Go to the documentation of this file.
7 #ifndef INCLUDE_JET_SURFACE2_H_
8 #define INCLUDE_JET_SURFACE2_H_
89 const Ray2D& 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_SURFACE2_H_
Struct that represents ray-surface intersection point.
Definition: surface2.h:19
bool isNormalFlipped
Flips normal.
Definition: surface2.h:33
virtual ~Surface2()
Default destructor.
Vector2D closestPoint(const Vector2D &otherPoint) const
virtual Vector2D closestPointLocal(const Vector2D &otherPoint) const =0
virtual BoundingBox2D boundingBoxLocal() const =0
Returns the bounding box of this surface object in local frame.
virtual double closestDistanceLocal(const Vector2D &otherPoint) const
double closestDistance(const Vector2D &otherPoint) const
bool _isNormalFlipped
Definition: surface2.h:130
DerivedBuilder & withIsNormalFlipped(bool isNormalFlipped)
Returns builder with flipped normal flag.
Definition: surface2.h:135
Vector2D closestNormal(const Vector2D &otherPoint) const
Class for 2-D ray.
Definition: ray2.h:21
BoundingBox2D boundingBox() const
Returns the bounding box of this surface object.
Vector2D point
Definition: surface2.h:22
bool isIntersecting
Definition: surface2.h:20
virtual bool isValidGeometry() const
Returns true if the surface is a valid geometry.
Surface2(const Transform2 &transform=Transform2(), bool isNormalFlipped=false)
Constructs a surface with normal direction.
Definition: advection_solver2.h:18
Transform2 transform
Local-to-world transform.
Definition: surface2.h:30
SurfaceRayIntersection2 closestIntersection(const Ray2D &ray) const
Returns the closest intersection point for given ray.
std::shared_ptr< Surface2 > Surface2Ptr
Shared pointer for the Surface2 type.
Definition: surface2.h:109
virtual bool intersectsLocal(const Ray2D &ray) const
virtual bool isInsideLocal(const Vector2D &otherPoint) const
Vector2D normal
Definition: surface2.h:23
2-D vector class.
Definition: vector2.h:24
virtual SurfaceRayIntersection2 closestIntersectionLocal(const Ray2D &ray) const =0
Returns the closest intersection point for given ray in local frame.
Base class for 2-D surface builder.
Definition: surface2.h:115
virtual void updateQueryEngine()
Updates internal spatial query engine.
constexpr double kMaxD
Max double.
Definition: constants.h:88
2-D axis-aligned bounding box class.
Definition: bounding_box2.h:41
DerivedBuilder & withOrientation(double orientation)
Returns builder with orientation.
Definition: surface2.h:147
Transform2 _transform
Definition: surface2.h:131
Abstract base class for 2-D surface.
Definition: surface2.h:27
bool intersects(const Ray2D &ray) const
Returns true if the given ray intersects with this surface object.
double distance
Definition: surface2.h:21
virtual bool isBounded() const
Returns true if bounding box can be defined.
bool isInside(const Vector2D &otherPoint) const
DerivedBuilder & withTranslation(const Vector2D &translation)
Returns builder with translation.
Definition: surface2.h:141
Surface2(const Surface2 &other)
Copy constructor.
DerivedBuilder & withTransform(const Transform2 &transform)
Returns builder with transform.
Definition: surface2.h:153
virtual Vector2D closestNormalLocal(const Vector2D &otherPoint) const =0