summaryrefslogtreecommitdiff
path: root/src/KingSystem/Physics/System/physParamSet.h
blob: c50fe5f5264f0c53d2f1cfc46d79623b6be080e7 (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
#pragma once

#include <container/seadBuffer.h>
#include <utility/aglParameter.h>
#include <utility/aglParameterList.h>
#include <utility/aglParameterObj.h>

namespace ksys::res {
class Physics;
}

namespace ksys::phys {

struct RigidBodySetParam;
struct CharacterControllerParam;
struct ClothSetParam;
struct RagdollParam;
struct SupportBoneParam;
struct ContactInfoParam;
struct EdgeRigidBodySetParam;

struct ParamSet : public agl::utl::ParameterList {
    ParamSet();
    ~ParamSet() override;
    ParamSet(const ParamSet&) = delete;
    auto operator=(const ParamSet&) = delete;

    bool parse(res::Physics* bphysics, agl::utl::ResParameterArchive archive, sead::Heap* heap);

    RigidBodySetParam& getRigidBodySet(int idx);

    sead::Buffer<RigidBodySetParam> rigid_body_sets{};
    CharacterControllerParam* character_controller{};
    ClothSetParam* cloth_set{};
    RagdollParam* ragdoll{};
    SupportBoneParam* support_bone{};
    ContactInfoParam* contact_info{};
    EdgeRigidBodySetParam* edge_rigid_body_set{};

    agl::utl::ParameterObj obj;
    agl::utl::Parameter<int> use_rigid_body_set_num;
    agl::utl::Parameter<bool> use_character_controller;
    agl::utl::Parameter<bool> use_ragdoll;
    agl::utl::Parameter<bool> use_support_bone;
    agl::utl::Parameter<bool> use_cloth;
    agl::utl::Parameter<bool> use_contact_info;
    agl::utl::Parameter<bool> use_system_group_handler;
    agl::utl::Parameter<int> use_edge_rigid_body_num;
    int num_rigid_bodies_with_link_matrix = 0;

private:
    void finalize();
    bool doParse(res::Physics* bphysics, agl::utl::ResParameterArchive archive, sead::Heap* heap);
};

}  // namespace ksys::phys