Changeset 472 for code/branches/objecthierarchy/src/orxonox/objects
- Timestamp:
- Dec 12, 2007, 3:11:44 PM (17 years ago)
- Location:
- code/branches/objecthierarchy/src/orxonox/objects
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/objects/WorldEntity.cc
r461 r472 28 28 } 29 29 30 this->bStatic_ = false;30 this->bStatic_ = true; 31 31 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; 32 36 } 33 37 … … 40 44 if (!this->bStatic_) 41 45 { 46 this->velocity_ += (dt * this->acceleration_); 42 47 this->translate(dt * this->velocity_); 48 49 this->rotationRate_ += (dt * this->momentum_); 50 this->rotate(this->rotationAxis_, dt * this->rotationRate_); 43 51 } 44 52 } -
code/branches/objecthierarchy/src/orxonox/objects/WorldEntity.h
r460 r472 60 60 { this->node_->detachAllObjects(); } 61 61 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 62 98 static Ogre::SceneManager* sceneManager_s; 63 99 static int num_s; … … 69 105 bool bStatic_; 70 106 Vector3 velocity_; 107 Vector3 acceleration_; 108 Vector3 rotationAxis_; 109 Radian rotationRate_; 110 Radian momentum_; 71 111 }; 72 112 }
Note: See TracChangeset
for help on using the changeset viewer.