27 m_surfaceMaterial(other.m_surfaceMaterial) {}
33 m_associatedLayer(nullptr),
34 m_surfaceMaterial(other.m_surfaceMaterial) {}
43 auto lpResult = globalToLocal(gctx, position, momentum);
45 return bcheck ? bounds().inside(lpResult.value(), bcheck) :
true;
55 (position - center(gctx)).transpose();
57 const auto& rotation =
transform(gctx).rotation();
59 const Vector3D localXAxis = rotation.col(0);
60 const Vector3D localYAxis = rotation.col(1);
61 const Vector3D localZAxis = rotation.col(2);
64 const auto& [rotToLocalXAxis, rotToLocalYAxis, rotToLocalZAxis] =
69 AlignmentToLocalCartesianMatrix::Zero();
74 pcRowVec * rotToLocalXAxis;
76 pcRowVec * rotToLocalYAxis;
78 pcRowVec * rotToLocalZAxis;
82 const auto& loc3DToLocBound =
83 localCartesianToBoundLocalDerivative(gctx, position);
85 const auto& alignToPath =
86 alignmentToPathDerivative(gctx, rotToLocalZAxis, position, direction);
89 initJacobianToLocal(gctx, jacToLocal, position, direction);
97 loc3DToLocBound * alignToLoc3D +
114 (position - center(gctx)).transpose();
116 const auto& rotation =
transform(gctx).rotation();
118 const Vector3D localZAxis = rotation.col(2);
121 const double dirZ = localZAxis.dot(direction);
127 -pcRowVec * rotToLocalZAxis / dirZ;
133 return shared_from_this();
137 return shared_from_this();
141 if (&other !=
this) {
154 if (&other ==
this) {
158 if (other.
type() != type()) {
162 if (other.
bounds() != bounds()) {
184 std::ostream& sl)
const {
185 sl << std::setiosflags(std::ios::fixed);
186 sl << std::setprecision(4);
187 sl <<
name() << std::endl;
188 const Vector3D& sfcenter = center(gctx);
189 sl <<
" Center position (x, y, z) = (" << sfcenter.x() <<
", "
190 << sfcenter.y() <<
", " << sfcenter.z() <<
")" << std::endl;
195 sl << std::setprecision(6);
196 sl <<
" Rotation: colX = (" << rotX(0) <<
", " << rotX(1)
197 <<
", " << rotX(2) <<
")" << std::endl;
198 sl <<
" colY = (" << rotY(0) <<
", " << rotY(1)
199 <<
", " << rotY(2) <<
")" << std::endl;
200 sl <<
" colZ = (" << rotZ(0) <<
", " << rotZ(1)
201 <<
", " << rotZ(2) <<
")" << std::endl;
202 sl <<
" Bounds : " << bounds();
203 sl << std::setprecision(-1);