Permalink
Browse files

Initial project setup, nothing special.

Most content was simply copied from my WebGL demos.
  • Loading branch information...
1 parent 563e523 commit 957ce91bd2a0d1dc97d1f68b4c731e71c936680e @sinisterchipmunk committed Dec 14, 2010
Showing with 8,278 additions and 11 deletions.
  1. +3 −0 .gitignore
  2. +4 −3 Gemfile
  3. +108 −0 Gemfile.lock
  4. +8 −4 README.rdoc
  5. +6 −3 Rakefile
  6. +2 −0 lib/rails-webgl.rb
  7. +38 −0 lib/webgl.rb
  8. +28 −0 lib/webgl/railtie.rb
  9. 0 log/development.log
  10. +12 −0 public/javascripts/control/keycodes.js
  11. +150 −0 public/javascripts/control/mouse_weight.js
  12. +366 −0 public/javascripts/culling/octree.js
  13. +103 −0 public/javascripts/engine/animation.js
  14. +48 −0 public/javascripts/engine/assertions.js
  15. +102 −0 public/javascripts/engine/buffer.js
  16. +392 −0 public/javascripts/engine/camera.js
  17. +69 −0 public/javascripts/engine/canvas_texture.js
  18. +361 −0 public/javascripts/engine/context.js
  19. +272 −0 public/javascripts/engine/core.js
  20. +269 −0 public/javascripts/engine/frustum.js
  21. +295 −0 public/javascripts/engine/heightmap.js
  22. 0 public/javascripts/engine/lighting.js
  23. +301 −0 public/javascripts/engine/mesh.js
  24. +43 −0 public/javascripts/engine/plane.js
  25. +240 −0 public/javascripts/engine/shader.js
  26. +243 −0 public/javascripts/engine/text.js
  27. +99 −0 public/javascripts/engine/texture.js
  28. +270 −0 public/javascripts/engine/vector.js
  29. +36 −0 public/javascripts/engine/video_texture.js
  30. +188 −0 public/javascripts/engine/world.js
  31. +181 −0 public/javascripts/gl-utils.js
  32. +38 −0 public/javascripts/models/actor.js
  33. +78 −0 public/javascripts/models/ai.js
  34. +76 −0 public/javascripts/models/creature.js
  35. +52 −0 public/javascripts/objects/axis.js
  36. +72 −0 public/javascripts/objects/cube.js
  37. +37 −0 public/javascripts/objects/json3d.js
  38. +32 −0 public/javascripts/objects/line.js
  39. +571 −0 public/javascripts/objects/md2.js
  40. +17 −0 public/javascripts/objects/point.js
  41. +36 −0 public/javascripts/objects/quad.js
  42. +266 −0 public/javascripts/objects/renderable.js
  43. +380 −0 public/javascripts/objects/skeleton.js
  44. +85 −0 public/javascripts/objects/sphere.js
  45. +81 −0 public/javascripts/sylvester-ext.js
  46. +1,254 −0 public/javascripts/sylvester.js
  47. +65 −0 public/javascripts/systems/particle_manager.js
  48. +320 −0 public/javascripts/systems/particle_system.js
  49. +188 −0 public/javascripts/tests/engine/camera.js
  50. +23 −0 public/javascripts/tests/engine/core.js
  51. +19 −0 public/javascripts/tests/engine/heightmap.js
  52. 0 public/javascripts/tests/engine/lighting.js
  53. +14 −0 public/javascripts/tests/engine/renderable.js
  54. +45 −0 public/javascripts/tests/engine/shader.js
  55. 0 public/javascripts/tests/engine/world.js
  56. +1 −0 public/javascripts/tests/objects/md2.js
  57. +26 −0 public/javascripts/tests/objects/skeleton.js
  58. 0 public/javascripts/tests/test_helper.js
  59. +82 −0 public/javascripts/webgl.js
  60. +58 −0 spec/javascripts/PlayerSpec.js
  61. +9 −0 spec/javascripts/helpers/SpecHelper.js
  62. +73 −0 spec/javascripts/support/jasmine.yml
  63. +32 −0 spec/javascripts/support/jasmine_runner.rb
  64. +11 −1 spec/spec_helper.rb
View
@@ -1,3 +1,6 @@
+.idea
+
+
# rcov generated
coverage
View
@@ -1,11 +1,12 @@
source "http://rubygems.org"
-# Add dependencies required to use your gem here.
-# Example:
-# gem "activesupport", ">= 2.3.5"
+
+gem 'rails', '~> 3.0'
# Add dependencies to develop your gem here.
# Include everything needed to run rake, tests, features, etc.
group :development do
+ gem 'jasmine'
+ gem 'genspec', '>= 0.2.0.prerails3.2'
gem "rspec", "~> 2.1.0"
gem "bundler", "~> 1.0.0"
gem "jeweler", "~> 1.5.1"
View
@@ -0,0 +1,108 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ abstract (1.0.0)
+ actionmailer (3.0.3)
+ actionpack (= 3.0.3)
+ mail (~> 2.2.9)
+ actionpack (3.0.3)
+ activemodel (= 3.0.3)
+ activesupport (= 3.0.3)
+ builder (~> 2.1.2)
+ erubis (~> 2.6.6)
+ i18n (~> 0.4)
+ rack (~> 1.2.1)
+ rack-mount (~> 0.6.13)
+ rack-test (~> 0.5.6)
+ tzinfo (~> 0.3.23)
+ activemodel (3.0.3)
+ activesupport (= 3.0.3)
+ builder (~> 2.1.2)
+ i18n (~> 0.4)
+ activerecord (3.0.3)
+ activemodel (= 3.0.3)
+ activesupport (= 3.0.3)
+ arel (~> 2.0.2)
+ tzinfo (~> 0.3.23)
+ activeresource (3.0.3)
+ activemodel (= 3.0.3)
+ activesupport (= 3.0.3)
+ activesupport (3.0.3)
+ arel (2.0.6)
+ builder (2.1.2)
+ diff-lcs (1.1.2)
+ erubis (2.6.6)
+ abstract (>= 1.0.0)
+ genspec (0.2.0.prerails3.2)
+ rspec (>= 2.0.0.beta.14)
+ sc-core-ext (>= 1.2.1)
+ git (1.2.5)
+ i18n (0.5.0)
+ jasmine (1.0.1.1)
+ json_pure (>= 1.4.3)
+ rack (>= 1.0.0)
+ rake (>= 0.8.7)
+ rspec (>= 1.1.5)
+ selenium-client (>= 1.2.17)
+ selenium-rc (>= 2.1.0)
+ jeweler (1.5.1)
+ bundler (~> 1.0.0)
+ git (>= 1.2.5)
+ rake
+ json_pure (1.4.6)
+ mail (2.2.12)
+ activesupport (>= 2.3.6)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.16)
+ polyglot (0.3.1)
+ rack (1.2.1)
+ rack-mount (0.6.13)
+ rack (>= 1.0.0)
+ rack-test (0.5.6)
+ rack (>= 1.0)
+ rails (3.0.3)
+ actionmailer (= 3.0.3)
+ actionpack (= 3.0.3)
+ activerecord (= 3.0.3)
+ activeresource (= 3.0.3)
+ activesupport (= 3.0.3)
+ bundler (~> 1.0)
+ railties (= 3.0.3)
+ railties (3.0.3)
+ actionpack (= 3.0.3)
+ activesupport (= 3.0.3)
+ rake (>= 0.8.7)
+ thor (~> 0.14.4)
+ rake (0.8.7)
+ rcov (0.9.9)
+ rspec (2.1.0)
+ rspec-core (~> 2.1.0)
+ rspec-expectations (~> 2.1.0)
+ rspec-mocks (~> 2.1.0)
+ rspec-core (2.1.0)
+ rspec-expectations (2.1.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.1.0)
+ sc-core-ext (1.2.1)
+ activesupport (>= 2.3.5)
+ selenium-client (1.2.18)
+ selenium-rc (2.2.4)
+ selenium-client (>= 1.2.18)
+ thor (0.14.6)
+ treetop (1.4.9)
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.23)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ bundler (~> 1.0.0)
+ genspec (>= 0.2.0.prerails3.2)
+ jasmine
+ jeweler (~> 1.5.1)
+ rails (~> 3.0)
+ rcov
+ rspec (~> 2.1.0)
View
@@ -1,6 +1,10 @@
= webgl
-Description goes here.
+A WebGL framework for Rails. This is the _official_ project spawned from my Rails-based demos, which you can read more
+about at http://github.com/sinisterchipmunk/webgl.
+
+And so far, that's about all there is to say about this project. Check back soon when I have something you can actually
+use.
== Contributing to webgl
@@ -10,10 +14,10 @@ Description goes here.
* Start a feature/bugfix branch
* Commit and push until you are happy with your contribution
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
-* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
+* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise
+ necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
== Copyright
-Copyright (c) 2010 Colin MacKenzie IV. See LICENSE.txt for
-further details.
+Copyright (c) 2010 Colin MacKenzie IV. See LICENSE.txt for further details.
View
@@ -13,10 +13,10 @@ require 'jeweler'
Jeweler::Tasks.new do |gem|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
gem.name = "webgl"
- gem.homepage = "http://github.com/sinisterchipmunk/webgl"
+ gem.homepage = "http://thoughtsincomputation.com"
gem.license = "MIT"
- gem.summary = %Q{TODO: one-line summary of your gem}
- gem.description = %Q{TODO: longer description of your gem}
+ gem.summary = %Q{A WebGL framework for Rails.}
+ gem.description = %Q{A WebGL framework for Rails.}
gem.email = "sinisterchipmunk@gmail.com"
gem.authors = ["Colin MacKenzie IV"]
# Include your dependencies below. Runtime dependencies are required when using your gem,
@@ -48,3 +48,6 @@ Rake::RDocTask.new do |rdoc|
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
+
+require 'jasmine'
+load 'jasmine/tasks/jasmine.rake'
View
@@ -0,0 +1,2 @@
+# For easier require from Rails gemfiles
+require File.join(File.dirname(__FILE__), 'webgl')
View
@@ -0,0 +1,38 @@
+$:.unshift(File.dirname(__FILE__))
+
+require 'rails'
+require 'webgl/railtie'
+
+module WebGL
+ class << self
+ def path
+ File.expand_path(File.join(File.dirname(__FILE__), '..'))
+ end
+
+ def public_path
+ File.join(path, 'public')
+ end
+
+ # Copies static resources (JavaScripts, CSS, etc.) to the Rails public directory.
+ #
+ # IMPORTANT:
+ #
+ # I've decided to replace this method with a manually-fired Rails generator when I get time.
+ # This way I don't step on developers' toes if they make customizations to the static files.
+ #
+ def install
+ Dir[File.join(public_path, '*')].each do |source|
+ dest = File.join(Rails.root, 'public', source.sub(public_path, ''))
+
+ # Don't copy if the dest file exists, and is newer than the source.
+ next if File.file?(dest) && File.stat(dest).mtime >= File.stat(source).mtime
+
+ if File.directory?(source)
+ FileUtils.cp_r source.concat('/.'), dest
+ else
+ FileUtils.cp source, dest
+ end
+ end
+ end
+ end
+end
View
@@ -0,0 +1,28 @@
+module WebGL
+ class Railtie < Rails::Railtie
+# rake_tasks do
+# load 'webgl/rake_tasks.rb'
+# end
+
+ initializer 'webgl' do |config|
+ if Rails.env.production?
+ WebGL.install
+ else
+ config.middleware.use '::ActionDispatch::Static', WebGL.public_path
+ end
+ end
+
+ config.before_configuration do
+ config.action_view.javascript_expansions[:webgl] = Dir[File.join(WebGL.public_path, "javascripts/**/*.js")]
+ end
+
+# generators do
+# require File.join(WebGL.path, "generators/webgl/webgl_generator")
+# end
+
+# config.to_prepare do
+# ApplicationController.helper WebGL::Helper
+# ApplicationController.layout 'name'
+# end
+ end
+end
View
No changes.
@@ -0,0 +1,12 @@
+var KC_BACKSPACE = 8,
+ KC_TAB = 9,
+ KC_ENTER = 13,
+ KC_SHIFT = 16,
+ KC_CTRL = 17,
+ KC_ALT = 18,
+ KC_PAUSE = 19,
+ KC_BREAK = 19,
+ KC_PAUSE_BREAK=19,
+ KC_CAPS_LOCK = 20
+
+;
Oops, something went wrong.

0 comments on commit 957ce91

Please sign in to comment.