include "Math/Vec3f.fbs";
include "Math/PackedVec3f.fbs";

namespace pkNX.Structures.FlatBuffers.SV.Trinity;
attribute "fs_serializer";

table Sphere {
    TrcolFilePath:string (required);
    Field_01:PackedVec3f (required);
    Field_02:PackedVec3f (required);
    Field_03:PackedVec3f (required);
}

table Box {
    // Just a box. No TrcolFilePath.
    Field_01:PackedVec3f (required);
    Field_02:PackedVec3f (required);
    Field_03:PackedVec3f (required);
}

table Capsule {
    TrcolFilePath:string (required);
    Field_01:PackedVec3f (required);
    Field_02:PackedVec3f (required);
    Field_03:PackedVec3f (required);
}

table Havok {
    TrcolFilePath:string (required);
    Field_01:PackedVec3f (required);
    Field_02:PackedVec3f (required);
    Field_03:PackedVec3f (required);
}

table Vec3f {
    X:float;
    Y:float;
    Z:float;
}

union CollisionUnion {Sphere, Box, Capsule, Havok}

table CollisionComponent (fs_serializer) {
    Shape:CollisionUnion (required);
    // field 01 is the object ptr for ^
    Field_02:uint;
    Field_03:byte;
    Field_04:uint;
    Field_05:uint;
    Field_06:uint;
    Field_07:uint;
    Field_08:Vec3f (required);
    Field_09:string (required);
    Field_0A:uint;
    Field_0B:byte;
}

union ComponentUnion {CollisionComponent}

table TrinityComponent (fs_serializer) {
    Component:ComponentUnion (required);
}

root_type TrinityComponent;
