Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 472 for code


Ignore:
Timestamp:
Dec 12, 2007, 3:11:44 PM (17 years ago)
Author:
landauf
Message:

added acceleration, rotationRate and momentum

Location:
code/branches/objecthierarchy
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/bin/resources.cfg

    r135 r472  
    88FileSystem=../Media
    99FileSystem=../Media/fonts
    10 #FileSystem=../Media/materials/programs
    11 #FileSystem=../Media/materials/scripts
    12 #FileSystem=../Media/materials/textures
    13 #FileSystem=../Media/models
    14 #FileSystem=../Media/overlays
    15 #FileSystem=../Media/particle
     10# FileSystem=../Media/materials/programs
     11# FileSystem=../Media/materials/scripts
     12# FileSystem=../Media/materials/textures
     13# FileSystem=../Media/models
     14# FileSystem=../Media/overlays
     15# FileSystem=../Media/particle
    1616FileSystem=../Media/gui
    17 #FileSystem=../Media/DeferredShadingMedia
    18 #Zip=../Media/packs/cubemap.zip
    19 #Zip=../Media/packs/cubemapsJS.zip
    20 #Zip=../Media/packs/dragon.zip
    21 #Zip=../Media/packs/fresneldemo.zip
    22 #Zip=../Media/packs/ogretestmap.zip
     17# FileSystem=../Media/DeferredShadingMedia
     18# Zip=../Media/packs/cubemap.zip
     19# Zip=../Media/packs/cubemapsJS.zip
     20# Zip=../Media/packs/dragon.zip
     21# Zip=../Media/packs/fresneldemo.zip
     22# Zip=../Media/packs/ogretestmap.zip
    2323Zip=../Media/packs/skybox.zip
  • code/branches/objecthierarchy/src/orxonox/core/CoreIncludes.h

    r460 r472  
    3333    typedef Ogre::ColourValue ColourValue;
    3434    typedef Ogre::Radian Radian;
     35    typedef Ogre::Degree Degree;
    3536    typedef Ogre::Real Real;
    3637    typedef Ogre::Quaternion Quaternion;
  • code/branches/objecthierarchy/src/orxonox/objects/WorldEntity.cc

    r461 r472  
    2828        }
    2929
    30         this->bStatic_ = false;
     30        this->bStatic_ = true;
    3131        this->velocity_ = Vector3(0, 0, 0);
     32        this->acceleration_ = Vector3(0, 0, 0);
     33        this->rotationAxis_ = Vector3(0, 1, 0);
     34        this->rotationRate_ = 0;
     35        this->momentum_ = 0;
    3236    }
    3337
     
    4044        if (!this->bStatic_)
    4145        {
     46            this->velocity_ += (dt * this->acceleration_);
    4247            this->translate(dt * this->velocity_);
     48
     49            this->rotationRate_ += (dt * this->momentum_);
     50            this->rotate(this->rotationAxis_, dt * this->rotationRate_);
    4351        }
    4452    }
  • code/branches/objecthierarchy/src/orxonox/objects/WorldEntity.h

    r460 r472  
    6060                { this->node_->detachAllObjects(); }
    6161
     62            inline void setVelocity(const Vector3& velocity)
     63                { this->velocity_ = velocity; }
     64            inline void setVelocity(Real x, Real y, Real z)
     65                { this->velocity_.x = x; this->velocity_.y = y; this->velocity_.z = z; }
     66            inline const Vector3& getVelocity() const
     67                { return this->velocity_; }
     68
     69            inline void setAcceleration(const Vector3& acceleration)
     70                { this->acceleration_ = acceleration; }
     71            inline void setAcceleration(Real x, Real y, Real z)
     72                { this->acceleration_.x = x; this->acceleration_.y = y; this->acceleration_.z = z; }
     73            inline const Vector3& getAcceleration() const
     74                { return this->acceleration_; }
     75
     76            inline void setRotationAxis(const Vector3& axis)
     77                { this->rotationAxis_ = axis; }
     78            inline void setRotationAxis(Real x, Real y, Real z)
     79                { this->rotationAxis_.x = x; this->rotationAxis_.y = y; this->rotationAxis_.z = z; }
     80            inline const Vector3& getRotationAxis() const
     81                { return this->rotationAxis_; }
     82
     83            inline void setRotationRate(const Radian& angle)
     84                { this->rotationRate_ = angle; }
     85            inline void setRotationRate(const Degree& angle)
     86                { this->rotationRate_ = angle; }
     87            inline const Radian& getRotationRate() const
     88                { return this->rotationRate_; }
     89
     90            inline void setMomentum(const Radian& angle)
     91                { this->momentum_ = angle; }
     92            inline void setMomentum(const Degree& angle)
     93                { this->momentum_ = angle; }
     94            inline const Radian& getMomentum() const
     95                { return this->momentum_; }
     96
     97
    6298            static Ogre::SceneManager* sceneManager_s;
    6399            static int num_s;
     
    69105            bool bStatic_;
    70106            Vector3 velocity_;
     107            Vector3 acceleration_;
     108            Vector3 rotationAxis_;
     109            Radian rotationRate_;
     110            Radian momentum_;
    71111    };
    72112}
Note: See TracChangeset for help on using the changeset viewer.