All Known Implementing Classes:
RVec3

public interface RVec3Arg
Read-only access to an RVec3. (native type: const RVec3)
  • Method Summary

    Modifier and Type
    Method
    Description
    cross(RVec3Arg rightFactor)
    Return the cross product with the argument.
    double
    dot(RVec3Arg factor)
    Return the dot product with the argument.
    double
    get(int index)
    Return the specified component in double precision.
    Return the first (X) component in positional precision.
    Return the 2nd (Y) component in positional precision.
    Return the 3rd (Z) component in positional precision.
    boolean
    Test whether the vector contains infinities or NaNs.
    boolean
    Test whether the vector contains NaNs.
    boolean
    Test whether the squared length is within 10^-12 (single-precision) or 10^-24 (double-precision) of zero.
    boolean
    isNearZero(double tolerance)
    Test whether the squared length is within the specified tolerance of zero.
    boolean
    Test whether the vector is normalized to within a tolerance of 10^-6 (single precision) or 10^-12 (double precision).
    boolean
    isNormalized(double tolerance)
    Test whether the vector is normalized to within the specified tolerance.
    double
    Return the length.
    double
    Return the squared length.
    Generate a unit vector with the same direction.
    Generate the component-wise reciprocal.
    double[]
    Copy the components to an array.
    Convert to single-precision vector.
    float
    x()
    Return the first (X) component in single precision.
    double
    xx()
    Return the first (X) component in double precision.
    float
    y()
    Return the 2nd (Y) component in single precision.
    double
    yy()
    Return the 2nd (Y) component in double precision.
    float
    z()
    Return the 3rd (Z) component in single precision.
    double
    zz()
    Return the 3rd (Z) component in double precision.
  • Method Details

    • cross

      RVec3 cross(RVec3Arg rightFactor)
      Return the cross product with the argument. Both vectors are unaffected.
      Parameters:
      rightFactor - the vector to cross with the current one (not null, unaffected)
      Returns:
      a new product vector
    • dot

      double dot(RVec3Arg factor)
      Return the dot product with the argument. Both vectors are unaffected.
      Parameters:
      factor - the vector to dot with the current one (not null, unaffected)
      Returns:
      the dot product
    • get

      double get(int index)
      Return the specified component in double precision. The vector is unaffected.
      Parameters:
      index - 0, 1, or 2
      Returns:
      the X component if index=0, the Y component if index=1, or the Z component if index=2
      Throws:
      IllegalArgumentException - if index is not 0, 1, or 2
    • getX

      Object getX()
      Return the first (X) component in positional precision. The vector is unaffected.
      Returns:
      the component value
    • getY

      Object getY()
      Return the 2nd (Y) component in positional precision. The vector is unaffected.
      Returns:
      the component value
    • getZ

      Object getZ()
      Return the 3rd (Z) component in positional precision. The vector is unaffected.
      Returns:
      the component value
    • isFinite

      boolean isFinite()
      Test whether the vector contains infinities or NaNs. The vector is unaffected.
      Returns:
      false if one or more infinities or NaNs, otherwise true
    • isNan

      boolean isNan()
      Test whether the vector contains NaNs. The vector is unaffected.
      Returns:
      true if one or more NaNs, otherwise false
    • isNearZero

      boolean isNearZero()
      Test whether the squared length is within 10^-12 (single-precision) or 10^-24 (double-precision) of zero. The vector is unaffected.
      Returns:
      true if nearly zero, otherwise false
    • isNearZero

      boolean isNearZero(double tolerance)
      Test whether the squared length is within the specified tolerance of zero. The vector is unaffected.
      Parameters:
      tolerance - the desired tolerance (≥0, default=1e-12 or 1e-24)
      Returns:
      true if nearly zero, otherwise false
    • isNormalized

      boolean isNormalized()
      Test whether the vector is normalized to within a tolerance of 10^-6 (single precision) or 10^-12 (double precision). The vector is unaffected.
      Returns:
      true if normalized, otherwise false
    • isNormalized

      boolean isNormalized(double tolerance)
      Test whether the vector is normalized to within the specified tolerance. The vector is unaffected.
      Parameters:
      tolerance - the desired tolerance (≥0, default=1e-6 or 1e-12)
      Returns:
      true if normalized, otherwise false
    • length

      double length()
      Return the length. The vector is unaffected.
      Returns:
      the length
    • lengthSq

      double lengthSq()
      Return the squared length. The vector is unaffected.
      Returns:
      the squared length
    • normalized

      RVec3 normalized()
      Generate a unit vector with the same direction. The current vector is unaffected.
      Returns:
      a new vector
    • reciprocal

      RVec3 reciprocal()
      Generate the component-wise reciprocal. The current vector is unaffected.
      Returns:
      a new vector
    • toArray

      double[] toArray()
      Copy the components to an array. The vector is unaffected.
      Returns:
      a new array with length=3
    • toVec3

      Vec3 toVec3()
      Convert to single-precision vector. The current vector is unaffected.
      Returns:
      a new vector
    • x

      float x()
      Return the first (X) component in single precision. The vector is unaffected.
      Returns:
      the component value
    • xx

      double xx()
      Return the first (X) component in double precision. The vector is unaffected.
      Returns:
      the component value
    • y

      float y()
      Return the 2nd (Y) component in single precision. The vector is unaffected.
      Returns:
      the component value
    • yy

      double yy()
      Return the 2nd (Y) component in double precision. The vector is unaffected.
      Returns:
      the component value
    • z

      float z()
      Return the 3rd (Z) component in single precision. The vector is unaffected.
      Returns:
      the component value
    • zz

      double zz()
      Return the 3rd (Z) component in double precision. The vector is unaffected.
      Returns:
      the component value