Public Member Functions | Private Member Functions | Private Attributes | List of all members
SurgSim::Collision::OctreeDcdContact Class Reference

Class to calculate intersections between an Octree and other shapes. More...

#include <SurgSim/Collision/OctreeDcdContact.h>

Inheritance diagram for SurgSim::Collision::OctreeDcdContact:
SurgSim::Collision::ContactCalculation

Public Member Functions

 OctreeDcdContact (std::shared_ptr< ContactCalculation > calculator)
 Constructor. More...
 
virtual std::pair< int, int > getShapeTypes () override
 Function that returns the shapes between which this class performs collision detection. More...
 
- Public Member Functions inherited from SurgSim::Collision::ContactCalculation
 ContactCalculation ()
 Constructor. More...
 
virtual ~ContactCalculation ()
 Destructor. More...
 
void calculateContact (std::shared_ptr< CollisionPair > pair)
 Function that handles asymmetric pair and calls the actual contact calculation routine of the sub class. More...
 

Private Member Functions

virtual void doCalculateContact (std::shared_ptr< CollisionPair > pair) override
 Calculate the actual contact between two shapes of the given CollisionPair. More...
 
void calculateContactWithNode (std::shared_ptr< const SurgSim::Math::OctreeShape::NodeType > node, std::shared_ptr< CollisionPair > pair, std::shared_ptr< SurgSim::DataStructures::OctreePath > nodePath)
 Calculate the collision between a specific octree node and a shape This function will check for contact between the node and shape. More...
 

Private Attributes

const std::shared_ptr< ContactCalculationm_calculator
 The contact calculator to use on each octree node. More...
 
std::pair< int, int > m_shapeTypes
 The shape types that this contact caculation handles. More...
 
std::shared_ptr< ShapeCollisionRepresentationm_nodeCollisionRepresentation
 Collision Representation used to detect contacts with each octree node. More...
 

Detailed Description

Class to calculate intersections between an Octree and other shapes.

Constructor & Destructor Documentation

SurgSim::Collision::OctreeDcdContact::OctreeDcdContact ( std::shared_ptr< ContactCalculation calculator)
explicit

Constructor.

Parameters
calculatorThe contact calculator to use on each octree node

Member Function Documentation

void SurgSim::Collision::OctreeDcdContact::calculateContactWithNode ( std::shared_ptr< const SurgSim::Math::OctreeShape::NodeType node,
std::shared_ptr< CollisionPair pair,
std::shared_ptr< SurgSim::DataStructures::OctreePath nodePath 
)
private

Calculate the collision between a specific octree node and a shape This function will check for contact between the node and shape.

If contact is found, this function will be called on each of the node's children. Once a leaf node is reached, contacts are added to the CollisionPair.

Parameters
nodethe octree node to collide with
[in,out]pairthe collision pair that is under consideration
nodePaththe path of the current node
void SurgSim::Collision::OctreeDcdContact::doCalculateContact ( std::shared_ptr< CollisionPair pair)
overrideprivatevirtual

Calculate the actual contact between two shapes of the given CollisionPair.

Parameters
pairThe symmetric pair that is under consideration.

Implements SurgSim::Collision::ContactCalculation.

std::pair< int, int > SurgSim::Collision::OctreeDcdContact::getShapeTypes ( )
overridevirtual

Function that returns the shapes between which this class performs collision detection.

Returns
A pair of shape type ids

Implements SurgSim::Collision::ContactCalculation.

Member Data Documentation

const std::shared_ptr<ContactCalculation> SurgSim::Collision::OctreeDcdContact::m_calculator
private

The contact calculator to use on each octree node.

std::shared_ptr<ShapeCollisionRepresentation> SurgSim::Collision::OctreeDcdContact::m_nodeCollisionRepresentation
private

Collision Representation used to detect contacts with each octree node.

std::pair<int, int> SurgSim::Collision::OctreeDcdContact::m_shapeTypes
private

The shape types that this contact caculation handles.


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