playcanvas / playcanvas/engine

Be able to get contact result of trigger entity

Open
#5,668 7 comments 1 reaction 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 it's not possible to get the contact result of a trigger entity, while Ammo provides this information. It will be nice if I can access this information with a trigger entity. (I want to use a trigger entity on a AI to detect all entities in the surrounding and with the (local) position of the collision points I can let the AI ​​make the right decisions).

https://github.com/playcanvas/engine/blob/58ef2f524a2058467631e7722beee92caf2b8231/src/framework/components/rigid-body/system.js#L835C19-L835C30

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 at src/framework/components/rigid-body/system.js around line 835 and trace how trigger entities receive collision information from Ammo. Determine how the contact result and local collision-point positions should be exposed for trigger entities; done means callers can access that information for surrounding-entity detection.

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.