ent_bonerotate(entity,string name,vector angle)
ent_bonerotate_parent(entity,string name,vector angle)
Rotates an entity bone, it's children and all
attached vertices. ent_bonerotate rotates about it's hinge point, ent_bonerotate_parent rotates
about it's parent's
joint (this corresponds to rotate3
mode in MED).
Parameters:
entity - entity pointer
name - name of the bone
angle - pan, tilt, roll euler angles.
Returns:
0 if bone not found, otherwise nonzero.
Speed:
Slow
Remarks:
- This instruction does not set the bone to a certain angle, it rather
adds the angle to the current bone orientation. For setting bones to absolute
angles, or for concatenating a bones animation from several bones rotations,
reset the bones before by ent_bonereset or
ent_animate.
-
Bone rotations are relative to the rotation of the entity.
Examples:
action endless_animation()
{
while(1) {
ent_bonerotate(my,"bone",vector(time_step, 0, 0));
wait(1);
}
}
action combined_animation()
{
while(1) {
if (key_q) { my.skill1 -= time_step; }
if (key_w) { my.skill1 += time_step; }
if (key_a) { my.skill2 -= time_step; }
if (key_s) { my.skill2 += time_step; }
ent_animate(my,NULL,0,0); // reset all bones
ent_bonerotate(my,"bone1",vector(0,my.skill2,0)); // tilt first bone
ent_bonerotate(my,"bone2",vector(my.skill1,0,0)); // pan second bone
wait(1);
}
}
See also:
ent_bonereset, ent_bonescale,
ent_animate, ent_bonemove
► latest
version online