Struct adi_screen::Transform
[−]
[src]
#[must_use]pub struct Transform(_);
Transform represents a transformation matrix.
Methods
impl Transform
[src]
fn create() -> Transform
Create a transform that does nothing. ( Underneath, this is an identity matrix ).
fn translate(self, x: f32, y: f32, z: f32) -> Transform
Translate self by x, y and z.
fn scale(self, x: f32, y: f32, z: f32) -> Transform
Scale self by x, y and z.
fn rotate(self, yaw: f32, pitch: f32, roll: f32) -> Transform
Rotate self by yaw, pitch and roll.
fn perspective(self, window: &Window, fov: f32) -> TransformApply
Apply perspective with fov degrees for field of view. Note: The return value is TransformApply.
fn orthographic(self, window: &Window) -> TransformApply
Apply an orthographic projection ( depth doesn't change x and y position ). Note: The return value is TransformApply.
fn auto(self, window: &mut Window, pos: (f32, f32)) -> TransformApply
Multiply by a projection that scales width and height by the smallest widget size. The widget is put at position pos. Position isn't affected by aspect ratio.