/** * Get the current angle for axis. * * <p>REMARK: * In dAMotorUser mode this is simply the value that was set with * dJointSetAMotorAngle(). * In dAMotorEuler mode this is the corresponding euler angle. * @param j j * @param anum a * @return r */ //ODE_API public static double dJointGetAMotorAngle (DAMotorJoint j, int anum) { return j.getAngle(anum); }
/** * Set axis. * @param j j * @param anum anum * @param rel r * @param x x * @param y y * @param z z */ //ODE_API public static void dJointSetAMotorAxis (DAMotorJoint j, int anum, int rel, double x, double y, double z) { j.setAxis(anum, rel, x, y, z); }
/** * Set the nr of axes. * @param j j * @param num 0..3 */ //ODE_API public static void dJointSetAMotorNumAxes (DAMotorJoint j, int num) { j.setNumAxes(num); }
lmotor[1].attach (body[0],null); amotor[0] = OdeHelper.createAMotorJoint (world,null); amotor[0].attach (body[0],body[1]); amotor[1] = OdeHelper.createAMotorJoint (world,null); amotor[1].attach (body[0], null); amotor[i].setNumAxes( 3); amotor[i].setAxis(0,1,1,0,0); amotor[i].setAxis(1,1,0,1,0); amotor[i].setAxis(2,1,0,0,1); amotor[i].setParamFMax(0.00001); amotor[i].setParamFMax2(0.00001); amotor[i].setParamFMax3(0.00001); amotor[i].setParamVel(0); amotor[i].setParamVel2(0); amotor[i].setParamVel3(0);
0,0,1, 0,0,1, 0,0); jointAMotor = OdeHelper.createAMotorJoint (world,null); jointAMotor.attach (body[0],body[1]); jointAMotor.setNumAxes (3); jointAMotor.setAxis (0,1, 0,0,1); jointAMotor.setAxis (2,2, 1,0,0); jointAMotor.setMode (AMotorMode.dAMotorEuler); max_iterations = 200; return 1;
/** * Set mode. * @param j j * @param mode mode */ //ODE_API public static void dJointSetAMotorMode (DAMotorJoint j, int mode) { j.setMode(AMotorMode.from(mode)); }
/** * Get the current angle rate for axis anum. * * <p>REMARK: * In dAMotorUser mode this is always zero, as not enough information is * available. * In dAMotorEuler mode this is the corresponding euler angle rate. * @param j j * @param anum a * @return r */ //ODE_API public static double dJointGetAMotorAngleRate (DAMotorJoint j, int anum) { return j.getAngleRate(anum); }
/** * Get the AMotor axes. * @param j j * @param anum selects the axis to change (0,1 or 2). * <ul> * <li> 0: The axis is anchored to the global frame. </li> * <li> 1: The axis is anchored to the first body. </li> * <li> 2: The axis is anchored to the second body. </li> * </ul> * @param result Each axis can have one of three ``relative orientation'' modes. */ //ODE_API public static void dJointGetAMotorAxis (DAMotorJoint j, int anum, DVector3 result) { j.getAxis(anum, result); }
/** * Applies torque0 about the AMotor's axis 0, torque1 about the * AMotor's axis 1, and torque2 about the AMotor's axis 2. * * <p>REMARK: * If the motor has fewer than three axes, the higher torques are ignored. * This function is just a wrapper for dBodyAddTorque(). * @param j j * @param torque1 t1 * @param torque2 t2 * @param torque3 t3 */ //ODE_API public static void dJointAddAMotorTorques (DAMotorJoint j, double torque1, double torque2, double torque3) { j.addTorques(torque1, torque2, torque3); }
/** * Get the angular motor mode. * Mode must be one of the following constants: * <ul> * <li> dAMotorUser The AMotor axes and joint angle settings are entirely * controlled by the user. This is the default mode.</li> * <li> dAMotorEuler Euler angles are automatically computed. * The axis a1 is also automatically computed. * The AMotor axes must be set correctly when in this mode, * as described below.</li> * </ul> * When this mode is initially set the current relative orientations * of the bodies will correspond to all euler angles at zero. * @param j j * @return r */ //ODE_API public static AMotorMode dJointGetAMotorMode (DAMotorJoint j) { return j.getMode(); }
/** * Get axis. * * <p>REMARK: * The axis vector is always specified in global coordinates regardless * of the setting of rel. * There are two GetAMotorAxis functions, one to return the axis and one to * return the relative mode. * * For dAMotorEuler mode: * <ul> * <li> Only axes 0 and 2 need to be set. Axis 1 will be determined automatically at each time step. </li> * <li> Axes 0 and 2 must be perpendicular to each other. </li> * <li> Axis 0 must be anchored to the first body, axis 2 must be anchored to the second body. </li> * </ul> * @param j j * @param anum a * @return r */ //ODE_API public static int dJointGetAMotorAxisRel (DAMotorJoint j, int anum) { return j.getAxisRel(anum); }
/** * Set mode. * @param j j * @param mode mode */ //ODE_API public static void dJointSetAMotorMode (DAMotorJoint j, int mode) { j.setMode(AMotorMode.from(mode)); }
/** * Get the current angle rate for axis anum. * * <p>REMARK: * In dAMotorUser mode this is always zero, as not enough information is * available. * In dAMotorEuler mode this is the corresponding euler angle rate. * @param j j * @param anum a * @return r */ //ODE_API public static double dJointGetAMotorAngleRate (DAMotorJoint j, int anum) { return j.getAngleRate(anum); }
/** * Get the AMotor axes. * @param j j * @param anum selects the axis to change (0,1 or 2). * <ul> * <li> 0: The axis is anchored to the global frame. </li> * <li> 1: The axis is anchored to the first body. </li> * <li> 2: The axis is anchored to the second body. </li> * </ul> * @param result Each axis can have one of three ``relative orientation'' modes. */ //ODE_API public static void dJointGetAMotorAxis (DAMotorJoint j, int anum, DVector3 result) { j.getAxis(anum, result); }
/** * Applies torque0 about the AMotor's axis 0, torque1 about the * AMotor's axis 1, and torque2 about the AMotor's axis 2. * * <p>REMARK: * If the motor has fewer than three axes, the higher torques are ignored. * This function is just a wrapper for dBodyAddTorque(). * @param j j * @param torque1 t1 * @param torque2 t2 * @param torque3 t3 */ //ODE_API public static void dJointAddAMotorTorques (DAMotorJoint j, double torque1, double torque2, double torque3) { j.addTorques(torque1, torque2, torque3); }
/** * Get the angular motor mode. * Mode must be one of the following constants: * <ul> * <li> dAMotorUser The AMotor axes and joint angle settings are entirely * controlled by the user. This is the default mode.</li> * <li> dAMotorEuler Euler angles are automatically computed. * The axis a1 is also automatically computed. * The AMotor axes must be set correctly when in this mode, * as described below.</li> * </ul> * When this mode is initially set the current relative orientations * of the bodies will correspond to all euler angles at zero. * @param j j * @return r */ //ODE_API public static AMotorMode dJointGetAMotorMode (DAMotorJoint j) { return j.getMode(); }
/** * Get axis. * * <p>REMARK: * The axis vector is always specified in global coordinates regardless * of the setting of rel. * There are two GetAMotorAxis functions, one to return the axis and one to * return the relative mode. * * For dAMotorEuler mode: * <ul> * <li> Only axes 0 and 2 need to be set. Axis 1 will be determined automatically at each time step. </li> * <li> Axes 0 and 2 must be perpendicular to each other. </li> * <li> Axis 0 must be anchored to the first body, axis 2 must be anchored to the second body. </li> * </ul> * @param j j * @param anum a * @return r */ //ODE_API public static int dJointGetAMotorAxisRel (DAMotorJoint j, int anum) { return j.getAxisRel(anum); }
/** * Get the current angle for axis. * * <p>REMARK: * In dAMotorUser mode this is simply the value that was set with * dJointSetAMotorAngle(). * In dAMotorEuler mode this is the corresponding euler angle. * @param j j * @param anum a * @return r */ //ODE_API public static double dJointGetAMotorAngle (DAMotorJoint j, int anum) { return j.getAngle(anum); }
/** * Set the nr of axes. * @param j j * @param num 0..3 */ //ODE_API public static void dJointSetAMotorNumAxes (DAMotorJoint j, int num) { j.setNumAxes(num); }
/** * Set axis. * @param j j * @param anum anum * @param rel r * @param x x * @param y y * @param z z */ //ODE_API public static void dJointSetAMotorAxis (DAMotorJoint j, int anum, int rel, double x, double y, double z) { j.setAxis(anum, rel, x, y, z); }