visiblePosition: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|=GROUP1" to "|GROUP1=")
m (Text replacement - "↵ ↵|" to " |")
 
(62 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma2oa |Game name=
|game1= arma2oa
|version1= 1.60


|1.60|Game version=
|game2= tkoh
|version2= 1.00


|gr1= Positions |GROUP1=
|game3= arma3
|gr2= Render Time Scope |GROUP2=
|version3= 0.50
____________________________________________________________________________________________


| Returns an object's rendered position (z value above surface underneath) in render time scope. Same as [[getPosVisual]] |DESCRIPTION=
|gr1= Positions
____________________________________________________________________________________________
|gr2= Render Time Scope


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


|s1= [[visiblePosition]] object


|p1= object: [[Object]]: - name of the object |PARAMETER1=
|p1= object: [[Object]] - name of the object


| [[Array]] - format [[PositionAGLS]] |RETURNVALUE=
|r1= [[Position#PositionAGLS|PositionAGLS]]


____________________________________________________________________________________________
|x1= <sqf>_playerRenderedPos = visiblePosition player;</sqf>
 
|x1= <code>playerRenderedPos = [[visiblePosition]] [[player]];</code> |EXAMPLE1=
____________________________________________________________________________________________


| [[getPosVisual]], [[getPosATLVisual]], [[getPosASLVisual]], [[getPosWorldVisual]], [[visiblePositionASL]], [[position]], [[getPos]], [[getPosATL]], [[getPosASL]], [[getPosASLW]] |SEEALSO=
|seealso= [[getPosVisual]] [[getPosATLVisual]] [[getPosASLVisual]] [[getPosWorldVisual]] [[visiblePositionASL]] [[position]] [[getPos]] [[getPosATL]] [[getPosASL]] [[getPosASLW]]
}}


{{Note
|user= Leopard20
|timestamp= 20220126151506
|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:
<sqf>
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
</sqf>
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Arma 2: Operation Arrowhead: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on February 4, 2015 - 17:04 (UTC)</dd>
<dt class="note">[[User:Pierre MGI|Pierre MGI]]</dt>
<dd class="note">
Z (visiblePosition select 2) works but if unit/object is in a building, Z remains at ground level. If you need Z depending on building floors/stages, use getPosAtl select 2 instead.
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 12:45, 8 April 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