|
Replaces the current sequence with a new one.
The engine will interpolate between the old sequence and the new one
The duration of the interpolation process is controlled by transition_period
transition_period is in mili seconds.
If transition_period==0 then the engine wont do any interpolation between the old and the
new sequences.
Returns OK or VR_ERROR
Note that usually this function is used
together with STATE_3D_sequence_duplicate()
This is because if two objects use the same 3D_sequence then
changing the speed of the sequence (or other properties) will
effect both objects
Examples:
A) A simple example
STATE_object_set_3D_sequence(my_object, walking_sequence, 100);
B) A simple example with full code
DWORD obj=STATE_object_create_from_file("robot.md2");
DWORD anim3d=STATE_object_get_3D_animation(obj);
Every md2 file might have different sequence names depending on the animated character
to know the names of the sequences you have to go through all of them using STATE_3D_sequence_get_first() and get next mechanism (and of course STATE_3D_sequence_get_name)
DWORD walking_sequence=STATE_3D_sequence_get_using_name("walk");
STATE_object_set_3D_sequence(my_object, walking_sequence, 100);
C) How to do it when a multiple number of objects might use the same 3D sequence
Normally you will do it like in this sample
DWORD robot1=STATE_object_create_from_file("robot.md2");
DWORD anim3d=STATE_object_get_3D_animation(robot1);
Every md2 file might have different sequence names depending on the animated character
to know the names of the sequences you have to go through all of them using STATE_3D_sequence_get_first() and get next mechanism (and of course STATE_3D_sequence_get_name)
DWORD walking_sequence=STATE_3D_sequence_get_using_name("walk");
robot1_walk=STATE_3D_sequence_duplicate(walking_sequence, "robot1_walk");
STATE_object_set_3D_sequence(robot1, robot1_walk, 100);
Note ! now that this object has its own sequence then changing the sequence speed wont effect
other objects which use the same sequence
|