Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F96929
Scene.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
Scene.h
View Options
#ifndef _ECHOSCENE_H_
#define _ECHOSCENE_H_
#include
<echo/Kernel/TaskGroup.h>
#include
<echo/Graphics/Renderable.h>
#include
<echo/Graphics/SceneRenderable.h>
#include
<map>
#include
<vector>
namespace
Echo
{
class
Camera
;
class
Light
;
class
SceneRenderable
;
class
RenderTarget
;
class
Matrix4
;
class
Ray
;
class
Scene
:
public
TaskGroup
,
public
SceneRenderableVisitor
{
public
:
Scene
();
Scene
(
const
std
::
string
&
name
);
virtual
~
Scene
();
shared_ptr
<
Camera
>
CreateCamera
();
//Creates a camera for the Scene
shared_ptr
<
Camera
>
CreateCamera
(
const
std
::
string
&
name
);
//Creates a camera for the Scene
shared_ptr
<
Camera
>
GetCamera
(
const
std
::
string
&
name
);
//Gets a camera for the Scene
shared_ptr
<
Light
>
CreateLight
();
//Creates a light for the Scene
shared_ptr
<
Light
>
CreateLight
(
const
std
::
string
&
name
);
//Creates a light for the Scene
shared_ptr
<
Light
>
GetLight
(
const
std
::
string
&
name
);
//Gets a light for the Scene
void
AddRenderable
(
shared_ptr
<
SceneRenderable
>
sceneRenderable
,
bool
pickable
=
true
);
void
RemoveRenderable
(
shared_ptr
<
SceneRenderable
>
sceneRenderable
);
shared_ptr
<
SceneRenderable
>
Pick
(
Camera
&
camera
,
Ray
&
ray
);
//! Builds the render queue.
void
BuildRenderQueue
(
const
Camera
&
camera
);
void
SceneRenderableVisit
(
SceneRenderable
&
renderable
)
override
;
/**
* Override from SceneRenderableVisitor.
* @return If performing a Render operation, the current camera used for rendering the scene, otherwise null.
*/
const
Camera
*
GetCurrentCamera
()
override
;
void
Render
(
RenderTarget
&
renderTarget
,
const
Camera
&
camera
);
void
SetSkyBox
(
shared_ptr
<
SceneRenderable
>
skyBox
);
protected
:
void
ApplyLights
(
RenderTarget
&
renderTarget
,
const
Camera
&
camera
);
typedef
std
::
pair
<
f32
,
SceneRenderable
*
>
DistanceRenderablePair
;
typedef
std
::
pair
<
const
std
::
string
,
shared_ptr
<
Light
>
>
NamedLightPair
;
static
bool
DistanceCompare
(
const
DistanceRenderablePair
&
a
,
const
DistanceRenderablePair
&
b
);
std
::
map
<
std
::
string
,
shared_ptr
<
Camera
>
>
mCameras
;
std
::
map
<
std
::
string
,
shared_ptr
<
Light
>
>
mLights
;
std
::
list
<
shared_ptr
<
SceneRenderable
>
>
mRenderables
;
std
::
list
<
shared_ptr
<
SceneRenderable
>
>
mPickableRenderables
;
std
::
vector
<
DistanceRenderablePair
>
mRenderQueue
;
shared_ptr
<
SceneRenderable
>
mSkyBox
;
const
Camera
*
mCurrentCamera
;
/// Camera set for operations over multiple methods.
};
}
#endif
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Thu, Dec 5, 2:04 AM (7 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
61647
Default Alt Text
Scene.h (2 KB)
Attached To
Mode
rEE Echo 3
Attached
Detach File
Event Timeline
Log In to Comment