Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
orxonox::SpaceShip Class Reference

The SpaceShip is the principal entity through which the player interacts with the game. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/orxonox/worldentities/pawns/SpaceShip.h>

Inheritance diagram for orxonox::SpaceShip:
orxonox::Pawn orxonox::ControllableEntity orxonox::RadarViewable orxonox::PickupCarrier orxonox::MobileEntity orxonox::OrxonoxInterface orxonox::OrxonoxInterface orxonox::WorldEntity orxonox::Tickable orxonox::Configurable orxonox::Destroyable orxonox::Configurable orxonox::Destroyable orxonox::BaseObject orxonox::Synchronisable orxonox::OrxonoxInterface orxonox::Listable orxonox::Listable orxonox::OrxonoxClass orxonox::OrxonoxInterface orxonox::Configurable orxonox::Destroyable orxonox::Identifiable orxonox::Identifiable orxonox::Configurable orxonox::Destroyable orxonox::Configurable orxonox::Destroyable orxonox::Listable orxonox::Listable orxonox::Listable orxonox::Identifiable orxonox::Identifiable orxonox::Identifiable orxonox::Asteroids2DShip orxonox::Destroyer orxonox::DodgeRaceShip orxonox::FlappyOrxShip orxonox::HoverShip orxonox::InvaderShip orxonox::ModularSpaceShip orxonox::OrxoKartKart orxonox::OrxyRoadShip orxonox::PacmanGelb orxonox::StoryModePawn orxonox::TowerDefenseEnemy

Public Member Functions

 SpaceShip (Context *context)
 
virtual ~SpaceShip ()
 
void addEngine (Engine *engine)
 Add an Engine to the SpaceShip. More...
 
void addSpeed (float speed)
 Add to the speed factor for all engines of the SpaceShip. More...
 
void addSpeedFactor (float factor)
 Add to the speed factor for all engines of the SpaceShip. More...
 
virtual void boost (bool bBoost)
 Starts or stops boosting. More...
 
virtual void fire ()
 
void gainBoostPower (float gainedBoostPower)
 Add boost power. More...
 
float getBoostCooldownDuration () const
 Get the cooldown duration. More...
 
float getBoostFactor () const
 Get the mean boost factor over all engines of the SpaceShip. More...
 
float getBoostPower () const
 Get the current boost power. More...
 
float getBoostPowerRate () const
 Get the boost power rate. More...
 
float getBoostRate () const
 Get the boost rate. More...
 
EnginegetEngine (unsigned int i)
 Get the i-th Engine of the SpaceShip. More...
 
EnginegetEngineByName (const std::string &name)
 Looks for an attached Engine with a certain name. More...
 
const std::vector< Engine * > & getEngineList () const
 Get the list of all Engines that are mounted on the SpaceShip. More...
 
float getInitialBoostPower () const
 Get the initial boost power. More...
 
float getMaxSpeedFront () const
 Get the largest maximal forward speed over all engines of the SpaceShip. More...
 
float getShakeAmplitude () const
 Get the shake amplitude. More...
 
float getShakeFrequency () const
 Get the shake frequency. More...
 
float getSpeedFactor () const
 Get the mean speed factor over all engines of the SpaceShip. More...
 
const Vector3 & getSteeringDirection () const
 Get the steering direction of the SpaceShip. More...
 
bool hasEngine (Engine *engine) const
 Check whether the SpaceShip has a particular Engine. More...
 
bool isBoostCoolingDown () const
 Check whether the SpaceShip boost is cooling down. More...
 
bool isBoosting () const
 Check whether the SpaceShip is currently boosting. More...
 
virtual void moveFrontBack (const Vector2 &value)
 Move forward or backward,. More...
 
void moveFrontBack (float value)
 
virtual void moveRightLeft (const Vector2 &value)
 Move right or left. More...
 
void moveRightLeft (float value)
 
virtual void moveUpDown (const Vector2 &value)
 Move up or down. More...
 
void moveUpDown (float value)
 
void removeAllEngines ()
 Remove and destroy all Engines of the SpaceShip. More...
 
void removeEngine (Engine *engine)
 Remove a particular Engine from the SpaceShip. More...
 
virtual void rotatePitch (const Vector2 &value)
 Rotate in pitch direction. More...
 
virtual void rotateRoll (const Vector2 &value)
 Rotate in roll direction. More...
 
virtual void rotateYaw (const Vector2 &value)
 Rotate in yaw direction. More...
 
void setBoostCooldownDuration (float duration)
 Set the duration for which boosting, if in cooldown, is not possible. More...
 
void setBoostPowerRate (float rate)
 Set the rate, at which boost power is recharged, to the input value. More...
 
void setBoostRate (float rate)
 Set the rate, at which boost power us used up, to the input value. More...
 
void setConfigValues ()
 
void setInitialBoostPower (float power)
 Set the initial power available for boosting to the input value. More...
 
void setShakeAmplitude (float amplitude)
 Set the amplitude with which the camera shakes during boosting. More...
 
void setShakeFrequency (float frequency)
 Set the frequency with which the camera shakes during boosting. More...
 
void setSteeringDirection (const Vector3 &direction)
 Set the steering direction of the SpaceShip. More...
 
virtual void tick (float dt)
 Gets called every frame. More...
 
virtual void XMLPort (Element &xmlelement, XMLPort::Mode mode)
 XML loading and saving. More...
 
- Public Member Functions inherited from orxonox::Pawn
 Pawn (Context *context)
 
virtual ~Pawn ()
 
virtual void addedWeaponPack (WeaponPack *wPack)
 
void addExplosionPart (ExplosionPart *ePart)
 
void addHealth (float health)
 
void addMunitionXML (Munition *munition)
 
void addShieldHealth (float amount)
 
void addWeaponPack (WeaponPack *wPack)
 
void addWeaponPackXML (WeaponPack *wPack)
 
void addWeaponSet (WeaponSet *wSet)
 
void addWeaponSlot (WeaponSlot *wSlot)
 
virtual void changedVisibility () override
 When the visibility is changed, it is changed for all attached objects as well. More...
 
virtual void changedVulnerability ()
 This function gets called if the vulnerability of the pawn changes. More...
 
void decreaseShieldRechargeCountdownTime (float dt)
 
bool doesAcceptPickups ()
 
virtual void fired (unsigned int firemode) override
 Check whether the Pawn has a orxonox::WeaponSystem and fire it with the specified firemode if it has one. More...
 
Vector3 getAimPosition ()
 
virtual const Vector3 & getCarrierPosition (void) const override
 Get the (absolute) position of the PickupCarrier. More...
 
float getDamageMultiplier () const
 
unsigned int getExplosionChunks () const
 
ExplosionPartgetExplosionPart ()
 
const std::string & getExplosionSound ()
 
float getHealth () const
 
float getInitialHealth () const
 
float getInitialShieldHealth () const
 
ControllableEntitygetLastHitOriginator () const
 
float getMaxHealth () const
 
float getMaxShieldHealth () const
 
MunitiongetMunition (SubclassIdentifier< Munition > *identifier)
 
MunitiongetMunitionXML () const
 
float getShieldAbsorption ()
 
float getShieldHealth ()
 
float getShieldRechargeRate () const
 
float getShieldRechargeWaitTime () const
 
float getSpawnParticleDuration () const
 
const std::string & getSpawnParticleSource () const
 
WeaponPackgetWeaponPack (unsigned int index) const
 
WeaponSetgetWeaponSet (unsigned int index) const
 
WeaponSlotgetWeaponSlot (unsigned int index) const
 
const WeaponSystemgetWeaponSystem () const
 
bool hasShield ()
 
virtual void hit (Pawn *originator, const Vector3 &force, const btCollisionShape *cs, float damage, float healthdamage=0.0f, float shielddamage=0.0f)
 
virtual void hit (Pawn *originator, btManifoldPoint &contactpoint, const btCollisionShape *cs, float damage, float healthdamage=0.0f, float shielddamage=0.0f)
 
bool isAlive () const
 
const bool & isVulnerable () const
 Returns the state of the pawns vulnerability. More...
 
virtual void kill ()
 
virtual void postSpawn ()
 
void removeHealth (float health)
 
void resetShieldRechargeCountdown ()
 
void restoreInitialShieldHealth ()
 
void restoreMaxShieldHealth ()
 
void setAimPosition (Vector3 position)
 
void setDamageMultiplier (float multiplier)
 
void setExplosionChunks (unsigned int chunks)
 
void setExplosionSound (const std::string &engineSound)
 
void setHealth (float health)
 
void setInitialHealth (float initialhealth)
 
void setInitialShieldHealth (float initialshieldhealth)
 
void setMaxHealth (float maxhealth)
 
void setMaxShieldHealth (float maxshieldhealth)
 
void setPickupAcceptance (bool b)
 
void setShieldAbsorption (float shieldAbsorption)
 
void setShieldHealth (float shieldHealth)
 
void setShieldRechargeRate (float shieldRechargeRate)
 
void setShieldRechargeWaitTime (float shieldRechargeWaitTime)
 
void setSpawnParticleDuration (float duration)
 
void setSpawnParticleSource (const std::string &source)
 
void setVulnerable (bool bVulnerable)
 Sets the state of the pawns vulnerability. More...
 
virtual void startLocalHumanControl () override
 
void startShieldRechargeCountdown ()
 
virtual void XMLEventPort (Element &xmlelement, XMLPort::Mode mode) override
 Defines the possible event states of this object and parses eventsources from an XML file. More...
 
- Public Member Functions inherited from orxonox::ControllableEntity
 ControllableEntity (Context *context)
 
virtual ~ControllableEntity ()
 
void addCameraPosition (CameraPosition *position)
 
virtual void changedPlayer ()
 
void fire (unsigned int firemode)
 
CameragetCamera () const
 
CameraPositiongetCameraPosition (unsigned int index) const
 
const std::list< StrongPtr< CameraPosition > > & getCameraPositions () const
 
const std::string & getCameraPositionTemplate () const
 
ControllergetController () const
 
unsigned int getCurrentCameraIndex () const
 
CameraPositiongetCurrentCameraPosition ()
 
bool getDestroyWhenPlayerLeft () const
 
PlayerInfogetFormerPlayer () const
 Get the player even after the ControllableEntity has stopped being the players ControllableEntity. More...
 
OverlayGroupgetHUD () const
 
const std::string & getHudTemplate () const
 
float getMouseLookSpeed () const
 
PlayerInfogetPlayer () const
 
CameraPositiongetReverseCamera () const
 
virtual WorldEntitygetTarget ()
 
int getTeam () const
 
ControllergetXMLController () const
 
virtual void greet ()
 
bool hasHumanController () const
 
bool hasLocalController () const
 
bool isInMouseLook () const
 
virtual void mouseLook ()
 
void moveFrontBack (float value)
 
void moveRightLeft (float value)
 
void moveUpDown (float value)
 
virtual void reload ()
 
void rotatePitch (float value)
 
void rotateRoll (float value)
 
void rotateYaw (float value)
 
virtual void setAngularVelocity (const Vector3 &velocity) override
 
bool setCameraPosition (unsigned int index)
 
void setCameraPositionTemplate (const std::string &name)
 
void setConfigValues ()
 
void setController (Controller *val)
 
void setDestroyWhenPlayerLeft (bool bDestroy)
 
virtual void setOrientation (const Quaternion &orientation) override
 
virtual void setPosition (const Vector3 &position) override
 
void setReverseCamera (CameraPosition *camera)
 
virtual void setTarget (WorldEntity *target)
 
void setTargetInternal (uint32_t targetID)
 
void setTeam (int team)
 
virtual void setVelocity (const Vector3 &velocity) override
 
virtual void switchCamera ()
 
- Public Member Functions inherited from orxonox::MobileEntity
 MobileEntity (Context *context)
 
virtual ~MobileEntity ()
 
void addAcceleration (const Vector3 &acceleration, const Vector3 &relativePosition=Vector3::ZERO)
 Adds the input acceleration at the input position to the MobileEntity. More...
 
void applyCentralForce (const Vector3 &force)
 
void applyCentralForce (float x, float y, float z)
 
const Vector3 & getAcceleration () const
 
const Vector3 & getAngularAcceleration () const
 
const Vector3 & getAngularVelocity () const
 
Vector3 getLocalVelocity () const
 Get the velocity in the coordinate-system of the MoblieEntity. More...
 
Vector3 getRotationAxis () const
 
Degree getRotationRate () const
 
virtual const Vector3 & getVelocity () const override
 
void setAcceleration (const Vector3 &acceleration)
 
void setAcceleration (float x, float y, float z)
 
void setAngularAcceleration (const Vector3 &acceleration)
 
void setAngularAcceleration (float x, float y, float z)
 
void setAngularVelocity (float x, float y, float z)
 
void setRotationAxis (const Vector3 &axis)
 
void setRotationRate (Degree rate)
 
void setVelocity (float x, float y, float z)
 
- Public Member Functions inherited from orxonox::WorldEntity
 WorldEntity (Context *context)
 Creates a new WorldEntity that may immediately be used. More...
 
virtual ~WorldEntity ()
 Destroys the WorldEntity AND ALL its children with it. More...
 
void activatePhysics ()
 Activates physics if the CollisionType is not None. More...
 
bool addedToPhysicalWorld () const
 Tells whether the object has already been added to the Bullet physics World. More...
 
void attach (WorldEntity *object)
 Attaches a child WorldEntity to this object. More...
 
void attachCollisionShape (CollisionShape *shape)
 Attaches a collision Shape to this object (delegated to the internal CompoundCollisionShape) More...
 
void attachNode (Ogre::SceneNode *node)
 Attaches an Ogre::SceneNode to this WorldEntity. More...
 
void attachOgreObject (Ogre::MovableObject *object)
 Attaches an Ogre::MovableObject to this WorldEntity. More...
 
void attachOgreObject (Ogre::BillboardSet *object)
 
void attachOgreObject (Ogre::Camera *object)
 
void attachOgreObject (Ogre::Entity *object)
 
void attachOgreObject (Ogre::ParticleSystem *object)
 
void attachToNode (Ogre::SceneNode *node)
 Attaches this object to a parent SceneNode. More...
 
void attachToParent (WorldEntity *parent)
 
 BT_DECLARE_ALIGNED_ALLOCATOR ()
 
virtual void changedActivity (void) override
 When the activity is changed, it is changed for all attached objects as well. More...
 
virtual void changedScale ()
 
virtual bool collidesAgainst (WorldEntity *otherObject, const btCollisionShape *ownCollisionShape, btManifoldPoint &contactPoint)
 Virtual function that gets called when this object collides with another. More...
 
void deactivatePhysics ()
 Deactivates physics but the CollisionType does not change. More...
 
void detach (WorldEntity *object)
 Detaches a child WorldEntity from this instance. More...
 
void detachCollisionShape (CollisionShape *shape)
 Detaches a collision Shape from this object (delegated to the internal CompoundCollisionShape) More...
 
void detachFromNode (Ogre::SceneNode *node)
 Detaches this object from a parent SceneNode. More...
 
void detachFromParent ()
 
void detachNode (Ogre::SceneNode *node)
 Detaches an Ogre::SceneNode from this WorldEntity. More...
 
void detachOgreObject (Ogre::MovableObject *object)
 Detaches an Ogre::MovableObject from this WorldEntity. More...
 
void detachOgreObject (Ogre::BillboardSet *object)
 
void detachOgreObject (Ogre::Camera *object)
 
void detachOgreObject (Ogre::Entity *object)
 
void detachOgreObject (Ogre::ParticleSystem *object)
 
Ogre::MovableObject * detachOgreObject (const Ogre::String &name)
 Detaches an Ogre::MovableObject (by string) from this WorldEntity. More...
 
void disableCollisionCallback ()
 Disables the collidesAgainst(.) function. More...
 
void enableCollisionCallback ()
 Enables the collidesAgainst(.) function. The object doesn't respond to collision otherwise! More...
 
float getAngularDamping () const
 Returns the angular damping. More...
 
float getAngularFactor () const
 Returns the angular factor. More...
 
CollisionShapegetAttachedCollisionShape (unsigned int index)
 Returns an attached collision Shape of this object (delegated to the internal CompoundCollisionShape) More...
 
WorldEntitygetAttachedObject (unsigned int index)
 Returns an attached object (merely for XMLPort). More...
 
const std::set< WorldEntity * > & getAttachedObjects () const
 
float getCcdMotionThreshold () const
 Returns the currently used motion threshold for CCD (0 means CCD is deactivated). More...
 
float getCcdSweptSphereRadius () const
 Returns the currently used radius of the sphere for CCD. More...
 
CollisionType getCollisionType () const
 Returns the CollisionType. More...
 
std::string getCollisionTypeStr () const
 Gets the CollisionType by string (used for the XMLPort) More...
 
bool getDeleteWithParent () const
 
float getFriction () const
 Returns the amount of friction applied to the object. More...
 
std::string getID (void)
 
float getLinearDamping () const
 Returns the linear damping. More...
 
const btVector3 & getLocalInertia () const
 Returns the diagonal elements of the inertia tensor when calculated in local coordinates. More...
 
float getMass () const
 Returns the mass of this object without its children. More...
 
const Ogre::SceneNode * getNode () const
 
const Quaternion & getOrientation () const
 
WorldEntitygetParent () const
 
const Vector3 & getPosition () const
 
float getRestitution () const
 Returns the restitution parameter. More...
 
float getScale () const
 
const Vector3 & getScale3D () const
 
float getTotalMass () const
 Returns the total mass of this object with all its attached children. More...
 
const Quaternion & getWorldOrientation () const
 Returns the orientation relative to the root space. More...
 
const Vector3 & getWorldPosition () const
 Returns the position relative to the root space. More...
 
float getWorldScale () const
 Returns the scaling applied relative to the root space in 3 coordinates. More...
 
const Vector3 & getWorldScale3D () const
 Returns the scaling applied relative to the root space in 3 coordinates. More...
 
bool hasCollisionResponse ()
 Tells whether there could be a collision response. More...
 
bool hasPhysics () const
 Tells whether the object has any connection to the Bullet physics engine. If hasPhysics() is false, the object may still have a velocity. More...
 
bool isCollisionCallbackActive () const
 Tells whether there could be a collision callback via collidesAgainst(.) More...
 
bool isDynamic () const
 
bool isKinematic () const
 
bool isPhysicsActive () const
 Tells whether physics has been activated (you can temporarily deactivate it) More...
 
bool isStatic () const
 
void lookAt (const Vector3 &target, TransformSpace relativeTo=TransformSpace::Parent, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
 Makes this WorldEntity look at a specific target location. More...
 
void notifyChildMassChanged ()
 Recalculates the accumulated child mass and calls recalculateMassProps() and notifies the parent of the change. More...
 
void notifyChildPropsChanged ()
 
void notifyCollisionShapeChanged ()
 Undertakes the necessary steps to change the collision shape in Bullet, even at runtime. More...
 
void pitch (const Degree &angle, TransformSpace relativeTo=TransformSpace::Local)
 
void roll (const Degree &angle, TransformSpace relativeTo=TransformSpace::Local)
 
void rotate (const Quaternion &rotation, TransformSpace relativeTo=TransformSpace::Local)
 Rotates this WorldEntity by a quaternion. More...
 
void rotate (const Vector3 &axis, const Degree &angle, TransformSpace relativeTo=TransformSpace::Local)
 
void scale (float scale)
 
void scale3D (const Vector3 &scale)
 
void scale3D (float x, float y, float z)
 
void setAngularDamping (float angularDamping)
 Applies a tensor independent rotation damping. Angular velocities will simply diminish exponentially. More...
 
void setAngularFactor (float angularFactor)
 Sets an artificial parameter that tells how much torque is applied when you apply a non-central force. More...
 
void setCcdMotionThreshold (float ccdMotionThreshold)
 Sets the motion threshold for continuous collision detection (CCD). More...
 
void setCcdSweptSphereRadius (float ccdSweptSphereRadius)
 Sets the radius of the sphere which is used for continuous collision detection (CCD). More...
 
void setCollisionResponse (bool value)
 Enables or disables collision response (default is of course on) More...
 
void setCollisionType (CollisionType type)
 Sets the CollisionType. More...
 
void setCollisionTypeStr (const std::string &type)
 Sets the CollisionType by string (used for the XMLPort) More...
 
void setDeleteWithParent (bool value)
 
void setDirection (const Vector3 &direction, TransformSpace relativeTo=TransformSpace::Local, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
 Makes this WorldEntity look in specific direction. More...
 
void setDirection (float x, float y, float z, TransformSpace relativeTo=TransformSpace::Local, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
 
void setFriction (float friction)
 Applies friction to the object. Friction occurs when two objects collide. More...
 
void setID (std::string id)
 
void setLinearDamping (float linearDamping)
 Applies a mass independent damping. Velocities will simply diminish exponentially. More...
 
void setMass (float mass)
 Sets the mass of this object. Note that the total mass may be influenced by attached objects! More...
 
void setOrientation (float w, float x, float y, float z)
 
void setOrientation (const Vector3 &axis, const Radian &angle)
 
void setOrientation (const Vector3 &axis, const Degree &angle)
 
void setPosition (float x, float y, float z)
 
void setRestitution (float restitution)
 Sets how much reaction is applied in a collision. More...
 
void setScale (float scale)
 
virtual void setScale3D (const Vector3 &scale)
 Sets the three dimensional scaling of this object. More...
 
void setScale3D (float x, float y, float z)
 
void translate (const Vector3 &distance, TransformSpace relativeTo=TransformSpace::Parent)
 Translates this WorldEntity by a vector. More...
 
void translate (float x, float y, float z, TransformSpace relativeTo=TransformSpace::Parent)
 
void yaw (const Degree &angle, TransformSpace relativeTo=TransformSpace::Local)
 
- Public Member Functions inherited from orxonox::BaseObject
 BaseObject (Context *context)
 Constructor: Registers the object in the BaseObject-list. More...
 
virtual ~BaseObject ()
 Destructor. More...
 
void addEventListener (BaseObject *listener)
 Adds an object which listens to the events of this object. More...
 
void addEventSource (BaseObject *source, const std::string &state)
 Adds a new event source for a specific state. More...
 
void addTemplate (const std::string &name)
 Adds a Template to the object. More...
 
void addTemplate (Template *temp)
 Adds a Template to the object. More...
 
virtual void changedMainStateName ()
 This function gets called if the main state name of the object changes. More...
 
virtual void changedName ()
 This function gets called if the name of the object changes. More...
 
void fireEvent (const std::string &name="")
 Fires an event (without a state). More...
 
void fireEvent (bool activate, const std::string &name="")
 Fires an event which activates or deactivates a state. More...
 
void fireEvent (bool activate, BaseObject *originator, const std::string &name="")
 Fires an event which activates or deactivates a state with agiven originator (the object which triggered the event). More...
 
void fireEvent (Event &event)
 Fires an event, using the Event struct. More...
 
BaseObjectgetCreator () const
 
BaseObjectgetEventListener (unsigned int index) const
 Returns an event listener with a given index. More...
 
BaseObjectgetEventSource (unsigned int index, const std::string &state) const
 Returns an eventsource with a given index. More...
 
const XMLFilegetFile () const
 Returns a pointer to the XMLFile that loaded this object. More...
 
const std::string & getFilename () const
 Returns the levelfile that loaded this object. More...
 
GametypegetGametype () const
 
LevelgetLevel () const
 
const std::string & getLoaderIndentation () const
 Returns the indentation of the debug output in the Loader. More...
 
const std::string & getMainStateName () const
 Returns the name of the main state. More...
 
const std::string & getName () const
 Returns the name of the object. More...
 
NamespacegetNamespace () const
 
const std::string & getOldName () const
 Returns the old name of the object. More...
 
ScenegetScene () const
 
virtual uint32_t getSceneID () const
 
const std::set< Template * > & getTemplates () const
 Returns the set of all aplied templates. More...
 
const mboolisActive () const
 Returns the state of the objects activity. More...
 
bool isInitialized () const
 Returns if the object was initialized (passed the object registration). More...
 
const mboolisVisible () const
 Returns the state of the objects visibility. More...
 
virtual void processEvent (Event &event)
 Processing an event by calling the right main state. More...
 
void removeEventSource (BaseObject *source)
 Removes an eventsource (but doesn't unregister itself at the source). More...
 
void setActive (bool bActive)
 Sets the state of the objects activity. More...
 
void setCreator (BaseObject *creator)
 
void setFile (const XMLFile *file)
 Sets a pointer to the xml file that loaded this object. More...
 
void setGametype (const StrongOrWeakPtr< Gametype > &gametype)
 
void setLevel (const StrongOrWeakPtr< Level > &level)
 
void setLoaderIndentation (const std::string &indentation)
 Sets the indentation of the debug output in the Loader. More...
 
void setMainState (bool state)
 Sets the main state of the object to a given boolean value. More...
 
void setMainStateName (const std::string &name)
 Sets the name of the main state (used for event reactions). More...
 
void setName (const std::string &name)
 Sets the name of the object. More...
 
void setNamespace (const StrongOrWeakPtr< Namespace > &ns)
 
void setScene (const StrongOrWeakPtr< Scene > &scene, uint32_t sceneID)
 
void setVisible (bool bVisible)
 Sets the state of the objects visibility. More...
 
- Public Member Functions inherited from orxonox::OrxonoxClass
 OrxonoxClass ()
 
OrxonoxClassoperator= (const OrxonoxClass &)=default
 
- Public Member Functions inherited from orxonox::Configurable
 Configurable ()
 
void setConfigValues ()
 Function to collect the SetConfigValue-macro calls. More...
 
- Public Member Functions inherited from orxonox::Listable
 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...
 
ContextgetContext () const
 
void setContext (Context *context)
 Changes the context. More...
 
void unregisterObject ()
 Removes this object from the object-lists. More...
 
- Public Member Functions inherited from orxonox::Identifiable
 Identifiable ()
 Constructor: Sets the default values. More...
 
virtual ~Identifiable ()
 
ORX_FORCEINLINE voidgetDerivedPointer (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...
 
IdentifiergetIdentifier () 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...
 
- Public Member Functions inherited from orxonox::Destroyable
 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...
 
- Public Member Functions inherited from orxonox::Synchronisable
virtual ~Synchronisable ()
 Destructor: Delete all callback objects and remove objectID_ from the objectMap_. More...
 
uint32_t getClassID () const
 
unsigned int getContextID () const
 
uint32_t getNrOfVariables ()
 
uint32_t getObjectID () const
 
unsigned int getPriority () const
 
uint8_t getSyncMode () const
 
uint32_t getVarSize (VariableID ID)
 
template<>
_NetworkExport void registerVariable (std::string &variable, uint8_t mode, NetworkCallbackBase *cb, bool bidirectional)
 
template<>
void registerVariable (std::string &variable, uint8_t mode, NetworkCallbackBase *cb, bool bidirectional)
 
void setSyncMode (uint8_t mode)
 This function sets the synchronisation mode of the object If set to 0x0 variables will not be synchronised at all If set to 0x1 variables will only be synchronised to the client If set to 0x2 variables will only be synchronised to the server If set to 0x3 variables will be synchronised bidirectionally (only if set so in registerVar) More...
 
template<>
_NetworkExport void unregisterVariable (std::string &variable)
 
template<>
void unregisterVariable (std::string &variable)
 
- Public Member Functions inherited from orxonox::OrxonoxInterface
 OrxonoxInterface ()
 
- Public Member Functions inherited from orxonox::RadarViewable
 RadarViewable (BaseObject *creator, const WorldEntity *wePtr)
 Constructor. More...
 
virtual ~RadarViewable ()
 
const std::string & getRadarName () const
 
float getRadarObjectCamouflage () const
 
const ColourValue & getRadarObjectColour () const
 
float getRadarObjectScale () const
 
Shape getRadarObjectShape () const
 
bool getRadarVisibility () const
 
Vector3 getRVOrientedVelocity () const
 
Vector3 getRVVelocity () const
 
const Vector3 & getRVWorldPosition () const
 
const std::string & getUniqueId ()
 
virtual const WorldEntitygetWorldEntity () const
 
virtual void setRadarName (const std::string &name)
 
void setRadarObjectCamouflage (float camouflage)
 
void setRadarObjectColour (const ColourValue &colour)
 
void setRadarObjectScale (float scale)
 
void setRadarObjectShape (Shape shape)
 
void setRadarVisibility (bool b)
 
void settingsChanged ()
 
- Public Member Functions inherited from orxonox::PickupCarrier
 PickupCarrier ()
 Constructor. More...
 
virtual ~PickupCarrier ()
 Destructor. More...
 
PickupCarriergetTarget (const Pickupable *pickup)
 Get the carrier that is both a child of the PickupCarrier (or the PickupCarrier itself) and a target of the input Pickupable. More...
 
bool isTarget (const Pickupable *pickup) const
 Can be used to check whether the PickupCarrier or a child of his is a target ot the input Pickupable. More...
 

Protected Attributes

bool bBoost_
 Whether the SpaceShip is currently boosting. More...
 
bool bBoostCooldown_
 Whether the SpaceShip is currently in boost cooldown, during which boosting is impossible. More...
 
bool bInvertYAxis_
 
float boostCooldownDuration_
 The duration for which boost cooldown is in effect. More...
 
float boostPower_
 The current boost power. If the boost power is reduced to zero the boost cooldown will start. More...
 
float boostPowerRate_
 The rate at which the boost power is recharged. More...
 
float boostRate_
 The rate at which boost power is used up. More...
 
float initialBoostPower_
 The initial (and maximal) boost power. More...
 
float lift_
 The amount of lift that is added. More...
 
btVector3 localAngularAcceleration_
 The acceleration that accounts for angular movement and is used internally. More...
 
float rotationThrust_
 Force with which the SpaceShip rotates. More...
 
float shakeAmplitude_
 The amplitude of the shaking of the camera due to boosting. More...
 
float shakeFrequency_
 The frequency of the shaking of the camera due to boosting. More...
 
float stallSpeed_
 The forward speed where no more lift is added. More...
 
Vector3 steering_
 The direction and magnitude of the steering action given through user input. More...
 
- Protected Attributes inherited from orxonox::Pawn
bool acceptsPickups_
 
bool bAlive_
 
bool bVulnerable_
 If this is false, then the pawn may not take damage. More...
 
float damageMultiplier_
 Used by the Damage Boost Pickup. More...
 
std::vector< ExplosionPart * > explosionPartList_
 
float health_
 
float initialHealth_
 
float initialShieldHealth_
 
WeakPtr< PawnlastHitOriginator_
 
float maxHealth_
 
float maxShieldHealth_
 
unsigned int numexplosionchunks_
 
float shieldAbsorption_
 Has to be between 0 and 1. More...
 
float shieldHealth_
 
float shieldRechargeRate_
 
float shieldRechargeWaitCountdown_
 
float shieldRechargeWaitTime_
 
float spawnparticleduration_
 
std::string spawnparticlesource_
 
WeaponSystemweaponSystem_
 
- Protected Attributes inherited from orxonox::ControllableEntity
Ogre::SceneNode * cameraPositionRootNode_
 
- Protected Attributes inherited from orxonox::MobileEntity
Vector3 angularAcceleration_
 
Vector3 angularVelocity_
 
Vector3 linearAcceleration_
 
Vector3 linearVelocity_
 
- Protected Attributes inherited from orxonox::WorldEntity
std::string id_
 Used by the ScriptableController to identify objects. More...
 
Ogre::SceneNode * node_
 
btRigidBody * physicalBody_
 Bullet rigid body. Everything physical is applied to this instance. More...
 
- Protected Attributes inherited from orxonox::BaseObject
mbool bActive_
 True = the object is active. More...
 
mbool bVisible_
 True = the object is visible. More...
 
FunctorPtr mainStateFunctor_
 
std::string mainStateName_
 
std::string name_
 The name of the object. More...
 
std::set< std::string > networkTemplateNames_
 
std::string oldName_
 The old name of the object. More...
 

Private Member Functions

void backupCamera ()
 Save the original position and orientation of the camera. More...
 
void boostCooledDown (void)
 Callback function. More...
 
void changedEnableMotionBlur ()
 Is called when the enableMotionBlur config value has changed. More...
 
virtual bool isCollisionTypeLegal (WorldEntity::CollisionType type) const
 Function checks whether the requested collision type is legal to this object. More...
 
void registerVariables ()
 
void resetCamera ()
 Reset the camera to its original position. More...
 
void shakeCamera (float dt)
 Shake the camera for a given time interval. More...
 

Private Attributes

bool bEnableMotionBlur_
 Whether motion blur is enabled or not. More...
 
float blurStrength_
 The strength of the applied blur. More...
 
ShaderboostBlur_
 A radial blur shader, applied when boosting according to the amount of boosting. More...
 
Quaternion cameraOriginalOrientation_
 The original orientation of the camera before shaking it. More...
 
Vector3 cameraOriginalPosition_
 The original position of the camera before shaking it. More...
 
std::vector< Engine * > engineList_
 The list of all Engines mounted on this SpaceShip. More...
 
float shakeDt_
 Temporary variable for the shaking of the camera. More...
 
Timer timer_
 Timer for the cooldown of the boost. More...
 

Additional Inherited Members

- Public Types inherited from orxonox::WorldEntity
enum  CollisionType { CollisionType::Dynamic, CollisionType::Kinematic, CollisionType::Static, CollisionType::None }
 Denotes the possible types of physical objects in a Scene. More...
 
enum  TransformSpace { TransformSpace::Local, TransformSpace::Parent, TransformSpace::World }
 Enumeration denoting the spaces which a transform can be relative to. More...
 
- Public Types inherited from orxonox::RadarViewable
enum  Shape { Shape::Square, Shape::Dot, Shape::Triangle }
 
- Static Public Member Functions inherited from orxonox::Pawn
static void consoleCommand_debugDrawWeapons (bool bDraw)
 
- Static Public Member Functions inherited from orxonox::BaseObject
static void loadAllEventStates (Element &xmlelement, XMLPort::Mode mode, BaseObject *object, Identifier *identifier)
 Manually loads all event states, even if the class doesn't officially support them. More...
 
- Static Public Member Functions inherited from orxonox::Synchronisable
static bool deleteObject (uint32_t objectID_)
 Finds and deletes the Synchronisable with the appropriate objectID_. More...
 
static Synchronisablefabricate (uint8_t *&mem, uint8_t mode=0x0)
 This function fabricated a new synchrnisable (and children of it), sets calls updateData and create After calling this function the mem pointer will be increased by the size of the needed data. More...
 
static unsigned int getNumberOfDeletedObject ()
 
static SynchronisablegetSynchronisable (uint32_t objectID_)
 This function looks up the objectID_ in the objectMap_ and returns a pointer to the right Synchronisable. More...
 
static uint32_t popDeletedObject ()
 
static void setClient (bool b)
 This function sets the internal mode for synchronisation. More...
 
- Public Attributes inherited from orxonox::RadarViewable
bool isHumanShip_
 
- Static Public Attributes inherited from orxonox::WorldEntity
static const Vector3 BACK = Vector3::UNIT_Z
 
static const Vector3 DOWN = Vector3::NEGATIVE_UNIT_Y
 
static const Vector3 FRONT = Vector3::NEGATIVE_UNIT_Z
 
static const Vector3 LEFT = Vector3::NEGATIVE_UNIT_X
 
static const Vector3 RIGHT = Vector3::UNIT_X
 
static const Vector3 UP = Vector3::UNIT_Y
 
- Protected Member Functions inherited from orxonox::Pawn
virtual void damage (float damage, float healthdamage=0.0f, float shielddamage=0.0f, Pawn *originator=nullptr, const btCollisionShape *cs=nullptr)
 
virtual void death ()
 
virtual std::vector< PickupCarrier * > * getCarrierChildren (void) const override
 Get all direct children of this PickupSpawner. More...
 
virtual PickupCarriergetCarrierParent (void) const override
 Get the parent of this PickupSpawner. More...
 
virtual ControllergetSlave ()
 
virtual void goWithStyle ()
 
virtual bool hasSlaves ()
 
virtual void preDestroy () override
 Is called before the PickupCarrier is effectively destroyed. More...
 
virtual void removePlayer () override
 
virtual void setPlayer (PlayerInfo *player) override
 
virtual void spawneffect ()
 
- Protected Member Functions inherited from orxonox::ControllableEntity
void createHud (void)
 
void destroyHud (void)
 
virtual void parentChanged () override
 
void setHudTemplate (const std::string &name)
 
virtual void stopLocalHumanControl ()
 
- Protected Member Functions inherited from orxonox::MobileEntity
virtual void getWorldTransform (btTransform &worldTrans) const override
 
- Protected Member Functions inherited from orxonox::BaseObject
void addEventState (const std::string &name, EventState *container)
 Adds a new event-state to the object. More...
 
EventStategetEventState (const std::string &name) const
 Returns the event-state with the given name. More...
 
- Protected Member Functions inherited from orxonox::Synchronisable
 Synchronisable (Context *context)
 Constructor: Initializes all Variables and sets the right objectID_. More...
 
uint32_t findContextID (Context *context)
 Returns the id of the context. More...
 
template<class T >
void registerVariable (T &variable, uint8_t mode=0x1, NetworkCallbackBase *cb=nullptr, bool bidirectional=false)
 
template<class T >
void registerVariable (std::set< T > &variable, uint8_t mode=0x1, NetworkCallbackBase *cb=nullptr, bool bidirectional=false)
 
void setPriority (unsigned int freq)
 
template<class T >
void unregisterVariable (T &var)
 
- Protected Member Functions inherited from orxonox::Tickable
 Tickable ()
 Constructor: Registers the object in the Tickable-list. More...
 
- Protected Member Functions inherited from orxonox::PickupCarrier
std::set< Pickupable * > & getPickups (void)
 Get all Pickupables this PickupCarrier has. More...
 

Detailed Description

The SpaceShip is the principal entity through which the player interacts with the game.

Its main function is to fly, however many things, such as orxonox::Engine Engines or orxonox::Weapon Weapons, can be attached to it. The feature that you can add orxonox::Engine Engines is new in this class. However adding orxonox::Weapon Weapons is possible because every Spaceship is a Pawn (due to inheritance) and every Pawn can carry orxonox::Weapon Weapons.

There are several parameters that define the behavior of the SpaceShip>

A spaceship always needs to have the collision type "dynamic". Other collision types are illegal.

As mentioned orxonox::Engine Engines can be mounted on the SpaceShip. Here is a (primitive) example of a SpaceShip defined in XML:

rotationThrust = 50
lift = 1;
stallSpeed = 220;
boostPower = 15
boostPowerRate = 1
boostRate = 5
boostCooldownDuration = 10
shakeFrequency = 15
shakeAmplitude = 9
collisionType = "dynamic"
mass = 100
linearDamping = 0.7
angularDamping = 0.9999999
>
<engines>
<Engine />
<Engine />
</engines>
Author
Fabian 'x3n' Landau

Constructor & Destructor Documentation

orxonox::SpaceShip::SpaceShip ( Context context)
orxonox::SpaceShip::~SpaceShip ( )
virtual

Member Function Documentation

void orxonox::SpaceShip::addEngine ( orxonox::Engine engine)

Add an Engine to the SpaceShip.

Parameters
engineA pointer to the Engine to be added.
void orxonox::SpaceShip::addSpeed ( float  speed)

Add to the speed factor for all engines of the SpaceShip.

Parameters
speedThe speed to be added.
void orxonox::SpaceShip::addSpeedFactor ( float  factor)

Add to the speed factor for all engines of the SpaceShip.

Parameters
factorThe factor to be added.
void orxonox::SpaceShip::backupCamera ( )
private

Save the original position and orientation of the camera.

void orxonox::SpaceShip::boost ( bool  bBoost)
virtual

Starts or stops boosting.

Parameters
bBoostWhether to start or stop boosting.

Reimplemented from orxonox::ControllableEntity.

Reimplemented in orxonox::HoverShip, orxonox::DodgeRaceShip, orxonox::OrxyRoadShip, orxonox::FlappyOrxShip, orxonox::InvaderShip, orxonox::StoryModePawn, and orxonox::Asteroids2DShip.

void orxonox::SpaceShip::boostCooledDown ( void  )
inlineprivate

Callback function.

Is called when the boost has cooled down.

void orxonox::SpaceShip::changedEnableMotionBlur ( )
private

Is called when the enableMotionBlur config value has changed.

void orxonox::SpaceShip::fire ( )
virtual
void orxonox::SpaceShip::gainBoostPower ( float  gainedBoostPower)

Add boost power.

Is non-negative.

Returns
Returns the current boost power.
float orxonox::SpaceShip::getBoostCooldownDuration ( ) const
inline

Get the cooldown duration.

Returns
Returns the cooldown duration in seconds. Is non-negative.
float orxonox::SpaceShip::getBoostFactor ( ) const

Get the mean boost factor over all engines of the SpaceShip.

Returns
Returns the mean boost factor over all engines of the SpaceShip.
float orxonox::SpaceShip::getBoostPower ( ) const
inline

Get the current boost power.

Is non-negative.

Returns
Returns the current boost power.
float orxonox::SpaceShip::getBoostPowerRate ( ) const
inline

Get the boost power rate.

Returns
Returns the boost power rate in units per second. Is non-negative.
float orxonox::SpaceShip::getBoostRate ( ) const
inline

Get the boost rate.

Returns
Returns the boost rate in units per second. Is non-negative.
Engine * orxonox::SpaceShip::getEngine ( unsigned int  i)

Get the i-th Engine of the SpaceShip.

Returns
Returns a pointer to the i-the Engine. nullptr if there is no Engine with that index.
Engine * orxonox::SpaceShip::getEngineByName ( const std::string &  name)

Looks for an attached Engine with a certain name.

Parameters
nameThe name of the engine to be returned.
Returns
Pointer to the engine with the given name, or nullptr if not found.
const std::vector<Engine*>& orxonox::SpaceShip::getEngineList ( ) const
inline

Get the list of all Engines that are mounted on the SpaceShip.

Returns
Returns a vector of all Engines of the SpaceShip.
float orxonox::SpaceShip::getInitialBoostPower ( ) const
inline

Get the initial boost power.

Is non-negative.

Returns
Returns the initial boost power.
float orxonox::SpaceShip::getMaxSpeedFront ( ) const

Get the largest maximal forward speed over all engines of the SpaceShip.

Returns
Returns the largest forward speed over all engines of the SpaceShip.
float orxonox::SpaceShip::getShakeAmplitude ( ) const
inline

Get the shake amplitude.

Returns
Returns the shake amplitude. Is non-negative.
float orxonox::SpaceShip::getShakeFrequency ( ) const
inline

Get the shake frequency.

Returns
Returns the shake frequency in times per seconds. Is non-negative.
float orxonox::SpaceShip::getSpeedFactor ( ) const

Get the mean speed factor over all engines of the SpaceShip.

Returns
Returns the mean speed factor over all engines of the SpaceShip.
const Vector3& orxonox::SpaceShip::getSteeringDirection ( ) const
inline

Get the steering direction of the SpaceShip.

Returns
Returns the steering direction of the SpaceShip. The length of the vector is the amount of steering needed.
bool orxonox::SpaceShip::hasEngine ( Engine search) const

Check whether the SpaceShip has a particular Engine.

Parameters
searchA pointer to the Engine to be checked.
bool orxonox::SpaceShip::isBoostCoolingDown ( ) const
inline

Check whether the SpaceShip boost is cooling down.

Returns
Returns true if the SpaceShip is cooling down from boosting.
bool orxonox::SpaceShip::isBoosting ( ) const
inline

Check whether the SpaceShip is currently boosting.

Returns
Returns true if the SpaceShip is boosting, false if not.
bool orxonox::SpaceShip::isCollisionTypeLegal ( WorldEntity::CollisionType  type) const
privatevirtual

Function checks whether the requested collision type is legal to this object.

You can override this function in a derived class to constrain the collision to e.g. None or Dynamic. A projectile may not prove very useful if there is no physical body. Simply set the CollisionType in its constructor and override this method. But be careful that a derived class's virtual functions don't yet exist in the constructor if a base class.

Reimplemented from orxonox::MobileEntity.

virtual void orxonox::SpaceShip::moveFrontBack ( const Vector2 &  value)
inlinevirtual

Move forward or backward,.

Parameters
valueA vector whose first component specifies the amount of movement. Positive means forward, negative means backward.

Reimplemented from orxonox::ControllableEntity.

Reimplemented in orxonox::DodgeRaceShip, orxonox::OrxyRoadShip, orxonox::HoverShip, orxonox::InvaderShip, orxonox::OrxoKartKart, and orxonox::StoryModePawn.

void orxonox::SpaceShip::moveFrontBack ( float  value)
inline
virtual void orxonox::SpaceShip::moveRightLeft ( const Vector2 &  value)
inlinevirtual

Move right or left.

Parameters
valueA vector whose first component specifies the amount of movement. Positive means right, negative means left.

Reimplemented from orxonox::ControllableEntity.

Reimplemented in orxonox::DodgeRaceShip, orxonox::OrxyRoadShip, orxonox::HoverShip, orxonox::InvaderShip, orxonox::OrxoKartKart, and orxonox::StoryModePawn.

void orxonox::SpaceShip::moveRightLeft ( float  value)
inline
virtual void orxonox::SpaceShip::moveUpDown ( const Vector2 &  value)
inlinevirtual

Move up or down.

Parameters
valueA vector whose first component specifies the amount of movement. Positive means up, negative means down.

Reimplemented from orxonox::ControllableEntity.

Reimplemented in orxonox::HoverShip, orxonox::OrxoKartKart, and orxonox::StoryModePawn.

void orxonox::SpaceShip::moveUpDown ( float  value)
inline
void orxonox::SpaceShip::registerVariables ( void  )
private
void orxonox::SpaceShip::removeAllEngines ( )

Remove and destroy all Engines of the SpaceShip.

void orxonox::SpaceShip::removeEngine ( Engine engine)

Remove a particular Engine from the SpaceShip.

Parameters
engineA pointer to the Engine to be removed.
Note
Don't forget to reset the Engine's ship pointer after it was removed (or destroy the engine).
void orxonox::SpaceShip::resetCamera ( )
private

Reset the camera to its original position.

void orxonox::SpaceShip::rotatePitch ( const Vector2 &  value)
virtual

Rotate in pitch direction.

Due to added left, can also lead to an additional up-down motion.

Parameters
valueA vector whose first component specifies the magnitude of the rotation. Positive means pitch up, negative means pitch down.

Reimplemented from orxonox::ControllableEntity.

Reimplemented in orxonox::DodgeRaceShip, orxonox::OrxyRoadShip, orxonox::HoverShip, orxonox::PacmanGelb, orxonox::InvaderShip, orxonox::OrxoKartKart, orxonox::Asteroids2DShip, and orxonox::StoryModePawn.

void orxonox::SpaceShip::rotateRoll ( const Vector2 &  value)
virtual

Rotate in roll direction.

Parameters
valueA vector whose first component specifies the magnitude of the rotation. Positive means roll left, negative means roll right.

Reimplemented from orxonox::ControllableEntity.

Reimplemented in orxonox::DodgeRaceShip, orxonox::OrxyRoadShip, orxonox::HoverShip, orxonox::InvaderShip, orxonox::OrxoKartKart, orxonox::Asteroids2DShip, and orxonox::StoryModePawn.

void orxonox::SpaceShip::rotateYaw ( const Vector2 &  value)
virtual

Rotate in yaw direction.

Due to added lift, can also lead to an additional right-left motion.

Parameters
valueA vector whose first component specifies the magnitude of the rotation. Positive means yaw left, negative means yaw right.

Reimplemented from orxonox::ControllableEntity.

Reimplemented in orxonox::DodgeRaceShip, orxonox::OrxyRoadShip, orxonox::HoverShip, orxonox::InvaderShip, orxonox::PacmanGelb, orxonox::OrxoKartKart, and orxonox::StoryModePawn.

void orxonox::SpaceShip::setBoostCooldownDuration ( float  duration)
inline

Set the duration for which boosting, if in cooldown, is not possible.

Cooldown is reached if all boost power is depleted.

Parameters
durationThe cooldown duration in seconds. Must be non-negative.
void orxonox::SpaceShip::setBoostPowerRate ( float  rate)
inline

Set the rate, at which boost power is recharged, to the input value.

Parameters
rateThe boost power rate in units per second. Must be non-negative.
void orxonox::SpaceShip::setBoostRate ( float  rate)
inline

Set the rate, at which boost power us used up, to the input value.

Parameters
rateThe boost rate in units per second. Must be non-negative.
void orxonox::SpaceShip::setConfigValues ( void  )
void orxonox::SpaceShip::setInitialBoostPower ( float  power)
inline

Set the initial power available for boosting to the input value.

The current boost power is set to the input value as well.

Parameters
powerThe initial boost power. Must be non-negative.
void orxonox::SpaceShip::setShakeAmplitude ( float  amplitude)
inline

Set the amplitude with which the camera shakes during boosting.

Parameters
amplitudeThe amplitude. Must be non-negative.
void orxonox::SpaceShip::setShakeFrequency ( float  frequency)
inline

Set the frequency with which the camera shakes during boosting.

Parameters
frequencyThe frequency in times per second. Must be non-negative.
void orxonox::SpaceShip::setSteeringDirection ( const Vector3 &  direction)
inline

Set the steering direction of the SpaceShip.

This is set through the user input.

Parameters
directionThe direction the SpaceShip should steer in.
void orxonox::SpaceShip::shakeCamera ( float  dt)
private

Shake the camera for a given time interval.

Parameters
dtThe time interval in seconds.
void orxonox::SpaceShip::tick ( float  dt)
virtual

Gets called every frame.

Parameters
dtThe time since the last frame in seconds

Reimplemented from orxonox::Pawn.

Reimplemented in orxonox::DodgeRaceShip, orxonox::OrxyRoadShip, orxonox::FlappyOrxShip, orxonox::PacmanGelb, orxonox::Asteroids2DShip, and orxonox::InvaderShip.

void orxonox::SpaceShip::XMLPort ( Element &  xmlelement,
XMLPort::Mode  mode 
)
virtual

XML loading and saving.

Parameters
xmlelementThe XML-element
modeThe mode defines the operation that is being executed: loading or saving the object (from or to XML respectively)

Reimplemented from orxonox::Pawn.

Reimplemented in orxonox::ModularSpaceShip, orxonox::FlappyOrxShip, orxonox::HoverShip, and orxonox::OrxoKartKart.

Member Data Documentation

bool orxonox::SpaceShip::bBoost_
protected

Whether the SpaceShip is currently boosting.

bool orxonox::SpaceShip::bBoostCooldown_
protected

Whether the SpaceShip is currently in boost cooldown, during which boosting is impossible.

bool orxonox::SpaceShip::bEnableMotionBlur_
private

Whether motion blur is enabled or not.

bool orxonox::SpaceShip::bInvertYAxis_
protected
float orxonox::SpaceShip::blurStrength_
private

The strength of the applied blur.

Shader* orxonox::SpaceShip::boostBlur_
private

A radial blur shader, applied when boosting according to the amount of boosting.

float orxonox::SpaceShip::boostCooldownDuration_
protected

The duration for which boost cooldown is in effect.

float orxonox::SpaceShip::boostPower_
protected

The current boost power. If the boost power is reduced to zero the boost cooldown will start.

float orxonox::SpaceShip::boostPowerRate_
protected

The rate at which the boost power is recharged.

float orxonox::SpaceShip::boostRate_
protected

The rate at which boost power is used up.

Quaternion orxonox::SpaceShip::cameraOriginalOrientation_
private

The original orientation of the camera before shaking it.

Vector3 orxonox::SpaceShip::cameraOriginalPosition_
private

The original position of the camera before shaking it.

std::vector<Engine*> orxonox::SpaceShip::engineList_
private

The list of all Engines mounted on this SpaceShip.

float orxonox::SpaceShip::initialBoostPower_
protected

The initial (and maximal) boost power.

float orxonox::SpaceShip::lift_
protected

The amount of lift that is added.

btVector3 orxonox::SpaceShip::localAngularAcceleration_
protected

The acceleration that accounts for angular movement and is used internally.

float orxonox::SpaceShip::rotationThrust_
protected

Force with which the SpaceShip rotates.

float orxonox::SpaceShip::shakeAmplitude_
protected

The amplitude of the shaking of the camera due to boosting.

float orxonox::SpaceShip::shakeDt_
private

Temporary variable for the shaking of the camera.

float orxonox::SpaceShip::shakeFrequency_
protected

The frequency of the shaking of the camera due to boosting.

float orxonox::SpaceShip::stallSpeed_
protected

The forward speed where no more lift is added.

Vector3 orxonox::SpaceShip::steering_
protected

The direction and magnitude of the steering action given through user input.

Timer orxonox::SpaceShip::timer_
private

Timer for the cooldown of the boost.


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