use p1 to p4 instead of a matrix

This commit is contained in:
Shuo Feng 2024-02-20 22:32:55 -05:00
parent f624514714
commit 295bdc0c89
Signed by: sfeng
GPG key ID: 1E83AE6CD1C037B1
2 changed files with 10 additions and 5 deletions

View file

@ -95,8 +95,12 @@ Rectangle *Parser::getRectangle(const nlohmann::json &j, float ka, float kd,
const Vector3f &cd, const Vector3f &cs,
float pc) {
Matrix<float, 3, 4> corners = getCorners(j);
Vector3f p1 = getVector3f(j["p1"]);
Vector3f p2 = getVector3f(j["p2"]);
Vector3f p3 = getVector3f(j["p3"]);
Vector3f p4 = getVector3f(j["p4"]);
return new Rectangle(ka, kd, ks, ca, cd, cs, pc, corners);
return new Rectangle(ka, kd, ks, ca, cd, cs, pc, p1, p2, p3, p4);
}
Light *Parser::getLight(const nlohmann::json &j) {