载入中...
搜索中...
未找到
Animation.cpp
浏览该文件的文档.
362FootIKSolver *Animation::newFootIKSolver(AnimSkeleton *skeleton) { return new FootIKSolver(skeleton); }
368AnimBoneMask* Animation::newBoneMask(AnimSkeleton* skeleton) { return new AnimBoneMask(skeleton); }
370AnimLayerMixer* Animation::newLayerMixer(AnimSkeleton* skeleton) { return new AnimLayerMixer(skeleton); }
388ControlPose *Animation::newControlPose(AnimSkeleton *skeleton) { return new ControlPose(skeleton); }
582 auto nextTick = hasLastTick_ ? lastTick_.incremented() : std::optional<eve::SimulationTick>(eve::SimulationTick(1));
585 eve::Diagnostic::error(eve::DiagnosticCode::InvariantViolation, "animation simulation tick overflow"))
740 "AnimConstraintStack", std::function<AnimConstraintStack *()>([]() -> AnimConstraintStack * { return nullptr; }),
752 "AnimSyncGroup", std::function<AnimSyncGroup *()>([]() -> AnimSyncGroup * { return nullptr; }), true);
879 "AnimBoneMask", std::function<AnimBoneMask*()>([]() -> AnimBoneMask* { return nullptr; }), true);
888 "AnimLayerMixer", std::function<AnimLayerMixer*()>([]() -> AnimLayerMixer* { return nullptr; }), true);
1029 "FootIKSolver", std::function<FootIKSolver *()>([]() -> FootIKSolver * { return nullptr; }), true);
1335 cls.addFunc("newSkeletonFromAnimationFixtureText", &Animation::newSkeletonFromAnimationFixtureText);
Fluent LitMotion-style builder that commits into MotionRuntime.
Dense motion storage advanced by Animation::advance(SimulationStep).
Squirrel GC wrappers for Motion builder / handle / sequence.
Lean LitMotion-style sequence: Append / Join / Insert / AppendInterval.
#define EV_PROFILE_MODULE(module, name)
Profile the enclosing scope, tagged with a module for grouping.
Definition Profile.h:140
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static Result< Duration > fromSeconds(double seconds)
Convert finite seconds to the nearest nanosecond.
Definition Time.cpp:16
void ignore(std::string_view reason={}) const noexcept
Explicitly discard this result after documenting the reason.
Definition Result.h:393
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.h:81
Parallel batch evaluator for independent character clip poses. Script type: AnimBatch.
Definition AnimBatch.h:13
void evaluate(int workerCount=0)
Evaluate queued poses, using hardware concurrency when workerCount is zero.
Definition AnimBatch.cpp:21
void add(AnimClip *clip, AnimSkeleton *skeleton, AnimPose *pose, float time, int lodLevel=0)
Queue one clip sample. The clip, skeleton and pose must outlive evaluate().
Definition AnimBatch.cpp:14
Per-bone weights used by override and additive animation layers.
Definition AnimLayerMixer.h:20
bool setBoneWeight(int boneIndex, float weight)
Set one bone's clamped weight.
Definition AnimLayerMixer.cpp:44
bool setBoneAndChildren(const std::string &boneName, float weight)
Set a bone and all descendants to the same clamped weight.
Definition AnimLayerMixer.cpp:54
bool setBoneWeightByName(const std::string &boneName, float weight)
Set a named bone's clamped weight.
Definition AnimLayerMixer.cpp:50
float getBoneWeight(int boneIndex) const
Return one bone's weight, or zero for an invalid index.
Definition AnimLayerMixer.cpp:67
int getBoneCount() const
Return the number of bones represented by this mask.
Definition AnimLayerMixer.h:36
static void registerPath(const std::string &path, AnimClip *clip)
Track a clip under a source path (keys are normalized).
Definition AnimClipRegistry.cpp:79
Keyframed skeletal animation clip (local TRS tracks per bone). Script type: AnimClip.
Definition AnimClip.h:145
Ordered main-thread post-process stack with aim, limb IK and foot planting.
Definition AnimConstraintStack.h:17
void setSkeleton(AnimSkeleton *skeleton)
Rebind the borrowed skeleton; changing it clears old index constraints.
Definition AnimConstraintStack.cpp:15
void addAim(int bone, float targetX, float targetY, float targetZ, float weight=1.f)
Append a weighted bone aim constraint.
Definition AnimConstraintStack.cpp:21
void addFootIK(int hip, int knee, int foot, float groundY, float normalX=0.f, float normalY=1.f, float normalZ=0.f, float soleOffset=0.f, float weight=1.f)
Plant a foot at groundY + soleOffset and orient its local +Z toward the ground normal.
Definition AnimConstraintStack.cpp:32
void apply(AnimPose *pose) const
Apply constraints in insertion order and refresh world transforms. Main-thread only.
Definition AnimConstraintStack.cpp:40
void addTwoBoneIK(int root, int mid, int tip, float targetX, float targetY, float targetZ, float weight=1.f)
Append a weighted two-bone IK constraint.
Definition AnimConstraintStack.cpp:26
AnimSkeleton * getSkeleton() const
Return the borrowed skeleton, or null after explicit unbinding. @ownership Borrowed; ownership remain...
Definition AnimConstraintStack.h:33
Composable runtime pose graph supporting clips, blends, additive layers, per-bone masks,...
Definition AnimGraph.h:26
void addBlendSpace2DPoint(int node, float x, float y, int child)
Adds blend space 2 d point.
Definition AnimGraph.cpp:99
AnimPose * getPose() override
Borrowed pointer accessor. @ownership Borrowed @lifetime Valid while the owning animation object rema...
Definition AnimGraph.h:97
void setBoneMask(int node, int boneIndex, float weight, bool includeChildren=false)
Sets the bone mask.
Definition AnimGraph.cpp:106
int addOneShot(int base, int shot, float fadeIn=0.1f, float fadeOut=0.1f)
Adds one shot.
Definition AnimGraph.cpp:77
void addBlendSpace1DPoint(int node, float x, int child)
Adds blend space 1 d point.
Definition AnimGraph.cpp:92
void update(float dt)
Legacy seconds facade; explicitly forwards to advance().
Definition AnimGraph.cpp:305
std::string getAdditiveReference(int node) const
Return "bind" / "identity", or empty for non-additive / invalid nodes.
Definition AnimGraph.cpp:180
bool setAdditiveReferenceCompat(int node, const std::string &reference)
Compatibility facade over setAdditiveReference.
Definition AnimGraph.cpp:171
static void importAnimationFixtureTextFile(const std::string &path, AnimSkeleton **skeletonOut, AnimClip **clipOut)
Load from an *.anim.txt fixture path.
Definition AnimImporter.cpp:173
void setDivisions(int divX, int divY, int divZ)
Changes divisions; resets all control points to identity and clears the bind.
Definition AnimLattice.cpp:43
float getDeformedPositionX(int vertexIndex) const
Cached deformed position component (requires updateDeformedPositions).
Definition AnimLattice.cpp:311
std::vector< float > getDeformedNormals() const
Copy of the cached deformed normals (xyz packed; empty when not updated).
Definition AnimLattice.cpp:337
std::vector< float > getDeformedPositions() const
Copy of the cached deformed positions (xyz packed; empty when not updated).
Definition AnimLattice.cpp:333
void setPointScale(int ix, int iy, int iz, float sx, float sy, float sz)
Per-control-point scale (squash / stretch about the lattice origin).
Definition AnimLattice.cpp:85
float getPointOffsetX(int ix, int iy, int iz) const
Returns the point offset x.
Definition AnimLattice.cpp:123
bool updateDeformedPositions()
Deform the bound bind positions into the internal cache.
Definition AnimLattice.cpp:288
float getBindPositionZ(int vertexIndex) const
Returns the bind position z.
Definition AnimLattice.cpp:164
void setOrigin(float ox, float oy, float oz)
Center of the lattice box in model space.
Definition AnimLattice.cpp:64
void setClamp(bool clamp)
When true (default), vertices outside the box are clamped to the boundary cells; when false,...
Definition AnimLattice.h:88
void bindModel(const model3d::ModelData *model, int meshIndex)
Binds the current lattice to meshIndex of model (uses current divisions).
Definition AnimLatticeFromModel.cpp:27
bool updateDeformedNormals(const std::vector< float > &posXYZ, const std::vector< float > &inNrmXYZ)
Deform packed xyz normals (with packed positions for cell lookup) into the internal normal cache.
Definition AnimLattice.cpp:296
float getPointScaleX(int ix, int iy, int iz) const
Returns the point scale x.
Definition AnimLattice.cpp:111
float getPointOffsetY(int ix, int iy, int iz) const
Returns the point offset y.
Definition AnimLattice.cpp:127
float getDeformedPositionY(int vertexIndex) const
Returns the deformed position y.
Definition AnimLattice.cpp:318
bool updateDeformedPositions(const std::vector< float > &inPosXYZ)
Deform an input packed xyz array into the internal cache (size vertexCount*3).
Definition AnimLattice.cpp:277
void setSize(float sx, float sy, float sz)
World-space size of the lattice box (components must be > 0).
Definition AnimLattice.cpp:55
float getDeformedPositionZ(int vertexIndex) const
Returns the deformed position z.
Definition AnimLattice.cpp:325
void setPointOffset(int ix, int iy, int iz, float dx, float dy, float dz)
Per-control-point translation offset (local bulge / pinch).
Definition AnimLattice.cpp:93
bool hasDeformedPositions() const
True after a successful updateDeformedPositions().
Definition AnimLattice.h:179
float getPointScaleY(int ix, int iy, int iz) const
Returns the point scale y.
Definition AnimLattice.cpp:115
void setScale(float sx, float sy, float sz)
Applies one scale to every control point (whole-lattice squash & stretch).
Definition AnimLattice.cpp:101
float getBindPositionX(int vertexIndex) const
Bind-pose position component for vertex v (0..vertexCount-1).
Definition AnimLattice.cpp:156
float getPointOffsetZ(int ix, int iy, int iz) const
Returns the point offset z.
Definition AnimLattice.cpp:131
void reset()
Resets every control point to identity (offset 0, scale 1).
Definition AnimLattice.cpp:109
bool hasDeformedNormals() const
True after a successful updateDeformedNormals().
Definition AnimLattice.h:182
float getPointScaleZ(int ix, int iy, int iz) const
Returns the point scale z.
Definition AnimLattice.cpp:119
void bindPositions(const float *posXYZ, int count)
Binds a packed xyz array (count * 3 floats). Uses current divisions/size/origin.
Definition AnimLattice.cpp:136
float getBindPositionY(int vertexIndex) const
Returns the bind position y.
Definition AnimLattice.cpp:160
Combines a borrowed base pose source with ordered override/additive layers.
Definition AnimLayerMixer.h:53
std::string getLayerMode(const std::string &name) const
Return "override" / "additive", or empty for unknown names.
Definition AnimLayerMixer.cpp:274
bool setBaseStateMachine(AnimStateMachine *stateMachine)
Compatibility facade over setBaseSource(AnimStateMachine*).
Definition AnimLayerMixer.cpp:141
void update(float dt)
Legacy seconds facade; explicitly forwards to advance().
Definition AnimLayerMixer.cpp:363
int addStateMachineLayer(const std::string &name, AnimStateMachine *stateMachine, AnimBoneMask *mask, const std::string &mode)
Compatibility facade over addPoseLayer(AnimStateMachine*).
Definition AnimLayerMixer.cpp:192
std::string getEventName(int index) const override
Returns the event name.
Definition AnimLayerMixer.cpp:377
int addLayer(const std::string &name, AnimPlayer *player, AnimBoneMask *mask, const std::string &mode)
Compatibility facade over addPoseLayer(AnimPlayer*).
Definition AnimLayerMixer.cpp:173
bool getLayerEnabled(const std::string &name) const
Return whether a layer is enabled; false for unknown names.
Definition AnimLayerMixer.cpp:269
AnimPose * getPose() override
Return the most recently combined pose. @ownership Borrowed @lifetime Valid while the owning animatio...
Definition AnimLayerMixer.h:132
bool setBaseGraph(AnimGraph *graph)
Compatibility facade over setBaseSource(AnimGraph*).
Definition AnimLayerMixer.cpp:132
std::string getLayerAdditiveReference(const std::string &name) const
Return "bind" / "identity", or empty for unknown names.
Definition AnimLayerMixer.cpp:280
bool setLayerAdditiveReferenceCompat(const std::string &name, const std::string &reference)
Compatibility facade over setLayerAdditiveReference.
Definition AnimLayerMixer.cpp:250
int addGraphLayer(const std::string &name, AnimGraph *graph, AnimBoneMask *mask, const std::string &mode)
Compatibility facade over addPoseLayer(AnimGraph*).
Definition AnimLayerMixer.cpp:182
std::string getLayerName(int index) const
Return a layer name, or empty for an invalid index.
Definition AnimLayerMixer.cpp:259
bool setLayerEnabled(const std::string &name, bool enabled)
Enable or disable a layer without removing it. Disabled layers still advance.
Definition AnimLayerMixer.cpp:229
bool setBasePlayer(AnimPlayer *player)
Compatibility facade over setBaseSource(AnimPlayer*).
Definition AnimLayerMixer.cpp:123
std::string getEventPayload(int index) const override
Returns the event payload.
Definition AnimLayerMixer.cpp:382
std::string getEventLayer(int index) const
Source layer name; "base" identifies the base source.
Definition AnimLayerMixer.cpp:372
AnimPlayer * getBasePlayer() const
Return the base when it is an AnimPlayer; otherwise null. @ownership Borrowed @lifetime Valid while t...
Definition AnimLayerMixer.cpp:150
float getLayerWeight(const std::string &name) const
Return a layer weight, or zero for an unknown name.
Definition AnimLayerMixer.cpp:264
bool setLayerWeight(const std::string &name, float weight)
Set a layer's global clamped weight.
Definition AnimLayerMixer.cpp:222
Single-clip (or cross-fading) 3D animation player. Script type: AnimPlayer.
Definition AnimPlayer.h:30
Evaluated local (and optional world) pose for an AnimSkeleton. Script type: AnimPose.
Definition AnimPose.h:17
float getLocalRotationX(int boneIndex) const
Returns the local rotation x.
Definition AnimPose.cpp:174
float getWorldRotationX(int boneIndex) const
Returns the world rotation x.
Definition AnimPose.cpp:350
float getWorldPositionZ(int boneIndex) const
Returns the world position z.
Definition AnimPose.cpp:346
float getLocalPositionZ(int boneIndex) const
Returns the local position z.
Definition AnimPose.cpp:170
float getWorldMatrixElement(int boneIndex, int elementIndex) const
Column-major 4x4 world matrix for boneIndex after computeWorld(). elementIndex in [0,...
Definition AnimPose.cpp:372
float getLocalPositionX(int boneIndex) const
Returns the local position x.
Definition AnimPose.cpp:162
float getLocalRotationW(int boneIndex) const
Returns the local rotation w.
Definition AnimPose.cpp:186
float getWorldPositionX(int boneIndex) const
Returns the world position x.
Definition AnimPose.cpp:338
void setLocalScale(int boneIndex, float x, float y, float z)
Sets the local scale.
Definition AnimPose.cpp:154
float getWorldPositionY(int boneIndex) const
Returns the world position y.
Definition AnimPose.cpp:342
void setLocalRotation(int boneIndex, float x, float y, float z, float w)
Sets the local rotation.
Definition AnimPose.cpp:144
float getWorldRotationW(int boneIndex) const
Returns the world rotation w.
Definition AnimPose.cpp:362
float getWorldRotationZ(int boneIndex) const
Returns the world rotation z.
Definition AnimPose.cpp:358
float getWorldRotationY(int boneIndex) const
Returns the world rotation y.
Definition AnimPose.cpp:354
float getLocalRotationZ(int boneIndex) const
Returns the local rotation z.
Definition AnimPose.cpp:182
void setLocalPosition(int boneIndex, float x, float y, float z)
Sets the local position.
Definition AnimPose.cpp:136
float getLocalPositionY(int boneIndex) const
Returns the local position y.
Definition AnimPose.cpp:166
float getLocalRotationY(int boneIndex) const
Returns the local rotation y.
Definition AnimPose.cpp:178
bool aimBone(const AnimSkeleton *skeleton, int boneIndex, float targetX, float targetY, float targetZ, float weight=1.f)
Rotate a bone so its local +Z axis aims at a world-space target.
Definition AnimPose.cpp:220
void computeWorld(const AnimSkeleton *skeleton)
Compute world transforms from local pose + skeleton hierarchy. World values readable via getWorld* af...
Definition AnimPose.cpp:203
bool solveTwoBoneIK(const AnimSkeleton *skeleton, int rootBone, int midBone, int tipBone, float targetX, float targetY, float targetZ, float weight=1.f)
Analytically solve a root-mid-tip chain toward a world-space target.
Definition AnimPose.cpp:237
3D bone hierarchy + bind-pose local TRS for skeletal animation. Independent of ik::Skeleton3D (FABRIK...
Definition AnimSkeleton.h:16
float getBindPositionY(int boneIndex) const
Returns the bind position y.
Definition AnimSkeleton.cpp:90
void setBindPosition(int boneIndex, float x, float y, float z)
Sets the bind position.
Definition AnimSkeleton.cpp:49
float getBindPositionZ(int boneIndex) const
Returns the bind position z.
Definition AnimSkeleton.cpp:94
float getBindRotationW(int boneIndex) const
Returns the bind rotation w.
Definition AnimSkeleton.cpp:110
float getBindRotationY(int boneIndex) const
Returns the bind rotation y.
Definition AnimSkeleton.cpp:102
float getBindPositionX(int boneIndex) const
Returns the bind position x.
Definition AnimSkeleton.cpp:86
float getBindRotationZ(int boneIndex) const
Returns the bind rotation z.
Definition AnimSkeleton.cpp:106
float getBindRotationX(int boneIndex) const
Returns the bind rotation x.
Definition AnimSkeleton.cpp:98
int getBoneLodLimit(int boneIndex) const
Highest LOD at which the bone is sampled; defaults to all LODs.
Definition AnimSkeleton.cpp:81
void setBoneLodLimit(int boneIndex, int highestLod)
Set the highest animation LOD at which this bone is sampled (0 = full-detail only)....
Definition AnimSkeleton.cpp:75
void setBindScale(int boneIndex, float x, float y, float z)
Sets the bind scale.
Definition AnimSkeleton.cpp:67
void setBindRotation(int boneIndex, float x, float y, float z, float w)
Sets the bind rotation.
Definition AnimSkeleton.cpp:57
void applyBindPose(class AnimPose *pose) const
Fill pose locals with bind pose.
Definition AnimSkeleton.cpp:132
int addBone(const std::string &name, int parentIndex=-1)
Append a bone. parentIndex = -1 for root.
Definition AnimSkeleton.cpp:14
int getSkeletonBone(int skinBoneIndex) const
Skeleton bone index used by skin joint i (-1 if unused).
Definition AnimSkin.cpp:104
bool applyToMesh(graphics::Graphics *gfx, graphics::Mesh *mesh, const AnimPose *pose)
Skin positions (and normals when available) and write the result back to a GPU mesh in one call....
Definition AnimSkin.cpp:341
float getInverseBindElement(int skinBoneIndex, int elementIndex) const
Inverse-bind matrix element (column-major, 0..15) for skin joint i.
Definition AnimSkin.cpp:114
std::vector< float > getSkinnedPositions() const
Packed skinned positions (xyz, vertexCount*3) as a copy. Empty when updateSkinnedPositions() has not ...
Definition AnimSkin.cpp:274
float getSkinnedPositionX(int vertexIndex) const
Cached skinned position component (requires updateSkinnedPositions).
Definition AnimSkin.cpp:258
bool updateMatrixPalette(const AnimPose *pose) const
Build and cache the column-major skinning matrix palette for a pose. The palette contains boneWorld *...
Definition AnimSkin.cpp:122
float getBindPositionX(int vertexIndex) const
Bind-pose (unskinned) position component for vertex v (0..vertexCount-1).
Definition AnimSkin.cpp:168
int getVertexBone(int vertexIndex, int influenceIndex) const
Influence slot i (0..3) for vertex: skeleton bone index or -1.
Definition AnimSkin.cpp:181
bool hasSkinnedPositions() const
True after a successful updateSkinnedPositions().
Definition AnimSkin.h:122
bool updateSkinnedPositions(const AnimPose *pose)
Skin into an internal cache readable via getSkinnedPosition*. Returns false if pose is null or there ...
Definition AnimSkin.cpp:247
float getMatrixPaletteElement(int skinBoneIndex, int elementIndex) const
Cached palette element for one skin bone (elementIndex 0..15).
Definition AnimSkin.cpp:135
bool updateSkinnedNormals(const AnimPose *pose)
Skin the bind-pose normals captured at fromModel with the pose. pose must already have computeWorld(s...
Definition AnimSkin.cpp:279
float getVertexWeight(int vertexIndex, int influenceIndex) const
Returns the vertex weight.
Definition AnimSkin.cpp:198
std::string getSkinBoneName(int skinBoneIndex) const
Returns the skin bone name.
Definition AnimSkin.cpp:109
bool hasSkinnedNormals() const
True after a successful updateSkinnedNormals().
Definition AnimSkin.h:146
bool bindGpuMesh(graphics::Graphics *gfx, graphics::Mesh *mesh)
Upload this skin's joint/weight vertex stream to an existing GPU mesh.
Definition AnimSkin.cpp:144
std::vector< float > getSkinnedNormals() const
Packed skinned normals (xyz, vertexCount*3) as a copy.
Definition AnimSkin.cpp:336
float getBindPositionZ(int vertexIndex) const
Returns the bind position z.
Definition AnimSkin.cpp:176
bool updateGpuMesh(graphics::Mesh *mesh, const AnimPose *pose) const
Update a bound GPU mesh's matrix palette from a world-computed pose.
Definition AnimSkin.cpp:163
int getVertexSkinJoint(int vertexIndex, int influenceIndex) const
Influence slot i (0..3) for vertex: skin-local joint index or -1.
Definition AnimSkin.cpp:191
float getSkinnedPositionZ(int vertexIndex) const
Returns the skinned position z.
Definition AnimSkin.cpp:268
float getSkinnedPositionY(int vertexIndex) const
Returns the skinned position y.
Definition AnimSkin.cpp:263
float getBindPositionY(int vertexIndex) const
Returns the bind position y.
Definition AnimSkin.cpp:172
Clip-driven animation state machine with float/bool/trigger parameters and cross-fade transitions....
Definition AnimStateMachine.h:23
void setHasExitTime(int transitionId, bool enabled)
Sets the has exit time.
Definition AnimStateMachine.cpp:181
int addTransition(const std::string &from, const std::string &to, float blendSeconds)
Add transition from → to with blend duration.
Definition AnimStateMachine.cpp:126
void addTriggerCondition(int transitionId, const std::string ¶m)
Adds trigger condition.
Definition AnimStateMachine.cpp:165
void update(float dt)
Legacy seconds facade retained for scripts and old callers.
Definition AnimStateMachine.cpp:323
void addBoolCondition(int transitionId, const std::string ¶m, bool value)
Adds bool condition.
Definition AnimStateMachine.cpp:154
void addFloatCondition(int transitionId, const std::string ¶m, const std::string &op, float threshold)
Comparison op: ">", ">=", "<", "<=", "==", "!=".
Definition AnimStateMachine.cpp:141
void setFloat(const std::string &name, float value)
Sets the float.
Definition AnimStateMachine.cpp:185
void addState(const std::string &name, AnimClip *clip)
Adds state.
Definition AnimStateMachine.cpp:103
AnimPose * getPose() override
Borrowed pointer accessor. @ownership Borrowed @lifetime Valid while the owning animation object rema...
Definition AnimStateMachine.cpp:203
void setExitTime(int transitionId, float normalizedTime)
Optional: require normalized local time in [0,1] >= exitTime before transition.
Definition AnimStateMachine.cpp:175
Marker-aware synchronization group for locomotion animation players.
Definition AnimSyncGroup.h:13
void update(float dt)
Legacy seconds facade; explicitly forwards to advance().
Definition AnimSyncGroup.cpp:69
bool getUsedMarkerSync() const
Whether the latest update used compatible sync markers for at least one follower.
Definition AnimSyncGroup.h:32
void addPlayer(AnimPlayer *player, float phaseOffset=0.f)
Adds player.
Definition AnimSyncGroup.cpp:12
Motion trail / afterimage recorder + 2D trajectory drawer.
Definition AnimTrail.h:34
void setDuration(float seconds)
How long each sample lives (seconds). <= 0 keeps until capacity eviction.
Definition AnimTrail.cpp:29
void setCapacity(int capacity)
Max retained samples (ring). Clamped to >= 2.
Definition AnimTrail.cpp:21
void update(float dt)
Legacy seconds facade; explicitly forwards to advance().
Definition AnimTrail.cpp:167
void addPoint3(float x, float y, float z)
Append a 3D sample (draw uses set plane / first two mapped axes via sampleBone).
Definition AnimTrail.cpp:80
void setMinDistance(float distance)
Skip new samples closer than this distance to the newest point (0 = always add).
Definition AnimTrail.cpp:33
void draw(graphics::Graphics *gfx)
Draw trajectory in 2D pixel/world space via Graphics.
Definition AnimTrail.cpp:255
void setColor(float r, float g, float b, float a=1.f)
Head (newest) color; alpha fades toward 0 along the trail when fade is on.
Definition AnimTrail.cpp:43
void sampleBone(const AnimPose *pose, int boneIndex, const std::string &plane="xy")
Sample bone world position after pose->computeWorld. plane maps axes to draw (x,y): "xy" | "xz" | "yz...
Definition AnimTrail.cpp:103
void setStyle(const std::string &style)
"line" | "points". Invalid → exception.
Definition AnimTrail.cpp:52
float getPointAlpha(int index) const
Effective draw alpha in [0, colorA] after fade.
Definition AnimTrail.cpp:208
float getPointX(int index) const
Index 0 = oldest retained sample; count-1 = newest.
Definition AnimTrail.cpp:182
void setDrawScale(float sx, float sy)
Applied at draw time: screen = (x,y) * scale + offset. Useful when sampling bone world units into pix...
Definition AnimTrail.cpp:68
void sampleBoneOffset(const AnimPose *pose, int boneIndex, float ox, float oy, float oz, const std::string &plane="xy")
Sample bone offset.
Definition AnimTrail.cpp:107
Animation module — tween factory + 2D sprite-sheet / Spine + 3D skeletal playback (player / state mac...
Definition Animation.h:80
PhysicalBalancePose * newPhysicalBalancePose(AnimSkeleton *skeleton)
Impulse-driven balance overlay that wobbles then recovers toward the authored pose.
Definition Animation.cpp:390
MotionVec2Builder motionVec2(MotionVec2 from, MotionVec2 to, float duration)
LitMotion-style Vec2 motion builder.
Definition Animation.cpp:421
SpriteSheet * newSpriteSheetFromSequence(eve::graphics::Graphics *gfx, const std::string &pattern, int first, int last, int columns=0)
Load numbered PNG files into a runtime atlas and return its frame table. Pattern must contain {n},...
Definition Animation.cpp:124
SpriteSheet * newSpriteSheetFromAtlasJson(eve::graphics::Graphics *gfx, const std::string &texturePath, const std::string &jsonPath)
Import Aseprite/TexturePacker JSON frame metadata and its atlas texture.
Definition Animation.cpp:228
AnimConstraintStack * newConstraintStack(AnimSkeleton *skeleton)
Create an ordered procedural constraint stack.
Definition Animation.cpp:333
MotionVec2Builder shakeVec2(MotionVec2 from, MotionVec2 strength, float duration)
Vec2 shake builder.
Definition Animation.cpp:443
Tween * newTween(float duration=1.f)
Create a tween (duration in seconds). Returned pointer is owned by script GC.
Definition Animation.cpp:116
AnimClip * newClipFromAnimationFixtureText(const std::string &path)
Load an animation clip from an internal *.anim.txt test fixture.
Definition Animation.cpp:402
int setupHairChain(DynamicBoneSolver *solver, const std::string &rootBone, const std::string &tipBone, float stiffness=0.12f, float damping=0.18f, float inertia=0.8f, float endLength=0.08f, bool selfCollision=true)
Add a hair/tail spring chain with card-friendly defaults.
Definition Animation.cpp:340
int getSpriteSequenceCacheCount() const
Number of decoded runtime sequence atlases retained for reuse.
Definition Animation.cpp:217
AnimPose * newPose(int boneCount=0)
Creates a pose. @ownership Caller deletes unless documented otherwise.
Definition Animation.cpp:331
AnimLattice * newLattice(int divX=2, int divY=2, int divZ=2)
3D lattice scale-deformer (晶格缩放变形). divX/divY/divZ are the control-point divisions (each >= 2)....
Definition Animation.cpp:411
MotionBuilder punch(float from, float strength, float duration)
Definition Animation.cpp:431
SpineAtlas * newSpineAtlasFromFile(const std::string &path)
Load helpers (allocate + parse; false → empty object still returned? prefer nullable).
Definition Animation.cpp:287
void clearSpriteSequenceCache()
Drop cache metadata; existing returned sheets/textures remain valid.
Definition Animation.cpp:226
MotionVec2Builder punchVec2(MotionVec2 from, MotionVec2 strength, float duration)
Vec2 punch builder.
Definition Animation.cpp:439
void update(float dt)
Legacy seconds facade; invalid input is explicitly consumed and ignored.
Definition Animation.cpp:575
AnimBoneMask * newBoneMask(AnimSkeleton *skeleton)
Create a zero-weight per-bone animation mask.
Definition Animation.cpp:368
eve::Result< void > advance(const eve::SimulationStep &step)
Advance all registered tweens, motions, sprite anims, and spine anims.
Definition Animation.cpp:506
AnimTrail * newTrail(int capacity=64)
Motion trail / afterimage (script GC owns returned object). capacity: max retained samples (>= 2).
Definition Animation.cpp:415
SpineSkeleton * newSpineSkeleton(SpineSkeletonData *data)
Creates a spine skeleton. @ownership Caller deletes unless documented otherwise.
Definition Animation.cpp:277
SpriteClip * newSpriteClip(const std::string &name="")
Creates a sprite clip. @ownership Caller deletes unless documented otherwise.
Definition Animation.cpp:265
AnimGraph * newGraph(AnimSkeleton *skeleton)
Create a composable pose graph for the skeleton.
Definition Animation.cpp:366
int getSpriteSequenceCacheBytes() const
Approximate RGBA8 bytes retained by cached sequence atlases.
Definition Animation.cpp:218
AnimSkeleton * newSkeleton()
3D skeletal animation factories (script GC owns returned objects).
Definition Animation.cpp:327
ControlAnim * newControlAnim(float frequencyHz=3.f, float dampingZeta=1.f, float response=1.f)
Control-theory procedural animation (second-order / spring / PD). frequencyHz: natural frequency f (H...
Definition Animation.cpp:384
void clearAll()
Detach all tweens from the registry (does not delete Tween objects).
Definition Animation.cpp:619
AnimClip * newClip(const std::string &name="")
Creates a clip. @ownership Caller deletes unless documented otherwise.
Definition Animation.cpp:329
MotionDatabase * newMotionDatabase(AnimSkeleton *skeleton)
Creates a motion database. @ownership Caller deletes unless documented otherwise.
Definition Animation.cpp:376
SpineSkeletonData * newSpineSkeletonDataFromJson(const std::string &json)
Creates a spine skeleton data from json. @ownership Caller deletes unless documented otherwise.
Definition Animation.cpp:317
AnimPlayer * newPlayer(AnimSkeleton *skeleton)
Creates a player. @ownership Caller deletes unless documented otherwise.
Definition Animation.cpp:365
AnimStateMachine * newStateMachine(AnimSkeleton *skeleton)
Creates a state machine. @ownership Caller deletes unless documented otherwise.
Definition Animation.cpp:372
SpriteAnim * newSpriteAnim()
Creates a sprite anim. @ownership Caller deletes unless documented otherwise.
Definition Animation.cpp:267
MotionVec3Builder motionVec3(MotionVec3 from, MotionVec3 to, float duration)
LitMotion-style Vec3 motion builder.
Definition Animation.cpp:425
int setupHairHeadCollider(DynamicBoneSolver *solver, const std::string &boneName, float radius=0.12f)
Attach a head sphere collider for hair chains.
Definition Animation.cpp:356
MotionColorBuilder motionColor(MotionColor from, MotionColor to, float duration)
Color tween builder (lerp).
Definition Animation.cpp:455
AnimLayerMixer * newLayerMixer(AnimSkeleton *skeleton)
Create an override/additive animation layer mixer.
Definition Animation.cpp:370
DynamicBoneSolver * newDynamicBoneSolver(AnimSkeleton *skeleton)
Create a dynamic bone solver for spring-damped chains. @ownership Returned object is owned by script ...
Definition Animation.cpp:336
MotionQuatBuilder motionQuat(MotionQuat from, MotionQuat to, float duration)
Quaternion tween builder (slerp).
Definition Animation.cpp:459
SpriteSheet * newSpriteSheet()
2D sprite-sheet animation factories (script GC owns returned objects).
Definition Animation.cpp:122
AnimSyncGroup * newSyncGroup()
Create a normalized-time player synchronization group.
Definition Animation.cpp:363
MotionVec3Builder shakeVec3(MotionVec3 from, MotionVec3 strength, float duration)
Vec3 shake builder.
Definition Animation.cpp:451
MotionBuilder shake(float from, float strength, float duration)
LitMotion-style shake (punch with deterministic random signs).
Definition Animation.cpp:435
SpineSkeletonData * newSpineSkeletonData()
Creates a spine skeleton data. @ownership Caller deletes unless documented otherwise.
Definition Animation.cpp:275
MotionMatcher * newMotionMatcher(AnimSkeleton *skeleton, MotionDatabase *database)
Creates a motion matcher. @ownership Caller deletes unless documented otherwise.
Definition Animation.cpp:380
void clearFinished()
Drop finished/stopped entries from the registry (does not delete Tween objects).
Definition Animation.cpp:606
SpineAnim * newSpineAnim(SpineSkeleton *skeleton)
Creates a spine anim. @ownership Caller deletes unless documented otherwise.
Definition Animation.cpp:281
AnimSkeleton * newSkeletonFromAnimationFixtureText(const std::string &path)
Load a skeleton from an internal *.anim.txt test fixture.
Definition Animation.cpp:394
ControlPose * newControlPose(AnimSkeleton *skeleton)
Creates a control pose. @ownership Caller deletes unless documented otherwise.
Definition Animation.cpp:388
MotionBuilder motion(float from, float to, float duration)
Definition Animation.cpp:417
SpineAtlas * newSpineAtlasFromText(const std::string &text)
Creates a spine atlas from text. @ownership Caller deletes unless documented otherwise.
Definition Animation.cpp:297
MotionVec3Builder punchVec3(MotionVec3 from, MotionVec3 strength, float duration)
Vec3 punch builder.
Definition Animation.cpp:447
SpineSkeletonData * newSpineSkeletonDataFromFile(const std::string &path)
Creates a spine skeleton data from file. @ownership Caller deletes unless documented otherwise.
Definition Animation.cpp:307
FootIKSolver * newFootIKSolver(AnimSkeleton *skeleton)
Create a paired-foot IK solver for a borrowed skeleton. @ownership Returned object is owned by script...
Definition Animation.cpp:362
Control-theory procedural animation for named scalar properties.
Definition ControlAnim.h:25
void set(const std::string &name, float value)
Create/update a channel: current value snaps to value, velocity cleared.
Definition ControlAnim.cpp:66
void setTarget(const std::string &name, float value)
Move the tracking target (does not snap state). Creates channel if missing.
Definition ControlAnim.cpp:77
std::string getPropertyName(int index) const
Returns the property name.
Definition ControlAnim.cpp:128
void setIntegrator(const std::string &kind)
Integrator: "secondOrder" | "spring" | "pd". Invalid → exception.
Definition ControlAnim.cpp:30
void update(float dt)
Legacy seconds facade; explicitly forwards to advance().
Definition ControlAnim.cpp:171
void setTargetVelocity(const std::string &name, float velocity)
Optional explicit target velocity (used by secondOrder / pd).
Definition ControlAnim.cpp:88
void impulse(const std::string &name, float deltaVelocity)
Inject an instantaneous velocity impulse (procedural “hit”).
Definition ControlAnim.cpp:94
Control-theory procedural pose driver: tracks a target AnimPose with per-channel second-order / sprin...
Definition ControlPose.h:23
void setBoneWeight(int boneIndex, float weight)
Per-bone blend weight in [0,1]; 1 = full dynamics, 0 = hard snap to target.
Definition ControlPose.cpp:77
void update(float dt)
Legacy seconds facade; explicitly forwards to advance().
Definition ControlPose.cpp:312
void setTargetPose(const AnimPose *target)
Copy target pose. Channels without prior state snap; existing state keeps momentum.
Definition ControlPose.cpp:131
void snapToTarget()
Snap current state to the last target without changing the target.
Definition ControlPose.cpp:141
World-space spring-chain solver that writes results as local bone rotations.
Definition DynamicBoneSolver.h:37
void setObjectMoveResponse(float value)
Set how much simulated particles follow root translation, from zero to one.
Definition DynamicBoneSolver.cpp:105
void setColliderInside(int index, bool inside)
Select inside containment or outside exclusion for a collider.
Definition DynamicBoneSolver.cpp:117
void setChainParticleParameters(int chainIndex, int particleIndex, float stiffness, float damping, float inertia, float gravityScale, float radius)
Override simulation parameters for one chain particle, where zero is the root.
Definition DynamicBoneSolver.cpp:89
int addChain(int rootBone, int endBone, float stiffness, float damping, float inertia, float gravityScale=1.f, float radius=0.f, int iterations=4)
Add an ancestor-to-descendant spring chain.
Definition DynamicBoneSolver.cpp:71
void setColliderRadius(int index, float radius)
Change a collider radius; non-positive values are ignored.
Definition DynamicBoneSolver.cpp:118
void setDistanceLimit(float value)
Set sleep distance; zero disables distance sleeping.
Definition DynamicBoneSolver.cpp:107
void setWeight(float weight)
Set final rotation blend weight in [0, 1].
Definition DynamicBoneSolver.cpp:102
void addBoneColliderCapsule(int boneIndex, float startX, float startY, float startZ, float endX, float endY, float endZ, float radius)
Add a capsule whose endpoints follow bone-local offsets.
Definition DynamicBoneSolver.cpp:112
void addColliderSphere(float centerX, float centerY, float centerZ, float radius)
Add a fixed model-space sphere collider; non-positive radii are ignored.
Definition DynamicBoneSolver.cpp:109
void clearChainEnd(int chainIndex)
Remove a chain's virtual terminal particle.
Definition DynamicBoneSolver.cpp:99
float getTeleportThreshold() const
Return teleport reset distance; zero disables it.
Definition DynamicBoneSolver.h:130
float getObjectMoveResponse() const
Return root translation response.
Definition DynamicBoneSolver.h:134
void addColliderCapsule(float startX, float startY, float startZ, float endX, float endY, float endZ, float radius)
Add a fixed model-space capsule collider.
Definition DynamicBoneSolver.cpp:111
void setTeleportThreshold(float distance)
Set root movement distance that triggers a simulation reset.
Definition DynamicBoneSolver.cpp:104
void setUpdateRate(float updatesPerSecond)
Set preferred simulation frequency; zero means one step per update.
Definition DynamicBoneSolver.cpp:103
void setChainEndOffset(int chainIndex, float x, float y, float z)
Add a virtual particle at a last-bone-local offset; this replaces end length mode.
Definition DynamicBoneSolver.cpp:98
void update(AnimPose *pose, float dt)
Simulate one frame using injected dt and update pose local rotations.
Definition DynamicBoneSolver.cpp:235
void setColliderEnabled(int index, bool enabled)
Enable or disable a collider without changing its index.
Definition DynamicBoneSolver.cpp:116
void reset()
Reset all chains to the animated pose on their next update.
Definition DynamicBoneSolver.cpp:119
bool isChainSleeping(int chainIndex) const
Return whether a valid chain is currently distance-sleeping.
Definition DynamicBoneSolver.cpp:108
void setExternalForce(float x, float y, float z)
Set additional model-space acceleration such as wind.
Definition DynamicBoneSolver.cpp:101
void setGlobalGravity(float x, float y, float z)
Set model-space gravity acceleration.
Definition DynamicBoneSolver.cpp:100
void removeCollider(int index)
Remove a valid collider index; invalid indices are ignored.
Definition DynamicBoneSolver.cpp:115
bool isChainEnabled(int chainIndex) const
Return enabled state, or false for an invalid index.
Definition DynamicBoneSolver.cpp:86
void setChainSelfCollision(int chainIndex, bool enabled)
Enable or disable non-adjacent particle self-collision for a chain.
Definition DynamicBoneSolver.cpp:88
void setDistanceReference(float x, float y, float z)
Set the model-space point used for distance-based sleeping.
Definition DynamicBoneSolver.cpp:106
void setChainEndLength(int chainIndex, float length)
Add a virtual particle after the last bone along the animated terminal direction.
Definition DynamicBoneSolver.cpp:97
void setChainEnabled(int chainIndex, bool enabled)
Set a valid chain's enabled state; invalid indices are ignored.
Definition DynamicBoneSolver.cpp:85
void addBoneColliderSphere(int boneIndex, float offsetX, float offsetY, float offsetZ, float radius)
Add a sphere collider following a bone-local offset.
Definition DynamicBoneSolver.cpp:110
int addChainByName(const std::string &rootBone, const std::string &endBone, float stiffness, float damping, float inertia, float gravityScale=1.f, float radius=0.f, int iterations=4)
Name-based addChain variant; returns -1 for invalid input.
Definition DynamicBoneSolver.cpp:79
void setChainFreezeAxis(int chainIndex, int axis)
Restrict a chain to its animated model-space plane.
Definition DynamicBoneSolver.cpp:87
Paired-foot IK with contact smoothing and pelvis compensation.
Definition FootIKSolver.h:32
void setMinGroundNormalY(float value)
Set minimum accepted upward normal cosine in [0, 1].
Definition FootIKSolver.cpp:60
void setMaxPelvisOffset(float distance)
Set maximum pelvis compensation distance.
Definition FootIKSolver.cpp:59
void setGroundQuery(float startHeight, float distance)
Set ray origin height and downward query distance.
Definition FootIKSolver.cpp:45
void configureLeftToe(int toe, float soleOffset=0.f)
Configure an optional left toe child and its sole offset.
Definition FootIKSolver.cpp:43
void configureRightLeg(int hip, int knee, int foot, float soleOffset=0.f)
Configure the right hip-knee-foot chain and sole offset.
Definition FootIKSolver.cpp:37
void setFootLockEnabled(bool enabled)
Enable or disable world-space foot locking.
Definition FootIKSolver.cpp:64
bool isLeftFootLocked() const
Return whether the left foot is currently locked.
Definition FootIKSolver.h:95
void setRightContact(bool hit, float x, float y, float z, float nx, float ny, float nz, float weight=1.f)
Supply the right model-space ground contact.
Definition FootIKSolver.cpp:56
void setPositionResponse(float value)
Set contact interpolation response in inverse seconds.
Definition FootIKSolver.cpp:61
void setRotationResponse(float value)
Set foot-normal interpolation response in inverse seconds.
Definition FootIKSolver.cpp:62
void setContactGraceTime(float seconds)
Set how long a missing automatic contact retains its prior target.
Definition FootIKSolver.cpp:63
void apply(AnimPose *pose, float dt)
Apply using injected delta time and owning contact values.
Definition FootIKSolver.cpp:112
bool isRightFootLocked() const
Return whether the right foot is currently locked.
Definition FootIKSolver.h:97
void setFootLockThresholds(float enterWeight, float exitWeight)
Set lock enter and release contact-weight thresholds.
Definition FootIKSolver.cpp:65
void configureLeftLeg(int hip, int knee, int foot, float soleOffset=0.f)
Configure the left hip-knee-foot chain and sole offset.
Definition FootIKSolver.cpp:36
void configureRightToe(int toe, float soleOffset=0.f)
Configure an optional right toe child and its sole offset.
Definition FootIKSolver.cpp:44
void setLeftContact(bool hit, float x, float y, float z, float nx, float ny, float nz, float weight=1.f)
Supply the left model-space ground contact.
Definition FootIKSolver.cpp:53
AnimSkeleton * getSkeleton() const
Return the borrowed skeleton, or null. @ownership Borrowed; ownership remains with the animation sour...
Definition FootIKSolver.h:49
void setSkeleton(AnimSkeleton *skeleton)
Rebind; changing skeleton clears all bone-index configuration.
Definition FootIKSolver.cpp:19
Configure then bind/run a float motion into a MotionRuntime.
Definition MotionBuilder.h:26
MotionBuilder & style(MotionStyle style)
Select Tween / Punch / Shake evaluation.
Definition MotionBuilder.cpp:226
Color fluent builder (Tween / lerp only).
Definition MotionBuilder.h:190
Baked motion-matching feature database from one or more AnimClips. Feature layout per frame: [0....
Definition MotionDatabase.h:39
Runtime motion matching player: builds a query feature from current pose + desired trajectory,...
Definition MotionMatcher.h:66
Quaternion fluent builder (Tween / slerp only).
Definition MotionBuilder.h:231
int activeCount() const noexcept
Definition MotionRuntime.cpp:692
eve::Result< void > advance(const eve::SimulationStep &step)
Definition MotionRuntime.cpp:707
eve::SimulationTick currentTick() const noexcept
Definition MotionRuntime.h:176
bool hasCurrentTick() const noexcept
Definition MotionRuntime.h:175
Schedule unspawned builders onto a shared MotionRuntime timeline.
Definition MotionSequence.h:62
MotionVec2Builder & style(MotionStyle style)
Select Tween / Punch / Shake evaluation.
Definition MotionBuilder.cpp:243
MotionVec3Builder & style(MotionStyle style)
Select Tween / Punch / Shake evaluation.
Definition MotionBuilder.cpp:260
Authored-pose overlay that wobbles from world impulses and recovers balance.
Definition PhysicalBalancePose.h:30
Spine animation player + 2D draw collector (region attachments).
Definition SpineAnim.h:35
void apply()
Apply current animation time to skeleton and update world transforms.
Definition SpineAnim.cpp:214
void setPageTexture(int pageIndex, graphics::Texture *texture)
Bind a GPU texture to an atlas page (by index or page image name).
Definition SpineAnim.cpp:36
graphics::Texture * getPageTexture(int pageIndex) const
Returns the page texture.
Definition SpineAnim.cpp:56
void setPageTextureByName(const std::string &pageName, graphics::Texture *texture)
Sets the page texture by name.
Definition SpineAnim.cpp:45
bool update(float dt)
Legacy seconds facade; explicitly forwards to advance().
Definition SpineAnim.cpp:303
int getDrawSlotCount() const
Query posed draw slots without textures (for unit tests). Returns number of visible region attachment...
Definition SpineAnim.cpp:460
float getDrawSlotRotation(int index) const
Returns the draw slot rotation.
Definition SpineAnim.cpp:478
std::string getDrawSlotRegion(int index) const
Returns the draw slot region.
Definition SpineAnim.cpp:486
void setFlipY(bool flip)
When true (default), Spine Y-up is flipped for screen Y-down draw items.
Definition SpineAnim.h:83
void draw(graphics::Graphics *gfx)
Draw the current pose into an existing frame without clearing or presenting it.
Definition SpineAnim.cpp:314
Esoteric Spine .atlas text parser (region rectangles + page metadata). Does not load image pixels — b...
Definition SpineAtlas.h:16
Spine skeleton JSON data (bones / slots / skins / animations).
Definition SpineSkeletonData.h:23
float getAnimationDuration(int index) const
Returns the animation duration.
Definition SpineSkeletonData.cpp:148
std::string getAnimationName(int index) const
Returns the animation name.
Definition SpineSkeletonData.cpp:144
Runtime Spine skeleton pose (local + world bone transforms, slot attachments). Script type: SpineSkel...
Definition SpineSkeleton.h:16
float getBoneWorldRotation(int index) const
Returns the bone world rotation.
Definition SpineSkeleton.cpp:147
std::string getSlotAttachmentName(int slotIndex) const
Returns the slot attachment name.
Definition SpineSkeleton.cpp:169
void setSlotAttachmentName(int slotIndex, const std::string &name)
Sets the slot attachment name.
Definition SpineSkeleton.cpp:174
void bindQuad(graphics::Quad *quad)
Keep this Quad's viewport updated each update/play.
Definition SpriteAnim.cpp:175
bool update(float dt)
Legacy seconds facade; explicitly forwards to advance().
Definition SpriteAnim.cpp:300
bool consumeCompleted()
Consume and clear the one-shot completion event.
Definition SpriteAnim.cpp:138
void resetSpeedCurve()
Restart speed-curve sampling from zero without changing clip time.
Definition SpriteAnim.cpp:80
void setSpeedCurveInterpolation(const std::string &mode)
Set speed-curve interpolation: linear, smooth, or cubic.
Definition SpriteAnim.cpp:110
void clearSpeedCurve()
Remove all speed-curve keys and restore constant-speed playback.
Definition SpriteAnim.cpp:75
void setSheet(SpriteSheet *sheet)
Optional sheet used by applyToQuad / bindQuad.
Definition SpriteAnim.cpp:22
int getLoopCount() const
Return loop boundaries crossed since play started.
Definition SpriteAnim.h:94
void addSpeedCurveKey(float seconds, float multiplier)
Add a piecewise-linear speed multiplier key at curve time in seconds.
Definition SpriteAnim.cpp:68
float getSpeedCurveValue() const
Return the current sampled curve multiplier.
Definition SpriteAnim.cpp:108
int getClipFrame() const
Index inside the current clip (0..clipFrameCount-1), or -1.
Definition SpriteAnim.h:103
void bindSprite(graphics::Renderable2D *sprite)
Bind a Sprite2D so trimmed frame layout is synchronized automatically.
Definition SpriteAnim.cpp:181
void applyToQuad(graphics::Quad *quad) const
Write current sheet frame into quad (requires sheet).
Definition SpriteAnim.cpp:183
void playReverse(SpriteClip *clip)
Start at the clip end and play backward (speed becomes negative).
Definition SpriteAnim.cpp:39
int consumeLooped()
Consume and clear pending loop events, returning their count.
Definition SpriteAnim.cpp:144
void setSpeedCurveLoop(bool loop)
Choose whether speed-curve time wraps after its last key.
Definition SpriteAnim.h:63
int getSheetFrame() const
Sheet frame index for the current cell, or -1.
Definition SpriteAnim.cpp:170
Named 2D frame sequence referencing SpriteSheet frame indices. Script type: SpriteClip.
Definition SpriteClip.h:17
void addEvent(int clipFrame, const std::string &name)
Attach a named event to a clip-frame index.
Definition SpriteClip.cpp:61
float wrapTime(float timeSeconds) const
Local time wrapped or clamped according to loop flag.
Definition SpriteClip.cpp:89
void addFrame(int sheetFrameIndex, float duration=0.1f)
Append one cell: sheetFrameIndex + display duration (seconds).
Definition SpriteClip.cpp:20
void addFrameByName(SpriteSheet *sheet, const std::string &frameName, float duration=0.1f)
Resolve name via sheet and append.
Definition SpriteClip.cpp:27
int frameAtTime(float timeSeconds) const
Map absolute time (seconds) into a clip frame index. When loop is false and t >= duration,...
Definition SpriteClip.cpp:101
void addRange(int firstSheetFrame, int lastSheetFrame, float fps)
Append inclusive sheet-frame range at a uniform frame rate.
Definition SpriteClip.cpp:36
std::string getEvent(int clipFrame) const
Return event name for a frame, or empty when none.
Definition SpriteClip.cpp:66
Sprite-sheet / texture-atlas frame table (pixel rects).
Definition SpriteSheet.h:23
graphics::Texture * getTexture() const
Return the optional atlas texture without transferring ownership.
Definition SpriteSheet.h:53
int addFrame(const std::string &name, int x, int y, int w, int h)
Append a named frame. Returns frame index. Empty name → "frameN".
Definition SpriteSheet.cpp:14
int getFrameSourceWidth(int index) const
Returns the frame source width.
Definition SpriteSheet.cpp:39
int setGrid(int columns, int rows, int frameW, int frameH, int margin=0, int spacing=0, int originX=0, int originY=0)
Generate frames in row-major order from a grid. frameW/frameH are cell sizes; margin is outer padding...
Definition SpriteSheet.cpp:44
void setTexture(graphics::Texture *texture)
Optional atlas texture produced by a sequence loader or assigned by the user.
Definition SpriteSheet.h:51
void applyToQuad(graphics::Quad *quad, int frameIndex) const
Write pixel viewport into an existing Quad (does not allocate).
Definition SpriteSheet.cpp:101
int getFrameSourceHeight(int index) const
Returns the frame source height.
Definition SpriteSheet.cpp:40
Property tween — interpolates named float properties from → to over time.
Definition Tween.h:25
void setDeltaAngle(const std::string &name, float deltaRadians)
Sets the delta angle.
Definition Tween.cpp:76
int getPropertyCount() const
Names of all property tracks (stable order = insertion order).
Definition Tween.h:131
bool update(float dt)
Advance by dt seconds; legacy facade that forwards to advance().
Definition Tween.cpp:304
void setFromAngle(const std::string &name, float radians)
Sets the from angle.
Definition Tween.cpp:60
float evaluate(const std::string &name, float t) const
Sample property at linear t in [0,1] using current from/to (no state change).
Definition Tween.cpp:315
void setRepeat(int count)
Play count: 1 = once (default), N = N cycles, -1 = infinite. Values < -1 are clamped to -1.
Definition Tween.cpp:128
void setDelta(const std::string &name, float delta)
Relative change: end = start + delta (resolved when start() runs).
Definition Tween.cpp:52
constexpr std::optional< StrongUint64 > incremented() const noexcept
Returns the next value, or empty instead of unsigned wraparound.
Definition StrongUint64.h:30
Definition Graphics.h:125
Texture * newTextureFromImageData(image::ImageData *data, bool repeatU=false, bool repeatV=false)
Creates a texture from image data. @ownership Caller deletes unless documented otherwise.
Definition Graphics.cpp:1737
virtual Texture * newTextureFromFile(const std::string &filename)=0
Creates a texture from file. @ownership Caller deletes unless documented otherwise.
void getPixel(int x, int y, Colorf &c) const
Gets the pixel at location (x,y).
Definition ImageData.cpp:535
void paste(ImageData *src, int dx, int dy, int sx, int sy, int sw, int sh)
Paste part of one ImageData onto another. The subregion defined by the top-left corner (sx,...
Definition ImageData.cpp:1074
This module is responsible for decoding files such as PNG, GIF, JPEG into raw pixel data,...
Definition Image.h:22
ImageData * newImageDataFromFile(std::string path)
Loads an image from a VFS path through the unified resource cache. Repeated loads of one path share a...
Definition Image.cpp:53
Result< int > addHeadCollider(DynamicBoneSolver &solver, const std::string &boneName, float radius, float offsetX, float offsetY, float offsetZ)
Attach a bone-following sphere collider (typically the head) for hair chains.
Definition HairDynamicBones.cpp:50
Result< int > addChain(DynamicBoneSolver &solver, const ChainDesc &desc)
Add one hair/tail chain by bone name.
Definition HairDynamicBones.cpp:17
Definition Animation.cpp:58
void exposeAnimPlayerBindings(ssq::Table &table)
Register playback, sampling and event inspection for AnimPlayer.
Definition AnimationPlayerBindings.cpp:38
void exposeAnimationModelImportBindings(ssq::Class &cls)
Register ModelData/Assimp import factories when AnimationModelImport.cpp is linked (OPTIONAL_DEPS mod...
Definition AnimationModelImport.cpp:32
void exposePhysicalBalancePoseBindings(ssq::Table &table)
Register the impulse/balance pose overlay Squirrel surface.
Definition PhysicalBalancePoseBindings.cpp:12
void exposeMotionMatcherBindings(ssq::Table &table)
Register the synchronous MotionMatcher Squirrel surface.
Definition AnimationMotionBindings.cpp:30
void exposeAnimClipBindings(ssq::Table &table)
Register AnimClip's authoring and playback-neutral Squirrel surface.
Definition AnimationClipBindings.cpp:29
void exposeMotionScriptBindings(ssq::Table &table, ssq::Class &animationClass)
Register Motion / MotionSequence script types and Animation factories.
Definition MotionScriptBindings.cpp:206
@ InvalidArgument
@ InvariantViolation
@ Conflict
@ Applied
Compact quaternion used by motion adapters (xyzw).
Definition MotionTypes.h:60
Compact float2 used by motion adapters (avoids graphics math deps).
Definition MotionTypes.h:39
One named spring chain with game-friendly hair defaults.
Definition HairDynamicBones.h:23