Hello,
I would like to talk about geometry positioning, and convex hull sharing.
We previously said that it is assumed that Geometry instance center of mass is at (0,0,0) of geometry local coordinates. A side effect is that ConvexHull instances translate the vertex that composes the hull to place the center of mass in zero when it is not the case. As a consequence it uneasy to draw a complex mesh at the same place as the hull, cause this translation is unknown.
1- Change Geometry interface to publish a mass center coordinate. The inertia matrix is still computed at the mass center place. This one makes Geometry interface more complex. Do you think it is going to be necessary for future feature ?
2- Set the current local transformation of the geometry to the inverse of the one applied to convex hull vertices's. Then the vertex doesn't moved in Body's space.
Do you thinks it is affordable ?
I'm not sure how this correlates to this idea, but I also have some
ideas on how the body/geometry thing should work out in practice:
1. when a geometry is added, then the tensors and mass stuff is
updated incrementally, so that we avoid having the method finalize().
This should be the same when removing a geometry.
2. when you add/remove a geometry, all geometries should remain in
the same world-space position and orientation. We therefore update the
local transforms of the geometries AND the position of the Body.
3. The centre of mass point that is computed by convex hull is just
stored in Geometry as you say. Then, it can be taken into account when
computing the tensors, but we avoid having to move the vertices to the
centre of mass frame.
> The second point is convex hull data & computation sharing. I created lots
> (5000) of body and ConvexHull Geometry. I solved a blocking performance
> issue by implementing an alternative to MassProperties. QuickHull algorithm
> still takes time, a I fear that some day, I will have memory consumption
> issues. For now it works, but I would like to have your view on how could we
> share Inertia matrix, hull & dual over geometries, or even geometries over
> bodies.
Yes this is an issue for sure. I think it should not be very hard to
make a copy a ConvexHull that shares the same geometry data. I'll
think about that :)