BIS fnc relPos: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|gr([0-9]+) = " to "|gr$1= ")
m (Some wiki formatting)
Line 1: Line 1:
{{RV|type=function
{{RV|type=function


|arma2
|game1= arma2
|version1= 1.00


|1.00
|game2= arma2oa
|version2= 1.50
 
|game3= tkoh
|version3= 1.00
 
|game4= arma3
|version4= 0.50


|gr1= Positions
|gr1= Positions
Line 9: Line 17:
|gr2= Geometry
|gr2= Geometry


|Returns a position that is a specified distance and compass direction from the passed position or object. {{Feature|arma3|In Arma 3 use [[getPos]] instead.}}
|descr= Returns a position that is a specified distance and compass direction from the passed position or object.
{{Feature|arma3|In {{arma3}} use [[getPos]]' [[getPos#Alternative Syntax 2|alternative syntax]] instead.}}


|[start, distance, direction] call '''BIS_fnc_relPos'''
|s1= [origin, distance, direction] call [[BIS_fnc_relPos]]


|p1= start: [[Object]] or [[Position]] - Object or position which should be used as initial point.
|p1= origin: [[Object]] or [[Position]] - object or position which should be used as initial point.


|p2= distance: [[Number]] - Distance from initial point.
|p2= distance: [[Number]] - distance from initial point


|p3= direction: [[Number]] - Direction from the intial position.
|p3= direction: [[Number]] - direction from the intial position


|[[Position]]
|r1= [[Position]]


|x1= <code>[ [0,0,0], 1000, 50 ] [[call]] '''BIS_fnc_relPos''';//[766.044,642.788,0]</code>
|x1= <code>[<nowiki/>[0,0,0], 1000, 50] [[call]] [[BIS_fnc_relPos]]; {{cc|[766.044,642.788,0]}}</code>


|seealso= [[getPos]]
|seealso= [[getPos]]
}}
}}
[[Category:{{Name|arma2}}: Functions|{{uc:relPos}}]]
[[Category:{{Name|arma2oa}}: Functions|{{uc:relPos}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:relPos}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:relPos}}]]


<dl class="command_description">
<dl class="command_description">
Line 38: Line 40:
<dt class="note">[[User:Lawman Actual|Lawman Actual]]</dt>
<dt class="note">[[User:Lawman Actual|Lawman Actual]]</dt>
<dd class="note">
<dd class="note">
The function appears to work in two dimensions, and as such can be used to find the position of a target relative to the player if bearing and distance are known.
The function appears to work in two dimensions, and as such can be used to find the position of a target relative to the player if bearing and distance are known.


However, if there is a significant change in elevation between yourself and the target, the distance registered on a ragefinder (which is measuring a 3 dimensional straight line) will always be larger than the two-dimensional value required for BIS_fnc_relPos and as such air-strikes and ordnance called in using such a function can miss by several hundred metres in extreme cases.
However, if there is a significant change in elevation between yourself and the target, the distance registered on a rangefinder (which is measuring in a 3-dimensional straight line) will always be larger than the two-dimensional value required for [[BIS_fnc_relPos]] and as such air-strikes and ordnance called in using such a function can miss by several hundred metres in extreme cases.


Currently searching for a method which incorporates the azimuth of the rangefinder in calculation.  
Currently searching for a method which incorporates the azimuth of the rangefinder in calculation.
</dd>
</dd>
</dl>
</dl>

Revision as of 17:20, 9 June 2021

Hover & click on the images for description

Description

Description:
Returns a position that is a specified distance and compass direction from the passed position or object.
Arma 3
In Arma 3 use getPos' alternative syntax instead.
Execution:
call
Groups:
PositionsGeometry

Syntax

Syntax:
[origin, distance, direction] call BIS_fnc_relPos
Parameters:
origin: Object or Position - object or position which should be used as initial point.
distance: Number - distance from initial point
direction: Number - direction from the intial position
Return Value:
Position

Examples

Example 1:
[[0,0,0], 1000, 50] call BIS_fnc_relPos; // [766.044,642.788,0]

Additional Information

See also:
getPos

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
Posted on January 7, 2016 - 19:26 (UTC)
Lawman Actual
The function appears to work in two dimensions, and as such can be used to find the position of a target relative to the player if bearing and distance are known. However, if there is a significant change in elevation between yourself and the target, the distance registered on a rangefinder (which is measuring in a 3-dimensional straight line) will always be larger than the two-dimensional value required for BIS_fnc_relPos and as such air-strikes and ordnance called in using such a function can miss by several hundred metres in extreme cases. Currently searching for a method which incorporates the azimuth of the rangefinder in calculation.