Struct raylib::core::math::Vector3[][src]

#[repr(C)]
pub struct Vector3 { pub x: f32, pub y: f32, pub z: f32, }

Fields

x: f32y: f32z: f32

Implementations

Returns a new Vector3 with specified components.

Returns a new Vector3 with all components set to zero.

Returns a new Vector3 with all components set to one.

Returns a new Vector3 containing the cross product between self and vector v.

Returns a new Vector3 perpendicular to self.

Calculates the vector length.

Calculates the dot product with vector v.

Calculates the distance towards vector v.

Scales the vector by multiplying both components by scale.

Returns a new Vector3 with components scaled by scale.

Normalizes the current vector.

Returns a new Vector3 with normalized components from the current vector.

Normalizes and changes both self and v to be orthogonal to eachother.

Transforms the current vector using Matrix mat.

Returns a new Vector3 containing components transformed by Matrix mat.

Rotates the current vector using Quaternion q.

Returns a new Vector3 with components rotated by Quaternion q.

Returns a new Vector3 with componenets linearly interpolated by amount towards vector v.

Reflects the current vector from normal.

Returns a new Vector3 reflected from the current vector using normal.

Returns a new Vector3 containing the minimum of each corresponding component.

Returns a new Vector3 containing the maximum of each corresponding component.

Returns barycenter coordinates (u, v, w) from point p (current vector) with respect to triangle (a, b, c).

Returns a 3-length f32 array containing components [x, y, z] of the current vector.

Returns a new Vector3 with componenets clamp to a certain interval.

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

Performs the /= operation. Read more

Performs the /= operation. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

Performs the *= operation. Read more

Performs the *= operation. Read more

The resulting type after applying the - operator.

Performs the unary - operation. Read more

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

This method tests for !=.

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

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)

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.