ogre.rb 0.1-i386-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. data/README +79 -0
  2. data/Rakefile +291 -0
  3. data/doc_src/ogre.rb +246 -0
  4. data/doc_src/ois.rb +67 -0
  5. data/lib/application.rb +146 -0
  6. data/lib/application_frame_listener.rb +302 -0
  7. data/lib/application_loading_bar.rb +115 -0
  8. data/lib/constants.rb +51 -0
  9. data/lib/method_fixes.rb +42 -0
  10. data/lib/ogre.dll +0 -0
  11. data/lib/ruby_ois.dll +0 -0
  12. data/ogre.rb +25 -0
  13. data/platform.rb +23 -0
  14. data/samples/Ogre.log +279 -0
  15. data/samples/bsp.rb +76 -0
  16. data/samples/cg.dll +0 -0
  17. data/samples/grass.rb +325 -0
  18. data/samples/js3250.dll +0 -0
  19. data/samples/lighting.rb +138 -0
  20. data/samples/media/materials/programs/Grass.cg +30 -0
  21. data/samples/media/materials/programs/OffsetMapping.cg +97 -0
  22. data/samples/media/materials/programs/OffsetMapping.hlsl +135 -0
  23. data/samples/media/materials/programs/OffsetMappingFp.glsl +69 -0
  24. data/samples/media/materials/programs/OffsetMappingVp.glsl +54 -0
  25. data/samples/media/materials/programs/OffsetMapping_specular.asm +44 -0
  26. data/samples/media/materials/scripts/CloudySky.material +17 -0
  27. data/samples/media/materials/scripts/CubeMapping.material +34 -0
  28. data/samples/media/materials/scripts/Flare.material +17 -0
  29. data/samples/media/materials/scripts/Grass.material +63 -0
  30. data/samples/media/materials/scripts/Knot.material +14 -0
  31. data/samples/media/materials/scripts/MorningSkyBox.material +17 -0
  32. data/samples/media/materials/scripts/Offset.material +124 -0
  33. data/samples/media/materials/scripts/Ogre.material +119 -0
  34. data/samples/media/materials/scripts/RZR-002.material +15 -0
  35. data/samples/media/materials/scripts/Razor.material +14 -0
  36. data/samples/media/materials/scripts/Ribbon.material +19 -0
  37. data/samples/media/materials/scripts/RustySteel.material +14 -0
  38. data/samples/media/materials/scripts/SpaceSkyBox.material +17 -0
  39. data/samples/media/materials/scripts/SpaceSkyPlane.material +17 -0
  40. data/samples/media/materials/scripts/TextureEffects.material +15 -0
  41. data/samples/media/materials/scripts/dragon.material +42 -0
  42. data/samples/media/materials/scripts/smoke.material +18 -0
  43. data/samples/media/materials/textures/GreenSkin.jpg +0 -0
  44. data/samples/media/materials/textures/MtlPlat2.jpg +0 -0
  45. data/samples/media/materials/textures/RZR-002.png +0 -0
  46. data/samples/media/materials/textures/RustedMetal.jpg +0 -0
  47. data/samples/media/materials/textures/RustySteel.jpg +0 -0
  48. data/samples/media/materials/textures/Thumbs.db +0 -0
  49. data/samples/media/materials/textures/Water02.jpg +0 -0
  50. data/samples/media/materials/textures/WeirdEye.png +0 -0
  51. data/samples/media/materials/textures/clouds.jpg +0 -0
  52. data/samples/media/materials/textures/cursor.png +0 -0
  53. data/samples/media/materials/textures/dirt01.jpg +0 -0
  54. data/samples/media/materials/textures/flare.png +0 -0
  55. data/samples/media/materials/textures/gras_02.png +0 -0
  56. data/samples/media/materials/textures/grass_1024.jpg +0 -0
  57. data/samples/media/materials/textures/ogreborder.png +0 -0
  58. data/samples/media/materials/textures/ogreborderUp.png +0 -0
  59. data/samples/media/materials/textures/ribbonband.png +0 -0
  60. data/samples/media/materials/textures/rockwall.tga +0 -0
  61. data/samples/media/materials/textures/rockwall_NH.tga +0 -0
  62. data/samples/media/materials/textures/smoke.png +0 -0
  63. data/samples/media/materials/textures/smokecolors.png +0 -0
  64. data/samples/media/materials/textures/spacesky.jpg +0 -0
  65. data/samples/media/materials/textures/spheremap.png +0 -0
  66. data/samples/media/materials/textures/texmap2.jpg +0 -0
  67. data/samples/media/models/RZR-002.mesh +0 -0
  68. data/samples/media/models/geosphere4500.mesh +0 -0
  69. data/samples/media/models/geosphere8000.mesh +0 -0
  70. data/samples/media/models/knot.mesh +0 -0
  71. data/samples/media/models/ogrehead.mesh +0 -0
  72. data/samples/media/models/razor.mesh +0 -0
  73. data/samples/media/models/sphere.mesh +0 -0
  74. data/samples/media/overlays/CubeMapping.overlay +139 -0
  75. data/samples/media/packs/OgreCore.zip +0 -0
  76. data/samples/media/packs/chiropteraDM.pk3 +0 -0
  77. data/samples/media/packs/chiropteraDM.txt +99 -0
  78. data/samples/media/packs/cubemap.zip +0 -0
  79. data/samples/media/packs/cubemapsJS.zip +0 -0
  80. data/samples/media/packs/dragon.zip +0 -0
  81. data/samples/media/packs/skybox.zip +0 -0
  82. data/samples/media/particles/smoke.particle +43 -0
  83. data/samples/media.cfg +22 -0
  84. data/samples/ogre.cfg +19 -0
  85. data/samples/plugins.cfg +12 -0
  86. data/samples/quake3settings.cfg +2 -0
  87. data/samples/render_to_texture.rb +161 -0
  88. data/samples/resources.cfg +16 -0
  89. data/samples/sky_box.rb +107 -0
  90. data/samples/sky_dome.rb +86 -0
  91. data/samples/sky_plane.rb +27 -0
  92. data/samples/smoke.rb +23 -0
  93. data/samples/work/cube_mapping.rb +686 -0
  94. metadata +149 -0
@@ -0,0 +1,86 @@
1
+ #!/usr/bin/ruby -w
2
+
3
+ $: << File.dirname(__FILE__) + "/.."
4
+ require 'ogre'
5
+ require 'application'
6
+ include Ogre
7
+
8
+ class SkyDomeListener < ApplicationFrameListener
9
+ def initialize(root, window, camera, scene_manager)
10
+ super(root, window, camera)
11
+ @scene_manager = scene_manager
12
+ @curvature = 1
13
+ @tiling = 15
14
+
15
+ @time_delay = 0
16
+ end
17
+
18
+ def frame_started(event)
19
+ return false unless super(event)
20
+
21
+ update_sky = false
22
+
23
+ if keyboard.key_down?(OIS::KC_H) && @time_delay <= 0
24
+ @curvature += 1
25
+ @time_delay = 0.1
26
+ update_sky = true
27
+ elsif keyboard.key_down?(OIS::KC_G) && @time_delay <= 0
28
+ @curvature -= 1
29
+ @time_delay = 0.1
30
+ update_sky = true
31
+ elsif keyboard.key_down?(OIS::KC_U) && @time_delay <= 0
32
+ @tiling += 1
33
+ @time_delay = 0.1
34
+ update_sky = true
35
+ elsif keyboard.key_down?(OIS::KC_Y) && @time_delay <= 0
36
+ @tiling -= 1
37
+ @time_delay = 0.1
38
+ update_sky = true
39
+ end
40
+
41
+ if @time_delay > 0
42
+ @time_delay -= event.time_since_last_frame
43
+ end
44
+
45
+ if update_sky
46
+ puts "Updating sky with #@curvature and #@tiling"
47
+ @scene_manager.set_sky_dome(true, "CloudySky", @curvature, @tiling)
48
+ end
49
+
50
+ true
51
+ end
52
+ end
53
+
54
+ class SkyDomeApplication < Ogre::Application
55
+
56
+ def create_scene
57
+ scene_manager.set_ambient_light ColourValue.new(0.5, 0.5, 0.5)
58
+ scene_manager.set_sky_dome(true, "CloudySky", 5, 8)
59
+
60
+ light = scene_manager.create_light("MainLight")
61
+ light.set_position Vector3.new(20, 80, 50)
62
+
63
+ p = Plane.new
64
+ p.normal = Vector3.UNIT_Y
65
+ p.d = 200
66
+
67
+ MeshManager.instance.create_plane("FloorPlane",
68
+ ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME, p, 2000, 2000, 1, 1, true,
69
+ 1, 5, 5, Vector3.UNIT_Z)
70
+
71
+ entity = scene_manager.create_entity("floor", "FloorPlane")
72
+ entity.set_material_name "RustySteel"
73
+
74
+ scene_manager.root_scene_node.attach_object(entity)
75
+
76
+ entity = scene_manager.create_entity("head", "ogrehead.mesh")
77
+ scene_manager.root_scene_node.attach_object(entity)
78
+ end
79
+
80
+ def create_frame_listener
81
+ self.frame_listener = SkyDomeListener.new(root, window, camera, scene_manager)
82
+ end
83
+ end
84
+
85
+ app = SkyDomeApplication.new
86
+ app.go
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/ruby -w
2
+
3
+ $: << File.dirname(__FILE__) + "/.."
4
+ require 'ogre'
5
+ require 'application'
6
+
7
+ include Ogre
8
+
9
+ class SkyPlaneApplication < Application
10
+ def create_scene
11
+ scene_manager.set_ambient_light ColourValue.new(0.5, 0.5, 0.5)
12
+
13
+ plane = Plane.new
14
+ plane.d = 5000
15
+ plane.normal = -Vector3.UNIT_Y
16
+ scene_manager.set_sky_plane(true, plane, "SpaceSkyPlane", 10000, 3)
17
+
18
+ light = scene_manager.create_light("MainLight")
19
+ light.set_position(20, 80, 50)
20
+
21
+ dragon = scene_manager.create_entity("dragon", "dragon.mesh")
22
+ scene_manager.root_scene_node.attach_object(dragon)
23
+ end
24
+ end
25
+
26
+ app = SkyPlaneApplication.new
27
+ app.go
data/samples/smoke.rb ADDED
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/ruby -w
2
+
3
+ $: << File.dirname(__FILE__) + "/.."
4
+ require 'ogre'
5
+ require 'application'
6
+
7
+ class ParticleApplication < Ogre::Application
8
+
9
+ def create_scene
10
+ scene_manager.set_ambient_light Ogre::ColourValue.new(0.5, 0.5, 0.5)
11
+ scene_manager.set_sky_dome(true, "CloudySky", 5, 8)
12
+
13
+ @fountain = scene_manager.root_scene_node.create_child_scene_node;
14
+
15
+ @particle_system = scene_manager.create_particle_system("fountain1", "Smoke")
16
+ node = @fountain.create_child_scene_node
17
+ node.attach_object(@particle_system)
18
+ end
19
+
20
+ end
21
+
22
+ app = ParticleApplication.new
23
+ app.go