Collision normal questions

Some questions about the getSurfaceNormal function:

  1. Why do you need to give it a NodePath? (e.g. render) What are the effects of changing it?
  2. Which does it get the normal of? The into or the from?
  3. 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?)

Hello ,

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…

Exactly right.

  1. 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.

David

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

Right?

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.

David