Archicad 28 C++ API
Loading...
Searching...
No Matches
Geometry::GJKResult< VectorType > Class Template Reference

#include <GJK.hpp>

Public Types

enum class  CollisionType { UNDEFINED , COLLISION , NO_COLLISION , COLLISION_NOT_FOUND }
 

Public Member Functions

 operator bool () const
 
bool IsCollided () const
 
bool IsNotFound () const
 
template<typename DistanceType >
bool IsCloser (DistanceType dist) const
 

Static Public Member Functions

static GJKResult Collision ()
 
static GJKResult NoCollision (const VectorType &support, const VectorType &direction)
 
static GJKResult NotFound (const VectorType &support, const VectorType &direction)
 

Detailed Description

template<typename VectorType>
class Geometry::GJKResult< VectorType >

The result of the collision detection.

Member Enumeration Documentation

◆ CollisionType

template<typename VectorType >
enum class Geometry::GJKResult::CollisionType
strong

Enumerates all possible results of the GJK algorithm.

Member Function Documentation

◆ Collision()

template<typename VectorType >
static GJKResult Geometry::GJKResult< VectorType >::Collision ( )
inlinestatic

Creates a GJKResult object with collision result.

Returns
A GJKResult object.

◆ IsCloser()

template<typename VectorType >
template<typename DistanceType >
bool Geometry::GJKResult< VectorType >::IsCloser ( DistanceType  dist) const
inline

Check if objects are closer than the dist parameter.

Parameters
distThe distance.
Returns
True if the distance between objects is closer than the dist parameter.

◆ IsCollided()

template<typename VectorType >
bool Geometry::GJKResult< VectorType >::IsCollided ( ) const
inline

Check if this class contains a collision.

Returns
True if there was a collision.

◆ IsNotFound()

template<typename VectorType >
bool Geometry::GJKResult< VectorType >::IsNotFound ( ) const
inline

Check if any collision was found.

Returns
True if any collision was not found.

◆ NoCollision()

template<typename VectorType >
static GJKResult Geometry::GJKResult< VectorType >::NoCollision ( const VectorType &  support,
const VectorType &  direction 
)
inlinestatic

Creates a GJKResult object with no collision result.

Parameters
supportSupport point.
directionThe direction vector.
Returns
A GJKResult object.

◆ NotFound()

template<typename VectorType >
static GJKResult Geometry::GJKResult< VectorType >::NotFound ( const VectorType &  support,
const VectorType &  direction 
)
inlinestatic

Creates a GJKResult object with collision not found result.

Parameters
supportSupport point.
directionThe direction vector.
Returns
A GJKResult object.

◆ operator bool()

template<typename VectorType >
Geometry::GJKResult< VectorType >::operator bool ( ) const
inline

Check if this class contains a collision.

Returns
True if there was a collision.