[Orxonox-commit 3871] r8545 - in code/branches/steering: data/levels/templates src/orxonox/worldentities/pawns
mastalde at orxonox.net
mastalde at orxonox.net
Mon May 23 16:12:44 CEST 2011
Author: mastalde
Date: 2011-05-23 16:12:44 +0200 (Mon, 23 May 2011)
New Revision: 8545
Modified:
code/branches/steering/data/levels/templates/spaceshipAssff.oxt
code/branches/steering/src/orxonox/worldentities/pawns/SpaceShip.cc
Log:
cleaded code and added some comments
Modified: code/branches/steering/data/levels/templates/spaceshipAssff.oxt
===================================================================
--- code/branches/steering/data/levels/templates/spaceshipAssff.oxt 2011-05-23 14:12:27 UTC (rev 8544)
+++ code/branches/steering/data/levels/templates/spaceshipAssff.oxt 2011-05-23 14:12:44 UTC (rev 8545)
@@ -15,7 +15,7 @@
auxilaryThrust = 30;
rotationThrust = 60;
- lift = 0.2;
+ lift = 1;
stallSpeed = 220;
collisionType = "dynamic"
Modified: code/branches/steering/src/orxonox/worldentities/pawns/SpaceShip.cc
===================================================================
--- code/branches/steering/src/orxonox/worldentities/pawns/SpaceShip.cc 2011-05-23 14:12:27 UTC (rev 8544)
+++ code/branches/steering/src/orxonox/worldentities/pawns/SpaceShip.cc 2011-05-23 14:12:44 UTC (rev 8545)
@@ -64,8 +64,8 @@
this->boostCooldownDuration_ = 5.0;
this->bBoostCooldown_ = false;
- this->lift_ = 0.2f;
- this->stallSpeed_ = 220.0f;
+ this->lift_ = 1.0f; // factor of the lift, standard is 1
+ this->stallSpeed_ = 220.0f; // max speed where lift is added
this->bInvertYAxis_ = false;
@@ -174,8 +174,6 @@
}
}
-//COUT(1) << "Vel:" << this-> getLocalVelocity().z * -1 << endl;
-
}
}
@@ -223,13 +221,13 @@
Pawn::rotatePitch(value);
-
-
- if (abs(this-> getLocalVelocity().z) < stallSpeed_) {this->moveUpDown(lift_*value*sqrt(abs(this-> getLocalVelocity().z)));}
-
+ //This function call adds a lift to the ship when it is pitching to make it's movement more "realistic" and enhance the feeling.
+ if (abs(this-> getLocalVelocity().z) < stallSpeed_) {this->moveUpDown(lift_ / 5 * value * sqrt(abs(this-> getLocalVelocity().z)));}
+
+
}
void SpaceShip::rotateRoll(const Vector2& value)
@@ -237,7 +235,7 @@
this->localAngularAcceleration_.setZ(this->localAngularAcceleration_.z() + value.x);
Pawn::rotateRoll(value);
-
+
}
void SpaceShip::fire()
More information about the Orxonox-commit
mailing list