From 1d1b9ed9f7f6b6da8233ad77d5122e35eb496cba Mon Sep 17 00:00:00 2001 From: Adam Mathieson Date: Fri, 15 Apr 2022 01:53:03 +0200 Subject: [PATCH] + Camera Struct + D3DXPlane Struct --- OmsiHook/D3DStructs.cs | 4 + OmsiHook/OmsiCamera.cs | 241 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 245 insertions(+) diff --git a/OmsiHook/D3DStructs.cs b/OmsiHook/D3DStructs.cs index 39a4a03..23c1e69 100644 --- a/OmsiHook/D3DStructs.cs +++ b/OmsiHook/D3DStructs.cs @@ -24,4 +24,8 @@ public struct OmsiPoint { public int x, y; } + public struct D3DXPlane + { + public float a, b, c, d; + } } diff --git a/OmsiHook/OmsiCamera.cs b/OmsiHook/OmsiCamera.cs index 873e837..98e0d4c 100644 --- a/OmsiHook/OmsiCamera.cs +++ b/OmsiHook/OmsiCamera.cs @@ -11,5 +11,246 @@ public string Name get => omsiMemory.ReadMemoryString(baseAddress + 0x4); set => omsiMemory.WriteMemory(baseAddress + 0x4, value); } + public float Ratio + { + get => omsiMemory.ReadMemory(baseAddress + 0x8); + set => omsiMemory.WriteMemory(baseAddress + 0x8, value); + } + public float NearZ + { + get => omsiMemory.ReadMemory(baseAddress + 0xc); + set => omsiMemory.WriteMemory(baseAddress + 0xc, value); + } + public float FarZ + { + get => omsiMemory.ReadMemory(baseAddress + 0x10); + set => omsiMemory.WriteMemory(baseAddress + 0x10, value); + } + public float Z_Offset + { + get => omsiMemory.ReadMemory(baseAddress + 0x14); + set => omsiMemory.WriteMemory(baseAddress + 0x14, value); + } + public bool Mirror + { + get => omsiMemory.ReadMemory(baseAddress + 0x18); + set => omsiMemory.WriteMemory(baseAddress + 0x18, value); + } + public float Angle_HDG + { + get => omsiMemory.ReadMemory(baseAddress + 0x1c); + set => omsiMemory.WriteMemory(baseAddress + 0x1c, value); + } + public float Angle_HGT + { + get => omsiMemory.ReadMemory(baseAddress + 0x20); + set => omsiMemory.WriteMemory(baseAddress + 0x20, value); + } + public float Dist + { + get => omsiMemory.ReadMemory(baseAddress + 0x24); + set => omsiMemory.WriteMemory(baseAddress + 0x24, value); + } + public float Angle_HDG_Render + { + get => omsiMemory.ReadMemory(baseAddress + 0x28); + set => omsiMemory.WriteMemory(baseAddress + 0x28, value); + } + public float Angle_HGT_Render + { + get => omsiMemory.ReadMemory(baseAddress + 0x2c); + set => omsiMemory.WriteMemory(baseAddress + 0x2c, value); + } + public float Dist_Render + { + get => omsiMemory.ReadMemory(baseAddress + 0x30); + set => omsiMemory.WriteMemory(baseAddress + 0x30, value); + } + + /// + /// Field Of View + /// + public float Sichtwinkel_Render + { + get => omsiMemory.ReadMemory(baseAddress + 0x34); + set => omsiMemory.WriteMemory(baseAddress + 0x34, value); + } + public float Sichtwinkel + { + get => omsiMemory.ReadMemory(baseAddress + 0x38); + set => omsiMemory.WriteMemory(baseAddress + 0x38, value); + } + public D3DMatrix MatView + { + get => omsiMemory.ReadMemory(baseAddress + 0x3c); + set => omsiMemory.WriteMemory(baseAddress + 0x3c, value); + } + public D3DMatrix MatProj + { + get => omsiMemory.ReadMemory(baseAddress + 0x7c); + set => omsiMemory.WriteMemory(baseAddress + 0x7c, value); + } + public D3DMatrix MatView_Calc + { + get => omsiMemory.ReadMemory(baseAddress + 0xbc); + set => omsiMemory.WriteMemory(baseAddress + 0xbc, value); + } + public D3DMatrix MatProj_Calc + { + get => omsiMemory.ReadMemory(baseAddress + 0xfc); + set => omsiMemory.WriteMemory(baseAddress + 0xfc, value); + } + public D3DVector Cam_CenterPoint + { + get => omsiMemory.ReadMemory(baseAddress + 0x13c); + set => omsiMemory.WriteMemory(baseAddress + 0x13c, value); + } + public D3DVector Cam_Pos + { + get => omsiMemory.ReadMemory(baseAddress + 0x148); + set => omsiMemory.WriteMemory(baseAddress + 0x148, value); + } + public D3DVector Cam_Dir + { + get => omsiMemory.ReadMemory(baseAddress + 0x154); + set => omsiMemory.WriteMemory(baseAddress + 0x154, value); + } + public D3DVector Cam_Up + { + get => omsiMemory.ReadMemory(baseAddress + 0x160); + set => omsiMemory.WriteMemory(baseAddress + 0x160, value); + } + public D3DVector Cam_CenterPoint_Calc + { + get => omsiMemory.ReadMemory(baseAddress + 0x16c); + set => omsiMemory.WriteMemory(baseAddress + 0x16c, value); + } + public D3DVector Cam_Pos_Calc + { + get => omsiMemory.ReadMemory(baseAddress + 0x178); + set => omsiMemory.WriteMemory(baseAddress + 0x178, value); + } + public D3DVector Cam_Dir_Calc + { + get => omsiMemory.ReadMemory(baseAddress + 0x184); + set => omsiMemory.WriteMemory(baseAddress + 0x184, value); + } + public D3DVector Cam_Up_Calc + { + get => omsiMemory.ReadMemory(baseAddress + 0x190); + set => omsiMemory.WriteMemory(baseAddress + 0x190, value); + } + public bool CenterPoint_Global_OK + { + get => omsiMemory.ReadMemory(baseAddress + 0x19c); + set => omsiMemory.WriteMemory(baseAddress + 0x19c, value); + } + public D3DVector CenterPoint_Global + { + get => omsiMemory.ReadMemory(baseAddress + 0x19d); + set => omsiMemory.WriteMemory(baseAddress + 0x19d, value); + } + public D3DMatrix CamPntMatrix + { + get => omsiMemory.ReadMemory(baseAddress + 0x1a9); + set => omsiMemory.WriteMemory(baseAddress + 0x1a9, value); + } + public D3DMatrix CamPntMatrix_Calc + { + get => omsiMemory.ReadMemory(baseAddress + 0x1e9); + set => omsiMemory.WriteMemory(baseAddress + 0x1e9, value); + } + + + // TODO: VFDPlane_Render - struct D3DXPlane[6] @ 0x229 + /*public D3DXPlane[] VFDPlane_Render + { + get => omsiMemory.ReadMemory(baseAddress + 0x229); + set => omsiMemory.WriteMemory(baseAddress + 0x229, value); + }*/ + // TODO: VFDPlane_Calc - struct D3DXPlane[6] @ 0x289 + /*public D3DXPlane[] VFDPlane_Calc + { + get => omsiMemory.ReadMemory(baseAddress + 0x289); + set => omsiMemory.WriteMemory(baseAddress + 0x289, value); + }*/ + + + public D3DVector Pos + { + get => omsiMemory.ReadMemory (baseAddress + 0x2e9); + set => omsiMemory.WriteMemory(baseAddress + 0x2e9, value); + } + public D3DVector Pos_Render + { + get => omsiMemory.ReadMemory (baseAddress + 0x2f5); + set => omsiMemory.WriteMemory(baseAddress + 0x2f5, value); + } + public float Angle_HDG_Norm + { + get => omsiMemory.ReadMemory(baseAddress + 0x304); + set => omsiMemory.WriteMemory(baseAddress + 0x304, value); + } + public float Angle_HGT_Norm + { + get => omsiMemory.ReadMemory(baseAddress + 0x308); + set => omsiMemory.WriteMemory(baseAddress + 0x308, value); + } + public D3DVector Pos_Norm + { + get => omsiMemory.ReadMemory(baseAddress + 0x30c); + set => omsiMemory.WriteMemory(baseAddress + 0x30c, value); + } + public bool ConstDist + { + get => omsiMemory.ReadMemory(baseAddress + 0x318); + set => omsiMemory.WriteMemory(baseAddress + 0x318, value); + } + /// + /// Field Of View + /// + public float Sichtwinkel_Norm + { + get => omsiMemory.ReadMemory(baseAddress + 0x31c); + set => omsiMemory.WriteMemory(baseAddress + 0x31c, value); + } + public D3DVector Dir_Vec_Norm + { + get => omsiMemory.ReadMemory(baseAddress + 0x320); + set => omsiMemory.WriteMemory(baseAddress + 0x320, value); + } + public D3DMatrix Local_Coord + { + get => omsiMemory.ReadMemory(baseAddress + 0x32c); + set => omsiMemory.WriteMemory(baseAddress + 0x32c, value); + } + public D3DMatrix Transform + { + get => omsiMemory.ReadMemory(baseAddress + 0x330); + set => omsiMemory.WriteMemory(baseAddress + 0x330, value); + } + public D3DMatrix Transform_Render + { + get => omsiMemory.ReadMemory(baseAddress + 0x334); + set => omsiMemory.WriteMemory(baseAddress + 0x334, value); + } + public D3DMatrix Local_Coord_Render + { + get => omsiMemory.ReadMemory(baseAddress + 0x374); + set => omsiMemory.WriteMemory(baseAddress + 0x374, value); + } + public D3DMatrix NullMatrix + { + get => omsiMemory.ReadMemory(baseAddress + 0x3b4); + set => omsiMemory.WriteMemory(baseAddress + 0x3b4, value); + } + /// + /// Floor Height + /// + public float Bodenhoehe + { + get => omsiMemory.ReadMemory(baseAddress + 0x3f4); + set => omsiMemory.WriteMemory(baseAddress + 0x3f4, value); + } } } \ No newline at end of file