Xors3d Engine
Entity animation

Functions

BBDECL void BBCALL xAnimate (Entity *entity, int mode=1, float speed=1.0f, int sequence=0, float translate=0.0f, const char *rootBone="")
 Animates an entity.
BBDECL int BBCALL xAnimating (Entity *entity, const char *rootBone="")
 Returns true if the specified entity is currently animating.
BBDECL float BBCALL xAnimLength (Entity *entity, const char *rootBone="")
 Returns the length of the specified entity's current animation sequence.
BBDECL int BBCALL xAnimSeq (Entity *entity, const char *rootBone="")
 Returns the specified entity's current animation sequence.
BBDECL float BBCALL xAnimSpeed (Entity *entity, const char *rootBone="")
 Returns the specified entity's current animation speed.
BBDECL float BBCALL xAnimTime (Entity *entity, const char *rootBone="")
 Returns the current animation time of an entity.
BBDECL int BBCALL xExtractAnimSeq (Entity *entity, int firstFrame, int lastFrame, int sequence=0)
 Extracts part of specified sequence to a new one and returns its index.
BBDECL int BBCALL xLoadAnimSeq (Entity *entity, const char *path)
 Appends an animation sequence from a file to an entity. Returns the animation sequence number added.
BBDECL void BBCALL xSetAnimFrame (Entity *entity, float frame, int sequence, const char *rootBone="")
 Sets entity's animation frame.
BBDECL void BBCALL xSetAnimSpeed (Entity *entity, float speed, const char *rootBone="")
 Sets entity's animation speed.
BBDECL void BBCALL xSetAnimTime (Entity *entity, float time, int sequence, const char *rootBone="")
 Sets entity's animation time.

Function Documentation

BBDECL int BBCALL xExtractAnimSeq ( Entity *  entity,
int  firstFrame,
int  lastFrame,
int  sequence = 0 
)

Extracts part of specified sequence to a new one and returns its index.

B3D format supports only one sequence per file. You can arrange all animations into one in editor and then extact them in Xors3D

Parameters:
entityEntity handle
firstFrameFirst frame of anim sequence to extract
lastFrameLast frame of anim sequence to extract
sequenceAnimation sequence to extract from
BBDECL int BBCALL xLoadAnimSeq ( Entity *  entity,
const char *  path 
)

Appends an animation sequence from a file to an entity. Returns the animation sequence number added.

Parameters:
entityEntity handle
pathFilename of animated 3D object
BBDECL void BBCALL xSetAnimSpeed ( Entity *  entity,
float  speed,
const char *  rootBone = "" 
)

Sets entity's animation speed.

Parameters:
entityEntity handle
speedNew animation speed
rootBoneRoot bone. See xAnimate() for more infromation
BBDECL float BBCALL xAnimSpeed ( Entity *  entity,
const char *  rootBone = "" 
)

Returns the specified entity's current animation speed.

This function must be used only with real skinned mesh, or it will return wrong values

Parameters:
entityEntity handle
rootBoneRoot bone name in animation track. See xAnimate() for more infromation
BBDECL int BBCALL xAnimating ( Entity *  entity,
const char *  rootBone = "" 
)

Returns true if the specified entity is currently animating.

This function must be used only with real skinned mesh, or it will return wrong values

Parameters:
entityEntity handle
rootBoneRoot bone name in animation track. See xAnimate() for more infromation
BBDECL float BBCALL xAnimTime ( Entity *  entity,
const char *  rootBone = "" 
)

Returns the current animation time of an entity.

This function must be used only with real skinned mesh, or it will return wrong values

Parameters:
entityEntity handle
rootBoneName of root bone in animation track. See xAnimate() for more infromation
BBDECL void BBCALL xAnimate ( Entity *  entity,
int  mode = 1,
float  speed = 1.0f,
int  sequence = 0,
float  translate = 0.0f,
const char *  rootBone = "" 
)

Animates an entity.

Parameters:
entityEntity handle
modeAnimating mode. See 'Animation playback types' for more information
speedAnimation speed. A negative speed will play the animation backwards
sequenceInitially, an entity loaded with xLoadAnimMesh() will have a single animation sequence. More sequences can be added using either xLoadAnimSeq() or xAddAnimSeq(). Animation sequences are numbered 0, 1, 2, etc
translateA value of 0 will cause an instant 'leap' to the first frame, while values greater than 0 will cause a smooth transition
rootBoneRoot bone in hierarhy, from that animation will be applied. In Blitz3D you may find bone by FindChild() command and animate it. In Xors3D you must simply pass its name in xAnimate() command. For hierarhy a new animation track will be created, so then you will need to get its info (like time, speed, etc) you must also pass a name of its root bone for correct results.
BBDECL int BBCALL xAnimSeq ( Entity *  entity,
const char *  rootBone = "" 
)

Returns the specified entity's current animation sequence.

This function must be used only with real skinned mesh, or it will return wrong values

Parameters:
entityEntity handle
rootBoneRoot bone name in animation track. See xAnimate() for more infromation
BBDECL float BBCALL xAnimLength ( Entity *  entity,
const char *  rootBone = "" 
)

Returns the length of the specified entity's current animation sequence.

This function must be used only with real skinned mesh, or it will return wrong values

Parameters:
entityEntity handle
rootBoneRoot bone name in animation track. See xAnimate() for more infromation
BBDECL void BBCALL xSetAnimTime ( Entity *  entity,
float  time,
int  sequence,
const char *  rootBone = "" 
)

Sets entity's animation time.

Parameters:
entityEntity handle
timeNew animation time
sequenceAnimation sequence number
rootBoneRoot bone. See xAnimate() for more infromation
BBDECL void BBCALL xSetAnimFrame ( Entity *  entity,
float  frame,
int  sequence,
const char *  rootBone = "" 
)

Sets entity's animation frame.

This work similarly with xSetAnimTime(), but operate with frames

Parameters:
entityEntity handle
frameNew animation frame
sequenceAnimation sequence number
rootBoneRoot bone. See xAnimate() for more infromation