Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ARectangleLight.h
Go to the documentation of this file.
1#pragma once
2
4#include "SDL/sdl_interface.h"
5
6#include <Common/primitive_type.h>
7
8namespace ph
9{
10
12{
13public:
14 std::shared_ptr<Geometry> getArea(const CookingContext& ctx) const override;
15
16 void setDimension(real width, real height);
17
18private:
19 real m_width;
20 real m_height;
21
22public:
24 {
25 ClassType clazz("rectangle-light");
26 clazz.docName("Rectangular Light Actor");
27 clazz.description(
28 "This type of light emits energy from a rectangular shape. Note that energy "
29 "is only allowed to emit from one side of the rectangle, not both sides.");
30 clazz.baseOn<AAreaLight>();
31
32 TSdlReal<OwnerType> width("width", &OwnerType::m_width);
33 width.description("The width of the rectangle.");
34 width.defaultTo(1);
35 width.required();
36 clazz.addField(width);
37
38 TSdlReal<OwnerType> height("height", &OwnerType::m_height);
39 height.description("The height of the rectangle.");
40 height.defaultTo(1);
41 height.required();
42 clazz.addField(height);
43
44 return clazz;
45 }
46};
47
48}// end namespace ph
Definition AAreaLight.h:14
Definition ARectangleLight.h:12
std::shared_ptr< Geometry > getArea(const CookingContext &ctx) const override
Definition ARectangleLight.cpp:9
void setDimension(real width, real height)
Definition ARectangleLight.cpp:16
PH_DEFINE_SDL_CLASS(TSdlOwnerClass< ARectangleLight >)
Definition ARectangleLight.h:23
Information about the world being cooked.
Definition CookingContext.h:24
SDL binding type for a canonical SDL resource class.
Definition TSdlOwnerClass.h:23
A field class that binds a floating point member variable.
Definition TSdlReal.h:21
TSdlValue & description(std::string descriptionStr)
Definition TSdlValue.ipp:95
TSdlValue & defaultTo(T defaultValue)
Definition TSdlValue.ipp:71
TSdlValue & required()
Definition TSdlValue.ipp:117
The root for all renderer implementations.
Definition EEngineProject.h:6