# Unigine::Math::bvec4 Struct

This class represents a vector of 4 byte (unsigned char) components. This vector is used for vertex color parameters.

## bvec4 ( ) #

Default constructor. Produces a zero vector.

## bvec4 ( const bvec4 & v ) #

Constructor. Initializes the vector by copying a given source vector.

### Arguments

• const bvec4 & v - Source vector.

## bvec4 ( unsigned char x, unsigned char y, unsigned char z, unsigned char w ) #

Constructor. Initializes the vector using given unsigned char values.

### Arguments

• unsigned char x - X component of the vector.
• unsigned char y - Y component of the vector.
• unsigned char z - Z component of the vector.
• unsigned char w - W component of the vector.

## bvec4 ( const vec4 & v, float scale ) #

Constructor. Initializes the vector using a given vec4 source vector and a scale multiplier.

### Arguments

• const vec4 & v - Source vector.
• float scale - Scale.

## explicit bvec4 ( unsigned char v ) #

Constructor. Initializes the vector using a given scalar value: x=v, y=v, z=v, w=v.

### Arguments

• unsigned char v - Scalar.

## explicit bvec4 ( const vec4 & v ) #

Constructor. Initializes the vector using a given vec4 source vector.

### Arguments

• const vec4 & v - Source vector.

## explicit bvec4 ( const dvec4 & v ) #

Constructor. Initializes the vector using a given dvec4 source vector.

### Arguments

• const dvec4 & v - Source vector.

## explicit bvec4 ( const ivec4 & v ) #

Constructor. Initializes the vector using a given ivec4 source vector.

### Arguments

• const ivec4 & v - Source vector.

## explicit bvec4 ( const unsigned char * v ) #

Constructor. Initializes the vector using a given pointer to the array of unsigned char elements: x=v, y=v, z=v, w=v.

### Arguments

• const unsigned char * v - Pointer to the array of unsigned char elements.

## voidset ( unsigned char x_, unsigned char y_, unsigned char z_, unsigned char w_ ) #

Sets the vector by components.

### Arguments

• unsigned char x_ - X component of the vector.
• unsigned char y_ - Y component of the vector.
• unsigned char z_ - Z component of the vector.
• unsigned char w_ - W component of the vector.

## voidset ( const unsigned char * val ) #

Sets the vector using the array of unsigned char elements: x=val, y=val, z=val, w=val.

### Arguments

• const unsigned char * val - Pointer to the array of unsigned char elements.

## voidset ( unsigned char val ) #

Sets the vector components equal to specified scalar value: x=val, y=val, z=val, w=val.

### Arguments

• unsigned char val - Scalar value.

## voidset ( const bvec4 & val ) #

Sets the vector equal to the specified vector.

### Arguments

• const bvec4 & val - Source vector.

## voidset ( const vec4 & val, float scale ) #

Sets the vector using a given vec4 vector and a scale multiplier.

### Arguments

• const vec4 & val - Source vector.
• float scale - Scale.

## unsigned char *get ( ) #

Returns the pointer to the vector.

### Return value

Pointer to the vector.

## const unsigned char *get ( ) # const

Returns the constant pointer to the vector.

### Return value

Pointer to the vector.

## voidget ( unsigned char * val ) #

### Arguments

• unsigned char * val

## const unsigned char *operator const unsigned char * ( ) #

Performs type conversion to const unsigned char *.

## const void *operator const void * ( ) #

Performs type conversion to const void *.

## unsigned char *operator unsigned char * ( ) #

Performs type conversion to unsigned char *.

## void *operator void * ( ) #

Performs type conversion to void *.

## bvec4 &operator= ( const bvec4 & val ) #

Performs vector assignment. Destination vector = Source vector.

### Arguments

• const bvec4 & val - Source vector.

Result.

## unsigned char &operator[] ( int i ) #

Performs array access to the vector item reference by using given item index.

### Arguments

• int i - Vector item index.

### Return value

Vector item reference.

## unsigned charoperator[] ( int i ) # const

Performs array access to the vector item by using given item index.

### Arguments

• int i - Vector item index.

### Return value

Vector item.
Last update: 2020-05-19