From 6541600d44222d6b8cb3acb3a75981a2defaa67c Mon Sep 17 00:00:00 2001 From: Nou Date: Fri, 3 Apr 2015 15:26:27 -0700 Subject: [PATCH] Switch everything to use modelToWorldVisual instead of modelToWorld. --- addons/attach/functions/fnc_attach.sqf | 2 +- addons/attach/functions/fnc_canAttach.sqf | 2 +- addons/attach/functions/fnc_placeApprove.sqf | 2 +- addons/backpacks/functions/fnc_backpackOpened.sqf | 2 +- addons/common/functions/fnc_addToInventory.sqf | 6 +++--- addons/common/functions/fnc_canGetInPosition.sqf | 4 ++-- addons/common/functions/fnc_getTurretDirection.sqf | 4 ++-- addons/common/functions/fnc_inWater.sqf | 2 +- addons/dragging/functions/fnc_carryObject.sqf | 2 +- addons/dragging/functions/fnc_dragObject.sqf | 2 +- addons/dragging/functions/fnc_handleScrollWheel.sqf | 2 +- addons/explosives/functions/fnc_dialingPhone.sqf | 2 +- addons/explosives/functions/fnc_placeExplosive.sqf | 2 +- addons/interact_menu/functions/fnc_renderBaseMenu.sqf | 8 ++++---- addons/laser/functions/fnc_findLaserDesignator.sqf | 2 +- .../functions/fnc_laserHudDesignateOn.sqf | 8 +++++--- addons/laserpointer/functions/fnc_drawLaserpoint.sqf | 2 +- addons/medical/functions/fnc_isInMedicalFacility.sqf | 2 +- addons/missileguidance/functions/fnc_guidance_DAGR.sqf | 2 +- addons/missileguidance/functions/fnc_guidance_LGB.sqf | 2 +- addons/movement/functions/fnc_handleClimb.sqf | 2 +- addons/resting/functions/fnc_getIntersection.sqf | 2 +- addons/safemode/functions/fnc_playChangeFiremodeSound.sqf | 2 +- .../functions/fnc_playChangeFiremodeSound.sqf | 2 +- 24 files changed, 35 insertions(+), 33 deletions(-) diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index a8b73052dc..3703514fb6 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -94,7 +94,7 @@ if (_unit == _attachToVehicle) then { //Self Attachment _unit removeAction _actionID; if (GVAR(placeAction) == 1) then { - _startingPosition = _tempObject modelToWorld [0,0,0]; + _startingPosition = _tempObject modelToWorldVisual [0,0,0]; [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _startingPosition] call FUNC(placeApprove); }; deleteVehicle _tempObject; diff --git a/addons/attach/functions/fnc_canAttach.sqf b/addons/attach/functions/fnc_canAttach.sqf index 966794b32f..d0930dc069 100644 --- a/addons/attach/functions/fnc_canAttach.sqf +++ b/addons/attach/functions/fnc_canAttach.sqf @@ -25,6 +25,6 @@ _itemName = [_args, 0, ""] call CBA_fnc_defaultParam; _attachLimit = [6, 1] select (_player == _attachToVehicle); _attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; -_playerPos = (ACE_player modelToWorld (ACE_player selectionPosition "pilot")); +_playerPos = (ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot")); (canStand _player) && {(_attachToVehicle distance _player) < 7} && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_itemName in ((itemsWithMagazines _player) + [""])}; diff --git a/addons/attach/functions/fnc_placeApprove.sqf b/addons/attach/functions/fnc_placeApprove.sqf index 576721cf59..60c5e3a9bf 100644 --- a/addons/attach/functions/fnc_placeApprove.sqf +++ b/addons/attach/functions/fnc_placeApprove.sqf @@ -45,7 +45,7 @@ while {(_closeInMax - _closeInMin) > 0.01} do { // systemChat format ["Trying %1 from %2 start %3", _closeInDistance, [_closeInMax, _closeInMin], _startDistanceFromCenter]; _endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance); _endPosTestOffset set [2, (_startingOffset select 2)]; - _endPosTest = _attachToVehicle modelToWorld _endPosTestOffset; + _endPosTest = _attachToVehicle modelToWorldVisual _endPosTestOffset; _doesIntersect = false; { diff --git a/addons/backpacks/functions/fnc_backpackOpened.sqf b/addons/backpacks/functions/fnc_backpackOpened.sqf index 186202027f..1894d68f23 100644 --- a/addons/backpacks/functions/fnc_backpackOpened.sqf +++ b/addons/backpacks/functions/fnc_backpackOpened.sqf @@ -37,7 +37,7 @@ _sounds = [ QUOTE(PATHTO_R(sounds\zip_out.wav)) ]; -_position = _target modelToWorld (_target selectionPosition "Spine3"); +_position = _target modelToWorldVisual (_target selectionPosition "Spine3"); _position = _position call EFUNC(common,positionToASL); playSound3D [ diff --git a/addons/common/functions/fnc_addToInventory.sqf b/addons/common/functions/fnc_addToInventory.sqf index 4e088525fc..b28d864df8 100644 --- a/addons/common/functions/fnc_addToInventory.sqf +++ b/addons/common/functions/fnc_addToInventory.sqf @@ -57,7 +57,7 @@ switch ((_type select 0)) do { }; } else { _addedToPlayer = false; - _pos = _unit modelToWorld [0,1,0.05]; + _pos = _unit modelToWorldVisual [0,1,0.05]; _unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"]; _unit addWeaponCargoGlobal [_classname,1]; _unit setPosATL _pos; @@ -73,7 +73,7 @@ switch ((_type select 0)) do { }; } else { _addedToPlayer = false; - _pos = _unit modelToWorld [0,1,0.05]; + _pos = _unit modelToWorldVisual [0,1,0.05]; _unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"]; _unit addMagazineCargoGlobal [_classname, 1]; _unit setPosATL _pos; @@ -89,7 +89,7 @@ switch ((_type select 0)) do { }; } else { _addedToPlayer = false; - _pos = _unit modelToWorld [0,1,0.05]; + _pos = _unit modelToWorldVisual [0,1,0.05]; _unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"]; _unit addItemCargoGlobal [_classname,1]; _unit setPosATL _pos; diff --git a/addons/common/functions/fnc_canGetInPosition.sqf b/addons/common/functions/fnc_canGetInPosition.sqf index 5ac4c527fd..f4337b6171 100644 --- a/addons/common/functions/fnc_canGetInPosition.sqf +++ b/addons/common/functions/fnc_canGetInPosition.sqf @@ -242,10 +242,10 @@ _fnc_isInRange = { private ["_unitPosition", "_distance"]; _unitPosition = getPos _unit; - _distance = _unitPosition distance (_vehicle modelToWorld _selectionPosition); + _distance = _unitPosition distance (_vehicle modelToWorldVisual _selectionPosition); if (!isNil "_selectionPosition2") then { - _distance = _distance min (_unitPosition distance (_vehicle modelToWorld _selectionPosition2)); + _distance = _distance min (_unitPosition distance (_vehicle modelToWorldVisual _selectionPosition2)); }; _distance < _radius diff --git a/addons/common/functions/fnc_getTurretDirection.sqf b/addons/common/functions/fnc_getTurretDirection.sqf index 0619fb302c..fb265bf545 100644 --- a/addons/common/functions/fnc_getTurretDirection.sqf +++ b/addons/common/functions/fnc_getTurretDirection.sqf @@ -27,11 +27,11 @@ _povDir = [0,0,0]; if(_pov == "pip0_pos") then { _pipDir = ATLtoASL ( _vehicle modelToWorldVisual (_vehicle selectionPosition "pip0_dir" ) ); - _povDir = _povPos vectorDiff _pipDir; + _povDir = _pipDir vectorDiff _povPos; } else { _gunBeginPos = ATLtoASL ( _vehicle modelToWorldVisual (_vehicle selectionPosition _gunBeg ) ); _gunEndPos = ATLtoASL ( _vehicle modelToWorldVisual (_vehicle selectionPosition _gunEnd ) ); - _povDir = _gunEndPos vectorDiff _gunBeginPos; + _povDir = _gunBeginPos vectorDiff _gunEndPos; }; [_povPos, _povDir] \ No newline at end of file diff --git a/addons/common/functions/fnc_inWater.sqf b/addons/common/functions/fnc_inWater.sqf index ea511d388d..2fdede1737 100644 --- a/addons/common/functions/fnc_inWater.sqf +++ b/addons/common/functions/fnc_inWater.sqf @@ -14,7 +14,7 @@ private ["_unit","_return","_aslPos"]; _unit = _this select 0; _return = false; if ((surfaceIsWater getPos _unit)) then { - _aslPos = _unit modelToWorld (_unit selectionPosition "head"); + _aslPos = _unit modelToWorldVisual (_unit selectionPosition "head"); if ((_aslPos select 2) <= 0) then { _return = true; }; diff --git a/addons/dragging/functions/fnc_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf index 2037dfc3f0..ee72dc9aa7 100644 --- a/addons/dragging/functions/fnc_carryObject.sqf +++ b/addons/dragging/functions/fnc_carryObject.sqf @@ -36,7 +36,7 @@ if (_target isKindOf "CAManBase") then { // add height offset of model private "_offset"; - _offset = (_target modelToWorld [0, 0, 0] select 2) - (_unit modelToWorld [0, 0, 0] select 2); + _offset = (_target modelToWorldVisual [0, 0, 0] select 2) - (_unit modelToWorldVisual [0, 0, 0] select 2); _position = _position vectorAdd [0, 0, _offset]; diff --git a/addons/dragging/functions/fnc_dragObject.sqf b/addons/dragging/functions/fnc_dragObject.sqf index f614af9548..35f8687ed0 100644 --- a/addons/dragging/functions/fnc_dragObject.sqf +++ b/addons/dragging/functions/fnc_dragObject.sqf @@ -25,7 +25,7 @@ _direction = _target getVariable [QGVAR(dragDirection), 0]; // add height offset of model private "_offset"; -_offset = (_target modelToWorld [0, 0, 0] select 2) - (_unit modelToWorld [0, 0, 0] select 2); +_offset = (_target modelToWorldVisual [0, 0, 0] select 2) - (_unit modelToWorldVisual [0, 0, 0] select 2); _position = _position vectorAdd [0, 0, _offset]; diff --git a/addons/dragging/functions/fnc_handleScrollWheel.sqf b/addons/dragging/functions/fnc_handleScrollWheel.sqf index 0782e64db7..96f46413bc 100644 --- a/addons/dragging/functions/fnc_handleScrollWheel.sqf +++ b/addons/dragging/functions/fnc_handleScrollWheel.sqf @@ -36,7 +36,7 @@ if (_carriedItem isKindOf "CAManBase") exitWith {false}; private ["_position", "_maxHeight"]; _position = getPosATL _carriedItem; -_maxHeight = (_unit ModelToWorld [0,0,0]) select 2; +_maxHeight = (_unit modelToWorldVisual [0,0,0]) select 2; _position set [2, ((_position select 2) + _scrollAmount min (_maxHeight + 1.5)) max _maxHeight]; diff --git a/addons/explosives/functions/fnc_dialingPhone.sqf b/addons/explosives/functions/fnc_dialingPhone.sqf index d3c429c9fc..fa992a9cac 100644 --- a/addons/explosives/functions/fnc_dialingPhone.sqf +++ b/addons/explosives/functions/fnc_dialingPhone.sqf @@ -19,7 +19,7 @@ #include "script_component.hpp" EXPLODE_4_PVT(_this select 0,_unit,_i,_arr,_code); if ((_i mod 4) == 0) then { - playSound3D [QUOTE(PATHTO_R(Data\Audio\DialTone.wss)), objNull, false, (_unit ModelToWorld [0,0.2,2]), 15,1,2.5]; + playSound3D [QUOTE(PATHTO_R(Data\Audio\DialTone.wss)), objNull, false, (_unit modelToWorldVisual [0,0.2,2]), 15,1,2.5]; }; ctrlSetText [1400,format["Calling%1",_arr select (_i - 4)]]; diff --git a/addons/explosives/functions/fnc_placeExplosive.sqf b/addons/explosives/functions/fnc_placeExplosive.sqf index 1e1ac44bdf..ce43698309 100644 --- a/addons/explosives/functions/fnc_placeExplosive.sqf +++ b/addons/explosives/functions/fnc_placeExplosive.sqf @@ -15,7 +15,7 @@ * Placed explosive * * Example: - * _explosive = [player, player modelToWorld [0,0.5, 0.1], 134, + * _explosive = [player, player modelToWorldVisual [0,0.5, 0.1], 134, * "SatchelCharge_Remote_Mag", "Command", []] call ACE_Explosives_fnc_placeExplosive; * * Public: Yes diff --git a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf index 077a9239f0..0f03dc1b50 100644 --- a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf @@ -28,15 +28,15 @@ if((count _this) > 2) then { _pos = _this select 2; } else { if(typeName (_actionData select 7) == "ARRAY") then { - _pos = _object modelToWorld (_actionData select 7); + _pos = _object modelToWorldVisual (_actionData select 7); } else { if ((_actionData select 7) == "weapon") then { // Craft a suitable position for weapon interaction _weaponDir = _object weaponDirection currentWeapon _object; _ref = _weaponDir call EFUNC(common,createOrthonormalReference); - _pos = (_object modelToWorld (_object selectionPosition "righthand")) vectorAdd ((_ref select 2) vectorMultiply 0.1); + _pos = (_object modelToWorldVisual (_object selectionPosition "righthand")) vectorAdd ((_ref select 2) vectorMultiply 0.1); } else { - _pos = _object modelToWorld (_object selectionPosition (_actionData select 7)); + _pos = _object modelToWorldVisual (_object selectionPosition (_actionData select 7)); }; }; // Compensate for movement during the frame to get rid of jittering @@ -45,7 +45,7 @@ if((count _this) > 2) then { // For non-self actions, exit if the action is too far away if (GVAR(openedMenuType) == 0 && vehicle ACE_player == ACE_player && - {(ACE_player modelToWorld (ACE_player selectionPosition "pilot")) distance _pos >= _distance}) exitWith {false}; + {(ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot")) distance _pos >= _distance}) exitWith {false}; // Exit if the action is behind you _sPos = if (count _pos != 2) then { diff --git a/addons/laser/functions/fnc_findLaserDesignator.sqf b/addons/laser/functions/fnc_findLaserDesignator.sqf index 73a9462457..d10e221501 100644 --- a/addons/laser/functions/fnc_findLaserDesignator.sqf +++ b/addons/laser/functions/fnc_findLaserDesignator.sqf @@ -19,7 +19,7 @@ if(!(isNil "ACE_LASERS")) then { { if(!(isNull _x)) then { - _sensorPos = ATLtoASL(_missile modelToWorld _offset); + _sensorPos = ATLtoASL(_missile modelToWorldVisual _offset); _vectorTo = [_sensorPos, ([_x] call FUNC(getPosASL))] call BIS_fnc_vectorFromXToY; _polarTo = _vectorTo call CBA_fnc_vect2polar; _dir = _polarTo select 1; diff --git a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf index 57c5d686c9..f44fb2e2b9 100644 --- a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf +++ b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf @@ -1,4 +1,4 @@ -//#define DEBUG_MODE_FULL +// #define DEBUG_MODE_FULL #include "script_component.hpp" TRACE_1("enter", _this); @@ -47,6 +47,8 @@ FUNC(laserHudDesignatePFH) = { _povPos = _turretInfo select 0; _povDir = _turretInfo select 1; + + _result = [_povPos, _povDir] call EFUNC(laser,shootCone); if((count _result) > 0) then { _resultPositions = _result select 2; @@ -77,11 +79,11 @@ FUNC(laserHudDesignatePFH) = { }; #ifdef DEBUG_MODE_FULL drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], (getPosATL _laserTarget), 0.75, 0.75, 0, "", 0.5, 0.025, "TahomaB"]; - + { private["_position"]; _position = _x select 0; - drawLine3d [_povPos, _position, [0,0,1,1] ]; + drawLine3d [ASLToATL _povPos, ASLToATL _position, [0,0,1,1] ]; } forEach _resultPositions; #endif }; diff --git a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf index 969607f987..31be95099a 100644 --- a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf +++ b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf @@ -3,7 +3,7 @@ EXPLODE_3_PVT(_this,_unit,_range,_isGreen); -_p0Pos = _unit modelToWorld (_unit selectionPosition "righthand"); +_p0Pos = _unit modelToWorldVisual (_unit selectionPosition "righthand"); // Convert _p0Pos to ASL _p0 = + _p0Pos; diff --git a/addons/medical/functions/fnc_isInMedicalFacility.sqf b/addons/medical/functions/fnc_isInMedicalFacility.sqf index b1521b288b..bed660a46a 100644 --- a/addons/medical/functions/fnc_isInMedicalFacility.sqf +++ b/addons/medical/functions/fnc_isInMedicalFacility.sqf @@ -37,7 +37,7 @@ _medicalFacility = "USMC_WarfareBFieldhHospital" ]; -_objects = (lineIntersectsWith [_unit modelToWorld [0, 0, (_eyePos select 2)], _unit modelToWorld [0, 0, (_eyePos select 2) +10], _unit]); +_objects = (lineIntersectsWith [_unit modelToWorldVisual [0, 0, (_eyePos select 2)], _unit modelToWorldVisual [0, 0, (_eyePos select 2) +10], _unit]); { if (((typeOf _x) in _medicalFacility) || (_x getVariable [QGVAR(isMedicalFacility),false])) exitwith { _isInBuilding = true; diff --git a/addons/missileguidance/functions/fnc_guidance_DAGR.sqf b/addons/missileguidance/functions/fnc_guidance_DAGR.sqf index 9599a81161..9055b00a7f 100644 --- a/addons/missileguidance/functions/fnc_guidance_DAGR.sqf +++ b/addons/missileguidance/functions/fnc_guidance_DAGR.sqf @@ -83,7 +83,7 @@ FUNC(guidance_DIRECT_LOAL_PFH) = { if(accTime > 0) then { _outVector = [_dagr, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); - // _outVector = _dagr modelToWorld [_yaw, 1, _pitch]; + // _outVector = _dagr modelToWorldVisual [_yaw, 1, _pitch]; // _outVector = ATLtoASL _outVector; _vectorTo = _dagrPos vectorFromTo _outVector; diff --git a/addons/missileguidance/functions/fnc_guidance_LGB.sqf b/addons/missileguidance/functions/fnc_guidance_LGB.sqf index 940c94d34e..47efa46768 100644 --- a/addons/missileguidance/functions/fnc_guidance_LGB.sqf +++ b/addons/missileguidance/functions/fnc_guidance_LGB.sqf @@ -73,7 +73,7 @@ FUNC(guidance_LGB_LOAL_PFH) = { if(accTime > 0) then { _outVector = [_lgb, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); - // _outVector = _lgb modelToWorld [_yaw, 1, _pitch]; + // _outVector = _lgb modelToWorldVisual [_yaw, 1, _pitch]; // _outVector = ATLtoASL _outVector; _vectorTo = _lgbPos vectorFromTo _outVector; diff --git a/addons/movement/functions/fnc_handleClimb.sqf b/addons/movement/functions/fnc_handleClimb.sqf index da0f8e0224..39ca9b1e92 100644 --- a/addons/movement/functions/fnc_handleClimb.sqf +++ b/addons/movement/functions/fnc_handleClimb.sqf @@ -21,7 +21,7 @@ private ["_unit", "_anim", "_pos"]; _unit = _this select 0; _anim = _this select 1; -_pos = _unit modelToWorld (_unit selectionPosition "camera"); +_pos = _unit modelToWorldVisual (_unit selectionPosition "camera"); [_unit, "AmovPknlMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); _pos = _pos vectorDiff (_unit selectionPosition "camera"); diff --git a/addons/resting/functions/fnc_getIntersection.sqf b/addons/resting/functions/fnc_getIntersection.sqf index 395b83f0a4..0527a7c514 100644 --- a/addons/resting/functions/fnc_getIntersection.sqf +++ b/addons/resting/functions/fnc_getIntersection.sqf @@ -18,7 +18,7 @@ EXPLODE_3_PVT(_this,_unit,_vehicle,_weapon); private ["_weaponPos", "_weaponDir", "_weaponPosDown"]; -_weaponPos = ATLtoASL (_unit modelToWorld (_unit selectionPosition "RightHand")); +_weaponPos = ATLtoASL (_unit modelToWorldVisual (_unit selectionPosition "RightHand")); _weaponDir = _unit weaponDirection _weapon; _weaponPosDown = _weaponPos vectorAdd [0,0,-MAXHEIGHT]; diff --git a/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf index c0b58604b9..6c2c797706 100644 --- a/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf +++ b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf @@ -26,7 +26,7 @@ if (count _sound < 3) then {_sound pushBack 1}; if (count _sound < 4) then {_sound pushBack 0}; private "_position"; -_position = _unit modelToWorld (_unit selectionPosition "RightHand"); +_position = _unit modelToWorldVisual (_unit selectionPosition "RightHand"); _position set [2, (_position select 2) + ((getPosASLW _unit select 2) - (getPosATL _unit select 2) max 0)]; playSound3D [_sound select 0, objNull, false, _position, _sound select 1, _sound select 2, _sound select 3]; diff --git a/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf index 82901a1b52..ea671a530d 100644 --- a/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf +++ b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf @@ -27,7 +27,7 @@ if (count _sound < 4) then {_sound pushBack 0}; private "_position"; -_position = _unit modelToWorld (_unit selectionPosition "RightHand"); +_position = _unit modelToWorldVisual (_unit selectionPosition "RightHand"); _position set [2, (_position select 2) + ((getPosASLW _unit select 2) - (getPosATL _unit select 2) max 0)]; playSound3D [_sound select 0, objNull, false, _position, _sound select 1, _sound select 2, _sound select 3];