Changeset 2826 for code/trunk/src/orxonox/objects/worldentities
- Timestamp:
- Mar 23, 2009, 12:02:49 PM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 23 edited
- 8 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/miniprojects (added) merged: 2755,2768,2789,2806,2818-2821,2824
- 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.h
r2662 r2826 34 34 #include "util/Math.h" 35 35 #include "tools/BillboardSet.h" 36 #include "objects/Teamcolourable.h" 36 37 37 38 namespace orxonox 38 39 { 39 class _OrxonoxExport Billboard : public StaticEntity 40 class _OrxonoxExport Billboard : public StaticEntity, public Teamcolourable 40 41 { 41 42 public: … … 61 62 { return this->colour_; } 62 63 64 virtual void setTeamColour(const ColourValue& colour) 65 { this->setColour(colour); } 66 63 67 protected: 64 68 inline BillboardSet& getBillboardSet() -
code/trunk/src/orxonox/objects/worldentities/CMakeLists.txt
r2710 r2826 19 19 Planet.cc 20 20 SpawnPoint.cc 21 TeamSpawnPoint.cc 22 PongCenterpoint.cc 23 PongBall.cc 24 PongBat.cc 21 25 ) 22 26 -
code/trunk/src/orxonox/objects/worldentities/Camera.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/trunk/src/orxonox/objects/worldentities/Camera.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/trunk/src/orxonox/objects/worldentities/CameraPosition.cc
r2662 r2826 44 44 this->bDrag_ = false; 45 45 this->bAllowMouseLook_ = false; 46 this->bAbsolute_ = false; 46 47 47 48 this->setObjectMode(0x0); … … 58 59 XMLPortParam(CameraPosition, "drag", setDrag, getDrag, xmlelement, mode).defaultValues(false); 59 60 XMLPortParam(CameraPosition, "mouselook", setAllowMouseLook, getAllowMouseLook, xmlelement, mode).defaultValues(false); 61 XMLPortParam(CameraPosition, "absolute", setIsAbsolute, getIsAbsolute, xmlelement, mode).defaultValues(false); 60 62 } 61 63 -
code/trunk/src/orxonox/objects/worldentities/CameraPosition.h
r2662 r2826 54 54 { return this->bAllowMouseLook_; } 55 55 56 inline void setIsAbsolute(bool bAbsolute) 57 { this->bAbsolute_ = bAbsolute; } 58 inline bool getIsAbsolute() const 59 { return this->bAbsolute_; } 60 56 61 void attachCamera(Camera* camera); 57 62 … … 59 64 bool bDrag_; 60 65 bool bAllowMouseLook_; 66 bool bAbsolute_; 61 67 }; 62 68 } -
code/trunk/src/orxonox/objects/worldentities/ControllableEntity.cc
r2662 r2826 144 144 void ControllableEntity::addCameraPosition(CameraPosition* position) 145 145 { 146 if (position->getAllowMouseLook()) 147 position->attachToNode(this->cameraPositionRootNode_); 146 if (!position->getIsAbsolute()) 147 { 148 if (position->getAllowMouseLook()) 149 position->attachToNode(this->cameraPositionRootNode_); 150 else 151 this->attach(position); 152 } 148 153 else 149 this->attach(position); 154 { 155 WorldEntity* parent = this->getParent(); 156 if (parent) 157 parent->attach(position); 158 } 150 159 this->cameraPositions_.push_back(position); 151 160 } -
code/trunk/src/orxonox/objects/worldentities/Light.h
r2662 r2826 37 37 38 38 #include "util/Math.h" 39 #include "objects/Teamcolourable.h" 39 40 40 41 namespace orxonox 41 42 { 42 class _OrxonoxExport Light : public StaticEntity 43 class _OrxonoxExport Light : public StaticEntity, public Teamcolourable 43 44 { 44 45 public: … … 68 69 inline const ColourValue& getSpecularColour() const 69 70 { return this->specular_; } 71 72 virtual void setTeamColour(const ColourValue& colour) 73 { this->setDiffuseColour(colour); this->setSpecularColour(colour); } 70 74 71 75 /** -
code/trunk/src/orxonox/objects/worldentities/MobileEntity.cc
- Property svn:mergeinfo changed
/code/trunk/src/orxonox/objects/worldentities/MobileEntity.cc merged: 2171-2660
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/objects/worldentities/MobileEntity.h
- Property svn:mergeinfo changed
/code/trunk/src/orxonox/objects/worldentities/MobileEntity.h merged: 2171-2660
- Property svn:mergeinfo changed
-
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/StaticEntity.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/trunk/src/orxonox/objects/worldentities/StaticEntity.h
- Property svn:mergeinfo changed (with no actual effect on merging)
-
code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc
r2809 r2826 133 133 } 134 134 135 void Pawn::setPlayer(PlayerInfo* player) 136 { 137 ControllableEntity::setPlayer(player); 138 139 if (this->getGametype()) 140 this->getGametype()->playerStartsControllingPawn(player, this); 141 } 142 143 void Pawn::removePlayer() 144 { 145 if (this->getGametype()) 146 this->getGametype()->playerStopsControllingPawn(this->getPlayer(), this); 147 148 ControllableEntity::removePlayer(); 149 } 150 135 151 void Pawn::setHealth(float health) 136 152 { … … 140 156 void Pawn::damage(float damage, Pawn* originator) 141 157 { 142 this->setHealth(this->health_ - damage); 143 this->lastHitOriginator_ = originator; 144 145 // play damage effect 158 if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator)) 159 { 160 this->setHealth(this->health_ - damage); 161 this->lastHitOriginator_ = originator; 162 163 // play damage effect 164 } 146 165 } 147 166 148 167 void Pawn::hit(Pawn* originator, const Vector3& force, float damage) 149 168 { 150 this->damage(damage, originator); 151 this->setVelocity(this->getVelocity() + force); 152 153 // play hit effect 169 if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator)) 170 { 171 this->damage(damage, originator); 172 this->setVelocity(this->getVelocity() + force); 173 174 // play hit effect 175 } 154 176 } 155 177 … … 176 198 void Pawn::death() 177 199 { 178 // Set bAlive_ to false and wait for PawnManager to do the destruction 179 this->bAlive_ = false; 180 181 this->setDestroyWhenPlayerLeft(false); 182 183 if (this->getGametype()) 184 this->getGametype()->pawnKilled(this, this->lastHitOriginator_); 185 186 if (this->getPlayer()) 187 this->getPlayer()->stopControl(this); 188 189 if (Core::isMaster()) 190 this->deatheffect(); 200 if (this->getGametype() && this->getGametype()->allowPawnDeath(this, this->lastHitOriginator_)) 201 { 202 // Set bAlive_ to false and wait for PawnManager to do the destruction 203 this->bAlive_ = false; 204 205 this->setDestroyWhenPlayerLeft(false); 206 207 if (this->getGametype()) 208 this->getGametype()->pawnKilled(this, this->lastHitOriginator_); 209 210 if (this->getPlayer()) 211 this->getPlayer()->stopControl(this); 212 213 if (Core::isMaster()) 214 this->deatheffect(); 215 } 216 else 217 this->setHealth(1); 191 218 } 192 219 -
code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.h
r2662 r2826 47 47 virtual void tick(float dt); 48 48 void registerVariables(); 49 50 virtual void setPlayer(PlayerInfo* player); 51 virtual void removePlayer(); 49 52 50 53 inline bool isAlive() const -
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 (with no actual effect on merging)
-
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.