- Cal3D 0.9 API Reference -

Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

mixer.h

00001 //****************************************************************************//
00002 // mixer.h                                                                    //
00003 // Copyright (C) 2001, 2002 Bruno 'Beosil' Heidelberger                       //
00004 // Copyright (C) 2004 Mekensleep <licensing@mekensleep.com>                   //
00005 //****************************************************************************//
00006 // This library is free software; you can redistribute it and/or modify it    //
00007 // under the terms of the GNU Lesser General Public License as published by   //
00008 // the Free Software Foundation; either version 2.1 of the License, or (at    //
00009 // your option) any later version.                                            //
00010 //****************************************************************************//
00011 
00012 #ifndef CAL_MIXER_H
00013 #define CAL_MIXER_H
00014 
00015 //****************************************************************************//
00016 // Includes                                                                   //
00017 //****************************************************************************//
00018 
00019 #include "cal3d/global.h"
00020 
00021 //****************************************************************************//
00022 // Forward declarations                                                       //
00023 //****************************************************************************//
00024 
00025 class CalModel;
00026 class CalAnimation;
00027 class CalAnimationAction;
00028 class CalAnimationCycle;
00029 
00030 /*****************************************************************************/
00094 class CAL3D_API CalAbstractMixer
00095 {
00096 public:
00097   CalAbstractMixer() {}
00098   virtual ~CalAbstractMixer() {}
00099 
00100   /*****************************************************************************/
00108   virtual bool isDefaultMixer() { return false; }
00109 
00110   /*****************************************************************************/
00135   virtual bool create(CalModel *pModel) = 0;
00136 
00137   /*****************************************************************************/
00152   virtual void destroy() = 0;
00153 
00154   /*****************************************************************************/
00171   virtual void updateAnimation(float deltaTime) = 0;
00172 
00173   /*****************************************************************************/
00189   virtual void updateSkeleton() = 0;
00190 };
00191 
00192 //****************************************************************************//
00193 // Class declaration                                                          //
00194 //****************************************************************************//
00195 
00196  /*****************************************************************************/
00200 class CAL3D_API CalMixer : public CalAbstractMixer
00201 {
00202 // member variables
00203 public:
00204   CalModel *m_pModel;
00205   std::vector<CalAnimation *> m_vectorAnimation;
00206   std::list<CalAnimationAction *> m_listAnimationAction;
00207   std::list<CalAnimationCycle *> m_listAnimationCycle;
00208   float m_animationTime;
00209   float m_animationDuration;
00210   float m_timeFactor;
00211 
00212 // constructors/destructor
00213 public:
00214   CalMixer();
00215   virtual ~CalMixer();
00216 
00217 // member functions 
00218 public:
00219   virtual bool isDefaultMixer() { return true; }
00220   bool blendCycle(int id, float weight, float delay);
00221   bool clearCycle(int id, float delay);
00222   virtual bool create(CalModel *pModel);
00223   virtual void destroy();
00224   bool executeAction(int id, float delayIn, float delayOut, float weightTarget = 1.0f, bool autoLock=false);
00225   bool removeAction(int id);
00226   virtual void updateAnimation(float deltaTime);
00227   virtual void updateSkeleton();
00228   float getAnimationTime();
00229   float getAnimationDuration();
00230   void setAnimationTime(float animationTime);
00231   void setTimeFactor(float timeFactor);
00232   float getTimeFactor();
00233   
00234 
00235 };
00236 
00237 #endif
00238 
00239 //****************************************************************************//

Generated at Thu Dec 2 19:29:06 2004 by The Cal3D Team with doxygen 1.3.9.1 © 1997-2001 Dimitri van Heesch