Changeset 2442 for code/branches/physics_merge/src/orxonox/objects/worldentities/ControllableEntity.h
- Timestamp:
- Dec 14, 2008, 4:16:52 PM (15 years ago)
- Location:
- code/branches/physics_merge
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/physics_merge
- Property svn:mergeinfo changed
-
code/branches/physics_merge/src/orxonox/objects/worldentities/ControllableEntity.h
r2087 r2442 23 23 * Fabian 'x3n' Landau 24 24 * Co-authors: 25 * ...25 * Reto Grieder 26 26 * 27 27 */ … … 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include "WorldEntity.h" 35 #include "objects/Tickable.h" 34 #include "MobileEntity.h" 36 35 37 36 namespace orxonox 38 37 { 39 class _OrxonoxExport ControllableEntity : public WorldEntity, public Tickable38 class _OrxonoxExport ControllableEntity : public MobileEntity 40 39 { 41 40 public: … … 72 71 virtual void switchCamera(); 73 72 74 inline const Vector3& getVelocity() const75 { return this->velocity_; }76 inline const Vector3& getAcceleration() const77 { return this->acceleration_; }78 73 inline const std::string& getHudTemplate() const 79 74 { 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; }109 75 110 76 inline Camera* getCamera() const … … 123 89 { return this->cameraPositionTemplate_; } 124 90 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 125 101 protected: 126 102 virtual void startLocalControl(); … … 133 109 { return this->bControlled_; } 134 110 135 Vector3 acceleration_;136 137 111 private: 138 112 void overwrite(); … … 140 114 141 115 void processServerPosition(); 142 void processServer Velocity();116 void processServerLinearVelocity(); 143 117 void processServerOrientation(); 118 void processServerAngularVelocity(); 144 119 145 120 void processClientPosition(); 146 void processClient Velocity();121 void processClientLinearVelocity(); 147 122 void processClientOrientation(); 123 void processClientAngularVelocity(); 148 124 149 125 void networkcallback_changedplayerID(); 126 127 // Bullet btMotionState related 128 void setWorldTransform(const btTransform& worldTrans); 150 129 151 130 unsigned int server_overwrite_; 152 131 unsigned int client_overwrite_; 153 132 154 Vector3 velocity_;155 156 133 bool bControlled_; 157 134 Vector3 server_position_; 158 135 Vector3 client_position_; 159 Vector3 server_ velocity_;160 Vector3 client_ velocity_;136 Vector3 server_linear_velocity_; 137 Vector3 client_linear_velocity_; 161 138 Quaternion server_orientation_; 162 139 Quaternion client_orientation_; 140 Vector3 server_angular_velocity_; 141 Vector3 client_angular_velocity_; 163 142 164 143 PlayerInfo* player_;
Note: See TracChangeset
for help on using the changeset viewer.