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

Handles P files. More...

#include <VGearsPFile.h>

Inheritance diagram for VGears::PFile:
Collaboration diagram for VGears::PFile:

Classes

struct  BBoxEntry
 A bounding box entry in a P file. More...
 
struct  Edge
 An edge. More...
 
struct  Group
 Group data in a P file. More...
 
struct  MaterialInformation
 Material information in a P file. More...
 
struct  PolygonDefinition
 A polygon definition in the P file. More...
 

Public Types

typedef Ogre::ColourValue Colour
 
typedef std::vector< Ogre::Vector3 > VertexList
 
typedef std::vector< Ogre::Vector3 > NormalList
 
typedef std::vector< Ogre::Vector3 > Unkown1List
 
typedef std::vector< Ogre::Vector2 > TextureCoordinateList
 
typedef std::vector< ColourVertexColorList
 
typedef std::vector< ColourPolygonColorList
 
typedef std::vector< EdgeEdgeList
 
typedef std::vector< PolygonDefinitionPolygonDefinitionList
 
typedef std::vector< GroupGroupList
 
typedef std::vector< BBoxEntryBBoxList
 

Public Member Functions

 PFile (Ogre::ResourceManager *creator, const String &name, Ogre::ResourceHandle handle, const String &group, bool is_manual=false, Ogre::ManualResourceLoader *loader=nullptr)
 Constructor. More...
 
virtual ~PFile ()
 Destructor. More...
 
virtual bool IsValid ()
 Indicates if the file is a valid P file. More...
 
virtual bool IsPolygonDefinitionListValid ()
 Indicates if the poligons definitions are valid. More...
 
virtual void AddGroups (Ogre::Mesh *mesh, const String &bone_name, const RSDFilePtr &rsd) const
 Adds a resource group. More...
 
virtual VertexListGetVertices ()
 Retrieves the vertices in the file. More...
 
virtual NormalListGetNormals ()
 Retrieves the normals in the file. More...
 
virtual Unkown1ListGetUnknown1 ()
 Retrieves unknown data from the file. More...
 
virtual TextureCoordinateListGetTextureCoordinates ()
 Retrieves the texture coordinates in the file. More...
 
virtual VertexColorListGetVertexColors ()
 Retrieves the vertex colurs in the file. More...
 
virtual PolygonColorListGetPolygonColors ()
 Retrieves the polygon colours in the file. More...
 
virtual EdgeListGetEdges ()
 Retrieves the edges in the file. More...
 
virtual PolygonDefinitionListGetPolygonDefinitions ()
 Retrieves the polygon definitions in the file. More...
 
virtual GroupListGetGroups ()
 Retrieves the groups in the file. More...
 
virtual BBoxListGetBBoxes ()
 Retrieves the bounding boxes in the file. More...
 

Static Public Attributes

static const String RESOURCE_TYPE
 The type of resource. More...
 

Protected Member Functions

virtual void loadImpl () override
 Loads the file. More...
 
virtual void unloadImpl () override
 Unloads the file. More...
 
virtual size_t calculateSize () const override
 Calculates the size of the palette. More...
 
virtual void AddGroup (const Group &group, ManualObject &mo, const String &sub_name, const String &material_base_name, const Ogre::Bone *bone) const
 Add a group to the file. More...
 
virtual Ogre::Vector3 GetPosition (const Ogre::Bone *bone) const
 Retrieves the position of a bone. More...
 

Static Protected Member Functions

static Ogre::Quaternion CreateStaticRotation ()
 Creates a static rotation. More...
 

Static Protected Attributes

static const Ogre::Quaternion STATIC_ROTATION
 Static rotation. More...
 

Private Attributes

VertexList vertices_
 The list of vertices. More...
 
NormalList normals_
 The list of normals. More...
 
Unkown1List unknown_1_
 List of unknown data. More...
 
TextureCoordinateList texture_coordinates_
 The list of texture coordinates. More...
 
VertexColorList vertex_colours_
 The list of vertex colours. More...
 
PolygonColorList polygon_colours_
 The list of polygon colours. More...
 
EdgeList edges_
 The list of edges. More...
 
PolygonDefinitionList polygon_definitions_
 The list of polygon definitions. More...
 
GroupList groups_
 The list of groups. More...
 
BBoxList bounding_boxes_
 The list of bounding boxes. More...
 

Detailed Description

Handles P files.

P files are binary files containing data which form 3D model. The files specify model's vertices, polygons, colors, texture coordinates and model sub-groups. The files do not specify references to the texture files, animations, model skeleton or anything else. P-files are used as parts of field models, battle models, battle locations on PC version of FF7.

Member Typedef Documentation

◆ BBoxList

typedef std::vector<BBoxEntry> VGears::PFile::BBoxList

◆ Colour

typedef Ogre::ColourValue VGears::PFile::Colour

◆ EdgeList

typedef std::vector<Edge> VGears::PFile::EdgeList

◆ GroupList

typedef std::vector<Group> VGears::PFile::GroupList

◆ NormalList

typedef std::vector<Ogre::Vector3> VGears::PFile::NormalList

◆ PolygonColorList

◆ PolygonDefinitionList

◆ TextureCoordinateList

typedef std::vector<Ogre::Vector2> VGears::PFile::TextureCoordinateList

◆ Unkown1List

typedef std::vector<Ogre::Vector3> VGears::PFile::Unkown1List

◆ VertexColorList

typedef std::vector<Colour> VGears::PFile::VertexColorList

◆ VertexList

typedef std::vector<Ogre::Vector3> VGears::PFile::VertexList

Constructor & Destructor Documentation

◆ PFile()

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

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.

◆ ~PFile()

VGears::PFile::~PFile ( )
virtual

Destructor.

Member Function Documentation

◆ AddGroup()

void VGears::PFile::AddGroup ( const Group group,
ManualObject mo,
const String sub_name,
const String material_base_name,
const Ogre::Bone *  bone 
) const
protectedvirtual

Add a group to the file.

A resource group includes a bone, a mesh and a graphical resource.

Parameters
[in]groupThe group to add to the file.
[in,out]moThe object to add to the group.
[in]sub_nameName for mo.
[in]material_base_nameName of the material for mo.
[in]boneThe bone to assign to bo.

◆ AddGroups()

void VGears::PFile::AddGroups ( Ogre::Mesh *  mesh,
const String bone_name,
const RSDFilePtr rsd 
) const
virtual

Adds a resource group.

A resource group includes a bone, a mesh and a graphical resource.

Parameters
[in]meshThe mesh to add to the group.
[in]bone_nameThe bone in the skeleton to which to add the group. The bone must be in a skeleton assigned to MESH.
[in]rsdFile with the resource to add to the group.

◆ calculateSize()

size_t VGears::PFile::calculateSize ( void  ) const
overrideprotectedvirtual

Calculates the size of the palette.

Returns
The size of the palette.
Todo:
Units?

◆ CreateStaticRotation()

Ogre::Quaternion VGears::PFile::CreateStaticRotation ( )
staticprotected

Creates a static rotation.

◆ GetBBoxes()

PFile::BBoxList & VGears::PFile::GetBBoxes ( )
virtual

Retrieves the bounding boxes in the file.

Returns
The vertices in the file.

◆ GetEdges()

PFile::EdgeList & VGears::PFile::GetEdges ( )
virtual

Retrieves the edges in the file.

Returns
The edgesvertices in the file.

◆ GetGroups()

PFile::GroupList & VGears::PFile::GetGroups ( )
virtual

Retrieves the groups in the file.

A group includes a bone, a mesh and a graphical resource.

Returns
The groups in the file.

◆ GetNormals()

PFile::NormalList & VGears::PFile::GetNormals ( )
virtual

Retrieves the normals in the file.

Returns
The normals in the file.

◆ GetPolygonColors()

PFile::PolygonColorList & VGears::PFile::GetPolygonColors ( )
virtual

Retrieves the polygon colours in the file.

Returns
The polygon colours in the file.

◆ GetPolygonDefinitions()

PFile::PolygonDefinitionList & VGears::PFile::GetPolygonDefinitions ( )
virtual

Retrieves the polygon definitions in the file.

Returns
The polygon definitions in the file.

◆ GetPosition()

Ogre::Vector3 VGears::PFile::GetPosition ( const Ogre::Bone *  bone) const
protectedvirtual

Retrieves the position of a bone.

Parameters
[in]boneThe bone.
Returns
The position of the bone.

◆ GetTextureCoordinates()

PFile::TextureCoordinateList & VGears::PFile::GetTextureCoordinates ( )
virtual

Retrieves the texture coordinates in the file.

Returns
The texture coordinates in the file.

◆ GetUnknown1()

PFile::Unkown1List & VGears::PFile::GetUnknown1 ( )
virtual

Retrieves unknown data from the file.

Returns
Unknown data.

◆ GetVertexColors()

PFile::VertexColorList & VGears::PFile::GetVertexColors ( )
virtual

Retrieves the vertex colurs in the file.

Returns
The vertex colurs in the file.

◆ GetVertices()

PFile::VertexList & VGears::PFile::GetVertices ( )
virtual

Retrieves the vertices in the file.

Returns
The vertices in the file.

◆ IsPolygonDefinitionListValid()

bool VGears::PFile::IsPolygonDefinitionListValid ( )
virtual

Indicates if the poligons definitions are valid.

Returns
True if all the poligon definitions are valid, false otherwise.

◆ IsValid()

bool VGears::PFile::IsValid ( )
virtual

Indicates if the file is a valid P file.

Returns
True if the file is a valid P file, false otherwise.

◆ loadImpl()

void VGears::PFile::loadImpl ( void  )
overrideprotectedvirtual

Loads the file.

◆ unloadImpl()

void VGears::PFile::unloadImpl ( void  )
overrideprotectedvirtual

Unloads the file.

Member Data Documentation

◆ bounding_boxes_

BBoxList VGears::PFile::bounding_boxes_
private

The list of bounding boxes.

◆ edges_

EdgeList VGears::PFile::edges_
private

The list of edges.

◆ groups_

GroupList VGears::PFile::groups_
private

The list of groups.

◆ normals_

NormalList VGears::PFile::normals_
private

The list of normals.

◆ polygon_colours_

PolygonColorList VGears::PFile::polygon_colours_
private

The list of polygon colours.

◆ polygon_definitions_

PolygonDefinitionList VGears::PFile::polygon_definitions_
private

The list of polygon definitions.

◆ RESOURCE_TYPE

const String VGears::PFile::RESOURCE_TYPE
static

The type of resource.

◆ STATIC_ROTATION

const Ogre::Quaternion VGears::PFile::STATIC_ROTATION
staticprotected

Static rotation.

◆ texture_coordinates_

TextureCoordinateList VGears::PFile::texture_coordinates_
private

The list of texture coordinates.

◆ unknown_1_

Unkown1List VGears::PFile::unknown_1_
private

List of unknown data.

◆ vertex_colours_

VertexColorList VGears::PFile::vertex_colours_
private

The list of vertex colours.

◆ vertices_

VertexList VGears::PFile::vertices_
private

The list of vertices.


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