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 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§

source

fn translate(self, trans: Vec3<i32>) -> Self

Translates the primitive along the vector trans.

source

fn rotate_about( self, rot: Mat3<i32>, point: Vec3<impl AsPrimitive<f32>> ) -> Self

Rotates the primitive about the given point of the primitive by multiplying each block position by the provided rotation matrix.

source

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.

source

fn repeat(self, offset: Vec3<i32>, count: u32) -> Self

Returns a PrimitiveRef of the primitive in addition to the same primitive translated by offset and repeated count times, each time translated by an additional offset.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a, const N: usize> PrimitiveTransform for [PrimitiveRef<'a>; N]

source§

fn translate(self, trans: Vec3<i32>) -> Self

source§

fn rotate_about( self, rot: Mat3<i32>, point: Vec3<impl AsPrimitive<f32>> ) -> Self

source§

fn scale(self, scale: Vec3<impl AsPrimitive<f32>>) -> Self

source§

fn repeat(self, offset: Vec3<i32>, count: u32) -> Self

Implementors§