Plays frame range directly without pre-defined sequences (alternative to b3dAnimateSeq, firstFrame/lastFrame in frames).
Takes entity (animated mesh entity handle), mode (playback mode 0=stop, 1=loop, 2=pingpong, 3=once), speed (playback speed multiplier, 1.0 = normal), firstFrame/lastFrame (frame range, 0/0 = entire animation, converted to seconds using global FPS), transition (blend time in seconds, 0.0 = instant, 0.2-0.5 typical).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
entityInt
modeInt
speedDouble
firstFrameInt
lastFrameInt
transitionDouble
Returns
Void
Quick Summary
Plays frame range directly without pre-defined sequences (alternative to b3dAnimateSeq, firstFrame/lastFrame in frames).
Takes entity (animated mesh entity handle), mode (playback mode 0=stop, 1=loop, 2=pingpong, 3=once), speed (playback speed multiplier, 1.0 = normal), firstFrame/lastFrame (frame range, 0/0 = entire animation, converted to seconds using global FPS), transition (blend time in seconds, 0.0 = instant, 0.2-0.5 typical).
Returns nothing.
Technical Exegesis...
Plays frame range directly without pre-defined sequences (alternative to b3dAnimateSeq, firstFrame/lastFrame in frames). Takes entity (animated mesh entity handle), mode (playback mode 0=stop, 1=loop, 2=pingpong, 3=once), speed (playback speed multiplier, 1.0 = normal), firstFrame/lastFrame (frame range, 0/0 = entire animation, converted to seconds using global FPS), transition (blend time in seconds, 0.0 = instant, 0.2-0.5 typical). Returns nothing.
Plays frame range directly without pre-defined sequences (alternative to b3dAnimateSeq, firstFrame/lastFrame in frames). Takes entity (animated mesh entity handle), mode (playback mode 0=stop, 1=loop, 2=pingpong, 3=once), speed (playback speed multiplier, 1.0 = normal), firstFrame/lastFrame (frame range, 0/0 = entire animation, converted to seconds using global FPS), transition (blend time in seconds, 0.0 = instant, 0.2-0.5 typical). Returns nothing. Converts frames to time using g_animFPS (startTime = firstFrame / fps, endTime = lastFrame / fps), sets playback state (playing/looping/pingPong/speed), optionally blends from current pose (transition parameter, linear interpolation over time). Use for direct animation playback (no need to define sequences with b3dSetAnimSeq first), quick testing (play frame ranges without setup), or simple animations (single animation file, no named sequences needed). Playback modes: mode 0 = stop (stops animation, freezes at current frame), mode 1 = loop (repeats from start after end, typical for walk/run/idle), mode 2 = pingpong (reverses at end, plays forward then backward, typical for breathing), mode 3 = once (plays once and stops, typical for attacks/jumps). Frame range: firstFrame/lastFrame in frame numbers (e.g., 0-30 for first 30 frames at 24 FPS = 0-1.25 seconds), if both 0 plays entire animation (startTime = 0, endTime = animation duration, full playback), converted using global FPS (set via b3dSetAnimFPS, default 24 FPS). Speed multiplier: speed 1.0 = normal (plays at authored speed), <1.0 = slower (0.5 = half speed, slow motion), >1.0 = faster (2.0 = double speed, fast forward), independent of FPS (FPS converts frames to time, speed adjusts playback rate). Transition blending: if transition > 0.0 stores previous joint transforms (captures current pose), sets transitionDuration and transitionTime (countdown timer for blend), linearly interpolates between previous and new pose each frame (smooth transition over duration), if transition = 0.0 instant switch (no blending, snaps to new pose). Use cases: (1) Simple playback (b3dAnimate(player, 1, 1.0, 0, 120, 0.3) loop frames 0-120 at normal speed with 0.3s blend), (2) Full animation (b3dAnimate(prop, 3, 1.0, 0, 0, 0.0) play entire animation once instantly), (3) Quick test (b3dAnimate(character, 1, 1.5, 30, 60, 0.0) test frames 30-60 at 1.5x speed), (4) Direct control (no sequences needed, just call Animate with frame numbers). Common patterns: full loop = b3dAnimate(entity, 1, 1.0, 0, 0, 0.0) loop entire animation; frame range = b3dAnimate(entity, 3, 1.0, 50, 100, 0.2) play frames 50-100 once with blend; stop = b3dAnimate(entity, 0, 0, 0, 0, 0.0) stop playback. Typical transition times: instant (0.0s), quick (0.1-0.2s for reactive animations), smooth (0.3-0.5s for locomotion), slow (0.5-1.0s for dramatic effect). Difference from b3dAnimateSeq: b3dAnimateSeq uses pre-defined sequences (requires b3dSetAnimSeq first, named sequences like walk/run), b3dAnimate uses frame ranges directly (no setup, immediate playback, frame numbers on demand), b3dAnimateSeq better for organized animation library (define once, play by ID), b3dAnimate better for quick testing or simple use cases (fewer function calls, direct control). Creates temporary sequence: internally creates AnimSequence (startTime/endTime/speed from parameters), stores in temporary slot (not persisted in sequences map, not reusable), currentSequenceIndex = -1 (indicates not using named sequences, distinguishes from b3dAnimateSeq). Validation: only affects ENTITY_ANIMATED_MESH (non-animated entities ignored), silent if entity not found (invalid handle or wrong type, no error), mode clamped (0-3 range, mode 0 = stop always works), firstFrame/lastFrame clamped (negative values or out-of-range handled gracefully, clamps to animation duration). Related: b3dAnimateSeq plays pre-defined sequence (alternative, requires b3dSetAnimSeq first, named sequences), b3dSetAnimSeq defines sequence (splits animation into named clips, used with b3dAnimateSeq), b3dSetAnimFPS sets global FPS (affects frame-to-time conversion for this function), b3dPauseAnimSeq pauses playback (freezes animation started with this function), b3dResumeAnimSeq resumes playback (continues animation started with this function), b3dAnimating queries playback state (returns 1 if playing, 0 if stopped), b3dAnimTime queries current time (returns playback position in seconds).