Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# tracks.h

Go to the documentation of this file.

    00001 /* -*- c -*- */
    00002 #ifndef INCLUDED_LIB3DS_TRACKS_H
    00003 #define INCLUDED_LIB3DS_TRACKS_H
    00004 /*
    00005  * The 3D Studio File Format Library
    00006  * Copyright (C) 1996-2001 by J.E. Hoffmann <je-h@gmx.net>
    00007  * All rights reserved.
    00008  *
    00009  * This program is  free  software;  you can redistribute it and/or modify it
    00010  * under the terms of the  GNU Lesser General Public License  as published by
    00011  * the  Free Software Foundation;  either version 2.1 of the License,  or (at
    00012  * your option) any later version.
    00013  *
    00014  * This  program  is  distributed in  the  hope that it will  be useful,  but
    00015  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    00016  * or  FITNESS FOR A  PARTICULAR PURPOSE.  See the  GNU Lesser General Public
    00017  * License for more details.
    00018  *
    00019  * You should  have received  a copy of the GNU Lesser General Public License
    00020  * along with  this program;  if not, write to the  Free Software Foundation,
    00021  * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00022  *
    00023  * $Id: tracks.h,v 1.1 2005/03/07 11:16:26 Assassin Exp $
    00024  */
    00025
    00026 #ifndef INCLUDED_LIB3DS_TCB_H
    00027 #include <lib3ds/tcb.h>
    00028 #endif
    00029
    00030 #ifdef __cplusplus
    00031 extern "C" {
    00032 #endif
    00033
    00034 /*!
    00035  * Track flags
    00036  * \ingroup tracks
    00037  */
    00038 typedef enum {
    00039   LIB3DS_REPEAT    =0x0001,
    00040   LIB3DS_SMOOTH    =0x0002,
    00041   LIB3DS_LOCK_X    =0x0008,
    00042   LIB3DS_LOCK_Y    =0x0010,
    00043   LIB3DS_LOCK_Z    =0x0020,
    00044   LIB3DS_UNLINK_X  =0x0100,
    00045   LIB3DS_UNLINK_Y  =0x0200,
    00046   LIB3DS_UNLINK_Z  =0x0400
    00047 } Lib3dsTrackFlags;
    00048
    00049 /*!
    00050  * Boolean track key
    00051  * \ingroup tracks
    00052  */
    00053 struct _Lib3dsBoolKey {
    00054     Lib3dsTcb tcb;
    00055     Lib3dsBoolKey *next;
    00056 };
    00057
    00058 /*!
    00059  * Boolean track
    00060  * \ingroup tracks
    00061  */
    00062 struct _Lib3dsBoolTrack {
    00063     Lib3dsDword flags;
    00064     Lib3dsBoolKey *keyL;
    00065 };
    00066
    00067 /*!
    00068  * Floating-point track key
    00069  * \ingroup tracks
    00070  */
    00071 struct _Lib3dsLin1Key {
    00072     Lib3dsTcb tcb;
    00073     Lib3dsLin1Key *next;
    00074     Lib3dsFloat value;
    00075     Lib3dsFloat dd;
    00076     Lib3dsFloat ds;
    00077 };
    00078
    00079 /*!
    00080  * Floating-point track
    00081  * \ingroup tracks
    00082  */
    00083 struct _Lib3dsLin1Track {
    00084     Lib3dsDword flags;
    00085     Lib3dsLin1Key *keyL;
    00086 };
    00087
    00088 /*!
    00089  * Vector track key
    00090  * \ingroup tracks
    00091  */
    00092 struct _Lib3dsLin3Key {
    00093     Lib3dsTcb tcb;
    00094     Lib3dsLin3Key *next;
    00095     Lib3dsVector value;
    00096     Lib3dsVector dd;
    00097     Lib3dsVector ds;
    00098 };
    00099
    00100 /*!
    00101  * Vector track
    00102  * \ingroup tracks
    00103  */
    00104 struct _Lib3dsLin3Track {
    00105     Lib3dsDword flags;
    00106     Lib3dsLin3Key *keyL;
    00107 };
    00108
    00109 /*!
    00110  * Rotation track key
    00111  * \ingroup tracks
    00112  */
    00113 struct _Lib3dsQuatKey {
    00114     Lib3dsTcb tcb;
    00115     Lib3dsQuatKey *next;
    00116     Lib3dsVector axis;
    00117     Lib3dsFloat angle;
    00118     Lib3dsQuat q;
    00119     Lib3dsQuat dd;
    00120     Lib3dsQuat ds;
    00121 };
    00122
    00123 /*!
    00124  * Rotation track
    00125  * \ingroup tracks
    00126  */
    00127 struct _Lib3dsQuatTrack {
    00128     Lib3dsDword flags;
    00129     Lib3dsQuatKey *keyL;
    00130 };
    00131
    00132 /*!
    00133  * Morph track key
    00134  * \ingroup tracks
    00135  */
    00136 struct _Lib3dsMorphKey {
    00137     Lib3dsTcb tcb;
    00138     Lib3dsMorphKey *next;
    00139     char name[64];
    00140 };
    00141
    00142 /*!
    00143  * Morph track
    00144  * \ingroup tracks
    00145  */
    00146 struct _Lib3dsMorphTrack {
    00147     Lib3dsDword flags;
    00148     Lib3dsMorphKey *keyL;
    00149 };
    00150
    00151 extern LIB3DSAPI Lib3dsBoolKey* lib3ds_bool_key_new();
    00152 extern LIB3DSAPI void lib3ds_bool_key_free(Lib3dsBoolKey* key);
    00153 extern LIB3DSAPI void lib3ds_bool_track_free_keys(Lib3dsBoolTrack *track);
    00154 extern LIB3DSAPI void lib3ds_bool_track_insert(Lib3dsBoolTrack *track, Lib3dsBoolKey* key);
    00155 extern LIB3DSAPI void lib3ds_bool_track_remove(Lib3dsBoolTrack *track, Lib3dsIntd frame);
    00156 extern LIB3DSAPI void lib3ds_bool_track_eval(Lib3dsBoolTrack *track, Lib3dsBool *p, Lib3dsFloat t);
    00157 extern LIB3DSAPI Lib3dsBool lib3ds_bool_track_read(Lib3dsBoolTrack *track, Lib3dsIo *io);
    00158 extern LIB3DSAPI Lib3dsBool lib3ds_bool_track_write(Lib3dsBoolTrack *track, Lib3dsIo *io);
    00159
    00160 extern LIB3DSAPI Lib3dsLin1Key* lib3ds_lin1_key_new();
    00161 extern LIB3DSAPI void lib3ds_lin1_key_free(Lib3dsLin1Key* key);
    00162 extern LIB3DSAPI void lib3ds_lin1_track_free_keys(Lib3dsLin1Track *track);
    00163 extern LIB3DSAPI void lib3ds_lin1_key_setup(Lib3dsLin1Key *p, Lib3dsLin1Key *cp, Lib3dsLin1Key *c,
    00164   Lib3dsLin1Key *cn, Lib3dsLin1Key *n);
    00165 extern LIB3DSAPI void lib3ds_lin1_track_setup(Lib3dsLin1Track *track);
    00166 extern LIB3DSAPI void lib3ds_lin1_track_insert(Lib3dsLin1Track *track, Lib3dsLin1Key *key);
    00167 extern LIB3DSAPI void lib3ds_lin1_track_remove(Lib3dsLin1Track *track, Lib3dsIntd frame);
    00168 extern LIB3DSAPI void lib3ds_lin1_track_eval(Lib3dsLin1Track *track, Lib3dsFloat *p, Lib3dsFloat t);
    00169 extern LIB3DSAPI Lib3dsBool lib3ds_lin1_track_read(Lib3dsLin1Track *track, Lib3dsIo *io);
    00170 extern LIB3DSAPI Lib3dsBool lib3ds_lin1_track_write(Lib3dsLin1Track *track, Lib3dsIo *io);
    00171
    00172 extern LIB3DSAPI Lib3dsLin3Key* lib3ds_lin3_key_new();
    00173 extern LIB3DSAPI void lib3ds_lin3_key_free(Lib3dsLin3Key* key);
    00174 extern LIB3DSAPI void lib3ds_lin3_track_free_keys(Lib3dsLin3Track *track);
    00175 extern LIB3DSAPI void lib3ds_lin3_key_setup(Lib3dsLin3Key *p, Lib3dsLin3Key *cp, Lib3dsLin3Key *c,
    00176   Lib3dsLin3Key *cn, Lib3dsLin3Key *n);
    00177 extern LIB3DSAPI void lib3ds_lin3_track_setup(Lib3dsLin3Track *track);
    00178 extern LIB3DSAPI void lib3ds_lin3_track_insert(Lib3dsLin3Track *track, Lib3dsLin3Key *key);
    00179 extern LIB3DSAPI void lib3ds_lin3_track_remove(Lib3dsLin3Track *track, Lib3dsIntd frame);
    00180 extern LIB3DSAPI void lib3ds_lin3_track_eval(Lib3dsLin3Track *track, Lib3dsVector p, Lib3dsFloat t);
    00181 extern LIB3DSAPI Lib3dsBool lib3ds_lin3_track_read(Lib3dsLin3Track *track, Lib3dsIo *io);
    00182 extern LIB3DSAPI Lib3dsBool lib3ds_lin3_track_write(Lib3dsLin3Track *track, Lib3dsIo *io);
    00183
    00184 extern LIB3DSAPI Lib3dsQuatKey* lib3ds_quat_key_new();
    00185 extern LIB3DSAPI void lib3ds_quat_key_free(Lib3dsQuatKey* key);
    00186 extern LIB3DSAPI void lib3ds_quat_track_free_keys(Lib3dsQuatTrack *track);
    00187 extern LIB3DSAPI void lib3ds_quat_key_setup(Lib3dsQuatKey *p, Lib3dsQuatKey *cp, Lib3dsQuatKey *c,
    00188   Lib3dsQuatKey *cn, Lib3dsQuatKey *n);
    00189 extern LIB3DSAPI void lib3ds_quat_track_setup(Lib3dsQuatTrack *track);
    00190 extern LIB3DSAPI void lib3ds_quat_track_insert(Lib3dsQuatTrack *track, Lib3dsQuatKey *key);
    00191 extern LIB3DSAPI void lib3ds_quat_track_remove(Lib3dsQuatTrack *track, Lib3dsIntd frame);
    00192 extern LIB3DSAPI void lib3ds_quat_track_eval(Lib3dsQuatTrack *track, Lib3dsQuat p, Lib3dsFloat t);
    00193 extern LIB3DSAPI Lib3dsBool lib3ds_quat_track_read(Lib3dsQuatTrack *track, Lib3dsIo *io);
    00194 extern LIB3DSAPI Lib3dsBool lib3ds_quat_track_write(Lib3dsQuatTrack *track, Lib3dsIo *io);
    00195
    00196 extern LIB3DSAPI Lib3dsMorphKey* lib3ds_morph_key_new();
    00197 extern LIB3DSAPI void lib3ds_morph_key_free(Lib3dsMorphKey* key);
    00198 extern LIB3DSAPI void lib3ds_morph_track_free_keys(Lib3dsMorphTrack *track);
    00199 extern LIB3DSAPI void lib3ds_morph_track_insert(Lib3dsMorphTrack *track, Lib3dsMorphKey *key);
    00200 extern LIB3DSAPI void lib3ds_morph_track_remove(Lib3dsMorphTrack *track, Lib3dsIntd frame);
    00201 extern LIB3DSAPI void lib3ds_morph_track_eval(Lib3dsMorphTrack *track, char *p, Lib3dsFloat t);
    00202 extern LIB3DSAPI Lib3dsBool lib3ds_morph_track_read(Lib3dsMorphTrack *track, Lib3dsIo *io);
    00203 extern LIB3DSAPI Lib3dsBool lib3ds_morph_track_write(Lib3dsMorphTrack *track, Lib3dsIo *io);
    00204
    00205 #ifdef __cplusplus
    00206 };
    00207 #endif
    00208 #endif
    00209