summaryrefslogtreecommitdiffstats
path: root/src/modelinfo/PedModelInfo.h
blob: 84ada087ab982ede1e77b72bad7e6a17ce95d3a0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#pragma once

#include "ClumpModelInfo.h"
#include "PedType.h"
#include "PedStats.h"

enum PedNode {
	PED_TORSO,
	PED_MID,	// Smid on PS2/PC, Storso on mobile/xbox
	PED_HEAD,
	PED_UPPERARML,
	PED_UPPERARMR,
	PED_HANDL,
	PED_HANDR,
	PED_UPPERLEGL,
	PED_UPPERLEGR,
	PED_FOOTL,
	PED_FOOTR,
	PED_LOWERLEGR,
	PED_NODE_MAX// Not valid: PED_LOWERLEGL
};

class CPedModelInfo : public CClumpModelInfo
{
public:
	uint32 m_animGroup;
	ePedType m_pedType;
	ePedStats m_pedStatType;
	uint32 m_carsCanDrive;
	CColModel *m_hitColModel;
#ifdef PED_SKIN
	RpAtomic *m_head;
	RpAtomic *m_lhand;
	RpAtomic *m_rhand;
#endif

	static RwObjectNameIdAssocation m_pPedIds[PED_NODE_MAX];

	CPedModelInfo(void) : CClumpModelInfo(MITYPE_PED) { }
	void DeleteRwObject(void);
	void SetClump(RpClump *);

	void SetLowDetailClump(RpClump*);
	void CreateHitColModel(void);
	void CreateHitColModelSkinned(RpClump *clump);
	CColModel *GetHitColModel(void) { return m_hitColModel; }
	static CColModel *AnimatePedColModel(CColModel* colmodel, RwFrame* frame);
	CColModel *AnimatePedColModelSkinned(RpClump *clump);

#ifdef PED_SKIN
	static RpAtomic *findLimbsCb(RpAtomic *atomic, void *data);
	RpAtomic *getHead(void) { return m_head; }
	RpAtomic *getLeftHand(void) { return m_lhand; }
	RpAtomic *getRightHand(void) { return m_rhand; }
#endif
};
#ifndef PED_SKIN
VALIDATE_SIZE(CPedModelInfo, 0x48);
#endif