Class: Ogre::MeshInstance
- Defined in:
- lib/shattered_ogrerb/mesh_instance.rb
Overview
are not delegated respectfully.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#entity ⇒ Object
readonly
Returns the value of attribute entity.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Instance Method Summary collapse
-
#initialize(parent, scene_manager, mesh_name, options = {}) ⇒ MeshInstance
constructor
A new instance of MeshInstance.
-
#material=(material) ⇒ Object
Set a material on a mesh.
-
#visible=(v) ⇒ Object
Entity delegates that map differently.
- #visible? ⇒ Boolean
Constructor Details
#initialize(parent, scene_manager, mesh_name, options = {}) ⇒ MeshInstance
Returns a new instance of MeshInstance.
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/shattered_ogrerb/mesh_instance.rb', line 14 def initialize(parent, scene_manager, mesh_name, ={}) @@entity_count ||= 0 @node = parent.create_child_scene_node # formats to '#<SceneManager:???>.entity(0)' @entity = [:entity] || scene_manager.create_entity("#{scene_manager.to_s}.entity(#{@@entity_count})", mesh_name) @node.attach_object(@entity) @@entity_count += 1 # delegate all unknown methods to the entity object __setobj__(@entity) end |
Instance Attribute Details
#entity ⇒ Object (readonly)
Returns the value of attribute entity.
13 14 15 |
# File 'lib/shattered_ogrerb/mesh_instance.rb', line 13 def entity @entity end |
#node ⇒ Object (readonly)
Returns the value of attribute node.
13 14 15 |
# File 'lib/shattered_ogrerb/mesh_instance.rb', line 13 def node @node end |
Instance Method Details
#material=(material) ⇒ Object
Set a material on a mesh. You can set rmaterials or names of Ogre materials.
54 55 56 57 58 59 60 |
# File 'lib/shattered_ogrerb/mesh_instance.rb', line 54 def material=(material) if(material.is_a? String) self.set_material_name(material) else self.set_material_name(material.get_name) end end |
#visible=(v) ⇒ Object
Entity delegates that map differently
45 46 47 |
# File 'lib/shattered_ogrerb/mesh_instance.rb', line 45 def visible=(v) entity.set_visible v end |
#visible? ⇒ Boolean
49 50 51 |
# File 'lib/shattered_ogrerb/mesh_instance.rb', line 49 def visible? entity.is_visible end |