Package org.ode4j.ode

Examples of org.ode4j.ode.DGeom


    DMass mass = OdeHelper.createMass();
    DBody body = OdeHelper.createBody(env.getWorld());
    mass.setBox(1, 1, 1, 3);
    body.setMass(mass);
    body.setPosition(pos.x, pos.y, pos.z);
    DGeom geom = OdeHelper.createBox(0.5, 0.5, 3);
    geom.setBody(body);
    env.getSpace().add(geom);
    body.setAngularDamping(.001f);
    body.setLinearDamping(.001f);
    bodies.add(body);
    geoms.add(geom);
View Full Code Here


    DMass mass = OdeHelper.createMass();
    DBody body = OdeHelper.createBody(env.getWorld());
    mass.setBox(1, 1, 1, 3);
    body.setMass(mass);
    body.setPosition(pos.x, pos.y, pos.z);
    DGeom geom = OdeHelper.createBox(1, 1, 1);
    geom.setBody(body);
    env.getSpace().add(geom);
    body.setAngularDamping(.001f);
    body.setLinearDamping(.001f);
    bodies.add(body);
    geoms.add(geom);
View Full Code Here

//    DVector3 size = new DVector3(1,1,1);
//    mass.setBox(1, size.get0(), size.get1(), size.get2());
    mass.setCylinder(1, 1, 1, .5);
    body.setMass(mass);
//    geom = OdeHelper.createBox(size.get0(), size.get1(), size.get2());
    DGeom geom = OdeHelper.createCylinder(null, 1, .5);
    geom.setBody(body);
    env.getSpace().add(geom);
   
    bodies.add(body);
    geoms.add(geom);
    masses.add(mass);
View Full Code Here

      // create left body
      DBody body = OdeHelper.createBody(env.getWorld());
      body.setPosition(0, -L / 4, H / 2);
      mass.setBoxTotal(MASS / 2, W, L / 2, H);
      body.setMass(mass);
      DGeom geom = OdeHelper.createBox(env.getSpace(), W, L / 2, H);
      geom.setBody(body);
      bodies.add(body);
      geoms.add(geom);

      // create central bodies
      for (int i = 1; i < numberOfModules; i++) {
        body = OdeHelper.createBody(env.getWorld());
        body.setPosition(0, -L * (i), H / 2);
        mass.setBoxTotal(MASS, W, L / 2, H);
        body.setMass(mass);

        geom = OdeHelper.createBox(env.getSpace(), W, L / 2, H);
        DGeom geom2 = OdeHelper.createBox(
            env.getSpace(), W, L / 2, H);

        geom.setBody(body);
        geom2.setBody(body);

        geom.setOffsetPosition(0, L / 4, 0);
        geom2.setOffsetPosition(0, -L / 4, 0);
        bodies.add(body);
        geoms.add(geom);
        geoms.add(geom2);
      }

View Full Code Here

    DBody body = OdeHelper.createBody(env.getWorld());
    body.setPosition(position);
    DVector3 size = new DVector3(1,1,1);
    mass.setBox(1, size.get0(), size.get1(), size.get2());
    body.setMass(mass);
    DGeom geom = OdeHelper.createBox(size.get0(), size.get1(), size.get2());
    geom.setBody(body);
    env.getSpace().add(geom);
   
    bodies.add(body);
    geoms.add(geom);
    masses.add(mass);
View Full Code Here

    private static final long serialVersionUID = -4099834334274853259L;

    public ClothEnv(int id, ParCollection params) {
    super(id, params);
    DBody blockbody = OdeHelper.createBody(getWorld());
    DGeom blockgeom = OdeHelper.createSphere(1);
    DMass blockmass = OdeHelper.createMass();
    blockbody.setPosition(0, 0, 1.1);
    blockmass.setSphere(1, 1);
    blockgeom.setBody(blockbody);
    blockbody.setMass(blockmass);
    getSpace().add(blockgeom);
   
  }
View Full Code Here

   * @param params
   */
  public ObstacleAgent(int id, ClothEnv env, ParCollection params) {
    super(id, env, params);
   
    DGeom geom = OdeHelper.createSphere(env.getSpace(), 1);
    DBody body = OdeHelper.createBody(env.getWorld());
    body.setPosition(0, 0, 1);
    DMass mass = OdeHelper.createMass();
    mass.setSphere(2, 2);
    geom.setBody(body);
    body.setKinematic();
   
    bodies.add(body);
    geoms.add(geom);
    masses.add(mass);
View Full Code Here

            prePos.get1() + relPos.get1()*size.get1()/2,
            prePos.get2() + relPos.get2()*size.get2()/2);
      }
      DBody b = OdeHelper.createBody(env.getWorld());
      bp.setBody(b);
      DGeom g = OdeHelper.createBox(
          env.getSpace(),
          size.get0(),
          size.get1(),
          size.get2());
      b.setPosition(newPos);
      g.setBody(b);
      DMass mass = OdeHelper.createMass();
      mass.setBox(
          1,
          bp.getSize().get0(),
          bp.getSize().get1(),
View Full Code Here

TOP

Related Classes of org.ode4j.ode.DGeom

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.