Panda3D
|
00001 // Filename: switchNode.I 00002 // Created by: drose (31Jul02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 00016 //////////////////////////////////////////////////////////////////// 00017 // Function: SwitchNode::CData::Constructor 00018 // Access: Public 00019 // Description: 00020 //////////////////////////////////////////////////////////////////// 00021 INLINE SwitchNode::CData:: 00022 CData() { 00023 _visible_child = 0; 00024 } 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Function: SwitchNode::CData::Copy Constructor 00028 // Access: Public 00029 // Description: 00030 //////////////////////////////////////////////////////////////////// 00031 INLINE SwitchNode::CData:: 00032 CData(const SwitchNode::CData ©) : 00033 _visible_child(copy._visible_child) 00034 { 00035 } 00036 00037 //////////////////////////////////////////////////////////////////// 00038 // Function: SwitchNode::Constructor 00039 // Access: Published 00040 // Description: 00041 //////////////////////////////////////////////////////////////////// 00042 INLINE SwitchNode:: 00043 SwitchNode(const string &name) : 00044 SelectiveChildNode(name) 00045 { 00046 set_cull_callback(); 00047 } 00048 00049 //////////////////////////////////////////////////////////////////// 00050 // Function: SwitchNode::set_visible_child 00051 // Access: Published 00052 // Description: Specifies the particular child of this node, by 00053 // index, that will be visible. 00054 //////////////////////////////////////////////////////////////////// 00055 INLINE void SwitchNode:: 00056 set_visible_child(int index) { 00057 nassertv(index >= 0); 00058 CDWriter cdata(_cycler); 00059 cdata->_visible_child = index; 00060 }