OGRE  1.9.0
Ogre::SkeletonSerializer Class Reference

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

#include <OgreSkeletonSerializer.h>

Inheritance diagram for Ogre::SkeletonSerializer:

Public Types

enum  Endian { ENDIAN_NATIVE , ENDIAN_BIG , ENDIAN_LITTLE }
 The endianness of written files. More...
 

Public Member Functions

 SkeletonSerializer ()
 
virtual ~SkeletonSerializer ()
 
void exportSkeleton (const Skeleton *pSkeleton, const String &filename, SkeletonVersion ver=SKELETON_VERSION_LATEST, Endian endianMode=ENDIAN_NATIVE)
 Exports a skeleton to the file specified.
 
void exportSkeleton (const Skeleton *pSkeleton, DataStreamPtr stream, SkeletonVersion ver=SKELETON_VERSION_LATEST, Endian endianMode=ENDIAN_NATIVE)
 Exports a skeleton to the stream specified.
 
void importSkeleton (DataStreamPtr &stream, Skeleton *pDest)
 Imports Skeleton and animation data from a .skeleton file DataStream.
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete (void *ptr, void *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info
 
void * operator new (size_t sz, void *ptr)
 placement operator new
 
void * operator new[] (size_t sz)
 
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info
 

Protected Member Functions

size_t calcAnimationSize (const Skeleton *pSkel, const Animation *pAnim)
 
size_t calcAnimationTrackSize (const Skeleton *pSkel, const NodeAnimationTrack *pTrack)
 
size_t calcBoneParentSize (const Skeleton *pSkel)
 
size_t calcBoneSize (const Skeleton *pSkel, const Bone *pBone)
 
size_t calcBoneSizeWithoutScale (const Skeleton *pSkel, const Bone *pBone)
 
size_t calcKeyFrameSize (const Skeleton *pSkel, const TransformKeyFrame *pKey)
 
size_t calcKeyFrameSizeWithoutScale (const Skeleton *pSkel, const TransformKeyFrame *pKey)
 
size_t calcSkeletonAnimationLinkSize (const Skeleton *pSkel, const LinkedSkeletonAnimationSource &link)
 
virtual void determineEndianness (DataStreamPtr &stream)
 Determine the endianness of the incoming stream compared to native.
 
virtual void determineEndianness (Endian requestedEndian)
 Determine the endianness to write with based on option.
 
virtual void flipFromLittleEndian (void *pData, size_t size, size_t count=1)
 
virtual void flipToLittleEndian (void *pData, size_t size, size_t count=1)
 
void readAnimation (DataStreamPtr &stream, Skeleton *pSkel)
 
void readAnimationTrack (DataStreamPtr &stream, Animation *anim, Skeleton *pSkel)
 
void readBone (DataStreamPtr &stream, Skeleton *pSkel)
 
void readBoneParent (DataStreamPtr &stream, Skeleton *pSkel)
 
void readBools (DataStreamPtr &stream, bool *pDest, size_t count)
 
virtual unsigned short readChunk (DataStreamPtr &stream)
 
void readFileHeader (DataStreamPtr &stream)
 
void readFloats (DataStreamPtr &stream, double *pDest, size_t count)
 
void readFloats (DataStreamPtr &stream, float *pDest, size_t count)
 
void readInts (DataStreamPtr &stream, uint32 *pDest, size_t count)
 
void readKeyFrame (DataStreamPtr &stream, NodeAnimationTrack *track, Skeleton *pSkel)
 
void readObject (DataStreamPtr &stream, Quaternion &pDest)
 
void readObject (DataStreamPtr &stream, Vector3 &pDest)
 
void readShorts (DataStreamPtr &stream, uint16 *pDest, size_t count)
 
void readSkeletonAnimationLink (DataStreamPtr &stream, Skeleton *pSkel)
 
String readString (DataStreamPtr &stream)
 
String readString (DataStreamPtr &stream, size_t numChars)
 
void setWorkingVersion (SkeletonVersion ver)
 
void writeAnimation (const Skeleton *pSkel, const Animation *anim, SkeletonVersion ver)
 
void writeAnimationTrack (const Skeleton *pSkel, const NodeAnimationTrack *track)
 
void writeBone (const Skeleton *pSkel, const Bone *pBone)
 
void writeBoneParent (const Skeleton *pSkel, unsigned short boneId, unsigned short parentId)
 
void writeBools (const bool *const pLong, size_t count)
 
virtual void writeChunkHeader (uint16 id, size_t size)
 
void writeData (const void *const buf, size_t size, size_t count)
 
virtual void writeFileHeader (void)
 Default to native endian, derive from header.
 
void writeFloats (const double *const pfloat, size_t count)
 
void writeFloats (const float *const pfloat, size_t count)
 
void writeInts (const uint32 *const pInt, size_t count)
 
void writeKeyFrame (const Skeleton *pSkel, const TransformKeyFrame *key)
 
void writeObject (const Quaternion &q)
 
void writeObject (const Vector3 &vec)
 
void writeShorts (const uint16 *const pShort, size_t count)
 
void writeSkeleton (const Skeleton *pSkel, SkeletonVersion ver)
 
void writeSkeletonAnimationLink (const Skeleton *pSkel, const LinkedSkeletonAnimationSource &link)
 
void writeString (const String &string)
 

Protected Attributes

uint32 mCurrentstreamLen
 
bool mFlipEndian
 
DataStreamPtr mStream
 
String mVersion
 

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 instantiated 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

Definition at line 68 of file OgreSkeletonSerializer.h.

Member Enumeration Documentation

◆ Endian

enum Ogre::Serializer::Endian
inherited

The endianness of written files.

Enumerator
ENDIAN_NATIVE 

Use the platform native endian.

ENDIAN_BIG 

Use big endian (0x1000 is serialised as 0x10 0x00)

ENDIAN_LITTLE 

Use little endian (0x1000 is serialised as 0x00 0x10)

Definition at line 57 of file OgreSerializer.h.

Constructor & Destructor Documentation

◆ SkeletonSerializer()

Ogre::SkeletonSerializer::SkeletonSerializer ( )

◆ ~SkeletonSerializer()

virtual Ogre::SkeletonSerializer::~SkeletonSerializer ( )
virtual

Member Function Documentation

◆ calcAnimationSize()

size_t Ogre::SkeletonSerializer::calcAnimationSize ( const Skeleton * pSkel,
const Animation * pAnim )
protected

◆ calcAnimationTrackSize()

size_t Ogre::SkeletonSerializer::calcAnimationTrackSize ( const Skeleton * pSkel,
const NodeAnimationTrack * pTrack )
protected

◆ calcBoneParentSize()

size_t Ogre::SkeletonSerializer::calcBoneParentSize ( const Skeleton * pSkel)
protected

◆ calcBoneSize()

size_t Ogre::SkeletonSerializer::calcBoneSize ( const Skeleton * pSkel,
const Bone * pBone )
protected

◆ calcBoneSizeWithoutScale()

size_t Ogre::SkeletonSerializer::calcBoneSizeWithoutScale ( const Skeleton * pSkel,
const Bone * pBone )
protected

◆ calcKeyFrameSize()

size_t Ogre::SkeletonSerializer::calcKeyFrameSize ( const Skeleton * pSkel,
const TransformKeyFrame * pKey )
protected

◆ calcKeyFrameSizeWithoutScale()

size_t Ogre::SkeletonSerializer::calcKeyFrameSizeWithoutScale ( const Skeleton * pSkel,
const TransformKeyFrame * pKey )
protected

◆ calcSkeletonAnimationLinkSize()

size_t Ogre::SkeletonSerializer::calcSkeletonAnimationLinkSize ( const Skeleton * pSkel,
const LinkedSkeletonAnimationSource & link )
protected

◆ determineEndianness() [1/2]

virtual void Ogre::Serializer::determineEndianness ( DataStreamPtr & stream)
protectedvirtualinherited

Determine the endianness of the incoming stream compared to native.

◆ determineEndianness() [2/2]

virtual void Ogre::Serializer::determineEndianness ( Endian requestedEndian)
protectedvirtualinherited

Determine the endianness to write with based on option.

◆ exportSkeleton() [1/2]

void Ogre::SkeletonSerializer::exportSkeleton ( const Skeleton * pSkeleton,
const String & filename,
SkeletonVersion ver = SKELETON_VERSION_LATEST,
Endian endianMode = ENDIAN_NATIVE )

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
pSkeletonWeak reference to the Skeleton to export
filenameThe destination filename
endianModeThe endian mode to write in

◆ exportSkeleton() [2/2]

void Ogre::SkeletonSerializer::exportSkeleton ( const Skeleton * pSkeleton,
DataStreamPtr stream,
SkeletonVersion ver = SKELETON_VERSION_LATEST,
Endian endianMode = ENDIAN_NATIVE )

Exports a skeleton to the stream specified.

Remarks
This method takes an externally created Skeleton object, and exports both it and animations it uses to a .skeleton file.
Parameters
pSkeletonWeak reference to the Skeleton to export
streamThe destination stream
endianModeThe endian mode to write in

◆ flipFromLittleEndian()

virtual void Ogre::Serializer::flipFromLittleEndian ( void * pData,
size_t size,
size_t count = 1 )
protectedvirtualinherited

◆ flipToLittleEndian()

virtual void Ogre::Serializer::flipToLittleEndian ( void * pData,
size_t size,
size_t count = 1 )
protectedvirtualinherited

◆ importSkeleton()

void Ogre::SkeletonSerializer::importSkeleton ( DataStreamPtr & stream,
Skeleton * pDest )

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

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

◆ operator delete() [1/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void * ptr)
inherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

◆ operator delete() [2/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void * ptr,
const char * ,
int ,
const char *  )
inherited

Definition at line 108 of file OgreMemoryAllocatedObject.h.

◆ operator delete() [3/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void * ptr,
void *  )
inherited

Definition at line 102 of file OgreMemoryAllocatedObject.h.

◆ operator delete[]() [1/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void * ptr)
inherited

Definition at line 113 of file OgreMemoryAllocatedObject.h.

◆ operator delete[]() [2/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void * ptr,
const char * ,
int ,
const char *  )
inherited

Definition at line 119 of file OgreMemoryAllocatedObject.h.

◆ operator new() [1/3]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new ( size_t sz)
inherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

◆ operator new() [2/3]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new ( size_t sz,
const char * file,
int line,
const char * func )
inherited

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

◆ operator new() [3/3]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new ( size_t sz,
void * ptr )
inherited

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

◆ operator new[]() [1/2]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new[] ( size_t sz)
inherited

Definition at line 91 of file OgreMemoryAllocatedObject.h.

◆ operator new[]() [2/2]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new[] ( size_t sz,
const char * file,
int line,
const char * func )
inherited

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

◆ readAnimation()

void Ogre::SkeletonSerializer::readAnimation ( DataStreamPtr & stream,
Skeleton * pSkel )
protected

◆ readAnimationTrack()

void Ogre::SkeletonSerializer::readAnimationTrack ( DataStreamPtr & stream,
Animation * anim,
Skeleton * pSkel )
protected

◆ readBone()

void Ogre::SkeletonSerializer::readBone ( DataStreamPtr & stream,
Skeleton * pSkel )
protected

◆ readBoneParent()

void Ogre::SkeletonSerializer::readBoneParent ( DataStreamPtr & stream,
Skeleton * pSkel )
protected

◆ readBools()

void Ogre::Serializer::readBools ( DataStreamPtr & stream,
bool * pDest,
size_t count )
protectedinherited

◆ readChunk()

virtual unsigned short Ogre::Serializer::readChunk ( DataStreamPtr & stream)
protectedvirtualinherited

◆ readFileHeader()

void Ogre::SkeletonSerializer::readFileHeader ( DataStreamPtr & stream)
protectedvirtual

Reimplemented from Ogre::Serializer.

◆ readFloats() [1/2]

void Ogre::Serializer::readFloats ( DataStreamPtr & stream,
double * pDest,
size_t count )
protectedinherited

◆ readFloats() [2/2]

void Ogre::Serializer::readFloats ( DataStreamPtr & stream,
float * pDest,
size_t count )
protectedinherited

◆ readInts()

void Ogre::Serializer::readInts ( DataStreamPtr & stream,
uint32 * pDest,
size_t count )
protectedinherited

◆ readKeyFrame()

void Ogre::SkeletonSerializer::readKeyFrame ( DataStreamPtr & stream,
NodeAnimationTrack * track,
Skeleton * pSkel )
protected

◆ readObject() [1/2]

void Ogre::Serializer::readObject ( DataStreamPtr & stream,
Quaternion & pDest )
protectedinherited

◆ readObject() [2/2]

void Ogre::Serializer::readObject ( DataStreamPtr & stream,
Vector3 & pDest )
protectedinherited

◆ readShorts()

void Ogre::Serializer::readShorts ( DataStreamPtr & stream,
uint16 * pDest,
size_t count )
protectedinherited

◆ readSkeletonAnimationLink()

void Ogre::SkeletonSerializer::readSkeletonAnimationLink ( DataStreamPtr & stream,
Skeleton * pSkel )
protected

◆ readString() [1/2]

String Ogre::Serializer::readString ( DataStreamPtr & stream)
protectedinherited

◆ readString() [2/2]

String Ogre::Serializer::readString ( DataStreamPtr & stream,
size_t numChars )
protectedinherited

◆ setWorkingVersion()

void Ogre::SkeletonSerializer::setWorkingVersion ( SkeletonVersion ver)
protected

◆ writeAnimation()

void Ogre::SkeletonSerializer::writeAnimation ( const Skeleton * pSkel,
const Animation * anim,
SkeletonVersion ver )
protected

◆ writeAnimationTrack()

void Ogre::SkeletonSerializer::writeAnimationTrack ( const Skeleton * pSkel,
const NodeAnimationTrack * track )
protected

◆ writeBone()

void Ogre::SkeletonSerializer::writeBone ( const Skeleton * pSkel,
const Bone * pBone )
protected

◆ writeBoneParent()

void Ogre::SkeletonSerializer::writeBoneParent ( const Skeleton * pSkel,
unsigned short boneId,
unsigned short parentId )
protected

◆ writeBools()

void Ogre::Serializer::writeBools ( const bool *const pLong,
size_t count )
protectedinherited

◆ writeChunkHeader()

virtual void Ogre::Serializer::writeChunkHeader ( uint16 id,
size_t size )
protectedvirtualinherited

◆ writeData()

void Ogre::Serializer::writeData ( const void *const buf,
size_t size,
size_t count )
protectedinherited

◆ writeFileHeader()

virtual void Ogre::Serializer::writeFileHeader ( void )
protectedvirtualinherited

Default to native endian, derive from header.

◆ writeFloats() [1/2]

void Ogre::Serializer::writeFloats ( const double *const pfloat,
size_t count )
protectedinherited

◆ writeFloats() [2/2]

void Ogre::Serializer::writeFloats ( const float *const pfloat,
size_t count )
protectedinherited

◆ writeInts()

void Ogre::Serializer::writeInts ( const uint32 *const pInt,
size_t count )
protectedinherited

◆ writeKeyFrame()

void Ogre::SkeletonSerializer::writeKeyFrame ( const Skeleton * pSkel,
const TransformKeyFrame * key )
protected

◆ writeObject() [1/2]

void Ogre::Serializer::writeObject ( const Quaternion & q)
protectedinherited

◆ writeObject() [2/2]

void Ogre::Serializer::writeObject ( const Vector3 & vec)
protectedinherited

◆ writeShorts()

void Ogre::Serializer::writeShorts ( const uint16 *const pShort,
size_t count )
protectedinherited

◆ writeSkeleton()

void Ogre::SkeletonSerializer::writeSkeleton ( const Skeleton * pSkel,
SkeletonVersion ver )
protected

◆ writeSkeletonAnimationLink()

void Ogre::SkeletonSerializer::writeSkeletonAnimationLink ( const Skeleton * pSkel,
const LinkedSkeletonAnimationSource & link )
protected

◆ writeString()

void Ogre::Serializer::writeString ( const String & string)
protectedinherited

Member Data Documentation

◆ mCurrentstreamLen

uint32 Ogre::Serializer::mCurrentstreamLen
protectedinherited

Definition at line 70 of file OgreSerializer.h.

◆ mFlipEndian

bool Ogre::Serializer::mFlipEndian
protectedinherited

Definition at line 73 of file OgreSerializer.h.

◆ mStream

DataStreamPtr Ogre::Serializer::mStream
protectedinherited

Definition at line 71 of file OgreSerializer.h.

◆ mVersion

String Ogre::Serializer::mVersion
protectedinherited

Definition at line 72 of file OgreSerializer.h.


The documentation for this class was generated from the following file: