CBA_fnc_modelHeadDir

Description

Get the direction of any unit’s head.

This can be used on any character model provided it has the “neck” and “pilot” mem points defined in the model.

This works for proxy models as well!

Parameters

_unitUnit to check [Object]

Returns

[<NUMBER>, <NUMBER>, <NUMBER>]

  • Direction of unit head
  • Difference angle (negative or positive), e.g how many degrees turning to center object horizontally
  • Pitch of head (off of flat plane)

Examples

_data = [object] call CBA_fnc_headDir;
// => returns direction of objects head

TODO

Check for mem points.  Make sure that it doesn’t throw an RPT error if executed pre-init/during init

ImplementationNote

Model must contain the needed mempoints for the calculations to work.  This should not be an issue for any ArmA2 models, but I can not guarantee it will work on all models all the time.  Until there is a way to test for that it should be used with some caution and if you are getting invalid results then revert to the older method of CBA_fnc_headDir.

Author

Nou

Close