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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access