Computer Game Design and Development
Explore the intricacies of collision detection and physics within game design. This guide delves into mathematical principles, emphasizing collision approximations like the Minkowski Sum and bounding volumes (AABB and OBB). Learn about handling terrain collisions using heightmaps, subdividing objects for optimal performance, and implementing robust collision resolution techniques across three essential phases. Additionally, it covers fundamental particle physics concepts, including position, velocity, and force dynamics, and introduces various physics engines, such as Havok and Open Dynamics Engine, for effective game simulation.
Computer Game Design and Development
E N D
Presentation Transcript
Computer Game Design and Development Mathematics, Collision, and Physics Havok Destruction
Collision ApproximationsMinkowski Sum – sweep origin of X across Y
Bounding Volumes AABB OBB
Performance Possible collisionbetween R and B since overlap in all axis (2 in this case) Subdivide such that on averageone object in each cell.
Terrain Collision • Heightmap information • Look up terrain height • 3 LERPs – Linear Interpretation between points • X • Z • Between x and z http://creators.xna.com/en-US/sample/collision3dheightmap
Resolving Collision • Gross collision & subdivide if needed • Three phases • Prologue – ignore or trigger other events • Collision – point of impact, new velocities • Epilogue – destroy object, effects, damage
Particle Physics Basics • Use consistent units (SI) • Particles • Position (p) in 3-space, vector3 (x,y,z) = p(t) • Velocity (v) = change in position over time, V(t) • Acceleration (a) = change in velocity over time, a(t) • Force (f) = results in change in acceleration over time, F(t) = ma(t) • Calculus • Derivatives and integrals go from one to another
Physics Engines • Commercial • Game Dynamics SDK (Havok) • Renderware Physcis • NovodeX SDK • Free/Shareware • Open Dynamics Engine (ODE) • Tokamak Game Physics SDK • Newton Game Dynamics SDK
Demo http://www.havok.com/content/view/584/96/ http://www.tokamakphysics.com/index.htm