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