2-D implicit surface wrapper for generic Surface2 instance. More...

#include <Core/Surface/SurfaceToImplicit2.h>

Inheritance diagram for CubbyFlow::SurfaceToImplicit2:
CubbyFlow::ImplicitSurface2 CubbyFlow::Surface2

Classes

class  Builder
 Front-end to create SurfaceToImplicit2 objects step by step. More...
 

Public Member Functions

 SurfaceToImplicit2 (const Surface2Ptr &surface, const Transform2 &transform=Transform2(), bool isNormalFlipped=false)
 Constructs an instance with generic Surface2 instance. More...
 
 SurfaceToImplicit2 (const SurfaceToImplicit2 &other)
 Copy constructor. More...
 
Surface2Ptr GetSurface () const
 Returns the raw surface instance. More...
 
- Public Member Functions inherited from CubbyFlow::ImplicitSurface2
 ImplicitSurface2 (const Transform2 &transform=Transform2(), bool isNormalFlipped=false)
 Default constructor. More...
 
 ImplicitSurface2 (const ImplicitSurface2 &other)
 Copy constructor. More...
 
virtual ~ImplicitSurface2 ()
 Default destructor. More...
 
double SignedDistance (const Vector2D &otherPoint) const
 Returns signed distance from the given point otherPoint. More...
 
- Public Member Functions inherited from CubbyFlow::Surface2
 Surface2 (const Transform2 &transform=Transform2(), bool isNormalFlipped=false)
 Constructs a surface with normal direction. More...
 
 Surface2 (const Surface2 &other)
 Copy constructor. More...
 
virtual ~Surface2 ()
 Default destructor. More...
 
Vector2D ClosestPoint (const Vector2D &otherPoint) const
 Returns the closest point from the given point otherPoint to the surface. More...
 
BoundingBox2D BoundingBox () const
 Returns the bounding box of this surface object. More...
 
bool Intersects (const Ray2D &ray) const
 Returns true if the given ray intersects with this surface object. More...
 
double ClosestDistance (const Vector2D &otherPoint) const
 
SurfaceRayIntersection2 ClosestIntersection (const Ray2D &ray) const
 Returns the closest intersection point for given ray. More...
 
Vector2D ClosestNormal (const Vector2D &otherPoint) const
 
virtual void UpdateQueryEngine ()
 Updates internal spatial query engine. More...
 

Static Public Member Functions

static Builder GetBuilder ()
 Returns builder for SurfaceToImplicit2. More...
 

Protected Member Functions

Vector2D ClosestPointLocal (const Vector2D &otherPoint) const override
 
double ClosestDistanceLocal (const Vector2D &otherPoint) const override
 
bool IntersectsLocal (const Ray2D &ray) const override
 
BoundingBox2D BoundingBoxLocal () const override
 Returns the bounding box of this surface object in local frame. More...
 
Vector2D ClosestNormalLocal (const Vector2D &otherPoint) const override
 
double SignedDistanceLocal (const Vector2D &otherPoint) const override
 Returns signed distance from the given point otherPoint in local space. More...
 
SurfaceRayIntersection2 ClosestIntersectionLocal (const Ray2D &ray) const override
 Returns the closest intersection point for given ray in local frame. More...
 

Additional Inherited Members

- Public Attributes inherited from CubbyFlow::Surface2
Transform2 transform
 Local-to-world transform. More...
 
bool isNormalFlipped = false
 Flips normal. More...
 

Detailed Description

2-D implicit surface wrapper for generic Surface2 instance.

This class represents 2-D implicit surface that converts Surface2 instance to an ImplicitSurface2 object. The conversion is made by evaluating closest point and normal from a given point for the given (explicit) surface. Thus, this conversion won't work for every single surfaces. Use this class only for the basic primitives such as Sphere2 or Box2.

Constructor & Destructor Documentation

◆ SurfaceToImplicit2() [1/2]

CubbyFlow::SurfaceToImplicit2::SurfaceToImplicit2 ( const Surface2Ptr surface,
const Transform2 transform = Transform2(),
bool  isNormalFlipped = false 
)

Constructs an instance with generic Surface2 instance.

◆ SurfaceToImplicit2() [2/2]

CubbyFlow::SurfaceToImplicit2::SurfaceToImplicit2 ( const SurfaceToImplicit2 other)

Copy constructor.

Member Function Documentation

◆ BoundingBoxLocal()

BoundingBox2D CubbyFlow::SurfaceToImplicit2::BoundingBoxLocal ( ) const
overrideprotectedvirtual

Returns the bounding box of this surface object in local frame.

Implements CubbyFlow::Surface2.

◆ ClosestDistanceLocal()

double CubbyFlow::SurfaceToImplicit2::ClosestDistanceLocal ( const Vector2D otherPoint) const
overrideprotectedvirtual

Returns the closest distance from the given point otherPoint to the point on the surface in local frame.

Reimplemented from CubbyFlow::ImplicitSurface2.

◆ ClosestIntersectionLocal()

SurfaceRayIntersection2 CubbyFlow::SurfaceToImplicit2::ClosestIntersectionLocal ( const Ray2D ray) const
overrideprotectedvirtual

Returns the closest intersection point for given ray in local frame.

Implements CubbyFlow::Surface2.

◆ ClosestNormalLocal()

Vector2D CubbyFlow::SurfaceToImplicit2::ClosestNormalLocal ( const Vector2D otherPoint) const
overrideprotectedvirtual

Returns the normal to the closest point on the surface from the given point otherPoint in local frame.

Implements CubbyFlow::Surface2.

◆ ClosestPointLocal()

Vector2D CubbyFlow::SurfaceToImplicit2::ClosestPointLocal ( const Vector2D otherPoint) const
overrideprotectedvirtual

Returns the closest point from the given point otherPoint to the surface in local frame.

Implements CubbyFlow::Surface2.

◆ GetBuilder()

static Builder CubbyFlow::SurfaceToImplicit2::GetBuilder ( )
static

Returns builder for SurfaceToImplicit2.

◆ GetSurface()

Surface2Ptr CubbyFlow::SurfaceToImplicit2::GetSurface ( ) const

Returns the raw surface instance.

◆ IntersectsLocal()

bool CubbyFlow::SurfaceToImplicit2::IntersectsLocal ( const Ray2D ray) const
overrideprotectedvirtual

Returns true if the given ray intersects with this surface object in local frame.

Reimplemented from CubbyFlow::Surface2.

◆ SignedDistanceLocal()

double CubbyFlow::SurfaceToImplicit2::SignedDistanceLocal ( const Vector2D otherPoint) const
overrideprotectedvirtual

Returns signed distance from the given point otherPoint in local space.

Implements CubbyFlow::ImplicitSurface2.


The documentation for this class was generated from the following file: