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 
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 
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 
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 
155  {
156  public:
168 
171 
173  KeyFrame* _clone(AnimationTrack* newParent) const;
174 
175  protected:
177 
178  };
179 
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);
228 
229 
231  const PoseRefList& getPoseReferences(void) const;
232 
235 
238 
241 
243  KeyFrame* _clone(AnimationTrack* newParent) const;
244 
246 
247  protected:
249 
250  };
254 }
255 
256 #include "OgreHeaderSuffix.h"
257 
258 #endif
259 
OgreHeaderSuffix.h
Ogre::TransformKeyFrame::_clone
KeyFrame * _clone(AnimationTrack *newParent) const
Clone a keyframe (internal use only)
Ogre::KeyFrame
A key frame in an animation sequence defined by an AnimationTrack.
Definition: OgreKeyFrame.h:57
Ogre::NumericKeyFrame::mValue
AnyNumeric mValue
Definition: OgreKeyFrame.h:98
Ogre::VertexPoseKeyFrame::PoseRefList
vector< PoseRef >::type PoseRefList
Definition: OgreKeyFrame.h:212
Ogre::VertexMorphKeyFrame::VertexMorphKeyFrame
VertexMorphKeyFrame(const AnimationTrack *parent, Real time)
Default constructor, you should not call this but use AnimationTrack::createKeyFrame instead.
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:59
Ogre::VertexPoseKeyFrame::PoseRef::PoseRef
PoseRef(ushort p, Real i)
Definition: OgreKeyFrame.h:210
Ogre
Definition: OgreAndroidLogListener.h:35
Ogre::NumericKeyFrame
Specialised KeyFrame which stores any numeric value.
Definition: OgreKeyFrame.h:81
Ogre::KeyFrame::_clone
virtual KeyFrame * _clone(AnimationTrack *newParent) const
Clone a keyframe (internal use only)
Ogre::TransformKeyFrame::TransformKeyFrame
TransformKeyFrame(const AnimationTrack *parent, Real time)
Default constructor, you should not call this but use AnimationTrack::createKeyFrame instead.
Ogre::ushort
unsigned short ushort
Definition: OgrePrerequisites.h:113
Ogre::NumericKeyFrame::NumericKeyFrame
NumericKeyFrame(const AnimationTrack *parent, Real time)
Default constructor, you should not call this but use AnimationTrack::createKeyFrame instead.
OgreAny.h
Ogre::TransformKeyFrame::setRotation
virtual void setRotation(const Quaternion &rot)
Sets the rotation applied by this keyframe.
Ogre::NumericKeyFrame::getValue
virtual const AnyNumeric & getValue(void) const
Get the value at this keyframe.
Ogre::TransformKeyFrame::getRotation
virtual const Quaternion & getRotation(void) const
Gets the rotation applied by this keyframe.
Ogre::VertexPoseKeyFrame::PoseRef
Reference to a pose at a given influence level.
Definition: OgreKeyFrame.h:196
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::VertexPoseKeyFrame
VertexPoseKeyFrame(const AnimationTrack *parent, Real time)
Default constructor, you should not call this but use AnimationTrack::createKeyFrame instead.
Ogre::VertexPoseKeyFrame::_applyBaseKeyFrame
void _applyBaseKeyFrame(const VertexPoseKeyFrame *base)
Ogre::VertexPoseKeyFrame
Specialised KeyFrame which references a Mesh::Pose at a certain influence level, which stores offsets...
Definition: OgreKeyFrame.h:185
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::NumericKeyFrame::_clone
KeyFrame * _clone(AnimationTrack *newParent) const
Clone a keyframe (internal use only)
Ogre::KeyFrame::KeyFrame
KeyFrame(const AnimationTrack *parent, Real time)
Default constructor, you should not call this but use AnimationTrack::createKeyFrame instead.
Ogre::VertexPoseKeyFrame::removePoseReference
void removePoseReference(ushort poseIndex)
Remove reference to a given pose.
Ogre::VertexPoseKeyFrame::addPoseReference
void addPoseReference(ushort poseIndex, Real influence)
Add a new pose reference.
Ogre::VertexPoseKeyFrame::PoseRef::influence
Real influence
Influence level of the linked pose.
Definition: OgreKeyFrame.h:208
Ogre::VertexPoseKeyFrame::getPoseReferenceIterator
PoseRefIterator getPoseReferenceIterator(void)
Get an iterator over the pose references.
Ogre::VertexMorphKeyFrame::~VertexMorphKeyFrame
~VertexMorphKeyFrame()
Definition: OgreKeyFrame.h:159
Ogre::TransformKeyFrame::getTranslate
const Vector3 & getTranslate(void) const
Gets the translation applied by this keyframe.
Ogre::Quaternion
Implementation of a Quaternion, i.e.
Definition: OgreQuaternion.h:58
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:87
Ogre::VertexPoseKeyFrame::_clone
KeyFrame * _clone(AnimationTrack *newParent) const
Clone a keyframe (internal use only)
Ogre::AnyNumeric
Specialised Any class which has built in arithmetic operators, but can hold only types which support ...
Definition: OgreAny.h:248
Ogre::VertexPoseKeyFrame::getPoseReferences
const PoseRefList & getPoseReferences(void) const
Get a const reference to the list of pose references.
Ogre::AnimationTrack
A 'track' in an animation sequence, i.e.
Definition: OgreAnimationTrack.h:123
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
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::TransformKeyFrame::getScale
virtual const Vector3 & getScale(void) const
Gets the scaling factor applied by this keyframe.
Ogre::NumericKeyFrame::setValue
virtual void setValue(const AnyNumeric &val)
Set the value at this keyframe.
Ogre::VertexPoseKeyFrame::removeAllPoseReferences
void removeAllPoseReferences(void)
Remove all pose references.
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:104
Ogre::VertexMorphKeyFrame::getVertexBuffer
const HardwareVertexBufferSharedPtr & getVertexBuffer(void) const
Gets the vertex buffer containing positions for this keyframe.
Ogre::TransformKeyFrame::setScale
virtual void setScale(const Vector3 &scale)
Sets the scaling factor applied by this keyframe to the animable object at it's time index.
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:155
Ogre::TransformKeyFrame::setTranslate
virtual void setTranslate(const Vector3 &trans)
Sets the translation associated with this keyframe.
Ogre::VertexMorphKeyFrame::_clone
KeyFrame * _clone(AnimationTrack *newParent) const
Clone a keyframe (internal use only)
Ogre::vector
Definition: OgrePrerequisites.h:492
Ogre::VertexMorphKeyFrame::setVertexBuffer
void setVertexBuffer(const HardwareVertexBufferSharedPtr &buf)
Sets the vertex buffer containing the source positions for this keyframe.
OgreVector3.h
Ogre::Vector3
Standard 3-dimensional vector.
Definition: OgreVector3.h:52
Ogre::VertexPoseKeyFrame::PoseRefIterator
VectorIterator< PoseRefList > PoseRefIterator
Definition: OgreKeyFrame.h:233
Ogre::VertexPoseKeyFrame::getPoseReferenceIterator
ConstPoseRefIterator getPoseReferenceIterator(void) const
Get a const iterator over the pose references.
Ogre::ConstVectorIterator
Concrete IteratorWrapper for const access to the underlying container.
Definition: OgreIteratorWrapper.h:217
Ogre::VertexPoseKeyFrame::updatePoseReference
void updatePoseReference(ushort poseIndex, Real influence)
Update the influence of a pose reference.

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.