Examples of Matrix3f


Examples of com.jme.math.Matrix3f

        return loadedModel;
    }

    // This gimble locks, but good enough for now...
    public static Matrix3f calcRotationMatrix(float x, float y, float z) {
        Matrix3f m3f = new Matrix3f();
        m3f.loadIdentity();
        m3f.fromAngleAxis(x, new Vector3f(1f, 0f, 0f));
        Matrix3f rotY = new Matrix3f();
        rotY.loadIdentity();
        rotY.fromAngleAxis(y, new Vector3f(0f, 1f, 0f));
        Matrix3f rotZ = new Matrix3f();
        rotZ.loadIdentity();
        rotZ.fromAngleAxis(z, new Vector3f(0f, 0f, 1f));

        m3f.multLocal(rotY);
        m3f.multLocal(rotZ);

        return m3f;
View Full Code Here

Examples of com.jme.math.Matrix3f

                        label = new TextLabel2D(displayName, foregroundColor, backgroundColor,
          height, true, font);

                        label.setLocalTranslation(0, heightAbove, 0);

                        Matrix3f rot = new Matrix3f();
                        rot.fromAngleAxis((float) Math.PI, new Vector3f(0f, 1f, 0f));
                        label.setLocalRotation(rot);

                        attachChild(label);
                    } else {
                        label.setFont(font);
View Full Code Here

Examples of com.jme3.math.Matrix3f

            } else {
                return;
            }
        }

        Matrix3f mat = new Matrix3f();
        mat.fromAngleNormalAxis(rotationSpeed * value, axis);

        Vector3f up = cam.getUp();
        Vector3f left = cam.getLeft();
        Vector3f dir = cam.getDirection();

        mat.mult(up, up);
        mat.mult(left, left);
        mat.mult(dir, dir);

        if (firstPersonConstraint && up.getY() < 0) {
            return;
        }

View Full Code Here

Examples of com.jme3.math.Matrix3f

                // apply translation
                geometry.setLocalTranslation(childCollisionShape.location);

                // apply rotation
                TempVars vars = TempVars.get();               
                Matrix3f tempRot = vars.tempMat3;

                tempRot.set(geometry.getLocalRotation());
                childCollisionShape.rotation.mult(tempRot, tempRot);
                geometry.setLocalRotation(tempRot);

                vars.release();
View Full Code Here

Examples of com.jme3.math.Matrix3f

            particle.velocity.multLocal(normalVelocity);
        } else {
            // calculating surface tangent (velocity contains the 'normal' value)
            temp.set(particle.velocity.z * surfaceTangentFactor, particle.velocity.y * surfaceTangentFactor, -particle.velocity.x * surfaceTangentFactor);
            if (surfaceTangentRotation != 0.0f) {// rotating the tangent
                Matrix3f m = new Matrix3f();
                m.fromAngleNormalAxis(FastMath.PI * surfaceTangentRotation, particle.velocity);
                temp = m.multLocal(temp);
            }
            // applying normal factor (this must be done first)
            particle.velocity.multLocal(normalVelocity);
            // adding tangent vector
            particle.velocity.addLocal(temp);
View Full Code Here

Examples of javax.vecmath.Matrix3f

 
  /**
   * Updates model rotation from the values of <code>transform</code>.
   */
  private void updateModelRotation(Transform3D transform) {
    Matrix3f modelRotationMatrix = new Matrix3f();
    transform.getRotationScale(modelRotationMatrix);
    boolean proportional = this.controller.isProportional();
    this.controller.setProportional(false);
    this.controller.setModelRotation(new float [][] {{modelRotationMatrix.m00, modelRotationMatrix.m01, modelRotationMatrix.m02},
                                                     {modelRotationMatrix.m10, modelRotationMatrix.m11, modelRotationMatrix.m12},
View Full Code Here

Examples of javax.vecmath.Matrix3f

              float depth = controller.getDepth();
              float height = controller.getHeight();
             
              // Compute size before old model rotation
              float [][] oldModelRotation = (float [][])ev.getOldValue();
              Matrix3f oldModelRotationMatrix = new Matrix3f(oldModelRotation [0][0], oldModelRotation [0][1], oldModelRotation [0][2],
                  oldModelRotation [1][0], oldModelRotation [1][1], oldModelRotation [1][2],
                  oldModelRotation [2][0], oldModelRotation [2][1], oldModelRotation [2][2]);
              oldModelRotationMatrix.invert();
              float oldWidth = oldModelRotationMatrix.m00 * width
                  + oldModelRotationMatrix.m01 * height
                  + oldModelRotationMatrix.m02 * depth;
              float oldHeight = oldModelRotationMatrix.m10 * width
                  + oldModelRotationMatrix.m11 * height
View Full Code Here

Examples of javax.vecmath.Matrix3f

  public Object clone() throws CloneNotSupportedException{
    TransformDataXith3d res=(TransformDataXith3d)super.clone();
    res.trans=new Transform3D();
    res.v3=new Vector3f();
    res.m3=new Matrix3f();
    res.m4=new Matrix4f();
    res.q=new Quat4f();   
    return res;
  }
View Full Code Here

Examples of javax.vecmath.Matrix3f

      return FULL;
    }
    if(isIdentity(m)){
      return IDENTITY;
    }
    Matrix3f m3=new Matrix3f();
    Vector3f v=new Vector3f();
    float s=m.get(m3, v);
    if(s==1.0f){
      if(isIdentity(m3)){
        if(v.x==0.f){
View Full Code Here

Examples of javax.vecmath.Matrix3f

 
  public Object clone() throws CloneNotSupportedException{
    TransformDataJava3d res=(TransformDataJava3d)super.clone();
    res.trans=new Transform3D();
    res.v3=new Vector3d();
    res.m3=new Matrix3f();
    res.m4=new Matrix4f();
    res.q=new Quat4f();
    return res;
  }
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.