dynamicsWorld.addRigidBody(groundRigidBody);
// Initialise 'ballMotion' to a motion state that assigns a specified location to the ball.
MotionState ballMotion = new DefaultMotionState(new Transform(DEFAULT_BALL_TRANSFORM));
// Calculate the ball's inertia (resistance to movement) using its mass (2.5 kilograms).
Vector3f ballInertia = new Vector3f(0, 0, 0);
ballShape.calculateLocalInertia(2.5f, ballInertia);
// Composes the ball's construction info of its mass, its motion state, its shape, and its inertia.
RigidBodyConstructionInfo ballConstructionInfo = new RigidBodyConstructionInfo(2.5f, ballMotion, ballShape, ballInertia);
// Set the restitution, also known as the bounciness or spring, to 0.5. The restitution may range from 0.0
// not bouncy) to 1.0 (extremely bouncy).
ballConstructionInfo.restitution = 0.5f;