Changeset 9237 for code/branches/spacebomb
- Timestamp:
- May 24, 2012, 3:06:56 PM (13 years ago)
- Location:
- code/branches/spacebomb/src/modules/weapons
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/spacebomb/src/modules/weapons/projectiles/SimpleRocket.cc
r8859 r9237 44 44 #include "graphics/ParticleSpawner.h" 45 45 #include "infos/PlayerInfo.h" 46 #include "objects/collisionshapes/ ConeCollisionShape.h"46 #include "objects/collisionshapes/SphereCollisionShape.h" 47 47 #include "worldentities/pawns/Pawn.h" 48 48 #include "sound/WorldSound.h" 49 49 50 50 #include "weapons/RocketController.h" 51 52 // NOTE this branch now has the spacebomb implementation in 53 // the simplerocket facilities since there is no time to implement 54 // a proper weapon for it now. DO NOT MERGE THIS INTO TRUNK. 55 51 56 52 57 namespace orxonox … … 64 69 65 70 this->localAngularVelocity_ = 0; 66 this->lifetime_ = 10 .f;71 this->lifetime_ = 100.f; 67 72 68 73 this->setMass(15.0); … … 75 80 // Create rocket model. 76 81 Model* model = new Model(this); 77 model->setMeshSource(" rocket.mesh");78 model->scale(0. 7f);82 model->setMeshSource("Spacebomb.mesh"); 83 model->scale(0.3f); 79 84 this->attach(model); 80 85 81 86 // Add effects. 82 this->fire_ = new ParticleEmitter(this); 83 this->attach(this->fire_); 84 85 this->fire_->setOrientation(this->getOrientation()); 86 this->fire_->setSource("Orxonox/simplerocketfire"); 87 87 88 this->enableCollisionCallback(); 88 89 this->setCollisionResponse(false); … … 91 92 // Add collision shape. 92 93 // TODO: fix the orientation and size of this collision shape to match the rocket 93 ConeCollisionShape* collisionShape = new ConeCollisionShape(this);94 SphereCollisionShape* collisionShape = new SphereCollisionShape(this); 94 95 collisionShape->setOrientation(this->getOrientation()); 95 collisionShape->setRadius(1.5f); 96 collisionShape->setHeight(5); 96 collisionShape->setRadius(50.00f); 97 97 this->attachCollisionShape(collisionShape); 98 98 … … 102 102 this->setRadarObjectColour(ColourValue(1.0, 1.0, 0.0)); // yellow 103 103 this->setRadarObjectShape(RadarViewable::Triangle); 104 this->setRadarObjectScale(0. 5f);104 this->setRadarObjectScale(0.3f); 105 105 } 106 106 … … 141 141 { 142 142 this->setAcceleration(0,0,0); 143 this->fire_->detachFromParent();143 144 144 } 145 145 -
code/branches/spacebomb/src/modules/weapons/weaponmodes/SimpleRocketFire.cc
r8855 r9237 81 81 rocket->setOrientation(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getWorldOrientation()); 82 82 rocket->setPosition(this->getMuzzlePosition()); 83 rocket->setVelocity( this->getMuzzleDirection()*this->speed_);83 rocket->setVelocity(0.0f,0.0f,0.0f); 84 84 rocket->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()); 85 85
Note: See TracChangeset
for help on using the changeset viewer.