Compound colliders

Hi,

I’m new to PlayCanvas, but have been using Unity for a long time.
One thing that I’m having trouble grasping is how you go about using multiple colliders for 1 rigidbody?

In Unity, all colliders for the entity that has the rigidbody component as well as all colliders on it’s children are treated as one compound collider.
That’s really convenient when trying to describe more advanced shapes, without the overhead of using meshcolliders.

Is there something similar in PlayCanvas that I’m missing? If I add a primitive collider to a child of an entity that has a rigidbody, it seems to be ignored.

Thank’s in advance!

PS. I’m really loving PlayCanvas so far! . DS
/Anders

Hello,

Compound colliders are not currently supported by the default rigid body / collision components. It is in our roadmap to support them. However you could perhaps try implementing this yourself for your project. We are using Ammo.js for physics which is a port of Bullet physics for JavaScript. Here is the documentation for the btCompoundShape for Bullet, which is basically what we are going to use to implement this feature: http://bulletphysics.com/Bullet/BulletFull/classbtCompoundShape.html Give it a shot if you want and we’re here for answers :slight_smile:

Also here’s the source code for the PlayCanvas engine on Github: https://github.com/playcanvas/engine.

Rigibody system: https://github.com/playcanvas/engine/blob/master/src/framework/components/physics/rigidbody_system.js

Collision system: https://github.com/playcanvas/engine/blob/master/src/framework/components/physics/collision/collision_system.js

Thanks a lot vaios, really good information!

While it might be a bit too much for me to handle at the moment (I’m just playing around so far), I might try to incorporate compound colliders at a later time.
Really nice to know that Bullet has support for it.