Havok Overview
Havok Overview
Havok Overview
Contents
1
Collision Detection__________________________________________________ 4
Constraints ________________________________________________________ 8
Vehicle Dynamics___________________________________________________ 9
10
11
12
13
14
15
16
1 Product Summary
The Havok Game Dynamics SDK is a comprehensive highly optimized development
solution designed to simplify the task to integrating full physical simulation into
entertainment applications.
The core technology has support for the following:
Optimized collision detection & resolution
Rigid body response
Deformable dynamics: soft body (mesh and FFD based), cloth and rope
Vehicle Dynamics
Fast general constraints
Specific car and rag doll constraints
Sensors, events & callbacks
Rapid prototyping layer
Debugging and profiling support
Demos, tutorials and documentation
In addition to the core engine, the Havok Game Dynamics SDK features a comprehensive
set of tools for programmers, artists and designers to facilitate parallel development
streams early in the project lifecycle and easy tuning and profiling of your game.
Exporters for 3ds max and Maya, for the easy set-up of physical scenes within a
familiar environment
Car tuning tool, for tweaking over 100 vehicle parameters, while testing vehicle
drivability in real-time on your target platform
Visual Debugger, for analyzing and profiling your game
Supported Platforms
The Havok 1.7 Game Dynamics SDK is available for PlayStation 2, GameCube, Xbox
and PC and supports all commonly used compilers (e.g. Codewarrior, ProDG). Havoks
core technology is optimized for each supported platform.
Havok also supports all 3D graphics engines: Alchemy from Intrinsic, NetImmerse from
NDL, Renderware from Criterion, the Quake and Unreal engines, as well as all in-house
rendering engines.
2 Collision Detection
Collision geometry types supported by Havok are:
Spheres and Planes
Convex objects
Concave objects (not necessarily closed)
Fixed polygon soups (e.g. landscapes): used for geometry, which never moves and
has been optimized for this purpose.
Heightfields (2 flavors: optimized and unoptimized).
The matrix above details the collision detection implementation in the current release.
Each square represents whether collision are calculated for the associated features. In
some cases (e.g. planes colliding with planes) the collisions are purposefully not
implement. Currently, the height-field support is limited to rigid convex objects but
support for all other object classes is in development.
Feature Benefits:
Feature
Description
Benefit
The
Havok
Collision
Detection
Engine
Havok has developed a new mid-phase
Optimized Collision
requires significantly less memory than collision detection system based on Memory
Detection Engine
any other implementation available on Optimized Partial Polytope (MOPP)
the market today.
Access to collision
results
User defined
collision primitives
Query collision
system
Display proxies
Phantom Objects
Collision Filtering
Collision Layers
Description
Benefit
Fast Subspace
ODE Solvers
Multiple Friction
Models
Stable Stacking
Math Library
An ODE is an ordinary differential equation (in this case the equation is that which
describes the motions of the rigid bodies). An ODE solver is a piece of math code that
solves the equations, and in this case works out how the objects move in the
simulation.
1
4 Scene Management
The Havok SDK provides a set of functions to allow you to manage the simulation of
your game world in a scalable way, allowing it to handle large geometries and large
numbers of dynamic objects.
Feature Benefits:
Feature
Dynamic Creation
& Deletion
Description
Benefit
Subspaces
Cloning
Automatic
Deactivation
5 Constraints
Havok has a fully featured constrained dynamics engine tailored for real-time game
applications. Our constraints have been optimized for games and are extremely efficient
while very stable. All constraint properties and connections are editable in real-time so
you can make or break constraints at will at run-time.
Feature Benefits:
Feature
Point to Point
Description
Benefit
Point to Nail
Joint Limits
Joint Friction
Hinge joint
Rag Doll
constraints
Car Wheel
constraints
Stiff Springs
Springs
Feature
Dashpots
Description
Benefit
6 Vehicle Dynamics
The Havok vehicle dynamics module is made up of a core vehicle physics system with
efficient ray casting for wheels and a tuned car wheel friction model to allow all types of
vehicle behaviors to be simulated effectively. On top of this core are a series of game
specific modules, which are available with source (and thus are user replaceable). These
include modules for:
Transmission
Engine
Suspension
Gameplay
Aerodynamics
Steering
The default system provided (complete with car tuning tool) gives access to over 100
parameters all of which may be tweaked in real-time for outstanding vehicle design
control. Some of these parameters are:
Wheel parameters: radius, width, friction, axle
Suspension parameters: length, strength, damping, suspension hardpoint
Engine parameters: rpm, torque, resistance torque
Gearing parameters: gear levels, shift points, clutch delay, wheel torque ratios
Aerodynamics parameters: air density, drag coefficient, lift coefficient
Gameplay parameters: friction equalizer, inertia factors, wheel friction tweakers
The vehicle SDK is based on a 2-axel steerable model with an unlimited number of
wheels per axel.
Feature Benefits:
Feature
Car Tuning Tool
Description
Benefit
Modular with
Source
Raycasting for
Wheels
100+ parameters
Skidmarks &
Camera Support
Advanced wheel
friction model
10
Description
Benefit
Deflectors
Attachment
Constraints
Volume Constraints
11
12
Deflectors:
Cloth, soft bodies, and rope do not get added to the Havok collision detector. Instead, a
specialized collision detection system is provided to allow very fast and accurate collision
detection with specialized objects.
The focus of the cloth / soft body, and rope collision detection solution, is for the
creation of deformable character dynamics.
Cloth vertices may be setup in advance to be deflected by any number of deflectors. In
addition, deflectors can be used dynamically (activated by callback functions from the
collision detector) to provide some interaction between external objects and deformable
bodies. Deflector shapes provided include:
Plane deflectors
Cylinder deflectors
(Almost) Arbitrary geometric deflectors = capsule height field
This last deflector type might need a little more explaining. To create deflectors for
objects that are not flat (where a plane is fine) or cylindrical (usually OK for most limbs
of characters) you can use a capsule height field, which is fitted to the shape of the object
you want to represent. Remember, this new deformable technology does not have
collision detection with arbitrary objects so you have to do a bit of work to achieve the
same result. Recall that height fields are a pretty efficient way to do collision detection
(thats why theyre so popular on PS2 in particular). What weve provided here is a
height field in 3D one that is wrapped around a cylinder capped with 2 hemispheres (a
capsule). We take the rigid body we want to represent and generate a height field on the
capsule to closely approximate the rigid body. If the rigid body is convex then we can
always generate a good representation. If is not convex, we will end up with a convex
deflector regardless (sort of like using a convex collision geometry but a non-convex
display geometry). This is the main limitation of the deflector approach.
This process is shown below using screen shots from the max exporter:
Deflector
13
14
Character
Controller
Source available
Description
Benefit
15
Description
Benefit
Sensor Event
Interpenetration
Events
Phantom Object
Events
Callbacks
Event Filters
16
Sensor events:
The following parameters of rigid bodies many be monitored by a sensor and an event
raised if the value falls within a user supplied range of values:
Linear Velocity
Angular Velocity
Force experienced by the rigid body
Torque experienced by the rigid body
17
10 Toolkit Layer
A toolkit layer is provided on top of the core physics API to allow easy access to many of
the features of the SDK without needing to dig deep into the workings of the core. With
the toolkit, you can inject physics functionality quickly and easily into your game.
Feature Benefits:
Feature
Toolkit functions
Description
Benefit
TK File Utility
Export Toolkit
18
Description
Benefit
DirectX8 Display
library
hkBase source
19
12 Debugging / Profiling
Havok has not been designed as a black box system. Though we need to protect some of
our core IP by not supplying source, we have gone to great lengths to remove the need for
source to allow you to effectively debug and test your applications.
Feature Benefits:
Feature
Visual Debugger
Description
Benefit
Debug Build
Timing Stats
20
21
Figure 1 Havok SDK Exporter for Max: setting up a scene in a familiar environment
Figure 2 Setting up rag dolls in the Havok SDK Exporter for Maya
22
23
24
Tweak a few slide bars to change your vehicle behavior from a Formula One
racer to a cartoon truck
o A default vehicle is constructed from more than 50 unique parameter
values. These are placed into some ten categories that define the car, such
as steering, suspension and wheels.
o Tweak the default values to design your unique vehicle handling.
See the vehicle behavior change in real-time on your target platform
o Changing a parameter value in code and recompiling the executable is
obviously time-consuming and bothersome. But with our tuning tool you
can dynamically load the parameter values from an external source, or
synchronize using a real-time connection.
o Run a car simulation on the PlayStation2 and tune it using the tuning tool
running on a PC.
25
Easily check for any inconsistencies between graphical and simulation worlds
o Visualize collision geometries and bounding boxes to check position and
orientations of simulated objects, while playing your game in real-time on
target platform.
26
Figure 6 Visualizing collision geometries and bounding boxes in real-time, while demo is running on
target platform.
27
14 Demos,
Demo
Documentation
Framework
and
Havok is provided with a comprehensive set of demos, all provided within a demo
framework that abstracts the simulation from the display and provides for cross-platform
support (abstracts mouse, keyboards and controllers). There is a wealth of documentation
available also covering all aspects of the physics system at a user level and an online
reference manual.
Feature Benefits:
Feature
Reference Manual
User Manuals
Description
Benefit
Demos
Demo Framework
List of Manuals:
Note: all manuals are in Adobe PDF format and are fully illustrated in color.
Actions Poltergeist and Possession: describes the action interface and illustrates
how to create your own actions to extend the physics system using a poltergeist action
as an example. This is accompanied by a corresponding demo with the action fully
implemented.
28
Features
Fast Subspace
Stacking Boxes
CharacterCloth
CharacterCloth
Controller
ChildsPlay
CityCar
29
Demo
Features
ClothCollision
EventTest
HingeConstraint
hkMenuGame
(blank)
LP2PConstraint
Necklace
P2PConstraint
PhantomObjects
PileUp
Pinball
Poltergeist
RagDoll
Rope
30
Demo
Features
SoftBody
A cube with wobbly soft body antennae can be controlled showing how the
soft bodies collide against the objects in the scene (which have had simple
deflectors associated with them through code). You can also pull the soft
bodies with the mouse.
Stiff springs demo compare this with the P2Pconstraints demo. They do
essentially the same thing, but stiff springs are faster to compute but exhibit a
little more springiness which you can see near the top when the chain reaches
full extension the cubes at the top are pulled away from each other slightly.
This is not so noticeable on shorter chains.
A demo of collision handling for objects that are typically difficult to handle
i.e. long thin ones. You can select between normal long and thin and even
longer and thin so see the effect.
Another example of the vehicle SDK, this time with simple AI opponents.
These guys follow a set of way points on the track, but all the behavior of the
trucks (skidding out, under steering etc.) are all down to the vehicle SDK.
Power sliding and tight suspension is a feature of the truck (in comparison to
the Driver style loose suspension in the city car demo).
A flag flapping in the breeze just showing the nice behavior of the cloth
coupled with a wind action. The cloth can be picked, but this doesnt look
very nice. There are 1100 triangles in this piece of cloth.
SSpringConstraint
Toothpicks
Truck
WindAndCloth
31
15 Source Code
The source code that is shipped with the SDK is listed below.
Events
Base Library (hkBase)
Toolkit Library
Vehicle SDK gameplay modules
Particle System (available on request; mail [email protected] for more details)
Water Module (available on request; mail [email protected] for more details)
Renderer Integration Toolkits
Demos
Car tuning tool and Convex object tools.
Core Vehicle physics.
Integration source code is provided for the exporters.
Source is NOT shipped for:
Core actions (including constraints)
Collision Detection
Collision Resolution
Entities
World
Math Library
Geometry Lib
Export Lib
32
16 Contact Details
European & UK Offices
1 Farnham Road,
Guildford,
Surrey,
GU2 4RG,
Tel: +44 1483 549 287
Fax: +44 1483 549 100
North American Offices
510 Veterans Blvd,
Redwood City,
CA 94063,
USA
Tel: +1 650 322 2332
Fax: +1 650 322 2240
Global Headquarters
7 Westland Court,
Cumberland Street,
Dublin 2,
Ireland
Tel: +353 1 677 8705
Fax: +353 1 676 7094
Further Information: [email protected]
Support: [email protected]
World Wide Web: www.havok.com
33