Orxonox
0.0.5 Codename: Arcturus
|
Baseclass of all projectiles. More...
#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/modules/weapons/projectiles/BasicProjectile.h>
Public Member Functions | |
BasicProjectile () | |
Constructor. More... | |
virtual | ~BasicProjectile () |
virtual void | destroyObject (void) |
Destroys the object. More... | |
float | getDamage () const |
Get the normal damage done by this projectile. More... | |
float | getHealthDamage () const |
Get the health-damage done by this projectile. More... | |
float | getShieldDamage () const |
Get the shield-damage done by this projectile. More... | |
Pawn * | getShooter (void) |
Get the entity that fired the projectile. More... | |
void | setDamage (float damage) |
Set the normal damage done by this projectile. More... | |
void | setHealthDamage (float healthdamage) |
Set the health-damage done by this projectile. More... | |
void | setShieldDamage (float shielddamage) |
Set the shield-damage done by this projectile. More... | |
virtual void | setShooter (Pawn *shooter) |
Set the entity that fired the projectile. More... | |
![]() | |
OrxonoxInterface () | |
![]() | |
Configurable () | |
void | setConfigValues () |
Function to collect the SetConfigValue-macro calls. More... | |
![]() | |
Listable () | |
Constructor: Allocates space in the element list. More... | |
Listable (Context *context) | |
Constructor: Allocates space in the element list and assigns the context. More... | |
virtual | ~Listable () |
Destructor: Removes the object from the object-lists. More... | |
Context * | getContext () const |
void | setContext (Context *context) |
Changes the context. More... | |
void | unregisterObject () |
Removes this object from the object-lists. More... | |
![]() | |
Identifiable () | |
Constructor: Sets the default values. More... | |
virtual | ~Identifiable () |
ORX_FORCEINLINE void * | getDerivedPointer (unsigned int classID) |
Returns a valid pointer of any derived type that is registered in the class hierarchy. More... | |
template<class T > | |
ORX_FORCEINLINE T * | getDerivedPointer (unsigned int classID) |
Version of getDerivedPointer with template. More... | |
template<class T > | |
ORX_FORCEINLINE const T * | getDerivedPointer (unsigned int classID) const |
Const version of getDerivedPointer with template. More... | |
Identifier * | getIdentifier () const |
Returns the Identifier of the object. More... | |
bool | isA (const Identifier *identifier) |
Returns true if the object's class is of the given type or a derivative. More... | |
template<class B > | |
bool | isA (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is of the given type or a derivative. More... | |
bool | isA (const Identifiable *object) |
Returns true if the object's class is of the given type or a derivative. More... | |
bool | isChildOf (const Identifier *identifier) |
Returns true if the object's class is a child of the given type. More... | |
template<class B > | |
bool | isChildOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a child of the given type. More... | |
bool | isChildOf (const Identifiable *object) |
Returns true if the object's class is a child of the given type. More... | |
bool | isDirectChildOf (const Identifier *identifier) |
Returns true if the object's class is a direct child of the given type. More... | |
template<class B > | |
bool | isDirectChildOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a direct child of the given type. More... | |
bool | isDirectChildOf (const Identifiable *object) |
Returns true if the object's class is a direct child of the given type. More... | |
bool | isDirectParentOf (const Identifier *identifier) |
Returns true if the object's class is a direct parent of the given type. More... | |
template<class B > | |
bool | isDirectParentOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a direct parent of the given type. More... | |
bool | isDirectParentOf (const Identifiable *object) |
Returns true if the object's class is a direct child of the given type. More... | |
bool | isExactlyA (const Identifier *identifier) |
Returns true if the object's class is exactly of the given type. More... | |
template<class B > | |
bool | isExactlyA (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is exactly of the given type. More... | |
bool | isExactlyA (const Identifiable *object) |
Returns true if the object's class is exactly of the given type. More... | |
bool | isParentOf (const Identifier *identifier) |
Returns true if the object's class is a parent of the given type. More... | |
template<class B > | |
bool | isParentOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a parent of the given type. More... | |
bool | isParentOf (const Identifiable *object) |
Returns true if the object's class is a parent of the given type. More... | |
![]() | |
Destroyable () | |
Constructor: Sets the default values. More... | |
virtual | ~Destroyable () |
Destructor: Notifies all DestructionListener (for example weak pointers) that this object is being deleted. More... | |
void | destroy () |
Deletes the object if no strong pointers point to this object. More... | |
void | destroyLater () |
Works like destroy() but doesn't destroy the object until the current tick has ended. More... | |
unsigned int | getReferenceCount () const |
Returns the number of strong pointers that point to this object. More... | |
Protected Member Functions | |
void | destroyCheck (void) |
Check whether the projectile needs to be destroyed and destroys it if so. More... | |
bool | getDestroyAfterCollision () const |
bool | processCollision (WorldEntity *otherObject, btManifoldPoint &contactPoint, const btCollisionShape *cs) |
The function called when a projectile hits another thing. More... | |
void | setDestroyAfterCollision (bool destroyAfterCollision) |
![]() | |
virtual void | preDestroy () |
This virtual function is called if destroy() is called and no StrongPtr points to this object. More... | |
Private Member Functions | |
bool | isObjectRelatedToShooter (WorldEntity *otherObject) |
Returns true if otherObject is equal to the shooter or if one of otherObject's parents is equal to the shooter or if one of the shooter's parent is equal to otherObject. More... | |
Private Attributes | |
bool | bDestroy_ |
Boolean, to check whether a projectile should be destroyed. More... | |
float | damage_ |
The amount of normal damage. Normal damage can be (partially) absorbed by shields. More... | |
bool | destroyAfterCollision_ |
Boolean, defines whether the projectile gets detroyed after a collision. More... | |
float | healthdamage_ |
The amount of health-damage. Health-damage cannot be absorbed by shields. More... | |
float | shielddamage_ |
The amount of shield-damage. Shield-damage only reduces shield health. More... | |
WeakPtr< Pawn > | shooter_ |
The entity that fired the projectile. More... | |
Baseclass of all projectiles.
Defines the damage the projectile does.
orxonox::BasicProjectile::BasicProjectile | ( | ) |
Constructor.
Registers the object and initializes some default values.
|
virtual |
Check whether the projectile needs to be destroyed and destroys it if so.
Needs to be called in the tick() by every Class directly inheriting from BasicProjectile, to make sure the projectile is destroyed after it has hit something.
Destroys the object.
Reimplemented in orxonox::Rocket, and orxonox::RocketOld.
|
inline |
Get the normal damage done by this projectile.
Normal damage can be (partially) absorbed by shields.
|
inlineprotected |
|
inline |
Get the health-damage done by this projectile.
Health-damage cannot be absorbed by shields.
|
inline |
Get the shield-damage done by this projectile.
Get the entity that fired the projectile.
|
private |
Returns true if otherObject is equal to the shooter or if one of otherObject's parents is equal to the shooter or if one of the shooter's parent is equal to otherObject.
|
protected |
The function called when a projectile hits another thing.
Calls the hit-function, starts the shield recharge countdown, displays visual hit effects defined in Pawn. Needs to be called in the collidesAgainst() function by every Class directly inheriting from BasicProjectile.
otherObject | A pointer to the object the Projectile has collided against. |
contactPoint | A btManifoldPoint indicating the point of contact/impact. |
cs | The btCollisionShape of the other object |
|
inline |
Set the normal damage done by this projectile.
Normal damage can be (partially) absorbed by shields.
damage | The amount of damage. Must be non-negative. |
|
inlineprotected |
|
inline |
Set the health-damage done by this projectile.
Health-damage cannot be absorbed by shields.
healthdamage | The amount of damage. Must be non-negative. |
|
inline |
Set the shield-damage done by this projectile.
Shield-damage only reduces shield health.
shielddamage | The amount of damage. Must be non-negative. |
Set the entity that fired the projectile.
shooter | A pointer to the Pawn that fired the projectile. |
Reimplemented in orxonox::SimpleRocket, orxonox::Rocket, and orxonox::RocketOld.
|
private |
Boolean, to check whether a projectile should be destroyed.
|
private |
The amount of normal damage. Normal damage can be (partially) absorbed by shields.
|
private |
Boolean, defines whether the projectile gets detroyed after a collision.
|
private |
The amount of health-damage. Health-damage cannot be absorbed by shields.
|
private |
The amount of shield-damage. Shield-damage only reduces shield health.