]> git.tdb.fi Git - libs/game.git/commitdiff
Add some useful constructors for TransformValues
authorMikko Rasa <tdb@tdb.fi>
Sat, 12 Nov 2022 15:34:32 +0000 (17:34 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 12 Nov 2022 15:34:32 +0000 (17:34 +0200)
source/game/transform.h

index 603076024adbdd27c2aa659cd5c805c320fa0d51..05c895b42e949b42e2e2c328a6dd72b3fca90e5d 100644 (file)
@@ -13,6 +13,13 @@ struct TransformValues
        LinAl::Vector<float, 3> position;
        Geometry::Quaternion<float> rotation = Geometry::Quaternion<float>::one();
        LinAl::Vector<float, 3> scale = { 1.0f, 1.0f, 1.0f };
+
+       TransformValues() = default;
+       TransformValues(const LinAl::Vector<float, 3> &p): position(p) { }
+       TransformValues(const LinAl::Vector<float, 3> &p, const Geometry::Quaternion<float> &r,
+               const LinAl::Vector<float, 3> &s = LinAl::Vector<float, 3>(1.0f, 1.0f, 1.0f)):
+               position(p), rotation(r), scale(s)
+       { }
 };
 
 class Transform: public Component