Jump to content

Sign in to follow this  
M.Evans

Flipping a unit

Recommended Posts

Is there a script which allows you to flip a unit, Like invert them,

I need a plane to be inverted and I am not sure of the command for such,

any help is appreciated,

thanks.

Share this post


Link to post
Share on other sites

Hi... you should be able to orient an object anyway you want with this function. It simply returns true when completed.

fn_orientObject.sqf:-

/*

call with: _bool = [object,direction,angle,pitch] call fn_orientObject

*/

private ["_obj","_dir","_ang","_pit","_vecdx","_vecdy","_vecdz","_vecux","_vecuy","_vecuz"];

_obj = _this select 0;
_dir = _this select 1;
_ang = _this select 2;
_pit = _this select 3;

_vecdx = sin(_dir) * cos(_ang);
_vecdy = cos(_dir) * cos(_ang);
_vecdz = sin(_ang);

_vecux = cos(_dir) * cos(_ang) * sin(_pit);
_vecuy = sin(_dir) * cos(_ang) * sin(_pit);
_vecuz = cos(_ang) * cos(_pit);

_obj setVectorDirAndUp [[_vecdx,_vecdy,_vecdz],[_vecux,_vecuy,_vecuz]];

true

In your init.sqf...

fn_orientObject = compile preprocessFileLineNumbers "fn_orientObject.sqf";

Edited by twirly
Clarity

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  

×