Class SbVec3f

java.lang.Object
com.openinventor.inventor.SbBasic
com.openinventor.inventor.SbVec3f
Direct Known Subclasses:
SbColor

public class SbVec3f extends SbBasic
3D vector class. 3D vector class used to store 3D vectors and points. This class is used throughout Open Inventor for arguments and return values.

See Also:
  • Field Details

    • array

      public final float[] array
    • LENGTH

      public static final int LENGTH
      See Also:
  • Constructor Details

    • SbVec3f

      public SbVec3f(float[] components)
    • SbVec3f

      public SbVec3f(SbVec3f copyFrom)
    • SbVec3f

      public SbVec3f(float c0, float c1, float c2)
    • SbVec3f

      public SbVec3f()
    • SbVec3f

      public SbVec3f(SbPlane p0, SbPlane p1, SbPlane p2)
      Constructor given 3 planes.
  • Method Details

    • setValue

      public void setValue(SbVec3f copyFrom)
    • getValue

      public float[] getValue()
    • setValue

      public SbVec3f setValue(float[] components)
    • setValue

      public SbVec3f setValue(float[] components, int startIndex)
    • setX

      public void setX(float value)
    • setY

      public void setY(float value)
    • getValueAt

      public float getValueAt(int index)
    • setValue

      public SbVec3f setValue(float c0, float c1, float c2)
    • setValueAt

      public void setValueAt(int index, float value)
    • getY

      public float getY()
    • setZ

      public void setZ(float value)
    • getZ

      public float getZ()
    • getX

      public float getX()
    • normalize

      public float normalize()
      Changes vector to be unit length, returning the length before normalization.
    • equals

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

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getClosestAxis

      public SbVec3f getClosestAxis()
      Returns principal axis that is closest (based on maximum dot product) to this vector.
    • toArray

      public static SbVec3f[] toArray(long nativeArray, long length)
    • length

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

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

      public float dot(SbVec3f v)
      Returns dot (inner) product of vector and another vector.
    • setValue

      public SbVec3f setValue(SbVec3d vec3d)
      Sets value of vector from a double precision vector.
    • multiply

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

      public void substract(SbVec3f v)
      Component-wise vector subtraction operator.
    • add

      public void add(SbVec3f v)
      Component-wise vector addition operator.
    • multiply

      public void multiply(SbVec3f v)
      Component-wise vector multiplication operator.
    • minus

      public SbVec3f minus(SbVec3f v2)
      Component-wise binary vector subtraction operator.
    • divide

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

      public SbVec3f plus(SbVec3f v2)
      Component-wise binary vector addition operator.
    • over

      public SbVec3f over(float d)
      Component-wise binary scalar division operator.
    • setValue

      public SbVec3f setValue(SbVec3f barycentic, SbVec3f v0, SbVec3f v1, SbVec3f v2)
      Sets value of vector as the weighted average of 3 other vectors.
    • times

      public SbVec3f times(float d)
      Component-wise binary scalar multiplication operator.
    • cross

      public SbVec3f cross(SbVec3f v)
      Returns right-handed cross product of vector and another vector.
    • times

      public SbVec3f times(SbVec3f v)
      Component-wise vector multiplication operator.