Xors3d Engine
Entity animation

Functions

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

Function Documentation

int 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
int 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
void 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
float 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
int 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
float 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
void 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.
int 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
float 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
void 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
void 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