summaryrefslogtreecommitdiff
path: root/src/engine/editor/GameObject.h
blob: a8e269df95bb1d433f3ff753bef0d886e3092ed9 (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
#pragma once

#include <libultraship/libultraship.h>
#include <libultra/gbi.h>
#include <libultra/types.h>
#include "../CoreMath.h"
#include "EditorMath.h"
#include <vector>

extern "C" {
#include "common_structs.h"
}

struct Triangle;

namespace Editor {
class GameObject {
  public:
    enum class CollisionType { VTX_INTERSECT, BOUNDING_BOX, BOUNDING_SPHERE };

    GameObject(const char* name, FVector* pos, IRotator* rot, FVector* scale, Gfx* model,
               std::vector<Triangle> triangles, CollisionType collision, float boundingBoxSize, int32_t* despawnFlag,
               int32_t despawnValue);
    GameObject(FVector* pos, Vec3s* rot);
    GameObject();
    virtual void Tick();
    virtual void Draw();
    virtual void Load() {};

    const char* Name;
    FVector* Pos;
    IRotator* Rot;
    FVector* Scale;
    Gfx* Model;
    std::vector<Triangle> Triangles;
    CollisionType Collision;
    float BoundingBoxSize;
    int32_t* DespawnFlag;
    int32_t DespawnValue;
};
} // namespace Editor