-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwing.h
More file actions
48 lines (37 loc) · 890 Bytes
/
wing.h
File metadata and controls
48 lines (37 loc) · 890 Bytes
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
#ifndef WING_INCLUDED
#define WING_INCLUDED
#include "SM64DS_PI.h"
#include <span>
class Wing
{
static SharedFilePtr modelFile;
const Vector3& pos;
short rowTimer = RandomInt() & 0x3f;
CommonModel model;
public:
explicit Wing(const Vector3& pos) : pos(pos) {}
enum UpdateFlags
{
flutter = 1 << 0,
mirrorSound = 1 << 1,
noWingSound = 1 << 2
};
void Update(unsigned flags);
void Update(unsigned flags, const Vector3& soundOffset);
void Render(const Vector3* offsetsBegin, const Vector3* offsetsEnd, const Vector3& scale);
template<Fix12i scale>
void Render(const Vector3* offsetsBegin, const Vector3* offsetsEnd)
{
static constexpr Vector3 scaleVec = {scale, scale, scale};
Render(offsetsBegin, offsetsEnd, scaleVec);
}
void SetFile()
{
model.SetFile(modelFile.LoadBMD(), 1, -1);
}
static void ReleaseFile()
{
modelFile.Release();
}
};
#endif