Reader small image

You're reading from  Game Physics Cookbook

Product typeBook
Published inMar 2017
Reading LevelIntermediate
PublisherPackt
ISBN-139781787123663
Edition1st Edition
Languages
Tools
Concepts
Right arrow
Author (1)
Gabor Szauer
Gabor Szauer
author image
Gabor Szauer

Gabor Szauer has been making games since 2010. He graduated from Full Sail University in 2010 with a bachelor's degree in game development. Gabor maintains an active Twitter presence, and maintains a programming-oriented game development blog. Gabor's previously published books are Game Physics Programming Cookbook and Lua Quick Start Guide, both published by Packt.
Read more about Gabor Szauer

Right arrow

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 needed for Euler Integration (position, velocity, forces and mass) in the new class. All the new variables will be public. These variables will be directly accessable as opposed to having accessor and mutator functions. We do this to keep the...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Game Physics Cookbook
Published in: Mar 2017Publisher: PacktISBN-13: 9781787123663

Author (1)

author image
Gabor Szauer

Gabor Szauer has been making games since 2010. He graduated from Full Sail University in 2010 with a bachelor's degree in game development. Gabor maintains an active Twitter presence, and maintains a programming-oriented game development blog. Gabor's previously published books are Game Physics Programming Cookbook and Lua Quick Start Guide, both published by Packt.
Read more about Gabor Szauer