summaryrefslogtreecommitdiff
path: root/src/KingSystem/Physics/StaticCompound/physStaticCompoundInfo.h
blob: dfd31ed997fa179fa1e64b1cba342681a861f93f (plain)
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
60
61
62
63
64
#pragma once

#include <Havok/Common/Base/hkBase.h>
#include "KingSystem/Physics/physDefines.h"

class hkTypeInfo;

namespace ksys::phys {

enum class BodyLayerType {
    EntityGround,
    EntityGroundSmooth,
    EntityGroundRough,
    EntityObject,
    EntityGroundObject,
    EntityTree,
    SensorInDoor,
    EntityNoHit,
    EntityWallForClimb,
    EntityWater,
    Invalid = -1,
};
constexpr int NumBodyLayerTypes = 10;

struct ShapeInfo {
    HK_DECLARE_REFLECTION()

    hkInt32 m_ActorInfoIndex;
    hkInt32 m_InstanceId;
    hkInt8 m_BodyGroup;
    hkUint8 m_BodyLayerType;
};
extern const hkClass ShapeInfo_Class;
extern const hkTypeInfo ShapeInfo_TypeInfo;

struct ActorInfo {
    HK_DECLARE_REFLECTION()

    hkUint32 m_HashId;
    hkInt32 m_SRTHash;
    hkInt32 m_ShapeInfoStart;
    hkInt32 m_ShapeInfoEnd;
};
extern const hkClass ActorInfo_Class;
extern const hkTypeInfo ActorInfo_TypeInfo;

struct StaticCompoundInfo {
    HK_DECLARE_REFLECTION()

    int getActorIdx(u32 hash_id, u32 srt_hash) const;
    int getShapeInfoStart(int actor_idx) const;
    int getShapeInfoEnd(int actor_idx) const;
    const ShapeInfo* getShapeInfo(int shape_idx) const;

    hkUint32 m_Offset;
    hkArray<ActorInfo> m_ActorInfo;
    hkArray<ShapeInfo> m_ShapeInfo;
};
extern const hkClass StaticCompoundInfo_Class;
extern const hkTypeInfo StaticCompoundInfo_TypeInfo;

BodyLayerType getBodyLayerType(ContactLayer layer);

}  // namespace ksys::phys