Package com.flansmod.common.vector

Examples of com.flansmod.common.vector.Vector3f


  }
 
  //Rotate globally by some angle about the pitch axis
  public RotatedAxes rotateGlobalPitch(float rotateBy)
  {
    rotationMatrix.rotate(rotateBy * 3.14159265F / 180F, new Vector3f(0F, 0F, 1F));
    convertMatrixToAngles();
    return this;
  }
View Full Code Here


  }
 
  //Rotate globally by some angle about the roll axis
  public RotatedAxes rotateGlobalRoll(float rotateBy)
  {
    rotationMatrix.rotate(rotateBy * 3.14159265F / 180F, new Vector3f(1F, 0F, 0F));
    convertMatrixToAngles();
    return this;
  }
View Full Code Here

  }
 
  //Rotate globally by some angle about the yaw axis
  public RotatedAxes rotateGlobalYawInRads(float rotateBy)
  {
    rotationMatrix.rotate(rotateBy, new Vector3f(0F, 1F, 0F));
    convertMatrixToAngles();
    return this;
  }
View Full Code Here

  }
 
  //Rotate globally by some angle about the pitch axis
  public RotatedAxes rotateGlobalPitchInRads(float rotateBy)
  {
    rotationMatrix.rotate(rotateBy, new Vector3f(0F, 0F, 1F));
    convertMatrixToAngles();
    return this;
  }
View Full Code Here

  }
 
  //Rotate globally by some angle about the roll axis
  public RotatedAxes rotateGlobalRollInRads(float rotateBy)
  {
    rotationMatrix.rotate(rotateBy, new Vector3f(1F, 0F, 0F));
    convertMatrixToAngles();
    return this;
  }
View Full Code Here

    Matrix4f mat = new Matrix4f();
    mat.m00 = in.x;
    mat.m10 = in.y;
    mat.m20 = in.z;
    //Do the rotations used to obtain this basis in reverse
    mat.rotate(-rotationYaw * 3.14159265F / 180F, new Vector3f(0F, 1F, 0F));
    mat.rotate(-rotationPitch * 3.14159265F / 180F, new Vector3f(0F, 0F, 1F));
    mat.rotate(-rotationRoll * 3.14159265F / 180F, new Vector3f(1F, 0F, 0F));
    return new Vector3f(mat.m00, mat.m10, mat.m20);
  }
View Full Code Here

    Matrix4f mat = new Matrix4f();
    mat.m00 = in.x;
    mat.m10 = in.y;
    mat.m20 = in.z;
    //Do the rotations used to obtain this basis
    mat.rotate(rotationRoll * 3.14159265F / 180F, new Vector3f(1F, 0F, 0F));
    mat.rotate(rotationPitch * 3.14159265F / 180F, new Vector3f(0F, 0F, 1F));
    mat.rotate(rotationYaw * 3.14159265F / 180F, new Vector3f(0F, 1F, 0F));
    return new Vector3f(mat.m00, mat.m10, mat.m20);
  }
View Full Code Here

  private void convertAnglesToMatrix()
  {
    //Re-load the identity
    rotationMatrix = new Matrix4f();
    rotationMatrix.rotate(rotationRoll * 3.14159265F / 180F, new Vector3f(1F, 0F, 0F));
    rotationMatrix.rotate(rotationPitch * 3.14159265F / 180F, new Vector3f(0F, 0F, 1F));
    rotationMatrix.rotate(rotationYaw * 3.14159265F / 180F, new Vector3f(0F, 1F, 0F));
    convertMatrixToAngles();
  }
View Full Code Here

  {
    //Take the input matrix
    Matrix4f mat = new Matrix4f();
    mat.load(in.getMatrix());
    //Perform the rotations to convert from this local set of axes to the global axes
    mat.rotate(rotationRoll * 3.14159265F / 180F, new Vector3f(1F, 0F, 0F));
    mat.rotate(rotationPitch * 3.14159265F / 180F, new Vector3f(0F, 0F, 1F));
    mat.rotate(rotationYaw * 3.14159265F / 180F, new Vector3f(0F, 1F, 0F));
    //Return the globalised matrix
    return new RotatedAxes(mat);
  }
View Full Code Here

   
    ammoModel[1] = new ModelRendererTurbo(this, 20, 12, textureX, textureY);
    ammoModel[1].addShapeBox(4F, -1F, -1F, 2, 2, 2, 0F, /* 0 */ -2F, 0F, 0F, /* 1 */ 1.25F, -1.25F, 0F, /* 2 */ 1.25F, -1.25F, 0F, /* 3 */ -2F, 0F, 0F, /* 4 */ -0.5F, -0.5F, 0F, /* 5 */ 0.5F, 0F, 0F, /* 6 */ 0.5F, 0F, 0F, /* 7 */ -0.5F, -0.5F, 0F);

    //Stock
    stockAttachPoint = new Vector3f(3F / 16F, 5F / 16F, 0F);
   
    defaultStockModel = new ModelRendererTurbo[4];
   
    defaultStockModel[0] = new ModelRendererTurbo(this, 12, 10, textureX, textureY);
    defaultStockModel[0].addBox(-2F, 3F, -0.5F, 1, 1, 1);
   
    defaultStockModel[1] = new ModelRendererTurbo(this, 16, 10, textureX, textureY);
    defaultStockModel[1].addShapeBox(-7F, 1F, -0.5F, 5, 1, 1, 0F, /* 0 */ 0F, 0F, 0F, /* 1 */ 0F, -2F, 0F, /* 2 */ 0F, -2F, 0F, /* 3 */ 0F, 0F, 0F, /* 4 */ 0F, -0.5F, 0F, /* 5 */ 0F, 1.5F, 0F, /* 6 */ 0F, 1.5F, 0F, /* 7 */ 0F, -0.5F, 0F);

    defaultStockModel[2] = new ModelRendererTurbo(this, 18, 8, textureX, textureY);
    defaultStockModel[2].addBox(-7F, 3.5F, -0.5F, 5, 0.5F, 1);

    defaultStockModel[3] = new ModelRendererTurbo(this, 28, 12, textureX, textureY);
    defaultStockModel[3].addBox(-8F, 1F, -0.5F, 1, 3, 1);

    //Barrel
    barrelAttachPoint = new Vector3f(11.75F / 16F, 3.5F / 16F, 0F);
   
    defaultBarrelModel = new ModelRendererTurbo[1];
   
    defaultBarrelModel[0] = new ModelRendererTurbo(this, 32, 14, textureX, textureY);
    defaultBarrelModel[0].addBox(11.5F, 3F, -0.5F, 2, 1, 1);
   
    //Scope
    scopeAttachPoint = new Vector3f(3F / 16F, 5F / 16F, 0F);
   
    defaultScopeModel = new ModelRendererTurbo[1];
   
    defaultScopeModel[0] = new ModelRendererTurbo(this, 38, 14, textureX, textureY);
    defaultScopeModel[0].addBox(4F, 5F, -0.5F, 1, 1, 1);
View Full Code Here

TOP

Related Classes of com.flansmod.common.vector.Vector3f

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.