Finding out collisions

I need to effectively(without the overlap problem) detect collisions, but not apply them. AFAIK, sensor is good at this. However, it doesn’t detect static objects or other sensors. How can I effeciently detect collisions between any 2 objects from an object that acts like no-collision object?

Also, is it possible to detect which exact collision vertices are colliding(in case if triangle mesh)? I need to know for each vertex if it is in collision. I hope that it is possible.

Finally, is it possible to replace the physics mesh to match the current visual mesh during runtime?

I hope that all of those important steps can be solved. They would give me a huge​ development time boost for my project. Thanks! :wink:

1a) Make sure the ‘actor’ checkbox is ticked on any static objects you want to detect with a collision sensor
1b) Try using ghost objects

  1. No, but you can get the hit position using collision callbacks, and when coupled with knowledge of the mesh, you can do this easily enough. But it is quite slow. Anything involving meshes is quite slow unless you can precache it.

  2. Yes, but it is very slow, well, subjectively. Remember the landscape demo in my WIP thread. That was recalculating the physics for 1500 verts only when necessary

I suspect you will hit performance limitations very quickly…

I believe they added something in the API to replace the physics mesh in UPBGE,

obj1.replacePhysicsShape(obj2)

This will replace the physics mesh of obj1 with that of obj2.

As for collision for each vertex, it is somewhat possible, actually you can get all the vertices within a certain radius of the collision point, but it is extremely slow. You can use kdtrees to make it a little faster.

Uh… Ah… Aw… It seems that it’d be easier to model collisions myself in this case. At least I could have full control. But the maths behidnd are VERY complicated.

Can anybody throw me tons of documents about collision detection? I need it focused at triangle meshes.

At my local uni:
ENMT171
EMTH271ENME302

They will throw it at you for 4 months at a time, 9 hours a week. However, the prerequisite tree for those courses amounts to two or three years of study. However, even just EMTH171 and it’s prerequisite EMTH118 would set you in good course for most modelling and vector math. EMTH302 I did last year and it includes FEA methods. It is probably the hardest course I’ve taken so far, but I wish I could remember more of it.

At some point, what you need is just experience at mathematical modelling and physics in general. It is far easier to gain this by going to a university than trying to read up on it yourself. That said, going through a physics textbook or two never hurt anyone…

Huh… You say that I must do something else for 3 years until I graduate medium school(called high school in England, US etc.)? Hm… Sounds scary:D But reading 100 online papers doesn’t sound any better…