Module: ShatteredState::ClassMethods
- Defined in:
- lib/shattered_state/base.rb
Instance Method Summary collapse
-
#camera(options = {}) ⇒ Object
In order to set the initial position of the camera, and any other attributes you would like, use the following format.
-
#scene_manager(type) ⇒ Object
:general, :terrain, :nature, :paging, :indoor.
-
#viewport(options = {}) ⇒ Object
Viewports are your windows into the world.
Instance Method Details
#camera(options = {}) ⇒ Object
In order to set the initial position of the camera, and any other attributes you would like, use the following format.
class CameraTestState < ShatteredState::Base
camera :position => v(10,0,0), :near_clip => 10, :far_clip => 100
end
Additional Options:
:position => v(0,0,0) # The initial position of the camera
:name => "StateName" # Internal name within Ogre, usually defaults to the state name.
:look_at => (none) # Looks at a given direction. Will behave as expected with a :position passed in.
:near_clip => 1 # The clip distance when near objects begin to disappear.
:far_clip => 10000 # The clip distance when far objects begin to disappear.
Initially set to just a large number.
27 28 29 |
# File 'lib/shattered_state/base.rb', line 27 def camera( = {}) before_init_call( 'create', :camera, .delete(:name) || self.to_s, ) end |
#scene_manager(type) ⇒ Object
:general, :terrain, :nature, :paging, :indoor
33 34 35 |
# File 'lib/shattered_state/base.rb', line 33 def scene_manager(type) before_init_call( 'create', :scene_manager, type) end |
#viewport(options = {}) ⇒ Object
Viewports are your windows into the world.
Cameras can have many viewports, but usually the relationship is 1-1.
TODO: There are many more viewport options to take care of, including :dimensions, etc. Options:
:color => rgb(0,0,0) # The background color of the viewport.
44 45 46 |
# File 'lib/shattered_state/base.rb', line 44 def ( = {}) before_init_call( 'create', :viewport, ) end |