I want to keep track of triangle that I use a reference pointer to a location on weapon model, I would also like to use that triangles facing direction as the travel direction of bullets when fire is called is there an easy built in way to do it…apart from setting up a ray reflection, or is this my best option.
The triangles should have information about the normals already, so just convert it to the coordinate space you want and you should be sorted. Unless i’m missing something
[java]Triangle triangle = // however you got the triangle, perhaps a ray with results.getClosestCollision().getTriangle(null);
Vector3f normal = triangle.getNormal(); // this will be in object/model space (i think)
spatial.getWorldRotation ().mult (normal); //using the spatial the triangle belongs to, you can get the triangle normal direction in another coordinate system (global in this case)[/java]