Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoTrackFollower.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23/*==============================================================================
24* Classes : SoTrackFollower
25* Author(s) : Fabien ARNAUD
26* : Jerome HUMMEL
27* Date : Jul, 23 2002
28*==============================================================================
29*
30* Description : See below
31*
32*============================================================================*/
33
34#ifndef _SO_TRACK_FOLLOWER_H_
35#define _SO_TRACK_FOLLOWER_H_
36
37#include <Inventor/engines/SoSubEngine.h>
38#include <Inventor/fields/SoSFFloat.h>
39#include <Inventor/fields/SoMFFloat.h>
40#include <Inventor/fields/SoSFVec3f.h>
41#include <Inventor/fields/SoMFVec3f.h>
42#include <Inventor/fields/SoSFBool.h>
43#include <Inventor/fields/SoMFBool.h>
44#include <Inventor/fields/SoSFRotation.h>
45#include <Inventor/fields/SoMFRotation.h>
46#include <Inventor/nodes/SoCoordinate3.h>
47
48#define SO_UNDEFINED_TIME_STAMP (-1)
49
50
51
103class SoTrackFollower : public SoEngine {
104
105 SO_ENGINE_HEADER (SoTrackFollower);
106
107 public:
108
109 // Input fields
114
145
157
158
175
188
200
209
214
226
233
234 // Output fields
235
239 SoEngineOutput position; // (SoSFVec3f) position
240
246 SoEngineOutput orientation; // (SoSFRotation) position
247
248 // Constructor
249
254
255 private:
256 // Internal values access
257
262 float getAlphaValue (int control_point)
263 { return m_01_time [control_point]; }
264
273 void getTrackCoordinate (SoCoordinate3* coords, float width = 1, SbBool flat = FALSE, int precision = 16);
274
279 void computeData (float alpha, SbVec3f& vessel_pos, SbRotation& vessel_rot, SbRotation& roll_rot, SbRotation& head_rot);
280
281 private:
282 static void initClass();
283 static void exitClass();
284
285 private:
286 // Destructor
288
289 virtual void inputChanged (SoField* whichField);
290
291 // Evaluation method
292 virtual void evaluate();
293
294 private:
295 // Time used for interpolation
296 void compute01Time();
297 float* m_01_time;
298 SbBool m_need_01time_computation;
299
300 // Smooth angles
301 void computeAngles();
302 SbBool m_need_angles_computation;
303 float* m_turn_start_time;
304 float* m_turn_end_time;
305 float* m_turn_gamma;
306 SbVec3f* m_turn_center;
307 SbVec3f* m_turn_normal;
308 SbVec3f* m_turn_start_point;
309 SbVec3f* m_turn_end_point;
310};
311
312#endif // _SO_TRACK_FOLLOWER_H_
313
314
Class for representing a rotation.
Definition SbRotation.h:126
3D vector class.
Definition SbVec.h:932
Coordinate point node.
Base class for all engines.
Definition SoEngine.h:133
Class for all engine outputs.
Definition SoEngine.h:282
Base class for all fields.
Definition SoField.h:234
Multiple-value field containing any number of Boolean values.
Definition SoMFBool.h:90
Multiple-value field containing any number of floating point values.
Definition SoMFFloat.h:90
Multiple-value field containing any number of SbRotations.
Multiple-value field containing any number of three-dimensional vectors.
Definition SoMFVec3f.h:181
Field containing a single Boolean value.
Definition SoSFBool.h:79
Field containing a floating-point value.
Definition SoSFFloat.h:78
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Animates an obje...
SoMFFloat rollAngle
Roll angle during the turn at a control point.
SoSFBool loop
If loop is TRUE, the animation will loop.
SoMFRotation headRotation
The final rotation applied at a control point, which allows the camera or the object to be rotated wh...
SoEngineOutput orientation
(SoSFRotation) Rotation interpolated from the alpha value.
SoMFFloat rollSpeed
Speed at which the roll angle is reached during a turn.
SoMFBool keepRollAngle
Indicates if the roll angle should be maintained after the middle of the turn.
SoSFFloat alpha
The value on which the interpolation is made.
SoSFBool useHeadRotationOnly
If TRUE, the orientation output field is a direct interpolation of headRotation values,...
SoMFFloat timeStamps
Time stamps associated with the control points.
SoEngineOutput position
(SoSFVec3f) Position interpolated from the alpha value.
SoTrackFollower()
Constructor.
SoMFFloat radius
Radius of the turn at a control point.
SoMFVec3f points
Coordinates of the control points.
int SbBool
Boolean type.
Definition SbBase.h:87