X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgame%2Ftransform.h;h=b1766aeb993292d576acb3abf23e7be9ec68fcee;hb=c193dd08af5159544008b5fee0813b1f716ac062;hp=603076024adbdd27c2aa659cd5c805c320fa0d51;hpb=c23855e4ac4a1ed3e20f06c95a28a665b657221c;p=libs%2Fgame.git diff --git a/source/game/transform.h b/source/game/transform.h index 6030760..b1766ae 100644 --- a/source/game/transform.h +++ b/source/game/transform.h @@ -13,14 +13,21 @@ struct TransformValues LinAl::Vector position; Geometry::Quaternion rotation = Geometry::Quaternion::one(); LinAl::Vector scale = { 1.0f, 1.0f, 1.0f }; + + TransformValues() = default; + TransformValues(const LinAl::Vector &p): position(p) { } + TransformValues(const LinAl::Vector &p, const Geometry::Quaternion &r, + const LinAl::Vector &s = LinAl::Vector(1.0f, 1.0f, 1.0f)): + position(p), rotation(r), scale(s) + { } }; class Transform: public Component { private: TransformValues values; - LinAl::Matrix local_matrix; - LinAl::Matrix world_matrix; + LinAl::Matrix local_matrix = LinAl::Matrix::identity(); + LinAl::Matrix world_matrix = LinAl::Matrix::identity(); public: Transform(Handle);