playcanvas / playcanvas/engine

Implement simple API to allow Meshes / Renders to be used as a Collider

Open
#4,181 10 comments 6 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.