Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 14, 2008, 4:16:52 PM (15 years ago)
Author:
rgrieder
Message:

Finally merged physics stuff. Target is physics_merge because I'll have to do some testing first.

Location:
code/branches/physics_merge
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/physics_merge

  • code/branches/physics_merge/src/orxonox/objects/worldentities/ControllableEntity.h

    r2087 r2442  
    2323 *      Fabian 'x3n' Landau
    2424 *   Co-authors:
    25  *      ...
     25 *      Reto Grieder
    2626 *
    2727 */
     
    3232#include "OrxonoxPrereqs.h"
    3333
    34 #include "WorldEntity.h"
    35 #include "objects/Tickable.h"
     34#include "MobileEntity.h"
    3635
    3736namespace orxonox
    3837{
    39     class _OrxonoxExport ControllableEntity : public WorldEntity, public Tickable
     38    class _OrxonoxExport ControllableEntity : public MobileEntity
    4039    {
    4140        public:
     
    7271            virtual void switchCamera();
    7372
    74             inline const Vector3& getVelocity() const
    75                 { return this->velocity_; }
    76             inline const Vector3& getAcceleration() const
    77                 { return this->acceleration_; }
    7873            inline const std::string& getHudTemplate() const
    7974                { return this->hudtemplate_; }
    80 
    81             using WorldEntity::setPosition;
    82             using WorldEntity::translate;
    83             using WorldEntity::setOrientation;
    84             using WorldEntity::rotate;
    85             using WorldEntity::yaw;
    86             using WorldEntity::pitch;
    87             using WorldEntity::roll;
    88             using WorldEntity::lookAt;
    89             using WorldEntity::setDirection;
    90 
    91             void setPosition(const Vector3& position);
    92             void translate(const Vector3& distance, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL);
    93             void setOrientation(const Quaternion& orientation);
    94             void rotate(const Quaternion& rotation, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL);
    95             void yaw(const Degree& angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL);
    96             void pitch(const Degree& angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL);
    97             void roll(const Degree& angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL);
    98             void lookAt(const Vector3& target, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
    99             void setDirection(const Vector3& direction, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
    100 
    101             void setVelocity(const Vector3& velocity);
    102             inline void setVelocity(float x, float y, float z)
    103                 { this->velocity_.x = x; this->velocity_.y = y; this->velocity_.z = z; }
    104 
    105             inline void setAcceleration(const Vector3& acceleration)
    106                 { this->acceleration_ = acceleration; }
    107             inline void setAcceleration(float x, float y, float z)
    108                 { this->acceleration_.x = x; this->acceleration_.y = y; this->acceleration_.z = z; }
    10975
    11076            inline Camera* getCamera() const
     
    12389                { return this->cameraPositionTemplate_; }
    12490
     91            using WorldEntity::setPosition;
     92            using WorldEntity::setOrientation;
     93            using MobileEntity::setVelocity;
     94            using MobileEntity::setAngularVelocity;
     95
     96            void setPosition(const Vector3& position);
     97            void setOrientation(const Quaternion& orientation);
     98            void setVelocity(const Vector3& velocity);
     99            void setAngularVelocity(const Vector3& velocity);
     100
    125101        protected:
    126102            virtual void startLocalControl();
     
    133109                { return this->bControlled_; }
    134110
    135             Vector3 acceleration_;
    136 
    137111        private:
    138112            void overwrite();
     
    140114
    141115            void processServerPosition();
    142             void processServerVelocity();
     116            void processServerLinearVelocity();
    143117            void processServerOrientation();
     118            void processServerAngularVelocity();
    144119
    145120            void processClientPosition();
    146             void processClientVelocity();
     121            void processClientLinearVelocity();
    147122            void processClientOrientation();
     123            void processClientAngularVelocity();
    148124
    149125            void networkcallback_changedplayerID();
     126
     127            // Bullet btMotionState related
     128            void setWorldTransform(const btTransform& worldTrans);
    150129
    151130            unsigned int server_overwrite_;
    152131            unsigned int client_overwrite_;
    153132
    154             Vector3 velocity_;
    155 
    156133            bool bControlled_;
    157134            Vector3 server_position_;
    158135            Vector3 client_position_;
    159             Vector3 server_velocity_;
    160             Vector3 client_velocity_;
     136            Vector3 server_linear_velocity_;
     137            Vector3 client_linear_velocity_;
    161138            Quaternion server_orientation_;
    162139            Quaternion client_orientation_;
     140            Vector3 server_angular_velocity_;
     141            Vector3 client_angular_velocity_;
    163142
    164143            PlayerInfo* player_;
Note: See TracChangeset for help on using the changeset viewer.