00001 // Filename: collisionVisualizer.I 00002 // Created by: drose (17Apr03) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 00016 //////////////////////////////////////////////////////////////////// 00017 // Function: CollisionVisualizer::SolidInfo::Constructor 00018 // Access: Public 00019 // Description: 00020 //////////////////////////////////////////////////////////////////// 00021 INLINE CollisionVisualizer::SolidInfo:: 00022 SolidInfo() { 00023 _detected_count = 0; 00024 _missed_count = 0; 00025 } 00026 00027 00028 //////////////////////////////////////////////////////////////////// 00029 // Function: CollisionVisualizer::set_point_scale 00030 // Access: Published 00031 // Description: Scales the points that are drawn to represent the 00032 // surface and interior intersection points of the 00033 // collisions. By default, these objects are drawn at 00034 // an arbitrary scale which is appropriate if the window 00035 // units are the default range -1 .. 1. Change this 00036 // scale accordinatly if the window units are measured 00037 // on some other scale or if you need to observe these 00038 // objects in a smaller window. 00039 //////////////////////////////////////////////////////////////////// 00040 INLINE void CollisionVisualizer:: 00041 set_point_scale(PN_stdfloat point_scale) { 00042 _point_scale = point_scale; 00043 } 00044 00045 //////////////////////////////////////////////////////////////////// 00046 // Function: CollisionVisualizer::get_point_scale 00047 // Access: Published 00048 // Description: Returns the value last set by set_point_scale(). 00049 //////////////////////////////////////////////////////////////////// 00050 INLINE PN_stdfloat CollisionVisualizer:: 00051 get_point_scale() const { 00052 return _point_scale; 00053 } 00054 00055 //////////////////////////////////////////////////////////////////// 00056 // Function: CollisionVisualizer::set_normal_scale 00057 // Access: Published 00058 // Description: Scales the line segments that are drawn to represent 00059 // the normals of the collisions. By default, these 00060 // objects are drawn at an arbitrary scale which is 00061 // appropriate if the scene units are measured in feet. 00062 // Change this scale accordinatly if the scene units are 00063 // measured on some other scale or if you need to 00064 // observe these normals from farther away. 00065 //////////////////////////////////////////////////////////////////// 00066 INLINE void CollisionVisualizer:: 00067 set_normal_scale(PN_stdfloat normal_scale) { 00068 _normal_scale = normal_scale; 00069 } 00070 00071 //////////////////////////////////////////////////////////////////// 00072 // Function: CollisionVisualizer::get_normal_scale 00073 // Access: Published 00074 // Description: Returns the value last set by set_normal_scale(). 00075 //////////////////////////////////////////////////////////////////// 00076 INLINE PN_stdfloat CollisionVisualizer:: 00077 get_normal_scale() const { 00078 return _normal_scale; 00079 } 00080 00081 //////////////////////////////////////////////////////////////////// 00082 // Function: CollisionVisualizer::as_typed_object 00083 // Access: Public 00084 // Description: This is provided to disambiguate the typecast to 00085 // TypedObject, since we have two TypedObjects in our 00086 // inheritance chain. 00087 //////////////////////////////////////////////////////////////////// 00088 INLINE TypedObject *CollisionVisualizer:: 00089 as_typed_object() { 00090 // In fact, it really doesn't matter which one we pick. Arbitrarily 00091 // pick the one that goes through PandaNode. 00092 return PandaNode::as_typed_object(); 00093 } 00094 00095 //////////////////////////////////////////////////////////////////// 00096 // Function: CollisionVisualizer::as_typed_object 00097 // Access: Public 00098 // Description: This is provided to disambiguate the typecast to 00099 // TypedObject, since we have two TypedObjects in our 00100 // inheritance chain. 00101 //////////////////////////////////////////////////////////////////// 00102 INLINE const TypedObject * CollisionVisualizer:: 00103 as_typed_object() const { 00104 // In fact, it really doesn't matter which one we pick. Arbitrarily 00105 // pick the one that goes through PandaNode. 00106 return PandaNode::as_typed_object(); 00107 } 00108