Arkanoid Remake
1.0
|
Dynamic object with velocity control. More...
#include <DynObj.h>
Public Member Functions | |
DynObj () | |
Default constructor. | |
DynObj (const DynObj &obj) | |
Copy contructor. | |
void | SetVel (double x, double y) |
Set the velocity along the axes. | |
void | SetVelX (double x) |
Set the velocity along the X axis. | |
void | SetVelY (double y) |
Set the velocity along the Y axis. | |
const VecXy & | Vel () const |
Get the velocity vector. | |
const double | VelX () const |
Get the velocity component along the X axis. | |
const double | VelY () const |
Get the velocity component along the Y axis. | |
void | InvertVelX () |
Invert the velocity component along the X axis. | |
void | InvertVelY () |
Invert the velocity component along the Y axis. | |
const double | Speed () const |
Get the speed (recalculate it if needed) | |
const double | SquareSpeed () const |
Get the square speed (recalculate it if needed) | |
void | Move (double delta_time) |
Move according to the velocity. | |
void | Stop () |
Stop: reset the velocity. | |
const VecXy & | PrevPos () const |
VecXy & | PrevPos () |
![]() | |
BoxObj (double x=0.0, double y=0.0) | |
Default constructor with optional intialization list. | |
BoxObj (const BoxObj &obj) | |
VecXy & | Pos () |
Position. | |
const VecXy & | Pos () const |
Position (read only) | |
VecXy & | Origin () |
Origin (min x,y corner) | |
const VecXy & | Origin () const |
Origin (min x,y corner, read-only) | |
VecXy & | Size () |
Size. | |
const VecXy & | Size () const |
Size (read only) | |
const double | MinX () const |
Lower X value. | |
const double | MinY () const |
Lower Y value. | |
const double | MaxX () const |
Upper X value. | |
const double | MaxY () const |
Upper X value. | |
const VecXy | HSize () const |
Half size. | |
const double | HSizeX () const |
Half size along X axis. | |
const double | HSizeY () const |
Half size along Y axis. | |
Protected Member Functions | |
void | UpdateSpeed () const |
Update the scala speed values based on the velocity. | |
Protected Attributes | |
VecXy | mVel |
VecXy | mPrevPos |
![]() | |
VecXy | mPos |
VecXy | mSize |
VecXy | mOrigin |
Dynamic object with velocity control.
The DynObj class implements the specific behaviour of a specialized box-shaped object, thus it is derived from the BoxObj class.