Package com.bulletphysics.linearmath

Examples of com.bulletphysics.linearmath.Transform


  }

  public void printOrigins() {

    Transform transform = new Transform();
    Vector3f origin = new Vector3f();
    Matrix4f matrix = new Matrix4f();

    bodies[BodyPart.BODYPART_HEAD.ordinal()].getMotionState()
        .getWorldTransform(transform);
    transform.getMatrix(matrix);
    System.out.println("//BODYPART_HEAD");
    System.out
        .println("bodies[BodyPart.BODYPART_HEAD.ordinal()].getMotionState().getWorldTransform(transform);");
    System.out.println("transform.set(new Matrix4f(" + matrix.m00 + "f,"
        + matrix.m01 + "f," + matrix.m02 + "f," + matrix.m03 + "f,"
        + matrix.m10 + "f," + matrix.m11 + "f," + matrix.m12 + "f,"
        + matrix.m13 + "f * this.scale," + matrix.m20 + "f,"
        + matrix.m21 + "f," + matrix.m22 + "f," + matrix.m23
        + "f * this.scale," + matrix.m30 + "f," + matrix.m31 + "f,"
        + matrix.m32 + "f," + matrix.m33 + "f * this.scale));");
    System.out
        .println("bodies[BodyPart.BODYPART_HEAD.ordinal()].setMotionState(new  DefaultMotionState(transform));");
    System.out.println();

    bodies[BodyPart.BODYPART_SPINE.ordinal()].getMotionState()
        .getWorldTransform(transform);
    transform.getMatrix(matrix);
    System.out.println("//BODYPART_SPINE");
    System.out
        .println("bodies[BodyPart.BODYPART_SPINE.ordinal()].getMotionState().getWorldTransform(transform);");
    System.out.println("transform.setIdentity();");
    System.out.println("transform.set(new Matrix4f(" + matrix.m00 + "f,"
        + matrix.m01 + "f," + matrix.m02 + "f," + matrix.m03 + "f,"
        + matrix.m10 + "f," + matrix.m11 + "f," + matrix.m12 + "f,"
        + matrix.m13 + "f * this.scale," + matrix.m20 + "f,"
        + matrix.m21 + "f," + matrix.m22 + "f," + matrix.m23
        + "f * this.scale," + matrix.m30 + "f," + matrix.m31 + "f,"
        + matrix.m32 + "f," + matrix.m33 + "f * this.scale));");
    System.out
        .println("bodies[BodyPart.BODYPART_SPINE.ordinal()].setMotionState(new  DefaultMotionState(transform));");
    System.out.println();

    bodies[BodyPart.BODYPART_PELVIS.ordinal()].getMotionState()
        .getWorldTransform(transform);
    transform.getMatrix(matrix);
    System.out.println("//BODYPART_PELVIS");
    System.out
        .println("bodies[BodyPart.BODYPART_PELVIS.ordinal()].getMotionState().getWorldTransform(transform);");
    System.out.println("transform.setIdentity();");
    System.out.println("transform.set(new Matrix4f(" + matrix.m00 + "f,"
        + matrix.m01 + "f," + matrix.m02 + "f," + matrix.m03 + "f,"
        + matrix.m10 + "f," + matrix.m11 + "f," + matrix.m12 + "f,"
        + matrix.m13 + "f * this.scale," + matrix.m20 + "f,"
        + matrix.m21 + "f," + matrix.m22 + "f," + matrix.m23
        + "f * this.scale," + matrix.m30 + "f," + matrix.m31 + "f,"
        + matrix.m32 + "f," + matrix.m33 + "f * this.scale));");
    System.out
        .println("bodies[BodyPart.BODYPART_PELVIS.ordinal()].setMotionState(new  DefaultMotionState(transform));");
    System.out.println();

    bodies[BodyPart.BODYPART_LEFT_UPPER_LEG.ordinal()].getMotionState()
        .getWorldTransform(transform);
    transform.getMatrix(matrix);
    System.out.println("//BODYPART_LEFT_UPPER_LEG");
    System.out
        .println("bodies[BodyPart.BODYPART_LEFT_UPPER_LEG.ordinal()].getMotionState().getWorldTransform(transform);");
    System.out.println("transform.setIdentity();");
    System.out.println("transform.set(new Matrix4f(" + matrix.m00 + "f,"
        + matrix.m01 + "f," + matrix.m02 + "f," + matrix.m03 + "f,"
        + matrix.m10 + "f," + matrix.m11 + "f," + matrix.m12 + "f,"
        + matrix.m13 + "f * this.scale," + matrix.m20 + "f,"
        + matrix.m21 + "f," + matrix.m22 + "f," + matrix.m23
        + "f * this.scale," + matrix.m30 + "f," + matrix.m31 + "f,"
        + matrix.m32 + "f," + matrix.m33 + "f * this.scale));");
    System.out
        .println("bodies[BodyPart.BODYPART_LEFT_UPPER_LEG.ordinal()].setMotionState(new  DefaultMotionState(transform));");
    System.out.println();

    bodies[BodyPart.BODYPART_LEFT_LOWER_LEG.ordinal()].getMotionState()
        .getWorldTransform(transform);
    transform.getMatrix(matrix);
    System.out.println("//BODYPART_LEFT_LOWER_LEG");
    System.out
        .println("bodies[BodyPart.BODYPART_LEFT_LOWER_LEG.ordinal()].getMotionState().getWorldTransform(transform);");
    System.out.println("transform.setIdentity();");
    System.out.println("transform.set(new Matrix4f(" + matrix.m00 + "f,"
        + matrix.m01 + "f," + matrix.m02 + "f," + matrix.m03 + "f,"
        + matrix.m10 + "f," + matrix.m11 + "f," + matrix.m12 + "f,"
        + matrix.m13 + "f * this.scale," + matrix.m20 + "f,"
        + matrix.m21 + "f," + matrix.m22 + "f," + matrix.m23
        + "f * this.scale," + matrix.m30 + "f," + matrix.m31 + "f,"
        + matrix.m32 + "f," + matrix.m33 + "f * this.scale));");
    System.out
        .println("bodies[BodyPart.BODYPART_LEFT_LOWER_LEG.ordinal()].setMotionState(new  DefaultMotionState(transform));");
    System.out.println();

    bodies[BodyPart.BODYPART_RIGHT_UPPER_LEG.ordinal()].getMotionState()
        .getWorldTransform(transform);
    transform.getMatrix(matrix);
    System.out.println("//RIGHT_UPPER_LEG");
    System.out
        .println("bodies[BodyPart.BODYPART_RIGHT_UPPER_LEG.ordinal()].getMotionState().getWorldTransform(transform);");
    System.out.println("transform.setIdentity();");
    System.out.println("transform.set(new Matrix4f(" + matrix.m00 + "f,"
        + matrix.m01 + "f," + matrix.m02 + "f," + matrix.m03 + "f,"
        + matrix.m10 + "f," + matrix.m11 + "f," + matrix.m12 + "f,"
        + matrix.m13 + "f * this.scale," + matrix.m20 + "f,"
        + matrix.m21 + "f," + matrix.m22 + "f," + matrix.m23
        + "f * this.scale," + matrix.m30 + "f," + matrix.m31 + "f,"
        + matrix.m32 + "f," + matrix.m33 + "f * this.scale));");
    System.out
        .println("bodies[BodyPart.BODYPART_RIGHT_UPPER_LEG.ordinal()].setMotionState(new  DefaultMotionState(transform));");
    System.out.println();

    bodies[BodyPart.BODYPART_RIGHT_LOWER_LEG.ordinal()].getMotionState()
        .getWorldTransform(transform);
    transform.getMatrix(matrix);
    System.out.println("//BODYPART_RIGHT_LOWER_LEG");
    System.out
        .println("bodies[BodyPart.BODYPART_RIGHT_LOWER_LEG.ordinal()].getMotionState().getWorldTransform(transform);");
    System.out.println("transform.setIdentity();");
    System.out.println("transform.set(new Matrix4f(" + matrix.m00 + "f,"
        + matrix.m01 + "f," + matrix.m02 + "f," + matrix.m03 + "f,"
        + matrix.m10 + "f," + matrix.m11 + "f," + matrix.m12 + "f,"
        + matrix.m13 + "f * this.scale," + matrix.m20 + "f,"
        + matrix.m21 + "f," + matrix.m22 + "f," + matrix.m23
        + "f * this.scale," + matrix.m30 + "f," + matrix.m31 + "f,"
        + matrix.m32 + "f," + matrix.m33 + "f * this.scale));");
    System.out
        .println("bodies[BodyPart.BODYPART_RIGHT_LOWER_LEG.ordinal()].setMotionState(new  DefaultMotionState(transform));");
    System.out.println();

    bodies[BodyPart.BODYPART_RIGHT_FOOT.ordinal()].getMotionState()
        .getWorldTransform(transform);
    transform.getMatrix(matrix);
    System.out.println("//BODYPART_RIGHT_FOOT");
    System.out
        .println("bodies[BodyPart.BODYPART_RIGHT_FOOT.ordinal()].getMotionState().getWorldTransform(transform);");
    System.out.println("transform.setIdentity();");
    System.out.println("transform.set(new Matrix4f(" + matrix.m00 + "f,"
        + matrix.m01 + "f," + matrix.m02 + "f," + matrix.m03 + "f,"
        + matrix.m10 + "f," + matrix.m11 + "f," + matrix.m12 + "f,"
        + matrix.m13 + "f * this.scale," + matrix.m20 + "f,"
        + matrix.m21 + "f," + matrix.m22 + "f," + matrix.m23
        + "f * this.scale," + matrix.m30 + "f," + matrix.m31 + "f,"
        + matrix.m32 + "f," + matrix.m33 + "f * this.scale));");
    System.out
        .println("bodies[BodyPart.BODYPART_RIGHT_FOOT.ordinal()].setMotionState(new  DefaultMotionState(transform));");
    System.out.println();

    bodies[BodyPart.BODYPART_LEFT_FOOT.ordinal()].getMotionState()
        .getWorldTransform(transform);
    transform.getMatrix(matrix);
    System.out.println("//BODYPART_LEFT_FOOT");
    System.out
        .println("bodies[BodyPart.BODYPART_LEFT_FOOT.ordinal()].getMotionState().getWorldTransform(transform);");
    System.out.println("transform.setIdentity();");
    System.out.println("transform.set(new Matrix4f(" + matrix.m00 + "f,"
View Full Code Here


      g.fill(SETTINGS.ERGODOLL_FILL_COLOUR);

    g.pushMatrix();
    g.scale(renderScale);
    g.noStroke();
    Transform myTransform = new Transform();

    if (!GLOBAL.performanceMode)
      g.sphereDetail(SETTINGS.sphere_res);
    //head
View Full Code Here

      GLOBAL.widgetMaterials.slotSizeTextfield.setText(
          Float.toString(SETTINGS.materialThickness));
    }

    // now we are a "live" object again, so let's run rebuild and start
    this.currentWorldTransform = new Transform();
    this.selectedPlanes.empty();
    this.selectedPlanes.add(this.getSlicePlanesY());
    this.selectedPlanes.buildCurrentSketch();

    // this.updateCollisionShape();
View Full Code Here

  /**
   * Set the current designs position as the start position to start from after rewinding.
   */
  public void setCurrentPositionAsStartTransform() {
    Transform startTransform = new Transform();

    Vector3f localInertia = new Vector3f(0, 0, 0);
    float mass = this.getMass();
    trimesh.calculateLocalInertia(mass, localInertia);
    startTransform.origin.set(
View Full Code Here

    if (currentWorldTransform == null || rigidBody == null)
      return new Vec3D(0, 0, 0);

    float scaleBy = 1f / GLOBAL.jBullet.getScale();
    Transform myTransform = new Transform();
    myTransform = rigidBody.getMotionState().getWorldTransform(myTransform);

    Vector3f center = new Vector3f();
    rigidBody.getCenterOfMassPosition(center);
View Full Code Here

        .getDispatcher();
    if (dispatcher == null)
      return;

    GImpactCollisionAlgorithm.registerAlgorithm(dispatcher);
    Transform startTransform = new Transform();

    Vector3f localInertia = new Vector3f(0, 0, 0);
    float mass = this.getMass();
    trimesh.calculateLocalInertia(mass, localInertia);
    startTransform.origin.set(centreOfMass.x, centreOfMass.y,
        centreOfMass.z);
    DefaultMotionState myMotionState = new DefaultMotionState(
        startTransform);

    this.startWorldTransform = startTransform;
    RigidBodyConstructionInfo rbInfo = new RigidBodyConstructionInfo(mass,
        myMotionState, trimesh, localInertia);
    rigidBody = new RigidBody(rbInfo);
    Transform center = new Transform();
    center.origin.set(centreOfMass.x, centreOfMass.y, centreOfMass.z);
    rigidBody.setCenterOfMassTransform(center);

    rigidBody.setDamping(SETTINGS.chair_damping_linear,
        SETTINGS.chair_damping_ang);
View Full Code Here

      if (rigidBody == null)
        return;

      float scaleBy = 1f / GLOBAL.jBullet.getScale();
      Transform myTransform = new Transform();
      myTransform = rigidBody.getMotionState().getWorldTransform(
          myTransform);

      Vector3f center = new Vector3f();
      rigidBody.getCenterOfMassPosition(center);
View Full Code Here

        return p;

      }

      float scaleBy = 1f / GLOBAL.jBullet.getScale();
      Transform myTransform = new Transform();
      myTransform = rigidBody.getMotionState().getWorldTransform(
          myTransform);

      Vector3f center = new Vector3f();
      rigidBody.getCenterOfMassPosition(center);
View Full Code Here

    this.hybernate();

    Vec3D thisCentre = this.getCentreOfMass();

    Transform worldTransform = new Transform();
    rigidBody.getMotionState().getWorldTransform(worldTransform);
    // worldTransform.origin.setX(
    // this.startWorldTransform.origin.x-worldTransform.origin.x );

    // worldTransform.origin.y - this.startWorldTransform.origin.y,
View Full Code Here

    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    }

    // now we are a "live" object again, so let's run rebuild and start
    currentWorldTransform = new Transform();
    this.buildPreview();

  }
View Full Code Here

TOP

Related Classes of com.bulletphysics.linearmath.Transform

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.