From b96cb40157a0514b21efa43838bfdc016b89c946 Mon Sep 17 00:00:00 2001 From: Maximilian Reininghaus <maximilian.reininghaus@kit.edu> Date: Fri, 3 Jul 2020 15:32:18 +0200 Subject: [PATCH] new constructor for CoordinateSystem from given transfomation matrix --- Framework/Geometry/CoordinateSystem.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Framework/Geometry/CoordinateSystem.h b/Framework/Geometry/CoordinateSystem.h index 64e51167e..0f4e007eb 100644 --- a/Framework/Geometry/CoordinateSystem.h +++ b/Framework/Geometry/CoordinateSystem.h @@ -31,10 +31,6 @@ namespace corsika::geometry { CoordinateSystem const* reference = nullptr; EigenTransform transf; - CoordinateSystem(CoordinateSystem const& reference, EigenTransform const& transf) - : reference(&reference) - , transf(transf) {} - CoordinateSystem() : // for creating the root CS transf(EigenTransform::Identity()) {} @@ -48,6 +44,10 @@ namespace corsika::geometry { static EigenTransform GetTransformation(CoordinateSystem const& c1, CoordinateSystem const& c2); + CoordinateSystem(CoordinateSystem const& reference, EigenTransform const& transf) + : reference(&reference) + , transf(transf) {} + auto& operator=(const CoordinateSystem& pCS) { reference = pCS.reference; transf = pCS.transf; @@ -60,6 +60,9 @@ namespace corsika::geometry { return CoordinateSystem(*this, translation); } + /** + * creates a new CS in which vVec points in direction of the new z-axis + */ template <typename TDim> auto RotateToZ(Vector<TDim> vVec) const { auto const a = vVec.normalized().GetComponents(*this).eVector; -- GitLab