Determining point collision

Normal facing diagram.png

When the normal and the vector V point in the same direction, the dot product returns 1. If the two vectors are perpendicular, the result is 0. (source)

And when the vectors face away from each other, the dot product is less than 0. We can use this fact to determine if a point in space is colliding(inside) a surface.

Node setup

You need a NURBS surface and a world position(P).

Detecting collision with pointOnSurfaceInfo.png
I've connected the dot product to a condition node to visualize it. (zoom)

  1. Connect P (world position) to a closestPointOnSurface node. Connect this to pointOnSurfaceInfo which contains Q (pointOnSurfaceInfo.position) and N (pointOnSurfaceInfo.normal).

  2. Subtract Q from P using a plusMinusAverage in subtract mode to get vector V, which points from the surface towards the world position.

  3. dotProduct V with N. If the result is less than 0, the point is colliding inside the surface.