Package com.openinventor.inventor
Class SbVec3d
java.lang.Object
com.openinventor.inventor.SbBasic
com.openinventor.inventor.SbVec3d
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidComponent-wise vector addition operator.Returns right-handed cross product of vector and another vector.voiddivide(double d) Component-wise scalar division operator.doubleReturns dot (inner) product of vector and another vector.booleanEquality comparison within given tolerance - the square of the length of the maximum distance between the two vectors.booleanReturns 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.doubleReturns square length of vector.Component-wise binary vector subtraction operator.voidmultiply(double d) Component-wise scalar multiplication operator.voidComponent-wise vector multiplication operator.voidnegate()Negates each component of vector in place.doubleChanges vector to be unit length, returning the length before normalization.over(double d) Component-wise binary scalar division operator.Component-wise binary vector addition operator.setValue(double[] components) setValue(double[] components, int startIndex) setValue(double c0, double c1, double c2) voidSets value of vector as the weighted average of 3 other vectors.Sets value of vector from a single precision vector.voidsetValueAt(int index, double value) voidsetX(double value) voidsetY(double value) voidsetZ(double value) voidComponent-wise vector subtraction operator.times(double d) Component-wise binary scalar multiplication operator.Component-wise vector multiplication operator.static SbVec3d[]toArray(long nativeArray, long length)
-
Field Details
-
array
public final double[] array
-
-
Constructor Details
-
SbVec3d
public SbVec3d(double[] components) -
SbVec3d
-
SbVec3d
public SbVec3d(double c0, double c1, double c2) -
SbVec3d
public SbVec3d() -
SbVec3d
Constructor given 3 planes.
-
-
Method Details
-
setValue
-
getValue
public double[] getValue() -
setValue
-
setValue
-
setX
public void setX(double value) -
setY
public void setY(double value) -
getValueAt
public double getValueAt(int index) -
setValue
-
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
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
-
getClosestAxis
Returns principal axis that is closest (based on maximum dot product) to this vector. -
toArray
-
length
public double length()Returns geometric length of vector. -
lengthSquared
public double lengthSquared()Returns square length of vector. Faster thanlength(). -
dot
Returns dot (inner) product of vector and another vector. -
setValue
Sets value of vector from a single precision vector. -
multiply
public void multiply(double d) Component-wise scalar multiplication operator. -
substract
Component-wise vector subtraction operator. -
add
Component-wise vector addition operator. -
multiply
Component-wise vector multiplication operator. -
minus
Component-wise binary vector subtraction operator. -
divide
public void divide(double d) Component-wise scalar division operator. -
plus
Component-wise binary vector addition operator. -
over
Component-wise binary scalar division operator. -
setValue
Sets value of vector as the weighted average of 3 other vectors. -
times
Component-wise binary scalar multiplication operator. -
cross
Returns right-handed cross product of vector and another vector. -
times
Component-wise vector multiplication operator.
-