Panda3D
Loading...
Searching...
No Matches
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 */
17INLINE void PhysicalNode::
18clear() {
19 for (Physical *physical : _physicals) {
20 nassertd(physical->_physical_node == this) continue;
21 physical->_physical_node = nullptr;
22 }
23 _physicals.clear();
24}
25
26/**
27
28 */
29INLINE Physical *PhysicalNode::
30get_physical(size_t index) const {
31 nassertr(index < _physicals.size(), nullptr);
32 return _physicals[index];
33}
34
35/**
36
37 */
38INLINE size_t PhysicalNode::
39get_num_physicals() const {
40 return _physicals.size();
41}
42
43/**
44 * Adds a Physical to this PhysicalNode. If it is already added to this node,
45 * does nothing. It is an error to add a Physical to multiple PhysicalNodes.
46 */
47INLINE void PhysicalNode::
48add_physical(Physical *physical) {
49 if (physical->_physical_node != this) {
50 nassertv(physical->_physical_node == nullptr);
51 _physicals.push_back(physical);
52 physical->_physical_node = this;
53 }
54}
Graph node that encapsulated a series of physical objects.
void add_physical(Physical *physical)
Adds a Physical to this PhysicalNode.
Defines a set of physically modeled attributes.
Definition physical.h:37