OgreKeyFrame.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef __KeyFrame_H__
#define __KeyFrame_H__
#include "OgrePrerequisites.h"
#include "OgreVector3.h"
#include "OgreQuaternion.h"
#include "OgreAny.h"
#include "OgreHardwareVertexBuffer.h"
#include "OgreIteratorWrappers.h"
#include "OgreHeaderPrefix.h"
namespace Ogre
{
class _OgreExport KeyFrame : public AnimationAlloc
{
public:
KeyFrame(const AnimationTrack* parent, Real time);
virtual ~KeyFrame() {}
Real getTime(void) const { return mTime; }
virtual KeyFrame* _clone(AnimationTrack* newParent) const;
protected:
Real mTime;
const AnimationTrack* mParentTrack;
};
class _OgreExport NumericKeyFrame : public KeyFrame
{
public:
NumericKeyFrame(const AnimationTrack* parent, Real time);
~NumericKeyFrame() {}
virtual const AnyNumeric& getValue(void) const;
virtual void setValue(const AnyNumeric& val);
KeyFrame* _clone(AnimationTrack* newParent) const;
protected:
AnyNumeric mValue;
};
class _OgreExport TransformKeyFrame : public KeyFrame
{
public:
TransformKeyFrame(const AnimationTrack* parent, Real time);
~TransformKeyFrame() {}
virtual void setTranslate(const Vector3& trans);
const Vector3& getTranslate(void) const;
virtual void setScale(const Vector3& scale);
virtual const Vector3& getScale(void) const;
virtual void setRotation(const Quaternion& rot);
virtual const Quaternion& getRotation(void) const;
KeyFrame* _clone(AnimationTrack* newParent) const;
protected:
Vector3 mTranslate;
Vector3 mScale;
Quaternion mRotate;
};
class _OgreExport VertexMorphKeyFrame : public KeyFrame
{
public:
VertexMorphKeyFrame(const AnimationTrack* parent, Real time);
~VertexMorphKeyFrame() {}
void setVertexBuffer(const HardwareVertexBufferSharedPtr& buf);
const HardwareVertexBufferSharedPtr& getVertexBuffer(void) const;
KeyFrame* _clone(AnimationTrack* newParent) const;
protected:
HardwareVertexBufferSharedPtr mBuffer;
};
class _OgreExport VertexPoseKeyFrame : public KeyFrame
{
public:
VertexPoseKeyFrame(const AnimationTrack* parent, Real time);
~VertexPoseKeyFrame() {}
struct PoseRef
{
ushort poseIndex;
Real influence;
PoseRef(ushort p, Real i) : poseIndex(p), influence(i) {}
};
typedef vector<PoseRef>::type PoseRefList;
void addPoseReference(ushort poseIndex, Real influence);
void updatePoseReference(ushort poseIndex, Real influence);
void removePoseReference(ushort poseIndex);
void removeAllPoseReferences(void);
const PoseRefList& getPoseReferences(void) const;
typedef VectorIterator<PoseRefList> PoseRefIterator;
typedef ConstVectorIterator<PoseRefList> ConstPoseRefIterator;
PoseRefIterator getPoseReferenceIterator(void);
ConstPoseRefIterator getPoseReferenceIterator(void) const;
KeyFrame* _clone(AnimationTrack* newParent) const;
void _applyBaseKeyFrame(const VertexPoseKeyFrame* base);
protected:
PoseRefList mPoseRefs;
};
}
#include "OgreHeaderSuffix.h"
#endif
Ogre::AnimationTrack
A &#39;track&#39; in an animation sequence, i.e.
Definition: OgreAnimationTrack.h:122
Ogre::VectorIterator
Concrete IteratorWrapper for nonconst access to the underlying container.
Definition: OgreIteratorWrapper.h:186
Ogre::TransformKeyFrame::mRotate
Quaternion mRotate
Definition: OgreKeyFrame.h:144
OgreQuaternion.h
OgreVector3.h
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::VertexMorphKeyFrame::~VertexMorphKeyFrame
~VertexMorphKeyFrame()
Definition: OgreKeyFrame.h:159
Ogre::Quaternion
Implementation of a Quaternion, i.e.
Definition: OgreQuaternion.h:57
Ogre::VertexPoseKeyFrame::PoseRefList
vector< PoseRef >::type PoseRefList
Definition: OgreKeyFrame.h:212
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::VertexPoseKeyFrame::mPoseRefs
PoseRefList mPoseRefs
Definition: OgreKeyFrame.h:248
Ogre::TransformKeyFrame
Specialised KeyFrame which stores a full transform.
Definition: OgreKeyFrame.h:103
Ogre::KeyFrame::mParentTrack
const AnimationTrack * mParentTrack
Definition: OgreKeyFrame.h:74
Ogre::NumericKeyFrame::mValue
AnyNumeric mValue
Definition: OgreKeyFrame.h:98
Ogre::VertexPoseKeyFrame::PoseRef
Reference to a pose at a given influence level.
Definition: OgreKeyFrame.h:195
Ogre::Vector3
Standard 3-dimensional vector.
Definition: OgreVector3.h:51
Ogre::HardwareVertexBufferSharedPtr
Shared pointer implementation used to share vertex buffers.
Definition: OgreHardwareVertexBuffer.h:86
OgrePrerequisites.h
Ogre::KeyFrame::mTime
Real mTime
Definition: OgreKeyFrame.h:73
Ogre::VertexPoseKeyFrame::PoseRefIterator
VectorIterator< PoseRefList > PoseRefIterator
Definition: OgreKeyFrame.h:233
Ogre::KeyFrame
A key frame in an animation sequence defined by an AnimationTrack.
Definition: OgreKeyFrame.h:56
Ogre::VertexPoseKeyFrame::~VertexPoseKeyFrame
~VertexPoseKeyFrame()
Definition: OgreKeyFrame.h:189
Ogre::AnyNumeric
Specialised Any class which has built in arithmetic operators, but can hold only types which support ...
Definition: OgreAny.h:247
OgreHardwareVertexBuffer.h
Ogre::NumericKeyFrame::~NumericKeyFrame
~NumericKeyFrame()
Definition: OgreKeyFrame.h:85
Ogre::VertexMorphKeyFrame
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
Ogre::VertexPoseKeyFrame::PoseRef::poseIndex
ushort poseIndex
The linked pose index.
Definition: OgreKeyFrame.h:204
OgreHeaderSuffix.h
OgreAny.h
OgreIteratorWrappers.h
Ogre::TransformKeyFrame::mTranslate
Vector3 mTranslate
Definition: OgreKeyFrame.h:142
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::ConstVectorIterator
Concrete IteratorWrapper for const access to the underlying container.
Definition: OgreIteratorWrapper.h:217
Ogre::vector
Definition: OgrePrerequisites.h:491
OgreHeaderPrefix.h
Ogre::VertexPoseKeyFrame
Specialised KeyFrame which references a Mesh::Pose at a certain influence level, which stores offsets...
Definition: OgreKeyFrame.h:184
Ogre::TransformKeyFrame::~TransformKeyFrame
~TransformKeyFrame()
Definition: OgreKeyFrame.h:108
Ogre::ushort
unsigned short ushort
Definition: OgrePrerequisites.h:113
Ogre::VertexPoseKeyFrame::PoseRef::PoseRef
PoseRef(ushort p, Real i)
Definition: OgreKeyFrame.h:210
Ogre::VertexPoseKeyFrame::ConstPoseRefIterator
ConstVectorIterator< PoseRefList > ConstPoseRefIterator
Definition: OgreKeyFrame.h:234
Ogre::VertexMorphKeyFrame::mBuffer
HardwareVertexBufferSharedPtr mBuffer
Definition: OgreKeyFrame.h:176
Ogre::VertexPoseKeyFrame::PoseRef::influence
Real influence
Influence level of the linked pose.
Definition: OgreKeyFrame.h:208
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:58
Ogre::TransformKeyFrame::mScale
Vector3 mScale
Definition: OgreKeyFrame.h:143
Ogre::KeyFrame::getTime
Real getTime(void) const
Gets the time of this keyframe in the animation sequence.
Definition: OgreKeyFrame.h:66
Ogre::NumericKeyFrame
Specialised KeyFrame which stores any numeric value.
Definition: OgreKeyFrame.h:80
Ogre::KeyFrame::~KeyFrame
virtual ~KeyFrame()
Definition: OgreKeyFrame.h:63

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