Skip to content

Instantly share code, notes, and snippets.

@nomisum
Created September 17, 2022 08:54
Show Gist options
  • Save nomisum/2cd0e94ce38b04aaf56004986e0e0db9 to your computer and use it in GitHub Desktop.
Save nomisum/2cd0e94ce38b04aaf56004986e0e0db9 to your computer and use it in GitHub Desktop.
3den relative attachment extractor
/*
get offsets of all attached objects of vehicle in 3den
*/
private _vehicle = [];
private _objects = [];
private _objectsAndOffsets = [];
private _collection = [];
private _vectors = [];
{
if (!(_x isKindOf "LandVehicle")) then {
_objects pushBack _x;
} else {
_vehicle = _x;
};
} forEach (get3DENSelected "object");
{
_objectsAndOffsets pushBack [typeOf _x, (_vehicle worldToModelVisual ASLToAGL (getPosWorld _x)), ([_vehicle, _x] call BIS_fnc_vectorDirAndUpRelative)];
} forEach _objects;
_collection pushBack [typeOf _vehicle, _objectsAndOffsets];
_collection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment