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/src/constants.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
JAX_VERSION: 0.0.0.8
|
data/src/constants.yml.erb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
JAX_VERSION: <%=Jax::Version::STRING%>
|
data/src/jax.js
DELETED
@@ -1,119 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Global
|
3
|
-
* Objects and functions defined here are available in the global (window) scope.
|
4
|
-
**/
|
5
|
-
|
6
|
-
/**
|
7
|
-
* Jax
|
8
|
-
* Root namespace containing all Jax data
|
9
|
-
**/
|
10
|
-
var Jax = { PRODUCTION: 1, VERSION: "<%=JAX_VERSION%>" };
|
11
|
-
|
12
|
-
/* Called by Jax applications as of version 0.0.0.5 to alert the user to incomplete upgrades */
|
13
|
-
Jax.doVersionCheck = function(targetVersion) {
|
14
|
-
// don't do this in production cause that would be a Bad Idea
|
15
|
-
if (Jax.environment && Jax.environment == Jax.PRODUCTION) return;
|
16
|
-
|
17
|
-
if (Jax.VERSION != targetVersion) {
|
18
|
-
alert("Jax version mismatch!\n\n" +
|
19
|
-
"Your Jax gem is version "+targetVersion+", but the Jax JS library is version "+Jax.VERSION+"!\n\n" +
|
20
|
-
"Please run `rake jax:update` at the command line to fix this issue.");
|
21
|
-
}
|
22
|
-
};
|
23
|
-
|
24
|
-
// note: the default_shader is used immediately after Jax.Material has been defined. So, most
|
25
|
-
// likely the end user won't be able to customize it with the expected result. Materials created
|
26
|
-
// *after* the default shader has been changed are fine, but materials already existing
|
27
|
-
// (such as "default") will continue to use the previous default. If default material init can be deferred
|
28
|
-
// until first use (e.g. upon first call to model#render), then we can expose this variable.
|
29
|
-
// Since materials are generally meant to maintain their own shaders, it may not be desirable to
|
30
|
-
// expose it in any case.
|
31
|
-
Jax.default_shader = "basic";
|
32
|
-
|
33
|
-
//= require "jax/compatibility"
|
34
|
-
//= require "jax/core"
|
35
|
-
//= require "jax/anim_frame"
|
36
|
-
//= require "jax/prototype/extensions"
|
37
|
-
//= require "jax/mvc/helper"
|
38
|
-
//= require "jax/mvc/model"
|
39
|
-
//= require "jax/mvc/controller"
|
40
|
-
//= require "jax/mvc/view_manager"
|
41
|
-
//= require "jax/mvc/route_set"
|
42
|
-
//= require "jax/mvc/view"
|
43
|
-
//= require "jax/context"
|
44
|
-
//= require "jax/noise"
|
45
|
-
|
46
|
-
Jax.shaders = {};
|
47
|
-
|
48
|
-
/**
|
49
|
-
* Jax.views -> Jax.ViewManager
|
50
|
-
**/
|
51
|
-
Jax.views = new Jax.ViewManager();
|
52
|
-
|
53
|
-
/**
|
54
|
-
* Jax.routes -> Jax.RouteSet
|
55
|
-
**/
|
56
|
-
Jax.routes = new Jax.RouteSet();
|
57
|
-
|
58
|
-
/**
|
59
|
-
* Jax.loaded -> Boolean
|
60
|
-
* True after Jax has been loaded.
|
61
|
-
**/
|
62
|
-
Jax.loaded = true;
|
63
|
-
|
64
|
-
/**
|
65
|
-
* Jax.render_speed -> Number
|
66
|
-
* Target number of milliseconds to wait between frames.
|
67
|
-
* This is not a guaranteed number in JavaScript, just a target. Most notably,
|
68
|
-
* system performance issues can drive the framerate down regardless of the
|
69
|
-
* target refresh rate.
|
70
|
-
*
|
71
|
-
* Defaults to 16, for a target rate of 60 frames per second.
|
72
|
-
**/
|
73
|
-
Jax.render_speed = 16;
|
74
|
-
|
75
|
-
/**
|
76
|
-
* Jax.update_speed -> Number
|
77
|
-
* Target number of milliseconds to wait between updates.
|
78
|
-
* This is not a guaranteed number in JavaScript, just a target. Most notably,
|
79
|
-
* system performance issues can drive the framerate down regardless of the
|
80
|
-
* target refresh rate.
|
81
|
-
*
|
82
|
-
* Defaults to 33, for a target rate of 30 updates per second.
|
83
|
-
**/
|
84
|
-
Jax.update_speed = 33;
|
85
|
-
|
86
|
-
|
87
|
-
/**
|
88
|
-
* Jax.max_lights -> Number
|
89
|
-
*
|
90
|
-
* If set, Jax will raise an error whenever more than this number of light sources
|
91
|
-
* are activated at one time.
|
92
|
-
*
|
93
|
-
* By default, there is no limit to the number of lights Jax can support. (This
|
94
|
-
* property is undefined by default.)
|
95
|
-
**/
|
96
|
-
Jax.max_lights = undefined;
|
97
|
-
|
98
|
-
/**
|
99
|
-
* Jax.uptime -> Number
|
100
|
-
*
|
101
|
-
* The amount of time the Jax subsystem has been running, in seconds. This is updated
|
102
|
-
* whether any contexts are active or not. It is used for tracking update intervals
|
103
|
-
* and framerates, so that individual Jax contexts are not constantly spawning new
|
104
|
-
* Date() instances (which then have to be garbage collected).
|
105
|
-
**/
|
106
|
-
Jax.uptime = 0.0;
|
107
|
-
Jax.uptime_tracker = new Date();
|
108
|
-
|
109
|
-
/* TODO: verify : is setInterval better for updates, or should be we using requestAnimFrame? */
|
110
|
-
setInterval(function() { Jax.uptime = (new Date() - Jax.uptime_tracker) / 1000; }, 33);
|
111
|
-
|
112
|
-
//= require "jax/builtin/all.js"
|
113
|
-
|
114
|
-
/*
|
115
|
-
FIXME Resource manager looks for an object in the global namespace, so using Jax.Scene.LightSource
|
116
|
-
instead of just LightSource results in a broken resource load.
|
117
|
-
*/
|
118
|
-
var LightSource = Jax.Scene.LightSource;
|
119
|
-
var Material = Jax.Material;
|
data/src/jax/anim_frame.js
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Copyright 2010, Google Inc.
|
3
|
-
* All rights reserved.
|
4
|
-
*
|
5
|
-
* Redistribution and use in source and binary forms, with or without
|
6
|
-
* modification, are permitted provided that the following conditions are
|
7
|
-
* met:
|
8
|
-
*
|
9
|
-
* * Redistributions of source code must retain the above copyright
|
10
|
-
* notice, this list of conditions and the following disclaimer.
|
11
|
-
* * Redistributions in binary form must reproduce the above
|
12
|
-
* copyright notice, this list of conditions and the following disclaimer
|
13
|
-
* in the documentation and/or other materials provided with the
|
14
|
-
* distribution.
|
15
|
-
* * Neither the name of Google Inc. nor the names of its
|
16
|
-
* contributors may be used to endorse or promote products derived from
|
17
|
-
* this software without specific prior written permission.
|
18
|
-
*
|
19
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
20
|
-
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
21
|
-
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
22
|
-
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
23
|
-
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
24
|
-
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
25
|
-
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
26
|
-
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
27
|
-
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
28
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
29
|
-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
30
|
-
*/
|
31
|
-
|
32
|
-
|
33
|
-
/**
|
34
|
-
* Global#requestAnimFrame(callback, element) -> undefined
|
35
|
-
* - callback (Function): callback to be fired to initiate a render sequence
|
36
|
-
* - element (DOMElement): a DOM element to attach the animation state to
|
37
|
-
*
|
38
|
-
* Provides requestAnimationFrame in a cross browser way.
|
39
|
-
**/
|
40
|
-
window.requestAnimFrame = (function() {
|
41
|
-
return window.requestAnimationFrame ||
|
42
|
-
window.webkitRequestAnimationFrame ||
|
43
|
-
window.mozRequestAnimationFrame ||
|
44
|
-
window.oRequestAnimationFrame ||
|
45
|
-
window.msRequestAnimationFrame ||
|
46
|
-
function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
|
47
|
-
window.setTimeout(callback, 1000/60);
|
48
|
-
};
|
49
|
-
})();
|
50
|
-
|
51
|
-
|
data/src/jax/builtin/all.js
DELETED
@@ -1,83 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* class Jax.Mesh.Cube < Jax.Mesh
|
3
|
-
*
|
4
|
-
* Constructs a 6-sided Cube mesh.
|
5
|
-
*
|
6
|
-
* Options:
|
7
|
-
*
|
8
|
-
* * width : the width of the cube in units. Defaults to +size+.
|
9
|
-
* * height : the height of the cube in units. Defaults to +size+.
|
10
|
-
* * depth : the depth of the cube in units. Defaults to +size+.
|
11
|
-
* * size : a value to use for any of the other options if
|
12
|
-
* they are unspecified. Defaults to 1.0.
|
13
|
-
*
|
14
|
-
* Example:
|
15
|
-
*
|
16
|
-
* new Jax.Mesh.Cube(); //=> 1x1x1
|
17
|
-
* new Jax.Mesh.Cube({size:2}); //=> 2x2x2
|
18
|
-
* new Jax.Mesh.Cube({width:2}); //=> 2x1x1
|
19
|
-
* new Jax.Mesh.Cube({width:2,depth:3}); //=> 2x1x3
|
20
|
-
*
|
21
|
-
**/
|
22
|
-
Jax.Mesh.Cube = Jax.Class.create(Jax.Mesh, {
|
23
|
-
initialize: function($super, options) {
|
24
|
-
var size = options && options.size || 1.0;
|
25
|
-
options = Jax.Util.normalizeOptions(options, {
|
26
|
-
width: size,
|
27
|
-
depth: size,
|
28
|
-
height: size
|
29
|
-
});
|
30
|
-
this.draw_mode = GL_TRIANGLES;
|
31
|
-
$super(options);
|
32
|
-
|
33
|
-
var w = options.width, h = options.height, d = options.depth;
|
34
|
-
this.sides = {};
|
35
|
-
|
36
|
-
this.sides.left = new Jax.Model({mesh: new Jax.Mesh.Quad(d, h)});
|
37
|
-
this.sides.left.camera.orient([-1,0,0], [0,1,0], [-w/2,0,0]);
|
38
|
-
|
39
|
-
this.sides.right = new Jax.Model({mesh: new Jax.Mesh.Quad(d, h)});
|
40
|
-
this.sides.right.camera.orient([1,0,0], [0,1,0], [w/2,0,0]);
|
41
|
-
|
42
|
-
this.sides.front = new Jax.Model({mesh: new Jax.Mesh.Quad(w, h)});
|
43
|
-
this.sides.front.camera.orient([0,0,1], [0,1,0], [0,0,d/2]);
|
44
|
-
|
45
|
-
this.sides.back = new Jax.Model({mesh: new Jax.Mesh.Quad(w, h)});
|
46
|
-
this.sides.back.camera.orient([0,0,-1], [0,1,0], [0,0,-d/2]);
|
47
|
-
|
48
|
-
this.sides.top = new Jax.Model({mesh: new Jax.Mesh.Quad(w, d)});
|
49
|
-
this.sides.top.camera.orient([0,1,0], [0,0,1], [0,h/2,0]);
|
50
|
-
|
51
|
-
this.sides.bottom = new Jax.Model({mesh: new Jax.Mesh.Quad(w, d)});
|
52
|
-
this.sides.bottom.camera.orient([0,-1,0], [0,0,-1], [0,-h/2,0]);
|
53
|
-
},
|
54
|
-
|
55
|
-
init: function(verts, colors, texes, norms) {
|
56
|
-
// we need to get each quad's vertices, but then transform them by the object's
|
57
|
-
// local transformation, which includes the position offset and direction.
|
58
|
-
|
59
|
-
var matrix;
|
60
|
-
for (var i in this.sides)
|
61
|
-
{
|
62
|
-
var qverts = [], qcolor = [], qtex = [], qnorm = [];
|
63
|
-
this.sides[i].mesh.init(qverts, qcolor, qtex, qnorm, []);
|
64
|
-
matrix = this.sides[i].camera.getTransformationMatrix();
|
65
|
-
|
66
|
-
// unfortunately quads are rendered in triangle strips; we need to translate that
|
67
|
-
// into triangles, because there's no support at this time for ending one triangle
|
68
|
-
// strip and beginning another.
|
69
|
-
function push(verti) {
|
70
|
-
var i1 = verti*3, i2 = verti*3+1, i3 = verti*3+2;
|
71
|
-
var vert = mat4.multiplyVec3(matrix, [qverts[i1], qverts[i2], qverts[i3]]);
|
72
|
-
var norm = mat4.multiplyVec3(matrix, [qnorm[i1], qnorm[i2], qnorm[i3]]);
|
73
|
-
|
74
|
-
verts.push(vert[0], vert[1], vert[2]);
|
75
|
-
norms.push(norm[0], norm[1], norm[2]);
|
76
|
-
if (qcolor.length != 0) colors.push(qcolor[verti*4], qcolor[verti*4+1], qcolor[verti*4+2], qcolor[verti*4+3]);
|
77
|
-
if (qtex.length != 0) texes. push(-qtex [verti*2], qtex[verti*2+1]);//, qtex [i3]);
|
78
|
-
}
|
79
|
-
push(0); push(1); push(2); // tri1
|
80
|
-
push(2); push(1); push(3); // tri2
|
81
|
-
}
|
82
|
-
}
|
83
|
-
});
|
@@ -1,63 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* class Jax.Mesh.Plane < Jax.Mesh
|
3
|
-
*
|
4
|
-
* Constructs a multi-polygonal flat plane treating the center of
|
5
|
-
* the plane as the origin.
|
6
|
-
*
|
7
|
-
* Options:
|
8
|
-
*
|
9
|
-
* * width : the width of the cube in units. Defaults to +size+.
|
10
|
-
* * depth : the depth of the cube in units. Defaults to +size+.
|
11
|
-
* * size : a value to use for any of the other dimensional options if
|
12
|
-
* they are unspecified. Defaults to 500.0.
|
13
|
-
* * x_segments : the number of vertices along the plane's X axis.
|
14
|
-
* Defaults to +segments+.
|
15
|
-
* * z_segments : the number of vertices along the plane's Z axis.
|
16
|
-
* Defaults to +segments+.
|
17
|
-
* * segments : a value to use for any of the other segment count options
|
18
|
-
* if they are unspecified. Defaults to 20.
|
19
|
-
*
|
20
|
-
* Examples:
|
21
|
-
*
|
22
|
-
* new Jax.Mesh.Plane();
|
23
|
-
* new Jax.Mesh.Plane({size:2});
|
24
|
-
* new Jax.Mesh.Plane({width:2});
|
25
|
-
* new Jax.Mesh.Plane({width:2,x_segments:2});
|
26
|
-
*
|
27
|
-
**/
|
28
|
-
Jax.Mesh.Plane = Jax.Class.create(Jax.Mesh, {
|
29
|
-
initialize: function($super, options) {
|
30
|
-
options = options || {};
|
31
|
-
this.width = options.width || options.size || 500;
|
32
|
-
this.depth = options.depth || options.size || 500;
|
33
|
-
this.x_segments = options.x_segments || options.segments || 20;
|
34
|
-
this.z_segments = options.z_segments || options.segments || 20;
|
35
|
-
this.draw_mode = GL_TRIANGLE_STRIP;
|
36
|
-
$super(options);
|
37
|
-
},
|
38
|
-
|
39
|
-
init: function(verts, colors, texes, norms) {
|
40
|
-
var w = this.width, d = this.depth, x_seg = this.x_segments, z_seg = this.z_segments;
|
41
|
-
|
42
|
-
var x_unit = w / x_seg, z_unit = d / z_seg;
|
43
|
-
var x, z, vx, vz;
|
44
|
-
|
45
|
-
for (x = 1; x < x_seg; x++) {
|
46
|
-
for (z = 0; z < z_seg; z++) {
|
47
|
-
vx = x_unit * x - w / 2;
|
48
|
-
vz = z_unit * z - d / 2;
|
49
|
-
verts.push(vx, 0, vz);
|
50
|
-
verts.push(vx-x_unit, 0, vz);
|
51
|
-
norms.push(0,1,0, 0,1,0);
|
52
|
-
}
|
53
|
-
|
54
|
-
for (z = z_seg-1; z >= 0; z--) {
|
55
|
-
vx = x_unit * x - w / 2;
|
56
|
-
vz = z_unit * z - d / 2;
|
57
|
-
verts.push(vx-x_unit, 0, vz);
|
58
|
-
verts.push(vx, 0, vz);
|
59
|
-
norms.push(0,1,0, 0,1,0);
|
60
|
-
}
|
61
|
-
}
|
62
|
-
}
|
63
|
-
});
|
@@ -1,86 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* class Jax.Mesh.Quad < Jax.Mesh
|
3
|
-
*
|
4
|
-
* A simple square or rectangle. You can adjust its width and height, and that's about it.
|
5
|
-
*
|
6
|
-
* This mesh is generally used for testing purposes, or for simple, textured objects like smoke particles.
|
7
|
-
*
|
8
|
-
* Options:
|
9
|
-
*
|
10
|
-
* * width : the width of this quad in units along the X axis. Defaults to +size+.
|
11
|
-
* * height : the height of this quad in units along the Y axis. Defaults to +size+.
|
12
|
-
* * size : a value to use for both width and height. Defaults to 1.0.
|
13
|
-
*
|
14
|
-
* Examples:
|
15
|
-
*
|
16
|
-
* var quad = new Jax.Mesh.Quad({width: 2, height: 1});
|
17
|
-
* var quad = new Jax.Mesh.Quad({size:1.5});
|
18
|
-
*
|
19
|
-
**/
|
20
|
-
Jax.Mesh.Quad = (function() {
|
21
|
-
return Jax.Class.create(Jax.Mesh, {
|
22
|
-
initialize: function($super, options) {
|
23
|
-
if (typeof(options) == "number") { options = {width:options, height:options}; }
|
24
|
-
|
25
|
-
options = Jax.Util.normalizeOptions(options, {
|
26
|
-
width:options && options.size ? options.size : 1,
|
27
|
-
height:options && options.size ? options.size : 1
|
28
|
-
});
|
29
|
-
|
30
|
-
this.draw_mode = GL_TRIANGLE_STRIP;
|
31
|
-
$super(options);
|
32
|
-
|
33
|
-
this.setSize(options.width, options.height);
|
34
|
-
},
|
35
|
-
|
36
|
-
/**
|
37
|
-
* Jax.Mesh.Quad#setWidth(width) -> undefined
|
38
|
-
* - width (Number): the width of this quad in WebGL Units.
|
39
|
-
* Sets the width of this quad.
|
40
|
-
**/
|
41
|
-
setWidth: function(width) { this.setSize(width, this.height); },
|
42
|
-
|
43
|
-
/**
|
44
|
-
* Jax.Mesh.Quad#setHeight(height) -> undefined
|
45
|
-
* - height (Number): the height of this quad in WebGL Units.
|
46
|
-
* Sets the height of this quad.
|
47
|
-
**/
|
48
|
-
setHeight:function(height){ this.setHeight(this.width, height); },
|
49
|
-
|
50
|
-
/**
|
51
|
-
* Jax.Mesh.Quad#setSize(width, height) -> undefined
|
52
|
-
* - width (Number): the width of this quad in WebGL Units.
|
53
|
-
* - height (Number): the height of this quad in WebGL Units.
|
54
|
-
* Sets the width and height of this quad.
|
55
|
-
**/
|
56
|
-
setSize: function(width, height) {
|
57
|
-
this.width = width;
|
58
|
-
this.height = height;
|
59
|
-
this.rebuild();
|
60
|
-
},
|
61
|
-
|
62
|
-
init: function(verts, colors, textureCoords, normals) {
|
63
|
-
var width = this.width/2, height = this.height/2;
|
64
|
-
|
65
|
-
verts.push(-width, height, 0);
|
66
|
-
verts.push(-width, -height, 0);
|
67
|
-
verts.push( width, height, 0);
|
68
|
-
verts.push( width, -height, 0);
|
69
|
-
|
70
|
-
colors.push(1,1,1,1);
|
71
|
-
colors.push(1,1,1,1);
|
72
|
-
colors.push(1,1,1,1);
|
73
|
-
colors.push(1,1,1,1);
|
74
|
-
|
75
|
-
textureCoords.push(0, 1);
|
76
|
-
textureCoords.push(0, 0);
|
77
|
-
textureCoords.push(1, 1);
|
78
|
-
textureCoords.push(1, 0);
|
79
|
-
|
80
|
-
normals.push(0,0,1);
|
81
|
-
normals.push(0,0,1);
|
82
|
-
normals.push(0,0,1);
|
83
|
-
normals.push(0,0,1);
|
84
|
-
}
|
85
|
-
});
|
86
|
-
})();
|
@@ -1,65 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* class Jax.Mesh.Sphere < Jax.Mesh
|
3
|
-
*
|
4
|
-
* A spherical mesh.
|
5
|
-
*
|
6
|
-
* Takes 3 options:
|
7
|
-
*
|
8
|
-
* * radius: the size of this sphere. Defaults to 1.
|
9
|
-
* * slices: the number of lines of longitude. The higher this value is, the smoother and more perfect the sphere will
|
10
|
-
* appear but the more hardware-intensive rendering it will be. Defaults to 30.
|
11
|
-
* * stacks: The number of lines of latitude. The higher this value is, the smoother and more perfect the sphere will
|
12
|
-
* appear but the more hardware-intensive rendering it will be. Defaults to 30.
|
13
|
-
*
|
14
|
-
* Examples:
|
15
|
-
*
|
16
|
-
* new Jax.Mesh.Sphere({radius:2.0});
|
17
|
-
* new Jax.Mesh.Sphere({slices:8, stacks:8, radius: 10.0});
|
18
|
-
*
|
19
|
-
**/
|
20
|
-
Jax.Mesh.Sphere = Jax.Class.create(Jax.Mesh, {
|
21
|
-
initialize: function($super, options) {
|
22
|
-
options = options || {};
|
23
|
-
this.slices = options.slices || 30;
|
24
|
-
this.stacks = options.stacks || 30;
|
25
|
-
this.radius = options.radius || 1;
|
26
|
-
$super(options);
|
27
|
-
},
|
28
|
-
|
29
|
-
init: function(vertices, colors, textureCoords, normals, indices) {
|
30
|
-
var slices = this.slices, stacks = this.stacks;
|
31
|
-
var radius = this.radius;
|
32
|
-
var slice, stack;
|
33
|
-
for (slice = 0; slice <= slices; slice++) {
|
34
|
-
var theta = slice * Math.PI / slices;
|
35
|
-
var sinth = Math.sin(theta);
|
36
|
-
var costh = Math.cos(theta);
|
37
|
-
|
38
|
-
for (stack = 0; stack <= stacks; stack++) {
|
39
|
-
var phi = stack * 2 * Math.PI / stacks;
|
40
|
-
var sinph = Math.sin(phi);
|
41
|
-
var cosph = Math.cos(phi);
|
42
|
-
|
43
|
-
var x = cosph * sinth;
|
44
|
-
var y = costh;
|
45
|
-
var z = sinph * sinth;
|
46
|
-
var u = 1 - (stack / stacks);
|
47
|
-
var v = 1 - (slice / slices);
|
48
|
-
|
49
|
-
normals.push(x, y, z);
|
50
|
-
textureCoords.push(u, v);
|
51
|
-
vertices.push(radius * x, radius * y, radius * z);
|
52
|
-
colors.push(1, 1, 1, 1);
|
53
|
-
}
|
54
|
-
}
|
55
|
-
|
56
|
-
for (slice = 0; slice < slices; slice++) {
|
57
|
-
for (stack = 0; stack < stacks; stack++) {
|
58
|
-
var first = (slice * (stacks + 1)) + stack;
|
59
|
-
var second = first + stacks + 1;
|
60
|
-
indices.push(first, second, first+1);
|
61
|
-
indices.push(second, second+1, first+1);
|
62
|
-
}
|
63
|
-
}
|
64
|
-
}
|
65
|
-
});
|