00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef TEDDY__IMPORTS__LW_CHANNEL_ENVELOPE__H
00026 #define TEDDY__IMPORTS__LW_CHANNEL_ENVELOPE__H
00027
00028
00029 #include "Teddy/TeddyConfig.h"
00030 #if defined( TEDDY_INCLUDE_LW_SCENE )
00031
00032
00033 #include "Teddy/SysSupport/StdList.h"
00034
00035
00036 namespace Teddy {
00037 namespace Imports {
00038
00039
00040 class LWChannelKey;
00041
00042
00043
00044 #define LW_CHANNEL_X 0 // 0 - Move X
00045 #define LW_CHANNEL_Y 1 // 1 - Move Y
00046 #define LW_CHANNEL_Z 2 // 2 - Move Z
00047 #define LW_CHANNEL_H 3 // 3 - Rotate Heading
00048 #define LW_CHANNEL_P 4 // 4 - Rotate Pitch
00049 #define LW_CHANNEL_B 5 // 5 - Rotate Bank
00050 #define LW_CHANNEL_SX 6 // 6 - Scale X / Size X (channels are connected)
00051 #define LW_CHANNEL_SY 7 // 7 - Scale Y / Size Y (channels are connected)
00052 #define LW_CHANNEL_SZ 8 // 8 - Scale Z / Size Z (channels are connected)
00053 #define LW_CHANNEL_RX 9 // 9 - RestLength X
00054 #define LW_CHANNEL_RY 10 // 10 - RestLength Y
00055 #define LW_CHANNEL_RZ 11 // 11 - RestLength Z
00056 #define LW_CHANNEL_PX 9 // 9 - Move PivotPoint X
00057 #define LW_CHANNEL_PY 10 // 10 - Move PivotPoint Y
00058 #define LW_CHANNEL_PZ 11 // 11 - Move PivotPoint Z
00059
00060
00061
00062 #define LW_SPAN_TCB 0 // TCB (Kochanek-Bartels)
00063 #define LW_SPAN_HERMITE 1 // Hermite
00064 #define LW_SPAN_1D_BEZIER 2 // 1D Bezier (obsolete, equivalent to Hermite)
00065 #define LW_SPAN_LINEAR 3 // Linear
00066 #define LW_SPAN_STEPPED 4 // Stepped
00067 #define LW_SPAN_2D_BEZIER 5 // 2D Bezier
00068
00069
00070 #define LW_BEHAVIOR_RESET 0 // Reset Sets the value to 0.0.
00071 #define LW_BEHAVIOR_CONSTAT 1 // Constant Sets the value to the value at the nearest key.
00072 #define LW_BEHAVIOR_REPEAT 2 // Repeat Repeats the interval between the first and last keys (the primary interval).
00073 #define LW_BEHAVIOR_OSCILLATE 3 // Oscillate Like Repeat, but alternating copies of the primary interval are time-reversed.
00074 #define LW_BEHAVIOR_OFFSET_REPEAT 4 // Offset Repeat Like Repeat, but offset by the difference between the values of the first and last keys.
00075 #define LW_BEHAVIOR_LINEAR 5 // Linear Linearly extrapolates the value based on the tangent at the nearest key.
00076
00077
00078 class LWChannelEnvelope {
00079 public:
00080 LWChannelEnvelope( int channel_id );
00081
00082 int getChannelId();
00083 void insert ( LWChannelKey *channel_key );
00084 void setBehaviors( int pre, int post );
00085 float eval ( float key_position );
00086
00087 protected:
00088 list<LWChannelKey*> keys;
00089 int channel_id;
00090 int steps;
00091 int pre_behavior;
00092 int post_behavior;
00093 float last_time;
00094 float last_value;
00095 };
00096
00097
00098 };
00099 };
00100
00101
00102 #endif // TEDDY_INCLUDE_LW_SCENE
00103 #endif // TEDDY__IMPORTS__LW_CHANNEL_ENVELOPE__H
00104