|
OpenFrames
|
Updates FrameTransform objects from Trajectory objects. More...
#include <TrajectoryFollower.hpp>
Public Types | |
| enum | FollowMode { LOOP = 0, LIMIT } |
| enum | FollowData { POSITION = 1, ATTITUDE = 2 } |
Public Member Functions | |
| TrajectoryFollower (Trajectory *traj=NULL) | |
| TrajectoryFollower (const TrajectoryFollower &tf, const osg::CopyOp ©op) | |
| META_Object (OpenFrames, TrajectoryFollower) | |
| void | setTrajectory (Trajectory *traj) |
| void | addTrajectory (Trajectory *traj) |
| void | removeTrajectory (Trajectory *traj) |
| void | setFollowType (unsigned int data, FollowMode mode) |
| void | getFollowType (unsigned int &data, FollowMode &mode) const |
| bool | setXData (const Trajectory::DataSource &src) |
| bool | setYData (const Trajectory::DataSource &src) |
| bool | setZData (const Trajectory::DataSource &src) |
| const Trajectory::DataSource * | getDataSource () const |
| void | setDefaultData () |
| bool | getUsingDefaultData () |
| void | setTime (double time) |
| void | setOffsetTime (double offsetTime) |
| bool | isFollowingTime () const |
| double | getLastTime () const |
| Trajectory * | getLastTrajectory () const |
| virtual bool | run (osg::Object *object, osg::Object *data) |
| virtual void | dataCleared (Trajectory *traj) |
| virtual void | dataAdded (Trajectory *traj) |
Protected Types | |
| typedef std::vector< osg::ref_ptr< Trajectory > > | TrajList |
Protected Member Functions | |
| double | _computeTime (double time) |
| Trajectory * | _chooseTrajectory (double time) |
| bool | _updateState (double time, FollowData data) |
| bool | _verifyDataSources () const |
Protected Attributes | |
| TrajList | _trajList |
| osg::observer_ptr< Trajectory > | _follow |
| FollowMode | _mode |
| unsigned int | _data |
| Trajectory::DataSource | _dataSource [3] |
| bool | _dataValid |
| bool | _usingDefaultData |
| bool | _needsUpdate |
| bool | _followTime |
| double | _timeVal |
| double | _lastSimTime |
| double | _lastAdjustedTime |
| OpenThreads::Mutex | _mutex |
Updates FrameTransform objects from Trajectory objects.
This class updates a FrameTransform object with the position/attitude of a given set of Trajectory objects. It should be added as an update callback via frameTransformObject->setUpdateCallback(trajectoryFollowerObject). Adjustable parameters are the time scale at which to follow the trajectories, and what to do if the current time is not in the trajectory's time list. If multiple trajectories are specified, then TrajectoryFollower chooses which one to follow based on the current time and follow mode. e.g.: Given trajectory T_i, set of trajectories {T}, and current time t If t not within time of {T}, then wrap t to time of {T} (based on follow mode) If t within time of {T} but not within any T_i, then follow closest T_i If t within time of T_i, then follow T_i.
Specifies which of position or attitude we want to follow.
If a trajectory is being followed, the FollowMode specifies how the transform handles the current time being out of range of the followed trajectory's times. If the current time is in the trajectory's time list, then the trajectory's position/attitude is used regardless of the FollowMode setting.
|
inlinevirtual |
Called by a trajectory when data is added to it. Must be implemented by derived classes.
Implements OpenFrames::TrajectorySubscriber.
|
inlinevirtual |
Inherited from OpenFrames::TrajectorySubscriber Functions that inform about Trajectory changes
Implements OpenFrames::TrajectorySubscriber.
|
virtual |
Inherited from osg::Callback, implements the callback.
1.8.14