This provides a higher-level wrapper around ScissorAttrib. More...
Public Member Functions | |
RenderEffect const | addPoint (Point3 const point, NodePath const node) |
Returns a new ScissorEffect with the indicated point added. | |
RenderEffect const | addPoint (Point3 const point) |
Returns a new ScissorEffect with the indicated point added. | |
bool | getClip () |
Returns true if this ScissorEffect actually enables scissoring, or false if it culls only. | |
VBase4 const | getFrame () |
If is_screen() returns true, this method may be called to query the screen-based scissor frame. | |
NodePath | getNode (int n) |
Returns the node to which the nth point is relative, or empty NodePath to indicate the current node. | |
list | getNodes () |
int | getNumPoints () |
Returns the number of node-based scissor points. | |
Point3 const | getPoint (int n) |
If is_screen() returns false, then get_num_points() and get_point() may be called to query the node-based scissor frame. | |
list | getPoints () |
bool | isScreen () |
Returns true if the ScissorEffect is a screen-based effect, meaning get_frame() has a meaningful value, but get_a() and get_b() do not. | |
Static Public Member Functions | |
static TypeHandle | getClassType () |
static RenderEffect const | makeNode (Point3 const a, Point3 const b, Point3 const c, Point3 const d, NodePath const node) |
Constructs a new node-relative ScissorEffect. | |
static RenderEffect const | makeNode (Point3 const a, Point3 const b, Point3 const c, Point3 const d) |
Constructs a new node-relative ScissorEffect. | |
static RenderEffect const | makeNode (Point3 const a, Point3 const b, NodePath const node) |
Constructs a new node-relative ScissorEffect. | |
static RenderEffect const | makeNode (Point3 const a, Point3 const b) |
Constructs a new node-relative ScissorEffect. | |
static RenderEffect const | makeNode (bool clip) |
Constructs a new node-relative ScissorEffect, with no points. | |
static RenderEffect const | makeNode () |
Constructs a new node-relative ScissorEffect, with no points. | |
static RenderEffect const | makeScreen (VBase4 const frame, bool clip) |
Constructs a new screen-relative ScissorEffect. | |
static RenderEffect const | makeScreen (VBase4 const frame) |
Constructs a new screen-relative ScissorEffect. |
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.
RenderEffect const addPoint | ( | Point3 const | point, |
NodePath const | node | ||
) |
Returns a new ScissorEffect with the indicated point added.
It is only valid to call this on a "node" type ScissorEffect. 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.
RenderEffect const addPoint | ( | Point3 const | point | ) |
Returns a new ScissorEffect with the indicated point added.
It is only valid to call this on a "node" type ScissorEffect. 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 getClassType | ( | ) | [static] |
Reimplemented from RenderEffect.
bool getClip | ( | ) |
Returns true if this ScissorEffect actually enables scissoring, or false if it culls only.
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 current DisplayRegion. See ScissorAttrib.
Returns the node to which the nth point is relative, or empty NodePath to indicate the current node.
list getNodes | ( | ) |
int getNumPoints | ( | ) |
Returns the number of node-based scissor points.
See get_point().
If is_screen() returns false, then get_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.
list getPoints | ( | ) |
bool isScreen | ( | ) |
Returns true if the ScissorEffect is a screen-based effect, meaning get_frame() has a meaningful value, but get_a() and get_b() do not.
static RenderEffect const makeNode | ( | Point3 const | a, |
Point3 const | b, | ||
Point3 const | c, | ||
Point3 const | d, | ||
NodePath const | node | ||
) | [static] |
Constructs a new node-relative ScissorEffect.
The four points are understood to be relative to the indicated node, or the current node if the indicated NodePath is empty, and determine four points surrounding the scissor region.
static RenderEffect const makeNode | ( | Point3 const | a, |
Point3 const | b, | ||
Point3 const | c, | ||
Point3 const | d | ||
) | [static] |
Constructs a new node-relative ScissorEffect.
The four points are understood to be relative to the indicated node, or the current node if the indicated NodePath is empty, and determine four points surrounding the scissor region.
static RenderEffect const makeNode | ( | Point3 const | a, |
Point3 const | b, | ||
NodePath const | node | ||
) | [static] |
Constructs a new node-relative ScissorEffect.
The two points are understood to be relative to the indicated node, or the current node if the NodePath is empty, and determine the diagonally opposite corners of the scissor region.
static RenderEffect const makeNode | ( | Point3 const | a, |
Point3 const | b | ||
) | [static] |
Constructs a new node-relative ScissorEffect.
The two points are understood to be relative to the indicated node, or the current node if the NodePath is empty, and determine the diagonally opposite corners of the scissor region.
static RenderEffect const makeNode | ( | bool | clip | ) | [static] |
Constructs a new node-relative ScissorEffect, with no points.
This empty ScissorEffect does nothing. You must then call add_point a number of times to add the points you require.
static RenderEffect const makeNode | ( | ) | [static] |
Constructs a new node-relative ScissorEffect, with no points.
This empty ScissorEffect does nothing. You must then call add_point a number of times to add the points you require.
static RenderEffect const makeScreen | ( | VBase4 const | frame, |
bool | clip | ||
) | [static] |
Constructs a new screen-relative ScissorEffect.
The frame defines a left, right, bottom, top region, relative to the DisplayRegion. See ScissorAttrib.
static RenderEffect const makeScreen | ( | VBase4 const | frame | ) | [static] |
Constructs a new screen-relative ScissorEffect.
The frame defines a left, right, bottom, top region, relative to the DisplayRegion. See ScissorAttrib.