/** * Get the slider linear position (i.e. the slider's extension) * * When the axis is set, the current position of the attached bodies is * examined and that position will be the zero position. * The position is the distance, with respect to the zero position, * along the slider axis of body 1 with respect to * body 2. (A NULL body is replaced by the world). * @param j j * @return r */ //ODE_API public static double dJointGetSliderPosition (DSliderJoint j) { return j.getPosition(); }
body[1].addForce (0,0,-0.1); if (iteration == 40) { double a = jointSlider.getPosition (); if (a > 0.2 && a < 0.5) return 0; double p = jointSlider.getPosition (); double r = jointSlider.getPositionRate (); double er = (p-last_pos_321)/STEPSIZE; // estimated rate (almost exact)
/** * Get the slider linear position (i.e. the slider's extension) * * When the axis is set, the current position of the attached bodies is * examined and that position will be the zero position. * The position is the distance, with respect to the zero position, * along the slider axis of body 1 with respect to * body 2. (A NULL body is replaced by the world). * @param j j * @return r */ //ODE_API public static double dJointGetSliderPosition (DSliderJoint j) { return j.getPosition(); }
if (joint instanceof DSliderJoint) { DSliderJoint sj = (DSliderJoint) (joint); System.out.println("Position =" + sj.getPosition()); } else if (joint instanceof DPUJoint) { DPUJoint pu = (DPUJoint) (joint);
if ( joint instanceof DSliderJoint) { DSliderJoint sj = (DSliderJoint) (joint); System.out.println("Position =" + sj.getPosition()); } else { DPistonJoint rj = (DPistonJoint ) (joint);
l = ( (DSliderJoint ) joint).getPosition(); } else { ( (DPistonJoint ) joint).getAxis (ax);
l = ( (DSliderJoint ) joint).getPosition(); } else { ( (DPistonJoint ) joint).getAxis (ax);
if ( joint instanceof DSliderJoint) { DSliderJoint sj = (DSliderJoint) (joint); std_cout("Position =",sj.getPosition() ,"\n"); } else { DPistonJoint rj = (DPistonJoint ) (joint);
if (joint instanceof DSliderJoint) { DSliderJoint sj = (DSliderJoint) (joint); std_cout("Position =", sj.getPosition(), "\n"); } else if (joint instanceof DPUJoint) { DPUJoint pu = (DPUJoint) (joint);