Colliding or not?


Is there any different method from collideWith() to determine if an object is colliding or not? Collision listener reacts only on collision, but I want to know that my object is not colliding as well.

I am calculating things on normal vectors when the object is colliding, I don’t need that calculations when it isn’t colliding.

You get informed about collisions continuously, so you will be called each physics tick when the object collides. When you bump sidewards into an object you actually only collide once, I think thats what might be your problem. The floor for example should continuously report collisions, as well as when your object really rests on two other objects those two collisions are also reported each physics tick. Note that collideWith() works with geometry/bounding information and has nothing to do with the physics collision system.

The thing is that I have to know the direction normal vector. My object won’t have a normal vector when it isn’t colliding. May we have a method like spatialControl.isColliding() :roll:?

I cannot add to bullet whats not there (and they cannot report collisions when there are none). You get a collision, you get informed, you store the collision normals and then you do whatever you need to do. When there is no collision, you have no direction for the collision normal. If you need to know the direction of the object, just check its rotation. If you need the normals for a longer time than the collision happens, store them in some other variable.

Très dommage. Thank you for your reply. I think I’ll find something out :(.