OK, small update.
Reviewed the code once again, this time with a pen and a piece of paper because I can't work on 3D vectors in my memory... Know what each vector means and how it works at last. Nothing unexpected.
Did some experiments with improving things. Armor and penetration tables changed to float, added code to read in-between penetration values (by approximation for intermediate ranges). The table of GetPenetrationProbability changed into a function of AOI (BTW seems some work was done on this lately, but not finished, this not enabled test function was not that bad). It seems to work without problems.
Now after educating a little and discovery of what HitNormal vector is, I enabled debug and did some experiments with better collision detection, by HitNormal. I understand that this function returns normalised vector perpendicular to the plane of collision mesh (or plane normal) at the point of impact, so exactly what I need. Not sure what happens with turrets, which doesn't have collision mesh, only collision box. Would HitNormal return vector perpendicular to collision box surface ?
Well, it seems that RO and/or UT collision detection is it's Achilles's heel... Most times it works OK, but sometimes I get collision detection on the other side of the vehicle, from the inside... :-/ Probably the same happens in stock game anyway, if the collision point is detected on the other side then the HitAngle is calculated wrong too... Only the fact that those walls are parallel anyway and the angle is the same saves the calcs... But this can be problem sometimes maybe that's the reason why sometimes left track is disabled with right side hit :-/ Not sure why this happens, if the projectile is too fast, or what.... has to slow it down and see...
(I'm also not very happy with the fact that track hit from a front makes penetration and destroys it with two hits...)
I'm not sure why I don't get HitNormal readings on Tiger tank's turret. It has collision mesh, so it should work.
Other tanks have only collision boxes for turrets so if the collision detection was resolved, collision meshes should be added later to the rest of the tanks. In fact to use collision meshes with HitNormal information for collision detection, almost the whole ROVehicles would have to be rebuild eventually.The resulting effect could be very good then, if only the problems could be resolved.
Can vehicle models be exportet from the SDK ? (to make collision meshes from them and import them back). The hull collision meshes could be fine tuned too, some parts from sheet metal removed to not cause unwanted ricoshets. (edit: from what I understand from reading this forum, up to now, it's impossible to export skeletal mesh (from anim packs, like tank turret model) from RO SDK, to work with it in 3D program and import it later as collision mesh ? Do I have really to make new turret collision meshes from scratch ??)
OK, now question for those who could/want to answer:
What would be the best way to detect turret hits ? From within vehicle class ? Can I get name of the bone hit, maybe ? It's not a big problem, I already have two alternatives in mind (like hit height and some other) but best would be to check directly what part was hit, hull or turret....
Second question - how to get turret rotation reading from within vehicle class ?? I'm in RoTreadCraft calculating hit detection and armor penetration, and I need data about current turret rotation to recalculate the axes for turret hits. As it is now, only the hull angle counts, so you can angle hull and you get this bonus on the turret as well. Try this - rotate the Panther's turret backwards, and try to shoot at the turret from the front and from the rear. You will notice that now from the turret rear it has full protection, and the turret front is weak. It's because only the hull rotation counts.
So how to read it from within RoTreadCraft ?
rotator (or vector) TurretRotation
TurretRotation = ?
There is something called TurretRot but doesn't seem to be used and type is TexRotator...
I don't want to use mesh collision angle detection untill problems are resolved, so probably simple box collisions will stay for now, but I want to add real turrets to tanks to nex mod relase, the only thing I need is turret rotation info...
P.S. For some reason, after replacing the ROTreadCraft class, I have some HUD elements missing in tanks - the reload "shell" and tank turret graph... any idea why ?? Something is called not properly now ? all seems to work but some hud elements are not there :-/ (edit: yeah I see, the HitNormal vector is 0,0,0 for turret hits... but why? Tiger turret has collision mesh)