pmndrs / cannon-es

💣 A lightweight 3D physics engine written in JavaScript.
https://pmndrs.github.io/cannon-es/
MIT License
1.79k stars 133 forks source link

Support Capsule Shape #132

Open arpu opened 2 years ago

arpu commented 2 years ago

Hey,

some question to optimize Character movements, right now i use 3 Sphere Collider meshes for Head Body Legs the best solution would be using a Capsule geometry Collider

some more infos: https://github.com/gkjohnson/three-mesh-bvh/blob/master/example/characterMovement.js

https://github.com/mrdoob/three.js/blob/dev/examples/jsm/math/Capsule.js

open for discussion

arpu commented 2 years ago

some more technical info: https://wickedengine.net/2020/04/26/capsule-collision-detection/

Russo-creation commented 2 years ago

It would be very cool to have something like in Unity for this case.

I'm currently going through same thing like @arpu and after research I found this repo https://github.com/maximeq/three-js-capsule-geometry which can help tu build shape (especially that a lot of existing code to build this shape has an depreciated functions). https://dualbox.com/apps/capsule-geometry/production.

arpu commented 2 years ago

@Russo-creation three has this build in in latest version https://github.com/mrdoob/three.js/pull/23586