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 TypeMethodDescriptionvoid
Component-wise vector addition operator.Returns right-handed cross product of vector and another vector.void
divide
(double d) Component-wise scalar division operator.double
Returns dot (inner) product of vector and another vector.boolean
Equality comparison within given tolerance - the square of the length of the maximum distance between the two vectors.boolean
Returns principal axis that is closest (based on maximum dot product) to this vector.double[]
getValue()
double
getValueAt
(int index) double
getX()
double
getY()
double
getZ()
double
length()
Returns geometric length of vector.double
Returns square length of vector.Component-wise binary vector subtraction operator.void
multiply
(double d) Component-wise scalar multiplication operator.void
Component-wise vector multiplication operator.void
negate()
Negates each component of vector in place.double
Changes 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) void
Sets value of vector as the weighted average of 3 other vectors.Sets value of vector from a single precision vector.void
setValueAt
(int index, double value) void
setX
(double value) void
setY
(double value) void
setZ
(double value) void
Component-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() -
SbVec3d
-
SbVec3d
public SbVec3d(double[] components) -
SbVec3d
public SbVec3d(double c0, double c1, double c2) -
SbVec3d
Constructor given 3 planes.
-
-
Method Details
-
setX
public void setX(double value) -
setValue
-
setY
public void setY(double value) -
setZ
public void setZ(double value) -
setValue
-
getValue
public double[] getValue() -
setValue
-
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
-
plus
Component-wise binary vector addition operator. -
cross
Returns right-handed cross product of vector and another vector. -
getClosestAxis
Returns principal axis that is closest (based on maximum dot product) to this vector. -
equals
Equality comparison within given tolerance - the square of the length of the maximum distance between the two vectors. -
equals
-
toArray
-
minus
Component-wise binary vector subtraction operator. -
over
Component-wise binary scalar division operator. -
negate
public void negate()Negates each component of vector in place. -
setValue
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
Sets value of vector from a single precision vector. -
times
Component-wise vector multiplication operator. -
times
Component-wise binary scalar multiplication operator. -
multiply
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
Component-wise vector addition operator. -
substract
Component-wise vector subtraction operator. -
dot
Returns dot (inner) product of vector and another vector.
-