Panda3D
|
00001 // Filename: collisionHandlerFloor.I 00002 // Created by: drose (16Mar02) 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: CollisionHandlerFloor::set_offset 00018 // Access: Public 00019 // Description: Sets the linear offset to add to (or subtract from) 00020 // the highest detected collision point to determine the 00021 // actual height at which to set the collider. 00022 //////////////////////////////////////////////////////////////////// 00023 INLINE void CollisionHandlerFloor:: 00024 set_offset(PN_stdfloat offset) { 00025 _offset = offset; 00026 } 00027 00028 //////////////////////////////////////////////////////////////////// 00029 // Function: CollisionHandlerFloor::get_offset 00030 // Access: Public 00031 // Description: Returns the linear offset to add to (or subtract from) 00032 // the highest detected collision point to determine the 00033 // actual height at which to set the collider. 00034 //////////////////////////////////////////////////////////////////// 00035 INLINE PN_stdfloat CollisionHandlerFloor:: 00036 get_offset() const { 00037 return _offset; 00038 } 00039 00040 //////////////////////////////////////////////////////////////////// 00041 // Function: CollisionHandlerFloor::set_reach 00042 // Access: Public 00043 // Description: Sets the reach to add to (or subtract from) 00044 // the highest collision point 00045 //////////////////////////////////////////////////////////////////// 00046 INLINE void CollisionHandlerFloor:: 00047 set_reach(PN_stdfloat reach) { 00048 _reach = reach; 00049 } 00050 00051 //////////////////////////////////////////////////////////////////// 00052 // Function: CollisionHandlerFloor::get_reach 00053 // Access: Public 00054 // Description: Returns the reach to add to (or subtract from) 00055 // the highest collision point 00056 //////////////////////////////////////////////////////////////////// 00057 INLINE PN_stdfloat CollisionHandlerFloor:: 00058 get_reach() const { 00059 return _reach; 00060 } 00061 00062 //////////////////////////////////////////////////////////////////// 00063 // Function: CollisionHandlerFloor::set_max_velocity 00064 // Access: Public 00065 // Description: Sets the maximum speed at which the object will be 00066 // allowed to descend towards a floor below it, in units 00067 // per second. Set this to zero to allow it to 00068 // instantly teleport any distance. 00069 //////////////////////////////////////////////////////////////////// 00070 INLINE void CollisionHandlerFloor:: 00071 set_max_velocity(PN_stdfloat max_velocity) { 00072 _max_velocity = max_velocity; 00073 } 00074 00075 //////////////////////////////////////////////////////////////////// 00076 // Function: CollisionHandlerFloor::get_max_velocity 00077 // Access: Public 00078 // Description: Retrieves the maximum speed at which the object will 00079 // be allowed to descend towards a floor below it, in 00080 // units per second. See set_max_velocity(). 00081 //////////////////////////////////////////////////////////////////// 00082 INLINE PN_stdfloat CollisionHandlerFloor:: 00083 get_max_velocity() const { 00084 return _max_velocity; 00085 }