ShellSprite Class Reference

#include <ShellSprite.h>

Inheritance diagram for ShellSprite:

Inheritance graph
[legend]
Collaboration diagram for ShellSprite:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ShellSprite ()
 Create a invisible, inactive ShellSprite at an undefined location.
 ShellSprite (float pos[], float vel[], float rot[], bool dummy=false)
 Create a ShellSprite at with a specified pose and a specified velocity.
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.
virtual void getCollisionPoint (float where[3])
 Compute where this Shell would collide.
virtual Packet packObject () const
 Create a network packet representing vital data about this Sprite.
virtual void setObject (Packet &p)
 Set this object's data to that represented by the packet p.

Protected Member Functions

template<bool forReal>
bool execUpdate (float dt)
 Update this shell objects physics.
virtual void explode ()

Static Protected Member Functions

static void Init ()

Private Attributes

std::list< float > trajectory
bool canExplode

Static Private Attributes

static bool initialized
static Modelm

Constructor & Destructor Documentation

ShellSprite::ShellSprite (  )  [inline]

Create a invisible, inactive ShellSprite at an undefined location.

ShellSprite::ShellSprite ( float  pos[],
float  vel[],
float  rot[],
bool  dummy = false 
)

Create a ShellSprite at with a specified pose and a specified velocity.

Parameters:
pos Where in the world the shell's origo should be.
vel The velocity the shell should have.
rot The rotation of the shell.


Member Function Documentation

virtual bool ShellSprite::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.

template<bool forReal>
bool ShellSprite::execUpdate ( float  dt  )  [protected]

Update this shell objects physics.

If forReal i true the update is "sticky" otherwise it is only a simulation and can not affect anything or explode etc.

Parameters:
dt Timestep to use for update.
Returns:
true if collison ocurred during update, false if not.

virtual void ShellSprite::explode (  )  [protected, virtual]

virtual void ShellSprite::getCollisionPoint ( float  where[3]  )  [virtual]

Compute where this Shell would collide.

The function considers the world to be static and it does not modify the Shell.

Parameters:
where The resulting point in the world where the sprite will collide.

static void ShellSprite::Init (  )  [static, protected]

virtual bool ShellSprite::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 Packet ShellSprite::packObject (  )  const [virtual]

Create a network packet representing vital data about this Sprite.

The default implementation packs an SPRITE_UDATE string followed by the sprites URI and all physics data in the form pos[0] rot[0] vel[0] ... aVel[3].

See also:
setObject

Reimplemented from Sprite.

virtual void ShellSprite::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 ShellSprite::setObject ( Packet p  )  [virtual]

Set this object's data to that represented by the packet p.

The default implementation unpacks a packet created by the default impl. of packObject().

Reimplemented from Sprite.

virtual void ShellSprite::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

bool ShellSprite::canExplode [private]

bool ShellSprite::initialized [static, private]

Model* ShellSprite::m [static, private]

std::list<float> ShellSprite::trajectory [private]


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