Panda3D
scissorEffect.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 scissorEffect.I
10  * @author drose
11  * @date 2008-07-30
12  */
13 
14 /**
15  * Returns true if the ScissorEffect is a screen-based effect, meaning
16  * get_frame() has a meaningful value, but get_a() and get_b() do not.
17  */
18 INLINE bool ScissorEffect::
19 is_screen() const {
20  return _screen;
21 }
22 
23 /**
24  * If is_screen() returns true, this method may be called to query the screen-
25  * based scissor frame. This is a series of left, right, bottom, top,
26  * representing the scissor frame relative to the current DisplayRegion. See
27  * ScissorAttrib.
28  */
29 INLINE const LVecBase4 &ScissorEffect::
30 get_frame() const {
31  return _frame;
32 }
33 
34 /**
35  * Returns the number of node-based scissor points. See get_point().
36  */
37 INLINE int ScissorEffect::
38 get_num_points() const {
39  return (int)_points.size();
40 }
41 
42 /**
43  * If is_screen() returns false, then get_num_points() and get_point() may be
44  * called to query the node-based scissor frame. These return n points (at
45  * least two), which are understood to be in the space of this node, and which
46  * define any opposite corners of the scissor frame.
47  */
48 INLINE const LPoint3 &ScissorEffect::
49 get_point(int n) const {
50  nassertr(n >= 0 && n < (int)_points.size(), LPoint3::zero());
51  return _points[n]._p;
52 }
53 
54 /**
55  * Returns the node to which the nth point is relative, or empty NodePath to
56  * indicate the current node.
57  */
59 get_node(int n) const {
60  nassertr(n >= 0 && n < (int)_points.size(), NodePath());
61  return _points[n]._node;
62 }
63 
64 /**
65  * Returns true if this ScissorEffect actually enables scissoring, or false if
66  * it culls only.
67  */
68 INLINE bool ScissorEffect::
69 get_clip() const {
70  return _clip;
71 }
bool is_screen() const
Returns true if the ScissorEffect is a screen-based effect, meaning get_frame() has a meaningful valu...
Definition: scissorEffect.I:19
const LVecBase4 & get_frame() const
If is_screen() returns true, this method may be called to query the screen- based scissor frame.
Definition: scissorEffect.I:30
get_point
If is_screen() returns false, then get_num_points() and get_point() may be called to query the node-b...
Definition: scissorEffect.h:55
bool get_clip() const
Returns true if this ScissorEffect actually enables scissoring, or false if it culls only.
Definition: scissorEffect.I:69
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:161
get_node
Returns the node to which the nth point is relative, or empty NodePath to indicate the current node.
Definition: scissorEffect.h:57