Panda3D
 All Classes Functions Variables Enumerations
physxControllerReport.h
1 // Filename: physxControllerReport.h
2 // Created by: enn0x (24Sep09)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef PHYSXCONTROLLERREPORT_H
16 #define PHYSXCONTROLLERREPORT_H
17 
18 #include "pandabase.h"
19 #include "callbackObject.h"
20 #include "pStatCollector.h"
21 
22 #include "physx_includes.h"
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : PhysxControllerReport
26 // Description : Implementation of the NxUserControllerHitReport
27 // interface.
28 ////////////////////////////////////////////////////////////////////
29 class EXPCL_PANDAPHYSX PhysxControllerReport : public NxUserControllerHitReport {
30 
31 public:
32  INLINE PhysxControllerReport();
33  INLINE ~PhysxControllerReport();
34 
35  void enable();
36  void disable();
37  bool is_enabled() const;
38 
39  INLINE void set_shape_hit_callback(PT(CallbackObject) cbobj);
40  INLINE void set_controller_hit_callback(PT(CallbackObject) cbobj);
41 
42  virtual NxControllerAction onShapeHit(const NxControllerShapeHit& hit);
43  virtual NxControllerAction onControllerHit(const NxControllersHit& hit);
44 
45 private:
46  bool _enabled;
47 
48  PT(CallbackObject) _shape_hit_cbobj;
49  PT(CallbackObject) _controller_hit_cbobj;
50 
51  static PStatCollector _pcollector;
52 };
53 
54 #include "physxControllerReport.I"
55 
56 #endif // PHYSXCONTROLLERREPORT_H
A lightweight class that represents a single element that may be timed and/or counted via stats...
This is a generic object that can be assigned to a callback at various points in the rendering proces...
Implementation of the NxUserControllerHitReport interface.