Linear Velocity
The next step in making our physics engine more realistic is in creating the RigidbodyVolume
class. This new class will have a shape and volume. The shape will be a sphere or a box. This new class will have Linear Velocity. Linear Velocity moves an object in a linear fashion, which means that there will be no rotation. Gravity pulling a sphere straight down is a linear motion caused by Linear Velocity.
Ideally, we would want the collision shape (Sphere
or Box
) to be stored outside the RigidbodyVolume
class. However, for the sake of keeping the code presented in this book easy to follow, we will include the collision shape in the RigidbodyVolume
class.
The RigidbodyVolume
class will perform Euler Integration. We will include the variables ...
Get Game Physics Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.