Panda3D
|
00001 // Filename: collisionPlane.I 00002 // Created by: drose (25Apr00) 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: CollisionPlane::Default Constructor 00018 // Access: Protected 00019 // Description: This is only for the convenience of CollisionPolygon. 00020 // Normally, you should not attempt to create an 00021 // uninitialized CollisionPlane. 00022 //////////////////////////////////////////////////////////////////// 00023 INLINE CollisionPlane:: 00024 CollisionPlane() { 00025 } 00026 00027 //////////////////////////////////////////////////////////////////// 00028 // Function: CollisionPlane::Constructor 00029 // Access: Public 00030 // Description: 00031 //////////////////////////////////////////////////////////////////// 00032 INLINE CollisionPlane:: 00033 CollisionPlane(const LPlane &plane) : 00034 _plane(plane) 00035 { 00036 } 00037 00038 //////////////////////////////////////////////////////////////////// 00039 // Function: CollisionPlane::Copy Constructor 00040 // Access: Public 00041 // Description: 00042 //////////////////////////////////////////////////////////////////// 00043 INLINE CollisionPlane:: 00044 CollisionPlane(const CollisionPlane ©) : 00045 CollisionSolid(copy), 00046 _plane(copy._plane) 00047 { 00048 } 00049 00050 //////////////////////////////////////////////////////////////////// 00051 // Function: CollisionPlane::flush_level 00052 // Access: Public, Static 00053 // Description: Flushes the PStatCollectors used during traversal. 00054 //////////////////////////////////////////////////////////////////// 00055 INLINE void CollisionPlane:: 00056 flush_level() { 00057 _volume_pcollector.flush_level(); 00058 _test_pcollector.flush_level(); 00059 } 00060 00061 //////////////////////////////////////////////////////////////////// 00062 // Function: CollisionPlane::get_normal 00063 // Access: Published 00064 // Description: 00065 //////////////////////////////////////////////////////////////////// 00066 INLINE LVector3 CollisionPlane:: 00067 get_normal() const { 00068 return _plane.get_normal(); 00069 } 00070 00071 //////////////////////////////////////////////////////////////////// 00072 // Function: CollisionPlane::dist_to_plane 00073 // Access: Published 00074 // Description: 00075 //////////////////////////////////////////////////////////////////// 00076 INLINE PN_stdfloat CollisionPlane:: 00077 dist_to_plane(const LPoint3 &point) const { 00078 return _plane.dist_to_plane(point); 00079 } 00080 00081 //////////////////////////////////////////////////////////////////// 00082 // Function: CollisionPlane::set_plane 00083 // Access: Published 00084 // Description: 00085 //////////////////////////////////////////////////////////////////// 00086 INLINE void CollisionPlane:: 00087 set_plane(const LPlane &plane) { 00088 _plane = plane; 00089 mark_internal_bounds_stale(); 00090 mark_viz_stale(); 00091 } 00092 00093 //////////////////////////////////////////////////////////////////// 00094 // Function: CollisionPlane::get_plane 00095 // Access: Published 00096 // Description: 00097 //////////////////////////////////////////////////////////////////// 00098 INLINE const LPlane &CollisionPlane:: 00099 get_plane() const { 00100 return _plane; 00101 } 00102 00103 //////////////////////////////////////////////////////////////////// 00104 // Function: CollisionPlane::flip 00105 // Access: Published 00106 // Description: Convenience method to flip the plane in-place. 00107 //////////////////////////////////////////////////////////////////// 00108 INLINE void CollisionPlane:: 00109 flip() { 00110 _plane.flip(); 00111 }