#ifndef _engine #define _engine //- // ========================================================================== // Copyright (C) 1995 - 2006 Autodesk, Inc. and/or its licensors. All // rights reserved. // // The coded instructions, statements, computer programs, and/or related // material (collectively the "Data") in these files contain unpublished // information proprietary to Autodesk, Inc. ("Autodesk") and/or its // licensors, which is protected by U.S. and Canadian federal copyright // law and by international treaties. // // The Data is provided for use exclusively by You. You have the right // to use, modify, and incorporate this Data into other products for // purposes authorized by the Autodesk software license agreement, // without fee. // // The copyright notices in the Software and this entire statement, // including the above license grant, this restriction and the // following disclaimer, must be included in all copies of the // Software, in whole or in part, and all derivative works of // the Software, unless such copies or derivative works are solely // in the form of machine-executable object code generated by a // source language processor. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. // AUTODESK DOES NOT MAKE AND HEREBY DISCLAIMS ANY EXPRESS OR IMPLIED // WARRANTIES INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF // NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR // PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE, OR // TRADE PRACTICE. IN NO EVENT WILL AUTODESK AND/OR ITS LICENSORS // BE LIABLE FOR ANY LOST REVENUES, DATA, OR PROFITS, OR SPECIAL, // DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES, EVEN IF AUTODESK // AND/OR ITS LICENSORS HAS BEEN ADVISED OF THE POSSIBILITY // OR PROBABILITY OF SUCH DAMAGES. // // ========================================================================== //+ #include #include #include #ifdef WIN32 # include #pragma warning (disable : 4244) #else # include #endif #include #include /* Constants ============================================================== */ #define kFileMaxWordSize 256 /* maximum size of a word */ /* Common types =========================================================== */ typedef int EtInt; /* natural int representation */ typedef float EtFloat; /* natural float representation */ typedef void EtVoid; /* void */ #define kEngineNULL (0) /* NULL */ typedef char EtBoolean; /* boolean */ #define kEngineTRUE ((EtBoolean)1) #define kEngineFALSE ((EtBoolean)0) typedef unsigned char EtByte; /* 1 byte */ /* File Engine ============================================================ */ typedef int EtFileHandle; /* type used for referencing a file */ #define kFileBadParam -2 /* a bad parameter was passed */ #define kFileNotOpened -1 /* file could not be opened */ typedef const char * EtFileName; /* type used for a file name */ /* Anim Engine ============================================================ */ typedef float EtTime; /* type used for key times (in seconds) */ typedef float EtValue; /* type used for key values (in internal units) */ struct EtKey { EtTime time; /* key time (in seconds) */ EtValue value; /* key value (in internal units) */ EtFloat inTanX; /* key in-tangent x value */ EtFloat inTanY; /* key in-tangent y value */ EtFloat outTanX; /* key out-tangent x value */ EtFloat outTanY; /* key out-tangent y value */ }; typedef struct EtKey EtKey; enum EtInfinityType { kInfinityConstant, kInfinityLinear, kInfinityCycle, kInfinityCycleRelative, kInfinityOscillate }; typedef enum EtInfinityType EtInfinityType; struct EtCurve { EtInt numKeys; /* The number of keys in the anim curve */ EtBoolean isWeighted; /* whether or not this curve has weighted tangents */ EtBoolean isStatic; /* whether or not all the keys have the same value */ EtInfinityType preInfinity; /* how to evaluate pre-infinity */ EtInfinityType postInfinity; /* how to evaluate post-infinity */ /* evaluate cache */ EtKey * lastKey; /* lastKey evaluated */ EtInt lastIndex; /* last index evaluated */ EtInt lastInterval; /* last interval evaluated */ EtBoolean isStep; /* whether or not this interval is a step interval */ EtBoolean isLinear; /* whether or not this interval is linear */ EtValue fX1; /* start x of the segment */ EtValue fX4; /* end x of the segment */ EtValue fCoeff[4]; /* bezier x parameters (only used for weighted curves */ EtValue fPolyY[4]; /* bezier y parameters */ EtKey keyList[1]; /* This must be the last element and contains */ /* an array of keys sorted in ascending order */ /* by time */ }; typedef struct EtCurve EtCurve; struct EtChannel { EtByte * channel; /* the name of the channel */ EtCurve * curve; /* the animation curve */ struct EtChannel * next; /* the next animation curve in a linked list */ }; typedef struct EtChannel EtChannel; #endif