Trait veloren_world::site2::gen::PrimitiveTransform
source · 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.
Object Safety§
This trait is not object safe.