mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
snapping corrections and direction lock for similar constructions
Add direction lock. If direction lock it only allows 0 and 180 degrees adjustment. Will force 90 to 180 an 270 to 0 This keeps all snaps in proper order during tests
This commit is contained in:
parent
834d8bcb40
commit
2f6e0bf4c6
@ -223,12 +223,16 @@ if (_class != "") then {
|
|||||||
_Snapdirection = EPOCH_snapDirection;
|
_Snapdirection = EPOCH_snapDirection;
|
||||||
EP_snapPos = [0,0,0];
|
EP_snapPos = [0,0,0];
|
||||||
_snapped = false;
|
_snapped = false;
|
||||||
|
_dirlock = false;
|
||||||
{
|
{
|
||||||
_nearestObject = _x;
|
_nearestObject = _x;
|
||||||
_isSnap = false;
|
_isSnap = false;
|
||||||
|
|
||||||
// Vector + Snapping
|
// Vector + Snapping
|
||||||
_snapMemoryPoint = "";
|
_snapMemoryPoint = "";
|
||||||
|
if( ((typeOf _nearestObject) isEqualTo _staticClass) || ((_nearestObject isKindOf "Const_floors_static_F") && (_staticClass isKindOf "Const_floors_static_F")) || ((_nearestObject isKindOf "Const_Cinder_static_F") && (_staticClass isKindOf "Const_Cinder_static_F")) || ((_nearestObject isKindOf "Const_WoodWalls_static_F") && (_staticClass isKindOf "Const_WoodWalls_static_F")) )then{
|
||||||
|
_dirLock = true;
|
||||||
|
};
|
||||||
|
|
||||||
_snapPosition = [0, 0, 0];
|
_snapPosition = [0, 0, 0];
|
||||||
if (!isNull _nearestObject) then {
|
if (!isNull _nearestObject) then {
|
||||||
@ -273,6 +277,11 @@ if (_class != "") then {
|
|||||||
else {
|
else {
|
||||||
_direction = 0;
|
_direction = 0;
|
||||||
};
|
};
|
||||||
|
if(_dirLock)then{
|
||||||
|
["Snap Direction LOCKED to 0 and 180", 5] call Epoch_message;
|
||||||
|
if(EPOCH_snapDirection isEqualTo 3)then{EPOCH_snapDirection = 0;};
|
||||||
|
if(EPOCH_snapDirection isEqualTo 1)then{EPOCH_snapDirection = 2;};
|
||||||
|
};
|
||||||
if (EPOCH_snapDirection > 0) then {
|
if (EPOCH_snapDirection > 0) then {
|
||||||
_direction = _direction + (EPOCH_snapDirection * 90);
|
_direction = _direction + (EPOCH_snapDirection * 90);
|
||||||
};
|
};
|
||||||
@ -325,7 +334,12 @@ if (_class != "") then {
|
|||||||
_currentTarget setVectorDirAndUp [_vectorDir,_vectorUP];
|
_currentTarget setVectorDirAndUp [_vectorDir,_vectorUP];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if(_dirLock)then{
|
||||||
|
_currentTarget setVectorDirAndUp [_dir2,_vectorUP];
|
||||||
|
_currentTarget setposATL _snapPosition;
|
||||||
|
};
|
||||||
|
|
||||||
_snapped = true;
|
_snapped = true;
|
||||||
_arr_snapPoints = [];
|
_arr_snapPoints = [];
|
||||||
EPOCH_arr_snapPoints = [];
|
EPOCH_arr_snapPoints = [];
|
||||||
|
Loading…
Reference in New Issue
Block a user