- Cal3D 0.11 API Reference -

mixer.h
1//****************************************************************************//
2// mixer.h //
3// Copyright (C) 2001, 2002 Bruno 'Beosil' Heidelberger //
4// Copyright (C) 2004 Mekensleep <licensing@mekensleep.com> //
5//****************************************************************************//
6// This library is free software; you can redistribute it and/or modify it //
7// under the terms of the GNU Lesser General Public License as published by //
8// the Free Software Foundation; either version 2.1 of the License, or (at //
9// your option) any later version. //
10//****************************************************************************//
11
12#ifndef CAL_MIXER_H
13#define CAL_MIXER_H
14
15//****************************************************************************//
16// Includes //
17//****************************************************************************//
18
19#include "cal3d/global.h"
20
21//****************************************************************************//
22// Forward declarations //
23//****************************************************************************//
24
25 class CalModel;
26 class CalAnimation;
27 class CalAnimationAction;
28 class CalAnimationCycle;
29
30
31
32
33/*****************************************************************************/
96
97 class CAL3D_API CalAbstractMixer
98{
99 public:
100 CalAbstractMixer() {}
101 virtual ~CalAbstractMixer() {}
102
103 /*****************************************************************************/
111 virtual bool isDefaultMixer() { return false; }
112
113 /*****************************************************************************/
130 virtual void updateAnimation(float deltaTime) = 0;
131
132 /*****************************************************************************/
148 virtual void updateSkeleton() = 0;
149};
150
151
152 class CAL3D_API CalMixer : public CalAbstractMixer
153{
154 public:
155 CalMixer(CalModel* pModel);
156 virtual ~CalMixer();
157
158 virtual bool isDefaultMixer() { return true; }
159 bool blendCycle(int id, float weight, float delay);
160 bool clearCycle(int id, float delay);
161 bool executeAction(int id, float delayIn, float delayOut, float weightTarget = 1.0f, bool autoLock=false);
162 bool removeAction(int id);
163 virtual void updateAnimation(float deltaTime);
164 virtual void updateSkeleton();
165 float getAnimationTime();
166 float getAnimationDuration();
167 void setAnimationTime(float animationTime);
168 void setTimeFactor(float timeFactor);
169 float getTimeFactor();
170 CalModel *getCalModel();
171 std::vector<CalAnimation *> &getAnimationVector();
172 std::list<CalAnimationAction *> &getAnimationActionList();
173 std::list<CalAnimationCycle *> &getAnimationCycle();
174
175 protected:
176 CalModel *m_pModel;
177 std::vector<CalAnimation *> m_vectorAnimation;
178 std::list<CalAnimationAction *> m_listAnimationAction;
179 std::list<CalAnimationCycle *> m_listAnimationCycle;
180 float m_animationTime;
181 float m_animationDuration;
182 float m_timeFactor;
183};
184
185#endif
186
187//****************************************************************************//
CalAbstractMixer::updateAnimation
virtual void updateAnimation(float deltaTime)=0
Notifies the instance that updateAnimation was last called deltaTime seconds ago.
CalAbstractMixer::isDefaultMixer
virtual bool isDefaultMixer()
Is the object an instance of the default mixer (i.e.
Definition mixer.h:111
CalAbstractMixer::updateSkeleton
virtual void updateSkeleton()=0
Updates the skeleton of the corresponding CalModel (as provided to the create method) to match the cu...
CalAnimationAction
Definition animation_action.h:23
CalAnimationCycle
Definition animation_cycle.h:23
CalAnimation
Definition animation.h:22
CalMixer::isDefaultMixer
virtual bool isDefaultMixer()
Is the object an instance of the default mixer (i.e.
Definition mixer.h:158
CalMixer::CalMixer
CalMixer(CalModel *pModel)
Constructs the mixer instance.
Definition mixer.cpp:39
CalModel
Definition model.h:31

Generated by The Cal3D Team with Doxygen 1.15.0