RigidBody body; body.setPosition(Vector3f(0.0f, 0.0f, 0.0f)); // set position of the body body.setRotation(Quaternionf::Identity()); // set initial rotation body.setLinearVelocity(Vector3f(0.0f, 0.0f, 0.0f)); // set the initial velocity of the body
RigidBody body; Vector3f force = Vector3f(3.0f, 0.0f, 0.0f); // the force to be applied Vector3f point = Vector3f(2.0f, 1.0f, 0.0f); // the point where the force is applied body.applyForce(force, point); // apply the force to the body at the given point
RigidBody body1; RigidBody body2; // two rigid bodies bool collided = body1.checkCollision(body2); // check if the two bodies have collided if (collided){ // handle the collision }Package library: Eigen.