Kanzi Java API
Vector4 Class Reference

Vector with 4 floating point components: (x, y, z, w). More...

Public Member Functions

 Vector4 (long cPtr, boolean cMemoryOwn)
 
 Vector4 ()
 Default constructor, initializes the vector to (0.0, 0.0, 0.0, 0.0).
 
 Vector4 (float v)
 Constructor, initializes the vector to (v, v, v, v). More...
 
 Vector4 (float x, float y, float z, float w)
 Constructor, initializes the vector to (x, y, z, w). More...
 
Vector4 add (float scalar)
 Adds a scalar to each vector element. More...
 
Vector4 add (Vector4 v)
 Modifies this vector by adding another vector. More...
 
synchronized void delete ()
 
Vector4 divide (float scalar)
 Divides each vector element with a scalar. More...
 
boolean equals (Object obj)
 
float get (long index)
 
float getW ()
 Returns the w element of the vector. More...
 
float getX ()
 Returns the x element of the vector. More...
 
float getY ()
 Returns the y element of the vector. More...
 
float getZ ()
 Returns the z element of the vector. More...
 
boolean hasNan ()
 Returns true if and only if at least one of the vector values is NaN.
 
float length ()
 Calculates the length of the vector. More...
 
Vector4 multiply (float scalar)
 Multiplies each vector element with a scalar. More...
 
Vector4 normalized ()
 Normalizes the vector and returns the resulting vector. More...
 
void set (long index, float value)
 
void setW (float value)
 Sets the w element of the vector. More...
 
void setX (float value)
 Sets the x element of the vector. More...
 
void setY (float value)
 Sets the y element of the vector. More...
 
void setZ (float value)
 Sets the z element of the vector. More...
 
float squaredLength ()
 Calculates the squared length of the vector. More...
 
Vector4 subtract (Vector4 v)
 Modifies this vector by subtracting another vector from this vector. More...
 

Static Public Member Functions

static Vector4 add (float scalar, Vector4 v)
 Adds a scalar and a vector and returns the sum. More...
 
static Vector4 add (Vector4 v, float scalar)
 Adds a vector and a scalar and returns the sum. More...
 
static Vector4 add (Vector4 v1, Vector4 v2)
 Adds two vectors and returns the sum. More...
 
static Vector4 componentAbs (Vector4 v)
 
static Vector4 componentAdd (Vector4 v, float scalar)
 
static boolean componentAllGreaterThan (Vector4 a, Vector4 b)
 
static boolean componentAllGreaterThanOrEqual (Vector4 a, Vector4 b)
 
static boolean componentAllLessThan (Vector4 a, Vector4 b)
 
static boolean componentAllLessThanOrEqual (Vector4 a, Vector4 b)
 
static Vector4 componentCeil (Vector4 v)
 
static Vector4 componentFloor (Vector4 v)
 
static Vector4 componentRound (Vector4 v)
 
static Vector4 componentSqrt (Vector4 v)
 
static Vector4 componentSubtract (Vector4 v, float scalar)
 
static Vector4 componentWiseDivide (Vector4 v1, Vector4 v2)
 
static Vector4 componentWiseMax (Vector4 v1, Vector4 v2)
 
static Vector4 componentWiseMin (Vector4 v1, Vector4 v2)
 
static Vector4 componentWiseMultiply (Vector4 v1, Vector4 v2)
 
static Vector4 componentWiseRemainder (Vector4 v1, Vector4 v2)
 
static Vector4 divide (Vector4 v, float scalar)
 Divides all vector elements with a scalar and returns the resulting vector. More...
 
static float dotProduct (Vector4 v1, Vector4 v2)
 
static long getCPtr (Vector4 obj)
 
static Vector4 highestValue ()
 Returns the vector with each element having the most positive float value. More...
 
static Vector4 linearTosRGB (Vector4 vec)
 
static Vector4 lowestValue ()
 Returns the vector with each element having the most negative float value. More...
 
static Vector4 multiply (float scalar, Vector4 v)
 Multiplies all vector elements with a scalar and returns the resulting vector. More...
 
static Vector4 multiply (Vector4 v, float scalar)
 Multiplies all vector elements with a scalar and returns the resulting vector. More...
 
static Vector4 nan ()
 Returns the vector with each element being NaN. More...
 
static Vector4 negate (Vector4 v)
 Negates all vector elements and returns the resulting vector. More...
 
static Vector4 negativeInfinity ()
 Returns the vector with each element being the negative infinity. More...
 
static Vector4 one ()
 Returns the vector with each element being one. More...
 
static Vector4 positiveInfinity ()
 Returns the vector with each element being the positive infinity. More...
 
static Vector4 sRGBToLinear (Vector4 vec)
 
static Vector4 subtract (Vector4 v1, Vector4 v2)
 Subtracts two vectors and returns the difference. More...
 
static Vector4 zero ()
 Returns the vector with each element being zero. More...
 

Protected Member Functions

void finalize ()
 

Protected Attributes

transient boolean swigCMemOwn
 

Detailed Description

Vector with 4 floating point components: (x, y, z, w).

Constructor & Destructor Documentation

Vector4 ( float  v)

Constructor, initializes the vector to (v, v, v, v).


Parameters
vx, y, z, and w component of the vector.
Vector4 ( float  x,
float  y,
float  z,
float  w 
)

Constructor, initializes the vector to (x, y, z, w).


Parameters
xx component of the vector.
yy component of the vector.
zz component of the vector.
ww component of the vector.

Member Function Documentation

Vector4 add ( float  scalar)

Adds a scalar to each vector element.


Parameters
scalarAddition to each vector element.
Returns
This vector.
Vector4 add ( Vector4  v)

Modifies this vector by adding another vector.


Parameters
vAnother vector.
Returns
This vector.
static Vector4 add ( float  scalar,
Vector4  v 
)
static

Adds a scalar and a vector and returns the sum.

Parameters
scalarLeft hand side scalar.
vRight hand side vector.
Returns
The result vector.
static Vector4 add ( Vector4  v,
float  scalar 
)
static

Adds a vector and a scalar and returns the sum.

Parameters
vLeft hand side vector.
scalarRight hand side scalar.
Returns
The result vector.
static Vector4 add ( Vector4  v1,
Vector4  v2 
)
static

Adds two vectors and returns the sum.

Parameters
v1Left hand side vector.
v2Right hand side vector.
Returns
The result vector.
Vector4 divide ( float  scalar)

Divides each vector element with a scalar.


Parameters
scalarDivider for each vector element.
Returns
This vector.
static Vector4 divide ( Vector4  v,
float  scalar 
)
static

Divides all vector elements with a scalar and returns the resulting vector.

Parameters
vA vector.
scalarA scalar.
Returns
The result vector.
float getW ( )

Returns the w element of the vector.


Returns
The w element.
float getX ( )

Returns the x element of the vector.


Returns
The x element.
float getY ( )

Returns the y element of the vector.


Returns
The y element.
float getZ ( )

Returns the z element of the vector.


Returns
The z element.
static Vector4 highestValue ( )
static

Returns the vector with each element having the most positive float value.


Returns
Vector with the highest possible value.
float length ( )

Calculates the length of the vector.


Returns
sqrt(dot product of the vector).
static Vector4 lowestValue ( )
static

Returns the vector with each element having the most negative float value.


Returns
Vector with the lowest possible value.
Vector4 multiply ( float  scalar)

Multiplies each vector element with a scalar.


Parameters
scalarMultiplier for each vector element.
Returns
This vector.
static Vector4 multiply ( float  scalar,
Vector4  v 
)
static

Multiplies all vector elements with a scalar and returns the resulting vector.

Parameters
scalarA scalar.
vA vector.
Returns
The result vector.
static Vector4 multiply ( Vector4  v,
float  scalar 
)
static

Multiplies all vector elements with a scalar and returns the resulting vector.

Parameters
vA vector.
scalarA scalar.
Returns
The result vector.
static Vector4 nan ( )
static

Returns the vector with each element being NaN.


Returns
Vector with NaN elements.
static Vector4 negate ( Vector4  v)
static

Negates all vector elements and returns the resulting vector.

Parameters
vA vector.
Returns
The result vector.
static Vector4 negativeInfinity ( )
static

Returns the vector with each element being the negative infinity.


Returns
Vector with negative infinity elements.
Vector4 normalized ( )

Normalizes the vector and returns the resulting vector.


Returns
The normalized vector.
static Vector4 one ( )
static

Returns the vector with each element being one.


Returns
Vector with unit element values.
static Vector4 positiveInfinity ( )
static

Returns the vector with each element being the positive infinity.


Returns
Vector with positive infinity elements.
void setW ( float  value)

Sets the w element of the vector.


Parameters
valueThe new value of the w element.
void setX ( float  value)

Sets the x element of the vector.


Parameters
valueThe new value of the x element.
void setY ( float  value)

Sets the y element of the vector.


Parameters
valueThe new value of the y element.
void setZ ( float  value)

Sets the z element of the vector.


Parameters
valueThe new value of the z element.
float squaredLength ( )

Calculates the squared length of the vector.


Returns
Dot product of the vector.
Vector4 subtract ( Vector4  v)

Modifies this vector by subtracting another vector from this vector.


Parameters
vAnother vector.
Returns
This vector.
static Vector4 subtract ( Vector4  v1,
Vector4  v2 
)
static

Subtracts two vectors and returns the difference.

Parameters
v1Left hand side vector.
v2Right hand side vector.
Returns
The result vector.
static Vector4 zero ( )
static

Returns the vector with each element being zero.


Returns
Vector with zeroed elements.