11 #ifndef CUBBYFLOW_SURFACE_HPP 12 #define CUBBYFLOW_SURFACE_HPP 28 double distance = std::numeric_limits<double>::max();
43 bool isNormalFlipped =
false);
73 [[nodiscard]]
double ClosestDistance(
86 virtual void UpdateQueryEngine();
89 [[nodiscard]]
virtual bool IsBounded()
const;
92 [[nodiscard]]
virtual bool IsValidGeometry()
const;
102 bool isNormalFlipped =
false;
124 [[nodiscard]]
virtual bool IntersectsLocal(
const Ray<double, N>& ray)
const;
128 [[nodiscard]]
virtual double ClosestDistanceLocal(
133 [[nodiscard]]
virtual bool IsInsideLocal(
152 template <
size_t N,
typename DerivedBuilder>
157 DerivedBuilder& WithIsNormalFlipped(
bool isNormalFlipped);
163 DerivedBuilder& WithOrientation(
const Orientation<N>& orientation);
166 DerivedBuilder& WithTransform(
const Transform<N>& transform);
169 bool m_isNormalFlipped =
false;
173 template <
size_t N,
typename T>
176 m_isNormalFlipped = isNormalFlipped;
177 return static_cast<T&
>(*this);
180 template <
size_t N,
typename T>
184 m_transform.SetTranslation(translation);
185 return static_cast<T&
>(*this);
188 template <
size_t N,
typename T>
191 m_transform.SetOrientation(orientation);
192 return static_cast<T&
>(*this);
195 template <
size_t N,
typename T>
198 m_transform = transform;
199 return static_cast<T&
>(*this);
202 template <
typename T>
205 template <
typename T>
Class for N-D ray.
Definition: Ray.hpp:25
DerivedBuilder & WithTranslation(const Vector< double, N > &translation)
Returns builder with translation.
Definition: Surface.hpp:181
Vector< double, N > point
Definition: Surface.hpp:29
Definition: Matrix.hpp:27
Definition: pybind11Utils.hpp:20
Abstract base class for N-D surface.
Definition: Surface.hpp:38
std::shared_ptr< Surface3 > Surface3Ptr
Shared pointer for the Surface3 type.
Definition: Surface.hpp:147
Transform< N > m_transform
Definition: Surface.hpp:170
Struct that represents ray-surface intersection point.
Definition: Surface.hpp:25
Definition: Transform.hpp:22
DerivedBuilder & WithTransform(const Transform< N > &transform)
Returns builder with transform.
Definition: Surface.hpp:196
Transform< N > transform
Local-to-world transform.
Definition: Surface.hpp:99
double distance
Definition: Surface.hpp:28
std::shared_ptr< Surface2 > Surface2Ptr
Shared pointer for the Surface2 type.
Definition: Surface.hpp:144
Vector< double, N > normal
Definition: Surface.hpp:30
Base class for N-D surface builder.
Definition: Surface.hpp:153
DerivedBuilder & WithOrientation(const Orientation< N > &orientation)
Returns builder with orientation.
Definition: Surface.hpp:189
bool isIntersecting
Definition: Surface.hpp:27
DerivedBuilder & WithIsNormalFlipped(bool isNormalFlipped)
Returns builder with flipped normal flag.
Definition: Surface.hpp:174