| GL Studio C++ Runtime API

gls_moving_eye.h
Go to the documentation of this file.
1/*! \file
2 \brief The disti::GlsMovingEye class.
3
4 \par Copyright Information
5
6 Copyright (c) 2017 by The DiSTI Corporation.<br>
7 11301 Corporate Blvd; Suite 100<br>
8 Orlando, Florida 32817<br>
9 USA<br>
10 <br>
11 All rights reserved.<br>
12
13 This Software contains proprietary trade secrets of DiSTI and may not be
14 reproduced, in whole or part, in any form, or by any means of electronic,
15 mechanical, or otherwise, without the written permission of DiSTI. Said
16 permission may be derived through the purchase of applicable DiSTI product
17 licenses which detail the distribution rights of this content and any
18 Derivative Works based on this or other copyrighted DiSTI Software.
19
20 NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26
27 LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34 EXCEED FIVE DOLLARS (US$5.00).
35
36 The aforementioned terms and restrictions are governed by the laws of the
37 State of Florida and the United States of America.
38
39*/
40#ifndef INCLUDED_GLS_MOVING_EYE_H
41#define INCLUDED_GLS_MOVING_EYE_H
42
43#include <cstddef>
44#include <queue>
45
46#ifdef __VXWORKS__
47# define va_list std::va_list
48#endif
49
50#include "gls_cpp_lang_support.h"
51#include "gls_eyepoint.h"
52
53/// Provides support for creating DLLs.
54#if( defined( GLSGEN_EXPORT_GLSMOVINGEYE ) || defined( GLSGEN_IMPORT_GLSMOVINGEYE ) || defined( GLS_EXPORT_GENERATED ) || defined( GLS_IMPORT_GENERATED ) ) \
55 && defined( _MSC_VER )
56# if defined( GLSGEN_EXPORT_GLSMOVINGEYE ) || defined( GLS_EXPORT_GENERATED )
57# define GLSGEN_GLSMOVINGEYE_EXPORT __declspec( dllexport )
58# else
59# define GLSGEN_GLSMOVINGEYE_EXPORT __declspec( dllimport )
60# endif
61#else
62# define GLSGEN_GLSMOVINGEYE_EXPORT
63#endif
64///////////////////////////////////////////////////////////////////////////////
65
66/// Automatically link the runtime library plugin (on Windows).
67#define LIB_BASE_NAME "gls_moving_eye"
68#include "gls_auto_lib.h"
69#undef LIB_BASE_NAME
70
71 namespace disti
72{
73// SetValue enumerations
74 enum
75{
76 GLS_MOVINGEYE_EMIT_EVENT = GLS_EYEPOINT_VIEW_VECTORS + 1,
77 GLS_MOVINGEYE_LOOK_AT_OBJECT,
78 GLS_MOVINGEYE_MAX_SPEED,
79 GLS_MOVINGEYE_MOVEMENT,
80 GLS_MOVINGEYE_ROUTE,
81 GLS_MOVINGEYE_DISABLE_HISTORY
82};
83
84//------------------------------------------------------------------------
85/**
86* Runtime implementation of a GlsMovingEye
87*/
88 class GlsMovingEye : public GlsEyePoint
89{
90 private:
91 GlsMovingEye& operator=( const GlsMovingEye& ) DISTI_SPECIAL_MEM_FUN_DELETE;
92 GlsMovingEye( const GlsMovingEye& ) DISTI_SPECIAL_MEM_FUN_DELETE;
93
94 public:
95 DISTI_DEPRECATED( "This identifier is forbidden by the C++ standard. Use BaseClass instead." )
96 typedef GlsEyePoint _BaseClass; ///< Deprecated typedef for the base class.
97 typedef GlsEyePoint BaseClass; ///< Typedef for the base class.
98
99 /// This specifies the type of route taken from one eyepoint to another.
100 enum Movement_t
101 {
102 CONSTANT = 0,
103 SINUSOIDAL = 1
104 };
105
106 /// This specifies the type of route taken from one eyepoint to another.
107 enum Route_t
108 {
109 DIRECT = 0,
110 ARC = 1
111 };
112
113 static const char* MOVE_COMPLETE_EVENT_NAME; ///< Name of the event emitted when a move is completed
114
115 //------------------------------------------------------------------------
116 /**
117 * Create a new GlsMovingEye.
118 */
119 GLSGEN_GLSMOVINGEYE_EXPORT GlsMovingEye();
120
121 /// Copy constructor
122 /// \param that The object to copy from.
123 /// \param generateNames Whether or not to generate an instance name for this object.
124 GLSGEN_GLSMOVINGEYE_EXPORT GlsMovingEye( const GlsMovingEye& that, const bool generateNames );
125
126 //------------------------------------------------------------------------
127 /**
128 * GlsMovingEyeEditor destructor
129 */
130 virtual GLSGEN_GLSMOVINGEYE_EXPORT ~GlsMovingEye();
131
132 /// \return True if the we're at the beginning of the history of movements.
133 bool AtStartOfHistory() const
134 {
135 return _historyPos == 0;
136 }
137
138 /// \return True if the we're at the end of the history of movements.
139 bool AtEndOfHistory() const
140 {
141 return _historyPos == _moveHistory.size() - 1;
142 }
143
144 //------------------------------------------------------------------------
145 /**
146 * Aborts any move currently in progress.
147 */
148 GLSGEN_GLSMOVINGEYE_EXPORT void AbortMove();
149
150 virtual GLSGEN_GLSMOVINGEYE_EXPORT void SetAvailableAttributes( unsigned int value ) DISTI_METHOD_OVERRIDE;
151 virtual GLSGEN_GLSMOVINGEYE_EXPORT void Calculate( double time ) DISTI_METHOD_OVERRIDE;
152 virtual GLSGEN_GLSMOVINGEYE_EXPORT DisplayObject* CloneObject( bool generateNames = false ) DISTI_METHOD_OVERRIDE;
153 virtual GLSGEN_GLSMOVINGEYE_EXPORT void CopyProperties( DisplayObject* src ) DISTI_METHOD_OVERRIDE;
154
155 /// \return A pointer to a new GlsMovingEye object.
156 static GLSGEN_GLSMOVINGEYE_EXPORT DisplayObject* CreateInstance();
157
158 virtual GLSGEN_GLSMOVINGEYE_EXPORT void Draw() DISTI_METHOD_OVERRIDE;
159
160 /// \return Whether or not an event is emitted upon completion of a commanded movement.
161 bool EmitEvent() const { return _emitEvent; }
162
163 /// Sets whether or not an event is emitted upon completion of a commanded movement.
164 /// \param emitEvent The new event emit state.
165 void EmitEvent( bool emitEvent );
166
167 /// \return Whether or not an the move history is disabled.
168 bool DisableMoveHistory() const { return _disableMoveHistory; }
169
170 /// Sets whether or not the move history is disabled.
171 /// \param his The new move history state.
172 void DisableMoveHistory( bool his );
173
174 virtual GLSGEN_GLSMOVINGEYE_EXPORT void GenerateInstanceName() DISTI_METHOD_OVERRIDE;
175
176#ifndef GLES
177 virtual GLSGEN_GLSMOVINGEYE_EXPORT InterfaceListType* GetCppInterfaceDescription( InterfaceListType* addToThisList = 0 ) DISTI_METHOD_OVERRIDE;
178 virtual GLSGEN_GLSMOVINGEYE_EXPORT void GetCppInterfaceDescriptionFree( InterfaceListType* array ) DISTI_METHOD_OVERRIDE;
179#endif
180 //------------------------------------------------------------------------
181 /**
182 * \return The name of the object that the eyepoint should be always
183 * looking at.
184 * Lifetime is guaranteed to coincide with the GlsMovingEye's lifetime
185 * or until LookAtObject is changed.
186 */
187 const std::string& LookAtObject() const { return _lookAtObject; }
188
189 /// Sets the name of the object that the eyepoint should be always looking at.
190 /// \param name The name of the object in question.
191 void LookAtObject( const std::string& name );
192
193 /// \return The maximum speed in logical units/second which will be used to achive the transition between eyepoints.
194 float MaxSpeed() const { return _maxSpeed; }
195
196 /// Sets the maximum speed in logical units/second which will be used to achive the transition between eyepoints.
197 /// \param speed The new speed to set in logical units/second.
198 void MaxSpeed( float speed );
199
200 /// \return The type of movement algorithm to use when moving to another eyepoint.
201 Movement_t Movement() const { return _movement; }
202
203 /// Sets the type of movement algorithm to use when moving to another eyepoint.
204 /// \param movementType The new movement algorithm to use.
205 void Movement( Movement_t movementType );
206
207 //------------------------------------------------------------------------
208 /**
209 * Moves this eyepoint to the previously set eyepoint. If a move is
210 * already in progress, it will be immediately stopped, and this move
211 * will start.
212 */
213 GLSGEN_GLSMOVINGEYE_EXPORT void MoveBack();
214
215 //------------------------------------------------------------------------
216 /**
217 * Moves this eyepoint to the eyepoint which was last achieved from a
218 * MoveBack(). If a move is already in progress, it will be immediately
219 * stopped, and this move will start.
220 */
221 GLSGEN_GLSMOVINGEYE_EXPORT void MoveForward();
222
223 /// Causes this eye to move from its current state to the state specified
224 /// by the targetEye. It will take moveTime to get there. If a move is
225 /// already in progress, it will be immediately stopped, and this move
226 /// will start.
227 /// \param eye The eyepoint to move to.
228 /// \param moveTime The time to take in seconds.
229 GLSGEN_GLSMOVINGEYE_EXPORT void MoveToEye( GlsEyePoint* eye, float moveTime = 2.0f );
230
231 /// Causes the eye to move from its current state to each eyepoint in the
232 /// specified group ending with the last eye in the group. If a move is
233 /// already in progress, it will be immediately stopped, and this move
234 /// will start.
235 /// \param eyeGroup The group to search recursively for GlsEyepoint objects.
236 /// \param moveTime The time to take for each move in seconds.
237 GLSGEN_GLSMOVINGEYE_EXPORT void MoveToEye( Group* eyeGroup, float moveTime = 2.0f );
238
239 /// Causes the specified eye to be added to the end of the list of eyes
240 /// which should be moved through.
241 /// \param eye The eyepoint to add to the list.
242 /// \param moveTime The time to take in seconds.
243 GLSGEN_GLSMOVINGEYE_EXPORT void MoveToEyeAdd( GlsEyePoint* eye, float moveTime = 2.0f );
244
245 /// Causes the specified eyes to be added to the end of the list of eyes
246 /// which should be moved through.
247 /// \param eyeGroup The group to search recursively for GlsEyepoint objects.
248 /// \param moveTime The time to take for each move in seconds.
249 GLSGEN_GLSMOVINGEYE_EXPORT void MoveToEyeAdd( Group* eyeGroup, float moveTime = 2.0f );
250
251 /// Causes this eye to move to the specified location in the scene without
252 /// modifying the view direction or any other eye specific information.
253 /// \param location The location to move to.
254 /// \param moveTime The time to take in seconds.
255 GLSGEN_GLSMOVINGEYE_EXPORT void MoveToLocation( const Vector& location, float moveTime = 2.0f );
256
257 /// Moves the eyepoint in view-relative coordinates by the specified amount.
258 /// The units are in relative screen coordinates:
259 /// X and Y are pixels, Z is 0->1. See WindowToLogical() or LogicalToWindow().
260 /// \param moveAmount The amount to move on each axis.
261 /// \param rotation The amount to rotate on each axis in degrees.
262 GLSGEN_GLSMOVINGEYE_EXPORT void MoveRelative( const Vector& moveAmount, const Vector& rotation );
263
264 /// \return The type of route to use when moving to another eyepoint.
265 Route_t Route() const { return _route; }
266
267 /// Sets the type of route to use when moving to another eyepoint.
268 /// \param routeType The new route type to set.
269 void Route( Route_t routeType );
270
271 GLSGEN_GLSMOVINGEYE_EXPORT virtual void SetValue( int spec, va_list& args ) DISTI_METHOD_OVERRIDE;
272
273 protected:
274#ifdef GLES
275 /** Set a single attribute from the GLO file.
276 * \param data The attribute to set and its associated data.
277 */
278 GLSGEN_GLSMOVINGEYE_EXPORT virtual void SetFromGloData( GlsGloFileAttribute& data ) DISTI_METHOD_OVERRIDE;
279#endif
280
281 /// Type to store eyepoint state information.
282 struct EyeState_t
283 {
284 Vector location; ///< Location of the eyepoint in logical units.
285 bool orthographic; ///< True if orthographic projection, else perspective projection.
286 double FOV; ///< Field of view of eyepoint in Degrees, if fovIsHorizontal is true, this is horizontal.
287 double otherFOV; ///< Field of view for the other direction, based on fovIsHorizontal.
288 bool fovIsHorizontal; ///< True if field of view measurement is along horizonal axis, else along vertical axis.
289 double orthoSize; ///< Size of ortho projection in logical units, if fovIsHorizontal is true, this is horizontal.
290 double otherOrthoSize; ///< Size of ortho projection for the other direction, based on fovIsHorizontal.
291 double farClip; ///< Distance from eyepoint to near clipping plane.
292 double nearClip; ///< Distance from eyepoint to far clipping plane.
293 FovConstraintType horizontalConstraint; ///< The type of constraint in the horizontal direction.
294 FovConstraintType verticalConstraint; ///< The type of constraint in the vertical direction.
295 Vector viewVectors[ 3 ]; ///< 3 vectors used to set the orientation of the eyepoint.
296
297 /** Default constructor */
298 EyeState_t();
299
300 /** Initialize EyeState_t using targetEye parameters.
301 * \param movingEye The GlsMovingEye that the state information is for (needed for coordinate conversions)
302 * \param targetEye The GlsEyePoint to move to
303 */
304 EyeState_t( GlsMovingEye* movingEye, GlsEyePoint* targetEye );
305
306 /// Copied from GlsEyePoint::Direction()
307 /// \return The Z view vector for this state.
308 inline Vector Direction()
309 {
310 return viewVectors[ 2 ];
311 }
312 };
313
314 /// Type to store eyepoint movement parameters.
315 struct MoveParms_t : public EyeState_t
316 {
317 bool addToHistory; ///< If true, will be added to eyepoint movement history.
318 double time; ///< The amount of time to move in seconds.
319 std::string qualifiedEyeName; ///< The name of the eyepoint object to move to.
320
321 /// Constructor
322 /// \param storeHistory If true, will be added to eyepoint movement history.
323 /// \param moveTime The amount of time to move in seconds.
324 /// \param movingEye The eye to move.
325 /// \param targetEye The eye to move to.
326 MoveParms_t( bool storeHistory, double moveTime, GlsMovingEye* movingEye, GlsEyePoint* targetEye );
327 };
328
329 /// Whether or not to emit an event when the move has completed.
330 bool _emitEvent;
331
332 /// This is true when a move is occurring and the route segment being
333 /// moved along is the very first one in the queue. This is used during
334 /// sinusoidal movement to smoothly speed up when starting.
335 bool _firstSegment;
336
337 /// Current position into the history list
338 std::size_t _historyPos;
339
340 /// Flag to keep track of when the object gets initialized.
341 bool _initialized;
342
343 /// Automatically adjust the view direction to point at the specified
344 /// targetObject. This is inactivated when the string is blank.
345 /// While this is active, the move methods will not control the view
346 /// direction. They can still control the position and other eye
347 /// information.
348 std::string _lookAtObject;
349
350 /// The last up vector provided by the user or the move code.
351 /// Used by the 'look at' algorithm to orient the eyepoint
352 Vector _lookAtReferenceUpVector;
353
354 /// The last up vector calculated by the lookAt algorithm.
355 Vector _lookAtCalculatedUpVector;
356
357 /// Stores a history of visited eyepoints for moving back and forth.
358 std::vector<MoveParms_t> _moveHistory;
359
360 bool _disableMoveHistory; ///< If true, move history will not be saved.
361
362 /// This specifies the maximum speed in logical units / second which will
363 /// be used to achive the transition. If the requested transition cannot
364 /// occur within the requested move time without exceeding the max speed,
365 /// the move time will be longer than requested. In other words, this
366 /// limit has priority over any requested moveTime. A MaxSpeed value of
367 /// < 0.0 means the speed limit is disabled.
368 float _maxSpeed;
369
370 /// Type of movement algorithm to use when moving to another eyepoint.
371 Movement_t _movement;
372
373 /// Contains movement parameters for each move that should be performed.
374 /// The last one contains the final eyepoint to stop at.
375 std::queue<MoveParms_t> _moveQ;
376
377 /// Type of route to take when moving to another eyepoint.
378 Route_t _route;
379
380 /// Stores this eyepoint's current state at the start of a move and is
381 /// used in calculating movement during each execution frame.
382 EyeState_t _start;
383
384 /// Latest known simulation time.
385 double _simTime;
386
387 /// Simulation time that a move starts.
388 double _startTime;
389
390 /// This specifies the up direction and is used when interpolating
391 /// movement to keep the view oriented 'correctly'.
392 Vector _upVector;
393
394 /// This specifies a buffer area around _upVector and -_upVector which
395 /// the moving eye will try to avoid. Setting this to non-zero avoids
396 /// flipping problems when orientation passes through _upVector or -_upVector
397 /// during moves.
398 float _bufferAngle;
399
400 /// Calculates the direction to the named object.
401 /// \param qualifiedObjName The name of the object in question.
402 /// \return A direction Vector pointing from this object to the target, 0,0,0 if not found.
403 Vector DirectionToObj( const std::string& qualifiedObjName ) const;
404
405 /// Extracts all eyepoint objects from the group hierarchy.
406 /// The group can contain other groups and object types.
407 /// \param group The group to search for eyepoints in recursively.
408 /// \param eyes The returned list of found eyepoints.
409 void ExtractEyepoints( Group* group, std::vector<GlsEyePoint*>& eyes );
410
411 //------------------------------------------------------------------------
412 /**
413 * Called when the destination eyepoint is reached to perform actions
414 * necessary to complete the movement.
415 */
416 //------------------------------------------------------------------------
417 void FinishMoving();
418
419 //------------------------------------------------------------------------
420 /**
421 * Initializes the movement history with the initial state of the eyepoint.
422 */
423 //------------------------------------------------------------------------
424 void Initialize();
425
426 /// Returns an adjusted move time based on the maximum speed setting. If the
427 /// speed of moving over distance in desiredTime is greater than the
428 /// maximum speed setting, the move time will be lengthened.
429 /// \param distance Distance in logical units that will be moved.
430 /// \param desiredTime Time in which we wish to cover the specified distance.
431 /// \return The adjusted move time in seconds.
432 float MoveTime( float distance, float desiredTime ) const;
433
434 /// Calculates the distance over the entire route if moving between all eyepoints in the list.
435 /// \param eyes The list of eyes to calculate the total route distance.
436 /// \return The total distance of the route in logical units.
437 float RouteDistance( std::vector<GlsEyePoint*>& eyes ) const;
438
439 /// Queues the move using the passed in movement parameters and sets up
440 /// the start time and starting state of the move.
441 /// \param moveParms The move parameters for this move.
442 void StartMoving( const MoveParms_t& moveParms );
443
444 friend class GlsMovingEyeEditor;
445};
446
447/// Stream out operator
448/// \param outstr The stream to write to.
449/// \param m The value to write to the stream.
450/// \return The stream in its current state.
451 inline std::ostream& operator<<( std::ostream& outstr, GlsMovingEye::Movement_t m )
452{
453 switch( m )
454 {
455 case GlsMovingEye::CONSTANT:
456 outstr << "CONSTANT";
457 break;
458 case GlsMovingEye::SINUSOIDAL:
459 outstr << "SINUSOIDAL";
460 break;
461 default:
462 outstr << "BAD_MOVEMENT";
463 };
464
465 return outstr;
466}
467
468/// Stream in operator
469/// \param instr The stream to read from.
470/// \param m The returned value read from the stream.
471/// \return The stream in its current state.
472 inline std::istream& operator>>( std::istream& instr, GlsMovingEye::Movement_t& m )
473{
474 std::string str;
475 instr >> str;
476 if( str == "CONSTANT" )
477 {
478 m = GlsMovingEye::CONSTANT;
479 }
480 else if( str == "SINUSOIDAL" )
481 {
482 m = GlsMovingEye::SINUSOIDAL;
483 }
484 return instr;
485}
486
487/// Stream out operator
488/// \param outstr The stream to write to.
489/// \param r The value to write to the stream.
490/// \return The stream in its current state.
491 inline std::ostream& operator<<( std::ostream& outstr, GlsMovingEye::Route_t r )
492{
493 switch( r )
494 {
495 case GlsMovingEye::DIRECT:
496 outstr << "DIRECT";
497 break;
498 case GlsMovingEye::ARC:
499 outstr << "ARC";
500 break;
501 default:
502 outstr << "BAD_ROUTE";
503 };
504
505 return outstr;
506}
507
508/// Stream in operator
509/// \param instr The stream to read from.
510/// \param r The returned value read from the stream.
511/// \return The stream in its current state.
512 inline std::istream& operator>>( std::istream& instr, GlsMovingEye::Route_t& r )
513{
514 std::string str;
515 instr >> str;
516 if( str == "DIRECT" )
517 {
518 r = GlsMovingEye::DIRECT;
519 }
520 else if( str == "ARC" )
521 {
522 r = GlsMovingEye::ARC;
523 }
524 return instr;
525}
526
527} // namespace disti
528#endif
disti::DisplayObject
Definition: display.h:96
disti::DynamicArray
Definition: dynamic_array.h:79
disti::GlsEyePoint
Definition: gls_eyepoint.h:117
disti::GlsEyePoint::FovConstraintType
FovConstraintType
The FovConstraintType enum. Defines view constraint behavior.
Definition: gls_eyepoint.h:126
disti::GlsGloFileAttribute
Definition: gls_glo_file.h:1243
disti::GlsMovingEye
Definition: gls_moving_eye.h:89
disti::GlsMovingEye::_simTime
double _simTime
Latest known simulation time.
Definition: gls_moving_eye.h:385
disti::GlsMovingEye::MoveForward
void MoveForward()
disti::GlsMovingEye::Movement
Movement_t Movement() const
Definition: gls_moving_eye.h:201
disti::GlsMovingEye::SetAvailableAttributes
virtual void SetAvailableAttributes(unsigned int value) DISTI_METHOD_OVERRIDE
disti::GlsMovingEye::Draw
virtual void Draw() DISTI_METHOD_OVERRIDE
disti::GlsMovingEye::_disableMoveHistory
bool _disableMoveHistory
If true, move history will not be saved.
Definition: gls_moving_eye.h:360
disti::GlsMovingEye::_movement
Movement_t _movement
Type of movement algorithm to use when moving to another eyepoint.
Definition: gls_moving_eye.h:371
disti::GlsMovingEye::Route
Route_t Route() const
Definition: gls_moving_eye.h:265
disti::GlsMovingEye::Route
void Route(Route_t routeType)
disti::GlsMovingEye::CloneObject
virtual DisplayObject * CloneObject(bool generateNames=false) DISTI_METHOD_OVERRIDE
disti::GlsMovingEye::MaxSpeed
float MaxSpeed() const
Definition: gls_moving_eye.h:194
disti::GlsMovingEye::Movement
void Movement(Movement_t movementType)
disti::GlsMovingEye::SetFromGloData
virtual void SetFromGloData(GlsGloFileAttribute &data) DISTI_METHOD_OVERRIDE
disti::GlsMovingEye::GlsMovingEye
GlsMovingEye(const GlsMovingEye &that, const bool generateNames)
disti::GlsMovingEye::_moveQ
std::queue< MoveParms_t > _moveQ
Definition: gls_moving_eye.h:375
disti::GlsMovingEye::AbortMove
void AbortMove()
disti::GlsMovingEye::DirectionToObj
Vector DirectionToObj(const std::string &qualifiedObjName) const
disti::GlsMovingEye::_initialized
bool _initialized
Flag to keep track of when the object gets initialized.
Definition: gls_moving_eye.h:341
disti::GlsMovingEye::_maxSpeed
float _maxSpeed
Definition: gls_moving_eye.h:368
disti::GlsMovingEye::_moveHistory
std::vector< MoveParms_t > _moveHistory
Stores a history of visited eyepoints for moving back and forth.
Definition: gls_moving_eye.h:358
disti::GlsMovingEye::MoveToEyeAdd
void MoveToEyeAdd(Group *eyeGroup, float moveTime=2.0f)
disti::GlsMovingEye::MoveTime
float MoveTime(float distance, float desiredTime) const
disti::GlsMovingEye::MaxSpeed
void MaxSpeed(float speed)
disti::GlsMovingEye::SetValue
virtual void SetValue(int spec, va_list &args) DISTI_METHOD_OVERRIDE
disti::GlsMovingEye::AtStartOfHistory
bool AtStartOfHistory() const
Definition: gls_moving_eye.h:133
disti::GlsMovingEye::Movement_t
Movement_t
This specifies the type of route taken from one eyepoint to another.
Definition: gls_moving_eye.h:101
disti::GlsMovingEye::ExtractEyepoints
void ExtractEyepoints(Group *group, std::vector< GlsEyePoint * > &eyes)
disti::GlsMovingEye::EmitEvent
void EmitEvent(bool emitEvent)
disti::GlsMovingEye::Calculate
virtual void Calculate(double time) DISTI_METHOD_OVERRIDE
disti::GlsMovingEye::LookAtObject
void LookAtObject(const std::string &name)
disti::GlsMovingEye::CreateInstance
static DisplayObject * CreateInstance()
disti::GlsMovingEye::_emitEvent
bool _emitEvent
Whether or not to emit an event when the move has completed.
Definition: gls_moving_eye.h:330
disti::GlsMovingEye::DisableMoveHistory
void DisableMoveHistory(bool his)
disti::GlsMovingEye::_startTime
double _startTime
Simulation time that a move starts.
Definition: gls_moving_eye.h:388
disti::GlsMovingEye::Initialize
void Initialize()
disti::GlsMovingEye::_route
Route_t _route
Type of route to take when moving to another eyepoint.
Definition: gls_moving_eye.h:378
disti::GlsMovingEye::_bufferAngle
float _bufferAngle
Definition: gls_moving_eye.h:398
disti::GlsMovingEye::AtEndOfHistory
bool AtEndOfHistory() const
Definition: gls_moving_eye.h:139
disti::GlsMovingEye::_lookAtCalculatedUpVector
Vector _lookAtCalculatedUpVector
The last up vector calculated by the lookAt algorithm.
Definition: gls_moving_eye.h:355
disti::GlsMovingEye::_start
EyeState_t _start
Definition: gls_moving_eye.h:382
disti::GlsMovingEye::_historyPos
std::size_t _historyPos
Current position into the history list.
Definition: gls_moving_eye.h:338
disti::GlsMovingEye::MoveToLocation
void MoveToLocation(const Vector &location, float moveTime=2.0f)
disti::GlsMovingEye::MoveToEye
void MoveToEye(GlsEyePoint *eye, float moveTime=2.0f)
disti::GlsMovingEye::_lookAtObject
std::string _lookAtObject
Definition: gls_moving_eye.h:348
disti::GlsMovingEye::~GlsMovingEye
virtual ~GlsMovingEye()
disti::GlsMovingEye::MoveBack
void MoveBack()
disti::GlsMovingEye::CopyProperties
virtual void CopyProperties(DisplayObject *src) DISTI_METHOD_OVERRIDE
disti::GlsMovingEye::_upVector
Vector _upVector
Definition: gls_moving_eye.h:392
disti::GlsMovingEye::Route_t
Route_t
This specifies the type of route taken from one eyepoint to another.
Definition: gls_moving_eye.h:108
disti::GlsMovingEye::FinishMoving
void FinishMoving()
disti::GlsMovingEye::_lookAtReferenceUpVector
Vector _lookAtReferenceUpVector
Definition: gls_moving_eye.h:352
disti::GlsMovingEye::DisableMoveHistory
bool DisableMoveHistory() const
Definition: gls_moving_eye.h:168
disti::GlsMovingEye::MoveToEyeAdd
void MoveToEyeAdd(GlsEyePoint *eye, float moveTime=2.0f)
disti::GlsMovingEye::MOVE_COMPLETE_EVENT_NAME
static const char * MOVE_COMPLETE_EVENT_NAME
Name of the event emitted when a move is completed.
Definition: gls_moving_eye.h:113
disti::GlsMovingEye::MoveRelative
void MoveRelative(const Vector &moveAmount, const Vector &rotation)
disti::GlsMovingEye::LookAtObject
const std::string & LookAtObject() const
Definition: gls_moving_eye.h:187
disti::GlsMovingEye::MoveToEye
void MoveToEye(Group *eyeGroup, float moveTime=2.0f)
disti::GlsMovingEye::GenerateInstanceName
virtual void GenerateInstanceName() DISTI_METHOD_OVERRIDE
disti::GlsMovingEye::RouteDistance
float RouteDistance(std::vector< GlsEyePoint * > &eyes) const
disti::GlsMovingEye::StartMoving
void StartMoving(const MoveParms_t &moveParms)
disti::GlsMovingEye::_firstSegment
bool _firstSegment
Definition: gls_moving_eye.h:335
disti::GlsMovingEye::EmitEvent
bool EmitEvent() const
Definition: gls_moving_eye.h:161
disti::GlsMovingEye::GlsMovingEye
GlsMovingEye()
disti::Group
Definition: group.h:53
disti::VertexNoColor
Definition: vertex.h:85
gls_auto_lib.h
The gls_auto_lib.
gls_cpp_lang_support.h
Macros and helper code to determine what subset of C++11/14/17 is available.
DISTI_SPECIAL_MEM_FUN_DELETE
#define DISTI_SPECIAL_MEM_FUN_DELETE
Macro to wrap function deletion, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:246
DISTI_DEPRECATED
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:488
DISTI_METHOD_OVERRIDE
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:222
gls_eyepoint.h
The disti::GlsEyePoint class. Implements eyepoints.
GLSGEN_GLSMOVINGEYE_EXPORT
#define GLSGEN_GLSMOVINGEYE_EXPORT
Provides support for creating DLLs.
Definition: gls_moving_eye.h:62
disti
Definition: bmpimage.h:47
disti::operator<<
std::ostream & operator<<(std::ostream &outstr, const AttributeName &name)
disti::operator>>
std::istream & operator>>(std::istream &instr, GlsColor &color)
disti::GlsMovingEye::EyeState_t
Type to store eyepoint state information.
Definition: gls_moving_eye.h:283
disti::GlsMovingEye::EyeState_t::FOV
double FOV
Field of view of eyepoint in Degrees, if fovIsHorizontal is true, this is horizontal.
Definition: gls_moving_eye.h:286
disti::GlsMovingEye::EyeState_t::location
Vector location
Location of the eyepoint in logical units.
Definition: gls_moving_eye.h:284
disti::GlsMovingEye::EyeState_t::farClip
double farClip
Distance from eyepoint to near clipping plane.
Definition: gls_moving_eye.h:291
disti::GlsMovingEye::EyeState_t::verticalConstraint
FovConstraintType verticalConstraint
The type of constraint in the vertical direction.
Definition: gls_moving_eye.h:294
disti::GlsMovingEye::EyeState_t::fovIsHorizontal
bool fovIsHorizontal
True if field of view measurement is along horizonal axis, else along vertical axis.
Definition: gls_moving_eye.h:288
disti::GlsMovingEye::EyeState_t::orthographic
bool orthographic
True if orthographic projection, else perspective projection.
Definition: gls_moving_eye.h:285
disti::GlsMovingEye::EyeState_t::orthoSize
double orthoSize
Size of ortho projection in logical units, if fovIsHorizontal is true, this is horizontal.
Definition: gls_moving_eye.h:289
disti::GlsMovingEye::EyeState_t::Direction
Vector Direction()
Definition: gls_moving_eye.h:308
disti::GlsMovingEye::EyeState_t::EyeState_t
EyeState_t(GlsMovingEye *movingEye, GlsEyePoint *targetEye)
disti::GlsMovingEye::EyeState_t::nearClip
double nearClip
Distance from eyepoint to far clipping plane.
Definition: gls_moving_eye.h:292
disti::GlsMovingEye::EyeState_t::viewVectors
Vector viewVectors[3]
3 vectors used to set the orientation of the eyepoint.
Definition: gls_moving_eye.h:295
disti::GlsMovingEye::EyeState_t::EyeState_t
EyeState_t()
disti::GlsMovingEye::EyeState_t::horizontalConstraint
FovConstraintType horizontalConstraint
The type of constraint in the horizontal direction.
Definition: gls_moving_eye.h:293
disti::GlsMovingEye::EyeState_t::otherOrthoSize
double otherOrthoSize
Size of ortho projection for the other direction, based on fovIsHorizontal.
Definition: gls_moving_eye.h:290
disti::GlsMovingEye::EyeState_t::otherFOV
double otherFOV
Field of view for the other direction, based on fovIsHorizontal.
Definition: gls_moving_eye.h:287
disti::GlsMovingEye::MoveParms_t
Type to store eyepoint movement parameters.
Definition: gls_moving_eye.h:316
disti::GlsMovingEye::MoveParms_t::qualifiedEyeName
std::string qualifiedEyeName
The name of the eyepoint object to move to.
Definition: gls_moving_eye.h:319
disti::GlsMovingEye::MoveParms_t::MoveParms_t
MoveParms_t(bool storeHistory, double moveTime, GlsMovingEye *movingEye, GlsEyePoint *targetEye)
disti::GlsMovingEye::MoveParms_t::time
double time
The amount of time to move in seconds.
Definition: gls_moving_eye.h:318
disti::GlsMovingEye::MoveParms_t::addToHistory
bool addToHistory
If true, will be added to eyepoint movement history.
Definition: gls_moving_eye.h:317