src/linetypes/triangle.cpp

changeset 81
62373840e33a
parent 77
028798a72591
child 86
4bec0525ef1b
--- a/src/linetypes/triangle.cpp	Wed Mar 11 19:05:34 2020 +0200
+++ b/src/linetypes/triangle.cpp	Tue Mar 17 23:13:29 2020 +0200
@@ -83,3 +83,20 @@
 	// -> 1 0 2
 	std::swap(this->points[0], this->points[1]);
 }
+
+int ldraw::Triangle::numPoints() const
+{
+	return 3;
+}
+
+const glm::vec3& ldraw::Triangle::getPoint(int index) const
+{
+	if (index >= 0 and index < 3)
+	{
+		return this->points[index];
+	}
+	else
+	{
+		return ldraw::ColoredObject::getPoint(index);
+	}
+}

mercurial