summaryrefslogtreecommitdiff
path: root/engine/src/transform.rs
diff options
context:
space:
mode:
Diffstat (limited to 'engine/src/transform.rs')
-rw-r--r--engine/src/transform.rs34
1 files changed, 6 insertions, 28 deletions
diff --git a/engine/src/transform.rs b/engine/src/transform.rs
index f55f44e..ad67d4c 100644
--- a/engine/src/transform.rs
+++ b/engine/src/transform.rs
@@ -6,37 +6,12 @@ use crate::vector::Vec3;
#[derive(Debug, Clone, Component)]
pub struct Transform
{
- position: Vec3<f32>,
- scale: Vec3<f32>,
+ pub position: Vec3<f32>,
+ pub scale: Vec3<f32>,
}
impl Transform
{
- #[must_use]
- pub fn new() -> Self
- {
- Self {
- position: Vec3::default(),
- scale: Vec3 { x: 1.0, y: 1.0, z: 1.0 },
- }
- }
-
- #[must_use]
- pub fn position(&self) -> &Vec3<f32>
- {
- &self.position
- }
-
- pub fn set_position(&mut self, position: Vec3<f32>)
- {
- self.position = position;
- }
-
- pub fn set_scale(&mut self, scale: Vec3<f32>)
- {
- self.scale = scale;
- }
-
pub(crate) fn as_matrix(&self) -> Matrix<f32, 4, 4>
{
let mut matrix = Matrix::new_identity();
@@ -53,6 +28,9 @@ impl Default for Transform
{
fn default() -> Self
{
- Self::new()
+ Self {
+ position: Vec3::default(),
+ scale: Vec3 { x: 1.0, y: 1.0, z: 1.0 },
+ }
}
}