Panda3D
|
This restricts rendering to within a rectangular region of the scene, without otherwise affecting the viewport or lens properties. More...
#include "scissorAttrib.h"
Public Member Functions | |
virtual TypeHandle | force_init_type () |
const LVecBase4f & | get_frame () const |
Returns the left, right, bottom, top coordinates of the scissor frame. | |
virtual int | get_slot () const |
virtual TypeHandle | get_type () const |
virtual void | output (ostream &out) const |
virtual void | write_datagram (BamWriter *manager, Datagram &dg) |
Writes the contents of this object to the datagram for shipping out to a Bam file. | |
Static Public Member Functions | |
static | CPT (RenderAttrib) make_off() |
static | CPT (RenderAttrib) make(float left |
static | CPT (RenderAttrib) make_default() |
static | CPT (RenderAttrib) make(const LVecBase4f &frame) |
static int | get_class_slot () |
static TypeHandle | get_class_type () |
static void | init_type () |
static void | register_with_read_factory () |
Tells the BamReader how to create objects of type ScissorAttrib. | |
Public Attributes | |
static float float | bottom |
static float | right |
static float float float | top |
Protected Member Functions | |
virtual int | compare_to_impl (const RenderAttrib *other) const |
Intended to be overridden by derived ScissorAttrib types to return a unique number indicating whether this ScissorAttrib is equivalent to the other one. | |
virtual | CPT (RenderAttrib) compose_impl(const RenderAttrib *other) const |
void | fillin (DatagramIterator &scan, BamReader *manager) |
This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new ScissorAttrib. | |
Static Protected Member Functions | |
static TypedWritable * | make_from_bam (const FactoryParams ¶ms) |
This function is called by the BamReader's factory when a new object of type ScissorAttrib is encountered in the Bam file. |
This restricts rendering to within a rectangular region of the scene, without otherwise affecting the viewport or lens properties.
Geometry that falls outside the scissor region is not rendered. It is akin to the OpenGL glScissor() function.
The ScissorAttrib always specifies its region relative to its enclosing DisplayRegion, in screen space, and performs no culling.
See ScissorEffect if you wish to define a region relative to 2-D or 3-D coordinates in the scene graph, with culling.
Definition at line 41 of file scissorAttrib.h.
int ScissorAttrib::compare_to_impl | ( | const RenderAttrib * | other | ) | const [protected, virtual] |
Intended to be overridden by derived ScissorAttrib types to return a unique number indicating whether this ScissorAttrib is equivalent to the other one.
This should return 0 if the two ScissorAttrib objects are equivalent, a number less than zero if this one should be sorted before the other one, and a number greater than zero otherwise.
This will only be called with two ScissorAttrib objects whose get_type() functions return the same.
Reimplemented from RenderAttrib.
Definition at line 112 of file scissorAttrib.cxx.
References LVecBase4f::compare_to().
void ScissorAttrib::fillin | ( | DatagramIterator & | scan, |
BamReader * | manager | ||
) | [protected, virtual] |
This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new ScissorAttrib.
Reimplemented from RenderAttrib.
Definition at line 201 of file scissorAttrib.cxx.
References LVecBase4f::read_datagram().
Referenced by make_from_bam().
const LVecBase4f & ScissorAttrib::get_frame | ( | ) | const [inline] |
Returns the left, right, bottom, top coordinates of the scissor frame.
This defines a frame within the current DisplayRegion, where 0,0 is the lower-left corner of the DisplayRegion, and 1,1 is the upper-right corner.
Definition at line 39 of file scissorAttrib.I.
Referenced by PGItem::activate_region().
TypedWritable * ScissorAttrib::make_from_bam | ( | const FactoryParams & | params | ) | [static, protected] |
This function is called by the BamReader's factory when a new object of type ScissorAttrib is encountered in the Bam file.
It should create the ScissorAttrib and extract its information from the file.
Definition at line 182 of file scissorAttrib.cxx.
References fillin().
Referenced by register_with_read_factory().
void ScissorAttrib::register_with_read_factory | ( | ) | [static] |
Tells the BamReader how to create objects of type ScissorAttrib.
Definition at line 156 of file scissorAttrib.cxx.
References BamReader::get_factory(), make_from_bam(), and Factory< Type >::register_factory().
Writes the contents of this object to the datagram for shipping out to a Bam file.
Reimplemented from RenderAttrib.
Definition at line 167 of file scissorAttrib.cxx.
References LVecBase4f::write_datagram().