Game Entity (BO2)

From COD Engine Research
Jump to: navigation, search
enum entityType_t
{
	ET_GENERAL = 0x0,
	ET_PLAYER = 0x1,
	ET_PLAYER_CORPSE = 0x2,
	ET_ITEM = 0x3,
	ET_MISSILE = 0x4,
	ET_INVISIBLE = 0x5,
	ET_SCRIPTMOVER = 0x6,
	ET_SOUND_BLEND = 0x7,
	ET_FX = 0x8,
	ET_LOOP_FX = 0x9,
	ET_PRIMARY_LIGHT = 0xA,
	ET_TURRET = 0xB,
	ET_HELICOPTER = 0xC,
	ET_PLANE = 0xD,
	ET_VEHICLE = 0xE,
	ET_VEHICLE_CORPSE = 0xF,
	ET_ACTOR = 0x10,
	ET_ACTOR_SPAWNER = 0x11,
	ET_ACTOR_CORPSE = 0x12,
	ET_STREAMER_HINT = 0x13,
	ET_ZBARRIER = 0x14,
};
 
struct trajectory_t
{
	char trType; //0x0
	int trTime; //0x4
	int trDuration; //0x8
	vec3_t trBase; //0xC
	vec3_t trDelta; //0x18
};
 
struct LerpEntityStatePlayer
{
	float leanf; //0x0
	int movementDir; //0x4
	int moveType; //0x8
	int primaryWeapon; //0xC
	int stowedWeapon; //0x10
	int offhandWeapon; //0x14
	int meleeWeapon; //0x18
	char meleeWeaponCamo; //0x1C
	char meleeWeaponModel; //0x1D
	char vehicleType; //0x1E
	char vehicleAnimBoneIndex; //0x1F
	char vehicleSeat; //0x20
	char stowedWeaponCamo; //0x21
	char weaponHeat; //0x22
	char proneLegsAngle; //0x23
};
 
struct LerpEntityStateMissile
{
	int launchTime; //0x0
	int parentClientNum; //0x4
	int fuseTime; //0x8
	int forcedDud; //0xC
	int autoDetonateTime; //0x10
};
 
struct LerpEntityStateAnonymous
{
	int data[8]; //0x0
};
 
struct LerpEntityStateLoopFx
{
	float cullDist; //0x0
	int period; //0x4
};
 
struct LerpEntityStateTurret
{
	float gunAngles[3]; //0x0
	int ownerNum; //0xC
	int heatVal; //0x10
	int overheating; //0x14
	int pivotOffset; //0x18
	int flags; //0x1C
};
 
struct LerpEntityStateVehicle
{
	float steerYaw; //0x0
	float bodyRoll; //0x4
	struct
	{
		short pitch;
		short yaw;
	}gunnerAngles[4]; //0x8
	short throttle; //0x18
	short gunPitch; //0x1A
	short gunYaw; //0x1C
	char targetRotorSpeed; //0x1E
};
 
struct LerpEntityStateActor
{
	struct
	{
		int actornum;
	}index; //0x0
	int species; //0x4
	int team; //0x8
	int enemy; //0xC
	int freeCameraLockOnAllowed; //0x10
	struct
	{
		short fBodyPitch;
	}proneInfo;//0x14
	short aiType; //0x16
};
 
struct LerpEntityStateScriptMover
{
	char attachTagIndex[4]; //0x0
	int attachedTagIndex; //0x4
	short attachModelIndex[4]; //0x8
	short animScriptedAnim; //0x10
	short attachedEntNum; //0x12
	int attachedEntTime; //0x14
	short exploderIndex; //0x18
		char unk0[2]; //0x1A
	char flags; //0x1C
		char unk1[1]; //0x1D
	short aiType; //0x1E
};
 
struct LerpEntityStateZBarrier
{
	int barrierTypeIndex; //0x0
	struct
	{
		char flags;
		char animTime;
	}pieces[6]; //0x4
};
 
union LerpEntityStateTypeUnion
{
	LerpEntityStatePlayer player;
	LerpEntityStateMissile missile;
	LerpEntityStateAnonymous anonymous;
	LerpEntityStateLoopFx loopFx;
	LerpEntityStateTurret turret;
	LerpEntityStateVehicle vehicle;
	LerpEntityStateActor actor;
	LerpEntityStateScriptMover scriptMover;
	LerpEntityStateZBarrier zbarrier;
};
 
struct LerpEntityState
{
	int eFlags; //0x0
	int eFlags2; //0x4
	trajectory_t pos;//0x8
	trajectory_t apos;//0x2C
	LerpEntityStateTypeUnion u; //0x50
	short useCount; //0x74
	short faction; //0x76
	int clientFields; //0x78  ? might be a struct of size 4
};
 
struct entityState_s
{
	int number; //0x0
	LerpEntityState lerp; //0x4
	int time2; //0x80
	int loopSoundId; //0x84
	int solid; //0x88
	int renderOptions; //0x8C
	union
	{
		struct
		{
			int legsAnim; //0x90
			int torsoAnim; //0x94
			float fTorsoPitch; //0x98
			float fWaistPitch; //0x9C
		}anim;
		struct
		{
			char fov; //0x90
			char treeId; //0x91
			char animId; //0x92
		}moverState;
		struct
		{
			short flags; //0x90
			char vehicleDefIndex; //0x92
			char treeId; //0x93
			short animId; //0x94
			short attachModelIndex[2]; //0x96
			char attachTagIndex[2]; //0x9A
		}vehicleState;
		struct
		{
			short state; //0x90
			char subState; //0x92
			float fLeanAmount; //0x94
			float fAimUpDown; //0x98
			float fAimLeftRight; //0x9C
		}animState;
	}un2; //0x90
	union
	{
		char unk0[4]; //0xA0
	}un3; //0xA0
	int partBits[5]; //0xA4
	int clientLinkInfo; //0xB8
		char unk1[4]; //0xBC
	char events[4]; //0xC0
	int eventParms[4]; //0xC4
	unsigned int eventParm; //0xD4
	short eType; //0xD8 entityType_t
	short groundEntityNum; //0xDA
	union
	{
		char unk2[2]; //0xDC
	}index; //0xDC
	short otherEntityNum; //0xDE
	short attackerEntityNum; //0xE0
	short enemyModel; //0xE2
	int weapon; //0xE4
	int lastStandPrevWeapon; //0xE8
	unsigned short targetname; //0xEC
	short loopSoundFade; //0xEE
	short eventSequence; //0xF0
	char surfType; //0xF2
	char clientNum; //0xF3
	char iHeadIcon; //0xF4
	char weaponModel; //0xF5
	union
	{
		char hintString; //0xF6
		char helicopterStage; //0xF6
		char eventParm2; //0xF6
	}un1; // 0xF6
};
 
struct entityShared_t //creds to aero
{
	char linked; //0x0
	char bmodel; //0x1
	char svFlags; //0x2
	char inuse; //0x3
	int broadcastTime; //0x4
	float mins[3]; //0x8
	float maxs[3]; //0x14
	int contents; //0x20
	float absmin[3]; //0x24
 	float absmax[3]; //0x30
	float currentOrigin[3]; //0x3C
	float currentAngles[3]; //0x48
	int ownerNum; //0x54
	int eventTime; //0x58
};
 
struct turretInfo_s
{
		char unk0[8]; //0x0
	int flags; //0x8
		char unk1[0]; //0xC haven't looked for the size
};
 
struct gentity_s
{
	entityState_s s; //0x0
	entityShared_t r; //0xF8
	gclient_s* client; //0x154
		void *actor; //0x158
		void *sentient;
	turretInfo_s* pTurretInfo; //0x160
		void *destructible; //0x164
	scr_vehicle_s *scr_vehicle; //0x168
	uint16_t model; //0x16C
	char physicsObject; //0x16E
	char takedamage; //0x16F
		char unk2[6]; //0x170
	uint16_t classname; //0x176
	uint16_t target; //0x178
	uint16_t targetname; //0x17A
	uint16_t script_noteworthy; //0x17C
		char unk3[6]; //0x17E
	int spawnflags; //0x184
	int flags; //0x188
	int eventTime; //0x18C
		char unk4[0x18]; //0x190
	int health; //0x1A8
	int maxhealth; //0x1AC
	int dmg; //0x1B0
		char unk5[0x74]; //0x1B4
	int count; //0x228
		char unk6[0x14]; //0x22C
	int index; //0x240
	float lerp_to_lighter; //0x244
	float lerp_to_darker; //0x248
		char unk7[0x60]; //0x24C
	uint16_t attacModelNames[19]; // 0x2AC
	uint16_t attachTagNames[19]; // 0x2D2
		char unk8[0x18]; // 0x2F8
	int birthtime; //0x310
		char unk9[8]; //0x314
};