add implementations for geometry methods

This commit is contained in:
Shuo Feng 2024-02-13 19:31:06 -05:00
parent e652b957f0
commit 5524343a6e
Signed by: sfeng
GPG key ID: 1E83AE6CD1C037B1
2 changed files with 13 additions and 0 deletions

9
src/Geometry.cc Normal file
View file

@ -0,0 +1,9 @@
#include "Geometry.h"
void Geometry::setTransform(const Matrix4f &transform) {
this->transform = transform;
}
bool Sphere::intersect() const { return false; }
bool Rectangle::intersect() const { return false; }

View file

@ -37,6 +37,8 @@ public:
: Geometry(Type::SPHERE, ka, kd, ks, ca, cd, cs, pc), radius(radius),
center(center) {}
bool intersect() const override;
private:
float radius;
Vector3f center;
@ -49,6 +51,8 @@ public:
: Geometry(Type::RECTANGLE, ka, kd, ks, ca, cd, cs, pc),
corners(corners) {}
bool intersect() const override;
private:
Matrix<float, 3, 4> corners;
};