Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum ObjectType_t {
- TYPE_PLAYER = 4,
- TYPE_OFFROADER = 17,
- TYPE_DEER = 19,
- TYPE_WOLF = 20,
- TYPE_RAVEN = 89,
- TYPE_ZOMBIE = 91,
- TYPE_PICKUP = 114
- };
- class CGameClient;
- class CGraphics;
- class CObject;
- class CCamera;
- class CCameraMatrix;
- class CDisplay;
- class CGameClient {
- public:
- char __pad0[0x1020];
- __int32 m_nObjectListSize; // 0x1020
- char __pad1[0x1B4];
- CObject* m_pFirstObject; // 0x11D8
- };
- class CObject {
- public:
- char __pad0[0x1D0];
- Vector3 m_vOrigin; // 0x01D0
- char __pad1[0x24];
- Vector3 m_vVelocity; // 0x0200
- char __pad2[0x144];
- CObject* m_pNextObject; // 0x0350
- char __pad3[0x74];
- char m_pName[32]; // 0x03CC
- char __pad4[0x114];
- int m_nType; // 0x0500
- };
- class CCameraMatrix {
- public:
- char __pad0[0x1A0];
- Matrix4x4 m_Matrix; // 0x01B0
- };
- class CCamera {
- public:
- char __pad0[0x20];
- CCameraMatrix* m_pCameraMatrix; // 0x20
- };
- class CDisplay {
- public:
- char __pad0[0x588];
- IDirect3D9* m_pDirect3D; // 0x0588
- char __pad1[0x130];
- IDirect3DDevice9* m_pDevice; // 0x06C0
- };
- class CGraphics {
- public:
- char __pad0[0x28];
- int m_nScreenWidth; // 0x0028
- int m_nScreenHeight; // 0x002C
- char __pad1[0x18];
- CCamera* m_pCamera; // 0x0048
- char __pad2[0x298];
- CDisplay* m_pDisplay; // 0x02E8
- bool WorldToScreen(const Vector3& vOrigin, Vector3& vOut) {
- float world[4];
- world[0] = vOrigin.x;
- world[1] = vOrigin.y;
- world[2] = vOrigin.z;
- world[3] = 0.0f;
- int x = 0, y = 0;
- typedef bool (__thiscall* World2ScreenFn)(void*, float*, int*, int*);
- World2ScreenFn World2Screen = (World2ScreenFn)0x14030B180;
- if (!World2Screen(this, world, &x, &y)) {
- return false;
- }
- vOut.x = x;
- vOut.y = y;
- return true;
- }
- /*bool WorldToScreen(const Vector3& vOrigin, Vector3& vOut) {
- if (!m_pCamera) {
- return false;
- }
- if (!m_pCamera->m_pCameraMatrix) {
- return false;
- }
- CCameraMatrix* pCameraMatrix = (CCameraMatrix*)(m_pCamera->m_pCameraMatrix + 0x10);
- Matrix4x4 Matrix = pCameraMatrix->m_Matrix;
- Matrix.Transpose();
- Matrix._21 *= -1;
- Matrix._22 *= -1;
- Matrix._23 *= -1;
- Matrix._24 *= -1;
- float w = Matrix.GetAxis(3).Dot(vOrigin) + Matrix.m[3][3];
- if ( w < 0.098 ) {
- return false;
- }
- float x = Matrix.GetAxis(0).Dot(vOrigin) + Matrix.m[0][3];
- float y = Matrix.GetAxis(1).Dot(vOrigin) + Matrix.m[1][3];
- vOut.x = (m_nScreenWidth / 2) * (1.0 + x / w);
- vOut.y = (m_nScreenHeight / 2) * (1.0 - y / w);
- return true;
- }*/
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement