DI-Guy SDK Documentation  13.5
diguyWaypoint.h
Go to the documentation of this file.
1 
2 /*********************************************************************
3  ** Copyright (c) 1992-2020 MAK Technologies, Inc.
4  ** All rights reserved.
5  *********************************************************************/
6 
7 /*********************************************************************
8  **
9  *t diguyWaypoint
10  **
11  *b Link against: libdiguy
12  */
13 
14 #ifndef __diguyWaypoint_H
15 #define __diguyWaypoint_H
16 
17 #ifdef SWIG
18 %module diguyWaypoint
19 #else
20 #define CPLUSPLUS_ONLY
21 #endif
22 
23 #ifdef CPLUSPLUS_ONLY
24 class bdiBeadWaypoint;
25 #endif
26 
27 
28 #include <declspec_diguy.h>
29 
30 /****************************************************************************/
31 class BDI_DECLSPEC_diguy diguyWaypoint
32 {
33 
34 public:
35 
36 /*****************************************************************************/
47  /*l
48  *b Description:
49  **
50  ** Returns the name of the object. This pointer will never be NULL.
51  **
52  *b Returns:
53  **
54  ** name of the object
55  */
56  const char* get_name();
57 
58  /*l
59  *b Description:
60  **
61  ** All waypoints are assigned a unique identifier, or uid. This
62  ** function returns this waypoints's uid.
63  **
64  ** *Note*: unique identifiers will change between DI-Guy runs!
65  **
66  *b Returns:
67  **
68  ** unique identifier of object
69  */
70  long get_uid();
71 
72  /*l
73  *b Returns:
74  **
75  ** 1 if waypoint is selected in DI-Guy Scenario or DI-Guy Author, 0
76  ** if not.
77  */
78  int get_selected();
79 
80 
81 
82 /*****************************************************************************/
103  /*l
104  *b Description:
105  **
106  ** This function sets the x, y, z coordinates of the waypoint in
107  ** meters.
108  **
109  ** Requires subsequent call to diguyCharacterPath::update() or
110  ** diguyPathShape::update(). (See above.)
111  **
112  *b Returns:
113  **
114  ** x, y, z coordinate of waypoint in meters
115  */
116  void set_position(float x, float y, float z);
117 
118  /*l
119  *b Description:
120  **
121  ** Double precision version of set_position().
122  */
123  void set_position_double(double x, double y, double z);
124 
125  /*l
126  *b Returns:
127  **
128  ** x, y, z coordinate of waypoint in meters
129  **
130  ** Note: in Lua this will return 3 values.
131  */
132  void get_position(float* x, float* y, float* z);
133 
134  /*l
135  *b Description:
136  **
137  ** Double precision version of get_position().
138  **
139  ** Note: in Lua this will return 3 values.
140  */
141  void get_position_double(double* tx, double* ty, double* tz);
142 
143  /*l
144  *b Description:
145  **
146  ** Sets the orientation of the path entering the waypoint.
147  **
148  ** If the angles in and angles out are coupled (e.g.,
149  ** get_yaw_coupled() returns 1) this will set rz out, as well. The
150  ** new angle out will be angle in plus the angle coupling offset.
151  **
152  ** Requires subsequent call to diguyCharacterPath::update() or
153  ** diguyPathShape::update(). (See above.)
154  **
155  *b Arguments:
156  **
157  *a rz, rx, ry - orientations in degrees
158  */
159  void set_orientation_in(float rz, float rx, float ry);
160 
161  /*l
162  *b Description:
163  **
164  ** Retrieves the orientation of the path entering the waypoint.
165  **
166  *b Arguments:
167  **
168  *a rz, rx, ry - orientations in degrees counter-clockwise from the
169  *a positive X axis
170  **
171  ** Note: in Lua this will return 3 values.
172  */
173  void get_orientation_in(float* rz, float* rx, float* ry);
174 
175  /*l
176  *b Description:
177  **
178  ** Equivalent to set_orientation_in(), but for the path exiting the
179  ** waypoint.
180  */
181  void set_orientation_out(float rz, float rx, float ry);
182 
183  /*l
184  *b Description:
185  **
186  ** Equivalent to get_orientation_in(), but for the path exiting the
187  ** waypoint.
188  **
189  ** Note: in Lua this will return 3 values.
190  */
191  void get_orientation_out(float* rz, float* rx, float* ry);
192 
193  /*l
194  *b Description:
195  **
196  ** This function sets whether the yaw in and yaw out angles are
197  ** coupled together. In general, for paths to look smooth, the in and
198  ** out angles should be coupled together with 0 coupling offset.
199  **
200  ** Requires subsequent call to diguyCharacterPath::update() or
201  ** diguyPathShape::update(). (See above.)
202  **
203  *b Arguments:
204  **
205  *a yaw_coupled - pass 1 to couple yaw in to yaw out
206  */
207  void set_yaw_coupled(int yaw_coupled);
208 
209  /*l
210  *b Returns:
211  **
212  ** whether the yaw in and yaw out angles are coupled together;
213  ** see set_yaw_coupled()
214  */
215  int get_yaw_coupled();
216 
217  /*l
218  *b Description:
219  **
220  ** This function sets by how much the yaw in and yaw out angles should
221  ** be offset when they are coupled together.
222  **
223  ** Requires subsequent call to diguyCharacterPath::update() or
224  ** diguyPathShape::update(). (See above.)
225  **
226  *b Arguments:
227  **
228  *a yaw_coupling_offset - new yaw coupling offset, in degrees
229  */
230  void set_yaw_coupling_offset(float yaw_coupling_offset);
231 
232  /*l
233  *b Returns:
234  **
235  ** the offset between yaw in and yaw out when the yaw angles are
236  ** coupled together; see set_yaw_coupling_offset()
237  */
238  float get_yaw_coupling_offset();
239 
240  /*l
241  *b Description:
242  **
243  ** This function is the same as its yaw counterpart, but rotation
244  ** is about the x axis.
245  */
246  void set_roll_coupled(int roll_coupled);
247 
248  /*l
249  *b Description:
250  **
251  ** This function is the same as its yaw counterpart, but rotation
252  ** is about the x axis.
253  */
254  int get_roll_coupled();
255 
256  /*l
257  *b Description:
258  **
259  ** This function is the same as its yaw counterpart, but rotation
260  ** is about the x axis.
261  */
262  void set_roll_coupling_offset(float roll_coupling_offset);
263 
264  /*l
265  *b Description:
266  **
267  ** This function is the same as its yaw counterpart, but rotation
268  ** is about the x axis.
269  */
270  float get_roll_coupling_offset();
271 
272  /*l
273  *b Description:
274  **
275  ** This function is the same as its yaw counterpart, but rotation
276  ** is about the y axis.
277  */
278  void set_pitch_coupled(int pitch_coupled);
279 
280  /*l
281  *b Description:
282  **
283  ** This function is the same as its yaw counterpart, but rotation
284  ** is about the y axis.
285  */
286  int get_pitch_coupled();
287 
288  /*l
289  *b Description:
290  **
291  ** This function is the same as its yaw counterpart, but rotation
292  ** is about the y axis.
293  */
294  void set_pitch_coupling_offset(float pitch_coupling_offset);
295 
296  /*l
297  *b Description:
298  **
299  ** This function is the same as its yaw counterpart, but rotation
300  ** is about the y axis.
301  */
302  float get_pitch_coupling_offset();
303 
304 
305 /*****************************************************************************
306  **
307  *2 Control Point Functions
308  **
309  ** Unless otherwise noted all functions in this class section are callable from:
310  **
311  *- - C++
312  *- - Script
313  **
314  */
315 
316  /*l
317  *b Description:
318  **
319  ** This function sets the weight of the control handle heading into
320  ** the waypoint. The weights of the waypoint set how long the
321  ** "control handles" of the waypoint are, in meters. The longer the
322  ** control handle, the more the path will be stretched in the
323  ** direction of the waypoint's orientation.
324  **
325  ** If the weight in and weight out are coupled (get_weight_coupled()
326  ** returns 1) this will set weight out, as well.
327  **
328  ** Requires subsequent call to diguyCharacterPath::update() or
329  ** diguyPathShape::update(). (See above.)
330  */
331  void set_weight_in(float weight_in);
332 
333  /*l
334  *b Returns:
335  **
336  ** weight heading into the waypoint, in meters; see set_weight_in()
337  */
338  float get_weight_in();
339 
340  /*l
341  *b Description:
342  **
343  ** Similar to set_weight_in(), but for the outgoing weight.
344  */
345  void set_weight_out(float weight_out);
346 
347  /*l
348  *b Returns:
349  **
350  ** weight heading out of the waypoint, in meters; see
351  ** set_weight_out().
352  */
353  float get_weight_out();
354 
355  /*l
356  *b Description:
357  **
358  ** This function sets whether the weight in and weight out are
359  ** coupled together.
360  **
361  ** If this waypoint is part of a diguyCharacterPath or diguyPathShape,
362  ** the diguyCharacterPath::update() or diguyPathShape::update()
363  ** function must be called for changes to take effect.
364  */
365  void set_weight_coupled(int weight_coupled);
366 
367  /*l
368  *b Returns:
369  **
370  ** whether the weight in and weight out are coupled together;
371  ** see set_weight_coupled()
372  */
373  int get_weight_coupled();
374 
375  /*l
376  *b Description:
377  **
378  ** This function returns the world position of the control point
379  ** heading into the waypoint. This is derived from the waypoint's
380  ** position, orientation in, and the weights of the in control bar.
381  */
382  void get_control_point_in_position(float* x, float* y, float* z);
383 
384  /*l
385  *b Description:
386  **
387  ** Similar to get_control_point_in_position(), but for out control
388  ** point.
389  */
390  void get_control_point_out_position(float* x, float* y, float* z);
391 
392  /*l
393  *b Description:
394  **
395  ** This function returns the normal vector of the control bar heading
396  ** into the waypoint.
397  */
398  void get_forward_normal_in(float* x, float* y, float* z);
399 
400  /*l
401  *b Description:
402  **
403  ** Similar to get_forward_normal_in(), but for left normal.
404  */
405  void get_left_normal_in(float* x, float* y, float* z);
406 
407  /*l
408  *b Description:
409  **
410  ** Similar to get_out_normal_in(), but for up normal.
411  */
412  void get_up_normal_in(float* x, float* y, float* z);
413 
414  /*l
415  *b Description:
416  **
417  ** Similar to get_forward_normal_in(), but for out control bar.
418  */
419  void get_forward_normal_out(float* x, float* y, float* z);
420 
421  /*l
422  *b Description:
423  **
424  ** Similar to get_left_normal_in(), but for out control bar.
425  */
426  void get_left_normal_out(float* x, float* y, float* z);
427 
428  /*l
429  *b Description:
430  **
431  ** Similar to get_up_normal_in(), but for out control bar.
432  */
433  void get_up_normal_out(float* x, float* y, float* z);
434 
435 
436 /*****************************************************************************/
442  /*l
443  *b Description:
444  **
445  ** This function sets how many segments the path portion this waypoint
446  ** begins will be divided into. This is strictly for visualization
447  ** purposes only and will have no functional effect.
448  **
449  ** If this waypoint is part of a diguyCharacterPath or diguyPathShape,
450  ** the diguyCharacterPath::update() or diguyPathShape::update()
451  ** function must be called for changes to take effect.
452  **
453  *b Arguments:
454  **
455  *a num_segments - number of segments to divide path portion into;
456  ** default is 64
457  */
458  void set_num_segments(int num_segments);
459 
460  /*l
461  *b Returns:
462  **
463  ** how many segments the path portion this waypoint begins will be
464  ** divided into; see set_num_segments()
465  */
466  int get_num_segments();
467 
468 
469 /****************************************************************************/
470 /****************************************************************************/
471 /****************************************************************************/
482 /****************************************************************************/
483 /****************************************************************************/
484 /****************************************************************************/
485 
486  /*l
487  ** This function is deprecated. Use set_position() instead.
488  */
489  void set_x(float x);
490 
491  /*l
492  ** This function is deprecated. Use get_position() instead.
493  */
494  float get_x();
495 
496  /*l
497  ** This function is deprecated. Use set_position() instead.
498  */
499  void set_y(float y);
500 
501  /*l
502  ** This function is deprecated. Use get_position() instead.
503  */
504  float get_y();
505 
506  /*l
507  ** This function is deprecated. Use set_position() instead.
508  */
509  void set_z(float z);
510 
511  /*l
512  ** This function is deprecated. Use get_position() instead.
513  */
514  float get_z();
515 
516  /*l
517  ** This function is deprecated. Use set_orientation_in() instead.
518  */
519  void set_yaw_in(float yaw);
520 
521  /*l
522  ** This function is deprecated. Use get_orientation_in() instead.
523  */
524  float get_yaw_in();
525 
526  /*l
527  ** This function is deprecated. Use set_orientation_out() instead.
528  */
529  void set_yaw_out(float yaw);
530 
531  /*l
532  ** This function is deprecated. Use get_orientation_out() instead.
533  */
534  float get_yaw_out();
535 
536  /*l
537  ** This function is deprecated. Use get_yaw_coupled() instead.
538  */
539  int get_yaw_smooth();
540 
541  /*l
542  ** This function is deprecated. Use set_yaw_coupled() instead.
543  */
544  void set_yaw_smooth(int yaw_smooth);
545 
546  /*l
547  ** This function is deprecated. Use get_yaw_coupling_offset()
548  ** instead.
549  */
550  float get_yaw_offset();
551 
552  /*l
553  ** This function is deprecated. Use set_yaw_coupling_offset()
554  ** instead.
555  */
556  void set_yaw_offset(float yaw_offset);
557 
558  /*l
559  ** This function is deprecated. Use set_orientation_in() instead.
560  */
561  void set_roll_in(float roll);
562 
563  /*l
564  ** This function is deprecated. Use get_orientation_in() instead.
565  */
566  float get_roll_in();
567 
568  /*l
569  ** This function is deprecated. Use set_orientation_out() instead.
570  */
571  void set_roll_out(float roll);
572 
573  /*l
574  ** This function is deprecated. Use get_orientation_out() instead.
575  */
576  float get_roll_out();
577 
578  /*l
579  ** This function is deprecated. Use get_roll_coupled() instead.
580  */
581  int get_roll_smooth();
582 
583  /*l
584  ** This function is deprecated. Use set_roll_coupled() instead.
585  */
586  void set_roll_smooth(int roll_smooth);
587 
588  /*l
589  ** This function is deprecated. Use get_roll_coupling_offset()
590  ** instead.
591  */
592  float get_roll_offset();
593 
594  /*l
595  ** This function is deprecated. Use set_roll_coupling_offset()
596  ** instead.
597  */
598  void set_roll_offset(float roll_offset);
599 
600  /*l
601  ** This function is deprecated. Use set_orientation_in() instead.
602  */
603  void set_pitch_in(float pitch);
604 
605  /*l
606  ** This function is deprecated. Use get_orientation_in() instead.
607  */
608  float get_pitch_in();
609 
610  /*l
611  ** This function is deprecated. Use set_orientation_out() instead.
612  */
613  void set_pitch_out(float pitch);
614 
615  /*l
616  ** This function is deprecated. Use get_orientation_out() instead.
617  */
618  float get_pitch_out();
619 
620  /*l
621  ** This function is deprecated. Use get_pitch_coupled() instead.
622  */
623  int get_pitch_smooth();
624 
625  /*l
626  ** This function is deprecated. Use set_pitch_coupled() instead.
627  */
628  void set_pitch_smooth(int pitch_smooth);
629 
630  /*l
631  ** This function is deprecated. Use get_pitch_coupling_offset()
632  ** instead.
633  */
634  float get_pitch_offset();
635 
636  /*l
637  ** This function is deprecated. Use get_pitch_coupling_offset()
638  ** instead.
639  */
640  void set_pitch_offset(float pitch_offset);
641 
642  /*l
643  ** This function is deprecated. Use get_weight_coupled()
644  ** instead.
645  */
646  int get_distance_smooth();
647 
648  /*l
649  ** This function is deprecated. Use set_weight_coupled()
650  ** instead.
651  */
652  void set_distance_smooth(int distance_smooth);
653 
654 
655 /****************************************************************************/
656 /****************************************************************************/
657 
662 #ifdef CPLUSPLUS_ONLY
663 
664  bdiBeadWaypoint* get_scripted_object() {return m_scripted_object;}
665 
666 private:
667 
668  /*l
669  ** A private constructor.
670  */
671  diguyWaypoint(bdiBeadWaypoint* waypoint);
672 
673  /*l
674  ** A private destructor.
675  */
676  ~diguyWaypoint();
677 
678  /*l
679  ** A pointer to internal data.
680  */
681  bdiBeadWaypoint* m_scripted_object;
682 
683  friend class diguyScenario;
684  friend class bdiBeadWaypoint;
685 
686 #endif
687 
688 };
689 
690 
691 #endif /* __diguyWaypoint_H */
Represents the scenario currently being portrayed.
Definition: diguyScenario.h:100
Definition: diguyWaypoint.h:29