BIS fnc rotateVector2D: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (format)
Line 59: Line 59:
To counter this, simply negate their output:
To counter this, simply negate their output:


<code>[<nowiki>[0,1,0]</nowiki>, '''-('''[[getDir]] _object''')'''] [[call]] BIS_fnc_rotateVector2D;</code>
<code>[<nowiki>[0,1,0]</nowiki>, '''-('''[[getDir]] _object''')'''] [[call]] [[BIS_fnc_rotateVector2D]];</code>
<code>[<nowiki>[0,1,0]</nowiki>, '''-('''[_unit, _vehicle] [[call]] [[BIS_fnc_dirTo]]''')'''] [[call]] BIS_fnc_rotateVector2D;</code>
<code>[<nowiki>[0,1,0]</nowiki>, '''-('''[_unit, _vehicle] [[call]] [[BIS_fnc_dirTo]]''')'''] [[call]] [[BIS_fnc_rotateVector2D]];</code>
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->
<!-- DISCONTINUE Notes -->

Revision as of 13:57, 18 September 2016

Hover & click on the images for description

Description

Description:
/************************************************************
	Rotate 2D Vector

Parameters: [[vector], angle]
Returns: [vector]

This function returns a 2D vector rotated a specified number
of degrees around the origin.
************************************************************/

(Placeholder description extracted from the function header by BIS_fnc_exportFunctionsToWiki)
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
Syntax needed
Return Value:
Return value needed

Examples

Example 1:

Additional Information

See also:
See also needed

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

Notes

Bottom Section

Posted on January 21, 2015 - 14:15 (UTC)
AgentRevolution
Be careful when using this function in conjunction with getDir or BIS_fnc_dirTo; they return a clockwise angle, while the rotation is done counterclockwise (mathematically correct).
To counter this, simply negate their output: [[0,1,0], -(getDir _object)] call BIS_fnc_rotateVector2D; [[0,1,0], -([_unit, _vehicle] call BIS_fnc_dirTo)] call BIS_fnc_rotateVector2D;