Skip to content
Snippets Groups Projects
CirclePlane.h 682 B
Newer Older
Postea's avatar
Postea committed
#pragma once
Yoel's avatar
Yoel committed
#include "Light.h"
Postea's avatar
Postea committed
#include "Shape.h"

namespace shapes {
Yoel's avatar
Yoel committed
class CirclePlane : public Light, public Shape {
Yoel's avatar
Yoel committed
   public:
	CirclePlane(float radius, bool twofaced,
Yoel's avatar
Yoel committed
	            const std::shared_ptr<material::Material>& material);
Yoel's avatar
Yoel committed
	std::optional<cam::Hit> intersect(const cam::Ray& r) const override;
	util::AxisAlignedBoundingBox bounds() const override;
Yoel's avatar
Yoel committed
	util::SurfacePoint sampleLight() const override;
	util::Vec3 calculateLightEmission(const util::SurfacePoint& p,
	                                  const util::Vec3& d) const override;

Yoel's avatar
Yoel committed
   private:
	std::shared_ptr<material::Material> material;
	const float radius;
	const bool twofaced;
Yoel's avatar
Yoel committed
}  // namespace shapes