18#include <OgreAxisAlignedBox.h>
19#include <OgreColourValue.h>
21#include <OgreResource.h>
38 class PFile :
public Ogre::Resource{
57 Ogre::ResourceManager* creator,
const String &name, Ogre::ResourceHandle handle,
58 const String& group,
bool is_manual =
false,
59 Ogre::ManualResourceLoader* loader =
nullptr
A manually handled object.
Definition: VGearsManualObject.h:32
Handles P files.
Definition: VGearsPFile.h:38
static Ogre::Quaternion CreateStaticRotation()
Creates a static rotation.
Definition: VGearsPFile.cpp:187
std::vector< Colour > PolygonColorList
Definition: VGearsPFile.h:259
virtual VertexList & GetVertices()
Retrieves the vertices in the file.
Definition: VGearsPFile.cpp:60
virtual NormalList & GetNormals()
Retrieves the normals in the file.
Definition: VGearsPFile.cpp:62
std::vector< Group > GroupList
Definition: VGearsPFile.h:265
std::vector< Colour > VertexColorList
Definition: VGearsPFile.h:257
virtual PolygonDefinitionList & GetPolygonDefinitions()
Retrieves the polygon definitions in the file.
Definition: VGearsPFile.cpp:76
virtual PolygonColorList & GetPolygonColors()
Retrieves the polygon colours in the file.
Definition: VGearsPFile.cpp:72
Unkown1List unknown_1_
List of unknown data.
Definition: VGearsPFile.h:414
VertexColorList vertex_colours_
The list of vertex colours.
Definition: VGearsPFile.h:424
std::vector< Ogre::Vector3 > Unkown1List
Definition: VGearsPFile.h:253
GroupList groups_
The list of groups.
Definition: VGearsPFile.h:444
virtual ~PFile()
Destructor.
Definition: VGearsPFile.cpp:37
virtual VertexColorList & GetVertexColors()
Retrieves the vertex colurs in the file.
Definition: VGearsPFile.cpp:70
static const Ogre::Quaternion STATIC_ROTATION
Static rotation.
Definition: VGearsPFile.h:392
virtual void unloadImpl() override
Unloads the file.
Definition: VGearsPFile.cpp:47
Ogre::ColourValue Colour
Definition: VGearsPFile.h:247
std::vector< Edge > EdgeList
Definition: VGearsPFile.h:261
BBoxList bounding_boxes_
The list of bounding boxes.
Definition: VGearsPFile.h:449
virtual EdgeList & GetEdges()
Retrieves the edges in the file.
Definition: VGearsPFile.cpp:74
NormalList normals_
The list of normals.
Definition: VGearsPFile.h:409
PFile(Ogre::ResourceManager *creator, const String &name, Ogre::ResourceHandle handle, const String &group, bool is_manual=false, Ogre::ManualResourceLoader *loader=nullptr)
Constructor.
Definition: VGearsPFile.cpp:31
PolygonColorList polygon_colours_
The list of polygon colours.
Definition: VGearsPFile.h:429
std::vector< Ogre::Vector3 > VertexList
Definition: VGearsPFile.h:249
TextureCoordinateList texture_coordinates_
The list of texture coordinates.
Definition: VGearsPFile.h:419
virtual TextureCoordinateList & GetTextureCoordinates()
Retrieves the texture coordinates in the file.
Definition: VGearsPFile.cpp:66
virtual Ogre::Vector3 GetPosition(const Ogre::Bone *bone) const
Retrieves the position of a bone.
Definition: VGearsPFile.cpp:142
PolygonDefinitionList polygon_definitions_
The list of polygon definitions.
Definition: VGearsPFile.h:439
virtual bool IsValid()
Indicates if the file is a valid P file.
Definition: VGearsPFile.cpp:98
virtual void loadImpl() override
Loads the file.
Definition: VGearsPFile.cpp:39
std::vector< Ogre::Vector3 > NormalList
Definition: VGearsPFile.h:251
virtual bool IsPolygonDefinitionListValid()
Indicates if the poligons definitions are valid.
Definition: VGearsPFile.cpp:100
EdgeList edges_
The list of edges.
Definition: VGearsPFile.h:434
virtual size_t calculateSize() const override
Calculates the size of the palette.
Definition: VGearsPFile.cpp:84
std::vector< BBoxEntry > BBoxList
Definition: VGearsPFile.h:267
virtual void AddGroups(Ogre::Mesh *mesh, const String &bone_name, const RSDFilePtr &rsd) const
Adds a resource group.
Definition: VGearsPFile.cpp:128
virtual BBoxList & GetBBoxes()
Retrieves the bounding boxes in the file.
Definition: VGearsPFile.cpp:82
virtual GroupList & GetGroups()
Retrieves the groups in the file.
Definition: VGearsPFile.cpp:80
virtual Unkown1List & GetUnknown1()
Retrieves unknown data from the file.
Definition: VGearsPFile.cpp:64
std::vector< Ogre::Vector2 > TextureCoordinateList
Definition: VGearsPFile.h:255
std::vector< PolygonDefinition > PolygonDefinitionList
Definition: VGearsPFile.h:263
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.
Definition: VGearsPFile.cpp:152
VertexList vertices_
The list of vertices.
Definition: VGearsPFile.h:404
static const String RESOURCE_TYPE
The type of resource.
Definition: VGearsPFile.h:272
Definition: FF7NameLookup.h:24
Ogre::SharedPtr< PFile > PFilePtr
Definition: VGearsPFile.h:452
Ogre::uint16 uint16
Definition: TypeDefine.h:32
Ogre::String String
Definition: TypeDefine.h:37
Ogre::SharedPtr< RSDFile > RSDFilePtr
Definition: VGearsRSDFile.h:198
Ogre::uint32 uint32
Definition: TypeDefine.h:33
HRCFile::Bone Bone
Definition: VGearsHRCMeshLoader.cpp:26
Ogre::uint8 uint8
Definition: TypeDefine.h:31
A bounding box entry in a P file.
Definition: VGearsPFile.h:234
uint32 unknown
Unknown data.
Definition: VGearsPFile.h:239
Ogre::AxisAlignedBox bbox
The bounding box.
Definition: VGearsPFile.h:244
An edge.
Definition: VGearsPFile.h:98
uint16 index[2]
Each of the edge vertices.
Definition: VGearsPFile.h:103
Group data in a P file.
Definition: VGearsPFile.h:156
uint32 has_texture
Indicates if the group has an assigned texture.
Definition: VGearsPFile.h:223
uint32 texture_index
Index of the assigned texture (if any).
Definition: VGearsPFile.h:228
uint32 num_polygons
The number of polygons in the group.
Definition: VGearsPFile.h:173
uint32 unknown_20
Unknown data.
Definition: VGearsPFile.h:203
uint32 nuvertices_
The number of vertices in the group.
Definition: VGearsPFile.h:183
uint32 unknown_28
Unknown data.
Definition: VGearsPFile.h:213
uint32 vertex_start_index
Definition: VGearsPFile.h:178
uint32 polygon_start_index
Definition: VGearsPFile.h:168
uint32 texture_coordinate_start_index
Definition: VGearsPFile.h:218
uint32 unknown_1C
Unknown data.
Definition: VGearsPFile.h:198
uint32 unknown_24
Unknown data.
Definition: VGearsPFile.h:208
uint32 nuedges_
The number of edges in the group.
Definition: VGearsPFile.h:193
uint32 primitive_type
The primitive type of the group.
Definition: VGearsPFile.h:163
uint32 edge_start_index
Definition: VGearsPFile.h:188
A polygon definition in the P file.
Definition: VGearsPFile.h:109
uint16 vertex[3]
Polygon vertices (3, always a triangle).
Definition: VGearsPFile.h:119
uint16 unknown_14
Unknown data.
Definition: VGearsPFile.h:134
uint16 edge[3]
The edges of the polygon (3, always a triangle).
Definition: VGearsPFile.h:129
uint16 unknown_16
Unknown data.
Definition: VGearsPFile.h:139
uint16 normal[3]
The polygon normal (three components).
Definition: VGearsPFile.h:124
uint16 unknown_00
Unknown data.
Definition: VGearsPFile.h:114