getRelDir: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
Hypoxic125 (talk | contribs) m (Added example, removed my note) |
||
(27 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{RV|type=command | ||
|arma3| | |game1= arma3 | ||
|version1= 1.56 | |||
| | |arg= global | ||
| | |gr1= Object Manipulation | ||
| | |descr= Returns direction, which is relative to object's current direction, from given object to another object or position in the range from 0 to 360, the equivalent of [[BIS_fnc_relativeDirTo]]. | ||
Taking the current [[direction]] of the object into account. | |||
| | |s1= object [[getRelDir]] position | ||
| object | |p1= object: [[Object]] | ||
|p2= position: [[Object]], [[Position#Introduction|Position2D]] or [[Position#Introduction|Position3D]] | |||
|p2= position: [[Object]], [[Position2D]] or [[Position3D]] | |||
|r1= [[Number]] | |||
|x1= <sqf>_reldir = player getRelDir tank;</sqf> | |||
< | |||
< | |x2= <sqf> | ||
</ | // Set object's direction towards any given position | ||
_object setDir (getDir _object + (_object getRelDir [_x, _y, _z])) | |||
</sqf> | |||
|seealso= [[getDir]] [[direction]] [[getDirVisual]] | |||
}} | |||
<dl class="command_description"> | |||
< | <dt></dt> | ||
< | <dd class="notedate">Posted on 2018-08-07 - 21:50 (UTC)</dd> | ||
<dd class="notedate">Posted on | |||
<dt class="note">[[User:Tankbuster|Tankbuster]]</dt> | <dt class="note">[[User:Tankbuster|Tankbuster]]</dt> | ||
<dd class="note"> | <dd class="note"> | ||
To clarify, this returns a relative direction, so objects directly in front are said to be at zero degrees. So, taking example 1 above, if the tank is in front of the player, this function will return 0. If the tank is to the right of the player, it will return 90. | To clarify, this returns a relative direction, so objects directly in front are said to be at zero degrees. So, taking example 1 above, if the tank is in front of the player, this function will return 0. If the tank is to the right of the player, it will return 90. | ||
</dd> | </dd> | ||
</dl> | </dl> | ||
Latest revision as of 03:06, 12 May 2024
Description
- Description:
- Returns direction, which is relative to object's current direction, from given object to another object or position in the range from 0 to 360, the equivalent of BIS_fnc_relativeDirTo. Taking the current direction of the object into account.
- Groups:
- Object Manipulation
Syntax
- Syntax:
- object getRelDir position
- Parameters:
- object: Object
- position: Object, Position2D or Position3D
- Return Value:
- Number
Examples
- Example 1:
- Example 2:
Additional Information
- See also:
- getDir direction getDirVisual
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 2018-08-07 - 21:50 (UTC)
- Tankbuster
- To clarify, this returns a relative direction, so objects directly in front are said to be at zero degrees. So, taking example 1 above, if the tank is in front of the player, this function will return 0. If the tank is to the right of the player, it will return 90.