jax 0.0.0.9 → 0.0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +6 -0
- data/jax.gemspec +6 -2
- data/lib/jax/generators/app/templates/public/javascripts/jax.js +1 -1
- data/lib/jax/version.rb +1 -1
- metadata +3 -533
- data/guides/assets/images/book_icon.gif +0 -0
- data/guides/assets/images/bullet.gif +0 -0
- data/guides/assets/images/chapters_icon.gif +0 -0
- data/guides/assets/images/check_bullet.gif +0 -0
- data/guides/assets/images/credits_pic_blank.gif +0 -0
- data/guides/assets/images/edge_badge.png +0 -0
- data/guides/assets/images/feature_tile.gif +0 -0
- data/guides/assets/images/footer_tile.gif +0 -0
- data/guides/assets/images/getting_started/clean_passing_jasmine_suite.png +0 -0
- data/guides/assets/images/getting_started/dungeon-complete.png +0 -0
- data/guides/assets/images/getting_started/dungeon-normal-map.png +0 -0
- data/guides/assets/images/getting_started/dungeon-rainbow-textured.png +0 -0
- data/guides/assets/images/getting_started/dungeon-rainbow.png +0 -0
- data/guides/assets/images/getting_started/dungeon-textured-lighting.png +0 -0
- data/guides/assets/images/getting_started/dungeon-textured.png +0 -0
- data/guides/assets/images/getting_started/rock.png +0 -0
- data/guides/assets/images/getting_started/rock_normal.png +0 -0
- data/guides/assets/images/getting_started/teapot-red-directional-point.png +0 -0
- data/guides/assets/images/getting_started/teapot-red-directional.png +0 -0
- data/guides/assets/images/getting_started/teapot-red-nolight.png +0 -0
- data/guides/assets/images/getting_started/teapot-red-spot-point-directional.png +0 -0
- data/guides/assets/images/getting_started/teapot-white.png +0 -0
- data/guides/assets/images/getting_started/teapot-with-model.png +0 -0
- data/guides/assets/images/grey_bullet.gif +0 -0
- data/guides/assets/images/header_backdrop.png +0 -0
- data/guides/assets/images/header_tile.gif +0 -0
- data/guides/assets/images/icons/README +0 -5
- data/guides/assets/images/icons/callouts/1.png +0 -0
- data/guides/assets/images/icons/callouts/10.png +0 -0
- data/guides/assets/images/icons/callouts/11.png +0 -0
- data/guides/assets/images/icons/callouts/12.png +0 -0
- data/guides/assets/images/icons/callouts/13.png +0 -0
- data/guides/assets/images/icons/callouts/14.png +0 -0
- data/guides/assets/images/icons/callouts/15.png +0 -0
- data/guides/assets/images/icons/callouts/2.png +0 -0
- data/guides/assets/images/icons/callouts/3.png +0 -0
- data/guides/assets/images/icons/callouts/4.png +0 -0
- data/guides/assets/images/icons/callouts/5.png +0 -0
- data/guides/assets/images/icons/callouts/6.png +0 -0
- data/guides/assets/images/icons/callouts/7.png +0 -0
- data/guides/assets/images/icons/callouts/8.png +0 -0
- data/guides/assets/images/icons/callouts/9.png +0 -0
- data/guides/assets/images/icons/caution.png +0 -0
- data/guides/assets/images/icons/example.png +0 -0
- data/guides/assets/images/icons/home.png +0 -0
- data/guides/assets/images/icons/important.png +0 -0
- data/guides/assets/images/icons/next.png +0 -0
- data/guides/assets/images/icons/note.png +0 -0
- data/guides/assets/images/icons/prev.png +0 -0
- data/guides/assets/images/icons/tip.png +0 -0
- data/guides/assets/images/icons/up.png +0 -0
- data/guides/assets/images/icons/warning.png +0 -0
- data/guides/assets/images/nav_arrow.gif +0 -0
- data/guides/assets/images/tab_grey.gif +0 -0
- data/guides/assets/images/tab_info.gif +0 -0
- data/guides/assets/images/tab_note.gif +0 -0
- data/guides/assets/images/tab_red.gif +0 -0
- data/guides/assets/images/tab_yellow.gif +0 -0
- data/guides/assets/images/tab_yellow.png +0 -0
- data/guides/assets/javascripts/guides.js +0 -7
- data/guides/assets/javascripts/syntaxhighlighter/shBrushAS3.js +0 -59
- data/guides/assets/javascripts/syntaxhighlighter/shBrushAppleScript.js +0 -75
- data/guides/assets/javascripts/syntaxhighlighter/shBrushBash.js +0 -59
- data/guides/assets/javascripts/syntaxhighlighter/shBrushCSharp.js +0 -65
- data/guides/assets/javascripts/syntaxhighlighter/shBrushColdFusion.js +0 -100
- data/guides/assets/javascripts/syntaxhighlighter/shBrushCpp.js +0 -125
- data/guides/assets/javascripts/syntaxhighlighter/shBrushCss.js +0 -91
- data/guides/assets/javascripts/syntaxhighlighter/shBrushDelphi.js +0 -55
- data/guides/assets/javascripts/syntaxhighlighter/shBrushDiff.js +0 -41
- data/guides/assets/javascripts/syntaxhighlighter/shBrushErlang.js +0 -52
- data/guides/assets/javascripts/syntaxhighlighter/shBrushGroovy.js +0 -67
- data/guides/assets/javascripts/syntaxhighlighter/shBrushJScript.js +0 -52
- data/guides/assets/javascripts/syntaxhighlighter/shBrushJava.js +0 -57
- data/guides/assets/javascripts/syntaxhighlighter/shBrushJavaFX.js +0 -58
- data/guides/assets/javascripts/syntaxhighlighter/shBrushPerl.js +0 -72
- data/guides/assets/javascripts/syntaxhighlighter/shBrushPhp.js +0 -88
- data/guides/assets/javascripts/syntaxhighlighter/shBrushPlain.js +0 -33
- data/guides/assets/javascripts/syntaxhighlighter/shBrushPowerShell.js +0 -74
- data/guides/assets/javascripts/syntaxhighlighter/shBrushPython.js +0 -64
- data/guides/assets/javascripts/syntaxhighlighter/shBrushRuby.js +0 -55
- data/guides/assets/javascripts/syntaxhighlighter/shBrushSass.js +0 -94
- data/guides/assets/javascripts/syntaxhighlighter/shBrushScala.js +0 -51
- data/guides/assets/javascripts/syntaxhighlighter/shBrushSql.js +0 -66
- data/guides/assets/javascripts/syntaxhighlighter/shBrushVb.js +0 -56
- data/guides/assets/javascripts/syntaxhighlighter/shBrushXml.js +0 -69
- data/guides/assets/javascripts/syntaxhighlighter/shCore.js +0 -17
- data/guides/assets/stylesheets/fixes.css +0 -16
- data/guides/assets/stylesheets/main.css +0 -445
- data/guides/assets/stylesheets/print.css +0 -52
- data/guides/assets/stylesheets/reset.css +0 -43
- data/guides/assets/stylesheets/style.css +0 -13
- data/guides/assets/stylesheets/syntaxhighlighter/shCore.css +0 -226
- data/guides/assets/stylesheets/syntaxhighlighter/shCoreDefault.css +0 -328
- data/guides/assets/stylesheets/syntaxhighlighter/shCoreDjango.css +0 -331
- data/guides/assets/stylesheets/syntaxhighlighter/shCoreEclipse.css +0 -339
- data/guides/assets/stylesheets/syntaxhighlighter/shCoreEmacs.css +0 -324
- data/guides/assets/stylesheets/syntaxhighlighter/shCoreFadeToGrey.css +0 -328
- data/guides/assets/stylesheets/syntaxhighlighter/shCoreMDUltra.css +0 -324
- data/guides/assets/stylesheets/syntaxhighlighter/shCoreMidnight.css +0 -324
- data/guides/assets/stylesheets/syntaxhighlighter/shCoreRDark.css +0 -324
- data/guides/assets/stylesheets/syntaxhighlighter/shThemeDefault.css +0 -117
- data/guides/assets/stylesheets/syntaxhighlighter/shThemeDjango.css +0 -120
- data/guides/assets/stylesheets/syntaxhighlighter/shThemeEclipse.css +0 -128
- data/guides/assets/stylesheets/syntaxhighlighter/shThemeEmacs.css +0 -113
- data/guides/assets/stylesheets/syntaxhighlighter/shThemeFadeToGrey.css +0 -117
- data/guides/assets/stylesheets/syntaxhighlighter/shThemeJaxGuides.css +0 -116
- data/guides/assets/stylesheets/syntaxhighlighter/shThemeMDUltra.css +0 -113
- data/guides/assets/stylesheets/syntaxhighlighter/shThemeMidnight.css +0 -113
- data/guides/assets/stylesheets/syntaxhighlighter/shThemeRDark.css +0 -113
- data/guides/jax_guides.rb +0 -41
- data/guides/jax_guides/common.rb +0 -7
- data/guides/jax_guides/generator.rb +0 -287
- data/guides/jax_guides/helpers.rb +0 -29
- data/guides/jax_guides/indexer.rb +0 -69
- data/guides/jax_guides/levenshtein.rb +0 -31
- data/guides/jax_guides/textile_extensions.rb +0 -61
- data/guides/partials/_top_nav.html.erb +0 -17
- data/guides/source/getting_started.textile +0 -1210
- data/guides/source/index.html.erb +0 -61
- data/guides/source/layout.html.erb +0 -147
- data/guides/source/lighting.textile +0 -5
- data/guides/source/materials.textile +0 -5
- data/guides/source/matrices.textile +0 -5
- data/guides/source/shaders.textile +0 -499
- data/guides/source/testing.textile +0 -5
- data/guides/w3c_validator.rb +0 -91
- data/public/images/brickwall.jpg +0 -0
- data/public/images/jacks.jpg +0 -0
- data/public/images/normal_map.jpg +0 -0
- data/public/images/rock.png +0 -0
- data/public/images/rockNormal.png +0 -0
- data/public/images/rss.png +0 -0
- data/public/webgl_not_supported.html +0 -26
- data/spec/example_app/Gemfile +0 -1
- data/spec/example_app/Rakefile +0 -15
- data/spec/example_app/app/controllers/application_controller.js +0 -5
- data/spec/example_app/app/controllers/courthouse_controller.js +0 -24
- data/spec/example_app/app/controllers/lighting_controller.js +0 -67
- data/spec/example_app/app/controllers/noise_controller.js +0 -50
- data/spec/example_app/app/controllers/picking_controller.js +0 -32
- data/spec/example_app/app/controllers/shadows_controller.js +0 -130
- data/spec/example_app/app/controllers/textures_controller.js +0 -52
- data/spec/example_app/app/helpers/application_helper.js +0 -3
- data/spec/example_app/app/helpers/noise_helper.js +0 -3
- data/spec/example_app/app/helpers/picking_helper.js +0 -3
- data/spec/example_app/app/helpers/textures_helper.js +0 -3
- data/spec/example_app/app/models/blob.js +0 -38
- data/spec/example_app/app/models/character.js +0 -23
- data/spec/example_app/app/models/door.js +0 -10
- data/spec/example_app/app/models/scene.js +0 -19
- data/spec/example_app/app/resources/blobs/default.yml +0 -2
- data/spec/example_app/app/resources/characters/judge.yml +0 -3
- data/spec/example_app/app/resources/doors/courthouse_door.yml +0 -5
- data/spec/example_app/app/resources/light_sources/directional_light.yml +0 -13
- data/spec/example_app/app/resources/light_sources/point_light.yml +0 -31
- data/spec/example_app/app/resources/light_sources/spot_light.yml +0 -15
- data/spec/example_app/app/resources/light_sources/sun.yml +0 -7
- data/spec/example_app/app/resources/light_sources/textures_point.yml +0 -34
- data/spec/example_app/app/resources/materials/blob.yml +0 -28
- data/spec/example_app/app/resources/materials/bricks.yml +0 -36
- data/spec/example_app/app/resources/materials/lighting_with_shadows.yml +0 -27
- data/spec/example_app/app/resources/scenes/courthouse.yml +0 -4
- data/spec/example_app/app/shaders/blob/common.ejs +0 -13
- data/spec/example_app/app/shaders/blob/fragment.ejs +0 -8
- data/spec/example_app/app/shaders/blob/manifest.yml +0 -15
- data/spec/example_app/app/shaders/blob/material.js +0 -51
- data/spec/example_app/app/shaders/blob/vertex.ejs +0 -40
- data/spec/example_app/app/views/courthouse/index.js +0 -4
- data/spec/example_app/app/views/lighting/index.js +0 -4
- data/spec/example_app/app/views/noise/index.js +0 -4
- data/spec/example_app/app/views/picking/index.js +0 -4
- data/spec/example_app/app/views/shadows/index.js +0 -6
- data/spec/example_app/app/views/textures/index.js +0 -4
- data/spec/example_app/config/application.rb +0 -6
- data/spec/example_app/config/boot.rb +0 -13
- data/spec/example_app/config/routes.rb +0 -8
- data/spec/example_app/public/images/185__normalmap.png +0 -0
- data/spec/example_app/public/images/face_norm.jpg +0 -0
- data/spec/example_app/public/images/rock.png +0 -0
- data/spec/example_app/public/images/rockNormal.png +0 -0
- data/spec/example_app/public/images/rss.png +0 -0
- data/spec/example_app/public/webgl_not_supported.html +0 -26
- data/spec/example_app/script/jax +0 -7
- data/spec/example_app/spec/javascripts/controllers/noise_controller_spec.js +0 -11
- data/spec/example_app/spec/javascripts/controllers/picking_controller_spec.js +0 -11
- data/spec/example_app/spec/javascripts/controllers/textures_controller_spec.js +0 -11
- data/spec/example_app/spec/javascripts/helpers/application_helper_spec.js +0 -12
- data/spec/example_app/spec/javascripts/helpers/noise_helper_spec.js +0 -12
- data/spec/example_app/spec/javascripts/helpers/picking_helper_spec.js +0 -12
- data/spec/example_app/spec/javascripts/models/blob_spec.js +0 -11
- data/spec/example_app/spec/javascripts/resources/directional_light_spec.js +0 -16
- data/spec/example_app/spec/javascripts/resources/point_light_spec.js +0 -17
- data/spec/example_app/spec/javascripts/resources/spot_light_spec.js +0 -18
- data/spec/example_app/spec/javascripts/shaders/blob_spec.js +0 -27
- data/spec/example_app/spec/javascripts/support/jasmine.yml +0 -89
- data/spec/example_app/spec/javascripts/support/jasmine_runner.rb +0 -32
- data/spec/example_app/spec/javascripts/support/spec_helpers/jax_spec_environment_helper.js +0 -33
- data/spec/example_app/spec/javascripts/support/spec_helpers/jax_spec_helper.js +0 -93
- data/spec/example_app/spec/javascripts/support/spec_layout.html.erb +0 -111
- data/spec/javascripts/helpers/jax_spec_environment_helper.js +0 -33
- data/spec/javascripts/helpers/jax_spec_helper.js +0 -216
- data/spec/javascripts/jax/builtin/meshes/cube_spec.js +0 -10
- data/spec/javascripts/jax/builtin/meshes/plane_spec.js +0 -8
- data/spec/javascripts/jax/builtin/meshes/quad_spec.js +0 -8
- data/spec/javascripts/jax/builtin/meshes/sphere_spec.js +0 -8
- data/spec/javascripts/jax/builtin/meshes/teapot_spec.js +0 -8
- data/spec/javascripts/jax/builtin/meshes/torus_spec.js +0 -8
- data/spec/javascripts/jax/compatibility_spec.js +0 -50
- data/spec/javascripts/jax/context_spec.js +0 -82
- data/spec/javascripts/jax/controller_spec.js +0 -145
- data/spec/javascripts/jax/core/delegation_spec.js +0 -48
- data/spec/javascripts/jax/core/events_spec.js +0 -17
- data/spec/javascripts/jax/core/matrix_stack_spec.js +0 -28
- data/spec/javascripts/jax/core/utils_spec.js +0 -275
- data/spec/javascripts/jax/helper_spec.js +0 -33
- data/spec/javascripts/jax/model_spec.js +0 -97
- data/spec/javascripts/jax/optimizations/material_limitations_spec.js +0 -87
- data/spec/javascripts/jax/optimizations/shaders/basic_spec.js +0 -68
- data/spec/javascripts/jax/prototype/extensions_spec.js +0 -34
- data/spec/javascripts/jax/route_set_spec.js +0 -67
- data/spec/javascripts/jax/view_manager_spec.js +0 -17
- data/spec/javascripts/jax/webgl/camera_spec.js +0 -159
- data/spec/javascripts/jax/webgl/framebuffer_spec.js +0 -46
- data/spec/javascripts/jax/webgl/lighting_spec.js +0 -61
- data/spec/javascripts/jax/webgl/material_spec.js +0 -118
- data/spec/javascripts/jax/webgl/mesh_spec.js +0 -86
- data/spec/javascripts/jax/webgl/shader/manifest_spec.js +0 -60
- data/spec/javascripts/jax/webgl/shader_chain_spec.js +0 -192
- data/spec/javascripts/jax/webgl/shader_spec.js +0 -276
- data/spec/javascripts/jax/webgl/tangent_space_spec.js +0 -142
- data/spec/javascripts/jax/webgl/texture_spec.js +0 -162
- data/spec/javascripts/jax/webgl_spec.js +0 -5
- data/spec/javascripts/jax/world_spec.js +0 -161
- data/spec/javascripts/jax_spec.js +0 -27
- data/spec/javascripts/shaders/core_materials_spec.js +0 -42
- data/spec/javascripts/shaders/fog_spec.js +0 -19
- data/spec/javascripts/shaders/lighting_spec.js +0 -19
- data/spec/javascripts/shaders/normal_map_spec.js +0 -19
- data/spec/javascripts/shaders/paraboloid_spec.js +0 -37
- data/spec/javascripts/shaders/preprocessor_spec.js +0 -50
- data/spec/javascripts/shaders/shadow_map_spec.js +0 -19
- data/spec/javascripts/shaders/texture_spec.js +0 -40
- data/src/constants.yml +0 -1
- data/src/constants.yml.erb +0 -1
- data/src/jax.js +0 -119
- data/src/jax/anim_frame.js +0 -51
- data/src/jax/builtin/all.js +0 -7
- data/src/jax/builtin/meshes/cube.js +0 -83
- data/src/jax/builtin/meshes/plane.js +0 -63
- data/src/jax/builtin/meshes/quad.js +0 -86
- data/src/jax/builtin/meshes/sphere.js +0 -65
- data/src/jax/builtin/meshes/teapot.js +0 -48
- data/src/jax/builtin/meshes/torus.js +0 -64
- data/src/jax/compatibility.js +0 -303
- data/src/jax/context.js +0 -420
- data/src/jax/core.js +0 -42
- data/src/jax/core/math.js +0 -55
- data/src/jax/core/matrix_stack.js +0 -311
- data/src/jax/core/util.js +0 -253
- data/src/jax/events.js +0 -234
- data/src/jax/geometry.js +0 -7
- data/src/jax/geometry/plane.js +0 -113
- data/src/jax/mvc/controller.js +0 -195
- data/src/jax/mvc/helper.js +0 -35
- data/src/jax/mvc/model.js +0 -302
- data/src/jax/mvc/route_set.js +0 -125
- data/src/jax/mvc/view.js +0 -43
- data/src/jax/mvc/view_manager.js +0 -47
- data/src/jax/noise.js +0 -206
- data/src/jax/prototype/class.js +0 -81
- data/src/jax/prototype/core.js +0 -112
- data/src/jax/prototype/extensions.js +0 -142
- data/src/jax/vendor/ejs.js +0 -4
- data/src/jax/vendor/glMatrix.js +0 -3
- data/src/jax/webgl.js +0 -98
- data/src/jax/webgl/camera.js +0 -526
- data/src/jax/webgl/core.js +0 -6
- data/src/jax/webgl/core/buffer.js +0 -161
- data/src/jax/webgl/core/edge.js +0 -6
- data/src/jax/webgl/core/events.js +0 -25
- data/src/jax/webgl/core/face.js +0 -8
- data/src/jax/webgl/core/framebuffer.js +0 -211
- data/src/jax/webgl/material.js +0 -392
- data/src/jax/webgl/mesh.js +0 -427
- data/src/jax/webgl/scene.js +0 -11
- data/src/jax/webgl/scene/frustum.js +0 -260
- data/src/jax/webgl/scene/light_manager.js +0 -136
- data/src/jax/webgl/scene/light_source.js +0 -294
- data/src/jax/webgl/shader.js +0 -296
- data/src/jax/webgl/shader/delegator.js +0 -13
- data/src/jax/webgl/shader/delegator/attribute.js +0 -53
- data/src/jax/webgl/shader/delegator/uniform.js +0 -71
- data/src/jax/webgl/shader/manifest.js +0 -64
- data/src/jax/webgl/shader/program.js +0 -140
- data/src/jax/webgl/shader_chain.js +0 -264
- data/src/jax/webgl/texture.js +0 -312
- data/src/jax/webgl/world.js +0 -240
- data/vendor/ejs/.svn/all-wcprops +0 -17
- data/vendor/ejs/.svn/entries +0 -114
- data/vendor/ejs/.svn/text-base/Eratta.txt.svn-base +0 -3
- data/vendor/ejs/.svn/text-base/license.txt.svn-base +0 -21
- data/vendor/ejs/Eratta.txt +0 -3
- data/vendor/ejs/example/.svn/all-wcprops +0 -29
- data/vendor/ejs/example/.svn/entries +0 -164
- data/vendor/ejs/example/.svn/prop-base/ejs.gif.svn-base +0 -5
- data/vendor/ejs/example/.svn/text-base/demo.html.svn-base +0 -54
- data/vendor/ejs/example/.svn/text-base/ejs.gif.svn-base +0 -0
- data/vendor/ejs/example/.svn/text-base/example.css.svn-base +0 -31
- data/vendor/ejs/example/.svn/text-base/example.js.svn-base +0 -88
- data/vendor/ejs/example/demo.html +0 -54
- data/vendor/ejs/example/ejs.gif +0 -0
- data/vendor/ejs/example/example.css +0 -31
- data/vendor/ejs/example/example.js +0 -88
- data/vendor/ejs/lib/.svn/all-wcprops +0 -11
- data/vendor/ejs/lib/.svn/entries +0 -62
- data/vendor/ejs/lib/.svn/text-base/ejs_fulljslint.js.svn-base +0 -3774
- data/vendor/ejs/lib/ejs_fulljslint.js +0 -3774
- data/vendor/ejs/license.txt +0 -21
- data/vendor/ejs/script/.svn/all-wcprops +0 -17
- data/vendor/ejs/script/.svn/entries +0 -96
- data/vendor/ejs/script/.svn/prop-base/yuicompressor-2.2.4.jar.svn-base +0 -5
- data/vendor/ejs/script/.svn/text-base/production.bat.svn-base +0 -4
- data/vendor/ejs/script/.svn/text-base/yuicompressor-2.2.4.jar.svn-base +0 -0
- data/vendor/ejs/script/production.bat +0 -4
- data/vendor/ejs/script/yuicompressor-2.2.4.jar +0 -0
- data/vendor/ejs/src/.svn/all-wcprops +0 -17
- data/vendor/ejs/src/.svn/entries +0 -96
- data/vendor/ejs/src/.svn/text-base/ejs.js.svn-base +0 -505
- data/vendor/ejs/src/.svn/text-base/view.js.svn-base +0 -200
- data/vendor/ejs/src/ejs.js +0 -505
- data/vendor/ejs/src/view.js +0 -200
- data/vendor/ejs/test/.svn/all-wcprops +0 -23
- data/vendor/ejs/test/.svn/entries +0 -139
- data/vendor/ejs/test/.svn/text-base/index.html.svn-base +0 -18
- data/vendor/ejs/test/.svn/text-base/setup_test.html.svn-base +0 -44
- data/vendor/ejs/test/.svn/text-base/sidebar.html.svn-base +0 -28
- data/vendor/ejs/test/included/.svn/all-wcprops +0 -23
- data/vendor/ejs/test/included/.svn/entries +0 -130
- data/vendor/ejs/test/included/.svn/text-base/prototype.js.svn-base +0 -4184
- data/vendor/ejs/test/included/.svn/text-base/test.css.svn-base +0 -44
- data/vendor/ejs/test/included/.svn/text-base/unittest.js.svn-base +0 -564
- data/vendor/ejs/test/included/prototype.js +0 -4184
- data/vendor/ejs/test/included/test.css +0 -44
- data/vendor/ejs/test/included/unittest.js +0 -564
- data/vendor/ejs/test/index.html +0 -18
- data/vendor/ejs/test/setup_test.html +0 -44
- data/vendor/ejs/test/sidebar.html +0 -28
- data/vendor/ejs/test/templates/.svn/all-wcprops +0 -11
- data/vendor/ejs/test/templates/.svn/entries +0 -62
- data/vendor/ejs/test/templates/.svn/text-base/test.ejs.svn-base +0 -3
- data/vendor/ejs/test/templates/test.ejs +0 -3
- data/vendor/ejs/test/tests/.svn/all-wcprops +0 -23
- data/vendor/ejs/test/tests/.svn/entries +0 -130
- data/vendor/ejs/test/tests/.svn/text-base/rendering.js.svn-base +0 -94
- data/vendor/ejs/test/tests/.svn/text-base/templating.js.svn-base +0 -43
- data/vendor/ejs/test/tests/.svn/text-base/views.js.svn-base +0 -100
- data/vendor/ejs/test/tests/rendering.js +0 -94
- data/vendor/ejs/test/tests/templating.js +0 -43
- data/vendor/ejs/test/tests/views.js +0 -100
- data/vendor/glmatrix/benchmark/js/CanvasMatrix.js +0 -722
- data/vendor/glmatrix/benchmark/js/EWGL_math.js +0 -742
- data/vendor/glmatrix/benchmark/js/mjs.js +0 -1230
- data/vendor/glmatrix/benchmark/matrix_benchmark.html +0 -419
- data/vendor/glmatrix/glMatrix-min.js +0 -32
- data/vendor/glmatrix/glMatrix.js +0 -1772
- data/vendor/glmatrix/unit tests/glMatrix-test.js +0 -74
- data/vendor/glmatrix/unit tests/qunit.css +0 -119
- data/vendor/glmatrix/unit tests/qunit.js +0 -1069
- data/vendor/glmatrix/unit tests/test_glMatrix.html +0 -21
- data/vendor/pdoc_template/html/assets/images/pdoc/alias.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/class.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/class_deprecated.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/class_method.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/class_property.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/constant.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/constructor.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/deprecated.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/description.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/information.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/instance_method.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/instance_property.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/method.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/method_deprecated.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/mixin.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/namespace.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/property.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/related_to.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/search-background.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/section-background.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/section.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/selected-section-background.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/subclass.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/superclass.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/utility.png +0 -0
- data/vendor/pdoc_template/html/assets/javascripts/pdoc/application.js +0 -478
- data/vendor/pdoc_template/html/assets/javascripts/pdoc/prototype.js +0 -4874
- data/vendor/pdoc_template/html/assets/javascripts/pdoc/tabs.js +0 -506
- data/vendor/pdoc_template/html/assets/stylesheets/jax.css +0 -30
- data/vendor/pdoc_template/html/assets/stylesheets/pdoc/api.css +0 -681
- data/vendor/pdoc_template/html/assets/stylesheets/pdoc/pygments.css +0 -62
- data/vendor/pdoc_template/html/helpers.rb +0 -35
- data/vendor/pdoc_template/html/index.erb +0 -18
- data/vendor/pdoc_template/html/item_index.js.erb +0 -6
- data/vendor/pdoc_template/html/layout.erb +0 -67
- data/vendor/pdoc_template/html/leaf.erb +0 -22
- data/vendor/pdoc_template/html/node.erb +0 -30
- data/vendor/pdoc_template/html/partials/class_relationships.erb +0 -19
- data/vendor/pdoc_template/html/partials/classes.erb +0 -7
- data/vendor/pdoc_template/html/partials/constructor.erb +0 -5
- data/vendor/pdoc_template/html/partials/description.erb +0 -5
- data/vendor/pdoc_template/html/partials/link_list.erb +0 -1
- data/vendor/pdoc_template/html/partials/method_signatures.erb +0 -14
- data/vendor/pdoc_template/html/partials/methodized_note.erb +0 -9
- data/vendor/pdoc_template/html/partials/mixins.erb +0 -7
- data/vendor/pdoc_template/html/partials/namespaces.erb +0 -7
- data/vendor/pdoc_template/html/partials/related_utilities.erb +0 -5
- data/vendor/pdoc_template/html/partials/relationships.erb +0 -11
- data/vendor/pdoc_template/html/partials/short_description_list.erb +0 -7
- data/vendor/pdoc_template/html/partials/title.erb +0 -24
- data/vendor/pdoc_template/html/section.erb +0 -18
- data/vendor/yuicompressor-2.4.2.jar +0 -0
data/guides/w3c_validator.rb
DELETED
@@ -1,91 +0,0 @@
|
|
1
|
-
# ---------------------------------------------------------------------------
|
2
|
-
#
|
3
|
-
# This script validates the generated guides against the W3C Validator.
|
4
|
-
#
|
5
|
-
# Guides are taken from the output directory, from where all .html files are
|
6
|
-
# submitted to the validator.
|
7
|
-
#
|
8
|
-
# This script is prepared to be launched from the railties directory as a rake task:
|
9
|
-
#
|
10
|
-
# rake validate_guides
|
11
|
-
#
|
12
|
-
# If nothing is specified, all files will be validated, but you can check just
|
13
|
-
# some of them using this environment variable:
|
14
|
-
#
|
15
|
-
# ONLY
|
16
|
-
# Use ONLY if you want to validate only one or a set of guides. Prefixes are
|
17
|
-
# enough:
|
18
|
-
#
|
19
|
-
# # validates only association_basics.html
|
20
|
-
# ONLY=assoc rake validate_guides
|
21
|
-
#
|
22
|
-
# Separate many using commas:
|
23
|
-
#
|
24
|
-
# # validates only association_basics.html and migrations.html
|
25
|
-
# ONLY=assoc,migrations rake validate_guides
|
26
|
-
#
|
27
|
-
# ---------------------------------------------------------------------------
|
28
|
-
|
29
|
-
require 'rubygems'
|
30
|
-
require 'w3c_validators'
|
31
|
-
include W3CValidators
|
32
|
-
|
33
|
-
module JaxGuides
|
34
|
-
class Validator
|
35
|
-
|
36
|
-
def validate
|
37
|
-
validator = MarkupValidator.new
|
38
|
-
STDOUT.sync = true
|
39
|
-
errors_on_guides = {}
|
40
|
-
|
41
|
-
guides_to_validate.each do |f|
|
42
|
-
results = validator.validate_file(f)
|
43
|
-
|
44
|
-
if results.validity
|
45
|
-
print "."
|
46
|
-
else
|
47
|
-
print "E"
|
48
|
-
errors_on_guides[f] = results.errors
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
show_results(errors_on_guides)
|
53
|
-
end
|
54
|
-
|
55
|
-
private
|
56
|
-
def guides_to_validate
|
57
|
-
guides = Dir["./guides/output/*.html"]
|
58
|
-
guides.delete("./guides/output/layout.html")
|
59
|
-
ENV.key?('ONLY') ? select_only(guides) : guides
|
60
|
-
end
|
61
|
-
|
62
|
-
def select_only(guides)
|
63
|
-
prefixes = ENV['ONLY'].split(",").map(&:strip)
|
64
|
-
guides.select do |guide|
|
65
|
-
prefixes.any? {|p| guide.start_with?("./guides/output/#{p}")}
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
def show_results(error_list)
|
70
|
-
if error_list.size == 0
|
71
|
-
puts "\n\nAll checked guides validate OK!"
|
72
|
-
else
|
73
|
-
error_summary = error_detail = ""
|
74
|
-
|
75
|
-
error_list.each_pair do |name, errors|
|
76
|
-
error_summary += "\n #{name}"
|
77
|
-
error_detail += "\n\n #{name} has #{errors.size} validation error(s):\n"
|
78
|
-
errors.each do |error|
|
79
|
-
error_detail += "\n "+error.to_s.gsub("\n", "")
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
puts "\n\nThere are #{error_list.size} guides with validation errors:\n" + error_summary
|
84
|
-
puts "\nHere are the detailed errors for each guide:" + error_detail
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
JaxGuides::Validator.new.validate
|
data/public/images/brickwall.jpg
DELETED
Binary file
|
data/public/images/jacks.jpg
DELETED
Binary file
|
Binary file
|
data/public/images/rock.png
DELETED
Binary file
|
Binary file
|
data/public/images/rss.png
DELETED
Binary file
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<title>WebGL is not supported!</title>
|
4
|
-
</head>
|
5
|
-
<body>
|
6
|
-
<h1>Uh-oh!</h1>
|
7
|
-
|
8
|
-
<p>
|
9
|
-
Unfortunately, WebGL appears to be unavailable! Please verify that you have the latest release of a WebGL-compatible
|
10
|
-
browser such as <a href="http://www.firefox.com">FireFox 4.0</a> or <a href="http://chrome.google.com">Chrome 11</a>.
|
11
|
-
</p>
|
12
|
-
|
13
|
-
<p>
|
14
|
-
If you are certain you already have a WebGL-compatible browser, please verify that WebGL is enabled and supported
|
15
|
-
by your system. You could also try upgrading to your graphics drivers to the latest version.
|
16
|
-
</p>
|
17
|
-
|
18
|
-
<h2>Your Browser Information</h2>
|
19
|
-
|
20
|
-
<script type="text/javascript">
|
21
|
-
var fields = ['appCodeName', 'appName', 'appVersion', 'cookieEnabled', 'platform', 'userAgent'];
|
22
|
-
for (var i = 0; i < fields.length; i++)
|
23
|
-
document.writeln("<p>"+fields[i]+": "+navigator[fields[i]]+"</p>");
|
24
|
-
</script>
|
25
|
-
</body>
|
26
|
-
</html>
|
data/spec/example_app/Gemfile
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
gem 'jax', :path => File.expand_path("../../../", __FILE__)
|
data/spec/example_app/Rakefile
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require File.expand_path('../config/application', __FILE__)
|
2
|
-
require 'jax/tasks/rake'
|
3
|
-
|
4
|
-
require 'jasmine'
|
5
|
-
|
6
|
-
module Jasmine
|
7
|
-
class Config
|
8
|
-
alias _start_server start_server
|
9
|
-
def start_server(port = 8889)
|
10
|
-
_start_server(8889)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
load 'jasmine/tasks/jasmine.rake'
|
@@ -1,24 +0,0 @@
|
|
1
|
-
//= require "application_controller"
|
2
|
-
|
3
|
-
var CourthouseController = (function() {
|
4
|
-
return Jax.Controller.create("courthouse", ApplicationController, {
|
5
|
-
/* 'index' action. Sets up the scene. 'index' is called by default when first
|
6
|
-
switching to this controller, unless another action name is given.
|
7
|
-
*/
|
8
|
-
index: function() {
|
9
|
-
this.world.addLightSource(LightSource.find('sun'));
|
10
|
-
this.world.addObject(Scene.find('courthouse'));
|
11
|
-
this.world.addObject(Character.find('judge'));
|
12
|
-
},
|
13
|
-
|
14
|
-
/* Some special actions are fired whenever the corresponding input is
|
15
|
-
received from the user.
|
16
|
-
*/
|
17
|
-
mouse_clicked: function(event) {
|
18
|
-
if (event.target.isKindOf(Door)) {
|
19
|
-
/* user clicks on the door, so they need to go to the next scene */
|
20
|
-
this.redirectTo(event.target.destination);
|
21
|
-
}
|
22
|
-
}
|
23
|
-
});
|
24
|
-
})();
|
@@ -1,67 +0,0 @@
|
|
1
|
-
//= require "application_controller"
|
2
|
-
|
3
|
-
/*
|
4
|
-
Example of blinn-phong shading with arbitrary light sources. Renders a teapot with 3 light sources:
|
5
|
-
red, blue and white. The white light source is a spotlight and will pivot back and forth over a 90-degree angle
|
6
|
-
with the teapot in the center. The mouse can be moved to move the camera, or dragged to move the teapot.
|
7
|
-
*/
|
8
|
-
|
9
|
-
var LightingController = (function() {
|
10
|
-
return Jax.Controller.create("lighting", ApplicationController, {
|
11
|
-
index: function() {
|
12
|
-
// build a new material, since the default one isn't quite to our liking for this demo
|
13
|
-
// all unspecified options will simply inherit the default ones.
|
14
|
-
var custom_material = Jax.Material.find("lighting_with_shadows");
|
15
|
-
|
16
|
-
// add a Teapot
|
17
|
-
this.world.addObject(new Jax.Model({ mesh: new Jax.Mesh.Teapot({size:10, material:custom_material}),position:[0,0,-25] }));
|
18
|
-
this.world.addObject(new Jax.Model({ mesh: new Jax.Mesh.Plane({size:75, material:custom_material}), position:[0,-15,-50],direction:[0,1,0]}));
|
19
|
-
|
20
|
-
// add a spotlight, like a flashlight -- we'll animate this later
|
21
|
-
this.world.addLightSource(Jax.Scene.LightSource.find("spot_light"));
|
22
|
-
this.world.addObject(new Jax.Model({mesh:new Jax.Mesh.Sphere({color:[0.5,0.5,0.5,1]}), shadow_caster: false, lit:false, position:[0,0,30]}));
|
23
|
-
|
24
|
-
// add a point light, like a candle
|
25
|
-
var point_light = Jax.Scene.LightSource.find("point_light");
|
26
|
-
this.world.addLightSource(point_light);
|
27
|
-
this.world.addObject(new Jax.Model({mesh:new Jax.Mesh.Sphere({color:[0.5,0,0,1]}), shadow_caster: false, lit:false, position:point_light.getPosition()}));
|
28
|
-
|
29
|
-
// add a directional light, like the sun
|
30
|
-
this.world.addLightSource(Jax.Scene.LightSource.find("directional_light"));
|
31
|
-
|
32
|
-
// position the player backwards 20 units, to [0,0,20].
|
33
|
-
this.player.camera.setPosition(0,15,50);
|
34
|
-
this.player.camera.lookAt([0,0,0],[0,1,0]);
|
35
|
-
},
|
36
|
-
|
37
|
-
/* this updater will take care of pivoting the spotlight horizontally over time. */
|
38
|
-
update: function(timechange) {
|
39
|
-
var spotlight = this.context.world.lighting.getLight(0);
|
40
|
-
var speed = Math.PI/4; // pivot at a speed of 45 degrees per second
|
41
|
-
var rotation_direction = this.rotation_per_second || speed;
|
42
|
-
|
43
|
-
// see if it's time to reverse direction. A camera's view vector has magnitude 1. Remember your
|
44
|
-
// unit circles? When magnitude is 1, X is cos. The cos of 45 degrees is sqrt(2)/2. So to pivot every
|
45
|
-
// 45 degrees off from the focal point (for a total of 90 degrees difference), we'll check X <=> sqrt(2)/2.
|
46
|
-
var view = spotlight.camera.getViewVector();
|
47
|
-
if (view[0] > Math.sqrt(2)/2) this.rotation_per_second = speed;
|
48
|
-
else if (view[0] < -Math.sqrt(2)/2) this.rotation_per_second = -speed;
|
49
|
-
|
50
|
-
// rotate the spotlight. Just like any other object, a light has its own camera, so it's trivial to orient
|
51
|
-
// it within the scene. Rotating about the Y axis causes a horizontal movement.
|
52
|
-
spotlight.camera.rotate(rotation_direction*timechange, 0, 1, 0);
|
53
|
-
},
|
54
|
-
|
55
|
-
/* moving the mouse will pan the camera */
|
56
|
-
mouse_moved: function(event) {
|
57
|
-
var camera = this.context.player.camera;
|
58
|
-
camera.move(0.175, [this.context.mouse.diffx, 0, -this.context.mouse.diffy]);
|
59
|
-
},
|
60
|
-
|
61
|
-
/* dragging the mouse will pan the object */
|
62
|
-
mouse_dragged: function(event) {
|
63
|
-
var camera = this.world.getObject(0).camera;
|
64
|
-
camera.move(0.175, [this.context.mouse.diffx, 0, -this.context.mouse.diffy]);
|
65
|
-
}
|
66
|
-
});
|
67
|
-
})();
|
@@ -1,50 +0,0 @@
|
|
1
|
-
//= require "application_controller"
|
2
|
-
|
3
|
-
var NoiseController = (function() {
|
4
|
-
var red, green, blue;
|
5
|
-
|
6
|
-
return Jax.Controller.create("noise", ApplicationController, {
|
7
|
-
index: function() {
|
8
|
-
var model = new Blob();
|
9
|
-
this.world.addObject(model);
|
10
|
-
this.player.camera.move(-5);
|
11
|
-
|
12
|
-
var light_options = {
|
13
|
-
type: Jax.POINT_LIGHT,
|
14
|
-
attenuation: {
|
15
|
-
constant: 0,
|
16
|
-
linear: 0,
|
17
|
-
quadratic: 0.002
|
18
|
-
}
|
19
|
-
};
|
20
|
-
|
21
|
-
red = new LightSource(Jax.Util.normalizeOptions({
|
22
|
-
position: [-20, 0, 20], color: { ambient: [0.2, 0, 0, 1], diffuse: [0.8, 0, 0, 1], specular:[1.0, 0, 0, 1] }
|
23
|
-
}, light_options));
|
24
|
-
this.world.addLightSource(red);
|
25
|
-
|
26
|
-
green = new LightSource(Jax.Util.normalizeOptions({
|
27
|
-
position: [ 20, 20, 20], color: { ambient: [0, 0.2, 0, 1], diffuse: [0, 0.8, 0, 1], specular:[0, 1.0, 0, 1] }
|
28
|
-
}, light_options));
|
29
|
-
this.world.addLightSource(green);
|
30
|
-
|
31
|
-
blue = new LightSource(Jax.Util.normalizeOptions({
|
32
|
-
position: [ 20, -20, 20], color: { ambient: [0, 0, 0.2, 1], diffuse: [0, 0, 0.8, 1], specular:[0, 0, 1.0, 1] }
|
33
|
-
}, light_options));
|
34
|
-
this.world.addLightSource(blue);
|
35
|
-
},
|
36
|
-
|
37
|
-
update: function(tc) {
|
38
|
-
this.rot = (this.rot || 0) + tc * 3.0;
|
39
|
-
|
40
|
-
function set(light, angle) {
|
41
|
-
var s = Math.sin(angle), c = Math.cos(angle);
|
42
|
-
light.camera.setPosition(s*20, c*20, 20);
|
43
|
-
}
|
44
|
-
var dif = Math.deg2rad(120);
|
45
|
-
set(red, this.rot + dif);
|
46
|
-
set(blue, this.rot + dif*2);
|
47
|
-
set(green, this.rot + dif*3);
|
48
|
-
}
|
49
|
-
});
|
50
|
-
})();
|
@@ -1,32 +0,0 @@
|
|
1
|
-
//= require "application_controller"
|
2
|
-
|
3
|
-
var PickingController = (function() {
|
4
|
-
return Jax.Controller.create("picking", ApplicationController, {
|
5
|
-
index: function() {
|
6
|
-
function mesh() { return new Jax.Mesh.Sphere({size: 1.0}); };
|
7
|
-
|
8
|
-
ofront = this.world.addObject(new Jax.Model({position:[ 0.0, 0.0,-5],mesh:mesh()}));
|
9
|
-
otopleft = this.world.addObject(new Jax.Model({position:[-2.5, 2.5,-5],mesh:mesh()}));
|
10
|
-
otopright = this.world.addObject(new Jax.Model({position:[ 2.5, 2.5,-5],mesh:mesh()}));
|
11
|
-
obottomleft = this.world.addObject(new Jax.Model({position:[-2.5,-2.5,-5],mesh:mesh()}));
|
12
|
-
obottomright = this.world.addObject(new Jax.Model({position:[ 2.5,-2.5,-5],mesh:mesh()}));
|
13
|
-
},
|
14
|
-
|
15
|
-
mouse_pressed: function(e) { alert(e.x+" "+e.y); },
|
16
|
-
|
17
|
-
mouse_moved: function(evt) {
|
18
|
-
var obj = this.world.pick(evt.x, evt.y);
|
19
|
-
if (obj) {
|
20
|
-
if (this.current_obj && obj != this.current_obj) {
|
21
|
-
this.current_obj.mesh.setColor(1,1,1,1);
|
22
|
-
}
|
23
|
-
obj.mesh.setColor(1,0,0,1);
|
24
|
-
} else {
|
25
|
-
if (this.current_obj) {
|
26
|
-
this.current_obj.mesh.setColor(1,1,1,1);
|
27
|
-
}
|
28
|
-
}
|
29
|
-
this.current_obj = obj;
|
30
|
-
}
|
31
|
-
});
|
32
|
-
})();
|
@@ -1,130 +0,0 @@
|
|
1
|
-
//= require "application_controller"
|
2
|
-
|
3
|
-
/*
|
4
|
-
Example of shadows cast using phong shading and point, directional and spot lights.
|
5
|
-
A single light exists and its type can be toggled by clicking on the canvas. The light
|
6
|
-
will constantly be changing direction, though this should be unnoticeable for the
|
7
|
-
point light, which always emits in all directions.
|
8
|
-
|
9
|
-
WORK IN PROGRESS
|
10
|
-
*/
|
11
|
-
|
12
|
-
var ShadowsController = (function() {
|
13
|
-
return Jax.Controller.create("shadows", ApplicationController, {
|
14
|
-
index: function() {
|
15
|
-
/* light sources */
|
16
|
-
var light01 = new Jax.Scene.LightSource({
|
17
|
-
enabled:true,
|
18
|
-
type: Jax.POINT_LIGHT,
|
19
|
-
angle: 20.0,
|
20
|
-
position: [0,150,150],
|
21
|
-
direction: [-1,-1,-1],
|
22
|
-
color: {
|
23
|
-
ambient: [0,0,0,1],
|
24
|
-
diffuse: [1,1,1,1],
|
25
|
-
specular: [1,1,1,1]
|
26
|
-
},
|
27
|
-
attenuation: {
|
28
|
-
constant: 0,
|
29
|
-
linear: 0.01,
|
30
|
-
quadratic: 0.00001
|
31
|
-
}
|
32
|
-
});
|
33
|
-
|
34
|
-
this.world.addLightSource(light01);
|
35
|
-
|
36
|
-
/* materials */
|
37
|
-
var floor_mat = new Jax.Material({
|
38
|
-
shaderType: "blinn-phong",
|
39
|
-
shininess: 60,
|
40
|
-
ambient: [0.1,0.1,0.1,1],
|
41
|
-
diffuse: [0.4,0.9,0.4,1],
|
42
|
-
specular: [0.4,0.4,0.4,1]
|
43
|
-
});
|
44
|
-
floor_mat.addLayer(new Jax.Material.Lighting());
|
45
|
-
floor_mat.addLayer(new Jax.Material.ShadowMap());
|
46
|
-
|
47
|
-
var torus_mat = new Jax.Material({
|
48
|
-
shaderType: "blinn-phong",
|
49
|
-
shininess: 60,
|
50
|
-
ambient: [0.1,0.1,0.1,1],
|
51
|
-
diffuse: [0.9,0.3,0.3,1],
|
52
|
-
specular:[0.6,0.6,0.6,1]
|
53
|
-
});
|
54
|
-
torus_mat.addLayer(new Jax.Material.Lighting());
|
55
|
-
torus_mat.addLayer(new Jax.Material.ShadowMap());
|
56
|
-
|
57
|
-
var sphere_mat = new Jax.Material({
|
58
|
-
shaderType: "blinn-phong",
|
59
|
-
shininess: 60,
|
60
|
-
ambient: [0.1,0.1,0.1,1],
|
61
|
-
diffuse: [0.3,0.3,0.9,1],
|
62
|
-
specular:[0.4,0.4,0.4,1]
|
63
|
-
});
|
64
|
-
sphere_mat.addLayer(new Jax.Material.Lighting());
|
65
|
-
sphere_mat.addLayer(new Jax.Material.ShadowMap());
|
66
|
-
|
67
|
-
/* objects */
|
68
|
-
this.world.addObject(new Jax.Model({mesh: new Jax.Mesh.Plane({size:500,segments:20,material:floor_mat})}));
|
69
|
-
|
70
|
-
var torus = new Jax.Model({mesh:new Jax.Mesh.Torus({outer_radius:60,inner_radius:32,material:torus_mat})});
|
71
|
-
torus.camera.orient(0,-1,0, 0,0,1);
|
72
|
-
torus.camera.setPosition(-70,50,0);
|
73
|
-
this.world.addObject(torus);
|
74
|
-
|
75
|
-
var sphere = new Jax.Model({mesh: new Jax.Mesh.Sphere({radius:40,stacks:40,slices:40,material:sphere_mat})});
|
76
|
-
sphere.camera.setPosition(70, 40, 0);
|
77
|
-
this.world.addObject(sphere);
|
78
|
-
|
79
|
-
/* camera */
|
80
|
-
this.player.camera.setPosition(30, 500, 400);
|
81
|
-
this.player.camera.lookAt([0,0,0], [0,1,0]);
|
82
|
-
},
|
83
|
-
|
84
|
-
/*
|
85
|
-
TODO delegation
|
86
|
-
delegate getLight() into world.lighting
|
87
|
-
delegate model setPosition() and friends into model.camera
|
88
|
-
*/
|
89
|
-
|
90
|
-
update: function(timechange) {
|
91
|
-
// let's rotate the light's camera
|
92
|
-
var light = this.world.lighting.getLight(0);
|
93
|
-
var rot = light.rotation || 0;
|
94
|
-
rot += Math.PI / 4 * timechange;
|
95
|
-
light.rotation = rot;
|
96
|
-
var length = vec3.length([0,75,75]);
|
97
|
-
light.camera.setPosition(Math.cos(rot)*length, 150, Math.sin(rot)*length);
|
98
|
-
light.camera.lookAt([0,0,0],[0,1,0]);
|
99
|
-
},
|
100
|
-
|
101
|
-
mouse_moved: function(event) {
|
102
|
-
var obj = this.context.world.lighting.getLight(0);
|
103
|
-
// obj.camera.setPosition(vec3.add(obj.camera.getPosition(), [this.context.mouse.diffx, 0, 0]));
|
104
|
-
// document.getElementById('jax_banner').innerHTML = (this.context.mouse.diffx+" "+this.context.mouse.diffy);
|
105
|
-
this.context.player.camera.rotate( this.context.mouse.diffy/50, 1, 0, 0);
|
106
|
-
this.context.player.camera.rotate(-this.context.mouse.diffx/50, 0, 1, 0);
|
107
|
-
},
|
108
|
-
|
109
|
-
mouse_clicked: function(event) {
|
110
|
-
// var lt = this.context.world.lighting.getLight(0);
|
111
|
-
// switch(lt.type) {
|
112
|
-
// case Jax.POINT_LIGHT:
|
113
|
-
// lt.type = Jax.SPOT_LIGHT;
|
114
|
-
// break;
|
115
|
-
// case Jax.SPOT_LIGHT:
|
116
|
-
// lt.type = Jax.DIRECTIONAL_LIGHT;
|
117
|
-
// break;
|
118
|
-
// case Jax.DIRECTIONAL_LIGHT:
|
119
|
-
// lt.type = Jax.POINT_LIGHT;
|
120
|
-
// break;
|
121
|
-
// default:
|
122
|
-
// alert("unexpected light type: "+lt.type);
|
123
|
-
// }
|
124
|
-
},
|
125
|
-
|
126
|
-
mouse_dragged: function(event) {
|
127
|
-
this.context.player.camera.move(0.25, [this.context.mouse.diffx, 0, -this.context.mouse.diffy]);
|
128
|
-
}
|
129
|
-
});
|
130
|
-
})();
|