Suggestion; Have CCD for another collision option in the future

Would be nice if the engine by default had Continuous Collision Detection as a option to select from to deal with objects that go too fast for the regular collisions to work properly or if the frame rate is low for one reason or another and also causes the regular collision to bug out.

Just to check, are you asking if it’s possible now or are you suggesting an editor facing value in the physics component?

I’m sure it’s possible now but I’m just not that good at coding to make it myself as I researched about it I found this;

However the script/library no longer functions when trying to import the script and then use it on a object sadly no longer works on the current version of PlayCanvas Engine.

I also found a guide on how to implement it yourself for regular games however I have no idea on how’d you get it working inside of the PlayCanvas engine itself since it seems you’d to do your own physics script then as-well. http://codetheory.in/game-physics-basics-and-implementation-of-predictive-collision-detection/


So TLDR; It’d be nice if all I had to do with the engine would be set the game entity collision to ContinuousDynamic and all the possible things it can hit for their collisions to Continuous and then let the Engine take care of the rest. (Like Unity/Phaser do)

I had a quick look for Ammo.js (the library we use for physics) and looks like the functions are exposed to enable CCD. I’ve also created some scripts in the past to enable the use of filters in physics (i.e. A can collide with B but not C). Hopefully I will get a bit of time before the holidays to create projects to show this and add them to the tutorial section.

While it be nice to add this to the Editor itself, it will take a bit of time to design and implement whereas I can provide a script to get you there first in the meantime.

Thanks, just currently working on a Pong game and couldn’t find a way to deal with increasing the ball’s speed to it constantly breaking out of the confinement walls.

Here we go, an example of enabling CCD on physics objects: https://playcanvas.com/project/447023/overview/physics-with-ccd

1 Like