diff --git a/include/vsg/maths/transform.h b/include/vsg/maths/transform.h index bd979e79b..a07b1a131 100644 --- a/include/vsg/maths/transform.h +++ b/include/vsg/maths/transform.h @@ -263,10 +263,12 @@ namespace vsg /// usage: auto matrix = vsg::visit(nodePath).matrix; struct VSG_DECLSPEC ComputeTransform : public ConstVisitor { + dvec3 origin; dmat4 matrix; void apply(const Transform& transform) override; void apply(const MatrixTransform& mt) override; + void apply(const CoordinateFrame& cf) override; void apply(const Camera& camera) override; }; diff --git a/src/vsg/maths/maths_transform.cpp b/src/vsg/maths/maths_transform.cpp index f7b8074a0..24a8e17ea 100644 --- a/src/vsg/maths/maths_transform.cpp +++ b/src/vsg/maths/maths_transform.cpp @@ -14,6 +14,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #include #include #include +#include using namespace vsg; @@ -441,6 +442,12 @@ void ComputeTransform::apply(const MatrixTransform& mt) matrix = matrix * mt.matrix; } +void ComputeTransform::apply(const CoordinateFrame& cf) +{ + origin = cf.origin; + matrix = vsg::rotate(cf.rotation); +} + void ComputeTransform::apply(const Camera& camera) { if (camera.viewMatrix)