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()
    • SbVec3d

      public SbVec3d(SbVec3d copyFrom)
    • SbVec3d

      public SbVec3d(double[] components)
    • SbVec3d

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

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

    • setX

      public void setX(double value)
    • setValue

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

      public void setY(double value)
    • setZ

      public void setZ(double value)
    • setValue

      public void setValue(SbVec3d copyFrom)
    • getValue

      public double[] getValue()
    • setValue

      public SbVec3d setValue(double[] components)
    • setValueAt

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

      public double getValueAt(int index)
    • getY

      public double getY()
    • getZ

      public double getZ()
    • getX

      public double getX()
    • setValue

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public void multiply(SbVec3d v)
      Component-wise vector multiplication operator.
    • 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(SbVec3d v)
      Component-wise vector addition operator.
    • substract

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

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