Panda3D
 All Classes Functions Variables Enumerations
collideMask.h
1 // Filename: collideMask.h
2 // Created by: drose (03Jul00)
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 COLLIDEMASK_H
16 #define COLLIDEMASK_H
17 
18 #include "pandabase.h"
19 
20 #include "bitMask.h"
21 
22 // This is the data type of the collision mask: the set of bits that
23 // every CollisionNode has, and that any two nodes must have some in
24 // common in order to be tested for a mutual intersection.
25 
26 // This file used to live in the collide directory, but since it's
27 // such a trivial definition that a few other directories (like egg)
28 // need without necessarily having to pull in all of collide, it
29 // seemed better to move it to putil.
30 
31 typedef BitMask32 CollideMask;
32 
33 // We need some conventions for initial bits for GeomNodes and
34 // CollideNodes. These are primarily advisory, since the application
35 // programmer is free to define each bit as he or she chooses, but
36 // they also control the initial default values that are assigned to
37 // new nodes.
38 
39 // By established convention, the lower 20 bits are reserved for
40 // CollisionNodes. Each CollisionNode has all these bits set on by
41 // default (and no others). You can (and probably should) change this
42 // on a per-node basis to specialize CollisionNodes for different
43 // purposes.
44 static const CollideMask default_collision_node_collide_mask = CollideMask::lower_on(20);
45 
46 // The next bit is reserved for generic GeomNodes. Each GeomNode has
47 // this bit on by default (and no others). You can, of course, set
48 // any mask you want on a particular GeomNode; this is just the
49 // default bit if you choose not to do anything.
50 static const CollideMask default_geom_node_collide_mask = CollideMask::bit(20);
51 
52 // The remaining 11 bits are presently unassigned. No nodes will have
53 // these bits on by default.
54 
55 #endif
56 
static BitMask< WType, nbits > bit(int index)
Returns a BitMask with only the indicated bit on.
Definition: bitMask.I:117
static BitMask< WType, nbits > lower_on(int on_bits)
Returns a BitMask whose lower on_bits bits are on.
Definition: bitMask.I:99