Orxonox: orxonox::WorldEntity Class Reference

# orxonox::WorldEntity Class Reference

The WorldEntity represents everything that can be put in a Scene at a certain location. More...

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

Inheritance diagram for orxonox::WorldEntity:

List of all members.

## Public Types

enum | CollisionType { Dynamic, Kinematic, Static, None }
| Denotes the possible types of physical objects in a Scene. More...
enum | TransformSpace { Local, Parent, World }
| Enumeration denoting the spaces which a transform can be relative to. More...

## Public Member Functions

void | activatePhysics ()
| Activates physics if the CollisionType is not None.
bool | addedToPhysicalWorld () const
| Tells whether the object has already been added to the Bullet physics World.
void | attach (WorldEntity *object)

Attaches a child WorldEntity to this object. This calls notifyBeingAttached() of the child WE. The collision shape of the child object gets attached nevertheless. That also means that you can change the collision shape of the child and it correctly cascadeds the changes to this instance. Be aware of this implication: When implementing attaching of kinematic objects to others, you have to change this behaviour because you then might not want to merge the collision shapes.

void | attachCollisionShape (CollisionShape *shape)
| Attaches a collision Shape to this object (delegated to the internal CompoundCollisionShape).
void | attachNode (Ogre::SceneNode *node)
| Attaches an Ogre::SceneNode to this WorldEntity.
void | attachOgreObject (Ogre::ParticleSystem *object)
void | attachOgreObject (Ogre::Entity *object)
void | attachOgreObject (Ogre::Camera *object)
void | attachOgreObject (Ogre::BillboardSet *object)
void | attachOgreObject (Ogre::MovableObject *object)
| Attaches an Ogre::MovableObject to this WorldEntity.
void | attachToNode (Ogre::SceneNode *node)
| Attaches this object to a parent SceneNode. Only use this method if you know exactly what you're doing! Normally, attaching works internally by attaching WE's.
void | attachToParent (WorldEntity *parent)
virtual void | changedScale ()
virtual bool | collidesAgainst (WorldEntity *otherObject, btManifoldPoint &contactPoint)
| Virtual function that gets called when this object collides with another.
void | deactivatePhysics ()
| Deactivates physics but the CollisionType does not change.
void | detach (WorldEntity *object)
| Detaches a child WorldEntity from this instance.
void | detachCollisionShape (CollisionShape *shape)
| Detaches a collision Shape from this object (delegated to the internal CompoundCollisionShape).
void | detachFromNode (Ogre::SceneNode *node)
| Detaches this object from a parent SceneNode. Only use this method if you know exactly what you're doing! Normally, attaching works internally by attaching WE's.
void | detachFromParent ()
void | detachNode (Ogre::SceneNode *node)
| Detaches an Ogre::SceneNode from this WorldEntity.
Ogre::MovableObject * | detachOgreObject (const Ogre::String &name)
| Detaches an Ogre::MovableObject (by string) from this WorldEntity.
void | detachOgreObject (Ogre::ParticleSystem *object)
void | detachOgreObject (Ogre::Entity *object)
void | detachOgreObject (Ogre::Camera *object)
void | detachOgreObject (Ogre::BillboardSet *object)
void | detachOgreObject (Ogre::MovableObject *object)
| Detaches an Ogre::MovableObject from this WorldEntity.
void | disableCollisionCallback ()
| Disables the collidesAgainst(.) function.
void | enableCollisionCallback ()
| Enables the collidesAgainst(.) function. The object doesn't respond to collision otherwise!
float | getAngularDamping () const
| Returns the angular damping.
float | getAngularFactor () const
| Returns the angular factor.
CollisionShape * | getAttachedCollisionShape (unsigned int index)
| Returns an attached collision Shape of this object (delegated to the internal CompoundCollisionShape).
WorldEntity * | getAttachedObject (unsigned int index)
| Returns an attached object (merely for XMLPort).
const std::set< WorldEntity * > & | getAttachedObjects () const
CollisionType | getCollisionType () const
| Returns the CollisionType.
std::string | getCollisionTypeStr () const
| Gets the CollisionType by string (used for the XMLPort).
bool | getDeleteWithParent () const
float | getFriction () const
| Returns the amount of friction applied to the object.
float | getLinearDamping () const
| Returns the linear damping.
const btVector3 & | getLocalInertia () const

Returns the diagonal elements of the inertia tensor when calculated in local coordinates. The local inertia tensor cannot be set, but is calculated by Bullet according to the collisionShape. With compound collision shapes, an approximation is used.

float | getMass () const
| Returns the mass of this object without its children.
const Ogre::SceneNode * | getNode () const
const Quaternion & | getOrientation () const
WorldEntity * | getParent () const
const Vector3 & | getPosition () const
float | getRestitution () const
| Returns the restitution parameter.
float | getScale () const
const Vector3 & | getScale3D () const
float | getTotalMass () const
| Returns the total mass of this object with all its attached children.
virtual const Vector3 & | getVelocity () const
const Quaternion & | getWorldOrientation () const
| Returns the orientation relative to the root space.
const Vector3 & | getWorldPosition () const
| Returns the position relative to the root space.
float | getWorldScale () const
| Returns the scaling applied relative to the root space in 3 coordinates.
const Vector3 & | getWorldScale3D () const
| Returns the scaling applied relative to the root space in 3 coordinates.
bool | hasCollisionResponse ()
| Tells whether there could be a collision response.
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.
bool | isCollisionCallbackActive () const
| Tells whether there could be a collision callback via collidesAgainst(.).
bool | isDynamic () const
bool | isKinematic () const
bool | isPhysicsActive () const
| Tells whether physics has been activated (you can temporarily deactivate it).
bool | isStatic () const
void | lookAt (const Vector3 &target, TransformSpace relativeTo=WorldEntity::Parent, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
| Makes this WorldEntity look a specific target location.
void | notifyChildMassChanged ()
| Recalculates the accumulated child mass and calls recalculateMassProps() and notifies the parent of the change. Called by a child WE.
void | notifyChildPropsChanged ()
void | notifyCollisionShapeChanged ()

Undertakes the necessary steps to change the collision shape in Bullet, even at runtime.

- called by this->collisionShape_
- May have a REALLY big overhead when called continuously at runtime, because then we need to remove the physical body from Bullet and add it again.

void | pitch (const Degree &angle, TransformSpace relativeTo=WorldEntity::Local)
void | registerVariables ()
void | roll (const Degree &angle, TransformSpace relativeTo=WorldEntity::Local)
void | rotate (const Vector3 &axis, const Degree &angle, TransformSpace relativeTo=WorldEntity::Local)
void | rotate (const Quaternion &rotation, TransformSpace relativeTo=WorldEntity::Local)
| Rotates this WorldEntity by a quaternion.
void | scale (float scale)
void | scale3D (float x, float y, float z)
void | scale3D (const Vector3 &scale)
void | setAngularDamping (float angularDamping)
| Applies a tensor independent rotation damping. Angular velocities will simply diminish exponentially.
void | setAngularFactor (float angularFactor)
| Sets an artificial parameter that tells how much torque is applied when you apply a non-central force.
void | setCollisionResponse (bool value)
| Enables or disables collision response (default is of course on).
void | setCollisionType (CollisionType type)
| Sets the CollisionType. This alters the object significantly!
void | setCollisionTypeStr (const std::string &type)
| Sets the CollisionType by string (used for the XMLPort).
void | setDeleteWithParent (bool value)
void | setDirection (float x, float y, float z, TransformSpace relativeTo=WorldEntity::Local, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
void | setDirection (const Vector3 &direction, TransformSpace relativeTo=WorldEntity::Local, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
| Makes this WorldEntity look in specific direction.
void | setFriction (float friction)
| Applies friction to the object. Friction occurs when two objects collide.
void | setLinearDamping (float linearDamping)
| Applies a mass independent damping. Velocities will simply diminish exponentially.
void | setMass (float mass)
| Sets the mass of this object. Note that the total mass may be influenced by attached objects!
void | setOrientation (const Vector3 &axis, const Degree &angle)
void | setOrientation (const Vector3 &axis, const Radian &angle)
void | setOrientation (float w, float x, float y, float z)
virtual void | setOrientation (const Quaternion &orientation)=0
void | setPosition (float x, float y, float z)
virtual void | setPosition (const Vector3 &position)=0
void | setRestitution (float restitution)
| Sets how much reaction is applied in a collision.
void | setScale (float scale)
void | setScale3D (float x, float y, float z)
virtual void | setScale3D (const Vector3 &scale)
| Sets the three dimensional scaling of this object. Scaling physical objects has not yet been implemented and is therefore forbidden.
void | translate (float x, float y, float z, TransformSpace relativeTo=WorldEntity::Parent)
void | translate (const Vector3 &distance, TransformSpace relativeTo=WorldEntity::Parent)
| Translates this WorldEntity by a vector.
| WorldEntity (BaseObject *creator)
| Creates a new WorldEntity that may immediately be used. All the default values are being set here.
virtual void | XMLPort (Element &xmlelement, XMLPort::Mode mode)
| XML loading and saving.
void | yaw (const Degree &angle, TransformSpace relativeTo=WorldEntity::Local)
virtual | ~WorldEntity ()
| Destroys the WorldEntity AND ALL its children with it.

## Static Public Attributes

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

virtual bool | isCollisionTypeLegal (CollisionType type) const =0
| Function checks whether the requested collision type is legal to this object.
virtual void | parentChanged ()

## Protected Attributes

Ogre::SceneNode * | node_
btRigidBody * | physicalBody_
| Bullet rigid body. Everything physical is applied to this instance.

## Private Member Functions

void | angularDampingChanged ()
| Network callback workaround to call a function when the value changes.
void | angularFactorChanged ()
| Network callback workaround to call a function when the value changes.
void | collisionCallbackActivityChanged ()
| Function sets whether Bullet should issue a callback on collisions.
void | collisionResponseActivityChanged ()
| Function sets whether Bullet should react itself to a collision.
void | collisionTypeChanged ()
| Network callback for the collision type. Only change the type if it was valid.
void | frictionChanged ()
| Network callback workaround to call a function when the value changes.
void | internalSetPhysicsProps ()
| Copies our own parameters for restitution, angular factor, dampings and friction to the bullet rigid body.
void | linearDampingChanged ()
| Network callback workaround to call a function when the value changes.
void | lookAt_xmlport (const Vector3 &target)
void | massChanged ()
| Network callback workaround to call a function when the value changes.
void | networkcallback_parentChanged ()
| Network function that object this instance to its correct parent.
bool | notifyBeingAttached (WorldEntity *newParent)
| Function gets called when this object is being attached to a new parent.
void | notifyDetached ()
| Function gets called when the object has been detached from its parent.
void | physicsActivityChanged ()
| Network callback for this->bPhysicsActive_.
void | pitch_xmlport (const Degree &angle)
void | recalculateMassProps ()
| Updates all mass dependent parameters (mass, inertia tensor and child mass).
void | restitutionChanged ()
| Network callback workaround to call a function when the value changes.
void | roll_xmlport (const Degree &angle)
void | scaleChanged ()
void | setDirection_xmlport (const Vector3 &direction)
void | yaw_xmlport (const Degree &angle)

## Private Attributes

btScalar | angularDamping_
btScalar | angularFactor_
bool | bCollisionCallbackActive_
bool | bCollisionResponseActive_
| Tells whether the object should respond to collisions.
bool | bDeleteWithParent_
bool | bPhysicsActive_
bool | bPhysicsActiveBeforeAttaching_
| When attaching objects hierarchically this variable tells this object (as child) whether physics was activated before attaching (because the deactivate physics while being attached).
bool | bPhysicsActiveSynchronised_
std::set< WorldEntity * > | children_
btScalar | childrenMass_
| Sum of all the children's masses.
WorldEntityCollisionShape * | collisionShape_
| Attached collision shapes go here.
CollisionType | collisionType_
CollisionType | collisionTypeSynchronised_
| Network synchronised variable for collisionType_.
btScalar | friction_
btScalar | linearDamping_
btVector3 | localInertia_
btScalar | mass_
WorldEntity * | parent_
unsigned int | parentID_
btScalar | restitution_

## Friends

class | Scene

## Detailed Description

The WorldEntity represents everything that can be put in a Scene at a certain location.

It is supposed to be the base class of everything you would call an 'object' in a Scene. The class itself is abstract which means you cannot use it directly. You may use StaticEntity as the simplest derivative or (derived from MobileEntity) MovableEntity and ControllableEntity as more advanced ones.

The basic task of the WorldEntity is provide a location, a direction and a scaling and the possibility to create an entire hierarchy of derivated objects. It is also the basis for the physics interface to the Bullet physics engine. Every WorldEntity can have a specific collision type:

See also:
  CollisionType This would then imply that every scene object could have any collision type. To limit this, you can always override this->isCollisionTypeLegal(CollisionType). Return false if the collision type is not supported for a specific object. There is also support for attaching WorldEntities with physics to each other. Currently, the collision shape of both objects simply get merged into one larger shape (for static collision type). The phyiscal body that is internally stored and administrated has the following supported properties:
  - Restitution, angular factor, linear damping, angular damping, fricition, mass and collision shape. You can get more information at the corresponding set function.

Collision shapes: These are controlled by the internal WorldEntityCollisionShape.

See also:
  WorldEntityCollisionShape.

## Member Enumeration Documentation

enum orxonox::WorldEntity::CollisionType

Denotes the possible types of physical objects in a Scene.

Dynamic: The object is influenced by its physical environment, like for instance little ball. Kinematic: The object can only influence other dynamic objects. It's movement is coordinated by your own saying. Static: Like kinematic but the object is not allowed to move during the simulation. None: The object has no physics at all.

Enumerator:

  Dynamic |
  Kinematic |
  Static |
  None |

enum orxonox::WorldEntity::TransformSpace

Enumeration denoting the spaces which a transform can be relative to.

Enumerator:

  Local | Transform is relative to the local space.
  Parent | Transform is relative to the space of the parent node.
  World | Transform is relative to world space.

## Constructor & Destructor Documentation

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

Creates a new WorldEntity that may immediately be used. All the default values are being set here.

References angularDamping_, angularFactor_, bCollisionCallbackActive_, bCollisionResponseActive_, bDeleteWithParent_, bPhysicsActive_, bPhysicsActiveBeforeAttaching_, bPhysicsActiveSynchronised_, childrenMass_, collisionShape_, collisionType_, collisionTypeSynchronised_, friction_, orxonox::Scene::getRootSceneNode(), orxonox::BaseObject::getScene(), linearDamping_, mass_, node_, None, orxonox::OBJECTID_UNKNOWN, parent_, parentID_, physicalBody_, RegisterObject, registerVariables(), restitution_, and ThrowException.

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

Destroys the WorldEntity AND ALL its children with it.

References children_, collisionShape_, deactivatePhysics(), detach(), detachFromParent(), orxonox::BaseObject::getScene(), orxonox::Scene::getSceneManager(), getWorldPosition(), orxonox::BaseObject::isInitialized(), node_, OrxAssert, parent_, and physicalBody_.

## Member Function Documentation

void orxonox::WorldEntity::activatePhysics | ( |  | ) |

Activates physics if the CollisionType is not None.

References orxonox::Scene::addPhysicalObject(), bPhysicsActive_, bPhysicsActiveSynchronised_, orxonox::BaseObject::getScene(), hasPhysics(), orxonox::BaseObject::isActive(), isPhysicsActive(), and parent_.

Referenced by notifyCollisionShapeChanged(), notifyDetached(), physicsActivityChanged(), and setCollisionType().

bool orxonox::WorldEntity::addedToPhysicalWorld | ( |  | ) | const

Tells whether the object has already been added to the Bullet physics World.

References physicalBody_.

Referenced by notifyCollisionShapeChanged(), orxonox::StaticEntity::setOrientation(), and orxonox::StaticEntity::setPosition().

void orxonox::WorldEntity::angularDampingChanged | ( |  | ) | `[inline, private]`

Network callback workaround to call a function when the value changes.

Referenced by registerVariables().

void orxonox::WorldEntity::angularFactorChanged | ( |  | ) | `[inline, private]`

Network callback workaround to call a function when the value changes.

Referenced by registerVariables().

void orxonox::WorldEntity::attach | ( | WorldEntity * | object | ) |

Attaches a child WorldEntity to this object. This calls notifyBeingAttached() of the child WE. The collision shape of the child object gets attached nevertheless. That also means that you can change the collision shape of the child and it correctly cascadeds the changes to this instance. Be aware of this implication: When implementing attaching of kinematic objects to others, you have to change this behaviour because you then might not want to merge the collision shapes.

References attachCollisionShape(), attachNode(), children_, childrenMass_, collisionShape_, COUT, node_, notifyBeingAttached(), and recalculateMassProps().

Referenced by orxonox::MultiStateEngine::addActiveEffect(), orxonox::MultiStateEngine::addBoostEffect(), orxonox::MultiStateEngine::addBrakeEffect(), orxonox::ControllableEntity::addCameraPosition(), orxonox::MultiStateEngine::addForwardEffect(), orxonox::Attacher::addObject(), orxonox::MultiStateEngine::addToSpaceShip(), orxonox::WeaponSystem::addWeaponPack(), orxonox::Pawn::addWeaponSlot(), orxonox::CameraPosition::attachCamera(), attachToParent(), orxonox::DroppedItem::createDefaultDrop(), orxonox::BigExplosion::init(), orxonox::HsW01::muendungsfeuer(), orxonox::EnergyDrink::muendungsfeuer(), orxonox::ControllableEntity::parentChanged(), orxonox::HsW01::shot(), orxonox::EnergyDrink::shot(), orxonox::Pong::start(), and XMLPort().

void orxonox::WorldEntity::attachCollisionShape | ( | CollisionShape * | shape | ) |

Attaches a collision Shape to this object (delegated to the internal CompoundCollisionShape).

References orxonox::CompoundCollisionShape::attach(), and collisionShape_.

Referenced by attach(), orxonox::CollisionShape::parentChanged(), orxonox::Projectile::Projectile(), and XMLPort().

void orxonox::WorldEntity::attachNode | ( | Ogre::SceneNode * | node | ) |

Attaches an Ogre::SceneNode to this WorldEntity.

References node_.

Referenced by attach(), orxonox::Camera::Camera(), and orxonox::Camera::setDrag().

void orxonox::WorldEntity::attachOgreObject | ( | Ogre::ParticleSystem * | object | ) |

References node_.

void orxonox::WorldEntity::attachOgreObject | ( | Ogre::Entity * | object | ) |

References node_.

void orxonox::WorldEntity::attachOgreObject | ( | Ogre::Camera * | object | ) |

References node_.

void orxonox::WorldEntity::attachOgreObject | ( | Ogre::BillboardSet * | object | ) |

References node_.

void orxonox::WorldEntity::attachOgreObject | ( | Ogre::MovableObject * | object | ) |

Attaches an Ogre::MovableObject to this WorldEntity.

References node_.

Referenced by orxonox::CameraPosition::attachCamera(), orxonox::BillboardProjectile::BillboardProjectile(), orxonox::Billboard::changedMaterial(), orxonox::Planet::changedMesh(), orxonox::Model::changedMesh(), orxonox::ExplosionChunk::ExplosionChunk(), orxonox::Planet::init(), orxonox::BigExplosion::init(), orxonox::Light::Light(), orxonox::ParticleProjectile::ParticleProjectile(), orxonox::ParticleEmitter::sourceChanged(), orxonox::Spectator::Spectator(), and orxonox::Trigger::Trigger().

void orxonox::WorldEntity::attachToNode | ( | Ogre::SceneNode * | node | ) |

Attaches this object to a parent SceneNode. Only use this method if you know exactly what you're doing! Normally, attaching works internally by attaching WE's.

References node_.

Referenced by orxonox::ControllableEntity::addCameraPosition(), orxonox::ControllableEntity::startLocalHumanControl(), and orxonox::ControllableEntity::switchCamera().

void orxonox::WorldEntity::attachToParent | ( | WorldEntity * | parent | ) | `[inline]`

References attach().

Referenced by orxonox::Attacher::loadedNewXMLName(), networkcallback_parentChanged(), and orxonox::Attacher::setTarget().

virtual void orxonox::WorldEntity::changedScale | ( |  | ) | `[inline, virtual]`

Reimplemented in orxonox::Backlight.

Referenced by setScale3D().

virtual bool orxonox::WorldEntity::collidesAgainst | ( | WorldEntity * | otherObject,
|  | btManifoldPoint & | contactPoint |
| ) |  |  | `[inline, virtual]`

Virtual function that gets called when this object collides with another.

Parameters:

  | otherObject | The object this one has collided into. contactPoint Contact point provided by Bullet. Holds more information and can me modified. See return value. Returning false means that no modification to the contactPoint has been made. Return true otherwise! Condition is that enableCollisionCallback() was called.

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

Referenced by orxonox::Scene::collisionCallback().

void orxonox::WorldEntity::collisionCallbackActivityChanged | ( |  | ) | `[private]`

Function sets whether Bullet should issue a callback on collisions.

References bCollisionCallbackActive_, hasPhysics(), and physicalBody_.

Referenced by registerVariables(), and setCollisionType().

void orxonox::WorldEntity::collisionResponseActivityChanged | ( |  | ) | `[private]`

Function sets whether Bullet should react itself to a collision.

References bCollisionResponseActive_, hasPhysics(), and physicalBody_.

Referenced by registerVariables(), and setCollisionType().

void orxonox::WorldEntity::collisionTypeChanged | ( |  | ) | `[private]`

Network callback for the collision type. Only change the type if it was valid.

References CCOUT, collisionType_, collisionTypeSynchronised_, Dynamic, Kinematic, None, parent_, setCollisionType(), and Static.

Referenced by registerVariables().

void orxonox::WorldEntity::deactivatePhysics | ( |  | ) |

Deactivates physics but the CollisionType does not change.

References bPhysicsActive_, bPhysicsActiveSynchronised_, orxonox::BaseObject::getScene(), isPhysicsActive(), and orxonox::Scene::removePhysicalObject().

Referenced by notifyBeingAttached(), notifyCollisionShapeChanged(), physicsActivityChanged(), setCollisionType(), and ~WorldEntity().

void orxonox::WorldEntity::detach | ( | WorldEntity * | object | ) |

Detaches a child WorldEntity from this instance.

References CCOUT, children_, childrenMass_, collisionShape_, detachCollisionShape(), detachNode(), getMass(), node_, and recalculateMassProps().

Referenced by ~WorldEntity().

void orxonox::WorldEntity::detachCollisionShape | ( | CollisionShape * | shape | ) |

Detaches a collision Shape from this object (delegated to the internal CompoundCollisionShape).

References collisionShape_, and orxonox::CompoundCollisionShape::detach().

Referenced by detach().

void orxonox::WorldEntity::detachFromNode | ( | Ogre::SceneNode * | node | ) |

Detaches this object from a parent SceneNode. Only use this method if you know exactly what you're doing! Normally, attaching works internally by attaching WE's.

References node_.

void orxonox::WorldEntity::detachFromParent | ( |  | ) | `[inline]`

Referenced by notifyBeingAttached(), orxonox::ControllableEntity::stopLocalHumanControl(), orxonox::ParticleSpawner::stopParticleSpawner(), and ~WorldEntity().

void orxonox::WorldEntity::detachNode | ( | Ogre::SceneNode * | node | ) |

Detaches an Ogre::SceneNode from this WorldEntity.

References node_.

Referenced by detach(), orxonox::Camera::setDrag(), and orxonox::Camera::~Camera().

Ogre::MovableObject * orxonox::WorldEntity::detachOgreObject | ( | const Ogre::String & | name | ) |

Detaches an Ogre::MovableObject (by string) from this WorldEntity.

References node_.

void orxonox::WorldEntity::detachOgreObject | ( | Ogre::ParticleSystem * | object | ) |

References node_.

void orxonox::WorldEntity::detachOgreObject | ( | Ogre::Entity * | object | ) |

References node_.

void orxonox::WorldEntity::detachOgreObject | ( | Ogre::Camera * | object | ) |

References node_.

void orxonox::WorldEntity::detachOgreObject | ( | Ogre::BillboardSet * | object | ) |

References node_.

void orxonox::WorldEntity::detachOgreObject | ( | Ogre::MovableObject * | object | ) |

Detaches an Ogre::MovableObject from this WorldEntity.

References node_.

Referenced by orxonox::Planet::changedMesh(), orxonox::Model::changedMesh(), orxonox::BigExplosion::~BigExplosion(), orxonox::Billboard::~Billboard(), orxonox::BillboardProjectile::~BillboardProjectile(), orxonox::ExplosionChunk::~ExplosionChunk(), orxonox::Model::~Model(), orxonox::ParticleEmitter::~ParticleEmitter(), orxonox::ParticleProjectile::~ParticleProjectile(), orxonox::Planet::~Planet(), and orxonox::Spectator::~Spectator().

void orxonox::WorldEntity::disableCollisionCallback | ( |  | ) | `[inline]`

Disables the collidesAgainst(.) function.

See also:
  enableCollisionCallback()

void orxonox::WorldEntity::enableCollisionCallback | ( |  | ) | `[inline]`

Enables the collidesAgainst(.) function. The object doesn't respond to collision otherwise!

Referenced by orxonox::Projectile::Projectile(), and orxonox::SpaceShip::SpaceShip().

void orxonox::WorldEntity::frictionChanged | ( |  | ) | `[inline, private]`

Network callback workaround to call a function when the value changes.

Referenced by registerVariables().

float orxonox::WorldEntity::getAngularDamping | ( |  | ) | const`[inline]`

Returns the angular damping.

See also:
  setAngularDamping.

Referenced by XMLPort().

float orxonox::WorldEntity::getAngularFactor | ( |  | ) | const`[inline]`

Returns the angular factor.

See also:
  setAngularFactor.

Referenced by XMLPort().

CollisionShape * orxonox::WorldEntity::getAttachedCollisionShape | ( | unsigned int | index | ) |

Returns an attached collision Shape of this object (delegated to the internal CompoundCollisionShape).

References collisionShape_, and orxonox::CompoundCollisionShape::getAttachedShape().

Referenced by XMLPort().

WorldEntity * orxonox::WorldEntity::getAttachedObject | ( | unsigned int | index | ) |

Returns an attached object (merely for XMLPort).

References children_.

Referenced by XMLPort().

const std::set<WorldEntity*>& orxonox::WorldEntity::getAttachedObjects | ( |  | ) | const`[inline]`

Referenced by orxonox::PickupSpawner::changedActivity(), orxonox::TeamBaseMatchBase::changeTeamColour(), and orxonox::TeamDeathmatch::playerStartsControllingPawn().

CollisionType orxonox::WorldEntity::getCollisionType | ( |  | ) | const`[inline]`

Returns the CollisionType.

See also:
  CollisionType.

Referenced by getCollisionTypeStr().

std::string orxonox::WorldEntity::getCollisionTypeStr | ( |  | ) | const

Gets the CollisionType by string (used for the XMLPort).

References Dynamic, getCollisionType(), Kinematic, None, and Static.

Referenced by XMLPort().

bool orxonox::WorldEntity::getDeleteWithParent | ( |  | ) | const`[inline]`

Referenced by XMLPort().

float orxonox::WorldEntity::getFriction | ( |  | ) | const`[inline]`

Returns the amount of friction applied to the object.

Referenced by XMLPort().

float orxonox::WorldEntity::getLinearDamping | ( |  | ) | const`[inline]`

Returns the linear damping.

See also:
  setLinearDamping.

Referenced by XMLPort().

const btVector3& orxonox::WorldEntity::getLocalInertia | ( |  | ) | const`[inline]`

Returns the diagonal elements of the inertia tensor when calculated in local coordinates. The local inertia tensor cannot be set, but is calculated by Bullet according to the collisionShape. With compound collision shapes, an approximation is used.

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

float orxonox::WorldEntity::getMass | ( |  | ) | const`[inline]`

Returns the mass of this object without its children.

Referenced by orxonox::MobileEntity::applyCentralForce(), detach(), orxonox::MobileEntity::setAcceleration(), and XMLPort().

const Ogre::SceneNode* orxonox::WorldEntity::getNode | ( |  | ) | const`[inline]`

Referenced by orxonox::Backlight::Backlight().

const Quaternion & orxonox::WorldEntity::getOrientation | ( |  | ) | const

References node_.

Referenced by orxonox::Projectile::collidesAgainst(), orxonox::DroppedItem::createDefaultDrop(), orxonox::Pawn::deatheffect(), orxonox::HUDRadar::displayObject(), notifyBeingAttached(), orxonox::ControllableEntity::processClientOrientation(), orxonox::StaticEntity::registerVariables(), orxonox::MovableEntity::resynchronize(), rotate(), setDirection(), orxonox::ControllableEntity::setOrientation(), orxonox::ControllableEntity::setWorldTransform(), orxonox::Pawn::spawneffect(), orxonox::SoundManager::tick(), orxonox::PongBat::tick(), orxonox::Spectator::tick(), orxonox::ForceField::tick(), orxonox::ControllableEntity::tick(), orxonox::Engine::tick(), translate(), orxonox::SoundBase::update(), orxonox::Jump::used(), and XMLPort().

WorldEntity* orxonox::WorldEntity::getParent | ( |  | ) | const`[inline]`

Referenced by orxonox::ControllableEntity::addCameraPosition(), orxonox::ControllableEntity::parentChanged(), and orxonox::ControllableEntity::switchCamera().

const Vector3 & orxonox::WorldEntity::getPosition | ( |  | ) | const

References node_.

Referenced by orxonox::ArtificialController::aimAtTarget(), orxonox::WeaponSlot::attachWeapon(), orxonox::PongAI::calculateBallEndPosition(), orxonox::Projectile::collidesAgainst(), orxonox::DroppedItem::createDefaultDrop(), orxonox::Pawn::deatheffect(), orxonox::HUDRadar::displayObject(), orxonox::Pawn::goWithStyle(), orxonox::ArtificialController::isCloseAtTarget(), lookAt(), orxonox::ArtificialController::moveToPosition(), notifyBeingAttached(), orxonox::ControllableEntity::processClientPosition(), orxonox::StaticEntity::registerVariables(), orxonox::MovableEntity::resynchronize(), orxonox::WaypointPatrolController::searchEnemy(), orxonox::ArtificialController::searchNewTarget(), orxonox::ControllableEntity::setPosition(), orxonox::ArtificialController::setTarget(), orxonox::ControllableEntity::setWorldTransform(), orxonox::Pawn::spawneffect(), orxonox::SoundManager::tick(), orxonox::PongBat::tick(), orxonox::PongBall::tick(), orxonox::Planet::tick(), orxonox::ControllableEntity::tick(), orxonox::PongAI::tick(), translate(), orxonox::SoundBase::update(), and XMLPort().

float orxonox::WorldEntity::getRestitution | ( |  | ) | const`[inline]`

Returns the restitution parameter.

See also:
  setRestitution.

Referenced by XMLPort().

float orxonox::WorldEntity::getScale | ( |  | ) | const`[inline]`

References orxonox::MT_Type::Vector3.

Referenced by orxonox::Planet::init(), orxonox::Planet::tick(), and XMLPort().

const Vector3 & orxonox::WorldEntity::getScale3D | ( |  | ) | const

References node_.

Referenced by registerVariables(), and XMLPort().

float orxonox::WorldEntity::getTotalMass | ( |  | ) | const`[inline]`

Returns the total mass of this object with all its attached children.

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

Reimplemented in orxonox::MobileEntity.

Referenced by orxonox::SoundBase::update().

const Quaternion & orxonox::WorldEntity::getWorldOrientation | ( |  | ) | const

Returns the orientation relative to the root space.

References node_.

Referenced by orxonox::Gametype::end(), orxonox::WeaponMode::getMuzzleDirection(), orxonox::WeaponMode::getMuzzleOrientation(), orxonox::WeaponMode::getMuzzlePosition(), orxonox::Gametype::pawnKilled(), rotate(), orxonox::Camera::setDrag(), orxonox::SpawnPoint::spawn(), and orxonox::Camera::tick().

const Vector3 & orxonox::WorldEntity::getWorldPosition | ( |  | ) | const

Returns the position relative to the root space.

References node_.

Referenced by orxonox::DistanceTrigger::checkDistance(), orxonox::HUDRadar::displayObject(), orxonox::Gametype::end(), orxonox::WeaponMode::getMuzzlePosition(), lookAt(), orxonox::Gametype::pawnKilled(), orxonox::Camera::setDrag(), orxonox::SpawnPoint::spawn(), orxonox::ParticleSpawner::stopParticleSpawner(), orxonox::Planet::tick(), orxonox::ForceField::tick(), orxonox::Camera::tick(), orxonox::PickupSpawner::tick(), orxonox::DroppedItem::tick(), and ~WorldEntity().

float orxonox::WorldEntity::getWorldScale | ( |  | ) | const

Returns the scaling applied relative to the root space in 3 coordinates.

Returns:
  Returns the scaling if it is uniform, 1.0f otherwise.

References getWorldScale3D(), scale(), and orxonox::MT_Type::Vector3.

Referenced by orxonox::Backlight::update_length(), orxonox::Backlight::update_lifetime(), and orxonox::Backlight::update_width().

const Vector3 & orxonox::WorldEntity::getWorldScale3D | ( |  | ) | const

Returns the scaling applied relative to the root space in 3 coordinates.

References node_.

Referenced by getWorldScale().

bool orxonox::WorldEntity::hasCollisionResponse | ( |  | ) | `[inline]`

Tells whether there could be a collision response.

Referenced by XMLPort().

bool orxonox::WorldEntity::hasPhysics | ( |  | ) | const`[inline]`

Tells whether the object has any connection to the Bullet physics engine. If hasPhysics() is false, the object may still have a velocity.

References orxonox::KeybindMode::None.

Referenced by activatePhysics(), collisionCallbackActivityChanged(), collisionResponseActivityChanged(), internalSetPhysicsProps(), notifyBeingAttached(), notifyCollisionShapeChanged(), recalculateMassProps(), and setCollisionType().

void orxonox::WorldEntity::internalSetPhysicsProps | ( |  | ) | `[private]`

Copies our own parameters for restitution, angular factor, dampings and friction to the bullet rigid body.

References angularDamping_, angularFactor_, friction_, hasPhysics(), linearDamping_, physicalBody_, and restitution_.

Referenced by setCollisionType().

bool orxonox::WorldEntity::isCollisionCallbackActive | ( |  | ) | const`[inline]`

Tells whether there could be a collision callback via collidesAgainst(.).

Referenced by orxonox::Scene::collisionCallback().

virtual bool orxonox::WorldEntity::isCollisionTypeLegal | ( | CollisionType | type | ) | const`[protected, pure 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.

Implemented in orxonox::MobileEntity, orxonox::SpaceShip, and orxonox::StaticEntity.

Referenced by setCollisionType().

bool orxonox::WorldEntity::isDynamic | ( |  | ) | const`[inline]`

See also:
  CollisionType

Referenced by orxonox::MobileEntity::applyCentralForce(), orxonox::MobileEntity::getWorldTransform(), notifyBeingAttached(), orxonox::MobileEntity::setAcceleration(), orxonox::MobileEntity::setAngularAcceleration(), orxonox::MobileEntity::setAngularVelocity(), orxonox::MobileEntity::setOrientation(), orxonox::MobileEntity::setPosition(), orxonox::MobileEntity::setVelocity(), orxonox::MobileEntity::tick(), and orxonox::ControllableEntity::tick().

bool orxonox::WorldEntity::isKinematic | ( |  | ) | const`[inline]`

See also:
  CollisionType

Referenced by notifyBeingAttached().

bool orxonox::WorldEntity::isPhysicsActive | ( |  | ) | const`[inline]`

Tells whether physics has been activated (you can temporarily deactivate it).

Referenced by activatePhysics(), deactivatePhysics(), notifyBeingAttached(), and setCollisionType().

bool orxonox::WorldEntity::isStatic | ( |  | ) | const`[inline]`

See also:
  CollisionType

References orxonox::FunctionType::Static.

Referenced by recalculateMassProps(), orxonox::StaticEntity::setOrientation(), and orxonox::StaticEntity::setPosition().

void orxonox::WorldEntity::linearDampingChanged | ( |  | ) | `[inline, private]`

Network callback workaround to call a function when the value changes.

Referenced by registerVariables().

void orxonox::WorldEntity::lookAt | ( | const Vector3 & | target,
|  | TransformSpace | relativeTo = `WorldEntity::Parent`,
|  | const Vector3 & | localDirectionVector = `Vector3::NEGATIVE_UNIT_Z` |
| ) |  |  |

Makes this WorldEntity look a specific target location.

Parameters:

  | relativeTo |

See also:
  WorldEntity::TransformSpace

Parameters:

  | localDirectionVector | The vector which normally describes the natural direction of the object, usually -Z.

References getPosition(), getWorldPosition(), Local, Parent, setDirection(), orxonox::MT_Type::Vector3, and World.

void orxonox::WorldEntity::lookAt_xmlport | ( | const Vector3 & | target | ) | `[inline, private]`

Referenced by XMLPort().

void orxonox::WorldEntity::massChanged | ( |  | ) | `[inline, private]`

Network callback workaround to call a function when the value changes.

Referenced by registerVariables().

void orxonox::WorldEntity::networkcallback_parentChanged | ( |  | ) | `[private]`

Network function that object this instance to its correct parent.

References attachToParent(), orxonox::Synchronisable::getSynchronisable(), orxonox::OBJECTID_UNKNOWN, and parentID_.

Referenced by registerVariables().

bool orxonox::WorldEntity::notifyBeingAttached | ( | WorldEntity * | newParent | ) | `[private]`

Function gets called when this object is being attached to a new parent.

This operation is only allowed if the collision types "like" each other.

- You cannot a attach a non physical object to a physical one.
- Dynamic object can NOT be attached at all.
- It is also not possible to attach a kinematic to a dynamic one.
- Attaching of kinematic objects otherwise is not yet supported.

References bPhysicsActiveBeforeAttaching_, collisionShape_, COUT, deactivatePhysics(), detachFromParent(), orxonox::Synchronisable::getObjectID(), getOrientation(), getPosition(), hasPhysics(), isDynamic(), isKinematic(), isPhysicsActive(), parent_, parentChanged(), parentID_, orxonox::CollisionShape::setOrientation(), and orxonox::CollisionShape::setPosition().

Referenced by attach().

void orxonox::WorldEntity::notifyChildMassChanged | ( |  | ) |

Recalculates the accumulated child mass and calls recalculateMassProps() and notifies the parent of the change. Called by a child WE.

References children_, childrenMass_, notifyChildMassChanged(), parent_, and recalculateMassProps().

Referenced by notifyChildMassChanged().

void orxonox::WorldEntity::notifyChildPropsChanged | ( |  | ) |

void orxonox::WorldEntity::notifyCollisionShapeChanged | ( |  | ) |

Undertakes the necessary steps to change the collision shape in Bullet, even at runtime.

- called by this->collisionShape_
- May have a REALLY big overhead when called continuously at runtime, because then we need to remove the physical body from Bullet and add it again.

References activatePhysics(), addedToPhysicalWorld(), collisionShape_, deactivatePhysics(), orxonox::CollisionShape::getCollisionShape(), hasPhysics(), physicalBody_, and recalculateMassProps().

Referenced by orxonox::WorldEntityCollisionShape::updateParent().

void orxonox::WorldEntity::notifyDetached | ( |  | ) | `[private]`

Function gets called when the object has been detached from its parent.

References activatePhysics(), bPhysicsActiveBeforeAttaching_, collisionShape_, orxonox::OBJECTID_UNKNOWN, parent_, parentChanged(), parentID_, orxonox::CollisionShape::setOrientation(), and orxonox::CollisionShape::setPosition().

virtual void orxonox::WorldEntity::parentChanged | ( |  | ) | `[inline, protected, virtual]`

Reimplemented in orxonox::ControllableEntity.

Referenced by notifyBeingAttached(), notifyDetached(), and orxonox::ControllableEntity::parentChanged().

void orxonox::WorldEntity::physicsActivityChanged | ( |  | ) | `[private]`

Network callback for this->bPhysicsActive_.

References activatePhysics(), bPhysicsActiveSynchronised_, and deactivatePhysics().

Referenced by registerVariables().

void orxonox::WorldEntity::pitch | ( | const Degree & | angle,
|  | TransformSpace | relativeTo = `WorldEntity::Local` |
| ) |  |  | `[inline]`

References orxonox::MT_Type::Quaternion.

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

void orxonox::WorldEntity::pitch_xmlport | ( | const Degree & | angle | ) | `[inline, private]`

Referenced by XMLPort().

void orxonox::WorldEntity::recalculateMassProps | ( |  | ) | `[private]`

Updates all mass dependent parameters (mass, inertia tensor and child mass).

References orxonox::CollisionShape::calculateLocalInertia(), CCOUT, childrenMass_, collisionShape_, hasPhysics(), isStatic(), localInertia_, mass_, and physicalBody_.

Referenced by attach(), detach(), notifyChildMassChanged(), notifyCollisionShapeChanged(), and setCollisionType().

void orxonox::WorldEntity::registerVariables | ( |  | ) |

Reimplemented in orxonox::LightningGunProjectile, orxonox::Backlight, orxonox::BigExplosion, orxonox::Billboard, orxonox::BlinkingBillboard, orxonox::ControllableEntity, orxonox::ExplosionChunk, orxonox::FadingBillboard, orxonox::Light, orxonox::Model, orxonox::MovableEntity, orxonox::ParticleEmitter, orxonox::Pawn, orxonox::SpaceShip, orxonox::Spectator, orxonox::Planet, orxonox::PongBall, orxonox::PongBat, and orxonox::StaticEntity.

References angularDamping_, angularDampingChanged(), angularFactor_, angularFactorChanged(), orxonox::BaseObject::bActive_, bCollisionCallbackActive_, bCollisionResponseActive_, bPhysicsActiveSynchronised_, orxonox::BaseObject::bVisible_, orxonox::BaseObject::changedActivity(), orxonox::BaseObject::changedMainState(), orxonox::BaseObject::changedVisibility(), collisionCallbackActivityChanged(), collisionResponseActivityChanged(), collisionTypeChanged(), collisionTypeSynchronised_, friction_, frictionChanged(), getScale3D(), linearDamping_, linearDampingChanged(), orxonox::BaseObject::mainStateName_, mass_, massChanged(), networkcallback_parentChanged(), parentID_, physicsActivityChanged(), orxonox::Synchronisable::registerVariable(), restitution_, restitutionChanged(), scaleChanged(), and orxonox::VariableDirection::ToClient.

Referenced by orxonox::MobileEntity::MobileEntity(), and WorldEntity().

void orxonox::WorldEntity::restitutionChanged | ( |  | ) | `[inline, private]`

Network callback workaround to call a function when the value changes.

Referenced by registerVariables().

void orxonox::WorldEntity::roll | ( | const Degree & | angle,
|  | TransformSpace | relativeTo = `WorldEntity::Local` |
| ) |  |  | `[inline]`

References orxonox::MT_Type::Quaternion.

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

void orxonox::WorldEntity::roll_xmlport | ( | const Degree & | angle | ) | `[inline, private]`

Referenced by XMLPort().

void orxonox::WorldEntity::rotate | ( | const Vector3 & | axis,
|  | const Degree & | angle,
|  | TransformSpace | relativeTo = `WorldEntity::Local` |
| ) |  |  | `[inline]`

References orxonox::MT_Type::Quaternion.

void orxonox::WorldEntity::rotate | ( | const Quaternion & | rotation,
|  | TransformSpace | relativeTo = `WorldEntity::Local` |
| ) |  |  |

Rotates this WorldEntity by a quaternion.

Parameters:

  | relativeTo |

See also:
  WorldEntity::TransformSpace

References getOrientation(), getWorldOrientation(), Local, Parent, setOrientation(), and World.

void orxonox::WorldEntity::scale | ( | float | scale | ) | `[inline]`

Referenced by orxonox::FusionFire::fire(), and getWorldScale().

void orxonox::WorldEntity::scale3D | ( | float | x,
|  | float | y,
|  | float | z |
| ) |  |  | `[inline]`

References orxonox::MT_Type::Vector3.

void orxonox::WorldEntity::scale3D | ( | const Vector3 & | scale | ) | `[inline]`

void orxonox::WorldEntity::scaleChanged | ( |  | ) | `[inline, private]`

Referenced by registerVariables().

void orxonox::WorldEntity::setAngularDamping | ( | float | angularDamping | ) | `[inline]`

Applies a tensor independent rotation damping. Angular velocities will simply diminish exponentially.

Referenced by XMLPort().

void orxonox::WorldEntity::setAngularFactor | ( | float | angularFactor | ) | `[inline]`

Sets an artificial parameter that tells how much torque is applied when you apply a non-central force.

Normally the angular factor is 1, which means it's physically 'correct'. Howerver if you have a player character that should not rotate when hit sideways, you can set the angular factor to 0.

Referenced by XMLPort().

void orxonox::WorldEntity::setCollisionResponse | ( | bool | value | ) | `[inline]`

Enables or disables collision response (default is of course on).

Referenced by orxonox::Projectile::Projectile(), and XMLPort().

void orxonox::WorldEntity::setCollisionType | ( | CollisionType | type | ) |

Sets the CollisionType. This alters the object significantly!

See also:
  CollisionType. Operation does not work on attached WorldEntities.

References activatePhysics(), CCOUT, collisionCallbackActivityChanged(), collisionResponseActivityChanged(), collisionShape_, collisionType_, collisionTypeSynchronised_, deactivatePhysics(), Dynamic, orxonox::CollisionShape::getCollisionShape(), hasPhysics(), internalSetPhysicsProps(), isCollisionTypeLegal(), isPhysicsActive(), Kinematic, None, parent_, physicalBody_, recalculateMassProps(), and Static.

Referenced by collisionTypeChanged(), orxonox::Projectile::Projectile(), setCollisionTypeStr(), and orxonox::SpaceShip::SpaceShip().

void orxonox::WorldEntity::setCollisionTypeStr | ( | const std::string & | type | ) |

Sets the CollisionType by string (used for the XMLPort).

References Dynamic, orxonox::getLowercase(), Kinematic, None, setCollisionType(), Static, and ThrowException.

Referenced by XMLPort().

void orxonox::WorldEntity::setDeleteWithParent | ( | bool | value | ) | `[inline]`

Referenced by XMLPort().

void orxonox::WorldEntity::setDirection | ( | float | x,
|  | float | y,
|  | float | z,
|  | TransformSpace | relativeTo = `WorldEntity::Local`,
|  | const Vector3 & | localDirectionVector = `Vector3::NEGATIVE_UNIT_Z` |
| ) |  |  | `[inline]`

References orxonox::MT_Type::Vector3.

void orxonox::WorldEntity::setDirection | ( | const Vector3 & | direction,
|  | TransformSpace | relativeTo = `WorldEntity::Local`,
|  | const Vector3 & | localDirectionVector = `Vector3::NEGATIVE_UNIT_Z` |
| ) |  |  |

Makes this WorldEntity look in specific direction.

Parameters:

  | relativeTo |

See also:
  WorldEntity::TransformSpace

Parameters:

  | localDirectionVector | The vector which normally describes the natural direction of the object, usually -Z.

References getOrientation(), node_, orxonox::MT_Type::Quaternion, and setOrientation().

Referenced by orxonox::ForceField::ForceField(), and lookAt().

void orxonox::WorldEntity::setDirection_xmlport | ( | const Vector3 & | direction | ) | `[inline, private]`

Referenced by XMLPort().

void orxonox::WorldEntity::setFriction | ( | float | friction | ) | `[inline]`

Applies friction to the object. Friction occurs when two objects collide.

Referenced by XMLPort().

void orxonox::WorldEntity::setLinearDamping | ( | float | linearDamping | ) | `[inline]`

Applies a mass independent damping. Velocities will simply diminish exponentially.

Referenced by XMLPort().

void orxonox::WorldEntity::setMass | ( | float | mass | ) | `[inline]`

Sets the mass of this object. Note that the total mass may be influenced by attached objects!

Referenced by XMLPort().

void orxonox::WorldEntity::setOrientation | ( | const Vector3 & | axis,
|  | const Degree & | angle |
| ) |  |  | `[inline]`

References orxonox::MT_Type::Quaternion.

void orxonox::WorldEntity::setOrientation | ( | const Vector3 & | axis,
|  | const Radian & | angle |
| ) |  |  | `[inline]`

References orxonox::MT_Type::Quaternion.

void orxonox::WorldEntity::setOrientation | ( | float | w,
|  | float | x,
|  | float | y,
|  | float | z |
| ) |  |  | `[inline]`

References orxonox::MT_Type::Quaternion.

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

Implemented in orxonox::ControllableEntity, orxonox::MobileEntity, orxonox::MovableEntity, and orxonox::StaticEntity.

Referenced by rotate(), setDirection(), and XMLPort().

void orxonox::WorldEntity::setPosition | ( | float | x,
|  | float | y,
|  | float | z |
| ) |  |  | `[inline]`

References orxonox::MT_Type::Vector3.

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

Implemented in orxonox::ControllableEntity, orxonox::MobileEntity, orxonox::MovableEntity, and orxonox::StaticEntity.

Referenced by translate(), and XMLPort().

void orxonox::WorldEntity::setRestitution | ( | float | restitution | ) | `[inline]`

Sets how much reaction is applied in a collision.

Consider two equal spheres colliding with equal velocities: Restitution 1 means that both spheres simply reverse their velocity (no loss of energy) Restitution 0 means that both spheres will immediately stop moving (maximum loss of energy without violating of the preservation of momentum)

Referenced by XMLPort().

void orxonox::WorldEntity::setScale | ( | float | scale | ) | `[inline]`

Referenced by orxonox::BillboardProjectile::BillboardProjectile(), orxonox::DroppedItem::createDefaultDrop(), orxonox::BigExplosion::init(), orxonox::MuzzleFlash::MuzzleFlash(), orxonox::HsW01::shot(), orxonox::EnergyDrink::shot(), orxonox::BlinkingBillboard::tick(), and XMLPort().

void orxonox::WorldEntity::setScale3D | ( | float | x,
|  | float | y,
|  | float | z |
| ) |  |  | `[inline]`

References orxonox::MT_Type::Vector3.

void orxonox::WorldEntity::setScale3D | ( | const Vector3 & | scale | ) | `[virtual]`

Sets the three dimensional scaling of this object. Scaling physical objects has not yet been implemented and is therefore forbidden.

References changedScale(), and node_.

Referenced by XMLPort().

void orxonox::WorldEntity::translate | ( | float | x,
|  | float | y,
|  | float | z,
|  | TransformSpace | relativeTo = `WorldEntity::Parent` |
| ) |  |  | `[inline]`

References orxonox::MT_Type::Vector3.

void orxonox::WorldEntity::translate | ( | const Vector3 & | distance,
|  | TransformSpace | relativeTo = `WorldEntity::Parent` |
| ) |  |  |

Translates this WorldEntity by a vector.

Parameters:

  | relativeTo |

See also:
  WorldEntity::TransformSpace

References getOrientation(), getPosition(), Local, node_, Parent, setPosition(), and World.

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

void orxonox::WorldEntity::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::BaseObject.

Reimplemented in orxonox::PickupSpawner, orxonox::QuestEffectBeacon, orxonox::Weapon, orxonox::WeaponSlot, orxonox::Attacher, orxonox::Backlight, orxonox::Billboard, orxonox::BlinkingBillboard, orxonox::CameraPosition, orxonox::ControllableEntity, orxonox::FadingBillboard, orxonox::ForceField, orxonox::Light, orxonox::MobileEntity, orxonox::Model, orxonox::MovableEntity, orxonox::ParticleEmitter, orxonox::ParticleSpawner, orxonox::Pawn, orxonox::SpaceShip, orxonox::Planet, orxonox::PongCenterpoint, orxonox::SpawnPoint, orxonox::TeamSpawnPoint, orxonox::CheckPoint, orxonox::DistanceTrigger, orxonox::PlayerTrigger, and orxonox::Trigger.

References attach(), attachCollisionShape(), getAngularDamping(), getAngularFactor(), getAttachedCollisionShape(), getAttachedObject(), getCollisionTypeStr(), getDeleteWithParent(), getFriction(), getLinearDamping(), getMass(), getOrientation(), getPosition(), getRestitution(), getScale(), getScale3D(), hasCollisionResponse(), lookAt_xmlport(), pitch_xmlport(), orxonox::MT_Type::Quaternion, roll_xmlport(), setAngularDamping(), setAngularFactor(), setCollisionResponse(), setCollisionTypeStr(), setDeleteWithParent(), setDirection_xmlport(), setFriction(), setLinearDamping(), setMass(), setOrientation(), setPosition(), setRestitution(), setScale(), setScale3D(), SUPER, orxonox::MT_Type::Vector3, XMLPortObject, XMLPortParam, XMLPortParamLoadOnly, XMLPortParamTemplate, and yaw_xmlport().

void orxonox::WorldEntity::yaw | ( | const Degree & | angle,
|  | TransformSpace | relativeTo = `WorldEntity::Local` |
| ) |  |  | `[inline]`

References orxonox::MT_Type::Quaternion.

Referenced by orxonox::Pong::start(), orxonox::Spectator::tick(), and orxonox::PickupSpawner::tick().

void orxonox::WorldEntity::yaw_xmlport | ( | const Degree & | angle | ) | `[inline, private]`

Referenced by XMLPort().

## Friends And Related Function Documentation

friend class Scene`[friend]`

## Member Data Documentation

btScalar orxonox::WorldEntity::angularDamping_`[private]`

See also:
  setAngularDamping

Referenced by internalSetPhysicsProps(), registerVariables(), and WorldEntity().

btScalar orxonox::WorldEntity::angularFactor_`[private]`

See also:
  setAngularFactor

Referenced by internalSetPhysicsProps(), registerVariables(), and WorldEntity().

const Vector3 orxonox::WorldEntity::BACK = Vector3::UNIT_Z`[static]`

bool orxonox::WorldEntity::bCollisionCallbackActive_`[private]`

See also:
  enableCollisionCallback

Referenced by collisionCallbackActivityChanged(), registerVariables(), and WorldEntity().

bool orxonox::WorldEntity::bCollisionResponseActive_`[private]`

Tells whether the object should respond to collisions.

Referenced by collisionResponseActivityChanged(), registerVariables(), and WorldEntity().

bool orxonox::WorldEntity::bDeleteWithParent_`[private]`

Referenced by WorldEntity().

bool orxonox::WorldEntity::bPhysicsActive_`[private]`

See also:
  isPhysicsActive

Referenced by activatePhysics(), deactivatePhysics(), and WorldEntity().

bool orxonox::WorldEntity::bPhysicsActiveBeforeAttaching_`[private]`

When attaching objects hierarchically this variable tells this object (as child) whether physics was activated before attaching (because the deactivate physics while being attached).

Referenced by notifyBeingAttached(), notifyDetached(), and WorldEntity().

bool orxonox::WorldEntity::bPhysicsActiveSynchronised_`[private]`

Network synchronised variable for bPhysicsActive_

Referenced by activatePhysics(), deactivatePhysics(), physicsActivityChanged(), registerVariables(), and WorldEntity().

std::set<WorldEntity*> orxonox::WorldEntity::children_`[private]`

Reimplemented in orxonox::Trigger.

Referenced by attach(), detach(), getAttachedObject(), notifyChildMassChanged(), and ~WorldEntity().

btScalar orxonox::WorldEntity::childrenMass_`[private]`

Sum of all the children's masses.

Referenced by attach(), detach(), notifyChildMassChanged(), recalculateMassProps(), and WorldEntity().

WorldEntityCollisionShape* orxonox::WorldEntity::collisionShape_`[private]`

Attached collision shapes go here.

Referenced by attach(), attachCollisionShape(), detach(), detachCollisionShape(), getAttachedCollisionShape(), notifyBeingAttached(), notifyCollisionShapeChanged(), notifyDetached(), recalculateMassProps(), setCollisionType(), WorldEntity(), and ~WorldEntity().

CollisionType orxonox::WorldEntity::collisionType_`[private]`

See also:
  setCollisionType

Referenced by collisionTypeChanged(), setCollisionType(), and WorldEntity().

CollisionType orxonox::WorldEntity::collisionTypeSynchronised_`[private]`

Network synchronised variable for collisionType_.

Referenced by collisionTypeChanged(), registerVariables(), setCollisionType(), and WorldEntity().

const Vector3 orxonox::WorldEntity::DOWN = Vector3::NEGATIVE_UNIT_Y`[static]`

btScalar orxonox::WorldEntity::friction_`[private]`

See also:
  setFriction

Referenced by internalSetPhysicsProps(), registerVariables(), and WorldEntity().

const Vector3 orxonox::WorldEntity::FRONT = Vector3::NEGATIVE_UNIT_Z`[static]`

Referenced by orxonox::HUDRadar::displayObject(), orxonox::WeaponMode::getMuzzleDirection(), orxonox::ArtificialController::isLookingAtTarget(), orxonox::Light::Light(), orxonox::ArtificialController::moveToPosition(), orxonox::ParticleProjectile::ParticleProjectile(), orxonox::ArtificialController::searchNewTarget(), and orxonox::ForceField::tick().

const Vector3 orxonox::WorldEntity::LEFT = Vector3::NEGATIVE_UNIT_X`[static]`

btScalar orxonox::WorldEntity::linearDamping_`[private]`

See also:
  setLinearDamping

Referenced by internalSetPhysicsProps(), registerVariables(), and WorldEntity().

btVector3 orxonox::WorldEntity::localInertia_`[private]`

See also:
  getLocalInertia

Referenced by recalculateMassProps().

btScalar orxonox::WorldEntity::mass_`[private]`

See also:
  setMass

Referenced by recalculateMassProps(), registerVariables(), and WorldEntity().

Ogre::SceneNode* orxonox::WorldEntity::node_`[protected]`

Referenced by attach(), attachNode(), attachOgreObject(), attachToNode(), orxonox::ControllableEntity::ControllableEntity(), detach(), detachFromNode(), detachNode(), detachOgreObject(), getOrientation(), getPosition(), getScale3D(), getWorldOrientation(), getWorldPosition(), getWorldScale3D(), orxonox::StaticEntity::getWorldTransform(), orxonox::MobileEntity::getWorldTransform(), setDirection(), orxonox::StaticEntity::setOrientation(), orxonox::MobileEntity::setOrientation(), orxonox::StaticEntity::setPosition(), orxonox::MobileEntity::setPosition(), setScale3D(), orxonox::MobileEntity::setWorldTransform(), orxonox::MobileEntity::tick(), orxonox::Backlight::tick(), translate(), WorldEntity(), and ~WorldEntity().

WorldEntity* orxonox::WorldEntity::parent_`[private]`

Referenced by activatePhysics(), collisionTypeChanged(), notifyBeingAttached(), notifyChildMassChanged(), notifyDetached(), setCollisionType(), WorldEntity(), and ~WorldEntity().

unsigned int orxonox::WorldEntity::parentID_`[private]`

Referenced by networkcallback_parentChanged(), notifyBeingAttached(), notifyDetached(), registerVariables(), and WorldEntity().

btRigidBody* orxonox::WorldEntity::physicalBody_`[protected]`

Bullet rigid body. Everything physical is applied to this instance.

Referenced by addedToPhysicalWorld(), orxonox::MobileEntity::applyCentralForce(), collisionCallbackActivityChanged(), collisionResponseActivityChanged(), orxonox::MobileEntity::getWorldTransform(), internalSetPhysicsProps(), notifyCollisionShapeChanged(), recalculateMassProps(), orxonox::Scene::removePhysicalObject(), orxonox::MobileEntity::setAcceleration(), orxonox::MobileEntity::setAngularAcceleration(), orxonox::MobileEntity::setAngularVelocity(), setCollisionType(), orxonox::StaticEntity::setOrientation(), orxonox::MobileEntity::setOrientation(), orxonox::StaticEntity::setPosition(), orxonox::MobileEntity::setPosition(), orxonox::MobileEntity::setVelocity(), orxonox::MobileEntity::setWorldTransform(), orxonox::SpaceShip::tick(), WorldEntity(), and ~WorldEntity().

btScalar orxonox::WorldEntity::restitution_`[private]`

See also:
  setRestitution

Referenced by internalSetPhysicsProps(), registerVariables(), and WorldEntity().

const Vector3 orxonox::WorldEntity::RIGHT = Vector3::UNIT_X`[static]`

const Vector3 orxonox::WorldEntity::UP = Vector3::UNIT_Y`[static]`

Referenced by orxonox::HUDRadar::displayObject(), and orxonox::ArtificialController::moveToPosition().

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

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