physics.rst 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. Physics properties
  2. ==================
  3. Exporting physics properties is done by enabling "Rigid Body" in Blender's
  4. physics tab:
  5. .. image:: img/enable_physics.png
  6. .. important::
  7. By default, a single Blender object with rigid body enabled will export as
  8. three nodes: a PhysicsBody, a CollisionShape, and a MeshInstance3D.
  9. Body type
  10. ---------
  11. Blender only has the concept of "Active" and "Passive" rigid bodies. These
  12. turn into Static and RigidBody nodes. To create a kinematic body, enable the
  13. "animated" checkbox on an "Active" body:
  14. .. image:: img/body_type.jpg
  15. Collision shapes
  16. ----------------
  17. Many of the parameters for collision shapes are missing from Blender, and many
  18. of the collision shapes are also not present. However, almost all of the
  19. options in Blender's rigid body collision and rigid body dynamics interfaces
  20. are supported:
  21. .. image:: img/collision_shapes.jpg
  22. There are the following caveats:
  23. - Not all of the collision shapes are supported. Only ``Mesh``, ``Convex
  24. Hull``, ``Capsule``, ``Sphere`` and ``Box`` are supported in both Blender and
  25. Godot
  26. - In Godot, you can have different collision groups and collision masks. In
  27. Blender you only have collision groups. As a result, the exported object's
  28. collision mask is equal to its collision group. Most of the time, this is
  29. what you want.
  30. .. important::
  31. To build compound physics shapes, parent together multiple objects with
  32. rigid body enabled. The physics properties are taken from the parent-most
  33. rigid body, and the rest are used as collision shapes.
  34. Collision geometry only
  35. -----------------------
  36. Frequently you want different geometry for your collision meshes and your
  37. graphical meshes, but by default, the exporter will export a mesh along with the
  38. collision shape. To only export the collision shape, set the object's maximum
  39. draw type to Wire:
  40. .. image:: img/col_only.png
  41. This will also influence how the object is shown in Blender's viewport.
  42. Most of the time, you want your collision geometry to be shown see-through when
  43. working on the models, so this works out fairly nicely.