Difference between revisions of "API Panel.Position.RotateTo"
(XML import of API documentation) |
(XML import) |
||
Line 1: | Line 1: | ||
− | |||
− | |||
<sidebar>API Contents</sidebar> | <sidebar>API Contents</sidebar> | ||
Rotates the object to the given rotation | Rotates the object to the given rotation |
Revision as of 15:57, 16 January 2014
<sidebar>API Contents</sidebar> Rotates the object to the given rotation
Contents
Parameters
HANDLE Handle
- The position or component to update
- The default value for this parameter is: this
HANDLE Pivot
- The coordinates of the rotation center, Handle if zero
HANDLE Axis
- An axis to align the angles to, Handle if zero
FLOAT X_Pitch
- The absolute local X degrees to update with
- The default value for this parameter is: 0
FLOAT Y_Yaw
- The absolute local Y degrees to update with
- The default value for this parameter is: 0
FLOAT Z_Roll
- The absolute local Z degrees to update with
- The default value for this parameter is: 0
Return value
This call does not return a value
Detailed description
This rotates an object to the exact orientation specified. The orientation is represented as Euler angles. This is typically useful for setting to an exact angle, but is not recommended for incremental changes - Euler angles suffer from gimbal lock and it can be difficult to maintain an absolute values through incremental changes.
For an incremental change, use RotateAlong.
If Pivot or Axis are zero, that parameter is ignored. This is in contrast with most Position calls that treat zero as world-space. It is advised not to use world-space in a component that is exported, use this as the coordinate space instead.
Note that a common mistake is to set the orientation to (0, 0, 0) to reset the Handle back to its original position. Where as this will work for objects that are originally aligned to the specified axis, this will not work for objects whose initial position is off axis. To reliably restore the orientation of an object, the original position should be read and stored with a call to Get and the orientation restored using SetRotation.
Note another common mistake is to set the angle relative to the object being rotated. Specifying the same Axis as Handle will cause the object to be rotated relative to itself, which may have unexpected results.
Examples
Calling in a calculation
- Add to a calculation icon:
::Panel.Position.RotateTo(handle, pivot, axis, x_pitch, y_yaw, z_roll)
No additional examples