public void Move(float deltaTime) { var delta = Destination - Position; var wayLength = MathModule.Length(delta); if (wayLength < 0.01) { return; } if (wayLength < _speed) { Position = Destination; } else { var move = delta * (float)(_speed / wayLength) * deltaTime; Position += move; } }
public bool PointVisible(double x, double y) => MathModule.Hypot(this.Position.X - x, this.Position.Y - y) < this._viewRadius;
public bool AbleToFire(Vector2f target) { var distance = MathModule.Length(target - Position); return((distance > _minRange) && (distance < _maxRange)); }