Permalink
Browse files

Refactor QuickStep to use a single data array

Port changes from ODE to make QuickStep use just a single array of
doubles to store all coefficients for LCP solver.
  • Loading branch information...
1 parent 2c2180d commit 969d4f135ff3fa97e8b4d967d209bf49ae103880 ppiastucki committed Sep 10, 2016
Showing with 911 additions and 407 deletions.
  1. +109 −0 core/src/main/java/org/ode4j/ode/internal/CommonEnums.java
  2. +157 −206 core/src/main/java/org/ode4j/ode/internal/DxQuickStep.java
  3. +171 −0 core/src/main/java/org/ode4j/ode/internal/QuickStepEnums.java
  4. +2 −1 core/src/main/java/org/ode4j/ode/internal/Step.java
  5. +0 −183 core/src/main/java/org/ode4j/ode/internal/joints/DxJoint.java
  6. +1 −1 core/src/main/java/org/ode4j/ode/internal/joints/DxJointAMotor.java
  7. +1 −1 core/src/main/java/org/ode4j/ode/internal/joints/DxJointBall.java
  8. +1 −1 core/src/main/java/org/ode4j/ode/internal/joints/DxJointConstrainedBall.java
  9. +1 −1 core/src/main/java/org/ode4j/ode/internal/joints/DxJointContact.java
  10. +1 −1 core/src/main/java/org/ode4j/ode/internal/joints/DxJointHinge.java
  11. +1 −1 core/src/main/java/org/ode4j/ode/internal/joints/DxJointHinge2.java
  12. +1 −1 core/src/main/java/org/ode4j/ode/internal/joints/DxJointLMotor.java
  13. +0 −1 core/src/main/java/org/ode4j/ode/internal/joints/DxJointLimitMotor.java
  14. +1 −1 core/src/main/java/org/ode4j/ode/internal/joints/DxJointNull.java
  15. +1 −1 core/src/main/java/org/ode4j/ode/internal/joints/DxJointPR.java
  16. +1 −1 core/src/main/java/org/ode4j/ode/internal/joints/DxJointPU.java
  17. +1 −1 core/src/main/java/org/ode4j/ode/internal/joints/DxJointPiston.java
  18. +1 −1 core/src/main/java/org/ode4j/ode/internal/joints/DxJointPlane2D.java
  19. +1 −1 core/src/main/java/org/ode4j/ode/internal/joints/DxJointSlider.java
  20. +1 −1 core/src/main/java/org/ode4j/ode/internal/joints/DxJointUniversal.java
  21. +33 −0 core/src/main/java/org/ode4j/ode/internal/joints/Info2Descr.java
  22. +179 −0 core/src/main/java/org/ode4j/ode/internal/joints/Info2DescrQuickStep.java
  23. +218 −0 core/src/main/java/org/ode4j/ode/internal/joints/Info2DescrStep.java
  24. +26 −0 core/src/main/java/org/ode4j/ode/internal/joints/JointEnums.java
  25. +2 −2 demo-cpp/src/test/java/org/ode4j/tests/FrictionJointContact.java
@@ -0,0 +1,109 @@
+package org.ode4j.ode.internal;
+
+public class CommonEnums {
+
+ // dSpaceAxis
+ public static final int dSA__MIN = 0;
+ public static final int dSA_X = dSA__MIN;
+ public static final int dSA_Y = dSA_X + 1;
+ public static final int dSA_Z = dSA_Y + 1;
+ public static final int dSA__MAX = dSA_Z + 1;
+ // dMotionDynamics
+ public static final int dMD__MIN = 0;
+ public static final int dMD_LINEAR = dMD__MIN;
+ public static final int dMD_ANGULAR = dMD_LINEAR + 1;
+ public static final int dMD__MAX = dMD_ANGULAR + 1;
+ // dDynamicsAxis
+ public static final int dDA__MIN = 0;
+ public static final int dDA__L_MIN = dDA__MIN + dMD_LINEAR * dSA__MAX;
+ public static final int dDA_LX = dDA__L_MIN + dSA_X;
+ public static final int dDA_LY = dDA__L_MIN + dSA_Y;
+ public static final int dDA_LZ = dDA__L_MIN + dSA_Z;
+ public static final int dDA__L_MAX = dDA__L_MIN + dSA__MAX;
+ public static final int dDA__A_MIN = dDA__MIN + dMD_ANGULAR * dSA__MAX;
+ public static final int dDA_AX = dDA__A_MIN + dSA_X;
+ public static final int dDA_AY = dDA__A_MIN + dSA_Y;
+ public static final int dDA_AZ = dDA__A_MIN + dSA_Z;
+ public static final int dDA__A_MAX = dDA__A_MIN + dSA__MAX;
+ public static final int dDA__MAX = dDA__MIN + dMD__MAX * dSA__MAX;
+ // dVec3Element
+ public static final int dV3E__MIN = 0;
+ public static final int dV3E__AXES_MIN = dV3E__MIN;
+ public static final int dV3E_X = dV3E__AXES_MIN + dSA_X;
+ public static final int dV3E_Y = dV3E__AXES_MIN + dSA_Y;
+ public static final int dV3E_Z = dV3E__AXES_MIN + dSA_Z;
+ public static final int dV3E__AXES_MAX = dV3E__AXES_MIN + dSA__MAX;
+ public static final int dV3E_PAD = dV3E__AXES_MAX;
+ public static final int dV3E__MAX = dV3E_PAD + 1;
+ // dVec4Element
+ public static final int dV4E__MIN = 0;
+ public static final int dV4E_X = dV4E__MIN + dSA_X;
+ public static final int dV4E_Y = dV4E__MIN + dSA_Y;
+ public static final int dV4E_Z = dV4E__MIN + dSA_Z;
+ public static final int dV4E_O = dV4E__MIN + dSA__MAX;
+ public static final int dV4E__MAX = dV4E_O + 1;
+ // dMat3Element
+ public static final int dM3E__MIN = 0;
+ public static final int dM3E__X_MIN = dM3E__MIN + dSA_X * dV3E__MAX;
+ public static final int dM3E__X_AXES_MIN = dM3E__X_MIN + dV3E__AXES_MIN;
+ public static final int dM3E_XX = dM3E__X_MIN + dV3E_X;
+ public static final int dM3E_XY = dM3E__X_MIN + dV3E_Y;
+ public static final int dM3E_XZ = dM3E__X_MIN + dV3E_Z;
+ public static final int dM3E__X_AXES_MAX = dM3E__X_MIN + dV3E__AXES_MAX;
+ public static final int dM3E_XPAD = dM3E__X_MIN + dV3E_PAD;
+ public static final int dM3E__X_MAX = dM3E__X_MIN + dV3E__MAX;
+ public static final int dM3E__Y_MIN = dM3E__MIN + dSA_Y * dV3E__MAX;
+ public static final int dM3E__Y_AXES_MIN = dM3E__Y_MIN + dV3E__AXES_MIN;
+ public static final int dM3E_YX = dM3E__Y_MIN + dV3E_X;
+ public static final int dM3E_YY = dM3E__Y_MIN + dV3E_Y;
+ public static final int dM3E_YZ = dM3E__Y_MIN + dV3E_Z;
+ public static final int dM3E__Y_AXES_MAX = dM3E__Y_MIN + dV3E__AXES_MAX;
+ public static final int dM3E_YPAD = dM3E__Y_MIN + dV3E_PAD;
+ public static final int dM3E__Y_MAX = dM3E__Y_MIN + dV3E__MAX;
+ public static final int dM3E__Z_MIN = dM3E__MIN + dSA_Z * dV3E__MAX;
+ public static final int dM3E__Z_AXES_MIN = dM3E__Z_MIN + dV3E__AXES_MIN;
+ public static final int dM3E_ZX = dM3E__Z_MIN + dV3E_X;
+ public static final int dM3E_ZY = dM3E__Z_MIN + dV3E_Y;
+ public static final int dM3E_ZZ = dM3E__Z_MIN + dV3E_Z;
+ public static final int dM3E__Z_AXES_MAX = dM3E__Z_MIN + dV3E__AXES_MAX;
+ public static final int dM3E_ZPAD = dM3E__Z_MIN + dV3E_PAD;
+ public static final int dM3E__Z_MAX = dM3E__Z_MIN + dV3E__MAX;
+ public static final int dM3E__MAX = dM3E__MIN + dSA__MAX * dV3E__MAX;
+ // dMat4Element
+ public static final int dM4E__MIN = 0;
+ public static final int dM4E__X_MIN = dM4E__MIN + dV4E_X * dV4E__MAX;
+ public static final int dM4E_XX = dM4E__X_MIN + dV4E_X;
+ public static final int dM4E_XY = dM4E__X_MIN + dV4E_Y;
+ public static final int dM4E_XZ = dM4E__X_MIN + dV4E_Z;
+ public static final int dM4E_XO = dM4E__X_MIN + dV4E_O;
+ public static final int dM4E__X_MAX = dM4E__X_MIN + dV4E__MAX;
+ public static final int dM4E__Y_MIN = dM4E__MIN + dV4E_Y * dV4E__MAX;
+ public static final int dM4E_YX = dM4E__Y_MIN + dV4E_X;
+ public static final int dM4E_YY = dM4E__Y_MIN + dV4E_Y;
+ public static final int dM4E_YZ = dM4E__Y_MIN + dV4E_Z;
+ public static final int dM4E_YO = dM4E__Y_MIN + dV4E_O;
+ public static final int dM4E__Y_MAX = dM4E__Y_MIN + dV4E__MAX;
+ public static final int dM4E__Z_MIN = dM4E__MIN + dV4E_Z * dV4E__MAX;
+ public static final int dM4E_ZX = dM4E__Z_MIN + dV4E_X;
+ public static final int dM4E_ZY = dM4E__Z_MIN + dV4E_Y;
+ public static final int dM4E_ZZ = dM4E__Z_MIN + dV4E_Z;
+ public static final int dM4E_ZO = dM4E__Z_MIN + dV4E_O;
+ public static final int dM4E__Z_MAX = dM4E__Z_MIN + dV4E__MAX;
+ public static final int dM4E__O_MIN = dM4E__MIN + dV4E_O * dV4E__MAX;
+ public static final int dM4E_OX = dM4E__O_MIN + dV4E_X;
+ public static final int dM4E_OY = dM4E__O_MIN + dV4E_Y;
+ public static final int dM4E_OZ = dM4E__O_MIN + dV4E_Z;
+ public static final int dM4E_OO = dM4E__O_MIN + dV4E_O;
+ public static final int dM4E__O_MAX = dM4E__O_MIN + dV4E__MAX;
+ public static final int dM4E__MAX = dM4E__MIN + dV4E__MAX * dV4E__MAX;
+ // dQuatElement
+ public static final int dQUE__MIN = 0;
+ public static final int dQUE_R = dQUE__MIN;
+ public static final int dQUE__AXIS_MIN = dQUE_R + 1;
+ public static final int dQUE_I = dQUE__AXIS_MIN + dSA_X;
+ public static final int dQUE_J = dQUE__AXIS_MIN + dSA_Y;
+ public static final int dQUE_K = dQUE__AXIS_MIN + dSA_Z;
+ public static final int dQUE__AXIS_MAX = dQUE__AXIS_MIN + dSA__MAX;
+ public static final int dQUE__MAX = dQUE__AXIS_MAX;
+
+}
Oops, something went wrong.

0 comments on commit 969d4f1

Please sign in to comment.