2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2016-10-12 22:35:24 +00:00
|
|
|
/*
|
|
|
|
* Author: jaynus / nou
|
|
|
|
* Change a projectile's direction, maintaing speed
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Projectile <OBJECT>
|
|
|
|
* 1: Direction (unit vector) <ARRAY>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [missile, [0,1,0]] call ace_missileguidance_fnc_changeMissileDirection;
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2016-05-30 16:37:03 +00:00
|
|
|
|
2021-03-19 05:28:55 +00:00
|
|
|
params ["_projectile", "_pitch", "_yaw", "_roll"];
|
|
|
|
|
|
|
|
private _dir = [sin _yaw * cos _pitch, cos _yaw * cos _pitch, sin _pitch];
|
|
|
|
private _up = [[sin _roll, -sin _pitch, cos _roll * cos _pitch], -_yaw] call BIS_fnc_rotateVector2D;
|
|
|
|
|
|
|
|
_projectile setVectorDirAndUp [_dir, _up];
|