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 
#define _OgreExport
Definition: OgrePlatform.h:257
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
A 'track' in an animation sequence, i.e.
Specialised Any class which has built in arithmetic operators, but can hold only types which support ...
Definition: OgreAny.h:248
Concrete IteratorWrapper for const access to the underlying container.
Shared pointer implementation used to share vertex buffers.
A key frame in an animation sequence defined by an AnimationTrack.
Definition: OgreKeyFrame.h:57
virtual KeyFrame * _clone(AnimationTrack *newParent) const
Clone a keyframe (internal use only)
virtual ~KeyFrame()
Definition: OgreKeyFrame.h:63
KeyFrame(const AnimationTrack *parent, Real time)
Default constructor, you should not call this but use AnimationTrack::createKeyFrame instead.
Real getTime(void) const
Gets the time of this keyframe in the animation sequence.
Definition: OgreKeyFrame.h:66
const AnimationTrack * mParentTrack
Definition: OgreKeyFrame.h:74
Specialised KeyFrame which stores any numeric value.
Definition: OgreKeyFrame.h:81
KeyFrame * _clone(AnimationTrack *newParent) const
Clone a keyframe (internal use only)
virtual const AnyNumeric & getValue(void) const
Get the value at this keyframe.
NumericKeyFrame(const AnimationTrack *parent, Real time)
Default constructor, you should not call this but use AnimationTrack::createKeyFrame instead.
virtual void setValue(const AnyNumeric &val)
Set the value at this keyframe.
Implementation of a Quaternion, i.e.
Specialised KeyFrame which stores a full transform.
Definition: OgreKeyFrame.h:104
KeyFrame * _clone(AnimationTrack *newParent) const
Clone a keyframe (internal use only)
virtual void setScale(const Vector3 &scale)
Sets the scaling factor applied by this keyframe to the animable object at it's time index.
TransformKeyFrame(const AnimationTrack *parent, Real time)
Default constructor, you should not call this but use AnimationTrack::createKeyFrame instead.
virtual void setRotation(const Quaternion &rot)
Sets the rotation applied by this keyframe.
virtual void setTranslate(const Vector3 &trans)
Sets the translation associated with this keyframe.
const Vector3 & getTranslate(void) const
Gets the translation applied by this keyframe.
virtual const Vector3 & getScale(void) const
Gets the scaling factor applied by this keyframe.
virtual const Quaternion & getRotation(void) const
Gets the rotation applied by this keyframe.
Standard 3-dimensional vector.
Definition: OgreVector3.h:52
Concrete IteratorWrapper for nonconst access to the underlying container.
Specialised KeyFrame which stores absolute vertex positions for a complete buffer,...
Definition: OgreKeyFrame.h:155
VertexMorphKeyFrame(const AnimationTrack *parent, Real time)
Default constructor, you should not call this but use AnimationTrack::createKeyFrame instead.
void setVertexBuffer(const HardwareVertexBufferSharedPtr &buf)
Sets the vertex buffer containing the source positions for this keyframe.
const HardwareVertexBufferSharedPtr & getVertexBuffer(void) const
Gets the vertex buffer containing positions for this keyframe.
HardwareVertexBufferSharedPtr mBuffer
Definition: OgreKeyFrame.h:176
KeyFrame * _clone(AnimationTrack *newParent) const
Clone a keyframe (internal use only)
Specialised KeyFrame which references a Mesh::Pose at a certain influence level, which stores offsets...
Definition: OgreKeyFrame.h:185
void removeAllPoseReferences(void)
Remove all pose references.
void addPoseReference(ushort poseIndex, Real influence)
Add a new pose reference.
VectorIterator< PoseRefList > PoseRefIterator
Definition: OgreKeyFrame.h:233
vector< PoseRef >::type PoseRefList
Definition: OgreKeyFrame.h:212
const PoseRefList & getPoseReferences(void) const
Get a const reference to the list of pose references.
PoseRefIterator getPoseReferenceIterator(void)
Get an iterator over the pose references.
void updatePoseReference(ushort poseIndex, Real influence)
Update the influence of a pose reference.
ConstVectorIterator< PoseRefList > ConstPoseRefIterator
Definition: OgreKeyFrame.h:234
void _applyBaseKeyFrame(const VertexPoseKeyFrame *base)
ConstPoseRefIterator getPoseReferenceIterator(void) const
Get a const iterator over the pose references.
VertexPoseKeyFrame(const AnimationTrack *parent, Real time)
Default constructor, you should not call this but use AnimationTrack::createKeyFrame instead.
KeyFrame * _clone(AnimationTrack *newParent) const
Clone a keyframe (internal use only)
void removePoseReference(ushort poseIndex)
Remove reference to a given pose.
float Real
Software floating point type.
unsigned short ushort
Reference to a pose at a given influence level.
Definition: OgreKeyFrame.h:196
ushort poseIndex
The linked pose index.
Definition: OgreKeyFrame.h:204
Real influence
Influence level of the linked pose.
Definition: OgreKeyFrame.h:208

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