Panda3D

physxMask.h

00001 // Filename: physxMask32.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 PHYSXMASK_H
00016 #define PHYSXMASK_H
00017 
00018 #include "pandabase.h"
00019 
00020 #include "physx_includes.h"
00021 
00022 ////////////////////////////////////////////////////////////////////
00023 //       Class : PhysxMask
00024 // Description : 32-bit bitmask class.
00025 ////////////////////////////////////////////////////////////////////
00026 class EXPCL_PANDAPHYSX PhysxMask {
00027 
00028 PUBLISHED:
00029   INLINE PhysxMask();
00030   INLINE ~PhysxMask();
00031 
00032   void set_bit(unsigned int idx);
00033   void clear_bit(unsigned int idx);
00034   bool get_bit(unsigned int idx) const;
00035 
00036   void output(ostream &out) const;
00037 
00038   static PhysxMask all_on();
00039   static PhysxMask all_off();
00040 
00041 public:
00042   INLINE NxU32 get_mask() const;
00043 
00044 private:
00045   NxU32 _mask;
00046 };
00047 
00048 INLINE ostream &operator << (ostream &out, const PhysxMask &mask) {
00049   mask.output(out);
00050   return out;
00051 }
00052 
00053 #include "physxMask.I"
00054 
00055 #endif // PHYSXMASK_H
 All Classes Functions Variables Enumerations