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

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

#include "src/port/ui/DefaultProperties.h"

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

struct Triangle;

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

        GameObject(FVector pos, IRotator rot, FVector scale, const char* model, std::vector<Triangle> triangles, CollisionType collision, float boundingBoxSize);
        GameObject();
        virtual ~GameObject() = default;
        virtual void Tick();
        virtual void Draw();
        virtual void Load() {};
        FVector GetLocation() const;
        IRotator GetRotation() const;
        FVector GetScale() const;
        void Translate(FVector pos);
        void Rotate(IRotator rot);
        void SetScale(FVector scale);
        void Destroy() {};

        const char* Name;
        const char* ResourceName;
        FVector SpawnPos = {0.0f, 0.0f, 0.0f};
        IRotator SpawnRot = {0, 0, 0};
        FVector SpawnScale = {1.0f, 1.0f, 1.0f};
        float Speed;
        FVector Pos;
        IRotator Rot;
        FVector Scale;
        const char* Model = "";
        std::vector<Triangle> Triangles;
        CollisionType Collision;
        float BoundingBoxSize;
        virtual void DrawEditorProperties() { DrawDefaultEditorProperties(); };
    };
}