Exile Snapping #1

This commit is contained in:
DESKTOP-UH65DCE\MusTanG 2017-07-23 19:24:27 -05:00
parent 1be712d100
commit a1dd93b901

View File

@ -109,8 +109,8 @@ while {ExileClientConstructionResult isEqualTo 0} do
ExileClientConstructionCurrentSnapToObject = objNull;
_position = getPosATL player;
_position set [2, -500];
_newDirAndUp = [[sin BuildVecYaw * cos BuildVecPitch, cos BuildVecYaw * cos BuildVecPitch, sin BuildVecPitch],[[ sin BuildVecRoll,-sin BuildVecPitch,cos BuildVecRoll * cos BuildVecPitch],-BuildVecYaw] call BIS_fnc_rotateVector2D];
_vectorDirection = _newDirAndUp select 0;
_rotation = (ExileClientConstructionRotation + (getDir player) + 360) % 360;
_vectorDirection = [sin(_rotation), cos(_rotation), 0];
_potentionalSnapObject = cursorTarget;
if !(isNull _potentionalSnapObject) then
{
@ -133,19 +133,15 @@ while {ExileClientConstructionResult isEqualTo 0} do
}
else
{
_newDirAndUp = [[sin BuildVecYaw * cos BuildVecPitch, cos BuildVecYaw * cos BuildVecPitch, sin BuildVecPitch],[[ sin BuildVecRoll,-sin BuildVecPitch,cos BuildVecRoll * cos BuildVecPitch],-BuildVecYaw] call BIS_fnc_rotateVector2D];
_vectorDirection = _newDirAndUp select 0;
_vectorUp = _newDirAndUp select 1;
ExileClientConstructionObject setVectorDirAndUp [_vectorDirection,_vectorUp];
_position = ASLtoATL (AGLtoASL (player modelToWorld ExileClientConstructionOffset));
ExileClientConstructionObject setPosATL _position;
ExileClientConstructionObject attachTo [ExileClientConstructionCurrentSnapToObject,ExileClientConstructionOffset];
_rotation = (ExileClientConstructionRotation + (getDir player) + 360) % 360;
_vectorDirection = [sin(_rotation), cos(_rotation), 0];
{
if (_x distance _position < 1) exitWith
{
_position = _x;
_newDirAndUp = [[sin BuildVecYaw * cos BuildVecPitch, cos BuildVecYaw * cos BuildVecPitch, sin BuildVecPitch],[[ sin BuildVecRoll,-sin BuildVecPitch,cos BuildVecRoll * cos BuildVecPitch],-BuildVecYaw] call BIS_fnc_rotateVector2D];
_vectorDirection = _newDirAndUp select 0;
_rotation = (ExileClientConstructionRotation + (getDir ExileClientConstructionCurrentSnapToObject) + 360) % 360;
_vectorDirection = [sin(_rotation), cos(_rotation), 0];
_vectorUp = vectorUp ExileClientConstructionCurrentSnapToObject;
ExileClientConstructionIsSnapped = true;
};