Начинающий
- Статус
- Оффлайн
- Регистрация
- 23 Июн 2025
- Сообщения
- 43
- Реакции
- 0
- Выберите загрузчик игры
- Vanilla
JavaScript:
case "Uni" -> {
float gcd = SensUtils.getGCDValue();
double speedX = Math.sin(System.currentTimeMillis() / 150.0) * 0.15;
double speedY = Math.cos(System.currentTimeMillis() / 150.0) * 0.15;
Vector3d targetVec = target.getPositionVec().add(0,
clamp(mc.player.getPosYEye() - target.getPosY(), 0, target.getHeight() * 0.8), 0)
.add(speedX, speedY, speedX);
Vector3d diffVec = targetVec.subtract(mc.player.getEyePosition(1.0F));
float targetYaw = (float) MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(diffVec.z, diffVec.x)) - 90);
float targetPitch = (float) (-Math.toDegrees(Math.atan2(diffVec.y, hypot(diffVec.x, diffVec.z))));
yawDelta = wrapDegrees(targetYaw - rotateVector.x);
pitchDelta = targetPitch - rotateVector.y;
float dist = (float) Math.hypot(yawDelta, pitchDelta);
float speed = clamp(dist / 18f, 0.2f, 0.95f);
float rawYaw = rotateVector.x + (yawDelta * speed);
float rawPitch = rotateVector.y + (pitchDelta * speed);
float deltaYaw = rawYaw - rotateVector.x;
float deltaPitch = rawPitch - rotateVector.y;
float fixedYaw = rotateVector.x + Math.round(deltaYaw / gcd) * gcd;
float fixedPitch = rotateVector.y + Math.round(deltaPitch / gcd) * gcd;
rotateVector = new Vector2f(fixedYaw, clamp(fixedPitch, -90, 90));
}