00001
00002 /*************** <auto-copyright.pl BEGIN do not edit this line> **************
00003 *
00004 * Animaniac is (C) Copyright 2000,2001 Kevin Meinert
00005 *
00006 * Original Authors:
00007 * Kevin Meinert
00008 *
00009 *
00010 *
00011 * This library is free software; you can redistribute it and/or
00012 * modify it under the terms of the GNU Library General Public
00013 * License as published by the Free Software Foundation; either
00014 * version 2 of the License, or (at your option) any later version.
00015 *
00016 * This library is distributed in the hope that it will be useful,
00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00019 * Library General Public License for more details.
00020 *
00021 * You should have received a copy of the GNU Library General Public
00022 * License along with this library; if not, write to the
00023 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00024 * Boston, MA 02111-1307, USA.
00025 *
00026 * -----------------------------------------------------------------
00027 * File: $RCSfile: Key.h,v $
00028 * Date modified: $Date: 2001/03/05 23:23:15 $
00029 * Version: $Revision: 1.2 $
00030 * -----------------------------------------------------------------
00031 *
00032 *************** <auto-copyright.pl END do not edit this line> ***************/
00033
00034
00035 // NOTE: for best results, read this file using an editor that supports
00036 // color syntax highlighting. (i.e. nedit, gvim, visual studio, visual
00037 // slick edit)
00038
00039 #ifndef ANIMANIAC_KEY
00040 #define ANIMANIAC_KEY
00041
00042 #include <assert.h>
00043
00044 namespace ani
00045 {
00046 //: One Key for the KeyFramer
00047 class Key
00048 {
00049 public:
00050 Key() : mTime( 0 )
00051 {
00052 }
00053 // copy constructor
00054 Key( const Key& key )
00055 {
00056 this->setTime( key.time() );
00057 }
00058
00059 // time constructor
00060 Key( const float& timeVal )
00061 {
00062 this->setTime( timeVal );
00063 }
00064
00065 inline const float& time() const { return mTime; }
00066 inline float& time() { return mTime; }
00067 inline void setTime( const float& t )
00068 {
00069 mTime = t;
00070 }
00071
00072 //: set this key to the interpolated value of key0 to key1
00073 // interp is a number from key0.time() to key1.time(),
00074 //
00075 // where:
00076 // interp == key0.time() sets the Key to key0
00077 // key0.time() < interp < key1.time() sets the Key to interpolated
00078 // value of key0 to key1
00079 // interp == key1.time() sets the Key to key1
00080 //
00082 //virtual void setInterpolate( float interp, const Key& key0, const Key& key1 ) = 0;
00083
00084 private:
00085 float mTime;
00086 };
00087
00088 };
00089
00090 #endif
1.2.15