Editor use vtx collision

This commit is contained in:
MegaMech
2025-02-28 17:31:24 -07:00
parent 08f0d261d1
commit 7a31679c2d
17 changed files with 405 additions and 95 deletions
+26
View File
@@ -7,6 +7,29 @@ extern "C" {
#include "common_structs.h"
}
enum class CollisionType {
VTX_INTERSECT,
BOUNDING_BOX,
BOUNDING_SPHERE
};
struct Ray {
FVector Origin;
FVector Direction;
};
struct Triangle {
FVector v0, v1, v2;
};
struct GameObject {
FVector* Pos;
Gfx* Model;
std::vector<Triangle> Triangles;
CollisionType Collision;
float BoundingBoxSize;
};
/**
* Projects 2D cursor into the game world
*
@@ -23,4 +46,7 @@ s32 Inverse(MtxF* src, MtxF* dest);
void Copy(MtxF* src, MtxF* dest);
void Clear(MtxF* mf);
bool IntersectRayTriangle(const Ray& ray, const Triangle& tri, float& t);