File: simutils.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 (164 lines) | stat: -rw-r--r-- 4,792 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
/*
                    SAR Simulation Utility Functions
 */

#ifndef SIMUTILS_H
#define SIMUTILS_H

#include <sys/types.h>
#include "sfm.h"
#include "sound.h"
#include "obj.h"
#include "sar.h"

extern float SARSimGetFlatContactRadius(sar_object_struct *obj_ptr);
extern sar_object_struct *SARSimMatchObjectFromFDM(
        sar_object_struct **list, int total,
        SFMModelStruct *fdm, int *index
);
extern float SARSimThrottleOutputCoeff(
        int flight_model_type,
        float throttle,
        float collective, float collective_range
);
extern float SARSimStallSpeed(
	const sar_object_aircraft_struct *obj_aircraft_ptr
);

/* Position Realization */
extern void SARSimWarpObjectRelative(   
        sar_scene_struct *scene, sar_object_struct *obj_ptr,
        sar_object_struct **ptr, int total, int ref_obj_num,
        sar_position_struct *offset_pos,
        sar_direction_struct *offset_dir
);
extern void SARSimWarpObject(
        sar_scene_struct *scene, sar_object_struct *obj_ptr,
        sar_position_struct *new_pos,
        sar_direction_struct *new_dir
);

/* Object Parts */
extern void SARSimUpdatePart(
	sar_scene_struct *scene,
        sar_object_struct *obj_ptr, sar_obj_part_struct *part_ptr,
	snd_recorder_struct *recorder, int play_sound, int ear_in_cockpit
);
extern void SARSimOpAirBrakes(
        sar_scene_struct *scene,
        sar_object_struct ***ptr, int *total,
        sar_object_struct *obj_ptr, int air_brakes_state,
	snd_recorder_struct *recorder, int play_sound, int ear_in_cockpit
);
extern void SARSimOpLandingGear(
        sar_scene_struct *scene,
        sar_object_struct ***ptr, int *total,
        sar_object_struct *obj_ptr, int gear_state,
	snd_recorder_struct *recorder, int play_sound, int ear_in_cockpit
);
extern void SARSimOpDoorRescue(
        sar_scene_struct *scene,
        sar_object_struct ***ptr, int *total,
        sar_object_struct *obj_ptr, int state
);

/* Rotor */
extern void SARSimRotorUpdateControls(
        sar_obj_rotor_struct *rotor_ptr,
        float pitch, float bank
);

/* Engine */
extern sar_engine_state SARSimGetEngineState(sar_object_struct *obj_ptr);
extern void SARSimOpEngine(
        sar_scene_struct *scene,
        sar_object_struct ***ptr, int *total,
        sar_object_struct *obj_ptr, sar_engine_state engine_state,
        snd_recorder_struct *recorder, char play_sound, char ear_in_cockpit
);
extern void SARSimPitchEngine(
        sar_scene_struct *scene,
        sar_object_struct ***ptr, int *total,
        sar_object_struct *obj_ptr, int pitch_state
);

/* Object Lights */
extern void SARSimUpdateLights(sar_object_struct *obj_ptr);
extern int SARSimGetLightsState(sar_object_struct *obj_ptr);
extern void SARSimOpLights( 
        sar_object_struct *obj_ptr, int state
);
extern int SARSimGetStrobesState(sar_object_struct *obj_ptr);
extern void SARSimOpStrobes(
        sar_object_struct *obj_ptr, int state
);
extern int SARSimGetAttenuateState(sar_object_struct *obj_ptr);
extern void SARSimOpAttenuate(
        sar_object_struct *obj_ptr, int state
);

/* Repair & Refuel */
extern int SARSimOpRepair(
        sar_scene_struct *scene, sar_object_struct *obj_ptr
);
extern int SARSimOpRefuel(
        sar_scene_struct *scene, sar_object_struct *obj_ptr
);

/* Passenger Operations */
extern int SARSimOpPassengersSetLeave(
        sar_scene_struct *scene, sar_object_struct *obj_ptr,
        int passengers_leave_pending, int passengers_drop_pending
);
extern int SARSimOpPassengersUnloadAll(
        sar_scene_struct *scene, sar_object_struct *obj_ptr
);

/* Fuel */
extern float SARSimOpTransferFuelFromTanks(
        sar_scene_struct *scene, sar_object_struct *obj_ptr
);
extern int SARSimOpDropFuelTankNext(  
        sar_scene_struct *scene,
        sar_object_struct ***ptr, int *total,
        int obj_num, sar_object_struct *obj_ptr
);

/* Smoke Respawn */
extern void SARSimSmokeSpawn(
        sar_core_struct *core_ptr, sar_object_struct *obj_ptr,
        sar_object_smoke_struct *obj_smoke_ptr
);

/* Slew */
extern int SARSimIsSlew(sar_object_struct *obj_ptr);
extern void SARSimSetSlew(
	sar_object_struct *obj_ptr, int enter_slew
);

/* Hoist & Passenger Operations */
extern int SARSimDoPickUpHuman(
	sar_scene_struct *scene,
        sar_object_struct *obj_ptr,
	sar_object_human_struct *obj_human_ptr,
	int human_obj_num
);
extern int SARSimDoHoistIn(
        sar_core_struct *core_ptr,
        sar_object_struct *obj_ptr 
);
extern int SARSimBoardObject(
        sar_core_struct *core_ptr,
        sar_object_struct *tar_obj_ptr, int src_obj_num
);

/* Camera Setting */
extern void SARSimSetFlyByPosition(
	sar_scene_struct *scene,
	sar_object_struct ***ptr, int *total,
	sar_object_struct *obj_ptr,
	sar_position_struct *pos_result
);


#endif	/* SIMUTILS_H */