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