Support a convex polyhedron shape
w0rm opened this issue · 1 comments
w0rm commented
With the release of https://package.elm-lang.org/packages/w0rm/elm-obj-file/latest there is an easy way to load TriangularMesh
from Blender. elm-physics currently only supports Block3d
(which is internally defined as a convex polyhedron).
Collision algorithm is limited to convex shapes. There are several options to construct a convex polyhedron shape:
- As a convex hull from a list of
Point3d
- A function that takes
TriangularMesh
ofPoint3d
and returns aMaybe
ofShape
(Nothing
if a shape isn’t convex) - An unsafe function that takes
TriangularMesh
ofPoint3d
and returns aShape
While 1. and 2. are good because they make it impossible to create wrong shapes, they are computationally intensive.
Open question: what to do with the center of mass of a convex polyhedron. Shall it be calculated or provided by the user.