OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreKeyFrame.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2014 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 
29 #ifndef __KeyFrame_H__
30 #define __KeyFrame_H__
31 
32 #include "OgrePrerequisites.h"
33 #include "OgreVector3.h"
34 #include "OgreQuaternion.h"
35 #include "OgreAny.h"
37 #include "OgreHeaderPrefix.h"
38 
39 namespace Ogre
40 {
41 
56  {
57  public:
58 
60  KeyFrame(const AnimationTrack* parent, Real time);
61 
62  virtual ~KeyFrame() {}
63 
65  Real getTime(void) const { return mTime; }
66 
68  virtual KeyFrame* _clone(AnimationTrack* newParent) const;
69 
70 
71  protected:
74  };
75 
76 
80  {
81  public:
83  NumericKeyFrame(const AnimationTrack* parent, Real time);
85 
87  virtual const AnyNumeric& getValue(void) const;
92  virtual void setValue(const AnyNumeric& val);
93 
95  KeyFrame* _clone(AnimationTrack* newParent) const;
96  protected:
98  };
99 
100 
103  {
104  public:
106  TransformKeyFrame(const AnimationTrack* parent, Real time);
114  virtual void setTranslate(const Vector3& trans);
115 
117  const Vector3& getTranslate(void) const;
118 
124  virtual void setScale(const Vector3& scale);
125 
127  virtual const Vector3& getScale(void) const;
128 
133  virtual void setRotation(const Quaternion& rot);
134 
136  virtual const Quaternion& getRotation(void) const;
137 
139  KeyFrame* _clone(AnimationTrack* newParent) const;
140  protected:
144 
145 
146  };
147 
148 
149 
154  {
155  public:
157  VertexMorphKeyFrame(const AnimationTrack* parent, Real time);
166  void setVertexBuffer(const HardwareVertexBufferSharedPtr& buf);
167 
169  const HardwareVertexBufferSharedPtr& getVertexBuffer(void) const;
170 
172  KeyFrame* _clone(AnimationTrack* newParent) const;
173 
174  protected:
176 
177  };
178 
184  {
185  public:
187  VertexPoseKeyFrame(const AnimationTrack* parent, Real time);
189 
194  struct PoseRef
195  {
208 
209  PoseRef(ushort p, Real i) : poseIndex(p), influence(i) {}
210  };
212 
216  void addPoseReference(ushort poseIndex, Real influence);
220  void updatePoseReference(ushort poseIndex, Real influence);
224  void removePoseReference(ushort poseIndex);
226  void removeAllPoseReferences(void);
227 
228 
230  const PoseRefList& getPoseReferences(void) const;
231 
234 
236  PoseRefIterator getPoseReferenceIterator(void);
237 
239  ConstPoseRefIterator getPoseReferenceIterator(void) const;
240 
242  KeyFrame* _clone(AnimationTrack* newParent) const;
243 
244  void _applyBaseKeyFrame(const VertexPoseKeyFrame* base);
245 
246  protected:
248 
249  };
253 }
254 
255 #include "OgreHeaderSuffix.h"
256 
257 #endif
258 
const AnimationTrack * mParentTrack
Definition: OgreKeyFrame.h:73
Specialised Any class which has built in arithmetic operators, but can hold only types which support ...
Definition: OgreAny.h:245
Specialised KeyFrame which stores absolute vertex positions for a complete buffer, designed to be interpolated with other keys in the same track.
Definition: OgreKeyFrame.h:153
Reference to a pose at a given influence level.
Definition: OgreKeyFrame.h:194
float Real
Software floating point type.
Specialised KeyFrame which stores a full transform.
Definition: OgreKeyFrame.h:102
#define _OgreExport
Definition: OgrePlatform.h:255
A key frame in an animation sequence defined by an AnimationTrack.
Definition: OgreKeyFrame.h:55
HardwareVertexBufferSharedPtr mBuffer
Definition: OgreKeyFrame.h:175
Shared pointer implementation used to share vertex buffers.
Implementation of a Quaternion, i.e.
vector< PoseRef >::type PoseRefList
Definition: OgreKeyFrame.h:211
Real getTime(void) const
Gets the time of this keyframe in the animation sequence.
Definition: OgreKeyFrame.h:65
Concrete IteratorWrapper for const access to the underlying container.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
A 'track' in an animation sequence, i.e.
virtual ~KeyFrame()
Definition: OgreKeyFrame.h:62
ushort poseIndex
The linked pose index.
Definition: OgreKeyFrame.h:203
Standard 3-dimensional vector.
Definition: OgreVector3.h:50
VectorIterator< PoseRefList > PoseRefIterator
Definition: OgreKeyFrame.h:232
unsigned short ushort
Real influence
Influence level of the linked pose.
Definition: OgreKeyFrame.h:207
Specialised KeyFrame which references a Mesh::Pose at a certain influence level, which stores offsets...
Definition: OgreKeyFrame.h:183
Specialised KeyFrame which stores any numeric value.
Definition: OgreKeyFrame.h:79
Concrete IteratorWrapper for nonconst access to the underlying container.
ConstVectorIterator< PoseRefList > ConstPoseRefIterator
Definition: OgreKeyFrame.h:233