CS 599 Physically Based Modeling for Interactive Simulation and Games Case Study: Havok Engine for Game Physics Jernej Barbic University of Southern CaliforniaPhysics in gamesPhysics EnginesReal-time physics engines: open sourceReal-time physics engines: commercialComponents of physics engineRigid object contactReal-time simulationCharactersPhysics processing unit (PPU)GPGPUIntel LarrabeeHavokHavok EngineSlide 15Havok PhysicsSlide 17Slide 18Slide 19Slide 20Havok Physics is not…Slide 22Rigid objectsConstraintsSlide 25Slide 26Collision DetectionSlide 28Collision Detection: QueriesContinuous PhysicsSlide 31PowerPoint Presentation1CS 599Physically Based Modeling for Interactive Simulation and Games Case Study:Havok Engine for Game PhysicsJernej BarbicUniversity of Southern California2Physics in games•Custom, in-house software•Off-the shelf libraries•Physics middleware3Physics Engines•Real-time–Video games•High precision–Slow–Film–Scientific computingHalf-life 24Real-time physics engines:open source•Open Dynamics Engine (ODE)•Bullet•SOFA•and several others5Real-time physics engines:commercial•Havok (Ireland) (now Intel)•Physx (formerly NovodeX, now nVidia)•Vortex (Montreal)6Components of physics engine•Collision detection•Dynamics–rigid objects–cloth–fluids•FractureQuickTime™ and a decompressorare needed to see this picture.7Rigid object contact•Penalty-based–popular with soft/deformable objects•Impulse-based•Constraint-based–expensive, suitable for continuous contact8Real-time simulation•Speed more important than accuracy•Objects have two representations:–Complex geometry (rendering)–Simplified geometry (collision detection, dynamics)9Characters•Rag-doll physics–Rigid objects•Cloth•Controller–Natural motion•Particles (hair)10Physics processing unit (PPU)•Dedicated physics co-processor•SPARTA and HELLAS –academic–Penn State, Univ. of Georgia•Ageia (Switzerland, 2006) –later merged into nVidia–use AGEIA's PhysX SDK11GPGPU•Havok FX–may have been cancelled•Multi-GPU technology–ATI (CrossFire)–nVidia (SLI)•Increasingly more suitable for physics12Intel Larrabee•Many-core x86•Fusion of CPU and GPU•Suitable for physics•Was scheduled for 2010, but delayed13Havok•Real-time commercial physics engine•Company bought by Intel (2007) ($110 million)•Used in 150 games–Halo 3–Half Life 214Havok Engine•Animation–Fast playback–Real-time blending–Inverse kinematics–Retargeting•AI– path-findingQuickTime™ and a decompressorare needed to see this picture.15Havok Engine•Behavior–Character behavior development tool•Cloth•Destruction•Physics16Havok PhysicsQuickTime™ and a decompressorare needed to see this picture.17Havok Physics•Collision detection•Constraints•Rigid bodies•Cloth•Continuous physicsQuickTime™ and a decompressorare needed to see this picture.Uncharted 2: Among thieves18Havok Physics•Vehicle simulation•Human ragdolls•Character controller–simulate enemy characters being hitQuickTime™ and a decompressorare needed to see this picture.19Havok Physics•Visual debugger and profiler•Content creation tools•Integration with 3rd-party renderers–3D Studio Max–MayaQuickTime™ and a decompressorare needed to see this picture.20Havok Physics•Extensively optimized (machine code)•Microsoft Xbox •Sony PLAYSTATION•Nintendo Wii•PC21Havok Physics is not…•Simple technology–Must invest time to use it•Black box–Must understand the componentsand recombine them•Commercial renderer22Havok Physics•The “Havok World” (hkpWorld)•Contains all physical objectsin the simulation•Timesteps the simulationforward in timeQuickTime™ and a decompressorare needed to see this picture.23Rigid objects•The central object in Havok•hkpRigidObject class•Add to the “world”•Set mass, inertia tensor, etc.24ConstraintsBall andsocketHinge Translational25ConstraintsQuickTime™ and a decompressorare needed to see this picture.26ConstraintsQuickTime™ and a decompressorare needed to see this picture.QuickTime™ and a decompressorare needed to see this picture.QuickTime™ and a decompressorare needed to see this picture.27Collision Detection•Broad phase and narrow phaseQuickTime™ and a decompressorare needed to see this picture.Broadphase28Collision Detection•Narrow phase•Spheres•AABBs•Cylinders•Capsules•Compound shapes29Collision Detection: Queries•Closest points between two bodies•Whether two bodies penetrate•Raycast a point through spaceand get colliding objects30Continuous PhysicsQuickTime™ and a decompressorare needed to see this picture.31Continuous Physics•Time of impact:QuickTime™ and a decompressorare needed to see this picture.32QuickTime™ and a decompressorare needed to see this
View Full Document