| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- // Filename: forceNode.I
- // Created by: charles (02Aug00)
- //
- ////////////////////////////////////////////////////////////////////
- //
- // PANDA 3D SOFTWARE
- // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
- //
- // All use of this software is subject to the terms of the Panda 3d
- // Software license. You should have received a copy of this license
- // along with this source code; you will also find a current copy of
- // the license at http://www.panda3d.org/license.txt .
- //
- // To contact the maintainers of this program write to
- // [email protected] .
- //
- ////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////
- // Function : clear
- // Access : public
- ////////////////////////////////////////////////////////////////////
- INLINE void ForceNode::
- clear(void) {
- _forces.erase(_forces.begin(), _forces.end());
- }
- ////////////////////////////////////////////////////////////////////
- // Function : get_force
- // Access : public
- ////////////////////////////////////////////////////////////////////
- INLINE BaseForce *ForceNode::
- get_force(int index) const {
- nassertr(index >= 0 && index < (int)_forces.size(),
- (BaseForce *) NULL);
- return _forces[index];
- }
- ////////////////////////////////////////////////////////////////////
- // Function : get_num_forces
- // Access : public
- ////////////////////////////////////////////////////////////////////
- INLINE int ForceNode::
- get_num_forces(void) const {
- return _forces.size();
- }
- ////////////////////////////////////////////////////////////////////
- // Function : add_force
- // Access : public
- ////////////////////////////////////////////////////////////////////
- INLINE void ForceNode::
- add_force(BaseForce *force) {
- _forces.push_back(force);
- force->_force_node = this;
- }
|