#How do you access turretAxis configFile

1 messages · Page 1 of 1 (latest)

autumn leaf
#

_veh selectionPosition "osaveze" does return non-[0,0,0] on all the vanilla and cup arty though. Could just fall back to vehicle center if it fails on a vic.

olive vigil
#

okay so using that command directly on osaveze does return something. i just couldn't get it via configFile

#

so the command has a broader range of what it looks for

#

selectionPosition

autumn leaf
autumn leaf
olive vigil
#

meaning it finds things that are not in config viewer

autumn leaf
#

Oh yeah. You can also check selectionNames

olive vigil
#

also the value it gives has negative z, so i'm not sure how to convert that to world

autumn leaf
#
private _gunPosASL = _vehicle modelToWorldWorld _selectionPos;
#

then vector from gun to target, zero the z for horizontal, normalize (set to 1m length), set the z for elevation angle, normalize again, and vectorMultiply to desired distance. probably 1 km is fine?

olive vigil
#

so the negative z is actually upward

autumn leaf
#

the selectionPosition result is vehicle-space coordinates.

olive vigil
#

my math is using the distance to target and rotating it down:

    for "_rad" from 88 to 60 step 2 do {
        private _testVec = [
            (cos _rad) * (_tgtVec select 0),
            (cos _rad) * (_tgtVec select 1),
            (sin _rad) * (_tgtVec select 2)
olive vigil
autumn leaf
#

Would not want to rotate vectors in 3D unless I had to xD.
I would do

_vectorDirect = _gunPos vectorFromTo _tgtPos;
_vectorDirect set [2, 0]; // Horizontal
_x = vectorMagnitude _vectorDirect;

for //
private _z = _x * tan _angle;
_vectorDirect set [2, _z];
private _checkPos = _gunPos vectorAdd _vectorDirect;
//check
olive vigil
#

so 1 tan in the loop instead of 3 cos/rad?

autumn leaf
#

the x and y to the target doesn't change, just the z for elevation.

#

your code would only work if target is due east? i think

olive vigil
#

gjk ampersand editino

autumn leaf
#

nope

olive vigil
#

ok thanks for help