Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 12, 2009, 8:00:42 PM (14 years ago)
Author:
rgrieder
Message:

Making use of Ogre::UserDefinedObject by subclassing it in WorldEntity: This way we can access a WE from an Ogre::MovableObject (e.g. Ogre::Entity or Ogre::ParticleSystem), but with a dynamic_cast of course.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/steering/src/orxonox/worldentities/WorldEntity.h

    r5781 r6052  
    3333#include "OrxonoxPrereqs.h"
    3434
     35#include <OgreUserDefinedObject.h>
    3536#ifdef ORXONOX_RELEASE
    3637#  include <OgreSceneNode.h>
     
    5556
    5657        The basic task of the WorldEntity is provide a location, a direction and a scaling and the possibility
    57         to create an entire hierarchy of derivated objects.
     58        to create an entire hierarchy of derived objects.
    5859        It is also the basis for the physics interface to the Bullet physics engine.
    5960        Every WorldEntity can have a specific collision type: @see CollisionType
     
    6364        There is also support for attaching WorldEntities with physics to each other. Currently, the collision shape
    6465        of both objects simply get merged into one larger shape (for static collision type).
    65         The phyiscal body that is internally stored and administrated has the following supported properties:
    66         - Restitution, angular factor, linear damping, angular damping, fricition, mass and collision shape.
     66        The physical body that is internally stored and administrated has the following supported properties:
     67        - Restitution, angular factor, linear damping, angular damping, friction, mass and collision shape.
    6768        You can get more information at the corresponding set function.
    6869
    6970        Collision shapes: These are controlled by the internal WorldEntityCollisionShape. @see WorldEntityCollisionShape.
    7071    */
    71     class _OrxonoxExport WorldEntity : public BaseObject, public Synchronisable, public btMotionState
     72    class _OrxonoxExport WorldEntity : public BaseObject, public Synchronisable, public btMotionState, public Ogre::UserDefinedObject
    7273    {
    7374        friend class Scene;
     
    318319                Sets an artificial parameter that tells how much torque is applied when you apply a non-central force.
    319320
    320                 Normally the angular factor is 1, which means it's physically 'correct'. Howerver if you have a player
     321                Normally the angular factor is 1, which means it's physically 'correct'. However if you have a player
    321322                character that should not rotate when hit sideways, you can set the angular factor to 0.
    322323            */
     
    394395                You can override this function in a derived class to constrain the collision to e.g. None or Dynamic.
    395396                A projectile may not prove very useful if there is no physical body. Simply set the CollisionType
    396                 in its constructor and override this method. But be careful that a derived classe's virtual functions
     397                in its constructor and override this method. But be careful that a derived class's virtual functions
    397398                don't yet exist in the constructor if a base class.
    398399            */
Note: See TracChangeset for help on using the changeset viewer.