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 void
add(SbVec3d v)
Component-wise vector addition operator.SbVec3d
cross(SbVec3d v)
Returns right-handed cross product of vector and another vector.void
divide(double d)
Component-wise scalar division operator.double
dot(SbVec3d v)
Returns dot (inner) product of vector and another vector.boolean
equals(SbVec3d v, double tolerance)
Equality comparison within given tolerance - the square of the length of the maximum distance between the two vectors.boolean
equals(java.lang.Object obj)
SbVec3d
getClosestAxis()
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
lengthSquared()
Returns square length of vector.SbVec3d
minus(SbVec3d v2)
Component-wise binary vector subtraction operator.void
multiply(double d)
Component-wise scalar multiplication operator.void
multiply(SbVec3d v)
Component-wise vector multiplication operator.void
negate()
Negates each component of vector in place.double
normalize()
Changes vector to be unit length, returning the length before normalization.SbVec3d
over(double d)
Component-wise binary scalar division operator.SbVec3d
plus(SbVec3d v2)
Component-wise binary vector addition operator.SbVec3d
setValue(double[] components)
SbVec3d
setValue(double[] components, int startIndex)
SbVec3d
setValue(double c0, double c1, double c2)
void
setValue(SbVec3d copyFrom)
SbVec3d
setValue(SbVec3d barycentic, SbVec3d v0, SbVec3d v1, SbVec3d v2)
Sets value of vector as the weighted average of 3 other vectors.SbVec3d
setValue(SbVec3f vec3f)
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
substract(SbVec3d v)
Component-wise vector subtraction operator.SbVec3d
times(double d)
Component-wise binary scalar multiplication operator.SbVec3d
times(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:
equals
in 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.
-
-