- Timestamp:
- Dec 11, 2008, 2:18:34 PM (15 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/physics/src/orxonox/objects/worldentities/MobileEntity.cc
r2407 r2408 28 28 29 29 #include "OrxonoxStableHeaders.h" 30 #include "Mo vableEntity.h"30 #include "MobileEntity.h" 31 31 32 32 #include "BulletDynamics/Dynamics/btRigidBody.h" … … 42 42 namespace orxonox 43 43 { 44 Mo vableEntity::MovableEntity(BaseObject* creator) : WorldEntity(creator)45 { 46 RegisterObject(Mo vableEntity);44 MobileEntity::MobileEntity(BaseObject* creator) : WorldEntity(creator) 45 { 46 RegisterObject(MobileEntity); 47 47 48 48 this->linearAcceleration_ = Vector3::ZERO; … … 54 54 } 55 55 56 Mo vableEntity::~MovableEntity()57 { 58 } 59 60 void Mo vableEntity::XMLPort(Element& xmlelement, XMLPort::Mode mode)61 { 62 SUPER(Mo vableEntity, XMLPort, xmlelement, mode);63 64 XMLPortParamTemplate(Mo vableEntity, "velocity", setVelocity, getVelocity, xmlelement, mode, const Vector3&);65 XMLPortParamTemplate(Mo vableEntity, "rotationaxis", setRotationAxis, getRotationAxis, xmlelement, mode, const Vector3&);66 XMLPortParam(Mo vableEntity, "rotationrate", setRotationRate, getRotationRate, xmlelement, mode);67 } 68 69 void Mo vableEntity::registerVariables()70 { 71 } 72 73 void Mo vableEntity::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) 74 74 { 75 75 if (this->isActive()) … … 104 104 } 105 105 106 void Mo vableEntity::setPosition(const Vector3& position)106 void MobileEntity::setPosition(const Vector3& position) 107 107 { 108 108 if (this->isDynamic()) … … 117 117 } 118 118 119 void Mo vableEntity::translate(const Vector3& distance, Ogre::Node::TransformSpace relativeTo)119 void MobileEntity::translate(const Vector3& distance, Ogre::Node::TransformSpace relativeTo) 120 120 { 121 121 if (this->isDynamic()) … … 130 130 } 131 131 132 void Mo vableEntity::setOrientation(const Quaternion& orientation)132 void MobileEntity::setOrientation(const Quaternion& orientation) 133 133 { 134 134 if (this->isDynamic()) … … 143 143 } 144 144 145 void Mo vableEntity::rotate(const Quaternion& rotation, Ogre::Node::TransformSpace relativeTo)145 void MobileEntity::rotate(const Quaternion& rotation, Ogre::Node::TransformSpace relativeTo) 146 146 { 147 147 if (this->isDynamic()) … … 157 157 } 158 158 159 void Mo vableEntity::yaw(const Degree& angle, Ogre::Node::TransformSpace relativeTo)159 void MobileEntity::yaw(const Degree& angle, Ogre::Node::TransformSpace relativeTo) 160 160 { 161 161 if (this->isDynamic()) … … 172 172 } 173 173 174 void Mo vableEntity::pitch(const Degree& angle, Ogre::Node::TransformSpace relativeTo)174 void MobileEntity::pitch(const Degree& angle, Ogre::Node::TransformSpace relativeTo) 175 175 { 176 176 if (this->isDynamic()) … … 187 187 } 188 188 189 void Mo vableEntity::roll(const Degree& angle, Ogre::Node::TransformSpace relativeTo)189 void MobileEntity::roll(const Degree& angle, Ogre::Node::TransformSpace relativeTo) 190 190 { 191 191 if (this->isDynamic()) … … 202 202 } 203 203 204 void Mo vableEntity::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) 205 205 { 206 206 if (this->isDynamic()) … … 215 215 } 216 216 217 void Mo vableEntity::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) 218 218 { 219 219 if (this->isDynamic()) … … 228 228 } 229 229 230 void Mo vableEntity::setVelocity(const Vector3& velocity)230 void MobileEntity::setVelocity(const Vector3& velocity) 231 231 { 232 232 if (this->isDynamic()) … … 237 237 } 238 238 239 void Mo vableEntity::setAngularVelocity(const Vector3& velocity)239 void MobileEntity::setAngularVelocity(const Vector3& velocity) 240 240 { 241 241 if (this->isDynamic()) … … 246 246 } 247 247 248 void Mo vableEntity::setAcceleration(const Vector3& acceleration)248 void MobileEntity::setAcceleration(const Vector3& acceleration) 249 249 { 250 250 if (this->isDynamic()) … … 254 254 } 255 255 256 void Mo vableEntity::setAngularAcceleration(const Vector3& acceleration)256 void MobileEntity::setAngularAcceleration(const Vector3& acceleration) 257 257 { 258 258 if (this->isDynamic()) … … 265 265 } 266 266 267 bool Mo vableEntity::isCollisionTypeLegal(WorldEntity::CollisionType type) const267 bool MobileEntity::isCollisionTypeLegal(WorldEntity::CollisionType type) const 268 268 { 269 269 if (type == WorldEntity::Static) 270 270 { 271 ThrowException(PhysicsViolation, "Cannot tell a Mo vableEntity to have static collision type");271 ThrowException(PhysicsViolation, "Cannot tell a MobileEntity to have static collision type"); 272 272 return false; 273 273 } … … 276 276 } 277 277 278 void Mo vableEntity::setWorldTransform(const btTransform& worldTrans)278 void MobileEntity::setWorldTransform(const btTransform& worldTrans) 279 279 { 280 280 // We use a dynamic body. So we translate our node accordingly. … … 293 293 } 294 294 295 void Mo vableEntity::getWorldTransform(btTransform& worldTrans) const295 void MobileEntity::getWorldTransform(btTransform& worldTrans) const 296 296 { 297 297 // We use a kinematic body
Note: See TracChangeset
for help on using the changeset viewer.