OGRE  1.9
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 "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:
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 
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 
const AnimationTrack * mParentTrack
Definition: OgreKeyFrame.h:74
Specialised Any class which has built in arithmetic operators, but can hold only types which support ...
Definition: OgreAny.h:247
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:154
Reference to a pose at a given influence level.
Definition: OgreKeyFrame.h:195
float Real
Software floating point type.
Specialised KeyFrame which stores a full transform.
Definition: OgreKeyFrame.h:103
#define _OgreExport
Definition: OgrePlatform.h:260
A key frame in an animation sequence defined by an AnimationTrack.
Definition: OgreKeyFrame.h:56
HardwareVertexBufferSharedPtr mBuffer
Definition: OgreKeyFrame.h:176
Shared pointer implementation used to share vertex buffers.
Implementation of a Quaternion, i.e.
vector< PoseRef >::type PoseRefList
Definition: OgreKeyFrame.h:212
Real getTime(void) const
Gets the time of this keyframe in the animation sequence.
Definition: OgreKeyFrame.h:66
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:63
ushort poseIndex
The linked pose index.
Definition: OgreKeyFrame.h:204
Standard 3-dimensional vector.
Definition: OgreVector3.h:51
VectorIterator< PoseRefList > PoseRefIterator
Definition: OgreKeyFrame.h:233
unsigned short ushort
Real influence
Influence level of the linked pose.
Definition: OgreKeyFrame.h:208
Specialised KeyFrame which references a Mesh::Pose at a certain influence level, which stores offsets...
Definition: OgreKeyFrame.h:184
Specialised KeyFrame which stores any numeric value.
Definition: OgreKeyFrame.h:80
Concrete IteratorWrapper for nonconst access to the underlying container.
ConstVectorIterator< PoseRefList > ConstPoseRefIterator
Definition: OgreKeyFrame.h:234