Changeset 11025
- Timestamp:
- Jan 3, 2016, 2:39:10 PM (9 years ago)
- Location:
- code/branches/presentationHS15/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentationHS15/src/modules/hover/CMakeLists.txt
r10960 r11025 13 13 FIND_HEADER_FILES 14 14 LINK_LIBRARIES 15 15 objects 16 16 orxonox 17 17 overlays -
code/branches/presentationHS15/src/modules/hover/FlagHUD.h
r10960 r11025 49 49 virtual ~FlagHUD(); 50 50 51 51 virtual void tick(float dt); 52 52 virtual void changedOwner(); 53 53 -
code/branches/presentationHS15/src/modules/hover/HoverShip.h
r10960 r11025 47 47 { 48 48 private: 49 50 49 float jumpBoost_; 50 bool isFloor_; 51 51 52 52 public: … … 59 59 virtual void setJumpBoost(float jumpBoost); 60 60 61 61 virtual float getJumpBoost(); 62 62 63 63 virtual void moveFrontBack(const Vector2& value); 64 64 65 65 virtual void moveRightLeft(const Vector2& value); 66 66 67 67 virtual void moveUpDown(const Vector2& value); 68 68 69 69 virtual void rotateYaw(const Vector2& value); 70 70 71 virtual void rotatePitch(const Vector2& value); 72 73 virtual void rotateRoll(const Vector2& value); 71 virtual void rotatePitch(const Vector2& value); 74 72 75 virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);73 virtual void rotateRoll(const Vector2& value); 76 74 77 virtual void boost(bool bBoost);75 virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint); 78 76 79 }; 77 virtual void boost(bool bBoost); 78 79 }; 80 80 } 81 81 -
code/branches/presentationHS15/src/modules/objects/Turret.h
r10622 r11025 103 103 104 104 inline void setRotationThrust(float rotationthrust) 105 105 { this->rotationThrust_ = rotationthrust; } 106 106 107 107 inline float getRotationThrust() 108 108 { return this->rotationThrust_; } 109 109 110 110 protected: -
code/branches/presentationHS15/src/modules/towerdefense/TowerDefenseSelecter.cc
r10629 r11025 88 88 { 89 89 moveDownPressed_ = false; 90 90 selectedPos_->Set(selecterPosX, selecterPosY - 1); 91 91 updatePosition(); 92 92 } … … 100 100 { 101 101 moveRightPressed_ = false; 102 102 selectedPos_->Set(selecterPosX + 1, selecterPosY); 103 103 updatePosition(); 104 104 } -
code/branches/presentationHS15/src/orxonox/controllers/DivisionController.h
r10974 r11025 45 45 public: 46 46 //----[language demanded functions]---- 47 47 DivisionController(Context* context); 48 48 49 49 virtual ~DivisionController(); 50 50 //----[/language demanded functions]---- 51 51 -
code/branches/presentationHS15/src/orxonox/controllers/FightingController.cc
r10974 r11025 47 47 FightingController::FightingController( Context* context ): FlyingController( context ) 48 48 { 49 49 this->attackRange_ = 2500; 50 50 this->stopLookingAtTarget(); 51 51 this->bSetupWorked = false; -
code/branches/presentationHS15/src/orxonox/worldentities/ExplosionPart.cc
r10962 r11025 36 36 { 37 37 38 39 40 41 42 43 38 RegisterClass(ExplosionPart); 39 40 ExplosionPart::ExplosionPart(Context* context) : MovableEntity(context) 41 { 42 RegisterObject(ExplosionPart); 43 this->bStop_ = false; 44 44 this->LOD_ = LODParticle::Normal; 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 45 this->mesh_ = ""; 46 this->effect1_ = ""; 47 this->effect2_ = ""; 48 this->model_= new Model(this->getContext()); 49 this->effect1Particle_= NULL; 50 this->effect2Particle_= NULL; 51 this->explosionEntity_ = new MovableEntity(this->getContext()); 52 this->posOffset_ = Vector3::ZERO; 53 54 55 56 } 57 58 59 ExplosionPart::~ExplosionPart() 60 60 { 61 61 if (this->isInitialized()) … … 75 75 76 76 77 78 79 80 81 82 83 84 85 86 XMLPortParam(ExplosionPart, "offset", setOffset, getOffset, xmlelement, mode).defaultValues(Vector3::ZERO); //Offset of the position if you need to have an explosion off-center 87 88 89 90 91 92 93 94 95 96 97 98 99 100 77 void ExplosionPart::XMLPort(Element& xmlelement, XMLPort::Mode mode) 78 { 79 SUPER(ExplosionPart, XMLPort, xmlelement, mode); 80 81 XMLPortParam(ExplosionPart, "mesh", setMesh, getMesh, xmlelement, mode).defaultValues(""); //Define mesh file, that is going to fly out 82 XMLPortParam(ExplosionPart, "minspeed", setMinSpeed, getMinSpeed, xmlelement, mode).defaultValues(50); //Minimum velocity at which parts fly out 83 XMLPortParam(ExplosionPart, "maxspeed", setMaxSpeed, getMaxSpeed, xmlelement, mode).defaultValues(100); //Maximum velocity at which parts fly out, set both minspeed and maxspeed to 0 to have stationary effects 84 XMLPortParam(ExplosionPart, "effect1", setEffect1, getEffect1, xmlelement, mode).defaultValues(""); //particle effect 1 85 XMLPortParam(ExplosionPart, "effect2", setEffect2, getEffect2, xmlelement, mode).defaultValues(""); //particle effect 2 86 XMLPortParam(ExplosionPart, "offset", setOffset, getOffset, xmlelement, mode).defaultValues(Vector3::ZERO); //Offset of the position if you need to have an explosion off-center 87 XMLPortParam(ExplosionPart, "direction", setDirection, getDirection, xmlelement, mode).defaultValues(Vector3(1,1,1)); //general direction the parts fly in 88 XMLPortParam(ExplosionPart, "angle", setAngle, getAngle, xmlelement, mode).defaultValues(180); //defines a cone shape with direction "direction" and angle "angle" inside which the parts fly out of 89 XMLPortParam(ExplosionPart, "delay", setDelay, getDelay, xmlelement, mode).defaultValues(0); //delay to the explosion in seconds 90 } 91 92 93 void ExplosionPart::Explode() 94 { 95 this->destroyTimer_.setTimer(delay_, false, createExecutor(createFunctor(&ExplosionPart::ActuallyExplode, this))); 96 } 97 98 void ExplosionPart::stop() 99 { 100 if (this->effect1Particle_) 101 101 this->effect1Particle_->setEnabled(false); 102 102 if (this->effect2Particle_) … … 110 110 this->destroyTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&ExplosionPart::destroy, this))); 111 111 } 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 112 } 113 114 void ExplosionPart::ActuallyExplode() 115 { 116 this->model_->setVisible(true); 117 118 //this->explosionEntity_->setSyncMode(0); 119 120 //this->model_->setSyncMode(0); 121 122 123 if(effect1_ != "") 124 { 125 this->effect1Particle_ = new ParticleInterface(this->getScene()->getSceneManager(), effect1_, this->LOD_); 126 this->effect1Particle_->setDimensions(this->getScale()); 127 this->model_->attachOgreObject(this->effect1Particle_->getParticleSystem()); 128 } 129 130 if(effect2_ != "") 131 { 132 this->effect2Particle_ = new ParticleInterface(this->getScene()->getSceneManager(), effect2_, this->LOD_); 133 this->effect2Particle_->setDimensions(this->getScale()); 134 this->model_->attachOgreObject(this->effect2Particle_->getParticleSystem()); 135 } 136 137 138 139 140 140 Vector3 velocityOffset = direction_.perpendicular(); 141 141 velocityOffset.normalise(); … … 147 147 Vector3 finalDirection = direction_ + sin((rnd(0, angle_))*M_PI/180)*velocityOffset; 148 148 149 149 this->explosionEntity_->setVelocity(finalDirection*rnd(minSpeed_,maxSpeed_)); 150 150 this->explosionEntity_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians()); 151 151 this->explosionEntity_->setScale(this->getScale() * 4); … … 161 161 this->destroyTimer_.setTimer(rnd(2, 4), false, createExecutor(createFunctor(&ExplosionPart::stop, this))); 162 162 } 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 163 } 164 165 166 167 168 void ExplosionPart::setMesh(const std::string& newString) 169 { 170 if(newString != "") 171 { 172 this->mesh_ = newString; 173 this->model_->setMeshSource(mesh_); 174 this->model_->setVisible(false); 175 } 176 } 177 178 void ExplosionPart::setEffect1(const std::string& newString) 179 { 180 this->effect1_ = newString; 181 } 182 183 void ExplosionPart::setEffect2(const std::string& newString) 184 { 185 this->effect2_ = newString; 186 } 187 188 void ExplosionPart::setMinSpeed(float speed) 189 { 190 this->minSpeed_ = speed; 191 } 192 193 void ExplosionPart::setMaxSpeed(float speed) 194 { 195 this->maxSpeed_ = speed; 196 } 197 198 void ExplosionPart::setOffset(Vector3 newVector) 199 { 200 this->posOffset_ = newVector; 201 this->explosionEntity_->setPosition(this->getPosition() + this->posOffset_ / this->getScale()); 202 } 203 204 void ExplosionPart::setDirection(Vector3 newDirection) 205 { 206 this->direction_ = newDirection; 207 } 208 209 void ExplosionPart::setAngle(float newAngle) 210 { 211 this->angle_ = newAngle; 212 } 213 214 void ExplosionPart::setDelay(float newDelay) 215 { 216 this->delay_ = newDelay; 217 } 218 219 std::string& ExplosionPart::getMesh() 220 { return this->mesh_; } 221 222 std::string& ExplosionPart::getEffect1() 223 { return this->effect1_; } 224 225 std::string& ExplosionPart::getEffect2() 226 { return this->effect2_; } 227 228 float ExplosionPart::getMinSpeed() 229 { 230 return this->minSpeed_; 231 } 232 233 float ExplosionPart::getMaxSpeed() 234 { 235 return this->maxSpeed_; 236 } 237 238 Vector3 ExplosionPart::getOffset() 239 { 240 return this->posOffset_; 241 } 242 243 Vector3 ExplosionPart::getDirection() 244 { 245 return direction_; 246 } 247 248 float ExplosionPart::getAngle() 249 { 250 return angle_; 251 } 252 253 float ExplosionPart::getDelay() 254 { 255 return delay_; 256 } 257 257 258 258 -
code/branches/presentationHS15/src/orxonox/worldentities/ExplosionPart.h
r10962 r11025 82 82 83 83 84 85 84 Model* model_; 85 ParticleInterface* effect1Particle_; 86 86 ParticleInterface* effect2Particle_; 87 87 … … 89 89 float minSpeed_; 90 90 float maxSpeed_; 91 92 91 std::string mesh_; 92 std::string effect1_; 93 93 std::string effect2_; 94 94 Vector3 posOffset_; … … 101 101 Timer destroyTimer_; 102 102 103 103 104 104 105 105 };
Note: See TracChangeset
for help on using the changeset viewer.