Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 11, 2008, 2:18:34 PM (15 years ago)
Author:
rgrieder
Message:

Renamed MovableEntity to MobileEntity and LinearEntity to MovableEntity.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • code/branches/physics/src/orxonox/objects/worldentities/MobileEntity.cc

    r2407 r2408  
    2828
    2929#include "OrxonoxStableHeaders.h"
    30 #include "MovableEntity.h"
     30#include "MobileEntity.h"
    3131
    3232#include "BulletDynamics/Dynamics/btRigidBody.h"
     
    4242namespace orxonox
    4343{
    44     MovableEntity::MovableEntity(BaseObject* creator) : WorldEntity(creator)
    45     {
    46         RegisterObject(MovableEntity);
     44    MobileEntity::MobileEntity(BaseObject* creator) : WorldEntity(creator)
     45    {
     46        RegisterObject(MobileEntity);
    4747
    4848        this->linearAcceleration_  = Vector3::ZERO;
     
    5454    }
    5555
    56     MovableEntity::~MovableEntity()
    57     {
    58     }
    59 
    60     void MovableEntity::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    61     {
    62         SUPER(MovableEntity, XMLPort, xmlelement, mode);
    63 
    64         XMLPortParamTemplate(MovableEntity, "velocity",     setVelocity,     getVelocity,     xmlelement, mode, const Vector3&);
    65         XMLPortParamTemplate(MovableEntity, "rotationaxis", setRotationAxis, getRotationAxis, xmlelement, mode, const Vector3&);
    66         XMLPortParam(MovableEntity, "rotationrate", setRotationRate, getRotationRate, xmlelement, mode);
    67     }
    68 
    69     void MovableEntity::registerVariables()
    70     {
    71     }
    72 
    73     void MovableEntity::tick(float dt)
     56    MobileEntity::~MobileEntity()
     57    {
     58    }
     59
     60    void MobileEntity::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     61    {
     62        SUPER(MobileEntity, XMLPort, xmlelement, mode);
     63
     64        XMLPortParamTemplate(MobileEntity, "velocity",     setVelocity,     getVelocity,     xmlelement, mode, const Vector3&);
     65        XMLPortParamTemplate(MobileEntity, "rotationaxis", setRotationAxis, getRotationAxis, xmlelement, mode, const Vector3&);
     66        XMLPortParam(MobileEntity, "rotationrate", setRotationRate, getRotationRate, xmlelement, mode);
     67    }
     68
     69    void MobileEntity::registerVariables()
     70    {
     71    }
     72
     73    void MobileEntity::tick(float dt)
    7474    {
    7575        if (this->isActive())
     
    104104    }
    105105
    106     void MovableEntity::setPosition(const Vector3& position)
     106    void MobileEntity::setPosition(const Vector3& position)
    107107    {
    108108        if (this->isDynamic())
     
    117117    }
    118118
    119     void MovableEntity::translate(const Vector3& distance, Ogre::Node::TransformSpace relativeTo)
     119    void MobileEntity::translate(const Vector3& distance, Ogre::Node::TransformSpace relativeTo)
    120120    {
    121121        if (this->isDynamic())
     
    130130    }
    131131
    132     void MovableEntity::setOrientation(const Quaternion& orientation)
     132    void MobileEntity::setOrientation(const Quaternion& orientation)
    133133    {
    134134        if (this->isDynamic())
     
    143143    }
    144144
    145     void MovableEntity::rotate(const Quaternion& rotation, Ogre::Node::TransformSpace relativeTo)
     145    void MobileEntity::rotate(const Quaternion& rotation, Ogre::Node::TransformSpace relativeTo)
    146146    {
    147147        if (this->isDynamic())
     
    157157    }
    158158
    159     void MovableEntity::yaw(const Degree& angle, Ogre::Node::TransformSpace relativeTo)
     159    void MobileEntity::yaw(const Degree& angle, Ogre::Node::TransformSpace relativeTo)
    160160    {
    161161        if (this->isDynamic())
     
    172172    }
    173173
    174     void MovableEntity::pitch(const Degree& angle, Ogre::Node::TransformSpace relativeTo)
     174    void MobileEntity::pitch(const Degree& angle, Ogre::Node::TransformSpace relativeTo)
    175175    {
    176176        if (this->isDynamic())
     
    187187    }
    188188
    189     void MovableEntity::roll(const Degree& angle, Ogre::Node::TransformSpace relativeTo)
     189    void MobileEntity::roll(const Degree& angle, Ogre::Node::TransformSpace relativeTo)
    190190    {
    191191        if (this->isDynamic())
     
    202202    }
    203203
    204     void MovableEntity::lookAt(const Vector3& target, Ogre::Node::TransformSpace relativeTo, const Vector3& localDirectionVector)
     204    void MobileEntity::lookAt(const Vector3& target, Ogre::Node::TransformSpace relativeTo, const Vector3& localDirectionVector)
    205205    {
    206206        if (this->isDynamic())
     
    215215    }
    216216
    217     void MovableEntity::setDirection(const Vector3& direction, Ogre::Node::TransformSpace relativeTo, const Vector3& localDirectionVector)
     217    void MobileEntity::setDirection(const Vector3& direction, Ogre::Node::TransformSpace relativeTo, const Vector3& localDirectionVector)
    218218    {
    219219        if (this->isDynamic())
     
    228228    }
    229229
    230     void MovableEntity::setVelocity(const Vector3& velocity)
     230    void MobileEntity::setVelocity(const Vector3& velocity)
    231231    {
    232232        if (this->isDynamic())
     
    237237    }
    238238
    239     void MovableEntity::setAngularVelocity(const Vector3& velocity)
     239    void MobileEntity::setAngularVelocity(const Vector3& velocity)
    240240    {
    241241        if (this->isDynamic())
     
    246246    }
    247247
    248     void MovableEntity::setAcceleration(const Vector3& acceleration)
     248    void MobileEntity::setAcceleration(const Vector3& acceleration)
    249249    {
    250250        if (this->isDynamic())
     
    254254    }
    255255
    256     void MovableEntity::setAngularAcceleration(const Vector3& acceleration)
     256    void MobileEntity::setAngularAcceleration(const Vector3& acceleration)
    257257    {
    258258        if (this->isDynamic())
     
    265265    }
    266266
    267     bool MovableEntity::isCollisionTypeLegal(WorldEntity::CollisionType type) const
     267    bool MobileEntity::isCollisionTypeLegal(WorldEntity::CollisionType type) const
    268268    {
    269269        if (type == WorldEntity::Static)
    270270        {
    271             ThrowException(PhysicsViolation, "Cannot tell a MovableEntity to have static collision type");
     271            ThrowException(PhysicsViolation, "Cannot tell a MobileEntity to have static collision type");
    272272            return false;
    273273        }
     
    276276    }
    277277
    278     void MovableEntity::setWorldTransform(const btTransform& worldTrans)
     278    void MobileEntity::setWorldTransform(const btTransform& worldTrans)
    279279    {
    280280        // We use a dynamic body. So we translate our node accordingly.
     
    293293    }
    294294
    295     void MovableEntity::getWorldTransform(btTransform& worldTrans) const
     295    void MobileEntity::getWorldTransform(btTransform& worldTrans) const
    296296    {
    297297        // We use a kinematic body
Note: See TracChangeset for help on using the changeset viewer.