pub struct Transform { /* private fields */ }
Implementations§
Source§impl Transform
impl Transform
Sourcepub fn new() -> Self
pub fn new() -> Self
Begins a new transformation
Note: The transformation starts as an identity matrix
Sourcepub fn translate(self, x: f32, y: f32, z: f32) -> Self
pub fn translate(self, x: f32, y: f32, z: f32) -> Self
Adds a translation transformation
§Arguments
-
x
- Amount by which to move on the x-axis -
y
- Amount by which to move on the y-axis -
z
- Amount by which to move on the z-axis
Sourcepub fn scale(self, x: f32, y: f32, z: f32) -> Self
pub fn scale(self, x: f32, y: f32, z: f32) -> Self
Adds a scale transformation
§Arguments
-
x
- Amount by which to scale on the x-axis -
y
- Amount by which to scale on the y-axis -
z
- Amount by which to scale on the z-axis
Sourcepub fn rotate(self, x: f32, y: f32, z: f32) -> Self
pub fn rotate(self, x: f32, y: f32, z: f32) -> Self
Adds a rotation transformation
§Arguments
-
x
- Amount by which to rotate on the x-axis -
y
- Amount by which to rotate on the y-axis -
z
- Amount by which to rotate on the z-axis
Sourcepub fn orthographic(self, width: f32, height: f32, depth: f32) -> [[f32; 4]; 4]
pub fn orthographic(self, width: f32, height: f32, depth: f32) -> [[f32; 4]; 4]
Adds an orthographic projection transformation
§Arguments
-
width
- Size of the view on the x-axis -
height
- Size of the view on the y-axis -
depth
- Size of the view on the z-axis
Note: This is the last step of the transformation and returns the matrix