Struct graphene::Vec4[][src]

pub struct Vec4(_);
Expand description

A structure capable of holding a vector with four dimensions: x, y, z, and w.

The contents of the Vec4 structure are private and should never be accessed directly.

Implementations

Adds each component of the two given vectors.

b

a Vec4

Returns

res

return location for the resulting vector

Divides each component of the first operand self by the corresponding component of the second operand b, and places the results into the vector res.

b

a Vec4

Returns

res

return location for the resulting vector

Computes the dot product of the two given vectors.

b

a Vec4

Returns

the value of the dot product

Retrieves the value of the fourth component of the given Vec4.

Returns

the value of the fourth component

Retrieves the value of the first component of the given Vec4.

Returns

the value of the first component

Creates a Vec2 that contains the first two components of the given Vec4.

Returns

res

return location for a Vec2

Creates a Vec3 that contains the first three components of the given Vec4.

Returns

res

return location for a graphene_vec3_t

Retrieves the value of the second component of the given Vec4.

Returns

the value of the second component

Retrieves the value of the third component of the given Vec4.

Returns

the value of the third component

Initializes a Vec4 using the given values.

This function can be called multiple times.

x

the X field of the vector

y

the Y field of the vector

z

the Z field of the vector

w

the W field of the vector

Returns

a pointer to the initialized vector

Initializes a Vec4 using the components of a Vec2 and the values of z and w.

src

a Vec2

z

the value for the third component of self

w

the value for the fourth component of self

Returns

the initialized vector

Initializes a Vec4 using the components of a Vec3 and the value of w.

src

a Vec3

w

the value for the fourth component of self

Returns

the initialized vector

Initializes a Vec4 using the components of another Vec4.

src

a Vec4

Returns

the initialized vector

Linearly interpolates self and v2 using the given factor.

v2

a Vec4

factor

the interpolation factor

Returns

res

the interpolated vector

Computes the length of the given Vec4.

Returns

the length of the vector

Compares each component of the two given vectors and creates a vector that contains the maximum values.

b

a Vec4

Returns

res

return location for the result vector

Compares each component of the two given vectors and creates a vector that contains the minimum values.

b

a Vec4

Returns

res

return location for the result vector

Multiplies each component of the two given vectors.

b

a Vec4

Returns

res

return location for the resulting vector

Compares the two given Vec4 vectors and checks whether their values are within the given epsilon.

v2

a Vec4

epsilon

the threshold between the two vectors

Returns

true if the two vectors are near each other

Negates the given Vec4.

Returns

res

return location for the result vector

Normalizes the given Vec4.

Returns

res

return location for the normalized vector

Multiplies all components of the given vector with the given scalar factor.

factor

the scalar factor

Returns

res

return location for the result vector

Subtracts from each component of the first operand self the corresponding component of the second operand b and places each result into the components of res.

b

a Vec4

Returns

res

return location for the resulting vector

Retrieves a pointer to a Vec4 with all its components set to 1.

Returns

a constant vector

Retrieves a pointer to a Vec4 with its components set to (0, 0, 0, 1).

Returns

a constant vector

Retrieves a pointer to a Vec4 with its components set to (1, 0, 0, 0).

Returns

a constant vector

Retrieves a pointer to a Vec4 with its components set to (0, 1, 0, 0).

Returns

a constant vector

Retrieves a pointer to a Vec4 with its components set to (0, 0, 1, 0).

Returns

a constant vector

Retrieves a pointer to a Vec4 with all its components set to 0.

Returns

a constant vector

Initializes a Vec4 with the values inside the given array.

src

an array of four floating point values

Returns

the initialized vector

Stores the components of the given Vec4 into an array of floating point values.

Returns

dest

return location for an array of floating point values

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Returns the type identifier of Self.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.