|
@@ -75,6 +75,7 @@ function ObJS(){
|
|
|
/********************************************************************
|
|
/********************************************************************
|
|
|
* Booleans to indicate if mtl file should be used. *
|
|
* Booleans to indicate if mtl file should be used. *
|
|
|
********************************************************************/
|
|
********************************************************************/
|
|
|
|
|
+ var hasMtl = true;
|
|
|
var useMtl = true;
|
|
var useMtl = true;
|
|
|
|
|
|
|
|
/********************************************************************
|
|
/********************************************************************
|
|
@@ -224,6 +225,31 @@ function ObJS(){
|
|
|
readMtlFile(mtlContent);
|
|
readMtlFile(mtlContent);
|
|
|
draw();
|
|
draw();
|
|
|
};
|
|
};
|
|
|
|
|
+ /********************************************************************
|
|
|
|
|
+ * Getters that determine if an element is being drawn. *
|
|
|
|
|
+ ********************************************************************/
|
|
|
|
|
+ this.isBackgroungDrawn = function(){
|
|
|
|
|
+ return dBackg;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ this.isVertexDrawn = function(){
|
|
|
|
|
+ return dVerts;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ this.isEdgeDrawn = function(){
|
|
|
|
|
+ return dEdges;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ this.isFaceDrawn = function(){
|
|
|
|
|
+ return dFaces;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ /********************************************************************
|
|
|
|
|
+ * Getters that determine if the model has associated materials. *
|
|
|
|
|
+ ********************************************************************/
|
|
|
|
|
+ this.isBackgroungDrawn = function(){
|
|
|
|
|
+ return dBackg;
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
/********************************************************************
|
|
/********************************************************************
|
|
|
* Functions switching the elements drawn (dVerts, dEdges, dFaces). *
|
|
* Functions switching the elements drawn (dVerts, dEdges, dFaces). *
|
|
@@ -624,6 +650,8 @@ function ObJS(){
|
|
|
text = text.substring(text.indexOf("\n") + 1);
|
|
text = text.substring(text.indexOf("\n") + 1);
|
|
|
}
|
|
}
|
|
|
totalMaterial = material.length;
|
|
totalMaterial = material.length;
|
|
|
|
|
+ if (totalMaterial == 0)
|
|
|
|
|
+ hasMtl = false;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/********************************************************************
|
|
/********************************************************************
|