#How do you access turretAxis configFile
1 messages · Page 1 of 1 (latest)
Unfortunately I can't seem to find anything in config either. Would only be in model.cfg perhaps https://community.bistudio.com/wiki/Turret_Config_Reference#animationSourceBody_.3D_.22mainTurret.22
_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.
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
How do you mean range?
meaning it finds things that are not in config viewer
Oh yeah. You can also check selectionNames
also the value it gives has negative z, so i'm not sure how to convert that to world
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?
so the negative z is actually upward
the selectionPosition result is vehicle-space coordinates.
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)
er except it should be -2
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
so 1 tan in the loop instead of 3 cos/rad?
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
i hadn't tested that yet, but in any case, i assume the tan way will be faster, so it is a good optimization.
btw, are you the dev of the mem allocator?
gjk ampersand editino
nope
ok thanks for help