Gel2D object base class. More...
#include <gelObject.h>
Public Member Functions | |
GelObject () | |
Default constructor. | |
GelObject (Gel2dVec obj_pos, float obj_rot, Gel2dVec obj_scl) | |
Convenience constructor. | |
Gel2dVec | getPos () const |
Gets the position (translation) of the object. | |
void | setPos (const Gel2dVec &vecPos) |
Sets the position (translation) of the object. | |
float | getRot () const |
Gets the rotation of the object. | |
void | setRot (float deg) |
Sets the rotation of the object. | |
Gel2dVec | getScale () const |
Gets the scale of the object. | |
void | setScale (const Gel2dVec &vecScale) |
Sets the scale of the object. | |
Gel2dVec | getHotSpot () const |
Gets the coordinates of the object's center for translation, rotation, and scaling. | |
void | setHotSpot (const Gel2dVec &vecHotSpot) |
Sets the coordinates of the object's center for translation, rotation, and scaling. | |
void | move (const Gel2dVec &trans) |
Moves the object by the specified amount. | |
void | rotate (float deg) |
Rotates the object by the specified amount. | |
void | scale (const Gel2dVec &scale) |
Scales the object by the specified amount. | |
void | moveTo (const Gel2dVec &vec, int frames) |
Moves the object using interpolation. | |
void | scaleTo (const Gel2dVec &vec, int frames) |
Scales the object using interpolation. | |
float | getDistanceTo (const GelObject &obj) const |
Gets the distance from this object to another GelObject. | |
float | getDistanceTo (const Gel2dVec &vec) const |
Gets the distance from this object to a Gel2dVec. | |
void | setParent (GelObject *par, int delay) |
GelObject | getParent () const |
void | removeParent () |
bool | hasParent () const |
bool | isMouseOver () |
Tests if the mouse cursor is over this object. | |
bool | isMouseOver (int width, int height, int mousex, int mousey) |
Tests if the mouse cursor is over this object. | |
Gel2dVec | getLocalCoords (int screenx, int screeny) const |
Gel2dVec | getLocalCoords (int width, int height, int screenx, int screeny) const |
CollisionBounds | getCollisionBounds () const |
void | setCollisionBounds (CollisionBounds type) |
virtual GelCircle | getCircle () const |
Gets the object's bounding circle. | |
virtual GelAABB | getAABB () const |
Gets the object's axis-aligned bounding box. | |
virtual void | render () |
Protected Member Functions | |
void | fix () |
int | _testMouseIntersect () |
virtual int | _pointIntersect (float locx, float locy) |
Protected Attributes | |
Gel2dVec | pos |
Position. | |
float | rot |
Rotation. | |
Gel2dVec | scl |
Scale. | |
Gel2dVec | hotSpot |
Center of translation, rotation, and scaling. | |
GelObject * | parent |
Parent object. | |
int | isCursorOver |
int | bMouseTest |
int | view [4] |
double | model [16] |
double | proj [16] |
int | customParam |
int | wndWidth |
int | wndHeight |
int | mouseX |
int | mouseY |
CollisionBounds | collisionBounds |
float | radius |
Gel2dVec | par_pos |
Gel2dVec | chd_pos |
float | par_rot |
float | chd_rot |
Gel2dVec | par_scl |
int | par_delay |
Gel2D object base class.
gel::GelObject::GelObject | ( | ) |
Default constructor.
Convenience constructor.
Sets the object's position, rotation, and scale.
obj_pos | : The object's x and y coordinates. |
obj_rot | : The rotation of the object in degrees. |
obj_scl | : The object's scale. |
Gel2dVec gel::GelObject::getPos | ( | ) | const [inline] |
Gets the position (translation) of the object.
void gel::GelObject::setPos | ( | const Gel2dVec & | vecPos | ) | [inline] |
Sets the position (translation) of the object.
vecPos | : A Gel2dVec containing the new x and y coordinates. |
float gel::GelObject::getRot | ( | ) | const [inline] |
Gets the rotation of the object.
void gel::GelObject::setRot | ( | float | deg | ) | [inline] |
Sets the rotation of the object.
If deg is set to a number above 360 or below 0, it will automatically be reset to it's equivalent angle within the 0-360 range.
deg | : The new rotation of the object in degrees. It should be in range from 0 to 360. |
Gel2dVec gel::GelObject::getScale | ( | ) | const [inline] |
Gets the scale of the object.
void gel::GelObject::setScale | ( | const Gel2dVec & | vecScale | ) | [inline] |
Sets the scale of the object.
vecScale | : A Gel2dVec containing the new scale of the x and y axes, respectively. |
Gel2dVec gel::GelObject::getHotSpot | ( | ) | const [inline] |
Gets the coordinates of the object's center for translation, rotation, and scaling.
void gel::GelObject::setHotSpot | ( | const Gel2dVec & | vecHotSpot | ) | [inline] |
Sets the coordinates of the object's center for translation, rotation, and scaling.
vecHotSpot | : A Gel2dVec containing the new x and y coordinates. |
void gel::GelObject::move | ( | const Gel2dVec & | trans | ) | [inline] |
Moves the object by the specified amount.
trans | : The amount to move the object, in pixels. |
void gel::GelObject::rotate | ( | float | deg | ) | [inline] |
Rotates the object by the specified amount.
deg | : The amount to rotate the object, in degrees. |
void gel::GelObject::scale | ( | const Gel2dVec & | scale | ) | [inline] |
Scales the object by the specified amount.
scale | : The amount to scale the object. |
void gel::GelObject::moveTo | ( | const Gel2dVec & | vec, |
int | frames | ||
) |
Moves the object using interpolation.
Moves the object to the location specified in vec, in the duration specified by frames.
This function will probably be removed in a later release.
vec | : The position to move to. |
frames | : The number of frames to interpolate the movement across. |
void gel::GelObject::scaleTo | ( | const Gel2dVec & | vec, |
int | frames | ||
) |
Scales the object using interpolation.
Scales the object to the scale specified in vec, in the duration specified by frames.
This function will probably be removed in a later release.
vec | : The scale. |
frames | : The number of frames to interpolate the scale across. |
float gel::GelObject::getDistanceTo | ( | const GelObject & | obj | ) | const |
float gel::GelObject::getDistanceTo | ( | const Gel2dVec & | vec | ) | const |
void gel::GelObject::setParent | ( | GelObject * | par, |
int | delay | ||
) |
GelObject gel::GelObject::getParent | ( | ) | const [inline] |
void gel::GelObject::removeParent | ( | ) |
bool gel::GelObject::hasParent | ( | ) | const |
bool gel::GelObject::isMouseOver | ( | ) |
Tests if the mouse cursor is over this object.
bool gel::GelObject::isMouseOver | ( | int | width, |
int | height, | ||
int | mousex, | ||
int | mousey | ||
) |
Tests if the mouse cursor is over this object.
This overloaded function allows you to specify alternate window dimensions and mouse coordinates.
width | : Window width. |
height | : Window height. |
mousex | : Mouse cursor's horizontal position. |
mousey | : Mouse cursor's vertical position. |
Gel2dVec gel::GelObject::getLocalCoords | ( | int | screenx, |
int | screeny | ||
) | const |
Gel2dVec gel::GelObject::getLocalCoords | ( | int | width, |
int | height, | ||
int | screenx, | ||
int | screeny | ||
) | const |
CollisionBounds gel::GelObject::getCollisionBounds | ( | ) | const [inline] |
void gel::GelObject::setCollisionBounds | ( | CollisionBounds | type | ) | [inline] |
virtual GelCircle gel::GelObject::getCircle | ( | ) | const [virtual] |
Gets the object's bounding circle.
virtual GelAABB gel::GelObject::getAABB | ( | ) | const [virtual] |
Gets the object's axis-aligned bounding box.
Reimplemented in gel::GelSprite.
virtual void gel::GelObject::render | ( | ) | [virtual] |
Reimplemented in gel::GelArmature, gel::GelCamera, gel::GelGUIText, gel::GelGUIButton, gel::GelGUICheckBox, gel::GelLine, gel::GelParticleSys, gel::GelSprite, gel::GelAnimSprite, and gel::GelText.
void gel::GelObject::fix | ( | ) | [protected] |
int gel::GelObject::_testMouseIntersect | ( | ) | [protected] |
virtual int gel::GelObject::_pointIntersect | ( | float | locx, |
float | locy | ||
) | [protected, virtual] |
Reimplemented in gel::GelSprite.
Gel2dVec gel::GelObject::pos [protected] |
Position.
float gel::GelObject::rot [protected] |
Rotation.
Gel2dVec gel::GelObject::scl [protected] |
Scale.
Gel2dVec gel::GelObject::hotSpot [protected] |
Center of translation, rotation, and scaling.
GelObject* gel::GelObject::parent [protected] |
Parent object.
int gel::GelObject::isCursorOver [protected] |
int gel::GelObject::bMouseTest [protected] |
int gel::GelObject::view[4] [protected] |
double gel::GelObject::model[16] [protected] |
double gel::GelObject::proj[16] [protected] |
int gel::GelObject::customParam [protected] |
int gel::GelObject::wndWidth [protected] |
int gel::GelObject::wndHeight [protected] |
int gel::GelObject::mouseX [protected] |
int gel::GelObject::mouseY [protected] |
CollisionBounds gel::GelObject::collisionBounds [protected] |
float gel::GelObject::radius [protected] |
Gel2dVec gel::GelObject::par_pos [protected] |
Gel2dVec gel::GelObject::chd_pos [protected] |
float gel::GelObject::par_rot [protected] |
float gel::GelObject::chd_rot [protected] |
Gel2dVec gel::GelObject::par_scl [protected] |
int gel::GelObject::par_delay [protected] |
API Documentation by Mark D. Procarione | Generated by |