11 #include "EffectsContainer.h"
12 #include "GDCore/String.h"
17 class SerializerElement;
18 class EffectsContainer;
38 void SetViewport(
float x1_,
float y1_,
float x2_,
float y2_) {
44 void SetViewportX1(
float x1_) { x1 = x1_; };
45 void SetViewportY1(
float y1_) { y1 = y1_; };
46 void SetViewportX2(
float x2_) { x2 = x2_; };
47 void SetViewportY2(
float y2_) { y2 = y2_; };
48 float GetViewportX1()
const {
return x1; };
49 float GetViewportY1()
const {
return y1; };
50 float GetViewportX2()
const {
return x2; };
51 float GetViewportY2()
const {
return y2; };
56 void SetSize(
float width_,
float height_) {
60 float GetWidth()
const {
return width; };
61 float GetHeight()
const {
return height; };
63 void SetUseDefaultSize(
bool useDefaultSize =
true) {
64 defaultSize = useDefaultSize;
66 bool UseDefaultSize()
const {
return defaultSize; }
68 void SetUseDefaultViewport(
bool useDefaultViewport =
true) {
69 defaultViewport = useDefaultViewport;
71 bool UseDefaultViewport()
const {
return defaultViewport; }
106 const gd::String& GetRenderingType()
const {
return renderingType; }
108 void SetRenderingType(
const gd::String& renderingType_) {
109 renderingType = renderingType_;
112 const gd::String& GetDefaultCameraBehavior()
const {
return defaultCameraBehavior; }
114 void SetDefaultCameraBehavior(
const gd::String& defaultCameraBehavior_) {
115 defaultCameraBehavior = defaultCameraBehavior_;
118 const gd::String& GetCameraType()
const {
return cameraType; }
120 void SetCameraType(
const gd::String& cameraType_) {
121 cameraType = cameraType_;
137 void SetLocked(
bool isLocked_) { isLocked = isLocked_; }
148 isLightingLayer = isLightingLayer_;
160 followBaseLayerCamera = followBaseLayerCamera_;
171 double GetCamera3DNearPlaneDistance()
const {
172 return camera3DNearPlaneDistance;
174 void SetCamera3DNearPlaneDistance(
double distance) {
175 camera3DNearPlaneDistance = distance;
177 double GetCamera3DFarPlaneDistance()
const {
178 return camera3DFarPlaneDistance;
180 void SetCamera3DFarPlaneDistance(
double distance) {
181 camera3DFarPlaneDistance = distance;
183 double GetCamera3DFieldOfView()
const {
return camera3DFieldOfView; }
184 void SetCamera3DFieldOfView(
double angle) { camera3DFieldOfView = angle; }
194 void SetCameraCount(std::size_t n);
205 if (n >= GetCameraCount())
return badCamera;
213 if (n >= GetCameraCount())
return badCamera;
221 if (n >= GetCameraCount())
return;
222 cameras.erase(cameras.begin() + n);
251 ambientLightColorR = r;
252 ambientLightColorG = g;
253 ambientLightColorB = b;
288 bool isLightingLayer;
290 bool followBaseLayerCamera;
292 double camera3DNearPlaneDistance;
293 double camera3DFarPlaneDistance;
294 double camera3DFieldOfView;
295 unsigned int ambientLightColorR;
296 unsigned int ambientLightColorG;
297 unsigned int ambientLightColorB;
298 std::vector<gd::Camera> cameras;
A camera is used to render a specific area of a layout.
Definition: Layer.h:29
void SetViewport(float x1_, float y1_, float x2_, float y2_)
Change the viewport, i.e the area of the window where the camera will be displayed.
Definition: Layer.h:38
void SetSize(float width_, float height_)
Change the size of the rendered area of the scene, in pixels.
Definition: Layer.h:56
Contains effects applied to an entity on screen (i.e: a Layer or an Object).
Definition: EffectsContainer.h:29
Represents a layer of a layout.
Definition: Layer.h:91
bool GetVisibility() const
Return true if layer will be displayed at the layout startup.
Definition: Layer.h:132
std::size_t GetCameraCount() const
Get cameras count.
Definition: Layer.h:199
void SetLocked(bool isLocked_)
Change if layer can be modified or not.
Definition: Layer.h:137
void SetName(const gd::String &name_)
Change layer name.
Definition: Layer.h:99
void SetAmbientLightColor(unsigned int r, unsigned int g, unsigned int b)
Definition: Layer.h:250
unsigned int GetAmbientLightColorBlue() const
Definition: Layer.h:245
bool IsLightingLayer() const
Return true if the layer is a lighting layer.
Definition: Layer.h:154
bool IsFollowingBaseLayerCamera() const
Return true if the layer follows the base layer.
Definition: Layer.h:166
void DeleteCamera(std::size_t n)
Delete a specific camera.
Definition: Layer.h:220
const gd::String & GetName() const
Get layer name.
Definition: Layer.h:104
void SetLightingLayer(bool isLightingLayer_)
Set if the layer is a lighting layer or not.
Definition: Layer.h:147
const Camera & GetCamera(std::size_t n) const
Return a reference to a camera.
Definition: Layer.h:204
unsigned int GetAmbientLightColorGreen() const
Definition: Layer.h:240
void AddCamera(const Camera &camera)
Add an already existing camera.
Definition: Layer.h:228
void SetFollowBaseLayerCamera(bool followBaseLayerCamera_)
Set if the layer automatically follows the base layer or not.
Definition: Layer.h:159
void SetVisibility(bool isVisible_)
Change if layer is displayed or not.
Definition: Layer.h:127
bool IsLocked() const
Return true if layer can't be modified.
Definition: Layer.h:142
unsigned int GetAmbientLightColorRed() const
Definition: Layer.h:235
Camera & GetCamera(std::size_t n)
Return a reference to a camera.
Definition: Layer.h:212
A generic container that can represent a value ( containing a string, double, bool or int),...
Definition: SerializerElement.h:37
String represents an UTF8 encoded string.
Definition: String.h:33
Definition: CommonTools.h:24