mirror of
https://github.com/sethduda/AdvancedSlingLoading.git
synced 2024-08-30 17:32:12 +00:00
Adjusting cargo corner points
This commit is contained in:
@ -435,11 +435,11 @@ ASL_Can_Put_Away_Ropes = {
|
||||
ASL_Get_Corner_Points = {
|
||||
params ["_vehicle"];
|
||||
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
|
||||
_widthFactor = 0.75;
|
||||
_lengthFactor = 0.75;
|
||||
_widthFactor = 0.5;
|
||||
_lengthFactor = 0.5;
|
||||
if(_vehicle isKindOf "Air") then {
|
||||
_widthFactor = 0.3;
|
||||
};
|
||||
@ -456,10 +456,13 @@ ASL_Get_Corner_Points = {
|
||||
_widthOffset = ((_maxWidth / 2) - abs ( _centerOfMass select 0 )) * _widthFactor;
|
||||
_maxLength = abs ((_p2 select 1) - (_p1 select 1));
|
||||
_lengthOffset = ((_maxLength / 2) - abs (_centerOfMass select 1 )) * _lengthFactor;
|
||||
_rearCorner = [(_centerOfMass select 0) + _widthOffset, (_centerOfMass select 1) - _lengthOffset, _centerOfMass select 2];
|
||||
_rearCorner2 = [(_centerOfMass select 0) - _widthOffset, (_centerOfMass select 1) - _lengthOffset, _centerOfMass select 2];
|
||||
_frontCorner = [(_centerOfMass select 0) + _widthOffset, (_centerOfMass select 1) + _lengthOffset, _centerOfMass select 2];
|
||||
_frontCorner2 = [(_centerOfMass select 0) - _widthOffset, (_centerOfMass select 1) + _lengthOffset, _centerOfMass select 2];
|
||||
_maxHeight = abs ((_p2 select 2) - (_p1 select 2));
|
||||
_heightOffset = _maxHeight/6;
|
||||
|
||||
_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];
|
||||
};
|
||||
|
Reference in New Issue
Block a user