C++ SDK Reference  12.5
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diguyFormation.h
Go to the documentation of this file.
1 
2 /*
3  * Copyright (C) 1992-2013 Boston Dynamics
4  * ALL RIGHTS RESERVED.
5  *
6  * These coded instructions, statements, and computer programs
7  * contain unpublished proprietary information of Boston Dynamics
8  * and are protected by Copyright Laws of the United States.
9  * They may not be used, duplicated, or disclosed in any form, in
10  * whole or in part, without the prior written consent from Boston
11  * Dynamics.
12  *
13  * RESTRICTED RIGHTS LEGEND
14  * Use, duplication, or disclosure by the government is subject
15  * to restrictions as set forth in FAR 52.227.19(c)(2) or
16  * subparagraph (c)(1)(ii) of the Rights in Technical Data and
17  * Computer Software clause at DFARS 252.227-7013 and/or in
18  * similar or successor clauses in the FAR, or the DOD or NASA
19  * FAR Supplement, or to subparagraphs (c)(1) and (c)(2) of the
20  * Commercial Computer Software--Restricted Rights at 48 CFR
21  * 52.227-19, as applicable. Unpublished-rights reserved under
22  * the Copyright Laws of the United States.
23  * Contractor/Manufacturer is:
24  * Boston Dynamics/78 Fourth Avenue/Waltham MA 02451.
25  */
26 
27 /*********************************************************************
28  **
29  *t diguyFormation
30  **
31  *b Link against: libdiguy
32  */
33 
34 #ifndef __diguyFormation_H
35 #define __diguyFormation_H
36 
37 #ifdef SWIG
38 %module diguyFormation
39 #else
40 #define CPLUSPLUS_ONLY
41 #endif
42 
43 #ifdef CPLUSPLUS_ONLY
44 
45 class bdiScenarioFormation;
46 class diguyFormation;
47 class diguyCharacter;
48 
49 #endif
50 
51 
52 #include <declspec_diguy.h>
53 
54 /****************************************************************************/
55 class BDI_DECLSPEC_diguy diguyFormation
56 {
57 
58 public:
59 
60  /*l
61  *b Description:
62  **
63  ** Returns the name of the object. This pointer will never be NULL.
64  **
65  *b Returns:
66  **
67  ** name of the object
68  **
69  *b Callable From:
70  **
71  *- - C++
72  *- - Script
73  */
74  const char* get_name();
75 
76  /*l
77  *b Description:
78  **
79  ** This function sets the name of this object.
80  **
81  *b Returns:
82  **
83  ** 0 on success, -1 on failure
84  **
85  *b Callable From:
86  **
87  *- - C++
88  *- - Script
89  */
90  int set_name(const char* name);
91 
92  /*l
93  *b Returns:
94  **
95  ** type name of the object; this value will never be NULL
96  **
97  *b Callable From:
98  **
99  *- - C++
100  *- - Script
101  */
102  const char* get_type_name();
103 
104 
105  /*l
106  *b Returns:
107  **
108  ** guide name used by this formation
109  **
110  *b Callable From:
111  **
112  *- - C++
113  *- - Script
114  */
115  const char* get_guide_name();
116 
117  /*l
118  *b Description:
119  **
120  ** Sets number of followers in the formation.
121  **
122  *b Arguments:
123  **
124  *a number - number of followers in this formation
125  **
126  *b Returns:
127  **
128  ** 0 if success
129  **
130  *b Callable From:
131  **
132  *- - C++
133  *- - Script
134  */
135  int set_num_followers(int number);
136 
137  /*l
138  *b Returns:
139  **
140  ** number of members of formation (leader not included)
141  **
142  *b Callable From:
143  **
144  *- - C++
145  *- - Script
146  */
147  int get_num_followers();
148 
149  /*l
150  *b Description:
151  **
152  ** Sets rz offset of member relative to leader.
153  **
154  *b Arguments:
155  **
156  *a follower_index - index of follower to modify
157  *a rz - orientation of member relative to leader, in
158  *a degrees
159  **
160  *b Returns:
161  **
162  ** 0 if success
163  **
164  *b Callable From:
165  **
166  *- - C++
167  *- - Script
168  */
169  int set_follower_rz_offset(int follower_index, float rz);
170 
171  /*l
172  *b Description:
173  **
174  ** Creates a string describing the formation, with positions being
175  ** relative to relative_x and relative_y.
176  **
177  *b Arguments:
178  **
179  *a relative_x, relative_y - relative positions in meters
180  **
181  *b Returns:
182  **
183  ** string containing lua script
184  **
185  *b Callable From:
186  **
187  *- - C++
188  *- - Script
189  */
190  const char* to_lua_string(float relative_x = 0.0f,
191  float relative_y = 0.0f);
192 
193  /*l
194  *b Description:
195  **
196  ** Gets x offset of formation member relative to leader.
197  **
198  *b Arguments:
199  **
200  *a follower_index - index of follower in formation (does not include
201  *a leader)
202  **
203  *b Returns:
204  **
205  ** x offset in meters
206  **
207  *b Callable From:
208  **
209  *- - C++
210  *- - Script
211  */
212  float get_follower_x_offset(int follower_index);
213 
214  /*l
215  *b Description:
216  **
217  ** Gets y offset of formation member relative to leader.
218  **
219  *b Arguments:
220  **
221  *a follower_index - index of follower in formation (does not include
222  *a leader)
223  **
224  *b Returns:
225  **
226  ** y offset in meters
227  **
228  *b Callable From:
229  **
230  *- - C++
231  *- - Script
232  */
233  float get_follower_y_offset(int follower_index);
234 
235  /*l
236  *b Description:
237  **
238  ** Gets rz (or yaw) of formation member relative to leader.
239  **
240  *b Arguments:
241  **
242  *a follower_index - index of follower in formation (does not include
243  *a leader)
244  **
245  *b Returns:
246  **
247  ** rz offset in degrees
248  **
249  *b Callable From:
250  **
251  *- - C++
252  *- - Script
253  */
254  float get_follower_rz_offset(int follower_index);
255 
256  /*l
257  *b Description:
258  **
259  ** Sets role name of member.
260  **
261  *b Arguments:
262  **
263  *a follower_index - index of follower to modify
264  *a role_name - new role
265  **
266  *b Returns:
267  **
268  ** 0 if success
269  **
270  *b Callable From:
271  **
272  *- - C++
273  *- - Script
274  */
275  int set_role_name(int follower_index, const char* role_name);
276 
277  /*l
278  *b Description:
279  **
280  ** Gets role. Roles generally correlate with a character's carried
281  ** object.
282  **
283  * RYAN: Give a little more information on what roles are, and at
284  * least one example.
285  **
286  *b Arguments:
287  **
288  *a follower_index - index of follower in formation (does not include
289  *a leader)
290  **
291  *b Returns:
292  **
293  ** string containing role, or "character" if specific role specified
294  **
295  *b Callable From:
296  **
297  *- - C++
298  *- - Script
299  */
300  const char* get_role_name(int follower_index);
301 
302  /*l
303  *b Arguments:
304  **
305  *a follower_index - index of follower in formation (does not include
306  *a leader)
307  **
308  *b Returns:
309  **
310  ** string containing name of follower, if defined
311  **
312  *b Callable From:
313  **
314  *- - C++
315  *- - Script
316  */
317  const char* get_follower_instance(int follower_index);
318 
319  /*l
320  *b Description:
321  **
322  ** Sets subgroup size. If > 0, this means that there are subgroups
323  ** and that they will be applied.
324  **
325  * RYAN: What is a subgroup? What is it used for? Can there be
326  * only one?
327  **
328  *b Arguments:
329  **
330  *a size - size of subgroup
331  **
332  *b Returns:
333  **
334  ** 0 if success
335  **
336  *b Callable From:
337  **
338  *- - C++
339  *- - Script
340  */
341  int set_subgroup_size(int size);
342 
343  /*l
344  *b Description:
345  **
346  ** Gets size of subgroup. If > 0, this means that there are subgroups
347  ** and that they will be applied.
348  **
349  *b Returns:
350  **
351  ** number of followers in subgroup
352  **
353  *b Callable From:
354  **
355  *- - C++
356  *- - Script
357  */
358  int get_subgroup_size();
359 
360  /*l
361  *b Description:
362  **
363  ** Get number of subgroups
364  **
365  *b Returns:
366  **
367  ** number of subgroups
368  **
369  *b Callable From:
370  **
371  *- - C++
372  *- - Script
373  */
374  int get_num_subgroups();
375 
376  /*l
377  *b Description:
378  **
379  ** Sets index of first subgroup. Any members before this member are
380  ** not in a subgroup.
381  **
382  *b Arguments:
383  **
384  *a index - index of first follower in subgroup
385  **
386  *b Returns:
387  **
388  ** 0 if success
389  **
390  *b Callable From:
391  **
392  *- - C++
393  *- - Script
394  */
395  int set_first_subgroup_index(int index);
396 
397  /*l
398  *b Description:
399  **
400  ** Gets index of first formation member that's in a subgroup.
401  **
402  *b Returns:
403  **
404  ** index of formation member
405  **
406  *b Callable From:
407  **
408  *- - C++
409  *- - Script
410  */
411  int get_first_subgroup_index();
412 
413  /*l
414  *b Description:
415  **
416  ** Sets x, y offsets of member relative to leader.
417  **
418  *b Arguments:
419  **
420  *a follower_index - index of follower to modify
421  *a x, y - offsets of member relative to leader, in meters
422  **
423  * RYAN: Does follower_index include leader?
424  **
425  *b Returns:
426  **
427  ** 0 if success
428  **
429  *b Callable From:
430  **
431  *- - C++
432  *- - Script
433  */
434  int set_follower_offset(int follower_index, float x, float y);
435 
436  /*l
437  *b Returns:
438  **
439  ** radius of formation, in meters
440  **
441  * RYAN: Radius of what? Relative to what? The leader?
442  **
443  *b Callable From:
444  **
445  *- - C++
446  *- - Script
447  */
448  float get_radius();
449 
450 
455 #ifdef CPLUSPLUS_ONLY
456  bdiScenarioFormation* get_scripted_object() {return m_scripted_object;}
457 
458 private:
459 
460  /*l
461  ** A private constructor.
462  */
463  diguyFormation(bdiScenarioFormation* formation);
464 
465  /*l
466  ** A pointer to internal data.
467  */
468  bdiScenarioFormation* m_scripted_object;
469 
470  friend class bdiScenarioFormation;
471 
472 #endif
473 
474 };
475 
476 #endif /* __diguyFormation_H */
477