summaryrefslogtreecommitdiff
path: root/include/d/actor/d_a_obj_crope.h
blob: bde25e379c6f81c138ee31f338d7b9c98af00a1e (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
73
74
75
76
77
#ifndef D_A_OBJ_CROPE_H
#define D_A_OBJ_CROPE_H

#include "f_op/f_op_actor_mng.h"
#include "d/d_cc_d.h"

/**
 * @ingroup actors-objects
 * @class daObjCrope_c
 * @brief Wolf Tightrope
 *
 * @details
 *
 */
class daObjCrope_c : public fopAc_ac_c {
public:
    int createHeap();
    int create();
    ~daObjCrope_c();
    void setNormalRopePos();
    void setRideRopePos();
    int execute();
    int draw();

    cXyz* getRopeStartPos() { return mLineMat.getPos(0); }
    cXyz* getRopeEndPos() { return &mLineMat.getPos(0)[99]; }
    cXyz* getRopeVec() { return &mRopeVec; }
    cXyz& getPlayerNearPos() { return mPlayerNearPos; }
    void onOutFlg() { mOutFlg = true; }
    void setFrontJoint(int i_jointNo) { mFrontJoint = i_jointNo; }
    void setBackJoint(int i_jointNo) { mBackJoint = i_jointNo; }

    f32 getStartRate(const cXyz* param_0) {
        if (field_0x714) {
            return field_0x724 * (param_0->x - getRopeStartPos()->x);
        } else {
             return field_0x724 * (param_0->z - getRopeStartPos()->z);
         }
    }

    void rideKeep() {
        setFrontJoint(-2);
        setBackJoint(-1);
    }

    void offRide() {
        setFrontJoint(-1);
        setBackJoint(-1);
    }

    void setCoCancelTimer() {
        mCoCancelTimer = 30;
    }

private:
    /* 0x0568 */ request_of_phase_process_class mPhase;
    /* 0x0570 */ dCcD_Stts mCcStts;
    /* 0x05AC */ dCcD_Sph mCollider;
    /* 0x06E4 */ Mtx field_0x6e4;
    /* 0x0714 */ u8 field_0x714;
    /* 0x0715 */ u8 mOutFlg;
    /* 0x0716 */ u8 mCoCancelTimer;
    /* 0x0718 */ int mFrontJoint;
    /* 0x071C */ int mBackJoint;
    /* 0x0720 */ f32 field_0x720;
    /* 0x0724 */ f32 field_0x724;
    /* 0x0728 */ cXyz mRopeVec;
    /* 0x0734 */ cXyz mPlayerNearPos;
    /* 0x0740 */ cXyz field_0x740[98];
    /* 0x0BD8 */ cXyz field_0xbd8[98];
    /* 0x1070 */ mDoExt_3DlineMat1_c mLineMat;
};

STATIC_ASSERT(sizeof(daObjCrope_c) == 0x10ac);


#endif /* D_A_OBJ_CROPE_H */