vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CollisionAppController.h
Go to the documentation of this file.
2 
3 
4 #ifdef COMPILE_PHANTOM_DEVICE
5 
6 
7 #include <vrecko/Ability.h>
9 
10 
11 using namespace vrecko;
12 
13 namespace APHapticCollisionApp {
14 
15 class CollisionAppController: public Ability {
16  public:
17  CollisionAppController();
18  ~CollisionAppController();
19 
20  virtual void preInitialize();
21  virtual void postInitialize();
22  virtual bool loadXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *pParametersNode);
23  virtual void update(void);
24  virtual void *processRequest(const std::string &name, void *data);
25  void processObjectSwitch(bool bRelease);
26  // [bRelease] == true -> we should release the currently held objects
27  protected:
28  void checkOrCreateStructsForObject(unsigned int objectID);
29 
30  void simpleAbilityAddAndInit( EnvironmentObject * obj, vrecko::Ability * pAbility);
31 
32  // Automatically creates (if desired)
33  // - MTMatrixTransform
34  // - PointShell
35  // - SNCH
36 
37  bool bAutoCreatePS; // Create PointShell automatically for grabbed objects
38  bool bAutoCreateSNCH; // Create SNCH hierarchy automatically for grabbed objects
39 
40  bool bGhosting; // Create shadow objects to show real phantom position (in addition to the simulated position)
41 
42  bool graspNewObjectUsingCollisions(vreckoDP_PHANToM::PHANTOM_HELD_OBJECTS_ARRAY *heldObjects, osg::Matrix* heldObjInverseTransform);
43  // Resolves collisions, updates [heldObjects] if necessary and returns "true" if any changes
44  // has been performed.
45 
46  bool graspNewObjectUsingDistances(vreckoDP_PHANToM::PHANTOM_HELD_OBJECTS_ARRAY *heldObjects, osg::Matrix* heldObjInverseTransform);
47  // Checks for any nearby graspable objects and updates [heldObjects].
48  // Returns "true" if any changes ahve been performed.
49 };
50 
51 }
52 
53 #endif