ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/Daodan/src/patches/objt.h
Revision: 984
Committed: Sun Mar 16 23:35:10 2014 UTC (11 years, 6 months ago) by alloc
Content type: text/x-chdr
File size: 2927 byte(s)
Log Message:
Daodan: TV code

File Contents

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