Examples of Matrix4f


Examples of javax.vecmath.Matrix4f

        PhysicsSphere(Vector4f colour, Vector3f position, DynamicsWorld physicsWorld, float mass, float radius, int slices, int stacks) {
            this.colour = colour;
            this.radius = radius;
            this.slices = slices;
            this.stacks = stacks;
            MotionState motion = new DefaultMotionState(new Transform(new Matrix4f(new Quat4f(0, 0, 0, 1), position, 1.0f)));
            CollisionShape shape = new SphereShape(radius);
            this.physicsBody = new RigidBody(mass, motion, shape);
            this.physicsWorld = physicsWorld;
            this.physicsWorld.addRigidBody(physicsBody);
            this.renderSphere = new org.lwjgl.util.glu.Sphere();
View Full Code Here

Examples of javax.vecmath.Matrix4f

      //mousePos.x += intersect.z;
      //System.out.println("after rotate " +intersect);
    }

    //get the chair matrix
    Matrix4f chairMatrix = new Matrix4f();
    Vec3D chairCentreOfMass = new Vec3D();
    if (GLOBAL.sketchChairs.getCurChair() != null
        && GLOBAL.sketchChairs.getCurChair().rigidBody != null) {
      Transform transform = new Transform();
      GLOBAL.sketchChairs.getCurChair().rigidBody
View Full Code Here

Examples of javax.vecmath.Matrix4f

  }

  public Vec2D getPointOnPlaneOld(Vec2D mousePoint, Plane planeIn) {
    //get the chair matrix
    Matrix4f chairMatrix = new Matrix4f();
    Vec3D chairCentreOfMass = new Vec3D();
    if (GLOBAL.sketchChairs.getCurChair() != null
        && GLOBAL.sketchChairs.getCurChair().rigidBody != null) {
      Transform transform = new Transform();
      GLOBAL.sketchChairs.getCurChair().rigidBody
View Full Code Here

Examples of javax.vecmath.Matrix4f

   
    //Remembered positions
    //BODYPART_HEAD
    bodies[BodyPart.BODYPART_HEAD.ordinal()].getMotionState()
        .getWorldTransform(transform);
    transform.set(new Matrix4f(0.999522f, -0.02457619f, 0.01875775f,
        103.311295f, 0.03083701f, 0.83602184f, -0.547829f,
        22.693146f * this.scale, -0.0022183368f, 0.5481455f, 0.83638f,
        -1.0370132f * this.scale, 0.0f, 0.0f, 0.0f, 1.0f * this.scale));
    bodies[BodyPart.BODYPART_HEAD.ordinal()]
        .setMotionState(new DefaultMotionState(transform));

    //BODYPART_SPINE
    bodies[BodyPart.BODYPART_SPINE.ordinal()].getMotionState()
        .getWorldTransform(transform);
    transform.setIdentity();
    transform.set(new Matrix4f(0.9932064f, 0.116363324f, 7.786779E-4f,
        104.067566f, -0.1162641f, 0.99203515f, 0.04846615f,
        31.873365f * this.scale, 0.004867207f, -0.048227426f,
        0.99882454f, 0.0021075667f * this.scale, 0.0f, 0.0f, 0.0f,
        1.0f * this.scale));
    bodies[BodyPart.BODYPART_SPINE.ordinal()]
        .setMotionState(new DefaultMotionState(transform));

    //BODYPART_PELVIS
    bodies[BodyPart.BODYPART_PELVIS.ordinal()].getMotionState()
        .getWorldTransform(transform);
    transform.setIdentity();
    transform.set(new Matrix4f(0.9835286f, 0.17898695f, -0.025202362f,
        105.264946f, -0.18059899f, 0.97884035f, -0.09620573f,
        40.34729f * this.scale, 0.007449517f, 0.099172615f, 0.9950424f,
        0.04683579f * this.scale, 0.0f, 0.0f, 0.0f, 1.0f * this.scale));
    bodies[BodyPart.BODYPART_PELVIS.ordinal()]
        .setMotionState(new DefaultMotionState(transform));

    //BODYPART_LEFT_UPPER_LEG
    bodies[BodyPart.BODYPART_LEFT_UPPER_LEG.ordinal()].getMotionState()
        .getWorldTransform(transform);
    transform.setIdentity();
    transform.set(new Matrix4f(0.29188365f, 0.9564537f, -4.4153258E-4f,
        109.79127f, -0.9526396f, 0.29067844f, -0.0893526f,
        44.345417f * this.scale, -0.08533329f, 0.026501186f,
        0.99599993f, 3.9808998f * this.scale, 0.0f, 0.0f, 0.0f,
        1.0f * this.scale));
    bodies[BodyPart.BODYPART_LEFT_UPPER_LEG.ordinal()]
        .setMotionState(new DefaultMotionState(transform));

    //BODYPART_LEFT_LOWER_LEG
    bodies[BodyPart.BODYPART_LEFT_LOWER_LEG.ordinal()].getMotionState()
        .getWorldTransform(transform);
    transform.setIdentity();
    transform.set(new Matrix4f(0.9873329f, -0.15865491f, 0.0015572663f,
        115.62421f, 0.15813647f, 0.98321307f, -0.09102161f,
        52.051834f * this.scale, 0.012909901f, 0.09011489f, 0.9958477f,
        4.6894903f * this.scale, 0.0f, 0.0f, 0.0f, 1.0f * this.scale));
    bodies[BodyPart.BODYPART_LEFT_LOWER_LEG.ordinal()]
        .setMotionState(new DefaultMotionState(transform));

    //RIGHT_UPPER_LEG
    bodies[BodyPart.BODYPART_RIGHT_UPPER_LEG.ordinal()].getMotionState()
        .getWorldTransform(transform);
    transform.setIdentity();
    transform.set(new Matrix4f(0.23838913f, 0.9675928f, -0.08327571f,
        110.01697f, -0.9671425f, 0.22872531f, -0.110996194f,
        44.76596f * this.scale, -0.08835185f, 0.10699976f, 0.9903257f,
        -2.6929f * this.scale, 0.0f, 0.0f, 0.0f, 1.0f * this.scale));
    bodies[BodyPart.BODYPART_RIGHT_UPPER_LEG.ordinal()]
        .setMotionState(new DefaultMotionState(transform));

    //BODYPART_RIGHT_LOWER_LEG
    bodies[BodyPart.BODYPART_RIGHT_LOWER_LEG.ordinal()].getMotionState()
        .getWorldTransform(transform);
    transform.setIdentity();
    transform.set(new Matrix4f(0.9864584f, -0.14225316f, -0.081632055f,
        116.022156f, 0.13265687f, 0.98470926f, -0.11291519f,
        52.043633f * this.scale, 0.09644639f, 0.10055709f, 0.9902456f,
        -1.3562305f * this.scale, 0.0f, 0.0f, 0.0f, 1.0f * this.scale));
    bodies[BodyPart.BODYPART_RIGHT_LOWER_LEG.ordinal()]
        .setMotionState(new DefaultMotionState(transform));

    //BODYPART_RIGHT_FOOT
    bodies[BodyPart.BODYPART_RIGHT_FOOT.ordinal()].getMotionState()
        .getWorldTransform(transform);
    transform.setIdentity();
    transform.set(new Matrix4f(0.00923717f, 0.9967484f, -0.080045804f,
        116.96003f, -0.99355465f, 1.0448694E-4f, -0.11335374f,
        57.707912f * this.scale, -0.11297679f, 0.08057695f, 0.990325f,
        -0.6338565f * this.scale, 0.0f, 0.0f, 0.0f, 1.0f * this.scale));
    bodies[BodyPart.BODYPART_RIGHT_FOOT.ordinal()]
        .setMotionState(new DefaultMotionState(transform));

    //BODYPART_LEFT_FOOT
    bodies[BodyPart.BODYPART_LEFT_FOOT.ordinal()].getMotionState()
        .getWorldTransform(transform);
    transform.setIdentity();
    transform.set(new Matrix4f(-3.4880638E-4f, 0.99999404f, 0.0034378879f,
        116.47286f, -0.9958018f, -3.2663345E-5f, -0.09153569f,
        57.707455f * this.scale, -0.09153503f, -0.0034553856f,
        0.99579585f, 5.203514f * this.scale, 0.0f, 0.0f, 0.0f,
        1.0f * this.scale));
    bodies[BodyPart.BODYPART_LEFT_FOOT.ordinal()]
 
View Full Code Here

Examples of javax.vecmath.Matrix4f

  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");
View Full Code Here

Examples of javax.vecmath.Matrix4f

        return;

      Transform transform = new Transform();
      MotionState motionstate = rigidBody.getMotionState();
      motionstate.getWorldTransform(transform);
      Matrix4f chairMatrix = new Matrix4f();
      transform.getMatrix(chairMatrix);
      //  LOGGER.debug("current origin"+transform.origin.toString());

      //this is overwritten when settign the chair matrix
      //transform.origin.set(this.centreOfMass.x, this.centreOfMass.y,
View Full Code Here

Examples of javax.vecmath.Matrix4f

        return depthPlane;
    } else {
      if (slabPlane != null)
        return slabPlane;
    }
    Matrix4f m = matrixTransform;
    return new Point4f(-m.m20, -m.m21, -m.m22, -m.m23
        + (isDepth ? depthValue : slabValue));
  }
View Full Code Here

Examples of javax.vecmath.Matrix4f

    visualRange = angstroms;
  }

  Matrix4f getUnscaledTransformMatrix() {
    //for povray only
    Matrix4f unscaled = new Matrix4f();
    unscaled.setIdentity();
    vectorTemp.set(fixedRotationCenter);
    matrixTemp.setZero();
    matrixTemp.setTranslation(vectorTemp);
    unscaled.sub(matrixTemp);
    matrixTemp.set(matrixRotate);
    unscaled.mul(matrixTemp, unscaled);
    return unscaled;
  }
View Full Code Here

Examples of javax.vecmath.Matrix4f

    boolean isSmiles = (!isIsomer && args.length > (isStdDev ? 3 : 2));
    BitSet bs1 = (args[0].tok == Token.bitset ? (BitSet) args[0].value : null);
    BitSet bs2 = (args[1].tok == Token.bitset ? (BitSet) args[1].value : null);
    String smiles1 = (bs1 == null ? ScriptVariable.sValue(args[0]) : "");
    String smiles2 = (bs2 == null ? ScriptVariable.sValue(args[1]) : "");
    Matrix4f m = new Matrix4f();
    stddev = Float.NaN;
    List ptsA, ptsB;
    if (isSmiles) {
      if (bs1 == null || bs2 == null)
        return false;
View Full Code Here

Examples of javax.vecmath.Matrix4f

        return addX(f);
      }
    case Token.matrix4f:
      if (n < 0 || n > 2)
        return false;
      Matrix4f m4 = (Matrix4f) x1.value;
      switch (tok) {
      case Token.row:
        f = new float[4];
        m4.getRow(n, f);
        return addX(f);
      case Token.col:
      default:
        f = new float[4];
        m4.getColumn(n, f);
        return addX(f);
      }
    }
    return false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.