Class SbVec2d

    • Field Summary

      Fields 
      Modifier and Type Field Description
      double[] array  
    • Constructor Summary

      Constructors 
      Constructor Description
      SbVec2d()  
      SbVec2d​(double[] components)  
      SbVec2d​(double c0, double c1)  
      SbVec2d​(SbVec2d copyFrom)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(SbVec2d u)
      Component-wise vector addition operator.
      void divide​(double d)
      Component-wise scalar division operator.
      double dot​(SbVec2d v)
      Returns dot (inner) product of vector and another vector.
      boolean equals​(SbVec2d v, double tolerance)
      Equality comparison within given tolerance - the square of the length of the maximum distance between the two vectors.
      boolean equals​(java.lang.Object obj)  
      double[] getValue()  
      double getValueAt​(int index)  
      double getX()  
      double getY()  
      double length()
      Returns geometric length of vector.
      double lengthSquared()
      Returns square length of vector.
      SbVec2d minus​(SbVec2d v2)
      Component-wise binary vector subtraction operator.
      void multiply​(double d)
      Component-wise scalar multiplication operator.
      void negate()
      Negates each component of vector in place.
      double normalize()
      Changes vector to be unit length.
      SbVec2d over​(double d)
      Component-wise binary scalar division operator.
      SbVec2d plus​(SbVec2d v2)
      Component-wise binary vector addition operator.
      SbVec2d setValue​(double[] components)  
      SbVec2d setValue​(double[] components, int startIndex)  
      SbVec2d setValue​(double c0, double c1)  
      void setValue​(SbVec2d copyFrom)  
      SbVec2d setValue​(SbVec2f vec2f)
      Sets value of vector from a single precision vector.
      void setValueAt​(int index, double value)  
      void setX​(double value)  
      void setY​(double value)  
      void substract​(SbVec2d u)
      Component-wise vector subtraction operator.
      SbVec2d times​(double d)
      Component-wise binary scalar multiplication operator.
      static SbVec2d[] toArray​(long nativeArray, long length)  
      • Methods inherited from class java.lang.Object

        getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • array

        public final double[] array
    • Constructor Detail

      • SbVec2d

        public SbVec2d​(double c0,
                       double c1)
      • SbVec2d

        public SbVec2d​(double[] components)
      • SbVec2d

        public SbVec2d​(SbVec2d copyFrom)
      • SbVec2d

        public SbVec2d()
    • Method Detail

      • setValue

        public void setValue​(SbVec2d copyFrom)
      • getValueAt

        public double getValueAt​(int index)
      • getValue

        public double[] getValue()
      • setValue

        public SbVec2d setValue​(double[] components,
                                int startIndex)
      • setValue

        public SbVec2d setValue​(double c0,
                                double c1)
      • setValue

        public SbVec2d setValue​(double[] components)
      • setValueAt

        public void setValueAt​(int index,
                               double value)
      • setX

        public void setX​(double value)
      • setY

        public void setY​(double value)
      • getX

        public double getX()
      • getY

        public double getY()
      • lengthSquared

        public double lengthSquared()
        Returns square length of vector. Faster than length().
      • negate

        public void negate()
        Negates each component of vector in place.
      • equals

        public boolean equals​(SbVec2d v,
                              double tolerance)
        Equality comparison within given tolerance - the square of the length of the maximum distance between the two vectors.
      • toArray

        public static SbVec2d[] toArray​(long nativeArray,
                                        long length)
      • normalize

        public double normalize()
        Changes vector to be unit length.
      • dot

        public double dot​(SbVec2d v)
        Returns dot (inner) product of vector and another vector.
      • length

        public double length()
        Returns geometric length of vector.
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • substract

        public void substract​(SbVec2d u)
        Component-wise vector subtraction operator.
      • setValue

        public SbVec2d setValue​(SbVec2f vec2f)
        Sets value of vector from a single precision vector.
      • divide

        public void divide​(double d)
        Component-wise scalar division operator.
      • multiply

        public void multiply​(double d)
        Component-wise scalar multiplication operator.
      • add

        public void add​(SbVec2d u)
        Component-wise vector addition operator.
      • times

        public SbVec2d times​(double d)
        Component-wise binary scalar multiplication operator.
      • plus

        public SbVec2d plus​(SbVec2d v2)
        Component-wise binary vector addition operator.
      • minus

        public SbVec2d minus​(SbVec2d v2)
        Component-wise binary vector subtraction operator.
      • over

        public SbVec2d over​(double d)
        Component-wise binary scalar division operator.