- Timestamp:
- Jul 4, 2006, 10:31:46 PM (18 years ago)
- Location:
- branches/presentation/src/world_entities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/world_entities/effects/explosion.cc
r9171 r9175 113 113 void Explosion::tick (float dt) 114 114 { 115 printf("%f %f\n", this->lifeCycle, this->lifeTime);116 115 this->lifeCycle += dt; 117 116 if(this->lifeTime < this->lifeCycle) -
branches/presentation/src/world_entities/npcs/attractor_mine.cc
r9173 r9175 25 25 #include "debug.h" 26 26 27 #include "player.h" 28 #include "playable.h" 29 27 30 #include "loading/factory.h" 28 31 #include "loading/load_param.h" … … 34 37 35 38 AttractorMine::AttractorMine(const TiXmlElement* root) 36 : NPC(NULL)39 : NPC(NULL) 37 40 { 38 41 this->setClassID(CL_ATTRACTOR_MINE, "AttractorMine"); … … 100 103 glMultMatrixf((float*)matrix); 101 104 102 // if (this->shader != NULL && this->shader != Shader::getActiveShader())103 // shader->activateShader();105 // if (this->shader != NULL && this->shader != Shader::getActiveShader()) 106 // shader->activateShader(); 104 107 105 108 this->getModel()->draw(); 106 // shader->deactivateShader();109 // shader->deactivateShader(); 107 110 108 111 109 /* if (this->model)110 this->model->draw();*/112 /* if (this->model) 113 this->model->draw();*/ 111 114 glPopMatrix(); 112 115 } … … 115 118 void AttractorMine::tick(float dt) 116 119 { 117 // Vector direction = (State::getCameraTarget()->getAbsCoor() - this->getAbsCoor()); 120 PNode* attractNode = State::getPlayer()->getPlayable(); 121 if (attractNode != NULL) 122 { 123 if (this->distance(attractNode) < 80) 124 { 125 Vector dist = (attractNode->getAbsCoor() - this->getAbsCoor()); 126 float distance = dist.len(); 127 this->velocity += dist * (( 250.0 - distance) / distance * dt); 128 } 129 } 130 131 this->shiftCoor(this->velocity * dt); 132 133 // Vector direction = (State::getCameraTarget()->getAbsCoor() - this->getAbsCoor()); 118 134 119 135 //if (directin.len() < 100) 120 // this->shiftCoor(direction *dt * 5 * exp(-direction.len() / 30.0));121 // this->shiftDir(Quaternion(dt, this->randomRotAxis));136 // this->shiftCoor(direction *dt * 5 * exp(-direction.len() / 30.0)); 137 // this->shiftDir(Quaternion(dt, this->randomRotAxis)); 122 138 123 139 } -
branches/presentation/src/world_entities/npcs/attractor_mine.h
r9173 r9175 26 26 Vector randomRotAxis; 27 27 Shader* shader; 28 29 Vector velocity; 28 30 }; 29 31
Note: See TracChangeset
for help on using the changeset viewer.