tec::OBJ
#include <obj.hpp>
Inherits from tec::MeshFile
Public Classes
Name | |
---|---|
struct | Face |
struct | MTL |
struct | OBJGroup |
Public Functions
Name | |
---|---|
std::shared_ptr< OBJ > | Create(const Path & fname) Returns a resource with the specified name. |
bool | Parse() Loads the OBJ file from disk and parses it. |
bool | ParseMTL(const Path & fname) Loads the MTL file from disk and parses it. |
void | PopulateMeshGroups() Calculates the final vertex positions based on the bind-pose skeleton. |
void | SetFileName(const Path & fname) Sets the mesh filename. |
Additional inherited members
Public Functions inherited from tec::MeshFile
Name | |
---|---|
virtual | ~MeshFile() |
Mesh * | CreateMesh() Creates a new mesh and adds it to this file. |
void | AddMesh(Mesh * mesh) Adds a mesh to this file. Ownership is transferred. |
Mesh * | GetMesh(const std::size_t index) Returns a specific mesh. |
std::size_t | GetMeshCount() const Returns the number of meshes in this file. |
const std::string | GetName() const |
void | SetName(const std::string & _name) |
bool | IsDirty() const |
void | Invalidate() Mark dirty. |
void | Validate() Mark not dirty. |
Protected Attributes inherited from tec::MeshFile
Name | |
---|---|
std::vector< Mesh * > | meshes |
std::string | name |
bool | dirty |
Public Functions Documentation
function Create
static std::shared_ptr< OBJ > Create(
const Path & fname
)
Returns a resource with the specified name.
Parameters:
Return: std::shared_ptr
The only used initialization property is "filename".
function Parse
bool Parse()
Loads the OBJ file from disk and parses it.
Return: bool If the mesh was valid and loaded correctly.
function ParseMTL
bool ParseMTL(
const Path & fname
)
Loads the MTL file from disk and parses it.
Return: bool If the material was valid and loaded correctly.
function PopulateMeshGroups
void PopulateMeshGroups()
Calculates the final vertex positions based on the bind-pose skeleton.
Return: void
There isn't a return as the processing will just do nothing if the parse data was default objects.
function SetFileName
inline void SetFileName(
const Path & fname
)
Sets the mesh filename.
Parameters:
- const std::string& fname The mesh filename.
Return: bool True if initialization finished with no errors.
This is just a shorthand function that can be called directly via script API.
Updated on 2022-07-24 at 19:27:35 +0000