coal  3.0.1
Coal, The Collision Detection Library. Previously known as HPP-FCL, fork of FCL -- The Flexible Collision Library
coal::KDOP< N > Class Template Reference

KDOP class describes the KDOP collision structures. K is set as the template parameter, which should be 16, 18, or 24 The KDOP structure is defined by some pairs of parallel planes defined by some axes. For K = 16, the planes are 6 AABB planes and 10 diagonal planes that cut off some space of the edges: (-1,0,0) and (1,0,0) -> indices 0 and 8 (0,-1,0) and (0,1,0) -> indices 1 and 9 (0,0,-1) and (0,0,1) -> indices 2 and 10 (-1,-1,0) and (1,1,0) -> indices 3 and 11 (-1,0,-1) and (1,0,1) -> indices 4 and 12 (0,-1,-1) and (0,1,1) -> indices 5 and 13 (-1,1,0) and (1,-1,0) -> indices 6 and 14 (-1,0,1) and (1,0,-1) -> indices 7 and 15 For K = 18, the planes are 6 AABB planes and 12 diagonal planes that cut off some space of the edges: (-1,0,0) and (1,0,0) -> indices 0 and 9 (0,-1,0) and (0,1,0) -> indices 1 and 10 (0,0,-1) and (0,0,1) -> indices 2 and 11 (-1,-1,0) and (1,1,0) -> indices 3 and 12 (-1,0,-1) and (1,0,1) -> indices 4 and 13 (0,-1,-1) and (0,1,1) -> indices 5 and 14 (-1,1,0) and (1,-1,0) -> indices 6 and 15 (-1,0,1) and (1,0,-1) -> indices 7 and 16 (0,-1,1) and (0,1,-1) -> indices 8 and 17 For K = 18, the planes are 6 AABB planes and 18 diagonal planes that cut off some space of the edges: (-1,0,0) and (1,0,0) -> indices 0 and 12 (0,-1,0) and (0,1,0) -> indices 1 and 13 (0,0,-1) and (0,0,1) -> indices 2 and 14 (-1,-1,0) and (1,1,0) -> indices 3 and 15 (-1,0,-1) and (1,0,1) -> indices 4 and 16 (0,-1,-1) and (0,1,1) -> indices 5 and 17 (-1,1,0) and (1,-1,0) -> indices 6 and 18 (-1,0,1) and (1,0,-1) -> indices 7 and 19 (0,-1,1) and (0,1,-1) -> indices 8 and 20 (-1, -1, 1) and (1, 1, -1) --> indices 9 and 21 (-1, 1, -1) and (1, -1, 1) --> indices 10 and 22 (1, -1, -1) and (-1, 1, 1) --> indices 11 and 23. More...

#include <coal/BV/kDOP.h>

Inheritance diagram for coal::KDOP< N >:

Public Member Functions

 KDOP ()
 Creating kDOP containing nothing. More...
 
 KDOP (const Vec3s &v)
 Creating kDOP containing only one point. More...
 
 KDOP (const Vec3s &a, const Vec3s &b)
 Creating kDOP containing two points. More...
 
bool operator== (const KDOP &other) const
 Equality operator. More...
 
bool operator!= (const KDOP &other) const
 Difference operator. More...
 
bool overlap (const KDOP &other) const
 Check whether two KDOPs overlap. More...
 
bool overlap (const KDOP &other, const CollisionRequest &request, Scalar &sqrDistLowerBound) const
 Check whether two KDOPs overlap. More...
 
Scalar distance (const KDOP &other, Vec3s *P=NULL, Vec3s *Q=NULL) const
 The distance between two KDOP, Not implemented. More...
 
KDOPoperator+= (const Vec3s &p)
 Merge the point and the KDOP. More...
 
KDOPoperator+= (const KDOP &other)
 Merge two KDOPs. More...
 
KDOP< N > operator+ (const KDOP &other) const
 Create a KDOP by mergin two KDOPs. More...
 
Scalar size () const
 Size of the kDOP (used in BV_Splitter to order two kDOPs) More...
 
Vec3s center () const
 The (AABB) center. More...
 
Scalar width () const
 The (AABB) width. More...
 
Scalar height () const
 The (AABB) height. More...
 
Scalar depth () const
 The (AABB) depth. More...
 
Scalar volume () const
 The (AABB) volume. More...
 
Scalar dist (short i) const
 
Scalardist (short i)
 
bool inside (const Vec3s &p) const
 

Protected Attributes

Eigen::Array< Scalar, N, 1 > dist_
 Origin's distances to N KDOP planes. More...
 

Detailed Description

template<short N>
class coal::KDOP< N >

KDOP class describes the KDOP collision structures. K is set as the template parameter, which should be 16, 18, or 24 The KDOP structure is defined by some pairs of parallel planes defined by some axes. For K = 16, the planes are 6 AABB planes and 10 diagonal planes that cut off some space of the edges: (-1,0,0) and (1,0,0) -> indices 0 and 8 (0,-1,0) and (0,1,0) -> indices 1 and 9 (0,0,-1) and (0,0,1) -> indices 2 and 10 (-1,-1,0) and (1,1,0) -> indices 3 and 11 (-1,0,-1) and (1,0,1) -> indices 4 and 12 (0,-1,-1) and (0,1,1) -> indices 5 and 13 (-1,1,0) and (1,-1,0) -> indices 6 and 14 (-1,0,1) and (1,0,-1) -> indices 7 and 15 For K = 18, the planes are 6 AABB planes and 12 diagonal planes that cut off some space of the edges: (-1,0,0) and (1,0,0) -> indices 0 and 9 (0,-1,0) and (0,1,0) -> indices 1 and 10 (0,0,-1) and (0,0,1) -> indices 2 and 11 (-1,-1,0) and (1,1,0) -> indices 3 and 12 (-1,0,-1) and (1,0,1) -> indices 4 and 13 (0,-1,-1) and (0,1,1) -> indices 5 and 14 (-1,1,0) and (1,-1,0) -> indices 6 and 15 (-1,0,1) and (1,0,-1) -> indices 7 and 16 (0,-1,1) and (0,1,-1) -> indices 8 and 17 For K = 18, the planes are 6 AABB planes and 18 diagonal planes that cut off some space of the edges: (-1,0,0) and (1,0,0) -> indices 0 and 12 (0,-1,0) and (0,1,0) -> indices 1 and 13 (0,0,-1) and (0,0,1) -> indices 2 and 14 (-1,-1,0) and (1,1,0) -> indices 3 and 15 (-1,0,-1) and (1,0,1) -> indices 4 and 16 (0,-1,-1) and (0,1,1) -> indices 5 and 17 (-1,1,0) and (1,-1,0) -> indices 6 and 18 (-1,0,1) and (1,0,-1) -> indices 7 and 19 (0,-1,1) and (0,1,-1) -> indices 8 and 20 (-1, -1, 1) and (1, 1, -1) --> indices 9 and 21 (-1, 1, -1) and (1, -1, 1) --> indices 10 and 22 (1, -1, -1) and (-1, 1, 1) --> indices 11 and 23.

Constructor & Destructor Documentation

◆ KDOP() [1/3]

template<short N>
coal::KDOP< N >::KDOP ( )

Creating kDOP containing nothing.

◆ KDOP() [2/3]

template<short N>
coal::KDOP< N >::KDOP ( const Vec3s v)

Creating kDOP containing only one point.

◆ KDOP() [3/3]

template<short N>
coal::KDOP< N >::KDOP ( const Vec3s a,
const Vec3s b 
)

Creating kDOP containing two points.

Member Function Documentation

◆ center()

template<short N>
Vec3s coal::KDOP< N >::center ( ) const
inline

The (AABB) center.

◆ depth()

template<short N>
Scalar coal::KDOP< N >::depth ( ) const
inline

The (AABB) depth.

◆ dist() [1/2]

template<short N>
Scalar& coal::KDOP< N >::dist ( short  i)
inline

◆ dist() [2/2]

template<short N>
Scalar coal::KDOP< N >::dist ( short  i) const
inline

◆ distance()

template<short N>
Scalar coal::KDOP< N >::distance ( const KDOP< N > &  other,
Vec3s P = NULL,
Vec3s Q = NULL 
) const

The distance between two KDOP, Not implemented.

◆ height()

template<short N>
Scalar coal::KDOP< N >::height ( ) const
inline

The (AABB) height.

◆ inside()

template<short N>
bool coal::KDOP< N >::inside ( const Vec3s p) const

◆ operator!=()

template<short N>
bool coal::KDOP< N >::operator!= ( const KDOP< N > &  other) const
inline

Difference operator.

◆ operator+()

template<short N>
KDOP<N> coal::KDOP< N >::operator+ ( const KDOP< N > &  other) const

Create a KDOP by mergin two KDOPs.

◆ operator+=() [1/2]

template<short N>
KDOP& coal::KDOP< N >::operator+= ( const KDOP< N > &  other)

Merge two KDOPs.

◆ operator+=() [2/2]

template<short N>
KDOP& coal::KDOP< N >::operator+= ( const Vec3s p)

Merge the point and the KDOP.

◆ operator==()

template<short N>
bool coal::KDOP< N >::operator== ( const KDOP< N > &  other) const
inline

Equality operator.

◆ overlap() [1/2]

template<short N>
bool coal::KDOP< N >::overlap ( const KDOP< N > &  other) const

Check whether two KDOPs overlap.

◆ overlap() [2/2]

template<short N>
bool coal::KDOP< N >::overlap ( const KDOP< N > &  other,
const CollisionRequest request,
Scalar sqrDistLowerBound 
) const

Check whether two KDOPs overlap.

Returns
true if collision happens.
Return values
sqrDistLowerBoundsquared lower bound on distance between boxes if they do not overlap.

◆ size()

template<short N>
Scalar coal::KDOP< N >::size ( ) const
inline

Size of the kDOP (used in BV_Splitter to order two kDOPs)

◆ volume()

template<short N>
Scalar coal::KDOP< N >::volume ( ) const
inline

The (AABB) volume.

◆ width()

template<short N>
Scalar coal::KDOP< N >::width ( ) const
inline

The (AABB) width.

Member Data Documentation

◆ dist_

template<short N>
Eigen::Array<Scalar, N, 1> coal::KDOP< N >::dist_
protected

Origin's distances to N KDOP planes.


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