Panda3D
bulletBaseCharacterControllerNode.cxx
1 // Filename: bulletBaseCharacterControllerNode.cxx
2 // Created by: enn0x (21Nov10)
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 #include "bulletBaseCharacterControllerNode.h"
16 
17 TypeHandle BulletBaseCharacterControllerNode::_type_handle;
18 
19 ////////////////////////////////////////////////////////////////////
20 // Function: BulletBaseCharacterControllerNode::Constructor
21 // Access: Published
22 // Description:
23 ////////////////////////////////////////////////////////////////////
24 BulletBaseCharacterControllerNode::
25 BulletBaseCharacterControllerNode(const char *name) : PandaNode(name) {
26 
27  // Default collide mask
29 }
30 
31 ////////////////////////////////////////////////////////////////////
32 // Function: BulletBaseCharacterControllerNode::get_legal_collide_mask
33 // Access: Public, virtual
34 // Description: Returns the subset of CollideMask bits that may be
35 // set for this particular type of PandaNode. For
36 // CharacterControllerNodes this returns all bits on.
37 ////////////////////////////////////////////////////////////////////
40 
41  return CollideMask::all_on();
42 }
43 
44 ////////////////////////////////////////////////////////////////////
45 // Function: BulletBaseCharacterControllerNode::safe_to_flatten
46 // Access: Public, Virtual
47 // Description: Returns true if it is generally safe to flatten out
48 // this particular kind of Node by duplicating
49 // instances, false otherwise (for instance, a Camera
50 // cannot be safely flattened, because the Camera
51 // pointer itself is meaningful).
52 ////////////////////////////////////////////////////////////////////
54 safe_to_flatten() const {
55 
56  return false;
57 }
58 
59 ////////////////////////////////////////////////////////////////////
60 // Function: BulletBaseCharacterControllerNode::safe_to_modify_transform
61 // Access: Public, Virtual
62 // Description: Returns true if it is safe to automatically adjust
63 // the transform on this kind of node. Usually, this is
64 // only a bad idea if the user expects to find a
65 // particular transform on the node.
66 //
67 // ModelNodes with the preserve_transform flag set are
68 // presently the only kinds of nodes that should not
69 // have their transform even adjusted.
70 ////////////////////////////////////////////////////////////////////
73 
74  return false;
75 }
76 
77 ////////////////////////////////////////////////////////////////////
78 // Function: BulletBaseCharacterControllerNode::safe_to_combine
79 // Access: Public, Virtual
80 // Description: Returns true if it is generally safe to combine this
81 // particular kind of PandaNode with other kinds of
82 // PandaNodes of compatible type, adding children or
83 // whatever. For instance, an LODNode should not be
84 // combined with any other PandaNode, because its set of
85 // children is meaningful.
86 ////////////////////////////////////////////////////////////////////
88 safe_to_combine() const {
89 
90  return false;
91 }
92 
93 ////////////////////////////////////////////////////////////////////
94 // Function: BulletBaseCharacterControllerNode::safe_to_combine_children
95 // Access: Public, Virtual
96 // Description: Returns true if it is generally safe to combine the
97 // children of this PandaNode with each other. For
98 // instance, an LODNode's children should not be
99 // combined with each other, because the set of children
100 // is meaningful.
101 ////////////////////////////////////////////////////////////////////
104 
105  return false;
106 }
107 
108 ////////////////////////////////////////////////////////////////////
109 // Function: BulletBaseCharacterControllerNode::safe_to_flatten_below
110 // Access: Public, Virtual
111 // Description: Returns true if a flatten operation may safely
112 // continue past this node, or false if nodes below this
113 // node may not be molested.
114 ////////////////////////////////////////////////////////////////////
117 
118  return false;
119 }
120 
121 ////////////////////////////////////////////////////////////////////
122 // Function: BulletBaseCharacterControllerNode::safe_to_transform
123 // Access: Public, Virtual
124 // Description: Returns true if it is generally safe to transform
125 // this particular kind of Node by calling the xform()
126 // method, false otherwise. For instance, it's usually
127 // a bad idea to attempt to xform a Character.
128 ////////////////////////////////////////////////////////////////////
131 
132  return false;
133 }
134 
A basic node of the scene graph or data graph.
Definition: pandaNode.h:72
virtual bool safe_to_combine_children() const
Returns true if it is generally safe to combine the children of this PandaNode with each other...
static BitMask< PN_uint32, nbits > all_on()
Returns a BitMask whose bits are all on.
Definition: bitMask.I:73
virtual CollideMask get_legal_collide_mask() const
Returns the subset of CollideMask bits that may be set for this particular type of PandaNode...
virtual bool safe_to_combine() const
Returns true if it is generally safe to combine this particular kind of PandaNode with other kinds of...
virtual bool safe_to_flatten_below() const
Returns true if a flatten operation may safely continue past this node, or false if nodes below this ...
void set_into_collide_mask(CollideMask mask)
Sets the "into" CollideMask.
Definition: pandaNode.cxx:2037
virtual bool safe_to_transform() const
Returns true if it is generally safe to transform this particular kind of Node by calling the xform()...
virtual bool safe_to_modify_transform() const
Returns true if it is safe to automatically adjust the transform on this kind of node.
virtual bool safe_to_flatten() const
Returns true if it is generally safe to flatten out this particular kind of Node by duplicating insta...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85