pub trait Transformable: Send + Sync {
    // Required methods
    fn translate(self, translation: Vec3) -> Self
       where Self: Sized;
    fn rotate(self, origin: Point3, axis: Vec3, angle: f64) -> Self
       where Self: Sized;
    fn rotate_x(self, angle: f64) -> Self
       where Self: Sized;
    fn rotate_y(self, angle: f64) -> Self
       where Self: Sized;
    fn rotate_z(self, angle: f64) -> Self
       where Self: Sized;
    fn scale_x(self, factor: f64) -> Self
       where Self: Sized;
    fn scale_y(self, factor: f64) -> Self
       where Self: Sized;
    fn scale_z(self, factor: f64) -> Self
       where Self: Sized;
    fn scale_xyz(self, scale: Vec3) -> Self
       where Self: Sized;
    fn scale(self, origin: Point3, scale: Vec3) -> Self
       where Self: Sized;
    fn look_at(self, target: Point3, view_up: Vec3) -> Self
       where Self: Sized;
}
Expand description

An interface to easily apply transformations.

Required Methods§

source

fn translate(self, translation: Vec3) -> Self
where Self: Sized,

Translate self by the given translation.

This does not set the position but shifts it.

source

fn rotate(self, origin: Point3, axis: Vec3, angle: f64) -> Self
where Self: Sized,

Rotate self around the specified origin along an arbitrary axis.

angle is assumed to be in radians.

source

fn rotate_x(self, angle: f64) -> Self
where Self: Sized,

Rotate self around its center along the +X axis.

angle is assumed to be in radians.

source

fn rotate_y(self, angle: f64) -> Self
where Self: Sized,

Rotate self around its center along the +Y axis.

angle is assumed to be in radians.

source

fn rotate_z(self, angle: f64) -> Self
where Self: Sized,

Rotate self around its center along the +Z axis.

angle is assumed to be in radians.

source

fn scale_x(self, factor: f64) -> Self
where Self: Sized,

Scale self relative to its center along the +X axis.

source

fn scale_y(self, factor: f64) -> Self
where Self: Sized,

Scale self relative to its center along the +Y axis.

source

fn scale_z(self, factor: f64) -> Self
where Self: Sized,

Scale self relative to its center along the +Z axis.

source

fn scale_xyz(self, scale: Vec3) -> Self
where Self: Sized,

Scale self relative to its center along all 3 dimensions.

source

fn scale(self, origin: Point3, scale: Vec3) -> Self
where Self: Sized,

Scale self relative to the specified origin along all 3 dimensions.

source

fn look_at(self, target: Point3, view_up: Vec3) -> Self
where Self: Sized,

Make self look at specified target.

Implementors§