Difference between revisions of "Osiris/API/GetRotation"
From Divinity Engine Wiki
m |
m |
||
(One intermediate revision by the same user not shown) | |||
Line 6: | Line 6: | ||
* '''Success/Failure''': Fails if '''_Target''' does not exist. | * '''Success/Failure''': Fails if '''_Target''' does not exist. | ||
* '''_X''': Rotation in degrees of '''_Target''' around the X axis. | * '''_X''': Rotation in degrees of '''_Target''' around the X axis. | ||
− | * '''_Y''': Rotation in degrees of '''_Target''' around the Y axis. This angle is offset 90 degrees from the X-axis (i.e., if a character faces in the same direction as the X-axis, the result of this call will be -90 or 270). | + | * '''_Y''': Rotation in degrees of '''_Target''' around the Y axis. This angle is offset 90 degrees from the X-axis (i.e., if a character faces in the same direction as the X-axis, the result of this call will be -90 or 270). This corresponds to the South direction. |
* '''_Z''': Rotation in degrees of '''_Target''' around the Z axis. | * '''_Z''': Rotation in degrees of '''_Target''' around the Z axis. | ||
===== Notes ===== | ===== Notes ===== | ||
Line 17: | Line 17: | ||
* [[Osiris/API/GetAngleTo|GetAngleTo]] | * [[Osiris/API/GetAngleTo|GetAngleTo]] | ||
* [[Osiris/API/GetPosition|GetPosition]] | * [[Osiris/API/GetPosition|GetPosition]] | ||
+ | * [[Osiris/API/ItemToTransform|ItemToTransform]] | ||
[[Category:Osiris Queries|GetRotation]] | [[Category:Osiris Queries|GetRotation]] |
Latest revision as of 12:43, 23 February 2018
Full Definition(s)
- query GetRotation([in](GUIDSTRING)_Target, [out](REAL)_X, [out](REAL)_Y, [out](REAL)_Z)
Description
Returns the rotation of the _Target as rotations around the X, Y and Z axes (Y = vertical axis). It works on any kind of game object.
Return Values
- Success/Failure: Fails if _Target does not exist.
- _X: Rotation in degrees of _Target around the X axis.
- _Y: Rotation in degrees of _Target around the Y axis. This angle is offset 90 degrees from the X-axis (i.e., if a character faces in the same direction as the X-axis, the result of this call will be -90 or 270). This corresponds to the South direction.
- _Z: Rotation in degrees of _Target around the Z axis.
Notes
- If _Target is an item and the item is inside the inventory of a character or a container, this call returns the rotation of the character/outermost container.
- The results of this call correspond to the Xr, Yr and Zr values you can see in the editor when selecting an object (as long as it hasn't rotated since the game started).
- All returned angles are in the interval [-180, 360].
- The rotation angle increases when rotating in the clockwise direction.