java.lang.Object
com.marginallyclever.ro3.physics.ODE4JHelper

public class ODE4JHelper extends Object
Shared methods for working with ODE4J physics.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static javax.vecmath.Matrix4d
    convertODEtoMatrix(org.ode4j.math.DVector3C translation, org.ode4j.math.DMatrix3C rotation)
    Convert an ODE4J translation/rotation pair to a Java3D matrix.
    static org.ode4j.math.DMatrix3C
    convertRotationToODE(javax.vecmath.Matrix4d mat)
    receive a 4x4 matrix.
    static javax.vecmath.Vector3d
    jsonToVector3(org.json.JSONObject vector)
     
    static org.json.JSONObject
    vector3ToJSON(javax.vecmath.Vector3d vector)
     
    static double
    volumeBox(double x, double y, double z)
     
    static double
    volumeCapsule(double radius, double length)
     
    static double
    volumeCylinder(double radius, double length)
     
    static double
    volumeSphere(double radius)
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ODE4JHelper

      public ODE4JHelper()
  • Method Details

    • convertODEtoMatrix

      public static javax.vecmath.Matrix4d convertODEtoMatrix(org.ode4j.math.DVector3C translation, org.ode4j.math.DMatrix3C rotation)
      Convert an ODE4J translation/rotation pair to a Java3D matrix.
      Parameters:
      translation - the translation component.
      rotation - the rotation matrix
      Returns:
      the Java3D matrix.
    • convertRotationToODE

      public static org.ode4j.math.DMatrix3C convertRotationToODE(javax.vecmath.Matrix4d mat)
      receive a 4x4 matrix. extract the rotation component and store it in a DMatrix3C.
      Parameters:
      mat - the 4x4 matrix.
      Returns:
      the rotation component as a 3x3 matrix.
    • volumeCylinder

      public static double volumeCylinder(double radius, double length)
    • volumeCapsule

      public static double volumeCapsule(double radius, double length)
    • volumeBox

      public static double volumeBox(double x, double y, double z)
    • volumeSphere

      public static double volumeSphere(double radius)
    • vector3ToJSON

      public static org.json.JSONObject vector3ToJSON(javax.vecmath.Vector3d vector)
    • jsonToVector3

      public static javax.vecmath.Vector3d jsonToVector3(org.json.JSONObject vector)