group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
CharacterAnimator.hpp File Reference

Per-entity animator — state machine, sampling, blending, CPU skinning. More...

#include "AnimationLibrary.hpp"
#include "CharacterRig.hpp"
#include "SkinningBackend.hpp"
#include "ecs/components/AnimSnapshot.hpp"
#include "ecs/components/GripPose.hpp"
#include "ecs/components/WeaponHoldPose.hpp"
#include <array>
#include <glm/glm.hpp>
#include <glm/gtc/quaternion.hpp>
#include <memory>
#include <vector>
Include dependency graph for CharacterAnimator.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  AnimationInputs
 Driving inputs for the animation state machine. More...
struct  ClipSampler
 One active sampler slot contributing to the per-frame blend. More...
class  CharacterAnimator
 Per-entity animator. More...

Functions

float computeIdleGroundedMinY (const CharacterRig &rig, const AnimationLibrary &library, const glm::quat &orientationFix, float bindMeshMinY)
 Grounding reference that aligns the IDLE pose's feet with the floor.

Variables

static constexpr size_t kNumSamplerSlots = 5
 Number of sampler slots available for the per-frame blend.
static constexpr size_t kHandFingerIkCount = 5
 Number of fingers per hand.

Detailed Description

Per-entity animator — state machine, sampling, blending, CPU skinning.

Function Documentation

◆ computeIdleGroundedMinY()

float computeIdleGroundedMinY ( const CharacterRig & rig,
const AnimationLibrary & library,
const glm::quat & orientationFix,
float bindMeshMinY )
nodiscard

Grounding reference that aligns the IDLE pose's feet with the floor.

The renderer grounds a character by aligning the rig's bind-pose lowest vertex (bindMeshMinY) with the bottom of the collision AABB. Mixamo clips bend the knees slightly, so the animated feet sit a constant amount above the straight-legged T-pose bind — grounding off the bind makes every clip appear lifted by that amount. This samples the Idle clip once and returns bindMeshMinY shifted by the idle-vs-bind foot-joint Y delta, so all clips (which share the idle floor reference) sit on the ground. Falls back to bindMeshMinY if the rig has no recognisable foot joints or no Idle clip.

Parameters
orientationFixSame rotation passed to CharacterRig::loadFromFBX, so the bind foot positions are measured in the rendered frame.
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ kHandFingerIkCount

size_t kHandFingerIkCount = 5
staticconstexpr

Number of fingers per hand.

Iteration count for the FK finger pose applied in CharacterAnimator::applyWeaponHoldPose.

◆ kNumSamplerSlots

size_t kNumSamplerSlots = 5
staticconstexpr

Number of sampler slots available for the per-frame blend.

[0] locomotion primary (Idle / Walk / Run / RunBackward) [1] locomotion secondary (for 1-D speed band blend) [2] locomotion strafe (StrafeLeft/Right, WalkStrafe/RunStrafe) [3] override (Slide / WallRun / Jump / debug clip) [4] transition (short start / stop / pivot overlay)