mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
e2ac18a05d
* advanced_ballistics * advanced_fatigue * advanced_throwing * ai * aircraft * arsenal * atragmx * attach * backpacks * ballistics * captives * cargo * chemlights * common * concertina_wire * cookoff * dagr * disarming * disposable * dogtags * dragging * explosives * fastroping * fcs * finger * frag * gestures * gforces * goggles * grenades * gunbag * hearing * hitreactions * huntir * interact_menu * interaction * inventory * kestrel4500 * laser * laserpointer * logistics_uavbattery * logistics_wirecutter * magazinerepack * map * map_gestures * maptools * markers * medical * medical_ai * medical_blood * medical_menu * microdagr * minedetector * missileguidance * missionmodules * mk6mortar * modules * movement * nametags * nightvision * nlaw * optics * optionsmenu * overheating * overpressure * parachute * pylons * quickmount * rangecard * rearm * recoil * refuel * reload * reloadlaunchers * repair * respawn * safemode * sandbag * scopes * slideshow * spectator * spottingscope * switchunits * tacticalladder * tagging * trenches * tripod * ui * vector * vehiclelock * vehicles * viewdistance * weaponselect * weather * winddeflection * yardage450 * zeus * arsenal defines.hpp * optionals * DEBUG_MODE_FULL 1 * DEBUG_MODE_FULL 2 * Manual fixes * Add SQF Validator check for #include after block comment * explosives fnc_openTimerUI * fix uniqueItems
60 lines
1.3 KiB
Plaintext
60 lines
1.3 KiB
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: Bohemia Interactive edit by KoffeinFlummi
|
|
* Sets the value of an ACE_Parameter and makes it public.
|
|
*
|
|
* Arguments:
|
|
* 0: Unit/Vehicle <OBJECT>
|
|
* 1: Pitch <NUMBER>
|
|
* 2: Yaw <NUMBER>
|
|
* 3: Bank <NUMBER>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [bob, 1, 2, 3] call ace_common_fnc_setPitchBankYaw
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
|
|
params ["_object", "_aroundX", "_aroundY", "_aroundZ"];
|
|
|
|
_aroundZ = - _aroundZ;
|
|
|
|
private _dirX = 0;
|
|
private _dirY = 1;
|
|
private _dirZ = 0;
|
|
private _upX = 0;
|
|
private _upY = 0;
|
|
private _upZ = 1;
|
|
|
|
if (_aroundX != 0) then {
|
|
_dirY = cos _aroundX;
|
|
_dirZ = sin _aroundX;
|
|
_upY = -sin _aroundX;
|
|
_upZ = cos _aroundX;
|
|
};
|
|
|
|
if (_aroundY != 0) then {
|
|
_dirX = _dirZ * sin _aroundY;
|
|
_dirZ = _dirZ * cos _aroundY;
|
|
_upX = _upZ * sin _aroundY;
|
|
_upZ = _upZ * cos _aroundY;
|
|
};
|
|
|
|
if (_aroundZ != 0) then {
|
|
private _dirXTemp = _dirX;
|
|
_dirX = (_dirXTemp* cos _aroundZ) - (_dirY * sin _aroundZ);
|
|
_dirY = (_dirY * cos _aroundZ) + (_dirXTemp * sin _aroundZ);
|
|
|
|
private _upXTemp = _upX;
|
|
_upX = (_upXTemp * cos _aroundZ) - (_upY * sin _aroundZ);
|
|
_upY = (_upY * cos _aroundZ) + (_upXTemp * sin _aroundZ);
|
|
};
|
|
|
|
private _dir = [_dirX, _dirY, _dirZ];
|
|
private _up = [_upX, _upY, _upZ];
|
|
|
|
_object setVectorDirAndUp [_dir,_up];
|