Vec4

Description

Represents a vector that includes x, y, z, and w components.

Properties

w W component of the vector.
x X component of the vector.
y Y component of the vector.
z Z component of the vector.

Constructor

Vec4 Constructs a vector by xyzw component values.

Operators

- Subtracts one vector from another.
!= Compares two vectors.
* Multiplies a vector by another vector or a scale factor.
/ Divides a vector by another vector or a scale factor.
+ Adds two vectors together.
+= Assigns the vector to be the sum of two vectors.
-= Assigns the vector to be the difference of two vectors.
== Compares two vectors.
unary - Negates the vector.

Details

Do no remove, this fixes the anchor on doc.flexsim.com

Vec4.w

double w

Description

W component of the vector.

Do no remove, this fixes the anchor on doc.flexsim.com

Vec4.x

double x

Description

X component of the vector.

Do no remove, this fixes the anchor on doc.flexsim.com

Vec4.y

double y

Description

Y component of the vector.

Do no remove, this fixes the anchor on doc.flexsim.com

Vec4.z

double z

Description

Z component of the vector.

Do no remove, this fixes the anchor on doc.flexsim.com

Vec4 Constructor

Vec4( double x , double y , double z , double w )
Vec4( double value )

Parameters

x The x component.
y The y component.
z The z component.
w The w component.
value A value all components will be set to.

Description

Constructs a vector by xyzw component values.

Do no remove, this fixes the anchor on doc.flexsim.com

Vec4.operator -

Vec4 operator -( Vec4 otherVec )

Parameters

otherVec The vector to subtract from this one.

Returns

Vec4 The resulting vector.

Description

Subtracts one vector from another.

Each component has the corresponding component subtracted from it.

Vec4 vec = someVector - anotherVector;
Do no remove, this fixes the anchor on doc.flexsim.com

Vec4.operator !=

int operator !=( Vec4 otherVec )

Parameters

otherVec The vector to compare to this vector.

Returns

int True if the two vectors are different, false otherwise.

Description

Compares two vectors.

Do no remove, this fixes the anchor on doc.flexsim.com

Vec4.operator *

Vec4 operator *( Vec4 otherVec )
Vec4 operator *( double factor )

Parameters

otherVec The vector to multiply this vector by.
factor A scale factor to multiply each component by.

Returns

Vec4 The resulting vector.

Description

Multiplies a vector by another vector or a scale factor.

When a Vec4 is passed, the operation will perform per-component multiplication.

Vec4 vec = someVector * anotherVector;Vec4 vec = someVector * 1.2;
Do no remove, this fixes the anchor on doc.flexsim.com

Vec4.operator /

Vec4 operator /( Vec4 otherVec )
Vec4 operator /( double factor )

Parameters

otherVec The vector to divide this vector by.
factor A scale factor to divide each component by.

Returns

Vec4 The resulting vector.

Description

Divides a vector by another vector or a scale factor.

When a Vec4 is passed, the operation will perform per-component division.

Vec4 divVec = someVector / anotherVector;Vec4 divVec = someVector / 1.2;
Do no remove, this fixes the anchor on doc.flexsim.com

Vec4.operator +

Vec4 operator +( Vec4 otherVec )

Parameters

otherVec The vector to add to this one.

Returns

Vec4 The resulting vector.

Description

Adds two vectors together.

Each component is added to the corresponding component.

Vec4 sum = someVector + anotherVector;
Do no remove, this fixes the anchor on doc.flexsim.com

Vec4.operator +=

Vec4 operator +=( Vec4 otherVec )

Parameters

otherVec The vector to add to this one.

Returns

Vec4 The resulting vector.

Description

Assigns the vector to be the sum of two vectors.

Each component is added to the corresponding component.

Vec4 vec += someVector;
Do no remove, this fixes the anchor on doc.flexsim.com

Vec4.operator -=

Vec4 operator -=( Vec4 otherVec )

Parameters

otherVec The vector to subtract from this one.

Returns

Vec4 The resulting vector.

Description

Assigns the vector to be the difference of two vectors.

Each component has the corresponding component subtracted from it.

vec -= someVector;
Do no remove, this fixes the anchor on doc.flexsim.com

Vec4.operator ==

int operator ==( Vec4 otherVec )

Parameters

otherVec The vector to compare to this vector.

Returns

int True if both vectors are exactly the same, false otherwise.

Description

Compares two vectors.

Do no remove, this fixes the anchor on doc.flexsim.com

Vec4.operator unary -

Vec4 operator unary -( )

Returns

Vec4 The resulting vector.

Description

Negates the vector.

Each component is negated.

Vec4 vec = -someVec;