- Timestamp:
- Jul 4, 2006, 3:31:30 AM (18 years ago)
- Location:
- branches/presentation/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/lib/math/quaternion.h
r9092 r9097 25 25 26 26 #include "compiler.h" 27 //! PI the circle-constant28 #define PI 3.14159265359f29 27 #include "vector.h" 30 28 -
branches/presentation/src/world_entities/space_ships/spacecraft_2d.cc
r9087 r9097 25 25 26 26 #include "util/loading/factory.h" 27 #include "util/loading/load_param.h" 27 28 #include "key_mapper.h" 28 29 #include "state.h" … … 42 43 { 43 44 this->setPlayer(NULL); 45 delete this->toTravelHeight; 44 46 } 45 47 … … 116 118 117 119 /// 2D-MODE 118 this->travelHeight = 0.0f;119 120 this->toTravelHeight = NULL; 120 121 this->travelSpeed = 0.0f; … … 201 202 { 202 203 Playable::loadParams(root); 204 205 LoadParam(root, "travel-speed", this, Spacecraft2D, setTravelSpeed); 206 LoadParam(root, "travel-height", this, Spacecraft2D, setTravelHeight); 203 207 } 204 208 … … 208 212 } 209 213 214 void Spacecraft2D::setTravelSpeed(float travelSpeed) 215 { 216 this->travelSpeed = travelSpeed; 217 } 218 219 220 void Spacecraft2D::setTravelHeight(float travelHeight) 221 { 222 if (this->toTravelHeight == NULL) 223 this->toTravelHeight = new float; 224 *this->toTravelHeight = travelHeight; 225 } 226 227 228 229 210 230 void Spacecraft2D::enter() 211 231 { 212 232 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( true); 213 this->setPlaymode( Playable::Full3D /*this->getPlaymode()*/);233 this->setPlaymode(this->getPlaymode()); 214 234 } 215 235 … … 252 272 253 273 State::getCameraNode()->setParentSoft(this->travelNode); 254 State::getCameraNode()->setRelCoorSoft(- 10, 50,0);274 State::getCameraNode()->setRelCoorSoft(-3, 50,0); 255 275 State::getCameraTargetNode()->setParentSoft(this->travelNode); 256 276 … … 369 389 case Playable::Horizontal: 370 390 { 391 392 if (this->toTravelHeight != NULL) 393 { 394 this->travelNode->shiftCoor(Vector(0, (*toTravelHeight - this->travelNode->getAbsCoor().y) * dt, 0)); 395 if (fabsf(this->travelNode->getAbsCoor().y - *this->toTravelHeight) < .1) 396 { 397 delete this->toTravelHeight; 398 this->toTravelHeight = NULL; 399 } 400 } 401 this->travelNode->shiftCoor(Vector(this->travelSpeed * dt, 0, 0)); 371 402 372 403 accel.y = 0.0; -
branches/presentation/src/world_entities/space_ships/spacecraft_2d.h
r9087 r9097 67 67 /// 2D-traveling 68 68 PNode* travelNode; 69 float travelHeight;70 69 float* toTravelHeight; 71 70 float travelSpeed; //!< the current speed of the Hove (to make soft movement)
Note: See TracChangeset
for help on using the changeset viewer.