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
3
#include "
Actor/Light/AAreaLight.h
"
4
#include "
SDL/sdl_interface.h
"
5
6
#include <Common/primitive_type.h>
7
8
namespace
ph
9
{
10
11
class
ARectangleLight
:
public
AAreaLight
12
{
13
public
:
14
std::shared_ptr<Geometry>
getArea
(
const
CookingContext
& ctx)
const override
;
15
16
void
setDimension
(real width, real height);
17
18
private
:
19
real m_width;
20
real m_height;
21
22
public
:
23
PH_DEFINE_SDL_CLASS
(
TSdlOwnerClass<ARectangleLight>
)
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
AAreaLight.h
ph::AAreaLight
Definition
AAreaLight.h:14
ph::ARectangleLight
Definition
ARectangleLight.h:12
ph::ARectangleLight::getArea
std::shared_ptr< Geometry > getArea(const CookingContext &ctx) const override
Definition
ARectangleLight.cpp:9
ph::ARectangleLight::setDimension
void setDimension(real width, real height)
Definition
ARectangleLight.cpp:16
ph::ARectangleLight::PH_DEFINE_SDL_CLASS
PH_DEFINE_SDL_CLASS(TSdlOwnerClass< ARectangleLight >)
Definition
ARectangleLight.h:23
ph::CookingContext
Information about the world being cooked.
Definition
CookingContext.h:24
ph::TSdlOwnerClass
SDL binding type for a canonical SDL resource class.
Definition
TSdlOwnerClass.h:23
ph::TSdlReal
A field class that binds a floating point member variable.
Definition
TSdlReal.h:21
ph::TSdlValue::description
TSdlValue & description(std::string descriptionStr)
Definition
TSdlValue.ipp:95
ph::TSdlValue::defaultTo
TSdlValue & defaultTo(T defaultValue)
Definition
TSdlValue.ipp:71
ph::TSdlValue::required
TSdlValue & required()
Definition
TSdlValue.ipp:117
ph
The root for all renderer implementations.
Definition
EEngineProject.h:6
sdl_interface.h
Source
Actor
Light
ARectangleLight.h
Generated by
1.11.0