panda3d.core.ScissorAttrib

class ScissorAttrib

Bases: RenderAttrib

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.

Inheritance diagram

Inheritance diagram of ScissorAttrib

static makeOff() → RenderAttrib

Constructs a new ScissorAttrib object that removes the scissor region and fills the DisplayRegion.

Return type

RenderAttrib

static make(frame: LVecBase4) → RenderAttrib

Constructs a ScissorAttrib that restricts rendering to the indicated frame within the current DisplayRegion. (0,0) is the lower-left corner of the DisplayRegion, and (1,1) is the upper-right corner.

Return type

RenderAttrib

static make(left: float, right: float, bottom: float, top: float) → RenderAttrib

Constructs a ScissorAttrib that restricts rendering to the indicated frame within the current DisplayRegion. (0,0) is the lower-left corner of the DisplayRegion, and (1,1) is the upper-right corner.

Return type

RenderAttrib

static makeDefault() → RenderAttrib

Returns a RenderAttrib that corresponds to whatever the standard default properties for render attributes of this type ought to be.

Return type

RenderAttrib

isOff() → bool

Returns true if the ScissorAttrib is an ‘off’ ScissorAttrib, indicating that scissor testing is disabled.

getFrame() → LVecBase4

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.

Return type

LVecBase4

static getClassSlot() → int
static getClassType() → TypeHandle
Return type

TypeHandle

property frame

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.

Return type

LVecBase4

property class_slot
Return type

int