63 Model (std::string filename);
75 int NumGroups ()
const {
return this->_groups.size(); }
79 std::vector<OBJ::Group>::const_iterator
beginGroups ()
const {
return this->_groups.begin(); }
81 std::vector<OBJ::Group>::const_iterator
endGroups ()
const {
return this->_groups.end(); }
85 std::string _mtlLibName;
88 std::vector<OBJ::Material> _materials;
89 std::vector<OBJ::Group> _groups;
92 bool readMaterial (std::string m);
uint32_t nIndices
the number of indices (3 * number of triangles)
Definition: obj.hxx:49
just use color component
Definition: obj.hxx:25
std::vector< OBJ::Group >::const_iterator beginGroups() const
iterator for looping over the groups in the module
Definition: obj.hxx:79
const OBJ::Material & Material(int i) const
get a material
Definition: obj.hxx:72
int material
index to material for group (-1 for no material)
Definition: obj.hxx:47
std::string normalMap
optional normal map for bump mapping
Definition: obj.hxx:41
int NumMaterials() const
the number of materials associated with this model
Definition: obj.hxx:70
cs237::vec2f * txtCoords
array of nVerts texture coordinates (or nullptr)
Definition: obj.hxx:52
std::string specularMap
optional texture map for specular highlights
Definition: obj.hxx:40
float shininess
specular exponent
Definition: obj.hxx:37
const OBJ::Group & Group(int i) const
get a group by index
Definition: obj.hxx:77
uint32_t nVerts
the number of vertices in this group.
Definition: obj.hxx:48
cs237::color3f ambient
ambient component
Definition: obj.hxx:34
std::string name
name of material
Definition: obj.hxx:32
Axis-Aligned Bounding Box.
Definition: cs237-aabb.hxx:24
Structure that defines a material in a model.
Definition: obj.hxx:31
std::string diffuseMap
optional texture map for diffuse lighting
Definition: obj.hxx:39
A model from an OBJ file.
Definition: obj.hxx:58
uint32_t * indices
Definition: obj.hxx:53
std::string ambientMap
optional texture map for ambient
Definition: obj.hxx:38
template class for three-element vectors
Definition: cs237-types.hxx:26
A mesh that corresponds to a group in the obj file.
Definition: obj.hxx:45
include specular highlights
Definition: obj.hxx:27
template class for two-element vectors
Definition: cs237-types.hxx:25
cs237::color3f specular
specular component
Definition: obj.hxx:36
std::vector< OBJ::Group >::const_iterator endGroups() const
terminator for looping over the groups in the module
Definition: obj.hxx:81
ambient + diffuse
Definition: obj.hxx:26
Definition: cs237-color.hxx:57
int NumGroups() const
the number of groups in this model
Definition: obj.hxx:75
Model(std::string filename)
const cs237::AABBf & BBox() const
the model's axis-aligned bounding box
Definition: obj.hxx:67
std::string name
name of this group */
Definition: obj.hxx:46
cs237::vec3f * verts
array of nVerts texture coordinates (or nullptr)
Definition: obj.hxx:50
int illum
illumination mode (NoLight, etc.)
Definition: obj.hxx:33
cs237::vec3f * norms
array of nVerts texture coordinates (or nullptr)
Definition: obj.hxx:51
cs237::color3f diffuse
diffuse component
Definition: obj.hxx:35