Panda3D
Loading...
Searching...
No Matches
selectiveChildNode.cxx
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 selectiveChildNode.cxx
10 * @author drose
11 * @date 2002-03-06
12 */
13
14#include "selectiveChildNode.h"
15
16TypeHandle SelectiveChildNode::_type_handle;
17
18
19/**
20 * Should be overridden by derived classes to return true if this kind of node
21 * has some restrictions on the set of children that should be rendered. Node
22 * with this property include LODNodes, SwitchNodes, and SequenceNodes.
23 *
24 * If this function returns true, get_first_visible_child() and
25 * get_next_visible_child() will be called to walk through the list of
26 * children during cull, instead of iterating through the entire list. This
27 * method is called after cull_callback(), so cull_callback() may be
28 * responsible for the decisions as to which children are visible at the
29 * moment.
30 */
33 return true;
34}
35
36/**
37 * Returns the index number of the first visible child of this node, or a
38 * number >= get_num_children() if there are no visible children of this node.
39 * This is called during the cull traversal, but only if
40 * has_selective_visibility() has already returned true. See
41 * has_selective_visibility().
42 */
45 return _selected_child;
46}
47
48/**
49 * Returns the index number of the next visible child of this node following
50 * the indicated child, or a number >= get_num_children() if there are no more
51 * visible children of this node. See has_selective_visibility() and
52 * get_first_visible_child().
53 */
55get_next_visible_child(int n) const {
56 return get_num_children();
57}
get_num_children
Returns the number of child nodes this node has.
Definition pandaNode.h:124
virtual int get_first_visible_child() const
Returns the index number of the first visible child of this node, or a number >= get_num_children() i...
virtual int get_next_visible_child(int n) const
Returns the index number of the next visible child of this node following the indicated child,...
virtual bool has_selective_visibility() const
Should be overridden by derived classes to return true if this kind of node has some restrictions on ...
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.