### U64Vec2 Lifecycle and Formatting Source: https://docs.rs/glam/latest/glam/u64/struct.U64Vec2 Documentation for standard methods like cloning, debugging, default instantiation, and display formatting for the U64Vec2 struct. ```APIDOC ## U64Vec2 Lifecycle and Formatting ### Cloning Allows creating a duplicate of a U64Vec2 instance. #### fn clone(&self) -> U64Vec2 Returns a duplicate of the value. #### fn clone_from(&mut self, source: &Self) Performs copy-assignment from `source`. ### Debug Formatting Provides a way to format U64Vec2 for debugging purposes. #### fn fmt(&self, fmt: &mut Formatter<'_>) -> Result Formats the value using the given formatter. ### Default Value Allows creating a U64Vec2 instance with its default value. #### fn default() -> Self Returns the “default value” for a type. ### Display Formatting Provides a way to format U64Vec2 for display. #### fn fmt(&self, f: &mut Formatter<'_>) -> Result Formats the value using the given formatter. ``` -------------------------------- ### Default Value Source: https://docs.rs/glam/latest/glam/i8/struct.I8Vec3 Details how to get the default value for an I8Vec3 instance. ```APIDOC ## Default Value for I8Vec3 ### Description Provides a way to obtain the default value for the `I8Vec3` type. ### Method - **`default() -> Self`**: Returns the default value for `I8Vec3`. ``` -------------------------------- ### DAffine2 Constructors Source: https://docs.rs/glam/latest/glam/f64/struct.DAffine2 Methods for creating new DAffine2 instances from various inputs. ```APIDOC ## DAffine2 Constructors ### `from_cols(x_axis: DVec2, y_axis: DVec2, z_axis: DVec2) -> Self` * **Description**: Creates an affine transform from three column vectors. ### `from_cols_array(m: &[f64; 6]) -> Self` * **Description**: Creates an affine transform from a `[f64; 6]` array stored in column major order. ### `to_cols_array(&self) -> [f64; 6]` * **Description**: Creates a `[f64; 6]` array storing data in column major order. ### `from_cols_array_2d(m: &[[f64; 2]; 3]) -> Self` * **Description**: Creates an affine transform from a `[[f64; 2]; 3]` 2D array stored in column major order. If your data is in row major order you will need to `transpose` the returned matrix. ### `to_cols_array_2d(&self) -> [[f64; 2]; 3]` * **Description**: Creates a `[[f64; 2]; 3]` 2D array storing data in column major order. If you require data in row major order `transpose` the matrix first. ### `from_cols_slice(slice: &[f64]) -> Self` * **Description**: Creates an affine transform from the first 6 values in `slice`. * **Panics**: Panics if `slice` is less than 6 elements long. ### `write_cols_to_slice(self, slice: &mut [f64])` * **Description**: Writes the columns of `self` to the first 6 elements in `slice`. * **Panics**: Panics if `slice` is less than 6 elements long. ### `from_scale(scale: DVec2) -> Self` * **Description**: Creates an affine transform that changes scale. Note that if any scale is zero the transform will be non-invertible. ### `from_angle(angle: f64) -> Self` * **Description**: Creates an affine transform from the given rotation `angle` (in radians). ### `from_translation(translation: DVec2) -> Self` * **Description**: Creates an affine transformation from the given 2D `translation`. ### `from_mat2(matrix2: DMat2) -> Self` * **Description**: Creates an affine transform from a 2x2 matrix (expressing scale, shear and rotation). ### `from_mat2_translation(matrix2: DMat2, translation: DVec2) -> Self` * **Description**: Creates an affine transform from a 2x2 matrix (expressing scale, shear and rotation) and a translation vector. Equivalent to `DAffine2::from_translation(translation) * DAffine2::from_mat2(mat2)`. ### `from_scale_angle_translation( scale: DVec2, angle: f64, translation: DVec2, ) -> Self` * **Description**: Creates an affine transform from the given 2D `scale`, rotation `angle` (in radians) and `translation`. Equivalent to `DAffine2::from_translation(translation) * DAffine2::from_angle(angle) * DAffine2::from_scale(scale)`. ### `from_angle_translation(angle: f64, translation: DVec2) -> Self` * **Description**: Creates an affine transform from the given 2D rotation `angle` (in radians) and `translation`. Equivalent to `DAffine2::from_translation(translation) * DAffine2::from_angle(angle)`. ### `from_mat3(m: DMat3) -> Self` * **Description**: Creates an affine transform from a `DMat3`. The given `DMat3` must be an affine transform. ``` -------------------------------- ### Get Any Orthogonal Vector Source: https://docs.rs/glam/latest/glam/f32/struct.Vec3 Returns a vector that is orthogonal to the given vector. ```APIDOC ## any_orthogonal_vector ### Description Returns some vector that is orthogonal to the given one. The input vector must be finite and non-zero. The output vector is not necessarily unit length. For that use `Self::any_orthonormal_vector()` instead. ### Method Not applicable (method on struct) ### Endpoint Not applicable (method on struct) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) Returns a vector orthogonal to the input vector. #### Response Example None ``` -------------------------------- ### Affine2 Constructors and Constants Source: https://docs.rs/glam/latest/glam/f32/struct.Affine2 Provides information on static methods and constants for creating Affine2 instances. ```APIDOC ## Affine2 Constructors and Constants ### Constants * **ZERO**: `const ZERO: Self` - The degenerate zero transform. * **IDENTITY**: `const IDENTITY: Self` - The identity transform. * **NAN**: `const NAN: Self` - All NANs. ### Static Methods * **from_cols(x_axis: Vec2, y_axis: Vec2, z_axis: Vec2)** -> Self - Creates an affine transform from three column vectors. * **from_cols_array(m: &[f32; 6])** -> Self - Creates an affine transform from a `[f32; 6]` array stored in column major order. * **from_cols_array_2d(m: &[[f32; 2]; 3])** -> Self - Creates an affine transform from a `[[f32; 2]; 3]` 2D array stored in column major order. * **from_cols_slice(slice: &[f32])** -> Self - Creates an affine transform from the first 6 values in `slice`. * **Panics**: Panics if `slice` is less than 6 elements long. * **from_scale(scale: Vec2)** -> Self - Creates an affine transform that changes scale. * **from_angle(angle: f32)** -> Self - Creates an affine transform from the given rotation `angle`. * **from_translation(translation: Vec2)** -> Self - Creates an affine transformation from the given 2D `translation`. * **from_mat2(matrix2: Mat2)** -> Self - Creates an affine transform from a 2x2 matrix. * **from_mat2_translation(matrix2: Mat2, translation: Vec2)** -> Self - Creates an affine transform from a 2x2 matrix and a translation vector. * **from_scale_angle_translation(scale: Vec2, angle: f32, translation: Vec2)** -> Self - Creates an affine transform from scale, angle, and translation. * **from_angle_translation(angle: f32, translation: Vec2)** -> Self - Creates an affine transform from angle and translation. * **from_mat3(m: Mat3)** -> Self - Creates an affine transform from a `Mat3` (must be an affine transform). * **from_mat3a(m: Mat3A)** -> Self - Creates an affine transform from a `Mat3A` (must be an affine transform). ``` -------------------------------- ### UVec3 Default Value Source: https://docs.rs/glam/latest/glam/u32/struct.UVec3 Details on how to get the default value for a UVec3 instance. ```APIDOC ## Default Value for UVec3 ### Description This implementation provides a way to obtain the default value for the `UVec3` struct. ### Methods #### `impl Default for UVec3` - **Method**: `default` - **Description**: Returns the default value for `UVec3`. - **Return Type**: `Self` (which is `UVec3`) ``` -------------------------------- ### Get Any Orthonormal Vector Source: https://docs.rs/glam/latest/glam/f32/struct.Vec3 Returns a unit vector that is orthogonal to the given unit vector. ```APIDOC ## any_orthonormal_vector ### Description Returns any unit vector that is orthogonal to the given one. The input vector must be unit length. ### Method Not applicable (method on struct) ### Endpoint Not applicable (method on struct) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) Returns a unit vector orthogonal to the input vector. #### Response Example None ### Panics Will panic if `self` is not normalized when `glam_assert` is enabled. ``` -------------------------------- ### I8Vec3 Constructors Source: https://docs.rs/glam/latest/glam/i8/struct.I8Vec3 Methods for creating new I8Vec3 instances. ```APIDOC ## I8Vec3 Constructors ### `new(x: i8, y: i8, z: i8) -> Self` Creates a new vector. ### `splat(v: i8) -> Self` Creates a vector with all elements set to `v`. ### `from_array(a: [i8; 3]) -> Self` Creates a new vector from an array. ### `from_slice(slice: &[i8]) -> Self` Creates a vector from the first 3 values in `slice`. **Panics** Panics if `slice` is less than 3 elements long. ``` -------------------------------- ### Absolute Value and Sign Operations Source: https://docs.rs/glam/latest/glam/f32/struct.Vec3A Functions to get the absolute value, sign, and copy the sign of vector elements. ```APIDOC ## POST /websites/rs_glam_glam/abs ### Description Returns a vector containing the absolute value of each element of `self`. ### Method POST ### Endpoint `/websites/rs_glam_glam/abs` ### Parameters #### Request Body - **vector** (object) - Required - The input vector. ### Response #### Success Response (200) - **result** (object) - A vector with the absolute values of the input elements. #### Response Example ```json { "result": {"x": 1.0, "y": 2.0, "z": 3.0} } ``` ## POST /websites/rs_glam_glam/signum ### Description Returns a vector with elements representing the sign of `self`. * `1.0` if the number is positive, `+0.0` or `INFINITY` * `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY` * `NAN` if the number is `NAN` ### Method POST ### Endpoint `/websites/rs_glam_glam/signum` ### Parameters #### Request Body - **vector** (object) - Required - The input vector. ### Response #### Success Response (200) - **result** (object) - A vector with the sign of each element. #### Response Example ```json { "result": {"x": 1.0, "y": -1.0, "z": 0.0} } ``` ## POST /websites/rs_glam_glam/copysign ### Description Returns a vector with signs of `rhs` and the magnitudes of `self`. ### Method POST ### Endpoint `/websites/rs_glam_glam/copysign` ### Parameters #### Request Body - **self** (object) - Required - The vector providing magnitudes. - **rhs** (object) - Required - The vector providing signs. ### Response #### Success Response (200) - **result** (object) - A vector with signs from `rhs` and magnitudes from `self`. #### Response Example ```json { "result": {"x": 1.0, "y": -2.0, "z": 3.0} } ``` ``` -------------------------------- ### U16Vec2 Constructor Methods Source: https://docs.rs/glam/latest/glam/u16/struct.U16Vec2 Provides methods for creating new U16Vec2 instances. ```APIDOC ## U16Vec2 Constructors ### `new(x: u16, y: u16) -> Self` Creates a new `U16Vec2` with the specified x and y components. ### `splat(v: u16) -> Self` Creates a new `U16Vec2` with all components set to the given value `v`. ### `from_array(a: [u16; 2]) -> Self` Creates a new `U16Vec2` from a 2-element array. ### `from_slice(slice: &[u16]) -> Self` Creates a new `U16Vec2` from the first two elements of a slice. **Panics** Panics if `slice` has fewer than 2 elements. ``` -------------------------------- ### Mat4 Default Value Source: https://docs.rs/glam/latest/glam/f32/struct.Mat4 Documentation for getting the default value of a Mat4 matrix. ```APIDOC ## Mat4 Default Value ### Description Provides a method to get the default value of a `Mat4` matrix. ### Methods #### `default() -> Self` Returns the default `Mat4` matrix. **Type**: `impl Default for Mat4` ``` -------------------------------- ### U16Vec3 Constructors Source: https://docs.rs/glam/latest/glam/u16/struct.U16Vec3 Methods for creating new U16Vec3 instances. ```APIDOC ## U16Vec3 Constructors ### `new(x: u16, y: u16, z: u16) -> Self` Creates a new vector. ### `splat(v: u16) -> Self` Creates a vector with all elements set to `v`. ### `from_array(a: [u16; 3]) -> Self` Creates a new vector from an array. ### `from_slice(slice: &[u16]) -> Self` Creates a vector from the first 3 values in `slice`. **Panics** Panics if `slice` is less than 3 elements long. ### Request Example ```rust let vec_new = glam::U16Vec3::new(1, 2, 3); let vec_splat = glam::U16Vec3::splat(5); let vec_from_array = glam::U16Vec3::from_array([10, 20, 30]); let data = [40, 50, 60]; let vec_from_slice = glam::U16Vec3::from_slice(&data); ``` ``` -------------------------------- ### BVec4 Constructors and Methods Source: https://docs.rs/glam/latest/glam/bool/struct.BVec4 Provides methods for creating and manipulating BVec4 instances, including constants, constructors, and utility functions. ```APIDOC ## Implementations for BVec4 ### Constants - **FALSE**: `Self` - All false. - **TRUE**: `Self` - All true. ### Constructors - **new(x: bool, y: bool, z: bool, w: bool)** -> `Self` - Creates a new vector mask. - **splat(v: bool)** -> `Self` - Creates a vector mask with all elements set to `v`. - **from_array(a: [bool; 4])** -> `Self` - Creates a new vector mask from a bool array. ### Methods - **bitmask(self)** -> `u32` - Returns a bitmask with the lowest 4 bits set from the elements of `self`. A true element results in a `1` bit and a false element in a `0` bit. Element `x` goes into the first lowest bit, element `y` into the second, etc. - **any(self)** -> `bool` - Returns true if any of the elements are true, false otherwise. - **all(self)** -> `bool` - Returns true if all the elements are true, false otherwise. - **test(&self, index: usize)** -> `bool` - Tests the value at `index`. Panics if `index` is greater than 3. - **set(&mut self, index: usize, value: bool)** - Sets the element at `index`. Panics if `index` is greater than 3. ``` -------------------------------- ### Quaternion Properties and Checks Source: https://docs.rs/glam/latest/glam/f32/struct.Quat Functions to get properties like length or check conditions like normalization or finiteness. ```APIDOC ## POST /quaternion/length ### Description Computes the length of `self`. ### Method POST ### Endpoint /quaternion/length ### Parameters #### Request Body - **quaternion** (array) - Required - The input quaternion [x, y, z, w]. ### Request Example ```json { "quaternion": [0.1, 0.2, 0.3, 0.4] } ``` ### Response #### Success Response (200) - **length** (float) - The length of the quaternion. #### Response Example ```json { "length": 0.5477225575051661 } ``` ## POST /quaternion/length_squared ### Description Computes the squared length of `self`. This is generally faster than `length()` as it avoids a square root operation. ### Method POST ### Endpoint /quaternion/length_squared ### Parameters #### Request Body - **quaternion** (array) - Required - The input quaternion [x, y, z, w]. ### Request Example ```json { "quaternion": [0.1, 0.2, 0.3, 0.4] } ``` ### Response #### Success Response (200) - **length_squared** (float) - The squared length of the quaternion. #### Response Example ```json { "length_squared": 0.3 } ``` ## POST /quaternion/length_recip ### Description Computes `1.0 / length()`. For valid results, `self` must _not_ be of length zero. ### Method POST ### Endpoint /quaternion/length_recip ### Parameters #### Request Body - **quaternion** (array) - Required - The input quaternion [x, y, z, w]. ### Request Example ```json { "quaternion": [0.0, 0.0, 0.0, 1.0] } ``` ### Response #### Success Response (200) - **length_recip** (float) - The reciprocal of the quaternion's length. #### Response Example ```json { "length_recip": 1.0 } ``` ## POST /quaternion/normalize ### Description Returns `self` normalized to length 1.0. For valid results, `self` must _not_ be of length zero. Panics Will panic if `self` is zero length when `glam_assert` is enabled. ### Method POST ### Endpoint /quaternion/normalize ### Parameters #### Request Body - **quaternion** (array) - Required - The input quaternion [x, y, z, w]. ### Request Example ```json { "quaternion": [0.1, 0.2, 0.3, 0.4] } ``` ### Response #### Success Response (200) - **quaternion** (array) - The normalized quaternion [x, y, z, w]. #### Response Example ```json { "quaternion": [0.18257418583505536, 0.3651483716701107, 0.547722557505166, 0.7302967433402214] } ``` ## POST /quaternion/is_finite ### Description Returns `true` if, and only if, all elements are finite. If any element is either `NaN`, positive or negative infinity, this will return `false`. ### Method POST ### Endpoint /quaternion/is_finite ### Parameters #### Request Body - **quaternion** (array) - Required - The input quaternion [x, y, z, w]. ### Request Example ```json { "quaternion": [0.1, 0.2, 0.3, 0.4] } ``` ### Response #### Success Response (200) - **is_finite** (boolean) - True if all elements are finite, false otherwise. #### Response Example ```json { "is_finite": true } ``` ## POST /quaternion/is_nan ### Description Returns `true` if any elements are `NAN`. ### Method POST ### Endpoint /quaternion/is_nan ### Parameters #### Request Body - **quaternion** (array) - Required - The input quaternion [x, y, z, w]. ### Request Example ```json { "quaternion": [0.1, 0.2, 0.3, 0.4] } ``` ### Response #### Success Response (200) - **is_nan** (boolean) - True if any element is NaN, false otherwise. #### Response Example ```json { "is_nan": false } ``` ## POST /quaternion/is_normalized ### Description Returns whether `self` of length `1.0` or not. Uses a precision threshold of `1e-6`. ### Method POST ### Endpoint /quaternion/is_normalized ### Parameters #### Request Body - **quaternion** (array) - Required - The input quaternion [x, y, z, w]. ### Request Example ```json { "quaternion": [0.0, 0.0, 0.0, 1.0] } ``` ### Response #### Success Response (200) - **is_normalized** (boolean) - True if the quaternion is normalized, false otherwise. #### Response Example ```json { "is_normalized": true } ``` ## POST /quaternion/is_near_identity ### Description Checks if the quaternion is near the identity quaternion. ### Method POST ### Endpoint /quaternion/is_near_identity ### Parameters #### Request Body - **quaternion** (array) - Required - The input quaternion [x, y, z, w]. ### Request Example ```json { "quaternion": [0.0, 0.0, 0.0, 1.0] } ``` ### Response #### Success Response (200) - **is_near_identity** (boolean) - True if the quaternion is near identity, false otherwise. #### Response Example ```json { "is_near_identity": true } ``` ## POST /quaternion/angle_between ### Description Returns the angle (in radians) for the minimal rotation for transforming this quaternion into another. Both quaternions must be normalized. ##### §Panics Will panic if `self` or `rhs` are not normalized when `glam_assert` is enabled. ### Method POST ### Endpoint /quaternion/angle_between ### Parameters #### Request Body - **quaternion1** (array) - Required - The first normalized quaternion [x, y, z, w]. - **quaternion2** (array) - Required - The second normalized quaternion [x, y, z, w]. ### Request Example ```json { "quaternion1": [0.0, 0.0, 0.0, 1.0], "quaternion2": [0.0, 0.0, 0.7071067811865475, 0.7071067811865476] } ``` ### Response #### Success Response (200) - **angle** (float) - The angle in radians between the two quaternions. #### Response Example ```json { "angle": 0.7853981633974483 } ``` ``` -------------------------------- ### Generic Any TypeId Retrieval Source: https://docs.rs/glam/latest/glam/f32/struct.Mat3A Provides a way to get the `TypeId` of any type `T` that is `'static` and not dynamically sized. ```rust impl Any for T where T: 'static + ?Sized, { fn type_id(&self) -> TypeId; } ``` -------------------------------- ### Affine2 Instance Methods Source: https://docs.rs/glam/latest/glam/f32/struct.Affine2 Details methods for converting Affine2 to arrays, extracting components, and performing transformations. ```APIDOC ## Affine2 Instance Methods ### Array Conversion * **to_cols_array(&self)** -> [f32; 6] - Creates a `[f32; 6]` array storing data in column major order. * **to_cols_array_2d(&self)** -> [[f32; 2]; 3] - Creates a `[[f32; 2]; 3]` 2D array storing data in column major order. * **write_cols_to_slice(self, slice: &mut [f32])** - Writes the columns of `self` to the first 6 elements in `slice`. * **Panics**: Panics if `slice` is less than 6 elements long. ### Component Extraction * **to_scale_angle_translation(self)** -> (Vec2, f32, Vec2) - Extracts `scale`, `angle`, and `translation` from `self`. * **Panics**: Will panic if the determinant `self.matrix2` is zero or if the resulting scale vector contains any zero elements when `glam_assert` is enabled. ### Transformation * **transform_point2(&self, rhs: Vec2)** -> Vec2 - Transforms the given 2D point, applying shear, scale, rotation, and translation. * **transform_vector2(&self, rhs: Vec2)** -> Vec2 - Transforms the given 2D vector, applying shear, scale, and rotation (but NOT translation). ### Utility * **is_finite(&self)** -> bool - Returns `true` if all elements are finite. * **is_nan(&self)** -> bool - Returns `true` if any elements are `NaN`. ``` -------------------------------- ### U64Vec2 Constructors Source: https://docs.rs/glam/latest/glam/u64/struct.U64Vec2 Methods for creating new U64Vec2 instances. ```APIDOC ## Constructors ### `new(x: u64, y: u64) -> Self` Creates a new vector. ### `splat(v: u64) -> Self` Creates a vector with all elements set to `v`. ### `from_array(a: [u64; 2]) -> Self` Creates a new vector from an array. ### `from_slice(slice: &[u64]) -> Self` Creates a vector from the first 2 values in `slice`. ##### §Panics Panics if `slice` is less than 2 elements long. ``` -------------------------------- ### AsMut and AsRef for I16Vec3 Source: https://docs.rs/glam/latest/glam/i16/struct.I16Vec3 Provides methods for getting mutable and immutable references to the underlying array of I16Vec3. ```APIDOC ## AsMut and AsRef for I16Vec3 ### Description Allows conversion to mutable and immutable references of a fixed-size array of `i16`. ### Methods #### `fn as_mut(&mut self) -> &mut [i16; 3]` Converts this type into a mutable reference to a `[i16; 3]` array. #### `fn as_ref(&self) -> &[i16; 3]` Converts this type into an immutable reference to a `[i16; 3]` array. ``` -------------------------------- ### Debug and Display Formatting Source: https://docs.rs/glam/latest/glam/u64/struct.U64Vec4 Documentation for the `fmt` method used for Debug and Display trait implementations for U64Vec4. ```APIDOC ## fn fmt(&self, fmt: &mut Formatter<'_>) -> Result ### Description Formats the value using the given formatter. ### Method POST ### Endpoint /websites/rs_glam_glam/fmt ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **fmt** (&mut Formatter<'_>) - The formatter to use. ### Request Example ```json { "formatter": "" } ``` ### Response #### Success Response (200) - **Result** (Result) - The result of the formatting operation. #### Response Example ```json { "format_result": "" } ``` ``` -------------------------------- ### I64Vec3 AsMut/AsRef Source: https://docs.rs/glam/latest/glam/i64/struct.I64Vec3 Provides methods to get mutable and immutable references to the underlying `[i64; 3]` array. ```APIDOC ## I64Vec3 AsMut/AsRef These traits allow for obtaining mutable and immutable references to the internal `[i64; 3]` array representation of `I64Vec3`. ### `impl AsMut<[i64; 3]> for I64Vec3` - **Description**: Converts `I64Vec3` into a mutable reference of the `[i64; 3]` type. - **Method**: `as_mut` - **Endpoint**: N/A (Method implementation) - **Parameters**: None - **Response**: `&mut [i64; 3]` ### `impl AsRef<[i64; 3]> for I64Vec3` - **Description**: Converts `I64Vec3` into an immutable reference of the `[i64; 3]` type. - **Method**: `as_ref` - **Endpoint**: N/A (Method implementation) - **Parameters**: None - **Response**: `&[i64; 3]` ``` -------------------------------- ### Vec3 Reference Conversions Source: https://docs.rs/glam/latest/glam/f32/struct.Vec3 Provides methods to get mutable and immutable slices of the Vec3's underlying data. ```APIDOC ## Vec3 Reference Conversions ### Description Allows accessing the underlying `[f32; 3]` array of a `Vec3` as mutable or immutable references. ### Methods * **`as_mut()`**: Returns a mutable reference `&mut [f32; 3]` to the underlying data. * **`as_ref()`**: Returns an immutable reference `&[f32; 3]` to the underlying data. ``` -------------------------------- ### DAffine3 Equality and Product Operations Source: https://docs.rs/glam/latest/glam/f64/struct.DAffine3 Details on how to check for equality between DAffine3 instances and how to compute a product from an iterator. ```APIDOC ## Equality and Product Operations for DAffine3 ### `impl PartialEq for DAffine3` #### Description Provides methods to test for equality (`==`) and inequality (`!=`) between `DAffine3` instances. #### Method `GET` (Conceptual - This is for comparison, not a direct API endpoint) #### Endpoint N/A ### `impl<'a> Product<&'a DAffine3> for DAffine3` #### Description Allows computing the product of an iterator of `DAffine3` references. #### Method `POST` (Conceptual - This is for aggregation, not a direct API endpoint) #### Endpoint N/A ``` -------------------------------- ### U64Vec3 Constructors Source: https://docs.rs/glam/latest/glam/u64/struct.U64Vec3 Methods for creating new U64Vec3 instances, including `new`, `splat`, `from_array`, and `from_slice`. ```APIDOC ## Constructors ### `new(x: u64, y: u64, z: u64) -> Self` Creates a new vector. ### `splat(v: u64) -> Self` Creates a vector with all elements set to `v`. ### `from_array(a: [u64; 3]) -> Self` Creates a new vector from an array. ### `from_slice(slice: &[u64]) -> Self` Creates a vector from the first 3 values in `slice`. #### Panics Panics if `slice` is less than 3 elements long. ### Request Example (new) ```json { "method": "new", "args": [10, 20, 30] } ``` ### Request Example (splat) ```json { "method": "splat", "args": [5] } ``` ### Response Example ```json { "result": { "x": 10, "y": 20, "z": 30 } } ``` ``` -------------------------------- ### Get Perpendicular Vector (2D) Source: https://docs.rs/glam/latest/glam/f32/struct.Vec2 Returns a new vector that is the result of rotating the input vector by 90 degrees. ```rust pub fn perp(self) -> Self ``` -------------------------------- ### Debugging and Display Formatting for I64Vec2 Source: https://docs.rs/glam/latest/glam/i64/struct.I64Vec2 Documentation for the `Debug` and `Display` trait implementations for `I64Vec2`, used for formatted output. ```APIDOC ## Debugging and Display Formatting for I64Vec2 ### Description This section covers the implementations of the `Debug` and `Display` traits for `I64Vec2`, enabling formatted output for debugging and user-facing representations. ### Methods #### `impl Debug for I64Vec2` - **Method**: `fmt` - **Description**: Formats the `I64Vec2` value using the provided formatter for debugging purposes. - **Parameters**: - `fmt` (&mut Formatter<'_>): The mutable formatter. - **Return Type**: `Result` #### `impl Display for I64Vec2` - **Method**: `fmt` - **Description**: Formats the `I64Vec2` value using the provided formatter for display purposes. - **Parameters**: - `f` (&mut Formatter<'_>): The mutable formatter. - **Return Type**: `Result` ``` -------------------------------- ### Get Orthonormal Basis Pair Source: https://docs.rs/glam/latest/glam/f32/struct.Vec3 Given a unit vector, returns two additional vectors that, along with the input vector, form an orthonormal basis. ```APIDOC ## any_orthonormal_pair ### Description Given a unit vector return two other vectors that together form an orthonormal basis. That is, all three vectors are orthogonal to each other and are normalized. ### Method Not applicable (method on struct) ### Endpoint Not applicable (method on struct) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) Returns a tuple containing two orthonormal vectors. #### Response Example None ### Panics Will panic if `self` is not normalized when `glam_assert` is enabled. ``` -------------------------------- ### Get Vector Angle (Rust) Source: https://docs.rs/glam/latest/glam/f64/struct.DVec2 Calculates the angle of a vector in radians, within the range `[-π, +π]`. The input vector does not need to be normalized but must be non-zero. ```Rust pub fn to_angle(self) -> f64 ``` -------------------------------- ### DVec3 Constructor Methods Source: https://docs.rs/glam/latest/glam/f64/struct.DVec3 Methods for creating new DVec3 instances. ```APIDOC ## DVec3 Constructor Methods ### Description Functions to create new `DVec3` instances. ### Methods #### `new(x: f64, y: f64, z: f64) -> Self` Creates a new vector with the specified x, y, and z components. - **Parameters**: - **x** (f64) - The x-component. - **y** (f64) - The y-component. - **z** (f64) - The z-component. #### `splat(v: f64) -> Self` Creates a vector with all components set to the same value. - **Parameters**: - **v** (f64) - The value to set for all components. #### `from_array(a: [f64; 3]) -> Self` Creates a new vector from a 3-element array. - **Parameters**: - **a** ([f64; 3]) - The array containing the x, y, and z components. #### `from_slice(slice: &[f64]) -> Self` Creates a new vector from the first 3 values in a slice. - **Parameters**: - **slice** (&[f64]) - The slice containing at least 3 f64 values. ##### §Panics Panics if `slice` is less than 3 elements long. ### Request Example (new) ```json { "method": "new", "args": [1.0, 2.0, 3.0] } ``` ### Response Example (new) ```json { "x": 1.0, "y": 2.0, "z": 3.0 } ``` ### Request Example (splat) ```json { "method": "splat", "args": [5.0] } ``` ### Response Example (splat) ```json { "x": 5.0, "y": 5.0, "z": 5.0 } ``` ``` -------------------------------- ### UVec2 Swizzle Operations Source: https://docs.rs/glam/latest/glam/u32/struct.UVec2 Defines swizzle operations for UVec2, allowing for the creation of UVec3 and UVec4 from its components. The 'xx' function is an example of a swizzle operation. ```rust impl Vec2Swizzles for UVec2 { type Vec3 = UVec3; type Vec4 = UVec4; fn xx(self) -> Self; } ``` -------------------------------- ### Mat4 Constructors Source: https://docs.rs/glam/latest/glam/f32/struct.Mat4 Documents the various methods for creating Mat4 instances, from arrays, columns, and individual transformation components. ```APIDOC ### Constructors * `from_cols(x_axis: Vec4, y_axis: Vec4, z_axis: Vec4, w_axis: Vec4) -> Self`: Creates a 4x4 matrix from four column vectors. * `from_cols_array(m: &[f32; 16]) -> Self`: Creates a 4x4 matrix from a `[f32; 16]` array (column major). * `from_cols_array_2d(m: &[[f32; 4]; 4]) -> Self`: Creates a 4x4 matrix from a `[[f32; 4]; 4]` array (column major). * `from_diagonal(diagonal: Vec4) -> Self`: Creates a 4x4 matrix with a specified diagonal. * `from_scale_rotation_translation(scale: Vec3, rotation: Quat, translation: Vec3) -> Self`: Creates an affine transformation matrix from scale, rotation, and translation. * `from_rotation_translation(rotation: Quat, translation: Vec3) -> Self`: Creates an affine transformation matrix from rotation and translation. * `from_quat(rotation: Quat) -> Self`: Creates an affine transformation matrix from a quaternion. ``` -------------------------------- ### Implement Product for DAffine2 Source: https://docs.rs/glam/latest/glam/f64/struct.DAffine2 Enables the creation of a `DAffine2` instance by multiplying elements from an iterator. The `product` function takes an iterator where each item is a reference to a `DAffine2` and computes their product. ```rust impl<'a> Product<&'a DAffine2> for DAffine2 { fn product(iter: I) -> Self where I: Iterator; } ``` -------------------------------- ### Get Vec2 Components Source: https://docs.rs/glam/latest/glam/f32/struct.Vec4 These functions retrieve the components of a Vec2 vector. They take a reference to the vector ('self') and return a Vec2 representing the extracted components. No external dependencies are required for these getter methods. ```rust fn yy(self) -> Vec2 fn yz(self) -> Vec2 fn yw(self) -> Vec2 fn zx(self) -> Vec2 fn zy(self) -> Vec2 fn zz(self) -> Vec2 fn zw(self) -> Vec2 fn wx(self) -> Vec2 fn wy(self) -> Vec2 fn wz(self) -> Vec2 fn ww(self) -> Vec2 ``` -------------------------------- ### Rust: Implement ToString for T Source: https://docs.rs/glam/latest/glam/bool/struct.BVec4A Shows the implementation of the `ToString` trait, which allows types that implement `Display` to be converted into a `String`. This is a common way to get a string representation of a value. ```Rust impl ToString for T where T: Display + ?Sized, { fn to_string(&self) -> String { format!("{}", self) } } ``` -------------------------------- ### UVec2 Constructor Methods Source: https://docs.rs/glam/latest/glam/u32/struct.UVec2 Methods for creating new UVec2 instances. ```APIDOC ## UVec2 Constructor Methods ### `new(x: u32, y: u32) -> Self` Creates a new vector with the given x and y components. ### `splat(v: u32) -> Self` Creates a vector with all components set to the given value `v`. ### `from_array(a: [u32; 2]) -> Self` Creates a new vector from a 2-element array `[x, y]`. ### `from_slice(slice: &[u32]) -> Self` Creates a new vector from the first two elements of a slice. Panics if the slice has less than 2 elements. ``` -------------------------------- ### U64Vec4 Creation Methods Source: https://docs.rs/glam/latest/glam/u64/struct.U64Vec4 Methods for creating new U64Vec4 instances. ```APIDOC ## U64Vec4 Creation Methods ### Description Methods for creating `U64Vec4` instances. ### Methods - **`new(x: u64, y: u64, z: u64, w: u64) -> Self`**: Creates a new vector with the specified components. - **`splat(v: u64) -> Self`**: Creates a vector with all elements set to the given value `v`. - **`from_array(a: [u64; 4]) -> Self`**: Creates a new vector from a 4-element array. - **`from_slice(slice: &[u64]) -> Self`**: Creates a new vector from the first 4 elements of a slice. Panics if the slice has fewer than 4 elements. ``` -------------------------------- ### Get Angle of 2D Vector (f32) Source: https://docs.rs/glam/latest/glam/f32/struct.Vec2 Returns the angle in radians (in the range `[-π, +π]`) of a 2D vector. The input vector does not need to be normalized but must be non-zero. ```rust pub fn to_angle(self) -> f32 ``` -------------------------------- ### Get immutable slice of DVec3 in Rust Source: https://docs.rs/glam/latest/glam/f64/struct.DVec3 Converts a shared reference to DVec3 into a shared reference to a fixed-size array of 3 f64 elements. This provides read-only access to the vector's components. ```rust fn as_ref(&self) -> &[f64; 3] ``` -------------------------------- ### Hashing Source: https://docs.rs/glam/latest/glam/u16/struct.U16Vec3 Documentation for hashing-related operations on `U16Vec3`. ```APIDOC ## Hashing for U16Vec3 This section covers the hashing capabilities of the `U16Vec3` type. ### `impl Hash for U16Vec3` #### Method `fn hash<__H: Hasher>(&self, state: &mut __H)` #### Description Feeds the `U16Vec3` value into the provided `Hasher`. #### Static Method `fn hash_slice(data: &[Self], state: &mut H)` where H: Hasher, Self: Sized #### Description Feeds a slice of `U16Vec3` values into the provided `Hasher`. ``` -------------------------------- ### Get mutable slice of DVec3 in Rust Source: https://docs.rs/glam/latest/glam/f64/struct.DVec3 Converts a mutable reference to DVec3 into a mutable reference to a fixed-size array of 3 f64 elements. This allows direct modification of the vector's components. ```rust fn as_mut(&mut self) -> &mut [f64; 3] ``` -------------------------------- ### Display Formatting (Display) Source: https://docs.rs/glam/latest/glam/u16/struct.U16Vec3 Documentation for the `fmt` method within the `Display` trait implementation, used for user-facing string representation of U16Vec3 instances. ```APIDOC ## Display Formatting (Display) This endpoint covers the `Display` trait implementation for `U16Vec3`. ### `fn fmt(&self, f: &mut Formatter<'_>) -> Result` Formats the value using the given formatter for display. ```