Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::SkeletonSerializer Class Reference

Class for serialising skeleton data to/from an OGRE .skeleton file. More...

#include <OgreSkeletonSerializer.h>

Inheritance diagram for Ogre::SkeletonSerializer:

Ogre::Serializer List of all members.

Public Methods

 SkeletonSerializer ()
virtual ~SkeletonSerializer ()
void exportSkeleton (const Skeleton *pSkeleton, const String &filename)
 Exports a skeleton to the file specified. More...

void importSkeleton (DataChunk &chunk, Skeleton *pDest)
 Imports Skeleton and animation data from a .skeleton file DataChunk. More...


Protected Methods

virtual void writeFileHeader (void)
virtual void writeChunkHeader (unsigned short id, unsigned long size)
void writeReals (const Real *pReal, unsigned short count)
void writeShorts (const unsigned short *pShort, unsigned short count)
void writeLongs (const unsigned long *pLong, unsigned short count)
void writeBools (const bool *pLong, unsigned short count)
void writeObject (const Vector3 &vec)
void writeObject (const Quaternion &q)
void writeString (const String &string)
void writeData (const void *buf, size_t size, size_t count)
virtual void readFileHeader (DataChunk &chunk)
virtual unsigned short readChunk (DataChunk &chunk)
void readBools (DataChunk &chunk, bool *pDest, unsigned short count)
void readReals (DataChunk &chunk, Real *pDest, unsigned short count)
void readShorts (DataChunk &chunk, unsigned short *pDest, unsigned short count)
void readLongs (DataChunk &chunk, unsigned long *pDest, unsigned short count)
void readObject (DataChunk &chunk, Vector3 *pDest)
void readObject (DataChunk &chunk, Quaternion *pDest)
String readString (DataChunk &chunk)
void flipToLittleEndian (void *pData, size_t size, unsigned short count=1)
void flipFromLittleEndian (void *pData, size_t size, unsigned short count=1)
void flipEndian (void *pData, size_t size, unsigned short count)
void flipEndian (void *pData, size_t size)

Protected Attributes

unsigned long mCurrentChunkLen
FILE * mpfFile
String mVersion

Private Methods

void writeSkeleton (const Skeleton *pSkel)
void writeBone (const Bone *pBone)
void writeBoneParent (unsigned short boneId, unsigned short parentId)
void writeAnimation (const Animation *anim)
void writeAnimationTrack (const AnimationTrack *track)
void writeKeyFrame (const KeyFrame *key)
void readBone (DataChunk &chunk)
void readBoneParent (DataChunk &chunk)
void readAnimation (DataChunk &chunk)
void readAnimationTrack (DataChunk &chunk, Animation *anim)
void readKeyFrame (DataChunk &chunk, AnimationTrack *track)
unsigned long calcBoneSize (const Bone *pBone)
unsigned long calcBoneParentSize (void)
unsigned long calcAnimationSize (const Animation *pAnim)
unsigned long calcAnimationTrackSize (const AnimationTrack *pTrack)
unsigned long calcKeyFrameSize (const KeyFrame *pKey)

Private Attributes

Skeleton * mpSkeleton

Detailed Description

Class for serialising skeleton data to/from an OGRE .skeleton file.

Remarks:
This class allows exporters to write OGRE .skeleton files easily, and allows the OGRE engine to import .skeleton files into instatiated OGRE Skeleton objects. Note that a .skeleton file includes not only the Skeleton, but also definitions of any Animations it uses.

To export a Skeleton:

  1. Create a Skeleton object and populate it using it's methods.
  2. Call the exportSkeleton method


Constructor & Destructor Documentation

Ogre::SkeletonSerializer::SkeletonSerializer (    ) 
 

Ogre::SkeletonSerializer::~SkeletonSerializer (    )  [virtual]
 


Member Function Documentation

unsigned long Ogre::SkeletonSerializer::calcAnimationSize (  const Animation *    pAnim )  [private]
 

unsigned long Ogre::SkeletonSerializer::calcAnimationTrackSize (  const AnimationTrack *    pTrack )  [private]
 

unsigned long Ogre::SkeletonSerializer::calcBoneParentSize (  void    )  [private]
 

unsigned long Ogre::SkeletonSerializer::calcBoneSize (  const Bone *    pBone )  [private]
 

unsigned long Ogre::SkeletonSerializer::calcKeyFrameSize (  const KeyFrame *    pKey )  [private]
 

void Ogre::SkeletonSerializer::exportSkeleton (  const Skeleton *    pSkeleton,
const String &    filename
) 
 

Exports a skeleton to the file specified.

Remarks:
This method takes an externally created Skeleton object, and exports both it and animations it uses to a .skeleton file.
Parameters:
pSkeleton  Pointer to the Skeleton to export
filename  The destination filename

void Ogre::Serializer::flipEndian (  void *    pData,
size_t    size
)  [protected, inherited]
 

void Ogre::Serializer::flipEndian (  void *    pData,
size_t    size,
unsigned short    count
)  [protected, inherited]
 

void Ogre::Serializer::flipFromLittleEndian (  void *    pData,
size_t    size,
unsigned short    count = 1
)  [protected, inherited]
 

void Ogre::Serializer::flipToLittleEndian (  void *    pData,
size_t    size,
unsigned short    count = 1
)  [protected, inherited]
 

void Ogre::SkeletonSerializer::importSkeleton (  DataChunk &    chunk,
Skeleton *    pDest
) 
 

Imports Skeleton and animation data from a .skeleton file DataChunk.

Remarks:
This method imports data from a DataChunk opened from a .skeleton file and places it's contents into the Skeleton object which is passed in.
Parameters:
chunk  The DataChunk holding the .skeleton data. Must be initialised (pos at the start of the buffer).
pDest  Pointer to the Skeleton object which will receive the data. Should be blank already.

void Ogre::SkeletonSerializer::readAnimation (  DataChunk &    chunk )  [private]
 

void Ogre::SkeletonSerializer::readAnimationTrack (  DataChunk &    chunk,
Animation *    anim
)  [private]
 

void Ogre::SkeletonSerializer::readBone (  DataChunk &    chunk )  [private]
 

void Ogre::SkeletonSerializer::readBoneParent (  DataChunk &    chunk )  [private]
 

void Ogre::Serializer::readBools (  DataChunk &    chunk,
bool *    pDest,
unsigned short    count
)  [protected, inherited]
 

unsigned short Ogre::Serializer::readChunk (  DataChunk &    chunk )  [protected, virtual, inherited]
 

void Ogre::Serializer::readFileHeader (  DataChunk &    chunk )  [protected, virtual, inherited]
 

void Ogre::SkeletonSerializer::readKeyFrame (  DataChunk &    chunk,
AnimationTrack *    track
)  [private]
 

void Ogre::Serializer::readLongs (  DataChunk &    chunk,
unsigned long *    pDest,
unsigned short    count
)  [protected, inherited]
 

void Ogre::Serializer::readObject (  DataChunk &    chunk,
Quaternion *    pDest
)  [protected, inherited]
 

void Ogre::Serializer::readObject (  DataChunk &    chunk,
Vector3 *    pDest
)  [protected, inherited]
 

void Ogre::Serializer::readReals (  DataChunk &    chunk,
Real *    pDest,
unsigned short    count
)  [protected, inherited]
 

void Ogre::Serializer::readShorts (  DataChunk &    chunk,
unsigned short *    pDest,
unsigned short    count
)  [protected, inherited]
 

String Ogre::Serializer::readString (  DataChunk &    chunk )  [protected, inherited]
 

void Ogre::SkeletonSerializer::writeAnimation (  const Animation *    anim )  [private]
 

void Ogre::SkeletonSerializer::writeAnimationTrack (  const AnimationTrack *    track )  [private]
 

void Ogre::SkeletonSerializer::writeBone (  const Bone *    pBone )  [private]
 

void Ogre::SkeletonSerializer::writeBoneParent (  unsigned short    boneId,
unsigned short    parentId
)  [private]
 

void Ogre::Serializer::writeBools (  const bool *    pLong,
unsigned short    count
)  [protected, inherited]
 

void Ogre::Serializer::writeChunkHeader (  unsigned short    id,
unsigned long    size
)  [protected, virtual, inherited]
 

void Ogre::Serializer::writeData (  const void *    buf,
size_t    size,
size_t    count
)  [protected, inherited]
 

void Ogre::Serializer::writeFileHeader (  void    )  [protected, virtual, inherited]
 

void Ogre::SkeletonSerializer::writeKeyFrame (  const KeyFrame *    key )  [private]
 

void Ogre::Serializer::writeLongs (  const unsigned long *    pLong,
unsigned short    count
)  [protected, inherited]
 

void Ogre::Serializer::writeObject (  const Quaternion &    q )  [protected, inherited]
 

void Ogre::Serializer::writeObject (  const Vector3 &    vec )  [protected, inherited]
 

void Ogre::Serializer::writeReals (  const Real *    pReal,
unsigned short    count
)  [protected, inherited]
 

void Ogre::Serializer::writeShorts (  const unsigned short *    pShort,
unsigned short    count
)  [protected, inherited]
 

void Ogre::SkeletonSerializer::writeSkeleton (  const Skeleton *    pSkel )  [private]
 

void Ogre::Serializer::writeString (  const String &    string )  [protected, inherited]
 


Member Data Documentation

unsigned long Ogre::Serializer::mCurrentChunkLen [protected, inherited]
 

FILE* Ogre::Serializer::mpfFile [protected, inherited]
 

Skeleton* Ogre::SkeletonSerializer::mpSkeleton [private]
 

String Ogre::Serializer::mVersion [protected, inherited]
 

Copyright © 2002 by The OGRE Team