Some questions about the getSurfaceNormal function:
- Why do you need to give it a NodePath? (e.g. render) What are the effects of changing it?
- Which does it get the normal of? The into or the from?
- Does it get the entire object’s normal? Or does it just get the normal of the point of collision(and as asked in question 2… On the into or the from?)
Not an expert but i think for 1) the nodepath is to decide the coordinate system. ie the normal will be expressed in the provided nodepath coordinate system
Not a clue for next…
- The NodePath determines the coordinate system (transform) in which the answer is returned.
2, 3) The normal is the surface normal of the into object at the point of collision.
That makes sense… And if I want the surface normal at the point of collision on the from object, I use:
colEntry.getSurfaceNormal(render) * -1
Well, the surface normal of the from object is not necessarily the inverse of the surface normal of the into object. It completely depends on the shapes of the objects.
In fact, Panda doesn’t bother to compute the surface normal of the from object, since it’s so rarely useful.