#include <spectre.h>
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... |
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 that takes in the surface and the radius and sets its variables.
|
|
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 )
|
|
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. |
|
This is the major key because you don't want to collide on different surfaces.
|