shattered_ogrerb 0.5.0.1 → 0.5.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/shattered_ogrerb/mesh_instance.rb +9 -0
- data/vendor/Navi/js3250.dll +0 -0
- data/vendor/Navi/nspr4.dll +0 -0
- data/vendor/Navi/plc4.dll +0 -0
- data/vendor/Navi/plds4.dll +0 -0
- data/vendor/Navi/xpcom.dll +0 -0
- data/vendor/Navi/xul.dll +0 -0
- data/vendor/ogrerb/CHANGELOG +7 -0
- data/vendor/ogrerb/README +7 -2
- data/vendor/ogrerb/Rakefile +98 -10
- data/vendor/ogrerb/build/ogre/extconf.rb +6 -0
- data/vendor/ogrerb/build/ois/extconf.rb +8 -1
- data/vendor/ogrerb/doc_src/ogre.rb +97 -3
- data/vendor/ogrerb/lib/OIS.so +0 -0
- data/vendor/ogrerb/{samples → lib}/application.rb +0 -0
- data/vendor/ogrerb/{samples → lib}/application_frame_listener.rb +1 -1
- data/vendor/ogrerb/{samples → lib}/application_loading_bar.rb +12 -12
- data/vendor/ogrerb/lib/constants.rb +16 -0
- data/vendor/ogrerb/lib/method_fixes.rb +42 -0
- data/vendor/ogrerb/lib/navi.dll +0 -0
- data/vendor/ogrerb/lib/ogre.dll +0 -0
- data/vendor/ogrerb/lib/ogre.so +0 -0
- data/vendor/ogrerb/lib/ruby_ois.dll +0 -0
- data/vendor/ogrerb/lib/ruby_ois.so +0 -0
- data/vendor/ogrerb/ogre/OgreAxisAlignedBox.i +6 -0
- data/vendor/ogrerb/ogre/OgreHardwareIndexBuffer.i +14 -0
- data/vendor/ogrerb/ogre/OgreHardwareVertexBuffer.i +33 -1
- data/vendor/ogrerb/ogre/OgreMaterialManager.i +1 -1
- data/vendor/ogrerb/ogre/OgreMesh.i +32 -0
- data/vendor/ogrerb/ogre/OgreQuaternion.i +5 -0
- data/vendor/ogrerb/ogre/OgreRenderSystemCapabilities.i +4 -0
- data/vendor/ogrerb/ogre/OgreShadowTextureManager.i +6 -1
- data/vendor/ogrerb/ogre/OgreStaticGeometry.i +272 -0
- data/vendor/ogrerb/ogre/OgreStringVector.i +20 -0
- data/vendor/ogrerb/ogre/OgreSubMesh.i +4 -0
- data/vendor/ogrerb/ogre/OgreTextureUnitState.i +3 -0
- data/vendor/ogrerb/ogre/OgreVector4.i +4 -0
- data/vendor/ogrerb/ogre/ogre_rb.i +26 -18
- data/vendor/ogrerb/ogre.rb +5 -3
- data/vendor/ogrerb/samples/bsp.rb +2 -0
- data/vendor/ogrerb/samples/cel_shading.rb +85 -0
- data/vendor/ogrerb/samples/grass.rb +325 -0
- data/vendor/ogrerb/samples/lighting.rb +2 -0
- data/vendor/ogrerb/samples/media/materials/programs/CelShading.cg +63 -0
- data/vendor/ogrerb/samples/media/materials/programs/Grass.cg +30 -0
- data/vendor/ogrerb/samples/media/materials/programs/OffsetMapping.cg +97 -0
- data/vendor/ogrerb/samples/media/materials/programs/OffsetMapping.hlsl +135 -0
- data/vendor/ogrerb/samples/media/materials/programs/OffsetMappingFp.glsl +69 -0
- data/vendor/ogrerb/samples/media/materials/programs/OffsetMappingVp.glsl +54 -0
- data/vendor/ogrerb/samples/media/materials/programs/OffsetMapping_specular.asm +44 -0
- data/vendor/ogrerb/samples/media/materials/scripts/CelShading.material +68 -0
- data/vendor/ogrerb/samples/media/materials/scripts/CubeMapping.material +34 -0
- data/vendor/ogrerb/samples/media/materials/scripts/Grass.material +63 -0
- data/vendor/ogrerb/samples/media/materials/scripts/Offset.material +124 -0
- data/vendor/ogrerb/samples/media/materials/scripts/RZR-002.material +15 -0
- data/vendor/ogrerb/samples/media/materials/textures/RZR-002.png +0 -0
- data/vendor/ogrerb/samples/media/materials/textures/cel_shading_diffuse.png +0 -0
- data/vendor/ogrerb/samples/media/materials/textures/cel_shading_edge.png +0 -0
- data/vendor/ogrerb/samples/media/materials/textures/cel_shading_specular.png +0 -0
- data/vendor/ogrerb/samples/media/materials/textures/gras_02.png +0 -0
- data/vendor/ogrerb/samples/media/materials/textures/grass_1024.jpg +0 -0
- data/vendor/ogrerb/samples/media/materials/textures/rockwall.tga +0 -0
- data/vendor/ogrerb/samples/media/materials/textures/rockwall_NH.tga +0 -0
- data/vendor/ogrerb/samples/media/models/RZR-002.mesh +0 -0
- data/vendor/ogrerb/samples/media/models/geosphere4500.mesh +0 -0
- data/vendor/ogrerb/samples/media/models/geosphere8000.mesh +0 -0
- data/vendor/ogrerb/samples/media/models/sphere.mesh +0 -0
- data/vendor/ogrerb/samples/media/overlays/CubeMapping.overlay +139 -0
- data/vendor/ogrerb/samples/media.cfg +22 -0
- data/vendor/ogrerb/samples/plugins.cfg +1 -0
- data/vendor/ogrerb/samples/render_to_texture.rb +2 -0
- data/vendor/ogrerb/samples/resources.cfg +2 -0
- data/vendor/ogrerb/samples/sky_box.rb +2 -0
- data/vendor/ogrerb/samples/sky_dome.rb +2 -0
- data/vendor/ogrerb/samples/sky_plane.rb +3 -0
- data/vendor/ogrerb/samples/smoke.rb +2 -0
- data/vendor/ogrerb/samples/work/cube_mapping.rb +686 -0
- data/vendor/ogrerb/src_headers/wrappers/IndexBufferProxy.h +49 -0
- data/vendor/ogrerb/src_headers/wrappers/StaticGeometryProxies.h +867 -0
- data/vendor/ogrerb/src_headers/wrappers/VertexBufferProxy.h +245 -0
- data/vendor/ogrerb/website/index.html +9 -0
- metadata +54 -6
@@ -88,5 +88,14 @@ module Ogre
|
|
88
88
|
entity.is_visible
|
89
89
|
end
|
90
90
|
|
91
|
+
# Set a material on a mesh. You can set rmaterials or names of Ogre materials.
|
92
|
+
def material=(material)
|
93
|
+
if(material.is_a? String)
|
94
|
+
self.set_material_name(material)
|
95
|
+
else
|
96
|
+
self.set_material_name(material.get_name)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
91
100
|
end
|
92
101
|
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/vendor/Navi/xul.dll
ADDED
Binary file
|
data/vendor/ogrerb/README
CHANGED
@@ -32,7 +32,7 @@ part of a sample application.
|
|
32
32
|
* rake
|
33
33
|
* Ogre 1.4.x (Eihort)
|
34
34
|
* OIS
|
35
|
-
* swig 1.3.
|
35
|
+
* swig 1.3.31+ (uses -autorename)
|
36
36
|
* pkg-config (Linux)
|
37
37
|
|
38
38
|
== Build Steps
|
@@ -45,7 +45,12 @@ The resulting files can be found in ogrerb/lib.
|
|
45
45
|
|
46
46
|
=== Mac
|
47
47
|
|
48
|
-
|
48
|
+
rake build_all
|
49
|
+
|
50
|
+
The resulting frameworks will be located in ogrerb/lib.
|
51
|
+
|
52
|
+
You will need to run the build_mac_rubyw Rake task, which creates a rubyw executable that's fit for opening
|
53
|
+
up windows in the foreground. See http://rubyforge.org/forum/forum.php?thread_id=15371&forum_id=14174 for details.
|
49
54
|
|
50
55
|
=== Windows
|
51
56
|
|
data/vendor/ogrerb/Rakefile
CHANGED
@@ -1,21 +1,34 @@
|
|
1
1
|
require 'rake/testtask'
|
2
2
|
require 'rake/rdoctask'
|
3
3
|
require 'rake/contrib/sshpublisher'
|
4
|
+
require 'rake/gempackagetask'
|
4
5
|
|
5
6
|
require 'platform'
|
6
7
|
|
7
8
|
task :default => :build_all
|
8
9
|
|
10
|
+
OGRE_RB_VERSION = "0.1"
|
11
|
+
|
9
12
|
###########################
|
10
13
|
# Project Managment tasks #
|
11
14
|
###########################
|
12
15
|
|
16
|
+
RDOC_INCLUDES = %w(
|
17
|
+
README
|
18
|
+
doc_src/**/*.rb
|
19
|
+
lib/application.rb
|
20
|
+
lib/application_frame_listener.rb
|
21
|
+
lib/application_loading_bar.rb
|
22
|
+
lib/constants.rb
|
23
|
+
lib/method_fixes.rb
|
24
|
+
)
|
25
|
+
|
26
|
+
RDOC_OPTIONS = ['-S', '-t Ogre.rb Documentation']
|
27
|
+
|
13
28
|
Rake::RDocTask.new do |t|
|
14
29
|
t.main = "README"
|
15
|
-
|
16
|
-
|
17
|
-
t.rdoc_files.exclude("doc_src/application.rb", "doc_src/application_frame_listener.rb")
|
18
|
-
t.rdoc_files.include("samples/application.rb", "samples/application_frame_listener.rb")
|
30
|
+
t.rdoc_files.include(RDOC_INCLUDES)
|
31
|
+
t.options += RDOC_OPTIONS
|
19
32
|
end
|
20
33
|
|
21
34
|
RUBYFORGE_USERNAME = "jameskilton"
|
@@ -33,19 +46,85 @@ task :upload_web => :rdoc do |t|
|
|
33
46
|
rm_rf "publish"
|
34
47
|
end
|
35
48
|
|
49
|
+
## Gem Compilation ##
|
50
|
+
ogre_rb_spec = Gem::Specification.new do |s|
|
51
|
+
|
52
|
+
s.platform = Gem::Platform::CURRENT
|
53
|
+
|
54
|
+
lib_files = ""
|
55
|
+
if Platform.windows?
|
56
|
+
lib_files = %w(lib/ogre.dll lib/ruby_ois.dll)
|
57
|
+
elsif Platform.mac?
|
58
|
+
lib_files = %w(lib/ogre.bundle lib/ruby_ois.bundle)
|
59
|
+
else # Posix environment
|
60
|
+
lib_files = %w(lib/ogre.so lib/ruby_ois.so)
|
61
|
+
end
|
62
|
+
|
63
|
+
s.name = 'ogre.rb'
|
64
|
+
s.version = OGRE_RB_VERSION
|
65
|
+
s.summary = "Ruby wrapper for Ogre 3D"
|
66
|
+
s.description = %q{Ogre.rb is a SWIG wrapper to allow access to the Ogre 3D API from Ruby.}
|
67
|
+
|
68
|
+
s.author = "Jason Roelofs"
|
69
|
+
s.email = "jameskilton@gmail.com"
|
70
|
+
s.rubyforge_project = 'ogrerb'
|
71
|
+
s.homepage = 'http://ogrerb.rubyforge.org'
|
72
|
+
|
73
|
+
s.require_path = '.'
|
74
|
+
|
75
|
+
s.required_ruby_version = '>= 1.8.4'
|
76
|
+
|
77
|
+
# Inform of the need to have Ogre installed and OGRE_HOME set
|
78
|
+
s.requirements << "Ogre Einhort (1.4)"
|
79
|
+
s.requirements << "Environment variable OGRE_HOME set"
|
80
|
+
|
81
|
+
#s.has_rdoc = false
|
82
|
+
#s.extra_rdoc_files += RDOC_INCLUDES
|
83
|
+
#s.rdoc_options += RDOC_OPTIONS
|
84
|
+
|
85
|
+
files = FileList.new %w(
|
86
|
+
README
|
87
|
+
platform.rb
|
88
|
+
ogre.rb
|
89
|
+
Rakefile
|
90
|
+
lib/*.rb
|
91
|
+
samples/**/*
|
92
|
+
doc_src/**/*
|
93
|
+
) do |fl|
|
94
|
+
fl.exclude(/navi/)
|
95
|
+
end
|
96
|
+
|
97
|
+
files += lib_files
|
98
|
+
|
99
|
+
s.files = files
|
100
|
+
end
|
101
|
+
|
102
|
+
desc 'Package as gem & zip'
|
103
|
+
Rake::GemPackageTask.new(ogre_rb_spec) do |p|
|
104
|
+
p.gem_spec = ogre_rb_spec
|
105
|
+
end
|
36
106
|
|
37
107
|
#############################
|
38
108
|
# Project compilation tasks #
|
39
109
|
#############################
|
40
110
|
|
41
|
-
desc "Rebuild the OGRE and OIS wrappers"
|
111
|
+
desc "Rebuild the OGRE and OIS wrappers. Does not work on Windows."
|
42
112
|
task :build_all => ["ogre:build", "ois:build"]
|
43
113
|
|
44
114
|
desc "Clean everything"
|
45
115
|
task :clean_all => ["ogre:clean", "ois:clean"]
|
46
116
|
|
117
|
+
desc "Build rubyw on the mac platform, needed for ogrerb to run properly."
|
118
|
+
task :build_mac_rubyw do
|
119
|
+
if Platform.mac?
|
120
|
+
sh "ruby=`which ruby`; rubyw=${ruby}w; sudo cp $ruby $rubyw; sudo /Developer/Tools/Rez -t APPL Carbon.r -o $rubyw"
|
121
|
+
else
|
122
|
+
puts "This is only to be run on Mac OS X"
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
47
126
|
namespace :ois do
|
48
|
-
desc "Rebuild all of the OIS wrapper"
|
127
|
+
desc "Rebuild all of the OIS wrapper. Does not work on Windows."
|
49
128
|
task :build => [:swig, :compile]
|
50
129
|
|
51
130
|
desc "Run swig on the interface files"
|
@@ -75,7 +154,11 @@ namespace :ois do
|
|
75
154
|
sh "mt.exe /manifest #{resulting_file}.manifest /outputresource:#{resulting_file};#2"
|
76
155
|
resulting_file = "ruby_ois.dll"
|
77
156
|
build_file = "ruby_ois.so"
|
78
|
-
|
157
|
+
elsif Platform.mac?
|
158
|
+
sh "make all"
|
159
|
+
resulting_file = "ruby_ois.bundle"
|
160
|
+
build_file = "ruby_ois.bundle"
|
161
|
+
else
|
79
162
|
raise "Error: Unsupported platform " + PLATFORM
|
80
163
|
end
|
81
164
|
cp build_file, File.join("..", "..", "lib", resulting_file)
|
@@ -94,7 +177,7 @@ end
|
|
94
177
|
|
95
178
|
namespace :ogre do
|
96
179
|
|
97
|
-
desc "Rebuild all of ogre.rb"
|
180
|
+
desc "Rebuild all of ogre.rb. Does not work on Windows."
|
98
181
|
task :build => [:swig, :compile]
|
99
182
|
|
100
183
|
desc "Run swig on the interface files"
|
@@ -115,6 +198,7 @@ namespace :ogre do
|
|
115
198
|
desc "Compile the extension and move the resulting library into lib/"
|
116
199
|
task :compile do
|
117
200
|
resulting_file = "ogre.so"
|
201
|
+
build_file = resulting_file
|
118
202
|
cd "build/ogre" do
|
119
203
|
ruby "extconf.rb"
|
120
204
|
if Platform.linux?
|
@@ -124,10 +208,14 @@ namespace :ogre do
|
|
124
208
|
# Create our manifest (see http://www.codeproject.com/cpp/vcredists_x86.asp)
|
125
209
|
sh "mt.exe /manifest ogre.so.manifest /outputresource:ogre.so;#2"
|
126
210
|
resulting_file = "ogre.dll"
|
127
|
-
|
211
|
+
elsif Platform.mac?
|
212
|
+
sh "make clean all"
|
213
|
+
resulting_file = "ogre.bundle"
|
214
|
+
build_file = "ogre.bundle"
|
215
|
+
else
|
128
216
|
raise "Error: Unsupported platform " + PLATFORM
|
129
217
|
end
|
130
|
-
cp
|
218
|
+
cp build_file, File.join("..", "..", "lib", resulting_file)
|
131
219
|
end
|
132
220
|
end
|
133
221
|
|
@@ -43,6 +43,12 @@ elsif Platform.windows?
|
|
43
43
|
|
44
44
|
append_ld_flags "-libpath:\"#{ENV["OGRE_HOME"]}/lib\""
|
45
45
|
append_ld_flags "OIS.lib"
|
46
|
+
elsif Platform.mac?
|
47
|
+
#Ogre Includes from the framework
|
48
|
+
append_cpp_flags "-I\"/Library/Frameworks/Ogre.framework/Headers\""
|
49
|
+
|
50
|
+
#Ogre Framework
|
51
|
+
append_ld_flags "-framework Ogre"
|
46
52
|
end
|
47
53
|
|
48
54
|
|
@@ -42,7 +42,14 @@ elsif Platform.windows?
|
|
42
42
|
|
43
43
|
append_ld_flags "-libpath:\"#{ENV["OGRE_HOME"]}/lib\""
|
44
44
|
append_ld_flags "OIS.lib"
|
45
|
-
|
45
|
+
|
46
|
+
elsif Platform.mac?
|
47
|
+
#OIS Includes from the framework
|
48
|
+
append_cpp_flags "-I\"/Library/Frameworks/OIS.framework/Headers\" -DOIS_DYNAMIC_LIB"
|
49
|
+
|
50
|
+
#OIS Framework
|
51
|
+
append_ld_flags "-framework OIS"
|
52
|
+
|
46
53
|
end
|
47
54
|
|
48
55
|
create_makefile('ruby_ois')
|
@@ -14,8 +14,8 @@
|
|
14
14
|
#
|
15
15
|
# scene_manager.set_sky_box(true, "CloudySky")
|
16
16
|
#
|
17
|
-
#
|
18
|
-
# though please post a patch if
|
17
|
+
# This documentation will try to cover every method rename that differs from straight undercasing of Ogre method names,
|
18
|
+
# though please post a patch if some are missed.
|
19
19
|
#
|
20
20
|
module Ogre
|
21
21
|
# This class is here to define a few things that were difficult / not
|
@@ -24,7 +24,7 @@ module Ogre
|
|
24
24
|
#
|
25
25
|
# See OgreVector3.i for an example, but basically we need to define these manually
|
26
26
|
# because Ruby always passes references, which causes annoying problems such as:
|
27
|
-
#
|
27
|
+
#
|
28
28
|
# vec1 = Ogre::Vector3.ZERO
|
29
29
|
# vec1.x = 10
|
30
30
|
# vec2 = Ogre::Vector3.ZERO
|
@@ -33,6 +33,8 @@ module Ogre
|
|
33
33
|
# Current classes with constants redefined as methods in lib/constants.rb:
|
34
34
|
#
|
35
35
|
# Vector3
|
36
|
+
# Vector4
|
37
|
+
# Quaternion
|
36
38
|
#
|
37
39
|
module Constants
|
38
40
|
end
|
@@ -97,6 +99,11 @@ module Ogre
|
|
97
99
|
|
98
100
|
class Singleton
|
99
101
|
# Renamed: getSingleton
|
102
|
+
#
|
103
|
+
# In following the Ruby-way, singletons are to be accessed as such:
|
104
|
+
#
|
105
|
+
# MeshManager.instance.create_mesh
|
106
|
+
#
|
100
107
|
def self.instance
|
101
108
|
end
|
102
109
|
end
|
@@ -149,4 +156,91 @@ module Ogre
|
|
149
156
|
end
|
150
157
|
end
|
151
158
|
end
|
159
|
+
|
160
|
+
# Hardware buffers are an especially interesting problem when it comes to duplicating functionality in Ruby.
|
161
|
+
# Buffers like Vertex and Index buffers are meant to be directly accessible and in a contiguous memory location.
|
162
|
+
# This allows the Ogre C++ code to populate these buffers as such
|
163
|
+
#
|
164
|
+
# // position
|
165
|
+
# *pReal++ = -vec.x;
|
166
|
+
# *pReal++ = GRASS_HEIGHT;
|
167
|
+
# *pReal++ = -vec.z;
|
168
|
+
# // normal
|
169
|
+
# *pReal++ = 0;
|
170
|
+
# *pReal++ = 1;
|
171
|
+
# *pReal++ = 0;
|
172
|
+
# // uv
|
173
|
+
# *pReal++ = 0;
|
174
|
+
# *pReal++ = 0;
|
175
|
+
#
|
176
|
+
# Now we obviously can't do this in Ruby, so Vertex and Index Buffer proxy classes have been put together to
|
177
|
+
# allow the above code to become this following in Ruby
|
178
|
+
#
|
179
|
+
# x = i * 32
|
180
|
+
# # Position
|
181
|
+
# reals[x + 0] = -vec.x
|
182
|
+
# reals[x + 1] = GRASS_HEIGHT
|
183
|
+
# reals[x + 2] = -vec.z
|
184
|
+
# # Normal
|
185
|
+
# reals[x + 3] = 0
|
186
|
+
# reals[x + 4] = 1
|
187
|
+
# reals[x + 5] = 0
|
188
|
+
# # UV
|
189
|
+
# reals[x + 6] = 0
|
190
|
+
# reals[x + 7] = 0
|
191
|
+
#
|
192
|
+
# Compare the Ogre Grass demo with the Ogre.rb Grass demo to see the full code
|
193
|
+
class HardwareBuffer
|
194
|
+
end
|
195
|
+
|
196
|
+
# See HardwareBuffer
|
197
|
+
class HardwareVertexBuffer < HardwareBuffer
|
198
|
+
# For now this should be the only lock method used. It returns a VertexBufferProxy which
|
199
|
+
# allows the array-like access
|
200
|
+
def lock(lock_options)
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
# See HardwareBuffer
|
205
|
+
class HardwareIndexBuffer < HardwareBuffer
|
206
|
+
# For now this should be the only lock method used. It returns an IndexBufferProxy which
|
207
|
+
# allows the array-like access
|
208
|
+
def lock(lock_options)
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
|
213
|
+
# The StaticGeometry class contains a lot of nested classes to deal with all of the parts that could possible
|
214
|
+
# be in a piece of static geometry. This of course poses a serious problem with wrapping as SWIG cannot handle
|
215
|
+
# nested classes. The solution here is to create proxy classes for all of the nested classes and use those instead.
|
216
|
+
# The normal API of using StaticGeometry has not changed, just the names of the classes that will be dealt with.
|
217
|
+
#
|
218
|
+
# This proxy code was taken from OgreDotNet and still needs some work to make it fit nicely into the Ruby way of
|
219
|
+
# doing things. If something isn't quite right, please look at OgreStaticGeometry.i and StaticGeometryProxies.h
|
220
|
+
# to see what methods are available.
|
221
|
+
#
|
222
|
+
# See the Grass demo for example usage.
|
223
|
+
class StaticGeometry
|
224
|
+
# Proxy for the StaticGeometry::GeometryBucket class
|
225
|
+
class SGGeometryBucket
|
226
|
+
# Returns the underlying GeometryBucket class as a Renderable object
|
227
|
+
def as_renderable
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
231
|
+
# Proxy for the StaticGeometry::MaterialBucket class
|
232
|
+
class SGMaterialBucket
|
233
|
+
end
|
234
|
+
|
235
|
+
# Proxy for the StaticGeometry::LODBucket class
|
236
|
+
class SGLODBucket
|
237
|
+
end
|
238
|
+
|
239
|
+
# Proxy for the StaticGeometry::Region class
|
240
|
+
class SGRegion
|
241
|
+
# Returns the underlying Region class as a MovableObject
|
242
|
+
def as_movable_object
|
243
|
+
end
|
244
|
+
end
|
245
|
+
end
|
152
246
|
end
|
Binary file
|
File without changes
|
@@ -111,7 +111,7 @@ module Ogre
|
|
111
111
|
# Most likely won't have a joystick here, so just throw away any exceptions
|
112
112
|
@joy_stick = nil
|
113
113
|
begin
|
114
|
-
@joy_stick = @input_manager.create_input_object( OIS::OISJoyStick, buffered_joy)
|
114
|
+
@joy_stick = @input_manager.create_input_object( OIS::OISJoyStick, buffered_joy) unless Platform.mac?
|
115
115
|
rescue
|
116
116
|
end
|
117
117
|
|
@@ -2,19 +2,19 @@ module Ogre
|
|
2
2
|
|
3
3
|
# From Ogre's ExampleLoadingBar:
|
4
4
|
#
|
5
|
-
# Defines an example loading progress bar which you can use during
|
6
|
-
#
|
5
|
+
# Defines an example loading progress bar which you can use during
|
6
|
+
# startup, level changes etc to display loading progress.
|
7
7
|
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
8
|
+
# Basically you just need to create an instance of this class, call start()
|
9
|
+
# before loading and finish() afterwards. You may also need to stop areas of
|
10
|
+
# your scene rendering in between since this method will call
|
11
|
+
# RenderWindow::update() to update the display of the bar - we advise using
|
12
|
+
# SceneManager's 'special case render queues' for this, see
|
13
|
+
# SceneManager::addSpecialCaseRenderQueue for details.
|
14
|
+
#
|
15
|
+
# This progress bar relies on you having the OgreCore.zip package already
|
16
|
+
# added to a resource group called 'Bootstrap' - this provides the basic
|
17
|
+
# resources required for the progress bar and will be loaded automatically.
|
18
18
|
class ApplicationLoadingBar < ResourceGroupListenerProxy
|
19
19
|
|
20
20
|
def start(window, num_groups_init = 1, num_groups_load = 1, initial_proportion = 0.7)
|
@@ -32,4 +32,20 @@ module Ogre
|
|
32
32
|
Vector3.new(1, 1, 1)
|
33
33
|
end
|
34
34
|
end
|
35
|
+
|
36
|
+
class Vector4
|
37
|
+
def self.ZERO
|
38
|
+
Vector4.new(0,0,0,0)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
class Quaternion
|
43
|
+
def self.ZERO
|
44
|
+
Quaternion.new(0.0,0.0,0.0,0.0)
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.IDENTITY
|
48
|
+
Quaternion.new(1.0,0.0,0.0,0.0)
|
49
|
+
end
|
50
|
+
end
|
35
51
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Ogre
|
2
|
+
|
3
|
+
class SubMesh
|
4
|
+
alias_method :use_shared_vertices?, :useSharedVertices
|
5
|
+
alias_method :use_shared_vertices=, :useSharedVertices=
|
6
|
+
|
7
|
+
alias_method :vertex_data, :vertexData
|
8
|
+
alias_method :vertex_data=, :vertexData=
|
9
|
+
|
10
|
+
alias_method :index_data, :indexData
|
11
|
+
alias_method :index_data=, :indexData=
|
12
|
+
|
13
|
+
# SubMesh is a friend of Mesh, not a subclass...
|
14
|
+
#alias_method :shared_vertex_data, :sharedVertexData
|
15
|
+
#alias_method :shared_vertex_data=, :sharedVertexData=
|
16
|
+
end
|
17
|
+
|
18
|
+
class VertexData
|
19
|
+
alias_method :vertex_declaration, :vertexDeclaration
|
20
|
+
alias_method :vertex_declaration=, :vertexDeclaration=
|
21
|
+
|
22
|
+
alias_method :vertex_buffer_binding, :vertexBufferBinding
|
23
|
+
alias_method :vertex_buffer_binding=, :vertexBufferBinding=
|
24
|
+
|
25
|
+
alias_method :vertex_start, :vertexStart
|
26
|
+
alias_method :vertex_start=, :vertexStart=
|
27
|
+
|
28
|
+
alias_method :vertex_count, :vertexCount
|
29
|
+
alias_method :vertex_count=, :vertexCount=
|
30
|
+
end
|
31
|
+
|
32
|
+
class IndexData
|
33
|
+
alias_method :index_buffer, :indexBuffer
|
34
|
+
alias_method :index_buffer=, :indexBuffer=
|
35
|
+
|
36
|
+
alias_method :index_start, :indexStart
|
37
|
+
alias_method :index_start=, :indexStart=
|
38
|
+
|
39
|
+
alias_method :index_count, :indexCount
|
40
|
+
alias_method :index_count=, :indexCount=
|
41
|
+
end
|
42
|
+
end
|
Binary file
|
data/vendor/ogrerb/lib/ogre.dll
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,9 +1,23 @@
|
|
1
1
|
%{
|
2
2
|
#include "OgreHardwareIndexBuffer.h"
|
3
|
+
#include "IndexBufferProxy.h"
|
3
4
|
%}
|
4
5
|
|
5
6
|
namespace Ogre {
|
6
7
|
%template(HardwareIndexBufferSharedPtrSWIG) SharedPtr<HardwareIndexBuffer>;
|
8
|
+
|
9
|
+
/**
|
10
|
+
* Taken from pyogre, we need a special proxy object for dealing with locked
|
11
|
+
* memory buffers. The normal C++ code has pointer access, and can just increment (++)
|
12
|
+
* through memory. As we can't do that in Ruby, we'll proxy off the calls back
|
13
|
+
* into C++
|
14
|
+
*/
|
15
|
+
%extend HardwareIndexBuffer {
|
16
|
+
IndexBufferProxy lock(HardwareBuffer::LockOptions options) {
|
17
|
+
return IndexBufferProxy(self, self->lock(options), self->getNumIndexes());
|
18
|
+
}
|
19
|
+
}
|
7
20
|
}
|
8
21
|
|
9
22
|
%include "OgreHardwareIndexBuffer.h"
|
23
|
+
%include "IndexBufferProxy.h"
|
@@ -1,10 +1,42 @@
|
|
1
1
|
%{
|
2
2
|
#include "OgreHardwareVertexBuffer.h"
|
3
|
+
#include "VertexBufferProxy.h"
|
3
4
|
%}
|
4
5
|
|
5
6
|
namespace Ogre {
|
6
7
|
%template(HardwareVertexBufferSharedPtrSWIG) SharedPtr<HardwareVertexBuffer>;
|
8
|
+
|
9
|
+
/**
|
10
|
+
* Turn lists into normal Ruby arrays
|
11
|
+
*/
|
12
|
+
%typemap(out) const VertexDeclaration::VertexElementList& {
|
13
|
+
VALUE arr = rb_ary_new2($1->size());
|
14
|
+
VALUE res = Qnil;
|
15
|
+
|
16
|
+
int size = $1->size();
|
17
|
+
std::list<VertexElement>::iterator i = $1->begin();
|
18
|
+
for(; i != $1->end(); i++) {
|
19
|
+
res = SWIG_NewPointerObj( &(*i), SWIGTYPE_p_Ogre__VertexElement, 0);
|
20
|
+
rb_ary_push(arr, res);
|
21
|
+
}
|
22
|
+
|
23
|
+
$result = arr;
|
24
|
+
}
|
25
|
+
|
26
|
+
%ignore HardwareVertexBuffer::lock(LockOptions options);
|
27
|
+
|
28
|
+
/**
|
29
|
+
* Taken from pyogre, we need a special proxy object for dealing with locked
|
30
|
+
* memory buffers. The normal C++ code has pointer access, and can just increment (++)
|
31
|
+
* through memory. As we can't do that in Ruby, we'll proxy off the calls back
|
32
|
+
* into C++
|
33
|
+
*/
|
34
|
+
%extend HardwareVertexBuffer {
|
35
|
+
VertexBufferProxy lock(HardwareBuffer::LockOptions options) {
|
36
|
+
return VertexBufferProxy(self, self->lock(options));
|
37
|
+
}
|
38
|
+
}
|
7
39
|
}
|
8
40
|
|
9
41
|
%include "OgreHardwareVertexBuffer.h"
|
10
|
-
|
42
|
+
%include "VertexBufferProxy.h"
|
@@ -6,6 +6,38 @@ namespace Ogre {
|
|
6
6
|
%template(MeshSharedPtr) SharedPtr<Mesh>;
|
7
7
|
|
8
8
|
%ignore Mesh::getPoseIterator;
|
9
|
+
|
10
|
+
%rename("shared_vertex_data=") Mesh::set_shared_vertex_data;
|
11
|
+
|
12
|
+
// These typemaps are supposed to work! but as they don't we'll just wrap
|
13
|
+
// the method manually :(
|
14
|
+
//
|
15
|
+
// Set appropriate OUTPUT parameters
|
16
|
+
//%apply unsigned short& OUTPUT { unsigned short &outSourceCoordSet };
|
17
|
+
//%apply unsigned short& OUTPUT { unsigned short &outIndex };
|
18
|
+
//bool MeshPtr::suggestTangentVectorBuildParams(VertexElementSemantic, unsigned short& OUTPUT, unsigned short &OUTPUT);
|
19
|
+
|
20
|
+
%extend Mesh {
|
21
|
+
VertexData* shared_vertex_data() {
|
22
|
+
return self->sharedVertexData;
|
23
|
+
}
|
24
|
+
|
25
|
+
void set_shared_vertex_data(VertexData* vd) {
|
26
|
+
self->sharedVertexData = vd;
|
27
|
+
}
|
28
|
+
|
29
|
+
VALUE suggestTangentVectorBuildParams(VertexElementSemantic semantic) {
|
30
|
+
VALUE res = rb_ary_new2(3);
|
31
|
+
unsigned short sourceCoordSet, outIndex;
|
32
|
+
bool result = self-> suggestTangentVectorBuildParams(semantic, sourceCoordSet, outIndex);
|
33
|
+
rb_ary_push(res, result ? Qtrue : Qfalse);
|
34
|
+
rb_ary_push(res, INT2NUM(sourceCoordSet));
|
35
|
+
rb_ary_push(res, INT2NUM(outIndex));
|
36
|
+
return res;
|
37
|
+
}
|
38
|
+
}
|
9
39
|
}
|
10
40
|
|
41
|
+
%ignore Ogre::Mesh::suggestTangentVectorBuildParams(VertexElementSemantic, unsigned short&, unsigned short&);
|
42
|
+
|
11
43
|
%include "OgreMesh.h"
|