Orxonox  0.0.5 Codename: Arcturus
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
orxonox::WorldEntity Class Referenceabstract

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

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

Inheritance diagram for orxonox::WorldEntity:
orxonox::BaseObject orxonox::Synchronisable orxonox::OrxonoxClass orxonox::OrxonoxInterface orxonox::Configurable orxonox::Destroyable orxonox::Configurable orxonox::Destroyable orxonox::Listable orxonox::Listable orxonox::Identifiable orxonox::Identifiable orxonox::MobileEntity orxonox::StaticEntity orxonox::ControllableEntity orxonox::MovableEntity orxonox::TowerDefenseCenterpoint orxonox::Actionpoint orxonox::Asteroids2DCenterPoint orxonox::Attacher orxonox::Billboard orxonox::Camera orxonox::CameraPosition orxonox::DistanceTriggerBeacon orxonox::Dock orxonox::DockingTarget orxonox::DodgeRaceCenterPoint orxonox::ForceField orxonox::HoverFlag orxonox::HoverOrigin orxonox::HoverWall orxonox::IceGunFreezer orxonox::InvaderCenterPoint orxonox::JumpCenterpoint orxonox::LensFlare orxonox::Light orxonox::Mini4DgameBoard orxonox::Model orxonox::NameableStaticEntity orxonox::OrxoKartFlag orxonox::OrxoKartOrigin orxonox::OrxoKartTile orxonox::OrxyRoadCenterPoint orxonox::ParticleEmitter orxonox::PickupSpawner orxonox::PongCenterpoint orxonox::PortalEndPoint orxonox::QuestEffectBeacon orxonox::SOBCastlestone orxonox::SOBCenterpoint orxonox::SOBFlagstone orxonox::SOBItem orxonox::SpaceBoundaries orxonox::SpawnPoint orxonox::TetrisCenterpoint orxonox::TriggerBase orxonox::WagnisGameboard orxonox::Weapon orxonox::WeaponSlot orxonox::WorldSound

Public Types

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 Member Functions

 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 void changedVisibility (void) override
 When the visibility is changed, it is changed for all attached objects as well. More...
 
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...
 
virtual const Vector3 & getVelocity () const
 
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...
 
virtual void setOrientation (const Quaternion &orientation)=0
 
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)
 
virtual void setPosition (const Vector3 &position)=0
 
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)
 
virtual void XMLPort (Element &xmlelement, XMLPort::Mode mode) override
 XML loading and saving. More...
 
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...
 
virtual void XMLEventPort (Element &xmlelement, XMLPort::Mode mode)
 Defines the possible event states of this object and parses eventsources from an XML file. 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 ()
 

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. More...
 
virtual void parentChanged ()
 
- 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::Destroyable
virtual void preDestroy ()
 This virtual function is called if destroy() is called and no StrongPtr points to this object. 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 Attributes

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 angularDampingChanged ()
 Network callback workaround to call a function when the value changes. More...
 
void angularFactorChanged ()
 Network callback workaround to call a function when the value changes. More...
 
void ccdMotionThresholdChanged ()
 Network callback workaround to call a function when the value changes. More...
 
void ccdSweptSphereRadiusChanged ()
 Network callback workaround to call a function when the value changes. More...
 
void collisionCallbackActivityChanged ()
 Function sets whether Bullet should issue a callback on collisions. More...
 
void collisionResponseActivityChanged ()
 Function sets whether Bullet should react itself to a collision. More...
 
void collisionTypeChanged ()
 Network callback for the collision type. More...
 
void frictionChanged ()
 Network callback workaround to call a function when the value changes. More...
 
void internalSetPhysicsProps ()
 Copies our own parameters for restitution, angular factor, damping and friction to the bullet rigid body. More...
 
void linearDampingChanged ()
 Network callback workaround to call a function when the value changes. More...
 
void lookAt_xmlport (const Vector3 &target)
 
void massChanged ()
 Network callback workaround to call a function when the value changes. More...
 
void networkcallback_parentChanged ()
 Network function that object this instance to its correct parent. More...
 
bool notifyBeingAttached (WorldEntity *newParent)
 Function gets called when this object is being attached to a new parent. More...
 
void notifyDetached ()
 Function gets called when the object has been detached from its parent. More...
 
void physicsActivityChanged ()
 Network callback for this->bPhysicsActive_. More...
 
void pitch_xmlport (const Degree &angle)
 
void recalculateMassProps ()
 Updates all mass dependent parameters (mass, inertia tensor and child mass) More...
 
void registerVariables ()
 
void restitutionChanged ()
 Network callback workaround to call a function when the value changes. More...
 
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 bActiveMem_
 
bool bCollisionCallbackActive_
 
bool bCollisionResponseActive_
 Tells whether the object should respond to collisions. More...
 
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). More...
 
bool bPhysicsActiveSynchronised_
 Network synchronised variable for bPhysicsActive_. More...
 
bool bVisibleMem_
 
btScalar ccdMotionThreshold_
 
btScalar ccdSweptSphereRadius_
 
std::set< WorldEntity * > children_
 
btScalar childrenMass_
 Sum of all the children's masses. More...
 
WorldEntityCollisionShapecollisionShape_
 Attached collision shapes go here. More...
 
CollisionType collisionType_
 
CollisionType collisionTypeSynchronised_
 Network synchronised variable for collisionType_. More...
 
btScalar friction_
 
btScalar linearDamping_
 
btVector3 localInertia_
 
btScalar mass_
 
WorldEntityparent_
 
unsigned int parentID_
 
btScalar restitution_
 

Friends

class Scene
 

Additional Inherited Members

- 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...
 

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 derived 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 physical body that is internally stored and administrated has the following supported properties:
  • Restitution, angular factor, linear damping, angular damping, friction, 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

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 

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 ( Context context)

Creates a new WorldEntity that may immediately be used.

All the default values are being set here.

orxonox::WorldEntity::~WorldEntity ( )
virtual

Destroys the WorldEntity AND ALL its children with it.

Member Function Documentation

void orxonox::WorldEntity::activatePhysics ( )

Activates physics if the CollisionType is not None.

bool orxonox::WorldEntity::addedToPhysicalWorld ( ) const

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

void orxonox::WorldEntity::angularDampingChanged ( )
inlineprivate

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

void orxonox::WorldEntity::angularFactorChanged ( )
inlineprivate

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

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

Attaches a child WorldEntity to this object.

This calls notifyBeingAttached() of the child WE.

Note
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 orxonox::WorldEntity::attachCollisionShape ( CollisionShape shape)

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

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

Attaches an Ogre::SceneNode to this WorldEntity.

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

Attaches an Ogre::MovableObject to this WorldEntity.

void orxonox::WorldEntity::attachOgreObject ( Ogre::BillboardSet *  object)
void orxonox::WorldEntity::attachOgreObject ( Ogre::Camera *  object)
void orxonox::WorldEntity::attachOgreObject ( Ogre::Entity *  object)
void orxonox::WorldEntity::attachOgreObject ( Ogre::ParticleSystem *  object)
void orxonox::WorldEntity::attachToNode ( Ogre::SceneNode *  node)

Attaches this object to a parent SceneNode.

Remarks
Only use this method if you know exactly what you're doing! Normally, attaching works internally by attaching WE's.
void orxonox::WorldEntity::attachToParent ( WorldEntity parent)
inline
orxonox::WorldEntity::BT_DECLARE_ALIGNED_ALLOCATOR ( )
void orxonox::WorldEntity::ccdMotionThresholdChanged ( )
inlineprivate

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

void orxonox::WorldEntity::ccdSweptSphereRadiusChanged ( )
inlineprivate

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

void orxonox::WorldEntity::changedActivity ( void  )
overridevirtual

When the activity is changed, it is changed for all attached objects as well.

Reimplemented from orxonox::BaseObject.

Reimplemented in orxonox::PortalEndPoint, orxonox::CheckPoint, orxonox::Attacher, orxonox::WorldSound, orxonox::FadingBillboard, and orxonox::ParticleEmitter.

virtual void orxonox::WorldEntity::changedScale ( )
inlinevirtual

Reimplemented in orxonox::Backlight.

void orxonox::WorldEntity::changedVisibility ( void  )
overridevirtual
virtual bool orxonox::WorldEntity::collidesAgainst ( WorldEntity otherObject,
const btCollisionShape *  ownCollisionShape,
btManifoldPoint &  contactPoint 
)
inlinevirtual

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

Parameters
otherObjectThe object this one has collided into.
ownCollisionShapeThe collision shape of the other object
contactPointContact point provided by Bullet. Holds more information and can me modified. See return value.
Returns
Returning false means that no modification to the contactPoint has been made. Return true otherwise!
Note
Condition is that enableCollisionCallback() was called.

Reimplemented in orxonox::DodgeRaceShip, orxonox::OrxyRoadShip, orxonox::FpsPlayer, orxonox::HoverShip, orxonox::Projectile, orxonox::InvaderShip, orxonox::Rocket, orxonox::RocketOld, orxonox::SimpleRocket, orxonox::IceGunProjectile, orxonox::Asteroids2DShip, orxonox::Asteroids2DStone, orxonox::WagnisProjectile, orxonox::OrxoKartFlag, orxonox::OrxoKartTile, orxonox::HoverFlag, orxonox::SOBFireball, orxonox::SOBTube, orxonox::SOBFlagstone, orxonox::SOBItem, orxonox::InvaderEnemy, orxonox::SOBGumba, orxonox::SOBGumbaBoss, orxonox::SOBMushroom, orxonox::MovableEntity, orxonox::SOBFigure, orxonox::SOBCastlestone, orxonox::GravityBomb, orxonox::ShootableObstacle, and orxonox::SOBQBlock.

void orxonox::WorldEntity::collisionCallbackActivityChanged ( )
private

Function sets whether Bullet should issue a callback on collisions.

void orxonox::WorldEntity::collisionResponseActivityChanged ( )
private

Function sets whether Bullet should react itself to a collision.

void orxonox::WorldEntity::collisionTypeChanged ( )
private

Network callback for the collision type.

Only change the type if it was valid.

void orxonox::WorldEntity::deactivatePhysics ( )

Deactivates physics but the CollisionType does not change.

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

Detaches a child WorldEntity from this instance.

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

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

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

Detaches this object from a parent SceneNode.

Remarks
Only use this method if you know exactly what you're doing! Normally, attaching works internally by attaching WE's.
void orxonox::WorldEntity::detachFromParent ( )
inline
void orxonox::WorldEntity::detachNode ( Ogre::SceneNode *  node)

Detaches an Ogre::SceneNode from this WorldEntity.

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

Detaches an Ogre::MovableObject from this WorldEntity.

void orxonox::WorldEntity::detachOgreObject ( Ogre::BillboardSet *  object)
void orxonox::WorldEntity::detachOgreObject ( Ogre::Camera *  object)
void orxonox::WorldEntity::detachOgreObject ( Ogre::Entity *  object)
void orxonox::WorldEntity::detachOgreObject ( Ogre::ParticleSystem *  object)
Ogre::MovableObject * orxonox::WorldEntity::detachOgreObject ( const Ogre::String &  name)

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

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!

void orxonox::WorldEntity::frictionChanged ( )
inlineprivate

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

float orxonox::WorldEntity::getAngularDamping ( ) const
inline

Returns the angular damping.

See also
setAngularDamping.
float orxonox::WorldEntity::getAngularFactor ( ) const
inline

Returns the angular factor.

See also
setAngularFactor.
CollisionShape * orxonox::WorldEntity::getAttachedCollisionShape ( unsigned int  index)

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

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

Returns an attached object (merely for XMLPort).

const std::set<WorldEntity*>& orxonox::WorldEntity::getAttachedObjects ( ) const
inline
float orxonox::WorldEntity::getCcdMotionThreshold ( ) const
inline

Returns the currently used motion threshold for CCD (0 means CCD is deactivated).

float orxonox::WorldEntity::getCcdSweptSphereRadius ( ) const
inline

Returns the currently used radius of the sphere for CCD.

CollisionType orxonox::WorldEntity::getCollisionType ( ) const
inline

Returns the CollisionType.

See also
CollisionType.
std::string orxonox::WorldEntity::getCollisionTypeStr ( ) const

Gets the CollisionType by string (used for the XMLPort)

bool orxonox::WorldEntity::getDeleteWithParent ( ) const
inline
float orxonox::WorldEntity::getFriction ( ) const
inline

Returns the amount of friction applied to the object.

std::string orxonox::WorldEntity::getID ( void  )
inline
float orxonox::WorldEntity::getLinearDamping ( ) const
inline

Returns the linear damping.

See also
setLinearDamping.
const btVector3& orxonox::WorldEntity::getLocalInertia ( ) const
inline

Returns the diagonal elements of the inertia tensor when calculated in local coordinates.

Note
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 orxonox::WorldEntity::getMass ( ) const
inline

Returns the mass of this object without its children.

const Ogre::SceneNode* orxonox::WorldEntity::getNode ( ) const
inline
const Quaternion & orxonox::WorldEntity::getOrientation ( ) const
WorldEntity* orxonox::WorldEntity::getParent ( ) const
inline
const Vector3 & orxonox::WorldEntity::getPosition ( void  ) const
float orxonox::WorldEntity::getRestitution ( ) const
inline

Returns the restitution parameter.

See also
setRestitution.
float orxonox::WorldEntity::getScale ( ) const
inline
const Vector3 & orxonox::WorldEntity::getScale3D ( ) const
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
inlinevirtual

Reimplemented in orxonox::MobileEntity.

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

Returns the orientation relative to the root space.

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

Returns the position relative to the root space.

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.
const Vector3 & orxonox::WorldEntity::getWorldScale3D ( ) const

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

bool orxonox::WorldEntity::hasCollisionResponse ( )
inline

Tells whether there could be a collision response.

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.

void orxonox::WorldEntity::internalSetPhysicsProps ( )
private

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

bool orxonox::WorldEntity::isCollisionCallbackActive ( ) const
inline

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

virtual bool orxonox::WorldEntity::isCollisionTypeLegal ( CollisionType  type) const
protectedpure 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 class's virtual functions don't yet exist in the constructor if a base class.

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

bool orxonox::WorldEntity::isDynamic ( ) const
inline
See also
CollisionType
bool orxonox::WorldEntity::isKinematic ( ) const
inline
See also
CollisionType
bool orxonox::WorldEntity::isPhysicsActive ( ) const
inline

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

bool orxonox::WorldEntity::isStatic ( ) const
inline
See also
CollisionType
void orxonox::WorldEntity::linearDampingChanged ( )
inlineprivate

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

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

Makes this WorldEntity look at a specific target location.

Parameters
targetAn absolute point in the space which defines the direction of the entity
relativeToThe TransformSpace of this translation
localDirectionVectorThe vector which normally describes the natural direction of the object, usually -Z.
void orxonox::WorldEntity::lookAt_xmlport ( const Vector3 &  target)
inlineprivate
void orxonox::WorldEntity::massChanged ( )
inlineprivate

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

void orxonox::WorldEntity::networkcallback_parentChanged ( )
private

Network function that object this instance to its correct parent.

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.
void orxonox::WorldEntity::notifyChildMassChanged ( )

Recalculates the accumulated child mass and calls recalculateMassProps() and notifies the parent of the change.

Note
Called by a child WE
void orxonox::WorldEntity::notifyChildPropsChanged ( )
void orxonox::WorldEntity::notifyCollisionShapeChanged ( )

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

Note
  • 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 orxonox::WorldEntity::notifyDetached ( )
private

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

virtual void orxonox::WorldEntity::parentChanged ( )
inlineprotectedvirtual

Reimplemented in orxonox::ControllableEntity.

void orxonox::WorldEntity::physicsActivityChanged ( )
private

Network callback for this->bPhysicsActive_.

void orxonox::WorldEntity::pitch ( const Degree &  angle,
TransformSpace  relativeTo = TransformSpace::Local 
)
inline
void orxonox::WorldEntity::pitch_xmlport ( const Degree &  angle)
inlineprivate
void orxonox::WorldEntity::recalculateMassProps ( )
private

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

void orxonox::WorldEntity::registerVariables ( void  )
private
void orxonox::WorldEntity::restitutionChanged ( )
inlineprivate

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

void orxonox::WorldEntity::roll ( const Degree &  angle,
TransformSpace  relativeTo = TransformSpace::Local 
)
inline
void orxonox::WorldEntity::roll_xmlport ( const Degree &  angle)
inlineprivate
void orxonox::WorldEntity::rotate ( const Quaternion &  rotation,
TransformSpace  relativeTo = TransformSpace::Local 
)

Rotates this WorldEntity by a quaternion.

Parameters
rotationThe desired relative rotation
relativeToThe TransformSpace of this translation
void orxonox::WorldEntity::rotate ( const Vector3 &  axis,
const Degree &  angle,
TransformSpace  relativeTo = TransformSpace::Local 
)
inline
void orxonox::WorldEntity::scale ( float  scale)
inline
void orxonox::WorldEntity::scale3D ( const Vector3 &  scale)
inline
void orxonox::WorldEntity::scale3D ( float  x,
float  y,
float  z 
)
inline
void orxonox::WorldEntity::scaleChanged ( )
inlineprivate
void orxonox::WorldEntity::setAngularDamping ( float  angularDamping)
inline

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

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'. However if you have a player character that should not rotate when hit sideways, you can set the angular factor to 0.

void orxonox::WorldEntity::setCcdMotionThreshold ( float  ccdMotionThreshold)
inline

Sets the motion threshold for continuous collision detection (CCD).

This should be activated if an object moves further in one tick than its own size. This means that in one tick the object may be in front of a wall and in the next tick it will be behind the wall without ever triggering a collision. CCD ensures that collisions are still detected. By default it is deactivated (threshold = 0) which is fine for slow or static objects, but it should be set to a real value for fast moving objects (e.g. projectiles).

A good value for the threshold is (diameter^2).

Parameters
ccdMotionThresholdCCD is enabled if the squared velocity of the object is > ccdMotionThreshold (default 0.0). 0.0 means deactivated.
void orxonox::WorldEntity::setCcdSweptSphereRadius ( float  ccdSweptSphereRadius)
inline

Sets the radius of the sphere which is used for continuous collision detection (CCD).

The sphere should be embedded inside the objects collision shape, preferably smaller.

See also
setCcdMotionThreshold for more information about CCD.

A good value for the radius is (diameter/5).

Parameters
ccdSweptSphereRadiusThe diameter of the sphere which is used for CCD (default 0.0).
void orxonox::WorldEntity::setCollisionResponse ( bool  value)
inline

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

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

Sets the CollisionType.

This alters the object significantly!

Note
Operation does not work on attached WorldEntities.
void orxonox::WorldEntity::setCollisionTypeStr ( const std::string &  type)

Sets the CollisionType by string (used for the XMLPort)

void orxonox::WorldEntity::setDeleteWithParent ( bool  value)
inline
void orxonox::WorldEntity::setDirection ( const Vector3 &  direction,
TransformSpace  relativeTo = TransformSpace::Local,
const Vector3 &  localDirectionVector = Vector3::NEGATIVE_UNIT_Z 
)

Makes this WorldEntity look in specific direction.

Parameters
directionA point relative to the position of the WorldEntity which defines its orientation
relativeToThe TransformSpace of this translation
localDirectionVectorThe vector which normally describes the natural direction of the object, usually -Z.
void orxonox::WorldEntity::setDirection ( float  x,
float  y,
float  z,
TransformSpace  relativeTo = TransformSpace::Local,
const Vector3 &  localDirectionVector = Vector3::NEGATIVE_UNIT_Z 
)
inline
void orxonox::WorldEntity::setDirection_xmlport ( const Vector3 &  direction)
inlineprivate
void orxonox::WorldEntity::setFriction ( float  friction)
inline

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

void orxonox::WorldEntity::setID ( std::string  id)
inline
void orxonox::WorldEntity::setLinearDamping ( float  linearDamping)
inline

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

void orxonox::WorldEntity::setMass ( float  mass)
inline

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

virtual void orxonox::WorldEntity::setOrientation ( const Quaternion &  orientation)
pure virtual
void orxonox::WorldEntity::setOrientation ( float  w,
float  x,
float  y,
float  z 
)
inline
void orxonox::WorldEntity::setOrientation ( const Vector3 &  axis,
const Radian &  angle 
)
inline
void orxonox::WorldEntity::setOrientation ( const Vector3 &  axis,
const Degree &  angle 
)
inline
virtual void orxonox::WorldEntity::setPosition ( const Vector3 &  position)
pure virtual
void orxonox::WorldEntity::setPosition ( float  x,
float  y,
float  z 
)
inline
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)

void orxonox::WorldEntity::setScale ( float  scale)
inline
void orxonox::WorldEntity::setScale3D ( const Vector3 &  scale)
virtual

Sets the three dimensional scaling of this object.

Note
Scaling physical objects has not yet been implemented and is therefore forbidden.
void orxonox::WorldEntity::setScale3D ( float  x,
float  y,
float  z 
)
inline
void orxonox::WorldEntity::translate ( const Vector3 &  distance,
TransformSpace  relativeTo = TransformSpace::Parent 
)

Translates this WorldEntity by a vector.

Parameters
distanceThe relative distance of the translation
relativeToThe TransformSpace of this translation
void orxonox::WorldEntity::translate ( float  x,
float  y,
float  z,
TransformSpace  relativeTo = TransformSpace::Parent 
)
inline
void orxonox::WorldEntity::XMLPort ( Element &  xmlelement,
XMLPort::Mode  mode 
)
overridevirtual

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::BaseObject.

Reimplemented in orxonox::LensFlare, orxonox::PongCenterpoint, orxonox::ModularSpaceShip, orxonox::MultiTrigger, orxonox::Actionpoint, orxonox::DistanceTrigger, orxonox::DistanceMultiTrigger, orxonox::SpaceShip, orxonox::SpaceBoundaries, orxonox::QuestEffectBeacon, orxonox::ForceField, orxonox::AsteroidMinable, orxonox::PickupSpawner, orxonox::FlappyOrxShip, orxonox::EventMultiTrigger, orxonox::TriggerBase, orxonox::Turret, orxonox::Dock, orxonox::PongBall, orxonox::PortalEndPoint, orxonox::WeaponSlot, orxonox::Pawn, orxonox::TetrisCenterpoint, orxonox::TowerDefenseField, orxonox::Model, orxonox::CheckPoint, orxonox::MobileEntity, orxonox::Light, orxonox::Planet, orxonox::ControllableEntity, orxonox::AutonomousDrone, orxonox::ScriptableControllerDrone, orxonox::Attacher, orxonox::TowerDefenseCenterpoint, orxonox::ExplosionPart, orxonox::Weapon, orxonox::Drone, orxonox::HoverOrigin, orxonox::OrxoKartOrigin, orxonox::SOBFireball, orxonox::SOBTube, orxonox::RaceCheckPoint, orxonox::JumpItem, orxonox::JumpEnemy, orxonox::JumpPlatform, orxonox::JumpPlatformTimer, orxonox::SOBFlagstone, orxonox::Billboard, orxonox::WorldSound, orxonox::Asteroids2DCenterPoint, orxonox::SOBCoin, orxonox::SOBGumba, orxonox::SOBItem, orxonox::SOBMushroom, orxonox::MovableEntity, orxonox::FpsPlayer, orxonox::JumpCenterpoint, orxonox::SOBCenterpoint, orxonox::FadingBillboard, orxonox::HoverShip, orxonox::OrxoKartKart, orxonox::PacmanGhost, orxonox::PacmanPointAfraid, orxonox::PacmanPointSphere, orxonox::AnimatedModel, orxonox::Backlight, orxonox::BlinkingBillboard, orxonox::NameableStaticEntity, orxonox::SpawnPoint, orxonox::ParticleEmitter, orxonox::ParticleSpawner, orxonox::TeamSpawnPoint, orxonox::SOBQBlock, orxonox::CameraPosition, orxonox::JumpFigure, orxonox::ShootableObstacle, orxonox::WagnisGameboard, and orxonox::WagnisProvince.

void orxonox::WorldEntity::yaw ( const Degree &  angle,
TransformSpace  relativeTo = TransformSpace::Local 
)
inline
void orxonox::WorldEntity::yaw_xmlport ( const Degree &  angle)
inlineprivate

Friends And Related Function Documentation

friend class Scene
friend

Member Data Documentation

btScalar orxonox::WorldEntity::angularDamping_
private
btScalar orxonox::WorldEntity::angularFactor_
private
const Vector3 orxonox::WorldEntity::BACK = Vector3::UNIT_Z
static
bool orxonox::WorldEntity::bActiveMem_
private
bool orxonox::WorldEntity::bCollisionCallbackActive_
private
bool orxonox::WorldEntity::bCollisionResponseActive_
private

Tells whether the object should respond to collisions.

bool orxonox::WorldEntity::bDeleteWithParent_
private
bool orxonox::WorldEntity::bPhysicsActive_
private
See also
isPhysicsActive
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).

bool orxonox::WorldEntity::bPhysicsActiveSynchronised_
private

Network synchronised variable for bPhysicsActive_.

bool orxonox::WorldEntity::bVisibleMem_
private
btScalar orxonox::WorldEntity::ccdMotionThreshold_
private
btScalar orxonox::WorldEntity::ccdSweptSphereRadius_
private
std::set<WorldEntity*> orxonox::WorldEntity::children_
private
btScalar orxonox::WorldEntity::childrenMass_
private

Sum of all the children's masses.

WorldEntityCollisionShape* orxonox::WorldEntity::collisionShape_
private

Attached collision shapes go here.

CollisionType orxonox::WorldEntity::collisionType_
private
CollisionType orxonox::WorldEntity::collisionTypeSynchronised_
private

Network synchronised variable for collisionType_.

const Vector3 orxonox::WorldEntity::DOWN = Vector3::NEGATIVE_UNIT_Y
static
btScalar orxonox::WorldEntity::friction_
private
See also
setFriction
const Vector3 orxonox::WorldEntity::FRONT = Vector3::NEGATIVE_UNIT_Z
static
std::string orxonox::WorldEntity::id_
protected

Used by the ScriptableController to identify objects.

const Vector3 orxonox::WorldEntity::LEFT = Vector3::NEGATIVE_UNIT_X
static
btScalar orxonox::WorldEntity::linearDamping_
private
btVector3 orxonox::WorldEntity::localInertia_
private
See also
getLocalInertia
btScalar orxonox::WorldEntity::mass_
private
See also
setMass
Ogre::SceneNode* orxonox::WorldEntity::node_
protected
WorldEntity* orxonox::WorldEntity::parent_
private
unsigned int orxonox::WorldEntity::parentID_
private
btRigidBody* orxonox::WorldEntity::physicalBody_
protected

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

btScalar orxonox::WorldEntity::restitution_
private
See also
setRestitution
const Vector3 orxonox::WorldEntity::RIGHT = Vector3::UNIT_X
static
const Vector3 orxonox::WorldEntity::UP = Vector3::UNIT_Y
static

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