Ejemplo n.º 1
0
        public void EnableFreeCameraControls()
        {
            Injection.InjectionEntryPoint.HideCursor();

            coordinatesFuncBytes = MemoryManipulator.Read(CAMERA_COORDINATES_UPDATE_FUNC_ADDRESS, 2);
            MemoryManipulator.Write(CAMERA_COORDINATES_UPDATE_FUNC_ADDRESS, Assembly.GetPaddedReturnInstructions(1));

            focusCoordinatesFuncBytes = MemoryManipulator.Read(CAMERA_FOCUS_COORDINATES_UPDATE_FUNC_ADDRESS, 2);
            MemoryManipulator.Write(CAMERA_FOCUS_COORDINATES_UPDATE_FUNC_ADDRESS, Assembly.GetPaddedReturnInstructions(1));

            slantFuncBytes = MemoryManipulator.Read(CAMERA_SLANT_UPDATE_FUNC_ADDRESS, 8);
            MemoryManipulator.Write(CAMERA_SLANT_UPDATE_FUNC_ADDRESS, Assembly.GetPaddedReturnInstructions(7));

            fovFuncBytes = MemoryManipulator.Read(CAMERA_FOV_UPDATE_FUNC_ADDRESS, 7);
            MemoryManipulator.Write(CAMERA_FOV_UPDATE_FUNC_ADDRESS, Assembly.GetPaddedReturnInstructions(6));

            ReadDivaCameraData();

            CameraVerticalRotation = MathHelper.AngleFromPoints(
                CameraData.X, CameraData.Z,
                CameraData.FocusX, CameraData.FocusZ);

            CameraHorizontalRotation = 0f;
            CameraSlant = 0f;
        }