Adjusting cargo corner points

This commit is contained in:
sethduda
2016-04-12 23:04:14 -04:00
parent 29e505c2d6
commit 28101a0603

View File

@ -435,11 +435,11 @@ ASL_Can_Put_Away_Ropes = {
ASL_Get_Corner_Points = { ASL_Get_Corner_Points = {
params ["_vehicle"]; params ["_vehicle"];
private ["_centerOfMass","_bbr","_p1","_p2","_rearCorner","_rearCorner2","_frontCorner","_frontCorner2"]; private ["_centerOfMass","_bbr","_p1","_p2","_rearCorner","_rearCorner2","_frontCorner","_frontCorner2"];
private ["_maxWidth","_widthOffset","_maxLength","_lengthOffset","_widthFactor","_lengthFactor"]; private ["_maxWidth","_widthOffset","_maxLength","_lengthOffset","_widthFactor","_lengthFactor","_maxHeight","_heightOffset"];
// Correct width and length factor for air // Correct width and length factor for air
_widthFactor = 0.75; _widthFactor = 0.5;
_lengthFactor = 0.75; _lengthFactor = 0.5;
if(_vehicle isKindOf "Air") then { if(_vehicle isKindOf "Air") then {
_widthFactor = 0.3; _widthFactor = 0.3;
}; };
@ -456,10 +456,13 @@ ASL_Get_Corner_Points = {
_widthOffset = ((_maxWidth / 2) - abs ( _centerOfMass select 0 )) * _widthFactor; _widthOffset = ((_maxWidth / 2) - abs ( _centerOfMass select 0 )) * _widthFactor;
_maxLength = abs ((_p2 select 1) - (_p1 select 1)); _maxLength = abs ((_p2 select 1) - (_p1 select 1));
_lengthOffset = ((_maxLength / 2) - abs (_centerOfMass select 1 )) * _lengthFactor; _lengthOffset = ((_maxLength / 2) - abs (_centerOfMass select 1 )) * _lengthFactor;
_rearCorner = [(_centerOfMass select 0) + _widthOffset, (_centerOfMass select 1) - _lengthOffset, _centerOfMass select 2]; _maxHeight = abs ((_p2 select 2) - (_p1 select 2));
_rearCorner2 = [(_centerOfMass select 0) - _widthOffset, (_centerOfMass select 1) - _lengthOffset, _centerOfMass select 2]; _heightOffset = _maxHeight/6;
_frontCorner = [(_centerOfMass select 0) + _widthOffset, (_centerOfMass select 1) + _lengthOffset, _centerOfMass select 2];
_frontCorner2 = [(_centerOfMass select 0) - _widthOffset, (_centerOfMass select 1) + _lengthOffset, _centerOfMass select 2]; _rearCorner = [(_centerOfMass select 0) + _widthOffset, (_centerOfMass select 1) - _lengthOffset, (_centerOfMass select 2)+_heightOffset];
_rearCorner2 = [(_centerOfMass select 0) - _widthOffset, (_centerOfMass select 1) - _lengthOffset, (_centerOfMass select 2)+_heightOffset];
_frontCorner = [(_centerOfMass select 0) + _widthOffset, (_centerOfMass select 1) + _lengthOffset, (_centerOfMass select 2)+_heightOffset];
_frontCorner2 = [(_centerOfMass select 0) - _widthOffset, (_centerOfMass select 1) + _lengthOffset, (_centerOfMass select 2)+_heightOffset];
[_rearCorner,_rearCorner2,_frontCorner,_frontCorner2]; [_rearCorner,_rearCorner2,_frontCorner,_frontCorner2];
}; };