#include <PositionPath.h>
Public Member Functions | |
PositionPath () | |
~PositionPath () | |
Position | GetPosition (int time) |
void | SetConstantPosition (float x, float y, float z, float roll, float pitch, float yaw) |
bool | IsDefined (int time) |
bool | HasDynamicRotation () |
bool | HasStaticRotation () |
BoundingBox | GetTranslationBox () |
void | StartPath (int offset, float x, float y, float z, float roll, float pitch, float yaw) |
void | CompletePath (float x, float y, float z, float roll, float pitch, float yaw) |
void | AddCheckpoint (float x, float y, float z, float roll, float pitch, float yaw) |
void | SetDuration (int time) |
void | SetGlobalTransition (int mode, float parameter) |
void | SetTransitionModes (int mode_x, int mode_y, int mode_z, int mode_roll, int mode_pitch, int mode_yaw) |
void | SetParameters (float param_x, float param_y, float param_z, float param_roll, float param_pitch, float param_yaw) |
void | Shift (float x, float y, float z) |
void | PrintToConsole () |
Private Types | |
typedef PositionPath::PathNode | Path |
Private Member Functions | |
void | SeekTime (int time) |
void | DeletePath () |
void | Initialize () |
void | ConservativeUpdate (PathNode *node) |
Position | EvaluateNode (PathNode *node, float progress) |
float | EvaluateValue (int mode, float value, float parameter) |
Private Attributes | |
bool | is_constant |
bool | has_dynamic_rotation |
bool | has_static_rotation |
BoundingBox | translation_box |
Position | constant_position |
Path * | first_node |
bool | not_complete |
PathNode * | current_node |
PathNode * | node_pointer |
Classes | |
struct | PathNode |
A PositionPath is a 6DOF position in 3D space that may vary over time. Such a path is defined by checkpoints that are reached at specific points in time. For times that lie between two checkpoints, the positions of those checkpoints are interpolated. There are several modes of interpolation possible, either linearly PP_LINEAR, using a cosine (which means smooth start) PP_COSINE, using a sine (which means a smooth stop) or jumping directly from position one to position two PP_JUMP. Each value of the position (x, y, z, roll, pitch, yaw) may either be interpolated in the same way or independently of the other values (for example linearly interpolating between two x coordinates and using a cosine to interpolate between the pitch angles). Each interpolation may additionally have a parameter. While the parameter has no meaning for the linear interpolation, it specifies the number of oscillations when using a sine or cosine interpolation. When using the jumpy interpolation, it must lie between 0.0 and 1.0 and determines the time of the position jump as a the fraction of the timespan between the two checkpoints.
Furthermore, each PositionPath may contain several sequences of checkpoints. Between two such sequences, the object may not be defined if there is a gap between the end resp. start times of the two sequences.
Definition at line 56 of file PositionPath.h.
|
This structure holds the required path information. |
|
Constructor: Initializes the class and sets it to the zero position {0, 0, 0, 0, 0, 0} Definition at line 3 of file PositionPath.cpp. |
|
Destructor: Destroys the path. Definition at line 8 of file PositionPath.cpp. |
|
Used to construct a path. This routine adds a checkpoint to the current path. It may only be called between 'StartPath (...)' and 'CompletePath (...)'.
Definition at line 64 of file PositionPath.cpp. |
|
Used to construct a path. This routine ends the current path. It may only be called if a path has already been started with 'StartPath (...)'.
Definition at line 170 of file PositionPath.cpp. |
|
Updates the translation box in a conservative manner if a transition mode contains either a SINE or COSINE interpolation and its parameter is different from 0.0. This is necessary, because such an interpolation may result in values between -1 and 1 (instead of 0 and 1), which means that the translation box could be incorrect.
Definition at line 241 of file PositionPath.cpp. |
|
Destroys the path and frees its ressources. Definition at line 299 of file PositionPath.cpp. |
|
Returns a position by interpolating between the start and end position of a certain node using its transition evaluator(s) and parameter(s).
Definition at line 423 of file PositionPath.cpp. |
|
Applies an evaluator.
Definition at line 462 of file PositionPath.cpp. |
|
Retrieves the position at any given time. The returned position is only valid if it is indeed defined at the requested time.
Definition at line 399 of file PositionPath.cpp. |
|
Retrieves a box which contains the minimal and maximal values for each axis that can be achieved over time. All points of the path lie within or on the boundary of this box.
Definition at line 203 of file PositionPath.cpp. |
|
States if the position has changing rotation values.
Definition at line 502 of file PositionPath.cpp. |
|
States if the position contains any rotation (values different from 0.0, 0.0, 0.0 for roll, pitch and yaw).
Definition at line 497 of file PositionPath.cpp. |
|
Initializes the path. Definition at line 13 of file PositionPath.cpp. |
|
States if a position is defined at any given time.
Definition at line 477 of file PositionPath.cpp. |
|
Prints the path to the console. Definition at line 507 of file PositionPath.cpp. |
|
Sets the 'node_pointer' to the correct node of the path, such that it points to the node with the biggest starting time that is still smaller than the requested time. If the requested time is smaller than the starting time of the first node, 'node_pointer' is set to 'NULL'.
Definition at line 362 of file PositionPath.cpp. |
|
Sets the position to constant values, which are always defined.
Definition at line 38 of file PositionPath.cpp. |
|
Used to construct a path. This routine sets the duration between two points along the path. It may only be called between 'StartPath (...)' and 'CompletePath (...)'.
Definition at line 317 of file PositionPath.cpp. |
|
Used to construct a path. Specifies the interpolation between two points of the path. All 6 values of the position are interpolated using the same method.
Definition at line 325 of file PositionPath.cpp. |
|
Used to construct a path. Specifies the parameters for the interpolation between two points of the path. There is one parameter for each of the 6 values of the position. The meanings of the parameters differ depending on the chosen interpolation modes.
Definition at line 349 of file PositionPath.cpp. |
|
Used to construct a path. Specifies the interpolation between two points of the path. All 6 values of the position are interpolated independently. Each parameter of this routine can be one of the following: PP_LINEAR, PP_SINE, PP_COSINE or PP_JUMP.
Definition at line 335 of file PositionPath.cpp. |
|
Shifts the whole path by a certain distance
Definition at line 208 of file PositionPath.cpp. |
|
Used to construct a path. This routine starts a new path. It may only be called as the first element of the path or if already existing elements have been completed by calling 'CompletePath (...)'.
Definition at line 110 of file PositionPath.cpp. |
|
Constant position, only valid if this 'is_constant' equals 'true'. Definition at line 238 of file PositionPath.h. |
|
internal member for the path construction, points to the current node. Definition at line 262 of file PositionPath.h. |
|
First node of the path. Definition at line 256 of file PositionPath.h. |
|
States if the path contains changing rotation values over time. Definition at line 229 of file PositionPath.h. |
|
States if the path contains rotation values different from {0, 0 ,0}. Definition at line 232 of file PositionPath.h. |
|
States if the path contains only constant values which are always defined. Definition at line 226 of file PositionPath.h. |
|
internal member for the path access, points to the node which has been accessed most lately. Definition at line 265 of file PositionPath.h. |
|
internal member for the path construction, states if the path is complete or not. Definition at line 259 of file PositionPath.h. |
|
A box defining the minimal and maximal positions achieved over time for each axis. Definition at line 235 of file PositionPath.h. |