3 #include <Engine/RaEngine.hpp>
10 #include <Core/Utils/IndexedObject.hpp>
12 #include <Engine/Data/ShaderProgram.hpp>
13 #include <Engine/Rendering/RenderObjectTypes.hpp>
14 #include <Engine/Rendering/RenderTechnique.hpp>
26 struct ViewingParameters;
27 class RenderParameters;
39 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
54 const RenderObjectType& type,
86 const std::string& name,
88 const RenderObjectType& type,
89 std::shared_ptr<Data::Displayable> mesh,
99 const std::string& getName()
const;
103 const RenderObjectType& getType()
const;
104 void setType(
const RenderObjectType& t );
106 void setVisible(
bool visible );
107 void toggleVisible();
108 bool isVisible()
const;
110 void setPickable(
bool pickable );
111 void togglePickable();
112 bool isPickable()
const;
114 void setXRay(
bool xray );
118 void setTransparent(
bool transparent );
119 void toggleTransparent();
120 bool isTransparent()
const;
123 void setColoredByVertexAttrib(
bool state );
125 void toggleColoredByVertexAttrib();
127 bool isColoredByVertexAttrib()
const;
129 bool isDirty()
const;
131 void setRenderTechnique( std::shared_ptr<RenderTechnique> technique );
132 std::shared_ptr<const RenderTechnique> getRenderTechnique()
const;
133 std::shared_ptr<RenderTechnique> getRenderTechnique();
135 void setMaterial( std::shared_ptr<Data::Material> material );
136 std::shared_ptr<const Data::Material> getMaterial()
const;
137 std::shared_ptr<Data::Material> getMaterial();
139 void setMesh( std::shared_ptr<Data::Displayable> mesh );
140 std::shared_ptr<const Data::Displayable> getMesh()
const;
141 const std::shared_ptr<Data::Displayable>& getMesh();
143 Core::Transform getTransform()
const;
144 Core::Matrix4 getTransformAsMatrix()
const;
146 Core::Aabb computeAabb();
148 void setLocalTransform(
const Core::Transform& transform );
149 void setLocalTransform(
const Core::Matrix4& transform );
150 const Core::Transform& getLocalTransform()
const;
151 const Core::Matrix4& getLocalTransformAsMatrix()
const;
157 void hasBeenRenderedOnce();
163 void setLifetime(
int t );
186 Core::Utils::Index passId = DefaultRenderingPasses::LIGHTING_OPAQUE );
188 void invalidateAabb();
191 Core::Transform m_localTransform { Core::Transform::Identity() };
194 std::string m_name {};
196 RenderObjectType m_type { RenderObjectType::Geometry };
197 std::shared_ptr<RenderTechnique> m_renderTechnique {
nullptr };
198 std::shared_ptr<Data::Displayable> m_mesh {
nullptr };
199 std::shared_ptr<Data::Material> m_material {
nullptr };
201 mutable std::mutex m_updateMutex;
203 int m_lifetime { -1 };
204 bool m_visible {
true };
205 bool m_pickable {
true };
206 bool m_xray {
false };
207 bool m_transparent {
false };
208 bool m_dirty {
true };
209 bool m_hasLifetime {
false };
211 bool m_isAabbValid {
false };
213 int m_aabbObserverIndex { -1 };
static RenderTechnique createDefaultRenderTechnique()
A component is an element that can be updated by a system. It is also linked to some other components...
the set of viewing parameters extracted from the camera and given to the renderer