OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
Ogre::Skeleton::ChunkAnimationTrackKF Class Reference

#include <StdMeshLoaderBinaryChunks.h>

Inheritance diagram for Ogre::Skeleton::ChunkAnimationTrackKF:
[legend]
Collaboration diagram for Ogre::Skeleton::ChunkAnimationTrackKF:
[legend]

Public Member Functions

Type GetType () const
 
size_t GetSize () const
 

Static Public Member Functions

static std::unique_ptr< ChunkRead (DataStream *stream)
 
static Type Peek (const DataStream *stream)
 

Public Attributes

float time
 
StdMeshQuaternion rotation
 
StdMeshVector translation
 
StdMeshVector scale
 

Static Public Attributes

static const size_t ChunkHeaderLength
 

Protected Types

typedef ChunkID Type
 

Protected Member Functions

void ReadImpl (DataStream *stream) override
 

Protected Attributes

Type type
 
size_t size
 

Detailed Description

Definition at line 636 of file StdMeshLoaderBinaryChunks.h.

Member Typedef Documentation

typedef ChunkID Ogre::ChunkBase< ChunkID >::Type
protectedinherited

Definition at line 286 of file StdMeshLoaderBinaryChunks.h.

Member Function Documentation

size_t Ogre::ChunkBase< ChunkID >::GetSize ( ) const
inlineinherited

Definition at line 292 of file StdMeshLoaderBinaryChunks.h.

References Ogre::ChunkBase< _Type >::size.

Referenced by Ogre::Mesh::ChunkUnknown::ReadImpl(), Ogre::Mesh::ChunkMeshBoneAssignments::ReadImpl(), Ogre::Mesh::ChunkGeometryVertexData::ReadImpl(), Ogre::Skeleton::ChunkUnknown::ReadImpl(), Ogre::Skeleton::ChunkBone::ReadImpl(), and ReadImpl().

Here is the caller graph for this function:

Type Ogre::ChunkBase< ChunkID >::GetType ( ) const
inlineinherited
static Type Ogre::ChunkBase< ChunkID >::Peek ( const DataStream stream)
inlinestaticinherited

Definition at line 295 of file StdMeshLoaderBinaryChunks.h.

References Ogre::DataStream::Peek().

Referenced by StdMeshSkeletonLoader::LoadSkeletonBinary(), Ogre::Mesh::ChunkMesh::ReadImpl(), Ogre::Mesh::ChunkSubmesh::ReadImpl(), Ogre::Mesh::ChunkGeometry::ReadImpl(), Ogre::Mesh::ChunkGeometryVertexDecl::ReadImpl(), Ogre::Mesh::ChunkGeometryVertexBuffer::ReadImpl(), Ogre::Skeleton::ChunkAnimation::ReadImpl(), and Ogre::Skeleton::ChunkAnimationTrack::ReadImpl().

296  {
297  return static_cast<Type>(stream->Peek<uint16_t>());
298  }

Here is the call graph for this function:

Here is the caller graph for this function:

std::unique_ptr< Chunk > Ogre::Skeleton::Chunk::Read ( DataStream stream)
staticinherited

Definition at line 322 of file StdMeshLoaderBinaryChunks.cpp.

References Ogre::ChunkBase< ChunkID >::ChunkHeaderLength, Ogre::Skeleton::CID_Animation, Ogre::Skeleton::CID_Animation_BaseInfo, Ogre::Skeleton::CID_Animation_Link, Ogre::Skeleton::CID_Animation_Track, Ogre::Skeleton::CID_Animation_Track_KF, Ogre::Skeleton::CID_BlendMode, Ogre::Skeleton::CID_Bone, Ogre::Skeleton::CID_Bone_Parent, Ogre::Skeleton::CID_Header, Ogre::Skeleton::CID_Invalid, Ogre::DataStream::GetRemainingBytes(), LogF(), Ogre::DataStream::Read(), and Ogre::ChunkBase< ChunkID >::size.

Referenced by StdMeshSkeletonLoader::LoadSkeletonBinary(), Ogre::Skeleton::ChunkAnimation::ReadImpl(), and Ogre::Skeleton::ChunkAnimationTrack::ReadImpl().

323  {
324  assert(stream->GetRemainingBytes() >= ChunkHeaderLength);
325 
326  // Read metadata
327  ChunkID id = CID_Invalid;
328  id = static_cast<ChunkID>(stream->Read<uint16_t>());
329  size_t size = 0;
330  // Special case: CID_Header doesn't have any size info.
331  if (id != CID_Header)
332  {
333  // All others are proper chunks.
334  size = stream->Read<uint32_t>();
335  size -= ChunkHeaderLength;
336  }
337 
338  // Create chunk
339  std::unique_ptr<Chunk> chunk;
340  switch (id)
341  {
342  case CID_Header: chunk = std::make_unique<Ogre::Skeleton::ChunkFileHeader>(); break;
343  case CID_BlendMode: chunk = std::make_unique<Ogre::Skeleton::ChunkBlendMode>(); break;
344  case CID_Bone: chunk = std::make_unique<Ogre::Skeleton::ChunkBone>(); break;
345  case CID_Bone_Parent: chunk = std::make_unique<Ogre::Skeleton::ChunkBoneParent>(); break;
346  case CID_Animation: chunk = std::make_unique<Ogre::Skeleton::ChunkAnimation>(); break;
347  case CID_Animation_BaseInfo: chunk = std::make_unique<Ogre::Skeleton::ChunkAnimationBaseInfo>(); break;
348  case CID_Animation_Track: chunk = std::make_unique<Ogre::Skeleton::ChunkAnimationTrack>(); break;
349  case CID_Animation_Track_KF: chunk = std::make_unique<Ogre::Skeleton::ChunkAnimationTrackKF>(); break;
350  case CID_Animation_Link: chunk = std::make_unique<Ogre::Skeleton::ChunkAnimationLink>(); break;
351  default:
352  LogF("StdMeshLoader: I don't know what to do with a chunk of type 0x%xu", id);
353  chunk = std::make_unique<Ogre::Skeleton::ChunkUnknown>(); break;
354  };
355  chunk->type = id;
356  chunk->size = size;
357  chunk->ReadImpl(stream);
358  return chunk;
359  }
bool LogF(const char *strMessage,...)
Definition: C4Log.cpp:260

Here is the call graph for this function:

Here is the caller graph for this function:

void Ogre::Skeleton::ChunkAnimationTrackKF::ReadImpl ( DataStream stream)
overrideprotectedvirtual

Implements Ogre::ChunkBase< ChunkID >.

Definition at line 445 of file StdMeshLoaderBinaryChunks.cpp.

References Ogre::ChunkBase< ChunkID >::GetSize(), Ogre::DataStream::Read(), rotation, scale, time, translation, StdMeshVector::UnitScale(), StdMeshVector::x, StdMeshVector::y, and StdMeshVector::z.

446  {
447  time = stream->Read<float>();
448  rotation.x = stream->Read<float>();
449  rotation.y = stream->Read<float>();
450  rotation.z = stream->Read<float>();
451  rotation.w = stream->Read<float>();
452  translation.x = stream->Read<float>();
453  translation.y = stream->Read<float>();
454  translation.z = stream->Read<float>();
455  // Guess whether we have a scale element
456  if (GetSize() > sizeof(float) * 8)
457  {
458  scale.x = stream->Read<float>();
459  scale.y = stream->Read<float>();
460  scale.z = stream->Read<float>();
461  }
462  else
463  {
465  }
466  }
static StdMeshVector UnitScale()
Definition: StdMeshMath.cpp:29

Here is the call graph for this function:

Member Data Documentation

const size_t Ogre::ChunkBase< ChunkID >::ChunkHeaderLength
staticinherited
StdMeshQuaternion Ogre::Skeleton::ChunkAnimationTrackKF::rotation

Definition at line 640 of file StdMeshLoaderBinaryChunks.h.

Referenced by ReadImpl().

StdMeshVector Ogre::Skeleton::ChunkAnimationTrackKF::scale

Definition at line 642 of file StdMeshLoaderBinaryChunks.h.

Referenced by ReadImpl().

size_t Ogre::ChunkBase< ChunkID >::size
protectedinherited
float Ogre::Skeleton::ChunkAnimationTrackKF::time

Definition at line 639 of file StdMeshLoaderBinaryChunks.h.

Referenced by ReadImpl().

StdMeshVector Ogre::Skeleton::ChunkAnimationTrackKF::translation

Definition at line 641 of file StdMeshLoaderBinaryChunks.h.

Referenced by ReadImpl().

Type Ogre::ChunkBase< ChunkID >::type
protectedinherited

Definition at line 287 of file StdMeshLoaderBinaryChunks.h.


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