293
订阅者
无数据24 小时
+67 天
+230 天
帖子存档
293
void Movement(uintptr_t player, uintptr_t photon, uintptr_t playercontrols){
if (MoveBefore){
utils::clearHashSet(process->Read<uintptr_t>(playercontrols + oxorany(0x68)));
utils::clearHashSet(process->Read<uintptr_t>(playercontrols + oxorany(0x70)));
utils::clearHashSet(process->Read<uintptr_t>(playercontrols + oxorany(0x78)));
}
if(AirJump){
auto touchController = process->Read<uintptr_t>(playercontrols + oxorany(0x38));
if (touchController > 0) {
auto jumpButton = process->Read<uintptr_t>(touchController + oxorany(0x70));
if (jumpButton > 0 && process->Read<bool>(jumpButton + oxorany(0x88))) {
auto characterController = process->Read<uintptr_t>(player + oxorany(0xF0));
if (characterController > 0) {
auto object = process->Read<uintptr_t>(characterController + oxorany(0x10));
auto pmttest = process->Read<uintptr_t>(object + oxorany(0xCC));
pmttest |= (1 << 2);
process->Write<uintptr_t>(object + oxorany(0xCC), pmttest);
}
}
}
}
}
}04 8月 2025, 13:33
293
bool thirdperson;
float thirdfloat = 3.0f;
// Camera control
float cameraYaw = 0.0f; // Горизонтальный угол
float cameraPitch = 15.0f; // Вертикальный угол (начальный наклон вниз)
float cameraSensitivity = 0.5f;
if(ImGui::CollapsingHeader("Third Person")) {
ImGui::Checkbox("Enabled", &thirdperson);
if(thirdperson) {
ImGui::SliderFloat("Distance", &thirdfloat, 1.0f, 10.0f);
ImGui::SliderFloat("Sensitivity", &cameraSensitivity, 0.1f, 2.0f);
if(ImGui::Button("Reset View")) {
cameraYaw = 0.0f;
cameraPitch = 10.0f;
}
}
Найди
bool HandleInputEvent
После
io.MousePos.y = g_LastTouchEvent.y;
Вставь
if(thirdperson) {
static float lastX = 0, lastY = 0;
float currentX = static_cast<float>(x);
float currentY = static_cast<float>(y);
if(motionEvent == TOUCH_ACTION_DOWN) {
lastX = currentX;
lastY = currentY;
}
else if(motionEvent == TOUCH_ACTION_MOVE && thirdperson) {
float xoffset = (currentX - lastX) * cameraSensitivity;
float yoffset = (lastY - currentY) * cameraSensitivity;
lastX = currentX;
lastY = currentY;
cameraYaw += xoffset;
cameraPitch = std::clamp(cameraPitch + yoffset, -89.0f, 89.0f);
}
}
Где у тебя все подобные воиды
void (*set_TpsView3)(void* player);
Quaternion (*get_rotation)(void* transform);
void (*set_rotation)(void* transform, Quaternion rotation);
Quaternion LookAtRotation(Vector3 source, Vector3 target, Vector3 up = Vector3(0, 1, 0));
Vector3 (*get_right)(void* transform);
Vector3 (*get_up)(void* transform);
В player update
if (thirdperson) {
set_TpsView3(instance);
}
void* (*old_PlayerControllerLateUpdate)(void *up);
void PlayerControllerLateUpdate(void* up) {
if (thirdperson && myplayer) {
void* camera = get_camera();
void* cameraTransform = get_transform(camera);
void* playerTransform = get_transform(myplayer);
// Получаем позицию игрока
Vector3 playerPos = get_position(playerTransform);
// Рассчитываем смещение камеры
Vector3 offset;
offset.x = sinf(cameraYaw * (M_PI/180)) * cosf(cameraPitch * (M_PI/180));
offset.y = sinf(cameraPitch * (M_PI/180));
offset.z = cosf(cameraYaw * (M_PI/180)) * cosf(cameraPitch * (M_PI/180));
// Умножаем на желаемое расстояние
offset = offset * thirdfloat;
// Вычисляем конечную позицию камеры
Vector3 desiredCameraPos = playerPos + offset;
// Точка, куда должна смотреть камера (немного выше игрока)
Vector3 lookAtPos = playerPos;
lookAtPos.y += 1.8f;
// Устанавливаем позицию и поворот камеры
setpos(cameraTransform, desiredCameraPos);
Vector3 lookDirection = (lookAtPos - desiredCameraPos).normalized();
Quaternion targetRotation = Quaternion::LookRotation(lookDirection);
set_rotation(cameraTransform, targetRotation);
}
old_PlayerControllerLateUpdate(up);
}
Ну и в конце
DobbyHook((void *) KittyMemory::getAbsoluteAddress(oxorany("lib/arm/libil2cpp.so"), oxorany(0x63BF64)), (void *) PlayerControllerLateUpdate, (void **) &old_PlayerControllerLateUpdate);
// Получение поворота
get_rotation = (Quaternion(*)(void*))getAbsoluteAddress("libil2cpp.so", 0xC1AB78);
// Установка поворота
set_rotation = (void(*)(void*, Quaternion))getAbsoluteAddress("libil2cpp.so", 0xC1AC60);
set_TpsView3 = (void (*)(void*)) getAbsoluteAddress(oxorany("lib/arm/libil2cpp.so"), oxorany(0x639FA8));
Спасибо @sairakss
04 8月 2025, 13:33
