geomc 1.0
A c++ linear algebra template library
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
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, Derived >

Public Types

typedef PointType< T, N >::point_t point_t
 
typedef T elem_t
 The coordinate type of this shape.
 

Public Member Functions

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

Static Public Attributes

static constexpr size_t N = _N
 The dimension of this shape.
 

Protected Member Functions

virtual point_t _impl_convex_support (Vec< T, N > p) const =0
 
virtual Rect< T, N_impl_bounds () 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 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: