Panda3D

Loading...
Searching...
No Matches
occluderEffect.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 occluderEffect.I
10 * @author drose
11 * @date 2011-03-17
12 */
13
14/**
15 * Use OccluderEffect::make() to construct a new OccluderEffect object.
16 */
17INLINE OccluderEffect::
18OccluderEffect() {
19}
20
21/**
22 * Use OccluderEffect::make() to construct a new OccluderEffect object. The
23 * copy constructor is only defined to facilitate methods like
24 * add_on_occluder().
25 */
26INLINE OccluderEffect::
27OccluderEffect(const OccluderEffect &copy) :
28 _on_occluders(copy._on_occluders)
29{
30}
31
32/**
33 * Returns the number of occluders that are enabled by the effectute.
34 */
35INLINE int OccluderEffect::
36 get_num_on_occluders() const {
37 return _on_occluders.size();
38}
39
40/**
41 * Returns the nth occluder enabled by the effectute, sorted in render order.
42 */
43INLINE NodePath OccluderEffect::
44 get_on_occluder(int n) const {
45 nassertr(n >= 0 && n < (int)_on_occluders.size(), NodePath::fail());
46 return _on_occluders[n];
47}
48
49/**
50 * Returns true if the indicated occluder is enabled by the effect, false
51 * otherwise.
52 */
53INLINE bool OccluderEffect::
54 has_on_occluder(const NodePath &occluder) const {
55 return _on_occluders.find(occluder) != _on_occluders.end();
56}
57
58/**
59 * Returns true if this is an identity effect: it does not change the set of
60 * occluders in use.
61 */
62INLINE bool OccluderEffect::
63 is_identity() const {
64 return _on_occluders.empty();
65}
NodePath
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition nodePath.h:159
NodePath::fail
static NodePath fail()
Creates a NodePath with the ET_fail error type set.
Definition nodePath.I:149
OccluderEffect
This functions similarly to a LightAttrib or ClipPlaneAttrib.
Definition occluderEffect.h:32
OccluderEffect::is_identity
bool is_identity() const
Returns true if this is an identity effect: it does not change the set of occluders in use.
Definition occluderEffect.I:63
OccluderEffect::get_num_on_occluders
get_num_on_occluders
Returns the number of occluders that are enabled by the effectute.
Definition occluderEffect.h:42
OccluderEffect::has_on_occluder
bool has_on_occluder(const NodePath &occluder) const
Returns true if the indicated occluder is enabled by the effect, false otherwise.
Definition occluderEffect.I:54
OccluderEffect::get_on_occluder
get_on_occluder
Returns the nth occluder enabled by the effectute, sorted in render order.
Definition occluderEffect.h:42