#ifndef QCOMMON_Q_COLLISION_TYPES_H
#define QCOMMON_Q_COLLISION_TYPES_H

#include <stddef.h>
#include <stdint.h>

#include "q_vector_types.h"

/* Canonical Quake collision-plane record.  All authoritative CoD:UO engine
 * and module bodies use this 0x14-byte layout and the signbits byte at +0x11. */
typedef struct cplane_s {
    vec3_t normal;
    float dist;
    uint8_t type;
    uint8_t signbits;
    uint8_t pad[2];
} cplane_t;

typedef char q_collision_cplane_normal_offset[
    offsetof(cplane_t, normal) == 0x00 ? 1 : -1];
typedef char q_collision_cplane_dist_offset[
    offsetof(cplane_t, dist) == 0x0c ? 1 : -1];
typedef char q_collision_cplane_type_offset[
    offsetof(cplane_t, type) == 0x10 ? 1 : -1];
typedef char q_collision_cplane_signbits_offset[
    offsetof(cplane_t, signbits) == 0x11 ? 1 : -1];
typedef char q_collision_cplane_size[sizeof(cplane_t) == 0x14 ? 1 : -1];

#endif
