Package com.openinventor.inventor
Class SbVec4f
java.lang.Object
com.openinventor.inventor.SbBasic
com.openinventor.inventor.SbVec4f
- Direct Known Subclasses:
SbColorRGBA
4D vector class.
4D vector class used to store homogeneous coordinates. This class is used in Open Inventor for arguments and return values.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Component-wise vector addition operator.void
divide
(float d) Component-wise scalar division operator.float
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
getReal()
Returns the real portion of the vector by dividing by the fourth value.float[]
getValue()
float
getValueAt
(int index) float
getW()
float
getX()
float
getY()
float
getZ()
float
length()
Returns geometric length of vector.float
Returns square length of vector.Component-wise binary vector subtraction operator.void
multiply
(float d) Component-wise scalar multiplication operator.void
negate()
Negates each component of vector in place.float
Changes vector to be unit length.over
(float d) Component-wise binary scalar division operator.Component-wise binary vector addition operator.setValue
(float[] components) setValue
(float[] components, int startIndex) setValue
(float c0, float c1, float c2, float c3) Sets value of vector from a double precision vector.void
void
setValueAt
(int index, float value) void
setW
(float value) void
setX
(float value) void
setY
(float value) void
setZ
(float value) void
Component-wise vector subtraction operator.times
(float d) Component-wise binary scalar multiplication operator.static SbVec4f[]
toArray
(long nativeArray, long length)
-
Field Details
-
array
public final float[] array
-
-
Constructor Details
-
SbVec4f
public SbVec4f() -
SbVec4f
-
SbVec4f
public SbVec4f(float[] components) -
SbVec4f
public SbVec4f(float c0, float c1, float c2, float c3)
-
-
Method Details
-
setValue
-
setY
public void setY(float value) -
setX
public void setX(float value) -
getValueAt
public float getValueAt(int index) -
setValue
-
setValueAt
public void setValueAt(int index, float value) -
setValue
-
getValue
public float[] getValue() -
setValue
-
setZ
public void setZ(float value) -
getZ
public float getZ() -
getX
public float getX() -
getY
public float getY() -
setW
public void setW(float value) -
getW
public float getW() -
toArray
-
equals
-
equals
Equality comparison within given tolerance - the square of the length of the maximum distance between the two vectors. -
plus
Component-wise binary vector addition operator. -
minus
Component-wise binary vector subtraction operator. -
over
Component-wise binary scalar division operator. -
length
public float length()Returns geometric length of vector. -
lengthSquared
public float lengthSquared()Returns square length of vector. Faster thanlength()
. -
getReal
Returns the real portion of the vector by dividing by the fourth value. -
dot
Returns dot (inner) product of vector and another vector. -
negate
public void negate()Negates each component of vector in place. -
add
Component-wise vector addition operator. -
divide
public void divide(float d) Component-wise scalar division operator. -
times
Component-wise binary scalar multiplication operator. -
substract
Component-wise vector subtraction operator. -
multiply
public void multiply(float d) Component-wise scalar multiplication operator. -
normalize
public float normalize()Changes vector to be unit length. -
setValue
Sets value of vector from a double precision vector.
-