Package org.ode4j.ode

Examples of org.ode4j.ode.DBallJoint


   
    int jointCounter = 0;
//    attach vertical constraints
    for (int x = 0; x < width; x++) {
      for (int y = 0; y < height - 1; y++) {
        DBallJoint joint = joints[jointCounter];
        joint = OdeHelper.createBallJoint(env.getWorld());
        joint.attach(bodyMatrix[x][y],bodyMatrix[x][y + 1]);
        joint.setParam(DJoint.PARAM_N.dParamCFM1, cfmAng1);
        joint.setParam(DJoint.PARAM_N.dParamERP1, erpAng1);
        joint.setParam(DJoint.PARAM_N.dParamFMax1, fmaxAng1);
        jointCounter++;
      }
    }
    //
     // attach horizontal constraints
    for (int x = 0; x < width - 1; x++) {
      for (int y = 0; y < height; y++) {
        DBallJoint joint = joints[jointCounter];
        joint = OdeHelper.createBallJoint(env.getWorld());
        joint.attach(bodyMatrix[x][y],bodyMatrix[x + 1][y]);
        joint.setParam(DJoint.PARAM_N.dParamCFM1, cfmAng1);
        joint.setParam(DJoint.PARAM_N.dParamERP1, erpAng1);
        joint.setParam(DJoint.PARAM_N.dParamFMax1, fmaxAng1);
        jointCounter++;
      }
    }
    // attach diagonal constraints
    for (int x = 0; x < width - 1; x++) {
      for (int y = 0; y < height - 1; y++) {
        DBallJoint joint = joints[jointCounter];
        joint = OdeHelper.createBallJoint(env.getWorld());
        joint.attach(bodyMatrix[x][y],bodyMatrix[x + 1][y + 1]);
        joint.setParam(DJoint.PARAM_N.dParamCFM1, cfmAng1);
        joint.setParam(DJoint.PARAM_N.dParamERP1, erpAng1);
        joint.setParam(DJoint.PARAM_N.dParamFMax1, fmaxAng1);
        jointCounter++;
      }
    }
////
    // attach diagonal constraints
    for (int x = 0; x < width-1; x++) {
      for (int y = 0; y < height - 1; y++) {
        DBallJoint joint = joints[jointCounter];
        joint = OdeHelper.createBallJoint(env.getWorld());
        joint.attach(bodyMatrix[x+1][y],bodyMatrix[x][y + 1]);
        joint.setParam(DJoint.PARAM_N.dParamCFM1, cfmAng1);
        joint.setParam(DJoint.PARAM_N.dParamERP1, erpAng1);
        joint.setParam(DJoint.PARAM_N.dParamFMax1, fmaxAng1);
        jointCounter++;
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.ode4j.ode.DBallJoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.