Changeset 3257 for code/branches/core4/src/orxonox/objects/worldentities
- Timestamp:
- Jun 30, 2009, 3:14:45 PM (15 years ago)
- Location:
- code/branches/core4/src/orxonox/objects/worldentities
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core4/src/orxonox/objects/worldentities/Backlight.cc
r3196 r3257 108 108 void Backlight::registerVariables() 109 109 { 110 registerVariable(this->width_, variableDirection::toclient, new NetworkCallback<Backlight>(this, &Backlight::update_width));111 registerVariable(this->lifetime_, variableDirection::toclient, new NetworkCallback<Backlight>(this, &Backlight::update_lifetime));112 registerVariable(this->length_, variableDirection::toclient, new NetworkCallback<Backlight>(this, &Backlight::update_length));113 registerVariable(this->maxelements_, variableDirection::toclient, new NetworkCallback<Backlight>(this, &Backlight::update_maxelements));114 registerVariable(this->trailmaterial_, variableDirection::toclient, new NetworkCallback<Backlight>(this, &Backlight::update_trailmaterial));110 registerVariable(this->width_, VariableDirection::ToClient, new NetworkCallback<Backlight>(this, &Backlight::update_width)); 111 registerVariable(this->lifetime_, VariableDirection::ToClient, new NetworkCallback<Backlight>(this, &Backlight::update_lifetime)); 112 registerVariable(this->length_, VariableDirection::ToClient, new NetworkCallback<Backlight>(this, &Backlight::update_length)); 113 registerVariable(this->maxelements_, VariableDirection::ToClient, new NetworkCallback<Backlight>(this, &Backlight::update_maxelements)); 114 registerVariable(this->trailmaterial_, VariableDirection::ToClient, new NetworkCallback<Backlight>(this, &Backlight::update_trailmaterial)); 115 115 } 116 116 -
code/branches/core4/src/orxonox/objects/worldentities/BigExplosion.cc
r3239 r3257 56 56 */ 57 57 this->bStop_ = false; 58 this->LOD_ = LODParticle:: normal;58 this->LOD_ = LODParticle::Normal; 59 59 60 60 /* this->stf_ = "setTimeFactor "; … … 307 307 void BigExplosion::registerVariables() 308 308 { 309 registerVariable((int&)(this->LOD_), variableDirection::toclient, new NetworkCallback<BigExplosion>(this, &BigExplosion::LODchanged));310 registerVariable(this->bStop_, variableDirection::toclient, new NetworkCallback<BigExplosion>(this, &BigExplosion::checkStop));309 registerVariable((int&)(this->LOD_), VariableDirection::ToClient, new NetworkCallback<BigExplosion>(this, &BigExplosion::LODchanged)); 310 registerVariable(this->bStop_, VariableDirection::ToClient, new NetworkCallback<BigExplosion>(this, &BigExplosion::checkStop)); 311 311 } 312 312 -
code/branches/core4/src/orxonox/objects/worldentities/BigExplosion.h
r3196 r3257 47 47 void registerVariables(); 48 48 49 inline void setLOD(LODParticle:: LODlevel)49 inline void setLOD(LODParticle::Value level) 50 50 { this->LOD_ = level; this->LODchanged(); } 51 inline LODParticle:: LODgetLOD() const51 inline LODParticle::Value getLOD() const 52 52 { return this->LOD_; } 53 53 … … 98 98 ParticleInterface* explosionFire_; 99 99 100 LODParticle:: LODLOD_;100 LODParticle::Value LOD_; 101 101 Timer<BigExplosion> destroyTimer_; 102 102 }; -
code/branches/core4/src/orxonox/objects/worldentities/Billboard.cc
r3196 r3257 69 69 void Billboard::registerVariables() 70 70 { 71 registerVariable(this->material_, variableDirection::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedMaterial));72 registerVariable(this->colour_, variableDirection::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedColour));73 // registerVariable(this->rotation_, variableDirection::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedRotation));71 registerVariable(this->material_, VariableDirection::ToClient, new NetworkCallback<Billboard>(this, &Billboard::changedMaterial)); 72 registerVariable(this->colour_, VariableDirection::ToClient, new NetworkCallback<Billboard>(this, &Billboard::changedColour)); 73 // registerVariable(this->rotation_, VariableDirection::ToClient, new NetworkCallback<Billboard>(this, &Billboard::changedRotation)); 74 74 } 75 75 -
code/branches/core4/src/orxonox/objects/worldentities/BlinkingBillboard.cc
r3196 r3257 66 66 void BlinkingBillboard::registerVariables() 67 67 { 68 // registerVariable(this->amplitude_, variableDirection::toclient);69 // registerVariable(this->frequency_, variableDirection::toclient);70 // registerVariable(this->phase_, variableDirection::toclient);68 // registerVariable(this->amplitude_, VariableDirection::ToClient); 69 // registerVariable(this->frequency_, VariableDirection::ToClient); 70 // registerVariable(this->phase_, VariableDirection::ToClient); 71 71 } 72 72 -
code/branches/core4/src/orxonox/objects/worldentities/ControllableEntity.cc
r3239 r3257 79 79 80 80 this->setConfigValues(); 81 this->setPriority( priority::very_high );81 this->setPriority( Priority::VeryHigh ); 82 82 this->registerVariables(); 83 83 } … … 238 238 { 239 239 this->client_overwrite_ = this->server_overwrite_; 240 this->setObjectMode( objectDirection::bidirectional);240 this->setObjectMode(ObjectDirection::Bidirectional); 241 241 } 242 242 } … … 254 254 this->bHasLocalController_ = false; 255 255 this->bHasHumanController_ = false; 256 this->setObjectMode( objectDirection::toclient);256 this->setObjectMode(ObjectDirection::ToClient); 257 257 258 258 this->changedPlayer(); … … 368 368 void ControllableEntity::registerVariables() 369 369 { 370 registerVariable(this->cameraPositionTemplate_, variableDirection::toclient);371 registerVariable(this->hudtemplate_, variableDirection::toclient);372 373 registerVariable(this->server_position_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition));374 registerVariable(this->server_linear_velocity_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerLinearVelocity));375 registerVariable(this->server_orientation_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation));376 registerVariable(this->server_angular_velocity_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerAngularVelocity));377 378 registerVariable(this->server_overwrite_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite));379 registerVariable(this->client_overwrite_, variableDirection::toserver);380 381 registerVariable(this->client_position_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition));382 registerVariable(this->client_linear_velocity_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientLinearVelocity));383 registerVariable(this->client_orientation_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation));384 registerVariable(this->client_angular_velocity_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientAngularVelocity));370 registerVariable(this->cameraPositionTemplate_, VariableDirection::ToClient); 371 registerVariable(this->hudtemplate_, VariableDirection::ToClient); 372 373 registerVariable(this->server_position_, VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition)); 374 registerVariable(this->server_linear_velocity_, VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerLinearVelocity)); 375 registerVariable(this->server_orientation_, VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation)); 376 registerVariable(this->server_angular_velocity_, VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerAngularVelocity)); 377 378 registerVariable(this->server_overwrite_, VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite)); 379 registerVariable(this->client_overwrite_, VariableDirection::ToServer); 380 381 registerVariable(this->client_position_, VariableDirection::ToServer, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition)); 382 registerVariable(this->client_linear_velocity_, VariableDirection::ToServer, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientLinearVelocity)); 383 registerVariable(this->client_orientation_, VariableDirection::ToServer, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation)); 384 registerVariable(this->client_angular_velocity_, VariableDirection::ToServer, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientAngularVelocity)); 385 385 386 386 387 registerVariable(this->playerID_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID));387 registerVariable(this->playerID_, VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID)); 388 388 } 389 389 -
code/branches/core4/src/orxonox/objects/worldentities/ExplosionChunk.cc
r3196 r3257 48 48 49 49 this->bStop_ = false; 50 this->LOD_ = LODParticle:: normal;50 this->LOD_ = LODParticle::Normal; 51 51 52 52 if ( GameMode::showsGraphics() ) … … 104 104 void ExplosionChunk::registerVariables() 105 105 { 106 registerVariable((int&)(this->LOD_), variableDirection::toclient, new NetworkCallback<ExplosionChunk>(this, &ExplosionChunk::LODchanged));107 registerVariable(this->bStop_, variableDirection::toclient, new NetworkCallback<ExplosionChunk>(this, &ExplosionChunk::checkStop));106 registerVariable((int&)(this->LOD_), VariableDirection::ToClient, new NetworkCallback<ExplosionChunk>(this, &ExplosionChunk::LODchanged)); 107 registerVariable(this->bStop_, VariableDirection::ToClient, new NetworkCallback<ExplosionChunk>(this, &ExplosionChunk::checkStop)); 108 108 } 109 109 -
code/branches/core4/src/orxonox/objects/worldentities/ExplosionChunk.h
r3196 r3257 46 46 void registerVariables(); 47 47 48 inline void setLOD(LODParticle:: LODlevel)48 inline void setLOD(LODParticle::Value level) 49 49 { this->LOD_ = level; this->LODchanged(); } 50 inline LODParticle:: LODgetLOD() const50 inline LODParticle::Value getLOD() const 51 51 { return this->LOD_; } 52 52 … … 60 60 ParticleInterface* fire_; 61 61 ParticleInterface* smoke_; 62 LODParticle:: LODLOD_;62 LODParticle::Value LOD_; 63 63 Timer<ExplosionChunk> destroyTimer_; 64 64 }; -
code/branches/core4/src/orxonox/objects/worldentities/FadingBillboard.cc
r3196 r3257 64 64 void FadingBillboard::registerVariables() 65 65 { 66 registerVariable(this->turnontime_, variableDirection::toclient);67 registerVariable(this->turnofftime_, variableDirection::toclient);66 registerVariable(this->turnontime_, VariableDirection::ToClient); 67 registerVariable(this->turnofftime_, VariableDirection::ToClient); 68 68 } 69 69 -
code/branches/core4/src/orxonox/objects/worldentities/Light.cc
r3250 r3257 45 45 46 46 // Be sure we don't do bad conversions 47 BOOST_STATIC_ASSERT((int)Ogre::Light::LT_POINT == (int)Light:: LT_POINT);48 BOOST_STATIC_ASSERT((int)Ogre::Light::LT_DIRECTIONAL == (int)Light:: LT_DIRECTIONAL);49 BOOST_STATIC_ASSERT((int)Ogre::Light::LT_SPOTLIGHT == (int)Light:: LT_SPOTLIGHT);47 BOOST_STATIC_ASSERT((int)Ogre::Light::LT_POINT == (int)Light::Point); 48 BOOST_STATIC_ASSERT((int)Ogre::Light::LT_DIRECTIONAL == (int)Light::Directional); 49 BOOST_STATIC_ASSERT((int)Ogre::Light::LT_SPOTLIGHT == (int)Light::Spotlight); 50 50 51 51 Light::Light(BaseObject* creator) : StaticEntity(creator) … … 56 56 this->diffuse_ = ColourValue::White; 57 57 this->specular_ = ColourValue::White; 58 this->type_ = Light:: LT_POINT;58 this->type_ = Light::Point; 59 59 this->attenuation_ = Vector4(100000, 1, 0, 0); 60 60 this->spotlightRange_ = Vector3(40.0f, 30.0f, 1.0f); … … 106 106 void Light::registerVariables() 107 107 { 108 registerVariable((int&)this->type_, variableDirection::toclient, new NetworkCallback<Light>(this, &Light::updateType));109 registerVariable(this->diffuse_, variableDirection::toclient, new NetworkCallback<Light>(this, &Light::updateDiffuseColour));110 registerVariable(this->specular_, variableDirection::toclient, new NetworkCallback<Light>(this, &Light::updateSpecularColour));111 registerVariable(this->attenuation_, variableDirection::toclient, new NetworkCallback<Light>(this, &Light::updateAttenuation));112 registerVariable(this->spotlightRange_, variableDirection::toclient, new NetworkCallback<Light>(this, &Light::updateSpotlightRange));108 registerVariable((int&)this->type_, VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateType)); 109 registerVariable(this->diffuse_, VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateDiffuseColour)); 110 registerVariable(this->specular_, VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateSpecularColour)); 111 registerVariable(this->attenuation_, VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateAttenuation)); 112 registerVariable(this->spotlightRange_, VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateSpotlightRange)); 113 113 } 114 114 … … 127 127 void Light::updateAttenuation() 128 128 { 129 if (this->light_ && this->type_ != Light:: LT_DIRECTIONAL)129 if (this->light_ && this->type_ != Light::Directional) 130 130 this->light_->setAttenuation(this->attenuation_.x, this->attenuation_.y, this->attenuation_.z, this->attenuation_.w); 131 131 } … … 133 133 void Light::updateSpotlightRange() 134 134 { 135 if (this->light_ && this->type_ == Light:: LT_SPOTLIGHT)135 if (this->light_ && this->type_ == Light::Spotlight) 136 136 this->light_->setSpotlightRange(Degree(this->spotlightRange_.x), Degree(this->spotlightRange_.y), this->spotlightRange_.z); 137 137 } … … 140 140 { 141 141 if (type == "point") 142 this->setType(Light:: LT_POINT);142 this->setType(Light::Point); 143 143 else if (type == "directional") 144 this->setType(Light:: LT_DIRECTIONAL);144 this->setType(Light::Directional); 145 145 else if (type == "spotlight") 146 this->setType(Light:: LT_SPOTLIGHT);146 this->setType(Light::Spotlight); 147 147 else 148 this->setType(Light:: LT_POINT);148 this->setType(Light::Point); 149 149 } 150 150 … … 153 153 switch (this->type_) 154 154 { 155 case Light:: LT_DIRECTIONAL:155 case Light::Directional: 156 156 return "directional"; 157 case Light:: LT_SPOTLIGHT:157 case Light::Spotlight: 158 158 return "spotlight"; 159 case Light:: LT_POINT:159 case Light::Point: 160 160 default: 161 161 return "point"; … … 169 169 this->light_->setType(static_cast<Ogre::Light::LightTypes>(this->type_)); 170 170 171 if (this->type_ != Light:: LT_DIRECTIONAL)171 if (this->type_ != Light::Directional) 172 172 this->updateAttenuation(); 173 if (this->type_ == Light:: LT_SPOTLIGHT)173 if (this->type_ == Light::Spotlight) 174 174 this->updateSpotlightRange(); 175 175 } -
code/branches/core4/src/orxonox/objects/worldentities/Light.h
r3196 r3257 45 45 { 46 46 /// Point light sources give off light equally in all directions, so require only position not direction 47 LT_POINT,47 Point, 48 48 /// Directional lights simulate parallel light beams from a distant source, hence have direction but no position 49 LT_DIRECTIONAL,49 Directional, 50 50 /// Spotlights simulate a cone of light from a source so require position and direction, plus extra values for falloff 51 LT_SPOTLIGHT51 Spotlight 52 52 }; 53 53 -
code/branches/core4/src/orxonox/objects/worldentities/Model.cc
r3196 r3257 65 65 void Model::registerVariables() 66 66 { 67 registerVariable(this->meshSrc_, variableDirection::toclient, new NetworkCallback<Model>(this, &Model::changedMesh));68 registerVariable(this->bCastShadows_, variableDirection::toclient, new NetworkCallback<Model>(this, &Model::changedShadows));67 registerVariable(this->meshSrc_, VariableDirection::ToClient, new NetworkCallback<Model>(this, &Model::changedMesh)); 68 registerVariable(this->bCastShadows_, VariableDirection::ToClient, new NetworkCallback<Model>(this, &Model::changedShadows)); 69 69 } 70 70 -
code/branches/core4/src/orxonox/objects/worldentities/MovableEntity.cc
r3239 r3257 52 52 this->continuousResynchroTimer_ = 0; 53 53 54 this->setPriority( priority::low);54 this->setPriority(Priority::Low); 55 55 56 56 this->registerVariables(); … … 89 89 void MovableEntity::registerVariables() 90 90 { 91 registerVariable(this->linearVelocity_, variableDirection::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::processLinearVelocity));92 registerVariable(this->angularVelocity_, variableDirection::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::processAngularVelocity));91 registerVariable(this->linearVelocity_, VariableDirection::ToClient, new NetworkCallback<MovableEntity>(this, &MovableEntity::processLinearVelocity)); 92 registerVariable(this->angularVelocity_, VariableDirection::ToClient, new NetworkCallback<MovableEntity>(this, &MovableEntity::processAngularVelocity)); 93 93 94 registerVariable(this->overwrite_position_, variableDirection::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwritePosition));95 registerVariable(this->overwrite_orientation_, variableDirection::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwriteOrientation));94 registerVariable(this->overwrite_position_, VariableDirection::ToClient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwritePosition)); 95 registerVariable(this->overwrite_orientation_, VariableDirection::ToClient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwriteOrientation)); 96 96 } 97 97 -
code/branches/core4/src/orxonox/objects/worldentities/ParticleEmitter.cc
r3196 r3257 53 53 54 54 this->particles_ = 0; 55 this->LOD_ = LODParticle:: normal;55 this->LOD_ = LODParticle::Normal; 56 56 57 57 this->registerVariables(); … … 71 71 SUPER(ParticleEmitter, XMLPort, xmlelement, mode); 72 72 73 XMLPortParam(ParticleEmitter, "lod", setLODxml, getLODxml, xmlelement, mode).defaultValues(LODParticle:: normal);73 XMLPortParam(ParticleEmitter, "lod", setLODxml, getLODxml, xmlelement, mode).defaultValues(LODParticle::Normal); 74 74 XMLPortParam(ParticleEmitter, "source", setSource, getSource, xmlelement, mode); 75 75 } … … 77 77 void ParticleEmitter::registerVariables() 78 78 { 79 registerVariable(this->source_, variableDirection::toclient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::sourceChanged));80 registerVariable((int&)(this->LOD_), variableDirection::toclient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::LODchanged));79 registerVariable(this->source_, VariableDirection::ToClient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::sourceChanged)); 80 registerVariable((int&)(this->LOD_), VariableDirection::ToClient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::LODchanged)); 81 81 } 82 82 -
code/branches/core4/src/orxonox/objects/worldentities/ParticleEmitter.h
r3196 r3257 57 57 { return this->source_; } 58 58 59 inline void setLOD(LODParticle:: LODlevel)59 inline void setLOD(LODParticle::Value level) 60 60 { this->LOD_ = level; this->LODchanged(); } 61 inline LODParticle:: LODgetLOD() const61 inline LODParticle::Value getLOD() const 62 62 { return this->LOD_; } 63 63 64 64 protected: 65 65 inline void setLODxml(unsigned int level) 66 { this->LOD_ = (LODParticle:: LOD)level; this->LODchanged(); }66 { this->LOD_ = (LODParticle::Value)level; this->LODchanged(); } 67 67 inline unsigned int getLODxml() const 68 68 { return (unsigned int)this->LOD_; } … … 73 73 ParticleInterface* particles_; 74 74 std::string source_; 75 LODParticle:: LODLOD_;75 LODParticle::Value LOD_; 76 76 }; 77 77 } -
code/branches/core4/src/orxonox/objects/worldentities/Planet.cc
r3196 r3257 157 157 void Planet::registerVariables() 158 158 { 159 registerVariable(this->atmosphere_, variableDirection::toclient);160 registerVariable(this->meshSrc_, variableDirection::toclient, new NetworkCallback<Planet>(this, &Planet::changedMesh));161 registerVariable(this->bCastShadows_, variableDirection::toclient, new NetworkCallback<Planet>(this, &Planet::changedShadows));162 registerVariable(this->atmosphereSize, variableDirection::toclient);163 registerVariable(this->imageSize, variableDirection::toclient);159 registerVariable(this->atmosphere_, VariableDirection::ToClient); 160 registerVariable(this->meshSrc_, VariableDirection::ToClient, new NetworkCallback<Planet>(this, &Planet::changedMesh)); 161 registerVariable(this->bCastShadows_, VariableDirection::ToClient, new NetworkCallback<Planet>(this, &Planet::changedShadows)); 162 registerVariable(this->atmosphereSize, VariableDirection::ToClient); 163 registerVariable(this->imageSize, VariableDirection::ToClient); 164 164 } 165 165 -
code/branches/core4/src/orxonox/objects/worldentities/PongBall.cc
r3239 r3257 72 72 registerVariable( this->relMercyOffset_ ); 73 73 registerVariable( this->batID_[0] ); 74 registerVariable( this->batID_[1], variableDirection::toclient, new NetworkCallback<PongBall>( this, &PongBall::applyBats) );74 registerVariable( this->batID_[1], VariableDirection::ToClient, new NetworkCallback<PongBall>( this, &PongBall::applyBats) ); 75 75 } 76 76 -
code/branches/core4/src/orxonox/objects/worldentities/StaticEntity.cc
r3196 r3257 43 43 RegisterObject(StaticEntity); 44 44 45 this->setPriority( priority::very_low);45 this->setPriority(Priority::VeryLow); 46 46 47 47 this->registerVariables(); … … 54 54 void StaticEntity::registerVariables() 55 55 { 56 registerVariable(this->getPosition(), variableDirection::toclient, new NetworkCallback<StaticEntity>(this, &StaticEntity::positionChanged));57 registerVariable(this->getOrientation(), variableDirection::toclient, new NetworkCallback<StaticEntity>(this, &StaticEntity::orientationChanged));56 registerVariable(this->getPosition(), VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::positionChanged)); 57 registerVariable(this->getOrientation(), VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::orientationChanged)); 58 58 } 59 59 -
code/branches/core4/src/orxonox/objects/worldentities/WorldEntity.cc
r3239 r3257 175 175 void WorldEntity::registerVariables() 176 176 { 177 registerVariable(this->mainStateName_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedMainState));178 179 registerVariable(this->bActive_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity));180 registerVariable(this->bVisible_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility));181 182 registerVariable(this->getScale3D(), variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::scaleChanged));177 registerVariable(this->mainStateName_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedMainState)); 178 179 registerVariable(this->bActive_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity)); 180 registerVariable(this->bVisible_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility)); 181 182 registerVariable(this->getScale3D(), VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::scaleChanged)); 183 183 184 184 // Physics stuff 185 registerVariable(this->mass_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::massChanged));186 registerVariable(this->restitution_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::restitutionChanged));187 registerVariable(this->angularFactor_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::angularFactorChanged));188 registerVariable(this->linearDamping_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::linearDampingChanged));189 registerVariable(this->angularDamping_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::angularDampingChanged));190 registerVariable(this->friction_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::frictionChanged));185 registerVariable(this->mass_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::massChanged)); 186 registerVariable(this->restitution_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::restitutionChanged)); 187 registerVariable(this->angularFactor_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::angularFactorChanged)); 188 registerVariable(this->linearDamping_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::linearDampingChanged)); 189 registerVariable(this->angularDamping_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::angularDampingChanged)); 190 registerVariable(this->friction_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::frictionChanged)); 191 191 registerVariable(this->bCollisionCallbackActive_, 192 variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionCallbackActivityChanged));192 VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionCallbackActivityChanged)); 193 193 registerVariable(this->bCollisionResponseActive_, 194 variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionResponseActivityChanged));194 VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionResponseActivityChanged)); 195 195 registerVariable((int&)this->collisionTypeSynchronised_, 196 variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionTypeChanged));196 VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionTypeChanged)); 197 197 registerVariable(this->bPhysicsActiveSynchronised_, 198 variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::physicsActivityChanged));198 VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::physicsActivityChanged)); 199 199 200 200 // Attach to parent if necessary 201 registerVariable(this->parentID_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::networkcallback_parentChanged));201 registerVariable(this->parentID_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::networkcallback_parentChanged)); 202 202 } 203 203 -
code/branches/core4/src/orxonox/objects/worldentities/pawns/Pawn.cc
r3214 r3257 117 117 void Pawn::registerVariables() 118 118 { 119 registerVariable(this->bAlive_, variableDirection::toclient);120 registerVariable(this->health_, variableDirection::toclient);121 registerVariable(this->initialHealth_, variableDirection::toclient);122 registerVariable(this->bReload_, variableDirection::toserver);119 registerVariable(this->bAlive_, VariableDirection::ToClient); 120 registerVariable(this->health_, VariableDirection::ToClient); 121 registerVariable(this->initialHealth_, VariableDirection::ToClient); 122 registerVariable(this->bReload_, VariableDirection::ToServer); 123 123 } 124 124 -
code/branches/core4/src/orxonox/objects/worldentities/pawns/SpaceShip.cc
r3239 r3257 90 90 void SpaceShip::registerVariables() 91 91 { 92 registerVariable(this->primaryThrust_, variableDirection::toclient);93 registerVariable(this->auxilaryThrust_, variableDirection::toclient);94 registerVariable(this->rotationThrust_, variableDirection::toclient);92 registerVariable(this->primaryThrust_, VariableDirection::ToClient); 93 registerVariable(this->auxilaryThrust_, VariableDirection::ToClient); 94 registerVariable(this->rotationThrust_, VariableDirection::ToClient); 95 95 } 96 96 -
code/branches/core4/src/orxonox/objects/worldentities/pawns/Spectator.cc
r3196 r3257 93 93 void Spectator::registerVariables() 94 94 { 95 registerVariable(this->bGreetingFlareVisible_, variableDirection::toclient, new NetworkCallback<Spectator>(this, &Spectator::changedFlareVisibility));96 registerVariable(this->bGreeting_, variableDirection::toserver, new NetworkCallback<Spectator>(this, &Spectator::changedGreeting));95 registerVariable(this->bGreetingFlareVisible_, VariableDirection::ToClient, new NetworkCallback<Spectator>(this, &Spectator::changedFlareVisibility)); 96 registerVariable(this->bGreeting_, VariableDirection::ToServer, new NetworkCallback<Spectator>(this, &Spectator::changedGreeting)); 97 97 } 98 98 … … 145 145 ControllableEntity::setPlayer(player); 146 146 147 // this->setObjectMode( objectDirection::toclient);147 // this->setObjectMode(ObjectDirection::ToClient); 148 148 } 149 149 -
code/branches/core4/src/orxonox/objects/worldentities/pawns/TeamBaseMatchBase.cc
r3239 r3257 43 43 RegisterObject(TeamBaseMatchBase); 44 44 45 this->state_ = BaseState:: uncontrolled;45 this->state_ = BaseState::Uncontrolled; 46 46 47 47 TeamBaseMatch* gametype = orxonox_cast<TeamBaseMatch*>(this->getGametype()); … … 66 66 switch (this->state_) 67 67 { 68 case BaseState:: controlTeam1:68 case BaseState::ControlTeam1: 69 69 colour = gametype->getTeamColour(0); 70 70 break; 71 case BaseState:: controlTeam2:71 case BaseState::ControlTeam2: 72 72 colour = gametype->getTeamColour(1); 73 73 break; 74 case BaseState:: uncontrolled:74 case BaseState::Uncontrolled: 75 75 default: 76 76 colour = ColourValue(0.5, 0.5, 0.5, 1.0); -
code/branches/core4/src/orxonox/objects/worldentities/pawns/TeamBaseMatchBase.h
r3196 r3257 38 38 namespace BaseState 39 39 { 40 enum Enum40 enum Value 41 41 { 42 uncontrolled,43 controlTeam1,44 controlTeam2,42 Uncontrolled, 43 ControlTeam1, 44 ControlTeam2, 45 45 }; 46 46 } … … 58 58 59 59 // Set the state of a base to whatever the argument of the function is 60 void setState(BaseState:: Enumstate)60 void setState(BaseState::Value state) 61 61 { 62 62 this->state_ = state; … … 66 66 67 67 // Get the state of a base as a return value 68 BaseState:: EnumgetState() const68 BaseState::Value getState() const 69 69 { 70 70 return this->state_; … … 75 75 void changeTeamColour(); 76 76 77 BaseState:: Enumstate_;77 BaseState::Value state_; 78 78 }; 79 79 } -
code/branches/core4/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc
r3239 r3257 141 141 } 142 142 143 bool DistanceTrigger::isTriggered(TriggerMode mode)143 bool DistanceTrigger::isTriggered(TriggerMode::Value mode) 144 144 { 145 145 if (Trigger::isTriggered(mode)) -
code/branches/core4/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h
r3196 r3257 59 59 60 60 protected: 61 virtual bool isTriggered(TriggerMode mode);61 virtual bool isTriggered(TriggerMode::Value mode); 62 62 virtual void notifyMaskUpdate() {} 63 63 -
code/branches/core4/src/orxonox/objects/worldentities/triggers/EventTrigger.cc
r3196 r3257 54 54 } 55 55 56 bool EventTrigger::isTriggered(TriggerMode mode)56 bool EventTrigger::isTriggered(TriggerMode::Value mode) 57 57 { 58 58 if (Trigger::isTriggered(mode)) -
code/branches/core4/src/orxonox/objects/worldentities/triggers/EventTrigger.h
r3196 r3257 47 47 48 48 protected: 49 virtual bool isTriggered(TriggerMode mode);49 virtual bool isTriggered(TriggerMode::Value mode); 50 50 51 51 private: -
code/branches/core4/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h
r3196 r3257 70 70 71 71 protected: 72 virtual bool isTriggered(TriggerMode mode) = 0;72 virtual bool isTriggered(TriggerMode::Value mode) = 0; 73 73 74 74 /** -
code/branches/core4/src/orxonox/objects/worldentities/triggers/Trigger.cc
r3196 r3257 46 46 RegisterObject(Trigger); 47 47 48 this->mode_ = T M_EventTriggerAND;48 this->mode_ = TriggerMode::EventTriggerAND; 49 49 50 50 this->bFirstTick_ = true; … … 163 163 } 164 164 165 bool Trigger::isTriggered(TriggerMode mode)165 bool Trigger::isTriggered(TriggerMode::Value mode) 166 166 { 167 167 // if (this->bUpdating_) … … 175 175 switch (mode) 176 176 { 177 case T M_EventTriggerAND:177 case TriggerMode::EventTriggerAND: 178 178 returnval = checkAnd(); 179 179 break; 180 case T M_EventTriggerOR:180 case TriggerMode::EventTriggerOR: 181 181 returnval = checkOr(); 182 182 break; 183 case T M_EventTriggerXOR:183 case TriggerMode::EventTriggerXOR: 184 184 returnval = checkXor(); 185 185 break; … … 270 270 { 271 271 if (modeName == "and") 272 this->setMode(T M_EventTriggerAND);272 this->setMode(TriggerMode::EventTriggerAND); 273 273 else if (modeName == "or") 274 this->setMode(T M_EventTriggerOR);274 this->setMode(TriggerMode::EventTriggerOR); 275 275 else if (modeName == "xor") 276 this->setMode(T M_EventTriggerXOR);276 this->setMode(TriggerMode::EventTriggerXOR); 277 277 } 278 278 279 279 std::string Trigger::getModeString() const 280 280 { 281 if (this->mode_ == T M_EventTriggerAND)281 if (this->mode_ == TriggerMode::EventTriggerAND) 282 282 return std::string("and"); 283 else if (this->mode_ == T M_EventTriggerOR)283 else if (this->mode_ == TriggerMode::EventTriggerOR) 284 284 return std::string("or"); 285 else if (this->mode_ == T M_EventTriggerXOR)285 else if (this->mode_ == TriggerMode::EventTriggerXOR) 286 286 return std::string("xor"); 287 287 else -
code/branches/core4/src/orxonox/objects/worldentities/triggers/Trigger.h
r3196 r3257 41 41 namespace orxonox 42 42 { 43 enumTriggerMode43 namespace TriggerMode 44 44 { 45 TM_EventTriggerAND, 46 TM_EventTriggerOR, 47 TM_EventTriggerXOR, 48 }; 45 enum Value 46 { 47 EventTriggerAND, 48 EventTriggerOR, 49 EventTriggerXOR, 50 }; 51 } 49 52 50 53 class _OrxonoxExport Trigger : public StaticEntity, public Tickable … … 64 67 65 68 void setMode(const std::string& modeName); 66 inline void setMode(TriggerMode mode)69 inline void setMode(TriggerMode::Value mode) 67 70 { this->mode_ = mode; } 68 inline TriggerMode getMode() const71 inline TriggerMode::Value getMode() const 69 72 { return mode_; } 70 73 … … 103 106 protected: 104 107 inline bool isTriggered() { return this->isTriggered(this->mode_); } 105 virtual bool isTriggered(TriggerMode mode);108 virtual bool isTriggered(TriggerMode::Value mode); 106 109 virtual void triggered(bool bIsTriggered); 107 110 … … 118 121 bool bFirstTick_; 119 122 120 TriggerMode mode_;123 TriggerMode::Value mode_; 121 124 bool bInvertMode_; 122 125 bool bSwitch_;
Note: See TracChangeset
for help on using the changeset viewer.