Now we can create rigid bodies or soft bodies and watch them interact with other rigid or soft bodies. A rigid body is an animate or inanimate object that doesn't change its shape or physical properties. Soft bodies, on the other hand, can be squishy and made to change shape.
In the following example, we will focus on the creation of a rigid body.
To create a rigid body, we have to specify the shape of the object and the motion state, and then set the mass and inertia of the objects. Shapes are defined using btCollisionShape. An object can have different shapes, or sometimes even a combination of shapes, called a compound shape. We use btBoxShape to create cubes and cuboids and btSphereShape to create spheres. We can also create other shapes, such as btCapsuleShape, btCylinderShape, and btConeShape, which will be used for narrowphase collision by the library...