00001 // Filename: collisionSolid.I 00002 // Created by: drose (27Jun00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: CollisionSolid::set_tangible 00022 // Access: Public 00023 // Description: Sets the current state of the 'tangible' flag. Set 00024 // this true to make the solid tangible, so that a 00025 // CollisionHandlerPusher will not allow another object 00026 // to intersect it, or false to make it intangible, so 00027 // that a CollisionHandlerPusher will ignore it except 00028 // to throw an event. 00029 //////////////////////////////////////////////////////////////////// 00030 INLINE void CollisionSolid:: 00031 set_tangible(bool tangible) { 00032 if (tangible != _tangible) { 00033 _tangible = tangible; 00034 mark_viz_stale(); 00035 } 00036 } 00037 00038 //////////////////////////////////////////////////////////////////// 00039 // Function: CollisionSolid::is_tangible 00040 // Access: Public 00041 // Description: Returns whether the solid is considered 'tangible' or 00042 // not. An intangible solid has no effect in a 00043 // CollisionHandlerPusher (except to throw an event); 00044 // it's useful for defining 'trigger' planes and 00045 // spheres, that cause an effect when passed through. 00046 //////////////////////////////////////////////////////////////////// 00047 INLINE bool CollisionSolid:: 00048 is_tangible() const { 00049 return _tangible; 00050 } 00051 00052 //////////////////////////////////////////////////////////////////// 00053 // Function: CollisionSolid::mark_viz_stale 00054 // Access: Protected 00055 // Description: Called internally when the visualization may have 00056 // been compromised by some change to internal state and 00057 // will need to be recomputed the next time it is 00058 // rendered. 00059 //////////////////////////////////////////////////////////////////// 00060 INLINE void CollisionSolid:: 00061 mark_viz_stale() { 00062 _viz_geom_stale = true; 00063 }