Начинающий
- Статус
- Оффлайн
- Регистрация
- 16 Фев 2023
- Сообщения
- 230
- Реакции
- 6
слотх на ии, запатчить ротацию не составит проблемыглавное что эту хуйню обходит братан
Смотрите видео ниже, чтобы узнать, как установить наш сайт в качестве веб-приложения на домашнем экране.
Примечание: Эта возможность может быть недоступна в некоторых браузерах.
слотх на ии, запатчить ротацию не составит проблемыглавное что эту хуйню обходит братан
почему у тебя яв санитарируетсяРотация с рич клиента на экспенсив 3.1
SS -
Java:case "SlothAI" -> { if (target == null) break; Vector3d eyes = player.getEyePosition(1.0f); Vector3d targetPos = target.getBoundingBox().getCenter(); Vector3d diff = targetPos.subtract(eyes); double distXZ = Math.sqrt(diff.x * diff.x + diff.z * diff.z); float targetYaw = (float) wrapDegrees(Math.toDegrees(Math.atan2(diff.z, diff.x)) - 90.0f); float targetPitch = (float) -Math.toDegrees(Math.atan2(diff.y, distXZ)); yawDelta = (float) wrapDegrees(targetYaw - rotateVector.x); pitchDelta = (float) wrapDegrees(targetPitch - rotateVector.y); float rotationDifference = (float) Math.hypot(Math.abs(yawDelta), Math.abs(pitchDelta)); float distanceToTarget = (float) player.getDistance(target); boolean canAttack = target != null && player.getDistance(target) <= attackDistance(); float baseSpeed = canAttack ? 0.93f : 0.56f; if (distanceToTarget > 0 && distanceToTarget < 0.66f) { float closeRangeSpeed = MathHelper.clamp(distanceToTarget / 1.5f * 0.35f, 0.1f, 0.6f); baseSpeed = canAttack ? 0.85f : Math.min(baseSpeed, closeRangeSpeed); } float jitterYaw = (float) (randomLerp(20, 26) * Math.sin(System.currentTimeMillis() / 25.0)); float jitterPitch = (float) (randomLerp(8, 23) * Math.sin(System.currentTimeMillis() / 27.0)); boolean shouldIdle = (!isState() || this.target == null) && stopWatch.hasTimeElapsed(1000, false); if (shouldIdle) { baseSpeed = 0.35f; jitterYaw = 0; jitterPitch = 0; } float moveYaw = MathHelper.clamp(yawDelta, -Math.abs(yawDelta / rotationDifference * 180), Math.abs(yawDelta / rotationDifference * 180)); float movePitch = MathHelper.clamp(pitchDelta, -Math.abs(pitchDelta / rotationDifference * 180), Math.abs(pitchDelta / rotationDifference * 180)); float finalYaw = MathHelper.lerp(baseSpeed, rotateVector.x, rotateVector.x + moveYaw) + jitterYaw; float finalPitch = MathHelper.lerp(baseSpeed, rotateVector.y, rotateVector.y + movePitch) + jitterPitch; finalPitch = clamp(finalPitch, -90.0f, 90.0f); finalYaw = sanitizeYaw(finalYaw); float gcd = SensUtils.getGCDValue(); if (gcd > 0.0f && gcd < 10.0f && !Float.isInfinite(gcd) && !Float.isNaN(gcd)) { finalYaw = (float) (finalYaw - (finalYaw - rotateVector.x) % gcd); finalPitch = (float) (finalPitch - (finalPitch - rotateVector.y) % gcd); } rotateVector = new Vector2f(finalYaw, finalPitch); isRotated = true; if (options.getValueByName("Коррекция движения").get()) { player.rotationYawOffset = finalYaw; } }
Java:private float randomLerp(float min, float max) { return min + random.nextFloat() * (max - min); }
Java:private float sanitizeYaw(float yaw) { while (yaw > 180.0F) { yaw -= 360.0F; } while (yaw < -180.0F) { yaw += 360.0F; } return yaw; }![]()
пастеры уже к этому ач добрались???? я думал что вы об нем даже не знали.Ротация с рич клиента на экспенсив 3.1
SS -
Java:case "SlothAI" -> { if (target == null) break; Vector3d eyes = player.getEyePosition(1.0f); Vector3d targetPos = target.getBoundingBox().getCenter(); Vector3d diff = targetPos.subtract(eyes); double distXZ = Math.sqrt(diff.x * diff.x + diff.z * diff.z); float targetYaw = (float) wrapDegrees(Math.toDegrees(Math.atan2(diff.z, diff.x)) - 90.0f); float targetPitch = (float) -Math.toDegrees(Math.atan2(diff.y, distXZ)); yawDelta = (float) wrapDegrees(targetYaw - rotateVector.x); pitchDelta = (float) wrapDegrees(targetPitch - rotateVector.y); float rotationDifference = (float) Math.hypot(Math.abs(yawDelta), Math.abs(pitchDelta)); float distanceToTarget = (float) player.getDistance(target); boolean canAttack = target != null && player.getDistance(target) <= attackDistance(); float baseSpeed = canAttack ? 0.93f : 0.56f; if (distanceToTarget > 0 && distanceToTarget < 0.66f) { float closeRangeSpeed = MathHelper.clamp(distanceToTarget / 1.5f * 0.35f, 0.1f, 0.6f); baseSpeed = canAttack ? 0.85f : Math.min(baseSpeed, closeRangeSpeed); } float jitterYaw = (float) (randomLerp(20, 26) * Math.sin(System.currentTimeMillis() / 25.0)); float jitterPitch = (float) (randomLerp(8, 23) * Math.sin(System.currentTimeMillis() / 27.0)); boolean shouldIdle = (!isState() || this.target == null) && stopWatch.hasTimeElapsed(1000, false); if (shouldIdle) { baseSpeed = 0.35f; jitterYaw = 0; jitterPitch = 0; } float moveYaw = MathHelper.clamp(yawDelta, -Math.abs(yawDelta / rotationDifference * 180), Math.abs(yawDelta / rotationDifference * 180)); float movePitch = MathHelper.clamp(pitchDelta, -Math.abs(pitchDelta / rotationDifference * 180), Math.abs(pitchDelta / rotationDifference * 180)); float finalYaw = MathHelper.lerp(baseSpeed, rotateVector.x, rotateVector.x + moveYaw) + jitterYaw; float finalPitch = MathHelper.lerp(baseSpeed, rotateVector.y, rotateVector.y + movePitch) + jitterPitch; finalPitch = clamp(finalPitch, -90.0f, 90.0f); finalYaw = sanitizeYaw(finalYaw); float gcd = SensUtils.getGCDValue(); if (gcd > 0.0f && gcd < 10.0f && !Float.isInfinite(gcd) && !Float.isNaN(gcd)) { finalYaw = (float) (finalYaw - (finalYaw - rotateVector.x) % gcd); finalPitch = (float) (finalPitch - (finalPitch - rotateVector.y) % gcd); } rotateVector = new Vector2f(finalYaw, finalPitch); isRotated = true; if (options.getValueByName("Коррекция движения").get()) { player.rotationYawOffset = finalYaw; } }
Java:private float randomLerp(float min, float max) { return min + random.nextFloat() * (max - min); }
Java:private float sanitizeYaw(float yaw) { while (yaw > 180.0F) { yaw -= 360.0F; } while (yaw < -180.0F) { yaw += 360.0F; } return yaw; }![]()
вот это таргет еспРотация с рич клиента на экспенсив 3.1
SS -
Java:case "SlothAI" -> { if (target == null) break; Vector3d eyes = player.getEyePosition(1.0f); Vector3d targetPos = target.getBoundingBox().getCenter(); Vector3d diff = targetPos.subtract(eyes); double distXZ = Math.sqrt(diff.x * diff.x + diff.z * diff.z); float targetYaw = (float) wrapDegrees(Math.toDegrees(Math.atan2(diff.z, diff.x)) - 90.0f); float targetPitch = (float) -Math.toDegrees(Math.atan2(diff.y, distXZ)); yawDelta = (float) wrapDegrees(targetYaw - rotateVector.x); pitchDelta = (float) wrapDegrees(targetPitch - rotateVector.y); float rotationDifference = (float) Math.hypot(Math.abs(yawDelta), Math.abs(pitchDelta)); float distanceToTarget = (float) player.getDistance(target); boolean canAttack = target != null && player.getDistance(target) <= attackDistance(); float baseSpeed = canAttack ? 0.93f : 0.56f; if (distanceToTarget > 0 && distanceToTarget < 0.66f) { float closeRangeSpeed = MathHelper.clamp(distanceToTarget / 1.5f * 0.35f, 0.1f, 0.6f); baseSpeed = canAttack ? 0.85f : Math.min(baseSpeed, closeRangeSpeed); } float jitterYaw = (float) (randomLerp(20, 26) * Math.sin(System.currentTimeMillis() / 25.0)); float jitterPitch = (float) (randomLerp(8, 23) * Math.sin(System.currentTimeMillis() / 27.0)); boolean shouldIdle = (!isState() || this.target == null) && stopWatch.hasTimeElapsed(1000, false); if (shouldIdle) { baseSpeed = 0.35f; jitterYaw = 0; jitterPitch = 0; } float moveYaw = MathHelper.clamp(yawDelta, -Math.abs(yawDelta / rotationDifference * 180), Math.abs(yawDelta / rotationDifference * 180)); float movePitch = MathHelper.clamp(pitchDelta, -Math.abs(pitchDelta / rotationDifference * 180), Math.abs(pitchDelta / rotationDifference * 180)); float finalYaw = MathHelper.lerp(baseSpeed, rotateVector.x, rotateVector.x + moveYaw) + jitterYaw; float finalPitch = MathHelper.lerp(baseSpeed, rotateVector.y, rotateVector.y + movePitch) + jitterPitch; finalPitch = clamp(finalPitch, -90.0f, 90.0f); finalYaw = sanitizeYaw(finalYaw); float gcd = SensUtils.getGCDValue(); if (gcd > 0.0f && gcd < 10.0f && !Float.isInfinite(gcd) && !Float.isNaN(gcd)) { finalYaw = (float) (finalYaw - (finalYaw - rotateVector.x) % gcd); finalPitch = (float) (finalPitch - (finalPitch - rotateVector.y) % gcd); } rotateVector = new Vector2f(finalYaw, finalPitch); isRotated = true; if (options.getValueByName("Коррекция движения").get()) { player.rotationYawOffset = finalYaw; } }
Java:private float randomLerp(float min, float max) { return min + random.nextFloat() * (max - min); }
Java:private float sanitizeYaw(float yaw) { while (yaw > 180.0F) { yaw -= 360.0F; } while (yaw < -180.0F) { yaw += 360.0F; } return yaw; }![]()
- ушиРотация с рич клиента на экспенсив 3.1
SS -
Java:case "SlothAI" -> { if (target == null) break; Vector3d eyes = player.getEyePosition(1.0f); Vector3d targetPos = target.getBoundingBox().getCenter(); Vector3d diff = targetPos.subtract(eyes); double distXZ = Math.sqrt(diff.x * diff.x + diff.z * diff.z); float targetYaw = (float) wrapDegrees(Math.toDegrees(Math.atan2(diff.z, diff.x)) - 90.0f); float targetPitch = (float) -Math.toDegrees(Math.atan2(diff.y, distXZ)); yawDelta = (float) wrapDegrees(targetYaw - rotateVector.x); pitchDelta = (float) wrapDegrees(targetPitch - rotateVector.y); float rotationDifference = (float) Math.hypot(Math.abs(yawDelta), Math.abs(pitchDelta)); float distanceToTarget = (float) player.getDistance(target); boolean canAttack = target != null && player.getDistance(target) <= attackDistance(); float baseSpeed = canAttack ? 0.93f : 0.56f; if (distanceToTarget > 0 && distanceToTarget < 0.66f) { float closeRangeSpeed = MathHelper.clamp(distanceToTarget / 1.5f * 0.35f, 0.1f, 0.6f); baseSpeed = canAttack ? 0.85f : Math.min(baseSpeed, closeRangeSpeed); } float jitterYaw = (float) (randomLerp(20, 26) * Math.sin(System.currentTimeMillis() / 25.0)); float jitterPitch = (float) (randomLerp(8, 23) * Math.sin(System.currentTimeMillis() / 27.0)); boolean shouldIdle = (!isState() || this.target == null) && stopWatch.hasTimeElapsed(1000, false); if (shouldIdle) { baseSpeed = 0.35f; jitterYaw = 0; jitterPitch = 0; } float moveYaw = MathHelper.clamp(yawDelta, -Math.abs(yawDelta / rotationDifference * 180), Math.abs(yawDelta / rotationDifference * 180)); float movePitch = MathHelper.clamp(pitchDelta, -Math.abs(pitchDelta / rotationDifference * 180), Math.abs(pitchDelta / rotationDifference * 180)); float finalYaw = MathHelper.lerp(baseSpeed, rotateVector.x, rotateVector.x + moveYaw) + jitterYaw; float finalPitch = MathHelper.lerp(baseSpeed, rotateVector.y, rotateVector.y + movePitch) + jitterPitch; finalPitch = clamp(finalPitch, -90.0f, 90.0f); finalYaw = sanitizeYaw(finalYaw); float gcd = SensUtils.getGCDValue(); if (gcd > 0.0f && gcd < 10.0f && !Float.isInfinite(gcd) && !Float.isNaN(gcd)) { finalYaw = (float) (finalYaw - (finalYaw - rotateVector.x) % gcd); finalPitch = (float) (finalPitch - (finalPitch - rotateVector.y) % gcd); } rotateVector = new Vector2f(finalYaw, finalPitch); isRotated = true; if (options.getValueByName("Коррекция движения").get()) { player.rotationYawOffset = finalYaw; } }
Java:private float randomLerp(float min, float max) { return min + random.nextFloat() * (max - min); }
Java:private float sanitizeYaw(float yaw) { while (yaw > 180.0F) { yaw -= 360.0F; } while (yaw < -180.0F) { yaw += 360.0F; } return yaw; }![]()
та нормальная ротка че вы набросилисьРотация с рич клиента на экспенсив 3.1
SS -
Java:case "SlothAI" -> { if (target == null) break; Vector3d eyes = player.getEyePosition(1.0f); Vector3d targetPos = target.getBoundingBox().getCenter(); Vector3d diff = targetPos.subtract(eyes); double distXZ = Math.sqrt(diff.x * diff.x + diff.z * diff.z); float targetYaw = (float) wrapDegrees(Math.toDegrees(Math.atan2(diff.z, diff.x)) - 90.0f); float targetPitch = (float) -Math.toDegrees(Math.atan2(diff.y, distXZ)); yawDelta = (float) wrapDegrees(targetYaw - rotateVector.x); pitchDelta = (float) wrapDegrees(targetPitch - rotateVector.y); float rotationDifference = (float) Math.hypot(Math.abs(yawDelta), Math.abs(pitchDelta)); float distanceToTarget = (float) player.getDistance(target); boolean canAttack = target != null && player.getDistance(target) <= attackDistance(); float baseSpeed = canAttack ? 0.93f : 0.56f; if (distanceToTarget > 0 && distanceToTarget < 0.66f) { float closeRangeSpeed = MathHelper.clamp(distanceToTarget / 1.5f * 0.35f, 0.1f, 0.6f); baseSpeed = canAttack ? 0.85f : Math.min(baseSpeed, closeRangeSpeed); } float jitterYaw = (float) (randomLerp(20, 26) * Math.sin(System.currentTimeMillis() / 25.0)); float jitterPitch = (float) (randomLerp(8, 23) * Math.sin(System.currentTimeMillis() / 27.0)); boolean shouldIdle = (!isState() || this.target == null) && stopWatch.hasTimeElapsed(1000, false); if (shouldIdle) { baseSpeed = 0.35f; jitterYaw = 0; jitterPitch = 0; } float moveYaw = MathHelper.clamp(yawDelta, -Math.abs(yawDelta / rotationDifference * 180), Math.abs(yawDelta / rotationDifference * 180)); float movePitch = MathHelper.clamp(pitchDelta, -Math.abs(pitchDelta / rotationDifference * 180), Math.abs(pitchDelta / rotationDifference * 180)); float finalYaw = MathHelper.lerp(baseSpeed, rotateVector.x, rotateVector.x + moveYaw) + jitterYaw; float finalPitch = MathHelper.lerp(baseSpeed, rotateVector.y, rotateVector.y + movePitch) + jitterPitch; finalPitch = clamp(finalPitch, -90.0f, 90.0f); finalYaw = sanitizeYaw(finalYaw); float gcd = SensUtils.getGCDValue(); if (gcd > 0.0f && gcd < 10.0f && !Float.isInfinite(gcd) && !Float.isNaN(gcd)) { finalYaw = (float) (finalYaw - (finalYaw - rotateVector.x) % gcd); finalPitch = (float) (finalPitch - (finalPitch - rotateVector.y) % gcd); } rotateVector = new Vector2f(finalYaw, finalPitch); isRotated = true; if (options.getValueByName("Коррекция движения").get()) { player.rotationYawOffset = finalYaw; } }
Java:private float randomLerp(float min, float max) { return min + random.nextFloat() * (max - min); }
Java:private float sanitizeYaw(float yaw) { while (yaw > 180.0F) { yaw -= 360.0F; } while (yaw < -180.0F) { yaw += 360.0F; } return yaw; }![]()
Благодарим вас за помощь в разработке Sloth!Ротация с рич клиента на экспенсив 3.1
SS -
Java:case "SlothAI" -> { if (target == null) break; Vector3d eyes = player.getEyePosition(1.0f); Vector3d targetPos = target.getBoundingBox().getCenter(); Vector3d diff = targetPos.subtract(eyes); double distXZ = Math.sqrt(diff.x * diff.x + diff.z * diff.z); float targetYaw = (float) wrapDegrees(Math.toDegrees(Math.atan2(diff.z, diff.x)) - 90.0f); float targetPitch = (float) -Math.toDegrees(Math.atan2(diff.y, distXZ)); yawDelta = (float) wrapDegrees(targetYaw - rotateVector.x); pitchDelta = (float) wrapDegrees(targetPitch - rotateVector.y); float rotationDifference = (float) Math.hypot(Math.abs(yawDelta), Math.abs(pitchDelta)); float distanceToTarget = (float) player.getDistance(target); boolean canAttack = target != null && player.getDistance(target) <= attackDistance(); float baseSpeed = canAttack ? 0.93f : 0.56f; if (distanceToTarget > 0 && distanceToTarget < 0.66f) { float closeRangeSpeed = MathHelper.clamp(distanceToTarget / 1.5f * 0.35f, 0.1f, 0.6f); baseSpeed = canAttack ? 0.85f : Math.min(baseSpeed, closeRangeSpeed); } float jitterYaw = (float) (randomLerp(20, 26) * Math.sin(System.currentTimeMillis() / 25.0)); float jitterPitch = (float) (randomLerp(8, 23) * Math.sin(System.currentTimeMillis() / 27.0)); boolean shouldIdle = (!isState() || this.target == null) && stopWatch.hasTimeElapsed(1000, false); if (shouldIdle) { baseSpeed = 0.35f; jitterYaw = 0; jitterPitch = 0; } float moveYaw = MathHelper.clamp(yawDelta, -Math.abs(yawDelta / rotationDifference * 180), Math.abs(yawDelta / rotationDifference * 180)); float movePitch = MathHelper.clamp(pitchDelta, -Math.abs(pitchDelta / rotationDifference * 180), Math.abs(pitchDelta / rotationDifference * 180)); float finalYaw = MathHelper.lerp(baseSpeed, rotateVector.x, rotateVector.x + moveYaw) + jitterYaw; float finalPitch = MathHelper.lerp(baseSpeed, rotateVector.y, rotateVector.y + movePitch) + jitterPitch; finalPitch = clamp(finalPitch, -90.0f, 90.0f); finalYaw = sanitizeYaw(finalYaw); float gcd = SensUtils.getGCDValue(); if (gcd > 0.0f && gcd < 10.0f && !Float.isInfinite(gcd) && !Float.isNaN(gcd)) { finalYaw = (float) (finalYaw - (finalYaw - rotateVector.x) % gcd); finalPitch = (float) (finalPitch - (finalPitch - rotateVector.y) % gcd); } rotateVector = new Vector2f(finalYaw, finalPitch); isRotated = true; if (options.getValueByName("Коррекция движения").get()) { player.rotationYawOffset = finalYaw; } }
Java:private float randomLerp(float min, float max) { return min + random.nextFloat() * (max - min); }
Java:private float sanitizeYaw(float yaw) { while (yaw > 180.0F) { yaw -= 360.0F; } while (yaw < -180.0F) { yaw += 360.0F; } return yaw; }![]()
ну все не бупасБлагодарим вас за помощь в разработке Sloth!
Мы очень признательны вам за то, что вы решили опубликовать эту ротацию - теперь благодаря ней наши алгоритмы машинного обучения станут ещё лучше!
зачем вообще чтото выкладывать обходы под этот ач? если его пофиксит постмаркетРотация с рич клиента на экспенсив 3.1
SS -
Java:case "SlothAI" -> { if (target == null) break; Vector3d eyes = player.getEyePosition(1.0f); Vector3d targetPos = target.getBoundingBox().getCenter(); Vector3d diff = targetPos.subtract(eyes); double distXZ = Math.sqrt(diff.x * diff.x + diff.z * diff.z); float targetYaw = (float) wrapDegrees(Math.toDegrees(Math.atan2(diff.z, diff.x)) - 90.0f); float targetPitch = (float) -Math.toDegrees(Math.atan2(diff.y, distXZ)); yawDelta = (float) wrapDegrees(targetYaw - rotateVector.x); pitchDelta = (float) wrapDegrees(targetPitch - rotateVector.y); float rotationDifference = (float) Math.hypot(Math.abs(yawDelta), Math.abs(pitchDelta)); float distanceToTarget = (float) player.getDistance(target); boolean canAttack = target != null && player.getDistance(target) <= attackDistance(); float baseSpeed = canAttack ? 0.93f : 0.56f; if (distanceToTarget > 0 && distanceToTarget < 0.66f) { float closeRangeSpeed = MathHelper.clamp(distanceToTarget / 1.5f * 0.35f, 0.1f, 0.6f); baseSpeed = canAttack ? 0.85f : Math.min(baseSpeed, closeRangeSpeed); } float jitterYaw = (float) (randomLerp(20, 26) * Math.sin(System.currentTimeMillis() / 25.0)); float jitterPitch = (float) (randomLerp(8, 23) * Math.sin(System.currentTimeMillis() / 27.0)); boolean shouldIdle = (!isState() || this.target == null) && stopWatch.hasTimeElapsed(1000, false); if (shouldIdle) { baseSpeed = 0.35f; jitterYaw = 0; jitterPitch = 0; } float moveYaw = MathHelper.clamp(yawDelta, -Math.abs(yawDelta / rotationDifference * 180), Math.abs(yawDelta / rotationDifference * 180)); float movePitch = MathHelper.clamp(pitchDelta, -Math.abs(pitchDelta / rotationDifference * 180), Math.abs(pitchDelta / rotationDifference * 180)); float finalYaw = MathHelper.lerp(baseSpeed, rotateVector.x, rotateVector.x + moveYaw) + jitterYaw; float finalPitch = MathHelper.lerp(baseSpeed, rotateVector.y, rotateVector.y + movePitch) + jitterPitch; finalPitch = clamp(finalPitch, -90.0f, 90.0f); finalYaw = sanitizeYaw(finalYaw); float gcd = SensUtils.getGCDValue(); if (gcd > 0.0f && gcd < 10.0f && !Float.isInfinite(gcd) && !Float.isNaN(gcd)) { finalYaw = (float) (finalYaw - (finalYaw - rotateVector.x) % gcd); finalPitch = (float) (finalPitch - (finalPitch - rotateVector.y) % gcd); } rotateVector = new Vector2f(finalYaw, finalPitch); isRotated = true; if (options.getValueByName("Коррекция движения").get()) { player.rotationYawOffset = finalYaw; } }
Java:private float randomLerp(float min, float max) { return min + random.nextFloat() * (max - min); }
Java:private float sanitizeYaw(float yaw) { while (yaw > 180.0F) { yaw -= 360.0F; } while (yaw < -180.0F) { yaw += 360.0F; } return yaw; }![]()
хуйня /delРотация с рич клиента на экспенсив 3.1
SS -
Java:case "SlothAI" -> { if (target == null) break; Vector3d eyes = player.getEyePosition(1.0f); Vector3d targetPos = target.getBoundingBox().getCenter(); Vector3d diff = targetPos.subtract(eyes); double distXZ = Math.sqrt(diff.x * diff.x + diff.z * diff.z); float targetYaw = (float) wrapDegrees(Math.toDegrees(Math.atan2(diff.z, diff.x)) - 90.0f); float targetPitch = (float) -Math.toDegrees(Math.atan2(diff.y, distXZ)); yawDelta = (float) wrapDegrees(targetYaw - rotateVector.x); pitchDelta = (float) wrapDegrees(targetPitch - rotateVector.y); float rotationDifference = (float) Math.hypot(Math.abs(yawDelta), Math.abs(pitchDelta)); float distanceToTarget = (float) player.getDistance(target); boolean canAttack = target != null && player.getDistance(target) <= attackDistance(); float baseSpeed = canAttack ? 0.93f : 0.56f; if (distanceToTarget > 0 && distanceToTarget < 0.66f) { float closeRangeSpeed = MathHelper.clamp(distanceToTarget / 1.5f * 0.35f, 0.1f, 0.6f); baseSpeed = canAttack ? 0.85f : Math.min(baseSpeed, closeRangeSpeed); } float jitterYaw = (float) (randomLerp(20, 26) * Math.sin(System.currentTimeMillis() / 25.0)); float jitterPitch = (float) (randomLerp(8, 23) * Math.sin(System.currentTimeMillis() / 27.0)); boolean shouldIdle = (!isState() || this.target == null) && stopWatch.hasTimeElapsed(1000, false); if (shouldIdle) { baseSpeed = 0.35f; jitterYaw = 0; jitterPitch = 0; } float moveYaw = MathHelper.clamp(yawDelta, -Math.abs(yawDelta / rotationDifference * 180), Math.abs(yawDelta / rotationDifference * 180)); float movePitch = MathHelper.clamp(pitchDelta, -Math.abs(pitchDelta / rotationDifference * 180), Math.abs(pitchDelta / rotationDifference * 180)); float finalYaw = MathHelper.lerp(baseSpeed, rotateVector.x, rotateVector.x + moveYaw) + jitterYaw; float finalPitch = MathHelper.lerp(baseSpeed, rotateVector.y, rotateVector.y + movePitch) + jitterPitch; finalPitch = clamp(finalPitch, -90.0f, 90.0f); finalYaw = sanitizeYaw(finalYaw); float gcd = SensUtils.getGCDValue(); if (gcd > 0.0f && gcd < 10.0f && !Float.isInfinite(gcd) && !Float.isNaN(gcd)) { finalYaw = (float) (finalYaw - (finalYaw - rotateVector.x) % gcd); finalPitch = (float) (finalPitch - (finalPitch - rotateVector.y) % gcd); } rotateVector = new Vector2f(finalYaw, finalPitch); isRotated = true; if (options.getValueByName("Коррекция движения").get()) { player.rotationYawOffset = finalYaw; } }
Java:private float randomLerp(float min, float max) { return min + random.nextFloat() * (max - min); }
Java:private float sanitizeYaw(float yaw) { while (yaw > 180.0F) { yaw -= 360.0F; } while (yaw < -180.0F) { yaw += 360.0F; } return yaw; }![]()
тп на аме серега пиратА можно песню?
Проект предоставляет различный материал, относящийся к сфере киберспорта, программирования, ПО для игр, а также позволяет его участникам общаться на многие другие темы. Почта для жалоб: admin@yougame.biz