getPosWorldVisual: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Remove PositionWorld)
m (Some wiki formatting)
Line 17: Line 17:
|r1= [[Array]] - format [[Position#PositionASL|PositionASL]]  '''the model centre'''<nowiki/>'s position (see [[getPosWorld]]) in render scope
|r1= [[Array]] - format [[Position#PositionASL|PositionASL]]  '''the model centre'''<nowiki/>'s position (see [[getPosWorld]]) in render scope


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


|x2= <code>_groundObj [[modelToWorldVisualWorld]] [0,0,0] [[isEqualTo]] [[getPosWorldVisual]] _groundObj; //true</code>
|x2= <sqf>_groundObj modelToWorldVisualWorld [0,0,0] isEqualTo getPosWorldVisual _groundObj; // true</sqf>


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


|seealso= [[getPosWorld]] [[setPosWorld]] [[visiblePosition]] [[getPosATLVisual]] [[getPosASLVisual]] [[visiblePositionASL]] [[modelToWorldVisual]] [[modelToWorldVisualWorld]]
|seealso= [[getPosWorld]] [[setPosWorld]] [[visiblePosition]] [[getPosATLVisual]] [[getPosASLVisual]] [[visiblePositionASL]] [[modelToWorldVisual]] [[modelToWorldVisualWorld]]
}}
}}

Revision as of 15:12, 3 May 2022

Hover & click on the images for description

Description

Description:
Returns the provided object's, model centre position in render version in format PositionASL, rather than transformed boundingCenter or LandContact vertices.
Groups:
Object ManipulationRender Time Scope

Syntax

Syntax:
getPosWorldVisual object
Parameters:
object: Object
Return Value:
Array - format PositionASL the model centre's position (see getPosWorld) in render scope

Examples

Example 1:
_obj setPosWorld getPosWorldVisual _obj;
Example 2:
_groundObj modelToWorldVisualWorld [0,0,0] isEqualTo getPosWorldVisual _groundObj; // true
Example 3:
private _waveHeight = ((boat modelToWorldVisual [0,0,0]) vectorDiff getPosWorldVisual boat) select 2;

Additional Information

See also:
getPosWorld setPosWorld visiblePosition getPosATLVisual getPosASLVisual visiblePositionASL modelToWorldVisual modelToWorldVisualWorld

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