/** * Set anchor. * @param j j * @param x x * @param y y * @param z z */ //ODE_API public static void dJointSetUniversalAnchor (DUniversalJoint j, double x, double y, double z) { j.setAnchor(x, y, z); }
/** * Set axis. * @param j j * @param x x * @param y y * @param z z */ //ODE_API public static void dJointSetUniversalAxis1 (DUniversalJoint j, double x, double y, double z) { j.setAxis1(x, y, z); }
/** * Set axis. * @param j j * @param x x * @param y y * @param z z */ //ODE_API public static void dJointSetUniversalAxis2 (DUniversalJoint j, double x, double y, double z) { j.setAxis2(x, y, z); }
private DJoint addUniversalJoint(DxRagdollBody body1, DxRagdollBody body2, DVector3 anchor, DVector3 axis1, DVector3 axis2, double loStop1, double hiStop1, double loStop2, double hiStop2) { DUniversalJoint joint = OdeHelper.createUniversalJoint(world); joint.attach(body1.body, body2.body); joint.setAnchor(anchor); joint.setAxis1(axis1); joint.setAxis2(axis2); joint.setParam(PARAM_N.dParamLoStop1, loStop1); joint.setParam(PARAM_N.dParamHiStop1, hiStop1); joint.setParam(PARAM_N.dParamLoStop2, loStop2); joint.setParam(PARAM_N.dParamHiStop2, hiStop2); joints.add(joint); return joint; }
jointUniversal.getAxis1(ax1); jointUniversal.getAxis2(ax2); return Math.abs(10*ax1.dot(ax2)); double a = jointUniversal.getAngle1(); double r = jointUniversal.getAngle1Rate(); double diff = a - last_angle_701; if (diff > M_PI) diff -= 2*M_PI; double a = jointUniversal.getAngle2(); double r = jointUniversal.getAngle2Rate(); double diff = a - last_angle_702; if (diff > M_PI) diff -= 2*M_PI; addOscillatingTorqueAbout (0.1, 1, 1, 0); dampRotationalMotion (0.1); jointUniversal.getAxis1(ax1); jointUniversal.getAxis2(ax2); return Math.abs(10*ax1.dot(ax2)); double a = jointUniversal.getAngle1(); double r = jointUniversal.getAngle1Rate(); double diff = a - last_angle_721; if (diff > M_PI) diff -= 2*M_PI; double a = jointUniversal.getAngle2(); double r = jointUniversal.getAngle2Rate(); double diff = a - last_angle_722; if (diff > M_PI) diff -= 2*M_PI;
/** * Get both angles at the same time. * * <p>NOTE: This function combine getUniversalAngle1 and getUniversalAngle2 together * and try to avoid redundant calculation * * @param joint The universal joint for which we want to calculate the angles * @param angle1 The angle between the body1 and the axis 1 * @param angle2 The angle between the body2 and the axis 2 */ //ODE_API // void dJointGetUniversalAngles (dJoint j, double *angle1, double *angle2); public static void dJointGetUniversalAngles (DUniversalJoint joint, RefDouble angle1, RefDouble angle2) { angle1.d = joint.getAngle1(); angle2.d = joint.getAngle2(); }
/** * Get time derivative of angle * @param j j * @return r */ //ODE_API public static double dJointGetUniversalAngle1Rate (DUniversalJoint j) { return j.getAngle1Rate(); }
/** * Get angle * @param j j * @return r */ //ODE_API public static double dJointGetUniversalAngle2 (DUniversalJoint j) { return j.getAngle2(); }
/** * Get angle. * @param j j * @return r */ //ODE_API public static double dJointGetUniversalAngle1 (DUniversalJoint j) { return j.getAngle1(); }
/** * Get time derivative of angle * @param j j * @return r */ //ODE_API public static double dJointGetUniversalAngle2Rate (DUniversalJoint j) { return j.getAngle2Rate(); }
/** * Get axis. * @param j j * @param result r */ //ODE_API public static void dJointGetUniversalAxis1 (DUniversalJoint j, DVector3 result) { j.getAxis1(result); }
/** * Get axis. * @param j j * @param result r */ //ODE_API public static void dJointGetUniversalAxis2 (DUniversalJoint j, DVector3 result) { j.getAxis2(result); }
private DJoint addUniversalJoint(DxRagdollBody body1, DxRagdollBody body2, DVector3 anchor, DVector3 axis1, DVector3 axis2, double loStop1, double hiStop1, double loStop2, double hiStop2) { DUniversalJoint joint = OdeHelper.createUniversalJoint(world); joint.attach(body1.body, body2.body); joint.setAnchor(anchor); joint.setAxis1(axis1); joint.setAxis2(axis2); joint.setParam(PARAM_N.dParamLoStop1, loStop1); joint.setParam(PARAM_N.dParamHiStop1, hiStop1); joint.setParam(PARAM_N.dParamLoStop2, loStop2); joint.setParam(PARAM_N.dParamHiStop2, hiStop2); joints.add(joint); return joint; }
/** * Get both angles at the same time. * * <p>NOTE: This function combine getUniversalAngle1 and getUniversalAngle2 together * and try to avoid redundant calculation * * @param joint The universal joint for which we want to calculate the angles * @param angle1 The angle between the body1 and the axis 1 * @param angle2 The angle between the body2 and the axis 2 */ //ODE_API // void dJointGetUniversalAngles (dJoint j, double *angle1, double *angle2); public static void dJointGetUniversalAngles (DUniversalJoint joint, RefDouble angle1, RefDouble angle2) { angle1.d = joint.getAngle1(); angle2.d = joint.getAngle2(); }
/** * Get time derivative of angle * @param j j * @return r */ //ODE_API public static double dJointGetUniversalAngle1Rate (DUniversalJoint j) { return j.getAngle1Rate(); }
/** * Get angle * @param j j * @return r */ //ODE_API public static double dJointGetUniversalAngle2 (DUniversalJoint j) { return j.getAngle2(); }
/** * Get angle. * @param j j * @return r */ //ODE_API public static double dJointGetUniversalAngle1 (DUniversalJoint j) { return j.getAngle1(); }
/** * Get time derivative of angle * @param j j * @return r */ //ODE_API public static double dJointGetUniversalAngle2Rate (DUniversalJoint j) { return j.getAngle2Rate(); }
/** * Get axis. * @param j j * @param result r */ //ODE_API public static void dJointGetUniversalAxis1 (DUniversalJoint j, DVector3 result) { j.getAxis1(result); }
/** * Get axis. * @param j j * @param result r */ //ODE_API public static void dJointGetUniversalAxis2 (DUniversalJoint j, DVector3 result) { j.getAxis2(result); }