Compound Collisions - Maximum call stack size exceeded

Hi fellow developers,

we’ve run into an issue using compound colliders. When a entity with compound colliders collide with another collider (trigger or collision), ammo.wasm throws a stack overflow error:

“Uncaught RangeError: Maximum call stack size exceeded”

Project: https://playcanvas.com/project/736945

Did you also run into such problems? Any hints appreciated,
Rene

Hi @dexter_deluxe,

I can confirm the behavior, though it seems to be isolated to Kinematic compound bodies.

Setting the CompoundCollision body to dynamic it has no problem to go through the trigger and correctly trigger the triggerenter/triggerleave events.

Would you care to submit an issue about it in the engine repo?

1 Like

Sounds similar to this error: https://github.com/playcanvas/engine/issues/2152

2 Likes

Hi,

thanks for the quick reply.

I can confirm that:

    // this throws errors when entering the trigger
    this.entity.setPosition(this._orgPosition.x, this._orgPosition.y + up, this._orgPosition.z);

    // this would work without errors
    this.entity.rigidbody.teleport(this._orgPosition.x, this._orgPosition.y + up, this._orgPosition.z);

So this brings me finally back to this question: Use Collision/Trigger Volumes without Rigidbody/Physics

@yaustar should i submit another issue, or link this topic in the existing issue?

Best,
Rene

Link it to the existing one, I’ve just used the old version of the engine (1.27.4) and seems to work with your example:

https://launch.playcanvas.com/1032016?debug=true&use_local_engine=https://code.playcanvas.com/playcanvas-1.27.4.js

1 Like

There’s PC shapes (AABB, Orientated Boxes, Planes and Spheres) that could be used for some of this.

I was actually looking for a 3D collision only library the other day for a similar reason. @whydoidoit wrote one a while back but can no longer find the original repo :frowning:

Here is the original project: https://playcanvas.com/project/387026/overview/free-collision-detection-library

1 Like

I think he never released a GitHub repo or something, only a Dropbox link with the final script (the link isn’t active anymore right). I don’t think you will find anything else apart from the collisionDetection.js script included in the project you shared.

He had a BitBucket repo which is long gone. I’ve managed to grab the collision.js script out of the published build but it’s in legacy and outdated API

https://s3-eu-west-1.amazonaws.com/apps.playcanvas.com/JKPo8wLp/collisiondetection.js

I’ve been tempted to rehost it in GitHub given the license