I have to do some hit-analysis of a gun in a flightsim. The gunfire is done using the
SolidParticleSystem. Currently I do the hit analysis using
SolidParticle.intersectsMesh() as proposed by the
SolidParticleSystem documentation. Works ok, but is quite inaccurate bc. of AABB intersection testing. Therefor I already refine by
GroundMesh.getHeightAtCoordinates() for terrain hits.
It springs to mind using the ray-casting for more accurate intersection testing.
My question is: What is the best strategy?
- Is it feasible to use
SolidParticle.intersectsMesh()first and in case of a hit refine that with a
- Don’t do
SolidParticle.intersectsMesh()upfront and use
Ray.intersectsMesh()with any potential target directly?
Scene.pickWithRay()directly (making sure that the scene is properly configured concerning
- For terrain, use raycasting or try to find intersection point with
Thank you for any opinion,