- Timestamp:
- Nov 25, 2008, 1:14:19 AM (16 years ago)
- Location:
- code/branches/objecthierarchy2/src/orxonox/objects/worldentities
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/ControllableEntity.cc
r2254 r2256 168 168 { 169 169 this->client_overwrite_ = this->server_overwrite_; 170 COUT(0) << "CE: bidirectional synchronization" << std::endl;171 170 this->setObjectMode(direction::bidirectional); 172 171 } … … 202 201 void ControllableEntity::startLocalHumanControl() 203 202 { 204 // std::cout << this->getObjectID() << " ###### start local control" << std::endl;205 203 this->camera_ = new Camera(this); 206 204 this->camera_->requestFocus(); … … 216 214 this->hud_ = new OverlayGroup(this); 217 215 this->hud_->addTemplate(this->hudtemplate_); 216 this->hud_->setOwner(this); 218 217 } 219 218 } … … 221 220 void ControllableEntity::stopLocalHumanControl() 222 221 { 223 // std::cout << "###### stop local control" << std::endl;224 222 this->camera_->detachFromParent(); 225 223 delete this->camera_; … … 244 242 else if (this->bHasLocalController_) 245 243 { 246 // COUT(2) << "setting client position" << endl;247 244 this->client_velocity_ = this->velocity_; 248 245 this->client_position_ = this->node_->getPosition(); … … 254 251 { 255 252 REGISTERSTRING(this->cameraPositionTemplate_, direction::toclient); 253 REGISTERSTRING(this->hudtemplate_, direction::toclient); 256 254 257 255 REGISTERDATA(this->client_overwrite_, direction::toserver); … … 304 302 if (this->server_overwrite_ == this->client_overwrite_) 305 303 { 306 // COUT(2) << "callback: setting client position" << endl;307 304 this->node_->setPosition(this->client_position_); 308 305 this->server_position_ = this->client_position_; 309 306 } 310 // else311 // COUT(2) << "callback: not setting client position" << endl;312 307 } 313 308 -
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/WorldEntity.h
r2212 r2256 72 72 inline void translate(float x, float y, float z, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL) 73 73 { this->translate(Vector3(x, y, z), relativeTo); } 74 75 virtual inline const Vector3& getVelocity() const 76 { return Vector3::ZERO; } 74 77 75 78 virtual void setOrientation(const Quaternion& orientation) = 0; -
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/pawns/Pawn.cc
r2171 r2256 61 61 this->weaponSystem_->getWeaponSetPointer(0)->getWeaponSlotPointer(0)->setAmmoType(true); 62 62 */ 63 64 this->setRadarObjectColour(ColourValue::Red); 65 this->setRadarObjectShape(RadarViewable::Dot); 63 66 64 67 this->registerVariables(); -
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/pawns/Pawn.h
r2098 r2256 33 33 34 34 #include "objects/worldentities/ControllableEntity.h" 35 #include "objects/RadarViewable.h" 35 36 36 37 namespace orxonox 37 38 { 38 class _OrxonoxExport Pawn : public ControllableEntity 39 class _OrxonoxExport Pawn : public ControllableEntity, public RadarViewable 39 40 { 40 41 public: … … 78 79 virtual void postSpawn(); 79 80 81 inline const WorldEntity* getWorldEntity() const 82 { return (WorldEntity*)this; } 83 80 84 protected: 81 85 virtual void spawn(); -
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/pawns/SpaceShip.cc
r2254 r2256 229 229 } 230 230 } 231 232 void SpaceShip::setEngine(Engine* engine) 233 { 234 this->engine_ = engine; 235 if (engine && engine->getShip() != this) 236 engine->addToSpaceShip(this); 237 } 231 238 } -
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/pawns/SpaceShip.h
r2254 r2256 58 58 virtual void boost(); 59 59 60 void setEngine(Engine* engine); 61 inline Engine* getEngine() const 62 { return this->engine_; } 63 60 64 void setMaxRotation(const Degree& value) 61 65 { this->maxRotation_ = value; }
Note: See TracChangeset
for help on using the changeset viewer.