Panda3D
collisionTraverser.I
1 // Filename: collisionTraverser.I
2 // Created by: drose (16Mar02)
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 
16 ////////////////////////////////////////////////////////////////////
17 // Function: CollisionTraverser::set_respect_prev_transform
18 // Access: Published
19 // Description: Sets the flag that indicates whether the
20 // prev_transform stored on a node (as updated via
21 // set_fluid_pos(), etc.) is respected to calculate
22 // collisions. If this is true, certain types of
23 // collision tests will be enhanced by the information
24 // about objects in motion. If this is false, objects
25 // are always considered to be static. The default is
26 // false.
27 ////////////////////////////////////////////////////////////////////
28 INLINE void CollisionTraverser::
30  _respect_prev_transform = flag;
31 }
32 
33 ////////////////////////////////////////////////////////////////////
34 // Function: CollisionTraverser::get_respect_prev_transform
35 // Access: Published
36 // Description: Returns the flag that indicates whether the
37 // prev_transform stored on a node is respected to
38 // calculate collisions. See
39 // set_respect_prev_transform().
40 ////////////////////////////////////////////////////////////////////
41 INLINE bool CollisionTraverser::
43  return _respect_prev_transform;
44 }
45 
46 #ifdef DO_COLLISION_RECORDING
47 
48 ////////////////////////////////////////////////////////////////////
49 // Function: CollisionTraverser::has_recorder
50 // Access: Published
51 // Description: Returns true if the CollisionTraverser has a
52 // CollisionRecorder object currently assigned, false
53 // otherwise.
54 ////////////////////////////////////////////////////////////////////
55 INLINE bool CollisionTraverser::
56 has_recorder() const {
57  return _recorder != (CollisionRecorder *)NULL;
58 }
59 
60 ////////////////////////////////////////////////////////////////////
61 // Function: CollisionTraverser::get_recorder
62 // Access: Published
63 // Description: Returns the CollisionRecorder currently assigned, or
64 // NULL if no recorder is assigned.
65 ////////////////////////////////////////////////////////////////////
66 INLINE CollisionRecorder *CollisionTraverser::
67 get_recorder() const {
68  return _recorder;
69 }
70 
71 ////////////////////////////////////////////////////////////////////
72 // Function: CollisionTraverser::clear_recorder
73 // Access: Published
74 // Description: Removes the CollisionRecorder from the traverser and
75 // restores normal low-overhead operation.
76 ////////////////////////////////////////////////////////////////////
77 INLINE void CollisionTraverser::
78 clear_recorder() {
79  set_recorder((CollisionRecorder *)NULL);
80 }
81 
82 #endif // DO_COLLISION_RECORDING
void set_respect_prev_transform(bool flag)
Sets the flag that indicates whether the prev_transform stored on a node (as updated via set_fluid_po...
bool get_respect_prev_transform() const
Returns the flag that indicates whether the prev_transform stored on a node is respected to calculate...