Class SbVec3d

java.lang.Object
com.openinventor.inventor.SbBasic
com.openinventor.inventor.SbVec3d

public class SbVec3d extends SbBasic
3D vector class (double precision). 3D vector class used to store 3D vectors and points. Although Open Inventor fields still store only single precision values, for certain applications it is useful and convenient to be able to store and manipulate double precision values, for example, double precision coordinate data or values that will be used for further computation.

See Also:
  • Field Details

    • array

      public final double[] array
  • Constructor Details

    • SbVec3d

      public SbVec3d(double[] components)
    • SbVec3d

      public SbVec3d(SbVec3d copyFrom)
    • SbVec3d

      public SbVec3d(double c0, double c1, double c2)
    • SbVec3d

      public SbVec3d()
    • SbVec3d

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

    • setValue

      public void setValue(SbVec3d copyFrom)
    • getValue

      public double[] getValue()
    • setValue

      public SbVec3d setValue(double[] components)
    • setValue

      public SbVec3d setValue(double[] components, int startIndex)
    • setX

      public void setX(double value)
    • setY

      public void setY(double value)
    • getValueAt

      public double getValueAt(int index)
    • setValue

      public SbVec3d setValue(double c0, double c1, double c2)
    • setValueAt

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

      public double getY()
    • setZ

      public void setZ(double value)
    • getZ

      public double getZ()
    • getX

      public double getX()
    • normalize

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

      public boolean equals(SbVec3d v, double 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 SbVec3d getClosestAxis()
      Returns principal axis that is closest (based on maximum dot product) to this vector.
    • toArray

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

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

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

      public double dot(SbVec3d v)
      Returns dot (inner) product of vector and another vector.
    • setValue

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

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

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

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

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

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

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

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

      public SbVec3d over(double d)
      Component-wise binary scalar division operator.
    • setValue

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

      public SbVec3d times(double d)
      Component-wise binary scalar multiplication operator.
    • cross

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

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