summaryrefslogtreecommitdiff
path: root/include/d/snd/d_snd_3d_manager.h
blob: af45af62d967463505a68b84c26410cdc12efa05 (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
#ifndef D_SND_3D_MANAGER_H
#define D_SND_3D_MANAGER_H

#include "d/snd/d_snd_3d_engine.h"
#include "d/snd/d_snd_util.h"
#include "egg/gfx/eggCamera.h"
#include "nw4r/math/math_types.h"
#include "nw4r/snd/snd_Sound3DListener.h"
#include "nw4r/snd/snd_Sound3DManager.h"

SND_DISPOSER_FORWARD_DECL(dSnd3DManager_c);

class dSnd3DManager_c {
    SND_DISPOSER_MEMBERS(dSnd3DManager_c);

public:
    dSnd3DManager_c();

    void setup();
    void updateFromCamera(EGG::LookAtCamera &camera);
    void setCamDistance(f32 value);
    void resetCamDistance();
    void calc();
    void clearState();

    nw4r::snd::Sound3DManager &getManager() {
        return mManager;
    }

    const nw4r::math::VEC3 &getCameraTargetPos() const {
        return mCameraTargetPosition;
    }

    const nw4r::math::VEC3 &getNrmCameraDirection() const {
        return mCameraDirectionNormalized;
    }

    const nw4r::math::VEC3 &getSndListenerPos() const {
        return mListener.GetPosition();
    }

    const nw4r::math::MTX34 &getSndListenerMatrix() const {
        return mListener.GetMatrix();
    }

private:
    void updateListenerPos(f32);
    /* 0x010 */ bool mIsSetup;
    /* 0x011 */ bool mCalculationsFresh;
    /* 0x014 */ dSnd3DEngine_c *mpEngine;
    /* 0x018 */ nw4r::snd::Sound3DManager mManager;
    /* 0x044 */ nw4r::snd::Sound3DListener mListener;
    /* 0xB0 */ EGG::LookAtCamera mCamera;
    /* 0x138 */ nw4r::math::VEC3 mCameraDirectionNormalized;
    /* 0x144 */ nw4r::math::VEC3 mCameraTargetPosition;
    /* 0x150 */ f32 mCameraPosSqVelocity;
    /* 0x154 */ f32 mCameraAtSqVelocity;
    /* 0x158 */ f32 mCamDistance;
    /* 0x15C */ s16 mTimer;
};

#endif