#[repr(C)]pub struct Mat3 {
pub x_axis: Vec3,
pub y_axis: Vec3,
pub z_axis: Vec3,
}Expand description
A 3x3 column major matrix.
This 3x3 matrix type features convenience methods for creating and using linear and
affine transformations. If you are primarily dealing with 2D affine transformations the
Affine2 type is much faster and more space efficient than
using a 3x3 matrix.
Linear transformations including 3D rotation and scale can be created using methods
such as Self::from_diagonal(), Self::from_quat(), Self::from_axis_angle(),
Self::from_rotation_x(), Self::from_rotation_y(), or
Self::from_rotation_z().
The resulting matrices can be use to transform 3D vectors using regular vector multiplication.
Affine transformations including 2D translation, rotation and scale can be created
using methods such as Self::from_translation(), Self::from_angle(),
Self::from_scale() and Self::from_scale_angle_translation().
The Self::transform_point2() and Self::transform_vector2() convenience methods
are provided for performing affine transforms on 2D vectors and points. These multiply
2D inputs as 3D vectors with an implicit z value of 1 for points and 0 for
vectors respectively. These methods assume that Self contains a valid affine
transform.
Fields§
§x_axis: Vec3§y_axis: Vec3§z_axis: Vec3Implementations§
Source§impl Mat3
impl Mat3
Sourcepub const IDENTITY: Mat3
pub const IDENTITY: Mat3
A 3x3 identity matrix, where all diagonal elements are 1, and all off-diagonal elements are 0.
Sourcepub const fn from_cols(x_axis: Vec3, y_axis: Vec3, z_axis: Vec3) -> Mat3
pub const fn from_cols(x_axis: Vec3, y_axis: Vec3, z_axis: Vec3) -> Mat3
Creates a 3x3 matrix from three column vectors.
Examples found in repository?
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
fn move_pointer(
// `Single` ensures the system runs ONLY when exactly one matching entity exists.
mut player: Single<(&mut Transform, &Player)>,
// `Option<Single>` ensures that the system runs ONLY when zero or one matching entity exists.
enemy: Option<Single<&Transform, (With<Enemy>, Without<Player>)>>,
time: Res<Time>,
) {
let (player_transform, player) = &mut *player;
if let Some(enemy_transform) = enemy {
// Enemy found, rotate and move towards it.
let delta = enemy_transform.translation - player_transform.translation;
let distance = delta.length();
let front = delta / distance;
let up = Vec3::Z;
let side = front.cross(up);
player_transform.rotation = Quat::from_mat3(&Mat3::from_cols(side, front, up));
let max_step = distance - player.min_follow_radius;
if 0.0 < max_step {
let velocity = (player.speed * time.delta_secs()).min(max_step);
player_transform.translation += front * velocity;
}
} else {
// No enemy found, keep searching.
player_transform.rotate_axis(Dir3::Z, player.rotation_speed * time.delta_secs());
}
}Sourcepub const fn from_cols_array(m: &[f32; 9]) -> Mat3
pub const fn from_cols_array(m: &[f32; 9]) -> Mat3
Creates a 3x3 matrix from a [f32; 9] array stored in column major order.
If your data is stored in row major you will need to transpose the returned
matrix.
Sourcepub const fn to_cols_array(&self) -> [f32; 9]
pub const fn to_cols_array(&self) -> [f32; 9]
Creates a [f32; 9] array storing data in column major order.
If you require data in row major order transpose the matrix first.
Sourcepub const fn from_cols_array_2d(m: &[[f32; 3]; 3]) -> Mat3
pub const fn from_cols_array_2d(m: &[[f32; 3]; 3]) -> Mat3
Creates a 3x3 matrix from a [[f32; 3]; 3] 3D array stored in column major order.
If your data is in row major order you will need to transpose the returned
matrix.
Sourcepub const fn to_cols_array_2d(&self) -> [[f32; 3]; 3]
pub const fn to_cols_array_2d(&self) -> [[f32; 3]; 3]
Creates a [[f32; 3]; 3] 3D array storing data in column major order.
If you require data in row major order transpose the matrix first.
Sourcepub const fn from_diagonal(diagonal: Vec3) -> Mat3
pub const fn from_diagonal(diagonal: Vec3) -> Mat3
Creates a 3x3 matrix with its diagonal set to diagonal and all other entries set to 0.
Sourcepub fn from_mat4(m: Mat4) -> Mat3
pub fn from_mat4(m: Mat4) -> Mat3
Creates a 3x3 matrix from a 4x4 matrix, discarding the 4th row and column.
Sourcepub fn from_mat4_minor(m: Mat4, i: usize, j: usize) -> Mat3
pub fn from_mat4_minor(m: Mat4, i: usize, j: usize) -> Mat3
Creates a 3x3 matrix from the minor of the given 4x4 matrix, discarding the ith column
and jth row.
§Panics
Panics if i or j is greater than 3.
Sourcepub fn from_quat(rotation: Quat) -> Mat3
pub fn from_quat(rotation: Quat) -> Mat3
Creates a 3D rotation matrix from the given quaternion.
§Panics
Will panic if rotation is not normalized when glam_assert is enabled.
Sourcepub fn from_axis_angle(axis: Vec3, angle: f32) -> Mat3
pub fn from_axis_angle(axis: Vec3, angle: f32) -> Mat3
Creates a 3D rotation matrix from a normalized rotation axis and angle (in
radians).
§Panics
Will panic if axis is not normalized when glam_assert is enabled.
Sourcepub fn from_euler(order: EulerRot, a: f32, b: f32, c: f32) -> Mat3
pub fn from_euler(order: EulerRot, a: f32, b: f32, c: f32) -> Mat3
Creates a 3D rotation matrix from the given euler rotation sequence and the angles (in radians).
Sourcepub fn to_euler(&self, order: EulerRot) -> (f32, f32, f32)
pub fn to_euler(&self, order: EulerRot) -> (f32, f32, f32)
Extract Euler angles with the given Euler rotation order.
Note if the input matrix contains scales, shears, or other non-rotation transformations then the resulting Euler angles will be ill-defined.
§Panics
Will panic if any input matrix column is not normalized when glam_assert is enabled.
Sourcepub fn from_rotation_x(angle: f32) -> Mat3
pub fn from_rotation_x(angle: f32) -> Mat3
Creates a 3D rotation matrix from angle (in radians) around the x axis.
Sourcepub fn from_rotation_y(angle: f32) -> Mat3
pub fn from_rotation_y(angle: f32) -> Mat3
Creates a 3D rotation matrix from angle (in radians) around the y axis.
Examples found in repository?
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
fn move_camera(
keyboard_input: Res<ButtonInput<KeyCode>>,
mut mouse_wheel_events: EventReader<MouseWheel>,
mut cameras: Query<&mut Transform, With<Camera3d>>,
) {
let (mut zoom_delta, mut theta_delta) = (0.0, 0.0);
// Process zoom in and out via the keyboard.
if keyboard_input.pressed(KeyCode::KeyW) || keyboard_input.pressed(KeyCode::ArrowUp) {
zoom_delta -= CAMERA_KEYBOARD_ZOOM_SPEED;
} else if keyboard_input.pressed(KeyCode::KeyS) || keyboard_input.pressed(KeyCode::ArrowDown) {
zoom_delta += CAMERA_KEYBOARD_ZOOM_SPEED;
}
// Process left and right pan via the keyboard.
if keyboard_input.pressed(KeyCode::KeyA) || keyboard_input.pressed(KeyCode::ArrowLeft) {
theta_delta -= CAMERA_KEYBOARD_PAN_SPEED;
} else if keyboard_input.pressed(KeyCode::KeyD) || keyboard_input.pressed(KeyCode::ArrowRight) {
theta_delta += CAMERA_KEYBOARD_PAN_SPEED;
}
// Process zoom in and out via the mouse wheel.
for event in mouse_wheel_events.read() {
zoom_delta -= event.y * CAMERA_MOUSE_MOVEMENT_SPEED;
}
// Update the camera transform.
for transform in cameras.iter_mut() {
let transform = transform.into_inner();
let direction = transform.translation.normalize_or_zero();
let magnitude = transform.translation.length();
let new_direction = Mat3::from_rotation_y(theta_delta) * direction;
let new_magnitude = (magnitude + zoom_delta).max(MIN_ZOOM_DISTANCE);
transform.translation = new_direction * new_magnitude;
transform.look_at(CAMERA_FOCAL_POINT, Vec3::Y);
}
}Sourcepub fn from_rotation_z(angle: f32) -> Mat3
pub fn from_rotation_z(angle: f32) -> Mat3
Creates a 3D rotation matrix from angle (in radians) around the z axis.
Sourcepub fn from_translation(translation: Vec2) -> Mat3
pub fn from_translation(translation: Vec2) -> Mat3
Creates an affine transformation matrix from the given 2D translation.
The resulting matrix can be used to transform 2D points and vectors. See
Self::transform_point2() and Self::transform_vector2().
Sourcepub fn from_angle(angle: f32) -> Mat3
pub fn from_angle(angle: f32) -> Mat3
Creates an affine transformation matrix from the given 2D rotation angle (in
radians).
The resulting matrix can be used to transform 2D points and vectors. See
Self::transform_point2() and Self::transform_vector2().
Examples found in repository?
598 599 600 601 602 603 604 605 606 607 608 609 610 611 612
fn rotate_primitive_2d_meshes(
mut primitives_2d: Query<
(&mut Transform, &ViewVisibility),
(With<PrimitiveData>, With<MeshDim2>),
>,
time: Res<Time>,
) {
let rotation_2d = Quat::from_mat3(&Mat3::from_angle(time.elapsed_secs()));
primitives_2d
.iter_mut()
.filter(|(_, vis)| vis.get())
.for_each(|(mut transform, _)| {
transform.rotation = rotation_2d;
});
}Sourcepub fn from_scale_angle_translation(
scale: Vec2,
angle: f32,
translation: Vec2,
) -> Mat3
pub fn from_scale_angle_translation( scale: Vec2, angle: f32, translation: Vec2, ) -> Mat3
Creates an affine transformation matrix from the given 2D scale, rotation angle (in
radians) and translation.
The resulting matrix can be used to transform 2D points and vectors. See
Self::transform_point2() and Self::transform_vector2().
Sourcepub fn from_scale(scale: Vec2) -> Mat3
pub fn from_scale(scale: Vec2) -> Mat3
Creates an affine transformation matrix from the given non-uniform 2D scale.
The resulting matrix can be used to transform 2D points and vectors. See
Self::transform_point2() and Self::transform_vector2().
§Panics
Will panic if all elements of scale are zero when glam_assert is enabled.
Sourcepub fn from_mat2(m: Mat2) -> Mat3
pub fn from_mat2(m: Mat2) -> Mat3
Creates an affine transformation matrix from the given 2x2 matrix.
The resulting matrix can be used to transform 2D points and vectors. See
Self::transform_point2() and Self::transform_vector2().
Sourcepub const fn from_cols_slice(slice: &[f32]) -> Mat3
pub const fn from_cols_slice(slice: &[f32]) -> Mat3
Creates a 3x3 matrix from the first 9 values in slice.
§Panics
Panics if slice is less than 9 elements long.
Sourcepub fn write_cols_to_slice(self, slice: &mut [f32])
pub fn write_cols_to_slice(self, slice: &mut [f32])
Writes the columns of self to the first 9 elements in slice.
§Panics
Panics if slice is less than 9 elements long.
Sourcepub fn col_mut(&mut self, index: usize) -> &mut Vec3
pub fn col_mut(&mut self, index: usize) -> &mut Vec3
Returns a mutable reference to the matrix column for the given index.
§Panics
Panics if index is greater than 2.
Sourcepub fn is_finite(&self) -> bool
pub fn is_finite(&self) -> bool
Returns true if, and only if, all elements are finite.
If any element is either NaN, positive or negative infinity, this will return false.
Sourcepub fn determinant(&self) -> f32
pub fn determinant(&self) -> f32
Returns the determinant of self.
Sourcepub fn inverse(&self) -> Mat3
pub fn inverse(&self) -> Mat3
Returns the inverse of self.
If the matrix is not invertible the returned matrix will be invalid.
§Panics
Will panic if the determinant of self is zero when glam_assert is enabled.
Sourcepub fn transform_point2(&self, rhs: Vec2) -> Vec2
pub fn transform_point2(&self, rhs: Vec2) -> Vec2
Transforms the given 2D vector as a point.
This is the equivalent of multiplying rhs as a 3D vector where z is 1.
This method assumes that self contains a valid affine transform.
§Panics
Will panic if the 2nd row of self is not (0, 0, 1) when glam_assert is enabled.
Sourcepub fn transform_vector2(&self, rhs: Vec2) -> Vec2
pub fn transform_vector2(&self, rhs: Vec2) -> Vec2
Rotates the given 2D vector.
This is the equivalent of multiplying rhs as a 3D vector where z is 0.
This method assumes that self contains a valid affine transform.
§Panics
Will panic if the 2nd row of self is not (0, 0, 1) when glam_assert is enabled.
Sourcepub fn mul_scalar(&self, rhs: f32) -> Mat3
pub fn mul_scalar(&self, rhs: f32) -> Mat3
Multiplies a 3x3 matrix by a scalar.
Sourcepub fn div_scalar(&self, rhs: f32) -> Mat3
pub fn div_scalar(&self, rhs: f32) -> Mat3
Divides a 3x3 matrix by a scalar.
Sourcepub fn abs_diff_eq(&self, rhs: Mat3, max_abs_diff: f32) -> bool
pub fn abs_diff_eq(&self, rhs: Mat3, max_abs_diff: f32) -> bool
Returns true if the absolute difference of all elements between self and rhs
is less than or equal to max_abs_diff.
This can be used to compare if two matrices contain similar elements. It works best
when comparing with a known value. The max_abs_diff that should be used used
depends on the values being compared against.
For more see comparing floating point numbers.
pub fn as_dmat3(&self) -> DMat3
Trait Implementations§
Source§impl AddAssign for Mat3
impl AddAssign for Mat3
Source§fn add_assign(&mut self, rhs: Mat3)
fn add_assign(&mut self, rhs: Mat3)
+= operation. Read moreSource§impl AsMutMatrixParts<f32, 3, 3> for Mat3
impl AsMutMatrixParts<f32, 3, 3> for Mat3
Source§impl AsRefMatrixParts<f32, 3, 3> for Mat3
impl AsRefMatrixParts<f32, 3, 3> for Mat3
Source§impl CreateFrom for Mat3where
Mat3: ShaderType<ExtraMetadata = MatrixMetadata> + FromMatrixParts<f32, 3, 3>,
f32: MatrixScalar + CreateFrom,
impl CreateFrom for Mat3where
Mat3: ShaderType<ExtraMetadata = MatrixMetadata> + FromMatrixParts<f32, 3, 3>,
f32: MatrixScalar + CreateFrom,
Source§impl<'de> Deserialize<'de> for Mat3
Deserialize expects a sequence of 9 values.
impl<'de> Deserialize<'de> for Mat3
Deserialize expects a sequence of 9 values.
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Mat3, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Mat3, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl DivAssign<f32> for Mat3
impl DivAssign<f32> for Mat3
Source§fn div_assign(&mut self, rhs: f32)
fn div_assign(&mut self, rhs: f32)
/= operation. Read moreSource§impl FromReflect for Mat3
impl FromReflect for Mat3
Source§fn from_reflect(reflect: &(dyn PartialReflect + 'static)) -> Option<Mat3>
fn from_reflect(reflect: &(dyn PartialReflect + 'static)) -> Option<Mat3>
Self from a reflected value.Source§fn take_from_reflect(
reflect: Box<dyn PartialReflect>,
) -> Result<Self, Box<dyn PartialReflect>>
fn take_from_reflect( reflect: Box<dyn PartialReflect>, ) -> Result<Self, Box<dyn PartialReflect>>
Self using,
constructing the value using from_reflect if that fails. Read moreSource§impl GetOwnership for &Mat3
impl GetOwnership for &Mat3
Source§impl GetOwnership for &mut Mat3
impl GetOwnership for &mut Mat3
Source§impl GetOwnership for Mat3
impl GetOwnership for Mat3
Source§impl GetTypeRegistration for Mat3
impl GetTypeRegistration for Mat3
Source§fn get_type_registration() -> TypeRegistration
fn get_type_registration() -> TypeRegistration
TypeRegistration for this type.Source§fn register_type_dependencies(registry: &mut TypeRegistry)
fn register_type_dependencies(registry: &mut TypeRegistry)
Source§impl IntoReturn for &Mat3
impl IntoReturn for &Mat3
Source§impl IntoReturn for &mut Mat3
impl IntoReturn for &mut Mat3
Source§impl IntoReturn for Mat3
impl IntoReturn for Mat3
Source§impl MulAssign<f32> for Mat3
impl MulAssign<f32> for Mat3
Source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
*= operation. Read moreSource§impl MulAssign for Mat3
impl MulAssign for Mat3
Source§fn mul_assign(&mut self, rhs: Mat3)
fn mul_assign(&mut self, rhs: Mat3)
*= operation. Read moreSource§impl PartialReflect for Mat3
impl PartialReflect for Mat3
Source§fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
Source§fn clone_value(&self) -> Box<dyn PartialReflect>
fn clone_value(&self) -> Box<dyn PartialReflect>
Reflect trait object. Read moreSource§fn try_apply(
&mut self,
value: &(dyn PartialReflect + 'static),
) -> Result<(), ApplyError>
fn try_apply( &mut self, value: &(dyn PartialReflect + 'static), ) -> Result<(), ApplyError>
Source§fn reflect_kind(&self) -> ReflectKind
fn reflect_kind(&self) -> ReflectKind
Source§fn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_ref(&self) -> ReflectRef<'_>
Source§fn reflect_mut(&mut self) -> ReflectMut<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
Source§fn reflect_owned(self: Box<Mat3>) -> ReflectOwned
fn reflect_owned(self: Box<Mat3>) -> ReflectOwned
Source§fn try_into_reflect(
self: Box<Mat3>,
) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
fn try_into_reflect( self: Box<Mat3>, ) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
Source§fn try_as_reflect(&self) -> Option<&(dyn Reflect + 'static)>
fn try_as_reflect(&self) -> Option<&(dyn Reflect + 'static)>
Source§fn try_as_reflect_mut(&mut self) -> Option<&mut (dyn Reflect + 'static)>
fn try_as_reflect_mut(&mut self) -> Option<&mut (dyn Reflect + 'static)>
Source§fn into_partial_reflect(self: Box<Mat3>) -> Box<dyn PartialReflect>
fn into_partial_reflect(self: Box<Mat3>) -> Box<dyn PartialReflect>
Source§fn as_partial_reflect(&self) -> &(dyn PartialReflect + 'static)
fn as_partial_reflect(&self) -> &(dyn PartialReflect + 'static)
Source§fn as_partial_reflect_mut(&mut self) -> &mut (dyn PartialReflect + 'static)
fn as_partial_reflect_mut(&mut self) -> &mut (dyn PartialReflect + 'static)
Source§fn reflect_partial_eq(
&self,
value: &(dyn PartialReflect + 'static),
) -> Option<bool>
fn reflect_partial_eq( &self, value: &(dyn PartialReflect + 'static), ) -> Option<bool>
Source§fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Source§fn apply(&mut self, value: &(dyn PartialReflect + 'static))
fn apply(&mut self, value: &(dyn PartialReflect + 'static))
Source§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
Source§fn serializable(&self) -> Option<Serializable<'_>>
fn serializable(&self) -> Option<Serializable<'_>>
Source§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
Source§impl ReadFrom for Mat3where
Mat3: ShaderType<ExtraMetadata = MatrixMetadata> + AsMutMatrixParts<f32, 3, 3>,
f32: MatrixScalar + ReadFrom,
impl ReadFrom for Mat3where
Mat3: ShaderType<ExtraMetadata = MatrixMetadata> + AsMutMatrixParts<f32, 3, 3>,
f32: MatrixScalar + ReadFrom,
Source§impl Reflect for Mat3
impl Reflect for Mat3
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut dyn Any. Read moreSource§fn into_reflect(self: Box<Mat3>) -> Box<dyn Reflect>
fn into_reflect(self: Box<Mat3>) -> Box<dyn Reflect>
Source§fn as_reflect(&self) -> &(dyn Reflect + 'static)
fn as_reflect(&self) -> &(dyn Reflect + 'static)
Source§fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)
fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)
Source§impl Serialize for Mat3
Serialize as a sequence of 9 values.
impl Serialize for Mat3
Serialize as a sequence of 9 values.
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Source§impl ShaderSize for Mat3where
f32: ShaderSize,
impl ShaderSize for Mat3where
f32: ShaderSize,
Source§const SHADER_SIZE: NonZero<u64> = _
const SHADER_SIZE: NonZero<u64> = _
ShaderType::min_size)Source§impl ShaderType for Mat3where
f32: ShaderSize,
impl ShaderType for Mat3where
f32: ShaderSize,
Source§fn assert_uniform_compat()
fn assert_uniform_compat()
Self meets the requirements of the
uniform address space restrictions on stored values and the
uniform address space layout constraints Read moreSource§impl Struct for Mat3
impl Struct for Mat3
Source§fn field(&self, name: &str) -> Option<&(dyn PartialReflect + 'static)>
fn field(&self, name: &str) -> Option<&(dyn PartialReflect + 'static)>
name as a &dyn PartialReflect.Source§fn field_mut(
&mut self,
name: &str,
) -> Option<&mut (dyn PartialReflect + 'static)>
fn field_mut( &mut self, name: &str, ) -> Option<&mut (dyn PartialReflect + 'static)>
name as a
&mut dyn PartialReflect.Source§fn field_at(&self, index: usize) -> Option<&(dyn PartialReflect + 'static)>
fn field_at(&self, index: usize) -> Option<&(dyn PartialReflect + 'static)>
index as a
&dyn PartialReflect.Source§fn field_at_mut(
&mut self,
index: usize,
) -> Option<&mut (dyn PartialReflect + 'static)>
fn field_at_mut( &mut self, index: usize, ) -> Option<&mut (dyn PartialReflect + 'static)>
index
as a &mut dyn PartialReflect.Source§fn name_at(&self, index: usize) -> Option<&str>
fn name_at(&self, index: usize) -> Option<&str>
index.Source§fn iter_fields(&self) -> FieldIter<'_> ⓘ
fn iter_fields(&self) -> FieldIter<'_> ⓘ
Source§fn clone_dynamic(&self) -> DynamicStruct
fn clone_dynamic(&self) -> DynamicStruct
DynamicStruct.Source§fn get_represented_struct_info(&self) -> Option<&'static StructInfo>
fn get_represented_struct_info(&self) -> Option<&'static StructInfo>
None if TypeInfo is not available.Source§impl SubAssign for Mat3
impl SubAssign for Mat3
Source§fn sub_assign(&mut self, rhs: Mat3)
fn sub_assign(&mut self, rhs: Mat3)
-= operation. Read moreSource§impl TypePath for Mat3
impl TypePath for Mat3
Source§fn type_path() -> &'static str
fn type_path() -> &'static str
Source§fn short_type_path() -> &'static str
fn short_type_path() -> &'static str
Source§fn type_ident() -> Option<&'static str>
fn type_ident() -> Option<&'static str>
Source§fn crate_name() -> Option<&'static str>
fn crate_name() -> Option<&'static str>
Source§impl WriteInto for Mat3where
Mat3: ShaderType<ExtraMetadata = MatrixMetadata> + AsRefMatrixParts<f32, 3, 3>,
f32: MatrixScalar + WriteInto,
impl WriteInto for Mat3where
Mat3: ShaderType<ExtraMetadata = MatrixMetadata> + AsRefMatrixParts<f32, 3, 3>,
f32: MatrixScalar + WriteInto,
fn write_into<B>(&self, writer: &mut Writer<B>)where
B: BufferMut,
impl Copy for Mat3
impl Pod for Mat3
Auto Trait Implementations§
impl Freeze for Mat3
impl RefUnwindSafe for Mat3
impl Send for Mat3
impl Sync for Mat3
impl Unpin for Mat3
impl UnwindSafe for Mat3
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DynamicTypePath for Twhere
T: TypePath,
impl<T> DynamicTypePath for Twhere
T: TypePath,
Source§fn reflect_type_path(&self) -> &str
fn reflect_type_path(&self) -> &str
TypePath::type_path.Source§fn reflect_short_type_path(&self) -> &str
fn reflect_short_type_path(&self) -> &str
Source§fn reflect_type_ident(&self) -> Option<&str>
fn reflect_type_ident(&self) -> Option<&str>
TypePath::type_ident.Source§fn reflect_crate_name(&self) -> Option<&str>
fn reflect_crate_name(&self) -> Option<&str>
TypePath::crate_name.Source§fn reflect_module_path(&self) -> Option<&str>
fn reflect_module_path(&self) -> Option<&str>
Source§impl<T> DynamicTyped for Twhere
T: Typed,
impl<T> DynamicTyped for Twhere
T: Typed,
Source§fn reflect_type_info(&self) -> &'static TypeInfo
fn reflect_type_info(&self) -> &'static TypeInfo
Typed::type_info.Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<S> GetField for Swhere
S: Struct,
impl<S> GetField for Swhere
S: Struct,
Source§impl<T> GetPath for T
impl<T> GetPath for T
Source§fn reflect_path<'p>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>
fn reflect_path<'p>( &self, path: impl ReflectPath<'p>, ) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>
path. Read moreSource§fn reflect_path_mut<'p>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>
fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>
path. Read moreSource§fn path<'p, T>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
fn path<'p, T>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
path. Read moreSource§fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
path. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.