Step By Step Demos
------------------

This folder contains a set of small stand-alone demos which aim to demonstrate a minimal starting and shutting down of havok for different use cases. The demos start simple, and get a little more compilicated as features are added. The demo order listed below is roughly in the order of complexity.

* MemoryUtilInit

Starts up and shuts down havok, using the hkMemoryInitUtil in order to set up the memory system. This is one of the simplest ways to set up memory in havok - but may link in more code than is really needed into your executable.

* Physics

Shows how to set up a havok physics world, add a rigid body, and run the simulation for 20 frames.

* Serialize

Shows how to read and write an object using havoks serialization system. The example uses a hkpRigidBody as the object type it serializes. The example writes and reads a binary file and an xml tagfile. 

* Physics Monitor

Havok has profiling facilities that make it very easy to work out how computing resources are being used within havok and in applications. The framework to do this revolves around a hkMonitorStream - which is used to store timing information and the hkMonitorStreamAnalyzer which is used accumulate timing statistics as well as to produce timing report. The demo runs a phyics simulation for 20 frames. The timing information across each single frame is accumulated in the hkMonitorStream. Each frames timing information is then accumulated into a hkMonitorStreamAnalyzer. After the 20 frames have completed the results are written out from the analyzer to a file moniterAnalyzerOutput.txt.

* PhysicsVdb

The Visual Debugger (Vdb) provides the capability to view and modify physics behavior in an executing havok application. The example shows the small amount of extra code that is needed to support this feature in an application. Inside the demo a physics world with a rigid body in it is set up, and the simulation run on it for 10 seconds. If the Visual Debugger is running when the demo is run, the demo will automatically connect to the visual debugger - and the contents of the simulation will be available to view and modify in real-time. 

Note that the application connects to the visual debugger through a network socket. During the first run of the demo - windows may ask you if you want to allow the application to make a socket connection. You have to click 'allow' for the demo to be able to connect to the visual debugger. 