Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Spectre::CollideKey Class Reference

A class that allows Collidable s to be sorted quickly. More...

#include <spectre.h>

List of all members.

Public Methods

 CollideKey (int s=0, double r=0.)
 Constructor that takes in the surface and the radius and sets its variables. More...

bool operator< (const CollideKey &b) const
 This function checks if two CollideKey s are less than each other. This function is manditory for sorting. More...


Public Attributes

int surface
 This is the major key because you don't want to collide on different surfaces. More...

double radius
 This is the minor key within a surface that says how far from the "center" of the Surface the Collidable is. More...


Detailed Description

A class that allows Collidable s to be sorted quickly.

CollideKey is a class that holds information allowing two Collidable objects to be sorted so that it is easy to narrow down objects which are next to each other. This class is used later in IdTable in order to sort COlidable s.


Constructor & Destructor Documentation

Spectre::CollideKey::CollideKey int    s = 0,
double    r = 0.
[inline]
 

Constructor that takes in the surface and the radius and sets its variables.


Member Function Documentation

bool Spectre::CollideKey::operator< const CollideKey &    b const [inline]
 

This function checks if two CollideKey s are less than each other. This function is manditory for sorting.

The function first checks the major key ( surface ) and then the minor key ( radius )

00021                                                     {
00022             if (surface==b.surface)
00023                 return radius<b.radius;
00024             return surface<b.surface;
00025         }


Member Data Documentation

double Spectre::CollideKey::radius
 

This is the minor key within a surface that says how far from the "center" of the Surface the Collidable is.

Note: This must be a double because of accuracy issues with large numbers.

int Spectre::CollideKey::surface
 

This is the major key because you don't want to collide on different surfaces.


The documentation for this class was generated from the following file:
Generated on Mon Jul 7 21:13:55 2003 for Ethereal by doxygen1.2.15