00001 // Filename: forceNode.I 00002 // Created by: charles (02Aug00) 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 // Function : clear 00017 // Access : public 00018 //////////////////////////////////////////////////////////////////// 00019 INLINE void ForceNode:: 00020 clear() { 00021 _forces.erase(_forces.begin(), _forces.end()); 00022 } 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Function : get_force 00026 // Access : public 00027 //////////////////////////////////////////////////////////////////// 00028 INLINE BaseForce *ForceNode:: 00029 get_force(int index) const { 00030 nassertr(index >= 0 && index < (int)_forces.size(), 00031 (BaseForce *) NULL); 00032 return _forces[index]; 00033 } 00034 00035 //////////////////////////////////////////////////////////////////// 00036 // Function : get_num_forces 00037 // Access : public 00038 //////////////////////////////////////////////////////////////////// 00039 INLINE int ForceNode:: 00040 get_num_forces() const { 00041 return _forces.size(); 00042 } 00043 00044 //////////////////////////////////////////////////////////////////// 00045 // Function : add_force 00046 // Access : public 00047 //////////////////////////////////////////////////////////////////// 00048 INLINE void ForceNode:: 00049 add_force(BaseForce *force) { 00050 _forces.push_back(force); 00051 force->_force_node = this; 00052 force->_force_node_path = NodePath(this); 00053 }