![]() |
Abstract base class to calculate intersections between an Octree and other shapes. More...
#include <SurgSim/Collision/OctreeContact.h>
Classes | |
class | Vector3dHash |
Enable a Vector3d to be used as a key in an unordered map. More... | |
Protected Member Functions | |
virtual std::list< std::shared_ptr< Contact > > | boxContactCalculation (const SurgSim::Math::BoxShape &boxShape, const SurgSim::Math::RigidTransform3d &boxPose, const SurgSim::Math::Shape &otherShape, const SurgSim::Math::RigidTransform3d &otherPose)=0 |
Do the calculation between an octree node (BoxShape) and the other shape. More... | |
Private Member Functions | |
std::list< std::shared_ptr< Contact > > | doCalculateDcdContact (const Math::PosedShape< std::shared_ptr< Math::Shape >> &posedShape1, const Math::PosedShape< std::shared_ptr< Math::Shape >> &posedShape2) override |
Virtual function receives the call from the public interface, usually will type the shapes statically to their known types and then execute a specific contact calculation between the two shapes. More... | |
void | calculateContactWithNode (std::shared_ptr< const SurgSim::Math::OctreeShape::NodeType > node, Math::RigidTransform3d octreePose, const std::shared_ptr< Math::Shape > &shape, const Math::RigidTransform3d &shapePose, SurgSim::DataStructures::OctreePath *nodePath, std::list< std::shared_ptr< Contact >> *result) |
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 | |
std::unordered_map< SurgSim::Math::Vector3d, std::shared_ptr< SurgSim::Math::BoxShape >, Vector3dHash > | m_shapes |
The shapes used for the contact calculations are cached for performance. More... | |
Additional Inherited Members | |
![]() | |
typedef std::array< std::array< std::shared_ptr< ContactCalculation >, Math::SHAPE_TYPE_COUNT >, Math::SHAPE_TYPE_COUNT > | TableType |
![]() | |
ContactCalculation () | |
Constructor. More... | |
virtual | ~ContactCalculation () |
Destructor. More... | |
void | calculateContact (std::shared_ptr< CollisionPair > pair) |
Calculate the contacts for a given pair. More... | |
std::list< std::shared_ptr< Contact > > | calculateDcdContact (const Math::PosedShape< std::shared_ptr< Math::Shape >> posedShape1, const Math::PosedShape< std::shared_ptr< Math::Shape >> posedShape2) |
Calculate the dcd contacts between two posed/transformed shapes. More... | |
std::list< std::shared_ptr< Contact > > | calculateCcdContact (const Math::PosedShapeMotion< std::shared_ptr< Math::Shape >> posedShapeMotion1, const Math::PosedShapeMotion< std::shared_ptr< Math::Shape >> posedShapeMotion2) |
Calculate the ccd contacts between two posed/transformed shapes. More... | |
virtual std::pair< int, int > | getShapeTypes ()=0 |
Virtual function that returns the shapes that this ContactCalculation class handles. More... | |
![]() | |
static void | registerDcdContactCalculation (const std::shared_ptr< ContactCalculation > &calculation) |
Register an instance of a contact calculation in the table. More... | |
static void | registerCcdContactCalculation (const std::shared_ptr< ContactCalculation > &calculation) |
Register an instance of a contact calculation in the table. More... | |
static const TableType & | getDcdContactTable () |
static const TableType & | getCcdContactTable () |
Abstract base class to calculate intersections between an Octree and other shapes.
Derived classes handle the calculation for specific shape types (ie OctreeSphereContact).
|
protectedpure virtual |
Do the calculation between an octree node (BoxShape) and the other shape.
boxShape | the box shape |
boxPose | the pose of the box |
otherShape | the other shape |
otherPose | the pose of the other shape |
Implemented in SurgSim::Collision::OctreeSphereContact, SurgSim::Collision::OctreePlaneContact, SurgSim::Collision::OctreeDoubleSidedPlaneContact, and SurgSim::Collision::OctreeCapsuleContact.
|
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.
node | the octree node to collide with |
octreePose | the pose of the octree shape |
shape | the shape that the octree is colliding with |
shapePose | the pose of the shape |
nodePath | the NodePath of the current octree node |
result | [in,out] all generated contacts are agreggated here |
nodePath | [in,out] the path of the current node |
|
overrideprivatevirtual |
Virtual function receives the call from the public interface, usually will type the shapes statically to their known types and then execute a specific contact calculation between the two shapes.
posedShape1,posedShape2 | The two posed shapes to calculate dcd contact for |
Reimplemented from SurgSim::Collision::ContactCalculation.
|
private |
The shapes used for the contact calculations are cached for performance.