[984] | 1 | #ifndef _OBJT_H_
|
---|
| 2 | #define _OBJT_H_
|
---|
| 3 |
|
---|
| 4 | #define M3cNumBoundingPoints 8// Do not change without changing references below
|
---|
| 5 | #define M3cNumBoundingFaces 6// Do not change without changing references below
|
---|
| 6 |
|
---|
| 7 | typedef struct M3tPoint3D
|
---|
| 8 | {
|
---|
| 9 | float x;
|
---|
| 10 | float y;
|
---|
| 11 | float z;
|
---|
| 12 | } M3tPoint3D;
|
---|
| 13 |
|
---|
| 14 | typedef struct M3tQuad
|
---|
| 15 | {
|
---|
| 16 | uint32_t indices[4];
|
---|
| 17 | } M3tQuad;
|
---|
| 18 |
|
---|
| 19 | typedef struct M3tPlaneEquation
|
---|
| 20 | {
|
---|
| 21 | float a;
|
---|
| 22 | float b;
|
---|
| 23 | float c;
|
---|
| 24 | float d;
|
---|
| 25 | } M3tPlaneEquation;
|
---|
| 26 |
|
---|
| 27 | typedef M3tPoint3D M3tVector3D;
|
---|
| 28 |
|
---|
| 29 | typedef struct M3tBoundingVolume
|
---|
| 30 | {
|
---|
| 31 | M3tPoint3D worldPoints[8];// Must match M3cNumBoundingPoints above
|
---|
| 32 | M3tQuad faces[6];// Must match M3cNumBoundingFaces above
|
---|
| 33 | M3tVector3D normals[6];// Must match M3cNumBoundingFaces above- starting normals
|
---|
| 34 |
|
---|
| 35 | M3tPlaneEquation curPlanes[6];// Must match M3cNumBoundingFaces above- current plane equs
|
---|
| 36 | uint16_t curProjections[6]; // Must match M3cNumBoundingFaces above
|
---|
| 37 | } M3tBoundingVolume;
|
---|
| 38 |
|
---|
| 39 | typedef struct M3tBoundingSphere
|
---|
| 40 | {
|
---|
| 41 | M3tPoint3D center;
|
---|
| 42 | float radius;
|
---|
| 43 | } M3tBoundingSphere;
|
---|
| 44 |
|
---|
| 45 | typedef uint32_t OBJtObjectType;
|
---|
| 46 |
|
---|
| 47 | typedef struct OBJtObject
|
---|
| 48 | {
|
---|
| 49 | OBJtObjectType object_type;
|
---|
| 50 | uint32_t object_id;
|
---|
| 51 | uint32_t flags;
|
---|
| 52 | M3tPoint3D position;
|
---|
| 53 | M3tPoint3D rotation;
|
---|
| 54 | OBJtMethods* methods;
|
---|
| 55 | void* mechanics_class; //ONtMechanicsClass* mechanics_class;
|
---|
| 56 | uint32_t object_data[0];
|
---|
| 57 | } OBJtObject;
|
---|
| 58 |
|
---|
| 59 | #define OBJcMaxNameLength 63
|
---|
| 60 | #define OBJcMaxNoteChars 127
|
---|
| 61 | #define SLcScript_MaxNameLength (32)
|
---|
| 62 |
|
---|
| 63 | typedef struct OBJtOSD_TriggerVolume
|
---|
| 64 | {
|
---|
| 65 | char name[OBJcMaxNameLength];
|
---|
| 66 | char entry_script[SLcScript_MaxNameLength];
|
---|
| 67 | char inside_script[SLcScript_MaxNameLength];
|
---|
| 68 | char exit_script[SLcScript_MaxNameLength];
|
---|
| 69 |
|
---|
[985] | 70 | // TODO: +1 in orig, why do we have to shift here?
|
---|
| 71 | char note[OBJcMaxNoteChars + 2];
|
---|
[984] | 72 |
|
---|
| 73 | M3tPoint3D scale;
|
---|
| 74 | int32_t id;
|
---|
| 75 | int32_t parent_id;
|
---|
| 76 |
|
---|
| 77 | M3tBoundingVolume volume;
|
---|
| 78 | M3tBoundingSphere sphere;// not written to disk
|
---|
| 79 | uint32_t team_mask;
|
---|
| 80 |
|
---|
| 81 | uint32_t authored_flags;
|
---|
| 82 | uint32_t in_game_flags;// not written to disk
|
---|
| 83 | char cur_entry_script[SLcScript_MaxNameLength];// not written to disk
|
---|
| 84 | char cur_inside_script[SLcScript_MaxNameLength];// not written to disk
|
---|
| 85 | char cur_exit_script[SLcScript_MaxNameLength];// not written to disk
|
---|
| 86 | } OBJtOSD_TriggerVolume;
|
---|
| 87 |
|
---|
| 88 | typedef struct OBJtOSD_All
|
---|
| 89 | {
|
---|
| 90 | union
|
---|
| 91 | {
|
---|
| 92 | //OBJtOSD_Combat combat_osd;
|
---|
| 93 | //OBJtOSD_Character character_osd;
|
---|
| 94 | //OBJtOSD_PatrolPath patrolpath_osd;
|
---|
| 95 | //OBJtOSD_Flag flag_osd;
|
---|
| 96 | //OBJtOSD_Furniture furniture_osd;
|
---|
| 97 | //OBJtOSD_Particle particle_osd;
|
---|
| 98 | //OBJtOSD_PowerUp powerup_osd;
|
---|
| 99 | //OBJtOSD_Sound sound_osd;
|
---|
| 100 | OBJtOSD_TriggerVolume trigger_volume_osd;
|
---|
| 101 | //OBJtOSD_Weapon weapon_osd;
|
---|
| 102 | //OBJtOSD_Trigger trigger_osd;
|
---|
| 103 | //OBJtOSD_Turret turret_osd;
|
---|
| 104 | //OBJtOSD_Console console_osd;
|
---|
| 105 | //OBJtOSD_Door door_osd;
|
---|
| 106 | //OBJtOSD_Melee melee_osd;
|
---|
| 107 | //OBJtOSD_Neutral neutral_osd;
|
---|
| 108 | } osd;
|
---|
| 109 | } OBJtOSD_All;
|
---|
| 110 |
|
---|
| 111 | #endif
|
---|