visiblePosition: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "ASLtoAGL" to "ASLToAGL")
m (Some wiki formatting)
Line 14: Line 14:


|descr= Returns an object's rendered position (z value above surface underneath) in render time scope. Same as [[getPosVisual]].
|descr= Returns an object's rendered position (z value above surface underneath) in render time scope. Same as [[getPosVisual]].
{{Feature | Important | This command '''should not''' be used for actual 3D calculations. See [[getPos]] for more details.}}
{{Feature|important|This command must '''not''' be used for actual 3D calculations. See [[getPos]] for an explanation.}}


|s1= [[visiblePosition]] object
|s1= [[visiblePosition]] object
Line 21: Line 21:


|r1= [[Position#PositionAGLS|PositionAGLS]]
|r1= [[Position#PositionAGLS|PositionAGLS]]
    
    
|x1= <sqf>playerRenderedPos = visiblePosition player;</sqf>
|x1= <sqf>_playerRenderedPos = visiblePosition player;</sqf>


|seealso= [[getPosVisual]] [[getPosATLVisual]] [[getPosASLVisual]] [[getPosWorldVisual]] [[visiblePositionASL]] [[position]] [[getPos]] [[getPosATL]] [[getPosASL]] [[getPosASLW]]
|seealso= [[getPosVisual]] [[getPosATLVisual]] [[getPosASLVisual]] [[getPosWorldVisual]] [[visiblePositionASL]] [[position]] [[getPos]] [[getPosATL]] [[getPosASL]] [[getPosASLW]]
Line 33: Line 32:
|text= Note that this command returns the position in [[Position#PositionAGLS|AGLS]] format (Z is measured from the nearest surface below). For example the value of Z is 0 even if the object is resting on top of a building.<br>
|text= Note that this command returns the position in [[Position#PositionAGLS|AGLS]] format (Z is measured from the nearest surface below). For example the value of Z is 0 even if the object is resting on top of a building.<br>
For use with draw commands, such as [[drawIcon3D]], an [[Position#PositionAGL|AGL]] position is needed. The following alternatives can be used, depending on where the icon is intended to be shown:
For use with draw commands, such as [[drawIcon3D]], an [[Position#PositionAGL|AGL]] position is needed. The following alternatives can be used, depending on where the icon is intended to be shown:
<sqf>ASLToAGL getPosWorldVisual _object     // object center in model coordinates, i.e [0,0,0]
<sqf>
ASLToAGL getPosASLVisual _object       // object land contact (e.g. floor of a building)
ASLToAGL getPosWorldVisual _object // object center in model coordinates, i.e [0,0,0]
unitAimPositionVisual _object           // object's aiming position, i.e where the AI aim at, such as a soldier's chest
ASLToAGL getPosASLVisual _object // object land contact (e.g. floor of a building)
_object modelToWorldVisual _relativePos // custom position in model coordinates. if _relativePos is [0,0,0], it'll be the same as ASLToAGL getPosWorldVisual _object</sqf>
unitAimPositionVisual _object // object's aiming position, i.e where the AI aim at, such as a soldier's chest
_object modelToWorldVisual _relativePos // custom position in model coordinates. if _relativePos is [0,0,0], it'll be the same as ASLToAGL getPosWorldVisual _object
</sqf>
}}
}}

Revision as of 20:50, 8 March 2024

Hover & click on the images for description

Description

Description:
Returns an object's rendered position (z value above surface underneath) in render time scope. Same as getPosVisual.
This command must not be used for actual 3D calculations. See getPos for an explanation.
Groups:
PositionsRender Time Scope

Syntax

Syntax:
visiblePosition object
Parameters:
object: Object - name of the object
Return Value:
PositionAGLS

Examples

Example 1:
_playerRenderedPos = visiblePosition player;

Additional Information

See also:
getPosVisual getPosATLVisual getPosASLVisual getPosWorldVisual visiblePositionASL position getPos getPosATL getPosASL getPosASLW

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
Leopard20 - c
Posted on Jan 26, 2022 - 15:15 (UTC)
Note that this command returns the position in AGLS format (Z is measured from the nearest surface below). For example the value of Z is 0 even if the object is resting on top of a building.
For use with draw commands, such as drawIcon3D, an AGL position is needed. The following alternatives can be used, depending on where the icon is intended to be shown:
ASLToAGL getPosWorldVisual _object // object center in model coordinates, i.e [0,0,0] ASLToAGL getPosASLVisual _object // object land contact (e.g. floor of a building) unitAimPositionVisual _object // object's aiming position, i.e where the AI aim at, such as a soldier's chest _object modelToWorldVisual _relativePos // custom position in model coordinates. if _relativePos is [0,0,0], it'll be the same as ASLToAGL getPosWorldVisual _object