15 pInternalNode->globalTransform(pInternalNode->localTransform());
21 pInternalNode->globalTransform() *=
parent->localTransform();
42 if (releaseAnimations)
60 for (
U32 i = 0u; i < animationCount; ++i)
63 const D64 duration = crtAnimation->duration();
66 for (
D64 ticks = 0; ticks < duration; ticks += tickStep)
74 transforms[a] = bone->offsetMatrix() * bone->globalTransform();
94 crtAnimation->initBuffers(gfxDevice);
108 return init(context);
148 return bone !=
nullptr ? bone->boneID() : -1;
156 const I32 frameIndex = std::max(
_animations[animationIndex]->frameIndexAt(dt)._curr - 1, 0);
194 const mat4<F32>& me = piNode->globalTransform();
198 Line& line = lines.emplace_back(s_line);
204 for (
const auto& bone : piNode->
_children) {
vector< BoneTransform > & transforms() noexcept
U32 frameCount() const noexcept
Bone * find(const string &name)
vector< Bone * > _children
Rough around the edges Adapter pattern abstracting the actual rendering API and access to the GPU.
static void UpdateTransforms(Bone *pNode)
U8 boneCount() const noexcept
vector< std::unique_ptr< AnimEvaluator > > _animations
A vector that holds each animation.
static I32 CreateSkeleton(Bone *piNode, const mat4< F32 > &parent, vector< Line > &lines)
Create animation skeleton.
const BoneTransform & transforms(const U32 animationIndex, const U32 index) const
bool init(PlatformContext &context, Bone *skeleton, const vector< Bone * > &bones)
This will build the skeleton based on the scene passed to it and CLEAR EVERYTHING.
U32 _maximumAnimationFrames
Frame count of the longest registered animation.
void calculate(U32 animationIndex, D64 pTime)
void release(bool releaseAnimations)
Frees all memory and initializes everything to a default state.
vector< vector< Line > > _skeletonLinesContainer
LineCollection _skeletonLines
Bone * boneByName(const string &name) const
const vector< Line > & skeletonLines(U32 animationIndex, D64 dt)
Renders the current skeleton pose at time index dt.
hashMap< U64, U32 > _animationNameToID
find animations quickly
I32 boneIndex(const string &bName) const
void buildBuffers(GFXDevice &gfxDevice)
Bone * _skeleton
Root node of the internal scene structure.
const vec4< T > & getRow(I32 index) const noexcept
Handle console commands that start with a forward slash.
constexpr U32 to_U32(const T value)
void CalculateBoneToWorldTransform(Bone *pInternalNode) noexcept
Calculates the global transformation matrix for the given internal node.
eastl::vector< Type > vector
static const vec3< F32 > VECTOR3_UNIT
constexpr I16 to_I16(const T value)
static constexpr F32 ANIMATION_TICKS_PER_SECOND
constexpr I32 to_I32(const T value)
static const mat4< F32 > MAT4_IDENTITY
static const vec3< F32 > VECTOR3_ZERO
static NO_INLINE void d_printfn(const char *format, T &&... args)
vec3< F32 > _positionStart