API Panel.Position.RotateTo

From Flowcode Help
Revision as of 15:57, 16 January 2014 by JonnyW (talk | contribs) (XML import)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

<sidebar>API Contents</sidebar> Rotates the object to the given rotation

Class hierarchy





The position or component to update
The default value for this parameter is: this


The coordinates of the rotation center, Handle if zero


An axis to align the angles to, Handle if zero


The absolute local X degrees to update with
The default value for this parameter is: 0


The absolute local Y degrees to update with
The default value for this parameter is: 0


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.


Calling in a calculation

  • Add to a calculation icon:
    ::Panel.Position.RotateTo(handle, pivot, axis, x_pitch, y_yaw, z_roll)

No additional examples