DI-Guy C++ SDK Reference  13.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diguyCharacterPathActionBead.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 diguyCharacterPathActionBead
10  **
11  *b Link against: libdiguy
12  */
13 
14 #ifndef __diguyCharacterPathActionBead_H
15 #define __diguyCharacterPathActionBead_H
16 
17 #ifdef SWIG
19 #else
20 #define CPLUSPLUS_ONLY
21 #endif
22 
23 #ifdef CPLUSPLUS_ONLY
24 class bdiBeadAction;
25 #endif
26 
27 
28 #include <declspec_diguy.h>
29 
30 /****************************************************************************/
31 class BDI_DECLSPEC_diguy diguyCharacterPathActionBead
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 action this bead specifies.
73  ** This pointer will never be NULL.
74  **
75  *b Returns:
76  **
77  ** action of this bead
78  **
79  *b Callable From:
80  **
81  *- - C++
82  *- - Script
83  */
84  const char* get_action();
85 
86  /*l
87  *b Description:
88  **
89  ** This function sets the action this bead specifies. When
90  ** a character is traversing the path containing this
91  ** bead, the specified action will be performed when this bead
92  ** is reached.
93  **
94  ** If this action bead is part of a diguyCharacterPath,
95  ** the diguyCharacterPath::update() function must be called for
96  ** changes to take effect.
97  **
98  *b Arguments:
99  **
100  *a action - the action the character should perform when
101  *a this bead is reached
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_action(const char* action);
113 
114  /*l
115  *b Description:
116  **
117  ** This function returns how far into the path this bead is.
118  **
119  *b Returns:
120  **
121  ** distance into path of this bead, in meters
122  **
123  *b Callable From:
124  **
125  *- - C++
126  *- - Script
127  */
128  float get_distance_into_path();
129 
130  /*l
131  *b Description:
132  **
133  ** This function sets how far into the path this bead is.
134  **
135  ** Since distances and times on paths are interrelated,
136  ** calling this function will have the side-effect of setting
137  ** when on the path the bead is located, as if to a call to
138  ** set_tin().
139  **
140  ** If this script bead is part of a diguyCharacterPath,
141  ** the diguyCharacterPath::update() function must be called for
142  ** changes to take effect.
143  **
144  *b Arguments:
145  **
146  *a distance_into_path - how far into the path this bead is,
147  *a in meters
148  **
149  *b Returns:
150  **
151  ** 0 on success, -1 on failure
152  **
153  *b Callable From:
154  **
155  *- - C++
156  *- - Script
157  */
158  int set_distance_into_path(float distance_into_path);
159 
160  /*l
161  *b Description:
162  **
163  ** This function returns where on the path this bead is.
164  **
165  *b Returns:
166  **
167  ** location of this bead, in meters
168  **
169  *b Callable From:
170  **
171  *- - C++
172  *- - Script
173  */
174  float get_length();
175 
176  /*l
177  *b Description:
178  **
179  ** This function sets how long this bead will have an
180  ** effect. The bead will have an effect from its initial
181  ** distance into the path (as set by set_distance_into_path())
182  ** to (distance + length) seconds.
183  **
184  ** Since distances and times on paths are interrelated,
185  ** calling this function will have the side-effect of setting
186  ** when on the path the bead's effect ends, as if to a call
187  ** to set_duration().
188  **
189  ** If this script bead is part of a diguyCharacterPath,
190  ** the diguyCharacterPath::update() function must be called for
191  ** changes to take effect.
192  **
193  *b Arguments:
194  **
195  *a duration - duration of this bead, in seconds
196  **
197  *b Returns:
198  **
199  ** 0 on success, -1 on failure
200  **
201  *b Callable From:
202  **
203  *- - C++
204  *- - Script
205  */
206  int set_length(float length);
207 
208  /*l
209  *b Description:
210  **
211  ** This function returns whether the length of this bead is
212  ** derived from other information in the bead. If so, calling
213  ** set_length() will have no effect.
214  **
215  ** See set_derive_length_flag() for information on how length
216  ** is derived.
217  **
218  *b Returns:
219  **
220  ** integer flag; 1 means length is derived, 0 means it is not
221  **
222  *b Callable From:
223  **
224  *- - C++
225  *- - Script
226  */
227  int get_derive_length_flag();
228 
229  /*l
230  *b Description:
231  **
232  ** This function sets whether the length of this bead is
233  ** derived from other information in the bead. If so, calling
234  ** set_length() will have no effect.
235  **
236  ** (More documentation needed to explain how length is derived.)
237  **
238  *b Arguments:
239  **
240  *a derive_length_flag - pass 1 for length to be derived, else 0
241  **
242  *b Returns:
243  **
244  ** 0 on success, -1 on failure
245  **
246  *b Callable From:
247  **
248  *- - C++
249  *- - Script
250  */
251  int set_derive_length_flag(int derive_length_flag);
252 
253  /*l
254  *b Description:
255  **
256  ** This function returns when on the path this bead is.
257  **
258  *b Returns:
259  **
260  ** time location of this bead, in seconds
261  **
262  *b Callable From:
263  **
264  *- - C++
265  *- - Script
266  */
267  float get_tin();
268 
269  /*l
270  *b Description:
271  **
272  ** This function sets when this bead will begin to have
273  ** an effect.
274  **
275  ** Since distances and times on paths are interrelated,
276  ** calling this function will have the side-effect of setting
277  ** where on the path the bead is located, as if to a call to
278  ** set_distance_into_path().
279  **
280  ** If this script bead is part of a diguyCharacterPath,
281  ** the diguyCharacterPath::update() function must be called for
282  ** changes to take effect.
283  **
284  *b Arguments:
285  **
286  *a tin - when this bead begins to have an effect, in seconds
287  **
288  *b Returns:
289  **
290  ** 0 on success, -1 on failure
291  **
292  *b Callable From:
293  **
294  *- - C++
295  *- - Script
296  */
297  int set_tin(float tin);
298 
299  /*l
300  *b Description:
301  **
302  ** This function returns how long this bead will have an
303  ** effect.
304  **
305  *b Returns:
306  **
307  ** duration of this bead, in seconds
308  **
309  *b Callable From:
310  **
311  *- - C++
312  *- - Script
313  */
314  float get_duration();
315 
316  /*l
317  *b Description:
318  **
319  ** This function sets how long this bead will have an
320  ** effect. The bead will have an effect from tin seconds
321  ** (as set by set_tin()) to (tin + duration) seconds.
322  **
323  ** Note that if duration is derived (as by a call to
324  ** set_derive_duration_flag()), this function will have
325  ** no effect.
326  **
327  ** Since distances and times on paths are interrelated,
328  ** calling this function will have the side-effect of setting
329  ** where on the path the bead's effect ends, as if to a call
330  ** to set_length().
331  **
332  ** If this script bead is part of a diguyCharacterPath,
333  ** the diguyCharacterPath::update() function must be called for
334  ** changes to take effect.
335  **
336  *b Arguments:
337  **
338  *a duration - duration of this bead, in seconds
339  **
340  *b Returns:
341  **
342  ** 0 on success, -1 on failure
343  **
344  *b Callable From:
345  **
346  *- - C++
347  *- - Script
348  */
349  int set_duration(float duration);
350 
351  /*l
352  *b Description:
353  **
354  ** This function returns whether the duration of this bead is
355  ** derived from other information in the bead. If so, calling
356  ** set_duration() will have no effect.
357  **
358  ** See set_derive_duration_flag() for information on how length
359  ** is derived.
360  **
361  *b Returns:
362  **
363  ** integer flag; 1 means duration is derived, 0 means it is not
364  **
365  *b Callable From:
366  **
367  *- - C++
368  *- - Script
369  */
370  int get_derive_duration_flag();
371 
372  /*l
373  *b Description:
374  **
375  ** This function sets whether the duration of this bead is
376  ** derived from other information in the bead. If so, calling
377  ** set_duration() will have no effect.
378  **
379  ** (More documentation needed to explain how duration is derived.)
380  **
381  *b Arguments:
382  **
383  *a derive_length_flag - pass 1 for duration to be derived, else 0
384  **
385  *b Returns:
386  **
387  ** 0 on success, -1 on failure
388  **
389  *b Callable From:
390  **
391  *- - C++
392  *- - Script
393  */
394  int set_derive_duration_flag(int derive_duration_flag);
395 
396  /*l
397  *b Returns:
398  **
399  ** the desired duration of this bead
400  **
401  *b Callable From:
402  **
403  *- - C++
404  *- - Script
405  */
406  float get_desired_duration();
407 
408  /*l
409  *b Description:
410  **
411  ** This function sets the desired duration of the action bead.
412  **
413  *b Arguments:
414  **
415  *a desired_duration - desired duration of action in seconds
416  **
417  *b Returns:
418  **
419  ** 0 on success, -1 on failure
420  **
421  *b Callable From:
422  **
423  *- - C++
424  *- - Script
425  */
426  int set_desired_duration(float desired_duration);
427 
428  /*l
429  *b Description:
430  **
431  ** This function returns whether the desired duration of this bead
432  ** is derived from other information in the bead. If so, calling
433  ** set_desired_duration() will have no effect.
434  **
435  *b Returns:
436  **
437  ** integer flag; 1 means duration is derived, 0 means it is not
438  **
439  *b Callable From:
440  **
441  *- - C++
442  *- - Script
443  */
444  int get_derive_desired_duration_flag();
445 
446  /*l
447  *b Description:
448  **
449  ** This function sets whether the desired duration of this bead is
450  ** derived from other information in the bead. If so, calling
451  ** set_desired_duration() will have no effect.
452  **
453  *b Arguments:
454  **
455  *a derive_desired_duration_flag - pass 1 for duration to be derived,
456  *a else 0
457  **
458  *b Returns:
459  **
460  ** 0 on success, -1 on failure
461  **
462  *b Callable From:
463  **
464  *- - C++
465  *- - Script
466  */
467  int set_derive_desired_duration_flag(int derive_desired_duration_flag);
468 
469  /*l
470  *b Returns:
471  **
472  ** how many repetitions of the action's looping motion will be played
473  **
474  *b Callable From:
475  **
476  *- - C++
477  *- - Script
478  */
479  int get_motion_reps();
480 
481  /*l
482  *b Description:
483  **
484  ** This function sets how many repetitions of the action's looping
485  ** motion will be played.
486  **
487  *b Arguments:
488  **
489  *a motion_reps - how many times to play the looping motion
490  **
491  *b Returns:
492  **
493  ** 0 on success, -1 on failure
494  **
495  *b Callable From:
496  **
497  *- - C++
498  *- - Script
499  */
500  int set_motion_reps(int motion_reps);
501 
502  /*l
503  *b Description:
504  **
505  ** This function returns whether the number of motion repetitions
506  ** for this action is derived from other data in the bead. If so,
507  ** calling set_motion_reps() will have no effect.
508  **
509  *b Returns:
510  **
511  ** integer flag; 1 means number of motion reps is derived, 0 means
512  ** it is not
513  **
514  *b Callable From:
515  **
516  *- - C++
517  *- - Script
518  */
519  int get_derive_motion_reps_flag();
520 
521  /*l
522  *b Description:
523  **
524  ** This function sets whether the number of motion repetitions
525  ** for this bead is derived from other information in the bead.
526  ** If so, calling set_motion_reps() will have no effect.
527  **
528  *b Arguments:
529  **
530  *a derive_motion_reps - pass 1 for number of motion reps to be
531  *a derived, else 0
532  **
533  *b Returns:
534  **
535  ** 0 on success, -1 on failure
536  **
537  *b Callable From:
538  **
539  *- - C++
540  *- - Script
541  */
542  int set_derive_motion_reps_flag(int derive_motion_reps);
543 
544  /*l
545  *b Description:
546  **
547  ** This function returns whether the transition motion for this
548  ** action bead from the previous action bead (if any) occurs
549  ** before this action bead or after.
550  **
551  *b Returns:
552  **
553  ** integer flag; 1 means transition happens before, 0 means
554  ** it happens after
555  **
556  *b Callable From:
557  **
558  *- - C++
559  *- - Script
560  */
561  int get_transition_before_bead_flag();
562 
563  /*l
564  *b Description:
565  **
566  ** This function sets whether the transition motion for this
567  ** action bead from the previous action bead (if any) occurs
568  ** before this action bead or after.
569  **
570  *b Arguments:
571  **
572  *a transition_before_bead_flag - pass 1 for transition to happen
573  *a before, 0 for it to happen after
574  **
575  *b Returns:
576  **
577  ** 0 on success, -1 on failure
578  **
579  *b Callable From:
580  **
581  *- - C++
582  *- - Script
583  */
584  int set_transition_before_bead_flag(int transition_before_bead_flag);
585 
586  /*l
587  *b Description:
588  **
589  ** This function returns the name of this bead's companion waypoint.
590  **
591  *b Returns:
592  **
593  ** C string identifying name of companion waypoint; NULL if there is
594  ** no companion waypoint
595  **
596  *b Callable From:
597  **
598  *- - C++
599  *- - Script
600  */
601  const char* get_companion_waypoint_name();
602 
603  /*l
604  *b Description:
605  **
606  ** This function sets the name of this action bead's companion
607  ** waypoint. The action bead will be constrained to stay at the
608  ** companion waypoint as the waypoint is moved around.
609  **
610  *b Arguments:
611  **
612  *a companion_waypoint_name - name of companion waypoint; pass
613  *a NULL to un-set the companion waypoint
614  **
615  *b Returns:
616  **
617  ** 0 on success, -1 on failure
618  **
619  *b Callable From:
620  **
621  *- - C++
622  *- - Script
623  */
624  int set_companion_waypoint_name(const char* companion_waypoint_name);
625 
626  /*l
627  *b Description:
628  **
629  ** This function creates a companion waypoint for this action bead
630  ** if it doesn't already have one. The created waypoint will be
631  ** at the action bead's current position. If this action bead
632  ** already has a companion waypoint, it may be modified to show
633  ** facing direction changes if this action or the previous action
634  ** have changed since the companion waypoint was assigned.
635  **
636  *b Returns:
637  **
638  ** 0 on success, -1 on failure
639  **
640  *b Callable From:
641  **
642  *- - C++
643  *- - Script
644  */
645  int create_or_update_companion_waypoint();
646 
647 
648 /****************************************************************************/
649 /****************************************************************************/
650 
655 #ifdef CPLUSPLUS_ONLY
656 
657  bdiBeadAction* get_scripted_object() {return m_scripted_object;}
658 
659  friend class bdiBeadAction;
660 
661 private:
662 
663  /*l
664  ** A private constructor.
665  */
666  diguyCharacterPathActionBead(bdiBeadAction* scripted_object);
667 
668  /*l
669  ** A private destructor.
670  */
672 
673  /*l
674  ** A pointer to internal data.
675  */
676  bdiBeadAction* m_scripted_object;
677 
678 #endif
679 
680 };
681 
682 
683 #endif /* __diguyCharacterPathActionBead_H */
684 
685 
686 /*********************************************************************
687  ** Copyright (c) 1992-2014 VT MAK
688  ** All rights reserved.
689  *********************************************************************/
690