File: objutils.h

package info (click to toggle)
searchandrescue 0.8.2-10
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,656 kB
  • ctags: 6,111
  • sloc: ansic: 89,072; cpp: 7,691; sh: 90; makefile: 80
file content (205 lines) | stat: -rw-r--r-- 5,529 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
#ifndef OBJUTILS_H
#define OBJUTILS_H

#include "obj.h"

extern int SARObjIsAllocated(
	sar_object_struct **ptr, int total,
	int n
);
extern sar_object_struct *SARObjGetPtr(
	sar_object_struct **ptr, int total,
	int n
);
extern int SARGetObjectNumberFromPointer(
	sar_scene_struct *scene,
	sar_object_struct **ptr, int total,
	sar_object_struct *obj_ptr
);
extern sar_object_struct *SARObjMatchPointerByName(
	sar_scene_struct *scene,
	sar_object_struct **ptr, int total,
	const char *name, int *obj_num
);

extern int SARIsTextureAllocated(
	sar_scene_struct *scene,
	int n
);
extern v3d_texture_ref_struct *SARGetTextureRefByName(
	sar_scene_struct *scene, const char *name
);
extern int SARGetTextureRefNumberByName(
	sar_scene_struct *scene, const char *name
);

extern int SARObjLandingGearState(sar_object_struct *obj_ptr);

extern sar_obj_part_struct *SARObjGetPartPtr(
	sar_object_struct *obj_ptr, sar_obj_part_type type, int skip
);
extern sar_obj_rotor_struct *SARObjGetRotorPtr(
	sar_object_struct *obj_ptr, int n, int *total
);
extern sar_obj_hoist_struct *SARObjGetHoistPtr(
	sar_object_struct *obj_ptr, int n, int *total
);
extern int SARObjGetOnBoardPtr(
	sar_object_struct *obj_ptr,
	int **crew, int **passengers, int **passengers_max,
	float **passengers_mass,
	int **passengers_leave_pending, int **passengers_drop_pending
);
extern sar_external_fueltank_struct *SARObjGetFuelTankPtr(
	sar_object_struct *obj_ptr, int n, int *total
);

extern sar_visual_model_struct *SARVisualModelNew(
	sar_scene_struct *scene,
	const char *filename, const char *name
);
extern void *SARVisualModelNewList(sar_visual_model_struct *vmodel);
extern int SARVisualModelGetRefCount(sar_visual_model_struct *vmodel);
extern void SARVisualModelRef(sar_visual_model_struct *vmodel);
extern void SARVisualModelUnref(
	sar_scene_struct *scene, sar_visual_model_struct *vmodel
);
extern void SARVisualModelCallList(sar_visual_model_struct *vmodel);
extern void SARVisualModelDeleteAll(sar_scene_struct *scene);

extern sar_cloud_layer_struct *SARCloudLayerNew(
	sar_scene_struct *scene,
	int tile_width, int tile_height,
	float range,		/* Tiling range in meters */
	float altitude,		/* Altitude in meters */
	const char *tex_name
);
extern void SARCloudLayerDelete(
	sar_scene_struct *scene,
	sar_cloud_layer_struct *cloud_layer_ptr
);

extern sar_cloud_bb_struct *SARCloudBBNew(
	sar_scene_struct *scene,
	int tile_width, int tile_height,
	const sar_position_struct *pos,
	float width, float height,	/* In meters */
	const char *tex_name,
	time_t lightening_min_int,	/* In ms */
	time_t lightening_max_int	/* In ms */
);
extern void SARCloudBBDelete(sar_cloud_bb_struct *cloud_bb_ptr);

extern int SARObjAddToGroundList(
	sar_scene_struct *scene,
	sar_object_struct *obj_ptr
);
extern void SARObjRemoveFromGroundList(
	sar_scene_struct *scene,
	sar_object_struct *obj_ptr
);
extern int SARObjAddToHumanRescueList(
	sar_scene_struct *scene,
	sar_object_struct *obj_ptr
);
extern void SARObjRemoveFromHumanRescueList(
	sar_scene_struct *scene,
	sar_object_struct *obj_ptr
);

extern int SARObjAddContactBoundsSpherical(
	sar_object_struct *obj_ptr,
	sar_obj_flags_t crash_flags, int crash_type,
	float contact_radius
);
extern int SARObjAddContactBoundsCylendrical(
	sar_object_struct *obj_ptr,
	sar_obj_flags_t crash_flags, int crash_type,
	float contact_radius,
	float contact_h_min, float contact_h_max
);
extern int SARObjAddContactBoundsRectangular(
	sar_object_struct *obj_ptr,
	sar_obj_flags_t crash_flags, int crash_type,
	float contact_x_min, float contact_x_max,
	float contact_y_min, float contact_y_max,
	float contact_z_min, float contact_z_max
);

extern int SARObjInterceptNew(
	sar_scene_struct *scene,
	sar_intercept_struct ***ptr, int *total,
	sar_obj_flags_t flags,
	float x, float y, float z,
	float radius,
	float urgency,
	const char *name
);
extern sar_obj_part_struct *SARObjPartNew(
	sar_scene_struct *scene,
	sar_obj_part_struct ***ptr, int *total,
	sar_obj_part_type type
);
extern sar_obj_part_struct *SARObjAirBrakeNew(
	sar_scene_struct *scene,
	sar_obj_part_struct ***ptr, int *total
);
extern sar_obj_part_struct *SARObjDoorRescueNew(
	sar_scene_struct *scene,
	sar_obj_part_struct ***ptr, int *total
);
extern sar_obj_part_struct *SARObjLandingGearNew(
	sar_scene_struct *scene,
	sar_obj_part_struct ***ptr, int *total
);
extern int SARObjExternalFuelTankNew(
	sar_scene_struct *scene,
	sar_external_fueltank_struct ***ptr, int *total
);
extern int SARObjRotorNew(
	sar_scene_struct *scene,
	sar_obj_rotor_struct ***ptr, int *total
);
extern sar_light_struct *SARObjLightNew(
	sar_scene_struct *scene,
	sar_light_struct ***ptr, int *total
);
extern int SARObjNew(
	sar_scene_struct *scene,
	sar_object_struct ***ptr, int *total,
	int type
);

extern void SARObjDeleteIntercepts(
	sar_scene_struct *scene,
	sar_intercept_struct ***ptr, int *total
);
extern void SARObjDeleteLights(
	sar_scene_struct *scene,
	sar_light_struct ***ptr, int *total
);
extern void SARObjDeleteParts(
	sar_scene_struct *scene,
	sar_obj_part_struct ***ptr, int *total
);
extern void SARObjDeleteExternalFuelTanks(
	sar_scene_struct *scene,
	sar_external_fueltank_struct ***ptr, int *total
);
extern void SARObjDeleteRotors(
	sar_scene_struct *scene,
	sar_obj_rotor_struct ***ptr, int *total
);
extern void SARObjDelete(
	void *core_ptr,
	sar_object_struct ***ptr, int *total,
	int n
);

extern void SARObjGenerateTilePlane(
	float min, float max, /* In meters */
	float tile_width, float tile_height
);


#endif	/* OBJUTILS_H */