Continuing working on dumping the world

This commit is contained in:
Godzil
2020-02-28 09:29:09 +00:00
parent 8ceb68fdff
commit b4ae737b40
19 changed files with 164 additions and 22 deletions

View File

@@ -137,4 +137,17 @@ BoundingBox Cone::getBounds()
ret.max.fixPoint();
return ret;
}
void Cone::dumpMe(FILE *fp)
{
fprintf(fp, "\"Type\": \"Cylinder\",\n");
Tuple t = this->transformMatrix * Point(0, 0, 0);
fprintf(fp, "\"pseudocenter\": { \"x\": %f, \"y\": %f, \"z\": %f}, \n",
t.x, t.y, t.z);
t = this->transformMatrix * Point(0, this->minCap, 0);
fprintf(fp, "\"min\": %f, \n", t.y);
t = this->transformMatrix * Point(1, this->maxCap, 1);
fprintf(fp, "\"max\": %f, \n", t.y);
Shape::dumpMe(fp);
}