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-2013 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 "OgreIteratorWrappers.h"
38 #include "OgreHeaderPrefix.h"
39 
40 namespace Ogre
41 {
42 
56  class _OgreExport KeyFrame : public AnimationAlloc
57  {
58  public:
59 
61  KeyFrame(const AnimationTrack* parent, Real time);
62 
63  virtual ~KeyFrame() {}
64 
66  Real getTime(void) const { return mTime; }
67 
69  virtual KeyFrame* _clone(AnimationTrack* newParent) const;
70 
71 
72  protected:
75  };
76 
77 
80  class _OgreExport NumericKeyFrame : public KeyFrame
81  {
82  public:
84  NumericKeyFrame(const AnimationTrack* parent, Real time);
86 
88  virtual const AnyNumeric& getValue(void) const;
93  virtual void setValue(const AnyNumeric& val);
94 
96  KeyFrame* _clone(AnimationTrack* newParent) const;
97  protected:
99  };
100 
101 
103  class _OgreExport TransformKeyFrame : public KeyFrame
104  {
105  public:
107  TransformKeyFrame(const AnimationTrack* parent, Real time);
115  virtual void setTranslate(const Vector3& trans);
116 
118  const Vector3& getTranslate(void) const;
119 
125  virtual void setScale(const Vector3& scale);
126 
128  virtual const Vector3& getScale(void) const;
129 
134  virtual void setRotation(const Quaternion& rot);
135 
137  virtual const Quaternion& getRotation(void) const;
138 
140  KeyFrame* _clone(AnimationTrack* newParent) const;
141  protected:
145 
146 
147  };
148 
149 
150 
154  class _OgreExport VertexMorphKeyFrame : public KeyFrame
155  {
156  public:
158  VertexMorphKeyFrame(const AnimationTrack* parent, Real time);
167  void setVertexBuffer(const HardwareVertexBufferSharedPtr& buf);
168 
170  const HardwareVertexBufferSharedPtr& getVertexBuffer(void) const;
171 
173  KeyFrame* _clone(AnimationTrack* newParent) const;
174 
175  protected:
177 
178  };
179 
184  class _OgreExport VertexPoseKeyFrame : public KeyFrame
185  {
186  public:
188  VertexPoseKeyFrame(const AnimationTrack* parent, Real time);
190 
195  struct PoseRef
196  {
209 
210  PoseRef(ushort p, Real i) : poseIndex(p), influence(i) {}
211  };
213 
217  void addPoseReference(ushort poseIndex, Real influence);
221  void updatePoseReference(ushort poseIndex, Real influence);
225  void removePoseReference(ushort poseIndex);
227  void removeAllPoseReferences(void);
228 
229 
231  const PoseRefList& getPoseReferences(void) const;
232 
235 
237  PoseRefIterator getPoseReferenceIterator(void);
238 
240  ConstPoseRefIterator getPoseReferenceIterator(void) const;
241 
243  KeyFrame* _clone(AnimationTrack* newParent) const;
244 
245  void _applyBaseKeyFrame(const VertexPoseKeyFrame* base);
246 
247  protected:
249 
250  };
254 }
255 
256 #include "OgreHeaderSuffix.h"
257 
258 #endif
259 
OgreHeaderSuffix.h
Ogre::KeyFrame
A key frame in an animation sequence defined by an AnimationTrack.
Definition: OgreKeyFrame.h:56
Ogre::NumericKeyFrame::mValue
AnyNumeric mValue
Definition: OgreKeyFrame.h:98
Ogre::VertexPoseKeyFrame::PoseRefList
vector< PoseRef >::type PoseRefList
Definition: OgreKeyFrame.h:212
Ogre::VertexMorphKeyFrame::mBuffer
HardwareVertexBufferSharedPtr mBuffer
Definition: OgreKeyFrame.h:176
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:58
Ogre::VertexPoseKeyFrame::PoseRef::PoseRef
PoseRef(ushort p, Real i)
Definition: OgreKeyFrame.h:210
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::NumericKeyFrame
Specialised KeyFrame which stores any numeric value.
Definition: OgreKeyFrame.h:80
Ogre::ushort
unsigned short ushort
Definition: OgrePrerequisites.h:113
OgreAny.h
Ogre::VertexPoseKeyFrame::PoseRef
Reference to a pose at a given influence level.
Definition: OgreKeyFrame.h:195
Ogre::VectorIterator
Concrete IteratorWrapper for nonconst access to the underlying container.
Definition: OgreIteratorWrapper.h:186
Ogre::TransformKeyFrame::mScale
Vector3 mScale
Definition: OgreKeyFrame.h:143
OgreQuaternion.h
Ogre::VertexPoseKeyFrame
Specialised KeyFrame which references a Mesh::Pose at a certain influence level, which stores offsets...
Definition: OgreKeyFrame.h:184
Ogre::KeyFrame::getTime
Real getTime(void) const
Gets the time of this keyframe in the animation sequence.
Definition: OgreKeyFrame.h:66
Ogre::KeyFrame::~KeyFrame
virtual ~KeyFrame()
Definition: OgreKeyFrame.h:63
Ogre::VertexPoseKeyFrame::PoseRef::influence
Real influence
Influence level of the linked pose.
Definition: OgreKeyFrame.h:208
Ogre::VertexMorphKeyFrame::~VertexMorphKeyFrame
~VertexMorphKeyFrame()
Definition: OgreKeyFrame.h:159
Ogre::Quaternion
Implementation of a Quaternion, i.e.
Definition: OgreQuaternion.h:57
OgreHeaderPrefix.h
Ogre::TransformKeyFrame::mTranslate
Vector3 mTranslate
Definition: OgreKeyFrame.h:142
OgrePrerequisites.h
Ogre::HardwareVertexBufferSharedPtr
Shared pointer implementation used to share vertex buffers.
Definition: OgreHardwareVertexBuffer.h:86
Ogre::AnyNumeric
Specialised Any class which has built in arithmetic operators, but can hold only types which support ...
Definition: OgreAny.h:247
Ogre::AnimationTrack
A 'track' in an animation sequence, i.e.
Definition: OgreAnimationTrack.h:122
Ogre::TransformKeyFrame::mRotate
Quaternion mRotate
Definition: OgreKeyFrame.h:144
Ogre::VertexPoseKeyFrame::mPoseRefs
PoseRefList mPoseRefs
Definition: OgreKeyFrame.h:248
Ogre::TransformKeyFrame::~TransformKeyFrame
~TransformKeyFrame()
Definition: OgreKeyFrame.h:108
Ogre::KeyFrame::mTime
Real mTime
Definition: OgreKeyFrame.h:73
OgreIteratorWrappers.h
OgreHardwareVertexBuffer.h
Ogre::VertexPoseKeyFrame::ConstPoseRefIterator
ConstVectorIterator< PoseRefList > ConstPoseRefIterator
Definition: OgreKeyFrame.h:234
Ogre::KeyFrame::mParentTrack
const AnimationTrack * mParentTrack
Definition: OgreKeyFrame.h:74
Ogre::TransformKeyFrame
Specialised KeyFrame which stores a full transform.
Definition: OgreKeyFrame.h:103
Ogre::VertexPoseKeyFrame::PoseRef::poseIndex
ushort poseIndex
The linked pose index.
Definition: OgreKeyFrame.h:204
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::NumericKeyFrame::~NumericKeyFrame
~NumericKeyFrame()
Definition: OgreKeyFrame.h:85
Ogre::VertexPoseKeyFrame::~VertexPoseKeyFrame
~VertexPoseKeyFrame()
Definition: OgreKeyFrame.h:189
Ogre::VertexMorphKeyFrame
Specialised KeyFrame which stores absolute vertex positions for a complete buffer,...
Definition: OgreKeyFrame.h:154
Ogre::vector
Definition: OgrePrerequisites.h:491
OgreVector3.h
Ogre::Vector3
Standard 3-dimensional vector.
Definition: OgreVector3.h:51
Ogre::VertexPoseKeyFrame::PoseRefIterator
VectorIterator< PoseRefList > PoseRefIterator
Definition: OgreKeyFrame.h:233
Ogre::ConstVectorIterator
Concrete IteratorWrapper for const access to the underlying container.
Definition: OgreIteratorWrapper.h:217

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Tue Apr 13 2021 08:53:15