SphereSphereContact.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013-2015, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_COLLISION_SPHERESPHERECONTACT_H
17 #define SURGSIM_COLLISION_SPHERESPHERECONTACT_H
18 
19 #include <memory>
20 
23 
24 namespace SurgSim
25 {
26 namespace Collision
27 {
28 
29 class CollisionPair;
30 
32 class SphereSphereContact : public ShapeShapeContactCalculation<Math::SphereShape, Math::SphereShape>
33 {
34 public:
36 
37  std::list<std::shared_ptr<Contact>> calculateDcdContact(
38  const Math::SphereShape& sphere1,
39  const Math::RigidTransform3d& sphere1Pose,
40  const Math::SphereShape& sphere2,
41  const Math::RigidTransform3d& sphere2Pose) const override;
42 
43  std::pair<int, int> getShapeTypes() override;
44 
45 };
46 
47 }; // namespace Collision
48 }; // namespace SurgSim
49 
50 #endif
ShapeShapeContactCalculation.h
SurgSim::Math::RigidTransform3d
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
SurgSim::Collision::SphereSphereContact::calculateDcdContact
std::list< std::shared_ptr< Contact > > calculateDcdContact(const Math::SphereShape &sphere1, const Math::RigidTransform3d &sphere1Pose, const Math::SphereShape &sphere2, const Math::RigidTransform3d &sphere2Pose) const override
Virtual function to be overridden, this provides the typed contact calculation between two shapes it ...
Definition: SphereSphereContact.cpp:32
SurgSim::Collision::SphereSphereContact
Class to calculate intersections between spheres.
Definition: SphereSphereContact.h:32
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Math::SphereShape
Sphere shape: sphere centered on (0 0 0), defined with radius.
Definition: SphereShape.h:30
SurgSim::Collision::SphereSphereContact::getShapeTypes
std::pair< int, int > getShapeTypes() override
Virtual function that returns the shapes that this ContactCalculation class handles.
Definition: SphereSphereContact.cpp:63
SurgSim::Collision::ContactCalculation::calculateDcdContact
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.
Definition: ContactCalculation.cpp:74
SphereShape.h
SurgSim::Collision::ShapeShapeContactCalculation
Class that can automate the type conversion and provides a consistent interface to the typed call Tak...
Definition: ShapeShapeContactCalculation.h:31