Package javax.vecmath

Examples of javax.vecmath.Matrix3f


    Vector3f right = new Vector3f();
    right.cross(cameraUp, forward);
    Quat4f roll = new Quat4f();
    QuaternionUtil.setRotation(roll, right, -rele);

    Matrix3f tmpMat1 = new Matrix3f();
    Matrix3f tmpMat2 = new Matrix3f();
    tmpMat1.set(rot);
    tmpMat2.set(roll);
    tmpMat1.mul(tmpMat2);
    tmpMat1.transform(eyePos);

    cameraPosition.set(eyePos);
View Full Code Here


   */
  public int getId() {
    return id;
  }
  public Matrix3f getRotation() {
    return new Matrix3f(Functions.actorGetRotation(id));
  }
View Full Code Here

    static class Matrix3fWrapper extends ValueWrapper {
  private float[] value = new float[9];

  @Override
  void set(Object value) {
      Matrix3f m = (Matrix3f)value;
      this.value[0] = m.m00;
      this.value[1] = m.m01;
      this.value[2] = m.m02;
      this.value[3] = m.m10;
      this.value[4] = m.m11;
View Full Code Here

      this.value[8] = m.m22;
  }

  @Override
  Object get() {
      return new Matrix3f(value);
  }
View Full Code Here

  }

  @Override
  void set(int index, Object value) {
      int j = index * 9;
      Matrix3f m = (Matrix3f)value;

      this.value[j+0] = m.m00;
      this.value[j+1] = m.m01;
      this.value[j+2] = m.m02;
      this.value[j+3] = m.m10;
View Full Code Here

  @Override
  Object get() {
      Matrix3f[] arr = new Matrix3f[this.length];
      for (int i = 0; i < this.length; i++) {
    int j = i * 9;
                arr[i] = new Matrix3f();
    arr[i].m00 = this.value[j+0];
    arr[i].m01 = this.value[j+1];
    arr[i].m02 = this.value[j+2];
    arr[i].m10 = this.value[j+3];
    arr[i].m11 = this.value[j+4];
View Full Code Here

          Quat4f tmpQuat = Stack.alloc(Quat4f.class);
          tmp.normalize(ab);
          QuaternionUtil.setRotation(tmpQuat, tmp, cst2Pi / 3f);

          Matrix3f r = Stack.alloc(Matrix3f.class);
          MatrixUtil.setRotation(r, tmpQuat);

          Vector3f w = Stack.alloc(Vector3f.class);
          w.set(b[m[0] > m[1] ? m[0] > m[2] ? 0 : 2 : m[1] > m[2] ? 1 : 2]);

          tmp.normalize(w);
          Support(tmp, simplex[4]); r.transform(w);
          tmp.normalize(w);
          Support(tmp, simplex[2]); r.transform(w);
          tmp.normalize(w);
          Support(tmp, simplex[3]); r.transform(w);
          order = 4;
          return (true);
        }
        // Triangle
        case 2: {
View Full Code Here

    Vector3f right = new Vector3f();
    right.cross(cameraUp, forward);
    Quat4f roll = new Quat4f();
    QuaternionUtil.setRotation(roll, right, -rele);

    Matrix3f tmpMat1 = new Matrix3f();
    Matrix3f tmpMat2 = new Matrix3f();
    tmpMat1.set(rot);
    tmpMat2.set(roll);
    tmpMat1.mul(tmpMat2);
    tmpMat1.transform(eyePos);

    cameraPosition.set(eyePos);
View Full Code Here

    appliedImpulse = 0f;

    Vector3f normal = Stack.alloc(Vector3f.class);
    normal.set(0f, 0f, 0f);

    Matrix3f tmpMat1 = Stack.alloc(Matrix3f.class);
    Matrix3f tmpMat2 = Stack.alloc(Matrix3f.class);
    Vector3f tmp1 = Stack.alloc(Vector3f.class);
    Vector3f tmp2 = Stack.alloc(Vector3f.class);
    Vector3f tmpVec = Stack.alloc(Vector3f.class);
   
    Transform centerOfMassA = rbA.getCenterOfMassTransform(Stack.alloc(Transform.class));
    Transform centerOfMassB = rbB.getCenterOfMassTransform(Stack.alloc(Transform.class));

    for (int i = 0; i < 3; i++) {
      VectorUtil.setCoord(normal, i, 1f);

      tmpMat1.transpose(centerOfMassA.basis);
      tmpMat2.transpose(centerOfMassB.basis);

      tmp1.set(pivotInA);
      centerOfMassA.transform(tmp1);
      tmp1.sub(rbA.getCenterOfMassPosition(tmpVec));
View Full Code Here

    // linear part
    for (int i=0; i<3; i++) {
      calculatedTransformA.basis.getColumn(i, normalWorld);

      Matrix3f mat1 = rbA.getCenterOfMassTransform(tmpTrans1).basis;
      mat1.transpose();

      Matrix3f mat2 = rbB.getCenterOfMassTransform(tmpTrans2).basis;
      mat2.transpose();

      jacLin[i].init(
          mat1,
          mat2,
          relPosA,
          relPosB,
          normalWorld,
          rbA.getInvInertiaDiagLocal(tmp),
          rbA.getInvMass(),
          rbB.getInvInertiaDiagLocal(tmp2),
          rbB.getInvMass());
      jacLinDiagABInv[i] = 1f / jacLin[i].getDiagonal();
      VectorUtil.setCoord(depth, i, delta.dot(normalWorld));
    }
    testLinLimits();

    // angular part
    for (int i=0; i<3; i++) {
      calculatedTransformA.basis.getColumn(i, normalWorld);

      Matrix3f mat1 = rbA.getCenterOfMassTransform(tmpTrans1).basis;
      mat1.transpose();

      Matrix3f mat2 = rbB.getCenterOfMassTransform(tmpTrans2).basis;
      mat2.transpose();

      jacAng[i].init(
          normalWorld,
          mat1,
          mat2,
View Full Code Here

TOP

Related Classes of javax.vecmath.Matrix3f

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.