CUGL 3.0
Cornell University Game Library
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
cugl::scene3::ModelInfo Class Reference

#include <CUObjModel.h>

Public Member Functions

 ModelInfo ()
 
std::shared_ptr< GroupInfoacquireGroup ()
 
std::shared_ptr< GroupInfocurrentGroup () const
 

Public Attributes

std::string name
 
std::string path
 
std::string material
 
std::vector< cugl::Vec3positions
 
std::vector< cugl::Vec2texcoords
 
std::vector< cugl::Vec3normals
 
std::vector< std::shared_ptr< GroupInfo > > groups
 
std::unordered_map< std::string, std::shared_ptr< MaterialLib > > libraries
 

Detailed Description

This class represents the data in an OBJ file.

While a single OBJ file can potentially represeting multiple models, we consider them all to be a single model and only separate up files into rendering groups (which is all the specification really allows)

All data is stored in the same order that it is presented in the file. That makes it possible for a VertexInfo to refer to data by its index.

Constructor & Destructor Documentation

◆ ModelInfo()

cugl::scene3::ModelInfo::ModelInfo ( )
inline

Creates an unintialized ModelInfo with default values

Member Function Documentation

◆ acquireGroup()

std::shared_ptr< GroupInfo > cugl::scene3::ModelInfo::acquireGroup ( )

Returns a new GroupInfo allocated for this model.

This method is used during parsing to add new render groups.

Returns
a new GroupInfo allocated for this model.

◆ currentGroup()

std::shared_ptr< GroupInfo > cugl::scene3::ModelInfo::currentGroup ( ) const
inline

Returns the currently active GroupInfo object.

This method is used during parsing to update the current render group.

Returns
the currently active GroupInfo object.

Member Data Documentation

◆ groups

std::vector<std::shared_ptr<GroupInfo> > cugl::scene3::ModelInfo::groups

The render groups in this file

◆ libraries

std::unordered_map<std::string,std::shared_ptr<MaterialLib> > cugl::scene3::ModelInfo::libraries

The imported libraries

◆ material

std::string cugl::scene3::ModelInfo::material

The name for the current active material

◆ name

std::string cugl::scene3::ModelInfo::name

The name of the object model (e.g. the reference key)

◆ normals

std::vector<cugl::Vec3> cugl::scene3::ModelInfo::normals

The vertex normals in this file

◆ path

std::string cugl::scene3::ModelInfo::path

The path to the OBJ file

◆ positions

std::vector<cugl::Vec3> cugl::scene3::ModelInfo::positions

The vertex positions in this file

◆ texcoords

std::vector<cugl::Vec2> cugl::scene3::ModelInfo::texcoords

The texture coordinates in this file


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