Jump to content
Sign in to follow this  
KernelPanicAkr

Arma 3: camSetDir workarround.

Recommended Posts

Today I found that camSetDir wont work as intended. So I made a workarround with similar behaviour.

/*
* Desc: Changes view direction of a camera.
* Params:
*
* param 0: <Object> Camera itself.
* param 1: <Float> Map direction.
* param 2: <Float> Inclination.
*/

AKR_cameraSetTargetDir = {
_camera = [_this, 0, objNull, [objNull]] call BIS_fnc_param;
_dir = [_this select 1, 0, 0, [-1]] call BIS_fnc_param;
_inclination = [_this select 1, 1, 0, [-1]] call BIS_fnc_param;

_camPos = getPos _camera;
_relPos = [sin(_dir), cos(_dir), _inclination];
_result = _camPos vectorAdd _relPos;
_camera camSetTarget (_result);
_camObj camCommit 0;
};

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×