OgrePose.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 __OGRE_POSE_H
#define __OGRE_POSE_H
#include "OgrePrerequisites.h"
#include "OgreString.h"
#include "OgreHardwareVertexBuffer.h"
#include "OgreVector3.h"
#include "OgreIteratorWrappers.h"
#include "OgreHeaderPrefix.h"
namespace Ogre {
class _OgreExport Pose : public AnimationAlloc
{
public:
Pose(ushort target, const String& name = StringUtil::BLANK);
virtual ~Pose();
const String& getName(void) const { return mName; }
ushort getTarget(void) const { return mTarget; }
typedef map<size_t, Vector3>::type VertexOffsetMap;
typedef MapIterator<VertexOffsetMap> VertexOffsetIterator;
typedef ConstMapIterator<VertexOffsetMap> ConstVertexOffsetIterator;
typedef map<size_t, Vector3>::type NormalsMap;
typedef MapIterator<NormalsMap> NormalsIterator;
typedef ConstMapIterator<NormalsMap> ConstNormalsIterator;
bool getIncludesNormals() const { return !mNormalsMap.empty(); }
void addVertex(size_t index, const Vector3& offset);
void addVertex(size_t index, const Vector3& offset, const Vector3& normal);
void removeVertex(size_t index);
void clearVertices(void);
ConstVertexOffsetIterator getVertexOffsetIterator(void) const;
VertexOffsetIterator getVertexOffsetIterator(void);
const VertexOffsetMap& getVertexOffsets(void) const { return mVertexOffsetMap; }
ConstNormalsIterator getNormalsIterator(void) const;
NormalsIterator getNormalsIterator(void);
const NormalsMap& getNormals(void) const { return mNormalsMap; }
const HardwareVertexBufferSharedPtr& _getHardwareVertexBuffer(const VertexData* origData) const;
Pose* clone(void) const;
protected:
ushort mTarget;
String mName;
VertexOffsetMap mVertexOffsetMap;
NormalsMap mNormalsMap;
mutable HardwareVertexBufferSharedPtr mBuffer;
};
typedef vector<Pose*>::type PoseList;
}
#include "OgreHeaderSuffix.h"
#endif
Ogre::Pose::mTarget
ushort mTarget
Target geometry index.
Definition: OgrePose.h:125
Ogre::Pose::mNormalsMap
NormalsMap mNormalsMap
Primary storage, sparse vertex use.
Definition: OgrePose.h:131
OgreVector3.h
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::Pose::getNormals
const NormalsMap & getNormals(void) const
Gets a const reference to the vertex offsets.
Definition: OgrePose.h:114
Ogre::Pose::getTarget
ushort getTarget(void) const
Return the target geometry index of the pose.
Definition: OgrePose.h:68
Ogre::PoseList
vector< Pose * >::type PoseList
Definition: OgrePose.h:135
Ogre::VertexData
Summary class collecting together vertex source information.
Definition: OgreVertexIndexData.h:49
Ogre::MapIterator
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
Definition: OgreIteratorWrapper.h:319
Ogre::ConstMapIterator
Concrete IteratorWrapper for const access to the underlying key-value container.
Definition: OgreIteratorWrapper.h:352
OgreString.h
Ogre::Pose::NormalsIterator
MapIterator< NormalsMap > NormalsIterator
An iterator over the vertex offsets.
Definition: OgrePose.h:78
Ogre::Pose::mVertexOffsetMap
VertexOffsetMap mVertexOffsetMap
Primary storage, sparse vertex use.
Definition: OgrePose.h:129
Ogre::Pose::ConstNormalsIterator
ConstMapIterator< NormalsMap > ConstNormalsIterator
An iterator over the vertex offsets.
Definition: OgrePose.h:80
Ogre::Pose::VertexOffsetMap
map< size_t, Vector3 >::type VertexOffsetMap
A collection of vertex offsets based on the vertex index.
Definition: OgrePose.h:70
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::Pose::mName
String mName
Optional name.
Definition: OgrePose.h:127
Ogre::Pose::mBuffer
HardwareVertexBufferSharedPtr mBuffer
Derived hardware buffer, covers all vertices.
Definition: OgrePose.h:133
Ogre::Pose::getIncludesNormals
bool getIncludesNormals() const
Return whether the pose vertices include normals.
Definition: OgrePose.h:82
Ogre::Pose::VertexOffsetIterator
MapIterator< VertexOffsetMap > VertexOffsetIterator
An iterator over the vertex offsets.
Definition: OgrePose.h:72
OgreHardwareVertexBuffer.h
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::Pose::getName
const String & getName(void) const
Return the name of the pose (may be blank)
Definition: OgrePose.h:66
OgreHeaderSuffix.h
OgreIteratorWrappers.h
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::vector
Definition: OgrePrerequisites.h:491
OgreHeaderPrefix.h
Ogre::map
Definition: OgrePrerequisites.h:533
Ogre::Pose::getVertexOffsets
const VertexOffsetMap & getVertexOffsets(void) const
Gets a const reference to the vertex offsets.
Definition: OgrePose.h:107
Ogre::Pose::NormalsMap
map< size_t, Vector3 >::type NormalsMap
A collection of normals based on the vertex index.
Definition: OgrePose.h:76
Ogre::ushort
unsigned short ushort
Definition: OgrePrerequisites.h:113
Ogre::StringUtil::BLANK
static const String BLANK
Constant blank string, useful for returning by ref where local does not exist.
Definition: OgreString.h:196
Ogre::Pose::ConstVertexOffsetIterator
ConstMapIterator< VertexOffsetMap > ConstVertexOffsetIterator
An iterator over the vertex offsets.
Definition: OgrePose.h:74
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:58
Ogre::Pose
A pose is a linked set of vertex offsets applying to one set of vertex data.
Definition: OgrePose.h:55

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