Class SbVec2f

    • Field Summary

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

      Constructors 
      Constructor Description
      SbVec2f()  
      SbVec2f​(float val)
      Constructor that sets all components to the same value.
      SbVec2f​(float[] components)  
      SbVec2f​(float c0, float c1)  
      SbVec2f​(SbVec2f copyFrom)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(SbVec2f u)
      Component-wise vector addition operator.
      void divide​(float d)
      Component-wise scalar division operator.
      float dot​(SbVec2f v)
      Returns dot (inner) product of vector and another vector.
      boolean equals​(SbVec2f v, float 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)  
      float[] getValue()  
      float getValueAt​(int index)  
      float getX()  
      float getY()  
      float length()
      Returns geometric length of vector.
      float lengthSquared()
      Returns square length of vector.
      SbVec2f minus​(SbVec2f v2)
      Component-wise binary vector subtraction operator.
      void multiply​(float d)
      Component-wise scalar multiplication operator.
      void multiply​(SbVec2f v)
      Component-wise vector multiplication operator.
      void negate()
      Negates each component of vector in place.
      float normalize()
      Changes vector to be unit length.
      SbVec2f over​(float d)
      Component-wise binary scalar division operator.
      SbVec2f plus​(SbVec2f v2)
      Component-wise binary vector addition operator.
      SbVec2f setValue​(float[] components)  
      SbVec2f setValue​(float[] components, int startIndex)  
      SbVec2f setValue​(float c0, float c1)  
      SbVec2f setValue​(SbVec2d vec2d)
      Sets value of vector from a double precision vector.
      void setValue​(SbVec2f copyFrom)  
      void setValueAt​(int index, float value)  
      void setX​(float value)  
      void setY​(float value)  
      void substract​(SbVec2f u)
      Component-wise vector subtraction operator.
      SbVec2f times​(float d)
      Component-wise binary scalar multiplication operator.
      SbVec2f times​(SbVec2f v)
      Component-wise vector multiplication operator.
      static SbVec2f[] 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 float[] array
    • Constructor Detail

      • SbVec2f

        public SbVec2f()
      • SbVec2f

        public SbVec2f​(float c0,
                       float c1)
      • SbVec2f

        public SbVec2f​(float[] components)
      • SbVec2f

        public SbVec2f​(SbVec2f copyFrom)
      • SbVec2f

        public SbVec2f​(float val)
        Constructor that sets all components to the same value.
    • Method Detail

      • setX

        public void setX​(float value)
      • setValue

        public void setValue​(SbVec2f copyFrom)
      • setValue

        public SbVec2f setValue​(float c0,
                                float c1)
      • setValueAt

        public void setValueAt​(int index,
                               float value)
      • getValue

        public float[] getValue()
      • setValue

        public SbVec2f setValue​(float[] components,
                                int startIndex)
      • getValueAt

        public float getValueAt​(int index)
      • setValue

        public SbVec2f setValue​(float[] components)
      • getY

        public float getY()
      • setY

        public void setY​(float value)
      • getX

        public float getX()
      • over

        public SbVec2f over​(float d)
        Component-wise binary scalar division operator.
      • toArray

        public static SbVec2f[] toArray​(long nativeArray,
                                        long length)
      • minus

        public SbVec2f minus​(SbVec2f v2)
        Component-wise binary vector subtraction operator.
      • equals

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

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

        public SbVec2f plus​(SbVec2f v2)
        Component-wise binary vector addition operator.
      • lengthSquared

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

        public float length()
        Returns geometric length of vector.
      • normalize

        public float normalize()
        Changes vector to be unit length.
      • negate

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

        public float dot​(SbVec2f v)
        Returns dot (inner) product of vector and another vector.
      • divide

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

        public void multiply​(SbVec2f v)
        Component-wise vector multiplication operator.
      • add

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

        public SbVec2f times​(float d)
        Component-wise binary scalar multiplication operator.
      • substract

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

        public SbVec2f setValue​(SbVec2d vec2d)
        Sets value of vector from a double precision vector. If the values stored in the double precision argument(s) are too large to be stored in single precision variables, some loss of data will occur during the data transfer. The loss of data is defined by the standard C type conversion from double to float. It is the application's responsibility to handle this potential loss of data appropriately.

        NOTE: Open Inventor fields still store only single precision values, not double precision values.

      • times

        public SbVec2f times​(SbVec2f v)
        Component-wise vector multiplication operator.
      • multiply

        public void multiply​(float d)
        Component-wise scalar multiplication operator.