DI-Guy SDK Documentation  13.1
diguyVehicleNearCollision.h
Go to the documentation of this file.
1 
2 /*********************************************************************
3  ** Copyright (c) 1992-2015 VT MAK
4  ** All rights reserved.
5  *********************************************************************/
6 
7 /*********************************************************************
8  **
9  *t diguyVehicleNearCollision
10  **
11  *b Link against: libdiguy
12  */
13 
14 #ifndef __diguyVehicleNearCollision_H
15 #define __diguyVehicleNearCollision_H
16 
17 #ifdef SWIG
19 #else
20 #define CPLUSPLUS_ONLY
21 #endif
22 
23 #ifdef CPLUSPLUS_ONLY
24 #include <stdio.h> // for NULL
25 class diguyCharacter;
26 class diguyScenario;
27 class diguySceneObject;
28 #endif
29 
30 #include <declspec_diguy.h>
31 #include <diguy_constants.h>
32 
33 
34 /****************************************************************************/
35 class BDI_DECLSPEC_diguy diguyVehicleNearCollision
36 {
37 
38 public:
39 
40 /*****************************************************************************/
45  /*l
46  *b Returns:
47  **
48  ** speed of vehicle being approached in near collision, in m/s
49  **
50  *b Callable From:
51  **
52  *- - C++
53  *- - Script
54  **
55  */
56  float get_approached_vehicle_speed();
57 
58  /*l
59  *b Returns:
60  **
61  ** name of approached vehicle
62  **
63  *b Callable From:
64  **
65  *- - C++
66  *- - Script
67  **
68  */
69  const char* get_approached_vehicle_name();
70 
71  /*l
72  *b Returns:
73  **
74  ** speed of approaching vehicle, in m/s
75  **
76  *b Callable From:
77  **
78  *- - C++
79  *- - Script
80  **
81  */
82  float get_approaching_vehicle_speed();
83 
84  /*l
85  *b Returns:
86  **
87  ** name of approached vehicle
88  **
89  *b Callable From:
90  **
91  *- - C++
92  *- - Script
93  **
94  */
95  const char* get_approaching_vehicle_name();
96 
97  /*l
98  *b Description:
99  **
100  ** This function returns the suggested speed for the approaching
101  ** vehicle, to make it less likely that it will collide with the
102  ** approached vehicle.
103  **
104  *b Returns:
105  **
106  ** suggested speed, in m/s
107  **
108  *b Callable From:
109  **
110  *- - C++
111  *- - Script
112  **
113  */
114  float get_approaching_vehicle_suggested_speed();
115 
116  /*l
117  *b Description:
118  **
119  ** XXX
120  **
121  *b Returns:
122  **
123  ** Speed
124  **
125  *b Callable From:
126  **
127  *- - C++
128  *- - Script
129  **
130  */
131  float get_distance();
132 
133  /*l
134  *b Description:
135  **
136  ** XXX
137  **
138  *b Returns:
139  **
140  ** Speed
141  **
142  *b Callable From:
143  **
144  *- - C++
145  *- - Script
146  **
147  */
148  float get_time_to_next_check();
149 
150  /*l
151  *b Description:
152  **
153  ** XXX
154  **
155  *b Returns:
156  **
157  ** 1, if the collision is valid. If 0, there is not
158  **
159  *b Callable From:
160  **
161  *- - C++
162  *- - Script
163  **
164  */
165  int get_active() {return m_is_active;}
166 
167 #ifdef CPLUSPLUS_ONLY
168 
174 private:
175 
178  friend class bdiScenario;
180  friend class bdiScenarioCharacter;
181  friend class diguyCharacter;
182  friend class bdiScenarioVehicleController;
183 
184  /*l
185  ** A private constructor.
186  */
188  diguyCharacter* vehicle = NULL);
190  /*
191  * Private data members.
192  */
193  diguyScenario* m_scenario;
194  diguyCharacter* m_approached_vehicle;
195  diguyCharacter* m_approaching_vehicle;
196  float m_distance;
197  float m_suggested_approaching_speed;
198  float m_time_to_next_check;
199  int m_is_active;
200 
201 #endif
202 
203 };
204 
205 
206 #endif /* __diguyVehicleNearCollision_H */
Definition: diguyVehicleNearCollision.h:33
Represents the scenario currently being portrayed.
Definition: diguyScenario.h:92
The class that represents a DI-Guy Entity in the world.
Definition: diguyCharacter.h:78
A scene object is a static (that is, non-moving) object in the scenario. Scene objects are the basic ...
Definition: diguySceneObject.h:43
static diguyScenario * scenario
Definition: simple_playback_ogl.cpp:54