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

Solving constraints


In the last section, Integrating Particles, we made our particle class move using Euler Integration. The only force affecting particles was gravity. This means if you were to run the simulation, every particle would fall down without interacting with anything. In this section, we will introduce several unmovable constraints to the world. By the end of the section, particles will bounce around the screen as they hit constraints while falling under the force of gravity.

Our PhysicsSystem currently only supports OBB constraints; however, adding additional constraint types is a trivial task. We will use raycasting to find collision features between a constraint and a particle. Because we modified the raycast for all primitives to return the same data, implementing new constraint types will use very similar code.

Solving constraints is based on Newton's third law of motion:

Every action has an equal and opposite reaction

In this section, we will explore what to do when a particle...

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