Main Content

moveBody

Class: Aero.Animation
Namespace: Aero

Move body in animation object

Syntax

moveBody(h,idx,translation,rotation)

Description

moveBody(h,idx,translation,rotation) sets a new position and attitude for the body specified with the index idx in the animation object h. translation is a 1-by-3 vector in the aerospace body coordinate system. rotation is a 1-by-3 vector, in radians, that specifies the rotations about the right-hand x-y-z coordinate axes. The order of application of the rotation is z-y-x (yaw, pitch, and roll (Y-P-R)).

Input Arguments

expand all

Aerospace animation object, specified as an Aero.Animation object.

Body index, specified as a scalar.

Body translation, specified as a 1-by-3 vector in the aerospace body coordinate system.

Body rotation, specified as a 1-by-3 vector, in radians, that specifies the rotations about the right-hand x-y-z coordinate axes. The order of application of the rotation is z-y-x (Y-P-R).

Examples

expand all

Move an Aero.Animation body with the index 1 to the position offset from the original by + [0 0 -3].

h = Aero.Animation;
idx1 = createBody(h,'pa24-250_orange.ac','Ac3d');
pos1 = h.Bodies{1}.Position;
rot1 = h.Bodies{1}.Rotation;
moveBody(h,1,pos1 + [0 0 -3],rot1);

Version History

Introduced in R2007a