Panda3D
|
00001 // Filename: physOverlapReport.h 00002 // Created by: enn0x (21Oct09) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef PHYSXOVERLAPREPORT_H 00016 #define PHYSXOVERLAPREPORT_H 00017 00018 #include "pandabase.h" 00019 #include "pvector.h" 00020 #include "pointerTo.h" 00021 00022 #include "config_physx.h" 00023 #include "physx_includes.h" 00024 00025 class PhysxShape; 00026 00027 class PhysxUserEntityReport : public NxUserEntityReport<NxShape *> {}; 00028 00029 //////////////////////////////////////////////////////////////////// 00030 // Class : PhysxOverlapReport 00031 // Description : Objects of this class are returned by the 'overlap 00032 // shape' methods, for example overlapSphereShapes. 00033 // They contain an iterable list of all sshapes that 00034 // the raycast query produced. 00035 //////////////////////////////////////////////////////////////////// 00036 class EXPCL_PANDAPHYSX PhysxOverlapReport : public PhysxUserEntityReport { 00037 00038 PUBLISHED: 00039 unsigned int get_num_overlaps() const; 00040 PhysxShape *get_first_overlap(); 00041 PhysxShape *get_next_overlap(); 00042 PhysxShape *get_overlap(unsigned int idx); 00043 MAKE_SEQ(get_overlaps, get_num_overlaps, get_overlap); 00044 00045 public: 00046 INLINE PhysxOverlapReport(); 00047 INLINE ~PhysxOverlapReport(); 00048 00049 virtual bool onEvent(NxU32 nbEntities, NxShape **entities); 00050 00051 private: 00052 typedef pvector<PT(PhysxShape)> Overlaps; 00053 Overlaps _overlaps; 00054 00055 typedef Overlaps::const_iterator const_iterator; 00056 const_iterator _iterator; 00057 }; 00058 00059 #include "physxOverlapReport.I" 00060 00061 #endif // PHYSXOVERLAPREPORT_H