Trying to make the dump a bit more usefull and slightly less cluttered

This commit is contained in:
Godzil
2020-03-09 17:41:11 +00:00
parent 15a861802a
commit 4e241a1871
6 changed files with 83 additions and 26 deletions

View File

@@ -73,6 +73,8 @@ BoundingBox Triangle::getLocalBounds()
void Triangle::dumpMe(FILE *fp)
{
fprintf(fp, "\"Type\": \"Triangle\",\n");
/* World points*/
Tuple t = this->transformMatrix * this->p1;
fprintf(fp, "\"p1\": { \"x\": %f, \"y\": %f, \"z\": %f}, \n",
t.x, t.y, t.z);
@@ -82,5 +84,16 @@ void Triangle::dumpMe(FILE *fp)
t = this->transformMatrix * this->p3;
fprintf(fp, "\"p3\": { \"x\": %f, \"y\": %f, \"z\": %f}, \n",
t.x, t.y, t.z);
/* Local points */
t = this->p1;
fprintf(fp, "\"lp1\": { \"x\": %f, \"y\": %f, \"z\": %f}, \n",
t.x, t.y, t.z);
t = this->p2;
fprintf(fp, "\"lp2\": { \"x\": %f, \"y\": %f, \"z\": %f}, \n",
t.x, t.y, t.z);
t = this->p3;
fprintf(fp, "\"lp3\": { \"x\": %f, \"y\": %f, \"z\": %f}, \n",
t.x, t.y, t.z);
Shape::dumpMe(fp);
}