playcanvas / playcanvas/engine

Collision Component Update-Renderer Collision for built-in primitives

Open
#3,758 11 comments 0 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

Hi, I'm proposing this feature that will enable us to use built-in primitives and wire them in collision component.

Description

I was trying to add plane primitive to my scene, after that I did add collision and rigidbody to it. Since it is a built in primitive when I choose Mesh option on Collision i need to slot mesh, but I don't have plane mesh in my project and therefore it is not usable.
I was forced to use Box Collision and set Y=0.1 and I would like to avoid that.

Feature:

Add extra option in Collision component:
Renderer: Slot object/entity that has renderer and use its render mesh as a collision shape.
This way, whenever we scale our plane renderer collision shape will also update.

Here is my original problem that I have posted on PC Forum -> https://forum.playcanvas.com/t/plane-collision-setup/23157

Thank you and I hope this can be simple/easy update.

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 the Collision component's Mesh option and the built-in plane primitive's renderer. Determine how a Renderer slot could supply the render mesh and respond to renderer scaling; done means a built-in primitive can use its rendered mesh for collision without a separate mesh asset and the collision shape updates when scaled.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics, game-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.