Package com.openinventor.inventor
Class SbVec4d
java.lang.Object
com.openinventor.inventor.SbBasic
com.openinventor.inventor.SbVec4d
4D vector class (double precision).
4D vector class used to store homogeneous coordinates. 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.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.booleangetReal()Returns the real portion of the vector by dividing by the fourth value.double[]getValue()doublegetValueAt(int index) doublegetW()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.voidnegate()Negates each component of vector in place.doubleChanges vector to be unit length.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, double c3) voidSets value of vector from a single precision vector.voidsetValueAt(int index, double value) voidsetW(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.static SbVec4d[]toArray(long nativeArray, long length)
-
Field Details
-
array
public final double[] array
-
-
Constructor Details
-
SbVec4d
public SbVec4d(double[] components) -
SbVec4d
public SbVec4d() -
SbVec4d
public SbVec4d(double c0, double c1, double c2, double c3) -
SbVec4d
-
-
Method Details
-
setZ
public void setZ(double value) -
setW
public void setW(double value) -
setY
public void setY(double value) -
setValue
-
setX
public void setX(double value) -
setValue
-
setValueAt
public void setValueAt(int index, double value) -
getValueAt
public double getValueAt(int index) -
setValue
-
getW
public double getW() -
getZ
public double getZ() -
getY
public double getY() -
getValue
public double[] getValue() -
getX
public double getX() -
setValue
-
plus
Component-wise binary vector addition operator. -
toArray
-
equals
Equality comparison within given tolerance - the square of the length of the maximum distance between the two vectors. -
equals
-
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. -
lengthSquared
public double lengthSquared()Returns square length of vector. Faster thanlength(). -
length
public double length()Returns geometric length of vector. -
getReal
Returns the real portion of the vector by dividing by the fourth value. -
dot
Returns dot (inner) product of vector and another vector. -
normalize
public double normalize()Changes vector to be unit length. -
times
Component-wise binary scalar multiplication operator. -
substract
Component-wise vector subtraction operator. -
add
Component-wise vector addition operator. -
multiply
public void multiply(double d) Component-wise scalar multiplication operator. -
setValue
Sets value of vector from a single precision vector. -
divide
public void divide(double d) Component-wise scalar division operator.
-