Skip to content

Conversation

@Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Nov 24, 2025

Fixed #24777.

Description

Since another user wanted to use Octree with a AABB collider I've thought I implement the required methods boxIntersect(), getBoxTriangles() and triangleBoxIntersect(). The first two almost have the same structure as their sphere and capsule counterparts so they were easy to implement. triangleBoxIntersect() required some attention though. I have ended up with the default approach which is finding out which corner of the AABB intersects the triangle's plane deepest. You can then compute some data (depth, normals) required to solve the collision.

I've tested the code with games_fps and it works as expected. That said, it is highly recommended to keep using capsule for the player collider since it interacts more smoothly with the worlds geometry.

@Mugen87 Mugen87 added this to the r182 milestone Nov 25, 2025
@Mugen87 Mugen87 merged commit acc03cc into mrdoob:dev Nov 25, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Octree: Box3 support

1 participant