Go to the documentation of this file.
7 #ifndef INCLUDE_JET_SURFACE3_H_
8 #define INCLUDE_JET_SURFACE3_H_
89 const Ray3D& ray)
const = 0;
114 template <
typename DerivedBuilder>
134 template <
typename T>
136 _isNormalFlipped = isNormalFlipped;
137 return static_cast<T&
>(*this);
140 template <
typename T>
142 _transform.setTranslation(translation);
143 return static_cast<T&
>(*this);
146 template <
typename T>
148 _transform.setOrientation(orientation);
149 return static_cast<T&
>(*this);
152 template <
typename T>
154 _transform = transform;
155 return static_cast<T&
>(*this);
160 #endif // INCLUDE_JET_SURFACE3_H_
DerivedBuilder & withTranslation(const Vector3D &translation)
Returns builder with translation.
Definition: surface3.h:141
double distance
Definition: surface3.h:21
virtual bool isBounded() const
Returns true if bounding box can be defined.
bool isInside(const Vector3D &otherPoint) const
virtual bool isInsideLocal(const Vector3D &otherPoint) const
virtual double closestDistanceLocal(const Vector3D &otherPoint) const
Vector3D closestPoint(const Vector3D &otherPoint) const
virtual BoundingBox3D boundingBoxLocal() const =0
Returns the bounding box of this surface object in local frame.
virtual void updateQueryEngine()
Updates internal spatial query engine.
3-D axis-aligned bounding box class.
Definition: bounding_box3.h:41
double closestDistance(const Vector3D &otherPoint) const
bool _isNormalFlipped
Definition: surface3.h:130
Base class for 3-D surface builder.
Definition: surface3.h:115
virtual ~Surface3()
Default destructor.
Surface3(const Transform3 &transform=Transform3(), bool isNormalFlipped=false)
Constructs a surface with normal direction.
bool isNormalFlipped
Flips normal when calling Surface3::closestNormal(...).
Definition: surface3.h:33
std::shared_ptr< Surface3 > Surface3Ptr
Shared pointer for the Surface3 type.
Definition: surface3.h:109
Vector3D closestNormal(const Vector3D &otherPoint) const
Definition: advection_solver2.h:18
virtual SurfaceRayIntersection3 closestIntersectionLocal(const Ray3D &ray) const =0
Returns the closest intersection point for given ray in local frame.
DerivedBuilder & withTransform(const Transform3 &transform)
Returns builder with transform.
Definition: surface3.h:153
SurfaceRayIntersection3 closestIntersection(const Ray3D &ray) const
Returns the closest intersection point for given ray.
virtual Vector3D closestPointLocal(const Vector3D &otherPoint) const =0
virtual Vector3D closestNormalLocal(const Vector3D &otherPoint) const =0
Transform3 transform
Local-to-world transform.
Definition: surface3.h:30
Class for 2-D ray.
Definition: ray3.h:21
DerivedBuilder & withIsNormalFlipped(bool isNormalFlipped)
Returns builder with flipped normal flag.
Definition: surface3.h:135
Transform3 _transform
Definition: surface3.h:131
constexpr double kMaxD
Max double.
Definition: constants.h:88
Vector3D normal
Definition: surface3.h:23
Struct that represents ray-surface intersection point.
Definition: surface3.h:19
bool intersects(const Ray3D &ray) const
Returns true if the given ray intersects with this surface object.
virtual bool intersectsLocal(const Ray3D &ray) const
bool isIntersecting
Definition: surface3.h:20
3-D vector class.
Definition: vector3.h:25
Vector3D point
Definition: surface3.h:22
BoundingBox3D boundingBox() const
Returns the bounding box of this surface object.
DerivedBuilder & withOrientation(const QuaternionD &orientation)
Returns builder with orientation.
Definition: surface3.h:147
Abstract base class for 3-D surface.
Definition: surface3.h:27
virtual bool isValidGeometry() const
Returns true if the surface is a valid geometry.
Surface3(const Surface3 &other)
Copy constructor.