checkpoint
[anneal.git] / src / edu / berkeley / qfat / geom / Triangle.java
index fece872..bfc0b84 100644 (file)
@@ -23,17 +23,18 @@ public abstract class Triangle implements HasBoundingBox {
     }
 
     /** issue gl.glVertex() for each of the triangle's points */
-    public void glVertices(GL gl) {
-        norm().glNormal(gl);
-        p1().glVertex(gl);
-        p2().glVertex(gl);
-        p3().glVertex(gl);
-    }
     public void glVertices(GL gl, Matrix m) {
-        m.times(norm()).glNormal(gl);
-        m.times(p1()).glVertex(gl);
-        m.times(p2()).glVertex(gl);
-        m.times(p3()).glVertex(gl);
+        if (m==null) {
+            norm().glNormal(gl);
+            p1().glVertex(gl);
+            p2().glVertex(gl);
+            p3().glVertex(gl);
+        } else {
+            m.times(norm()).glNormal(gl);
+            m.times(p1()).glVertex(gl);
+            m.times(p2()).glVertex(gl);
+            m.times(p3()).glVertex(gl);
+        }
     }
 
     /** the triangle's centroid */