ScissorEffect
-
class ScissorEffect
Bases:
RenderEffect
This provides a higher-level wrapper around
ScissorAttrib
. It allows for the scissor region to be defined via points relative to the current node, and also performs culling based on the scissor region.Inheritance diagram
-
ConstPointerTo<RenderEffect> add_point(LPoint3 const &point, NodePath const &node = NodePath()) const
Returns a new
ScissorEffect
with the indicated point added. It is only valid to call this on a “node” typeScissorEffect
. The full set of points, projected into screen space, defines the bounding volume of the rectangular scissor region.Each point may be relative to a different node, if desired.
-
static TypeHandle get_class_type(void)
-
bool get_clip(void) const
Returns true if this
ScissorEffect
actually enables scissoring, or false if it culls only.
-
LVecBase4 const &get_frame(void) const
If
is_screen()
returns true, this method may be called to query the screen- based scissor frame. This is a series of left, right, bottom, top, representing the scissor frame relative to the currentDisplayRegion
. SeeScissorAttrib
.
-
NodePath get_node(int n) const
Returns the node to which the nth point is relative, or empty
NodePath
to indicate the current node.
-
int get_num_points(void) const
Returns the number of node-based scissor points. See
get_point()
.
-
LPoint3 const &get_point(int n) const
If
is_screen()
returns false, thenget_num_points()
and get_point() may be called to query the node-based scissor frame. These return n points (at least two), which are understood to be in the space of this node, and which define any opposite corners of the scissor frame.
-
bool is_screen(void) const
Returns true if the
ScissorEffect
is a screen-based effect, meaningget_frame()
has a meaningful value, but get_a() and get_b() do not.
-
static ConstPointerTo<RenderEffect> make_node(bool clip = true)
-
static ConstPointerTo<RenderEffect> make_node(LPoint3 const &a, LPoint3 const &b, NodePath const &node = NodePath())
-
static ConstPointerTo<RenderEffect> make_node(LPoint3 const &a, LPoint3 const &b, LPoint3 const &c, LPoint3 const &d, NodePath const &node = NodePath())
Constructs a new node-relative
ScissorEffect
, with no points. This emptyScissorEffect
does nothing. You must then calladd_point
a number of times to add the points you require.Constructs a new node-relative
ScissorEffect
. The two points are understood to be relative to the indicated node, or the current node if theNodePath
is empty, and determine the diagonally opposite corners of the scissor region.Constructs a new node-relative
ScissorEffect
. The four points are understood to be relative to the indicated node, or the current node if the indicatedNodePath
is empty, and determine four points surrounding the scissor region.
-
static ConstPointerTo<RenderEffect> make_screen(LVecBase4 const &frame, bool clip = true)
Constructs a new screen-relative
ScissorEffect
. The frame defines a left, right, bottom, top region, relative to theDisplayRegion
. SeeScissorAttrib
.
-
ConstPointerTo<RenderEffect> add_point(LPoint3 const &point, NodePath const &node = NodePath()) const