Orxonox: orxonox::MobileEntity Class Reference

# orxonox::MobileEntity Class Reference

`#include <src/orxonox/objects/worldentities/MobileEntity.h>`

Inheritance diagram for orxonox::MobileEntity:

List of all members.

## Public Member Functions

void | applyCentralForce (float x, float y, float z)
void | applyCentralForce (const Vector3 &force)
const Vector3 & | getAcceleration () const
const Vector3 & | getAngularAcceleration () const
const Vector3 & | getAngularVelocity () const
Vector3 | getLocalVelocity () const
Vector3 | getRotationAxis () const
Degree | getRotationRate () const
const Vector3 & | getVelocity () const
| MobileEntity (BaseObject *creator)
void | setAcceleration (float x, float y, float z)
void | setAcceleration (const Vector3 &acceleration)
void | setAngularAcceleration (float x, float y, float z)
void | setAngularAcceleration (const Vector3 &acceleration)
void | setAngularVelocity (float x, float y, float z)
virtual void | setAngularVelocity (const Vector3 &velocity)
virtual void | setOrientation (const Quaternion &orientation)
virtual void | setPosition (const Vector3 &position)
void | setRotationAxis (const Vector3 &axis)
void | setRotationRate (Degree rate)
void | setVelocity (float x, float y, float z)
virtual void | setVelocity (const Vector3 &velocity)
virtual void | tick (float dt)
| Gets called every frame.
virtual void | XMLPort (Element &xmlelement, XMLPort::Mode mode)
| XML loading and saving.
virtual | ~MobileEntity ()

## Protected Member Functions

void | getWorldTransform (btTransform &worldTrans) const
virtual void | setWorldTransform (const btTransform &worldTrans)

## Protected Attributes

Vector3 | angularAcceleration_
Vector3 | angularVelocity_
Vector3 | linearAcceleration_
Vector3 | linearVelocity_

## Private Member Functions

virtual bool | isCollisionTypeLegal (WorldEntity::CollisionType type) const
| Function checks whether the requested collision type is legal to this object.

## Constructor & Destructor Documentation

orxonox::MobileEntity::MobileEntity | ( | BaseObject * | creator | ) |

References angularAcceleration_, angularVelocity_, linearAcceleration_, linearVelocity_, RegisterObject, and orxonox::WorldEntity::registerVariables().

orxonox::MobileEntity::~MobileEntity | ( |  | ) | `[virtual]`

## Member Function Documentation

void orxonox::MobileEntity::applyCentralForce | ( | float | x,
|  | float | y,
|  | float | z |
| ) |  |  | `[inline]`

References orxonox::MT_Type::Vector3.

void orxonox::MobileEntity::applyCentralForce | ( | const Vector3 & | force | ) |

References orxonox::WorldEntity::getMass(), orxonox::WorldEntity::isDynamic(), and orxonox::WorldEntity::physicalBody_.

const Vector3& orxonox::MobileEntity::getAcceleration | ( |  | ) | const`[inline]`

const Vector3& orxonox::MobileEntity::getAngularAcceleration | ( |  | ) | const`[inline]`

const Vector3& orxonox::MobileEntity::getAngularVelocity | ( |  | ) | const`[inline]`

Referenced by orxonox::ControllableEntity::processClientAngularVelocity(), orxonox::ControllableEntity::setAngularVelocity(), orxonox::ControllableEntity::setWorldTransform(), and orxonox::ControllableEntity::tick().

Vector3 orxonox::MobileEntity::getLocalVelocity | ( |  | ) | const`[inline]`

Referenced by orxonox::MultiStateEngine::tick(), and orxonox::Engine::tick().

Vector3 orxonox::MobileEntity::getRotationAxis | ( |  | ) | const`[inline]`

Referenced by XMLPort().

Degree orxonox::MobileEntity::getRotationRate | ( |  | ) | const`[inline]`

References orxonox::MT_Type::Degree.

Referenced by XMLPort().

const Vector3& orxonox::MobileEntity::getVelocity | ( |  | ) | const`[inline, virtual]`

Reimplemented from orxonox::WorldEntity.

Referenced by orxonox::ArtificialController::aimAtTarget(), orxonox::PongAI::calculateBallEndPosition(), orxonox::MovableEntity::collidesAgainst(), orxonox::Pawn::hit(), orxonox::ArtificialController::moveToPosition(), orxonox::ControllableEntity::processClientLinearVelocity(), orxonox::ArtificialController::searchNewTarget(), orxonox::PongBall::setSpeed(), orxonox::ControllableEntity::setVelocity(), orxonox::ControllableEntity::setWorldTransform(), orxonox::HUDSpeedBar::tick(), orxonox::PongBall::tick(), orxonox::ExplosionChunk::tick(), orxonox::ControllableEntity::tick(), orxonox::PongAI::tick(), orxonox::Jump::used(), and XMLPort().

void orxonox::MobileEntity::getWorldTransform | ( | btTransform & | worldTrans | ) | const`[protected]`

References angularVelocity_, orxonox::WorldEntity::isDynamic(), linearVelocity_, orxonox::WorldEntity::node_, and orxonox::WorldEntity::physicalBody_.

bool orxonox::MobileEntity::isCollisionTypeLegal | ( | WorldEntity::CollisionType | type | ) | const`[private, virtual]`

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 classe's virtual functions don't yet exist in the constructor if a base class.

Implements orxonox::WorldEntity.

Reimplemented in orxonox::SpaceShip.

References CCOUT, and orxonox::WorldEntity::Static.

void orxonox::MobileEntity::setAcceleration | ( | float | x,
|  | float | y,
|  | float | z |
| ) |  |  | `[inline]`

References orxonox::MT_Type::Vector3.

void orxonox::MobileEntity::setAcceleration | ( | const Vector3 & | acceleration | ) |

References orxonox::WorldEntity::getMass(), orxonox::WorldEntity::isDynamic(), linearAcceleration_, and orxonox::WorldEntity::physicalBody_.

Referenced by orxonox::LightningGun::fire(), and orxonox::Engine::tick().

void orxonox::MobileEntity::setAngularAcceleration | ( | float | x,
|  | float | y,
|  | float | z |
| ) |  |  | `[inline]`

References orxonox::MT_Type::Vector3.

void orxonox::MobileEntity::setAngularAcceleration | ( | const Vector3 & | acceleration | ) |

References angularAcceleration_, orxonox::WorldEntity::isDynamic(), and orxonox::WorldEntity::physicalBody_.

void orxonox::MobileEntity::setAngularVelocity | ( | float | x,
|  | float | y,
|  | float | z |
| ) |  |  | `[inline]`

References orxonox::MT_Type::Vector3.

void orxonox::MobileEntity::setAngularVelocity | ( | const Vector3 & | velocity | ) | `[virtual]`

Reimplemented in orxonox::ControllableEntity.

References angularVelocity_, orxonox::WorldEntity::isDynamic(), and orxonox::WorldEntity::physicalBody_.

Referenced by orxonox::BigExplosion::init(), orxonox::ControllableEntity::processClientAngularVelocity(), orxonox::ControllableEntity::processServerAngularVelocity(), orxonox::ControllableEntity::setAngularVelocity(), and XMLPort().

void orxonox::MobileEntity::setOrientation | ( | const Quaternion & | orientation | ) | `[virtual]`

Implements orxonox::WorldEntity.

Reimplemented in orxonox::ControllableEntity, and orxonox::MovableEntity.

References orxonox::WorldEntity::isDynamic(), orxonox::WorldEntity::node_, and orxonox::WorldEntity::physicalBody_.

Referenced by orxonox::ControllableEntity::processClientOrientation(), orxonox::ControllableEntity::processServerOrientation(), orxonox::MovableEntity::setOrientation(), and orxonox::ControllableEntity::setOrientation().

void orxonox::MobileEntity::setPosition | ( | const Vector3 & | position | ) | `[virtual]`

Implements orxonox::WorldEntity.

Reimplemented in orxonox::ControllableEntity, and orxonox::MovableEntity.

References orxonox::WorldEntity::isDynamic(), orxonox::WorldEntity::node_, and orxonox::WorldEntity::physicalBody_.

Referenced by orxonox::ControllableEntity::processClientPosition(), orxonox::ControllableEntity::processServerPosition(), orxonox::MovableEntity::setPosition(), and orxonox::ControllableEntity::setPosition().

void orxonox::MobileEntity::setRotationAxis | ( | const Vector3 & | axis | ) | `[inline]`

void orxonox::MobileEntity::setRotationRate | ( | Degree | rate | ) | `[inline]`

void orxonox::MobileEntity::setVelocity | ( | float | x,
|  | float | y,
|  | float | z |
| ) |  |  | `[inline]`

References orxonox::MT_Type::Vector3.

void orxonox::MobileEntity::setVelocity | ( | const Vector3 & | velocity | ) | `[virtual]`

Reimplemented in orxonox::ControllableEntity.

References orxonox::WorldEntity::isDynamic(), linearVelocity_, and orxonox::WorldEntity::physicalBody_.

Referenced by orxonox::BigExplosion::BigExplosion(), orxonox::ExplosionChunk::ExplosionChunk(), orxonox::LightningGun::fire(), orxonox::LaserFire::fire(), orxonox::FusionFire::fire(), orxonox::BigExplosion::init(), orxonox::Pong::playerScored(), orxonox::ControllableEntity::processClientLinearVelocity(), orxonox::ControllableEntity::processServerLinearVelocity(), orxonox::PongBall::setSpeed(), orxonox::ControllableEntity::setVelocity(), orxonox::HsW01::shot(), orxonox::EnergyDrink::shot(), orxonox::PongBall::tick(), orxonox::ExplosionChunk::tick(), and XMLPort().

void orxonox::MobileEntity::setWorldTransform | ( | const btTransform & | worldTrans | ) | `[protected, virtual]`

Reimplemented in orxonox::ControllableEntity.

References angularVelocity_, linearVelocity_, orxonox::WorldEntity::node_, orxonox::WorldEntity::physicalBody_, orxonox::MT_Type::Quaternion, and orxonox::MT_Type::Vector3.

Referenced by orxonox::ControllableEntity::setWorldTransform().

void orxonox::MobileEntity::tick | ( | float | dt | ) | `[virtual]`

Gets called every frame.

Parameters:

  | dt | The time since the last frame in seconds

Implements orxonox::Tickable.

Reimplemented in orxonox::Projectile, orxonox::BigExplosion, orxonox::ControllableEntity, orxonox::ExplosionChunk, orxonox::Pawn, orxonox::SpaceShip, orxonox::Spectator, orxonox::Planet, orxonox::PongBall, and orxonox::PongBat.

References angularAcceleration_, angularVelocity_, orxonox::BaseObject::isActive(), orxonox::WorldEntity::isDynamic(), linearAcceleration_, linearVelocity_, orxonox::WorldEntity::node_, and orxonox::MT_Type::Quaternion.

Referenced by orxonox::ControllableEntity::tick().

void orxonox::MobileEntity::XMLPort | ( | Element & | xmlelement,
|  | XMLPort::Mode | mode |
| ) |  |  | `[virtual]`

XML loading and saving.

Parameters:

  | xmlelement | The XML-element
  | loading | Loading (true) or saving (false)

Returns:
  The XML-element

Reimplemented from orxonox::WorldEntity.

Reimplemented in orxonox::ControllableEntity, orxonox::MovableEntity, orxonox::Pawn, orxonox::SpaceShip, and orxonox::Planet.

References orxonox::MT_Type::Degree, getRotationAxis(), getRotationRate(), getVelocity(), orxonox::XMLPort::LoadObject, setAngularVelocity(), setVelocity(), SUPER, orxonox::MT_Type::Vector3, XMLPortParamTemplate, and XMLPortParamVariable.

## Member Data Documentation

Vector3 orxonox::MobileEntity::angularAcceleration_`[protected]`

Referenced by MobileEntity(), setAngularAcceleration(), and tick().

Vector3 orxonox::MobileEntity::angularVelocity_`[protected]`

Referenced by getWorldTransform(), MobileEntity(), orxonox::MovableEntity::registerVariables(), setAngularVelocity(), setWorldTransform(), and tick().

Vector3 orxonox::MobileEntity::linearAcceleration_`[protected]`

Referenced by MobileEntity(), setAcceleration(), and tick().

Vector3 orxonox::MobileEntity::linearVelocity_`[protected]`

Referenced by getWorldTransform(), MobileEntity(), orxonox::MovableEntity::registerVariables(), setVelocity(), setWorldTransform(), and tick().

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

- src/orxonox/objects/worldentities/MobileEntity.h
- src/orxonox/objects/worldentities/MobileEntity.cc