Method: Ogre::MeshInstance#initialize
- Defined in:
- lib/shattered_view/ogrerb/mesh_instance.rb
#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 25 |
# File 'lib/shattered_view/ogrerb/mesh_instance.rb', line 14 def initialize(parent, scene_manager, mesh_name, ={}) @@entity_count ||= 0 @scene_manager = scene_manager @parent = parent @node = parent.create_child_scene_node("#{parent.to_s}.node(#{parent.num_children})") # 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 |