Panda3D
physicalNode.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file physicalNode.I
10  * @author charles
11  * @date 2000-08-01
12  */
13 
14 /**
15 
16  */
17 INLINE void PhysicalNode::
18 clear() {
19  PhysicalsVector::iterator it;
20  for (it = _physicals.begin(); it != _physicals.end(); ++it) {
21  nassertd((*it)->_physical_node == this) continue;
22  (*it)->_physical_node = nullptr;
23  }
24  _physicals.erase(_physicals.begin(), _physicals.end());
25 }
26 
27 /**
28 
29  */
30 INLINE Physical *PhysicalNode::
31 get_physical(size_t index) const {
32  nassertr(index < _physicals.size(), nullptr);
33  return _physicals[index];
34 }
35 
36 /**
37 
38  */
39 INLINE size_t PhysicalNode::
40 get_num_physicals() const {
41  return _physicals.size();
42 }
43 
44 /**
45 
46  */
47 INLINE void PhysicalNode::
48 add_physical(Physical *physical) {
49  _physicals.push_back(physical);
50  physical->_physical_node = this;
51 }
Graph node that encapsulated a series of physical objects.
Definition: physicalNode.h:28
Defines a set of physically modeled attributes.
Definition: physical.h:37