collisionSolid.I 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // Filename: collisionSolid.I
  2. // Created by: drose (27Jun00)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
  8. //
  9. // All use of this software is subject to the terms of the Panda 3d
  10. // Software license. You should have received a copy of this license
  11. // along with this source code; you will also find a current copy of
  12. // the license at http://www.panda3d.org/license.txt .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. ////////////////////////////////////////////////////////////////////
  19. // Function: CollisionSolid::set_tangible
  20. // Access: Public
  21. // Description: Sets the current state of the 'tangible' flag. Set
  22. // this true to make the solid tangible, so that a
  23. // CollisionHandlerPusher will not allow another object
  24. // to intersect it, or false to make it intangible, so
  25. // that a CollisionHandlerPusher will ignore it except
  26. // to throw an event.
  27. ////////////////////////////////////////////////////////////////////
  28. INLINE void CollisionSolid::
  29. set_tangible(bool tangible) {
  30. if (tangible != _tangible) {
  31. _tangible = tangible;
  32. mark_viz_stale();
  33. }
  34. }
  35. ////////////////////////////////////////////////////////////////////
  36. // Function: CollisionSolid::is_tangible
  37. // Access: Public
  38. // Description: Returns whether the solid is considered 'tangible' or
  39. // not. An intangible solid has no effect in a
  40. // CollisionHandlerPusher (except to throw an event);
  41. // it's useful for defining 'trigger' planes and
  42. // spheres, that cause an effect when passed through.
  43. ////////////////////////////////////////////////////////////////////
  44. INLINE bool CollisionSolid::
  45. is_tangible() const {
  46. return _tangible;
  47. }
  48. ////////////////////////////////////////////////////////////////////
  49. // Function: CollisionSolid::mark_viz_stale
  50. // Access: Protected
  51. // Description: Called internally when the visualization may have
  52. // been compromised by some change to internal state and
  53. // will need to be recomputed the next time it is
  54. // rendered.
  55. ////////////////////////////////////////////////////////////////////
  56. INLINE void CollisionSolid::
  57. mark_viz_stale() {
  58. _viz_stale = true;
  59. _viz_geom_stale = true;
  60. }