summaryrefslogtreecommitdiff
path: root/src/KingSystem/Resource/Actor/resResourceActorCapture.h
blob: eda2e6a286029d8d2eaa165f4fc8be5ee204202a (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
65
66
67
68
69
70
71
72
#pragma once

#include <math/seadVector.h>
#include <prim/seadSafeString.h>
#include <utility/aglParameter.h>
#include <utility/aglParameterObj.h>
#include "KingSystem/Resource/resResource.h"
#include "KingSystem/Utils/ParamIO.h"

namespace ksys::res {

class ActorCapture : public ParamIO, public Resource {
    SEAD_RTTI_OVERRIDE(ActorCapture, Resource)
public:
    struct ActorCaptureConstants {
        // NON_MATCHING: equivalent but reordered
        ActorCaptureConstants() {
            camera_position = {0.0, 2.0, 5.0};
            camera_direction = {0.0, 2.0, 0.0};
            light_direction = {0.5720610022544861, -0.7071070075035095, -0.41562700271606445};
            actor_position = sead::Vector3f::zero;
            actor_rotation = sead::Vector3f::zero;
        }
        sead::Vector3f camera_position;
        sead::Vector3f camera_direction;
        sead::Vector3f light_direction;
        sead::Vector3f actor_position;
        sead::Vector3f actor_rotation;
    };

    struct CameraInfo : agl::utl::ParameterObj {
        agl::utl::Parameter<sead::Vector3f> position;
        agl::utl::Parameter<sead::Vector3f> direction;
        agl::utl::Parameter<f32> fov;
        agl::utl::Parameter<f32> tilt;
    };

    struct ActorInfo : agl::utl::ParameterObj {
        agl::utl::Parameter<sead::Vector3f> position;
        agl::utl::Parameter<sead::Vector3f> rotation;
        agl::utl::Parameter<sead::FixedSafeString<32>> as_name;
        agl::utl::Parameter<bool> apply_skel_anim;
        agl::utl::Parameter<f32> frame;
        agl::utl::Parameter<bool> bounding_adjustment;
        agl::utl::Parameter<bool> force_idle;
        agl::utl::Parameter<bool> disable_cloth;
    };

    struct LightInfo : agl::utl::ParameterObj {
        agl::utl::Parameter<sead::Vector3f> direction;
    };

    ActorCapture();

    void doCreate_(u8*, u32, sead::Heap*) override {}
    bool needsParse() const override { return true; }
    bool ParamIO_m0(char* data) override { return true; }

    void reset();

    static const ActorCaptureConstants& getConstants();

    CameraInfo mCameraInfoObj;
    ActorInfo mActorInfoObj;
    LightInfo mLightInfoObj;

private:
    bool parse_(u8* data, size_t size, sead::Heap* heap) override;
};
KSYS_CHECK_SIZE_NX150(ActorCapture, 0x538);

}  // namespace ksys::res