Panda3D
Loading...
Searching...
No Matches
switchNode.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 switchNode.I
10 * @author drose
11 * @date 2002-07-31
12 */
13
14/**
15 *
16 */
17INLINE SwitchNode::CData::
18CData() {
19 _visible_child = 0;
20}
21
22/**
23 *
24 */
25INLINE SwitchNode::CData::
26CData(const SwitchNode::CData &copy) :
27 _visible_child(copy._visible_child)
28{
29}
30
31/**
32 *
33 */
34INLINE SwitchNode::
35SwitchNode(const std::string &name) :
37{
38 set_cull_callback();
39}
40
41/**
42 * Specifies the particular child of this node, by index, that will be
43 * visible.
44 */
45INLINE void SwitchNode::
46set_visible_child(int index) {
47 nassertv(index >= 0);
48 CDWriter cdata(_cycler);
49 cdata->_visible_child = index;
50}
A base class for nodes like LODNode and SequenceNode that select only one visible child at a time.
set_visible_child
Specifies the particular child of this node, by index, that will be visible.
Definition switchNode.h:44