Easy way to calculate angle of impact


I’ve been working quite some hours now to figure out an easy way to calculate the angle of impact (ie a bullet bouncing off, without physicsnode) on a model. I’ve been trying to do it with multiple rays and then determing the angles by comparing the vectors of the closest collisionpoints, but I can’t get it working properly (for (newbish) reasons the angleBetween function and homebrew solutions won’t work with me).

Is there an easier way to do it?

You can get the collision normal with Result.getContactNormal(). Then you can just calculate the angle between the incoming vector and the normal and use that for the “output” angle.



getContactNormal returns a nullpointerexception. Am I forgetting something?

BTW Do you know a good site with explanations about normals and normalization?

Hm, dont know if the normal is available with all types of collision… Normals and normalization have nothing to do with each other :stuck_out_tongue:

Do you know with which types it does? And I know, but I didn’t know 'bout both of them; just learned about normals. :smiley: Not really sure 'xcept a vague feeling what normalization does though; will Google it.