saharan / OimoPhysics

A cross-platform 3D physics engine
MIT License
863 stars 68 forks source link

Continious collision detection. #9

Open xoopx opened 6 years ago

xoopx commented 6 years ago

Hi, would it be complicated to integrate continious collision detection for certain bodies? Bodies with high speed slips through each other, i managed to resolve this problem with multiple world.step call each frame but this highly impacts performance. And one more question, are there any plans with terrain geometry?

saharan commented 6 years ago

Hi,

Implementing continuous collision detection is difficult and complicated, but I want to implement CCD some time, as high-speed objects are often required in games.

Until the implementation, you can use convex casting instead of CCD. Convex casting enables to "throw" a convex geometry (note: all geometries are convex so far) and computes when the thrown geometry hits another. You can specify geometry with beginning transform and linear translation, then get "time of impact" from 0.0 to 1.0 through callback function if hits. It's a bit complicated but probably improves performance. (I maybe add this to the demo box later)

And one more question, are there any plans with terrain geometry?

yes, I'm planning to add static trimesh for terrains :)