Package org.joml

Interface Vector4Lc

  • All Known Implementing Classes:
    Vector4L

    public interface Vector4Lc
    Interface to a read-only view of a 4-dimensional vector of longs.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Vector4L absolute​(Vector4L dest)
      Compute the absolute of each of this vector's components and store the result into dest.
      Vector4L add​(long x, long y, long z, long w, Vector4L dest)
      Increment the components of this vector by the given values and store the result in dest.
      Vector4L add​(Vector4ic v, Vector4L dest)
      Add the supplied vector to this one and store the result in dest.
      Vector4L add​(Vector4Lc v, Vector4L dest)
      Add the supplied vector to this one and store the result in dest.
      double distance​(long x, long y, long z, long w)
      Return the distance between this vector and (x, y, z, w).
      double distance​(Vector4ic v)
      Return the distance between this Vector and v.
      double distance​(Vector4Lc v)
      Return the distance between this Vector and v.
      long distanceSquared​(long x, long y, long z, long w)
      Return the square of the distance between this vector and (x, y, z, w).
      long distanceSquared​(Vector4ic v)
      Return the square of the distance between this vector and v.
      long distanceSquared​(Vector4Lc v)
      Return the square of the distance between this vector and v.
      Vector4L div​(float scalar, Vector4L dest)
      Divide all components of this vector by the given scalar value and store the result in dest.
      Vector4L div​(long scalar, Vector4L dest)
      Divide all components of this vector by the given scalar value and store the result in dest.
      Vector4L div​(Vector4ic v, Vector4L dest)
      Divide this Vector4L component-wise by another Vector4ic and store the result in dest.
      Vector4L div​(Vector4Lc v, Vector4L dest)
      Divide this Vector4L component-wise by another Vector4Lc and store the result in dest.
      long dot​(Vector4ic v)
      Compute the dot product (inner product) of this vector and v.
      long dot​(Vector4Lc v)
      Compute the dot product (inner product) of this vector and v.
      boolean equals​(long x, long y, long z, long w)
      Compare the vector components of this vector with the given (x, y, z, w) and return whether all of them are equal.
      long get​(int component)
      Get the value of the specified component of this vector.
      java.nio.ByteBuffer get​(int index, java.nio.ByteBuffer buffer)
      Store this vector into the supplied ByteBuffer starting at the specified absolute buffer position/index.
      java.nio.LongBuffer get​(int index, java.nio.LongBuffer buffer)
      Store this vector into the supplied LongBuffer starting at the specified absolute buffer position/index.
      java.nio.ByteBuffer get​(java.nio.ByteBuffer buffer)
      Store this vector into the supplied ByteBuffer at the current buffer position.
      java.nio.LongBuffer get​(java.nio.LongBuffer buffer)
      Store this vector into the supplied LongBuffer at the current buffer position.
      Vector4Lc getToAddress​(long address)
      Store this vector at the given off-heap memory address.
      long gridDistance​(long x, long y, long z, long w)
      Return the grid distance in between (aka 1-Norm, Minkowski or Manhattan distance) (x, y).
      long gridDistance​(Vector4ic v)
      Return the grid distance in between (aka 1-Norm, Minkowski or Manhattan distance) (x, y).
      long gridDistance​(Vector4Lc v)
      Return the grid distance in between (aka 1-Norm, Minkowski or Manhattan distance) (x, y).
      double length()
      Return the length of this vector.
      long lengthSquared()
      Return the length squared of this vector.
      Vector4L max​(Vector4Lc v, Vector4L dest)
      Set the components of dest to be the component-wise maximum of this and the other vector.
      int maxComponent()
      Determine the component with the biggest absolute value.
      Vector4L min​(Vector4Lc v, Vector4L dest)
      Set the components of dest to be the component-wise minimum of this and the other vector.
      int minComponent()
      Determine the component with the smallest (towards zero) absolute value.
      Vector4L mul​(long scalar, Vector4L dest)
      Multiply all components of this vector by the given scalar value and store the result in dest.
      Vector4L mul​(Vector4ic v, Vector4L dest)
      Multiply this Vector4L component-wise by another Vector4ic and store the result in dest.
      Vector4L mul​(Vector4Lc v, Vector4L dest)
      Multiply this Vector4L component-wise by another Vector4Lc and store the result in dest.
      Vector4L negate​(Vector4L dest)
      Negate this vector and store the result in dest.
      Vector4L sub​(long x, long y, long z, long w, Vector4L dest)
      Subtract (x, y, z, w) from this and store the result in dest.
      Vector4L sub​(Vector4ic v, Vector4L dest)
      Subtract the supplied vector from this one and store the result in dest.
      Vector4L sub​(Vector4Lc v, Vector4L dest)
      Subtract the supplied vector from this one and store the result in dest.
      long w()  
      long x()  
      long y()  
      long z()  
    • Method Detail

      • x

        long x()
        Returns:
        the value of the x component
      • y

        long y()
        Returns:
        the value of the y component
      • z

        long z()
        Returns:
        the value of the z component
      • w

        long w()
        Returns:
        the value of the w component
      • get

        java.nio.LongBuffer get​(java.nio.LongBuffer buffer)
        Store this vector into the supplied LongBuffer at the current buffer position.

        This method will not increment the position of the given LongBuffer.

        In order to specify the offset into the LongBuffer at which the vector is stored, use get(int, LongBuffer), taking the absolute position as parameter.

        Parameters:
        buffer - will receive the values of this vector in x, y, z, w order
        Returns:
        the passed in buffer
        See Also:
        get(int, LongBuffer)
      • get

        java.nio.LongBuffer get​(int index,
                                java.nio.LongBuffer buffer)
        Store this vector into the supplied LongBuffer starting at the specified absolute buffer position/index.

        This method will not increment the position of the given LongBuffer.

        Parameters:
        index - the absolute position into the LongBuffer
        buffer - will receive the values of this vector in x, y, z, w order
        Returns:
        the passed in buffer
      • get

        java.nio.ByteBuffer get​(java.nio.ByteBuffer buffer)
        Store this vector into the supplied ByteBuffer at the current buffer position.

        This method will not increment the position of the given ByteBuffer.

        In order to specify the offset into the ByteBuffer at which the vector is stored, use get(int, ByteBuffer), taking the absolute position as parameter.

        Parameters:
        buffer - will receive the values of this vector in x, y, z, w order
        Returns:
        the passed in buffer
        See Also:
        get(int, ByteBuffer)
      • get

        java.nio.ByteBuffer get​(int index,
                                java.nio.ByteBuffer buffer)
        Store this vector into the supplied ByteBuffer starting at the specified absolute buffer position/index.

        This method will not increment the position of the given ByteBuffer.

        Parameters:
        index - the absolute position into the ByteBuffer
        buffer - will receive the values of this vector in x, y, z, w order
        Returns:
        the passed in buffer
      • getToAddress

        Vector4Lc getToAddress​(long address)
        Store this vector at the given off-heap memory address.

        This method will throw an UnsupportedOperationException when JOML is used with `-Djoml.nounsafe`.

        This method is unsafe as it can result in a crash of the JVM process when the specified address range does not belong to this process.

        Parameters:
        address - the off-heap address where to store this vector
        Returns:
        this
      • sub

        Vector4L sub​(Vector4Lc v,
                     Vector4L dest)
        Subtract the supplied vector from this one and store the result in dest.
        Parameters:
        v - the vector to subtract from this
        dest - will hold the result
        Returns:
        dest
      • sub

        Vector4L sub​(Vector4ic v,
                     Vector4L dest)
        Subtract the supplied vector from this one and store the result in dest.
        Parameters:
        v - the vector to subtract from this
        dest - will hold the result
        Returns:
        dest
      • sub

        Vector4L sub​(long x,
                     long y,
                     long z,
                     long w,
                     Vector4L dest)
        Subtract (x, y, z, w) from this and store the result in dest.
        Parameters:
        x - the x component to subtract
        y - the y component to subtract
        z - the z component to subtract
        w - the w component to subtract
        dest - will hold the result
        Returns:
        dest
      • add

        Vector4L add​(Vector4Lc v,
                     Vector4L dest)
        Add the supplied vector to this one and store the result in dest.
        Parameters:
        v - the vector to add
        dest - will hold the result
        Returns:
        dest
      • add

        Vector4L add​(Vector4ic v,
                     Vector4L dest)
        Add the supplied vector to this one and store the result in dest.
        Parameters:
        v - the vector to add
        dest - will hold the result
        Returns:
        dest
      • add

        Vector4L add​(long x,
                     long y,
                     long z,
                     long w,
                     Vector4L dest)
        Increment the components of this vector by the given values and store the result in dest.
        Parameters:
        x - the x component to add
        y - the y component to add
        z - the z component to add
        w - the w component to add
        dest - will hold the result
        Returns:
        dest
      • mul

        Vector4L mul​(Vector4Lc v,
                     Vector4L dest)
        Multiply this Vector4L component-wise by another Vector4Lc and store the result in dest.
        Parameters:
        v - the other vector
        dest - will hold the result
        Returns:
        dest
      • mul

        Vector4L mul​(Vector4ic v,
                     Vector4L dest)
        Multiply this Vector4L component-wise by another Vector4ic and store the result in dest.
        Parameters:
        v - the other vector
        dest - will hold the result
        Returns:
        dest
      • div

        Vector4L div​(Vector4Lc v,
                     Vector4L dest)
        Divide this Vector4L component-wise by another Vector4Lc and store the result in dest.
        Parameters:
        v - the vector to divide by
        dest - will hold the result
        Returns:
        dest
      • div

        Vector4L div​(Vector4ic v,
                     Vector4L dest)
        Divide this Vector4L component-wise by another Vector4ic and store the result in dest.
        Parameters:
        v - the vector to divide by
        dest - will hold the result
        Returns:
        dest
      • mul

        Vector4L mul​(long scalar,
                     Vector4L dest)
        Multiply all components of this vector by the given scalar value and store the result in dest.
        Parameters:
        scalar - the scalar to multiply by
        dest - will hold the result
        Returns:
        dest
      • div

        Vector4L div​(float scalar,
                     Vector4L dest)
        Divide all components of this vector by the given scalar value and store the result in dest.
        Parameters:
        scalar - the scalar to divide by
        dest - will hold the result
        Returns:
        dest
      • div

        Vector4L div​(long scalar,
                     Vector4L dest)
        Divide all components of this vector by the given scalar value and store the result in dest.
        Parameters:
        scalar - the scalar to divide by
        dest - will hold the result
        Returns:
        dest
      • lengthSquared

        long lengthSquared()
        Return the length squared of this vector.
        Returns:
        the length squared
      • length

        double length()
        Return the length of this vector.
        Returns:
        the length
      • distance

        double distance​(Vector4Lc v)
        Return the distance between this Vector and v.
        Parameters:
        v - the other vector
        Returns:
        the distance
      • distance

        double distance​(Vector4ic v)
        Return the distance between this Vector and v.
        Parameters:
        v - the other vector
        Returns:
        the distance
      • distance

        double distance​(long x,
                        long y,
                        long z,
                        long w)
        Return the distance between this vector and (x, y, z, w).
        Parameters:
        x - the x component of the other vector
        y - the y component of the other vector
        z - the z component of the other vector
        w - the w component of the other vector
        Returns:
        the euclidean distance
      • gridDistance

        long gridDistance​(Vector4Lc v)
        Return the grid distance in between (aka 1-Norm, Minkowski or Manhattan distance) (x, y).
        Parameters:
        v - the other vector
        Returns:
        the grid distance
      • gridDistance

        long gridDistance​(Vector4ic v)
        Return the grid distance in between (aka 1-Norm, Minkowski or Manhattan distance) (x, y).
        Parameters:
        v - the other vector
        Returns:
        the grid distance
      • gridDistance

        long gridDistance​(long x,
                          long y,
                          long z,
                          long w)
        Return the grid distance in between (aka 1-Norm, Minkowski or Manhattan distance) (x, y).
        Parameters:
        x - the x component of the other vector
        y - the y component of the other vector
        z - the z component of the other vector
        w - the w component of the other vector
        Returns:
        the grid distance
      • distanceSquared

        long distanceSquared​(Vector4Lc v)
        Return the square of the distance between this vector and v.
        Parameters:
        v - the other vector
        Returns:
        the squared of the distance
      • distanceSquared

        long distanceSquared​(Vector4ic v)
        Return the square of the distance between this vector and v.
        Parameters:
        v - the other vector
        Returns:
        the squared of the distance
      • distanceSquared

        long distanceSquared​(long x,
                             long y,
                             long z,
                             long w)
        Return the square of the distance between this vector and (x, y, z, w).
        Parameters:
        x - the x component of the other vector
        y - the y component of the other vector
        z - the z component of the other vector
        w - the w component of the other vector
        Returns:
        the square of the distance
      • dot

        long dot​(Vector4Lc v)
        Compute the dot product (inner product) of this vector and v.
        Parameters:
        v - the other vector
        Returns:
        the dot product
      • dot

        long dot​(Vector4ic v)
        Compute the dot product (inner product) of this vector and v.
        Parameters:
        v - the other vector
        Returns:
        the dot product
      • negate

        Vector4L negate​(Vector4L dest)
        Negate this vector and store the result in dest.
        Parameters:
        dest - will hold the result
        Returns:
        dest
      • min

        Vector4L min​(Vector4Lc v,
                     Vector4L dest)
        Set the components of dest to be the component-wise minimum of this and the other vector.
        Parameters:
        v - the other vector
        dest - will hold the result
        Returns:
        dest
      • max

        Vector4L max​(Vector4Lc v,
                     Vector4L dest)
        Set the components of dest to be the component-wise maximum of this and the other vector.
        Parameters:
        v - the other vector
        dest - will hold the result
        Returns:
        dest
      • get

        long get​(int component)
          throws java.lang.IllegalArgumentException
        Get the value of the specified component of this vector.
        Parameters:
        component - the component, within [0..3]
        Returns:
        the value
        Throws:
        java.lang.IllegalArgumentException - if component is not within [0..3]
      • maxComponent

        int maxComponent()
        Determine the component with the biggest absolute value.
        Returns:
        the component index, within [0..3]
      • minComponent

        int minComponent()
        Determine the component with the smallest (towards zero) absolute value.
        Returns:
        the component index, within [0..3]
      • absolute

        Vector4L absolute​(Vector4L dest)
        Compute the absolute of each of this vector's components and store the result into dest.
        Parameters:
        dest - will hold the result
        Returns:
        dest
      • equals

        boolean equals​(long x,
                       long y,
                       long z,
                       long w)
        Compare the vector components of this vector with the given (x, y, z, w) and return whether all of them are equal.
        Parameters:
        x - the x component to compare to
        y - the y component to compare to
        z - the z component to compare to
        w - the w component to compare to
        Returns:
        true if all the vector components are equal