mElite  1.0
An Elite clone based on TextElite by Jan-Philipp Kappmeier and Melanie Schmidt.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | List of all members
PlayerObject Class Reference

This class represents the player. More...

#include <PlayerObject.h>

Inheritance diagram for PlayerObject:
CameraObject SpaceShip MovingObject MovingObject ModelObject GameObject GameObject GraphicsObject GameObject

Public Member Functions

 PlayerObject (float r, GLuint displayList)
 
 PlayerObject (Vector3 position, float r, GLuint displayList)
 
 PlayerObject (float x, float y, float z, float r, GLuint displayList)
 
 ~PlayerObject (void)
 
void coolLaser (DWORD time)
 Cools the laser.
 
- Public Member Functions inherited from CameraObject
 CameraObject (void)
 Initializes the camera residing in the center of the scene.
 
 CameraObject (Vector3 position)
 Initializes the eye with a given position but standard view direction.
 
 CameraObject (float x, float y, float z)
 Initializes the eye with a given position but standard view direction.
 
 ~CameraObject (void)
 Destructor.
 
bool isRearView (void)
 Checks, if rear view is enabled.
 
void look (void)
 Moves the camera to the position defined by eye and adjusts it to view to the correct position.
 
void toggleRearView (void)
 Switches to rear view and back to normal view.
 
void moveDown (float t)
 Moves the camera position downwards.
 
void moveLeft (float t)
 Moves the camera position to the left.
 
void moveRight (float t)
 Moves the camera position to the right.
 
void moveUp (float t)
 Moves the camera position upwards.
 
void setMoveSpeed (float t)
 Sets the speed for camera movement. speed the speed.
 
- Public Member Functions inherited from MovingObject
 MovingObject ()
 Constructor, initializes to the origin. The line of vision is aligned to the z axis, the up vector is aligned to the y-axis.
 
 MovingObject (Vector3 position)
 Constructor initializing to a given position as Vector3.
 
 MovingObject (float x, float y, float z)
 Constructor, the startposition is (x,y,z).
 
 ~MovingObject (void)
 Destructor.
 
void pitch (float angle)
 Pitches the line of vision.
 
void roll (float angle)
 Rolls the eye.
 
Vector3 getRight (void)
 Returns the vector indiciating what is 'right' of the eye.
 
Vector3 getUp (void)
 Returns the vector indication what is 'up'.
 
Vector3 getView (void)
 Returns the current viewing vector.
 
void setView (Vector3 v)
 Sets the current viewing vector.
 
void accelerate (float step)
 Sets the speed.
 
void advance (float t)
 Move the camera depending on the current speed and line of vision.
 
float getMaxSpeed (void)
 Returns the maximal speed.
 
float getMinSpeed (void)
 Returns the minimal speed.
 
float getSpeed (void)
 Returns the vector indicating the direction 'right'.
 
void setMaxSpeed (float speed)
 Sets the maximal speed.
 
void setMinSpeed (float speed)
 Sets the minimal speed.
 
void setSpeed (float speed)
 Sets the current speed.
 
void setStep (float step)
 Sets the value that is advanced in one step.
 
- Public Member Functions inherited from GameObject
 GameObject (void)
 The constructor creates the object. The position is set to zero by default.
 
 GameObject (Vector3 position)
 The constructor creates the object and gives it a position in the scene.
 
 GameObject (float x, float y, float z)
 The constructor creates the object and gives it a position in the scene.
 
 ~GameObject (void)
 Destructor. Does nothing.
 
virtual Vector3 getPos (void)
 Returns the current position as Vector3 triple.
 
void setPos (float x, float y, float z)
 Sets the current position.
 
void setPos (Vector3 position)
 Sets the current position.
 
- Public Member Functions inherited from SpaceShip
 SpaceShip (float r, GLuint displayList)
 Initializes the space ship.
 
 SpaceShip (Vector3 position, float r, GLuint displayList)
 Initializes the space ship.
 
 SpaceShip (float x, float y, float z, float r, GLuint displayList)
 Initializes the space ship.
 
 ~SpaceShip (void)
 Destructor.
 
void draw ()
 Draws the object using the base class drawing method.
 
Vector3 getOriginalView (void)
 Returns the original view vector.
 
Vector3 getOriginalUp (void)
 Returns the original up vector.
 
bool isDestroyed ()
 Determines wheather a ship is destroyed or not.
 
virtual void update (float t)
 
float getLaserHeat (void)
 Returns the current heat of the laser.
 
float getMaxLaserHeat (void)
 
float getLaserPercentage (void)
 Returns the percentage of the heat of the maximal heat.
 
unsigned int getMissileCount (void)
 Returns the current amount of missiles.
 
bool isOverHeated (void)
 Returns true if the laser is overheated, otherwise false.
 
void useMissile (void)
 Shoots a missile, if possible.
 
bool isShooting ()
 
void setShoot (bool status)
 
float getBackShieldPower (void)
 Returns the current back shield power.
 
float getBackShieldPowerPercentage (void)
 Returns the current percentage of back shield power.
 
float getFrontShieldPower (void)
 Returns the current front shield power.
 
float getFrontShieldPowerPercentage (void)
 Returns the current percentage of front shield power.
 
void setShieldRecovering (bool recovers)
 
void receiveHitBack (DWORD time)
 
void receiveHitFront (DWORD time)
 
void setShieldCapacity (float capacity)
 
bool shipWasHitOnce ()
 

Additional Inherited Members

- Protected Member Functions inherited from SpaceShip
void advance (float t)
 
void updateLaser (float t)
 
void setLaserHeat (float heat)
 

Detailed Description

This class represents the player.

A player combines a camera and a space ship.

Definition at line 16 of file PlayerObject.h.

Constructor & Destructor Documentation

PlayerObject::PlayerObject ( float  r,
GLuint  displayList 
)

Definition at line 8 of file PlayerObject.cpp.

PlayerObject::PlayerObject ( Vector3  position,
float  r,
GLuint  displayList 
)

Definition at line 12 of file PlayerObject.cpp.

PlayerObject::PlayerObject ( float  x,
float  y,
float  z,
float  r,
GLuint  displayList 
)

Definition at line 16 of file PlayerObject.cpp.

PlayerObject::~PlayerObject ( void  )

Definition at line 20 of file PlayerObject.cpp.

Member Function Documentation

void PlayerObject::coolLaser ( DWORD  time)
virtual

Cools the laser.

If the laser is not used, this function is called. It cools the laser until its heat is zero. This is called in the SpaceShip::advance() method.

Parameters
timethe time that has passed

Reimplemented from SpaceShip.

Definition at line 23 of file PlayerObject.cpp.


The documentation for this class was generated from the following files: