Panda3D
physxMask.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 physxMask.h
10  * @author enn0x
11  * @date 2009-10-21
12  */
13 
14 #ifndef PHYSXMASK_H
15 #define PHYSXMASK_H
16 
17 #include "pandabase.h"
18 
19 #include "physx_includes.h"
20 
21 /**
22  * 32-bit bitmask class.
23  */
24 class EXPCL_PANDAPHYSX PhysxMask {
25 
26 PUBLISHED:
27  INLINE PhysxMask();
28  INLINE ~PhysxMask();
29 
30  void set_bit(unsigned int idx);
31  void clear_bit(unsigned int idx);
32  bool get_bit(unsigned int idx) const;
33 
34  void output(std::ostream &out) const;
35 
36  static PhysxMask all_on();
37  static PhysxMask all_off();
38 
39 public:
40  INLINE NxU32 get_mask() const;
41 
42 private:
43  NxU32 _mask;
44 };
45 
46 INLINE std::ostream &operator << (std::ostream &out, const PhysxMask &mask) {
47  mask.output(out);
48  return out;
49 }
50 
51 #include "physxMask.I"
52 
53 #endif // PHYSXMASK_H
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void output(std::ostream &out) const
Writes the PhysxMask out as a list of ones and zeros.
Definition: physxMask.cxx:73
32-bit bitmask class.
Definition: physxMask.h:24