BirdSprite Class Reference

Represents a single bird that may or may not be part of a flock. More...

#include <BirdSprite.h>

Inheritance diagram for BirdSprite:

Inheritance graph
[legend]
Collaboration diagram for BirdSprite:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BirdSprite (float x, float y)
 Create a new bird of the default type at location x,y.
virtual ~BirdSprite ()
 Delete this bird and remove it from the flock.
virtual void update ()
 Update this sprite's pysics and stuff.
virtual void paint ()
 Draw this sprite on screen.
virtual bool notifyCollision (Sprite *sender)
 Notify an other sprite that we think we have collided with it.
virtual bool checkCollision (Sprite *with, bool fromSelf=false)
 Performe collision detection and handling between two sprites.

Static Public Member Functions

static std::list< BirdSprite * > & MakeFlock (float x, float y, int nmemb)
 Create a flock of nmemb birds in the area around x,y.

Protected Attributes

std::list< BirdSprite * > * flock
float turnRate
float azimuth
float roll
float speed
float z
int count
int direction

Static Protected Attributes

static Modelm

Detailed Description

Represents a single bird that may or may not be part of a flock.


Constructor & Destructor Documentation

BirdSprite::BirdSprite ( float  x,
float  y 
)

Create a new bird of the default type at location x,y.

virtual BirdSprite::~BirdSprite (  )  [virtual]

Delete this bird and remove it from the flock.


Member Function Documentation

virtual bool BirdSprite::checkCollision ( Sprite with,
bool  fromSelf = false 
) [virtual]

Performe collision detection and handling between two sprites.

Parameters:
with The sprite to performe collision detection with.
fromSelf set this to true when the collision check originates from one self, normally all external callers should leave this variable at the default (false) value.
Returns:
true if a collision was detected, false otherwise.

Reimplemented from Sprite.

static std::list<BirdSprite*>& BirdSprite::MakeFlock ( float  x,
float  y,
int  nmemb 
) [static]

Create a flock of nmemb birds in the area around x,y.

virtual bool BirdSprite::notifyCollision ( Sprite sender  )  [virtual]

Notify an other sprite that we think we have collided with it.

Parameters:
sender Pointer to the sprite that detected the collision.
Returns:
true if the receiving object accepts this as a collision, false otherwise.

Reimplemented from Sprite.

virtual void BirdSprite::paint (  )  [virtual]

Draw this sprite on screen.

The paint method is allowed to change the model-view matrix and any pushable attributes.

Implements Sprite.

virtual void BirdSprite::update (  )  [virtual]

Update this sprite's pysics and stuff.

Note that the update method should use the static dTime variable to check the time since last invokation. The caller is responsible for setting this variable to an apropriate value!

Implements Sprite.


Member Data Documentation

float BirdSprite::azimuth [protected]

int BirdSprite::count [protected]

int BirdSprite::direction [protected]

std::list<BirdSprite*>* BirdSprite::flock [protected]

Model* BirdSprite::m [static, protected]

float BirdSprite::roll [protected]

float BirdSprite::speed [protected]

float BirdSprite::turnRate [protected]

float BirdSprite::z [protected]


The documentation for this class was generated from the following file:
Generated on Sun Mar 11 15:33:26 2007 for MetalWarriors by  doxygen 1.4.7