mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
If the surface is not horizontal create _v2 pointing upward instead of away
This commit is contained in:
parent
21c4efcbba
commit
18fd198d1e
@ -72,6 +72,11 @@ if (_surfaceNormal vectorDotProduct (_endPosASL vectorDiff _startPosASL) > 0) t
|
||||
// Check if its a valid surface: big enough, reasonably plane
|
||||
private _v1 = vectorNormalized (_surfaceNormal vectorMultiply -1);
|
||||
private _v2 = vectorNormalized (_v1 vectorCrossProduct (_endPosASL vectorDiff _startPosASL));
|
||||
// If the surface is not horizontal (>25º), create vup _v2 pointing upward instead of away
|
||||
if (_v1 select 2 > -0.42) then {
|
||||
private _v3Temp = _v1 vectorCrossProduct [0, 0, 1];
|
||||
_v2 = _v3Temp vectorCrossProduct _v1;
|
||||
};
|
||||
private _v3 = _v2 vectorCrossProduct _v1;
|
||||
|
||||
TRACE_3("Reference:", _v1, _v2, _v3);
|
||||
|
Loading…
Reference in New Issue
Block a user