playcanvas / playcanvas/engine
Implement simple API to allow Meshes / Renders to be used as a Collider
Open
Nobody has claimed this yet.
area: physics
enhancement
- Dominant language
- JavaScript
- Stars
- 16.8k
- Forks
- 2k
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 222
Description
- currently the Collider can accept Render / Model assets, or an instance of the model, which is not convenient for dynamically generated meshes
- Ammo tri-meshes are cached in the _triMeshCache and don't get removed, causing a leak. This should be implemented using ref counting similarly to how MeshInstance references a Mesh - when there are no references to tri-mesh, it needs to be properly released from the memory
the complete story: https://forum.playcanvas.com/t/procedural-mesh-collision-generation-and-updates/25113
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how Collider accepts Render/Model assets and how dynamically generated meshes could enter that path. Inspect Ammo's _triMeshCache and the MeshInstance reference-counting approach. Done means a simple mesh/render collider API exists and unused tri-meshes are released when their reference count reaches zero.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100