Package com.openinventor.inventor
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.
-
-
Field Summary
Fields Modifier and Type Field Description double[]array
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(SbVec3d v)Component-wise vector addition operator.SbVec3dcross(SbVec3d v)Returns right-handed cross product of vector and another vector.voiddivide(double d)Component-wise scalar division operator.doubledot(SbVec3d v)Returns dot (inner) product of vector and another vector.booleanequals(SbVec3d v, double tolerance)Equality comparison within given tolerance - the square of the length of the maximum distance between the two vectors.booleanequals(java.lang.Object obj)SbVec3dgetClosestAxis()Returns principal axis that is closest (based on maximum dot product) to this vector.double[]getValue()doublegetValueAt(int index)doublegetX()doublegetY()doublegetZ()doublelength()Returns geometric length of vector.doublelengthSquared()Returns square length of vector.SbVec3dminus(SbVec3d v2)Component-wise binary vector subtraction operator.voidmultiply(double d)Component-wise scalar multiplication operator.voidmultiply(SbVec3d v)Component-wise vector multiplication operator.voidnegate()Negates each component of vector in place.doublenormalize()Changes vector to be unit length, returning the length before normalization.SbVec3dover(double d)Component-wise binary scalar division operator.SbVec3dplus(SbVec3d v2)Component-wise binary vector addition operator.SbVec3dsetValue(double[] components)SbVec3dsetValue(double[] components, int startIndex)SbVec3dsetValue(double c0, double c1, double c2)voidsetValue(SbVec3d copyFrom)SbVec3dsetValue(SbVec3d barycentic, SbVec3d v0, SbVec3d v1, SbVec3d v2)Sets value of vector as the weighted average of 3 other vectors.SbVec3dsetValue(SbVec3f vec3f)Sets value of vector from a single precision vector.voidsetValueAt(int index, double value)voidsetX(double value)voidsetY(double value)voidsetZ(double value)voidsubstract(SbVec3d v)Component-wise vector subtraction operator.SbVec3dtimes(double d)Component-wise binary scalar multiplication operator.SbVec3dtimes(SbVec3d v)Component-wise vector multiplication operator.static SbVec3d[]toArray(long nativeArray, long length)
-
-
-
Method Detail
-
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)
-
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(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toArray
public static SbVec3d[] toArray(long nativeArray, long length)
-
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 thanlength().
-
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(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.
-
-