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