Panda3D
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  */
17 INLINE SwitchNode::CData::
18 CData() {
19  _visible_child = 0;
20 }
21 
22 /**
23  *
24  */
25 INLINE SwitchNode::CData::
26 CData(const SwitchNode::CData &copy) :
27  _visible_child(copy._visible_child)
28 {
29 }
30 
31 /**
32  *
33  */
34 INLINE SwitchNode::
35 SwitchNode(const std::string &name) :
36  SelectiveChildNode(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  */
45 INLINE void SwitchNode::
46 set_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