I am in need of a physics engine for my game. I know that there are already physics engines out there, but I want to create my own from scratch. It's nothing more then knowing the formulas and how to implement them right? What I am asking for is what would be the best way to integrate this into code. With the use of classes and structs or using functions ?

6 Years
Discussion Span
Last Post by jwenting

well, it involves a lot more THAN knowing formulas.

I'd start with writing datastructures and associated methods for 3D and 4D mathematics.
All those pesky matrix and vector things that you're going to need a LOT when doing your physics engine.
Test it, optimise the heck out of it, because if it's not bugfree and blazing fast you're going to be in serious trouble down the line.

Then start thinking about how you're going to be presenting the input for your physics engine to the engine, and how you'd want the results in an application independent way.

You'll likely end up with a combination of structs, classes, and loose functions.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.