Changeset 10216 for code/trunk/src/orxonox
- Timestamp:
- Jan 31, 2015, 6:03:17 PM (10 years ago)
- Location:
- code/trunk
- Files:
-
- 17 edited
- 13 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/CMakeLists.txt
r9348 r10216 31 31 PawnManager.cc 32 32 PlayerManager.cc 33 ShipPartManager.cc 33 34 Radar.cc 34 35 # Test.cc … … 64 65 infos/PlayerInfo.h 65 66 sound/SoundManager.h 67 controllers/ScriptController.h 66 68 PCH_FILE 67 69 OrxonoxPrecompiledHeaders.h -
code/trunk/src/orxonox/OrxonoxPrereqs.h
r9348 r10216 142 142 143 143 // items 144 class ShipPart; 145 class PartDestructionEvent; 144 146 class Engine; 145 147 class Item; … … 189 191 class Pawn; 190 192 class SpaceShip; 193 class ModularSpaceShip; 191 194 class Spectator; 192 195 class TeamBaseMatchBase; -
code/trunk/src/orxonox/Scene.cc
r10196 r10216 363 363 SmartPtr<WorldEntity> object1 = static_cast<WorldEntity*>(colObj1->getUserPointer()); 364 364 365 // get the CollisionShape pointers 366 const btCollisionShape* cs0 = colObj0->getCollisionShape(); 367 const btCollisionShape* cs1 = colObj1->getCollisionShape(); 368 365 369 // false means that bullet will assume we didn't modify the contact 366 370 bool modified = false; 367 371 if (object0->isCollisionCallbackActive()) 368 modified |= object0->collidesAgainst(object1, c p);372 modified |= object0->collidesAgainst(object1, cs1, cp); 369 373 if (object1->isCollisionCallbackActive()) 370 modified |= object1->collidesAgainst(object0, c p);374 modified |= object1->collidesAgainst(object0, cs0, cp); 371 375 372 376 return modified; -
code/trunk/src/orxonox/collisionshapes/CollisionShape.cc
r9667 r10216 121 121 WorldEntityCollisionShape* parentWECCS = orxonox_cast<WorldEntityCollisionShape*>(newParent); 122 122 if (parentWECCS) 123 { 123 124 this->parentID_ = parentWECCS->getWorldEntityOwner()->getObjectID(); 124 // Else it is set to the objectID of the CompoundCollisionShape. 125 126 // If this shape is not a CompoundCollisionShape (thus an actual physical shape) & the parent is a WorldEntity's CollisionShape, 127 // set it's userPointer to the WorldEntity this CompoundCollisionShape belongs to. 128 if (!orxonox_cast<CompoundCollisionShape*>(this)) 129 this->getCollisionShape()->setUserPointer(parentWECCS->getWorldEntityOwner()); 130 } 125 131 else 132 { 133 // Else it is set to the objectID of the CompoundCollisionShape. 126 134 this->parentID_ = newParent->getObjectID(); 135 } 127 136 128 137 return true; -
code/trunk/src/orxonox/controllers/ArtificialController.cc
r9667 r10216 94 94 static const float hardcoded_projectile_speed = 1250; 95 95 96 this->targetPosition_ = getPredictedPosition(this->getControllableEntity()->get Position(), hardcoded_projectile_speed, this->target_->getPosition(), this->target_->getVelocity());96 this->targetPosition_ = getPredictedPosition(this->getControllableEntity()->getWorldPosition(), hardcoded_projectile_speed, this->target_->getWorldPosition(), this->target_->getVelocity()); 97 97 this->bHasTargetPosition_ = (this->targetPosition_ != Vector3::ZERO); 98 98 -
code/trunk/src/orxonox/controllers/CMakeLists.txt
r9016 r10216 10 10 DroneController.cc 11 11 FormationController.cc 12 ControllerDirector.cc 12 13 ) -
code/trunk/src/orxonox/controllers/NewHumanController.cc
r9939 r10216 220 220 if (!controlPaused_ ) 221 221 { 222 if (this->getControllableEntity() && ( this->getControllableEntity()->isExactlyA(ClassByString("SpaceShip")) || this->getControllableEntity()->isExactlyA(ClassByString("Rocket"))))222 if (this->getControllableEntity() && ((this->getControllableEntity()->isExactlyA(ClassByString("SpaceShip")) || (this->getControllableEntity()->isExactlyA(ClassByString("ModularSpaceShip")))) || this->getControllableEntity()->isExactlyA(ClassByString("Rocket")))) 223 223 this->showOverlays(); 224 224 else if (this->getControllableEntity() && this->getControllableEntity()->isExactlyA(ClassByString("FpsPlayer"))) … … 498 498 this->controlMode_ = 0; 499 499 this->centerCursor(); 500 if (this->getControllableEntity() && ( this->getControllableEntity()->isExactlyA(ClassByString("SpaceShip")) || this->getControllableEntity()->isExactlyA(ClassByString("Rocket"))))500 if (this->getControllableEntity() && ((this->getControllableEntity()->isExactlyA(ClassByString("SpaceShip")) || (this->getControllableEntity()->isExactlyA(ClassByString("ModularSpaceShip")))) || this->getControllableEntity()->isExactlyA(ClassByString("Rocket")))) 501 501 { 502 502 this->showOverlays_ = true; -
code/trunk/src/orxonox/items/CMakeLists.txt
r5781 r10216 3 3 Engine.cc 4 4 MultiStateEngine.cc 5 ShipPart.cc 6 PartDestructionEvent.cc 5 7 ) -
code/trunk/src/orxonox/worldentities/MovableEntity.cc
r9667 r10216 72 72 } 73 73 74 bool MovableEntity::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)74 bool MovableEntity::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) 75 75 { 76 76 if (GameMode::isMaster() && enableCollisionDamage_) … … 80 80 { 81 81 float damage = this->collisionDamage_ * (victim->getVelocity() - this->getVelocity()).length(); 82 victim->hit(0, contactPoint, damage);82 victim->hit(0, contactPoint, ownCollisionShape, damage); 83 83 } 84 84 } … … 86 86 return false; 87 87 } 88 89 88 90 89 void MovableEntity::registerVariables() -
code/trunk/src/orxonox/worldentities/MovableEntity.h
r9667 r10216 47 47 48 48 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 49 virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);49 virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint); 50 50 51 51 using WorldEntity::setPosition; -
code/trunk/src/orxonox/worldentities/WorldEntity.h
r9667 r10216 374 374 Condition is that enableCollisionCallback() was called. 375 375 */ 376 virtual inline bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)376 virtual inline bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) 377 377 { return false; } /* With false, Bullet assumes no modification to the collision objects. */ 378 378 -
code/trunk/src/orxonox/worldentities/pawns/CMakeLists.txt
r7163 r10216 4 4 Pawn.cc 5 5 SpaceShip.cc 6 ModularSpaceShip.cc 6 7 TeamBaseMatchBase.cc 7 8 Destroyer.cc -
code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
r9950 r10216 244 244 } 245 245 246 void Pawn::damage(float damage, float healthdamage, float shielddamage, Pawn* originator )246 void Pawn::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs) 247 247 { 248 248 // Applies multiplier given by the DamageBoost Pickup. … … 279 279 280 280 */ 281 void Pawn::hit(Pawn* originator, const Vector3& force, float damage, float healthdamage, float shielddamage)281 void Pawn::hit(Pawn* originator, const Vector3& force, const btCollisionShape* cs, float damage, float healthdamage, float shielddamage) 282 282 { 283 283 if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator) && (!this->getController() || !this->getController()->getGodMode()) ) 284 284 { 285 this->damage(damage, healthdamage, shielddamage, originator );285 this->damage(damage, healthdamage, shielddamage, originator, cs); 286 286 this->setVelocity(this->getVelocity() + force); 287 287 } 288 288 } 289 289 290 291 void Pawn::hit(Pawn* originator, btManifoldPoint& contactpoint, float damage, float healthdamage, float shielddamage) 290 void Pawn::hit(Pawn* originator, btManifoldPoint& contactpoint, const btCollisionShape* cs, float damage, float healthdamage, float shielddamage) 292 291 { 293 292 if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator) && (!this->getController() || !this->getController()->getGodMode()) ) 294 293 { 295 this->damage(damage, healthdamage, shielddamage, originator );294 this->damage(damage, healthdamage, shielddamage, originator, cs); 296 295 297 296 if ( this->getController() ) … … 559 558 return BLANKSTRING; 560 559 } 561 562 563 560 } -
code/trunk/src/orxonox/worldentities/pawns/Pawn.h
r9948 r10216 126 126 //virtual void hit(Pawn* originator, const Vector3& force, float damage); 127 127 //virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage); 128 virtual void hit(Pawn* originator, const Vector3& force, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);129 virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);128 virtual void hit(Pawn* originator, const Vector3& force, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f); 129 virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f); 130 130 131 131 virtual void kill(); … … 196 196 197 197 //virtual void damage(float damage, Pawn* originator = 0); 198 virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = NULL );198 virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = NULL, const btCollisionShape* cs = NULL); 199 199 200 200 bool bAlive_; -
code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc
r9667 r10216 342 342 /** 343 343 @brief 344 Looks for an attached Engine with a certain name. 345 @param name 346 The name of the engine to be returned. 347 @return 348 Pointer to the engine with the given name, or NULL if not found. 349 */ 350 Engine* SpaceShip::getEngineByName(const std::string& name) 351 { 352 for(size_t i = 0; i < this->engineList_.size(); ++i) 353 if(this->engineList_[i]->getName() == name) 354 return this->engineList_[i]; 355 356 orxout(internal_warning) << "Couldn't find Engine with name \"" << name << "\"." << endl; 357 return NULL; 358 } 359 360 /** 361 @brief 344 362 Remove and destroy all Engines of the SpaceShip. 345 363 */ … … 355 373 @param engine 356 374 A pointer to the Engine to be removed. 375 @note 376 Don't forget to reset the Engine's ship pointer after it was removed (or destroy the engine). 357 377 */ 358 378 void SpaceShip::removeEngine(Engine* engine) -
code/trunk/src/orxonox/worldentities/pawns/SpaceShip.h
r9667 r10216 124 124 bool hasEngine(Engine* engine) const; // Check whether the SpaceShip has a particular Engine. 125 125 Engine* getEngine(unsigned int i); // Get the i-th Engine of the SpaceShip. 126 Engine* getEngineByName(const std::string& name); 126 127 /** 127 128 @brief Get the list of all Engines that are mounted on the SpaceShip.
Note: See TracChangeset
for help on using the changeset viewer.