I'm doing a project in my Calculus class and would like to know how Calculus (specifically differential and integral) is used in the BeamNG physics engine.And to be honest, I just outright curious.
The basics of physics engines are Newton's laws of motion: https://en.wikipedia.org/wiki/Newton's_laws_of_motion On top of that you need to add a kinematic numerical integrator: https://en.wikipedia.org/wiki/Numerical_integration http://physicsforgames.blogspot.com/2010/02/kinematic-integration.html Looking at above you'll see that most of the differentials and integrals are being applied on vectors. Most of the equations that you'll see in a physics engine are of the differential kind, but there are times when you'll need to do the opposite and use the integral form of an equation. Apart from the laws of motion there are other physics phenomenons that are important in a physics engine. Such as friction, aero/hydrodynamics, pressure (for tires, balloons) and so on. For each of these phenomenons the corresponding physics equations need to be used [1] (in differential or integral form, depending on the problem ). The other big problem in physics engines are collisions. And more specifically collision detection which is a very difficult problem. Collision detection finds out pairs of objects that touch with each other. It also needs to find the specific points where the two objects touch. Having found that, collision resolution needs to happen to separate the two objects. If you are familiar with programming there are heaps of physics engines with available open source code [2]. There are also tons of tutorials and books about physics simulation freely available. [1] In BeamNG we have a huge dislike of "cheating" the physics. So we use the real physics equations. Other physics engines have different priorities (which is understandable) and may use simplifications or even not use anything resembling the real physics equations at all. [2] IMHO, a quick way to decide how much a physics engine's source code "sucks", is to count the number of trigonometric functions that you see in the physics core code. Each trigonometric function increases the "suckiness" factor (start from suckiness = 0). If suckiness is > 4, reading the source code is bad for you .
That, and how hard it is to understand. Trig can be irritating, especially with calculus. --- Post updated --- Your post is greatly appreciated. I plan to research further into the topic. Do you mind if I quote you on some of this, because I would like to share it, and give credit to you.
Please offer to license your physics engine to space engineers. I fell head over heels in love but havok is doing them dirty. If you haven't checked it out please do, they have a stupid awesome idea but the physics could use a genius injection from likes of you. Cheers @estama , your an all right dude. Edit: to me beamng is an engine first game second. If you guys managed to do what epic games did with unreal, the gaming landscape would be forever changed for the better. I'm not actually trying to tell you guys what to do with your tech, just letting you know I value it over world peace.
It's a huge issue. Its a 10th as good as beam and it uses way less resources. Havok physics had its time and place in history, 2004.
The game The Crew uses the Havok engine and the game if very notorious with very glitchy collision physics.
Explain this. The physics slows down with big ships in space engineers. Sure the ships are bigger than a beam car but there's a lot going on under the skin of the beam car. The kicker tho? Space engineers has havok updating 60 times a second. That's a far cry from the 2000 the beam team manages with their INFINATLY more accurate engine.
There is one major slowdown for space engineers that doesnt impact BeamNG. BeamNG is native C/C++. Space engineers voxel deformations arent calculated in the havok side, they are done in C#, a non native language. C# compiles to CIL bytecode run within the .NET virtual machine.
Well thanks for that insider look on what's really happening. I hope they fix it somehow. The world needs a new engine that everyone can use. These indy devs would be putting triple a outfits out of business if they had the tools that the big dogs do. 15 guys are making better games than 150 man teams. Beamng and keen software house are perfect examples of the little guy doing it big. --- Post updated --- Well thanks for that insider look on what's really happening. I hope they fix it somehow. The world needs a new engine that everyone can use. These indy devs would be putting triple a outfits out of business if they had the tools that the big dogs do. 15 guys are making better games than 150 man teams. Beamng and keen software house are perfect examples of the little guy doing it big.