Panda3D
|
00001 // Filename: physicalNode.I 00002 // Created by: charles (01Aug00) 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 PhysicalNode:: 00020 clear() { 00021 _physicals.erase(_physicals.begin(), _physicals.end()); 00022 } 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Function : get_physical 00026 // Access : public 00027 //////////////////////////////////////////////////////////////////// 00028 INLINE Physical *PhysicalNode:: 00029 get_physical(int index) const { 00030 nassertr(index >= 0 && index < (int)_physicals.size(), 00031 (Physical *) NULL); 00032 return _physicals[index]; 00033 } 00034 00035 //////////////////////////////////////////////////////////////////// 00036 // Function : get_num_physicals 00037 // Access : public 00038 //////////////////////////////////////////////////////////////////// 00039 INLINE int PhysicalNode:: 00040 get_num_physicals() const { 00041 return _physicals.size(); 00042 } 00043 00044 //////////////////////////////////////////////////////////////////// 00045 // Function : add_physical 00046 // Access : public 00047 //////////////////////////////////////////////////////////////////// 00048 INLINE void PhysicalNode:: 00049 add_physical(Physical *physical) { 00050 _physicals.push_back(physical); 00051 physical->_physical_node = this; 00052 physical->_physical_node_path = NodePath(this); 00053 }