This commit is contained in:
Mini-Chiss 2015-08-29 16:54:23 -07:00
parent a76610e21e
commit 50b6bfbe1a

View File

@ -165,17 +165,17 @@ public class SnakeCreature extends EventCreature<Silverfish>
{ {
Vector moveTo = UtilAlg.getTrajectory(vec, _waypoint.toVector()); Vector moveTo = UtilAlg.getTrajectory(vec, _waypoint.toVector());
Vector target = vec.clone().add(moveTo.multiply(1)); // Vector target = vec.clone().add(moveTo.multiply(3));
//
// //MATHS
// double speed = 10d;
// double right = -Math.sin(_ticks/speed) * 4;
// double up = Math.cos(_ticks/speed) * 4;
//
// target.add(UtilAlg.getRight(vec).multiply(right));
// target.add(UtilAlg.getUp(vec).multiply(up));
//MATHS _velocity.add(moveTo.normalize().multiply(0.04));
double speed = 10d;
double right = -Math.sin(_ticks/speed) * 4;
double up = Math.cos(_ticks/speed) * 4;
target.add(UtilAlg.getRight(vec).multiply(right));
target.add(UtilAlg.getUp(vec).multiply(up));
_velocity.add(target.normalize().multiply(0.04));
if (_velocity.length() > 0.5) if (_velocity.length() > 0.5)
_velocity.normalize().multiply(0.5); _velocity.normalize().multiply(0.5);