![]() |
V-Gears 0
Free Final Fantasy VII engine.
|
Handles P files. More...
#include <VGearsPFile.h>
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< Colour > | VertexColorList |
typedef std::vector< Colour > | PolygonColorList |
typedef std::vector< Edge > | EdgeList |
typedef std::vector< PolygonDefinition > | PolygonDefinitionList |
typedef std::vector< Group > | GroupList |
typedef std::vector< BBoxEntry > | BBoxList |
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 VertexList & | GetVertices () |
Retrieves the vertices in the file. More... | |
virtual NormalList & | GetNormals () |
Retrieves the normals in the file. More... | |
virtual Unkown1List & | GetUnknown1 () |
Retrieves unknown data from the file. More... | |
virtual TextureCoordinateList & | GetTextureCoordinates () |
Retrieves the texture coordinates in the file. More... | |
virtual VertexColorList & | GetVertexColors () |
Retrieves the vertex colurs in the file. More... | |
virtual PolygonColorList & | GetPolygonColors () |
Retrieves the polygon colours in the file. More... | |
virtual EdgeList & | GetEdges () |
Retrieves the edges in the file. More... | |
virtual PolygonDefinitionList & | GetPolygonDefinitions () |
Retrieves the polygon definitions in the file. More... | |
virtual GroupList & | GetGroups () |
Retrieves the groups in the file. More... | |
virtual BBoxList & | GetBBoxes () |
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... | |
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.
typedef std::vector<BBoxEntry> VGears::PFile::BBoxList |
typedef Ogre::ColourValue VGears::PFile::Colour |
typedef std::vector<Edge> VGears::PFile::EdgeList |
typedef std::vector<Group> VGears::PFile::GroupList |
typedef std::vector<Ogre::Vector3> VGears::PFile::NormalList |
typedef std::vector<Colour> VGears::PFile::PolygonColorList |
typedef std::vector<PolygonDefinition> VGears::PFile::PolygonDefinitionList |
typedef std::vector<Ogre::Vector2> VGears::PFile::TextureCoordinateList |
typedef std::vector<Ogre::Vector3> VGears::PFile::Unkown1List |
typedef std::vector<Colour> VGears::PFile::VertexColorList |
typedef std::vector<Ogre::Vector3> VGears::PFile::VertexList |
VGears::PFile::PFile | ( | Ogre::ResourceManager * | creator, |
const String & | name, | ||
Ogre::ResourceHandle | handle, | ||
const String & | group, | ||
bool | is_manual = false , |
||
Ogre::ManualResourceLoader * | loader = nullptr |
||
) |
Constructor.
[in] | creator | Pointer to the ResourceManager that is creating this resource. |
[in] | name | The unique name of the resource. |
[in] | handle |
[in] | group | The name of the resource group to which this resource belong. |
[in] | is_manual | True if the resource is manually loaded, false otherwise. |
[in] | loader | Pointer 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. |
|
virtual |
Destructor.
|
protectedvirtual |
Add a group to the file.
A resource group includes a bone, a mesh and a graphical resource.
[in] | group | The group to add to the file. |
[in,out] | mo | The object to add to the group. |
[in] | sub_name | Name for mo. |
[in] | material_base_name | Name of the material for mo. |
[in] | bone | The bone to assign to bo. |
|
virtual |
Adds a resource group.
A resource group includes a bone, a mesh and a graphical resource.
[in] | mesh | The mesh to add to the group. |
[in] | bone_name | The bone in the skeleton to which to add the group. The bone must be in a skeleton assigned to MESH. |
[in] | rsd | File with the resource to add to the group. |
|
overrideprotectedvirtual |
|
staticprotected |
Creates a static rotation.
|
virtual |
Retrieves the bounding boxes in the file.
|
virtual |
Retrieves the edges in the file.
|
virtual |
Retrieves the groups in the file.
A group includes a bone, a mesh and a graphical resource.
|
virtual |
Retrieves the normals in the file.
|
virtual |
Retrieves the polygon colours in the file.
|
virtual |
Retrieves the polygon definitions in the file.
|
protectedvirtual |
Retrieves the position of a bone.
[in] | bone | The bone. |
|
virtual |
Retrieves the texture coordinates in the file.
|
virtual |
Retrieves unknown data from the file.
|
virtual |
Retrieves the vertex colurs in the file.
|
virtual |
Retrieves the vertices in the file.
|
virtual |
Indicates if the poligons definitions are valid.
|
virtual |
Indicates if the file is a valid P file.
|
overrideprotectedvirtual |
Loads the file.
|
overrideprotectedvirtual |
Unloads the file.
|
private |
The list of bounding boxes.
|
private |
The list of edges.
|
private |
The list of groups.
|
private |
The list of normals.
|
private |
The list of polygon colours.
|
private |
The list of polygon definitions.
|
static |
The type of resource.
|
staticprotected |
Static rotation.
|
private |
The list of texture coordinates.
|
private |
List of unknown data.
|
private |
The list of vertex colours.
|
private |
The list of vertices.