ContactFilter.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013-2016, 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_CONTACTFILTER_H
17 #define SURGSIM_COLLISION_CONTACTFILTER_H
18 
19 
21 
22 #include <string>
23 
24 namespace SurgSim
25 {
26 
27 namespace Physics
28 {
29 class PhysicsManagerState;
30 }
31 
32 namespace Collision
33 {
34 class CollisionPair;
35 
41 {
42 public:
44  explicit ContactFilter(const std::string& name);
45 
49  void filterContacts(
50  const std::shared_ptr<Physics::PhysicsManagerState>& state,
51  const std::shared_ptr<CollisionPair>& pair);
52 
56  void update(double dt);
57 
58 protected:
59 
62  virtual void doFilterContacts(const std::shared_ptr<Physics::PhysicsManagerState>& state,
63  const std::shared_ptr<CollisionPair>& pair) = 0;
64 
65  virtual void doUpdate(double dt) = 0;
66 
67 };
68 
69 }
70 }
71 
72 #endif
SurgSim::Framework::Component
Component is the main interface class to pass information to the system managers each will decide whe...
Definition: Component.h:42
SurgSim::Collision::ContactFilter
Base class to implement a contact filter, the job of this class is to be executed by the ContactFilte...
Definition: ContactFilter.h:40
SurgSim::Collision::ContactFilter::update
void update(double dt)
Base function to update the internal data structures with regard to the filtering operation,...
Definition: ContactFilter.cpp:35
SurgSim::Collision::ContactFilter::doFilterContacts
virtual void doFilterContacts(const std::shared_ptr< Physics::PhysicsManagerState > &state, const std::shared_ptr< CollisionPair > &pair)=0
Override this with the implementation of the filter, this has to be threadsafe, it will be called in ...
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
Component.h
SurgSim::Collision::ContactFilter::filterContacts
void filterContacts(const std::shared_ptr< Physics::PhysicsManagerState > &state, const std::shared_ptr< CollisionPair > &pair)
Base function to filter the contacts on a collision pair this will modify the 'contacts' in the colli...
Definition: ContactFilter.cpp:29
string
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38
SurgSim::Collision::ContactFilter::doUpdate
virtual void doUpdate(double dt)=0
SurgSim::Collision::ContactFilter::ContactFilter
ContactFilter(const std::string &name)
Constructor.
Definition: ContactFilter.cpp:23