coal 3.0.2
Coal, The Collision Detection Library. Previously known as HPP-FCL, fork of FCL -- The Flexible Collision Library
Loading...
Searching...
No Matches
Construction of BVHModel

Classes

struct  coal::BVNodeBase
 BVNodeBase encodes the tree structure for BVH. More...
struct  coal::BVNode< BV >
 A class describing a bounding volume node. It includes the tree structure providing in BVNodeBase and also the geometry data provided in BV template parameter. More...
class  coal::BVFitter< BV >
 The class for the default algorithm fitting a bounding volume to a set of points. More...
class  coal::BVSplitter< BV >
 A class describing the split rule that splits each BV node. More...
class  coal::BVHModelBase
 A base class describing the bounding hierarchy of a mesh model or a point cloud model (which is viewed as a degraded version of mesh) More...
class  coal::BVHModel< BV >
 A class describing the bounding hierarchy of a mesh model or a point cloud model (which is viewed as a degraded version of mesh) More...
class  coal::CollisionGeometry
 The geometry for the object for collision or distance computation. More...
class  coal::CollisionObject
 the object for collision or distance computation, contains the geometry and the transform information More...

Typedefs

typedef BVNodeBase coal::BVNode< BV >::Base

Functions

 coal::BVNodeBase::BVNodeBase ()
 Default constructor.
bool coal::BVNodeBase::operator== (const BVNodeBase &other) const
 Equality operator.
bool coal::BVNodeBase::operator!= (const BVNodeBase &other) const
 Difference operator.
bool coal::BVNodeBase::isLeaf () const
 Whether current node is a leaf node (i.e. contains a primitive index.
int coal::BVNodeBase::primitiveId () const
 Return the primitive index. The index is referred to the original data (i.e. vertices or tri_indices) in BVHModel.
int coal::BVNodeBase::leftChild () const
 Return the index of the first child. The index is referred to the bounding volume array (i.e. bvs) in BVHModel.
int coal::BVNodeBase::rightChild () const
 Return the index of the second child. The index is referred to the bounding volume array (i.e. bvs) in BVHModel.
bool coal::BVNode< BV >::operator== (const BVNode &other) const
 Equality operator.
bool coal::BVNode< BV >::operator!= (const BVNode &other) const
 Difference operator.
bool coal::BVNode< BV >::overlap (const BVNode &other) const
 Check whether two BVNode collide.
bool coal::BVNode< BV >::overlap (const BVNode &other, const CollisionRequest &request, CoalScalar &sqrDistLowerBound) const
 Check whether two BVNode collide.
CoalScalar coal::BVNode< BV >::distance (const BVNode &other, Vec3s *P1=NULL, Vec3s *P2=NULL) const
 Compute the distance between two BVNode. P1 and P2, if not NULL and the underlying BV supports distance, return the nearest points.
Vec3s coal::BVNode< BV >::getCenter () const
 Access to the center of the BV.
const Matrix3scoal::BVNode< BV >::getOrientation () const
 Access to the orientation of the BV.
 coal::CollisionGeometry::CollisionGeometry ()
 coal::CollisionGeometry::CollisionGeometry (const CollisionGeometry &other)=default
 Copy constructor.
virtual coal::CollisionGeometry::~CollisionGeometry ()
virtual CollisionGeometrycoal::CollisionGeometry::clone () const =0
 Clone *this into a new CollisionGeometry.
bool coal::CollisionGeometry::operator== (const CollisionGeometry &other) const
 Equality operator.
bool coal::CollisionGeometry::operator!= (const CollisionGeometry &other) const
 Difference operator.
virtual OBJECT_TYPE coal::CollisionGeometry::getObjectType () const
 get the type of the object
virtual NODE_TYPE coal::CollisionGeometry::getNodeType () const
 get the node type
virtual void coal::CollisionGeometry::computeLocalAABB ()=0
 compute the AABB for object in local coordinate
void * coal::CollisionGeometry::getUserData () const
 get user data in geometry
void coal::CollisionGeometry::setUserData (void *data)
 set user data in geometry
bool coal::CollisionGeometry::isOccupied () const
 whether the object is completely occupied
bool coal::CollisionGeometry::isFree () const
 whether the object is completely free
bool coal::CollisionGeometry::isUncertain () const
 whether the object has some uncertainty
virtual Vec3s coal::CollisionGeometry::computeCOM () const
 compute center of mass
virtual Matrix3s coal::CollisionGeometry::computeMomentofInertia () const
 compute the inertia matrix, related to the origin
virtual CoalScalar coal::CollisionGeometry::computeVolume () const
 compute the volume
virtual Matrix3s coal::CollisionGeometry::computeMomentofInertiaRelatedToCOM () const
 compute the inertia matrix, related to the com
 coal::CollisionObject::CollisionObject (const shared_ptr< CollisionGeometry > &cgeom_, bool compute_local_aabb=true)
 coal::CollisionObject::CollisionObject (const shared_ptr< CollisionGeometry > &cgeom_, const Transform3s &tf, bool compute_local_aabb=true)
 coal::CollisionObject::CollisionObject (const shared_ptr< CollisionGeometry > &cgeom_, const Matrix3s &R, const Vec3s &T, bool compute_local_aabb=true)
bool coal::CollisionObject::operator== (const CollisionObject &other) const
bool coal::CollisionObject::operator!= (const CollisionObject &other) const
 coal::CollisionObject::~CollisionObject ()
OBJECT_TYPE coal::CollisionObject::getObjectType () const
 get the type of the object
NODE_TYPE coal::CollisionObject::getNodeType () const
 get the node type
const AABBcoal::CollisionObject::getAABB () const
 get the AABB in world space
AABBcoal::CollisionObject::getAABB ()
 get the AABB in world space
void coal::CollisionObject::computeAABB ()
 compute the AABB in world space
void * coal::CollisionObject::getUserData () const
 get user data in object
void coal::CollisionObject::setUserData (void *data)
 set user data in object
const Vec3scoal::CollisionObject::getTranslation () const
 get translation of the object
const Matrix3scoal::CollisionObject::getRotation () const
 get matrix rotation of the object
const Transform3scoal::CollisionObject::getTransform () const
 get object's transform
void coal::CollisionObject::setRotation (const Matrix3s &R)
 set object's rotation matrix
void coal::CollisionObject::setTranslation (const Vec3s &T)
 set object's translation
void coal::CollisionObject::setTransform (const Matrix3s &R, const Vec3s &T)
 set object's transform
void coal::CollisionObject::setTransform (const Transform3s &tf)
 set object's transform
bool coal::CollisionObject::isIdentityTransform () const
 whether the object is in local coordinate
void coal::CollisionObject::setIdentityTransform ()
 set the object in local coordinate
const shared_ptr< const CollisionGeometrycoal::CollisionObject::collisionGeometry () const
 get shared pointer to collision geometry of the object instance
const shared_ptr< CollisionGeometry > & coal::CollisionObject::collisionGeometry ()
 get shared pointer to collision geometry of the object instance
const CollisionGeometrycoal::CollisionObject::collisionGeometryPtr () const
 get raw pointer to collision geometry of the object instance
CollisionGeometrycoal::CollisionObject::collisionGeometryPtr ()
 get raw pointer to collision geometry of the object instance
void coal::CollisionObject::setCollisionGeometry (const shared_ptr< CollisionGeometry > &collision_geometry, bool compute_local_aabb=true)
 Associate a new CollisionGeometry.
void coal::CollisionObject::init (bool compute_local_aabb=true)

Variables

int coal::BVNodeBase::first_child
 An index for first child node or primitive If the value is positive, it is the index of the first child bv node If the value is negative, it is -(primitive index + 1) Zero is not used.
unsigned int coal::BVNodeBase::first_primitive
 The start id the primitive belonging to the current node. The index is referred to the primitive_indices in BVHModel and from that we can obtain the primitive's index in original data indirectly.
unsigned int coal::BVNodeBase::num_primitives
 The number of primitives belonging to the current node.
BV coal::BVNode< BV >::bv
 bounding volume storing the geometry
Vec3s coal::CollisionGeometry::aabb_center
 AABB center in local coordinate.
CoalScalar coal::CollisionGeometry::aabb_radius
 AABB radius.
AABB coal::CollisionGeometry::aabb_local
 AABB in local coordinate, used for tight AABB when only translation transform.
void * coal::CollisionGeometry::user_data
 pointer to user defined data specific to this object
CoalScalar coal::CollisionGeometry::cost_density
 collision cost for unit volume
CoalScalar coal::CollisionGeometry::threshold_occupied
 threshold for occupied ( >= is occupied)
CoalScalar coal::CollisionGeometry::threshold_free
 threshold for free (<= is free)
shared_ptr< CollisionGeometrycoal::CollisionObject::cgeom
Transform3s coal::CollisionObject::t
AABB coal::CollisionObject::aabb
 AABB in global coordinate.
void * coal::CollisionObject::user_data
 pointer to user defined data specific to this object

Detailed Description

Classes which are used to build a BVHModel (Bounding Volume Hierarchy)

Typedef Documentation

◆ Base

template<typename BV>
typedef BVNodeBase coal::BVNode< BV >::Base

Function Documentation

◆ BVNodeBase()

coal::BVNodeBase::BVNodeBase()
inline

Default constructor.

◆ clone()

◆ CollisionGeometry() [1/2]

coal::CollisionGeometry::CollisionGeometry()
inline

◆ CollisionGeometry() [2/2]

coal::CollisionGeometry::CollisionGeometry(const CollisionGeometry &other)
default

Copy constructor.

◆ collisionGeometry() [1/2]

const shared_ptr< CollisionGeometry > & coal::CollisionObject::collisionGeometry()
inline

get shared pointer to collision geometry of the object instance

◆ collisionGeometry() [2/2]

const shared_ptr< const CollisionGeometry > coal::CollisionObject::collisionGeometry()const
inline

get shared pointer to collision geometry of the object instance

◆ collisionGeometryPtr() [1/2]

CollisionGeometry * coal::CollisionObject::collisionGeometryPtr()
inline

get raw pointer to collision geometry of the object instance

◆ collisionGeometryPtr() [2/2]

const CollisionGeometry * coal::CollisionObject::collisionGeometryPtr()const
inline

get raw pointer to collision geometry of the object instance

◆ CollisionObject() [1/3]

coal::CollisionObject::CollisionObject(const shared_ptr< CollisionGeometry > &cgeom_,
boolcompute_local_aabb = true )
inline

◆ CollisionObject() [2/3]

coal::CollisionObject::CollisionObject(const shared_ptr< CollisionGeometry > &cgeom_,
const Matrix3s &R,
const Vec3s &T,
boolcompute_local_aabb = true )
inline

◆ CollisionObject() [3/3]

coal::CollisionObject::CollisionObject(const shared_ptr< CollisionGeometry > &cgeom_,
const Transform3s &tf,
boolcompute_local_aabb = true )
inline

◆ computeAABB()

void coal::CollisionObject::computeAABB()
inline

compute the AABB in world space

◆ computeCOM()

virtual Vec3s coal::CollisionGeometry::computeCOM()const
inlinevirtual

compute center of mass

Reimplemented in coal::BVHModelBase, coal::Cone, coal::Convex< PolygonT >, and coal::HeightField< BV >.

◆ computeLocalAABB()

virtual void coal::CollisionGeometry::computeLocalAABB()
pure virtual

◆ computeMomentofInertia()

virtual Matrix3s coal::CollisionGeometry::computeMomentofInertia()const
inlinevirtual

◆ computeMomentofInertiaRelatedToCOM()

virtual Matrix3s coal::CollisionGeometry::computeMomentofInertiaRelatedToCOM()const
inlinevirtual

compute the inertia matrix, related to the com

◆ computeVolume()

virtual CoalScalar coal::CollisionGeometry::computeVolume()const
inlinevirtual

◆ distance()

template<typename BV>
CoalScalar coal::BVNode< BV >::distance(const BVNode< BV > &other,
Vec3s *P1 = NULL,
Vec3s *P2 = NULL ) const
inline

Compute the distance between two BVNode. P1 and P2, if not NULL and the underlying BV supports distance, return the nearest points.

◆ getAABB() [1/2]

AABB & coal::CollisionObject::getAABB()
inline

get the AABB in world space

◆ getAABB() [2/2]

const AABB & coal::CollisionObject::getAABB()const
inline

get the AABB in world space

◆ getCenter()

template<typename BV>
Vec3s coal::BVNode< BV >::getCenter()const
inline

Access to the center of the BV.

◆ getNodeType() [1/2]

◆ getNodeType() [2/2]

NODE_TYPE coal::CollisionObject::getNodeType()const
inline

get the node type

◆ getObjectType() [1/2]

virtual OBJECT_TYPE coal::CollisionGeometry::getObjectType()const
inlinevirtual

get the type of the object

Reimplemented in coal::BVHModelBase, coal::HeightField< BV >, coal::OcTree, and coal::ShapeBase.

◆ getObjectType() [2/2]

OBJECT_TYPE coal::CollisionObject::getObjectType()const
inline

get the type of the object

◆ getOrientation()

template<typename BV>
const Matrix3s & coal::BVNode< BV >::getOrientation()const
inline

Access to the orientation of the BV.

◆ getRotation()

const Matrix3s & coal::CollisionObject::getRotation()const
inline

get matrix rotation of the object

◆ getTransform()

const Transform3s & coal::CollisionObject::getTransform()const
inline

get object's transform

◆ getTranslation()

const Vec3s & coal::CollisionObject::getTranslation()const
inline

get translation of the object

◆ getUserData() [1/2]

void * coal::CollisionGeometry::getUserData()const
inline

get user data in geometry

◆ getUserData() [2/2]

void * coal::CollisionObject::getUserData()const
inline

get user data in object

◆ init()

void coal::CollisionObject::init(boolcompute_local_aabb = true)
inlineprotected

◆ isFree()

bool coal::CollisionGeometry::isFree()const
inline

whether the object is completely free

◆ isIdentityTransform()

bool coal::CollisionObject::isIdentityTransform()const
inline

whether the object is in local coordinate

◆ isLeaf()

bool coal::BVNodeBase::isLeaf()const
inline

Whether current node is a leaf node (i.e. contains a primitive index.

◆ isOccupied()

bool coal::CollisionGeometry::isOccupied()const
inline

whether the object is completely occupied

◆ isUncertain()

bool coal::CollisionGeometry::isUncertain()const

whether the object has some uncertainty

◆ leftChild()

int coal::BVNodeBase::leftChild()const
inline

Return the index of the first child. The index is referred to the bounding volume array (i.e. bvs) in BVHModel.

◆ operator!=() [1/4]

template<typename BV>
bool coal::BVNode< BV >::operator!=(const BVNode< BV > &other)const
inline

Difference operator.

◆ operator!=() [2/4]

bool coal::BVNodeBase::operator!=(const BVNodeBase &other)const
inline

Difference operator.

◆ operator!=() [3/4]

bool coal::CollisionGeometry::operator!=(const CollisionGeometry &other)const
inline

Difference operator.

◆ operator!=() [4/4]

bool coal::CollisionObject::operator!=(const CollisionObject &other)const
inline

◆ operator==() [1/4]

template<typename BV>
bool coal::BVNode< BV >::operator==(const BVNode< BV > &other)const
inline

Equality operator.

◆ operator==() [2/4]

bool coal::BVNodeBase::operator==(const BVNodeBase &other)const
inline

Equality operator.

◆ operator==() [3/4]

bool coal::CollisionGeometry::operator==(const CollisionGeometry &other)const
inline

Equality operator.

◆ operator==() [4/4]

bool coal::CollisionObject::operator==(const CollisionObject &other)const
inline

◆ overlap() [1/2]

template<typename BV>
bool coal::BVNode< BV >::overlap(const BVNode< BV > &other)const
inline

Check whether two BVNode collide.

◆ overlap() [2/2]

template<typename BV>
bool coal::BVNode< BV >::overlap(const BVNode< BV > &other,
const CollisionRequest &request,
CoalScalar &sqrDistLowerBound ) const
inline

Check whether two BVNode collide.

◆ primitiveId()

int coal::BVNodeBase::primitiveId()const
inline

Return the primitive index. The index is referred to the original data (i.e. vertices or tri_indices) in BVHModel.

◆ rightChild()

int coal::BVNodeBase::rightChild()const
inline

Return the index of the second child. The index is referred to the bounding volume array (i.e. bvs) in BVHModel.

◆ setCollisionGeometry()

void coal::CollisionObject::setCollisionGeometry(const shared_ptr< CollisionGeometry > &collision_geometry,
boolcompute_local_aabb = true )
inline

Associate a new CollisionGeometry.

Parameters
[in]collision_geometryThe new CollisionGeometry
[in]compute_local_aabbWhether the local aabb of the input new has to be computed.

◆ setIdentityTransform()

void coal::CollisionObject::setIdentityTransform()
inline

set the object in local coordinate

◆ setRotation()

void coal::CollisionObject::setRotation(const Matrix3s &R)
inline

set object's rotation matrix

◆ setTransform() [1/2]

void coal::CollisionObject::setTransform(const Matrix3s &R,
const Vec3s &T )
inline

set object's transform

◆ setTransform() [2/2]

void coal::CollisionObject::setTransform(const Transform3s &tf)
inline

set object's transform

◆ setTranslation()

void coal::CollisionObject::setTranslation(const Vec3s &T)
inline

set object's translation

◆ setUserData() [1/2]

void coal::CollisionGeometry::setUserData(void *data)
inline

set user data in geometry

◆ setUserData() [2/2]

void coal::CollisionObject::setUserData(void *data)
inline

set user data in object

◆ ~CollisionGeometry()

virtual coal::CollisionGeometry::~CollisionGeometry()
inlinevirtual

◆ ~CollisionObject()

coal::CollisionObject::~CollisionObject()
inline

Variable Documentation

◆ aabb

AABB coal::CollisionObject::aabb
mutableprotected

AABB in global coordinate.

◆ aabb_center

Vec3s coal::CollisionGeometry::aabb_center

AABB center in local coordinate.

◆ aabb_local

AABB coal::CollisionGeometry::aabb_local

AABB in local coordinate, used for tight AABB when only translation transform.

◆ aabb_radius

CoalScalar coal::CollisionGeometry::aabb_radius

AABB radius.

◆ bv

template<typename BV>
BV coal::BVNode< BV >::bv

bounding volume storing the geometry

◆ cgeom

shared_ptr<CollisionGeometry> coal::CollisionObject::cgeom
protected

◆ cost_density

CoalScalar coal::CollisionGeometry::cost_density

collision cost for unit volume

◆ first_child

int coal::BVNodeBase::first_child

An index for first child node or primitive If the value is positive, it is the index of the first child bv node If the value is negative, it is -(primitive index + 1) Zero is not used.

◆ first_primitive

unsigned int coal::BVNodeBase::first_primitive

The start id the primitive belonging to the current node. The index is referred to the primitive_indices in BVHModel and from that we can obtain the primitive's index in original data indirectly.

◆ num_primitives

unsigned int coal::BVNodeBase::num_primitives

The number of primitives belonging to the current node.

◆ t

Transform3s coal::CollisionObject::t
protected

◆ threshold_free

CoalScalar coal::CollisionGeometry::threshold_free

threshold for free (<= is free)

◆ threshold_occupied

CoalScalar coal::CollisionGeometry::threshold_occupied

threshold for occupied ( >= is occupied)

◆ user_data [1/2]

void* coal::CollisionGeometry::user_data

pointer to user defined data specific to this object

◆ user_data [2/2]

void* coal::CollisionObject::user_data
protected

pointer to user defined data specific to this object