Panda3D
collisionVisualizer.I
1 // Filename: collisionVisualizer.I
2 // Created by: drose (17Apr03)
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: CollisionVisualizer::SolidInfo::Constructor
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE CollisionVisualizer::SolidInfo::
22 SolidInfo() {
23  _detected_count = 0;
24  _missed_count = 0;
25 }
26 
27 
28 ////////////////////////////////////////////////////////////////////
29 // Function: CollisionVisualizer::set_point_scale
30 // Access: Published
31 // Description: Scales the points that are drawn to represent the
32 // surface and interior intersection points of the
33 // collisions. By default, these objects are drawn at
34 // an arbitrary scale which is appropriate if the window
35 // units are the default range -1 .. 1. Change this
36 // scale accordinatly if the window units are measured
37 // on some other scale or if you need to observe these
38 // objects in a smaller window.
39 ////////////////////////////////////////////////////////////////////
40 INLINE void CollisionVisualizer::
41 set_point_scale(PN_stdfloat point_scale) {
42  _point_scale = point_scale;
43 }
44 
45 ////////////////////////////////////////////////////////////////////
46 // Function: CollisionVisualizer::get_point_scale
47 // Access: Published
48 // Description: Returns the value last set by set_point_scale().
49 ////////////////////////////////////////////////////////////////////
50 INLINE PN_stdfloat CollisionVisualizer::
51 get_point_scale() const {
52  return _point_scale;
53 }
54 
55 ////////////////////////////////////////////////////////////////////
56 // Function: CollisionVisualizer::set_normal_scale
57 // Access: Published
58 // Description: Scales the line segments that are drawn to represent
59 // the normals of the collisions. By default, these
60 // objects are drawn at an arbitrary scale which is
61 // appropriate if the scene units are measured in feet.
62 // Change this scale accordinatly if the scene units are
63 // measured on some other scale or if you need to
64 // observe these normals from farther away.
65 ////////////////////////////////////////////////////////////////////
66 INLINE void CollisionVisualizer::
67 set_normal_scale(PN_stdfloat normal_scale) {
68  _normal_scale = normal_scale;
69 }
70 
71 ////////////////////////////////////////////////////////////////////
72 // Function: CollisionVisualizer::get_normal_scale
73 // Access: Published
74 // Description: Returns the value last set by set_normal_scale().
75 ////////////////////////////////////////////////////////////////////
76 INLINE PN_stdfloat CollisionVisualizer::
77 get_normal_scale() const {
78  return _normal_scale;
79 }
80 
81 ////////////////////////////////////////////////////////////////////
82 // Function: CollisionVisualizer::as_typed_object
83 // Access: Public
84 // Description: This is provided to disambiguate the typecast to
85 // TypedObject, since we have two TypedObjects in our
86 // inheritance chain.
87 ////////////////////////////////////////////////////////////////////
88 INLINE TypedObject *CollisionVisualizer::
89 as_typed_object() {
90  // In fact, it really doesn't matter which one we pick. Arbitrarily
91  // pick the one that goes through PandaNode.
93 }
94 
95 ////////////////////////////////////////////////////////////////////
96 // Function: CollisionVisualizer::as_typed_object
97 // Access: Public
98 // Description: This is provided to disambiguate the typecast to
99 // TypedObject, since we have two TypedObjects in our
100 // inheritance chain.
101 ////////////////////////////////////////////////////////////////////
102 INLINE const TypedObject * CollisionVisualizer::
103 as_typed_object() const {
104  // In fact, it really doesn't matter which one we pick. Arbitrarily
105  // pick the one that goes through PandaNode.
107 }
108 
This is an abstract class that all classes which use TypeHandle, and also provide virtual functions t...
Definition: typedObject.h:98
TypedObject * as_typed_object()
Returns the object, upcast (if necessary) to a TypedObject pointer.
Definition: typedObject.I:99