Panda3D
 All Classes Functions Variables Enumerations
physxGroupsMask.h
1 // Filename: physxGroupsMask.h
2 // Created by: enn0x (21Oct09)
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 PHYSXGROUPSMASK_H
16 #define PHYSXGROUPSMASK_H
17 
18 #include "pandabase.h"
19 
20 #include "physx_includes.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : PhysxGroupsMask
24 // Description : 128-bit bitmask class.
25 ////////////////////////////////////////////////////////////////////
26 class EXPCL_PANDAPHYSX PhysxGroupsMask {
27 
28 PUBLISHED:
29  INLINE PhysxGroupsMask();
30  INLINE PhysxGroupsMask(NxGroupsMask mask);
31  INLINE ~PhysxGroupsMask();
32 
33  void set_bit(unsigned int idx);
34  void clear_bit(unsigned int idx);
35  bool get_bit(unsigned int idx) const;
36 
37  void output(ostream &out) const;
38 
39  static PhysxGroupsMask all_on();
40  static PhysxGroupsMask all_off();
41 
42  INLINE unsigned int get_bits0() const;
43  INLINE unsigned int get_bits1() const;
44  INLINE unsigned int get_bits2() const;
45  INLINE unsigned int get_bits3() const;
46 
47  INLINE void set_bits0( unsigned int bits );
48  INLINE void set_bits1( unsigned int bits );
49  INLINE void set_bits2( unsigned int bits );
50  INLINE void set_bits3( unsigned int bits );
51 
52 public:
53  INLINE NxGroupsMask get_mask() const;
54  INLINE void set_mask(NxGroupsMask mask);
55 
56  NxGroupsMask _mask;
57 };
58 
59 INLINE ostream &operator << (ostream &out, const PhysxGroupsMask &mask) {
60  mask.output(out);
61  return out;
62 }
63 
64 #include "physxGroupsMask.I"
65 
66 #endif // PHYSXGROUPSMASK_H
void output(ostream &out) const
Writes the PhysxGroupsMask out as a list of ones and zeros.
128-bit bitmask class.