Class: Engine::Components::MeshRenderer
- Inherits:
-
Engine::Component
- Object
- Engine::Component
- Engine::Components::MeshRenderer
- Defined in:
- lib/engine/components/mesh_renderer.rb
Instance Attribute Summary collapse
-
#material ⇒ Object
readonly
Returns the value of attribute material.
-
#mesh ⇒ Object
readonly
Returns the value of attribute mesh.
-
#static ⇒ Object
readonly
Returns the value of attribute static.
Attributes inherited from Engine::Component
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(mesh, material, static: false) ⇒ MeshRenderer
constructor
A new instance of MeshRenderer.
- #renderer? ⇒ Boolean
- #start ⇒ Object
- #update(delta_time) ⇒ Object
Methods inherited from Engine::Component
#_erase!, #destroy!, #destroyed?, destroyed_components, erase_destroyed_components, method_added, #set_game_object, #ui_renderer?
Constructor Details
#initialize(mesh, material, static: false) ⇒ MeshRenderer
Returns a new instance of MeshRenderer.
7 8 9 10 11 |
# File 'lib/engine/components/mesh_renderer.rb', line 7 def initialize(mesh, material, static: false) @mesh = mesh @material = material @static = static end |
Instance Attribute Details
#material ⇒ Object (readonly)
Returns the value of attribute material.
5 6 7 |
# File 'lib/engine/components/mesh_renderer.rb', line 5 def material @material end |
#mesh ⇒ Object (readonly)
Returns the value of attribute mesh.
5 6 7 |
# File 'lib/engine/components/mesh_renderer.rb', line 5 def mesh @mesh end |
#static ⇒ Object (readonly)
Returns the value of attribute static.
5 6 7 |
# File 'lib/engine/components/mesh_renderer.rb', line 5 def static @static end |
Instance Method Details
#destroy ⇒ Object
27 28 29 |
# File 'lib/engine/components/mesh_renderer.rb', line 27 def destroy Rendering::RenderPipeline.remove_instance(self) end |
#renderer? ⇒ Boolean
13 14 15 |
# File 'lib/engine/components/mesh_renderer.rb', line 13 def renderer? true end |
#start ⇒ Object
17 18 19 |
# File 'lib/engine/components/mesh_renderer.rb', line 17 def start Rendering::RenderPipeline.add_instance(self) end |
#update(delta_time) ⇒ Object
21 22 23 24 25 |
# File 'lib/engine/components/mesh_renderer.rb', line 21 def update(delta_time) unless static Rendering::RenderPipeline.update_instance(self) end end |