Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ShUtil::ShObjMesh Class Reference

Inheritance diagram for ShUtil::ShObjMesh:

Inheritance graph
[legend]
Collaboration diagram for ShUtil::ShObjMesh:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ShMesh< ShObjMeshTypeParentType

Public Member Functions

 ShObjMesh ()
 Constructs an empty mesh.
 ShObjMesh (std::istream &in)
 Constructs ShObjMesh from an input stream of an OBJ file.
std::istream & readObj (std::istream &in)
 Deletes current mesh and reads in a new mesh from an OBJ file.
void generateFaceNormals ()
 Generates face normals by cross product.
int generateVertexNormals (bool force=false)
 Generates normals by averaging adjacent face normals for vertices that have zero normals (or all vertices if force = true).
int generateTangents (bool force=false)
 Generates tangents by cross product with (0,1,0) for vertices that have zero tangents (or all vertices if force = true).
int generateSphericalTexCoords (bool force=false)
 Generates texcoords in a "spherical" shrink map centered at the average of all vertex positions only when all vertex texcoords are 0.
void normalizeNormals ()
 Normalizes all the normals held in this mesh.
void consolidateVertices ()
 Consolidates vertices whose coordinates are within 1e-5 of each other componentwise.

Friends

std::istream & operator>> (std::istream &in, ShObjMesh &mesh)
 Sets mesh data to data from an OBJ file.

Detailed Description

Definition at line 63 of file ShObjMesh.hpp.


Member Function Documentation

int ShUtil::ShObjMesh::generateSphericalTexCoords bool  force = false  ) 
 

Generates texcoords in a "spherical" shrink map centered at the average of all vertex positions only when all vertex texcoords are 0.

(or if force = true)

returns the number of texture coordinates generated

Definition at line 276 of file ShObjMesh.cpp.

References SH::acos(), SH::atan2(), SH::dot(), ShUtil::ShMesh< ShObjMeshType >::edges, SH::ShGeneric< N, T >::getValue(), SH::normalize(), and ShUtil::ShMesh< ShObjMeshType >::verts.

Referenced by readObj().

int ShUtil::ShObjMesh::generateTangents bool  force = false  ) 
 

Generates tangents by cross product with (0,1,0) for vertices that have zero tangents (or all vertices if force = true).

returns the number of tangents generated

Definition at line 264 of file ShObjMesh.cpp.

References SH::cross(), SH::dot(), and ShUtil::ShMesh< ShObjMeshType >::edges.

Referenced by readObj().

int ShUtil::ShObjMesh::generateVertexNormals bool  force = false  ) 
 

Generates normals by averaging adjacent face normals for vertices that have zero normals (or all vertices if force = true).

returns the number of fixed vertex normals

Definition at line 229 of file ShObjMesh.cpp.

References SH::cross(), SH::dot(), ShUtil::ShMesh< ShObjMeshType >::edges, SH::length(), SH::normalize(), and SH::scale().

Referenced by readObj().


The documentation for this class was generated from the following files:
Generated on Thu Jul 28 17:37:56 2005 for Sh by  doxygen 1.4.3-20050530