Tabnine Logo
com.ardor3d.math
Code IndexAdd Tabnine to your IDE (free)

How to use com.ardor3d.math

Best Java code snippets using com.ardor3d.math (Showing top 20 results out of 315)

origin: Renanse/Ardor3D

private Matrix4 a3dMatrixRandom() {
  final Matrix4 mat = new Matrix4();
  final Vector3 axis = new Vector3(MathUtils.nextRandomDouble(), MathUtils.nextRandomDouble(),
      MathUtils.nextRandomDouble());
  axis.normalizeLocal();
  mat.applyRotation(MathUtils.nextRandomDouble(), axis.getX(), axis.getY(), axis.getZ());
  mat.applyTranslationPost(MathUtils.nextRandomDouble(), MathUtils.nextRandomDouble(),
      MathUtils.nextRandomDouble());
  return mat;
}
origin: com.ardor3d/ardor3d-math

public Vector3 getPositiveEnd(final Vector3 store) {
  Vector3 result = store;
  if (result == null) {
    result = new Vector3();
  }
  result.set(getDirection()).multiplyLocal(_extent);
  result.addLocal(getOrigin());
  return result;
}
origin: com.ardor3d/ardor3d-math

/**
 * @return An instance of Vector2 that is intended for temporary use in calculations and so forth. Multiple calls to
 *         the method should return instances of this class that are not currently in use.
 */
public final static Vector2 fetchTempInstance() {
  if (MathConstants.useMathPools) {
    return Vector2.VEC_POOL.fetch();
  } else {
    return new Vector2();
  }
}
origin: Renanse/Ardor3D

/**
 * Apply the rotation matrix to a given vector representing a particle velocity.
 *
 * @param pSpeed
 *            the velocity vector to be modified.
 */
protected void rotateVectorSpeed(final Vector3 pSpeed) {
  final double x = pSpeed.getX(), y = pSpeed.getY(), z = pSpeed.getZ();
  pSpeed.setX(-1 * ((_rotMatrix.getM00() * x) + (_rotMatrix.getM10() * y) + (_rotMatrix.getM20() * z)));
  pSpeed.setY((_rotMatrix.getM01() * x) + (_rotMatrix.getM11() * y) + (_rotMatrix.getM21() * z));
  pSpeed.setZ(-1 * ((_rotMatrix.getM02() * x) + (_rotMatrix.getM12() * y) + (_rotMatrix.getM22() * z)));
}
origin: Renanse/Ardor3D

/**
 * @return An instance of Transform that is intended for temporary use in calculations and so forth. Multiple calls
 *         to the method should return instances of this class that are not currently in use.
 */
public final static Transform fetchTempInstance() {
  if (MathConstants.useMathPools) {
    return Transform.TRANS_POOL.fetch();
  } else {
    return new Transform();
  }
}
origin: Renanse/Ardor3D

@Override
public Transform multiply(final ReadOnlyTransform transformBy, final Transform store) {
  final Transform transform = super.multiply(transformBy, store);
  if (!Transform.isValid(transform)) {
    throw new InvalidTransformException("Transform is invalid");
  }
  return transform;
}
origin: Renanse/Ardor3D

/**
 * @return An instance of Quaternion that is intended for temporary use in calculations and so forth. Multiple calls
 *         to the method should return instances of this class that are not currently in use.
 */
public final static Quaternion fetchTempInstance() {
  if (MathConstants.useMathPools) {
    return Quaternion.QUAT_POOL.fetch();
  } else {
    return new Quaternion();
  }
}
origin: Renanse/Ardor3D

@Override
public ValidatingTransform setRotation(final ReadOnlyQuaternion rotation) {
  super.setRotation(rotation);
  validate();
  return this;
}
origin: Renanse/Ardor3D

/**
 * @return An instance of Rectangle2 that is intended for temporary use in calculations and so forth. Multiple calls
 *         to the method should return instances of this class that are not currently in use.
 */
public final static Rectangle2 fetchTempInstance() {
  if (MathConstants.useMathPools) {
    return Rectangle2.RECTANGLE_POOL.fetch();
  } else {
    return new Rectangle2();
  }
}
origin: com.ardor3d/ardor3d-math

/**
 * @return An instance of Line3 that is intended for temporary use in calculations and so forth. Multiple calls to
 *         the method should return instances of this class that are not currently in use.
 */
public final static Line3 fetchTempInstance() {
  if (MathConstants.useMathPools) {
    return LINE3_POOL.fetch();
  } else {
    return new Line3();
  }
}
origin: com.ardor3d/ardor3d-math

/**
 * @return An instance of Rectangle3 that is intended for temporary use in calculations and so forth. Multiple calls
 *         to the method should return instances of this class that are not currently in use.
 */
public final static Rectangle3 fetchTempInstance() {
  if (MathConstants.useMathPools) {
    return Rectangle3.RECTANGLE_POOL.fetch();
  } else {
    return new Rectangle3();
  }
}
origin: com.ardor3d/ardor3d-math

/**
 * @return An instance of Triangle that is intended for temporary use in calculations and so forth. Multiple calls
 *         to the method should return instances of this class that are not currently in use.
 */
public final static Triangle fetchTempInstance() {
  if (MathConstants.useMathPools) {
    return Triangle.TRI_POOL.fetch();
  } else {
    return new Triangle();
  }
}
origin: com.ardor3d/ardor3d-math

/**
 * @return the magnitude of this vector, or the distance between the origin (0, 0) and the point described by (x,
 *         y). Basically sqrt(x^2 + y^2)
 */
@Override
public double length() {
  return MathUtils.sqrt(lengthSquared());
}
origin: com.ardor3d/ardor3d-math

@Override
public Transform translate(final ReadOnlyVector3 vec) {
  super.translate(vec);
  validate();
  return this;
}
origin: Renanse/Ardor3D

/**
 * @return the magnitude or distance between the origin (0, 0, 0, 0) and the point described by this vector (x, y,
 *         z, w). Effectively the square root of the value returned by {@link #lengthSquared()}.
 */
@Override
public double length() {
  return MathUtils.sqrt(lengthSquared());
}
origin: Renanse/Ardor3D

/**
 * @param x
 * @param y
 * @return the distance between the point described by this vector and the given x, y point.
 */
@Override
public double distance(final double x, final double y) {
  return MathUtils.sqrt(distanceSquared(x, y));
}
origin: com.ardor3d/ardor3d-math

public Vector3 getNegativeEnd(final Vector3 store) {
  Vector3 result = store;
  if (result == null) {
    result = new Vector3();
  }
  result.set(getDirection()).multiplyLocal(-_extent);
  result.addLocal(getOrigin());
  return result;
}
origin: Renanse/Ardor3D

/**
 * @return An instance of Rectangle3 that is intended for temporary use in calculations and so forth. Multiple calls
 *         to the method should return instances of this class that are not currently in use.
 */
public final static Rectangle3 fetchTempInstance() {
  if (MathConstants.useMathPools) {
    return Rectangle3.RECTANGLE_POOL.fetch();
  } else {
    return new Rectangle3();
  }
}
origin: Renanse/Ardor3D

/**
 * @return the magnitude of this vector, or the distance between the origin (0, 0) and the point described by (x,
 *         y). Basically sqrt(x^2 + y^2)
 */
@Override
public double length() {
  return MathUtils.sqrt(lengthSquared());
}
origin: Renanse/Ardor3D

public Vector3 getNegativeEnd(final Vector3 store) {
  Vector3 result = store;
  if (result == null) {
    result = new Vector3();
  }
  result.set(getDirection()).multiplyLocal(-_extent);
  result.addLocal(getOrigin());
  return result;
}
com.ardor3d.math

Most used classes

  • Vector3
    Vector3 represents a point or vector in a three dimensional system. This implementation stores its d
  • MathUtils
  • ColorRGBA
    ColorRGBA is a 4 component color value (red, green, blue, alpha). The standard range for each indivi
  • Transform
    Transform models a transformation in 3d space as: Y = M*X+T, with M being a Matrix3 and T is a Vecto
  • ReadOnlyColorRGBA
  • Matrix3,
  • ReadOnlyMatrix3,
  • ReadOnlyVector3,
  • Matrix4,
  • Vector2,
  • Vector4,
  • Quaternion,
  • Rectangle2,
  • Plane,
  • Ray3,
  • ReadOnlyMatrix4,
  • Line3,
  • Triangle,
  • ReadOnlyRay3
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now