pub trait PrimitiveTransform {
// Required methods
fn translate(self, trans: Vec3<i32>) -> Self;
fn rotate_about(
self,
rot: Mat3<i32>,
point: Vec3<impl AsPrimitive<f32>>,
) -> Self;
fn rotate_z_90_about(
self,
n: i32,
point: Vec3<impl AsPrimitive<f32>>,
) -> Self;
fn scale(self, scale: Vec3<impl AsPrimitive<f32>>) -> Self;
fn repeat(self, offset: Vec3<i32>, count: u32) -> Self;
}Expand description
A trait to more easily manipulate groups of primitives.
Required Methods§
Sourcefn rotate_about(
self,
rot: Mat3<i32>,
point: Vec3<impl AsPrimitive<f32>>,
) -> Self
fn rotate_about( self, rot: Mat3<i32>, point: Vec3<impl AsPrimitive<f32>>, ) -> Self
Rotates the primitive about the given point by multiplying each block position by the provided rotation matrix.
Sourcefn rotate_z_90_about(self, n: i32, point: Vec3<impl AsPrimitive<f32>>) -> Self
fn rotate_z_90_about(self, n: i32, point: Vec3<impl AsPrimitive<f32>>) -> Self
Rotates the primitive 90 degrees counterclockwise about the given point along the Z axis n times.
Sourcefn scale(self, scale: Vec3<impl AsPrimitive<f32>>) -> Self
fn scale(self, scale: Vec3<impl AsPrimitive<f32>>) -> Self
Scales the primitive along each axis by the x, y, and z components of
the scale vector respectively.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".