geomc 1.0
A c++ linear algebra template library
Loading...
Searching...
No Matches
AnyConvex< T, N > Class Template Referenceabstract

Helper class which virtualizes the static polymorphism of Convex shapes. More...

#include <geomc/shape/Shape.h>

Inheritance diagram for AnyConvex< T, N >:
Convex< T, N, AnyConvex< T, N > > Bounded< T, N, AnyConvex< T, N > > Dimensional< T, N >

Public Types

using elem_t
 The coordinate type of this object.
 
using point_t
 The type of a point in this object's space.
 

Public Member Functions

Rect< T, Nbounds () const
 
point_t convex_support (point_t d) const
 
bool intersects (const Convex< T, N, Shape > &other) const
 Convex shape overlap test.
 

Static Public Attributes

static constexpr index_t N
 The dimension of this object.
 

Protected Member Functions

virtual Rect< T, N_impl_bounds () const =0
 
virtual point_t _impl_convex_support (Vec< T, N > p) const =0
 

Detailed Description

template<typename T, index_t N>
class geom::AnyConvex< T, N >

Helper class which virtualizes the static polymorphism of Convex shapes.

This allows the various Shape classes to interoperate with pointers in specific cases where it's needed. An example is in the implementation of gjk_intersect(Shape1, Shape2), which should not instantiate a template for each combination of shape classes.

To convert a shape to an AnyConvex, call the convenience function as_any_convex(Shape).

Member Typedef Documentation

◆ point_t

using point_t
inherited

The type of a point in this object's space.

An N-vector of T if N > 1, otherwise a T.

Member Function Documentation

◆ intersects()

bool intersects ( const Convex< T, N, Shape > & other) const
inlineinherited

Convex shape overlap test.

Returns
True if and only if this convex shape overlaps other; false otherwise.

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