Changeset 2171 for code/trunk/src/orxonox/objects/worldentities
- Timestamp:
- Nov 10, 2008, 12:05:03 AM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/objecthierarchy merged: 2111-2115,2123,2132-2134,2143-2144,2153-2158,2160-2169
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/objects/worldentities/Backlight.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/trunk/src/orxonox/objects/worldentities/Backlight.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/trunk/src/orxonox/objects/worldentities/Billboard.cc
r2087 r2171 64 64 void Billboard::registerVariables() 65 65 { 66 REGISTERSTRING(this->material_, network::direction::toclient, new network::NetworkCallback<Billboard>(this, &Billboard::changedMaterial));67 REGISTERDATA (this->colour_, network::direction::toclient, new network::NetworkCallback<Billboard>(this, &Billboard::changedColour));66 REGISTERSTRING(this->material_, direction::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedMaterial)); 67 REGISTERDATA (this->colour_, direction::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedColour)); 68 68 } 69 69 … … 75 75 { 76 76 this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1); 77 this->getNode()->attachObject(this->billboard_.getBillboardSet()); 77 if (this->billboard_.getBillboardSet()) 78 this->getNode()->attachObject(this->billboard_.getBillboardSet()); 78 79 this->billboard_.setVisible(this->isVisible()); 79 80 } … … 90 91 { 91 92 this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1); 92 this->getNode()->attachObject(this->billboard_.getBillboardSet()); 93 if (this->billboard_.getBillboardSet()) 94 this->getNode()->attachObject(this->billboard_.getBillboardSet()); 93 95 this->billboard_.setVisible(this->isVisible()); 94 96 } -
code/trunk/src/orxonox/objects/worldentities/BlinkingBillboard.cc
r2087 r2171 68 68 void BlinkingBillboard::registerVariables() 69 69 { 70 // REGISTERDATA(this->amplitude_, network::direction::toclient);71 // REGISTERDATA(this->frequency_, network::direction::toclient);72 // REGISTERDATA(this->phase_, network::direction::toclient);70 // REGISTERDATA(this->amplitude_, direction::toclient); 71 // REGISTERDATA(this->frequency_, direction::toclient); 72 // REGISTERDATA(this->phase_, direction::toclient); 73 73 } 74 74 -
code/trunk/src/orxonox/objects/worldentities/Camera.cc
- Property svn:mergeinfo changed
/code/branches/objecthierarchy/src/orxonox/objects/worldentities/Camera.cc merged: 2161-2162
r2103 r2171 38 38 #include <OgreViewport.h> 39 39 40 #include "util/Exception.h" 40 41 #include "core/CoreIncludes.h" 41 42 #include "core/ConfigValueIncludes.h" … … 51 52 RegisterObject(Camera); 52 53 53 assert(this->getScene());54 assert(this->getScene()->getSceneManager());54 if (!this->getScene() || !this->getScene()->getSceneManager()) 55 ThrowException(AbortLoading, "Can't create Camera, no scene or no scene manager given."); 55 56 56 57 this->camera_ = this->getScene()->getSceneManager()->createCamera(getUniqueNumberString()); - Property svn:mergeinfo changed
-
code/trunk/src/orxonox/objects/worldentities/Camera.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/trunk/src/orxonox/objects/worldentities/ControllableEntity.cc
r2087 r2171 52 52 this->client_overwrite_ = 0; 53 53 this->player_ = 0; 54 this->playerID_ = network::OBJECTID_UNKNOWN;54 this->playerID_ = OBJECTID_UNKNOWN; 55 55 this->hud_ = 0; 56 56 this->camera_ = 0; … … 165 165 this->client_overwrite_ = this->server_overwrite_; 166 166 COUT(0) << "CE: bidirectional synchronization" << std::endl; 167 this->setObjectMode( network::direction::bidirectional);167 this->setObjectMode(direction::bidirectional); 168 168 } 169 169 } … … 176 176 177 177 this->player_ = 0; 178 this->playerID_ = network::OBJECTID_UNKNOWN;178 this->playerID_ = OBJECTID_UNKNOWN; 179 179 this->bControlled_ = false; 180 this->setObjectMode( network::direction::toclient);180 this->setObjectMode(direction::toclient); 181 181 182 182 if (this->bDestroyWhenPlayerLeft_) … … 187 187 { 188 188 // just do this in case the entity wasn't yet synchronized when the corresponding PlayerInfo got our objectID 189 if (this->playerID_ != network::OBJECTID_UNKNOWN)190 { 191 this->player_ = dynamic_cast<PlayerInfo*>( network::Synchronisable::getSynchronisable(this->playerID_));189 if (this->playerID_ != OBJECTID_UNKNOWN) 190 { 191 this->player_ = dynamic_cast<PlayerInfo*>(Synchronisable::getSynchronisable(this->playerID_)); 192 192 if (this->player_ && (this->player_->getControllableEntity() != this)) 193 193 this->player_->startControl(this); … … 248 248 void ControllableEntity::registerVariables() 249 249 { 250 REGISTERSTRING(this->cameraPositionTemplate_, network::direction::toclient);251 252 REGISTERDATA(this-> server_position_, network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition));253 REGISTERDATA(this->server_velocity_, network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerVelocity));254 REGISTERDATA(this->server_ orientation_, network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation));255 256 REGISTERDATA(this->server_o verwrite_, network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite));257 REGISTERDATA(this-> client_overwrite_, network::direction::toserver);258 259 REGISTERDATA(this->client_position_, network::direction::toserver, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition));260 REGISTERDATA(this->client_velocity_, network::direction::toserver, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientVelocity));261 REGISTERDATA(this->client_orientation_, network::direction::toserver, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation));262 263 264 REGISTERDATA(this->playerID_, network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID));250 REGISTERSTRING(this->cameraPositionTemplate_, direction::toclient); 251 252 REGISTERDATA(this->client_overwrite_, direction::toserver); 253 254 REGISTERDATA(this->server_position_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition)); 255 REGISTERDATA(this->server_velocity_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerVelocity)); 256 REGISTERDATA(this->server_orientation_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation)); 257 REGISTERDATA(this->server_overwrite_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite)); 258 259 REGISTERDATA(this->client_position_, direction::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition)); 260 REGISTERDATA(this->client_velocity_, direction::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientVelocity)); 261 REGISTERDATA(this->client_orientation_, direction::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation)); 262 263 264 REGISTERDATA(this->playerID_, direction::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID)); 265 265 } 266 266 -
code/trunk/src/orxonox/objects/worldentities/Light.cc
r2087 r2171 79 79 void Light::registerVariables() 80 80 { 81 REGISTERDATA(this->type_, network::direction::toclient, new network::NetworkCallback<Light>(this, &Light::changedType));82 REGISTERDATA(this->light_->getDiffuseColour(), network::direction::toclient);83 REGISTERDATA(this->light_->getSpecularColour(), network::direction::toclient);84 REGISTERDATA(this->light_->getDirection(), network::direction::toclient);81 REGISTERDATA(this->type_, direction::toclient, new NetworkCallback<Light>(this, &Light::changedType)); 82 REGISTERDATA(this->light_->getDiffuseColour(), direction::toclient); 83 REGISTERDATA(this->light_->getSpecularColour(), direction::toclient); 84 REGISTERDATA(this->light_->getDirection(), direction::toclient); 85 85 } 86 86 -
code/trunk/src/orxonox/objects/worldentities/Model.cc
r2087 r2171 61 61 void Model::registerVariables() 62 62 { 63 REGISTERSTRING(this->meshSrc_, network::direction::toclient, new network::NetworkCallback<Model>(this, &Model::changedMesh));64 REGISTERDATA(this->bCastShadows_, network::direction::toclient, new network::NetworkCallback<Model>(this, &Model::changedShadows));63 REGISTERSTRING(this->meshSrc_, direction::toclient, new NetworkCallback<Model>(this, &Model::changedMesh)); 64 REGISTERDATA(this->bCastShadows_, direction::toclient, new NetworkCallback<Model>(this, &Model::changedShadows)); 65 65 } 66 66 -
code/trunk/src/orxonox/objects/worldentities/MovableEntity.cc
r2087 r2171 84 84 void MovableEntity::registerVariables() 85 85 { 86 REGISTERDATA(this->velocity_.x, network::direction::toclient);87 REGISTERDATA(this->velocity_.y, network::direction::toclient);88 REGISTERDATA(this->velocity_.z, network::direction::toclient);86 REGISTERDATA(this->velocity_.x, direction::toclient); 87 REGISTERDATA(this->velocity_.y, direction::toclient); 88 REGISTERDATA(this->velocity_.z, direction::toclient); 89 89 90 REGISTERDATA(this->rotationAxis_.x, network::direction::toclient);91 REGISTERDATA(this->rotationAxis_.y, network::direction::toclient);92 REGISTERDATA(this->rotationAxis_.z, network::direction::toclient);90 REGISTERDATA(this->rotationAxis_.x, direction::toclient); 91 REGISTERDATA(this->rotationAxis_.y, direction::toclient); 92 REGISTERDATA(this->rotationAxis_.z, direction::toclient); 93 93 94 REGISTERDATA(this->rotationRate_, network::direction::toclient);94 REGISTERDATA(this->rotationRate_, direction::toclient); 95 95 96 REGISTERDATA(this->overwrite_position_, network::direction::toclient, new network::NetworkCallback<MovableEntity>(this, &MovableEntity::overwritePosition));97 REGISTERDATA(this->overwrite_orientation_, network::direction::toclient, new network::NetworkCallback<MovableEntity>(this, &MovableEntity::overwriteOrientation));96 REGISTERDATA(this->overwrite_position_, direction::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwritePosition)); 97 REGISTERDATA(this->overwrite_orientation_, direction::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwriteOrientation)); 98 98 } 99 99 -
code/trunk/src/orxonox/objects/worldentities/MovableEntity.h
r2087 r2171 38 38 namespace orxonox 39 39 { 40 class _OrxonoxExport MovableEntity : public WorldEntity, public Tickable, public network::ClientConnectionListener40 class _OrxonoxExport MovableEntity : public WorldEntity, public Tickable, public ClientConnectionListener 41 41 { 42 42 public: -
code/trunk/src/orxonox/objects/worldentities/ParticleEmitter.cc
r2087 r2171 28 28 29 29 /** 30 * @file ParticleInterface.cc30 * @file 31 31 * @brief class to control praticle effects 32 32 */ … … 37 37 38 38 #include "tools/ParticleInterface.h" 39 #include "util/Exception.h" 39 40 #include "core/CoreIncludes.h" 40 41 #include "core/XMLPort.h" … … 49 50 RegisterObject(ParticleEmitter); 50 51 51 assert(this->getScene());52 assert(this->getScene()->getSceneManager());52 if (!this->getScene() || !this->getScene()->getSceneManager()) 53 ThrowException(AbortLoading, "Can't create Camera, no scene or no scene manager given."); 53 54 54 55 this->particles_ = 0; … … 74 75 void ParticleEmitter::registerVariables() 75 76 { 76 REGISTERSTRING(this->source_, network::direction::toclient, new network::NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::sourceChanged));77 REGISTERDATA (this->LOD_, network::direction::toclient, new network::NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::LODchanged));77 REGISTERSTRING(this->source_, direction::toclient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::sourceChanged)); 78 REGISTERDATA (this->LOD_, direction::toclient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::LODchanged)); 78 79 } 79 80 -
code/trunk/src/orxonox/objects/worldentities/ParticleSpawner.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/trunk/src/orxonox/objects/worldentities/ParticleSpawner.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/trunk/src/orxonox/objects/worldentities/PositionableEntity.cc
r2087 r2171 48 48 void PositionableEntity::registerVariables() 49 49 { 50 REGISTERDATA(this->getPosition().x, network::direction::toclient);51 REGISTERDATA(this->getPosition().y, network::direction::toclient);52 REGISTERDATA(this->getPosition().z, network::direction::toclient);50 REGISTERDATA(this->getPosition().x, direction::toclient); 51 REGISTERDATA(this->getPosition().y, direction::toclient); 52 REGISTERDATA(this->getPosition().z, direction::toclient); 53 53 54 REGISTERDATA(this->getOrientation().w, network::direction::toclient);55 REGISTERDATA(this->getOrientation().x, network::direction::toclient);56 REGISTERDATA(this->getOrientation().y, network::direction::toclient);57 REGISTERDATA(this->getOrientation().z, network::direction::toclient);54 REGISTERDATA(this->getOrientation().w, direction::toclient); 55 REGISTERDATA(this->getOrientation().x, direction::toclient); 56 REGISTERDATA(this->getOrientation().y, direction::toclient); 57 REGISTERDATA(this->getOrientation().z, direction::toclient); 58 58 } 59 59 } -
code/trunk/src/orxonox/objects/worldentities/WorldEntity.cc
r2087 r2171 36 36 #include "core/XMLPort.h" 37 37 #include "util/Convert.h" 38 #include "util/Exception.h" 38 39 39 40 #include "objects/Scene.h" … … 48 49 const Vector3 WorldEntity::UP = Vector3::UNIT_Y; 49 50 50 WorldEntity::WorldEntity(BaseObject* creator) : BaseObject(creator), network::Synchronisable(creator)51 WorldEntity::WorldEntity(BaseObject* creator) : BaseObject(creator), Synchronisable(creator) 51 52 { 52 53 RegisterObject(WorldEntity); 53 54 54 assert(this->getScene());55 assert(this->getScene()->getRootSceneNode());55 if (!this->getScene() || !this->getScene()->getRootSceneNode()) 56 ThrowException(AbortLoading, "Can't create WorldEntity, no scene or no root-scenenode given."); 56 57 57 58 this->node_ = this->getScene()->getRootSceneNode()->createChildSceneNode(); 58 59 59 60 this->parent_ = 0; 60 this->parentID_ = (unsigned int)-1;61 this->parentID_ = OBJECTID_UNKNOWN; 61 62 62 63 this->node_->setPosition(Vector3::ZERO); … … 95 96 void WorldEntity::registerVariables() 96 97 { 97 REGISTERDATA(this->bActive_, network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity));98 REGISTERDATA(this->bVisible_, network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility));98 REGISTERDATA(this->bActive_, direction::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity)); 99 REGISTERDATA(this->bVisible_, direction::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility)); 99 100 100 REGISTERDATA(this->getScale3D().x, network::direction::toclient);101 REGISTERDATA(this->getScale3D().y, network::direction::toclient);102 REGISTERDATA(this->getScale3D().z, network::direction::toclient);101 REGISTERDATA(this->getScale3D().x, direction::toclient); 102 REGISTERDATA(this->getScale3D().y, direction::toclient); 103 REGISTERDATA(this->getScale3D().z, direction::toclient); 103 104 104 REGISTERDATA(this->parentID_, network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::updateParent));105 REGISTERDATA(this->parentID_, direction::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::updateParent)); 105 106 } 106 107 107 108 void WorldEntity::updateParent() 108 109 { 109 WorldEntity* parent = dynamic_cast<WorldEntity*>(Synchronisable::getSynchronisable(this->parentID_)); 110 if (parent) 111 this->attachToParent(parent); 110 if (this->parentID_ != OBJECTID_UNKNOWN) 111 { 112 WorldEntity* parent = dynamic_cast<WorldEntity*>(Synchronisable::getSynchronisable(this->parentID_)); 113 if (parent) 114 this->attachToParent(parent); 115 } 112 116 } 113 117 … … 134 138 this->children_.erase(object); 135 139 object->parent_ = 0; 136 object->parentID_ = (unsigned int)-1;140 object->parentID_ = OBJECTID_UNKNOWN; 137 141 138 142 // this->getScene()->getRootSceneNode()->addChild(object->node_); -
code/trunk/src/orxonox/objects/worldentities/WorldEntity.h
r2087 r2171 42 42 namespace orxonox 43 43 { 44 class _OrxonoxExport WorldEntity : public BaseObject, public network::Synchronisable44 class _OrxonoxExport WorldEntity : public BaseObject, public Synchronisable 45 45 { 46 46 public: -
code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc
r2106 r2171 80 80 void Pawn::registerVariables() 81 81 { 82 REGISTERDATA(this->bAlive_, network::direction::toclient);83 REGISTERDATA(this->health_, network::direction::toclient);82 REGISTERDATA(this->bAlive_, direction::toclient); 83 REGISTERDATA(this->health_, direction::toclient); 84 84 } 85 85 -
code/trunk/src/orxonox/objects/worldentities/pawns/SpaceShip.cc
r2087 r2171 82 82 void SpaceShip::registerVariables() 83 83 { 84 REGISTERDATA(this->maxSpeed_, network::direction::toclient);85 REGISTERDATA(this->maxSecondarySpeed_, network::direction::toclient);86 REGISTERDATA(this->maxRotation_, network::direction::toclient);87 REGISTERDATA(this->translationAcceleration_, network::direction::toclient);88 REGISTERDATA(this->rotationAcceleration_, network::direction::toclient);89 REGISTERDATA(this->translationDamping_, network::direction::toclient);84 REGISTERDATA(this->maxSpeed_, direction::toclient); 85 REGISTERDATA(this->maxSecondarySpeed_, direction::toclient); 86 REGISTERDATA(this->maxRotation_, direction::toclient); 87 REGISTERDATA(this->translationAcceleration_, direction::toclient); 88 REGISTERDATA(this->rotationAcceleration_, direction::toclient); 89 REGISTERDATA(this->translationDamping_, direction::toclient); 90 90 } 91 91 -
code/trunk/src/orxonox/objects/worldentities/pawns/Spectator.cc
r2087 r2171 62 62 this->greetingFlare_ = new BillboardSet(); 63 63 this->greetingFlare_->setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(1.0, 1.0, 0.8), Vector3(0, 20, 0), 1); 64 this->getNode()->attachObject(this->greetingFlare_->getBillboardSet()); 64 if (this->greetingFlare_->getBillboardSet()) 65 this->getNode()->attachObject(this->greetingFlare_->getBillboardSet()); 65 66 this->greetingFlare_->setVisible(false); 66 67 this->bGreetingFlareVisible_ = false; … … 76 77 if (this->greetingFlare_) 77 78 { 78 this->getNode()->detachObject(this->greetingFlare_->getBillboardSet()); 79 if (this->greetingFlare_->getBillboardSet()) 80 this->getNode()->detachObject(this->greetingFlare_->getBillboardSet()); 79 81 delete this->greetingFlare_; 80 82 } … … 84 86 void Spectator::registerVariables() 85 87 { 86 REGISTERDATA(this->bGreetingFlareVisible_, network::direction::toclient, new network::NetworkCallback<Spectator>(this, &Spectator::changedFlareVisibility));87 REGISTERDATA(this->bGreeting_, network::direction::toserver, new network::NetworkCallback<Spectator>(this, &Spectator::changedGreeting));88 REGISTERDATA(this->hudmode_, network::direction::toclient);88 REGISTERDATA(this->bGreetingFlareVisible_, direction::toclient, new NetworkCallback<Spectator>(this, &Spectator::changedFlareVisibility)); 89 REGISTERDATA(this->bGreeting_, direction::toserver, new NetworkCallback<Spectator>(this, &Spectator::changedGreeting)); 90 REGISTERDATA(this->hudmode_, direction::toclient); 89 91 } 90 92 … … 129 131 ControllableEntity::setPlayer(player); 130 132 131 // this->setObjectMode( network::direction::toclient);133 // this->setObjectMode(direction::toclient); 132 134 } 133 135 … … 203 205 { 204 206 if (this->getGametype()->isStartCountdownRunning()) 205 this->hudmode_ = 2 + 10* ceil(this->getGametype()->getStartCountdown());207 this->hudmode_ = 2 + 10*(int)ceil(this->getGametype()->getStartCountdown()); 206 208 else 207 209 this->hudmode_ = 3; -
code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.cc
- Property svn:mergeinfo changed
/code/branches/objecthierarchy/src/orxonox/objects/worldentities/triggers/Trigger.cc merged: 2161
r2103 r2171 69 69 this->debugBillboard_.setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(1.0, 0.0, 0.0), 1); 70 70 this->debugBillboard_.setVisible(false); 71 } 72 73 this->getNode()->attachObject(this->debugBillboard_.getBillboardSet()); 71 72 if (this->debugBillboard_.getBillboardSet()) 73 this->getNode()->attachObject(this->debugBillboard_.getBillboardSet()); 74 } 75 74 76 this->setObjectMode(0x0); 75 77 } … … 310 312 void Trigger::setBillboardColour(const ColourValue& colour) 311 313 { 312 this->debugBillboard_. getBillboardSet()->getBillboard(0)->setColour(colour);314 this->debugBillboard_.setColour(colour); 313 315 } 314 316 - Property svn:mergeinfo changed
-
code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.h
- Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset
for help on using the changeset viewer.