I am trying to make a convex hull collider for bullet physics. I am using BulletSharp.CompoundShape and BulletSharp.ConvexHullShape.

This is model of a chair in unity with rigidbody and convex mesh collider (how i expect it to behave):

enter image description here

This is that same model in my engine:

enter image description here

Here is the chair in blender:

enter image description here

When attaching collision shapes to CompoundShape there is an option to add offset, i tried setting that offset to center of volume of mesh i calculated, it did not work.

Simple solution would be to center object in blender somewhere around its center of mass, but can this be avoided? Can i somehow change the chairs center of mass in bullet?

Here is a picture of chairs acting more naturally after changing the center in blender:

enter image description here

All pictures were taken when rigidbodies were still and probably asleep.

  • 1
    \$\begingroup\$ I haven't worked much with Bullet (more with ODE), but apparently, you'll have to make your objects so that the center of mass is set the origin, I'm afraid. Depending on the rest of your software and how it is architecture'd, this could be done automatically when you load your objects. \$\endgroup\$ – Vaillancourt Jun 26 '19 at 0:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.