getPosWorld: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - ":<code>" to ": <code>")
m (Replaced <code> with <sqf>)
 
(7 intermediate revisions by one other user not shown)
Line 16: Line 16:
|r1= [[Array]] format [[Position#PositionASL|PositionASL]] - '''the model's centre'''
|r1= [[Array]] format [[Position#PositionASL|PositionASL]] - '''the model's centre'''


|x1= <code>_obj [[setPosWorld]] [[getPosWorld]] _obj;</code>
|x1= <sqf>_obj setPosWorld getPosWorld _obj;</sqf>


|x2= <code>[[ATLToASL]] (_groundObj [[modelToWorld]] [0,0,0]) [[isEqualTo]] [[getPosWorld]] _groundObj; {{cc|true}}</code>
|x2= <sqf>ATLToASL (_groundObj modelToWorld [0,0,0]) isEqualTo getPosWorld _groundObj; // true</sqf>


|x3= Wave height under a boat:
|x3= Wave height under a boat:
<code>[[private]] _h = ((boat [[modelToWorld]] [0,0,0]) [[vectorDiff]] [[getPosWorld]] boat) [[select]] 2;</code>
<sqf>private _h = ((boat modelToWorld [0,0,0]) vectorDiff getPosWorld boat) select 2;</sqf>


|seealso= [[getPosWorldVisual]] [[setPosWorld]] [[position]] [[getPosATL]] [[getPosASL]] [[getPosASLW]] [[visiblePosition]] [[visiblePositionASL]] [[getMarkerPos]] [[modelToWorld]]
|seealso= [[getPosWorldVisual]] [[setPosWorld]] [[position]] [[getPosATL]] [[getPosASL]] [[getPosASLW]] [[visiblePosition]] [[visiblePositionASL]] [[getMarkerPos]] [[modelToWorld]]
}}
}}

Latest revision as of 13:54, 14 May 2022

Hover & click on the images for description

Description

Description:
Returns the provided object's model centre position ([0,0,0]) in PositionASL, rather than the transformed boundingCenter or LandContact vertices.
Groups:
Positions

Syntax

Syntax:
getPosWorld object
Parameters:
object: Object
Return Value:
Array format PositionASL - the model's centre

Examples

Example 1:
_obj setPosWorld getPosWorld _obj;
Example 2:
ATLToASL (_groundObj modelToWorld [0,0,0]) isEqualTo getPosWorld _groundObj; // true
Example 3:
Wave height under a boat:
private _h = ((boat modelToWorld [0,0,0]) vectorDiff getPosWorld boat) select 2;

Additional Information

See also:
getPosWorldVisual setPosWorld position getPosATL getPosASL getPosASLW visiblePosition visiblePositionASL getMarkerPos modelToWorld

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note