Package com.openinventor.inventor
Class SbVec4d
- java.lang.Object
 - 
- com.openinventor.inventor.SbBasic
 - 
- com.openinventor.inventor.SbVec4d
 
 
 
- 
public class SbVec4d extends SbBasic
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. 
- 
- 
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(SbVec4d u)Component-wise vector addition operator.voiddivide(double d)Component-wise scalar division operator.doubledot(SbVec4d v)Returns dot (inner) product of vector and another vector.booleanequals(SbVec4d 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)SbVec3dgetReal()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.doublelengthSquared()Returns square length of vector.SbVec4dminus(SbVec4d v2)Component-wise binary vector subtraction operator.voidmultiply(double d)Component-wise scalar multiplication operator.voidnegate()Negates each component of vector in place.doublenormalize()Changes vector to be unit length.SbVec4dover(double d)Component-wise binary scalar division operator.SbVec4dplus(SbVec4d v2)Component-wise binary vector addition operator.SbVec4dsetValue(double[] components)SbVec4dsetValue(double[] components, int startIndex)SbVec4dsetValue(double c0, double c1, double c2, double c3)voidsetValue(SbVec4d copyFrom)SbVec4dsetValue(SbVec4f vec4f)Sets 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)voidsubstract(SbVec4d u)Component-wise vector subtraction operator.SbVec4dtimes(double d)Component-wise binary scalar multiplication operator.static SbVec4d[]toArray(long nativeArray, long length) 
 - 
 
- 
- 
Constructor Detail
- 
SbVec4d
public SbVec4d()
 
- 
SbVec4d
public SbVec4d(SbVec4d copyFrom)
 
- 
SbVec4d
public SbVec4d(double[] components)
 
- 
SbVec4d
public SbVec4d(double c0, double c1, double c2, double c3) 
 - 
 
- 
Method Detail
- 
setValue
public SbVec4d setValue(double c0, double c1, double c2, double c3)
 
- 
setY
public void setY(double value)
 
- 
setX
public void setX(double value)
 
- 
getValueAt
public double getValueAt(int index)
 
- 
setValue
public void setValue(SbVec4d copyFrom)
 
- 
setValueAt
public void setValueAt(int index, double value) 
- 
setValue
public SbVec4d setValue(double[] components, int startIndex)
 
- 
getValue
public double[] getValue()
 
- 
setValue
public SbVec4d setValue(double[] components)
 
- 
setZ
public void setZ(double value)
 
- 
getZ
public double getZ()
 
- 
getX
public double getX()
 
- 
getY
public double getY()
 
- 
setW
public void setW(double value)
 
- 
getW
public double getW()
 
- 
toArray
public static SbVec4d[] toArray(long nativeArray, long length)
 
- 
equals
public boolean equals(java.lang.Object obj)
- Overrides:
 equalsin classjava.lang.Object
 
- 
equals
public boolean equals(SbVec4d v, double tolerance)
Equality comparison within given tolerance - the square of the length of the maximum distance between the two vectors. 
- 
over
public SbVec4d over(double d)
Component-wise binary scalar division operator. 
- 
length
public double length()
Returns geometric length of vector. 
- 
lengthSquared
public double lengthSquared()
Returns square length of vector. Faster thanlength(). 
- 
getReal
public SbVec3d getReal()
Returns the real portion of the vector by dividing by the fourth value. 
- 
dot
public double dot(SbVec4d v)
Returns dot (inner) product of vector and another vector. 
- 
negate
public void negate()
Negates each component of vector in place. 
- 
add
public void add(SbVec4d u)
Component-wise vector addition operator. 
- 
divide
public void divide(double d)
Component-wise scalar division operator. 
- 
times
public SbVec4d times(double d)
Component-wise binary scalar multiplication operator. 
- 
substract
public void substract(SbVec4d u)
Component-wise vector subtraction operator. 
- 
multiply
public void multiply(double d)
Component-wise scalar multiplication operator. 
- 
normalize
public double normalize()
Changes vector to be unit length. 
 - 
 
 -