Panda3D
 All Classes Functions Variables Enumerations
physicalNode.I
1 // Filename: physicalNode.I
2 // Created by: charles (01Aug00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 ////////////////////////////////////////////////////////////////////
16 // Function : clear
17 // Access : public
18 ////////////////////////////////////////////////////////////////////
19 INLINE void PhysicalNode::
20 clear() {
21  _physicals.erase(_physicals.begin(), _physicals.end());
22 }
23 
24 ////////////////////////////////////////////////////////////////////
25 // Function : get_physical
26 // Access : public
27 ////////////////////////////////////////////////////////////////////
28 INLINE Physical *PhysicalNode::
29 get_physical(int index) const {
30  nassertr(index >= 0 && index < (int)_physicals.size(),
31  (Physical *) NULL);
32  return _physicals[index];
33 }
34 
35 ////////////////////////////////////////////////////////////////////
36 // Function : get_num_physicals
37 // Access : public
38 ////////////////////////////////////////////////////////////////////
39 INLINE int PhysicalNode::
40 get_num_physicals() const {
41  return _physicals.size();
42 }
43 
44 ////////////////////////////////////////////////////////////////////
45 // Function : add_physical
46 // Access : public
47 ////////////////////////////////////////////////////////////////////
48 INLINE void PhysicalNode::
49 add_physical(Physical *physical) {
50  _physicals.push_back(physical);
51  physical->_physical_node = this;
52 }
Defines a set of physically modeled attributes.
Definition: physical.h:40