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

#include <libultraship/libultraship.h>
#include <libultra/gbi.h>
#include "GameObject.h"
#include "engine/Actor.h"
#include "engine/objects/Object.h"

#include "EditorMath.h"

/**
 * @file Editor Collision
 * 
 * Most actors use cylinder collision. 
 * Proper vtx intersection tests are necessary for object picking
 * 
 * Therefore, generate a full collision mesh for actors
 */

#define EDITOR_GFX_GET_OPCODE(var) ((uint32_t) ((var) & 0xFF000000))

namespace TrackEditor {
    void GenerateCollisionMesh(std::variant<AActor*, OObject*, GameObject*> object, Gfx* model, float scale);
    void DebugCollision(GameObject* obj, FVector pos, IRotator rot, FVector scale, const std::vector<Triangle>& triangles);
}