Update snapping again

This commit is contained in:
A Man
2022-06-13 13:44:45 +02:00
parent e88677f6ae
commit 8e1400c001
2 changed files with 5 additions and 6 deletions

View File

@@ -615,9 +615,9 @@ if (_canBuild) then {
///////////////////////////////////////////////////////////////////////////////////////////
local _update = {
DZE_memForBack = (DZE_memForBack + 360) % 360; // clamp rotation angles
DZE_memLeftRight = (DZE_memLeftRight + 360) % 360;
DZE_memDir = (DZE_memDir + 360) % 360;
DZE_memForBack = DZE_memForBack % 360; // clamp rotation angles
DZE_memLeftRight = DZE_memLeftRight % 360;
DZE_memDir = DZE_memDir % 360;
[_objectHelper, [DZE_memForBack, DZE_memLeftRight, DZE_memDir]] call fnc_SetPitchBankYaw;
@@ -984,7 +984,7 @@ if (_canBuild) then {
local _bz = abs (_b0 select 2) + abs (_b1 select 2);
local _diag = sqrt (_bx^2 + _by^2 + _bz^2); // get diagonal of boundingBox
DZE_snapRadius = ceil ((_diag * 0.5) + (DZE_maxSnapObjectDiag * 0.5)); // snap radius is the sum of half the bounding box diagonals of both the current object and the largest object in the game; currently the Land_WarfareBarrier10xTall_DZ
DZE_snapRadius = ceil ((_diag + DZE_maxSnapObjectDiag) * 0.5); // snap radius is the sum of half the bounding box diagonals of both the current object and the largest object in the game; currently the Land_WarfareBarrier10xTall_DZ
_refreshDist = DZE_snapRadius * 0.5; // distance object moves before the snap auto-refresh triggers
};

View File

@@ -92,7 +92,6 @@ fnc_initSnapPointsNearby = {
{
local _objectSnapGizmo = DZE_SNAP_HELPER_CLASS createVehicleLocal [0,0,0];
_objectSnapGizmo setObjectTexture DZE_SNAP_POINT_RESET; // green
_objectSnapGizmo setPosATL (getPosATL _nearbyObject);
_objectSnapGizmo setVariable ["snappoint", [_displayName, _x select 3, _memDir], false]; // store object display name, snapping point text, and direction
_x resize 3; // remove text element
@@ -127,7 +126,7 @@ fnc_snapDistanceCheck = {
_snapObject = {
_objectHelper setPosASL (getPosASL _closestNearCurr); // snap object
DZE_memDir = (_closestNearCurr getVariable ["snappoint", ["","",0]]) select 2;
DZE_memDir = (_closestNearCurr getVariable ["snappoint", ["","", getDir _closestNearCurr]]) select 2;
[_objectHelper, [DZE_memForBack, DZE_memLeftRight, DZE_memDir]] call fnc_SetPitchBankYaw;
waitUntil {uiSleep 0.1; !helperDetach};