AssertionError : has_contact_pos()....

Hi Folks,

I’m coliding a CollisionSphere against a CollisionPlane and this nice thingy turned up.

What could be the reason

Martin

It means you called entry.getContactPos() for a CollisionEntry that didn’t compute a contact point. Not all collisions define a contact point; you can use entry.hasContactPos() to check whether this particular one does.

David

thought so.

But how to work around?
Setting up a collisionPolygon?

The Idea was to constrain a ball within a Space and the manual says that testing against Polygons is the most expensive test.

THX
MArtin

A wall of planes is a fine way to constrain a sphere within a space. Use getSurfacePoint() instead of getContactPos().

David

THX
Martin

Worked fine!

but why have some collision contact points and how does the length of the surface normal compute?

Martin

The ‘surface point’ is defined as a point on the surface of the into object near the point of the intersection. The ‘contact point’ is defined as the precise point of intersection, which might be inside the into object if there was a deep interpenetration.

The ‘contact point’ is only offered if it is easy to compute. Often it is not, and since it is rarely used, it isn’t computed.

The surface normal is computed according to the type of surface it is. It should always be of length 1 in the object’s own space. It might have a different length in other spaces, according to the scale transforms in effect.

David

Thanks

learned an other thing …

Martin