32 #if !defined(LoadOBJ_INCLUDE_ONCE) 33 #define LoadOBJ_INCLUDE_ONCE 97 bool valid()
const {
return !mFileName.empty(); }
108 bool cc()
const {
return mCC; }
110 bool clamp()
const {
return mClamp; }
126 float bm()
const {
return mBM; }
203 float tr()
const {
return mTr; }
205 float ns()
const {
return mNs; }
207 int illum()
const {
return mIllum; }
209 float ni()
const {
return mNi; }
316 const std::vector<int>&
face_type()
const {
return mFace_type; }
345 const std::vector<fvec3>&
normalArray()
const {
return mNormals; }
347 const std::map< std::string, ref<ObjMaterial> >&
materials()
const {
return mMaterials; }
348 const std::vector< ref<ObjMesh> >&
meshes()
const {
return mMeshes; }
353 std::map< std::string, ref<ObjMaterial> >&
materials() {
return mMaterials; }
354 std::vector< ref<ObjMesh> >&
meshes() {
return mMeshes; }
363 void loadObjMaterials(
VirtualFile* file, std::vector<ObjMaterial>& materials );
float ns() const
Ns - specular exponent.
VLGRAPHICS_EXPORT ref< ResourceDatabase > loadOBJ(const String &path)
Loads a Wavefront OBJ file. See also ObjLoader.
void setMM_Base(float base)
-mm base gain
std::vector< fvec4 > & vertexArray()
ref< ObjMaterial > mMaterial
int illum() const
illum - illumination model
const std::vector< int > & faceTexCoordIndex() const
Index into ObjLoader::texCoordsArray() vector.
std::vector< fvec4 > mCoords
std::vector< int > & faceNormalIndex()
Index into ObjLoader::normalArray() vector.
void setClamp(bool on)
-clamp on | off
const std::map< std::string, ref< ObjMaterial > > & materials() const
void setO_UVW(const fvec3 &o_uvw)
-o u v w
const fvec3 & ka() const
Ka - ambient color.
float mm_Base() const
-mm base gain
fvec3 mKe
Ke - emissive color.
bool clamp() const
-clamp on | off
float tr() const
Tr/d - transparency.
std::vector< ref< ObjMesh > > & meshes()
ObjTexture mMap_Bump
bump - bump map
void setNi(float ni)
Ni - optical density / index of refraction.
An abstract class representing a file.
Loads a Wavefront OBJ file.
bool mClamp
-clamp on | off
ref< ResourceDatabase > loadResource(const String &path) const
std::vector< int > & face_type()
Each entry represents a face, the number represents how many vertices the face has.
const ObjTexture & map_Disp() const
disp - displace map
void setImfchan(char val)
-imfchan r | g | b | m | l | z
fvec3 mKa
Ka - ambient color.
void setMap_d(const ObjTexture &map_d)
map_d - transparency map
The String class implements an advanced UTF16 (Unicode BMP) string manipulation engine.
void setMap_Ks(const ObjTexture &map_ks)
map_Ks - specular color map
void setMap_Kd(const ObjTexture &map_kd)
map_Kd - ambient diffuse
const fvec3 & kd() const
Kd - diffuse color.
ref< ResourceDatabase > loadResource(VirtualFile *file) const
ObjTexture mMap_Ns
map_Ns - specular exponent map
const std::vector< int > & faceNormalIndex() const
Index into ObjLoader::normalArray() vector.
std::vector< ref< ObjMesh > > mMeshes
fvec3 mKd
Kd - diffuse color.
String mFileName
Texture file name.
std::vector< fvec3 > & normalArray()
void setBlendU(bool on)
-blendu on | off
bool mBlendU
-blendu on | off
bool mBlendV
-blendv on | off
void setMap_Decal(const ObjTexture &map_decal)
decal - decal map
const std::vector< fvec3 > & normalArray() const
float mNi
Ni - optical density / index of refraction.
std::map< std::string, ref< ObjMaterial > > & materials()
float texres_Value() const
-texres value
const ObjTexture & map_Ks() const
map_Ks - specular color map
#define VL_INSTRUMENT_CLASS(ClassName, BaseClass)
const String & path() const
Texture file name.
std::vector< int > mFace_itexcoords
void setKe(const fvec3 &ke)
Ke - emissive color.
void setBlendV(bool on)
-blendv on | off
float mMM_Gain
-mm base gain
Visualization Library main namespace.
float mTexres_Value
-texres value
Represents a Wavefront OBJ mesh. See also ObjLoader.
const ObjTexture & map_Ka() const
map_Ka - ambient color map
char imfchan() const
-imfchan r | g | b | m | l | z
const std::vector< fvec3 > & texCoordsArray() const
void setMap_Bump(const ObjTexture &map_bump)
bump - bump map
const fvec3 & ke() const
Ke - emissive color.
float mNs
Ns - specular exponent.
std::vector< int > & faceTexCoordIndex()
Index into ObjLoader::texCoordsArray() vector.
const ObjTexture & map_Bump() const
bump - bump map
The LoadWriterOBJ class is a ResourceLoadWriter capable of reading OBJ files.
ObjTexture mMap_Decal
decal - decal map
void setKa(const fvec3 &ka)
Ka - ambient color.
The base class for all the reference counted objects.
Represents a Wavefront OBJ texture. See also ObjMaterial and ObjLoader.
void setKs(const fvec3 &ks)
Ks - specular color.
ObjTexture mMap_Kd
map_Kd - ambient diffuse
float mm_Gain() const
-mm base gain
ObjTexture mMap_Ka
map_Ka - ambient color map
void setNs(float ns)
Ns - specular exponent.
std::map< std::string, ref< ObjMaterial > > mMaterials
void setPath(const String &filename)
Texture file name.
std::vector< fvec3 > mNormals
ObjMaterial * material()
The material associated to this mesh.
std::vector< fvec3 > & texCoordsArray()
void setS_UVW(const fvec3 &s_uvw)
-s u v w
bool blendU() const
-blendu on | off
const std::vector< int > & face_type() const
Each entry represents a face, the number represents how many vertices the face has.
const ObjTexture & map_d() const
map_d - transparency map
void setTexres_Value(float value)
-texres value
bool blendV() const
-blendv on | off
const ObjTexture & map_Ns() const
map_Ns - specular exponent map
fvec3 mKs
Ks - specular color.
float ni() const
Ni - optical density / index of refraction.
void setIllum(int illum)
illum - illumination model
const std::vector< ref< ObjMesh > > & meshes() const
void setT_UVW(const fvec3 &t_uvw)
-t u v w
#define VLGRAPHICS_EXPORT
std::vector< int > & facePositionIndex()
Index into ObjLoader::vertexArray() vector.
int mIllum
illum - illumination model
const ObjMaterial * material() const
The material associated to this mesh.
bool cc() const
-cc on | off
const std::vector< int > & facePositionIndex() const
Index into ObjLoader::vertexArray() vector.
bool writeResource(const String &, ResourceDatabase *) const
Not supported yet.
char mImfchan
-imfchan r | g | b | m | l | z
float mMM_Base
-mm base gain
void setMap_Disp(const ObjTexture &map_disp)
disp - displace map
void setKd(const fvec3 &kd)
Kd - diffuse color.
const fvec3 & t_UVW() const
-t u v w
std::vector< int > mFace_icoords
void registerLoadWriter()
bool writeResource(VirtualFile *, ResourceDatabase *) const
Not supported yet.
The ref<> class is used to reference-count an Object.
std::vector< int > mFace_inormals
const ObjTexture & map_Kd() const
map_Kd - ambient diffuse
const fvec3 & s_UVW() const
-s u v w
ObjTexture mMap_d
map_d - transparency map
Represents a Wavefront OBJ material as loaded from an MTL file. See also ObjLoader.
void setBM(float bm)
-bm mult
std::vector< fvec3 > mTexCoords
std::vector< int > mFace_type
The ResourceLoadWriter class is an abstract class used to implement read/write support for one or mor...
void setMM_Gain(float gain)
-mm base gain
void setTr(float tr)
Tr/d - transparency.
const ObjTexture & map_Decal() const
decal - decal map
const fvec3 & ks() const
Ks - specular color.
void setMaterial(ObjMaterial *mat)
The material associated to this mesh.
void setMap_Ka(const ObjTexture &map_ka)
map_Ka - ambient color map
void setMap_Ns(const ObjTexture &map_ns)
map_Ns - specular exponent map
const fvec3 & o_UVW() const
-o u v w
ObjTexture mMap_Disp
disp - displace map
float mTr
Tr/d - transparency.
The ResourceDatabase class contains and manipulates a set of resources.
const std::vector< fvec4 > & vertexArray() const
ObjTexture mMap_Ks
map_Ks - specular color map
void setCC(bool on)
-cc on | off