V-Gears 0
Free Final Fantasy VII engine.
VGears::AFile Class Reference

Handles A files. More...

#include <VGearsAFile.h>

Inheritance diagram for VGears::AFile:
Collaboration diagram for VGears::AFile:

Classes

struct  Frame
 A frame in an animation. More...
 

Public Types

typedef std::vector< Ogre::Vector3 > BoneRotationList
 
typedef std::vector< FrameFrameList
 

Public Member Functions

 AFile (Ogre::ResourceManager *creator, const String &name, Ogre::ResourceHandle handle, const String &group, bool is_manual=false, Ogre::ManualResourceLoader *loader=NULL)
 Constructor. More...
 
virtual ~AFile ()
 Destructor. More...
 
void AddTo (Ogre::SkeletonPtr skeleton, const String &name) const
 Adds an animation to an skeleton. More...
 
FrameListGetFrames ()
 Retrieves the list of frames in the file. More...
 
void SetBoneCount (const uint32 bone_count)
 Sets the number of bones. More...
 
- Public Member Functions inherited from VGears::Resource
 Resource (Ogre::ResourceManager *creator, const String &name, Ogre::ResourceHandle handle, const String &group, bool manual, Ogre::ManualResourceLoader *loader)
 Constructor. More...
 
virtual ~Resource ()=default
 Destructor. More...
 

Static Public Attributes

static const Ogre::Real FRAME_DURATION
 Duration of a frame. More...
 
static const String RESOURCE_TYPE
 The type of resource. More...
 

Protected Member Functions

virtual void loadImpl () override final
 Loads the file. More...
 
virtual void unloadImpl () override final
 Unloads the file. More...
 
size_t CalculateSize () const
 Calculates the size of the file. More...
 
void SetFrameRotation (Ogre::TransformKeyFrame *key_frame, const Ogre::Vector3 &rotation) const
 Sets the rotation for a frame. More...
 
- Protected Member Functions inherited from VGears::Resource
virtual Ogre::DataStreamPtr openResource ()
 Opens the resource. More...
 

Private Attributes

uint32 bone_count_
 The number of bones. More...
 
FrameList frames_
 The list of frames. More...
 

Detailed Description

Handles A files.

A files are files with skeleton animation data.

Member Typedef Documentation

◆ BoneRotationList

typedef std::vector<Ogre::Vector3> VGears::AFile::BoneRotationList

◆ FrameList

typedef std::vector<Frame> VGears::AFile::FrameList

Constructor & Destructor Documentation

◆ AFile()

VGears::AFile::AFile ( Ogre::ResourceManager *  creator,
const String name,
Ogre::ResourceHandle  handle,
const String group,
bool  is_manual = false,
Ogre::ManualResourceLoader *  loader = NULL 
)

Constructor.

Parameters
[in]creatorPointer to the ResourceManager that is creating this resource.
[in]nameThe unique name of the resource.
[in]handle
Todo:
Understand and document.
Parameters
[in]groupThe name of the resource group to which this resource belong.
[in]is_manualTrue if the resource is manually loaded, false otherwise.
[in]loaderPointer to a ManualResourceLoader implementation which will be called when the Resource wishes to load (should be supplied if is_manual is set to true). It can be null, but the Resource will never be able to reload if anything ever causes it to unload. Therefore provision of a proper ManualResourceLoader instance is strongly recommended.

◆ ~AFile()

VGears::AFile::~AFile ( )
virtual

Destructor.

Member Function Documentation

◆ AddTo()

void VGears::AFile::AddTo ( Ogre::SkeletonPtr  skeleton,
const String name 
) const

Adds an animation to an skeleton.

Parameters
[in,out]skeletonSkeleton to add the animation to.
[in]nameAnimation name.

◆ CalculateSize()

size_t VGears::AFile::CalculateSize ( ) const
protected

Calculates the size of the file.

Returns
The size of the file.
Todo:
Units?

◆ GetFrames()

FrameList & VGears::AFile::GetFrames ( )
inline

Retrieves the list of frames in the file.

Returns
The list of frames.

◆ loadImpl()

void VGears::AFile::loadImpl ( )
finaloverrideprotectedvirtual

Loads the file.

◆ SetBoneCount()

void VGears::AFile::SetBoneCount ( const uint32  bone_count)

Sets the number of bones.

Parameters
[in]bone_countThe number of bones.

◆ SetFrameRotation()

void VGears::AFile::SetFrameRotation ( Ogre::TransformKeyFrame *  key_frame,
const Ogre::Vector3 &  rotation 
) const
protected

Sets the rotation for a frame.

Parameters
[in]key_frameThe frame.
[in]rotationThe rotation for the frame

◆ unloadImpl()

void VGears::AFile::unloadImpl ( )
finaloverrideprotectedvirtual

Unloads the file.

Member Data Documentation

◆ bone_count_

uint32 VGears::AFile::bone_count_
private

The number of bones.

◆ FRAME_DURATION

const Ogre::Real VGears::AFile::FRAME_DURATION
static

Duration of a frame.

◆ frames_

FrameList VGears::AFile::frames_
private

The list of frames.

◆ RESOURCE_TYPE

const String VGears::AFile::RESOURCE_TYPE
static

The type of resource.


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