1 
2 #ifndef ENGINE_BASE_TYPES_H
3 #define ENGINE_BASE_TYPES_H
4 
5 #include <stdint.h>
6 
7 #define OBJECT_STATIC_MESH                      (0x0001)
8 #define OBJECT_ROOM_BASE                        (0x0002)
9 #define OBJECT_ENTITY                           (0x0003)
10 #define OBJECT_HAIR                             (0x0004)
11 #define OBJECT_BULLET_MISC                      (0x7FFF)
12 
13 #define COLLISION_SHAPE_BOX                     0x0001
14 #define COLLISION_SHAPE_BOX_BASE                0x0002     // use mesh box collision
15 #define COLLISION_SHAPE_SPHERE                  0x0003
16 #define COLLISION_SHAPE_TRIMESH                 0x0004     // for static objects and room's!
17 #define COLLISION_SHAPE_TRIMESH_CONVEX          0x0005     // for dynamic objects
18 #define COLLISION_SHAPE_SINGLE_BOX              0x0006     // use single box collision
19 #define COLLISION_SHAPE_SINGLE_SPHERE           0x0007
20 
21 #define COLLISION_NONE                          (0x0000)
22 #define COLLISION_MASK_ALL                      (0x7FFF)        // bullet uses signed short int for these flags!
23 
24 #define COLLISION_GROUP_ALL                     (0x7FFF)
25 #define COLLISION_GROUP_STATIC_ROOM             (0x0001)        // room mesh
26 #define COLLISION_GROUP_STATIC_OBLECT           (0x0002)        // room static object
27 #define COLLISION_GROUP_KINEMATIC               (0x0004)        // doors, blocks, static animated entityes
28 //#define COLLISION_GROUP_GHOST                   (0x0008)        // probe objects
29 #define COLLISION_GROUP_TRIGGERS                (0x0010)        // probe objects
30 #define COLLISION_GROUP_CHARACTERS              (0x0020)        // Lara, enemies, friends, creatures
31 #define COLLISION_GROUP_VEHICLE                 (0x0040)        // car, moto, bike
32 #define COLLISION_GROUP_BULLETS                 (0x0080)        // bullets, rockets, grenades, arrows...
33 #define COLLISION_GROUP_DYNAMICS                (0x0100)        // test balls, warious
34 #define COLLISION_GROUP_DYNAMICS_NI             (0x0200)        // test balls, warious
35 
36 
37 #define COLLISION_FILTER_CHARACTER              (COLLISION_GROUP_STATIC_ROOM | COLLISION_GROUP_STATIC_OBLECT | COLLISION_GROUP_KINEMATIC | \
38                                                  COLLISION_GROUP_CHARACTERS | COLLISION_GROUP_VEHICLE | COLLISION_GROUP_DYNAMICS)
39 
40 #define COLLISION_FILTER_HEIGHT_TEST            (COLLISION_GROUP_STATIC_ROOM | COLLISION_GROUP_STATIC_OBLECT | COLLISION_GROUP_KINEMATIC | COLLISION_GROUP_VEHICLE)
41 
42 #ifdef	__cplusplus
43 extern "C" {
44 #endif
45 
46 struct room_s;
47 struct room_sector_s;
48 
49 typedef struct engine_container_s
50 {
51     uint16_t                     object_type;
52     uint16_t                     collision_shape : 8;
53     uint16_t                     collision_heavy : 1;
54     uint16_t                     : 7;
55     int16_t                      collision_group;
56     int16_t                      collision_mask;
57     void                        *object;
58     struct room_s               *room;
59     struct room_sector_s        *sector;
60     struct engine_container_s   *next;
61 }engine_container_t, *engine_container_p;
62 
63 typedef struct engine_transform_s
64 {
65     float                        M4x4[16] __attribute__((packed, aligned(16))); // GL transformation matrix
66     float                        scaling[3];         // entity scaling
67     float                        angles[3];
68 } engine_transform_t, *engine_transform_p;
69 
70 
71 engine_container_p Container_Create();
72 void Container_Delete(engine_container_p cont);
73 
74 #ifdef	__cplusplus
75 }
76 #endif
77 #endif
78