Main Page   Class Hierarchy   Compound List   File List   Compound Members  

KrRect Struct Reference

A rectangle structure. More...

#include <krmath.h>

List of all members.

Public Methods

int Width () const
 width of the rectangle.

int Height () const
 height of the rectangle.

void Set (int _xmin, int _ymin, int _xmax, int _ymax)
 Initialize. Convenience function.

void SetInvalid ()
 Initialize to an invalid rectangle.

void Zero ()
 Set all the members to zero.

bool IsValid () const
 Return true if this is potentially a valid rectangle.

void FromPair (int x0, int y0, int x1, int y1)
 Creates the rectangle from 2 points, which can be in any relationship to each other.

bool Intersect (const KrRect &rect) const
 Return true if the rectangles intersect.

bool HasInside (const KrRect &rect) const
 Return true if 'rect' is inside this.

bool HasInside (const KrVector2 &point) const
 Return true if 'rect' is inside this.

void DoUnion (const KrRect &rect)
 Merge the rect into this.

void DoIntersection (const KrRect &rect)
 Turn this into the intersection.

void DoClip (const KrRect &rect)
 Clip this to the passed in rectangle. Will become invalid if they don't intersect.

void Scale (GlFixed x, GlFixed y)
 Scale all coordinates by the given ratios:.

void EdgeAdd (int i)
 Changes the boundaries.


Public Attributes

int xmin
 the lower x (inclusive).

int ymin
 the lower y (inclusive).

int xmax
 the upper x (inclusive).

int ymax
 the upper y (inclusive).


Detailed Description

A rectangle structure.


The documentation for this struct was generated from the following file:
Generated on Mon Sep 15 12:01:11 2003 for Kyra by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001