Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F123387
SceneRenderable.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
SceneRenderable.cpp
View Options
#include
<echo/Graphics/SceneRenderable.h>
namespace
Echo
{
SceneRenderable
::
SceneRenderable
(
const
Vector3
&
position
,
const
Quaternion
&
orientation
,
const
Vector3
&
scale
)
:
Node
(
position
,
orientation
,
scale
),
mVisible
(
true
),
mParentSceneRenderable
(
nullptr
)
{
}
SceneRenderable
::~
SceneRenderable
()
{
// Higher level classes may dynamic cast to a SceneRenderable which will fail when this node is removed
// from the parent because the SceneRenderable part of the object will have been deleted.
if
(
GetParent
())
{
GetParent
()
->
RemoveChild
(
*
this
);
}
}
SceneRenderable
::
SceneRenderable
(
const
SceneRenderable
&
other
)
{
mParentSceneRenderable
=
0
;
*
this
=
other
;
}
SceneRenderable
&
SceneRenderable
::
operator
=
(
const
SceneRenderable
&
rhs
)
{
if
(
this
==&
rhs
)
{
return
*
this
;
}
//mParentSceneRenderable // Leave.
Node
::
operator
=
(
rhs
);
mVisible
=
rhs
.
mVisible
;
return
*
this
;
}
AxisAlignedBox
SceneRenderable
::
GetSceneAxisAlignedBox
()
const
{
AxisAlignedBox
localAABB
=
GetAxisAlignedBox
(
false
);
localAABB
.
Transform
(
Node
::
GetTransform
());
return
localAABB
;
}
void
SceneRenderable
::
Accept
(
SceneRenderableVisitor
&
visitor
)
{
if
(
mVisible
)
{
visitor
.
SceneRenderableVisit
(
*
this
);
}
}
void
SceneRenderable
::
Leave
(
SceneRenderableVisitor
&
)
{
//Default is to do nothing
}
bool
SceneRenderable
::
GetVisible
()
const
{
if
(
mParentSceneRenderable
)
{
return
mVisible
&&
mParentSceneRenderable
->
GetVisible
();
}
return
mVisible
;
}
void
SceneRenderable
::
OnParentSet
(
Node
*
node
)
{
mParentSceneRenderable
=
dynamic_cast
<
SceneRenderable
*>
(
node
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Wed, Jan 15, 8:43 PM (2 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
72048
Default Alt Text
SceneRenderable.cpp (1 KB)
Attached To
Mode
rEE Echo 3
Attached
Detach File
Event Timeline
Log In to Comment