commentaar jumpStep

This commit is contained in:
Leen Dereu
2018-03-11 16:36:17 +01:00
parent b15ccb5cca
commit 87946a1c20
2 changed files with 12 additions and 3 deletions

View File

@@ -662,8 +662,17 @@ public class Worm {
/** /**
* *
* @param deltaTime ... * @param deltaTime
* @return Tuple<Double, Double> * the total time the worm schould jump
* @return Tuple<Double, Double> with the new location of the worm. The new x-coordinate is the old x-coordinate plus the jump velocity
* multiplied with the cosinus of the orientation multiplied with delta time. The new y-coordinate is the old y-coordinate plus
* the jump velocity multiplied with the sinus of the orientation multiplied with delta time minus 0,5 times the gravity multiplied
* with the second power of delta time
* |Tuple.create(getLocation().item1 + this.jumpVelocity() * cos(getOrientation()) * deltaTime,
|getLocation().item2 + this.jumpVelocity() * sin(getOrientation()) * deltaTime - 0.5 * G * pow(deltaTime, 2))
* @throws IllegalArgumentException()
* if the deltaTime is not a number or bigger then jumpTime or smaller then 0
* |if (Double.isNaN(deltaTime) || deltaTime > this.jumpTime() || deltaTime < 0)
*/ */
public Tuple<Double, Double> jumpStep(double deltaTime) { public Tuple<Double, Double> jumpStep(double deltaTime) {
if (Double.isNaN(deltaTime) || deltaTime > this.jumpTime() || deltaTime < 0) if (Double.isNaN(deltaTime) || deltaTime > this.jumpTime() || deltaTime < 0)

View File

@@ -4,7 +4,7 @@
- getMaxActionPoints DONE - getMaxActionPoints DONE
- decreaseActionPoints DONE - decreaseActionPoints DONE
- canTurn DONE - canTurn DONE
- Tuple (methode) - jumpStep DONE
* testen schrijven * testen schrijven
* documentatie Facade * documentatie Facade
* is Facade klaar? * is Facade klaar?