org.xith3d.render
Class ScissorRect

java.lang.Object
  extended by org.xith3d.render.ScissorRect

public class ScissorRect
extends java.lang.Object

This class is used to attach glScissor information to a RenderAtom.


Constructor Summary
ScissorRect(int x, int y, int width, int height)
          Creates a new ScissorBox
 
Method Summary
 boolean check(org.openmali.types.twodee.Sized2iRO viewport)
          Checks if the values of the box are valid
 void clamp(org.openmali.types.twodee.Sized2iRO viewport)
          Clamps the ScissorBox'es values to be insode the Canvas.
 boolean equals(ScissorRect box2)
           
 int getHeight()
           
 int getWidth()
           
 int getX()
           
 int getY()
           
 void init(int x, int y, int width, int height)
          Initializes the ScissorBox
 boolean isChanged()
          Have the values changed since last time?
 void setChanged(boolean changed)
          Have the values changed since last time?
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScissorRect

public ScissorRect(int x,
                   int y,
                   int width,
                   int height)
Creates a new ScissorBox

Parameters:
x - the x coordinate of the lower-left corner
y - the y coordinate of the lower-left corner
width - the width of the box
height - the height of the box
Method Detail

getX

public int getX()
Returns:
the x coordinate of the lower-left corner

getY

public int getY()
Returns:
the y coordinate of the lower-left corner

getWidth

public int getWidth()
Returns:
the width of the box

getHeight

public int getHeight()
Returns:
the height of the box

setChanged

public void setChanged(boolean changed)
Have the values changed since last time?


isChanged

public boolean isChanged()
Have the values changed since last time?


check

public boolean check(org.openmali.types.twodee.Sized2iRO viewport)
Checks if the values of the box are valid

Parameters:
viewport - the Viewport size to check the bounds against
Returns:
true, if the bounds are valid, false otherwise

clamp

public void clamp(org.openmali.types.twodee.Sized2iRO viewport)
Clamps the ScissorBox'es values to be insode the Canvas.

Parameters:
viewport - the Viewport size to check the bounds against

equals

public boolean equals(ScissorRect box2)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

init

public void init(int x,
                 int y,
                 int width,
                 int height)
Initializes the ScissorBox

Parameters:
x - the x coordinate of the lower-left corner
y - the y coordinate of the lower-left corner
width - the width of the box
height - the height of the box