[Opensim-dev] Havok Physics Engine

Dahlia Trimble dahliatrimble at gmail.com
Thu Oct 28 20:09:56 UTC 2010


Hi,

I'm not familiar with the Havok APIs or if it's even capable of using
triangle meshes as colliders, but I felt a brief description of the ODE
interface may be a good starting point.

In a nutshell...

ODE has some internal collider types that it uses for basic shapes such as a
box or sphere. There is logic in OpenSimulator that tests a prim shape can
be represented by an internal ODE collider, and if so, instructs ODE to use
the appropriate internal shape. If the shape is more complex, CreateMesh()
in Meshmerizer.cs is called which creates a triangle mesh suitable for a
collider. Once the mesh is created, the mesh
methods getVertexListAsPtrToFloatArray() and getIndexListAsPtrToIntArray()
are called  (both in Mesh.cs) which return pointers to arrays containing the
mesh data. The data are arranged as strided arrays of 32 bit floats for the
vertex data, and 32 bit ints for the face index data.  The vertex positions
are the only component of a triangle face as face normals are implied by the
index order, and ODE only collides on the outward facing side of a triangle.
These pointers reference arrays which are "pinned" in memory, as ODE is
unmanaged code and is not able to safely access managed data structures.
There is also a caching function built into the meshing system which
attempts to keep all the pinned mesh data in one place in the heap and share
the meshes as often as possible to save memory, however you shouldnt need to
worry about that if you only use the pinned vertex arrays. If you need other
formats, Mesh.cs contains the code which formats the arrays for ODE.

 Good luck  and keep us posted on your progress :)
-dahlia
On Thu, Oct 28, 2010 at 12:17 PM, ftechz <ftechz at gmail.com> wrote:

> Hello devs,
>
> I'm attempting to create a wrapper for the free version of Havok to hook-up
> with opensim. I'm quite new to this so I'm not quite sure what exactly is
> required by opensim to make this possible. I'm especially confused by the
> mesher, how it integrates with ODE and how it may be used by Havok... among
> other things...
> If anyone can give me some advice to point me in the right direction it
> would be helpful. I understand that not everyone will be able to use Havok
> in their sims due to licencing issues but I hope that people who are
> eligible may be able to use it in the future.
>
> Thanks,
> Phil
>
> _______________________________________________
> Opensim-dev mailing list
> Opensim-dev at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20101028/6ba6dd3b/attachment-0001.html>


More information about the Opensim-dev mailing list