DI-Guy C++ SDK Reference  13.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diguyCharacterPathScriptBead.h
Go to the documentation of this file.
1 
2 /*********************************************************************
3  ** Copyright (c) 1992-2014 VT MAK
4  ** All rights reserved.
5  *********************************************************************/
6 
7 /*********************************************************************
8  **
9  *t diguyCharacterPathScriptBead
10  **
11  *b Link against: libdiguy
12  */
13 
14 #ifndef __diguyCharacterPathScriptBead_H
15 #define __diguyCharacterPathScriptBead_H
16 
17 #ifdef SWIG
19 #else
20 #define CPLUSPLUS_ONLY
21 #endif
22 
23 #ifdef CPLUSPLUS_ONLY
24 class bdiBeadScript;
25 #endif
26 
27 
28 #include <declspec_diguy.h>
29 
30 /****************************************************************************/
31 class BDI_DECLSPEC_diguy diguyCharacterPathScriptBead
32 {
33 
34 public:
35 
36  /*l
37  *b Description:
38  **
39  ** Returns the name of the object. This pointer will
40  ** never be NULL.
41  **
42  *b Returns:
43  **
44  ** name of the object
45  **
46  *b Callable From:
47  **
48  *- - C++
49  *- - Script
50  */
51  const char* get_name();
52 
53  /*l
54  *b Description:
55  **
56  ** This function sets the name of this object.
57  **
58  *b Returns:
59  **
60  ** 0 on success, -1 on failure
61  **
62  *b Callable From:
63  **
64  *- - C++
65  *- - Script
66  */
67  int set_name(const char* name);
68 
69  /*l
70  *b Description:
71  **
72  ** This function returns the script this bead performs.
73  **
74  *b Returns:
75  **
76  ** script to perform; empty string if no script set
77  **
78  *b Callable From:
79  **
80  *- - C++
81  *- - Script
82  */
83  const char* get_script();
84 
85  /*l
86  *b Description:
87  **
88  ** This function sets the script this bead performs. When
89  ** a character is traversing the path containing this
90  ** bead, the specified script will be performed when this bead
91  ** is reached.
92  **
93  ** If this script bead is part of a diguyCharacterPath,
94  ** the diguyCharacterPath::update() function must be called for
95  ** changes to take effect.
96  **
97  *b Arguments:
98  **
99  *a script - the script that should be evaluated when
100  *a this bead is reached; pass NULL to un-set
101  *a the script
102  **
103  *b Returns:
104  **
105  ** 0 on success, -1 on failure
106  **
107  *b Callable From:
108  **
109  *- - C++
110  *- - Script
111  */
112  int set_script(const char* script);
113 
114  /*l
115  *b Description:
116  **
117  ** This function sets the script type of this bead. This can only
118  ** be "lua".
119  **
120  *b Arguments:
121  **
122  *a script_type - the language of the script
123  **
124  *b Returns:
125  **
126  ** 0 on success, -1 on failure
127  **
128  *b Callable From:
129  **
130  *- - C++
131  *- - Script
132  */
133  int set_script_type(const char* script);
134 
135  /*l
136  *b Returns:
137  **
138  ** The language of the script
139  **
140  *b Callable From:
141  **
142  *- - C++
143  *- - Script
144  */
145 
146  const char* get_script_type();
147 
148  /*l
149  *b Description:
150  **
151  ** This function returns how far into the path this bead is.
152  **
153  *b Returns:
154  **
155  ** distance into path of this bead, in meters
156  **
157  *b Callable From:
158  **
159  *- - C++
160  *- - Script
161  */
162  float get_distance_into_path();
163 
164  /*l
165  *b Description:
166  **
167  ** This function sets how far into the path this bead is.
168  **
169  ** Since distances and times on paths are interrelated,
170  ** calling this function will have the side-effect of setting
171  ** when on the path the bead is located, as if to a call to
172  ** set_tin().
173  **
174  ** If this script bead is part of a diguyCharacterPath,
175  ** the diguyCharacterPath::update() function must be called for
176  ** changes to take effect.
177  **
178  *b Arguments:
179  **
180  *a distance_into_path - how far into the path this bead is,
181  *a in meters
182  **
183  *b Returns:
184  **
185  ** 0 on success, -1 on failure
186  **
187  *b Callable From:
188  **
189  *- - C++
190  *- - Script
191  */
192  int set_distance_into_path(float distance_into_path);
193 
194  /*l
195  *b Description:
196  **
197  ** This function returns where on the path this bead is.
198  **
199  *b Returns:
200  **
201  ** location of this bead, in meters
202  **
203  *b Callable From:
204  **
205  *- - C++
206  *- - Script
207  */
208  float get_length();
209 
210  /*l
211  *b Description:
212  **
213  ** This function sets how long this bead will have an
214  ** effect. The bead will have an effect from its initial
215  ** distance into the path (as set by set_distance_into_path())
216  ** to (distance + length) seconds.
217  **
218  ** Since distances and times on paths are interrelated,
219  ** calling this function will have the side-effect of setting
220  ** when on the path the bead's effect ends, as if to a call
221  ** to set_duration().
222  **
223  ** If this script bead is part of a diguyCharacterPath,
224  ** the diguyCharacterPath::update() function must be called for
225  ** changes to take effect.
226  **
227  *b Arguments:
228  **
229  *a duration - duration of this bead, in seconds
230  **
231  *b Returns:
232  **
233  ** 0 on success, -1 on failure
234  **
235  *b Callable From:
236  **
237  *- - C++
238  *- - Script
239  */
240  int set_length(float length);
241 
242  /*l
243  *b Description:
244  **
245  ** This function returns when on the path this bead is.
246  **
247  *b Returns:
248  **
249  ** time location of this bead, in seconds
250  **
251  *b Callable From:
252  **
253  *- - C++
254  *- - Script
255  */
256  float get_tin();
257 
258  /*l
259  *b Description:
260  **
261  ** This function sets when this bead will begin to have
262  ** an effect.
263  **
264  ** Since distances and times on paths are interrelated,
265  ** calling this function will have the side-effect of setting
266  ** where on the path the bead is located, as if to a call to
267  ** set_distance_into_path().
268  **
269  ** If this script bead is part of a diguyCharacterPath,
270  ** the diguyCharacterPath::update() function must be called for
271  ** changes to take effect.
272  **
273  *b Arguments:
274  **
275  *a tin - when this bead begins to have an effect, in seconds
276  **
277  *b Returns:
278  **
279  ** 0 on success, -1 on failure
280  **
281  *b Callable From:
282  **
283  *- - C++
284  *- - Script
285  */
286  int set_tin(float tin);
287 
288  /*l
289  *b Description:
290  **
291  ** This function returns how long this bead will have an
292  ** effect.
293  **
294  *b Returns:
295  **
296  ** duration of this bead, in seconds
297  **
298  *b Callable From:
299  **
300  *- - C++
301  *- - Script
302  */
303  float get_duration();
304 
305  /*l
306  *b Description:
307  **
308  ** This function sets how long this bead will have an
309  ** effect. The bead will have an effect from tin seconds
310  ** (as set by set_tin()) to (tin + duration) seconds.
311  **
312  ** Since distances and times on paths are interrelated,
313  ** calling this function will have the side-effect of setting
314  ** where on the path the bead's effect ends, as if to a call
315  ** to set_length().
316  **
317  ** If this script bead is part of a diguyCharacterPath,
318  ** the diguyCharacterPath::update() function must be called for
319  ** changes to take effect.
320  **
321  *b Arguments:
322  **
323  *a duration - duration of this bead, in seconds
324  **
325  *b Returns:
326  **
327  ** 0 on success, -1 on failure
328  **
329  *b Callable From:
330  **
331  *- - C++
332  *- - Script
333  */
334  int set_duration(float duration);
335 
336 
337 /****************************************************************************/
338 /****************************************************************************/
339 /****************************************************************************/
346 /****************************************************************************/
347 /****************************************************************************/
348 /****************************************************************************/
349 
350  const char* get_begin_at_object_name();
351 
352  int set_begin_at_object_name(const char* begin_at_object_name);
353 
354  float get_begin_at_object_offset();
355 
356  int set_begin_at_object_offset(float begin_at_object_offset);
357 
358  const char* get_end_at_object_name();
359 
360  int set_end_at_object_name(const char* end_at_object_name);
361 
362  float get_end_at_object_offset();
363 
364  int set_end_at_object_offset(float end_at_object_offset);
365 
366 
367 /****************************************************************************/
368 /****************************************************************************/
369 
374 #ifdef CPLUSPLUS_ONLY
375 
376  bdiBeadScript* get_scripted_object() {return m_scripted_object;}
378  friend class bdiBeadScript;
379 
380 private:
381 
382  /*l
383  ** A private constructor.
384  */
385  diguyCharacterPathScriptBead(bdiBeadScript* scripted_object);
386 
387  /*l
388  ** A private destructor.
389  */
391 
392  /*l
393  ** A pointer to internal data.
394  */
395  bdiBeadScript* m_scripted_object;
396 
397 #endif
398 
399 };
400 
401 
402 #endif /* __diguyCharacterPathScriptBead_H */
403 
404 
405 /*********************************************************************
406  ** Copyright (c) 1992-2014 VT MAK
407  ** All rights reserved.
408  *********************************************************************/