Panda3D
physxOverlapReport.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file physxOverlapReport.h
10  * @author enn0x
11  * @date 2009-10-21
12  */
13 
14 #ifndef PHYSXOVERLAPREPORT_H
15 #define PHYSXOVERLAPREPORT_H
16 
17 #include "pandabase.h"
18 #include "pvector.h"
19 #include "pointerTo.h"
20 
21 #include "config_physx.h"
22 #include "physx_includes.h"
23 
24 class PhysxShape;
25 
26 class PhysxUserEntityReport : public NxUserEntityReport<NxShape *> {};
27 
28 /**
29  * Objects of this class are returned by the 'overlap shape' methods, for
30  * example overlapSphereShapes. They contain an iterable list of all sshapes
31  * that the raycast query produced.
32  */
33 class EXPCL_PANDAPHYSX PhysxOverlapReport : public PhysxUserEntityReport {
34 
35 PUBLISHED:
36  unsigned int get_num_overlaps() const;
37  PhysxShape *get_first_overlap();
38  PhysxShape *get_next_overlap();
39  PhysxShape *get_overlap(unsigned int idx);
40  MAKE_SEQ(get_overlaps, get_num_overlaps, get_overlap);
41 
42 public:
43  INLINE PhysxOverlapReport();
44  INLINE ~PhysxOverlapReport();
45 
46  virtual bool onEvent(NxU32 nbEntities, NxShape **entities);
47 
48 private:
49  typedef pvector<PT(PhysxShape)> Overlaps;
50  Overlaps _overlaps;
51 
52  typedef Overlaps::const_iterator const_iterator;
53  const_iterator _iterator;
54 };
55 
56 #include "physxOverlapReport.I"
57 
58 #endif // PHYSXOVERLAPREPORT_H
Objects of this class are returned by the 'overlap shape' methods, for example overlapSphereShapes.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Abstract base class for shapes.
Definition: physxShape.h:39
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is our own Panda specialization on the default STL vector.
Definition: pvector.h:42
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.