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