Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

# Unigine.bvec4 Struct

Notice
The functions listed below are the members of the Unigine.MathLib namespace.

## bytex#

The X component of the vector.

## bytey#

The Y component of the vector.

## bytez#

The Z component of the vector.

## bytew#

The W component of the vector.

## byteMinimum#

The Minimum value among all components.

## byteMaximum#

The Maximum value among all components.

## intLength2#

The Squared length of the vector. This method is much faster than length() — the calculation is basically the same only without the slow Sqrt call. If you are using lengths simply to compare distances, then it is faster to compare squared lengths against the squares of distances as the comparison gives the same result.

## intSum#

The Sum of vector components.

## bvec4ZERO#

The Vector, filled with zeros (0).

## bvec4ONE#

The Vector, filled with ones (1).

## byteNUM_ELEMENTS#

The Number of elements in the vector.

Multiplication.

Multiplication.

Multiplication.

## ivec4operator* ( bvec4 v0, int v1 ) #

Multiplication.

### Arguments

• bvec4 v0 - First value.
• int v1 - Second value.

Multiplication.

## bvec4operator* ( bvec4 v0, byte v1 ) #

Multiplication.

### Arguments

• bvec4 v0 - First value.
• byte v1 - Second value.

Division.

Division.

Division.

## ivec4operator/ ( bvec4 v0, int v1 ) #

Division.

### Arguments

• bvec4 v0 - First value.
• int v1 - Second value.

Division.

## bvec4operator/ ( bvec4 v0, byte v1 ) #

Division.

### Arguments

• bvec4 v0 - First value.
• byte v1 - Second value.

Subtraction.

Subtraction.

Subtraction.

## ivec4operator- ( bvec4 v0, int v1 ) #

Subtraction.

### Arguments

• bvec4 v0 - First value.
• int v1 - Second value.

Subtraction.

## bvec4operator- ( bvec4 v0, byte v1 ) #

Subtraction.

### Arguments

• bvec4 v0 - First value.
• byte v1 - Second value.

## ivec4operator+ ( bvec4 v0, int v1 ) #

### Arguments

• bvec4 v0 - First value.
• int v1 - Second value.

## bvec4operator+ ( bvec4 v0, byte v1 ) #

### Arguments

• bvec4 v0 - First value.
• byte v1 - Second value.

## ivec4operator% ( bvec4 v0, ivec2 v1 ) #

Modulo, gives the remainder of a division of two specified values.

## ivec4operator% ( bvec4 v0, ivec3 v1 ) #

Modulo, gives the remainder of a division of two specified values.

## ivec4operator% ( bvec4 v0, ivec4 v1 ) #

Modulo, gives the remainder of a division of two specified values.

## ivec4operator% ( bvec4 v0, int v1 ) #

Modulo, gives the remainder of a division of two specified values.

### Arguments

• bvec4 v0 - First value.
• int v1 - Second value.

## bvec4operator% ( bvec4 v0, bvec4 v1 ) #

Modulo, gives the remainder of a division of two specified values.

## bvec4operator% ( bvec4 v0, byte v1 ) #

Modulo, gives the remainder of a division of two specified values.

### Arguments

• bvec4 v0 - First value.
• byte v1 - Second value.

## bvec4operator>> ( bvec4 v0, int v1 ) #

Bitwise right shift.

### Arguments

• bvec4 v0 - First value.
• int v1 - Second value.

## bvec4operator<< ( bvec4 v0, int v1 ) #

Bitwise left shift.

### Arguments

• bvec4 v0 - First value.
• int v1 - Second value.

Increment.

Decrement.

## booloperator== ( bvec4 v0, bvec4 v1 ) #

Performs equal comparison.

## booloperator!= ( bvec4 v0, bvec4 v1 ) #

Not equal comparison.

## booloperator> ( bvec4 v0, bvec4 v1 ) #

Greater comparison.

## booloperator< ( bvec4 v0, bvec4 v1 ) #

Greater comparison.

## booloperator>= ( bvec4 v0, bvec4 v1 ) #

Greater than or equal to comparison.

## booloperator<= ( bvec4 v0, bvec4 v1 ) #

Less than or equal to comparison.

## booloperatortrue ( bvec4 v ) #

Returns true if the operand is both, not null and not NaN.

## booloperatorfalse ( bvec4 v ) #

Returns true if the operand is both, null and NaN.

## voidSet ( float vx, float vy, float vz, float vw ) #

Sets the value using the specified argument(s).

### Arguments

• float vx - New float value to be set for the first component.
• float vy - New float value to be set for the second component.
• float vz - New float value to be set for the third component.
• float vw - New float value to be set for the fourth component.

## voidSet ( float v ) #

Sets the value using the specified argument(s).

### Arguments

• float v - A float value to be used.

## voidSet ( float[] v ) #

Sets the value using the specified argument(s).

### Arguments

• float[] v - Source vector.

## voidSet ( vec2 v, double vz, float vw ) #

Sets the value using the specified argument(s).

### Arguments

• vec2 v - Source vector.
• double vz - New double value to be set for the third component.
• float vw - New float value to be set for the fourth component.

## voidSet ( vec3 v, double vw ) #

Sets the value using the specified argument(s).

### Arguments

• vec3 v - Source vector.
• double vw - New double value to be set for the fourth component.

## voidSet ( vec2 v ) #

Sets the value using the specified argument(s).

### Arguments

• vec2 v - Source vector.

## voidSet ( vec3 v ) #

Sets the value using the specified argument(s).

### Arguments

• vec3 v - Source vector.

## voidSet ( vec4 v ) #

Sets the value using the specified argument(s).

### Arguments

• vec4 v - Source vector.

## voidSet ( vec4 v, float scale ) #

Sets the value using the specified argument(s).

### Arguments

• vec4 v - Source vector.
• float scale - Scaling vector (scale.x, scale.y, scale.z).

## voidSet ( double vx, double vy, double vz, double vw ) #

Sets the value using the specified argument(s).

### Arguments

• double vx - New double value to be set for the first component.
• double vy - New double value to be set for the second component.
• double vz - New double value to be set for the third component.
• double vw - New double value to be set for the fourth component.

## voidSet ( double v ) #

Sets the value using the specified argument(s).

### Arguments

• double v - A double value to be used.

## voidSet ( double[] v ) #

Sets the value using the specified argument(s).

### Arguments

• double[] v - Source vector.

## voidSet ( dvec2 v, double vz, float vw ) #

Sets the value using the specified argument(s).

### Arguments

• dvec2 v - Source vector.
• double vz - New double value to be set for the third component.
• float vw - New float value to be set for the fourth component.

## voidSet ( dvec3 v, double vw ) #

Sets the value using the specified argument(s).

### Arguments

• dvec3 v - Source vector.
• double vw - New double value to be set for the fourth component.

## voidSet ( dvec2 v ) #

Sets the value using the specified argument(s).

## voidSet ( dvec3 v ) #

Sets the value using the specified argument(s).

## voidSet ( dvec4 v ) #

Sets the value using the specified argument(s).

## voidSet ( int vx, int vy, int vz, int vw ) #

Sets the value using the specified argument(s).

### Arguments

• int vx - New int value to be set for the first component.
• int vy - New int value to be set for the second component.
• int vz - New int value to be set for the third component.
• int vw - New int value to be set for the fourth component.

## voidSet ( int v ) #

Sets the value using the specified argument(s).

### Arguments

• int v - A int value to be used.

## voidSet ( int[] v ) #

Sets the value using the specified argument(s).

### Arguments

• int[] v - Source vector.

## voidSet ( ivec2 v, double vz, float vw ) #

Sets the value using the specified argument(s).

### Arguments

• ivec2 v - Source vector.
• double vz - New double value to be set for the third component.
• float vw - New float value to be set for the fourth component.

## voidSet ( ivec3 v, double vw ) #

Sets the value using the specified argument(s).

### Arguments

• ivec3 v - Source vector.
• double vw - New double value to be set for the fourth component.

## voidSet ( ivec2 v ) #

Sets the value using the specified argument(s).

## voidSet ( ivec3 v ) #

Sets the value using the specified argument(s).

## voidSet ( ivec4 v ) #

Sets the value using the specified argument(s).

## voidSet ( byte vx, byte vy, byte vz, byte vw ) #

Sets the value using the specified argument(s).

### Arguments

• byte vx - New byte value to be set for the first component.
• byte vy - New byte value to be set for the second component.
• byte vz - New byte value to be set for the third component.
• byte vw - New byte value to be set for the fourth component.

## voidSet ( byte v ) #

Sets the value using the specified argument(s).

### Arguments

• byte v - A byte value to be used.

## voidSet ( byte[] v ) #

Sets the value using the specified argument(s).

### Arguments

• byte[] v - Source vector.

## voidSet ( bvec4 v ) #

Sets the value using the specified argument(s).

## voidClear ( ) #

Clears the value by setting all components/elements to 0.

## voidAdd ( bvec4 v ) #

Performs addition of the specified argument.

## voidAdd ( byte v ) #

Performs addition of the specified argument.

### Arguments

• byte v - Value.

## voidSub ( bvec4 v ) #

Subtracts each element of the specified argument from ther corresponding element.

## voidSub ( byte v ) #

Subtracts each element of the specified argument from ther corresponding element.

### Arguments

• byte v - Value.

## voidMul ( bvec4 v ) #

Multiplies the vector by the value of the specified argument.

### Arguments

• bvec4 v - Vector multiplier.

## voidMul ( byte v ) #

Multiplies the vector by the value of the specified argument.

### Arguments

• byte v - A byte multiplier.

## voidDiv ( bvec4 v ) #

Returns the result of division of the vector by the value of the specified arguments.

### Arguments

• bvec4 v - A bvec4 divisor value.

## voidDiv ( byte v ) #

Returns the result of division of the vector by the value of the specified arguments.

### Arguments

• byte v - A byte divisor value.

## boolEquals ( bvec4 other ) #

Checks if the vector and the specified argument are equal (epsilon).

### Arguments

• bvec4 other - Value to be checked for equality.

Return value.

## boolEquals ( object obj ) #

Checks if the vector and the specified argument are equal (epsilon).

Return value.

## intGetHashCode ( ) #

Returns a hash code for the current object. Serves as the default hash function.

### Return value

Resulting int value.

## stringToString ( ) #

Converts the current value to a string value.

### Return value

Resulting string value.

## stringToString ( string format ) #

Converts the current value to a string value.

### Arguments

• string format - String formatting to be used. A format string is composed of zero or more ordinary characters (excluding %) that are copied directly to the result string and control sequences, each of which results in fetching its own parameter. Each control sequence consists of a percent sign (%) followed by one or more of these elements, in order:
• An optional number, a width specifier, that says how many characters (minimum) this conversion should result in.
• An optional precision specifier that says how many decimal digits should be displayed for floating-point numbers.
• A type specifier that says what type the argument data should be treated as. Possible types:
• c: the argument is treated as an integer and presented as a character with that ASCII value.
• d or i: the argument is treated as an integer and presented as a (signed) decimal number.
• o: the argument is treated as an integer and presented as an octal number.
• u: the argument is treated as an integer and presented as an unsigned decimal number.
• x: the argument is treated as an integer and presented as a hexadecimal number (with lower-case letters).
• X: the argument is treated as an integer and presented as a hexadecimal number (with upper-case letters).
• f: the argument is treated as a float and presented as a floating-point number.
• g: the same as e or f, the shortest one is selected.
• G: the same as E or F, the shortest one is selected.
• e: the argument is treated as using the scientific notation with lower-case 'e' (e.g. 1.2e+2).
• E: the argument is treated as using the scientific notation with upper-case 'E' (e.g. 1.2E+2).
• s: the argument is treated as and presented as a string.
• p: the argument is treated as and presented as a pointer address.
• %: a literal percent character. No argument is required.

### Return value

Resulting string value.

## stringToString ( string format, IFormatProvider formatProvider ) #

Converts the current value to a string value.

### Arguments

• string format - String formatting to be used. A format string is composed of zero or more ordinary characters (excluding %) that are copied directly to the result string and control sequences, each of which results in fetching its own parameter. Each control sequence consists of a percent sign (%) followed by one or more of these elements, in order:
• An optional number, a width specifier, that says how many characters (minimum) this conversion should result in.
• An optional precision specifier that says how many decimal digits should be displayed for floating-point numbers.
• A type specifier that says what type the argument data should be treated as. Possible types:
• c: the argument is treated as an integer and presented as a character with that ASCII value.
• d or i: the argument is treated as an integer and presented as a (signed) decimal number.
• o: the argument is treated as an integer and presented as an octal number.
• u: the argument is treated as an integer and presented as an unsigned decimal number.
• x: the argument is treated as an integer and presented as a hexadecimal number (with lower-case letters).
• X: the argument is treated as an integer and presented as a hexadecimal number (with upper-case letters).
• f: the argument is treated as a float and presented as a floating-point number.
• g: the same as e or f, the shortest one is selected.
• G: the same as E or F, the shortest one is selected.
• e: the argument is treated as using the scientific notation with lower-case 'e' (e.g. 1.2e+2).
• E: the argument is treated as using the scientific notation with upper-case 'E' (e.g. 1.2E+2).
• s: the argument is treated as and presented as a string.
• p: the argument is treated as and presented as a pointer address.
• %: a literal percent character. No argument is required.
• IFormatProvider formatProvider - Provider to be used to format the value. Pass a null reference to obtain the numeric format information from the current locale setting of the operating system.

### Return value

Resulting string value.

## IEnumerator<byte>GetEnumerator ( ) #

Returns an IEnumerator for the object.

Return value.

## IEnumeratorGetEnumerator ( ) #

Returns an IEnumerator for the object.

### Return value

Return value.
Last update: 2022-12-14