[Source] ODE fixed in NPS branch (physics examples render again) :)

Norbraten, Terry tdnorbra at nps.edu
Thu Aug 26 17:11:23 PDT 2010


Alan, et al.

Was able to get the physics examples to work again in the NPS branch.  What
follows is an excerpt from my running log of codebase changes implemented in
the NPS branch:

25) 26 AUG 2010: Update to #18 above.  Even though we were successful in
creating
a 64bit binary universal to Macs, all rigid body physics example renderings
were
still broken.  A bit of refactoring of how Xj3D deals with ODE was performed
in
order to reactivate rigid body physics rendering.  Explanation follows:
    a) The java.net CVS project for ODE included most platform binaries,
both
       32bit and 64bit, except for Mac.  That was fixed in #18 above.  All
       working ODE native binaries are in the NPS Branch directory
       "runtime_binaries" and are:
       libodejava.so
       libodejava64.so
       odejava.dll
       odejava64.dll
       libodejava.jnlib (universal binary for PPC and Intel 32/64 bit)
       Note: the old libodejava.dylib is no longer required
    b) Due to some refactoring from ODE team for java.net, all the JNI code
was
       moved out of the main ODE branch into its own code base.  Resulting
       jar is odejava-jni.jar.
    c) The main class for the JNI code required one refactor to the static
init()
       method.  Xj3D requires a boolean return type (static block of
       DefaultRigidBodyPhysicsManager) and the latest revision to
       org.odejava.ode.OdeJava.init() was refactored to a void return type
(fixed).
    d) There was some refactoring in the main ODE branch that did away with
       javax.vecmath and introduced org.openmali.vecmath2.  This API is
contained
       in a jar named openmali.jar which is now required in addition to
vecmath.jar.
    e) Xj3D code that required some refactoring to be compatible with the
latest
       ODE are:

       org.xj3d.impl.core.eventmodel.DefaultRigidBodyPhysicsManager
       org.web3d.vrml.renderer.common.nodes.rigidphysics.BaseCollidableNode
       org.web3d.vrml.renderer.common.nodes.rigidphysics.BaseCollidableShape
       org.web3d.vrml.renderer.common.nodes.rigidphysics.BaseContact
       org.web3d.vrml.renderer.common.nodes.rigidphysics.BaseRigidBody

       There are comments in each of these that explain why the refactor was
       necessary (NPS Branch of course).

       The main challenge was to keep the javax.vecmath.Matrix4f transform
matrix
       that Aviatrix3d requires intact and to transpose the
org.openmali.vecmath2
       versions of AxisAngle4f and Vector3f values to properly initialize
the
       javax.vecmath.Matrix4f before passing to Aviatrix3d.
    f) Required jars for ODE are in the NPS Branch "lib" directory and are:
       odejava-jni.jar
       odejava.jar
       openmali.jar
    g) The dependency on log4j is no longer required.  ODE refactored
logging to
       use java.util.Logging API.


There is very likely some more checking/testing to do with the examples to
make sure I got the transforms correct, but it¹s a start. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/mailman/private/source_web3d.org/attachments/20100826/3809d5be/attachment.html>


More information about the Source mailing list