Havok and Dev C++, completely lost

Havok and Dev C++, completely lost

Hi, I am new to these forums and new to the Havok sdk. I have a number of questions, and I would really apprectiate it if you guys could help me out :)

First question, is can Havok do native 2d simulations?

Second question, is will the SDK work in Dev C++

Now my big question. How can I, from scratch, create a simple box on plane example using the Havok Physics SDK? Im still somewhat new to C++, but I know enough to understand most things. So how is this done?

Please help me out, I would be very greatful.

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.


1) Everything in Havok is done in 3D. But there are tricks that you can do to make sure that things look like they're in 2D. There is some discussion on it here:
Essentially, if you make the inertia tensor of an object "infinite" around two axes (by making the inverse inertia tensor 0 on those axes), you can ensure that it only ever rotates about the other axis. There is also a constraint in the SDK to make sure that the object stays on a specified 2D plane.

2) You mean this: http://sourceforge.net/projects/dev-cpp/ , right? We don't officially support it (heck, I'd never heard of it before), so I'm not sure if there are any sort of problems. For example, some structs or classes can wind up as different sizes when built with different compilers, and if that happens, you're in for a world of pain. Does that project have a history of interfacing with Visual Studio libraries? If it runs on top of GCC (looks like it does), I don't think it'll work. If cost is your concern, you can download a free version of Visual Studio 2008 from Microsoft's site (don't have the exact link handy, though).

3) The best starting place is in hk550DemoStandAloneDemosConsoleExampleMtSimpleMultithreadedConsoleMain.cpp. That keeps everything in one file, and shows how to set up the Havok Base system, creates a few bodies, runs some physics steps, then cleans itself up.


Great! Thanks a lot for the help, thats exactly what I wanted to know. I do have one more question though:

How can I get variables from the Havok Objects, such as rotations and X,Y positions?

EDIT: And when I put the file you told me to start from (multithreaded console) into my compiler, it threw out a whole pile of errors that state [Linker Error] undefined reference to ""

The main physics object is hkpRigidBody - calling it's getTranform method will give you back an hkTransform, which consists of a position vector, and a 3x3 rotation matrix.

Hard to say if the linker errors are because of the compiler, or because you don't have your directories set up properly. I suspect the latter, though - you'll need to link against several of the Havok libraries (hkBase.lib, hkpDynamics.lib, etc) in order to properly build the program. If you open the vcproj (visual studio project) file in a text editor, you can see which libraries it links against, but it won't hurt just to link all of them for now.


Leave a Comment

Please sign in to add a comment. Not a member? Join today