From d188c11c6343794885cbdf9dd3d3baca16f6f5e6 Mon Sep 17 00:00:00 2001 From: rob-bateman Date: Wed, 22 Oct 2014 14:14:40 +0100 Subject: [PATCH] update for npm compatibility --- Gruntfile.js | 166 - build/awayjs-renderergl.d.ts | 6401 +++ build/awayjs-renderergl.js | 17846 ++++++++ build/awayjs-renderergl.js.map | 279 + build/stagegl-extensions.next.d.ts | 5318 --- build/stagegl-extensions.next.js | 19612 --------- build/stagegl-extensions.next.js.map | 1 - build/stagegl-extensions.next.min.js | 15 - libs/awayjs-core.next.d.ts | 15640 ------- libs/awayjs-core.next.js | 34946 ---------------- libs/awayjs-core.next.min.js | 17 - libs/molehill_js_flashbridge.swf | Bin 7713 -> 0 bytes libs/ref/js.d.ts | 20 - libs/stagegl-core.next.d.ts | 4515 -- libs/stagegl-core.next.js | 14250 ------- libs/stagegl-core.next.min.js | 10 - libs/swfobject.d.ts | 20 - libs/swfobject.js | 777 - package.json | 29 +- src/StageGLExtensions.ts | 15 - src/away/_definitions.ts | 157 - src/away/animators/ParticleAnimationSet.ts | 406 - src/away/animators/ParticleAnimator.ts | 164 - src/away/animators/SkeletonAnimationSet.ts | 125 - src/away/animators/SkeletonAnimator.ts | 622 - src/away/animators/VertexAnimationSet.ts | 197 - src/away/animators/VertexAnimator.ts | 190 - .../animators/data/AnimationSubGeometry.ts | 103 - src/away/animators/data/ColorSegmentPoint.ts | 33 - src/away/animators/data/JointPose.ts | 74 - .../animators/data/ParticleAnimationData.ts | 30 - src/away/animators/data/ParticleData.ts | 15 - src/away/animators/data/ParticleProperties.ts | 42 - .../animators/data/ParticlePropertiesMode.ts | 26 - src/away/animators/data/Skeleton.ts | 100 - src/away/animators/data/SkeletonJoint.ts | 37 - src/away/animators/data/SkeletonPose.ts | 120 - .../animators/data/VertexAnimationMode.ts | 23 - .../animators/nodes/AnimationClipNodeBase.ts | 118 - .../nodes/ParticleAccelerationNode.ts | 88 - .../nodes/ParticleBezierCurveNode.ts | 128 - .../animators/nodes/ParticleBillboardNode.ts | 74 - src/away/animators/nodes/ParticleColorNode.ts | 229 - .../animators/nodes/ParticleFollowNode.ts | 155 - .../nodes/ParticleInitialColorNode.ts | 109 - src/away/animators/nodes/ParticleNodeBase.ts | 142 - src/away/animators/nodes/ParticleOrbitNode.ts | 160 - .../animators/nodes/ParticleOscillatorNode.ts | 98 - .../animators/nodes/ParticlePositionNode.ts | 74 - .../nodes/ParticleRotateToHeadingNode.ts | 190 - .../nodes/ParticleRotateToPositionNode.ts | 214 - .../nodes/ParticleRotationalVelocityNode.ts | 154 - src/away/animators/nodes/ParticleScaleNode.ts | 122 - .../nodes/ParticleSegmentedColorNode.ts | 186 - .../nodes/ParticleSpriteSheetNode.ts | 195 - src/away/animators/nodes/ParticleTimeNode.ts | 105 - src/away/animators/nodes/ParticleUVNode.ts | 146 - .../animators/nodes/ParticleVelocityNode.ts | 82 - .../animators/nodes/SkeletonBinaryLERPNode.ts | 38 - src/away/animators/nodes/SkeletonClipNode.ts | 92 - .../animators/nodes/SkeletonDifferenceNode.ts | 38 - .../nodes/SkeletonDirectionalNode.ts | 47 - .../animators/nodes/SkeletonNaryLERPNode.ts | 66 - src/away/animators/nodes/VertexClipNode.ts | 79 - .../animators/states/AnimationClipState.ts | 172 - .../animators/states/AnimationStateBase.ts | 98 - .../states/ISkeletonAnimationState.ts | 12 - .../animators/states/IVertexAnimationState.ts | 28 - .../states/ParticleAccelerationState.ts | 67 - .../states/ParticleBezierCurveState.ts | 69 - .../states/ParticleBillboardState.ts | 86 - .../animators/states/ParticleColorState.ts | 174 - .../animators/states/ParticleFollowState.ts | 253 - .../states/ParticleInitialColorState.ts | 85 - .../animators/states/ParticleOrbitState.ts | 139 - .../states/ParticleOscillatorState.ts | 74 - .../animators/states/ParticlePositionState.ts | 72 - .../states/ParticleRotateToHeadingState.ts | 34 - .../states/ParticleRotateToPositionState.ts | 63 - .../states/ParticleRotationalVelocityState.ts | 92 - .../animators/states/ParticleScaleState.ts | 128 - .../states/ParticleSegmentedColorState.ts | 159 - .../states/ParticleSpriteSheetState.ts | 110 - .../animators/states/ParticleStateBase.ts | 106 - .../animators/states/ParticleTimeState.ts | 35 - src/away/animators/states/ParticleUVState.ts | 37 - .../animators/states/ParticleVelocityState.ts | 68 - .../states/SkeletonBinaryLERPState.ts | 143 - .../animators/states/SkeletonClipState.ts | 189 - .../states/SkeletonDifferenceState.ts | 146 - .../states/SkeletonDirectionalState.ts | 199 - .../animators/states/SkeletonNaryLERPState.ts | 220 - src/away/animators/states/VertexClipState.ts | 69 - .../transitions/CrossfadeTransition.ts | 26 - .../transitions/CrossfadeTransitionNode.ts | 25 - .../transitions/CrossfadeTransitionState.ts | 41 - .../transitions/IAnimationTransition.ts | 9 - src/away/core/base/ParticleGeometry.ts | 19 - src/away/core/pick/JSPickingCollider.ts | 148 - src/away/core/pick/PickingColliderBase.ts | 130 - src/away/core/pick/ShaderPicker.ts | 560 - src/away/debug/.gitignore | 0 src/away/events/AnimationStateEvent.ts | 71 - .../materials/methods/AmbientEnvMapMethod.ts | 80 - .../materials/methods/DiffuseCelMethod.ts | 133 - .../methods/DiffuseCompositeMethod.ts | 225 - .../materials/methods/DiffuseDepthMethod.ts | 73 - .../methods/DiffuseGradientMethod.ts | 132 - .../methods/DiffuseLightMapMethod.ts | 131 - .../methods/DiffuseSubSurfaceMethod.ts | 278 - .../materials/methods/DiffuseWrapMethod.ts | 114 - .../methods/EffectAlphaMaskMethod.ts | 95 - .../methods/EffectColorMatrixMethod.ts | 105 - .../materials/methods/EffectEnvMapMethod.ts | 141 - src/away/materials/methods/EffectFogMethod.ts | 133 - .../methods/EffectFresnelEnvMapMethod.ts | 194 - .../materials/methods/EffectLightMapMethod.ts | 125 - .../methods/EffectRefractionEnvMapMethod.ts | 282 - .../materials/methods/EffectRimLightMethod.ts | 172 - .../methods/NormalHeightMapMethod.ts | 95 - .../methods/NormalSimpleWaterMethod.ts | 184 - .../materials/methods/ShadowCascadeMethod.ts | 262 - .../materials/methods/ShadowDitheredMethod.ts | 291 - .../materials/methods/ShadowFilteredMethod.ts | 135 - .../materials/methods/ShadowNearMethod.ts | 229 - .../materials/methods/ShadowSoftMethod.ts | 207 - .../methods/SpecularAnisotropicMethod.ts | 91 - .../materials/methods/SpecularCelMethod.ts | 106 - .../methods/SpecularCompositeMethod.ts | 221 - .../methods/SpecularFresnelMethod.ts | 152 - .../materials/methods/SpecularPhongMethod.ts | 79 - .../materials/passes/SingleObjectDepthPass.ts | 207 - src/away/parsers/AWDParser.ts | 2876 -- src/away/parsers/MD2Parser.ts | 502 - src/away/parsers/MD5AnimParser.ts | 647 - src/away/parsers/MD5MeshParser.ts | 682 - src/away/parsers/Max3DSParser.ts | 866 - src/away/parsers/OBJParser.ts | 1145 - src/away/parsers/Parsers.ts | 59 - src/away/tools/commands/Merge.ts | 364 - .../tools/data/ParticleGeometryTransform.ts | 46 - .../tools/helpers/ParticleGeometryHelper.ts | 202 - src/away/utils/PerspectiveMatrix3D.ts | 19 - tests/frame.html | 9 +- tests/index.html | 18 +- tests/js/AWDParserTest.js | 101 - tests/js/AWDParserTest.js.map | 1 - tests/js/AWDSuzanne.js | 143 - tests/js/AWDSuzanne.js.map | 1 - tests/js/AppHarness.js | 395 - tests/js/AppHarness.js.map | 1 - tests/js/LightsShadowTest.js | 160 - tests/js/LightsShadowTest.js.map | 1 - tests/js/MaterialAlphaTest.js | 214 - tests/js/MaterialAlphaTest.js.map | 1 - tests/js/MaterialEnvMapTest.js | 106 - tests/js/MaterialEnvMapTest.js.map | 1 - tests/js/ObjChiefTestDay.js | 163 - tests/js/ObjChiefTestDay.js.map | 1 - tests/js/ObjParserTest.js | 83 - tests/js/ObjParserTest.js.map | 1 - tests/lights/LightsShadowTest.ts | 324 +- tests/materials/MaterialAlphaTest.ts | 445 +- tests/materials/MaterialEnvMapTest.ts | 187 +- tests/parsers/AWDParserTest.ts | 201 +- tests/parsers/AWDSuzanne.ts | 260 +- tests/parsers/ObjChiefTestDay.ts | 326 +- tests/parsers/ObjParserTest.ts | 167 +- 168 files changed, 25510 insertions(+), 119506 deletions(-) delete mode 100644 Gruntfile.js create mode 100755 build/awayjs-renderergl.d.ts create mode 100755 build/awayjs-renderergl.js create mode 100644 build/awayjs-renderergl.js.map delete mode 100644 build/stagegl-extensions.next.d.ts delete mode 100644 build/stagegl-extensions.next.js delete mode 100644 build/stagegl-extensions.next.js.map delete mode 100644 build/stagegl-extensions.next.min.js delete mode 100644 libs/awayjs-core.next.d.ts delete mode 100644 libs/awayjs-core.next.js delete mode 100644 libs/awayjs-core.next.min.js delete mode 100755 libs/molehill_js_flashbridge.swf delete mode 100644 libs/ref/js.d.ts delete mode 100644 libs/stagegl-core.next.d.ts delete mode 100644 libs/stagegl-core.next.js delete mode 100644 libs/stagegl-core.next.min.js delete mode 100644 libs/swfobject.d.ts delete mode 100755 libs/swfobject.js delete mode 100644 src/StageGLExtensions.ts delete mode 100644 src/away/_definitions.ts delete mode 100644 src/away/animators/ParticleAnimationSet.ts delete mode 100644 src/away/animators/ParticleAnimator.ts delete mode 100644 src/away/animators/SkeletonAnimationSet.ts delete mode 100644 src/away/animators/SkeletonAnimator.ts delete mode 100644 src/away/animators/VertexAnimationSet.ts delete mode 100644 src/away/animators/VertexAnimator.ts delete mode 100644 src/away/animators/data/AnimationSubGeometry.ts delete mode 100644 src/away/animators/data/ColorSegmentPoint.ts delete mode 100644 src/away/animators/data/JointPose.ts delete mode 100644 src/away/animators/data/ParticleAnimationData.ts delete mode 100644 src/away/animators/data/ParticleData.ts delete mode 100644 src/away/animators/data/ParticleProperties.ts delete mode 100644 src/away/animators/data/ParticlePropertiesMode.ts delete mode 100644 src/away/animators/data/Skeleton.ts delete mode 100644 src/away/animators/data/SkeletonJoint.ts delete mode 100644 src/away/animators/data/SkeletonPose.ts delete mode 100644 src/away/animators/data/VertexAnimationMode.ts delete mode 100644 src/away/animators/nodes/AnimationClipNodeBase.ts delete mode 100644 src/away/animators/nodes/ParticleAccelerationNode.ts delete mode 100644 src/away/animators/nodes/ParticleBezierCurveNode.ts delete mode 100644 src/away/animators/nodes/ParticleBillboardNode.ts delete mode 100644 src/away/animators/nodes/ParticleColorNode.ts delete mode 100644 src/away/animators/nodes/ParticleFollowNode.ts delete mode 100644 src/away/animators/nodes/ParticleInitialColorNode.ts delete mode 100644 src/away/animators/nodes/ParticleNodeBase.ts delete mode 100644 src/away/animators/nodes/ParticleOrbitNode.ts delete mode 100644 src/away/animators/nodes/ParticleOscillatorNode.ts delete mode 100644 src/away/animators/nodes/ParticlePositionNode.ts delete mode 100644 src/away/animators/nodes/ParticleRotateToHeadingNode.ts delete mode 100644 src/away/animators/nodes/ParticleRotateToPositionNode.ts delete mode 100644 src/away/animators/nodes/ParticleRotationalVelocityNode.ts delete mode 100644 src/away/animators/nodes/ParticleScaleNode.ts delete mode 100644 src/away/animators/nodes/ParticleSegmentedColorNode.ts delete mode 100644 src/away/animators/nodes/ParticleSpriteSheetNode.ts delete mode 100644 src/away/animators/nodes/ParticleTimeNode.ts delete mode 100644 src/away/animators/nodes/ParticleUVNode.ts delete mode 100644 src/away/animators/nodes/ParticleVelocityNode.ts delete mode 100644 src/away/animators/nodes/SkeletonBinaryLERPNode.ts delete mode 100644 src/away/animators/nodes/SkeletonClipNode.ts delete mode 100644 src/away/animators/nodes/SkeletonDifferenceNode.ts delete mode 100644 src/away/animators/nodes/SkeletonDirectionalNode.ts delete mode 100644 src/away/animators/nodes/SkeletonNaryLERPNode.ts delete mode 100644 src/away/animators/nodes/VertexClipNode.ts delete mode 100644 src/away/animators/states/AnimationClipState.ts delete mode 100644 src/away/animators/states/AnimationStateBase.ts delete mode 100644 src/away/animators/states/ISkeletonAnimationState.ts delete mode 100644 src/away/animators/states/IVertexAnimationState.ts delete mode 100644 src/away/animators/states/ParticleAccelerationState.ts delete mode 100644 src/away/animators/states/ParticleBezierCurveState.ts delete mode 100644 src/away/animators/states/ParticleBillboardState.ts delete mode 100644 src/away/animators/states/ParticleColorState.ts delete mode 100644 src/away/animators/states/ParticleFollowState.ts delete mode 100644 src/away/animators/states/ParticleInitialColorState.ts delete mode 100644 src/away/animators/states/ParticleOrbitState.ts delete mode 100644 src/away/animators/states/ParticleOscillatorState.ts delete mode 100644 src/away/animators/states/ParticlePositionState.ts delete mode 100644 src/away/animators/states/ParticleRotateToHeadingState.ts delete mode 100644 src/away/animators/states/ParticleRotateToPositionState.ts delete mode 100644 src/away/animators/states/ParticleRotationalVelocityState.ts delete mode 100644 src/away/animators/states/ParticleScaleState.ts delete mode 100644 src/away/animators/states/ParticleSegmentedColorState.ts delete mode 100644 src/away/animators/states/ParticleSpriteSheetState.ts delete mode 100644 src/away/animators/states/ParticleStateBase.ts delete mode 100644 src/away/animators/states/ParticleTimeState.ts delete mode 100644 src/away/animators/states/ParticleUVState.ts delete mode 100644 src/away/animators/states/ParticleVelocityState.ts delete mode 100644 src/away/animators/states/SkeletonBinaryLERPState.ts delete mode 100644 src/away/animators/states/SkeletonClipState.ts delete mode 100644 src/away/animators/states/SkeletonDifferenceState.ts delete mode 100644 src/away/animators/states/SkeletonDirectionalState.ts delete mode 100644 src/away/animators/states/SkeletonNaryLERPState.ts delete mode 100644 src/away/animators/states/VertexClipState.ts delete mode 100644 src/away/animators/transitions/CrossfadeTransition.ts delete mode 100644 src/away/animators/transitions/CrossfadeTransitionNode.ts delete mode 100644 src/away/animators/transitions/CrossfadeTransitionState.ts delete mode 100644 src/away/animators/transitions/IAnimationTransition.ts delete mode 100644 src/away/core/base/ParticleGeometry.ts delete mode 100644 src/away/core/pick/JSPickingCollider.ts delete mode 100644 src/away/core/pick/PickingColliderBase.ts delete mode 100644 src/away/core/pick/ShaderPicker.ts delete mode 100644 src/away/debug/.gitignore delete mode 100644 src/away/events/AnimationStateEvent.ts delete mode 100644 src/away/materials/methods/AmbientEnvMapMethod.ts delete mode 100644 src/away/materials/methods/DiffuseCelMethod.ts delete mode 100755 src/away/materials/methods/DiffuseCompositeMethod.ts delete mode 100644 src/away/materials/methods/DiffuseDepthMethod.ts delete mode 100644 src/away/materials/methods/DiffuseGradientMethod.ts delete mode 100644 src/away/materials/methods/DiffuseLightMapMethod.ts delete mode 100644 src/away/materials/methods/DiffuseSubSurfaceMethod.ts delete mode 100644 src/away/materials/methods/DiffuseWrapMethod.ts delete mode 100644 src/away/materials/methods/EffectAlphaMaskMethod.ts delete mode 100644 src/away/materials/methods/EffectColorMatrixMethod.ts delete mode 100755 src/away/materials/methods/EffectEnvMapMethod.ts delete mode 100644 src/away/materials/methods/EffectFogMethod.ts delete mode 100644 src/away/materials/methods/EffectFresnelEnvMapMethod.ts delete mode 100644 src/away/materials/methods/EffectLightMapMethod.ts delete mode 100644 src/away/materials/methods/EffectRefractionEnvMapMethod.ts delete mode 100644 src/away/materials/methods/EffectRimLightMethod.ts delete mode 100644 src/away/materials/methods/NormalHeightMapMethod.ts delete mode 100755 src/away/materials/methods/NormalSimpleWaterMethod.ts delete mode 100644 src/away/materials/methods/ShadowCascadeMethod.ts delete mode 100644 src/away/materials/methods/ShadowDitheredMethod.ts delete mode 100644 src/away/materials/methods/ShadowFilteredMethod.ts delete mode 100644 src/away/materials/methods/ShadowNearMethod.ts delete mode 100644 src/away/materials/methods/ShadowSoftMethod.ts delete mode 100644 src/away/materials/methods/SpecularAnisotropicMethod.ts delete mode 100644 src/away/materials/methods/SpecularCelMethod.ts delete mode 100755 src/away/materials/methods/SpecularCompositeMethod.ts delete mode 100755 src/away/materials/methods/SpecularFresnelMethod.ts delete mode 100644 src/away/materials/methods/SpecularPhongMethod.ts delete mode 100644 src/away/materials/passes/SingleObjectDepthPass.ts delete mode 100644 src/away/parsers/AWDParser.ts delete mode 100644 src/away/parsers/MD2Parser.ts delete mode 100644 src/away/parsers/MD5AnimParser.ts delete mode 100644 src/away/parsers/MD5MeshParser.ts delete mode 100644 src/away/parsers/Max3DSParser.ts delete mode 100644 src/away/parsers/OBJParser.ts delete mode 100644 src/away/parsers/Parsers.ts delete mode 100644 src/away/tools/commands/Merge.ts delete mode 100644 src/away/tools/data/ParticleGeometryTransform.ts delete mode 100644 src/away/tools/helpers/ParticleGeometryHelper.ts delete mode 100644 src/away/utils/PerspectiveMatrix3D.ts delete mode 100644 tests/js/AWDParserTest.js delete mode 100644 tests/js/AWDParserTest.js.map delete mode 100644 tests/js/AWDSuzanne.js delete mode 100644 tests/js/AWDSuzanne.js.map delete mode 100644 tests/js/AppHarness.js delete mode 100644 tests/js/AppHarness.js.map delete mode 100644 tests/js/LightsShadowTest.js delete mode 100644 tests/js/LightsShadowTest.js.map delete mode 100644 tests/js/MaterialAlphaTest.js delete mode 100644 tests/js/MaterialAlphaTest.js.map delete mode 100644 tests/js/MaterialEnvMapTest.js delete mode 100644 tests/js/MaterialEnvMapTest.js.map delete mode 100644 tests/js/ObjChiefTestDay.js delete mode 100644 tests/js/ObjChiefTestDay.js.map delete mode 100644 tests/js/ObjParserTest.js delete mode 100644 tests/js/ObjParserTest.js.map diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index 478398a9e..000000000 --- a/Gruntfile.js +++ /dev/null @@ -1,166 +0,0 @@ -/**************************************************************************************************************************************************************** - * Grunt File Usage: - **************************************************************************************************************************************************************** - * - * Export Documentation, TypeScript and Minify: - * - * grunt - * - * Export TypeScript and Minify: - * - * grunt lib - * - ***************************************************************************************************************************************************************** - * Options - ***************************************************************************************************************************************************************** - * - * Export lib version, defaults to 'next' if not specified: - * - * grunt --libversion=0.0.1 - * - **************************************************************************************************************************************************************** - * Installing Dependencies: - **************************************************************************************************************************************************************** - * - * To install Grunt - * - * 1) install the grunt cli: - * - * npm install -g grunt-cli - * - * 2) install the dependencies used by the build script: - * - * OSX : sudo npm install - * Windows: npm install - * - ****************************************************************************************************************************************************************/ - -module.exports = function(grunt) { - - - var version = grunt.option('libversion') || 'next'; // Check for a version number | defaults to next if not specified - - //-------------------------------------------------------------------------------------------------------------- - // Plugins used by Grunt Script - //-------------------------------------------------------------------------------------------------------------- - - grunt.loadNpmTasks("grunt-ts"); - grunt.loadNpmTasks('grunt-contrib-yuidoc'); - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-contrib-concat'); - - //-------------------------------------------------------------------------------------------------------------- - // Grunt Config - //-------------------------------------------------------------------------------------------------------------- - - grunt.initConfig( { - - //-------------------------------------------------------------------------------------------------------------- - // Read the package.json - //-------------------------------------------------------------------------------------------------------------- - - pkg: grunt.file.readJSON('package.json'), - - //-------------------------------------------------------------------------------------------------------------- - // Metadata / Configuration - //-------------------------------------------------------------------------------------------------------------- - - meta: { - - tsFile: 'src/StageGLExtensions.ts', // TypeScript export source - tsPath: 'src/', // TypeScript source folder - - tsExportFile: 'build/stagegl-extensions.' + version + '.js', // JavaScript export target - tsExportUglyFile: 'build/stagegl-extensions.' + version + '.min.js', // JavaScript minified target - - tsExportFolder: 'build/', // Export folder - docsPath: 'docs/' // Documentation export path - - }, - - //-------------------------------------------------------------------------------------------------------------- - // Export and compile TypeScript - //-------------------------------------------------------------------------------------------------------------- - - ts: { - - MainJsFile: { - src: ['<%= meta.tsFile %>'], - out: '<%= meta.tsExportFile %>', - options: { - target: 'es5', - sourcemap: true, - declaration: true, - comments: true - } - } - }, - - //-------------------------------------------------------------------------------------------------------------- - // Concatenate file ( currently not used ) - //-------------------------------------------------------------------------------------------------------------- - - concat: { - options: { - // define a string to put between each file in the concatenated output - separator: ';' - }, - dist: { - // the files to concatenate - src: [ '<%= meta.tsExportFile %>' ], - // the location of the resulting JS file - dest: '' - - } - }, - - //-------------------------------------------------------------------------------------------------------------- - // Minify JavaScript source - //-------------------------------------------------------------------------------------------------------------- - - uglify: { - - options: { - mangle: false - }, - my_target: { - files: { - '<%= meta.tsExportUglyFile %>': [ '<%= meta.tsExportFile %>' ] - } - } - - }, - - //-------------------------------------------------------------------------------------------------------------- - // Export Documentation ( using multi export JS files ) - //-------------------------------------------------------------------------------------------------------------- - - yuidoc: { - - compile: { - - name: '<%= pkg.name %>', - description: '<%= pkg.description %>', - version: '<%= pkg.version %>', - url: '<%= pkg.homepage %>', - - options: { - extension:'.ts', - paths: '<%= meta.tsPath %>', - outdir: '<%= meta.docsPath %>' - } - } - } - - } ); - - //-------------------------------------------------------------------------------------------------------------- - // Register Grunt tasks - //-------------------------------------------------------------------------------------------------------------- - - grunt.option.init(); - grunt.registerTask('default', ['ts' , 'uglify' , 'yuidoc' ]); // Default Tasks - grunt.registerTask('lib', ['ts' , 'uglify' ]); // Export TypeScript only - -}; - diff --git a/build/awayjs-renderergl.d.ts b/build/awayjs-renderergl.d.ts new file mode 100755 index 000000000..f8c60976a --- /dev/null +++ b/build/awayjs-renderergl.d.ts @@ -0,0 +1,6401 @@ +declare module "awayjs-renderergl/lib/animators/data/ParticleData" { + import TriangleSubGeometry = require("awayjs-core/lib/core/base/TriangleSubGeometry"); + class ParticleData { + particleIndex: number; + numVertices: number; + startVertexIndex: number; + subGeometry: TriangleSubGeometry; + } + export = ParticleData; + +} +declare module "awayjs-renderergl/lib/animators/data/ParticleAnimationData" { + import ParticleData = require("awayjs-renderergl/lib/animators/data/ParticleData"); + /** + * ... + */ + class ParticleAnimationData { + index: number; + startTime: number; + totalTime: number; + duration: number; + delay: number; + startVertexIndex: number; + numVertices: number; + constructor(index: number, startTime: number, duration: number, delay: number, particle: ParticleData); + } + export = ParticleAnimationData; + +} +declare module "awayjs-renderergl/lib/animators/data/AnimationSubGeometry" { + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import IContextStageGL = require("awayjs-stagegl/lib/core/stagegl/IContextStageGL"); + import IVertexBuffer = require("awayjs-stagegl/lib/core/stagegl/IVertexBuffer"); + import ParticleAnimationData = require("awayjs-renderergl/lib/animators/data/ParticleAnimationData"); + /** + * ... + */ + class AnimationSubGeometry { + static SUBGEOM_ID_COUNT: number; + _pVertexData: number[]; + _pVertexBuffer: IVertexBuffer[]; + _pBufferContext: IContextStageGL[]; + _pBufferDirty: boolean[]; + private _numVertices; + private _totalLenOfOneVertex; + numProcessedVertices: number; + previousTime: number; + animationParticles: ParticleAnimationData[]; + /** + * An id for this animation subgeometry, used to identify animation subgeometries when using animation sets. + * + * @private + */ + _iUniqueId: number; + constructor(); + createVertexData(numVertices: number, totalLenOfOneVertex: number): void; + activateVertexBuffer(index: number, bufferOffset: number, stage: Stage, format: string): void; + dispose(): void; + invalidateBuffer(): void; + vertexData: number[]; + numVertices: number; + totalLenOfOneVertex: number; + } + export = AnimationSubGeometry; + +} +declare module "awayjs-renderergl/lib/animators/data/ParticleProperties" { + /** + * Dynamic class for holding the local properties of a particle, used for processing the static properties + * of particles in the particle animation set before beginning upload to the GPU. + */ + class ParticleProperties { + /** + * The index of the current particle being set. + */ + index: number; + /** + * The total number of particles being processed by the particle animation set. + */ + total: number; + /** + * The start time of the particle. + */ + startTime: number; + /** + * The duration of the particle, an optional value used when the particle aniamtion set settings for useDuration are enabled in the constructor. + * + * @see away.animators.ParticleAnimationSet + */ + duration: number; + /** + * The delay between cycles of the particle, an optional value used when the particle aniamtion set settings for useLooping and useDelay are enabled in the constructor. + * + * @see away.animators.ParticleAnimationSet + */ + delay: number; + } + export = ParticleProperties; + +} +declare module "awayjs-renderergl/lib/animators/data/ParticlePropertiesMode" { + /** + * Options for setting the properties mode of a particle animation node. + */ + class ParticlePropertiesMode { + /** + * Mode that defines the particle node as acting on global properties (ie. the properties set in the node constructor or the corresponding animation state). + */ + static GLOBAL: number; + /** + * Mode that defines the particle node as acting on local static properties (ie. the properties of particles set in the initialising on the animation set). + */ + static LOCAL_STATIC: number; + /** + * Mode that defines the particle node as acting on local dynamic properties (ie. the properties of the particles set in the corresponding animation state). + */ + static LOCAL_DYNAMIC: number; + } + export = ParticlePropertiesMode; + +} +declare module "awayjs-renderergl/lib/animators/nodes/ParticleNodeBase" { + import AnimationNodeBase = require("awayjs-core/lib/animators/nodes/AnimationNodeBase"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ParticleAnimationSet = require("awayjs-renderergl/lib/animators/ParticleAnimationSet"); + import ParticleProperties = require("awayjs-renderergl/lib/animators/data/ParticleProperties"); + /** + * Provides an abstract base class for particle animation nodes. + */ + class ParticleNodeBase extends AnimationNodeBase { + private _priority; + _pMode: number; + _pDataLength: number; + _pOneData: number[]; + _iDataOffset: number; + private static GLOBAL; + private static LOCAL_STATIC; + private static LOCAL_DYNAMIC; + private static MODES; + /** + * Returns the property mode of the particle animation node. Typically set in the node constructor + * + * @see away.animators.ParticlePropertiesMode + */ + mode: number; + /** + * Returns the priority of the particle animation node, used to order the agal generated in a particle animation set. Set automatically on instantiation. + * + * @see away.animators.ParticleAnimationSet + * @see #getAGALVertexCode + */ + priority: number; + /** + * Returns the length of the data used by the node when in LOCAL_STATIC mode. Used to generate the local static data of the particle animation set. + * + * @see away.animators.ParticleAnimationSet + * @see #getAGALVertexCode + */ + dataLength: number; + /** + * Returns the generated data vector of the node after one particle pass during the generation of all local static data of the particle animation set. + * + * @see away.animators.ParticleAnimationSet + * @see #generatePropertyOfOneParticle + */ + oneData: number[]; + /** + * Creates a new ParticleNodeBase object. + * + * @param name Defines the generic name of the particle animation node. + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + * @param dataLength Defines the length of the data used by the node when in LOCAL_STATIC mode. + * @param [optional] priority the priority of the particle animation node, used to order the agal generated in a particle animation set. Defaults to 1. + */ + constructor(name: string, mode: number, dataLength: number, priority?: number); + /** + * Returns the AGAL code of the particle animation node for use in the vertex shader. + */ + getAGALVertexCode(shaderObject: ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; + /** + * Returns the AGAL code of the particle animation node for use in the fragment shader. + */ + getAGALFragmentCode(shaderObject: ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; + /** + * Returns the AGAL code of the particle animation node for use in the fragment shader when UV coordinates are required. + */ + getAGALUVCode(shaderObject: ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; + /** + * Called internally by the particle animation set when assigning the set of static properties originally defined by the initParticleFunc of the set. + * + * @see away.animators.ParticleAnimationSet#initParticleFunc + */ + _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; + /** + * Called internally by the particle animation set when determining the requirements of the particle animation node AGAL. + */ + _iProcessAnimationSetting(particleAnimationSet: ParticleAnimationSet): void; + } + export = ParticleNodeBase; + +} +declare module "awayjs-renderergl/lib/events/AnimationStateEvent" { + import AnimationNodeBase = require("awayjs-core/lib/animators/nodes/AnimationNodeBase"); + import Event = require("awayjs-core/lib/events/Event"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import IAnimationState = require("awayjs-stagegl/lib/animators/states/IAnimationState"); + /** + * Dispatched to notify changes in an animation state's state. + */ + class AnimationStateEvent extends Event { + /** + * Dispatched when a non-looping clip node inside an animation state reaches the end of its timeline. + */ + static PLAYBACK_COMPLETE: string; + static TRANSITION_COMPLETE: string; + private _animator; + private _animationState; + private _animationNode; + /** + * Create a new AnimatonStateEvent + * + * @param type The event type. + * @param animator The animation state object that is the subject of this event. + * @param animationNode The animation node inside the animation state from which the event originated. + */ + constructor(type: string, animator: AnimatorBase, animationState: IAnimationState, animationNode: AnimationNodeBase); + /** + * The animator object that is the subject of this event. + */ + animator: AnimatorBase; + /** + * The animation state object that is the subject of this event. + */ + animationState: IAnimationState; + /** + * The animation node inside the animation state from which the event originated. + */ + animationNode: AnimationNodeBase; + /** + * Clones the event. + * + * @return An exact duplicate of the current object. + */ + clone(): Event; + } + export = AnimationStateEvent; + +} +declare module "awayjs-renderergl/lib/animators/states/AnimationStateBase" { + import AnimationNodeBase = require("awayjs-core/lib/animators/nodes/AnimationNodeBase"); + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import IAnimationState = require("awayjs-stagegl/lib/animators/states/IAnimationState"); + /** + * + */ + class AnimationStateBase implements IAnimationState { + _pAnimationNode: AnimationNodeBase; + _pRootDelta: Vector3D; + _pPositionDeltaDirty: boolean; + _pTime: number; + _pStartTime: number; + _pAnimator: AnimatorBase; + /** + * Returns a 3d vector representing the translation delta of the animating entity for the current timestep of animation + */ + positionDelta: Vector3D; + constructor(animator: AnimatorBase, animationNode: AnimationNodeBase); + /** + * Resets the start time of the node to a new value. + * + * @param startTime The absolute start time (in milliseconds) of the node's starting time. + */ + offset(startTime: number): void; + /** + * Updates the configuration of the node to its current state. + * + * @param time The absolute time (in milliseconds) of the animator's play head position. + * + * @see AnimatorBase#update() + */ + update(time: number): void; + /** + * Sets the animation phase of the node. + * + * @param value The phase value to use. 0 represents the beginning of an animation clip, 1 represents the end. + */ + phase(value: number): void; + /** + * Updates the node's internal playhead position. + * + * @param time The local time (in milliseconds) of the node's playhead position. + */ + _pUpdateTime(time: number): void; + /** + * Updates the node's root delta position + */ + _pUpdatePositionDelta(): void; + } + export = AnimationStateBase; + +} +declare module "awayjs-renderergl/lib/animators/states/ParticleStateBase" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import Camera = require("awayjs-core/lib/entities/Camera"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import ParticleAnimator = require("awayjs-renderergl/lib/animators/ParticleAnimator"); + import AnimationSubGeometry = require("awayjs-renderergl/lib/animators/data/AnimationSubGeometry"); + import ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); + import AnimationStateBase = require("awayjs-renderergl/lib/animators/states/AnimationStateBase"); + /** + * ... + */ + class ParticleStateBase extends AnimationStateBase { + private _particleNode; + _pDynamicProperties: Vector3D[]; + _pDynamicPropertiesDirty: Object; + _pNeedUpdateTime: boolean; + constructor(animator: ParticleAnimator, particleNode: ParticleNodeBase, needUpdateTime?: boolean); + needUpdateTime: boolean; + setRenderState(stage: Stage, renderable: RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: Camera): void; + _pUpdateDynamicProperties(animationSubGeometry: AnimationSubGeometry): void; + } + export = ParticleStateBase; + +} +declare module "awayjs-renderergl/lib/animators/ParticleAnimator" { + import Camera = require("awayjs-core/lib/entities/Camera"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ParticleAnimationSet = require("awayjs-renderergl/lib/animators/ParticleAnimationSet"); + /** + * Provides an interface for assigning paricle-based animation data sets to mesh-based entity objects + * and controlling the various available states of animation through an interative playhead that can be + * automatically updated or manually triggered. + * + * Requires that the containing geometry of the parent mesh is particle geometry + * + * @see away.base.ParticleGeometry + */ + class ParticleAnimator extends AnimatorBase { + private _particleAnimationSet; + private _animationParticleStates; + private _animatorParticleStates; + private _timeParticleStates; + private _totalLenOfOneVertex; + private _animatorSubGeometries; + /** + * Creates a new ParticleAnimator object. + * + * @param particleAnimationSet The animation data set containing the particle animations used by the animator. + */ + constructor(particleAnimationSet: ParticleAnimationSet); + /** + * @inheritDoc + */ + clone(): AnimatorBase; + /** + * @inheritDoc + */ + setRenderState(shaderObject: ShaderObjectBase, renderable: RenderableBase, stage: Stage, camera: Camera, vertexConstantOffset: number, vertexStreamOffset: number): void; + /** + * @inheritDoc + */ + testGPUCompatibility(shaderObject: ShaderObjectBase): void; + /** + * @inheritDoc + */ + start(): void; + /** + * @inheritDoc + */ + _pUpdateDeltaTime(dt: number): void; + /** + * @inheritDoc + */ + resetTime(offset?: number): void; + dispose(): void; + private getAnimatorSubGeometry(subMesh); + } + export = ParticleAnimator; + +} +declare module "awayjs-renderergl/lib/animators/states/ParticleTimeState" { + import Camera = require("awayjs-core/lib/entities/Camera"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import ParticleAnimator = require("awayjs-renderergl/lib/animators/ParticleAnimator"); + import AnimationSubGeometry = require("awayjs-renderergl/lib/animators/data/AnimationSubGeometry"); + import ParticleTimeNode = require("awayjs-renderergl/lib/animators/nodes/ParticleTimeNode"); + import ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); + /** + * ... + */ + class ParticleTimeState extends ParticleStateBase { + /** @private */ + static TIME_STREAM_INDEX: number; + /** @private */ + static TIME_CONSTANT_INDEX: number; + private _particleTimeNode; + constructor(animator: ParticleAnimator, particleTimeNode: ParticleTimeNode); + setRenderState(stage: Stage, renderable: RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: Camera): void; + } + export = ParticleTimeState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/ParticleTimeNode" { + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ParticleProperties = require("awayjs-renderergl/lib/animators/data/ParticleProperties"); + import ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); + import ParticleTimeState = require("awayjs-renderergl/lib/animators/states/ParticleTimeState"); + /** + * A particle animation node used as the base node for timekeeping inside a particle. Automatically added to a particle animation set on instatiation. + */ + class ParticleTimeNode extends ParticleNodeBase { + /** @private */ + _iUsesDuration: boolean; + /** @private */ + _iUsesDelay: boolean; + /** @private */ + _iUsesLooping: boolean; + /** + * Creates a new ParticleTimeNode + * + * @param [optional] usesDuration Defines whether the node uses the duration data in the static properties to determine how long a particle is visible for. Defaults to false. + * @param [optional] usesDelay Defines whether the node uses the delay data in the static properties to determine how long a particle is hidden for. Defaults to false. Requires usesDuration to be true. + * @param [optional] usesLooping Defines whether the node creates a looping timeframe for each particle determined by the startTime, duration and delay data in the static properties function. Defaults to false. Requires usesLooping to be true. + */ + constructor(usesDuration?: boolean, usesLooping?: boolean, usesDelay?: boolean); + /** + * @inheritDoc + */ + getAGALVertexCode(shaderObject: ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; + /** + * @inheritDoc + */ + getAnimationState(animator: AnimatorBase): ParticleTimeState; + /** + * @inheritDoc + */ + _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; + } + export = ParticleTimeNode; + +} +declare module "awayjs-renderergl/lib/core/base/ParticleGeometry" { + import Geometry = require("awayjs-core/lib/core/base/Geometry"); + import ParticleData = require("awayjs-renderergl/lib/animators/data/ParticleData"); + /** + * @class away.base.ParticleGeometry + */ + class ParticleGeometry extends Geometry { + particles: ParticleData[]; + numParticles: number; + } + export = ParticleGeometry; + +} +declare module "awayjs-renderergl/lib/animators/ParticleAnimationSet" { + import IAnimationSet = require("awayjs-core/lib/animators/IAnimationSet"); + import AnimationNodeBase = require("awayjs-core/lib/animators/nodes/AnimationNodeBase"); + import ISubMesh = require("awayjs-core/lib/core/base/ISubMesh"); + import Mesh = require("awayjs-core/lib/entities/Mesh"); + import AnimationSetBase = require("awayjs-stagegl/lib/animators/AnimationSetBase"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); + /** + * The animation data set used by particle-based animators, containing particle animation data. + * + * @see away.animators.ParticleAnimator + */ + class ParticleAnimationSet extends AnimationSetBase implements IAnimationSet { + /** @private */ + _iAnimationRegisterCache: AnimationRegisterCache; + private _timeNode; + /** + * Property used by particle nodes that require compilation at the end of the shader + */ + static POST_PRIORITY: number; + /** + * Property used by particle nodes that require color compilation + */ + static COLOR_PRIORITY: number; + private _animationSubGeometries; + private _particleNodes; + private _localDynamicNodes; + private _localStaticNodes; + private _totalLenOfOneVertex; + hasUVNode: boolean; + needVelocity: boolean; + hasBillboard: boolean; + hasColorMulNode: boolean; + hasColorAddNode: boolean; + /** + * Initialiser function for static particle properties. Needs to reference a with the following format + * + * + * initParticleFunc(prop:ParticleProperties) + * { + * //code for settings local properties + * } + * + * + * Aside from setting any properties required in particle animation nodes using local static properties, the initParticleFunc function + * is required to time node requirements as they may be needed. These properties on the ParticleProperties object can include + * startTime, duration and delay. The use of these properties is determined by the setting + * arguments passed in the constructor of the particle animation set. By default, only the startTime property is required. + */ + initParticleFunc: Function; + /** + * Initialiser function scope for static particle properties + */ + initParticleScope: Object; + /** + * Creates a new ParticleAnimationSet + * + * @param [optional] usesDuration Defines whether the animation set uses the duration data in its static properties to determine how long a particle is visible for. Defaults to false. + * @param [optional] usesLooping Defines whether the animation set uses a looping timeframe for each particle determined by the startTime, duration and delay data in its static properties function. Defaults to false. Requires usesDuration to be true. + * @param [optional] usesDelay Defines whether the animation set uses the delay data in its static properties to determine how long a particle is hidden for. Defaults to false. Requires usesLooping to be true. + */ + constructor(usesDuration?: boolean, usesLooping?: boolean, usesDelay?: boolean); + /** + * Returns a vector of the particle animation nodes contained within the set. + */ + particleNodes: ParticleNodeBase[]; + /** + * @inheritDoc + */ + addAnimation(node: AnimationNodeBase): void; + /** + * @inheritDoc + */ + activate(shaderObject: ShaderObjectBase, stage: Stage): void; + /** + * @inheritDoc + */ + deactivate(shaderObject: ShaderObjectBase, stage: Stage): void; + /** + * @inheritDoc + */ + getAGALVertexCode(shaderObject: ShaderObjectBase): string; + /** + * @inheritDoc + */ + getAGALUVCode(shaderObject: ShaderObjectBase): string; + /** + * @inheritDoc + */ + getAGALFragmentCode(shaderObject: ShaderObjectBase, shadedTarget: string): string; + /** + * @inheritDoc + */ + doneAGALCode(shaderObject: ShaderObjectBase): void; + /** + * @inheritDoc + */ + usesCPU: boolean; + /** + * @inheritDoc + */ + cancelGPUCompatibility(): void; + dispose(): void; + getAnimationSubGeometry(subMesh: ISubMesh): any; + /** @private */ + _iGenerateAnimationSubGeometries(mesh: Mesh): void; + } + export = ParticleAnimationSet; + +} +declare module "awayjs-renderergl/lib/animators/SkeletonAnimationSet" { + import IAnimationSet = require("awayjs-core/lib/animators/IAnimationSet"); + import AnimationSetBase = require("awayjs-stagegl/lib/animators/AnimationSetBase"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + /** + * The animation data set used by skeleton-based animators, containing skeleton animation data. + * + * @see away.animators.SkeletonAnimator + */ + class SkeletonAnimationSet extends AnimationSetBase implements IAnimationSet { + private _jointsPerVertex; + /** + * Returns the amount of skeleton joints that can be linked to a single vertex via skinned weight values. For GPU-base animation, the + * maximum allowed value is 4. + */ + jointsPerVertex: number; + /** + * Creates a new SkeletonAnimationSet object. + * + * @param jointsPerVertex Sets the amount of skeleton joints that can be linked to a single vertex via skinned weight values. For GPU-base animation, the maximum allowed value is 4. Defaults to 4. + */ + constructor(jointsPerVertex?: number); + /** + * @inheritDoc + */ + getAGALVertexCode(shaderObject: ShaderObjectBase): string; + /** + * @inheritDoc + */ + activate(shaderObject: ShaderObjectBase, stage: Stage): void; + /** + * @inheritDoc + */ + deactivate(shaderObject: ShaderObjectBase, stage: Stage): void; + /** + * @inheritDoc + */ + getAGALFragmentCode(shaderObject: ShaderObjectBase, shadedTarget: string): string; + /** + * @inheritDoc + */ + getAGALUVCode(shaderObject: ShaderObjectBase): string; + /** + * @inheritDoc + */ + doneAGALCode(shaderObject: ShaderObjectBase): void; + } + export = SkeletonAnimationSet; + +} +declare module "awayjs-renderergl/lib/animators/data/JointPose" { + import Matrix3D = require("awayjs-core/lib/core/geom/Matrix3D"); + import Quaternion = require("awayjs-core/lib/core/geom/Quaternion"); + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + /** + * Contains transformation data for a skeleton joint, used for skeleton animation. + * + * @see away.animation.Skeleton + * @see away.animation.SkeletonJoint + * + * todo: support (uniform) scale + */ + class JointPose { + /** + * The name of the joint to which the pose is associated + */ + name: string; + /** + * The rotation of the pose stored as a quaternion + */ + orientation: Quaternion; + /** + * The translation of the pose + */ + translation: Vector3D; + constructor(); + /** + * Converts the transformation to a Matrix3D representation. + * + * @param target An optional target matrix to store the transformation. If not provided, it will create a new instance. + * @return The transformation matrix of the pose. + */ + toMatrix3D(target?: Matrix3D): Matrix3D; + /** + * Copies the transformation data from a source pose object into the existing pose object. + * + * @param pose The source pose to copy from. + */ + copyFrom(pose: JointPose): void; + } + export = JointPose; + +} +declare module "awayjs-renderergl/lib/animators/data/SkeletonJoint" { + /** + * A value obect representing a single joint in a skeleton object. + * + * @see away.animators.Skeleton + */ + class SkeletonJoint { + /** + * The index of the parent joint in the skeleton's joints vector. + * + * @see away.animators.Skeleton#joints + */ + parentIndex: number; + /** + * The name of the joint + */ + name: string; + /** + * The inverse bind pose matrix, as raw data, used to transform vertices to bind joint space in preparation for transformation using the joint matrix. + */ + inverseBindPose: number[]; + /** + * Creates a new SkeletonJoint object + */ + constructor(); + } + export = SkeletonJoint; + +} +declare module "awayjs-renderergl/lib/animators/data/Skeleton" { + import SkeletonJoint = require("awayjs-renderergl/lib/animators/data/SkeletonJoint"); + import IAsset = require("awayjs-core/lib/core/library/IAsset"); + import NamedAssetBase = require("awayjs-core/lib/core/library/NamedAssetBase"); + /** + * A Skeleton object is a hierarchical grouping of joint objects that can be used for skeletal animation. + * + * @see away.animators.SkeletonJoint + */ + class Skeleton extends NamedAssetBase implements IAsset { + /** + * A flat list of joint objects that comprise the skeleton. Every joint except for the root has a parentIndex + * property that is an index into this list. + * A child joint should always have a higher index than its parent. + */ + joints: SkeletonJoint[]; + /** + * The total number of joints in the skeleton. + */ + numJoints: number; + /** + * Creates a new Skeleton object + */ + constructor(); + /** + * Returns the joint object in the skeleton with the given name, otherwise returns a null object. + * + * @param jointName The name of the joint object to be found. + * @return The joint object with the given name. + * + * @see #joints + */ + jointFromName(jointName: string): SkeletonJoint; + /** + * Returns the joint index, given the joint name. -1 is returned if the joint name is not found. + * + * @param jointName The name of the joint object to be found. + * @return The index of the joint object in the joints Array + * + * @see #joints + */ + jointIndexFromName(jointName: string): number; + /** + * @inheritDoc + */ + dispose(): void; + /** + * @inheritDoc + */ + assetType: string; + } + export = Skeleton; + +} +declare module "awayjs-renderergl/lib/animators/data/SkeletonPose" { + import JointPose = require("awayjs-renderergl/lib/animators/data/JointPose"); + import IAsset = require("awayjs-core/lib/core/library/IAsset"); + import NamedAssetBase = require("awayjs-core/lib/core/library/NamedAssetBase"); + /** + * A collection of pose objects, determining the pose for an entire skeleton. + * The jointPoses vector object corresponds to a skeleton's joints vector object, however, there is no + * reference to a skeleton's instance, since several skeletons can be influenced by the same pose (eg: animation + * clips are added to any animator with a valid skeleton) + * + * @see away.animators.Skeleton + * @see away.animators.JointPose + */ + class SkeletonPose extends NamedAssetBase implements IAsset { + /** + * A flat list of pose objects that comprise the skeleton pose. The pose indices correspond to the target skeleton's joint indices. + * + * @see away.animators.Skeleton#joints + */ + jointPoses: JointPose[]; + /** + * The total number of joint poses in the skeleton pose. + */ + numJointPoses: number; + /** + * Creates a new SkeletonPose object. + */ + constructor(); + /** + * @inheritDoc + */ + assetType: string; + /** + * Returns the joint pose object with the given joint name, otherwise returns a null object. + * + * @param jointName The name of the joint object whose pose is to be found. + * @return The pose object with the given joint name. + */ + jointPoseFromName(jointName: string): JointPose; + /** + * Returns the pose index, given the joint name. -1 is returned if the joint name is not found in the pose. + * + * @param The name of the joint object whose pose is to be found. + * @return The index of the pose object in the jointPoses Array + * + * @see #jointPoses + */ + jointPoseIndexFromName(jointName: string): number; + /** + * Creates a copy of the SkeletonPose object, with a dulpicate of its component joint poses. + * + * @return SkeletonPose + */ + clone(): SkeletonPose; + /** + * @inheritDoc + */ + dispose(): void; + } + export = SkeletonPose; + +} +declare module "awayjs-renderergl/lib/animators/states/ISkeletonAnimationState" { + import IAnimationState = require("awayjs-stagegl/lib/animators/states/IAnimationState"); + import Skeleton = require("awayjs-renderergl/lib/animators/data/Skeleton"); + import SkeletonPose = require("awayjs-renderergl/lib/animators/data/SkeletonPose"); + interface ISkeletonAnimationState extends IAnimationState { + /** + * Returns the output skeleton pose of the animation node. + */ + getSkeletonPose(skeleton: Skeleton): SkeletonPose; + } + export = ISkeletonAnimationState; + +} +declare module "awayjs-renderergl/lib/animators/transitions/IAnimationTransition" { + import AnimationNodeBase = require("awayjs-core/lib/animators/nodes/AnimationNodeBase"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + /** + * + */ + interface IAnimationTransition { + getAnimationNode(animator: AnimatorBase, startNode: AnimationNodeBase, endNode: AnimationNodeBase, startTime: number): AnimationNodeBase; + } + export = IAnimationTransition; + +} +declare module "awayjs-renderergl/lib/animators/SkeletonAnimator" { + import TriangleSubGeometry = require("awayjs-core/lib/core/base/TriangleSubGeometry"); + import Camera = require("awayjs-core/lib/entities/Camera"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import TriangleSubMeshRenderable = require("awayjs-stagegl/lib/core/pool/TriangleSubMeshRenderable"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import SkeletonAnimationSet = require("awayjs-renderergl/lib/animators/SkeletonAnimationSet"); + import Skeleton = require("awayjs-renderergl/lib/animators/data/Skeleton"); + import SkeletonPose = require("awayjs-renderergl/lib/animators/data/SkeletonPose"); + import IAnimationTransition = require("awayjs-renderergl/lib/animators/transitions/IAnimationTransition"); + /** + * Provides an interface for assigning skeleton-based animation data sets to mesh-based entity objects + * and controlling the various available states of animation through an interative playhead that can be + * automatically updated or manually triggered. + */ + class SkeletonAnimator extends AnimatorBase { + private _globalMatrices; + private _globalPose; + private _globalPropertiesDirty; + private _numJoints; + private _morphedSubGeometry; + private _morphedSubGeometryDirty; + private _condensedMatrices; + private _skeleton; + private _forceCPU; + private _useCondensedIndices; + private _jointsPerVertex; + private _activeSkeletonState; + private _onTransitionCompleteDelegate; + private _onIndicesUpdateDelegate; + private _onVerticesUpdateDelegate; + /** + * returns the calculated global matrices of the current skeleton pose. + * + * @see #globalPose + */ + globalMatrices: number[]; + /** + * returns the current skeleton pose output from the animator. + * + * @see away.animators.data.SkeletonPose + */ + globalPose: SkeletonPose; + /** + * Returns the skeleton object in use by the animator - this defines the number and heirarchy of joints used by the + * skinned geoemtry to which skeleon animator is applied. + */ + skeleton: Skeleton; + /** + * Indicates whether the skeleton animator is disabled by default for GPU rendering, something that allows the animator to perform calculation on the GPU. + * Defaults to false. + */ + forceCPU: boolean; + /** + * Offers the option of enabling GPU accelerated animation on skeletons larger than 32 joints + * by condensing the number of joint index values required per mesh. Only applicable to + * skeleton animations that utilise more than one mesh object. Defaults to false. + */ + useCondensedIndices: boolean; + /** + * Creates a new SkeletonAnimator object. + * + * @param skeletonAnimationSet The animation data set containing the skeleton animations used by the animator. + * @param skeleton The skeleton object used for calculating the resulting global matrices for transforming skinned mesh data. + * @param forceCPU Optional value that only allows the animator to perform calculation on the CPU. Defaults to false. + */ + constructor(animationSet: SkeletonAnimationSet, skeleton: Skeleton, forceCPU?: boolean); + /** + * @inheritDoc + */ + clone(): AnimatorBase; + /** + * Plays an animation state registered with the given name in the animation data set. + * + * @param name The data set name of the animation state to be played. + * @param transition An optional transition object that determines how the animator will transition from the currently active animation state. + * @param offset An option offset time (in milliseconds) that resets the state's internal clock to the absolute time of the animator plus the offset value. Required for non-looping animation states. + */ + play(name: string, transition?: IAnimationTransition, offset?: number): void; + /** + * @inheritDoc + */ + setRenderState(shaderObject: ShaderObjectBase, renderable: RenderableBase, stage: Stage, camera: Camera, vertexConstantOffset: number, vertexStreamOffset: number): void; + /** + * @inheritDoc + */ + testGPUCompatibility(shaderObject: ShaderObjectBase): void; + /** + * Applies the calculated time delta to the active animation state node or state transition object. + */ + _pUpdateDeltaTime(dt: number): void; + private updateCondensedMatrices(condensedIndexLookUp, numJoints); + private updateGlobalProperties(); + getRenderableSubGeometry(renderable: TriangleSubMeshRenderable, sourceSubGeometry: TriangleSubGeometry): TriangleSubGeometry; + /** + * If the animation can't be performed on GPU, transform vertices manually + * @param subGeom The subgeometry containing the weights and joint index data per vertex. + * @param pass The material pass for which we need to transform the vertices + */ + morphSubGeometry(renderable: TriangleSubMeshRenderable, sourceSubGeometry: TriangleSubGeometry): void; + /** + * Converts a local hierarchical skeleton pose to a global pose + * @param targetPose The SkeletonPose object that will contain the global pose. + * @param skeleton The skeleton containing the joints, and as such, the hierarchical data to transform to global poses. + */ + private localToGlobalPose(sourcePose, targetPose, skeleton); + private onTransitionComplete(event); + private onIndicesUpdate(event); + private onVerticesUpdate(event); + } + export = SkeletonAnimator; + +} +declare module "awayjs-renderergl/lib/animators/data/VertexAnimationMode" { + /** + * Options for setting the animation mode of a vertex animator object. + * + * @see away.animators.VertexAnimator + */ + class VertexAnimationMode { + /** + * Animation mode that adds all outputs from active vertex animation state to form the current vertex animation pose. + */ + static ADDITIVE: string; + /** + * Animation mode that picks the output from a single vertex animation state to form the current vertex animation pose. + */ + static ABSOLUTE: string; + } + export = VertexAnimationMode; + +} +declare module "awayjs-renderergl/lib/animators/VertexAnimationSet" { + import IAnimationSet = require("awayjs-core/lib/animators/IAnimationSet"); + import AnimationSetBase = require("awayjs-stagegl/lib/animators/AnimationSetBase"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + /** + * The animation data set used by vertex-based animators, containing vertex animation state data. + * + * @see VertexAnimator + */ + class VertexAnimationSet extends AnimationSetBase implements IAnimationSet { + private _numPoses; + private _blendMode; + /** + * Returns the number of poses made available at once to the GPU animation code. + */ + numPoses: number; + /** + * Returns the active blend mode of the vertex animator object. + */ + blendMode: string; + /** + * Returns whether or not normal data is used in last set GPU pass of the vertex shader. + */ + /** + * Creates a new VertexAnimationSet object. + * + * @param numPoses The number of poses made available at once to the GPU animation code. + * @param blendMode Optional value for setting the animation mode of the vertex animator object. + * + * @see away3d.animators.data.VertexAnimationMode + */ + constructor(numPoses?: number, blendMode?: string); + /** + * @inheritDoc + */ + getAGALVertexCode(shaderObject: ShaderObjectBase): string; + /** + * @inheritDoc + */ + activate(shaderObject: ShaderObjectBase, stage: Stage): void; + /** + * @inheritDoc + */ + deactivate(shaderObject: ShaderObjectBase, stage: Stage): void; + /** + * @inheritDoc + */ + getAGALFragmentCode(shaderObject: ShaderObjectBase, shadedTarget: string): string; + /** + * @inheritDoc + */ + getAGALUVCode(shaderObject: ShaderObjectBase): string; + /** + * @inheritDoc + */ + doneAGALCode(shaderObject: ShaderObjectBase): void; + /** + * Generates the vertex AGAL code for absolute blending. + */ + private getAbsoluteAGALCode(shaderObject); + /** + * Generates the vertex AGAL code for additive blending. + */ + private getAdditiveAGALCode(shaderObject); + } + export = VertexAnimationSet; + +} +declare module "awayjs-renderergl/lib/animators/states/IVertexAnimationState" { + import Geometry = require("awayjs-core/lib/core/base/Geometry"); + import IAnimationState = require("awayjs-stagegl/lib/animators/states/IAnimationState"); + /** + * Provides an interface for animation node classes that hold animation data for use in the Vertex animator class. + * + * @see away.animators.VertexAnimator + */ + interface IVertexAnimationState extends IAnimationState { + /** + * Returns the current geometry frame of animation in the clip based on the internal playhead position. + */ + currentGeometry: Geometry; + /** + * Returns the current geometry frame of animation in the clip based on the internal playhead position. + */ + nextGeometry: Geometry; + /** + * Returns a fractional value between 0 and 1 representing the blending ratio of the current playhead position + * between the current geometry frame (0) and next geometry frame (1) of the animation. + */ + blendWeight: number; + } + export = IVertexAnimationState; + +} +declare module "awayjs-renderergl/lib/animators/VertexAnimator" { + import TriangleSubGeometry = require("awayjs-core/lib/core/base/TriangleSubGeometry"); + import Camera = require("awayjs-core/lib/entities/Camera"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import TriangleSubMeshRenderable = require("awayjs-stagegl/lib/core/pool/TriangleSubMeshRenderable"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import VertexAnimationSet = require("awayjs-renderergl/lib/animators/VertexAnimationSet"); + import IAnimationTransition = require("awayjs-renderergl/lib/animators/transitions/IAnimationTransition"); + /** + * Provides an interface for assigning vertex-based animation data sets to mesh-based entity objects + * and controlling the various available states of animation through an interative playhead that can be + * automatically updated or manually triggered. + */ + class VertexAnimator extends AnimatorBase { + private _vertexAnimationSet; + private _poses; + private _weights; + private _numPoses; + private _blendMode; + private _activeVertexState; + /** + * Creates a new VertexAnimator object. + * + * @param vertexAnimationSet The animation data set containing the vertex animations used by the animator. + */ + constructor(vertexAnimationSet: VertexAnimationSet); + /** + * @inheritDoc + */ + clone(): AnimatorBase; + /** + * Plays a sequence with a given name. If the sequence is not found, it may not be loaded yet, and it will retry every frame. + * @param sequenceName The name of the clip to be played. + */ + play(name: string, transition?: IAnimationTransition, offset?: number): void; + /** + * @inheritDoc + */ + _pUpdateDeltaTime(dt: number): void; + /** + * @inheritDoc + */ + setRenderState(shaderObject: ShaderObjectBase, renderable: RenderableBase, stage: Stage, camera: Camera, vertexConstantOffset: number, vertexStreamOffset: number): void; + private setNullPose(shaderObject, renderable, stage, vertexConstantOffset, vertexStreamOffset); + /** + * Verifies if the animation will be used on cpu. Needs to be true for all passes for a material to be able to use it on gpu. + * Needs to be called if gpu code is potentially required. + */ + testGPUCompatibility(shaderObject: ShaderObjectBase): void; + getRenderableSubGeometry(renderable: TriangleSubMeshRenderable, sourceSubGeometry: TriangleSubGeometry): TriangleSubGeometry; + } + export = VertexAnimator; + +} +declare module "awayjs-renderergl/lib/animators/nodes/AnimationClipNodeBase" { + import AnimationNodeBase = require("awayjs-core/lib/animators/nodes/AnimationNodeBase"); + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + /** + * Provides an abstract base class for nodes with time-based animation data in an animation blend tree. + */ + class AnimationClipNodeBase extends AnimationNodeBase { + _pLooping: boolean; + _pTotalDuration: number; + _pLastFrame: number; + _pStitchDirty: boolean; + _pStitchFinalFrame: boolean; + _pNumFrames: number; + _pDurations: number[]; + _pTotalDelta: Vector3D; + fixedFrameRate: boolean; + /** + * Determines whether the contents of the animation node have looping characteristics enabled. + */ + looping: boolean; + /** + * Defines if looping content blends the final frame of animation data with the first (true) or works on the + * assumption that both first and last frames are identical (false). Defaults to false. + */ + stitchFinalFrame: boolean; + totalDuration: number; + totalDelta: Vector3D; + lastFrame: number; + /** + * Returns a vector of time values representing the duration (in milliseconds) of each animation frame in the clip. + */ + durations: number[]; + /** + * Creates a new AnimationClipNodeBase object. + */ + constructor(); + /** + * Updates the node's final frame stitch state. + * + * @see #stitchFinalFrame + */ + _pUpdateStitch(): void; + } + export = AnimationClipNodeBase; + +} +declare module "awayjs-renderergl/lib/animators/states/AnimationClipState" { + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import AnimationClipNodeBase = require("awayjs-renderergl/lib/animators/nodes/AnimationClipNodeBase"); + import AnimationStateBase = require("awayjs-renderergl/lib/animators/states/AnimationStateBase"); + /** + * + */ + class AnimationClipState extends AnimationStateBase { + private _animationClipNode; + private _animationStatePlaybackComplete; + _pBlendWeight: number; + _pCurrentFrame: number; + _pNextFrame: number; + _pOldFrame: number; + _pTimeDir: number; + _pFramesDirty: boolean; + /** + * Returns a fractional value between 0 and 1 representing the blending ratio of the current playhead position + * between the current frame (0) and next frame (1) of the animation. + * + * @see #currentFrame + * @see #nextFrame + */ + blendWeight: number; + /** + * Returns the current frame of animation in the clip based on the internal playhead position. + */ + currentFrame: number; + /** + * Returns the next frame of animation in the clip based on the internal playhead position. + */ + nextFrame: number; + constructor(animator: AnimatorBase, animationClipNode: AnimationClipNodeBase); + /** + * @inheritDoc + */ + update(time: number): void; + /** + * @inheritDoc + */ + phase(value: number): void; + /** + * @inheritDoc + */ + _pUpdateTime(time: number): void; + /** + * Updates the nodes internal playhead to determine the current and next animation frame, and the blendWeight between the two. + * + * @see #currentFrame + * @see #nextFrame + * @see #blendWeight + */ + _pUpdateFrames(): void; + private notifyPlaybackComplete(); + } + export = AnimationClipState; + +} +declare module "awayjs-renderergl/lib/animators/states/SkeletonClipState" { + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import Skeleton = require("awayjs-renderergl/lib/animators/data/Skeleton"); + import SkeletonPose = require("awayjs-renderergl/lib/animators/data/SkeletonPose"); + import SkeletonClipNode = require("awayjs-renderergl/lib/animators/nodes/SkeletonClipNode"); + import AnimationClipState = require("awayjs-renderergl/lib/animators/states/AnimationClipState"); + import ISkeletonAnimationState = require("awayjs-renderergl/lib/animators/states/ISkeletonAnimationState"); + /** + * + */ + class SkeletonClipState extends AnimationClipState implements ISkeletonAnimationState { + private _rootPos; + private _frames; + private _skeletonClipNode; + private _skeletonPose; + private _skeletonPoseDirty; + private _currentPose; + private _nextPose; + /** + * Returns the current skeleton pose frame of animation in the clip based on the internal playhead position. + */ + currentPose: SkeletonPose; + /** + * Returns the next skeleton pose frame of animation in the clip based on the internal playhead position. + */ + nextPose: SkeletonPose; + constructor(animator: AnimatorBase, skeletonClipNode: SkeletonClipNode); + /** + * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. + */ + getSkeletonPose(skeleton: Skeleton): SkeletonPose; + /** + * @inheritDoc + */ + _pUpdateTime(time: number): void; + /** + * @inheritDoc + */ + _pUpdateFrames(): void; + /** + * Updates the output skeleton pose of the node based on the internal playhead position. + * + * @param skeleton The skeleton used by the animator requesting the ouput pose. + */ + private updateSkeletonPose(skeleton); + /** + * @inheritDoc + */ + _pUpdatePositionDelta(): void; + } + export = SkeletonClipState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/SkeletonClipNode" { + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import SkeletonPose = require("awayjs-renderergl/lib/animators/data/SkeletonPose"); + import AnimationClipNodeBase = require("awayjs-renderergl/lib/animators/nodes/AnimationClipNodeBase"); + import SkeletonClipState = require("awayjs-renderergl/lib/animators/states/SkeletonClipState"); + /** + * A skeleton animation node containing time-based animation data as individual skeleton poses. + */ + class SkeletonClipNode extends AnimationClipNodeBase { + private _frames; + /** + * Determines whether to use SLERP equations (true) or LERP equations (false) in the calculation + * of the output skeleton pose. Defaults to false. + */ + highQuality: boolean; + /** + * Returns a vector of skeleton poses representing the pose of each animation frame in the clip. + */ + frames: SkeletonPose[]; + /** + * Creates a new SkeletonClipNode object. + */ + constructor(); + /** + * Adds a skeleton pose frame to the internal timeline of the animation node. + * + * @param skeletonPose The skeleton pose object to add to the timeline of the node. + * @param duration The specified duration of the frame in milliseconds. + */ + addFrame(skeletonPose: SkeletonPose, duration: number): void; + /** + * @inheritDoc + */ + getAnimationState(animator: AnimatorBase): SkeletonClipState; + /** + * @inheritDoc + */ + _pUpdateStitch(): void; + } + export = SkeletonClipNode; + +} +declare module "awayjs-renderergl/lib/animators/states/VertexClipState" { + import Geometry = require("awayjs-core/lib/core/base/Geometry"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import VertexClipNode = require("awayjs-renderergl/lib/animators/nodes/VertexClipNode"); + import AnimationClipState = require("awayjs-renderergl/lib/animators/states/AnimationClipState"); + import IVertexAnimationState = require("awayjs-renderergl/lib/animators/states/IVertexAnimationState"); + /** + * + */ + class VertexClipState extends AnimationClipState implements IVertexAnimationState { + private _frames; + private _vertexClipNode; + private _currentGeometry; + private _nextGeometry; + /** + * @inheritDoc + */ + currentGeometry: Geometry; + /** + * @inheritDoc + */ + nextGeometry: Geometry; + constructor(animator: AnimatorBase, vertexClipNode: VertexClipNode); + /** + * @inheritDoc + */ + _pUpdateFrames(): void; + /** + * @inheritDoc + */ + _pUpdatePositionDelta(): void; + } + export = VertexClipState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/VertexClipNode" { + import Geometry = require("awayjs-core/lib/core/base/Geometry"); + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import AnimationClipNodeBase = require("awayjs-renderergl/lib/animators/nodes/AnimationClipNodeBase"); + /** + * A vertex animation node containing time-based animation data as individual geometry obejcts. + */ + class VertexClipNode extends AnimationClipNodeBase { + private _frames; + private _translations; + /** + * Returns a vector of geometry frames representing the vertex values of each animation frame in the clip. + */ + frames: Geometry[]; + /** + * Creates a new VertexClipNode object. + */ + constructor(); + /** + * Adds a geometry object to the internal timeline of the animation node. + * + * @param geometry The geometry object to add to the timeline of the node. + * @param duration The specified duration of the frame in milliseconds. + * @param translation The absolute translation of the frame, used in root delta calculations for mesh movement. + */ + addFrame(geometry: Geometry, duration: number, translation?: Vector3D): void; + /** + * @inheritDoc + */ + _pUpdateStitch(): void; + } + export = VertexClipNode; + +} +declare module "awayjs-renderergl/lib/materials/methods/AmbientEnvMapMethod" { + import CubeTextureBase = require("awayjs-core/lib/textures/CubeTextureBase"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import AmbientBasicMethod = require("awayjs-stagegl/lib/materials/methods/AmbientBasicMethod"); + /** + * AmbientEnvMapMethod provides a diffuse shading method that uses a diffuse irradiance environment map to + * approximate global lighting rather than lights. + */ + class AmbientEnvMapMethod extends AmbientBasicMethod { + private _cubeTexture; + /** + * Creates a new AmbientEnvMapMethod object. + * + * @param envMap The cube environment map to use for the ambient lighting. + */ + constructor(envMap: CubeTextureBase); + /** + * @inheritDoc + */ + iInitVO(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; + /** + * The cube environment map to use for the diffuse lighting. + */ + envMap: CubeTextureBase; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, regCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + } + export = AmbientEnvMapMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/DiffuseDepthMethod" { + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderLightingObject = require("awayjs-stagegl/lib/materials/compilation/ShaderLightingObject"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import DiffuseBasicMethod = require("awayjs-stagegl/lib/materials/methods/DiffuseBasicMethod"); + /** + * DiffuseDepthMethod provides a debug method to visualise depth maps + */ + class DiffuseDepthMethod extends DiffuseBasicMethod { + /** + * Creates a new DiffuseBasicMethod object. + */ + constructor(); + /** + * @inheritDoc + */ + iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; + /** + * @inheritDoc + */ + iGetFragmentPostLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + } + export = DiffuseDepthMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/DiffuseCompositeMethod" { + import Texture2DBase = require("awayjs-core/lib/textures/Texture2DBase"); + import Camera = require("awayjs-core/lib/entities/Camera"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderLightingObject = require("awayjs-stagegl/lib/materials/compilation/ShaderLightingObject"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import DiffuseBasicMethod = require("awayjs-stagegl/lib/materials/methods/DiffuseBasicMethod"); + /** + * DiffuseCompositeMethod provides a base class for diffuse methods that wrap a diffuse method to alter the + * calculated diffuse reflection strength. + */ + class DiffuseCompositeMethod extends DiffuseBasicMethod { + pBaseMethod: DiffuseBasicMethod; + private _onShaderInvalidatedDelegate; + /** + * Creates a new DiffuseCompositeMethod object. + * + * @param modulateMethod The method which will add the code to alter the base method's strength. It needs to have the signature clampDiffuse(t:ShaderRegisterElement, regCache:ShaderRegisterCache):string, in which t.w will contain the diffuse strength. + * @param baseMethod The base diffuse method on which this method's shading is based. + */ + constructor(modulateMethod: (shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData) => string, baseMethod?: DiffuseBasicMethod); + /** + * The base diffuse method on which this method's shading is based. + */ + baseMethod: DiffuseBasicMethod; + /** + * @inheritDoc + */ + iInitVO(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; + /** + * @inheritDoc + */ + iInitConstants(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; + /** + * @inheritDoc + */ + dispose(): void; + /** + * @inheritDoc + */ + /** + * @inheritDoc + */ + texture: Texture2DBase; + /** + * @inheritDoc + */ + /** + * @inheritDoc + */ + diffuseColor: number; + /** + * @inheritDoc + */ + /** + * @inheritDoc + */ + ambientColor: number; + /** + * @inheritDoc + */ + iGetFragmentPreLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iGetFragmentCodePerLight(shaderObject: ShaderLightingObject, methodVO: MethodVO, lightDirReg: ShaderRegisterElement, lightColReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iGetFragmentCodePerProbe(shaderObject: ShaderLightingObject, methodVO: MethodVO, cubeMapReg: ShaderRegisterElement, weightRegister: string, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + iSetRenderState(shaderObject: ShaderLightingObject, methodVO: MethodVO, renderable: RenderableBase, stage: Stage, camera: Camera): void; + /** + * @inheritDoc + */ + iDeactivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + iGetVertexCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iGetFragmentPostLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iReset(): void; + /** + * @inheritDoc + */ + iCleanCompilationData(): void; + /** + * Called when the base method's shader code is invalidated. + */ + private onShaderInvalidated(event); + } + export = DiffuseCompositeMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/DiffuseCelMethod" { + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderLightingObject = require("awayjs-stagegl/lib/materials/compilation/ShaderLightingObject"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import DiffuseBasicMethod = require("awayjs-stagegl/lib/materials/methods/DiffuseBasicMethod"); + import DiffuseCompositeMethod = require("awayjs-renderergl/lib/materials/methods/DiffuseCompositeMethod"); + /** + * DiffuseCelMethod provides a shading method to add diffuse cel (cartoon) shading. + */ + class DiffuseCelMethod extends DiffuseCompositeMethod { + private _levels; + private _dataReg; + private _smoothness; + /** + * Creates a new DiffuseCelMethod object. + * @param levels The amount of shadow gradations. + * @param baseMethod An optional diffuse method on which the cartoon shading is based. If omitted, DiffuseBasicMethod is used. + */ + constructor(levels?: number, baseMethod?: DiffuseBasicMethod); + /** + * @inheritDoc + */ + iInitConstants(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; + /** + * The amount of shadow gradations. + */ + levels: number; + /** + * The smoothness of the edge between 2 shading levels. + */ + smoothness: number; + /** + * @inheritDoc + */ + iCleanCompilationData(): void; + /** + * @inheritDoc + */ + iGetFragmentPreLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: Stage): void; + /** + * Snaps the diffuse shading of the wrapped method to one of the levels. + * @param vo The MethodVO used to compile the current shader. + * @param t The register containing the diffuse strength in the "w" component. + * @param regCache The register cache used for the shader compilation. + * @param sharedRegisters The shared register data for this shader. + * @return The AGAL fragment code for the method. + */ + private clampDiffuse(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); + } + export = DiffuseCelMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/DiffuseGradientMethod" { + import Texture2DBase = require("awayjs-core/lib/textures/Texture2DBase"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderLightingObject = require("awayjs-stagegl/lib/materials/compilation/ShaderLightingObject"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import DiffuseBasicMethod = require("awayjs-stagegl/lib/materials/methods/DiffuseBasicMethod"); + /** + * DiffuseGradientMethod is an alternative to DiffuseBasicMethod in which the shading can be modulated with a gradient + * to introduce color-tinted shading as opposed to the single-channel diffuse strength. This can be used as a crude + * approximation to subsurface scattering (for instance, the mid-range shading for skin can be tinted red to similate + * scattered light within the skin attributing to the final colour) + */ + class DiffuseGradientMethod extends DiffuseBasicMethod { + private _gradientTextureRegister; + private _gradient; + /** + * Creates a new DiffuseGradientMethod object. + * @param gradient A texture that contains the light colour based on the angle. This can be used to change + * the light colour due to subsurface scattering when the surface faces away from the light. + */ + constructor(gradient: Texture2DBase); + /** + * A texture that contains the light colour based on the angle. This can be used to change the light colour + * due to subsurface scattering when the surface faces away from the light. + */ + gradient: Texture2DBase; + /** + * @inheritDoc + */ + iCleanCompilationData(): void; + /** + * @inheritDoc + */ + iGetFragmentPreLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iGetFragmentCodePerLight(shaderObject: ShaderLightingObject, methodVO: MethodVO, lightDirReg: ShaderRegisterElement, lightColReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + pApplyShadow(shaderObject: ShaderLightingObject, methodVO: MethodVO, regCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: Stage): void; + } + export = DiffuseGradientMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/DiffuseLightMapMethod" { + import Texture2DBase = require("awayjs-core/lib/textures/Texture2DBase"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderLightingObject = require("awayjs-stagegl/lib/materials/compilation/ShaderLightingObject"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import DiffuseBasicMethod = require("awayjs-stagegl/lib/materials/methods/DiffuseBasicMethod"); + import DiffuseCompositeMethod = require("awayjs-renderergl/lib/materials/methods/DiffuseCompositeMethod"); + /** + * DiffuseLightMapMethod provides a diffuse shading method that uses a light map to modulate the calculated diffuse + * lighting. It is different from EffectLightMapMethod in that the latter modulates the entire calculated pixel color, rather + * than only the diffuse lighting value. + */ + class DiffuseLightMapMethod extends DiffuseCompositeMethod { + /** + * Indicates the light map should be multiplied with the calculated shading result. + * This can be used to add pre-calculated shadows or occlusion. + */ + static MULTIPLY: string; + /** + * Indicates the light map should be added into the calculated shading result. + * This can be used to add pre-calculated lighting or global illumination. + */ + static ADD: string; + private _lightMapTexture; + private _blendMode; + private _useSecondaryUV; + /** + * Creates a new DiffuseLightMapMethod method. + * + * @param lightMap The texture containing the light map. + * @param blendMode The blend mode with which the light map should be applied to the lighting result. + * @param useSecondaryUV Indicates whether the secondary UV set should be used to map the light map. + * @param baseMethod The diffuse method used to calculate the regular diffuse-based lighting. + */ + constructor(lightMap: Texture2DBase, blendMode?: string, useSecondaryUV?: boolean, baseMethod?: DiffuseBasicMethod); + /** + * @inheritDoc + */ + iInitVO(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; + /** + * The blend mode with which the light map should be applied to the lighting result. + * + * @see DiffuseLightMapMethod.ADD + * @see DiffuseLightMapMethod.MULTIPLY + */ + blendMode: string; + /** + * The texture containing the light map data. + */ + lightMapTexture: Texture2DBase; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + iGetFragmentPostLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + } + export = DiffuseLightMapMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/DiffuseWrapMethod" { + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderLightingObject = require("awayjs-stagegl/lib/materials/compilation/ShaderLightingObject"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import DiffuseBasicMethod = require("awayjs-stagegl/lib/materials/methods/DiffuseBasicMethod"); + /** + * DiffuseWrapMethod is an alternative to DiffuseBasicMethod in which the light is allowed to be "wrapped around" the normally dark area, to some extent. + * It can be used as a crude approximation to Oren-Nayar or simple subsurface scattering. + */ + class DiffuseWrapMethod extends DiffuseBasicMethod { + private _wrapDataRegister; + private _wrapFactor; + /** + * Creates a new DiffuseWrapMethod object. + * @param wrapFactor A factor to indicate the amount by which the light is allowed to wrap + */ + constructor(wrapFactor?: number); + /** + * @inheritDoc + */ + iCleanCompilationData(): void; + /** + * A factor to indicate the amount by which the light is allowed to wrap. + */ + wrapFactor: number; + /** + * @inheritDoc + */ + iGetFragmentPreLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iGetFragmentCodePerLight(shaderObject: ShaderLightingObject, methodVO: MethodVO, lightDirReg: ShaderRegisterElement, lightColReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: Stage): void; + } + export = DiffuseWrapMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/EffectAlphaMaskMethod" { + import Texture2DBase = require("awayjs-core/lib/textures/Texture2DBase"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderLightingObject = require("awayjs-stagegl/lib/materials/compilation/ShaderLightingObject"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import EffectMethodBase = require("awayjs-stagegl/lib/materials/methods/EffectMethodBase"); + /** + * EffectAlphaMaskMethod allows the use of an additional texture to specify the alpha value of the material. When used + * with the secondary uv set, it allows for a tiled main texture with independently varying alpha (useful for water + * etc). + */ + class EffectAlphaMaskMethod extends EffectMethodBase { + private _texture; + private _useSecondaryUV; + /** + * Creates a new EffectAlphaMaskMethod object. + * + * @param texture The texture to use as the alpha mask. + * @param useSecondaryUV Indicated whether or not the secondary uv set for the mask. This allows mapping alpha independently. + */ + constructor(texture: Texture2DBase, useSecondaryUV?: boolean); + /** + * @inheritDoc + */ + iInitVO(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; + /** + * Indicated whether or not the secondary uv set for the mask. This allows mapping alpha independently, for + * instance to tile the main texture and normal map while providing untiled alpha, for example to define the + * transparency over a tiled water surface. + */ + useSecondaryUV: boolean; + /** + * The texture to use as the alpha mask. + */ + texture: Texture2DBase; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + } + export = EffectAlphaMaskMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/EffectColorMatrixMethod" { + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import EffectMethodBase = require("awayjs-stagegl/lib/materials/methods/EffectMethodBase"); + /** + * EffectColorMatrixMethod provides a shading method that changes the colour of a material analogous to a ColorMatrixFilter. + */ + class EffectColorMatrixMethod extends EffectMethodBase { + private _matrix; + /** + * Creates a new EffectColorTransformMethod. + * + * @param matrix An array of 20 items for 4 x 5 color transform. + */ + constructor(matrix: number[]); + /** + * The 4 x 5 matrix to transform the color of the material. + */ + colorMatrix: number[]; + /** + * @inheritDoc + */ + iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: Stage): void; + } + export = EffectColorMatrixMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/EffectEnvMapMethod" { + import CubeTextureBase = require("awayjs-core/lib/textures/CubeTextureBase"); + import Texture2DBase = require("awayjs-core/lib/textures/Texture2DBase"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import EffectMethodBase = require("awayjs-stagegl/lib/materials/methods/EffectMethodBase"); + /** + * EffectEnvMapMethod provides a material method to perform reflection mapping using cube maps. + */ + class EffectEnvMapMethod extends EffectMethodBase { + private _cubeTexture; + private _alpha; + private _mask; + /** + * Creates an EffectEnvMapMethod object. + * @param envMap The environment map containing the reflected scene. + * @param alpha The reflectivity of the surface. + */ + constructor(envMap: CubeTextureBase, alpha?: number); + /** + * An optional texture to modulate the reflectivity of the surface. + */ + mask: Texture2DBase; + /** + * @inheritDoc + */ + iInitVO(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; + /** + * The cubic environment map containing the reflected scene. + */ + envMap: CubeTextureBase; + /** + * @inheritDoc + */ + dispose(): void; + /** + * The reflectivity of the surface. + */ + alpha: number; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + } + export = EffectEnvMapMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/EffectFogMethod" { + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderLightingObject = require("awayjs-stagegl/lib/materials/compilation/ShaderLightingObject"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import EffectMethodBase = require("awayjs-stagegl/lib/materials/methods/EffectMethodBase"); + /** + * EffectFogMethod provides a method to add distance-based fog to a material. + */ + class EffectFogMethod extends EffectMethodBase { + private _minDistance; + private _maxDistance; + private _fogColor; + private _fogR; + private _fogG; + private _fogB; + /** + * Creates a new EffectFogMethod object. + * @param minDistance The distance from which the fog starts appearing. + * @param maxDistance The distance at which the fog is densest. + * @param fogColor The colour of the fog. + */ + constructor(minDistance: number, maxDistance: number, fogColor?: number); + /** + * @inheritDoc + */ + iInitVO(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; + /** + * @inheritDoc + */ + iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; + /** + * The distance from which the fog starts appearing. + */ + minDistance: number; + /** + * The distance at which the fog is densest. + */ + maxDistance: number; + /** + * The colour of the fog. + */ + fogColor: number; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + } + export = EffectFogMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/EffectFresnelEnvMapMethod" { + import CubeTextureBase = require("awayjs-core/lib/textures/CubeTextureBase"); + import Texture2DBase = require("awayjs-core/lib/textures/Texture2DBase"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import EffectMethodBase = require("awayjs-stagegl/lib/materials/methods/EffectMethodBase"); + /** + * EffectFresnelEnvMapMethod provides a method to add fresnel-based reflectivity to an object using cube maps, which gets + * stronger as the viewing angle becomes more grazing. + */ + class EffectFresnelEnvMapMethod extends EffectMethodBase { + private _cubeTexture; + private _fresnelPower; + private _normalReflectance; + private _alpha; + private _mask; + /** + * Creates a new EffectFresnelEnvMapMethod object. + * + * @param envMap The environment map containing the reflected scene. + * @param alpha The reflectivity of the material. + */ + constructor(envMap: CubeTextureBase, alpha?: number); + /** + * @inheritDoc + */ + iInitVO(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; + /** + * @inheritDoc + */ + iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; + /** + * An optional texture to modulate the reflectivity of the surface. + */ + mask: Texture2DBase; + /** + * The power used in the Fresnel equation. Higher values make the fresnel effect more pronounced. Defaults to 5. + */ + fresnelPower: number; + /** + * The cubic environment map containing the reflected scene. + */ + envMap: CubeTextureBase; + /** + * The reflectivity of the surface. + */ + alpha: number; + /** + * The minimum amount of reflectance, ie the reflectance when the view direction is normal to the surface or light direction. + */ + normalReflectance: number; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + } + export = EffectFresnelEnvMapMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/EffectLightMapMethod" { + import Texture2DBase = require("awayjs-core/lib/textures/Texture2DBase"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import EffectMethodBase = require("awayjs-stagegl/lib/materials/methods/EffectMethodBase"); + /** + * EffectLightMapMethod provides a method that allows applying a light map texture to the calculated pixel colour. + * It is different from DiffuseLightMapMethod in that the latter only modulates the diffuse shading value rather + * than the whole pixel colour. + */ + class EffectLightMapMethod extends EffectMethodBase { + /** + * Indicates the light map should be multiplied with the calculated shading result. + */ + static MULTIPLY: string; + /** + * Indicates the light map should be added into the calculated shading result. + */ + static ADD: string; + private _texture; + private _blendMode; + private _useSecondaryUV; + /** + * Creates a new EffectLightMapMethod object. + * + * @param texture The texture containing the light map. + * @param blendMode The blend mode with which the light map should be applied to the lighting result. + * @param useSecondaryUV Indicates whether the secondary UV set should be used to map the light map. + */ + constructor(texture: Texture2DBase, blendMode?: string, useSecondaryUV?: boolean); + /** + * @inheritDoc + */ + iInitVO(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; + /** + * The blend mode with which the light map should be applied to the lighting result. + * + * @see EffectLightMapMethod.ADD + * @see EffectLightMapMethod.MULTIPLY + */ + blendMode: string; + /** + * The texture containing the light map. + */ + texture: Texture2DBase; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + } + export = EffectLightMapMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/EffectRimLightMethod" { + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import EffectMethodBase = require("awayjs-stagegl/lib/materials/methods/EffectMethodBase"); + /** + * EffectRimLightMethod provides a method to add rim lighting to a material. This adds a glow-like effect to edges of objects. + */ + class EffectRimLightMethod extends EffectMethodBase { + static ADD: string; + static MULTIPLY: string; + static MIX: string; + private _color; + private _blendMode; + private _colorR; + private _colorG; + private _colorB; + private _strength; + private _power; + /** + * Creates a new EffectRimLightMethod object. + * + * @param color The colour of the rim light. + * @param strength The strength of the rim light. + * @param power The power of the rim light. Higher values will result in a higher edge fall-off. + * @param blend The blend mode with which to add the light to the object. + */ + constructor(color?: number, strength?: number, power?: number, blend?: string); + /** + * @inheritDoc + */ + iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; + /** + * @inheritDoc + */ + iInitVO(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; + /** + * The blend mode with which to add the light to the object. + * + * EffectRimLightMethod.MULTIPLY multiplies the rim light with the material's colour. + * EffectRimLightMethod.ADD adds the rim light with the material's colour. + * EffectRimLightMethod.MIX provides normal alpha blending. + */ + blendMode: string; + /** + * The color of the rim light. + */ + color: number; + /** + * The strength of the rim light. + */ + strength: number; + /** + * The power of the rim light. Higher values will result in a higher edge fall-off. + */ + power: number; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + } + export = EffectRimLightMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/NormalSimpleWaterMethod" { + import Texture2DBase = require("awayjs-core/lib/textures/Texture2DBase"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import NormalBasicMethod = require("awayjs-stagegl/lib/materials/methods/NormalBasicMethod"); + /** + * NormalSimpleWaterMethod provides a basic normal map method to create water ripples by translating two wave normal maps. + */ + class NormalSimpleWaterMethod extends NormalBasicMethod { + private _texture2; + private _normalTextureRegister2; + private _useSecondNormalMap; + private _water1OffsetX; + private _water1OffsetY; + private _water2OffsetX; + private _water2OffsetY; + /** + * Creates a new NormalSimpleWaterMethod object. + * @param waveMap1 A normal map containing one layer of a wave structure. + * @param waveMap2 A normal map containing a second layer of a wave structure. + */ + constructor(waveMap1: Texture2DBase, waveMap2: Texture2DBase); + /** + * @inheritDoc + */ + iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; + /** + * @inheritDoc + */ + iInitVO(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; + /** + * The translation of the first wave layer along the X-axis. + */ + water1OffsetX: number; + /** + * The translation of the first wave layer along the Y-axis. + */ + water1OffsetY: number; + /** + * The translation of the second wave layer along the X-axis. + */ + water2OffsetX: number; + /** + * The translation of the second wave layer along the Y-axis. + */ + water2OffsetY: number; + /** + * A second normal map that will be combined with the first to create a wave-like animation pattern. + */ + secondaryNormalMap: Texture2DBase; + /** + * @inheritDoc + */ + iCleanCompilationData(): void; + /** + * @inheritDoc + */ + dispose(): void; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + } + export = NormalSimpleWaterMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/ShadowDitheredMethod" { + import DirectionalLight = require("awayjs-core/lib/entities/DirectionalLight"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderLightingObject = require("awayjs-stagegl/lib/materials/compilation/ShaderLightingObject"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import ShadowMethodBase = require("awayjs-stagegl/lib/materials/methods/ShadowMethodBase"); + /** + * ShadowDitheredMethod provides a soft shadowing technique by randomly distributing sample points differently for each fragment. + */ + class ShadowDitheredMethod extends ShadowMethodBase { + private static _grainTexture; + private static _grainUsages; + private static _grainBitmapData; + private _depthMapSize; + private _range; + private _numSamples; + /** + * Creates a new ShadowDitheredMethod object. + * @param castingLight The light casting the shadows + * @param numSamples The amount of samples to take for dithering. Minimum 1, maximum 24. + */ + constructor(castingLight: DirectionalLight, numSamples?: number, range?: number); + /** + * The amount of samples to take for dithering. Minimum 1, maximum 24. The actual maximum may depend on the + * complexity of the shader. + */ + numSamples: number; + /** + * @inheritDoc + */ + iInitVO(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; + /** + * @inheritDoc + */ + iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; + /** + * The range in the shadow map in which to distribute the samples. + */ + range: number; + /** + * Creates a texture containing the dithering noise texture. + */ + private initGrainTexture(); + /** + * @inheritDoc + */ + dispose(): void; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + _pGetPlanarFragmentCode(methodVO: MethodVO, targetReg: ShaderRegisterElement, regCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * Get the actual shader code for shadow mapping + * @param regCache The register cache managing the registers. + * @param depthMapRegister The texture register containing the depth map. + * @param decReg The register containing the depth map decoding data. + * @param targetReg The target register to add the shadow coverage. + */ + private getSampleCode(customDataReg, depthMapRegister, decReg, targetReg, regCache, sharedRegisters); + /** + * Adds the code for another tap to the shader code. + * @param uvReg The uv register for the tap. + * @param depthMapRegister The texture register containing the depth map. + * @param decReg The register containing the depth map decoding data. + * @param targetReg The target register to add the tap comparison result. + * @param regCache The register cache managing the registers. + * @return + */ + private addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); + /** + * @inheritDoc + */ + iActivateForCascade(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + _iGetCascadeFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, decodeRegister: ShaderRegisterElement, depthTexture: ShaderRegisterElement, depthProjection: ShaderRegisterElement, targetRegister: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + } + export = ShadowDitheredMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/ShadowFilteredMethod" { + import DirectionalLight = require("awayjs-core/lib/entities/DirectionalLight"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderLightingObject = require("awayjs-stagegl/lib/materials/compilation/ShaderLightingObject"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import ShadowMethodBase = require("awayjs-stagegl/lib/materials/methods/ShadowMethodBase"); + /** + * ShadowFilteredMethod provides a softened shadowing technique by bilinearly interpolating shadow comparison + * results of neighbouring pixels. + */ + class ShadowFilteredMethod extends ShadowMethodBase { + /** + * Creates a new DiffuseBasicMethod object. + * + * @param castingLight The light casting the shadow + */ + constructor(castingLight: DirectionalLight); + /** + * @inheritDoc + */ + iInitConstants(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; + /** + * @inheritDoc + */ + _pGetPlanarFragmentCode(methodVO: MethodVO, targetReg: ShaderRegisterElement, regCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iActivateForCascade(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + _iGetCascadeFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, decodeRegister: ShaderRegisterElement, depthTexture: ShaderRegisterElement, depthProjection: ShaderRegisterElement, targetRegister: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + } + export = ShadowFilteredMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/SpecularCompositeMethod" { + import Camera = require("awayjs-core/lib/entities/Camera"); + import Texture2DBase = require("awayjs-core/lib/textures/Texture2DBase"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderLightingObject = require("awayjs-stagegl/lib/materials/compilation/ShaderLightingObject"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import SpecularBasicMethod = require("awayjs-stagegl/lib/materials/methods/SpecularBasicMethod"); + import MaterialPassBase = require("awayjs-stagegl/lib/materials/passes/MaterialPassBase"); + /** + * SpecularCompositeMethod provides a base class for specular methods that wrap a specular method to alter the + * calculated specular reflection strength. + */ + class SpecularCompositeMethod extends SpecularBasicMethod { + private _baseMethod; + private _onShaderInvalidatedDelegate; + /** + * Creates a new SpecularCompositeMethod object. + * + * @param modulateMethod The method which will add the code to alter the base method's strength. It needs to have the signature modSpecular(t:ShaderRegisterElement, regCache:ShaderRegisterCache):string, in which t.w will contain the specular strength and t.xyz will contain the half-vector or the reflection vector. + * @param baseMethod The base specular method on which this method's shading is based. + */ + constructor(modulateMethod: (shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData) => string, baseMethod?: SpecularBasicMethod); + /** + * @inheritDoc + */ + iInitVO(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; + /** + * @inheritDoc + */ + iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; + /** + * The base specular method on which this method's shading is based. + */ + baseMethod: SpecularBasicMethod; + /** + * @inheritDoc + */ + gloss: number; + /** + * @inheritDoc + */ + specular: number; + /** + * @inheritDoc + */ + passes: MaterialPassBase[]; + /** + * @inheritDoc + */ + dispose(): void; + /** + * @inheritDoc + */ + texture: Texture2DBase; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + iSetRenderState(shaderObject: ShaderLightingObject, methodVO: MethodVO, renderable: RenderableBase, stage: Stage, camera: Camera): void; + /** + * @inheritDoc + */ + iDeactivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + iGetVertexCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iGetFragmentPreLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iGetFragmentCodePerLight(shaderObject: ShaderLightingObject, methodVO: MethodVO, lightDirReg: ShaderRegisterElement, lightColReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + * @return + */ + iGetFragmentCodePerProbe(shaderObject: ShaderLightingObject, methodVO: MethodVO, cubeMapReg: ShaderRegisterElement, weightRegister: string, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iGetFragmentPostLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iReset(): void; + /** + * @inheritDoc + */ + iCleanCompilationData(): void; + /** + * Called when the base method's shader code is invalidated. + */ + private onShaderInvalidated(event); + } + export = SpecularCompositeMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/SpecularFresnelMethod" { + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderLightingObject = require("awayjs-stagegl/lib/materials/compilation/ShaderLightingObject"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import SpecularBasicMethod = require("awayjs-stagegl/lib/materials/methods/SpecularBasicMethod"); + import SpecularCompositeMethod = require("awayjs-renderergl/lib/materials/methods/SpecularCompositeMethod"); + /** + * SpecularFresnelMethod provides a specular shading method that causes stronger highlights on grazing view angles. + */ + class SpecularFresnelMethod extends SpecularCompositeMethod { + private _dataReg; + private _incidentLight; + private _fresnelPower; + private _normalReflectance; + /** + * Creates a new SpecularFresnelMethod object. + * @param basedOnSurface Defines whether the fresnel effect should be based on the view angle on the surface (if true), or on the angle between the light and the view. + * @param baseMethod The specular method to which the fresnel equation. Defaults to SpecularBasicMethod. + */ + constructor(basedOnSurface?: boolean, baseMethod?: SpecularBasicMethod); + /** + * @inheritDoc + */ + iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; + /** + * Defines whether the fresnel effect should be based on the view angle on the surface (if true), or on the angle between the light and the view. + */ + basedOnSurface: boolean; + /** + * The power used in the Fresnel equation. Higher values make the fresnel effect more pronounced. Defaults to 5. + */ + fresnelPower: number; + /** + * @inheritDoc + */ + iCleanCompilationData(): void; + /** + * The minimum amount of reflectance, ie the reflectance when the view direction is normal to the surface or light direction. + */ + normalReflectance: number; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + iGetFragmentPreLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * Applies the fresnel effect to the specular strength. + * + * @param vo The MethodVO object containing the method data for the currently compiled material pass. + * @param target The register containing the specular strength in the "w" component, and the half-vector/reflection vector in "xyz". + * @param regCache The register cache used for the shader compilation. + * @param sharedRegisters The shared registers created by the compiler. + * @return The AGAL fragment code for the method. + */ + private modulateSpecular(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); + } + export = SpecularFresnelMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/SpecularAnisotropicMethod" { + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderLightingObject = require("awayjs-stagegl/lib/materials/compilation/ShaderLightingObject"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import SpecularBasicMethod = require("awayjs-stagegl/lib/materials/methods/SpecularBasicMethod"); + /** + * SpecularAnisotropicMethod provides a specular method resulting in anisotropic highlights. These are typical for + * surfaces with microfacet details such as tiny grooves. In particular, this uses the Heidrich-Seidel distrubution. + * The tangent vectors are used as the surface groove directions. + */ + class SpecularAnisotropicMethod extends SpecularBasicMethod { + /** + * Creates a new SpecularAnisotropicMethod object. + */ + constructor(); + /** + * @inheritDoc + */ + iInitVO(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; + /** + * @inheritDoc + */ + iGetFragmentCodePerLight(shaderObject: ShaderLightingObject, methodVO: MethodVO, lightDirReg: ShaderRegisterElement, lightColReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + } + export = SpecularAnisotropicMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/SpecularCelMethod" { + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderLightingObject = require("awayjs-stagegl/lib/materials/compilation/ShaderLightingObject"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import SpecularBasicMethod = require("awayjs-stagegl/lib/materials/methods/SpecularBasicMethod"); + import SpecularCompositeMethod = require("awayjs-renderergl/lib/materials/methods/SpecularCompositeMethod"); + /** + * SpecularCelMethod provides a shading method to add specular cel (cartoon) shading. + */ + class SpecularCelMethod extends SpecularCompositeMethod { + private _dataReg; + private _smoothness; + private _specularCutOff; + /** + * Creates a new SpecularCelMethod object. + * @param specularCutOff The threshold at which the specular highlight should be shown. + * @param baseMethod An optional specular method on which the cartoon shading is based. If ommitted, SpecularBasicMethod is used. + */ + constructor(specularCutOff?: number, baseMethod?: SpecularBasicMethod); + /** + * The smoothness of the highlight edge. + */ + smoothness: number; + /** + * The threshold at which the specular highlight should be shown. + */ + specularCutOff: number; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + iCleanCompilationData(): void; + /** + * Snaps the specular shading strength of the wrapped method to zero or one, depending on whether or not it exceeds the specularCutOff + * @param vo The MethodVO used to compile the current shader. + * @param t The register containing the specular strength in the "w" component, and either the half-vector or the reflection vector in "xyz". + * @param regCache The register cache used for the shader compilation. + * @param sharedRegisters The shared register data for this shader. + * @return The AGAL fragment code for the method. + */ + private clampSpecular(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); + /** + * @inheritDoc + */ + iGetFragmentPreLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + } + export = SpecularCelMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/SpecularPhongMethod" { + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderLightingObject = require("awayjs-stagegl/lib/materials/compilation/ShaderLightingObject"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import SpecularBasicMethod = require("awayjs-stagegl/lib/materials/methods/SpecularBasicMethod"); + /** + * SpecularPhongMethod provides a specular method that provides Phong highlights. + */ + class SpecularPhongMethod extends SpecularBasicMethod { + /** + * Creates a new SpecularPhongMethod object. + */ + constructor(); + /** + * @inheritDoc + */ + iGetFragmentCodePerLight(shaderObject: ShaderLightingObject, methodVO: MethodVO, lightDirReg: ShaderRegisterElement, lightColReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + } + export = SpecularPhongMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/ShadowNearMethod" { + import Camera = require("awayjs-core/lib/entities/Camera"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderLightingObject = require("awayjs-stagegl/lib/materials/compilation/ShaderLightingObject"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import ShadowMethodBase = require("awayjs-stagegl/lib/materials/methods/ShadowMethodBase"); + /** + * ShadowNearMethod provides a shadow map method that restricts the shadowed area near the camera to optimize + * shadow map usage. This method needs to be used in conjunction with a NearDirectionalShadowMapper. + * + * @see away.lights.NearDirectionalShadowMapper + */ + class ShadowNearMethod extends ShadowMethodBase { + private _baseMethod; + private _fadeRatio; + private _nearShadowMapper; + private _onShaderInvalidatedDelegate; + /** + * Creates a new ShadowNearMethod object. + * @param baseMethod The shadow map sampling method used to sample individual cascades (fe: ShadowHardMethod, ShadowSoftMethod) + * @param fadeRatio The amount of shadow fading to the outer shadow area. A value of 1 would mean the shadows start fading from the camera's near plane. + */ + constructor(baseMethod: ShadowMethodBase, fadeRatio?: number); + /** + * The base shadow map method on which this method's shading is based. + */ + baseMethod: ShadowMethodBase; + /** + * @inheritDoc + */ + iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; + /** + * @inheritDoc + */ + iInitVO(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; + /** + * @inheritDoc + */ + dispose(): void; + /** + * @inheritDoc + */ + alpha: number; + /** + * @inheritDoc + */ + epsilon: number; + /** + * The amount of shadow fading to the outer shadow area. A value of 1 would mean the shadows start fading from the camera's near plane. + */ + fadeRatio: number; + /** + * @inheritDoc + */ + iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + iDeactivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + iSetRenderState(shaderObject: ShaderObjectBase, methodVO: MethodVO, renderable: RenderableBase, stage: Stage, camera: Camera): void; + /** + * @inheritDoc + */ + iGetVertexCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iReset(): void; + /** + * @inheritDoc + */ + iCleanCompilationData(): void; + /** + * Called when the base method's shader code is invalidated. + */ + private onShaderInvalidated(event); + } + export = ShadowNearMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/ShadowSoftMethod" { + import DirectionalLight = require("awayjs-core/lib/entities/DirectionalLight"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import ShadowMethodBase = require("awayjs-stagegl/lib/materials/methods/ShadowMethodBase"); + /** + * ShadowSoftMethod provides a soft shadowing technique by randomly distributing sample points. + */ + class ShadowSoftMethod extends ShadowMethodBase { + private _range; + private _numSamples; + private _offsets; + /** + * Creates a new DiffuseBasicMethod object. + * + * @param castingLight The light casting the shadows + * @param numSamples The amount of samples to take for dithering. Minimum 1, maximum 32. + */ + constructor(castingLight: DirectionalLight, numSamples?: number, range?: number); + /** + * The amount of samples to take for dithering. Minimum 1, maximum 32. The actual maximum may depend on the + * complexity of the shader. + */ + numSamples: number; + /** + * The range in the shadow map in which to distribute the samples. + */ + range: number; + /** + * @inheritDoc + */ + iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + _pGetPlanarFragmentCode(methodVO: MethodVO, targetReg: ShaderRegisterElement, regCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * Adds the code for another tap to the shader code. + * @param uv The uv register for the tap. + * @param texture The texture register containing the depth map. + * @param decode The register containing the depth map decoding data. + * @param target The target register to add the tap comparison result. + * @param regCache The register cache managing the registers. + * @return + */ + private addSample(uv, texture, decode, target, regCache); + /** + * @inheritDoc + */ + iActivateForCascade(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + _iGetCascadeFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, decodeRegister: ShaderRegisterElement, depthTexture: ShaderRegisterElement, depthProjection: ShaderRegisterElement, targetRegister: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * Get the actual shader code for shadow mapping + * @param regCache The register cache managing the registers. + * @param depthTexture The texture register containing the depth map. + * @param decodeRegister The register containing the depth map decoding data. + * @param targetReg The target register to add the shadow coverage. + * @param dataReg The register containing additional data. + */ + private getSampleCode(regCache, depthTexture, decodeRegister, targetRegister, dataReg); + } + export = ShadowSoftMethod; + +} +declare module "awayjs-renderergl/lib/parsers/data/AWDBlock" { + import ByteArray = require("awayjs-core/lib/utils/ByteArray"); + /** + * + */ + class AWDBlock { + id: number; + name: string; + data: any; + len: any; + geoID: number; + extras: Object; + bytes: ByteArray; + errorMessages: string[]; + uvsForVertexAnimation: number[][]; + constructor(); + dispose(): void; + addError(errorMsg: string): void; + } + export = AWDBlock; + +} +declare module "awayjs-renderergl/lib/parsers/data/AWDProperties" { + class AWDProperties { + set(key: number, value: any): void; + get(key: number, fallback: any): any; + } + export = AWDProperties; + +} +declare module "awayjs-renderergl/lib/parsers/data/BitFlags" { + /** + * + */ + class BitFlags { + static FLAG1: number; + static FLAG2: number; + static FLAG3: number; + static FLAG4: number; + static FLAG5: number; + static FLAG6: number; + static FLAG7: number; + static FLAG8: number; + static FLAG9: number; + static FLAG10: number; + static FLAG11: number; + static FLAG12: number; + static FLAG13: number; + static FLAG14: number; + static FLAG15: number; + static FLAG16: number; + static test(flags: number, testFlag: number): boolean; + } + export = BitFlags; + +} +declare module "awayjs-renderergl/lib/parsers/AWDParser" { + import IAsset = require("awayjs-core/lib/core/library/IAsset"); + import ParserBase = require("awayjs-core/lib/parsers/ParserBase"); + import ResourceDependency = require("awayjs-core/lib/parsers/ResourceDependency"); + /** + * AWDParser provides a parser for the AWD data type. + */ + class AWDParser extends ParserBase { + private _debug; + private _byteData; + private _startedParsing; + private _cur_block_id; + private _blocks; + private _newBlockBytes; + private _version; + private _compression; + private _accuracyOnBlocks; + private _accuracyMatrix; + private _accuracyGeo; + private _accuracyProps; + private _matrixNrType; + private _geoNrType; + private _propsNrType; + private _streaming; + private _texture_users; + private _parsed_header; + private _body; + private _defaultTexture; + private _cubeTextures; + private _defaultBitmapMaterial; + private _defaultCubeTexture; + static COMPRESSIONMODE_LZMA: string; + static UNCOMPRESSED: number; + static DEFLATE: number; + static LZMA: number; + static INT8: number; + static INT16: number; + static INT32: number; + static UINT8: number; + static UINT16: number; + static UINT32: number; + static FLOAT32: number; + static FLOAT64: number; + static BOOL: number; + static COLOR: number; + static BADDR: number; + static AWDSTRING: number; + static AWDBYTEARRAY: number; + static VECTOR2x1: number; + static VECTOR3x1: number; + static VECTOR4x1: number; + static MTX3x2: number; + static MTX3x3: number; + static MTX4x3: number; + static MTX4x4: number; + private blendModeDic; + private _depthSizeDic; + /** + * Creates a new AWDParser object. + * @param uri The url or id of the data or file to be parsed. + * @param extra The holder for extra contextual data that the parser might need. + */ + constructor(); + /** + * Indicates whether or not a given file extension is supported by the parser. + * @param extension The file extension of a potential file to be parsed. + * @return Whether or not the given file type is supported. + */ + static supportsType(extension: string): boolean; + /** + * Tests whether a data block can be parsed by the parser. + * @param data The data block to potentially be parsed. + * @return Whether or not the given data is supported. + */ + static supportsData(data: any): boolean; + /** + * @inheritDoc + */ + _iResolveDependency(resourceDependency: ResourceDependency): void; + /** + * @inheritDoc + */ + _iResolveDependencyFailure(resourceDependency: ResourceDependency): void; + /** + * Resolve a dependency name + * + * @param resourceDependency The dependency to be resolved. + */ + _iResolveDependencyName(resourceDependency: ResourceDependency, asset: IAsset): string; + /** + * @inheritDoc + */ + _pProceedParsing(): boolean; + _pStartParsing(frameLimit: number): void; + private dispose(); + private parseNextBlock(); + private parseTriangleGeometrieBlock(blockID); + private parsePrimitves(blockID); + private parseContainer(blockID); + private parseMeshInstance(blockID); + private parseSkyboxInstance(blockID); + private parseLight(blockID); + private parseCamera(blockID); + private parseLightPicker(blockID); + private parseMaterial(blockID); + private parseMaterial_v1(blockID); + private parseTexture(blockID); + private parseCubeTexture(blockID); + private parseSharedMethodBlock(blockID); + private parseShadowMethodBlock(blockID); + private parseCommand(blockID); + private parseMetaData(blockID); + private parseNameSpace(blockID); + private parseShadowMethodList(light, blockID); + private parseSkeleton(blockID); + private parseSkeletonPose(blockID); + private parseSkeletonAnimation(blockID); + private parseMeshPoseAnimation(blockID, poseOnly?); + private parseVertexAnimationSet(blockID); + private parseAnimatorSet(blockID); + private parseSharedMethodList(blockID); + private parseUserAttributes(); + private parseProperties(expected); + private parseAttrValue(type, len); + private parseHeader(); + private getUVForVertexAnimation(meshID); + private parseVarStr(); + private getAssetByID(assetID, assetTypesToGet, extraTypeInfo?); + private getDefaultAsset(assetType, extraTypeInfo); + private getDefaultMaterial(); + private getDefaultTexture(); + private getDefaultCubeTexture(); + private readNumber(precision?); + private parseMatrix3D(); + private parseMatrix32RawData(); + private parseMatrix43RawData(); + } + export = AWDParser; + +} +declare module "awayjs-renderergl/lib/parsers/MD2Parser" { + import ParserBase = require("awayjs-core/lib/parsers/ParserBase"); + import ResourceDependency = require("awayjs-core/lib/parsers/ResourceDependency"); + /** + * MD2Parser provides a parser for the MD2 data type. + */ + class MD2Parser extends ParserBase { + static FPS: number; + private _clipNodes; + private _byteData; + private _startedParsing; + private _parsedHeader; + private _parsedUV; + private _parsedFaces; + private _parsedFrames; + private _ident; + private _version; + private _skinWidth; + private _skinHeight; + private _numSkins; + private _numVertices; + private _numST; + private _numTris; + private _numFrames; + private _offsetSkins; + private _offsetST; + private _offsetTris; + private _offsetFrames; + private _offsetEnd; + private _uvIndices; + private _indices; + private _vertIndices; + private _animationSet; + private _firstSubGeom; + private _uvs; + private _finalUV; + private _materialNames; + private _textureType; + private _ignoreTexturePath; + private _mesh; + private _geometry; + private materialFinal; + private geoCreated; + /** + * Creates a new MD2Parser object. + * @param textureType The extension of the texture (e.g. jpg/png/...) + * @param ignoreTexturePath If true, the path of the texture is ignored + */ + constructor(textureType?: string, ignoreTexturePath?: boolean); + /** + * Indicates whether or not a given file extension is supported by the parser. + * @param extension The file extension of a potential file to be parsed. + * @return Whether or not the given file type is supported. + */ + static supportsType(extension: string): boolean; + /** + * Tests whether a data block can be parsed by the parser. + * @param data The data block to potentially be parsed. + * @return Whether or not the given data is supported. + */ + static supportsData(data: any): boolean; + /** + * @inheritDoc + */ + _iResolveDependency(resourceDependency: ResourceDependency): void; + /** + * @inheritDoc + */ + _iResolveDependencyFailure(resourceDependency: ResourceDependency): void; + /** + * @inheritDoc + */ + _pProceedParsing(): boolean; + _pStartParsing(frameLimit: number): void; + /** + * Reads in all that MD2 Header data that is declared as private variables. + * I know its a lot, and it looks ugly, but only way to do it in Flash + */ + private parseHeader(); + /** + * Parses the file names for the materials. + */ + private parseMaterialNames(); + /** + * Parses the uv data for the mesh. + */ + private parseUV(); + /** + * Parses unique indices for the faces. + */ + private parseFaces(); + /** + * Adds a face index to the list if it doesn't exist yet, based on vertexIndex and uvIndex, and adds the + * corresponding vertex and uv data in the correct location. + * @param vertexIndex The original index in the vertex list. + * @param uvIndex The original index in the uv list. + */ + private addIndex(vertexIndex, uvIndex); + /** + * Finds the final index corresponding to the original MD2's vertex and uv indices. Returns -1 if it wasn't added yet. + * @param vertexIndex The original index in the vertex list. + * @param uvIndex The original index in the uv list. + * @return The index of the final mesh corresponding to the original vertex and uv index. -1 if it doesn't exist yet. + */ + private findIndex(vertexIndex, uvIndex); + /** + * Parses all the frame geometries. + */ + private parseFrames(); + private readFrameName(); + } + export = MD2Parser; + +} +declare module "awayjs-renderergl/lib/parsers/data/BaseFrameData" { + import Quaternion = require("awayjs-core/lib/core/geom/Quaternion"); + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + /** + * + */ + class BaseFrameData { + /** + * + */ + position: Vector3D; + /** + * + */ + orientation: Quaternion; + } + export = BaseFrameData; + +} +declare module "awayjs-renderergl/lib/parsers/data/BoundsData" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + /** + * + */ + class BoundsData { + /** + * + */ + min: Vector3D; + /** + * + */ + max: Vector3D; + } + export = BoundsData; + +} +declare module "awayjs-renderergl/lib/parsers/data/FrameData" { + /** + * + */ + class FrameData { + /** + * + */ + index: number; + /** + * + */ + components: number[]; + } + export = FrameData; + +} +declare module "awayjs-renderergl/lib/parsers/data/HierarchyData" { + /** + * + */ + class HierarchyData { + /** + * + */ + name: string; + /** + * + */ + parentIndex: number; + /** + * + */ + flags: number; + /** + * + */ + startIndex: number; + } + export = HierarchyData; + +} +declare module "awayjs-renderergl/lib/parsers/MD5AnimParser" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import ParserBase = require("awayjs-core/lib/parsers/ParserBase"); + /** + * MD5AnimParser provides a parser for the md5anim data type, providing an animation sequence for the md5 format. + * + * todo: optimize + */ + class MD5AnimParser extends ParserBase { + private _textData; + private _startedParsing; + static VERSION_TOKEN: string; + static COMMAND_LINE_TOKEN: string; + static NUM_FRAMES_TOKEN: string; + static NUM_JOINTS_TOKEN: string; + static FRAME_RATE_TOKEN: string; + static NUM_ANIMATED_COMPONENTS_TOKEN: string; + static HIERARCHY_TOKEN: string; + static BOUNDS_TOKEN: string; + static BASE_FRAME_TOKEN: string; + static FRAME_TOKEN: string; + static COMMENT_TOKEN: string; + private _parseIndex; + private _reachedEOF; + private _line; + private _charLineIndex; + private _version; + private _frameRate; + private _numFrames; + private _numJoints; + private _numAnimatedComponents; + private _hierarchy; + private _bounds; + private _frameData; + private _baseFrameData; + private _rotationQuat; + private _clip; + /** + * Creates a new MD5AnimParser object. + * @param uri The url or id of the data or file to be parsed. + * @param extra The holder for extra contextual data that the parser might need. + */ + constructor(additionalRotationAxis?: Vector3D, additionalRotationRadians?: number); + /** + * Indicates whether or not a given file extension is supported by the parser. + * @param extension The file extension of a potential file to be parsed. + * @return Whether or not the given file type is supported. + */ + static supportsType(extension: string): boolean; + /** + * Tests whether a data block can be parsed by the parser. + * @param data The data block to potentially be parsed. + * @return Whether or not the given data is supported. + */ + static supportsData(data: any): boolean; + /** + * @inheritDoc + */ + _pProceedParsing(): boolean; + /** + * Converts all key frame data to an SkinnedAnimationSequence. + */ + private translateClip(); + /** + * Converts a single key frame data to a SkeletonPose. + * @param frameData The actual frame data. + * @return A SkeletonPose containing the frame data's pose. + */ + private translatePose(frameData); + /** + * Parses the skeleton's hierarchy data. + */ + private parseHierarchy(); + /** + * Parses frame bounds. + */ + private parseBounds(); + /** + * Parses the base frame. + */ + private parseBaseFrame(); + /** + * Parses a single frame. + */ + private parseFrame(); + /** + * Puts back the last read character into the data stream. + */ + private putBack(); + /** + * Gets the next token in the data stream. + */ + private getNextToken(); + /** + * Skips all whitespace in the data stream. + */ + private skipWhiteSpace(); + /** + * Skips to the next line. + */ + private ignoreLine(); + /** + * Retrieves the next single character in the data stream. + */ + private getNextChar(); + /** + * Retrieves the next integer in the data stream. + */ + private getNextInt(); + /** + * Retrieves the next floating point number in the data stream. + */ + private getNextNumber(); + /** + * Retrieves the next 3d vector in the data stream. + */ + private parseVector3D(); + /** + * Retrieves the next quaternion in the data stream. + */ + private parseQuaternion(); + /** + * Parses the command line data. + */ + private parseCMD(); + /** + * Retrieves the next literal string in the data stream. A literal string is a sequence of characters bounded + * by double quotes. + */ + private parseLiteralstring(); + /** + * Throws an end-of-file error when a premature end of file was encountered. + */ + private sendEOFError(); + /** + * Throws an error when an unexpected token was encountered. + * @param expected The token type that was actually expected. + */ + private sendParseError(expected); + /** + * Throws an error when an unknown keyword was encountered. + */ + private sendUnknownKeywordError(); + } + export = MD5AnimParser; + +} +declare module "awayjs-renderergl/lib/parsers/MD5MeshParser" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import ParserBase = require("awayjs-core/lib/parsers/ParserBase"); + /** + * MD5MeshParser provides a parser for the md5mesh data type, providing the geometry of the md5 format. + * + * todo: optimize + */ + class MD5MeshParser extends ParserBase { + private _textData; + private _startedParsing; + static VERSION_TOKEN: string; + static COMMAND_LINE_TOKEN: string; + static NUM_JOINTS_TOKEN: string; + static NUM_MESHES_TOKEN: string; + static COMMENT_TOKEN: string; + static JOINTS_TOKEN: string; + static MESH_TOKEN: string; + static MESH_SHADER_TOKEN: string; + static MESH_NUM_VERTS_TOKEN: string; + static MESH_VERT_TOKEN: string; + static MESH_NUM_TRIS_TOKEN: string; + static MESH_TRI_TOKEN: string; + static MESH_NUM_WEIGHTS_TOKEN: string; + static MESH_WEIGHT_TOKEN: string; + private _parseIndex; + private _reachedEOF; + private _line; + private _charLineIndex; + private _version; + private _numJoints; + private _numMeshes; + private _mesh; + private _shaders; + private _maxJointCount; + private _meshData; + private _bindPoses; + private _geometry; + private _skeleton; + private _animationSet; + private _rotationQuat; + /** + * Creates a new MD5MeshParser object. + */ + constructor(additionalRotationAxis?: Vector3D, additionalRotationRadians?: number); + /** + * Indicates whether or not a given file extension is supported by the parser. + * @param extension The file extension of a potential file to be parsed. + * @return Whether or not the given file type is supported. + */ + static supportsType(extension: string): boolean; + /** + * Tests whether a data block can be parsed by the parser. + * @param data The data block to potentially be parsed. + * @return Whether or not the given data is supported. + */ + static supportsData(data: any): boolean; + /** + * @inheritDoc + */ + _pProceedParsing(): boolean; + _pStartParsing(frameLimit: number): void; + private calculateMaxJointCount(); + private countZeroWeightJoints(vertex, weights); + /** + * Parses the skeleton's joints. + */ + private parseJoints(); + /** + * Puts back the last read character into the data stream. + */ + private putBack(); + /** + * Parses the mesh geometry. + */ + private parseMesh(); + /** + * Converts the mesh data to a SkinnedSub instance. + * @param vertexData The mesh's vertices. + * @param weights The joint weights per vertex. + * @param indices The indices for the faces. + * @return A SubGeometry instance containing all geometrical data for the current mesh. + */ + private translateGeom(vertexData, weights, indices); + /** + * Retrieve the next triplet of vertex indices that form a face. + * @param indices The index list in which to store the read data. + */ + private parseTri(indices); + /** + * Reads a new joint data set for a single joint. + * @param weights the target list to contain the weight data. + */ + private parseJoint(weights); + /** + * Reads the data for a single vertex. + * @param vertexData The list to contain the vertex data. + */ + private parseVertex(vertexData); + /** + * Reads the next uv coordinate. + * @param vertexData The vertexData to contain the UV coordinates. + */ + private parseUV(vertexData); + /** + * Gets the next token in the data stream. + */ + private getNextToken(); + /** + * Skips all whitespace in the data stream. + */ + private skipWhiteSpace(); + /** + * Skips to the next line. + */ + private ignoreLine(); + /** + * Retrieves the next single character in the data stream. + */ + private getNextChar(); + /** + * Retrieves the next integer in the data stream. + */ + private getNextInt(); + /** + * Retrieves the next floating point number in the data stream. + */ + private getNextNumber(); + /** + * Retrieves the next 3d vector in the data stream. + */ + private parseVector3D(); + /** + * Retrieves the next quaternion in the data stream. + */ + private parseQuaternion(); + /** + * Parses the command line data. + */ + private parseCMD(); + /** + * Retrieves the next literal string in the data stream. A literal string is a sequence of characters bounded + * by double quotes. + */ + private parseLiteralstring(); + /** + * Throws an end-of-file error when a premature end of file was encountered. + */ + private sendEOFError(); + /** + * Throws an error when an unexpected token was encountered. + * @param expected The token type that was actually expected. + */ + private sendParseError(expected); + /** + * Throws an error when an unknown keyword was encountered. + */ + private sendUnknownKeywordError(); + } + export = MD5MeshParser; + +} +declare module "awayjs-renderergl/lib/parsers/data/FaceVO" { + /** + * + */ + class FaceVO { + a: number; + b: number; + c: number; + smoothGroup: number; + } + export = FaceVO; + +} +declare module "awayjs-renderergl/lib/parsers/data/TextureVO" { + import Texture2DBase = require("awayjs-core/lib/textures/Texture2DBase"); + /** + * + */ + class TextureVO { + url: string; + texture: Texture2DBase; + } + export = TextureVO; + +} +declare module "awayjs-renderergl/lib/parsers/data/MaterialVO" { + import MaterialBase = require("awayjs-core/lib/materials/MaterialBase"); + import TextureVO = require("awayjs-renderergl/lib/parsers/data/TextureVO"); + /** + * + */ + class MaterialVO { + name: string; + ambientColor: number; + diffuseColor: number; + specularColor: number; + twoSided: boolean; + colorMap: TextureVO; + specularMap: TextureVO; + material: MaterialBase; + } + export = MaterialVO; + +} +declare module "awayjs-renderergl/lib/parsers/data/ObjectVO" { + class ObjectVO { + name: string; + type: string; + pivotX: number; + pivotY: number; + pivotZ: number; + transform: number[]; + verts: number[]; + indices: number[]; + uvs: number[]; + materialFaces: Object; + materials: string[]; + smoothingGroups: number[]; + } + export = ObjectVO; + +} +declare module "awayjs-renderergl/lib/parsers/data/VertexVO" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + class VertexVO { + x: number; + y: number; + z: number; + u: number; + v: number; + normal: Vector3D; + tangent: Vector3D; + } + export = VertexVO; + +} +declare module "awayjs-renderergl/lib/parsers/Max3DSParser" { + import ParserBase = require("awayjs-core/lib/parsers/ParserBase"); + import ResourceDependency = require("awayjs-core/lib/parsers/ResourceDependency"); + /** + * Max3DSParser provides a parser for the 3ds data type. + */ + class Max3DSParser extends ParserBase { + private _byteData; + private _textures; + private _materials; + private _unfinalized_objects; + private _cur_obj_end; + private _cur_obj; + private _cur_mat_end; + private _cur_mat; + private _useSmoothingGroups; + /** + * Creates a new Max3DSParser object. + * + * @param useSmoothingGroups Determines whether the parser looks for smoothing groups in the 3ds file or assumes uniform smoothing. Defaults to true. + */ + constructor(useSmoothingGroups?: boolean); + /** + * Indicates whether or not a given file extension is supported by the parser. + * @param extension The file extension of a potential file to be parsed. + * @return Whether or not the given file type is supported. + */ + static supportsType(extension: string): boolean; + /** + * Tests whether a data block can be parsed by the parser. + * @param data The data block to potentially be parsed. + * @return Whether or not the given data is supported. + */ + static supportsData(data: any): boolean; + /** + * @inheritDoc + */ + _iResolveDependency(resourceDependency: ResourceDependency): void; + /** + * @inheritDoc + */ + _iResolveDependencyFailure(resourceDependency: ResourceDependency): void; + /** + * @inheritDoc + */ + _pProceedParsing(): boolean; + _pStartParsing(frameLimit: number): void; + private parseMaterial(); + private parseTexture(end); + private parseVertexList(); + private parseFaceList(); + private parseSmoothingGroups(); + private parseUVList(); + private parseFaceMaterialList(); + private parseObjectAnimation(end); + private constructObject(obj, pivot?); + private prepareData(vertices, faces, obj); + private applySmoothGroups(vertices, faces); + private finalizeCurrentMaterial(); + private readNulTermstring(); + private readTransform(); + private readColor(); + } + export = Max3DSParser; + +} +declare module "awayjs-renderergl/lib/parsers/OBJParser" { + import ParserBase = require("awayjs-core/lib/parsers/ParserBase"); + import ResourceDependency = require("awayjs-core/lib/parsers/ResourceDependency"); + /** + * OBJParser provides a parser for the OBJ data type. + */ + class OBJParser extends ParserBase { + private _textData; + private _startedParsing; + private _charIndex; + private _oldIndex; + private _stringLength; + private _currentObject; + private _currentGroup; + private _currentMaterialGroup; + private _objects; + private _materialIDs; + private _materialLoaded; + private _materialSpecularData; + private _meshes; + private _lastMtlID; + private _objectIndex; + private _realIndices; + private _vertexIndex; + private _vertices; + private _vertexNormals; + private _uvs; + private _scale; + private _mtlLib; + private _mtlLibLoaded; + private _activeMaterialID; + /** + * Creates a new OBJParser object. + * @param uri The url or id of the data or file to be parsed. + * @param extra The holder for extra contextual data that the parser might need. + */ + constructor(scale?: number); + /** + * Scaling factor applied directly to vertices data + * @param value The scaling factor. + */ + scale: number; + /** + * Indicates whether or not a given file extension is supported by the parser. + * @param extension The file extension of a potential file to be parsed. + * @return Whether or not the given file type is supported. + */ + static supportsType(extension: string): boolean; + /** + * Tests whether a data block can be parsed by the parser. + * @param data The data block to potentially be parsed. + * @return Whether or not the given data is supported. + */ + static supportsData(data: any): boolean; + /** + * @inheritDoc + */ + _iResolveDependency(resourceDependency: ResourceDependency): void; + /** + * @inheritDoc + */ + _iResolveDependencyFailure(resourceDependency: ResourceDependency): void; + /** + * @inheritDoc + */ + _pProceedParsing(): boolean; + _pStartParsing(frameLimit: number): void; + /** + * Parses a single line in the OBJ file. + */ + private parseLine(trunk); + /** + * Converts the parsed data into an Away3D scenegraph structure + */ + private translate(); + /** + * Translates an obj's material group to a subgeometry. + * @param materialGroup The material group data to convert. + * @param geometry The Geometry to contain the converted SubGeometry. + */ + private translateMaterialGroup(materialGroup, geometry); + private translateVertexData(face, vertexIndex, vertices, uvs, indices, normals); + /** + * Creates a new object group. + * @param trunk The data block containing the object tag and its parameters + */ + private createObject(trunk); + /** + * Creates a new group. + * @param trunk The data block containing the group tag and its parameters + */ + private createGroup(trunk); + /** + * Creates a new material group. + * @param trunk The data block containing the material tag and its parameters + */ + private createMaterialGroup(trunk); + /** + * Reads the next vertex coordinates. + * @param trunk The data block containing the vertex tag and its parameters + */ + private parseVertex(trunk); + /** + * Reads the next uv coordinates. + * @param trunk The data block containing the uv tag and its parameters + */ + private parseUV(trunk); + /** + * Reads the next vertex normal coordinates. + * @param trunk The data block containing the vertex normal tag and its parameters + */ + private parseVertexNormal(trunk); + /** + * Reads the next face's indices. + * @param trunk The data block containing the face tag and its parameters + */ + private parseFace(trunk); + /** + * This is a hack around negative face coords + */ + private parseIndex(index, length); + private parseMtl(data); + private parseMapKdString(trunk); + private loadMtl(mtlurl); + private applyMaterial(lm); + private applyMaterials(); + } + export = OBJParser; + +} +declare module "awayjs-renderergl/lib/parsers/Parsers" { + /** + * + */ + class Parsers { + /** + * A list of all parsers that come bundled with Away3D. Use this to quickly + * enable support for all bundled parsers to the file format auto-detection + * feature, using any of the enableParsers() methods on loaders, e.g.: + * + * AssetLibrary.enableParsers(Parsers.ALL_BUNDLED); + * + * Beware however that this requires all parser classes to be included in the + * SWF file, which will add 50-100 kb to the file. When only a limited set of + * file formats are used, SWF file size can be saved by adding the parsers + * individually using AssetLibrary.enableParser() + * + * A third way is to specify a parser for each loaded file, thereby bypassing + * the auto-detection mechanisms altogether, while at the same time allowing + * any properties that are unique to that parser to be set for that load. + * + * The bundled parsers are: + * + * + * + * @see away.library.AssetLibrary.enableParser + */ + static ALL_BUNDLED: Object[]; + /** + * Short-hand function to enable all bundled parsers for auto-detection. In practice, + * this is the same as invoking enableParsers(Parsers.ALL_BUNDLED) on any of the + * loader classes SingleFileLoader, AssetLoader, AssetLibrary or Loader3D. + * + * See notes about file size in the documentation for the ALL_BUNDLED constant. + * + * @see away.parsers.Parsers.ALL_BUNDLED + */ + static enableAllBundled(): void; + } + export = Parsers; + +} +declare module "awayjs-renderergl/lib/utils/PerspectiveMatrix3D" { + import Matrix3D = require("awayjs-core/lib/core/geom/Matrix3D"); + /** + * + */ + class PerspectiveMatrix3D extends Matrix3D { + constructor(v?: number[]); + perspectiveFieldOfViewLH(fieldOfViewY: number, aspectRatio: number, zNear: number, zFar: number): void; + } + export = PerspectiveMatrix3D; + +} +declare module "awayjs-renderergl/lib/animators/data/ColorSegmentPoint" { + import ColorTransform = require("awayjs-core/lib/core/geom/ColorTransform"); + class ColorSegmentPoint { + private _color; + private _life; + constructor(life: number, color: ColorTransform); + color: ColorTransform; + life: number; + } + export = ColorSegmentPoint; + +} +declare module "awayjs-renderergl/lib/animators/states/ParticleAccelerationState" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import Camera = require("awayjs-core/lib/entities/Camera"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import ParticleAnimator = require("awayjs-renderergl/lib/animators/ParticleAnimator"); + import AnimationSubGeometry = require("awayjs-renderergl/lib/animators/data/AnimationSubGeometry"); + import ParticleAccelerationNode = require("awayjs-renderergl/lib/animators/nodes/ParticleAccelerationNode"); + import ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); + /** + * ... + */ + class ParticleAccelerationState extends ParticleStateBase { + /** @private */ + static ACCELERATION_INDEX: number; + private _particleAccelerationNode; + private _acceleration; + private _halfAcceleration; + /** + * Defines the acceleration vector of the state, used when in global mode. + */ + acceleration: Vector3D; + constructor(animator: ParticleAnimator, particleAccelerationNode: ParticleAccelerationNode); + /** + * @inheritDoc + */ + setRenderState(stage: Stage, renderable: RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: Camera): void; + private updateAccelerationData(); + } + export = ParticleAccelerationState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/ParticleAccelerationNode" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ParticleProperties = require("awayjs-renderergl/lib/animators/data/ParticleProperties"); + import ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); + import ParticleAccelerationState = require("awayjs-renderergl/lib/animators/states/ParticleAccelerationState"); + /** + * A particle animation node used to apply a constant acceleration vector to the motion of a particle. + */ + class ParticleAccelerationNode extends ParticleNodeBase { + /** @private */ + _acceleration: Vector3D; + /** + * Reference for acceleration node properties on a single particle (when in local property mode). + * Expects a Vector3D object representing the direction of acceleration on the particle. + */ + static ACCELERATION_VECTOR3D: string; + /** + * Creates a new ParticleAccelerationNode + * + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + * @param [optional] acceleration Defines the default acceleration vector of the node, used when in global mode. + */ + constructor(mode: number, acceleration?: Vector3D); + /** + * @inheritDoc + */ + pGetAGALVertexCode(shaderObject: ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; + /** + * @inheritDoc + */ + getAnimationState(animator: AnimatorBase): ParticleAccelerationState; + /** + * @inheritDoc + */ + _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; + } + export = ParticleAccelerationNode; + +} +declare module "awayjs-renderergl/lib/animators/states/ParticleBezierCurveState" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import Camera = require("awayjs-core/lib/entities/Camera"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import ParticleAnimator = require("awayjs-renderergl/lib/animators/ParticleAnimator"); + import AnimationSubGeometry = require("awayjs-renderergl/lib/animators/data/AnimationSubGeometry"); + import ParticleBezierCurveNode = require("awayjs-renderergl/lib/animators/nodes/ParticleBezierCurveNode"); + import ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); + /** + * ... + */ + class ParticleBezierCurveState extends ParticleStateBase { + /** @private */ + static BEZIER_CONTROL_INDEX: number; + /** @private */ + static BEZIER_END_INDEX: number; + private _particleBezierCurveNode; + private _controlPoint; + private _endPoint; + /** + * Defines the default control point of the node, used when in global mode. + */ + controlPoint: Vector3D; + /** + * Defines the default end point of the node, used when in global mode. + */ + endPoint: Vector3D; + constructor(animator: ParticleAnimator, particleBezierCurveNode: ParticleBezierCurveNode); + setRenderState(stage: Stage, renderable: RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: Camera): void; + } + export = ParticleBezierCurveState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/ParticleBezierCurveNode" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ParticleProperties = require("awayjs-renderergl/lib/animators/data/ParticleProperties"); + import ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); + import ParticleBezierCurveState = require("awayjs-renderergl/lib/animators/states/ParticleBezierCurveState"); + /** + * A particle animation node used to control the position of a particle over time along a bezier curve. + */ + class ParticleBezierCurveNode extends ParticleNodeBase { + /** @private */ + _iControlPoint: Vector3D; + /** @private */ + _iEndPoint: Vector3D; + /** + * Reference for bezier curve node properties on a single particle (when in local property mode). + * Expects a Vector3D object representing the control point position (0, 1, 2) of the curve. + */ + static BEZIER_CONTROL_VECTOR3D: string; + /** + * Reference for bezier curve node properties on a single particle (when in local property mode). + * Expects a Vector3D object representing the end point position (0, 1, 2) of the curve. + */ + static BEZIER_END_VECTOR3D: string; + /** + * Creates a new ParticleBezierCurveNode + * + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + * @param [optional] controlPoint Defines the default control point of the node, used when in global mode. + * @param [optional] endPoint Defines the default end point of the node, used when in global mode. + */ + constructor(mode: number, controlPoint?: Vector3D, endPoint?: Vector3D); + /** + * @inheritDoc + */ + getAGALVertexCode(shaderObject: ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; + /** + * @inheritDoc + */ + getAnimationState(animator: AnimatorBase): ParticleBezierCurveState; + /** + * @inheritDoc + */ + _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; + } + export = ParticleBezierCurveNode; + +} +declare module "awayjs-renderergl/lib/animators/states/ParticleBillboardState" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import Camera = require("awayjs-core/lib/entities/Camera"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import ParticleAnimator = require("awayjs-renderergl/lib/animators/ParticleAnimator"); + import AnimationSubGeometry = require("awayjs-renderergl/lib/animators/data/AnimationSubGeometry"); + import ParticleBillboardNode = require("awayjs-renderergl/lib/animators/nodes/ParticleBillboardNode"); + import ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); + /** + * ... + */ + class ParticleBillboardState extends ParticleStateBase { + /** @private */ + static MATRIX_INDEX: number; + private _matrix; + private _billboardAxis; + /** + * + */ + constructor(animator: ParticleAnimator, particleNode: ParticleBillboardNode); + setRenderState(stage: Stage, renderable: RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: Camera): void; + /** + * Defines the billboard axis. + */ + billboardAxis: Vector3D; + } + export = ParticleBillboardState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/ParticleBillboardNode" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ParticleAnimationSet = require("awayjs-renderergl/lib/animators/ParticleAnimationSet"); + import ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); + import ParticleBillboardState = require("awayjs-renderergl/lib/animators/states/ParticleBillboardState"); + /** + * A particle animation node that controls the rotation of a particle to always face the camera. + */ + class ParticleBillboardNode extends ParticleNodeBase { + /** @private */ + _iBillboardAxis: Vector3D; + /** + * Creates a new ParticleBillboardNode + */ + constructor(billboardAxis?: Vector3D); + /** + * @inheritDoc + */ + getAGALVertexCode(shaderObject: ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; + /** + * @inheritDoc + */ + getAnimationState(animator: AnimatorBase): ParticleBillboardState; + /** + * @inheritDoc + */ + _iProcessAnimationSetting(particleAnimationSet: ParticleAnimationSet): void; + } + export = ParticleBillboardNode; + +} +declare module "awayjs-renderergl/lib/animators/states/ParticleColorState" { + import ColorTransform = require("awayjs-core/lib/core/geom/ColorTransform"); + import Camera = require("awayjs-core/lib/entities/Camera"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import ParticleAnimator = require("awayjs-renderergl/lib/animators/ParticleAnimator"); + import AnimationSubGeometry = require("awayjs-renderergl/lib/animators/data/AnimationSubGeometry"); + import ParticleColorNode = require("awayjs-renderergl/lib/animators/nodes/ParticleColorNode"); + import ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); + /** + * ... + * @author ... + */ + class ParticleColorState extends ParticleStateBase { + /** @private */ + static START_MULTIPLIER_INDEX: number; + /** @private */ + static DELTA_MULTIPLIER_INDEX: number; + /** @private */ + static START_OFFSET_INDEX: number; + /** @private */ + static DELTA_OFFSET_INDEX: number; + /** @private */ + static CYCLE_INDEX: number; + private _particleColorNode; + private _usesMultiplier; + private _usesOffset; + private _usesCycle; + private _usesPhase; + private _startColor; + private _endColor; + private _cycleDuration; + private _cyclePhase; + private _cycleData; + private _startMultiplierData; + private _deltaMultiplierData; + private _startOffsetData; + private _deltaOffsetData; + /** + * Defines the start color transform of the state, when in global mode. + */ + startColor: ColorTransform; + /** + * Defines the end color transform of the state, when in global mode. + */ + endColor: ColorTransform; + /** + * Defines the duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. + */ + cycleDuration: number; + /** + * Defines the phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. + */ + cyclePhase: number; + constructor(animator: ParticleAnimator, particleColorNode: ParticleColorNode); + setRenderState(stage: Stage, renderable: RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: Camera): void; + private updateColorData(); + } + export = ParticleColorState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/ParticleColorNode" { + import ColorTransform = require("awayjs-core/lib/core/geom/ColorTransform"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ParticleAnimationSet = require("awayjs-renderergl/lib/animators/ParticleAnimationSet"); + import ParticleProperties = require("awayjs-renderergl/lib/animators/data/ParticleProperties"); + import ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); + import ParticleColorState = require("awayjs-renderergl/lib/animators/states/ParticleColorState"); + /** + * A particle animation node used to control the color variation of a particle over time. + */ + class ParticleColorNode extends ParticleNodeBase { + /** @private */ + _iUsesMultiplier: boolean; + /** @private */ + _iUsesOffset: boolean; + /** @private */ + _iUsesCycle: boolean; + /** @private */ + _iUsesPhase: boolean; + /** @private */ + _iStartColor: ColorTransform; + /** @private */ + _iEndColor: ColorTransform; + /** @private */ + _iCycleDuration: number; + /** @private */ + _iCyclePhase: number; + /** + * Reference for color node properties on a single particle (when in local property mode). + * Expects a ColorTransform object representing the start color transform applied to the particle. + */ + static COLOR_START_COLORTRANSFORM: string; + /** + * Reference for color node properties on a single particle (when in local property mode). + * Expects a ColorTransform object representing the end color transform applied to the particle. + */ + static COLOR_END_COLORTRANSFORM: string; + /** + * Creates a new ParticleColorNode + * + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + * @param [optional] usesMultiplier Defines whether the node uses multiplier data in the shader for its color transformations. Defaults to true. + * @param [optional] usesOffset Defines whether the node uses offset data in the shader for its color transformations. Defaults to true. + * @param [optional] usesCycle Defines whether the node uses the cycleDuration property in the shader to calculate the period of the animation independent of particle duration. Defaults to false. + * @param [optional] usesPhase Defines whether the node uses the cyclePhase property in the shader to calculate a starting offset to the cycle rotation of the particle. Defaults to false. + * @param [optional] startColor Defines the default start color transform of the node, when in global mode. + * @param [optional] endColor Defines the default end color transform of the node, when in global mode. + * @param [optional] cycleDuration Defines the duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. + * @param [optional] cyclePhase Defines the phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. + */ + constructor(mode: number, usesMultiplier?: boolean, usesOffset?: boolean, usesCycle?: boolean, usesPhase?: boolean, startColor?: ColorTransform, endColor?: ColorTransform, cycleDuration?: number, cyclePhase?: number); + /** + * @inheritDoc + */ + getAGALVertexCode(shaderObject: ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; + /** + * @inheritDoc + */ + getAnimationState(animator: AnimatorBase): ParticleColorState; + /** + * @inheritDoc + */ + _iProcessAnimationSetting(particleAnimationSet: ParticleAnimationSet): void; + /** + * @inheritDoc + */ + _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; + } + export = ParticleColorNode; + +} +declare module "awayjs-renderergl/lib/animators/states/ParticleFollowState" { + import DisplayObject = require("awayjs-core/lib/core/base/DisplayObject"); + import Camera = require("awayjs-core/lib/entities/Camera"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import ParticleAnimator = require("awayjs-renderergl/lib/animators/ParticleAnimator"); + import AnimationSubGeometry = require("awayjs-renderergl/lib/animators/data/AnimationSubGeometry"); + import ParticleFollowNode = require("awayjs-renderergl/lib/animators/nodes/ParticleFollowNode"); + import ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); + /** + * ... + */ + class ParticleFollowState extends ParticleStateBase { + /** @private */ + static FOLLOW_POSITION_INDEX: number; + /** @private */ + static FOLLOW_ROTATION_INDEX: number; + private _particleFollowNode; + private _followTarget; + private _targetPos; + private _targetEuler; + private _prePos; + private _preEuler; + private _smooth; + private _temp; + constructor(animator: ParticleAnimator, particleFollowNode: ParticleFollowNode); + followTarget: DisplayObject; + smooth: boolean; + /** + * @inheritDoc + */ + setRenderState(stage: Stage, renderable: RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: Camera): void; + private processPosition(currentTime, deltaTime, animationSubGeometry); + private precessRotation(currentTime, deltaTime, animationSubGeometry); + private processPositionAndRotation(currentTime, deltaTime, animationSubGeometry); + } + export = ParticleFollowState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/ParticleFollowNode" { + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); + import ParticleFollowState = require("awayjs-renderergl/lib/animators/states/ParticleFollowState"); + /** + * A particle animation node used to create a follow behaviour on a particle system. + */ + class ParticleFollowNode extends ParticleNodeBase { + /** @private */ + _iUsesPosition: boolean; + /** @private */ + _iUsesRotation: boolean; + /** @private */ + _iSmooth: boolean; + /** + * Creates a new ParticleFollowNode + * + * @param [optional] usesPosition Defines wehether the individual particle reacts to the position of the target. + * @param [optional] usesRotation Defines wehether the individual particle reacts to the rotation of the target. + * @param [optional] smooth Defines wehether the state calculate the interpolated value. + */ + constructor(usesPosition?: boolean, usesRotation?: boolean, smooth?: boolean); + /** + * @inheritDoc + */ + getAGALVertexCode(shaderObject: ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; + /** + * @inheritDoc + */ + getAnimationState(animator: AnimatorBase): ParticleFollowState; + } + export = ParticleFollowNode; + +} +declare module "awayjs-renderergl/lib/animators/states/ParticleInitialColorState" { + import ColorTransform = require("awayjs-core/lib/core/geom/ColorTransform"); + import Camera = require("awayjs-core/lib/entities/Camera"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import ParticleAnimator = require("awayjs-renderergl/lib/animators/ParticleAnimator"); + import AnimationSubGeometry = require("awayjs-renderergl/lib/animators/data/AnimationSubGeometry"); + import ParticleInitialColorNode = require("awayjs-renderergl/lib/animators/nodes/ParticleInitialColorNode"); + import ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); + /** + * + */ + class ParticleInitialColorState extends ParticleStateBase { + /** @private */ + static MULTIPLIER_INDEX: number; + /** @private */ + static OFFSET_INDEX: number; + private _particleInitialColorNode; + private _usesMultiplier; + private _usesOffset; + private _initialColor; + private _multiplierData; + private _offsetData; + constructor(animator: ParticleAnimator, particleInitialColorNode: ParticleInitialColorNode); + /** + * Defines the initial color transform of the state, when in global mode. + */ + initialColor: ColorTransform; + /** + * @inheritDoc + */ + setRenderState(stage: Stage, renderable: RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: Camera): void; + private updateColorData(); + } + export = ParticleInitialColorState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/ParticleInitialColorNode" { + import ColorTransform = require("awayjs-core/lib/core/geom/ColorTransform"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ParticleAnimationSet = require("awayjs-renderergl/lib/animators/ParticleAnimationSet"); + import ParticleProperties = require("awayjs-renderergl/lib/animators/data/ParticleProperties"); + import ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); + /** + * + */ + class ParticleInitialColorNode extends ParticleNodeBase { + /** @private */ + _iUsesMultiplier: boolean; + /** @private */ + _iUsesOffset: boolean; + /** @private */ + _iInitialColor: ColorTransform; + /** + * Reference for color node properties on a single particle (when in local property mode). + * Expects a ColorTransform object representing the color transform applied to the particle. + */ + static COLOR_INITIAL_COLORTRANSFORM: string; + constructor(mode: number, usesMultiplier?: boolean, usesOffset?: boolean, initialColor?: ColorTransform); + /** + * @inheritDoc + */ + getAGALVertexCode(shaderObject: ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; + /** + * @inheritDoc + */ + _iProcessAnimationSetting(particleAnimationSet: ParticleAnimationSet): void; + /** + * @inheritDoc + */ + _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; + } + export = ParticleInitialColorNode; + +} +declare module "awayjs-renderergl/lib/animators/states/ParticleOrbitState" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import Camera = require("awayjs-core/lib/entities/Camera"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import ParticleAnimator = require("awayjs-renderergl/lib/animators/ParticleAnimator"); + import AnimationSubGeometry = require("awayjs-renderergl/lib/animators/data/AnimationSubGeometry"); + import ParticleOrbitNode = require("awayjs-renderergl/lib/animators/nodes/ParticleOrbitNode"); + import ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); + /** + * ... + */ + class ParticleOrbitState extends ParticleStateBase { + /** @private */ + static ORBIT_INDEX: number; + /** @private */ + static EULERS_INDEX: number; + private _particleOrbitNode; + private _usesEulers; + private _usesCycle; + private _usesPhase; + private _radius; + private _cycleDuration; + private _cyclePhase; + private _eulers; + private _orbitData; + private _eulersMatrix; + /** + * Defines the radius of the orbit when in global mode. Defaults to 100. + */ + radius: number; + /** + * Defines the duration of the orbit in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. + */ + cycleDuration: number; + /** + * Defines the phase of the orbit in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. + */ + cyclePhase: number; + /** + * Defines the euler rotation in degrees, applied to the orientation of the orbit when in global mode. + */ + eulers: Vector3D; + constructor(animator: ParticleAnimator, particleOrbitNode: ParticleOrbitNode); + setRenderState(stage: Stage, renderable: RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: Camera): void; + private updateOrbitData(); + } + export = ParticleOrbitState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/ParticleOrbitNode" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ParticleProperties = require("awayjs-renderergl/lib/animators/data/ParticleProperties"); + import ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); + import ParticleOrbitState = require("awayjs-renderergl/lib/animators/states/ParticleOrbitState"); + /** + * A particle animation node used to control the position of a particle over time around a circular orbit. + */ + class ParticleOrbitNode extends ParticleNodeBase { + /** @private */ + _iUsesEulers: boolean; + /** @private */ + _iUsesCycle: boolean; + /** @private */ + _iUsesPhase: boolean; + /** @private */ + _iRadius: number; + /** @private */ + _iCycleDuration: number; + /** @private */ + _iCyclePhase: number; + /** @private */ + _iEulers: Vector3D; + /** + * Reference for orbit node properties on a single particle (when in local property mode). + * Expects a Vector3D object representing the radius (x), cycle speed (y) and cycle phase (z) of the motion on the particle. + */ + static ORBIT_VECTOR3D: string; + /** + * Creates a new ParticleOrbitNode object. + * + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + * @param [optional] usesEulers Defines whether the node uses the eulers property in the shader to calculate a rotation on the orbit. Defaults to true. + * @param [optional] usesCycle Defines whether the node uses the cycleDuration property in the shader to calculate the period of the orbit independent of particle duration. Defaults to false. + * @param [optional] usesPhase Defines whether the node uses the cyclePhase property in the shader to calculate a starting offset to the cycle rotation of the particle. Defaults to false. + * @param [optional] radius Defines the radius of the orbit when in global mode. Defaults to 100. + * @param [optional] cycleDuration Defines the duration of the orbit in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. + * @param [optional] cyclePhase Defines the phase of the orbit in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. + * @param [optional] eulers Defines the euler rotation in degrees, applied to the orientation of the orbit when in global mode. + */ + constructor(mode: number, usesEulers?: boolean, usesCycle?: boolean, usesPhase?: boolean, radius?: number, cycleDuration?: number, cyclePhase?: number, eulers?: Vector3D); + /** + * @inheritDoc + */ + getAGALVertexCode(shaderObject: ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; + /** + * @inheritDoc + */ + getAnimationState(animator: AnimatorBase): ParticleOrbitState; + /** + * @inheritDoc + */ + _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; + } + export = ParticleOrbitNode; + +} +declare module "awayjs-renderergl/lib/animators/states/ParticleOscillatorState" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import Camera = require("awayjs-core/lib/entities/Camera"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import ParticleAnimator = require("awayjs-renderergl/lib/animators/ParticleAnimator"); + import AnimationSubGeometry = require("awayjs-renderergl/lib/animators/data/AnimationSubGeometry"); + import ParticleOscillatorNode = require("awayjs-renderergl/lib/animators/nodes/ParticleOscillatorNode"); + import ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); + /** + * ... + */ + class ParticleOscillatorState extends ParticleStateBase { + /** @private */ + static OSCILLATOR_INDEX: number; + private _particleOscillatorNode; + private _oscillator; + private _oscillatorData; + /** + * Defines the default oscillator axis (x, y, z) and cycleDuration (w) of the state, used when in global mode. + */ + oscillator: Vector3D; + constructor(animator: ParticleAnimator, particleOscillatorNode: ParticleOscillatorNode); + /** + * @inheritDoc + */ + setRenderState(stage: Stage, renderable: RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: Camera): void; + private updateOscillatorData(); + } + export = ParticleOscillatorState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/ParticleOscillatorNode" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ParticleProperties = require("awayjs-renderergl/lib/animators/data/ParticleProperties"); + import ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); + import ParticleOscillatorState = require("awayjs-renderergl/lib/animators/states/ParticleOscillatorState"); + /** + * A particle animation node used to control the position of a particle over time using simple harmonic motion. + */ + class ParticleOscillatorNode extends ParticleNodeBase { + /** @private */ + _iOscillator: Vector3D; + /** + * Reference for ocsillator node properties on a single particle (when in local property mode). + * Expects a Vector3D object representing the axis (x,y,z) and cycle speed (w) of the motion on the particle. + */ + static OSCILLATOR_VECTOR3D: string; + /** + * Creates a new ParticleOscillatorNode + * + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + * @param [optional] oscillator Defines the default oscillator axis (x, y, z) and cycleDuration (w) of the node, used when in global mode. + */ + constructor(mode: number, oscillator?: Vector3D); + /** + * @inheritDoc + */ + getAGALVertexCode(shaderObject: ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; + /** + * @inheritDoc + */ + getAnimationState(animator: AnimatorBase): ParticleOscillatorState; + /** + * @inheritDoc + */ + _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; + } + export = ParticleOscillatorNode; + +} +declare module "awayjs-renderergl/lib/animators/states/ParticlePositionState" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import Camera = require("awayjs-core/lib/entities/Camera"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import ParticleAnimator = require("awayjs-renderergl/lib/animators/ParticleAnimator"); + import AnimationSubGeometry = require("awayjs-renderergl/lib/animators/data/AnimationSubGeometry"); + import ParticlePositionNode = require("awayjs-renderergl/lib/animators/nodes/ParticlePositionNode"); + import ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); + /** + * ... + * @author ... + */ + class ParticlePositionState extends ParticleStateBase { + /** @private */ + static POSITION_INDEX: number; + private _particlePositionNode; + private _position; + /** + * Defines the position of the particle when in global mode. Defaults to 0,0,0. + */ + position: Vector3D; + /** + * + */ + getPositions(): Vector3D[]; + setPositions(value: Vector3D[]): void; + constructor(animator: ParticleAnimator, particlePositionNode: ParticlePositionNode); + /** + * @inheritDoc + */ + setRenderState(stage: Stage, renderable: RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: Camera): void; + } + export = ParticlePositionState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/ParticlePositionNode" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ParticleProperties = require("awayjs-renderergl/lib/animators/data/ParticleProperties"); + import ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); + import ParticlePositionState = require("awayjs-renderergl/lib/animators/states/ParticlePositionState"); + /** + * A particle animation node used to set the starting position of a particle. + */ + class ParticlePositionNode extends ParticleNodeBase { + /** @private */ + _iPosition: Vector3D; + /** + * Reference for position node properties on a single particle (when in local property mode). + * Expects a Vector3D object representing position of the particle. + */ + static POSITION_VECTOR3D: string; + /** + * Creates a new ParticlePositionNode + * + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + * @param [optional] position Defines the default position of the particle when in global mode. Defaults to 0,0,0. + */ + constructor(mode: number, position?: Vector3D); + /** + * @inheritDoc + */ + getAGALVertexCode(shaderObject: ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; + /** + * @inheritDoc + */ + getAnimationState(animator: AnimatorBase): ParticlePositionState; + /** + * @inheritDoc + */ + _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; + } + export = ParticlePositionNode; + +} +declare module "awayjs-renderergl/lib/animators/states/ParticleRotateToHeadingState" { + import Camera = require("awayjs-core/lib/entities/Camera"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import ParticleAnimator = require("awayjs-renderergl/lib/animators/ParticleAnimator"); + import AnimationSubGeometry = require("awayjs-renderergl/lib/animators/data/AnimationSubGeometry"); + import ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); + import ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); + /** + * ... + */ + class ParticleRotateToHeadingState extends ParticleStateBase { + /** @private */ + static MATRIX_INDEX: number; + private _matrix; + constructor(animator: ParticleAnimator, particleNode: ParticleNodeBase); + setRenderState(stage: Stage, renderable: RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: Camera): void; + } + export = ParticleRotateToHeadingState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/ParticleRotateToHeadingNode" { + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ParticleAnimationSet = require("awayjs-renderergl/lib/animators/ParticleAnimationSet"); + import ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); + import ParticleRotateToHeadingState = require("awayjs-renderergl/lib/animators/states/ParticleRotateToHeadingState"); + /** + * A particle animation node used to control the rotation of a particle to match its heading vector. + */ + class ParticleRotateToHeadingNode extends ParticleNodeBase { + /** + * Creates a new ParticleBillboardNode + */ + constructor(); + /** + * @inheritDoc + */ + getAGALVertexCode(shaderObject: ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; + /** + * @inheritDoc + */ + getAnimationState(animator: AnimatorBase): ParticleRotateToHeadingState; + /** + * @inheritDoc + */ + _iProcessAnimationSetting(particleAnimationSet: ParticleAnimationSet): void; + } + export = ParticleRotateToHeadingNode; + +} +declare module "awayjs-renderergl/lib/animators/states/ParticleRotateToPositionState" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import Camera = require("awayjs-core/lib/entities/Camera"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import ParticleAnimator = require("awayjs-renderergl/lib/animators/ParticleAnimator"); + import AnimationSubGeometry = require("awayjs-renderergl/lib/animators/data/AnimationSubGeometry"); + import ParticleRotateToPositionNode = require("awayjs-renderergl/lib/animators/nodes/ParticleRotateToPositionNode"); + import ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); + /** + * ... + */ + class ParticleRotateToPositionState extends ParticleStateBase { + /** @private */ + static MATRIX_INDEX: number; + /** @private */ + static POSITION_INDEX: number; + private _particleRotateToPositionNode; + private _position; + private _matrix; + private _offset; + /** + * Defines the position of the point the particle will rotate to face when in global mode. Defaults to 0,0,0. + */ + position: Vector3D; + constructor(animator: ParticleAnimator, particleRotateToPositionNode: ParticleRotateToPositionNode); + setRenderState(stage: Stage, renderable: RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: Camera): void; + } + export = ParticleRotateToPositionState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/ParticleRotateToPositionNode" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ParticleProperties = require("awayjs-renderergl/lib/animators/data/ParticleProperties"); + import ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); + import ParticleRotateToPositionState = require("awayjs-renderergl/lib/animators/states/ParticleRotateToPositionState"); + /** + * A particle animation node used to control the rotation of a particle to face to a position + */ + class ParticleRotateToPositionNode extends ParticleNodeBase { + /** @private */ + _iPosition: Vector3D; + /** + * Reference for the position the particle will rotate to face for a single particle (when in local property mode). + * Expects a Vector3D object representing the position that the particle must face. + */ + static POSITION_VECTOR3D: string; + /** + * Creates a new ParticleRotateToPositionNode + */ + constructor(mode: number, position?: Vector3D); + /** + * @inheritDoc + */ + getAGALVertexCode(shaderObject: ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; + /** + * @inheritDoc + */ + getAnimationState(animator: AnimatorBase): ParticleRotateToPositionState; + /** + * @inheritDoc + */ + _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; + } + export = ParticleRotateToPositionNode; + +} +declare module "awayjs-renderergl/lib/animators/states/ParticleRotationalVelocityState" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import Camera = require("awayjs-core/lib/entities/Camera"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import ParticleAnimator = require("awayjs-renderergl/lib/animators/ParticleAnimator"); + import AnimationSubGeometry = require("awayjs-renderergl/lib/animators/data/AnimationSubGeometry"); + import ParticleRotationalVelocityNode = require("awayjs-renderergl/lib/animators/nodes/ParticleRotationalVelocityNode"); + import ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); + /** + * ... + */ + class ParticleRotationalVelocityState extends ParticleStateBase { + /** @private */ + static ROTATIONALVELOCITY_INDEX: number; + private _particleRotationalVelocityNode; + private _rotationalVelocityData; + private _rotationalVelocity; + /** + * Defines the default rotationalVelocity of the state, used when in global mode. + */ + rotationalVelocity: Vector3D; + /** + * + */ + getRotationalVelocities(): Vector3D[]; + setRotationalVelocities(value: Vector3D[]): void; + constructor(animator: ParticleAnimator, particleRotationNode: ParticleRotationalVelocityNode); + /** + * @inheritDoc + */ + setRenderState(stage: Stage, renderable: RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: Camera): void; + private updateRotationalVelocityData(); + } + export = ParticleRotationalVelocityState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/ParticleRotationalVelocityNode" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ParticleProperties = require("awayjs-renderergl/lib/animators/data/ParticleProperties"); + import ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); + import ParticleRotationalVelocityState = require("awayjs-renderergl/lib/animators/states/ParticleRotationalVelocityState"); + /** + * A particle animation node used to set the starting rotational velocity of a particle. + */ + class ParticleRotationalVelocityNode extends ParticleNodeBase { + /** @private */ + _iRotationalVelocity: Vector3D; + /** + * Reference for rotational velocity node properties on a single particle (when in local property mode). + * Expects a Vector3D object representing the rotational velocity around an axis of the particle. + */ + static ROTATIONALVELOCITY_VECTOR3D: string; + /** + * Creates a new ParticleRotationalVelocityNode + * + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + */ + constructor(mode: number, rotationalVelocity?: Vector3D); + /** + * @inheritDoc + */ + getAGALVertexCode(shaderObject: ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; + /** + * @inheritDoc + */ + getAnimationState(animator: AnimatorBase): ParticleRotationalVelocityState; + /** + * @inheritDoc + */ + _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; + } + export = ParticleRotationalVelocityNode; + +} +declare module "awayjs-renderergl/lib/animators/states/ParticleScaleState" { + import Camera = require("awayjs-core/lib/entities/Camera"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import ParticleAnimator = require("awayjs-renderergl/lib/animators/ParticleAnimator"); + import AnimationSubGeometry = require("awayjs-renderergl/lib/animators/data/AnimationSubGeometry"); + import ParticleScaleNode = require("awayjs-renderergl/lib/animators/nodes/ParticleScaleNode"); + import ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); + /** + * ... + */ + class ParticleScaleState extends ParticleStateBase { + /** @private */ + static SCALE_INDEX: number; + private _particleScaleNode; + private _usesCycle; + private _usesPhase; + private _minScale; + private _maxScale; + private _cycleDuration; + private _cyclePhase; + private _scaleData; + /** + * Defines the end scale of the state, when in global mode. Defaults to 1. + */ + minScale: number; + /** + * Defines the end scale of the state, when in global mode. Defaults to 1. + */ + maxScale: number; + /** + * Defines the duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. + */ + cycleDuration: number; + /** + * Defines the phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. + */ + cyclePhase: number; + constructor(animator: ParticleAnimator, particleScaleNode: ParticleScaleNode); + setRenderState(stage: Stage, renderable: RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: Camera): void; + private updateScaleData(); + } + export = ParticleScaleState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/ParticleScaleNode" { + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ParticleProperties = require("awayjs-renderergl/lib/animators/data/ParticleProperties"); + import ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); + import ParticleScaleState = require("awayjs-renderergl/lib/animators/states/ParticleScaleState"); + /** + * A particle animation node used to control the scale variation of a particle over time. + */ + class ParticleScaleNode extends ParticleNodeBase { + /** @private */ + _iUsesCycle: boolean; + /** @private */ + _iUsesPhase: boolean; + /** @private */ + _iMinScale: number; + /** @private */ + _iMaxScale: number; + /** @private */ + _iCycleDuration: number; + /** @private */ + _iCyclePhase: number; + /** + * Reference for scale node properties on a single particle (when in local property mode). + * Expects a Vector3D representing the min scale (x), max scale(y), optional cycle speed (z) and phase offset (w) applied to the particle. + */ + static SCALE_VECTOR3D: string; + /** + * Creates a new ParticleScaleNode + * + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + * @param [optional] usesCycle Defines whether the node uses the cycleDuration property in the shader to calculate the period of animation independent of particle duration. Defaults to false. + * @param [optional] usesPhase Defines whether the node uses the cyclePhase property in the shader to calculate a starting offset to the animation cycle. Defaults to false. + * @param [optional] minScale Defines the default min scale transform of the node, when in global mode. Defaults to 1. + * @param [optional] maxScale Defines the default max color transform of the node, when in global mode. Defaults to 1. + * @param [optional] cycleDuration Defines the default duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. + * @param [optional] cyclePhase Defines the default phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. + */ + constructor(mode: number, usesCycle: boolean, usesPhase: boolean, minScale?: number, maxScale?: number, cycleDuration?: number, cyclePhase?: number); + /** + * @inheritDoc + */ + getAGALVertexCode(shaderObject: ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; + /** + * @inheritDoc + */ + getAnimationState(animator: AnimatorBase): ParticleScaleState; + /** + * @inheritDoc + */ + _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; + } + export = ParticleScaleNode; + +} +declare module "awayjs-renderergl/lib/animators/states/ParticleSegmentedColorState" { + import ColorTransform = require("awayjs-core/lib/core/geom/ColorTransform"); + import Camera = require("awayjs-core/lib/entities/Camera"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import ParticleAnimator = require("awayjs-renderergl/lib/animators/ParticleAnimator"); + import AnimationSubGeometry = require("awayjs-renderergl/lib/animators/data/AnimationSubGeometry"); + import ColorSegmentPoint = require("awayjs-renderergl/lib/animators/data/ColorSegmentPoint"); + import ParticleSegmentedColorNode = require("awayjs-renderergl/lib/animators/nodes/ParticleSegmentedColorNode"); + import ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); + /** + * + */ + class ParticleSegmentedColorState extends ParticleStateBase { + /** @private */ + static START_MULTIPLIER_INDEX: number; + /** @private */ + static START_OFFSET_INDEX: number; + /** @private */ + static TIME_DATA_INDEX: number; + private _usesMultiplier; + private _usesOffset; + private _startColor; + private _endColor; + private _segmentPoints; + private _numSegmentPoint; + private _timeLifeData; + private _multiplierData; + private _offsetData; + /** + * Defines the start color transform of the state, when in global mode. + */ + startColor: ColorTransform; + /** + * Defines the end color transform of the state, when in global mode. + */ + endColor: ColorTransform; + /** + * Defines the number of segments. + */ + numSegmentPoint: number; + /** + * Defines the key points of color + */ + segmentPoints: ColorSegmentPoint[]; + usesMultiplier: boolean; + usesOffset: boolean; + constructor(animator: ParticleAnimator, particleSegmentedColorNode: ParticleSegmentedColorNode); + setRenderState(stage: Stage, renderable: RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: Camera): void; + private updateColorData(); + } + export = ParticleSegmentedColorState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/ParticleSegmentedColorNode" { + import ColorTransform = require("awayjs-core/lib/core/geom/ColorTransform"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ParticleAnimationSet = require("awayjs-renderergl/lib/animators/ParticleAnimationSet"); + import ColorSegmentPoint = require("awayjs-renderergl/lib/animators/data/ColorSegmentPoint"); + import ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); + /** + * + */ + class ParticleSegmentedColorNode extends ParticleNodeBase { + /** @private */ + _iUsesMultiplier: boolean; + /** @private */ + _iUsesOffset: boolean; + /** @private */ + _iStartColor: ColorTransform; + /** @private */ + _iEndColor: ColorTransform; + /** @private */ + _iNumSegmentPoint: number; + /** @private */ + _iSegmentPoints: ColorSegmentPoint[]; + constructor(usesMultiplier: boolean, usesOffset: boolean, numSegmentPoint: number, startColor: ColorTransform, endColor: ColorTransform, segmentPoints: ColorSegmentPoint[]); + /** + * @inheritDoc + */ + _iProcessAnimationSetting(particleAnimationSet: ParticleAnimationSet): void; + /** + * @inheritDoc + */ + getAGALVertexCode(shaderObject: ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; + } + export = ParticleSegmentedColorNode; + +} +declare module "awayjs-renderergl/lib/animators/states/ParticleSpriteSheetState" { + import Camera = require("awayjs-core/lib/entities/Camera"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import ParticleAnimator = require("awayjs-renderergl/lib/animators/ParticleAnimator"); + import AnimationSubGeometry = require("awayjs-renderergl/lib/animators/data/AnimationSubGeometry"); + import ParticleSpriteSheetNode = require("awayjs-renderergl/lib/animators/nodes/ParticleSpriteSheetNode"); + import ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); + /** + * ... + */ + class ParticleSpriteSheetState extends ParticleStateBase { + /** @private */ + static UV_INDEX_0: number; + /** @private */ + static UV_INDEX_1: number; + private _particleSpriteSheetNode; + private _usesCycle; + private _usesPhase; + private _totalFrames; + private _numColumns; + private _numRows; + private _cycleDuration; + private _cyclePhase; + private _spriteSheetData; + /** + * Defines the cycle phase, when in global mode. Defaults to zero. + */ + cyclePhase: number; + /** + * Defines the cycle duration in seconds, when in global mode. Defaults to 1. + */ + cycleDuration: number; + constructor(animator: ParticleAnimator, particleSpriteSheetNode: ParticleSpriteSheetNode); + setRenderState(stage: Stage, renderable: RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: Camera): void; + private updateSpriteSheetData(); + } + export = ParticleSpriteSheetState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/ParticleSpriteSheetNode" { + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ParticleAnimationSet = require("awayjs-renderergl/lib/animators/ParticleAnimationSet"); + import ParticleProperties = require("awayjs-renderergl/lib/animators/data/ParticleProperties"); + import ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); + import ParticleSpriteSheetState = require("awayjs-renderergl/lib/animators/states/ParticleSpriteSheetState"); + /** + * A particle animation node used when a spritesheet texture is required to animate the particle. + * NB: to enable use of this node, the repeat property on the material has to be set to true. + */ + class ParticleSpriteSheetNode extends ParticleNodeBase { + /** @private */ + _iUsesCycle: boolean; + /** @private */ + _iUsesPhase: boolean; + /** @private */ + _iTotalFrames: number; + /** @private */ + _iNumColumns: number; + /** @private */ + _iNumRows: number; + /** @private */ + _iCycleDuration: number; + /** @private */ + _iCyclePhase: number; + /** + * Reference for spritesheet node properties on a single particle (when in local property mode). + * Expects a Vector3D representing the cycleDuration (x), optional phaseTime (y). + */ + static UV_VECTOR3D: string; + /** + * Defines the number of columns in the spritesheet, when in global mode. Defaults to 1. Read only. + */ + numColumns: number; + /** + * Defines the number of rows in the spritesheet, when in global mode. Defaults to 1. Read only. + */ + numRows: number; + /** + * Defines the total number of frames used by the spritesheet, when in global mode. Defaults to the number defined by numColumns and numRows. Read only. + */ + totalFrames: number; + /** + * Creates a new ParticleSpriteSheetNode + * + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + * @param [optional] numColumns Defines the number of columns in the spritesheet, when in global mode. Defaults to 1. + * @param [optional] numRows Defines the number of rows in the spritesheet, when in global mode. Defaults to 1. + * @param [optional] cycleDuration Defines the default cycle duration in seconds, when in global mode. Defaults to 1. + * @param [optional] cyclePhase Defines the default cycle phase, when in global mode. Defaults to 0. + * @param [optional] totalFrames Defines the total number of frames used by the spritesheet, when in global mode. Defaults to the number defined by numColumns and numRows. + * @param [optional] looping Defines whether the spritesheet animation is set to loop indefinitely. Defaults to true. + */ + constructor(mode: number, usesCycle: boolean, usesPhase: boolean, numColumns?: number, numRows?: number, cycleDuration?: number, cyclePhase?: number, totalFrames?: number); + /** + * @inheritDoc + */ + getAGALUVCode(shaderObject: ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; + /** + * @inheritDoc + */ + getAnimationState(animator: AnimatorBase): ParticleSpriteSheetState; + /** + * @inheritDoc + */ + _iProcessAnimationSetting(particleAnimationSet: ParticleAnimationSet): void; + /** + * @inheritDoc + */ + _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; + } + export = ParticleSpriteSheetNode; + +} +declare module "awayjs-renderergl/lib/animators/states/ParticleUVState" { + import Camera = require("awayjs-core/lib/entities/Camera"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import ParticleAnimator = require("awayjs-renderergl/lib/animators/ParticleAnimator"); + import AnimationSubGeometry = require("awayjs-renderergl/lib/animators/data/AnimationSubGeometry"); + import ParticleUVNode = require("awayjs-renderergl/lib/animators/nodes/ParticleUVNode"); + import ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); + /** + * ... + */ + class ParticleUVState extends ParticleStateBase { + /** @private */ + static UV_INDEX: number; + private _particleUVNode; + constructor(animator: ParticleAnimator, particleUVNode: ParticleUVNode); + setRenderState(stage: Stage, renderable: RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: Camera): void; + } + export = ParticleUVState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/ParticleUVNode" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ParticleAnimationSet = require("awayjs-renderergl/lib/animators/ParticleAnimationSet"); + import ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); + import ParticleUVState = require("awayjs-renderergl/lib/animators/states/ParticleUVState"); + /** + * A particle animation node used to control the UV offset and scale of a particle over time. + */ + class ParticleUVNode extends ParticleNodeBase { + /** @private */ + _iUvData: Vector3D; + /** + * + */ + static U_AXIS: string; + /** + * + */ + static V_AXIS: string; + private _cycle; + private _scale; + private _axis; + /** + * Creates a new ParticleTimeNode + * + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + * @param [optional] cycle Defines whether the time track is in loop mode. Defaults to false. + * @param [optional] scale Defines whether the time track is in loop mode. Defaults to false. + * @param [optional] axis Defines whether the time track is in loop mode. Defaults to false. + */ + constructor(mode: number, cycle?: number, scale?: number, axis?: string); + /** + * + */ + cycle: number; + /** + * + */ + scale: number; + /** + * + */ + axis: string; + /** + * @inheritDoc + */ + getAGALUVCode(shaderObject: ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; + /** + * @inheritDoc + */ + getAnimationState(animator: AnimatorBase): ParticleUVState; + private updateUVData(); + /** + * @inheritDoc + */ + _iProcessAnimationSetting(particleAnimationSet: ParticleAnimationSet): void; + } + export = ParticleUVNode; + +} +declare module "awayjs-renderergl/lib/animators/states/ParticleVelocityState" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import Camera = require("awayjs-core/lib/entities/Camera"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import ParticleAnimator = require("awayjs-renderergl/lib/animators/ParticleAnimator"); + import AnimationSubGeometry = require("awayjs-renderergl/lib/animators/data/AnimationSubGeometry"); + import ParticleVelocityNode = require("awayjs-renderergl/lib/animators/nodes/ParticleVelocityNode"); + import ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); + /** + * ... + */ + class ParticleVelocityState extends ParticleStateBase { + /** @private */ + static VELOCITY_INDEX: number; + private _particleVelocityNode; + private _velocity; + /** + * Defines the default velocity vector of the state, used when in global mode. + */ + velocity: Vector3D; + /** + * + */ + getVelocities(): Vector3D[]; + setVelocities(value: Vector3D[]): void; + constructor(animator: ParticleAnimator, particleVelocityNode: ParticleVelocityNode); + setRenderState(stage: Stage, renderable: RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: Camera): void; + } + export = ParticleVelocityState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/ParticleVelocityNode" { + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import AnimationRegisterCache = require("awayjs-stagegl/lib/animators/data/AnimationRegisterCache"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ParticleProperties = require("awayjs-renderergl/lib/animators/data/ParticleProperties"); + import ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); + import ParticleVelocityState = require("awayjs-renderergl/lib/animators/states/ParticleVelocityState"); + /** + * A particle animation node used to set the starting velocity of a particle. + */ + class ParticleVelocityNode extends ParticleNodeBase { + /** @private */ + _iVelocity: Vector3D; + /** + * Reference for velocity node properties on a single particle (when in local property mode). + * Expects a Vector3D object representing the direction of movement on the particle. + */ + static VELOCITY_VECTOR3D: string; + /** + * Creates a new ParticleVelocityNode + * + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + * @param [optional] velocity Defines the default velocity vector of the node, used when in global mode. + */ + constructor(mode: number, velocity?: Vector3D); + /** + * @inheritDoc + */ + getAGALVertexCode(shaderObject: ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; + /** + * @inheritDoc + */ + getAnimationState(animator: AnimatorBase): ParticleVelocityState; + /** + * @inheritDoc + */ + _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; + } + export = ParticleVelocityNode; + +} +declare module "awayjs-renderergl/lib/animators/states/SkeletonBinaryLERPState" { + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import Skeleton = require("awayjs-renderergl/lib/animators/data/Skeleton"); + import SkeletonPose = require("awayjs-renderergl/lib/animators/data/SkeletonPose"); + import SkeletonBinaryLERPNode = require("awayjs-renderergl/lib/animators/nodes/SkeletonBinaryLERPNode"); + import AnimationStateBase = require("awayjs-renderergl/lib/animators/states/AnimationStateBase"); + import ISkeletonAnimationState = require("awayjs-renderergl/lib/animators/states/ISkeletonAnimationState"); + /** + * + */ + class SkeletonBinaryLERPState extends AnimationStateBase implements ISkeletonAnimationState { + private _blendWeight; + private _skeletonAnimationNode; + private _skeletonPose; + private _skeletonPoseDirty; + private _inputA; + private _inputB; + /** + * Defines a fractional value between 0 and 1 representing the blending ratio between inputA (0) and inputB (1), + * used to produce the skeleton pose output. + * + * @see inputA + * @see inputB + */ + blendWeight: number; + constructor(animator: AnimatorBase, skeletonAnimationNode: SkeletonBinaryLERPNode); + /** + * @inheritDoc + */ + phase(value: number): void; + /** + * @inheritDoc + */ + _pUpdateTime(time: number): void; + /** + * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. + */ + getSkeletonPose(skeleton: Skeleton): SkeletonPose; + /** + * @inheritDoc + */ + _pUpdatePositionDelta(): void; + /** + * Updates the output skeleton pose of the node based on the blendWeight value between input nodes. + * + * @param skeleton The skeleton used by the animator requesting the ouput pose. + */ + private updateSkeletonPose(skeleton); + } + export = SkeletonBinaryLERPState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/SkeletonBinaryLERPNode" { + import AnimationNodeBase = require("awayjs-core/lib/animators/nodes/AnimationNodeBase"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import SkeletonBinaryLERPState = require("awayjs-renderergl/lib/animators/states/SkeletonBinaryLERPState"); + /** + * A skeleton animation node that uses two animation node inputs to blend a lineraly interpolated output of a skeleton pose. + */ + class SkeletonBinaryLERPNode extends AnimationNodeBase { + /** + * Defines input node A to use for the blended output. + */ + inputA: AnimationNodeBase; + /** + * Defines input node B to use for the blended output. + */ + inputB: AnimationNodeBase; + /** + * Creates a new SkeletonBinaryLERPNode object. + */ + constructor(); + /** + * @inheritDoc + */ + getAnimationState(animator: AnimatorBase): SkeletonBinaryLERPState; + } + export = SkeletonBinaryLERPNode; + +} +declare module "awayjs-renderergl/lib/animators/states/SkeletonDifferenceState" { + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import Skeleton = require("awayjs-renderergl/lib/animators/data/Skeleton"); + import SkeletonPose = require("awayjs-renderergl/lib/animators/data/SkeletonPose"); + import SkeletonDifferenceNode = require("awayjs-renderergl/lib/animators/nodes/SkeletonDifferenceNode"); + import AnimationStateBase = require("awayjs-renderergl/lib/animators/states/AnimationStateBase"); + import ISkeletonAnimationState = require("awayjs-renderergl/lib/animators/states/ISkeletonAnimationState"); + /** + * + */ + class SkeletonDifferenceState extends AnimationStateBase implements ISkeletonAnimationState { + private _blendWeight; + private static _tempQuat; + private _skeletonAnimationNode; + private _skeletonPose; + private _skeletonPoseDirty; + private _baseInput; + private _differenceInput; + /** + * Defines a fractional value between 0 and 1 representing the blending ratio between the base input (0) and difference input (1), + * used to produce the skeleton pose output. + * + * @see #baseInput + * @see #differenceInput + */ + blendWeight: number; + constructor(animator: AnimatorBase, skeletonAnimationNode: SkeletonDifferenceNode); + /** + * @inheritDoc + */ + phase(value: number): void; + /** + * @inheritDoc + */ + _pUpdateTime(time: number): void; + /** + * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. + */ + getSkeletonPose(skeleton: Skeleton): SkeletonPose; + /** + * @inheritDoc + */ + _pUpdatePositionDelta(): void; + /** + * Updates the output skeleton pose of the node based on the blendWeight value between base input and difference input nodes. + * + * @param skeleton The skeleton used by the animator requesting the ouput pose. + */ + private updateSkeletonPose(skeleton); + } + export = SkeletonDifferenceState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/SkeletonDifferenceNode" { + import AnimationNodeBase = require("awayjs-core/lib/animators/nodes/AnimationNodeBase"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import SkeletonDifferenceState = require("awayjs-renderergl/lib/animators/states/SkeletonDifferenceState"); + /** + * A skeleton animation node that uses a difference input pose with a base input pose to blend a linearly interpolated output of a skeleton pose. + */ + class SkeletonDifferenceNode extends AnimationNodeBase { + /** + * Defines a base input node to use for the blended output. + */ + baseInput: AnimationNodeBase; + /** + * Defines a difference input node to use for the blended output. + */ + differenceInput: AnimationNodeBase; + /** + * Creates a new SkeletonAdditiveNode object. + */ + constructor(); + /** + * @inheritDoc + */ + getAnimationState(animator: AnimatorBase): SkeletonDifferenceState; + } + export = SkeletonDifferenceNode; + +} +declare module "awayjs-renderergl/lib/animators/states/SkeletonDirectionalState" { + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import Skeleton = require("awayjs-renderergl/lib/animators/data/Skeleton"); + import SkeletonPose = require("awayjs-renderergl/lib/animators/data/SkeletonPose"); + import SkeletonDirectionalNode = require("awayjs-renderergl/lib/animators/nodes/SkeletonDirectionalNode"); + import AnimationStateBase = require("awayjs-renderergl/lib/animators/states/AnimationStateBase"); + import ISkeletonAnimationState = require("awayjs-renderergl/lib/animators/states/ISkeletonAnimationState"); + /** + * + */ + class SkeletonDirectionalState extends AnimationStateBase implements ISkeletonAnimationState { + private _skeletonAnimationNode; + private _skeletonPose; + private _skeletonPoseDirty; + private _inputA; + private _inputB; + private _blendWeight; + private _direction; + private _blendDirty; + private _forward; + private _backward; + private _left; + private _right; + /** + * Defines the direction in degrees of the aniamtion between the forwards (0), right(90) backwards (180) and left(270) input nodes, + * used to produce the skeleton pose output. + */ + direction: number; + constructor(animator: AnimatorBase, skeletonAnimationNode: SkeletonDirectionalNode); + /** + * @inheritDoc + */ + phase(value: number): void; + /** + * @inheritDoc + */ + _pUdateTime(time: number): void; + /** + * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. + */ + getSkeletonPose(skeleton: Skeleton): SkeletonPose; + /** + * @inheritDoc + */ + _pUpdatePositionDelta(): void; + /** + * Updates the output skeleton pose of the node based on the direction value between forward, backwards, left and right input nodes. + * + * @param skeleton The skeleton used by the animator requesting the ouput pose. + */ + private updateSkeletonPose(skeleton); + /** + * Updates the blend value for the animation output based on the direction value between forward, backwards, left and right input nodes. + * + * @private + */ + private updateBlend(); + } + export = SkeletonDirectionalState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/SkeletonDirectionalNode" { + import AnimationNodeBase = require("awayjs-core/lib/animators/nodes/AnimationNodeBase"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import SkeletonDirectionalState = require("awayjs-renderergl/lib/animators/states/SkeletonDirectionalState"); + /** + * A skeleton animation node that uses four directional input poses with an input direction to blend a linearly interpolated output of a skeleton pose. + */ + class SkeletonDirectionalNode extends AnimationNodeBase { + /** + * Defines the forward configured input node to use for the blended output. + */ + forward: AnimationNodeBase; + /** + * Defines the backwards configured input node to use for the blended output. + */ + backward: AnimationNodeBase; + /** + * Defines the left configured input node to use for the blended output. + */ + left: AnimationNodeBase; + /** + * Defines the right configured input node to use for the blended output. + */ + right: AnimationNodeBase; + constructor(); + /** + * @inheritDoc + */ + getAnimationState(animator: AnimatorBase): SkeletonDirectionalState; + } + export = SkeletonDirectionalNode; + +} +declare module "awayjs-renderergl/lib/animators/states/SkeletonNaryLERPState" { + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import Skeleton = require("awayjs-renderergl/lib/animators/data/Skeleton"); + import SkeletonPose = require("awayjs-renderergl/lib/animators/data/SkeletonPose"); + import SkeletonNaryLERPNode = require("awayjs-renderergl/lib/animators/nodes/SkeletonNaryLERPNode"); + import AnimationStateBase = require("awayjs-renderergl/lib/animators/states/AnimationStateBase"); + import ISkeletonAnimationState = require("awayjs-renderergl/lib/animators/states/ISkeletonAnimationState"); + /** + * + */ + class SkeletonNaryLERPState extends AnimationStateBase implements ISkeletonAnimationState { + private _skeletonAnimationNode; + private _skeletonPose; + private _skeletonPoseDirty; + private _blendWeights; + private _inputs; + constructor(animator: AnimatorBase, skeletonAnimationNode: SkeletonNaryLERPNode); + /** + * @inheritDoc + */ + phase(value: number): void; + /** + * @inheritDoc + */ + _pUdateTime(time: number): void; + /** + * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. + */ + getSkeletonPose(skeleton: Skeleton): SkeletonPose; + /** + * Returns the blend weight of the skeleton aniamtion node that resides at the given input index. + * + * @param index The input index for which the skeleton animation node blend weight is requested. + */ + getBlendWeightAt(index: number): number; + /** + * Sets the blend weight of the skeleton aniamtion node that resides at the given input index. + * + * @param index The input index on which the skeleton animation node blend weight is to be set. + * @param blendWeight The blend weight value to use for the given skeleton animation node index. + */ + setBlendWeightAt(index: number, blendWeight: number): void; + /** + * @inheritDoc + */ + _pUpdatePositionDelta(): void; + /** + * Updates the output skeleton pose of the node based on the blend weight values given to the input nodes. + * + * @param skeleton The skeleton used by the animator requesting the ouput pose. + */ + private updateSkeletonPose(skeleton); + } + export = SkeletonNaryLERPState; + +} +declare module "awayjs-renderergl/lib/animators/nodes/SkeletonNaryLERPNode" { + import AnimationNodeBase = require("awayjs-core/lib/animators/nodes/AnimationNodeBase"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import SkeletonNaryLERPState = require("awayjs-renderergl/lib/animators/states/SkeletonNaryLERPState"); + /** + * A skeleton animation node that uses an n-dimensional array of animation node inputs to blend a lineraly interpolated output of a skeleton pose. + */ + class SkeletonNaryLERPNode extends AnimationNodeBase { + _iInputs: AnimationNodeBase[]; + private _numInputs; + numInputs: number; + /** + * Creates a new SkeletonNaryLERPNode object. + */ + constructor(); + /** + * Returns an integer representing the input index of the given skeleton animation node. + * + * @param input The skeleton animation node for with the input index is requested. + */ + getInputIndex(input: AnimationNodeBase): number; + /** + * Returns the skeleton animation node object that resides at the given input index. + * + * @param index The input index for which the skeleton animation node is requested. + */ + getInputAt(index: number): AnimationNodeBase; + /** + * Adds a new skeleton animation node input to the animation node. + */ + addInput(input: AnimationNodeBase): void; + /** + * @inheritDoc + */ + getAnimationState(animator: AnimatorBase): SkeletonNaryLERPState; + } + export = SkeletonNaryLERPNode; + +} +declare module "awayjs-renderergl/lib/animators/transitions/CrossfadeTransitionState" { + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import SkeletonBinaryLERPState = require("awayjs-renderergl/lib/animators/states/SkeletonBinaryLERPState"); + import CrossfadeTransitionNode = require("awayjs-renderergl/lib/animators/transitions/CrossfadeTransitionNode"); + /** + * + */ + class CrossfadeTransitionState extends SkeletonBinaryLERPState { + private _crossfadeTransitionNode; + private _animationStateTransitionComplete; + constructor(animator: AnimatorBase, skeletonAnimationNode: CrossfadeTransitionNode); + /** + * @inheritDoc + */ + _pUpdateTime(time: number): void; + } + export = CrossfadeTransitionState; + +} +declare module "awayjs-renderergl/lib/animators/transitions/CrossfadeTransitionNode" { + import SkeletonBinaryLERPNode = require("awayjs-renderergl/lib/animators/nodes/SkeletonBinaryLERPNode"); + /** + * A skeleton animation node that uses two animation node inputs to blend a lineraly interpolated output of a skeleton pose. + */ + class CrossfadeTransitionNode extends SkeletonBinaryLERPNode { + blendSpeed: number; + startBlend: number; + /** + * Creates a new CrossfadeTransitionNode object. + */ + constructor(); + } + export = CrossfadeTransitionNode; + +} +declare module "awayjs-renderergl/lib/animators/transitions/CrossfadeTransition" { + import AnimationNodeBase = require("awayjs-core/lib/animators/nodes/AnimationNodeBase"); + import AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); + import IAnimationTransition = require("awayjs-renderergl/lib/animators/transitions/IAnimationTransition"); + /** + * + */ + class CrossfadeTransition implements IAnimationTransition { + blendSpeed: number; + constructor(blendSpeed: number); + getAnimationNode(animator: AnimatorBase, startNode: AnimationNodeBase, endNode: AnimationNodeBase, startBlend: number): AnimationNodeBase; + } + export = CrossfadeTransition; + +} +declare module "awayjs-renderergl/lib/core/pick/PickingColliderBase" { + import PickingCollisionVO = require("awayjs-core/lib/core/pick/PickingCollisionVO"); + import Point = require("awayjs-core/lib/core/geom/Point"); + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import Billboard = require("awayjs-core/lib/entities/Billboard"); + import Mesh = require("awayjs-core/lib/entities/Mesh"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + /** + * An abstract base class for all picking collider classes. It should not be instantiated directly. + * + * @class away.pick.PickingColliderBase + */ + class PickingColliderBase { + private _billboardRenderablePool; + private _subMeshRenderablePool; + rayPosition: Vector3D; + rayDirection: Vector3D; + constructor(); + _pPetCollisionNormal(indexData: number[], vertexData: number[], triangleIndex: number): Vector3D; + _pGetCollisionUV(indexData: number[], uvData: number[], triangleIndex: number, v: number, w: number, u: number, uvOffset: number, uvStride: number): Point; + /** + * @inheritDoc + */ + _pTestRenderableCollision(renderable: RenderableBase, pickingCollisionVO: PickingCollisionVO, shortestCollisionDistance: number): boolean; + /** + * @inheritDoc + */ + setLocalRay(localPosition: Vector3D, localDirection: Vector3D): void; + /** + * Tests a Billboard object for a collision with the picking ray. + * + * @param billboard The billboard instance to be tested. + * @param pickingCollisionVO The collision object used to store the collision results + * @param shortestCollisionDistance The current value of the shortest distance to a detected collision along the ray. + * @param findClosest + */ + testBillboardCollision(billboard: Billboard, pickingCollisionVO: PickingCollisionVO, shortestCollisionDistance: number): boolean; + /** + * Tests a Mesh object for a collision with the picking ray. + * + * @param mesh The mesh instance to be tested. + * @param pickingCollisionVO The collision object used to store the collision results + * @param shortestCollisionDistance The current value of the shortest distance to a detected collision along the ray. + * @param findClosest + */ + testMeshCollision(mesh: Mesh, pickingCollisionVO: PickingCollisionVO, shortestCollisionDistance: number, findClosest: boolean): boolean; + } + export = PickingColliderBase; + +} +declare module "awayjs-renderergl/lib/core/pick/JSPickingCollider" { + import PickingCollisionVO = require("awayjs-core/lib/core/pick/PickingCollisionVO"); + import IPickingCollider = require("awayjs-core/lib/core/pick/IPickingCollider"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import PickingColliderBase = require("awayjs-renderergl/lib/core/pick/PickingColliderBase"); + /** + * Pure JS picking collider for display objects. Used with the RaycastPicker picking object. + * + * @see away.base.DisplayObject#pickingCollider + * @see away.pick.RaycastPicker + * + * @class away.pick.JSPickingCollider + */ + class JSPickingCollider extends PickingColliderBase implements IPickingCollider { + private _findClosestCollision; + /** + * Creates a new JSPickingCollider object. + * + * @param findClosestCollision Determines whether the picking collider searches for the closest collision along the ray. Defaults to false. + */ + constructor(findClosestCollision?: boolean); + /** + * @inheritDoc + */ + _pTestRenderableCollision(renderable: RenderableBase, pickingCollisionVO: PickingCollisionVO, shortestCollisionDistance: number): boolean; + } + export = JSPickingCollider; + +} +declare module "awayjs-renderergl/lib/core/pick/ShaderPicker" { + import Scene = require("awayjs-core/lib/containers/Scene"); + import View = require("awayjs-core/lib/containers/View"); + import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); + import IPicker = require("awayjs-core/lib/core/pick/IPicker"); + import PickingCollisionVO = require("awayjs-core/lib/core/pick/PickingCollisionVO"); + import EntityCollector = require("awayjs-core/lib/core/traverse/EntityCollector"); + import ITextureBase = require("awayjs-stagegl/lib/core/stagegl/ITextureBase"); + /** + * Picks a 3d object from a view or scene by performing a separate render pass on the scene around the area being picked using key color values, + * then reading back the color value of the pixel in the render representing the picking ray. Requires multiple passes and readbacks for retriving details + * on an entity that has its shaderPickingDetails property set to true. + * + * A read-back operation from any GPU is not a very efficient process, and the amount of processing used can vary significantly between different hardware. + * + * @see away.entities.Entity#shaderPickingDetails + * + * @class away.pick.ShaderPicker + */ + class ShaderPicker implements IPicker { + private _opaqueRenderableHead; + private _blendedRenderableHead; + private _stage; + private _context; + private _onlyMouseEnabled; + private _objectProgram; + private _triangleProgram; + private _bitmapData; + private _viewportData; + private _boundOffsetScale; + private _id; + private _interactives; + private _interactiveId; + private _hitColor; + private _projX; + private _projY; + private _hitRenderable; + private _hitEntity; + private _localHitPosition; + private _hitUV; + private _faceIndex; + private _subGeometryIndex; + private _localHitNormal; + private _rayPos; + private _rayDir; + private _potentialFound; + private static MOUSE_SCISSOR_RECT; + private _shaderPickingDetails; + /** + * @inheritDoc + */ + onlyMouseEnabled: boolean; + /** + * Creates a new ShaderPicker object. + * + * @param shaderPickingDetails Determines whether the picker includes a second pass to calculate extra + * properties such as uv and normal coordinates. + */ + constructor(shaderPickingDetails?: boolean); + /** + * @inheritDoc + */ + getViewCollision(x: number, y: number, view: View): PickingCollisionVO; + /** + * @inheritDoc + */ + getSceneCollision(position: Vector3D, direction: Vector3D, scene: Scene): PickingCollisionVO; + /** + * @inheritDoc + */ + pDraw(entityCollector: EntityCollector, target: ITextureBase): void; + /** + * Draw a list of renderables. + * @param renderables The renderables to draw. + * @param camera The camera for which to render. + */ + private drawRenderables(renderable, camera); + private updateRay(camera); + /** + * Creates the Program that color-codes objects. + */ + private initObjectProgram(); + /** + * Creates the Program that renders positions. + */ + private initTriangleProgram(); + /** + * Gets more detailed information about the hir position, if required. + * @param camera The camera used to view the hit object. + */ + private getHitDetails(camera); + /** + * Finds a first-guess approximate position about the hit position. + * + * @param camera The camera used to view the hit object. + */ + private getApproximatePosition(camera); + /** + * Use the approximate position info to find the face under the mouse position from which we can derive the precise + * ray-face intersection point, then use barycentric coordinates to figure out the uv coordinates, etc. + * @param camera The camera used to view the hit object. + */ + private getPreciseDetails(camera); + /** + * Finds the precise hit position by unprojecting the screen coordinate back unto the hit face's plane and + * calculating the intersection point. + * @param camera The camera used to render the object. + * @param invSceneTransform The inverse scene transformation of the hit object. + * @param nx The x-coordinate of the face's plane normal. + * @param ny The y-coordinate of the face plane normal. + * @param nz The z-coordinate of the face plane normal. + * @param px The x-coordinate of a point on the face's plane (ie a face vertex) + * @param py The y-coordinate of a point on the face's plane (ie a face vertex) + * @param pz The z-coordinate of a point on the face's plane (ie a face vertex) + */ + private getPrecisePosition(invSceneTransform, nx, ny, nz, px, py, pz); + dispose(): void; + } + export = ShaderPicker; + +} +declare module "awayjs-renderergl/lib/materials/passes/SingleObjectDepthPass" { + import Matrix3D = require("awayjs-core/lib/core/geom/Matrix3D"); + import Camera = require("awayjs-core/lib/entities/Camera"); + import RenderTexture = require("awayjs-core/lib/textures/RenderTexture"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import MaterialPassData = require("awayjs-stagegl/lib/core/pool/MaterialPassData"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import MaterialPassBase = require("awayjs-stagegl/lib/materials/passes/MaterialPassBase"); + /** + * The SingleObjectDepthPass provides a material pass that renders a single object to a depth map from the point + * of view from a light. + */ + class SingleObjectDepthPass extends MaterialPassBase { + private _textures; + private _projections; + private _textureSize; + private _polyOffset; + private _enc; + private _projectionTexturesInvalid; + /** + * The size of the depth map texture to render to. + */ + textureSize: number; + /** + * The amount by which the rendered object will be inflated, to prevent depth map rounding errors. + */ + polyOffset: number; + /** + * Creates a new SingleObjectDepthPass object. + */ + constructor(); + /** + * @inheritDoc + */ + dispose(): void; + /** + * Updates the projection textures used to contain the depth renders. + */ + private updateProjectionTextures(); + /** + * @inheritDoc + */ + _iGetVertexCode(): string; + /** + * @inheritDoc + */ + _iGetFragmentCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * Gets the depth maps rendered for this object from all lights. + * @param renderable The renderable for which to retrieve the depth maps. + * @param stage3DProxy The Stage3DProxy object currently used for rendering. + * @return A list of depth map textures for all supported lights. + */ + _iGetDepthMap(renderable: RenderableBase): RenderTexture; + /** + * Retrieves the depth map projection maps for all lights. + * @param renderable The renderable for which to retrieve the projection maps. + * @return A list of projection maps for all supported lights. + */ + _iGetProjection(renderable: RenderableBase): Matrix3D; + /** + * @inheritDoc + */ + _iRender(pass: MaterialPassData, renderable: RenderableBase, stage: Stage, camera: Camera, viewProjection: Matrix3D): void; + /** + * @inheritDoc + */ + _iActivate(pass: MaterialPassData, stage: Stage, camera: Camera): void; + } + export = SingleObjectDepthPass; + +} +declare module "awayjs-renderergl/lib/materials/methods/DiffuseSubSurfaceMethod" { + import Camera = require("awayjs-core/lib/entities/Camera"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderLightingObject = require("awayjs-stagegl/lib/materials/compilation/ShaderLightingObject"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import DiffuseBasicMethod = require("awayjs-stagegl/lib/materials/methods/DiffuseBasicMethod"); + import DiffuseCompositeMethod = require("awayjs-renderergl/lib/materials/methods/DiffuseCompositeMethod"); + /** + * DiffuseSubSurfaceMethod provides a depth map-based diffuse shading method that mimics the scattering of + * light inside translucent surfaces. It allows light to shine through an object and to soften the diffuse shading. + * It can be used for candle wax, ice, skin, ... + */ + class DiffuseSubSurfaceMethod extends DiffuseCompositeMethod { + private _depthPass; + private _lightProjVarying; + private _propReg; + private _scattering; + private _translucency; + private _lightColorReg; + private _scatterColor; + private _colorReg; + private _decReg; + private _scatterR; + private _scatterG; + private _scatterB; + private _targetReg; + /** + * Creates a new DiffuseSubSurfaceMethod object. + * + * @param depthMapSize The size of the depth map used. + * @param depthMapOffset The amount by which the rendered object will be inflated, to prevent depth map rounding errors. + * @param baseMethod The diffuse method used to calculate the regular diffuse-based lighting. + */ + constructor(depthMapSize?: number, depthMapOffset?: number, baseMethod?: DiffuseBasicMethod); + /** + * @inheritDoc + */ + iInitConstants(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; + iCleanCompilationData(): void; + /** + * The amount by which the light scatters. It can be used to set the translucent surface's thickness. Use low + * values for skin. + */ + scattering: number; + /** + * The translucency of the object. + */ + translucency: number; + /** + * The colour of the "insides" of the object, ie: the colour the light becomes after leaving the object. + */ + scatterColor: number; + /** + * @inheritDoc + */ + iGetVertexCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iGetFragmentPreLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iGetFragmentCodePerLight(shaderObject: ShaderLightingObject, methodVO: MethodVO, lightDirReg: ShaderRegisterElement, lightColReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iGetFragmentPostLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + iSetRenderState(shaderObject: ShaderObjectBase, methodVO: MethodVO, renderable: RenderableBase, stage: Stage, camera: Camera): void; + /** + * Generates the code for this method + */ + private scatterLight(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); + } + export = DiffuseSubSurfaceMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/EffectRefractionEnvMapMethod" { + import CubeTextureBase = require("awayjs-core/lib/textures/CubeTextureBase"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import EffectMethodBase = require("awayjs-stagegl/lib/materials/methods/EffectMethodBase"); + /** + * EffectRefractionEnvMapMethod provides a method to add refracted transparency based on cube maps. + */ + class EffectRefractionEnvMapMethod extends EffectMethodBase { + private _envMap; + private _dispersionR; + private _dispersionG; + private _dispersionB; + private _useDispersion; + private _refractionIndex; + private _alpha; + /** + * Creates a new EffectRefractionEnvMapMethod object. Example values for dispersion are: dispersionR: -0.03, dispersionG: -0.01, dispersionB: = .0015 + * + * @param envMap The environment map containing the refracted scene. + * @param refractionIndex The refractive index of the material. + * @param dispersionR The amount of chromatic dispersion of the red channel. Defaults to 0 (none). + * @param dispersionG The amount of chromatic dispersion of the green channel. Defaults to 0 (none). + * @param dispersionB The amount of chromatic dispersion of the blue channel. Defaults to 0 (none). + */ + constructor(envMap: CubeTextureBase, refractionIndex?: number, dispersionR?: number, dispersionG?: number, dispersionB?: number); + /** + * @inheritDoc + */ + iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; + /** + * @inheritDoc + */ + iInitVO(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; + /** + * The cube environment map to use for the refraction. + */ + envMap: CubeTextureBase; + /** + * The refractive index of the material. + */ + refractionIndex: number; + /** + * The amount of chromatic dispersion of the red channel. Defaults to 0 (none). + */ + dispersionR: number; + /** + * The amount of chromatic dispersion of the green channel. Defaults to 0 (none). + */ + dispersionG: number; + /** + * The amount of chromatic dispersion of the blue channel. Defaults to 0 (none). + */ + dispersionB: number; + /** + * The amount of transparency of the object. Warning: the alpha applies to the refracted color, not the actual + * material. A value of 1 will make it appear fully transparent. + */ + alpha: number; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + } + export = EffectRefractionEnvMapMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/NormalHeightMapMethod" { + import Texture2DBase = require("awayjs-core/lib/textures/Texture2DBase"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import NormalBasicMethod = require("awayjs-stagegl/lib/materials/methods/NormalBasicMethod"); + import ShadingMethodBase = require("awayjs-stagegl/lib/materials/methods/ShadingMethodBase"); + /** + * NormalHeightMapMethod provides a normal map method that uses a height map to calculate the normals. + */ + class NormalHeightMapMethod extends NormalBasicMethod { + private _worldXYRatio; + private _worldXZRatio; + /** + * Creates a new NormalHeightMapMethod method. + * + * @param heightMap The texture containing the height data. 0 means low, 1 means high. + * @param worldWidth The width of the 'world'. This is used to map uv coordinates' u component to scene dimensions. + * @param worldHeight The height of the 'world'. This is used to map the height map values to scene dimensions. + * @param worldDepth The depth of the 'world'. This is used to map uv coordinates' v component to scene dimensions. + */ + constructor(heightMap: Texture2DBase, worldWidth: number, worldHeight: number, worldDepth: number); + /** + * @inheritDoc + */ + iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; + /** + * @inheritDoc + */ + tangentSpace: boolean; + /** + * @inheritDoc + */ + copyFrom(method: ShadingMethodBase): void; + /** + * @inheritDoc + */ + iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + } + export = NormalHeightMapMethod; + +} +declare module "awayjs-renderergl/lib/materials/methods/ShadowCascadeMethod" { + import Camera = require("awayjs-core/lib/entities/Camera"); + import Stage = require("awayjs-stagegl/lib/core/base/Stage"); + import RenderableBase = require("awayjs-stagegl/lib/core/pool/RenderableBase"); + import MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); + import ShaderLightingObject = require("awayjs-stagegl/lib/materials/compilation/ShaderLightingObject"); + import ShaderObjectBase = require("awayjs-stagegl/lib/materials/compilation/ShaderObjectBase"); + import ShaderRegisterCache = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache"); + import ShaderRegisterData = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterData"); + import ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); + import ShadowMapMethodBase = require("awayjs-stagegl/lib/materials/methods/ShadowMapMethodBase"); + import ShadowMethodBase = require("awayjs-stagegl/lib/materials/methods/ShadowMethodBase"); + /** + * ShadowCascadeMethod is a shadow map method to apply cascade shadow mapping on materials. + * Must be used with a DirectionalLight with a CascadeShadowMapper assigned to its shadowMapper property. + * + * @see away.lights.CascadeShadowMapper + */ + class ShadowCascadeMethod extends ShadowMapMethodBase { + private _baseMethod; + private _cascadeShadowMapper; + private _depthMapCoordVaryings; + private _cascadeProjections; + /** + * Creates a new ShadowCascadeMethod object. + * + * @param shadowMethodBase The shadow map sampling method used to sample individual cascades (fe: ShadowHardMethod, ShadowSoftMethod) + */ + constructor(shadowMethodBase: ShadowMethodBase); + /** + * The shadow map sampling method used to sample individual cascades. These are typically those used in conjunction + * with a DirectionalShadowMapper. + * + * @see ShadowHardMethod + * @see ShadowSoftMethod + */ + baseMethod: ShadowMethodBase; + /** + * @inheritDoc + */ + iInitVO(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; + /** + * @inheritDoc + */ + iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; + /** + * @inheritDoc + */ + iCleanCompilationData(): void; + /** + * @inheritDoc + */ + iGetVertexCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * Creates the registers for the cascades' projection coordinates. + */ + private initProjectionsRegs(registerCache); + /** + * @inheritDoc + */ + iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; + /** + * @inheritDoc + */ + iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: Stage): void; + /** + * @inheritDoc + */ + iSetRenderState(shaderObject: ShaderObjectBase, methodVO: MethodVO, renderable: RenderableBase, stage: Stage, camera: Camera): void; + /** + * Called when the shadow mappers cascade configuration changes. + */ + private onCascadeChange(event); + /** + * Called when the base method's shader code is invalidated. + */ + private onShaderInvalidated(event); + } + export = ShadowCascadeMethod; + +} +declare module "awayjs-renderergl/lib/tools/commands/Merge" { + import DisplayObjectContainer = require("awayjs-core/lib/containers/DisplayObjectContainer"); + import Mesh = require("awayjs-core/lib/entities/Mesh"); + /** + * Class Merge merges two or more static meshes into one.Merge + */ + class Merge { + private _objectSpace; + private _keepMaterial; + private _disposeSources; + private _geomVOs; + private _toDispose; + /** + * @param keepMaterial [optional] Determines if the merged object uses the recevier mesh material information or keeps its source material(s). Defaults to false. + * If false and receiver object has multiple materials, the last material found in receiver submeshes is applied to the merged submesh(es). + * @param disposeSources [optional] Determines if the mesh and geometry source(s) used for the merging are disposed. Defaults to false. + * If true, only receiver geometry and resulting mesh are kept in memory. + * @param objectSpace [optional] Determines if source mesh(es) is/are merged using objectSpace or worldspace. Defaults to false. + */ + constructor(keepMaterial?: boolean, disposeSources?: boolean, objectSpace?: boolean); + /** + * Determines if the mesh and geometry source(s) used for the merging are disposed. Defaults to false. + */ + disposeSources: boolean; + /** + * Determines if the material source(s) used for the merging are disposed. Defaults to false. + */ + keepMaterial: boolean; + /** + * Determines if source mesh(es) is/are merged using objectSpace or worldspace. Defaults to false. + */ + objectSpace: boolean; + /** + * Merges all the children of a container into a single Mesh. If no Mesh object is found, method returns the receiver without modification. + * + * @param receiver The Mesh to receive the merged contents of the container. + * @param objectContainer The DisplayObjectContainer holding the meshes to be mergd. + * + * @return The merged Mesh instance. + */ + applyToContainer(receiver: Mesh, objectContainer: DisplayObjectContainer): void; + /** + * Merges all the meshes found in the Array<Mesh> into a single Mesh. + * + * @param receiver The Mesh to receive the merged contents of the meshes. + * @param meshes A series of Meshes to be merged with the reciever mesh. + */ + applyToMeshes(receiver: Mesh, meshes: Mesh[]): void; + /** + * Merges 2 meshes into one. It is recommand to use apply when 2 meshes are to be merged. If more need to be merged, use either applyToMeshes or applyToContainer methods. + * + * @param receiver The Mesh to receive the merged contents of both meshes. + * @param mesh The Mesh to be merged with the receiver mesh + */ + apply(receiver: Mesh, mesh: Mesh): void; + private reset(); + private merge(destMesh, dispose); + private collect(mesh, dispose); + private getSubGeomData(material); + private parseContainer(receiver, object); + } + export = Merge; + +} +declare module "awayjs-renderergl/lib/tools/data/ParticleGeometryTransform" { + import Matrix = require("awayjs-core/lib/core/geom/Matrix"); + import Matrix3D = require("awayjs-core/lib/core/geom/Matrix3D"); + /** + * ... + */ + class ParticleGeometryTransform { + private _defaultVertexTransform; + private _defaultInvVertexTransform; + private _defaultUVTransform; + vertexTransform: Matrix3D; + UVTransform: Matrix; + invVertexTransform: Matrix3D; + } + export = ParticleGeometryTransform; + +} +declare module "awayjs-renderergl/lib/tools/helpers/ParticleGeometryHelper" { + import Geometry = require("awayjs-core/lib/core/base/Geometry"); + import ParticleGeometry = require("awayjs-renderergl/lib/core/base/ParticleGeometry"); + import ParticleGeometryTransform = require("awayjs-renderergl/lib/tools/data/ParticleGeometryTransform"); + /** + * ... + */ + class ParticleGeometryHelper { + static MAX_VERTEX: number; + static generateGeometry(geometries: Geometry[], transforms?: ParticleGeometryTransform[]): ParticleGeometry; + } + export = ParticleGeometryHelper; + +} \ No newline at end of file diff --git a/build/awayjs-renderergl.js b/build/awayjs-renderergl.js new file mode 100755 index 000000000..1a98aa6e1 --- /dev/null +++ b/build/awayjs-renderergl.js @@ -0,0 +1,17846 @@ +require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;oParticleAnimationSet + * + * @param [optional] usesDuration Defines whether the animation set uses the duration data in its static properties to determine how long a particle is visible for. Defaults to false. + * @param [optional] usesLooping Defines whether the animation set uses a looping timeframe for each particle determined by the startTime, duration and delay data in its static properties function. Defaults to false. Requires usesDuration to be true. + * @param [optional] usesDelay Defines whether the animation set uses the delay data in its static properties to determine how long a particle is hidden for. Defaults to false. Requires usesLooping to be true. + */ + function ParticleAnimationSet(usesDuration, usesLooping, usesDelay) { + if (usesDuration === void 0) { usesDuration = false; } + if (usesLooping === void 0) { usesLooping = false; } + if (usesDelay === void 0) { usesDelay = false; } + _super.call(this); + this._animationSubGeometries = new Object(); + this._particleNodes = new Array(); + this._localDynamicNodes = new Array(); + this._localStaticNodes = new Array(); + this._totalLenOfOneVertex = 0; + //automatically add a particle time node to the set + this.addAnimation(this._timeNode = new ParticleTimeNode(usesDuration, usesLooping, usesDelay)); + } + Object.defineProperty(ParticleAnimationSet.prototype, "particleNodes", { + /** + * Returns a vector of the particle animation nodes contained within the set. + */ + get: function () { + return this._particleNodes; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + ParticleAnimationSet.prototype.addAnimation = function (node) { + var i /*int*/; + var n = node; + n._iProcessAnimationSetting(this); + if (n.mode == ParticlePropertiesMode.LOCAL_STATIC) { + n._iDataOffset = this._totalLenOfOneVertex; + this._totalLenOfOneVertex += n.dataLength; + this._localStaticNodes.push(n); + } + else if (n.mode == ParticlePropertiesMode.LOCAL_DYNAMIC) + this._localDynamicNodes.push(n); + for (i = this._particleNodes.length - 1; i >= 0; i--) { + if (this._particleNodes[i].priority <= n.priority) + break; + } + this._particleNodes.splice(i + 1, 0, n); + _super.prototype.addAnimation.call(this, node); + }; + /** + * @inheritDoc + */ + ParticleAnimationSet.prototype.activate = function (shaderObject, stage) { + // this._iAnimationRegisterCache = pass.animationRegisterCache; + }; + /** + * @inheritDoc + */ + ParticleAnimationSet.prototype.deactivate = function (shaderObject, stage) { + // var context:IContextStageGL = stage.context; + // var offset:number /*int*/ = this._iAnimationRegisterCache.vertexAttributesOffset; + // var used:number /*int*/ = this._iAnimationRegisterCache.numUsedStreams; + // for (var i:number /*int*/ = offset; i < used; i++) + // context.setVertexBufferAt(i, null); + }; + /** + * @inheritDoc + */ + ParticleAnimationSet.prototype.getAGALVertexCode = function (shaderObject) { + //grab animationRegisterCache from the materialpassbase or create a new one if the first time + this._iAnimationRegisterCache = shaderObject.animationRegisterCache; + if (this._iAnimationRegisterCache == null) + this._iAnimationRegisterCache = shaderObject.animationRegisterCache = new AnimationRegisterCache(shaderObject.profile); + //reset animationRegisterCache + this._iAnimationRegisterCache.vertexConstantOffset = shaderObject.numUsedVertexConstants; + this._iAnimationRegisterCache.vertexAttributesOffset = shaderObject.numUsedStreams; + this._iAnimationRegisterCache.varyingsOffset = shaderObject.numUsedVaryings; + this._iAnimationRegisterCache.fragmentConstantOffset = shaderObject.numUsedFragmentConstants; + this._iAnimationRegisterCache.hasUVNode = this.hasUVNode; + this._iAnimationRegisterCache.needVelocity = this.needVelocity; + this._iAnimationRegisterCache.hasBillboard = this.hasBillboard; + this._iAnimationRegisterCache.sourceRegisters = shaderObject.animatableAttributes; + this._iAnimationRegisterCache.targetRegisters = shaderObject.animationTargetRegisters; + this._iAnimationRegisterCache.needFragmentAnimation = shaderObject.usesFragmentAnimation; + this._iAnimationRegisterCache.needUVAnimation = !shaderObject.usesUVTransform; + this._iAnimationRegisterCache.hasColorAddNode = this.hasColorAddNode; + this._iAnimationRegisterCache.hasColorMulNode = this.hasColorMulNode; + this._iAnimationRegisterCache.reset(); + var code = ""; + code += this._iAnimationRegisterCache.getInitCode(); + var node; + var i /*int*/; + for (i = 0; i < this._particleNodes.length; i++) { + node = this._particleNodes[i]; + if (node.priority < ParticleAnimationSet.POST_PRIORITY) + code += node.getAGALVertexCode(shaderObject, this._iAnimationRegisterCache); + } + code += this._iAnimationRegisterCache.getCombinationCode(); + for (i = 0; i < this._particleNodes.length; i++) { + node = this._particleNodes[i]; + if (node.priority >= ParticleAnimationSet.POST_PRIORITY && node.priority < ParticleAnimationSet.COLOR_PRIORITY) + code += node.getAGALVertexCode(shaderObject, this._iAnimationRegisterCache); + } + code += this._iAnimationRegisterCache.initColorRegisters(); + for (i = 0; i < this._particleNodes.length; i++) { + node = this._particleNodes[i]; + if (node.priority >= ParticleAnimationSet.COLOR_PRIORITY) + code += node.getAGALVertexCode(shaderObject, this._iAnimationRegisterCache); + } + code += this._iAnimationRegisterCache.getColorPassCode(); + return code; + }; + /** + * @inheritDoc + */ + ParticleAnimationSet.prototype.getAGALUVCode = function (shaderObject) { + var code = ""; + if (this.hasUVNode) { + this._iAnimationRegisterCache.setUVSourceAndTarget(shaderObject.uvSource, shaderObject.uvTarget); + code += "mov " + this._iAnimationRegisterCache.uvTarget + ".xy," + this._iAnimationRegisterCache.uvAttribute.toString() + "\n"; + var node; + for (var i = 0; i < this._particleNodes.length; i++) + node = this._particleNodes[i]; + code += node.getAGALUVCode(shaderObject, this._iAnimationRegisterCache); + code += "mov " + this._iAnimationRegisterCache.uvVar.toString() + "," + this._iAnimationRegisterCache.uvTarget + ".xy\n"; + } + else + code += "mov " + shaderObject.uvTarget + "," + shaderObject.uvSource + "\n"; + return code; + }; + /** + * @inheritDoc + */ + ParticleAnimationSet.prototype.getAGALFragmentCode = function (shaderObject, shadedTarget) { + return this._iAnimationRegisterCache.getColorCombinationCode(shadedTarget); + }; + /** + * @inheritDoc + */ + ParticleAnimationSet.prototype.doneAGALCode = function (shaderObject) { + this._iAnimationRegisterCache.setDataLength(); + //set vertexZeroConst,vertexOneConst,vertexTwoConst + this._iAnimationRegisterCache.setVertexConst(this._iAnimationRegisterCache.vertexZeroConst.index, 0, 1, 2, 0); + }; + Object.defineProperty(ParticleAnimationSet.prototype, "usesCPU", { + /** + * @inheritDoc + */ + get: function () { + return false; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + ParticleAnimationSet.prototype.cancelGPUCompatibility = function () { + }; + ParticleAnimationSet.prototype.dispose = function () { + for (var key in this._animationSubGeometries) + this._animationSubGeometries[key].dispose(); + _super.prototype.dispose.call(this); + }; + ParticleAnimationSet.prototype.getAnimationSubGeometry = function (subMesh) { + var mesh = subMesh.parentMesh; + var animationSubGeometry = (mesh.shareAnimationGeometry) ? this._animationSubGeometries[subMesh.subGeometry.id] : this._animationSubGeometries[subMesh.id]; + if (animationSubGeometry) + return animationSubGeometry; + this._iGenerateAnimationSubGeometries(mesh); + return (mesh.shareAnimationGeometry) ? this._animationSubGeometries[subMesh.subGeometry.id] : this._animationSubGeometries[subMesh.id]; + }; + /** @private */ + ParticleAnimationSet.prototype._iGenerateAnimationSubGeometries = function (mesh) { + if (this.initParticleFunc == null) + throw (new Error("no initParticleFunc set")); + var geometry = mesh.geometry; + if (!geometry) + throw (new Error("Particle animation can only be performed on a ParticleGeometry object")); + var i /*int*/, j /*int*/, k /*int*/; + var animationSubGeometry; + var newAnimationSubGeometry = false; + var subGeometry; + var subMesh; + var localNode; + for (i = 0; i < mesh.subMeshes.length; i++) { + subMesh = mesh.subMeshes[i]; + subGeometry = subMesh.subGeometry; + if (mesh.shareAnimationGeometry) { + animationSubGeometry = this._animationSubGeometries[subGeometry.id]; + if (animationSubGeometry) + continue; + } + animationSubGeometry = new AnimationSubGeometry(); + if (mesh.shareAnimationGeometry) + this._animationSubGeometries[subGeometry.id] = animationSubGeometry; + else + this._animationSubGeometries[subMesh.id] = animationSubGeometry; + newAnimationSubGeometry = true; + //create the vertexData vector that will be used for local node data + animationSubGeometry.createVertexData(subGeometry.numVertices, this._totalLenOfOneVertex); + } + if (!newAnimationSubGeometry) + return; + var particles = geometry.particles; + var particlesLength = particles.length; + var numParticles = geometry.numParticles; + var particleProperties = new ParticleProperties(); + var particle; + var oneDataLen /*int*/; + var oneDataOffset /*int*/; + var counterForVertex /*int*/; + var counterForOneData /*int*/; + var oneData; + var numVertices /*uint*/; + var vertexData; + var vertexLength /*uint*/; + var startingOffset /*uint*/; + var vertexOffset /*uint*/; + //default values for particle param + particleProperties.total = numParticles; + particleProperties.startTime = 0; + particleProperties.duration = 1000; + particleProperties.delay = 0.1; + i = 0; + j = 0; + while (i < numParticles) { + particleProperties.index = i; + //call the init on the particle parameters + this.initParticleFunc.call(this.initParticleScope, particleProperties); + for (k = 0; k < this._localStaticNodes.length; k++) + this._localStaticNodes[k]._iGeneratePropertyOfOneParticle(particleProperties); + while (j < particlesLength && (particle = particles[j]).particleIndex == i) { + for (k = 0; k < mesh.subMeshes.length; k++) { + subMesh = mesh.subMeshes[k]; + if (subMesh.subGeometry == particle.subGeometry) { + animationSubGeometry = (mesh.shareAnimationGeometry) ? this._animationSubGeometries[subMesh.subGeometry.id] : this._animationSubGeometries[subMesh.id]; + break; + } + } + numVertices = particle.numVertices; + vertexData = animationSubGeometry.vertexData; + vertexLength = numVertices * this._totalLenOfOneVertex; + startingOffset = animationSubGeometry.numProcessedVertices * this._totalLenOfOneVertex; + for (k = 0; k < this._localStaticNodes.length; k++) { + localNode = this._localStaticNodes[k]; + oneData = localNode.oneData; + oneDataLen = localNode.dataLength; + oneDataOffset = startingOffset + localNode._iDataOffset; + for (counterForVertex = 0; counterForVertex < vertexLength; counterForVertex += this._totalLenOfOneVertex) { + vertexOffset = oneDataOffset + counterForVertex; + for (counterForOneData = 0; counterForOneData < oneDataLen; counterForOneData++) + vertexData[vertexOffset + counterForOneData] = oneData[counterForOneData]; + } + } + //store particle properties if they need to be retreived for dynamic local nodes + if (this._localDynamicNodes.length) + animationSubGeometry.animationParticles.push(new ParticleAnimationData(i, particleProperties.startTime, particleProperties.duration, particleProperties.delay, particle)); + animationSubGeometry.numProcessedVertices += numVertices; + //next index + j++; + } + //next particle + i++; + } + }; + /** + * Property used by particle nodes that require compilation at the end of the shader + */ + ParticleAnimationSet.POST_PRIORITY = 9; + /** + * Property used by particle nodes that require color compilation + */ + ParticleAnimationSet.COLOR_PRIORITY = 18; + return ParticleAnimationSet; +})(AnimationSetBase); +module.exports = ParticleAnimationSet; + + +},{"awayjs-renderergl/lib/animators/data/AnimationSubGeometry":undefined,"awayjs-renderergl/lib/animators/data/ParticleAnimationData":undefined,"awayjs-renderergl/lib/animators/data/ParticleProperties":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/nodes/ParticleTimeNode":undefined,"awayjs-stagegl/lib/animators/AnimationSetBase":undefined,"awayjs-stagegl/lib/animators/data/AnimationRegisterCache":undefined}],"awayjs-renderergl/lib/animators/ParticleAnimator":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); +var ContextGLProgramType = require("awayjs-stagegl/lib/core/stagegl/ContextGLProgramType"); +var AnimationSubGeometry = require("awayjs-renderergl/lib/animators/data/AnimationSubGeometry"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +/** + * Provides an interface for assigning paricle-based animation data sets to mesh-based entity objects + * and controlling the various available states of animation through an interative playhead that can be + * automatically updated or manually triggered. + * + * Requires that the containing geometry of the parent mesh is particle geometry + * + * @see away.base.ParticleGeometry + */ +var ParticleAnimator = (function (_super) { + __extends(ParticleAnimator, _super); + /** + * Creates a new ParticleAnimator object. + * + * @param particleAnimationSet The animation data set containing the particle animations used by the animator. + */ + function ParticleAnimator(particleAnimationSet) { + _super.call(this, particleAnimationSet); + this._animationParticleStates = new Array(); + this._animatorParticleStates = new Array(); + this._timeParticleStates = new Array(); + this._totalLenOfOneVertex = 0; + this._animatorSubGeometries = new Object(); + this._particleAnimationSet = particleAnimationSet; + var state; + var node; + for (var i = 0; i < this._particleAnimationSet.particleNodes.length; i++) { + node = this._particleAnimationSet.particleNodes[i]; + state = this.getAnimationState(node); + if (node.mode == ParticlePropertiesMode.LOCAL_DYNAMIC) { + this._animatorParticleStates.push(state); + node._iDataOffset = this._totalLenOfOneVertex; + this._totalLenOfOneVertex += node.dataLength; + } + else { + this._animationParticleStates.push(state); + } + if (state.needUpdateTime) + this._timeParticleStates.push(state); + } + } + /** + * @inheritDoc + */ + ParticleAnimator.prototype.clone = function () { + return new ParticleAnimator(this._particleAnimationSet); + }; + /** + * @inheritDoc + */ + ParticleAnimator.prototype.setRenderState = function (shaderObject, renderable, stage, camera, vertexConstantOffset /*int*/, vertexStreamOffset /*int*/) { + var animationRegisterCache = this._particleAnimationSet._iAnimationRegisterCache; + var subMesh = renderable.subMesh; + var state; + var i; + if (!subMesh) + throw (new Error("Must be subMesh")); + //process animation sub geometries + var animationSubGeometry = this._particleAnimationSet.getAnimationSubGeometry(subMesh); + for (i = 0; i < this._animationParticleStates.length; i++) + this._animationParticleStates[i].setRenderState(stage, renderable, animationSubGeometry, animationRegisterCache, camera); + //process animator subgeometries + var animatorSubGeometry = this.getAnimatorSubGeometry(subMesh); + for (i = 0; i < this._animatorParticleStates.length; i++) + this._animatorParticleStates[i].setRenderState(stage, renderable, animatorSubGeometry, animationRegisterCache, camera); + stage.context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX, animationRegisterCache.vertexConstantOffset, animationRegisterCache.vertexConstantData, animationRegisterCache.numVertexConstant); + if (animationRegisterCache.numFragmentConstant > 0) + stage.context.setProgramConstantsFromArray(ContextGLProgramType.FRAGMENT, animationRegisterCache.fragmentConstantOffset, animationRegisterCache.fragmentConstantData, animationRegisterCache.numFragmentConstant); + }; + /** + * @inheritDoc + */ + ParticleAnimator.prototype.testGPUCompatibility = function (shaderObject) { + }; + /** + * @inheritDoc + */ + ParticleAnimator.prototype.start = function () { + _super.prototype.start.call(this); + for (var i = 0; i < this._timeParticleStates.length; i++) + this._timeParticleStates[i].offset(this._pAbsoluteTime); + }; + /** + * @inheritDoc + */ + ParticleAnimator.prototype._pUpdateDeltaTime = function (dt) { + this._pAbsoluteTime += dt; + for (var i = 0; i < this._timeParticleStates.length; i++) + this._timeParticleStates[i].update(this._pAbsoluteTime); + }; + /** + * @inheritDoc + */ + ParticleAnimator.prototype.resetTime = function (offset) { + if (offset === void 0) { offset = 0; } + for (var i = 0; i < this._timeParticleStates.length; i++) + this._timeParticleStates[i].offset(this._pAbsoluteTime + offset); + this.update(this.time); + }; + ParticleAnimator.prototype.dispose = function () { + for (var key in this._animatorSubGeometries) + this._animatorSubGeometries[key].dispose(); + }; + ParticleAnimator.prototype.getAnimatorSubGeometry = function (subMesh) { + if (!this._animatorParticleStates.length) + return; + var subGeometry = subMesh.subGeometry; + var animatorSubGeometry = this._animatorSubGeometries[subGeometry.id] = new AnimationSubGeometry(); + //create the vertexData vector that will be used for local state data + animatorSubGeometry.createVertexData(subGeometry.numVertices, this._totalLenOfOneVertex); + //pass the particles data to the animator subGeometry + animatorSubGeometry.animationParticles = this._particleAnimationSet.getAnimationSubGeometry(subMesh).animationParticles; + }; + return ParticleAnimator; +})(AnimatorBase); +module.exports = ParticleAnimator; + + +},{"awayjs-renderergl/lib/animators/data/AnimationSubGeometry":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-stagegl/lib/animators/AnimatorBase":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLProgramType":undefined}],"awayjs-renderergl/lib/animators/SkeletonAnimationSet":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var AnimationSetBase = require("awayjs-stagegl/lib/animators/AnimationSetBase"); +/** + * The animation data set used by skeleton-based animators, containing skeleton animation data. + * + * @see away.animators.SkeletonAnimator + */ +var SkeletonAnimationSet = (function (_super) { + __extends(SkeletonAnimationSet, _super); + /** + * Creates a new SkeletonAnimationSet object. + * + * @param jointsPerVertex Sets the amount of skeleton joints that can be linked to a single vertex via skinned weight values. For GPU-base animation, the maximum allowed value is 4. Defaults to 4. + */ + function SkeletonAnimationSet(jointsPerVertex) { + if (jointsPerVertex === void 0) { jointsPerVertex = 4; } + _super.call(this); + this._jointsPerVertex = jointsPerVertex; + } + Object.defineProperty(SkeletonAnimationSet.prototype, "jointsPerVertex", { + /** + * Returns the amount of skeleton joints that can be linked to a single vertex via skinned weight values. For GPU-base animation, the + * maximum allowed value is 4. + */ + get: function () { + return this._jointsPerVertex; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + SkeletonAnimationSet.prototype.getAGALVertexCode = function (shaderObject) { + var len = shaderObject.animatableAttributes.length; + var indexOffset0 = shaderObject.numUsedVertexConstants; + var indexOffset1 = indexOffset0 + 1; + var indexOffset2 = indexOffset0 + 2; + var indexStream = "va" + shaderObject.numUsedStreams; + var weightStream = "va" + (shaderObject.numUsedStreams + 1); + var indices = [indexStream + ".x", indexStream + ".y", indexStream + ".z", indexStream + ".w"]; + var weights = [weightStream + ".x", weightStream + ".y", weightStream + ".z", weightStream + ".w"]; + var temp1 = this._pFindTempReg(shaderObject.animationTargetRegisters); + var temp2 = this._pFindTempReg(shaderObject.animationTargetRegisters, temp1); + var dot = "dp4"; + var code = ""; + for (var i = 0; i < len; ++i) { + var src = shaderObject.animatableAttributes[i]; + for (var j = 0; j < this._jointsPerVertex; ++j) { + code += dot + " " + temp1 + ".x, " + src + ", vc[" + indices[j] + "+" + indexOffset0 + "]\n" + dot + " " + temp1 + ".y, " + src + ", vc[" + indices[j] + "+" + indexOffset1 + "]\n" + dot + " " + temp1 + ".z, " + src + ", vc[" + indices[j] + "+" + indexOffset2 + "]\n" + "mov " + temp1 + ".w, " + src + ".w\n" + "mul " + temp1 + ", " + temp1 + ", " + weights[j] + "\n"; // apply weight + // add or mov to target. Need to write to a temp reg first, because an output can be a target + if (j == 0) + code += "mov " + temp2 + ", " + temp1 + "\n"; + else + code += "add " + temp2 + ", " + temp2 + ", " + temp1 + "\n"; + } + // switch to dp3 once positions have been transformed, from now on, it should only be vectors instead of points + dot = "dp3"; + code += "mov " + shaderObject.animationTargetRegisters[i] + ", " + temp2 + "\n"; + } + return code; + }; + /** + * @inheritDoc + */ + SkeletonAnimationSet.prototype.activate = function (shaderObject, stage) { + }; + /** + * @inheritDoc + */ + SkeletonAnimationSet.prototype.deactivate = function (shaderObject, stage) { + // var streamOffset:number /*uint*/ = pass.numUsedStreams; + // var context:IContextStageGL = stage.context; + // context.setVertexBufferAt(streamOffset, null); + // context.setVertexBufferAt(streamOffset + 1, null); + }; + /** + * @inheritDoc + */ + SkeletonAnimationSet.prototype.getAGALFragmentCode = function (shaderObject, shadedTarget) { + return ""; + }; + /** + * @inheritDoc + */ + SkeletonAnimationSet.prototype.getAGALUVCode = function (shaderObject) { + return "mov " + shaderObject.uvTarget + "," + shaderObject.uvSource + "\n"; + }; + /** + * @inheritDoc + */ + SkeletonAnimationSet.prototype.doneAGALCode = function (shaderObject) { + }; + return SkeletonAnimationSet; +})(AnimationSetBase); +module.exports = SkeletonAnimationSet; + + +},{"awayjs-stagegl/lib/animators/AnimationSetBase":undefined}],"awayjs-renderergl/lib/animators/SkeletonAnimator":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var TriangleSubGeometry = require("awayjs-core/lib/core/base/TriangleSubGeometry"); +var SubGeometryEvent = require("awayjs-core/lib/events/SubGeometryEvent"); +var AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); +var ContextGLProgramType = require("awayjs-stagegl/lib/core/stagegl/ContextGLProgramType"); +var JointPose = require("awayjs-renderergl/lib/animators/data/JointPose"); +var SkeletonPose = require("awayjs-renderergl/lib/animators/data/SkeletonPose"); +var AnimationStateEvent = require("awayjs-renderergl/lib/events/AnimationStateEvent"); +/** + * Provides an interface for assigning skeleton-based animation data sets to mesh-based entity objects + * and controlling the various available states of animation through an interative playhead that can be + * automatically updated or manually triggered. + */ +var SkeletonAnimator = (function (_super) { + __extends(SkeletonAnimator, _super); + /** + * Creates a new SkeletonAnimator object. + * + * @param skeletonAnimationSet The animation data set containing the skeleton animations used by the animator. + * @param skeleton The skeleton object used for calculating the resulting global matrices for transforming skinned mesh data. + * @param forceCPU Optional value that only allows the animator to perform calculation on the CPU. Defaults to false. + */ + function SkeletonAnimator(animationSet, skeleton, forceCPU) { + var _this = this; + if (forceCPU === void 0) { forceCPU = false; } + _super.call(this, animationSet); + this._globalPose = new SkeletonPose(); + this._morphedSubGeometry = new Object(); + this._morphedSubGeometryDirty = new Object(); + this._skeleton = skeleton; + this._forceCPU = forceCPU; + this._jointsPerVertex = animationSet.jointsPerVertex; + this._numJoints = this._skeleton.numJoints; + this._globalMatrices = new Array(this._numJoints * 12); + var j = 0; + for (var i = 0; i < this._numJoints; ++i) { + this._globalMatrices[j++] = 1; + this._globalMatrices[j++] = 0; + this._globalMatrices[j++] = 0; + this._globalMatrices[j++] = 0; + this._globalMatrices[j++] = 0; + this._globalMatrices[j++] = 1; + this._globalMatrices[j++] = 0; + this._globalMatrices[j++] = 0; + this._globalMatrices[j++] = 0; + this._globalMatrices[j++] = 0; + this._globalMatrices[j++] = 1; + this._globalMatrices[j++] = 0; + } + this._onTransitionCompleteDelegate = function (event) { return _this.onTransitionComplete(event); }; + this._onIndicesUpdateDelegate = function (event) { return _this.onIndicesUpdate(event); }; + this._onVerticesUpdateDelegate = function (event) { return _this.onVerticesUpdate(event); }; + } + Object.defineProperty(SkeletonAnimator.prototype, "globalMatrices", { + /** + * returns the calculated global matrices of the current skeleton pose. + * + * @see #globalPose + */ + get: function () { + if (this._globalPropertiesDirty) + this.updateGlobalProperties(); + return this._globalMatrices; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SkeletonAnimator.prototype, "globalPose", { + /** + * returns the current skeleton pose output from the animator. + * + * @see away.animators.data.SkeletonPose + */ + get: function () { + if (this._globalPropertiesDirty) + this.updateGlobalProperties(); + return this._globalPose; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SkeletonAnimator.prototype, "skeleton", { + /** + * Returns the skeleton object in use by the animator - this defines the number and heirarchy of joints used by the + * skinned geoemtry to which skeleon animator is applied. + */ + get: function () { + return this._skeleton; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SkeletonAnimator.prototype, "forceCPU", { + /** + * Indicates whether the skeleton animator is disabled by default for GPU rendering, something that allows the animator to perform calculation on the GPU. + * Defaults to false. + */ + get: function () { + return this._forceCPU; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SkeletonAnimator.prototype, "useCondensedIndices", { + /** + * Offers the option of enabling GPU accelerated animation on skeletons larger than 32 joints + * by condensing the number of joint index values required per mesh. Only applicable to + * skeleton animations that utilise more than one mesh object. Defaults to false. + */ + get: function () { + return this._useCondensedIndices; + }, + set: function (value) { + this._useCondensedIndices = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + SkeletonAnimator.prototype.clone = function () { + /* The cast to SkeletonAnimationSet should never fail, as _animationSet can only be set + through the constructor, which will only accept a SkeletonAnimationSet. */ + return new SkeletonAnimator(this._pAnimationSet, this._skeleton, this._forceCPU); + }; + /** + * Plays an animation state registered with the given name in the animation data set. + * + * @param name The data set name of the animation state to be played. + * @param transition An optional transition object that determines how the animator will transition from the currently active animation state. + * @param offset An option offset time (in milliseconds) that resets the state's internal clock to the absolute time of the animator plus the offset value. Required for non-looping animation states. + */ + SkeletonAnimator.prototype.play = function (name, transition, offset) { + if (transition === void 0) { transition = null; } + if (offset === void 0) { offset = NaN; } + if (this._pActiveAnimationName == name) + return; + this._pActiveAnimationName = name; + if (!this._pAnimationSet.hasAnimation(name)) + throw new Error("Animation root node " + name + " not found!"); + if (transition && this._pActiveNode) { + //setup the transition + this._pActiveNode = transition.getAnimationNode(this, this._pActiveNode, this._pAnimationSet.getAnimation(name), this._pAbsoluteTime); + this._pActiveNode.addEventListener(AnimationStateEvent.TRANSITION_COMPLETE, this._onTransitionCompleteDelegate); + } + else + this._pActiveNode = this._pAnimationSet.getAnimation(name); + this._pActiveState = this.getAnimationState(this._pActiveNode); + if (this.updatePosition) { + //update straight away to reset position deltas + this._pActiveState.update(this._pAbsoluteTime); + this._pActiveState.positionDelta; + } + this._activeSkeletonState = this._pActiveState; + this.start(); + //apply a time offset if specified + if (!isNaN(offset)) + this.reset(name, offset); + }; + /** + * @inheritDoc + */ + SkeletonAnimator.prototype.setRenderState = function (shaderObject, renderable, stage, camera, vertexConstantOffset /*int*/, vertexStreamOffset /*int*/) { + // do on request of globalProperties + if (this._globalPropertiesDirty) + this.updateGlobalProperties(); + var subGeometry = renderable.subMesh.subGeometry; + subGeometry.useCondensedIndices = this._useCondensedIndices; + if (this._useCondensedIndices) { + // using a condensed data set + this.updateCondensedMatrices(subGeometry.condensedIndexLookUp, subGeometry.numCondensedJoints); + stage.context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX, vertexConstantOffset, this._condensedMatrices, subGeometry.numCondensedJoints * 3); + } + else { + if (this._pAnimationSet.usesCPU) { + if (this._morphedSubGeometryDirty[subGeometry.id]) + this.morphSubGeometry(renderable, subGeometry); + return; + } + stage.context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX, vertexConstantOffset, this._globalMatrices, this._numJoints * 3); + } + stage.context.activateBuffer(vertexStreamOffset, renderable.getVertexData(TriangleSubGeometry.JOINT_INDEX_DATA), renderable.getVertexOffset(TriangleSubGeometry.JOINT_INDEX_DATA), renderable.JOINT_INDEX_FORMAT); + stage.context.activateBuffer(vertexStreamOffset + 1, renderable.getVertexData(TriangleSubGeometry.JOINT_WEIGHT_DATA), renderable.getVertexOffset(TriangleSubGeometry.JOINT_WEIGHT_DATA), renderable.JOINT_WEIGHT_FORMAT); + }; + /** + * @inheritDoc + */ + SkeletonAnimator.prototype.testGPUCompatibility = function (shaderObject) { + if (!this._useCondensedIndices && (this._forceCPU || this._jointsPerVertex > 4 || shaderObject.numUsedVertexConstants + this._numJoints * 3 > 128)) + this._pAnimationSet.cancelGPUCompatibility(); + }; + /** + * Applies the calculated time delta to the active animation state node or state transition object. + */ + SkeletonAnimator.prototype._pUpdateDeltaTime = function (dt) { + _super.prototype._pUpdateDeltaTime.call(this, dt); + //invalidate pose matrices + this._globalPropertiesDirty = true; + //trigger geometry invalidation if using CPU animation + if (this._pAnimationSet.usesCPU) + for (var key in this._morphedSubGeometryDirty) + this._morphedSubGeometryDirty[key] = true; + }; + SkeletonAnimator.prototype.updateCondensedMatrices = function (condensedIndexLookUp /*uint*/, numJoints /*uint*/) { + var i = 0, j = 0; + var len /*uint*/; + var srcIndex /*uint*/; + this._condensedMatrices = new Array(); + do { + srcIndex = condensedIndexLookUp[i] * 4; + len = srcIndex + 12; + while (srcIndex < len) + this._condensedMatrices[j++] = this._globalMatrices[srcIndex++]; + } while (++i < numJoints); + }; + SkeletonAnimator.prototype.updateGlobalProperties = function () { + this._globalPropertiesDirty = false; + //get global pose + this.localToGlobalPose(this._activeSkeletonState.getSkeletonPose(this._skeleton), this._globalPose, this._skeleton); + // convert pose to matrix + var mtxOffset = 0; + var globalPoses = this._globalPose.jointPoses; + var raw; + var ox, oy, oz, ow; + var xy2, xz2, xw2; + var yz2, yw2, zw2; + var n11, n12, n13; + var n21, n22, n23; + var n31, n32, n33; + var m11, m12, m13, m14; + var m21, m22, m23, m24; + var m31, m32, m33, m34; + var joints = this._skeleton.joints; + var pose; + var quat; + var vec; + var t; + for (var i = 0; i < this._numJoints; ++i) { + pose = globalPoses[i]; + quat = pose.orientation; + vec = pose.translation; + ox = quat.x; + oy = quat.y; + oz = quat.z; + ow = quat.w; + xy2 = (t = 2.0 * ox) * oy; + xz2 = t * oz; + xw2 = t * ow; + yz2 = (t = 2.0 * oy) * oz; + yw2 = t * ow; + zw2 = 2.0 * oz * ow; + yz2 = 2.0 * oy * oz; + yw2 = 2.0 * oy * ow; + zw2 = 2.0 * oz * ow; + ox *= ox; + oy *= oy; + oz *= oz; + ow *= ow; + n11 = (t = ox - oy) - oz + ow; + n12 = xy2 - zw2; + n13 = xz2 + yw2; + n21 = xy2 + zw2; + n22 = -t - oz + ow; + n23 = yz2 - xw2; + n31 = xz2 - yw2; + n32 = yz2 + xw2; + n33 = -ox - oy + oz + ow; + // prepend inverse bind pose + raw = joints[i].inverseBindPose; + m11 = raw[0]; + m12 = raw[4]; + m13 = raw[8]; + m14 = raw[12]; + m21 = raw[1]; + m22 = raw[5]; + m23 = raw[9]; + m24 = raw[13]; + m31 = raw[2]; + m32 = raw[6]; + m33 = raw[10]; + m34 = raw[14]; + this._globalMatrices[mtxOffset] = n11 * m11 + n12 * m21 + n13 * m31; + this._globalMatrices[mtxOffset + 1] = n11 * m12 + n12 * m22 + n13 * m32; + this._globalMatrices[mtxOffset + 2] = n11 * m13 + n12 * m23 + n13 * m33; + this._globalMatrices[mtxOffset + 3] = n11 * m14 + n12 * m24 + n13 * m34 + vec.x; + this._globalMatrices[mtxOffset + 4] = n21 * m11 + n22 * m21 + n23 * m31; + this._globalMatrices[mtxOffset + 5] = n21 * m12 + n22 * m22 + n23 * m32; + this._globalMatrices[mtxOffset + 6] = n21 * m13 + n22 * m23 + n23 * m33; + this._globalMatrices[mtxOffset + 7] = n21 * m14 + n22 * m24 + n23 * m34 + vec.y; + this._globalMatrices[mtxOffset + 8] = n31 * m11 + n32 * m21 + n33 * m31; + this._globalMatrices[mtxOffset + 9] = n31 * m12 + n32 * m22 + n33 * m32; + this._globalMatrices[mtxOffset + 10] = n31 * m13 + n32 * m23 + n33 * m33; + this._globalMatrices[mtxOffset + 11] = n31 * m14 + n32 * m24 + n33 * m34 + vec.z; + mtxOffset = mtxOffset + 12; + } + }; + SkeletonAnimator.prototype.getRenderableSubGeometry = function (renderable, sourceSubGeometry) { + this._morphedSubGeometryDirty[sourceSubGeometry.id] = true; + //early out for GPU animations + if (!this._pAnimationSet.usesCPU) + return sourceSubGeometry; + var targetSubGeometry; + if (!(targetSubGeometry = this._morphedSubGeometry[sourceSubGeometry.id])) { + //not yet stored + targetSubGeometry = this._morphedSubGeometry[sourceSubGeometry.id] = sourceSubGeometry.clone(); + //turn off auto calculations on the morphed geometry + targetSubGeometry.autoDeriveNormals = false; + targetSubGeometry.autoDeriveTangents = false; + targetSubGeometry.autoDeriveUVs = false; + //add event listeners for any changes in UV values on the source geometry + sourceSubGeometry.addEventListener(SubGeometryEvent.INDICES_UPDATED, this._onIndicesUpdateDelegate); + sourceSubGeometry.addEventListener(SubGeometryEvent.VERTICES_UPDATED, this._onVerticesUpdateDelegate); + } + return targetSubGeometry; + }; + /** + * If the animation can't be performed on GPU, transform vertices manually + * @param subGeom The subgeometry containing the weights and joint index data per vertex. + * @param pass The material pass for which we need to transform the vertices + */ + SkeletonAnimator.prototype.morphSubGeometry = function (renderable, sourceSubGeometry) { + this._morphedSubGeometryDirty[sourceSubGeometry.id] = false; + var sourcePositions = sourceSubGeometry.positions; + var sourceNormals = sourceSubGeometry.vertexNormals; + var sourceTangents = sourceSubGeometry.vertexTangents; + var jointIndices = sourceSubGeometry.jointIndices; + var jointWeights = sourceSubGeometry.jointWeights; + var targetSubGeometry = this._morphedSubGeometry[sourceSubGeometry.id]; + var targetPositions = targetSubGeometry.positions; + var targetNormals = targetSubGeometry.vertexNormals; + var targetTangents = targetSubGeometry.vertexTangents; + var index = 0; + var j = 0; + var k /*uint*/; + var vx, vy, vz; + var nx, ny, nz; + var tx, ty, tz; + var len = sourcePositions.length; + var weight; + var vertX, vertY, vertZ; + var normX, normY, normZ; + var tangX, tangY, tangZ; + var m11, m12, m13, m14; + var m21, m22, m23, m24; + var m31, m32, m33, m34; + while (index < len) { + vertX = sourcePositions[index]; + vertY = sourcePositions[index + 1]; + vertZ = sourcePositions[index + 2]; + normX = sourceNormals[index]; + normY = sourceNormals[index + 1]; + normZ = sourceNormals[index + 2]; + tangX = sourceTangents[index]; + tangY = sourceTangents[index + 1]; + tangZ = sourceTangents[index + 2]; + vx = 0; + vy = 0; + vz = 0; + nx = 0; + ny = 0; + nz = 0; + tx = 0; + ty = 0; + tz = 0; + k = 0; + while (k < this._jointsPerVertex) { + weight = jointWeights[j]; + if (weight > 0) { + // implicit /3*12 (/3 because indices are multiplied by 3 for gpu matrix access, *12 because it's the matrix size) + var mtxOffset = jointIndices[j++] << 2; + m11 = this._globalMatrices[mtxOffset]; + m12 = this._globalMatrices[mtxOffset + 1]; + m13 = this._globalMatrices[mtxOffset + 2]; + m14 = this._globalMatrices[mtxOffset + 3]; + m21 = this._globalMatrices[mtxOffset + 4]; + m22 = this._globalMatrices[mtxOffset + 5]; + m23 = this._globalMatrices[mtxOffset + 6]; + m24 = this._globalMatrices[mtxOffset + 7]; + m31 = this._globalMatrices[mtxOffset + 8]; + m32 = this._globalMatrices[mtxOffset + 9]; + m33 = this._globalMatrices[mtxOffset + 10]; + m34 = this._globalMatrices[mtxOffset + 11]; + vx += weight * (m11 * vertX + m12 * vertY + m13 * vertZ + m14); + vy += weight * (m21 * vertX + m22 * vertY + m23 * vertZ + m24); + vz += weight * (m31 * vertX + m32 * vertY + m33 * vertZ + m34); + nx += weight * (m11 * normX + m12 * normY + m13 * normZ); + ny += weight * (m21 * normX + m22 * normY + m23 * normZ); + nz += weight * (m31 * normX + m32 * normY + m33 * normZ); + tx += weight * (m11 * tangX + m12 * tangY + m13 * tangZ); + ty += weight * (m21 * tangX + m22 * tangY + m23 * tangZ); + tz += weight * (m31 * tangX + m32 * tangY + m33 * tangZ); + ++k; + } + else { + j += (this._jointsPerVertex - k); + k = this._jointsPerVertex; + } + } + targetPositions[index] = vx; + targetPositions[index + 1] = vy; + targetPositions[index + 2] = vz; + targetNormals[index] = nx; + targetNormals[index + 1] = ny; + targetNormals[index + 2] = nz; + targetTangents[index] = tx; + targetTangents[index + 1] = ty; + targetTangents[index + 2] = tz; + index += 3; + } + targetSubGeometry.updatePositions(targetPositions); + targetSubGeometry.updateVertexNormals(targetNormals); + targetSubGeometry.updateVertexTangents(targetTangents); + }; + /** + * Converts a local hierarchical skeleton pose to a global pose + * @param targetPose The SkeletonPose object that will contain the global pose. + * @param skeleton The skeleton containing the joints, and as such, the hierarchical data to transform to global poses. + */ + SkeletonAnimator.prototype.localToGlobalPose = function (sourcePose, targetPose, skeleton) { + var globalPoses = targetPose.jointPoses; + var globalJointPose; + var joints = skeleton.joints; + var len = sourcePose.numJointPoses; + var jointPoses = sourcePose.jointPoses; + var parentIndex /*int*/; + var joint; + var parentPose; + var pose; + var or; + var tr; + var t; + var q; + var x1, y1, z1, w1; + var x2, y2, z2, w2; + var x3, y3, z3; + // :s + if (globalPoses.length != len) + globalPoses.length = len; + for (var i = 0; i < len; ++i) { + globalJointPose = globalPoses[i]; + if (globalJointPose == null) + globalJointPose = globalPoses[i] = new JointPose(); + joint = joints[i]; + parentIndex = joint.parentIndex; + pose = jointPoses[i]; + q = globalJointPose.orientation; + t = globalJointPose.translation; + if (parentIndex < 0) { + tr = pose.translation; + or = pose.orientation; + q.x = or.x; + q.y = or.y; + q.z = or.z; + q.w = or.w; + t.x = tr.x; + t.y = tr.y; + t.z = tr.z; + } + else { + // append parent pose + parentPose = globalPoses[parentIndex]; + // rotate point + or = parentPose.orientation; + tr = pose.translation; + x2 = or.x; + y2 = or.y; + z2 = or.z; + w2 = or.w; + x3 = tr.x; + y3 = tr.y; + z3 = tr.z; + w1 = -x2 * x3 - y2 * y3 - z2 * z3; + x1 = w2 * x3 + y2 * z3 - z2 * y3; + y1 = w2 * y3 - x2 * z3 + z2 * x3; + z1 = w2 * z3 + x2 * y3 - y2 * x3; + // append parent translation + tr = parentPose.translation; + t.x = -w1 * x2 + x1 * w2 - y1 * z2 + z1 * y2 + tr.x; + t.y = -w1 * y2 + x1 * z2 + y1 * w2 - z1 * x2 + tr.y; + t.z = -w1 * z2 - x1 * y2 + y1 * x2 + z1 * w2 + tr.z; + // append parent orientation + x1 = or.x; + y1 = or.y; + z1 = or.z; + w1 = or.w; + or = pose.orientation; + x2 = or.x; + y2 = or.y; + z2 = or.z; + w2 = or.w; + q.w = w1 * w2 - x1 * x2 - y1 * y2 - z1 * z2; + q.x = w1 * x2 + x1 * w2 + y1 * z2 - z1 * y2; + q.y = w1 * y2 - x1 * z2 + y1 * w2 + z1 * x2; + q.z = w1 * z2 + x1 * y2 - y1 * x2 + z1 * w2; + } + } + }; + SkeletonAnimator.prototype.onTransitionComplete = function (event) { + if (event.type == AnimationStateEvent.TRANSITION_COMPLETE) { + event.animationNode.removeEventListener(AnimationStateEvent.TRANSITION_COMPLETE, this._onTransitionCompleteDelegate); + //if this is the current active state transition, revert control to the active node + if (this._pActiveState == event.animationState) { + this._pActiveNode = this._pAnimationSet.getAnimation(this._pActiveAnimationName); + this._pActiveState = this.getAnimationState(this._pActiveNode); + this._activeSkeletonState = this._pActiveState; + } + } + }; + SkeletonAnimator.prototype.onIndicesUpdate = function (event) { + var subGeometry = event.target; + this._morphedSubGeometry[subGeometry.id].updateIndices(subGeometry.indices); + }; + SkeletonAnimator.prototype.onVerticesUpdate = function (event) { + var subGeometry = event.target; + var morphGeometry = this._morphedSubGeometry[subGeometry.id]; + switch (event.dataType) { + case TriangleSubGeometry.UV_DATA: + morphGeometry.updateUVs(subGeometry.uvs); + case TriangleSubGeometry.SECONDARY_UV_DATA: + morphGeometry.updateUVs(subGeometry.secondaryUVs); + } + }; + return SkeletonAnimator; +})(AnimatorBase); +module.exports = SkeletonAnimator; + + +},{"awayjs-core/lib/core/base/TriangleSubGeometry":undefined,"awayjs-core/lib/events/SubGeometryEvent":undefined,"awayjs-renderergl/lib/animators/data/JointPose":undefined,"awayjs-renderergl/lib/animators/data/SkeletonPose":undefined,"awayjs-renderergl/lib/events/AnimationStateEvent":undefined,"awayjs-stagegl/lib/animators/AnimatorBase":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLProgramType":undefined}],"awayjs-renderergl/lib/animators/VertexAnimationSet":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var AnimationSetBase = require("awayjs-stagegl/lib/animators/AnimationSetBase"); +var VertexAnimationMode = require("awayjs-renderergl/lib/animators/data/VertexAnimationMode"); +/** + * The animation data set used by vertex-based animators, containing vertex animation state data. + * + * @see VertexAnimator + */ +var VertexAnimationSet = (function (_super) { + __extends(VertexAnimationSet, _super); + /** + * Returns whether or not normal data is used in last set GPU pass of the vertex shader. + */ + // public get useNormals():boolean + // { + // return this._uploadNormals; + // } + /** + * Creates a new VertexAnimationSet object. + * + * @param numPoses The number of poses made available at once to the GPU animation code. + * @param blendMode Optional value for setting the animation mode of the vertex animator object. + * + * @see away3d.animators.data.VertexAnimationMode + */ + function VertexAnimationSet(numPoses, blendMode) { + if (numPoses === void 0) { numPoses = 2; } + if (blendMode === void 0) { blendMode = "absolute"; } + _super.call(this); + this._numPoses = numPoses; + this._blendMode = blendMode; + } + Object.defineProperty(VertexAnimationSet.prototype, "numPoses", { + /** + * Returns the number of poses made available at once to the GPU animation code. + */ + get: function () { + return this._numPoses; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VertexAnimationSet.prototype, "blendMode", { + /** + * Returns the active blend mode of the vertex animator object. + */ + get: function () { + return this._blendMode; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + VertexAnimationSet.prototype.getAGALVertexCode = function (shaderObject) { + if (this._blendMode == VertexAnimationMode.ABSOLUTE) + return this.getAbsoluteAGALCode(shaderObject); + else + return this.getAdditiveAGALCode(shaderObject); + }; + /** + * @inheritDoc + */ + VertexAnimationSet.prototype.activate = function (shaderObject, stage) { + // var uID:number = pass._iUniqueId; + // this._uploadNormals = this._useNormals[uID]; + // this._uploadTangents = this._useTangents[uID]; + }; + /** + * @inheritDoc + */ + VertexAnimationSet.prototype.deactivate = function (shaderObject, stage) { + // var uID:number = pass._iUniqueId; + // var index:number /*uint*/ = this._streamIndices[uID]; + // var context:IContextStageGL = stage.context; + // context.setVertexBufferAt(index, null); + // if (this._uploadNormals) + // context.setVertexBufferAt(index + 1, null); + // if (this._uploadTangents) + // context.setVertexBufferAt(index + 2, null); + }; + /** + * @inheritDoc + */ + VertexAnimationSet.prototype.getAGALFragmentCode = function (shaderObject, shadedTarget) { + return ""; + }; + /** + * @inheritDoc + */ + VertexAnimationSet.prototype.getAGALUVCode = function (shaderObject) { + return "mov " + shaderObject.uvTarget + "," + shaderObject.uvSource + "\n"; + }; + /** + * @inheritDoc + */ + VertexAnimationSet.prototype.doneAGALCode = function (shaderObject) { + }; + /** + * Generates the vertex AGAL code for absolute blending. + */ + VertexAnimationSet.prototype.getAbsoluteAGALCode = function (shaderObject) { + var code = ""; + var temp1 = this._pFindTempReg(shaderObject.animationTargetRegisters); + var temp2 = this._pFindTempReg(shaderObject.animationTargetRegisters, temp1); + var regs = new Array("x", "y", "z", "w"); + var len = shaderObject.animatableAttributes.length; + var constantReg = "vc" + shaderObject.numUsedVertexConstants; + if (len > 2) + len = 2; + var streamIndex = shaderObject.numUsedStreams; + for (var i = 0; i < len; ++i) { + code += "mul " + temp1 + ", " + shaderObject.animatableAttributes[i] + ", " + constantReg + "." + regs[0] + "\n"; + for (var j = 1; j < this._numPoses; ++j) { + code += "mul " + temp2 + ", va" + streamIndex + ", " + constantReg + "." + regs[j] + "\n"; + if (j < this._numPoses - 1) + code += "add " + temp1 + ", " + temp1 + ", " + temp2 + "\n"; + ++streamIndex; + } + code += "add " + shaderObject.animationTargetRegisters[i] + ", " + temp1 + ", " + temp2 + "\n"; + } + // add code for bitangents if tangents are used + if (shaderObject.tangentDependencies > 0 || shaderObject.outputsNormals) { + code += "dp3 " + temp1 + ".x, " + shaderObject.animatableAttributes[2] + ", " + shaderObject.animationTargetRegisters[1] + "\n" + "mul " + temp1 + ", " + shaderObject.animationTargetRegisters[1] + ", " + temp1 + ".x\n" + "sub " + shaderObject.animationTargetRegisters[2] + ", " + shaderObject.animationTargetRegisters[2] + ", " + temp1 + "\n"; + } + return code; + }; + /** + * Generates the vertex AGAL code for additive blending. + */ + VertexAnimationSet.prototype.getAdditiveAGALCode = function (shaderObject) { + var code = ""; + var len = shaderObject.animatableAttributes.length; + var regs = ["x", "y", "z", "w"]; + var temp1 = this._pFindTempReg(shaderObject.animationTargetRegisters); + var k /*uint*/; + var streamIndex = shaderObject.numUsedStreams; + if (len > 2) + len = 2; + code += "mov " + shaderObject.animationTargetRegisters[0] + ", " + shaderObject.animatableAttributes[0] + "\n"; + if (shaderObject.normalDependencies > 0) + code += "mov " + shaderObject.animationTargetRegisters[1] + ", " + shaderObject.animatableAttributes[1] + "\n"; + for (var i = 0; i < len; ++i) { + for (var j = 0; j < this._numPoses; ++j) { + code += "mul " + temp1 + ", va" + (streamIndex + k) + ", vc" + shaderObject.numUsedVertexConstants + "." + regs[j] + "\n" + "add " + shaderObject.animationTargetRegisters[i] + ", " + shaderObject.animationTargetRegisters[i] + ", " + temp1 + "\n"; + k++; + } + } + if (shaderObject.tangentDependencies > 0 || shaderObject.outputsNormals) { + code += "dp3 " + temp1 + ".x, " + shaderObject.animatableAttributes[2] + ", " + shaderObject.animationTargetRegisters[1] + "\n" + "mul " + temp1 + ", " + shaderObject.animationTargetRegisters[1] + ", " + temp1 + ".x\n" + "sub " + shaderObject.animationTargetRegisters[2] + ", " + shaderObject.animatableAttributes[2] + ", " + temp1 + "\n"; + } + return code; + }; + return VertexAnimationSet; +})(AnimationSetBase); +module.exports = VertexAnimationSet; + + +},{"awayjs-renderergl/lib/animators/data/VertexAnimationMode":undefined,"awayjs-stagegl/lib/animators/AnimationSetBase":undefined}],"awayjs-renderergl/lib/animators/VertexAnimator":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var TriangleSubGeometry = require("awayjs-core/lib/core/base/TriangleSubGeometry"); +var AnimatorBase = require("awayjs-stagegl/lib/animators/AnimatorBase"); +var VertexDataPool = require("awayjs-stagegl/lib/core/pool/VertexDataPool"); +var ContextGLProgramType = require("awayjs-stagegl/lib/core/stagegl/ContextGLProgramType"); +var VertexAnimationMode = require("awayjs-renderergl/lib/animators/data/VertexAnimationMode"); +/** + * Provides an interface for assigning vertex-based animation data sets to mesh-based entity objects + * and controlling the various available states of animation through an interative playhead that can be + * automatically updated or manually triggered. + */ +var VertexAnimator = (function (_super) { + __extends(VertexAnimator, _super); + /** + * Creates a new VertexAnimator object. + * + * @param vertexAnimationSet The animation data set containing the vertex animations used by the animator. + */ + function VertexAnimator(vertexAnimationSet) { + _super.call(this, vertexAnimationSet); + this._poses = new Array(); + this._weights = Array(1, 0, 0, 0); + this._vertexAnimationSet = vertexAnimationSet; + this._numPoses = vertexAnimationSet.numPoses; + this._blendMode = vertexAnimationSet.blendMode; + } + /** + * @inheritDoc + */ + VertexAnimator.prototype.clone = function () { + return new VertexAnimator(this._vertexAnimationSet); + }; + /** + * Plays a sequence with a given name. If the sequence is not found, it may not be loaded yet, and it will retry every frame. + * @param sequenceName The name of the clip to be played. + */ + VertexAnimator.prototype.play = function (name, transition, offset) { + if (transition === void 0) { transition = null; } + if (offset === void 0) { offset = NaN; } + if (this._pActiveAnimationName == name) + return; + this._pActiveAnimationName = name; + //TODO: implement transitions in vertex animator + if (!this._pAnimationSet.hasAnimation(name)) + throw new Error("Animation root node " + name + " not found!"); + this._pActiveNode = this._pAnimationSet.getAnimation(name); + this._pActiveState = this.getAnimationState(this._pActiveNode); + if (this.updatePosition) { + //update straight away to reset position deltas + this._pActiveState.update(this._pAbsoluteTime); + this._pActiveState.positionDelta; + } + this._activeVertexState = this._pActiveState; + this.start(); + //apply a time offset if specified + if (!isNaN(offset)) + this.reset(name, offset); + }; + /** + * @inheritDoc + */ + VertexAnimator.prototype._pUpdateDeltaTime = function (dt) { + _super.prototype._pUpdateDeltaTime.call(this, dt); + var geometryFlag = false; + if (this._poses[0] != this._activeVertexState.currentGeometry) { + this._poses[0] = this._activeVertexState.currentGeometry; + geometryFlag = true; + } + if (this._poses[1] != this._activeVertexState.nextGeometry) { + this._poses[1] = this._activeVertexState.nextGeometry; + geometryFlag = true; + } + this._weights[0] = 1 - (this._weights[1] = this._activeVertexState.blendWeight); + if (geometryFlag) { + //invalidate meshes + var mesh; + var len = this._pOwners.length; + for (var i = 0; i < len; i++) { + mesh = this._pOwners[i]; + mesh._iInvalidateRenderableGeometries(); + } + } + }; + /** + * @inheritDoc + */ + VertexAnimator.prototype.setRenderState = function (shaderObject, renderable, stage, camera, vertexConstantOffset /*int*/, vertexStreamOffset /*int*/) { + // todo: add code for when running on cpu + // if no poses defined, set temp data + if (!this._poses.length) { + this.setNullPose(shaderObject, renderable, stage, vertexConstantOffset, vertexStreamOffset); + return; + } + // this type of animation can only be SubMesh + var subMesh = renderable.subMesh; + var subGeom; + var i /*uint*/; + var len = this._numPoses; + stage.context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX, vertexConstantOffset, this._weights, 1); + if (this._blendMode == VertexAnimationMode.ABSOLUTE) + i = 1; + else + i = 0; + for (; i < len; ++i) { + subGeom = this._poses[i].subGeometries[subMesh._iIndex] || subMesh.subGeometry; + stage.context.activateBuffer(vertexStreamOffset++, VertexDataPool.getItem(subGeom, renderable.getIndexData(), TriangleSubGeometry.POSITION_DATA), subGeom.getOffset(TriangleSubGeometry.POSITION_DATA), TriangleSubGeometry.POSITION_FORMAT); + if (shaderObject.normalDependencies > 0) + stage.context.activateBuffer(vertexStreamOffset++, VertexDataPool.getItem(subGeom, renderable.getIndexData(), TriangleSubGeometry.NORMAL_DATA), subGeom.getOffset(TriangleSubGeometry.NORMAL_DATA), TriangleSubGeometry.NORMAL_FORMAT); + } + }; + VertexAnimator.prototype.setNullPose = function (shaderObject, renderable, stage, vertexConstantOffset /*int*/, vertexStreamOffset /*int*/) { + stage.context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX, vertexConstantOffset, this._weights, 1); + if (this._blendMode == VertexAnimationMode.ABSOLUTE) { + var len = this._numPoses; + for (var i = 1; i < len; ++i) { + stage.context.activateBuffer(vertexStreamOffset++, renderable.getVertexData(TriangleSubGeometry.POSITION_DATA), renderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA), TriangleSubGeometry.POSITION_FORMAT); + if (shaderObject.normalDependencies > 0) + stage.context.activateBuffer(vertexStreamOffset++, renderable.getVertexData(TriangleSubGeometry.NORMAL_DATA), renderable.getVertexOffset(TriangleSubGeometry.NORMAL_DATA), TriangleSubGeometry.NORMAL_FORMAT); + } + } + // todo: set temp data for additive? + }; + /** + * Verifies if the animation will be used on cpu. Needs to be true for all passes for a material to be able to use it on gpu. + * Needs to be called if gpu code is potentially required. + */ + VertexAnimator.prototype.testGPUCompatibility = function (shaderObject) { + }; + VertexAnimator.prototype.getRenderableSubGeometry = function (renderable, sourceSubGeometry) { + if (this._blendMode == VertexAnimationMode.ABSOLUTE && this._poses.length) + return this._poses[0].subGeometries[renderable.subMesh._iIndex] || sourceSubGeometry; + //nothing to do here + return sourceSubGeometry; + }; + return VertexAnimator; +})(AnimatorBase); +module.exports = VertexAnimator; + + +},{"awayjs-core/lib/core/base/TriangleSubGeometry":undefined,"awayjs-renderergl/lib/animators/data/VertexAnimationMode":undefined,"awayjs-stagegl/lib/animators/AnimatorBase":undefined,"awayjs-stagegl/lib/core/pool/VertexDataPool":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLProgramType":undefined}],"awayjs-renderergl/lib/animators/data/AnimationSubGeometry":[function(require,module,exports){ +/** + * ... + */ +var AnimationSubGeometry = (function () { + function AnimationSubGeometry() { + this._pVertexBuffer = new Array(8); + this._pBufferContext = new Array(8); + this._pBufferDirty = new Array(8); + this.numProcessedVertices = 0; + this.previousTime = Number.NEGATIVE_INFINITY; + this.animationParticles = new Array(); + for (var i = 0; i < 8; i++) + this._pBufferDirty[i] = true; + this._iUniqueId = AnimationSubGeometry.SUBGEOM_ID_COUNT++; + } + AnimationSubGeometry.prototype.createVertexData = function (numVertices /*uint*/, totalLenOfOneVertex /*uint*/) { + this._numVertices = numVertices; + this._totalLenOfOneVertex = totalLenOfOneVertex; + this._pVertexData = new Array(numVertices * totalLenOfOneVertex); + }; + AnimationSubGeometry.prototype.activateVertexBuffer = function (index /*int*/, bufferOffset /*int*/, stage, format) { + var contextIndex = stage.stageIndex; + var context = stage.context; + var buffer = this._pVertexBuffer[contextIndex]; + if (!buffer || this._pBufferContext[contextIndex] != context) { + buffer = this._pVertexBuffer[contextIndex] = context.createVertexBuffer(this._numVertices, this._totalLenOfOneVertex); + this._pBufferContext[contextIndex] = context; + this._pBufferDirty[contextIndex] = true; + } + if (this._pBufferDirty[contextIndex]) { + buffer.uploadFromArray(this._pVertexData, 0, this._numVertices); + this._pBufferDirty[contextIndex] = false; + } + context.setVertexBufferAt(index, buffer, bufferOffset, format); + }; + AnimationSubGeometry.prototype.dispose = function () { + while (this._pVertexBuffer.length) { + var vertexBuffer = this._pVertexBuffer.pop(); + if (vertexBuffer) + vertexBuffer.dispose(); + } + }; + AnimationSubGeometry.prototype.invalidateBuffer = function () { + for (var i = 0; i < 8; i++) + this._pBufferDirty[i] = true; + }; + Object.defineProperty(AnimationSubGeometry.prototype, "vertexData", { + get: function () { + return this._pVertexData; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationSubGeometry.prototype, "numVertices", { + get: function () { + return this._numVertices; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationSubGeometry.prototype, "totalLenOfOneVertex", { + get: function () { + return this._totalLenOfOneVertex; + }, + enumerable: true, + configurable: true + }); + AnimationSubGeometry.SUBGEOM_ID_COUNT = 0; + return AnimationSubGeometry; +})(); +module.exports = AnimationSubGeometry; + + +},{}],"awayjs-renderergl/lib/animators/data/ColorSegmentPoint":[function(require,module,exports){ +var ColorSegmentPoint = (function () { + function ColorSegmentPoint(life, color) { + //0= 1) + throw (new Error("life exceeds range (0,1)")); + this._life = life; + this._color = color; + } + Object.defineProperty(ColorSegmentPoint.prototype, "color", { + get: function () { + return this._color; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColorSegmentPoint.prototype, "life", { + get: function () { + return this._life; + }, + enumerable: true, + configurable: true + }); + return ColorSegmentPoint; +})(); +module.exports = ColorSegmentPoint; + + +},{}],"awayjs-renderergl/lib/animators/data/JointPose":[function(require,module,exports){ +var Matrix3D = require("awayjs-core/lib/core/geom/Matrix3D"); +var Quaternion = require("awayjs-core/lib/core/geom/Quaternion"); +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +/** + * Contains transformation data for a skeleton joint, used for skeleton animation. + * + * @see away.animation.Skeleton + * @see away.animation.SkeletonJoint + * + * todo: support (uniform) scale + */ +var JointPose = (function () { + function JointPose() { + /** + * The rotation of the pose stored as a quaternion + */ + this.orientation = new Quaternion(); + /** + * The translation of the pose + */ + this.translation = new Vector3D(); + } + /** + * Converts the transformation to a Matrix3D representation. + * + * @param target An optional target matrix to store the transformation. If not provided, it will create a new instance. + * @return The transformation matrix of the pose. + */ + JointPose.prototype.toMatrix3D = function (target) { + if (target === void 0) { target = null; } + if (target == null) + target = new Matrix3D(); + this.orientation.toMatrix3D(target); + target.appendTranslation(this.translation.x, this.translation.y, this.translation.z); + return target; + }; + /** + * Copies the transformation data from a source pose object into the existing pose object. + * + * @param pose The source pose to copy from. + */ + JointPose.prototype.copyFrom = function (pose) { + var or = pose.orientation; + var tr = pose.translation; + this.orientation.x = or.x; + this.orientation.y = or.y; + this.orientation.z = or.z; + this.orientation.w = or.w; + this.translation.x = tr.x; + this.translation.y = tr.y; + this.translation.z = tr.z; + }; + return JointPose; +})(); +module.exports = JointPose; + + +},{"awayjs-core/lib/core/geom/Matrix3D":undefined,"awayjs-core/lib/core/geom/Quaternion":undefined,"awayjs-core/lib/core/geom/Vector3D":undefined}],"awayjs-renderergl/lib/animators/data/ParticleAnimationData":[function(require,module,exports){ +/** + * ... + */ +var ParticleAnimationData = (function () { + function ParticleAnimationData(index /*uint*/, startTime, duration, delay, particle) { + this.index = index; + this.startTime = startTime; + this.totalTime = duration + delay; + this.duration = duration; + this.delay = delay; + this.startVertexIndex = particle.startVertexIndex; + this.numVertices = particle.numVertices; + } + return ParticleAnimationData; +})(); +module.exports = ParticleAnimationData; + + +},{}],"awayjs-renderergl/lib/animators/data/ParticleData":[function(require,module,exports){ +var ParticleData = (function () { + function ParticleData() { + } + return ParticleData; +})(); +module.exports = ParticleData; + + +},{}],"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":[function(require,module,exports){ +/** + * Options for setting the properties mode of a particle animation node. + */ +var ParticlePropertiesMode = (function () { + function ParticlePropertiesMode() { + } + /** + * Mode that defines the particle node as acting on global properties (ie. the properties set in the node constructor or the corresponding animation state). + */ + ParticlePropertiesMode.GLOBAL = 0; + /** + * Mode that defines the particle node as acting on local static properties (ie. the properties of particles set in the initialising on the animation set). + */ + ParticlePropertiesMode.LOCAL_STATIC = 1; + /** + * Mode that defines the particle node as acting on local dynamic properties (ie. the properties of the particles set in the corresponding animation state). + */ + ParticlePropertiesMode.LOCAL_DYNAMIC = 2; + return ParticlePropertiesMode; +})(); +module.exports = ParticlePropertiesMode; + + +},{}],"awayjs-renderergl/lib/animators/data/ParticleProperties":[function(require,module,exports){ +/** + * Dynamic class for holding the local properties of a particle, used for processing the static properties + * of particles in the particle animation set before beginning upload to the GPU. + */ +var ParticleProperties = (function () { + function ParticleProperties() { + } + return ParticleProperties; +})(); +module.exports = ParticleProperties; + + +},{}],"awayjs-renderergl/lib/animators/data/SkeletonJoint":[function(require,module,exports){ +/** + * A value obect representing a single joint in a skeleton object. + * + * @see away.animators.Skeleton + */ +var SkeletonJoint = (function () { + /** + * Creates a new SkeletonJoint object + */ + function SkeletonJoint() { + /** + * The index of the parent joint in the skeleton's joints vector. + * + * @see away.animators.Skeleton#joints + */ + this.parentIndex = -1; + } + return SkeletonJoint; +})(); +module.exports = SkeletonJoint; + + +},{}],"awayjs-renderergl/lib/animators/data/SkeletonPose":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var JointPose = require("awayjs-renderergl/lib/animators/data/JointPose"); +var AssetType = require("awayjs-core/lib/core/library/AssetType"); +var NamedAssetBase = require("awayjs-core/lib/core/library/NamedAssetBase"); +/** + * A collection of pose objects, determining the pose for an entire skeleton. + * The jointPoses vector object corresponds to a skeleton's joints vector object, however, there is no + * reference to a skeleton's instance, since several skeletons can be influenced by the same pose (eg: animation + * clips are added to any animator with a valid skeleton) + * + * @see away.animators.Skeleton + * @see away.animators.JointPose + */ +var SkeletonPose = (function (_super) { + __extends(SkeletonPose, _super); + /** + * Creates a new SkeletonPose object. + */ + function SkeletonPose() { + _super.call(this); + this.jointPoses = new Array(); + } + Object.defineProperty(SkeletonPose.prototype, "numJointPoses", { + /** + * The total number of joint poses in the skeleton pose. + */ + get: function () { + return this.jointPoses.length; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SkeletonPose.prototype, "assetType", { + /** + * @inheritDoc + */ + get: function () { + return AssetType.SKELETON_POSE; + }, + enumerable: true, + configurable: true + }); + /** + * Returns the joint pose object with the given joint name, otherwise returns a null object. + * + * @param jointName The name of the joint object whose pose is to be found. + * @return The pose object with the given joint name. + */ + SkeletonPose.prototype.jointPoseFromName = function (jointName) { + var jointPoseIndex = this.jointPoseIndexFromName(jointName); + if (jointPoseIndex != -1) + return this.jointPoses[jointPoseIndex]; + else + return null; + }; + /** + * Returns the pose index, given the joint name. -1 is returned if the joint name is not found in the pose. + * + * @param The name of the joint object whose pose is to be found. + * @return The index of the pose object in the jointPoses Array + * + * @see #jointPoses + */ + SkeletonPose.prototype.jointPoseIndexFromName = function (jointName) { + // this is implemented as a linear search, rather than a possibly + // more optimal method (Dictionary lookup, for example) because: + // a) it is assumed that it will be called once for each joint + // b) it is assumed that it will be called only during load, and not during main loop + // c) maintaining a dictionary (for safety) would dictate an interface to access JointPoses, + // rather than direct array access. this would be sub-optimal. + var jointPoseIndex /*int*/; + var jointPose; + for (var i /*uint*/; i < this.jointPoses.length; i++) { + jointPose = this.jointPoses[i]; + if (jointPose.name == jointName) + return jointPoseIndex; + jointPoseIndex++; + } + return -1; + }; + /** + * Creates a copy of the SkeletonPose object, with a dulpicate of its component joint poses. + * + * @return SkeletonPose + */ + SkeletonPose.prototype.clone = function () { + var clone = new SkeletonPose(); + var numJointPoses = this.jointPoses.length; + for (var i = 0; i < numJointPoses; i++) { + var cloneJointPose = new JointPose(); + var thisJointPose = this.jointPoses[i]; + cloneJointPose.name = thisJointPose.name; + cloneJointPose.copyFrom(thisJointPose); + clone.jointPoses[i] = cloneJointPose; + } + return clone; + }; + /** + * @inheritDoc + */ + SkeletonPose.prototype.dispose = function () { + this.jointPoses.length = 0; + }; + return SkeletonPose; +})(NamedAssetBase); +module.exports = SkeletonPose; + + +},{"awayjs-core/lib/core/library/AssetType":undefined,"awayjs-core/lib/core/library/NamedAssetBase":undefined,"awayjs-renderergl/lib/animators/data/JointPose":undefined}],"awayjs-renderergl/lib/animators/data/Skeleton":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var AssetType = require("awayjs-core/lib/core/library/AssetType"); +var NamedAssetBase = require("awayjs-core/lib/core/library/NamedAssetBase"); +/** + * A Skeleton object is a hierarchical grouping of joint objects that can be used for skeletal animation. + * + * @see away.animators.SkeletonJoint + */ +var Skeleton = (function (_super) { + __extends(Skeleton, _super); + /** + * Creates a new Skeleton object + */ + function Skeleton() { + _super.call(this); + // in the long run, it might be a better idea to not store Joint objects, but keep all data in Vectors, that we can upload easily? + this.joints = new Array(); + } + Object.defineProperty(Skeleton.prototype, "numJoints", { + /** + * The total number of joints in the skeleton. + */ + get: function () { + return this.joints.length; + }, + enumerable: true, + configurable: true + }); + /** + * Returns the joint object in the skeleton with the given name, otherwise returns a null object. + * + * @param jointName The name of the joint object to be found. + * @return The joint object with the given name. + * + * @see #joints + */ + Skeleton.prototype.jointFromName = function (jointName) { + var jointIndex = this.jointIndexFromName(jointName); + if (jointIndex != -1) + return this.joints[jointIndex]; + else + return null; + }; + /** + * Returns the joint index, given the joint name. -1 is returned if the joint name is not found. + * + * @param jointName The name of the joint object to be found. + * @return The index of the joint object in the joints Array + * + * @see #joints + */ + Skeleton.prototype.jointIndexFromName = function (jointName) { + // this is implemented as a linear search, rather than a possibly + // more optimal method (Dictionary lookup, for example) because: + // a) it is assumed that it will be called once for each joint + // b) it is assumed that it will be called only during load, and not during main loop + // c) maintaining a dictionary (for safety) would dictate an interface to access SkeletonJoints, + // rather than direct array access. this would be sub-optimal. + var jointIndex /*int*/; + var joint; + for (var i /*int*/; i < this.joints.length; i++) { + joint = this.joints[i]; + if (joint.name == jointName) + return jointIndex; + jointIndex++; + } + return -1; + }; + /** + * @inheritDoc + */ + Skeleton.prototype.dispose = function () { + this.joints.length = 0; + }; + Object.defineProperty(Skeleton.prototype, "assetType", { + /** + * @inheritDoc + */ + get: function () { + return AssetType.SKELETON; + }, + enumerable: true, + configurable: true + }); + return Skeleton; +})(NamedAssetBase); +module.exports = Skeleton; + + +},{"awayjs-core/lib/core/library/AssetType":undefined,"awayjs-core/lib/core/library/NamedAssetBase":undefined}],"awayjs-renderergl/lib/animators/data/VertexAnimationMode":[function(require,module,exports){ +/** + * Options for setting the animation mode of a vertex animator object. + * + * @see away.animators.VertexAnimator + */ +var VertexAnimationMode = (function () { + function VertexAnimationMode() { + } + /** + * Animation mode that adds all outputs from active vertex animation state to form the current vertex animation pose. + */ + VertexAnimationMode.ADDITIVE = "additive"; + /** + * Animation mode that picks the output from a single vertex animation state to form the current vertex animation pose. + */ + VertexAnimationMode.ABSOLUTE = "absolute"; + return VertexAnimationMode; +})(); +module.exports = VertexAnimationMode; + + +},{}],"awayjs-renderergl/lib/animators/nodes/AnimationClipNodeBase":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var AnimationNodeBase = require("awayjs-core/lib/animators/nodes/AnimationNodeBase"); +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +/** + * Provides an abstract base class for nodes with time-based animation data in an animation blend tree. + */ +var AnimationClipNodeBase = (function (_super) { + __extends(AnimationClipNodeBase, _super); + /** + * Creates a new AnimationClipNodeBase object. + */ + function AnimationClipNodeBase() { + _super.call(this); + this._pLooping = true; + this._pTotalDuration = 0; + this._pStitchDirty = true; + this._pStitchFinalFrame = false; + this._pNumFrames = 0; + this._pDurations = new Array(); + /*uint*/ + this._pTotalDelta = new Vector3D(); + this.fixedFrameRate = true; + } + Object.defineProperty(AnimationClipNodeBase.prototype, "looping", { + /** + * Determines whether the contents of the animation node have looping characteristics enabled. + */ + get: function () { + return this._pLooping; + }, + set: function (value) { + if (this._pLooping == value) + return; + this._pLooping = value; + this._pStitchDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationClipNodeBase.prototype, "stitchFinalFrame", { + /** + * Defines if looping content blends the final frame of animation data with the first (true) or works on the + * assumption that both first and last frames are identical (false). Defaults to false. + */ + get: function () { + return this._pStitchFinalFrame; + }, + set: function (value) { + if (this._pStitchFinalFrame == value) + return; + this._pStitchFinalFrame = value; + this._pStitchDirty = true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationClipNodeBase.prototype, "totalDuration", { + get: function () { + if (this._pStitchDirty) + this._pUpdateStitch(); + return this._pTotalDuration; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationClipNodeBase.prototype, "totalDelta", { + get: function () { + if (this._pStitchDirty) + this._pUpdateStitch(); + return this._pTotalDelta; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationClipNodeBase.prototype, "lastFrame", { + get: function () { + if (this._pStitchDirty) + this._pUpdateStitch(); + return this._pLastFrame; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationClipNodeBase.prototype, "durations", { + /** + * Returns a vector of time values representing the duration (in milliseconds) of each animation frame in the clip. + */ + get: function () { + return this._pDurations; + }, + enumerable: true, + configurable: true + }); + /** + * Updates the node's final frame stitch state. + * + * @see #stitchFinalFrame + */ + AnimationClipNodeBase.prototype._pUpdateStitch = function () { + this._pStitchDirty = false; + this._pLastFrame = (this._pStitchFinalFrame) ? this._pNumFrames : this._pNumFrames - 1; + this._pTotalDuration = 0; + this._pTotalDelta.x = 0; + this._pTotalDelta.y = 0; + this._pTotalDelta.z = 0; + }; + return AnimationClipNodeBase; +})(AnimationNodeBase); +module.exports = AnimationClipNodeBase; + + +},{"awayjs-core/lib/animators/nodes/AnimationNodeBase":undefined,"awayjs-core/lib/core/geom/Vector3D":undefined}],"awayjs-renderergl/lib/animators/nodes/ParticleAccelerationNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); +var ParticleAccelerationState = require("awayjs-renderergl/lib/animators/states/ParticleAccelerationState"); +/** + * A particle animation node used to apply a constant acceleration vector to the motion of a particle. + */ +var ParticleAccelerationNode = (function (_super) { + __extends(ParticleAccelerationNode, _super); + /** + * Creates a new ParticleAccelerationNode + * + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + * @param [optional] acceleration Defines the default acceleration vector of the node, used when in global mode. + */ + function ParticleAccelerationNode(mode /*uint*/, acceleration) { + if (acceleration === void 0) { acceleration = null; } + _super.call(this, "ParticleAcceleration", mode, 3); + this._pStateClass = ParticleAccelerationState; + this._acceleration = acceleration || new Vector3D(); + } + /** + * @inheritDoc + */ + ParticleAccelerationNode.prototype.pGetAGALVertexCode = function (shaderObject, animationRegisterCache) { + var accelerationValue = (this._pMode == ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + animationRegisterCache.setRegisterIndex(this, ParticleAccelerationState.ACCELERATION_INDEX, accelerationValue.index); + var temp = animationRegisterCache.getFreeVertexVectorTemp(); + animationRegisterCache.addVertexTempUsages(temp, 1); + var code = "mul " + temp + "," + animationRegisterCache.vertexTime + "," + accelerationValue + "\n"; + if (animationRegisterCache.needVelocity) { + var temp2 = animationRegisterCache.getFreeVertexVectorTemp(); + code += "mul " + temp2 + "," + temp + "," + animationRegisterCache.vertexTwoConst + "\n"; + code += "add " + animationRegisterCache.velocityTarget + ".xyz," + temp2 + ".xyz," + animationRegisterCache.velocityTarget + ".xyz\n"; + } + animationRegisterCache.removeVertexTempUsage(temp); + code += "mul " + temp + "," + temp + "," + animationRegisterCache.vertexTime + "\n"; + code += "add " + animationRegisterCache.positionTarget + ".xyz," + temp + "," + animationRegisterCache.positionTarget + ".xyz\n"; + return code; + }; + /** + * @inheritDoc + */ + ParticleAccelerationNode.prototype.getAnimationState = function (animator) { + return animator.getAnimationState(this); + }; + /** + * @inheritDoc + */ + ParticleAccelerationNode.prototype._iGeneratePropertyOfOneParticle = function (param) { + var tempAcceleration = param[ParticleAccelerationNode.ACCELERATION_VECTOR3D]; + if (!tempAcceleration) + throw new Error("there is no " + ParticleAccelerationNode.ACCELERATION_VECTOR3D + " in param!"); + this._pOneData[0] = tempAcceleration.x / 2; + this._pOneData[1] = tempAcceleration.y / 2; + this._pOneData[2] = tempAcceleration.z / 2; + }; + /** + * Reference for acceleration node properties on a single particle (when in local property mode). + * Expects a Vector3D object representing the direction of acceleration on the particle. + */ + ParticleAccelerationNode.ACCELERATION_VECTOR3D = "AccelerationVector3D"; + return ParticleAccelerationNode; +})(ParticleNodeBase); +module.exports = ParticleAccelerationNode; + + +},{"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase":undefined,"awayjs-renderergl/lib/animators/states/ParticleAccelerationState":undefined}],"awayjs-renderergl/lib/animators/nodes/ParticleBezierCurveNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); +var ParticleBezierCurveState = require("awayjs-renderergl/lib/animators/states/ParticleBezierCurveState"); +/** + * A particle animation node used to control the position of a particle over time along a bezier curve. + */ +var ParticleBezierCurveNode = (function (_super) { + __extends(ParticleBezierCurveNode, _super); + /** + * Creates a new ParticleBezierCurveNode + * + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + * @param [optional] controlPoint Defines the default control point of the node, used when in global mode. + * @param [optional] endPoint Defines the default end point of the node, used when in global mode. + */ + function ParticleBezierCurveNode(mode /*uint*/, controlPoint, endPoint) { + if (controlPoint === void 0) { controlPoint = null; } + if (endPoint === void 0) { endPoint = null; } + _super.call(this, "ParticleBezierCurve", mode, 6); + this._pStateClass = ParticleBezierCurveState; + this._iControlPoint = controlPoint || new Vector3D(); + this._iEndPoint = endPoint || new Vector3D(); + } + /** + * @inheritDoc + */ + ParticleBezierCurveNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { + var controlValue = (this._pMode == ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + animationRegisterCache.setRegisterIndex(this, ParticleBezierCurveState.BEZIER_CONTROL_INDEX, controlValue.index); + var endValue = (this._pMode == ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + animationRegisterCache.setRegisterIndex(this, ParticleBezierCurveState.BEZIER_END_INDEX, endValue.index); + var temp = animationRegisterCache.getFreeVertexVectorTemp(); + var rev_time = new ShaderRegisterElement(temp.regName, temp.index, 0); + var time_2 = new ShaderRegisterElement(temp.regName, temp.index, 1); + var time_temp = new ShaderRegisterElement(temp.regName, temp.index, 2); + animationRegisterCache.addVertexTempUsages(temp, 1); + var temp2 = animationRegisterCache.getFreeVertexVectorTemp(); + var distance = new ShaderRegisterElement(temp2.regName, temp2.index); + animationRegisterCache.removeVertexTempUsage(temp); + var code = ""; + code += "sub " + rev_time + "," + animationRegisterCache.vertexOneConst + "," + animationRegisterCache.vertexLife + "\n"; + code += "mul " + time_2 + "," + animationRegisterCache.vertexLife + "," + animationRegisterCache.vertexLife + "\n"; + code += "mul " + time_temp + "," + animationRegisterCache.vertexLife + "," + rev_time + "\n"; + code += "mul " + time_temp + "," + time_temp + "," + animationRegisterCache.vertexTwoConst + "\n"; + code += "mul " + distance + ".xyz," + time_temp + "," + controlValue + "\n"; + code += "add " + animationRegisterCache.positionTarget + ".xyz," + distance + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; + code += "mul " + distance + ".xyz," + time_2 + "," + endValue + "\n"; + code += "add " + animationRegisterCache.positionTarget + ".xyz," + distance + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; + if (animationRegisterCache.needVelocity) { + code += "mul " + time_2 + "," + animationRegisterCache.vertexLife + "," + animationRegisterCache.vertexTwoConst + "\n"; + code += "sub " + time_temp + "," + animationRegisterCache.vertexOneConst + "," + time_2 + "\n"; + code += "mul " + time_temp + "," + animationRegisterCache.vertexTwoConst + "," + time_temp + "\n"; + code += "mul " + distance + ".xyz," + controlValue + "," + time_temp + "\n"; + code += "add " + animationRegisterCache.velocityTarget + ".xyz," + distance + ".xyz," + animationRegisterCache.velocityTarget + ".xyz\n"; + code += "mul " + distance + ".xyz," + endValue + "," + time_2 + "\n"; + code += "add " + animationRegisterCache.velocityTarget + ".xyz," + distance + ".xyz," + animationRegisterCache.velocityTarget + ".xyz\n"; + } + return code; + }; + /** + * @inheritDoc + */ + ParticleBezierCurveNode.prototype.getAnimationState = function (animator) { + return animator.getAnimationState(this); + }; + /** + * @inheritDoc + */ + ParticleBezierCurveNode.prototype._iGeneratePropertyOfOneParticle = function (param) { + var bezierControl = param[ParticleBezierCurveNode.BEZIER_CONTROL_VECTOR3D]; + if (!bezierControl) + throw new Error("there is no " + ParticleBezierCurveNode.BEZIER_CONTROL_VECTOR3D + " in param!"); + var bezierEnd = param[ParticleBezierCurveNode.BEZIER_END_VECTOR3D]; + if (!bezierEnd) + throw new Error("there is no " + ParticleBezierCurveNode.BEZIER_END_VECTOR3D + " in param!"); + this._pOneData[0] = bezierControl.x; + this._pOneData[1] = bezierControl.y; + this._pOneData[2] = bezierControl.z; + this._pOneData[3] = bezierEnd.x; + this._pOneData[4] = bezierEnd.y; + this._pOneData[5] = bezierEnd.z; + }; + /** + * Reference for bezier curve node properties on a single particle (when in local property mode). + * Expects a Vector3D object representing the control point position (0, 1, 2) of the curve. + */ + ParticleBezierCurveNode.BEZIER_CONTROL_VECTOR3D = "BezierControlVector3D"; + /** + * Reference for bezier curve node properties on a single particle (when in local property mode). + * Expects a Vector3D object representing the end point position (0, 1, 2) of the curve. + */ + ParticleBezierCurveNode.BEZIER_END_VECTOR3D = "BezierEndVector3D"; + return ParticleBezierCurveNode; +})(ParticleNodeBase); +module.exports = ParticleBezierCurveNode; + + +},{"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase":undefined,"awayjs-renderergl/lib/animators/states/ParticleBezierCurveState":undefined,"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement":undefined}],"awayjs-renderergl/lib/animators/nodes/ParticleBillboardNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); +var ParticleBillboardState = require("awayjs-renderergl/lib/animators/states/ParticleBillboardState"); +/** + * A particle animation node that controls the rotation of a particle to always face the camera. + */ +var ParticleBillboardNode = (function (_super) { + __extends(ParticleBillboardNode, _super); + /** + * Creates a new ParticleBillboardNode + */ + function ParticleBillboardNode(billboardAxis) { + if (billboardAxis === void 0) { billboardAxis = null; } + _super.call(this, "ParticleBillboard", ParticlePropertiesMode.GLOBAL, 0, 4); + this._pStateClass = ParticleBillboardState; + this._iBillboardAxis = billboardAxis; + } + /** + * @inheritDoc + */ + ParticleBillboardNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { + var rotationMatrixRegister = animationRegisterCache.getFreeVertexConstant(); + animationRegisterCache.setRegisterIndex(this, ParticleBillboardState.MATRIX_INDEX, rotationMatrixRegister.index); + animationRegisterCache.getFreeVertexConstant(); + animationRegisterCache.getFreeVertexConstant(); + animationRegisterCache.getFreeVertexConstant(); + var temp = animationRegisterCache.getFreeVertexVectorTemp(); + var code = "m33 " + temp + ".xyz," + animationRegisterCache.scaleAndRotateTarget + "," + rotationMatrixRegister + "\n" + "mov " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp + "\n"; + var shaderRegisterElement; + for (var i = 0; i < animationRegisterCache.rotationRegisters.length; i++) { + shaderRegisterElement = animationRegisterCache.rotationRegisters[i]; + code += "m33 " + temp + ".xyz," + shaderRegisterElement + "," + rotationMatrixRegister + "\n" + "mov " + shaderRegisterElement + ".xyz," + shaderRegisterElement + "\n"; + } + return code; + }; + /** + * @inheritDoc + */ + ParticleBillboardNode.prototype.getAnimationState = function (animator) { + return animator.getAnimationState(this); + }; + /** + * @inheritDoc + */ + ParticleBillboardNode.prototype._iProcessAnimationSetting = function (particleAnimationSet) { + particleAnimationSet.hasBillboard = true; + }; + return ParticleBillboardNode; +})(ParticleNodeBase); +module.exports = ParticleBillboardNode; + + +},{"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase":undefined,"awayjs-renderergl/lib/animators/states/ParticleBillboardState":undefined}],"awayjs-renderergl/lib/animators/nodes/ParticleColorNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ColorTransform = require("awayjs-core/lib/core/geom/ColorTransform"); +var ParticleAnimationSet = require("awayjs-renderergl/lib/animators/ParticleAnimationSet"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); +var ParticleColorState = require("awayjs-renderergl/lib/animators/states/ParticleColorState"); +/** + * A particle animation node used to control the color variation of a particle over time. + */ +var ParticleColorNode = (function (_super) { + __extends(ParticleColorNode, _super); + /** + * Creates a new ParticleColorNode + * + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + * @param [optional] usesMultiplier Defines whether the node uses multiplier data in the shader for its color transformations. Defaults to true. + * @param [optional] usesOffset Defines whether the node uses offset data in the shader for its color transformations. Defaults to true. + * @param [optional] usesCycle Defines whether the node uses the cycleDuration property in the shader to calculate the period of the animation independent of particle duration. Defaults to false. + * @param [optional] usesPhase Defines whether the node uses the cyclePhase property in the shader to calculate a starting offset to the cycle rotation of the particle. Defaults to false. + * @param [optional] startColor Defines the default start color transform of the node, when in global mode. + * @param [optional] endColor Defines the default end color transform of the node, when in global mode. + * @param [optional] cycleDuration Defines the duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. + * @param [optional] cyclePhase Defines the phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. + */ + function ParticleColorNode(mode /*uint*/, usesMultiplier, usesOffset, usesCycle, usesPhase, startColor, endColor, cycleDuration, cyclePhase) { + if (usesMultiplier === void 0) { usesMultiplier = true; } + if (usesOffset === void 0) { usesOffset = true; } + if (usesCycle === void 0) { usesCycle = false; } + if (usesPhase === void 0) { usesPhase = false; } + if (startColor === void 0) { startColor = null; } + if (endColor === void 0) { endColor = null; } + if (cycleDuration === void 0) { cycleDuration = 1; } + if (cyclePhase === void 0) { cyclePhase = 0; } + _super.call(this, "ParticleColor", mode, (usesMultiplier && usesOffset) ? 16 : 8, ParticleAnimationSet.COLOR_PRIORITY); + this._pStateClass = ParticleColorState; + this._iUsesMultiplier = usesMultiplier; + this._iUsesOffset = usesOffset; + this._iUsesCycle = usesCycle; + this._iUsesPhase = usesPhase; + this._iStartColor = startColor || new ColorTransform(); + this._iEndColor = endColor || new ColorTransform(); + this._iCycleDuration = cycleDuration; + this._iCyclePhase = cyclePhase; + } + /** + * @inheritDoc + */ + ParticleColorNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { + var code = ""; + if (animationRegisterCache.needFragmentAnimation) { + var temp = animationRegisterCache.getFreeVertexVectorTemp(); + if (this._iUsesCycle) { + var cycleConst = animationRegisterCache.getFreeVertexConstant(); + animationRegisterCache.setRegisterIndex(this, ParticleColorState.CYCLE_INDEX, cycleConst.index); + animationRegisterCache.addVertexTempUsages(temp, 1); + var sin = animationRegisterCache.getFreeVertexSingleTemp(); + animationRegisterCache.removeVertexTempUsage(temp); + code += "mul " + sin + "," + animationRegisterCache.vertexTime + "," + cycleConst + ".x\n"; + if (this._iUsesPhase) + code += "add " + sin + "," + sin + "," + cycleConst + ".y\n"; + code += "sin " + sin + "," + sin + "\n"; + } + if (this._iUsesMultiplier) { + var startMultiplierValue = (this._pMode == ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + var deltaMultiplierValue = (this._pMode == ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + animationRegisterCache.setRegisterIndex(this, ParticleColorState.START_MULTIPLIER_INDEX, startMultiplierValue.index); + animationRegisterCache.setRegisterIndex(this, ParticleColorState.DELTA_MULTIPLIER_INDEX, deltaMultiplierValue.index); + code += "mul " + temp + "," + deltaMultiplierValue + "," + (this._iUsesCycle ? sin : animationRegisterCache.vertexLife) + "\n"; + code += "add " + temp + "," + temp + "," + startMultiplierValue + "\n"; + code += "mul " + animationRegisterCache.colorMulTarget + "," + temp + "," + animationRegisterCache.colorMulTarget + "\n"; + } + if (this._iUsesOffset) { + var startOffsetValue = (this._pMode == ParticlePropertiesMode.LOCAL_STATIC) ? animationRegisterCache.getFreeVertexAttribute() : animationRegisterCache.getFreeVertexConstant(); + var deltaOffsetValue = (this._pMode == ParticlePropertiesMode.LOCAL_STATIC) ? animationRegisterCache.getFreeVertexAttribute() : animationRegisterCache.getFreeVertexConstant(); + animationRegisterCache.setRegisterIndex(this, ParticleColorState.START_OFFSET_INDEX, startOffsetValue.index); + animationRegisterCache.setRegisterIndex(this, ParticleColorState.DELTA_OFFSET_INDEX, deltaOffsetValue.index); + code += "mul " + temp + "," + deltaOffsetValue + "," + (this._iUsesCycle ? sin : animationRegisterCache.vertexLife) + "\n"; + code += "add " + temp + "," + temp + "," + startOffsetValue + "\n"; + code += "add " + animationRegisterCache.colorAddTarget + "," + temp + "," + animationRegisterCache.colorAddTarget + "\n"; + } + } + return code; + }; + /** + * @inheritDoc + */ + ParticleColorNode.prototype.getAnimationState = function (animator) { + return animator.getAnimationState(this); + }; + /** + * @inheritDoc + */ + ParticleColorNode.prototype._iProcessAnimationSetting = function (particleAnimationSet) { + if (this._iUsesMultiplier) + particleAnimationSet.hasColorMulNode = true; + if (this._iUsesOffset) + particleAnimationSet.hasColorAddNode = true; + }; + /** + * @inheritDoc + */ + ParticleColorNode.prototype._iGeneratePropertyOfOneParticle = function (param) { + var startColor = param[ParticleColorNode.COLOR_START_COLORTRANSFORM]; + if (!startColor) + throw (new Error("there is no " + ParticleColorNode.COLOR_START_COLORTRANSFORM + " in param!")); + var endColor = param[ParticleColorNode.COLOR_END_COLORTRANSFORM]; + if (!endColor) + throw (new Error("there is no " + ParticleColorNode.COLOR_END_COLORTRANSFORM + " in param!")); + var i = 0; + if (!this._iUsesCycle) { + //multiplier + if (this._iUsesMultiplier) { + this._pOneData[i++] = startColor.redMultiplier; + this._pOneData[i++] = startColor.greenMultiplier; + this._pOneData[i++] = startColor.blueMultiplier; + this._pOneData[i++] = startColor.alphaMultiplier; + this._pOneData[i++] = endColor.redMultiplier - startColor.redMultiplier; + this._pOneData[i++] = endColor.greenMultiplier - startColor.greenMultiplier; + this._pOneData[i++] = endColor.blueMultiplier - startColor.blueMultiplier; + this._pOneData[i++] = endColor.alphaMultiplier - startColor.alphaMultiplier; + } + //offset + if (this._iUsesOffset) { + this._pOneData[i++] = startColor.redOffset / 255; + this._pOneData[i++] = startColor.greenOffset / 255; + this._pOneData[i++] = startColor.blueOffset / 255; + this._pOneData[i++] = startColor.alphaOffset / 255; + this._pOneData[i++] = (endColor.redOffset - startColor.redOffset) / 255; + this._pOneData[i++] = (endColor.greenOffset - startColor.greenOffset) / 255; + this._pOneData[i++] = (endColor.blueOffset - startColor.blueOffset) / 255; + this._pOneData[i++] = (endColor.alphaOffset - startColor.alphaOffset) / 255; + } + } + else { + //multiplier + if (this._iUsesMultiplier) { + this._pOneData[i++] = (startColor.redMultiplier + endColor.redMultiplier) / 2; + this._pOneData[i++] = (startColor.greenMultiplier + endColor.greenMultiplier) / 2; + this._pOneData[i++] = (startColor.blueMultiplier + endColor.blueMultiplier) / 2; + this._pOneData[i++] = (startColor.alphaMultiplier + endColor.alphaMultiplier) / 2; + this._pOneData[i++] = (startColor.redMultiplier - endColor.redMultiplier) / 2; + this._pOneData[i++] = (startColor.greenMultiplier - endColor.greenMultiplier) / 2; + this._pOneData[i++] = (startColor.blueMultiplier - endColor.blueMultiplier) / 2; + this._pOneData[i++] = (startColor.alphaMultiplier - endColor.alphaMultiplier) / 2; + } + //offset + if (this._iUsesOffset) { + this._pOneData[i++] = (startColor.redOffset + endColor.redOffset) / (255 * 2); + this._pOneData[i++] = (startColor.greenOffset + endColor.greenOffset) / (255 * 2); + this._pOneData[i++] = (startColor.blueOffset + endColor.blueOffset) / (255 * 2); + this._pOneData[i++] = (startColor.alphaOffset + endColor.alphaOffset) / (255 * 2); + this._pOneData[i++] = (startColor.redOffset - endColor.redOffset) / (255 * 2); + this._pOneData[i++] = (startColor.greenOffset - endColor.greenOffset) / (255 * 2); + this._pOneData[i++] = (startColor.blueOffset - endColor.blueOffset) / (255 * 2); + this._pOneData[i++] = (startColor.alphaOffset - endColor.alphaOffset) / (255 * 2); + } + } + }; + /** + * Reference for color node properties on a single particle (when in local property mode). + * Expects a ColorTransform object representing the start color transform applied to the particle. + */ + ParticleColorNode.COLOR_START_COLORTRANSFORM = "ColorStartColorTransform"; + /** + * Reference for color node properties on a single particle (when in local property mode). + * Expects a ColorTransform object representing the end color transform applied to the particle. + */ + ParticleColorNode.COLOR_END_COLORTRANSFORM = "ColorEndColorTransform"; + return ParticleColorNode; +})(ParticleNodeBase); +module.exports = ParticleColorNode; + + +},{"awayjs-core/lib/core/geom/ColorTransform":undefined,"awayjs-renderergl/lib/animators/ParticleAnimationSet":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase":undefined,"awayjs-renderergl/lib/animators/states/ParticleColorState":undefined}],"awayjs-renderergl/lib/animators/nodes/ParticleFollowNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ParticleAnimationSet = require("awayjs-renderergl/lib/animators/ParticleAnimationSet"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); +var ParticleFollowState = require("awayjs-renderergl/lib/animators/states/ParticleFollowState"); +/** + * A particle animation node used to create a follow behaviour on a particle system. + */ +var ParticleFollowNode = (function (_super) { + __extends(ParticleFollowNode, _super); + /** + * Creates a new ParticleFollowNode + * + * @param [optional] usesPosition Defines wehether the individual particle reacts to the position of the target. + * @param [optional] usesRotation Defines wehether the individual particle reacts to the rotation of the target. + * @param [optional] smooth Defines wehether the state calculate the interpolated value. + */ + function ParticleFollowNode(usesPosition, usesRotation, smooth) { + if (usesPosition === void 0) { usesPosition = true; } + if (usesRotation === void 0) { usesRotation = true; } + if (smooth === void 0) { smooth = false; } + _super.call(this, "ParticleFollow", ParticlePropertiesMode.LOCAL_DYNAMIC, (usesPosition && usesRotation) ? 6 : 3, ParticleAnimationSet.POST_PRIORITY); + this._pStateClass = ParticleFollowState; + this._iUsesPosition = usesPosition; + this._iUsesRotation = usesRotation; + this._iSmooth = smooth; + } + /** + * @inheritDoc + */ + ParticleFollowNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { + //TODO: use Quaternion to implement this function + var code = ""; + if (this._iUsesRotation) { + var rotationAttribute = animationRegisterCache.getFreeVertexAttribute(); + animationRegisterCache.setRegisterIndex(this, ParticleFollowState.FOLLOW_ROTATION_INDEX, rotationAttribute.index); + var temp1 = animationRegisterCache.getFreeVertexVectorTemp(); + animationRegisterCache.addVertexTempUsages(temp1, 1); + var temp2 = animationRegisterCache.getFreeVertexVectorTemp(); + animationRegisterCache.addVertexTempUsages(temp2, 1); + var temp3 = animationRegisterCache.getFreeVertexVectorTemp(); + var temp4; + if (animationRegisterCache.hasBillboard) { + animationRegisterCache.addVertexTempUsages(temp3, 1); + temp4 = animationRegisterCache.getFreeVertexVectorTemp(); + } + animationRegisterCache.removeVertexTempUsage(temp1); + animationRegisterCache.removeVertexTempUsage(temp2); + if (animationRegisterCache.hasBillboard) + animationRegisterCache.removeVertexTempUsage(temp3); + var len = animationRegisterCache.rotationRegisters.length; + var i /*int*/; + //x axis + code += "mov " + temp1 + "," + animationRegisterCache.vertexZeroConst + "\n"; + code += "mov " + temp1 + ".x," + animationRegisterCache.vertexOneConst + "\n"; + code += "mov " + temp3 + "," + animationRegisterCache.vertexZeroConst + "\n"; + code += "sin " + temp3 + ".y," + rotationAttribute + ".x\n"; + code += "cos " + temp3 + ".z," + rotationAttribute + ".x\n"; + code += "mov " + temp2 + ".x," + animationRegisterCache.vertexZeroConst + "\n"; + code += "mov " + temp2 + ".y," + temp3 + ".z\n"; + code += "neg " + temp2 + ".z," + temp3 + ".y\n"; + if (animationRegisterCache.hasBillboard) + code += "m33 " + temp4 + ".xyz," + animationRegisterCache.positionTarget + ".xyz," + temp1 + "\n"; + else { + code += "m33 " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp1 + "\n"; + for (i = 0; i < len; i++) + code += "m33 " + animationRegisterCache.rotationRegisters[i] + ".xyz," + animationRegisterCache.rotationRegisters[i] + "," + temp1 + "\n"; + } + //y axis + code += "mov " + temp1 + "," + animationRegisterCache.vertexZeroConst + "\n"; + code += "cos " + temp1 + ".x," + rotationAttribute + ".y\n"; + code += "sin " + temp1 + ".z," + rotationAttribute + ".y\n"; + code += "mov " + temp2 + "," + animationRegisterCache.vertexZeroConst + "\n"; + code += "mov " + temp2 + ".y," + animationRegisterCache.vertexOneConst + "\n"; + code += "mov " + temp3 + "," + animationRegisterCache.vertexZeroConst + "\n"; + code += "neg " + temp3 + ".x," + temp1 + ".z\n"; + code += "mov " + temp3 + ".z," + temp1 + ".x\n"; + if (animationRegisterCache.hasBillboard) + code += "m33 " + temp4 + ".xyz," + temp4 + ".xyz," + temp1 + "\n"; + else { + code += "m33 " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp1 + "\n"; + for (i = 0; i < len; i++) + code += "m33 " + animationRegisterCache.rotationRegisters[i] + ".xyz," + animationRegisterCache.rotationRegisters[i] + "," + temp1 + "\n"; + } + //z axis + code += "mov " + temp2 + "," + animationRegisterCache.vertexZeroConst + "\n"; + code += "sin " + temp2 + ".x," + rotationAttribute + ".z\n"; + code += "cos " + temp2 + ".y," + rotationAttribute + ".z\n"; + code += "mov " + temp1 + "," + animationRegisterCache.vertexZeroConst + "\n"; + code += "mov " + temp1 + ".x," + temp2 + ".y\n"; + code += "neg " + temp1 + ".y," + temp2 + ".x\n"; + code += "mov " + temp3 + "," + animationRegisterCache.vertexZeroConst + "\n"; + code += "mov " + temp3 + ".z," + animationRegisterCache.vertexOneConst + "\n"; + if (animationRegisterCache.hasBillboard) { + code += "m33 " + temp4 + ".xyz," + temp4 + ".xyz," + temp1 + "\n"; + code += "sub " + temp4 + ".xyz," + temp4 + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; + code += "add " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp4 + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; + } + else { + code += "m33 " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp1 + "\n"; + for (i = 0; i < len; i++) + code += "m33 " + animationRegisterCache.rotationRegisters[i] + ".xyz," + animationRegisterCache.rotationRegisters[i] + "," + temp1 + "\n"; + } + } + if (this._iUsesPosition) { + var positionAttribute = animationRegisterCache.getFreeVertexAttribute(); + animationRegisterCache.setRegisterIndex(this, ParticleFollowState.FOLLOW_POSITION_INDEX, positionAttribute.index); + code += "add " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + positionAttribute + "," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; + } + return code; + }; + /** + * @inheritDoc + */ + ParticleFollowNode.prototype.getAnimationState = function (animator) { + return animator.getAnimationState(this); + }; + return ParticleFollowNode; +})(ParticleNodeBase); +module.exports = ParticleFollowNode; + + +},{"awayjs-renderergl/lib/animators/ParticleAnimationSet":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase":undefined,"awayjs-renderergl/lib/animators/states/ParticleFollowState":undefined}],"awayjs-renderergl/lib/animators/nodes/ParticleInitialColorNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ColorTransform = require("awayjs-core/lib/core/geom/ColorTransform"); +var ParticleAnimationSet = require("awayjs-renderergl/lib/animators/ParticleAnimationSet"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); +var ParticleInitialColorState = require("awayjs-renderergl/lib/animators/states/ParticleInitialColorState"); +/** + * + */ +var ParticleInitialColorNode = (function (_super) { + __extends(ParticleInitialColorNode, _super); + function ParticleInitialColorNode(mode /*uint*/, usesMultiplier, usesOffset, initialColor) { + if (usesMultiplier === void 0) { usesMultiplier = true; } + if (usesOffset === void 0) { usesOffset = false; } + if (initialColor === void 0) { initialColor = null; } + _super.call(this, "ParticleInitialColor", mode, (usesMultiplier && usesOffset) ? 8 : 4, ParticleAnimationSet.COLOR_PRIORITY); + this._pStateClass = ParticleInitialColorState; + this._iUsesMultiplier = usesMultiplier; + this._iUsesOffset = usesOffset; + this._iInitialColor = initialColor || new ColorTransform(); + } + /** + * @inheritDoc + */ + ParticleInitialColorNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { + var code = ""; + if (animationRegisterCache.needFragmentAnimation) { + if (this._iUsesMultiplier) { + var multiplierValue = (this._pMode == ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + animationRegisterCache.setRegisterIndex(this, ParticleInitialColorState.MULTIPLIER_INDEX, multiplierValue.index); + code += "mul " + animationRegisterCache.colorMulTarget + "," + multiplierValue + "," + animationRegisterCache.colorMulTarget + "\n"; + } + if (this._iUsesOffset) { + var offsetValue = (this._pMode == ParticlePropertiesMode.LOCAL_STATIC) ? animationRegisterCache.getFreeVertexAttribute() : animationRegisterCache.getFreeVertexConstant(); + animationRegisterCache.setRegisterIndex(this, ParticleInitialColorState.OFFSET_INDEX, offsetValue.index); + code += "add " + animationRegisterCache.colorAddTarget + "," + offsetValue + "," + animationRegisterCache.colorAddTarget + "\n"; + } + } + return code; + }; + /** + * @inheritDoc + */ + ParticleInitialColorNode.prototype._iProcessAnimationSetting = function (particleAnimationSet) { + if (this._iUsesMultiplier) + particleAnimationSet.hasColorMulNode = true; + if (this._iUsesOffset) + particleAnimationSet.hasColorAddNode = true; + }; + /** + * @inheritDoc + */ + ParticleInitialColorNode.prototype._iGeneratePropertyOfOneParticle = function (param) { + var initialColor = param[ParticleInitialColorNode.COLOR_INITIAL_COLORTRANSFORM]; + if (!initialColor) + throw (new Error("there is no " + ParticleInitialColorNode.COLOR_INITIAL_COLORTRANSFORM + " in param!")); + var i = 0; + //multiplier + if (this._iUsesMultiplier) { + this._pOneData[i++] = initialColor.redMultiplier; + this._pOneData[i++] = initialColor.greenMultiplier; + this._pOneData[i++] = initialColor.blueMultiplier; + this._pOneData[i++] = initialColor.alphaMultiplier; + } + //offset + if (this._iUsesOffset) { + this._pOneData[i++] = initialColor.redOffset / 255; + this._pOneData[i++] = initialColor.greenOffset / 255; + this._pOneData[i++] = initialColor.blueOffset / 255; + this._pOneData[i++] = initialColor.alphaOffset / 255; + } + }; + /** + * Reference for color node properties on a single particle (when in local property mode). + * Expects a ColorTransform object representing the color transform applied to the particle. + */ + ParticleInitialColorNode.COLOR_INITIAL_COLORTRANSFORM = "ColorInitialColorTransform"; + return ParticleInitialColorNode; +})(ParticleNodeBase); +module.exports = ParticleInitialColorNode; + + +},{"awayjs-core/lib/core/geom/ColorTransform":undefined,"awayjs-renderergl/lib/animators/ParticleAnimationSet":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase":undefined,"awayjs-renderergl/lib/animators/states/ParticleInitialColorState":undefined}],"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var AnimationNodeBase = require("awayjs-core/lib/animators/nodes/AnimationNodeBase"); +/** + * Provides an abstract base class for particle animation nodes. + */ +var ParticleNodeBase = (function (_super) { + __extends(ParticleNodeBase, _super); + /** + * Creates a new ParticleNodeBase object. + * + * @param name Defines the generic name of the particle animation node. + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + * @param dataLength Defines the length of the data used by the node when in LOCAL_STATIC mode. + * @param [optional] priority the priority of the particle animation node, used to order the agal generated in a particle animation set. Defaults to 1. + */ + function ParticleNodeBase(name, mode /*uint*/, dataLength /*uint*/, priority) { + if (priority === void 0) { priority = 1; } + _super.call(this); + this._pDataLength = 3; + name = name + ParticleNodeBase.MODES[mode]; + this.name = name; + this._pMode = mode; + this._priority = priority; + this._pDataLength = dataLength; + this._pOneData = new Array(this._pDataLength); + } + Object.defineProperty(ParticleNodeBase.prototype, "mode", { + /** + * Returns the property mode of the particle animation node. Typically set in the node constructor + * + * @see away.animators.ParticlePropertiesMode + */ + get: function () { + return this._pMode; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleNodeBase.prototype, "priority", { + /** + * Returns the priority of the particle animation node, used to order the agal generated in a particle animation set. Set automatically on instantiation. + * + * @see away.animators.ParticleAnimationSet + * @see #getAGALVertexCode + */ + get: function () { + return this._priority; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleNodeBase.prototype, "dataLength", { + /** + * Returns the length of the data used by the node when in LOCAL_STATIC mode. Used to generate the local static data of the particle animation set. + * + * @see away.animators.ParticleAnimationSet + * @see #getAGALVertexCode + */ + get: function () { + return this._pDataLength; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleNodeBase.prototype, "oneData", { + /** + * Returns the generated data vector of the node after one particle pass during the generation of all local static data of the particle animation set. + * + * @see away.animators.ParticleAnimationSet + * @see #generatePropertyOfOneParticle + */ + get: function () { + return this._pOneData; + }, + enumerable: true, + configurable: true + }); + /** + * Returns the AGAL code of the particle animation node for use in the vertex shader. + */ + ParticleNodeBase.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { + return ""; + }; + /** + * Returns the AGAL code of the particle animation node for use in the fragment shader. + */ + ParticleNodeBase.prototype.getAGALFragmentCode = function (shaderObject, animationRegisterCache) { + return ""; + }; + /** + * Returns the AGAL code of the particle animation node for use in the fragment shader when UV coordinates are required. + */ + ParticleNodeBase.prototype.getAGALUVCode = function (shaderObject, animationRegisterCache) { + return ""; + }; + /** + * Called internally by the particle animation set when assigning the set of static properties originally defined by the initParticleFunc of the set. + * + * @see away.animators.ParticleAnimationSet#initParticleFunc + */ + ParticleNodeBase.prototype._iGeneratePropertyOfOneParticle = function (param) { + }; + /** + * Called internally by the particle animation set when determining the requirements of the particle animation node AGAL. + */ + ParticleNodeBase.prototype._iProcessAnimationSetting = function (particleAnimationSet) { + }; + //modes alias + ParticleNodeBase.GLOBAL = 'Global'; + ParticleNodeBase.LOCAL_STATIC = 'LocalStatic'; + ParticleNodeBase.LOCAL_DYNAMIC = 'LocalDynamic'; + //modes list + ParticleNodeBase.MODES = { + 0: ParticleNodeBase.GLOBAL, + 1: ParticleNodeBase.LOCAL_STATIC, + 2: ParticleNodeBase.LOCAL_DYNAMIC + }; + return ParticleNodeBase; +})(AnimationNodeBase); +module.exports = ParticleNodeBase; + + +},{"awayjs-core/lib/animators/nodes/AnimationNodeBase":undefined}],"awayjs-renderergl/lib/animators/nodes/ParticleOrbitNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); +var ParticleOrbitState = require("awayjs-renderergl/lib/animators/states/ParticleOrbitState"); +/** + * A particle animation node used to control the position of a particle over time around a circular orbit. + */ +var ParticleOrbitNode = (function (_super) { + __extends(ParticleOrbitNode, _super); + /** + * Creates a new ParticleOrbitNode object. + * + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + * @param [optional] usesEulers Defines whether the node uses the eulers property in the shader to calculate a rotation on the orbit. Defaults to true. + * @param [optional] usesCycle Defines whether the node uses the cycleDuration property in the shader to calculate the period of the orbit independent of particle duration. Defaults to false. + * @param [optional] usesPhase Defines whether the node uses the cyclePhase property in the shader to calculate a starting offset to the cycle rotation of the particle. Defaults to false. + * @param [optional] radius Defines the radius of the orbit when in global mode. Defaults to 100. + * @param [optional] cycleDuration Defines the duration of the orbit in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. + * @param [optional] cyclePhase Defines the phase of the orbit in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. + * @param [optional] eulers Defines the euler rotation in degrees, applied to the orientation of the orbit when in global mode. + */ + function ParticleOrbitNode(mode /*uint*/, usesEulers, usesCycle, usesPhase, radius, cycleDuration, cyclePhase, eulers) { + if (usesEulers === void 0) { usesEulers = true; } + if (usesCycle === void 0) { usesCycle = false; } + if (usesPhase === void 0) { usesPhase = false; } + if (radius === void 0) { radius = 100; } + if (cycleDuration === void 0) { cycleDuration = 1; } + if (cyclePhase === void 0) { cyclePhase = 0; } + if (eulers === void 0) { eulers = null; } + var len = 3; + if (usesPhase) + len++; + _super.call(this, "ParticleOrbit", mode, len); + this._pStateClass = ParticleOrbitState; + this._iUsesEulers = usesEulers; + this._iUsesCycle = usesCycle; + this._iUsesPhase = usesPhase; + this._iRadius = radius; + this._iCycleDuration = cycleDuration; + this._iCyclePhase = cyclePhase; + this._iEulers = eulers || new Vector3D(); + } + /** + * @inheritDoc + */ + ParticleOrbitNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { + var orbitRegister = (this._pMode == ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + animationRegisterCache.setRegisterIndex(this, ParticleOrbitState.ORBIT_INDEX, orbitRegister.index); + var eulersMatrixRegister = animationRegisterCache.getFreeVertexConstant(); + animationRegisterCache.setRegisterIndex(this, ParticleOrbitState.EULERS_INDEX, eulersMatrixRegister.index); + animationRegisterCache.getFreeVertexConstant(); + animationRegisterCache.getFreeVertexConstant(); + animationRegisterCache.getFreeVertexConstant(); + var temp1 = animationRegisterCache.getFreeVertexVectorTemp(); + animationRegisterCache.addVertexTempUsages(temp1, 1); + var distance = new ShaderRegisterElement(temp1.regName, temp1.index); + var temp2 = animationRegisterCache.getFreeVertexVectorTemp(); + var cos = new ShaderRegisterElement(temp2.regName, temp2.index, 0); + var sin = new ShaderRegisterElement(temp2.regName, temp2.index, 1); + var degree = new ShaderRegisterElement(temp2.regName, temp2.index, 2); + animationRegisterCache.removeVertexTempUsage(temp1); + var code = ""; + if (this._iUsesCycle) { + code += "mul " + degree + "," + animationRegisterCache.vertexTime + "," + orbitRegister + ".y\n"; + if (this._iUsesPhase) + code += "add " + degree + "," + degree + "," + orbitRegister + ".w\n"; + } + else + code += "mul " + degree + "," + animationRegisterCache.vertexLife + "," + orbitRegister + ".y\n"; + code += "cos " + cos + "," + degree + "\n"; + code += "sin " + sin + "," + degree + "\n"; + code += "mul " + distance + ".x," + cos + "," + orbitRegister + ".x\n"; + code += "mul " + distance + ".y," + sin + "," + orbitRegister + ".x\n"; + code += "mov " + distance + ".wz" + animationRegisterCache.vertexZeroConst + "\n"; + if (this._iUsesEulers) + code += "m44 " + distance + "," + distance + "," + eulersMatrixRegister + "\n"; + code += "add " + animationRegisterCache.positionTarget + ".xyz," + distance + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; + if (animationRegisterCache.needVelocity) { + code += "neg " + distance + ".x," + sin + "\n"; + code += "mov " + distance + ".y," + cos + "\n"; + code += "mov " + distance + ".zw," + animationRegisterCache.vertexZeroConst + "\n"; + if (this._iUsesEulers) + code += "m44 " + distance + "," + distance + "," + eulersMatrixRegister + "\n"; + code += "mul " + distance + "," + distance + "," + orbitRegister + ".z\n"; + code += "div " + distance + "," + distance + "," + orbitRegister + ".y\n"; + if (!this._iUsesCycle) + code += "div " + distance + "," + distance + "," + animationRegisterCache.vertexLife + "\n"; + code += "add " + animationRegisterCache.velocityTarget + ".xyz," + animationRegisterCache.velocityTarget + ".xyz," + distance + ".xyz\n"; + } + return code; + }; + /** + * @inheritDoc + */ + ParticleOrbitNode.prototype.getAnimationState = function (animator) { + return animator.getAnimationState(this); + }; + /** + * @inheritDoc + */ + ParticleOrbitNode.prototype._iGeneratePropertyOfOneParticle = function (param) { + //Vector3D.x is radius, Vector3D.y is cycle duration, Vector3D.z is phase + var orbit = param[ParticleOrbitNode.ORBIT_VECTOR3D]; + if (!orbit) + throw new Error("there is no " + ParticleOrbitNode.ORBIT_VECTOR3D + " in param!"); + this._pOneData[0] = orbit.x; + if (this._iUsesCycle && orbit.y <= 0) + throw (new Error("the cycle duration must be greater than zero")); + this._pOneData[1] = Math.PI * 2 / (!this._iUsesCycle ? 1 : orbit.y); + this._pOneData[2] = orbit.x * Math.PI * 2; + if (this._iUsesPhase) + this._pOneData[3] = orbit.z * Math.PI / 180; + }; + /** + * Reference for orbit node properties on a single particle (when in local property mode). + * Expects a Vector3D object representing the radius (x), cycle speed (y) and cycle phase (z) of the motion on the particle. + */ + ParticleOrbitNode.ORBIT_VECTOR3D = "OrbitVector3D"; + return ParticleOrbitNode; +})(ParticleNodeBase); +module.exports = ParticleOrbitNode; + + +},{"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase":undefined,"awayjs-renderergl/lib/animators/states/ParticleOrbitState":undefined,"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement":undefined}],"awayjs-renderergl/lib/animators/nodes/ParticleOscillatorNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); +var ParticleOscillatorState = require("awayjs-renderergl/lib/animators/states/ParticleOscillatorState"); +/** + * A particle animation node used to control the position of a particle over time using simple harmonic motion. + */ +var ParticleOscillatorNode = (function (_super) { + __extends(ParticleOscillatorNode, _super); + /** + * Creates a new ParticleOscillatorNode + * + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + * @param [optional] oscillator Defines the default oscillator axis (x, y, z) and cycleDuration (w) of the node, used when in global mode. + */ + function ParticleOscillatorNode(mode /*uint*/, oscillator) { + if (oscillator === void 0) { oscillator = null; } + _super.call(this, "ParticleOscillator", mode, 4); + this._pStateClass = ParticleOscillatorState; + this._iOscillator = oscillator || new Vector3D(); + } + /** + * @inheritDoc + */ + ParticleOscillatorNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { + var oscillatorRegister = (this._pMode == ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + animationRegisterCache.setRegisterIndex(this, ParticleOscillatorState.OSCILLATOR_INDEX, oscillatorRegister.index); + var temp = animationRegisterCache.getFreeVertexVectorTemp(); + var dgree = new ShaderRegisterElement(temp.regName, temp.index, 0); + var sin = new ShaderRegisterElement(temp.regName, temp.index, 1); + var cos = new ShaderRegisterElement(temp.regName, temp.index, 2); + animationRegisterCache.addVertexTempUsages(temp, 1); + var temp2 = animationRegisterCache.getFreeVertexVectorTemp(); + var distance = new ShaderRegisterElement(temp2.regName, temp2.index); + animationRegisterCache.removeVertexTempUsage(temp); + var code = ""; + code += "mul " + dgree + "," + animationRegisterCache.vertexTime + "," + oscillatorRegister + ".w\n"; + code += "sin " + sin + "," + dgree + "\n"; + code += "mul " + distance + ".xyz," + sin + "," + oscillatorRegister + ".xyz\n"; + code += "add " + animationRegisterCache.positionTarget + ".xyz," + distance + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; + if (animationRegisterCache.needVelocity) { + code += "cos " + cos + "," + dgree + "\n"; + code += "mul " + distance + ".xyz," + cos + "," + oscillatorRegister + ".xyz\n"; + code += "add " + animationRegisterCache.velocityTarget + ".xyz," + distance + ".xyz," + animationRegisterCache.velocityTarget + ".xyz\n"; + } + return code; + }; + /** + * @inheritDoc + */ + ParticleOscillatorNode.prototype.getAnimationState = function (animator) { + return animator.getAnimationState(this); + }; + /** + * @inheritDoc + */ + ParticleOscillatorNode.prototype._iGeneratePropertyOfOneParticle = function (param) { + //(Vector3D.x,Vector3D.y,Vector3D.z) is oscillator axis, Vector3D.w is oscillator cycle duration + var drift = param[ParticleOscillatorNode.OSCILLATOR_VECTOR3D]; + if (!drift) + throw (new Error("there is no " + ParticleOscillatorNode.OSCILLATOR_VECTOR3D + " in param!")); + this._pOneData[0] = drift.x; + this._pOneData[1] = drift.y; + this._pOneData[2] = drift.z; + if (drift.w <= 0) + throw (new Error("the cycle duration must greater than zero")); + this._pOneData[3] = Math.PI * 2 / drift.w; + }; + /** + * Reference for ocsillator node properties on a single particle (when in local property mode). + * Expects a Vector3D object representing the axis (x,y,z) and cycle speed (w) of the motion on the particle. + */ + ParticleOscillatorNode.OSCILLATOR_VECTOR3D = "OscillatorVector3D"; + return ParticleOscillatorNode; +})(ParticleNodeBase); +module.exports = ParticleOscillatorNode; + + +},{"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase":undefined,"awayjs-renderergl/lib/animators/states/ParticleOscillatorState":undefined,"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement":undefined}],"awayjs-renderergl/lib/animators/nodes/ParticlePositionNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); +var ParticlePositionState = require("awayjs-renderergl/lib/animators/states/ParticlePositionState"); +/** + * A particle animation node used to set the starting position of a particle. + */ +var ParticlePositionNode = (function (_super) { + __extends(ParticlePositionNode, _super); + /** + * Creates a new ParticlePositionNode + * + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + * @param [optional] position Defines the default position of the particle when in global mode. Defaults to 0,0,0. + */ + function ParticlePositionNode(mode /*uint*/, position) { + if (position === void 0) { position = null; } + _super.call(this, "ParticlePosition", mode, 3); + this._pStateClass = ParticlePositionState; + this._iPosition = position || new Vector3D(); + } + /** + * @inheritDoc + */ + ParticlePositionNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { + var positionAttribute = (this._pMode == ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + animationRegisterCache.setRegisterIndex(this, ParticlePositionState.POSITION_INDEX, positionAttribute.index); + return "add " + animationRegisterCache.positionTarget + ".xyz," + positionAttribute + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; + }; + /** + * @inheritDoc + */ + ParticlePositionNode.prototype.getAnimationState = function (animator) { + return animator.getAnimationState(this); + }; + /** + * @inheritDoc + */ + ParticlePositionNode.prototype._iGeneratePropertyOfOneParticle = function (param) { + var offset = param[ParticlePositionNode.POSITION_VECTOR3D]; + if (!offset) + throw (new Error("there is no " + ParticlePositionNode.POSITION_VECTOR3D + " in param!")); + this._pOneData[0] = offset.x; + this._pOneData[1] = offset.y; + this._pOneData[2] = offset.z; + }; + /** + * Reference for position node properties on a single particle (when in local property mode). + * Expects a Vector3D object representing position of the particle. + */ + ParticlePositionNode.POSITION_VECTOR3D = "PositionVector3D"; + return ParticlePositionNode; +})(ParticleNodeBase); +module.exports = ParticlePositionNode; + + +},{"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase":undefined,"awayjs-renderergl/lib/animators/states/ParticlePositionState":undefined}],"awayjs-renderergl/lib/animators/nodes/ParticleRotateToHeadingNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); +var ParticleRotateToHeadingState = require("awayjs-renderergl/lib/animators/states/ParticleRotateToHeadingState"); +/** + * A particle animation node used to control the rotation of a particle to match its heading vector. + */ +var ParticleRotateToHeadingNode = (function (_super) { + __extends(ParticleRotateToHeadingNode, _super); + /** + * Creates a new ParticleBillboardNode + */ + function ParticleRotateToHeadingNode() { + _super.call(this, "ParticleRotateToHeading", ParticlePropertiesMode.GLOBAL, 0, 3); + this._pStateClass = ParticleRotateToHeadingState; + } + /** + * @inheritDoc + */ + ParticleRotateToHeadingNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { + var code = ""; + var len = animationRegisterCache.rotationRegisters.length; + var i /*int*/; + if (animationRegisterCache.hasBillboard) { + var temp1 = animationRegisterCache.getFreeVertexVectorTemp(); + animationRegisterCache.addVertexTempUsages(temp1, 1); + var temp2 = animationRegisterCache.getFreeVertexVectorTemp(); + animationRegisterCache.addVertexTempUsages(temp2, 1); + var temp3 = animationRegisterCache.getFreeVertexVectorTemp(); + var rotationMatrixRegister = animationRegisterCache.getFreeVertexConstant(); + animationRegisterCache.setRegisterIndex(this, ParticleRotateToHeadingState.MATRIX_INDEX, rotationMatrixRegister.index); + animationRegisterCache.getFreeVertexConstant(); + animationRegisterCache.getFreeVertexConstant(); + animationRegisterCache.getFreeVertexConstant(); + animationRegisterCache.removeVertexTempUsage(temp1); + animationRegisterCache.removeVertexTempUsage(temp2); + //process the velocity + code += "m33 " + temp1 + ".xyz," + animationRegisterCache.velocityTarget + ".xyz," + rotationMatrixRegister + "\n"; + code += "mov " + temp3 + "," + animationRegisterCache.vertexZeroConst + "\n"; + code += "mov " + temp3 + ".xy," + temp1 + ".xy\n"; + code += "nrm " + temp3 + ".xyz," + temp3 + ".xyz\n"; + //temp3.x=cos,temp3.y=sin + //only process z axis + code += "mov " + temp2 + "," + animationRegisterCache.vertexZeroConst + "\n"; + code += "mov " + temp2 + ".x," + temp3 + ".y\n"; + code += "mov " + temp2 + ".y," + temp3 + ".x\n"; + code += "mov " + temp1 + "," + animationRegisterCache.vertexZeroConst + "\n"; + code += "mov " + temp1 + ".x," + temp3 + ".x\n"; + code += "neg " + temp1 + ".y," + temp3 + ".y\n"; + code += "mov " + temp3 + "," + animationRegisterCache.vertexZeroConst + "\n"; + code += "mov " + temp3 + ".z," + animationRegisterCache.vertexOneConst + "\n"; + code += "m33 " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp1 + "\n"; + for (i = 0; i < len; i++) + code += "m33 " + animationRegisterCache.rotationRegisters[i] + ".xyz," + animationRegisterCache.rotationRegisters[i] + "," + temp1 + "\n"; + } + else { + var nrmVel = animationRegisterCache.getFreeVertexVectorTemp(); + animationRegisterCache.addVertexTempUsages(nrmVel, 1); + var xAxis = animationRegisterCache.getFreeVertexVectorTemp(); + animationRegisterCache.addVertexTempUsages(xAxis, 1); + var R = animationRegisterCache.getFreeVertexVectorTemp(); + animationRegisterCache.addVertexTempUsages(R, 1); + var R_rev = animationRegisterCache.getFreeVertexVectorTemp(); + var cos = new ShaderRegisterElement(R.regName, R.index, 3); + var sin = new ShaderRegisterElement(R_rev.regName, R_rev.index, 3); + var cos2 = new ShaderRegisterElement(nrmVel.regName, nrmVel.index, 3); + var tempSingle = sin; + animationRegisterCache.removeVertexTempUsage(nrmVel); + animationRegisterCache.removeVertexTempUsage(xAxis); + animationRegisterCache.removeVertexTempUsage(R); + code += "mov " + xAxis + ".x," + animationRegisterCache.vertexOneConst + "\n"; + code += "mov " + xAxis + ".yz," + animationRegisterCache.vertexZeroConst + "\n"; + code += "nrm " + nrmVel + ".xyz," + animationRegisterCache.velocityTarget + ".xyz\n"; + code += "dp3 " + cos2 + "," + nrmVel + ".xyz," + xAxis + ".xyz\n"; + code += "crs " + nrmVel + ".xyz," + xAxis + ".xyz," + nrmVel + ".xyz\n"; + code += "nrm " + nrmVel + ".xyz," + nrmVel + ".xyz\n"; + //use R as temp to judge if nrm is (0,0,0). + //if nrm is (0,0,0) ,change it to (0,0,1). + code += "dp3 " + R + ".x," + nrmVel + ".xyz," + nrmVel + ".xyz\n"; + code += "sge " + R + ".x," + animationRegisterCache.vertexZeroConst + "," + R + ".x\n"; + code += "add " + nrmVel + ".z," + R + ".x," + nrmVel + ".z\n"; + code += "add " + tempSingle + "," + cos2 + "," + animationRegisterCache.vertexOneConst + "\n"; + code += "div " + tempSingle + "," + tempSingle + "," + animationRegisterCache.vertexTwoConst + "\n"; + code += "sqt " + cos + "," + tempSingle + "\n"; + code += "sub " + tempSingle + "," + animationRegisterCache.vertexOneConst + "," + cos2 + "\n"; + code += "div " + tempSingle + "," + tempSingle + "," + animationRegisterCache.vertexTwoConst + "\n"; + code += "sqt " + sin + "," + tempSingle + "\n"; + code += "mul " + R + ".xyz," + sin + "," + nrmVel + ".xyz\n"; + //use cos as R.w + code += "mul " + R_rev + ".xyz," + sin + "," + nrmVel + ".xyz\n"; + code += "neg " + R_rev + ".xyz," + R_rev + ".xyz\n"; + //use cos as R_rev.w + //nrmVel and xAxis are used as temp register + code += "crs " + nrmVel + ".xyz," + R + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; + //use cos as R.w + code += "mul " + xAxis + ".xyz," + cos + "," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; + code += "add " + nrmVel + ".xyz," + nrmVel + ".xyz," + xAxis + ".xyz\n"; + code += "dp3 " + xAxis + ".w," + R + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; + code += "neg " + nrmVel + ".w," + xAxis + ".w\n"; + code += "crs " + R + ".xyz," + nrmVel + ".xyz," + R_rev + ".xyz\n"; + //code += "mul " + xAxis + ".xyzw," + nrmVel + ".xyzw," +R_rev + ".w\n"; + code += "mul " + xAxis + ".xyzw," + nrmVel + ".xyzw," + cos + "\n"; + code += "add " + R + ".xyz," + R + ".xyz," + xAxis + ".xyz\n"; + code += "mul " + xAxis + ".xyz," + nrmVel + ".w," + R_rev + ".xyz\n"; + code += "add " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + R + ".xyz," + xAxis + ".xyz\n"; + for (i = 0; i < len; i++) { + //just repeat the calculate above + //because of the limited registers, no need to optimise + code += "mov " + xAxis + ".x," + animationRegisterCache.vertexOneConst + "\n"; + code += "mov " + xAxis + ".yz," + animationRegisterCache.vertexZeroConst + "\n"; + code += "nrm " + nrmVel + ".xyz," + animationRegisterCache.velocityTarget + ".xyz\n"; + code += "dp3 " + cos2 + "," + nrmVel + ".xyz," + xAxis + ".xyz\n"; + code += "crs " + nrmVel + ".xyz," + xAxis + ".xyz," + nrmVel + ".xyz\n"; + code += "nrm " + nrmVel + ".xyz," + nrmVel + ".xyz\n"; + code += "dp3 " + R + ".x," + nrmVel + ".xyz," + nrmVel + ".xyz\n"; + code += "sge " + R + ".x," + animationRegisterCache.vertexZeroConst + "," + R + ".x\n"; + code += "add " + nrmVel + ".z," + R + ".x," + nrmVel + ".z\n"; + code += "add " + tempSingle + "," + cos2 + "," + animationRegisterCache.vertexOneConst + "\n"; + code += "div " + tempSingle + "," + tempSingle + "," + animationRegisterCache.vertexTwoConst + "\n"; + code += "sqt " + cos + "," + tempSingle + "\n"; + code += "sub " + tempSingle + "," + animationRegisterCache.vertexOneConst + "," + cos2 + "\n"; + code += "div " + tempSingle + "," + tempSingle + "," + animationRegisterCache.vertexTwoConst + "\n"; + code += "sqt " + sin + "," + tempSingle + "\n"; + code += "mul " + R + ".xyz," + sin + "," + nrmVel + ".xyz\n"; + code += "mul " + R_rev + ".xyz," + sin + "," + nrmVel + ".xyz\n"; + code += "neg " + R_rev + ".xyz," + R_rev + ".xyz\n"; + code += "crs " + nrmVel + ".xyz," + R + ".xyz," + animationRegisterCache.rotationRegisters[i] + ".xyz\n"; + code += "mul " + xAxis + ".xyz," + cos + "," + animationRegisterCache.rotationRegisters[i] + ".xyz\n"; + code += "add " + nrmVel + ".xyz," + nrmVel + ".xyz," + xAxis + ".xyz\n"; + code += "dp3 " + xAxis + ".w," + R + ".xyz," + animationRegisterCache.rotationRegisters[i] + ".xyz\n"; + code += "neg " + nrmVel + ".w," + xAxis + ".w\n"; + code += "crs " + R + ".xyz," + nrmVel + ".xyz," + R_rev + ".xyz\n"; + code += "mul " + xAxis + ".xyzw," + nrmVel + ".xyzw," + cos + "\n"; + code += "add " + R + ".xyz," + R + ".xyz," + xAxis + ".xyz\n"; + code += "mul " + xAxis + ".xyz," + nrmVel + ".w," + R_rev + ".xyz\n"; + code += "add " + animationRegisterCache.rotationRegisters[i] + ".xyz," + R + ".xyz," + xAxis + ".xyz\n"; + } + } + return code; + }; + /** + * @inheritDoc + */ + ParticleRotateToHeadingNode.prototype.getAnimationState = function (animator) { + return animator.getAnimationState(this); + }; + /** + * @inheritDoc + */ + ParticleRotateToHeadingNode.prototype._iProcessAnimationSetting = function (particleAnimationSet) { + particleAnimationSet.needVelocity = true; + }; + return ParticleRotateToHeadingNode; +})(ParticleNodeBase); +module.exports = ParticleRotateToHeadingNode; + + +},{"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase":undefined,"awayjs-renderergl/lib/animators/states/ParticleRotateToHeadingState":undefined,"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement":undefined}],"awayjs-renderergl/lib/animators/nodes/ParticleRotateToPositionNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); +var ParticleRotateToPositionState = require("awayjs-renderergl/lib/animators/states/ParticleRotateToPositionState"); +/** + * A particle animation node used to control the rotation of a particle to face to a position + */ +var ParticleRotateToPositionNode = (function (_super) { + __extends(ParticleRotateToPositionNode, _super); + /** + * Creates a new ParticleRotateToPositionNode + */ + function ParticleRotateToPositionNode(mode /*uint*/, position) { + if (position === void 0) { position = null; } + _super.call(this, "ParticleRotateToPosition", mode, 3, 3); + this._pStateClass = ParticleRotateToPositionState; + this._iPosition = position || new Vector3D(); + } + /** + * @inheritDoc + */ + ParticleRotateToPositionNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { + var positionAttribute = (this._pMode == ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + animationRegisterCache.setRegisterIndex(this, ParticleRotateToPositionState.POSITION_INDEX, positionAttribute.index); + var code = ""; + var len = animationRegisterCache.rotationRegisters.length; + var i /*int*/; + if (animationRegisterCache.hasBillboard) { + var temp1 = animationRegisterCache.getFreeVertexVectorTemp(); + animationRegisterCache.addVertexTempUsages(temp1, 1); + var temp2 = animationRegisterCache.getFreeVertexVectorTemp(); + animationRegisterCache.addVertexTempUsages(temp2, 1); + var temp3 = animationRegisterCache.getFreeVertexVectorTemp(); + var rotationMatrixRegister = animationRegisterCache.getFreeVertexConstant(); + animationRegisterCache.setRegisterIndex(this, ParticleRotateToPositionState.MATRIX_INDEX, rotationMatrixRegister.index); + animationRegisterCache.getFreeVertexConstant(); + animationRegisterCache.getFreeVertexConstant(); + animationRegisterCache.getFreeVertexConstant(); + animationRegisterCache.removeVertexTempUsage(temp1); + animationRegisterCache.removeVertexTempUsage(temp2); + //process the position + code += "sub " + temp1 + ".xyz," + positionAttribute + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; + code += "m33 " + temp1 + ".xyz," + temp1 + ".xyz," + rotationMatrixRegister + "\n"; + code += "mov " + temp3 + "," + animationRegisterCache.vertexZeroConst + "\n"; + code += "mov " + temp3 + ".xy," + temp1 + ".xy\n"; + code += "nrm " + temp3 + ".xyz," + temp3 + ".xyz\n"; + //temp3.x=cos,temp3.y=sin + //only process z axis + code += "mov " + temp2 + "," + animationRegisterCache.vertexZeroConst + "\n"; + code += "mov " + temp2 + ".x," + temp3 + ".y\n"; + code += "mov " + temp2 + ".y," + temp3 + ".x\n"; + code += "mov " + temp1 + "," + animationRegisterCache.vertexZeroConst + "\n"; + code += "mov " + temp1 + ".x," + temp3 + ".x\n"; + code += "neg " + temp1 + ".y," + temp3 + ".y\n"; + code += "mov " + temp3 + "," + animationRegisterCache.vertexZeroConst + "\n"; + code += "mov " + temp3 + ".z," + animationRegisterCache.vertexOneConst + "\n"; + code += "m33 " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp1 + "\n"; + for (i = 0; i < len; i++) + code += "m33 " + animationRegisterCache.rotationRegisters[i] + ".xyz," + animationRegisterCache.rotationRegisters[i] + "," + temp1 + "\n"; + } + else { + var nrmDirection = animationRegisterCache.getFreeVertexVectorTemp(); + animationRegisterCache.addVertexTempUsages(nrmDirection, 1); + var temp = animationRegisterCache.getFreeVertexVectorTemp(); + animationRegisterCache.addVertexTempUsages(temp, 1); + var cos = new ShaderRegisterElement(temp.regName, temp.index, 0); + var sin = new ShaderRegisterElement(temp.regName, temp.index, 1); + var o_temp = new ShaderRegisterElement(temp.regName, temp.index, 2); + var tempSingle = new ShaderRegisterElement(temp.regName, temp.index, 3); + var R = animationRegisterCache.getFreeVertexVectorTemp(); + animationRegisterCache.addVertexTempUsages(R, 1); + animationRegisterCache.removeVertexTempUsage(nrmDirection); + animationRegisterCache.removeVertexTempUsage(temp); + animationRegisterCache.removeVertexTempUsage(R); + code += "sub " + nrmDirection + ".xyz," + positionAttribute + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; + code += "nrm " + nrmDirection + ".xyz," + nrmDirection + ".xyz\n"; + code += "mov " + sin + "," + nrmDirection + ".y\n"; + code += "mul " + cos + "," + sin + "," + sin + "\n"; + code += "sub " + cos + "," + animationRegisterCache.vertexOneConst + "," + cos + "\n"; + code += "sqt " + cos + "," + cos + "\n"; + code += "mul " + R + ".x," + cos + "," + animationRegisterCache.scaleAndRotateTarget + ".y\n"; + code += "mul " + R + ".y," + sin + "," + animationRegisterCache.scaleAndRotateTarget + ".z\n"; + code += "mul " + R + ".z," + sin + "," + animationRegisterCache.scaleAndRotateTarget + ".y\n"; + code += "mul " + R + ".w," + cos + "," + animationRegisterCache.scaleAndRotateTarget + ".z\n"; + code += "sub " + animationRegisterCache.scaleAndRotateTarget + ".y," + R + ".x," + R + ".y\n"; + code += "add " + animationRegisterCache.scaleAndRotateTarget + ".z," + R + ".z," + R + ".w\n"; + code += "abs " + R + ".y," + nrmDirection + ".y\n"; + code += "sge " + R + ".z," + R + ".y," + animationRegisterCache.vertexOneConst + "\n"; + code += "mul " + R + ".x," + R + ".y," + nrmDirection + ".y\n"; + //judgu if nrmDirection=(0,1,0); + code += "mov " + nrmDirection + ".y," + animationRegisterCache.vertexZeroConst + "\n"; + code += "dp3 " + sin + "," + nrmDirection + ".xyz," + nrmDirection + ".xyz\n"; + code += "sge " + tempSingle + "," + animationRegisterCache.vertexZeroConst + "," + sin + "\n"; + code += "mov " + nrmDirection + ".y," + animationRegisterCache.vertexZeroConst + "\n"; + code += "nrm " + nrmDirection + ".xyz," + nrmDirection + ".xyz\n"; + code += "sub " + sin + "," + animationRegisterCache.vertexOneConst + "," + tempSingle + "\n"; + code += "mul " + sin + "," + sin + "," + nrmDirection + ".x\n"; + code += "mov " + cos + "," + nrmDirection + ".z\n"; + code += "neg " + cos + "," + cos + "\n"; + code += "sub " + o_temp + "," + animationRegisterCache.vertexOneConst + "," + cos + "\n"; + code += "mul " + o_temp + "," + R + ".x," + tempSingle + "\n"; + code += "add " + cos + "," + cos + "," + o_temp + "\n"; + code += "mul " + R + ".x," + cos + "," + animationRegisterCache.scaleAndRotateTarget + ".x\n"; + code += "mul " + R + ".y," + sin + "," + animationRegisterCache.scaleAndRotateTarget + ".z\n"; + code += "mul " + R + ".z," + sin + "," + animationRegisterCache.scaleAndRotateTarget + ".x\n"; + code += "mul " + R + ".w," + cos + "," + animationRegisterCache.scaleAndRotateTarget + ".z\n"; + code += "sub " + animationRegisterCache.scaleAndRotateTarget + ".x," + R + ".x," + R + ".y\n"; + code += "add " + animationRegisterCache.scaleAndRotateTarget + ".z," + R + ".z," + R + ".w\n"; + for (i = 0; i < len; i++) { + //just repeat the calculate above + //because of the limited registers, no need to optimise + code += "sub " + nrmDirection + ".xyz," + positionAttribute + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; + code += "nrm " + nrmDirection + ".xyz," + nrmDirection + ".xyz\n"; + code += "mov " + sin + "," + nrmDirection + ".y\n"; + code += "mul " + cos + "," + sin + "," + sin + "\n"; + code += "sub " + cos + "," + animationRegisterCache.vertexOneConst + "," + cos + "\n"; + code += "sqt " + cos + "," + cos + "\n"; + code += "mul " + R + ".x," + cos + "," + animationRegisterCache.rotationRegisters[i] + ".y\n"; + code += "mul " + R + ".y," + sin + "," + animationRegisterCache.rotationRegisters[i] + ".z\n"; + code += "mul " + R + ".z," + sin + "," + animationRegisterCache.rotationRegisters[i] + ".y\n"; + code += "mul " + R + ".w," + cos + "," + animationRegisterCache.rotationRegisters[i] + ".z\n"; + code += "sub " + animationRegisterCache.rotationRegisters[i] + ".y," + R + ".x," + R + ".y\n"; + code += "add " + animationRegisterCache.rotationRegisters[i] + ".z," + R + ".z," + R + ".w\n"; + code += "abs " + R + ".y," + nrmDirection + ".y\n"; + code += "sge " + R + ".z," + R + ".y," + animationRegisterCache.vertexOneConst + "\n"; + code += "mul " + R + ".x," + R + ".y," + nrmDirection + ".y\n"; + code += "mov " + nrmDirection + ".y," + animationRegisterCache.vertexZeroConst + "\n"; + code += "dp3 " + sin + "," + nrmDirection + ".xyz," + nrmDirection + ".xyz\n"; + code += "sge " + tempSingle + "," + animationRegisterCache.vertexZeroConst + "," + sin + "\n"; + code += "mov " + nrmDirection + ".y," + animationRegisterCache.vertexZeroConst + "\n"; + code += "nrm " + nrmDirection + ".xyz," + nrmDirection + ".xyz\n"; + code += "sub " + sin + "," + animationRegisterCache.vertexOneConst + "," + tempSingle + "\n"; + code += "mul " + sin + "," + sin + "," + nrmDirection + ".x\n"; + code += "mov " + cos + "," + nrmDirection + ".z\n"; + code += "neg " + cos + "," + cos + "\n"; + code += "sub " + o_temp + "," + animationRegisterCache.vertexOneConst + "," + cos + "\n"; + code += "mul " + o_temp + "," + R + ".x," + tempSingle + "\n"; + code += "add " + cos + "," + cos + "," + o_temp + "\n"; + code += "mul " + R + ".x," + cos + "," + animationRegisterCache.rotationRegisters[i] + ".x\n"; + code += "mul " + R + ".y," + sin + "," + animationRegisterCache.rotationRegisters[i] + ".z\n"; + code += "mul " + R + ".z," + sin + "," + animationRegisterCache.rotationRegisters[i] + ".x\n"; + code += "mul " + R + ".w," + cos + "," + animationRegisterCache.rotationRegisters[i] + ".z\n"; + code += "sub " + animationRegisterCache.rotationRegisters[i] + ".x," + R + ".x," + R + ".y\n"; + code += "add " + animationRegisterCache.rotationRegisters[i] + ".z," + R + ".z," + R + ".w\n"; + } + } + return code; + }; + /** + * @inheritDoc + */ + ParticleRotateToPositionNode.prototype.getAnimationState = function (animator) { + return animator.getAnimationState(this); + }; + /** + * @inheritDoc + */ + ParticleRotateToPositionNode.prototype._iGeneratePropertyOfOneParticle = function (param) { + var offset = param[ParticleRotateToPositionNode.POSITION_VECTOR3D]; + if (!offset) + throw (new Error("there is no " + ParticleRotateToPositionNode.POSITION_VECTOR3D + " in param!")); + this._pOneData[0] = offset.x; + this._pOneData[1] = offset.y; + this._pOneData[2] = offset.z; + }; + /** + * Reference for the position the particle will rotate to face for a single particle (when in local property mode). + * Expects a Vector3D object representing the position that the particle must face. + */ + ParticleRotateToPositionNode.POSITION_VECTOR3D = "RotateToPositionVector3D"; + return ParticleRotateToPositionNode; +})(ParticleNodeBase); +module.exports = ParticleRotateToPositionNode; + + +},{"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase":undefined,"awayjs-renderergl/lib/animators/states/ParticleRotateToPositionState":undefined,"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement":undefined}],"awayjs-renderergl/lib/animators/nodes/ParticleRotationalVelocityNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); +var ParticleRotationalVelocityState = require("awayjs-renderergl/lib/animators/states/ParticleRotationalVelocityState"); +/** + * A particle animation node used to set the starting rotational velocity of a particle. + */ +var ParticleRotationalVelocityNode = (function (_super) { + __extends(ParticleRotationalVelocityNode, _super); + /** + * Creates a new ParticleRotationalVelocityNode + * + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + */ + function ParticleRotationalVelocityNode(mode /*uint*/, rotationalVelocity) { + if (rotationalVelocity === void 0) { rotationalVelocity = null; } + _super.call(this, "ParticleRotationalVelocity", mode, 4); + this._pStateClass = ParticleRotationalVelocityState; + this._iRotationalVelocity = rotationalVelocity || new Vector3D(); + } + /** + * @inheritDoc + */ + ParticleRotationalVelocityNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { + var rotationRegister = (this._pMode == ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + animationRegisterCache.setRegisterIndex(this, ParticleRotationalVelocityState.ROTATIONALVELOCITY_INDEX, rotationRegister.index); + var nrmVel = animationRegisterCache.getFreeVertexVectorTemp(); + animationRegisterCache.addVertexTempUsages(nrmVel, 1); + var xAxis = animationRegisterCache.getFreeVertexVectorTemp(); + animationRegisterCache.addVertexTempUsages(xAxis, 1); + var temp = animationRegisterCache.getFreeVertexVectorTemp(); + animationRegisterCache.addVertexTempUsages(temp, 1); + var Rtemp = new ShaderRegisterElement(temp.regName, temp.index); + var R_rev = animationRegisterCache.getFreeVertexVectorTemp(); + R_rev = new ShaderRegisterElement(R_rev.regName, R_rev.index); + var cos = new ShaderRegisterElement(Rtemp.regName, Rtemp.index, 3); + var sin = new ShaderRegisterElement(R_rev.regName, R_rev.index, 3); + animationRegisterCache.removeVertexTempUsage(nrmVel); + animationRegisterCache.removeVertexTempUsage(xAxis); + animationRegisterCache.removeVertexTempUsage(temp); + var code = ""; + code += "mov " + nrmVel + ".xyz," + rotationRegister + ".xyz\n"; + code += "mov " + nrmVel + ".w," + animationRegisterCache.vertexZeroConst + "\n"; + code += "mul " + cos + "," + animationRegisterCache.vertexTime + "," + rotationRegister + ".w\n"; + code += "sin " + sin + "," + cos + "\n"; + code += "cos " + cos + "," + cos + "\n"; + code += "mul " + Rtemp + ".xyz," + sin + "," + nrmVel + ".xyz\n"; + code += "mul " + R_rev + ".xyz," + sin + "," + nrmVel + ".xyz\n"; + code += "neg " + R_rev + ".xyz," + R_rev + ".xyz\n"; + //nrmVel and xAxis are used as temp register + code += "crs " + nrmVel + ".xyz," + Rtemp + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; + code += "mul " + xAxis + ".xyz," + cos + "," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; + code += "add " + nrmVel + ".xyz," + nrmVel + ".xyz," + xAxis + ".xyz\n"; + code += "dp3 " + xAxis + ".w," + Rtemp + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; + code += "neg " + nrmVel + ".w," + xAxis + ".w\n"; + code += "crs " + Rtemp + ".xyz," + nrmVel + ".xyz," + R_rev + ".xyz\n"; + //use cos as R_rev.w + code += "mul " + xAxis + ".xyzw," + nrmVel + ".xyzw," + cos + "\n"; + code += "add " + Rtemp + ".xyz," + Rtemp + ".xyz," + xAxis + ".xyz\n"; + code += "mul " + xAxis + ".xyz," + nrmVel + ".w," + R_rev + ".xyz\n"; + code += "add " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + Rtemp + ".xyz," + xAxis + ".xyz\n"; + var len = animationRegisterCache.rotationRegisters.length; + for (var i = 0; i < len; i++) { + code += "mov " + nrmVel + ".xyz," + rotationRegister + ".xyz\n"; + code += "mov " + nrmVel + ".w," + animationRegisterCache.vertexZeroConst + "\n"; + code += "mul " + cos + "," + animationRegisterCache.vertexTime + "," + rotationRegister + ".w\n"; + code += "sin " + sin + "," + cos + "\n"; + code += "cos " + cos + "," + cos + "\n"; + code += "mul " + Rtemp + ".xyz," + sin + "," + nrmVel + ".xyz\n"; + code += "mul " + R_rev + ".xyz," + sin + "," + nrmVel + ".xyz\n"; + code += "neg " + R_rev + ".xyz," + R_rev + ".xyz\n"; + code += "crs " + nrmVel + ".xyz," + Rtemp + ".xyz," + animationRegisterCache.rotationRegisters[i] + ".xyz\n"; + code += "mul " + xAxis + ".xyz," + cos + "," + animationRegisterCache.rotationRegisters[i] + "\n"; + code += "add " + nrmVel + ".xyz," + nrmVel + ".xyz," + xAxis + ".xyz\n"; + code += "dp3 " + xAxis + ".w," + Rtemp + ".xyz," + animationRegisterCache.rotationRegisters[i] + "\n"; + code += "neg " + nrmVel + ".w," + xAxis + ".w\n"; + code += "crs " + Rtemp + ".xyz," + nrmVel + ".xyz," + R_rev + ".xyz\n"; + code += "mul " + xAxis + ".xyzw," + nrmVel + ".xyzw," + cos + "\n"; + code += "add " + Rtemp + ".xyz," + Rtemp + ".xyz," + xAxis + ".xyz\n"; + code += "mul " + xAxis + ".xyz," + nrmVel + ".w," + R_rev + ".xyz\n"; + code += "add " + animationRegisterCache.rotationRegisters[i] + "," + Rtemp + ".xyz," + xAxis + ".xyz\n"; + } + return code; + }; + /** + * @inheritDoc + */ + ParticleRotationalVelocityNode.prototype.getAnimationState = function (animator) { + return animator.getAnimationState(this); + }; + /** + * @inheritDoc + */ + ParticleRotationalVelocityNode.prototype._iGeneratePropertyOfOneParticle = function (param) { + //(Vector3d.x,Vector3d.y,Vector3d.z) is rotation axis,Vector3d.w is cycle duration + var rotate = param[ParticleRotationalVelocityNode.ROTATIONALVELOCITY_VECTOR3D]; + if (!rotate) + throw (new Error("there is no " + ParticleRotationalVelocityNode.ROTATIONALVELOCITY_VECTOR3D + " in param!")); + if (rotate.length <= 0) + rotate.z = 1; //set the default direction + else + rotate.normalize(); + this._pOneData[0] = rotate.x; + this._pOneData[1] = rotate.y; + this._pOneData[2] = rotate.z; + if (rotate.w <= 0) + throw (new Error("the cycle duration must greater than zero")); + // it's used as angle/2 in agal + this._pOneData[3] = Math.PI / rotate.w; + }; + /** + * Reference for rotational velocity node properties on a single particle (when in local property mode). + * Expects a Vector3D object representing the rotational velocity around an axis of the particle. + */ + ParticleRotationalVelocityNode.ROTATIONALVELOCITY_VECTOR3D = "RotationalVelocityVector3D"; + return ParticleRotationalVelocityNode; +})(ParticleNodeBase); +module.exports = ParticleRotationalVelocityNode; + + +},{"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase":undefined,"awayjs-renderergl/lib/animators/states/ParticleRotationalVelocityState":undefined,"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement":undefined}],"awayjs-renderergl/lib/animators/nodes/ParticleScaleNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); +var ParticleScaleState = require("awayjs-renderergl/lib/animators/states/ParticleScaleState"); +/** + * A particle animation node used to control the scale variation of a particle over time. + */ +var ParticleScaleNode = (function (_super) { + __extends(ParticleScaleNode, _super); + /** + * Creates a new ParticleScaleNode + * + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + * @param [optional] usesCycle Defines whether the node uses the cycleDuration property in the shader to calculate the period of animation independent of particle duration. Defaults to false. + * @param [optional] usesPhase Defines whether the node uses the cyclePhase property in the shader to calculate a starting offset to the animation cycle. Defaults to false. + * @param [optional] minScale Defines the default min scale transform of the node, when in global mode. Defaults to 1. + * @param [optional] maxScale Defines the default max color transform of the node, when in global mode. Defaults to 1. + * @param [optional] cycleDuration Defines the default duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. + * @param [optional] cyclePhase Defines the default phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. + */ + function ParticleScaleNode(mode /*uint*/, usesCycle, usesPhase, minScale, maxScale, cycleDuration, cyclePhase) { + if (minScale === void 0) { minScale = 1; } + if (maxScale === void 0) { maxScale = 1; } + if (cycleDuration === void 0) { cycleDuration = 1; } + if (cyclePhase === void 0) { cyclePhase = 0; } + _super.call(this, "ParticleScale", mode, (usesCycle && usesPhase) ? 4 : ((usesCycle || usesPhase) ? 3 : 2), 3); + this._pStateClass = ParticleScaleState; + this._iUsesCycle = usesCycle; + this._iUsesPhase = usesPhase; + this._iMinScale = minScale; + this._iMaxScale = maxScale; + this._iCycleDuration = cycleDuration; + this._iCyclePhase = cyclePhase; + } + /** + * @inheritDoc + */ + ParticleScaleNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { + var code = ""; + var temp = animationRegisterCache.getFreeVertexSingleTemp(); + var scaleRegister = (this._pMode == ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + animationRegisterCache.setRegisterIndex(this, ParticleScaleState.SCALE_INDEX, scaleRegister.index); + if (this._iUsesCycle) { + code += "mul " + temp + "," + animationRegisterCache.vertexTime + "," + scaleRegister + ".z\n"; + if (this._iUsesPhase) + code += "add " + temp + "," + temp + "," + scaleRegister + ".w\n"; + code += "sin " + temp + "," + temp + "\n"; + } + code += "mul " + temp + "," + scaleRegister + ".y," + ((this._iUsesCycle) ? temp : animationRegisterCache.vertexLife) + "\n"; + code += "add " + temp + "," + scaleRegister + ".x," + temp + "\n"; + code += "mul " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp + "\n"; + return code; + }; + /** + * @inheritDoc + */ + ParticleScaleNode.prototype.getAnimationState = function (animator) { + return animator.getAnimationState(this); + }; + /** + * @inheritDoc + */ + ParticleScaleNode.prototype._iGeneratePropertyOfOneParticle = function (param) { + var scale = param[ParticleScaleNode.SCALE_VECTOR3D]; + if (!scale) + throw (new Error("there is no " + ParticleScaleNode.SCALE_VECTOR3D + " in param!")); + if (this._iUsesCycle) { + this._pOneData[0] = (scale.x + scale.y) / 2; + this._pOneData[1] = Math.abs(scale.x - scale.y) / 2; + if (scale.z <= 0) + throw (new Error("the cycle duration must be greater than zero")); + this._pOneData[2] = Math.PI * 2 / scale.z; + if (this._iUsesPhase) + this._pOneData[3] = scale.w * Math.PI / 180; + } + else { + this._pOneData[0] = scale.x; + this._pOneData[1] = scale.y - scale.x; + } + }; + /** + * Reference for scale node properties on a single particle (when in local property mode). + * Expects a Vector3D representing the min scale (x), max scale(y), optional cycle speed (z) and phase offset (w) applied to the particle. + */ + ParticleScaleNode.SCALE_VECTOR3D = "ScaleVector3D"; + return ParticleScaleNode; +})(ParticleNodeBase); +module.exports = ParticleScaleNode; + + +},{"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase":undefined,"awayjs-renderergl/lib/animators/states/ParticleScaleState":undefined}],"awayjs-renderergl/lib/animators/nodes/ParticleSegmentedColorNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); +var ParticleAnimationSet = require("awayjs-renderergl/lib/animators/ParticleAnimationSet"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); +var ParticleSegmentedColorState = require("awayjs-renderergl/lib/animators/states/ParticleSegmentedColorState"); +/** + * + */ +var ParticleSegmentedColorNode = (function (_super) { + __extends(ParticleSegmentedColorNode, _super); + function ParticleSegmentedColorNode(usesMultiplier, usesOffset, numSegmentPoint /*int*/, startColor, endColor, segmentPoints) { + //because of the stage3d register limitation, it only support the global mode + _super.call(this, "ParticleSegmentedColor", ParticlePropertiesMode.GLOBAL, 0, ParticleAnimationSet.COLOR_PRIORITY); + this._pStateClass = ParticleSegmentedColorState; + if (numSegmentPoint > 4) + throw (new Error("the numSegmentPoint must be less or equal 4")); + this._iUsesMultiplier = usesMultiplier; + this._iUsesOffset = usesOffset; + this._iNumSegmentPoint = numSegmentPoint; + this._iStartColor = startColor; + this._iEndColor = endColor; + this._iSegmentPoints = segmentPoints; + } + /** + * @inheritDoc + */ + ParticleSegmentedColorNode.prototype._iProcessAnimationSetting = function (particleAnimationSet) { + if (this._iUsesMultiplier) + particleAnimationSet.hasColorMulNode = true; + if (this._iUsesOffset) + particleAnimationSet.hasColorAddNode = true; + }; + /** + * @inheritDoc + */ + ParticleSegmentedColorNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { + var code = ""; + if (animationRegisterCache.needFragmentAnimation) { + var accMultiplierColor; + //var accOffsetColor:ShaderRegisterElement; + if (this._iUsesMultiplier) { + accMultiplierColor = animationRegisterCache.getFreeVertexVectorTemp(); + animationRegisterCache.addVertexTempUsages(accMultiplierColor, 1); + } + var tempColor = animationRegisterCache.getFreeVertexVectorTemp(); + animationRegisterCache.addVertexTempUsages(tempColor, 1); + var temp = animationRegisterCache.getFreeVertexVectorTemp(); + var accTime = new ShaderRegisterElement(temp.regName, temp.index, 0); + var tempTime = new ShaderRegisterElement(temp.regName, temp.index, 1); + if (this._iUsesMultiplier) + animationRegisterCache.removeVertexTempUsage(accMultiplierColor); + animationRegisterCache.removeVertexTempUsage(tempColor); + //for saving all the life values (at most 4) + var lifeTimeRegister = animationRegisterCache.getFreeVertexConstant(); + animationRegisterCache.setRegisterIndex(this, ParticleSegmentedColorState.TIME_DATA_INDEX, lifeTimeRegister.index); + var i /*int*/; + var startMulValue; + var deltaMulValues; + if (this._iUsesMultiplier) { + startMulValue = animationRegisterCache.getFreeVertexConstant(); + animationRegisterCache.setRegisterIndex(this, ParticleSegmentedColorState.START_MULTIPLIER_INDEX, startMulValue.index); + deltaMulValues = new Array(); + for (i = 0; i < this._iNumSegmentPoint + 1; i++) + deltaMulValues.push(animationRegisterCache.getFreeVertexConstant()); + } + var startOffsetValue; + var deltaOffsetValues; + if (this._iUsesOffset) { + startOffsetValue = animationRegisterCache.getFreeVertexConstant(); + animationRegisterCache.setRegisterIndex(this, ParticleSegmentedColorState.START_OFFSET_INDEX, startOffsetValue.index); + deltaOffsetValues = new Array(); + for (i = 0; i < this._iNumSegmentPoint + 1; i++) + deltaOffsetValues.push(animationRegisterCache.getFreeVertexConstant()); + } + if (this._iUsesMultiplier) + code += "mov " + accMultiplierColor + "," + startMulValue + "\n"; + if (this._iUsesOffset) + code += "add " + animationRegisterCache.colorAddTarget + "," + animationRegisterCache.colorAddTarget + "," + startOffsetValue + "\n"; + for (i = 0; i < this._iNumSegmentPoint; i++) { + switch (i) { + case 0: + code += "min " + tempTime + "," + animationRegisterCache.vertexLife + "," + lifeTimeRegister + ".x\n"; + break; + case 1: + code += "sub " + accTime + "," + animationRegisterCache.vertexLife + "," + lifeTimeRegister + ".x\n"; + code += "max " + tempTime + "," + accTime + "," + animationRegisterCache.vertexZeroConst + "\n"; + code += "min " + tempTime + "," + tempTime + "," + lifeTimeRegister + ".y\n"; + break; + case 2: + code += "sub " + accTime + "," + accTime + "," + lifeTimeRegister + ".y\n"; + code += "max " + tempTime + "," + accTime + "," + animationRegisterCache.vertexZeroConst + "\n"; + code += "min " + tempTime + "," + tempTime + "," + lifeTimeRegister + ".z\n"; + break; + case 3: + code += "sub " + accTime + "," + accTime + "," + lifeTimeRegister + ".z\n"; + code += "max " + tempTime + "," + accTime + "," + animationRegisterCache.vertexZeroConst + "\n"; + code += "min " + tempTime + "," + tempTime + "," + lifeTimeRegister + ".w\n"; + break; + } + if (this._iUsesMultiplier) { + code += "mul " + tempColor + "," + tempTime + "," + deltaMulValues[i] + "\n"; + code += "add " + accMultiplierColor + "," + accMultiplierColor + "," + tempColor + "\n"; + } + if (this._iUsesOffset) { + code += "mul " + tempColor + "," + tempTime + "," + deltaOffsetValues[i] + "\n"; + code += "add " + animationRegisterCache.colorAddTarget + "," + animationRegisterCache.colorAddTarget + "," + tempColor + "\n"; + } + } + //for the last segment: + if (this._iNumSegmentPoint == 0) + tempTime = animationRegisterCache.vertexLife; + else { + switch (this._iNumSegmentPoint) { + case 1: + code += "sub " + accTime + "," + animationRegisterCache.vertexLife + "," + lifeTimeRegister + ".x\n"; + break; + case 2: + code += "sub " + accTime + "," + accTime + "," + lifeTimeRegister + ".y\n"; + break; + case 3: + code += "sub " + accTime + "," + accTime + "," + lifeTimeRegister + ".z\n"; + break; + case 4: + code += "sub " + accTime + "," + accTime + "," + lifeTimeRegister + ".w\n"; + break; + } + code += "max " + tempTime + "," + accTime + "," + animationRegisterCache.vertexZeroConst + "\n"; + } + if (this._iUsesMultiplier) { + code += "mul " + tempColor + "," + tempTime + "," + deltaMulValues[this._iNumSegmentPoint] + "\n"; + code += "add " + accMultiplierColor + "," + accMultiplierColor + "," + tempColor + "\n"; + code += "mul " + animationRegisterCache.colorMulTarget + "," + animationRegisterCache.colorMulTarget + "," + accMultiplierColor + "\n"; + } + if (this._iUsesOffset) { + code += "mul " + tempColor + "," + tempTime + "," + deltaOffsetValues[this._iNumSegmentPoint] + "\n"; + code += "add " + animationRegisterCache.colorAddTarget + "," + animationRegisterCache.colorAddTarget + "," + tempColor + "\n"; + } + } + return code; + }; + return ParticleSegmentedColorNode; +})(ParticleNodeBase); +module.exports = ParticleSegmentedColorNode; + + +},{"awayjs-renderergl/lib/animators/ParticleAnimationSet":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase":undefined,"awayjs-renderergl/lib/animators/states/ParticleSegmentedColorState":undefined,"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement":undefined}],"awayjs-renderergl/lib/animators/nodes/ParticleSpriteSheetNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); +var ParticleAnimationSet = require("awayjs-renderergl/lib/animators/ParticleAnimationSet"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); +var ParticleSpriteSheetState = require("awayjs-renderergl/lib/animators/states/ParticleSpriteSheetState"); +/** + * A particle animation node used when a spritesheet texture is required to animate the particle. + * NB: to enable use of this node, the repeat property on the material has to be set to true. + */ +var ParticleSpriteSheetNode = (function (_super) { + __extends(ParticleSpriteSheetNode, _super); + /** + * Creates a new ParticleSpriteSheetNode + * + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + * @param [optional] numColumns Defines the number of columns in the spritesheet, when in global mode. Defaults to 1. + * @param [optional] numRows Defines the number of rows in the spritesheet, when in global mode. Defaults to 1. + * @param [optional] cycleDuration Defines the default cycle duration in seconds, when in global mode. Defaults to 1. + * @param [optional] cyclePhase Defines the default cycle phase, when in global mode. Defaults to 0. + * @param [optional] totalFrames Defines the total number of frames used by the spritesheet, when in global mode. Defaults to the number defined by numColumns and numRows. + * @param [optional] looping Defines whether the spritesheet animation is set to loop indefinitely. Defaults to true. + */ + function ParticleSpriteSheetNode(mode /*uint*/, usesCycle, usesPhase, numColumns, numRows, cycleDuration, cyclePhase, totalFrames) { + if (numColumns === void 0) { numColumns = 1; } + if (numRows === void 0) { numRows = 1; } + if (cycleDuration === void 0) { cycleDuration = 1; } + if (cyclePhase === void 0) { cyclePhase = 0; } + if (totalFrames === void 0) { totalFrames = Number.MAX_VALUE; } + _super.call(this, "ParticleSpriteSheet", mode, usesCycle ? (usesPhase ? 3 : 2) : 1, ParticleAnimationSet.POST_PRIORITY + 1); + this._pStateClass = ParticleSpriteSheetState; + this._iUsesCycle = usesCycle; + this._iUsesPhase = usesPhase; + this._iNumColumns = numColumns; + this._iNumRows = numRows; + this._iCyclePhase = cyclePhase; + this._iCycleDuration = cycleDuration; + this._iTotalFrames = Math.min(totalFrames, numColumns * numRows); + } + Object.defineProperty(ParticleSpriteSheetNode.prototype, "numColumns", { + /** + * Defines the number of columns in the spritesheet, when in global mode. Defaults to 1. Read only. + */ + get: function () { + return this._iNumColumns; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleSpriteSheetNode.prototype, "numRows", { + /** + * Defines the number of rows in the spritesheet, when in global mode. Defaults to 1. Read only. + */ + get: function () { + return this._iNumRows; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleSpriteSheetNode.prototype, "totalFrames", { + /** + * Defines the total number of frames used by the spritesheet, when in global mode. Defaults to the number defined by numColumns and numRows. Read only. + */ + get: function () { + return this._iTotalFrames; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + ParticleSpriteSheetNode.prototype.getAGALUVCode = function (shaderObject, animationRegisterCache) { + //get 2 vc + var uvParamConst1 = animationRegisterCache.getFreeVertexConstant(); + var uvParamConst2 = (this._pMode == ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + animationRegisterCache.setRegisterIndex(this, ParticleSpriteSheetState.UV_INDEX_0, uvParamConst1.index); + animationRegisterCache.setRegisterIndex(this, ParticleSpriteSheetState.UV_INDEX_1, uvParamConst2.index); + var uTotal = new ShaderRegisterElement(uvParamConst1.regName, uvParamConst1.index, 0); + var uStep = new ShaderRegisterElement(uvParamConst1.regName, uvParamConst1.index, 1); + var vStep = new ShaderRegisterElement(uvParamConst1.regName, uvParamConst1.index, 2); + var uSpeed = new ShaderRegisterElement(uvParamConst2.regName, uvParamConst2.index, 0); + var cycle = new ShaderRegisterElement(uvParamConst2.regName, uvParamConst2.index, 1); + var phaseTime = new ShaderRegisterElement(uvParamConst2.regName, uvParamConst2.index, 2); + var temp = animationRegisterCache.getFreeVertexVectorTemp(); + var time = new ShaderRegisterElement(temp.regName, temp.index, 0); + var vOffset = new ShaderRegisterElement(temp.regName, temp.index, 1); + temp = new ShaderRegisterElement(temp.regName, temp.index, 2); + var temp2 = new ShaderRegisterElement(temp.regName, temp.index, 3); + var u = new ShaderRegisterElement(animationRegisterCache.uvTarget.regName, animationRegisterCache.uvTarget.index, 0); + var v = new ShaderRegisterElement(animationRegisterCache.uvTarget.regName, animationRegisterCache.uvTarget.index, 1); + var code = ""; + //scale uv + code += "mul " + u + "," + u + "," + uStep + "\n"; + if (this._iNumRows > 1) + code += "mul " + v + "," + v + "," + vStep + "\n"; + if (this._iUsesCycle) { + if (this._iUsesPhase) + code += "add " + time + "," + animationRegisterCache.vertexTime + "," + phaseTime + "\n"; + else + code += "mov " + time + "," + animationRegisterCache.vertexTime + "\n"; + code += "div " + time + "," + time + "," + cycle + "\n"; + code += "frc " + time + "," + time + "\n"; + code += "mul " + time + "," + time + "," + cycle + "\n"; + code += "mul " + temp + "," + time + "," + uSpeed + "\n"; + } + else + code += "mul " + temp.toString() + "," + animationRegisterCache.vertexLife + "," + uTotal + "\n"; + if (this._iNumRows > 1) { + code += "frc " + temp2 + "," + temp + "\n"; + code += "sub " + vOffset + "," + temp + "," + temp2 + "\n"; + code += "mul " + vOffset + "," + vOffset + "," + vStep + "\n"; + code += "add " + v + "," + v + "," + vOffset + "\n"; + } + code += "div " + temp2 + "," + temp + "," + uStep + "\n"; + code += "frc " + temp + "," + temp2 + "\n"; + code += "sub " + temp2 + "," + temp2 + "," + temp + "\n"; + code += "mul " + temp + "," + temp2 + "," + uStep + "\n"; + if (this._iNumRows > 1) + code += "frc " + temp + "," + temp + "\n"; + code += "add " + u + "," + u + "," + temp + "\n"; + return code; + }; + /** + * @inheritDoc + */ + ParticleSpriteSheetNode.prototype.getAnimationState = function (animator) { + return animator.getAnimationState(this); + }; + /** + * @inheritDoc + */ + ParticleSpriteSheetNode.prototype._iProcessAnimationSetting = function (particleAnimationSet) { + particleAnimationSet.hasUVNode = true; + }; + /** + * @inheritDoc + */ + ParticleSpriteSheetNode.prototype._iGeneratePropertyOfOneParticle = function (param) { + if (this._iUsesCycle) { + var uvCycle = param[ParticleSpriteSheetNode.UV_VECTOR3D]; + if (!uvCycle) + throw (new Error("there is no " + ParticleSpriteSheetNode.UV_VECTOR3D + " in param!")); + if (uvCycle.x <= 0) + throw (new Error("the cycle duration must be greater than zero")); + var uTotal = this._iTotalFrames / this._iNumColumns; + this._pOneData[0] = uTotal / uvCycle.x; + this._pOneData[1] = uvCycle.x; + if (this._iUsesPhase) + this._pOneData[2] = uvCycle.y; + } + }; + /** + * Reference for spritesheet node properties on a single particle (when in local property mode). + * Expects a Vector3D representing the cycleDuration (x), optional phaseTime (y). + */ + ParticleSpriteSheetNode.UV_VECTOR3D = "UVVector3D"; + return ParticleSpriteSheetNode; +})(ParticleNodeBase); +module.exports = ParticleSpriteSheetNode; + + +},{"awayjs-renderergl/lib/animators/ParticleAnimationSet":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase":undefined,"awayjs-renderergl/lib/animators/states/ParticleSpriteSheetState":undefined,"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement":undefined}],"awayjs-renderergl/lib/animators/nodes/ParticleTimeNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); +var ParticleTimeState = require("awayjs-renderergl/lib/animators/states/ParticleTimeState"); +/** + * A particle animation node used as the base node for timekeeping inside a particle. Automatically added to a particle animation set on instatiation. + */ +var ParticleTimeNode = (function (_super) { + __extends(ParticleTimeNode, _super); + /** + * Creates a new ParticleTimeNode + * + * @param [optional] usesDuration Defines whether the node uses the duration data in the static properties to determine how long a particle is visible for. Defaults to false. + * @param [optional] usesDelay Defines whether the node uses the delay data in the static properties to determine how long a particle is hidden for. Defaults to false. Requires usesDuration to be true. + * @param [optional] usesLooping Defines whether the node creates a looping timeframe for each particle determined by the startTime, duration and delay data in the static properties function. Defaults to false. Requires usesLooping to be true. + */ + function ParticleTimeNode(usesDuration, usesLooping, usesDelay) { + if (usesDuration === void 0) { usesDuration = false; } + if (usesLooping === void 0) { usesLooping = false; } + if (usesDelay === void 0) { usesDelay = false; } + this._pStateClass = ParticleTimeState; + this._iUsesDuration = usesDuration; + this._iUsesLooping = usesLooping; + this._iUsesDelay = usesDelay; + _super.call(this, "ParticleTime", ParticlePropertiesMode.LOCAL_STATIC, 4, 0); + } + /** + * @inheritDoc + */ + ParticleTimeNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { + var timeStreamRegister = animationRegisterCache.getFreeVertexAttribute(); //timeStreamRegister.x is start,timeStreamRegister.y is during time + animationRegisterCache.setRegisterIndex(this, ParticleTimeState.TIME_STREAM_INDEX, timeStreamRegister.index); + var timeConst = animationRegisterCache.getFreeVertexConstant(); + animationRegisterCache.setRegisterIndex(this, ParticleTimeState.TIME_CONSTANT_INDEX, timeConst.index); + var code = ""; + code += "sub " + animationRegisterCache.vertexTime + "," + timeConst + "," + timeStreamRegister + ".x\n"; + //if time=0,set the position to zero. + var temp = animationRegisterCache.getFreeVertexSingleTemp(); + code += "sge " + temp + "," + animationRegisterCache.vertexTime + "," + animationRegisterCache.vertexZeroConst + "\n"; + code += "mul " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp + "\n"; + if (this._iUsesDuration) { + if (this._iUsesLooping) { + var div = animationRegisterCache.getFreeVertexSingleTemp(); + if (this._iUsesDelay) { + code += "div " + div + "," + animationRegisterCache.vertexTime + "," + timeStreamRegister + ".z\n"; + code += "frc " + div + "," + div + "\n"; + code += "mul " + animationRegisterCache.vertexTime + "," + div + "," + timeStreamRegister + ".z\n"; + code += "slt " + div + "," + animationRegisterCache.vertexTime + "," + timeStreamRegister + ".y\n"; + code += "mul " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + div + "\n"; + } + else { + code += "mul " + div + "," + animationRegisterCache.vertexTime + "," + timeStreamRegister + ".w\n"; + code += "frc " + div + "," + div + "\n"; + code += "mul " + animationRegisterCache.vertexTime + "," + div + "," + timeStreamRegister + ".y\n"; + } + } + else { + var sge = animationRegisterCache.getFreeVertexSingleTemp(); + code += "sge " + sge + "," + timeStreamRegister + ".y," + animationRegisterCache.vertexTime + "\n"; + code += "mul " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + sge + "\n"; + } + } + code += "mul " + animationRegisterCache.vertexLife + "," + animationRegisterCache.vertexTime + "," + timeStreamRegister + ".w\n"; + return code; + }; + /** + * @inheritDoc + */ + ParticleTimeNode.prototype.getAnimationState = function (animator) { + return animator.getAnimationState(this); + }; + /** + * @inheritDoc + */ + ParticleTimeNode.prototype._iGeneratePropertyOfOneParticle = function (param) { + this._pOneData[0] = param.startTime; + this._pOneData[1] = param.duration; + this._pOneData[2] = param.delay + param.duration; + this._pOneData[3] = 1 / param.duration; + }; + return ParticleTimeNode; +})(ParticleNodeBase); +module.exports = ParticleTimeNode; + + +},{"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase":undefined,"awayjs-renderergl/lib/animators/states/ParticleTimeState":undefined}],"awayjs-renderergl/lib/animators/nodes/ParticleUVNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var ShaderRegisterElement = require("awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement"); +var ParticleAnimationSet = require("awayjs-renderergl/lib/animators/ParticleAnimationSet"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); +var ParticleUVState = require("awayjs-renderergl/lib/animators/states/ParticleUVState"); +/** + * A particle animation node used to control the UV offset and scale of a particle over time. + */ +var ParticleUVNode = (function (_super) { + __extends(ParticleUVNode, _super); + /** + * Creates a new ParticleTimeNode + * + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + * @param [optional] cycle Defines whether the time track is in loop mode. Defaults to false. + * @param [optional] scale Defines whether the time track is in loop mode. Defaults to false. + * @param [optional] axis Defines whether the time track is in loop mode. Defaults to false. + */ + function ParticleUVNode(mode /*uint*/, cycle, scale, axis) { + if (cycle === void 0) { cycle = 1; } + if (scale === void 0) { scale = 1; } + if (axis === void 0) { axis = "x"; } + //because of the stage3d register limitation, it only support the global mode + _super.call(this, "ParticleUV", ParticlePropertiesMode.GLOBAL, 4, ParticleAnimationSet.POST_PRIORITY + 1); + this._pStateClass = ParticleUVState; + this._cycle = cycle; + this._scale = scale; + this._axis = axis; + this.updateUVData(); + } + Object.defineProperty(ParticleUVNode.prototype, "cycle", { + /** + * + */ + get: function () { + return this._cycle; + }, + set: function (value) { + this._cycle = value; + this.updateUVData(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleUVNode.prototype, "scale", { + /** + * + */ + get: function () { + return this._scale; + }, + set: function (value) { + this._scale = value; + this.updateUVData(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleUVNode.prototype, "axis", { + /** + * + */ + get: function () { + return this._axis; + }, + set: function (value) { + this._axis = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + ParticleUVNode.prototype.getAGALUVCode = function (shaderObject, animationRegisterCache) { + var code = ""; + var uvConst = animationRegisterCache.getFreeVertexConstant(); + animationRegisterCache.setRegisterIndex(this, ParticleUVState.UV_INDEX, uvConst.index); + var axisIndex = this._axis == "x" ? 0 : (this._axis == "y" ? 1 : 2); + var target = new ShaderRegisterElement(animationRegisterCache.uvTarget.regName, animationRegisterCache.uvTarget.index, axisIndex); + var sin = animationRegisterCache.getFreeVertexSingleTemp(); + if (this._scale != 1) + code += "mul " + target + "," + target + "," + uvConst + ".y\n"; + code += "mul " + sin + "," + animationRegisterCache.vertexTime + "," + uvConst + ".x\n"; + code += "sin " + sin + "," + sin + "\n"; + code += "add " + target + "," + target + "," + sin + "\n"; + return code; + }; + /** + * @inheritDoc + */ + ParticleUVNode.prototype.getAnimationState = function (animator) { + return animator.getAnimationState(this); + }; + ParticleUVNode.prototype.updateUVData = function () { + this._iUvData = new Vector3D(Math.PI * 2 / this._cycle, this._scale, 0, 0); + }; + /** + * @inheritDoc + */ + ParticleUVNode.prototype._iProcessAnimationSetting = function (particleAnimationSet) { + particleAnimationSet.hasUVNode = true; + }; + /** + * + */ + ParticleUVNode.U_AXIS = "x"; + /** + * + */ + ParticleUVNode.V_AXIS = "y"; + return ParticleUVNode; +})(ParticleNodeBase); +module.exports = ParticleUVNode; + + +},{"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-renderergl/lib/animators/ParticleAnimationSet":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase":undefined,"awayjs-renderergl/lib/animators/states/ParticleUVState":undefined,"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement":undefined}],"awayjs-renderergl/lib/animators/nodes/ParticleVelocityNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleNodeBase = require("awayjs-renderergl/lib/animators/nodes/ParticleNodeBase"); +var ParticleVelocityState = require("awayjs-renderergl/lib/animators/states/ParticleVelocityState"); +/** + * A particle animation node used to set the starting velocity of a particle. + */ +var ParticleVelocityNode = (function (_super) { + __extends(ParticleVelocityNode, _super); + /** + * Creates a new ParticleVelocityNode + * + * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. + * @param [optional] velocity Defines the default velocity vector of the node, used when in global mode. + */ + function ParticleVelocityNode(mode /*uint*/, velocity) { + if (velocity === void 0) { velocity = null; } + _super.call(this, "ParticleVelocity", mode, 3); + this._pStateClass = ParticleVelocityState; + this._iVelocity = velocity || new Vector3D(); + } + /** + * @inheritDoc + */ + ParticleVelocityNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { + var velocityValue = (this._pMode == ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); + animationRegisterCache.setRegisterIndex(this, ParticleVelocityState.VELOCITY_INDEX, velocityValue.index); + var distance = animationRegisterCache.getFreeVertexVectorTemp(); + var code = ""; + code += "mul " + distance + "," + animationRegisterCache.vertexTime + "," + velocityValue + "\n"; + code += "add " + animationRegisterCache.positionTarget + ".xyz," + distance + "," + animationRegisterCache.positionTarget + ".xyz\n"; + if (animationRegisterCache.needVelocity) + code += "add " + animationRegisterCache.velocityTarget + ".xyz," + velocityValue + ".xyz," + animationRegisterCache.velocityTarget + ".xyz\n"; + return code; + }; + /** + * @inheritDoc + */ + ParticleVelocityNode.prototype.getAnimationState = function (animator) { + return animator.getAnimationState(this); + }; + /** + * @inheritDoc + */ + ParticleVelocityNode.prototype._iGeneratePropertyOfOneParticle = function (param) { + var _tempVelocity = param[ParticleVelocityNode.VELOCITY_VECTOR3D]; + if (!_tempVelocity) + throw new Error("there is no " + ParticleVelocityNode.VELOCITY_VECTOR3D + " in param!"); + this._pOneData[0] = _tempVelocity.x; + this._pOneData[1] = _tempVelocity.y; + this._pOneData[2] = _tempVelocity.z; + }; + /** + * Reference for velocity node properties on a single particle (when in local property mode). + * Expects a Vector3D object representing the direction of movement on the particle. + */ + ParticleVelocityNode.VELOCITY_VECTOR3D = "VelocityVector3D"; + return ParticleVelocityNode; +})(ParticleNodeBase); +module.exports = ParticleVelocityNode; + + +},{"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase":undefined,"awayjs-renderergl/lib/animators/states/ParticleVelocityState":undefined}],"awayjs-renderergl/lib/animators/nodes/SkeletonBinaryLERPNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var AnimationNodeBase = require("awayjs-core/lib/animators/nodes/AnimationNodeBase"); +var SkeletonBinaryLERPState = require("awayjs-renderergl/lib/animators/states/SkeletonBinaryLERPState"); +/** + * A skeleton animation node that uses two animation node inputs to blend a lineraly interpolated output of a skeleton pose. + */ +var SkeletonBinaryLERPNode = (function (_super) { + __extends(SkeletonBinaryLERPNode, _super); + /** + * Creates a new SkeletonBinaryLERPNode object. + */ + function SkeletonBinaryLERPNode() { + _super.call(this); + this._pStateClass = SkeletonBinaryLERPState; + } + /** + * @inheritDoc + */ + SkeletonBinaryLERPNode.prototype.getAnimationState = function (animator) { + return animator.getAnimationState(this); + }; + return SkeletonBinaryLERPNode; +})(AnimationNodeBase); +module.exports = SkeletonBinaryLERPNode; + + +},{"awayjs-core/lib/animators/nodes/AnimationNodeBase":undefined,"awayjs-renderergl/lib/animators/states/SkeletonBinaryLERPState":undefined}],"awayjs-renderergl/lib/animators/nodes/SkeletonClipNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var AnimationClipNodeBase = require("awayjs-renderergl/lib/animators/nodes/AnimationClipNodeBase"); +var SkeletonClipState = require("awayjs-renderergl/lib/animators/states/SkeletonClipState"); +/** + * A skeleton animation node containing time-based animation data as individual skeleton poses. + */ +var SkeletonClipNode = (function (_super) { + __extends(SkeletonClipNode, _super); + /** + * Creates a new SkeletonClipNode object. + */ + function SkeletonClipNode() { + _super.call(this); + this._frames = new Array(); + /** + * Determines whether to use SLERP equations (true) or LERP equations (false) in the calculation + * of the output skeleton pose. Defaults to false. + */ + this.highQuality = false; + this._pStateClass = SkeletonClipState; + } + Object.defineProperty(SkeletonClipNode.prototype, "frames", { + /** + * Returns a vector of skeleton poses representing the pose of each animation frame in the clip. + */ + get: function () { + return this._frames; + }, + enumerable: true, + configurable: true + }); + /** + * Adds a skeleton pose frame to the internal timeline of the animation node. + * + * @param skeletonPose The skeleton pose object to add to the timeline of the node. + * @param duration The specified duration of the frame in milliseconds. + */ + SkeletonClipNode.prototype.addFrame = function (skeletonPose, duration /*number /*uint*/) { + this._frames.push(skeletonPose); + this._pDurations.push(duration); + this._pNumFrames = this._pDurations.length; + this._pStitchDirty = true; + }; + /** + * @inheritDoc + */ + SkeletonClipNode.prototype.getAnimationState = function (animator) { + return animator.getAnimationState(this); + }; + /** + * @inheritDoc + */ + SkeletonClipNode.prototype._pUpdateStitch = function () { + _super.prototype._pUpdateStitch.call(this); + var i = this._pNumFrames - 1; + var p1, p2, delta; + while (i--) { + this._pTotalDuration += this._pDurations[i]; + p1 = this._frames[i].jointPoses[0].translation; + p2 = this._frames[i + 1].jointPoses[0].translation; + delta = p2.subtract(p1); + this._pTotalDelta.x += delta.x; + this._pTotalDelta.y += delta.y; + this._pTotalDelta.z += delta.z; + } + if (this._pStitchFinalFrame || !this._pLooping) { + this._pTotalDuration += this._pDurations[this._pNumFrames - 1]; + p1 = this._frames[0].jointPoses[0].translation; + p2 = this._frames[1].jointPoses[0].translation; + delta = p2.subtract(p1); + this._pTotalDelta.x += delta.x; + this._pTotalDelta.y += delta.y; + this._pTotalDelta.z += delta.z; + } + }; + return SkeletonClipNode; +})(AnimationClipNodeBase); +module.exports = SkeletonClipNode; + + +},{"awayjs-renderergl/lib/animators/nodes/AnimationClipNodeBase":undefined,"awayjs-renderergl/lib/animators/states/SkeletonClipState":undefined}],"awayjs-renderergl/lib/animators/nodes/SkeletonDifferenceNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var AnimationNodeBase = require("awayjs-core/lib/animators/nodes/AnimationNodeBase"); +var SkeletonDifferenceState = require("awayjs-renderergl/lib/animators/states/SkeletonDifferenceState"); +/** + * A skeleton animation node that uses a difference input pose with a base input pose to blend a linearly interpolated output of a skeleton pose. + */ +var SkeletonDifferenceNode = (function (_super) { + __extends(SkeletonDifferenceNode, _super); + /** + * Creates a new SkeletonAdditiveNode object. + */ + function SkeletonDifferenceNode() { + _super.call(this); + this._pStateClass = SkeletonDifferenceState; + } + /** + * @inheritDoc + */ + SkeletonDifferenceNode.prototype.getAnimationState = function (animator) { + return animator.getAnimationState(this); + }; + return SkeletonDifferenceNode; +})(AnimationNodeBase); +module.exports = SkeletonDifferenceNode; + + +},{"awayjs-core/lib/animators/nodes/AnimationNodeBase":undefined,"awayjs-renderergl/lib/animators/states/SkeletonDifferenceState":undefined}],"awayjs-renderergl/lib/animators/nodes/SkeletonDirectionalNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var AnimationNodeBase = require("awayjs-core/lib/animators/nodes/AnimationNodeBase"); +var SkeletonDirectionalState = require("awayjs-renderergl/lib/animators/states/SkeletonDirectionalState"); +/** + * A skeleton animation node that uses four directional input poses with an input direction to blend a linearly interpolated output of a skeleton pose. + */ +var SkeletonDirectionalNode = (function (_super) { + __extends(SkeletonDirectionalNode, _super); + function SkeletonDirectionalNode() { + _super.call(this); + this._pStateClass = SkeletonDirectionalState; + } + /** + * @inheritDoc + */ + SkeletonDirectionalNode.prototype.getAnimationState = function (animator) { + return animator.getAnimationState(this); + }; + return SkeletonDirectionalNode; +})(AnimationNodeBase); +module.exports = SkeletonDirectionalNode; + + +},{"awayjs-core/lib/animators/nodes/AnimationNodeBase":undefined,"awayjs-renderergl/lib/animators/states/SkeletonDirectionalState":undefined}],"awayjs-renderergl/lib/animators/nodes/SkeletonNaryLERPNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var AnimationNodeBase = require("awayjs-core/lib/animators/nodes/AnimationNodeBase"); +var SkeletonNaryLERPState = require("awayjs-renderergl/lib/animators/states/SkeletonNaryLERPState"); +/** + * A skeleton animation node that uses an n-dimensional array of animation node inputs to blend a lineraly interpolated output of a skeleton pose. + */ +var SkeletonNaryLERPNode = (function (_super) { + __extends(SkeletonNaryLERPNode, _super); + /** + * Creates a new SkeletonNaryLERPNode object. + */ + function SkeletonNaryLERPNode() { + _super.call(this); + this._iInputs = new Array(); + this._pStateClass = SkeletonNaryLERPState; + } + Object.defineProperty(SkeletonNaryLERPNode.prototype, "numInputs", { + get: function () { + return this._numInputs; + }, + enumerable: true, + configurable: true + }); + /** + * Returns an integer representing the input index of the given skeleton animation node. + * + * @param input The skeleton animation node for with the input index is requested. + */ + SkeletonNaryLERPNode.prototype.getInputIndex = function (input) { + return this._iInputs.indexOf(input); + }; + /** + * Returns the skeleton animation node object that resides at the given input index. + * + * @param index The input index for which the skeleton animation node is requested. + */ + SkeletonNaryLERPNode.prototype.getInputAt = function (index /*uint*/) { + return this._iInputs[index]; + }; + /** + * Adds a new skeleton animation node input to the animation node. + */ + SkeletonNaryLERPNode.prototype.addInput = function (input) { + this._iInputs[this._numInputs++] = input; + }; + /** + * @inheritDoc + */ + SkeletonNaryLERPNode.prototype.getAnimationState = function (animator) { + return animator.getAnimationState(this); + }; + return SkeletonNaryLERPNode; +})(AnimationNodeBase); +module.exports = SkeletonNaryLERPNode; + + +},{"awayjs-core/lib/animators/nodes/AnimationNodeBase":undefined,"awayjs-renderergl/lib/animators/states/SkeletonNaryLERPState":undefined}],"awayjs-renderergl/lib/animators/nodes/VertexClipNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var AnimationClipNodeBase = require("awayjs-renderergl/lib/animators/nodes/AnimationClipNodeBase"); +var VertexClipState = require("awayjs-renderergl/lib/animators/states/VertexClipState"); +/** + * A vertex animation node containing time-based animation data as individual geometry obejcts. + */ +var VertexClipNode = (function (_super) { + __extends(VertexClipNode, _super); + /** + * Creates a new VertexClipNode object. + */ + function VertexClipNode() { + _super.call(this); + this._frames = new Array(); + this._translations = new Array(); + this._pStateClass = VertexClipState; + } + Object.defineProperty(VertexClipNode.prototype, "frames", { + /** + * Returns a vector of geometry frames representing the vertex values of each animation frame in the clip. + */ + get: function () { + return this._frames; + }, + enumerable: true, + configurable: true + }); + /** + * Adds a geometry object to the internal timeline of the animation node. + * + * @param geometry The geometry object to add to the timeline of the node. + * @param duration The specified duration of the frame in milliseconds. + * @param translation The absolute translation of the frame, used in root delta calculations for mesh movement. + */ + VertexClipNode.prototype.addFrame = function (geometry, duration /*uint*/, translation) { + if (translation === void 0) { translation = null; } + this._frames.push(geometry); + this._pDurations.push(duration); + this._translations.push(translation || new Vector3D()); + this._pNumFrames = this._pDurations.length; + this._pStitchDirty = true; + }; + /** + * @inheritDoc + */ + VertexClipNode.prototype._pUpdateStitch = function () { + _super.prototype._pUpdateStitch.call(this); + var i = this._pNumFrames - 1; + var p1, p2, delta; + while (i--) { + this._pTotalDuration += this._pDurations[i]; + p1 = this._translations[i]; + p2 = this._translations[i + 1]; + delta = p2.subtract(p1); + this._pTotalDelta.x += delta.x; + this._pTotalDelta.y += delta.y; + this._pTotalDelta.z += delta.z; + } + if (this._pNumFrames > 1 && (this._pStitchFinalFrame || !this._pLooping)) { + this._pTotalDuration += this._pDurations[this._pNumFrames - 1]; + p1 = this._translations[0]; + p2 = this._translations[1]; + delta = p2.subtract(p1); + this._pTotalDelta.x += delta.x; + this._pTotalDelta.y += delta.y; + this._pTotalDelta.z += delta.z; + } + }; + return VertexClipNode; +})(AnimationClipNodeBase); +module.exports = VertexClipNode; + + +},{"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-renderergl/lib/animators/nodes/AnimationClipNodeBase":undefined,"awayjs-renderergl/lib/animators/states/VertexClipState":undefined}],"awayjs-renderergl/lib/animators/states/AnimationClipState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var AnimationStateBase = require("awayjs-renderergl/lib/animators/states/AnimationStateBase"); +var AnimationStateEvent = require("awayjs-renderergl/lib/events/AnimationStateEvent"); +/** + * + */ +var AnimationClipState = (function (_super) { + __extends(AnimationClipState, _super); + function AnimationClipState(animator, animationClipNode) { + _super.call(this, animator, animationClipNode); + this._pFramesDirty = true; + this._animationClipNode = animationClipNode; + } + Object.defineProperty(AnimationClipState.prototype, "blendWeight", { + /** + * Returns a fractional value between 0 and 1 representing the blending ratio of the current playhead position + * between the current frame (0) and next frame (1) of the animation. + * + * @see #currentFrame + * @see #nextFrame + */ + get: function () { + if (this._pFramesDirty) + this._pUpdateFrames(); + return this._pBlendWeight; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationClipState.prototype, "currentFrame", { + /** + * Returns the current frame of animation in the clip based on the internal playhead position. + */ + get: function () { + if (this._pFramesDirty) + this._pUpdateFrames(); + return this._pCurrentFrame; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationClipState.prototype, "nextFrame", { + /** + * Returns the next frame of animation in the clip based on the internal playhead position. + */ + get: function () { + if (this._pFramesDirty) + this._pUpdateFrames(); + return this._pNextFrame; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + AnimationClipState.prototype.update = function (time /*int*/) { + if (!this._animationClipNode.looping) { + if (time > this._pStartTime + this._animationClipNode.totalDuration) + time = this._pStartTime + this._animationClipNode.totalDuration; + else if (time < this._pStartTime) + time = this._pStartTime; + } + if (this._pTime == time - this._pStartTime) + return; + this._pUpdateTime(time); + }; + /** + * @inheritDoc + */ + AnimationClipState.prototype.phase = function (value) { + var time = value * this._animationClipNode.totalDuration + this._pStartTime; + if (this._pTime == time - this._pStartTime) + return; + this._pUpdateTime(time); + }; + /** + * @inheritDoc + */ + AnimationClipState.prototype._pUpdateTime = function (time /*int*/) { + this._pFramesDirty = true; + this._pTimeDir = (time - this._pStartTime > this._pTime) ? 1 : -1; + _super.prototype._pUpdateTime.call(this, time); + }; + /** + * Updates the nodes internal playhead to determine the current and next animation frame, and the blendWeight between the two. + * + * @see #currentFrame + * @see #nextFrame + * @see #blendWeight + */ + AnimationClipState.prototype._pUpdateFrames = function () { + this._pFramesDirty = false; + var looping = this._animationClipNode.looping; + var totalDuration = this._animationClipNode.totalDuration; + var lastFrame = this._animationClipNode.lastFrame; + var time = this._pTime; + //trace("time", time, totalDuration) + if (looping && (time >= totalDuration || time < 0)) { + time %= totalDuration; + if (time < 0) + time += totalDuration; + } + if (!looping && time >= totalDuration) { + this.notifyPlaybackComplete(); + this._pCurrentFrame = lastFrame; + this._pNextFrame = lastFrame; + this._pBlendWeight = 0; + } + else if (!looping && time <= 0) { + this._pCurrentFrame = 0; + this._pNextFrame = 0; + this._pBlendWeight = 0; + } + else if (this._animationClipNode.fixedFrameRate) { + var t = time / totalDuration * lastFrame; + this._pCurrentFrame = Math.floor(t); + this._pBlendWeight = t - this._pCurrentFrame; + this._pNextFrame = this._pCurrentFrame + 1; + } + else { + this._pCurrentFrame = 0; + this._pNextFrame = 0; + var dur = 0, frameTime /*uint*/; + var durations = this._animationClipNode.durations; + do { + frameTime = dur; + dur += durations[this._pNextFrame]; + this._pCurrentFrame = this._pNextFrame++; + } while (time > dur); + if (this._pCurrentFrame == lastFrame) { + this._pCurrentFrame = 0; + this._pNextFrame = 1; + } + this._pBlendWeight = (time - frameTime) / durations[this._pCurrentFrame]; + } + }; + AnimationClipState.prototype.notifyPlaybackComplete = function () { + if (this._animationStatePlaybackComplete == null) + this._animationStatePlaybackComplete = new AnimationStateEvent(AnimationStateEvent.PLAYBACK_COMPLETE, this._pAnimator, this, this._animationClipNode); + this._animationClipNode.dispatchEvent(this._animationStatePlaybackComplete); + }; + return AnimationClipState; +})(AnimationStateBase); +module.exports = AnimationClipState; + + +},{"awayjs-renderergl/lib/animators/states/AnimationStateBase":undefined,"awayjs-renderergl/lib/events/AnimationStateEvent":undefined}],"awayjs-renderergl/lib/animators/states/AnimationStateBase":[function(require,module,exports){ +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +/** + * + */ +var AnimationStateBase = (function () { + function AnimationStateBase(animator, animationNode) { + this._pRootDelta = new Vector3D(); + this._pPositionDeltaDirty = true; + this._pStartTime = 0; + this._pAnimator = animator; + this._pAnimationNode = animationNode; + } + Object.defineProperty(AnimationStateBase.prototype, "positionDelta", { + /** + * Returns a 3d vector representing the translation delta of the animating entity for the current timestep of animation + */ + get: function () { + if (this._pPositionDeltaDirty) { + this._pUpdatePositionDelta(); + } + return this._pRootDelta; + }, + enumerable: true, + configurable: true + }); + /** + * Resets the start time of the node to a new value. + * + * @param startTime The absolute start time (in milliseconds) of the node's starting time. + */ + AnimationStateBase.prototype.offset = function (startTime) { + this._pStartTime = startTime; + this._pPositionDeltaDirty = true; + }; + /** + * Updates the configuration of the node to its current state. + * + * @param time The absolute time (in milliseconds) of the animator's play head position. + * + * @see AnimatorBase#update() + */ + AnimationStateBase.prototype.update = function (time) { + if (this._pTime == time - this._pStartTime) { + return; + } + this._pUpdateTime(time); + }; + /** + * Sets the animation phase of the node. + * + * @param value The phase value to use. 0 represents the beginning of an animation clip, 1 represents the end. + */ + AnimationStateBase.prototype.phase = function (value) { + }; + /** + * Updates the node's internal playhead position. + * + * @param time The local time (in milliseconds) of the node's playhead position. + */ + AnimationStateBase.prototype._pUpdateTime = function (time) { + this._pTime = time - this._pStartTime; + this._pPositionDeltaDirty = true; + }; + /** + * Updates the node's root delta position + */ + AnimationStateBase.prototype._pUpdatePositionDelta = function () { + }; + return AnimationStateBase; +})(); +module.exports = AnimationStateBase; + + +},{"awayjs-core/lib/core/geom/Vector3D":undefined}],"awayjs-renderergl/lib/animators/states/ISkeletonAnimationState":[function(require,module,exports){ + + + +},{}],"awayjs-renderergl/lib/animators/states/IVertexAnimationState":[function(require,module,exports){ + + + +},{}],"awayjs-renderergl/lib/animators/states/ParticleAccelerationState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var ContextGLVertexBufferFormat = require("awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); +/** + * ... + */ +var ParticleAccelerationState = (function (_super) { + __extends(ParticleAccelerationState, _super); + function ParticleAccelerationState(animator, particleAccelerationNode) { + _super.call(this, animator, particleAccelerationNode); + this._particleAccelerationNode = particleAccelerationNode; + this._acceleration = this._particleAccelerationNode._acceleration; + this.updateAccelerationData(); + } + Object.defineProperty(ParticleAccelerationState.prototype, "acceleration", { + /** + * Defines the acceleration vector of the state, used when in global mode. + */ + get: function () { + return this._acceleration; + }, + set: function (value) { + this._acceleration.x = value.x; + this._acceleration.y = value.y; + this._acceleration.z = value.z; + this.updateAccelerationData(); + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + ParticleAccelerationState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { + var index = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleAccelerationState.ACCELERATION_INDEX); + if (this._particleAccelerationNode.mode == ParticlePropertiesMode.LOCAL_STATIC) + animationSubGeometry.activateVertexBuffer(index, this._particleAccelerationNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); + else + animationRegisterCache.setVertexConst(index, this._halfAcceleration.x, this._halfAcceleration.y, this._halfAcceleration.z); + }; + ParticleAccelerationState.prototype.updateAccelerationData = function () { + if (this._particleAccelerationNode.mode == ParticlePropertiesMode.GLOBAL) + this._halfAcceleration = new Vector3D(this._acceleration.x / 2, this._acceleration.y / 2, this._acceleration.z / 2); + }; + /** @private */ + ParticleAccelerationState.ACCELERATION_INDEX = 0; + return ParticleAccelerationState; +})(ParticleStateBase); +module.exports = ParticleAccelerationState; + + +},{"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/states/ParticleStateBase":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat":undefined}],"awayjs-renderergl/lib/animators/states/ParticleBezierCurveState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ContextGLVertexBufferFormat = require("awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); +/** + * ... + */ +var ParticleBezierCurveState = (function (_super) { + __extends(ParticleBezierCurveState, _super); + function ParticleBezierCurveState(animator, particleBezierCurveNode) { + _super.call(this, animator, particleBezierCurveNode); + this._particleBezierCurveNode = particleBezierCurveNode; + this._controlPoint = this._particleBezierCurveNode._iControlPoint; + this._endPoint = this._particleBezierCurveNode._iEndPoint; + } + Object.defineProperty(ParticleBezierCurveState.prototype, "controlPoint", { + /** + * Defines the default control point of the node, used when in global mode. + */ + get: function () { + return this._controlPoint; + }, + set: function (value) { + this._controlPoint = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleBezierCurveState.prototype, "endPoint", { + /** + * Defines the default end point of the node, used when in global mode. + */ + get: function () { + return this._endPoint; + }, + set: function (value) { + this._endPoint = value; + }, + enumerable: true, + configurable: true + }); + ParticleBezierCurveState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { + var controlIndex = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleBezierCurveState.BEZIER_CONTROL_INDEX); + var endIndex = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleBezierCurveState.BEZIER_END_INDEX); + if (this._particleBezierCurveNode.mode == ParticlePropertiesMode.LOCAL_STATIC) { + animationSubGeometry.activateVertexBuffer(controlIndex, this._particleBezierCurveNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); + animationSubGeometry.activateVertexBuffer(endIndex, this._particleBezierCurveNode._iDataOffset + 3, stage, ContextGLVertexBufferFormat.FLOAT_3); + } + else { + animationRegisterCache.setVertexConst(controlIndex, this._controlPoint.x, this._controlPoint.y, this._controlPoint.z); + animationRegisterCache.setVertexConst(endIndex, this._endPoint.x, this._endPoint.y, this._endPoint.z); + } + }; + /** @private */ + ParticleBezierCurveState.BEZIER_CONTROL_INDEX = 0; + /** @private */ + ParticleBezierCurveState.BEZIER_END_INDEX = 1; + return ParticleBezierCurveState; +})(ParticleStateBase); +module.exports = ParticleBezierCurveState; + + +},{"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/states/ParticleStateBase":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat":undefined}],"awayjs-renderergl/lib/animators/states/ParticleBillboardState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var MathConsts = require("awayjs-core/lib/core/geom/MathConsts"); +var Matrix3D = require("awayjs-core/lib/core/geom/Matrix3D"); +var Orientation3D = require("awayjs-core/lib/core/geom/Orientation3D"); +var ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); +/** + * ... + */ +var ParticleBillboardState = (function (_super) { + __extends(ParticleBillboardState, _super); + /** + * + */ + function ParticleBillboardState(animator, particleNode) { + _super.call(this, animator, particleNode); + this._matrix = new Matrix3D; + this._billboardAxis = particleNode._iBillboardAxis; + } + ParticleBillboardState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { + var comps; + if (this._billboardAxis) { + var pos = renderable.sourceEntity.sceneTransform.position; + var look = camera.sceneTransform.position.subtract(pos); + var right = look.crossProduct(this._billboardAxis); + right.normalize(); + look = this.billboardAxis.crossProduct(right); + look.normalize(); + //create a quick inverse projection matrix + this._matrix.copyFrom(renderable.sourceEntity.sceneTransform); + comps = this._matrix.decompose(Orientation3D.AXIS_ANGLE); + this._matrix.copyColumnFrom(0, right); + this._matrix.copyColumnFrom(1, this.billboardAxis); + this._matrix.copyColumnFrom(2, look); + this._matrix.copyColumnFrom(3, pos); + this._matrix.appendRotation(-comps[1].w * MathConsts.RADIANS_TO_DEGREES, comps[1]); + } + else { + //create a quick inverse projection matrix + this._matrix.copyFrom(renderable.sourceEntity.sceneTransform); + this._matrix.append(camera.inverseSceneTransform); + //decompose using axis angle rotations + comps = this._matrix.decompose(Orientation3D.AXIS_ANGLE); + //recreate the matrix with just the rotation data + this._matrix.identity(); + this._matrix.appendRotation(-comps[1].w * MathConsts.RADIANS_TO_DEGREES, comps[1]); + } + //set a new matrix transform constant + animationRegisterCache.setVertexConstFromMatrix(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleBillboardState.MATRIX_INDEX), this._matrix); + }; + Object.defineProperty(ParticleBillboardState.prototype, "billboardAxis", { + /** + * Defines the billboard axis. + */ + get: function () { + return this.billboardAxis; + }, + set: function (value) { + this.billboardAxis = value ? value.clone() : null; + if (this.billboardAxis) + this.billboardAxis.normalize(); + }, + enumerable: true, + configurable: true + }); + /** @private */ + ParticleBillboardState.MATRIX_INDEX = 0; + return ParticleBillboardState; +})(ParticleStateBase); +module.exports = ParticleBillboardState; + + +},{"awayjs-core/lib/core/geom/MathConsts":undefined,"awayjs-core/lib/core/geom/Matrix3D":undefined,"awayjs-core/lib/core/geom/Orientation3D":undefined,"awayjs-renderergl/lib/animators/states/ParticleStateBase":undefined}],"awayjs-renderergl/lib/animators/states/ParticleColorState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var ContextGLVertexBufferFormat = require("awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); +/** + * ... + * @author ... + */ +var ParticleColorState = (function (_super) { + __extends(ParticleColorState, _super); + function ParticleColorState(animator, particleColorNode) { + _super.call(this, animator, particleColorNode); + this._particleColorNode = particleColorNode; + this._usesMultiplier = this._particleColorNode._iUsesMultiplier; + this._usesOffset = this._particleColorNode._iUsesOffset; + this._usesCycle = this._particleColorNode._iUsesCycle; + this._usesPhase = this._particleColorNode._iUsesPhase; + this._startColor = this._particleColorNode._iStartColor; + this._endColor = this._particleColorNode._iEndColor; + this._cycleDuration = this._particleColorNode._iCycleDuration; + this._cyclePhase = this._particleColorNode._iCyclePhase; + this.updateColorData(); + } + Object.defineProperty(ParticleColorState.prototype, "startColor", { + /** + * Defines the start color transform of the state, when in global mode. + */ + get: function () { + return this._startColor; + }, + set: function (value) { + this._startColor = value; + this.updateColorData(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleColorState.prototype, "endColor", { + /** + * Defines the end color transform of the state, when in global mode. + */ + get: function () { + return this._endColor; + }, + set: function (value) { + this._endColor = value; + this.updateColorData(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleColorState.prototype, "cycleDuration", { + /** + * Defines the duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. + */ + get: function () { + return this._cycleDuration; + }, + set: function (value) { + this._cycleDuration = value; + this.updateColorData(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleColorState.prototype, "cyclePhase", { + /** + * Defines the phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. + */ + get: function () { + return this._cyclePhase; + }, + set: function (value) { + this._cyclePhase = value; + this.updateColorData(); + }, + enumerable: true, + configurable: true + }); + ParticleColorState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { + if (animationRegisterCache.needFragmentAnimation) { + var dataOffset = this._particleColorNode._iDataOffset; + if (this._usesCycle) + animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorState.CYCLE_INDEX), this._cycleData.x, this._cycleData.y, this._cycleData.z, this._cycleData.w); + if (this._usesMultiplier) { + if (this._particleColorNode.mode == ParticlePropertiesMode.LOCAL_STATIC) { + animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorState.START_MULTIPLIER_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); + dataOffset += 4; + animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorState.DELTA_MULTIPLIER_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); + dataOffset += 4; + } + else { + animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorState.START_MULTIPLIER_INDEX), this._startMultiplierData.x, this._startMultiplierData.y, this._startMultiplierData.z, this._startMultiplierData.w); + animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorState.DELTA_MULTIPLIER_INDEX), this._deltaMultiplierData.x, this._deltaMultiplierData.y, this._deltaMultiplierData.z, this._deltaMultiplierData.w); + } + } + if (this._usesOffset) { + if (this._particleColorNode.mode == ParticlePropertiesMode.LOCAL_STATIC) { + animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorState.START_OFFSET_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); + dataOffset += 4; + animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorState.DELTA_OFFSET_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); + dataOffset += 4; + } + else { + animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorState.START_OFFSET_INDEX), this._startOffsetData.x, this._startOffsetData.y, this._startOffsetData.z, this._startOffsetData.w); + animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorState.DELTA_OFFSET_INDEX), this._deltaOffsetData.x, this._deltaOffsetData.y, this._deltaOffsetData.z, this._deltaOffsetData.w); + } + } + } + }; + ParticleColorState.prototype.updateColorData = function () { + if (this._usesCycle) { + if (this._cycleDuration <= 0) + throw (new Error("the cycle duration must be greater than zero")); + this._cycleData = new Vector3D(Math.PI * 2 / this._cycleDuration, this._cyclePhase * Math.PI / 180, 0, 0); + } + if (this._particleColorNode.mode == ParticlePropertiesMode.GLOBAL) { + if (this._usesCycle) { + if (this._usesMultiplier) { + this._startMultiplierData = new Vector3D((this._startColor.redMultiplier + this._endColor.redMultiplier) / 2, (this._startColor.greenMultiplier + this._endColor.greenMultiplier) / 2, (this._startColor.blueMultiplier + this._endColor.blueMultiplier) / 2, (this._startColor.alphaMultiplier + this._endColor.alphaMultiplier) / 2); + this._deltaMultiplierData = new Vector3D((this._endColor.redMultiplier - this._startColor.redMultiplier) / 2, (this._endColor.greenMultiplier - this._startColor.greenMultiplier) / 2, (this._endColor.blueMultiplier - this._startColor.blueMultiplier) / 2, (this._endColor.alphaMultiplier - this._startColor.alphaMultiplier) / 2); + } + if (this._usesOffset) { + this._startOffsetData = new Vector3D((this._startColor.redOffset + this._endColor.redOffset) / (255 * 2), (this._startColor.greenOffset + this._endColor.greenOffset) / (255 * 2), (this._startColor.blueOffset + this._endColor.blueOffset) / (255 * 2), (this._startColor.alphaOffset + this._endColor.alphaOffset) / (255 * 2)); + this._deltaOffsetData = new Vector3D((this._endColor.redOffset - this._startColor.redOffset) / (255 * 2), (this._endColor.greenOffset - this._startColor.greenOffset) / (255 * 2), (this._endColor.blueOffset - this._startColor.blueOffset) / (255 * 2), (this._endColor.alphaOffset - this._startColor.alphaOffset) / (255 * 2)); + } + } + else { + if (this._usesMultiplier) { + this._startMultiplierData = new Vector3D(this._startColor.redMultiplier, this._startColor.greenMultiplier, this._startColor.blueMultiplier, this._startColor.alphaMultiplier); + this._deltaMultiplierData = new Vector3D((this._endColor.redMultiplier - this._startColor.redMultiplier), (this._endColor.greenMultiplier - this._startColor.greenMultiplier), (this._endColor.blueMultiplier - this._startColor.blueMultiplier), (this._endColor.alphaMultiplier - this._startColor.alphaMultiplier)); + } + if (this._usesOffset) { + this._startOffsetData = new Vector3D(this._startColor.redOffset / 255, this._startColor.greenOffset / 255, this._startColor.blueOffset / 255, this._startColor.alphaOffset / 255); + this._deltaOffsetData = new Vector3D((this._endColor.redOffset - this._startColor.redOffset) / 255, (this._endColor.greenOffset - this._startColor.greenOffset) / 255, (this._endColor.blueOffset - this._startColor.blueOffset) / 255, (this._endColor.alphaOffset - this._startColor.alphaOffset) / 255); + } + } + } + }; + /** @private */ + ParticleColorState.START_MULTIPLIER_INDEX = 0; + /** @private */ + ParticleColorState.DELTA_MULTIPLIER_INDEX = 1; + /** @private */ + ParticleColorState.START_OFFSET_INDEX = 2; + /** @private */ + ParticleColorState.DELTA_OFFSET_INDEX = 3; + /** @private */ + ParticleColorState.CYCLE_INDEX = 4; + return ParticleColorState; +})(ParticleStateBase); +module.exports = ParticleColorState; + + +},{"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/states/ParticleStateBase":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat":undefined}],"awayjs-renderergl/lib/animators/states/ParticleFollowState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var MathConsts = require("awayjs-core/lib/core/geom/MathConsts"); +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var ContextGLVertexBufferFormat = require("awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat"); +var ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); +/** + * ... + */ +var ParticleFollowState = (function (_super) { + __extends(ParticleFollowState, _super); + function ParticleFollowState(animator, particleFollowNode) { + _super.call(this, animator, particleFollowNode, true); + this._targetPos = new Vector3D(); + this._targetEuler = new Vector3D(); + //temporary vector3D for calculation + this._temp = new Vector3D(); + this._particleFollowNode = particleFollowNode; + this._smooth = particleFollowNode._iSmooth; + } + Object.defineProperty(ParticleFollowState.prototype, "followTarget", { + get: function () { + return this._followTarget; + }, + set: function (value) { + this._followTarget = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleFollowState.prototype, "smooth", { + get: function () { + return this._smooth; + }, + set: function (value) { + this._smooth = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + ParticleFollowState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { + if (this._followTarget) { + if (this._particleFollowNode._iUsesPosition) { + this._targetPos.x = this._followTarget.transform.position.x / renderable.sourceEntity.scaleX; + this._targetPos.y = this._followTarget.transform.position.y / renderable.sourceEntity.scaleY; + this._targetPos.z = this._followTarget.transform.position.z / renderable.sourceEntity.scaleZ; + } + if (this._particleFollowNode._iUsesRotation) { + this._targetEuler.x = this._followTarget.rotationX; + this._targetEuler.y = this._followTarget.rotationY; + this._targetEuler.z = this._followTarget.rotationZ; + this._targetEuler.scaleBy(MathConsts.DEGREES_TO_RADIANS); + } + } + //initialization + if (!this._prePos) + this._prePos = this._targetPos.clone(); + if (!this._preEuler) + this._preEuler = this._targetEuler.clone(); + var currentTime = this._pTime / 1000; + var previousTime = animationSubGeometry.previousTime; + var deltaTime = currentTime - previousTime; + var needProcess = previousTime != currentTime; + if (this._particleFollowNode._iUsesPosition && this._particleFollowNode._iUsesRotation) { + if (needProcess) + this.processPositionAndRotation(currentTime, deltaTime, animationSubGeometry); + animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleFollowState.FOLLOW_POSITION_INDEX), this._particleFollowNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); + animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleFollowState.FOLLOW_ROTATION_INDEX), this._particleFollowNode._iDataOffset + 3, stage, ContextGLVertexBufferFormat.FLOAT_3); + } + else if (this._particleFollowNode._iUsesPosition) { + if (needProcess) + this.processPosition(currentTime, deltaTime, animationSubGeometry); + animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleFollowState.FOLLOW_POSITION_INDEX), this._particleFollowNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); + } + else if (this._particleFollowNode._iUsesRotation) { + if (needProcess) + this.precessRotation(currentTime, deltaTime, animationSubGeometry); + animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleFollowState.FOLLOW_ROTATION_INDEX), this._particleFollowNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); + } + this._prePos.copyFrom(this._targetPos); + this._targetEuler.copyFrom(this._targetEuler); + animationSubGeometry.previousTime = currentTime; + }; + ParticleFollowState.prototype.processPosition = function (currentTime, deltaTime, animationSubGeometry) { + var data = animationSubGeometry.animationParticles; + var vertexData = animationSubGeometry.vertexData; + var changed = false; + var len = data.length; + var interpolatedPos; + var posVelocity; + if (this._smooth) { + posVelocity = this._prePos.subtract(this._targetPos); + posVelocity.scaleBy(1 / deltaTime); + } + else + interpolatedPos = this._targetPos; + for (var i = 0; i < len; i++) { + var k = (currentTime - data[i].startTime) / data[i].totalTime; + var t = (k - Math.floor(k)) * data[i].totalTime; + if (t - deltaTime <= 0) { + var inc = data[i].startVertexIndex * animationSubGeometry.totalLenOfOneVertex + this._particleFollowNode._iDataOffset; + if (this._smooth) { + this._temp.copyFrom(posVelocity); + this._temp.scaleBy(t); + interpolatedPos = this._targetPos.add(this._temp); + } + if (vertexData[inc] != interpolatedPos.x || vertexData[inc + 1] != interpolatedPos.y || vertexData[inc + 2] != interpolatedPos.z) { + changed = true; + for (var j = 0; j < data[i].numVertices; j++) { + vertexData[inc++] = interpolatedPos.x; + vertexData[inc++] = interpolatedPos.y; + vertexData[inc++] = interpolatedPos.z; + } + } + } + } + if (changed) + animationSubGeometry.invalidateBuffer(); + }; + ParticleFollowState.prototype.precessRotation = function (currentTime, deltaTime, animationSubGeometry) { + var data = animationSubGeometry.animationParticles; + var vertexData = animationSubGeometry.vertexData; + var changed = false; + var len = data.length; + var interpolatedRotation; + var rotationVelocity; + if (this._smooth) { + rotationVelocity = this._preEuler.subtract(this._targetEuler); + rotationVelocity.scaleBy(1 / deltaTime); + } + else + interpolatedRotation = this._targetEuler; + for (var i = 0; i < len; i++) { + var k = (currentTime - data[i].startTime) / data[i].totalTime; + var t = (k - Math.floor(k)) * data[i].totalTime; + if (t - deltaTime <= 0) { + var inc = data[i].startVertexIndex * animationSubGeometry.totalLenOfOneVertex + this._particleFollowNode._iDataOffset; + if (this._smooth) { + this._temp.copyFrom(rotationVelocity); + this._temp.scaleBy(t); + interpolatedRotation = this._targetEuler.add(this._temp); + } + if (vertexData[inc] != interpolatedRotation.x || vertexData[inc + 1] != interpolatedRotation.y || vertexData[inc + 2] != interpolatedRotation.z) { + changed = true; + for (var j = 0; j < data[i].numVertices; j++) { + vertexData[inc++] = interpolatedRotation.x; + vertexData[inc++] = interpolatedRotation.y; + vertexData[inc++] = interpolatedRotation.z; + } + } + } + } + if (changed) + animationSubGeometry.invalidateBuffer(); + }; + ParticleFollowState.prototype.processPositionAndRotation = function (currentTime, deltaTime, animationSubGeometry) { + var data = animationSubGeometry.animationParticles; + var vertexData = animationSubGeometry.vertexData; + var changed = false; + var len = data.length; + var interpolatedPos; + var interpolatedRotation; + var posVelocity; + var rotationVelocity; + if (this._smooth) { + posVelocity = this._prePos.subtract(this._targetPos); + posVelocity.scaleBy(1 / deltaTime); + rotationVelocity = this._preEuler.subtract(this._targetEuler); + rotationVelocity.scaleBy(1 / deltaTime); + } + else { + interpolatedPos = this._targetPos; + interpolatedRotation = this._targetEuler; + } + for (var i = 0; i < len; i++) { + var k = (currentTime - data[i].startTime) / data[i].totalTime; + var t = (k - Math.floor(k)) * data[i].totalTime; + if (t - deltaTime <= 0) { + var inc = data[i].startVertexIndex * animationSubGeometry.totalLenOfOneVertex + this._particleFollowNode._iDataOffset; + if (this._smooth) { + this._temp.copyFrom(posVelocity); + this._temp.scaleBy(t); + interpolatedPos = this._targetPos.add(this._temp); + this._temp.copyFrom(rotationVelocity); + this._temp.scaleBy(t); + interpolatedRotation = this._targetEuler.add(this._temp); + } + if (vertexData[inc] != interpolatedPos.x || vertexData[inc + 1] != interpolatedPos.y || vertexData[inc + 2] != interpolatedPos.z || vertexData[inc + 3] != interpolatedRotation.x || vertexData[inc + 4] != interpolatedRotation.y || vertexData[inc + 5] != interpolatedRotation.z) { + changed = true; + for (var j = 0; j < data[i].numVertices; j++) { + vertexData[inc++] = interpolatedPos.x; + vertexData[inc++] = interpolatedPos.y; + vertexData[inc++] = interpolatedPos.z; + vertexData[inc++] = interpolatedRotation.x; + vertexData[inc++] = interpolatedRotation.y; + vertexData[inc++] = interpolatedRotation.z; + } + } + } + } + if (changed) + animationSubGeometry.invalidateBuffer(); + }; + /** @private */ + ParticleFollowState.FOLLOW_POSITION_INDEX = 0; + /** @private */ + ParticleFollowState.FOLLOW_ROTATION_INDEX = 1; + return ParticleFollowState; +})(ParticleStateBase); +module.exports = ParticleFollowState; + + +},{"awayjs-core/lib/core/geom/MathConsts":undefined,"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-renderergl/lib/animators/states/ParticleStateBase":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat":undefined}],"awayjs-renderergl/lib/animators/states/ParticleInitialColorState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var ContextGLVertexBufferFormat = require("awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); +/** +* +*/ +var ParticleInitialColorState = (function (_super) { + __extends(ParticleInitialColorState, _super); + function ParticleInitialColorState(animator, particleInitialColorNode) { + _super.call(this, animator, particleInitialColorNode); + this._particleInitialColorNode = particleInitialColorNode; + this._usesMultiplier = particleInitialColorNode._iUsesMultiplier; + this._usesOffset = particleInitialColorNode._iUsesOffset; + this._initialColor = particleInitialColorNode._iInitialColor; + this.updateColorData(); + } + Object.defineProperty(ParticleInitialColorState.prototype, "initialColor", { + /** + * Defines the initial color transform of the state, when in global mode. + */ + get: function () { + return this._initialColor; + }, + set: function (value) { + this._initialColor = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + ParticleInitialColorState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { + // TODO: not used + renderable = renderable; + camera = camera; + if (animationRegisterCache.needFragmentAnimation) { + if (this._particleInitialColorNode.mode == ParticlePropertiesMode.LOCAL_STATIC) { + var dataOffset = this._particleInitialColorNode._iDataOffset; + if (this._usesMultiplier) { + animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleInitialColorState.MULTIPLIER_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); + dataOffset += 4; + } + if (this._usesOffset) + animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleInitialColorState.OFFSET_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); + } + else { + if (this._usesMultiplier) + animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleInitialColorState.MULTIPLIER_INDEX), this._multiplierData.x, this._multiplierData.y, this._multiplierData.z, this._multiplierData.w); + if (this._usesOffset) + animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleInitialColorState.OFFSET_INDEX), this._offsetData.x, this._offsetData.y, this._offsetData.z, this._offsetData.w); + } + } + }; + ParticleInitialColorState.prototype.updateColorData = function () { + if (this._particleInitialColorNode.mode == ParticlePropertiesMode.GLOBAL) { + if (this._usesMultiplier) + this._multiplierData = new Vector3D(this._initialColor.redMultiplier, this._initialColor.greenMultiplier, this._initialColor.blueMultiplier, this._initialColor.alphaMultiplier); + if (this._usesOffset) + this._offsetData = new Vector3D(this._initialColor.redOffset / 255, this._initialColor.greenOffset / 255, this._initialColor.blueOffset / 255, this._initialColor.alphaOffset / 255); + } + }; + /** @private */ + ParticleInitialColorState.MULTIPLIER_INDEX = 0; + /** @private */ + ParticleInitialColorState.OFFSET_INDEX = 1; + return ParticleInitialColorState; +})(ParticleStateBase); +module.exports = ParticleInitialColorState; + + +},{"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/states/ParticleStateBase":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat":undefined}],"awayjs-renderergl/lib/animators/states/ParticleOrbitState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Matrix3D = require("awayjs-core/lib/core/geom/Matrix3D"); +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var ContextGLVertexBufferFormat = require("awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); +/** + * ... + */ +var ParticleOrbitState = (function (_super) { + __extends(ParticleOrbitState, _super); + function ParticleOrbitState(animator, particleOrbitNode) { + _super.call(this, animator, particleOrbitNode); + this._particleOrbitNode = particleOrbitNode; + this._usesEulers = this._particleOrbitNode._iUsesEulers; + this._usesCycle = this._particleOrbitNode._iUsesCycle; + this._usesPhase = this._particleOrbitNode._iUsesPhase; + this._eulers = this._particleOrbitNode._iEulers; + this._radius = this._particleOrbitNode._iRadius; + this._cycleDuration = this._particleOrbitNode._iCycleDuration; + this._cyclePhase = this._particleOrbitNode._iCyclePhase; + this.updateOrbitData(); + } + Object.defineProperty(ParticleOrbitState.prototype, "radius", { + /** + * Defines the radius of the orbit when in global mode. Defaults to 100. + */ + get: function () { + return this._radius; + }, + set: function (value) { + this._radius = value; + this.updateOrbitData(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleOrbitState.prototype, "cycleDuration", { + /** + * Defines the duration of the orbit in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. + */ + get: function () { + return this._cycleDuration; + }, + set: function (value) { + this._cycleDuration = value; + this.updateOrbitData(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleOrbitState.prototype, "cyclePhase", { + /** + * Defines the phase of the orbit in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. + */ + get: function () { + return this._cyclePhase; + }, + set: function (value) { + this._cyclePhase = value; + this.updateOrbitData(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleOrbitState.prototype, "eulers", { + /** + * Defines the euler rotation in degrees, applied to the orientation of the orbit when in global mode. + */ + get: function () { + return this._eulers; + }, + set: function (value) { + this._eulers = value; + this.updateOrbitData(); + }, + enumerable: true, + configurable: true + }); + ParticleOrbitState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { + var index = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleOrbitState.ORBIT_INDEX); + if (this._particleOrbitNode.mode == ParticlePropertiesMode.LOCAL_STATIC) { + if (this._usesPhase) + animationSubGeometry.activateVertexBuffer(index, this._particleOrbitNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); + else + animationSubGeometry.activateVertexBuffer(index, this._particleOrbitNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); + } + else + animationRegisterCache.setVertexConst(index, this._orbitData.x, this._orbitData.y, this._orbitData.z, this._orbitData.w); + if (this._usesEulers) + animationRegisterCache.setVertexConstFromMatrix(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleOrbitState.EULERS_INDEX), this._eulersMatrix); + }; + ParticleOrbitState.prototype.updateOrbitData = function () { + if (this._usesEulers) { + this._eulersMatrix = new Matrix3D(); + this._eulersMatrix.appendRotation(this._eulers.x, Vector3D.X_AXIS); + this._eulersMatrix.appendRotation(this._eulers.y, Vector3D.Y_AXIS); + this._eulersMatrix.appendRotation(this._eulers.z, Vector3D.Z_AXIS); + } + if (this._particleOrbitNode.mode == ParticlePropertiesMode.GLOBAL) { + this._orbitData = new Vector3D(this._radius, 0, this._radius * Math.PI * 2, this._cyclePhase * Math.PI / 180); + if (this._usesCycle) { + if (this._cycleDuration <= 0) + throw (new Error("the cycle duration must be greater than zero")); + this._orbitData.y = Math.PI * 2 / this._cycleDuration; + } + else + this._orbitData.y = Math.PI * 2; + } + }; + /** @private */ + ParticleOrbitState.ORBIT_INDEX = 0; + /** @private */ + ParticleOrbitState.EULERS_INDEX = 1; + return ParticleOrbitState; +})(ParticleStateBase); +module.exports = ParticleOrbitState; + + +},{"awayjs-core/lib/core/geom/Matrix3D":undefined,"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/states/ParticleStateBase":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat":undefined}],"awayjs-renderergl/lib/animators/states/ParticleOscillatorState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var ContextGLVertexBufferFormat = require("awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); +/** + * ... + */ +var ParticleOscillatorState = (function (_super) { + __extends(ParticleOscillatorState, _super); + function ParticleOscillatorState(animator, particleOscillatorNode) { + _super.call(this, animator, particleOscillatorNode); + this._particleOscillatorNode = particleOscillatorNode; + this._oscillator = this._particleOscillatorNode._iOscillator; + this.updateOscillatorData(); + } + Object.defineProperty(ParticleOscillatorState.prototype, "oscillator", { + /** + * Defines the default oscillator axis (x, y, z) and cycleDuration (w) of the state, used when in global mode. + */ + get: function () { + return this._oscillator; + }, + set: function (value) { + this._oscillator = value; + this.updateOscillatorData(); + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + ParticleOscillatorState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { + var index = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleOscillatorState.OSCILLATOR_INDEX); + if (this._particleOscillatorNode.mode == ParticlePropertiesMode.LOCAL_STATIC) + animationSubGeometry.activateVertexBuffer(index, this._particleOscillatorNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); + else + animationRegisterCache.setVertexConst(index, this._oscillatorData.x, this._oscillatorData.y, this._oscillatorData.z, this._oscillatorData.w); + }; + ParticleOscillatorState.prototype.updateOscillatorData = function () { + if (this._particleOscillatorNode.mode == ParticlePropertiesMode.GLOBAL) { + if (this._oscillator.w <= 0) + throw (new Error("the cycle duration must greater than zero")); + if (this._oscillatorData == null) + this._oscillatorData = new Vector3D(); + this._oscillatorData.x = this._oscillator.x; + this._oscillatorData.y = this._oscillator.y; + this._oscillatorData.z = this._oscillator.z; + this._oscillatorData.w = Math.PI * 2 / this._oscillator.w; + } + }; + /** @private */ + ParticleOscillatorState.OSCILLATOR_INDEX = 0; + return ParticleOscillatorState; +})(ParticleStateBase); +module.exports = ParticleOscillatorState; + + +},{"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/states/ParticleStateBase":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat":undefined}],"awayjs-renderergl/lib/animators/states/ParticlePositionState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ContextGLVertexBufferFormat = require("awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); +/** + * ... + * @author ... + */ +var ParticlePositionState = (function (_super) { + __extends(ParticlePositionState, _super); + function ParticlePositionState(animator, particlePositionNode) { + _super.call(this, animator, particlePositionNode); + this._particlePositionNode = particlePositionNode; + this._position = this._particlePositionNode._iPosition; + } + Object.defineProperty(ParticlePositionState.prototype, "position", { + /** + * Defines the position of the particle when in global mode. Defaults to 0,0,0. + */ + get: function () { + return this._position; + }, + set: function (value) { + this._position = value; + }, + enumerable: true, + configurable: true + }); + /** + * + */ + ParticlePositionState.prototype.getPositions = function () { + return this._pDynamicProperties; + }; + ParticlePositionState.prototype.setPositions = function (value) { + this._pDynamicProperties = value; + this._pDynamicPropertiesDirty = new Object(); + }; + /** + * @inheritDoc + */ + ParticlePositionState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { + if (this._particlePositionNode.mode == ParticlePropertiesMode.LOCAL_DYNAMIC && !this._pDynamicPropertiesDirty[animationSubGeometry._iUniqueId]) + this._pUpdateDynamicProperties(animationSubGeometry); + var index = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticlePositionState.POSITION_INDEX); + if (this._particlePositionNode.mode == ParticlePropertiesMode.GLOBAL) + animationRegisterCache.setVertexConst(index, this._position.x, this._position.y, this._position.z); + else + animationSubGeometry.activateVertexBuffer(index, this._particlePositionNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); + }; + /** @private */ + ParticlePositionState.POSITION_INDEX = 0; + return ParticlePositionState; +})(ParticleStateBase); +module.exports = ParticlePositionState; + + +},{"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/states/ParticleStateBase":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat":undefined}],"awayjs-renderergl/lib/animators/states/ParticleRotateToHeadingState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Matrix3D = require("awayjs-core/lib/core/geom/Matrix3D"); +var ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); +/** + * ... + */ +var ParticleRotateToHeadingState = (function (_super) { + __extends(ParticleRotateToHeadingState, _super); + function ParticleRotateToHeadingState(animator, particleNode) { + _super.call(this, animator, particleNode); + this._matrix = new Matrix3D(); + } + ParticleRotateToHeadingState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { + if (animationRegisterCache.hasBillboard) { + this._matrix.copyFrom(renderable.sourceEntity.sceneTransform); + this._matrix.append(camera.inverseSceneTransform); + animationRegisterCache.setVertexConstFromMatrix(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleRotateToHeadingState.MATRIX_INDEX), this._matrix); + } + }; + /** @private */ + ParticleRotateToHeadingState.MATRIX_INDEX = 0; + return ParticleRotateToHeadingState; +})(ParticleStateBase); +module.exports = ParticleRotateToHeadingState; + + +},{"awayjs-core/lib/core/geom/Matrix3D":undefined,"awayjs-renderergl/lib/animators/states/ParticleStateBase":undefined}],"awayjs-renderergl/lib/animators/states/ParticleRotateToPositionState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Matrix3D = require("awayjs-core/lib/core/geom/Matrix3D"); +var ContextGLVertexBufferFormat = require("awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); +/** + * ... + */ +var ParticleRotateToPositionState = (function (_super) { + __extends(ParticleRotateToPositionState, _super); + function ParticleRotateToPositionState(animator, particleRotateToPositionNode) { + _super.call(this, animator, particleRotateToPositionNode); + this._matrix = new Matrix3D(); + this._particleRotateToPositionNode = particleRotateToPositionNode; + this._position = this._particleRotateToPositionNode._iPosition; + } + Object.defineProperty(ParticleRotateToPositionState.prototype, "position", { + /** + * Defines the position of the point the particle will rotate to face when in global mode. Defaults to 0,0,0. + */ + get: function () { + return this._position; + }, + set: function (value) { + this._position = value; + }, + enumerable: true, + configurable: true + }); + ParticleRotateToPositionState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { + var index = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleRotateToPositionState.POSITION_INDEX); + if (animationRegisterCache.hasBillboard) { + this._matrix.copyFrom(renderable.sourceEntity.sceneTransform); + this._matrix.append(camera.inverseSceneTransform); + animationRegisterCache.setVertexConstFromMatrix(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleRotateToPositionState.MATRIX_INDEX), this._matrix); + } + if (this._particleRotateToPositionNode.mode == ParticlePropertiesMode.GLOBAL) { + this._offset = renderable.sourceEntity.inverseSceneTransform.transformVector(this._position); + animationRegisterCache.setVertexConst(index, this._offset.x, this._offset.y, this._offset.z); + } + else + animationSubGeometry.activateVertexBuffer(index, this._particleRotateToPositionNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); + }; + /** @private */ + ParticleRotateToPositionState.MATRIX_INDEX = 0; + /** @private */ + ParticleRotateToPositionState.POSITION_INDEX = 1; + return ParticleRotateToPositionState; +})(ParticleStateBase); +module.exports = ParticleRotateToPositionState; + + +},{"awayjs-core/lib/core/geom/Matrix3D":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/states/ParticleStateBase":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat":undefined}],"awayjs-renderergl/lib/animators/states/ParticleRotationalVelocityState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var ContextGLVertexBufferFormat = require("awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); +/** + * ... + */ +var ParticleRotationalVelocityState = (function (_super) { + __extends(ParticleRotationalVelocityState, _super); + function ParticleRotationalVelocityState(animator, particleRotationNode) { + _super.call(this, animator, particleRotationNode); + this._particleRotationalVelocityNode = particleRotationNode; + this._rotationalVelocity = this._particleRotationalVelocityNode._iRotationalVelocity; + this.updateRotationalVelocityData(); + } + Object.defineProperty(ParticleRotationalVelocityState.prototype, "rotationalVelocity", { + /** + * Defines the default rotationalVelocity of the state, used when in global mode. + */ + get: function () { + return this._rotationalVelocity; + }, + set: function (value) { + this._rotationalVelocity = value; + this.updateRotationalVelocityData(); + }, + enumerable: true, + configurable: true + }); + /** + * + */ + ParticleRotationalVelocityState.prototype.getRotationalVelocities = function () { + return this._pDynamicProperties; + }; + ParticleRotationalVelocityState.prototype.setRotationalVelocities = function (value) { + this._pDynamicProperties = value; + this._pDynamicPropertiesDirty = new Object(); + }; + /** + * @inheritDoc + */ + ParticleRotationalVelocityState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { + if (this._particleRotationalVelocityNode.mode == ParticlePropertiesMode.LOCAL_DYNAMIC && !this._pDynamicPropertiesDirty[animationSubGeometry._iUniqueId]) + this._pUpdateDynamicProperties(animationSubGeometry); + var index = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleRotationalVelocityState.ROTATIONALVELOCITY_INDEX); + if (this._particleRotationalVelocityNode.mode == ParticlePropertiesMode.GLOBAL) + animationRegisterCache.setVertexConst(index, this._rotationalVelocityData.x, this._rotationalVelocityData.y, this._rotationalVelocityData.z, this._rotationalVelocityData.w); + else + animationSubGeometry.activateVertexBuffer(index, this._particleRotationalVelocityNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); + }; + ParticleRotationalVelocityState.prototype.updateRotationalVelocityData = function () { + if (this._particleRotationalVelocityNode.mode == ParticlePropertiesMode.GLOBAL) { + if (this._rotationalVelocity.w <= 0) + throw (new Error("the cycle duration must greater than zero")); + var rotation = this._rotationalVelocity.clone(); + if (rotation.length <= 0) + rotation.z = 1; //set the default direction + else + rotation.normalize(); + // w is used as angle/2 in agal + this._rotationalVelocityData = new Vector3D(rotation.x, rotation.y, rotation.z, Math.PI / rotation.w); + } + }; + /** @private */ + ParticleRotationalVelocityState.ROTATIONALVELOCITY_INDEX = 0; + return ParticleRotationalVelocityState; +})(ParticleStateBase); +module.exports = ParticleRotationalVelocityState; + + +},{"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/states/ParticleStateBase":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat":undefined}],"awayjs-renderergl/lib/animators/states/ParticleScaleState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var ContextGLVertexBufferFormat = require("awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); +/** + * ... + */ +var ParticleScaleState = (function (_super) { + __extends(ParticleScaleState, _super); + function ParticleScaleState(animator, particleScaleNode) { + _super.call(this, animator, particleScaleNode); + this._particleScaleNode = particleScaleNode; + this._usesCycle = this._particleScaleNode._iUsesCycle; + this._usesPhase = this._particleScaleNode._iUsesPhase; + this._minScale = this._particleScaleNode._iMinScale; + this._maxScale = this._particleScaleNode._iMaxScale; + this._cycleDuration = this._particleScaleNode._iCycleDuration; + this._cyclePhase = this._particleScaleNode._iCyclePhase; + this.updateScaleData(); + } + Object.defineProperty(ParticleScaleState.prototype, "minScale", { + /** + * Defines the end scale of the state, when in global mode. Defaults to 1. + */ + get: function () { + return this._minScale; + }, + set: function (value) { + this._minScale = value; + this.updateScaleData(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleScaleState.prototype, "maxScale", { + /** + * Defines the end scale of the state, when in global mode. Defaults to 1. + */ + get: function () { + return this._maxScale; + }, + set: function (value) { + this._maxScale = value; + this.updateScaleData(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleScaleState.prototype, "cycleDuration", { + /** + * Defines the duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. + */ + get: function () { + return this._cycleDuration; + }, + set: function (value) { + this._cycleDuration = value; + this.updateScaleData(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleScaleState.prototype, "cyclePhase", { + /** + * Defines the phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. + */ + get: function () { + return this._cyclePhase; + }, + set: function (value) { + this._cyclePhase = value; + this.updateScaleData(); + }, + enumerable: true, + configurable: true + }); + ParticleScaleState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { + var index = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleScaleState.SCALE_INDEX); + if (this._particleScaleNode.mode == ParticlePropertiesMode.LOCAL_STATIC) { + if (this._usesCycle) { + if (this._usesPhase) + animationSubGeometry.activateVertexBuffer(index, this._particleScaleNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); + else + animationSubGeometry.activateVertexBuffer(index, this._particleScaleNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); + } + else + animationSubGeometry.activateVertexBuffer(index, this._particleScaleNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_2); + } + else + animationRegisterCache.setVertexConst(index, this._scaleData.x, this._scaleData.y, this._scaleData.z, this._scaleData.w); + }; + ParticleScaleState.prototype.updateScaleData = function () { + if (this._particleScaleNode.mode == ParticlePropertiesMode.GLOBAL) { + if (this._usesCycle) { + if (this._cycleDuration <= 0) + throw (new Error("the cycle duration must be greater than zero")); + this._scaleData = new Vector3D((this._minScale + this._maxScale) / 2, Math.abs(this._minScale - this._maxScale) / 2, Math.PI * 2 / this._cycleDuration, this._cyclePhase * Math.PI / 180); + } + else + this._scaleData = new Vector3D(this._minScale, this._maxScale - this._minScale, 0, 0); + } + }; + /** @private */ + ParticleScaleState.SCALE_INDEX = 0; + return ParticleScaleState; +})(ParticleStateBase); +module.exports = ParticleScaleState; + + +},{"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/states/ParticleStateBase":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat":undefined}],"awayjs-renderergl/lib/animators/states/ParticleSegmentedColorState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); +/** + * + */ +var ParticleSegmentedColorState = (function (_super) { + __extends(ParticleSegmentedColorState, _super); + function ParticleSegmentedColorState(animator, particleSegmentedColorNode) { + _super.call(this, animator, particleSegmentedColorNode); + this._usesMultiplier = particleSegmentedColorNode._iUsesMultiplier; + this._usesOffset = particleSegmentedColorNode._iUsesOffset; + this._startColor = particleSegmentedColorNode._iStartColor; + this._endColor = particleSegmentedColorNode._iEndColor; + this._segmentPoints = particleSegmentedColorNode._iSegmentPoints; + this._numSegmentPoint = particleSegmentedColorNode._iNumSegmentPoint; + this.updateColorData(); + } + Object.defineProperty(ParticleSegmentedColorState.prototype, "startColor", { + /** + * Defines the start color transform of the state, when in global mode. + */ + get: function () { + return this._startColor; + }, + set: function (value) { + this._startColor = value; + this.updateColorData(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleSegmentedColorState.prototype, "endColor", { + /** + * Defines the end color transform of the state, when in global mode. + */ + get: function () { + return this._endColor; + }, + set: function (value) { + this._endColor = value; + this.updateColorData(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleSegmentedColorState.prototype, "numSegmentPoint", { + /** + * Defines the number of segments. + */ + get: function () { + return this._numSegmentPoint; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleSegmentedColorState.prototype, "segmentPoints", { + /** + * Defines the key points of color + */ + get: function () { + return this._segmentPoints; + }, + set: function (value) { + this._segmentPoints = value; + this.updateColorData(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleSegmentedColorState.prototype, "usesMultiplier", { + get: function () { + return this._usesMultiplier; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleSegmentedColorState.prototype, "usesOffset", { + get: function () { + return this._usesOffset; + }, + enumerable: true, + configurable: true + }); + ParticleSegmentedColorState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { + if (animationRegisterCache.needFragmentAnimation) { + if (this._numSegmentPoint > 0) + animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleSegmentedColorState.TIME_DATA_INDEX), this._timeLifeData[0], this._timeLifeData[1], this._timeLifeData[2], this._timeLifeData[3]); + if (this._usesMultiplier) + animationRegisterCache.setVertexConstFromArray(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleSegmentedColorState.START_MULTIPLIER_INDEX), this._multiplierData); + if (this._usesOffset) + animationRegisterCache.setVertexConstFromArray(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleSegmentedColorState.START_OFFSET_INDEX), this._offsetData); + } + }; + ParticleSegmentedColorState.prototype.updateColorData = function () { + this._timeLifeData = new Array(); + this._multiplierData = new Array(); + this._offsetData = new Array(); + var i /*int*/; + for (i = 0; i < this._numSegmentPoint; i++) { + if (i == 0) + this._timeLifeData.push(this._segmentPoints[i].life); + else + this._timeLifeData.push(this._segmentPoints[i].life - this._segmentPoints[i - 1].life); + } + if (this._numSegmentPoint == 0) + this._timeLifeData.push(1); + else + this._timeLifeData.push(1 - this._segmentPoints[i - 1].life); + if (this._usesMultiplier) { + this._multiplierData.push(this._startColor.redMultiplier, this._startColor.greenMultiplier, this._startColor.blueMultiplier, this._startColor.alphaMultiplier); + for (i = 0; i < this._numSegmentPoint; i++) { + if (i == 0) + this._multiplierData.push((this._segmentPoints[i].color.redMultiplier - this._startColor.redMultiplier) / this._timeLifeData[i], (this._segmentPoints[i].color.greenMultiplier - this._startColor.greenMultiplier) / this._timeLifeData[i], (this._segmentPoints[i].color.blueMultiplier - this._startColor.blueMultiplier) / this._timeLifeData[i], (this._segmentPoints[i].color.alphaMultiplier - this._startColor.alphaMultiplier) / this._timeLifeData[i]); + else + this._multiplierData.push((this._segmentPoints[i].color.redMultiplier - this._segmentPoints[i - 1].color.redMultiplier) / this._timeLifeData[i], (this._segmentPoints[i].color.greenMultiplier - this._segmentPoints[i - 1].color.greenMultiplier) / this._timeLifeData[i], (this._segmentPoints[i].color.blueMultiplier - this._segmentPoints[i - 1].color.blueMultiplier) / this._timeLifeData[i], (this._segmentPoints[i].color.alphaMultiplier - this._segmentPoints[i - 1].color.alphaMultiplier) / this._timeLifeData[i]); + } + if (this._numSegmentPoint == 0) + this._multiplierData.push(this._endColor.redMultiplier - this._startColor.redMultiplier, this._endColor.greenMultiplier - this._startColor.greenMultiplier, this._endColor.blueMultiplier - this._startColor.blueMultiplier, this._endColor.alphaMultiplier - this._startColor.alphaMultiplier); + else + this._multiplierData.push((this._endColor.redMultiplier - this._segmentPoints[i - 1].color.redMultiplier) / this._timeLifeData[i], (this._endColor.greenMultiplier - this._segmentPoints[i - 1].color.greenMultiplier) / this._timeLifeData[i], (this._endColor.blueMultiplier - this._segmentPoints[i - 1].color.blueMultiplier) / this._timeLifeData[i], (this._endColor.alphaMultiplier - this._segmentPoints[i - 1].color.alphaMultiplier) / this._timeLifeData[i]); + } + if (this._usesOffset) { + this._offsetData.push(this._startColor.redOffset / 255, this._startColor.greenOffset / 255, this._startColor.blueOffset / 255, this._startColor.alphaOffset / 255); + for (i = 0; i < this._numSegmentPoint; i++) { + if (i == 0) + this._offsetData.push((this._segmentPoints[i].color.redOffset - this._startColor.redOffset) / this._timeLifeData[i] / 255, (this._segmentPoints[i].color.greenOffset - this._startColor.greenOffset) / this._timeLifeData[i] / 255, (this._segmentPoints[i].color.blueOffset - this._startColor.blueOffset) / this._timeLifeData[i] / 255, (this._segmentPoints[i].color.alphaOffset - this._startColor.alphaOffset) / this._timeLifeData[i] / 255); + else + this._offsetData.push((this._segmentPoints[i].color.redOffset - this._segmentPoints[i - 1].color.redOffset) / this._timeLifeData[i] / 255, (this._segmentPoints[i].color.greenOffset - this._segmentPoints[i - 1].color.greenOffset) / this._timeLifeData[i] / 255, (this._segmentPoints[i].color.blueOffset - this._segmentPoints[i - 1].color.blueOffset) / this._timeLifeData[i] / 255, (this._segmentPoints[i].color.alphaOffset - this._segmentPoints[i - 1].color.alphaOffset) / this._timeLifeData[i] / 255); + } + if (this._numSegmentPoint == 0) + this._offsetData.push((this._endColor.redOffset - this._startColor.redOffset) / 255, (this._endColor.greenOffset - this._startColor.greenOffset) / 255, (this._endColor.blueOffset - this._startColor.blueOffset) / 255, (this._endColor.alphaOffset - this._startColor.alphaOffset) / 255); + else + this._offsetData.push((this._endColor.redOffset - this._segmentPoints[i - 1].color.redOffset) / this._timeLifeData[i] / 255, (this._endColor.greenOffset - this._segmentPoints[i - 1].color.greenOffset) / this._timeLifeData[i] / 255, (this._endColor.blueOffset - this._segmentPoints[i - 1].color.blueOffset) / this._timeLifeData[i] / 255, (this._endColor.alphaOffset - this._segmentPoints[i - 1].color.alphaOffset) / this._timeLifeData[i] / 255); + } + //cut off the data + this._timeLifeData.length = 4; + }; + /** @private */ + ParticleSegmentedColorState.START_MULTIPLIER_INDEX = 0; + /** @private */ + ParticleSegmentedColorState.START_OFFSET_INDEX = 1; + /** @private */ + ParticleSegmentedColorState.TIME_DATA_INDEX = 2; + return ParticleSegmentedColorState; +})(ParticleStateBase); +module.exports = ParticleSegmentedColorState; + + +},{"awayjs-renderergl/lib/animators/states/ParticleStateBase":undefined}],"awayjs-renderergl/lib/animators/states/ParticleSpriteSheetState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ContextGLVertexBufferFormat = require("awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); +/** + * ... + */ +var ParticleSpriteSheetState = (function (_super) { + __extends(ParticleSpriteSheetState, _super); + function ParticleSpriteSheetState(animator, particleSpriteSheetNode) { + _super.call(this, animator, particleSpriteSheetNode); + this._particleSpriteSheetNode = particleSpriteSheetNode; + this._usesCycle = this._particleSpriteSheetNode._iUsesCycle; + this._usesPhase = this._particleSpriteSheetNode._iUsesCycle; + this._totalFrames = this._particleSpriteSheetNode._iTotalFrames; + this._numColumns = this._particleSpriteSheetNode._iNumColumns; + this._numRows = this._particleSpriteSheetNode._iNumRows; + this._cycleDuration = this._particleSpriteSheetNode._iCycleDuration; + this._cyclePhase = this._particleSpriteSheetNode._iCyclePhase; + this.updateSpriteSheetData(); + } + Object.defineProperty(ParticleSpriteSheetState.prototype, "cyclePhase", { + /** + * Defines the cycle phase, when in global mode. Defaults to zero. + */ + get: function () { + return this._cyclePhase; + }, + set: function (value) { + this._cyclePhase = value; + this.updateSpriteSheetData(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleSpriteSheetState.prototype, "cycleDuration", { + /** + * Defines the cycle duration in seconds, when in global mode. Defaults to 1. + */ + get: function () { + return this._cycleDuration; + }, + set: function (value) { + this._cycleDuration = value; + this.updateSpriteSheetData(); + }, + enumerable: true, + configurable: true + }); + ParticleSpriteSheetState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { + if (animationRegisterCache.needUVAnimation) { + animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleSpriteSheetState.UV_INDEX_0), this._spriteSheetData[0], this._spriteSheetData[1], this._spriteSheetData[2], this._spriteSheetData[3]); + if (this._usesCycle) { + var index = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleSpriteSheetState.UV_INDEX_1); + if (this._particleSpriteSheetNode.mode == ParticlePropertiesMode.LOCAL_STATIC) { + if (this._usesPhase) + animationSubGeometry.activateVertexBuffer(index, this._particleSpriteSheetNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); + else + animationSubGeometry.activateVertexBuffer(index, this._particleSpriteSheetNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_2); + } + else + animationRegisterCache.setVertexConst(index, this._spriteSheetData[4], this._spriteSheetData[5]); + } + } + }; + ParticleSpriteSheetState.prototype.updateSpriteSheetData = function () { + this._spriteSheetData = new Array(8); + var uTotal = this._totalFrames / this._numColumns; + this._spriteSheetData[0] = uTotal; + this._spriteSheetData[1] = 1 / this._numColumns; + this._spriteSheetData[2] = 1 / this._numRows; + if (this._usesCycle) { + if (this._cycleDuration <= 0) + throw (new Error("the cycle duration must be greater than zero")); + this._spriteSheetData[4] = uTotal / this._cycleDuration; + this._spriteSheetData[5] = this._cycleDuration; + if (this._usesPhase) + this._spriteSheetData[6] = this._cyclePhase; + } + }; + /** @private */ + ParticleSpriteSheetState.UV_INDEX_0 = 0; + /** @private */ + ParticleSpriteSheetState.UV_INDEX_1 = 1; + return ParticleSpriteSheetState; +})(ParticleStateBase); +module.exports = ParticleSpriteSheetState; + + +},{"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/states/ParticleStateBase":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat":undefined}],"awayjs-renderergl/lib/animators/states/ParticleStateBase":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var AnimationStateBase = require("awayjs-renderergl/lib/animators/states/AnimationStateBase"); +/** + * ... + */ +var ParticleStateBase = (function (_super) { + __extends(ParticleStateBase, _super); + function ParticleStateBase(animator, particleNode, needUpdateTime) { + if (needUpdateTime === void 0) { needUpdateTime = false; } + _super.call(this, animator, particleNode); + this._pDynamicProperties = new Array(); + this._pDynamicPropertiesDirty = new Object(); + this._particleNode = particleNode; + this._pNeedUpdateTime = needUpdateTime; + } + Object.defineProperty(ParticleStateBase.prototype, "needUpdateTime", { + get: function () { + return this._pNeedUpdateTime; + }, + enumerable: true, + configurable: true + }); + ParticleStateBase.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { + }; + ParticleStateBase.prototype._pUpdateDynamicProperties = function (animationSubGeometry) { + this._pDynamicPropertiesDirty[animationSubGeometry._iUniqueId] = true; + var animationParticles = animationSubGeometry.animationParticles; + var vertexData = animationSubGeometry.vertexData; + var totalLenOfOneVertex = animationSubGeometry.totalLenOfOneVertex; + var dataLength = this._particleNode.dataLength; + var dataOffset = this._particleNode._iDataOffset; + var vertexLength /*uint*/; + // var particleOffset:number /*uint*/; + var startingOffset /*uint*/; + var vertexOffset /*uint*/; + var data; + var animationParticle; + // var numParticles:number /*uint*/ = _positions.length/dataLength; + var numParticles = this._pDynamicProperties.length; + var i = 0; + var j = 0; + var k = 0; + while (i < numParticles) { + while (j < numParticles && (animationParticle = animationParticles[j]).index == i) { + data = this._pDynamicProperties[i]; + vertexLength = animationParticle.numVertices * totalLenOfOneVertex; + startingOffset = animationParticle.startVertexIndex * totalLenOfOneVertex + dataOffset; + for (k = 0; k < vertexLength; k += totalLenOfOneVertex) { + vertexOffset = startingOffset + k; + for (k = 0; k < vertexLength; k += totalLenOfOneVertex) { + vertexOffset = startingOffset + k; + vertexData[vertexOffset++] = data.x; + vertexData[vertexOffset++] = data.y; + vertexData[vertexOffset++] = data.z; + if (dataLength == 4) + vertexData[vertexOffset++] = data.w; + } + } + j++; + } + i++; + } + animationSubGeometry.invalidateBuffer(); + }; + return ParticleStateBase; +})(AnimationStateBase); +module.exports = ParticleStateBase; + + +},{"awayjs-renderergl/lib/animators/states/AnimationStateBase":undefined}],"awayjs-renderergl/lib/animators/states/ParticleTimeState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ContextGLVertexBufferFormat = require("awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat"); +var ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); +/** + * ... + */ +var ParticleTimeState = (function (_super) { + __extends(ParticleTimeState, _super); + function ParticleTimeState(animator, particleTimeNode) { + _super.call(this, animator, particleTimeNode, true); + this._particleTimeNode = particleTimeNode; + } + ParticleTimeState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { + animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleTimeState.TIME_STREAM_INDEX), this._particleTimeNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); + var particleTime = this._pTime / 1000; + animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleTimeState.TIME_CONSTANT_INDEX), particleTime, particleTime, particleTime, particleTime); + }; + /** @private */ + ParticleTimeState.TIME_STREAM_INDEX = 0; + /** @private */ + ParticleTimeState.TIME_CONSTANT_INDEX = 1; + return ParticleTimeState; +})(ParticleStateBase); +module.exports = ParticleTimeState; + + +},{"awayjs-renderergl/lib/animators/states/ParticleStateBase":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat":undefined}],"awayjs-renderergl/lib/animators/states/ParticleUVState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); +/** + * ... + */ +var ParticleUVState = (function (_super) { + __extends(ParticleUVState, _super); + function ParticleUVState(animator, particleUVNode) { + _super.call(this, animator, particleUVNode); + this._particleUVNode = particleUVNode; + } + ParticleUVState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { + if (animationRegisterCache.needUVAnimation) { + var index = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleUVState.UV_INDEX); + var data = this._particleUVNode._iUvData; + animationRegisterCache.setVertexConst(index, data.x, data.y); + } + }; + /** @private */ + ParticleUVState.UV_INDEX = 0; + return ParticleUVState; +})(ParticleStateBase); +module.exports = ParticleUVState; + + +},{"awayjs-renderergl/lib/animators/states/ParticleStateBase":undefined}],"awayjs-renderergl/lib/animators/states/ParticleVelocityState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ContextGLVertexBufferFormat = require("awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat"); +var ParticlePropertiesMode = require("awayjs-renderergl/lib/animators/data/ParticlePropertiesMode"); +var ParticleStateBase = require("awayjs-renderergl/lib/animators/states/ParticleStateBase"); +/** + * ... + */ +var ParticleVelocityState = (function (_super) { + __extends(ParticleVelocityState, _super); + function ParticleVelocityState(animator, particleVelocityNode) { + _super.call(this, animator, particleVelocityNode); + this._particleVelocityNode = particleVelocityNode; + this._velocity = this._particleVelocityNode._iVelocity; + } + Object.defineProperty(ParticleVelocityState.prototype, "velocity", { + /** + * Defines the default velocity vector of the state, used when in global mode. + */ + get: function () { + return this._velocity; + }, + set: function (value) { + this._velocity = value; + }, + enumerable: true, + configurable: true + }); + /** + * + */ + ParticleVelocityState.prototype.getVelocities = function () { + return this._pDynamicProperties; + }; + ParticleVelocityState.prototype.setVelocities = function (value) { + this._pDynamicProperties = value; + this._pDynamicPropertiesDirty = new Object(); + }; + ParticleVelocityState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { + if (this._particleVelocityNode.mode == ParticlePropertiesMode.LOCAL_DYNAMIC && !this._pDynamicPropertiesDirty[animationSubGeometry._iUniqueId]) + this._pUpdateDynamicProperties(animationSubGeometry); + var index = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleVelocityState.VELOCITY_INDEX); + if (this._particleVelocityNode.mode == ParticlePropertiesMode.GLOBAL) + animationRegisterCache.setVertexConst(index, this._velocity.x, this._velocity.y, this._velocity.z); + else + animationSubGeometry.activateVertexBuffer(index, this._particleVelocityNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); + }; + /** @private */ + ParticleVelocityState.VELOCITY_INDEX = 0; + return ParticleVelocityState; +})(ParticleStateBase); +module.exports = ParticleVelocityState; + + +},{"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode":undefined,"awayjs-renderergl/lib/animators/states/ParticleStateBase":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat":undefined}],"awayjs-renderergl/lib/animators/states/SkeletonBinaryLERPState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var JointPose = require("awayjs-renderergl/lib/animators/data/JointPose"); +var SkeletonPose = require("awayjs-renderergl/lib/animators/data/SkeletonPose"); +var AnimationStateBase = require("awayjs-renderergl/lib/animators/states/AnimationStateBase"); +/** + * + */ +var SkeletonBinaryLERPState = (function (_super) { + __extends(SkeletonBinaryLERPState, _super); + function SkeletonBinaryLERPState(animator, skeletonAnimationNode) { + _super.call(this, animator, skeletonAnimationNode); + this._blendWeight = 0; + this._skeletonPose = new SkeletonPose(); + this._skeletonPoseDirty = true; + this._skeletonAnimationNode = skeletonAnimationNode; + this._inputA = animator.getAnimationState(this._skeletonAnimationNode.inputA); + this._inputB = animator.getAnimationState(this._skeletonAnimationNode.inputB); + } + Object.defineProperty(SkeletonBinaryLERPState.prototype, "blendWeight", { + /** + * Defines a fractional value between 0 and 1 representing the blending ratio between inputA (0) and inputB (1), + * used to produce the skeleton pose output. + * + * @see inputA + * @see inputB + */ + get: function () { + return this._blendWeight; + }, + set: function (value) { + this._blendWeight = value; + this._pPositionDeltaDirty = true; + this._skeletonPoseDirty = true; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + SkeletonBinaryLERPState.prototype.phase = function (value) { + this._skeletonPoseDirty = true; + this._pPositionDeltaDirty = true; + this._inputA.phase(value); + this._inputB.phase(value); + }; + /** + * @inheritDoc + */ + SkeletonBinaryLERPState.prototype._pUpdateTime = function (time /*int*/) { + this._skeletonPoseDirty = true; + this._inputA.update(time); + this._inputB.update(time); + _super.prototype._pUpdateTime.call(this, time); + }; + /** + * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. + */ + SkeletonBinaryLERPState.prototype.getSkeletonPose = function (skeleton) { + if (this._skeletonPoseDirty) + this.updateSkeletonPose(skeleton); + return this._skeletonPose; + }; + /** + * @inheritDoc + */ + SkeletonBinaryLERPState.prototype._pUpdatePositionDelta = function () { + this._pPositionDeltaDirty = false; + var deltA = this._inputA.positionDelta; + var deltB = this._inputB.positionDelta; + this._pRootDelta.x = deltA.x + this._blendWeight * (deltB.x - deltA.x); + this._pRootDelta.y = deltA.y + this._blendWeight * (deltB.y - deltA.y); + this._pRootDelta.z = deltA.z + this._blendWeight * (deltB.z - deltA.z); + }; + /** + * Updates the output skeleton pose of the node based on the blendWeight value between input nodes. + * + * @param skeleton The skeleton used by the animator requesting the ouput pose. + */ + SkeletonBinaryLERPState.prototype.updateSkeletonPose = function (skeleton) { + this._skeletonPoseDirty = false; + var endPose; + var endPoses = this._skeletonPose.jointPoses; + var poses1 = this._inputA.getSkeletonPose(skeleton).jointPoses; + var poses2 = this._inputB.getSkeletonPose(skeleton).jointPoses; + var pose1, pose2; + var p1, p2; + var tr; + var numJoints = skeleton.numJoints; + // :s + if (endPoses.length != numJoints) + endPoses.length = numJoints; + for (var i = 0; i < numJoints; ++i) { + endPose = endPoses[i]; + if (endPose == null) + endPose = endPoses[i] = new JointPose(); + pose1 = poses1[i]; + pose2 = poses2[i]; + p1 = pose1.translation; + p2 = pose2.translation; + endPose.orientation.lerp(pose1.orientation, pose2.orientation, this._blendWeight); + tr = endPose.translation; + tr.x = p1.x + this._blendWeight * (p2.x - p1.x); + tr.y = p1.y + this._blendWeight * (p2.y - p1.y); + tr.z = p1.z + this._blendWeight * (p2.z - p1.z); + } + }; + return SkeletonBinaryLERPState; +})(AnimationStateBase); +module.exports = SkeletonBinaryLERPState; + + +},{"awayjs-renderergl/lib/animators/data/JointPose":undefined,"awayjs-renderergl/lib/animators/data/SkeletonPose":undefined,"awayjs-renderergl/lib/animators/states/AnimationStateBase":undefined}],"awayjs-renderergl/lib/animators/states/SkeletonClipState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var JointPose = require("awayjs-renderergl/lib/animators/data/JointPose"); +var SkeletonPose = require("awayjs-renderergl/lib/animators/data/SkeletonPose"); +var AnimationClipState = require("awayjs-renderergl/lib/animators/states/AnimationClipState"); +/** + * + */ +var SkeletonClipState = (function (_super) { + __extends(SkeletonClipState, _super); + function SkeletonClipState(animator, skeletonClipNode) { + _super.call(this, animator, skeletonClipNode); + this._rootPos = new Vector3D(); + this._skeletonPose = new SkeletonPose(); + this._skeletonPoseDirty = true; + this._skeletonClipNode = skeletonClipNode; + this._frames = this._skeletonClipNode.frames; + } + Object.defineProperty(SkeletonClipState.prototype, "currentPose", { + /** + * Returns the current skeleton pose frame of animation in the clip based on the internal playhead position. + */ + get: function () { + if (this._pFramesDirty) + this._pUpdateFrames(); + return this._currentPose; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SkeletonClipState.prototype, "nextPose", { + /** + * Returns the next skeleton pose frame of animation in the clip based on the internal playhead position. + */ + get: function () { + if (this._pFramesDirty) + this._pUpdateFrames(); + return this._nextPose; + }, + enumerable: true, + configurable: true + }); + /** + * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. + */ + SkeletonClipState.prototype.getSkeletonPose = function (skeleton) { + if (this._skeletonPoseDirty) + this.updateSkeletonPose(skeleton); + return this._skeletonPose; + }; + /** + * @inheritDoc + */ + SkeletonClipState.prototype._pUpdateTime = function (time /*int*/) { + this._skeletonPoseDirty = true; + _super.prototype._pUpdateTime.call(this, time); + }; + /** + * @inheritDoc + */ + SkeletonClipState.prototype._pUpdateFrames = function () { + _super.prototype._pUpdateFrames.call(this); + this._currentPose = this._frames[this._pCurrentFrame]; + if (this._skeletonClipNode.looping && this._pNextFrame >= this._skeletonClipNode.lastFrame) { + this._nextPose = this._frames[0]; + this._pAnimator.dispatchCycleEvent(); + } + else + this._nextPose = this._frames[this._pNextFrame]; + }; + /** + * Updates the output skeleton pose of the node based on the internal playhead position. + * + * @param skeleton The skeleton used by the animator requesting the ouput pose. + */ + SkeletonClipState.prototype.updateSkeletonPose = function (skeleton) { + this._skeletonPoseDirty = false; + if (!this._skeletonClipNode.totalDuration) + return; + if (this._pFramesDirty) + this._pUpdateFrames(); + var currentPose = this._currentPose.jointPoses; + var nextPose = this._nextPose.jointPoses; + var numJoints = skeleton.numJoints; + var p1, p2; + var pose1, pose2; + var endPoses = this._skeletonPose.jointPoses; + var endPose; + var tr; + // :s + if (endPoses.length != numJoints) + endPoses.length = numJoints; + if ((numJoints != currentPose.length) || (numJoints != nextPose.length)) + throw new Error("joint counts don't match!"); + for (var i = 0; i < numJoints; ++i) { + endPose = endPoses[i]; + if (endPose == null) + endPose = endPoses[i] = new JointPose(); + pose1 = currentPose[i]; + pose2 = nextPose[i]; + p1 = pose1.translation; + p2 = pose2.translation; + if (this._skeletonClipNode.highQuality) + endPose.orientation.slerp(pose1.orientation, pose2.orientation, this._pBlendWeight); + else + endPose.orientation.lerp(pose1.orientation, pose2.orientation, this._pBlendWeight); + if (i > 0) { + tr = endPose.translation; + tr.x = p1.x + this._pBlendWeight * (p2.x - p1.x); + tr.y = p1.y + this._pBlendWeight * (p2.y - p1.y); + tr.z = p1.z + this._pBlendWeight * (p2.z - p1.z); + } + } + }; + /** + * @inheritDoc + */ + SkeletonClipState.prototype._pUpdatePositionDelta = function () { + this._pPositionDeltaDirty = false; + if (this._pFramesDirty) + this._pUpdateFrames(); + var p1, p2, p3; + var totalDelta = this._skeletonClipNode.totalDelta; + // jumping back, need to reset position + if ((this._pTimeDir > 0 && this._pNextFrame < this._pOldFrame) || (this._pTimeDir < 0 && this._pNextFrame > this._pOldFrame)) { + this._rootPos.x -= totalDelta.x * this._pTimeDir; + this._rootPos.y -= totalDelta.y * this._pTimeDir; + this._rootPos.z -= totalDelta.z * this._pTimeDir; + } + var dx = this._rootPos.x; + var dy = this._rootPos.y; + var dz = this._rootPos.z; + if (this._skeletonClipNode.stitchFinalFrame && this._pNextFrame == this._skeletonClipNode.lastFrame) { + p1 = this._frames[0].jointPoses[0].translation; + p2 = this._frames[1].jointPoses[0].translation; + p3 = this._currentPose.jointPoses[0].translation; + this._rootPos.x = p3.x + p1.x + this._pBlendWeight * (p2.x - p1.x); + this._rootPos.y = p3.y + p1.y + this._pBlendWeight * (p2.y - p1.y); + this._rootPos.z = p3.z + p1.z + this._pBlendWeight * (p2.z - p1.z); + } + else { + p1 = this._currentPose.jointPoses[0].translation; + p2 = this._frames[this._pNextFrame].jointPoses[0].translation; //cover the instances where we wrap the pose but still want the final frame translation values + this._rootPos.x = p1.x + this._pBlendWeight * (p2.x - p1.x); + this._rootPos.y = p1.y + this._pBlendWeight * (p2.y - p1.y); + this._rootPos.z = p1.z + this._pBlendWeight * (p2.z - p1.z); + } + this._pRootDelta.x = this._rootPos.x - dx; + this._pRootDelta.y = this._rootPos.y - dy; + this._pRootDelta.z = this._rootPos.z - dz; + this._pOldFrame = this._pNextFrame; + }; + return SkeletonClipState; +})(AnimationClipState); +module.exports = SkeletonClipState; + + +},{"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-renderergl/lib/animators/data/JointPose":undefined,"awayjs-renderergl/lib/animators/data/SkeletonPose":undefined,"awayjs-renderergl/lib/animators/states/AnimationClipState":undefined}],"awayjs-renderergl/lib/animators/states/SkeletonDifferenceState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Quaternion = require("awayjs-core/lib/core/geom/Quaternion"); +var JointPose = require("awayjs-renderergl/lib/animators/data/JointPose"); +var SkeletonPose = require("awayjs-renderergl/lib/animators/data/SkeletonPose"); +var AnimationStateBase = require("awayjs-renderergl/lib/animators/states/AnimationStateBase"); +/** + * + */ +var SkeletonDifferenceState = (function (_super) { + __extends(SkeletonDifferenceState, _super); + function SkeletonDifferenceState(animator, skeletonAnimationNode) { + _super.call(this, animator, skeletonAnimationNode); + this._blendWeight = 0; + this._skeletonPose = new SkeletonPose(); + this._skeletonPoseDirty = true; + this._skeletonAnimationNode = skeletonAnimationNode; + this._baseInput = animator.getAnimationState(this._skeletonAnimationNode.baseInput); + this._differenceInput = animator.getAnimationState(this._skeletonAnimationNode.differenceInput); + } + Object.defineProperty(SkeletonDifferenceState.prototype, "blendWeight", { + /** + * Defines a fractional value between 0 and 1 representing the blending ratio between the base input (0) and difference input (1), + * used to produce the skeleton pose output. + * + * @see #baseInput + * @see #differenceInput + */ + get: function () { + return this._blendWeight; + }, + set: function (value) { + this._blendWeight = value; + this._pPositionDeltaDirty = true; + this._skeletonPoseDirty = true; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + SkeletonDifferenceState.prototype.phase = function (value) { + this._skeletonPoseDirty = true; + this._pPositionDeltaDirty = true; + this._baseInput.phase(value); + this._baseInput.phase(value); + }; + /** + * @inheritDoc + */ + SkeletonDifferenceState.prototype._pUpdateTime = function (time /*int*/) { + this._skeletonPoseDirty = true; + this._baseInput.update(time); + this._differenceInput.update(time); + _super.prototype._pUpdateTime.call(this, time); + }; + /** + * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. + */ + SkeletonDifferenceState.prototype.getSkeletonPose = function (skeleton) { + if (this._skeletonPoseDirty) + this.updateSkeletonPose(skeleton); + return this._skeletonPose; + }; + /** + * @inheritDoc + */ + SkeletonDifferenceState.prototype._pUpdatePositionDelta = function () { + this._pPositionDeltaDirty = false; + var deltA = this._baseInput.positionDelta; + var deltB = this._differenceInput.positionDelta; + this.positionDelta.x = deltA.x + this._blendWeight * deltB.x; + this.positionDelta.y = deltA.y + this._blendWeight * deltB.y; + this.positionDelta.z = deltA.z + this._blendWeight * deltB.z; + }; + /** + * Updates the output skeleton pose of the node based on the blendWeight value between base input and difference input nodes. + * + * @param skeleton The skeleton used by the animator requesting the ouput pose. + */ + SkeletonDifferenceState.prototype.updateSkeletonPose = function (skeleton) { + this._skeletonPoseDirty = false; + var endPose; + var endPoses = this._skeletonPose.jointPoses; + var basePoses = this._baseInput.getSkeletonPose(skeleton).jointPoses; + var diffPoses = this._differenceInput.getSkeletonPose(skeleton).jointPoses; + var base, diff; + var basePos, diffPos; + var tr; + var numJoints = skeleton.numJoints; + // :s + if (endPoses.length != numJoints) + endPoses.length = numJoints; + for (var i = 0; i < numJoints; ++i) { + endPose = endPoses[i]; + if (endPose == null) + endPose = endPoses[i] = new JointPose(); + base = basePoses[i]; + diff = diffPoses[i]; + basePos = base.translation; + diffPos = diff.translation; + SkeletonDifferenceState._tempQuat.multiply(diff.orientation, base.orientation); + endPose.orientation.lerp(base.orientation, SkeletonDifferenceState._tempQuat, this._blendWeight); + tr = endPose.translation; + tr.x = basePos.x + this._blendWeight * diffPos.x; + tr.y = basePos.y + this._blendWeight * diffPos.y; + tr.z = basePos.z + this._blendWeight * diffPos.z; + } + }; + SkeletonDifferenceState._tempQuat = new Quaternion(); + return SkeletonDifferenceState; +})(AnimationStateBase); +module.exports = SkeletonDifferenceState; + + +},{"awayjs-core/lib/core/geom/Quaternion":undefined,"awayjs-renderergl/lib/animators/data/JointPose":undefined,"awayjs-renderergl/lib/animators/data/SkeletonPose":undefined,"awayjs-renderergl/lib/animators/states/AnimationStateBase":undefined}],"awayjs-renderergl/lib/animators/states/SkeletonDirectionalState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var JointPose = require("awayjs-renderergl/lib/animators/data/JointPose"); +var SkeletonPose = require("awayjs-renderergl/lib/animators/data/SkeletonPose"); +var AnimationStateBase = require("awayjs-renderergl/lib/animators/states/AnimationStateBase"); +/** + * + */ +var SkeletonDirectionalState = (function (_super) { + __extends(SkeletonDirectionalState, _super); + function SkeletonDirectionalState(animator, skeletonAnimationNode) { + _super.call(this, animator, skeletonAnimationNode); + this._skeletonPose = new SkeletonPose(); + this._skeletonPoseDirty = true; + this._blendWeight = 0; + this._direction = 0; + this._blendDirty = true; + this._skeletonAnimationNode = skeletonAnimationNode; + this._forward = animator.getAnimationState(this._skeletonAnimationNode.forward); + this._backward = animator.getAnimationState(this._skeletonAnimationNode.backward); + this._left = animator.getAnimationState(this._skeletonAnimationNode.left); + this._right = animator.getAnimationState(this._skeletonAnimationNode.right); + } + Object.defineProperty(SkeletonDirectionalState.prototype, "direction", { + get: function () { + return this._direction; + }, + /** + * Defines the direction in degrees of the aniamtion between the forwards (0), right(90) backwards (180) and left(270) input nodes, + * used to produce the skeleton pose output. + */ + set: function (value) { + if (this._direction == value) + return; + this._direction = value; + this._blendDirty = true; + this._skeletonPoseDirty = true; + this._pPositionDeltaDirty = true; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + SkeletonDirectionalState.prototype.phase = function (value) { + if (this._blendDirty) + this.updateBlend(); + this._skeletonPoseDirty = true; + this._pPositionDeltaDirty = true; + this._inputA.phase(value); + this._inputB.phase(value); + }; + /** + * @inheritDoc + */ + SkeletonDirectionalState.prototype._pUdateTime = function (time /*int*/) { + if (this._blendDirty) + this.updateBlend(); + this._skeletonPoseDirty = true; + this._inputA.update(time); + this._inputB.update(time); + _super.prototype._pUpdateTime.call(this, time); + }; + /** + * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. + */ + SkeletonDirectionalState.prototype.getSkeletonPose = function (skeleton) { + if (this._skeletonPoseDirty) + this.updateSkeletonPose(skeleton); + return this._skeletonPose; + }; + /** + * @inheritDoc + */ + SkeletonDirectionalState.prototype._pUpdatePositionDelta = function () { + this._pPositionDeltaDirty = false; + if (this._blendDirty) + this.updateBlend(); + var deltA = this._inputA.positionDelta; + var deltB = this._inputB.positionDelta; + this.positionDelta.x = deltA.x + this._blendWeight * (deltB.x - deltA.x); + this.positionDelta.y = deltA.y + this._blendWeight * (deltB.y - deltA.y); + this.positionDelta.z = deltA.z + this._blendWeight * (deltB.z - deltA.z); + }; + /** + * Updates the output skeleton pose of the node based on the direction value between forward, backwards, left and right input nodes. + * + * @param skeleton The skeleton used by the animator requesting the ouput pose. + */ + SkeletonDirectionalState.prototype.updateSkeletonPose = function (skeleton) { + this._skeletonPoseDirty = false; + if (this._blendDirty) + this.updateBlend(); + var endPose; + var endPoses = this._skeletonPose.jointPoses; + var poses1 = this._inputA.getSkeletonPose(skeleton).jointPoses; + var poses2 = this._inputB.getSkeletonPose(skeleton).jointPoses; + var pose1, pose2; + var p1, p2; + var tr; + var numJoints = skeleton.numJoints; + // :s + if (endPoses.length != numJoints) + endPoses.length = numJoints; + for (var i = 0; i < numJoints; ++i) { + endPose = endPoses[i]; + if (endPose == null) + endPose = endPoses[i] = new JointPose(); + pose1 = poses1[i]; + pose2 = poses2[i]; + p1 = pose1.translation; + p2 = pose2.translation; + endPose.orientation.lerp(pose1.orientation, pose2.orientation, this._blendWeight); + tr = endPose.translation; + tr.x = p1.x + this._blendWeight * (p2.x - p1.x); + tr.y = p1.y + this._blendWeight * (p2.y - p1.y); + tr.z = p1.z + this._blendWeight * (p2.z - p1.z); + } + }; + /** + * Updates the blend value for the animation output based on the direction value between forward, backwards, left and right input nodes. + * + * @private + */ + SkeletonDirectionalState.prototype.updateBlend = function () { + this._blendDirty = false; + if (this._direction < 0 || this._direction > 360) { + this._direction %= 360; + if (this._direction < 0) + this._direction += 360; + } + if (this._direction < 90) { + this._inputA = this._forward; + this._inputB = this._right; + this._blendWeight = this._direction / 90; + } + else if (this._direction < 180) { + this._inputA = this._right; + this._inputB = this._backward; + this._blendWeight = (this._direction - 90) / 90; + } + else if (this._direction < 270) { + this._inputA = this._backward; + this._inputB = this._left; + this._blendWeight = (this._direction - 180) / 90; + } + else { + this._inputA = this._left; + this._inputB = this._forward; + this._blendWeight = (this._direction - 270) / 90; + } + }; + return SkeletonDirectionalState; +})(AnimationStateBase); +module.exports = SkeletonDirectionalState; + + +},{"awayjs-renderergl/lib/animators/data/JointPose":undefined,"awayjs-renderergl/lib/animators/data/SkeletonPose":undefined,"awayjs-renderergl/lib/animators/states/AnimationStateBase":undefined}],"awayjs-renderergl/lib/animators/states/SkeletonNaryLERPState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var JointPose = require("awayjs-renderergl/lib/animators/data/JointPose"); +var SkeletonPose = require("awayjs-renderergl/lib/animators/data/SkeletonPose"); +var AnimationStateBase = require("awayjs-renderergl/lib/animators/states/AnimationStateBase"); +/** + * + */ +var SkeletonNaryLERPState = (function (_super) { + __extends(SkeletonNaryLERPState, _super); + function SkeletonNaryLERPState(animator, skeletonAnimationNode) { + _super.call(this, animator, skeletonAnimationNode); + this._skeletonPose = new SkeletonPose(); + this._skeletonPoseDirty = true; + this._blendWeights = new Array(); + this._inputs = new Array(); + this._skeletonAnimationNode = skeletonAnimationNode; + var i = this._skeletonAnimationNode.numInputs; + while (i--) + this._inputs[i] = animator.getAnimationState(this._skeletonAnimationNode._iInputs[i]); + } + /** + * @inheritDoc + */ + SkeletonNaryLERPState.prototype.phase = function (value) { + this._skeletonPoseDirty = true; + this._pPositionDeltaDirty = true; + for (var j = 0; j < this._skeletonAnimationNode.numInputs; ++j) { + if (this._blendWeights[j]) + this._inputs[j].update(value); + } + }; + /** + * @inheritDoc + */ + SkeletonNaryLERPState.prototype._pUdateTime = function (time /*int*/) { + for (var j = 0; j < this._skeletonAnimationNode.numInputs; ++j) { + if (this._blendWeights[j]) + this._inputs[j].update(time); + } + _super.prototype._pUpdateTime.call(this, time); + }; + /** + * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. + */ + SkeletonNaryLERPState.prototype.getSkeletonPose = function (skeleton) { + if (this._skeletonPoseDirty) + this.updateSkeletonPose(skeleton); + return this._skeletonPose; + }; + /** + * Returns the blend weight of the skeleton aniamtion node that resides at the given input index. + * + * @param index The input index for which the skeleton animation node blend weight is requested. + */ + SkeletonNaryLERPState.prototype.getBlendWeightAt = function (index /*uint*/) { + return this._blendWeights[index]; + }; + /** + * Sets the blend weight of the skeleton aniamtion node that resides at the given input index. + * + * @param index The input index on which the skeleton animation node blend weight is to be set. + * @param blendWeight The blend weight value to use for the given skeleton animation node index. + */ + SkeletonNaryLERPState.prototype.setBlendWeightAt = function (index /*uint*/, blendWeight) { + this._blendWeights[index] = blendWeight; + this._pPositionDeltaDirty = true; + this._skeletonPoseDirty = true; + }; + /** + * @inheritDoc + */ + SkeletonNaryLERPState.prototype._pUpdatePositionDelta = function () { + this._pPositionDeltaDirty = false; + var delta; + var weight; + this.positionDelta.x = 0; + this.positionDelta.y = 0; + this.positionDelta.z = 0; + for (var j = 0; j < this._skeletonAnimationNode.numInputs; ++j) { + weight = this._blendWeights[j]; + if (weight) { + delta = this._inputs[j].positionDelta; + this.positionDelta.x += weight * delta.x; + this.positionDelta.y += weight * delta.y; + this.positionDelta.z += weight * delta.z; + } + } + }; + /** + * Updates the output skeleton pose of the node based on the blend weight values given to the input nodes. + * + * @param skeleton The skeleton used by the animator requesting the ouput pose. + */ + SkeletonNaryLERPState.prototype.updateSkeletonPose = function (skeleton) { + this._skeletonPoseDirty = false; + var weight; + var endPoses = this._skeletonPose.jointPoses; + var poses; + var endPose, pose; + var endTr, tr; + var endQuat, q; + var firstPose; + var i /*uint*/; + var w0, x0, y0, z0; + var w1, x1, y1, z1; + var numJoints = skeleton.numJoints; + // :s + if (endPoses.length != numJoints) + endPoses.length = numJoints; + for (var j = 0; j < this._skeletonAnimationNode.numInputs; ++j) { + weight = this._blendWeights[j]; + if (!weight) + continue; + poses = this._inputs[j].getSkeletonPose(skeleton).jointPoses; + if (!firstPose) { + firstPose = poses; + for (i = 0; i < numJoints; ++i) { + endPose = endPoses[i]; + if (endPose == null) + endPose = endPoses[i] = new JointPose(); + pose = poses[i]; + q = pose.orientation; + tr = pose.translation; + endQuat = endPose.orientation; + endQuat.x = weight * q.x; + endQuat.y = weight * q.y; + endQuat.z = weight * q.z; + endQuat.w = weight * q.w; + endTr = endPose.translation; + endTr.x = weight * tr.x; + endTr.y = weight * tr.y; + endTr.z = weight * tr.z; + } + } + else { + for (i = 0; i < skeleton.numJoints; ++i) { + endPose = endPoses[i]; + pose = poses[i]; + q = firstPose[i].orientation; + x0 = q.x; + y0 = q.y; + z0 = q.z; + w0 = q.w; + q = pose.orientation; + tr = pose.translation; + x1 = q.x; + y1 = q.y; + z1 = q.z; + w1 = q.w; + // find shortest direction + if (x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1 < 0) { + x1 = -x1; + y1 = -y1; + z1 = -z1; + w1 = -w1; + } + endQuat = endPose.orientation; + endQuat.x += weight * x1; + endQuat.y += weight * y1; + endQuat.z += weight * z1; + endQuat.w += weight * w1; + endTr = endPose.translation; + endTr.x += weight * tr.x; + endTr.y += weight * tr.y; + endTr.z += weight * tr.z; + } + } + } + for (i = 0; i < skeleton.numJoints; ++i) + endPoses[i].orientation.normalize(); + }; + return SkeletonNaryLERPState; +})(AnimationStateBase); +module.exports = SkeletonNaryLERPState; + + +},{"awayjs-renderergl/lib/animators/data/JointPose":undefined,"awayjs-renderergl/lib/animators/data/SkeletonPose":undefined,"awayjs-renderergl/lib/animators/states/AnimationStateBase":undefined}],"awayjs-renderergl/lib/animators/states/VertexClipState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var AnimationClipState = require("awayjs-renderergl/lib/animators/states/AnimationClipState"); +/** + * + */ +var VertexClipState = (function (_super) { + __extends(VertexClipState, _super); + function VertexClipState(animator, vertexClipNode) { + _super.call(this, animator, vertexClipNode); + this._vertexClipNode = vertexClipNode; + this._frames = this._vertexClipNode.frames; + } + Object.defineProperty(VertexClipState.prototype, "currentGeometry", { + /** + * @inheritDoc + */ + get: function () { + if (this._pFramesDirty) + this._pUpdateFrames(); + return this._currentGeometry; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VertexClipState.prototype, "nextGeometry", { + /** + * @inheritDoc + */ + get: function () { + if (this._pFramesDirty) + this._pUpdateFrames(); + return this._nextGeometry; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + VertexClipState.prototype._pUpdateFrames = function () { + _super.prototype._pUpdateFrames.call(this); + this._currentGeometry = this._frames[this._pCurrentFrame]; + if (this._vertexClipNode.looping && this._pNextFrame >= this._vertexClipNode.lastFrame) { + this._nextGeometry = this._frames[0]; + this._pAnimator.dispatchCycleEvent(); + } + else + this._nextGeometry = this._frames[this._pNextFrame]; + }; + /** + * @inheritDoc + */ + VertexClipState.prototype._pUpdatePositionDelta = function () { + //TODO:implement positiondelta functionality for vertex animations + }; + return VertexClipState; +})(AnimationClipState); +module.exports = VertexClipState; + + +},{"awayjs-renderergl/lib/animators/states/AnimationClipState":undefined}],"awayjs-renderergl/lib/animators/transitions/CrossfadeTransitionNode":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var SkeletonBinaryLERPNode = require("awayjs-renderergl/lib/animators/nodes/SkeletonBinaryLERPNode"); +var CrossfadeTransitionState = require("awayjs-renderergl/lib/animators/transitions/CrossfadeTransitionState"); +/** + * A skeleton animation node that uses two animation node inputs to blend a lineraly interpolated output of a skeleton pose. + */ +var CrossfadeTransitionNode = (function (_super) { + __extends(CrossfadeTransitionNode, _super); + /** + * Creates a new CrossfadeTransitionNode object. + */ + function CrossfadeTransitionNode() { + _super.call(this); + this._pStateClass = CrossfadeTransitionState; + } + return CrossfadeTransitionNode; +})(SkeletonBinaryLERPNode); +module.exports = CrossfadeTransitionNode; + + +},{"awayjs-renderergl/lib/animators/nodes/SkeletonBinaryLERPNode":undefined,"awayjs-renderergl/lib/animators/transitions/CrossfadeTransitionState":undefined}],"awayjs-renderergl/lib/animators/transitions/CrossfadeTransitionState":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var SkeletonBinaryLERPState = require("awayjs-renderergl/lib/animators/states/SkeletonBinaryLERPState"); +var AnimationStateEvent = require("awayjs-renderergl/lib/events/AnimationStateEvent"); +/** + * + */ +var CrossfadeTransitionState = (function (_super) { + __extends(CrossfadeTransitionState, _super); + function CrossfadeTransitionState(animator, skeletonAnimationNode) { + _super.call(this, animator, skeletonAnimationNode); + this._crossfadeTransitionNode = skeletonAnimationNode; + } + /** + * @inheritDoc + */ + CrossfadeTransitionState.prototype._pUpdateTime = function (time /*int*/) { + this.blendWeight = Math.abs(time - this._crossfadeTransitionNode.startBlend) / (1000 * this._crossfadeTransitionNode.blendSpeed); + if (this.blendWeight >= 1) { + this.blendWeight = 1; + if (this._animationStateTransitionComplete == null) + this._animationStateTransitionComplete = new AnimationStateEvent(AnimationStateEvent.TRANSITION_COMPLETE, this._pAnimator, this, this._crossfadeTransitionNode); + this._crossfadeTransitionNode.dispatchEvent(this._animationStateTransitionComplete); + } + _super.prototype._pUpdateTime.call(this, time); + }; + return CrossfadeTransitionState; +})(SkeletonBinaryLERPState); +module.exports = CrossfadeTransitionState; + + +},{"awayjs-renderergl/lib/animators/states/SkeletonBinaryLERPState":undefined,"awayjs-renderergl/lib/events/AnimationStateEvent":undefined}],"awayjs-renderergl/lib/animators/transitions/CrossfadeTransition":[function(require,module,exports){ +var CrossfadeTransitionNode = require("awayjs-renderergl/lib/animators/transitions/CrossfadeTransitionNode"); +/** + * + */ +var CrossfadeTransition = (function () { + function CrossfadeTransition(blendSpeed) { + this.blendSpeed = 0.5; + this.blendSpeed = blendSpeed; + } + CrossfadeTransition.prototype.getAnimationNode = function (animator, startNode, endNode, startBlend /*int*/) { + var crossFadeTransitionNode = new CrossfadeTransitionNode(); + crossFadeTransitionNode.inputA = startNode; + crossFadeTransitionNode.inputB = endNode; + crossFadeTransitionNode.blendSpeed = this.blendSpeed; + crossFadeTransitionNode.startBlend = startBlend; + return crossFadeTransitionNode; + }; + return CrossfadeTransition; +})(); +module.exports = CrossfadeTransition; + + +},{"awayjs-renderergl/lib/animators/transitions/CrossfadeTransitionNode":undefined}],"awayjs-renderergl/lib/animators/transitions/IAnimationTransition":[function(require,module,exports){ + + + +},{}],"awayjs-renderergl/lib/core/base/ParticleGeometry":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Geometry = require("awayjs-core/lib/core/base/Geometry"); +/** + * @class away.base.ParticleGeometry + */ +var ParticleGeometry = (function (_super) { + __extends(ParticleGeometry, _super); + function ParticleGeometry() { + _super.apply(this, arguments); + } + return ParticleGeometry; +})(Geometry); +module.exports = ParticleGeometry; + + +},{"awayjs-core/lib/core/base/Geometry":undefined}],"awayjs-renderergl/lib/core/pick/JSPickingCollider":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var TriangleSubGeometry = require("awayjs-core/lib/core/base/TriangleSubGeometry"); +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var PickingColliderBase = require("awayjs-renderergl/lib/core/pick/PickingColliderBase"); +/** + * Pure JS picking collider for display objects. Used with the RaycastPicker picking object. + * + * @see away.base.DisplayObject#pickingCollider + * @see away.pick.RaycastPicker + * + * @class away.pick.JSPickingCollider + */ +var JSPickingCollider = (function (_super) { + __extends(JSPickingCollider, _super); + /** + * Creates a new JSPickingCollider object. + * + * @param findClosestCollision Determines whether the picking collider searches for the closest collision along the ray. Defaults to false. + */ + function JSPickingCollider(findClosestCollision) { + if (findClosestCollision === void 0) { findClosestCollision = false; } + _super.call(this); + this._findClosestCollision = findClosestCollision; + } + /** + * @inheritDoc + */ + JSPickingCollider.prototype._pTestRenderableCollision = function (renderable, pickingCollisionVO, shortestCollisionDistance) { + var t; + var i0, i1, i2; + var rx, ry, rz; + var nx, ny, nz; + var cx, cy, cz; + var coeff, u, v, w; + var p0x, p0y, p0z; + var p1x, p1y, p1z; + var p2x, p2y, p2z; + var s0x, s0y, s0z; + var s1x, s1y, s1z; + var nl, nDotV, D, disToPlane; + var Q1Q2, Q1Q1, Q2Q2, RQ1, RQ2; + var indexData = renderable.getIndexData().data; + var collisionTriangleIndex = -1; + var bothSides = renderable.materialOwner.material.bothSides; + var positionData = renderable.getVertexData(TriangleSubGeometry.POSITION_DATA).data; + var positionStride = renderable.getVertexData(TriangleSubGeometry.POSITION_DATA).dataPerVertex; + var positionOffset = renderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA); + var uvData = renderable.getVertexData(TriangleSubGeometry.UV_DATA).data; + var uvStride = renderable.getVertexData(TriangleSubGeometry.UV_DATA).dataPerVertex; + var uvOffset = renderable.getVertexOffset(TriangleSubGeometry.UV_DATA); + var numIndices = indexData.length; + for (var index = 0; index < numIndices; index += 3) { + // evaluate triangle indices + i0 = positionOffset + indexData[index] * positionStride; + i1 = positionOffset + indexData[(index + 1)] * positionStride; + i2 = positionOffset + indexData[(index + 2)] * positionStride; + // evaluate triangle positions + p0x = positionData[i0]; + p0y = positionData[(i0 + 1)]; + p0z = positionData[(i0 + 2)]; + p1x = positionData[i1]; + p1y = positionData[(i1 + 1)]; + p1z = positionData[(i1 + 2)]; + p2x = positionData[i2]; + p2y = positionData[(i2 + 1)]; + p2z = positionData[(i2 + 2)]; + // evaluate sides and triangle normal + s0x = p1x - p0x; // s0 = p1 - p0 + s0y = p1y - p0y; + s0z = p1z - p0z; + s1x = p2x - p0x; // s1 = p2 - p0 + s1y = p2y - p0y; + s1z = p2z - p0z; + nx = s0y * s1z - s0z * s1y; // n = s0 x s1 + ny = s0z * s1x - s0x * s1z; + nz = s0x * s1y - s0y * s1x; + nl = 1 / Math.sqrt(nx * nx + ny * ny + nz * nz); // normalize n + nx *= nl; + ny *= nl; + nz *= nl; + // -- plane intersection test -- + nDotV = nx * this.rayDirection.x + ny * +this.rayDirection.y + nz * this.rayDirection.z; // rayDirection . normal + if ((!bothSides && nDotV < 0.0) || (bothSides && nDotV != 0.0)) { + // find collision t + D = -(nx * p0x + ny * p0y + nz * p0z); + disToPlane = -(nx * this.rayPosition.x + ny * this.rayPosition.y + nz * this.rayPosition.z + D); + t = disToPlane / nDotV; + // find collision point + cx = this.rayPosition.x + t * this.rayDirection.x; + cy = this.rayPosition.y + t * this.rayDirection.y; + cz = this.rayPosition.z + t * this.rayDirection.z; + // collision point inside triangle? ( using barycentric coordinates ) + Q1Q2 = s0x * s1x + s0y * s1y + s0z * s1z; + Q1Q1 = s0x * s0x + s0y * s0y + s0z * s0z; + Q2Q2 = s1x * s1x + s1y * s1y + s1z * s1z; + rx = cx - p0x; + ry = cy - p0y; + rz = cz - p0z; + RQ1 = rx * s0x + ry * s0y + rz * s0z; + RQ2 = rx * s1x + ry * s1y + rz * s1z; + coeff = 1 / (Q1Q1 * Q2Q2 - Q1Q2 * Q1Q2); + v = coeff * (Q2Q2 * RQ1 - Q1Q2 * RQ2); + w = coeff * (-Q1Q2 * RQ1 + Q1Q1 * RQ2); + if (v < 0) + continue; + if (w < 0) + continue; + u = 1 - v - w; + if (!(u < 0) && t > 0 && t < shortestCollisionDistance) { + shortestCollisionDistance = t; + collisionTriangleIndex = index / 3; + pickingCollisionVO.rayEntryDistance = t; + pickingCollisionVO.localPosition = new Vector3D(cx, cy, cz); + pickingCollisionVO.localNormal = new Vector3D(nx, ny, nz); + pickingCollisionVO.uv = this._pGetCollisionUV(indexData, uvData, index, v, w, u, uvOffset, uvStride); + pickingCollisionVO.index = index; + // pickingCollisionVO.subGeometryIndex = this.pGetMeshSubMeshIndex(renderable); + // if not looking for best hit, first found will do... + if (!this._findClosestCollision) + return true; + } + } + } + if (collisionTriangleIndex >= 0) + return true; + return false; + }; + return JSPickingCollider; +})(PickingColliderBase); +module.exports = JSPickingCollider; + + +},{"awayjs-core/lib/core/base/TriangleSubGeometry":undefined,"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-renderergl/lib/core/pick/PickingColliderBase":undefined}],"awayjs-renderergl/lib/core/pick/PickingColliderBase":[function(require,module,exports){ +var RenderablePool = require("awayjs-core/lib/core/pool/RenderablePool"); +var Point = require("awayjs-core/lib/core/geom/Point"); +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var AbstractMethodError = require("awayjs-core/lib/errors/AbstractMethodError"); +var BillboardRenderable = require("awayjs-stagegl/lib/core/pool/BillboardRenderable"); +var TriangleSubMeshRenderable = require("awayjs-stagegl/lib/core/pool/TriangleSubMeshRenderable"); +/** + * An abstract base class for all picking collider classes. It should not be instantiated directly. + * + * @class away.pick.PickingColliderBase + */ +var PickingColliderBase = (function () { + function PickingColliderBase() { + this._billboardRenderablePool = RenderablePool.getPool(BillboardRenderable); + this._subMeshRenderablePool = RenderablePool.getPool(TriangleSubMeshRenderable); + } + PickingColliderBase.prototype._pPetCollisionNormal = function (indexData /*uint*/, vertexData, triangleIndex) { + var normal = new Vector3D(); + var i0 = indexData[triangleIndex] * 3; + var i1 = indexData[triangleIndex + 1] * 3; + var i2 = indexData[triangleIndex + 2] * 3; + var p0 = new Vector3D(vertexData[i0], vertexData[i0 + 1], vertexData[i0 + 2]); + var p1 = new Vector3D(vertexData[i1], vertexData[i1 + 1], vertexData[i1 + 2]); + var p2 = new Vector3D(vertexData[i2], vertexData[i2 + 1], vertexData[i2 + 2]); + var side0 = p1.subtract(p0); + var side1 = p2.subtract(p0); + normal = side0.crossProduct(side1); + normal.normalize(); + return normal; + }; + PickingColliderBase.prototype._pGetCollisionUV = function (indexData /*uint*/, uvData, triangleIndex, v, w, u, uvOffset, uvStride) { + var uv = new Point(); + var uIndex = indexData[triangleIndex] * uvStride + uvOffset; + var uv0 = new Vector3D(uvData[uIndex], uvData[uIndex + 1]); + uIndex = indexData[triangleIndex + 1] * uvStride + uvOffset; + var uv1 = new Vector3D(uvData[uIndex], uvData[uIndex + 1]); + uIndex = indexData[triangleIndex + 2] * uvStride + uvOffset; + var uv2 = new Vector3D(uvData[uIndex], uvData[uIndex + 1]); + uv.x = u * uv0.x + v * uv1.x + w * uv2.x; + uv.y = u * uv0.y + v * uv1.y + w * uv2.y; + return uv; + }; + /** + * @inheritDoc + */ + PickingColliderBase.prototype._pTestRenderableCollision = function (renderable, pickingCollisionVO, shortestCollisionDistance) { + throw new AbstractMethodError(); + }; + /** + * @inheritDoc + */ + PickingColliderBase.prototype.setLocalRay = function (localPosition, localDirection) { + this.rayPosition = localPosition; + this.rayDirection = localDirection; + }; + /** + * Tests a Billboard object for a collision with the picking ray. + * + * @param billboard The billboard instance to be tested. + * @param pickingCollisionVO The collision object used to store the collision results + * @param shortestCollisionDistance The current value of the shortest distance to a detected collision along the ray. + * @param findClosest + */ + PickingColliderBase.prototype.testBillboardCollision = function (billboard, pickingCollisionVO, shortestCollisionDistance) { + this.setLocalRay(pickingCollisionVO.localRayPosition, pickingCollisionVO.localRayDirection); + pickingCollisionVO.materialOwner = null; + if (this._pTestRenderableCollision(this._billboardRenderablePool.getItem(billboard), pickingCollisionVO, shortestCollisionDistance)) { + shortestCollisionDistance = pickingCollisionVO.rayEntryDistance; + pickingCollisionVO.materialOwner = billboard; + return true; + } + return false; + }; + /** + * Tests a Mesh object for a collision with the picking ray. + * + * @param mesh The mesh instance to be tested. + * @param pickingCollisionVO The collision object used to store the collision results + * @param shortestCollisionDistance The current value of the shortest distance to a detected collision along the ray. + * @param findClosest + */ + PickingColliderBase.prototype.testMeshCollision = function (mesh, pickingCollisionVO, shortestCollisionDistance, findClosest) { + this.setLocalRay(pickingCollisionVO.localRayPosition, pickingCollisionVO.localRayDirection); + pickingCollisionVO.materialOwner = null; + var subMesh; + var len = mesh.subMeshes.length; + for (var i = 0; i < len; ++i) { + subMesh = mesh.subMeshes[i]; + if (this._pTestRenderableCollision(this._subMeshRenderablePool.getItem(subMesh), pickingCollisionVO, shortestCollisionDistance)) { + shortestCollisionDistance = pickingCollisionVO.rayEntryDistance; + pickingCollisionVO.materialOwner = subMesh; + if (!findClosest) + return true; + } + } + return pickingCollisionVO.materialOwner != null; + }; + return PickingColliderBase; +})(); +module.exports = PickingColliderBase; + + +},{"awayjs-core/lib/core/geom/Point":undefined,"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-core/lib/core/pool/RenderablePool":undefined,"awayjs-core/lib/errors/AbstractMethodError":undefined,"awayjs-stagegl/lib/core/pool/BillboardRenderable":undefined,"awayjs-stagegl/lib/core/pool/TriangleSubMeshRenderable":undefined}],"awayjs-renderergl/lib/core/pick/ShaderPicker":[function(require,module,exports){ +var Debug = require("awayjs-core/lib/utils/Debug"); +var BitmapData = require("awayjs-core/lib/core/base/BitmapData"); +var TriangleSubGeometry = require("awayjs-core/lib/core/base/TriangleSubGeometry"); +var Matrix3DUtils = require("awayjs-core/lib/core/geom/Matrix3DUtils"); +var Point = require("awayjs-core/lib/core/geom/Point"); +var Rectangle = require("awayjs-core/lib/core/geom/Rectangle"); +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var AGALMiniAssembler = require("awayjs-stagegl/lib/aglsl/assembler/AGALMiniAssembler"); +var ContextGLBlendFactor = require("awayjs-stagegl/lib/core/stagegl/ContextGLBlendFactor"); +var ContextGLClearMask = require("awayjs-stagegl/lib/core/stagegl/ContextGLClearMask"); +var ContextGLCompareMode = require("awayjs-stagegl/lib/core/stagegl/ContextGLCompareMode"); +var ContextGLProgramType = require("awayjs-stagegl/lib/core/stagegl/ContextGLProgramType"); +var ContextGLTriangleFace = require("awayjs-stagegl/lib/core/stagegl/ContextGLTriangleFace"); +/** + * Picks a 3d object from a view or scene by performing a separate render pass on the scene around the area being picked using key color values, + * then reading back the color value of the pixel in the render representing the picking ray. Requires multiple passes and readbacks for retriving details + * on an entity that has its shaderPickingDetails property set to true. + * + * A read-back operation from any GPU is not a very efficient process, and the amount of processing used can vary significantly between different hardware. + * + * @see away.entities.Entity#shaderPickingDetails + * + * @class away.pick.ShaderPicker + */ +var ShaderPicker = (function () { + /** + * Creates a new ShaderPicker object. + * + * @param shaderPickingDetails Determines whether the picker includes a second pass to calculate extra + * properties such as uv and normal coordinates. + */ + function ShaderPicker(shaderPickingDetails) { + if (shaderPickingDetails === void 0) { shaderPickingDetails = false; } + this._onlyMouseEnabled = true; + this._interactives = new Array(); + this._localHitPosition = new Vector3D(); + this._hitUV = new Point(); + this._localHitNormal = new Vector3D(); + this._rayPos = new Vector3D(); + this._rayDir = new Vector3D(); + this._shaderPickingDetails = shaderPickingDetails; + this._id = new Array(4); + this._viewportData = new Array(4); // first 2 contain scale, last 2 translation + this._boundOffsetScale = new Array(8); // first 2 contain scale, last 2 translation + this._boundOffsetScale[3] = 0; + this._boundOffsetScale[7] = 1; + } + Object.defineProperty(ShaderPicker.prototype, "onlyMouseEnabled", { + /** + * @inheritDoc + */ + get: function () { + return this._onlyMouseEnabled; + }, + set: function (value) { + this._onlyMouseEnabled = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + ShaderPicker.prototype.getViewCollision = function (x, y, view) { + var collector = view.iEntityCollector; + this._stage = view.renderer.stage; + if (!this._stage) + return null; + this._context = this._stage.context; + this._viewportData[0] = view.width; + this._viewportData[1] = view.height; + this._viewportData[2] = -(this._projX = 2 * x / view.width - 1); + this._viewportData[3] = this._projY = 2 * y / view.height - 1; + // _potentialFound will be set to true if any object is actually rendered + this._potentialFound = false; + //reset head values + this._blendedRenderableHead = null; + this._opaqueRenderableHead = null; + this.pDraw(collector, null); + // clear buffers + this._context.setVertexBufferAt(0, null); + if (!this._context || !this._potentialFound) + return null; + if (!this._bitmapData) + this._bitmapData = new BitmapData(1, 1, false, 0); + this._context.drawToBitmapData(this._bitmapData); + this._hitColor = this._bitmapData.getPixel(0, 0); + if (!this._hitColor) { + this._context.present(); + return null; + } + this._hitRenderable = this._interactives[this._hitColor - 1]; + this._hitEntity = this._hitRenderable.sourceEntity; + if (this._onlyMouseEnabled && !this._hitEntity._iIsMouseEnabled()) + return null; + var _collisionVO = this._hitEntity._iPickingCollisionVO; + if (this._shaderPickingDetails) { + this.getHitDetails(view.camera); + _collisionVO.localPosition = this._localHitPosition; + _collisionVO.localNormal = this._localHitNormal; + _collisionVO.uv = this._hitUV; + _collisionVO.index = this._faceIndex; + } + else { + _collisionVO.localPosition = null; + _collisionVO.localNormal = null; + _collisionVO.uv = null; + _collisionVO.index = 0; + } + return _collisionVO; + }; + //*/ + /** + * @inheritDoc + */ + ShaderPicker.prototype.getSceneCollision = function (position, direction, scene) { + return null; + }; + /** + * @inheritDoc + */ + ShaderPicker.prototype.pDraw = function (entityCollector, target) { + var camera = entityCollector.camera; + this._context.clear(0, 0, 0, 1); + this._stage.scissorRect = ShaderPicker.MOUSE_SCISSOR_RECT; + this._interactives.length = this._interactiveId = 0; + if (!this._objectProgram) + this.initObjectProgram(); + this._context.setBlendFactors(ContextGLBlendFactor.ONE, ContextGLBlendFactor.ZERO); + this._context.setDepthTest(true, ContextGLCompareMode.LESS); + this._context.setProgram(this._objectProgram); + this._context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX, 4, this._viewportData, 1); + //this.drawRenderables(entityCollector.opaqueRenderableHead, camera); + //this.drawRenderables(entityCollector.blendedRenderableHead, camera); + //TODO: reimplement ShaderPicker inheriting from RendererBase + }; + /** + * Draw a list of renderables. + * @param renderables The renderables to draw. + * @param camera The camera for which to render. + */ + ShaderPicker.prototype.drawRenderables = function (renderable, camera) { + var matrix = Matrix3DUtils.CALCULATION_MATRIX; + var viewProjection = camera.viewProjection; + while (renderable) { + // it's possible that the renderable was already removed from the scene + if (!renderable.sourceEntity.scene || !renderable.sourceEntity._iIsMouseEnabled()) { + renderable = renderable.next; + continue; + } + this._potentialFound = true; + this._context.setCulling(renderable.materialOwner.material.bothSides ? ContextGLTriangleFace.NONE : ContextGLTriangleFace.BACK, camera.projection.coordinateSystem); + this._interactives[this._interactiveId++] = renderable; + // color code so that reading from bitmapdata will contain the correct value + this._id[1] = (this._interactiveId >> 8) / 255; // on green channel + this._id[2] = (this._interactiveId & 0xff) / 255; // on blue channel + matrix.copyFrom(renderable.sourceEntity.getRenderSceneTransform(camera)); + matrix.append(viewProjection); + this._context.setProgramConstantsFromMatrix(ContextGLProgramType.VERTEX, 0, matrix, true); + this._context.setProgramConstantsFromArray(ContextGLProgramType.FRAGMENT, 0, this._id, 1); + this._context.activateBuffer(0, renderable.getVertexData(TriangleSubGeometry.POSITION_DATA), renderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA), TriangleSubGeometry.POSITION_FORMAT); + this._context.drawTriangles(this._context.getIndexBuffer(renderable.getIndexData()), 0, renderable.numTriangles); + renderable = renderable.next; + } + }; + ShaderPicker.prototype.updateRay = function (camera) { + this._rayPos = camera.scenePosition; + this._rayDir = camera.getRay(this._projX, this._projY, 1); + this._rayDir.normalize(); + }; + /** + * Creates the Program that color-codes objects. + */ + ShaderPicker.prototype.initObjectProgram = function () { + var vertexCode; + var fragmentCode; + this._objectProgram = this._context.createProgram(); + vertexCode = "m44 vt0, va0, vc0 \n" + "mul vt1.xy, vt0.w, vc4.zw \n" + "add vt0.xy, vt0.xy, vt1.xy \n" + "mul vt0.xy, vt0.xy, vc4.xy \n" + "mov op, vt0 \n"; + fragmentCode = "mov oc, fc0"; // write identifier + Debug.throwPIR('ShaderPicker', 'initTriangleProgram', 'Dependency: initObjectProgram'); + //_objectProgram.upload(new AGALMiniAssembler().assemble(ContextGLProgramType.VERTEX, vertexCode),new AGALMiniAssembler().assemble(ContextGLProgramType.FRAGMENT, fragmentCode)); + }; + /** + * Creates the Program that renders positions. + */ + ShaderPicker.prototype.initTriangleProgram = function () { + var vertexCode; + var fragmentCode; + this._triangleProgram = this._context.createProgram(); + // todo: add animation code + vertexCode = "add vt0, va0, vc5 \n" + "mul vt0, vt0, vc6 \n" + "mov v0, vt0 \n" + "m44 vt0, va0, vc0 \n" + "mul vt1.xy, vt0.w, vc4.zw \n" + "add vt0.xy, vt0.xy, vt1.xy \n" + "mul vt0.xy, vt0.xy, vc4.xy \n" + "mov op, vt0 \n"; + fragmentCode = "mov oc, v0"; // write identifier + var vertexByteCode = (new AGALMiniAssembler().assemble("part vertex 1\n" + vertexCode + "endpart"))['vertex'].data; + var fragmentByteCode = (new AGALMiniAssembler().assemble("part fragment 1\n" + fragmentCode + "endpart"))['fragment'].data; + this._triangleProgram.upload(vertexByteCode, fragmentByteCode); + }; + /** + * Gets more detailed information about the hir position, if required. + * @param camera The camera used to view the hit object. + */ + ShaderPicker.prototype.getHitDetails = function (camera) { + this.getApproximatePosition(camera); + this.getPreciseDetails(camera); + }; + /** + * Finds a first-guess approximate position about the hit position. + * + * @param camera The camera used to view the hit object. + */ + ShaderPicker.prototype.getApproximatePosition = function (camera) { + var bounds = this._hitRenderable.sourceEntity.bounds.aabb; + var col; + var scX, scY, scZ; + var offsX, offsY, offsZ; + var localViewProjection = Matrix3DUtils.CALCULATION_MATRIX; + localViewProjection.copyFrom(this._hitRenderable.sourceEntity.getRenderSceneTransform(camera)); + localViewProjection.append(camera.viewProjection); + if (!this._triangleProgram) { + this.initTriangleProgram(); + } + this._boundOffsetScale[4] = 1 / (scX = bounds.width); + this._boundOffsetScale[5] = 1 / (scY = bounds.height); + this._boundOffsetScale[6] = 1 / (scZ = bounds.depth); + this._boundOffsetScale[0] = offsX = -bounds.x; + this._boundOffsetScale[1] = offsY = -bounds.y; + this._boundOffsetScale[2] = offsZ = -bounds.z; + this._context.setProgram(this._triangleProgram); + this._context.clear(0, 0, 0, 0, 1, 0, ContextGLClearMask.DEPTH); + this._context.setScissorRectangle(ShaderPicker.MOUSE_SCISSOR_RECT); + this._context.setProgramConstantsFromMatrix(ContextGLProgramType.VERTEX, 0, localViewProjection, true); + this._context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX, 5, this._boundOffsetScale, 2); + this._context.activateBuffer(0, this._hitRenderable.getVertexData(TriangleSubGeometry.POSITION_DATA), this._hitRenderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA), TriangleSubGeometry.POSITION_FORMAT); + this._context.drawTriangles(this._context.getIndexBuffer(this._hitRenderable.getIndexData()), 0, this._hitRenderable.numTriangles); + this._context.drawToBitmapData(this._bitmapData); + col = this._bitmapData.getPixel(0, 0); + this._localHitPosition.x = ((col >> 16) & 0xff) * scX / 255 - offsX; + this._localHitPosition.y = ((col >> 8) & 0xff) * scY / 255 - offsY; + this._localHitPosition.z = (col & 0xff) * scZ / 255 - offsZ; + }; + /** + * Use the approximate position info to find the face under the mouse position from which we can derive the precise + * ray-face intersection point, then use barycentric coordinates to figure out the uv coordinates, etc. + * @param camera The camera used to view the hit object. + */ + ShaderPicker.prototype.getPreciseDetails = function (camera) { + var len = indices.length; + var x1, y1, z1; + var x2, y2, z2; + var x3, y3, z3; + var i = 0, j = 1, k = 2; + var t1, t2, t3; + var v0x, v0y, v0z; + var v1x, v1y, v1z; + var v2x, v2y, v2z; + var ni1, ni2, ni3; + var n1, n2, n3, nLength; + var dot00, dot01, dot02, dot11, dot12; + var s, t, invDenom; + var x = this._localHitPosition.x, y = this._localHitPosition.y, z = this._localHitPosition.z; + var u, v; + var ui1, ui2, ui3; + var s0x, s0y, s0z; + var s1x, s1y, s1z; + var nl; + var indices = this._hitRenderable.getIndexData().data; + var positions = this._hitRenderable.getVertexData(TriangleSubGeometry.POSITION_DATA).data; + var positionStride = this._hitRenderable.getVertexData(TriangleSubGeometry.POSITION_DATA).dataPerVertex; + var positionOffset = this._hitRenderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA); + var uvs = this._hitRenderable.getVertexData(TriangleSubGeometry.UV_DATA).data; + var uvStride = this._hitRenderable.getVertexData(TriangleSubGeometry.UV_DATA).dataPerVertex; + var uvOffset = this._hitRenderable.getVertexOffset(TriangleSubGeometry.UV_DATA); + var normals = this._hitRenderable.getVertexData(TriangleSubGeometry.NORMAL_DATA).data; + var normalStride = this._hitRenderable.getVertexData(TriangleSubGeometry.NORMAL_DATA).dataPerVertex; + var normalOffset = this._hitRenderable.getVertexOffset(TriangleSubGeometry.NORMAL_DATA); + this.updateRay(camera); + while (i < len) { + t1 = positionOffset + indices[i] * positionStride; + t2 = positionOffset + indices[j] * positionStride; + t3 = positionOffset + indices[k] * positionStride; + x1 = positions[t1]; + y1 = positions[t1 + 1]; + z1 = positions[t1 + 2]; + x2 = positions[t2]; + y2 = positions[t2 + 1]; + z2 = positions[t2 + 2]; + x3 = positions[t3]; + y3 = positions[t3 + 1]; + z3 = positions[t3 + 2]; + // if within bounds + if (!((x < x1 && x < x2 && x < x3) || (y < y1 && y < y2 && y < y3) || (z < z1 && z < z2 && z < z3) || (x > x1 && x > x2 && x > x3) || (y > y1 && y > y2 && y > y3) || (z > z1 && z > z2 && z > z3))) { + // calculate barycentric coords for approximated position + v0x = x3 - x1; + v0y = y3 - y1; + v0z = z3 - z1; + v1x = x2 - x1; + v1y = y2 - y1; + v1z = z2 - z1; + v2x = x - x1; + v2y = y - y1; + v2z = z - z1; + dot00 = v0x * v0x + v0y * v0y + v0z * v0z; + dot01 = v0x * v1x + v0y * v1y + v0z * v1z; + dot02 = v0x * v2x + v0y * v2y + v0z * v2z; + dot11 = v1x * v1x + v1y * v1y + v1z * v1z; + dot12 = v1x * v2x + v1y * v2y + v1z * v2z; + invDenom = 1 / (dot00 * dot11 - dot01 * dot01); + s = (dot11 * dot02 - dot01 * dot12) * invDenom; + t = (dot00 * dot12 - dot01 * dot02) * invDenom; + // if inside the current triangle, fetch details hit information + if (s >= 0 && t >= 0 && (s + t) <= 1) { + ni1 = normalOffset + indices[i] * normalStride; + ni2 = normalOffset + indices[j] * normalStride; + ni3 = normalOffset + indices[k] * normalStride; + n1 = indices[ni1] + indices[ni2] + indices[ni3]; + n2 = indices[ni1 + 1] + indices[ni2 + 1] + indices[ni3 + 1]; + n3 = indices[ni1 + 2] + indices[ni2 + 2] + indices[ni3 + 2]; + nLength = Math.sqrt(n1 * n1 + n2 * n2 + n3 * n3); + n1 /= nLength; + n2 /= nLength; + n3 /= nLength; + // this is def the triangle, now calculate precise coords + this.getPrecisePosition(this._hitRenderable.sourceEntity.inverseSceneTransform, n1, n2, n3, x1, y1, z1); + v2x = this._localHitPosition.x - x1; + v2y = this._localHitPosition.y - y1; + v2z = this._localHitPosition.z - z1; + s0x = x2 - x1; // s0 = p1 - p0 + s0y = y2 - y1; + s0z = z2 - z1; + s1x = x3 - x1; // s1 = p2 - p0 + s1y = y3 - y1; + s1z = z3 - z1; + this._localHitNormal.x = s0y * s1z - s0z * s1y; // n = s0 x s1 + this._localHitNormal.y = s0z * s1x - s0x * s1z; + this._localHitNormal.z = s0x * s1y - s0y * s1x; + nl = 1 / Math.sqrt(this._localHitNormal.x * this._localHitNormal.x + this._localHitNormal.y * this._localHitNormal.y + this._localHitNormal.z * this._localHitNormal.z); // normalize n + this._localHitNormal.x *= nl; + this._localHitNormal.y *= nl; + this._localHitNormal.z *= nl; + dot02 = v0x * v2x + v0y * v2y + v0z * v2z; + dot12 = v1x * v2x + v1y * v2y + v1z * v2z; + s = (dot11 * dot02 - dot01 * dot12) * invDenom; + t = (dot00 * dot12 - dot01 * dot02) * invDenom; + ui1 = uvOffset + indices[i] * uvStride; + ui2 = uvOffset + indices[j] * uvStride; + ui3 = uvOffset + indices[k] * uvStride; + u = uvs[ui1]; + v = uvs[ui1 + 1]; + this._hitUV.x = u + t * (uvs[ui2] - u) + s * (uvs[ui3] - u); + this._hitUV.y = v + t * (uvs[ui2 + 1] - v) + s * (uvs[ui3 + 1] - v); + this._faceIndex = i; + //TODO add back subGeometryIndex value + //this._subGeometryIndex = away.utils.GeometryUtils.getMeshSubGeometryIndex(subGeom); + return; + } + } + i += 3; + j += 3; + k += 3; + } + }; + /** + * Finds the precise hit position by unprojecting the screen coordinate back unto the hit face's plane and + * calculating the intersection point. + * @param camera The camera used to render the object. + * @param invSceneTransform The inverse scene transformation of the hit object. + * @param nx The x-coordinate of the face's plane normal. + * @param ny The y-coordinate of the face plane normal. + * @param nz The z-coordinate of the face plane normal. + * @param px The x-coordinate of a point on the face's plane (ie a face vertex) + * @param py The y-coordinate of a point on the face's plane (ie a face vertex) + * @param pz The z-coordinate of a point on the face's plane (ie a face vertex) + */ + ShaderPicker.prototype.getPrecisePosition = function (invSceneTransform, nx, ny, nz, px, py, pz) { + // calculate screen ray and find exact intersection position with triangle + var rx, ry, rz; + var ox, oy, oz; + var t; + var raw = Matrix3DUtils.RAW_DATA_CONTAINER; + var cx = this._rayPos.x, cy = this._rayPos.y, cz = this._rayPos.z; + // unprojected projection point, gives ray dir in cam space + ox = this._rayDir.x; + oy = this._rayDir.y; + oz = this._rayDir.z; + // transform ray dir and origin (cam pos) to object space + //invSceneTransform.copyRawDataTo( raw ); + invSceneTransform.copyRawDataTo(raw); + rx = raw[0] * ox + raw[4] * oy + raw[8] * oz; + ry = raw[1] * ox + raw[5] * oy + raw[9] * oz; + rz = raw[2] * ox + raw[6] * oy + raw[10] * oz; + ox = raw[0] * cx + raw[4] * cy + raw[8] * cz + raw[12]; + oy = raw[1] * cx + raw[5] * cy + raw[9] * cz + raw[13]; + oz = raw[2] * cx + raw[6] * cy + raw[10] * cz + raw[14]; + t = ((px - ox) * nx + (py - oy) * ny + (pz - oz) * nz) / (rx * nx + ry * ny + rz * nz); + this._localHitPosition.x = ox + rx * t; + this._localHitPosition.y = oy + ry * t; + this._localHitPosition.z = oz + rz * t; + }; + ShaderPicker.prototype.dispose = function () { + this._bitmapData.dispose(); + if (this._triangleProgram) + this._triangleProgram.dispose(); + if (this._objectProgram) + this._objectProgram.dispose(); + this._triangleProgram = null; + this._objectProgram = null; + this._bitmapData = null; + this._hitRenderable = null; + this._hitEntity = null; + }; + ShaderPicker.MOUSE_SCISSOR_RECT = new Rectangle(0, 0, 1, 1); + return ShaderPicker; +})(); +module.exports = ShaderPicker; + + +},{"awayjs-core/lib/core/base/BitmapData":undefined,"awayjs-core/lib/core/base/TriangleSubGeometry":undefined,"awayjs-core/lib/core/geom/Matrix3DUtils":undefined,"awayjs-core/lib/core/geom/Point":undefined,"awayjs-core/lib/core/geom/Rectangle":undefined,"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-core/lib/utils/Debug":undefined,"awayjs-stagegl/lib/aglsl/assembler/AGALMiniAssembler":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLBlendFactor":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLClearMask":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLCompareMode":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLProgramType":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLTriangleFace":undefined}],"awayjs-renderergl/lib/events/AnimationStateEvent":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Event = require("awayjs-core/lib/events/Event"); +/** + * Dispatched to notify changes in an animation state's state. + */ +var AnimationStateEvent = (function (_super) { + __extends(AnimationStateEvent, _super); + /** + * Create a new AnimatonStateEvent + * + * @param type The event type. + * @param animator The animation state object that is the subject of this event. + * @param animationNode The animation node inside the animation state from which the event originated. + */ + function AnimationStateEvent(type, animator, animationState, animationNode) { + _super.call(this, type); + this._animator = animator; + this._animationState = animationState; + this._animationNode = animationNode; + } + Object.defineProperty(AnimationStateEvent.prototype, "animator", { + /** + * The animator object that is the subject of this event. + */ + get: function () { + return this._animator; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationStateEvent.prototype, "animationState", { + /** + * The animation state object that is the subject of this event. + */ + get: function () { + return this._animationState; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationStateEvent.prototype, "animationNode", { + /** + * The animation node inside the animation state from which the event originated. + */ + get: function () { + return this._animationNode; + }, + enumerable: true, + configurable: true + }); + /** + * Clones the event. + * + * @return An exact duplicate of the current object. + */ + AnimationStateEvent.prototype.clone = function () { + return new AnimationStateEvent(this.type, this._animator, this._animationState, this._animationNode); + }; + /** + * Dispatched when a non-looping clip node inside an animation state reaches the end of its timeline. + */ + AnimationStateEvent.PLAYBACK_COMPLETE = "playbackComplete"; + AnimationStateEvent.TRANSITION_COMPLETE = "transitionComplete"; + return AnimationStateEvent; +})(Event); +module.exports = AnimationStateEvent; + + +},{"awayjs-core/lib/events/Event":undefined}],"awayjs-renderergl/lib/materials/methods/AmbientEnvMapMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var AmbientBasicMethod = require("awayjs-stagegl/lib/materials/methods/AmbientBasicMethod"); +var ShaderCompilerHelper = require("awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper"); +/** + * AmbientEnvMapMethod provides a diffuse shading method that uses a diffuse irradiance environment map to + * approximate global lighting rather than lights. + */ +var AmbientEnvMapMethod = (function (_super) { + __extends(AmbientEnvMapMethod, _super); + /** + * Creates a new AmbientEnvMapMethod object. + * + * @param envMap The cube environment map to use for the ambient lighting. + */ + function AmbientEnvMapMethod(envMap) { + _super.call(this); + this._cubeTexture = envMap; + } + /** + * @inheritDoc + */ + AmbientEnvMapMethod.prototype.iInitVO = function (shaderObject, methodVO) { + _super.prototype.iInitVO.call(this, shaderObject, methodVO); + methodVO.needsNormals = true; + }; + Object.defineProperty(AmbientEnvMapMethod.prototype, "envMap", { + /** + * The cube environment map to use for the diffuse lighting. + */ + get: function () { + return this._cubeTexture; + }, + set: function (value) { + this._cubeTexture = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + AmbientEnvMapMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); + stage.context.activateCubeTexture(methodVO.texturesIndex, this._cubeTexture); + }; + /** + * @inheritDoc + */ + AmbientEnvMapMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, regCache, sharedRegisters) { + var code = ""; + var ambientInputRegister; + var cubeMapReg = regCache.getFreeTextureReg(); + methodVO.texturesIndex = cubeMapReg.index; + code += ShaderCompilerHelper.getTexCubeSampleCode(targetReg, cubeMapReg, this._cubeTexture, shaderObject.useSmoothTextures, shaderObject.useMipmapping, sharedRegisters.normalFragment); + ambientInputRegister = regCache.getFreeFragmentConstant(); + methodVO.fragmentConstantsIndex = ambientInputRegister.index; + code += "add " + targetReg + ".xyz, " + targetReg + ".xyz, " + ambientInputRegister + ".xyz\n"; + return code; + }; + return AmbientEnvMapMethod; +})(AmbientBasicMethod); +module.exports = AmbientEnvMapMethod; + + +},{"awayjs-stagegl/lib/materials/methods/AmbientBasicMethod":undefined,"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper":undefined}],"awayjs-renderergl/lib/materials/methods/DiffuseCelMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var DiffuseCompositeMethod = require("awayjs-renderergl/lib/materials/methods/DiffuseCompositeMethod"); +/** + * DiffuseCelMethod provides a shading method to add diffuse cel (cartoon) shading. + */ +var DiffuseCelMethod = (function (_super) { + __extends(DiffuseCelMethod, _super); + /** + * Creates a new DiffuseCelMethod object. + * @param levels The amount of shadow gradations. + * @param baseMethod An optional diffuse method on which the cartoon shading is based. If omitted, DiffuseBasicMethod is used. + */ + function DiffuseCelMethod(levels, baseMethod) { + var _this = this; + if (levels === void 0) { levels = 3; } + if (baseMethod === void 0) { baseMethod = null; } + _super.call(this, null, baseMethod); + this._smoothness = .1; + this.baseMethod._iModulateMethod = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { return _this.clampDiffuse(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); }; + this._levels = levels; + } + /** + * @inheritDoc + */ + DiffuseCelMethod.prototype.iInitConstants = function (shaderObject, methodVO) { + var data = shaderObject.fragmentConstantData; + var index = methodVO.secondaryFragmentConstantsIndex; + _super.prototype.iInitConstants.call(this, shaderObject, methodVO); + data[index + 1] = 1; + data[index + 2] = 0; + }; + Object.defineProperty(DiffuseCelMethod.prototype, "levels", { + /** + * The amount of shadow gradations. + */ + get: function () { + return this._levels; + }, + set: function (value /*uint*/) { + this._levels = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DiffuseCelMethod.prototype, "smoothness", { + /** + * The smoothness of the edge between 2 shading levels. + */ + get: function () { + return this._smoothness; + }, + set: function (value) { + this._smoothness = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + DiffuseCelMethod.prototype.iCleanCompilationData = function () { + _super.prototype.iCleanCompilationData.call(this); + this._dataReg = null; + }; + /** + * @inheritDoc + */ + DiffuseCelMethod.prototype.iGetFragmentPreLightingCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { + this._dataReg = registerCache.getFreeFragmentConstant(); + methodVO.secondaryFragmentConstantsIndex = this._dataReg.index * 4; + return _super.prototype.iGetFragmentPreLightingCode.call(this, shaderObject, methodVO, registerCache, sharedRegisters); + }; + /** + * @inheritDoc + */ + DiffuseCelMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); + var data = shaderObject.fragmentConstantData; + var index = methodVO.secondaryFragmentConstantsIndex; + data[index] = this._levels; + data[index + 3] = this._smoothness; + }; + /** + * Snaps the diffuse shading of the wrapped method to one of the levels. + * @param vo The MethodVO used to compile the current shader. + * @param t The register containing the diffuse strength in the "w" component. + * @param regCache The register cache used for the shader compilation. + * @param sharedRegisters The shared register data for this shader. + * @return The AGAL fragment code for the method. + */ + DiffuseCelMethod.prototype.clampDiffuse = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { + return "mul " + targetReg + ".w, " + targetReg + ".w, " + this._dataReg + ".x\n" + "frc " + targetReg + ".z, " + targetReg + ".w\n" + "sub " + targetReg + ".y, " + targetReg + ".w, " + targetReg + ".z\n" + "mov " + targetReg + ".x, " + this._dataReg + ".x\n" + "sub " + targetReg + ".x, " + targetReg + ".x, " + this._dataReg + ".y\n" + "rcp " + targetReg + ".x," + targetReg + ".x\n" + "mul " + targetReg + ".w, " + targetReg + ".y, " + targetReg + ".x\n" + "sub " + targetReg + ".y, " + targetReg + ".w, " + targetReg + ".x\n" + "div " + targetReg + ".z, " + targetReg + ".z, " + this._dataReg + ".w\n" + "sat " + targetReg + ".z, " + targetReg + ".z\n" + "mul " + targetReg + ".w, " + targetReg + ".w, " + targetReg + ".z\n" + "sub " + targetReg + ".z, " + this._dataReg + ".y, " + targetReg + ".z\n" + "mul " + targetReg + ".y, " + targetReg + ".y, " + targetReg + ".z\n" + "add " + targetReg + ".w, " + targetReg + ".w, " + targetReg + ".y\n" + "sat " + targetReg + ".w, " + targetReg + ".w\n"; + }; + return DiffuseCelMethod; +})(DiffuseCompositeMethod); +module.exports = DiffuseCelMethod; + + +},{"awayjs-renderergl/lib/materials/methods/DiffuseCompositeMethod":undefined}],"awayjs-renderergl/lib/materials/methods/DiffuseCompositeMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ShadingMethodEvent = require("awayjs-stagegl/lib/events/ShadingMethodEvent"); +var DiffuseBasicMethod = require("awayjs-stagegl/lib/materials/methods/DiffuseBasicMethod"); +/** + * DiffuseCompositeMethod provides a base class for diffuse methods that wrap a diffuse method to alter the + * calculated diffuse reflection strength. + */ +var DiffuseCompositeMethod = (function (_super) { + __extends(DiffuseCompositeMethod, _super); + /** + * Creates a new DiffuseCompositeMethod object. + * + * @param modulateMethod The method which will add the code to alter the base method's strength. It needs to have the signature clampDiffuse(t:ShaderRegisterElement, regCache:ShaderRegisterCache):string, in which t.w will contain the diffuse strength. + * @param baseMethod The base diffuse method on which this method's shading is based. + */ + function DiffuseCompositeMethod(modulateMethod, baseMethod) { + var _this = this; + if (baseMethod === void 0) { baseMethod = null; } + _super.call(this); + this._onShaderInvalidatedDelegate = function (event) { return _this.onShaderInvalidated(event); }; + this.pBaseMethod = baseMethod || new DiffuseBasicMethod(); + this.pBaseMethod._iModulateMethod = modulateMethod; + this.pBaseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); + } + Object.defineProperty(DiffuseCompositeMethod.prototype, "baseMethod", { + /** + * The base diffuse method on which this method's shading is based. + */ + get: function () { + return this.pBaseMethod; + }, + set: function (value) { + if (this.pBaseMethod == value) + return; + this.pBaseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); + this.pBaseMethod = value; + this.pBaseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); + this.iInvalidateShaderProgram(); + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + DiffuseCompositeMethod.prototype.iInitVO = function (shaderObject, methodVO) { + this.pBaseMethod.iInitVO(shaderObject, methodVO); + }; + /** + * @inheritDoc + */ + DiffuseCompositeMethod.prototype.iInitConstants = function (shaderObject, methodVO) { + this.pBaseMethod.iInitConstants(shaderObject, methodVO); + }; + /** + * @inheritDoc + */ + DiffuseCompositeMethod.prototype.dispose = function () { + this.pBaseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); + this.pBaseMethod.dispose(); + }; + Object.defineProperty(DiffuseCompositeMethod.prototype, "texture", { + /** + * @inheritDoc + */ + get: function () { + return this.pBaseMethod.texture; + }, + /** + * @inheritDoc + */ + set: function (value) { + this.pBaseMethod.texture = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DiffuseCompositeMethod.prototype, "diffuseColor", { + /** + * @inheritDoc + */ + get: function () { + return this.pBaseMethod.diffuseColor; + }, + /** + * @inheritDoc + */ + set: function (value) { + this.pBaseMethod.diffuseColor = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DiffuseCompositeMethod.prototype, "ambientColor", { + /** + * @inheritDoc + */ + get: function () { + return this.pBaseMethod.ambientColor; + }, + /** + * @inheritDoc + */ + set: function (value) { + this.pBaseMethod.ambientColor = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + DiffuseCompositeMethod.prototype.iGetFragmentPreLightingCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { + return this.pBaseMethod.iGetFragmentPreLightingCode(shaderObject, methodVO, registerCache, sharedRegisters); + }; + /** + * @inheritDoc + */ + DiffuseCompositeMethod.prototype.iGetFragmentCodePerLight = function (shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters) { + var code = this.pBaseMethod.iGetFragmentCodePerLight(shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters); + this._pTotalLightColorReg = this.pBaseMethod._pTotalLightColorReg; + return code; + }; + /** + * @inheritDoc + */ + DiffuseCompositeMethod.prototype.iGetFragmentCodePerProbe = function (shaderObject, methodVO, cubeMapReg, weightRegister, registerCache, sharedRegisters) { + var code = this.pBaseMethod.iGetFragmentCodePerProbe(shaderObject, methodVO, cubeMapReg, weightRegister, registerCache, sharedRegisters); + this._pTotalLightColorReg = this.pBaseMethod._pTotalLightColorReg; + return code; + }; + /** + * @inheritDoc + */ + DiffuseCompositeMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + this.pBaseMethod.iActivate(shaderObject, methodVO, stage); + }; + /** + * @inheritDoc + */ + DiffuseCompositeMethod.prototype.iSetRenderState = function (shaderObject, methodVO, renderable, stage, camera) { + this.pBaseMethod.iSetRenderState(shaderObject, methodVO, renderable, stage, camera); + }; + /** + * @inheritDoc + */ + DiffuseCompositeMethod.prototype.iDeactivate = function (shaderObject, methodVO, stage) { + this.pBaseMethod.iDeactivate(shaderObject, methodVO, stage); + }; + /** + * @inheritDoc + */ + DiffuseCompositeMethod.prototype.iGetVertexCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { + return this.pBaseMethod.iGetVertexCode(shaderObject, methodVO, registerCache, sharedRegisters); + }; + /** + * @inheritDoc + */ + DiffuseCompositeMethod.prototype.iGetFragmentPostLightingCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { + return this.pBaseMethod.iGetFragmentPostLightingCode(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); + }; + /** + * @inheritDoc + */ + DiffuseCompositeMethod.prototype.iReset = function () { + this.pBaseMethod.iReset(); + }; + /** + * @inheritDoc + */ + DiffuseCompositeMethod.prototype.iCleanCompilationData = function () { + _super.prototype.iCleanCompilationData.call(this); + this.pBaseMethod.iCleanCompilationData(); + }; + /** + * Called when the base method's shader code is invalidated. + */ + DiffuseCompositeMethod.prototype.onShaderInvalidated = function (event) { + this.iInvalidateShaderProgram(); + }; + return DiffuseCompositeMethod; +})(DiffuseBasicMethod); +module.exports = DiffuseCompositeMethod; + + +},{"awayjs-stagegl/lib/events/ShadingMethodEvent":undefined,"awayjs-stagegl/lib/materials/methods/DiffuseBasicMethod":undefined}],"awayjs-renderergl/lib/materials/methods/DiffuseDepthMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var DiffuseBasicMethod = require("awayjs-stagegl/lib/materials/methods/DiffuseBasicMethod"); +var ShaderCompilerHelper = require("awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper"); +/** + * DiffuseDepthMethod provides a debug method to visualise depth maps + */ +var DiffuseDepthMethod = (function (_super) { + __extends(DiffuseDepthMethod, _super); + /** + * Creates a new DiffuseBasicMethod object. + */ + function DiffuseDepthMethod() { + _super.call(this); + } + /** + * @inheritDoc + */ + DiffuseDepthMethod.prototype.iInitConstants = function (shaderObject, methodVO) { + var data = shaderObject.fragmentConstantData; + var index = methodVO.fragmentConstantsIndex; + data[index] = 1.0; + data[index + 1] = 1 / 255.0; + data[index + 2] = 1 / 65025.0; + data[index + 3] = 1 / 16581375.0; + }; + /** + * @inheritDoc + */ + DiffuseDepthMethod.prototype.iGetFragmentPostLightingCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { + var code = ""; + var temp; + var decReg; + if (!this._pUseTexture) + throw new Error("DiffuseDepthMethod requires texture!"); + // incorporate input from ambient + if (shaderObject.numLights > 0) { + if (sharedRegisters.shadowTarget) + code += "mul " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ".xyz, " + sharedRegisters.shadowTarget + ".w\n"; + code += "add " + targetReg + ".xyz, " + this._pTotalLightColorReg + ".xyz, " + targetReg + ".xyz\n" + "sat " + targetReg + ".xyz, " + targetReg + ".xyz\n"; + registerCache.removeFragmentTempUsage(this._pTotalLightColorReg); + } + temp = shaderObject.numLights > 0 ? registerCache.getFreeFragmentVectorTemp() : targetReg; + this._pDiffuseInputRegister = registerCache.getFreeTextureReg(); + methodVO.texturesIndex = this._pDiffuseInputRegister.index; + decReg = registerCache.getFreeFragmentConstant(); + methodVO.fragmentConstantsIndex = decReg.index * 4; + code += ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, this._pDiffuseInputRegister, this.texture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping) + "dp4 " + temp + ".x, " + temp + ", " + decReg + "\n" + "mov " + temp + ".yz, " + temp + ".xx \n" + "mov " + temp + ".w, " + decReg + ".x\n" + "sub " + temp + ".xyz, " + decReg + ".xxx, " + temp + ".xyz\n"; + if (shaderObject.numLights == 0) + return code; + code += "mul " + targetReg + ".xyz, " + temp + ".xyz, " + targetReg + ".xyz\n" + "mov " + targetReg + ".w, " + temp + ".w\n"; + return code; + }; + return DiffuseDepthMethod; +})(DiffuseBasicMethod); +module.exports = DiffuseDepthMethod; + + +},{"awayjs-stagegl/lib/materials/methods/DiffuseBasicMethod":undefined,"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper":undefined}],"awayjs-renderergl/lib/materials/methods/DiffuseGradientMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var DiffuseBasicMethod = require("awayjs-stagegl/lib/materials/methods/DiffuseBasicMethod"); +var ShaderCompilerHelper = require("awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper"); +/** + * DiffuseGradientMethod is an alternative to DiffuseBasicMethod in which the shading can be modulated with a gradient + * to introduce color-tinted shading as opposed to the single-channel diffuse strength. This can be used as a crude + * approximation to subsurface scattering (for instance, the mid-range shading for skin can be tinted red to similate + * scattered light within the skin attributing to the final colour) + */ +var DiffuseGradientMethod = (function (_super) { + __extends(DiffuseGradientMethod, _super); + /** + * Creates a new DiffuseGradientMethod object. + * @param gradient A texture that contains the light colour based on the angle. This can be used to change + * the light colour due to subsurface scattering when the surface faces away from the light. + */ + function DiffuseGradientMethod(gradient) { + _super.call(this); + this._gradient = gradient; + } + Object.defineProperty(DiffuseGradientMethod.prototype, "gradient", { + /** + * A texture that contains the light colour based on the angle. This can be used to change the light colour + * due to subsurface scattering when the surface faces away from the light. + */ + get: function () { + return this._gradient; + }, + set: function (value) { + if (value.hasMipmaps != this._gradient.hasMipmaps || value.format != this._gradient.format) + this.iInvalidateShaderProgram(); + this._gradient = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + DiffuseGradientMethod.prototype.iCleanCompilationData = function () { + _super.prototype.iCleanCompilationData.call(this); + this._gradientTextureRegister = null; + }; + /** + * @inheritDoc + */ + DiffuseGradientMethod.prototype.iGetFragmentPreLightingCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { + var code = _super.prototype.iGetFragmentPreLightingCode.call(this, shaderObject, methodVO, registerCache, sharedRegisters); + this._pIsFirstLight = true; + if (shaderObject.numLights > 0) { + this._gradientTextureRegister = registerCache.getFreeTextureReg(); + methodVO.secondaryTexturesIndex = this._gradientTextureRegister.index; + } + return code; + }; + /** + * @inheritDoc + */ + DiffuseGradientMethod.prototype.iGetFragmentCodePerLight = function (shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters) { + var code = ""; + var t; + // write in temporary if not first light, so we can add to total diffuse colour + if (this._pIsFirstLight) + t = this._pTotalLightColorReg; + else { + t = registerCache.getFreeFragmentVectorTemp(); + registerCache.addFragmentTempUsages(t, 1); + } + code += "dp3 " + t + ".w, " + lightDirReg + ".xyz, " + sharedRegisters.normalFragment + ".xyz\n" + "mul " + t + ".w, " + t + ".w, " + sharedRegisters.commons + ".x\n" + "add " + t + ".w, " + t + ".w, " + sharedRegisters.commons + ".x\n" + "mul " + t + ".xyz, " + t + ".w, " + lightDirReg + ".w\n"; + if (this._iModulateMethod != null) + code += this._iModulateMethod(shaderObject, methodVO, t, registerCache, sharedRegisters); + code += ShaderCompilerHelper.getTex2DSampleCode(t, sharedRegisters, this._gradientTextureRegister, this._gradient, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, t, "clamp") + "mul " + t + ".xyz, " + t + ".xyz, " + lightColReg + ".xyz\n"; + if (!this._pIsFirstLight) { + code += "add " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ".xyz, " + t + ".xyz\n"; + registerCache.removeFragmentTempUsage(t); + } + this._pIsFirstLight = false; + return code; + }; + /** + * @inheritDoc + */ + DiffuseGradientMethod.prototype.pApplyShadow = function (shaderObject, methodVO, regCache, sharedRegisters) { + var t = regCache.getFreeFragmentVectorTemp(); + return "mov " + t + ", " + sharedRegisters.shadowTarget + ".wwww\n" + ShaderCompilerHelper.getTex2DSampleCode(t, sharedRegisters, this._gradientTextureRegister, this._gradient, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, t, "clamp") + "mul " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ", " + t + "\n"; + }; + /** + * @inheritDoc + */ + DiffuseGradientMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); + stage.context.activateTexture(methodVO.secondaryTexturesIndex, this._gradient); + }; + return DiffuseGradientMethod; +})(DiffuseBasicMethod); +module.exports = DiffuseGradientMethod; + + +},{"awayjs-stagegl/lib/materials/methods/DiffuseBasicMethod":undefined,"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper":undefined}],"awayjs-renderergl/lib/materials/methods/DiffuseLightMapMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ShaderCompilerHelper = require("awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper"); +var DiffuseCompositeMethod = require("awayjs-renderergl/lib/materials/methods/DiffuseCompositeMethod"); +/** + * DiffuseLightMapMethod provides a diffuse shading method that uses a light map to modulate the calculated diffuse + * lighting. It is different from EffectLightMapMethod in that the latter modulates the entire calculated pixel color, rather + * than only the diffuse lighting value. + */ +var DiffuseLightMapMethod = (function (_super) { + __extends(DiffuseLightMapMethod, _super); + /** + * Creates a new DiffuseLightMapMethod method. + * + * @param lightMap The texture containing the light map. + * @param blendMode The blend mode with which the light map should be applied to the lighting result. + * @param useSecondaryUV Indicates whether the secondary UV set should be used to map the light map. + * @param baseMethod The diffuse method used to calculate the regular diffuse-based lighting. + */ + function DiffuseLightMapMethod(lightMap, blendMode, useSecondaryUV, baseMethod) { + if (blendMode === void 0) { blendMode = "multiply"; } + if (useSecondaryUV === void 0) { useSecondaryUV = false; } + if (baseMethod === void 0) { baseMethod = null; } + _super.call(this, null, baseMethod); + this._useSecondaryUV = useSecondaryUV; + this._lightMapTexture = lightMap; + this.blendMode = blendMode; + } + /** + * @inheritDoc + */ + DiffuseLightMapMethod.prototype.iInitVO = function (shaderObject, methodVO) { + methodVO.needsSecondaryUV = this._useSecondaryUV; + methodVO.needsUV = !this._useSecondaryUV; + }; + Object.defineProperty(DiffuseLightMapMethod.prototype, "blendMode", { + /** + * The blend mode with which the light map should be applied to the lighting result. + * + * @see DiffuseLightMapMethod.ADD + * @see DiffuseLightMapMethod.MULTIPLY + */ + get: function () { + return this._blendMode; + }, + set: function (value) { + if (value != DiffuseLightMapMethod.ADD && value != DiffuseLightMapMethod.MULTIPLY) + throw new Error("Unknown blendmode!"); + if (this._blendMode == value) + return; + this._blendMode = value; + this.iInvalidateShaderProgram(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DiffuseLightMapMethod.prototype, "lightMapTexture", { + /** + * The texture containing the light map data. + */ + get: function () { + return this._lightMapTexture; + }, + set: function (value) { + this._lightMapTexture = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + DiffuseLightMapMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + stage.context.activateTexture(methodVO.secondaryTexturesIndex, this._lightMapTexture); + _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); + }; + /** + * @inheritDoc + */ + DiffuseLightMapMethod.prototype.iGetFragmentPostLightingCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { + var code; + var lightMapReg = registerCache.getFreeTextureReg(); + var temp = registerCache.getFreeFragmentVectorTemp(); + methodVO.secondaryTexturesIndex = lightMapReg.index; + code = ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, lightMapReg, this._lightMapTexture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, sharedRegisters.secondaryUVVarying); + switch (this._blendMode) { + case DiffuseLightMapMethod.MULTIPLY: + code += "mul " + this._pTotalLightColorReg + ", " + this._pTotalLightColorReg + ", " + temp + "\n"; + break; + case DiffuseLightMapMethod.ADD: + code += "add " + this._pTotalLightColorReg + ", " + this._pTotalLightColorReg + ", " + temp + "\n"; + break; + } + code += _super.prototype.iGetFragmentPostLightingCode.call(this, shaderObject, methodVO, targetReg, registerCache, sharedRegisters); + return code; + }; + /** + * Indicates the light map should be multiplied with the calculated shading result. + * This can be used to add pre-calculated shadows or occlusion. + */ + DiffuseLightMapMethod.MULTIPLY = "multiply"; + /** + * Indicates the light map should be added into the calculated shading result. + * This can be used to add pre-calculated lighting or global illumination. + */ + DiffuseLightMapMethod.ADD = "add"; + return DiffuseLightMapMethod; +})(DiffuseCompositeMethod); +module.exports = DiffuseLightMapMethod; + + +},{"awayjs-renderergl/lib/materials/methods/DiffuseCompositeMethod":undefined,"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper":undefined}],"awayjs-renderergl/lib/materials/methods/DiffuseSubSurfaceMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var DiffuseCompositeMethod = require("awayjs-renderergl/lib/materials/methods/DiffuseCompositeMethod"); +var SingleObjectDepthPass = require("awayjs-renderergl/lib/materials/passes/SingleObjectDepthPass"); +/** + * DiffuseSubSurfaceMethod provides a depth map-based diffuse shading method that mimics the scattering of + * light inside translucent surfaces. It allows light to shine through an object and to soften the diffuse shading. + * It can be used for candle wax, ice, skin, ... + */ +var DiffuseSubSurfaceMethod = (function (_super) { + __extends(DiffuseSubSurfaceMethod, _super); + /** + * Creates a new DiffuseSubSurfaceMethod object. + * + * @param depthMapSize The size of the depth map used. + * @param depthMapOffset The amount by which the rendered object will be inflated, to prevent depth map rounding errors. + * @param baseMethod The diffuse method used to calculate the regular diffuse-based lighting. + */ + function DiffuseSubSurfaceMethod(depthMapSize, depthMapOffset, baseMethod) { + var _this = this; + if (depthMapSize === void 0) { depthMapSize = 512; } + if (depthMapOffset === void 0) { depthMapOffset = 15; } + if (baseMethod === void 0) { baseMethod = null; } + _super.call(this, null, baseMethod); + this._translucency = 1; + this._scatterColor = 0xffffff; + this._scatterR = 1.0; + this._scatterG = 1.0; + this._scatterB = 1.0; + this.pBaseMethod._iModulateMethod = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { return _this.scatterLight(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); }; + this._passes = new Array(); + this._depthPass = new SingleObjectDepthPass(); + this._depthPass.textureSize = depthMapSize; + this._depthPass.polyOffset = depthMapOffset; + this._passes.push(this._depthPass); + this._scattering = 0.2; + this._translucency = 1; + } + /** + * @inheritDoc + */ + DiffuseSubSurfaceMethod.prototype.iInitConstants = function (shaderObject, methodVO) { + _super.prototype.iInitConstants.call(this, shaderObject, methodVO); + var data = shaderObject.vertexConstantData; + var index = methodVO.secondaryVertexConstantsIndex; + data[index] = .5; + data[index + 1] = -.5; + data[index + 2] = 0; + data[index + 3] = 1; + data = shaderObject.fragmentConstantData; + index = methodVO.secondaryFragmentConstantsIndex; + data[index + 3] = 1.0; + data[index + 4] = 1.0; + data[index + 5] = 1 / 255; + data[index + 6] = 1 / 65025; + data[index + 7] = 1 / 16581375; + data[index + 10] = .5; + data[index + 11] = -.1; + }; + DiffuseSubSurfaceMethod.prototype.iCleanCompilationData = function () { + _super.prototype.iCleanCompilationData.call(this); + this._lightProjVarying = null; + this._propReg = null; + this._lightColorReg = null; + this._colorReg = null; + this._decReg = null; + this._targetReg = null; + }; + Object.defineProperty(DiffuseSubSurfaceMethod.prototype, "scattering", { + /** + * The amount by which the light scatters. It can be used to set the translucent surface's thickness. Use low + * values for skin. + */ + get: function () { + return this._scattering; + }, + set: function (value) { + this._scattering = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DiffuseSubSurfaceMethod.prototype, "translucency", { + /** + * The translucency of the object. + */ + get: function () { + return this._translucency; + }, + set: function (value) { + this._translucency = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DiffuseSubSurfaceMethod.prototype, "scatterColor", { + /** + * The colour of the "insides" of the object, ie: the colour the light becomes after leaving the object. + */ + get: function () { + return this._scatterColor; + }, + set: function (scatterColor /*uint*/) { + this._scatterColor = scatterColor; + this._scatterR = ((scatterColor >> 16) & 0xff) / 0xff; + this._scatterG = ((scatterColor >> 8) & 0xff) / 0xff; + this._scatterB = (scatterColor & 0xff) / 0xff; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + DiffuseSubSurfaceMethod.prototype.iGetVertexCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { + var code = _super.prototype.iGetVertexCode.call(this, shaderObject, methodVO, registerCache, sharedRegisters); + var lightProjection; + var toTexRegister; + var temp = registerCache.getFreeVertexVectorTemp(); + toTexRegister = registerCache.getFreeVertexConstant(); + methodVO.secondaryVertexConstantsIndex = toTexRegister.index * 4; + this._lightProjVarying = registerCache.getFreeVarying(); + lightProjection = registerCache.getFreeVertexConstant(); + registerCache.getFreeVertexConstant(); + registerCache.getFreeVertexConstant(); + registerCache.getFreeVertexConstant(); + code += "m44 " + temp + ", vt0, " + lightProjection + "\n" + "div " + temp + ".xyz, " + temp + ".xyz, " + temp + ".w\n" + "mul " + temp + ".xy, " + temp + ".xy, " + toTexRegister + ".xy\n" + "add " + temp + ".xy, " + temp + ".xy, " + toTexRegister + ".xx\n" + "mov " + this._lightProjVarying + ".xyz, " + temp + ".xyz\n" + "mov " + this._lightProjVarying + ".w, va0.w\n"; + return code; + }; + /** + * @inheritDoc + */ + DiffuseSubSurfaceMethod.prototype.iGetFragmentPreLightingCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { + this._colorReg = registerCache.getFreeFragmentConstant(); + this._decReg = registerCache.getFreeFragmentConstant(); + this._propReg = registerCache.getFreeFragmentConstant(); + methodVO.secondaryFragmentConstantsIndex = this._colorReg.index * 4; + return _super.prototype.iGetFragmentPreLightingCode.call(this, shaderObject, methodVO, registerCache, sharedRegisters); + }; + /** + * @inheritDoc + */ + DiffuseSubSurfaceMethod.prototype.iGetFragmentCodePerLight = function (shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters) { + this._pIsFirstLight = true; + this._lightColorReg = lightColReg; + return _super.prototype.iGetFragmentCodePerLight.call(this, shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters); + }; + /** + * @inheritDoc + */ + DiffuseSubSurfaceMethod.prototype.iGetFragmentPostLightingCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { + var code = _super.prototype.iGetFragmentPostLightingCode.call(this, shaderObject, methodVO, targetReg, registerCache, sharedRegisters); + var temp = registerCache.getFreeFragmentVectorTemp(); + code += "mul " + temp + ".xyz, " + this._lightColorReg + ".xyz, " + this._targetReg + ".w\n" + "mul " + temp + ".xyz, " + temp + ".xyz, " + this._colorReg + ".xyz\n" + "add " + targetReg + ".xyz, " + targetReg + ".xyz, " + temp + ".xyz\n"; + if (this._targetReg != sharedRegisters.viewDirFragment) + registerCache.removeFragmentTempUsage(targetReg); + return code; + }; + /** + * @inheritDoc + */ + DiffuseSubSurfaceMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); + var index = methodVO.secondaryFragmentConstantsIndex; + var data = shaderObject.fragmentConstantData; + data[index] = this._scatterR; + data[index + 1] = this._scatterG; + data[index + 2] = this._scatterB; + data[index + 8] = this._scattering; + data[index + 9] = this._translucency; + }; + /** + * @inheritDoc + */ + DiffuseSubSurfaceMethod.prototype.iSetRenderState = function (shaderObject, methodVO, renderable, stage, camera) { + stage.context.activateTexture(methodVO.secondaryTexturesIndex, this._depthPass._iGetDepthMap(renderable)); + this._depthPass._iGetProjection(renderable).copyRawDataTo(shaderObject.vertexConstantData, methodVO.secondaryVertexConstantsIndex + 4, true); + }; + /** + * Generates the code for this method + */ + DiffuseSubSurfaceMethod.prototype.scatterLight = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { + // only scatter first light + if (!this._pIsFirstLight) + return ""; + this._pIsFirstLight = false; + var code = ""; + var depthReg = registerCache.getFreeTextureReg(); + if (sharedRegisters.viewDirFragment) { + this._targetReg = sharedRegisters.viewDirFragment; + } + else { + this._targetReg = registerCache.getFreeFragmentVectorTemp(); + registerCache.addFragmentTempUsages(this._targetReg, 1); + } + methodVO.secondaryTexturesIndex = depthReg.index; + var temp = registerCache.getFreeFragmentVectorTemp(); + code += "tex " + temp + ", " + this._lightProjVarying + ", " + depthReg + " <2d,nearest,clamp>\n" + "dp4 " + targetReg + ".z, " + temp + ", " + this._decReg + "\n"; + // currentDistanceToLight - closestDistanceToLight + code += "sub " + targetReg + ".z, " + this._lightProjVarying + ".z, " + targetReg + ".z\n" + "sub " + targetReg + ".z, " + this._propReg + ".x, " + targetReg + ".z\n" + "mul " + targetReg + ".z, " + this._propReg + ".y, " + targetReg + ".z\n" + "sat " + targetReg + ".z, " + targetReg + ".z\n" + "neg " + targetReg + ".y, " + targetReg + ".x\n" + "mul " + targetReg + ".y, " + targetReg + ".y, " + this._propReg + ".z\n" + "add " + targetReg + ".y, " + targetReg + ".y, " + this._propReg + ".z\n" + "mul " + this._targetReg + ".w, " + targetReg + ".z, " + targetReg + ".y\n" + "sub " + targetReg + ".y, " + this._colorReg + ".w, " + this._targetReg + ".w\n" + "mul " + targetReg + ".w, " + targetReg + ".w, " + targetReg + ".y\n"; + return code; + }; + return DiffuseSubSurfaceMethod; +})(DiffuseCompositeMethod); +module.exports = DiffuseSubSurfaceMethod; + + +},{"awayjs-renderergl/lib/materials/methods/DiffuseCompositeMethod":undefined,"awayjs-renderergl/lib/materials/passes/SingleObjectDepthPass":undefined}],"awayjs-renderergl/lib/materials/methods/DiffuseWrapMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var DiffuseBasicMethod = require("awayjs-stagegl/lib/materials/methods/DiffuseBasicMethod"); +/** + * DiffuseWrapMethod is an alternative to DiffuseBasicMethod in which the light is allowed to be "wrapped around" the normally dark area, to some extent. + * It can be used as a crude approximation to Oren-Nayar or simple subsurface scattering. + */ +var DiffuseWrapMethod = (function (_super) { + __extends(DiffuseWrapMethod, _super); + /** + * Creates a new DiffuseWrapMethod object. + * @param wrapFactor A factor to indicate the amount by which the light is allowed to wrap + */ + function DiffuseWrapMethod(wrapFactor) { + if (wrapFactor === void 0) { wrapFactor = .5; } + _super.call(this); + this.wrapFactor = wrapFactor; + } + /** + * @inheritDoc + */ + DiffuseWrapMethod.prototype.iCleanCompilationData = function () { + _super.prototype.iCleanCompilationData.call(this); + this._wrapDataRegister = null; + }; + Object.defineProperty(DiffuseWrapMethod.prototype, "wrapFactor", { + /** + * A factor to indicate the amount by which the light is allowed to wrap. + */ + get: function () { + return this._wrapFactor; + }, + set: function (value) { + this._wrapFactor = value; + this._wrapFactor = 1 / (value + 1); + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + DiffuseWrapMethod.prototype.iGetFragmentPreLightingCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { + var code = _super.prototype.iGetFragmentPreLightingCode.call(this, shaderObject, methodVO, registerCache, sharedRegisters); + this._pIsFirstLight = true; + this._wrapDataRegister = registerCache.getFreeFragmentConstant(); + methodVO.secondaryFragmentConstantsIndex = this._wrapDataRegister.index * 4; + return code; + }; + /** + * @inheritDoc + */ + DiffuseWrapMethod.prototype.iGetFragmentCodePerLight = function (shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters) { + var code = ""; + var t; + // write in temporary if not first light, so we can add to total diffuse colour + if (this._pIsFirstLight) { + t = this._pTotalLightColorReg; + } + else { + t = registerCache.getFreeFragmentVectorTemp(); + registerCache.addFragmentTempUsages(t, 1); + } + code += "dp3 " + t + ".x, " + lightDirReg + ".xyz, " + sharedRegisters.normalFragment + ".xyz\n" + "add " + t + ".y, " + t + ".x, " + this._wrapDataRegister + ".x\n" + "mul " + t + ".y, " + t + ".y, " + this._wrapDataRegister + ".y\n" + "sat " + t + ".w, " + t + ".y\n" + "mul " + t + ".xz, " + t + ".w, " + lightDirReg + ".wz\n"; + if (this._iModulateMethod != null) + code += this._iModulateMethod(shaderObject, methodVO, lightDirReg, registerCache, sharedRegisters); + code += "mul " + t + ", " + t + ".x, " + lightColReg + "\n"; + if (!this._pIsFirstLight) { + code += "add " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ".xyz, " + t + ".xyz\n"; + registerCache.removeFragmentTempUsage(t); + } + this._pIsFirstLight = false; + return code; + }; + /** + * @inheritDoc + */ + DiffuseWrapMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); + var index = methodVO.secondaryFragmentConstantsIndex; + var data = shaderObject.fragmentConstantData; + data[index] = this._wrapFactor; + data[index + 1] = 1 / (this._wrapFactor + 1); + }; + return DiffuseWrapMethod; +})(DiffuseBasicMethod); +module.exports = DiffuseWrapMethod; + + +},{"awayjs-stagegl/lib/materials/methods/DiffuseBasicMethod":undefined}],"awayjs-renderergl/lib/materials/methods/EffectAlphaMaskMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var EffectMethodBase = require("awayjs-stagegl/lib/materials/methods/EffectMethodBase"); +var ShaderCompilerHelper = require("awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper"); +/** + * EffectAlphaMaskMethod allows the use of an additional texture to specify the alpha value of the material. When used + * with the secondary uv set, it allows for a tiled main texture with independently varying alpha (useful for water + * etc). + */ +var EffectAlphaMaskMethod = (function (_super) { + __extends(EffectAlphaMaskMethod, _super); + /** + * Creates a new EffectAlphaMaskMethod object. + * + * @param texture The texture to use as the alpha mask. + * @param useSecondaryUV Indicated whether or not the secondary uv set for the mask. This allows mapping alpha independently. + */ + function EffectAlphaMaskMethod(texture, useSecondaryUV) { + if (useSecondaryUV === void 0) { useSecondaryUV = false; } + _super.call(this); + this._texture = texture; + this._useSecondaryUV = useSecondaryUV; + } + /** + * @inheritDoc + */ + EffectAlphaMaskMethod.prototype.iInitVO = function (shaderObject, methodVO) { + methodVO.needsSecondaryUV = this._useSecondaryUV; + methodVO.needsUV = !this._useSecondaryUV; + }; + Object.defineProperty(EffectAlphaMaskMethod.prototype, "useSecondaryUV", { + /** + * Indicated whether or not the secondary uv set for the mask. This allows mapping alpha independently, for + * instance to tile the main texture and normal map while providing untiled alpha, for example to define the + * transparency over a tiled water surface. + */ + get: function () { + return this._useSecondaryUV; + }, + set: function (value) { + if (this._useSecondaryUV == value) + return; + this._useSecondaryUV = value; + this.iInvalidateShaderProgram(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(EffectAlphaMaskMethod.prototype, "texture", { + /** + * The texture to use as the alpha mask. + */ + get: function () { + return this._texture; + }, + set: function (value) { + this._texture = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + EffectAlphaMaskMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + stage.context.activateTexture(methodVO.texturesIndex, this._texture); + }; + /** + * @inheritDoc + */ + EffectAlphaMaskMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { + var textureReg = registerCache.getFreeTextureReg(); + var temp = registerCache.getFreeFragmentVectorTemp(); + var uvReg = this._useSecondaryUV ? sharedRegisters.secondaryUVVarying : sharedRegisters.uvVarying; + methodVO.texturesIndex = textureReg.index; + return ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, textureReg, this._texture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, uvReg) + "mul " + targetReg + ", " + targetReg + ", " + temp + ".x\n"; + }; + return EffectAlphaMaskMethod; +})(EffectMethodBase); +module.exports = EffectAlphaMaskMethod; + + +},{"awayjs-stagegl/lib/materials/methods/EffectMethodBase":undefined,"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper":undefined}],"awayjs-renderergl/lib/materials/methods/EffectColorMatrixMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var EffectMethodBase = require("awayjs-stagegl/lib/materials/methods/EffectMethodBase"); +/** + * EffectColorMatrixMethod provides a shading method that changes the colour of a material analogous to a ColorMatrixFilter. + */ +var EffectColorMatrixMethod = (function (_super) { + __extends(EffectColorMatrixMethod, _super); + /** + * Creates a new EffectColorTransformMethod. + * + * @param matrix An array of 20 items for 4 x 5 color transform. + */ + function EffectColorMatrixMethod(matrix) { + _super.call(this); + if (matrix.length != 20) + throw new Error("Matrix length must be 20!"); + this._matrix = matrix; + } + Object.defineProperty(EffectColorMatrixMethod.prototype, "colorMatrix", { + /** + * The 4 x 5 matrix to transform the color of the material. + */ + get: function () { + return this._matrix; + }, + set: function (value) { + this._matrix = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + EffectColorMatrixMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { + var code = ""; + var colorMultReg = registerCache.getFreeFragmentConstant(); + registerCache.getFreeFragmentConstant(); + registerCache.getFreeFragmentConstant(); + registerCache.getFreeFragmentConstant(); + var colorOffsetReg = registerCache.getFreeFragmentConstant(); + methodVO.fragmentConstantsIndex = colorMultReg.index * 4; + var temp = registerCache.getFreeFragmentVectorTemp(); + code += "m44 " + temp + ", " + targetReg + ", " + colorMultReg + "\n" + "add " + targetReg + ", " + temp + ", " + colorOffsetReg + "\n"; + return code; + }; + /** + * @inheritDoc + */ + EffectColorMatrixMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + var matrix = this._matrix; + var index = methodVO.fragmentConstantsIndex; + var data = shaderObject.fragmentConstantData; + // r + data[index] = matrix[0]; + data[index + 1] = matrix[1]; + data[index + 2] = matrix[2]; + data[index + 3] = matrix[3]; + // g + data[index + 4] = matrix[5]; + data[index + 5] = matrix[6]; + data[index + 6] = matrix[7]; + data[index + 7] = matrix[8]; + // b + data[index + 8] = matrix[10]; + data[index + 9] = matrix[11]; + data[index + 10] = matrix[12]; + data[index + 11] = matrix[13]; + // a + data[index + 12] = matrix[15]; + data[index + 13] = matrix[16]; + data[index + 14] = matrix[17]; + data[index + 15] = matrix[18]; + // rgba offset + data[index + 16] = matrix[4]; + data[index + 17] = matrix[9]; + data[index + 18] = matrix[14]; + data[index + 19] = matrix[19]; + }; + return EffectColorMatrixMethod; +})(EffectMethodBase); +module.exports = EffectColorMatrixMethod; + + +},{"awayjs-stagegl/lib/materials/methods/EffectMethodBase":undefined}],"awayjs-renderergl/lib/materials/methods/EffectEnvMapMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var EffectMethodBase = require("awayjs-stagegl/lib/materials/methods/EffectMethodBase"); +var ShaderCompilerHelper = require("awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper"); +/** + * EffectEnvMapMethod provides a material method to perform reflection mapping using cube maps. + */ +var EffectEnvMapMethod = (function (_super) { + __extends(EffectEnvMapMethod, _super); + /** + * Creates an EffectEnvMapMethod object. + * @param envMap The environment map containing the reflected scene. + * @param alpha The reflectivity of the surface. + */ + function EffectEnvMapMethod(envMap, alpha) { + if (alpha === void 0) { alpha = 1; } + _super.call(this); + this._cubeTexture = envMap; + this._alpha = alpha; + } + Object.defineProperty(EffectEnvMapMethod.prototype, "mask", { + /** + * An optional texture to modulate the reflectivity of the surface. + */ + get: function () { + return this._mask; + }, + set: function (value) { + if (value != this._mask || (value && this._mask && (value.hasMipmaps != this._mask.hasMipmaps || value.format != this._mask.format))) + this.iInvalidateShaderProgram(); + this._mask = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + EffectEnvMapMethod.prototype.iInitVO = function (shaderObject, methodVO) { + methodVO.needsNormals = true; + methodVO.needsView = true; + methodVO.needsUV = this._mask != null; + }; + Object.defineProperty(EffectEnvMapMethod.prototype, "envMap", { + /** + * The cubic environment map containing the reflected scene. + */ + get: function () { + return this._cubeTexture; + }, + set: function (value) { + this._cubeTexture = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + EffectEnvMapMethod.prototype.dispose = function () { + }; + Object.defineProperty(EffectEnvMapMethod.prototype, "alpha", { + /** + * The reflectivity of the surface. + */ + get: function () { + return this._alpha; + }, + set: function (value) { + this._alpha = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + EffectEnvMapMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + shaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex] = this._alpha; + stage.context.activateCubeTexture(methodVO.texturesIndex, this._cubeTexture); + if (this._mask) + stage.context.activateTexture(methodVO.texturesIndex + 1, this._mask); + }; + /** + * @inheritDoc + */ + EffectEnvMapMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { + var dataRegister = registerCache.getFreeFragmentConstant(); + var temp = registerCache.getFreeFragmentVectorTemp(); + var code = ""; + var cubeMapReg = registerCache.getFreeTextureReg(); + methodVO.texturesIndex = cubeMapReg.index; + methodVO.fragmentConstantsIndex = dataRegister.index * 4; + registerCache.addFragmentTempUsages(temp, 1); + var temp2 = registerCache.getFreeFragmentVectorTemp(); + // r = I - 2(I.N)*N + code += "dp3 " + temp + ".w, " + sharedRegisters.viewDirFragment + ".xyz, " + sharedRegisters.normalFragment + ".xyz\n" + "add " + temp + ".w, " + temp + ".w, " + temp + ".w\n" + "mul " + temp + ".xyz, " + sharedRegisters.normalFragment + ".xyz, " + temp + ".w\n" + "sub " + temp + ".xyz, " + temp + ".xyz, " + sharedRegisters.viewDirFragment + ".xyz\n" + ShaderCompilerHelper.getTexCubeSampleCode(temp, cubeMapReg, this._cubeTexture, shaderObject.useSmoothTextures, shaderObject.useMipmapping, temp) + "sub " + temp2 + ".w, " + temp + ".w, fc0.x\n" + "kil " + temp2 + ".w\n" + "sub " + temp + ", " + temp + ", " + targetReg + "\n"; + if (this._mask) + code += ShaderCompilerHelper.getTex2DSampleCode(temp2, sharedRegisters, registerCache.getFreeTextureReg(), this._mask, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping) + "mul " + temp + ", " + temp2 + ", " + temp + "\n"; + code += "mul " + temp + ", " + temp + ", " + dataRegister + ".x\n" + "add " + targetReg + ", " + targetReg + ", " + temp + "\n"; + registerCache.removeFragmentTempUsage(temp); + return code; + }; + return EffectEnvMapMethod; +})(EffectMethodBase); +module.exports = EffectEnvMapMethod; + + +},{"awayjs-stagegl/lib/materials/methods/EffectMethodBase":undefined,"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper":undefined}],"awayjs-renderergl/lib/materials/methods/EffectFogMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var EffectMethodBase = require("awayjs-stagegl/lib/materials/methods/EffectMethodBase"); +/** + * EffectFogMethod provides a method to add distance-based fog to a material. + */ +var EffectFogMethod = (function (_super) { + __extends(EffectFogMethod, _super); + /** + * Creates a new EffectFogMethod object. + * @param minDistance The distance from which the fog starts appearing. + * @param maxDistance The distance at which the fog is densest. + * @param fogColor The colour of the fog. + */ + function EffectFogMethod(minDistance, maxDistance, fogColor) { + if (fogColor === void 0) { fogColor = 0x808080; } + _super.call(this); + this._minDistance = 0; + this._maxDistance = 1000; + this.minDistance = minDistance; + this.maxDistance = maxDistance; + this.fogColor = fogColor; + } + /** + * @inheritDoc + */ + EffectFogMethod.prototype.iInitVO = function (shaderObject, methodVO) { + methodVO.needsProjection = true; + }; + /** + * @inheritDoc + */ + EffectFogMethod.prototype.iInitConstants = function (shaderObject, methodVO) { + var data = shaderObject.fragmentConstantData; + var index = methodVO.fragmentConstantsIndex; + data[index + 3] = 1; + data[index + 6] = 0; + data[index + 7] = 0; + }; + Object.defineProperty(EffectFogMethod.prototype, "minDistance", { + /** + * The distance from which the fog starts appearing. + */ + get: function () { + return this._minDistance; + }, + set: function (value) { + this._minDistance = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(EffectFogMethod.prototype, "maxDistance", { + /** + * The distance at which the fog is densest. + */ + get: function () { + return this._maxDistance; + }, + set: function (value) { + this._maxDistance = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(EffectFogMethod.prototype, "fogColor", { + /** + * The colour of the fog. + */ + get: function () { + return this._fogColor; + }, + set: function (value /*uint*/) { + this._fogColor = value; + this._fogR = ((value >> 16) & 0xff) / 0xff; + this._fogG = ((value >> 8) & 0xff) / 0xff; + this._fogB = (value & 0xff) / 0xff; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + EffectFogMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + var data = shaderObject.fragmentConstantData; + var index = methodVO.fragmentConstantsIndex; + data[index] = this._fogR; + data[index + 1] = this._fogG; + data[index + 2] = this._fogB; + data[index + 4] = this._minDistance; + data[index + 5] = 1 / (this._maxDistance - this._minDistance); + }; + /** + * @inheritDoc + */ + EffectFogMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { + var fogColor = registerCache.getFreeFragmentConstant(); + var fogData = registerCache.getFreeFragmentConstant(); + var temp = registerCache.getFreeFragmentVectorTemp(); + registerCache.addFragmentTempUsages(temp, 1); + var temp2 = registerCache.getFreeFragmentVectorTemp(); + var code = ""; + methodVO.fragmentConstantsIndex = fogColor.index * 4; + code += "sub " + temp2 + ".w, " + sharedRegisters.projectionFragment + ".z, " + fogData + ".x\n" + "mul " + temp2 + ".w, " + temp2 + ".w, " + fogData + ".y\n" + "sat " + temp2 + ".w, " + temp2 + ".w\n" + "sub " + temp + ", " + fogColor + ", " + targetReg + "\n" + "mul " + temp + ", " + temp + ", " + temp2 + ".w\n" + "add " + targetReg + ", " + targetReg + ", " + temp + "\n"; // fogRatio*(fogColor- col) + col + registerCache.removeFragmentTempUsage(temp); + return code; + }; + return EffectFogMethod; +})(EffectMethodBase); +module.exports = EffectFogMethod; + + +},{"awayjs-stagegl/lib/materials/methods/EffectMethodBase":undefined}],"awayjs-renderergl/lib/materials/methods/EffectFresnelEnvMapMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var EffectMethodBase = require("awayjs-stagegl/lib/materials/methods/EffectMethodBase"); +var ShaderCompilerHelper = require("awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper"); +/** + * EffectFresnelEnvMapMethod provides a method to add fresnel-based reflectivity to an object using cube maps, which gets + * stronger as the viewing angle becomes more grazing. + */ +var EffectFresnelEnvMapMethod = (function (_super) { + __extends(EffectFresnelEnvMapMethod, _super); + /** + * Creates a new EffectFresnelEnvMapMethod object. + * + * @param envMap The environment map containing the reflected scene. + * @param alpha The reflectivity of the material. + */ + function EffectFresnelEnvMapMethod(envMap, alpha) { + if (alpha === void 0) { alpha = 1; } + _super.call(this); + this._fresnelPower = 5; + this._normalReflectance = 0; + this._cubeTexture = envMap; + this._alpha = alpha; + } + /** + * @inheritDoc + */ + EffectFresnelEnvMapMethod.prototype.iInitVO = function (shaderObject, methodVO) { + methodVO.needsNormals = true; + methodVO.needsView = true; + methodVO.needsUV = this._mask != null; + }; + /** + * @inheritDoc + */ + EffectFresnelEnvMapMethod.prototype.iInitConstants = function (shaderObject, methodVO) { + shaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex + 3] = 1; + }; + Object.defineProperty(EffectFresnelEnvMapMethod.prototype, "mask", { + /** + * An optional texture to modulate the reflectivity of the surface. + */ + get: function () { + return this._mask; + }, + set: function (value) { + if (Boolean(value) != Boolean(this._mask) || (value && this._mask && (value.hasMipmaps != this._mask.hasMipmaps || value.format != this._mask.format))) { + this.iInvalidateShaderProgram(); + } + this._mask = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(EffectFresnelEnvMapMethod.prototype, "fresnelPower", { + /** + * The power used in the Fresnel equation. Higher values make the fresnel effect more pronounced. Defaults to 5. + */ + get: function () { + return this._fresnelPower; + }, + set: function (value) { + this._fresnelPower = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(EffectFresnelEnvMapMethod.prototype, "envMap", { + /** + * The cubic environment map containing the reflected scene. + */ + get: function () { + return this._cubeTexture; + }, + set: function (value) { + this._cubeTexture = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(EffectFresnelEnvMapMethod.prototype, "alpha", { + /** + * The reflectivity of the surface. + */ + get: function () { + return this._alpha; + }, + set: function (value) { + this._alpha = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(EffectFresnelEnvMapMethod.prototype, "normalReflectance", { + /** + * The minimum amount of reflectance, ie the reflectance when the view direction is normal to the surface or light direction. + */ + get: function () { + return this._normalReflectance; + }, + set: function (value) { + this._normalReflectance = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + EffectFresnelEnvMapMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + var data = shaderObject.fragmentConstantData; + var index = methodVO.fragmentConstantsIndex; + data[index] = this._alpha; + data[index + 1] = this._normalReflectance; + data[index + 2] = this._fresnelPower; + stage.context.activateCubeTexture(methodVO.texturesIndex, this._cubeTexture); + if (this._mask) + stage.context.activateTexture(methodVO.texturesIndex + 1, this._mask); + }; + /** + * @inheritDoc + */ + EffectFresnelEnvMapMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { + var dataRegister = registerCache.getFreeFragmentConstant(); + var temp = registerCache.getFreeFragmentVectorTemp(); + var code = ""; + var cubeMapReg = registerCache.getFreeTextureReg(); + var viewDirReg = sharedRegisters.viewDirFragment; + var normalReg = sharedRegisters.normalFragment; + methodVO.texturesIndex = cubeMapReg.index; + methodVO.fragmentConstantsIndex = dataRegister.index * 4; + registerCache.addFragmentTempUsages(temp, 1); + var temp2 = registerCache.getFreeFragmentVectorTemp(); + // r = V - 2(V.N)*N + code += "dp3 " + temp + ".w, " + viewDirReg + ".xyz, " + normalReg + ".xyz\n" + "add " + temp + ".w, " + temp + ".w, " + temp + ".w\n" + "mul " + temp + ".xyz, " + normalReg + ".xyz, " + temp + ".w\n" + "sub " + temp + ".xyz, " + temp + ".xyz, " + viewDirReg + ".xyz\n" + ShaderCompilerHelper.getTexCubeSampleCode(temp, cubeMapReg, this._cubeTexture, shaderObject.useSmoothTextures, shaderObject.useMipmapping, temp) + "sub " + temp2 + ".w, " + temp + ".w, fc0.x\n" + "kil " + temp2 + ".w\n" + "sub " + temp + ", " + temp + ", " + targetReg + "\n"; + // calculate fresnel term + code += "dp3 " + viewDirReg + ".w, " + viewDirReg + ".xyz, " + normalReg + ".xyz\n" + "sub " + viewDirReg + ".w, " + dataRegister + ".w, " + viewDirReg + ".w\n" + "pow " + viewDirReg + ".w, " + viewDirReg + ".w, " + dataRegister + ".z\n" + "sub " + normalReg + ".w, " + dataRegister + ".w, " + viewDirReg + ".w\n" + "mul " + normalReg + ".w, " + dataRegister + ".y, " + normalReg + ".w\n" + "add " + viewDirReg + ".w, " + viewDirReg + ".w, " + normalReg + ".w\n" + "mul " + viewDirReg + ".w, " + dataRegister + ".x, " + viewDirReg + ".w\n"; + if (this._mask) { + var maskReg = registerCache.getFreeTextureReg(); + code += ShaderCompilerHelper.getTex2DSampleCode(temp2, sharedRegisters, maskReg, this._mask, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping) + "mul " + viewDirReg + ".w, " + temp2 + ".x, " + viewDirReg + ".w\n"; + } + // blend + code += "mul " + temp + ", " + temp + ", " + viewDirReg + ".w\n" + "add " + targetReg + ", " + targetReg + ", " + temp + "\n"; + registerCache.removeFragmentTempUsage(temp); + return code; + }; + return EffectFresnelEnvMapMethod; +})(EffectMethodBase); +module.exports = EffectFresnelEnvMapMethod; + + +},{"awayjs-stagegl/lib/materials/methods/EffectMethodBase":undefined,"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper":undefined}],"awayjs-renderergl/lib/materials/methods/EffectLightMapMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var EffectMethodBase = require("awayjs-stagegl/lib/materials/methods/EffectMethodBase"); +var ShaderCompilerHelper = require("awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper"); +/** + * EffectLightMapMethod provides a method that allows applying a light map texture to the calculated pixel colour. + * It is different from DiffuseLightMapMethod in that the latter only modulates the diffuse shading value rather + * than the whole pixel colour. + */ +var EffectLightMapMethod = (function (_super) { + __extends(EffectLightMapMethod, _super); + /** + * Creates a new EffectLightMapMethod object. + * + * @param texture The texture containing the light map. + * @param blendMode The blend mode with which the light map should be applied to the lighting result. + * @param useSecondaryUV Indicates whether the secondary UV set should be used to map the light map. + */ + function EffectLightMapMethod(texture, blendMode, useSecondaryUV) { + if (blendMode === void 0) { blendMode = "multiply"; } + if (useSecondaryUV === void 0) { useSecondaryUV = false; } + _super.call(this); + this._useSecondaryUV = useSecondaryUV; + this._texture = texture; + this.blendMode = blendMode; + } + /** + * @inheritDoc + */ + EffectLightMapMethod.prototype.iInitVO = function (shaderObject, methodVO) { + methodVO.needsUV = !this._useSecondaryUV; + methodVO.needsSecondaryUV = this._useSecondaryUV; + }; + Object.defineProperty(EffectLightMapMethod.prototype, "blendMode", { + /** + * The blend mode with which the light map should be applied to the lighting result. + * + * @see EffectLightMapMethod.ADD + * @see EffectLightMapMethod.MULTIPLY + */ + get: function () { + return this._blendMode; + }, + set: function (value) { + if (value != EffectLightMapMethod.ADD && value != EffectLightMapMethod.MULTIPLY) + throw new Error("Unknown blendmode!"); + if (this._blendMode == value) + return; + this._blendMode = value; + this.iInvalidateShaderProgram(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(EffectLightMapMethod.prototype, "texture", { + /** + * The texture containing the light map. + */ + get: function () { + return this._texture; + }, + set: function (value) { + if (value.hasMipmaps != this._texture.hasMipmaps || value.format != this._texture.format) + this.iInvalidateShaderProgram(); + this._texture = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + EffectLightMapMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + stage.context.activateTexture(methodVO.texturesIndex, this._texture); + _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); + }; + /** + * @inheritDoc + */ + EffectLightMapMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { + var code; + var lightMapReg = registerCache.getFreeTextureReg(); + var temp = registerCache.getFreeFragmentVectorTemp(); + methodVO.texturesIndex = lightMapReg.index; + code = ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, lightMapReg, this._texture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, this._useSecondaryUV ? sharedRegisters.secondaryUVVarying : sharedRegisters.uvVarying); + switch (this._blendMode) { + case EffectLightMapMethod.MULTIPLY: + code += "mul " + targetReg + ", " + targetReg + ", " + temp + "\n"; + break; + case EffectLightMapMethod.ADD: + code += "add " + targetReg + ", " + targetReg + ", " + temp + "\n"; + break; + } + return code; + }; + /** + * Indicates the light map should be multiplied with the calculated shading result. + */ + EffectLightMapMethod.MULTIPLY = "multiply"; + /** + * Indicates the light map should be added into the calculated shading result. + */ + EffectLightMapMethod.ADD = "add"; + return EffectLightMapMethod; +})(EffectMethodBase); +module.exports = EffectLightMapMethod; + + +},{"awayjs-stagegl/lib/materials/methods/EffectMethodBase":undefined,"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper":undefined}],"awayjs-renderergl/lib/materials/methods/EffectRefractionEnvMapMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var EffectMethodBase = require("awayjs-stagegl/lib/materials/methods/EffectMethodBase"); +var ShaderCompilerHelper = require("awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper"); +/** + * EffectRefractionEnvMapMethod provides a method to add refracted transparency based on cube maps. + */ +var EffectRefractionEnvMapMethod = (function (_super) { + __extends(EffectRefractionEnvMapMethod, _super); + /** + * Creates a new EffectRefractionEnvMapMethod object. Example values for dispersion are: dispersionR: -0.03, dispersionG: -0.01, dispersionB: = .0015 + * + * @param envMap The environment map containing the refracted scene. + * @param refractionIndex The refractive index of the material. + * @param dispersionR The amount of chromatic dispersion of the red channel. Defaults to 0 (none). + * @param dispersionG The amount of chromatic dispersion of the green channel. Defaults to 0 (none). + * @param dispersionB The amount of chromatic dispersion of the blue channel. Defaults to 0 (none). + */ + function EffectRefractionEnvMapMethod(envMap, refractionIndex, dispersionR, dispersionG, dispersionB) { + if (refractionIndex === void 0) { refractionIndex = .1; } + if (dispersionR === void 0) { dispersionR = 0; } + if (dispersionG === void 0) { dispersionG = 0; } + if (dispersionB === void 0) { dispersionB = 0; } + _super.call(this); + this._dispersionR = 0; + this._dispersionG = 0; + this._dispersionB = 0; + this._alpha = 1; + this._envMap = envMap; + this._dispersionR = dispersionR; + this._dispersionG = dispersionG; + this._dispersionB = dispersionB; + this._useDispersion = !(this._dispersionR == this._dispersionB && this._dispersionR == this._dispersionG); + this._refractionIndex = refractionIndex; + } + /** + * @inheritDoc + */ + EffectRefractionEnvMapMethod.prototype.iInitConstants = function (shaderObject, methodVO) { + var index = methodVO.fragmentConstantsIndex; + var data = shaderObject.fragmentConstantData; + data[index + 4] = 1; + data[index + 5] = 0; + data[index + 7] = 1; + }; + /** + * @inheritDoc + */ + EffectRefractionEnvMapMethod.prototype.iInitVO = function (shaderObject, methodVO) { + methodVO.needsNormals = true; + methodVO.needsView = true; + }; + Object.defineProperty(EffectRefractionEnvMapMethod.prototype, "envMap", { + /** + * The cube environment map to use for the refraction. + */ + get: function () { + return this._envMap; + }, + set: function (value) { + this._envMap = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(EffectRefractionEnvMapMethod.prototype, "refractionIndex", { + /** + * The refractive index of the material. + */ + get: function () { + return this._refractionIndex; + }, + set: function (value) { + this._refractionIndex = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(EffectRefractionEnvMapMethod.prototype, "dispersionR", { + /** + * The amount of chromatic dispersion of the red channel. Defaults to 0 (none). + */ + get: function () { + return this._dispersionR; + }, + set: function (value) { + this._dispersionR = value; + var useDispersion = !(this._dispersionR == this._dispersionB && this._dispersionR == this._dispersionG); + if (this._useDispersion != useDispersion) { + this.iInvalidateShaderProgram(); + this._useDispersion = useDispersion; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(EffectRefractionEnvMapMethod.prototype, "dispersionG", { + /** + * The amount of chromatic dispersion of the green channel. Defaults to 0 (none). + */ + get: function () { + return this._dispersionG; + }, + set: function (value) { + this._dispersionG = value; + var useDispersion = !(this._dispersionR == this._dispersionB && this._dispersionR == this._dispersionG); + if (this._useDispersion != useDispersion) { + this.iInvalidateShaderProgram(); + this._useDispersion = useDispersion; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(EffectRefractionEnvMapMethod.prototype, "dispersionB", { + /** + * The amount of chromatic dispersion of the blue channel. Defaults to 0 (none). + */ + get: function () { + return this._dispersionB; + }, + set: function (value) { + this._dispersionB = value; + var useDispersion = !(this._dispersionR == this._dispersionB && this._dispersionR == this._dispersionG); + if (this._useDispersion != useDispersion) { + this.iInvalidateShaderProgram(); + this._useDispersion = useDispersion; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(EffectRefractionEnvMapMethod.prototype, "alpha", { + /** + * The amount of transparency of the object. Warning: the alpha applies to the refracted color, not the actual + * material. A value of 1 will make it appear fully transparent. + */ + get: function () { + return this._alpha; + }, + set: function (value) { + this._alpha = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + EffectRefractionEnvMapMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + var index = methodVO.fragmentConstantsIndex; + var data = shaderObject.fragmentConstantData; + data[index] = this._dispersionR + this._refractionIndex; + if (this._useDispersion) { + data[index + 1] = this._dispersionG + this._refractionIndex; + data[index + 2] = this._dispersionB + this._refractionIndex; + } + data[index + 3] = this._alpha; + stage.context.activateCubeTexture(methodVO.texturesIndex, this._envMap); + }; + /** + * @inheritDoc + */ + EffectRefractionEnvMapMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { + // todo: data2.x could use common reg, so only 1 reg is used + var data = registerCache.getFreeFragmentConstant(); + var data2 = registerCache.getFreeFragmentConstant(); + var code = ""; + var cubeMapReg = registerCache.getFreeTextureReg(); + var refractionDir; + var refractionColor; + var temp; + methodVO.texturesIndex = cubeMapReg.index; + methodVO.fragmentConstantsIndex = data.index * 4; + refractionDir = registerCache.getFreeFragmentVectorTemp(); + registerCache.addFragmentTempUsages(refractionDir, 1); + refractionColor = registerCache.getFreeFragmentVectorTemp(); + registerCache.addFragmentTempUsages(refractionColor, 1); + temp = registerCache.getFreeFragmentVectorTemp(); + var viewDirReg = sharedRegisters.viewDirFragment; + var normalReg = sharedRegisters.normalFragment; + code += "neg " + viewDirReg + ".xyz, " + viewDirReg + ".xyz\n"; + code += "dp3 " + temp + ".x, " + viewDirReg + ".xyz, " + normalReg + ".xyz\n" + "mul " + temp + ".w, " + temp + ".x, " + temp + ".x\n" + "sub " + temp + ".w, " + data2 + ".x, " + temp + ".w\n" + "mul " + temp + ".w, " + data + ".x, " + temp + ".w\n" + "mul " + temp + ".w, " + data + ".x, " + temp + ".w\n" + "sub " + temp + ".w, " + data2 + ".x, " + temp + ".w\n" + "sqt " + temp + ".y, " + temp + ".w\n" + "mul " + temp + ".x, " + data + ".x, " + temp + ".x\n" + "add " + temp + ".x, " + temp + ".x, " + temp + ".y\n" + "mul " + temp + ".xyz, " + temp + ".x, " + normalReg + ".xyz\n" + "mul " + refractionDir + ", " + data + ".x, " + viewDirReg + "\n" + "sub " + refractionDir + ".xyz, " + refractionDir + ".xyz, " + temp + ".xyz\n" + "nrm " + refractionDir + ".xyz, " + refractionDir + ".xyz\n"; + code += ShaderCompilerHelper.getTexCubeSampleCode(refractionColor, cubeMapReg, this._envMap, shaderObject.useSmoothTextures, shaderObject.useMipmapping, refractionDir) + "sub " + refractionColor + ".w, " + refractionColor + ".w, fc0.x \n" + "kil " + refractionColor + ".w\n"; + if (this._useDispersion) { + // GREEN + code += "dp3 " + temp + ".x, " + viewDirReg + ".xyz, " + normalReg + ".xyz\n" + "mul " + temp + ".w, " + temp + ".x, " + temp + ".x\n" + "sub " + temp + ".w, " + data2 + ".x, " + temp + ".w\n" + "mul " + temp + ".w, " + data + ".y, " + temp + ".w\n" + "mul " + temp + ".w, " + data + ".y, " + temp + ".w\n" + "sub " + temp + ".w, " + data2 + ".x, " + temp + ".w\n" + "sqt " + temp + ".y, " + temp + ".w\n" + "mul " + temp + ".x, " + data + ".y, " + temp + ".x\n" + "add " + temp + ".x, " + temp + ".x, " + temp + ".y\n" + "mul " + temp + ".xyz, " + temp + ".x, " + normalReg + ".xyz\n" + "mul " + refractionDir + ", " + data + ".y, " + viewDirReg + "\n" + "sub " + refractionDir + ".xyz, " + refractionDir + ".xyz, " + temp + ".xyz\n" + "nrm " + refractionDir + ".xyz, " + refractionDir + ".xyz\n"; + code += ShaderCompilerHelper.getTexCubeSampleCode(temp, cubeMapReg, this._envMap, shaderObject.useSmoothTextures, shaderObject.useMipmapping, refractionDir) + "mov " + refractionColor + ".y, " + temp + ".y\n"; + // BLUE + code += "dp3 " + temp + ".x, " + viewDirReg + ".xyz, " + normalReg + ".xyz\n" + "mul " + temp + ".w, " + temp + ".x, " + temp + ".x\n" + "sub " + temp + ".w, " + data2 + ".x, " + temp + ".w\n" + "mul " + temp + ".w, " + data + ".z, " + temp + ".w\n" + "mul " + temp + ".w, " + data + ".z, " + temp + ".w\n" + "sub " + temp + ".w, " + data2 + ".x, " + temp + ".w\n" + "sqt " + temp + ".y, " + temp + ".w\n" + "mul " + temp + ".x, " + data + ".z, " + temp + ".x\n" + "add " + temp + ".x, " + temp + ".x, " + temp + ".y\n" + "mul " + temp + ".xyz, " + temp + ".x, " + normalReg + ".xyz\n" + "mul " + refractionDir + ", " + data + ".z, " + viewDirReg + "\n" + "sub " + refractionDir + ".xyz, " + refractionDir + ".xyz, " + temp + ".xyz\n" + "nrm " + refractionDir + ".xyz, " + refractionDir + ".xyz\n"; + code += ShaderCompilerHelper.getTexCubeSampleCode(temp, cubeMapReg, this._envMap, shaderObject.useSmoothTextures, shaderObject.useMipmapping, refractionDir) + "mov " + refractionColor + ".z, " + temp + ".z\n"; + } + registerCache.removeFragmentTempUsage(refractionDir); + code += "sub " + refractionColor + ".xyz, " + refractionColor + ".xyz, " + targetReg + ".xyz\n" + "mul " + refractionColor + ".xyz, " + refractionColor + ".xyz, " + data + ".w\n" + "add " + targetReg + ".xyz, " + targetReg + ".xyz, " + refractionColor + ".xyz\n"; + registerCache.removeFragmentTempUsage(refractionColor); + // restore + code += "neg " + viewDirReg + ".xyz, " + viewDirReg + ".xyz\n"; + return code; + }; + return EffectRefractionEnvMapMethod; +})(EffectMethodBase); +module.exports = EffectRefractionEnvMapMethod; + + +},{"awayjs-stagegl/lib/materials/methods/EffectMethodBase":undefined,"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper":undefined}],"awayjs-renderergl/lib/materials/methods/EffectRimLightMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var EffectMethodBase = require("awayjs-stagegl/lib/materials/methods/EffectMethodBase"); +/** + * EffectRimLightMethod provides a method to add rim lighting to a material. This adds a glow-like effect to edges of objects. + */ +var EffectRimLightMethod = (function (_super) { + __extends(EffectRimLightMethod, _super); + /** + * Creates a new EffectRimLightMethod object. + * + * @param color The colour of the rim light. + * @param strength The strength of the rim light. + * @param power The power of the rim light. Higher values will result in a higher edge fall-off. + * @param blend The blend mode with which to add the light to the object. + */ + function EffectRimLightMethod(color, strength, power, blend) { + if (color === void 0) { color = 0xffffff; } + if (strength === void 0) { strength = .4; } + if (power === void 0) { power = 2; } + if (blend === void 0) { blend = "mix"; } + _super.call(this); + this._blendMode = blend; + this._strength = strength; + this._power = power; + this.color = color; + } + /** + * @inheritDoc + */ + EffectRimLightMethod.prototype.iInitConstants = function (shaderObject, methodVO) { + shaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex + 3] = 1; + }; + /** + * @inheritDoc + */ + EffectRimLightMethod.prototype.iInitVO = function (shaderObject, methodVO) { + methodVO.needsNormals = true; + methodVO.needsView = true; + }; + Object.defineProperty(EffectRimLightMethod.prototype, "blendMode", { + /** + * The blend mode with which to add the light to the object. + * + * EffectRimLightMethod.MULTIPLY multiplies the rim light with the material's colour. + * EffectRimLightMethod.ADD adds the rim light with the material's colour. + * EffectRimLightMethod.MIX provides normal alpha blending. + */ + get: function () { + return this._blendMode; + }, + set: function (value) { + if (this._blendMode == value) + return; + this._blendMode = value; + this.iInvalidateShaderProgram(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(EffectRimLightMethod.prototype, "color", { + /** + * The color of the rim light. + */ + get: function () { + return this._color; + }, + set: function (value /*uint*/) { + this._color = value; + this._colorR = ((value >> 16) & 0xff) / 0xff; + this._colorG = ((value >> 8) & 0xff) / 0xff; + this._colorB = (value & 0xff) / 0xff; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(EffectRimLightMethod.prototype, "strength", { + /** + * The strength of the rim light. + */ + get: function () { + return this._strength; + }, + set: function (value) { + this._strength = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(EffectRimLightMethod.prototype, "power", { + /** + * The power of the rim light. Higher values will result in a higher edge fall-off. + */ + get: function () { + return this._power; + }, + set: function (value) { + this._power = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + EffectRimLightMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + var index = methodVO.fragmentConstantsIndex; + var data = shaderObject.fragmentConstantData; + data[index] = this._colorR; + data[index + 1] = this._colorG; + data[index + 2] = this._colorB; + data[index + 4] = this._strength; + data[index + 5] = this._power; + }; + /** + * @inheritDoc + */ + EffectRimLightMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { + var dataRegister = registerCache.getFreeFragmentConstant(); + var dataRegister2 = registerCache.getFreeFragmentConstant(); + var temp = registerCache.getFreeFragmentVectorTemp(); + var code = ""; + methodVO.fragmentConstantsIndex = dataRegister.index * 4; + code += "dp3 " + temp + ".x, " + sharedRegisters.viewDirFragment + ".xyz, " + sharedRegisters.normalFragment + ".xyz\n" + "sat " + temp + ".x, " + temp + ".x\n" + "sub " + temp + ".x, " + dataRegister + ".w, " + temp + ".x\n" + "pow " + temp + ".x, " + temp + ".x, " + dataRegister2 + ".y\n" + "mul " + temp + ".x, " + temp + ".x, " + dataRegister2 + ".x\n" + "sub " + temp + ".x, " + dataRegister + ".w, " + temp + ".x\n" + "mul " + targetReg + ".xyz, " + targetReg + ".xyz, " + temp + ".x\n" + "sub " + temp + ".w, " + dataRegister + ".w, " + temp + ".x\n"; + if (this._blendMode == EffectRimLightMethod.ADD) { + code += "mul " + temp + ".xyz, " + temp + ".w, " + dataRegister + ".xyz\n" + "add " + targetReg + ".xyz, " + targetReg + ".xyz, " + temp + ".xyz\n"; + } + else if (this._blendMode == EffectRimLightMethod.MULTIPLY) { + code += "mul " + temp + ".xyz, " + temp + ".w, " + dataRegister + ".xyz\n" + "mul " + targetReg + ".xyz, " + targetReg + ".xyz, " + temp + ".xyz\n"; + } + else { + code += "sub " + temp + ".xyz, " + dataRegister + ".xyz, " + targetReg + ".xyz\n" + "mul " + temp + ".xyz, " + temp + ".xyz, " + temp + ".w\n" + "add " + targetReg + ".xyz, " + targetReg + ".xyz, " + temp + ".xyz\n"; + } + return code; + }; + EffectRimLightMethod.ADD = "add"; + EffectRimLightMethod.MULTIPLY = "multiply"; + EffectRimLightMethod.MIX = "mix"; + return EffectRimLightMethod; +})(EffectMethodBase); +module.exports = EffectRimLightMethod; + + +},{"awayjs-stagegl/lib/materials/methods/EffectMethodBase":undefined}],"awayjs-renderergl/lib/materials/methods/NormalHeightMapMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var NormalBasicMethod = require("awayjs-stagegl/lib/materials/methods/NormalBasicMethod"); +var ShaderCompilerHelper = require("awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper"); +/** + * NormalHeightMapMethod provides a normal map method that uses a height map to calculate the normals. + */ +var NormalHeightMapMethod = (function (_super) { + __extends(NormalHeightMapMethod, _super); + /** + * Creates a new NormalHeightMapMethod method. + * + * @param heightMap The texture containing the height data. 0 means low, 1 means high. + * @param worldWidth The width of the 'world'. This is used to map uv coordinates' u component to scene dimensions. + * @param worldHeight The height of the 'world'. This is used to map the height map values to scene dimensions. + * @param worldDepth The depth of the 'world'. This is used to map uv coordinates' v component to scene dimensions. + */ + function NormalHeightMapMethod(heightMap, worldWidth, worldHeight, worldDepth) { + _super.call(this); + this.normalMap = heightMap; + this._worldXYRatio = worldWidth / worldHeight; + this._worldXZRatio = worldDepth / worldHeight; + } + /** + * @inheritDoc + */ + NormalHeightMapMethod.prototype.iInitConstants = function (shaderObject, methodVO) { + var index = methodVO.fragmentConstantsIndex; + var data = shaderObject.fragmentConstantData; + data[index] = 1 / this.normalMap.width; + data[index + 1] = 1 / this.normalMap.height; + data[index + 2] = 0; + data[index + 3] = 1; + data[index + 4] = this._worldXYRatio; + data[index + 5] = this._worldXZRatio; + }; + Object.defineProperty(NormalHeightMapMethod.prototype, "tangentSpace", { + /** + * @inheritDoc + */ + get: function () { + return false; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + NormalHeightMapMethod.prototype.copyFrom = function (method) { + _super.prototype.copyFrom.call(this, method); + this._worldXYRatio = method._worldXYRatio; + this._worldXZRatio = method._worldXZRatio; + }; + /** + * @inheritDoc + */ + NormalHeightMapMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { + var temp = registerCache.getFreeFragmentVectorTemp(); + var dataReg = registerCache.getFreeFragmentConstant(); + var dataReg2 = registerCache.getFreeFragmentConstant(); + this._pNormalTextureRegister = registerCache.getFreeTextureReg(); + methodVO.texturesIndex = this._pNormalTextureRegister.index; + methodVO.fragmentConstantsIndex = dataReg.index * 4; + return ShaderCompilerHelper.getTex2DSampleCode(targetReg, sharedRegisters, this._pNormalTextureRegister, this.normalMap, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, sharedRegisters.uvVarying, "clamp") + "add " + temp + ", " + sharedRegisters.uvVarying + ", " + dataReg + ".xzzz\n" + ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, this._pNormalTextureRegister, this.normalMap, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, temp, "clamp") + "sub " + targetReg + ".x, " + targetReg + ".x, " + temp + ".x\n" + "add " + temp + ", " + sharedRegisters.uvVarying + ", " + dataReg + ".zyzz\n" + ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, this._pNormalTextureRegister, this.normalMap, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, temp, "clamp") + "sub " + targetReg + ".z, " + targetReg + ".z, " + temp + ".x\n" + "mov " + targetReg + ".y, " + dataReg + ".w\n" + "mul " + targetReg + ".xz, " + targetReg + ".xz, " + dataReg2 + ".xy\n" + "nrm " + targetReg + ".xyz, " + targetReg + ".xyz\n"; + }; + return NormalHeightMapMethod; +})(NormalBasicMethod); +module.exports = NormalHeightMapMethod; + + +},{"awayjs-stagegl/lib/materials/methods/NormalBasicMethod":undefined,"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper":undefined}],"awayjs-renderergl/lib/materials/methods/NormalSimpleWaterMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var NormalBasicMethod = require("awayjs-stagegl/lib/materials/methods/NormalBasicMethod"); +var ShaderCompilerHelper = require("awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper"); +/** + * NormalSimpleWaterMethod provides a basic normal map method to create water ripples by translating two wave normal maps. + */ +var NormalSimpleWaterMethod = (function (_super) { + __extends(NormalSimpleWaterMethod, _super); + /** + * Creates a new NormalSimpleWaterMethod object. + * @param waveMap1 A normal map containing one layer of a wave structure. + * @param waveMap2 A normal map containing a second layer of a wave structure. + */ + function NormalSimpleWaterMethod(waveMap1, waveMap2) { + _super.call(this); + this._useSecondNormalMap = false; + this._water1OffsetX = 0; + this._water1OffsetY = 0; + this._water2OffsetX = 0; + this._water2OffsetY = 0; + this.normalMap = waveMap1; + this.secondaryNormalMap = waveMap2; + } + /** + * @inheritDoc + */ + NormalSimpleWaterMethod.prototype.iInitConstants = function (shaderObject, methodVO) { + var index = methodVO.fragmentConstantsIndex; + var data = shaderObject.fragmentConstantData; + data[index] = .5; + data[index + 1] = 0; + data[index + 2] = 0; + data[index + 3] = 1; + }; + /** + * @inheritDoc + */ + NormalSimpleWaterMethod.prototype.iInitVO = function (shaderObject, methodVO) { + _super.prototype.iInitVO.call(this, shaderObject, methodVO); + this._useSecondNormalMap = this.normalMap != this.secondaryNormalMap; + }; + Object.defineProperty(NormalSimpleWaterMethod.prototype, "water1OffsetX", { + /** + * The translation of the first wave layer along the X-axis. + */ + get: function () { + return this._water1OffsetX; + }, + set: function (value) { + this._water1OffsetX = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NormalSimpleWaterMethod.prototype, "water1OffsetY", { + /** + * The translation of the first wave layer along the Y-axis. + */ + get: function () { + return this._water1OffsetY; + }, + set: function (value) { + this._water1OffsetY = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NormalSimpleWaterMethod.prototype, "water2OffsetX", { + /** + * The translation of the second wave layer along the X-axis. + */ + get: function () { + return this._water2OffsetX; + }, + set: function (value) { + this._water2OffsetX = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NormalSimpleWaterMethod.prototype, "water2OffsetY", { + /** + * The translation of the second wave layer along the Y-axis. + */ + get: function () { + return this._water2OffsetY; + }, + set: function (value) { + this._water2OffsetY = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NormalSimpleWaterMethod.prototype, "secondaryNormalMap", { + /** + * A second normal map that will be combined with the first to create a wave-like animation pattern. + */ + get: function () { + return this._texture2; + }, + set: function (value) { + this._texture2 = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + NormalSimpleWaterMethod.prototype.iCleanCompilationData = function () { + _super.prototype.iCleanCompilationData.call(this); + this._normalTextureRegister2 = null; + }; + /** + * @inheritDoc + */ + NormalSimpleWaterMethod.prototype.dispose = function () { + _super.prototype.dispose.call(this); + this._texture2 = null; + }; + /** + * @inheritDoc + */ + NormalSimpleWaterMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); + var data = shaderObject.fragmentConstantData; + var index = methodVO.fragmentConstantsIndex; + data[index + 4] = this._water1OffsetX; + data[index + 5] = this._water1OffsetY; + data[index + 6] = this._water2OffsetX; + data[index + 7] = this._water2OffsetY; + //if (this._useSecondNormalMap >= 0) + if (this._useSecondNormalMap) + stage.context.activateTexture(methodVO.texturesIndex + 1, this._texture2); + }; + /** + * @inheritDoc + */ + NormalSimpleWaterMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { + var temp = registerCache.getFreeFragmentVectorTemp(); + var dataReg = registerCache.getFreeFragmentConstant(); + var dataReg2 = registerCache.getFreeFragmentConstant(); + this._pNormalTextureRegister = registerCache.getFreeTextureReg(); + this._normalTextureRegister2 = this._useSecondNormalMap ? registerCache.getFreeTextureReg() : this._pNormalTextureRegister; + methodVO.texturesIndex = this._pNormalTextureRegister.index; + methodVO.fragmentConstantsIndex = dataReg.index * 4; + return "add " + temp + ", " + sharedRegisters.uvVarying + ", " + dataReg2 + ".xyxy\n" + ShaderCompilerHelper.getTex2DSampleCode(targetReg, sharedRegisters, this._pNormalTextureRegister, this.normalMap, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, temp) + "add " + temp + ", " + sharedRegisters.uvVarying + ", " + dataReg2 + ".zwzw\n" + ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, this._normalTextureRegister2, this._texture2, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, temp) + "add " + targetReg + ", " + targetReg + ", " + temp + " \n" + "mul " + targetReg + ", " + targetReg + ", " + dataReg + ".x \n" + "sub " + targetReg + ".xyz, " + targetReg + ".xyz, " + sharedRegisters.commons + ".xxx \n" + "nrm " + targetReg + ".xyz, " + targetReg + ".xyz \n"; + }; + return NormalSimpleWaterMethod; +})(NormalBasicMethod); +module.exports = NormalSimpleWaterMethod; + + +},{"awayjs-stagegl/lib/materials/methods/NormalBasicMethod":undefined,"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper":undefined}],"awayjs-renderergl/lib/materials/methods/ShadowCascadeMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var DirectionalLight = require("awayjs-core/lib/entities/DirectionalLight"); +var Event = require("awayjs-core/lib/events/Event"); +var ShadingMethodEvent = require("awayjs-stagegl/lib/events/ShadingMethodEvent"); +var MethodVO = require("awayjs-stagegl/lib/materials/compilation/MethodVO"); +var ShadowMapMethodBase = require("awayjs-stagegl/lib/materials/methods/ShadowMapMethodBase"); +/** + * ShadowCascadeMethod is a shadow map method to apply cascade shadow mapping on materials. + * Must be used with a DirectionalLight with a CascadeShadowMapper assigned to its shadowMapper property. + * + * @see away.lights.CascadeShadowMapper + */ +var ShadowCascadeMethod = (function (_super) { + __extends(ShadowCascadeMethod, _super); + /** + * Creates a new ShadowCascadeMethod object. + * + * @param shadowMethodBase The shadow map sampling method used to sample individual cascades (fe: ShadowHardMethod, ShadowSoftMethod) + */ + function ShadowCascadeMethod(shadowMethodBase) { + var _this = this; + _super.call(this, shadowMethodBase.castingLight); + this._baseMethod = shadowMethodBase; + if (!(this._pCastingLight instanceof DirectionalLight)) + throw new Error("ShadowCascadeMethod is only compatible with DirectionalLight"); + this._cascadeShadowMapper = this._pCastingLight.shadowMapper; + if (!this._cascadeShadowMapper) + throw new Error("ShadowCascadeMethod requires a light that has a CascadeShadowMapper instance assigned to shadowMapper."); + this._cascadeShadowMapper.addEventListener(Event.CHANGE, function (event) { return _this.onCascadeChange(event); }); + this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, function (event) { return _this.onShaderInvalidated(event); }); + } + Object.defineProperty(ShadowCascadeMethod.prototype, "baseMethod", { + /** + * The shadow map sampling method used to sample individual cascades. These are typically those used in conjunction + * with a DirectionalShadowMapper. + * + * @see ShadowHardMethod + * @see ShadowSoftMethod + */ + get: function () { + return this._baseMethod; + }, + set: function (value) { + var _this = this; + if (this._baseMethod == value) + return; + this._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, function (event) { return _this.onShaderInvalidated(event); }); + this._baseMethod = value; + this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, function (event) { return _this.onShaderInvalidated(event); }); + this.iInvalidateShaderProgram(); + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + ShadowCascadeMethod.prototype.iInitVO = function (shaderObject, methodVO) { + var tempVO = new MethodVO(this._baseMethod); + this._baseMethod.iInitVO(shaderObject, tempVO); + methodVO.needsGlobalVertexPos = true; + methodVO.needsProjection = true; + }; + /** + * @inheritDoc + */ + ShadowCascadeMethod.prototype.iInitConstants = function (shaderObject, methodVO) { + var fragmentData = shaderObject.fragmentConstantData; + var vertexData = shaderObject.vertexConstantData; + var index = methodVO.fragmentConstantsIndex; + fragmentData[index] = 1.0; + fragmentData[index + 1] = 1 / 255.0; + fragmentData[index + 2] = 1 / 65025.0; + fragmentData[index + 3] = 1 / 16581375.0; + fragmentData[index + 6] = .5; + fragmentData[index + 7] = -.5; + index = methodVO.vertexConstantsIndex; + vertexData[index] = .5; + vertexData[index + 1] = -.5; + vertexData[index + 2] = 0; + }; + /** + * @inheritDoc + */ + ShadowCascadeMethod.prototype.iCleanCompilationData = function () { + _super.prototype.iCleanCompilationData.call(this); + this._cascadeProjections = null; + this._depthMapCoordVaryings = null; + }; + /** + * @inheritDoc + */ + ShadowCascadeMethod.prototype.iGetVertexCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { + var code = ""; + var dataReg = registerCache.getFreeVertexConstant(); + this.initProjectionsRegs(registerCache); + methodVO.vertexConstantsIndex = dataReg.index * 4; + var temp = registerCache.getFreeVertexVectorTemp(); + for (var i = 0; i < this._cascadeShadowMapper.numCascades; ++i) { + code += "m44 " + temp + ", " + sharedRegisters.globalPositionVertex + ", " + this._cascadeProjections[i] + "\n" + "add " + this._depthMapCoordVaryings[i] + ", " + temp + ", " + dataReg + ".zzwz\n"; + } + return code; + }; + /** + * Creates the registers for the cascades' projection coordinates. + */ + ShadowCascadeMethod.prototype.initProjectionsRegs = function (registerCache) { + this._cascadeProjections = new Array(this._cascadeShadowMapper.numCascades); + this._depthMapCoordVaryings = new Array(this._cascadeShadowMapper.numCascades); + for (var i = 0; i < this._cascadeShadowMapper.numCascades; ++i) { + this._depthMapCoordVaryings[i] = registerCache.getFreeVarying(); + this._cascadeProjections[i] = registerCache.getFreeVertexConstant(); + registerCache.getFreeVertexConstant(); + registerCache.getFreeVertexConstant(); + registerCache.getFreeVertexConstant(); + } + }; + /** + * @inheritDoc + */ + ShadowCascadeMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { + var numCascades = this._cascadeShadowMapper.numCascades; + var depthMapRegister = registerCache.getFreeTextureReg(); + var decReg = registerCache.getFreeFragmentConstant(); + var dataReg = registerCache.getFreeFragmentConstant(); + var planeDistanceReg = registerCache.getFreeFragmentConstant(); + var planeDistances = Array(planeDistanceReg + ".x", planeDistanceReg + ".y", planeDistanceReg + ".z", planeDistanceReg + ".w"); + var code; + methodVO.fragmentConstantsIndex = decReg.index * 4; + methodVO.texturesIndex = depthMapRegister.index; + var inQuad = registerCache.getFreeFragmentVectorTemp(); + registerCache.addFragmentTempUsages(inQuad, 1); + var uvCoord = registerCache.getFreeFragmentVectorTemp(); + registerCache.addFragmentTempUsages(uvCoord, 1); + // assume lowest partition is selected, will be overwritten later otherwise + code = "mov " + uvCoord + ", " + this._depthMapCoordVaryings[numCascades - 1] + "\n"; + for (var i = numCascades - 2; i >= 0; --i) { + var uvProjection = this._depthMapCoordVaryings[i]; + // calculate if in texturemap (result == 0 or 1, only 1 for a single partition) + code += "slt " + inQuad + ".z, " + sharedRegisters.projectionFragment + ".z, " + planeDistances[i] + "\n"; // z = x > minX, w = y > minY + var temp = registerCache.getFreeFragmentVectorTemp(); + // linearly interpolate between old and new uv coords using predicate value == conditional toggle to new value if predicate == 1 (true) + code += "sub " + temp + ", " + uvProjection + ", " + uvCoord + "\n" + "mul " + temp + ", " + temp + ", " + inQuad + ".z\n" + "add " + uvCoord + ", " + uvCoord + ", " + temp + "\n"; + } + registerCache.removeFragmentTempUsage(inQuad); + code += "div " + uvCoord + ", " + uvCoord + ", " + uvCoord + ".w\n" + "mul " + uvCoord + ".xy, " + uvCoord + ".xy, " + dataReg + ".zw\n" + "add " + uvCoord + ".xy, " + uvCoord + ".xy, " + dataReg + ".zz\n"; + code += this._baseMethod._iGetCascadeFragmentCode(shaderObject, methodVO, decReg, depthMapRegister, uvCoord, targetReg, registerCache, sharedRegisters) + "add " + targetReg + ".w, " + targetReg + ".w, " + dataReg + ".y\n"; + registerCache.removeFragmentTempUsage(uvCoord); + return code; + }; + /** + * @inheritDoc + */ + ShadowCascadeMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + stage.context.activateTexture(methodVO.texturesIndex, this._pCastingLight.shadowMapper.depthMap); + var vertexData = shaderObject.vertexConstantData; + var vertexIndex = methodVO.vertexConstantsIndex; + shaderObject.vertexConstantData[methodVO.vertexConstantsIndex + 3] = -1 / (this._cascadeShadowMapper.depth * this._pEpsilon); + var numCascades = this._cascadeShadowMapper.numCascades; + vertexIndex += 4; + for (var k = 0; k < numCascades; ++k) { + this._cascadeShadowMapper.getDepthProjections(k).copyRawDataTo(vertexData, vertexIndex, true); + vertexIndex += 16; + } + var fragmentData = shaderObject.fragmentConstantData; + var fragmentIndex = methodVO.fragmentConstantsIndex; + fragmentData[fragmentIndex + 5] = 1 - this._pAlpha; + var nearPlaneDistances = this._cascadeShadowMapper._iNearPlaneDistances; + fragmentIndex += 8; + for (var i = 0; i < numCascades; ++i) + fragmentData[fragmentIndex + i] = nearPlaneDistances[i]; + this._baseMethod.iActivateForCascade(shaderObject, methodVO, stage); + }; + /** + * @inheritDoc + */ + ShadowCascadeMethod.prototype.iSetRenderState = function (shaderObject, methodVO, renderable, stage, camera) { + }; + /** + * Called when the shadow mappers cascade configuration changes. + */ + ShadowCascadeMethod.prototype.onCascadeChange = function (event) { + this.iInvalidateShaderProgram(); + }; + /** + * Called when the base method's shader code is invalidated. + */ + ShadowCascadeMethod.prototype.onShaderInvalidated = function (event) { + this.iInvalidateShaderProgram(); + }; + return ShadowCascadeMethod; +})(ShadowMapMethodBase); +module.exports = ShadowCascadeMethod; + + +},{"awayjs-core/lib/entities/DirectionalLight":undefined,"awayjs-core/lib/events/Event":undefined,"awayjs-stagegl/lib/events/ShadingMethodEvent":undefined,"awayjs-stagegl/lib/materials/compilation/MethodVO":undefined,"awayjs-stagegl/lib/materials/methods/ShadowMapMethodBase":undefined}],"awayjs-renderergl/lib/materials/methods/ShadowDitheredMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var BitmapData = require("awayjs-core/lib/core/base/BitmapData"); +var BitmapTexture = require("awayjs-core/lib/textures/BitmapTexture"); +var ShadowMethodBase = require("awayjs-stagegl/lib/materials/methods/ShadowMethodBase"); +/** + * ShadowDitheredMethod provides a soft shadowing technique by randomly distributing sample points differently for each fragment. + */ +var ShadowDitheredMethod = (function (_super) { + __extends(ShadowDitheredMethod, _super); + /** + * Creates a new ShadowDitheredMethod object. + * @param castingLight The light casting the shadows + * @param numSamples The amount of samples to take for dithering. Minimum 1, maximum 24. + */ + function ShadowDitheredMethod(castingLight, numSamples, range) { + if (numSamples === void 0) { numSamples = 4; } + if (range === void 0) { range = 1; } + _super.call(this, castingLight); + this._depthMapSize = this._pCastingLight.shadowMapper.depthMapSize; + this.numSamples = numSamples; + this.range = range; + ++ShadowDitheredMethod._grainUsages; + if (!ShadowDitheredMethod._grainTexture) + this.initGrainTexture(); + } + Object.defineProperty(ShadowDitheredMethod.prototype, "numSamples", { + /** + * The amount of samples to take for dithering. Minimum 1, maximum 24. The actual maximum may depend on the + * complexity of the shader. + */ + get: function () { + return this._numSamples; + }, + set: function (value /*int*/) { + this._numSamples = value; + if (this._numSamples < 1) + this._numSamples = 1; + else if (this._numSamples > 24) + this._numSamples = 24; + this.iInvalidateShaderProgram(); + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + ShadowDitheredMethod.prototype.iInitVO = function (shaderObject, methodVO) { + _super.prototype.iInitVO.call(this, shaderObject, methodVO); + methodVO.needsProjection = true; + }; + /** + * @inheritDoc + */ + ShadowDitheredMethod.prototype.iInitConstants = function (shaderObject, methodVO) { + _super.prototype.iInitConstants.call(this, shaderObject, methodVO); + var fragmentData = shaderObject.fragmentConstantData; + var index = methodVO.fragmentConstantsIndex; + fragmentData[index + 8] = 1 / this._numSamples; + }; + Object.defineProperty(ShadowDitheredMethod.prototype, "range", { + /** + * The range in the shadow map in which to distribute the samples. + */ + get: function () { + return this._range * 2; + }, + set: function (value) { + this._range = value / 2; + }, + enumerable: true, + configurable: true + }); + /** + * Creates a texture containing the dithering noise texture. + */ + ShadowDitheredMethod.prototype.initGrainTexture = function () { + ShadowDitheredMethod._grainBitmapData = new BitmapData(64, 64, false); + var vec = new Array(); + var len = 4096; + var step = 1 / (this._depthMapSize * this._range); + var r, g; + for (var i = 0; i < len; ++i) { + r = 2 * (Math.random() - .5); + g = 2 * (Math.random() - .5); + if (r < 0) + r -= step; + else + r += step; + if (g < 0) + g -= step; + else + g += step; + if (r > 1) + r = 1; + else if (r < -1) + r = -1; + if (g > 1) + g = 1; + else if (g < -1) + g = -1; + vec[i] = (Math.floor((r * .5 + .5) * 0xff) << 16) | (Math.floor((g * .5 + .5) * 0xff) << 8); + } + ShadowDitheredMethod._grainBitmapData.setVector(ShadowDitheredMethod._grainBitmapData.rect, vec); + ShadowDitheredMethod._grainTexture = new BitmapTexture(ShadowDitheredMethod._grainBitmapData); + }; + /** + * @inheritDoc + */ + ShadowDitheredMethod.prototype.dispose = function () { + if (--ShadowDitheredMethod._grainUsages == 0) { + ShadowDitheredMethod._grainTexture.dispose(); + ShadowDitheredMethod._grainBitmapData.dispose(); + ShadowDitheredMethod._grainTexture = null; + } + }; + /** + * @inheritDoc + */ + ShadowDitheredMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); + var data = shaderObject.fragmentConstantData; + var index = methodVO.fragmentConstantsIndex; + data[index + 9] = (stage.width - 1) / 63; + data[index + 10] = (stage.height - 1) / 63; + data[index + 11] = 2 * this._range / this._depthMapSize; + stage.context.activateTexture(methodVO.texturesIndex + 1, ShadowDitheredMethod._grainTexture); + }; + /** + * @inheritDoc + */ + ShadowDitheredMethod.prototype._pGetPlanarFragmentCode = function (methodVO, targetReg, regCache, sharedRegisters) { + var depthMapRegister = regCache.getFreeTextureReg(); + var decReg = regCache.getFreeFragmentConstant(); + var dataReg = regCache.getFreeFragmentConstant(); + var customDataReg = regCache.getFreeFragmentConstant(); + methodVO.fragmentConstantsIndex = decReg.index * 4; + methodVO.texturesIndex = depthMapRegister.index; + return this.getSampleCode(customDataReg, depthMapRegister, decReg, targetReg, regCache, sharedRegisters); + }; + /** + * Get the actual shader code for shadow mapping + * @param regCache The register cache managing the registers. + * @param depthMapRegister The texture register containing the depth map. + * @param decReg The register containing the depth map decoding data. + * @param targetReg The target register to add the shadow coverage. + */ + ShadowDitheredMethod.prototype.getSampleCode = function (customDataReg, depthMapRegister, decReg, targetReg, regCache, sharedRegisters) { + var code = ""; + var grainRegister = regCache.getFreeTextureReg(); + var uvReg = regCache.getFreeFragmentVectorTemp(); + var numSamples = this._numSamples; + regCache.addFragmentTempUsages(uvReg, 1); + var temp = regCache.getFreeFragmentVectorTemp(); + var projectionReg = sharedRegisters.projectionFragment; + code += "div " + uvReg + ", " + projectionReg + ", " + projectionReg + ".w\n" + "mul " + uvReg + ".xy, " + uvReg + ".xy, " + customDataReg + ".yz\n"; + while (numSamples > 0) { + if (numSamples == this._numSamples) + code += "tex " + uvReg + ", " + uvReg + ", " + grainRegister + " <2d,nearest,repeat,mipnone>\n"; + else + code += "tex " + uvReg + ", " + uvReg + ".zwxy, " + grainRegister + " <2d,nearest,repeat,mipnone>\n"; + // keep grain in uvReg.zw + code += "sub " + uvReg + ".zw, " + uvReg + ".xy, fc0.xx\n" + "mul " + uvReg + ".zw, " + uvReg + ".zw, " + customDataReg + ".w\n"; // (tex unpack scale and tex scale in one) + if (numSamples == this._numSamples) { + // first sample + code += "add " + uvReg + ".xy, " + uvReg + ".zw, " + this._pDepthMapCoordReg + ".xy\n" + "tex " + temp + ", " + uvReg + ", " + depthMapRegister + " <2d,nearest,clamp,mipnone>\n" + "dp4 " + temp + ".z, " + temp + ", " + decReg + "\n" + "slt " + targetReg + ".w, " + this._pDepthMapCoordReg + ".z, " + temp + ".z\n"; // 0 if in shadow + } + else { + code += this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); + } + if (numSamples > 4) + code += "add " + uvReg + ".xy, " + uvReg + ".xy, " + uvReg + ".zw\n" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); + if (numSamples > 1) + code += "sub " + uvReg + ".xy, " + this._pDepthMapCoordReg + ".xy, " + uvReg + ".zw\n" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); + if (numSamples > 5) + code += "sub " + uvReg + ".xy, " + uvReg + ".xy, " + uvReg + ".zw\n" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); + if (numSamples > 2) { + code += "neg " + uvReg + ".w, " + uvReg + ".w\n"; // will be rotated 90 degrees when being accessed as wz + code += "add " + uvReg + ".xy, " + uvReg + ".wz, " + this._pDepthMapCoordReg + ".xy\n" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); + } + if (numSamples > 6) + code += "add " + uvReg + ".xy, " + uvReg + ".xy, " + uvReg + ".wz\n" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); + if (numSamples > 3) + code += "sub " + uvReg + ".xy, " + this._pDepthMapCoordReg + ".xy, " + uvReg + ".wz\n" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); + if (numSamples > 7) + code += "sub " + uvReg + ".xy, " + uvReg + ".xy, " + uvReg + ".wz\n" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); + numSamples -= 8; + } + regCache.removeFragmentTempUsage(uvReg); + code += "mul " + targetReg + ".w, " + targetReg + ".w, " + customDataReg + ".x\n"; // average + return code; + }; + /** + * Adds the code for another tap to the shader code. + * @param uvReg The uv register for the tap. + * @param depthMapRegister The texture register containing the depth map. + * @param decReg The register containing the depth map decoding data. + * @param targetReg The target register to add the tap comparison result. + * @param regCache The register cache managing the registers. + * @return + */ + ShadowDitheredMethod.prototype.addSample = function (uvReg, depthMapRegister, decReg, targetReg, regCache) { + var temp = regCache.getFreeFragmentVectorTemp(); + return "tex " + temp + ", " + uvReg + ", " + depthMapRegister + " <2d,nearest,clamp,mipnone>\n" + "dp4 " + temp + ".z, " + temp + ", " + decReg + "\n" + "slt " + temp + ".z, " + this._pDepthMapCoordReg + ".z, " + temp + ".z\n" + "add " + targetReg + ".w, " + targetReg + ".w, " + temp + ".z\n"; + }; + /** + * @inheritDoc + */ + ShadowDitheredMethod.prototype.iActivateForCascade = function (shaderObject, methodVO, stage) { + var data = shaderObject.fragmentConstantData; + var index = methodVO.secondaryFragmentConstantsIndex; + data[index] = 1 / this._numSamples; + data[index + 1] = (stage.width - 1) / 63; + data[index + 2] = (stage.height - 1) / 63; + data[index + 3] = 2 * this._range / this._depthMapSize; + stage.context.activateTexture(methodVO.texturesIndex + 1, ShadowDitheredMethod._grainTexture); + }; + /** + * @inheritDoc + */ + ShadowDitheredMethod.prototype._iGetCascadeFragmentCode = function (shaderObject, methodVO, decodeRegister, depthTexture, depthProjection, targetRegister, registerCache, sharedRegisters) { + this._pDepthMapCoordReg = depthProjection; + var dataReg = registerCache.getFreeFragmentConstant(); + methodVO.secondaryFragmentConstantsIndex = dataReg.index * 4; + return this.getSampleCode(dataReg, depthTexture, decodeRegister, targetRegister, registerCache, sharedRegisters); + }; + return ShadowDitheredMethod; +})(ShadowMethodBase); +module.exports = ShadowDitheredMethod; + + +},{"awayjs-core/lib/core/base/BitmapData":undefined,"awayjs-core/lib/textures/BitmapTexture":undefined,"awayjs-stagegl/lib/materials/methods/ShadowMethodBase":undefined}],"awayjs-renderergl/lib/materials/methods/ShadowFilteredMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ShadowMethodBase = require("awayjs-stagegl/lib/materials/methods/ShadowMethodBase"); +/** + * ShadowFilteredMethod provides a softened shadowing technique by bilinearly interpolating shadow comparison + * results of neighbouring pixels. + */ +var ShadowFilteredMethod = (function (_super) { + __extends(ShadowFilteredMethod, _super); + /** + * Creates a new DiffuseBasicMethod object. + * + * @param castingLight The light casting the shadow + */ + function ShadowFilteredMethod(castingLight) { + _super.call(this, castingLight); + } + /** + * @inheritDoc + */ + ShadowFilteredMethod.prototype.iInitConstants = function (shaderObject, methodVO) { + _super.prototype.iInitConstants.call(this, shaderObject, methodVO); + var fragmentData = shaderObject.fragmentConstantData; + var index = methodVO.fragmentConstantsIndex; + fragmentData[index + 8] = .5; + var size = this.castingLight.shadowMapper.depthMapSize; + fragmentData[index + 9] = size; + fragmentData[index + 10] = 1 / size; + }; + /** + * @inheritDoc + */ + ShadowFilteredMethod.prototype._pGetPlanarFragmentCode = function (methodVO, targetReg, regCache, sharedRegisters) { + var depthMapRegister = regCache.getFreeTextureReg(); + var decReg = regCache.getFreeFragmentConstant(); + var dataReg = regCache.getFreeFragmentConstant(); + // TODO: not used + dataReg = dataReg; + var customDataReg = regCache.getFreeFragmentConstant(); + var depthCol = regCache.getFreeFragmentVectorTemp(); + var uvReg; + var code = ""; + methodVO.fragmentConstantsIndex = decReg.index * 4; + regCache.addFragmentTempUsages(depthCol, 1); + uvReg = regCache.getFreeFragmentVectorTemp(); + regCache.addFragmentTempUsages(uvReg, 1); + code += "mov " + uvReg + ", " + this._pDepthMapCoordReg + "\n" + "tex " + depthCol + ", " + this._pDepthMapCoordReg + ", " + depthMapRegister + " <2d, nearest, clamp>\n" + "dp4 " + depthCol + ".z, " + depthCol + ", " + decReg + "\n" + "slt " + uvReg + ".z, " + this._pDepthMapCoordReg + ".z, " + depthCol + ".z\n" + "add " + uvReg + ".x, " + this._pDepthMapCoordReg + ".x, " + customDataReg + ".z\n" + "tex " + depthCol + ", " + uvReg + ", " + depthMapRegister + " <2d, nearest, clamp>\n" + "dp4 " + depthCol + ".z, " + depthCol + ", " + decReg + "\n" + "slt " + uvReg + ".w, " + this._pDepthMapCoordReg + ".z, " + depthCol + ".z\n" + "mul " + depthCol + ".x, " + this._pDepthMapCoordReg + ".x, " + customDataReg + ".y\n" + "frc " + depthCol + ".x, " + depthCol + ".x\n" + "sub " + uvReg + ".w, " + uvReg + ".w, " + uvReg + ".z\n" + "mul " + uvReg + ".w, " + uvReg + ".w, " + depthCol + ".x\n" + "add " + targetReg + ".w, " + uvReg + ".z, " + uvReg + ".w\n" + "mov " + uvReg + ".x, " + this._pDepthMapCoordReg + ".x\n" + "add " + uvReg + ".y, " + this._pDepthMapCoordReg + ".y, " + customDataReg + ".z\n" + "tex " + depthCol + ", " + uvReg + ", " + depthMapRegister + " <2d, nearest, clamp>\n" + "dp4 " + depthCol + ".z, " + depthCol + ", " + decReg + "\n" + "slt " + uvReg + ".z, " + this._pDepthMapCoordReg + ".z, " + depthCol + ".z\n" + "add " + uvReg + ".x, " + this._pDepthMapCoordReg + ".x, " + customDataReg + ".z\n" + "tex " + depthCol + ", " + uvReg + ", " + depthMapRegister + " <2d, nearest, clamp>\n" + "dp4 " + depthCol + ".z, " + depthCol + ", " + decReg + "\n" + "slt " + uvReg + ".w, " + this._pDepthMapCoordReg + ".z, " + depthCol + ".z\n" + "mul " + depthCol + ".x, " + this._pDepthMapCoordReg + ".x, " + customDataReg + ".y\n" + "frc " + depthCol + ".x, " + depthCol + ".x\n" + "sub " + uvReg + ".w, " + uvReg + ".w, " + uvReg + ".z\n" + "mul " + uvReg + ".w, " + uvReg + ".w, " + depthCol + ".x\n" + "add " + uvReg + ".w, " + uvReg + ".z, " + uvReg + ".w\n" + "mul " + depthCol + ".x, " + this._pDepthMapCoordReg + ".y, " + customDataReg + ".y\n" + "frc " + depthCol + ".x, " + depthCol + ".x\n" + "sub " + uvReg + ".w, " + uvReg + ".w, " + targetReg + ".w\n" + "mul " + uvReg + ".w, " + uvReg + ".w, " + depthCol + ".x\n" + "add " + targetReg + ".w, " + targetReg + ".w, " + uvReg + ".w\n"; + regCache.removeFragmentTempUsage(depthCol); + regCache.removeFragmentTempUsage(uvReg); + methodVO.texturesIndex = depthMapRegister.index; + return code; + }; + /** + * @inheritDoc + */ + ShadowFilteredMethod.prototype.iActivateForCascade = function (shaderObject, methodVO, stage) { + var size = this.castingLight.shadowMapper.depthMapSize; + var index = methodVO.secondaryFragmentConstantsIndex; + var data = shaderObject.fragmentConstantData; + data[index] = size; + data[index + 1] = 1 / size; + }; + /** + * @inheritDoc + */ + ShadowFilteredMethod.prototype._iGetCascadeFragmentCode = function (shaderObject, methodVO, decodeRegister, depthTexture, depthProjection, targetRegister, registerCache, sharedRegisters) { + var code; + var dataReg = registerCache.getFreeFragmentConstant(); + methodVO.secondaryFragmentConstantsIndex = dataReg.index * 4; + var temp = registerCache.getFreeFragmentVectorTemp(); + registerCache.addFragmentTempUsages(temp, 1); + var predicate = registerCache.getFreeFragmentVectorTemp(); + registerCache.addFragmentTempUsages(predicate, 1); + code = "tex " + temp + ", " + depthProjection + ", " + depthTexture + " <2d, nearest, clamp>\n" + "dp4 " + temp + ".z, " + temp + ", " + decodeRegister + "\n" + "slt " + predicate + ".x, " + depthProjection + ".z, " + temp + ".z\n" + "add " + depthProjection + ".x, " + depthProjection + ".x, " + dataReg + ".y\n" + "tex " + temp + ", " + depthProjection + ", " + depthTexture + " <2d, nearest, clamp>\n" + "dp4 " + temp + ".z, " + temp + ", " + decodeRegister + "\n" + "slt " + predicate + ".z, " + depthProjection + ".z, " + temp + ".z\n" + "add " + depthProjection + ".y, " + depthProjection + ".y, " + dataReg + ".y\n" + "tex " + temp + ", " + depthProjection + ", " + depthTexture + " <2d, nearest, clamp>\n" + "dp4 " + temp + ".z, " + temp + ", " + decodeRegister + "\n" + "slt " + predicate + ".w, " + depthProjection + ".z, " + temp + ".z\n" + "sub " + depthProjection + ".x, " + depthProjection + ".x, " + dataReg + ".y\n" + "tex " + temp + ", " + depthProjection + ", " + depthTexture + " <2d, nearest, clamp>\n" + "dp4 " + temp + ".z, " + temp + ", " + decodeRegister + "\n" + "slt " + predicate + ".y, " + depthProjection + ".z, " + temp + ".z\n" + "mul " + temp + ".xy, " + depthProjection + ".xy, " + dataReg + ".x\n" + "frc " + temp + ".xy, " + temp + ".xy\n" + "sub " + depthProjection + ", " + predicate + ".xyzw, " + predicate + ".zwxy\n" + "mul " + depthProjection + ", " + depthProjection + ", " + temp + ".x\n" + "add " + predicate + ".xy, " + predicate + ".xy, " + depthProjection + ".zw\n" + "sub " + predicate + ".y, " + predicate + ".y, " + predicate + ".x\n" + "mul " + predicate + ".y, " + predicate + ".y, " + temp + ".y\n" + "add " + targetRegister + ".w, " + predicate + ".x, " + predicate + ".y\n"; + registerCache.removeFragmentTempUsage(temp); + registerCache.removeFragmentTempUsage(predicate); + return code; + }; + return ShadowFilteredMethod; +})(ShadowMethodBase); +module.exports = ShadowFilteredMethod; + + +},{"awayjs-stagegl/lib/materials/methods/ShadowMethodBase":undefined}],"awayjs-renderergl/lib/materials/methods/ShadowNearMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ShadingMethodEvent = require("awayjs-stagegl/lib/events/ShadingMethodEvent"); +var ShadowMethodBase = require("awayjs-stagegl/lib/materials/methods/ShadowMethodBase"); +// TODO: shadow mappers references in materials should be an interface so that this class should NOT extend ShadowMapMethodBase just for some delegation work +/** + * ShadowNearMethod provides a shadow map method that restricts the shadowed area near the camera to optimize + * shadow map usage. This method needs to be used in conjunction with a NearDirectionalShadowMapper. + * + * @see away.lights.NearDirectionalShadowMapper + */ +var ShadowNearMethod = (function (_super) { + __extends(ShadowNearMethod, _super); + /** + * Creates a new ShadowNearMethod object. + * @param baseMethod The shadow map sampling method used to sample individual cascades (fe: ShadowHardMethod, ShadowSoftMethod) + * @param fadeRatio The amount of shadow fading to the outer shadow area. A value of 1 would mean the shadows start fading from the camera's near plane. + */ + function ShadowNearMethod(baseMethod, fadeRatio) { + var _this = this; + if (fadeRatio === void 0) { fadeRatio = .1; } + _super.call(this, baseMethod.castingLight); + this._onShaderInvalidatedDelegate = function (event) { return _this.onShaderInvalidated(event); }; + this._baseMethod = baseMethod; + this._fadeRatio = fadeRatio; + this._nearShadowMapper = this._pCastingLight.shadowMapper; + if (!this._nearShadowMapper) + throw new Error("ShadowNearMethod requires a light that has a NearDirectionalShadowMapper instance assigned to shadowMapper."); + this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); + } + Object.defineProperty(ShadowNearMethod.prototype, "baseMethod", { + /** + * The base shadow map method on which this method's shading is based. + */ + get: function () { + return this._baseMethod; + }, + set: function (value) { + if (this._baseMethod == value) + return; + this._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); + this._baseMethod = value; + this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); + this.iInvalidateShaderProgram(); + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + ShadowNearMethod.prototype.iInitConstants = function (shaderObject, methodVO) { + _super.prototype.iInitConstants.call(this, shaderObject, methodVO); + this._baseMethod.iInitConstants(shaderObject, methodVO); + var fragmentData = shaderObject.fragmentConstantData; + var index = methodVO.secondaryFragmentConstantsIndex; + fragmentData[index + 2] = 0; + fragmentData[index + 3] = 1; + }; + /** + * @inheritDoc + */ + ShadowNearMethod.prototype.iInitVO = function (shaderObject, methodVO) { + this._baseMethod.iInitVO(shaderObject, methodVO); + methodVO.needsProjection = true; + }; + /** + * @inheritDoc + */ + ShadowNearMethod.prototype.dispose = function () { + this._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); + }; + Object.defineProperty(ShadowNearMethod.prototype, "alpha", { + /** + * @inheritDoc + */ + get: function () { + return this._baseMethod.alpha; + }, + set: function (value) { + this._baseMethod.alpha = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ShadowNearMethod.prototype, "epsilon", { + /** + * @inheritDoc + */ + get: function () { + return this._baseMethod.epsilon; + }, + set: function (value) { + this._baseMethod.epsilon = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ShadowNearMethod.prototype, "fadeRatio", { + /** + * The amount of shadow fading to the outer shadow area. A value of 1 would mean the shadows start fading from the camera's near plane. + */ + get: function () { + return this._fadeRatio; + }, + set: function (value) { + this._fadeRatio = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + ShadowNearMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { + var code = this._baseMethod.iGetFragmentCode(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); + var dataReg = registerCache.getFreeFragmentConstant(); + var temp = registerCache.getFreeFragmentSingleTemp(); + methodVO.secondaryFragmentConstantsIndex = dataReg.index * 4; + code += "abs " + temp + ", " + sharedRegisters.projectionFragment + ".w\n" + "sub " + temp + ", " + temp + ", " + dataReg + ".x\n" + "mul " + temp + ", " + temp + ", " + dataReg + ".y\n" + "sat " + temp + ", " + temp + "\n" + "sub " + temp + ", " + dataReg + ".w," + temp + "\n" + "sub " + targetReg + ".w, " + dataReg + ".w," + targetReg + ".w\n" + "mul " + targetReg + ".w, " + targetReg + ".w, " + temp + "\n" + "sub " + targetReg + ".w, " + dataReg + ".w," + targetReg + ".w\n"; + return code; + }; + /** + * @inheritDoc + */ + ShadowNearMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + this._baseMethod.iActivate(shaderObject, methodVO, stage); + }; + /** + * @inheritDoc + */ + ShadowNearMethod.prototype.iDeactivate = function (shaderObject, methodVO, stage) { + this._baseMethod.iDeactivate(shaderObject, methodVO, stage); + }; + /** + * @inheritDoc + */ + ShadowNearMethod.prototype.iSetRenderState = function (shaderObject, methodVO, renderable, stage, camera) { + // todo: move this to activate (needs camera) + var near = camera.projection.near; + var d = camera.projection.far - near; + var maxDistance = this._nearShadowMapper.coverageRatio; + var minDistance = maxDistance * (1 - this._fadeRatio); + maxDistance = near + maxDistance * d; + minDistance = near + minDistance * d; + var fragmentData = shaderObject.fragmentConstantData; + var index = methodVO.secondaryFragmentConstantsIndex; + fragmentData[index] = minDistance; + fragmentData[index + 1] = 1 / (maxDistance - minDistance); + this._baseMethod.iSetRenderState(shaderObject, methodVO, renderable, stage, camera); + }; + /** + * @inheritDoc + */ + ShadowNearMethod.prototype.iGetVertexCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { + return this._baseMethod.iGetVertexCode(shaderObject, methodVO, registerCache, sharedRegisters); + }; + /** + * @inheritDoc + */ + ShadowNearMethod.prototype.iReset = function () { + this._baseMethod.iReset(); + }; + /** + * @inheritDoc + */ + ShadowNearMethod.prototype.iCleanCompilationData = function () { + _super.prototype.iCleanCompilationData.call(this); + this._baseMethod.iCleanCompilationData(); + }; + /** + * Called when the base method's shader code is invalidated. + */ + ShadowNearMethod.prototype.onShaderInvalidated = function (event) { + this.iInvalidateShaderProgram(); + }; + return ShadowNearMethod; +})(ShadowMethodBase); +module.exports = ShadowNearMethod; + + +},{"awayjs-stagegl/lib/events/ShadingMethodEvent":undefined,"awayjs-stagegl/lib/materials/methods/ShadowMethodBase":undefined}],"awayjs-renderergl/lib/materials/methods/ShadowSoftMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var PoissonLookup = require("awayjs-core/lib/core/geom/PoissonLookup"); +var ShadowMethodBase = require("awayjs-stagegl/lib/materials/methods/ShadowMethodBase"); +/** + * ShadowSoftMethod provides a soft shadowing technique by randomly distributing sample points. + */ +var ShadowSoftMethod = (function (_super) { + __extends(ShadowSoftMethod, _super); + /** + * Creates a new DiffuseBasicMethod object. + * + * @param castingLight The light casting the shadows + * @param numSamples The amount of samples to take for dithering. Minimum 1, maximum 32. + */ + function ShadowSoftMethod(castingLight, numSamples, range) { + if (numSamples === void 0) { numSamples = 5; } + if (range === void 0) { range = 1; } + _super.call(this, castingLight); + this._range = 1; + this.numSamples = numSamples; + this.range = range; + } + Object.defineProperty(ShadowSoftMethod.prototype, "numSamples", { + /** + * The amount of samples to take for dithering. Minimum 1, maximum 32. The actual maximum may depend on the + * complexity of the shader. + */ + get: function () { + return this._numSamples; + }, + set: function (value /*int*/) { + this._numSamples = value; + if (this._numSamples < 1) + this._numSamples = 1; + else if (this._numSamples > 32) + this._numSamples = 32; + this._offsets = PoissonLookup.getDistribution(this._numSamples); + this.iInvalidateShaderProgram(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ShadowSoftMethod.prototype, "range", { + /** + * The range in the shadow map in which to distribute the samples. + */ + get: function () { + return this._range; + }, + set: function (value) { + this._range = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + ShadowSoftMethod.prototype.iInitConstants = function (shaderObject, methodVO) { + _super.prototype.iInitConstants.call(this, shaderObject, methodVO); + shaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex + 8] = 1 / this._numSamples; + shaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex + 9] = 0; + }; + /** + * @inheritDoc + */ + ShadowSoftMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); + var texRange = .5 * this._range / this._pCastingLight.shadowMapper.depthMapSize; + var data = shaderObject.fragmentConstantData; + var index = methodVO.fragmentConstantsIndex + 10; + var len = this._numSamples << 1; + for (var i = 0; i < len; ++i) + data[index + i] = this._offsets[i] * texRange; + }; + /** + * @inheritDoc + */ + ShadowSoftMethod.prototype._pGetPlanarFragmentCode = function (methodVO, targetReg, regCache, sharedRegisters) { + // todo: move some things to super + var depthMapRegister = regCache.getFreeTextureReg(); + var decReg = regCache.getFreeFragmentConstant(); + var dataReg = regCache.getFreeFragmentConstant(); + var customDataReg = regCache.getFreeFragmentConstant(); + methodVO.fragmentConstantsIndex = decReg.index * 4; + methodVO.texturesIndex = depthMapRegister.index; + return this.getSampleCode(regCache, depthMapRegister, decReg, targetReg, customDataReg); + }; + /** + * Adds the code for another tap to the shader code. + * @param uv The uv register for the tap. + * @param texture The texture register containing the depth map. + * @param decode The register containing the depth map decoding data. + * @param target The target register to add the tap comparison result. + * @param regCache The register cache managing the registers. + * @return + */ + ShadowSoftMethod.prototype.addSample = function (uv, texture, decode, target, regCache) { + var temp = regCache.getFreeFragmentVectorTemp(); + return "tex " + temp + ", " + uv + ", " + texture + " <2d,nearest,clamp>\n" + "dp4 " + temp + ".z, " + temp + ", " + decode + "\n" + "slt " + uv + ".w, " + this._pDepthMapCoordReg + ".z, " + temp + ".z\n" + "add " + target + ".w, " + target + ".w, " + uv + ".w\n"; + }; + /** + * @inheritDoc + */ + ShadowSoftMethod.prototype.iActivateForCascade = function (shaderObject, methodVO, stage) { + _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); + var texRange = this._range / this._pCastingLight.shadowMapper.depthMapSize; + var data = shaderObject.fragmentConstantData; + var index = methodVO.secondaryFragmentConstantsIndex; + var len = this._numSamples << 1; + data[index] = 1 / this._numSamples; + data[index + 1] = 0; + index += 2; + for (var i = 0; i < len; ++i) + data[index + i] = this._offsets[i] * texRange; + if (len % 4 == 0) { + data[index + len] = 0; + data[index + len + 1] = 0; + } + }; + /** + * @inheritDoc + */ + ShadowSoftMethod.prototype._iGetCascadeFragmentCode = function (shaderObject, methodVO, decodeRegister, depthTexture, depthProjection, targetRegister, registerCache, sharedRegisters) { + this._pDepthMapCoordReg = depthProjection; + var dataReg = registerCache.getFreeFragmentConstant(); + methodVO.secondaryFragmentConstantsIndex = dataReg.index * 4; + return this.getSampleCode(registerCache, depthTexture, decodeRegister, targetRegister, dataReg); + }; + /** + * Get the actual shader code for shadow mapping + * @param regCache The register cache managing the registers. + * @param depthTexture The texture register containing the depth map. + * @param decodeRegister The register containing the depth map decoding data. + * @param targetReg The target register to add the shadow coverage. + * @param dataReg The register containing additional data. + */ + ShadowSoftMethod.prototype.getSampleCode = function (regCache, depthTexture, decodeRegister, targetRegister, dataReg) { + var uvReg; + var code; + var offsets = new Array(dataReg + ".zw"); + uvReg = regCache.getFreeFragmentVectorTemp(); + regCache.addFragmentTempUsages(uvReg, 1); + var temp = regCache.getFreeFragmentVectorTemp(); + var numRegs = this._numSamples >> 1; + for (var i = 0; i < numRegs; ++i) { + var reg = regCache.getFreeFragmentConstant(); + offsets.push(reg + ".xy"); + offsets.push(reg + ".zw"); + } + for (i = 0; i < this._numSamples; ++i) { + if (i == 0) { + code = "add " + uvReg + ", " + this._pDepthMapCoordReg + ", " + dataReg + ".zwyy\n" + "tex " + temp + ", " + uvReg + ", " + depthTexture + " <2d,nearest,clamp>\n" + "dp4 " + temp + ".z, " + temp + ", " + decodeRegister + "\n" + "slt " + targetRegister + ".w, " + this._pDepthMapCoordReg + ".z, " + temp + ".z\n"; // 0 if in shadow; + } + else { + code += "add " + uvReg + ".xy, " + this._pDepthMapCoordReg + ".xy, " + offsets[i] + "\n" + this.addSample(uvReg, depthTexture, decodeRegister, targetRegister, regCache); + } + } + regCache.removeFragmentTempUsage(uvReg); + code += "mul " + targetRegister + ".w, " + targetRegister + ".w, " + dataReg + ".x\n"; // average + return code; + }; + return ShadowSoftMethod; +})(ShadowMethodBase); +module.exports = ShadowSoftMethod; + + +},{"awayjs-core/lib/core/geom/PoissonLookup":undefined,"awayjs-stagegl/lib/materials/methods/ShadowMethodBase":undefined}],"awayjs-renderergl/lib/materials/methods/SpecularAnisotropicMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var SpecularBasicMethod = require("awayjs-stagegl/lib/materials/methods/SpecularBasicMethod"); +/** + * SpecularAnisotropicMethod provides a specular method resulting in anisotropic highlights. These are typical for + * surfaces with microfacet details such as tiny grooves. In particular, this uses the Heidrich-Seidel distrubution. + * The tangent vectors are used as the surface groove directions. + */ +var SpecularAnisotropicMethod = (function (_super) { + __extends(SpecularAnisotropicMethod, _super); + /** + * Creates a new SpecularAnisotropicMethod object. + */ + function SpecularAnisotropicMethod() { + _super.call(this); + } + /** + * @inheritDoc + */ + SpecularAnisotropicMethod.prototype.iInitVO = function (shaderObject, methodVO) { + methodVO.needsTangents = true; + methodVO.needsView = true; + }; + /** + * @inheritDoc + */ + SpecularAnisotropicMethod.prototype.iGetFragmentCodePerLight = function (shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters) { + var code = ""; + var t; + if (this._pIsFirstLight) + t = this._pTotalLightColorReg; + else { + t = registerCache.getFreeFragmentVectorTemp(); + registerCache.addFragmentTempUsages(t, 1); + } + // (sin(l,t) * sin(v,t) - cos(l,t)*cos(v,t)) ^ k + code += "nrm " + t + ".xyz, " + sharedRegisters.tangentVarying + ".xyz\n" + "dp3 " + t + ".w, " + t + ".xyz, " + lightDirReg + ".xyz\n" + "dp3 " + t + ".z, " + t + ".xyz, " + sharedRegisters.viewDirFragment + ".xyz\n"; + // (sin(t.w) * sin(t.z) - cos(t.w)*cos(t.z)) ^ k + code += "sin " + t + ".x, " + t + ".w\n" + "sin " + t + ".y, " + t + ".z\n" + "mul " + t + ".x, " + t + ".x, " + t + ".y\n" + "cos " + t + ".z, " + t + ".z\n" + "cos " + t + ".w, " + t + ".w\n" + "mul " + t + ".w, " + t + ".w, " + t + ".z\n" + "sub " + t + ".w, " + t + ".x, " + t + ".w\n"; + if (this._pUseTexture) { + // apply gloss modulation from texture + code += "mul " + this._pSpecularTexData + ".w, " + this._pSpecularTexData + ".y, " + this._pSpecularDataRegister + ".w\n" + "pow " + t + ".w, " + t + ".w, " + this._pSpecularTexData + ".w\n"; + } + else + code += "pow " + t + ".w, " + t + ".w, " + this._pSpecularDataRegister + ".w\n"; + // attenuate + code += "mul " + t + ".w, " + t + ".w, " + lightDirReg + ".w\n"; + if (this._iModulateMethod != null) + code += this._iModulateMethod(shaderObject, methodVO, t, registerCache, sharedRegisters); + code += "mul " + t + ".xyz, " + lightColReg + ".xyz, " + t + ".w\n"; + if (!this._pIsFirstLight) { + code += "add " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ".xyz, " + t + ".xyz\n"; + registerCache.removeFragmentTempUsage(t); + } + this._pIsFirstLight = false; + return code; + }; + return SpecularAnisotropicMethod; +})(SpecularBasicMethod); +module.exports = SpecularAnisotropicMethod; + + +},{"awayjs-stagegl/lib/materials/methods/SpecularBasicMethod":undefined}],"awayjs-renderergl/lib/materials/methods/SpecularCelMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var SpecularCompositeMethod = require("awayjs-renderergl/lib/materials/methods/SpecularCompositeMethod"); +/** + * SpecularCelMethod provides a shading method to add specular cel (cartoon) shading. + */ +var SpecularCelMethod = (function (_super) { + __extends(SpecularCelMethod, _super); + /** + * Creates a new SpecularCelMethod object. + * @param specularCutOff The threshold at which the specular highlight should be shown. + * @param baseMethod An optional specular method on which the cartoon shading is based. If ommitted, SpecularBasicMethod is used. + */ + function SpecularCelMethod(specularCutOff, baseMethod) { + var _this = this; + if (specularCutOff === void 0) { specularCutOff = .5; } + if (baseMethod === void 0) { baseMethod = null; } + _super.call(this, null, baseMethod); + this._smoothness = .1; + this._specularCutOff = .1; + this.baseMethod._iModulateMethod = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { return _this.clampSpecular(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); }; + this._specularCutOff = specularCutOff; + } + Object.defineProperty(SpecularCelMethod.prototype, "smoothness", { + /** + * The smoothness of the highlight edge. + */ + get: function () { + return this._smoothness; + }, + set: function (value) { + this._smoothness = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SpecularCelMethod.prototype, "specularCutOff", { + /** + * The threshold at which the specular highlight should be shown. + */ + get: function () { + return this._specularCutOff; + }, + set: function (value) { + this._specularCutOff = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + SpecularCelMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); + var index = methodVO.secondaryFragmentConstantsIndex; + var data = shaderObject.fragmentConstantData; + data[index] = this._smoothness; + data[index + 1] = this._specularCutOff; + }; + /** + * @inheritDoc + */ + SpecularCelMethod.prototype.iCleanCompilationData = function () { + _super.prototype.iCleanCompilationData.call(this); + this._dataReg = null; + }; + /** + * Snaps the specular shading strength of the wrapped method to zero or one, depending on whether or not it exceeds the specularCutOff + * @param vo The MethodVO used to compile the current shader. + * @param t The register containing the specular strength in the "w" component, and either the half-vector or the reflection vector in "xyz". + * @param regCache The register cache used for the shader compilation. + * @param sharedRegisters The shared register data for this shader. + * @return The AGAL fragment code for the method. + */ + SpecularCelMethod.prototype.clampSpecular = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { + return "sub " + targetReg + ".y, " + targetReg + ".w, " + this._dataReg + ".y\n" + "div " + targetReg + ".y, " + targetReg + ".y, " + this._dataReg + ".x\n" + "sat " + targetReg + ".y, " + targetReg + ".y\n" + "sge " + targetReg + ".w, " + targetReg + ".w, " + this._dataReg + ".y\n" + "mul " + targetReg + ".w, " + targetReg + ".w, " + targetReg + ".y\n"; + }; + /** + * @inheritDoc + */ + SpecularCelMethod.prototype.iGetFragmentPreLightingCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { + this._dataReg = registerCache.getFreeFragmentConstant(); + methodVO.secondaryFragmentConstantsIndex = this._dataReg.index * 4; + return _super.prototype.iGetFragmentPreLightingCode.call(this, shaderObject, methodVO, registerCache, sharedRegisters); + }; + return SpecularCelMethod; +})(SpecularCompositeMethod); +module.exports = SpecularCelMethod; + + +},{"awayjs-renderergl/lib/materials/methods/SpecularCompositeMethod":undefined}],"awayjs-renderergl/lib/materials/methods/SpecularCompositeMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ShadingMethodEvent = require("awayjs-stagegl/lib/events/ShadingMethodEvent"); +var SpecularBasicMethod = require("awayjs-stagegl/lib/materials/methods/SpecularBasicMethod"); +/** + * SpecularCompositeMethod provides a base class for specular methods that wrap a specular method to alter the + * calculated specular reflection strength. + */ +var SpecularCompositeMethod = (function (_super) { + __extends(SpecularCompositeMethod, _super); + /** + * Creates a new SpecularCompositeMethod object. + * + * @param modulateMethod The method which will add the code to alter the base method's strength. It needs to have the signature modSpecular(t:ShaderRegisterElement, regCache:ShaderRegisterCache):string, in which t.w will contain the specular strength and t.xyz will contain the half-vector or the reflection vector. + * @param baseMethod The base specular method on which this method's shading is based. + */ + function SpecularCompositeMethod(modulateMethod, baseMethod) { + var _this = this; + if (baseMethod === void 0) { baseMethod = null; } + _super.call(this); + this._onShaderInvalidatedDelegate = function (event) { return _this.onShaderInvalidated(event); }; + this._baseMethod = baseMethod || new SpecularBasicMethod(); + this._baseMethod._iModulateMethod = modulateMethod; + this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); + } + /** + * @inheritDoc + */ + SpecularCompositeMethod.prototype.iInitVO = function (shaderObject, methodVO) { + this._baseMethod.iInitVO(shaderObject, methodVO); + }; + /** + * @inheritDoc + */ + SpecularCompositeMethod.prototype.iInitConstants = function (shaderObject, methodVO) { + this._baseMethod.iInitConstants(shaderObject, methodVO); + }; + Object.defineProperty(SpecularCompositeMethod.prototype, "baseMethod", { + /** + * The base specular method on which this method's shading is based. + */ + get: function () { + return this._baseMethod; + }, + set: function (value) { + if (this._baseMethod == value) + return; + this._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); + this._baseMethod = value; + this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); + this.iInvalidateShaderProgram(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SpecularCompositeMethod.prototype, "gloss", { + /** + * @inheritDoc + */ + get: function () { + return this._baseMethod.gloss; + }, + set: function (value) { + this._baseMethod.gloss = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SpecularCompositeMethod.prototype, "specular", { + /** + * @inheritDoc + */ + get: function () { + return this._baseMethod.specular; + }, + set: function (value) { + this._baseMethod.specular = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SpecularCompositeMethod.prototype, "passes", { + /** + * @inheritDoc + */ + get: function () { + return this._baseMethod.passes; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + SpecularCompositeMethod.prototype.dispose = function () { + this._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); + this._baseMethod.dispose(); + }; + Object.defineProperty(SpecularCompositeMethod.prototype, "texture", { + /** + * @inheritDoc + */ + get: function () { + return this._baseMethod.texture; + }, + set: function (value) { + this._baseMethod.texture = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + SpecularCompositeMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + this._baseMethod.iActivate(shaderObject, methodVO, stage); + }; + /** + * @inheritDoc + */ + SpecularCompositeMethod.prototype.iSetRenderState = function (shaderObject, methodVO, renderable, stage, camera) { + this._baseMethod.iSetRenderState(shaderObject, methodVO, renderable, stage, camera); + }; + /** + * @inheritDoc + */ + SpecularCompositeMethod.prototype.iDeactivate = function (shaderObject, methodVO, stage) { + this._baseMethod.iDeactivate(shaderObject, methodVO, stage); + }; + /** + * @inheritDoc + */ + SpecularCompositeMethod.prototype.iGetVertexCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { + return this._baseMethod.iGetVertexCode(shaderObject, methodVO, registerCache, sharedRegisters); + }; + /** + * @inheritDoc + */ + SpecularCompositeMethod.prototype.iGetFragmentPreLightingCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { + return this._baseMethod.iGetFragmentPreLightingCode(shaderObject, methodVO, registerCache, sharedRegisters); + }; + /** + * @inheritDoc + */ + SpecularCompositeMethod.prototype.iGetFragmentCodePerLight = function (shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters) { + return this._baseMethod.iGetFragmentCodePerLight(shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters); + }; + /** + * @inheritDoc + * @return + */ + SpecularCompositeMethod.prototype.iGetFragmentCodePerProbe = function (shaderObject, methodVO, cubeMapReg, weightRegister, registerCache, sharedRegisters) { + return this._baseMethod.iGetFragmentCodePerProbe(shaderObject, methodVO, cubeMapReg, weightRegister, registerCache, sharedRegisters); + }; + /** + * @inheritDoc + */ + SpecularCompositeMethod.prototype.iGetFragmentPostLightingCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { + return this._baseMethod.iGetFragmentPostLightingCode(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); + }; + /** + * @inheritDoc + */ + SpecularCompositeMethod.prototype.iReset = function () { + this._baseMethod.iReset(); + }; + /** + * @inheritDoc + */ + SpecularCompositeMethod.prototype.iCleanCompilationData = function () { + _super.prototype.iCleanCompilationData.call(this); + this._baseMethod.iCleanCompilationData(); + }; + /** + * Called when the base method's shader code is invalidated. + */ + SpecularCompositeMethod.prototype.onShaderInvalidated = function (event) { + this.iInvalidateShaderProgram(); + }; + return SpecularCompositeMethod; +})(SpecularBasicMethod); +module.exports = SpecularCompositeMethod; + + +},{"awayjs-stagegl/lib/events/ShadingMethodEvent":undefined,"awayjs-stagegl/lib/materials/methods/SpecularBasicMethod":undefined}],"awayjs-renderergl/lib/materials/methods/SpecularFresnelMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var SpecularCompositeMethod = require("awayjs-renderergl/lib/materials/methods/SpecularCompositeMethod"); +/** + * SpecularFresnelMethod provides a specular shading method that causes stronger highlights on grazing view angles. + */ +var SpecularFresnelMethod = (function (_super) { + __extends(SpecularFresnelMethod, _super); + /** + * Creates a new SpecularFresnelMethod object. + * @param basedOnSurface Defines whether the fresnel effect should be based on the view angle on the surface (if true), or on the angle between the light and the view. + * @param baseMethod The specular method to which the fresnel equation. Defaults to SpecularBasicMethod. + */ + function SpecularFresnelMethod(basedOnSurface, baseMethod) { + var _this = this; + if (basedOnSurface === void 0) { basedOnSurface = true; } + if (baseMethod === void 0) { baseMethod = null; } + // may want to offer diff speculars + _super.call(this, null, baseMethod); + this._fresnelPower = 5; + this._normalReflectance = .028; // default value for skin + this.baseMethod._iModulateMethod = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { return _this.modulateSpecular(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); }; + this._incidentLight = !basedOnSurface; + } + /** + * @inheritDoc + */ + SpecularFresnelMethod.prototype.iInitConstants = function (shaderObject, methodVO) { + var index = methodVO.secondaryFragmentConstantsIndex; + shaderObject.fragmentConstantData[index + 2] = 1; + shaderObject.fragmentConstantData[index + 3] = 0; + }; + Object.defineProperty(SpecularFresnelMethod.prototype, "basedOnSurface", { + /** + * Defines whether the fresnel effect should be based on the view angle on the surface (if true), or on the angle between the light and the view. + */ + get: function () { + return !this._incidentLight; + }, + set: function (value) { + if (this._incidentLight != value) + return; + this._incidentLight = !value; + this.iInvalidateShaderProgram(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SpecularFresnelMethod.prototype, "fresnelPower", { + /** + * The power used in the Fresnel equation. Higher values make the fresnel effect more pronounced. Defaults to 5. + */ + get: function () { + return this._fresnelPower; + }, + set: function (value) { + this._fresnelPower = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + SpecularFresnelMethod.prototype.iCleanCompilationData = function () { + _super.prototype.iCleanCompilationData.call(this); + this._dataReg = null; + }; + Object.defineProperty(SpecularFresnelMethod.prototype, "normalReflectance", { + /** + * The minimum amount of reflectance, ie the reflectance when the view direction is normal to the surface or light direction. + */ + get: function () { + return this._normalReflectance; + }, + set: function (value) { + this._normalReflectance = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + SpecularFresnelMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { + _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); + var fragmentData = shaderObject.fragmentConstantData; + var index = methodVO.secondaryFragmentConstantsIndex; + fragmentData[index] = this._normalReflectance; + fragmentData[index + 1] = this._fresnelPower; + }; + /** + * @inheritDoc + */ + SpecularFresnelMethod.prototype.iGetFragmentPreLightingCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { + this._dataReg = registerCache.getFreeFragmentConstant(); + console.log('SpecularFresnelMethod', 'iGetFragmentPreLightingCode', this._dataReg); + methodVO.secondaryFragmentConstantsIndex = this._dataReg.index * 4; + return _super.prototype.iGetFragmentPreLightingCode.call(this, shaderObject, methodVO, registerCache, sharedRegisters); + }; + /** + * Applies the fresnel effect to the specular strength. + * + * @param vo The MethodVO object containing the method data for the currently compiled material pass. + * @param target The register containing the specular strength in the "w" component, and the half-vector/reflection vector in "xyz". + * @param regCache The register cache used for the shader compilation. + * @param sharedRegisters The shared registers created by the compiler. + * @return The AGAL fragment code for the method. + */ + SpecularFresnelMethod.prototype.modulateSpecular = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { + var code; + code = "dp3 " + targetReg + ".y, " + sharedRegisters.viewDirFragment + ".xyz, " + (this._incidentLight ? targetReg : sharedRegisters.normalFragment) + ".xyz\n" + "sub " + targetReg + ".y, " + this._dataReg + ".z, " + targetReg + ".y\n" + "pow " + targetReg + ".x, " + targetReg + ".y, " + this._dataReg + ".y\n" + "sub " + targetReg + ".y, " + this._dataReg + ".z, " + targetReg + ".y\n" + "mul " + targetReg + ".y, " + this._dataReg + ".x, " + targetReg + ".y\n" + "add " + targetReg + ".y, " + targetReg + ".x, " + targetReg + ".y\n" + "mul " + targetReg + ".w, " + targetReg + ".w, " + targetReg + ".y\n"; + console.log('SpecularFresnelMethod', 'modulateSpecular', code); + return code; + }; + return SpecularFresnelMethod; +})(SpecularCompositeMethod); +module.exports = SpecularFresnelMethod; + + +},{"awayjs-renderergl/lib/materials/methods/SpecularCompositeMethod":undefined}],"awayjs-renderergl/lib/materials/methods/SpecularPhongMethod":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var SpecularBasicMethod = require("awayjs-stagegl/lib/materials/methods/SpecularBasicMethod"); +/** + * SpecularPhongMethod provides a specular method that provides Phong highlights. + */ +var SpecularPhongMethod = (function (_super) { + __extends(SpecularPhongMethod, _super); + /** + * Creates a new SpecularPhongMethod object. + */ + function SpecularPhongMethod() { + _super.call(this); + } + /** + * @inheritDoc + */ + SpecularPhongMethod.prototype.iGetFragmentCodePerLight = function (shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters) { + var code = ""; + var t; + if (this._pIsFirstLight) { + t = this._pTotalLightColorReg; + } + else { + t = registerCache.getFreeFragmentVectorTemp(); + registerCache.addFragmentTempUsages(t, 1); + } + var viewDirReg = sharedRegisters.viewDirFragment; + var normalReg = sharedRegisters.normalFragment; + // phong model + code += "dp3 " + t + ".w, " + lightDirReg + ", " + normalReg + "\n" + "add " + t + ".w, " + t + ".w, " + t + ".w\n" + "mul " + t + ".xyz, " + normalReg + ", " + t + ".w\n" + "sub " + t + ".xyz, " + t + ", " + lightDirReg + "\n" + "add " + t + ".w, " + t + ".w, " + sharedRegisters.commons + ".w\n" + "sat " + t + ".w, " + t + ".w\n" + "mul " + t + ".xyz, " + t + ", " + t + ".w\n" + "dp3 " + t + ".w, " + t + ", " + viewDirReg + "\n" + "sat " + t + ".w, " + t + ".w\n"; + if (this._pUseTexture) { + // apply gloss modulation from texture + code += "mul " + this._pSpecularTexData + ".w, " + this._pSpecularTexData + ".y, " + this._pSpecularDataRegister + ".w\n" + "pow " + t + ".w, " + t + ".w, " + this._pSpecularTexData + ".w\n"; + } + else + code += "pow " + t + ".w, " + t + ".w, " + this._pSpecularDataRegister + ".w\n"; + // attenuate + if (shaderObject.usesLightFallOff) + code += "mul " + t + ".w, " + t + ".w, " + lightDirReg + ".w\n"; + if (this._iModulateMethod != null) + code += this._iModulateMethod(shaderObject, methodVO, t, registerCache, sharedRegisters); + code += "mul " + t + ".xyz, " + lightColReg + ".xyz, " + t + ".w\n"; + if (!this._pIsFirstLight) { + code += "add " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ".xyz, " + t + ".xyz\n"; + registerCache.removeFragmentTempUsage(t); + } + this._pIsFirstLight = false; + return code; + }; + return SpecularPhongMethod; +})(SpecularBasicMethod); +module.exports = SpecularPhongMethod; + + +},{"awayjs-stagegl/lib/materials/methods/SpecularBasicMethod":undefined}],"awayjs-renderergl/lib/materials/passes/SingleObjectDepthPass":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var TriangleSubGeometry = require("awayjs-core/lib/core/base/TriangleSubGeometry"); +var Matrix3D = require("awayjs-core/lib/core/geom/Matrix3D"); +var RenderTexture = require("awayjs-core/lib/textures/RenderTexture"); +var ContextGLProgramType = require("awayjs-stagegl/lib/core/stagegl/ContextGLProgramType"); +var MaterialPassBase = require("awayjs-stagegl/lib/materials/passes/MaterialPassBase"); +/** + * The SingleObjectDepthPass provides a material pass that renders a single object to a depth map from the point + * of view from a light. + */ +var SingleObjectDepthPass = (function (_super) { + __extends(SingleObjectDepthPass, _super); + /** + * Creates a new SingleObjectDepthPass object. + */ + function SingleObjectDepthPass() { + _super.call(this); + this._textureSize = 512; + this._polyOffset = Array(15, 0, 0, 0); + this._projectionTexturesInvalid = true; + //this._pNumUsedStreams = 2; + //this._pNumUsedVertexConstants = 7; + //this._enc = Array(1.0, 255.0, 65025.0, 16581375.0, 1.0/255.0, 1.0/255.0, 1.0/255.0, 0.0); + // + //this._pAnimatableAttributes = Array("va0", "va1"); + //this._pAnimationTargetRegisters = Array("vt0", "vt1"); + } + Object.defineProperty(SingleObjectDepthPass.prototype, "textureSize", { + /** + * The size of the depth map texture to render to. + */ + get: function () { + return this._textureSize; + }, + set: function (value) { + this._textureSize = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SingleObjectDepthPass.prototype, "polyOffset", { + /** + * The amount by which the rendered object will be inflated, to prevent depth map rounding errors. + */ + get: function () { + return this._polyOffset[0]; + }, + set: function (value) { + this._polyOffset[0] = value; + }, + enumerable: true, + configurable: true + }); + /** + * @inheritDoc + */ + SingleObjectDepthPass.prototype.dispose = function () { + if (this._textures) { + for (var key in this._textures) { + var texture = this._textures[key]; + texture.dispose(); + } + this._textures = null; + } + }; + /** + * Updates the projection textures used to contain the depth renders. + */ + SingleObjectDepthPass.prototype.updateProjectionTextures = function () { + if (this._textures) { + for (var key in this._textures) { + var texture = this._textures[key]; + texture.dispose(); + } + } + this._textures = new Object(); + this._projections = new Object(); + this._projectionTexturesInvalid = false; + }; + /** + * @inheritDoc + */ + SingleObjectDepthPass.prototype._iGetVertexCode = function () { + var code; + // offset + code = "mul vt7, vt1, vc4.x \n" + "add vt7, vt7, vt0\n" + "mov vt7.w, vt0.w\n"; + // project + code += "m44 vt2, vt7, vc0\n" + "mov op, vt2\n"; + // perspective divide + code += "div v0, vt2, vt2.w\n"; + return code; + }; + /** + * @inheritDoc + */ + SingleObjectDepthPass.prototype._iGetFragmentCode = function (shaderObject, registerCache, sharedRegisters) { + var code = ""; + // encode float -> rgba + code += "mul ft0, fc0, v0.z\n" + "frc ft0, ft0\n" + "mul ft1, ft0.yzww, fc1\n" + "sub ft0, ft0, ft1\n" + "mov oc, ft0\n"; + return code; + }; + /** + * Gets the depth maps rendered for this object from all lights. + * @param renderable The renderable for which to retrieve the depth maps. + * @param stage3DProxy The Stage3DProxy object currently used for rendering. + * @return A list of depth map textures for all supported lights. + */ + SingleObjectDepthPass.prototype._iGetDepthMap = function (renderable) { + return this._textures[renderable.materialOwner.id]; + }; + /** + * Retrieves the depth map projection maps for all lights. + * @param renderable The renderable for which to retrieve the projection maps. + * @return A list of projection maps for all supported lights. + */ + SingleObjectDepthPass.prototype._iGetProjection = function (renderable) { + return this._projections[renderable.materialOwner.id]; + }; + /** + * @inheritDoc + */ + SingleObjectDepthPass.prototype._iRender = function (pass, renderable, stage, camera, viewProjection) { + var matrix; + var context = stage.context; + var len /*uint*/; + var light; + var lights = this._pLightPicker.allPickedLights; + var rId = renderable.materialOwner.id; + if (!this._textures[rId]) + this._textures[rId] = new RenderTexture(this._textureSize, this._textureSize); + if (!this._projections[rId]) + this._projections[rId] = new Matrix3D(); + len = lights.length; + // local position = enough + light = lights[0]; + matrix = light.iGetObjectProjectionMatrix(renderable.sourceEntity, camera, this._projections[rId]); + context.setRenderTarget(this._textures[rId], true); + context.clear(1.0, 1.0, 1.0); + context.setProgramConstantsFromMatrix(ContextGLProgramType.VERTEX, 0, matrix, true); + context.setProgramConstantsFromArray(ContextGLProgramType.FRAGMENT, 0, this._enc, 2); + context.activateBuffer(0, renderable.getVertexData(TriangleSubGeometry.POSITION_DATA), renderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA), TriangleSubGeometry.POSITION_FORMAT); + context.activateBuffer(1, renderable.getVertexData(TriangleSubGeometry.NORMAL_DATA), renderable.getVertexOffset(TriangleSubGeometry.NORMAL_DATA), TriangleSubGeometry.NORMAL_FORMAT); + context.drawTriangles(context.getIndexBuffer(renderable.getIndexData()), 0, renderable.numTriangles); + }; + /** + * @inheritDoc + */ + SingleObjectDepthPass.prototype._iActivate = function (pass, stage, camera) { + if (this._projectionTexturesInvalid) + this.updateProjectionTextures(); + // never scale + _super.prototype._iActivate.call(this, pass, stage, camera); + stage.context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX, 4, this._polyOffset, 1); + }; + return SingleObjectDepthPass; +})(MaterialPassBase); +module.exports = SingleObjectDepthPass; + + +},{"awayjs-core/lib/core/base/TriangleSubGeometry":undefined,"awayjs-core/lib/core/geom/Matrix3D":undefined,"awayjs-core/lib/textures/RenderTexture":undefined,"awayjs-stagegl/lib/core/stagegl/ContextGLProgramType":undefined,"awayjs-stagegl/lib/materials/passes/MaterialPassBase":undefined}],"awayjs-renderergl/lib/parsers/AWDParser":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var DisplayObjectContainer = require("awayjs-core/lib/containers/DisplayObjectContainer"); +var BlendMode = require("awayjs-core/lib/core/base/BlendMode"); +var Geometry = require("awayjs-core/lib/core/base/Geometry"); +var TriangleSubGeometry = require("awayjs-core/lib/core/base/TriangleSubGeometry"); +var ColorTransform = require("awayjs-core/lib/core/geom/ColorTransform"); +var Matrix3D = require("awayjs-core/lib/core/geom/Matrix3D"); +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var URLLoaderDataFormat = require("awayjs-core/lib/core/net/URLLoaderDataFormat"); +var URLRequest = require("awayjs-core/lib/core/net/URLRequest"); +var AssetType = require("awayjs-core/lib/core/library/AssetType"); +var DirectionalLight = require("awayjs-core/lib/entities/DirectionalLight"); +var PointLight = require("awayjs-core/lib/entities/PointLight"); +var Camera = require("awayjs-core/lib/entities/Camera"); +var Mesh = require("awayjs-core/lib/entities/Mesh"); +var Skybox = require("awayjs-core/lib/entities/Skybox"); +var StaticLightPicker = require("awayjs-core/lib/materials/lightpickers/StaticLightPicker"); +var CubeMapShadowMapper = require("awayjs-core/lib/materials/shadowmappers/CubeMapShadowMapper"); +var DirectionalShadowMapper = require("awayjs-core/lib/materials/shadowmappers/DirectionalShadowMapper"); +var PrefabBase = require("awayjs-core/lib/prefabs/PrefabBase"); +var PrimitiveCapsulePrefab = require("awayjs-core/lib/prefabs/PrimitiveCapsulePrefab"); +var PrimitiveConePrefab = require("awayjs-core/lib/prefabs/PrimitiveConePrefab"); +var PrimitiveCubePrefab = require("awayjs-core/lib/prefabs/PrimitiveCubePrefab"); +var PrimitiveCylinderPrefab = require("awayjs-core/lib/prefabs/PrimitiveCylinderPrefab"); +var PrimitivePlanePrefab = require("awayjs-core/lib/prefabs/PrimitivePlanePrefab"); +var PrimitiveSpherePrefab = require("awayjs-core/lib/prefabs/PrimitiveSpherePrefab"); +var PrimitiveTorusPrefab = require("awayjs-core/lib/prefabs/PrimitiveTorusPrefab"); +var ParserBase = require("awayjs-core/lib/parsers/ParserBase"); +var ParserUtils = require("awayjs-core/lib/parsers/ParserUtils"); +var PerspectiveProjection = require("awayjs-core/lib/projections/PerspectiveProjection"); +var OrthographicProjection = require("awayjs-core/lib/projections/OrthographicProjection"); +var OrthographicOffCenterProjection = require("awayjs-core/lib/projections/OrthographicOffCenterProjection"); +var BitmapCubeTexture = require("awayjs-core/lib/textures/BitmapCubeTexture"); +var ImageCubeTexture = require("awayjs-core/lib/textures/ImageCubeTexture"); +var ImageTexture = require("awayjs-core/lib/textures/ImageTexture"); +var ByteArray = require("awayjs-core/lib/utils/ByteArray"); +var SkyboxMaterial = require("awayjs-stagegl/lib/materials/SkyboxMaterial"); +var TriangleMaterialMode = require("awayjs-stagegl/lib/materials/TriangleMaterialMode"); +var TriangleMethodMaterial = require("awayjs-stagegl/lib/materials/TriangleMethodMaterial"); +var DefaultMaterialManager = require("awayjs-stagegl/lib/materials/utils/DefaultMaterialManager"); +var VertexAnimationSet = require("awayjs-renderergl/lib/animators/VertexAnimationSet"); +var VertexAnimator = require("awayjs-renderergl/lib/animators/VertexAnimator"); +var SkeletonAnimationSet = require("awayjs-renderergl/lib/animators/SkeletonAnimationSet"); +var SkeletonAnimator = require("awayjs-renderergl/lib/animators/SkeletonAnimator"); +var JointPose = require("awayjs-renderergl/lib/animators/data/JointPose"); +var Skeleton = require("awayjs-renderergl/lib/animators/data/Skeleton"); +var SkeletonPose = require("awayjs-renderergl/lib/animators/data/SkeletonPose"); +var SkeletonJoint = require("awayjs-renderergl/lib/animators/data/SkeletonJoint"); +var SkeletonClipNode = require("awayjs-renderergl/lib/animators/nodes/SkeletonClipNode"); +var VertexClipNode = require("awayjs-renderergl/lib/animators/nodes/VertexClipNode"); +var AmbientEnvMapMethod = require("awayjs-renderergl/lib/materials/methods/AmbientEnvMapMethod"); +var DiffuseDepthMethod = require("awayjs-renderergl/lib/materials/methods/DiffuseDepthMethod"); +var DiffuseCelMethod = require("awayjs-renderergl/lib/materials/methods/DiffuseCelMethod"); +var DiffuseGradientMethod = require("awayjs-renderergl/lib/materials/methods/DiffuseGradientMethod"); +var DiffuseLightMapMethod = require("awayjs-renderergl/lib/materials/methods/DiffuseLightMapMethod"); +var DiffuseWrapMethod = require("awayjs-renderergl/lib/materials/methods/DiffuseWrapMethod"); +var EffectAlphaMaskMethod = require("awayjs-renderergl/lib/materials/methods/EffectAlphaMaskMethod"); +var EffectColorMatrixMethod = require("awayjs-renderergl/lib/materials/methods/EffectColorMatrixMethod"); +var EffectColorTransformMethod = require("awayjs-stagegl/lib/materials/methods/EffectColorTransformMethod"); +var EffectEnvMapMethod = require("awayjs-renderergl/lib/materials/methods/EffectEnvMapMethod"); +var EffectFogMethod = require("awayjs-renderergl/lib/materials/methods/EffectFogMethod"); +var EffectFresnelEnvMapMethod = require("awayjs-renderergl/lib/materials/methods/EffectFresnelEnvMapMethod"); +var EffectLightMapMethod = require("awayjs-renderergl/lib/materials/methods/EffectLightMapMethod"); +var EffectRimLightMethod = require("awayjs-renderergl/lib/materials/methods/EffectRimLightMethod"); +var NormalSimpleWaterMethod = require("awayjs-renderergl/lib/materials/methods/NormalSimpleWaterMethod"); +var ShadowDitheredMethod = require("awayjs-renderergl/lib/materials/methods/ShadowDitheredMethod"); +var ShadowFilteredMethod = require("awayjs-renderergl/lib/materials/methods/ShadowFilteredMethod"); +var SpecularFresnelMethod = require("awayjs-renderergl/lib/materials/methods/SpecularFresnelMethod"); +var ShadowHardMethod = require("awayjs-stagegl/lib/materials/methods/ShadowHardMethod"); +var SpecularAnisotropicMethod = require("awayjs-renderergl/lib/materials/methods/SpecularAnisotropicMethod"); +var SpecularCelMethod = require("awayjs-renderergl/lib/materials/methods/SpecularCelMethod"); +var SpecularPhongMethod = require("awayjs-renderergl/lib/materials/methods/SpecularPhongMethod"); +var ShadowNearMethod = require("awayjs-renderergl/lib/materials/methods/ShadowNearMethod"); +var ShadowSoftMethod = require("awayjs-renderergl/lib/materials/methods/ShadowSoftMethod"); +var AWDBlock = require("awayjs-renderergl/lib/parsers/data/AWDBlock"); +var AWDProperties = require("awayjs-renderergl/lib/parsers/data/AWDProperties"); +var BitFlags = require("awayjs-renderergl/lib/parsers/data/BitFlags"); +/** + * AWDParser provides a parser for the AWD data type. + */ +var AWDParser = (function (_super) { + __extends(AWDParser, _super); + /** + * Creates a new AWDParser object. + * @param uri The url or id of the data or file to be parsed. + * @param extra The holder for extra contextual data that the parser might need. + */ + function AWDParser() { + _super.call(this, URLLoaderDataFormat.ARRAY_BUFFER); + //set to "true" to have some console.logs in the Console + this._debug = false; + this._startedParsing = false; + this._texture_users = {}; + this._parsed_header = false; + this._blocks = new Array(); + this._blocks[0] = new AWDBlock(); + this._blocks[0].data = null; // Zero address means null in AWD + this.blendModeDic = new Array(); // used to translate ints to blendMode-strings + this.blendModeDic.push(BlendMode.NORMAL); + this.blendModeDic.push(BlendMode.ADD); + this.blendModeDic.push(BlendMode.ALPHA); + this.blendModeDic.push(BlendMode.DARKEN); + this.blendModeDic.push(BlendMode.DIFFERENCE); + this.blendModeDic.push(BlendMode.ERASE); + this.blendModeDic.push(BlendMode.HARDLIGHT); + this.blendModeDic.push(BlendMode.INVERT); + this.blendModeDic.push(BlendMode.LAYER); + this.blendModeDic.push(BlendMode.LIGHTEN); + this.blendModeDic.push(BlendMode.MULTIPLY); + this.blendModeDic.push(BlendMode.NORMAL); + this.blendModeDic.push(BlendMode.OVERLAY); + this.blendModeDic.push(BlendMode.SCREEN); + this.blendModeDic.push(BlendMode.SHADER); + this.blendModeDic.push(BlendMode.OVERLAY); + this._depthSizeDic = new Array(); // used to translate ints to depthSize-values + this._depthSizeDic.push(256); + this._depthSizeDic.push(512); + this._depthSizeDic.push(2048); + this._depthSizeDic.push(1024); + this._version = Array(); // will contain 2 int (major-version, minor-version) for awd-version-check + } + /** + * Indicates whether or not a given file extension is supported by the parser. + * @param extension The file extension of a potential file to be parsed. + * @return Whether or not the given file type is supported. + */ + AWDParser.supportsType = function (extension) { + extension = extension.toLowerCase(); + return extension == "awd"; + }; + /** + * Tests whether a data block can be parsed by the parser. + * @param data The data block to potentially be parsed. + * @return Whether or not the given data is supported. + */ + AWDParser.supportsData = function (data) { + return (ParserUtils.toString(data, 3) == 'AWD'); + }; + /** + * @inheritDoc + */ + AWDParser.prototype._iResolveDependency = function (resourceDependency) { + // this will be called when Dependency has finished loading. + // the Assets waiting for this Bitmap, can be Texture or CubeTexture. + // if the Bitmap is awaited by a CubeTexture, we need to check if its the last Bitmap of the CubeTexture, + // so we know if we have to finalize the Asset (CubeTexture) or not. + if (resourceDependency.assets.length == 1) { + var isCubeTextureArray = resourceDependency.id.split("#"); + var ressourceID = isCubeTextureArray[0]; + var asset; + var thisBitmapTexture; + var block; + if (isCubeTextureArray.length == 1) { + asset = resourceDependency.assets[0]; + if (asset) { + var mat; + var users; + block = this._blocks[resourceDependency.id]; + block.data = asset; // Store finished asset + // Reset name of texture to the one defined in the AWD file, + // as opposed to whatever the image parser came up with. + asset.resetAssetPath(block.name, null, true); + block.name = asset.name; + // Finalize texture asset to dispatch texture event, which was + // previously suppressed while the dependency was loaded. + this._pFinalizeAsset(asset); + if (this._debug) { + console.log("Successfully loaded Bitmap for texture"); + console.log("Parsed texture: Name = " + block.name); + } + } + } + if (isCubeTextureArray.length > 1) { + thisBitmapTexture = resourceDependency.assets[0]; + var tx = thisBitmapTexture; + this._cubeTextures[isCubeTextureArray[1]] = tx.htmlImageElement; // ? + this._texture_users[ressourceID].push(1); + if (this._debug) { + console.log("Successfully loaded Bitmap " + this._texture_users[ressourceID].length + " / 6 for Cubetexture"); + } + if (this._texture_users[ressourceID].length == this._cubeTextures.length) { + var posX = this._cubeTextures[0]; + var negX = this._cubeTextures[1]; + var posY = this._cubeTextures[2]; + var negY = this._cubeTextures[3]; + var posZ = this._cubeTextures[4]; + var negZ = this._cubeTextures[5]; + asset = new ImageCubeTexture(posX, negX, posY, negY, posZ, negZ); + block = this._blocks[ressourceID]; + block.data = asset; // Store finished asset + // Reset name of texture to the one defined in the AWD file, + // as opposed to whatever the image parser came up with. + asset.resetAssetPath(block.name, null, true); + block.name = asset.name; + // Finalize texture asset to dispatch texture event, which was + // previously suppressed while the dependency was loaded. + this._pFinalizeAsset(asset); + if (this._debug) { + console.log("Parsed CubeTexture: Name = " + block.name); + } + } + } + } + }; + /** + * @inheritDoc + */ + AWDParser.prototype._iResolveDependencyFailure = function (resourceDependency) { + //not used - if a dependcy fails, the awaiting Texture or CubeTexture will never be finalized, and the default-bitmaps will be used. + // this means, that if one Bitmap of a CubeTexture fails, the CubeTexture will have the DefaultTexture applied for all six Bitmaps. + }; + /** + * Resolve a dependency name + * + * @param resourceDependency The dependency to be resolved. + */ + AWDParser.prototype._iResolveDependencyName = function (resourceDependency, asset) { + var oldName = asset.name; + if (asset) { + var block = this._blocks[parseInt(resourceDependency.id)]; + // Reset name of texture to the one defined in the AWD file, + // as opposed to whatever the image parser came up with. + asset.resetAssetPath(block.name, null, true); + } + var newName = asset.name; + asset.name = oldName; + return newName; + }; + /** + * @inheritDoc + */ + AWDParser.prototype._pProceedParsing = function () { + if (!this._startedParsing) { + this._byteData = this._pGetByteData(); //getByteData(); + this._startedParsing = true; + } + if (!this._parsed_header) { + //---------------------------------------------------------------------------- + // LITTLE_ENDIAN - Default for ArrayBuffer / Not implemented in ByteArray + //---------------------------------------------------------------------------- + //this._byteData.endian = Endian.LITTLE_ENDIAN; + //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- + // Parse header and decompress body if needed + this.parseHeader(); + switch (this._compression) { + case AWDParser.DEFLATE: + case AWDParser.LZMA: + this._pDieWithError('Compressed AWD formats not yet supported'); + break; + case AWDParser.UNCOMPRESSED: + this._body = this._byteData; + break; + } + this._parsed_header = true; + } + if (this._body) { + while (this._body.getBytesAvailable() > 0 && !this.parsingPaused) { + this.parseNextBlock(); + } + //---------------------------------------------------------------------------- + // Return complete status + if (this._body.getBytesAvailable() == 0) { + this.dispose(); + return ParserBase.PARSING_DONE; + } + else { + return ParserBase.MORE_TO_PARSE; + } + } + else { + switch (this._compression) { + case AWDParser.DEFLATE: + case AWDParser.LZMA: + if (this._debug) { + console.log("(!) AWDParser Error: Compressed AWD formats not yet supported (!)"); + } + break; + } + // Error - most likely _body not set because we do not support compression. + return ParserBase.PARSING_DONE; + } + }; + AWDParser.prototype._pStartParsing = function (frameLimit) { + _super.prototype._pStartParsing.call(this, frameLimit); + //create a content object for Loaders + this._pContent = new DisplayObjectContainer(); + }; + AWDParser.prototype.dispose = function () { + for (var c in this._blocks) { + var b = this._blocks[c]; + b.dispose(); + } + }; + AWDParser.prototype.parseNextBlock = function () { + var block; + var assetData; + var isParsed = false; + var ns; + var type; + var flags; + var len; + this._cur_block_id = this._body.readUnsignedInt(); + ns = this._body.readUnsignedByte(); + type = this._body.readUnsignedByte(); + flags = this._body.readUnsignedByte(); + len = this._body.readUnsignedInt(); + var blockCompression = BitFlags.test(flags, BitFlags.FLAG4); + var blockCompressionLZMA = BitFlags.test(flags, BitFlags.FLAG5); + if (this._accuracyOnBlocks) { + this._accuracyMatrix = BitFlags.test(flags, BitFlags.FLAG1); + this._accuracyGeo = BitFlags.test(flags, BitFlags.FLAG2); + this._accuracyProps = BitFlags.test(flags, BitFlags.FLAG3); + this._geoNrType = AWDParser.FLOAT32; + if (this._accuracyGeo) { + this._geoNrType = AWDParser.FLOAT64; + } + this._matrixNrType = AWDParser.FLOAT32; + if (this._accuracyMatrix) { + this._matrixNrType = AWDParser.FLOAT64; + } + this._propsNrType = AWDParser.FLOAT32; + if (this._accuracyProps) { + this._propsNrType = AWDParser.FLOAT64; + } + } + var blockEndAll = this._body.position + len; + if (len > this._body.getBytesAvailable()) { + this._pDieWithError('AWD2 block length is bigger than the bytes that are available!'); + this._body.position += this._body.getBytesAvailable(); + return; + } + this._newBlockBytes = new ByteArray(); + this._body.readBytes(this._newBlockBytes, 0, len); + //---------------------------------------------------------------------------- + // Compressed AWD Formats not yet supported + if (blockCompression) { + this._pDieWithError('Compressed AWD formats not yet supported'); + } + //---------------------------------------------------------------------------- + // LITTLE_ENDIAN - Default for ArrayBuffer / Not implemented in ByteArray + //---------------------------------------------------------------------------- + //this._newBlockBytes.endian = Endian.LITTLE_ENDIAN; + //---------------------------------------------------------------------------- + this._newBlockBytes.position = 0; + block = new AWDBlock(); + block.len = this._newBlockBytes.position + len; + block.id = this._cur_block_id; + var blockEndBlock = this._newBlockBytes.position + len; + if (blockCompression) { + this._pDieWithError('Compressed AWD formats not yet supported'); + } + if (this._debug) { + console.log("AWDBlock: ID = " + this._cur_block_id + " | TypeID = " + type + " | Compression = " + blockCompression + " | Matrix-Precision = " + this._accuracyMatrix + " | Geometry-Precision = " + this._accuracyGeo + " | Properties-Precision = " + this._accuracyProps); + } + this._blocks[this._cur_block_id] = block; + if ((this._version[0] == 2) && (this._version[1] == 1)) { + switch (type) { + case 11: + this.parsePrimitves(this._cur_block_id); + isParsed = true; + break; + case 31: + this.parseSkyboxInstance(this._cur_block_id); + isParsed = true; + break; + case 41: + this.parseLight(this._cur_block_id); + isParsed = true; + break; + case 42: + this.parseCamera(this._cur_block_id); + isParsed = true; + break; + case 51: + this.parseLightPicker(this._cur_block_id); + isParsed = true; + break; + case 81: + this.parseMaterial_v1(this._cur_block_id); + isParsed = true; + break; + case 83: + this.parseCubeTexture(this._cur_block_id); + isParsed = true; + break; + case 91: + this.parseSharedMethodBlock(this._cur_block_id); + isParsed = true; + break; + case 92: + this.parseShadowMethodBlock(this._cur_block_id); + isParsed = true; + break; + case 111: + this.parseMeshPoseAnimation(this._cur_block_id, true); + isParsed = true; + break; + case 112: + this.parseMeshPoseAnimation(this._cur_block_id); + isParsed = true; + break; + case 113: + this.parseVertexAnimationSet(this._cur_block_id); + isParsed = true; + break; + case 122: + this.parseAnimatorSet(this._cur_block_id); + isParsed = true; + break; + case 253: + this.parseCommand(this._cur_block_id); + isParsed = true; + break; + } + } + //* + if (isParsed == false) { + switch (type) { + case 1: + this.parseTriangleGeometrieBlock(this._cur_block_id); + break; + case 22: + this.parseContainer(this._cur_block_id); + break; + case 23: + this.parseMeshInstance(this._cur_block_id); + break; + case 81: + this.parseMaterial(this._cur_block_id); + break; + case 82: + this.parseTexture(this._cur_block_id); + break; + case 101: + this.parseSkeleton(this._cur_block_id); + break; + case 102: + this.parseSkeletonPose(this._cur_block_id); + break; + case 103: + this.parseSkeletonAnimation(this._cur_block_id); + break; + case 121: + case 254: + this.parseNameSpace(this._cur_block_id); + break; + case 255: + this.parseMetaData(this._cur_block_id); + break; + default: + if (this._debug) { + console.log("AWDBlock: Unknown BlockType (BlockID = " + this._cur_block_id + ") - Skip " + len + " bytes"); + } + this._newBlockBytes.position += len; + break; + } + } + //*/ + var msgCnt = 0; + if (this._newBlockBytes.position == blockEndBlock) { + if (this._debug) { + if (block.errorMessages) { + while (msgCnt < block.errorMessages.length) { + console.log(" (!) Error: " + block.errorMessages[msgCnt] + " (!)"); + msgCnt++; + } + } + } + if (this._debug) { + console.log("\n"); + } + } + else { + if (this._debug) { + console.log(" (!)(!)(!) Error while reading AWDBlock ID " + this._cur_block_id + " = skip to next block"); + if (block.errorMessages) { + while (msgCnt < block.errorMessages.length) { + console.log(" (!) Error: " + block.errorMessages[msgCnt] + " (!)"); + msgCnt++; + } + } + } + } + this._body.position = blockEndAll; + this._newBlockBytes = null; + }; + //--Parser Blocks--------------------------------------------------------------------------- + //Block ID = 1 + AWDParser.prototype.parseTriangleGeometrieBlock = function (blockID) { + var geom = new Geometry(); + // Read name and sub count + var name = this.parseVarStr(); + var num_subs = this._newBlockBytes.readUnsignedShort(); + // Read optional properties + var props = this.parseProperties({ 1: this._geoNrType, 2: this._geoNrType }); + var geoScaleU = props.get(1, 1); + var geoScaleV = props.get(2, 1); + // Loop through sub meshes + var subs_parsed = 0; + while (subs_parsed < num_subs) { + var i; + var sm_len, sm_end; + var sub_geom; + var w_indices; + var weights; + sm_len = this._newBlockBytes.readUnsignedInt(); + sm_end = this._newBlockBytes.position + sm_len; + // Ignore for now + var subProps = this.parseProperties({ 1: this._geoNrType, 2: this._geoNrType }); + while (this._newBlockBytes.position < sm_end) { + var idx = 0; + var str_ftype, str_type, str_len, str_end; + // Type, field type, length + str_type = this._newBlockBytes.readUnsignedByte(); + str_ftype = this._newBlockBytes.readUnsignedByte(); + str_len = this._newBlockBytes.readUnsignedInt(); + str_end = this._newBlockBytes.position + str_len; + var x, y, z; + if (str_type == 1) { + var verts = new Array(); + while (this._newBlockBytes.position < str_end) { + // TODO: Respect stream field type + x = this.readNumber(this._accuracyGeo); + y = this.readNumber(this._accuracyGeo); + z = this.readNumber(this._accuracyGeo); + verts[idx++] = x; + verts[idx++] = y; + verts[idx++] = z; + } + } + else if (str_type == 2) { + var indices = new Array(); + while (this._newBlockBytes.position < str_end) { + // TODO: Respect stream field type + indices[idx++] = this._newBlockBytes.readUnsignedShort(); + } + } + else if (str_type == 3) { + var uvs = new Array(); + while (this._newBlockBytes.position < str_end) { + uvs[idx++] = this.readNumber(this._accuracyGeo); + } + } + else if (str_type == 4) { + var normals = new Array(); + while (this._newBlockBytes.position < str_end) { + normals[idx++] = this.readNumber(this._accuracyGeo); + } + } + else if (str_type == 6) { + w_indices = Array(); + while (this._newBlockBytes.position < str_end) { + w_indices[idx++] = this._newBlockBytes.readUnsignedShort() * 3; // TODO: Respect stream field type + } + } + else if (str_type == 7) { + weights = new Array(); + while (this._newBlockBytes.position < str_end) { + weights[idx++] = this.readNumber(this._accuracyGeo); + } + } + else { + this._newBlockBytes.position = str_end; + } + } + this.parseUserAttributes(); // Ignore sub-mesh attributes for now + sub_geom = new TriangleSubGeometry(true); + if (weights) + sub_geom.jointsPerVertex = weights.length / (verts.length / 3); + if (normals) + sub_geom.autoDeriveNormals = false; + if (uvs) + sub_geom.autoDeriveUVs = false; + sub_geom.updateIndices(indices); + sub_geom.updatePositions(verts); + sub_geom.updateVertexNormals(normals); + sub_geom.updateUVs(uvs); + sub_geom.updateVertexTangents(null); + sub_geom.updateJointWeights(weights); + sub_geom.updateJointIndices(w_indices); + var scaleU = subProps.get(1, 1); + var scaleV = subProps.get(2, 1); + var setSubUVs = false; //this should remain false atm, because in AwayBuilder the uv is only scaled by the geometry + if ((geoScaleU != scaleU) || (geoScaleV != scaleV)) { + setSubUVs = true; + scaleU = geoScaleU / scaleU; + scaleV = geoScaleV / scaleV; + } + if (setSubUVs) + sub_geom.scaleUV(scaleU, scaleV); + geom.addSubGeometry(sub_geom); + // TODO: Somehow map in-sub to out-sub indices to enable look-up + // when creating meshes (and their material assignments.) + subs_parsed++; + } + if ((geoScaleU != 1) || (geoScaleV != 1)) + geom.scaleUV(geoScaleU, geoScaleV); + this.parseUserAttributes(); + this._pFinalizeAsset(geom, name); + this._blocks[blockID].data = geom; + if (this._debug) { + console.log("Parsed a TriangleGeometry: Name = " + name + "| Id = " + sub_geom.id); + } + }; + //Block ID = 11 + AWDParser.prototype.parsePrimitves = function (blockID) { + var name; + var prefab; + var primType; + var subs_parsed; + var props; + var bsm; + // Read name and sub count + name = this.parseVarStr(); + primType = this._newBlockBytes.readUnsignedByte(); + props = this.parseProperties({ 101: this._geoNrType, 102: this._geoNrType, 103: this._geoNrType, 110: this._geoNrType, 111: this._geoNrType, 301: AWDParser.UINT16, 302: AWDParser.UINT16, 303: AWDParser.UINT16, 701: AWDParser.BOOL, 702: AWDParser.BOOL, 703: AWDParser.BOOL, 704: AWDParser.BOOL }); + var primitiveTypes = ["Unsupported Type-ID", "PrimitivePlanePrefab", "PrimitiveCubePrefab", "PrimitiveSpherePrefab", "PrimitiveCylinderPrefab", "PrimitivesConePrefab", "PrimitivesCapsulePrefab", "PrimitivesTorusPrefab"]; + switch (primType) { + case 1: + prefab = new PrimitivePlanePrefab(props.get(101, 100), props.get(102, 100), props.get(301, 1), props.get(302, 1), props.get(701, true), props.get(702, false)); + break; + case 2: + prefab = new PrimitiveCubePrefab(props.get(101, 100), props.get(102, 100), props.get(103, 100), props.get(301, 1), props.get(302, 1), props.get(303, 1), props.get(701, true)); + break; + case 3: + prefab = new PrimitiveSpherePrefab(props.get(101, 50), props.get(301, 16), props.get(302, 12), props.get(701, true)); + break; + case 4: + prefab = new PrimitiveCylinderPrefab(props.get(101, 50), props.get(102, 50), props.get(103, 100), props.get(301, 16), props.get(302, 1), true, true, true); // bool701, bool702, bool703, bool704); + if (!props.get(701, true)) + prefab.topClosed = false; + if (!props.get(702, true)) + prefab.bottomClosed = false; + if (!props.get(703, true)) + prefab.yUp = false; + break; + case 5: + prefab = new PrimitiveConePrefab(props.get(101, 50), props.get(102, 100), props.get(301, 16), props.get(302, 1), props.get(701, true), props.get(702, true)); + break; + case 6: + prefab = new PrimitiveCapsulePrefab(props.get(101, 50), props.get(102, 100), props.get(301, 16), props.get(302, 15), props.get(701, true)); + break; + case 7: + prefab = new PrimitiveTorusPrefab(props.get(101, 50), props.get(102, 50), props.get(301, 16), props.get(302, 8), props.get(701, true)); + break; + default: + prefab = new PrefabBase(); + console.log("ERROR: UNSUPPORTED PREFAB_TYPE"); + break; + } + if ((props.get(110, 1) != 1) || (props.get(111, 1) != 1)) { + } + this.parseUserAttributes(); + prefab.name = name; + this._pFinalizeAsset(prefab, name); + this._blocks[blockID].data = prefab; + if (this._debug) { + if ((primType < 0) || (primType > 7)) { + primType = 0; + } + console.log("Parsed a Primivite: Name = " + name + "| type = " + primitiveTypes[primType]); + } + }; + // Block ID = 22 + AWDParser.prototype.parseContainer = function (blockID) { + var name; + var par_id; + var mtx; + var ctr; + var parent; + par_id = this._newBlockBytes.readUnsignedInt(); + mtx = this.parseMatrix3D(); + name = this.parseVarStr(); + var parentName = "Root (TopLevel)"; + ctr = new DisplayObjectContainer(); + ctr.transform.matrix3D = mtx; + var returnedArray = this.getAssetByID(par_id, [AssetType.CONTAINER, AssetType.LIGHT, AssetType.MESH]); + if (returnedArray[0]) { + var obj = returnedArray[1].addChild(ctr); + parentName = returnedArray[1].name; + } + else if (par_id > 0) { + this._blocks[blockID].addError("Could not find a parent for this ObjectContainer3D"); + } + else { + //add to the content property + this._pContent.addChild(ctr); + } + // in AWD version 2.1 we read the Container properties + if ((this._version[0] == 2) && (this._version[1] == 1)) { + var props = this.parseProperties({ 1: this._matrixNrType, 2: this._matrixNrType, 3: this._matrixNrType, 4: AWDParser.UINT8 }); + ctr.pivot = new Vector3D(props.get(1, 0), props.get(2, 0), props.get(3, 0)); + } + else { + this.parseProperties(null); + } + // the extraProperties should only be set for AWD2.1-Files, but is read for both versions + ctr.extra = this.parseUserAttributes(); + this._pFinalizeAsset(ctr, name); + this._blocks[blockID].data = ctr; + if (this._debug) { + console.log("Parsed a Container: Name = '" + name + "' | Parent-Name = " + parentName); + } + }; + // Block ID = 23 + AWDParser.prototype.parseMeshInstance = function (blockID) { + var num_materials; + var materials_parsed; + var parent; + var par_id = this._newBlockBytes.readUnsignedInt(); + var mtx = this.parseMatrix3D(); + var name = this.parseVarStr(); + var parentName = "Root (TopLevel)"; + var data_id = this._newBlockBytes.readUnsignedInt(); + var geom; + var returnedArrayGeometry = this.getAssetByID(data_id, [AssetType.GEOMETRY]); + if (returnedArrayGeometry[0]) { + geom = returnedArrayGeometry[1]; + } + else { + this._blocks[blockID].addError("Could not find a Geometry for this Mesh. A empty Geometry is created!"); + geom = new Geometry(); + } + this._blocks[blockID].geoID = data_id; + var materials = new Array(); + num_materials = this._newBlockBytes.readUnsignedShort(); + var materialNames = new Array(); + materials_parsed = 0; + var returnedArrayMaterial; + while (materials_parsed < num_materials) { + var mat_id; + mat_id = this._newBlockBytes.readUnsignedInt(); + returnedArrayMaterial = this.getAssetByID(mat_id, [AssetType.MATERIAL]); + if ((!returnedArrayMaterial[0]) && (mat_id > 0)) { + this._blocks[blockID].addError("Could not find Material Nr " + materials_parsed + " (ID = " + mat_id + " ) for this Mesh"); + } + var m = returnedArrayMaterial[1]; + materials.push(m); + materialNames.push(m.name); + materials_parsed++; + } + var mesh = new Mesh(geom, null); + mesh.transform.matrix3D = mtx; + var returnedArrayParent = this.getAssetByID(par_id, [AssetType.CONTAINER, AssetType.LIGHT, AssetType.MESH]); + if (returnedArrayParent[0]) { + var objC = returnedArrayParent[1]; + objC.addChild(mesh); + parentName = objC.name; + } + else if (par_id > 0) { + this._blocks[blockID].addError("Could not find a parent for this Mesh"); + } + else { + //add to the content property + this._pContent.addChild(mesh); + } + if (materials.length >= 1 && mesh.subMeshes.length == 1) { + mesh.material = materials[0]; + } + else if (materials.length > 1) { + var i; + for (i = 0; i < mesh.subMeshes.length; i++) { + mesh.subMeshes[i].material = materials[Math.min(materials.length - 1, i)]; + } + } + if ((this._version[0] == 2) && (this._version[1] == 1)) { + var props = this.parseProperties({ 1: this._matrixNrType, 2: this._matrixNrType, 3: this._matrixNrType, 4: AWDParser.UINT8, 5: AWDParser.BOOL }); + mesh.pivot = new Vector3D(props.get(1, 0), props.get(2, 0), props.get(3, 0)); + mesh.castsShadows = props.get(5, true); + } + else { + this.parseProperties(null); + } + mesh.extra = this.parseUserAttributes(); + this._pFinalizeAsset(mesh, name); + this._blocks[blockID].data = mesh; + if (this._debug) { + console.log("Parsed a Mesh: Name = '" + name + "' | Parent-Name = " + parentName + "| Geometry-Name = " + geom.name + " | SubMeshes = " + mesh.subMeshes.length + " | Mat-Names = " + materialNames.toString()); + } + }; + //Block ID 31 + AWDParser.prototype.parseSkyboxInstance = function (blockID) { + var name = this.parseVarStr(); + var cubeTexAddr = this._newBlockBytes.readUnsignedInt(); + var returnedArrayCubeTex = this.getAssetByID(cubeTexAddr, [AssetType.TEXTURE], "CubeTexture"); + if ((!returnedArrayCubeTex[0]) && (cubeTexAddr != 0)) + this._blocks[blockID].addError("Could not find the Cubetexture (ID = " + cubeTexAddr + " ) for this Skybox"); + var asset = new Skybox(new SkyboxMaterial(returnedArrayCubeTex[1])); + this.parseProperties(null); + asset.extra = this.parseUserAttributes(); + this._pFinalizeAsset(asset, name); + this._blocks[blockID].data = asset; + if (this._debug) + console.log("Parsed a Skybox: Name = '" + name + "' | CubeTexture-Name = " + returnedArrayCubeTex[1].name); + }; + //Block ID = 41 + AWDParser.prototype.parseLight = function (blockID) { + var light; + var newShadowMapper; + var par_id = this._newBlockBytes.readUnsignedInt(); + var mtx = this.parseMatrix3D(); + var name = this.parseVarStr(); + var lightType = this._newBlockBytes.readUnsignedByte(); + var props = this.parseProperties({ 1: this._propsNrType, 2: this._propsNrType, 3: AWDParser.COLOR, 4: this._propsNrType, 5: this._propsNrType, 6: AWDParser.BOOL, 7: AWDParser.COLOR, 8: this._propsNrType, 9: AWDParser.UINT8, 10: AWDParser.UINT8, 11: this._propsNrType, 12: AWDParser.UINT16, 21: this._matrixNrType, 22: this._matrixNrType, 23: this._matrixNrType }); + var shadowMapperType = props.get(9, 0); + var parentName = "Root (TopLevel)"; + var lightTypes = ["Unsupported LightType", "PointLight", "DirectionalLight"]; + var shadowMapperTypes = ["No ShadowMapper", "DirectionalShadowMapper", "NearDirectionalShadowMapper", "CascadeShadowMapper", "CubeMapShadowMapper"]; + if (lightType == 1) { + light = new PointLight(); + light.radius = props.get(1, 90000); + light.fallOff = props.get(2, 100000); + if (shadowMapperType > 0) { + if (shadowMapperType == 4) { + newShadowMapper = new CubeMapShadowMapper(); + } + } + light.transform.matrix3D = mtx; + } + if (lightType == 2) { + light = new DirectionalLight(props.get(21, 0), props.get(22, -1), props.get(23, 1)); + if (shadowMapperType > 0) { + if (shadowMapperType == 1) { + newShadowMapper = new DirectionalShadowMapper(); + } + } + } + light.color = props.get(3, 0xffffff); + light.specular = props.get(4, 1.0); + light.diffuse = props.get(5, 1.0); + light.ambientColor = props.get(7, 0xffffff); + light.ambient = props.get(8, 0.0); + // if a shadowMapper has been created, adjust the depthMapSize if needed, assign to light and set castShadows to true + if (newShadowMapper) { + if (newShadowMapper instanceof CubeMapShadowMapper) { + if (props.get(10, 1) != 1) { + newShadowMapper.depthMapSize = this._depthSizeDic[props.get(10, 1)]; + } + } + else { + if (props.get(10, 2) != 2) { + newShadowMapper.depthMapSize = this._depthSizeDic[props.get(10, 2)]; + } + } + light.shadowMapper = newShadowMapper; + light.castsShadows = true; + } + if (par_id != 0) { + var returnedArrayParent = this.getAssetByID(par_id, [AssetType.CONTAINER, AssetType.LIGHT, AssetType.MESH]); + if (returnedArrayParent[0]) { + returnedArrayParent[1].addChild(light); + parentName = returnedArrayParent[1].name; + } + else { + this._blocks[blockID].addError("Could not find a parent for this Light"); + } + } + else { + //add to the content property + this._pContent.addChild(light); + } + this.parseUserAttributes(); + this._pFinalizeAsset(light, name); + this._blocks[blockID].data = light; + if (this._debug) + console.log("Parsed a Light: Name = '" + name + "' | Type = " + lightTypes[lightType] + " | Parent-Name = " + parentName + " | ShadowMapper-Type = " + shadowMapperTypes[shadowMapperType]); + }; + //Block ID = 43 + AWDParser.prototype.parseCamera = function (blockID) { + var par_id = this._newBlockBytes.readUnsignedInt(); + var mtx = this.parseMatrix3D(); + var name = this.parseVarStr(); + var parentName = "Root (TopLevel)"; + var projection; + this._newBlockBytes.readUnsignedByte(); //set as active camera + this._newBlockBytes.readShort(); //lengthof lenses - not used yet + var projectiontype = this._newBlockBytes.readShort(); + var props = this.parseProperties({ 101: this._propsNrType, 102: this._propsNrType, 103: this._propsNrType, 104: this._propsNrType }); + switch (projectiontype) { + case 5001: + projection = new PerspectiveProjection(props.get(101, 60)); + break; + case 5002: + projection = new OrthographicProjection(props.get(101, 500)); + break; + case 5003: + projection = new OrthographicOffCenterProjection(props.get(101, -400), props.get(102, 400), props.get(103, -300), props.get(104, 300)); + break; + default: + console.log("unsupportedLenstype"); + return; + } + var camera = new Camera(projection); + camera.transform.matrix3D = mtx; + var returnedArrayParent = this.getAssetByID(par_id, [AssetType.CONTAINER, AssetType.LIGHT, AssetType.MESH]); + if (returnedArrayParent[0]) { + var objC = returnedArrayParent[1]; + objC.addChild(camera); + parentName = objC.name; + } + else if (par_id > 0) { + this._blocks[blockID].addError("Could not find a parent for this Camera"); + } + else { + //add to the content property + this._pContent.addChild(camera); + } + camera.name = name; + props = this.parseProperties({ 1: this._matrixNrType, 2: this._matrixNrType, 3: this._matrixNrType, 4: AWDParser.UINT8 }); + camera.pivot = new Vector3D(props.get(1, 0), props.get(2, 0), props.get(3, 0)); + camera.extra = this.parseUserAttributes(); + this._pFinalizeAsset(camera, name); + this._blocks[blockID].data = camera; + if (this._debug) { + console.log("Parsed a Camera: Name = '" + name + "' | Projectiontype = " + projection + " | Parent-Name = " + parentName); + } + }; + //Block ID = 51 + AWDParser.prototype.parseLightPicker = function (blockID) { + var name = this.parseVarStr(); + var numLights = this._newBlockBytes.readUnsignedShort(); + var lightsArray = new Array(); + var k = 0; + var lightID = 0; + var returnedArrayLight; + var lightsArrayNames = new Array(); + for (k = 0; k < numLights; k++) { + lightID = this._newBlockBytes.readUnsignedInt(); + returnedArrayLight = this.getAssetByID(lightID, [AssetType.LIGHT]); + if (returnedArrayLight[0]) { + lightsArray.push(returnedArrayLight[1]); + lightsArrayNames.push(returnedArrayLight[1].name); + } + else { + this._blocks[blockID].addError("Could not find a Light Nr " + k + " (ID = " + lightID + " ) for this LightPicker"); + } + } + if (lightsArray.length == 0) { + this._blocks[blockID].addError("Could not create this LightPicker, cause no Light was found."); + this.parseUserAttributes(); + return; //return without any more parsing for this block + } + var lightPick = new StaticLightPicker(lightsArray); + lightPick.name = name; + this.parseUserAttributes(); + this._pFinalizeAsset(lightPick, name); + this._blocks[blockID].data = lightPick; + if (this._debug) { + console.log("Parsed a StaticLightPicker: Name = '" + name + "' | Texture-Name = " + lightsArrayNames.toString()); + } + }; + //Block ID = 81 + AWDParser.prototype.parseMaterial = function (blockID) { + // TODO: not used + ////blockLength = block.len; + var name; + var type; + var props; + var mat; + var attributes; + var finalize; + var num_methods; + var methods_parsed; + var returnedArray; + name = this.parseVarStr(); + type = this._newBlockBytes.readUnsignedByte(); + num_methods = this._newBlockBytes.readUnsignedByte(); + // Read material numerical properties + // (1=color, 2=bitmap url, 10=alpha, 11=alpha_blending, 12=alpha_threshold, 13=repeat) + props = this.parseProperties({ 1: AWDParser.INT32, 2: AWDParser.BADDR, 10: this._propsNrType, 11: AWDParser.BOOL, 12: this._propsNrType, 13: AWDParser.BOOL }); + methods_parsed = 0; + while (methods_parsed < num_methods) { + var method_type; + method_type = this._newBlockBytes.readUnsignedShort(); + this.parseProperties(null); + this.parseUserAttributes(); + methods_parsed += 1; + } + var debugString = ""; + attributes = this.parseUserAttributes(); + if (type === 1) { + debugString += "Parsed a ColorMaterial(SinglePass): Name = '" + name + "' | "; + var color; + color = props.get(1, 0xffffff); + if (this.materialMode < 2) { + mat = new TriangleMethodMaterial(color, props.get(10, 1.0)); + } + else { + mat = new TriangleMethodMaterial(color); + mat.materialMode = TriangleMaterialMode.MULTI_PASS; + } + } + else if (type === 2) { + var tex_addr = props.get(2, 0); + returnedArray = this.getAssetByID(tex_addr, [AssetType.TEXTURE]); + if ((!returnedArray[0]) && (tex_addr > 0)) + this._blocks[blockID].addError("Could not find the DiffsueTexture (ID = " + tex_addr + " ) for this Material"); + mat = new TriangleMethodMaterial(returnedArray[1]); + if (this.materialMode < 2) { + mat.alphaBlending = props.get(11, false); + mat.alpha = props.get(10, 1.0); + debugString += "Parsed a TriangleMethodMaterial(SinglePass): Name = '" + name + "' | Texture-Name = " + mat.name; + } + else { + mat.materialMode = TriangleMaterialMode.MULTI_PASS; + debugString += "Parsed a TriangleMethodMaterial(MultiPass): Name = '" + name + "' | Texture-Name = " + mat.name; + } + } + mat.extra = attributes; + mat.alphaThreshold = props.get(12, 0.0); + mat.repeat = props.get(13, false); + this._pFinalizeAsset(mat, name); + this._blocks[blockID].data = mat; + if (this._debug) { + console.log(debugString); + } + }; + // Block ID = 81 AWD2.1 + AWDParser.prototype.parseMaterial_v1 = function (blockID) { + var mat; + var normalTexture; + var specTexture; + var returnedArray; + var name = this.parseVarStr(); + var type = this._newBlockBytes.readUnsignedByte(); + var num_methods = this._newBlockBytes.readUnsignedByte(); + var props = this.parseProperties({ 1: AWDParser.UINT32, 2: AWDParser.BADDR, 3: AWDParser.BADDR, 4: AWDParser.UINT8, 5: AWDParser.BOOL, 6: AWDParser.BOOL, 7: AWDParser.BOOL, 8: AWDParser.BOOL, 9: AWDParser.UINT8, 10: this._propsNrType, 11: AWDParser.BOOL, 12: this._propsNrType, 13: AWDParser.BOOL, 15: this._propsNrType, 16: AWDParser.UINT32, 17: AWDParser.BADDR, 18: this._propsNrType, 19: this._propsNrType, 20: AWDParser.UINT32, 21: AWDParser.BADDR, 22: AWDParser.BADDR }); + var spezialType = props.get(4, 0); + var debugString = ""; + if (spezialType >= 2) { + this._blocks[blockID].addError("Material-spezialType '" + spezialType + "' is not supported, can only be 0:singlePass, 1:MultiPass !"); + return; + } + if (this.materialMode == 1) + spezialType = 0; + else if (this.materialMode == 2) + spezialType = 1; + if (spezialType < 2) { + if (type == 1) { + var color = props.get(1, 0xcccccc); //TODO temporarily swapped so that diffuse color goes to ambient + if (spezialType == 1) { + mat = new TriangleMethodMaterial(color); + mat.materialMode = TriangleMaterialMode.MULTI_PASS; + debugString += "Parsed a ColorMaterial(MultiPass): Name = '" + name + "' | "; + } + else { + mat = new TriangleMethodMaterial(color, props.get(10, 1.0)); + mat.alphaBlending = props.get(11, false); + debugString += "Parsed a ColorMaterial(SinglePass): Name = '" + name + "' | "; + } + } + else if (type == 2) { + var tex_addr = props.get(2, 0); //TODO temporarily swapped so that diffuse texture goes to ambient + returnedArray = this.getAssetByID(tex_addr, [AssetType.TEXTURE]); + if ((!returnedArray[0]) && (tex_addr > 0)) + this._blocks[blockID].addError("Could not find the AmbientTexture (ID = " + tex_addr + " ) for this TriangleMethodMaterial"); + var texture = returnedArray[1]; + mat = new TriangleMethodMaterial(texture); + if (spezialType == 1) { + mat.materialMode = TriangleMaterialMode.MULTI_PASS; + debugString += "Parsed a TriangleMethodMaterial(MultiPass): Name = '" + name + "' | Texture-Name = " + texture.name; + } + else { + mat.alpha = props.get(10, 1.0); + mat.alphaBlending = props.get(11, false); + debugString += "Parsed a TriangleMethodMaterial(SinglePass): Name = '" + name + "' | Texture-Name = " + texture.name; + } + } + var diffuseTexture; + var diffuseTex_addr = props.get(17, 0); + returnedArray = this.getAssetByID(diffuseTex_addr, [AssetType.TEXTURE]); + if ((!returnedArray[0]) && (diffuseTex_addr != 0)) { + this._blocks[blockID].addError("Could not find the DiffuseTexture (ID = " + diffuseTex_addr + " ) for this TriangleMethodMaterial"); + } + if (returnedArray[0]) + diffuseTexture = returnedArray[1]; + if (diffuseTexture) { + mat.diffuseTexture = diffuseTexture; + debugString += " | DiffuseTexture-Name = " + diffuseTexture.name; + } + var normalTex_addr = props.get(3, 0); + returnedArray = this.getAssetByID(normalTex_addr, [AssetType.TEXTURE]); + if ((!returnedArray[0]) && (normalTex_addr != 0)) { + this._blocks[blockID].addError("Could not find the NormalTexture (ID = " + normalTex_addr + " ) for this TriangleMethodMaterial"); + } + if (returnedArray[0]) { + normalTexture = returnedArray[1]; + debugString += " | NormalTexture-Name = " + normalTexture.name; + } + var specTex_addr = props.get(21, 0); + returnedArray = this.getAssetByID(specTex_addr, [AssetType.TEXTURE]); + if ((!returnedArray[0]) && (specTex_addr != 0)) { + this._blocks[blockID].addError("Could not find the SpecularTexture (ID = " + specTex_addr + " ) for this TriangleMethodMaterial"); + } + if (returnedArray[0]) { + specTexture = returnedArray[1]; + debugString += " | SpecularTexture-Name = " + specTexture.name; + } + var lightPickerAddr = props.get(22, 0); + returnedArray = this.getAssetByID(lightPickerAddr, [AssetType.LIGHT_PICKER]); + if ((!returnedArray[0]) && (lightPickerAddr)) { + this._blocks[blockID].addError("Could not find the LightPicker (ID = " + lightPickerAddr + " ) for this TriangleMethodMaterial"); + } + else { + mat.lightPicker = returnedArray[1]; + } + mat.smooth = props.get(5, true); + mat.mipmap = props.get(6, true); + mat.bothSides = props.get(7, false); + mat.alphaPremultiplied = props.get(8, false); + mat.blendMode = this.blendModeDic[props.get(9, 0)]; + mat.repeat = props.get(13, false); + if (normalTexture) + mat.normalMap = normalTexture; + if (specTexture) + mat.specularMap = specTexture; + mat.alphaThreshold = props.get(12, 0.0); + mat.ambient = props.get(15, 1.0); + mat.diffuseColor = props.get(16, 0xffffff); + mat.specular = props.get(18, 1.0); + mat.gloss = props.get(19, 50); + mat.specularColor = props.get(20, 0xffffff); + var methods_parsed = 0; + var targetID; + while (methods_parsed < num_methods) { + var method_type; + method_type = this._newBlockBytes.readUnsignedShort(); + props = this.parseProperties({ 1: AWDParser.BADDR, 2: AWDParser.BADDR, 3: AWDParser.BADDR, 101: this._propsNrType, 102: this._propsNrType, 103: this._propsNrType, 201: AWDParser.UINT32, 202: AWDParser.UINT32, 301: AWDParser.UINT16, 302: AWDParser.UINT16, 401: AWDParser.UINT8, 402: AWDParser.UINT8, 601: AWDParser.COLOR, 602: AWDParser.COLOR, 701: AWDParser.BOOL, 702: AWDParser.BOOL, 801: AWDParser.MTX4x4 }); + switch (method_type) { + case 999: + targetID = props.get(1, 0); + returnedArray = this.getAssetByID(targetID, [AssetType.EFFECTS_METHOD]); + if (!returnedArray[0]) { + this._blocks[blockID].addError("Could not find the EffectMethod (ID = " + targetID + " ) for this Material"); + } + else { + mat.addEffectMethod(returnedArray[1]); + debugString += " | EffectMethod-Name = " + returnedArray[1].name; + } + break; + case 998: + targetID = props.get(1, 0); + returnedArray = this.getAssetByID(targetID, [AssetType.SHADOW_MAP_METHOD]); + if (!returnedArray[0]) { + this._blocks[blockID].addError("Could not find the ShadowMethod (ID = " + targetID + " ) for this Material"); + } + else { + mat.shadowMethod = returnedArray[1]; + debugString += " | ShadowMethod-Name = " + returnedArray[1].name; + } + break; + case 1: + targetID = props.get(1, 0); + returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE], "CubeTexture"); + if (!returnedArray[0]) + this._blocks[blockID].addError("Could not find the EnvMap (ID = " + targetID + " ) for this EnvMapAmbientMethodMaterial"); + mat.ambientMethod = new AmbientEnvMapMethod(returnedArray[1]); + debugString += " | AmbientEnvMapMethod | EnvMap-Name =" + returnedArray[1].name; + break; + case 51: + mat.diffuseMethod = new DiffuseDepthMethod(); + debugString += " | DiffuseDepthMethod"; + break; + case 52: + targetID = props.get(1, 0); + returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]); + if (!returnedArray[0]) + this._blocks[blockID].addError("Could not find the GradientDiffuseTexture (ID = " + targetID + " ) for this GradientDiffuseMethod"); + mat.diffuseMethod = new DiffuseGradientMethod(returnedArray[1]); + debugString += " | DiffuseGradientMethod | GradientDiffuseTexture-Name =" + returnedArray[1].name; + break; + case 53: + mat.diffuseMethod = new DiffuseWrapMethod(props.get(101, 5)); + debugString += " | DiffuseWrapMethod"; + break; + case 54: + targetID = props.get(1, 0); + returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]); + if (!returnedArray[0]) + this._blocks[blockID].addError("Could not find the LightMap (ID = " + targetID + " ) for this LightMapDiffuseMethod"); + mat.diffuseMethod = new DiffuseLightMapMethod(returnedArray[1], this.blendModeDic[props.get(401, 10)], false, mat.diffuseMethod); + debugString += " | DiffuseLightMapMethod | LightMapTexture-Name =" + returnedArray[1].name; + break; + case 55: + mat.diffuseMethod = new DiffuseCelMethod(props.get(401, 3), mat.diffuseMethod); + mat.diffuseMethod.smoothness = props.get(101, 0.1); + debugString += " | DiffuseCelMethod"; + break; + case 56: + break; + case 101: + mat.specularMethod = new SpecularAnisotropicMethod(); + debugString += " | SpecularAnisotropicMethod"; + break; + case 102: + mat.specularMethod = new SpecularPhongMethod(); + debugString += " | SpecularPhongMethod"; + break; + case 103: + mat.specularMethod = new SpecularCelMethod(props.get(101, 0.5), mat.specularMethod); + mat.specularMethod.smoothness = props.get(102, 0.1); + debugString += " | SpecularCelMethod"; + break; + case 104: + mat.specularMethod = new SpecularFresnelMethod(props.get(701, true), mat.specularMethod); + mat.specularMethod.fresnelPower = props.get(101, 5); + mat.specularMethod.normalReflectance = props.get(102, 0.1); + debugString += " | SpecularFresnelMethod"; + break; + case 151: + break; + case 152: + targetID = props.get(1, 0); + returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]); + if (!returnedArray[0]) + this._blocks[blockID].addError("Could not find the SecoundNormalMap (ID = " + targetID + " ) for this SimpleWaterNormalMethod"); + if (!mat.normalMap) + this._blocks[blockID].addError("Could not find a normal Map on this Material to use with this SimpleWaterNormalMethod"); + mat.normalMap = returnedArray[1]; + mat.normalMethod = new NormalSimpleWaterMethod(mat.normalMap, returnedArray[1]); + debugString += " | NormalSimpleWaterMethod | Second-NormalTexture-Name = " + returnedArray[1].name; + break; + } + this.parseUserAttributes(); + methods_parsed += 1; + } + } + mat.extra = this.parseUserAttributes(); + this._pFinalizeAsset(mat, name); + this._blocks[blockID].data = mat; + if (this._debug) { + console.log(debugString); + } + }; + //Block ID = 82 + AWDParser.prototype.parseTexture = function (blockID) { + var asset; + this._blocks[blockID].name = this.parseVarStr(); + var type = this._newBlockBytes.readUnsignedByte(); + var data_len; + this._texture_users[this._cur_block_id.toString()] = []; + // External + if (type == 0) { + data_len = this._newBlockBytes.readUnsignedInt(); + var url; + url = this._newBlockBytes.readUTFBytes(data_len); + this._pAddDependency(this._cur_block_id.toString(), new URLRequest(url), false, null, true); + } + else { + data_len = this._newBlockBytes.readUnsignedInt(); + var data; + data = new ByteArray(); + this._newBlockBytes.readBytes(data, 0, data_len); + // + // AWDParser - Fix for FireFox Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=715075 . + // + // Converting data to image here instead of parser - fix FireFox bug where image width / height is 0 when created from data + // This gives the browser time to initialise image width / height. + this._pAddDependency(this._cur_block_id.toString(), null, false, ParserUtils.byteArrayToImage(data), true); + } + // Ignore for now + this.parseProperties(null); + this._blocks[blockID].extras = this.parseUserAttributes(); + this._pPauseAndRetrieveDependencies(); + this._blocks[blockID].data = asset; + if (this._debug) { + var textureStylesNames = ["external", "embed"]; + console.log("Start parsing a " + textureStylesNames[type] + " Bitmap for Texture"); + } + }; + //Block ID = 83 + AWDParser.prototype.parseCubeTexture = function (blockID) { + //blockLength = block.len; + var data_len; + var asset; + var i; + this._cubeTextures = new Array(); + this._texture_users[this._cur_block_id.toString()] = []; + var type = this._newBlockBytes.readUnsignedByte(); + this._blocks[blockID].name = this.parseVarStr(); + for (i = 0; i < 6; i++) { + this._texture_users[this._cur_block_id.toString()] = []; + this._cubeTextures.push(null); + // External + if (type == 0) { + data_len = this._newBlockBytes.readUnsignedInt(); + var url; + url = this._newBlockBytes.readUTFBytes(data_len); + this._pAddDependency(this._cur_block_id.toString() + "#" + i, new URLRequest(url), false, null, true); + } + else { + data_len = this._newBlockBytes.readUnsignedInt(); + var data; + data = new ByteArray(); + this._newBlockBytes.readBytes(data, 0, data_len); + this._pAddDependency(this._cur_block_id.toString() + "#" + i, null, false, ParserUtils.byteArrayToImage(data), true); + } + } + // Ignore for now + this.parseProperties(null); + this._blocks[blockID].extras = this.parseUserAttributes(); + this._pPauseAndRetrieveDependencies(); + this._blocks[blockID].data = asset; + if (this._debug) { + var textureStylesNames = ["external", "embed"]; + console.log("Start parsing 6 " + textureStylesNames[type] + " Bitmaps for CubeTexture"); + } + }; + //Block ID = 91 + AWDParser.prototype.parseSharedMethodBlock = function (blockID) { + var asset; + this._blocks[blockID].name = this.parseVarStr(); + asset = this.parseSharedMethodList(blockID); + this.parseUserAttributes(); + this._blocks[blockID].data = asset; + this._pFinalizeAsset(asset, this._blocks[blockID].name); + this._blocks[blockID].data = asset; + if (this._debug) { + console.log("Parsed a EffectMethod: Name = " + asset.name + " Type = " + asset); + } + }; + //Block ID = 92 + AWDParser.prototype.parseShadowMethodBlock = function (blockID) { + var type; + var data_len; + var asset; + var shadowLightID; + this._blocks[blockID].name = this.parseVarStr(); + shadowLightID = this._newBlockBytes.readUnsignedInt(); + var returnedArray = this.getAssetByID(shadowLightID, [AssetType.LIGHT]); + if (!returnedArray[0]) { + this._blocks[blockID].addError("Could not find the TargetLight (ID = " + shadowLightID + " ) for this ShadowMethod - ShadowMethod not created"); + return; + } + asset = this.parseShadowMethodList(returnedArray[1], blockID); + if (!asset) + return; + this.parseUserAttributes(); // Ignore for now + this._pFinalizeAsset(asset, this._blocks[blockID].name); + this._blocks[blockID].data = asset; + if (this._debug) { + console.log("Parsed a ShadowMapMethodMethod: Name = " + asset.name + " | Type = " + asset + " | Light-Name = ", returnedArray[1].name); + } + }; + //Block ID = 253 + AWDParser.prototype.parseCommand = function (blockID) { + var hasBlocks = (this._newBlockBytes.readUnsignedByte() == 1); + var par_id = this._newBlockBytes.readUnsignedInt(); + var mtx = this.parseMatrix3D(); + var name = this.parseVarStr(); + var parentObject; + var targetObject; + var returnedArray = this.getAssetByID(par_id, [AssetType.CONTAINER, AssetType.LIGHT, AssetType.MESH]); + if (returnedArray[0]) { + parentObject = returnedArray[1]; + } + var numCommands = this._newBlockBytes.readShort(); + var typeCommand = this._newBlockBytes.readShort(); + var props = this.parseProperties({ 1: AWDParser.BADDR }); + switch (typeCommand) { + case 1: + var targetID = props.get(1, 0); + var returnedArrayTarget = this.getAssetByID(targetID, [AssetType.LIGHT, AssetType.TEXTURE_PROJECTOR]); //for no only light is requested!!!! + if ((!returnedArrayTarget[0]) && (targetID != 0)) { + this._blocks[blockID].addError("Could not find the light (ID = " + targetID + " ( for this CommandBock!"); + return; + } + targetObject = returnedArrayTarget[1]; + if (parentObject) { + parentObject.addChild(targetObject); + } + targetObject.transform.matrix3D = mtx; + break; + } + if (targetObject) { + props = this.parseProperties({ 1: this._matrixNrType, 2: this._matrixNrType, 3: this._matrixNrType, 4: AWDParser.UINT8 }); + targetObject.pivot = new Vector3D(props.get(1, 0), props.get(2, 0), props.get(3, 0)); + targetObject.extra = this.parseUserAttributes(); + } + this._blocks[blockID].data = targetObject; + if (this._debug) { + console.log("Parsed a CommandBlock: Name = '" + name); + } + }; + //blockID 255 + AWDParser.prototype.parseMetaData = function (blockID) { + var props = this.parseProperties({ 1: AWDParser.UINT32, 2: AWDParser.AWDSTRING, 3: AWDParser.AWDSTRING, 4: AWDParser.AWDSTRING, 5: AWDParser.AWDSTRING }); + if (this._debug) { + console.log("Parsed a MetaDataBlock: TimeStamp = " + props.get(1, 0)); + console.log(" EncoderName = " + props.get(2, "unknown")); + console.log(" EncoderVersion = " + props.get(3, "unknown")); + console.log(" GeneratorName = " + props.get(4, "unknown")); + console.log(" GeneratorVersion = " + props.get(5, "unknown")); + } + }; + //blockID 254 + AWDParser.prototype.parseNameSpace = function (blockID) { + var id = this._newBlockBytes.readUnsignedByte(); + var nameSpaceString = this.parseVarStr(); + if (this._debug) + console.log("Parsed a NameSpaceBlock: ID = " + id + " | String = " + nameSpaceString); + }; + //--Parser UTILS--------------------------------------------------------------------------- + // this functions reads and creates a ShadowMethodMethod + AWDParser.prototype.parseShadowMethodList = function (light, blockID) { + var methodType = this._newBlockBytes.readUnsignedShort(); + var shadowMethod; + var props = this.parseProperties({ 1: AWDParser.BADDR, 2: AWDParser.BADDR, 3: AWDParser.BADDR, 101: this._propsNrType, 102: this._propsNrType, 103: this._propsNrType, 201: AWDParser.UINT32, 202: AWDParser.UINT32, 301: AWDParser.UINT16, 302: AWDParser.UINT16, 401: AWDParser.UINT8, 402: AWDParser.UINT8, 601: AWDParser.COLOR, 602: AWDParser.COLOR, 701: AWDParser.BOOL, 702: AWDParser.BOOL, 801: AWDParser.MTX4x4 }); + var targetID; + var returnedArray; + switch (methodType) { + case 1002: + targetID = props.get(1, 0); + returnedArray = this.getAssetByID(targetID, [AssetType.SHADOW_MAP_METHOD]); + if (!returnedArray[0]) { + this._blocks[blockID].addError("Could not find the ShadowBaseMethod (ID = " + targetID + " ) for this ShadowNearMethod - ShadowMethod not created"); + return shadowMethod; + } + shadowMethod = new ShadowNearMethod(returnedArray[1]); + break; + case 1101: + shadowMethod = new ShadowFilteredMethod(light); + shadowMethod.alpha = props.get(101, 1); + shadowMethod.epsilon = props.get(102, 0.002); + break; + case 1102: + shadowMethod = new ShadowDitheredMethod(light, props.get(201, 5)); + shadowMethod.alpha = props.get(101, 1); + shadowMethod.epsilon = props.get(102, 0.002); + shadowMethod.range = props.get(103, 1); + break; + case 1103: + shadowMethod = new ShadowSoftMethod(light, props.get(201, 5)); + shadowMethod.alpha = props.get(101, 1); + shadowMethod.epsilon = props.get(102, 0.002); + shadowMethod.range = props.get(103, 1); + break; + case 1104: + shadowMethod = new ShadowHardMethod(light); + shadowMethod.alpha = props.get(101, 1); + shadowMethod.epsilon = props.get(102, 0.002); + break; + } + this.parseUserAttributes(); + return shadowMethod; + }; + //Block ID 101 + AWDParser.prototype.parseSkeleton = function (blockID /*uint*/) { + var name = this.parseVarStr(); + var num_joints = this._newBlockBytes.readUnsignedShort(); + var skeleton = new Skeleton(); + this.parseProperties(null); // Discard properties for now + var joints_parsed = 0; + while (joints_parsed < num_joints) { + var joint; + var ibp; + // Ignore joint id + this._newBlockBytes.readUnsignedShort(); + joint = new SkeletonJoint(); + joint.parentIndex = this._newBlockBytes.readUnsignedShort() - 1; // 0=null in AWD + joint.name = this.parseVarStr(); + ibp = this.parseMatrix3D(); + joint.inverseBindPose = ibp.rawData; + // Ignore joint props/attributes for now + this.parseProperties(null); + this.parseUserAttributes(); + skeleton.joints.push(joint); + joints_parsed++; + } + // Discard attributes for now + this.parseUserAttributes(); + this._pFinalizeAsset(skeleton, name); + this._blocks[blockID].data = skeleton; + if (this._debug) + console.log("Parsed a Skeleton: Name = " + skeleton.name + " | Number of Joints = " + joints_parsed); + }; + //Block ID = 102 + AWDParser.prototype.parseSkeletonPose = function (blockID /*uint*/) { + var name = this.parseVarStr(); + var num_joints = this._newBlockBytes.readUnsignedShort(); + this.parseProperties(null); // Ignore properties for now + var pose = new SkeletonPose(); + var joints_parsed = 0; + while (joints_parsed < num_joints) { + var joint_pose; + var has_transform /*uint*/; + joint_pose = new JointPose(); + has_transform = this._newBlockBytes.readUnsignedByte(); + if (has_transform == 1) { + var mtx_data = this.parseMatrix43RawData(); + var mtx = new Matrix3D(mtx_data); + joint_pose.orientation.fromMatrix(mtx); + joint_pose.translation.copyFrom(mtx.position); + pose.jointPoses[joints_parsed] = joint_pose; + } + joints_parsed++; + } + // Skip attributes for now + this.parseUserAttributes(); + this._pFinalizeAsset(pose, name); + this._blocks[blockID].data = pose; + if (this._debug) + console.log("Parsed a SkeletonPose: Name = " + pose.name + " | Number of Joints = " + joints_parsed); + }; + //blockID 103 + AWDParser.prototype.parseSkeletonAnimation = function (blockID /*uint*/) { + var frame_dur; + var pose_addr /*uint*/; + var name = this.parseVarStr(); + var clip = new SkeletonClipNode(); + var num_frames = this._newBlockBytes.readUnsignedShort(); + this.parseProperties(null); // Ignore properties for now + var frames_parsed = 0; + var returnedArray; + while (frames_parsed < num_frames) { + pose_addr = this._newBlockBytes.readUnsignedInt(); + frame_dur = this._newBlockBytes.readUnsignedShort(); + returnedArray = this.getAssetByID(pose_addr, [AssetType.SKELETON_POSE]); + if (!returnedArray[0]) + this._blocks[blockID].addError("Could not find the SkeletonPose Frame # " + frames_parsed + " (ID = " + pose_addr + " ) for this SkeletonClipNode"); + else + clip.addFrame(this._blocks[pose_addr].data, frame_dur); + frames_parsed++; + } + if (clip.frames.length == 0) { + this._blocks[blockID].addError("Could not this SkeletonClipNode, because no Frames where set."); + return; + } + // Ignore attributes for now + this.parseUserAttributes(); + this._pFinalizeAsset(clip, name); + this._blocks[blockID].data = clip; + if (this._debug) + console.log("Parsed a SkeletonClipNode: Name = " + clip.name + " | Number of Frames = " + clip.frames.length); + }; + //Block ID = 111 / Block ID = 112 + AWDParser.prototype.parseMeshPoseAnimation = function (blockID /*uint*/, poseOnly) { + if (poseOnly === void 0) { poseOnly = false; } + var num_frames = 1; + var num_submeshes /*uint*/; + var frames_parsed /*uint*/; + var subMeshParsed /*uint*/; + var frame_dur; + var x; + var y; + var z; + var str_len; + var str_end; + var geometry; + var subGeom; + var idx = 0; + var clip = new VertexClipNode(); + var indices /*uint*/; + var verts; + var num_Streams = 0; + var streamsParsed = 0; + var streamtypes = new Array() /*int*/; + var props; + var thisGeo; + var name = this.parseVarStr(); + var geoAdress = this._newBlockBytes.readUnsignedInt(); + var returnedArray = this.getAssetByID(geoAdress, [AssetType.GEOMETRY]); + if (!returnedArray[0]) { + this._blocks[blockID].addError("Could not find the target-Geometry-Object " + geoAdress + " ) for this VertexClipNode"); + return; + } + var uvs = this.getUVForVertexAnimation(geoAdress); + if (!poseOnly) + num_frames = this._newBlockBytes.readUnsignedShort(); + num_submeshes = this._newBlockBytes.readUnsignedShort(); + num_Streams = this._newBlockBytes.readUnsignedShort(); + streamsParsed = 0; + while (streamsParsed < num_Streams) { + streamtypes.push(this._newBlockBytes.readUnsignedShort()); + streamsParsed++; + } + props = this.parseProperties({ 1: AWDParser.BOOL, 2: AWDParser.BOOL }); + clip.looping = props.get(1, true); + clip.stitchFinalFrame = props.get(2, false); + frames_parsed = 0; + while (frames_parsed < num_frames) { + frame_dur = this._newBlockBytes.readUnsignedShort(); + geometry = new Geometry(); + subMeshParsed = 0; + while (subMeshParsed < num_submeshes) { + streamsParsed = 0; + str_len = this._newBlockBytes.readUnsignedInt(); + str_end = this._newBlockBytes.position + str_len; + while (streamsParsed < num_Streams) { + if (streamtypes[streamsParsed] == 1) { + indices = returnedArray[1].subGeometries[subMeshParsed].indices; + verts = new Array(); + idx = 0; + while (this._newBlockBytes.position < str_end) { + x = this.readNumber(this._accuracyGeo); + y = this.readNumber(this._accuracyGeo); + z = this.readNumber(this._accuracyGeo); + verts[idx++] = x; + verts[idx++] = y; + verts[idx++] = z; + } + subGeom = new TriangleSubGeometry(true); + subGeom.updateIndices(indices); + subGeom.updatePositions(verts); + subGeom.updateUVs(uvs[subMeshParsed]); + subGeom.updateVertexNormals(null); + subGeom.updateVertexTangents(null); + subGeom.autoDeriveNormals = false; + subGeom.autoDeriveTangents = false; + subMeshParsed++; + geometry.addSubGeometry(subGeom); + } + else + this._newBlockBytes.position = str_end; + streamsParsed++; + } + } + clip.addFrame(geometry, frame_dur); + frames_parsed++; + } + this.parseUserAttributes(); + this._pFinalizeAsset(clip, name); + this._blocks[blockID].data = clip; + if (this._debug) + console.log("Parsed a VertexClipNode: Name = " + clip.name + " | Target-Geometry-Name = " + returnedArray[1].name + " | Number of Frames = " + clip.frames.length); + }; + //BlockID 113 + AWDParser.prototype.parseVertexAnimationSet = function (blockID /*uint*/) { + var poseBlockAdress; /*int*/ + var outputString = ""; + var name = this.parseVarStr(); + var num_frames = this._newBlockBytes.readUnsignedShort(); + var props = this.parseProperties({ 1: AWDParser.UINT16 }); + var frames_parsed = 0; + var skeletonFrames = new Array(); + var vertexFrames = new Array(); + while (frames_parsed < num_frames) { + poseBlockAdress = this._newBlockBytes.readUnsignedInt(); + var returnedArray = this.getAssetByID(poseBlockAdress, [AssetType.ANIMATION_NODE]); + if (!returnedArray[0]) + this._blocks[blockID].addError("Could not find the AnimationClipNode Nr " + frames_parsed + " ( " + poseBlockAdress + " ) for this AnimationSet"); + else { + if (returnedArray[1] instanceof VertexClipNode) + vertexFrames.push(returnedArray[1]); + if (returnedArray[1] instanceof SkeletonClipNode) + skeletonFrames.push(returnedArray[1]); + } + frames_parsed++; + } + if ((vertexFrames.length == 0) && (skeletonFrames.length == 0)) { + this._blocks[blockID].addError("Could not create this AnimationSet, because it contains no animations"); + return; + } + this.parseUserAttributes(); + if (vertexFrames.length > 0) { + var newVertexAnimationSet = new VertexAnimationSet(); + for (var i = 0; i < vertexFrames.length; i++) + newVertexAnimationSet.addAnimation(vertexFrames[i]); + this._pFinalizeAsset(newVertexAnimationSet, name); + this._blocks[blockID].data = newVertexAnimationSet; + if (this._debug) + console.log("Parsed a VertexAnimationSet: Name = " + name + " | Animations = " + newVertexAnimationSet.animations.length + " | Animation-Names = " + newVertexAnimationSet.animationNames.toString()); + } + else if (skeletonFrames.length > 0) { + returnedArray = this.getAssetByID(poseBlockAdress, [AssetType.ANIMATION_NODE]); + var newSkeletonAnimationSet = new SkeletonAnimationSet(props.get(1, 4)); //props.get(1,4)); + for (var i = 0; i < skeletonFrames.length; i++) + newSkeletonAnimationSet.addAnimation(skeletonFrames[i]); + this._pFinalizeAsset(newSkeletonAnimationSet, name); + this._blocks[blockID].data = newSkeletonAnimationSet; + if (this._debug) + console.log("Parsed a SkeletonAnimationSet: Name = " + name + " | Animations = " + newSkeletonAnimationSet.animations.length + " | Animation-Names = " + newSkeletonAnimationSet.animationNames.toString()); + } + }; + //BlockID 122 + AWDParser.prototype.parseAnimatorSet = function (blockID /*uint*/) { + var targetMesh; + var animSetBlockAdress; /*int*/ + var targetAnimationSet; + var outputString = ""; + var name = this.parseVarStr(); + var type = this._newBlockBytes.readUnsignedShort(); + var props = this.parseProperties({ 1: AWDParser.BADDR }); + animSetBlockAdress = this._newBlockBytes.readUnsignedInt(); + var targetMeshLength = this._newBlockBytes.readUnsignedShort(); + var meshAdresses = new Array() /*uint*/; + for (var i = 0; i < targetMeshLength; i++) + meshAdresses.push(this._newBlockBytes.readUnsignedInt()); + var activeState = this._newBlockBytes.readUnsignedShort(); + var autoplay = (this._newBlockBytes.readUnsignedByte() == 1); + this.parseUserAttributes(); + this.parseUserAttributes(); + var returnedArray; + var targetMeshes = new Array(); + for (i = 0; i < meshAdresses.length; i++) { + returnedArray = this.getAssetByID(meshAdresses[i], [AssetType.MESH]); + if (returnedArray[0]) + targetMeshes.push(returnedArray[1]); + } + returnedArray = this.getAssetByID(animSetBlockAdress, [AssetType.ANIMATION_SET]); + if (!returnedArray[0]) { + this._blocks[blockID].addError("Could not find the AnimationSet ( " + animSetBlockAdress + " ) for this Animator"); + ; + return; + } + targetAnimationSet = returnedArray[1]; + var thisAnimator; + if (type == 1) { + returnedArray = this.getAssetByID(props.get(1, 0), [AssetType.SKELETON]); + if (!returnedArray[0]) { + this._blocks[blockID].addError("Could not find the Skeleton ( " + props.get(1, 0) + " ) for this Animator"); + return; + } + thisAnimator = new SkeletonAnimator(targetAnimationSet, returnedArray[1]); + } + else if (type == 2) + thisAnimator = new VertexAnimator(targetAnimationSet); + this._pFinalizeAsset(thisAnimator, name); + this._blocks[blockID].data = thisAnimator; + for (i = 0; i < targetMeshes.length; i++) { + if (type == 1) + targetMeshes[i].animator = thisAnimator; + if (type == 2) + targetMeshes[i].animator = thisAnimator; + } + if (this._debug) + console.log("Parsed a Animator: Name = " + name); + }; + // this functions reads and creates a EffectMethod + AWDParser.prototype.parseSharedMethodList = function (blockID) { + var methodType = this._newBlockBytes.readUnsignedShort(); + var effectMethodReturn; + var props = this.parseProperties({ 1: AWDParser.BADDR, 2: AWDParser.BADDR, 3: AWDParser.BADDR, 101: this._propsNrType, 102: this._propsNrType, 103: this._propsNrType, 104: this._propsNrType, 105: this._propsNrType, 106: this._propsNrType, 107: this._propsNrType, 201: AWDParser.UINT32, 202: AWDParser.UINT32, 301: AWDParser.UINT16, 302: AWDParser.UINT16, 401: AWDParser.UINT8, 402: AWDParser.UINT8, 601: AWDParser.COLOR, 602: AWDParser.COLOR, 701: AWDParser.BOOL, 702: AWDParser.BOOL }); + var targetID; + var returnedArray; + switch (methodType) { + case 401: + effectMethodReturn = new EffectColorMatrixMethod(props.get(101, new Array(0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1))); + break; + case 402: + effectMethodReturn = new EffectColorTransformMethod(); + var offCol = props.get(601, 0x00000000); + effectMethodReturn.colorTransform = new ColorTransform(props.get(102, 1), props.get(103, 1), props.get(104, 1), props.get(101, 1), ((offCol >> 16) & 0xFF), ((offCol >> 8) & 0xFF), (offCol & 0xFF), ((offCol >> 24) & 0xFF)); + break; + case 403: + targetID = props.get(1, 0); + console.log('ENV MAP', targetID); + returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE], "CubeTexture"); + if (!returnedArray[0]) + this._blocks[blockID].addError("Could not find the EnvMap (ID = " + targetID + " ) for this EnvMapMethod"); + effectMethodReturn = new EffectEnvMapMethod(returnedArray[1], props.get(101, 1)); + targetID = props.get(2, 0); + if (targetID > 0) { + returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]); + if (!returnedArray[0]) + this._blocks[blockID].addError("Could not find the Mask-texture (ID = " + targetID + " ) for this EnvMapMethod"); + } + break; + case 404: + targetID = props.get(1, 0); + returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]); + if (!returnedArray[0]) + this._blocks[blockID].addError("Could not find the LightMap (ID = " + targetID + " ) for this LightMapMethod"); + effectMethodReturn = new EffectLightMapMethod(returnedArray[1], this.blendModeDic[props.get(401, 10)]); //usesecondaryUV not set + break; + case 406: + effectMethodReturn = new EffectRimLightMethod(props.get(601, 0xffffff), props.get(101, 0.4), props.get(101, 2)); //blendMode + break; + case 407: + targetID = props.get(1, 0); + returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]); + if (!returnedArray[0]) + this._blocks[blockID].addError("Could not find the Alpha-texture (ID = " + targetID + " ) for this AlphaMaskMethod"); + effectMethodReturn = new EffectAlphaMaskMethod(returnedArray[1], props.get(701, false)); + break; + case 410: + targetID = props.get(1, 0); + returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE], "CubeTexture"); + if (!returnedArray[0]) + this._blocks[blockID].addError("Could not find the EnvMap (ID = " + targetID + " ) for this FresnelEnvMapMethod"); + effectMethodReturn = new EffectFresnelEnvMapMethod(returnedArray[1], props.get(101, 1)); + break; + case 411: + effectMethodReturn = new EffectFogMethod(props.get(101, 0), props.get(102, 1000), props.get(601, 0x808080)); + break; + } + this.parseUserAttributes(); + return effectMethodReturn; + }; + AWDParser.prototype.parseUserAttributes = function () { + var attributes; + var list_len; + var attibuteCnt; + list_len = this._newBlockBytes.readUnsignedInt(); + if (list_len > 0) { + var list_end; + attributes = {}; + list_end = this._newBlockBytes.position + list_len; + while (this._newBlockBytes.position < list_end) { + var ns_id; + var attr_key; + var attr_type; + var attr_len; + var attr_val; + // TODO: Properly tend to namespaces in attributes + ns_id = this._newBlockBytes.readUnsignedByte(); + attr_key = this.parseVarStr(); + attr_type = this._newBlockBytes.readUnsignedByte(); + attr_len = this._newBlockBytes.readUnsignedInt(); + if ((this._newBlockBytes.position + attr_len) > list_end) { + console.log(" Error in reading attribute # " + attibuteCnt + " = skipped to end of attribute-list"); + this._newBlockBytes.position = list_end; + return attributes; + } + switch (attr_type) { + case AWDParser.AWDSTRING: + attr_val = this._newBlockBytes.readUTFBytes(attr_len); + break; + case AWDParser.INT8: + attr_val = this._newBlockBytes.readByte(); + break; + case AWDParser.INT16: + attr_val = this._newBlockBytes.readShort(); + break; + case AWDParser.INT32: + attr_val = this._newBlockBytes.readInt(); + break; + case AWDParser.BOOL: + case AWDParser.UINT8: + attr_val = this._newBlockBytes.readUnsignedByte(); + break; + case AWDParser.UINT16: + attr_val = this._newBlockBytes.readUnsignedShort(); + break; + case AWDParser.UINT32: + case AWDParser.BADDR: + attr_val = this._newBlockBytes.readUnsignedInt(); + break; + case AWDParser.FLOAT32: + attr_val = this._newBlockBytes.readFloat(); + break; + case AWDParser.FLOAT64: + attr_val = this._newBlockBytes.readDouble(); + break; + default: + attr_val = 'unimplemented attribute type ' + attr_type; + this._newBlockBytes.position += attr_len; + break; + } + if (this._debug) { + console.log("attribute = name: " + attr_key + " / value = " + attr_val); + } + attributes[attr_key] = attr_val; + attibuteCnt += 1; + } + } + return attributes; + }; + AWDParser.prototype.parseProperties = function (expected) { + var list_end; + var list_len; + var propertyCnt = 0; + var props = new AWDProperties(); + list_len = this._newBlockBytes.readUnsignedInt(); + list_end = this._newBlockBytes.position + list_len; + if (expected) { + while (this._newBlockBytes.position < list_end) { + var len; + var key; + var type; + key = this._newBlockBytes.readUnsignedShort(); + len = this._newBlockBytes.readUnsignedInt(); + if ((this._newBlockBytes.position + len) > list_end) { + console.log(" Error in reading property # " + propertyCnt + " = skipped to end of propertie-list"); + this._newBlockBytes.position = list_end; + return props; + } + if (expected.hasOwnProperty(key.toString())) { + type = expected[key]; + props.set(key, this.parseAttrValue(type, len)); + } + else { + this._newBlockBytes.position += len; + } + propertyCnt += 1; + } + } + else { + this._newBlockBytes.position = list_end; + } + return props; + }; + AWDParser.prototype.parseAttrValue = function (type, len) { + var elem_len; + var read_func; + switch (type) { + case AWDParser.BOOL: + case AWDParser.INT8: + elem_len = 1; + read_func = this._newBlockBytes.readByte; + break; + case AWDParser.INT16: + elem_len = 2; + read_func = this._newBlockBytes.readShort; + break; + case AWDParser.INT32: + elem_len = 4; + read_func = this._newBlockBytes.readInt; + break; + case AWDParser.UINT8: + elem_len = 1; + read_func = this._newBlockBytes.readUnsignedByte; + break; + case AWDParser.UINT16: + elem_len = 2; + read_func = this._newBlockBytes.readUnsignedShort; + break; + case AWDParser.UINT32: + case AWDParser.COLOR: + case AWDParser.BADDR: + elem_len = 4; + read_func = this._newBlockBytes.readUnsignedInt; + break; + case AWDParser.FLOAT32: + elem_len = 4; + read_func = this._newBlockBytes.readFloat; + break; + case AWDParser.FLOAT64: + elem_len = 8; + read_func = this._newBlockBytes.readDouble; + break; + case AWDParser.AWDSTRING: + return this._newBlockBytes.readUTFBytes(len); + case AWDParser.VECTOR2x1: + case AWDParser.VECTOR3x1: + case AWDParser.VECTOR4x1: + case AWDParser.MTX3x2: + case AWDParser.MTX3x3: + case AWDParser.MTX4x3: + case AWDParser.MTX4x4: + elem_len = 8; + read_func = this._newBlockBytes.readDouble; + break; + } + if (elem_len < len) { + var list = []; + var num_read = 0; + var num_elems = len / elem_len; + while (num_read < num_elems) { + list.push(read_func.apply(this._newBlockBytes)); // list.push(read_func()); + num_read++; + } + return list; + } + else { + var val = read_func.apply(this._newBlockBytes); //read_func(); + return val; + } + }; + AWDParser.prototype.parseHeader = function () { + var flags; + var body_len; + this._byteData.position = 3; // Skip magic string and parse version + this._version[0] = this._byteData.readUnsignedByte(); + this._version[1] = this._byteData.readUnsignedByte(); + flags = this._byteData.readUnsignedShort(); // Parse bit flags + this._streaming = BitFlags.test(flags, BitFlags.FLAG1); + if ((this._version[0] == 2) && (this._version[1] == 1)) { + this._accuracyMatrix = BitFlags.test(flags, BitFlags.FLAG2); + this._accuracyGeo = BitFlags.test(flags, BitFlags.FLAG3); + this._accuracyProps = BitFlags.test(flags, BitFlags.FLAG4); + } + // if we set _accuracyOnBlocks, the precision-values are read from each block-header. + // set storagePrecision types + this._geoNrType = AWDParser.FLOAT32; + if (this._accuracyGeo) { + this._geoNrType = AWDParser.FLOAT64; + } + this._matrixNrType = AWDParser.FLOAT32; + if (this._accuracyMatrix) { + this._matrixNrType = AWDParser.FLOAT64; + } + this._propsNrType = AWDParser.FLOAT32; + if (this._accuracyProps) { + this._propsNrType = AWDParser.FLOAT64; + } + this._compression = this._byteData.readUnsignedByte(); // compression + if (this._debug) { + console.log("Import AWDFile of version = " + this._version[0] + " - " + this._version[1]); + console.log("Global Settings = Compression = " + this._compression + " | Streaming = " + this._streaming + " | Matrix-Precision = " + this._accuracyMatrix + " | Geometry-Precision = " + this._accuracyGeo + " | Properties-Precision = " + this._accuracyProps); + } + // Check file integrity + body_len = this._byteData.readUnsignedInt(); + if (!this._streaming && body_len != this._byteData.getBytesAvailable()) { + this._pDieWithError('AWD2 body length does not match header integrity field'); + } + }; + // Helper - functions + AWDParser.prototype.getUVForVertexAnimation = function (meshID /*uint*/) { + if (this._blocks[meshID].data instanceof Mesh) + meshID = this._blocks[meshID].geoID; + if (this._blocks[meshID].uvsForVertexAnimation) + return this._blocks[meshID].uvsForVertexAnimation; + var geometry = this._blocks[meshID].data; + var geoCnt = 0; + var ud; + var uStride /*uint*/; + var uOffs /*uint*/; + var numPoints /*uint*/; + var i /*int*/; + var newUvs; + var sub_geom; + this._blocks[meshID].uvsForVertexAnimation = new Array(); + while (geoCnt < geometry.subGeometries.length) { + newUvs = new Array(); + sub_geom = geometry.subGeometries[geoCnt]; + numPoints = sub_geom.numVertices; + ud = sub_geom.uvs; + uStride = sub_geom.getStride(TriangleSubGeometry.UV_DATA); + uOffs = sub_geom.getOffset(TriangleSubGeometry.UV_DATA); + for (i = 0; i < numPoints; i++) { + newUvs.push(ud[uOffs + i * uStride + 0]); + newUvs.push(ud[uOffs + i * uStride + 1]); + } + this._blocks[meshID].uvsForVertexAnimation.push(newUvs); + geoCnt++; + } + return this._blocks[meshID].uvsForVertexAnimation; + }; + AWDParser.prototype.parseVarStr = function () { + var len = this._newBlockBytes.readUnsignedShort(); + return this._newBlockBytes.readUTFBytes(len); + }; + AWDParser.prototype.getAssetByID = function (assetID, assetTypesToGet, extraTypeInfo) { + if (extraTypeInfo === void 0) { extraTypeInfo = "SingleTexture"; } + var returnArray = new Array(); + var typeCnt = 0; + if (assetID > 0) { + if (this._blocks[assetID]) { + if (this._blocks[assetID].data) { + while (typeCnt < assetTypesToGet.length) { + var iasset = this._blocks[assetID].data; + if (iasset.assetType == assetTypesToGet[typeCnt]) { + //if the right assetType was found + if ((assetTypesToGet[typeCnt] == AssetType.TEXTURE) && (extraTypeInfo == "CubeTexture")) { + if (this._blocks[assetID].data instanceof ImageCubeTexture) { + returnArray.push(true); + returnArray.push(this._blocks[assetID].data); + return returnArray; + } + } + if ((assetTypesToGet[typeCnt] == AssetType.TEXTURE) && (extraTypeInfo == "SingleTexture")) { + if (this._blocks[assetID].data instanceof ImageTexture) { + returnArray.push(true); + returnArray.push(this._blocks[assetID].data); + return returnArray; + } + } + else { + returnArray.push(true); + returnArray.push(this._blocks[assetID].data); + return returnArray; + } + } + //if ((assetTypesToGet[typeCnt] == AssetType.GEOMETRY) && (IAsset(_blocks[assetID].data).assetType == AssetType.MESH)) { + if ((assetTypesToGet[typeCnt] == AssetType.GEOMETRY) && (iasset.assetType == AssetType.MESH)) { + var mesh = this._blocks[assetID].data; + returnArray.push(true); + returnArray.push(mesh.geometry); + return returnArray; + } + typeCnt++; + } + } + } + } + // if the has not returned anything yet, the asset is not found, or the found asset is not the right type. + returnArray.push(false); + returnArray.push(this.getDefaultAsset(assetTypesToGet[0], extraTypeInfo)); + return returnArray; + }; + AWDParser.prototype.getDefaultAsset = function (assetType, extraTypeInfo) { + switch (true) { + case (assetType == AssetType.TEXTURE): + if (extraTypeInfo == "CubeTexture") + return this.getDefaultCubeTexture(); + if (extraTypeInfo == "SingleTexture") + return this.getDefaultTexture(); + break; + case (assetType == AssetType.MATERIAL): + return this.getDefaultMaterial(); + break; + default: + break; + } + return null; + }; + AWDParser.prototype.getDefaultMaterial = function () { + if (!this._defaultBitmapMaterial) + this._defaultBitmapMaterial = DefaultMaterialManager.getDefaultMaterial(); + return this._defaultBitmapMaterial; + }; + AWDParser.prototype.getDefaultTexture = function () { + if (!this._defaultTexture) + this._defaultTexture = DefaultMaterialManager.getDefaultTexture(); + return this._defaultTexture; + }; + AWDParser.prototype.getDefaultCubeTexture = function () { + if (!this._defaultCubeTexture) { + var defaultBitmap = DefaultMaterialManager.createCheckeredBitmapData(); + this._defaultCubeTexture = new BitmapCubeTexture(defaultBitmap, defaultBitmap, defaultBitmap, defaultBitmap, defaultBitmap, defaultBitmap); + this._defaultCubeTexture.name = "defaultCubeTexture"; + } + return this._defaultCubeTexture; + }; + AWDParser.prototype.readNumber = function (precision) { + if (precision === void 0) { precision = false; } + if (precision) + return this._newBlockBytes.readDouble(); + return this._newBlockBytes.readFloat(); + }; + AWDParser.prototype.parseMatrix3D = function () { + return new Matrix3D(this.parseMatrix43RawData()); + }; + AWDParser.prototype.parseMatrix32RawData = function () { + var i; + var mtx_raw = new Array(6); + for (i = 0; i < 6; i++) { + mtx_raw[i] = this._newBlockBytes.readFloat(); + } + return mtx_raw; + }; + AWDParser.prototype.parseMatrix43RawData = function () { + var mtx_raw = new Array(16); + mtx_raw[0] = this.readNumber(this._accuracyMatrix); + mtx_raw[1] = this.readNumber(this._accuracyMatrix); + mtx_raw[2] = this.readNumber(this._accuracyMatrix); + mtx_raw[3] = 0.0; + mtx_raw[4] = this.readNumber(this._accuracyMatrix); + mtx_raw[5] = this.readNumber(this._accuracyMatrix); + mtx_raw[6] = this.readNumber(this._accuracyMatrix); + mtx_raw[7] = 0.0; + mtx_raw[8] = this.readNumber(this._accuracyMatrix); + mtx_raw[9] = this.readNumber(this._accuracyMatrix); + mtx_raw[10] = this.readNumber(this._accuracyMatrix); + mtx_raw[11] = 0.0; + mtx_raw[12] = this.readNumber(this._accuracyMatrix); + mtx_raw[13] = this.readNumber(this._accuracyMatrix); + mtx_raw[14] = this.readNumber(this._accuracyMatrix); + mtx_raw[15] = 1.0; + //TODO: fix max exporter to remove NaN values in joint 0 inverse bind pose + if (isNaN(mtx_raw[0])) { + mtx_raw[0] = 1; + mtx_raw[1] = 0; + mtx_raw[2] = 0; + mtx_raw[4] = 0; + mtx_raw[5] = 1; + mtx_raw[6] = 0; + mtx_raw[8] = 0; + mtx_raw[9] = 0; + mtx_raw[10] = 1; + mtx_raw[12] = 0; + mtx_raw[13] = 0; + mtx_raw[14] = 0; + } + return mtx_raw; + }; + AWDParser.COMPRESSIONMODE_LZMA = "lzma"; + AWDParser.UNCOMPRESSED = 0; + AWDParser.DEFLATE = 1; + AWDParser.LZMA = 2; + AWDParser.INT8 = 1; + AWDParser.INT16 = 2; + AWDParser.INT32 = 3; + AWDParser.UINT8 = 4; + AWDParser.UINT16 = 5; + AWDParser.UINT32 = 6; + AWDParser.FLOAT32 = 7; + AWDParser.FLOAT64 = 8; + AWDParser.BOOL = 21; + AWDParser.COLOR = 22; + AWDParser.BADDR = 23; + AWDParser.AWDSTRING = 31; + AWDParser.AWDBYTEARRAY = 32; + AWDParser.VECTOR2x1 = 41; + AWDParser.VECTOR3x1 = 42; + AWDParser.VECTOR4x1 = 43; + AWDParser.MTX3x2 = 44; + AWDParser.MTX3x3 = 45; + AWDParser.MTX4x3 = 46; + AWDParser.MTX4x4 = 47; + return AWDParser; +})(ParserBase); +module.exports = AWDParser; + + +},{"awayjs-core/lib/containers/DisplayObjectContainer":undefined,"awayjs-core/lib/core/base/BlendMode":undefined,"awayjs-core/lib/core/base/Geometry":undefined,"awayjs-core/lib/core/base/TriangleSubGeometry":undefined,"awayjs-core/lib/core/geom/ColorTransform":undefined,"awayjs-core/lib/core/geom/Matrix3D":undefined,"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-core/lib/core/library/AssetType":undefined,"awayjs-core/lib/core/net/URLLoaderDataFormat":undefined,"awayjs-core/lib/core/net/URLRequest":undefined,"awayjs-core/lib/entities/Camera":undefined,"awayjs-core/lib/entities/DirectionalLight":undefined,"awayjs-core/lib/entities/Mesh":undefined,"awayjs-core/lib/entities/PointLight":undefined,"awayjs-core/lib/entities/Skybox":undefined,"awayjs-core/lib/materials/lightpickers/StaticLightPicker":undefined,"awayjs-core/lib/materials/shadowmappers/CubeMapShadowMapper":undefined,"awayjs-core/lib/materials/shadowmappers/DirectionalShadowMapper":undefined,"awayjs-core/lib/parsers/ParserBase":undefined,"awayjs-core/lib/parsers/ParserUtils":undefined,"awayjs-core/lib/prefabs/PrefabBase":undefined,"awayjs-core/lib/prefabs/PrimitiveCapsulePrefab":undefined,"awayjs-core/lib/prefabs/PrimitiveConePrefab":undefined,"awayjs-core/lib/prefabs/PrimitiveCubePrefab":undefined,"awayjs-core/lib/prefabs/PrimitiveCylinderPrefab":undefined,"awayjs-core/lib/prefabs/PrimitivePlanePrefab":undefined,"awayjs-core/lib/prefabs/PrimitiveSpherePrefab":undefined,"awayjs-core/lib/prefabs/PrimitiveTorusPrefab":undefined,"awayjs-core/lib/projections/OrthographicOffCenterProjection":undefined,"awayjs-core/lib/projections/OrthographicProjection":undefined,"awayjs-core/lib/projections/PerspectiveProjection":undefined,"awayjs-core/lib/textures/BitmapCubeTexture":undefined,"awayjs-core/lib/textures/ImageCubeTexture":undefined,"awayjs-core/lib/textures/ImageTexture":undefined,"awayjs-core/lib/utils/ByteArray":undefined,"awayjs-renderergl/lib/animators/SkeletonAnimationSet":undefined,"awayjs-renderergl/lib/animators/SkeletonAnimator":undefined,"awayjs-renderergl/lib/animators/VertexAnimationSet":undefined,"awayjs-renderergl/lib/animators/VertexAnimator":undefined,"awayjs-renderergl/lib/animators/data/JointPose":undefined,"awayjs-renderergl/lib/animators/data/Skeleton":undefined,"awayjs-renderergl/lib/animators/data/SkeletonJoint":undefined,"awayjs-renderergl/lib/animators/data/SkeletonPose":undefined,"awayjs-renderergl/lib/animators/nodes/SkeletonClipNode":undefined,"awayjs-renderergl/lib/animators/nodes/VertexClipNode":undefined,"awayjs-renderergl/lib/materials/methods/AmbientEnvMapMethod":undefined,"awayjs-renderergl/lib/materials/methods/DiffuseCelMethod":undefined,"awayjs-renderergl/lib/materials/methods/DiffuseDepthMethod":undefined,"awayjs-renderergl/lib/materials/methods/DiffuseGradientMethod":undefined,"awayjs-renderergl/lib/materials/methods/DiffuseLightMapMethod":undefined,"awayjs-renderergl/lib/materials/methods/DiffuseWrapMethod":undefined,"awayjs-renderergl/lib/materials/methods/EffectAlphaMaskMethod":undefined,"awayjs-renderergl/lib/materials/methods/EffectColorMatrixMethod":undefined,"awayjs-renderergl/lib/materials/methods/EffectEnvMapMethod":undefined,"awayjs-renderergl/lib/materials/methods/EffectFogMethod":undefined,"awayjs-renderergl/lib/materials/methods/EffectFresnelEnvMapMethod":undefined,"awayjs-renderergl/lib/materials/methods/EffectLightMapMethod":undefined,"awayjs-renderergl/lib/materials/methods/EffectRimLightMethod":undefined,"awayjs-renderergl/lib/materials/methods/NormalSimpleWaterMethod":undefined,"awayjs-renderergl/lib/materials/methods/ShadowDitheredMethod":undefined,"awayjs-renderergl/lib/materials/methods/ShadowFilteredMethod":undefined,"awayjs-renderergl/lib/materials/methods/ShadowNearMethod":undefined,"awayjs-renderergl/lib/materials/methods/ShadowSoftMethod":undefined,"awayjs-renderergl/lib/materials/methods/SpecularAnisotropicMethod":undefined,"awayjs-renderergl/lib/materials/methods/SpecularCelMethod":undefined,"awayjs-renderergl/lib/materials/methods/SpecularFresnelMethod":undefined,"awayjs-renderergl/lib/materials/methods/SpecularPhongMethod":undefined,"awayjs-renderergl/lib/parsers/data/AWDBlock":undefined,"awayjs-renderergl/lib/parsers/data/AWDProperties":undefined,"awayjs-renderergl/lib/parsers/data/BitFlags":undefined,"awayjs-stagegl/lib/materials/SkyboxMaterial":undefined,"awayjs-stagegl/lib/materials/TriangleMaterialMode":undefined,"awayjs-stagegl/lib/materials/TriangleMethodMaterial":undefined,"awayjs-stagegl/lib/materials/methods/EffectColorTransformMethod":undefined,"awayjs-stagegl/lib/materials/methods/ShadowHardMethod":undefined,"awayjs-stagegl/lib/materials/utils/DefaultMaterialManager":undefined}],"awayjs-renderergl/lib/parsers/MD2Parser":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var DisplayObjectContainer = require("awayjs-core/lib/containers/DisplayObjectContainer"); +var Geometry = require("awayjs-core/lib/core/base/Geometry"); +var TriangleSubGeometry = require("awayjs-core/lib/core/base/TriangleSubGeometry"); +var URLLoaderDataFormat = require("awayjs-core/lib/core/net/URLLoaderDataFormat"); +var URLRequest = require("awayjs-core/lib/core/net/URLRequest"); +var Mesh = require("awayjs-core/lib/entities/Mesh"); +var ParserBase = require("awayjs-core/lib/parsers/ParserBase"); +var ParserUtils = require("awayjs-core/lib/parsers/ParserUtils"); +var DefaultMaterialManager = require("awayjs-stagegl/lib/materials/utils/DefaultMaterialManager"); +var TriangleMethodMaterial = require("awayjs-stagegl/lib/materials/TriangleMethodMaterial"); +var TriangleMaterialMode = require("awayjs-stagegl/lib/materials/TriangleMaterialMode"); +var VertexClipNode = require("awayjs-renderergl/lib/animators/nodes/VertexClipNode"); +var VertexAnimationSet = require("awayjs-renderergl/lib/animators/VertexAnimationSet"); +/** + * MD2Parser provides a parser for the MD2 data type. + */ +var MD2Parser = (function (_super) { + __extends(MD2Parser, _super); + /** + * Creates a new MD2Parser object. + * @param textureType The extension of the texture (e.g. jpg/png/...) + * @param ignoreTexturePath If true, the path of the texture is ignored + */ + function MD2Parser(textureType, ignoreTexturePath) { + if (textureType === void 0) { textureType = "jpg"; } + if (ignoreTexturePath === void 0) { ignoreTexturePath = true; } + _super.call(this, URLLoaderDataFormat.ARRAY_BUFFER); + this._clipNodes = new Object(); + // the current subgeom being built + this._animationSet = new VertexAnimationSet(); + this.materialFinal = false; + this.geoCreated = false; + this._textureType = textureType; + this._ignoreTexturePath = ignoreTexturePath; + } + /** + * Indicates whether or not a given file extension is supported by the parser. + * @param extension The file extension of a potential file to be parsed. + * @return Whether or not the given file type is supported. + */ + MD2Parser.supportsType = function (extension) { + extension = extension.toLowerCase(); + return extension == "md2"; + }; + /** + * Tests whether a data block can be parsed by the parser. + * @param data The data block to potentially be parsed. + * @return Whether or not the given data is supported. + */ + MD2Parser.supportsData = function (data) { + return (ParserUtils.toString(data, 4) == 'IDP2'); + }; + /** + * @inheritDoc + */ + MD2Parser.prototype._iResolveDependency = function (resourceDependency) { + if (resourceDependency.assets.length != 1) + return; + var asset = resourceDependency.assets[0]; + if (asset) { + var material = new TriangleMethodMaterial(asset); + if (this.materialMode >= 2) + material.materialMode = TriangleMaterialMode.MULTI_PASS; + //add to the content property + this._pContent.addChild(this._mesh); + material.name = this._mesh.material.name; + this._mesh.material = material; + this._pFinalizeAsset(material); + this._pFinalizeAsset(this._mesh.geometry); + this._pFinalizeAsset(this._mesh); + } + this.materialFinal = true; + }; + /** + * @inheritDoc + */ + MD2Parser.prototype._iResolveDependencyFailure = function (resourceDependency) { + // apply system default + if (this.materialMode < 2) { + this._mesh.material = DefaultMaterialManager.getDefaultMaterial(); + } + else { + this._mesh.material = new TriangleMethodMaterial(DefaultMaterialManager.getDefaultTexture()); + this._mesh.material.materialMode = TriangleMaterialMode.MULTI_PASS; + } + //add to the content property + this._pContent.addChild(this._mesh); + this._pFinalizeAsset(this._mesh.geometry); + this._pFinalizeAsset(this._mesh); + this.materialFinal = true; + }; + /** + * @inheritDoc + */ + MD2Parser.prototype._pProceedParsing = function () { + if (!this._startedParsing) { + this._byteData = this._pGetByteData(); + this._startedParsing = true; + // Reset bytearray read position (which may have been + // moved forward by the supportsData() function.) + this._byteData.position = 0; + } + while (this._pHasTime()) { + if (!this._parsedHeader) { + //---------------------------------------------------------------------------- + // LITTLE_ENDIAN - Default for ArrayBuffer / Not implemented in ByteArray + //---------------------------------------------------------------------------- + //this._byteData.endian = Endian.LITTLE_ENDIAN; + // TODO: Create a mesh only when encountered (if it makes sense + // for this file format) and return it using this._pFinalizeAsset() + this._geometry = new Geometry(); + this._mesh = new Mesh(this._geometry, null); + if (this.materialMode < 2) { + this._mesh.material = DefaultMaterialManager.getDefaultMaterial(); + } + else { + this._mesh.material = new TriangleMethodMaterial(DefaultMaterialManager.getDefaultTexture()); + this._mesh.material.materialMode = TriangleMaterialMode.MULTI_PASS; + } + //_geometry.animation = new VertexAnimation(2, VertexAnimationMode.ABSOLUTE); + //_animator = new VertexAnimator(VertexAnimationState(_mesh.animationState)); + // Parse header and decompress body + this.parseHeader(); + this.parseMaterialNames(); + } + else if (!this._parsedUV) { + this.parseUV(); + } + else if (!this._parsedFaces) { + this.parseFaces(); + } + else if (!this._parsedFrames) { + this.parseFrames(); + } + else if ((this.geoCreated) && (this.materialFinal)) { + return ParserBase.PARSING_DONE; + } + else if (!this.geoCreated) { + this.geoCreated = true; + //create default subgeometry + this._geometry.addSubGeometry(this._firstSubGeom.clone()); + // Force name to be chosen by this._pFinalizeAsset() + this._mesh.name = ""; + if (this.materialFinal) { + //add to the content property + this._pContent.addChild(this._mesh); + this._pFinalizeAsset(this._mesh.geometry); + this._pFinalizeAsset(this._mesh); + } + this._pPauseAndRetrieveDependencies(); + } + } + return ParserBase.MORE_TO_PARSE; + }; + MD2Parser.prototype._pStartParsing = function (frameLimit) { + _super.prototype._pStartParsing.call(this, frameLimit); + //create a content object for Loaders + this._pContent = new DisplayObjectContainer(); + }; + /** + * Reads in all that MD2 Header data that is declared as private variables. + * I know its a lot, and it looks ugly, but only way to do it in Flash + */ + MD2Parser.prototype.parseHeader = function () { + this._ident = this._byteData.readInt(); + this._version = this._byteData.readInt(); + this._skinWidth = this._byteData.readInt(); + this._skinHeight = this._byteData.readInt(); + //skip this._frameSize + this._byteData.readInt(); + this._numSkins = this._byteData.readInt(); + this._numVertices = this._byteData.readInt(); + this._numST = this._byteData.readInt(); + this._numTris = this._byteData.readInt(); + //skip this._numGlCmds + this._byteData.readInt(); + this._numFrames = this._byteData.readInt(); + this._offsetSkins = this._byteData.readInt(); + this._offsetST = this._byteData.readInt(); + this._offsetTris = this._byteData.readInt(); + this._offsetFrames = this._byteData.readInt(); + //skip this._offsetGlCmds + this._byteData.readInt(); + this._offsetEnd = this._byteData.readInt(); + this._parsedHeader = true; + }; + /** + * Parses the file names for the materials. + */ + MD2Parser.prototype.parseMaterialNames = function () { + var url; + var name; + var extIndex /*int*/; + var slashIndex /*int*/; + this._materialNames = new Array(); + this._byteData.position = this._offsetSkins; + var regExp = new RegExp("[^a-zA-Z0-9\\_\/.]", "g"); + for (var i = 0; i < this._numSkins; ++i) { + name = this._byteData.readUTFBytes(64); + name = name.replace(regExp, ""); + extIndex = name.lastIndexOf("."); + if (this._ignoreTexturePath) + slashIndex = name.lastIndexOf("/"); + if (name.toLowerCase().indexOf(".jpg") == -1 && name.toLowerCase().indexOf(".png") == -1) { + name = name.substring(slashIndex + 1, extIndex); + url = name + "." + this._textureType; + } + else { + url = name; + } + this._materialNames[i] = name; + // only support 1 skin TODO: really? + if (this.dependencies.length == 0) + this._pAddDependency(name, new URLRequest(url)); + } + if (this._materialNames.length > 0) + this._mesh.material.name = this._materialNames[0]; + else + this.materialFinal = true; + }; + /** + * Parses the uv data for the mesh. + */ + MD2Parser.prototype.parseUV = function () { + var j = 0; + this._uvs = new Array(this._numST * 2); + this._byteData.position = this._offsetST; + for (var i = 0; i < this._numST; i++) { + this._uvs[j++] = this._byteData.readShort() / this._skinWidth; + this._uvs[j++] = this._byteData.readShort() / this._skinHeight; + } + this._parsedUV = true; + }; + /** + * Parses unique indices for the faces. + */ + MD2Parser.prototype.parseFaces = function () { + var a /*uint*/, b /*uint*/, c /*uint*/, ta /*uint*/, tb /*uint*/, tc /*uint*/; + var i /*uint*/; + this._vertIndices = new Array(); + this._uvIndices = new Array(); + this._indices = new Array(); + this._byteData.position = this._offsetTris; + for (i = 0; i < this._numTris; i++) { + //collect vertex indices + a = this._byteData.readUnsignedShort(); + b = this._byteData.readUnsignedShort(); + c = this._byteData.readUnsignedShort(); + //collect uv indices + ta = this._byteData.readUnsignedShort(); + tb = this._byteData.readUnsignedShort(); + tc = this._byteData.readUnsignedShort(); + this.addIndex(a, ta); + this.addIndex(b, tb); + this.addIndex(c, tc); + } + var len = this._uvIndices.length; + this._finalUV = new Array(len * 2); + for (i = 0; i < len; ++i) { + this._finalUV[i << 1] = this._uvs[this._uvIndices[i] << 1]; + this._finalUV[(i << 1) + 1] = this._uvs[(this._uvIndices[i] << 1) + 1]; + } + this._parsedFaces = true; + }; + /** + * Adds a face index to the list if it doesn't exist yet, based on vertexIndex and uvIndex, and adds the + * corresponding vertex and uv data in the correct location. + * @param vertexIndex The original index in the vertex list. + * @param uvIndex The original index in the uv list. + */ + MD2Parser.prototype.addIndex = function (vertexIndex /*uint*/, uvIndex /*uint*/) { + var index = this.findIndex(vertexIndex, uvIndex); + if (index == -1) { + this._indices.push(this._vertIndices.length); + this._vertIndices.push(vertexIndex); + this._uvIndices.push(uvIndex); + } + else + this._indices.push(index); + }; + /** + * Finds the final index corresponding to the original MD2's vertex and uv indices. Returns -1 if it wasn't added yet. + * @param vertexIndex The original index in the vertex list. + * @param uvIndex The original index in the uv list. + * @return The index of the final mesh corresponding to the original vertex and uv index. -1 if it doesn't exist yet. + */ + MD2Parser.prototype.findIndex = function (vertexIndex /*uint*/, uvIndex /*uint*/) { + var len = this._vertIndices.length; + for (var i = 0; i < len; ++i) { + if (this._vertIndices[i] == vertexIndex && this._uvIndices[i] == uvIndex) + return i; + } + return -1; + }; + /** + * Parses all the frame geometries. + */ + MD2Parser.prototype.parseFrames = function () { + var sx, sy, sz; + var tx, ty, tz; + var geometry; + var subGeom; + var vertLen = this._vertIndices.length; + var fvertices; + var tvertices; + var i /*uint*/, j /*int*/, k /*uint*/; + //var ch : number /*uint*/; + var name = ""; + var prevClip = null; + this._byteData.position = this._offsetFrames; + for (i = 0; i < this._numFrames; i++) { + tvertices = new Array(); + fvertices = new Array(vertLen * 3); + sx = this._byteData.readFloat(); + sy = this._byteData.readFloat(); + sz = this._byteData.readFloat(); + tx = this._byteData.readFloat(); + ty = this._byteData.readFloat(); + tz = this._byteData.readFloat(); + name = this.readFrameName(); + for (j = 0; j < this._numVertices; j++, this._byteData.position++) + tvertices.push(sx * this._byteData.readUnsignedByte() + tx, sy * this._byteData.readUnsignedByte() + ty, sz * this._byteData.readUnsignedByte() + tz); + k = 0; + for (j = 0; j < vertLen; j++) { + fvertices[k++] = tvertices[this._vertIndices[j] * 3]; + fvertices[k++] = tvertices[this._vertIndices[j] * 3 + 2]; + fvertices[k++] = tvertices[this._vertIndices[j] * 3 + 1]; + } + subGeom = new TriangleSubGeometry(true); + if (this._firstSubGeom == null) + this._firstSubGeom = subGeom; + geometry = new Geometry(); + geometry.addSubGeometry(subGeom); + subGeom.updateIndices(this._indices); + subGeom.updatePositions(fvertices); + subGeom.updateUVs(this._finalUV); + subGeom.vertexNormals; + subGeom.vertexTangents; + subGeom.autoDeriveNormals = false; + subGeom.autoDeriveTangents = false; + var clip = this._clipNodes[name]; + if (!clip) { + // If another sequence was parsed before this one, starting + // a new state means the previous one is complete and can + // hence be finalized. + if (prevClip) { + this._pFinalizeAsset(prevClip); + this._animationSet.addAnimation(prevClip); + } + clip = new VertexClipNode(); + clip.name = name; + clip.stitchFinalFrame = true; + this._clipNodes[name] = clip; + prevClip = clip; + } + clip.addFrame(geometry, 1000 / MD2Parser.FPS); + } + // Finalize the last state + if (prevClip) { + this._pFinalizeAsset(prevClip); + this._animationSet.addAnimation(prevClip); + } + // Force this._pFinalizeAsset() to decide name + this._pFinalizeAsset(this._animationSet); + this._parsedFrames = true; + }; + MD2Parser.prototype.readFrameName = function () { + var name = ""; + var k = 0; + for (var j = 0; j < 16; j++) { + var ch = this._byteData.readUnsignedByte(); + if (Math.floor(ch) > 0x39 && Math.floor(ch) <= 0x7A && k == 0) + name += String.fromCharCode(ch); + if (Math.floor(ch) >= 0x30 && Math.floor(ch) <= 0x39) + k++; + } + return name; + }; + MD2Parser.FPS = 6; + return MD2Parser; +})(ParserBase); +module.exports = MD2Parser; + + +},{"awayjs-core/lib/containers/DisplayObjectContainer":undefined,"awayjs-core/lib/core/base/Geometry":undefined,"awayjs-core/lib/core/base/TriangleSubGeometry":undefined,"awayjs-core/lib/core/net/URLLoaderDataFormat":undefined,"awayjs-core/lib/core/net/URLRequest":undefined,"awayjs-core/lib/entities/Mesh":undefined,"awayjs-core/lib/parsers/ParserBase":undefined,"awayjs-core/lib/parsers/ParserUtils":undefined,"awayjs-renderergl/lib/animators/VertexAnimationSet":undefined,"awayjs-renderergl/lib/animators/nodes/VertexClipNode":undefined,"awayjs-stagegl/lib/materials/TriangleMaterialMode":undefined,"awayjs-stagegl/lib/materials/TriangleMethodMaterial":undefined,"awayjs-stagegl/lib/materials/utils/DefaultMaterialManager":undefined}],"awayjs-renderergl/lib/parsers/MD5AnimParser":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Quaternion = require("awayjs-core/lib/core/geom/Quaternion"); +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var URLLoaderDataFormat = require("awayjs-core/lib/core/net/URLLoaderDataFormat"); +var ParserBase = require("awayjs-core/lib/parsers/ParserBase"); +var JointPose = require("awayjs-renderergl/lib/animators/data/JointPose"); +var SkeletonPose = require("awayjs-renderergl/lib/animators/data/SkeletonPose"); +var SkeletonClipNode = require("awayjs-renderergl/lib/animators/nodes/SkeletonClipNode"); +var BaseFrameData = require("awayjs-renderergl/lib/parsers/data/BaseFrameData"); +var BoundsData = require("awayjs-renderergl/lib/parsers/data/BoundsData"); +var FrameData = require("awayjs-renderergl/lib/parsers/data/FrameData"); +var HierarchyData = require("awayjs-renderergl/lib/parsers/data/HierarchyData"); +/** + * MD5AnimParser provides a parser for the md5anim data type, providing an animation sequence for the md5 format. + * + * todo: optimize + */ +var MD5AnimParser = (function (_super) { + __extends(MD5AnimParser, _super); + /** + * Creates a new MD5AnimParser object. + * @param uri The url or id of the data or file to be parsed. + * @param extra The holder for extra contextual data that the parser might need. + */ + function MD5AnimParser(additionalRotationAxis, additionalRotationRadians) { + if (additionalRotationAxis === void 0) { additionalRotationAxis = null; } + if (additionalRotationRadians === void 0) { additionalRotationRadians = 0; } + _super.call(this, URLLoaderDataFormat.TEXT); + this._parseIndex = 0; + this._line = 0; + this._charLineIndex = 0; + this._rotationQuat = new Quaternion(); + var t1 = new Quaternion(); + var t2 = new Quaternion(); + t1.fromAxisAngle(Vector3D.X_AXIS, -Math.PI * .5); + t2.fromAxisAngle(Vector3D.Y_AXIS, -Math.PI * .5); + this._rotationQuat.multiply(t2, t1); + if (additionalRotationAxis) { + this._rotationQuat.multiply(t2, t1); + t1.fromAxisAngle(additionalRotationAxis, additionalRotationRadians); + this._rotationQuat.multiply(t1, this._rotationQuat); + } + } + /** + * Indicates whether or not a given file extension is supported by the parser. + * @param extension The file extension of a potential file to be parsed. + * @return Whether or not the given file type is supported. + */ + MD5AnimParser.supportsType = function (extension) { + extension = extension.toLowerCase(); + return extension == "md5anim"; + }; + /** + * Tests whether a data block can be parsed by the parser. + * @param data The data block to potentially be parsed. + * @return Whether or not the given data is supported. + */ + MD5AnimParser.supportsData = function (data) { + return false; + }; + /** + * @inheritDoc + */ + MD5AnimParser.prototype._pProceedParsing = function () { + var token; + if (!this._startedParsing) { + this._textData = this._pGetTextData(); + this._startedParsing = true; + } + while (this._pHasTime()) { + token = this.getNextToken(); + switch (token) { + case MD5AnimParser.COMMENT_TOKEN: + this.ignoreLine(); + break; + case "": + break; + case MD5AnimParser.VERSION_TOKEN: + this._version = this.getNextInt(); + if (this._version != 10) + throw new Error("Unknown version number encountered!"); + break; + case MD5AnimParser.COMMAND_LINE_TOKEN: + this.parseCMD(); + break; + case MD5AnimParser.NUM_FRAMES_TOKEN: + this._numFrames = this.getNextInt(); + this._bounds = new Array(); + this._frameData = new Array(); + break; + case MD5AnimParser.NUM_JOINTS_TOKEN: + this._numJoints = this.getNextInt(); + this._hierarchy = new Array(this._numJoints); + this._baseFrameData = new Array(this._numJoints); + break; + case MD5AnimParser.FRAME_RATE_TOKEN: + this._frameRate = this.getNextInt(); + break; + case MD5AnimParser.NUM_ANIMATED_COMPONENTS_TOKEN: + this._numAnimatedComponents = this.getNextInt(); + break; + case MD5AnimParser.HIERARCHY_TOKEN: + this.parseHierarchy(); + break; + case MD5AnimParser.BOUNDS_TOKEN: + this.parseBounds(); + break; + case MD5AnimParser.BASE_FRAME_TOKEN: + this.parseBaseFrame(); + break; + case MD5AnimParser.FRAME_TOKEN: + this.parseFrame(); + break; + default: + if (!this._reachedEOF) + this.sendUnknownKeywordError(); + } + if (this._reachedEOF) { + this._clip = new SkeletonClipNode(); + this.translateClip(); + this._pFinalizeAsset(this._clip); + return ParserBase.PARSING_DONE; + } + } + return ParserBase.MORE_TO_PARSE; + }; + /** + * Converts all key frame data to an SkinnedAnimationSequence. + */ + MD5AnimParser.prototype.translateClip = function () { + for (var i = 0; i < this._numFrames; ++i) + this._clip.addFrame(this.translatePose(this._frameData[i]), 1000 / this._frameRate); + }; + /** + * Converts a single key frame data to a SkeletonPose. + * @param frameData The actual frame data. + * @return A SkeletonPose containing the frame data's pose. + */ + MD5AnimParser.prototype.translatePose = function (frameData) { + var hierarchy; + var pose; + var base; + var flags /*int*/; + var j /*int*/; + var translate = new Vector3D(); + var orientation = new Quaternion(); + var components = frameData.components; + var skelPose = new SkeletonPose(); + var jointPoses = skelPose.jointPoses; + for (var i = 0; i < this._numJoints; ++i) { + j = 0; + pose = new JointPose(); + hierarchy = this._hierarchy[i]; + base = this._baseFrameData[i]; + flags = hierarchy.flags; + translate.x = base.position.x; + translate.y = base.position.y; + translate.z = base.position.z; + orientation.x = base.orientation.x; + orientation.y = base.orientation.y; + orientation.z = base.orientation.z; + if (flags & 1) + translate.x = components[hierarchy.startIndex + (j++)]; + if (flags & 2) + translate.y = components[hierarchy.startIndex + (j++)]; + if (flags & 4) + translate.z = components[hierarchy.startIndex + (j++)]; + if (flags & 8) + orientation.x = components[hierarchy.startIndex + (j++)]; + if (flags & 16) + orientation.y = components[hierarchy.startIndex + (j++)]; + if (flags & 32) + orientation.z = components[hierarchy.startIndex + (j++)]; + var w = 1 - orientation.x * orientation.x - orientation.y * orientation.y - orientation.z * orientation.z; + orientation.w = w < 0 ? 0 : -Math.sqrt(w); + if (hierarchy.parentIndex < 0) { + pose.orientation.multiply(this._rotationQuat, orientation); + pose.translation = this._rotationQuat.rotatePoint(translate); + } + else { + pose.orientation.copyFrom(orientation); + pose.translation.x = translate.x; + pose.translation.y = translate.y; + pose.translation.z = translate.z; + } + pose.orientation.y = -pose.orientation.y; + pose.orientation.z = -pose.orientation.z; + pose.translation.x = -pose.translation.x; + jointPoses[i] = pose; + } + return skelPose; + }; + /** + * Parses the skeleton's hierarchy data. + */ + MD5AnimParser.prototype.parseHierarchy = function () { + var ch; + var data; + var token = this.getNextToken(); + var i = 0; + if (token != "{") + this.sendUnknownKeywordError(); + do { + if (this._reachedEOF) + this.sendEOFError(); + data = new HierarchyData(); + data.name = this.parseLiteralstring(); + data.parentIndex = this.getNextInt(); + data.flags = this.getNextInt(); + data.startIndex = this.getNextInt(); + this._hierarchy[i++] = data; + ch = this.getNextChar(); + if (ch == "/") { + this.putBack(); + ch = this.getNextToken(); + if (ch == MD5AnimParser.COMMENT_TOKEN) + this.ignoreLine(); + ch = this.getNextChar(); + } + if (ch != "}") + this.putBack(); + } while (ch != "}"); + }; + /** + * Parses frame bounds. + */ + MD5AnimParser.prototype.parseBounds = function () { + var ch; + var data; + var token = this.getNextToken(); + var i = 0; + if (token != "{") + this.sendUnknownKeywordError(); + do { + if (this._reachedEOF) + this.sendEOFError(); + data = new BoundsData(); + data.min = this.parseVector3D(); + data.max = this.parseVector3D(); + this._bounds[i++] = data; + ch = this.getNextChar(); + if (ch == "/") { + this.putBack(); + ch = this.getNextToken(); + if (ch == MD5AnimParser.COMMENT_TOKEN) + this.ignoreLine(); + ch = this.getNextChar(); + } + if (ch != "}") + this.putBack(); + } while (ch != "}"); + }; + /** + * Parses the base frame. + */ + MD5AnimParser.prototype.parseBaseFrame = function () { + var ch; + var data; + var token = this.getNextToken(); + var i = 0; + if (token != "{") + this.sendUnknownKeywordError(); + do { + if (this._reachedEOF) + this.sendEOFError(); + data = new BaseFrameData(); + data.position = this.parseVector3D(); + data.orientation = this.parseQuaternion(); + this._baseFrameData[i++] = data; + ch = this.getNextChar(); + if (ch == "/") { + this.putBack(); + ch = this.getNextToken(); + if (ch == MD5AnimParser.COMMENT_TOKEN) + this.ignoreLine(); + ch = this.getNextChar(); + } + if (ch != "}") + this.putBack(); + } while (ch != "}"); + }; + /** + * Parses a single frame. + */ + MD5AnimParser.prototype.parseFrame = function () { + var ch; + var data; + var token; + var frameIndex /*int*/; + frameIndex = this.getNextInt(); + token = this.getNextToken(); + if (token != "{") + this.sendUnknownKeywordError(); + do { + if (this._reachedEOF) + this.sendEOFError(); + data = new FrameData(); + data.components = new Array(this._numAnimatedComponents); + for (var i = 0; i < this._numAnimatedComponents; ++i) + data.components[i] = this.getNextNumber(); + this._frameData[frameIndex] = data; + ch = this.getNextChar(); + if (ch == "/") { + this.putBack(); + ch = this.getNextToken(); + if (ch == MD5AnimParser.COMMENT_TOKEN) + this.ignoreLine(); + ch = this.getNextChar(); + } + if (ch != "}") + this.putBack(); + } while (ch != "}"); + }; + /** + * Puts back the last read character into the data stream. + */ + MD5AnimParser.prototype.putBack = function () { + this._parseIndex--; + this._charLineIndex--; + this._reachedEOF = this._parseIndex >= this._textData.length; + }; + /** + * Gets the next token in the data stream. + */ + MD5AnimParser.prototype.getNextToken = function () { + var ch; + var token = ""; + while (!this._reachedEOF) { + ch = this.getNextChar(); + if (ch == " " || ch == "\r" || ch == "\n" || ch == "\t") { + if (token != MD5AnimParser.COMMENT_TOKEN) + this.skipWhiteSpace(); + if (token != "") + return token; + } + else + token += ch; + if (token == MD5AnimParser.COMMENT_TOKEN) + return token; + } + return token; + }; + /** + * Skips all whitespace in the data stream. + */ + MD5AnimParser.prototype.skipWhiteSpace = function () { + var ch; + do + ch = this.getNextChar(); + while (ch == "\n" || ch == " " || ch == "\r" || ch == "\t"); + this.putBack(); + }; + /** + * Skips to the next line. + */ + MD5AnimParser.prototype.ignoreLine = function () { + var ch; + while (!this._reachedEOF && ch != "\n") + ch = this.getNextChar(); + }; + /** + * Retrieves the next single character in the data stream. + */ + MD5AnimParser.prototype.getNextChar = function () { + var ch = this._textData.charAt(this._parseIndex++); + if (ch == "\n") { + ++this._line; + this._charLineIndex = 0; + } + else if (ch != "\r") + ++this._charLineIndex; + if (this._parseIndex == this._textData.length) + this._reachedEOF = true; + return ch; + }; + /** + * Retrieves the next integer in the data stream. + */ + MD5AnimParser.prototype.getNextInt = function () { + var i = parseInt(this.getNextToken()); + if (isNaN(i)) + this.sendParseError("int type"); + return i; + }; + /** + * Retrieves the next floating point number in the data stream. + */ + MD5AnimParser.prototype.getNextNumber = function () { + var f = parseFloat(this.getNextToken()); + if (isNaN(f)) + this.sendParseError("float type"); + return f; + }; + /** + * Retrieves the next 3d vector in the data stream. + */ + MD5AnimParser.prototype.parseVector3D = function () { + var vec = new Vector3D(); + var ch = this.getNextToken(); + if (ch != "(") + this.sendParseError("("); + vec.x = this.getNextNumber(); + vec.y = this.getNextNumber(); + vec.z = this.getNextNumber(); + if (this.getNextToken() != ")") + this.sendParseError(")"); + return vec; + }; + /** + * Retrieves the next quaternion in the data stream. + */ + MD5AnimParser.prototype.parseQuaternion = function () { + var quat = new Quaternion(); + var ch = this.getNextToken(); + if (ch != "(") + this.sendParseError("("); + quat.x = this.getNextNumber(); + quat.y = this.getNextNumber(); + quat.z = this.getNextNumber(); + // quat supposed to be unit length + var t = 1 - (quat.x * quat.x) - (quat.y * quat.y) - (quat.z * quat.z); + quat.w = t < 0 ? 0 : -Math.sqrt(t); + if (this.getNextToken() != ")") + this.sendParseError(")"); + return quat; + }; + /** + * Parses the command line data. + */ + MD5AnimParser.prototype.parseCMD = function () { + // just ignore the command line property + this.parseLiteralstring(); + }; + /** + * Retrieves the next literal string in the data stream. A literal string is a sequence of characters bounded + * by double quotes. + */ + MD5AnimParser.prototype.parseLiteralstring = function () { + this.skipWhiteSpace(); + var ch = this.getNextChar(); + var str = ""; + if (ch != "\"") + this.sendParseError("\""); + do { + if (this._reachedEOF) + this.sendEOFError(); + ch = this.getNextChar(); + if (ch != "\"") + str += ch; + } while (ch != "\""); + return str; + }; + /** + * Throws an end-of-file error when a premature end of file was encountered. + */ + MD5AnimParser.prototype.sendEOFError = function () { + throw new Error("Unexpected end of file"); + }; + /** + * Throws an error when an unexpected token was encountered. + * @param expected The token type that was actually expected. + */ + MD5AnimParser.prototype.sendParseError = function (expected) { + throw new Error("Unexpected token at line " + (this._line + 1) + ", character " + this._charLineIndex + ". " + expected + " expected, but " + this._textData.charAt(this._parseIndex - 1) + " encountered"); + }; + /** + * Throws an error when an unknown keyword was encountered. + */ + MD5AnimParser.prototype.sendUnknownKeywordError = function () { + throw new Error("Unknown keyword at line " + (this._line + 1) + ", character " + this._charLineIndex + ". "); + }; + MD5AnimParser.VERSION_TOKEN = "MD5Version"; + MD5AnimParser.COMMAND_LINE_TOKEN = "commandline"; + MD5AnimParser.NUM_FRAMES_TOKEN = "numFrames"; + MD5AnimParser.NUM_JOINTS_TOKEN = "numJoints"; + MD5AnimParser.FRAME_RATE_TOKEN = "frameRate"; + MD5AnimParser.NUM_ANIMATED_COMPONENTS_TOKEN = "numAnimatedComponents"; + MD5AnimParser.HIERARCHY_TOKEN = "hierarchy"; + MD5AnimParser.BOUNDS_TOKEN = "bounds"; + MD5AnimParser.BASE_FRAME_TOKEN = "baseframe"; + MD5AnimParser.FRAME_TOKEN = "frame"; + MD5AnimParser.COMMENT_TOKEN = "//"; + return MD5AnimParser; +})(ParserBase); +module.exports = MD5AnimParser; + + +},{"awayjs-core/lib/core/geom/Quaternion":undefined,"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-core/lib/core/net/URLLoaderDataFormat":undefined,"awayjs-core/lib/parsers/ParserBase":undefined,"awayjs-renderergl/lib/animators/data/JointPose":undefined,"awayjs-renderergl/lib/animators/data/SkeletonPose":undefined,"awayjs-renderergl/lib/animators/nodes/SkeletonClipNode":undefined,"awayjs-renderergl/lib/parsers/data/BaseFrameData":undefined,"awayjs-renderergl/lib/parsers/data/BoundsData":undefined,"awayjs-renderergl/lib/parsers/data/FrameData":undefined,"awayjs-renderergl/lib/parsers/data/HierarchyData":undefined}],"awayjs-renderergl/lib/parsers/MD5MeshParser":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var DisplayObjectContainer = require("awayjs-core/lib/containers/DisplayObjectContainer"); +var Geometry = require("awayjs-core/lib/core/base/Geometry"); +var TriangleSubGeometry = require("awayjs-core/lib/core/base/TriangleSubGeometry"); +var Quaternion = require("awayjs-core/lib/core/geom/Quaternion"); +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var URLLoaderDataFormat = require("awayjs-core/lib/core/net/URLLoaderDataFormat"); +var Mesh = require("awayjs-core/lib/entities/Mesh"); +var ParserBase = require("awayjs-core/lib/parsers/ParserBase"); +var SkeletonAnimationSet = require("awayjs-renderergl/lib/animators/SkeletonAnimationSet"); +var Skeleton = require("awayjs-renderergl/lib/animators/data/Skeleton"); +var SkeletonJoint = require("awayjs-renderergl/lib/animators/data/SkeletonJoint"); +// todo: create animation system, parse skeleton +/** + * MD5MeshParser provides a parser for the md5mesh data type, providing the geometry of the md5 format. + * + * todo: optimize + */ +var MD5MeshParser = (function (_super) { + __extends(MD5MeshParser, _super); + /** + * Creates a new MD5MeshParser object. + */ + function MD5MeshParser(additionalRotationAxis, additionalRotationRadians) { + if (additionalRotationAxis === void 0) { additionalRotationAxis = null; } + if (additionalRotationRadians === void 0) { additionalRotationRadians = 0; } + _super.call(this, URLLoaderDataFormat.TEXT); + this._parseIndex = 0; + this._line = 0; + this._charLineIndex = 0; + this._rotationQuat = new Quaternion(); + this._rotationQuat.fromAxisAngle(Vector3D.X_AXIS, -Math.PI * .5); + if (additionalRotationAxis) { + var quat = new Quaternion(); + quat.fromAxisAngle(additionalRotationAxis, additionalRotationRadians); + this._rotationQuat.multiply(this._rotationQuat, quat); + } + } + /** + * Indicates whether or not a given file extension is supported by the parser. + * @param extension The file extension of a potential file to be parsed. + * @return Whether or not the given file type is supported. + */ + MD5MeshParser.supportsType = function (extension) { + extension = extension.toLowerCase(); + return extension == "md5mesh"; + }; + /** + * Tests whether a data block can be parsed by the parser. + * @param data The data block to potentially be parsed. + * @return Whether or not the given data is supported. + */ + MD5MeshParser.supportsData = function (data) { + return false; + }; + /** + * @inheritDoc + */ + MD5MeshParser.prototype._pProceedParsing = function () { + var token; + if (!this._startedParsing) { + this._textData = this._pGetTextData(); + this._startedParsing = true; + } + while (this._pHasTime()) { + token = this.getNextToken(); + switch (token) { + case MD5MeshParser.COMMENT_TOKEN: + this.ignoreLine(); + break; + case MD5MeshParser.VERSION_TOKEN: + this._version = this.getNextInt(); + if (this._version != 10) + throw new Error("Unknown version number encountered!"); + break; + case MD5MeshParser.COMMAND_LINE_TOKEN: + this.parseCMD(); + break; + case MD5MeshParser.NUM_JOINTS_TOKEN: + this._numJoints = this.getNextInt(); + this._bindPoses = new Array(this._numJoints); + break; + case MD5MeshParser.NUM_MESHES_TOKEN: + this._numMeshes = this.getNextInt(); + break; + case MD5MeshParser.JOINTS_TOKEN: + this.parseJoints(); + break; + case MD5MeshParser.MESH_TOKEN: + this.parseMesh(); + break; + default: + if (!this._reachedEOF) + this.sendUnknownKeywordError(); + } + if (this._reachedEOF) { + this.calculateMaxJointCount(); + this._animationSet = new SkeletonAnimationSet(this._maxJointCount); + this._mesh = new Mesh(new Geometry(), null); + this._geometry = this._mesh.geometry; + for (var i = 0; i < this._meshData.length; ++i) + this._geometry.addSubGeometry(this.translateGeom(this._meshData[i].vertexData, this._meshData[i].weightData, this._meshData[i].indices)); + //_geometry.animation = _animation; + // _mesh.animationController = _animationController; + //add to the content property + this._pContent.addChild(this._mesh); + this._pFinalizeAsset(this._geometry); + this._pFinalizeAsset(this._mesh); + this._pFinalizeAsset(this._skeleton); + this._pFinalizeAsset(this._animationSet); + return ParserBase.PARSING_DONE; + } + } + return ParserBase.MORE_TO_PARSE; + }; + MD5MeshParser.prototype._pStartParsing = function (frameLimit) { + _super.prototype._pStartParsing.call(this, frameLimit); + //create a content object for Loaders + this._pContent = new DisplayObjectContainer(); + }; + MD5MeshParser.prototype.calculateMaxJointCount = function () { + this._maxJointCount = 0; + var numMeshData = this._meshData.length; + for (var i = 0; i < numMeshData; ++i) { + var meshData = this._meshData[i]; + var vertexData = meshData.vertexData; + var numVerts = vertexData.length; + for (var j = 0; j < numVerts; ++j) { + var zeroWeights = this.countZeroWeightJoints(vertexData[j], meshData.weightData); + var totalJoints = vertexData[j].countWeight - zeroWeights; + if (totalJoints > this._maxJointCount) + this._maxJointCount = totalJoints; + } + } + }; + MD5MeshParser.prototype.countZeroWeightJoints = function (vertex, weights) { + var start = vertex.startWeight; + var end = vertex.startWeight + vertex.countWeight; + var count = 0; + var weight; + for (var i = start; i < end; ++i) { + weight = weights[i].bias; + if (weight == 0) + ++count; + } + return count; + }; + /** + * Parses the skeleton's joints. + */ + MD5MeshParser.prototype.parseJoints = function () { + var ch; + var joint; + var pos; + var quat; + var i = 0; + var token = this.getNextToken(); + if (token != "{") + this.sendUnknownKeywordError(); + this._skeleton = new Skeleton(); + do { + if (this._reachedEOF) + this.sendEOFError(); + joint = new SkeletonJoint(); + joint.name = this.parseLiteralstring(); + joint.parentIndex = this.getNextInt(); + pos = this.parseVector3D(); + pos = this._rotationQuat.rotatePoint(pos); + quat = this.parseQuaternion(); + // todo: check if this is correct, or maybe we want to actually store it as quats? + this._bindPoses[i] = quat.toMatrix3D(); + this._bindPoses[i].appendTranslation(pos.x, pos.y, pos.z); + var inv = this._bindPoses[i].clone(); + inv.invert(); + joint.inverseBindPose = inv.rawData; + this._skeleton.joints[i++] = joint; + ch = this.getNextChar(); + if (ch == "/") { + this.putBack(); + ch = this.getNextToken(); + if (ch == MD5MeshParser.COMMENT_TOKEN) + this.ignoreLine(); + ch = this.getNextChar(); + } + if (ch != "}") + this.putBack(); + } while (ch != "}"); + }; + /** + * Puts back the last read character into the data stream. + */ + MD5MeshParser.prototype.putBack = function () { + this._parseIndex--; + this._charLineIndex--; + this._reachedEOF = this._parseIndex >= this._textData.length; + }; + /** + * Parses the mesh geometry. + */ + MD5MeshParser.prototype.parseMesh = function () { + var token = this.getNextToken(); + var ch; + var vertexData; + var weights; + var indices /*uint*/; + if (token != "{") + this.sendUnknownKeywordError(); + if (this._shaders == null) + this._shaders = new Array(); + while (ch != "}") { + ch = this.getNextToken(); + switch (ch) { + case MD5MeshParser.COMMENT_TOKEN: + this.ignoreLine(); + break; + case MD5MeshParser.MESH_SHADER_TOKEN: + this._shaders.push(this.parseLiteralstring()); + break; + case MD5MeshParser.MESH_NUM_VERTS_TOKEN: + vertexData = new Array(this.getNextInt()); + break; + case MD5MeshParser.MESH_NUM_TRIS_TOKEN: + indices = new Array(this.getNextInt() * 3); + break; + case MD5MeshParser.MESH_NUM_WEIGHTS_TOKEN: + weights = new Array(this.getNextInt()); + break; + case MD5MeshParser.MESH_VERT_TOKEN: + this.parseVertex(vertexData); + break; + case MD5MeshParser.MESH_TRI_TOKEN: + this.parseTri(indices); + break; + case MD5MeshParser.MESH_WEIGHT_TOKEN: + this.parseJoint(weights); + break; + } + } + if (this._meshData == null) + this._meshData = new Array(); + var i = this._meshData.length; + this._meshData[i] = new MeshData(); + this._meshData[i].vertexData = vertexData; + this._meshData[i].weightData = weights; + this._meshData[i].indices = indices; + }; + /** + * Converts the mesh data to a SkinnedSub instance. + * @param vertexData The mesh's vertices. + * @param weights The joint weights per vertex. + * @param indices The indices for the faces. + * @return A SubGeometry instance containing all geometrical data for the current mesh. + */ + MD5MeshParser.prototype.translateGeom = function (vertexData, weights, indices /*uint*/) { + var len = vertexData.length; + var v1 /*int*/, v2 /*int*/, v3 /*int*/; + var vertex; + var weight; + var bindPose; + var pos; + var subGeom = new TriangleSubGeometry(true); + var uvs = new Array(len * 2); + var vertices = new Array(len * 3); + var jointIndices = new Array(len * this._maxJointCount); + var jointWeights = new Array(len * this._maxJointCount); + var l = 0; + var nonZeroWeights /*int*/; + for (var i = 0; i < len; ++i) { + vertex = vertexData[i]; + v1 = vertex.index * 3; + v2 = v1 + 1; + v3 = v1 + 2; + vertices[v1] = vertices[v2] = vertices[v3] = 0; + nonZeroWeights = 0; + for (var j = 0; j < vertex.countWeight; ++j) { + weight = weights[vertex.startWeight + j]; + if (weight.bias > 0) { + bindPose = this._bindPoses[weight.joint]; + pos = bindPose.transformVector(weight.pos); + vertices[v1] += pos.x * weight.bias; + vertices[v2] += pos.y * weight.bias; + vertices[v3] += pos.z * weight.bias; + // indices need to be multiplied by 3 (amount of matrix registers) + jointIndices[l] = weight.joint * 3; + jointWeights[l++] = weight.bias; + ++nonZeroWeights; + } + } + for (j = nonZeroWeights; j < this._maxJointCount; ++j) { + jointIndices[l] = 0; + jointWeights[l++] = 0; + } + v1 = vertex.index << 1; + uvs[v1++] = vertex.s; + uvs[v1] = vertex.t; + } + subGeom.jointsPerVertex = this._maxJointCount; + subGeom.updateIndices(indices); + subGeom.updatePositions(vertices); + subGeom.updateUVs(uvs); + subGeom.updateJointIndices(jointIndices); + subGeom.updateJointWeights(jointWeights); + // cause explicit updates + subGeom.vertexNormals; + subGeom.vertexTangents; + // turn auto updates off because they may be animated and set explicitly + subGeom.autoDeriveTangents = false; + subGeom.autoDeriveNormals = false; + return subGeom; + }; + /** + * Retrieve the next triplet of vertex indices that form a face. + * @param indices The index list in which to store the read data. + */ + MD5MeshParser.prototype.parseTri = function (indices /*uint*/) { + var index = this.getNextInt() * 3; + indices[index] = this.getNextInt(); + indices[index + 1] = this.getNextInt(); + indices[index + 2] = this.getNextInt(); + }; + /** + * Reads a new joint data set for a single joint. + * @param weights the target list to contain the weight data. + */ + MD5MeshParser.prototype.parseJoint = function (weights) { + var weight = new JointData(); + weight.index = this.getNextInt(); + weight.joint = this.getNextInt(); + weight.bias = this.getNextNumber(); + weight.pos = this.parseVector3D(); + weights[weight.index] = weight; + }; + /** + * Reads the data for a single vertex. + * @param vertexData The list to contain the vertex data. + */ + MD5MeshParser.prototype.parseVertex = function (vertexData) { + var vertex = new VertexData(); + vertex.index = this.getNextInt(); + this.parseUV(vertex); + vertex.startWeight = this.getNextInt(); + vertex.countWeight = this.getNextInt(); + // if (vertex.countWeight > _maxJointCount) _maxJointCount = vertex.countWeight; + vertexData[vertex.index] = vertex; + }; + /** + * Reads the next uv coordinate. + * @param vertexData The vertexData to contain the UV coordinates. + */ + MD5MeshParser.prototype.parseUV = function (vertexData) { + var ch = this.getNextToken(); + if (ch != "(") + this.sendParseError("("); + vertexData.s = this.getNextNumber(); + vertexData.t = this.getNextNumber(); + if (this.getNextToken() != ")") + this.sendParseError(")"); + }; + /** + * Gets the next token in the data stream. + */ + MD5MeshParser.prototype.getNextToken = function () { + var ch; + var token = ""; + while (!this._reachedEOF) { + ch = this.getNextChar(); + if (ch == " " || ch == "\r" || ch == "\n" || ch == "\t") { + if (token != MD5MeshParser.COMMENT_TOKEN) + this.skipWhiteSpace(); + if (token != "") + return token; + } + else + token += ch; + if (token == MD5MeshParser.COMMENT_TOKEN) + return token; + } + return token; + }; + /** + * Skips all whitespace in the data stream. + */ + MD5MeshParser.prototype.skipWhiteSpace = function () { + var ch; + do + ch = this.getNextChar(); + while (ch == "\n" || ch == " " || ch == "\r" || ch == "\t"); + this.putBack(); + }; + /** + * Skips to the next line. + */ + MD5MeshParser.prototype.ignoreLine = function () { + var ch; + while (!this._reachedEOF && ch != "\n") + ch = this.getNextChar(); + }; + /** + * Retrieves the next single character in the data stream. + */ + MD5MeshParser.prototype.getNextChar = function () { + var ch = this._textData.charAt(this._parseIndex++); + if (ch == "\n") { + ++this._line; + this._charLineIndex = 0; + } + else if (ch != "\r") + ++this._charLineIndex; + if (this._parseIndex >= this._textData.length) + this._reachedEOF = true; + return ch; + }; + /** + * Retrieves the next integer in the data stream. + */ + MD5MeshParser.prototype.getNextInt = function () { + var i = parseInt(this.getNextToken()); + if (isNaN(i)) + this.sendParseError("int type"); + return i; + }; + /** + * Retrieves the next floating point number in the data stream. + */ + MD5MeshParser.prototype.getNextNumber = function () { + var f = parseFloat(this.getNextToken()); + if (isNaN(f)) + this.sendParseError("float type"); + return f; + }; + /** + * Retrieves the next 3d vector in the data stream. + */ + MD5MeshParser.prototype.parseVector3D = function () { + var vec = new Vector3D(); + var ch = this.getNextToken(); + if (ch != "(") + this.sendParseError("("); + vec.x = -this.getNextNumber(); + vec.y = this.getNextNumber(); + vec.z = this.getNextNumber(); + if (this.getNextToken() != ")") + this.sendParseError(")"); + return vec; + }; + /** + * Retrieves the next quaternion in the data stream. + */ + MD5MeshParser.prototype.parseQuaternion = function () { + var quat = new Quaternion(); + var ch = this.getNextToken(); + if (ch != "(") + this.sendParseError("("); + quat.x = this.getNextNumber(); + quat.y = -this.getNextNumber(); + quat.z = -this.getNextNumber(); + // quat supposed to be unit length + var t = 1 - quat.x * quat.x - quat.y * quat.y - quat.z * quat.z; + quat.w = t < 0 ? 0 : -Math.sqrt(t); + if (this.getNextToken() != ")") + this.sendParseError(")"); + var rotQuat = new Quaternion(); + rotQuat.multiply(this._rotationQuat, quat); + return rotQuat; + }; + /** + * Parses the command line data. + */ + MD5MeshParser.prototype.parseCMD = function () { + // just ignore the command line property + this.parseLiteralstring(); + }; + /** + * Retrieves the next literal string in the data stream. A literal string is a sequence of characters bounded + * by double quotes. + */ + MD5MeshParser.prototype.parseLiteralstring = function () { + this.skipWhiteSpace(); + var ch = this.getNextChar(); + var str = ""; + if (ch != "\"") + this.sendParseError("\""); + do { + if (this._reachedEOF) + this.sendEOFError(); + ch = this.getNextChar(); + if (ch != "\"") + str += ch; + } while (ch != "\""); + return str; + }; + /** + * Throws an end-of-file error when a premature end of file was encountered. + */ + MD5MeshParser.prototype.sendEOFError = function () { + throw new Error("Unexpected end of file"); + }; + /** + * Throws an error when an unexpected token was encountered. + * @param expected The token type that was actually expected. + */ + MD5MeshParser.prototype.sendParseError = function (expected) { + throw new Error("Unexpected token at line " + (this._line + 1) + ", character " + this._charLineIndex + ". " + expected + " expected, but " + this._textData.charAt(this._parseIndex - 1) + " encountered"); + }; + /** + * Throws an error when an unknown keyword was encountered. + */ + MD5MeshParser.prototype.sendUnknownKeywordError = function () { + throw new Error("Unknown keyword at line " + (this._line + 1) + ", character " + this._charLineIndex + ". "); + }; + MD5MeshParser.VERSION_TOKEN = "MD5Version"; + MD5MeshParser.COMMAND_LINE_TOKEN = "commandline"; + MD5MeshParser.NUM_JOINTS_TOKEN = "numJoints"; + MD5MeshParser.NUM_MESHES_TOKEN = "numMeshes"; + MD5MeshParser.COMMENT_TOKEN = "//"; + MD5MeshParser.JOINTS_TOKEN = "joints"; + MD5MeshParser.MESH_TOKEN = "mesh"; + MD5MeshParser.MESH_SHADER_TOKEN = "shader"; + MD5MeshParser.MESH_NUM_VERTS_TOKEN = "numverts"; + MD5MeshParser.MESH_VERT_TOKEN = "vert"; + MD5MeshParser.MESH_NUM_TRIS_TOKEN = "numtris"; + MD5MeshParser.MESH_TRI_TOKEN = "tri"; + MD5MeshParser.MESH_NUM_WEIGHTS_TOKEN = "numweights"; + MD5MeshParser.MESH_WEIGHT_TOKEN = "weight"; + return MD5MeshParser; +})(ParserBase); +var VertexData = (function () { + function VertexData() { + } + return VertexData; +})(); +var JointData = (function () { + function JointData() { + } + return JointData; +})(); +var MeshData = (function () { + function MeshData() { + } + return MeshData; +})(); +module.exports = MD5MeshParser; + + +},{"awayjs-core/lib/containers/DisplayObjectContainer":undefined,"awayjs-core/lib/core/base/Geometry":undefined,"awayjs-core/lib/core/base/TriangleSubGeometry":undefined,"awayjs-core/lib/core/geom/Quaternion":undefined,"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-core/lib/core/net/URLLoaderDataFormat":undefined,"awayjs-core/lib/entities/Mesh":undefined,"awayjs-core/lib/parsers/ParserBase":undefined,"awayjs-renderergl/lib/animators/SkeletonAnimationSet":undefined,"awayjs-renderergl/lib/animators/data/Skeleton":undefined,"awayjs-renderergl/lib/animators/data/SkeletonJoint":undefined}],"awayjs-renderergl/lib/parsers/Max3DSParser":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var DisplayObjectContainer = require("awayjs-core/lib/containers/DisplayObjectContainer"); +var Geometry = require("awayjs-core/lib/core/base/Geometry"); +var TriangleSubGeometry = require("awayjs-core/lib/core/base/TriangleSubGeometry"); +var Matrix3D = require("awayjs-core/lib/core/geom/Matrix3D"); +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var AssetType = require("awayjs-core/lib/core/library/AssetType"); +var URLLoaderDataFormat = require("awayjs-core/lib/core/net/URLLoaderDataFormat"); +var URLRequest = require("awayjs-core/lib/core/net/URLRequest"); +var Mesh = require("awayjs-core/lib/entities/Mesh"); +var ParserBase = require("awayjs-core/lib/parsers/ParserBase"); +var ParserUtils = require("awayjs-core/lib/parsers/ParserUtils"); +var DefaultMaterialManager = require("awayjs-stagegl/lib/materials/utils/DefaultMaterialManager"); +var TriangleMethodMaterial = require("awayjs-stagegl/lib/materials/TriangleMethodMaterial"); +var TriangleMaterialMode = require("awayjs-stagegl/lib/materials/TriangleMaterialMode"); +var FaceVO = require("awayjs-renderergl/lib/parsers/data/FaceVO"); +var MaterialVO = require("awayjs-renderergl/lib/parsers/data/MaterialVO"); +var ObjectVO = require("awayjs-renderergl/lib/parsers/data/ObjectVO"); +var TextureVO = require("awayjs-renderergl/lib/parsers/data/TextureVO"); +var VertexVO = require("awayjs-renderergl/lib/parsers/data/VertexVO"); +/** + * Max3DSParser provides a parser for the 3ds data type. + */ +var Max3DSParser = (function (_super) { + __extends(Max3DSParser, _super); + /** + * Creates a new Max3DSParser object. + * + * @param useSmoothingGroups Determines whether the parser looks for smoothing groups in the 3ds file or assumes uniform smoothing. Defaults to true. + */ + function Max3DSParser(useSmoothingGroups) { + if (useSmoothingGroups === void 0) { useSmoothingGroups = true; } + _super.call(this, URLLoaderDataFormat.ARRAY_BUFFER); + this._useSmoothingGroups = useSmoothingGroups; + } + /** + * Indicates whether or not a given file extension is supported by the parser. + * @param extension The file extension of a potential file to be parsed. + * @return Whether or not the given file type is supported. + */ + Max3DSParser.supportsType = function (extension) { + extension = extension.toLowerCase(); + return extension == "3ds"; + }; + /** + * Tests whether a data block can be parsed by the parser. + * @param data The data block to potentially be parsed. + * @return Whether or not the given data is supported. + */ + Max3DSParser.supportsData = function (data) { + var ba; + ba = ParserUtils.toByteArray(data); + if (ba) { + ba.position = 0; + if (ba.readShort() == 0x4d4d) + return true; + } + return false; + }; + /** + * @inheritDoc + */ + Max3DSParser.prototype._iResolveDependency = function (resourceDependency) { + if (resourceDependency.assets.length == 1) { + var asset; + asset = resourceDependency.assets[0]; + if (asset.assetType == AssetType.TEXTURE) { + var tex; + tex = this._textures[resourceDependency.id]; + tex.texture = asset; + } + } + }; + /** + * @inheritDoc + */ + Max3DSParser.prototype._iResolveDependencyFailure = function (resourceDependency) { + // TODO: Implement + }; + /** + * @inheritDoc + */ + Max3DSParser.prototype._pProceedParsing = function () { + if (!this._byteData) { + this._byteData = this._pGetByteData(); + this._byteData.position = 0; + //---------------------------------------------------------------------------- + // LITTLE_ENDIAN - Default for ArrayBuffer / Not implemented in ByteArray + //---------------------------------------------------------------------------- + //this._byteData.endian = Endian.LITTLE_ENDIAN;// Should be default + //---------------------------------------------------------------------------- + this._textures = {}; + this._materials = {}; + this._unfinalized_objects = {}; + } + while (this._pHasTime()) { + // If we are currently working on an object, and the most recent chunk was + // the last one in that object, finalize the current object. + if (this._cur_mat && this._byteData.position >= this._cur_mat_end) + this.finalizeCurrentMaterial(); + else if (this._cur_obj && this._byteData.position >= this._cur_obj_end) { + // Can't finalize at this point, because we have to wait until the full + // animation section has been parsed for any potential pivot definitions + this._unfinalized_objects[this._cur_obj.name] = this._cur_obj; + this._cur_obj_end = Number.MAX_VALUE; + this._cur_obj = null; + } + if (this._byteData.getBytesAvailable() > 0) { + var cid /*uint*/; + var len /*uint*/; + var end /*uint*/; + cid = this._byteData.readUnsignedShort(); + len = this._byteData.readUnsignedInt(); + end = this._byteData.position + (len - 6); + switch (cid) { + case 0x4D4D: + case 0x3D3D: + case 0xB000: + continue; + break; + case 0xAFFF: + this._cur_mat_end = end; + this._cur_mat = this.parseMaterial(); + break; + case 0x4000: + this._cur_obj_end = end; + this._cur_obj = new ObjectVO(); + this._cur_obj.name = this.readNulTermstring(); + this._cur_obj.materials = new Array(); + this._cur_obj.materialFaces = {}; + break; + case 0x4100: + this._cur_obj.type = AssetType.MESH; + break; + case 0x4110: + this.parseVertexList(); + break; + case 0x4120: + this.parseFaceList(); + break; + case 0x4140: + this.parseUVList(); + break; + case 0x4130: + this.parseFaceMaterialList(); + break; + case 0x4160: + this._cur_obj.transform = this.readTransform(); + break; + case 0xB002: + this.parseObjectAnimation(end); + break; + case 0x4150: + this.parseSmoothingGroups(); + break; + default: + // Skip this (unknown) chunk + this._byteData.position += (len - 6); + break; + } + // Pause parsing if there were any dependencies found during this + // iteration (i.e. if there are any dependencies that need to be + // retrieved at this time.) + if (this.dependencies.length) { + this._pPauseAndRetrieveDependencies(); + break; + } + } + } + // More parsing is required if the entire byte array has not yet + // been read, or if there is a currently non-finalized object in + // the pipeline. + if (this._byteData.getBytesAvailable() || this._cur_obj || this._cur_mat) { + return ParserBase.MORE_TO_PARSE; + } + else { + var name; + for (name in this._unfinalized_objects) { + var obj; + obj = this.constructObject(this._unfinalized_objects[name]); + if (obj) { + //add to the content property + this._pContent.addChild(obj); + this._pFinalizeAsset(obj, name); + } + } + return ParserBase.PARSING_DONE; + } + }; + Max3DSParser.prototype._pStartParsing = function (frameLimit) { + _super.prototype._pStartParsing.call(this, frameLimit); + //create a content object for Loaders + this._pContent = new DisplayObjectContainer(); + }; + Max3DSParser.prototype.parseMaterial = function () { + var mat; + mat = new MaterialVO(); + while (this._byteData.position < this._cur_mat_end) { + var cid /*uint*/; + var len /*uint*/; + var end /*uint*/; + cid = this._byteData.readUnsignedShort(); + len = this._byteData.readUnsignedInt(); + end = this._byteData.position + (len - 6); + switch (cid) { + case 0xA000: + mat.name = this.readNulTermstring(); + break; + case 0xA010: + mat.ambientColor = this.readColor(); + break; + case 0xA020: + mat.diffuseColor = this.readColor(); + break; + case 0xA030: + mat.specularColor = this.readColor(); + break; + case 0xA081: + mat.twoSided = true; + break; + case 0xA200: + mat.colorMap = this.parseTexture(end); + break; + case 0xA204: + mat.specularMap = this.parseTexture(end); + break; + default: + this._byteData.position = end; + break; + } + } + return mat; + }; + Max3DSParser.prototype.parseTexture = function (end /*uint*/) { + var tex; + tex = new TextureVO(); + while (this._byteData.position < end) { + var cid /*uint*/; + var len /*uint*/; + cid = this._byteData.readUnsignedShort(); + len = this._byteData.readUnsignedInt(); + switch (cid) { + case 0xA300: + tex.url = this.readNulTermstring(); + break; + default: + // Skip this unknown texture sub-chunk + this._byteData.position += (len - 6); + break; + } + } + this._textures[tex.url] = tex; + this._pAddDependency(tex.url, new URLRequest(tex.url)); + return tex; + }; + Max3DSParser.prototype.parseVertexList = function () { + var i /*uint*/; + var len /*uint*/; + var count /*uint*/; + count = this._byteData.readUnsignedShort(); + this._cur_obj.verts = new Array(count * 3); + i = 0; + len = this._cur_obj.verts.length; + while (i < len) { + var x, y, z; + x = this._byteData.readFloat(); + y = this._byteData.readFloat(); + z = this._byteData.readFloat(); + this._cur_obj.verts[i++] = x; + this._cur_obj.verts[i++] = z; + this._cur_obj.verts[i++] = y; + } + }; + Max3DSParser.prototype.parseFaceList = function () { + var i /*uint*/; + var len /*uint*/; + var count /*uint*/; + count = this._byteData.readUnsignedShort(); + this._cur_obj.indices = new Array(count * 3); + i = 0; + len = this._cur_obj.indices.length; + while (i < len) { + var i0 /*uint*/, i1 /*uint*/, i2 /*uint*/; + i0 = this._byteData.readUnsignedShort(); + i1 = this._byteData.readUnsignedShort(); + i2 = this._byteData.readUnsignedShort(); + this._cur_obj.indices[i++] = i0; + this._cur_obj.indices[i++] = i2; + this._cur_obj.indices[i++] = i1; + // Skip "face info", irrelevant in Away3D + this._byteData.position += 2; + } + this._cur_obj.smoothingGroups = new Array(count); + }; + Max3DSParser.prototype.parseSmoothingGroups = function () { + var len = this._cur_obj.indices.length / 3; + var i = 0; + while (i < len) { + this._cur_obj.smoothingGroups[i] = this._byteData.readUnsignedInt(); + i++; + } + }; + Max3DSParser.prototype.parseUVList = function () { + var i /*uint*/; + var len /*uint*/; + var count /*uint*/; + count = this._byteData.readUnsignedShort(); + this._cur_obj.uvs = new Array(count * 2); + i = 0; + len = this._cur_obj.uvs.length; + while (i < len) { + this._cur_obj.uvs[i++] = this._byteData.readFloat(); + this._cur_obj.uvs[i++] = 1.0 - this._byteData.readFloat(); + } + }; + Max3DSParser.prototype.parseFaceMaterialList = function () { + var mat; + var count /*uint*/; + var i /*uint*/; + var faces /*uint*/; + mat = this.readNulTermstring(); + count = this._byteData.readUnsignedShort(); + faces = new Array(count); + i = 0; + while (i < faces.length) + faces[i++] = this._byteData.readUnsignedShort(); + this._cur_obj.materials.push(mat); + this._cur_obj.materialFaces[mat] = faces; + }; + Max3DSParser.prototype.parseObjectAnimation = function (end) { + var vo; + var obj; + var pivot; + var name; + var hier /*uint*/; + // Pivot defaults to origin + pivot = new Vector3D; + while (this._byteData.position < end) { + var cid /*uint*/; + var len /*uint*/; + cid = this._byteData.readUnsignedShort(); + len = this._byteData.readUnsignedInt(); + switch (cid) { + case 0xb010: + name = this.readNulTermstring(); + this._byteData.position += 4; + hier = this._byteData.readShort(); + break; + case 0xb013: + pivot.x = this._byteData.readFloat(); + pivot.z = this._byteData.readFloat(); + pivot.y = this._byteData.readFloat(); + break; + default: + this._byteData.position += (len - 6); + break; + } + } + // If name is "$$$DUMMY" this is an empty object (e.g. a container) + // and will be ignored in this version of the parser + // TODO: Implement containers in 3DS parser. + if (name != '$$$DUMMY' && this._unfinalized_objects.hasOwnProperty(name)) { + vo = this._unfinalized_objects[name]; + obj = this.constructObject(vo, pivot); + if (obj) { + //add to the content property + this._pContent.addChild(obj); + this._pFinalizeAsset(obj, vo.name); + } + delete this._unfinalized_objects[name]; + } + }; + Max3DSParser.prototype.constructObject = function (obj, pivot) { + if (pivot === void 0) { pivot = null; } + if (obj.type == AssetType.MESH) { + var i /*uint*/; + var sub; + var geom; + var mat; + var mesh; + var mtx; + var vertices; + var faces; + if (obj.materials.length > 1) + console.log("The Away3D 3DS parser does not support multiple materials per mesh at this point."); + // Ignore empty objects + if (!obj.indices || obj.indices.length == 0) + return null; + vertices = new Array(obj.verts.length / 3); + faces = new Array(obj.indices.length / 3); + this.prepareData(vertices, faces, obj); + if (this._useSmoothingGroups) + this.applySmoothGroups(vertices, faces); + obj.verts = new Array(vertices.length * 3); + for (i = 0; i < vertices.length; i++) { + obj.verts[i * 3] = vertices[i].x; + obj.verts[i * 3 + 1] = vertices[i].y; + obj.verts[i * 3 + 2] = vertices[i].z; + } + obj.indices = new Array(faces.length * 3); + for (i = 0; i < faces.length; i++) { + obj.indices[i * 3] = faces[i].a; + obj.indices[i * 3 + 1] = faces[i].b; + obj.indices[i * 3 + 2] = faces[i].c; + } + if (obj.uvs) { + // If the object had UVs to start with, use UVs generated by + // smoothing group splitting algorithm. Otherwise those UVs + // will be nonsense and should be skipped. + obj.uvs = new Array(vertices.length * 2); + for (i = 0; i < vertices.length; i++) { + obj.uvs[i * 2] = vertices[i].u; + obj.uvs[i * 2 + 1] = vertices[i].v; + } + } + geom = new Geometry(); + // Construct sub-geometries (potentially splitting buffers) + // and add them to geometry. + sub = new TriangleSubGeometry(true); + sub.updateIndices(obj.indices); + sub.updatePositions(obj.verts); + sub.updateUVs(obj.uvs); + geom.addSubGeometry(sub); + if (obj.materials.length > 0) { + var mname; + mname = obj.materials[0]; + mat = this._materials[mname].material; + } + // Apply pivot translation to geometry if a pivot was + // found while parsing the keyframe chunk earlier. + if (pivot) { + if (obj.transform) { + // If a transform was found while parsing the + // object chunk, use it to find the local pivot vector + var dat = obj.transform.concat(); + dat[12] = 0; + dat[13] = 0; + dat[14] = 0; + mtx = new Matrix3D(dat); + pivot = mtx.transformVector(pivot); + } + pivot.scaleBy(-1); + mtx = new Matrix3D(); + mtx.appendTranslation(pivot.x, pivot.y, pivot.z); + geom.applyTransformation(mtx); + } + // Apply transformation to geometry if a transformation + // was found while parsing the object chunk earlier. + if (obj.transform) { + mtx = new Matrix3D(obj.transform); + mtx.invert(); + geom.applyTransformation(mtx); + } + // Final transform applied to geometry. Finalize the geometry, + // which will no longer be modified after this point. + this._pFinalizeAsset(geom, obj.name.concat('_geom')); + // Build mesh and return it + mesh = new Mesh(geom, mat); + mesh.transform.matrix3D = new Matrix3D(obj.transform); + return mesh; + } + // If reached, unknown + return null; + }; + Max3DSParser.prototype.prepareData = function (vertices, faces, obj) { + // convert raw ObjectVO's data to structured VertexVO and FaceVO + var i /*int*/; + var j /*int*/; + var k /*int*/; + var len = obj.verts.length; + for (i = 0, j = 0, k = 0; i < len;) { + var v = new VertexVO; + v.x = obj.verts[i++]; + v.y = obj.verts[i++]; + v.z = obj.verts[i++]; + if (obj.uvs) { + v.u = obj.uvs[j++]; + v.v = obj.uvs[j++]; + } + vertices[k++] = v; + } + len = obj.indices.length; + for (i = 0, k = 0; i < len;) { + var f = new FaceVO(); + f.a = obj.indices[i++]; + f.b = obj.indices[i++]; + f.c = obj.indices[i++]; + f.smoothGroup = obj.smoothingGroups[k] || 0; + faces[k++] = f; + } + }; + Max3DSParser.prototype.applySmoothGroups = function (vertices, faces) { + // clone vertices according to following rule: + // clone if vertex's in faces from groups 1+2 and 3 + // don't clone if vertex's in faces from groups 1+2, 3 and 1+3 + var i /*int*/; + var j /*int*/; + var k /*int*/; + var l /*int*/; + var len /*int*/; + var numVerts = vertices.length; + var numFaces = faces.length; + // extract groups data for vertices + var vGroups = new Array(numVerts) /*uint*/; + for (i = 0; i < numVerts; i++) + vGroups[i] = new Array(); + for (i = 0; i < numFaces; i++) { + var face = faces[i]; + for (j = 0; j < 3; j++) { + var groups = vGroups[(j == 0) ? face.a : ((j == 1) ? face.b : face.c)]; + var group = face.smoothGroup; + for (k = groups.length - 1; k >= 0; k--) { + if ((group & groups[k]) > 0) { + group |= groups[k]; + groups.splice(k, 1); + k = groups.length - 1; + } + } + groups.push(group); + } + } + // clone vertices + var vClones = new Array(numVerts) /*uint*/; + for (i = 0; i < numVerts; i++) { + if ((len = vGroups[i].length) < 1) + continue; + var clones = new Array(len) /*uint*/; + vClones[i] = clones; + clones[0] = i; + var v0 = vertices[i]; + for (j = 1; j < len; j++) { + var v1 = new VertexVO; + v1.x = v0.x; + v1.y = v0.y; + v1.z = v0.z; + v1.u = v0.u; + v1.v = v0.v; + clones[j] = vertices.length; + vertices.push(v1); + } + } + numVerts = vertices.length; + for (i = 0; i < numFaces; i++) { + face = faces[i]; + group = face.smoothGroup; + for (j = 0; j < 3; j++) { + k = (j == 0) ? face.a : ((j == 1) ? face.b : face.c); + groups = vGroups[k]; + len = groups.length; + clones = vClones[k]; + for (l = 0; l < len; l++) { + if (((group == 0) && (groups[l] == 0)) || ((group & groups[l]) > 0)) { + var index = clones[l]; + if (group == 0) { + // vertex is unique if no smoothGroup found + groups.splice(l, 1); + clones.splice(l, 1); + } + if (j == 0) + face.a = index; + else if (j == 1) + face.b = index; + else + face.c = index; + l = len; + } + } + } + } + }; + Max3DSParser.prototype.finalizeCurrentMaterial = function () { + var mat; + if (this._cur_mat.colorMap) + mat = new TriangleMethodMaterial(this._cur_mat.colorMap.texture || DefaultMaterialManager.getDefaultTexture()); + else + mat = new TriangleMethodMaterial(this._cur_mat.ambientColor); + mat.diffuseColor = this._cur_mat.diffuseColor; + mat.specularColor = this._cur_mat.specularColor; + if (this.materialMode >= 2) + mat.materialMode = TriangleMaterialMode.MULTI_PASS; + mat.bothSides = this._cur_mat.twoSided; + this._pFinalizeAsset(mat, this._cur_mat.name); + this._materials[this._cur_mat.name] = this._cur_mat; + this._cur_mat.material = mat; + this._cur_mat = null; + }; + Max3DSParser.prototype.readNulTermstring = function () { + var chr /*int*/; + var str = ""; + while ((chr = this._byteData.readUnsignedByte()) > 0) + str += String.fromCharCode(chr); + return str; + }; + Max3DSParser.prototype.readTransform = function () { + var data; + data = new Array(16); + // X axis + data[0] = this._byteData.readFloat(); // X + data[2] = this._byteData.readFloat(); // Z + data[1] = this._byteData.readFloat(); // Y + data[3] = 0; + // Z axis + data[8] = this._byteData.readFloat(); // X + data[10] = this._byteData.readFloat(); // Z + data[9] = this._byteData.readFloat(); // Y + data[11] = 0; + // Y Axis + data[4] = this._byteData.readFloat(); // X + data[6] = this._byteData.readFloat(); // Z + data[5] = this._byteData.readFloat(); // Y + data[7] = 0; + // Translation + data[12] = this._byteData.readFloat(); // X + data[14] = this._byteData.readFloat(); // Z + data[13] = this._byteData.readFloat(); // Y + data[15] = 1; + return data; + }; + Max3DSParser.prototype.readColor = function () { + var cid /*int*/; + var len /*int*/; + var r /*int*/, g /*int*/, b /*int*/; + cid = this._byteData.readUnsignedShort(); + len = this._byteData.readUnsignedInt(); + switch (cid) { + case 0x0010: + r = this._byteData.readFloat() * 255; + g = this._byteData.readFloat() * 255; + b = this._byteData.readFloat() * 255; + break; + case 0x0011: + r = this._byteData.readUnsignedByte(); + g = this._byteData.readUnsignedByte(); + b = this._byteData.readUnsignedByte(); + break; + default: + this._byteData.position += (len - 6); + break; + } + return (r << 16) | (g << 8) | b; + }; + return Max3DSParser; +})(ParserBase); +module.exports = Max3DSParser; + + +},{"awayjs-core/lib/containers/DisplayObjectContainer":undefined,"awayjs-core/lib/core/base/Geometry":undefined,"awayjs-core/lib/core/base/TriangleSubGeometry":undefined,"awayjs-core/lib/core/geom/Matrix3D":undefined,"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-core/lib/core/library/AssetType":undefined,"awayjs-core/lib/core/net/URLLoaderDataFormat":undefined,"awayjs-core/lib/core/net/URLRequest":undefined,"awayjs-core/lib/entities/Mesh":undefined,"awayjs-core/lib/parsers/ParserBase":undefined,"awayjs-core/lib/parsers/ParserUtils":undefined,"awayjs-renderergl/lib/parsers/data/FaceVO":undefined,"awayjs-renderergl/lib/parsers/data/MaterialVO":undefined,"awayjs-renderergl/lib/parsers/data/ObjectVO":undefined,"awayjs-renderergl/lib/parsers/data/TextureVO":undefined,"awayjs-renderergl/lib/parsers/data/VertexVO":undefined,"awayjs-stagegl/lib/materials/TriangleMaterialMode":undefined,"awayjs-stagegl/lib/materials/TriangleMethodMaterial":undefined,"awayjs-stagegl/lib/materials/utils/DefaultMaterialManager":undefined}],"awayjs-renderergl/lib/parsers/OBJParser":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var DisplayObjectContainer = require("awayjs-core/lib/containers/DisplayObjectContainer"); +var TriangleSubGeometry = require("awayjs-core/lib/core/base/TriangleSubGeometry"); +var Geometry = require("awayjs-core/lib/core/base/Geometry"); +var AssetType = require("awayjs-core/lib/core/library/AssetType"); +var URLLoaderDataFormat = require("awayjs-core/lib/core/net/URLLoaderDataFormat"); +var URLRequest = require("awayjs-core/lib/core/net/URLRequest"); +var Mesh = require("awayjs-core/lib/entities/Mesh"); +var ParserBase = require("awayjs-core/lib/parsers/ParserBase"); +var ParserUtils = require("awayjs-core/lib/parsers/ParserUtils"); +var DefaultMaterialManager = require("awayjs-stagegl/lib/materials/utils/DefaultMaterialManager"); +var SpecularBasicMethod = require("awayjs-stagegl/lib/materials/methods/SpecularBasicMethod"); +var TriangleMethodMaterial = require("awayjs-stagegl/lib/materials/TriangleMethodMaterial"); +var TriangleMaterialMode = require("awayjs-stagegl/lib/materials/TriangleMaterialMode"); +/** + * OBJParser provides a parser for the OBJ data type. + */ +var OBJParser = (function (_super) { + __extends(OBJParser, _super); + /** + * Creates a new OBJParser object. + * @param uri The url or id of the data or file to be parsed. + * @param extra The holder for extra contextual data that the parser might need. + */ + function OBJParser(scale) { + if (scale === void 0) { scale = 1; } + _super.call(this, URLLoaderDataFormat.TEXT); + this._mtlLibLoaded = true; + this._activeMaterialID = ""; + this._scale = scale; + } + Object.defineProperty(OBJParser.prototype, "scale", { + /** + * Scaling factor applied directly to vertices data + * @param value The scaling factor. + */ + set: function (value) { + this._scale = value; + }, + enumerable: true, + configurable: true + }); + /** + * Indicates whether or not a given file extension is supported by the parser. + * @param extension The file extension of a potential file to be parsed. + * @return Whether or not the given file type is supported. + */ + OBJParser.supportsType = function (extension) { + extension = extension.toLowerCase(); + return extension == "obj"; + }; + /** + * Tests whether a data block can be parsed by the parser. + * @param data The data block to potentially be parsed. + * @return Whether or not the given data is supported. + */ + OBJParser.supportsData = function (data) { + var content = ParserUtils.toString(data); + var hasV = false; + var hasF = false; + if (content) { + hasV = content.indexOf("\nv ") != -1; + hasF = content.indexOf("\nf ") != -1; + } + return hasV && hasF; + }; + /** + * @inheritDoc + */ + OBJParser.prototype._iResolveDependency = function (resourceDependency) { + if (resourceDependency.id == 'mtl') { + var str = ParserUtils.toString(resourceDependency.data); + this.parseMtl(str); + } + else { + var asset; + if (resourceDependency.assets.length != 1) { + return; + } + asset = resourceDependency.assets[0]; + if (asset.assetType == AssetType.TEXTURE) { + var lm = new LoadedMaterial(); + lm.materialID = resourceDependency.id; + lm.texture = asset; + this._materialLoaded.push(lm); + if (this._meshes.length > 0) { + this.applyMaterial(lm); + } + } + } + }; + /** + * @inheritDoc + */ + OBJParser.prototype._iResolveDependencyFailure = function (resourceDependency) { + if (resourceDependency.id == "mtl") { + this._mtlLib = false; + this._mtlLibLoaded = false; + } + else { + var lm = new LoadedMaterial(); + lm.materialID = resourceDependency.id; + this._materialLoaded.push(lm); + } + if (this._meshes.length > 0) + this.applyMaterial(lm); + }; + /** + * @inheritDoc + */ + OBJParser.prototype._pProceedParsing = function () { + var line; + var creturn = String.fromCharCode(10); + var trunk; + if (!this._startedParsing) { + this._textData = this._pGetTextData(); + // Merge linebreaks that are immediately preceeded by + // the "escape" backward slash into single lines. + this._textData = this._textData.replace(/\\[\r\n]+\s*/gm, ' '); + } + if (this._textData.indexOf(creturn) == -1) + creturn = String.fromCharCode(13); + if (!this._startedParsing) { + this._startedParsing = true; + this._vertices = new Array(); + this._vertexNormals = new Array(); + this._materialIDs = new Array(); + this._materialLoaded = new Array(); + this._meshes = new Array(); + this._uvs = new Array(); + this._stringLength = this._textData.length; + this._charIndex = this._textData.indexOf(creturn, 0); + this._oldIndex = 0; + this._objects = new Array(); + this._objectIndex = 0; + } + while (this._charIndex < this._stringLength && this._pHasTime()) { + this._charIndex = this._textData.indexOf(creturn, this._oldIndex); + if (this._charIndex == -1) + this._charIndex = this._stringLength; + line = this._textData.substring(this._oldIndex, this._charIndex); + line = line.split('\r').join(""); + line = line.replace(" ", " "); + trunk = line.split(" "); + this._oldIndex = this._charIndex + 1; + this.parseLine(trunk); + // If whatever was parsed on this line resulted in the + // parsing being paused to retrieve dependencies, break + // here and do not continue parsing until un-paused. + if (this.parsingPaused) { + return ParserBase.MORE_TO_PARSE; + } + } + if (this._charIndex >= this._stringLength) { + if (this._mtlLib && !this._mtlLibLoaded) { + return ParserBase.MORE_TO_PARSE; + } + this.translate(); + this.applyMaterials(); + return ParserBase.PARSING_DONE; + } + return ParserBase.MORE_TO_PARSE; + }; + OBJParser.prototype._pStartParsing = function (frameLimit) { + _super.prototype._pStartParsing.call(this, frameLimit); + //create a content object for Loaders + this._pContent = new DisplayObjectContainer(); + }; + /** + * Parses a single line in the OBJ file. + */ + OBJParser.prototype.parseLine = function (trunk) { + switch (trunk[0]) { + case "mtllib": + this._mtlLib = true; + this._mtlLibLoaded = false; + this.loadMtl(trunk[1]); + break; + case "g": + this.createGroup(trunk); + break; + case "o": + this.createObject(trunk); + break; + case "usemtl": + if (this._mtlLib) { + if (!trunk[1]) + trunk[1] = "def000"; + this._materialIDs.push(trunk[1]); + this._activeMaterialID = trunk[1]; + if (this._currentGroup) + this._currentGroup.materialID = this._activeMaterialID; + } + break; + case "v": + this.parseVertex(trunk); + break; + case "vt": + this.parseUV(trunk); + break; + case "vn": + this.parseVertexNormal(trunk); + break; + case "f": + this.parseFace(trunk); + } + }; + /** + * Converts the parsed data into an Away3D scenegraph structure + */ + OBJParser.prototype.translate = function () { + for (var objIndex = 0; objIndex < this._objects.length; ++objIndex) { + var groups = this._objects[objIndex].groups; + var numGroups = groups.length; + var materialGroups; + var numMaterialGroups; + var geometry; + var mesh; + var m; + var sm; + var bmMaterial; + for (var g = 0; g < numGroups; ++g) { + geometry = new Geometry(); + materialGroups = groups[g].materialGroups; + numMaterialGroups = materialGroups.length; + for (m = 0; m < numMaterialGroups; ++m) + this.translateMaterialGroup(materialGroups[m], geometry); + if (geometry.subGeometries.length == 0) + continue; + // Finalize and force type-based name + this._pFinalizeAsset(geometry); //, ""); + bmMaterial = new TriangleMethodMaterial(DefaultMaterialManager.getDefaultTexture()); + //check for multipass + if (this.materialMode >= 2) + bmMaterial.materialMode = TriangleMaterialMode.MULTI_PASS; + mesh = new Mesh(geometry, bmMaterial); + if (this._objects[objIndex].name) { + // this is a full independent object ('o' tag in OBJ file) + mesh.name = this._objects[objIndex].name; + } + else if (groups[g].name) { + // this is a group so the sub groups contain the actual mesh object names ('g' tag in OBJ file) + mesh.name = groups[g].name; + } + else { + // No name stored. Use empty string which will force it + // to be overridden by finalizeAsset() to type default. + mesh.name = ""; + } + this._meshes.push(mesh); + if (groups[g].materialID != "") + bmMaterial.name = groups[g].materialID + "~" + mesh.name; + else + bmMaterial.name = this._lastMtlID + "~" + mesh.name; + if (mesh.subMeshes.length > 1) { + for (sm = 1; sm < mesh.subMeshes.length; ++sm) + mesh.subMeshes[sm].material = bmMaterial; + } + //add to the content property + this._pContent.addChild(mesh); + this._pFinalizeAsset(mesh); + } + } + }; + /** + * Translates an obj's material group to a subgeometry. + * @param materialGroup The material group data to convert. + * @param geometry The Geometry to contain the converted SubGeometry. + */ + OBJParser.prototype.translateMaterialGroup = function (materialGroup, geometry) { + var faces = materialGroup.faces; + var face; + var numFaces = faces.length; + var numVerts; + var sub; + var vertices = new Array(); + var uvs = new Array(); + var normals = new Array(); + var indices = new Array(); + this._realIndices = []; + this._vertexIndex = 0; + var j; + for (var i = 0; i < numFaces; ++i) { + face = faces[i]; + numVerts = face.indexIds.length - 1; + for (j = 1; j < numVerts; ++j) { + this.translateVertexData(face, j, vertices, uvs, indices, normals); + this.translateVertexData(face, 0, vertices, uvs, indices, normals); + this.translateVertexData(face, j + 1, vertices, uvs, indices, normals); + } + } + if (vertices.length > 0) { + sub = new TriangleSubGeometry(true); + sub.autoDeriveNormals = normals.length ? false : true; + sub.updateIndices(indices); + sub.updatePositions(vertices); + sub.updateVertexNormals(normals); + sub.updateUVs(uvs); + geometry.addSubGeometry(sub); + } + }; + OBJParser.prototype.translateVertexData = function (face, vertexIndex, vertices, uvs, indices /*uint*/, normals) { + var index; + var vertex; + var vertexNormal; + var uv; + if (!this._realIndices[face.indexIds[vertexIndex]]) { + index = this._vertexIndex; + this._realIndices[face.indexIds[vertexIndex]] = ++this._vertexIndex; + vertex = this._vertices[face.vertexIndices[vertexIndex] - 1]; + vertices.push(vertex.x * this._scale, vertex.y * this._scale, vertex.z * this._scale); + if (face.normalIndices.length > 0) { + vertexNormal = this._vertexNormals[face.normalIndices[vertexIndex] - 1]; + normals.push(vertexNormal.x, vertexNormal.y, vertexNormal.z); + } + if (face.uvIndices.length > 0) { + try { + uv = this._uvs[face.uvIndices[vertexIndex] - 1]; + uvs.push(uv.u, uv.v); + } + catch (e) { + switch (vertexIndex) { + case 0: + uvs.push(0, 1); + break; + case 1: + uvs.push(.5, 0); + break; + case 2: + uvs.push(1, 1); + } + } + } + } + else { + index = this._realIndices[face.indexIds[vertexIndex]] - 1; + } + indices.push(index); + }; + /** + * Creates a new object group. + * @param trunk The data block containing the object tag and its parameters + */ + OBJParser.prototype.createObject = function (trunk) { + this._currentGroup = null; + this._currentMaterialGroup = null; + this._objects.push(this._currentObject = new ObjectGroup()); + if (trunk) + this._currentObject.name = trunk[1]; + }; + /** + * Creates a new group. + * @param trunk The data block containing the group tag and its parameters + */ + OBJParser.prototype.createGroup = function (trunk) { + if (!this._currentObject) + this.createObject(null); + this._currentGroup = new Group(); + this._currentGroup.materialID = this._activeMaterialID; + if (trunk) + this._currentGroup.name = trunk[1]; + this._currentObject.groups.push(this._currentGroup); + this.createMaterialGroup(null); + }; + /** + * Creates a new material group. + * @param trunk The data block containing the material tag and its parameters + */ + OBJParser.prototype.createMaterialGroup = function (trunk) { + this._currentMaterialGroup = new MaterialGroup(); + if (trunk) + this._currentMaterialGroup.url = trunk[1]; + this._currentGroup.materialGroups.push(this._currentMaterialGroup); + }; + /** + * Reads the next vertex coordinates. + * @param trunk The data block containing the vertex tag and its parameters + */ + OBJParser.prototype.parseVertex = function (trunk) { + //for the very rare cases of other delimiters/charcodes seen in some obj files + var v1, v2, v3; + if (trunk.length > 4) { + var nTrunk = []; + var val; + for (var i = 1; i < trunk.length; ++i) { + val = parseFloat(trunk[i]); + if (!isNaN(val)) + nTrunk.push(val); + } + v1 = nTrunk[0]; + v2 = nTrunk[1]; + v3 = -nTrunk[2]; + this._vertices.push(new Vertex(v1, v2, v3)); + } + else { + v1 = parseFloat(trunk[1]); + v2 = parseFloat(trunk[2]); + v3 = -parseFloat(trunk[3]); + this._vertices.push(new Vertex(v1, v2, v3)); + } + }; + /** + * Reads the next uv coordinates. + * @param trunk The data block containing the uv tag and its parameters + */ + OBJParser.prototype.parseUV = function (trunk) { + if (trunk.length > 3) { + var nTrunk = []; + var val; + for (var i = 1; i < trunk.length; ++i) { + val = parseFloat(trunk[i]); + if (!isNaN(val)) + nTrunk.push(val); + } + this._uvs.push(new UV(nTrunk[0], 1 - nTrunk[1])); + } + else { + this._uvs.push(new UV(parseFloat(trunk[1]), 1 - parseFloat(trunk[2]))); + } + }; + /** + * Reads the next vertex normal coordinates. + * @param trunk The data block containing the vertex normal tag and its parameters + */ + OBJParser.prototype.parseVertexNormal = function (trunk) { + if (trunk.length > 4) { + var nTrunk = []; + var val; + for (var i = 1; i < trunk.length; ++i) { + val = parseFloat(trunk[i]); + if (!isNaN(val)) + nTrunk.push(val); + } + this._vertexNormals.push(new Vertex(nTrunk[0], nTrunk[1], -nTrunk[2])); + } + else { + this._vertexNormals.push(new Vertex(parseFloat(trunk[1]), parseFloat(trunk[2]), -parseFloat(trunk[3]))); + } + }; + /** + * Reads the next face's indices. + * @param trunk The data block containing the face tag and its parameters + */ + OBJParser.prototype.parseFace = function (trunk) { + var len = trunk.length; + var face = new FaceData(); + if (!this._currentGroup) { + this.createGroup(null); + } + var indices; + for (var i = 1; i < len; ++i) { + if (trunk[i] == "") { + continue; + } + indices = trunk[i].split("/"); + face.vertexIndices.push(this.parseIndex(parseInt(indices[0]), this._vertices.length)); + if (indices[1] && String(indices[1]).length > 0) + face.uvIndices.push(this.parseIndex(parseInt(indices[1]), this._uvs.length)); + if (indices[2] && String(indices[2]).length > 0) + face.normalIndices.push(this.parseIndex(parseInt(indices[2]), this._vertexNormals.length)); + face.indexIds.push(trunk[i]); + } + this._currentMaterialGroup.faces.push(face); + }; + /** + * This is a hack around negative face coords + */ + OBJParser.prototype.parseIndex = function (index, length) { + if (index < 0) + return index + length + 1; + else + return index; + }; + OBJParser.prototype.parseMtl = function (data) { + var materialDefinitions = data.split('newmtl'); + var lines; + var trunk; + var j; + var basicSpecularMethod; + var useSpecular; + var useColor; + var diffuseColor; + var color; + var specularColor; + var specular; + var alpha; + var mapkd; + for (var i = 0; i < materialDefinitions.length; ++i) { + lines = (materialDefinitions[i].split('\r')).join("").split('\n'); + //lines = (materialDefinitions[i].split('\r') as Array).join("").split('\n'); + if (lines.length == 1) + lines = materialDefinitions[i].split(String.fromCharCode(13)); + diffuseColor = color = specularColor = 0xFFFFFF; + specular = 0; + useSpecular = false; + useColor = false; + alpha = 1; + mapkd = ""; + for (j = 0; j < lines.length; ++j) { + lines[j] = lines[j].replace(/\s+$/, ""); + if (lines[j].substring(0, 1) != "#" && (j == 0 || lines[j] != "")) { + trunk = lines[j].split(" "); + if (String(trunk[0]).charCodeAt(0) == 9 || String(trunk[0]).charCodeAt(0) == 32) + trunk[0] = trunk[0].substring(1, trunk[0].length); + if (j == 0) { + this._lastMtlID = trunk.join(""); + this._lastMtlID = (this._lastMtlID == "") ? "def000" : this._lastMtlID; + } + else { + switch (trunk[0]) { + case "Ka": + if (trunk[1] && !isNaN(Number(trunk[1])) && trunk[2] && !isNaN(Number(trunk[2])) && trunk[3] && !isNaN(Number(trunk[3]))) + color = trunk[1] * 255 << 16 | trunk[2] * 255 << 8 | trunk[3] * 255; + break; + case "Ks": + if (trunk[1] && !isNaN(Number(trunk[1])) && trunk[2] && !isNaN(Number(trunk[2])) && trunk[3] && !isNaN(Number(trunk[3]))) { + specularColor = trunk[1] * 255 << 16 | trunk[2] * 255 << 8 | trunk[3] * 255; + useSpecular = true; + } + break; + case "Ns": + if (trunk[1] && !isNaN(Number(trunk[1]))) + specular = Number(trunk[1]) * 0.001; + if (specular == 0) + useSpecular = false; + break; + case "Kd": + if (trunk[1] && !isNaN(Number(trunk[1])) && trunk[2] && !isNaN(Number(trunk[2])) && trunk[3] && !isNaN(Number(trunk[3]))) { + diffuseColor = trunk[1] * 255 << 16 | trunk[2] * 255 << 8 | trunk[3] * 255; + useColor = true; + } + break; + case "tr": + case "d": + if (trunk[1] && !isNaN(Number(trunk[1]))) + alpha = Number(trunk[1]); + break; + case "map_Kd": + mapkd = this.parseMapKdString(trunk); + mapkd = mapkd.replace(/\\/g, "/"); + } + } + } + } + if (mapkd != "") { + if (useSpecular) { + basicSpecularMethod = new SpecularBasicMethod(); + basicSpecularMethod.specularColor = specularColor; + basicSpecularMethod.specular = specular; + var specularData = new SpecularData(); + specularData.alpha = alpha; + specularData.basicSpecularMethod = basicSpecularMethod; + specularData.materialID = this._lastMtlID; + if (!this._materialSpecularData) + this._materialSpecularData = new Array(); + this._materialSpecularData.push(specularData); + } + this._pAddDependency(this._lastMtlID, new URLRequest(mapkd)); + } + else if (useColor && !isNaN(color)) { + var lm = new LoadedMaterial(); + lm.materialID = this._lastMtlID; + if (alpha == 0) + console.log("Warning: an alpha value of 0 was found in mtl color tag (Tr or d) ref:" + this._lastMtlID + ", mesh(es) using it will be invisible!"); + var cm; + if (this.materialMode < 2) { + cm = new TriangleMethodMaterial(color); + var colorMat = cm; + colorMat.alpha = alpha; + colorMat.diffuseColor = diffuseColor; + colorMat.repeat = true; + if (useSpecular) { + colorMat.specularColor = specularColor; + colorMat.specular = specular; + } + } + else { + cm = new TriangleMethodMaterial(color); + cm.materialMode = TriangleMaterialMode.MULTI_PASS; + var colorMultiMat = cm; + colorMultiMat.diffuseColor = diffuseColor; + colorMultiMat.repeat = true; + if (useSpecular) { + colorMultiMat.specularColor = specularColor; + colorMultiMat.specular = specular; + } + } + lm.cm = cm; + this._materialLoaded.push(lm); + if (this._meshes.length > 0) + this.applyMaterial(lm); + } + } + this._mtlLibLoaded = true; + }; + OBJParser.prototype.parseMapKdString = function (trunk) { + var url = ""; + var i; + var breakflag; + for (i = 1; i < trunk.length;) { + switch (trunk[i]) { + case "-blendu": + case "-blendv": + case "-cc": + case "-clamp": + case "-texres": + i += 2; //Skip ahead 1 attribute + break; + case "-mm": + i += 3; //Skip ahead 2 attributes + break; + case "-o": + case "-s": + case "-t": + i += 4; //Skip ahead 3 attributes + continue; + default: + breakflag = true; + break; + } + if (breakflag) + break; + } + for (i; i < trunk.length; i++) { + url += trunk[i]; + url += " "; + } + //Remove the extraneous space and/or newline from the right side + url = url.replace(/\s+$/, ""); + return url; + }; + OBJParser.prototype.loadMtl = function (mtlurl) { + // Add raw-data dependency to queue and load dependencies now, + // which will pause the parsing in the meantime. + this._pAddDependency('mtl', new URLRequest(mtlurl), true); + this._pPauseAndRetrieveDependencies(); // + }; + OBJParser.prototype.applyMaterial = function (lm) { + var decomposeID; + var mesh; + var tm; + var j; + var specularData; + for (var i = 0; i < this._meshes.length; ++i) { + mesh = this._meshes[i]; + decomposeID = mesh.material.name.split("~"); + if (decomposeID[0] == lm.materialID) { + if (lm.cm) { + if (mesh.material) + mesh.material = null; + mesh.material = lm.cm; + } + else if (lm.texture) { + if (this.materialMode < 2) { + tm = mesh.material; + tm.texture = lm.texture; + tm.color = lm.color; + tm.alpha = lm.alpha; + tm.repeat = true; + if (lm.specularMethod) { + // By setting the specularMethod property to null before assigning + // the actual method instance, we avoid having the properties of + // the new method being overridden with the settings from the old + // one, which is default behavior of the setter. + tm.specularMethod = null; + tm.specularMethod = lm.specularMethod; + } + else if (this._materialSpecularData) { + for (j = 0; j < this._materialSpecularData.length; ++j) { + specularData = this._materialSpecularData[j]; + if (specularData.materialID == lm.materialID) { + tm.specularMethod = null; // Prevent property overwrite (see above) + tm.specularMethod = specularData.basicSpecularMethod; + tm.color = specularData.color; + tm.alpha = specularData.alpha; + break; + } + } + } + } + else { + tm = mesh.material; + tm.materialMode = TriangleMaterialMode.MULTI_PASS; + tm.texture = lm.texture; + tm.color = lm.color; + tm.repeat = true; + if (lm.specularMethod) { + // By setting the specularMethod property to null before assigning + // the actual method instance, we avoid having the properties of + // the new method being overridden with the settings from the old + // one, which is default behavior of the setter. + tm.specularMethod = null; + tm.specularMethod = lm.specularMethod; + } + else if (this._materialSpecularData) { + for (j = 0; j < this._materialSpecularData.length; ++j) { + specularData = this._materialSpecularData[j]; + if (specularData.materialID == lm.materialID) { + tm.specularMethod = null; // Prevent property overwrite (see above) + tm.specularMethod = specularData.basicSpecularMethod; + tm.color = specularData.color; + break; + } + } + } + } + } + mesh.material.name = decomposeID[1] ? decomposeID[1] : decomposeID[0]; + this._meshes.splice(i, 1); + --i; + } + } + if (lm.cm || tm) + this._pFinalizeAsset(lm.cm || tm); + }; + OBJParser.prototype.applyMaterials = function () { + if (this._materialLoaded.length == 0) + return; + for (var i = 0; i < this._materialLoaded.length; ++i) + this.applyMaterial(this._materialLoaded[i]); + }; + return OBJParser; +})(ParserBase); +var ObjectGroup = (function () { + function ObjectGroup() { + this.groups = new Array(); + } + return ObjectGroup; +})(); +var Group = (function () { + function Group() { + this.materialGroups = new Array(); + } + return Group; +})(); +var MaterialGroup = (function () { + function MaterialGroup() { + this.faces = new Array(); + } + return MaterialGroup; +})(); +var SpecularData = (function () { + function SpecularData() { + this.color = 0xFFFFFF; + this.alpha = 1; + } + return SpecularData; +})(); +var LoadedMaterial = (function () { + function LoadedMaterial() { + this.color = 0xFFFFFF; + this.alpha = 1; + } + return LoadedMaterial; +})(); +var FaceData = (function () { + function FaceData() { + this.vertexIndices = new Array(); + this.uvIndices = new Array(); + this.normalIndices = new Array(); + this.indexIds = new Array(); // used for real index lookups + } + return FaceData; +})(); +/** +* Texture coordinates value object. +*/ +var UV = (function () { + /** + * Creates a new UV object. + * + * @param u [optional] The horizontal coordinate of the texture value. Defaults to 0. + * @param v [optional] The vertical coordinate of the texture value. Defaults to 0. + */ + function UV(u, v) { + if (u === void 0) { u = 0; } + if (v === void 0) { v = 0; } + this._u = u; + this._v = v; + } + Object.defineProperty(UV.prototype, "v", { + /** + * Defines the vertical coordinate of the texture value. + */ + get: function () { + return this._v; + }, + set: function (value) { + this._v = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(UV.prototype, "u", { + /** + * Defines the horizontal coordinate of the texture value. + */ + get: function () { + return this._u; + }, + set: function (value) { + this._u = value; + }, + enumerable: true, + configurable: true + }); + /** + * returns a new UV value Object + */ + UV.prototype.clone = function () { + return new UV(this._u, this._v); + }; + /** + * returns the value object as a string for trace/debug purpose + */ + UV.prototype.toString = function () { + return this._u + "," + this._v; + }; + return UV; +})(); +var Vertex = (function () { + /** + * Creates a new Vertex value object. + * + * @param x [optional] The x value. Defaults to 0. + * @param y [optional] The y value. Defaults to 0. + * @param z [optional] The z value. Defaults to 0. + * @param index [optional] The index value. Defaults is NaN. + */ + function Vertex(x, y, z, index) { + if (x === void 0) { x = 0; } + if (y === void 0) { y = 0; } + if (z === void 0) { z = 0; } + if (index === void 0) { index = 0; } + this._x = x; + this._y = y; + this._z = z; + this._index = index; + } + Object.defineProperty(Vertex.prototype, "index", { + get: function () { + return this._index; + }, + /** + * To define/store the index of value object + * @param ind The index + */ + set: function (ind) { + this._index = ind; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Vertex.prototype, "x", { + /** + * To define/store the x value of the value object + * @param value The x value + */ + get: function () { + return this._x; + }, + set: function (value) { + this._x = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Vertex.prototype, "y", { + /** + * To define/store the y value of the value object + * @param value The y value + */ + get: function () { + return this._y; + }, + set: function (value) { + this._y = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Vertex.prototype, "z", { + /** + * To define/store the z value of the value object + * @param value The z value + */ + get: function () { + return this._z; + }, + set: function (value) { + this._z = value; + }, + enumerable: true, + configurable: true + }); + /** + * returns a new Vertex value Object + */ + Vertex.prototype.clone = function () { + return new Vertex(this._x, this._y, this._z); + }; + return Vertex; +})(); +module.exports = OBJParser; + + +},{"awayjs-core/lib/containers/DisplayObjectContainer":undefined,"awayjs-core/lib/core/base/Geometry":undefined,"awayjs-core/lib/core/base/TriangleSubGeometry":undefined,"awayjs-core/lib/core/library/AssetType":undefined,"awayjs-core/lib/core/net/URLLoaderDataFormat":undefined,"awayjs-core/lib/core/net/URLRequest":undefined,"awayjs-core/lib/entities/Mesh":undefined,"awayjs-core/lib/parsers/ParserBase":undefined,"awayjs-core/lib/parsers/ParserUtils":undefined,"awayjs-stagegl/lib/materials/TriangleMaterialMode":undefined,"awayjs-stagegl/lib/materials/TriangleMethodMaterial":undefined,"awayjs-stagegl/lib/materials/methods/SpecularBasicMethod":undefined,"awayjs-stagegl/lib/materials/utils/DefaultMaterialManager":undefined}],"awayjs-renderergl/lib/parsers/Parsers":[function(require,module,exports){ +var AssetLoader = require("awayjs-core/lib/core/library/AssetLoader"); +var AWDParser = require("awayjs-renderergl/lib/parsers/AWDParser"); +var Max3DSParser = require("awayjs-renderergl/lib/parsers/Max3DSParser"); +var MD2Parser = require("awayjs-renderergl/lib/parsers/MD2Parser"); +var OBJParser = require("awayjs-renderergl/lib/parsers/OBJParser"); +/** + * + */ +var Parsers = (function () { + function Parsers() { + } + /** + * Short-hand function to enable all bundled parsers for auto-detection. In practice, + * this is the same as invoking enableParsers(Parsers.ALL_BUNDLED) on any of the + * loader classes SingleFileLoader, AssetLoader, AssetLibrary or Loader3D. + * + * See notes about file size in the documentation for the ALL_BUNDLED constant. + * + * @see away.parsers.Parsers.ALL_BUNDLED + */ + Parsers.enableAllBundled = function () { + AssetLoader.enableParsers(Parsers.ALL_BUNDLED); + }; + /** + * A list of all parsers that come bundled with Away3D. Use this to quickly + * enable support for all bundled parsers to the file format auto-detection + * feature, using any of the enableParsers() methods on loaders, e.g.: + * + * AssetLibrary.enableParsers(Parsers.ALL_BUNDLED); + * + * Beware however that this requires all parser classes to be included in the + * SWF file, which will add 50-100 kb to the file. When only a limited set of + * file formats are used, SWF file size can be saved by adding the parsers + * individually using AssetLibrary.enableParser() + * + * A third way is to specify a parser for each loaded file, thereby bypassing + * the auto-detection mechanisms altogether, while at the same time allowing + * any properties that are unique to that parser to be set for that load. + * + * The bundled parsers are: + * + *
    + *
  • AC3D (.ac)
  • + *
  • Away Data version 1 ASCII and version 2 binary (.awd). AWD1 BSP unsupported
  • + *
  • 3DMax (.3ds)
  • + *
  • DXF (.dxf)
  • + *
  • Quake 2 MD2 models (.md2)
  • + *
  • Doom 3 MD5 animation clips (.md5anim)
  • + *
  • Doom 3 MD5 meshes (.md5mesh)
  • + *
  • Wavefront OBJ (.obj)
  • + *
  • Collada (.dae)
  • + *
  • Images (.jpg, .png)
  • + *
+ * + * @see away.library.AssetLibrary.enableParser + */ + Parsers.ALL_BUNDLED = Array(AWDParser, Max3DSParser, MD2Parser, OBJParser); + return Parsers; +})(); +module.exports = Parsers; + + +},{"awayjs-core/lib/core/library/AssetLoader":undefined,"awayjs-renderergl/lib/parsers/AWDParser":undefined,"awayjs-renderergl/lib/parsers/MD2Parser":undefined,"awayjs-renderergl/lib/parsers/Max3DSParser":undefined,"awayjs-renderergl/lib/parsers/OBJParser":undefined}],"awayjs-renderergl/lib/parsers/data/AWDBlock":[function(require,module,exports){ +/** + * + */ +var AWDBlock = (function () { + function AWDBlock() { + } + AWDBlock.prototype.dispose = function () { + this.id = null; + this.bytes = null; + this.errorMessages = null; + this.uvsForVertexAnimation = null; + }; + AWDBlock.prototype.addError = function (errorMsg) { + if (!this.errorMessages) + this.errorMessages = new Array(); + this.errorMessages.push(errorMsg); + }; + return AWDBlock; +})(); +module.exports = AWDBlock; + + +},{}],"awayjs-renderergl/lib/parsers/data/AWDProperties":[function(require,module,exports){ +var AWDProperties = (function () { + function AWDProperties() { + } + AWDProperties.prototype.set = function (key, value) { + this[key.toString()] = value; + }; + AWDProperties.prototype.get = function (key, fallback) { + if (this.hasOwnProperty(key.toString())) { + return this[key.toString()]; + } + else { + return fallback; + } + }; + return AWDProperties; +})(); +module.exports = AWDProperties; + + +},{}],"awayjs-renderergl/lib/parsers/data/BaseFrameData":[function(require,module,exports){ +/** + * + */ +var BaseFrameData = (function () { + function BaseFrameData() { + } + return BaseFrameData; +})(); +module.exports = BaseFrameData; + + +},{}],"awayjs-renderergl/lib/parsers/data/BitFlags":[function(require,module,exports){ +/** + * + */ +var BitFlags = (function () { + function BitFlags() { + } + BitFlags.test = function (flags, testFlag) { + return (flags & testFlag) == testFlag; + }; + BitFlags.FLAG1 = 1; + BitFlags.FLAG2 = 2; + BitFlags.FLAG3 = 4; + BitFlags.FLAG4 = 8; + BitFlags.FLAG5 = 16; + BitFlags.FLAG6 = 32; + BitFlags.FLAG7 = 64; + BitFlags.FLAG8 = 128; + BitFlags.FLAG9 = 256; + BitFlags.FLAG10 = 512; + BitFlags.FLAG11 = 1024; + BitFlags.FLAG12 = 2048; + BitFlags.FLAG13 = 4096; + BitFlags.FLAG14 = 8192; + BitFlags.FLAG15 = 16384; + BitFlags.FLAG16 = 32768; + return BitFlags; +})(); +module.exports = BitFlags; + + +},{}],"awayjs-renderergl/lib/parsers/data/BoundsData":[function(require,module,exports){ +/** + * + */ +var BoundsData = (function () { + function BoundsData() { + } + return BoundsData; +})(); +module.exports = BoundsData; + + +},{}],"awayjs-renderergl/lib/parsers/data/FaceVO":[function(require,module,exports){ +/** + * + */ +var FaceVO = (function () { + function FaceVO() { + } + return FaceVO; +})(); +module.exports = FaceVO; + + +},{}],"awayjs-renderergl/lib/parsers/data/FrameData":[function(require,module,exports){ +/** + * + */ +var FrameData = (function () { + function FrameData() { + } + return FrameData; +})(); +module.exports = FrameData; + + +},{}],"awayjs-renderergl/lib/parsers/data/HierarchyData":[function(require,module,exports){ +/** + * + */ +var HierarchyData = (function () { + function HierarchyData() { + } + return HierarchyData; +})(); +module.exports = HierarchyData; + + +},{}],"awayjs-renderergl/lib/parsers/data/MaterialVO":[function(require,module,exports){ +/** + * + */ +var MaterialVO = (function () { + function MaterialVO() { + } + return MaterialVO; +})(); +module.exports = MaterialVO; + + +},{}],"awayjs-renderergl/lib/parsers/data/ObjectVO":[function(require,module,exports){ +var ObjectVO = (function () { + function ObjectVO() { + } + return ObjectVO; +})(); +module.exports = ObjectVO; + + +},{}],"awayjs-renderergl/lib/parsers/data/TextureVO":[function(require,module,exports){ +/** + * + */ +var TextureVO = (function () { + function TextureVO() { + } + return TextureVO; +})(); +module.exports = TextureVO; + + +},{}],"awayjs-renderergl/lib/parsers/data/VertexVO":[function(require,module,exports){ +var VertexVO = (function () { + function VertexVO() { + } + return VertexVO; +})(); +module.exports = VertexVO; + + +},{}],"awayjs-renderergl/lib/tools/commands/Merge":[function(require,module,exports){ +var Geometry = require("awayjs-core/lib/core/base/Geometry"); +var TriangleSubGeometry = require("awayjs-core/lib/core/base/TriangleSubGeometry"); +var Matrix3DUtils = require("awayjs-core/lib/core/geom/Matrix3DUtils"); +var Mesh = require("awayjs-core/lib/entities/Mesh"); +/** + * Class Merge merges two or more static meshes into one.Merge + */ +var Merge = (function () { + /** + * @param keepMaterial [optional] Determines if the merged object uses the recevier mesh material information or keeps its source material(s). Defaults to false. + * If false and receiver object has multiple materials, the last material found in receiver submeshes is applied to the merged submesh(es). + * @param disposeSources [optional] Determines if the mesh and geometry source(s) used for the merging are disposed. Defaults to false. + * If true, only receiver geometry and resulting mesh are kept in memory. + * @param objectSpace [optional] Determines if source mesh(es) is/are merged using objectSpace or worldspace. Defaults to false. + */ + function Merge(keepMaterial, disposeSources, objectSpace) { + if (keepMaterial === void 0) { keepMaterial = false; } + if (disposeSources === void 0) { disposeSources = false; } + if (objectSpace === void 0) { objectSpace = false; } + this._keepMaterial = keepMaterial; + this._disposeSources = disposeSources; + this._objectSpace = objectSpace; + } + Object.defineProperty(Merge.prototype, "disposeSources", { + get: function () { + return this._disposeSources; + }, + /** + * Determines if the mesh and geometry source(s) used for the merging are disposed. Defaults to false. + */ + set: function (b) { + this._disposeSources = b; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Merge.prototype, "keepMaterial", { + get: function () { + return this._keepMaterial; + }, + /** + * Determines if the material source(s) used for the merging are disposed. Defaults to false. + */ + set: function (b) { + this._keepMaterial = b; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Merge.prototype, "objectSpace", { + get: function () { + return this._objectSpace; + }, + /** + * Determines if source mesh(es) is/are merged using objectSpace or worldspace. Defaults to false. + */ + set: function (b) { + this._objectSpace = b; + }, + enumerable: true, + configurable: true + }); + /** + * Merges all the children of a container into a single Mesh. If no Mesh object is found, method returns the receiver without modification. + * + * @param receiver The Mesh to receive the merged contents of the container. + * @param objectContainer The DisplayObjectContainer holding the meshes to be mergd. + * + * @return The merged Mesh instance. + */ + Merge.prototype.applyToContainer = function (receiver, objectContainer) { + this.reset(); + //collect container meshes + this.parseContainer(receiver, objectContainer); + //collect receiver + this.collect(receiver, false); + //merge to receiver + this.merge(receiver, this._disposeSources); + }; + /** + * Merges all the meshes found in the Array<Mesh> into a single Mesh. + * + * @param receiver The Mesh to receive the merged contents of the meshes. + * @param meshes A series of Meshes to be merged with the reciever mesh. + */ + Merge.prototype.applyToMeshes = function (receiver, meshes) { + this.reset(); + if (!meshes.length) + return; + for (var i = 0; i < meshes.length; i++) + if (meshes[i] != receiver) + this.collect(meshes[i], this._disposeSources); + //collect receiver + this.collect(receiver, false); + //merge to receiver + this.merge(receiver, this._disposeSources); + }; + /** + * Merges 2 meshes into one. It is recommand to use apply when 2 meshes are to be merged. If more need to be merged, use either applyToMeshes or applyToContainer methods. + * + * @param receiver The Mesh to receive the merged contents of both meshes. + * @param mesh The Mesh to be merged with the receiver mesh + */ + Merge.prototype.apply = function (receiver, mesh) { + this.reset(); + //collect mesh + this.collect(mesh, this._disposeSources); + //collect receiver + this.collect(receiver, false); + //merge to receiver + this.merge(receiver, this._disposeSources); + }; + Merge.prototype.reset = function () { + this._toDispose = new Array(); + this._geomVOs = new Array(); + }; + Merge.prototype.merge = function (destMesh, dispose) { + var i /*uint*/; + var subIdx /*uint*/; + var oldGeom; + var destGeom; + var useSubMaterials; + oldGeom = destMesh.geometry; + destGeom = destMesh.geometry = new Geometry(); + subIdx = destMesh.subMeshes.length; + // Only apply materials directly to sub-meshes if necessary, + // i.e. if there is more than one material available. + useSubMaterials = (this._geomVOs.length > 1); + for (i = 0; i < this._geomVOs.length; i++) { + var s /*uint*/; + var data; + var sub = new TriangleSubGeometry(true); + sub.autoDeriveNormals = false; + sub.autoDeriveTangents = false; + data = this._geomVOs[i]; + sub.updateIndices(data.indices); + sub.updatePositions(data.vertices); + sub.updateVertexNormals(data.normals); + sub.updateVertexTangents(data.tangents); + sub.updateUVs(data.uvs); + destGeom.addSubGeometry(sub); + if (this._keepMaterial && useSubMaterials) + destMesh.subMeshes[subIdx].material = data.material; + } + if (this._keepMaterial && !useSubMaterials && this._geomVOs.length) + destMesh.material = this._geomVOs[0].material; + if (dispose) { + var m; + var len = this._toDispose.length; + for (var i; i < len; i++) { + m = this._toDispose[i]; + m.geometry.dispose(); + m.dispose(); + } + //dispose of the original receiver geometry + oldGeom.dispose(); + } + this._toDispose = null; + }; + Merge.prototype.collect = function (mesh, dispose) { + if (mesh.geometry) { + var subIdx /*uint*/; + var subGeometries = mesh.geometry.subGeometries; + var calc /*uint*/; + for (subIdx = 0; subIdx < subGeometries.length; subIdx++) { + var i /*uint*/; + var len /*uint*/; + var iIdx /*uint*/, vIdx /*uint*/, nIdx /*uint*/, tIdx /*uint*/, uIdx /*uint*/; + var indexOffset /*uint*/; + var subGeom; + var vo; + var vertices; + var normals; + var tangents; + var pd, nd, td, ud; + subGeom = subGeometries[subIdx]; + pd = subGeom.positions; + nd = subGeom.vertexNormals; + td = subGeom.vertexTangents; + ud = subGeom.uvs; + // Get (or create) a VO for this material + vo = this.getSubGeomData(mesh.subMeshes[subIdx].material || mesh.material); + // Vertices and normals are copied to temporary vectors, to be transformed + // before concatenated onto those of the data. This is unnecessary if no + // transformation will be performed, i.e. for object space merging. + vertices = (this._objectSpace) ? vo.vertices : new Array(); + normals = (this._objectSpace) ? vo.normals : new Array(); + tangents = (this._objectSpace) ? vo.tangents : new Array(); + // Copy over vertex attributes + vIdx = vertices.length; + nIdx = normals.length; + tIdx = tangents.length; + uIdx = vo.uvs.length; + len = subGeom.numVertices; + for (i = 0; i < len; i++) { + calc = i * 3; + // Position + vertices[vIdx++] = pd[calc]; + vertices[vIdx++] = pd[calc + 1]; + vertices[vIdx++] = pd[calc + 2]; + // Normal + normals[nIdx++] = nd[calc]; + normals[nIdx++] = nd[calc + 1]; + normals[nIdx++] = nd[calc + 2]; + // Tangent + tangents[tIdx++] = td[calc]; + tangents[tIdx++] = td[calc + 1]; + tangents[tIdx++] = td[calc + 2]; + // UV + vo.uvs[uIdx++] = ud[i * 2]; + vo.uvs[uIdx++] = ud[i * 2 + 1]; + } + // Copy over triangle indices + indexOffset = (!this._objectSpace) ? vo.vertices.length / 3 : 0; + iIdx = vo.indices.length; + len = subGeom.numTriangles; + for (i = 0; i < len; i++) { + calc = i * 3; + vo.indices[iIdx++] = subGeom.indices[calc] + indexOffset; + vo.indices[iIdx++] = subGeom.indices[calc + 1] + indexOffset; + vo.indices[iIdx++] = subGeom.indices[calc + 2] + indexOffset; + } + if (!this._objectSpace) { + mesh.sceneTransform.transformVectors(vertices, vertices); + Matrix3DUtils.deltaTransformVectors(mesh.sceneTransform, normals, normals); + Matrix3DUtils.deltaTransformVectors(mesh.sceneTransform, tangents, tangents); + // Copy vertex data from temporary (transformed) vectors + vIdx = vo.vertices.length; + nIdx = vo.normals.length; + tIdx = vo.tangents.length; + len = vertices.length; + for (i = 0; i < len; i++) { + vo.vertices[vIdx++] = vertices[i]; + vo.normals[nIdx++] = normals[i]; + vo.tangents[tIdx++] = tangents[i]; + } + } + } + if (dispose) + this._toDispose.push(mesh); + } + }; + Merge.prototype.getSubGeomData = function (material) { + var data; + if (this._keepMaterial) { + var i /*uint*/; + var len /*uint*/; + len = this._geomVOs.length; + for (i = 0; i < len; i++) { + if (this._geomVOs[i].material == material) { + data = this._geomVOs[i]; + break; + } + } + } + else if (this._geomVOs.length) { + // If materials are not to be kept, all data can be + // put into a single VO, so return that one. + data = this._geomVOs[0]; + } + // No data (for this material) found, create new. + if (!data) { + data = new GeometryVO(); + data.vertices = new Array(); + data.normals = new Array(); + data.tangents = new Array(); + data.uvs = new Array(); + data.indices = new Array(); + data.material = material; + this._geomVOs.push(data); + } + return data; + }; + Merge.prototype.parseContainer = function (receiver, object) { + var child; + var i /*uint*/; + if (object instanceof Mesh && object != receiver) + this.collect(object, this._disposeSources); + for (i = 0; i < object.numChildren; ++i) { + child = object.getChildAt(i); + this.parseContainer(receiver, child); + } + }; + return Merge; +})(); +var GeometryVO = (function () { + function GeometryVO() { + } + return GeometryVO; +})(); +module.exports = Merge; + + +},{"awayjs-core/lib/core/base/Geometry":undefined,"awayjs-core/lib/core/base/TriangleSubGeometry":undefined,"awayjs-core/lib/core/geom/Matrix3DUtils":undefined,"awayjs-core/lib/entities/Mesh":undefined}],"awayjs-renderergl/lib/tools/data/ParticleGeometryTransform":[function(require,module,exports){ +/** + * ... + */ +var ParticleGeometryTransform = (function () { + function ParticleGeometryTransform() { + } + Object.defineProperty(ParticleGeometryTransform.prototype, "vertexTransform", { + get: function () { + return this._defaultVertexTransform; + }, + set: function (value) { + this._defaultVertexTransform = value; + this._defaultInvVertexTransform = value.clone(); + this._defaultInvVertexTransform.invert(); + this._defaultInvVertexTransform.transpose(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleGeometryTransform.prototype, "UVTransform", { + get: function () { + return this._defaultUVTransform; + }, + set: function (value) { + this._defaultUVTransform = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ParticleGeometryTransform.prototype, "invVertexTransform", { + get: function () { + return this._defaultInvVertexTransform; + }, + enumerable: true, + configurable: true + }); + return ParticleGeometryTransform; +})(); +module.exports = ParticleGeometryTransform; + + +},{}],"awayjs-renderergl/lib/tools/helpers/ParticleGeometryHelper":[function(require,module,exports){ +var TriangleSubGeometry = require("awayjs-core/lib/core/base/TriangleSubGeometry"); +var Point = require("awayjs-core/lib/core/geom/Point"); +var Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +var ParticleData = require("awayjs-renderergl/lib/animators/data/ParticleData"); +var ParticleGeometry = require("awayjs-renderergl/lib/core/base/ParticleGeometry"); +/** + * ... + */ +var ParticleGeometryHelper = (function () { + function ParticleGeometryHelper() { + } + ParticleGeometryHelper.generateGeometry = function (geometries, transforms) { + if (transforms === void 0) { transforms = null; } + var indicesVector = new Array() /*uint*/; + var positionsVector = new Array(); + var normalsVector = new Array(); + var tangentsVector = new Array(); + var uvsVector = new Array(); + var vertexCounters = new Array() /*uint*/; + var particles = new Array(); + var subGeometries = new Array(); + var numParticles = geometries.length; + var sourceSubGeometries; + var sourceSubGeometry; + var numSubGeometries /*uint*/; + var indices /*uint*/; + var positions; + var normals; + var tangents; + var uvs; + var vertexCounter /*uint*/; + var subGeometry; + var i /*int*/; + var j /*int*/; + var sub2SubMap = new Array() /*int*/; + var tempVertex = new Vector3D; + var tempNormal = new Vector3D; + var tempTangents = new Vector3D; + var tempUV = new Point; + for (i = 0; i < numParticles; i++) { + sourceSubGeometries = geometries[i].subGeometries; + numSubGeometries = sourceSubGeometries.length; + for (var srcIndex = 0; srcIndex < numSubGeometries; srcIndex++) { + //create a different particle subgeometry group for each source subgeometry in a particle. + if (sub2SubMap.length <= srcIndex) { + sub2SubMap.push(subGeometries.length); + indicesVector.push(new Array()); + positionsVector.push(new Array()); + normalsVector.push(new Array()); + tangentsVector.push(new Array()); + uvsVector.push(new Array()); + subGeometries.push(new TriangleSubGeometry(true)); + vertexCounters.push(0); + } + sourceSubGeometry = sourceSubGeometries[srcIndex]; + //add a new particle subgeometry if this source subgeometry will take us over the maxvertex limit + if (sourceSubGeometry.numVertices + vertexCounters[sub2SubMap[srcIndex]] > ParticleGeometryHelper.MAX_VERTEX) { + //update submap and add new subgeom vectors + sub2SubMap[srcIndex] = subGeometries.length; + indicesVector.push(new Array()); + positionsVector.push(new Array()); + normalsVector.push(new Array()); + tangentsVector.push(new Array()); + uvsVector.push(new Array()); + subGeometries.push(new TriangleSubGeometry(true)); + vertexCounters.push(0); + } + j = sub2SubMap[srcIndex]; + //select the correct vector + indices = indicesVector[j]; + positions = positionsVector[j]; + normals = normalsVector[j]; + tangents = tangentsVector[j]; + uvs = uvsVector[j]; + vertexCounter = vertexCounters[j]; + subGeometry = subGeometries[j]; + var particleData = new ParticleData(); + particleData.numVertices = sourceSubGeometry.numVertices; + particleData.startVertexIndex = vertexCounter; + particleData.particleIndex = i; + particleData.subGeometry = subGeometry; + particles.push(particleData); + vertexCounters[j] += sourceSubGeometry.numVertices; + var k /*int*/; + var tempLen /*int*/; + var compact = sourceSubGeometry; + var product /*uint*/; + var sourcePositions; + var sourceNormals; + var sourceTangents; + var sourceUVs; + if (compact) { + tempLen = compact.numVertices; + compact.numTriangles; + sourcePositions = compact.positions; + sourceNormals = compact.vertexNormals; + sourceTangents = compact.vertexTangents; + sourceUVs = compact.uvs; + if (transforms) { + var particleGeometryTransform = transforms[i]; + var vertexTransform = particleGeometryTransform.vertexTransform; + var invVertexTransform = particleGeometryTransform.invVertexTransform; + var UVTransform = particleGeometryTransform.UVTransform; + for (k = 0; k < tempLen; k++) { + /* + * 0 - 2: vertex position X, Y, Z + * 3 - 5: normal X, Y, Z + * 6 - 8: tangent X, Y, Z + * 9 - 10: U V + * 11 - 12: Secondary U V*/ + product = k * 3; + tempVertex.x = sourcePositions[product]; + tempVertex.y = sourcePositions[product + 1]; + tempVertex.z = sourcePositions[product + 2]; + tempNormal.x = sourceNormals[product]; + tempNormal.y = sourceNormals[product + 1]; + tempNormal.z = sourceNormals[product + 2]; + tempTangents.x = sourceTangents[product]; + tempTangents.y = sourceTangents[product + 1]; + tempTangents.z = sourceTangents[product + 2]; + tempUV.x = sourceUVs[k * 2]; + tempUV.y = sourceUVs[k * 2 + 1]; + if (vertexTransform) { + tempVertex = vertexTransform.transformVector(tempVertex); + tempNormal = invVertexTransform.deltaTransformVector(tempNormal); + tempTangents = invVertexTransform.deltaTransformVector(tempNormal); + } + if (UVTransform) + tempUV = UVTransform.transformPoint(tempUV); + //this is faster than that only push one data + sourcePositions.push(tempVertex.x, tempVertex.y, tempVertex.z); + sourceNormals.push(tempNormal.x, tempNormal.y, tempNormal.z); + sourceTangents.push(tempTangents.x, tempTangents.y, tempTangents.z); + sourceUVs.push(tempUV.x, tempUV.y); + } + } + else { + for (k = 0; k < tempLen; k++) { + product = k * 3; + //this is faster than that only push one data + positions.push(sourcePositions[product], sourcePositions[product + 1], sourcePositions[product + 2]); + normals.push(sourceNormals[product], sourceNormals[product + 1], sourceNormals[product + 2]); + tangents.push(sourceTangents[product], sourceTangents[product + 1], sourceTangents[product + 2]); + uvs.push(sourceUVs[k * 2], sourceUVs[k * 2 + 1]); + } + } + } + else { + } + var sourceIndices = sourceSubGeometry.indices; + tempLen = sourceSubGeometry.numTriangles; + for (k = 0; k < tempLen; k++) { + product = k * 3; + indices.push(sourceIndices[product] + vertexCounter, sourceIndices[product + 1] + vertexCounter, sourceIndices[product + 2] + vertexCounter); + } + } + } + var particleGeometry = new ParticleGeometry(); + particleGeometry.particles = particles; + particleGeometry.numParticles = numParticles; + numParticles = subGeometries.length; + for (i = 0; i < numParticles; i++) { + subGeometry = subGeometries[i]; + subGeometry.autoDeriveNormals = false; + subGeometry.autoDeriveTangents = false; + subGeometry.updateIndices(indicesVector[i]); + subGeometry.updatePositions(positionsVector[i]); + subGeometry.updateVertexNormals(normalsVector[i]); + subGeometry.updateVertexTangents(tangentsVector[i]); + subGeometry.updateUVs(uvsVector[i]); + particleGeometry.addSubGeometry(subGeometry); + } + return particleGeometry; + }; + ParticleGeometryHelper.MAX_VERTEX = 65535; + return ParticleGeometryHelper; +})(); +module.exports = ParticleGeometryHelper; + + +},{"awayjs-core/lib/core/base/TriangleSubGeometry":undefined,"awayjs-core/lib/core/geom/Point":undefined,"awayjs-core/lib/core/geom/Vector3D":undefined,"awayjs-renderergl/lib/animators/data/ParticleData":undefined,"awayjs-renderergl/lib/core/base/ParticleGeometry":undefined}],"awayjs-renderergl/lib/utils/PerspectiveMatrix3D":[function(require,module,exports){ +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var Matrix3D = require("awayjs-core/lib/core/geom/Matrix3D"); +/** + * + */ +var PerspectiveMatrix3D = (function (_super) { + __extends(PerspectiveMatrix3D, _super); + function PerspectiveMatrix3D(v) { + if (v === void 0) { v = null; } + _super.call(this, v); + } + PerspectiveMatrix3D.prototype.perspectiveFieldOfViewLH = function (fieldOfViewY, aspectRatio, zNear, zFar) { + var yScale = 1 / Math.tan(fieldOfViewY / 2); + var xScale = yScale / aspectRatio; + this.copyRawDataFrom([xScale, 0.0, 0.0, 0.0, 0.0, yScale, 0.0, 0.0, 0.0, 0.0, zFar / (zFar - zNear), 1.0, 0.0, 0.0, (zNear * zFar) / (zNear - zFar), 0.0]); + }; + return PerspectiveMatrix3D; +})(Matrix3D); +module.exports = PerspectiveMatrix3D; + + +},{"awayjs-core/lib/core/geom/Matrix3D":undefined}]},{},[]) + + +//# sourceMappingURL=awayjs-renderergl.js.map \ No newline at end of file diff --git a/build/awayjs-renderergl.js.map b/build/awayjs-renderergl.js.map new file mode 100644 index 000000000..a765c2e56 --- /dev/null +++ b/build/awayjs-renderergl.js.map @@ -0,0 +1,279 @@ +{ + "version": 3, + "sources": [ + "node_modules/browserify/node_modules/browser-pack/_prelude.js", + "animators/particleanimationset.ts", + "animators/particleanimator.ts", + "animators/skeletonanimationset.ts", + "animators/skeletonanimator.ts", + "animators/vertexanimationset.ts", + "animators/vertexanimator.ts", + "animators/data/animationsubgeometry.ts", + "animators/data/colorsegmentpoint.ts", + "animators/data/jointpose.ts", + "animators/data/particleanimationdata.ts", + "animators/data/particledata.ts", + "animators/data/particlepropertiesmode.ts", + "animators/data/particleproperties.ts", + "animators/data/skeletonjoint.ts", + "animators/data/skeletonpose.ts", + "animators/data/skeleton.ts", + "animators/data/vertexanimationmode.ts", + "animators/nodes/animationclipnodebase.ts", + "animators/nodes/particleaccelerationnode.ts", + "animators/nodes/particlebeziercurvenode.ts", + "animators/nodes/particlebillboardnode.ts", + "animators/nodes/particlecolornode.ts", + "animators/nodes/particlefollownode.ts", + "animators/nodes/particleinitialcolornode.ts", + "animators/nodes/particlenodebase.ts", + "animators/nodes/particleorbitnode.ts", + "animators/nodes/particleoscillatornode.ts", + "animators/nodes/particlepositionnode.ts", + "animators/nodes/particlerotatetoheadingnode.ts", + "animators/nodes/particlerotatetopositionnode.ts", + "animators/nodes/particlerotationalvelocitynode.ts", + "animators/nodes/particlescalenode.ts", + "animators/nodes/particlesegmentedcolornode.ts", + "animators/nodes/particlespritesheetnode.ts", + "animators/nodes/particletimenode.ts", + "animators/nodes/particleuvnode.ts", + "animators/nodes/particlevelocitynode.ts", + "animators/nodes/skeletonbinarylerpnode.ts", + "animators/nodes/skeletonclipnode.ts", + "animators/nodes/skeletondifferencenode.ts", + "animators/nodes/skeletondirectionalnode.ts", + "animators/nodes/skeletonnarylerpnode.ts", + "animators/nodes/vertexclipnode.ts", + "animators/states/animationclipstate.ts", + "animators/states/animationstatebase.ts", + "animators/states/iskeletonanimationstate.ts", + "animators/states/ivertexanimationstate.ts", + "animators/states/particleaccelerationstate.ts", + "animators/states/particlebeziercurvestate.ts", + "animators/states/particlebillboardstate.ts", + "animators/states/particlecolorstate.ts", + "animators/states/particlefollowstate.ts", + "animators/states/particleinitialcolorstate.ts", + "animators/states/particleorbitstate.ts", + "animators/states/particleoscillatorstate.ts", + "animators/states/particlepositionstate.ts", + "animators/states/particlerotatetoheadingstate.ts", + "animators/states/particlerotatetopositionstate.ts", + "animators/states/particlerotationalvelocitystate.ts", + "animators/states/particlescalestate.ts", + "animators/states/particlesegmentedcolorstate.ts", + "animators/states/particlespritesheetstate.ts", + "animators/states/particlestatebase.ts", + "animators/states/particletimestate.ts", + "animators/states/particleuvstate.ts", + "animators/states/particlevelocitystate.ts", + "animators/states/skeletonbinarylerpstate.ts", + "animators/states/skeletonclipstate.ts", + "animators/states/skeletondifferencestate.ts", + "animators/states/skeletondirectionalstate.ts", + "animators/states/skeletonnarylerpstate.ts", + "animators/states/vertexclipstate.ts", + "animators/transitions/crossfadetransitionnode.ts", + "animators/transitions/crossfadetransitionstate.ts", + "animators/transitions/crossfadetransition.ts", + "animators/transitions/ianimationtransition.ts", + "core/base/particlegeometry.ts", + "core/pick/jspickingcollider.ts", + "core/pick/pickingcolliderbase.ts", + "core/pick/shaderpicker.ts", + "events/animationstateevent.ts", + "materials/methods/ambientenvmapmethod.ts", + "materials/methods/diffusecelmethod.ts", + "materials/methods/diffusecompositemethod.ts", + "materials/methods/diffusedepthmethod.ts", + "materials/methods/diffusegradientmethod.ts", + "materials/methods/diffuselightmapmethod.ts", + "materials/methods/diffusesubsurfacemethod.ts", + "materials/methods/diffusewrapmethod.ts", + "materials/methods/effectalphamaskmethod.ts", + "materials/methods/effectcolormatrixmethod.ts", + "materials/methods/effectenvmapmethod.ts", + "materials/methods/effectfogmethod.ts", + "materials/methods/effectfresnelenvmapmethod.ts", + "materials/methods/effectlightmapmethod.ts", + "materials/methods/effectrefractionenvmapmethod.ts", + "materials/methods/effectrimlightmethod.ts", + "materials/methods/normalheightmapmethod.ts", + "materials/methods/normalsimplewatermethod.ts", + "materials/methods/shadowcascademethod.ts", + "materials/methods/shadowditheredmethod.ts", + "materials/methods/shadowfilteredmethod.ts", + "materials/methods/shadownearmethod.ts", + "materials/methods/shadowsoftmethod.ts", + "materials/methods/specularanisotropicmethod.ts", + "materials/methods/specularcelmethod.ts", + "materials/methods/specularcompositemethod.ts", + "materials/methods/specularfresnelmethod.ts", + "materials/methods/specularphongmethod.ts", + "materials/passes/singleobjectdepthpass.ts", + "parsers/awdparser.ts", + "parsers/md2parser.ts", + "parsers/md5animparser.ts", + "parsers/md5meshparser.ts", + "parsers/max3dsparser.ts", + "parsers/objparser.ts", + "parsers/parsers.ts", + "parsers/data/awdblock.ts", + "parsers/data/awdproperties.ts", + "parsers/data/baseframedata.ts", + "parsers/data/bitflags.ts", + "parsers/data/boundsdata.ts", + "parsers/data/facevo.ts", + "parsers/data/framedata.ts", + "parsers/data/hierarchydata.ts", + "parsers/data/materialvo.ts", + "parsers/data/objectvo.ts", + "parsers/data/texturevo.ts", + "parsers/data/vertexvo.ts", + "tools/commands/merge.ts", + "tools/data/particlegeometrytransform.ts", + "tools/helpers/particlegeometryhelper.ts", + "utils/perspectivematrix3d.ts" + ], + "names": [], + "mappings": "AAAA;;;;;;;ACMA,IAAO,gBAAgB,WAAe,+CAA+C,CAAC,CAAC;AAEvF,IAAO,sBAAsB,WAAa,0DAA0D,CAAC,CAAC;AAItG,IAAO,oBAAoB,WAAc,2DAA2D,CAAC,CAAC;AACtG,IAAO,qBAAqB,WAAa,4DAA4D,CAAC,CAAC;AACvG,IAAO,kBAAkB,WAAc,yDAAyD,CAAC,CAAC;AAClG,IAAO,sBAAsB,WAAa,6DAA6D,CAAC,CAAC;AAGzG,IAAO,gBAAgB,WAAe,wDAAwD,CAAC,CAAC;AAGhG,AAKA;;;;GADG;IACG,oBAAoB;IAAS,UAA7B,oBAAoB,UAAyB;IAyDlD;;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AD,CAvLA,AAuLC,IAAA;AAED,AAAgC,iBAAvB,sBAAsB,CAAC;;;;;;;;;;AC1MhC,IAAO,QAAQ,WAAiB,oCAAoC,CAAC,CAAC;AAEtE,AAGA;;GADG;IACG,mBAAmB;IAAS,UAA5B,mBAAmB,UAAiB;IAEzC,SAFK,mBAAmB,CAEZ,CAAsB;QAAtB,iBAAsB,GAAtB,QAAsB;QAEjC,kBAAM,CAAC,CAAC,CAAC;IACV,CAAC;IAEM,sDAAwB,GAA/B,UAAgC,YAAmB,EAAE,WAAkB,EAAE,KAAY,EAAE,IAAW;QAEjG,IAAI,MAAM,GAAU,CAAC,GAAC,IAAI,CAAC,GAAG,CAAC,YAAY,GAAC,CAAC,CAAC,CAAC;QAC/C,IAAI,MAAM,GAAU,MAAM,GAAC,WAAW,CAAC;QAEvC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,GAAC,CAAC,IAAI,GAAG,KAAK,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,KAAK,GAAC,IAAI,CAAC,GAAC,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IACtJ,CAAC;IACF,0BAAC;AAAD,CAdA,AAcC,EAdiC,QAAQ,EAczC;AAED,AAA6B,iBAApB,mBAAmB,CAAC", + "file": "generated.js", + "sourceRoot": "", + "sourcesContent": [ + "(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o = new Array();\n\tprivate _localDynamicNodes:Array = new Array();\n\tprivate _localStaticNodes:Array = new Array();\n\tprivate _totalLenOfOneVertex:number /*int*/ = 0;\n\n\t//set true if has an node which will change UV\n\tpublic hasUVNode:boolean;\n\t//set if the other nodes need to access the velocity\n\tpublic needVelocity:boolean;\n\t//set if has a billboard node.\n\tpublic hasBillboard:boolean;\n\t//set if has an node which will apply color multiple operation\n\tpublic hasColorMulNode:boolean;\n\t//set if has an node which will apply color add operation\n\tpublic hasColorAddNode:boolean;\n\n\t/**\n\t * Initialiser function for static particle properties. Needs to reference a with the following format\n\t *\n\t * \n\t * initParticleFunc(prop:ParticleProperties)\n\t * {\n\t * \t\t//code for settings local properties\n\t * }\n\t * \n\t *\n\t * Aside from setting any properties required in particle animation nodes using local static properties, the initParticleFunc function\n\t * is required to time node requirements as they may be needed. These properties on the ParticleProperties object can include\n\t * startTime, duration and delay. The use of these properties is determined by the setting\n\t * arguments passed in the constructor of the particle animation set. By default, only the startTime property is required.\n\t */\n\tpublic initParticleFunc:Function;\n\n\t/**\n\t * Initialiser function scope for static particle properties\n\t */\n\tpublic initParticleScope:Object;\n\n\t/**\n\t * Creates a new ParticleAnimationSet\n\t *\n\t * @param [optional] usesDuration Defines whether the animation set uses the duration data in its static properties to determine how long a particle is visible for. Defaults to false.\n\t * @param [optional] usesLooping Defines whether the animation set uses a looping timeframe for each particle determined by the startTime, duration and delay data in its static properties function. Defaults to false. Requires usesDuration to be true.\n\t * @param [optional] usesDelay Defines whether the animation set uses the delay data in its static properties to determine how long a particle is hidden for. Defaults to false. Requires usesLooping to be true.\n\t */\n\tconstructor(usesDuration:boolean = false, usesLooping:boolean = false, usesDelay:boolean = false)\n\t{\n\t\tsuper();\n\n\t\t//automatically add a particle time node to the set\n\t\tthis.addAnimation(this._timeNode = new ParticleTimeNode(usesDuration, usesLooping, usesDelay));\n\t}\n\n\t/**\n\t * Returns a vector of the particle animation nodes contained within the set.\n\t */\n\tpublic get particleNodes():Array\n\t{\n\t\treturn this._particleNodes;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic addAnimation(node:AnimationNodeBase)\n\t{\n\t\tvar i:number /*int*/;\n\t\tvar n:ParticleNodeBase = node;\n\t\tn._iProcessAnimationSetting(this);\n\t\tif (n.mode == ParticlePropertiesMode.LOCAL_STATIC) {\n\t\t\tn._iDataOffset = this._totalLenOfOneVertex;\n\t\t\tthis._totalLenOfOneVertex += n.dataLength;\n\t\t\tthis._localStaticNodes.push(n);\n\t\t} else if (n.mode == ParticlePropertiesMode.LOCAL_DYNAMIC)\n\t\t\tthis._localDynamicNodes.push(n);\n\n\t\tfor (i = this._particleNodes.length - 1; i >= 0; i--) {\n\t\t\tif (this._particleNodes[i].priority <= n.priority)\n\t\t\t\tbreak;\n\t\t}\n\n\t\tthis._particleNodes.splice(i + 1, 0, n);\n\n\t\tsuper.addAnimation(node);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic activate(shaderObject:ShaderObjectBase, stage:Stage)\n\t{\n//\t\t\tthis._iAnimationRegisterCache = pass.animationRegisterCache;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic deactivate(shaderObject:ShaderObjectBase, stage:Stage)\n\t{\n//\t\t\tvar context:IContextStageGL = stage.context;\n//\t\t\tvar offset:number /*int*/ = this._iAnimationRegisterCache.vertexAttributesOffset;\n//\t\t\tvar used:number /*int*/ = this._iAnimationRegisterCache.numUsedStreams;\n//\t\t\tfor (var i:number /*int*/ = offset; i < used; i++)\n//\t\t\t\tcontext.setVertexBufferAt(i, null);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALVertexCode(shaderObject:ShaderObjectBase):string\n\t{\n\t\t//grab animationRegisterCache from the materialpassbase or create a new one if the first time\n\t\tthis._iAnimationRegisterCache = shaderObject.animationRegisterCache;\n\n\t\tif (this._iAnimationRegisterCache == null)\n\t\t\tthis._iAnimationRegisterCache = shaderObject.animationRegisterCache = new AnimationRegisterCache(shaderObject.profile);\n\n\t\t//reset animationRegisterCache\n\t\tthis._iAnimationRegisterCache.vertexConstantOffset = shaderObject.numUsedVertexConstants;\n\t\tthis._iAnimationRegisterCache.vertexAttributesOffset = shaderObject.numUsedStreams;\n\t\tthis._iAnimationRegisterCache.varyingsOffset = shaderObject.numUsedVaryings;\n\t\tthis._iAnimationRegisterCache.fragmentConstantOffset = shaderObject.numUsedFragmentConstants;\n\t\tthis._iAnimationRegisterCache.hasUVNode = this.hasUVNode;\n\t\tthis._iAnimationRegisterCache.needVelocity = this.needVelocity;\n\t\tthis._iAnimationRegisterCache.hasBillboard = this.hasBillboard;\n\t\tthis._iAnimationRegisterCache.sourceRegisters = shaderObject.animatableAttributes;\n\t\tthis._iAnimationRegisterCache.targetRegisters = shaderObject.animationTargetRegisters;\n\t\tthis._iAnimationRegisterCache.needFragmentAnimation = shaderObject.usesFragmentAnimation;\n\t\tthis._iAnimationRegisterCache.needUVAnimation = !shaderObject.usesUVTransform;\n\t\tthis._iAnimationRegisterCache.hasColorAddNode = this.hasColorAddNode;\n\t\tthis._iAnimationRegisterCache.hasColorMulNode = this.hasColorMulNode;\n\t\tthis._iAnimationRegisterCache.reset();\n\n\t\tvar code:string = \"\";\n\n\t\tcode += this._iAnimationRegisterCache.getInitCode();\n\n\t\tvar node:ParticleNodeBase;\n\t\tvar i:number /*int*/;\n\n\t\tfor (i = 0; i < this._particleNodes.length; i++) {\n\t\t\tnode = this._particleNodes[i];\n\t\t\tif (node.priority < ParticleAnimationSet.POST_PRIORITY)\n\t\t\t\tcode += node.getAGALVertexCode(shaderObject, this._iAnimationRegisterCache);\n\t\t}\n\n\t\tcode += this._iAnimationRegisterCache.getCombinationCode();\n\n\t\tfor (i = 0; i < this._particleNodes.length; i++) {\n\t\t\tnode = this._particleNodes[i];\n\t\t\tif (node.priority >= ParticleAnimationSet.POST_PRIORITY && node.priority < ParticleAnimationSet.COLOR_PRIORITY)\n\t\t\t\tcode += node.getAGALVertexCode(shaderObject, this._iAnimationRegisterCache);\n\t\t}\n\n\t\tcode += this._iAnimationRegisterCache.initColorRegisters();\n\n\t\tfor (i = 0; i < this._particleNodes.length; i++) {\n\t\t\tnode = this._particleNodes[i];\n\t\t\tif (node.priority >= ParticleAnimationSet.COLOR_PRIORITY)\n\t\t\t\tcode += node.getAGALVertexCode(shaderObject, this._iAnimationRegisterCache);\n\t\t}\n\t\tcode += this._iAnimationRegisterCache.getColorPassCode();\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALUVCode(shaderObject:ShaderObjectBase):string\n\t{\n\t\tvar code:string = \"\";\n\t\tif (this.hasUVNode) {\n\t\t\tthis._iAnimationRegisterCache.setUVSourceAndTarget(shaderObject.uvSource, shaderObject.uvTarget);\n\t\t\tcode += \"mov \" + this._iAnimationRegisterCache.uvTarget + \".xy,\" + this._iAnimationRegisterCache.uvAttribute.toString() + \"\\n\";\n\t\t\tvar node:ParticleNodeBase;\n\t\t\tfor (var i:number /*uint*/ = 0; i < this._particleNodes.length; i++)\n\t\t\t\tnode = this._particleNodes[i];\n\t\t\t\tcode += node.getAGALUVCode(shaderObject, this._iAnimationRegisterCache);\n\t\t\tcode += \"mov \" + this._iAnimationRegisterCache.uvVar.toString() + \",\" + this._iAnimationRegisterCache.uvTarget + \".xy\\n\";\n\t\t} else\n\t\t\tcode += \"mov \" + shaderObject.uvTarget + \",\" + shaderObject.uvSource + \"\\n\";\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALFragmentCode(shaderObject:ShaderObjectBase, shadedTarget:string):string\n\t{\n\t\treturn this._iAnimationRegisterCache.getColorCombinationCode(shadedTarget);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic doneAGALCode(shaderObject:ShaderObjectBase)\n\t{\n\t\tthis._iAnimationRegisterCache.setDataLength();\n\n\t\t//set vertexZeroConst,vertexOneConst,vertexTwoConst\n\t\tthis._iAnimationRegisterCache.setVertexConst(this._iAnimationRegisterCache.vertexZeroConst.index, 0, 1, 2, 0);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic get usesCPU():boolean\n\t{\n\t\treturn false;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic cancelGPUCompatibility()\n\t{\n\n\t}\n\n\tpublic dispose()\n\t{\n\t\tfor (var key in this._animationSubGeometries)\n\t\t\t( this._animationSubGeometries[key]).dispose();\n\n\t\tsuper.dispose();\n\t}\n\n\tpublic getAnimationSubGeometry(subMesh:ISubMesh)\n\t{\n\t\tvar mesh:Mesh = subMesh.parentMesh;\n\t\tvar animationSubGeometry:AnimationSubGeometry = (mesh.shareAnimationGeometry)? this._animationSubGeometries[subMesh.subGeometry.id] : this._animationSubGeometries[subMesh.id];\n\n\t\tif (animationSubGeometry)\n\t\t\treturn animationSubGeometry;\n\n\t\tthis._iGenerateAnimationSubGeometries(mesh);\n\n\t\treturn (mesh.shareAnimationGeometry)? this._animationSubGeometries[subMesh.subGeometry.id] : this._animationSubGeometries[subMesh.id];\n\t}\n\n\n\t/** @private */\n\tpublic _iGenerateAnimationSubGeometries(mesh:Mesh)\n\t{\n\t\tif (this.initParticleFunc == null)\n\t\t\tthrow(new Error(\"no initParticleFunc set\"));\n\n\t\tvar geometry:ParticleGeometry = mesh.geometry;\n\n\t\tif (!geometry)\n\t\t\tthrow(new Error(\"Particle animation can only be performed on a ParticleGeometry object\"));\n\n\t\tvar i:number /*int*/, j:number /*int*/, k:number /*int*/;\n\t\tvar animationSubGeometry:AnimationSubGeometry;\n\t\tvar newAnimationSubGeometry:boolean = false;\n\t\tvar subGeometry:SubGeometryBase;\n\t\tvar subMesh:ISubMesh;\n\t\tvar localNode:ParticleNodeBase;\n\n\t\tfor (i = 0; i < mesh.subMeshes.length; i++) {\n\t\t\tsubMesh = mesh.subMeshes[i];\n\t\t\tsubGeometry = subMesh.subGeometry;\n\t\t\tif (mesh.shareAnimationGeometry) {\n\t\t\t\tanimationSubGeometry = this._animationSubGeometries[subGeometry.id];\n\n\t\t\t\tif (animationSubGeometry)\n\t\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tanimationSubGeometry = new AnimationSubGeometry();\n\n\t\t\tif (mesh.shareAnimationGeometry)\n\t\t\t\tthis._animationSubGeometries[subGeometry.id] = animationSubGeometry;\n\t\t\telse\n\t\t\t\tthis._animationSubGeometries[subMesh.id] = animationSubGeometry;\n\n\t\t\tnewAnimationSubGeometry = true;\n\n\t\t\t//create the vertexData vector that will be used for local node data\n\t\t\tanimationSubGeometry.createVertexData(subGeometry.numVertices, this._totalLenOfOneVertex);\n\t\t}\n\n\t\tif (!newAnimationSubGeometry)\n\t\t\treturn;\n\n\t\tvar particles:Array = geometry.particles;\n\t\tvar particlesLength:number /*uint*/ = particles.length;\n\t\tvar numParticles:number /*uint*/ = geometry.numParticles;\n\t\tvar particleProperties:ParticleProperties = new ParticleProperties();\n\t\tvar particle:ParticleData;\n\n\t\tvar oneDataLen:number /*int*/;\n\t\tvar oneDataOffset:number /*int*/;\n\t\tvar counterForVertex:number /*int*/;\n\t\tvar counterForOneData:number /*int*/;\n\t\tvar oneData:Array;\n\t\tvar numVertices:number /*uint*/;\n\t\tvar vertexData:Array;\n\t\tvar vertexLength:number /*uint*/;\n\t\tvar startingOffset:number /*uint*/;\n\t\tvar vertexOffset:number /*uint*/;\n\n\t\t//default values for particle param\n\t\tparticleProperties.total = numParticles;\n\t\tparticleProperties.startTime = 0;\n\t\tparticleProperties.duration = 1000;\n\t\tparticleProperties.delay = 0.1;\n\n\t\ti = 0;\n\t\tj = 0;\n\t\twhile (i < numParticles) {\n\t\t\tparticleProperties.index = i;\n\n\t\t\t//call the init on the particle parameters\n\t\t\tthis.initParticleFunc.call(this.initParticleScope, particleProperties);\n\n\t\t\t//create the next set of node properties for the particle\n\t\t\tfor (k = 0; k < this._localStaticNodes.length; k++)\n\t\t\t\tthis._localStaticNodes[k]._iGeneratePropertyOfOneParticle(particleProperties);\n\n\t\t\t//loop through all particle data for the curent particle\n\t\t\twhile (j < particlesLength && (particle = particles[j]).particleIndex == i) {\n\t\t\t\t//find the target animationSubGeometry\n\t\t\t\tfor (k = 0; k < mesh.subMeshes.length; k++) {\n\t\t\t\t\tsubMesh = mesh.subMeshes[k];\n\t\t\t\t\tif (subMesh.subGeometry == particle.subGeometry) {\n\t\t\t\t\t\tanimationSubGeometry = (mesh.shareAnimationGeometry)? this._animationSubGeometries[subMesh.subGeometry.id] : this._animationSubGeometries[subMesh.id];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnumVertices = particle.numVertices;\n\t\t\t\tvertexData = animationSubGeometry.vertexData;\n\t\t\t\tvertexLength = numVertices*this._totalLenOfOneVertex;\n\t\t\t\tstartingOffset = animationSubGeometry.numProcessedVertices*this._totalLenOfOneVertex;\n\n\t\t\t\t//loop through each static local node in the animation set\n\t\t\t\tfor (k = 0; k < this._localStaticNodes.length; k++) {\n\t\t\t\t\tlocalNode = this._localStaticNodes[k];\n\t\t\t\t\toneData = localNode.oneData;\n\t\t\t\t\toneDataLen = localNode.dataLength;\n\t\t\t\t\toneDataOffset = startingOffset + localNode._iDataOffset;\n\n\t\t\t\t\t//loop through each vertex set in the vertex data\n\t\t\t\t\tfor (counterForVertex = 0; counterForVertex < vertexLength; counterForVertex += this._totalLenOfOneVertex) {\n\t\t\t\t\t\tvertexOffset = oneDataOffset + counterForVertex;\n\n\t\t\t\t\t\t//add the data for the local node to the vertex data\n\t\t\t\t\t\tfor (counterForOneData = 0; counterForOneData < oneDataLen; counterForOneData++)\n\t\t\t\t\t\t\tvertexData[vertexOffset + counterForOneData] = oneData[counterForOneData];\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t//store particle properties if they need to be retreived for dynamic local nodes\n\t\t\t\tif (this._localDynamicNodes.length)\n\t\t\t\t\tanimationSubGeometry.animationParticles.push(new ParticleAnimationData(i, particleProperties.startTime, particleProperties.duration, particleProperties.delay, particle));\n\n\t\t\t\tanimationSubGeometry.numProcessedVertices += numVertices;\n\n\t\t\t\t//next index\n\t\t\t\tj++;\n\t\t\t}\n\n\t\t\t//next particle\n\t\t\ti++;\n\t\t}\n\t}\n}\n\nexport = ParticleAnimationSet;", + "import ISubMesh\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/base/ISubMesh\");\nimport SubGeometryBase\t\t\t\t\t= require(\"awayjs-core/lib/core/base/SubGeometryBase\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport TriangleSubMeshRenderable\t\t= require(\"awayjs-stagegl/lib/core/pool/TriangleSubMeshRenderable\");\nimport ContextGLProgramType\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLProgramType\");\nimport IContextStageGL\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/IContextStageGL\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\n\nimport ParticleAnimationSet\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimationSet\");\nimport AnimationSubGeometry\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/AnimationSubGeometry\");\nimport ParticleAnimationData\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleAnimationData\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleNodeBase\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase\");\nimport ParticleStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleStateBase\");\n\n/**\n * Provides an interface for assigning paricle-based animation data sets to mesh-based entity objects\n * and controlling the various available states of animation through an interative playhead that can be\n * automatically updated or manually triggered.\n *\n * Requires that the containing geometry of the parent mesh is particle geometry\n *\n * @see away.base.ParticleGeometry\n */\nclass ParticleAnimator extends AnimatorBase\n{\n\n\tprivate _particleAnimationSet:ParticleAnimationSet;\n\tprivate _animationParticleStates:Array = new Array();\n\tprivate _animatorParticleStates:Array = new Array();\n\tprivate _timeParticleStates:Array = new Array();\n\tprivate _totalLenOfOneVertex:number /*uint*/ = 0;\n\tprivate _animatorSubGeometries:Object = new Object();\n\n\t/**\n\t * Creates a new ParticleAnimator object.\n\t *\n\t * @param particleAnimationSet The animation data set containing the particle animations used by the animator.\n\t */\n\tconstructor(particleAnimationSet:ParticleAnimationSet)\n\t{\n\t\tsuper(particleAnimationSet);\n\t\tthis._particleAnimationSet = particleAnimationSet;\n\n\t\tvar state:ParticleStateBase;\n\t\tvar node:ParticleNodeBase;\n\n\t\tfor (var i:number = 0; i < this._particleAnimationSet.particleNodes.length; i++) {\n\t\t\tnode = this._particleAnimationSet.particleNodes[i];\n\t\t\tstate = this.getAnimationState(node);\n\t\t\tif (node.mode == ParticlePropertiesMode.LOCAL_DYNAMIC) {\n\t\t\t\tthis._animatorParticleStates.push(state);\n\t\t\t\tnode._iDataOffset = this._totalLenOfOneVertex;\n\t\t\t\tthis._totalLenOfOneVertex += node.dataLength;\n\t\t\t} else {\n\t\t\t\tthis._animationParticleStates.push(state);\n\t\t\t}\n\t\t\tif (state.needUpdateTime)\n\t\t\t\tthis._timeParticleStates.push(state);\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic clone():AnimatorBase\n\t{\n\t\treturn new ParticleAnimator(this._particleAnimationSet);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic setRenderState(shaderObject:ShaderObjectBase, renderable:RenderableBase, stage:Stage, camera:Camera, vertexConstantOffset:number /*int*/, vertexStreamOffset:number /*int*/)\n\t{\n\t\tvar animationRegisterCache:AnimationRegisterCache = this._particleAnimationSet._iAnimationRegisterCache;\n\n\t\tvar subMesh:ISubMesh = ( renderable).subMesh;\n\t\tvar state:ParticleStateBase;\n\t\tvar i:number;\n\n\t\tif (!subMesh)\n\t\t\tthrow(new Error(\"Must be subMesh\"));\n\n\t\t//process animation sub geometries\n\t\tvar animationSubGeometry:AnimationSubGeometry = this._particleAnimationSet.getAnimationSubGeometry(subMesh);\n\n\t\tfor (i = 0; i < this._animationParticleStates.length; i++)\n\t\t\tthis._animationParticleStates[i].setRenderState(stage, renderable, animationSubGeometry, animationRegisterCache, camera);\n\n\t\t//process animator subgeometries\n\t\tvar animatorSubGeometry:AnimationSubGeometry = this.getAnimatorSubGeometry(subMesh);\n\n\t\tfor (i = 0; i < this._animatorParticleStates.length; i++)\n\t\t\tthis._animatorParticleStates[i].setRenderState(stage, renderable, animatorSubGeometry, animationRegisterCache, camera);\n\n\t\t( stage.context).setProgramConstantsFromArray(ContextGLProgramType.VERTEX, animationRegisterCache.vertexConstantOffset, animationRegisterCache.vertexConstantData, animationRegisterCache.numVertexConstant);\n\n\t\tif (animationRegisterCache.numFragmentConstant > 0)\n\t\t\t( stage.context).setProgramConstantsFromArray(ContextGLProgramType.FRAGMENT, animationRegisterCache.fragmentConstantOffset, animationRegisterCache.fragmentConstantData, animationRegisterCache.numFragmentConstant);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic testGPUCompatibility(shaderObject:ShaderObjectBase)\n\t{\n\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic start()\n\t{\n\t\tsuper.start();\n\n\t\tfor (var i:number = 0; i < this._timeParticleStates.length; i++)\n\t\t\tthis._timeParticleStates[i].offset(this._pAbsoluteTime);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pUpdateDeltaTime(dt:number)\n\t{\n\t\tthis._pAbsoluteTime += dt;\n\n\t\tfor (var i:number = 0; i < this._timeParticleStates.length; i++)\n\t\t\tthis._timeParticleStates[i].update(this._pAbsoluteTime);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic resetTime(offset:number /*int*/ = 0)\n\t{\n\t\tfor (var i:number = 0; i < this._timeParticleStates.length; i++)\n\t\t\tthis._timeParticleStates[i].offset(this._pAbsoluteTime + offset);\n\t\tthis.update(this.time);\n\t}\n\n\tpublic dispose()\n\t{\n\t\tfor (var key in this._animatorSubGeometries)\n\t\t\t( this._animatorSubGeometries[key]).dispose();\n\t}\n\n\tprivate getAnimatorSubGeometry(subMesh:ISubMesh):AnimationSubGeometry\n\t{\n\t\tif (!this._animatorParticleStates.length)\n\t\t\treturn;\n\n\t\tvar subGeometry:SubGeometryBase = subMesh.subGeometry;\n\t\tvar animatorSubGeometry:AnimationSubGeometry = this._animatorSubGeometries[subGeometry.id] = new AnimationSubGeometry();\n\n\t\t//create the vertexData vector that will be used for local state data\n\t\tanimatorSubGeometry.createVertexData(subGeometry.numVertices, this._totalLenOfOneVertex);\n\n\t\t//pass the particles data to the animator subGeometry\n\t\tanimatorSubGeometry.animationParticles = this._particleAnimationSet.getAnimationSubGeometry(subMesh).animationParticles;\n\t}\n}\n\nexport = ParticleAnimator;", + "import IAnimationSet\t\t\t\t\t= require(\"awayjs-core/lib/animators/IAnimationSet\");\n\nimport AnimationSetBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimationSetBase\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\n\n/**\n * The animation data set used by skeleton-based animators, containing skeleton animation data.\n *\n * @see away.animators.SkeletonAnimator\n */\nclass SkeletonAnimationSet extends AnimationSetBase implements IAnimationSet\n{\n\tprivate _jointsPerVertex:number /*uint*/;\n\n\t/**\n\t * Returns the amount of skeleton joints that can be linked to a single vertex via skinned weight values. For GPU-base animation, the\n\t * maximum allowed value is 4.\n\t */\n\tpublic get jointsPerVertex():number /*uint*/\n\t{\n\t\treturn this._jointsPerVertex;\n\t}\n\n\t/**\n\t * Creates a new SkeletonAnimationSet object.\n\t *\n\t * @param jointsPerVertex Sets the amount of skeleton joints that can be linked to a single vertex via skinned weight values. For GPU-base animation, the maximum allowed value is 4. Defaults to 4.\n\t */\n\tconstructor(jointsPerVertex:number /*uint*/ = 4)\n\t{\n\t\tsuper();\n\n\t\tthis._jointsPerVertex = jointsPerVertex;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALVertexCode(shaderObject:ShaderObjectBase):string\n\t{\n\t\tvar len:number /*uint*/ = shaderObject.animatableAttributes.length;\n\n\t\tvar indexOffset0:number /*uint*/ = shaderObject.numUsedVertexConstants;\n\t\tvar indexOffset1:number /*uint*/ = indexOffset0 + 1;\n\t\tvar indexOffset2:number /*uint*/ = indexOffset0 + 2;\n\t\tvar indexStream:string = \"va\" + shaderObject.numUsedStreams;\n\t\tvar weightStream:string = \"va\" + (shaderObject.numUsedStreams + 1);\n\t\tvar indices:Array = [ indexStream + \".x\", indexStream + \".y\", indexStream + \".z\", indexStream + \".w\" ];\n\t\tvar weights:Array = [ weightStream + \".x\", weightStream + \".y\", weightStream + \".z\", weightStream + \".w\" ];\n\t\tvar temp1:string = this._pFindTempReg(shaderObject.animationTargetRegisters);\n\t\tvar temp2:string = this._pFindTempReg(shaderObject.animationTargetRegisters, temp1);\n\t\tvar dot:string = \"dp4\";\n\t\tvar code:string = \"\";\n\n\t\tfor (var i:number /*uint*/ = 0; i < len; ++i) {\n\n\t\t\tvar src:string = shaderObject.animatableAttributes[i];\n\n\t\t\tfor (var j:number /*uint*/ = 0; j < this._jointsPerVertex; ++j) {\n\t\t\t\tcode += dot + \" \" + temp1 + \".x, \" + src + \", vc[\" + indices[j] + \"+\" + indexOffset0 + \"]\\n\" +\n\t\t\t\t\tdot + \" \" + temp1 + \".y, \" + src + \", vc[\" + indices[j] + \"+\" + indexOffset1 + \"]\\n\" +\n\t\t\t\t\tdot + \" \" + temp1 + \".z, \" + src + \", vc[\" + indices[j] + \"+\" + indexOffset2 + \"]\\n\" +\n\t\t\t\t\t\"mov \" + temp1 + \".w, \" + src + \".w\\n\" +\n\t\t\t\t\t\"mul \" + temp1 + \", \" + temp1 + \", \" + weights[j] + \"\\n\"; // apply weight\n\n\t\t\t\t// add or mov to target. Need to write to a temp reg first, because an output can be a target\n\t\t\t\tif (j == 0)\n\t\t\t\t\tcode += \"mov \" + temp2 + \", \" + temp1 + \"\\n\"; else\n\t\t\t\t\tcode += \"add \" + temp2 + \", \" + temp2 + \", \" + temp1 + \"\\n\";\n\t\t\t}\n\t\t\t// switch to dp3 once positions have been transformed, from now on, it should only be vectors instead of points\n\t\t\tdot = \"dp3\";\n\t\t\tcode += \"mov \" + shaderObject.animationTargetRegisters[i] + \", \" + temp2 + \"\\n\";\n\t\t}\n\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic activate(shaderObject:ShaderObjectBase, stage:Stage)\n\t{\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic deactivate(shaderObject:ShaderObjectBase, stage:Stage)\n\t{\n//\t\t\tvar streamOffset:number /*uint*/ = pass.numUsedStreams;\n//\t\t\tvar context:IContextStageGL = stage.context;\n//\t\t\tcontext.setVertexBufferAt(streamOffset, null);\n//\t\t\tcontext.setVertexBufferAt(streamOffset + 1, null);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALFragmentCode(shaderObject:ShaderObjectBase, shadedTarget:string):string\n\t{\n\t\treturn \"\";\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALUVCode(shaderObject:ShaderObjectBase):string\n\t{\n\t\treturn \"mov \" + shaderObject.uvTarget + \",\" + shaderObject.uvSource + \"\\n\";\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic doneAGALCode(shaderObject:ShaderObjectBase)\n\t{\n\n\t}\n}\n\nexport = SkeletonAnimationSet;", + "import ISubMesh\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/base/ISubMesh\");\nimport TriangleSubGeometry\t\t\t\t= require(\"awayjs-core/lib/core/base/TriangleSubGeometry\");\nimport TriangleSubMesh\t\t\t\t\t= require(\"awayjs-core/lib/core/base/TriangleSubMesh\");\nimport Quaternion\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Quaternion\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\nimport SubGeometryEvent\t\t\t\t\t= require(\"awayjs-core/lib/events/SubGeometryEvent\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport TriangleSubMeshRenderable\t\t= require(\"awayjs-stagegl/lib/core/pool/TriangleSubMeshRenderable\");\nimport ContextGLProgramType\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLProgramType\");\nimport IContextStageGL\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/IContextStageGL\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\n\nimport SkeletonAnimationSet\t\t\t\t= require(\"awayjs-renderergl/lib/animators/SkeletonAnimationSet\");\nimport JointPose\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/JointPose\");\nimport Skeleton\t\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/Skeleton\");\nimport SkeletonJoint\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/SkeletonJoint\");\nimport SkeletonPose\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/SkeletonPose\");\nimport ISkeletonAnimationState\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ISkeletonAnimationState\");\nimport IAnimationTransition\t\t\t\t= require(\"awayjs-renderergl/lib/animators/transitions/IAnimationTransition\");\nimport AnimationStateEvent\t\t\t\t= require(\"awayjs-renderergl/lib/events/AnimationStateEvent\");\n\n/**\n * Provides an interface for assigning skeleton-based animation data sets to mesh-based entity objects\n * and controlling the various available states of animation through an interative playhead that can be\n * automatically updated or manually triggered.\n */\nclass SkeletonAnimator extends AnimatorBase\n{\n\tprivate _globalMatrices:Array;\n\tprivate _globalPose:SkeletonPose = new SkeletonPose();\n\tprivate _globalPropertiesDirty:boolean;\n\tprivate _numJoints:number /*uint*/;\n\tprivate _morphedSubGeometry:Object = new Object();\n\tprivate _morphedSubGeometryDirty:Object = new Object();\n\tprivate _condensedMatrices:Array;\n\n\tprivate _skeleton:Skeleton;\n\tprivate _forceCPU:boolean;\n\tprivate _useCondensedIndices:boolean;\n\tprivate _jointsPerVertex:number /*uint*/;\n\tprivate _activeSkeletonState:ISkeletonAnimationState;\n\tprivate _onTransitionCompleteDelegate:(event:AnimationStateEvent) => void;\n\n\tprivate _onIndicesUpdateDelegate:(event:SubGeometryEvent) => void;\n\tprivate _onVerticesUpdateDelegate:(event:SubGeometryEvent) => void;\n\n\t/**\n\t * returns the calculated global matrices of the current skeleton pose.\n\t *\n\t * @see #globalPose\n\t */\n\tpublic get globalMatrices():Array\n\t{\n\t\tif (this._globalPropertiesDirty)\n\t\t\tthis.updateGlobalProperties();\n\n\t\treturn this._globalMatrices;\n\t}\n\n\t/**\n\t * returns the current skeleton pose output from the animator.\n\t *\n\t * @see away.animators.data.SkeletonPose\n\t */\n\tpublic get globalPose():SkeletonPose\n\t{\n\t\tif (this._globalPropertiesDirty)\n\t\t\tthis.updateGlobalProperties();\n\n\t\treturn this._globalPose;\n\t}\n\n\t/**\n\t * Returns the skeleton object in use by the animator - this defines the number and heirarchy of joints used by the\n\t * skinned geoemtry to which skeleon animator is applied.\n\t */\n\tpublic get skeleton():Skeleton\n\t{\n\t\treturn this._skeleton;\n\t}\n\n\t/**\n\t * Indicates whether the skeleton animator is disabled by default for GPU rendering, something that allows the animator to perform calculation on the GPU.\n\t * Defaults to false.\n\t */\n\tpublic get forceCPU():boolean\n\t{\n\t\treturn this._forceCPU;\n\t}\n\n\t/**\n\t * Offers the option of enabling GPU accelerated animation on skeletons larger than 32 joints\n\t * by condensing the number of joint index values required per mesh. Only applicable to\n\t * skeleton animations that utilise more than one mesh object. Defaults to false.\n\t */\n\tpublic get useCondensedIndices():boolean\n\t{\n\t\treturn this._useCondensedIndices;\n\t}\n\n\tpublic set useCondensedIndices(value:boolean)\n\t{\n\t\tthis._useCondensedIndices = value;\n\t}\n\n\t/**\n\t * Creates a new SkeletonAnimator object.\n\t *\n\t * @param skeletonAnimationSet The animation data set containing the skeleton animations used by the animator.\n\t * @param skeleton The skeleton object used for calculating the resulting global matrices for transforming skinned mesh data.\n\t * @param forceCPU Optional value that only allows the animator to perform calculation on the CPU. Defaults to false.\n\t */\n\tconstructor(animationSet:SkeletonAnimationSet, skeleton:Skeleton, forceCPU:boolean = false)\n\t{\n\t\tsuper(animationSet);\n\n\t\tthis._skeleton = skeleton;\n\t\tthis._forceCPU = forceCPU;\n\t\tthis._jointsPerVertex = animationSet.jointsPerVertex;\n\n\t\tthis._numJoints = this._skeleton.numJoints;\n\t\tthis._globalMatrices = new Array(this._numJoints*12);\n\n\t\tvar j:number /*int*/ = 0;\n\t\tfor (var i:number /*uint*/ = 0; i < this._numJoints; ++i) {\n\t\t\tthis._globalMatrices[j++] = 1;\n\t\t\tthis._globalMatrices[j++] = 0;\n\t\t\tthis._globalMatrices[j++] = 0;\n\t\t\tthis._globalMatrices[j++] = 0;\n\t\t\tthis._globalMatrices[j++] = 0;\n\t\t\tthis._globalMatrices[j++] = 1;\n\t\t\tthis._globalMatrices[j++] = 0;\n\t\t\tthis._globalMatrices[j++] = 0;\n\t\t\tthis._globalMatrices[j++] = 0;\n\t\t\tthis._globalMatrices[j++] = 0;\n\t\t\tthis._globalMatrices[j++] = 1;\n\t\t\tthis._globalMatrices[j++] = 0;\n\t\t}\n\n\t\tthis._onTransitionCompleteDelegate = (event:AnimationStateEvent) => this.onTransitionComplete(event);\n\t\tthis._onIndicesUpdateDelegate = (event:SubGeometryEvent) => this.onIndicesUpdate(event);\n\t\tthis._onVerticesUpdateDelegate = (event:SubGeometryEvent) => this.onVerticesUpdate(event);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic clone():AnimatorBase\n\t{\n\t\t/* The cast to SkeletonAnimationSet should never fail, as _animationSet can only be set\n\t\t through the constructor, which will only accept a SkeletonAnimationSet. */\n\t\treturn new SkeletonAnimator( this._pAnimationSet, this._skeleton, this._forceCPU);\n\t}\n\n\t/**\n\t * Plays an animation state registered with the given name in the animation data set.\n\t *\n\t * @param name The data set name of the animation state to be played.\n\t * @param transition An optional transition object that determines how the animator will transition from the currently active animation state.\n\t * @param offset An option offset time (in milliseconds) that resets the state's internal clock to the absolute time of the animator plus the offset value. Required for non-looping animation states.\n\t */\n\tpublic play(name:string, transition:IAnimationTransition = null, offset:number = NaN)\n\t{\n\t\tif (this._pActiveAnimationName == name)\n\t\t\treturn;\n\n\t\tthis._pActiveAnimationName = name;\n\n\t\tif (!this._pAnimationSet.hasAnimation(name))\n\t\t\tthrow new Error(\"Animation root node \" + name + \" not found!\");\n\n\t\tif (transition && this._pActiveNode) {\n\t\t\t//setup the transition\n\t\t\tthis._pActiveNode = transition.getAnimationNode(this, this._pActiveNode, this._pAnimationSet.getAnimation(name), this._pAbsoluteTime);\n\t\t\tthis._pActiveNode.addEventListener(AnimationStateEvent.TRANSITION_COMPLETE, this._onTransitionCompleteDelegate);\n\t\t} else\n\t\t\tthis._pActiveNode = this._pAnimationSet.getAnimation(name);\n\n\t\tthis._pActiveState = this.getAnimationState(this._pActiveNode);\n\n\t\tif (this.updatePosition) {\n\t\t\t//update straight away to reset position deltas\n\t\t\tthis._pActiveState.update(this._pAbsoluteTime);\n\t\t\tthis._pActiveState.positionDelta;\n\t\t}\n\n\t\tthis._activeSkeletonState = this._pActiveState;\n\n\t\tthis.start();\n\n\t\t//apply a time offset if specified\n\t\tif (!isNaN(offset))\n\t\t\tthis.reset(name, offset);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic setRenderState(shaderObject:ShaderObjectBase, renderable:RenderableBase, stage:Stage, camera:Camera, vertexConstantOffset:number /*int*/, vertexStreamOffset:number /*int*/)\n\t{\n\t\t// do on request of globalProperties\n\t\tif (this._globalPropertiesDirty)\n\t\t\tthis.updateGlobalProperties();\n\n\t\tvar subGeometry:TriangleSubGeometry = ( ( renderable).subMesh).subGeometry;\n\n\t\tsubGeometry.useCondensedIndices = this._useCondensedIndices;\n\n\t\tif (this._useCondensedIndices) {\n\t\t\t// using a condensed data set\n\t\t\tthis.updateCondensedMatrices(subGeometry.condensedIndexLookUp, subGeometry.numCondensedJoints);\n\t\t\t( stage.context).setProgramConstantsFromArray(ContextGLProgramType.VERTEX, vertexConstantOffset, this._condensedMatrices, subGeometry.numCondensedJoints*3);\n\t\t} else {\n\t\t\tif (this._pAnimationSet.usesCPU) {\n\t\t\t\tif (this._morphedSubGeometryDirty[subGeometry.id])\n\t\t\t\t\tthis.morphSubGeometry( renderable, subGeometry);\n\n\t\t\t\treturn\n\t\t\t}\n\t\t\t( stage.context).setProgramConstantsFromArray(ContextGLProgramType.VERTEX, vertexConstantOffset, this._globalMatrices, this._numJoints*3);\n\t\t}\n\n\t\t( stage.context).activateBuffer(vertexStreamOffset, renderable.getVertexData(TriangleSubGeometry.JOINT_INDEX_DATA), renderable.getVertexOffset(TriangleSubGeometry.JOINT_INDEX_DATA), renderable.JOINT_INDEX_FORMAT);\n\t\t( stage.context).activateBuffer(vertexStreamOffset + 1, renderable.getVertexData(TriangleSubGeometry.JOINT_WEIGHT_DATA), renderable.getVertexOffset(TriangleSubGeometry.JOINT_WEIGHT_DATA), renderable.JOINT_WEIGHT_FORMAT);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic testGPUCompatibility(shaderObject:ShaderObjectBase)\n\t{\n\t\tif (!this._useCondensedIndices && (this._forceCPU || this._jointsPerVertex > 4 || shaderObject.numUsedVertexConstants + this._numJoints*3 > 128))\n\t\t\tthis._pAnimationSet.cancelGPUCompatibility();\n\t}\n\n\t/**\n\t * Applies the calculated time delta to the active animation state node or state transition object.\n\t */\n\tpublic _pUpdateDeltaTime(dt:number)\n\t{\n\t\tsuper._pUpdateDeltaTime(dt);\n\n\t\t//invalidate pose matrices\n\t\tthis._globalPropertiesDirty = true;\n\n\t\t//trigger geometry invalidation if using CPU animation\n\t\tif (this._pAnimationSet.usesCPU)\n\t\t\tfor (var key in this._morphedSubGeometryDirty)\n\t\t\t\tthis._morphedSubGeometryDirty[key] = true;\n\t}\n\n\tprivate updateCondensedMatrices(condensedIndexLookUp:Array /*uint*/, numJoints:number /*uint*/)\n\t{\n\t\tvar i:number /*uint*/ = 0, j:number /*uint*/ = 0;\n\t\tvar len:number /*uint*/;\n\t\tvar srcIndex:number /*uint*/;\n\n\t\tthis._condensedMatrices = new Array();\n\n\t\tdo {\n\t\t\tsrcIndex = condensedIndexLookUp[i]*4;\n\t\t\tlen = srcIndex + 12;\n\t\t\t// copy into condensed\n\t\t\twhile (srcIndex < len)\n\t\t\t\tthis._condensedMatrices[j++] = this._globalMatrices[srcIndex++];\n\t\t} while (++i < numJoints);\n\t}\n\n\tprivate updateGlobalProperties()\n\t{\n\t\tthis._globalPropertiesDirty = false;\n\n\t\t//get global pose\n\t\tthis.localToGlobalPose(this._activeSkeletonState.getSkeletonPose(this._skeleton), this._globalPose, this._skeleton);\n\n\t\t// convert pose to matrix\n\t\tvar mtxOffset:number /*uint*/ = 0;\n\t\tvar globalPoses:Array = this._globalPose.jointPoses;\n\t\tvar raw:Array;\n\t\tvar ox:number, oy:number, oz:number, ow:number;\n\t\tvar xy2:number, xz2:number, xw2:number;\n\t\tvar yz2:number, yw2:number, zw2:number;\n\t\tvar n11:number, n12:number, n13:number;\n\t\tvar n21:number, n22:number, n23:number;\n\t\tvar n31:number, n32:number, n33:number;\n\t\tvar m11:number, m12:number, m13:number, m14:number;\n\t\tvar m21:number, m22:number, m23:number, m24:number;\n\t\tvar m31:number, m32:number, m33:number, m34:number;\n\t\tvar joints:Array = this._skeleton.joints;\n\t\tvar pose:JointPose;\n\t\tvar quat:Quaternion;\n\t\tvar vec:Vector3D;\n\t\tvar t:number;\n\n\t\tfor (var i:number /*uint*/ = 0; i < this._numJoints; ++i) {\n\t\t\tpose = globalPoses[i];\n\t\t\tquat = pose.orientation;\n\t\t\tvec = pose.translation;\n\t\t\tox = quat.x;\n\t\t\toy = quat.y;\n\t\t\toz = quat.z;\n\t\t\tow = quat.w;\n\n\t\t\txy2 = (t = 2.0*ox)*oy;\n\t\t\txz2 = t*oz;\n\t\t\txw2 = t*ow;\n\t\t\tyz2 = (t = 2.0*oy)*oz;\n\t\t\tyw2 = t*ow;\n\t\t\tzw2 = 2.0*oz*ow;\n\n\t\t\tyz2 = 2.0*oy*oz;\n\t\t\tyw2 = 2.0*oy*ow;\n\t\t\tzw2 = 2.0*oz*ow;\n\t\t\tox *= ox;\n\t\t\toy *= oy;\n\t\t\toz *= oz;\n\t\t\tow *= ow;\n\n\t\t\tn11 = (t = ox - oy) - oz + ow;\n\t\t\tn12 = xy2 - zw2;\n\t\t\tn13 = xz2 + yw2;\n\t\t\tn21 = xy2 + zw2;\n\t\t\tn22 = -t - oz + ow;\n\t\t\tn23 = yz2 - xw2;\n\t\t\tn31 = xz2 - yw2;\n\t\t\tn32 = yz2 + xw2;\n\t\t\tn33 = -ox - oy + oz + ow;\n\n\t\t\t// prepend inverse bind pose\n\t\t\traw = joints[i].inverseBindPose;\n\t\t\tm11 = raw[0];\n\t\t\tm12 = raw[4];\n\t\t\tm13 = raw[8];\n\t\t\tm14 = raw[12];\n\t\t\tm21 = raw[1];\n\t\t\tm22 = raw[5];\n\t\t\tm23 = raw[9];\n\t\t\tm24 = raw[13];\n\t\t\tm31 = raw[2];\n\t\t\tm32 = raw[6];\n\t\t\tm33 = raw[10];\n\t\t\tm34 = raw[14];\n\n\t\t\tthis._globalMatrices[mtxOffset] = n11*m11 + n12*m21 + n13*m31;\n\t\t\tthis._globalMatrices[mtxOffset + 1] = n11*m12 + n12*m22 + n13*m32;\n\t\t\tthis._globalMatrices[mtxOffset + 2] = n11*m13 + n12*m23 + n13*m33;\n\t\t\tthis._globalMatrices[mtxOffset + 3] = n11*m14 + n12*m24 + n13*m34 + vec.x;\n\t\t\tthis._globalMatrices[mtxOffset + 4] = n21*m11 + n22*m21 + n23*m31;\n\t\t\tthis._globalMatrices[mtxOffset + 5] = n21*m12 + n22*m22 + n23*m32;\n\t\t\tthis._globalMatrices[mtxOffset + 6] = n21*m13 + n22*m23 + n23*m33;\n\t\t\tthis._globalMatrices[mtxOffset + 7] = n21*m14 + n22*m24 + n23*m34 + vec.y;\n\t\t\tthis._globalMatrices[mtxOffset + 8] = n31*m11 + n32*m21 + n33*m31;\n\t\t\tthis._globalMatrices[mtxOffset + 9] = n31*m12 + n32*m22 + n33*m32;\n\t\t\tthis._globalMatrices[mtxOffset + 10] = n31*m13 + n32*m23 + n33*m33;\n\t\t\tthis._globalMatrices[mtxOffset + 11] = n31*m14 + n32*m24 + n33*m34 + vec.z;\n\n\t\t\tmtxOffset = mtxOffset + 12;\n\t\t}\n\t}\n\n\n\tpublic getRenderableSubGeometry(renderable:TriangleSubMeshRenderable, sourceSubGeometry:TriangleSubGeometry):TriangleSubGeometry\n\t{\n\t\tthis._morphedSubGeometryDirty[sourceSubGeometry.id] = true;\n\n\t\t//early out for GPU animations\n\t\tif (!this._pAnimationSet.usesCPU)\n\t\t\treturn sourceSubGeometry;\n\n\t\tvar targetSubGeometry:TriangleSubGeometry;\n\n\t\tif (!(targetSubGeometry = this._morphedSubGeometry[sourceSubGeometry.id])) {\n\t\t\t//not yet stored\n\t\t\ttargetSubGeometry = this._morphedSubGeometry[sourceSubGeometry.id] = sourceSubGeometry.clone();\n\t\t\t//turn off auto calculations on the morphed geometry\n\t\t\ttargetSubGeometry.autoDeriveNormals = false;\n\t\t\ttargetSubGeometry.autoDeriveTangents = false;\n\t\t\ttargetSubGeometry.autoDeriveUVs = false;\n\t\t\t//add event listeners for any changes in UV values on the source geometry\n\t\t\tsourceSubGeometry.addEventListener(SubGeometryEvent.INDICES_UPDATED, this._onIndicesUpdateDelegate);\n\t\t\tsourceSubGeometry.addEventListener(SubGeometryEvent.VERTICES_UPDATED, this._onVerticesUpdateDelegate);\n\t\t}\n\n\t\treturn targetSubGeometry;\n\t}\n\n\t/**\n\t * If the animation can't be performed on GPU, transform vertices manually\n\t * @param subGeom The subgeometry containing the weights and joint index data per vertex.\n\t * @param pass The material pass for which we need to transform the vertices\n\t */\n\tpublic morphSubGeometry(renderable:TriangleSubMeshRenderable, sourceSubGeometry:TriangleSubGeometry)\n\t{\n\t\tthis._morphedSubGeometryDirty[sourceSubGeometry.id] = false;\n\n\t\tvar sourcePositions:Array = sourceSubGeometry.positions;\n\t\tvar sourceNormals:Array = sourceSubGeometry.vertexNormals;\n\t\tvar sourceTangents:Array = sourceSubGeometry.vertexTangents;\n\n\t\tvar jointIndices:Array = sourceSubGeometry.jointIndices;\n\t\tvar jointWeights:Array = sourceSubGeometry.jointWeights;\n\n\t\tvar targetSubGeometry = this._morphedSubGeometry[sourceSubGeometry.id];\n\n\t\tvar targetPositions:Array = targetSubGeometry.positions;\n\t\tvar targetNormals:Array = targetSubGeometry.vertexNormals;\n\t\tvar targetTangents:Array = targetSubGeometry.vertexTangents;\n\n\t\tvar index:number /*uint*/ = 0;\n\t\tvar j:number /*uint*/ = 0;\n\t\tvar k:number /*uint*/;\n\t\tvar vx:number, vy:number, vz:number;\n\t\tvar nx:number, ny:number, nz:number;\n\t\tvar tx:number, ty:number, tz:number;\n\t\tvar len:number /*int*/ = sourcePositions.length;\n\t\tvar weight:number;\n\t\tvar vertX:number, vertY:number, vertZ:number;\n\t\tvar normX:number, normY:number, normZ:number;\n\t\tvar tangX:number, tangY:number, tangZ:number;\n\t\tvar m11:number, m12:number, m13:number, m14:number;\n\t\tvar m21:number, m22:number, m23:number, m24:number;\n\t\tvar m31:number, m32:number, m33:number, m34:number;\n\n\t\twhile (index < len) {\n\t\t\tvertX = sourcePositions[index];\n\t\t\tvertY = sourcePositions[index + 1];\n\t\t\tvertZ = sourcePositions[index + 2];\n\t\t\tnormX = sourceNormals[index];\n\t\t\tnormY = sourceNormals[index + 1];\n\t\t\tnormZ = sourceNormals[index + 2];\n\t\t\ttangX = sourceTangents[index];\n\t\t\ttangY = sourceTangents[index + 1];\n\t\t\ttangZ = sourceTangents[index + 2];\n\t\t\tvx = 0;\n\t\t\tvy = 0;\n\t\t\tvz = 0;\n\t\t\tnx = 0;\n\t\t\tny = 0;\n\t\t\tnz = 0;\n\t\t\ttx = 0;\n\t\t\tty = 0;\n\t\t\ttz = 0;\n\t\t\tk = 0;\n\t\t\twhile (k < this._jointsPerVertex) {\n\t\t\t\tweight = jointWeights[j];\n\t\t\t\tif (weight > 0) {\n\t\t\t\t\t// implicit /3*12 (/3 because indices are multiplied by 3 for gpu matrix access, *12 because it's the matrix size)\n\t\t\t\t\tvar mtxOffset:number /*uint*/ = jointIndices[j++] << 2;\n\t\t\t\t\tm11 = this._globalMatrices[mtxOffset];\n\t\t\t\t\tm12 = this._globalMatrices[mtxOffset + 1];\n\t\t\t\t\tm13 = this._globalMatrices[mtxOffset + 2];\n\t\t\t\t\tm14 = this._globalMatrices[mtxOffset + 3];\n\t\t\t\t\tm21 = this._globalMatrices[mtxOffset + 4];\n\t\t\t\t\tm22 = this._globalMatrices[mtxOffset + 5];\n\t\t\t\t\tm23 = this._globalMatrices[mtxOffset + 6];\n\t\t\t\t\tm24 = this._globalMatrices[mtxOffset + 7];\n\t\t\t\t\tm31 = this._globalMatrices[mtxOffset + 8];\n\t\t\t\t\tm32 = this._globalMatrices[mtxOffset + 9];\n\t\t\t\t\tm33 = this._globalMatrices[mtxOffset + 10];\n\t\t\t\t\tm34 = this._globalMatrices[mtxOffset + 11];\n\t\t\t\t\tvx += weight*(m11*vertX + m12*vertY + m13*vertZ + m14);\n\t\t\t\t\tvy += weight*(m21*vertX + m22*vertY + m23*vertZ + m24);\n\t\t\t\t\tvz += weight*(m31*vertX + m32*vertY + m33*vertZ + m34);\n\t\t\t\t\tnx += weight*(m11*normX + m12*normY + m13*normZ);\n\t\t\t\t\tny += weight*(m21*normX + m22*normY + m23*normZ);\n\t\t\t\t\tnz += weight*(m31*normX + m32*normY + m33*normZ);\n\t\t\t\t\ttx += weight*(m11*tangX + m12*tangY + m13*tangZ);\n\t\t\t\t\tty += weight*(m21*tangX + m22*tangY + m23*tangZ);\n\t\t\t\t\ttz += weight*(m31*tangX + m32*tangY + m33*tangZ);\n\t\t\t\t\t++k;\n\t\t\t\t} else {\n\t\t\t\t\tj += (this._jointsPerVertex - k);\n\t\t\t\t\tk = this._jointsPerVertex;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttargetPositions[index] = vx;\n\t\t\ttargetPositions[index + 1] = vy;\n\t\t\ttargetPositions[index + 2] = vz;\n\t\t\ttargetNormals[index] = nx;\n\t\t\ttargetNormals[index + 1] = ny;\n\t\t\ttargetNormals[index + 2] = nz;\n\t\t\ttargetTangents[index] = tx;\n\t\t\ttargetTangents[index + 1] = ty;\n\t\t\ttargetTangents[index + 2] = tz;\n\n\t\t\tindex += 3;\n\t\t}\n\n\t\ttargetSubGeometry.updatePositions(targetPositions);\n\t\ttargetSubGeometry.updateVertexNormals(targetNormals);\n\t\ttargetSubGeometry.updateVertexTangents(targetTangents);\n\t}\n\n\t/**\n\t * Converts a local hierarchical skeleton pose to a global pose\n\t * @param targetPose The SkeletonPose object that will contain the global pose.\n\t * @param skeleton The skeleton containing the joints, and as such, the hierarchical data to transform to global poses.\n\t */\n\tprivate localToGlobalPose(sourcePose:SkeletonPose, targetPose:SkeletonPose, skeleton:Skeleton)\n\t{\n\t\tvar globalPoses:Array = targetPose.jointPoses;\n\t\tvar globalJointPose:JointPose;\n\t\tvar joints:Array = skeleton.joints;\n\t\tvar len:number /*uint*/ = sourcePose.numJointPoses;\n\t\tvar jointPoses:Array = sourcePose.jointPoses;\n\t\tvar parentIndex:number /*int*/;\n\t\tvar joint:SkeletonJoint;\n\t\tvar parentPose:JointPose;\n\t\tvar pose:JointPose;\n\t\tvar or:Quaternion;\n\t\tvar tr:Vector3D;\n\t\tvar t:Vector3D;\n\t\tvar q:Quaternion;\n\n\t\tvar x1:number, y1:number, z1:number, w1:number;\n\t\tvar x2:number, y2:number, z2:number, w2:number;\n\t\tvar x3:number, y3:number, z3:number;\n\n\t\t// :s\n\t\tif (globalPoses.length != len)\n\t\t\tglobalPoses.length = len;\n\n\t\tfor (var i:number /*uint*/ = 0; i < len; ++i) {\n\t\t\tglobalJointPose = globalPoses[i];\n\n\t\t\tif (globalJointPose == null)\n\t\t\t\tglobalJointPose = globalPoses[i] = new JointPose();\n\n\t\t\tjoint = joints[i];\n\t\t\tparentIndex = joint.parentIndex;\n\t\t\tpose = jointPoses[i];\n\n\t\t\tq = globalJointPose.orientation;\n\t\t\tt = globalJointPose.translation;\n\n\t\t\tif (parentIndex < 0) {\n\t\t\t\ttr = pose.translation;\n\t\t\t\tor = pose.orientation;\n\t\t\t\tq.x = or.x;\n\t\t\t\tq.y = or.y;\n\t\t\t\tq.z = or.z;\n\t\t\t\tq.w = or.w;\n\t\t\t\tt.x = tr.x;\n\t\t\t\tt.y = tr.y;\n\t\t\t\tt.z = tr.z;\n\t\t\t} else {\n\t\t\t\t// append parent pose\n\t\t\t\tparentPose = globalPoses[parentIndex];\n\n\t\t\t\t// rotate point\n\t\t\t\tor = parentPose.orientation;\n\t\t\t\ttr = pose.translation;\n\t\t\t\tx2 = or.x;\n\t\t\t\ty2 = or.y;\n\t\t\t\tz2 = or.z;\n\t\t\t\tw2 = or.w;\n\t\t\t\tx3 = tr.x;\n\t\t\t\ty3 = tr.y;\n\t\t\t\tz3 = tr.z;\n\n\t\t\t\tw1 = -x2*x3 - y2*y3 - z2*z3;\n\t\t\t\tx1 = w2*x3 + y2*z3 - z2*y3;\n\t\t\t\ty1 = w2*y3 - x2*z3 + z2*x3;\n\t\t\t\tz1 = w2*z3 + x2*y3 - y2*x3;\n\n\t\t\t\t// append parent translation\n\t\t\t\ttr = parentPose.translation;\n\t\t\t\tt.x = -w1*x2 + x1*w2 - y1*z2 + z1*y2 + tr.x;\n\t\t\t\tt.y = -w1*y2 + x1*z2 + y1*w2 - z1*x2 + tr.y;\n\t\t\t\tt.z = -w1*z2 - x1*y2 + y1*x2 + z1*w2 + tr.z;\n\n\t\t\t\t// append parent orientation\n\t\t\t\tx1 = or.x;\n\t\t\t\ty1 = or.y;\n\t\t\t\tz1 = or.z;\n\t\t\t\tw1 = or.w;\n\t\t\t\tor = pose.orientation;\n\t\t\t\tx2 = or.x;\n\t\t\t\ty2 = or.y;\n\t\t\t\tz2 = or.z;\n\t\t\t\tw2 = or.w;\n\n\t\t\t\tq.w = w1*w2 - x1*x2 - y1*y2 - z1*z2;\n\t\t\t\tq.x = w1*x2 + x1*w2 + y1*z2 - z1*y2;\n\t\t\t\tq.y = w1*y2 - x1*z2 + y1*w2 + z1*x2;\n\t\t\t\tq.z = w1*z2 + x1*y2 - y1*x2 + z1*w2;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onTransitionComplete(event:AnimationStateEvent)\n\t{\n\t\tif (event.type == AnimationStateEvent.TRANSITION_COMPLETE) {\n\t\t\tevent.animationNode.removeEventListener(AnimationStateEvent.TRANSITION_COMPLETE, this._onTransitionCompleteDelegate);\n\t\t\t//if this is the current active state transition, revert control to the active node\n\t\t\tif (this._pActiveState == event.animationState) {\n\t\t\t\tthis._pActiveNode = this._pAnimationSet.getAnimation(this._pActiveAnimationName);\n\t\t\t\tthis._pActiveState = this.getAnimationState(this._pActiveNode);\n\t\t\t\tthis._activeSkeletonState = this._pActiveState;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onIndicesUpdate(event:SubGeometryEvent)\n\t{\n\t\tvar subGeometry:TriangleSubGeometry = event.target;\n\n\t\t( this._morphedSubGeometry[subGeometry.id]).updateIndices(subGeometry.indices);\n\t}\n\n\tprivate onVerticesUpdate(event:SubGeometryEvent)\n\t{\n\t\tvar subGeometry:TriangleSubGeometry = event.target;\n\t\tvar morphGeometry:TriangleSubGeometry = this._morphedSubGeometry[subGeometry.id];\n\n\t\tswitch(event.dataType) {\n\t\t\tcase TriangleSubGeometry.UV_DATA:\n\t\t\t\tmorphGeometry.updateUVs(subGeometry.uvs);\n\t\t\tcase TriangleSubGeometry.SECONDARY_UV_DATA:\n\t\t\t\tmorphGeometry.updateUVs(subGeometry.secondaryUVs);\n\t\t}\n\t}\n}\n\nexport = SkeletonAnimator;", + "import IAnimationSet\t\t\t\t\t= require(\"awayjs-core/lib/animators/IAnimationSet\");\n\nimport AnimationSetBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimationSetBase\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\n\nimport VertexAnimationMode\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/VertexAnimationMode\");\n\n/**\n * The animation data set used by vertex-based animators, containing vertex animation state data.\n *\n * @see VertexAnimator\n */\nclass VertexAnimationSet extends AnimationSetBase implements IAnimationSet\n{\n\tprivate _numPoses:number /*uint*/;\n\tprivate _blendMode:string;\n\n\t/**\n\t * Returns the number of poses made available at once to the GPU animation code.\n\t */\n\tpublic get numPoses():number /*uint*/\n\t{\n\t\treturn this._numPoses;\n\t}\n\n\t/**\n\t * Returns the active blend mode of the vertex animator object.\n\t */\n\tpublic get blendMode():string\n\t{\n\t\treturn this._blendMode;\n\t}\n\n\t/**\n\t * Returns whether or not normal data is used in last set GPU pass of the vertex shader.\n\t */\n//\t\tpublic get useNormals():boolean\n//\t\t{\n//\t\t\treturn this._uploadNormals;\n//\t\t}\n\n\t/**\n\t * Creates a new VertexAnimationSet object.\n\t *\n\t * @param numPoses The number of poses made available at once to the GPU animation code.\n\t * @param blendMode Optional value for setting the animation mode of the vertex animator object.\n\t *\n\t * @see away3d.animators.data.VertexAnimationMode\n\t */\n\tconstructor(numPoses:number /*uint*/ = 2, blendMode:string = \"absolute\")\n\t{\n\t\tsuper();\n\t\tthis._numPoses = numPoses;\n\t\tthis._blendMode = blendMode;\n\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALVertexCode(shaderObject:ShaderObjectBase):string\n\t{\n\t\tif (this._blendMode == VertexAnimationMode.ABSOLUTE)\n\t\t\treturn this.getAbsoluteAGALCode(shaderObject);\n\t\telse\n\t\t\treturn this.getAdditiveAGALCode(shaderObject);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic activate(shaderObject:ShaderObjectBase, stage:Stage)\n\t{\n//\t\t\tvar uID:number = pass._iUniqueId;\n//\t\t\tthis._uploadNormals = this._useNormals[uID];\n//\t\t\tthis._uploadTangents = this._useTangents[uID];\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic deactivate(shaderObject:ShaderObjectBase, stage:Stage)\n\t{\n//\t\t\tvar uID:number = pass._iUniqueId;\n//\t\t\tvar index:number /*uint*/ = this._streamIndices[uID];\n//\t\t\tvar context:IContextStageGL = stage.context;\n//\t\t\tcontext.setVertexBufferAt(index, null);\n//\t\t\tif (this._uploadNormals)\n//\t\t\t\tcontext.setVertexBufferAt(index + 1, null);\n//\t\t\tif (this._uploadTangents)\n//\t\t\t\tcontext.setVertexBufferAt(index + 2, null);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALFragmentCode(shaderObject:ShaderObjectBase, shadedTarget:string):string\n\t{\n\t\treturn \"\";\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALUVCode(shaderObject:ShaderObjectBase):string\n\t{\n\t\treturn \"mov \" + shaderObject.uvTarget + \",\" + shaderObject.uvSource + \"\\n\";\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic doneAGALCode(shaderObject:ShaderObjectBase)\n\t{\n\n\t}\n\n\t/**\n\t * Generates the vertex AGAL code for absolute blending.\n\t */\n\tprivate getAbsoluteAGALCode(shaderObject:ShaderObjectBase):string\n\t{\n\t\tvar code:string = \"\";\n\t\tvar temp1:string = this._pFindTempReg(shaderObject.animationTargetRegisters);\n\t\tvar temp2:string = this._pFindTempReg(shaderObject.animationTargetRegisters, temp1);\n\t\tvar regs:Array = new Array(\"x\", \"y\", \"z\", \"w\");\n\t\tvar len:number /*uint*/ = shaderObject.animatableAttributes.length;\n\t\tvar constantReg:string = \"vc\" + shaderObject.numUsedVertexConstants;\n\n\t\tif (len > 2)\n\t\t\tlen = 2;\n\t\tvar streamIndex:number /*uint*/ = shaderObject.numUsedStreams;\n\n\t\tfor (var i:number /*uint*/ = 0; i < len; ++i) {\n\t\t\tcode += \"mul \" + temp1 + \", \" + shaderObject.animatableAttributes[i] + \", \" + constantReg + \".\" + regs[0] + \"\\n\";\n\n\t\t\tfor (var j:number /*uint*/ = 1; j < this._numPoses; ++j) {\n\t\t\t\tcode += \"mul \" + temp2 + \", va\" + streamIndex + \", \" + constantReg + \".\" + regs[j] + \"\\n\";\n\n\t\t\t\tif (j < this._numPoses - 1)\n\t\t\t\t\tcode += \"add \" + temp1 + \", \" + temp1 + \", \" + temp2 + \"\\n\";\n\n\t\t\t\t++streamIndex;\n\t\t\t}\n\n\t\t\tcode += \"add \" + shaderObject.animationTargetRegisters[i] + \", \" + temp1 + \", \" + temp2 + \"\\n\";\n\t\t}\n\n\t\t// add code for bitangents if tangents are used\n\t\tif (shaderObject.tangentDependencies > 0 || shaderObject.outputsNormals) {\n\t\t\tcode += \"dp3 \" + temp1 + \".x, \" + shaderObject.animatableAttributes[2] + \", \" + shaderObject.animationTargetRegisters[1] + \"\\n\" +\n\t\t\t\t\"mul \" + temp1 + \", \" + shaderObject.animationTargetRegisters[1] + \", \" + temp1 + \".x\\n\" +\n\t\t\t\t\"sub \" + shaderObject.animationTargetRegisters[2] + \", \" + shaderObject.animationTargetRegisters[2] + \", \" + temp1 + \"\\n\";\n\t\t}\n\t\treturn code;\n\t}\n\n\t/**\n\t * Generates the vertex AGAL code for additive blending.\n\t */\n\tprivate getAdditiveAGALCode(shaderObject:ShaderObjectBase):string\n\t{\n\t\tvar code:string = \"\";\n\t\tvar len:number /*uint*/ = shaderObject.animatableAttributes.length;\n\t\tvar regs:Array = [\"x\", \"y\", \"z\", \"w\"];\n\t\tvar temp1:string = this._pFindTempReg(shaderObject.animationTargetRegisters);\n\t\tvar k:number /*uint*/;\n\n\t\tvar streamIndex:number /*uint*/ = shaderObject.numUsedStreams;\n\n\t\tif (len > 2)\n\t\t\tlen = 2;\n\n\t\tcode += \"mov \" + shaderObject.animationTargetRegisters[0] + \", \" + shaderObject.animatableAttributes[0] + \"\\n\";\n\t\tif (shaderObject.normalDependencies > 0)\n\t\t\tcode += \"mov \" + shaderObject.animationTargetRegisters[1] + \", \" + shaderObject.animatableAttributes[1] + \"\\n\";\n\n\t\tfor (var i:number /*uint*/ = 0; i < len; ++i) {\n\t\t\tfor (var j:number /*uint*/ = 0; j < this._numPoses; ++j) {\n\t\t\t\tcode += \"mul \" + temp1 + \", va\" + (streamIndex + k) + \", vc\" + shaderObject.numUsedVertexConstants + \".\" + regs[j] + \"\\n\" +\n\t\t\t\t\t\"add \" + shaderObject.animationTargetRegisters[i] + \", \" + shaderObject.animationTargetRegisters[i] + \", \" + temp1 + \"\\n\";\n\t\t\t\tk++;\n\t\t\t}\n\t\t}\n\n\t\tif (shaderObject.tangentDependencies > 0 || shaderObject.outputsNormals) {\n\t\t\tcode += \"dp3 \" + temp1 + \".x, \" + shaderObject.animatableAttributes[2] + \", \" + shaderObject.animationTargetRegisters[1] + \"\\n\" +\n\t\t\t\t\"mul \" + temp1 + \", \" + shaderObject.animationTargetRegisters[1] + \", \" + temp1 + \".x\\n\" +\n\t\t\t\t\"sub \" + shaderObject.animationTargetRegisters[2] + \", \" + shaderObject.animatableAttributes[2] + \", \" + temp1 + \"\\n\";\n\t\t}\n\n\t\treturn code;\n\t}\n}\n\nexport = VertexAnimationSet;", + "import Geometry\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/base/Geometry\");\nimport SubGeometryBase\t\t\t\t\t= require(\"awayjs-core/lib/core/base/SubGeometryBase\");\nimport TriangleSubGeometry\t\t\t\t= require(\"awayjs-core/lib/core/base/TriangleSubGeometry\");\nimport TriangleSubMesh\t\t\t\t\t= require(\"awayjs-core/lib/core/base/TriangleSubMesh\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\nimport Mesh\t\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Mesh\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport TriangleSubMeshRenderable\t\t= require(\"awayjs-stagegl/lib/core/pool/TriangleSubMeshRenderable\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport VertexDataPool\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/VertexDataPool\");\nimport ContextGLProgramType\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLProgramType\");\nimport IContextStageGL\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/IContextStageGL\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\n\nimport VertexAnimationSet\t\t\t\t= require(\"awayjs-renderergl/lib/animators/VertexAnimationSet\");\nimport VertexAnimationMode\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/VertexAnimationMode\");\nimport IVertexAnimationState\t\t\t= require(\"awayjs-renderergl/lib/animators/states/IVertexAnimationState\");\nimport IAnimationTransition\t\t\t\t= require(\"awayjs-renderergl/lib/animators/transitions/IAnimationTransition\");\n\n/**\n * Provides an interface for assigning vertex-based animation data sets to mesh-based entity objects\n * and controlling the various available states of animation through an interative playhead that can be\n * automatically updated or manually triggered.\n */\nclass VertexAnimator extends AnimatorBase\n{\n\tprivate _vertexAnimationSet:VertexAnimationSet;\n\tprivate _poses:Array = new Array();\n\tprivate _weights:Array = Array(1, 0, 0, 0);\n\tprivate _numPoses:number /*uint*/;\n\tprivate _blendMode:string;\n\tprivate _activeVertexState:IVertexAnimationState;\n\n\t/**\n\t * Creates a new VertexAnimator object.\n\t *\n\t * @param vertexAnimationSet The animation data set containing the vertex animations used by the animator.\n\t */\n\tconstructor(vertexAnimationSet:VertexAnimationSet)\n\t{\n\t\tsuper(vertexAnimationSet);\n\n\t\tthis._vertexAnimationSet = vertexAnimationSet;\n\t\tthis._numPoses = vertexAnimationSet.numPoses;\n\t\tthis._blendMode = vertexAnimationSet.blendMode;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic clone():AnimatorBase\n\t{\n\t\treturn new VertexAnimator(this._vertexAnimationSet);\n\t}\n\n\t/**\n\t * Plays a sequence with a given name. If the sequence is not found, it may not be loaded yet, and it will retry every frame.\n\t * @param sequenceName The name of the clip to be played.\n\t */\n\tpublic play(name:string, transition:IAnimationTransition = null, offset:number = NaN)\n\t{\n\t\tif (this._pActiveAnimationName == name)\n\t\t\treturn;\n\n\t\tthis._pActiveAnimationName = name;\n\n\t\t//TODO: implement transitions in vertex animator\n\n\t\tif (!this._pAnimationSet.hasAnimation(name))\n\t\t\tthrow new Error(\"Animation root node \" + name + \" not found!\");\n\n\t\tthis._pActiveNode = this._pAnimationSet.getAnimation(name);\n\n\t\tthis._pActiveState = this.getAnimationState(this._pActiveNode);\n\n\t\tif (this.updatePosition) {\n\t\t\t//update straight away to reset position deltas\n\t\t\tthis._pActiveState.update(this._pAbsoluteTime);\n\t\t\tthis._pActiveState.positionDelta;\n\t\t}\n\n\t\tthis._activeVertexState = this._pActiveState;\n\n\t\tthis.start();\n\n\t\t//apply a time offset if specified\n\t\tif (!isNaN(offset))\n\t\t\tthis.reset(name, offset);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pUpdateDeltaTime(dt:number)\n\t{\n\t\tsuper._pUpdateDeltaTime(dt);\n\n\t\tvar geometryFlag:boolean = false;\n\n\t\tif (this._poses[0] != this._activeVertexState.currentGeometry) {\n\t\t\tthis._poses[0] = this._activeVertexState.currentGeometry;\n\t\t\tgeometryFlag = true;\n\t\t}\n\n\t\tif (this._poses[1] != this._activeVertexState.nextGeometry) {\n\t\t\tthis._poses[1] = this._activeVertexState.nextGeometry;\n\t\t\tgeometryFlag = true;\n\t\t}\n\n\t\tthis._weights[0] = 1 - (this._weights[1] = this._activeVertexState.blendWeight);\n\n\t\tif (geometryFlag) {\n\t\t\t//invalidate meshes\n\t\t\tvar mesh:Mesh;\n\t\t\tvar len:number = this._pOwners.length;\n\t\t\tfor (var i:number = 0; i < len; i++) {\n\t\t\t\tmesh = this._pOwners[i];\n\t\t\t\tmesh._iInvalidateRenderableGeometries();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic setRenderState(shaderObject:ShaderObjectBase, renderable:RenderableBase, stage:Stage, camera:Camera, vertexConstantOffset:number /*int*/, vertexStreamOffset:number /*int*/)\n\t{\n\t\t// todo: add code for when running on cpu\n\n\t\t// if no poses defined, set temp data\n\t\tif (!this._poses.length) {\n\t\t\tthis.setNullPose(shaderObject, renderable, stage, vertexConstantOffset, vertexStreamOffset);\n\t\t\treturn;\n\t\t}\n\n\t\t// this type of animation can only be SubMesh\n\t\tvar subMesh:TriangleSubMesh = ( renderable).subMesh;\n\t\tvar subGeom:SubGeometryBase;\n\t\tvar i:number /*uint*/;\n\t\tvar len:number /*uint*/ = this._numPoses;\n\n\t\t( stage.context).setProgramConstantsFromArray(ContextGLProgramType.VERTEX, vertexConstantOffset, this._weights, 1);\n\n\t\tif (this._blendMode == VertexAnimationMode.ABSOLUTE)\n\t\t\ti = 1;\n\t\telse\n\t\t\ti = 0;\n\n\t\tfor (; i < len; ++i) {\n\t\t\tsubGeom = this._poses[i].subGeometries[subMesh._iIndex] || subMesh.subGeometry;\n\n\t\t\t( stage.context).activateBuffer(vertexStreamOffset++, VertexDataPool.getItem(subGeom, renderable.getIndexData(), TriangleSubGeometry.POSITION_DATA), subGeom.getOffset(TriangleSubGeometry.POSITION_DATA), TriangleSubGeometry.POSITION_FORMAT);\n\n\t\t\tif (shaderObject.normalDependencies > 0)\n\t\t\t\t( stage.context).activateBuffer(vertexStreamOffset++, VertexDataPool.getItem(subGeom, renderable.getIndexData(), TriangleSubGeometry.NORMAL_DATA), subGeom.getOffset(TriangleSubGeometry.NORMAL_DATA), TriangleSubGeometry.NORMAL_FORMAT);\n\t\t}\n\t}\n\n\tprivate setNullPose(shaderObject:ShaderObjectBase, renderable:RenderableBase, stage:Stage, vertexConstantOffset:number /*int*/, vertexStreamOffset:number /*int*/)\n\t{\n\t\t( stage.context).setProgramConstantsFromArray(ContextGLProgramType.VERTEX, vertexConstantOffset, this._weights, 1);\n\n\t\tif (this._blendMode == VertexAnimationMode.ABSOLUTE) {\n\t\t\tvar len:number /*uint*/ = this._numPoses;\n\t\t\tfor (var i:number /*uint*/ = 1; i < len; ++i) {\n\t\t\t\t( stage.context).activateBuffer(vertexStreamOffset++, renderable.getVertexData(TriangleSubGeometry.POSITION_DATA), renderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA), TriangleSubGeometry.POSITION_FORMAT);\n\n\t\t\t\tif (shaderObject.normalDependencies > 0)\n\t\t\t\t\t( stage.context).activateBuffer(vertexStreamOffset++, renderable.getVertexData(TriangleSubGeometry.NORMAL_DATA), renderable.getVertexOffset(TriangleSubGeometry.NORMAL_DATA), TriangleSubGeometry.NORMAL_FORMAT);\n\t\t\t}\n\t\t}\n\t\t// todo: set temp data for additive?\n\t}\n\n\t/**\n\t * Verifies if the animation will be used on cpu. Needs to be true for all passes for a material to be able to use it on gpu.\n\t * Needs to be called if gpu code is potentially required.\n\t */\n\tpublic testGPUCompatibility(shaderObject:ShaderObjectBase)\n\t{\n\t}\n\n\tpublic getRenderableSubGeometry(renderable:TriangleSubMeshRenderable, sourceSubGeometry:TriangleSubGeometry):TriangleSubGeometry\n\t{\n\t\tif (this._blendMode == VertexAnimationMode.ABSOLUTE && this._poses.length)\n\t\t\treturn this._poses[0].subGeometries[renderable.subMesh._iIndex] || sourceSubGeometry;\n\n\t\t//nothing to do here\n\t\treturn sourceSubGeometry;\n\t}\n}\n\nexport = VertexAnimator;", + "import Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport IContextStageGL\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/IContextStageGL\");\nimport IVertexBuffer\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/IVertexBuffer\");\n\nimport ParticleAnimationData\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleAnimationData\");\n\n/**\n * ...\n */\nclass AnimationSubGeometry\n{\n\tpublic static SUBGEOM_ID_COUNT:number = 0;\n\n\tpublic _pVertexData:Array;\n\n\tpublic _pVertexBuffer:Array = new Array(8);\n\tpublic _pBufferContext:Array = new Array(8);\n\tpublic _pBufferDirty:Array = new Array(8);\n\n\tprivate _numVertices:number /*uint*/;\n\n\tprivate _totalLenOfOneVertex:number /*uint*/;\n\n\tpublic numProcessedVertices:number /*int*/ = 0;\n\n\tpublic previousTime:number = Number.NEGATIVE_INFINITY;\n\n\tpublic animationParticles:Array = new Array();\n\n\t/**\n\t * An id for this animation subgeometry, used to identify animation subgeometries when using animation sets.\n\t *\n\t * @private\n\t */\n\tpublic _iUniqueId:number;//Arcane\n\n\tconstructor()\n\t{\n\t\tfor (var i:number /*int*/ = 0; i < 8; i++)\n\t\t\tthis._pBufferDirty[i] = true;\n\n\t\tthis._iUniqueId = AnimationSubGeometry.SUBGEOM_ID_COUNT++;\n\t}\n\n\tpublic createVertexData(numVertices:number /*uint*/, totalLenOfOneVertex:number /*uint*/)\n\t{\n\t\tthis._numVertices = numVertices;\n\t\tthis._totalLenOfOneVertex = totalLenOfOneVertex;\n\t\tthis._pVertexData = new Array(numVertices*totalLenOfOneVertex);\n\t}\n\n\tpublic activateVertexBuffer(index:number /*int*/, bufferOffset:number /*int*/, stage:Stage, format:string)\n\t{\n\t\tvar contextIndex:number /*int*/ = stage.stageIndex;\n\t\tvar context:IContextStageGL = stage.context;\n\n\t\tvar buffer:IVertexBuffer = this._pVertexBuffer[contextIndex];\n\t\tif (!buffer || this._pBufferContext[contextIndex] != context) {\n\t\t\tbuffer = this._pVertexBuffer[contextIndex] = context.createVertexBuffer(this._numVertices, this._totalLenOfOneVertex);\n\t\t\tthis._pBufferContext[contextIndex] = context;\n\t\t\tthis._pBufferDirty[contextIndex] = true;\n\t\t}\n\t\tif (this._pBufferDirty[contextIndex]) {\n\t\t\tbuffer.uploadFromArray(this._pVertexData, 0, this._numVertices);\n\t\t\tthis._pBufferDirty[contextIndex] = false;\n\t\t}\n\t\tcontext.setVertexBufferAt(index, buffer, bufferOffset, format);\n\t}\n\n\tpublic dispose()\n\t{\n\t\twhile (this._pVertexBuffer.length) {\n\t\t\tvar vertexBuffer:IVertexBuffer = this._pVertexBuffer.pop()\n\n\t\t\tif (vertexBuffer)\n\t\t\t\tvertexBuffer.dispose();\n\t\t}\n\t}\n\n\tpublic invalidateBuffer()\n\t{\n\t\tfor (var i:number /*int*/ = 0; i < 8; i++)\n\t\t\tthis._pBufferDirty[i] = true;\n\t}\n\n\tpublic get vertexData():Array\n\t{\n\t\treturn this._pVertexData;\n\t}\n\n\tpublic get numVertices():number /*uint*/\n\t{\n\t\treturn this._numVertices;\n\t}\n\n\tpublic get totalLenOfOneVertex():number /*uint*/\n\t{\n\t\treturn this._totalLenOfOneVertex;\n\t}\n}\n\nexport = AnimationSubGeometry;", + "import ColorTransform\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/ColorTransform\");\n\nclass ColorSegmentPoint\n{\n\tprivate _color:ColorTransform;\n\tprivate _life:number;\n\n\tconstructor(life:number, color:ColorTransform)\n\t{\n\t\t//0= 1)\n\t\t\tthrow(new Error(\"life exceeds range (0,1)\"));\n\t\tthis._life = life;\n\t\tthis._color = color;\n\t}\n\n\tpublic get color():ColorTransform\n\t{\n\t\treturn this._color;\n\t}\n\n\tpublic get life():number\n\t{\n\t\treturn this._life;\n\t}\n\n}\n\nexport = ColorSegmentPoint;", + "import Matrix3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Matrix3D\");\nimport Quaternion\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Quaternion\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\n/**\n * Contains transformation data for a skeleton joint, used for skeleton animation.\n *\n * @see away.animation.Skeleton\n * @see away.animation.SkeletonJoint\n *\n * todo: support (uniform) scale\n */\nclass JointPose\n{\n\t/**\n\t * The name of the joint to which the pose is associated\n\t */\n\tpublic name:string; // intention is that this should be used only at load time, not in the main loop\n\n\t/**\n\t * The rotation of the pose stored as a quaternion\n\t */\n\tpublic orientation:Quaternion = new Quaternion();\n\n\t/**\n\t * The translation of the pose\n\t */\n\tpublic translation:Vector3D = new Vector3D();\n\n\tconstructor()\n\t{\n\n\t}\n\n\t/**\n\t * Converts the transformation to a Matrix3D representation.\n\t *\n\t * @param target An optional target matrix to store the transformation. If not provided, it will create a new instance.\n\t * @return The transformation matrix of the pose.\n\t */\n\tpublic toMatrix3D(target:Matrix3D = null):Matrix3D\n\t{\n\t\tif (target == null)\n\t\t\ttarget = new Matrix3D();\n\n\t\tthis.orientation.toMatrix3D(target);\n\t\ttarget.appendTranslation(this.translation.x, this.translation.y, this.translation.z);\n\t\treturn target;\n\t}\n\n\t/**\n\t * Copies the transformation data from a source pose object into the existing pose object.\n\t *\n\t * @param pose The source pose to copy from.\n\t */\n\tpublic copyFrom(pose:JointPose)\n\t{\n\t\tvar or:Quaternion = pose.orientation;\n\t\tvar tr:Vector3D = pose.translation;\n\t\tthis.orientation.x = or.x;\n\t\tthis.orientation.y = or.y;\n\t\tthis.orientation.z = or.z;\n\t\tthis.orientation.w = or.w;\n\t\tthis.translation.x = tr.x;\n\t\tthis.translation.y = tr.y;\n\t\tthis.translation.z = tr.z;\n\t}\n}\n\nexport = JointPose;", + "import ParticleData\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleData\");\n\n/**\n * ...\n */\nclass ParticleAnimationData\n{\n\tpublic index:number /*uint*/;\n\tpublic startTime:number;\n\tpublic totalTime:number;\n\tpublic duration:number;\n\tpublic delay:number;\n\tpublic startVertexIndex:number /*uint*/;\n\tpublic numVertices:number /*uint*/;\n\n\tconstructor(index:number /*uint*/, startTime:number, duration:number, delay:number, particle:ParticleData)\n\t{\n\t\tthis.index = index;\n\t\tthis.startTime = startTime;\n\t\tthis.totalTime = duration + delay;\n\t\tthis.duration = duration;\n\t\tthis.delay = delay;\n\t\tthis.startVertexIndex = particle.startVertexIndex;\n\t\tthis.numVertices = particle.numVertices;\n\t}\n}\n\nexport = ParticleAnimationData;", + "import TriangleSubGeometry\t\t\t\t= require(\"awayjs-core/lib/core/base/TriangleSubGeometry\");\n\nclass ParticleData\n{\n\tpublic particleIndex:number /*uint*/;\n\tpublic numVertices:number /*uint*/;\n\tpublic startVertexIndex:number /*uint*/;\n\tpublic subGeometry:TriangleSubGeometry;\n}\n\nexport = ParticleData", + "/**\n * Options for setting the properties mode of a particle animation node.\n */\nclass ParticlePropertiesMode\n{\n\t/**\n\t * Mode that defines the particle node as acting on global properties (ie. the properties set in the node constructor or the corresponding animation state).\n\t */\n\tpublic static GLOBAL:number /*uint*/ = 0;\n\n\t/**\n\t * Mode that defines the particle node as acting on local static properties (ie. the properties of particles set in the initialising on the animation set).\n\t */\n\tpublic static LOCAL_STATIC:number /*uint*/ = 1;\n\n\t/**\n\t * Mode that defines the particle node as acting on local dynamic properties (ie. the properties of the particles set in the corresponding animation state).\n\t */\n\tpublic static LOCAL_DYNAMIC:number /*uint*/ = 2;\n}\n\nexport = ParticlePropertiesMode;", + "/**\n * Dynamic class for holding the local properties of a particle, used for processing the static properties\n * of particles in the particle animation set before beginning upload to the GPU.\n */\nclass ParticleProperties\n{\n\t/**\n\t * The index of the current particle being set.\n\t */\n\tpublic index:number /*uint*/;\n\n\t/**\n\t * The total number of particles being processed by the particle animation set.\n\t */\n\tpublic total:number /*uint*/;\n\n\t/**\n\t * The start time of the particle.\n\t */\n\tpublic startTime:number;\n\n\t/**\n\t * The duration of the particle, an optional value used when the particle aniamtion set settings for useDuration are enabled in the constructor.\n\t *\n\t * @see away.animators.ParticleAnimationSet\n\t */\n\tpublic duration:number;\n\n\t/**\n\t * The delay between cycles of the particle, an optional value used when the particle aniamtion set settings for useLooping and useDelay are enabled in the constructor.\n\t *\n\t * @see away.animators.ParticleAnimationSet\n\t */\n\tpublic delay:number;\n}\n\nexport = ParticleProperties;", + "/**\n * A value obect representing a single joint in a skeleton object.\n *\n * @see away.animators.Skeleton\n */\nclass SkeletonJoint\n{\n\t/**\n\t * The index of the parent joint in the skeleton's joints vector.\n\t *\n\t * @see away.animators.Skeleton#joints\n\t */\n\tpublic parentIndex:number /*int*/ = -1;\n\n\t/**\n\t * The name of the joint\n\t */\n\tpublic name:string; // intention is that this should be used only at load time, not in the main loop\n\n\t/**\n\t * The inverse bind pose matrix, as raw data, used to transform vertices to bind joint space in preparation for transformation using the joint matrix.\n\t */\n\tpublic inverseBindPose:Array;\n\n\t/**\n\t * Creates a new SkeletonJoint object\n\t */\n\tconstructor()\n\t{\n\t}\n}\n\nexport = SkeletonJoint;", + "import JointPose\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/JointPose\");\n\nimport AssetType\t\t\t\t\t\t= require(\"awayjs-core/lib/core/library/AssetType\");\nimport IAsset\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/library/IAsset\");\nimport NamedAssetBase\t\t\t\t\t= require(\"awayjs-core/lib/core/library/NamedAssetBase\");\n\n/**\n * A collection of pose objects, determining the pose for an entire skeleton.\n * The jointPoses vector object corresponds to a skeleton's joints vector object, however, there is no\n * reference to a skeleton's instance, since several skeletons can be influenced by the same pose (eg: animation\n * clips are added to any animator with a valid skeleton)\n *\n * @see away.animators.Skeleton\n * @see away.animators.JointPose\n */\nclass SkeletonPose extends NamedAssetBase implements IAsset\n{\n\t/**\n\t * A flat list of pose objects that comprise the skeleton pose. The pose indices correspond to the target skeleton's joint indices.\n\t *\n\t * @see away.animators.Skeleton#joints\n\t */\n\tpublic jointPoses:Array;\n\n\t/**\n\t * The total number of joint poses in the skeleton pose.\n\t */\n\tpublic get numJointPoses():number /*uint*/\n\t{\n\t\treturn this.jointPoses.length;\n\t}\n\n\t/**\n\t * Creates a new SkeletonPose object.\n\t */\n\tconstructor()\n\t{\n\t\tsuper();\n\n\t\tthis.jointPoses = new Array();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic get assetType():string\n\t{\n\t\treturn AssetType.SKELETON_POSE;\n\t}\n\n\t/**\n\t * Returns the joint pose object with the given joint name, otherwise returns a null object.\n\t *\n\t * @param jointName The name of the joint object whose pose is to be found.\n\t * @return The pose object with the given joint name.\n\t */\n\tpublic jointPoseFromName(jointName:string):JointPose\n\t{\n\t\tvar jointPoseIndex:number /*int*/ = this.jointPoseIndexFromName(jointName);\n\t\tif (jointPoseIndex != -1)\n\t\t\treturn this.jointPoses[jointPoseIndex]; else\n\t\t\treturn null;\n\t}\n\n\t/**\n\t * Returns the pose index, given the joint name. -1 is returned if the joint name is not found in the pose.\n\t *\n\t * @param The name of the joint object whose pose is to be found.\n\t * @return The index of the pose object in the jointPoses Array\n\t *\n\t * @see #jointPoses\n\t */\n\tpublic jointPoseIndexFromName(jointName:string):number /*int*/\n\t{\n\t\t// this is implemented as a linear search, rather than a possibly\n\t\t// more optimal method (Dictionary lookup, for example) because:\n\t\t// a) it is assumed that it will be called once for each joint\n\t\t// b) it is assumed that it will be called only during load, and not during main loop\n\t\t// c) maintaining a dictionary (for safety) would dictate an interface to access JointPoses,\n\t\t// rather than direct array access. this would be sub-optimal.\n\t\tvar jointPoseIndex:number /*int*/;\n\t\tvar jointPose:JointPose;\n\t\tfor (var i:number /*uint*/; i < this.jointPoses.length; i++) {\n\t\t\tjointPose = this.jointPoses[i];\n\t\t\tif (jointPose.name == jointName)\n\t\t\t\treturn jointPoseIndex;\n\t\t\tjointPoseIndex++;\n\t\t}\n\n\t\treturn -1;\n\t}\n\n\t/**\n\t * Creates a copy of the SkeletonPose object, with a dulpicate of its component joint poses.\n\t *\n\t * @return SkeletonPose\n\t */\n\tpublic clone():SkeletonPose\n\t{\n\t\tvar clone:SkeletonPose = new SkeletonPose();\n\t\tvar numJointPoses:number /*uint*/ = this.jointPoses.length;\n\t\tfor (var i:number /*uint*/ = 0; i < numJointPoses; i++) {\n\t\t\tvar cloneJointPose:JointPose = new JointPose();\n\t\t\tvar thisJointPose:JointPose = this.jointPoses[i];\n\t\t\tcloneJointPose.name = thisJointPose.name;\n\t\t\tcloneJointPose.copyFrom(thisJointPose);\n\t\t\tclone.jointPoses[i] = cloneJointPose;\n\t\t}\n\t\treturn clone;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic dispose()\n\t{\n\t\tthis.jointPoses.length = 0;\n\t}\n}\n\nexport = SkeletonPose;", + "import SkeletonJoint\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/SkeletonJoint\");\n\nimport AssetType\t\t\t\t\t\t= require(\"awayjs-core/lib/core/library/AssetType\");\nimport IAsset\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/library/IAsset\");\nimport NamedAssetBase\t\t\t\t\t= require(\"awayjs-core/lib/core/library/NamedAssetBase\");\n\n/**\n * A Skeleton object is a hierarchical grouping of joint objects that can be used for skeletal animation.\n *\n * @see away.animators.SkeletonJoint\n */\nclass Skeleton extends NamedAssetBase implements IAsset\n{\n\t/**\n\t * A flat list of joint objects that comprise the skeleton. Every joint except for the root has a parentIndex\n\t * property that is an index into this list.\n\t * A child joint should always have a higher index than its parent.\n\t */\n\tpublic joints:Array;\n\n\t/**\n\t * The total number of joints in the skeleton.\n\t */\n\tpublic get numJoints():number /*uint*/\n\t{\n\t\treturn this.joints.length;\n\t}\n\n\t/**\n\t * Creates a new Skeleton object\n\t */\n\tconstructor()\n\t{\n\t\tsuper();\n\n\t\t// in the long run, it might be a better idea to not store Joint objects, but keep all data in Vectors, that we can upload easily?\n\t\tthis.joints = new Array();\n\t}\n\n\t/**\n\t * Returns the joint object in the skeleton with the given name, otherwise returns a null object.\n\t *\n\t * @param jointName The name of the joint object to be found.\n\t * @return The joint object with the given name.\n\t *\n\t * @see #joints\n\t */\n\tpublic jointFromName(jointName:string):SkeletonJoint\n\t{\n\t\tvar jointIndex:number /*int*/ = this.jointIndexFromName(jointName);\n\t\tif (jointIndex != -1)\n\t\t\treturn this.joints[jointIndex]; else\n\t\t\treturn null;\n\t}\n\n\t/**\n\t * Returns the joint index, given the joint name. -1 is returned if the joint name is not found.\n\t *\n\t * @param jointName The name of the joint object to be found.\n\t * @return The index of the joint object in the joints Array\n\t *\n\t * @see #joints\n\t */\n\tpublic jointIndexFromName(jointName:string):number /*int*/\n\t{\n\t\t// this is implemented as a linear search, rather than a possibly\n\t\t// more optimal method (Dictionary lookup, for example) because:\n\t\t// a) it is assumed that it will be called once for each joint\n\t\t// b) it is assumed that it will be called only during load, and not during main loop\n\t\t// c) maintaining a dictionary (for safety) would dictate an interface to access SkeletonJoints,\n\t\t// rather than direct array access. this would be sub-optimal.\n\t\tvar jointIndex:number /*int*/;\n\t\tvar joint:SkeletonJoint;\n\t\tfor (var i:number /*int*/; i < this.joints.length; i++) {\n\t\t\tjoint = this.joints[i];\n\t\t\tif (joint.name == jointName)\n\t\t\t\treturn jointIndex;\n\t\t\tjointIndex++;\n\t\t}\n\n\t\treturn -1;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic dispose()\n\t{\n\t\tthis.joints.length = 0;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic get assetType():string\n\t{\n\t\treturn AssetType.SKELETON;\n\t}\n}\n\nexport = Skeleton;", + "/**\n * Options for setting the animation mode of a vertex animator object.\n *\n * @see away.animators.VertexAnimator\n */\nclass VertexAnimationMode\n{\n\t/**\n\t * Animation mode that adds all outputs from active vertex animation state to form the current vertex animation pose.\n\t */\n\tpublic static ADDITIVE:string = \"additive\";\n\n\t/**\n\t * Animation mode that picks the output from a single vertex animation state to form the current vertex animation pose.\n\t */\n\tpublic static ABSOLUTE:string = \"absolute\";\n}\n\nexport = VertexAnimationMode;", + "import AnimationNodeBase\t\t\t\t= require(\"awayjs-core/lib/animators/nodes/AnimationNodeBase\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\n/**\n * Provides an abstract base class for nodes with time-based animation data in an animation blend tree.\n */\nclass AnimationClipNodeBase extends AnimationNodeBase\n{\n\tpublic _pLooping:boolean = true;\n\tpublic _pTotalDuration:number /*uint*/ = 0;\n\tpublic _pLastFrame:number /*uint*/;\n\n\tpublic _pStitchDirty:boolean = true;\n\tpublic _pStitchFinalFrame:boolean = false;\n\tpublic _pNumFrames:number /*uint*/ = 0;\n\n\tpublic _pDurations:Array = new Array();\n\t/*uint*/\n\tpublic _pTotalDelta:Vector3D = new Vector3D();\n\n\tpublic fixedFrameRate:boolean = true;\n\n\t/**\n\t * Determines whether the contents of the animation node have looping characteristics enabled.\n\t */\n\tpublic get looping():boolean\n\t{\n\t\treturn this._pLooping;\n\t}\n\n\tpublic set looping(value:boolean)\n\t{\n\t\tif (this._pLooping == value)\n\t\t\treturn;\n\n\t\tthis._pLooping = value;\n\n\t\tthis._pStitchDirty = true;\n\t}\n\n\t/**\n\t * Defines if looping content blends the final frame of animation data with the first (true) or works on the\n\t * assumption that both first and last frames are identical (false). Defaults to false.\n\t */\n\tpublic get stitchFinalFrame():boolean\n\t{\n\t\treturn this._pStitchFinalFrame;\n\t}\n\n\tpublic set stitchFinalFrame(value:boolean)\n\t{\n\t\tif (this._pStitchFinalFrame == value)\n\t\t\treturn;\n\n\t\tthis._pStitchFinalFrame = value;\n\n\t\tthis._pStitchDirty = true;\n\t}\n\n\tpublic get totalDuration():number /*uint*/\n\t{\n\t\tif (this._pStitchDirty)\n\t\t\tthis._pUpdateStitch();\n\n\t\treturn this._pTotalDuration;\n\t}\n\n\tpublic get totalDelta():Vector3D\n\t{\n\t\tif (this._pStitchDirty)\n\t\t\tthis._pUpdateStitch();\n\n\t\treturn this._pTotalDelta;\n\t}\n\n\tpublic get lastFrame():number /*uint*/\n\t{\n\t\tif (this._pStitchDirty)\n\t\t\tthis._pUpdateStitch();\n\n\t\treturn this._pLastFrame;\n\t}\n\n\t/**\n\t * Returns a vector of time values representing the duration (in milliseconds) of each animation frame in the clip.\n\t */\n\tpublic get durations():Array /*uint*/\n\t{\n\t\treturn this._pDurations;\n\t}\n\n\t/**\n\t * Creates a new AnimationClipNodeBase object.\n\t */\n\tconstructor()\n\t{\n\t\tsuper();\n\t}\n\n\t/**\n\t * Updates the node's final frame stitch state.\n\t *\n\t * @see #stitchFinalFrame\n\t */\n\tpublic _pUpdateStitch()\n\t{\n\t\tthis._pStitchDirty = false;\n\n\t\tthis._pLastFrame = (this._pStitchFinalFrame)? this._pNumFrames : this._pNumFrames - 1;\n\n\t\tthis._pTotalDuration = 0;\n\t\tthis._pTotalDelta.x = 0;\n\t\tthis._pTotalDelta.y = 0;\n\t\tthis._pTotalDelta.z = 0;\n\t}\n}\n\nexport = AnimationClipNodeBase;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\n\nimport ParticleProperties\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleProperties\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleNodeBase\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase\");\nimport ParticleAccelerationState\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleAccelerationState\");\n\n/**\n * A particle animation node used to apply a constant acceleration vector to the motion of a particle.\n */\nclass ParticleAccelerationNode extends ParticleNodeBase\n{\n\t/** @private */\n\tpublic _acceleration:Vector3D;\n\n\t/**\n\t * Reference for acceleration node properties on a single particle (when in local property mode).\n\t * Expects a Vector3D object representing the direction of acceleration on the particle.\n\t */\n\tpublic static ACCELERATION_VECTOR3D:string = \"AccelerationVector3D\";\n\n\t/**\n\t * Creates a new ParticleAccelerationNode\n\t *\n\t * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node.\n\t * @param [optional] acceleration Defines the default acceleration vector of the node, used when in global mode.\n\t */\n\tconstructor(mode:number /*uint*/, acceleration:Vector3D = null)\n\t{\n\t\tsuper(\"ParticleAcceleration\", mode, 3);\n\n\t\tthis._pStateClass = ParticleAccelerationState;\n\n\t\tthis._acceleration = acceleration || new Vector3D();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic pGetAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string\n\t{\n\t\tvar accelerationValue:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute();\n\t\tanimationRegisterCache.setRegisterIndex(this, ParticleAccelerationState.ACCELERATION_INDEX, accelerationValue.index);\n\n\t\tvar temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\tanimationRegisterCache.addVertexTempUsages(temp, 1);\n\n\t\tvar code:string = \"mul \" + temp + \",\" + animationRegisterCache.vertexTime + \",\" + accelerationValue + \"\\n\";\n\n\t\tif (animationRegisterCache.needVelocity) {\n\t\t\tvar temp2:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\t\tcode += \"mul \" + temp2 + \",\" + temp + \",\" + animationRegisterCache.vertexTwoConst + \"\\n\";\n\t\t\tcode += \"add \" + animationRegisterCache.velocityTarget + \".xyz,\" + temp2 + \".xyz,\" + animationRegisterCache.velocityTarget + \".xyz\\n\";\n\t\t}\n\t\tanimationRegisterCache.removeVertexTempUsage(temp);\n\n\t\tcode += \"mul \" + temp + \",\" + temp + \",\" + animationRegisterCache.vertexTime + \"\\n\";\n\t\tcode += \"add \" + animationRegisterCache.positionTarget + \".xyz,\" + temp + \",\" + animationRegisterCache.positionTarget + \".xyz\\n\";\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAnimationState(animator:AnimatorBase):ParticleAccelerationState\n\t{\n\t\treturn animator.getAnimationState(this);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iGeneratePropertyOfOneParticle(param:ParticleProperties)\n\t{\n\t\tvar tempAcceleration:Vector3D = param[ParticleAccelerationNode.ACCELERATION_VECTOR3D];\n\t\tif (!tempAcceleration)\n\t\t\tthrow new Error(\"there is no \" + ParticleAccelerationNode.ACCELERATION_VECTOR3D + \" in param!\");\n\n\t\tthis._pOneData[0] = tempAcceleration.x/2;\n\t\tthis._pOneData[1] = tempAcceleration.y/2;\n\t\tthis._pOneData[2] = tempAcceleration.z/2;\n\t}\n}\n\nexport = ParticleAccelerationNode;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\n\nimport ParticleProperties\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleProperties\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleNodeBase\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase\");\nimport ParticleBezierCurveState\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleBezierCurveState\");\n\n/**\n * A particle animation node used to control the position of a particle over time along a bezier curve.\n */\nclass ParticleBezierCurveNode extends ParticleNodeBase\n{\n\t/** @private */\n\tpublic _iControlPoint:Vector3D;\n\t/** @private */\n\tpublic _iEndPoint:Vector3D;\n\n\t/**\n\t * Reference for bezier curve node properties on a single particle (when in local property mode).\n\t * Expects a Vector3D object representing the control point position (0, 1, 2) of the curve.\n\t */\n\tpublic static BEZIER_CONTROL_VECTOR3D:string = \"BezierControlVector3D\";\n\n\t/**\n\t * Reference for bezier curve node properties on a single particle (when in local property mode).\n\t * Expects a Vector3D object representing the end point position (0, 1, 2) of the curve.\n\t */\n\tpublic static BEZIER_END_VECTOR3D:string = \"BezierEndVector3D\";\n\n\t/**\n\t * Creates a new ParticleBezierCurveNode\n\t *\n\t * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node.\n\t * @param [optional] controlPoint Defines the default control point of the node, used when in global mode.\n\t * @param [optional] endPoint Defines the default end point of the node, used when in global mode.\n\t */\n\tconstructor(mode:number /*uint*/, controlPoint:Vector3D = null, endPoint:Vector3D = null)\n\t{\n\t\tsuper(\"ParticleBezierCurve\", mode, 6);\n\n\t\tthis._pStateClass = ParticleBezierCurveState;\n\n\t\tthis._iControlPoint = controlPoint || new Vector3D();\n\t\tthis._iEndPoint = endPoint || new Vector3D();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string\n\t{\n\t\tvar controlValue:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute();\n\t\tanimationRegisterCache.setRegisterIndex(this, ParticleBezierCurveState.BEZIER_CONTROL_INDEX, controlValue.index);\n\n\t\tvar endValue:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute();\n\t\tanimationRegisterCache.setRegisterIndex(this, ParticleBezierCurveState.BEZIER_END_INDEX, endValue.index);\n\n\t\tvar temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\tvar rev_time:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 0);\n\t\tvar time_2:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 1);\n\t\tvar time_temp:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 2);\n\t\tanimationRegisterCache.addVertexTempUsages(temp, 1);\n\t\tvar temp2:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\tvar distance:ShaderRegisterElement = new ShaderRegisterElement(temp2.regName, temp2.index);\n\t\tanimationRegisterCache.removeVertexTempUsage(temp);\n\n\t\tvar code:string = \"\";\n\t\tcode += \"sub \" + rev_time + \",\" + animationRegisterCache.vertexOneConst + \",\" + animationRegisterCache.vertexLife + \"\\n\";\n\t\tcode += \"mul \" + time_2 + \",\" + animationRegisterCache.vertexLife + \",\" + animationRegisterCache.vertexLife + \"\\n\";\n\n\t\tcode += \"mul \" + time_temp + \",\" + animationRegisterCache.vertexLife + \",\" + rev_time + \"\\n\";\n\t\tcode += \"mul \" + time_temp + \",\" + time_temp + \",\" + animationRegisterCache.vertexTwoConst + \"\\n\";\n\t\tcode += \"mul \" + distance + \".xyz,\" + time_temp + \",\" + controlValue + \"\\n\";\n\t\tcode += \"add \" + animationRegisterCache.positionTarget + \".xyz,\" + distance + \".xyz,\" + animationRegisterCache.positionTarget + \".xyz\\n\";\n\t\tcode += \"mul \" + distance + \".xyz,\" + time_2 + \",\" + endValue + \"\\n\";\n\t\tcode += \"add \" + animationRegisterCache.positionTarget + \".xyz,\" + distance + \".xyz,\" + animationRegisterCache.positionTarget + \".xyz\\n\";\n\n\t\tif (animationRegisterCache.needVelocity) {\n\t\t\tcode += \"mul \" + time_2 + \",\" + animationRegisterCache.vertexLife + \",\" + animationRegisterCache.vertexTwoConst + \"\\n\";\n\t\t\tcode += \"sub \" + time_temp + \",\" + animationRegisterCache.vertexOneConst + \",\" + time_2 + \"\\n\";\n\t\t\tcode += \"mul \" + time_temp + \",\" + animationRegisterCache.vertexTwoConst + \",\" + time_temp + \"\\n\";\n\t\t\tcode += \"mul \" + distance + \".xyz,\" + controlValue + \",\" + time_temp + \"\\n\";\n\t\t\tcode += \"add \" + animationRegisterCache.velocityTarget + \".xyz,\" + distance + \".xyz,\" + animationRegisterCache.velocityTarget + \".xyz\\n\";\n\t\t\tcode += \"mul \" + distance + \".xyz,\" + endValue + \",\" + time_2 + \"\\n\";\n\t\t\tcode += \"add \" + animationRegisterCache.velocityTarget + \".xyz,\" + distance + \".xyz,\" + animationRegisterCache.velocityTarget + \".xyz\\n\";\n\t\t}\n\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAnimationState(animator:AnimatorBase):ParticleBezierCurveState\n\t{\n\t\treturn animator.getAnimationState(this);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iGeneratePropertyOfOneParticle(param:ParticleProperties)\n\t{\n\t\tvar bezierControl:Vector3D = param[ParticleBezierCurveNode.BEZIER_CONTROL_VECTOR3D];\n\t\tif (!bezierControl)\n\t\t\tthrow new Error(\"there is no \" + ParticleBezierCurveNode.BEZIER_CONTROL_VECTOR3D + \" in param!\");\n\n\t\tvar bezierEnd:Vector3D = param[ParticleBezierCurveNode.BEZIER_END_VECTOR3D];\n\t\tif (!bezierEnd)\n\t\t\tthrow new Error(\"there is no \" + ParticleBezierCurveNode.BEZIER_END_VECTOR3D + \" in param!\");\n\n\t\tthis._pOneData[0] = bezierControl.x;\n\t\tthis._pOneData[1] = bezierControl.y;\n\t\tthis._pOneData[2] = bezierControl.z;\n\t\tthis._pOneData[3] = bezierEnd.x;\n\t\tthis._pOneData[4] = bezierEnd.y;\n\t\tthis._pOneData[5] = bezierEnd.z;\n\t}\n}\n\nexport = ParticleBezierCurveNode;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\n\nimport ParticleAnimationSet\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimationSet\");\nimport ParticleProperties\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleProperties\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleNodeBase\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase\");\nimport ParticleBillboardState\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleBillboardState\");\n\n/**\n * A particle animation node that controls the rotation of a particle to always face the camera.\n */\nclass ParticleBillboardNode extends ParticleNodeBase\n{\n\t/** @private */\n\tpublic _iBillboardAxis:Vector3D;\n\n\t/**\n\t * Creates a new ParticleBillboardNode\n\t */\n\tconstructor(billboardAxis:Vector3D = null)\n\t{\n\t\tsuper(\"ParticleBillboard\", ParticlePropertiesMode.GLOBAL, 0, 4);\n\n\t\tthis._pStateClass = ParticleBillboardState;\n\n\t\tthis._iBillboardAxis = billboardAxis;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string\n\t{\n\t\tvar rotationMatrixRegister:ShaderRegisterElement = animationRegisterCache.getFreeVertexConstant();\n\t\tanimationRegisterCache.setRegisterIndex(this, ParticleBillboardState.MATRIX_INDEX, rotationMatrixRegister.index);\n\t\tanimationRegisterCache.getFreeVertexConstant();\n\t\tanimationRegisterCache.getFreeVertexConstant();\n\t\tanimationRegisterCache.getFreeVertexConstant();\n\n\t\tvar temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\n\t\tvar code:string = \"m33 \" + temp + \".xyz,\" + animationRegisterCache.scaleAndRotateTarget + \",\" + rotationMatrixRegister + \"\\n\" +\n\t\t\t\t\t\t \"mov \" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + temp + \"\\n\";\n\n\t\tvar shaderRegisterElement:ShaderRegisterElement;\n\t\tfor (var i:number /*uint*/ = 0; i < animationRegisterCache.rotationRegisters.length; i++) {\n\t\t\tshaderRegisterElement = animationRegisterCache.rotationRegisters[i];\n\t\t\tcode += \"m33 \" + temp + \".xyz,\" + shaderRegisterElement + \",\" + rotationMatrixRegister + \"\\n\" +\n\t\t\t\t\t\"mov \" + shaderRegisterElement + \".xyz,\" + shaderRegisterElement + \"\\n\";\n\t\t}\n\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAnimationState(animator:AnimatorBase):ParticleBillboardState\n\t{\n\t\treturn animator.getAnimationState(this);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iProcessAnimationSetting(particleAnimationSet:ParticleAnimationSet)\n\t{\n\t\tparticleAnimationSet.hasBillboard = true;\n\t}\n}\n\nexport = ParticleBillboardNode;", + "import ColorTransform\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/ColorTransform\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\n\nimport ParticleAnimationSet\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimationSet\");\nimport ParticleProperties\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleProperties\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleNodeBase\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase\");\nimport ParticleColorState\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleColorState\");\n\n/**\n * A particle animation node used to control the color variation of a particle over time.\n */\nclass ParticleColorNode extends ParticleNodeBase\n{\n\t//default values used when creating states\n\t/** @private */\n\tpublic _iUsesMultiplier:boolean;\n\t/** @private */\n\tpublic _iUsesOffset:boolean;\n\t/** @private */\n\tpublic _iUsesCycle:boolean;\n\t/** @private */\n\tpublic _iUsesPhase:boolean;\n\t/** @private */\n\tpublic _iStartColor:ColorTransform;\n\t/** @private */\n\tpublic _iEndColor:ColorTransform;\n\t/** @private */\n\tpublic _iCycleDuration:number;\n\t/** @private */\n\tpublic _iCyclePhase:number;\n\n\t/**\n\t * Reference for color node properties on a single particle (when in local property mode).\n\t * Expects a ColorTransform object representing the start color transform applied to the particle.\n\t */\n\tpublic static COLOR_START_COLORTRANSFORM:string = \"ColorStartColorTransform\";\n\n\t/**\n\t * Reference for color node properties on a single particle (when in local property mode).\n\t * Expects a ColorTransform object representing the end color transform applied to the particle.\n\t */\n\tpublic static COLOR_END_COLORTRANSFORM:string = \"ColorEndColorTransform\";\n\n\t/**\n\t * Creates a new ParticleColorNode\n\t *\n\t * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node.\n\t * @param [optional] usesMultiplier Defines whether the node uses multiplier data in the shader for its color transformations. Defaults to true.\n\t * @param [optional] usesOffset Defines whether the node uses offset data in the shader for its color transformations. Defaults to true.\n\t * @param [optional] usesCycle Defines whether the node uses the cycleDuration property in the shader to calculate the period of the animation independent of particle duration. Defaults to false.\n\t * @param [optional] usesPhase Defines whether the node uses the cyclePhase property in the shader to calculate a starting offset to the cycle rotation of the particle. Defaults to false.\n\t * @param [optional] startColor Defines the default start color transform of the node, when in global mode.\n\t * @param [optional] endColor Defines the default end color transform of the node, when in global mode.\n\t * @param [optional] cycleDuration Defines the duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1.\n\t * @param [optional] cyclePhase Defines the phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0.\n\t */\n\tconstructor(mode:number /*uint*/, usesMultiplier:boolean = true, usesOffset:boolean = true, usesCycle:boolean = false, usesPhase:boolean = false, startColor:ColorTransform = null, endColor:ColorTransform = null, cycleDuration:number = 1, cyclePhase:number = 0)\n\t{\n\t\tsuper(\"ParticleColor\", mode, (usesMultiplier && usesOffset)? 16 : 8, ParticleAnimationSet.COLOR_PRIORITY);\n\n\t\tthis._pStateClass = ParticleColorState;\n\n\t\tthis._iUsesMultiplier = usesMultiplier;\n\t\tthis._iUsesOffset = usesOffset;\n\t\tthis._iUsesCycle = usesCycle;\n\t\tthis._iUsesPhase = usesPhase;\n\n\t\tthis._iStartColor = startColor || new ColorTransform();\n\t\tthis._iEndColor = endColor || new ColorTransform();\n\t\tthis._iCycleDuration = cycleDuration;\n\t\tthis._iCyclePhase = cyclePhase;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string\n\t{\n\t\tvar code:string = \"\";\n\t\tif (animationRegisterCache.needFragmentAnimation) {\n\t\t\tvar temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\n\t\t\tif (this._iUsesCycle) {\n\t\t\t\tvar cycleConst:ShaderRegisterElement = animationRegisterCache.getFreeVertexConstant();\n\t\t\t\tanimationRegisterCache.setRegisterIndex(this, ParticleColorState.CYCLE_INDEX, cycleConst.index);\n\n\t\t\t\tanimationRegisterCache.addVertexTempUsages(temp, 1);\n\t\t\t\tvar sin:ShaderRegisterElement = animationRegisterCache.getFreeVertexSingleTemp();\n\t\t\t\tanimationRegisterCache.removeVertexTempUsage(temp);\n\n\t\t\t\tcode += \"mul \" + sin + \",\" + animationRegisterCache.vertexTime + \",\" + cycleConst + \".x\\n\";\n\n\t\t\t\tif (this._iUsesPhase)\n\t\t\t\t\tcode += \"add \" + sin + \",\" + sin + \",\" + cycleConst + \".y\\n\";\n\n\t\t\t\tcode += \"sin \" + sin + \",\" + sin + \"\\n\";\n\t\t\t}\n\n\t\t\tif (this._iUsesMultiplier) {\n\t\t\t\tvar startMultiplierValue:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute();\n\t\t\t\tvar deltaMultiplierValue:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute();\n\n\t\t\t\tanimationRegisterCache.setRegisterIndex(this, ParticleColorState.START_MULTIPLIER_INDEX, startMultiplierValue.index);\n\t\t\t\tanimationRegisterCache.setRegisterIndex(this, ParticleColorState.DELTA_MULTIPLIER_INDEX, deltaMultiplierValue.index);\n\n\t\t\t\tcode += \"mul \" + temp + \",\" + deltaMultiplierValue + \",\" + (this._iUsesCycle? sin : animationRegisterCache.vertexLife) + \"\\n\";\n\t\t\t\tcode += \"add \" + temp + \",\" + temp + \",\" + startMultiplierValue + \"\\n\";\n\t\t\t\tcode += \"mul \" + animationRegisterCache.colorMulTarget + \",\" + temp + \",\" + animationRegisterCache.colorMulTarget + \"\\n\";\n\t\t\t}\n\n\t\t\tif (this._iUsesOffset) {\n\t\t\t\tvar startOffsetValue:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.LOCAL_STATIC)? animationRegisterCache.getFreeVertexAttribute() : animationRegisterCache.getFreeVertexConstant();\n\t\t\t\tvar deltaOffsetValue:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.LOCAL_STATIC)? animationRegisterCache.getFreeVertexAttribute() : animationRegisterCache.getFreeVertexConstant();\n\n\t\t\t\tanimationRegisterCache.setRegisterIndex(this, ParticleColorState.START_OFFSET_INDEX, startOffsetValue.index);\n\t\t\t\tanimationRegisterCache.setRegisterIndex(this, ParticleColorState.DELTA_OFFSET_INDEX, deltaOffsetValue.index);\n\n\t\t\t\tcode += \"mul \" + temp + \",\" + deltaOffsetValue + \",\" + (this._iUsesCycle? sin : animationRegisterCache.vertexLife) + \"\\n\";\n\t\t\t\tcode += \"add \" + temp + \",\" + temp + \",\" + startOffsetValue + \"\\n\";\n\t\t\t\tcode += \"add \" + animationRegisterCache.colorAddTarget + \",\" + temp + \",\" + animationRegisterCache.colorAddTarget + \"\\n\";\n\t\t\t}\n\t\t}\n\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAnimationState(animator:AnimatorBase):ParticleColorState\n\t{\n\t\treturn animator.getAnimationState(this);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iProcessAnimationSetting(particleAnimationSet:ParticleAnimationSet)\n\t{\n\t\tif (this._iUsesMultiplier)\n\t\t\tparticleAnimationSet.hasColorMulNode = true;\n\t\tif (this._iUsesOffset)\n\t\t\tparticleAnimationSet.hasColorAddNode = true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iGeneratePropertyOfOneParticle(param:ParticleProperties)\n\t{\n\t\tvar startColor:ColorTransform = param[ParticleColorNode.COLOR_START_COLORTRANSFORM];\n\t\tif (!startColor)\n\t\t\tthrow(new Error(\"there is no \" + ParticleColorNode.COLOR_START_COLORTRANSFORM + \" in param!\"));\n\n\t\tvar endColor:ColorTransform = param[ParticleColorNode.COLOR_END_COLORTRANSFORM];\n\t\tif (!endColor)\n\t\t\tthrow(new Error(\"there is no \" + ParticleColorNode.COLOR_END_COLORTRANSFORM + \" in param!\"));\n\n\t\tvar i:number /*uint*/ = 0;\n\n\t\tif (!this._iUsesCycle) {\n\t\t\t//multiplier\n\t\t\tif (this._iUsesMultiplier) {\n\t\t\t\tthis._pOneData[i++] = startColor.redMultiplier;\n\t\t\t\tthis._pOneData[i++] = startColor.greenMultiplier;\n\t\t\t\tthis._pOneData[i++] = startColor.blueMultiplier;\n\t\t\t\tthis._pOneData[i++] = startColor.alphaMultiplier;\n\t\t\t\tthis._pOneData[i++] = endColor.redMultiplier - startColor.redMultiplier;\n\t\t\t\tthis._pOneData[i++] = endColor.greenMultiplier - startColor.greenMultiplier;\n\t\t\t\tthis._pOneData[i++] = endColor.blueMultiplier - startColor.blueMultiplier;\n\t\t\t\tthis._pOneData[i++] = endColor.alphaMultiplier - startColor.alphaMultiplier;\n\t\t\t}\n\n\t\t\t//offset\n\t\t\tif (this._iUsesOffset) {\n\t\t\t\tthis._pOneData[i++] = startColor.redOffset/255;\n\t\t\t\tthis._pOneData[i++] = startColor.greenOffset/255;\n\t\t\t\tthis._pOneData[i++] = startColor.blueOffset/255;\n\t\t\t\tthis._pOneData[i++] = startColor.alphaOffset/255;\n\t\t\t\tthis._pOneData[i++] = (endColor.redOffset - startColor.redOffset)/255;\n\t\t\t\tthis._pOneData[i++] = (endColor.greenOffset - startColor.greenOffset)/255;\n\t\t\t\tthis._pOneData[i++] = (endColor.blueOffset - startColor.blueOffset)/255;\n\t\t\t\tthis._pOneData[i++] = (endColor.alphaOffset - startColor.alphaOffset)/255;\n\t\t\t}\n\t\t} else {\n\t\t\t//multiplier\n\t\t\tif (this._iUsesMultiplier) {\n\t\t\t\tthis._pOneData[i++] = (startColor.redMultiplier + endColor.redMultiplier)/2;\n\t\t\t\tthis._pOneData[i++] = (startColor.greenMultiplier + endColor.greenMultiplier)/2;\n\t\t\t\tthis._pOneData[i++] = (startColor.blueMultiplier + endColor.blueMultiplier)/2;\n\t\t\t\tthis._pOneData[i++] = (startColor.alphaMultiplier + endColor.alphaMultiplier)/2;\n\t\t\t\tthis._pOneData[i++] = (startColor.redMultiplier - endColor.redMultiplier)/2;\n\t\t\t\tthis._pOneData[i++] = (startColor.greenMultiplier - endColor.greenMultiplier)/2;\n\t\t\t\tthis._pOneData[i++] = (startColor.blueMultiplier - endColor.blueMultiplier)/2;\n\t\t\t\tthis._pOneData[i++] = (startColor.alphaMultiplier - endColor.alphaMultiplier)/2;\n\t\t\t}\n\n\t\t\t//offset\n\t\t\tif (this._iUsesOffset) {\n\t\t\t\tthis._pOneData[i++] = (startColor.redOffset + endColor.redOffset)/(255*2);\n\t\t\t\tthis._pOneData[i++] = (startColor.greenOffset + endColor.greenOffset)/(255*2);\n\t\t\t\tthis._pOneData[i++] = (startColor.blueOffset + endColor.blueOffset)/(255*2);\n\t\t\t\tthis._pOneData[i++] = (startColor.alphaOffset + endColor.alphaOffset)/(255*2);\n\t\t\t\tthis._pOneData[i++] = (startColor.redOffset - endColor.redOffset)/(255*2);\n\t\t\t\tthis._pOneData[i++] = (startColor.greenOffset - endColor.greenOffset)/(255*2);\n\t\t\t\tthis._pOneData[i++] = (startColor.blueOffset - endColor.blueOffset)/(255*2);\n\t\t\t\tthis._pOneData[i++] = (startColor.alphaOffset - endColor.alphaOffset)/(255*2);\n\t\t\t}\n\t\t}\n\n\t}\n}\n\nexport = ParticleColorNode;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\n\nimport ParticleAnimationSet\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimationSet\");\nimport ParticleProperties\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleProperties\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleNodeBase\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase\");\nimport ParticleFollowState\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleFollowState\");\n\n/**\n * A particle animation node used to create a follow behaviour on a particle system.\n */\nclass ParticleFollowNode extends ParticleNodeBase\n{\n\t/** @private */\n\tpublic _iUsesPosition:boolean;\n\n\t/** @private */\n\tpublic _iUsesRotation:boolean;\n\n\t/** @private */\n\tpublic _iSmooth:boolean;\n\n\t/**\n\t * Creates a new ParticleFollowNode\n\t *\n\t * @param [optional] usesPosition Defines wehether the individual particle reacts to the position of the target.\n\t * @param [optional] usesRotation Defines wehether the individual particle reacts to the rotation of the target.\n\t * @param [optional] smooth Defines wehether the state calculate the interpolated value.\n\t */\n\tconstructor(usesPosition:boolean = true, usesRotation:boolean = true, smooth:boolean = false)\n\t{\n\t\tsuper(\"ParticleFollow\", ParticlePropertiesMode.LOCAL_DYNAMIC, (usesPosition && usesRotation)? 6 : 3, ParticleAnimationSet.POST_PRIORITY);\n\n\t\tthis._pStateClass = ParticleFollowState;\n\n\t\tthis._iUsesPosition = usesPosition;\n\t\tthis._iUsesRotation = usesRotation;\n\t\tthis._iSmooth = smooth;\n\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string\n\t{\n\t\t//TODO: use Quaternion to implement this function\n\t\tvar code:string = \"\";\n\t\tif (this._iUsesRotation) {\n\t\t\tvar rotationAttribute:ShaderRegisterElement = animationRegisterCache.getFreeVertexAttribute();\n\t\t\tanimationRegisterCache.setRegisterIndex(this, ParticleFollowState.FOLLOW_ROTATION_INDEX, rotationAttribute.index);\n\n\t\t\tvar temp1:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\t\tanimationRegisterCache.addVertexTempUsages(temp1, 1);\n\t\t\tvar temp2:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\t\tanimationRegisterCache.addVertexTempUsages(temp2, 1);\n\t\t\tvar temp3:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\n\t\t\tvar temp4:ShaderRegisterElement;\n\t\t\tif (animationRegisterCache.hasBillboard) {\n\t\t\t\tanimationRegisterCache.addVertexTempUsages(temp3, 1);\n\t\t\t\ttemp4 = animationRegisterCache.getFreeVertexVectorTemp();\n\t\t\t}\n\n\t\t\tanimationRegisterCache.removeVertexTempUsage(temp1);\n\t\t\tanimationRegisterCache.removeVertexTempUsage(temp2);\n\t\t\tif (animationRegisterCache.hasBillboard)\n\t\t\t\tanimationRegisterCache.removeVertexTempUsage(temp3);\n\n\t\t\tvar len:number /*int*/ = animationRegisterCache.rotationRegisters.length;\n\t\t\tvar i:number /*int*/;\n\n\t\t\t//x axis\n\t\t\tcode += \"mov \" + temp1 + \",\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\tcode += \"mov \" + temp1 + \".x,\" + animationRegisterCache.vertexOneConst + \"\\n\";\n\t\t\tcode += \"mov \" + temp3 + \",\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\tcode += \"sin \" + temp3 + \".y,\" + rotationAttribute + \".x\\n\";\n\t\t\tcode += \"cos \" + temp3 + \".z,\" + rotationAttribute + \".x\\n\";\n\t\t\tcode += \"mov \" + temp2 + \".x,\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\tcode += \"mov \" + temp2 + \".y,\" + temp3 + \".z\\n\";\n\t\t\tcode += \"neg \" + temp2 + \".z,\" + temp3 + \".y\\n\";\n\n\t\t\tif (animationRegisterCache.hasBillboard)\n\t\t\t\tcode += \"m33 \" + temp4 + \".xyz,\" + animationRegisterCache.positionTarget + \".xyz,\" + temp1 + \"\\n\";\n\t\t\telse {\n\t\t\t\tcode += \"m33 \" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + temp1 + \"\\n\";\n\t\t\t\tfor (i = 0; i < len; i++)\n\t\t\t\t\tcode += \"m33 \" + animationRegisterCache.rotationRegisters[i] + \".xyz,\" + animationRegisterCache.rotationRegisters[i] + \",\" + temp1 + \"\\n\";\n\t\t\t}\n\n\t\t\t//y axis\n\t\t\tcode += \"mov \" + temp1 + \",\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\tcode += \"cos \" + temp1 + \".x,\" + rotationAttribute + \".y\\n\";\n\t\t\tcode += \"sin \" + temp1 + \".z,\" + rotationAttribute + \".y\\n\";\n\t\t\tcode += \"mov \" + temp2 + \",\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\tcode += \"mov \" + temp2 + \".y,\" + animationRegisterCache.vertexOneConst + \"\\n\";\n\t\t\tcode += \"mov \" + temp3 + \",\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\tcode += \"neg \" + temp3 + \".x,\" + temp1 + \".z\\n\";\n\t\t\tcode += \"mov \" + temp3 + \".z,\" + temp1 + \".x\\n\";\n\n\t\t\tif (animationRegisterCache.hasBillboard)\n\t\t\t\tcode += \"m33 \" + temp4 + \".xyz,\" + temp4 + \".xyz,\" + temp1 + \"\\n\";\n\t\t\telse {\n\t\t\t\tcode += \"m33 \" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + temp1 + \"\\n\";\n\t\t\t\tfor (i = 0; i < len; i++)\n\t\t\t\t\tcode += \"m33 \" + animationRegisterCache.rotationRegisters[i] + \".xyz,\" + animationRegisterCache.rotationRegisters[i] + \",\" + temp1 + \"\\n\";\n\t\t\t}\n\n\t\t\t//z axis\n\t\t\tcode += \"mov \" + temp2 + \",\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\tcode += \"sin \" + temp2 + \".x,\" + rotationAttribute + \".z\\n\";\n\t\t\tcode += \"cos \" + temp2 + \".y,\" + rotationAttribute + \".z\\n\";\n\t\t\tcode += \"mov \" + temp1 + \",\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\tcode += \"mov \" + temp1 + \".x,\" + temp2 + \".y\\n\";\n\t\t\tcode += \"neg \" + temp1 + \".y,\" + temp2 + \".x\\n\";\n\t\t\tcode += \"mov \" + temp3 + \",\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\tcode += \"mov \" + temp3 + \".z,\" + animationRegisterCache.vertexOneConst + \"\\n\";\n\n\t\t\tif (animationRegisterCache.hasBillboard) {\n\t\t\t\tcode += \"m33 \" + temp4 + \".xyz,\" + temp4 + \".xyz,\" + temp1 + \"\\n\";\n\t\t\t\tcode += \"sub \" + temp4 + \".xyz,\" + temp4 + \".xyz,\" + animationRegisterCache.positionTarget + \".xyz\\n\";\n\t\t\t\tcode += \"add \" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + temp4 + \".xyz,\" + animationRegisterCache.scaleAndRotateTarget + \".xyz\\n\";\n\t\t\t} else {\n\t\t\t\tcode += \"m33 \" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + temp1 + \"\\n\";\n\t\t\t\tfor (i = 0; i < len; i++)\n\t\t\t\t\tcode += \"m33 \" + animationRegisterCache.rotationRegisters[i] + \".xyz,\" + animationRegisterCache.rotationRegisters[i] + \",\" + temp1 + \"\\n\";\n\t\t\t}\n\n\t\t}\n\n\t\tif (this._iUsesPosition) {\n\t\t\tvar positionAttribute:ShaderRegisterElement = animationRegisterCache.getFreeVertexAttribute();\n\t\t\tanimationRegisterCache.setRegisterIndex(this, ParticleFollowState.FOLLOW_POSITION_INDEX, positionAttribute.index);\n\t\t\tcode += \"add \" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + positionAttribute + \",\" + animationRegisterCache.scaleAndRotateTarget + \".xyz\\n\";\n\t\t}\n\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAnimationState(animator:AnimatorBase):ParticleFollowState\n\t{\n\t\treturn animator.getAnimationState(this);\n\t}\n}\n\nexport = ParticleFollowNode;", + "import ColorTransform\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/ColorTransform\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\n\nimport ParticleAnimationSet\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimationSet\");\nimport ParticleProperties\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleProperties\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleNodeBase\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase\");\nimport ParticleInitialColorState\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleInitialColorState\");\n\n/**\n *\n */\nclass ParticleInitialColorNode extends ParticleNodeBase\n{\n\t//default values used when creating states\n\t/** @private */\n\tpublic _iUsesMultiplier:boolean;\n\t/** @private */\n\tpublic _iUsesOffset:boolean;\n\t/** @private */\n\tpublic _iInitialColor:ColorTransform;\n\n\t/**\n\t * Reference for color node properties on a single particle (when in local property mode).\n\t * Expects a ColorTransform object representing the color transform applied to the particle.\n\t */\n\tpublic static COLOR_INITIAL_COLORTRANSFORM:string = \"ColorInitialColorTransform\";\n\n\tconstructor(mode:number /*uint*/, usesMultiplier:boolean = true, usesOffset:boolean = false, initialColor:ColorTransform = null)\n\t{\n\t\tsuper(\"ParticleInitialColor\", mode, (usesMultiplier && usesOffset)? 8 : 4, ParticleAnimationSet.COLOR_PRIORITY);\n\n\t\tthis._pStateClass = ParticleInitialColorState;\n\n\t\tthis._iUsesMultiplier = usesMultiplier;\n\t\tthis._iUsesOffset = usesOffset;\n\t\tthis._iInitialColor = initialColor || new ColorTransform();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string\n\t{\n\t\tvar code:string = \"\";\n\t\tif (animationRegisterCache.needFragmentAnimation) {\n\n\t\t\tif (this._iUsesMultiplier) {\n\t\t\t\tvar multiplierValue:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute();\n\t\t\t\tanimationRegisterCache.setRegisterIndex(this, ParticleInitialColorState.MULTIPLIER_INDEX, multiplierValue.index);\n\n\t\t\t\tcode += \"mul \" + animationRegisterCache.colorMulTarget + \",\" + multiplierValue + \",\" + animationRegisterCache.colorMulTarget + \"\\n\";\n\t\t\t}\n\n\t\t\tif (this._iUsesOffset) {\n\t\t\t\tvar offsetValue:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.LOCAL_STATIC)? animationRegisterCache.getFreeVertexAttribute() : animationRegisterCache.getFreeVertexConstant();\n\t\t\t\tanimationRegisterCache.setRegisterIndex(this, ParticleInitialColorState.OFFSET_INDEX, offsetValue.index);\n\n\t\t\t\tcode += \"add \" + animationRegisterCache.colorAddTarget + \",\" + offsetValue + \",\" + animationRegisterCache.colorAddTarget + \"\\n\";\n\t\t\t}\n\t\t}\n\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iProcessAnimationSetting(particleAnimationSet:ParticleAnimationSet)\n\t{\n\t\tif (this._iUsesMultiplier)\n\t\t\tparticleAnimationSet.hasColorMulNode = true;\n\t\tif (this._iUsesOffset)\n\t\t\tparticleAnimationSet.hasColorAddNode = true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iGeneratePropertyOfOneParticle(param:ParticleProperties)\n\t{\n\t\tvar initialColor:ColorTransform = param[ParticleInitialColorNode.COLOR_INITIAL_COLORTRANSFORM];\n\t\tif (!initialColor)\n\t\t\tthrow(new Error(\"there is no \" + ParticleInitialColorNode.COLOR_INITIAL_COLORTRANSFORM + \" in param!\"));\n\n\t\tvar i:number /*uint*/ = 0;\n\n\t\t//multiplier\n\t\tif (this._iUsesMultiplier) {\n\t\t\tthis._pOneData[i++] = initialColor.redMultiplier;\n\t\t\tthis._pOneData[i++] = initialColor.greenMultiplier;\n\t\t\tthis._pOneData[i++] = initialColor.blueMultiplier;\n\t\t\tthis._pOneData[i++] = initialColor.alphaMultiplier;\n\t\t}\n\t\t//offset\n\t\tif (this._iUsesOffset) {\n\t\t\tthis._pOneData[i++] = initialColor.redOffset/255;\n\t\t\tthis._pOneData[i++] = initialColor.greenOffset/255;\n\t\t\tthis._pOneData[i++] = initialColor.blueOffset/255;\n\t\t\tthis._pOneData[i++] = initialColor.alphaOffset/255;\n\t\t}\n\n\t}\n\n}\n\nexport = ParticleInitialColorNode;", + "import AnimationNodeBase\t\t\t\t= require(\"awayjs-core/lib/animators/nodes/AnimationNodeBase\");\n\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\n\nimport ParticleAnimationSet\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimationSet\");\nimport ParticleProperties\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleProperties\");\n\n/**\n * Provides an abstract base class for particle animation nodes.\n */\nclass ParticleNodeBase extends AnimationNodeBase\n{\n\tprivate _priority:number /*int*/;\n\n\tpublic _pMode:number /*uint*/;\n\tpublic _pDataLength:number /*uint*/ = 3;\n\tpublic _pOneData:Array;\n\n\tpublic _iDataOffset:number /*uint*/;\n\n\t//modes alias\n\tprivate static GLOBAL:string = 'Global';\n\tprivate static LOCAL_STATIC:string = 'LocalStatic';\n\tprivate static LOCAL_DYNAMIC:string = 'LocalDynamic';\n\n\t//modes list\n\tprivate static MODES:Object =\n\t{\n\t\t0:ParticleNodeBase.GLOBAL,\n\t\t1:ParticleNodeBase.LOCAL_STATIC,\n\t\t2:ParticleNodeBase.LOCAL_DYNAMIC\n\t};\n\n\t/**\n\t * Returns the property mode of the particle animation node. Typically set in the node constructor\n\t *\n\t * @see away.animators.ParticlePropertiesMode\n\t */\n\tpublic get mode():number /*uint*/\n\t{\n\t\treturn this._pMode;\n\t}\n\n\t/**\n\t * Returns the priority of the particle animation node, used to order the agal generated in a particle animation set. Set automatically on instantiation.\n\t *\n\t * @see away.animators.ParticleAnimationSet\n\t * @see #getAGALVertexCode\n\t */\n\tpublic get priority():number /*int*/\n\t{\n\t\treturn this._priority;\n\t}\n\n\t/**\n\t * Returns the length of the data used by the node when in LOCAL_STATIC mode. Used to generate the local static data of the particle animation set.\n\t *\n\t * @see away.animators.ParticleAnimationSet\n\t * @see #getAGALVertexCode\n\t */\n\tpublic get dataLength():number /*int*/\n\t{\n\t\treturn this._pDataLength;\n\t}\n\n\t/**\n\t * Returns the generated data vector of the node after one particle pass during the generation of all local static data of the particle animation set.\n\t *\n\t * @see away.animators.ParticleAnimationSet\n\t * @see #generatePropertyOfOneParticle\n\t */\n\tpublic get oneData():Array\n\t{\n\t\treturn this._pOneData;\n\t}\n\n\t/**\n\t * Creates a new ParticleNodeBase object.\n\t *\n\t * @param name Defines the generic name of the particle animation node.\n\t * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node.\n\t * @param dataLength Defines the length of the data used by the node when in LOCAL_STATIC mode.\n\t * @param [optional] priority the priority of the particle animation node, used to order the agal generated in a particle animation set. Defaults to 1.\n\t */\n\tconstructor(name:string, mode:number /*uint*/, dataLength:number /*uint*/, priority:number /*int*/ = 1)\n\t{\n\t\tsuper();\n\n\t\tname = name + ParticleNodeBase.MODES[mode];\n\n\t\tthis.name = name;\n\t\tthis._pMode = mode;\n\t\tthis._priority = priority;\n\t\tthis._pDataLength = dataLength;\n\n\t\tthis._pOneData = new Array(this._pDataLength);\n\t}\n\n\t/**\n\t * Returns the AGAL code of the particle animation node for use in the vertex shader.\n\t */\n\tpublic getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string\n\t{\n\t\treturn \"\";\n\t}\n\n\t/**\n\t * Returns the AGAL code of the particle animation node for use in the fragment shader.\n\t */\n\tpublic getAGALFragmentCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string\n\t{\n\t\treturn \"\";\n\t}\n\n\t/**\n\t * Returns the AGAL code of the particle animation node for use in the fragment shader when UV coordinates are required.\n\t */\n\tpublic getAGALUVCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string\n\t{\n\t\treturn \"\";\n\t}\n\n\t/**\n\t * Called internally by the particle animation set when assigning the set of static properties originally defined by the initParticleFunc of the set.\n\t *\n\t * @see away.animators.ParticleAnimationSet#initParticleFunc\n\t */\n\tpublic _iGeneratePropertyOfOneParticle(param:ParticleProperties)\n\t{\n\n\t}\n\n\t/**\n\t * Called internally by the particle animation set when determining the requirements of the particle animation node AGAL.\n\t */\n\tpublic _iProcessAnimationSetting(particleAnimationSet:ParticleAnimationSet)\n\t{\n\n\t}\n}\n\nexport = ParticleNodeBase;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\n\nimport ParticleProperties\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleProperties\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleNodeBase\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase\");\nimport ParticleOrbitState\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleOrbitState\");\n\n/**\n * A particle animation node used to control the position of a particle over time around a circular orbit.\n */\nclass ParticleOrbitNode extends ParticleNodeBase\n{\n\t/** @private */\n\tpublic _iUsesEulers:boolean;\n\n\t/** @private */\n\tpublic _iUsesCycle:boolean;\n\n\t/** @private */\n\tpublic _iUsesPhase:boolean;\n\n\t/** @private */\n\tpublic _iRadius:number;\n\t/** @private */\n\tpublic _iCycleDuration:number;\n\t/** @private */\n\tpublic _iCyclePhase:number;\n\t/** @private */\n\tpublic _iEulers:Vector3D;\n\n\t/**\n\t * Reference for orbit node properties on a single particle (when in local property mode).\n\t * Expects a Vector3D object representing the radius (x), cycle speed (y) and cycle phase (z) of the motion on the particle.\n\t */\n\tpublic static ORBIT_VECTOR3D:string = \"OrbitVector3D\";\n\n\t/**\n\t * Creates a new ParticleOrbitNode object.\n\t *\n\t * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node.\n\t * @param [optional] usesEulers Defines whether the node uses the eulers property in the shader to calculate a rotation on the orbit. Defaults to true.\n\t * @param [optional] usesCycle Defines whether the node uses the cycleDuration property in the shader to calculate the period of the orbit independent of particle duration. Defaults to false.\n\t * @param [optional] usesPhase Defines whether the node uses the cyclePhase property in the shader to calculate a starting offset to the cycle rotation of the particle. Defaults to false.\n\t * @param [optional] radius Defines the radius of the orbit when in global mode. Defaults to 100.\n\t * @param [optional] cycleDuration Defines the duration of the orbit in seconds, used as a period independent of particle duration when in global mode. Defaults to 1.\n\t * @param [optional] cyclePhase Defines the phase of the orbit in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0.\n\t * @param [optional] eulers Defines the euler rotation in degrees, applied to the orientation of the orbit when in global mode.\n\t */\n\tconstructor(mode:number /*uint*/, usesEulers:boolean = true, usesCycle:boolean = false, usesPhase:boolean = false, radius:number = 100, cycleDuration:number = 1, cyclePhase:number = 0, eulers:Vector3D = null)\n\t{\n\t\tvar len:number /*int*/ = 3;\n\t\tif (usesPhase)\n\t\t\tlen++;\n\t\tsuper(\"ParticleOrbit\", mode, len);\n\n\t\tthis._pStateClass = ParticleOrbitState;\n\n\t\tthis._iUsesEulers = usesEulers;\n\t\tthis._iUsesCycle = usesCycle;\n\t\tthis._iUsesPhase = usesPhase;\n\n\t\tthis._iRadius = radius;\n\t\tthis._iCycleDuration = cycleDuration;\n\t\tthis._iCyclePhase = cyclePhase;\n\t\tthis._iEulers = eulers || new Vector3D();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string\n\t{\n\t\tvar orbitRegister:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute();\n\t\tanimationRegisterCache.setRegisterIndex(this, ParticleOrbitState.ORBIT_INDEX, orbitRegister.index);\n\n\t\tvar eulersMatrixRegister:ShaderRegisterElement = animationRegisterCache.getFreeVertexConstant();\n\t\tanimationRegisterCache.setRegisterIndex(this, ParticleOrbitState.EULERS_INDEX, eulersMatrixRegister.index);\n\t\tanimationRegisterCache.getFreeVertexConstant();\n\t\tanimationRegisterCache.getFreeVertexConstant();\n\t\tanimationRegisterCache.getFreeVertexConstant();\n\n\t\tvar temp1:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\tanimationRegisterCache.addVertexTempUsages(temp1, 1);\n\t\tvar distance:ShaderRegisterElement = new ShaderRegisterElement(temp1.regName, temp1.index);\n\n\t\tvar temp2:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\tvar cos:ShaderRegisterElement = new ShaderRegisterElement(temp2.regName, temp2.index, 0);\n\t\tvar sin:ShaderRegisterElement = new ShaderRegisterElement(temp2.regName, temp2.index, 1);\n\t\tvar degree:ShaderRegisterElement = new ShaderRegisterElement(temp2.regName, temp2.index, 2);\n\t\tanimationRegisterCache.removeVertexTempUsage(temp1);\n\n\t\tvar code:string = \"\";\n\n\t\tif (this._iUsesCycle) {\n\t\t\tcode += \"mul \" + degree + \",\" + animationRegisterCache.vertexTime + \",\" + orbitRegister + \".y\\n\";\n\n\t\t\tif (this._iUsesPhase)\n\t\t\t\tcode += \"add \" + degree + \",\" + degree + \",\" + orbitRegister + \".w\\n\";\n\t\t} else\n\t\t\tcode += \"mul \" + degree + \",\" + animationRegisterCache.vertexLife + \",\" + orbitRegister + \".y\\n\";\n\n\t\tcode += \"cos \" + cos + \",\" + degree + \"\\n\";\n\t\tcode += \"sin \" + sin + \",\" + degree + \"\\n\";\n\t\tcode += \"mul \" + distance + \".x,\" + cos + \",\" + orbitRegister + \".x\\n\";\n\t\tcode += \"mul \" + distance + \".y,\" + sin + \",\" + orbitRegister + \".x\\n\";\n\t\tcode += \"mov \" + distance + \".wz\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\tif (this._iUsesEulers)\n\t\t\tcode += \"m44 \" + distance + \",\" + distance + \",\" + eulersMatrixRegister + \"\\n\";\n\t\tcode += \"add \" + animationRegisterCache.positionTarget + \".xyz,\" + distance + \".xyz,\" + animationRegisterCache.positionTarget + \".xyz\\n\";\n\n\t\tif (animationRegisterCache.needVelocity) {\n\t\t\tcode += \"neg \" + distance + \".x,\" + sin + \"\\n\";\n\t\t\tcode += \"mov \" + distance + \".y,\" + cos + \"\\n\";\n\t\t\tcode += \"mov \" + distance + \".zw,\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\tif (this._iUsesEulers)\n\t\t\t\tcode += \"m44 \" + distance + \",\" + distance + \",\" + eulersMatrixRegister + \"\\n\";\n\t\t\tcode += \"mul \" + distance + \",\" + distance + \",\" + orbitRegister + \".z\\n\";\n\t\t\tcode += \"div \" + distance + \",\" + distance + \",\" + orbitRegister + \".y\\n\";\n\t\t\tif (!this._iUsesCycle)\n\t\t\t\tcode += \"div \" + distance + \",\" + distance + \",\" + animationRegisterCache.vertexLife + \"\\n\";\n\t\t\tcode += \"add \" + animationRegisterCache.velocityTarget + \".xyz,\" + animationRegisterCache.velocityTarget + \".xyz,\" + distance + \".xyz\\n\";\n\t\t}\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAnimationState(animator:AnimatorBase):ParticleOrbitState\n\t{\n\t\treturn animator.getAnimationState(this);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iGeneratePropertyOfOneParticle(param:ParticleProperties)\n\t{\n\t\t//Vector3D.x is radius, Vector3D.y is cycle duration, Vector3D.z is phase\n\t\tvar orbit:Vector3D = param[ParticleOrbitNode.ORBIT_VECTOR3D];\n\t\tif (!orbit)\n\t\t\tthrow new Error(\"there is no \" + ParticleOrbitNode.ORBIT_VECTOR3D + \" in param!\");\n\n\t\tthis._pOneData[0] = orbit.x;\n\t\tif (this._iUsesCycle && orbit.y <= 0)\n\t\t\tthrow(new Error(\"the cycle duration must be greater than zero\"));\n\t\tthis._pOneData[1] = Math.PI*2/(!this._iUsesCycle? 1 : orbit.y);\n\t\tthis._pOneData[2] = orbit.x*Math.PI*2;\n\t\tif (this._iUsesPhase)\n\t\t\tthis._pOneData[3] = orbit.z*Math.PI/180;\n\t}\n}\n\nexport = ParticleOrbitNode;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\n\nimport ParticleProperties\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleProperties\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleNodeBase\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase\");\nimport ParticleOscillatorState\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleOscillatorState\");\n\n/**\n * A particle animation node used to control the position of a particle over time using simple harmonic motion.\n */\nclass ParticleOscillatorNode extends ParticleNodeBase\n{\n\t/** @private */\n\tpublic _iOscillator:Vector3D;\n\n\t/**\n\t * Reference for ocsillator node properties on a single particle (when in local property mode).\n\t * Expects a Vector3D object representing the axis (x,y,z) and cycle speed (w) of the motion on the particle.\n\t */\n\tpublic static OSCILLATOR_VECTOR3D:string = \"OscillatorVector3D\";\n\n\t/**\n\t * Creates a new ParticleOscillatorNode\n\t *\n\t * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node.\n\t * @param [optional] oscillator Defines the default oscillator axis (x, y, z) and cycleDuration (w) of the node, used when in global mode.\n\t */\n\tconstructor(mode:number /*uint*/, oscillator:Vector3D = null)\n\t{\n\t\tsuper(\"ParticleOscillator\", mode, 4);\n\n\t\tthis._pStateClass = ParticleOscillatorState;\n\n\t\tthis._iOscillator = oscillator || new Vector3D();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string\n\t{\n\t\tvar oscillatorRegister:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute();\n\t\tanimationRegisterCache.setRegisterIndex(this, ParticleOscillatorState.OSCILLATOR_INDEX, oscillatorRegister.index);\n\t\tvar temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\tvar dgree:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 0);\n\t\tvar sin:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 1);\n\t\tvar cos:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 2);\n\t\tanimationRegisterCache.addVertexTempUsages(temp, 1);\n\t\tvar temp2:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\tvar distance:ShaderRegisterElement = new ShaderRegisterElement(temp2.regName, temp2.index);\n\t\tanimationRegisterCache.removeVertexTempUsage(temp);\n\n\t\tvar code:string = \"\";\n\t\tcode += \"mul \" + dgree + \",\" + animationRegisterCache.vertexTime + \",\" + oscillatorRegister + \".w\\n\";\n\t\tcode += \"sin \" + sin + \",\" + dgree + \"\\n\";\n\t\tcode += \"mul \" + distance + \".xyz,\" + sin + \",\" + oscillatorRegister + \".xyz\\n\";\n\t\tcode += \"add \" + animationRegisterCache.positionTarget + \".xyz,\" + distance + \".xyz,\" + animationRegisterCache.positionTarget + \".xyz\\n\";\n\n\t\tif (animationRegisterCache.needVelocity) {\n\t\t\tcode += \"cos \" + cos + \",\" + dgree + \"\\n\";\n\t\t\tcode += \"mul \" + distance + \".xyz,\" + cos + \",\" + oscillatorRegister + \".xyz\\n\";\n\t\t\tcode += \"add \" + animationRegisterCache.velocityTarget + \".xyz,\" + distance + \".xyz,\" + animationRegisterCache.velocityTarget + \".xyz\\n\";\n\t\t}\n\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAnimationState(animator:AnimatorBase):ParticleOscillatorState\n\t{\n\t\treturn animator.getAnimationState(this);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iGeneratePropertyOfOneParticle(param:ParticleProperties)\n\t{\n\t\t//(Vector3D.x,Vector3D.y,Vector3D.z) is oscillator axis, Vector3D.w is oscillator cycle duration\n\t\tvar drift:Vector3D = param[ParticleOscillatorNode.OSCILLATOR_VECTOR3D];\n\t\tif (!drift)\n\t\t\tthrow(new Error(\"there is no \" + ParticleOscillatorNode.OSCILLATOR_VECTOR3D + \" in param!\"));\n\n\t\tthis._pOneData[0] = drift.x;\n\t\tthis._pOneData[1] = drift.y;\n\t\tthis._pOneData[2] = drift.z;\n\t\tif (drift.w <= 0)\n\t\t\tthrow(new Error(\"the cycle duration must greater than zero\"));\n\t\tthis._pOneData[3] = Math.PI*2/drift.w;\n\t}\n}\n\nexport = ParticleOscillatorNode;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\n\nimport ParticleProperties\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleProperties\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleNodeBase\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase\");\nimport ParticlePositionState\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticlePositionState\");\n\n/**\n * A particle animation node used to set the starting position of a particle.\n */\nclass ParticlePositionNode extends ParticleNodeBase\n{\n\t/** @private */\n\tpublic _iPosition:Vector3D;\n\n\t/**\n\t * Reference for position node properties on a single particle (when in local property mode).\n\t * Expects a Vector3D object representing position of the particle.\n\t */\n\tpublic static POSITION_VECTOR3D:string = \"PositionVector3D\";\n\n\t/**\n\t * Creates a new ParticlePositionNode\n\t *\n\t * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node.\n\t * @param [optional] position Defines the default position of the particle when in global mode. Defaults to 0,0,0.\n\t */\n\tconstructor(mode:number /*uint*/, position:Vector3D = null)\n\t{\n\t\tsuper(\"ParticlePosition\", mode, 3);\n\n\t\tthis._pStateClass = ParticlePositionState;\n\n\t\tthis._iPosition = position || new Vector3D();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string\n\t{\n\t\tvar positionAttribute:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute();\n\t\tanimationRegisterCache.setRegisterIndex(this, ParticlePositionState.POSITION_INDEX, positionAttribute.index);\n\n\t\treturn \"add \" + animationRegisterCache.positionTarget + \".xyz,\" + positionAttribute + \".xyz,\" + animationRegisterCache.positionTarget + \".xyz\\n\";\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAnimationState(animator:AnimatorBase):ParticlePositionState\n\t{\n\t\treturn animator.getAnimationState(this);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iGeneratePropertyOfOneParticle(param:ParticleProperties)\n\t{\n\t\tvar offset:Vector3D = param[ParticlePositionNode.POSITION_VECTOR3D];\n\t\tif (!offset)\n\t\t\tthrow(new Error(\"there is no \" + ParticlePositionNode.POSITION_VECTOR3D + \" in param!\"));\n\n\t\tthis._pOneData[0] = offset.x;\n\t\tthis._pOneData[1] = offset.y;\n\t\tthis._pOneData[2] = offset.z;\n\t}\n}\n\nexport = ParticlePositionNode;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\n\nimport ParticleAnimationSet\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimationSet\");\nimport ParticleProperties\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleProperties\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleNodeBase\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase\");\nimport ParticleRotateToHeadingState\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleRotateToHeadingState\");\n\n/**\n * A particle animation node used to control the rotation of a particle to match its heading vector.\n */\nclass ParticleRotateToHeadingNode extends ParticleNodeBase\n{\n\t/**\n\t * Creates a new ParticleBillboardNode\n\t */\n\tconstructor()\n\t{\n\t\tsuper(\"ParticleRotateToHeading\", ParticlePropertiesMode.GLOBAL, 0, 3);\n\n\t\tthis._pStateClass = ParticleRotateToHeadingState;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string\n\t{\n\t\tvar code:string = \"\";\n\t\tvar len:number /*int*/ = animationRegisterCache.rotationRegisters.length;\n\t\tvar i:number /*int*/;\n\t\tif (animationRegisterCache.hasBillboard) {\n\t\t\tvar temp1:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\t\tanimationRegisterCache.addVertexTempUsages(temp1, 1);\n\t\t\tvar temp2:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\t\tanimationRegisterCache.addVertexTempUsages(temp2, 1);\n\t\t\tvar temp3:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\n\t\t\tvar rotationMatrixRegister:ShaderRegisterElement = animationRegisterCache.getFreeVertexConstant();\n\t\t\tanimationRegisterCache.setRegisterIndex(this, ParticleRotateToHeadingState.MATRIX_INDEX, rotationMatrixRegister.index);\n\t\t\tanimationRegisterCache.getFreeVertexConstant();\n\t\t\tanimationRegisterCache.getFreeVertexConstant();\n\t\t\tanimationRegisterCache.getFreeVertexConstant();\n\n\t\t\tanimationRegisterCache.removeVertexTempUsage(temp1);\n\t\t\tanimationRegisterCache.removeVertexTempUsage(temp2);\n\n\t\t\t//process the velocity\n\t\t\tcode += \"m33 \" + temp1 + \".xyz,\" + animationRegisterCache.velocityTarget + \".xyz,\" + rotationMatrixRegister + \"\\n\";\n\n\t\t\tcode += \"mov \" + temp3 + \",\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\tcode += \"mov \" + temp3 + \".xy,\" + temp1 + \".xy\\n\";\n\t\t\tcode += \"nrm \" + temp3 + \".xyz,\" + temp3 + \".xyz\\n\";\n\n\t\t\t//temp3.x=cos,temp3.y=sin\n\t\t\t//only process z axis\n\t\t\tcode += \"mov \" + temp2 + \",\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\tcode += \"mov \" + temp2 + \".x,\" + temp3 + \".y\\n\";\n\t\t\tcode += \"mov \" + temp2 + \".y,\" + temp3 + \".x\\n\";\n\t\t\tcode += \"mov \" + temp1 + \",\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\tcode += \"mov \" + temp1 + \".x,\" + temp3 + \".x\\n\";\n\t\t\tcode += \"neg \" + temp1 + \".y,\" + temp3 + \".y\\n\";\n\t\t\tcode += \"mov \" + temp3 + \",\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\tcode += \"mov \" + temp3 + \".z,\" + animationRegisterCache.vertexOneConst + \"\\n\";\n\t\t\tcode += \"m33 \" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + temp1 + \"\\n\";\n\t\t\tfor (i = 0; i < len; i++)\n\t\t\t\tcode += \"m33 \" + animationRegisterCache.rotationRegisters[i] + \".xyz,\" + animationRegisterCache.rotationRegisters[i] + \",\" + temp1 + \"\\n\";\n\t\t} else {\n\t\t\tvar nrmVel:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\t\tanimationRegisterCache.addVertexTempUsages(nrmVel, 1);\n\n\t\t\tvar xAxis:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\t\tanimationRegisterCache.addVertexTempUsages(xAxis, 1);\n\n\t\t\tvar R:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\t\tanimationRegisterCache.addVertexTempUsages(R, 1);\n\t\t\tvar R_rev:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\t\tvar cos:ShaderRegisterElement = new ShaderRegisterElement(R.regName, R.index, 3);\n\t\t\tvar sin:ShaderRegisterElement = new ShaderRegisterElement(R_rev.regName, R_rev.index, 3);\n\t\t\tvar cos2:ShaderRegisterElement = new ShaderRegisterElement(nrmVel.regName, nrmVel.index, 3);\n\t\t\tvar tempSingle:ShaderRegisterElement = sin;\n\n\t\t\tanimationRegisterCache.removeVertexTempUsage(nrmVel);\n\t\t\tanimationRegisterCache.removeVertexTempUsage(xAxis);\n\t\t\tanimationRegisterCache.removeVertexTempUsage(R);\n\n\t\t\tcode += \"mov \" + xAxis + \".x,\" + animationRegisterCache.vertexOneConst + \"\\n\";\n\t\t\tcode += \"mov \" + xAxis + \".yz,\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\n\t\t\tcode += \"nrm \" + nrmVel + \".xyz,\" + animationRegisterCache.velocityTarget + \".xyz\\n\";\n\t\t\tcode += \"dp3 \" + cos2 + \",\" + nrmVel + \".xyz,\" + xAxis + \".xyz\\n\";\n\t\t\tcode += \"crs \" + nrmVel + \".xyz,\" + xAxis + \".xyz,\" + nrmVel + \".xyz\\n\";\n\t\t\tcode += \"nrm \" + nrmVel + \".xyz,\" + nrmVel + \".xyz\\n\";\n\t\t\t//use R as temp to judge if nrm is (0,0,0).\n\t\t\t//if nrm is (0,0,0) ,change it to (0,0,1).\n\t\t\tcode += \"dp3 \" + R + \".x,\" + nrmVel + \".xyz,\" + nrmVel + \".xyz\\n\";\n\t\t\tcode += \"sge \" + R + \".x,\" + animationRegisterCache.vertexZeroConst + \",\" + R + \".x\\n\";\n\t\t\tcode += \"add \" + nrmVel + \".z,\" + R + \".x,\" + nrmVel + \".z\\n\";\n\n\t\t\tcode += \"add \" + tempSingle + \",\" + cos2 + \",\" + animationRegisterCache.vertexOneConst + \"\\n\";\n\t\t\tcode += \"div \" + tempSingle + \",\" + tempSingle + \",\" + animationRegisterCache.vertexTwoConst + \"\\n\";\n\t\t\tcode += \"sqt \" + cos + \",\" + tempSingle + \"\\n\";\n\n\t\t\tcode += \"sub \" + tempSingle + \",\" + animationRegisterCache.vertexOneConst + \",\" + cos2 + \"\\n\";\n\t\t\tcode += \"div \" + tempSingle + \",\" + tempSingle + \",\" + animationRegisterCache.vertexTwoConst + \"\\n\";\n\t\t\tcode += \"sqt \" + sin + \",\" + tempSingle + \"\\n\";\n\n\t\t\tcode += \"mul \" + R + \".xyz,\" + sin + \",\" + nrmVel + \".xyz\\n\";\n\n\t\t\t//use cos as R.w\n\n\t\t\tcode += \"mul \" + R_rev + \".xyz,\" + sin + \",\" + nrmVel + \".xyz\\n\";\n\t\t\tcode += \"neg \" + R_rev + \".xyz,\" + R_rev + \".xyz\\n\";\n\n\t\t\t//use cos as R_rev.w\n\n\t\t\t//nrmVel and xAxis are used as temp register\n\t\t\tcode += \"crs \" + nrmVel + \".xyz,\" + R + \".xyz,\" + animationRegisterCache.scaleAndRotateTarget + \".xyz\\n\";\n\n\t\t\t//use cos as R.w\n\t\t\tcode += \"mul \" + xAxis + \".xyz,\" + cos + \",\" + animationRegisterCache.scaleAndRotateTarget + \".xyz\\n\";\n\t\t\tcode += \"add \" + nrmVel + \".xyz,\" + nrmVel + \".xyz,\" + xAxis + \".xyz\\n\";\n\t\t\tcode += \"dp3 \" + xAxis + \".w,\" + R + \".xyz,\" + animationRegisterCache.scaleAndRotateTarget + \".xyz\\n\";\n\t\t\tcode += \"neg \" + nrmVel + \".w,\" + xAxis + \".w\\n\";\n\n\t\t\tcode += \"crs \" + R + \".xyz,\" + nrmVel + \".xyz,\" + R_rev + \".xyz\\n\";\n\t\t\t//code += \"mul \" + xAxis + \".xyzw,\" + nrmVel + \".xyzw,\" +R_rev + \".w\\n\";\n\t\t\tcode += \"mul \" + xAxis + \".xyzw,\" + nrmVel + \".xyzw,\" + cos + \"\\n\";\n\t\t\tcode += \"add \" + R + \".xyz,\" + R + \".xyz,\" + xAxis + \".xyz\\n\";\n\t\t\tcode += \"mul \" + xAxis + \".xyz,\" + nrmVel + \".w,\" + R_rev + \".xyz\\n\";\n\n\t\t\tcode += \"add \" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + R + \".xyz,\" + xAxis + \".xyz\\n\";\n\n\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\t//just repeat the calculate above\n\t\t\t\t//because of the limited registers, no need to optimise\n\t\t\t\tcode += \"mov \" + xAxis + \".x,\" + animationRegisterCache.vertexOneConst + \"\\n\";\n\t\t\t\tcode += \"mov \" + xAxis + \".yz,\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\t\tcode += \"nrm \" + nrmVel + \".xyz,\" + animationRegisterCache.velocityTarget + \".xyz\\n\";\n\t\t\t\tcode += \"dp3 \" + cos2 + \",\" + nrmVel + \".xyz,\" + xAxis + \".xyz\\n\";\n\t\t\t\tcode += \"crs \" + nrmVel + \".xyz,\" + xAxis + \".xyz,\" + nrmVel + \".xyz\\n\";\n\t\t\t\tcode += \"nrm \" + nrmVel + \".xyz,\" + nrmVel + \".xyz\\n\";\n\t\t\t\tcode += \"dp3 \" + R + \".x,\" + nrmVel + \".xyz,\" + nrmVel + \".xyz\\n\";\n\t\t\t\tcode += \"sge \" + R + \".x,\" + animationRegisterCache.vertexZeroConst + \",\" + R + \".x\\n\";\n\t\t\t\tcode += \"add \" + nrmVel + \".z,\" + R + \".x,\" + nrmVel + \".z\\n\";\n\t\t\t\tcode += \"add \" + tempSingle + \",\" + cos2 + \",\" + animationRegisterCache.vertexOneConst + \"\\n\";\n\t\t\t\tcode += \"div \" + tempSingle + \",\" + tempSingle + \",\" + animationRegisterCache.vertexTwoConst + \"\\n\";\n\t\t\t\tcode += \"sqt \" + cos + \",\" + tempSingle + \"\\n\";\n\t\t\t\tcode += \"sub \" + tempSingle + \",\" + animationRegisterCache.vertexOneConst + \",\" + cos2 + \"\\n\";\n\t\t\t\tcode += \"div \" + tempSingle + \",\" + tempSingle + \",\" + animationRegisterCache.vertexTwoConst + \"\\n\";\n\t\t\t\tcode += \"sqt \" + sin + \",\" + tempSingle + \"\\n\";\n\t\t\t\tcode += \"mul \" + R + \".xyz,\" + sin + \",\" + nrmVel + \".xyz\\n\";\n\t\t\t\tcode += \"mul \" + R_rev + \".xyz,\" + sin + \",\" + nrmVel + \".xyz\\n\";\n\t\t\t\tcode += \"neg \" + R_rev + \".xyz,\" + R_rev + \".xyz\\n\";\n\t\t\t\tcode += \"crs \" + nrmVel + \".xyz,\" + R + \".xyz,\" + animationRegisterCache.rotationRegisters[i] + \".xyz\\n\";\n\t\t\t\tcode += \"mul \" + xAxis + \".xyz,\" + cos + \",\" + animationRegisterCache.rotationRegisters[i] + \".xyz\\n\";\n\t\t\t\tcode += \"add \" + nrmVel + \".xyz,\" + nrmVel + \".xyz,\" + xAxis + \".xyz\\n\";\n\t\t\t\tcode += \"dp3 \" + xAxis + \".w,\" + R + \".xyz,\" + animationRegisterCache.rotationRegisters[i] + \".xyz\\n\";\n\t\t\t\tcode += \"neg \" + nrmVel + \".w,\" + xAxis + \".w\\n\";\n\t\t\t\tcode += \"crs \" + R + \".xyz,\" + nrmVel + \".xyz,\" + R_rev + \".xyz\\n\";\n\t\t\t\tcode += \"mul \" + xAxis + \".xyzw,\" + nrmVel + \".xyzw,\" + cos + \"\\n\";\n\t\t\t\tcode += \"add \" + R + \".xyz,\" + R + \".xyz,\" + xAxis + \".xyz\\n\";\n\t\t\t\tcode += \"mul \" + xAxis + \".xyz,\" + nrmVel + \".w,\" + R_rev + \".xyz\\n\";\n\t\t\t\tcode += \"add \" + animationRegisterCache.rotationRegisters[i] + \".xyz,\" + R + \".xyz,\" + xAxis + \".xyz\\n\";\n\t\t\t}\n\n\t\t}\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAnimationState(animator:AnimatorBase):ParticleRotateToHeadingState\n\t{\n\t\treturn animator.getAnimationState(this);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iProcessAnimationSetting(particleAnimationSet:ParticleAnimationSet)\n\t{\n\t\tparticleAnimationSet.needVelocity = true;\n\t}\n}\n\nexport = ParticleRotateToHeadingNode;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\n\nimport ParticleProperties\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleProperties\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleNodeBase\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase\");\nimport ParticleRotateToPositionState\t= require(\"awayjs-renderergl/lib/animators/states/ParticleRotateToPositionState\");\n\n/**\n * A particle animation node used to control the rotation of a particle to face to a position\n */\nclass ParticleRotateToPositionNode extends ParticleNodeBase\n{\n\t/** @private */\n\tpublic _iPosition:Vector3D;\n\n\t/**\n\t * Reference for the position the particle will rotate to face for a single particle (when in local property mode).\n\t * Expects a Vector3D object representing the position that the particle must face.\n\t */\n\tpublic static POSITION_VECTOR3D:string = \"RotateToPositionVector3D\";\n\n\t/**\n\t * Creates a new ParticleRotateToPositionNode\n\t */\n\tconstructor(mode:number /*uint*/, position:Vector3D = null)\n\t{\n\t\tsuper(\"ParticleRotateToPosition\", mode, 3, 3);\n\n\t\tthis._pStateClass = ParticleRotateToPositionState;\n\n\t\tthis._iPosition = position || new Vector3D();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string\n\t{\n\t\tvar positionAttribute:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute();\n\t\tanimationRegisterCache.setRegisterIndex(this, ParticleRotateToPositionState.POSITION_INDEX, positionAttribute.index);\n\n\t\tvar code:string = \"\";\n\t\tvar len:number /*int*/ = animationRegisterCache.rotationRegisters.length;\n\t\tvar i:number /*int*/;\n\t\tif (animationRegisterCache.hasBillboard) {\n\t\t\tvar temp1:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\t\tanimationRegisterCache.addVertexTempUsages(temp1, 1);\n\t\t\tvar temp2:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\t\tanimationRegisterCache.addVertexTempUsages(temp2, 1);\n\t\t\tvar temp3:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\n\t\t\tvar rotationMatrixRegister:ShaderRegisterElement = animationRegisterCache.getFreeVertexConstant();\n\t\t\tanimationRegisterCache.setRegisterIndex(this, ParticleRotateToPositionState.MATRIX_INDEX, rotationMatrixRegister.index);\n\t\t\tanimationRegisterCache.getFreeVertexConstant();\n\t\t\tanimationRegisterCache.getFreeVertexConstant();\n\t\t\tanimationRegisterCache.getFreeVertexConstant();\n\n\t\t\tanimationRegisterCache.removeVertexTempUsage(temp1);\n\t\t\tanimationRegisterCache.removeVertexTempUsage(temp2);\n\n\t\t\t//process the position\n\t\t\tcode += \"sub \" + temp1 + \".xyz,\" + positionAttribute + \".xyz,\" + animationRegisterCache.positionTarget + \".xyz\\n\";\n\t\t\tcode += \"m33 \" + temp1 + \".xyz,\" + temp1 + \".xyz,\" + rotationMatrixRegister + \"\\n\";\n\n\t\t\tcode += \"mov \" + temp3 + \",\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\tcode += \"mov \" + temp3 + \".xy,\" + temp1 + \".xy\\n\";\n\t\t\tcode += \"nrm \" + temp3 + \".xyz,\" + temp3 + \".xyz\\n\";\n\n\t\t\t//temp3.x=cos,temp3.y=sin\n\t\t\t//only process z axis\n\t\t\tcode += \"mov \" + temp2 + \",\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\tcode += \"mov \" + temp2 + \".x,\" + temp3 + \".y\\n\";\n\t\t\tcode += \"mov \" + temp2 + \".y,\" + temp3 + \".x\\n\";\n\t\t\tcode += \"mov \" + temp1 + \",\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\tcode += \"mov \" + temp1 + \".x,\" + temp3 + \".x\\n\";\n\t\t\tcode += \"neg \" + temp1 + \".y,\" + temp3 + \".y\\n\";\n\t\t\tcode += \"mov \" + temp3 + \",\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\tcode += \"mov \" + temp3 + \".z,\" + animationRegisterCache.vertexOneConst + \"\\n\";\n\t\t\tcode += \"m33 \" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + temp1 + \"\\n\";\n\t\t\tfor (i = 0; i < len; i++)\n\t\t\t\tcode += \"m33 \" + animationRegisterCache.rotationRegisters[i] + \".xyz,\" + animationRegisterCache.rotationRegisters[i] + \",\" + temp1 + \"\\n\";\n\t\t} else {\n\t\t\tvar nrmDirection:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\t\tanimationRegisterCache.addVertexTempUsages(nrmDirection, 1);\n\n\t\t\tvar temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\t\tanimationRegisterCache.addVertexTempUsages(temp, 1);\n\t\t\tvar cos:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 0);\n\t\t\tvar sin:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 1);\n\t\t\tvar o_temp:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 2);\n\t\t\tvar tempSingle:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 3);\n\n\t\t\tvar R:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\t\tanimationRegisterCache.addVertexTempUsages(R, 1);\n\n\t\t\tanimationRegisterCache.removeVertexTempUsage(nrmDirection);\n\t\t\tanimationRegisterCache.removeVertexTempUsage(temp);\n\t\t\tanimationRegisterCache.removeVertexTempUsage(R);\n\n\t\t\tcode += \"sub \" + nrmDirection + \".xyz,\" + positionAttribute + \".xyz,\" + animationRegisterCache.positionTarget + \".xyz\\n\";\n\t\t\tcode += \"nrm \" + nrmDirection + \".xyz,\" + nrmDirection + \".xyz\\n\";\n\n\t\t\tcode += \"mov \" + sin + \",\" + nrmDirection + \".y\\n\";\n\t\t\tcode += \"mul \" + cos + \",\" + sin + \",\" + sin + \"\\n\";\n\t\t\tcode += \"sub \" + cos + \",\" + animationRegisterCache.vertexOneConst + \",\" + cos + \"\\n\";\n\t\t\tcode += \"sqt \" + cos + \",\" + cos + \"\\n\";\n\n\t\t\tcode += \"mul \" + R + \".x,\" + cos + \",\" + animationRegisterCache.scaleAndRotateTarget + \".y\\n\";\n\t\t\tcode += \"mul \" + R + \".y,\" + sin + \",\" + animationRegisterCache.scaleAndRotateTarget + \".z\\n\";\n\t\t\tcode += \"mul \" + R + \".z,\" + sin + \",\" + animationRegisterCache.scaleAndRotateTarget + \".y\\n\";\n\t\t\tcode += \"mul \" + R + \".w,\" + cos + \",\" + animationRegisterCache.scaleAndRotateTarget + \".z\\n\";\n\n\t\t\tcode += \"sub \" + animationRegisterCache.scaleAndRotateTarget + \".y,\" + R + \".x,\" + R + \".y\\n\";\n\t\t\tcode += \"add \" + animationRegisterCache.scaleAndRotateTarget + \".z,\" + R + \".z,\" + R + \".w\\n\";\n\n\t\t\tcode += \"abs \" + R + \".y,\" + nrmDirection + \".y\\n\";\n\t\t\tcode += \"sge \" + R + \".z,\" + R + \".y,\" + animationRegisterCache.vertexOneConst + \"\\n\";\n\t\t\tcode += \"mul \" + R + \".x,\" + R + \".y,\" + nrmDirection + \".y\\n\";\n\n\t\t\t//judgu if nrmDirection=(0,1,0);\n\t\t\tcode += \"mov \" + nrmDirection + \".y,\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\tcode += \"dp3 \" + sin + \",\" + nrmDirection + \".xyz,\" + nrmDirection + \".xyz\\n\";\n\t\t\tcode += \"sge \" + tempSingle + \",\" + animationRegisterCache.vertexZeroConst + \",\" + sin + \"\\n\";\n\n\t\t\tcode += \"mov \" + nrmDirection + \".y,\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\tcode += \"nrm \" + nrmDirection + \".xyz,\" + nrmDirection + \".xyz\\n\";\n\n\t\t\tcode += \"sub \" + sin + \",\" + animationRegisterCache.vertexOneConst + \",\" + tempSingle + \"\\n\";\n\t\t\tcode += \"mul \" + sin + \",\" + sin + \",\" + nrmDirection + \".x\\n\";\n\n\t\t\tcode += \"mov \" + cos + \",\" + nrmDirection + \".z\\n\";\n\t\t\tcode += \"neg \" + cos + \",\" + cos + \"\\n\";\n\t\t\tcode += \"sub \" + o_temp + \",\" + animationRegisterCache.vertexOneConst + \",\" + cos + \"\\n\";\n\t\t\tcode += \"mul \" + o_temp + \",\" + R + \".x,\" + tempSingle + \"\\n\";\n\t\t\tcode += \"add \" + cos + \",\" + cos + \",\" + o_temp + \"\\n\";\n\n\t\t\tcode += \"mul \" + R + \".x,\" + cos + \",\" + animationRegisterCache.scaleAndRotateTarget + \".x\\n\";\n\t\t\tcode += \"mul \" + R + \".y,\" + sin + \",\" + animationRegisterCache.scaleAndRotateTarget + \".z\\n\";\n\t\t\tcode += \"mul \" + R + \".z,\" + sin + \",\" + animationRegisterCache.scaleAndRotateTarget + \".x\\n\";\n\t\t\tcode += \"mul \" + R + \".w,\" + cos + \",\" + animationRegisterCache.scaleAndRotateTarget + \".z\\n\";\n\n\t\t\tcode += \"sub \" + animationRegisterCache.scaleAndRotateTarget + \".x,\" + R + \".x,\" + R + \".y\\n\";\n\t\t\tcode += \"add \" + animationRegisterCache.scaleAndRotateTarget + \".z,\" + R + \".z,\" + R + \".w\\n\";\n\n\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\t//just repeat the calculate above\n\t\t\t\t//because of the limited registers, no need to optimise\n\t\t\t\tcode += \"sub \" + nrmDirection + \".xyz,\" + positionAttribute + \".xyz,\" + animationRegisterCache.positionTarget + \".xyz\\n\";\n\t\t\t\tcode += \"nrm \" + nrmDirection + \".xyz,\" + nrmDirection + \".xyz\\n\";\n\t\t\t\tcode += \"mov \" + sin + \",\" + nrmDirection + \".y\\n\";\n\t\t\t\tcode += \"mul \" + cos + \",\" + sin + \",\" + sin + \"\\n\";\n\t\t\t\tcode += \"sub \" + cos + \",\" + animationRegisterCache.vertexOneConst + \",\" + cos + \"\\n\";\n\t\t\t\tcode += \"sqt \" + cos + \",\" + cos + \"\\n\";\n\t\t\t\tcode += \"mul \" + R + \".x,\" + cos + \",\" + animationRegisterCache.rotationRegisters[i] + \".y\\n\";\n\t\t\t\tcode += \"mul \" + R + \".y,\" + sin + \",\" + animationRegisterCache.rotationRegisters[i] + \".z\\n\";\n\t\t\t\tcode += \"mul \" + R + \".z,\" + sin + \",\" + animationRegisterCache.rotationRegisters[i] + \".y\\n\";\n\t\t\t\tcode += \"mul \" + R + \".w,\" + cos + \",\" + animationRegisterCache.rotationRegisters[i] + \".z\\n\";\n\t\t\t\tcode += \"sub \" + animationRegisterCache.rotationRegisters[i] + \".y,\" + R + \".x,\" + R + \".y\\n\";\n\t\t\t\tcode += \"add \" + animationRegisterCache.rotationRegisters[i] + \".z,\" + R + \".z,\" + R + \".w\\n\";\n\t\t\t\tcode += \"abs \" + R + \".y,\" + nrmDirection + \".y\\n\";\n\t\t\t\tcode += \"sge \" + R + \".z,\" + R + \".y,\" + animationRegisterCache.vertexOneConst + \"\\n\";\n\t\t\t\tcode += \"mul \" + R + \".x,\" + R + \".y,\" + nrmDirection + \".y\\n\";\n\t\t\t\tcode += \"mov \" + nrmDirection + \".y,\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\t\tcode += \"dp3 \" + sin + \",\" + nrmDirection + \".xyz,\" + nrmDirection + \".xyz\\n\";\n\t\t\t\tcode += \"sge \" + tempSingle + \",\" + animationRegisterCache.vertexZeroConst + \",\" + sin + \"\\n\";\n\t\t\t\tcode += \"mov \" + nrmDirection + \".y,\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\t\tcode += \"nrm \" + nrmDirection + \".xyz,\" + nrmDirection + \".xyz\\n\";\n\t\t\t\tcode += \"sub \" + sin + \",\" + animationRegisterCache.vertexOneConst + \",\" + tempSingle + \"\\n\";\n\t\t\t\tcode += \"mul \" + sin + \",\" + sin + \",\" + nrmDirection + \".x\\n\";\n\t\t\t\tcode += \"mov \" + cos + \",\" + nrmDirection + \".z\\n\";\n\t\t\t\tcode += \"neg \" + cos + \",\" + cos + \"\\n\";\n\t\t\t\tcode += \"sub \" + o_temp + \",\" + animationRegisterCache.vertexOneConst + \",\" + cos + \"\\n\";\n\t\t\t\tcode += \"mul \" + o_temp + \",\" + R + \".x,\" + tempSingle + \"\\n\";\n\t\t\t\tcode += \"add \" + cos + \",\" + cos + \",\" + o_temp + \"\\n\";\n\t\t\t\tcode += \"mul \" + R + \".x,\" + cos + \",\" + animationRegisterCache.rotationRegisters[i] + \".x\\n\";\n\t\t\t\tcode += \"mul \" + R + \".y,\" + sin + \",\" + animationRegisterCache.rotationRegisters[i] + \".z\\n\";\n\t\t\t\tcode += \"mul \" + R + \".z,\" + sin + \",\" + animationRegisterCache.rotationRegisters[i] + \".x\\n\";\n\t\t\t\tcode += \"mul \" + R + \".w,\" + cos + \",\" + animationRegisterCache.rotationRegisters[i] + \".z\\n\";\n\t\t\t\tcode += \"sub \" + animationRegisterCache.rotationRegisters[i] + \".x,\" + R + \".x,\" + R + \".y\\n\";\n\t\t\t\tcode += \"add \" + animationRegisterCache.rotationRegisters[i] + \".z,\" + R + \".z,\" + R + \".w\\n\";\n\t\t\t}\n\t\t}\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAnimationState(animator:AnimatorBase):ParticleRotateToPositionState\n\t{\n\t\treturn animator.getAnimationState(this);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iGeneratePropertyOfOneParticle(param:ParticleProperties)\n\t{\n\t\tvar offset:Vector3D = param[ParticleRotateToPositionNode.POSITION_VECTOR3D];\n\t\tif (!offset)\n\t\t\tthrow(new Error(\"there is no \" + ParticleRotateToPositionNode.POSITION_VECTOR3D + \" in param!\"));\n\n\t\tthis._pOneData[0] = offset.x;\n\t\tthis._pOneData[1] = offset.y;\n\t\tthis._pOneData[2] = offset.z;\n\t}\n}\n\nexport = ParticleRotateToPositionNode;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\n\nimport ParticleProperties\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleProperties\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleNodeBase\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase\");\nimport ParticleRotationalVelocityState\t= require(\"awayjs-renderergl/lib/animators/states/ParticleRotationalVelocityState\");\n\n/**\n * A particle animation node used to set the starting rotational velocity of a particle.\n */\nclass ParticleRotationalVelocityNode extends ParticleNodeBase\n{\n\t/** @private */\n\tpublic _iRotationalVelocity:Vector3D;\n\n\t/**\n\t * Reference for rotational velocity node properties on a single particle (when in local property mode).\n\t * Expects a Vector3D object representing the rotational velocity around an axis of the particle.\n\t */\n\tpublic static ROTATIONALVELOCITY_VECTOR3D:string = \"RotationalVelocityVector3D\";\n\n\t/**\n\t * Creates a new ParticleRotationalVelocityNode\n\t *\n\t * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node.\n\t */\n\tconstructor(mode:number /*uint*/, rotationalVelocity:Vector3D = null)\n\t{\n\t\tsuper(\"ParticleRotationalVelocity\", mode, 4);\n\n\t\tthis._pStateClass = ParticleRotationalVelocityState;\n\n\t\tthis._iRotationalVelocity = rotationalVelocity || new Vector3D();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string\n\t{\n\t\tvar rotationRegister:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute();\n\t\tanimationRegisterCache.setRegisterIndex(this, ParticleRotationalVelocityState.ROTATIONALVELOCITY_INDEX, rotationRegister.index);\n\n\t\tvar nrmVel:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\tanimationRegisterCache.addVertexTempUsages(nrmVel, 1);\n\n\t\tvar xAxis:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\tanimationRegisterCache.addVertexTempUsages(xAxis, 1);\n\n\t\tvar temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\tanimationRegisterCache.addVertexTempUsages(temp, 1);\n\t\tvar Rtemp:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index);\n\t\tvar R_rev:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\tR_rev = new ShaderRegisterElement(R_rev.regName, R_rev.index);\n\n\t\tvar cos:ShaderRegisterElement = new ShaderRegisterElement(Rtemp.regName, Rtemp.index, 3);\n\t\tvar sin:ShaderRegisterElement = new ShaderRegisterElement(R_rev.regName, R_rev.index, 3);\n\n\t\tanimationRegisterCache.removeVertexTempUsage(nrmVel);\n\t\tanimationRegisterCache.removeVertexTempUsage(xAxis);\n\t\tanimationRegisterCache.removeVertexTempUsage(temp);\n\n\t\tvar code:string = \"\";\n\t\tcode += \"mov \" + nrmVel + \".xyz,\" + rotationRegister + \".xyz\\n\";\n\t\tcode += \"mov \" + nrmVel + \".w,\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\n\t\tcode += \"mul \" + cos + \",\" + animationRegisterCache.vertexTime + \",\" + rotationRegister + \".w\\n\";\n\n\t\tcode += \"sin \" + sin + \",\" + cos + \"\\n\";\n\t\tcode += \"cos \" + cos + \",\" + cos + \"\\n\";\n\n\t\tcode += \"mul \" + Rtemp + \".xyz,\" + sin + \",\" + nrmVel + \".xyz\\n\";\n\n\t\tcode += \"mul \" + R_rev + \".xyz,\" + sin + \",\" + nrmVel + \".xyz\\n\";\n\t\tcode += \"neg \" + R_rev + \".xyz,\" + R_rev + \".xyz\\n\";\n\n\t\t//nrmVel and xAxis are used as temp register\n\t\tcode += \"crs \" + nrmVel + \".xyz,\" + Rtemp + \".xyz,\" + animationRegisterCache.scaleAndRotateTarget + \".xyz\\n\";\n\n\t\tcode += \"mul \" + xAxis + \".xyz,\" + cos + \",\" + animationRegisterCache.scaleAndRotateTarget + \".xyz\\n\";\n\t\tcode += \"add \" + nrmVel + \".xyz,\" + nrmVel + \".xyz,\" + xAxis + \".xyz\\n\";\n\t\tcode += \"dp3 \" + xAxis + \".w,\" + Rtemp + \".xyz,\" + animationRegisterCache.scaleAndRotateTarget + \".xyz\\n\";\n\t\tcode += \"neg \" + nrmVel + \".w,\" + xAxis + \".w\\n\";\n\n\t\tcode += \"crs \" + Rtemp + \".xyz,\" + nrmVel + \".xyz,\" + R_rev + \".xyz\\n\";\n\n\t\t//use cos as R_rev.w\n\t\tcode += \"mul \" + xAxis + \".xyzw,\" + nrmVel + \".xyzw,\" + cos + \"\\n\";\n\t\tcode += \"add \" + Rtemp + \".xyz,\" + Rtemp + \".xyz,\" + xAxis + \".xyz\\n\";\n\t\tcode += \"mul \" + xAxis + \".xyz,\" + nrmVel + \".w,\" + R_rev + \".xyz\\n\";\n\n\t\tcode += \"add \" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + Rtemp + \".xyz,\" + xAxis + \".xyz\\n\";\n\n\t\tvar len:number /*int*/ = animationRegisterCache.rotationRegisters.length;\n\t\tfor (var i:number /*int*/ = 0; i < len; i++) {\n\t\t\tcode += \"mov \" + nrmVel + \".xyz,\" + rotationRegister + \".xyz\\n\";\n\t\t\tcode += \"mov \" + nrmVel + \".w,\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\tcode += \"mul \" + cos + \",\" + animationRegisterCache.vertexTime + \",\" + rotationRegister + \".w\\n\";\n\t\t\tcode += \"sin \" + sin + \",\" + cos + \"\\n\";\n\t\t\tcode += \"cos \" + cos + \",\" + cos + \"\\n\";\n\t\t\tcode += \"mul \" + Rtemp + \".xyz,\" + sin + \",\" + nrmVel + \".xyz\\n\";\n\t\t\tcode += \"mul \" + R_rev + \".xyz,\" + sin + \",\" + nrmVel + \".xyz\\n\";\n\t\t\tcode += \"neg \" + R_rev + \".xyz,\" + R_rev + \".xyz\\n\";\n\t\t\tcode += \"crs \" + nrmVel + \".xyz,\" + Rtemp + \".xyz,\" + animationRegisterCache.rotationRegisters[i] + \".xyz\\n\";\n\t\t\tcode += \"mul \" + xAxis + \".xyz,\" + cos + \",\" + animationRegisterCache.rotationRegisters[i] + \"\\n\";\n\t\t\tcode += \"add \" + nrmVel + \".xyz,\" + nrmVel + \".xyz,\" + xAxis + \".xyz\\n\";\n\t\t\tcode += \"dp3 \" + xAxis + \".w,\" + Rtemp + \".xyz,\" + animationRegisterCache.rotationRegisters[i] + \"\\n\";\n\t\t\tcode += \"neg \" + nrmVel + \".w,\" + xAxis + \".w\\n\";\n\t\t\tcode += \"crs \" + Rtemp + \".xyz,\" + nrmVel + \".xyz,\" + R_rev + \".xyz\\n\";\n\t\t\tcode += \"mul \" + xAxis + \".xyzw,\" + nrmVel + \".xyzw,\" + cos + \"\\n\";\n\t\t\tcode += \"add \" + Rtemp + \".xyz,\" + Rtemp + \".xyz,\" + xAxis + \".xyz\\n\";\n\t\t\tcode += \"mul \" + xAxis + \".xyz,\" + nrmVel + \".w,\" + R_rev + \".xyz\\n\";\n\t\t\tcode += \"add \" + animationRegisterCache.rotationRegisters[i] + \",\" + Rtemp + \".xyz,\" + xAxis + \".xyz\\n\";\n\t\t}\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAnimationState(animator:AnimatorBase):ParticleRotationalVelocityState\n\t{\n\t\treturn animator.getAnimationState(this);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iGeneratePropertyOfOneParticle(param:ParticleProperties)\n\t{\n\t\t//(Vector3d.x,Vector3d.y,Vector3d.z) is rotation axis,Vector3d.w is cycle duration\n\t\tvar rotate:Vector3D = param[ParticleRotationalVelocityNode.ROTATIONALVELOCITY_VECTOR3D];\n\t\tif (!rotate)\n\t\t\tthrow(new Error(\"there is no \" + ParticleRotationalVelocityNode.ROTATIONALVELOCITY_VECTOR3D + \" in param!\"));\n\n\t\tif (rotate.length <= 0)\n\t\t\trotate.z = 1; //set the default direction\n\t\telse\n\t\t\trotate.normalize();\n\n\t\tthis._pOneData[0] = rotate.x;\n\t\tthis._pOneData[1] = rotate.y;\n\t\tthis._pOneData[2] = rotate.z;\n\t\tif (rotate.w <= 0)\n\t\t\tthrow(new Error(\"the cycle duration must greater than zero\"));\n\t\t// it's used as angle/2 in agal\n\t\tthis._pOneData[3] = Math.PI/rotate.w;\n\t}\n}\n\nexport = ParticleRotationalVelocityNode;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\n\nimport ParticleProperties\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleProperties\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleNodeBase\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase\");\nimport ParticleScaleState\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleScaleState\");\n\n/**\n * A particle animation node used to control the scale variation of a particle over time.\n */\nclass ParticleScaleNode extends ParticleNodeBase\n{\n\t/** @private */\n\tpublic _iUsesCycle:boolean;\n\n\t/** @private */\n\tpublic _iUsesPhase:boolean;\n\n\t/** @private */\n\tpublic _iMinScale:number;\n\t/** @private */\n\tpublic _iMaxScale:number;\n\t/** @private */\n\tpublic _iCycleDuration:number;\n\t/** @private */\n\tpublic _iCyclePhase:number;\n\n\t/**\n\t * Reference for scale node properties on a single particle (when in local property mode).\n\t * Expects a Vector3D representing the min scale (x), max scale(y), optional cycle speed (z) and phase offset (w) applied to the particle.\n\t */\n\tpublic static SCALE_VECTOR3D:string = \"ScaleVector3D\";\n\n\t/**\n\t * Creates a new ParticleScaleNode\n\t *\n\t * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node.\n\t * @param [optional] usesCycle Defines whether the node uses the cycleDuration property in the shader to calculate the period of animation independent of particle duration. Defaults to false.\n\t * @param [optional] usesPhase Defines whether the node uses the cyclePhase property in the shader to calculate a starting offset to the animation cycle. Defaults to false.\n\t * @param [optional] minScale Defines the default min scale transform of the node, when in global mode. Defaults to 1.\n\t * @param [optional] maxScale Defines the default max color transform of the node, when in global mode. Defaults to 1.\n\t * @param [optional] cycleDuration Defines the default duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1.\n\t * @param [optional] cyclePhase Defines the default phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0.\n\t */\n\tconstructor(mode:number /*uint*/, usesCycle:boolean, usesPhase:boolean, minScale:number = 1, maxScale:number = 1, cycleDuration:number = 1, cyclePhase:number = 0)\n\t{\n\t\tsuper(\"ParticleScale\", mode, (usesCycle && usesPhase)? 4 : ((usesCycle || usesPhase)? 3 : 2), 3);\n\n\t\tthis._pStateClass = ParticleScaleState;\n\n\t\tthis._iUsesCycle = usesCycle;\n\t\tthis._iUsesPhase = usesPhase;\n\n\t\tthis._iMinScale = minScale;\n\t\tthis._iMaxScale = maxScale;\n\t\tthis._iCycleDuration = cycleDuration;\n\t\tthis._iCyclePhase = cyclePhase;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string\n\t{\n\t\tvar code:string = \"\";\n\t\tvar temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexSingleTemp();\n\n\t\tvar scaleRegister:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute();\n\t\tanimationRegisterCache.setRegisterIndex(this, ParticleScaleState.SCALE_INDEX, scaleRegister.index);\n\n\t\tif (this._iUsesCycle) {\n\t\t\tcode += \"mul \" + temp + \",\" + animationRegisterCache.vertexTime + \",\" + scaleRegister + \".z\\n\";\n\n\t\t\tif (this._iUsesPhase)\n\t\t\t\tcode += \"add \" + temp + \",\" + temp + \",\" + scaleRegister + \".w\\n\";\n\n\t\t\tcode += \"sin \" + temp + \",\" + temp + \"\\n\";\n\t\t}\n\n\t\tcode += \"mul \" + temp + \",\" + scaleRegister + \".y,\" + ((this._iUsesCycle)? temp : animationRegisterCache.vertexLife) + \"\\n\";\n\t\tcode += \"add \" + temp + \",\" + scaleRegister + \".x,\" + temp + \"\\n\";\n\t\tcode += \"mul \" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + temp + \"\\n\";\n\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAnimationState(animator:AnimatorBase):ParticleScaleState\n\t{\n\t\treturn animator.getAnimationState(this);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iGeneratePropertyOfOneParticle(param:ParticleProperties)\n\t{\n\t\tvar scale:Vector3D = param[ParticleScaleNode.SCALE_VECTOR3D];\n\t\tif (!scale)\n\t\t\tthrow(new Error(\"there is no \" + ParticleScaleNode.SCALE_VECTOR3D + \" in param!\"));\n\n\t\tif (this._iUsesCycle) {\n\t\t\tthis._pOneData[0] = (scale.x + scale.y)/2;\n\t\t\tthis._pOneData[1] = Math.abs(scale.x - scale.y)/2;\n\t\t\tif (scale.z <= 0)\n\t\t\t\tthrow(new Error(\"the cycle duration must be greater than zero\"));\n\t\t\tthis._pOneData[2] = Math.PI*2/scale.z;\n\t\t\tif (this._iUsesPhase)\n\t\t\t\tthis._pOneData[3] = scale.w*Math.PI/180;\n\t\t} else {\n\t\t\tthis._pOneData[0] = scale.x;\n\t\t\tthis._pOneData[1] = scale.y - scale.x;\n\t\t}\n\t}\n}\n\nexport = ParticleScaleNode;", + "import ColorTransform\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/ColorTransform\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\n\nimport ParticleAnimationSet\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimationSet\");\nimport ColorSegmentPoint\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ColorSegmentPoint\");\nimport ParticleProperties\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleProperties\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleNodeBase\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase\");\nimport ParticleSegmentedColorState\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleSegmentedColorState\");\n\n/**\n *\n */\nclass ParticleSegmentedColorNode extends ParticleNodeBase\n{\n\t/** @private */\n\tpublic _iUsesMultiplier:boolean;\n\t/** @private */\n\tpublic _iUsesOffset:boolean;\n\t/** @private */\n\tpublic _iStartColor:ColorTransform;\n\t/** @private */\n\tpublic _iEndColor:ColorTransform;\n\t/** @private */\n\tpublic _iNumSegmentPoint:number /*int*/;\n\t/** @private */\n\tpublic _iSegmentPoints:Array;\n\n\tconstructor(usesMultiplier:boolean, usesOffset:boolean, numSegmentPoint:number /*int*/, startColor:ColorTransform, endColor:ColorTransform, segmentPoints:Array)\n\t{\n\t\t//because of the stage3d register limitation, it only support the global mode\n\t\tsuper(\"ParticleSegmentedColor\", ParticlePropertiesMode.GLOBAL, 0, ParticleAnimationSet.COLOR_PRIORITY);\n\n\t\tthis._pStateClass = ParticleSegmentedColorState;\n\n\t\tif (numSegmentPoint > 4)\n\t\t\tthrow(new Error(\"the numSegmentPoint must be less or equal 4\"));\n\t\tthis._iUsesMultiplier = usesMultiplier;\n\t\tthis._iUsesOffset = usesOffset;\n\t\tthis._iNumSegmentPoint = numSegmentPoint;\n\t\tthis._iStartColor = startColor;\n\t\tthis._iEndColor = endColor;\n\t\tthis._iSegmentPoints = segmentPoints;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iProcessAnimationSetting(particleAnimationSet:ParticleAnimationSet)\n\t{\n\t\tif (this._iUsesMultiplier)\n\t\t\tparticleAnimationSet.hasColorMulNode = true;\n\t\tif (this._iUsesOffset)\n\t\t\tparticleAnimationSet.hasColorAddNode = true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string\n\t{\n\t\tvar code:string = \"\";\n\t\tif (animationRegisterCache.needFragmentAnimation) {\n\t\t\tvar accMultiplierColor:ShaderRegisterElement;\n\t\t\t//var accOffsetColor:ShaderRegisterElement;\n\t\t\tif (this._iUsesMultiplier) {\n\t\t\t\taccMultiplierColor = animationRegisterCache.getFreeVertexVectorTemp();\n\t\t\t\tanimationRegisterCache.addVertexTempUsages(accMultiplierColor, 1);\n\t\t\t}\n\n\t\t\tvar tempColor:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\t\tanimationRegisterCache.addVertexTempUsages(tempColor, 1);\n\n\t\t\tvar temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\t\tvar accTime:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 0);\n\t\t\tvar tempTime:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 1);\n\n\t\t\tif (this._iUsesMultiplier)\n\t\t\t\tanimationRegisterCache.removeVertexTempUsage(accMultiplierColor);\n\n\t\t\tanimationRegisterCache.removeVertexTempUsage(tempColor);\n\n\t\t\t//for saving all the life values (at most 4)\n\t\t\tvar lifeTimeRegister:ShaderRegisterElement = animationRegisterCache.getFreeVertexConstant();\n\t\t\tanimationRegisterCache.setRegisterIndex(this, ParticleSegmentedColorState.TIME_DATA_INDEX, lifeTimeRegister.index);\n\n\t\t\tvar i:number /*int*/;\n\n\t\t\tvar startMulValue:ShaderRegisterElement;\n\t\t\tvar deltaMulValues:Array;\n\t\t\tif (this._iUsesMultiplier) {\n\t\t\t\tstartMulValue = animationRegisterCache.getFreeVertexConstant();\n\t\t\t\tanimationRegisterCache.setRegisterIndex(this, ParticleSegmentedColorState.START_MULTIPLIER_INDEX, startMulValue.index);\n\t\t\t\tdeltaMulValues = new Array();\n\t\t\t\tfor (i = 0; i < this._iNumSegmentPoint + 1; i++)\n\t\t\t\t\tdeltaMulValues.push(animationRegisterCache.getFreeVertexConstant());\n\t\t\t}\n\n\t\t\tvar startOffsetValue:ShaderRegisterElement;\n\t\t\tvar deltaOffsetValues:Array;\n\t\t\tif (this._iUsesOffset) {\n\t\t\t\tstartOffsetValue = animationRegisterCache.getFreeVertexConstant();\n\t\t\t\tanimationRegisterCache.setRegisterIndex(this, ParticleSegmentedColorState.START_OFFSET_INDEX, startOffsetValue.index);\n\t\t\t\tdeltaOffsetValues = new Array();\n\t\t\t\tfor (i = 0; i < this._iNumSegmentPoint + 1; i++)\n\t\t\t\t\tdeltaOffsetValues.push(animationRegisterCache.getFreeVertexConstant());\n\t\t\t}\n\n\t\t\tif (this._iUsesMultiplier)\n\t\t\t\tcode += \"mov \" + accMultiplierColor + \",\" + startMulValue + \"\\n\";\n\t\t\tif (this._iUsesOffset)\n\t\t\t\tcode += \"add \" + animationRegisterCache.colorAddTarget + \",\" + animationRegisterCache.colorAddTarget + \",\" + startOffsetValue + \"\\n\";\n\n\t\t\tfor (i = 0; i < this._iNumSegmentPoint; i++) {\n\t\t\t\tswitch (i) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\tcode += \"min \" + tempTime + \",\" + animationRegisterCache.vertexLife + \",\" + lifeTimeRegister + \".x\\n\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tcode += \"sub \" + accTime + \",\" + animationRegisterCache.vertexLife + \",\" + lifeTimeRegister + \".x\\n\";\n\t\t\t\t\t\tcode += \"max \" + tempTime + \",\" + accTime + \",\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\t\t\t\tcode += \"min \" + tempTime + \",\" + tempTime + \",\" + lifeTimeRegister + \".y\\n\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tcode += \"sub \" + accTime + \",\" + accTime + \",\" + lifeTimeRegister + \".y\\n\";\n\t\t\t\t\t\tcode += \"max \" + tempTime + \",\" + accTime + \",\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\t\t\t\tcode += \"min \" + tempTime + \",\" + tempTime + \",\" + lifeTimeRegister + \".z\\n\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tcode += \"sub \" + accTime + \",\" + accTime + \",\" + lifeTimeRegister + \".z\\n\";\n\t\t\t\t\t\tcode += \"max \" + tempTime + \",\" + accTime + \",\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\t\t\t\tcode += \"min \" + tempTime + \",\" + tempTime + \",\" + lifeTimeRegister + \".w\\n\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (this._iUsesMultiplier) {\n\t\t\t\t\tcode += \"mul \" + tempColor + \",\" + tempTime + \",\" + deltaMulValues[i] + \"\\n\";\n\t\t\t\t\tcode += \"add \" + accMultiplierColor + \",\" + accMultiplierColor + \",\" + tempColor + \"\\n\";\n\t\t\t\t}\n\t\t\t\tif (this._iUsesOffset) {\n\t\t\t\t\tcode += \"mul \" + tempColor + \",\" + tempTime + \",\" + deltaOffsetValues[i] + \"\\n\";\n\t\t\t\t\tcode += \"add \" + animationRegisterCache.colorAddTarget + \",\" + animationRegisterCache.colorAddTarget + \",\" + tempColor + \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//for the last segment:\n\t\t\tif (this._iNumSegmentPoint == 0)\n\t\t\t\ttempTime = animationRegisterCache.vertexLife;\n\t\t\telse {\n\t\t\t\tswitch (this._iNumSegmentPoint) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tcode += \"sub \" + accTime + \",\" + animationRegisterCache.vertexLife + \",\" + lifeTimeRegister + \".x\\n\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tcode += \"sub \" + accTime + \",\" + accTime + \",\" + lifeTimeRegister + \".y\\n\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tcode += \"sub \" + accTime + \",\" + accTime + \",\" + lifeTimeRegister + \".z\\n\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\tcode += \"sub \" + accTime + \",\" + accTime + \",\" + lifeTimeRegister + \".w\\n\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcode += \"max \" + tempTime + \",\" + accTime + \",\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\t\t}\n\t\t\tif (this._iUsesMultiplier) {\n\t\t\t\tcode += \"mul \" + tempColor + \",\" + tempTime + \",\" + deltaMulValues[this._iNumSegmentPoint] + \"\\n\";\n\t\t\t\tcode += \"add \" + accMultiplierColor + \",\" + accMultiplierColor + \",\" + tempColor + \"\\n\";\n\t\t\t\tcode += \"mul \" + animationRegisterCache.colorMulTarget + \",\" + animationRegisterCache.colorMulTarget + \",\" + accMultiplierColor + \"\\n\";\n\t\t\t}\n\t\t\tif (this._iUsesOffset) {\n\t\t\t\tcode += \"mul \" + tempColor + \",\" + tempTime + \",\" + deltaOffsetValues[this._iNumSegmentPoint] + \"\\n\";\n\t\t\t\tcode += \"add \" + animationRegisterCache.colorAddTarget + \",\" + animationRegisterCache.colorAddTarget + \",\" + tempColor + \"\\n\";\n\t\t\t}\n\n\t\t}\n\t\treturn code;\n\t}\n\n}\n\nexport = ParticleSegmentedColorNode;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\n\nimport ParticleAnimationSet\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimationSet\");\nimport ParticleProperties\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleProperties\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleNodeBase\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase\");\nimport ParticleSpriteSheetState\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleSpriteSheetState\");\n\n/**\n * A particle animation node used when a spritesheet texture is required to animate the particle.\n * NB: to enable use of this node, the repeat property on the material has to be set to true.\n */\nclass ParticleSpriteSheetNode extends ParticleNodeBase\n{\n\t/** @private */\n\tpublic _iUsesCycle:boolean;\n\n\t/** @private */\n\tpublic _iUsesPhase:boolean;\n\n\t/** @private */\n\tpublic _iTotalFrames:number /*int*/;\n\t/** @private */\n\tpublic _iNumColumns:number /*int*/;\n\t/** @private */\n\tpublic _iNumRows:number /*int*/;\n\t/** @private */\n\tpublic _iCycleDuration:number;\n\t/** @private */\n\tpublic _iCyclePhase:number;\n\n\t/**\n\t * Reference for spritesheet node properties on a single particle (when in local property mode).\n\t * Expects a Vector3D representing the cycleDuration (x), optional phaseTime (y).\n\t */\n\tpublic static UV_VECTOR3D:string = \"UVVector3D\";\n\n\t/**\n\t * Defines the number of columns in the spritesheet, when in global mode. Defaults to 1. Read only.\n\t */\n\tpublic get numColumns():number\n\t{\n\t\treturn this._iNumColumns;\n\t}\n\n\t/**\n\t * Defines the number of rows in the spritesheet, when in global mode. Defaults to 1. Read only.\n\t */\n\tpublic get numRows():number\n\t{\n\t\treturn this._iNumRows;\n\t}\n\n\t/**\n\t * Defines the total number of frames used by the spritesheet, when in global mode. Defaults to the number defined by numColumns and numRows. Read only.\n\t */\n\tpublic get totalFrames():number\n\t{\n\t\treturn this._iTotalFrames;\n\t}\n\n\t/**\n\t * Creates a new ParticleSpriteSheetNode\n\t *\n\t * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node.\n\t * @param [optional] numColumns Defines the number of columns in the spritesheet, when in global mode. Defaults to 1.\n\t * @param [optional] numRows Defines the number of rows in the spritesheet, when in global mode. Defaults to 1.\n\t * @param [optional] cycleDuration Defines the default cycle duration in seconds, when in global mode. Defaults to 1.\n\t * @param [optional] cyclePhase Defines the default cycle phase, when in global mode. Defaults to 0.\n\t * @param [optional] totalFrames Defines the total number of frames used by the spritesheet, when in global mode. Defaults to the number defined by numColumns and numRows.\n\t * @param [optional] looping Defines whether the spritesheet animation is set to loop indefinitely. Defaults to true.\n\t */\n\tconstructor(mode:number /*uint*/, usesCycle:boolean, usesPhase:boolean, numColumns:number /*int*/ = 1, numRows:number /*uint*/ = 1, cycleDuration:number = 1, cyclePhase:number = 0, totalFrames:number /*uint*/ = Number.MAX_VALUE)\n\t{\n\t\tsuper(\"ParticleSpriteSheet\", mode, usesCycle? (usesPhase? 3 : 2) : 1, ParticleAnimationSet.POST_PRIORITY + 1);\n\n\t\tthis._pStateClass = ParticleSpriteSheetState;\n\n\t\tthis._iUsesCycle = usesCycle;\n\t\tthis._iUsesPhase = usesPhase;\n\n\t\tthis._iNumColumns = numColumns;\n\t\tthis._iNumRows = numRows;\n\t\tthis._iCyclePhase = cyclePhase;\n\t\tthis._iCycleDuration = cycleDuration;\n\t\tthis._iTotalFrames = Math.min(totalFrames, numColumns*numRows);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALUVCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string\n\t{\n\t\t//get 2 vc\n\t\tvar uvParamConst1:ShaderRegisterElement = animationRegisterCache.getFreeVertexConstant();\n\t\tvar uvParamConst2:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute();\n\t\tanimationRegisterCache.setRegisterIndex(this, ParticleSpriteSheetState.UV_INDEX_0, uvParamConst1.index);\n\t\tanimationRegisterCache.setRegisterIndex(this, ParticleSpriteSheetState.UV_INDEX_1, uvParamConst2.index);\n\n\t\tvar uTotal:ShaderRegisterElement = new ShaderRegisterElement(uvParamConst1.regName, uvParamConst1.index, 0);\n\t\tvar uStep:ShaderRegisterElement = new ShaderRegisterElement(uvParamConst1.regName, uvParamConst1.index, 1);\n\t\tvar vStep:ShaderRegisterElement = new ShaderRegisterElement(uvParamConst1.regName, uvParamConst1.index, 2);\n\n\t\tvar uSpeed:ShaderRegisterElement = new ShaderRegisterElement(uvParamConst2.regName, uvParamConst2.index, 0);\n\t\tvar cycle:ShaderRegisterElement = new ShaderRegisterElement(uvParamConst2.regName, uvParamConst2.index, 1);\n\t\tvar phaseTime:ShaderRegisterElement = new ShaderRegisterElement(uvParamConst2.regName, uvParamConst2.index, 2);\n\n\t\tvar temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\tvar time:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 0);\n\t\tvar vOffset:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 1);\n\t\ttemp = new ShaderRegisterElement(temp.regName, temp.index, 2);\n\t\tvar temp2:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 3);\n\n\t\tvar u:ShaderRegisterElement = new ShaderRegisterElement(animationRegisterCache.uvTarget.regName, animationRegisterCache.uvTarget.index, 0);\n\t\tvar v:ShaderRegisterElement = new ShaderRegisterElement(animationRegisterCache.uvTarget.regName, animationRegisterCache.uvTarget.index, 1);\n\n\t\tvar code:string = \"\";\n\t\t//scale uv\n\t\tcode += \"mul \" + u + \",\" + u + \",\" + uStep + \"\\n\";\n\t\tif (this._iNumRows > 1)\n\t\t\tcode += \"mul \" + v + \",\" + v + \",\" + vStep + \"\\n\";\n\n\t\tif (this._iUsesCycle) {\n\t\t\tif (this._iUsesPhase)\n\t\t\t\tcode += \"add \" + time + \",\" + animationRegisterCache.vertexTime + \",\" + phaseTime + \"\\n\";\n\t\t\telse\n\t\t\t\tcode += \"mov \" + time + \",\" + animationRegisterCache.vertexTime + \"\\n\";\n\t\t\tcode += \"div \" + time + \",\" + time + \",\" + cycle + \"\\n\";\n\t\t\tcode += \"frc \" + time + \",\" + time + \"\\n\";\n\t\t\tcode += \"mul \" + time + \",\" + time + \",\" + cycle + \"\\n\";\n\t\t\tcode += \"mul \" + temp + \",\" + time + \",\" + uSpeed + \"\\n\";\n\t\t} else\n\t\t\tcode += \"mul \" + temp.toString() + \",\" + animationRegisterCache.vertexLife + \",\" + uTotal + \"\\n\";\n\n\t\tif (this._iNumRows > 1) {\n\t\t\tcode += \"frc \" + temp2 + \",\" + temp + \"\\n\";\n\t\t\tcode += \"sub \" + vOffset + \",\" + temp + \",\" + temp2 + \"\\n\";\n\t\t\tcode += \"mul \" + vOffset + \",\" + vOffset + \",\" + vStep + \"\\n\";\n\t\t\tcode += \"add \" + v + \",\" + v + \",\" + vOffset + \"\\n\";\n\t\t}\n\n\t\tcode += \"div \" + temp2 + \",\" + temp + \",\" + uStep + \"\\n\";\n\t\tcode += \"frc \" + temp + \",\" + temp2 + \"\\n\";\n\t\tcode += \"sub \" + temp2 + \",\" + temp2 + \",\" + temp + \"\\n\";\n\t\tcode += \"mul \" + temp + \",\" + temp2 + \",\" + uStep + \"\\n\";\n\n\t\tif (this._iNumRows > 1)\n\t\t\tcode += \"frc \" + temp + \",\" + temp + \"\\n\";\n\t\tcode += \"add \" + u + \",\" + u + \",\" + temp + \"\\n\";\n\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAnimationState(animator:AnimatorBase):ParticleSpriteSheetState\n\t{\n\t\treturn animator.getAnimationState(this);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iProcessAnimationSetting(particleAnimationSet:ParticleAnimationSet)\n\t{\n\t\tparticleAnimationSet.hasUVNode = true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iGeneratePropertyOfOneParticle(param:ParticleProperties)\n\t{\n\t\tif (this._iUsesCycle) {\n\t\t\tvar uvCycle:Vector3D = param[ParticleSpriteSheetNode.UV_VECTOR3D];\n\t\t\tif (!uvCycle)\n\t\t\t\tthrow(new Error(\"there is no \" + ParticleSpriteSheetNode.UV_VECTOR3D + \" in param!\"));\n\t\t\tif (uvCycle.x <= 0)\n\t\t\t\tthrow(new Error(\"the cycle duration must be greater than zero\"));\n\t\t\tvar uTotal:number = this._iTotalFrames/this._iNumColumns;\n\t\t\tthis._pOneData[0] = uTotal/uvCycle.x;\n\t\t\tthis._pOneData[1] = uvCycle.x;\n\t\t\tif (this._iUsesPhase)\n\t\t\t\tthis._pOneData[2] = uvCycle.y;\n\t\t}\n\t}\n}\n\nexport = ParticleSpriteSheetNode;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\n\nimport ParticleProperties\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleProperties\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleNodeBase\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase\");\nimport ParticleTimeState\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleTimeState\");\n\n/**\n * A particle animation node used as the base node for timekeeping inside a particle. Automatically added to a particle animation set on instatiation.\n */\nclass ParticleTimeNode extends ParticleNodeBase\n{\n\t/** @private */\n\tpublic _iUsesDuration:boolean;\n\t/** @private */\n\tpublic _iUsesDelay:boolean;\n\t/** @private */\n\tpublic _iUsesLooping:boolean;\n\n\t/**\n\t * Creates a new ParticleTimeNode\n\t *\n\t * @param [optional] usesDuration Defines whether the node uses the duration data in the static properties to determine how long a particle is visible for. Defaults to false.\n\t * @param [optional] usesDelay Defines whether the node uses the delay data in the static properties to determine how long a particle is hidden for. Defaults to false. Requires usesDuration to be true.\n\t * @param [optional] usesLooping Defines whether the node creates a looping timeframe for each particle determined by the startTime, duration and delay data in the static properties function. Defaults to false. Requires usesLooping to be true.\n\t */\n\tconstructor(usesDuration:boolean = false, usesLooping:boolean = false, usesDelay:boolean = false)\n\t{\n\t\tthis._pStateClass = ParticleTimeState;\n\n\t\tthis._iUsesDuration = usesDuration;\n\t\tthis._iUsesLooping = usesLooping;\n\t\tthis._iUsesDelay = usesDelay;\n\n\t\tsuper(\"ParticleTime\", ParticlePropertiesMode.LOCAL_STATIC, 4, 0);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string\n\t{\n\t\tvar timeStreamRegister:ShaderRegisterElement = animationRegisterCache.getFreeVertexAttribute(); //timeStreamRegister.x is start,timeStreamRegister.y is during time\n\t\tanimationRegisterCache.setRegisterIndex(this, ParticleTimeState.TIME_STREAM_INDEX, timeStreamRegister.index);\n\t\tvar timeConst:ShaderRegisterElement = animationRegisterCache.getFreeVertexConstant();\n\t\tanimationRegisterCache.setRegisterIndex(this, ParticleTimeState.TIME_CONSTANT_INDEX, timeConst.index);\n\n\t\tvar code:string = \"\";\n\t\tcode += \"sub \" + animationRegisterCache.vertexTime + \",\" + timeConst + \",\" + timeStreamRegister + \".x\\n\";\n\t\t//if time=0,set the position to zero.\n\t\tvar temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexSingleTemp();\n\t\tcode += \"sge \" + temp + \",\" + animationRegisterCache.vertexTime + \",\" + animationRegisterCache.vertexZeroConst + \"\\n\";\n\t\tcode += \"mul \" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + temp + \"\\n\";\n\t\tif (this._iUsesDuration) {\n\t\t\tif (this._iUsesLooping) {\n\t\t\t\tvar div:ShaderRegisterElement = animationRegisterCache.getFreeVertexSingleTemp();\n\t\t\t\tif (this._iUsesDelay) {\n\t\t\t\t\tcode += \"div \" + div + \",\" + animationRegisterCache.vertexTime + \",\" + timeStreamRegister + \".z\\n\";\n\t\t\t\t\tcode += \"frc \" + div + \",\" + div + \"\\n\";\n\t\t\t\t\tcode += \"mul \" + animationRegisterCache.vertexTime + \",\" + div + \",\" + timeStreamRegister + \".z\\n\";\n\t\t\t\t\tcode += \"slt \" + div + \",\" + animationRegisterCache.vertexTime + \",\" + timeStreamRegister + \".y\\n\";\n\t\t\t\t\tcode += \"mul \" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + div + \"\\n\";\n\t\t\t\t} else {\n\t\t\t\t\tcode += \"mul \" + div + \",\" + animationRegisterCache.vertexTime + \",\" + timeStreamRegister + \".w\\n\";\n\t\t\t\t\tcode += \"frc \" + div + \",\" + div + \"\\n\";\n\t\t\t\t\tcode += \"mul \" + animationRegisterCache.vertexTime + \",\" + div + \",\" + timeStreamRegister + \".y\\n\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar sge:ShaderRegisterElement = animationRegisterCache.getFreeVertexSingleTemp();\n\t\t\t\tcode += \"sge \" + sge + \",\" + timeStreamRegister + \".y,\" + animationRegisterCache.vertexTime + \"\\n\";\n\t\t\t\tcode += \"mul \" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + animationRegisterCache.scaleAndRotateTarget + \".xyz,\" + sge + \"\\n\";\n\t\t\t}\n\t\t}\n\t\tcode += \"mul \" + animationRegisterCache.vertexLife + \",\" + animationRegisterCache.vertexTime + \",\" + timeStreamRegister + \".w\\n\";\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAnimationState(animator:AnimatorBase):ParticleTimeState\n\t{\n\t\treturn animator.getAnimationState(this);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iGeneratePropertyOfOneParticle(param:ParticleProperties)\n\t{\n\t\tthis._pOneData[0] = param.startTime;\n\t\tthis._pOneData[1] = param.duration;\n\t\tthis._pOneData[2] = param.delay + param.duration;\n\t\tthis._pOneData[3] = 1/param.duration;\n\n\t}\n}\n\nexport = ParticleTimeNode;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\n\nimport ParticleAnimationSet\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimationSet\");\nimport ParticleProperties\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleProperties\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleNodeBase\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase\");\nimport ParticleUVState\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleUVState\");\n\n/**\n * A particle animation node used to control the UV offset and scale of a particle over time.\n */\nclass ParticleUVNode extends ParticleNodeBase\n{\n\t/** @private */\n\tpublic _iUvData:Vector3D;\n\n\t/**\n\t *\n\t */\n\tpublic static U_AXIS:string = \"x\";\n\n\t/**\n\t *\n\t */\n\tpublic static V_AXIS:string = \"y\";\n\n\tprivate _cycle:number;\n\tprivate _scale:number;\n\tprivate _axis:string;\n\n\t/**\n\t * Creates a new ParticleTimeNode\n\t *\n\t * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node.\n\t * @param [optional] cycle Defines whether the time track is in loop mode. Defaults to false.\n\t * @param [optional] scale Defines whether the time track is in loop mode. Defaults to false.\n\t * @param [optional] axis Defines whether the time track is in loop mode. Defaults to false.\n\t */\n\tconstructor(mode:number /*uint*/, cycle:number = 1, scale:number = 1, axis:string = \"x\")\n\t{\n\t\t//because of the stage3d register limitation, it only support the global mode\n\t\tsuper(\"ParticleUV\", ParticlePropertiesMode.GLOBAL, 4, ParticleAnimationSet.POST_PRIORITY + 1);\n\n\t\tthis._pStateClass = ParticleUVState;\n\n\t\tthis._cycle = cycle;\n\t\tthis._scale = scale;\n\t\tthis._axis = axis;\n\n\t\tthis.updateUVData();\n\t}\n\n\t/**\n\t *\n\t */\n\tpublic get cycle():number\n\t{\n\t\treturn this._cycle;\n\t}\n\n\tpublic set cycle(value:number)\n\t{\n\t\tthis._cycle = value;\n\n\t\tthis.updateUVData();\n\t}\n\n\t/**\n\t *\n\t */\n\tpublic get scale():number\n\t{\n\t\treturn this._scale;\n\t}\n\n\tpublic set scale(value:number)\n\t{\n\t\tthis._scale = value;\n\n\t\tthis.updateUVData();\n\t}\n\n\t/**\n\t *\n\t */\n\tpublic get axis():string\n\t{\n\t\treturn this._axis;\n\t}\n\n\tpublic set axis(value:string)\n\t{\n\t\tthis._axis = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALUVCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string\n\t{\n\t\tvar code:string = \"\";\n\n\t\tvar uvConst:ShaderRegisterElement = animationRegisterCache.getFreeVertexConstant();\n\t\tanimationRegisterCache.setRegisterIndex(this, ParticleUVState.UV_INDEX, uvConst.index);\n\n\t\tvar axisIndex:number = this._axis == \"x\"? 0 : (this._axis == \"y\"? 1 : 2);\n\n\t\tvar target:ShaderRegisterElement = new ShaderRegisterElement(animationRegisterCache.uvTarget.regName, animationRegisterCache.uvTarget.index, axisIndex);\n\n\t\tvar sin:ShaderRegisterElement = animationRegisterCache.getFreeVertexSingleTemp();\n\n\t\tif (this._scale != 1)\n\t\t\tcode += \"mul \" + target + \",\" + target + \",\" + uvConst + \".y\\n\";\n\n\t\tcode += \"mul \" + sin + \",\" + animationRegisterCache.vertexTime + \",\" + uvConst + \".x\\n\";\n\t\tcode += \"sin \" + sin + \",\" + sin + \"\\n\";\n\t\tcode += \"add \" + target + \",\" + target + \",\" + sin + \"\\n\";\n\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAnimationState(animator:AnimatorBase):ParticleUVState\n\t{\n\t\treturn animator.getAnimationState(this);\n\t}\n\n\tprivate updateUVData()\n\t{\n\t\tthis._iUvData = new Vector3D(Math.PI*2/this._cycle, this._scale, 0, 0);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iProcessAnimationSetting(particleAnimationSet:ParticleAnimationSet)\n\t{\n\t\tparticleAnimationSet.hasUVNode = true;\n\t}\n}\n\nexport = ParticleUVNode;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\n\nimport ParticleProperties\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleProperties\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleNodeBase\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase\");\nimport ParticleVelocityState\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleVelocityState\");\n\n/**\n * A particle animation node used to set the starting velocity of a particle.\n */\nclass ParticleVelocityNode extends ParticleNodeBase\n{\n\t/** @private */\n\tpublic _iVelocity:Vector3D;\n\n\t/**\n\t * Reference for velocity node properties on a single particle (when in local property mode).\n\t * Expects a Vector3D object representing the direction of movement on the particle.\n\t */\n\tpublic static VELOCITY_VECTOR3D:string = \"VelocityVector3D\";\n\n\t/**\n\t * Creates a new ParticleVelocityNode\n\t *\n\t * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node.\n\t * @param [optional] velocity Defines the default velocity vector of the node, used when in global mode.\n\t */\n\tconstructor(mode:number /*uint*/, velocity:Vector3D = null)\n\t{\n\t\tsuper(\"ParticleVelocity\", mode, 3);\n\n\t\tthis._pStateClass = ParticleVelocityState;\n\n\t\tthis._iVelocity = velocity || new Vector3D();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string\n\t{\n\t\tvar velocityValue:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute();\n\t\tanimationRegisterCache.setRegisterIndex(this, ParticleVelocityState.VELOCITY_INDEX, velocityValue.index);\n\n\t\tvar distance:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp();\n\t\tvar code:string = \"\";\n\t\tcode += \"mul \" + distance + \",\" + animationRegisterCache.vertexTime + \",\" + velocityValue + \"\\n\";\n\t\tcode += \"add \" + animationRegisterCache.positionTarget + \".xyz,\" + distance + \",\" + animationRegisterCache.positionTarget + \".xyz\\n\";\n\n\t\tif (animationRegisterCache.needVelocity)\n\t\t\tcode += \"add \" + animationRegisterCache.velocityTarget + \".xyz,\" + velocityValue + \".xyz,\" + animationRegisterCache.velocityTarget + \".xyz\\n\";\n\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAnimationState(animator:AnimatorBase):ParticleVelocityState\n\t{\n\t\treturn animator.getAnimationState(this);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iGeneratePropertyOfOneParticle(param:ParticleProperties)\n\t{\n\t\tvar _tempVelocity:Vector3D = param[ParticleVelocityNode.VELOCITY_VECTOR3D];\n\t\tif (!_tempVelocity)\n\t\t\tthrow new Error(\"there is no \" + ParticleVelocityNode.VELOCITY_VECTOR3D + \" in param!\");\n\n\t\tthis._pOneData[0] = _tempVelocity.x;\n\t\tthis._pOneData[1] = _tempVelocity.y;\n\t\tthis._pOneData[2] = _tempVelocity.z;\n\t}\n}\n\nexport = ParticleVelocityNode;", + "import AnimationNodeBase\t\t\t\t= require(\"awayjs-core/lib/animators/nodes/AnimationNodeBase\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\n\nimport SkeletonBinaryLERPState\t\t\t= require(\"awayjs-renderergl/lib/animators/states/SkeletonBinaryLERPState\");\n\n/**\n * A skeleton animation node that uses two animation node inputs to blend a lineraly interpolated output of a skeleton pose.\n */\nclass SkeletonBinaryLERPNode extends AnimationNodeBase\n{\n\t/**\n\t * Defines input node A to use for the blended output.\n\t */\n\tpublic inputA:AnimationNodeBase;\n\n\t/**\n\t * Defines input node B to use for the blended output.\n\t */\n\tpublic inputB:AnimationNodeBase;\n\n\t/**\n\t * Creates a new SkeletonBinaryLERPNode object.\n\t */\n\tconstructor()\n\t{\n\t\tsuper();\n\n\t\tthis._pStateClass = SkeletonBinaryLERPState;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAnimationState(animator:AnimatorBase):SkeletonBinaryLERPState\n\t{\n\t\treturn animator.getAnimationState(this);\n\t}\n}\n\nexport = SkeletonBinaryLERPNode;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\n\nimport SkeletonPose\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/SkeletonPose\");\nimport AnimationClipNodeBase\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/AnimationClipNodeBase\");\nimport SkeletonClipState\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/SkeletonClipState\");\n\n/**\n * A skeleton animation node containing time-based animation data as individual skeleton poses.\n */\nclass SkeletonClipNode extends AnimationClipNodeBase\n{\n\tprivate _frames:Array = new Array();\n\n\t/**\n\t * Determines whether to use SLERP equations (true) or LERP equations (false) in the calculation\n\t * of the output skeleton pose. Defaults to false.\n\t */\n\tpublic highQuality:boolean = false;\n\n\t/**\n\t * Returns a vector of skeleton poses representing the pose of each animation frame in the clip.\n\t */\n\tpublic get frames():Array\n\t{\n\t\treturn this._frames;\n\t}\n\n\t/**\n\t * Creates a new SkeletonClipNode object.\n\t */\n\tconstructor()\n\t{\n\t\tsuper();\n\n\t\tthis._pStateClass = SkeletonClipState;\n\t}\n\n\t/**\n\t * Adds a skeleton pose frame to the internal timeline of the animation node.\n\t *\n\t * @param skeletonPose The skeleton pose object to add to the timeline of the node.\n\t * @param duration The specified duration of the frame in milliseconds.\n\t */\n\tpublic addFrame(skeletonPose:SkeletonPose, duration:number /*number /*uint*/)\n\t{\n\t\tthis._frames.push(skeletonPose);\n\t\tthis._pDurations.push(duration);\n\n\t\tthis._pNumFrames = this._pDurations.length;\n\n\t\tthis._pStitchDirty = true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAnimationState(animator:AnimatorBase):SkeletonClipState\n\t{\n\t\treturn animator.getAnimationState(this);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pUpdateStitch()\n\t{\n\t\tsuper._pUpdateStitch();\n\n\t\tvar i:number /*uint*/ = this._pNumFrames - 1;\n\t\tvar p1:Vector3D, p2:Vector3D, delta:Vector3D;\n\t\twhile (i--) {\n\t\t\tthis._pTotalDuration += this._pDurations[i];\n\t\t\tp1 = this._frames[i].jointPoses[0].translation;\n\t\t\tp2 = this._frames[i + 1].jointPoses[0].translation;\n\t\t\tdelta = p2.subtract(p1);\n\t\t\tthis._pTotalDelta.x += delta.x;\n\t\t\tthis._pTotalDelta.y += delta.y;\n\t\t\tthis._pTotalDelta.z += delta.z;\n\t\t}\n\n\t\tif (this._pStitchFinalFrame || !this._pLooping) {\n\t\t\tthis._pTotalDuration += this._pDurations[this._pNumFrames - 1];\n\t\t\tp1 = this._frames[0].jointPoses[0].translation;\n\t\t\tp2 = this._frames[1].jointPoses[0].translation;\n\t\t\tdelta = p2.subtract(p1);\n\t\t\tthis._pTotalDelta.x += delta.x;\n\t\t\tthis._pTotalDelta.y += delta.y;\n\t\t\tthis._pTotalDelta.z += delta.z;\n\t\t}\n\t}\n}\n\nexport = SkeletonClipNode;", + "import AnimationNodeBase\t\t\t\t= require(\"awayjs-core/lib/animators/nodes/AnimationNodeBase\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\n\nimport SkeletonDifferenceState\t\t\t= require(\"awayjs-renderergl/lib/animators/states/SkeletonDifferenceState\");\n\n/**\n * A skeleton animation node that uses a difference input pose with a base input pose to blend a linearly interpolated output of a skeleton pose.\n */\nclass SkeletonDifferenceNode extends AnimationNodeBase\n{\n\t/**\n\t * Defines a base input node to use for the blended output.\n\t */\n\tpublic baseInput:AnimationNodeBase;\n\n\t/**\n\t * Defines a difference input node to use for the blended output.\n\t */\n\tpublic differenceInput:AnimationNodeBase;\n\n\t/**\n\t * Creates a new SkeletonAdditiveNode object.\n\t */\n\tconstructor()\n\t{\n\t\tsuper();\n\n\t\tthis._pStateClass = SkeletonDifferenceState;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAnimationState(animator:AnimatorBase):SkeletonDifferenceState\n\t{\n\t\treturn animator.getAnimationState(this);\n\t}\n}\n\nexport = SkeletonDifferenceNode", + "import AnimationNodeBase\t\t\t\t= require(\"awayjs-core/lib/animators/nodes/AnimationNodeBase\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\n\nimport SkeletonDirectionalState\t\t\t= require(\"awayjs-renderergl/lib/animators/states/SkeletonDirectionalState\");\n\n/**\n * A skeleton animation node that uses four directional input poses with an input direction to blend a linearly interpolated output of a skeleton pose.\n */\nclass SkeletonDirectionalNode extends AnimationNodeBase\n{\n\t/**\n\t * Defines the forward configured input node to use for the blended output.\n\t */\n\tpublic forward:AnimationNodeBase;\n\n\t/**\n\t * Defines the backwards configured input node to use for the blended output.\n\t */\n\tpublic backward:AnimationNodeBase;\n\n\t/**\n\t * Defines the left configured input node to use for the blended output.\n\t */\n\tpublic left:AnimationNodeBase;\n\n\t/**\n\t * Defines the right configured input node to use for the blended output.\n\t */\n\tpublic right:AnimationNodeBase;\n\n\tconstructor()\n\t{\n\t\tsuper();\n\n\t\tthis._pStateClass = SkeletonDirectionalState;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAnimationState(animator:AnimatorBase):SkeletonDirectionalState\n\t{\n\t\treturn animator.getAnimationState(this);\n\t}\n\n}\n\nexport = SkeletonDirectionalNode;", + "import AnimationNodeBase\t\t\t\t= require(\"awayjs-core/lib/animators/nodes/AnimationNodeBase\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\n\nimport SkeletonNaryLERPState\t\t\t= require(\"awayjs-renderergl/lib/animators/states/SkeletonNaryLERPState\");\n\n/**\n * A skeleton animation node that uses an n-dimensional array of animation node inputs to blend a lineraly interpolated output of a skeleton pose.\n */\nclass SkeletonNaryLERPNode extends AnimationNodeBase\n{\n\tpublic _iInputs:Array = new Array();\n\n\tprivate _numInputs:number /*uint*/;\n\n\tpublic get numInputs():number /*uint*/\n\t{\n\t\treturn this._numInputs;\n\t}\n\n\t/**\n\t * Creates a new SkeletonNaryLERPNode object.\n\t */\n\tconstructor()\n\t{\n\t\tsuper();\n\n\t\tthis._pStateClass = SkeletonNaryLERPState;\n\t}\n\n\t/**\n\t * Returns an integer representing the input index of the given skeleton animation node.\n\t *\n\t * @param input The skeleton animation node for with the input index is requested.\n\t */\n\tpublic getInputIndex(input:AnimationNodeBase):number /*int*/\n\t{\n\t\treturn this._iInputs.indexOf(input);\n\t}\n\n\t/**\n\t * Returns the skeleton animation node object that resides at the given input index.\n\t *\n\t * @param index The input index for which the skeleton animation node is requested.\n\t */\n\tpublic getInputAt(index:number /*uint*/):AnimationNodeBase\n\t{\n\t\treturn this._iInputs[index];\n\t}\n\n\t/**\n\t * Adds a new skeleton animation node input to the animation node.\n\t */\n\tpublic addInput(input:AnimationNodeBase)\n\t{\n\t\tthis._iInputs[this._numInputs++] = input;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getAnimationState(animator:AnimatorBase):SkeletonNaryLERPState\n\t{\n\t\treturn animator.getAnimationState(this);\n\t}\n}\n\nexport = SkeletonNaryLERPNode", + "import Geometry\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/base/Geometry\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\n\nimport AnimationClipNodeBase\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/AnimationClipNodeBase\");\nimport VertexClipState\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/VertexClipState\");\n\n/**\n * A vertex animation node containing time-based animation data as individual geometry obejcts.\n */\nclass VertexClipNode extends AnimationClipNodeBase\n{\n\tprivate _frames:Array = new Array();\n\tprivate _translations:Array = new Array();\n\n\t/**\n\t * Returns a vector of geometry frames representing the vertex values of each animation frame in the clip.\n\t */\n\tpublic get frames():Array\n\t{\n\t\treturn this._frames;\n\t}\n\n\t/**\n\t * Creates a new VertexClipNode object.\n\t */\n\tconstructor()\n\t{\n\t\tsuper();\n\n\t\tthis._pStateClass = VertexClipState;\n\t}\n\n\t/**\n\t * Adds a geometry object to the internal timeline of the animation node.\n\t *\n\t * @param geometry The geometry object to add to the timeline of the node.\n\t * @param duration The specified duration of the frame in milliseconds.\n\t * @param translation The absolute translation of the frame, used in root delta calculations for mesh movement.\n\t */\n\tpublic addFrame(geometry:Geometry, duration:number /*uint*/, translation:Vector3D = null)\n\t{\n\t\tthis._frames.push(geometry);\n\t\tthis._pDurations.push(duration);\n\t\tthis._translations.push(translation || new Vector3D());\n\n\t\tthis._pNumFrames = this._pDurations.length;\n\n\t\tthis._pStitchDirty = true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pUpdateStitch()\n\t{\n\t\tsuper._pUpdateStitch();\n\n\t\tvar i:number /*uint*/ = this._pNumFrames - 1;\n\t\tvar p1:Vector3D, p2:Vector3D, delta:Vector3D;\n\t\twhile (i--) {\n\t\t\tthis._pTotalDuration += this._pDurations[i];\n\t\t\tp1 = this._translations[i];\n\t\t\tp2 = this._translations[i + 1];\n\t\t\tdelta = p2.subtract(p1);\n\t\t\tthis._pTotalDelta.x += delta.x;\n\t\t\tthis._pTotalDelta.y += delta.y;\n\t\t\tthis._pTotalDelta.z += delta.z;\n\t\t}\n\n\t\tif (this._pNumFrames > 1 && (this._pStitchFinalFrame || !this._pLooping)) {\n\t\t\tthis._pTotalDuration += this._pDurations[this._pNumFrames - 1];\n\t\t\tp1 = this._translations[0];\n\t\t\tp2 = this._translations[1];\n\t\t\tdelta = p2.subtract(p1);\n\t\t\tthis._pTotalDelta.x += delta.x;\n\t\t\tthis._pTotalDelta.y += delta.y;\n\t\t\tthis._pTotalDelta.z += delta.z;\n\t\t}\n\t}\n}\n\nexport = VertexClipNode;", + "import AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\n\nimport AnimationClipNodeBase\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/AnimationClipNodeBase\");\nimport AnimationStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/AnimationStateBase\");\nimport AnimationStateEvent\t\t\t\t= require(\"awayjs-renderergl/lib/events/AnimationStateEvent\");\n\n/**\n *\n */\nclass AnimationClipState extends AnimationStateBase\n{\n\tprivate _animationClipNode:AnimationClipNodeBase;\n\tprivate _animationStatePlaybackComplete:AnimationStateEvent;\n\tpublic _pBlendWeight:number;\n\tpublic _pCurrentFrame:number /*uint*/;\n\tpublic _pNextFrame:number /*uint*/;\n\n\tpublic _pOldFrame:number /*uint*/;\n\tpublic _pTimeDir:number /*int*/;\n\tpublic _pFramesDirty:boolean = true;\n\n\t/**\n\t * Returns a fractional value between 0 and 1 representing the blending ratio of the current playhead position\n\t * between the current frame (0) and next frame (1) of the animation.\n\t *\n\t * @see #currentFrame\n\t * @see #nextFrame\n\t */\n\tpublic get blendWeight():number\n\t{\n\t\tif (this._pFramesDirty)\n\t\t\tthis._pUpdateFrames();\n\n\t\treturn this._pBlendWeight;\n\t}\n\n\t/**\n\t * Returns the current frame of animation in the clip based on the internal playhead position.\n\t */\n\tpublic get currentFrame():number /*uint*/\n\t{\n\t\tif (this._pFramesDirty)\n\t\t\tthis._pUpdateFrames();\n\n\t\treturn this._pCurrentFrame;\n\t}\n\n\t/**\n\t * Returns the next frame of animation in the clip based on the internal playhead position.\n\t */\n\tpublic get nextFrame():number /*uint*/\n\t{\n\t\tif (this._pFramesDirty)\n\t\t\tthis._pUpdateFrames();\n\n\t\treturn this._pNextFrame;\n\t}\n\n\tconstructor(animator:AnimatorBase, animationClipNode:AnimationClipNodeBase)\n\t{\n\t\tsuper(animator, animationClipNode);\n\n\t\tthis._animationClipNode = animationClipNode;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic update(time:number /*int*/)\n\t{\n\t\tif (!this._animationClipNode.looping) {\n\t\t\tif (time > this._pStartTime + this._animationClipNode.totalDuration)\n\t\t\t\ttime = this._pStartTime + this._animationClipNode.totalDuration; else if (time < this._pStartTime)\n\t\t\t\ttime = this._pStartTime;\n\t\t}\n\n\t\tif (this._pTime == time - this._pStartTime)\n\t\t\treturn;\n\n\t\tthis._pUpdateTime(time);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic phase(value:number)\n\t{\n\t\tvar time:number /*int*/ = value*this._animationClipNode.totalDuration + this._pStartTime;\n\n\t\tif (this._pTime == time - this._pStartTime)\n\t\t\treturn;\n\n\t\tthis._pUpdateTime(time);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pUpdateTime(time:number /*int*/)\n\t{\n\t\tthis._pFramesDirty = true;\n\n\t\tthis._pTimeDir = (time - this._pStartTime > this._pTime)? 1 : -1;\n\n\t\tsuper._pUpdateTime(time);\n\t}\n\n\t/**\n\t * Updates the nodes internal playhead to determine the current and next animation frame, and the blendWeight between the two.\n\t *\n\t * @see #currentFrame\n\t * @see #nextFrame\n\t * @see #blendWeight\n\t */\n\tpublic _pUpdateFrames()\n\t{\n\t\tthis._pFramesDirty = false;\n\n\t\tvar looping:boolean = this._animationClipNode.looping;\n\t\tvar totalDuration:number /*uint*/ = this._animationClipNode.totalDuration;\n\t\tvar lastFrame:number /*uint*/ = this._animationClipNode.lastFrame;\n\t\tvar time:number /*int*/ = this._pTime;\n\n\t\t//trace(\"time\", time, totalDuration)\n\t\tif (looping && (time >= totalDuration || time < 0)) {\n\t\t\ttime %= totalDuration;\n\t\t\tif (time < 0)\n\t\t\t\ttime += totalDuration;\n\t\t}\n\n\t\tif (!looping && time >= totalDuration) {\n\t\t\tthis.notifyPlaybackComplete();\n\t\t\tthis._pCurrentFrame = lastFrame;\n\t\t\tthis._pNextFrame = lastFrame;\n\t\t\tthis._pBlendWeight = 0;\n\t\t} else if (!looping && time <= 0) {\n\t\t\tthis._pCurrentFrame = 0;\n\t\t\tthis._pNextFrame = 0;\n\t\t\tthis._pBlendWeight = 0;\n\t\t} else if (this._animationClipNode.fixedFrameRate) {\n\t\t\tvar t:number = time/totalDuration*lastFrame;\n\t\t\tthis._pCurrentFrame = Math.floor(t);\n\t\t\tthis._pBlendWeight = t - this._pCurrentFrame;\n\t\t\tthis._pNextFrame = this._pCurrentFrame + 1;\n\t\t} else {\n\t\t\tthis._pCurrentFrame = 0;\n\t\t\tthis._pNextFrame = 0;\n\n\t\t\tvar dur:number /*uint*/ = 0, frameTime:number /*uint*/;\n\t\t\tvar durations:Array /*uint*/ = this._animationClipNode.durations;\n\n\t\t\tdo {\n\t\t\t\tframeTime = dur;\n\t\t\t\tdur += durations[this._pNextFrame];\n\t\t\t\tthis._pCurrentFrame = this._pNextFrame++;\n\t\t\t} while (time > dur);\n\n\t\t\tif (this._pCurrentFrame == lastFrame) {\n\t\t\t\tthis._pCurrentFrame = 0;\n\t\t\t\tthis._pNextFrame = 1;\n\t\t\t}\n\n\t\t\tthis._pBlendWeight = (time - frameTime)/durations[this._pCurrentFrame];\n\t\t}\n\t}\n\n\tprivate notifyPlaybackComplete()\n\t{\n\t\tif (this._animationStatePlaybackComplete == null)\n\t\t\tthis._animationStatePlaybackComplete = new AnimationStateEvent(AnimationStateEvent.PLAYBACK_COMPLETE, this._pAnimator, this, this._animationClipNode);\n\n\t\tthis._animationClipNode.dispatchEvent(this._animationStatePlaybackComplete);\n\t}\n}\n\nexport = AnimationClipState;", + "import AnimationNodeBase\t\t\t\t= require(\"awayjs-core/lib/animators/nodes/AnimationNodeBase\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport IAnimationState\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/states/IAnimationState\");\n\nimport AnimationStateEvent\t\t\t\t= require(\"awayjs-renderergl/lib/events/AnimationStateEvent\");\n\n/**\n *\n */\nclass AnimationStateBase implements IAnimationState\n{\n\tpublic _pAnimationNode:AnimationNodeBase;\n\tpublic _pRootDelta:Vector3D = new Vector3D();\n\tpublic _pPositionDeltaDirty:boolean = true;\n\n\tpublic _pTime:number;\n\tpublic _pStartTime:number = 0;\n\tpublic _pAnimator:AnimatorBase;\n\n\t/**\n\t * Returns a 3d vector representing the translation delta of the animating entity for the current timestep of animation\n\t */\n\tpublic get positionDelta():Vector3D\n\t{\n\t\tif (this._pPositionDeltaDirty) {\n\n\t\t\tthis._pUpdatePositionDelta();\n\t\t}\n\n\t\treturn this._pRootDelta;\n\n\t}\n\n\tconstructor(animator:AnimatorBase, animationNode:AnimationNodeBase)\n\t{\n\t\tthis._pAnimator = animator;\n\t\tthis._pAnimationNode = animationNode;\n\t}\n\n\t/**\n\t * Resets the start time of the node to a new value.\n\t *\n\t * @param startTime The absolute start time (in milliseconds) of the node's starting time.\n\t */\n\tpublic offset(startTime:number)\n\t{\n\t\tthis._pStartTime = startTime;\n\n\t\tthis._pPositionDeltaDirty = true;\n\t}\n\n\t/**\n\t * Updates the configuration of the node to its current state.\n\t *\n\t * @param time The absolute time (in milliseconds) of the animator's play head position.\n\t *\n\t * @see AnimatorBase#update()\n\t */\n\tpublic update(time:number)\n\t{\n\t\tif (this._pTime == time - this._pStartTime) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis._pUpdateTime(time);\n\n\t}\n\n\t/**\n\t * Sets the animation phase of the node.\n\t *\n\t * @param value The phase value to use. 0 represents the beginning of an animation clip, 1 represents the end.\n\t */\n\tpublic phase(value:number)\n\t{\n\n\t}\n\n\t/**\n\t * Updates the node's internal playhead position.\n\t *\n\t * @param time The local time (in milliseconds) of the node's playhead position.\n\t */\n\tpublic _pUpdateTime(time:number)\n\t{\n\t\tthis._pTime = time - this._pStartTime;\n\n\t\tthis._pPositionDeltaDirty = true;\n\t}\n\n\t/**\n\t * Updates the node's root delta position\n\t */\n\tpublic _pUpdatePositionDelta()\n\t{\n\t}\n}\n\nexport = AnimationStateBase;", + "import IAnimationState\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/states/IAnimationState\");\n\nimport Skeleton\t\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/Skeleton\");\nimport SkeletonPose\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/SkeletonPose\");\n\ninterface ISkeletonAnimationState extends IAnimationState\n{\n\t/**\n\t * Returns the output skeleton pose of the animation node.\n\t */\n\tgetSkeletonPose(skeleton:Skeleton):SkeletonPose;\n}\n\nexport = ISkeletonAnimationState;", + "import Geometry\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/base/Geometry\");\n\nimport IAnimationState\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/states/IAnimationState\");\n\n/**\n * Provides an interface for animation node classes that hold animation data for use in the Vertex animator class.\n *\n * @see away.animators.VertexAnimator\n */\ninterface IVertexAnimationState extends IAnimationState\n{\n\t/**\n\t * Returns the current geometry frame of animation in the clip based on the internal playhead position.\n\t */\n\tcurrentGeometry:Geometry; //GET\n\n\t/**\n\t * Returns the current geometry frame of animation in the clip based on the internal playhead position.\n\t */\n\tnextGeometry:Geometry; //GET\n\n\t/**\n\t * Returns a fractional value between 0 and 1 representing the blending ratio of the current playhead position\n\t * between the current geometry frame (0) and next geometry frame (1) of the animation.\n\t */\n\tblendWeight:number; //GET\n}\n\nexport = IVertexAnimationState;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport ContextGLVertexBufferFormat\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat\");\n\nimport ParticleAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimator\");\nimport AnimationSubGeometry\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/AnimationSubGeometry\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleAccelerationNode\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleAccelerationNode\");\nimport ParticleStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleStateBase\");\n\n/**\n * ...\n */\nclass ParticleAccelerationState extends ParticleStateBase\n{\n\t/** @private */\n\tpublic static ACCELERATION_INDEX:number /*int*/ = 0;\n\n\tprivate _particleAccelerationNode:ParticleAccelerationNode;\n\tprivate _acceleration:Vector3D;\n\tprivate _halfAcceleration:Vector3D;\n\t\n\t/**\n\t * Defines the acceleration vector of the state, used when in global mode.\n\t */\n\tpublic get acceleration():Vector3D\n\t{\n\t\treturn this._acceleration;\n\t}\n\t\n\tpublic set acceleration(value:Vector3D)\n\t{\n\t\tthis._acceleration.x = value.x;\n\t\tthis._acceleration.y = value.y;\n\t\tthis._acceleration.z = value.z;\n\n\t\tthis.updateAccelerationData();\n\t}\n\t\n\tconstructor(animator:ParticleAnimator, particleAccelerationNode:ParticleAccelerationNode)\n\t{\n\t\tsuper(animator, particleAccelerationNode);\n\n\t\tthis._particleAccelerationNode = particleAccelerationNode;\n\t\tthis._acceleration = this._particleAccelerationNode._acceleration;\n\n\t\tthis.updateAccelerationData();\n\t}\n\t\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera)\n\t{\n\t\tvar index:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleAccelerationState.ACCELERATION_INDEX);\n\t\t\n\t\tif (this._particleAccelerationNode.mode == ParticlePropertiesMode.LOCAL_STATIC)\n\t\t\tanimationSubGeometry.activateVertexBuffer(index, this._particleAccelerationNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3);\n\t\telse\n\t\t\tanimationRegisterCache.setVertexConst(index, this._halfAcceleration.x, this._halfAcceleration.y, this._halfAcceleration.z);\n\t}\n\t\n\tprivate updateAccelerationData()\n\t{\n\t\tif (this._particleAccelerationNode.mode == ParticlePropertiesMode.GLOBAL)\n\t\t\tthis._halfAcceleration = new Vector3D(this._acceleration.x/2, this._acceleration.y/2, this._acceleration.z/2);\n\t}\n}\n\nexport = ParticleAccelerationState;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport ContextGLVertexBufferFormat\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat\");\n\nimport ParticleAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimator\");\nimport AnimationSubGeometry\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/AnimationSubGeometry\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleBezierCurveNode\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleBezierCurveNode\");\nimport ParticleStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleStateBase\");\n\n/**\n * ...\n */\nclass ParticleBezierCurveState extends ParticleStateBase\n{\n\t/** @private */\n\tpublic static BEZIER_CONTROL_INDEX:number /*int*/ = 0;\n\n\t/** @private */\n\tpublic static BEZIER_END_INDEX:number /*int*/ = 1;\n\n\tprivate _particleBezierCurveNode:ParticleBezierCurveNode;\n\tprivate _controlPoint:Vector3D;\n\tprivate _endPoint:Vector3D;\n\n\t/**\n\t * Defines the default control point of the node, used when in global mode.\n\t */\n\tpublic get controlPoint():Vector3D\n\t{\n\t\treturn this._controlPoint;\n\t}\n\n\tpublic set controlPoint(value:Vector3D)\n\t{\n\t\tthis._controlPoint = value;\n\t}\n\n\t/**\n\t * Defines the default end point of the node, used when in global mode.\n\t */\n\tpublic get endPoint():Vector3D\n\t{\n\t\treturn this._endPoint;\n\t}\n\n\tpublic set endPoint(value:Vector3D)\n\t{\n\t\tthis._endPoint = value;\n\t}\n\n\tconstructor(animator:ParticleAnimator, particleBezierCurveNode:ParticleBezierCurveNode)\n\t{\n\t\tsuper(animator, particleBezierCurveNode);\n\n\t\tthis._particleBezierCurveNode = particleBezierCurveNode;\n\t\tthis._controlPoint = this._particleBezierCurveNode._iControlPoint;\n\t\tthis._endPoint = this._particleBezierCurveNode._iEndPoint;\n\t}\n\n\tpublic setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera)\n\t{\n\t\tvar controlIndex:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleBezierCurveState.BEZIER_CONTROL_INDEX);\n\t\tvar endIndex:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleBezierCurveState.BEZIER_END_INDEX);\n\n\t\tif (this._particleBezierCurveNode.mode == ParticlePropertiesMode.LOCAL_STATIC) {\n\t\t\tanimationSubGeometry.activateVertexBuffer(controlIndex, this._particleBezierCurveNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3);\n\t\t\tanimationSubGeometry.activateVertexBuffer(endIndex, this._particleBezierCurveNode._iDataOffset + 3, stage, ContextGLVertexBufferFormat.FLOAT_3);\n\t\t} else {\n\t\t\tanimationRegisterCache.setVertexConst(controlIndex, this._controlPoint.x, this._controlPoint.y, this._controlPoint.z);\n\t\t\tanimationRegisterCache.setVertexConst(endIndex, this._endPoint.x, this._endPoint.y, this._endPoint.z);\n\t\t}\n\t}\n}\n\nexport = ParticleBezierCurveState;", + "import MathConsts\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/MathConsts\");\nimport Matrix3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Matrix3D\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport Orientation3D\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Orientation3D\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport ContextGLVertexBufferFormat\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat\");\n\nimport ParticleAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimator\");\nimport AnimationSubGeometry\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/AnimationSubGeometry\");\nimport ParticleBillboardNode\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleBillboardNode\");\nimport ParticleStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleStateBase\");\n\n/**\n * ...\n */\nclass ParticleBillboardState extends ParticleStateBase\n{\n\t/** @private */\n\tpublic static MATRIX_INDEX:number /*int*/ = 0;\n\n\tprivate _matrix:Matrix3D = new Matrix3D;\n\n\tprivate _billboardAxis:Vector3D;\n\n\t/**\n\t *\n\t */\n\tconstructor(animator:ParticleAnimator, particleNode:ParticleBillboardNode)\n\t{\n\t\tsuper(animator, particleNode);\n\n\t\tthis._billboardAxis = particleNode._iBillboardAxis;\n\t}\n\n\tpublic setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera)\n\t{\n\t\tvar comps:Array;\n\t\tif (this._billboardAxis) {\n\t\t\tvar pos:Vector3D = renderable.sourceEntity.sceneTransform.position;\n\t\t\tvar look:Vector3D = camera.sceneTransform.position.subtract(pos);\n\t\t\tvar right:Vector3D = look.crossProduct(this._billboardAxis);\n\t\t\tright.normalize();\n\t\t\tlook = this.billboardAxis.crossProduct(right);\n\t\t\tlook.normalize();\n\n\t\t\t//create a quick inverse projection matrix\n\t\t\tthis._matrix.copyFrom(renderable.sourceEntity.sceneTransform);\n\t\t\tcomps = this._matrix.decompose(Orientation3D.AXIS_ANGLE);\n\t\t\tthis._matrix.copyColumnFrom(0, right);\n\t\t\tthis._matrix.copyColumnFrom(1, this.billboardAxis);\n\t\t\tthis._matrix.copyColumnFrom(2, look);\n\t\t\tthis._matrix.copyColumnFrom(3, pos);\n\t\t\tthis._matrix.appendRotation(-comps[1].w*MathConsts.RADIANS_TO_DEGREES, comps[1]);\n\t\t} else {\n\t\t\t//create a quick inverse projection matrix\n\t\t\tthis._matrix.copyFrom(renderable.sourceEntity.sceneTransform);\n\t\t\tthis._matrix.append(camera.inverseSceneTransform);\n\n\t\t\t//decompose using axis angle rotations\n\t\t\tcomps = this._matrix.decompose(Orientation3D.AXIS_ANGLE);\n\n\t\t\t//recreate the matrix with just the rotation data\n\t\t\tthis._matrix.identity();\n\t\t\tthis._matrix.appendRotation(-comps[1].w*MathConsts.RADIANS_TO_DEGREES, comps[1]);\n\t\t}\n\n\t\t//set a new matrix transform constant\n\t\tanimationRegisterCache.setVertexConstFromMatrix(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleBillboardState.MATRIX_INDEX), this._matrix);\n\t}\n\n\t/**\n\t * Defines the billboard axis.\n\t */\n\tpublic get billboardAxis():Vector3D\n\t{\n\t\treturn this.billboardAxis;\n\t}\n\n\tpublic set billboardAxis(value:Vector3D)\n\t{\n\t\tthis.billboardAxis = value? value.clone() : null;\n\t\tif (this.billboardAxis)\n\t\t\tthis.billboardAxis.normalize();\n\t}\n\n}\n\nexport = ParticleBillboardState;", + "import ColorTransform\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/ColorTransform\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport ContextGLVertexBufferFormat\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat\");\n\nimport ParticleAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimator\");\nimport AnimationSubGeometry\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/AnimationSubGeometry\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleColorNode\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleColorNode\");\nimport ParticleStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleStateBase\");\n\n/**\n * ...\n * @author ...\n */\nclass ParticleColorState extends ParticleStateBase\n{\n\t/** @private */\n\tpublic static START_MULTIPLIER_INDEX:number /*uint*/ = 0;\n\n\t/** @private */\n\tpublic static DELTA_MULTIPLIER_INDEX:number /*uint*/ = 1;\n\n\t/** @private */\n\tpublic static START_OFFSET_INDEX:number /*uint*/ = 2;\n\n\t/** @private */\n\tpublic static DELTA_OFFSET_INDEX:number /*uint*/ = 3;\n\n\t/** @private */\n\tpublic static CYCLE_INDEX:number /*uint*/ = 4;\n\n\tprivate _particleColorNode:ParticleColorNode;\n\tprivate _usesMultiplier:boolean;\n\tprivate _usesOffset:boolean;\n\tprivate _usesCycle:boolean;\n\tprivate _usesPhase:boolean;\n\tprivate _startColor:ColorTransform;\n\tprivate _endColor:ColorTransform;\n\tprivate _cycleDuration:number;\n\tprivate _cyclePhase:number;\n\tprivate _cycleData:Vector3D;\n\tprivate _startMultiplierData:Vector3D;\n\tprivate _deltaMultiplierData:Vector3D;\n\tprivate _startOffsetData:Vector3D;\n\tprivate _deltaOffsetData:Vector3D;\n\n\t/**\n\t * Defines the start color transform of the state, when in global mode.\n\t */\n\tpublic get startColor():ColorTransform\n\t{\n\t\treturn this._startColor;\n\t}\n\n\tpublic set startColor(value:ColorTransform)\n\t{\n\t\tthis._startColor = value;\n\n\t\tthis.updateColorData();\n\t}\n\n\t/**\n\t * Defines the end color transform of the state, when in global mode.\n\t */\n\tpublic get endColor():ColorTransform\n\t{\n\t\treturn this._endColor;\n\t}\n\n\tpublic set endColor(value:ColorTransform)\n\t{\n\t\tthis._endColor = value;\n\n\t\tthis.updateColorData();\n\t}\n\n\t/**\n\t * Defines the duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1.\n\t */\n\tpublic get cycleDuration():number\n\t{\n\t\treturn this._cycleDuration;\n\t}\n\n\tpublic set cycleDuration(value:number)\n\t{\n\t\tthis._cycleDuration = value;\n\n\t\tthis.updateColorData();\n\t}\n\n\t/**\n\t * Defines the phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0.\n\t */\n\tpublic get cyclePhase():number\n\t{\n\t\treturn this._cyclePhase;\n\t}\n\n\tpublic set cyclePhase(value:number)\n\t{\n\t\tthis._cyclePhase = value;\n\n\t\tthis.updateColorData();\n\t}\n\n\tconstructor(animator:ParticleAnimator, particleColorNode:ParticleColorNode)\n\t{\n\t\tsuper(animator, particleColorNode);\n\n\t\tthis._particleColorNode = particleColorNode;\n\t\tthis._usesMultiplier = this._particleColorNode._iUsesMultiplier;\n\t\tthis._usesOffset = this._particleColorNode._iUsesOffset;\n\t\tthis._usesCycle = this._particleColorNode._iUsesCycle;\n\t\tthis._usesPhase = this._particleColorNode._iUsesPhase;\n\t\tthis._startColor = this._particleColorNode._iStartColor;\n\t\tthis._endColor = this._particleColorNode._iEndColor;\n\t\tthis._cycleDuration = this._particleColorNode._iCycleDuration;\n\t\tthis._cyclePhase = this._particleColorNode._iCyclePhase;\n\n\t\tthis.updateColorData();\n\t}\n\n\tpublic setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera)\n\t{\n\t\tif (animationRegisterCache.needFragmentAnimation) {\n\t\t\tvar dataOffset:number /*uint*/ = this._particleColorNode._iDataOffset;\n\t\t\tif (this._usesCycle)\n\t\t\t\tanimationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorState.CYCLE_INDEX), this._cycleData.x, this._cycleData.y, this._cycleData.z, this._cycleData.w);\n\n\t\t\tif (this._usesMultiplier) {\n\t\t\t\tif (this._particleColorNode.mode == ParticlePropertiesMode.LOCAL_STATIC) {\n\t\t\t\t\tanimationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorState.START_MULTIPLIER_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4);\n\t\t\t\t\tdataOffset += 4;\n\t\t\t\t\tanimationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorState.DELTA_MULTIPLIER_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4);\n\t\t\t\t\tdataOffset += 4;\n\t\t\t\t} else {\n\t\t\t\t\tanimationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorState.START_MULTIPLIER_INDEX), this._startMultiplierData.x, this._startMultiplierData.y, this._startMultiplierData.z, this._startMultiplierData.w);\n\t\t\t\t\tanimationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorState.DELTA_MULTIPLIER_INDEX), this._deltaMultiplierData.x, this._deltaMultiplierData.y, this._deltaMultiplierData.z, this._deltaMultiplierData.w);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this._usesOffset) {\n\t\t\t\tif (this._particleColorNode.mode == ParticlePropertiesMode.LOCAL_STATIC) {\n\t\t\t\t\tanimationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorState.START_OFFSET_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4);\n\t\t\t\t\tdataOffset += 4;\n\t\t\t\t\tanimationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorState.DELTA_OFFSET_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4);\n\t\t\t\t\tdataOffset += 4;\n\t\t\t\t} else {\n\t\t\t\t\tanimationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorState.START_OFFSET_INDEX), this._startOffsetData.x, this._startOffsetData.y, this._startOffsetData.z, this._startOffsetData.w);\n\t\t\t\t\tanimationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorState.DELTA_OFFSET_INDEX), this._deltaOffsetData.x, this._deltaOffsetData.y, this._deltaOffsetData.z, this._deltaOffsetData.w);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate updateColorData()\n\t{\n\t\tif (this._usesCycle) {\n\t\t\tif (this._cycleDuration <= 0)\n\t\t\t\tthrow(new Error(\"the cycle duration must be greater than zero\"));\n\t\t\tthis._cycleData = new Vector3D(Math.PI*2/this._cycleDuration, this._cyclePhase*Math.PI/180, 0, 0);\n\t\t}\n\t\tif (this._particleColorNode.mode == ParticlePropertiesMode.GLOBAL) {\n\t\t\tif (this._usesCycle) {\n\t\t\t\tif (this._usesMultiplier) {\n\t\t\t\t\tthis._startMultiplierData = new Vector3D((this._startColor.redMultiplier + this._endColor.redMultiplier)/2, (this._startColor.greenMultiplier + this._endColor.greenMultiplier)/2, (this._startColor.blueMultiplier + this._endColor.blueMultiplier)/2, (this._startColor.alphaMultiplier + this._endColor.alphaMultiplier)/2);\n\t\t\t\t\tthis._deltaMultiplierData = new Vector3D((this._endColor.redMultiplier - this._startColor.redMultiplier)/2, (this._endColor.greenMultiplier - this._startColor.greenMultiplier)/2, (this._endColor.blueMultiplier - this._startColor.blueMultiplier)/2, (this._endColor.alphaMultiplier - this._startColor.alphaMultiplier)/2);\n\t\t\t\t}\n\n\t\t\t\tif (this._usesOffset) {\n\t\t\t\t\tthis._startOffsetData = new Vector3D((this._startColor.redOffset + this._endColor.redOffset)/(255*2), (this._startColor.greenOffset + this._endColor.greenOffset)/(255*2), (this._startColor.blueOffset + this._endColor.blueOffset)/(255*2), (this._startColor.alphaOffset + this._endColor.alphaOffset)/(255*2));\n\t\t\t\t\tthis._deltaOffsetData = new Vector3D((this._endColor.redOffset - this._startColor.redOffset)/(255*2), (this._endColor.greenOffset - this._startColor.greenOffset)/(255*2), (this._endColor.blueOffset - this._startColor.blueOffset)/(255*2), (this._endColor.alphaOffset - this._startColor.alphaOffset)/(255*2));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (this._usesMultiplier) {\n\t\t\t\t\tthis._startMultiplierData = new Vector3D(this._startColor.redMultiplier, this._startColor.greenMultiplier, this._startColor.blueMultiplier, this._startColor.alphaMultiplier);\n\t\t\t\t\tthis._deltaMultiplierData = new Vector3D((this._endColor.redMultiplier - this._startColor.redMultiplier), (this._endColor.greenMultiplier - this._startColor.greenMultiplier), (this._endColor.blueMultiplier - this._startColor.blueMultiplier), (this._endColor.alphaMultiplier - this._startColor.alphaMultiplier));\n\t\t\t\t}\n\n\t\t\t\tif (this._usesOffset) {\n\t\t\t\t\tthis._startOffsetData = new Vector3D(this._startColor.redOffset/255, this._startColor.greenOffset/255, this._startColor.blueOffset/255, this._startColor.alphaOffset/255);\n\t\t\t\t\tthis._deltaOffsetData = new Vector3D((this._endColor.redOffset - this._startColor.redOffset)/255, (this._endColor.greenOffset - this._startColor.greenOffset)/255, (this._endColor.blueOffset - this._startColor.blueOffset )/255, (this._endColor.alphaOffset - this._startColor.alphaOffset)/255);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport = ParticleColorState;", + "import DisplayObject\t\t\t\t\t= require(\"awayjs-core/lib/core/base/DisplayObject\");\nimport MathConsts\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/MathConsts\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport ContextGLVertexBufferFormat\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat\");\n\nimport ParticleAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimator\");\nimport AnimationSubGeometry\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/AnimationSubGeometry\");\nimport ParticleAnimationData\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleAnimationData\");\nimport ParticleFollowNode\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleFollowNode\");\nimport ParticleStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleStateBase\");\n\n/**\n * ...\n */\nclass ParticleFollowState extends ParticleStateBase\n{\n\t/** @private */\n\tpublic static FOLLOW_POSITION_INDEX:number /*uint*/ = 0;\n\n\t/** @private */\n\tpublic static FOLLOW_ROTATION_INDEX:number /*uint*/ = 1;\n\n\tprivate _particleFollowNode:ParticleFollowNode;\n\tprivate _followTarget:DisplayObject;\n\n\tprivate _targetPos:Vector3D = new Vector3D();\n\tprivate _targetEuler:Vector3D = new Vector3D();\n\tprivate _prePos:Vector3D;\n\tprivate _preEuler:Vector3D;\n\tprivate _smooth:boolean;\n\n\t//temporary vector3D for calculation\n\tprivate _temp:Vector3D = new Vector3D();\n\n\tconstructor(animator:ParticleAnimator, particleFollowNode:ParticleFollowNode)\n\t{\n\t\tsuper(animator, particleFollowNode, true);\n\n\t\tthis._particleFollowNode = particleFollowNode;\n\t\tthis._smooth = particleFollowNode._iSmooth;\n\t}\n\n\tpublic get followTarget():DisplayObject\n\t{\n\t\treturn this._followTarget;\n\t}\n\n\tpublic set followTarget(value:DisplayObject)\n\t{\n\t\tthis._followTarget = value;\n\t}\n\n\tpublic get smooth():boolean\n\t{\n\t\treturn this._smooth;\n\t}\n\n\tpublic set smooth(value:boolean)\n\t{\n\t\tthis._smooth = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera)\n\t{\n\t\tif (this._followTarget) {\n\t\t\tif (this._particleFollowNode._iUsesPosition) {\n\t\t\t\tthis._targetPos.x = this._followTarget.transform.position.x/renderable.sourceEntity.scaleX;\n\t\t\t\tthis._targetPos.y = this._followTarget.transform.position.y/renderable.sourceEntity.scaleY;\n\t\t\t\tthis._targetPos.z = this._followTarget.transform.position.z/renderable.sourceEntity.scaleZ;\n\t\t\t}\n\t\t\tif (this._particleFollowNode._iUsesRotation) {\n\t\t\t\tthis._targetEuler.x = this._followTarget.rotationX;\n\t\t\t\tthis._targetEuler.y = this._followTarget.rotationY;\n\t\t\t\tthis._targetEuler.z = this._followTarget.rotationZ;\n\t\t\t\tthis._targetEuler.scaleBy(MathConsts.DEGREES_TO_RADIANS);\n\t\t\t}\n\t\t}\n\t\t//initialization\n\t\tif (!this._prePos)\n\t\t\tthis._prePos = this._targetPos.clone();\n\t\tif (!this._preEuler)\n\t\t\tthis._preEuler = this._targetEuler.clone();\n\n\t\tvar currentTime:number = this._pTime/1000;\n\t\tvar previousTime:number = animationSubGeometry.previousTime;\n\t\tvar deltaTime:number = currentTime - previousTime;\n\n\t\tvar needProcess:boolean = previousTime != currentTime;\n\n\t\tif (this._particleFollowNode._iUsesPosition && this._particleFollowNode._iUsesRotation) {\n\t\t\tif (needProcess)\n\t\t\t\tthis.processPositionAndRotation(currentTime, deltaTime, animationSubGeometry);\n\n\t\t\tanimationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleFollowState.FOLLOW_POSITION_INDEX), this._particleFollowNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3);\n\t\t\tanimationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleFollowState.FOLLOW_ROTATION_INDEX), this._particleFollowNode._iDataOffset + 3, stage, ContextGLVertexBufferFormat.FLOAT_3);\n\t\t} else if (this._particleFollowNode._iUsesPosition) {\n\t\t\tif (needProcess)\n\t\t\t\tthis.processPosition(currentTime, deltaTime, animationSubGeometry);\n\n\t\t\tanimationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleFollowState.FOLLOW_POSITION_INDEX), this._particleFollowNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3);\n\t\t} else if (this._particleFollowNode._iUsesRotation) {\n\t\t\tif (needProcess)\n\t\t\t\tthis.precessRotation(currentTime, deltaTime, animationSubGeometry);\n\n\t\t\tanimationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleFollowState.FOLLOW_ROTATION_INDEX), this._particleFollowNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3);\n\t\t}\n\n\t\tthis._prePos.copyFrom(this._targetPos);\n\t\tthis._targetEuler.copyFrom(this._targetEuler);\n\t\tanimationSubGeometry.previousTime = currentTime;\n\t}\n\n\tprivate processPosition(currentTime:number, deltaTime:number, animationSubGeometry:AnimationSubGeometry)\n\t{\n\t\tvar data:Array = animationSubGeometry.animationParticles;\n\t\tvar vertexData:Array = animationSubGeometry.vertexData;\n\n\t\tvar changed:boolean = false;\n\t\tvar len:number /*uint*/ = data.length;\n\t\tvar interpolatedPos:Vector3D;\n\t\tvar posVelocity:Vector3D;\n\t\tif (this._smooth) {\n\t\t\tposVelocity = this._prePos.subtract(this._targetPos);\n\t\t\tposVelocity.scaleBy(1/deltaTime);\n\t\t} else\n\t\t\tinterpolatedPos = this._targetPos;\n\t\tfor (var i:number /*uint*/ = 0; i < len; i++) {\n\t\t\tvar k:number = (currentTime - data[i].startTime)/data[i].totalTime;\n\t\t\tvar t:number = (k - Math.floor(k))*data[i].totalTime;\n\t\t\tif (t - deltaTime <= 0) {\n\t\t\t\tvar inc:number /*int*/ = data[i].startVertexIndex*animationSubGeometry.totalLenOfOneVertex + this._particleFollowNode._iDataOffset;\n\n\t\t\t\tif (this._smooth) {\n\t\t\t\t\tthis._temp.copyFrom(posVelocity);\n\t\t\t\t\tthis._temp.scaleBy(t);\n\t\t\t\t\tinterpolatedPos = this._targetPos.add(this._temp);\n\t\t\t\t}\n\n\t\t\t\tif (vertexData[inc] != interpolatedPos.x || vertexData[inc + 1] != interpolatedPos.y || vertexData[inc + 2] != interpolatedPos.z) {\n\t\t\t\t\tchanged = true;\n\t\t\t\t\tfor (var j:number /*uint*/ = 0; j < data[i].numVertices; j++) {\n\t\t\t\t\t\tvertexData[inc++] = interpolatedPos.x;\n\t\t\t\t\t\tvertexData[inc++] = interpolatedPos.y;\n\t\t\t\t\t\tvertexData[inc++] = interpolatedPos.z;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (changed)\n\t\t\tanimationSubGeometry.invalidateBuffer();\n\n\t}\n\n\tprivate precessRotation(currentTime:number, deltaTime:number, animationSubGeometry:AnimationSubGeometry)\n\t{\n\t\tvar data:Array = animationSubGeometry.animationParticles;\n\t\tvar vertexData:Array = animationSubGeometry.vertexData;\n\n\t\tvar changed:boolean = false;\n\t\tvar len:number /*uint*/ = data.length;\n\n\t\tvar interpolatedRotation:Vector3D;\n\t\tvar rotationVelocity:Vector3D;\n\n\t\tif (this._smooth) {\n\t\t\trotationVelocity = this._preEuler.subtract(this._targetEuler);\n\t\t\trotationVelocity.scaleBy(1/deltaTime);\n\t\t} else\n\t\t\tinterpolatedRotation = this._targetEuler;\n\n\t\tfor (var i:number /*uint*/ = 0; i < len; i++) {\n\t\t\tvar k:number = (currentTime - data[i].startTime)/data[i].totalTime;\n\t\t\tvar t:number = (k - Math.floor(k))*data[i].totalTime;\n\t\t\tif (t - deltaTime <= 0) {\n\t\t\t\tvar inc:number /*int*/ = data[i].startVertexIndex*animationSubGeometry.totalLenOfOneVertex + this._particleFollowNode._iDataOffset;\n\n\t\t\t\tif (this._smooth) {\n\t\t\t\t\tthis._temp.copyFrom(rotationVelocity);\n\t\t\t\t\tthis._temp.scaleBy(t);\n\t\t\t\t\tinterpolatedRotation = this._targetEuler.add(this._temp);\n\t\t\t\t}\n\n\t\t\t\tif (vertexData[inc] != interpolatedRotation.x || vertexData[inc + 1] != interpolatedRotation.y || vertexData[inc + 2] != interpolatedRotation.z) {\n\t\t\t\t\tchanged = true;\n\t\t\t\t\tfor (var j:number /*uint*/ = 0; j < data[i].numVertices; j++) {\n\t\t\t\t\t\tvertexData[inc++] = interpolatedRotation.x;\n\t\t\t\t\t\tvertexData[inc++] = interpolatedRotation.y;\n\t\t\t\t\t\tvertexData[inc++] = interpolatedRotation.z;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (changed)\n\t\t\tanimationSubGeometry.invalidateBuffer();\n\n\t}\n\n\tprivate processPositionAndRotation(currentTime:number, deltaTime:number, animationSubGeometry:AnimationSubGeometry)\n\t{\n\t\tvar data:Array = animationSubGeometry.animationParticles;\n\t\tvar vertexData:Array = animationSubGeometry.vertexData;\n\n\t\tvar changed:boolean = false;\n\t\tvar len:number /*uint*/ = data.length;\n\n\t\tvar interpolatedPos:Vector3D;\n\t\tvar interpolatedRotation:Vector3D;\n\n\t\tvar posVelocity:Vector3D;\n\t\tvar rotationVelocity:Vector3D;\n\t\tif (this._smooth) {\n\t\t\tposVelocity = this._prePos.subtract(this._targetPos);\n\t\t\tposVelocity.scaleBy(1/deltaTime);\n\t\t\trotationVelocity = this._preEuler.subtract(this._targetEuler);\n\t\t\trotationVelocity.scaleBy(1/deltaTime);\n\t\t} else {\n\t\t\tinterpolatedPos = this._targetPos;\n\t\t\tinterpolatedRotation = this._targetEuler;\n\t\t}\n\n\t\tfor (var i:number /*uint*/ = 0; i < len; i++) {\n\t\t\tvar k:number = (currentTime - data[i].startTime)/data[i].totalTime;\n\t\t\tvar t:number = (k - Math.floor(k))*data[i].totalTime;\n\t\t\tif (t - deltaTime <= 0) {\n\t\t\t\tvar inc:number /*int*/ = data[i].startVertexIndex*animationSubGeometry.totalLenOfOneVertex + this._particleFollowNode._iDataOffset;\n\t\t\t\tif (this._smooth) {\n\t\t\t\t\tthis._temp.copyFrom(posVelocity);\n\t\t\t\t\tthis._temp.scaleBy(t);\n\t\t\t\t\tinterpolatedPos = this._targetPos.add(this._temp);\n\n\t\t\t\t\tthis._temp.copyFrom(rotationVelocity);\n\t\t\t\t\tthis._temp.scaleBy(t);\n\t\t\t\t\tinterpolatedRotation = this._targetEuler.add(this._temp);\n\t\t\t\t}\n\n\t\t\t\tif (vertexData[inc] != interpolatedPos.x || vertexData[inc + 1] != interpolatedPos.y || vertexData[inc + 2] != interpolatedPos.z || vertexData[inc + 3] != interpolatedRotation.x || vertexData[inc + 4] != interpolatedRotation.y || vertexData[inc + 5] != interpolatedRotation.z) {\n\t\t\t\t\tchanged = true;\n\t\t\t\t\tfor (var j:number /*uint*/ = 0; j < data[i].numVertices; j++) {\n\t\t\t\t\t\tvertexData[inc++] = interpolatedPos.x;\n\t\t\t\t\t\tvertexData[inc++] = interpolatedPos.y;\n\t\t\t\t\t\tvertexData[inc++] = interpolatedPos.z;\n\t\t\t\t\t\tvertexData[inc++] = interpolatedRotation.x;\n\t\t\t\t\t\tvertexData[inc++] = interpolatedRotation.y;\n\t\t\t\t\t\tvertexData[inc++] = interpolatedRotation.z;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (changed)\n\t\t\tanimationSubGeometry.invalidateBuffer();\n\t}\n\n}\n\nexport = ParticleFollowState;", + "import ColorTransform\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/ColorTransform\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport ContextGLVertexBufferFormat\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat\");\n\nimport ParticleAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimator\");\nimport AnimationSubGeometry\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/AnimationSubGeometry\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleInitialColorNode\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleInitialColorNode\");\nimport ParticleStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleStateBase\");\n\n/**\n*\n*/\nclass ParticleInitialColorState extends ParticleStateBase\n{\n\t/** @private */\n\tpublic static MULTIPLIER_INDEX:number /*uint*/ = 0;\n\t/** @private */\n\tpublic static OFFSET_INDEX:number /*uint*/ = 1;\n\n\tprivate _particleInitialColorNode:ParticleInitialColorNode;\n\tprivate _usesMultiplier:boolean;\n\tprivate _usesOffset:boolean;\n\tprivate _initialColor:ColorTransform;\n\tprivate _multiplierData:Vector3D;\n\tprivate _offsetData:Vector3D;\n\n\tconstructor(animator:ParticleAnimator, particleInitialColorNode:ParticleInitialColorNode)\n\t{\n\t\tsuper(animator, particleInitialColorNode);\n\n\t\tthis._particleInitialColorNode = particleInitialColorNode;\n\t\tthis._usesMultiplier = particleInitialColorNode._iUsesMultiplier;\n\t\tthis._usesOffset = particleInitialColorNode._iUsesOffset;\n\t\tthis._initialColor = particleInitialColorNode._iInitialColor;\n\n\t\tthis.updateColorData();\n\t}\n\n\t/**\n\t * Defines the initial color transform of the state, when in global mode.\n\t */\n\tpublic get initialColor():ColorTransform\n\t{\n\t\treturn this._initialColor;\n\t}\n\n\tpublic set initialColor(value:ColorTransform)\n\t{\n\t\tthis._initialColor = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera)\n\t{\n\t\t// TODO: not used\n\t\trenderable = renderable;\n\t\tcamera = camera;\n\n\t\tif (animationRegisterCache.needFragmentAnimation) {\n\t\t\tif (this._particleInitialColorNode.mode == ParticlePropertiesMode.LOCAL_STATIC) {\n\t\t\t\tvar dataOffset:number /*uint*/ = this._particleInitialColorNode._iDataOffset;\n\t\t\t\tif (this._usesMultiplier) {\n\t\t\t\t\tanimationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleInitialColorState.MULTIPLIER_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4);\n\t\t\t\t\tdataOffset += 4;\n\t\t\t\t}\n\t\t\t\tif (this._usesOffset)\n\t\t\t\t\tanimationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleInitialColorState.OFFSET_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4);\n\t\t\t} else {\n\t\t\t\tif (this._usesMultiplier)\n\t\t\t\t\tanimationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleInitialColorState.MULTIPLIER_INDEX), this._multiplierData.x, this._multiplierData.y, this._multiplierData.z, this._multiplierData.w);\n\t\t\t\tif (this._usesOffset)\n\t\t\t\t\tanimationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleInitialColorState.OFFSET_INDEX), this._offsetData.x, this._offsetData.y, this._offsetData.z, this._offsetData.w);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate updateColorData()\n\t{\n\t\tif (this._particleInitialColorNode.mode == ParticlePropertiesMode.GLOBAL) {\n\t\t\tif (this._usesMultiplier)\n\t\t\t\tthis._multiplierData = new Vector3D(this._initialColor.redMultiplier, this._initialColor.greenMultiplier, this._initialColor.blueMultiplier, this._initialColor.alphaMultiplier);\n\t\t\tif (this._usesOffset)\n\t\t\t\tthis._offsetData = new Vector3D(this._initialColor.redOffset/255, this._initialColor.greenOffset/255, this._initialColor.blueOffset/255, this._initialColor.alphaOffset/255);\n\t\t}\n\t}\n\n}\n\nexport = ParticleInitialColorState;", + "import Matrix3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Matrix3D\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport ContextGLVertexBufferFormat\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat\");\n\nimport ParticleAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimator\");\nimport AnimationSubGeometry\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/AnimationSubGeometry\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleOrbitNode\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleOrbitNode\");\nimport ParticleStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleStateBase\");\n\n/**\n * ...\n */\nclass ParticleOrbitState extends ParticleStateBase\n{\n\t/** @private */\n\tpublic static ORBIT_INDEX:number /*uint*/ = 0;\n\n\t/** @private */\n\tpublic static EULERS_INDEX:number /*uint*/ = 1;\n\n\tprivate _particleOrbitNode:ParticleOrbitNode;\n\tprivate _usesEulers:boolean;\n\tprivate _usesCycle:boolean;\n\tprivate _usesPhase:boolean;\n\tprivate _radius:number;\n\tprivate _cycleDuration:number;\n\tprivate _cyclePhase:number;\n\tprivate _eulers:Vector3D;\n\tprivate _orbitData:Vector3D;\n\tprivate _eulersMatrix:Matrix3D;\n\n\t/**\n\t * Defines the radius of the orbit when in global mode. Defaults to 100.\n\t */\n\tpublic get radius():number\n\t{\n\t\treturn this._radius;\n\t}\n\n\tpublic set radius(value:number)\n\t{\n\t\tthis._radius = value;\n\n\t\tthis.updateOrbitData();\n\t}\n\n\t/**\n\t * Defines the duration of the orbit in seconds, used as a period independent of particle duration when in global mode. Defaults to 1.\n\t */\n\tpublic get cycleDuration():number\n\t{\n\t\treturn this._cycleDuration;\n\t}\n\n\tpublic set cycleDuration(value:number)\n\t{\n\t\tthis._cycleDuration = value;\n\n\t\tthis.updateOrbitData();\n\t}\n\n\t/**\n\t * Defines the phase of the orbit in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0.\n\t */\n\tpublic get cyclePhase():number\n\t{\n\t\treturn this._cyclePhase;\n\t}\n\n\tpublic set cyclePhase(value:number)\n\t{\n\t\tthis._cyclePhase = value;\n\n\t\tthis.updateOrbitData();\n\t}\n\n\t/**\n\t * Defines the euler rotation in degrees, applied to the orientation of the orbit when in global mode.\n\t */\n\tpublic get eulers():Vector3D\n\t{\n\t\treturn this._eulers;\n\t}\n\n\tpublic set eulers(value:Vector3D)\n\t{\n\t\tthis._eulers = value;\n\n\t\tthis.updateOrbitData();\n\n\t}\n\n\tconstructor(animator:ParticleAnimator, particleOrbitNode:ParticleOrbitNode)\n\t{\n\t\tsuper(animator, particleOrbitNode);\n\n\t\tthis._particleOrbitNode = particleOrbitNode;\n\t\tthis._usesEulers = this._particleOrbitNode._iUsesEulers;\n\t\tthis._usesCycle = this._particleOrbitNode._iUsesCycle;\n\t\tthis._usesPhase = this._particleOrbitNode._iUsesPhase;\n\t\tthis._eulers = this._particleOrbitNode._iEulers;\n\t\tthis._radius = this._particleOrbitNode._iRadius;\n\t\tthis._cycleDuration = this._particleOrbitNode._iCycleDuration;\n\t\tthis._cyclePhase = this._particleOrbitNode._iCyclePhase;\n\t\tthis.updateOrbitData();\n\t}\n\n\tpublic setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera)\n\t{\n\t\tvar index:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleOrbitState.ORBIT_INDEX);\n\n\t\tif (this._particleOrbitNode.mode == ParticlePropertiesMode.LOCAL_STATIC) {\n\t\t\tif (this._usesPhase)\n\t\t\t\tanimationSubGeometry.activateVertexBuffer(index, this._particleOrbitNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4);\n\t\t\telse\n\t\t\t\tanimationSubGeometry.activateVertexBuffer(index, this._particleOrbitNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3);\n\t\t} else\n\t\t\tanimationRegisterCache.setVertexConst(index, this._orbitData.x, this._orbitData.y, this._orbitData.z, this._orbitData.w);\n\n\t\tif (this._usesEulers)\n\t\t\tanimationRegisterCache.setVertexConstFromMatrix(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleOrbitState.EULERS_INDEX), this._eulersMatrix);\n\t}\n\n\tprivate updateOrbitData()\n\t{\n\t\tif (this._usesEulers) {\n\t\t\tthis._eulersMatrix = new Matrix3D();\n\t\t\tthis._eulersMatrix.appendRotation(this._eulers.x, Vector3D.X_AXIS);\n\t\t\tthis._eulersMatrix.appendRotation(this._eulers.y, Vector3D.Y_AXIS);\n\t\t\tthis._eulersMatrix.appendRotation(this._eulers.z, Vector3D.Z_AXIS);\n\t\t}\n\t\tif (this._particleOrbitNode.mode == ParticlePropertiesMode.GLOBAL) {\n\t\t\tthis._orbitData = new Vector3D(this._radius, 0, this._radius*Math.PI*2, this._cyclePhase*Math.PI/180);\n\t\t\tif (this._usesCycle) {\n\t\t\t\tif (this._cycleDuration <= 0)\n\t\t\t\t\tthrow(new Error(\"the cycle duration must be greater than zero\"));\n\t\t\t\tthis._orbitData.y = Math.PI*2/this._cycleDuration;\n\t\t\t} else\n\t\t\t\tthis._orbitData.y = Math.PI*2;\n\t\t}\n\t}\n}\n\nexport = ParticleOrbitState;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport ContextGLVertexBufferFormat\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat\");\n\nimport ParticleAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimator\");\nimport AnimationSubGeometry\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/AnimationSubGeometry\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleOscillatorNode\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleOscillatorNode\");\nimport ParticleStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleStateBase\");\n\n/**\n * ...\n */\nclass ParticleOscillatorState extends ParticleStateBase\n{\n\t/** @private */\n\tpublic static OSCILLATOR_INDEX:number /*uint*/ = 0;\n\n\tprivate _particleOscillatorNode:ParticleOscillatorNode;\n\tprivate _oscillator:Vector3D;\n\tprivate _oscillatorData:Vector3D;\n\n\t/**\n\t * Defines the default oscillator axis (x, y, z) and cycleDuration (w) of the state, used when in global mode.\n\t */\n\tpublic get oscillator():Vector3D\n\t{\n\t\treturn this._oscillator;\n\t}\n\n\tpublic set oscillator(value:Vector3D)\n\t{\n\t\tthis._oscillator = value;\n\n\t\tthis.updateOscillatorData();\n\t}\n\n\tconstructor(animator:ParticleAnimator, particleOscillatorNode:ParticleOscillatorNode)\n\t{\n\t\tsuper(animator, particleOscillatorNode);\n\n\t\tthis._particleOscillatorNode = particleOscillatorNode;\n\t\tthis._oscillator = this._particleOscillatorNode._iOscillator;\n\n\t\tthis.updateOscillatorData();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera)\n\t{\n\t\tvar index:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleOscillatorState.OSCILLATOR_INDEX);\n\n\t\tif (this._particleOscillatorNode.mode == ParticlePropertiesMode.LOCAL_STATIC)\n\t\t\tanimationSubGeometry.activateVertexBuffer(index, this._particleOscillatorNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4);\n\t\telse\n\t\t\tanimationRegisterCache.setVertexConst(index, this._oscillatorData.x, this._oscillatorData.y, this._oscillatorData.z, this._oscillatorData.w);\n\t}\n\n\tprivate updateOscillatorData()\n\t{\n\t\tif (this._particleOscillatorNode.mode == ParticlePropertiesMode.GLOBAL) {\n\t\t\tif (this._oscillator.w <= 0)\n\t\t\t\tthrow(new Error(\"the cycle duration must greater than zero\"));\n\n\t\t\tif (this._oscillatorData == null)\n\t\t\t\tthis._oscillatorData = new Vector3D();\n\n\t\t\tthis._oscillatorData.x = this._oscillator.x;\n\t\t\tthis._oscillatorData.y = this._oscillator.y;\n\t\t\tthis._oscillatorData.z = this._oscillator.z;\n\t\t\tthis._oscillatorData.w = Math.PI*2/this._oscillator.w;\n\t\t}\n\t}\n}\n\nexport = ParticleOscillatorState;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport ContextGLVertexBufferFormat\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat\");\n\nimport ParticleAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimator\");\nimport AnimationSubGeometry\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/AnimationSubGeometry\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticlePositionNode\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticlePositionNode\");\nimport ParticleStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleStateBase\");\n\n/**\n * ...\n * @author ...\n */\nclass ParticlePositionState extends ParticleStateBase\n{\n\t/** @private */\n\tpublic static POSITION_INDEX:number /*uint*/ = 0;\n\n\tprivate _particlePositionNode:ParticlePositionNode;\n\tprivate _position:Vector3D;\n\n\t/**\n\t * Defines the position of the particle when in global mode. Defaults to 0,0,0.\n\t */\n\tpublic get position():Vector3D\n\t{\n\t\treturn this._position;\n\t}\n\n\tpublic set position(value:Vector3D)\n\t{\n\t\tthis._position = value;\n\t}\n\n\t/**\n\t *\n\t */\n\tpublic getPositions():Array\n\t{\n\t\treturn this._pDynamicProperties;\n\t}\n\n\tpublic setPositions(value:Array)\n\t{\n\t\tthis._pDynamicProperties = value;\n\n\t\tthis._pDynamicPropertiesDirty = new Object();\n\t}\n\n\tconstructor(animator:ParticleAnimator, particlePositionNode:ParticlePositionNode)\n\t{\n\t\tsuper(animator, particlePositionNode);\n\n\t\tthis._particlePositionNode = particlePositionNode;\n\t\tthis._position = this._particlePositionNode._iPosition;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera)\n\t{\n\t\tif (this._particlePositionNode.mode == ParticlePropertiesMode.LOCAL_DYNAMIC && !this._pDynamicPropertiesDirty[animationSubGeometry._iUniqueId])\n\t\t\tthis._pUpdateDynamicProperties(animationSubGeometry);\n\n\t\tvar index:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticlePositionState.POSITION_INDEX);\n\n\t\tif (this._particlePositionNode.mode == ParticlePropertiesMode.GLOBAL)\n\t\t\tanimationRegisterCache.setVertexConst(index, this._position.x, this._position.y, this._position.z);\n\t\telse\n\t\t\tanimationSubGeometry.activateVertexBuffer(index, this._particlePositionNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3);\n\t}\n}\n\nexport = ParticlePositionState;", + "import Matrix3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Matrix3D\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\n\nimport ParticleAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimator\");\nimport AnimationSubGeometry\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/AnimationSubGeometry\");\nimport ParticleNodeBase\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase\");\nimport ParticleRotateToHeadingNode\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleRotateToHeadingNode\");\nimport ParticleStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleStateBase\");\n\n/**\n * ...\n */\nclass ParticleRotateToHeadingState extends ParticleStateBase\n{\n\t/** @private */\n\tpublic static MATRIX_INDEX:number /*int*/ = 0;\n\n\tprivate _matrix:Matrix3D = new Matrix3D();\n\n\tconstructor(animator:ParticleAnimator, particleNode:ParticleNodeBase)\n\t{\n\t\tsuper(animator, particleNode);\n\t}\n\n\tpublic setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera)\n\t{\n\t\tif (animationRegisterCache.hasBillboard) {\n\t\t\tthis._matrix.copyFrom(renderable.sourceEntity.sceneTransform);\n\t\t\tthis._matrix.append(camera.inverseSceneTransform);\n\t\t\tanimationRegisterCache.setVertexConstFromMatrix(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleRotateToHeadingState.MATRIX_INDEX), this._matrix);\n\t\t}\n\t}\n\n}\n\nexport = ParticleRotateToHeadingState;", + "import Matrix3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Matrix3D\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport ContextGLVertexBufferFormat\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat\");\n\nimport ParticleAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimator\");\nimport AnimationSubGeometry\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/AnimationSubGeometry\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleRotateToPositionNode\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleRotateToPositionNode\");\nimport ParticleStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleStateBase\");\n\n/**\n * ...\n */\nclass ParticleRotateToPositionState extends ParticleStateBase\n{\n\t/** @private */\n\tpublic static MATRIX_INDEX:number /*int*/ = 0;\n\t/** @private */\n\tpublic static POSITION_INDEX:number /*int*/ = 1;\n\n\tprivate _particleRotateToPositionNode:ParticleRotateToPositionNode;\n\tprivate _position:Vector3D;\n\tprivate _matrix:Matrix3D = new Matrix3D();\n\tprivate _offset:Vector3D;\n\n\t/**\n\t * Defines the position of the point the particle will rotate to face when in global mode. Defaults to 0,0,0.\n\t */\n\tpublic get position():Vector3D\n\t{\n\t\treturn this._position;\n\t}\n\n\tpublic set position(value:Vector3D)\n\t{\n\t\tthis._position = value;\n\t}\n\n\tconstructor(animator:ParticleAnimator, particleRotateToPositionNode:ParticleRotateToPositionNode)\n\t{\n\t\tsuper(animator, particleRotateToPositionNode);\n\n\t\tthis._particleRotateToPositionNode = particleRotateToPositionNode;\n\t\tthis._position = this._particleRotateToPositionNode._iPosition;\n\t}\n\n\tpublic setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera)\n\t{\n\t\tvar index:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleRotateToPositionState.POSITION_INDEX);\n\n\t\tif (animationRegisterCache.hasBillboard) {\n\t\t\tthis._matrix.copyFrom(renderable.sourceEntity.sceneTransform);\n\t\t\tthis._matrix.append(camera.inverseSceneTransform);\n\t\t\tanimationRegisterCache.setVertexConstFromMatrix(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleRotateToPositionState.MATRIX_INDEX), this._matrix);\n\t\t}\n\n\t\tif (this._particleRotateToPositionNode.mode == ParticlePropertiesMode.GLOBAL) {\n\t\t\tthis._offset = renderable.sourceEntity.inverseSceneTransform.transformVector(this._position);\n\t\t\tanimationRegisterCache.setVertexConst(index, this._offset.x, this._offset.y, this._offset.z);\n\t\t} else\n\t\t\tanimationSubGeometry.activateVertexBuffer(index, this._particleRotateToPositionNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3);\n\n\t}\n\n}\n\nexport = ParticleRotateToPositionState;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport ContextGLVertexBufferFormat\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat\");\n\nimport ParticleAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimator\");\nimport AnimationSubGeometry\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/AnimationSubGeometry\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleRotationalVelocityNode\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleRotationalVelocityNode\");\nimport ParticleStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleStateBase\");\n\n/**\n * ...\n */\nclass ParticleRotationalVelocityState extends ParticleStateBase\n{\n\t/** @private */\n\tpublic static ROTATIONALVELOCITY_INDEX:number /*uint*/ = 0;\n\n\tprivate _particleRotationalVelocityNode:ParticleRotationalVelocityNode;\n\tprivate _rotationalVelocityData:Vector3D;\n\tprivate _rotationalVelocity:Vector3D;\n\n\t/**\n\t * Defines the default rotationalVelocity of the state, used when in global mode.\n\t */\n\tpublic get rotationalVelocity():Vector3D\n\t{\n\t\treturn this._rotationalVelocity;\n\t}\n\n\tpublic set rotationalVelocity(value:Vector3D)\n\t{\n\t\tthis._rotationalVelocity = value;\n\n\t\tthis.updateRotationalVelocityData();\n\t}\n\n\t/**\n\t *\n\t */\n\tpublic getRotationalVelocities():Array\n\t{\n\t\treturn this._pDynamicProperties;\n\t}\n\n\tpublic setRotationalVelocities(value:Array)\n\t{\n\t\tthis._pDynamicProperties = value;\n\n\t\tthis._pDynamicPropertiesDirty = new Object();\n\t}\n\n\tconstructor(animator:ParticleAnimator, particleRotationNode:ParticleRotationalVelocityNode)\n\t{\n\t\tsuper(animator, particleRotationNode);\n\n\t\tthis._particleRotationalVelocityNode = particleRotationNode;\n\t\tthis._rotationalVelocity = this._particleRotationalVelocityNode._iRotationalVelocity;\n\n\t\tthis.updateRotationalVelocityData();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera)\n\t{\n\t\tif (this._particleRotationalVelocityNode.mode == ParticlePropertiesMode.LOCAL_DYNAMIC && !this._pDynamicPropertiesDirty[animationSubGeometry._iUniqueId])\n\t\t\tthis._pUpdateDynamicProperties(animationSubGeometry);\n\n\t\tvar index:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleRotationalVelocityState.ROTATIONALVELOCITY_INDEX);\n\n\t\tif (this._particleRotationalVelocityNode.mode == ParticlePropertiesMode.GLOBAL)\n\t\t\tanimationRegisterCache.setVertexConst(index, this._rotationalVelocityData.x, this._rotationalVelocityData.y, this._rotationalVelocityData.z, this._rotationalVelocityData.w);\n\t\telse\n\t\t\tanimationSubGeometry.activateVertexBuffer(index, this._particleRotationalVelocityNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4);\n\t}\n\n\tprivate updateRotationalVelocityData()\n\t{\n\t\tif (this._particleRotationalVelocityNode.mode == ParticlePropertiesMode.GLOBAL) {\n\t\t\tif (this._rotationalVelocity.w <= 0)\n\t\t\t\tthrow(new Error(\"the cycle duration must greater than zero\"));\n\t\t\tvar rotation:Vector3D = this._rotationalVelocity.clone();\n\n\t\t\tif (rotation.length <= 0)\n\t\t\t\trotation.z = 1; //set the default direction\n\t\t\telse\n\t\t\t\trotation.normalize();\n\t\t\t// w is used as angle/2 in agal\n\t\t\tthis._rotationalVelocityData = new Vector3D(rotation.x, rotation.y, rotation.z, Math.PI/rotation.w);\n\t\t}\n\t}\n}\n\nexport = ParticleRotationalVelocityState;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport ContextGLVertexBufferFormat\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat\");\n\nimport ParticleAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimator\");\nimport AnimationSubGeometry\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/AnimationSubGeometry\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleScaleNode\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleScaleNode\");\nimport ParticleStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleStateBase\");\n\n/**\n * ...\n */\nclass ParticleScaleState extends ParticleStateBase\n{\n\t/** @private */\n\tpublic static SCALE_INDEX:number /*uint*/ = 0;\n\n\tprivate _particleScaleNode:ParticleScaleNode;\n\tprivate _usesCycle:boolean;\n\tprivate _usesPhase:boolean;\n\tprivate _minScale:number;\n\tprivate _maxScale:number;\n\tprivate _cycleDuration:number;\n\tprivate _cyclePhase:number;\n\tprivate _scaleData:Vector3D;\n\n\t/**\n\t * Defines the end scale of the state, when in global mode. Defaults to 1.\n\t */\n\tpublic get minScale():number\n\t{\n\t\treturn this._minScale;\n\t}\n\n\tpublic set minScale(value:number)\n\t{\n\t\tthis._minScale = value;\n\n\t\tthis.updateScaleData();\n\t}\n\n\t/**\n\t * Defines the end scale of the state, when in global mode. Defaults to 1.\n\t */\n\tpublic get maxScale():number\n\t{\n\t\treturn this._maxScale;\n\t}\n\n\tpublic set maxScale(value:number)\n\t{\n\t\tthis._maxScale = value;\n\n\t\tthis.updateScaleData();\n\t}\n\n\t/**\n\t * Defines the duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1.\n\t */\n\tpublic get cycleDuration():number\n\t{\n\t\treturn this._cycleDuration;\n\t}\n\n\tpublic set cycleDuration(value:number)\n\t{\n\t\tthis._cycleDuration = value;\n\n\t\tthis.updateScaleData();\n\t}\n\n\t/**\n\t * Defines the phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0.\n\t */\n\tpublic get cyclePhase():number\n\t{\n\t\treturn this._cyclePhase;\n\t}\n\n\tpublic set cyclePhase(value:number)\n\t{\n\t\tthis._cyclePhase = value;\n\n\t\tthis.updateScaleData();\n\t}\n\n\tconstructor(animator:ParticleAnimator, particleScaleNode:ParticleScaleNode)\n\t{\n\t\tsuper(animator, particleScaleNode);\n\n\t\tthis._particleScaleNode = particleScaleNode;\n\t\tthis._usesCycle = this._particleScaleNode._iUsesCycle;\n\t\tthis._usesPhase = this._particleScaleNode._iUsesPhase;\n\t\tthis._minScale = this._particleScaleNode._iMinScale;\n\t\tthis._maxScale = this._particleScaleNode._iMaxScale;\n\t\tthis._cycleDuration = this._particleScaleNode._iCycleDuration;\n\t\tthis._cyclePhase = this._particleScaleNode._iCyclePhase;\n\n\t\tthis.updateScaleData();\n\t}\n\n\tpublic setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera)\n\t{\n\t\tvar index:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleScaleState.SCALE_INDEX);\n\n\t\tif (this._particleScaleNode.mode == ParticlePropertiesMode.LOCAL_STATIC) {\n\t\t\tif (this._usesCycle) {\n\t\t\t\tif (this._usesPhase)\n\t\t\t\t\tanimationSubGeometry.activateVertexBuffer(index, this._particleScaleNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4);\n\t\t\t\telse\n\t\t\t\t\tanimationSubGeometry.activateVertexBuffer(index, this._particleScaleNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3);\n\t\t\t} else\n\t\t\t\tanimationSubGeometry.activateVertexBuffer(index, this._particleScaleNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_2);\n\t\t} else\n\t\t\tanimationRegisterCache.setVertexConst(index, this._scaleData.x, this._scaleData.y, this._scaleData.z, this._scaleData.w);\n\t}\n\n\tprivate updateScaleData()\n\t{\n\t\tif (this._particleScaleNode.mode == ParticlePropertiesMode.GLOBAL) {\n\t\t\tif (this._usesCycle) {\n\t\t\t\tif (this._cycleDuration <= 0)\n\t\t\t\t\tthrow(new Error(\"the cycle duration must be greater than zero\"));\n\t\t\t\tthis._scaleData = new Vector3D((this._minScale + this._maxScale)/2, Math.abs(this._minScale - this._maxScale)/2, Math.PI*2/this._cycleDuration, this._cyclePhase*Math.PI/180);\n\t\t\t} else\n\t\t\t\tthis._scaleData = new Vector3D(this._minScale, this._maxScale - this._minScale, 0, 0);\n\t\t}\n\t}\n}\n\nexport = ParticleScaleState;", + "import ColorTransform\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/ColorTransform\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport ContextGLVertexBufferFormat\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat\");\n\nimport ParticleAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimator\");\nimport AnimationSubGeometry\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/AnimationSubGeometry\");\nimport ColorSegmentPoint\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ColorSegmentPoint\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleSegmentedColorNode\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleSegmentedColorNode\");\nimport ParticleStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleStateBase\");\n\n/**\n *\n */\nclass ParticleSegmentedColorState extends ParticleStateBase\n{\n\t/** @private */\n\tpublic static START_MULTIPLIER_INDEX:number /*uint*/ = 0;\n\n\t/** @private */\n\tpublic static START_OFFSET_INDEX:number /*uint*/ = 1;\n\n\t/** @private */\n\tpublic static TIME_DATA_INDEX:number /*uint*/ = 2;\n\n\tprivate _usesMultiplier:boolean;\n\tprivate _usesOffset:boolean;\n\tprivate _startColor:ColorTransform;\n\tprivate _endColor:ColorTransform;\n\tprivate _segmentPoints:Array;\n\tprivate _numSegmentPoint:number /*int*/;\n\n\tprivate _timeLifeData:Array;\n\tprivate _multiplierData:Array;\n\tprivate _offsetData:Array;\n\n\t/**\n\t * Defines the start color transform of the state, when in global mode.\n\t */\n\tpublic get startColor():ColorTransform\n\t{\n\t\treturn this._startColor;\n\t}\n\n\tpublic set startColor(value:ColorTransform)\n\t{\n\t\tthis._startColor = value;\n\n\t\tthis.updateColorData();\n\t}\n\n\t/**\n\t * Defines the end color transform of the state, when in global mode.\n\t */\n\tpublic get endColor():ColorTransform\n\t{\n\t\treturn this._endColor;\n\t}\n\n\tpublic set endColor(value:ColorTransform)\n\t{\n\t\tthis._endColor = value;\n\t\tthis.updateColorData();\n\t}\n\n\t/**\n\t * Defines the number of segments.\n\t */\n\tpublic get numSegmentPoint():number /*int*/\n\t{\n\t\treturn this._numSegmentPoint;\n\t}\n\n\t/**\n\t * Defines the key points of color\n\t */\n\tpublic get segmentPoints():Array\n\t{\n\t\treturn this._segmentPoints;\n\t}\n\n\tpublic set segmentPoints(value:Array)\n\t{\n\t\tthis._segmentPoints = value;\n\t\tthis.updateColorData();\n\t}\n\n\tpublic get usesMultiplier():boolean\n\t{\n\t\treturn this._usesMultiplier;\n\t}\n\n\tpublic get usesOffset():boolean\n\t{\n\t\treturn this._usesOffset;\n\t}\n\n\tconstructor(animator:ParticleAnimator, particleSegmentedColorNode:ParticleSegmentedColorNode)\n\t{\n\t\tsuper(animator, particleSegmentedColorNode);\n\n\t\tthis._usesMultiplier = particleSegmentedColorNode._iUsesMultiplier;\n\t\tthis._usesOffset = particleSegmentedColorNode._iUsesOffset;\n\t\tthis._startColor = particleSegmentedColorNode._iStartColor;\n\t\tthis._endColor = particleSegmentedColorNode._iEndColor;\n\t\tthis._segmentPoints = particleSegmentedColorNode._iSegmentPoints;\n\t\tthis._numSegmentPoint = particleSegmentedColorNode._iNumSegmentPoint;\n\t\tthis.updateColorData();\n\t}\n\n\tpublic setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera)\n\t{\n\t\tif (animationRegisterCache.needFragmentAnimation) {\n\t\t\tif (this._numSegmentPoint > 0)\n\t\t\t\tanimationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleSegmentedColorState.TIME_DATA_INDEX), this._timeLifeData[0], this._timeLifeData[1], this._timeLifeData[2], this._timeLifeData[3]);\n\t\t\tif (this._usesMultiplier)\n\t\t\t\tanimationRegisterCache.setVertexConstFromArray(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleSegmentedColorState.START_MULTIPLIER_INDEX), this._multiplierData);\n\t\t\tif (this._usesOffset)\n\t\t\t\tanimationRegisterCache.setVertexConstFromArray(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleSegmentedColorState.START_OFFSET_INDEX), this._offsetData);\n\t\t}\n\t}\n\n\tprivate updateColorData()\n\t{\n\t\tthis._timeLifeData = new Array();\n\t\tthis._multiplierData = new Array();\n\t\tthis._offsetData = new Array();\n\t\tvar i:number /*int*/;\n\t\tfor (i = 0; i < this._numSegmentPoint; i++) {\n\t\t\tif (i == 0)\n\t\t\t\tthis._timeLifeData.push(this._segmentPoints[i].life);\n\t\t\telse\n\t\t\t\tthis._timeLifeData.push(this._segmentPoints[i].life - this._segmentPoints[i - 1].life);\n\t\t}\n\t\tif (this._numSegmentPoint == 0)\n\t\t\tthis._timeLifeData.push(1);\n\t\telse\n\t\t\tthis._timeLifeData.push(1 - this._segmentPoints[i - 1].life);\n\n\t\tif (this._usesMultiplier) {\n\t\t\tthis._multiplierData.push(this._startColor.redMultiplier, this._startColor.greenMultiplier, this._startColor.blueMultiplier, this._startColor.alphaMultiplier);\n\t\t\tfor (i = 0; i < this._numSegmentPoint; i++) {\n\t\t\t\tif (i == 0)\n\t\t\t\t\tthis._multiplierData.push((this._segmentPoints[i].color.redMultiplier - this._startColor.redMultiplier)/this._timeLifeData[i], (this._segmentPoints[i].color.greenMultiplier - this._startColor.greenMultiplier)/this._timeLifeData[i], (this._segmentPoints[i].color.blueMultiplier - this._startColor.blueMultiplier)/this._timeLifeData[i], (this._segmentPoints[i].color.alphaMultiplier - this._startColor.alphaMultiplier)/this._timeLifeData[i]);\n\t\t\t\telse\n\t\t\t\t\tthis._multiplierData.push((this._segmentPoints[i].color.redMultiplier - this._segmentPoints[i - 1].color.redMultiplier)/this._timeLifeData[i], (this._segmentPoints[i].color.greenMultiplier - this._segmentPoints[i - 1].color.greenMultiplier)/this._timeLifeData[i], (this._segmentPoints[i].color.blueMultiplier - this._segmentPoints[i - 1].color.blueMultiplier)/this._timeLifeData[i], (this._segmentPoints[i].color.alphaMultiplier - this._segmentPoints[i - 1].color.alphaMultiplier)/this._timeLifeData[i]);\n\t\t\t}\n\t\t\tif (this._numSegmentPoint == 0)\n\t\t\t\tthis._multiplierData.push(this._endColor.redMultiplier - this._startColor.redMultiplier, this._endColor.greenMultiplier - this._startColor.greenMultiplier, this._endColor.blueMultiplier - this._startColor.blueMultiplier, this._endColor.alphaMultiplier - this._startColor.alphaMultiplier);\n\t\t\telse\n\t\t\t\tthis._multiplierData.push((this._endColor.redMultiplier - this._segmentPoints[i - 1].color.redMultiplier)/this._timeLifeData[i], (this._endColor.greenMultiplier - this._segmentPoints[i - 1].color.greenMultiplier)/this._timeLifeData[i], (this._endColor.blueMultiplier - this._segmentPoints[i - 1].color.blueMultiplier)/this._timeLifeData[i], (this._endColor.alphaMultiplier - this._segmentPoints[i - 1].color.alphaMultiplier)/this._timeLifeData[i]);\n\t\t}\n\n\t\tif (this._usesOffset) {\n\t\t\tthis._offsetData.push(this._startColor.redOffset/255, this._startColor.greenOffset/255, this._startColor.blueOffset/255, this._startColor.alphaOffset/255);\n\t\t\tfor (i = 0; i < this._numSegmentPoint; i++) {\n\t\t\t\tif (i == 0)\n\t\t\t\t\tthis._offsetData.push((this._segmentPoints[i].color.redOffset - this._startColor.redOffset)/this._timeLifeData[i]/255, (this._segmentPoints[i].color.greenOffset - this._startColor.greenOffset)/this._timeLifeData[i]/255, (this._segmentPoints[i].color.blueOffset - this._startColor.blueOffset)/this._timeLifeData[i]/255, (this._segmentPoints[i].color.alphaOffset - this._startColor.alphaOffset)/this._timeLifeData[i]/255);\n\t\t\t\telse\n\t\t\t\t\tthis._offsetData.push((this._segmentPoints[i].color.redOffset - this._segmentPoints[i - 1].color.redOffset)/this._timeLifeData[i]/255, (this._segmentPoints[i].color.greenOffset - this._segmentPoints[i - 1].color.greenOffset)/this._timeLifeData[i]/255, (this._segmentPoints[i].color.blueOffset - this._segmentPoints[i - 1].color.blueOffset)/this._timeLifeData[i]/255, (this._segmentPoints[i].color.alphaOffset - this._segmentPoints[i - 1].color.alphaOffset)/this._timeLifeData[i]/255);\n\t\t\t}\n\t\t\tif (this._numSegmentPoint == 0)\n\t\t\t\tthis._offsetData.push((this._endColor.redOffset - this._startColor.redOffset)/255, (this._endColor.greenOffset - this._startColor.greenOffset)/255, (this._endColor.blueOffset - this._startColor.blueOffset)/255, (this._endColor.alphaOffset - this._startColor.alphaOffset)/255);\n\t\t\telse\n\t\t\t\tthis._offsetData.push((this._endColor.redOffset - this._segmentPoints[i - 1].color.redOffset)/this._timeLifeData[i]/255, (this._endColor.greenOffset - this._segmentPoints[i - 1].color.greenOffset)/this._timeLifeData[i]/255, (this._endColor.blueOffset - this._segmentPoints[i - 1].color.blueOffset)/this._timeLifeData[i]/255, (this._endColor.alphaOffset - this._segmentPoints[i - 1].color.alphaOffset)/this._timeLifeData[i]/255);\n\t\t}\n\t\t//cut off the data\n\t\tthis._timeLifeData.length = 4;\n\t}\n}\n\nexport = ParticleSegmentedColorState;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport ContextGLVertexBufferFormat\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat\");\n\nimport ParticleAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimator\");\nimport AnimationSubGeometry\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/AnimationSubGeometry\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleSpriteSheetNode\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleSpriteSheetNode\");\nimport ParticleStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleStateBase\");\n\n/**\n * ...\n */\nclass ParticleSpriteSheetState extends ParticleStateBase\n{\n\t/** @private */\n\tpublic static UV_INDEX_0:number /*uint*/ = 0;\n\n\t/** @private */\n\tpublic static UV_INDEX_1:number /*uint*/ = 1;\n\n\tprivate _particleSpriteSheetNode:ParticleSpriteSheetNode;\n\tprivate _usesCycle:boolean;\n\tprivate _usesPhase:boolean;\n\tprivate _totalFrames:number /*int*/;\n\tprivate _numColumns:number /*int*/;\n\tprivate _numRows:number /*int*/;\n\tprivate _cycleDuration:number;\n\tprivate _cyclePhase:number;\n\tprivate _spriteSheetData:Array;\n\n\t/**\n\t * Defines the cycle phase, when in global mode. Defaults to zero.\n\t */\n\tpublic get cyclePhase():number\n\t{\n\t\treturn this._cyclePhase;\n\t}\n\n\tpublic set cyclePhase(value:number)\n\t{\n\t\tthis._cyclePhase = value;\n\n\t\tthis.updateSpriteSheetData();\n\t}\n\n\t/**\n\t * Defines the cycle duration in seconds, when in global mode. Defaults to 1.\n\t */\n\tpublic get cycleDuration():number\n\t{\n\t\treturn this._cycleDuration;\n\t}\n\n\tpublic set cycleDuration(value:number)\n\t{\n\t\tthis._cycleDuration = value;\n\n\t\tthis.updateSpriteSheetData();\n\t}\n\n\tconstructor(animator:ParticleAnimator, particleSpriteSheetNode:ParticleSpriteSheetNode)\n\t{\n\t\tsuper(animator, particleSpriteSheetNode);\n\n\t\tthis._particleSpriteSheetNode = particleSpriteSheetNode;\n\n\t\tthis._usesCycle = this._particleSpriteSheetNode._iUsesCycle;\n\t\tthis._usesPhase = this._particleSpriteSheetNode._iUsesCycle;\n\t\tthis._totalFrames = this._particleSpriteSheetNode._iTotalFrames;\n\t\tthis._numColumns = this._particleSpriteSheetNode._iNumColumns;\n\t\tthis._numRows = this._particleSpriteSheetNode._iNumRows;\n\t\tthis._cycleDuration = this._particleSpriteSheetNode._iCycleDuration;\n\t\tthis._cyclePhase = this._particleSpriteSheetNode._iCyclePhase;\n\n\t\tthis.updateSpriteSheetData();\n\t}\n\n\tpublic setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera)\n\t{\n\t\tif (animationRegisterCache.needUVAnimation) {\n\t\t\tanimationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleSpriteSheetState.UV_INDEX_0), this._spriteSheetData[0], this._spriteSheetData[1], this._spriteSheetData[2], this._spriteSheetData[3]);\n\t\t\tif (this._usesCycle) {\n\t\t\t\tvar index:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleSpriteSheetState.UV_INDEX_1);\n\t\t\t\tif (this._particleSpriteSheetNode.mode == ParticlePropertiesMode.LOCAL_STATIC) {\n\t\t\t\t\tif (this._usesPhase)\n\t\t\t\t\t\tanimationSubGeometry.activateVertexBuffer(index, this._particleSpriteSheetNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3);\n\t\t\t\t\telse\n\t\t\t\t\t\tanimationSubGeometry.activateVertexBuffer(index, this._particleSpriteSheetNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_2);\n\t\t\t\t} else\n\t\t\t\t\tanimationRegisterCache.setVertexConst(index, this._spriteSheetData[4], this._spriteSheetData[5]);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate updateSpriteSheetData()\n\t{\n\t\tthis._spriteSheetData = new Array(8);\n\n\t\tvar uTotal:number = this._totalFrames/this._numColumns;\n\n\t\tthis._spriteSheetData[0] = uTotal;\n\t\tthis._spriteSheetData[1] = 1/this._numColumns;\n\t\tthis._spriteSheetData[2] = 1/this._numRows;\n\n\t\tif (this._usesCycle) {\n\t\t\tif (this._cycleDuration <= 0)\n\t\t\t\tthrow(new Error(\"the cycle duration must be greater than zero\"));\n\t\t\tthis._spriteSheetData[4] = uTotal/this._cycleDuration;\n\t\t\tthis._spriteSheetData[5] = this._cycleDuration;\n\t\t\tif (this._usesPhase)\n\t\t\t\tthis._spriteSheetData[6] = this._cyclePhase;\n\t\t}\n\t}\n}\n\nexport = ParticleSpriteSheetState;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\n\nimport ParticleAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimator\");\nimport AnimationSubGeometry\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/AnimationSubGeometry\");\nimport ParticleAnimationData\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleAnimationData\");\nimport ParticleNodeBase\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleNodeBase\");\nimport AnimationStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/AnimationStateBase\");\n\n/**\n * ...\n */\nclass ParticleStateBase extends AnimationStateBase\n{\n\tprivate _particleNode:ParticleNodeBase;\n\n\tpublic _pDynamicProperties:Array = new Array();\n\tpublic _pDynamicPropertiesDirty:Object = new Object();\n\n\tpublic _pNeedUpdateTime:boolean;\n\n\tconstructor(animator:ParticleAnimator, particleNode:ParticleNodeBase, needUpdateTime:boolean = false)\n\t{\n\t\tsuper(animator, particleNode);\n\n\t\tthis._particleNode = particleNode;\n\t\tthis._pNeedUpdateTime = needUpdateTime;\n\t}\n\n\tpublic get needUpdateTime():boolean\n\t{\n\t\treturn this._pNeedUpdateTime;\n\t}\n\n\tpublic setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera)\n\t{\n\n\t}\n\n\tpublic _pUpdateDynamicProperties(animationSubGeometry:AnimationSubGeometry)\n\t{\n\t\tthis._pDynamicPropertiesDirty[animationSubGeometry._iUniqueId] = true;\n\n\t\tvar animationParticles:Array = animationSubGeometry.animationParticles;\n\t\tvar vertexData:Array = animationSubGeometry.vertexData;\n\t\tvar totalLenOfOneVertex:number /*uint*/ = animationSubGeometry.totalLenOfOneVertex;\n\t\tvar dataLength:number /*uint*/ = this._particleNode.dataLength;\n\t\tvar dataOffset:number /*uint*/ = this._particleNode._iDataOffset;\n\t\tvar vertexLength:number /*uint*/;\n\t\t//\t\t\tvar particleOffset:number /*uint*/;\n\t\tvar startingOffset:number /*uint*/;\n\t\tvar vertexOffset:number /*uint*/;\n\t\tvar data:Vector3D;\n\t\tvar animationParticle:ParticleAnimationData;\n\n\t\t//\t\t\tvar numParticles:number /*uint*/ = _positions.length/dataLength;\n\t\tvar numParticles:number /*uint*/ = this._pDynamicProperties.length;\n\t\tvar i:number /*uint*/ = 0;\n\t\tvar j:number /*uint*/ = 0;\n\t\tvar k:number /*uint*/ = 0;\n\n\t\t//loop through all particles\n\t\twhile (i < numParticles) {\n\t\t\t//loop through each particle data for the current particle\n\t\t\twhile (j < numParticles && (animationParticle = animationParticles[j]).index == i) {\n\t\t\t\tdata = this._pDynamicProperties[i];\n\t\t\t\tvertexLength = animationParticle.numVertices*totalLenOfOneVertex;\n\t\t\t\tstartingOffset = animationParticle.startVertexIndex*totalLenOfOneVertex + dataOffset;\n\t\t\t\t//loop through each vertex in the particle data\n\t\t\t\tfor (k = 0; k < vertexLength; k += totalLenOfOneVertex) {\n\t\t\t\t\tvertexOffset = startingOffset + k;\n\t\t\t\t\t//\t\t\t\t\t\tparticleOffset = i * dataLength;\n\t\t\t\t\t//loop through all vertex data for the current particle data\n\t\t\t\t\tfor (k = 0; k < vertexLength; k += totalLenOfOneVertex) {\n\t\t\t\t\t\tvertexOffset = startingOffset + k;\n\t\t\t\t\t\tvertexData[vertexOffset++] = data.x;\n\t\t\t\t\t\tvertexData[vertexOffset++] = data.y;\n\t\t\t\t\t\tvertexData[vertexOffset++] = data.z;\n\n\t\t\t\t\t\tif (dataLength == 4)\n\t\t\t\t\t\t\tvertexData[vertexOffset++] = data.w;\n\t\t\t\t\t}\n\t\t\t\t\t\t//loop through each value in the particle vertex\n\t\t\t\t\t\t//\t\t\t\t\t\tswitch(dataLength) {\n\t\t\t\t\t\t//\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t//\t\t\t\t\t\t\t\tvertexData[vertexOffset++] = _positions[particleOffset++];\n\t\t\t\t\t\t//\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t//\t\t\t\t\t\t\t\tvertexData[vertexOffset++] = _positions[particleOffset++];\n\t\t\t\t\t\t//\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t//\t\t\t\t\t\t\t\tvertexData[vertexOffset++] = _positions[particleOffset++];\n\t\t\t\t\t\t//\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t//\t\t\t\t\t\t\t\tvertexData[vertexOffset++] = _positions[particleOffset++];\n\t\t\t\t\t\t//\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tj++;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\n\t\tanimationSubGeometry.invalidateBuffer();\n\t}\n\n}\n\nexport = ParticleStateBase;", + "import Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport ContextGLVertexBufferFormat\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat\");\n\nimport ParticleAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimator\");\nimport AnimationSubGeometry\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/AnimationSubGeometry\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleTimeNode\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleTimeNode\");\nimport ParticleStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleStateBase\");\n\n/**\n * ...\n */\nclass ParticleTimeState extends ParticleStateBase\n{\n\t/** @private */\n\tpublic static TIME_STREAM_INDEX:number /*uint*/ = 0;\n\n\t/** @private */\n\tpublic static TIME_CONSTANT_INDEX:number /*uint*/ = 1;\n\n\tprivate _particleTimeNode:ParticleTimeNode;\n\n\tconstructor(animator:ParticleAnimator, particleTimeNode:ParticleTimeNode)\n\t{\n\t\tsuper(animator, particleTimeNode, true);\n\n\t\tthis._particleTimeNode = particleTimeNode;\n\t}\n\n\tpublic setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera)\n\t{\n\t\tanimationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleTimeState.TIME_STREAM_INDEX), this._particleTimeNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4);\n\n\t\tvar particleTime:number = this._pTime/1000;\n\t\tanimationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleTimeState.TIME_CONSTANT_INDEX), particleTime, particleTime, particleTime, particleTime);\n\t}\n\n}\n\nexport = ParticleTimeState;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\n\nimport ParticleAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimator\");\nimport AnimationSubGeometry\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/AnimationSubGeometry\");\nimport ParticleUVNode\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleUVNode\");\nimport ParticleStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleStateBase\");\n\n/**\n * ...\n */\nclass ParticleUVState extends ParticleStateBase\n{\n\t/** @private */\n\tpublic static UV_INDEX:number /*uint*/ = 0;\n\n\tprivate _particleUVNode:ParticleUVNode;\n\n\tconstructor(animator:ParticleAnimator, particleUVNode:ParticleUVNode)\n\t{\n\t\tsuper(animator, particleUVNode);\n\n\t\tthis._particleUVNode = particleUVNode;\n\t}\n\n\tpublic setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera)\n\t{\n\t\tif (animationRegisterCache.needUVAnimation) {\n\t\t\tvar index:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleUVState.UV_INDEX);\n\t\t\tvar data:Vector3D = this._particleUVNode._iUvData;\n\t\t\tanimationRegisterCache.setVertexConst(index, data.x, data.y);\n\t\t}\n\t}\n\n}\n\nexport = ParticleUVState;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport AnimationRegisterCache\t\t\t= require(\"awayjs-stagegl/lib/animators/data/AnimationRegisterCache\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport ContextGLVertexBufferFormat\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLVertexBufferFormat\");\n\nimport ParticleAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/ParticleAnimator\");\nimport AnimationSubGeometry\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/AnimationSubGeometry\");\nimport ParticlePropertiesMode\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticlePropertiesMode\");\nimport ParticleVelocityNode\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/ParticleVelocityNode\");\nimport ParticleStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ParticleStateBase\");\n\n/**\n * ...\n */\nclass ParticleVelocityState extends ParticleStateBase\n{\n\t/** @private */\n\tpublic static VELOCITY_INDEX:number /*int*/ = 0;\n\n\tprivate _particleVelocityNode:ParticleVelocityNode;\n\tprivate _velocity:Vector3D;\n\n\t/**\n\t * Defines the default velocity vector of the state, used when in global mode.\n\t */\n\tpublic get velocity():Vector3D\n\t{\n\t\treturn this._velocity;\n\t}\n\n\tpublic set velocity(value:Vector3D)\n\t{\n\t\tthis._velocity = value;\n\t}\n\n\t/**\n\t *\n\t */\n\tpublic getVelocities():Array\n\t{\n\t\treturn this._pDynamicProperties;\n\t}\n\n\tpublic setVelocities(value:Array)\n\t{\n\t\tthis._pDynamicProperties = value;\n\n\t\tthis._pDynamicPropertiesDirty = new Object();\n\t}\n\n\tconstructor(animator:ParticleAnimator, particleVelocityNode:ParticleVelocityNode)\n\t{\n\t\tsuper(animator, particleVelocityNode);\n\n\t\tthis._particleVelocityNode = particleVelocityNode;\n\t\tthis._velocity = this._particleVelocityNode._iVelocity;\n\t}\n\n\tpublic setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera)\n\t{\n\t\tif (this._particleVelocityNode.mode == ParticlePropertiesMode.LOCAL_DYNAMIC && !this._pDynamicPropertiesDirty[animationSubGeometry._iUniqueId])\n\t\t\tthis._pUpdateDynamicProperties(animationSubGeometry);\n\n\t\tvar index:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleVelocityState.VELOCITY_INDEX);\n\n\t\tif (this._particleVelocityNode.mode == ParticlePropertiesMode.GLOBAL)\n\t\t\tanimationRegisterCache.setVertexConst(index, this._velocity.x, this._velocity.y, this._velocity.z);\n\t\telse\n\t\t\tanimationSubGeometry.activateVertexBuffer(index, this._particleVelocityNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3);\n\t}\n}\n\nexport = ParticleVelocityState;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\n\nimport JointPose\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/JointPose\");\nimport Skeleton\t\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/Skeleton\");\nimport SkeletonPose\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/SkeletonPose\");\nimport SkeletonBinaryLERPNode\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/SkeletonBinaryLERPNode\");\nimport AnimationStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/AnimationStateBase\");\nimport ISkeletonAnimationState\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ISkeletonAnimationState\");\n\n/**\n *\n */\nclass SkeletonBinaryLERPState extends AnimationStateBase implements ISkeletonAnimationState\n{\n\tprivate _blendWeight:number = 0;\n\tprivate _skeletonAnimationNode:SkeletonBinaryLERPNode;\n\tprivate _skeletonPose:SkeletonPose = new SkeletonPose();\n\tprivate _skeletonPoseDirty:boolean = true;\n\tprivate _inputA:ISkeletonAnimationState;\n\tprivate _inputB:ISkeletonAnimationState;\n\n\t/**\n\t * Defines a fractional value between 0 and 1 representing the blending ratio between inputA (0) and inputB (1),\n\t * used to produce the skeleton pose output.\n\t *\n\t * @see inputA\n\t * @see inputB\n\t */\n\tpublic get blendWeight():number\n\t{\n\t\treturn this._blendWeight;\n\t}\n\n\tpublic set blendWeight(value:number)\n\t{\n\t\tthis._blendWeight = value;\n\n\t\tthis._pPositionDeltaDirty = true;\n\t\tthis._skeletonPoseDirty = true;\n\t}\n\n\tconstructor(animator:AnimatorBase, skeletonAnimationNode:SkeletonBinaryLERPNode)\n\t{\n\t\tsuper(animator, skeletonAnimationNode);\n\n\t\tthis._skeletonAnimationNode = skeletonAnimationNode;\n\n\t\tthis._inputA = animator.getAnimationState(this._skeletonAnimationNode.inputA);\n\t\tthis._inputB = animator.getAnimationState(this._skeletonAnimationNode.inputB);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic phase(value:number)\n\t{\n\t\tthis._skeletonPoseDirty = true;\n\n\t\tthis._pPositionDeltaDirty = true;\n\n\t\tthis._inputA.phase(value);\n\t\tthis._inputB.phase(value);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pUpdateTime(time:number /*int*/)\n\t{\n\t\tthis._skeletonPoseDirty = true;\n\n\t\tthis._inputA.update(time);\n\t\tthis._inputB.update(time);\n\n\t\tsuper._pUpdateTime(time);\n\t}\n\n\t/**\n\t * Returns the current skeleton pose of the animation in the clip based on the internal playhead position.\n\t */\n\tpublic getSkeletonPose(skeleton:Skeleton):SkeletonPose\n\t{\n\t\tif (this._skeletonPoseDirty)\n\t\t\tthis.updateSkeletonPose(skeleton);\n\n\t\treturn this._skeletonPose;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pUpdatePositionDelta()\n\t{\n\t\tthis._pPositionDeltaDirty = false;\n\n\t\tvar deltA:Vector3D = this._inputA.positionDelta;\n\t\tvar deltB:Vector3D = this._inputB.positionDelta;\n\n\t\tthis._pRootDelta.x = deltA.x + this._blendWeight*(deltB.x - deltA.x);\n\t\tthis._pRootDelta.y = deltA.y + this._blendWeight*(deltB.y - deltA.y);\n\t\tthis._pRootDelta.z = deltA.z + this._blendWeight*(deltB.z - deltA.z);\n\t}\n\n\t/**\n\t * Updates the output skeleton pose of the node based on the blendWeight value between input nodes.\n\t *\n\t * @param skeleton The skeleton used by the animator requesting the ouput pose.\n\t */\n\tprivate updateSkeletonPose(skeleton:Skeleton)\n\t{\n\t\tthis._skeletonPoseDirty = false;\n\n\t\tvar endPose:JointPose;\n\t\tvar endPoses:Array = this._skeletonPose.jointPoses;\n\t\tvar poses1:Array = this._inputA.getSkeletonPose(skeleton).jointPoses;\n\t\tvar poses2:Array = this._inputB.getSkeletonPose(skeleton).jointPoses;\n\t\tvar pose1:JointPose, pose2:JointPose;\n\t\tvar p1:Vector3D, p2:Vector3D;\n\t\tvar tr:Vector3D;\n\t\tvar numJoints:number /*uint*/ = skeleton.numJoints;\n\n\t\t// :s\n\t\tif (endPoses.length != numJoints)\n\t\t\tendPoses.length = numJoints;\n\n\t\tfor (var i:number /*uint*/ = 0; i < numJoints; ++i) {\n\t\t\tendPose = endPoses[i];\n\n\t\t\tif (endPose == null)\n\t\t\t\tendPose = endPoses[i] = new JointPose();\n\n\t\t\tpose1 = poses1[i];\n\t\t\tpose2 = poses2[i];\n\t\t\tp1 = pose1.translation;\n\t\t\tp2 = pose2.translation;\n\n\t\t\tendPose.orientation.lerp(pose1.orientation, pose2.orientation, this._blendWeight);\n\n\t\t\ttr = endPose.translation;\n\t\t\ttr.x = p1.x + this._blendWeight*(p2.x - p1.x);\n\t\t\ttr.y = p1.y + this._blendWeight*(p2.y - p1.y);\n\t\t\ttr.z = p1.z + this._blendWeight*(p2.z - p1.z);\n\t\t}\n\t}\n}\n\nexport = SkeletonBinaryLERPState;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\n\nimport SkeletonAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/SkeletonAnimator\");\nimport JointPose\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/JointPose\");\nimport Skeleton\t\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/Skeleton\");\nimport SkeletonPose\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/SkeletonPose\");\nimport SkeletonClipNode\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/SkeletonClipNode\");\nimport AnimationClipState\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/AnimationClipState\");\nimport ISkeletonAnimationState\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ISkeletonAnimationState\");\n\n/**\n *\n */\nclass SkeletonClipState extends AnimationClipState implements ISkeletonAnimationState\n{\n\tprivate _rootPos:Vector3D = new Vector3D();\n\tprivate _frames:Array;\n\tprivate _skeletonClipNode:SkeletonClipNode;\n\tprivate _skeletonPose:SkeletonPose = new SkeletonPose();\n\tprivate _skeletonPoseDirty:boolean = true;\n\tprivate _currentPose:SkeletonPose;\n\tprivate _nextPose:SkeletonPose;\n\n\t/**\n\t * Returns the current skeleton pose frame of animation in the clip based on the internal playhead position.\n\t */\n\tpublic get currentPose():SkeletonPose\n\t{\n\t\tif (this._pFramesDirty)\n\t\t\tthis._pUpdateFrames();\n\n\t\treturn this._currentPose;\n\t}\n\n\t/**\n\t * Returns the next skeleton pose frame of animation in the clip based on the internal playhead position.\n\t */\n\tpublic get nextPose():SkeletonPose\n\t{\n\t\tif (this._pFramesDirty)\n\t\t\tthis._pUpdateFrames();\n\n\t\treturn this._nextPose;\n\t}\n\n\tconstructor(animator:AnimatorBase, skeletonClipNode:SkeletonClipNode)\n\t{\n\t\tsuper(animator, skeletonClipNode);\n\n\t\tthis._skeletonClipNode = skeletonClipNode;\n\t\tthis._frames = this._skeletonClipNode.frames;\n\t}\n\n\t/**\n\t * Returns the current skeleton pose of the animation in the clip based on the internal playhead position.\n\t */\n\tpublic getSkeletonPose(skeleton:Skeleton):SkeletonPose\n\t{\n\t\tif (this._skeletonPoseDirty)\n\t\t\tthis.updateSkeletonPose(skeleton);\n\n\t\treturn this._skeletonPose;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pUpdateTime(time:number /*int*/)\n\t{\n\t\tthis._skeletonPoseDirty = true;\n\n\t\tsuper._pUpdateTime(time);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pUpdateFrames()\n\t{\n\t\tsuper._pUpdateFrames();\n\n\t\tthis._currentPose = this._frames[this._pCurrentFrame];\n\n\t\tif (this._skeletonClipNode.looping && this._pNextFrame >= this._skeletonClipNode.lastFrame) {\n\t\t\tthis._nextPose = this._frames[0];\n\t\t\t( this._pAnimator).dispatchCycleEvent();\n\t\t} else\n\t\t\tthis._nextPose = this._frames[this._pNextFrame];\n\t}\n\n\t/**\n\t * Updates the output skeleton pose of the node based on the internal playhead position.\n\t *\n\t * @param skeleton The skeleton used by the animator requesting the ouput pose.\n\t */\n\tprivate updateSkeletonPose(skeleton:Skeleton)\n\t{\n\t\tthis._skeletonPoseDirty = false;\n\n\t\tif (!this._skeletonClipNode.totalDuration)\n\t\t\treturn;\n\n\t\tif (this._pFramesDirty)\n\t\t\tthis._pUpdateFrames();\n\n\t\tvar currentPose:Array = this._currentPose.jointPoses;\n\t\tvar nextPose:Array = this._nextPose.jointPoses;\n\t\tvar numJoints:number /*uint*/ = skeleton.numJoints;\n\t\tvar p1:Vector3D, p2:Vector3D;\n\t\tvar pose1:JointPose, pose2:JointPose;\n\t\tvar endPoses:Array = this._skeletonPose.jointPoses;\n\t\tvar endPose:JointPose;\n\t\tvar tr:Vector3D;\n\n\t\t// :s\n\t\tif (endPoses.length != numJoints)\n\t\t\tendPoses.length = numJoints;\n\n\t\tif ((numJoints != currentPose.length) || (numJoints != nextPose.length))\n\t\t\tthrow new Error(\"joint counts don't match!\");\n\n\t\tfor (var i:number /*uint*/ = 0; i < numJoints; ++i) {\n\t\t\tendPose = endPoses[i];\n\n\t\t\tif (endPose == null)\n\t\t\t\tendPose = endPoses[i] = new JointPose();\n\n\t\t\tpose1 = currentPose[i];\n\t\t\tpose2 = nextPose[i];\n\t\t\tp1 = pose1.translation;\n\t\t\tp2 = pose2.translation;\n\n\t\t\tif (this._skeletonClipNode.highQuality)\n\t\t\t\tendPose.orientation.slerp(pose1.orientation, pose2.orientation, this._pBlendWeight); else\n\t\t\t\tendPose.orientation.lerp(pose1.orientation, pose2.orientation, this._pBlendWeight);\n\n\t\t\tif (i > 0) {\n\t\t\t\ttr = endPose.translation;\n\t\t\t\ttr.x = p1.x + this._pBlendWeight*(p2.x - p1.x);\n\t\t\t\ttr.y = p1.y + this._pBlendWeight*(p2.y - p1.y);\n\t\t\t\ttr.z = p1.z + this._pBlendWeight*(p2.z - p1.z);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pUpdatePositionDelta()\n\t{\n\t\tthis._pPositionDeltaDirty = false;\n\n\t\tif (this._pFramesDirty)\n\t\t\tthis._pUpdateFrames();\n\n\t\tvar p1:Vector3D, p2:Vector3D, p3:Vector3D;\n\t\tvar totalDelta:Vector3D = this._skeletonClipNode.totalDelta;\n\n\t\t// jumping back, need to reset position\n\t\tif ((this._pTimeDir > 0 && this._pNextFrame < this._pOldFrame) || (this._pTimeDir < 0 && this._pNextFrame > this._pOldFrame)) {\n\t\t\tthis._rootPos.x -= totalDelta.x*this._pTimeDir;\n\t\t\tthis._rootPos.y -= totalDelta.y*this._pTimeDir;\n\t\t\tthis._rootPos.z -= totalDelta.z*this._pTimeDir;\n\t\t}\n\n\t\tvar dx:number = this._rootPos.x;\n\t\tvar dy:number = this._rootPos.y;\n\t\tvar dz:number = this._rootPos.z;\n\n\t\tif (this._skeletonClipNode.stitchFinalFrame && this._pNextFrame == this._skeletonClipNode.lastFrame) {\n\t\t\tp1 = this._frames[0].jointPoses[0].translation;\n\t\t\tp2 = this._frames[1].jointPoses[0].translation;\n\t\t\tp3 = this._currentPose.jointPoses[0].translation;\n\n\t\t\tthis._rootPos.x = p3.x + p1.x + this._pBlendWeight*(p2.x - p1.x);\n\t\t\tthis._rootPos.y = p3.y + p1.y + this._pBlendWeight*(p2.y - p1.y);\n\t\t\tthis._rootPos.z = p3.z + p1.z + this._pBlendWeight*(p2.z - p1.z);\n\t\t} else {\n\t\t\tp1 = this._currentPose.jointPoses[0].translation;\n\t\t\tp2 = this._frames[this._pNextFrame].jointPoses[0].translation; //cover the instances where we wrap the pose but still want the final frame translation values\n\t\t\tthis._rootPos.x = p1.x + this._pBlendWeight*(p2.x - p1.x);\n\t\t\tthis._rootPos.y = p1.y + this._pBlendWeight*(p2.y - p1.y);\n\t\t\tthis._rootPos.z = p1.z + this._pBlendWeight*(p2.z - p1.z);\n\t\t}\n\n\t\tthis._pRootDelta.x = this._rootPos.x - dx;\n\t\tthis._pRootDelta.y = this._rootPos.y - dy;\n\t\tthis._pRootDelta.z = this._rootPos.z - dz;\n\n\t\tthis._pOldFrame = this._pNextFrame;\n\t}\n}\n\nexport = SkeletonClipState;", + "import Quaternion\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Quaternion\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\n\nimport JointPose\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/JointPose\");\nimport Skeleton\t\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/Skeleton\");\nimport SkeletonPose\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/SkeletonPose\");\nimport SkeletonDifferenceNode\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/SkeletonDifferenceNode\");\nimport AnimationStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/AnimationStateBase\");\nimport ISkeletonAnimationState\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ISkeletonAnimationState\");\n\n/**\n *\n */\nclass SkeletonDifferenceState extends AnimationStateBase implements ISkeletonAnimationState\n{\n\tprivate _blendWeight:number = 0;\n\tprivate static _tempQuat:Quaternion = new Quaternion();\n\tprivate _skeletonAnimationNode:SkeletonDifferenceNode;\n\tprivate _skeletonPose:SkeletonPose = new SkeletonPose();\n\tprivate _skeletonPoseDirty:boolean = true;\n\tprivate _baseInput:ISkeletonAnimationState;\n\tprivate _differenceInput:ISkeletonAnimationState;\n\n\t/**\n\t * Defines a fractional value between 0 and 1 representing the blending ratio between the base input (0) and difference input (1),\n\t * used to produce the skeleton pose output.\n\t *\n\t * @see #baseInput\n\t * @see #differenceInput\n\t */\n\tpublic get blendWeight():number\n\t{\n\t\treturn this._blendWeight;\n\t}\n\n\tpublic set blendWeight(value:number)\n\t{\n\t\tthis._blendWeight = value;\n\n\t\tthis._pPositionDeltaDirty = true;\n\t\tthis._skeletonPoseDirty = true;\n\t}\n\n\tconstructor(animator:AnimatorBase, skeletonAnimationNode:SkeletonDifferenceNode)\n\t{\n\t\tsuper(animator, skeletonAnimationNode);\n\n\t\tthis._skeletonAnimationNode = skeletonAnimationNode;\n\n\t\tthis._baseInput = animator.getAnimationState(this._skeletonAnimationNode.baseInput);\n\t\tthis._differenceInput = animator.getAnimationState(this._skeletonAnimationNode.differenceInput);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic phase(value:number)\n\t{\n\t\tthis._skeletonPoseDirty = true;\n\n\t\tthis._pPositionDeltaDirty = true;\n\n\t\tthis._baseInput.phase(value);\n\t\tthis._baseInput.phase(value);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pUpdateTime(time:number /*int*/)\n\t{\n\t\tthis._skeletonPoseDirty = true;\n\n\t\tthis._baseInput.update(time);\n\t\tthis._differenceInput.update(time);\n\n\t\tsuper._pUpdateTime(time);\n\t}\n\n\t/**\n\t * Returns the current skeleton pose of the animation in the clip based on the internal playhead position.\n\t */\n\tpublic getSkeletonPose(skeleton:Skeleton):SkeletonPose\n\t{\n\t\tif (this._skeletonPoseDirty)\n\t\t\tthis.updateSkeletonPose(skeleton);\n\n\t\treturn this._skeletonPose;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pUpdatePositionDelta()\n\t{\n\t\tthis._pPositionDeltaDirty = false;\n\n\t\tvar deltA:Vector3D = this._baseInput.positionDelta;\n\t\tvar deltB:Vector3D = this._differenceInput.positionDelta;\n\n\t\tthis.positionDelta.x = deltA.x + this._blendWeight*deltB.x;\n\t\tthis.positionDelta.y = deltA.y + this._blendWeight*deltB.y;\n\t\tthis.positionDelta.z = deltA.z + this._blendWeight*deltB.z;\n\t}\n\n\t/**\n\t * Updates the output skeleton pose of the node based on the blendWeight value between base input and difference input nodes.\n\t *\n\t * @param skeleton The skeleton used by the animator requesting the ouput pose.\n\t */\n\tprivate updateSkeletonPose(skeleton:Skeleton)\n\t{\n\t\tthis._skeletonPoseDirty = false;\n\n\t\tvar endPose:JointPose;\n\t\tvar endPoses:Array = this._skeletonPose.jointPoses;\n\t\tvar basePoses:Array = this._baseInput.getSkeletonPose(skeleton).jointPoses;\n\t\tvar diffPoses:Array = this._differenceInput.getSkeletonPose(skeleton).jointPoses;\n\t\tvar base:JointPose, diff:JointPose;\n\t\tvar basePos:Vector3D, diffPos:Vector3D;\n\t\tvar tr:Vector3D;\n\t\tvar numJoints:number /*uint*/ = skeleton.numJoints;\n\n\t\t// :s\n\t\tif (endPoses.length != numJoints)\n\t\t\tendPoses.length = numJoints;\n\n\t\tfor (var i:number /*uint*/ = 0; i < numJoints; ++i) {\n\t\t\tendPose = endPoses[i];\n\n\t\t\tif (endPose == null)\n\t\t\t\tendPose = endPoses[i] = new JointPose();\n\n\t\t\tbase = basePoses[i];\n\t\t\tdiff = diffPoses[i];\n\t\t\tbasePos = base.translation;\n\t\t\tdiffPos = diff.translation;\n\n\t\t\tSkeletonDifferenceState._tempQuat.multiply(diff.orientation, base.orientation);\n\t\t\tendPose.orientation.lerp(base.orientation, SkeletonDifferenceState._tempQuat, this._blendWeight);\n\n\t\t\ttr = endPose.translation;\n\t\t\ttr.x = basePos.x + this._blendWeight*diffPos.x;\n\t\t\ttr.y = basePos.y + this._blendWeight*diffPos.y;\n\t\t\ttr.z = basePos.z + this._blendWeight*diffPos.z;\n\t\t}\n\t}\n}\n\nexport = SkeletonDifferenceState;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\n\nimport JointPose\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/JointPose\");\nimport Skeleton\t\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/Skeleton\");\nimport SkeletonPose\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/SkeletonPose\");\nimport SkeletonDirectionalNode\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/SkeletonDirectionalNode\");\nimport AnimationStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/AnimationStateBase\");\nimport ISkeletonAnimationState\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ISkeletonAnimationState\");\n\n/**\n *\n */\nclass SkeletonDirectionalState extends AnimationStateBase implements ISkeletonAnimationState\n{\n\tprivate _skeletonAnimationNode:SkeletonDirectionalNode;\n\tprivate _skeletonPose:SkeletonPose = new SkeletonPose();\n\tprivate _skeletonPoseDirty:boolean = true;\n\tprivate _inputA:ISkeletonAnimationState;\n\tprivate _inputB:ISkeletonAnimationState;\n\tprivate _blendWeight:number = 0;\n\tprivate _direction:number = 0;\n\tprivate _blendDirty:boolean = true;\n\tprivate _forward:ISkeletonAnimationState;\n\tprivate _backward:ISkeletonAnimationState;\n\tprivate _left:ISkeletonAnimationState;\n\tprivate _right:ISkeletonAnimationState;\n\n\t/**\n\t * Defines the direction in degrees of the aniamtion between the forwards (0), right(90) backwards (180) and left(270) input nodes,\n\t * used to produce the skeleton pose output.\n\t */\n\tpublic set direction(value:number)\n\t{\n\t\tif (this._direction == value)\n\t\t\treturn;\n\n\t\tthis._direction = value;\n\n\t\tthis._blendDirty = true;\n\n\t\tthis._skeletonPoseDirty = true;\n\t\tthis._pPositionDeltaDirty = true;\n\t}\n\n\tpublic get direction():number\n\t{\n\t\treturn this._direction;\n\t}\n\n\tconstructor(animator:AnimatorBase, skeletonAnimationNode:SkeletonDirectionalNode)\n\t{\n\t\tsuper(animator, skeletonAnimationNode);\n\n\t\tthis._skeletonAnimationNode = skeletonAnimationNode;\n\n\t\tthis._forward = animator.getAnimationState(this._skeletonAnimationNode.forward);\n\t\tthis._backward = animator.getAnimationState(this._skeletonAnimationNode.backward);\n\t\tthis._left = animator.getAnimationState(this._skeletonAnimationNode.left);\n\t\tthis._right = animator.getAnimationState(this._skeletonAnimationNode.right);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic phase(value:number)\n\t{\n\t\tif (this._blendDirty)\n\t\t\tthis.updateBlend();\n\n\t\tthis._skeletonPoseDirty = true;\n\n\t\tthis._pPositionDeltaDirty = true;\n\n\t\tthis._inputA.phase(value);\n\t\tthis._inputB.phase(value);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pUdateTime(time:number /*int*/)\n\t{\n\t\tif (this._blendDirty)\n\t\t\tthis.updateBlend();\n\n\t\tthis._skeletonPoseDirty = true;\n\n\t\tthis._inputA.update(time);\n\t\tthis._inputB.update(time);\n\n\t\tsuper._pUpdateTime(time);\n\t}\n\n\t/**\n\t * Returns the current skeleton pose of the animation in the clip based on the internal playhead position.\n\t */\n\tpublic getSkeletonPose(skeleton:Skeleton):SkeletonPose\n\t{\n\t\tif (this._skeletonPoseDirty)\n\t\t\tthis.updateSkeletonPose(skeleton);\n\n\t\treturn this._skeletonPose;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pUpdatePositionDelta()\n\t{\n\t\tthis._pPositionDeltaDirty = false;\n\n\t\tif (this._blendDirty)\n\t\t\tthis.updateBlend();\n\n\t\tvar deltA:Vector3D = this._inputA.positionDelta;\n\t\tvar deltB:Vector3D = this._inputB.positionDelta;\n\n\t\tthis.positionDelta.x = deltA.x + this._blendWeight*(deltB.x - deltA.x);\n\t\tthis.positionDelta.y = deltA.y + this._blendWeight*(deltB.y - deltA.y);\n\t\tthis.positionDelta.z = deltA.z + this._blendWeight*(deltB.z - deltA.z);\n\t}\n\n\t/**\n\t * Updates the output skeleton pose of the node based on the direction value between forward, backwards, left and right input nodes.\n\t *\n\t * @param skeleton The skeleton used by the animator requesting the ouput pose.\n\t */\n\tprivate updateSkeletonPose(skeleton:Skeleton)\n\t{\n\t\tthis._skeletonPoseDirty = false;\n\n\t\tif (this._blendDirty)\n\t\t\tthis.updateBlend();\n\n\t\tvar endPose:JointPose;\n\t\tvar endPoses:Array = this._skeletonPose.jointPoses;\n\t\tvar poses1:Array = this._inputA.getSkeletonPose(skeleton).jointPoses;\n\t\tvar poses2:Array = this._inputB.getSkeletonPose(skeleton).jointPoses;\n\t\tvar pose1:JointPose, pose2:JointPose;\n\t\tvar p1:Vector3D, p2:Vector3D;\n\t\tvar tr:Vector3D;\n\t\tvar numJoints:number /*uint*/ = skeleton.numJoints;\n\n\t\t// :s\n\t\tif (endPoses.length != numJoints)\n\t\t\tendPoses.length = numJoints;\n\n\t\tfor (var i:number /*uint*/ = 0; i < numJoints; ++i) {\n\t\t\tendPose = endPoses[i];\n\n\t\t\tif (endPose == null)\n\t\t\t\tendPose = endPoses[i] = new JointPose();\n\n\t\t\tpose1 = poses1[i];\n\t\t\tpose2 = poses2[i];\n\t\t\tp1 = pose1.translation;\n\t\t\tp2 = pose2.translation;\n\n\t\t\tendPose.orientation.lerp(pose1.orientation, pose2.orientation, this._blendWeight);\n\n\t\t\ttr = endPose.translation;\n\t\t\ttr.x = p1.x + this._blendWeight*(p2.x - p1.x);\n\t\t\ttr.y = p1.y + this._blendWeight*(p2.y - p1.y);\n\t\t\ttr.z = p1.z + this._blendWeight*(p2.z - p1.z);\n\t\t}\n\t}\n\n\t/**\n\t * Updates the blend value for the animation output based on the direction value between forward, backwards, left and right input nodes.\n\t *\n\t * @private\n\t */\n\tprivate updateBlend()\n\t{\n\t\tthis._blendDirty = false;\n\n\t\tif (this._direction < 0 || this._direction > 360) {\n\t\t\tthis._direction %= 360;\n\t\t\tif (this._direction < 0)\n\t\t\t\tthis._direction += 360;\n\t\t}\n\n\t\tif (this._direction < 90) {\n\t\t\tthis._inputA = this._forward;\n\t\t\tthis._inputB = this._right;\n\t\t\tthis._blendWeight = this._direction/90;\n\t\t} else if (this._direction < 180) {\n\t\t\tthis._inputA = this._right;\n\t\t\tthis._inputB = this._backward;\n\t\t\tthis._blendWeight = (this._direction - 90)/90;\n\t\t} else if (this._direction < 270) {\n\t\t\tthis._inputA = this._backward;\n\t\t\tthis._inputB = this._left;\n\t\t\tthis._blendWeight = (this._direction - 180)/90;\n\t\t} else {\n\t\t\tthis._inputA = this._left;\n\t\t\tthis._inputB = this._forward;\n\t\t\tthis._blendWeight = (this._direction - 270)/90;\n\t\t}\n\t}\n}\n\nexport = SkeletonDirectionalState;", + "import Quaternion\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Quaternion\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\n\nimport JointPose\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/JointPose\");\nimport Skeleton\t\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/Skeleton\");\nimport SkeletonPose\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/SkeletonPose\");\nimport SkeletonNaryLERPNode\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/SkeletonNaryLERPNode\");\nimport AnimationStateBase\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/AnimationStateBase\");\nimport ISkeletonAnimationState\t\t\t= require(\"awayjs-renderergl/lib/animators/states/ISkeletonAnimationState\");\n\n/**\n *\n */\nclass SkeletonNaryLERPState extends AnimationStateBase implements ISkeletonAnimationState\n{\n\tprivate _skeletonAnimationNode:SkeletonNaryLERPNode;\n\tprivate _skeletonPose:SkeletonPose = new SkeletonPose();\n\tprivate _skeletonPoseDirty:boolean = true;\n\tprivate _blendWeights:Array = new Array();\n\tprivate _inputs:Array = new Array();\n\n\tconstructor(animator:AnimatorBase, skeletonAnimationNode:SkeletonNaryLERPNode)\n\t{\n\t\tsuper(animator, skeletonAnimationNode);\n\n\t\tthis._skeletonAnimationNode = skeletonAnimationNode;\n\n\t\tvar i:number /*uint*/ = this._skeletonAnimationNode.numInputs;\n\n\t\twhile (i--)\n\t\t\tthis._inputs[i] = animator.getAnimationState(this._skeletonAnimationNode._iInputs[i]);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic phase(value:number)\n\t{\n\t\tthis._skeletonPoseDirty = true;\n\n\t\tthis._pPositionDeltaDirty = true;\n\n\t\tfor (var j:number /*uint*/ = 0; j < this._skeletonAnimationNode.numInputs; ++j) {\n\t\t\tif (this._blendWeights[j])\n\t\t\t\tthis._inputs[j].update(value);\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pUdateTime(time:number /*int*/)\n\t{\n\t\tfor (var j:number /*uint*/ = 0; j < this._skeletonAnimationNode.numInputs; ++j) {\n\t\t\tif (this._blendWeights[j])\n\t\t\t\tthis._inputs[j].update(time);\n\t\t}\n\n\t\tsuper._pUpdateTime(time);\n\t}\n\n\t/**\n\t * Returns the current skeleton pose of the animation in the clip based on the internal playhead position.\n\t */\n\tpublic getSkeletonPose(skeleton:Skeleton):SkeletonPose\n\t{\n\t\tif (this._skeletonPoseDirty)\n\t\t\tthis.updateSkeletonPose(skeleton);\n\n\t\treturn this._skeletonPose;\n\t}\n\n\t/**\n\t * Returns the blend weight of the skeleton aniamtion node that resides at the given input index.\n\t *\n\t * @param index The input index for which the skeleton animation node blend weight is requested.\n\t */\n\tpublic getBlendWeightAt(index:number /*uint*/):number\n\t{\n\t\treturn this._blendWeights[index];\n\t}\n\n\t/**\n\t * Sets the blend weight of the skeleton aniamtion node that resides at the given input index.\n\t *\n\t * @param index The input index on which the skeleton animation node blend weight is to be set.\n\t * @param blendWeight The blend weight value to use for the given skeleton animation node index.\n\t */\n\tpublic setBlendWeightAt(index:number /*uint*/, blendWeight:number)\n\t{\n\t\tthis._blendWeights[index] = blendWeight;\n\n\t\tthis._pPositionDeltaDirty = true;\n\t\tthis._skeletonPoseDirty = true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pUpdatePositionDelta()\n\t{\n\t\tthis._pPositionDeltaDirty = false;\n\n\t\tvar delta:Vector3D;\n\t\tvar weight:number;\n\n\t\tthis.positionDelta.x = 0;\n\t\tthis.positionDelta.y = 0;\n\t\tthis.positionDelta.z = 0;\n\n\t\tfor (var j:number /*uint*/ = 0; j < this._skeletonAnimationNode.numInputs; ++j) {\n\t\t\tweight = this._blendWeights[j];\n\n\t\t\tif (weight) {\n\t\t\t\tdelta = this._inputs[j].positionDelta;\n\t\t\t\tthis.positionDelta.x += weight*delta.x;\n\t\t\t\tthis.positionDelta.y += weight*delta.y;\n\t\t\t\tthis.positionDelta.z += weight*delta.z;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Updates the output skeleton pose of the node based on the blend weight values given to the input nodes.\n\t *\n\t * @param skeleton The skeleton used by the animator requesting the ouput pose.\n\t */\n\tprivate updateSkeletonPose(skeleton:Skeleton)\n\t{\n\t\tthis._skeletonPoseDirty = false;\n\n\t\tvar weight:number;\n\t\tvar endPoses:Array = this._skeletonPose.jointPoses;\n\t\tvar poses:Array;\n\t\tvar endPose:JointPose, pose:JointPose;\n\t\tvar endTr:Vector3D, tr:Vector3D;\n\t\tvar endQuat:Quaternion, q:Quaternion;\n\t\tvar firstPose:Array;\n\t\tvar i:number /*uint*/;\n\t\tvar w0:number, x0:number, y0:number, z0:number;\n\t\tvar w1:number, x1:number, y1:number, z1:number;\n\t\tvar numJoints:number /*uint*/ = skeleton.numJoints;\n\n\t\t// :s\n\t\tif (endPoses.length != numJoints)\n\t\t\tendPoses.length = numJoints;\n\n\t\tfor (var j:number /*uint*/ = 0; j < this._skeletonAnimationNode.numInputs; ++j) {\n\t\t\tweight = this._blendWeights[j];\n\n\t\t\tif (!weight)\n\t\t\t\tcontinue;\n\n\t\t\tposes = this._inputs[j].getSkeletonPose(skeleton).jointPoses;\n\n\t\t\tif (!firstPose) {\n\t\t\t\tfirstPose = poses;\n\t\t\t\tfor (i = 0; i < numJoints; ++i) {\n\t\t\t\t\tendPose = endPoses[i];\n\n\t\t\t\t\tif (endPose == null)\n\t\t\t\t\t\tendPose = endPoses[i] = new JointPose();\n\n\t\t\t\t\tpose = poses[i];\n\t\t\t\t\tq = pose.orientation;\n\t\t\t\t\ttr = pose.translation;\n\n\t\t\t\t\tendQuat = endPose.orientation;\n\n\t\t\t\t\tendQuat.x = weight*q.x;\n\t\t\t\t\tendQuat.y = weight*q.y;\n\t\t\t\t\tendQuat.z = weight*q.z;\n\t\t\t\t\tendQuat.w = weight*q.w;\n\n\t\t\t\t\tendTr = endPose.translation;\n\t\t\t\t\tendTr.x = weight*tr.x;\n\t\t\t\t\tendTr.y = weight*tr.y;\n\t\t\t\t\tendTr.z = weight*tr.z;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (i = 0; i < skeleton.numJoints; ++i) {\n\t\t\t\t\tendPose = endPoses[i];\n\t\t\t\t\tpose = poses[i];\n\n\t\t\t\t\tq = firstPose[i].orientation;\n\t\t\t\t\tx0 = q.x;\n\t\t\t\t\ty0 = q.y;\n\t\t\t\t\tz0 = q.z;\n\t\t\t\t\tw0 = q.w;\n\n\t\t\t\t\tq = pose.orientation;\n\t\t\t\t\ttr = pose.translation;\n\n\t\t\t\t\tx1 = q.x;\n\t\t\t\t\ty1 = q.y;\n\t\t\t\t\tz1 = q.z;\n\t\t\t\t\tw1 = q.w;\n\t\t\t\t\t// find shortest direction\n\t\t\t\t\tif (x0*x1 + y0*y1 + z0*z1 + w0*w1 < 0) {\n\t\t\t\t\t\tx1 = -x1;\n\t\t\t\t\t\ty1 = -y1;\n\t\t\t\t\t\tz1 = -z1;\n\t\t\t\t\t\tw1 = -w1;\n\t\t\t\t\t}\n\t\t\t\t\tendQuat = endPose.orientation;\n\t\t\t\t\tendQuat.x += weight*x1;\n\t\t\t\t\tendQuat.y += weight*y1;\n\t\t\t\t\tendQuat.z += weight*z1;\n\t\t\t\t\tendQuat.w += weight*w1;\n\n\t\t\t\t\tendTr = endPose.translation;\n\t\t\t\t\tendTr.x += weight*tr.x;\n\t\t\t\t\tendTr.y += weight*tr.y;\n\t\t\t\t\tendTr.z += weight*tr.z;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0; i < skeleton.numJoints; ++i)\n\t\t\tendPoses[i].orientation.normalize();\n\t}\n}\n\nexport = SkeletonNaryLERPState;", + "import Geometry\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/base/Geometry\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\n\nimport VertexAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/VertexAnimator\");\nimport VertexClipNode\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/VertexClipNode\");\nimport AnimationClipState\t\t\t\t= require(\"awayjs-renderergl/lib/animators/states/AnimationClipState\");\nimport IVertexAnimationState\t\t\t= require(\"awayjs-renderergl/lib/animators/states/IVertexAnimationState\");\n\n/**\n *\n */\nclass VertexClipState extends AnimationClipState implements IVertexAnimationState\n{\n\tprivate _frames:Array;\n\tprivate _vertexClipNode:VertexClipNode;\n\tprivate _currentGeometry:Geometry;\n\tprivate _nextGeometry:Geometry;\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic get currentGeometry():Geometry\n\t{\n\t\tif (this._pFramesDirty)\n\t\t\tthis._pUpdateFrames();\n\n\t\treturn this._currentGeometry;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic get nextGeometry():Geometry\n\t{\n\t\tif (this._pFramesDirty)\n\t\t\tthis._pUpdateFrames();\n\n\t\treturn this._nextGeometry;\n\t}\n\n\tconstructor(animator:AnimatorBase, vertexClipNode:VertexClipNode)\n\t{\n\t\tsuper(animator, vertexClipNode);\n\n\t\tthis._vertexClipNode = vertexClipNode;\n\t\tthis._frames = this._vertexClipNode.frames;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pUpdateFrames()\n\t{\n\t\tsuper._pUpdateFrames();\n\n\t\tthis._currentGeometry = this._frames[this._pCurrentFrame];\n\n\t\tif (this._vertexClipNode.looping && this._pNextFrame >= this._vertexClipNode.lastFrame) {\n\t\t\tthis._nextGeometry = this._frames[0];\n\t\t\t( this._pAnimator).dispatchCycleEvent();\n\t\t} else\n\t\t\tthis._nextGeometry = this._frames[this._pNextFrame];\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pUpdatePositionDelta()\n\t{\n\t\t//TODO:implement positiondelta functionality for vertex animations\n\t}\n}\n\nexport = VertexClipState;", + "import SkeletonBinaryLERPNode\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/SkeletonBinaryLERPNode\");\nimport CrossfadeTransitionState\t\t\t= require(\"awayjs-renderergl/lib/animators/transitions/CrossfadeTransitionState\");\n\n/**\n * A skeleton animation node that uses two animation node inputs to blend a lineraly interpolated output of a skeleton pose.\n */\nclass CrossfadeTransitionNode extends SkeletonBinaryLERPNode\n{\n\tpublic blendSpeed:number;\n\n\tpublic startBlend:number /*int*/;\n\n\t/**\n\t * Creates a new CrossfadeTransitionNode object.\n\t */\n\tconstructor()\n\t{\n\t\tsuper();\n\n\t\tthis._pStateClass = CrossfadeTransitionState;\n\t}\n}\n\nexport = CrossfadeTransitionNode;", + "import AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\n\nimport SkeletonBinaryLERPNode\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/SkeletonBinaryLERPNode\");\nimport SkeletonBinaryLERPState\t\t\t= require(\"awayjs-renderergl/lib/animators/states/SkeletonBinaryLERPState\");\nimport CrossfadeTransitionNode\t\t\t= require(\"awayjs-renderergl/lib/animators/transitions/CrossfadeTransitionNode\");\nimport AnimationStateEvent\t\t\t\t= require(\"awayjs-renderergl/lib/events/AnimationStateEvent\");\n\n/**\n *\n */\nclass CrossfadeTransitionState extends SkeletonBinaryLERPState\n{\n\tprivate _crossfadeTransitionNode:CrossfadeTransitionNode;\n\tprivate _animationStateTransitionComplete:AnimationStateEvent;\n\n\tconstructor(animator:AnimatorBase, skeletonAnimationNode:CrossfadeTransitionNode)\n\t{\n\t\tsuper(animator, skeletonAnimationNode);\n\n\t\tthis._crossfadeTransitionNode = skeletonAnimationNode;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pUpdateTime(time:number /*int*/)\n\t{\n\t\tthis.blendWeight = Math.abs(time - this._crossfadeTransitionNode.startBlend)/(1000*this._crossfadeTransitionNode.blendSpeed);\n\n\t\tif (this.blendWeight >= 1) {\n\t\t\tthis.blendWeight = 1;\n\n\t\t\tif (this._animationStateTransitionComplete == null)\n\t\t\t\tthis._animationStateTransitionComplete = new AnimationStateEvent(AnimationStateEvent.TRANSITION_COMPLETE, this._pAnimator, this, this._crossfadeTransitionNode);\n\n\t\t\tthis._crossfadeTransitionNode.dispatchEvent(this._animationStateTransitionComplete);\n\t\t}\n\n\t\tsuper._pUpdateTime(time);\n\t}\n}\n\nexport = CrossfadeTransitionState;", + "import AnimationNodeBase\t\t\t\t= require(\"awayjs-core/lib/animators/nodes/AnimationNodeBase\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\n\nimport CrossfadeTransitionNode\t\t\t= require(\"awayjs-renderergl/lib/animators/transitions/CrossfadeTransitionNode\");\nimport IAnimationTransition\t\t\t\t= require(\"awayjs-renderergl/lib/animators/transitions/IAnimationTransition\");\n\n/**\n *\n */\nclass CrossfadeTransition implements IAnimationTransition\n{\n\tpublic blendSpeed:number = 0.5;\n\n\tconstructor(blendSpeed:number)\n\t{\n\t\tthis.blendSpeed = blendSpeed;\n\t}\n\n\tpublic getAnimationNode(animator:AnimatorBase, startNode:AnimationNodeBase, endNode:AnimationNodeBase, startBlend:number /*int*/):AnimationNodeBase\n\t{\n\t\tvar crossFadeTransitionNode:CrossfadeTransitionNode = new CrossfadeTransitionNode();\n\t\tcrossFadeTransitionNode.inputA = startNode;\n\t\tcrossFadeTransitionNode.inputB = endNode;\n\t\tcrossFadeTransitionNode.blendSpeed = this.blendSpeed;\n\t\tcrossFadeTransitionNode.startBlend = startBlend;\n\n\t\treturn crossFadeTransitionNode;\n\t}\n}\n\nexport = CrossfadeTransition;", + "import AnimationNodeBase\t\t\t\t= require(\"awayjs-core/lib/animators/nodes/AnimationNodeBase\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\n\n/**\n *\n */\ninterface IAnimationTransition\n{\n\tgetAnimationNode(animator:AnimatorBase, startNode:AnimationNodeBase, endNode:AnimationNodeBase, startTime:number /*int*/):AnimationNodeBase\n}\n\nexport = IAnimationTransition;", + "import Geometry\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/base/Geometry\");\n\nimport ParticleData\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleData\");\n\n/**\n * @class away.base.ParticleGeometry\n */\nclass ParticleGeometry extends Geometry\n{\n\tpublic particles:Array;\n\n\tpublic numParticles:number /*uint*/;\n\n}\n\nexport = ParticleGeometry;", + "import TriangleSubGeometry\t\t\t\t= require(\"awayjs-core/lib/core/base/TriangleSubGeometry\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport PickingCollisionVO\t\t\t\t= require(\"awayjs-core/lib/core/pick/PickingCollisionVO\");\nimport IPickingCollider\t\t\t\t\t= require(\"awayjs-core/lib/core/pick/IPickingCollider\");\nimport MaterialBase\t\t\t\t\t\t= require(\"awayjs-core/lib/materials/MaterialBase\");\n\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\n\nimport PickingColliderBase\t\t\t\t= require(\"awayjs-renderergl/lib/core/pick/PickingColliderBase\");\n\n/**\n * Pure JS picking collider for display objects. Used with the RaycastPicker picking object.\n *\n * @see away.base.DisplayObject#pickingCollider\n * @see away.pick.RaycastPicker\n *\n * @class away.pick.JSPickingCollider\n */\nclass JSPickingCollider extends PickingColliderBase implements IPickingCollider\n{\n\tprivate _findClosestCollision:boolean;\n\n\t/**\n\t * Creates a new JSPickingCollider object.\n\t *\n\t * @param findClosestCollision Determines whether the picking collider searches for the closest collision along the ray. Defaults to false.\n\t */\n\tconstructor(findClosestCollision:boolean = false)\n\t{\n\t\tsuper();\n\n\t\tthis._findClosestCollision = findClosestCollision;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pTestRenderableCollision(renderable:RenderableBase, pickingCollisionVO:PickingCollisionVO, shortestCollisionDistance:number):boolean\n\t{\n\t\tvar t:number;\n\t\tvar i0:number, i1:number, i2:number;\n\t\tvar rx:number, ry:number, rz:number;\n\t\tvar nx:number, ny:number, nz:number;\n\t\tvar cx:number, cy:number, cz:number;\n\t\tvar coeff:number, u:number, v:number, w:number;\n\t\tvar p0x:number, p0y:number, p0z:number;\n\t\tvar p1x:number, p1y:number, p1z:number;\n\t\tvar p2x:number, p2y:number, p2z:number;\n\t\tvar s0x:number, s0y:number, s0z:number;\n\t\tvar s1x:number, s1y:number, s1z:number;\n\t\tvar nl:number, nDotV:number, D:number, disToPlane:number;\n\t\tvar Q1Q2:number, Q1Q1:number, Q2Q2:number, RQ1:number, RQ2:number;\n\t\tvar indexData:Array = renderable.getIndexData().data;\n\t\tvar collisionTriangleIndex:number = -1;\n\t\tvar bothSides:boolean = ( renderable.materialOwner.material).bothSides;\n\n\t\tvar positionData:Array = renderable.getVertexData(TriangleSubGeometry.POSITION_DATA).data;\n\t\tvar positionStride:number = renderable.getVertexData(TriangleSubGeometry.POSITION_DATA).dataPerVertex;\n\t\tvar positionOffset:number = renderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA);\n\t\tvar uvData:Array = renderable.getVertexData(TriangleSubGeometry.UV_DATA).data;\n\t\tvar uvStride:number = renderable.getVertexData(TriangleSubGeometry.UV_DATA).dataPerVertex;\n\t\tvar uvOffset:number = renderable.getVertexOffset(TriangleSubGeometry.UV_DATA);\n\t\tvar numIndices:number = indexData.length;\n\n\t\tfor (var index:number = 0; index < numIndices; index += 3) { // sweep all triangles\n\t\t\t// evaluate triangle indices\n\t\t\ti0 = positionOffset + indexData[ index ]*positionStride;\n\t\t\ti1 = positionOffset + indexData[ (index + 1) ]*positionStride;\n\t\t\ti2 = positionOffset + indexData[ (index + 2) ]*positionStride;\n\n\t\t\t// evaluate triangle positions\n\t\t\tp0x = positionData[ i0 ];\n\t\t\tp0y = positionData[ (i0 + 1) ];\n\t\t\tp0z = positionData[ (i0 + 2) ];\n\t\t\tp1x = positionData[ i1 ];\n\t\t\tp1y = positionData[ (i1 + 1) ];\n\t\t\tp1z = positionData[ (i1 + 2) ];\n\t\t\tp2x = positionData[ i2 ];\n\t\t\tp2y = positionData[ (i2 + 1) ];\n\t\t\tp2z = positionData[ (i2 + 2) ];\n\n\t\t\t// evaluate sides and triangle normal\n\t\t\ts0x = p1x - p0x; // s0 = p1 - p0\n\t\t\ts0y = p1y - p0y;\n\t\t\ts0z = p1z - p0z;\n\t\t\ts1x = p2x - p0x; // s1 = p2 - p0\n\t\t\ts1y = p2y - p0y;\n\t\t\ts1z = p2z - p0z;\n\t\t\tnx = s0y*s1z - s0z*s1y; // n = s0 x s1\n\t\t\tny = s0z*s1x - s0x*s1z;\n\t\t\tnz = s0x*s1y - s0y*s1x;\n\t\t\tnl = 1/Math.sqrt(nx*nx + ny*ny + nz*nz); // normalize n\n\t\t\tnx *= nl;\n\t\t\tny *= nl;\n\t\t\tnz *= nl;\n\n\t\t\t// -- plane intersection test --\n\t\t\tnDotV = nx*this.rayDirection.x + ny* +this.rayDirection.y + nz*this.rayDirection.z; // rayDirection . normal\n\t\t\tif (( !bothSides && nDotV < 0.0 ) || ( bothSides && nDotV != 0.0 )) { // an intersection must exist\n\t\t\t\t// find collision t\n\t\t\t\tD = -( nx*p0x + ny*p0y + nz*p0z );\n\t\t\t\tdisToPlane = -( nx*this.rayPosition.x + ny*this.rayPosition.y + nz*this.rayPosition.z + D );\n\t\t\t\tt = disToPlane/nDotV;\n\t\t\t\t// find collision point\n\t\t\t\tcx = this.rayPosition.x + t*this.rayDirection.x;\n\t\t\t\tcy = this.rayPosition.y + t*this.rayDirection.y;\n\t\t\t\tcz = this.rayPosition.z + t*this.rayDirection.z;\n\t\t\t\t// collision point inside triangle? ( using barycentric coordinates )\n\t\t\t\tQ1Q2 = s0x*s1x + s0y*s1y + s0z*s1z;\n\t\t\t\tQ1Q1 = s0x*s0x + s0y*s0y + s0z*s0z;\n\t\t\t\tQ2Q2 = s1x*s1x + s1y*s1y + s1z*s1z;\n\t\t\t\trx = cx - p0x;\n\t\t\t\try = cy - p0y;\n\t\t\t\trz = cz - p0z;\n\t\t\t\tRQ1 = rx*s0x + ry*s0y + rz*s0z;\n\t\t\t\tRQ2 = rx*s1x + ry*s1y + rz*s1z;\n\t\t\t\tcoeff = 1/( Q1Q1*Q2Q2 - Q1Q2*Q1Q2 );\n\t\t\t\tv = coeff*( Q2Q2*RQ1 - Q1Q2*RQ2 );\n\t\t\t\tw = coeff*( -Q1Q2*RQ1 + Q1Q1*RQ2 );\n\t\t\t\tif (v < 0)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (w < 0)\n\t\t\t\t\tcontinue;\n\t\t\t\tu = 1 - v - w;\n\t\t\t\tif (!( u < 0 ) && t > 0 && t < shortestCollisionDistance) { // all tests passed\n\t\t\t\t\tshortestCollisionDistance = t;\n\t\t\t\t\tcollisionTriangleIndex = index/3;\n\t\t\t\t\tpickingCollisionVO.rayEntryDistance = t;\n\t\t\t\t\tpickingCollisionVO.localPosition = new Vector3D(cx, cy, cz);\n\t\t\t\t\tpickingCollisionVO.localNormal = new Vector3D(nx, ny, nz);\n\t\t\t\t\tpickingCollisionVO.uv = this._pGetCollisionUV(indexData, uvData, index, v, w, u, uvOffset, uvStride);\n\t\t\t\t\tpickingCollisionVO.index = index;\n//\t\t\t\t\t\tpickingCollisionVO.subGeometryIndex = this.pGetMeshSubMeshIndex(renderable);\n\n\t\t\t\t\t// if not looking for best hit, first found will do...\n\t\t\t\t\tif (!this._findClosestCollision)\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\tif (collisionTriangleIndex >= 0)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}\n}\n\nexport = JSPickingCollider;", + "import ISubMesh\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/base/ISubMesh\");\nimport PickingCollisionVO\t\t\t\t= require(\"awayjs-core/lib/core/pick/PickingCollisionVO\");\nimport RenderablePool\t\t\t\t\t= require(\"awayjs-core/lib/core/pool/RenderablePool\");\nimport Point\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Point\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport Billboard\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Billboard\");\nimport Mesh\t\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Mesh\");\nimport AbstractMethodError\t\t\t\t= require(\"awayjs-core/lib/errors/AbstractMethodError\");\n\nimport BillboardRenderable\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/BillboardRenderable\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport TriangleSubMeshRenderable\t\t= require(\"awayjs-stagegl/lib/core/pool/TriangleSubMeshRenderable\");\n\n/**\n * An abstract base class for all picking collider classes. It should not be instantiated directly.\n *\n * @class away.pick.PickingColliderBase\n */\nclass PickingColliderBase\n{\n\tprivate _billboardRenderablePool:RenderablePool;\n\tprivate _subMeshRenderablePool:RenderablePool;\n\n\tpublic rayPosition:Vector3D;\n\tpublic rayDirection:Vector3D;\n\n\tconstructor()\n\t{\n\t\tthis._billboardRenderablePool = RenderablePool.getPool(BillboardRenderable);\n\t\tthis._subMeshRenderablePool = RenderablePool.getPool(TriangleSubMeshRenderable);\n\t}\n\n\tpublic _pPetCollisionNormal(indexData:Array /*uint*/, vertexData:Array, triangleIndex:number):Vector3D // PROTECTED\n\t{\n\t\tvar normal:Vector3D = new Vector3D();\n\t\tvar i0:number = indexData[ triangleIndex ]*3;\n\t\tvar i1:number = indexData[ triangleIndex + 1 ]*3;\n\t\tvar i2:number = indexData[ triangleIndex + 2 ]*3;\n\t\tvar p0:Vector3D = new Vector3D(vertexData[ i0 ], vertexData[ i0 + 1 ], vertexData[ i0 + 2 ]);\n\t\tvar p1:Vector3D = new Vector3D(vertexData[ i1 ], vertexData[ i1 + 1 ], vertexData[ i1 + 2 ]);\n\t\tvar p2:Vector3D = new Vector3D(vertexData[ i2 ], vertexData[ i2 + 1 ], vertexData[ i2 + 2 ]);\n\t\tvar side0:Vector3D = p1.subtract(p0);\n\t\tvar side1:Vector3D = p2.subtract(p0);\n\t\tnormal = side0.crossProduct(side1);\n\t\tnormal.normalize();\n\t\treturn normal;\n\t}\n\n\tpublic _pGetCollisionUV(indexData:Array /*uint*/, uvData:Array, triangleIndex:number, v:number, w:number, u:number, uvOffset:number, uvStride:number):Point // PROTECTED\n\t{\n\t\tvar uv:Point = new Point();\n\t\tvar uIndex:number = indexData[ triangleIndex ]*uvStride + uvOffset;\n\t\tvar uv0:Vector3D = new Vector3D(uvData[ uIndex ], uvData[ uIndex + 1 ]);\n\t\tuIndex = indexData[ triangleIndex + 1 ]*uvStride + uvOffset;\n\t\tvar uv1:Vector3D = new Vector3D(uvData[ uIndex ], uvData[ uIndex + 1 ]);\n\t\tuIndex = indexData[ triangleIndex + 2 ]*uvStride + uvOffset;\n\t\tvar uv2:Vector3D = new Vector3D(uvData[ uIndex ], uvData[ uIndex + 1 ]);\n\t\tuv.x = u*uv0.x + v*uv1.x + w*uv2.x;\n\t\tuv.y = u*uv0.y + v*uv1.y + w*uv2.y;\n\t\treturn uv;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pTestRenderableCollision(renderable:RenderableBase, pickingCollisionVO:PickingCollisionVO, shortestCollisionDistance:number):boolean\n\t{\n\t\tthrow new AbstractMethodError();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic setLocalRay(localPosition:Vector3D, localDirection:Vector3D)\n\t{\n\t\tthis.rayPosition = localPosition;\n\t\tthis.rayDirection = localDirection;\n\t}\n\n\t/**\n\t * Tests a Billboard object for a collision with the picking ray.\n\t *\n\t * @param billboard The billboard instance to be tested.\n\t * @param pickingCollisionVO The collision object used to store the collision results\n\t * @param shortestCollisionDistance The current value of the shortest distance to a detected collision along the ray.\n\t * @param findClosest\n\t */\n\tpublic testBillboardCollision(billboard:Billboard, pickingCollisionVO:PickingCollisionVO, shortestCollisionDistance:number)\n\t{\n\t\tthis.setLocalRay(pickingCollisionVO.localRayPosition, pickingCollisionVO.localRayDirection);\n\t\tpickingCollisionVO.materialOwner = null;\n\n\t\tif (this._pTestRenderableCollision( this._billboardRenderablePool.getItem(billboard), pickingCollisionVO, shortestCollisionDistance)) {\n\t\t\tshortestCollisionDistance = pickingCollisionVO.rayEntryDistance;\n\n\t\t\tpickingCollisionVO.materialOwner = billboard;\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Tests a Mesh object for a collision with the picking ray.\n\t *\n\t * @param mesh The mesh instance to be tested.\n\t * @param pickingCollisionVO The collision object used to store the collision results\n\t * @param shortestCollisionDistance The current value of the shortest distance to a detected collision along the ray.\n\t * @param findClosest\n\t */\n\tpublic testMeshCollision(mesh:Mesh, pickingCollisionVO:PickingCollisionVO, shortestCollisionDistance:number, findClosest:boolean):boolean\n\t{\n\t\tthis.setLocalRay(pickingCollisionVO.localRayPosition, pickingCollisionVO.localRayDirection);\n\t\tpickingCollisionVO.materialOwner = null;\n\n\t\tvar subMesh:ISubMesh;\n\n\t\tvar len:number = mesh.subMeshes.length;\n\t\tfor (var i:number = 0; i < len; ++i) {\n\t\t\tsubMesh = mesh.subMeshes[i];\n\n\t\t\tif (this._pTestRenderableCollision( this._subMeshRenderablePool.getItem(subMesh), pickingCollisionVO, shortestCollisionDistance)) {\n\t\t\t\tshortestCollisionDistance = pickingCollisionVO.rayEntryDistance;\n\n\t\t\t\tpickingCollisionVO.materialOwner = subMesh;\n\n\t\t\t\tif (!findClosest)\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn pickingCollisionVO.materialOwner != null;\n\t}\n}\n\nexport = PickingColliderBase;", + "import Debug\t\t\t\t\t\t\t= require(\"awayjs-core/lib/utils/Debug\");\nimport BitmapData\t\t\t\t\t\t= require(\"awayjs-core/lib/core/base/BitmapData\");\nimport TriangleSubGeometry\t\t\t\t= require(\"awayjs-core/lib/core/base/TriangleSubGeometry\");\nimport Scene\t\t\t\t\t\t\t= require(\"awayjs-core/lib/containers/Scene\");\nimport View\t\t\t\t\t\t\t\t= require(\"awayjs-core/lib/containers/View\");\nimport Box\t\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Box\");\nimport Matrix3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Matrix3D\");\nimport Matrix3DUtils\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Matrix3DUtils\");\nimport Point\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Point\");\nimport Rectangle\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Rectangle\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport IPicker\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/pick/IPicker\");\nimport PickingCollisionVO\t\t\t\t= require(\"awayjs-core/lib/core/pick/PickingCollisionVO\");\nimport EntityCollector\t\t\t\t\t= require(\"awayjs-core/lib/core/traverse/EntityCollector\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\nimport IEntity\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/IEntity\");\nimport MaterialBase\t\t\t\t\t\t= require(\"awayjs-core/lib/materials/MaterialBase\");\nimport ByteArray\t\t\t\t\t\t= require(\"awayjs-core/lib/utils/ByteArray\");\n\nimport AGALMiniAssembler\t\t\t\t= require(\"awayjs-stagegl/lib/aglsl/assembler/AGALMiniAssembler\");\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport DefaultRenderer\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/render/DefaultRenderer\");\nimport ContextGLBlendFactor\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLBlendFactor\");\nimport ContextGLClearMask\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLClearMask\");\nimport ContextGLCompareMode\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLCompareMode\");\nimport ContextGLProgramType\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLProgramType\");\nimport ContextGLTriangleFace\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLTriangleFace\");\nimport IContextStageGL\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/IContextStageGL\");\nimport IProgram\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/IProgram\");\nimport ITextureBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ITextureBase\");\n\n/**\n * Picks a 3d object from a view or scene by performing a separate render pass on the scene around the area being picked using key color values,\n * then reading back the color value of the pixel in the render representing the picking ray. Requires multiple passes and readbacks for retriving details\n * on an entity that has its shaderPickingDetails property set to true.\n *\n * A read-back operation from any GPU is not a very efficient process, and the amount of processing used can vary significantly between different hardware.\n *\n * @see away.entities.Entity#shaderPickingDetails\n *\n * @class away.pick.ShaderPicker\n */\nclass ShaderPicker implements IPicker\n{\n\tprivate _opaqueRenderableHead:RenderableBase;\n\tprivate _blendedRenderableHead:RenderableBase;\n\n\tprivate _stage:Stage;\n\tprivate _context:IContextStageGL;\n\tprivate _onlyMouseEnabled:boolean = true;\n\n\tprivate _objectProgram:IProgram;\n\tprivate _triangleProgram:IProgram;\n\tprivate _bitmapData:BitmapData;\n\tprivate _viewportData:Array;\n\tprivate _boundOffsetScale:Array;\n\tprivate _id:Array;\n\n\tprivate _interactives:Array = new Array();\n\tprivate _interactiveId:number;\n\tprivate _hitColor:number;\n\tprivate _projX:number;\n\tprivate _projY:number;\n\n\tprivate _hitRenderable:RenderableBase;\n\tprivate _hitEntity:IEntity;\n\tprivate _localHitPosition:Vector3D = new Vector3D();\n\tprivate _hitUV:Point = new Point();\n\tprivate _faceIndex:number;\n\tprivate _subGeometryIndex:number;\n\n\tprivate _localHitNormal:Vector3D = new Vector3D();\n\n\tprivate _rayPos:Vector3D = new Vector3D();\n\tprivate _rayDir:Vector3D = new Vector3D();\n\tprivate _potentialFound:boolean;\n\tprivate static MOUSE_SCISSOR_RECT:Rectangle = new Rectangle(0, 0, 1, 1);\n\n\tprivate _shaderPickingDetails:boolean;\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic get onlyMouseEnabled():boolean\n\t{\n\t\treturn this._onlyMouseEnabled;\n\t}\n\n\tpublic set onlyMouseEnabled(value:boolean)\n\t{\n\t\tthis._onlyMouseEnabled = value;\n\t}\n\n\t/**\n\t * Creates a new ShaderPicker object.\n\t *\n\t * @param shaderPickingDetails Determines whether the picker includes a second pass to calculate extra\n\t * properties such as uv and normal coordinates.\n\t */\n\tconstructor(shaderPickingDetails:boolean = false)\n\t{\n\t\tthis._shaderPickingDetails = shaderPickingDetails;\n\n\t\tthis._id = new Array(4);\n\t\tthis._viewportData = new Array(4); // first 2 contain scale, last 2 translation\n\t\tthis._boundOffsetScale = new Array(8); // first 2 contain scale, last 2 translation\n\t\tthis._boundOffsetScale[3] = 0;\n\t\tthis._boundOffsetScale[7] = 1;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getViewCollision(x:number, y:number, view:View):PickingCollisionVO\n\t{\n\t\tvar collector:EntityCollector = view.iEntityCollector;\n\n\t\tthis._stage = ( view.renderer).stage;\n\n\t\tif (!this._stage)\n\t\t\treturn null;\n\n\t\tthis._context = this._stage.context;\n\n\t\tthis._viewportData[0] = view.width;\n\t\tthis._viewportData[1] = view.height;\n\t\tthis._viewportData[2] = -(this._projX = 2*x/view.width - 1);\n\t\tthis._viewportData[3] = this._projY = 2*y/view.height - 1;\n\n\t\t// _potentialFound will be set to true if any object is actually rendered\n\t\tthis._potentialFound = false;\n\n\t\t//reset head values\n\t\tthis._blendedRenderableHead = null;\n\t\tthis._opaqueRenderableHead = null;\n\n\t\tthis.pDraw(collector, null);\n\n\t\t// clear buffers\n\t\tthis._context.setVertexBufferAt(0, null);\n\n\t\tif (!this._context || !this._potentialFound)\n\t\t\treturn null;\n\n\t\tif (!this._bitmapData)\n\t\t\tthis._bitmapData = new BitmapData(1, 1, false, 0);\n\n\t\tthis._context.drawToBitmapData(this._bitmapData);\n\t\tthis._hitColor = this._bitmapData.getPixel(0, 0);\n\n\t\tif (!this._hitColor) {\n\t\t\tthis._context.present();\n\t\t\treturn null;\n\t\t}\n\n\t\tthis._hitRenderable = this._interactives[this._hitColor - 1];\n\t\tthis._hitEntity = this._hitRenderable.sourceEntity;\n\n\t\tif (this._onlyMouseEnabled && !this._hitEntity._iIsMouseEnabled())\n\t\t\treturn null;\n\n\t\tvar _collisionVO:PickingCollisionVO = this._hitEntity._iPickingCollisionVO;\n\t\tif (this._shaderPickingDetails) {\n\t\t\tthis.getHitDetails(view.camera);\n\t\t\t_collisionVO.localPosition = this._localHitPosition;\n\t\t\t_collisionVO.localNormal = this._localHitNormal;\n\t\t\t_collisionVO.uv = this._hitUV;\n\t\t\t_collisionVO.index = this._faceIndex;\n\t\t\t//_collisionVO.subGeometryIndex = this._subGeometryIndex;\n\n\t\t} else {\n\t\t\t_collisionVO.localPosition = null;\n\t\t\t_collisionVO.localNormal = null;\n\t\t\t_collisionVO.uv = null;\n\t\t\t_collisionVO.index = 0;\n\t\t\t//_collisionVO.subGeometryIndex = 0;\n\t\t}\n\n\t\treturn _collisionVO;\n\t}\n\n\t//*/\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic getSceneCollision(position:Vector3D, direction:Vector3D, scene:Scene):PickingCollisionVO\n\t{\n\t\treturn null;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic pDraw(entityCollector:EntityCollector, target:ITextureBase)\n\t{\n\n\t\tvar camera:Camera = entityCollector.camera;\n\n\t\tthis._context.clear(0, 0, 0, 1);\n\t\tthis._stage.scissorRect = ShaderPicker.MOUSE_SCISSOR_RECT;\n\n\t\tthis._interactives.length = this._interactiveId = 0;\n\n\t\tif (!this._objectProgram)\n\t\t\tthis.initObjectProgram();\n\n\t\tthis._context.setBlendFactors(ContextGLBlendFactor.ONE, ContextGLBlendFactor.ZERO);\n\t\tthis._context.setDepthTest(true, ContextGLCompareMode.LESS);\n\t\tthis._context.setProgram(this._objectProgram);\n\t\tthis._context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX, 4, this._viewportData, 1);\n\t\t//this.drawRenderables(entityCollector.opaqueRenderableHead, camera);\n\t\t//this.drawRenderables(entityCollector.blendedRenderableHead, camera);\n\t\t//TODO: reimplement ShaderPicker inheriting from RendererBase\n\t}\n\n\t/**\n\t * Draw a list of renderables.\n\t * @param renderables The renderables to draw.\n\t * @param camera The camera for which to render.\n\t */\n\tprivate drawRenderables(renderable:RenderableBase, camera:Camera)\n\t{\n\t\tvar matrix:Matrix3D = Matrix3DUtils.CALCULATION_MATRIX;\n\t\tvar viewProjection:Matrix3D = camera.viewProjection;\n\n\t\twhile (renderable) {\n\t\t\t// it's possible that the renderable was already removed from the scene\n\t\t\tif (!renderable.sourceEntity.scene || !renderable.sourceEntity._iIsMouseEnabled()) {\n\t\t\t\trenderable = renderable.next;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tthis._potentialFound = true;\n\n\t\t\tthis._context.setCulling(( renderable.materialOwner.material).bothSides? ContextGLTriangleFace.NONE : ContextGLTriangleFace.BACK, camera.projection.coordinateSystem);\n\n\t\t\tthis._interactives[this._interactiveId++] = renderable;\n\t\t\t// color code so that reading from bitmapdata will contain the correct value\n\t\t\tthis._id[1] = (this._interactiveId >> 8)/255; // on green channel\n\t\t\tthis._id[2] = (this._interactiveId & 0xff)/255; // on blue channel\n\n\t\t\tmatrix.copyFrom(renderable.sourceEntity.getRenderSceneTransform(camera));\n\t\t\tmatrix.append(viewProjection);\n\t\t\tthis._context.setProgramConstantsFromMatrix(ContextGLProgramType.VERTEX, 0, matrix, true);\n\t\t\tthis._context.setProgramConstantsFromArray(ContextGLProgramType.FRAGMENT, 0, this._id, 1);\n\t\t\tthis._context.activateBuffer(0, renderable.getVertexData(TriangleSubGeometry.POSITION_DATA), renderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA), TriangleSubGeometry.POSITION_FORMAT);\n\t\t\tthis._context.drawTriangles(this._context.getIndexBuffer(renderable.getIndexData()), 0, renderable.numTriangles);\n\n\t\t\trenderable = renderable.next;\n\t\t}\n\n\t}\n\n\tprivate updateRay(camera:Camera)\n\t{\n\t\tthis._rayPos = camera.scenePosition;\n\n\t\tthis._rayDir = camera.getRay(this._projX, this._projY, 1);\n\t\tthis._rayDir.normalize();\n\t}\n\n\t/**\n\t * Creates the Program that color-codes objects.\n\t */\n\tprivate initObjectProgram()\n\t{\n\t\tvar vertexCode:string;\n\t\tvar fragmentCode:string;\n\n\t\tthis._objectProgram = this._context.createProgram();\n\n\t\tvertexCode = \"m44 vt0, va0, vc0\t\t\t\\n\" + \"mul vt1.xy, vt0.w, vc4.zw\t\\n\" + \"add vt0.xy, vt0.xy, vt1.xy\t\\n\" + \"mul vt0.xy, vt0.xy, vc4.xy\t\\n\" + \"mov op, vt0\t\\n\";\n\t\tfragmentCode = \"mov oc, fc0\"; // write identifier\n\n\t\tDebug.throwPIR('ShaderPicker', 'initTriangleProgram', 'Dependency: initObjectProgram')\n\t\t//_objectProgram.upload(new AGALMiniAssembler().assemble(ContextGLProgramType.VERTEX, vertexCode),new AGALMiniAssembler().assemble(ContextGLProgramType.FRAGMENT, fragmentCode));\n\t}\n\n\t/**\n\t * Creates the Program that renders positions.\n\t */\n\n\tprivate initTriangleProgram()\n\t{\n\t\tvar vertexCode:string;\n\t\tvar fragmentCode:string;\n\n\t\tthis._triangleProgram = this._context.createProgram();\n\n\t\t// todo: add animation code\n\t\tvertexCode = \"add vt0, va0, vc5 \t\t\t\\n\" + \"mul vt0, vt0, vc6 \t\t\t\\n\" + \"mov v0, vt0\t\t\t\t\\n\" + \"m44 vt0, va0, vc0\t\t\t\\n\" + \"mul vt1.xy, vt0.w, vc4.zw\t\\n\" + \"add vt0.xy, vt0.xy, vt1.xy\t\\n\" + \"mul vt0.xy, vt0.xy, vc4.xy\t\\n\" + \"mov op, vt0\t\\n\";\n\t\tfragmentCode = \"mov oc, v0\"; // write identifier\n\n\t\tvar vertexByteCode:ByteArray = (new AGALMiniAssembler().assemble(\"part vertex 1\\n\" + vertexCode + \"endpart\"))['vertex'].data;\n\t\tvar fragmentByteCode:ByteArray = (new AGALMiniAssembler().assemble(\"part fragment 1\\n\" + fragmentCode + \"endpart\"))['fragment'].data;\n\t\tthis._triangleProgram.upload(vertexByteCode, fragmentByteCode);\n\t}\n\n\t/**\n\t * Gets more detailed information about the hir position, if required.\n\t * @param camera The camera used to view the hit object.\n\t */\n\tprivate getHitDetails(camera:Camera)\n\t{\n\t\tthis.getApproximatePosition(camera);\n\t\tthis.getPreciseDetails(camera);\n\t}\n\n\t/**\n\t * Finds a first-guess approximate position about the hit position.\n\t *\n\t * @param camera The camera used to view the hit object.\n\t */\n\tprivate getApproximatePosition(camera:Camera)\n\t{\n\t\tvar bounds:Box = this._hitRenderable.sourceEntity.bounds.aabb;\n\t\tvar col:number;\n\t\tvar scX:number, scY:number, scZ:number;\n\t\tvar offsX:number, offsY:number, offsZ:number;\n\t\tvar localViewProjection:Matrix3D = Matrix3DUtils.CALCULATION_MATRIX;\n\n\t\tlocalViewProjection.copyFrom(this._hitRenderable.sourceEntity.getRenderSceneTransform(camera));\n\t\tlocalViewProjection.append(camera.viewProjection);\n\t\tif (!this._triangleProgram) {\n\t\t\tthis.initTriangleProgram();\n\t\t}\n\n\t\tthis._boundOffsetScale[4] = 1/(scX = bounds.width);\n\t\tthis._boundOffsetScale[5] = 1/(scY = bounds.height);\n\t\tthis._boundOffsetScale[6] = 1/(scZ = bounds.depth);\n\t\tthis._boundOffsetScale[0] = offsX = -bounds.x;\n\t\tthis._boundOffsetScale[1] = offsY = -bounds.y;\n\t\tthis._boundOffsetScale[2] = offsZ = -bounds.z;\n\n\t\tthis._context.setProgram(this._triangleProgram);\n\t\tthis._context.clear(0, 0, 0, 0, 1, 0, ContextGLClearMask.DEPTH);\n\t\tthis._context.setScissorRectangle(ShaderPicker.MOUSE_SCISSOR_RECT);\n\t\tthis._context.setProgramConstantsFromMatrix(ContextGLProgramType.VERTEX, 0, localViewProjection, true);\n\t\tthis._context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX, 5, this._boundOffsetScale, 2);\n\n\t\tthis._context.activateBuffer(0, this._hitRenderable.getVertexData(TriangleSubGeometry.POSITION_DATA), this._hitRenderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA), TriangleSubGeometry.POSITION_FORMAT);\n\t\tthis._context.drawTriangles(this._context.getIndexBuffer(this._hitRenderable.getIndexData()), 0, this._hitRenderable.numTriangles);\n\n\t\tthis._context.drawToBitmapData(this._bitmapData);\n\n\t\tcol = this._bitmapData.getPixel(0, 0);\n\n\t\tthis._localHitPosition.x = ((col >> 16) & 0xff)*scX/255 - offsX;\n\t\tthis._localHitPosition.y = ((col >> 8) & 0xff)*scY/255 - offsY;\n\t\tthis._localHitPosition.z = (col & 0xff)*scZ/255 - offsZ;\n\t}\n\n\t/**\n\t * Use the approximate position info to find the face under the mouse position from which we can derive the precise\n\t * ray-face intersection point, then use barycentric coordinates to figure out the uv coordinates, etc.\n\t * @param camera The camera used to view the hit object.\n\t */\n\tprivate getPreciseDetails(camera:Camera)\n\t{\n\t\tvar len:number = indices.length;\n\t\tvar x1:number, y1:number, z1:number;\n\t\tvar x2:number, y2:number, z2:number;\n\t\tvar x3:number, y3:number, z3:number;\n\t\tvar i:number = 0, j:number = 1, k:number = 2;\n\t\tvar t1:number, t2:number, t3:number;\n\t\tvar v0x:number, v0y:number, v0z:number;\n\t\tvar v1x:number, v1y:number, v1z:number;\n\t\tvar v2x:number, v2y:number, v2z:number;\n\t\tvar ni1:number, ni2:number, ni3:number;\n\t\tvar n1:number, n2:number, n3:number, nLength:number;\n\t\tvar dot00:number, dot01:number, dot02:number, dot11:number, dot12:number;\n\t\tvar s:number, t:number, invDenom:number;\n\t\tvar x:number = this._localHitPosition.x, y:number = this._localHitPosition.y, z:number = this._localHitPosition.z;\n\t\tvar u:number, v:number;\n\t\tvar ui1:number, ui2:number, ui3:number;\n\t\tvar s0x:number, s0y:number, s0z:number;\n\t\tvar s1x:number, s1y:number, s1z:number;\n\t\tvar nl:number;\n\t\tvar indices:Array = this._hitRenderable.getIndexData().data;\n\n\t\tvar positions:Array = this._hitRenderable.getVertexData(TriangleSubGeometry.POSITION_DATA).data;\n\t\tvar positionStride:number = this._hitRenderable.getVertexData(TriangleSubGeometry.POSITION_DATA).dataPerVertex;\n\t\tvar positionOffset:number = this._hitRenderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA);\n\n\t\tvar uvs:Array = this._hitRenderable.getVertexData(TriangleSubGeometry.UV_DATA).data;\n\t\tvar uvStride:number = this._hitRenderable.getVertexData(TriangleSubGeometry.UV_DATA).dataPerVertex;\n\t\tvar uvOffset:number = this._hitRenderable.getVertexOffset(TriangleSubGeometry.UV_DATA);\n\n\t\tvar normals:Array = this._hitRenderable.getVertexData(TriangleSubGeometry.NORMAL_DATA).data;\n\t\tvar normalStride:number = this._hitRenderable.getVertexData(TriangleSubGeometry.NORMAL_DATA).dataPerVertex;\n\t\tvar normalOffset:number = this._hitRenderable.getVertexOffset(TriangleSubGeometry.NORMAL_DATA);\n\n\t\tthis.updateRay(camera);\n\n\t\twhile (i < len) {\n\t\t\tt1 = positionOffset + indices[i]*positionStride;\n\t\t\tt2 = positionOffset + indices[j]*positionStride;\n\t\t\tt3 = positionOffset + indices[k]*positionStride;\n\t\t\tx1 = positions[t1];\n\t\t\ty1 = positions[t1 + 1];\n\t\t\tz1 = positions[t1 + 2];\n\t\t\tx2 = positions[t2];\n\t\t\ty2 = positions[t2 + 1];\n\t\t\tz2 = positions[t2 + 2];\n\t\t\tx3 = positions[t3];\n\t\t\ty3 = positions[t3 + 1];\n\t\t\tz3 = positions[t3 + 2];\n\n\t\t\t// if within bounds\n\t\t\tif (!( (x < x1 && x < x2 && x < x3) || (y < y1 && y < y2 && y < y3) || (z < z1 && z < z2 && z < z3) || (x > x1 && x > x2 && x > x3) || (y > y1 && y > y2 && y > y3) || (z > z1 && z > z2 && z > z3))) {\n\n\t\t\t\t// calculate barycentric coords for approximated position\n\t\t\t\tv0x = x3 - x1;\n\t\t\t\tv0y = y3 - y1;\n\t\t\t\tv0z = z3 - z1;\n\t\t\t\tv1x = x2 - x1;\n\t\t\t\tv1y = y2 - y1;\n\t\t\t\tv1z = z2 - z1;\n\t\t\t\tv2x = x - x1;\n\t\t\t\tv2y = y - y1;\n\t\t\t\tv2z = z - z1;\n\t\t\t\tdot00 = v0x*v0x + v0y*v0y + v0z*v0z;\n\t\t\t\tdot01 = v0x*v1x + v0y*v1y + v0z*v1z;\n\t\t\t\tdot02 = v0x*v2x + v0y*v2y + v0z*v2z;\n\t\t\t\tdot11 = v1x*v1x + v1y*v1y + v1z*v1z;\n\t\t\t\tdot12 = v1x*v2x + v1y*v2y + v1z*v2z;\n\t\t\t\tinvDenom = 1/(dot00*dot11 - dot01*dot01);\n\t\t\t\ts = (dot11*dot02 - dot01*dot12)*invDenom;\n\t\t\t\tt = (dot00*dot12 - dot01*dot02)*invDenom;\n\n\t\t\t\t// if inside the current triangle, fetch details hit information\n\t\t\t\tif (s >= 0 && t >= 0 && (s + t) <= 1) {\n\n\t\t\t\t\tni1 = normalOffset + indices[i]*normalStride;\n\t\t\t\t\tni2 = normalOffset + indices[j]*normalStride;\n\t\t\t\t\tni3 = normalOffset + indices[k]*normalStride;\n\n\t\t\t\t\tn1 = indices[ni1] + indices[ni2] + indices[ni3];\n\t\t\t\t\tn2 = indices[ni1 + 1] + indices[ni2 + 1] + indices[ni3 + 1];\n\t\t\t\t\tn3 = indices[ni1 + 2] + indices[ni2 + 2] + indices[ni3 + 2];\n\n\t\t\t\t\tnLength = Math.sqrt(n1*n1 + n2*n2 + n3*n3);\n\n\t\t\t\t\tn1 /= nLength;\n\t\t\t\t\tn2 /= nLength;\n\t\t\t\t\tn3 /= nLength;\n\n\t\t\t\t\t// this is def the triangle, now calculate precise coords\n\t\t\t\t\tthis.getPrecisePosition(this._hitRenderable.sourceEntity.inverseSceneTransform, n1, n2, n3, x1, y1, z1);\n\n\t\t\t\t\tv2x = this._localHitPosition.x - x1;\n\t\t\t\t\tv2y = this._localHitPosition.y - y1;\n\t\t\t\t\tv2z = this._localHitPosition.z - z1;\n\n\t\t\t\t\ts0x = x2 - x1; // s0 = p1 - p0\n\t\t\t\t\ts0y = y2 - y1;\n\t\t\t\t\ts0z = z2 - z1;\n\t\t\t\t\ts1x = x3 - x1; // s1 = p2 - p0\n\t\t\t\t\ts1y = y3 - y1;\n\t\t\t\t\ts1z = z3 - z1;\n\t\t\t\t\tthis._localHitNormal.x = s0y*s1z - s0z*s1y; // n = s0 x s1\n\t\t\t\t\tthis._localHitNormal.y = s0z*s1x - s0x*s1z;\n\t\t\t\t\tthis._localHitNormal.z = s0x*s1y - s0y*s1x;\n\t\t\t\t\tnl = 1/Math.sqrt(this._localHitNormal.x*this._localHitNormal.x + this._localHitNormal.y*this._localHitNormal.y + this._localHitNormal.z*this._localHitNormal.z); // normalize n\n\t\t\t\t\tthis._localHitNormal.x *= nl;\n\t\t\t\t\tthis._localHitNormal.y *= nl;\n\t\t\t\t\tthis._localHitNormal.z *= nl;\n\n\t\t\t\t\tdot02 = v0x*v2x + v0y*v2y + v0z*v2z;\n\t\t\t\t\tdot12 = v1x*v2x + v1y*v2y + v1z*v2z;\n\t\t\t\t\ts = (dot11*dot02 - dot01*dot12)*invDenom;\n\t\t\t\t\tt = (dot00*dot12 - dot01*dot02)*invDenom;\n\n\t\t\t\t\tui1 = uvOffset + indices[i]*uvStride\n\t\t\t\t\tui2 = uvOffset + indices[j]*uvStride\n\t\t\t\t\tui3 = uvOffset + indices[k]*uvStride\n\n\t\t\t\t\tu = uvs[ui1];\n\t\t\t\t\tv = uvs[ui1 + 1];\n\t\t\t\t\tthis._hitUV.x = u + t*(uvs[ui2] - u) + s*(uvs[ui3] - u);\n\t\t\t\t\tthis._hitUV.y = v + t*(uvs[ui2 + 1] - v) + s*(uvs[ui3 + 1] - v);\n\n\t\t\t\t\tthis._faceIndex = i;\n\t\t\t\t\t//TODO add back subGeometryIndex value\n\t\t\t\t\t//this._subGeometryIndex = away.utils.GeometryUtils.getMeshSubGeometryIndex(subGeom);\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ti += 3;\n\t\t\tj += 3;\n\t\t\tk += 3;\n\t\t}\n\t}\n\n\t/**\n\t * Finds the precise hit position by unprojecting the screen coordinate back unto the hit face's plane and\n\t * calculating the intersection point.\n\t * @param camera The camera used to render the object.\n\t * @param invSceneTransform The inverse scene transformation of the hit object.\n\t * @param nx The x-coordinate of the face's plane normal.\n\t * @param ny The y-coordinate of the face plane normal.\n\t * @param nz The z-coordinate of the face plane normal.\n\t * @param px The x-coordinate of a point on the face's plane (ie a face vertex)\n\t * @param py The y-coordinate of a point on the face's plane (ie a face vertex)\n\t * @param pz The z-coordinate of a point on the face's plane (ie a face vertex)\n\t */\n\n\tprivate getPrecisePosition(invSceneTransform:Matrix3D, nx:number, ny:number, nz:number, px:number, py:number, pz:number)\n\t{\n\t\t// calculate screen ray and find exact intersection position with triangle\n\t\tvar rx:number, ry:number, rz:number;\n\t\tvar ox:number, oy:number, oz:number;\n\t\tvar t:number;\n\t\tvar raw:Array = Matrix3DUtils.RAW_DATA_CONTAINER;\n\t\tvar cx:number = this._rayPos.x, cy:number = this._rayPos.y, cz:number = this._rayPos.z;\n\n\t\t// unprojected projection point, gives ray dir in cam space\n\t\tox = this._rayDir.x;\n\t\toy = this._rayDir.y;\n\t\toz = this._rayDir.z;\n\n\t\t// transform ray dir and origin (cam pos) to object space\n\t\t//invSceneTransform.copyRawDataTo( raw );\n\t\tinvSceneTransform.copyRawDataTo(raw);\n\t\trx = raw[0]*ox + raw[4]*oy + raw[8]*oz;\n\t\try = raw[1]*ox + raw[5]*oy + raw[9]*oz;\n\t\trz = raw[2]*ox + raw[6]*oy + raw[10]*oz;\n\n\t\tox = raw[0]*cx + raw[4]*cy + raw[8]*cz + raw[12];\n\t\toy = raw[1]*cx + raw[5]*cy + raw[9]*cz + raw[13];\n\t\toz = raw[2]*cx + raw[6]*cy + raw[10]*cz + raw[14];\n\n\t\tt = ((px - ox)*nx + (py - oy)*ny + (pz - oz)*nz)/(rx*nx + ry*ny + rz*nz);\n\n\t\tthis._localHitPosition.x = ox + rx*t;\n\t\tthis._localHitPosition.y = oy + ry*t;\n\t\tthis._localHitPosition.z = oz + rz*t;\n\t}\n\n\tpublic dispose()\n\t{\n\t\tthis._bitmapData.dispose();\n\t\tif (this._triangleProgram)\n\t\t\tthis._triangleProgram.dispose();\n\n\t\tif (this._objectProgram)\n\t\t\tthis._objectProgram.dispose();\n\n\t\tthis._triangleProgram = null;\n\t\tthis._objectProgram = null;\n\t\tthis._bitmapData = null;\n\t\tthis._hitRenderable = null;\n\t\tthis._hitEntity = null;\n\t}\n}\n\nexport = ShaderPicker;", + "import AnimationNodeBase\t\t\t\t= require(\"awayjs-core/lib/animators/nodes/AnimationNodeBase\");\nimport Event\t\t\t\t\t\t\t= require(\"awayjs-core/lib/events/Event\");\n\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport IAnimationState\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/states/IAnimationState\");\n\n/**\n * Dispatched to notify changes in an animation state's state.\n */\nclass AnimationStateEvent extends Event\n{\n\t/**\n\t * Dispatched when a non-looping clip node inside an animation state reaches the end of its timeline.\n\t */\n\tpublic static PLAYBACK_COMPLETE:string = \"playbackComplete\";\n\n\tpublic static TRANSITION_COMPLETE:string = \"transitionComplete\";\n\n\tprivate _animator:AnimatorBase;\n\tprivate _animationState:IAnimationState;\n\tprivate _animationNode:AnimationNodeBase;\n\n\t/**\n\t * Create a new AnimatonStateEvent\n\t *\n\t * @param type The event type.\n\t * @param animator The animation state object that is the subject of this event.\n\t * @param animationNode The animation node inside the animation state from which the event originated.\n\t */\n\tconstructor(type:string, animator:AnimatorBase, animationState:IAnimationState, animationNode:AnimationNodeBase)\n\t{\n\t\tsuper(type);\n\n\t\tthis._animator = animator;\n\t\tthis._animationState = animationState;\n\t\tthis._animationNode = animationNode;\n\t}\n\n\t/**\n\t * The animator object that is the subject of this event.\n\t */\n\tpublic get animator():AnimatorBase\n\t{\n\t\treturn this._animator;\n\t}\n\n\t/**\n\t * The animation state object that is the subject of this event.\n\t */\n\tpublic get animationState():IAnimationState\n\t{\n\t\treturn this._animationState;\n\t}\n\n\t/**\n\t * The animation node inside the animation state from which the event originated.\n\t */\n\tpublic get animationNode():AnimationNodeBase\n\t{\n\t\treturn this._animationNode;\n\t}\n\n\t/**\n\t * Clones the event.\n\t *\n\t * @return An exact duplicate of the current object.\n\t */\n\tpublic clone():Event\n\t{\n\t\treturn new AnimationStateEvent(this.type, this._animator, this._animationState, this._animationNode);\n\t}\n}\n\nexport = AnimationStateEvent;", + "import CubeTextureBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/CubeTextureBase\");\n\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport IContextStageGL\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/IContextStageGL\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport AmbientBasicMethod\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/AmbientBasicMethod\");\nimport ShaderCompilerHelper\t\t\t\t= require(\"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper\");\n\n/**\n * AmbientEnvMapMethod provides a diffuse shading method that uses a diffuse irradiance environment map to\n * approximate global lighting rather than lights.\n */\nclass AmbientEnvMapMethod extends AmbientBasicMethod\n{\n\tprivate _cubeTexture:CubeTextureBase;\n\t\n\t/**\n\t * Creates a new AmbientEnvMapMethod object.\n\t *\n\t * @param envMap The cube environment map to use for the ambient lighting.\n\t */\n\tconstructor(envMap:CubeTextureBase)\n\t{\n\t\tsuper();\n\t\tthis._cubeTexture = envMap;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitVO(shaderObject:ShaderObjectBase, methodVO:MethodVO)\n\t{\n\t\tsuper.iInitVO(shaderObject, methodVO);\n\n\t\tmethodVO.needsNormals = true;\n\t}\n\t\n\t/**\n\t * The cube environment map to use for the diffuse lighting.\n\t */\n\tpublic get envMap():CubeTextureBase\n\t{\n\t\treturn this._cubeTexture;\n\t}\n\t\n\tpublic set envMap(value:CubeTextureBase)\n\t{\n\t\tthis._cubeTexture = value;\n\t}\n\t\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tsuper.iActivate(shaderObject, methodVO, stage);\n\n\t\t( stage.context).activateCubeTexture(methodVO.texturesIndex, this._cubeTexture);\n\t}\n\t\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, regCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar code:string = \"\";\n\t\tvar ambientInputRegister:ShaderRegisterElement;\n\t\tvar cubeMapReg:ShaderRegisterElement = regCache.getFreeTextureReg();\n\t\tmethodVO.texturesIndex = cubeMapReg.index;\n\t\t\n\t\tcode += ShaderCompilerHelper.getTexCubeSampleCode(targetReg, cubeMapReg, this._cubeTexture, shaderObject.useSmoothTextures, shaderObject.useMipmapping, sharedRegisters.normalFragment);\n\n\t\tambientInputRegister = regCache.getFreeFragmentConstant();\n\t\tmethodVO.fragmentConstantsIndex = ambientInputRegister.index;\n\t\t\n\t\tcode += \"add \" + targetReg + \".xyz, \" + targetReg + \".xyz, \" + ambientInputRegister + \".xyz\\n\";\n\t\t\n\t\treturn code;\n\t}\n}\n\nexport = AmbientEnvMapMethod;", + "import Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport IContextStageGL\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/IContextStageGL\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderLightingObject\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderLightingObject\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport DiffuseBasicMethod\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/DiffuseBasicMethod\");\nimport ShaderCompilerHelper\t\t\t\t= require(\"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper\");\n\nimport DiffuseCompositeMethod\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/DiffuseCompositeMethod\");\n\n/**\n * DiffuseCelMethod provides a shading method to add diffuse cel (cartoon) shading.\n */\nclass DiffuseCelMethod extends DiffuseCompositeMethod\n{\n\tprivate _levels:number /*uint*/;\n\tprivate _dataReg:ShaderRegisterElement;\n\tprivate _smoothness:number = .1;\n\n\t/**\n\t * Creates a new DiffuseCelMethod object.\n\t * @param levels The amount of shadow gradations.\n\t * @param baseMethod An optional diffuse method on which the cartoon shading is based. If omitted, DiffuseBasicMethod is used.\n\t */\n\tconstructor(levels:number /*uint*/ = 3, baseMethod:DiffuseBasicMethod = null)\n\t{\n\t\tsuper(null, baseMethod);\n\n\t\tthis.baseMethod._iModulateMethod = (shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData) => this.clampDiffuse(shaderObject, methodVO, targetReg, registerCache, sharedRegisters);\n\n\t\tthis._levels = levels;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitConstants(shaderObject:ShaderLightingObject, methodVO:MethodVO)\n\t{\n\t\tvar data:Array = shaderObject.fragmentConstantData;\n\t\tvar index:number /*int*/ = methodVO.secondaryFragmentConstantsIndex;\n\t\tsuper.iInitConstants(shaderObject, methodVO);\n\t\tdata[index + 1] = 1;\n\t\tdata[index + 2] = 0;\n\t}\n\n\t/**\n\t * The amount of shadow gradations.\n\t */\n\tpublic get levels():number /*uint*/\n\t{\n\t\treturn this._levels;\n\t}\n\n\tpublic set levels(value:number /*uint*/)\n\t{\n\t\tthis._levels = value;\n\t}\n\n\t/**\n\t * The smoothness of the edge between 2 shading levels.\n\t */\n\tpublic get smoothness():number\n\t{\n\t\treturn this._smoothness;\n\t}\n\n\tpublic set smoothness(value:number)\n\t{\n\t\tthis._smoothness = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iCleanCompilationData()\n\t{\n\t\tsuper.iCleanCompilationData();\n\t\tthis._dataReg = null;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentPreLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tthis._dataReg = registerCache.getFreeFragmentConstant();\n\t\tmethodVO.secondaryFragmentConstantsIndex = this._dataReg.index*4;\n\n\t\treturn super.iGetFragmentPreLightingCode(shaderObject, methodVO, registerCache, sharedRegisters);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderLightingObject, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tsuper.iActivate(shaderObject, methodVO, stage);\n\t\tvar data:Array = shaderObject.fragmentConstantData;\n\t\tvar index:number /*int*/ = methodVO.secondaryFragmentConstantsIndex;\n\t\tdata[index] = this._levels;\n\t\tdata[index + 3] = this._smoothness;\n\t}\n\n\t/**\n\t * Snaps the diffuse shading of the wrapped method to one of the levels.\n\t * @param vo The MethodVO used to compile the current shader.\n\t * @param t The register containing the diffuse strength in the \"w\" component.\n\t * @param regCache The register cache used for the shader compilation.\n\t * @param sharedRegisters The shared register data for this shader.\n\t * @return The AGAL fragment code for the method.\n\t */\n\tprivate clampDiffuse(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\treturn \"mul \" + targetReg + \".w, \" + targetReg + \".w, \" + this._dataReg + \".x\\n\" +\n\t\t\t\"frc \" + targetReg + \".z, \" + targetReg + \".w\\n\" +\n\t\t\t\"sub \" + targetReg + \".y, \" + targetReg + \".w, \" + targetReg + \".z\\n\" +\n\t\t\t\"mov \" + targetReg + \".x, \" + this._dataReg + \".x\\n\" +\n\t\t\t\"sub \" + targetReg + \".x, \" + targetReg + \".x, \" + this._dataReg + \".y\\n\" +\n\t\t\t\"rcp \" + targetReg + \".x,\" + targetReg + \".x\\n\" +\n\t\t\t\"mul \" + targetReg + \".w, \" + targetReg + \".y, \" + targetReg + \".x\\n\" +\n\n\t\t\t// previous clamped strength\n\t\t\t\"sub \" + targetReg + \".y, \" + targetReg + \".w, \" + targetReg + \".x\\n\" +\n\n\t\t\t// fract/epsilon (so 0 - epsilon will become 0 - 1)\n\t\t\t\"div \" + targetReg + \".z, \" + targetReg + \".z, \" + this._dataReg + \".w\\n\" +\n\t\t\t\"sat \" + targetReg + \".z, \" + targetReg + \".z\\n\" +\n\n\t\t\t\"mul \" + targetReg + \".w, \" + targetReg + \".w, \" + targetReg + \".z\\n\" +\n\t\t\t// 1-z\n\t\t\t\"sub \" + targetReg + \".z, \" + this._dataReg + \".y, \" + targetReg + \".z\\n\" +\n\t\t\t\"mul \" + targetReg + \".y, \" + targetReg + \".y, \" + targetReg + \".z\\n\" +\n\t\t\t\"add \" + targetReg + \".w, \" + targetReg + \".w, \" + targetReg + \".y\\n\" +\n\t\t\t\"sat \" + targetReg + \".w, \" + targetReg + \".w\\n\";\n\t}\n}\n\nexport = DiffuseCelMethod;", + "import Texture2DBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/Texture2DBase\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport ShadingMethodEvent\t\t\t\t= require(\"awayjs-stagegl/lib/events/ShadingMethodEvent\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderLightingObject\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderLightingObject\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport DiffuseBasicMethod\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/DiffuseBasicMethod\");\n\n/**\n * DiffuseCompositeMethod provides a base class for diffuse methods that wrap a diffuse method to alter the\n * calculated diffuse reflection strength.\n */\nclass DiffuseCompositeMethod extends DiffuseBasicMethod\n{\n\tpublic pBaseMethod:DiffuseBasicMethod;\n\n\tprivate _onShaderInvalidatedDelegate:Function;\n\n\t/**\n\t * Creates a new DiffuseCompositeMethod object.\n\t *\n\t * @param modulateMethod The method which will add the code to alter the base method's strength. It needs to have the signature clampDiffuse(t:ShaderRegisterElement, regCache:ShaderRegisterCache):string, in which t.w will contain the diffuse strength.\n\t * @param baseMethod The base diffuse method on which this method's shading is based.\n\t */\n\tconstructor(modulateMethod:(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData) => string, baseMethod:DiffuseBasicMethod = null)\n\t{\n\t\tsuper();\n\n\t\tthis._onShaderInvalidatedDelegate = (event:ShadingMethodEvent) => this.onShaderInvalidated(event);\n\n\t\tthis.pBaseMethod = baseMethod || new DiffuseBasicMethod();\n\t\tthis.pBaseMethod._iModulateMethod = modulateMethod;\n\t\tthis.pBaseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate);\n\t}\n\n\t/**\n\t * The base diffuse method on which this method's shading is based.\n\t */\n\tpublic get baseMethod():DiffuseBasicMethod\n\t{\n\t\treturn this.pBaseMethod;\n\t}\n\n\tpublic set baseMethod(value:DiffuseBasicMethod)\n\t{\n\t\tif (this.pBaseMethod == value)\n\t\t\treturn;\n\n\t\tthis.pBaseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate);\n\t\tthis.pBaseMethod = value;\n\t\tthis.pBaseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate);\n\t\tthis.iInvalidateShaderProgram();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitVO(shaderObject:ShaderLightingObject, methodVO:MethodVO)\n\t{\n\t\tthis.pBaseMethod.iInitVO(shaderObject, methodVO);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitConstants(shaderObject:ShaderLightingObject, methodVO:MethodVO)\n\t{\n\t\tthis.pBaseMethod.iInitConstants(shaderObject, methodVO);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic dispose()\n\t{\n\t\tthis.pBaseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate);\n\t\tthis.pBaseMethod.dispose();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic get texture():Texture2DBase\n\t{\n\t\treturn this.pBaseMethod.texture;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic set texture(value:Texture2DBase)\n\t{\n\t\tthis.pBaseMethod.texture = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic get diffuseColor():number\n\t{\n\t\treturn this.pBaseMethod.diffuseColor;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic set diffuseColor(value:number)\n\t{\n\t\tthis.pBaseMethod.diffuseColor = value;\n\t}\n\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic get ambientColor():number\n\t{\n\t\treturn this.pBaseMethod.ambientColor;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic set ambientColor(value:number)\n\t{\n\t\tthis.pBaseMethod.ambientColor = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentPreLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\treturn this.pBaseMethod.iGetFragmentPreLightingCode(shaderObject, methodVO, registerCache, sharedRegisters);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentCodePerLight(shaderObject:ShaderLightingObject, methodVO:MethodVO, lightDirReg:ShaderRegisterElement, lightColReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar code:string = this.pBaseMethod.iGetFragmentCodePerLight(shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters);\n\t\tthis._pTotalLightColorReg = this.pBaseMethod._pTotalLightColorReg;\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentCodePerProbe(shaderObject:ShaderLightingObject, methodVO:MethodVO, cubeMapReg:ShaderRegisterElement, weightRegister:string, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar code:string = this.pBaseMethod.iGetFragmentCodePerProbe(shaderObject, methodVO, cubeMapReg, weightRegister, registerCache, sharedRegisters);\n\t\tthis._pTotalLightColorReg = this.pBaseMethod._pTotalLightColorReg;\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderLightingObject, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tthis.pBaseMethod.iActivate(shaderObject, methodVO, stage);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iSetRenderState(shaderObject:ShaderLightingObject, methodVO:MethodVO, renderable:RenderableBase, stage:Stage, camera:Camera)\n\t{\n\t\tthis.pBaseMethod.iSetRenderState(shaderObject, methodVO, renderable, stage, camera);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iDeactivate(shaderObject:ShaderLightingObject, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tthis.pBaseMethod.iDeactivate(shaderObject, methodVO, stage);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetVertexCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\treturn this.pBaseMethod.iGetVertexCode(shaderObject, methodVO, registerCache, sharedRegisters);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentPostLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\treturn this.pBaseMethod.iGetFragmentPostLightingCode(shaderObject, methodVO, targetReg, registerCache, sharedRegisters);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iReset()\n\t{\n\t\tthis.pBaseMethod.iReset();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iCleanCompilationData()\n\t{\n\t\tsuper.iCleanCompilationData();\n\t\tthis.pBaseMethod.iCleanCompilationData();\n\t}\n\n\t/**\n\t * Called when the base method's shader code is invalidated.\n\t */\n\tprivate onShaderInvalidated(event:ShadingMethodEvent)\n\t{\n\t\tthis.iInvalidateShaderProgram();\n\t}\n}\n\nexport = DiffuseCompositeMethod;", + "import MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderLightingObject\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderLightingObject\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport DiffuseBasicMethod\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/DiffuseBasicMethod\");\nimport ShaderCompilerHelper\t\t\t\t= require(\"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper\");\n\n/**\n * DiffuseDepthMethod provides a debug method to visualise depth maps\n */\nclass DiffuseDepthMethod extends DiffuseBasicMethod\n{\n\t/**\n\t * Creates a new DiffuseBasicMethod object.\n\t */\n\tconstructor()\n\t{\n\t\tsuper();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO)\n\t{\n\t\tvar data:Array = shaderObject.fragmentConstantData;\n\t\tvar index:number /*int*/ = methodVO.fragmentConstantsIndex;\n\t\tdata[index] = 1.0;\n\t\tdata[index + 1] = 1/255.0;\n\t\tdata[index + 2] = 1/65025.0;\n\t\tdata[index + 3] = 1/16581375.0;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentPostLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar code:string = \"\";\n\t\tvar temp:ShaderRegisterElement;\n\t\tvar decReg:ShaderRegisterElement;\n\n\t\tif (!this._pUseTexture)\n\t\t\tthrow new Error(\"DiffuseDepthMethod requires texture!\");\n\n\t\t// incorporate input from ambient\n\t\tif (shaderObject.numLights > 0) {\n\t\t\tif (sharedRegisters.shadowTarget)\n\t\t\t\tcode += \"mul \" + this._pTotalLightColorReg + \".xyz, \" + this._pTotalLightColorReg + \".xyz, \" + sharedRegisters.shadowTarget + \".w\\n\";\n\t\t\tcode += \"add \" + targetReg + \".xyz, \" + this._pTotalLightColorReg + \".xyz, \" + targetReg + \".xyz\\n\" +\n\t\t\t\t\"sat \" + targetReg + \".xyz, \" + targetReg + \".xyz\\n\";\n\t\t\tregisterCache.removeFragmentTempUsage(this._pTotalLightColorReg);\n\t\t}\n\n\t\ttemp = shaderObject.numLights > 0? registerCache.getFreeFragmentVectorTemp():targetReg;\n\n\t\tthis._pDiffuseInputRegister = registerCache.getFreeTextureReg();\n\t\tmethodVO.texturesIndex = this._pDiffuseInputRegister.index;\n\t\tdecReg = registerCache.getFreeFragmentConstant();\n\t\tmethodVO.fragmentConstantsIndex = decReg.index*4;\n\t\tcode += ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, this._pDiffuseInputRegister, this.texture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping) +\n\t\t\t\"dp4 \" + temp + \".x, \" + temp + \", \" + decReg + \"\\n\" +\n\t\t\t\"mov \" + temp + \".yz, \" + temp + \".xx\t\t\t\\n\" +\n\t\t\t\"mov \" + temp + \".w, \" + decReg + \".x\\n\" +\n\t\t\t\"sub \" + temp + \".xyz, \" + decReg + \".xxx, \" + temp + \".xyz\\n\";\n\n\t\tif (shaderObject.numLights == 0)\n\t\t\treturn code;\n\n\t\tcode += \"mul \" + targetReg + \".xyz, \" + temp + \".xyz, \" + targetReg + \".xyz\\n\" +\n\t\t\t\"mov \" + targetReg + \".w, \" + temp + \".w\\n\";\n\n\t\treturn code;\n\t}\n}\n\nexport = DiffuseDepthMethod;", + "import Texture2DBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/Texture2DBase\");\n\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport IContextStageGL\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/IContextStageGL\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderLightingObject\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderLightingObject\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport DiffuseBasicMethod\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/DiffuseBasicMethod\");\nimport ShaderCompilerHelper\t\t\t\t= require(\"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper\");\n\n/**\n * DiffuseGradientMethod is an alternative to DiffuseBasicMethod in which the shading can be modulated with a gradient\n * to introduce color-tinted shading as opposed to the single-channel diffuse strength. This can be used as a crude\n * approximation to subsurface scattering (for instance, the mid-range shading for skin can be tinted red to similate\n * scattered light within the skin attributing to the final colour)\n */\nclass DiffuseGradientMethod extends DiffuseBasicMethod\n{\n\tprivate _gradientTextureRegister:ShaderRegisterElement;\n\tprivate _gradient:Texture2DBase;\n\n\t/**\n\t * Creates a new DiffuseGradientMethod object.\n\t * @param gradient A texture that contains the light colour based on the angle. This can be used to change\n\t * the light colour due to subsurface scattering when the surface faces away from the light.\n\t */\n\tconstructor(gradient:Texture2DBase)\n\t{\n\t\tsuper();\n\n\t\tthis._gradient = gradient;\n\t}\n\n\t/**\n\t * A texture that contains the light colour based on the angle. This can be used to change the light colour\n\t * due to subsurface scattering when the surface faces away from the light.\n\t */\n\tpublic get gradient():Texture2DBase\n\t{\n\t\treturn this._gradient;\n\t}\n\n\tpublic set gradient(value:Texture2DBase)\n\t{\n\t\tif (value.hasMipmaps != this._gradient.hasMipmaps || value.format != this._gradient.format)\n\t\t\tthis.iInvalidateShaderProgram();\n\t\tthis._gradient = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iCleanCompilationData()\n\t{\n\t\tsuper.iCleanCompilationData();\n\t\tthis._gradientTextureRegister = null;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentPreLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar code:string = super.iGetFragmentPreLightingCode(shaderObject, methodVO, registerCache, sharedRegisters);\n\t\tthis._pIsFirstLight = true;\n\n\t\tif (shaderObject.numLights > 0) {\n\t\t\tthis._gradientTextureRegister = registerCache.getFreeTextureReg();\n\t\t\tmethodVO.secondaryTexturesIndex = this._gradientTextureRegister.index;\n\t\t}\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentCodePerLight(shaderObject:ShaderLightingObject, methodVO:MethodVO, lightDirReg:ShaderRegisterElement, lightColReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar code:string = \"\";\n\t\tvar t:ShaderRegisterElement;\n\n\t\t// write in temporary if not first light, so we can add to total diffuse colour\n\t\tif (this._pIsFirstLight)\n\t\t\tt = this._pTotalLightColorReg;\n\t\telse {\n\t\t\tt = registerCache.getFreeFragmentVectorTemp();\n\t\t\tregisterCache.addFragmentTempUsages(t, 1);\n\t\t}\n\n\t\tcode += \"dp3 \" + t + \".w, \" + lightDirReg + \".xyz, \" + sharedRegisters.normalFragment + \".xyz\\n\" +\n\t\t\t\"mul \" + t + \".w, \" + t + \".w, \" + sharedRegisters.commons + \".x\\n\" +\n\t\t\t\"add \" + t + \".w, \" + t + \".w, \" + sharedRegisters.commons + \".x\\n\" +\n\t\t\t\"mul \" + t + \".xyz, \" + t + \".w, \" + lightDirReg + \".w\\n\";\n\n\t\tif (this._iModulateMethod != null)\n\t\t\tcode += this._iModulateMethod(shaderObject, methodVO, t, registerCache, sharedRegisters);\n\n\t\tcode += ShaderCompilerHelper.getTex2DSampleCode(t, sharedRegisters, this._gradientTextureRegister, this._gradient, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, t, \"clamp\") +\n\t\t\t//\t\t\t\t\t\"mul \" + t + \".xyz, \" + t + \".xyz, \" + t + \".w\\n\" +\n\t\t\t\"mul \" + t + \".xyz, \" + t + \".xyz, \" + lightColReg + \".xyz\\n\";\n\n\t\tif (!this._pIsFirstLight) {\n\t\t\tcode += \"add \" + this._pTotalLightColorReg + \".xyz, \" + this._pTotalLightColorReg + \".xyz, \" + t + \".xyz\\n\";\n\t\t\tregisterCache.removeFragmentTempUsage(t);\n\t\t}\n\n\t\tthis._pIsFirstLight = false;\n\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic pApplyShadow(shaderObject:ShaderLightingObject, methodVO:MethodVO, regCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar t:ShaderRegisterElement = regCache.getFreeFragmentVectorTemp();\n\n\t\treturn \"mov \" + t + \", \" + sharedRegisters.shadowTarget + \".wwww\\n\" +\n\t\t\tShaderCompilerHelper.getTex2DSampleCode(t, sharedRegisters, this._gradientTextureRegister, this._gradient, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, t, \"clamp\") +\n\t\t\t\"mul \" + this._pTotalLightColorReg + \".xyz, \" + this._pTotalLightColorReg + \", \" + t + \"\\n\";\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderLightingObject, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tsuper.iActivate(shaderObject, methodVO, stage);\n\n\t\t( stage.context).activateTexture(methodVO.secondaryTexturesIndex, this._gradient);\n\t}\n}\n\nexport = DiffuseGradientMethod;", + "import Texture2DBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/Texture2DBase\");\n\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport IContextStageGL\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/IContextStageGL\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderLightingObject\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderLightingObject\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport DiffuseBasicMethod\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/DiffuseBasicMethod\");\nimport ShaderCompilerHelper\t\t\t\t= require(\"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper\");\n\nimport DiffuseCompositeMethod\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/DiffuseCompositeMethod\");\n\n/**\n * DiffuseLightMapMethod provides a diffuse shading method that uses a light map to modulate the calculated diffuse\n * lighting. It is different from EffectLightMapMethod in that the latter modulates the entire calculated pixel color, rather\n * than only the diffuse lighting value.\n */\nclass DiffuseLightMapMethod extends DiffuseCompositeMethod\n{\n\t/**\n\t * Indicates the light map should be multiplied with the calculated shading result.\n\t * This can be used to add pre-calculated shadows or occlusion.\n\t */\n\tpublic static MULTIPLY:string = \"multiply\";\n\n\t/**\n\t * Indicates the light map should be added into the calculated shading result.\n\t * This can be used to add pre-calculated lighting or global illumination.\n\t */\n\tpublic static ADD:string = \"add\";\n\n\tprivate _lightMapTexture:Texture2DBase;\n\tprivate _blendMode:string;\n\tprivate _useSecondaryUV:boolean;\n\n\t/**\n\t * Creates a new DiffuseLightMapMethod method.\n\t *\n\t * @param lightMap The texture containing the light map.\n\t * @param blendMode The blend mode with which the light map should be applied to the lighting result.\n\t * @param useSecondaryUV Indicates whether the secondary UV set should be used to map the light map.\n\t * @param baseMethod The diffuse method used to calculate the regular diffuse-based lighting.\n\t */\n\tconstructor(lightMap:Texture2DBase, blendMode:string = \"multiply\", useSecondaryUV:boolean = false, baseMethod:DiffuseBasicMethod = null)\n\t{\n\t\tsuper(null, baseMethod);\n\n\t\tthis._useSecondaryUV = useSecondaryUV;\n\t\tthis._lightMapTexture = lightMap;\n\t\tthis.blendMode = blendMode;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitVO(shaderObject:ShaderLightingObject, methodVO:MethodVO)\n\t{\n\t\tmethodVO.needsSecondaryUV = this._useSecondaryUV;\n\t\tmethodVO.needsUV = !this._useSecondaryUV;\n\t}\n\n\t/**\n\t * The blend mode with which the light map should be applied to the lighting result.\n\t *\n\t * @see DiffuseLightMapMethod.ADD\n\t * @see DiffuseLightMapMethod.MULTIPLY\n\t */\n\tpublic get blendMode():string\n\t{\n\t\treturn this._blendMode;\n\t}\n\n\tpublic set blendMode(value:string)\n\t{\n\t\tif (value != DiffuseLightMapMethod.ADD && value != DiffuseLightMapMethod.MULTIPLY)\n\t\t\tthrow new Error(\"Unknown blendmode!\");\n\n\t\tif (this._blendMode == value)\n\t\t\treturn;\n\n\t\tthis._blendMode = value;\n\n\t\tthis.iInvalidateShaderProgram();\n\t}\n\n\t/**\n\t * The texture containing the light map data.\n\t */\n\tpublic get lightMapTexture():Texture2DBase\n\t{\n\t\treturn this._lightMapTexture;\n\t}\n\n\tpublic set lightMapTexture(value:Texture2DBase)\n\t{\n\t\tthis._lightMapTexture = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderLightingObject, methodVO:MethodVO, stage:Stage)\n\t{\n\t\t( stage.context).activateTexture(methodVO.secondaryTexturesIndex, this._lightMapTexture);\n\n\t\tsuper.iActivate(shaderObject, methodVO, stage);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentPostLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar code:string;\n\t\tvar lightMapReg:ShaderRegisterElement = registerCache.getFreeTextureReg();\n\t\tvar temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp();\n\t\tmethodVO.secondaryTexturesIndex = lightMapReg.index;\n\n\t\tcode = ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, lightMapReg, this._lightMapTexture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, sharedRegisters.secondaryUVVarying);\n\n\t\tswitch (this._blendMode) {\n\t\t\tcase DiffuseLightMapMethod.MULTIPLY:\n\t\t\t\tcode += \"mul \" + this._pTotalLightColorReg + \", \" + this._pTotalLightColorReg + \", \" + temp + \"\\n\";\n\t\t\t\tbreak;\n\t\t\tcase DiffuseLightMapMethod.ADD:\n\t\t\t\tcode += \"add \" + this._pTotalLightColorReg + \", \" + this._pTotalLightColorReg + \", \" + temp + \"\\n\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\tcode += super.iGetFragmentPostLightingCode(shaderObject, methodVO, targetReg, registerCache, sharedRegisters);\n\n\t\treturn code;\n\t}\n}\n\nexport = DiffuseLightMapMethod;", + "import Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport IContextStageGL\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/IContextStageGL\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderLightingObject\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderLightingObject\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport DiffuseBasicMethod\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/DiffuseBasicMethod\");\nimport MaterialPassBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/passes/MaterialPassBase\");\n\nimport DiffuseCompositeMethod\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/DiffuseCompositeMethod\");\nimport SingleObjectDepthPass\t\t\t= require(\"awayjs-renderergl/lib/materials/passes/SingleObjectDepthPass\");\n\n/**\n * DiffuseSubSurfaceMethod provides a depth map-based diffuse shading method that mimics the scattering of\n * light inside translucent surfaces. It allows light to shine through an object and to soften the diffuse shading.\n * It can be used for candle wax, ice, skin, ...\n */\nclass DiffuseSubSurfaceMethod extends DiffuseCompositeMethod\n{\n\tprivate _depthPass:SingleObjectDepthPass;\n\tprivate _lightProjVarying:ShaderRegisterElement;\n\tprivate _propReg:ShaderRegisterElement;\n\tprivate _scattering:number;\n\tprivate _translucency:number = 1;\n\tprivate _lightColorReg:ShaderRegisterElement;\n\tprivate _scatterColor:number /*uint*/ = 0xffffff;\n\tprivate _colorReg:ShaderRegisterElement;\n\tprivate _decReg:ShaderRegisterElement;\n\tprivate _scatterR:number = 1.0;\n\tprivate _scatterG:number = 1.0;\n\tprivate _scatterB:number = 1.0;\n\tprivate _targetReg:ShaderRegisterElement;\n\t\n\t/**\n\t * Creates a new DiffuseSubSurfaceMethod object.\n\t *\n\t * @param depthMapSize The size of the depth map used.\n\t * @param depthMapOffset The amount by which the rendered object will be inflated, to prevent depth map rounding errors.\n\t * @param baseMethod The diffuse method used to calculate the regular diffuse-based lighting.\n\t */\n\tconstructor(depthMapSize:number /*int*/ = 512, depthMapOffset:number = 15, baseMethod:DiffuseBasicMethod = null)\n\t{\n\t\tsuper(null, baseMethod);\n\n\t\tthis.pBaseMethod._iModulateMethod = (shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData) => this.scatterLight(shaderObject, methodVO, targetReg, registerCache, sharedRegisters);\n\n\t\tthis._passes = new Array();\n\t\tthis._depthPass = new SingleObjectDepthPass();\n\t\tthis._depthPass.textureSize = depthMapSize;\n\t\tthis._depthPass.polyOffset = depthMapOffset;\n\t\tthis._passes.push(this._depthPass);\n\t\tthis._scattering = 0.2;\n\t\tthis._translucency = 1;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitConstants(shaderObject:ShaderLightingObject, methodVO:MethodVO)\n\t{\n\t\tsuper.iInitConstants(shaderObject, methodVO);\n\n\t\tvar data:Array = shaderObject.vertexConstantData;\n\t\tvar index:number /*int*/ = methodVO.secondaryVertexConstantsIndex;\n\t\tdata[index] = .5;\n\t\tdata[index + 1] = -.5;\n\t\tdata[index + 2] = 0;\n\t\tdata[index + 3] = 1;\n\t\t\n\t\tdata = shaderObject.fragmentConstantData;\n\t\tindex = methodVO.secondaryFragmentConstantsIndex;\n\t\tdata[index + 3] = 1.0;\n\t\tdata[index + 4] = 1.0;\n\t\tdata[index + 5] = 1/255;\n\t\tdata[index + 6] = 1/65025;\n\t\tdata[index + 7] = 1/16581375;\n\t\tdata[index + 10] = .5;\n\t\tdata[index + 11] = -.1;\n\t}\n\t\n\tpublic iCleanCompilationData()\n\t{\n\t\tsuper.iCleanCompilationData();\n\n\t\tthis._lightProjVarying = null;\n\t\tthis._propReg = null;\n\t\tthis._lightColorReg = null;\n\t\tthis._colorReg = null;\n\t\tthis._decReg = null;\n\t\tthis._targetReg = null;\n\t}\n\t\n\t/**\n\t * The amount by which the light scatters. It can be used to set the translucent surface's thickness. Use low\n\t * values for skin.\n\t */\n\tpublic get scattering():number\n\t{\n\t\treturn this._scattering;\n\t}\n\t\n\tpublic set scattering(value:number)\n\t{\n\t\tthis._scattering = value;\n\t}\n\t\n\t/**\n\t * The translucency of the object.\n\t */\n\tpublic get translucency():number\n\t{\n\t\treturn this._translucency;\n\t}\n\t\n\tpublic set translucency(value:number)\n\t{\n\t\tthis._translucency = value;\n\t}\n\t\n\t/**\n\t * The colour of the \"insides\" of the object, ie: the colour the light becomes after leaving the object.\n\t */\n\tpublic get scatterColor():number /*uint*/\n\t{\n\t\treturn this._scatterColor;\n\t}\n\t\n\tpublic set scatterColor(scatterColor:number /*uint*/)\n\t{\n\t\tthis._scatterColor = scatterColor;\n\t\tthis._scatterR = ((scatterColor >> 16) & 0xff)/0xff;\n\t\tthis._scatterG = ((scatterColor >> 8) & 0xff)/0xff;\n\t\tthis._scatterB = (scatterColor & 0xff)/0xff;\n\t}\n\t\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetVertexCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar code:string = super.iGetVertexCode(shaderObject, methodVO, registerCache, sharedRegisters);\n\t\tvar lightProjection:ShaderRegisterElement;\n\t\tvar toTexRegister:ShaderRegisterElement;\n\t\tvar temp:ShaderRegisterElement = registerCache.getFreeVertexVectorTemp();\n\t\t\n\t\ttoTexRegister = registerCache.getFreeVertexConstant();\n\t\tmethodVO.secondaryVertexConstantsIndex = toTexRegister.index*4;\n\n\t\tthis._lightProjVarying = registerCache.getFreeVarying();\n\t\tlightProjection = registerCache.getFreeVertexConstant();\n\t\tregisterCache.getFreeVertexConstant();\n\t\tregisterCache.getFreeVertexConstant();\n\t\tregisterCache.getFreeVertexConstant();\n\t\t\n\t\tcode += \"m44 \" + temp + \", vt0, \" + lightProjection + \"\\n\" +\n\t\t\t\"div \" + temp + \".xyz, \" + temp + \".xyz, \" + temp + \".w\\n\" +\n\t\t\t\"mul \" + temp + \".xy, \" + temp + \".xy, \" + toTexRegister + \".xy\\n\" +\n\t\t\t\"add \" + temp + \".xy, \" + temp + \".xy, \" + toTexRegister + \".xx\\n\" +\n\t\t\t\"mov \" + this._lightProjVarying + \".xyz, \" + temp + \".xyz\\n\" +\n\t\t\t\"mov \" + this._lightProjVarying + \".w, va0.w\\n\";\n\t\t\n\t\treturn code;\n\t}\n\t\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentPreLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tthis._colorReg = registerCache.getFreeFragmentConstant();\n\t\tthis._decReg = registerCache.getFreeFragmentConstant();\n\t\tthis._propReg = registerCache.getFreeFragmentConstant();\n\t\tmethodVO.secondaryFragmentConstantsIndex = this._colorReg.index*4;\n\t\t\n\t\treturn super.iGetFragmentPreLightingCode(shaderObject, methodVO, registerCache, sharedRegisters);\n\t}\n\t\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentCodePerLight(shaderObject:ShaderLightingObject, methodVO:MethodVO, lightDirReg:ShaderRegisterElement, lightColReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tthis._pIsFirstLight = true;\n\t\tthis._lightColorReg = lightColReg;\n\t\treturn super.iGetFragmentCodePerLight(shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters);\n\t}\n\t\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentPostLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar code:string = super.iGetFragmentPostLightingCode(shaderObject, methodVO, targetReg, registerCache, sharedRegisters);\n\t\tvar temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp();\n\t\t\n\t\tcode += \"mul \" + temp + \".xyz, \" + this._lightColorReg + \".xyz, \" + this._targetReg + \".w\\n\" +\n\t\t\t\"mul \" + temp + \".xyz, \" + temp + \".xyz, \" + this._colorReg + \".xyz\\n\" +\n\t\t\t\"add \" + targetReg + \".xyz, \" + targetReg + \".xyz, \" + temp + \".xyz\\n\";\n\t\t\n\t\tif (this._targetReg != sharedRegisters.viewDirFragment)\n\t\t\tregisterCache.removeFragmentTempUsage(targetReg);\n\t\t\n\t\treturn code;\n\t}\n\t\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderLightingObject, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tsuper.iActivate(shaderObject, methodVO, stage);\n\t\t\n\t\tvar index:number /*int*/ = methodVO.secondaryFragmentConstantsIndex;\n\t\tvar data:Array = shaderObject.fragmentConstantData;\n\t\tdata[index] = this._scatterR;\n\t\tdata[index + 1] = this._scatterG;\n\t\tdata[index + 2] = this._scatterB;\n\t\tdata[index + 8] = this._scattering;\n\t\tdata[index + 9] = this._translucency;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iSetRenderState(shaderObject:ShaderObjectBase, methodVO:MethodVO, renderable:RenderableBase, stage:Stage, camera:Camera)\n\t{\n\t\t( stage.context).activateTexture(methodVO.secondaryTexturesIndex, this._depthPass._iGetDepthMap(renderable));\n\n\t\tthis._depthPass._iGetProjection(renderable).copyRawDataTo(shaderObject.vertexConstantData, methodVO.secondaryVertexConstantsIndex + 4, true);\n\t}\n\t\n\t/**\n\t * Generates the code for this method\n\t */\n\tprivate scatterLight(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\t// only scatter first light\n\t\tif (!this._pIsFirstLight)\n\t\t\treturn \"\";\n\n\t\tthis._pIsFirstLight = false;\n\n\t\tvar code:string = \"\";\n\t\tvar depthReg:ShaderRegisterElement = registerCache.getFreeTextureReg();\n\n\t\tif (sharedRegisters.viewDirFragment) {\n\t\t\tthis._targetReg = sharedRegisters.viewDirFragment;\n\t\t} else {\n\t\t\tthis._targetReg = registerCache.getFreeFragmentVectorTemp();\n\t\t\tregisterCache.addFragmentTempUsages(this._targetReg, 1);\n\t\t}\n\n\t\tmethodVO.secondaryTexturesIndex = depthReg.index;\n\t\t\n\t\tvar temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp();\n\t\tcode += \"tex \" + temp + \", \" + this._lightProjVarying + \", \" + depthReg + \" <2d,nearest,clamp>\\n\" +\n\t\t\t// reencode RGBA\n\t\t\t\"dp4 \" + targetReg + \".z, \" + temp + \", \" + this._decReg + \"\\n\";\n\t\t// currentDistanceToLight - closestDistanceToLight\n\t\tcode += \"sub \" + targetReg + \".z, \" + this._lightProjVarying + \".z, \" + targetReg + \".z\\n\" +\n\t\t\t\n\t\t\t\"sub \" + targetReg + \".z, \" + this._propReg + \".x, \" + targetReg + \".z\\n\" +\n\t\t\t\"mul \" + targetReg + \".z, \" + this._propReg + \".y, \" + targetReg + \".z\\n\" +\n\t\t\t\"sat \" + targetReg + \".z, \" + targetReg + \".z\\n\" +\n\t\t\t\n\t\t\t// targetReg.x contains dot(lightDir, normal)\n\t\t\t// modulate according to incident light angle (scatter = scatter*(-.5*dot(light, normal) + .5)\n\t\t\t\"neg \" + targetReg + \".y, \" + targetReg + \".x\\n\" +\n\t\t\t\"mul \" + targetReg + \".y, \" + targetReg + \".y, \" + this._propReg + \".z\\n\" +\n\t\t\t\"add \" + targetReg + \".y, \" + targetReg + \".y, \" + this._propReg + \".z\\n\" +\n\t\t\t\"mul \" + this._targetReg + \".w, \" + targetReg + \".z, \" + targetReg + \".y\\n\" +\n\t\t\t\n\t\t\t// blend diffuse: d' = (1-s)*d + s*1\n\t\t\t\"sub \" + targetReg + \".y, \" + this._colorReg + \".w, \" + this._targetReg + \".w\\n\" +\n\t\t\t\"mul \" + targetReg + \".w, \" + targetReg + \".w, \" + targetReg + \".y\\n\";\n\t\t\n\t\treturn code;\n\t}\n}\n\nexport = DiffuseSubSurfaceMethod;", + "import Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderLightingObject\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderLightingObject\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport DiffuseBasicMethod\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/DiffuseBasicMethod\");\n\n/**\n * DiffuseWrapMethod is an alternative to DiffuseBasicMethod in which the light is allowed to be \"wrapped around\" the normally dark area, to some extent.\n * It can be used as a crude approximation to Oren-Nayar or simple subsurface scattering.\n */\nclass DiffuseWrapMethod extends DiffuseBasicMethod\n{\n\tprivate _wrapDataRegister:ShaderRegisterElement;\n\tprivate _wrapFactor:number;\n\n\t/**\n\t * Creates a new DiffuseWrapMethod object.\n\t * @param wrapFactor A factor to indicate the amount by which the light is allowed to wrap\n\t */\n\tconstructor(wrapFactor:number = .5)\n\t{\n\t\tsuper();\n\n\t\tthis.wrapFactor = wrapFactor;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iCleanCompilationData()\n\t{\n\t\tsuper.iCleanCompilationData();\n\n\t\tthis._wrapDataRegister = null;\n\t}\n\n\t/**\n\t * A factor to indicate the amount by which the light is allowed to wrap.\n\t */\n\tpublic get wrapFactor():number\n\t{\n\t\treturn this._wrapFactor;\n\t}\n\n\tpublic set wrapFactor(value:number)\n\t{\n\t\tthis._wrapFactor = value;\n\t\tthis._wrapFactor = 1/(value + 1);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentPreLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar code:string = super.iGetFragmentPreLightingCode(shaderObject, methodVO, registerCache, sharedRegisters);\n\t\tthis._pIsFirstLight = true;\n\t\tthis._wrapDataRegister = registerCache.getFreeFragmentConstant();\n\t\tmethodVO.secondaryFragmentConstantsIndex = this._wrapDataRegister.index*4;\n\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentCodePerLight(shaderObject:ShaderLightingObject, methodVO:MethodVO, lightDirReg:ShaderRegisterElement, lightColReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar code:string = \"\";\n\t\tvar t:ShaderRegisterElement;\n\n\t\t// write in temporary if not first light, so we can add to total diffuse colour\n\t\tif (this._pIsFirstLight) {\n\t\t\tt = this._pTotalLightColorReg;\n\t\t} else {\n\t\t\tt = registerCache.getFreeFragmentVectorTemp();\n\t\t\tregisterCache.addFragmentTempUsages(t, 1);\n\t\t}\n\n\t\tcode += \"dp3 \" + t + \".x, \" + lightDirReg + \".xyz, \" + sharedRegisters.normalFragment + \".xyz\\n\" +\n\t\t\t\"add \" + t + \".y, \" + t + \".x, \" + this._wrapDataRegister + \".x\\n\" +\n\t\t\t\"mul \" + t + \".y, \" + t + \".y, \" + this._wrapDataRegister + \".y\\n\" +\n\t\t\t\"sat \" + t + \".w, \" + t + \".y\\n\" +\n\t\t\t\"mul \" + t + \".xz, \" + t + \".w, \" + lightDirReg + \".wz\\n\";\n\n\t\tif (this._iModulateMethod != null)\n\t\t\tcode += this._iModulateMethod(shaderObject, methodVO, lightDirReg, registerCache, sharedRegisters);\n\n\t\tcode += \"mul \" + t + \", \" + t + \".x, \" + lightColReg + \"\\n\";\n\n\t\tif (!this._pIsFirstLight) {\n\t\t\tcode += \"add \" + this._pTotalLightColorReg + \".xyz, \" + this._pTotalLightColorReg + \".xyz, \" + t + \".xyz\\n\";\n\t\t\tregisterCache.removeFragmentTempUsage(t);\n\t\t}\n\n\t\tthis._pIsFirstLight = false;\n\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderLightingObject, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tsuper.iActivate(shaderObject, methodVO, stage);\n\n\t\tvar index:number /*int*/ = methodVO.secondaryFragmentConstantsIndex;\n\t\tvar data:Array = shaderObject.fragmentConstantData;\n\t\tdata[index] = this._wrapFactor;\n\t\tdata[index + 1] = 1/(this._wrapFactor + 1);\n\t}\n}\n\nexport = DiffuseWrapMethod;", + "import Texture2DBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/Texture2DBase\");\n\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport IContextStageGL\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/IContextStageGL\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderLightingObject\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderLightingObject\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport EffectMethodBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/EffectMethodBase\");\nimport ShaderCompilerHelper\t\t\t\t= require(\"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper\");\n\n/**\n * EffectAlphaMaskMethod allows the use of an additional texture to specify the alpha value of the material. When used\n * with the secondary uv set, it allows for a tiled main texture with independently varying alpha (useful for water\n * etc).\n */\nclass EffectAlphaMaskMethod extends EffectMethodBase\n{\n\tprivate _texture:Texture2DBase;\n\tprivate _useSecondaryUV:boolean;\n\n\t/**\n\t * Creates a new EffectAlphaMaskMethod object.\n\t *\n\t * @param texture The texture to use as the alpha mask.\n\t * @param useSecondaryUV Indicated whether or not the secondary uv set for the mask. This allows mapping alpha independently.\n\t */\n\tconstructor(texture:Texture2DBase, useSecondaryUV:boolean = false)\n\t{\n\t\tsuper();\n\n\t\tthis._texture = texture;\n\t\tthis._useSecondaryUV = useSecondaryUV;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitVO(shaderObject:ShaderObjectBase, methodVO:MethodVO)\n\t{\n\t\tmethodVO.needsSecondaryUV = this._useSecondaryUV;\n\t\tmethodVO.needsUV = !this._useSecondaryUV;\n\t}\n\n\t/**\n\t * Indicated whether or not the secondary uv set for the mask. This allows mapping alpha independently, for\n\t * instance to tile the main texture and normal map while providing untiled alpha, for example to define the\n\t * transparency over a tiled water surface.\n\t */\n\tpublic get useSecondaryUV():boolean\n\t{\n\t\treturn this._useSecondaryUV;\n\t}\n\n\tpublic set useSecondaryUV(value:boolean)\n\t{\n\t\tif (this._useSecondaryUV == value)\n\t\t\treturn;\n\t\tthis._useSecondaryUV = value;\n\t\tthis.iInvalidateShaderProgram();\n\t}\n\n\t/**\n\t * The texture to use as the alpha mask.\n\t */\n\tpublic get texture():Texture2DBase\n\t{\n\t\treturn this._texture;\n\t}\n\n\tpublic set texture(value:Texture2DBase)\n\t{\n\t\tthis._texture = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderLightingObject, methodVO:MethodVO, stage:Stage)\n\t{\n\t\t( stage.context).activateTexture(methodVO.texturesIndex, this._texture);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar textureReg:ShaderRegisterElement = registerCache.getFreeTextureReg();\n\t\tvar temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp();\n\t\tvar uvReg:ShaderRegisterElement = this._useSecondaryUV? sharedRegisters.secondaryUVVarying : sharedRegisters.uvVarying;\n\t\tmethodVO.texturesIndex = textureReg.index;\n\n\t\treturn ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, textureReg, this._texture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, uvReg) +\n\t\t\t\"mul \" + targetReg + \", \" + targetReg + \", \" + temp + \".x\\n\";\n\t}\n}\n\nexport = EffectAlphaMaskMethod;", + "import Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport EffectMethodBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/EffectMethodBase\");\n\n/**\n * EffectColorMatrixMethod provides a shading method that changes the colour of a material analogous to a ColorMatrixFilter.\n */\nclass EffectColorMatrixMethod extends EffectMethodBase\n{\n\tprivate _matrix:Array;\n\n\t/**\n\t * Creates a new EffectColorTransformMethod.\n\t *\n\t * @param matrix An array of 20 items for 4 x 5 color transform.\n\t */\n\tconstructor(matrix:Array)\n\t{\n\t\tsuper();\n\n\t\tif (matrix.length != 20)\n\t\t\tthrow new Error(\"Matrix length must be 20!\");\n\n\t\tthis._matrix = matrix;\n\t}\n\n\t/**\n\t * The 4 x 5 matrix to transform the color of the material.\n\t */\n\tpublic get colorMatrix():Array\n\t{\n\t\treturn this._matrix;\n\t}\n\n\tpublic set colorMatrix(value:Array)\n\t{\n\t\tthis._matrix = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar code:string = \"\";\n\t\tvar colorMultReg:ShaderRegisterElement = registerCache.getFreeFragmentConstant();\n\t\tregisterCache.getFreeFragmentConstant();\n\t\tregisterCache.getFreeFragmentConstant();\n\t\tregisterCache.getFreeFragmentConstant();\n\n\t\tvar colorOffsetReg:ShaderRegisterElement = registerCache.getFreeFragmentConstant();\n\n\t\tmethodVO.fragmentConstantsIndex = colorMultReg.index*4;\n\n\t\tvar temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp();\n\n\t\tcode += \"m44 \" + temp + \", \" + targetReg + \", \" + colorMultReg + \"\\n\" +\n\t\t\t\t\"add \" + targetReg + \", \" + temp + \", \" + colorOffsetReg + \"\\n\";\n\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tvar matrix:Array = this._matrix;\n\t\tvar index:number /*int*/ = methodVO.fragmentConstantsIndex;\n\t\tvar data:Array = shaderObject.fragmentConstantData;\n\n\t\t// r\n\t\tdata[index] = matrix[0];\n\t\tdata[index + 1] = matrix[1];\n\t\tdata[index + 2] = matrix[2];\n\t\tdata[index + 3] = matrix[3];\n\n\t\t// g\n\t\tdata[index + 4] = matrix[5];\n\t\tdata[index + 5] = matrix[6];\n\t\tdata[index + 6] = matrix[7];\n\t\tdata[index + 7] = matrix[8];\n\n\t\t// b\n\t\tdata[index + 8] = matrix[10];\n\t\tdata[index + 9] = matrix[11];\n\t\tdata[index + 10] = matrix[12];\n\t\tdata[index + 11] = matrix[13];\n\n\t\t// a\n\t\tdata[index + 12] = matrix[15];\n\t\tdata[index + 13] = matrix[16];\n\t\tdata[index + 14] = matrix[17];\n\t\tdata[index + 15] = matrix[18];\n\n\t\t// rgba offset\n\t\tdata[index + 16] = matrix[4];\n\t\tdata[index + 17] = matrix[9];\n\t\tdata[index + 18] = matrix[14];\n\t\tdata[index + 19] = matrix[19];\n\t}\n}\n\nexport = EffectColorMatrixMethod;", + "import CubeTextureBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/CubeTextureBase\");\nimport Texture2DBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/Texture2DBase\");\n\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport IContextStageGL\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/IContextStageGL\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport EffectMethodBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/EffectMethodBase\");\nimport ShaderCompilerHelper\t\t\t\t= require(\"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper\");\n\n/**\n * EffectEnvMapMethod provides a material method to perform reflection mapping using cube maps.\n */\nclass EffectEnvMapMethod extends EffectMethodBase\n{\n\tprivate _cubeTexture:CubeTextureBase;\n\tprivate _alpha:number;\n\tprivate _mask:Texture2DBase;\n\n\t/**\n\t * Creates an EffectEnvMapMethod object.\n\t * @param envMap The environment map containing the reflected scene.\n\t * @param alpha The reflectivity of the surface.\n\t */\n\tconstructor(envMap:CubeTextureBase, alpha:number = 1)\n\t{\n\t\tsuper();\n\t\tthis._cubeTexture = envMap;\n\t\tthis._alpha = alpha;\n\n\t}\n\n\t/**\n\t * An optional texture to modulate the reflectivity of the surface.\n\t */\n\tpublic get mask():Texture2DBase\n\t{\n\t\treturn this._mask;\n\t}\n\n\tpublic set mask(value:Texture2DBase)\n\t{\n\t\tif (value != this._mask || (value && this._mask && (value.hasMipmaps != this._mask.hasMipmaps || value.format != this._mask.format)))\n\t\t\tthis.iInvalidateShaderProgram();\n\n\t\tthis._mask = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitVO(shaderObject:ShaderObjectBase, methodVO:MethodVO)\n\t{\n\t\tmethodVO.needsNormals = true;\n\t\tmethodVO.needsView = true;\n\t\tmethodVO.needsUV = this._mask != null;\n\t}\n\n\t/**\n\t * The cubic environment map containing the reflected scene.\n\t */\n\tpublic get envMap():CubeTextureBase\n\t{\n\t\treturn this._cubeTexture;\n\t}\n\n\tpublic set envMap(value:CubeTextureBase)\n\t{\n\t\tthis._cubeTexture = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic dispose()\n\t{\n\t}\n\n\t/**\n\t * The reflectivity of the surface.\n\t */\n\tpublic get alpha():number\n\t{\n\t\treturn this._alpha;\n\t}\n\n\tpublic set alpha(value:number)\n\t{\n\t\tthis._alpha = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tshaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex] = this._alpha;\n\n\t\t( stage.context).activateCubeTexture(methodVO.texturesIndex, this._cubeTexture);\n\t\tif (this._mask)\n\t\t\t( stage.context).activateTexture(methodVO.texturesIndex + 1, this._mask);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar dataRegister:ShaderRegisterElement = registerCache.getFreeFragmentConstant();\n\t\tvar temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp();\n\t\tvar code:string = \"\";\n\t\tvar cubeMapReg:ShaderRegisterElement = registerCache.getFreeTextureReg();\n\n\t\tmethodVO.texturesIndex = cubeMapReg.index;\n\t\tmethodVO.fragmentConstantsIndex = dataRegister.index*4;\n\n\t\tregisterCache.addFragmentTempUsages(temp, 1);\n\t\tvar temp2:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp();\n\n\t\t// r = I - 2(I.N)*N\n\t\tcode += \"dp3 \" + temp + \".w, \" + sharedRegisters.viewDirFragment + \".xyz, \" + sharedRegisters.normalFragment + \".xyz\\n\" +\n\t\t\t\t\"add \" + temp + \".w, \" + temp + \".w, \" + temp + \".w\\n\" +\n\t\t\t\t\"mul \" + temp + \".xyz, \" + sharedRegisters.normalFragment + \".xyz, \" + temp + \".w\\n\" +\n\t\t\t\t\"sub \" + temp + \".xyz, \" + temp + \".xyz, \" + sharedRegisters.viewDirFragment + \".xyz\\n\" +\n\t\t\tShaderCompilerHelper.getTexCubeSampleCode(temp, cubeMapReg, this._cubeTexture, shaderObject.useSmoothTextures, shaderObject.useMipmapping, temp) +\n\t\t\t\t\"sub \" + temp2 + \".w, \" + temp + \".w, fc0.x\\n\" + // -.5\n\t\t\t\t\"kil \" + temp2 + \".w\\n\" +\t// used for real time reflection mapping - if alpha is not 1 (mock texture) kil output\n\t\t\t\t\"sub \" + temp + \", \" + temp + \", \" + targetReg + \"\\n\";\n\n\t\tif (this._mask)\n\t\t\tcode += ShaderCompilerHelper.getTex2DSampleCode(temp2, sharedRegisters, registerCache.getFreeTextureReg(), this._mask, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping) +\n\t\t\t\t\"mul \" + temp + \", \" + temp2 + \", \" + temp + \"\\n\";\n\n\t\tcode += \"mul \" + temp + \", \" + temp + \", \" + dataRegister + \".x\\n\" +\n\t\t\t\t\"add \" + targetReg + \", \" + targetReg + \", \" + temp + \"\\n\";\n\n\t\tregisterCache.removeFragmentTempUsage(temp);\n\n\t\treturn code;\n\t}\n}\n\nexport = EffectEnvMapMethod;", + "import Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderLightingObject\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderLightingObject\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport EffectMethodBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/EffectMethodBase\");\n\n/**\n * EffectFogMethod provides a method to add distance-based fog to a material.\n */\nclass EffectFogMethod extends EffectMethodBase\n{\n\tprivate _minDistance:number = 0;\n\tprivate _maxDistance:number = 1000;\n\tprivate _fogColor:number /*uint*/;\n\tprivate _fogR:number;\n\tprivate _fogG:number;\n\tprivate _fogB:number;\n\n\t/**\n\t * Creates a new EffectFogMethod object.\n\t * @param minDistance The distance from which the fog starts appearing.\n\t * @param maxDistance The distance at which the fog is densest.\n\t * @param fogColor The colour of the fog.\n\t */\n\tconstructor(minDistance:number, maxDistance:number, fogColor:number /*uint*/ = 0x808080)\n\t{\n\t\tsuper();\n\t\tthis.minDistance = minDistance;\n\t\tthis.maxDistance = maxDistance;\n\t\tthis.fogColor = fogColor;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitVO(shaderObject:ShaderLightingObject, methodVO:MethodVO)\n\t{\n\t\tmethodVO.needsProjection = true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO)\n\t{\n\t\tvar data:Array = shaderObject.fragmentConstantData;\n\t\tvar index:number /*int*/ = methodVO.fragmentConstantsIndex;\n\t\tdata[index + 3] = 1;\n\t\tdata[index + 6] = 0;\n\t\tdata[index + 7] = 0;\n\t}\n\n\t/**\n\t * The distance from which the fog starts appearing.\n\t */\n\tpublic get minDistance():number\n\t{\n\t\treturn this._minDistance;\n\t}\n\n\tpublic set minDistance(value:number)\n\t{\n\t\tthis._minDistance = value;\n\t}\n\n\t/**\n\t * The distance at which the fog is densest.\n\t */\n\tpublic get maxDistance():number\n\t{\n\t\treturn this._maxDistance;\n\t}\n\n\tpublic set maxDistance(value:number)\n\t{\n\t\tthis._maxDistance = value;\n\t}\n\n\t/**\n\t * The colour of the fog.\n\t */\n\tpublic get fogColor():number /*uint*/\n\t{\n\t\treturn this._fogColor;\n\t}\n\n\tpublic set fogColor(value:number/*uint*/)\n\t{\n\t\tthis._fogColor = value;\n\t\tthis._fogR = ((value >> 16) & 0xff)/0xff;\n\t\tthis._fogG = ((value >> 8) & 0xff)/0xff;\n\t\tthis._fogB = (value & 0xff)/0xff;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tvar data:Array = shaderObject.fragmentConstantData;\n\t\tvar index:number /*int*/ = methodVO.fragmentConstantsIndex;\n\t\tdata[index] = this._fogR;\n\t\tdata[index + 1] = this._fogG;\n\t\tdata[index + 2] = this._fogB;\n\t\tdata[index + 4] = this._minDistance;\n\t\tdata[index + 5] = 1/(this._maxDistance - this._minDistance);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar fogColor:ShaderRegisterElement = registerCache.getFreeFragmentConstant();\n\t\tvar fogData:ShaderRegisterElement = registerCache.getFreeFragmentConstant();\n\t\tvar temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp();\n\t\tregisterCache.addFragmentTempUsages(temp, 1);\n\t\tvar temp2:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp();\n\t\tvar code:string = \"\";\n\t\tmethodVO.fragmentConstantsIndex = fogColor.index*4;\n\n\t\tcode += \"sub \" + temp2 + \".w, \" + sharedRegisters.projectionFragment + \".z, \" + fogData + \".x\\n\" +\n\t\t\t\t\"mul \" + temp2 + \".w, \" + temp2 + \".w, \" + fogData + \".y\\n\" +\n\t\t\t\t\"sat \" + temp2 + \".w, \" + temp2 + \".w\\n\" +\n\t\t\t\t\"sub \" + temp + \", \" + fogColor + \", \" + targetReg + \"\\n\" + // (fogColor- col)\n\t\t\t\t\"mul \" + temp + \", \" + temp + \", \" + temp2 + \".w\\n\" + // (fogColor- col)*fogRatio\n\t\t\t\t\"add \" + targetReg + \", \" + targetReg + \", \" + temp + \"\\n\"; // fogRatio*(fogColor- col) + col\n\n\t\tregisterCache.removeFragmentTempUsage(temp);\n\n\t\treturn code;\n\t}\n}\n\nexport = EffectFogMethod;", + "import CubeTextureBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/CubeTextureBase\");\nimport Texture2DBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/Texture2DBase\");\n\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport IContextStageGL\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/IContextStageGL\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport EffectMethodBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/EffectMethodBase\");\nimport ShaderCompilerHelper\t\t\t\t= require(\"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper\");\n\n/**\n * EffectFresnelEnvMapMethod provides a method to add fresnel-based reflectivity to an object using cube maps, which gets\n * stronger as the viewing angle becomes more grazing.\n */\nclass EffectFresnelEnvMapMethod extends EffectMethodBase\n{\n\tprivate _cubeTexture:CubeTextureBase;\n\tprivate _fresnelPower:number = 5;\n\tprivate _normalReflectance:number = 0;\n\tprivate _alpha:number;\n\tprivate _mask:Texture2DBase;\n\n\t/**\n\t * Creates a new EffectFresnelEnvMapMethod object.\n\t *\n\t * @param envMap The environment map containing the reflected scene.\n\t * @param alpha The reflectivity of the material.\n\t */\n\tconstructor(envMap:CubeTextureBase, alpha:number = 1)\n\t{\n\t\tsuper();\n\n\t\tthis._cubeTexture = envMap;\n\t\tthis._alpha = alpha;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitVO(shaderObject:ShaderObjectBase, methodVO:MethodVO)\n\t{\n\t\tmethodVO.needsNormals = true;\n\t\tmethodVO.needsView = true;\n\t\tmethodVO.needsUV = this._mask != null;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO)\n\t{\n\t\tshaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex + 3] = 1;\n\t}\n\n\t/**\n\t * An optional texture to modulate the reflectivity of the surface.\n\t */\n\tpublic get mask():Texture2DBase\n\t{\n\t\treturn this._mask;\n\t}\n\n\tpublic set mask(value:Texture2DBase)\n\t{\n\t\tif (Boolean(value) != Boolean(this._mask) ||\n\t\t\t(value && this._mask && (value.hasMipmaps != this._mask.hasMipmaps || value.format != this._mask.format))) {\n\t\t\tthis.iInvalidateShaderProgram();\n\t\t}\n\t\tthis._mask = value;\n\t}\n\n\t/**\n\t * The power used in the Fresnel equation. Higher values make the fresnel effect more pronounced. Defaults to 5.\n\t */\n\tpublic get fresnelPower():number\n\t{\n\t\treturn this._fresnelPower;\n\t}\n\n\tpublic set fresnelPower(value:number)\n\t{\n\t\tthis._fresnelPower = value;\n\t}\n\n\t/**\n\t * The cubic environment map containing the reflected scene.\n\t */\n\tpublic get envMap():CubeTextureBase\n\t{\n\t\treturn this._cubeTexture;\n\t}\n\n\tpublic set envMap(value:CubeTextureBase)\n\t{\n\t\tthis._cubeTexture = value;\n\t}\n\n\t/**\n\t * The reflectivity of the surface.\n\t */\n\tpublic get alpha():number\n\t{\n\t\treturn this._alpha;\n\t}\n\n\tpublic set alpha(value:number)\n\t{\n\t\tthis._alpha = value;\n\t}\n\n\t/**\n\t * The minimum amount of reflectance, ie the reflectance when the view direction is normal to the surface or light direction.\n\t */\n\tpublic get normalReflectance():number\n\t{\n\t\treturn this._normalReflectance;\n\t}\n\n\tpublic set normalReflectance(value:number)\n\t{\n\t\tthis._normalReflectance = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tvar data:Array = shaderObject.fragmentConstantData;\n\t\tvar index:number /*int*/ = methodVO.fragmentConstantsIndex;\n\t\tdata[index] = this._alpha;\n\t\tdata[index + 1] = this._normalReflectance;\n\t\tdata[index + 2] = this._fresnelPower;\n\n\t\t( stage.context).activateCubeTexture(methodVO.texturesIndex, this._cubeTexture);\n\n\t\tif (this._mask)\n\t\t\t( stage.context).activateTexture(methodVO.texturesIndex + 1, this._mask);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar dataRegister:ShaderRegisterElement = registerCache.getFreeFragmentConstant();\n\t\tvar temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp();\n\t\tvar code:string = \"\";\n\t\tvar cubeMapReg:ShaderRegisterElement = registerCache.getFreeTextureReg();\n\t\tvar viewDirReg:ShaderRegisterElement = sharedRegisters.viewDirFragment;\n\t\tvar normalReg:ShaderRegisterElement = sharedRegisters.normalFragment;\n\n\t\tmethodVO.texturesIndex = cubeMapReg.index;\n\t\tmethodVO.fragmentConstantsIndex = dataRegister.index*4;\n\n\t\tregisterCache.addFragmentTempUsages(temp, 1);\n\t\tvar temp2:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp();\n\n\t\t// r = V - 2(V.N)*N\n\t\tcode += \"dp3 \" + temp + \".w, \" + viewDirReg + \".xyz, \" + normalReg + \".xyz\\n\" +\n\t\t\t\t\"add \" + temp + \".w, \" + temp + \".w, \" + temp + \".w\\n\" +\n\t\t\t\t\"mul \" + temp + \".xyz, \" + normalReg + \".xyz, \" + temp + \".w\\n\" +\n\t\t\t\t\"sub \" + temp + \".xyz, \" + temp + \".xyz, \" + viewDirReg + \".xyz\\n\" +\n\t\t\tShaderCompilerHelper.getTexCubeSampleCode(temp, cubeMapReg, this._cubeTexture, shaderObject.useSmoothTextures, shaderObject.useMipmapping, temp) +\n\t\t\t\t\"sub \" + temp2 + \".w, \" + temp + \".w, fc0.x\\n\" + \t// -.5\n\t\t\t\t\"kil \" + temp2 + \".w\\n\" +\t// used for real time reflection mapping - if alpha is not 1 (mock texture) kil output\n\t\t\t\t\"sub \" + temp + \", \" + temp + \", \" + targetReg + \"\\n\";\n\n\t\t// calculate fresnel term\n\t\tcode += \"dp3 \" + viewDirReg + \".w, \" + viewDirReg + \".xyz, \" + normalReg + \".xyz\\n\" + // dot(V, H)\n\t\t\t\t\"sub \" + viewDirReg + \".w, \" + dataRegister + \".w, \" + viewDirReg + \".w\\n\" + // base = 1-dot(V, H)\n\t\t\t\t\"pow \" + viewDirReg + \".w, \" + viewDirReg + \".w, \" + dataRegister + \".z\\n\" + // exp = pow(base, 5)\n\t\t\t\t\"sub \" + normalReg + \".w, \" + dataRegister + \".w, \" + viewDirReg + \".w\\n\" + // 1 - exp\n\t\t\t\t\"mul \" + normalReg + \".w, \" + dataRegister + \".y, \" + normalReg + \".w\\n\" + // f0*(1 - exp)\n\t\t\t\t\"add \" + viewDirReg + \".w, \" + viewDirReg + \".w, \" + normalReg + \".w\\n\" + // exp + f0*(1 - exp)\n\n\t\t\t\t// total alpha\n\t\t\t\t\"mul \" + viewDirReg + \".w, \" + dataRegister + \".x, \" + viewDirReg + \".w\\n\";\n\n\t\tif (this._mask) {\n\t\t\tvar maskReg:ShaderRegisterElement = registerCache.getFreeTextureReg();\n\t\t\tcode += ShaderCompilerHelper.getTex2DSampleCode(temp2, sharedRegisters, maskReg, this._mask, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping) +\n\t\t\t\t\"mul \" + viewDirReg + \".w, \" + temp2 + \".x, \" + viewDirReg + \".w\\n\";\n\t\t}\n\n\t\t// blend\n\t\tcode += \"mul \" + temp + \", \" + temp + \", \" + viewDirReg + \".w\\n\" +\n\t\t\t\t\"add \" + targetReg + \", \" + targetReg + \", \" + temp + \"\\n\";\n\n\t\tregisterCache.removeFragmentTempUsage(temp);\n\n\t\treturn code;\n\t}\n}\n\nexport = EffectFresnelEnvMapMethod;", + "import Texture2DBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/Texture2DBase\");\n\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport IContextStageGL\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/IContextStageGL\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport EffectMethodBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/EffectMethodBase\");\nimport ShaderCompilerHelper\t\t\t\t= require(\"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper\");\n\n/**\n * EffectLightMapMethod provides a method that allows applying a light map texture to the calculated pixel colour.\n * It is different from DiffuseLightMapMethod in that the latter only modulates the diffuse shading value rather\n * than the whole pixel colour.\n */\nclass EffectLightMapMethod extends EffectMethodBase\n{\n\t/**\n\t * Indicates the light map should be multiplied with the calculated shading result.\n\t */\n\tpublic static MULTIPLY:string = \"multiply\";\n\n\t/**\n\t * Indicates the light map should be added into the calculated shading result.\n\t */\n\tpublic static ADD:string = \"add\";\n\n\tprivate _texture:Texture2DBase;\n\n\tprivate _blendMode:string;\n\tprivate _useSecondaryUV:boolean;\n\n\t/**\n\t * Creates a new EffectLightMapMethod object.\n\t *\n\t * @param texture The texture containing the light map.\n\t * @param blendMode The blend mode with which the light map should be applied to the lighting result.\n\t * @param useSecondaryUV Indicates whether the secondary UV set should be used to map the light map.\n\t */\n\tconstructor(texture:Texture2DBase, blendMode:string = \"multiply\", useSecondaryUV:boolean = false)\n\t{\n\t\tsuper();\n\n\t\tthis._useSecondaryUV = useSecondaryUV;\n\t\tthis._texture = texture;\n\t\tthis.blendMode = blendMode;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitVO(shaderObject:ShaderObjectBase, methodVO:MethodVO)\n\t{\n\t\tmethodVO.needsUV = !this._useSecondaryUV;\n\t\tmethodVO.needsSecondaryUV = this._useSecondaryUV;\n\t}\n\n\t/**\n\t * The blend mode with which the light map should be applied to the lighting result.\n\t *\n\t * @see EffectLightMapMethod.ADD\n\t * @see EffectLightMapMethod.MULTIPLY\n\t */\n\tpublic get blendMode():string\n\t{\n\t\treturn this._blendMode;\n\t}\n\n\tpublic set blendMode(value:string)\n\t{\n\t\tif (value != EffectLightMapMethod.ADD && value != EffectLightMapMethod.MULTIPLY)\n\t\t\tthrow new Error(\"Unknown blendmode!\");\n\t\tif (this._blendMode == value)\n\t\t\treturn;\n\n\t\tthis._blendMode = value;\n\n\t\tthis.iInvalidateShaderProgram();\n\t}\n\n\t/**\n\t * The texture containing the light map.\n\t */\n\tpublic get texture():Texture2DBase\n\t{\n\t\treturn this._texture;\n\t}\n\n\tpublic set texture(value:Texture2DBase)\n\t{\n\t\tif (value.hasMipmaps != this._texture.hasMipmaps || value.format != this._texture.format)\n\t\t\tthis.iInvalidateShaderProgram();\n\n\t\tthis._texture = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage)\n\t{\n\t\t( stage.context).activateTexture(methodVO.texturesIndex, this._texture);\n\n\t\tsuper.iActivate(shaderObject, methodVO, stage);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar code:string;\n\t\tvar lightMapReg:ShaderRegisterElement = registerCache.getFreeTextureReg();\n\t\tvar temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp();\n\t\tmethodVO.texturesIndex = lightMapReg.index;\n\n\t\tcode = ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, lightMapReg, this._texture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, this._useSecondaryUV? sharedRegisters.secondaryUVVarying : sharedRegisters.uvVarying);\n\n\t\tswitch (this._blendMode) {\n\t\t\tcase EffectLightMapMethod.MULTIPLY:\n\t\t\t\tcode += \"mul \" + targetReg + \", \" + targetReg + \", \" + temp + \"\\n\";\n\t\t\t\tbreak;\n\t\t\tcase EffectLightMapMethod.ADD:\n\t\t\t\tcode += \"add \" + targetReg + \", \" + targetReg + \", \" + temp + \"\\n\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn code;\n\t}\n}\n\nexport = EffectLightMapMethod;", + "import CubeTextureBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/CubeTextureBase\");\n\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport IContextStageGL\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/IContextStageGL\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport EffectMethodBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/EffectMethodBase\");\nimport ShaderCompilerHelper\t\t\t\t= require(\"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper\");\n\n/**\n * EffectRefractionEnvMapMethod provides a method to add refracted transparency based on cube maps.\n */\nclass EffectRefractionEnvMapMethod extends EffectMethodBase\n{\n\tprivate _envMap:CubeTextureBase;\n\n\tprivate _dispersionR:number = 0;\n\tprivate _dispersionG:number = 0;\n\tprivate _dispersionB:number = 0;\n\tprivate _useDispersion:boolean;\n\tprivate _refractionIndex:number;\n\tprivate _alpha:number = 1;\n\n\t/**\n\t * Creates a new EffectRefractionEnvMapMethod object. Example values for dispersion are: dispersionR: -0.03, dispersionG: -0.01, dispersionB: = .0015\n\t *\n\t * @param envMap The environment map containing the refracted scene.\n\t * @param refractionIndex The refractive index of the material.\n\t * @param dispersionR The amount of chromatic dispersion of the red channel. Defaults to 0 (none).\n\t * @param dispersionG The amount of chromatic dispersion of the green channel. Defaults to 0 (none).\n\t * @param dispersionB The amount of chromatic dispersion of the blue channel. Defaults to 0 (none).\n\t */\n\tconstructor(envMap:CubeTextureBase, refractionIndex:number = .1, dispersionR:number = 0, dispersionG:number = 0, dispersionB:number = 0)\n\t{\n\t\tsuper();\n\t\tthis._envMap = envMap;\n\t\tthis._dispersionR = dispersionR;\n\t\tthis._dispersionG = dispersionG;\n\t\tthis._dispersionB = dispersionB;\n\t\tthis._useDispersion = !(this._dispersionR == this._dispersionB && this._dispersionR == this._dispersionG);\n\t\tthis._refractionIndex = refractionIndex;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO)\n\t{\n\t\tvar index:number /*int*/ = methodVO.fragmentConstantsIndex;\n\t\tvar data:Array = shaderObject.fragmentConstantData;\n\t\tdata[index + 4] = 1;\n\t\tdata[index + 5] = 0;\n\t\tdata[index + 7] = 1;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitVO(shaderObject:ShaderObjectBase, methodVO:MethodVO)\n\t{\n\t\tmethodVO.needsNormals = true;\n\t\tmethodVO.needsView = true;\n\t}\n\n\t/**\n\t * The cube environment map to use for the refraction.\n\t */\n\tpublic get envMap():CubeTextureBase\n\t{\n\t\treturn this._envMap;\n\t}\n\n\tpublic set envMap(value:CubeTextureBase)\n\t{\n\t\tthis._envMap = value;\n\t}\n\n\t/**\n\t * The refractive index of the material.\n\t */\n\tpublic get refractionIndex():number\n\t{\n\t\treturn this._refractionIndex;\n\t}\n\n\tpublic set refractionIndex(value:number)\n\t{\n\t\tthis._refractionIndex = value;\n\t}\n\n\t/**\n\t * The amount of chromatic dispersion of the red channel. Defaults to 0 (none).\n\t */\n\tpublic get dispersionR():number\n\t{\n\t\treturn this._dispersionR;\n\t}\n\n\tpublic set dispersionR(value:number)\n\t{\n\t\tthis._dispersionR = value;\n\n\t\tvar useDispersion:boolean = !(this._dispersionR == this._dispersionB && this._dispersionR == this._dispersionG);\n\t\tif (this._useDispersion != useDispersion) {\n\t\t\tthis.iInvalidateShaderProgram();\n\t\t\tthis._useDispersion = useDispersion;\n\t\t}\n\t}\n\n\t/**\n\t * The amount of chromatic dispersion of the green channel. Defaults to 0 (none).\n\t */\n\tpublic get dispersionG():number\n\t{\n\t\treturn this._dispersionG;\n\t}\n\n\tpublic set dispersionG(value:number)\n\t{\n\t\tthis._dispersionG = value;\n\n\t\tvar useDispersion:boolean = !(this._dispersionR == this._dispersionB && this._dispersionR == this._dispersionG);\n\t\tif (this._useDispersion != useDispersion) {\n\t\t\tthis.iInvalidateShaderProgram();\n\t\t\tthis._useDispersion = useDispersion;\n\t\t}\n\t}\n\n\t/**\n\t * The amount of chromatic dispersion of the blue channel. Defaults to 0 (none).\n\t */\n\tpublic get dispersionB():number\n\t{\n\t\treturn this._dispersionB;\n\t}\n\n\tpublic set dispersionB(value:number)\n\t{\n\t\tthis._dispersionB = value;\n\n\t\tvar useDispersion:boolean = !(this._dispersionR == this._dispersionB && this._dispersionR == this._dispersionG);\n\t\tif (this._useDispersion != useDispersion) {\n\t\t\tthis.iInvalidateShaderProgram();\n\t\t\tthis._useDispersion = useDispersion;\n\t\t}\n\t}\n\n\t/**\n\t * The amount of transparency of the object. Warning: the alpha applies to the refracted color, not the actual\n\t * material. A value of 1 will make it appear fully transparent.\n\t */\n\tpublic get alpha():number\n\t{\n\t\treturn this._alpha;\n\t}\n\n\tpublic set alpha(value:number)\n\t{\n\t\tthis._alpha = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tvar index:number /*int*/ = methodVO.fragmentConstantsIndex;\n\t\tvar data:Array = shaderObject.fragmentConstantData;\n\n\t\tdata[index] = this._dispersionR + this._refractionIndex;\n\n\t\tif (this._useDispersion) {\n\t\t\tdata[index + 1] = this._dispersionG + this._refractionIndex;\n\t\t\tdata[index + 2] = this._dispersionB + this._refractionIndex;\n\t\t}\n\t\tdata[index + 3] = this._alpha;\n\n\t\t( stage.context).activateCubeTexture(methodVO.texturesIndex, this._envMap);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\t// todo: data2.x could use common reg, so only 1 reg is used\n\t\tvar data:ShaderRegisterElement = registerCache.getFreeFragmentConstant();\n\t\tvar data2:ShaderRegisterElement = registerCache.getFreeFragmentConstant();\n\t\tvar code:string = \"\";\n\t\tvar cubeMapReg:ShaderRegisterElement = registerCache.getFreeTextureReg();\n\t\tvar refractionDir:ShaderRegisterElement;\n\t\tvar refractionColor:ShaderRegisterElement;\n\t\tvar temp:ShaderRegisterElement;\n\n\t\tmethodVO.texturesIndex = cubeMapReg.index;\n\t\tmethodVO.fragmentConstantsIndex = data.index*4;\n\n\t\trefractionDir = registerCache.getFreeFragmentVectorTemp();\n\t\tregisterCache.addFragmentTempUsages(refractionDir, 1);\n\t\trefractionColor = registerCache.getFreeFragmentVectorTemp();\n\t\tregisterCache.addFragmentTempUsages(refractionColor, 1);\n\n\t\ttemp = registerCache.getFreeFragmentVectorTemp();\n\n\t\tvar viewDirReg:ShaderRegisterElement = sharedRegisters.viewDirFragment;\n\t\tvar normalReg:ShaderRegisterElement = sharedRegisters.normalFragment;\n\n\t\tcode += \"neg \" + viewDirReg + \".xyz, \" + viewDirReg + \".xyz\\n\";\n\n\t\tcode += \"dp3 \" + temp + \".x, \" + viewDirReg + \".xyz, \" + normalReg + \".xyz\\n\" +\n\t\t\t\"mul \" + temp + \".w, \" + temp + \".x, \" + temp + \".x\\n\" +\n\t\t\t\"sub \" + temp + \".w, \" + data2 + \".x, \" + temp + \".w\\n\" +\n\t\t\t\"mul \" + temp + \".w, \" + data + \".x, \" + temp + \".w\\n\" +\n\t\t\t\"mul \" + temp + \".w, \" + data + \".x, \" + temp + \".w\\n\" +\n\t\t\t\"sub \" + temp + \".w, \" + data2 + \".x, \" + temp + \".w\\n\" +\n\t\t\t\"sqt \" + temp + \".y, \" + temp + \".w\\n\" +\n\n\t\t\t\"mul \" + temp + \".x, \" + data + \".x, \" + temp + \".x\\n\" +\n\t\t\t\"add \" + temp + \".x, \" + temp + \".x, \" + temp + \".y\\n\" +\n\t\t\t\"mul \" + temp + \".xyz, \" + temp + \".x, \" + normalReg + \".xyz\\n\" +\n\n\t\t\t\"mul \" + refractionDir + \", \" + data + \".x, \" + viewDirReg + \"\\n\" +\n\t\t\t\"sub \" + refractionDir + \".xyz, \" + refractionDir + \".xyz, \" + temp + \".xyz\\n\" +\n\t\t\t\"nrm \" + refractionDir + \".xyz, \" + refractionDir + \".xyz\\n\";\n\t\tcode += ShaderCompilerHelper.getTexCubeSampleCode(refractionColor, cubeMapReg, this._envMap, shaderObject.useSmoothTextures, shaderObject.useMipmapping, refractionDir) +\n\t\t\t\"sub \" + refractionColor + \".w, \" + refractionColor + \".w, fc0.x\t\\n\" +\n\t\t\t\"kil \" + refractionColor + \".w\\n\";\n\n\t\tif (this._useDispersion) {\n\t\t\t// GREEN\n\t\t\tcode += \"dp3 \" + temp + \".x, \" + viewDirReg + \".xyz, \" + normalReg + \".xyz\\n\" +\n\t\t\t\t\"mul \" + temp + \".w, \" + temp + \".x, \" + temp + \".x\\n\" +\n\t\t\t\t\"sub \" + temp + \".w, \" + data2 + \".x, \" + temp + \".w\\n\" +\n\t\t\t\t\"mul \" + temp + \".w, \" + data + \".y, \" + temp + \".w\\n\" +\n\t\t\t\t\"mul \" + temp + \".w, \" + data + \".y, \" + temp + \".w\\n\" +\n\t\t\t\t\"sub \" + temp + \".w, \" + data2 + \".x, \" + temp + \".w\\n\" +\n\t\t\t\t\"sqt \" + temp + \".y, \" + temp + \".w\\n\" +\n\n\t\t\t\t\"mul \" + temp + \".x, \" + data + \".y, \" + temp + \".x\\n\" +\n\t\t\t\t\"add \" + temp + \".x, \" + temp + \".x, \" + temp + \".y\\n\" +\n\t\t\t\t\"mul \" + temp + \".xyz, \" + temp + \".x, \" + normalReg + \".xyz\\n\" +\n\n\t\t\t\t\"mul \" + refractionDir + \", \" + data + \".y, \" + viewDirReg + \"\\n\" +\n\t\t\t\t\"sub \" + refractionDir + \".xyz, \" + refractionDir + \".xyz, \" + temp + \".xyz\\n\" +\n\t\t\t\t\"nrm \" + refractionDir + \".xyz, \" + refractionDir + \".xyz\\n\";\n\t\t\tcode += ShaderCompilerHelper.getTexCubeSampleCode(temp, cubeMapReg, this._envMap, shaderObject.useSmoothTextures, shaderObject.useMipmapping, refractionDir) +\n\t\t\t\t\"mov \" + refractionColor + \".y, \" + temp + \".y\\n\";\n\n\t\t\t// BLUE\n\t\t\tcode += \"dp3 \" + temp + \".x, \" + viewDirReg + \".xyz, \" + normalReg + \".xyz\\n\" +\n\t\t\t\t\"mul \" + temp + \".w, \" + temp + \".x, \" + temp + \".x\\n\" +\n\t\t\t\t\"sub \" + temp + \".w, \" + data2 + \".x, \" + temp + \".w\\n\" +\n\t\t\t\t\"mul \" + temp + \".w, \" + data + \".z, \" + temp + \".w\\n\" +\n\t\t\t\t\"mul \" + temp + \".w, \" + data + \".z, \" + temp + \".w\\n\" +\n\t\t\t\t\"sub \" + temp + \".w, \" + data2 + \".x, \" + temp + \".w\\n\" +\n\t\t\t\t\"sqt \" + temp + \".y, \" + temp + \".w\\n\" +\n\n\t\t\t\t\"mul \" + temp + \".x, \" + data + \".z, \" + temp + \".x\\n\" +\n\t\t\t\t\"add \" + temp + \".x, \" + temp + \".x, \" + temp + \".y\\n\" +\n\t\t\t\t\"mul \" + temp + \".xyz, \" + temp + \".x, \" + normalReg + \".xyz\\n\" +\n\n\t\t\t\t\"mul \" + refractionDir + \", \" + data + \".z, \" + viewDirReg + \"\\n\" +\n\t\t\t\t\"sub \" + refractionDir + \".xyz, \" + refractionDir + \".xyz, \" + temp + \".xyz\\n\" +\n\t\t\t\t\"nrm \" + refractionDir + \".xyz, \" + refractionDir + \".xyz\\n\";\n\t\t\tcode += ShaderCompilerHelper.getTexCubeSampleCode(temp, cubeMapReg, this._envMap, shaderObject.useSmoothTextures, shaderObject.useMipmapping, refractionDir) +\n\t\t\t\t\"mov \" + refractionColor + \".z, \" + temp + \".z\\n\";\n\t\t}\n\n\t\tregisterCache.removeFragmentTempUsage(refractionDir);\n\n\t\tcode += \"sub \" + refractionColor + \".xyz, \" + refractionColor + \".xyz, \" + targetReg + \".xyz\\n\" +\n\t\t\t\"mul \" + refractionColor + \".xyz, \" + refractionColor + \".xyz, \" + data + \".w\\n\" +\n\t\t\t\"add \" + targetReg + \".xyz, \" + targetReg + \".xyz, \" + refractionColor + \".xyz\\n\";\n\n\t\tregisterCache.removeFragmentTempUsage(refractionColor);\n\n\t\t// restore\n\t\tcode += \"neg \" + viewDirReg + \".xyz, \" + viewDirReg + \".xyz\\n\";\n\n\t\treturn code;\n\t}\n}\n\nexport = EffectRefractionEnvMapMethod;", + "import Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport EffectMethodBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/EffectMethodBase\");\n\n/**\n * EffectRimLightMethod provides a method to add rim lighting to a material. This adds a glow-like effect to edges of objects.\n */\nclass EffectRimLightMethod extends EffectMethodBase\n{\n\tpublic static ADD:string = \"add\";\n\tpublic static MULTIPLY:string = \"multiply\";\n\tpublic static MIX:string = \"mix\";\n\n\tprivate _color:number /*uint*/;\n\tprivate _blendMode:string;\n\tprivate _colorR:number;\n\tprivate _colorG:number;\n\tprivate _colorB:number;\n\tprivate _strength:number;\n\tprivate _power:number;\n\n\t/**\n\t * Creates a new EffectRimLightMethod object.\n\t *\n\t * @param color The colour of the rim light.\n\t * @param strength The strength of the rim light.\n\t * @param power The power of the rim light. Higher values will result in a higher edge fall-off.\n\t * @param blend The blend mode with which to add the light to the object.\n\t */\n\tconstructor(color:number /*uint*/ = 0xffffff, strength:number = .4, power:number = 2, blend:string = \"mix\")\n\t{\n\t\tsuper();\n\n\t\tthis._blendMode = blend;\n\t\tthis._strength = strength;\n\t\tthis._power = power;\n\n\t\tthis.color = color;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO)\n\t{\n\t\tshaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex + 3] = 1;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitVO(shaderObject:ShaderObjectBase, methodVO:MethodVO)\n\t{\n\t\tmethodVO.needsNormals = true;\n\t\tmethodVO.needsView = true;\n\t}\n\n\n\t/**\n\t * The blend mode with which to add the light to the object.\n\t *\n\t * EffectRimLightMethod.MULTIPLY multiplies the rim light with the material's colour.\n\t * EffectRimLightMethod.ADD adds the rim light with the material's colour.\n\t * EffectRimLightMethod.MIX provides normal alpha blending.\n\t */\n\tpublic get blendMode():string\n\t{\n\t\treturn this._blendMode;\n\t}\n\n\tpublic set blendMode(value:string)\n\t{\n\t\tif (this._blendMode == value)\n\t\t\treturn;\n\n\t\tthis._blendMode = value;\n\n\t\tthis.iInvalidateShaderProgram();\n\t}\n\n\t/**\n\t * The color of the rim light.\n\t */\n\tpublic get color():number /*uint*/\n\t{\n\t\treturn this._color;\n\t}\n\n\tpublic set color(value:number /*uint*/)\n\t{\n\t\tthis._color = value;\n\t\tthis._colorR = ((value >> 16) & 0xff)/0xff;\n\t\tthis._colorG = ((value >> 8) & 0xff)/0xff;\n\t\tthis._colorB = (value & 0xff)/0xff;\n\t}\n\n\t/**\n\t * The strength of the rim light.\n\t */\n\tpublic get strength():number\n\t{\n\t\treturn this._strength;\n\t}\n\n\tpublic set strength(value:number)\n\t{\n\t\tthis._strength = value;\n\t}\n\n\t/**\n\t * The power of the rim light. Higher values will result in a higher edge fall-off.\n\t */\n\tpublic get power():number\n\t{\n\t\treturn this._power;\n\t}\n\n\tpublic set power(value:number)\n\t{\n\t\tthis._power = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tvar index:number /*int*/ = methodVO.fragmentConstantsIndex;\n\t\tvar data:Array = shaderObject.fragmentConstantData;\n\t\tdata[index] = this._colorR;\n\t\tdata[index + 1] = this._colorG;\n\t\tdata[index + 2] = this._colorB;\n\t\tdata[index + 4] = this._strength;\n\t\tdata[index + 5] = this._power;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar dataRegister:ShaderRegisterElement = registerCache.getFreeFragmentConstant();\n\t\tvar dataRegister2:ShaderRegisterElement = registerCache.getFreeFragmentConstant();\n\t\tvar temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp();\n\t\tvar code:string = \"\";\n\n\t\tmethodVO.fragmentConstantsIndex = dataRegister.index*4;\n\n\t\tcode += \"dp3 \" + temp + \".x, \" + sharedRegisters.viewDirFragment + \".xyz, \" + sharedRegisters.normalFragment + \".xyz\\n\" +\n\t\t\t\"sat \" + temp + \".x, \" + temp + \".x\\n\" +\n\t\t\t\"sub \" + temp + \".x, \" + dataRegister + \".w, \" + temp + \".x\\n\" +\n\t\t\t\"pow \" + temp + \".x, \" + temp + \".x, \" + dataRegister2 + \".y\\n\" +\n\t\t\t\"mul \" + temp + \".x, \" + temp + \".x, \" + dataRegister2 + \".x\\n\" +\n\t\t\t\"sub \" + temp + \".x, \" + dataRegister + \".w, \" + temp + \".x\\n\" +\n\t\t\t\"mul \" + targetReg + \".xyz, \" + targetReg + \".xyz, \" + temp + \".x\\n\" +\n\t\t\t\"sub \" + temp + \".w, \" + dataRegister + \".w, \" + temp + \".x\\n\";\n\n\t\tif (this._blendMode == EffectRimLightMethod.ADD) {\n\t\t\tcode += \"mul \" + temp + \".xyz, \" + temp + \".w, \" + dataRegister + \".xyz\\n\" +\n\t\t\t\t\"add \" + targetReg + \".xyz, \" + targetReg + \".xyz, \" + temp + \".xyz\\n\";\n\t\t} else if (this._blendMode == EffectRimLightMethod.MULTIPLY) {\n\t\t\tcode += \"mul \" + temp + \".xyz, \" + temp + \".w, \" + dataRegister + \".xyz\\n\" +\n\t\t\t\t\"mul \" + targetReg + \".xyz, \" + targetReg + \".xyz, \" + temp + \".xyz\\n\";\n\t\t} else {\n\t\t\tcode += \"sub \" + temp + \".xyz, \" + dataRegister + \".xyz, \" + targetReg + \".xyz\\n\" +\n\t\t\t\t\"mul \" + temp + \".xyz, \" + temp + \".xyz, \" + temp + \".w\\n\" +\n\t\t\t\t\"add \" + targetReg + \".xyz, \" + targetReg + \".xyz, \" + temp + \".xyz\\n\";\n\t\t}\n\n\t\treturn code;\n\t}\n}\n\nexport = EffectRimLightMethod;", + "import Texture2DBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/Texture2DBase\");\n\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport NormalBasicMethod\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/NormalBasicMethod\");\nimport ShadingMethodBase\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/ShadingMethodBase\");\nimport ShaderCompilerHelper\t\t\t\t= require(\"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper\");\n\n/**\n * NormalHeightMapMethod provides a normal map method that uses a height map to calculate the normals.\n */\nclass NormalHeightMapMethod extends NormalBasicMethod\n{\n\tprivate _worldXYRatio:number;\n\tprivate _worldXZRatio:number;\n\n\t/**\n\t * Creates a new NormalHeightMapMethod method.\n\t *\n\t * @param heightMap The texture containing the height data. 0 means low, 1 means high.\n\t * @param worldWidth The width of the 'world'. This is used to map uv coordinates' u component to scene dimensions.\n\t * @param worldHeight The height of the 'world'. This is used to map the height map values to scene dimensions.\n\t * @param worldDepth The depth of the 'world'. This is used to map uv coordinates' v component to scene dimensions.\n\t */\n\tconstructor(heightMap:Texture2DBase, worldWidth:number, worldHeight:number, worldDepth:number)\n\t{\n\t\tsuper();\n\n\t\tthis.normalMap = heightMap;\n\t\tthis._worldXYRatio = worldWidth/worldHeight;\n\t\tthis._worldXZRatio = worldDepth/worldHeight;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO)\n\t{\n\t\tvar index:number /*int*/ = methodVO.fragmentConstantsIndex;\n\t\tvar data:Array = shaderObject.fragmentConstantData;\n\t\tdata[index] = 1/this.normalMap.width;\n\t\tdata[index + 1] = 1/this.normalMap.height;\n\t\tdata[index + 2] = 0;\n\t\tdata[index + 3] = 1;\n\t\tdata[index + 4] = this._worldXYRatio;\n\t\tdata[index + 5] = this._worldXZRatio;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic get tangentSpace():boolean\n\t{\n\t\treturn false;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic copyFrom(method:ShadingMethodBase)\n\t{\n\t\tsuper.copyFrom(method);\n\n\t\tthis._worldXYRatio = ( method)._worldXYRatio;\n\t\tthis._worldXZRatio = ( method)._worldXZRatio;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp();\n\t\tvar dataReg:ShaderRegisterElement = registerCache.getFreeFragmentConstant();\n\t\tvar dataReg2:ShaderRegisterElement = registerCache.getFreeFragmentConstant();\n\t\tthis._pNormalTextureRegister = registerCache.getFreeTextureReg();\n\t\tmethodVO.texturesIndex = this._pNormalTextureRegister.index;\n\t\tmethodVO.fragmentConstantsIndex = dataReg.index*4;\n\n\t\treturn ShaderCompilerHelper.getTex2DSampleCode(targetReg, sharedRegisters, this._pNormalTextureRegister, this.normalMap, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, sharedRegisters.uvVarying, \"clamp\") +\n\n\t\t\t\"add \" + temp + \", \" + sharedRegisters.uvVarying + \", \" + dataReg + \".xzzz\\n\" +\n\n\t\t\tShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, this._pNormalTextureRegister, this.normalMap, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, temp, \"clamp\") +\n\n\t\t\t\"sub \" + targetReg + \".x, \" + targetReg + \".x, \" + temp + \".x\\n\" +\n\t\t\t\"add \" + temp + \", \" + sharedRegisters.uvVarying + \", \" + dataReg + \".zyzz\\n\" +\n\n\t\t\tShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, this._pNormalTextureRegister, this.normalMap, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, temp, \"clamp\") +\n\n\t\t\t\"sub \" + targetReg + \".z, \" + targetReg + \".z, \" + temp + \".x\\n\" +\n\t\t\t\"mov \" + targetReg + \".y, \" + dataReg + \".w\\n\" +\n\t\t\t\"mul \" + targetReg + \".xz, \" + targetReg + \".xz, \" + dataReg2 + \".xy\\n\" +\n\t\t\t\"nrm \" + targetReg + \".xyz, \" + targetReg + \".xyz\\n\";\n\t}\n}\n\nexport = NormalHeightMapMethod;", + "import Texture2DBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/Texture2DBase\");\n\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport IContextStageGL\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/IContextStageGL\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport NormalBasicMethod\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/NormalBasicMethod\");\nimport ShaderCompilerHelper\t\t\t\t= require(\"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper\");\n\n/**\n * NormalSimpleWaterMethod provides a basic normal map method to create water ripples by translating two wave normal maps.\n */\nclass NormalSimpleWaterMethod extends NormalBasicMethod\n{\n\tprivate _texture2:Texture2DBase;\n\tprivate _normalTextureRegister2:ShaderRegisterElement;\n\tprivate _useSecondNormalMap:boolean = false;\n\tprivate _water1OffsetX:number = 0;\n\tprivate _water1OffsetY:number = 0;\n\tprivate _water2OffsetX:number = 0;\n\tprivate _water2OffsetY:number = 0;\n\n\t/**\n\t * Creates a new NormalSimpleWaterMethod object.\n\t * @param waveMap1 A normal map containing one layer of a wave structure.\n\t * @param waveMap2 A normal map containing a second layer of a wave structure.\n\t */\n\tconstructor(waveMap1:Texture2DBase, waveMap2:Texture2DBase)\n\t{\n\t\tsuper();\n\t\tthis.normalMap = waveMap1;\n\t\tthis.secondaryNormalMap = waveMap2;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO)\n\t{\n\t\tvar index:number = methodVO.fragmentConstantsIndex;\n\t\tvar data:Array = shaderObject.fragmentConstantData;\n\t\tdata[index] = .5;\n\t\tdata[index + 1] = 0;\n\t\tdata[index + 2] = 0;\n\t\tdata[index + 3] = 1;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitVO(shaderObject:ShaderObjectBase, methodVO:MethodVO)\n\t{\n\t\tsuper.iInitVO(shaderObject, methodVO);\n\n\t\tthis._useSecondNormalMap = this.normalMap != this.secondaryNormalMap;\n\t}\n\n\t/**\n\t * The translation of the first wave layer along the X-axis.\n\t */\n\tpublic get water1OffsetX():number\n\t{\n\t\treturn this._water1OffsetX;\n\t}\n\n\tpublic set water1OffsetX(value:number)\n\t{\n\t\tthis._water1OffsetX = value;\n\t}\n\n\t/**\n\t * The translation of the first wave layer along the Y-axis.\n\t */\n\tpublic get water1OffsetY():number\n\t{\n\t\treturn this._water1OffsetY;\n\t}\n\n\tpublic set water1OffsetY(value:number)\n\t{\n\t\tthis._water1OffsetY = value;\n\t}\n\n\t/**\n\t * The translation of the second wave layer along the X-axis.\n\t */\n\tpublic get water2OffsetX():number\n\t{\n\t\treturn this._water2OffsetX;\n\t}\n\n\tpublic set water2OffsetX(value:number)\n\t{\n\t\tthis._water2OffsetX = value;\n\t}\n\n\t/**\n\t * The translation of the second wave layer along the Y-axis.\n\t */\n\tpublic get water2OffsetY():number\n\t{\n\t\treturn this._water2OffsetY;\n\t}\n\n\tpublic set water2OffsetY(value:number)\n\t{\n\t\tthis._water2OffsetY = value;\n\t}\n\n\t/**\n\t * A second normal map that will be combined with the first to create a wave-like animation pattern.\n\t */\n\tpublic get secondaryNormalMap():Texture2DBase\n\t{\n\t\treturn this._texture2;\n\t}\n\n\tpublic set secondaryNormalMap(value:Texture2DBase)\n\t{\n\t\tthis._texture2 = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iCleanCompilationData()\n\t{\n\t\tsuper.iCleanCompilationData();\n\t\tthis._normalTextureRegister2 = null;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic dispose()\n\t{\n\t\tsuper.dispose();\n\t\tthis._texture2 = null;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tsuper.iActivate(shaderObject, methodVO, stage);\n\n\t\tvar data:Array = shaderObject.fragmentConstantData;\n\t\tvar index:number = methodVO.fragmentConstantsIndex;\n\n\t\tdata[index + 4] = this._water1OffsetX;\n\t\tdata[index + 5] = this._water1OffsetY;\n\t\tdata[index + 6] = this._water2OffsetX;\n\t\tdata[index + 7] = this._water2OffsetY;\n\n\t\t//if (this._useSecondNormalMap >= 0)\n\t\tif (this._useSecondNormalMap)\n\t\t\t( stage.context).activateTexture(methodVO.texturesIndex + 1, this._texture2);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp();\n\t\tvar dataReg:ShaderRegisterElement = registerCache.getFreeFragmentConstant();\n\t\tvar dataReg2:ShaderRegisterElement = registerCache.getFreeFragmentConstant();\n\t\tthis._pNormalTextureRegister = registerCache.getFreeTextureReg();\n\t\tthis._normalTextureRegister2 = this._useSecondNormalMap? registerCache.getFreeTextureReg():this._pNormalTextureRegister;\n\t\tmethodVO.texturesIndex = this._pNormalTextureRegister.index;\n\n\t\tmethodVO.fragmentConstantsIndex = dataReg.index*4;\n\n\t\treturn \"add \" + temp + \", \" + sharedRegisters.uvVarying + \", \" + dataReg2 + \".xyxy\\n\" +\n\t\t\tShaderCompilerHelper.getTex2DSampleCode(targetReg, sharedRegisters, this._pNormalTextureRegister, this.normalMap, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, temp) +\n\t\t\t\"add \" + temp + \", \" + sharedRegisters.uvVarying + \", \" + dataReg2 + \".zwzw\\n\" +\n\t\t\tShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, this._normalTextureRegister2, this._texture2, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, temp) +\n\t\t\t\"add \" + targetReg + \", \" + targetReg + \", \" + temp + \"\t\t\\n\" +\n\t\t\t\"mul \" + targetReg + \", \" + targetReg + \", \" + dataReg + \".x\t\\n\" +\n\t\t\t\"sub \" + targetReg + \".xyz, \" + targetReg + \".xyz, \" + sharedRegisters.commons + \".xxx\t\\n\" +\n\t\t\t\"nrm \" + targetReg + \".xyz, \" + targetReg + \".xyz\t\t\t\t\t\t\t\\n\";\n\t}\n}\n\nexport = NormalSimpleWaterMethod;", + "import Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\nimport DirectionalLight\t\t\t\t\t= require(\"awayjs-core/lib/entities/DirectionalLight\");\nimport Event\t\t\t\t\t\t\t= require(\"awayjs-core/lib/events/Event\");\nimport CascadeShadowMapper\t\t\t\t= require(\"awayjs-core/lib/materials/shadowmappers/CascadeShadowMapper\");\nimport Texture2DBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/Texture2DBase\");\n\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport IContextStageGL\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/IContextStageGL\");\nimport ShadingMethodEvent\t\t\t\t= require(\"awayjs-stagegl/lib/events/ShadingMethodEvent\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderLightingObject\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderLightingObject\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport ShadowMapMethodBase\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/ShadowMapMethodBase\");\nimport ShadowMethodBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/ShadowMethodBase\");\nimport ShaderCompilerHelper\t\t\t\t= require(\"awayjs-stagegl/lib/materials/utils/ShaderCompilerHelper\");\n\n/**\n * ShadowCascadeMethod is a shadow map method to apply cascade shadow mapping on materials.\n * Must be used with a DirectionalLight with a CascadeShadowMapper assigned to its shadowMapper property.\n *\n * @see away.lights.CascadeShadowMapper\n */\nclass ShadowCascadeMethod extends ShadowMapMethodBase\n{\n\tprivate _baseMethod:ShadowMethodBase;\n\tprivate _cascadeShadowMapper:CascadeShadowMapper;\n\tprivate _depthMapCoordVaryings:Array;\n\tprivate _cascadeProjections:Array;\n\n\t/**\n\t * Creates a new ShadowCascadeMethod object.\n\t *\n\t * @param shadowMethodBase The shadow map sampling method used to sample individual cascades (fe: ShadowHardMethod, ShadowSoftMethod)\n\t */\n\tconstructor(shadowMethodBase:ShadowMethodBase)\n\t{\n\t\tsuper(shadowMethodBase.castingLight);\n\n\t\tthis._baseMethod = shadowMethodBase;\n\t\tif (!(this._pCastingLight instanceof DirectionalLight))\n\t\t\tthrow new Error(\"ShadowCascadeMethod is only compatible with DirectionalLight\");\n\n\t\tthis._cascadeShadowMapper = this._pCastingLight.shadowMapper;\n\n\t\tif (!this._cascadeShadowMapper)\n\t\t\tthrow new Error(\"ShadowCascadeMethod requires a light that has a CascadeShadowMapper instance assigned to shadowMapper.\");\n\n\t\tthis._cascadeShadowMapper.addEventListener(Event.CHANGE, (event:Event) => this.onCascadeChange(event));\n\t\tthis._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, (event:ShadingMethodEvent) => this.onShaderInvalidated(event));\n\t}\n\n\t/**\n\t * The shadow map sampling method used to sample individual cascades. These are typically those used in conjunction\n\t * with a DirectionalShadowMapper.\n\t *\n\t * @see ShadowHardMethod\n\t * @see ShadowSoftMethod\n\t */\n\tpublic get baseMethod():ShadowMethodBase\n\t{\n\t\treturn this._baseMethod;\n\t}\n\n\tpublic set baseMethod(value:ShadowMethodBase)\n\t{\n\t\tif (this._baseMethod == value)\n\t\t\treturn;\n\n\t\tthis._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, (event:ShadingMethodEvent) => this.onShaderInvalidated(event));\n\n\t\tthis._baseMethod = value;\n\n\t\tthis._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, (event:ShadingMethodEvent) => this.onShaderInvalidated(event));\n\n\t\tthis.iInvalidateShaderProgram();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitVO(shaderObject:ShaderLightingObject, methodVO:MethodVO)\n\t{\n\t\tvar tempVO:MethodVO = new MethodVO(this._baseMethod);\n\t\tthis._baseMethod.iInitVO(shaderObject, tempVO);\n\n\t\tmethodVO.needsGlobalVertexPos = true;\n\t\tmethodVO.needsProjection = true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO)\n\t{\n\t\tvar fragmentData:Array = shaderObject.fragmentConstantData;\n\t\tvar vertexData:Array = shaderObject.vertexConstantData;\n\t\tvar index:number = methodVO.fragmentConstantsIndex;\n\t\tfragmentData[index] = 1.0;\n\t\tfragmentData[index + 1] = 1/255.0;\n\t\tfragmentData[index + 2] = 1/65025.0;\n\t\tfragmentData[index + 3] = 1/16581375.0;\n\n\t\tfragmentData[index + 6] = .5;\n\t\tfragmentData[index + 7] = -.5;\n\n\t\tindex = methodVO.vertexConstantsIndex;\n\t\tvertexData[index] = .5;\n\t\tvertexData[index + 1] = -.5;\n\t\tvertexData[index + 2] = 0;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iCleanCompilationData()\n\t{\n\t\tsuper.iCleanCompilationData();\n\t\tthis._cascadeProjections = null;\n\t\tthis._depthMapCoordVaryings = null;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetVertexCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar code:string = \"\";\n\t\tvar dataReg:ShaderRegisterElement = registerCache.getFreeVertexConstant();\n\n\t\tthis.initProjectionsRegs(registerCache);\n\t\tmethodVO.vertexConstantsIndex = dataReg.index*4;\n\n\t\tvar temp:ShaderRegisterElement = registerCache.getFreeVertexVectorTemp();\n\n\t\tfor (var i:number = 0; i < this._cascadeShadowMapper.numCascades; ++i) {\n\t\t\tcode += \"m44 \" + temp + \", \" + sharedRegisters.globalPositionVertex + \", \" + this._cascadeProjections[i] + \"\\n\" +\n\t\t\t\t\"add \" + this._depthMapCoordVaryings[i] + \", \" + temp + \", \" + dataReg + \".zzwz\\n\";\n\t\t}\n\n\t\treturn code;\n\t}\n\n\t/**\n\t * Creates the registers for the cascades' projection coordinates.\n\t */\n\tprivate initProjectionsRegs(registerCache:ShaderRegisterCache)\n\t{\n\t\tthis._cascadeProjections = new Array(this._cascadeShadowMapper.numCascades);\n\t\tthis._depthMapCoordVaryings = new Array(this._cascadeShadowMapper.numCascades);\n\n\t\tfor (var i:number = 0; i < this._cascadeShadowMapper.numCascades; ++i) {\n\t\t\tthis._depthMapCoordVaryings[i] = registerCache.getFreeVarying();\n\t\t\tthis._cascadeProjections[i] = registerCache.getFreeVertexConstant();\n\t\t\tregisterCache.getFreeVertexConstant();\n\t\t\tregisterCache.getFreeVertexConstant();\n\t\t\tregisterCache.getFreeVertexConstant();\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar numCascades:number = this._cascadeShadowMapper.numCascades;\n\t\tvar depthMapRegister:ShaderRegisterElement = registerCache.getFreeTextureReg();\n\t\tvar decReg:ShaderRegisterElement = registerCache.getFreeFragmentConstant();\n\t\tvar dataReg:ShaderRegisterElement = registerCache.getFreeFragmentConstant();\n\t\tvar planeDistanceReg:ShaderRegisterElement = registerCache.getFreeFragmentConstant();\n\t\tvar planeDistances:Array = Array( planeDistanceReg + \".x\", planeDistanceReg + \".y\", planeDistanceReg + \".z\", planeDistanceReg + \".w\" );\n\t\tvar code:string;\n\n\t\tmethodVO.fragmentConstantsIndex = decReg.index*4;\n\t\tmethodVO.texturesIndex = depthMapRegister.index;\n\n\t\tvar inQuad:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp();\n\t\tregisterCache.addFragmentTempUsages(inQuad, 1);\n\t\tvar uvCoord:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp();\n\t\tregisterCache.addFragmentTempUsages(uvCoord, 1);\n\n\t\t// assume lowest partition is selected, will be overwritten later otherwise\n\t\tcode = \"mov \" + uvCoord + \", \" + this._depthMapCoordVaryings[numCascades - 1] + \"\\n\";\n\n\t\tfor (var i:number = numCascades - 2; i >= 0; --i) {\n\t\t\tvar uvProjection:ShaderRegisterElement = this._depthMapCoordVaryings[i];\n\n\t\t\t// calculate if in texturemap (result == 0 or 1, only 1 for a single partition)\n\t\t\tcode += \"slt \" + inQuad + \".z, \" + sharedRegisters.projectionFragment + \".z, \" + planeDistances[i] + \"\\n\"; // z = x > minX, w = y > minY\n\n\t\t\tvar temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp();\n\n\t\t\t// linearly interpolate between old and new uv coords using predicate value == conditional toggle to new value if predicate == 1 (true)\n\t\t\tcode += \"sub \" + temp + \", \" + uvProjection + \", \" + uvCoord + \"\\n\" +\n\t\t\t\t\"mul \" + temp + \", \" + temp + \", \" + inQuad + \".z\\n\" +\n\t\t\t\t\"add \" + uvCoord + \", \" + uvCoord + \", \" + temp + \"\\n\";\n\t\t}\n\n\t\tregisterCache.removeFragmentTempUsage(inQuad);\n\n\t\tcode += \"div \" + uvCoord + \", \" + uvCoord + \", \" + uvCoord + \".w\\n\" +\n\t\t\t\"mul \" + uvCoord + \".xy, \" + uvCoord + \".xy, \" + dataReg + \".zw\\n\" +\n\t\t\t\"add \" + uvCoord + \".xy, \" + uvCoord + \".xy, \" + dataReg + \".zz\\n\";\n\n\t\tcode += this._baseMethod._iGetCascadeFragmentCode(shaderObject, methodVO, decReg, depthMapRegister, uvCoord, targetReg, registerCache, sharedRegisters) +\n\t\t\t\"add \" + targetReg + \".w, \" + targetReg + \".w, \" + dataReg + \".y\\n\";\n\n\t\tregisterCache.removeFragmentTempUsage(uvCoord);\n\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage)\n\t{\n\t\t( stage.context).activateTexture(methodVO.texturesIndex, this._pCastingLight.shadowMapper.depthMap);\n\n\t\tvar vertexData:Array = shaderObject.vertexConstantData;\n\t\tvar vertexIndex:number = methodVO.vertexConstantsIndex;\n\n\t\tshaderObject.vertexConstantData[methodVO.vertexConstantsIndex + 3] = -1/(this._cascadeShadowMapper.depth*this._pEpsilon);\n\n\t\tvar numCascades:number = this._cascadeShadowMapper.numCascades;\n\t\tvertexIndex += 4;\n\t\tfor (var k:number = 0; k < numCascades; ++k) {\n\t\t\tthis._cascadeShadowMapper.getDepthProjections(k).copyRawDataTo(vertexData, vertexIndex, true);\n\t\t\tvertexIndex += 16;\n\t\t}\n\n\t\tvar fragmentData:Array = shaderObject.fragmentConstantData;\n\t\tvar fragmentIndex:number = methodVO.fragmentConstantsIndex;\n\t\tfragmentData[fragmentIndex + 5] = 1 - this._pAlpha;\n\n\t\tvar nearPlaneDistances:Array = this._cascadeShadowMapper._iNearPlaneDistances;\n\n\t\tfragmentIndex += 8;\n\t\tfor (var i:number = 0; i < numCascades; ++i)\n\t\t\tfragmentData[fragmentIndex + i] = nearPlaneDistances[i];\n\n\t\tthis._baseMethod.iActivateForCascade(shaderObject, methodVO, stage);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iSetRenderState(shaderObject:ShaderObjectBase, methodVO:MethodVO, renderable:RenderableBase, stage:Stage, camera:Camera)\n\t{\n\t}\n\n\t/**\n\t * Called when the shadow mappers cascade configuration changes.\n\t */\n\tprivate onCascadeChange(event:Event)\n\t{\n\t\tthis.iInvalidateShaderProgram();\n\t}\n\n\t/**\n\t * Called when the base method's shader code is invalidated.\n\t */\n\tprivate onShaderInvalidated(event:ShadingMethodEvent)\n\t{\n\t\tthis.iInvalidateShaderProgram();\n\t}\n}\n\nexport = ShadowCascadeMethod;", + "import BitmapData\t\t\t\t\t\t= require(\"awayjs-core/lib/core/base/BitmapData\");\nimport DirectionalLight\t\t\t\t\t= require(\"awayjs-core/lib/entities/DirectionalLight\");\nimport BitmapTexture\t\t\t\t\t= require(\"awayjs-core/lib/textures/BitmapTexture\");\n\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport IContextStageGL\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/IContextStageGL\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderLightingObject\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderLightingObject\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport ShadowMethodBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/ShadowMethodBase\");\n\n/**\n * ShadowDitheredMethod provides a soft shadowing technique by randomly distributing sample points differently for each fragment.\n */\nclass ShadowDitheredMethod extends ShadowMethodBase\n{\n\tprivate static _grainTexture:BitmapTexture;\n\tprivate static _grainUsages:number /*int*/;\n\tprivate static _grainBitmapData:BitmapData;\n\tprivate _depthMapSize:number /*int*/;\n\tprivate _range:number;\n\tprivate _numSamples:number /*int*/;\n\n\t/**\n\t * Creates a new ShadowDitheredMethod object.\n\t * @param castingLight The light casting the shadows\n\t * @param numSamples The amount of samples to take for dithering. Minimum 1, maximum 24.\n\t */\n\tconstructor(castingLight:DirectionalLight, numSamples:number /*int*/ = 4, range:number = 1)\n\t{\n\t\tsuper(castingLight);\n\n\t\tthis._depthMapSize = this._pCastingLight.shadowMapper.depthMapSize;\n\n\t\tthis.numSamples = numSamples;\n\t\tthis.range = range;\n\n\t\t++ShadowDitheredMethod._grainUsages;\n\n\t\tif (!ShadowDitheredMethod._grainTexture)\n\t\t\tthis.initGrainTexture();\n\t}\n\n\t/**\n\t * The amount of samples to take for dithering. Minimum 1, maximum 24. The actual maximum may depend on the\n\t * complexity of the shader.\n\t */\n\tpublic get numSamples():number /*int*/\n\t{\n\t\treturn this._numSamples;\n\t}\n\n\tpublic set numSamples(value:number /*int*/)\n\t{\n\t\tthis._numSamples = value;\n\t\tif (this._numSamples < 1)\n\t\t\tthis._numSamples = 1; else if (this._numSamples > 24)\n\t\t\tthis._numSamples = 24;\n\t\tthis.iInvalidateShaderProgram();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitVO(shaderObject:ShaderLightingObject, methodVO:MethodVO)\n\t{\n\t\tsuper.iInitVO(shaderObject, methodVO);\n\n\t\tmethodVO.needsProjection = true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO)\n\t{\n\t\tsuper.iInitConstants(shaderObject, methodVO);\n\n\t\tvar fragmentData:Array = shaderObject.fragmentConstantData;\n\t\tvar index:number /*int*/ = methodVO.fragmentConstantsIndex;\n\t\tfragmentData[index + 8] = 1/this._numSamples;\n\t}\n\n\t/**\n\t * The range in the shadow map in which to distribute the samples.\n\t */\n\tpublic get range():number\n\t{\n\t\treturn this._range*2;\n\t}\n\n\tpublic set range(value:number)\n\t{\n\t\tthis._range = value/2;\n\t}\n\n\t/**\n\t * Creates a texture containing the dithering noise texture.\n\t */\n\tprivate initGrainTexture()\n\t{\n\t\tShadowDitheredMethod._grainBitmapData = new BitmapData(64, 64, false);\n\t\tvar vec:Array /*uint*/ = new Array();\n\t\tvar len:number /*uint*/ = 4096;\n\t\tvar step:number = 1/(this._depthMapSize*this._range);\n\t\tvar r:number, g:number;\n\n\t\tfor (var i:number /*uint*/ = 0; i < len; ++i) {\n\t\t\tr = 2*(Math.random() - .5);\n\t\t\tg = 2*(Math.random() - .5);\n\t\t\tif (r < 0)\n\t\t\t\tr -= step; else\n\t\t\t\tr += step;\n\t\t\tif (g < 0)\n\t\t\t\tg -= step; else\n\t\t\t\tg += step;\n\t\t\tif (r > 1)\n\t\t\t\tr = 1; else if (r < -1)\n\t\t\t\tr = -1;\n\t\t\tif (g > 1)\n\t\t\t\tg = 1; else if (g < -1)\n\t\t\t\tg = -1;\n\t\t\tvec[i] = (Math.floor((r*.5 + .5)*0xff) << 16) | (Math.floor((g*.5 + .5)*0xff) << 8);\n\t\t}\n\n\t\tShadowDitheredMethod._grainBitmapData.setVector(ShadowDitheredMethod._grainBitmapData.rect, vec);\n\t\tShadowDitheredMethod._grainTexture = new BitmapTexture(ShadowDitheredMethod._grainBitmapData);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic dispose()\n\t{\n\t\tif (--ShadowDitheredMethod._grainUsages == 0) {\n\t\t\tShadowDitheredMethod._grainTexture.dispose();\n\t\t\tShadowDitheredMethod._grainBitmapData.dispose();\n\t\t\tShadowDitheredMethod._grainTexture = null;\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tsuper.iActivate(shaderObject, methodVO, stage);\n\n\t\tvar data:Array = shaderObject.fragmentConstantData;\n\t\tvar index:number /*uint*/ = methodVO.fragmentConstantsIndex;\n\t\tdata[index + 9] = (stage.width - 1)/63;\n\t\tdata[index + 10] = (stage.height - 1)/63;\n\t\tdata[index + 11] = 2*this._range/this._depthMapSize;\n\n\t\t( stage.context).activateTexture(methodVO.texturesIndex + 1, ShadowDitheredMethod._grainTexture);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pGetPlanarFragmentCode(methodVO:MethodVO, targetReg:ShaderRegisterElement, regCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar depthMapRegister:ShaderRegisterElement = regCache.getFreeTextureReg();\n\t\tvar decReg:ShaderRegisterElement = regCache.getFreeFragmentConstant();\n\t\tvar dataReg:ShaderRegisterElement = regCache.getFreeFragmentConstant();\n\t\tvar customDataReg:ShaderRegisterElement = regCache.getFreeFragmentConstant();\n\n\t\tmethodVO.fragmentConstantsIndex = decReg.index*4;\n\t\tmethodVO.texturesIndex = depthMapRegister.index;\n\n\t\treturn this.getSampleCode(customDataReg, depthMapRegister, decReg, targetReg, regCache, sharedRegisters);\n\t}\n\n\t/**\n\t * Get the actual shader code for shadow mapping\n\t * @param regCache The register cache managing the registers.\n\t * @param depthMapRegister The texture register containing the depth map.\n\t * @param decReg The register containing the depth map decoding data.\n\t * @param targetReg The target register to add the shadow coverage.\n\t */\n\tprivate getSampleCode(customDataReg:ShaderRegisterElement, depthMapRegister:ShaderRegisterElement, decReg:ShaderRegisterElement, targetReg:ShaderRegisterElement, regCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar code:string = \"\";\n\t\tvar grainRegister:ShaderRegisterElement = regCache.getFreeTextureReg();\n\t\tvar uvReg:ShaderRegisterElement = regCache.getFreeFragmentVectorTemp();\n\t\tvar numSamples:number /*int*/ = this._numSamples;\n\t\tregCache.addFragmentTempUsages(uvReg, 1);\n\n\t\tvar temp:ShaderRegisterElement = regCache.getFreeFragmentVectorTemp();\n\n\t\tvar projectionReg:ShaderRegisterElement = sharedRegisters.projectionFragment;\n\n\t\tcode += \"div \" + uvReg + \", \" + projectionReg + \", \" + projectionReg + \".w\\n\" + \"mul \" + uvReg + \".xy, \" + uvReg + \".xy, \" + customDataReg + \".yz\\n\";\n\n\t\twhile (numSamples > 0) {\n\t\t\tif (numSamples == this._numSamples)\n\t\t\t\tcode += \"tex \" + uvReg + \", \" + uvReg + \", \" + grainRegister + \" <2d,nearest,repeat,mipnone>\\n\";\n\t\t\telse\n\t\t\t\tcode += \"tex \" + uvReg + \", \" + uvReg + \".zwxy, \" + grainRegister + \" <2d,nearest,repeat,mipnone>\\n\";\n\n\t\t\t// keep grain in uvReg.zw\n\t\t\tcode += \"sub \" + uvReg + \".zw, \" + uvReg + \".xy, fc0.xx\\n\" + // uv-.5\n\t\t\t\t\"mul \" + uvReg + \".zw, \" + uvReg + \".zw, \" + customDataReg + \".w\\n\"; // (tex unpack scale and tex scale in one)\n\n\t\t\tif (numSamples == this._numSamples) {\n\t\t\t\t// first sample\n\t\t\t\tcode += \"add \" + uvReg + \".xy, \" + uvReg + \".zw, \" + this._pDepthMapCoordReg + \".xy\\n\" +\n\t\t\t\t\t\"tex \" + temp + \", \" + uvReg + \", \" + depthMapRegister + \" <2d,nearest,clamp,mipnone>\\n\" +\n\t\t\t\t\t\"dp4 \" + temp + \".z, \" + temp + \", \" + decReg + \"\\n\" +\n\t\t\t\t\t\"slt \" + targetReg + \".w, \" + this._pDepthMapCoordReg + \".z, \" + temp + \".z\\n\"; // 0 if in shadow\n\t\t\t} else {\n\t\t\t\tcode += this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache);\n\t\t\t}\n\n\t\t\tif (numSamples > 4)\n\t\t\t\tcode += \"add \" + uvReg + \".xy, \" + uvReg + \".xy, \" + uvReg + \".zw\\n\" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache);\n\n\t\t\tif (numSamples > 1)\n\t\t\t\tcode += \"sub \" + uvReg + \".xy, \" + this._pDepthMapCoordReg + \".xy, \" + uvReg + \".zw\\n\" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache);\n\n\t\t\tif (numSamples > 5)\n\t\t\t\tcode += \"sub \" + uvReg + \".xy, \" + uvReg + \".xy, \" + uvReg + \".zw\\n\" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache);\n\n\t\t\tif (numSamples > 2) {\n\t\t\t\tcode += \"neg \" + uvReg + \".w, \" + uvReg + \".w\\n\"; // will be rotated 90 degrees when being accessed as wz\n\t\t\t\tcode += \"add \" + uvReg + \".xy, \" + uvReg + \".wz, \" + this._pDepthMapCoordReg + \".xy\\n\" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache);\n\t\t\t}\n\n\t\t\tif (numSamples > 6)\n\t\t\t\tcode += \"add \" + uvReg + \".xy, \" + uvReg + \".xy, \" + uvReg + \".wz\\n\" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache);\n\n\t\t\tif (numSamples > 3)\n\t\t\t\tcode += \"sub \" + uvReg + \".xy, \" + this._pDepthMapCoordReg + \".xy, \" + uvReg + \".wz\\n\" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache);\n\n\t\t\tif (numSamples > 7)\n\t\t\t\tcode += \"sub \" + uvReg + \".xy, \" + uvReg + \".xy, \" + uvReg + \".wz\\n\" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache);\n\n\t\t\tnumSamples -= 8;\n\t\t}\n\n\t\tregCache.removeFragmentTempUsage(uvReg);\n\t\tcode += \"mul \" + targetReg + \".w, \" + targetReg + \".w, \" + customDataReg + \".x\\n\"; // average\n\t\treturn code;\n\t}\n\n\t/**\n\t * Adds the code for another tap to the shader code.\n\t * @param uvReg The uv register for the tap.\n\t * @param depthMapRegister The texture register containing the depth map.\n\t * @param decReg The register containing the depth map decoding data.\n\t * @param targetReg The target register to add the tap comparison result.\n\t * @param regCache The register cache managing the registers.\n\t * @return\n\t */\n\tprivate addSample(uvReg:ShaderRegisterElement, depthMapRegister:ShaderRegisterElement, decReg:ShaderRegisterElement, targetReg:ShaderRegisterElement, regCache:ShaderRegisterCache):string\n\t{\n\t\tvar temp:ShaderRegisterElement = regCache.getFreeFragmentVectorTemp();\n\n\t\treturn \"tex \" + temp + \", \" + uvReg + \", \" + depthMapRegister + \" <2d,nearest,clamp,mipnone>\\n\" +\n\t\t\t\"dp4 \" + temp + \".z, \" + temp + \", \" + decReg + \"\\n\" +\n\t\t\t\"slt \" + temp + \".z, \" + this._pDepthMapCoordReg + \".z, \" + temp + \".z\\n\" + // 0 if in shadow\n\t\t\t\"add \" + targetReg + \".w, \" + targetReg + \".w, \" + temp + \".z\\n\";\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivateForCascade(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tvar data:Array = shaderObject.fragmentConstantData;\n\t\tvar index:number /*uint*/ = methodVO.secondaryFragmentConstantsIndex;\n\t\tdata[index] = 1/this._numSamples;\n\t\tdata[index + 1] = (stage.width - 1)/63;\n\t\tdata[index + 2] = (stage.height - 1)/63;\n\t\tdata[index + 3] = 2*this._range/this._depthMapSize;\n\n\t\t( stage.context).activateTexture(methodVO.texturesIndex + 1, ShadowDitheredMethod._grainTexture);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iGetCascadeFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, decodeRegister:ShaderRegisterElement, depthTexture:ShaderRegisterElement, depthProjection:ShaderRegisterElement, targetRegister:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tthis._pDepthMapCoordReg = depthProjection;\n\n\t\tvar dataReg:ShaderRegisterElement = registerCache.getFreeFragmentConstant();\n\t\tmethodVO.secondaryFragmentConstantsIndex = dataReg.index*4;\n\n\t\treturn this.getSampleCode(dataReg, depthTexture, decodeRegister, targetRegister, registerCache, sharedRegisters);\n\t}\n}\n\nexport = ShadowDitheredMethod;", + "import DirectionalLight\t\t\t\t\t= require(\"awayjs-core/lib/entities/DirectionalLight\");\n\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderLightingObject\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderLightingObject\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport ShadowMethodBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/ShadowMethodBase\");\n\n/**\n * ShadowFilteredMethod provides a softened shadowing technique by bilinearly interpolating shadow comparison\n * results of neighbouring pixels.\n */\nclass ShadowFilteredMethod extends ShadowMethodBase\n{\n\t/**\n\t * Creates a new DiffuseBasicMethod object.\n\t *\n\t * @param castingLight The light casting the shadow\n\t */\n\tconstructor(castingLight:DirectionalLight)\n\t{\n\t\tsuper(castingLight);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitConstants(shaderObject:ShaderLightingObject, methodVO:MethodVO)\n\t{\n\t\tsuper.iInitConstants(shaderObject, methodVO);\n\n\t\tvar fragmentData:Array = shaderObject.fragmentConstantData;\n\t\tvar index:number /*int*/ = methodVO.fragmentConstantsIndex;\n\t\tfragmentData[index + 8] = .5;\n\t\tvar size:number /*int*/ = this.castingLight.shadowMapper.depthMapSize;\n\t\tfragmentData[index + 9] = size;\n\t\tfragmentData[index + 10] = 1/size;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pGetPlanarFragmentCode(methodVO:MethodVO, targetReg:ShaderRegisterElement, regCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar depthMapRegister:ShaderRegisterElement = regCache.getFreeTextureReg();\n\t\tvar decReg:ShaderRegisterElement = regCache.getFreeFragmentConstant();\n\t\tvar dataReg:ShaderRegisterElement = regCache.getFreeFragmentConstant();\n\t\t// TODO: not used\n\t\tdataReg = dataReg;\n\t\tvar customDataReg:ShaderRegisterElement = regCache.getFreeFragmentConstant();\n\t\tvar depthCol:ShaderRegisterElement = regCache.getFreeFragmentVectorTemp();\n\t\tvar uvReg:ShaderRegisterElement;\n\t\tvar code:string = \"\";\n\t\tmethodVO.fragmentConstantsIndex = decReg.index*4;\n\n\t\tregCache.addFragmentTempUsages(depthCol, 1);\n\n\t\tuvReg = regCache.getFreeFragmentVectorTemp();\n\t\tregCache.addFragmentTempUsages(uvReg, 1);\n\n\t\tcode += \"mov \" + uvReg + \", \" + this._pDepthMapCoordReg + \"\\n\" +\n\n\t\t\t\"tex \" + depthCol + \", \" + this._pDepthMapCoordReg + \", \" + depthMapRegister + \" <2d, nearest, clamp>\\n\" + \"dp4 \" + depthCol + \".z, \" + depthCol + \", \" + decReg + \"\\n\" + \"slt \" + uvReg + \".z, \" + this._pDepthMapCoordReg + \".z, \" + depthCol + \".z\\n\" + // 0 if in shadow\n\n\t\t\t\"add \" + uvReg + \".x, \" + this._pDepthMapCoordReg + \".x, \" + customDataReg + \".z\\n\" + \t// (1, 0)\n\t\t\t\"tex \" + depthCol + \", \" + uvReg + \", \" + depthMapRegister + \" <2d, nearest, clamp>\\n\" + \"dp4 \" + depthCol + \".z, \" + depthCol + \", \" + decReg + \"\\n\" + \"slt \" + uvReg + \".w, \" + this._pDepthMapCoordReg + \".z, \" + depthCol + \".z\\n\" + // 0 if in shadow\n\n\t\t\t\"mul \" + depthCol + \".x, \" + this._pDepthMapCoordReg + \".x, \" + customDataReg + \".y\\n\" + \"frc \" + depthCol + \".x, \" + depthCol + \".x\\n\" + \"sub \" + uvReg + \".w, \" + uvReg + \".w, \" + uvReg + \".z\\n\" + \"mul \" + uvReg + \".w, \" + uvReg + \".w, \" + depthCol + \".x\\n\" + \"add \" + targetReg + \".w, \" + uvReg + \".z, \" + uvReg + \".w\\n\" +\n\n\t\t\t\"mov \" + uvReg + \".x, \" + this._pDepthMapCoordReg + \".x\\n\" + \"add \" + uvReg + \".y, \" + this._pDepthMapCoordReg + \".y, \" + customDataReg + \".z\\n\" +\t// (0, 1)\n\t\t\t\"tex \" + depthCol + \", \" + uvReg + \", \" + depthMapRegister + \" <2d, nearest, clamp>\\n\" + \"dp4 \" + depthCol + \".z, \" + depthCol + \", \" + decReg + \"\\n\" + \"slt \" + uvReg + \".z, \" + this._pDepthMapCoordReg + \".z, \" + depthCol + \".z\\n\" + // 0 if in shadow\n\n\t\t\t\"add \" + uvReg + \".x, \" + this._pDepthMapCoordReg + \".x, \" + customDataReg + \".z\\n\" +\t// (1, 1)\n\t\t\t\"tex \" + depthCol + \", \" + uvReg + \", \" + depthMapRegister + \" <2d, nearest, clamp>\\n\" + \"dp4 \" + depthCol + \".z, \" + depthCol + \", \" + decReg + \"\\n\" + \"slt \" + uvReg + \".w, \" + this._pDepthMapCoordReg + \".z, \" + depthCol + \".z\\n\" + // 0 if in shadow\n\n\t\t\t// recalculate fraction, since we ran out of registers :(\n\t\t\t\"mul \" + depthCol + \".x, \" + this._pDepthMapCoordReg + \".x, \" + customDataReg + \".y\\n\" + \"frc \" + depthCol + \".x, \" + depthCol + \".x\\n\" + \"sub \" + uvReg + \".w, \" + uvReg + \".w, \" + uvReg + \".z\\n\" + \"mul \" + uvReg + \".w, \" + uvReg + \".w, \" + depthCol + \".x\\n\" + \"add \" + uvReg + \".w, \" + uvReg + \".z, \" + uvReg + \".w\\n\" +\n\n\t\t\t\"mul \" + depthCol + \".x, \" + this._pDepthMapCoordReg + \".y, \" + customDataReg + \".y\\n\" + \"frc \" + depthCol + \".x, \" + depthCol + \".x\\n\" + \"sub \" + uvReg + \".w, \" + uvReg + \".w, \" + targetReg + \".w\\n\" + \"mul \" + uvReg + \".w, \" + uvReg + \".w, \" + depthCol + \".x\\n\" + \"add \" + targetReg + \".w, \" + targetReg + \".w, \" + uvReg + \".w\\n\";\n\n\t\tregCache.removeFragmentTempUsage(depthCol);\n\t\tregCache.removeFragmentTempUsage(uvReg);\n\n\t\tmethodVO.texturesIndex = depthMapRegister.index;\n\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivateForCascade(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tvar size:number /*int*/ = this.castingLight.shadowMapper.depthMapSize;\n\t\tvar index:number /*int*/ = methodVO.secondaryFragmentConstantsIndex;\n\t\tvar data:Array = shaderObject.fragmentConstantData;\n\t\tdata[index] = size;\n\t\tdata[index + 1] = 1/size;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iGetCascadeFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, decodeRegister:ShaderRegisterElement, depthTexture:ShaderRegisterElement, depthProjection:ShaderRegisterElement, targetRegister:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar code:string;\n\t\tvar dataReg:ShaderRegisterElement = registerCache.getFreeFragmentConstant();\n\t\tmethodVO.secondaryFragmentConstantsIndex = dataReg.index*4;\n\t\tvar temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp();\n\t\tregisterCache.addFragmentTempUsages(temp, 1);\n\t\tvar predicate:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp();\n\t\tregisterCache.addFragmentTempUsages(predicate, 1);\n\n\t\tcode = \"tex \" + temp + \", \" + depthProjection + \", \" + depthTexture + \" <2d, nearest, clamp>\\n\" + \"dp4 \" + temp + \".z, \" + temp + \", \" + decodeRegister + \"\\n\" + \"slt \" + predicate + \".x, \" + depthProjection + \".z, \" + temp + \".z\\n\" +\n\n\t\t\t\"add \" + depthProjection + \".x, \" + depthProjection + \".x, \" + dataReg + \".y\\n\" + \"tex \" + temp + \", \" + depthProjection + \", \" + depthTexture + \" <2d, nearest, clamp>\\n\" + \"dp4 \" + temp + \".z, \" + temp + \", \" + decodeRegister + \"\\n\" + \"slt \" + predicate + \".z, \" + depthProjection + \".z, \" + temp + \".z\\n\" +\n\n\t\t\t\"add \" + depthProjection + \".y, \" + depthProjection + \".y, \" + dataReg + \".y\\n\" + \"tex \" + temp + \", \" + depthProjection + \", \" + depthTexture + \" <2d, nearest, clamp>\\n\" + \"dp4 \" + temp + \".z, \" + temp + \", \" + decodeRegister + \"\\n\" + \"slt \" + predicate + \".w, \" + depthProjection + \".z, \" + temp + \".z\\n\" +\n\n\t\t\t\"sub \" + depthProjection + \".x, \" + depthProjection + \".x, \" + dataReg + \".y\\n\" + \"tex \" + temp + \", \" + depthProjection + \", \" + depthTexture + \" <2d, nearest, clamp>\\n\" + \"dp4 \" + temp + \".z, \" + temp + \", \" + decodeRegister + \"\\n\" + \"slt \" + predicate + \".y, \" + depthProjection + \".z, \" + temp + \".z\\n\" +\n\n\t\t\t\"mul \" + temp + \".xy, \" + depthProjection + \".xy, \" + dataReg + \".x\\n\" + \"frc \" + temp + \".xy, \" + temp + \".xy\\n\" +\n\n\t\t\t// some strange register juggling to prevent agal bugging out\n\t\t\t\"sub \" + depthProjection + \", \" + predicate + \".xyzw, \" + predicate + \".zwxy\\n\" + \"mul \" + depthProjection + \", \" + depthProjection + \", \" + temp + \".x\\n\" +\n\n\t\t\t\"add \" + predicate + \".xy, \" + predicate + \".xy, \" + depthProjection + \".zw\\n\" +\n\n\t\t\t\"sub \" + predicate + \".y, \" + predicate + \".y, \" + predicate + \".x\\n\" + \"mul \" + predicate + \".y, \" + predicate + \".y, \" + temp + \".y\\n\" + \"add \" + targetRegister + \".w, \" + predicate + \".x, \" + predicate + \".y\\n\";\n\n\t\tregisterCache.removeFragmentTempUsage(temp);\n\t\tregisterCache.removeFragmentTempUsage(predicate);\n\t\treturn code;\n\t}\n}\n\nexport = ShadowFilteredMethod;", + "import NearDirectionalShadowMapper\t\t= require(\"awayjs-core/lib/materials/shadowmappers/NearDirectionalShadowMapper\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport ShadingMethodEvent\t\t\t\t= require(\"awayjs-stagegl/lib/events/ShadingMethodEvent\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderLightingObject\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderLightingObject\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport ShadowMethodBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/ShadowMethodBase\");\n\n// TODO: shadow mappers references in materials should be an interface so that this class should NOT extend ShadowMapMethodBase just for some delegation work\n/**\n * ShadowNearMethod provides a shadow map method that restricts the shadowed area near the camera to optimize\n * shadow map usage. This method needs to be used in conjunction with a NearDirectionalShadowMapper.\n *\n * @see away.lights.NearDirectionalShadowMapper\n */\nclass ShadowNearMethod extends ShadowMethodBase\n{\n\tprivate _baseMethod:ShadowMethodBase;\n\n\tprivate _fadeRatio:number;\n\tprivate _nearShadowMapper:NearDirectionalShadowMapper;\n\n\tprivate _onShaderInvalidatedDelegate:Function;\n\n\t/**\n\t * Creates a new ShadowNearMethod object.\n\t * @param baseMethod The shadow map sampling method used to sample individual cascades (fe: ShadowHardMethod, ShadowSoftMethod)\n\t * @param fadeRatio The amount of shadow fading to the outer shadow area. A value of 1 would mean the shadows start fading from the camera's near plane.\n\t */\n\tconstructor(baseMethod:ShadowMethodBase, fadeRatio:number = .1)\n\t{\n\t\tsuper(baseMethod.castingLight);\n\n\t\tthis._onShaderInvalidatedDelegate = (event:ShadingMethodEvent) => this.onShaderInvalidated(event);\n\n\t\tthis._baseMethod = baseMethod;\n\t\tthis._fadeRatio = fadeRatio;\n\t\tthis._nearShadowMapper = this._pCastingLight.shadowMapper;\n\t\tif (!this._nearShadowMapper)\n\t\t\tthrow new Error(\"ShadowNearMethod requires a light that has a NearDirectionalShadowMapper instance assigned to shadowMapper.\");\n\t\tthis._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate);\n\t}\n\n\t/**\n\t * The base shadow map method on which this method's shading is based.\n\t */\n\tpublic get baseMethod():ShadowMethodBase\n\t{\n\t\treturn this._baseMethod;\n\t}\n\n\tpublic set baseMethod(value:ShadowMethodBase)\n\t{\n\t\tif (this._baseMethod == value)\n\t\t\treturn;\n\n\t\tthis._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate);\n\n\t\tthis._baseMethod = value;\n\n\t\tthis._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate);\n\n\t\tthis.iInvalidateShaderProgram();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO)\n\t{\n\t\tsuper.iInitConstants(shaderObject, methodVO);\n\t\tthis._baseMethod.iInitConstants(shaderObject, methodVO);\n\n\t\tvar fragmentData:Array = shaderObject.fragmentConstantData;\n\t\tvar index:number /*int*/ = methodVO.secondaryFragmentConstantsIndex;\n\t\tfragmentData[index + 2] = 0;\n\t\tfragmentData[index + 3] = 1;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitVO(shaderObject:ShaderLightingObject, methodVO:MethodVO)\n\t{\n\t\tthis._baseMethod.iInitVO(shaderObject, methodVO);\n\n\t\tmethodVO.needsProjection = true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic dispose()\n\t{\n\t\tthis._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic get alpha():number\n\t{\n\t\treturn this._baseMethod.alpha;\n\t}\n\n\tpublic set alpha(value:number)\n\t{\n\t\tthis._baseMethod.alpha = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic get epsilon():number\n\t{\n\t\treturn this._baseMethod.epsilon;\n\t}\n\n\tpublic set epsilon(value:number)\n\t{\n\t\tthis._baseMethod.epsilon = value;\n\t}\n\n\t/**\n\t * The amount of shadow fading to the outer shadow area. A value of 1 would mean the shadows start fading from the camera's near plane.\n\t */\n\tpublic get fadeRatio():number\n\t{\n\t\treturn this._fadeRatio;\n\t}\n\n\tpublic set fadeRatio(value:number)\n\t{\n\t\tthis._fadeRatio = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar code:string = this._baseMethod.iGetFragmentCode(shaderObject, methodVO, targetReg, registerCache, sharedRegisters);\n\n\t\tvar dataReg:ShaderRegisterElement = registerCache.getFreeFragmentConstant();\n\t\tvar temp:ShaderRegisterElement = registerCache.getFreeFragmentSingleTemp();\n\t\tmethodVO.secondaryFragmentConstantsIndex = dataReg.index*4;\n\n\t\tcode += \"abs \" + temp + \", \" + sharedRegisters.projectionFragment + \".w\\n\" +\n\t\t\t\"sub \" + temp + \", \" + temp + \", \" + dataReg + \".x\\n\" +\n\t\t\t\"mul \" + temp + \", \" + temp + \", \" + dataReg + \".y\\n\" +\n\t\t\t\"sat \" + temp + \", \" + temp + \"\\n\" +\n\t\t\t\"sub \" + temp + \", \" + dataReg + \".w,\" + temp + \"\\n\" +\n\t\t\t\"sub \" + targetReg + \".w, \" + dataReg + \".w,\" + targetReg + \".w\\n\" +\n\t\t\t\"mul \" + targetReg + \".w, \" + targetReg + \".w, \" + temp + \"\\n\" +\n\t\t\t\"sub \" + targetReg + \".w, \" + dataReg + \".w,\" + targetReg + \".w\\n\";\n\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tthis._baseMethod.iActivate(shaderObject, methodVO, stage);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iDeactivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tthis._baseMethod.iDeactivate(shaderObject, methodVO, stage);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iSetRenderState(shaderObject:ShaderObjectBase, methodVO:MethodVO, renderable:RenderableBase, stage:Stage, camera:Camera)\n\t{\n\t\t// todo: move this to activate (needs camera)\n\t\tvar near:number = camera.projection.near;\n\t\tvar d:number = camera.projection.far - near;\n\t\tvar maxDistance:number = this._nearShadowMapper.coverageRatio;\n\t\tvar minDistance:number = maxDistance*(1 - this._fadeRatio);\n\n\t\tmaxDistance = near + maxDistance*d;\n\t\tminDistance = near + minDistance*d;\n\n\t\tvar fragmentData:Array = shaderObject.fragmentConstantData;\n\t\tvar index:number /*int*/ = methodVO.secondaryFragmentConstantsIndex;\n\t\tfragmentData[index] = minDistance;\n\t\tfragmentData[index + 1] = 1/(maxDistance - minDistance);\n\n\t\tthis._baseMethod.iSetRenderState(shaderObject, methodVO, renderable, stage, camera);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetVertexCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\treturn this._baseMethod.iGetVertexCode(shaderObject, methodVO, registerCache, sharedRegisters);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iReset()\n\t{\n\t\tthis._baseMethod.iReset();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iCleanCompilationData()\n\t{\n\t\tsuper.iCleanCompilationData();\n\t\tthis._baseMethod.iCleanCompilationData();\n\t}\n\n\t/**\n\t * Called when the base method's shader code is invalidated.\n\t */\n\tprivate onShaderInvalidated(event:ShadingMethodEvent)\n\t{\n\t\tthis.iInvalidateShaderProgram();\n\t}\n}\n\nexport = ShadowNearMethod;", + "import PoissonLookup\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/PoissonLookup\");\nimport DirectionalLight\t\t\t\t\t= require(\"awayjs-core/lib/entities/DirectionalLight\");\n\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport ShadowMethodBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/ShadowMethodBase\");\n\n/**\n * ShadowSoftMethod provides a soft shadowing technique by randomly distributing sample points.\n */\nclass ShadowSoftMethod extends ShadowMethodBase\n{\n\tprivate _range:number = 1;\n\tprivate _numSamples:number /*int*/;\n\tprivate _offsets:Array;\n\n\t/**\n\t * Creates a new DiffuseBasicMethod object.\n\t *\n\t * @param castingLight The light casting the shadows\n\t * @param numSamples The amount of samples to take for dithering. Minimum 1, maximum 32.\n\t */\n\tconstructor(castingLight:DirectionalLight, numSamples:number /*int*/ = 5, range:number = 1)\n\t{\n\t\tsuper(castingLight);\n\n\t\tthis.numSamples = numSamples;\n\t\tthis.range = range;\n\t}\n\n\t/**\n\t * The amount of samples to take for dithering. Minimum 1, maximum 32. The actual maximum may depend on the\n\t * complexity of the shader.\n\t */\n\tpublic get numSamples():number /*int*/\n\t{\n\t\treturn this._numSamples;\n\t}\n\n\tpublic set numSamples(value:number /*int*/)\n\t{\n\t\tthis._numSamples = value;\n\t\t\n\t\tif (this._numSamples < 1)\n\t\t\tthis._numSamples = 1;\n\t\telse if (this._numSamples > 32)\n\t\t\tthis._numSamples = 32;\n\n\t\tthis._offsets = PoissonLookup.getDistribution(this._numSamples);\n\t\t\n\t\tthis.iInvalidateShaderProgram();\n\t}\n\n\t/**\n\t * The range in the shadow map in which to distribute the samples.\n\t */\n\tpublic get range():number\n\t{\n\t\treturn this._range;\n\t}\n\n\tpublic set range(value:number)\n\t{\n\t\tthis._range = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO)\n\t{\n\t\tsuper.iInitConstants(shaderObject, methodVO);\n\n\t\tshaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex + 8] = 1/this._numSamples;\n\t\tshaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex + 9] = 0;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tsuper.iActivate(shaderObject, methodVO, stage);\n\n\t\tvar texRange:number = .5*this._range/this._pCastingLight.shadowMapper.depthMapSize;\n\t\tvar data:Array = shaderObject.fragmentConstantData;\n\t\tvar index:number /*uint*/ = methodVO.fragmentConstantsIndex + 10;\n\t\tvar len:number /*uint*/ = this._numSamples << 1;\n\n\t\tfor (var i:number /*int*/ = 0; i < len; ++i)\n\t\t\tdata[index + i] = this._offsets[i]*texRange;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pGetPlanarFragmentCode(methodVO:MethodVO, targetReg:ShaderRegisterElement, regCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\t// todo: move some things to super\n\t\tvar depthMapRegister:ShaderRegisterElement = regCache.getFreeTextureReg();\n\t\tvar decReg:ShaderRegisterElement = regCache.getFreeFragmentConstant();\n\t\tvar dataReg:ShaderRegisterElement = regCache.getFreeFragmentConstant();\n\t\tvar customDataReg:ShaderRegisterElement = regCache.getFreeFragmentConstant();\n\n\t\tmethodVO.fragmentConstantsIndex = decReg.index*4;\n\t\tmethodVO.texturesIndex = depthMapRegister.index;\n\n\t\treturn this.getSampleCode(regCache, depthMapRegister, decReg, targetReg, customDataReg);\n\t}\n\n\t/**\n\t * Adds the code for another tap to the shader code.\n\t * @param uv The uv register for the tap.\n\t * @param texture The texture register containing the depth map.\n\t * @param decode The register containing the depth map decoding data.\n\t * @param target The target register to add the tap comparison result.\n\t * @param regCache The register cache managing the registers.\n\t * @return\n\t */\n\tprivate addSample(uv:ShaderRegisterElement, texture:ShaderRegisterElement, decode:ShaderRegisterElement, target:ShaderRegisterElement, regCache:ShaderRegisterCache):string\n\t{\n\t\tvar temp:ShaderRegisterElement = regCache.getFreeFragmentVectorTemp();\n\t\treturn \"tex \" + temp + \", \" + uv + \", \" + texture + \" <2d,nearest,clamp>\\n\" +\n\t\t\t\"dp4 \" + temp + \".z, \" + temp + \", \" + decode + \"\\n\" +\n\t\t\t\"slt \" + uv + \".w, \" + this._pDepthMapCoordReg + \".z, \" + temp + \".z\\n\" + // 0 if in shadow\n\t\t\t\"add \" + target + \".w, \" + target + \".w, \" + uv + \".w\\n\";\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivateForCascade(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tsuper.iActivate(shaderObject, methodVO, stage);\n\n\t\tvar texRange:number = this._range/this._pCastingLight.shadowMapper.depthMapSize;\n\t\tvar data:Array = shaderObject.fragmentConstantData;\n\t\tvar index:number /*uint*/ = methodVO.secondaryFragmentConstantsIndex;\n\t\tvar len:number /*uint*/ = this._numSamples << 1;\n\t\tdata[index] = 1/this._numSamples;\n\t\tdata[index + 1] = 0;\n\t\tindex += 2;\n\n\t\tfor (var i:number /*int*/ = 0; i < len; ++i)\n\t\t\tdata[index + i] = this._offsets[i]*texRange;\n\n\t\tif (len%4 == 0) {\n\t\t\tdata[index + len] = 0;\n\t\t\tdata[index + len + 1] = 0;\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iGetCascadeFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, decodeRegister:ShaderRegisterElement, depthTexture:ShaderRegisterElement, depthProjection:ShaderRegisterElement, targetRegister:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tthis._pDepthMapCoordReg = depthProjection;\n\n\t\tvar dataReg:ShaderRegisterElement = registerCache.getFreeFragmentConstant();\n\t\tmethodVO.secondaryFragmentConstantsIndex = dataReg.index*4;\n\n\t\treturn this.getSampleCode(registerCache, depthTexture, decodeRegister, targetRegister, dataReg);\n\t}\n\n\t/**\n\t * Get the actual shader code for shadow mapping\n\t * @param regCache The register cache managing the registers.\n\t * @param depthTexture The texture register containing the depth map.\n\t * @param decodeRegister The register containing the depth map decoding data.\n\t * @param targetReg The target register to add the shadow coverage.\n\t * @param dataReg The register containing additional data.\n\t */\n\tprivate getSampleCode(regCache:ShaderRegisterCache, depthTexture:ShaderRegisterElement, decodeRegister:ShaderRegisterElement, targetRegister:ShaderRegisterElement, dataReg:ShaderRegisterElement):string\n\t{\n\t\tvar uvReg:ShaderRegisterElement;\n\t\tvar code:string;\n\t\tvar offsets:Array = new Array(dataReg + \".zw\");\n\t\tuvReg = regCache.getFreeFragmentVectorTemp();\n\t\tregCache.addFragmentTempUsages(uvReg, 1);\n\n\t\tvar temp:ShaderRegisterElement = regCache.getFreeFragmentVectorTemp();\n\n\t\tvar numRegs:number /*int*/ = this._numSamples >> 1;\n\t\tfor (var i:number /*int*/ = 0; i < numRegs; ++i) {\n\t\t\tvar reg:ShaderRegisterElement = regCache.getFreeFragmentConstant();\n\t\t\toffsets.push(reg + \".xy\");\n\t\t\toffsets.push(reg + \".zw\");\n\t\t}\n\n\t\tfor (i = 0; i < this._numSamples; ++i) {\n\t\t\tif (i == 0) {\n\t\t\t\tcode = \"add \" + uvReg + \", \" + this._pDepthMapCoordReg + \", \" + dataReg + \".zwyy\\n\" +\n\t\t\t\t\t\"tex \" + temp + \", \" + uvReg + \", \" + depthTexture + \" <2d,nearest,clamp>\\n\" +\n\t\t\t\t\t\"dp4 \" + temp + \".z, \" + temp + \", \" + decodeRegister + \"\\n\" +\n\t\t\t\t\t\"slt \" + targetRegister + \".w, \" + this._pDepthMapCoordReg + \".z, \" + temp + \".z\\n\"; // 0 if in shadow;\n\t\t\t} else {\n\t\t\t\tcode += \"add \" + uvReg + \".xy, \" + this._pDepthMapCoordReg + \".xy, \" + offsets[i] + \"\\n\" +\n\t\t\t\t\tthis.addSample(uvReg, depthTexture, decodeRegister, targetRegister, regCache);\n\t\t\t}\n\t\t}\n\n\t\tregCache.removeFragmentTempUsage(uvReg);\n\n\t\tcode += \"mul \" + targetRegister + \".w, \" + targetRegister + \".w, \" + dataReg + \".x\\n\"; // average\n\n\t\treturn code;\n\t}\n}\n\nexport = ShadowSoftMethod;", + "import MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderLightingObject\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderLightingObject\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport SpecularBasicMethod\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/SpecularBasicMethod\");\n\n/**\n * SpecularAnisotropicMethod provides a specular method resulting in anisotropic highlights. These are typical for\n * surfaces with microfacet details such as tiny grooves. In particular, this uses the Heidrich-Seidel distrubution.\n * The tangent vectors are used as the surface groove directions.\n */\nclass SpecularAnisotropicMethod extends SpecularBasicMethod\n{\n\t/**\n\t * Creates a new SpecularAnisotropicMethod object.\n\t */\n\tconstructor()\n\t{\n\t\tsuper();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitVO(shaderObject:ShaderLightingObject, methodVO:MethodVO)\n\t{\n\t\tmethodVO.needsTangents = true;\n\t\tmethodVO.needsView = true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentCodePerLight(shaderObject:ShaderLightingObject, methodVO:MethodVO, lightDirReg:ShaderRegisterElement, lightColReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar code:string = \"\";\n\t\tvar t:ShaderRegisterElement;\n\n\t\tif (this._pIsFirstLight)\n\t\t\tt = this._pTotalLightColorReg;\n\t\telse {\n\t\t\tt = registerCache.getFreeFragmentVectorTemp();\n\t\t\tregisterCache.addFragmentTempUsages(t, 1);\n\t\t}\n\n\t\t// (sin(l,t) * sin(v,t) - cos(l,t)*cos(v,t)) ^ k\n\n\t\tcode += \"nrm \" + t + \".xyz, \" + sharedRegisters.tangentVarying + \".xyz\\n\" +\n\t\t\t\"dp3 \" + t + \".w, \" + t + \".xyz, \" + lightDirReg + \".xyz\\n\" +\n\t\t\t\"dp3 \" + t + \".z, \" + t + \".xyz, \" + sharedRegisters.viewDirFragment + \".xyz\\n\";\n\n\t\t// (sin(t.w) * sin(t.z) - cos(t.w)*cos(t.z)) ^ k\n\t\tcode += \"sin \" + t + \".x, \" + t + \".w\\n\" +\n\t\t\t\"sin \" + t + \".y, \" + t + \".z\\n\" +\n\t\t\t// (t.x * t.y - cos(t.w)*cos(t.z)) ^ k\n\t\t\t\"mul \" + t + \".x, \" + t + \".x, \" + t + \".y\\n\" +\n\t\t\t// (t.x - cos(t.w)*cos(t.z)) ^ k\n\t\t\t\"cos \" + t + \".z, \" + t + \".z\\n\" +\n\t\t\t\"cos \" + t + \".w, \" + t + \".w\\n\" +\n\t\t\t// (t.x - t.w*t.z) ^ k\n\t\t\t\"mul \" + t + \".w, \" + t + \".w, \" + t + \".z\\n\" +\n\t\t\t// (t.x - t.w) ^ k\n\t\t\t\"sub \" + t + \".w, \" + t + \".x, \" + t + \".w\\n\";\n\n\t\tif (this._pUseTexture) {\n\t\t\t// apply gloss modulation from texture\n\t\t\tcode += \"mul \" + this._pSpecularTexData + \".w, \" + this._pSpecularTexData + \".y, \" + this._pSpecularDataRegister + \".w\\n\" +\n\t\t\t\t\"pow \" + t + \".w, \" + t + \".w, \" + this._pSpecularTexData + \".w\\n\";\n\t\t} else\n\t\t\tcode += \"pow \" + t + \".w, \" + t + \".w, \" + this._pSpecularDataRegister + \".w\\n\";\n\n\t\t// attenuate\n\t\tcode += \"mul \" + t + \".w, \" + t + \".w, \" + lightDirReg + \".w\\n\";\n\n\t\tif (this._iModulateMethod != null)\n\t\t\tcode += this._iModulateMethod(shaderObject, methodVO, t, registerCache, sharedRegisters);\n\n\t\tcode += \"mul \" + t + \".xyz, \" + lightColReg + \".xyz, \" + t + \".w\\n\";\n\n\t\tif (!this._pIsFirstLight) {\n\t\t\tcode += \"add \" + this._pTotalLightColorReg + \".xyz, \" + this._pTotalLightColorReg + \".xyz, \" + t + \".xyz\\n\";\n\t\t\tregisterCache.removeFragmentTempUsage(t);\n\t\t}\n\n\t\tthis._pIsFirstLight = false;\n\n\t\treturn code;\n\t}\n}\n\nexport = SpecularAnisotropicMethod;", + "import Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderLightingObject\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderLightingObject\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport SpecularBasicMethod\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/SpecularBasicMethod\");\n\nimport SpecularCompositeMethod\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/SpecularCompositeMethod\");\n\n/**\n * SpecularCelMethod provides a shading method to add specular cel (cartoon) shading.\n */\nclass SpecularCelMethod extends SpecularCompositeMethod\n{\n\tprivate _dataReg:ShaderRegisterElement;\n\tprivate _smoothness:number = .1;\n\tprivate _specularCutOff:number = .1;\n\n\t/**\n\t * Creates a new SpecularCelMethod object.\n\t * @param specularCutOff The threshold at which the specular highlight should be shown.\n\t * @param baseMethod An optional specular method on which the cartoon shading is based. If ommitted, SpecularBasicMethod is used.\n\t */\n\tconstructor(specularCutOff:number = .5, baseMethod:SpecularBasicMethod = null)\n\t{\n\t\tsuper(null, baseMethod);\n\n\t\tthis.baseMethod._iModulateMethod = (shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData) => this.clampSpecular(shaderObject, methodVO, targetReg, registerCache, sharedRegisters);\n\n\t\tthis._specularCutOff = specularCutOff;\n\t}\n\n\t/**\n\t * The smoothness of the highlight edge.\n\t */\n\tpublic get smoothness():number\n\t{\n\t\treturn this._smoothness;\n\t}\n\n\tpublic set smoothness(value:number)\n\t{\n\t\tthis._smoothness = value;\n\t}\n\n\t/**\n\t * The threshold at which the specular highlight should be shown.\n\t */\n\tpublic get specularCutOff():number\n\t{\n\t\treturn this._specularCutOff;\n\t}\n\n\tpublic set specularCutOff(value:number)\n\t{\n\t\tthis._specularCutOff = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderLightingObject, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tsuper.iActivate(shaderObject, methodVO, stage);\n\n\t\tvar index:number /*int*/ = methodVO.secondaryFragmentConstantsIndex;\n\t\tvar data:Array = shaderObject.fragmentConstantData;\n\t\tdata[index] = this._smoothness;\n\t\tdata[index + 1] = this._specularCutOff;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iCleanCompilationData()\n\t{\n\t\tsuper.iCleanCompilationData();\n\t\tthis._dataReg = null;\n\t}\n\n\t/**\n\t * Snaps the specular shading strength of the wrapped method to zero or one, depending on whether or not it exceeds the specularCutOff\n\t * @param vo The MethodVO used to compile the current shader.\n\t * @param t The register containing the specular strength in the \"w\" component, and either the half-vector or the reflection vector in \"xyz\".\n\t * @param regCache The register cache used for the shader compilation.\n\t * @param sharedRegisters The shared register data for this shader.\n\t * @return The AGAL fragment code for the method.\n\t */\n\tprivate clampSpecular(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\treturn \"sub \" + targetReg + \".y, \" + targetReg + \".w, \" + this._dataReg + \".y\\n\" + // x - cutoff\n\t\t\t\"div \" + targetReg + \".y, \" + targetReg + \".y, \" + this._dataReg + \".x\\n\" + // (x - cutoff)/epsilon\n\t\t\t\"sat \" + targetReg + \".y, \" + targetReg + \".y\\n\" +\n\t\t\t\"sge \" + targetReg + \".w, \" + targetReg + \".w, \" + this._dataReg + \".y\\n\" +\n\t\t\t\"mul \" + targetReg + \".w, \" + targetReg + \".w, \" + targetReg + \".y\\n\";\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentPreLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tthis._dataReg = registerCache.getFreeFragmentConstant();\n\t\tmethodVO.secondaryFragmentConstantsIndex = this._dataReg.index*4;\n\n\t\treturn super.iGetFragmentPreLightingCode(shaderObject, methodVO, registerCache, sharedRegisters);\n\t}\n}\n\nexport = SpecularCelMethod;", + "import Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\nimport Texture2DBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/Texture2DBase\");\n\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport ShadingMethodEvent\t\t\t\t= require(\"awayjs-stagegl/lib/events/ShadingMethodEvent\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderLightingObject\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderLightingObject\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport SpecularBasicMethod\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/SpecularBasicMethod\");\nimport MaterialPassBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/passes/MaterialPassBase\");\n\n/**\n * SpecularCompositeMethod provides a base class for specular methods that wrap a specular method to alter the\n * calculated specular reflection strength.\n */\nclass SpecularCompositeMethod extends SpecularBasicMethod\n{\n\tprivate _baseMethod:SpecularBasicMethod;\n\n\tprivate _onShaderInvalidatedDelegate:Function;\n\n\t/**\n\t * Creates a new SpecularCompositeMethod object.\n\t *\n\t * @param modulateMethod The method which will add the code to alter the base method's strength. It needs to have the signature modSpecular(t:ShaderRegisterElement, regCache:ShaderRegisterCache):string, in which t.w will contain the specular strength and t.xyz will contain the half-vector or the reflection vector.\n\t * @param baseMethod The base specular method on which this method's shading is based.\n\t */\n\tconstructor(modulateMethod:(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData) => string, baseMethod:SpecularBasicMethod = null)\n\t{\n\t\tsuper();\n\n\t\tthis._onShaderInvalidatedDelegate = (event:ShadingMethodEvent) => this.onShaderInvalidated(event);\n\n\t\tthis._baseMethod = baseMethod || new SpecularBasicMethod();\n\t\tthis._baseMethod._iModulateMethod = modulateMethod;\n\t\tthis._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitVO(shaderObject:ShaderLightingObject, methodVO:MethodVO)\n\t{\n\t\tthis._baseMethod.iInitVO(shaderObject, methodVO);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO)\n\t{\n\t\tthis._baseMethod.iInitConstants(shaderObject, methodVO);\n\t}\n\n\t/**\n\t * The base specular method on which this method's shading is based.\n\t */\n\tpublic get baseMethod():SpecularBasicMethod\n\t{\n\t\treturn this._baseMethod;\n\t}\n\n\tpublic set baseMethod(value:SpecularBasicMethod)\n\t{\n\t\tif (this._baseMethod == value)\n\t\t\treturn;\n\n\t\tthis._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate);\n\n\t\tthis._baseMethod = value;\n\n\t\tthis._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate);\n\n\t\tthis.iInvalidateShaderProgram();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic get gloss():number\n\t{\n\t\treturn this._baseMethod.gloss;\n\t}\n\n\tpublic set gloss(value:number)\n\t{\n\t\tthis._baseMethod.gloss = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic get specular():number\n\t{\n\t\treturn this._baseMethod.specular;\n\t}\n\n\tpublic set specular(value:number)\n\t{\n\t\tthis._baseMethod.specular = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic get passes():Array\n\t{\n\t\treturn this._baseMethod.passes;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic dispose()\n\t{\n\t\tthis._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate);\n\t\tthis._baseMethod.dispose();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic get texture():Texture2DBase\n\t{\n\t\treturn this._baseMethod.texture;\n\t}\n\n\tpublic set texture(value:Texture2DBase)\n\t{\n\t\tthis._baseMethod.texture = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderLightingObject, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tthis._baseMethod.iActivate(shaderObject, methodVO, stage);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iSetRenderState(shaderObject:ShaderLightingObject, methodVO:MethodVO, renderable:RenderableBase, stage:Stage, camera:Camera)\n\t{\n\t\tthis._baseMethod.iSetRenderState(shaderObject, methodVO, renderable, stage, camera);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iDeactivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tthis._baseMethod.iDeactivate(shaderObject, methodVO, stage);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetVertexCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\treturn this._baseMethod.iGetVertexCode(shaderObject, methodVO, registerCache, sharedRegisters);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentPreLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\treturn this._baseMethod.iGetFragmentPreLightingCode(shaderObject, methodVO, registerCache, sharedRegisters);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentCodePerLight(shaderObject:ShaderLightingObject, methodVO:MethodVO, lightDirReg:ShaderRegisterElement, lightColReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\treturn this._baseMethod.iGetFragmentCodePerLight(shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t * @return\n\t */\n\tpublic iGetFragmentCodePerProbe(shaderObject:ShaderLightingObject, methodVO:MethodVO, cubeMapReg:ShaderRegisterElement, weightRegister:string, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\treturn this._baseMethod.iGetFragmentCodePerProbe(shaderObject, methodVO, cubeMapReg, weightRegister, registerCache, sharedRegisters);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentPostLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\treturn this._baseMethod.iGetFragmentPostLightingCode(shaderObject, methodVO, targetReg, registerCache, sharedRegisters);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iReset()\n\t{\n\t\tthis._baseMethod.iReset();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iCleanCompilationData()\n\t{\n\t\tsuper.iCleanCompilationData();\n\t\tthis._baseMethod.iCleanCompilationData();\n\t}\n\n\t/**\n\t * Called when the base method's shader code is invalidated.\n\t */\n\tprivate onShaderInvalidated(event:ShadingMethodEvent)\n\t{\n\t\tthis.iInvalidateShaderProgram();\n\t}\n}\n\nexport = SpecularCompositeMethod;", + "import Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\n\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderLightingObject\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderLightingObject\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport SpecularBasicMethod\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/SpecularBasicMethod\");\n\nimport SpecularCompositeMethod\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/SpecularCompositeMethod\");\n\n/**\n * SpecularFresnelMethod provides a specular shading method that causes stronger highlights on grazing view angles.\n */\nclass SpecularFresnelMethod extends SpecularCompositeMethod\n{\n\tprivate _dataReg:ShaderRegisterElement;\n\tprivate _incidentLight:boolean;\n\tprivate _fresnelPower:number = 5;\n\tprivate _normalReflectance:number = .028; // default value for skin\n\n\t/**\n\t * Creates a new SpecularFresnelMethod object.\n\t * @param basedOnSurface Defines whether the fresnel effect should be based on the view angle on the surface (if true), or on the angle between the light and the view.\n\t * @param baseMethod The specular method to which the fresnel equation. Defaults to SpecularBasicMethod.\n\t */\n\tconstructor(basedOnSurface:boolean = true, baseMethod:SpecularBasicMethod = null)\n\t{\n\t\t// may want to offer diff speculars\n\t\tsuper(null, baseMethod);\n\n\t\tthis.baseMethod._iModulateMethod = (shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData) => this.modulateSpecular(shaderObject, methodVO, targetReg, registerCache, sharedRegisters);\n\n\t\tthis._incidentLight = !basedOnSurface;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO)\n\t{\n\n\t\tvar index:number = methodVO.secondaryFragmentConstantsIndex;\n\t\tshaderObject.fragmentConstantData[index + 2] = 1;\n\t\tshaderObject.fragmentConstantData[index + 3] = 0;\n\t}\n\n\t/**\n\t * Defines whether the fresnel effect should be based on the view angle on the surface (if true), or on the angle between the light and the view.\n\t */\n\tpublic get basedOnSurface():boolean\n\t{\n\t\treturn !this._incidentLight;\n\t}\n\n\tpublic set basedOnSurface(value:boolean)\n\t{\n\t\tif (this._incidentLight != value)\n\t\t\treturn;\n\n\t\tthis._incidentLight = !value;\n\n\t\tthis.iInvalidateShaderProgram();\n\t}\n\n\t/**\n\t * The power used in the Fresnel equation. Higher values make the fresnel effect more pronounced. Defaults to 5.\n\t */\n\tpublic get fresnelPower():number\n\t{\n\t\treturn this._fresnelPower;\n\t}\n\n\tpublic set fresnelPower(value:number)\n\t{\n\t\tthis._fresnelPower = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iCleanCompilationData()\n\t{\n\t\tsuper.iCleanCompilationData();\n\t\tthis._dataReg = null;\n\t}\n\n\t/**\n\t * The minimum amount of reflectance, ie the reflectance when the view direction is normal to the surface or light direction.\n\t */\n\tpublic get normalReflectance():number\n\t{\n\t\treturn this._normalReflectance;\n\t}\n\n\tpublic set normalReflectance(value:number)\n\t{\n\t\tthis._normalReflectance = value;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iActivate(shaderObject:ShaderLightingObject, methodVO:MethodVO, stage:Stage)\n\t{\n\t\tsuper.iActivate(shaderObject, methodVO, stage);\n\n\t\tvar fragmentData:Array = shaderObject.fragmentConstantData;\n\n\t\tvar index:number = methodVO.secondaryFragmentConstantsIndex;\n\t\tfragmentData[index] = this._normalReflectance;\n\t\tfragmentData[index + 1] = this._fresnelPower;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentPreLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tthis._dataReg = registerCache.getFreeFragmentConstant();\n\n\t\tconsole.log('SpecularFresnelMethod', 'iGetFragmentPreLightingCode', this._dataReg);\n\n\t\tmethodVO.secondaryFragmentConstantsIndex = this._dataReg.index*4;\n\n\t\treturn super.iGetFragmentPreLightingCode(shaderObject, methodVO, registerCache, sharedRegisters);\n\t}\n\n\t/**\n\t * Applies the fresnel effect to the specular strength.\n\t *\n\t * @param vo The MethodVO object containing the method data for the currently compiled material pass.\n\t * @param target The register containing the specular strength in the \"w\" component, and the half-vector/reflection vector in \"xyz\".\n\t * @param regCache The register cache used for the shader compilation.\n\t * @param sharedRegisters The shared registers created by the compiler.\n\t * @return The AGAL fragment code for the method.\n\t */\n\tprivate modulateSpecular(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar code:string;\n\n\t\tcode = \"dp3 \" + targetReg + \".y, \" + sharedRegisters.viewDirFragment + \".xyz, \" + (this._incidentLight? targetReg : sharedRegisters.normalFragment) + \".xyz\\n\" + // dot(V, H)\n\t\t\t\"sub \" + targetReg + \".y, \" + this._dataReg + \".z, \" + targetReg + \".y\\n\" + // base = 1-dot(V, H)\n\t\t\t\"pow \" + targetReg + \".x, \" + targetReg + \".y, \" + this._dataReg + \".y\\n\" + // exp = pow(base, 5)\n\t\t\t\"sub \" + targetReg + \".y, \" + this._dataReg + \".z, \" + targetReg + \".y\\n\" + // 1 - exp\n\t\t\t\"mul \" + targetReg + \".y, \" + this._dataReg + \".x, \" + targetReg + \".y\\n\" + // f0*(1 - exp)\n\t\t\t\"add \" + targetReg + \".y, \" + targetReg + \".x, \" + targetReg + \".y\\n\" + // exp + f0*(1 - exp)\n\t\t\t\"mul \" + targetReg + \".w, \" + targetReg + \".w, \" + targetReg + \".y\\n\";\n\n\n\t\tconsole.log('SpecularFresnelMethod', 'modulateSpecular', code);\n\n\t\treturn code;\n\t}\n\n}\n\nexport = SpecularFresnelMethod;", + "import MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderLightingObject\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderLightingObject\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport ShaderRegisterElement\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterElement\");\nimport SpecularBasicMethod\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/SpecularBasicMethod\");\n\n/**\n * SpecularPhongMethod provides a specular method that provides Phong highlights.\n */\nclass SpecularPhongMethod extends SpecularBasicMethod\n{\n\t/**\n\t * Creates a new SpecularPhongMethod object.\n\t */\n\tconstructor()\n\t{\n\t\tsuper();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic iGetFragmentCodePerLight(shaderObject:ShaderLightingObject, methodVO:MethodVO, lightDirReg:ShaderRegisterElement, lightColReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar code:string = \"\";\n\t\tvar t:ShaderRegisterElement;\n\n\t\tif (this._pIsFirstLight) {\n\t\t\tt = this._pTotalLightColorReg;\n\t\t} else {\n\t\t\tt = registerCache.getFreeFragmentVectorTemp();\n\t\t\tregisterCache.addFragmentTempUsages(t, 1);\n\t\t}\n\n\t\tvar viewDirReg:ShaderRegisterElement =sharedRegisters.viewDirFragment;\n\t\tvar normalReg:ShaderRegisterElement =sharedRegisters.normalFragment;\n\n\t\t// phong model\n\t\tcode += \"dp3 \" + t + \".w, \" + lightDirReg + \", \" + normalReg + \"\\n\" + // sca1 = light.normal\n\n\t\t\t//find the reflected light vector R\n\t\t\t\"add \" + t + \".w, \" + t + \".w, \" + t + \".w\\n\" + // sca1 = sca1*2\n\t\t\t\"mul \" + t + \".xyz, \" + normalReg + \", \" + t + \".w\\n\" + // vec1 = normal*sca1\n\t\t\t\"sub \" + t + \".xyz, \" + t + \", \" + lightDirReg + \"\\n\" + // vec1 = vec1 - light (light vector is negative)\n\n\t\t\t//smooth the edge as incidence angle approaches 90\n\t\t\t\"add \" + t + \".w, \" + t + \".w, \" +sharedRegisters.commons + \".w\\n\" + // sca1 = sca1 + smoothtep;\n\t\t\t\"sat \" + t + \".w, \" + t + \".w\\n\" + // sca1 range 0 - 1\n\t\t\t\"mul \" + t + \".xyz, \" + t + \", \" + t + \".w\\n\" + // vec1 = vec1*sca1\n\n\t\t\t//find the dot product between R and V\n\t\t\t\"dp3 \" + t + \".w, \" + t + \", \" + viewDirReg + \"\\n\" + // sca1 = vec1.view\n\t\t\t\"sat \" + t + \".w, \" + t + \".w\\n\";\n\n\t\tif (this._pUseTexture) {\n\t\t\t// apply gloss modulation from texture\n\t\t\tcode += \"mul \" + this._pSpecularTexData + \".w, \" + this._pSpecularTexData + \".y, \" + this._pSpecularDataRegister + \".w\\n\" + \"pow \" + t + \".w, \" + t + \".w, \" + this._pSpecularTexData + \".w\\n\";\n\t\t} else\n\t\t\tcode += \"pow \" + t + \".w, \" + t + \".w, \" + this._pSpecularDataRegister + \".w\\n\";\n\n\t\t// attenuate\n\t\tif (shaderObject.usesLightFallOff)\n\t\t\tcode += \"mul \" + t + \".w, \" + t + \".w, \" + lightDirReg + \".w\\n\";\n\n\t\tif (this._iModulateMethod != null)\n\t\t\tcode += this._iModulateMethod(shaderObject, methodVO, t, registerCache, sharedRegisters);\n\n\t\tcode += \"mul \" + t + \".xyz, \" + lightColReg + \".xyz, \" + t + \".w\\n\";\n\n\t\tif (!this._pIsFirstLight) {\n\t\t\tcode += \"add \" + this._pTotalLightColorReg + \".xyz, \" + this._pTotalLightColorReg + \".xyz, \" + t + \".xyz\\n\";\n\t\t\tregisterCache.removeFragmentTempUsage(t);\n\t\t}\n\n\t\tthis._pIsFirstLight = false;\n\n\t\treturn code;\n\t}\n}\n\nexport = SpecularPhongMethod;", + "import LightBase\t\t\t\t\t\t= require(\"awayjs-core/lib/core/base/LightBase\");\nimport TriangleSubGeometry\t\t\t\t= require(\"awayjs-core/lib/core/base/TriangleSubGeometry\");\nimport Matrix3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Matrix3D\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\nimport MaterialBase\t\t\t\t\t\t= require(\"awayjs-core/lib/materials/MaterialBase\");\nimport RenderTexture\t\t\t\t\t= require(\"awayjs-core/lib/textures/RenderTexture\");\n\nimport Stage\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/base/Stage\");\nimport MaterialPassData\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/MaterialPassData\");\nimport RenderableBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/pool/RenderableBase\");\nimport ContextGLProgramType\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/ContextGLProgramType\");\nimport IContextStageGL\t\t\t\t\t= require(\"awayjs-stagegl/lib/core/stagegl/IContextStageGL\");\nimport MethodVO\t\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/MethodVO\");\nimport ShaderObjectBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderObjectBase\");\nimport ShaderRegisterCache\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterCache\");\nimport ShaderRegisterData\t\t\t\t= require(\"awayjs-stagegl/lib/materials/compilation/ShaderRegisterData\");\nimport MaterialPassBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/passes/MaterialPassBase\");\n\n/**\n * The SingleObjectDepthPass provides a material pass that renders a single object to a depth map from the point\n * of view from a light.\n */\nclass SingleObjectDepthPass extends MaterialPassBase\n{\n\tprivate _textures:Object;\n\tprivate _projections:Object;\n\tprivate _textureSize:number /*uint*/ = 512;\n\tprivate _polyOffset:Array = Array(15, 0, 0, 0);\n\tprivate _enc:Array;\n\tprivate _projectionTexturesInvalid:Boolean = true;\n\n\t/**\n\t * The size of the depth map texture to render to.\n\t */\n\tpublic get textureSize():number\n\t{\n\t\treturn this._textureSize;\n\t}\n\n\tpublic set textureSize(value:number)\n\t{\n\t\tthis._textureSize = value;\n\t}\n\n\t/**\n\t * The amount by which the rendered object will be inflated, to prevent depth map rounding errors.\n\t */\n\tpublic get polyOffset():number\n\t{\n\t\treturn this._polyOffset[0];\n\t}\n\n\tpublic set polyOffset(value:number)\n\t{\n\t\tthis._polyOffset[0] = value;\n\t}\n\n\t/**\n\t * Creates a new SingleObjectDepthPass object.\n\t */\n\tconstructor()\n\t{\n\t\tsuper();\n\n\t\t//this._pNumUsedStreams = 2;\n\t\t//this._pNumUsedVertexConstants = 7;\n\t\t//this._enc = Array(1.0, 255.0, 65025.0, 16581375.0, 1.0/255.0, 1.0/255.0, 1.0/255.0, 0.0);\n\t\t//\n\t\t//this._pAnimatableAttributes = Array(\"va0\", \"va1\");\n\t\t//this._pAnimationTargetRegisters = Array(\"vt0\", \"vt1\");\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic dispose()\n\t{\n\t\tif (this._textures) {\n\t\t\tfor (var key in this._textures) {\n\t\t\t\tvar texture:RenderTexture = this._textures[key];\n\t\t\t\ttexture.dispose();\n\t\t\t}\n\t\t\tthis._textures = null;\n\t\t}\n\t}\n\n\t/**\n\t * Updates the projection textures used to contain the depth renders.\n\t */\n\tprivate updateProjectionTextures()\n\t{\n\t\tif (this._textures) {\n\t\t\tfor (var key in this._textures) {\n\t\t\t\tvar texture:RenderTexture = this._textures[key];\n\t\t\t\ttexture.dispose();\n\t\t\t}\n\t\t}\n\n\t\tthis._textures = new Object();\n\t\tthis._projections = new Object();\n\t\tthis._projectionTexturesInvalid = false;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iGetVertexCode():string\n\t{\n\t\tvar code:string;\n\t\t// offset\n\t\tcode = \"mul vt7, vt1, vc4.x\t\\n\" +\n\t\t\t\t\"add vt7, vt7, vt0\\n\" +\n\t\t\t\t\"mov vt7.w, vt0.w\\n\";\n\t\t// project\n\t\tcode += \"m44 vt2, vt7, vc0\\n\" +\n\t\t\t\t\"mov op, vt2\\n\";\n\n\t\t// perspective divide\n\t\tcode += \"div v0, vt2, vt2.w\\n\";\n\n\t\treturn code;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iGetFragmentCode(shaderObject:ShaderObjectBase, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string\n\t{\n\t\tvar code:string = \"\";\n\n\t\t// encode float -> rgba\n\t\tcode += \"mul ft0, fc0, v0.z\\n\" +\n\t\t\t\t\"frc ft0, ft0\\n\" +\n\t\t\t\t\"mul ft1, ft0.yzww, fc1\\n\" +\n\t\t\t\t\"sub ft0, ft0, ft1\\n\" +\n\t\t\t\t\"mov oc, ft0\\n\";\n\n\t\treturn code;\n\t}\n\n\t/**\n\t * Gets the depth maps rendered for this object from all lights.\n\t * @param renderable The renderable for which to retrieve the depth maps.\n\t * @param stage3DProxy The Stage3DProxy object currently used for rendering.\n\t * @return A list of depth map textures for all supported lights.\n\t */\n\tpublic _iGetDepthMap(renderable:RenderableBase):RenderTexture\n\t{\n\t\treturn this._textures[renderable.materialOwner.id];\n\t}\n\n\t/**\n\t * Retrieves the depth map projection maps for all lights.\n\t * @param renderable The renderable for which to retrieve the projection maps.\n\t * @return A list of projection maps for all supported lights.\n\t */\n\tpublic _iGetProjection(renderable:RenderableBase):Matrix3D\n\t{\n\t\treturn this._projections[renderable.materialOwner.id];\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iRender(pass:MaterialPassData, renderable:RenderableBase, stage:Stage, camera:Camera, viewProjection:Matrix3D)\n\t{\n\t\tvar matrix:Matrix3D;\n\t\tvar context:IContextStageGL = stage.context;\n\t\tvar len:number /*uint*/;\n\t\tvar light:LightBase;\n\t\tvar lights:Array = this._pLightPicker.allPickedLights;\n\t\tvar rId:number = renderable.materialOwner.id;\n\n\t\tif (!this._textures[rId])\n\t\t\tthis._textures[rId] = new RenderTexture(this._textureSize, this._textureSize);\n\n\t\tif (!this._projections[rId])\n\t\t\tthis._projections[rId] = new Matrix3D();\n\n\t\tlen = lights.length;\n\n\t\t// local position = enough\n\t\tlight = lights[0];\n\n\t\tmatrix = light.iGetObjectProjectionMatrix(renderable.sourceEntity, camera, this._projections[rId]);\n\n\t\tcontext.setRenderTarget(this._textures[rId], true);\n\t\tcontext.clear(1.0, 1.0, 1.0);\n\t\tcontext.setProgramConstantsFromMatrix(ContextGLProgramType.VERTEX, 0, matrix, true);\n\t\tcontext.setProgramConstantsFromArray(ContextGLProgramType.FRAGMENT, 0, this._enc, 2);\n\n\t\tcontext.activateBuffer(0, renderable.getVertexData(TriangleSubGeometry.POSITION_DATA), renderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA), TriangleSubGeometry.POSITION_FORMAT);\n\t\tcontext.activateBuffer(1, renderable.getVertexData(TriangleSubGeometry.NORMAL_DATA), renderable.getVertexOffset(TriangleSubGeometry.NORMAL_DATA), TriangleSubGeometry.NORMAL_FORMAT);\n\t\tcontext.drawTriangles(context.getIndexBuffer(renderable.getIndexData()), 0, renderable.numTriangles);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iActivate(pass:MaterialPassData, stage:Stage, camera:Camera)\n\t{\n\t\tif (this._projectionTexturesInvalid)\n\t\t\tthis.updateProjectionTextures();\n\n\t\t// never scale\n\t\tsuper._iActivate(pass, stage, camera);\n\n\t\t( stage.context).setProgramConstantsFromArray(ContextGLProgramType.VERTEX, 4, this._polyOffset, 1);\n\t}\n}\n\nexport = SingleObjectDepthPass;", + "import DisplayObjectContainer\t\t\t= require(\"awayjs-core/lib/containers/DisplayObjectContainer\");\nimport BitmapData\t\t\t\t\t\t= require(\"awayjs-core/lib/core/base/BitmapData\");\nimport BlendMode\t\t\t\t\t\t= require(\"awayjs-core/lib/core/base/BlendMode\");\nimport DisplayObject\t\t\t\t\t= require(\"awayjs-core/lib/core/base/DisplayObject\");\nimport Geometry\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/base/Geometry\");\nimport LightBase\t\t\t\t\t\t= require(\"awayjs-core/lib/core/base/LightBase\");\nimport TriangleSubGeometry\t\t\t\t= require(\"awayjs-core/lib/core/base/TriangleSubGeometry\");\nimport ColorTransform\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/ColorTransform\");\nimport Matrix3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Matrix3D\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport URLLoaderDataFormat\t\t\t\t= require(\"awayjs-core/lib/core/net/URLLoaderDataFormat\");\nimport URLRequest\t\t\t\t\t\t= require(\"awayjs-core/lib/core/net/URLRequest\");\nimport AssetType\t\t\t\t\t\t= require(\"awayjs-core/lib/core/library/AssetType\");\nimport IAsset\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/library/IAsset\");\nimport DirectionalLight\t\t\t\t\t= require(\"awayjs-core/lib/entities/DirectionalLight\");\nimport PointLight\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/PointLight\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\nimport Mesh\t\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Mesh\");\nimport Skybox\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Skybox\");\nimport MaterialBase\t\t\t\t\t\t= require(\"awayjs-core/lib/materials/MaterialBase\");\nimport LightPickerBase\t\t\t\t\t= require(\"awayjs-core/lib/materials/lightpickers/LightPickerBase\");\nimport StaticLightPicker\t\t\t\t= require(\"awayjs-core/lib/materials/lightpickers/StaticLightPicker\");\nimport CubeMapShadowMapper\t\t\t\t= require(\"awayjs-core/lib/materials/shadowmappers/CubeMapShadowMapper\");\nimport DirectionalShadowMapper\t\t\t= require(\"awayjs-core/lib/materials/shadowmappers/DirectionalShadowMapper\");\nimport ShadowMapperBase\t\t\t\t\t= require(\"awayjs-core/lib/materials/shadowmappers/ShadowMapperBase\");\nimport PrefabBase\t\t\t\t\t\t= require(\"awayjs-core/lib/prefabs/PrefabBase\");\nimport PrimitiveCapsulePrefab\t\t\t= require(\"awayjs-core/lib/prefabs/PrimitiveCapsulePrefab\");\nimport PrimitiveConePrefab\t\t\t\t= require(\"awayjs-core/lib/prefabs/PrimitiveConePrefab\");\nimport PrimitiveCubePrefab\t\t\t\t= require(\"awayjs-core/lib/prefabs/PrimitiveCubePrefab\");\nimport PrimitiveCylinderPrefab\t\t\t= require(\"awayjs-core/lib/prefabs/PrimitiveCylinderPrefab\");\nimport PrimitivePlanePrefab\t\t\t\t= require(\"awayjs-core/lib/prefabs/PrimitivePlanePrefab\");\nimport PrimitiveSpherePrefab\t\t\t= require(\"awayjs-core/lib/prefabs/PrimitiveSpherePrefab\");\nimport PrimitiveTorusPrefab\t\t\t\t= require(\"awayjs-core/lib/prefabs/PrimitiveTorusPrefab\");\nimport ParserBase\t\t\t\t\t\t= require(\"awayjs-core/lib/parsers/ParserBase\");\nimport ParserUtils\t\t\t\t\t\t= require(\"awayjs-core/lib/parsers/ParserUtils\");\nimport ResourceDependency\t\t\t\t= require(\"awayjs-core/lib/parsers/ResourceDependency\");\nimport ProjectionBase\t\t\t\t\t= require(\"awayjs-core/lib/projections/ProjectionBase\");\nimport PerspectiveProjection\t\t\t= require(\"awayjs-core/lib/projections/PerspectiveProjection\");\nimport OrthographicProjection\t\t\t= require(\"awayjs-core/lib/projections/OrthographicProjection\");\nimport OrthographicOffCenterProjection\t= require(\"awayjs-core/lib/projections/OrthographicOffCenterProjection\");\nimport BitmapCubeTexture\t\t\t\t= require(\"awayjs-core/lib/textures/BitmapCubeTexture\");\nimport BitmapTexture\t\t\t\t\t= require(\"awayjs-core/lib/textures/BitmapTexture\");\nimport CubeTextureBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/CubeTextureBase\");\nimport ImageCubeTexture\t\t\t\t\t= require(\"awayjs-core/lib/textures/ImageCubeTexture\");\nimport ImageTexture\t\t\t\t\t\t= require(\"awayjs-core/lib/textures/ImageTexture\");\nimport Texture2DBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/Texture2DBase\");\nimport TextureProxyBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/TextureProxyBase\");\nimport ByteArray\t\t\t\t\t\t= require(\"awayjs-core/lib/utils/ByteArray\");\n\nimport AnimationSetBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimationSetBase\");\nimport AnimatorBase\t\t\t\t\t\t= require(\"awayjs-stagegl/lib/animators/AnimatorBase\");\nimport SkyboxMaterial\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/SkyboxMaterial\");\nimport TriangleMaterialMode\t\t\t\t= require(\"awayjs-stagegl/lib/materials/TriangleMaterialMode\");\nimport TriangleMethodMaterial\t\t\t= require(\"awayjs-stagegl/lib/materials/TriangleMethodMaterial\");\nimport DefaultMaterialManager\t\t\t= require(\"awayjs-stagegl/lib/materials/utils/DefaultMaterialManager\");\n\nimport VertexAnimationSet\t\t\t\t= require(\"awayjs-renderergl/lib/animators/VertexAnimationSet\");\nimport VertexAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/VertexAnimator\");\nimport SkeletonAnimationSet\t\t\t\t= require(\"awayjs-renderergl/lib/animators/SkeletonAnimationSet\");\nimport SkeletonAnimator\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/SkeletonAnimator\");\nimport JointPose\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/JointPose\");\nimport Skeleton\t\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/Skeleton\");\nimport SkeletonPose\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/SkeletonPose\");\nimport SkeletonJoint\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/SkeletonJoint\");\nimport SkeletonClipNode\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/SkeletonClipNode\");\nimport VertexClipNode\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/VertexClipNode\");\nimport AmbientEnvMapMethod\t\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/AmbientEnvMapMethod\");\nimport DiffuseDepthMethod\t\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/DiffuseDepthMethod\");\nimport DiffuseCelMethod\t\t\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/DiffuseCelMethod\");\nimport DiffuseGradientMethod\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/DiffuseGradientMethod\");\nimport DiffuseLightMapMethod\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/DiffuseLightMapMethod\");\nimport DiffuseWrapMethod\t\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/DiffuseWrapMethod\");\nimport EffectAlphaMaskMethod\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/EffectAlphaMaskMethod\");\nimport EffectColorMatrixMethod\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/EffectColorMatrixMethod\");\nimport EffectColorTransformMethod\t\t= require(\"awayjs-stagegl/lib/materials/methods/EffectColorTransformMethod\");\nimport EffectEnvMapMethod\t\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/EffectEnvMapMethod\");\nimport EffectFogMethod\t\t\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/EffectFogMethod\");\nimport EffectFresnelEnvMapMethod\t\t= require(\"awayjs-renderergl/lib/materials/methods/EffectFresnelEnvMapMethod\");\nimport EffectLightMapMethod\t\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/EffectLightMapMethod\");\nimport EffectMethodBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/EffectMethodBase\");\nimport EffectRimLightMethod\t\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/EffectRimLightMethod\");\nimport NormalSimpleWaterMethod\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/NormalSimpleWaterMethod\");\nimport ShadowDitheredMethod\t\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/ShadowDitheredMethod\");\nimport ShadowFilteredMethod\t\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/ShadowFilteredMethod\");\nimport ShadowMethodBase\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/ShadowMethodBase\");\nimport SpecularFresnelMethod\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/SpecularFresnelMethod\");\nimport ShadowHardMethod\t\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/ShadowHardMethod\");\nimport SpecularAnisotropicMethod\t\t= require(\"awayjs-renderergl/lib/materials/methods/SpecularAnisotropicMethod\");\nimport SpecularCelMethod\t\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/SpecularCelMethod\");\nimport SpecularPhongMethod\t\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/SpecularPhongMethod\");\nimport ShadowNearMethod\t\t\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/ShadowNearMethod\");\nimport ShadowSoftMethod\t\t\t\t\t= require(\"awayjs-renderergl/lib/materials/methods/ShadowSoftMethod\");\n\nimport AWDBlock\t\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/parsers/data/AWDBlock\");\nimport AWDProperties\t\t\t\t\t= require(\"awayjs-renderergl/lib/parsers/data/AWDProperties\");\nimport BitFlags\t\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/parsers/data/BitFlags\");\n\n/**\n * AWDParser provides a parser for the AWD data type.\n */\nclass AWDParser extends ParserBase\n{\n\t//set to \"true\" to have some console.logs in the Console\n\tprivate _debug:boolean = false;\n\tprivate _byteData:ByteArray;\n\tprivate _startedParsing:boolean = false;\n\tprivate _cur_block_id:number;\n\tprivate _blocks:Array;\n\tprivate _newBlockBytes:ByteArray;\n\tprivate _version:Array;\n\tprivate _compression:number;\n\tprivate _accuracyOnBlocks:boolean;\n\tprivate _accuracyMatrix:boolean;\n\tprivate _accuracyGeo:boolean;\n\tprivate _accuracyProps:boolean;\n\tprivate _matrixNrType:number;\n\tprivate _geoNrType:number;\n\tprivate _propsNrType:number;\n\tprivate _streaming:boolean;\n\tprivate _texture_users:Object = {};\n\tprivate _parsed_header:boolean = false;\n\tprivate _body:ByteArray;\n\tprivate _defaultTexture:BitmapTexture; // HTML IMAGE TEXTURE >? !\n\tprivate _cubeTextures:Array;\n\tprivate _defaultBitmapMaterial:TriangleMethodMaterial;\n\tprivate _defaultCubeTexture:BitmapCubeTexture;\n\n\tpublic static COMPRESSIONMODE_LZMA:string = \"lzma\";\n\tpublic static UNCOMPRESSED:number = 0;\n\tpublic static DEFLATE:number = 1;\n\tpublic static LZMA:number = 2;\n\tpublic static INT8:number = 1;\n\tpublic static INT16:number = 2;\n\tpublic static INT32:number = 3;\n\tpublic static UINT8:number = 4;\n\tpublic static UINT16:number = 5;\n\tpublic static UINT32:number = 6;\n\tpublic static FLOAT32:number = 7;\n\tpublic static FLOAT64:number = 8;\n\tpublic static BOOL:number = 21;\n\tpublic static COLOR:number = 22;\n\tpublic static BADDR:number = 23;\n\tpublic static AWDSTRING:number = 31;\n\tpublic static AWDBYTEARRAY:number = 32;\n\tpublic static VECTOR2x1:number = 41;\n\tpublic static VECTOR3x1:number = 42;\n\tpublic static VECTOR4x1:number = 43;\n\tpublic static MTX3x2:number = 44;\n\tpublic static MTX3x3:number = 45;\n\tpublic static MTX4x3:number = 46;\n\tpublic static MTX4x4:number = 47;\n\n\tprivate blendModeDic:Array;\n\tprivate _depthSizeDic:Array;\n\n\t/**\n\t * Creates a new AWDParser object.\n\t * @param uri The url or id of the data or file to be parsed.\n\t * @param extra The holder for extra contextual data that the parser might need.\n\t */\n\tconstructor()\n\t{\n\t\tsuper(URLLoaderDataFormat.ARRAY_BUFFER);\n\n\t\tthis._blocks = new Array();\n\t\tthis._blocks[0] = new AWDBlock();\n\t\tthis._blocks[0].data = null; // Zero address means null in AWD\n\n\t\tthis.blendModeDic = new Array(); // used to translate ints to blendMode-strings\n\t\tthis.blendModeDic.push(BlendMode.NORMAL);\n\t\tthis.blendModeDic.push(BlendMode.ADD);\n\t\tthis.blendModeDic.push(BlendMode.ALPHA);\n\t\tthis.blendModeDic.push(BlendMode.DARKEN);\n\t\tthis.blendModeDic.push(BlendMode.DIFFERENCE);\n\t\tthis.blendModeDic.push(BlendMode.ERASE);\n\t\tthis.blendModeDic.push(BlendMode.HARDLIGHT);\n\t\tthis.blendModeDic.push(BlendMode.INVERT);\n\t\tthis.blendModeDic.push(BlendMode.LAYER);\n\t\tthis.blendModeDic.push(BlendMode.LIGHTEN);\n\t\tthis.blendModeDic.push(BlendMode.MULTIPLY);\n\t\tthis.blendModeDic.push(BlendMode.NORMAL);\n\t\tthis.blendModeDic.push(BlendMode.OVERLAY);\n\t\tthis.blendModeDic.push(BlendMode.SCREEN);\n\t\tthis.blendModeDic.push(BlendMode.SHADER);\n\t\tthis.blendModeDic.push(BlendMode.OVERLAY);\n\n\t\tthis._depthSizeDic = new Array(); // used to translate ints to depthSize-values\n\t\tthis._depthSizeDic.push(256);\n\t\tthis._depthSizeDic.push(512);\n\t\tthis._depthSizeDic.push(2048);\n\t\tthis._depthSizeDic.push(1024);\n\t\tthis._version = Array(); // will contain 2 int (major-version, minor-version) for awd-version-check\n\t}\n\n\t/**\n\t * Indicates whether or not a given file extension is supported by the parser.\n\t * @param extension The file extension of a potential file to be parsed.\n\t * @return Whether or not the given file type is supported.\n\t */\n\tpublic static supportsType(extension:string):boolean\n\t{\n\t\textension = extension.toLowerCase();\n\t\treturn extension == \"awd\";\n\t}\n\n\t/**\n\t * Tests whether a data block can be parsed by the parser.\n\t * @param data The data block to potentially be parsed.\n\t * @return Whether or not the given data is supported.\n\t */\n\tpublic static supportsData(data:any):boolean\n\t{\n\t\treturn (ParserUtils.toString(data, 3) == 'AWD');\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iResolveDependency(resourceDependency:ResourceDependency):void\n\t{\n\t\t// this will be called when Dependency has finished loading.\n\t\t// the Assets waiting for this Bitmap, can be Texture or CubeTexture.\n\t\t// if the Bitmap is awaited by a CubeTexture, we need to check if its the last Bitmap of the CubeTexture,\n\t\t// so we know if we have to finalize the Asset (CubeTexture) or not.\n\t\tif (resourceDependency.assets.length == 1) {\n\t\t\tvar isCubeTextureArray:Array = resourceDependency.id.split(\"#\");\n\t\t\tvar ressourceID:string = isCubeTextureArray[0];\n\t\t\tvar asset:TextureProxyBase;\n\t\t\tvar thisBitmapTexture:Texture2DBase;\n\t\t\tvar block:AWDBlock;\n\n\t\t\tif (isCubeTextureArray.length == 1) // Not a cube texture\n\t\t\t{\n\t\t\t\tasset = resourceDependency.assets[0];\n\t\t\t\tif (asset) {\n\t\t\t\t\tvar mat:TriangleMethodMaterial;\n\t\t\t\t\tvar users:Array;\n\n\t\t\t\t\tblock = this._blocks[ resourceDependency.id ];\n\t\t\t\t\tblock.data = asset; // Store finished asset\n\n\t\t\t\t\t// Reset name of texture to the one defined in the AWD file,\n\t\t\t\t\t// as opposed to whatever the image parser came up with.\n\t\t\t\t\tasset.resetAssetPath(block.name, null, true);\n\t\t\t\t\tblock.name = asset.name;\n\t\t\t\t\t// Finalize texture asset to dispatch texture event, which was\n\t\t\t\t\t// previously suppressed while the dependency was loaded.\n\t\t\t\t\tthis._pFinalizeAsset( asset);\n\n\t\t\t\t\tif (this._debug) {\n\t\t\t\t\t\tconsole.log(\"Successfully loaded Bitmap for texture\");\n\t\t\t\t\t\tconsole.log(\"Parsed texture: Name = \" + block.name);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isCubeTextureArray.length > 1) // Cube Texture\n\t\t\t{\n\t\t\t\tthisBitmapTexture = resourceDependency.assets[0];\n\n\t\t\t\tvar tx:ImageTexture = thisBitmapTexture;\n\n\t\t\t\tthis._cubeTextures[ isCubeTextureArray[1] ] = tx.htmlImageElement; // ?\n\t\t\t\tthis._texture_users[ressourceID].push(1);\n\n\t\t\t\tif (this._debug) {\n\t\t\t\t\tconsole.log(\"Successfully loaded Bitmap \" + this._texture_users[ressourceID].length + \" / 6 for Cubetexture\");\n\t\t\t\t}\n\t\t\t\tif (this._texture_users[ressourceID].length == this._cubeTextures.length) {\n\n\t\t\t\t\tvar posX:any = this._cubeTextures[0];\n\t\t\t\t\tvar negX:any = this._cubeTextures[1];\n\t\t\t\t\tvar posY:any = this._cubeTextures[2];\n\t\t\t\t\tvar negY:any = this._cubeTextures[3];\n\t\t\t\t\tvar posZ:any = this._cubeTextures[4];\n\t\t\t\t\tvar negZ:any = this._cubeTextures[5];\n\n\t\t\t\t\tasset = new ImageCubeTexture(posX, negX, posY, negY, posZ, negZ);\n\t\t\t\t\tblock = this._blocks[ressourceID];\n\t\t\t\t\tblock.data = asset; // Store finished asset\n\n\t\t\t\t\t// Reset name of texture to the one defined in the AWD file,\n\t\t\t\t\t// as opposed to whatever the image parser came up with.\n\t\t\t\t\tasset.resetAssetPath(block.name, null, true);\n\t\t\t\t\tblock.name = asset.name;\n\t\t\t\t\t// Finalize texture asset to dispatch texture event, which was\n\t\t\t\t\t// previously suppressed while the dependency was loaded.\n\t\t\t\t\tthis._pFinalizeAsset( asset);\n\t\t\t\t\tif (this._debug) {\n\t\t\t\t\t\tconsole.log(\"Parsed CubeTexture: Name = \" + block.name);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iResolveDependencyFailure(resourceDependency:ResourceDependency):void\n\t{\n\t\t//not used - if a dependcy fails, the awaiting Texture or CubeTexture will never be finalized, and the default-bitmaps will be used.\n\t\t// this means, that if one Bitmap of a CubeTexture fails, the CubeTexture will have the DefaultTexture applied for all six Bitmaps.\n\t}\n\n\t/**\n\t * Resolve a dependency name\n\t *\n\t * @param resourceDependency The dependency to be resolved.\n\t */\n\tpublic _iResolveDependencyName(resourceDependency:ResourceDependency, asset:IAsset):string\n\t{\n\t\tvar oldName:string = asset.name;\n\n\t\tif (asset) {\n\t\t\tvar block:AWDBlock = this._blocks[parseInt(resourceDependency.id)];\n\t\t\t// Reset name of texture to the one defined in the AWD file,\n\t\t\t// as opposed to whatever the image parser came up with.\n\t\t\tasset.resetAssetPath(block.name, null, true);\n\t\t}\n\n\t\tvar newName:string = asset.name;\n\n\t\tasset.name = oldName;\n\n\t\treturn newName;\n\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pProceedParsing():boolean\n\t{\n\n\t\tif (!this._startedParsing) {\n\t\t\tthis._byteData = this._pGetByteData();//getByteData();\n\t\t\tthis._startedParsing = true;\n\t\t}\n\n\t\tif (!this._parsed_header) {\n\n\t\t\t//----------------------------------------------------------------------------\n\t\t\t// LITTLE_ENDIAN - Default for ArrayBuffer / Not implemented in ByteArray\n\t\t\t//----------------------------------------------------------------------------\n\t\t\t//this._byteData.endian = Endian.LITTLE_ENDIAN;\n\t\t\t//----------------------------------------------------------------------------\n\n\t\t\t//----------------------------------------------------------------------------\n\t\t\t// Parse header and decompress body if needed\n\t\t\tthis.parseHeader();\n\n\t\t\tswitch (this._compression) {\n\n\t\t\t\tcase AWDParser.DEFLATE:\n\t\t\t\tcase AWDParser.LZMA:\n\t\t\t\t\tthis._pDieWithError('Compressed AWD formats not yet supported');\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase AWDParser.UNCOMPRESSED:\n\t\t\t\t\tthis._body = this._byteData;\n\t\t\t\t\tbreak;\n\n\t\t\t\t//----------------------------------------------------------------------------\n\t\t\t\t// Compressed AWD Formats not yet supported\n\t\t\t\t//----------------------------------------------------------------------------\n\n\t\t\t\t/*\n\t\t\t\t case AWDParser.DEFLATE:\n\n\t\t\t\t this._body = new ByteArray();\n\t\t\t\t this._byteData.readBytes(this._body, 0, this._byteData.getBytesAvailable());\n\t\t\t\t this._body.uncompress();\n\n\t\t\t\t break;\n\t\t\t\t case AWDParser.LZMA:\n\n\t\t\t\t this._body = new ByteArray();\n\t\t\t\t this._byteData.readBytes(this._body, 0, this._byteData.getBytesAvailable());\n\t\t\t\t this._body.uncompress(COMPRESSIONMODE_LZMA);\n\n\t\t\t\t break;\n\t\t\t\t //*/\n\n\t\t\t}\n\n\t\t\tthis._parsed_header = true;\n\n\t\t\t//----------------------------------------------------------------------------\n\t\t\t// LITTLE_ENDIAN - Default for ArrayBuffer / Not implemented in ByteArray\n\t\t\t//----------------------------------------------------------------------------\n\t\t\t//this._body.endian = Endian.LITTLE_ENDIAN;// Should be default\n\t\t\t//----------------------------------------------------------------------------\n\n\t\t}\n\n\t\tif (this._body) {\n\n\t\t\twhile (this._body.getBytesAvailable() > 0 && !this.parsingPaused) //&& this._pHasTime() )\n\t\t\t{\n\t\t\t\tthis.parseNextBlock();\n\n\t\t\t}\n\n\t\t\t//----------------------------------------------------------------------------\n\t\t\t// Return complete status\n\t\t\tif (this._body.getBytesAvailable() == 0) {\n\t\t\t\tthis.dispose();\n\t\t\t\treturn ParserBase.PARSING_DONE;\n\t\t\t} else {\n\t\t\t\treturn ParserBase.MORE_TO_PARSE;\n\t\t\t}\n\t\t} else {\n\n\t\t\tswitch (this._compression) {\n\n\t\t\t\tcase AWDParser.DEFLATE:\n\t\t\t\tcase AWDParser.LZMA:\n\n\t\t\t\t\tif (this._debug) {\n\t\t\t\t\t\tconsole.log(\"(!) AWDParser Error: Compressed AWD formats not yet supported (!)\");\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\t\t\t// Error - most likely _body not set because we do not support compression.\n\t\t\treturn ParserBase.PARSING_DONE;\n\n\t\t}\n\n\t}\n\n\tpublic _pStartParsing(frameLimit:number)\n\t{\n\t\tsuper._pStartParsing(frameLimit);\n\n\t\t//create a content object for Loaders\n\t\tthis._pContent = new DisplayObjectContainer();\n\t}\n\n\tprivate dispose():void\n\t{\n\n\t\tfor (var c in this._blocks) {\n\n\t\t\tvar b:AWDBlock = this._blocks[ c ];\n\t\t\tb.dispose();\n\n\t\t}\n\n\t}\n\n\tprivate parseNextBlock():void\n\t{\n\t\tvar block:AWDBlock;\n\t\tvar assetData:IAsset;\n\t\tvar isParsed:boolean = false;\n\t\tvar ns:number;\n\t\tvar type:number;\n\t\tvar flags:number;\n\t\tvar len:number;\n\n\t\tthis._cur_block_id = this._body.readUnsignedInt();\n\n\t\tns = this._body.readUnsignedByte();\n\t\ttype = this._body.readUnsignedByte();\n\t\tflags = this._body.readUnsignedByte();\n\t\tlen = this._body.readUnsignedInt();\n\n\t\tvar blockCompression:boolean = BitFlags.test(flags, BitFlags.FLAG4);\n\t\tvar blockCompressionLZMA:boolean = BitFlags.test(flags, BitFlags.FLAG5);\n\n\t\tif (this._accuracyOnBlocks) {\n\t\t\tthis._accuracyMatrix = BitFlags.test(flags, BitFlags.FLAG1);\n\t\t\tthis._accuracyGeo = BitFlags.test(flags, BitFlags.FLAG2);\n\t\t\tthis._accuracyProps = BitFlags.test(flags, BitFlags.FLAG3);\n\t\t\tthis._geoNrType = AWDParser.FLOAT32;\n\n\t\t\tif (this._accuracyGeo) {\n\t\t\t\tthis._geoNrType = AWDParser.FLOAT64;\n\t\t\t}\n\n\t\t\tthis._matrixNrType = AWDParser.FLOAT32;\n\n\t\t\tif (this._accuracyMatrix) {\n\t\t\t\tthis._matrixNrType = AWDParser.FLOAT64;\n\t\t\t}\n\n\t\t\tthis._propsNrType = AWDParser.FLOAT32;\n\n\t\t\tif (this._accuracyProps) {\n\t\t\t\tthis._propsNrType = AWDParser.FLOAT64;\n\t\t\t}\n\t\t}\n\n\t\tvar blockEndAll:number = this._body.position + len;\n\n\t\tif (len > this._body.getBytesAvailable()) {\n\t\t\tthis._pDieWithError('AWD2 block length is bigger than the bytes that are available!');\n\t\t\tthis._body.position += this._body.getBytesAvailable();\n\t\t\treturn;\n\t\t}\n\t\tthis._newBlockBytes = new ByteArray();\n\n\n\t\tthis._body.readBytes(this._newBlockBytes, 0, len);\n\n\t\t//----------------------------------------------------------------------------\n\t\t// Compressed AWD Formats not yet supported\n\n\t\tif (blockCompression) {\n\t\t\tthis._pDieWithError('Compressed AWD formats not yet supported');\n\n\t\t\t/*\n\t\t\t if (blockCompressionLZMA)\n\t\t\t {\n\t\t\t this._newBlockBytes.uncompress(AWDParser.COMPRESSIONMODE_LZMA);\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t this._newBlockBytes.uncompress();\n\t\t\t }\n\t\t\t */\n\n\t\t}\n\n\t\t//----------------------------------------------------------------------------\n\t\t// LITTLE_ENDIAN - Default for ArrayBuffer / Not implemented in ByteArray\n\t\t//----------------------------------------------------------------------------\n\t\t//this._newBlockBytes.endian = Endian.LITTLE_ENDIAN;\n\t\t//----------------------------------------------------------------------------\n\n\t\tthis._newBlockBytes.position = 0;\n\t\tblock = new AWDBlock();\n\t\tblock.len = this._newBlockBytes.position + len;\n\t\tblock.id = this._cur_block_id;\n\n\t\tvar blockEndBlock:number = this._newBlockBytes.position + len;\n\n\t\tif (blockCompression) {\n\t\t\tthis._pDieWithError('Compressed AWD formats not yet supported');\n\t\t\t//blockEndBlock = this._newBlockBytes.position + this._newBlockBytes.length;\n\t\t\t//block.len = blockEndBlock;\n\t\t}\n\n\t\tif (this._debug) {\n\t\t\tconsole.log(\"AWDBlock: ID = \" + this._cur_block_id + \" | TypeID = \" + type + \" | Compression = \" + blockCompression + \" | Matrix-Precision = \" + this._accuracyMatrix + \" | Geometry-Precision = \" + this._accuracyGeo + \" | Properties-Precision = \" + this._accuracyProps);\n\t\t}\n\n\t\tthis._blocks[this._cur_block_id] = block;\n\n\t\tif ((this._version[0] == 2) && (this._version[1] == 1)) {\n\n\t\t\tswitch (type) {\n\t\t\t\tcase 11:\n\t\t\t\t\tthis.parsePrimitves(this._cur_block_id);\n\t\t\t\t\tisParsed = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 31:\n\t\t\t\t\tthis.parseSkyboxInstance(this._cur_block_id);\n\t\t\t\t\tisParsed = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 41:\n\t\t\t\t\tthis.parseLight(this._cur_block_id);\n\t\t\t\t\tisParsed = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 42:\n\t\t\t\t\tthis.parseCamera(this._cur_block_id);\n\t\t\t\t\tisParsed = true;\n\t\t\t\t\tbreak;\n\n\t\t\t\t// case 43:\n\t\t\t\t// parseTextureProjector(_cur_block_id);\n\t\t\t\t// isParsed = true;\n\t\t\t\t// break;\n\n\t\t\t\tcase 51:\n\t\t\t\t\tthis.parseLightPicker(this._cur_block_id);\n\t\t\t\t\tisParsed = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 81:\n\t\t\t\t\tthis.parseMaterial_v1(this._cur_block_id);\n\t\t\t\t\tisParsed = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 83:\n\t\t\t\t\tthis.parseCubeTexture(this._cur_block_id);\n\t\t\t\t\tisParsed = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 91:\n\t\t\t\t\tthis.parseSharedMethodBlock(this._cur_block_id);\n\t\t\t\t\tisParsed = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 92:\n\t\t\t\t\tthis.parseShadowMethodBlock(this._cur_block_id);\n\t\t\t\t\tisParsed = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 111:\n\t\t\t\t\tthis.parseMeshPoseAnimation(this._cur_block_id, true);\n\t\t\t\t\tisParsed = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 112:\n\t\t\t\t\tthis.parseMeshPoseAnimation(this._cur_block_id);\n\t\t\t\t\tisParsed = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 113:\n\t\t\t\t\tthis.parseVertexAnimationSet(this._cur_block_id);\n\t\t\t\t\tisParsed = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 122:\n\t\t\t\t\tthis.parseAnimatorSet(this._cur_block_id);\n\t\t\t\t\tisParsed = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 253:\n\t\t\t\t\tthis.parseCommand(this._cur_block_id);\n\t\t\t\t\tisParsed = true;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t//*/\n\t\t}\n\t\t//*\n\t\tif (isParsed == false) {\n\t\t\tswitch (type) {\n\n\t\t\t\tcase 1:\n\t\t\t\t\tthis.parseTriangleGeometrieBlock(this._cur_block_id);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 22:\n\t\t\t\t\tthis.parseContainer(this._cur_block_id);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 23:\n\t\t\t\t\tthis.parseMeshInstance(this._cur_block_id);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 81:\n\t\t\t\t\tthis.parseMaterial(this._cur_block_id);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 82:\n\t\t\t\t\tthis.parseTexture(this._cur_block_id);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 101:\n\t\t\t\t\tthis.parseSkeleton(this._cur_block_id);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 102:\n\t\t\t\t\tthis.parseSkeletonPose(this._cur_block_id);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 103:\n\t\t\t\t\tthis.parseSkeletonAnimation(this._cur_block_id);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 121:\n\t\t\t\t\t//this.parseUVAnimation(this._cur_block_id);\n\t\t\t\t\t//break;\n\t\t\t\tcase 254:\n\t\t\t\t\tthis.parseNameSpace(this._cur_block_id);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 255:\n\t\t\t\t\tthis.parseMetaData(this._cur_block_id);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif (this._debug) {\n\t\t\t\t\t\tconsole.log(\"AWDBlock: Unknown BlockType (BlockID = \" + this._cur_block_id + \") - Skip \" + len + \" bytes\");\n\t\t\t\t\t}\n\t\t\t\t\tthis._newBlockBytes.position += len;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//*/\n\n\t\tvar msgCnt:number = 0;\n\t\tif (this._newBlockBytes.position == blockEndBlock) {\n\t\t\tif (this._debug) {\n\t\t\t\tif (block.errorMessages) {\n\t\t\t\t\twhile (msgCnt < block.errorMessages.length) {\n\t\t\t\t\t\tconsole.log(\" (!) Error: \" + block.errorMessages[msgCnt] + \" (!)\");\n\t\t\t\t\t\tmsgCnt++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this._debug) {\n\t\t\t\tconsole.log(\"\\n\");\n\t\t\t}\n\t\t} else {\n\t\t\tif (this._debug) {\n\n\t\t\t\tconsole.log(\" (!)(!)(!) Error while reading AWDBlock ID \" + this._cur_block_id + \" = skip to next block\");\n\n\t\t\t\tif (block.errorMessages) {\n\t\t\t\t\twhile (msgCnt < block.errorMessages.length) {\n\t\t\t\t\t\tconsole.log(\" (!) Error: \" + block.errorMessages[msgCnt] + \" (!)\");\n\t\t\t\t\t\tmsgCnt++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis._body.position = blockEndAll;\n\t\tthis._newBlockBytes = null;\n\n\t}\n\n\n\t//--Parser Blocks---------------------------------------------------------------------------\n\n\t//Block ID = 1\n\tprivate parseTriangleGeometrieBlock(blockID:number):void\n\t{\n\n\t\tvar geom:Geometry = new Geometry();\n\n\t\t// Read name and sub count\n\t\tvar name:string = this.parseVarStr();\n\t\tvar num_subs:number = this._newBlockBytes.readUnsignedShort();\n\n\t\t// Read optional properties\n\t\tvar props:AWDProperties = this.parseProperties({1:this._geoNrType, 2:this._geoNrType});\n\t\tvar geoScaleU:number = props.get(1, 1);\n\t\tvar geoScaleV:number = props.get(2, 1);\n\n\t\t// Loop through sub meshes\n\t\tvar subs_parsed:number = 0;\n\t\twhile (subs_parsed < num_subs) {\n\t\t\tvar i:number;\n\t\t\tvar sm_len:number, sm_end:number;\n\t\t\tvar sub_geom:TriangleSubGeometry;\n\t\t\tvar w_indices:Array;\n\t\t\tvar weights:Array;\n\n\t\t\tsm_len = this._newBlockBytes.readUnsignedInt();\n\t\t\tsm_end = this._newBlockBytes.position + sm_len;\n\n\t\t\t// Ignore for now\n\t\t\tvar subProps:AWDProperties = this.parseProperties({1:this._geoNrType, 2:this._geoNrType});\n\t\t\t// Loop through data streams\n\t\t\twhile (this._newBlockBytes.position < sm_end) {\n\t\t\t\tvar idx:number = 0;\n\t\t\t\tvar str_ftype:number, str_type:number, str_len:number, str_end:number;\n\n\t\t\t\t// Type, field type, length\n\t\t\t\tstr_type = this._newBlockBytes.readUnsignedByte();\n\t\t\t\tstr_ftype = this._newBlockBytes.readUnsignedByte();\n\t\t\t\tstr_len = this._newBlockBytes.readUnsignedInt();\n\t\t\t\tstr_end = this._newBlockBytes.position + str_len;\n\n\t\t\t\tvar x:number, y:number, z:number;\n\n\t\t\t\tif (str_type == 1) {\n\t\t\t\t\tvar verts:Array = new Array();\n\n\t\t\t\t\twhile (this._newBlockBytes.position < str_end) {\n\t\t\t\t\t\t// TODO: Respect stream field type\n\t\t\t\t\t\tx = this.readNumber(this._accuracyGeo);\n\t\t\t\t\t\ty = this.readNumber(this._accuracyGeo);\n\t\t\t\t\t\tz = this.readNumber(this._accuracyGeo);\n\n\t\t\t\t\t\tverts[idx++] = x;\n\t\t\t\t\t\tverts[idx++] = y;\n\t\t\t\t\t\tverts[idx++] = z;\n\t\t\t\t\t}\n\t\t\t\t} else if (str_type == 2) {\n\t\t\t\t\tvar indices:Array = new Array();\n\n\t\t\t\t\twhile (this._newBlockBytes.position < str_end) {\n\t\t\t\t\t\t// TODO: Respect stream field type\n\t\t\t\t\t\tindices[idx++] = this._newBlockBytes.readUnsignedShort();\n\t\t\t\t\t}\n\n\t\t\t\t} else if (str_type == 3) {\n\t\t\t\t\tvar uvs:Array = new Array();\n\t\t\t\t\twhile (this._newBlockBytes.position < str_end) {\n\t\t\t\t\t\tuvs[idx++] = this.readNumber(this._accuracyGeo);\n\n\t\t\t\t\t}\n\t\t\t\t} else if (str_type == 4) {\n\n\t\t\t\t\tvar normals:Array = new Array();\n\n\t\t\t\t\twhile (this._newBlockBytes.position < str_end) {\n\t\t\t\t\t\tnormals[idx++] = this.readNumber(this._accuracyGeo);\n\t\t\t\t\t}\n\n\t\t\t\t} else if (str_type == 6) {\n\t\t\t\t\tw_indices = Array();\n\n\t\t\t\t\twhile (this._newBlockBytes.position < str_end) {\n\t\t\t\t\t\tw_indices[idx++] = this._newBlockBytes.readUnsignedShort()*3; // TODO: Respect stream field type\n\t\t\t\t\t}\n\n\t\t\t\t} else if (str_type == 7) {\n\n\t\t\t\t\tweights = new Array();\n\n\t\t\t\t\twhile (this._newBlockBytes.position < str_end) {\n\t\t\t\t\t\tweights[idx++] = this.readNumber(this._accuracyGeo);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis._newBlockBytes.position = str_end;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.parseUserAttributes(); // Ignore sub-mesh attributes for now\n\n\t\t\tsub_geom = new TriangleSubGeometry(true);\n\t\t\tif (weights)\n\t\t\t\tsub_geom.jointsPerVertex = weights.length/(verts.length/3);\n\t\t\tif (normals)\n\t\t\t\tsub_geom.autoDeriveNormals = false;\n\t\t\tif (uvs)\n\t\t\t\tsub_geom.autoDeriveUVs = false;\n\t\t\tsub_geom.updateIndices(indices);\n\t\t\tsub_geom.updatePositions(verts);\n\t\t\tsub_geom.updateVertexNormals(normals);\n\t\t\tsub_geom.updateUVs(uvs);\n\t\t\tsub_geom.updateVertexTangents(null);\n\t\t\tsub_geom.updateJointWeights(weights);\n\t\t\tsub_geom.updateJointIndices(w_indices);\n\n\t\t\tvar scaleU:number = subProps.get(1, 1);\n\t\t\tvar scaleV:number = subProps.get(2, 1);\n\t\t\tvar setSubUVs:boolean = false; //this should remain false atm, because in AwayBuilder the uv is only scaled by the geometry\n\n\t\t\tif ((geoScaleU != scaleU) || (geoScaleV != scaleV)) {\n\t\t\t\tsetSubUVs = true;\n\t\t\t\tscaleU = geoScaleU/scaleU;\n\t\t\t\tscaleV = geoScaleV/scaleV;\n\t\t\t}\n\n\t\t\tif (setSubUVs)\n\t\t\t\tsub_geom.scaleUV(scaleU, scaleV);\n\n\t\t\tgeom.addSubGeometry(sub_geom);\n\n\t\t\t// TODO: Somehow map in-sub to out-sub indices to enable look-up\n\t\t\t// when creating meshes (and their material assignments.)\n\n\t\t\tsubs_parsed++;\n\t\t}\n\t\tif ((geoScaleU != 1) || (geoScaleV != 1))\n\t\t\tgeom.scaleUV(geoScaleU, geoScaleV);\n\t\tthis.parseUserAttributes();\n\t\tthis._pFinalizeAsset( geom, name);\n\t\tthis._blocks[blockID].data = geom;\n\n\t\tif (this._debug) {\n\t\t\tconsole.log(\"Parsed a TriangleGeometry: Name = \" + name + \"| Id = \" + sub_geom.id);\n\t\t}\n\n\t}\n\n\t//Block ID = 11\n\tprivate parsePrimitves(blockID:number):void\n\t{\n\t\tvar name:string;\n\t\tvar prefab:PrefabBase;\n\t\tvar primType:number;\n\t\tvar subs_parsed:number;\n\t\tvar props:AWDProperties;\n\t\tvar bsm:Matrix3D;\n\n\t\t// Read name and sub count\n\t\tname = this.parseVarStr();\n\t\tprimType = this._newBlockBytes.readUnsignedByte();\n\t\tprops = this.parseProperties({101:this._geoNrType, 102:this._geoNrType, 103:this._geoNrType, 110:this._geoNrType, 111:this._geoNrType, 301:AWDParser.UINT16, 302:AWDParser.UINT16, 303:AWDParser.UINT16, 701:AWDParser.BOOL, 702:AWDParser.BOOL, 703:AWDParser.BOOL, 704:AWDParser.BOOL});\n\n\t\tvar primitiveTypes:Array = [\"Unsupported Type-ID\", \"PrimitivePlanePrefab\", \"PrimitiveCubePrefab\", \"PrimitiveSpherePrefab\", \"PrimitiveCylinderPrefab\", \"PrimitivesConePrefab\", \"PrimitivesCapsulePrefab\", \"PrimitivesTorusPrefab\"]\n\n\t\tswitch (primType) {\n\t\t\t// to do, not all properties are set on all primitives\n\n\t\t\tcase 1:\n\t\t\t\tprefab = new PrimitivePlanePrefab(props.get(101, 100), props.get(102, 100), props.get(301, 1), props.get(302, 1), props.get(701, true), props.get(702, false));\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\tprefab = new PrimitiveCubePrefab(props.get(101, 100), props.get(102, 100), props.get(103, 100), props.get(301, 1), props.get(302, 1), props.get(303, 1), props.get(701, true));\n\t\t\t\tbreak;\n\n\t\t\tcase 3:\n\t\t\t\tprefab = new PrimitiveSpherePrefab(props.get(101, 50), props.get(301, 16), props.get(302, 12), props.get(701, true));\n\t\t\t\tbreak;\n\n\t\t\tcase 4:\n\t\t\t\tprefab = new PrimitiveCylinderPrefab(props.get(101, 50), props.get(102, 50), props.get(103, 100), props.get(301, 16), props.get(302, 1), true, true, true); // bool701, bool702, bool703, bool704);\n\t\t\t\tif (!props.get(701, true))\n\t\t\t\t\t(prefab).topClosed = false;\n\t\t\t\tif (!props.get(702, true))\n\t\t\t\t\t(prefab).bottomClosed = false;\n\t\t\t\tif (!props.get(703, true))\n\t\t\t\t\t(prefab).yUp = false;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\t\t\t\tprefab = new PrimitiveConePrefab(props.get(101, 50), props.get(102, 100), props.get(301, 16), props.get(302, 1), props.get(701, true), props.get(702, true));\n\t\t\t\tbreak;\n\n\t\t\tcase 6:\n\t\t\t\tprefab = new PrimitiveCapsulePrefab(props.get(101, 50), props.get(102, 100), props.get(301, 16), props.get(302, 15), props.get(701, true));\n\t\t\t\tbreak;\n\n\t\t\tcase 7:\n\t\t\t\tprefab = new PrimitiveTorusPrefab(props.get(101, 50), props.get(102, 50), props.get(301, 16), props.get(302, 8), props.get(701, true));\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tprefab = new PrefabBase();\n\t\t\t\tconsole.log(\"ERROR: UNSUPPORTED PREFAB_TYPE\");\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ((props.get(110, 1) != 1) || (props.get(111, 1) != 1)) {\n\t\t\t//geom.subGeometries;\n\t\t\t//geom.scaleUV(props.get(110, 1), props.get(111, 1)); //TODO add back scaling to prefabs\n\t\t}\n\n\t\tthis.parseUserAttributes();\n\t\tprefab.name = name;\n\t\tthis._pFinalizeAsset(prefab, name);\n\t\tthis._blocks[blockID].data = prefab;\n\n\t\tif (this._debug) {\n\t\t\tif ((primType < 0) || (primType > 7)) {\n\t\t\t\tprimType = 0;\n\t\t\t}\n\t\t\tconsole.log(\"Parsed a Primivite: Name = \" + name + \"| type = \" + primitiveTypes[primType]);\n\t\t}\n\t}\n\n\t// Block ID = 22\n\tprivate parseContainer(blockID:number):void\n\t{\n\t\tvar name:string;\n\t\tvar par_id:number;\n\t\tvar mtx:Matrix3D;\n\t\tvar ctr:DisplayObjectContainer;\n\t\tvar parent:DisplayObjectContainer;\n\n\t\tpar_id = this._newBlockBytes.readUnsignedInt();\n\t\tmtx = this.parseMatrix3D();\n\t\tname = this.parseVarStr();\n\n\t\tvar parentName:string = \"Root (TopLevel)\";\n\t\tctr = new DisplayObjectContainer();\n\t\tctr.transform.matrix3D = mtx;\n\n\t\tvar returnedArray:Array = this.getAssetByID(par_id, [AssetType.CONTAINER, AssetType.LIGHT, AssetType.MESH]);\n\n\t\tif (returnedArray[0]) {\n\t\t\tvar obj:DisplayObject = ( returnedArray[1]).addChild(ctr);\n\t\t\tparentName = ( returnedArray[1]).name;\n\t\t} else if (par_id > 0) {\n\t\t\tthis._blocks[ blockID ].addError(\"Could not find a parent for this ObjectContainer3D\");\n\t\t} else {\n\t\t\t//add to the content property\n\t\t\t( this._pContent).addChild(ctr);\n\t\t}\n\n\t\t// in AWD version 2.1 we read the Container properties\n\t\tif ((this._version[0] == 2) && (this._version[1] == 1)) {\n\t\t\tvar props:AWDProperties = this.parseProperties({1:this._matrixNrType, 2:this._matrixNrType, 3:this._matrixNrType, 4:AWDParser.UINT8});\n\t\t\tctr.pivot = new Vector3D(props.get(1, 0), props.get(2, 0), props.get(3, 0));\n\t\t}\n\t\t// in other versions we do not read the Container properties\n\t\telse {\n\t\t\tthis.parseProperties(null);\n\t\t}\n\n\t\t// the extraProperties should only be set for AWD2.1-Files, but is read for both versions\n\t\tctr.extra = this.parseUserAttributes();\n\n\t\tthis._pFinalizeAsset( ctr, name);\n\t\tthis._blocks[blockID].data = ctr;\n\n\t\tif (this._debug) {\n\t\t\tconsole.log(\"Parsed a Container: Name = '\" + name + \"' | Parent-Name = \" + parentName);\n\t\t}\n\t}\n\n\t// Block ID = 23\n\tprivate parseMeshInstance(blockID:number):void\n\t{\n\t\tvar num_materials:number;\n\t\tvar materials_parsed:number;\n\t\tvar parent:DisplayObjectContainer;\n\t\tvar par_id:number = this._newBlockBytes.readUnsignedInt();\n\t\tvar mtx:Matrix3D = this.parseMatrix3D();\n\t\tvar name:string = this.parseVarStr();\n\t\tvar parentName:string = \"Root (TopLevel)\";\n\t\tvar data_id:number = this._newBlockBytes.readUnsignedInt();\n\t\tvar geom:Geometry;\n\t\tvar returnedArrayGeometry:Array = this.getAssetByID(data_id, [AssetType.GEOMETRY])\n\n\t\tif (returnedArrayGeometry[0]) {\n\t\t\tgeom = returnedArrayGeometry[1];\n\t\t} else {\n\t\t\tthis._blocks[blockID].addError(\"Could not find a Geometry for this Mesh. A empty Geometry is created!\");\n\t\t\tgeom = new Geometry();\n\t\t}\n\n\t\tthis._blocks[blockID].geoID = data_id;\n\t\tvar materials:Array = new Array();\n\t\tnum_materials = this._newBlockBytes.readUnsignedShort();\n\n\t\tvar materialNames:Array = new Array();\n\t\tmaterials_parsed = 0;\n\n\t\tvar returnedArrayMaterial:Array;\n\n\t\twhile (materials_parsed < num_materials) {\n\t\t\tvar mat_id:number;\n\t\t\tmat_id = this._newBlockBytes.readUnsignedInt();\n\t\t\treturnedArrayMaterial = this.getAssetByID(mat_id, [AssetType.MATERIAL])\n\t\t\tif ((!returnedArrayMaterial[0]) && (mat_id > 0)) {\n\t\t\t\tthis._blocks[blockID].addError(\"Could not find Material Nr \" + materials_parsed + \" (ID = \" + mat_id + \" ) for this Mesh\");\n\t\t\t}\n\n\t\t\tvar m:MaterialBase = returnedArrayMaterial[1];\n\n\t\t\tmaterials.push(m);\n\t\t\tmaterialNames.push(m.name);\n\n\t\t\tmaterials_parsed++;\n\t\t}\n\n\t\tvar mesh:Mesh = new Mesh(geom, null);\n\t\tmesh.transform.matrix3D = mtx;\n\n\t\tvar returnedArrayParent:Array = this.getAssetByID(par_id, [AssetType.CONTAINER, AssetType.LIGHT, AssetType.MESH])\n\n\t\tif (returnedArrayParent[0]) {\n\t\t\tvar objC:DisplayObjectContainer = returnedArrayParent[1];\n\t\t\tobjC.addChild(mesh);\n\t\t\tparentName = objC.name;\n\t\t} else if (par_id > 0) {\n\t\t\tthis._blocks[blockID].addError(\"Could not find a parent for this Mesh\");\n\t\t} else {\n\t\t\t//add to the content property\n\t\t\t( this._pContent).addChild(mesh);\n\t\t}\n\n\t\tif (materials.length >= 1 && mesh.subMeshes.length == 1) {\n\t\t\tmesh.material = materials[0];\n\t\t} else if (materials.length > 1) {\n\t\t\tvar i:number;\n\n\t\t\t// Assign each sub-mesh in the mesh a material from the list. If more sub-meshes\n\t\t\t// than materials, repeat the last material for all remaining sub-meshes.\n\t\t\tfor (i = 0; i < mesh.subMeshes.length; i++) {\n\t\t\t\tmesh.subMeshes[i].material = materials[Math.min(materials.length - 1, i)];\n\t\t\t}\n\t\t}\n\t\tif ((this._version[0] == 2) && (this._version[1] == 1)) {\n\t\t\tvar props:AWDProperties = this.parseProperties({1:this._matrixNrType, 2:this._matrixNrType, 3:this._matrixNrType, 4:AWDParser.UINT8, 5:AWDParser.BOOL});\n\t\t\tmesh.pivot = new Vector3D(props.get(1, 0), props.get(2, 0), props.get(3, 0));\n\t\t\tmesh.castsShadows = props.get(5, true);\n\t\t} else {\n\t\t\tthis.parseProperties(null);\n\t\t}\n\n\t\tmesh.extra = this.parseUserAttributes();\n\n\t\tthis._pFinalizeAsset( mesh, name);\n\t\tthis._blocks[blockID].data = mesh;\n\n\t\tif (this._debug) {\n\t\t\tconsole.log(\"Parsed a Mesh: Name = '\" + name + \"' | Parent-Name = \" + parentName + \"| Geometry-Name = \" + geom.name + \" | SubMeshes = \" + mesh.subMeshes.length + \" | Mat-Names = \" + materialNames.toString());\n\t\t}\n\t}\n\n\n\t//Block ID 31\n\tprivate parseSkyboxInstance(blockID:number):void\n\t{\n\t\tvar name:string = this.parseVarStr();\n\t\tvar cubeTexAddr:number = this._newBlockBytes.readUnsignedInt();\n\n\t\tvar returnedArrayCubeTex:Array = this.getAssetByID(cubeTexAddr, [AssetType.TEXTURE], \"CubeTexture\");\n\t\tif ((!returnedArrayCubeTex[0]) && (cubeTexAddr != 0))\n\t\t\tthis._blocks[blockID].addError(\"Could not find the Cubetexture (ID = \" + cubeTexAddr + \" ) for this Skybox\");\n\t\tvar asset:Skybox = new Skybox(new SkyboxMaterial( returnedArrayCubeTex[1]));\n\n\t\tthis.parseProperties(null)\n\t\tasset.extra = this.parseUserAttributes();\n\t\tthis._pFinalizeAsset(asset, name);\n\t\tthis._blocks[blockID].data = asset;\n\t\tif (this._debug)\n\t\t\tconsole.log(\"Parsed a Skybox: Name = '\" + name + \"' | CubeTexture-Name = \" + ( returnedArrayCubeTex[1]).name);\n\n\t}\n\n\t//Block ID = 41\n\tprivate parseLight(blockID:number):void\n\t{\n\t\tvar light:LightBase;\n\t\tvar newShadowMapper:ShadowMapperBase;\n\n\t\tvar par_id:number = this._newBlockBytes.readUnsignedInt();\n\t\tvar mtx:Matrix3D = this.parseMatrix3D();\n\t\tvar name:string = this.parseVarStr();\n\t\tvar lightType:number = this._newBlockBytes.readUnsignedByte();\n\t\tvar props:AWDProperties = this.parseProperties({1:this._propsNrType, 2:this._propsNrType, 3:AWDParser.COLOR, 4:this._propsNrType, 5:this._propsNrType, 6:AWDParser.BOOL, 7:AWDParser.COLOR, 8:this._propsNrType, 9:AWDParser.UINT8, 10:AWDParser.UINT8, 11:this._propsNrType, 12:AWDParser.UINT16, 21:this._matrixNrType, 22:this._matrixNrType, 23:this._matrixNrType});\n\t\tvar shadowMapperType:number = props.get(9, 0);\n\t\tvar parentName:string = \"Root (TopLevel)\";\n\t\tvar lightTypes:Array = [\"Unsupported LightType\", \"PointLight\", \"DirectionalLight\"];\n\t\tvar shadowMapperTypes:Array = [\"No ShadowMapper\", \"DirectionalShadowMapper\", \"NearDirectionalShadowMapper\", \"CascadeShadowMapper\", \"CubeMapShadowMapper\"];\n\n\t\tif (lightType == 1) {\n\t\t\tlight = new PointLight();\n\n\t\t\t( light).radius = props.get(1, 90000);\n\t\t\t( light).fallOff = props.get(2, 100000);\n\n\t\t\tif (shadowMapperType > 0) {\n\t\t\t\tif (shadowMapperType == 4) {\n\t\t\t\t\tnewShadowMapper = new CubeMapShadowMapper();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlight.transform.matrix3D = mtx;\n\n\t\t}\n\n\t\tif (lightType == 2) {\n\n\t\t\tlight = new DirectionalLight(props.get(21, 0), props.get(22, -1), props.get(23, 1));\n\n\t\t\tif (shadowMapperType > 0) {\n\t\t\t\tif (shadowMapperType == 1) {\n\t\t\t\t\tnewShadowMapper = new DirectionalShadowMapper();\n\t\t\t\t}\n\n\t\t\t\t//if (shadowMapperType == 2)\n\t\t\t\t// newShadowMapper = new NearDirectionalShadowMapper(props.get(11, 0.5));\n\t\t\t\t//if (shadowMapperType == 3)\n\t\t\t\t// newShadowMapper = new CascadeShadowMapper(props.get(12, 3));\n\n\t\t\t}\n\n\t\t}\n\t\tlight.color = props.get(3, 0xffffff);\n\t\tlight.specular = props.get(4, 1.0);\n\t\tlight.diffuse = props.get(5, 1.0);\n\t\tlight.ambientColor = props.get(7, 0xffffff);\n\t\tlight.ambient = props.get(8, 0.0);\n\n\t\t// if a shadowMapper has been created, adjust the depthMapSize if needed, assign to light and set castShadows to true\n\t\tif (newShadowMapper) {\n\t\t\tif (newShadowMapper instanceof CubeMapShadowMapper) {\n\t\t\t\tif (props.get(10, 1) != 1) {\n\t\t\t\t\tnewShadowMapper.depthMapSize = this._depthSizeDic[props.get(10, 1)];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (props.get(10, 2) != 2) {\n\t\t\t\t\tnewShadowMapper.depthMapSize = this._depthSizeDic[props.get(10, 2)];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlight.shadowMapper = newShadowMapper;\n\t\t\tlight.castsShadows = true;\n\t\t}\n\n\t\tif (par_id != 0) {\n\n\t\t\tvar returnedArrayParent:Array = this.getAssetByID(par_id, [AssetType.CONTAINER, AssetType.LIGHT, AssetType.MESH])\n\n\t\t\tif (returnedArrayParent[0]) {\n\t\t\t\t( returnedArrayParent[1]).addChild(light);\n\t\t\t\tparentName = ( returnedArrayParent[1]).name;\n\t\t\t} else {\n\t\t\t\tthis._blocks[blockID].addError(\"Could not find a parent for this Light\");\n\t\t\t}\n\t\t} else {\n\t\t\t//add to the content property\n\t\t\t( this._pContent).addChild(light);\n\t\t}\n\n\t\tthis.parseUserAttributes();\n\n\t\tthis._pFinalizeAsset(< IAsset> light, name);\n\n\t\tthis._blocks[blockID].data = light;\n\n\t\tif (this._debug)\n\t\t\tconsole.log(\"Parsed a Light: Name = '\" + name + \"' | Type = \" + lightTypes[lightType] + \" | Parent-Name = \" + parentName + \" | ShadowMapper-Type = \" + shadowMapperTypes[shadowMapperType]);\n\n\t}\n\n\t//Block ID = 43\n\tprivate parseCamera(blockID:number):void\n\t{\n\n\t\tvar par_id:number = this._newBlockBytes.readUnsignedInt();\n\t\tvar mtx:Matrix3D = this.parseMatrix3D();\n\t\tvar name:string = this.parseVarStr();\n\t\tvar parentName:string = \"Root (TopLevel)\";\n\t\tvar projection:ProjectionBase;\n\n\t\tthis._newBlockBytes.readUnsignedByte(); //set as active camera\n\t\tthis._newBlockBytes.readShort(); //lengthof lenses - not used yet\n\n\t\tvar projectiontype:number = this._newBlockBytes.readShort();\n\t\tvar props:AWDProperties = this.parseProperties({101:this._propsNrType, 102:this._propsNrType, 103:this._propsNrType, 104:this._propsNrType});\n\n\t\tswitch (projectiontype) {\n\t\t\tcase 5001:\n\t\t\t\tprojection = new PerspectiveProjection(props.get(101, 60));\n\t\t\t\tbreak;\n\t\t\tcase 5002:\n\t\t\t\tprojection = new OrthographicProjection(props.get(101, 500));\n\t\t\t\tbreak;\n\t\t\tcase 5003:\n\t\t\t\tprojection = new OrthographicOffCenterProjection(props.get(101, -400), props.get(102, 400), props.get(103, -300), props.get(104, 300));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tconsole.log(\"unsupportedLenstype\");\n\t\t\t\treturn;\n\t\t}\n\n\t\tvar camera:Camera = new Camera(projection);\n\t\tcamera.transform.matrix3D = mtx;\n\n\t\tvar returnedArrayParent:Array = this.getAssetByID(par_id, [AssetType.CONTAINER, AssetType.LIGHT, AssetType.MESH])\n\n\t\tif (returnedArrayParent[0]) {\n\n\t\t\tvar objC:DisplayObjectContainer = returnedArrayParent[1];\n\t\t\tobjC.addChild(camera);\n\n\t\t\tparentName = objC.name;\n\n\t\t} else if (par_id > 0) {\n\t\t\tthis._blocks[blockID].addError(\"Could not find a parent for this Camera\");\n\t\t} else {\n\t\t\t//add to the content property\n\t\t\t( this._pContent).addChild(camera);\n\t\t}\n\n\t\tcamera.name = name;\n\t\tprops = this.parseProperties({1:this._matrixNrType, 2:this._matrixNrType, 3:this._matrixNrType, 4:AWDParser.UINT8});\n\t\tcamera.pivot = new Vector3D(props.get(1, 0), props.get(2, 0), props.get(3, 0));\n\t\tcamera.extra = this.parseUserAttributes();\n\n\t\tthis._pFinalizeAsset(camera, name);\n\n\t\tthis._blocks[blockID].data = camera\n\n\t\tif (this._debug) {\n\t\t\tconsole.log(\"Parsed a Camera: Name = '\" + name + \"' | Projectiontype = \" + projection + \" | Parent-Name = \" + parentName);\n\t\t}\n\n\t}\n\n\t//Block ID = 51\n\tprivate parseLightPicker(blockID:number):void\n\t{\n\t\tvar name:string = this.parseVarStr();\n\t\tvar numLights:number = this._newBlockBytes.readUnsignedShort();\n\t\tvar lightsArray:Array = new Array();\n\t\tvar k:number = 0;\n\t\tvar lightID:number = 0;\n\n\t\tvar returnedArrayLight:Array;\n\t\tvar lightsArrayNames:Array = new Array();\n\n\t\tfor (k = 0; k < numLights; k++) {\n\t\t\tlightID = this._newBlockBytes.readUnsignedInt();\n\t\t\treturnedArrayLight = this.getAssetByID(lightID, [AssetType.LIGHT])\n\n\t\t\tif (returnedArrayLight[0]) {\n\t\t\t\tlightsArray.push( returnedArrayLight[1]);\n\t\t\t\tlightsArrayNames.push(( returnedArrayLight[1]).name);\n\n\t\t\t} else {\n\t\t\t\tthis._blocks[blockID].addError(\"Could not find a Light Nr \" + k + \" (ID = \" + lightID + \" ) for this LightPicker\");\n\t\t\t}\n\t\t}\n\n\t\tif (lightsArray.length == 0) {\n\t\t\tthis._blocks[blockID].addError(\"Could not create this LightPicker, cause no Light was found.\");\n\t\t\tthis.parseUserAttributes();\n\t\t\treturn; //return without any more parsing for this block\n\t\t}\n\n\t\tvar lightPick:LightPickerBase = new StaticLightPicker(lightsArray);\n\t\tlightPick.name = name;\n\n\t\tthis.parseUserAttributes();\n\t\tthis._pFinalizeAsset( lightPick, name);\n\n\t\tthis._blocks[blockID].data = lightPick\n\t\tif (this._debug) {\n\t\t\tconsole.log(\"Parsed a StaticLightPicker: Name = '\" + name + \"' | Texture-Name = \" + lightsArrayNames.toString());\n\t\t}\n\t}\n\n\t//Block ID = 81\n\tprivate parseMaterial(blockID:number):void\n\t{\n\t\t// TODO: not used\n\t\t////blockLength = block.len;\n\t\tvar name:string;\n\t\tvar type:number;\n\t\tvar props:AWDProperties;\n\t\tvar mat:TriangleMethodMaterial;\n\t\tvar attributes:Object;\n\t\tvar finalize:boolean;\n\t\tvar num_methods:number;\n\t\tvar methods_parsed:number;\n\t\tvar returnedArray:Array;\n\n\t\tname = this.parseVarStr();\n\t\ttype = this._newBlockBytes.readUnsignedByte();\n\t\tnum_methods = this._newBlockBytes.readUnsignedByte();\n\n\t\t// Read material numerical properties\n\t\t// (1=color, 2=bitmap url, 10=alpha, 11=alpha_blending, 12=alpha_threshold, 13=repeat)\n\t\tprops = this.parseProperties({ 1:AWDParser.INT32, 2:AWDParser.BADDR, 10:this._propsNrType, 11:AWDParser.BOOL, 12:this._propsNrType, 13:AWDParser.BOOL});\n\n\t\tmethods_parsed = 0;\n\t\twhile (methods_parsed < num_methods) {\n\t\t\tvar method_type:number;\n\n\t\t\tmethod_type = this._newBlockBytes.readUnsignedShort();\n\t\t\tthis.parseProperties(null);\n\t\t\tthis.parseUserAttributes();\n\t\t\tmethods_parsed += 1;\n\t\t}\n\t\tvar debugString:string = \"\";\n\t\tattributes = this.parseUserAttributes();\n\t\tif (type === 1) { // Color material\n\t\t\tdebugString += \"Parsed a ColorMaterial(SinglePass): Name = '\" + name + \"' | \";\n\t\t\tvar color:number;\n\t\t\tcolor = props.get(1, 0xffffff);\n\t\t\tif (this.materialMode < 2) {\n\t\t\t\tmat = new TriangleMethodMaterial(color, props.get(10, 1.0));\n\t\t\t} else {\n\t\t\t\tmat = new TriangleMethodMaterial(color);\n\t\t\t\tmat.materialMode = TriangleMaterialMode.MULTI_PASS;\n\t\t\t}\n\t\t} else if (type === 2) {\n\t\t\tvar tex_addr:number = props.get(2, 0);\n\n\t\t\treturnedArray = this.getAssetByID(tex_addr, [AssetType.TEXTURE]);\n\n\t\t\tif ((!returnedArray[0]) && (tex_addr > 0))\n\t\t\t\tthis._blocks[blockID].addError(\"Could not find the DiffsueTexture (ID = \" + tex_addr + \" ) for this Material\");\n\n\t\t\tmat = new TriangleMethodMaterial( returnedArray[1]);\n\n\t\t\tif (this.materialMode < 2) {\n\t\t\t\tmat.alphaBlending = props.get(11, false);\n\t\t\t\tmat.alpha = props.get(10, 1.0);\n\t\t\t\tdebugString += \"Parsed a TriangleMethodMaterial(SinglePass): Name = '\" + name + \"' | Texture-Name = \" + mat.name;\n\t\t\t} else {\n\t\t\t\tmat.materialMode = TriangleMaterialMode.MULTI_PASS;\n\t\t\t\tdebugString += \"Parsed a TriangleMethodMaterial(MultiPass): Name = '\" + name + \"' | Texture-Name = \" + mat.name;\n\t\t\t}\n\t\t}\n\n\t\tmat.extra = attributes;\n\t\tmat.alphaThreshold = props.get(12, 0.0);\n\t\tmat.repeat = props.get(13, false);\n\t\tthis._pFinalizeAsset( mat, name);\n\t\tthis._blocks[blockID].data = mat;\n\n\t\tif (this._debug) {\n\t\t\tconsole.log(debugString);\n\n\t\t}\n\t}\n\n\t// Block ID = 81 AWD2.1\n\tprivate parseMaterial_v1(blockID:number):void\n\t{\n\t\tvar mat:TriangleMethodMaterial;\n\t\tvar normalTexture:Texture2DBase;\n\t\tvar specTexture:Texture2DBase;\n\t\tvar returnedArray:Array;\n\n\t\tvar name:string = this.parseVarStr();\n\t\tvar type:number = this._newBlockBytes.readUnsignedByte();\n\t\tvar num_methods:number = this._newBlockBytes.readUnsignedByte();\n\t\tvar props:AWDProperties = this.parseProperties({1:AWDParser.UINT32, 2:AWDParser.BADDR, 3:AWDParser.BADDR, 4:AWDParser.UINT8, 5:AWDParser.BOOL, 6:AWDParser.BOOL, 7:AWDParser.BOOL, 8:AWDParser.BOOL, 9:AWDParser.UINT8, 10:this._propsNrType, 11:AWDParser.BOOL, 12:this._propsNrType, 13:AWDParser.BOOL, 15:this._propsNrType, 16:AWDParser.UINT32, 17:AWDParser.BADDR, 18:this._propsNrType, 19:this._propsNrType, 20:AWDParser.UINT32, 21:AWDParser.BADDR, 22:AWDParser.BADDR});\n\t\tvar spezialType:number = props.get(4, 0);\n\t\tvar debugString:string = \"\";\n\n\t\tif (spezialType >= 2) {//this is no supported material\n\t\t\tthis._blocks[blockID].addError(\"Material-spezialType '\" + spezialType + \"' is not supported, can only be 0:singlePass, 1:MultiPass !\");\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.materialMode == 1)\n\t\t\tspezialType = 0;\n\t\telse if (this.materialMode == 2)\n\t\t\tspezialType = 1;\n\n\t\tif (spezialType < 2) {//this is SinglePass or MultiPass\n\n\t\t\tif (type == 1) {// Color material\n\t\t\t\tvar color:number = props.get(1, 0xcccccc);//TODO temporarily swapped so that diffuse color goes to ambient\n\n\t\t\t\tif (spezialType == 1) {//\tMultiPassMaterial\n\t\t\t\t\tmat = new TriangleMethodMaterial(color);\n\t\t\t\t\tmat.materialMode = TriangleMaterialMode.MULTI_PASS;\n\t\t\t\t\tdebugString += \"Parsed a ColorMaterial(MultiPass): Name = '\" + name + \"' | \";\n\n\t\t\t\t} else { //\tSinglePassMaterial\n\t\t\t\t\tmat = new TriangleMethodMaterial(color, props.get(10, 1.0));\n\t\t\t\t\tmat.alphaBlending = props.get(11, false);\n\t\t\t\t\tdebugString += \"Parsed a ColorMaterial(SinglePass): Name = '\" + name + \"' | \";\n\t\t\t\t}\n\n\t\t\t} else if (type == 2) {// texture material\n\t\t\t\tvar tex_addr:number = props.get(2, 0);//TODO temporarily swapped so that diffuse texture goes to ambient\n\t\t\t\treturnedArray = this.getAssetByID(tex_addr, [AssetType.TEXTURE]);\n\n\t\t\t\tif ((!returnedArray[0]) && (tex_addr > 0))\n\t\t\t\t\tthis._blocks[blockID].addError(\"Could not find the AmbientTexture (ID = \" + tex_addr + \" ) for this TriangleMethodMaterial\");\n\n\t\t\t\tvar texture:Texture2DBase = returnedArray[1];\n\n\t\t\t\tmat = new TriangleMethodMaterial(texture);\n\n\t\t\t\tif (spezialType == 1) {// MultiPassMaterial\n\t\t\t\t\tmat.materialMode = TriangleMaterialMode.MULTI_PASS;\n\n\t\t\t\t\tdebugString += \"Parsed a TriangleMethodMaterial(MultiPass): Name = '\" + name + \"' | Texture-Name = \" + texture.name;\n\t\t\t\t} else {//\tSinglePassMaterial\n\t\t\t\t\tmat.alpha = props.get(10, 1.0);\n\t\t\t\t\tmat.alphaBlending = props.get(11, false);\n\n\t\t\t\t\tdebugString += \"Parsed a TriangleMethodMaterial(SinglePass): Name = '\" + name + \"' | Texture-Name = \" + texture.name;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar diffuseTexture:Texture2DBase;\n\t\t\tvar diffuseTex_addr:number = props.get(17, 0);\n\n\t\t\treturnedArray = this.getAssetByID(diffuseTex_addr, [AssetType.TEXTURE]);\n\n\t\t\tif ((!returnedArray[0]) && (diffuseTex_addr != 0)) {\n\t\t\t\tthis._blocks[blockID].addError(\"Could not find the DiffuseTexture (ID = \" + diffuseTex_addr + \" ) for this TriangleMethodMaterial\");\n\t\t\t}\n\n\t\t\tif (returnedArray[0])\n\t\t\t\tdiffuseTexture = returnedArray[1];\n\n\t\t\tif (diffuseTexture) {\n\t\t\t\tmat.diffuseTexture = diffuseTexture;\n\t\t\t\tdebugString += \" | DiffuseTexture-Name = \" + diffuseTexture.name;\n\t\t\t}\n\n\t\t\tvar normalTex_addr:number = props.get(3, 0);\n\n\t\t\treturnedArray = this.getAssetByID(normalTex_addr, [AssetType.TEXTURE]);\n\n\t\t\tif ((!returnedArray[0]) && (normalTex_addr != 0)) {\n\t\t\t\tthis._blocks[blockID].addError(\"Could not find the NormalTexture (ID = \" + normalTex_addr + \" ) for this TriangleMethodMaterial\");\n\t\t\t}\n\n\t\t\tif (returnedArray[0]) {\n\t\t\t\tnormalTexture = returnedArray[1];\n\t\t\t\tdebugString += \" | NormalTexture-Name = \" + normalTexture.name;\n\t\t\t}\n\n\t\t\tvar specTex_addr:number = props.get(21, 0);\n\t\t\treturnedArray = this.getAssetByID(specTex_addr, [AssetType.TEXTURE]);\n\n\t\t\tif ((!returnedArray[0]) && (specTex_addr != 0)) {\n\t\t\t\tthis._blocks[blockID].addError(\"Could not find the SpecularTexture (ID = \" + specTex_addr + \" ) for this TriangleMethodMaterial\");\n\t\t\t}\n\t\t\tif (returnedArray[0]) {\n\t\t\t\tspecTexture = returnedArray[1];\n\t\t\t\tdebugString += \" | SpecularTexture-Name = \" + specTexture.name;\n\t\t\t}\n\n\t\t\tvar lightPickerAddr:number = props.get(22, 0);\n\t\t\treturnedArray = this.getAssetByID(lightPickerAddr, [AssetType.LIGHT_PICKER])\n\n\t\t\tif ((!returnedArray[0]) && (lightPickerAddr)) {\n\t\t\t\tthis._blocks[blockID].addError(\"Could not find the LightPicker (ID = \" + lightPickerAddr + \" ) for this TriangleMethodMaterial\");\n\t\t\t} else {\n\t\t\t\tmat.lightPicker = returnedArray[1];\n\t\t\t\t//debugString+=\" | Lightpicker-Name = \"+LightPickerBase(returnedArray[1]).name;\n\t\t\t}\n\n\t\t\tmat.smooth = props.get(5, true);\n\t\t\tmat.mipmap = props.get(6, true);\n\t\t\tmat.bothSides = props.get(7, false);\n\t\t\tmat.alphaPremultiplied = props.get(8, false);\n\t\t\tmat.blendMode = this.blendModeDic[props.get(9, 0)];\n\t\t\tmat.repeat = props.get(13, false);\n\n\t\t\tif (normalTexture)\n\t\t\t\tmat.normalMap = normalTexture;\n\n\t\t\tif (specTexture)\n\t\t\t\tmat.specularMap = specTexture;\n\n\t\t\tmat.alphaThreshold = props.get(12, 0.0);\n\t\t\tmat.ambient = props.get(15, 1.0);\n\t\t\tmat.diffuseColor = props.get(16, 0xffffff);\n\t\t\tmat.specular = props.get(18, 1.0);\n\t\t\tmat.gloss = props.get(19, 50);\n\t\t\tmat.specularColor = props.get(20, 0xffffff);\n\n\t\t\tvar methods_parsed:number = 0;\n\t\t\tvar targetID:number;\n\n\t\t\twhile (methods_parsed < num_methods) {\n\t\t\t\tvar method_type:number;\n\t\t\t\tmethod_type = this._newBlockBytes.readUnsignedShort();\n\n\t\t\t\tprops = this.parseProperties({1:AWDParser.BADDR, 2:AWDParser.BADDR, 3:AWDParser.BADDR, 101:this._propsNrType, 102:this._propsNrType, 103:this._propsNrType, 201:AWDParser.UINT32, 202:AWDParser.UINT32, 301:AWDParser.UINT16, 302:AWDParser.UINT16, 401:AWDParser.UINT8, 402:AWDParser.UINT8, 601:AWDParser.COLOR, 602:AWDParser.COLOR, 701:AWDParser.BOOL, 702:AWDParser.BOOL, 801:AWDParser.MTX4x4});\n\n\t\t\t\tswitch (method_type) {\n\t\t\t\t\tcase 999: //wrapper-Methods that will load a previous parsed EffektMethod returned\n\n\t\t\t\t\t\ttargetID = props.get(1, 0);\n\t\t\t\t\t\treturnedArray = this.getAssetByID(targetID, [AssetType.EFFECTS_METHOD]);\n\n\t\t\t\t\t\tif (!returnedArray[0]) {\n\t\t\t\t\t\t\tthis._blocks[blockID].addError(\"Could not find the EffectMethod (ID = \" + targetID + \" ) for this Material\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmat.addEffectMethod(returnedArray[1]);\n\n\t\t\t\t\t\t\tdebugString += \" | EffectMethod-Name = \" + ( returnedArray[1]).name;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 998: //wrapper-Methods that will load a previous parsed ShadowMapMethod\n\n\t\t\t\t\t\ttargetID = props.get(1, 0);\n\t\t\t\t\t\treturnedArray = this.getAssetByID(targetID, [AssetType.SHADOW_MAP_METHOD]);\n\n\t\t\t\t\t\tif (!returnedArray[0]) {\n\t\t\t\t\t\t\tthis._blocks[blockID].addError(\"Could not find the ShadowMethod (ID = \" + targetID + \" ) for this Material\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmat.shadowMethod = returnedArray[1];\n\t\t\t\t\t\t\tdebugString += \" | ShadowMethod-Name = \" + ( returnedArray[1]).name;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 1: //EnvMapAmbientMethod\n\t\t\t\t\t\ttargetID = props.get(1, 0);\n\t\t\t\t\t\treturnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE], \"CubeTexture\");\n\t\t\t\t\t\tif (!returnedArray[0])\n\t\t\t\t\t\t\tthis._blocks[blockID].addError(\"Could not find the EnvMap (ID = \" + targetID + \" ) for this EnvMapAmbientMethodMaterial\");\n\t\t\t\t\t\tmat.ambientMethod = new AmbientEnvMapMethod(returnedArray[1]);\n\t\t\t\t\t\tdebugString += \" | AmbientEnvMapMethod | EnvMap-Name =\" + ( returnedArray[1]).name;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 51: //DepthDiffuseMethod\n\t\t\t\t\t\tmat.diffuseMethod = new DiffuseDepthMethod();\n\t\t\t\t\t\tdebugString += \" | DiffuseDepthMethod\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 52: //GradientDiffuseMethod\n\t\t\t\t\t\ttargetID = props.get(1, 0);\n\t\t\t\t\t\treturnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]);\n\t\t\t\t\t\tif (!returnedArray[0])\n\t\t\t\t\t\t\tthis._blocks[blockID].addError(\"Could not find the GradientDiffuseTexture (ID = \" + targetID + \" ) for this GradientDiffuseMethod\");\n\t\t\t\t\t\tmat.diffuseMethod = new DiffuseGradientMethod(returnedArray[1]);\n\t\t\t\t\t\tdebugString += \" | DiffuseGradientMethod | GradientDiffuseTexture-Name =\" + ( returnedArray[1]).name;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 53: //WrapDiffuseMethod\n\t\t\t\t\t\tmat.diffuseMethod = new DiffuseWrapMethod(props.get(101, 5));\n\t\t\t\t\t\tdebugString += \" | DiffuseWrapMethod\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 54: //LightMapDiffuseMethod\n\t\t\t\t\t\ttargetID = props.get(1, 0);\n\t\t\t\t\t\treturnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]);\n\t\t\t\t\t\tif (!returnedArray[0])\n\t\t\t\t\t\t\tthis._blocks[blockID].addError(\"Could not find the LightMap (ID = \" + targetID + \" ) for this LightMapDiffuseMethod\");\n\t\t\t\t\t\tmat.diffuseMethod = new DiffuseLightMapMethod(returnedArray[1], this.blendModeDic[props.get(401, 10)], false, mat.diffuseMethod);\n\t\t\t\t\t\tdebugString += \" | DiffuseLightMapMethod | LightMapTexture-Name =\" + ( returnedArray[1]).name;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 55: //CelDiffuseMethod\n\t\t\t\t\t\tmat.diffuseMethod = new DiffuseCelMethod(props.get(401, 3), mat.diffuseMethod);\n\t\t\t\t\t\t( mat.diffuseMethod).smoothness = props.get(101, 0.1);\n\t\t\t\t\t\tdebugString += \" | DiffuseCelMethod\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 56: //SubSurfaceScatteringMethod\n//\t\t\t\t\t\t\tmat.diffuseMethod = new DiffuseSubSurfaceMethod(); //depthMapSize and depthMapOffset ?\n//\t\t\t\t\t\t\t( mat.diffuseMethod).scattering = props.get(101, 0.2);\n//\t\t\t\t\t\t\t( mat.diffuseMethod).translucency = props.get(102, 1);\n//\t\t\t\t\t\t\t( mat.diffuseMethod).scatterColor = props.get(601, 0xffffff);\n//\t\t\t\t\t\t\tdebugString += \" | DiffuseSubSurfaceMethod\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 101: //AnisotropicSpecularMethod\n\t\t\t\t\t\tmat.specularMethod = new SpecularAnisotropicMethod();\n\t\t\t\t\t\tdebugString += \" | SpecularAnisotropicMethod\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 102: //SpecularPhongMethod\n\t\t\t\t\t\tmat.specularMethod = new SpecularPhongMethod();\n\t\t\t\t\t\tdebugString += \" | SpecularPhongMethod\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 103: //CellSpecularMethod\n\t\t\t\t\t\tmat.specularMethod = new SpecularCelMethod(props.get(101, 0.5), mat.specularMethod);\n\t\t\t\t\t\t( mat.specularMethod).smoothness = props.get(102, 0.1);\n\t\t\t\t\t\tdebugString += \" | SpecularCelMethod\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 104: //SpecularFresnelMethod\n\t\t\t\t\t\tmat.specularMethod = new SpecularFresnelMethod(props.get(701, true), mat.specularMethod);\n\t\t\t\t\t\t( mat.specularMethod).fresnelPower = props.get(101, 5);\n\t\t\t\t\t\t( mat.specularMethod).normalReflectance = props.get(102, 0.1);\n\t\t\t\t\t\tdebugString += \" | SpecularFresnelMethod\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 151://HeightMapNormalMethod - thios is not implemented for now, but might appear later\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 152: //SimpleWaterNormalMethod\n\t\t\t\t\t\ttargetID = props.get(1, 0);\n\t\t\t\t\t\treturnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]);\n\t\t\t\t\t\tif (!returnedArray[0])\n\t\t\t\t\t\t\tthis._blocks[blockID].addError(\"Could not find the SecoundNormalMap (ID = \" + targetID + \" ) for this SimpleWaterNormalMethod\");\n\t\t\t\t\t\tif (!mat.normalMap)\n\t\t\t\t\t\t\tthis._blocks[blockID].addError(\"Could not find a normal Map on this Material to use with this SimpleWaterNormalMethod\");\n\n\t\t\t\t\t\tmat.normalMap = returnedArray[1];\n\t\t\t\t\t\tmat.normalMethod = new NormalSimpleWaterMethod(mat.normalMap, returnedArray[1]);\n\t\t\t\t\t\tdebugString += \" | NormalSimpleWaterMethod | Second-NormalTexture-Name = \" + ( returnedArray[1]).name;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tthis.parseUserAttributes();\n\t\t\t\tmethods_parsed += 1;\n\t\t\t}\n\t\t}\n\t\tmat.extra = this.parseUserAttributes();\n\t\tthis._pFinalizeAsset( mat, name);\n\n\t\tthis._blocks[blockID].data = mat;\n\t\tif (this._debug) {\n\t\t\tconsole.log(debugString);\n\t\t}\n\t}\n\n\t//Block ID = 82\n\tprivate parseTexture(blockID:number):void\n\t{\n\n\t\tvar asset:Texture2DBase;\n\n\t\tthis._blocks[blockID].name = this.parseVarStr();\n\n\t\tvar type:number = this._newBlockBytes.readUnsignedByte();\n\t\tvar data_len:number;\n\n\t\tthis._texture_users[this._cur_block_id.toString()] = [];\n\n\t\t// External\n\t\tif (type == 0) {\n\t\t\tdata_len = this._newBlockBytes.readUnsignedInt();\n\t\t\tvar url:string;\n\t\t\turl = this._newBlockBytes.readUTFBytes(data_len);\n\t\t\tthis._pAddDependency(this._cur_block_id.toString(), new URLRequest(url), false, null, true);\n\n\t\t} else {\n\t\t\tdata_len = this._newBlockBytes.readUnsignedInt();\n\n\t\t\tvar data:ByteArray;\n\t\t\tdata = new ByteArray();\n\t\t\tthis._newBlockBytes.readBytes(data, 0, data_len);\n\n\t\t\t//\n\t\t\t// AWDParser - Fix for FireFox Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=715075 .\n\t\t\t//\n\t\t\t// Converting data to image here instead of parser - fix FireFox bug where image width / height is 0 when created from data\n\t\t\t// This gives the browser time to initialise image width / height.\n\n\t\t\tthis._pAddDependency(this._cur_block_id.toString(), null, false, ParserUtils.byteArrayToImage(data), true);\n\t\t\t//this._pAddDependency(this._cur_block_id.toString(), null, false, data, true);\n\n\t\t}\n\n\t\t// Ignore for now\n\t\tthis.parseProperties(null);\n\t\tthis._blocks[blockID].extras = this.parseUserAttributes();\n\t\tthis._pPauseAndRetrieveDependencies();\n\t\tthis._blocks[blockID].data = asset;\n\n\t\tif (this._debug) {\n\t\t\tvar textureStylesNames:Array = [\"external\", \"embed\"]\n\t\t\tconsole.log(\"Start parsing a \" + textureStylesNames[type] + \" Bitmap for Texture\");\n\t\t}\n\n\t}\n\n\t//Block ID = 83\n\tprivate parseCubeTexture(blockID:number):void\n\t{\n\t\t//blockLength = block.len;\n\t\tvar data_len:number;\n\t\tvar asset:CubeTextureBase;\n\t\tvar i:number;\n\n\t\tthis._cubeTextures = new Array();\n\t\tthis._texture_users[ this._cur_block_id.toString() ] = [];\n\n\t\tvar type:number = this._newBlockBytes.readUnsignedByte();\n\n\t\tthis._blocks[blockID].name = this.parseVarStr();\n\n\t\tfor (i = 0; i < 6; i++) {\n\t\t\tthis._texture_users[this._cur_block_id.toString()] = [];\n\t\t\tthis._cubeTextures.push(null);\n\n\t\t\t// External\n\t\t\tif (type == 0) {\n\t\t\t\tdata_len = this._newBlockBytes.readUnsignedInt();\n\t\t\t\tvar url:string;\n\t\t\t\turl = this._newBlockBytes.readUTFBytes(data_len);\n\n\t\t\t\tthis._pAddDependency(this._cur_block_id.toString() + \"#\" + i, new URLRequest(url), false, null, true);\n\t\t\t} else {\n\n\t\t\t\tdata_len = this._newBlockBytes.readUnsignedInt();\n\t\t\t\tvar data:ByteArray;\n\t\t\t\tdata = new ByteArray();\n\n\t\t\t\tthis._newBlockBytes.readBytes(data, 0, data_len);\n\n\t\t\t\tthis._pAddDependency(this._cur_block_id.toString() + \"#\" + i, null, false, ParserUtils.byteArrayToImage(data), true);\n\t\t\t}\n\t\t}\n\n\t\t// Ignore for now\n\t\tthis.parseProperties(null);\n\t\tthis._blocks[blockID].extras = this.parseUserAttributes();\n\t\tthis._pPauseAndRetrieveDependencies();\n\t\tthis._blocks[blockID].data = asset;\n\n\t\tif (this._debug) {\n\t\t\tvar textureStylesNames:Array = [\"external\", \"embed\"]\n\t\t\tconsole.log(\"Start parsing 6 \" + textureStylesNames[type] + \" Bitmaps for CubeTexture\");\n\t\t}\n\t}\n\n\t//Block ID = 91\n\tprivate parseSharedMethodBlock(blockID:number):void\n\t{\n\t\tvar asset:EffectMethodBase;\n\n\t\tthis._blocks[blockID].name = this.parseVarStr();\n\t\tasset = this.parseSharedMethodList(blockID);\n\t\tthis.parseUserAttributes();\n\t\tthis._blocks[blockID].data = asset;\n\t\tthis._pFinalizeAsset( asset, this._blocks[blockID].name);\n\t\tthis._blocks[blockID].data = asset;\n\n\t\tif (this._debug) {\n\t\t\tconsole.log(\"Parsed a EffectMethod: Name = \" + asset.name + \" Type = \" + asset);\n\t\t}\n\t}\n\n\t//Block ID = 92\n\tprivate parseShadowMethodBlock(blockID:number):void\n\t{\n\t\tvar type:number;\n\t\tvar data_len:number;\n\t\tvar asset:ShadowMethodBase;\n\t\tvar shadowLightID:number;\n\t\tthis._blocks[blockID].name = this.parseVarStr();\n\n\t\tshadowLightID = this._newBlockBytes.readUnsignedInt();\n\t\tvar returnedArray:Array = this.getAssetByID(shadowLightID, [AssetType.LIGHT]);\n\n\t\tif (!returnedArray[0]) {\n\t\t\tthis._blocks[blockID].addError(\"Could not find the TargetLight (ID = \" + shadowLightID + \" ) for this ShadowMethod - ShadowMethod not created\");\n\t\t\treturn;\n\t\t}\n\n\t\tasset = this.parseShadowMethodList( returnedArray[1], blockID);\n\n\t\tif (!asset)\n\t\t\treturn;\n\n\t\tthis.parseUserAttributes(); // Ignore for now\n\t\tthis._pFinalizeAsset( asset, this._blocks[blockID].name);\n\t\tthis._blocks[blockID].data = asset;\n\n\t\tif (this._debug) {\n\t\t\tconsole.log(\"Parsed a ShadowMapMethodMethod: Name = \" + asset.name + \" | Type = \" + asset + \" | Light-Name = \", ( returnedArray[1] ).name);\n\t\t}\n\t}\n\n\n\t//Block ID = 253\n\tprivate parseCommand(blockID:number):void\n\t{\n\t\tvar hasBlocks:boolean = ( this._newBlockBytes.readUnsignedByte() == 1 );\n\t\tvar par_id:number = this._newBlockBytes.readUnsignedInt();\n\t\tvar mtx:Matrix3D = this.parseMatrix3D();\n\t\tvar name:string = this.parseVarStr();\n\n\t\tvar parentObject:DisplayObjectContainer;\n\t\tvar targetObject:DisplayObjectContainer;\n\n\t\tvar returnedArray:Array = this.getAssetByID(par_id, [AssetType.CONTAINER, AssetType.LIGHT, AssetType.MESH]);\n\n\t\tif (returnedArray[0]) {\n\t\t\tparentObject = returnedArray[1];\n\t\t}\n\n\t\tvar numCommands:number = this._newBlockBytes.readShort();\n\t\tvar typeCommand:number = this._newBlockBytes.readShort();\n\n\t\tvar props:AWDProperties = this.parseProperties({1:AWDParser.BADDR});\n\n\t\tswitch (typeCommand) {\n\t\t\tcase 1:\n\n\t\t\t\tvar targetID:number = props.get(1, 0);\n\t\t\t\tvar returnedArrayTarget:Array = this.getAssetByID(targetID, [AssetType.LIGHT, AssetType.TEXTURE_PROJECTOR]); //for no only light is requested!!!!\n\n\t\t\t\tif ((!returnedArrayTarget[0]) && (targetID != 0)) {\n\t\t\t\t\tthis._blocks[blockID].addError(\"Could not find the light (ID = \" + targetID + \" ( for this CommandBock!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\ttargetObject = returnedArrayTarget[1];\n\n\t\t\t\tif (parentObject) {\n\t\t\t\t\tparentObject.addChild(targetObject);\n\t\t\t\t}\n\n\t\t\t\ttargetObject.transform.matrix3D = mtx;\n\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (targetObject) {\n\t\t\tprops = this.parseProperties({1:this._matrixNrType, 2:this._matrixNrType, 3:this._matrixNrType, 4:AWDParser.UINT8});\n\n\t\t\ttargetObject.pivot = new Vector3D(props.get(1, 0), props.get(2, 0), props.get(3, 0));\n\t\t\ttargetObject.extra = this.parseUserAttributes();\n\n\t\t}\n\t\tthis._blocks[blockID].data = targetObject\n\n\t\tif (this._debug) {\n\t\t\tconsole.log(\"Parsed a CommandBlock: Name = '\" + name);\n\t\t}\n\n\t}\n\n\t//blockID 255\n\tprivate parseMetaData(blockID:number):void\n\t{\n\t\tvar props:AWDProperties = this.parseProperties({1:AWDParser.UINT32, 2:AWDParser.AWDSTRING, 3:AWDParser.AWDSTRING, 4:AWDParser.AWDSTRING, 5:AWDParser.AWDSTRING});\n\n\t\tif (this._debug) {\n\t\t\tconsole.log(\"Parsed a MetaDataBlock: TimeStamp = \" + props.get(1, 0));\n\t\t\tconsole.log(\" EncoderName = \" + props.get(2, \"unknown\"));\n\t\t\tconsole.log(\" EncoderVersion = \" + props.get(3, \"unknown\"));\n\t\t\tconsole.log(\" GeneratorName = \" + props.get(4, \"unknown\"));\n\t\t\tconsole.log(\" GeneratorVersion = \" + props.get(5, \"unknown\"));\n\t\t}\n\t}\n\n\t//blockID 254\n\tprivate parseNameSpace(blockID:number):void\n\t{\n\t\tvar id:number = this._newBlockBytes.readUnsignedByte();\n\t\tvar nameSpaceString:string = this.parseVarStr();\n\t\tif (this._debug)\n\t\t\tconsole.log(\"Parsed a NameSpaceBlock: ID = \" + id + \" | String = \" + nameSpaceString);\n\t}\n\n\t//--Parser UTILS---------------------------------------------------------------------------\n\n\t// this functions reads and creates a ShadowMethodMethod\n\tprivate parseShadowMethodList(light:LightBase, blockID:number):ShadowMethodBase\n\t{\n\n\t\tvar methodType:number = this._newBlockBytes.readUnsignedShort();\n\t\tvar shadowMethod:ShadowMethodBase;\n\t\tvar props:AWDProperties = this.parseProperties({1:AWDParser.BADDR, 2:AWDParser.BADDR, 3:AWDParser.BADDR, 101:this._propsNrType, 102:this._propsNrType, 103:this._propsNrType, 201:AWDParser.UINT32, 202:AWDParser.UINT32, 301:AWDParser.UINT16, 302:AWDParser.UINT16, 401:AWDParser.UINT8, 402:AWDParser.UINT8, 601:AWDParser.COLOR, 602:AWDParser.COLOR, 701:AWDParser.BOOL, 702:AWDParser.BOOL, 801:AWDParser.MTX4x4});\n\n\t\tvar targetID:number;\n\t\tvar returnedArray:Array\n\t\tswitch (methodType) {\n\t\t\t//\t\t\t\tcase 1001: //CascadeShadowMapMethod\n\t\t\t//\t\t\t\t\ttargetID = props.get(1, 0);\n\t\t\t//\t\t\t\t\treturnedArray = getAssetByID(targetID, [AssetType.SHADOW_MAP_METHOD]);\n\t\t\t//\t\t\t\t\tif (!returnedArray[0]) {\n\t\t\t//\t\t\t\t\t\t_blocks[blockID].addError(\"Could not find the ShadowBaseMethod (ID = \" + targetID + \" ) for this CascadeShadowMapMethod - ShadowMethod not created\");\n\t\t\t//\t\t\t\t\t\treturn shadowMethod;\n\t\t\t//\t\t\t\t\t}\n\t\t\t//\t\t\t\t\tshadowMethod = new CascadeShadowMapMethod(returnedArray[1]);\n\t\t\t//\t\t\t\t\tbreak;\n\t\t\tcase 1002: //ShadowNearMethod\n\t\t\t\ttargetID = props.get(1, 0);\n\t\t\t\treturnedArray = this.getAssetByID(targetID, [AssetType.SHADOW_MAP_METHOD]);\n\t\t\t\tif (!returnedArray[0]) {\n\t\t\t\t\tthis._blocks[blockID].addError(\"Could not find the ShadowBaseMethod (ID = \" + targetID + \" ) for this ShadowNearMethod - ShadowMethod not created\");\n\t\t\t\t\treturn shadowMethod;\n\t\t\t\t}\n\t\t\t\tshadowMethod = new ShadowNearMethod( returnedArray[1]);\n\t\t\t\tbreak;\n\t\t\tcase 1101: //ShadowFilteredMethod\n\n\t\t\t\tshadowMethod = new ShadowFilteredMethod( light);\n\t\t\t\t( shadowMethod).alpha = props.get(101, 1);\n\t\t\t\t( shadowMethod).epsilon = props.get(102, 0.002);\n\t\t\t\tbreak;\n\n\t\t\tcase 1102: //ShadowDitheredMethod\n\n\n\t\t\t\tshadowMethod = new ShadowDitheredMethod( light, props.get(201, 5));\n\t\t\t\t( shadowMethod).alpha = props.get(101, 1);\n\t\t\t\t( shadowMethod).epsilon = props.get(102, 0.002);\n\t\t\t\t( shadowMethod).range = props.get(103, 1);\n\n\t\t\t\tbreak;\n\t\t\tcase 1103: //ShadowSoftMethod\n\n\t\t\t\tshadowMethod = new ShadowSoftMethod( light, props.get(201, 5));\n\t\t\t\t( shadowMethod).alpha = props.get(101, 1);\n\t\t\t\t( shadowMethod).epsilon = props.get(102, 0.002);\n\t\t\t\t( shadowMethod).range = props.get(103, 1);\n\n\t\t\t\tbreak;\n\t\t\tcase 1104: //ShadowHardMethod\n\t\t\t\tshadowMethod = new ShadowHardMethod(light);\n\t\t\t\t( shadowMethod).alpha = props.get(101, 1);\n\t\t\t\t( shadowMethod).epsilon = props.get(102, 0.002);\n\t\t\t\tbreak;\n\n\t\t}\n\t\tthis.parseUserAttributes();\n\t\treturn shadowMethod;\n\t}\n\n\t//Block ID 101\n\tprivate parseSkeleton(blockID:number /*uint*/):void\n\t{\n\t\tvar name:string = this.parseVarStr();\n\t\tvar num_joints:number /*uint*/ = this._newBlockBytes.readUnsignedShort();\n\t\tvar skeleton:Skeleton = new Skeleton();\n\t\tthis.parseProperties(null); // Discard properties for now\t\t\n\n\t\tvar joints_parsed:number /*uint*/ = 0;\n\t\twhile (joints_parsed < num_joints) {\n\t\t\tvar joint:SkeletonJoint;\n\t\t\tvar ibp:Matrix3D;\n\t\t\t// Ignore joint id\n\t\t\tthis._newBlockBytes.readUnsignedShort();\n\t\t\tjoint = new SkeletonJoint();\n\t\t\tjoint.parentIndex = this._newBlockBytes.readUnsignedShort() - 1; // 0=null in AWD\n\t\t\tjoint.name = this.parseVarStr();\n\n\t\t\tibp = this.parseMatrix3D();\n\t\t\tjoint.inverseBindPose = ibp.rawData;\n\t\t\t// Ignore joint props/attributes for now\n\t\t\tthis.parseProperties(null);\n\t\t\tthis.parseUserAttributes();\n\t\t\tskeleton.joints.push(joint);\n\t\t\tjoints_parsed++;\n\t\t}\n\n\t\t// Discard attributes for now\n\t\tthis.parseUserAttributes();\n\t\tthis._pFinalizeAsset(skeleton, name);\n\t\tthis._blocks[blockID].data = skeleton;\n\t\tif (this._debug)\n\t\t\tconsole.log(\"Parsed a Skeleton: Name = \" + skeleton.name + \" | Number of Joints = \" + joints_parsed);\n\t}\n\n\t//Block ID = 102\n\tprivate parseSkeletonPose(blockID:number /*uint*/):void\n\t{\n\t\tvar name:string = this.parseVarStr();\n\t\tvar num_joints:number /*uint*/ = this._newBlockBytes.readUnsignedShort();\n\t\tthis.parseProperties(null); // Ignore properties for now\n\n\t\tvar pose:SkeletonPose = new SkeletonPose();\n\n\t\tvar joints_parsed:number /*uint*/ = 0;\n\t\twhile (joints_parsed < num_joints) {\n\t\t\tvar joint_pose:JointPose;\n\t\t\tvar has_transform:number /*uint*/;\n\t\t\tjoint_pose = new JointPose();\n\t\t\thas_transform = this._newBlockBytes.readUnsignedByte();\n\t\t\tif (has_transform == 1) {\n\t\t\t\tvar mtx_data:Array = this.parseMatrix43RawData();\n\n\t\t\t\tvar mtx:Matrix3D = new Matrix3D(mtx_data);\n\t\t\t\tjoint_pose.orientation.fromMatrix(mtx);\n\t\t\t\tjoint_pose.translation.copyFrom(mtx.position);\n\n\t\t\t\tpose.jointPoses[joints_parsed] = joint_pose;\n\t\t\t}\n\t\t\tjoints_parsed++;\n\t\t}\n\t\t// Skip attributes for now\n\t\tthis.parseUserAttributes();\n\t\tthis._pFinalizeAsset(pose, name);\n\t\tthis._blocks[blockID].data = pose;\n\t\tif (this._debug)\n\t\t\tconsole.log(\"Parsed a SkeletonPose: Name = \" + pose.name + \" | Number of Joints = \" + joints_parsed);\n\t}\n\n\t//blockID 103\n\tprivate parseSkeletonAnimation(blockID:number /*uint*/):void\n\t{\n\t\tvar frame_dur:number;\n\t\tvar pose_addr:number /*uint*/;\n\t\tvar name:string = this.parseVarStr();\n\t\tvar clip:SkeletonClipNode = new SkeletonClipNode();\n\t\tvar num_frames:number /*uint*/ = this._newBlockBytes.readUnsignedShort();\n\t\tthis.parseProperties(null); // Ignore properties for now\n\n\t\tvar frames_parsed:number /*uint*/ = 0;\n\t\tvar returnedArray:Array;\n\t\twhile (frames_parsed < num_frames) {\n\t\t\tpose_addr = this._newBlockBytes.readUnsignedInt();\n\t\t\tframe_dur = this._newBlockBytes.readUnsignedShort();\n\t\t\treturnedArray = this.getAssetByID(pose_addr, [AssetType.SKELETON_POSE]);\n\t\t\tif (!returnedArray[0])\n\t\t\t\tthis._blocks[blockID].addError(\"Could not find the SkeletonPose Frame # \" + frames_parsed + \" (ID = \" + pose_addr + \" ) for this SkeletonClipNode\");\n\t\t\telse\n\t\t\t\tclip.addFrame( this._blocks[pose_addr].data, frame_dur);\n\t\t\tframes_parsed++;\n\t\t}\n\t\tif (clip.frames.length == 0) {\n\t\t\tthis._blocks[blockID].addError(\"Could not this SkeletonClipNode, because no Frames where set.\");\n\t\t\treturn;\n\t\t}\n\t\t// Ignore attributes for now\n\t\tthis.parseUserAttributes();\n\t\tthis._pFinalizeAsset(clip, name);\n\t\tthis._blocks[blockID].data = clip;\n\t\tif (this._debug)\n\t\t\tconsole.log(\"Parsed a SkeletonClipNode: Name = \" + clip.name + \" | Number of Frames = \" + clip.frames.length);\n\t}\n\n\t//Block ID = 111 / Block ID = 112\n\tprivate parseMeshPoseAnimation(blockID:number /*uint*/, poseOnly:boolean = false):void\n\t{\n\t\tvar num_frames:number /*uint*/ = 1;\n\t\tvar num_submeshes:number /*uint*/;\n\t\tvar frames_parsed:number /*uint*/;\n\t\tvar subMeshParsed:number /*uint*/;\n\t\tvar frame_dur:number;\n\t\tvar x:number;\n\t\tvar y:number;\n\t\tvar z:number;\n\t\tvar str_len:number;\n\t\tvar str_end:number;\n\t\tvar geometry:Geometry;\n\t\tvar subGeom:TriangleSubGeometry;\n\t\tvar idx:number /*int*/ = 0;\n\t\tvar clip:VertexClipNode = new VertexClipNode();\n\t\tvar indices:Array /*uint*/;\n\t\tvar verts:Array;\n\t\tvar num_Streams:number /*int*/ = 0;\n\t\tvar streamsParsed:number /*int*/ = 0;\n\t\tvar streamtypes:Array /*int*/ = new Array() /*int*/;\n\t\tvar props:AWDProperties;\n\t\tvar thisGeo:Geometry;\n\t\tvar name:string = this.parseVarStr();\n\t\tvar geoAdress:number /*int*/ = this._newBlockBytes.readUnsignedInt();\n\t\tvar returnedArray:Array = this.getAssetByID(geoAdress, [AssetType.GEOMETRY]);\n\t\tif (!returnedArray[0]) {\n\t\t\tthis._blocks[blockID].addError(\"Could not find the target-Geometry-Object \" + geoAdress + \" ) for this VertexClipNode\");\n\t\t\treturn;\n\t\t}\n\t\tvar uvs:Array> = this.getUVForVertexAnimation(geoAdress);\n\t\tif (!poseOnly)\n\t\t\tnum_frames = this._newBlockBytes.readUnsignedShort();\n\n\t\tnum_submeshes = this._newBlockBytes.readUnsignedShort();\n\t\tnum_Streams = this._newBlockBytes.readUnsignedShort();\n\t\tstreamsParsed = 0;\n\t\twhile (streamsParsed < num_Streams) {\n\t\t\tstreamtypes.push(this._newBlockBytes.readUnsignedShort());\n\t\t\tstreamsParsed++;\n\t\t}\n\t\tprops = this.parseProperties({1:AWDParser.BOOL, 2:AWDParser.BOOL});\n\n\t\tclip.looping = props.get(1, true);\n\t\tclip.stitchFinalFrame = props.get(2, false);\n\n\t\tframes_parsed = 0;\n\t\twhile (frames_parsed < num_frames) {\n\t\t\tframe_dur = this._newBlockBytes.readUnsignedShort();\n\t\t\tgeometry = new Geometry();\n\t\t\tsubMeshParsed = 0;\n\t\t\twhile (subMeshParsed < num_submeshes) {\n\t\t\t\tstreamsParsed = 0;\n\t\t\t\tstr_len = this._newBlockBytes.readUnsignedInt();\n\t\t\t\tstr_end = this._newBlockBytes.position + str_len;\n\t\t\t\twhile (streamsParsed < num_Streams) {\n\t\t\t\t\tif (streamtypes[streamsParsed] == 1) {\n\t\t\t\t\t\tindices = ( returnedArray[1]).subGeometries[subMeshParsed].indices;\n\t\t\t\t\t\tverts = new Array();\n\t\t\t\t\t\tidx = 0;\n\t\t\t\t\t\twhile (this._newBlockBytes.position < str_end) {\n\t\t\t\t\t\t\tx = this.readNumber(this._accuracyGeo)\n\t\t\t\t\t\t\ty = this.readNumber(this._accuracyGeo)\n\t\t\t\t\t\t\tz = this.readNumber(this._accuracyGeo)\n\t\t\t\t\t\t\tverts[idx++] = x;\n\t\t\t\t\t\t\tverts[idx++] = y;\n\t\t\t\t\t\t\tverts[idx++] = z;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsubGeom = new TriangleSubGeometry(true);\n\t\t\t\t\t\tsubGeom.updateIndices(indices);\n\t\t\t\t\t\tsubGeom.updatePositions(verts);\n\t\t\t\t\t\tsubGeom.updateUVs(uvs[subMeshParsed]);\n\t\t\t\t\t\tsubGeom.updateVertexNormals(null);\n\t\t\t\t\t\tsubGeom.updateVertexTangents(null);\n\t\t\t\t\t\tsubGeom.autoDeriveNormals = false;\n\t\t\t\t\t\tsubGeom.autoDeriveTangents = false;\n\t\t\t\t\t\tsubMeshParsed++;\n\t\t\t\t\t\tgeometry.addSubGeometry(subGeom)\n\t\t\t\t\t} else\n\t\t\t\t\t\tthis._newBlockBytes.position = str_end;\n\t\t\t\t\tstreamsParsed++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tclip.addFrame(geometry, frame_dur);\n\t\t\tframes_parsed++;\n\t\t}\n\t\tthis.parseUserAttributes();\n\t\tthis._pFinalizeAsset(clip, name);\n\n\t\tthis._blocks[blockID].data = clip;\n\t\tif (this._debug)\n\t\t\tconsole.log(\"Parsed a VertexClipNode: Name = \" + clip.name + \" | Target-Geometry-Name = \" + ( returnedArray[1]).name + \" | Number of Frames = \" + clip.frames.length);\n\t}\n\n\t//BlockID 113\n\tprivate parseVertexAnimationSet(blockID:number /*uint*/):void\n\t{\n\t\tvar poseBlockAdress:number /*int*/\n\t\tvar outputString:string = \"\";\n\t\tvar name:string = this.parseVarStr();\n\t\tvar num_frames:number /*uint*/ = this._newBlockBytes.readUnsignedShort();\n\t\tvar props:AWDProperties = this.parseProperties({1:AWDParser.UINT16});\n\t\tvar frames_parsed:number /*uint*/ = 0;\n\t\tvar skeletonFrames:Array = new Array();\n\t\tvar vertexFrames:Array = new Array();\n\t\twhile (frames_parsed < num_frames) {\n\t\t\tposeBlockAdress = this._newBlockBytes.readUnsignedInt();\n\t\t\tvar returnedArray:Array = this.getAssetByID(poseBlockAdress, [AssetType.ANIMATION_NODE]);\n\t\t\tif (!returnedArray[0])\n\t\t\t\tthis._blocks[blockID].addError(\"Could not find the AnimationClipNode Nr \" + frames_parsed + \" ( \" + poseBlockAdress + \" ) for this AnimationSet\");\n\t\t\telse {\n\t\t\t\tif (returnedArray[1] instanceof VertexClipNode)\n\t\t\t\tvertexFrames.push(returnedArray[1])\n\t\t\t\tif (returnedArray[1] instanceof SkeletonClipNode)\n\t\t\t\tskeletonFrames.push(returnedArray[1])\n\t\t\t}\n\t\t\tframes_parsed++;\n\t\t}\n\t\tif ((vertexFrames.length == 0) && (skeletonFrames.length == 0)) {\n\t\t\tthis._blocks[blockID].addError(\"Could not create this AnimationSet, because it contains no animations\");\n\t\t\treturn;\n\t\t}\n\t\tthis.parseUserAttributes();\n\t\tif (vertexFrames.length > 0) {\n\t\t\tvar newVertexAnimationSet:VertexAnimationSet = new VertexAnimationSet();\n\t\t\tfor (var i:number /*int*/ = 0; i < vertexFrames.length; i++)\n\t\t\t\tnewVertexAnimationSet.addAnimation(vertexFrames[i]);\n\t\t\tthis._pFinalizeAsset(newVertexAnimationSet, name);\n\t\t\tthis._blocks[blockID].data = newVertexAnimationSet;\n\t\t\tif (this._debug)\n\t\t\t\tconsole.log(\"Parsed a VertexAnimationSet: Name = \" + name + \" | Animations = \" + newVertexAnimationSet.animations.length + \" | Animation-Names = \" + newVertexAnimationSet.animationNames.toString());\n\n\t\t} else if (skeletonFrames.length > 0) {\n\t\t\treturnedArray = this.getAssetByID(poseBlockAdress, [AssetType.ANIMATION_NODE]);\n\t\t\tvar newSkeletonAnimationSet:SkeletonAnimationSet = new SkeletonAnimationSet(props.get(1, 4)); //props.get(1,4));\n\t\t\tfor (var i:number /*int*/ = 0; i < skeletonFrames.length; i++)\n\t\t\t\tnewSkeletonAnimationSet.addAnimation(skeletonFrames[i]);\n\t\t\tthis._pFinalizeAsset(newSkeletonAnimationSet, name);\n\t\t\tthis._blocks[blockID].data = newSkeletonAnimationSet;\n\t\t\tif (this._debug)\n\t\t\t\tconsole.log(\"Parsed a SkeletonAnimationSet: Name = \" + name + \" | Animations = \" + newSkeletonAnimationSet.animations.length + \" | Animation-Names = \" + newSkeletonAnimationSet.animationNames.toString());\n\n\t\t}\n\t}\n\n\t//BlockID 122\n\tprivate parseAnimatorSet(blockID:number /*uint*/):void\n\t{\n\t\tvar targetMesh:Mesh;\n\t\tvar animSetBlockAdress:number /*int*/\n\t\tvar targetAnimationSet:AnimationSetBase;\n\t\tvar outputString:string = \"\";\n\t\tvar name:string = this.parseVarStr();\n\t\tvar type:number /*uint*/ = this._newBlockBytes.readUnsignedShort();\n\n\t\tvar props:AWDProperties = this.parseProperties({1:AWDParser.BADDR});\n\n\t\tanimSetBlockAdress = this._newBlockBytes.readUnsignedInt();\n\t\tvar targetMeshLength:number /*uint*/ = this._newBlockBytes.readUnsignedShort();\n\t\tvar meshAdresses:Array /*uint*/ = new Array() /*uint*/;\n\t\tfor (var i:number /*int*/ = 0; i < targetMeshLength; i++)\n\t\t\tmeshAdresses.push(this._newBlockBytes.readUnsignedInt());\n\n\t\tvar activeState:number /*uint*/ = this._newBlockBytes.readUnsignedShort();\n\t\tvar autoplay:boolean = ( this._newBlockBytes.readUnsignedByte() == 1 );\n\t\tthis.parseUserAttributes();\n\t\tthis.parseUserAttributes();\n\n\t\tvar returnedArray:Array;\n\t\tvar targetMeshes:Array = new Array();\n\n\t\tfor (i = 0; i < meshAdresses.length; i++) {\n\t\t\treturnedArray = this.getAssetByID(meshAdresses[i], [AssetType.MESH]);\n\t\t\tif (returnedArray[0])\n\t\t\t\ttargetMeshes.push( returnedArray[1]);\n\t\t}\n\t\treturnedArray = this.getAssetByID(animSetBlockAdress, [AssetType.ANIMATION_SET]);\n\t\tif (!returnedArray[0]) {\n\t\t\tthis._blocks[blockID].addError(\"Could not find the AnimationSet ( \" + animSetBlockAdress + \" ) for this Animator\");;\n\t\t\treturn\n\t\t}\n\t\ttargetAnimationSet = returnedArray[1];\n\t\tvar thisAnimator:AnimatorBase;\n\t\tif (type == 1) {\n\n\t\t\treturnedArray = this.getAssetByID(props.get(1, 0), [AssetType.SKELETON]);\n\t\t\tif (!returnedArray[0]) {\n\t\t\t\tthis._blocks[blockID].addError(\"Could not find the Skeleton ( \" + props.get(1, 0) + \" ) for this Animator\");\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthisAnimator = new SkeletonAnimator( targetAnimationSet, returnedArray[1]);\n\n\t\t} else if (type == 2)\n\t\t\tthisAnimator = new VertexAnimator( targetAnimationSet);\n\n\t\tthis._pFinalizeAsset(thisAnimator, name);\n\t\tthis._blocks[blockID].data = thisAnimator;\n\t\tfor (i = 0; i < targetMeshes.length; i++) {\n\t\t\tif (type == 1)\n\t\t\t\ttargetMeshes[i].animator = ( thisAnimator);\n\t\t\tif (type == 2)\n\t\t\t\ttargetMeshes[i].animator = ( thisAnimator);\n\n\t\t}\n\t\tif (this._debug)\n\t\t\tconsole.log(\"Parsed a Animator: Name = \" + name);\n\t}\n\t\n\t// this functions reads and creates a EffectMethod\n\tprivate parseSharedMethodList(blockID:number):EffectMethodBase\n\t{\n\n\t\tvar methodType:number = this._newBlockBytes.readUnsignedShort();\n\t\tvar effectMethodReturn:EffectMethodBase;\n\n\t\tvar props:AWDProperties = this.parseProperties({1:AWDParser.BADDR, 2:AWDParser.BADDR, 3:AWDParser.BADDR, 101:this._propsNrType, 102:this._propsNrType, 103:this._propsNrType, 104:this._propsNrType, 105:this._propsNrType, 106:this._propsNrType, 107:this._propsNrType, 201:AWDParser.UINT32, 202:AWDParser.UINT32, 301:AWDParser.UINT16, 302:AWDParser.UINT16, 401:AWDParser.UINT8, 402:AWDParser.UINT8, 601:AWDParser.COLOR, 602:AWDParser.COLOR, 701:AWDParser.BOOL, 702:AWDParser.BOOL});\n\t\tvar targetID:number;\n\t\tvar returnedArray:Array;\n\n\t\tswitch (methodType) {\n\t\t\t// Effect Methods\n\t\t\tcase 401: //ColorMatrix\n\t\t\t\teffectMethodReturn = new EffectColorMatrixMethod(props.get(101, new Array(0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)));\n\t\t\t\tbreak;\n\t\t\tcase 402: //ColorTransform\n\t\t\t\teffectMethodReturn = new EffectColorTransformMethod();\n\t\t\t\tvar offCol:number /*uint*/ = props.get(601, 0x00000000);\n\t\t\t\t( effectMethodReturn).colorTransform = new ColorTransform(props.get(102, 1), props.get(103, 1), props.get(104, 1), props.get(101, 1), ((offCol >> 16) & 0xFF), ((offCol >> 8) & 0xFF), (offCol & 0xFF), ((offCol >> 24) & 0xFF));\n\t\t\t\tbreak;\n\t\t\tcase 403: //EnvMap\n\n\t\t\t\ttargetID = props.get(1, 0);\n\t\t\t\tconsole.log('ENV MAP', targetID);\n\n\n\t\t\t\treturnedArray = this.getAssetByID(targetID, [ AssetType.TEXTURE ], \"CubeTexture\");\n\t\t\t\tif (!returnedArray[0])\n\t\t\t\t\tthis._blocks[blockID].addError(\"Could not find the EnvMap (ID = \" + targetID + \" ) for this EnvMapMethod\");\n\t\t\t\teffectMethodReturn = new EffectEnvMapMethod( returnedArray[1], props.get(101, 1));\n\t\t\t\ttargetID = props.get(2, 0);\n\t\t\t\tif (targetID > 0) {\n\t\t\t\t\treturnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]);\n\t\t\t\t\tif (!returnedArray[0])\n\t\t\t\t\t\tthis._blocks[blockID].addError(\"Could not find the Mask-texture (ID = \" + targetID + \" ) for this EnvMapMethod\");\n\n\t\t\t\t\t// Todo: test mask with EnvMapMethod\n\t\t\t\t\t//( effectMethodReturn).mask = returnedArray[1];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 404: //LightMapMethod\n\t\t\t\ttargetID = props.get(1, 0);\n\t\t\t\treturnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]);\n\t\t\t\tif (!returnedArray[0])\n\t\t\t\t\tthis._blocks[blockID].addError(\"Could not find the LightMap (ID = \" + targetID + \" ) for this LightMapMethod\");\n\t\t\t\teffectMethodReturn = new EffectLightMapMethod(returnedArray[1], this.blendModeDic[props.get(401, 10)]); //usesecondaryUV not set\n\t\t\t\tbreak;\n\t\t\t//\t\t\t\tcase 405: //ProjectiveTextureMethod\n\t\t\t//\t\t\t\t\ttargetID = props.get(1, 0);\n\t\t\t//\t\t\t\t\treturnedArray = getAssetByID(targetID, [AssetType.TEXTURE_PROJECTOR]);\n\t\t\t//\t\t\t\t\tif (!returnedArray[0])\n\t\t\t//\t\t\t\t\t\t_blocks[blockID].addError(\"Could not find the TextureProjector (ID = \" + targetID + \" ) for this ProjectiveTextureMethod\");\n\t\t\t//\t\t\t\t\teffectMethodReturn = new ProjectiveTextureMethod(returnedArray[1], blendModeDic[props.get(401, 10)]);\n\t\t\t//\t\t\t\t\tbreak;\n\t\t\tcase 406: //RimLightMethod\n\t\t\t\teffectMethodReturn = new EffectRimLightMethod(props.get(601, 0xffffff), props.get(101, 0.4), props.get(101, 2)); //blendMode\n\t\t\t\tbreak;\n\t\t\tcase 407: //AlphaMaskMethod\n\t\t\t\ttargetID = props.get(1, 0);\n\t\t\t\treturnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]);\n\t\t\t\tif (!returnedArray[0])\n\t\t\t\t\tthis._blocks[blockID].addError(\"Could not find the Alpha-texture (ID = \" + targetID + \" ) for this AlphaMaskMethod\");\n\t\t\t\teffectMethodReturn = new EffectAlphaMaskMethod(returnedArray[1], props.get(701, false));\n\t\t\t\tbreak;\n\t\t\t//\t\t\t\tcase 408: //RefractionEnvMapMethod\n\t\t\t//\t\t\t\t\ttargetID = props.get(1, 0);\n\t\t\t//\t\t\t\t\treturnedArray = getAssetByID(targetID, [AssetType.TEXTURE], \"CubeTexture\");\n\t\t\t//\t\t\t\t\tif (!returnedArray[0])\n\t\t\t//\t\t\t\t\t\t_blocks[blockID].addError(\"Could not find the EnvMap (ID = \" + targetID + \" ) for this RefractionEnvMapMethod\");\n\t\t\t//\t\t\t\t\teffectMethodReturn = new RefractionEnvMapMethod(returnedArray[1], props.get(101, 0.1), props.get(102, 0.01), props.get(103, 0.01), props.get(104, 0.01));\n\t\t\t//\t\t\t\t\tRefractionEnvMapMethod(effectMethodReturn).alpha = props.get(104, 1);\n\t\t\t//\t\t\t\t\tbreak;\n\t\t\t//\t\t\t\tcase 409: //OutlineMethod\n\t\t\t//\t\t\t\t\teffectMethodReturn = new OutlineMethod(props.get(601, 0x00000000), props.get(101, 1), props.get(701, true), props.get(702, false));\n\t\t\t//\t\t\t\t\tbreak;\n\t\t\tcase 410: //FresnelEnvMapMethod\n\t\t\t\ttargetID = props.get(1, 0);\n\t\t\t\treturnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE], \"CubeTexture\");\n\t\t\t\tif (!returnedArray[0])\n\t\t\t\t\tthis._blocks[blockID].addError(\"Could not find the EnvMap (ID = \" + targetID + \" ) for this FresnelEnvMapMethod\");\n\t\t\t\teffectMethodReturn = new EffectFresnelEnvMapMethod(returnedArray[1], props.get(101, 1));\n\t\t\t\tbreak;\n\t\t\tcase 411: //FogMethod\n\t\t\t\teffectMethodReturn = new EffectFogMethod(props.get(101, 0), props.get(102, 1000), props.get(601, 0x808080));\n\t\t\t\tbreak;\n\n\t\t}\n\t\tthis.parseUserAttributes();\n\t\treturn effectMethodReturn;\n\n\t}\n\n\tprivate parseUserAttributes():Object\n\t{\n\t\tvar attributes:Object;\n\t\tvar list_len:number;\n\t\tvar attibuteCnt:number;\n\n\t\tlist_len = this._newBlockBytes.readUnsignedInt();\n\n\t\tif (list_len > 0) {\n\n\t\t\tvar list_end:number;\n\n\t\t\tattributes = {};\n\n\t\t\tlist_end = this._newBlockBytes.position + list_len;\n\n\t\t\twhile (this._newBlockBytes.position < list_end) {\n\t\t\t\tvar ns_id:number;\n\t\t\t\tvar attr_key:string;\n\t\t\t\tvar attr_type:number;\n\t\t\t\tvar attr_len:number;\n\t\t\t\tvar attr_val:any;\n\n\t\t\t\t// TODO: Properly tend to namespaces in attributes\n\t\t\t\tns_id = this._newBlockBytes.readUnsignedByte();\n\t\t\t\tattr_key = this.parseVarStr();\n\t\t\t\tattr_type = this._newBlockBytes.readUnsignedByte();\n\t\t\t\tattr_len = this._newBlockBytes.readUnsignedInt();\n\n\t\t\t\tif ((this._newBlockBytes.position + attr_len) > list_end) {\n\t\t\t\t\tconsole.log(\" Error in reading attribute # \" + attibuteCnt + \" = skipped to end of attribute-list\");\n\t\t\t\t\tthis._newBlockBytes.position = list_end;\n\t\t\t\t\treturn attributes;\n\t\t\t\t}\n\n\t\t\t\tswitch (attr_type) {\n\t\t\t\t\tcase AWDParser.AWDSTRING:\n\t\t\t\t\t\tattr_val = this._newBlockBytes.readUTFBytes(attr_len);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase AWDParser.INT8:\n\t\t\t\t\t\tattr_val = this._newBlockBytes.readByte();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase AWDParser.INT16:\n\t\t\t\t\t\tattr_val = this._newBlockBytes.readShort();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase AWDParser.INT32:\n\t\t\t\t\t\tattr_val = this._newBlockBytes.readInt();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase AWDParser.BOOL:\n\t\t\t\t\tcase AWDParser.UINT8:\n\t\t\t\t\t\tattr_val = this._newBlockBytes.readUnsignedByte();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase AWDParser.UINT16:\n\t\t\t\t\t\tattr_val = this._newBlockBytes.readUnsignedShort();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase AWDParser.UINT32:\n\t\t\t\t\tcase AWDParser.BADDR:\n\t\t\t\t\t\tattr_val = this._newBlockBytes.readUnsignedInt();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase AWDParser.FLOAT32:\n\t\t\t\t\t\tattr_val = this._newBlockBytes.readFloat();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase AWDParser.FLOAT64:\n\t\t\t\t\t\tattr_val = this._newBlockBytes.readDouble();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tattr_val = 'unimplemented attribute type ' + attr_type;\n\t\t\t\t\t\tthis._newBlockBytes.position += attr_len;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (this._debug) {\n\t\t\t\t\tconsole.log(\"attribute = name: \" + attr_key + \" / value = \" + attr_val);\n\t\t\t\t}\n\n\t\t\t\tattributes[attr_key] = attr_val;\n\t\t\t\tattibuteCnt += 1;\n\t\t\t}\n\t\t}\n\n\t\treturn attributes;\n\t}\n\n\tprivate parseProperties(expected:Object):AWDProperties\n\t{\n\t\tvar list_end:number;\n\t\tvar list_len:number;\n\t\tvar propertyCnt:number = 0;\n\t\tvar props:AWDProperties = new AWDProperties();\n\n\t\tlist_len = this._newBlockBytes.readUnsignedInt();\n\t\tlist_end = this._newBlockBytes.position + list_len;\n\n\t\tif (expected) {\n\n\t\t\twhile (this._newBlockBytes.position < list_end) {\n\t\t\t\tvar len:number;\n\t\t\t\tvar key:number;\n\t\t\t\tvar type:number;\n\n\t\t\t\tkey = this._newBlockBytes.readUnsignedShort();\n\t\t\t\tlen = this._newBlockBytes.readUnsignedInt();\n\n\t\t\t\tif ((this._newBlockBytes.position + len) > list_end) {\n\t\t\t\t\tconsole.log(\" Error in reading property # \" + propertyCnt + \" = skipped to end of propertie-list\");\n\t\t\t\t\tthis._newBlockBytes.position = list_end;\n\t\t\t\t\treturn props;\n\t\t\t\t}\n\n\t\t\t\tif (expected.hasOwnProperty(key.toString())) {\n\t\t\t\t\ttype = expected[key];\n\t\t\t\t\tprops.set(key, this.parseAttrValue(type, len));\n\t\t\t\t} else {\n\t\t\t\t\tthis._newBlockBytes.position += len;\n\t\t\t\t}\n\n\t\t\t\tpropertyCnt += 1;\n\n\t\t\t}\n\t\t} else {\n\t\t\tthis._newBlockBytes.position = list_end;\n\t\t}\n\n\t\treturn props;\n\n\t}\n\n\tprivate parseAttrValue(type:number, len:number):any\n\t{\n\t\tvar elem_len:number;\n\t\tvar read_func:Function;\n\n\t\tswitch (type) {\n\n\t\t\tcase AWDParser.BOOL:\n\t\t\tcase AWDParser.INT8:\n\t\t\t\telem_len = 1;\n\t\t\t\tread_func = this._newBlockBytes.readByte;\n\t\t\t\tbreak;\n\n\t\t\tcase AWDParser.INT16:\n\t\t\t\telem_len = 2;\n\t\t\t\tread_func = this._newBlockBytes.readShort;\n\t\t\t\tbreak;\n\n\t\t\tcase AWDParser.INT32:\n\t\t\t\telem_len = 4;\n\t\t\t\tread_func = this._newBlockBytes.readInt;\n\t\t\t\tbreak;\n\n\t\t\tcase AWDParser.UINT8:\n\t\t\t\telem_len = 1;\n\t\t\t\tread_func = this._newBlockBytes.readUnsignedByte;\n\t\t\t\tbreak;\n\n\t\t\tcase AWDParser.UINT16:\n\t\t\t\telem_len = 2;\n\t\t\t\tread_func = this._newBlockBytes.readUnsignedShort;\n\t\t\t\tbreak;\n\n\t\t\tcase AWDParser.UINT32:\n\t\t\tcase AWDParser.COLOR:\n\t\t\tcase AWDParser.BADDR:\n\t\t\t\telem_len = 4;\n\t\t\t\tread_func = this._newBlockBytes.readUnsignedInt;\n\t\t\t\tbreak;\n\n\t\t\tcase AWDParser.FLOAT32:\n\t\t\t\telem_len = 4;\n\t\t\t\tread_func = this._newBlockBytes.readFloat;\n\t\t\t\tbreak;\n\n\t\t\tcase AWDParser.FLOAT64:\n\t\t\t\telem_len = 8;\n\t\t\t\tread_func = this._newBlockBytes.readDouble;\n\t\t\t\tbreak;\n\n\t\t\tcase AWDParser.AWDSTRING:\n\t\t\t\treturn this._newBlockBytes.readUTFBytes(len);\n\n\t\t\tcase AWDParser.VECTOR2x1:\n\t\t\tcase AWDParser.VECTOR3x1:\n\t\t\tcase AWDParser.VECTOR4x1:\n\t\t\tcase AWDParser.MTX3x2:\n\t\t\tcase AWDParser.MTX3x3:\n\t\t\tcase AWDParser.MTX4x3:\n\t\t\tcase AWDParser.MTX4x4:\n\t\t\t\telem_len = 8;\n\t\t\t\tread_func = this._newBlockBytes.readDouble;\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\tif (elem_len < len) {\n\t\t\tvar list:Array = [];\n\t\t\tvar num_read:number = 0;\n\t\t\tvar num_elems:number = len/elem_len;\n\n\t\t\twhile (num_read < num_elems) {\n\t\t\t\tlist.push(read_func.apply(this._newBlockBytes)); // list.push(read_func());\n\t\t\t\tnum_read++;\n\t\t\t}\n\n\t\t\treturn list;\n\t\t} else {\n\n\t\t\tvar val:any = read_func.apply(this._newBlockBytes);//read_func();\n\t\t\treturn val;\n\t\t}\n\t}\n\n\tprivate parseHeader():void\n\t{\n\t\tvar flags:number;\n\t\tvar body_len:number;\n\n\t\tthis._byteData.position = 3; // Skip magic string and parse version\n\n\t\tthis._version[0] = this._byteData.readUnsignedByte();\n\t\tthis._version[1] = this._byteData.readUnsignedByte();\n\n\t\tflags = this._byteData.readUnsignedShort(); // Parse bit flags\n\n\t\tthis._streaming = BitFlags.test(flags, BitFlags.FLAG1);\n\n\t\tif ((this._version[0] == 2) && (this._version[1] == 1)) {\n\t\t\tthis._accuracyMatrix = BitFlags.test(flags, BitFlags.FLAG2);\n\t\t\tthis._accuracyGeo = BitFlags.test(flags, BitFlags.FLAG3);\n\t\t\tthis._accuracyProps = BitFlags.test(flags, BitFlags.FLAG4);\n\t\t}\n\n\t\t// if we set _accuracyOnBlocks, the precision-values are read from each block-header.\n\n\t\t// set storagePrecision types\n\t\tthis._geoNrType = AWDParser.FLOAT32;\n\n\t\tif (this._accuracyGeo) {\n\t\t\tthis._geoNrType = AWDParser.FLOAT64;\n\t\t}\n\n\t\tthis._matrixNrType = AWDParser.FLOAT32;\n\n\t\tif (this._accuracyMatrix) {\n\t\t\tthis._matrixNrType = AWDParser.FLOAT64;\n\t\t}\n\n\t\tthis._propsNrType = AWDParser.FLOAT32;\n\n\t\tif (this._accuracyProps) {\n\t\t\tthis._propsNrType = AWDParser.FLOAT64;\n\t\t}\n\n\t\tthis._compression = this._byteData.readUnsignedByte(); // compression\n\n\t\tif (this._debug) {\n\t\t\tconsole.log(\"Import AWDFile of version = \" + this._version[0] + \" - \" + this._version[1]);\n\t\t\tconsole.log(\"Global Settings = Compression = \" + this._compression + \" | Streaming = \" + this._streaming + \" | Matrix-Precision = \" + this._accuracyMatrix + \" | Geometry-Precision = \" + this._accuracyGeo + \" | Properties-Precision = \" + this._accuracyProps);\n\t\t}\n\n\t\t// Check file integrity\n\t\tbody_len = this._byteData.readUnsignedInt();\n\t\tif (!this._streaming && body_len != this._byteData.getBytesAvailable()) {\n\t\t\tthis._pDieWithError('AWD2 body length does not match header integrity field');\n\t\t}\n\n\t}\n\t// Helper - functions\n\tprivate getUVForVertexAnimation(meshID:number /*uint*/):Array>\n\t{\n\t\tif (this._blocks[meshID].data instanceof Mesh)\n\t\tmeshID = this._blocks[meshID].geoID;\n\t\tif (this._blocks[meshID].uvsForVertexAnimation)\n\t\t\treturn this._blocks[meshID].uvsForVertexAnimation;\n\t\tvar geometry:Geometry = ( this._blocks[meshID].data);\n\t\tvar geoCnt:number /*int*/ = 0;\n\t\tvar ud:Array;\n\t\tvar uStride:number /*uint*/;\n\t\tvar uOffs:number /*uint*/;\n\t\tvar numPoints:number /*uint*/;\n\t\tvar i:number /*int*/;\n\t\tvar newUvs:Array;\n\t\tvar sub_geom:TriangleSubGeometry;\n\t\tthis._blocks[meshID].uvsForVertexAnimation = new Array>();\n\t\twhile (geoCnt < geometry.subGeometries.length) {\n\t\t\tnewUvs = new Array();\n\t\t\tsub_geom = geometry.subGeometries[geoCnt];\n\t\t\tnumPoints = sub_geom.numVertices;\n\t\t\tud = sub_geom.uvs;\n\t\t\tuStride = sub_geom.getStride(TriangleSubGeometry.UV_DATA);\n\t\t\tuOffs = sub_geom.getOffset(TriangleSubGeometry.UV_DATA);\n\t\t\tfor (i = 0; i < numPoints; i++) {\n\t\t\t\tnewUvs.push(ud[uOffs + i*uStride + 0]);\n\t\t\t\tnewUvs.push(ud[uOffs + i*uStride + 1]);\n\t\t\t}\n\t\t\tthis._blocks[meshID].uvsForVertexAnimation.push(newUvs);\n\t\t\tgeoCnt++;\n\t\t}\n\t\treturn this._blocks[meshID].uvsForVertexAnimation;\n\t}\n\t\n\tprivate parseVarStr():string\n\t{\n\n\t\tvar len:number = this._newBlockBytes.readUnsignedShort();\n\t\treturn this._newBlockBytes.readUTFBytes(len);\n\t}\n\n\tprivate getAssetByID(assetID:number, assetTypesToGet:Array, extraTypeInfo:string = \"SingleTexture\"):Array\n\t{\n\t\tvar returnArray:Array = new Array();\n\t\tvar typeCnt:number = 0;\n\t\tif (assetID > 0) {\n\t\t\tif (this._blocks[assetID]) {\n\t\t\t\tif (this._blocks[assetID].data) {\n\t\t\t\t\twhile (typeCnt < assetTypesToGet.length) {\n\n\t\t\t\t\t\tvar iasset:IAsset = this._blocks[assetID].data;\n\n\t\t\t\t\t\tif (iasset.assetType == assetTypesToGet[typeCnt]) {\n\t\t\t\t\t\t\t//if the right assetType was found\n\t\t\t\t\t\t\tif ((assetTypesToGet[typeCnt] == AssetType.TEXTURE) && (extraTypeInfo == \"CubeTexture\")) {\n\t\t\t\t\t\t\t\tif (this._blocks[assetID].data instanceof ImageCubeTexture) {\n\t\t\t\t\t\t\t\t\treturnArray.push(true);\n\t\t\t\t\t\t\t\t\treturnArray.push(this._blocks[assetID].data);\n\t\t\t\t\t\t\t\t\treturn returnArray;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ((assetTypesToGet[typeCnt] == AssetType.TEXTURE) && (extraTypeInfo == \"SingleTexture\")) {\n\t\t\t\t\t\t\t\tif (this._blocks[assetID].data instanceof ImageTexture) {\n\t\t\t\t\t\t\t\t\treturnArray.push(true);\n\t\t\t\t\t\t\t\t\treturnArray.push(this._blocks[assetID].data);\n\t\t\t\t\t\t\t\t\treturn returnArray;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturnArray.push(true);\n\t\t\t\t\t\t\t\treturnArray.push(this._blocks[assetID].data);\n\t\t\t\t\t\t\t\treturn returnArray;\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//if ((assetTypesToGet[typeCnt] == AssetType.GEOMETRY) && (IAsset(_blocks[assetID].data).assetType == AssetType.MESH)) {\n\t\t\t\t\t\tif ((assetTypesToGet[typeCnt] == AssetType.GEOMETRY) && (iasset.assetType == AssetType.MESH)) {\n\n\t\t\t\t\t\t\tvar mesh:Mesh = this._blocks[assetID].data\n\n\t\t\t\t\t\t\treturnArray.push(true);\n\t\t\t\t\t\t\treturnArray.push(mesh.geometry);\n\t\t\t\t\t\t\treturn returnArray;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttypeCnt++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// if the has not returned anything yet, the asset is not found, or the found asset is not the right type.\n\t\treturnArray.push(false);\n\t\treturnArray.push(this.getDefaultAsset(assetTypesToGet[0], extraTypeInfo));\n\t\treturn returnArray;\n\t}\n\n\tprivate getDefaultAsset(assetType:string, extraTypeInfo:string):IAsset\n\t{\n\t\tswitch (true) {\n\t\t\tcase (assetType == AssetType.TEXTURE):\n\t\t\t\tif (extraTypeInfo == \"CubeTexture\")\n\t\t\t\t\treturn this.getDefaultCubeTexture();\n\t\t\t\tif (extraTypeInfo == \"SingleTexture\")\n\t\t\t\t\treturn this.getDefaultTexture();\n\t\t\t\tbreak;\n\t\t\tcase (assetType == AssetType.MATERIAL):\n\t\t\t\treturn this.getDefaultMaterial()\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate getDefaultMaterial():IAsset\n\t{\n\t\tif (!this._defaultBitmapMaterial)\n\t\t\tthis._defaultBitmapMaterial = DefaultMaterialManager.getDefaultMaterial();\n\n\t\treturn this._defaultBitmapMaterial;\n\t}\n\n\tprivate getDefaultTexture():IAsset\n\t{\n\t\tif (!this._defaultTexture)\n\t\t\tthis._defaultTexture = DefaultMaterialManager.getDefaultTexture();\n\n\t\treturn this._defaultTexture;\n\n\t}\n\n\tprivate getDefaultCubeTexture():IAsset\n\t{\n\t\tif (!this._defaultCubeTexture) {\n\t\t\tvar defaultBitmap:BitmapData = DefaultMaterialManager.createCheckeredBitmapData();\n\n\t\t\tthis._defaultCubeTexture = new BitmapCubeTexture(defaultBitmap, defaultBitmap, defaultBitmap, defaultBitmap, defaultBitmap, defaultBitmap);\n\t\t\tthis._defaultCubeTexture.name = \"defaultCubeTexture\";\n\t\t}\n\n\t\treturn this._defaultCubeTexture;\n\t}\n\n\tprivate readNumber(precision:boolean = false):number\n\t{\n\t\tif (precision)\n\t\t\treturn this._newBlockBytes.readDouble();\n\t\treturn this._newBlockBytes.readFloat();\n\n\t}\n\n\tprivate parseMatrix3D():Matrix3D\n\t{\n\t\treturn new Matrix3D(this.parseMatrix43RawData());\n\t}\n\n\tprivate parseMatrix32RawData():Array\n\t{\n\t\tvar i:number;\n\t\tvar mtx_raw:Array = new Array(6);\n\t\tfor (i = 0; i < 6; i++) {\n\t\t\tmtx_raw[i] = this._newBlockBytes.readFloat();\n\t\t}\n\n\t\treturn mtx_raw;\n\t}\n\n\tprivate parseMatrix43RawData():Array\n\t{\n\t\tvar mtx_raw:Array = new Array(16);\n\n\t\tmtx_raw[0] = this.readNumber(this._accuracyMatrix);\n\t\tmtx_raw[1] = this.readNumber(this._accuracyMatrix);\n\t\tmtx_raw[2] = this.readNumber(this._accuracyMatrix);\n\t\tmtx_raw[3] = 0.0;\n\t\tmtx_raw[4] = this.readNumber(this._accuracyMatrix);\n\t\tmtx_raw[5] = this.readNumber(this._accuracyMatrix);\n\t\tmtx_raw[6] = this.readNumber(this._accuracyMatrix);\n\t\tmtx_raw[7] = 0.0;\n\t\tmtx_raw[8] = this.readNumber(this._accuracyMatrix);\n\t\tmtx_raw[9] = this.readNumber(this._accuracyMatrix);\n\t\tmtx_raw[10] = this.readNumber(this._accuracyMatrix);\n\t\tmtx_raw[11] = 0.0;\n\t\tmtx_raw[12] = this.readNumber(this._accuracyMatrix);\n\t\tmtx_raw[13] = this.readNumber(this._accuracyMatrix);\n\t\tmtx_raw[14] = this.readNumber(this._accuracyMatrix);\n\t\tmtx_raw[15] = 1.0;\n\n\t\t//TODO: fix max exporter to remove NaN values in joint 0 inverse bind pose\n\n\t\tif (isNaN(mtx_raw[0])) {\n\t\t\tmtx_raw[0] = 1;\n\t\t\tmtx_raw[1] = 0;\n\t\t\tmtx_raw[2] = 0;\n\t\t\tmtx_raw[4] = 0;\n\t\t\tmtx_raw[5] = 1;\n\t\t\tmtx_raw[6] = 0;\n\t\t\tmtx_raw[8] = 0;\n\t\t\tmtx_raw[9] = 0;\n\t\t\tmtx_raw[10] = 1;\n\t\t\tmtx_raw[12] = 0;\n\t\t\tmtx_raw[13] = 0;\n\t\t\tmtx_raw[14] = 0;\n\n\t\t}\n\n\t\treturn mtx_raw;\n\t}\n\n}\n\nexport = AWDParser;", + "import DisplayObjectContainer\t\t\t= require(\"awayjs-core/lib/containers/DisplayObjectContainer\");\nimport BitmapData\t\t\t\t\t\t= require(\"awayjs-core/lib/core/base/BitmapData\");\nimport DisplayObject\t\t\t\t\t= require(\"awayjs-core/lib/core/base/DisplayObject\");\nimport Geometry\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/base/Geometry\");\nimport TriangleSubGeometry\t\t\t\t= require(\"awayjs-core/lib/core/base/TriangleSubGeometry\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport URLLoaderDataFormat\t\t\t\t= require(\"awayjs-core/lib/core/net/URLLoaderDataFormat\");\nimport URLRequest\t\t\t\t\t\t= require(\"awayjs-core/lib/core/net/URLRequest\");\nimport Camera\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Camera\");\nimport Mesh\t\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Mesh\");\nimport ParserBase\t\t\t\t\t\t= require(\"awayjs-core/lib/parsers/ParserBase\");\nimport ParserUtils\t\t\t\t\t\t= require(\"awayjs-core/lib/parsers/ParserUtils\");\nimport ResourceDependency\t\t\t\t= require(\"awayjs-core/lib/parsers/ResourceDependency\");\nimport Texture2DBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/Texture2DBase\");\nimport ByteArray\t\t\t\t\t\t= require(\"awayjs-core/lib/utils/ByteArray\");\n\nimport DefaultMaterialManager\t\t\t= require(\"awayjs-stagegl/lib/materials/utils/DefaultMaterialManager\");\nimport TriangleMethodMaterial\t\t\t= require(\"awayjs-stagegl/lib/materials/TriangleMethodMaterial\");\nimport TriangleMaterialMode\t\t\t\t= require(\"awayjs-stagegl/lib/materials/TriangleMaterialMode\");\n\nimport VertexClipNode\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/VertexClipNode\");\nimport VertexAnimationSet\t\t\t\t= require(\"awayjs-renderergl/lib/animators/VertexAnimationSet\");\n\n/**\n * MD2Parser provides a parser for the MD2 data type.\n */\nclass MD2Parser extends ParserBase\n{\n\tpublic static FPS:number /*int*/ = 6;\n\n\tprivate _clipNodes:Object = new Object();\n\tprivate _byteData:ByteArray;\n\tprivate _startedParsing:boolean;\n\tprivate _parsedHeader:boolean;\n\tprivate _parsedUV:boolean;\n\tprivate _parsedFaces:boolean;\n\tprivate _parsedFrames:boolean;\n\n\tprivate _ident:number /*uint*/;\n\tprivate _version:number /*uint*/;\n\tprivate _skinWidth:number /*uint*/;\n\tprivate _skinHeight:number /*uint*/;\n\t//private _frameSize : number /*uint*/;\n\tprivate _numSkins:number /*uint*/;\n\tprivate _numVertices:number /*uint*/;\n\tprivate _numST:number /*uint*/;\n\tprivate _numTris:number /*uint*/;\n\t//private _numGlCmds : number /*uint*/;\n\tprivate _numFrames:number /*uint*/;\n\tprivate _offsetSkins:number /*uint*/;\n\tprivate _offsetST:number /*uint*/;\n\tprivate _offsetTris:number /*uint*/;\n\tprivate _offsetFrames:number /*uint*/;\n\t//private _offsetGlCmds : number /*uint*/;\n\tprivate _offsetEnd:number /*uint*/;\n\n\tprivate _uvIndices:Array;\n\tprivate _indices:Array /*uint*/;\n\tprivate _vertIndices:Array;\n\n\t// the current subgeom being built\n\tprivate _animationSet:VertexAnimationSet = new VertexAnimationSet();\n\tprivate _firstSubGeom:TriangleSubGeometry;\n\tprivate _uvs:Array;\n\tprivate _finalUV:Array;\n\n\tprivate _materialNames:Array;\n\tprivate _textureType:string;\n\tprivate _ignoreTexturePath:boolean;\n\tprivate _mesh:Mesh;\n\tprivate _geometry:Geometry;\n\n\tprivate materialFinal:boolean = false;\n\tprivate geoCreated:boolean = false;\n\n\t/**\n\t * Creates a new MD2Parser object.\n\t * @param textureType The extension of the texture (e.g. jpg/png/...)\n\t * @param ignoreTexturePath If true, the path of the texture is ignored\n\t */\n\tconstructor(textureType:string = \"jpg\", ignoreTexturePath:boolean = true)\n\t{\n\t\tsuper(URLLoaderDataFormat.ARRAY_BUFFER);\n\t\tthis._textureType = textureType;\n\t\tthis._ignoreTexturePath = ignoreTexturePath;\n\t}\n\n\t/**\n\t * Indicates whether or not a given file extension is supported by the parser.\n\t * @param extension The file extension of a potential file to be parsed.\n\t * @return Whether or not the given file type is supported.\n\t */\n\tpublic static supportsType(extension:string):boolean\n\t{\n\t\textension = extension.toLowerCase();\n\t\treturn extension == \"md2\";\n\t}\n\n\t/**\n\t * Tests whether a data block can be parsed by the parser.\n\t * @param data The data block to potentially be parsed.\n\t * @return Whether or not the given data is supported.\n\t */\n\tpublic static supportsData(data:any):boolean\n\t{\n\t\treturn (ParserUtils.toString(data, 4) == 'IDP2');\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iResolveDependency(resourceDependency:ResourceDependency):void\n\t{\n\t\tif (resourceDependency.assets.length != 1)\n\t\t\treturn;\n\n\t\tvar asset:Texture2DBase = resourceDependency.assets[0];\n\n\t\tif (asset) {\n\t\t\tvar material:TriangleMethodMaterial = new TriangleMethodMaterial(asset);\n\n\t\t\tif (this.materialMode >= 2)\n\t\t\t\tmaterial.materialMode = TriangleMaterialMode.MULTI_PASS;\n\n\t\t\t//add to the content property\n\t\t\t( this._pContent).addChild(this._mesh);\n\n\t\t\tmaterial.name = this._mesh.material.name;\n\t\t\tthis._mesh.material = material;\n\t\t\tthis._pFinalizeAsset(material);\n\t\t\tthis._pFinalizeAsset(this._mesh.geometry);\n\t\t\tthis._pFinalizeAsset(this._mesh);\n\t\t}\n\t\tthis.materialFinal = true;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iResolveDependencyFailure(resourceDependency:ResourceDependency):void\n\t{\n\t\t// apply system default\n\t\tif (this.materialMode < 2) {\n\t\t\tthis._mesh.material = DefaultMaterialManager.getDefaultMaterial();\n\t\t} else {\n\t\t\tthis._mesh.material = new TriangleMethodMaterial(DefaultMaterialManager.getDefaultTexture());\n\t\t\t( this._mesh.material).materialMode = TriangleMaterialMode.MULTI_PASS;\n\t\t}\n\n\t\t//add to the content property\n\t\t( this._pContent).addChild(this._mesh);\n\n\t\tthis._pFinalizeAsset(this._mesh.geometry);\n\t\tthis._pFinalizeAsset(this._mesh);\n\t\tthis.materialFinal = true;\n\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pProceedParsing():boolean\n\t{\n\t\tif (!this._startedParsing) {\n\t\t\tthis._byteData = this._pGetByteData();\n\t\t\tthis._startedParsing = true;\n\n\t\t\t// Reset bytearray read position (which may have been\n\t\t\t// moved forward by the supportsData() function.)\n\t\t\tthis._byteData.position = 0;\n\t\t}\n\n\t\twhile (this._pHasTime()) {\n\t\t\tif (!this._parsedHeader) {\n\t\t\t\t//----------------------------------------------------------------------------\n\t\t\t\t// LITTLE_ENDIAN - Default for ArrayBuffer / Not implemented in ByteArray\n\t\t\t\t//----------------------------------------------------------------------------\n\t\t\t\t//this._byteData.endian = Endian.LITTLE_ENDIAN;\n\n\t\t\t\t// TODO: Create a mesh only when encountered (if it makes sense\n\t\t\t\t// for this file format) and return it using this._pFinalizeAsset()\n\t\t\t\tthis._geometry = new Geometry();\n\t\t\t\tthis._mesh = new Mesh(this._geometry, null);\n\t\t\t\tif (this.materialMode < 2) {\n\t\t\t\t\tthis._mesh.material = DefaultMaterialManager.getDefaultMaterial();\n\t\t\t\t} else {\n\t\t\t\t\tthis._mesh.material = new TriangleMethodMaterial(DefaultMaterialManager.getDefaultTexture());\n\t\t\t\t\t( this._mesh.material).materialMode = TriangleMaterialMode.MULTI_PASS;\n\t\t\t\t}\n\n\t\t\t\t//_geometry.animation = new VertexAnimation(2, VertexAnimationMode.ABSOLUTE);\n\t\t\t\t//_animator = new VertexAnimator(VertexAnimationState(_mesh.animationState));\n\n\t\t\t\t// Parse header and decompress body\n\t\t\t\tthis.parseHeader();\n\t\t\t\tthis.parseMaterialNames();\n\t\t\t} else if (!this._parsedUV) {\n\t\t\t\tthis.parseUV();\n\t\t\t} else if (!this._parsedFaces) {\n\t\t\t\tthis.parseFaces();\n\t\t\t} else if (!this._parsedFrames) {\n\t\t\t\tthis.parseFrames();\n\t\t\t} else if ((this.geoCreated) && (this.materialFinal)) {\n\t\t\t\treturn ParserBase.PARSING_DONE;\n\t\t\t} else if (!this.geoCreated) {\n\t\t\t\tthis.geoCreated = true;\n\t\t\t\t//create default subgeometry\n\t\t\t\tthis._geometry.addSubGeometry(this._firstSubGeom.clone());\n\t\t\t\t// Force name to be chosen by this._pFinalizeAsset()\n\t\t\t\tthis._mesh.name = \"\";\n\t\t\t\tif (this.materialFinal) {\n\t\t\t\t\t//add to the content property\n\t\t\t\t\t( this._pContent).addChild(this._mesh);\n\n\t\t\t\t\tthis._pFinalizeAsset(this._mesh.geometry);\n\t\t\t\t\tthis._pFinalizeAsset(this._mesh);\n\t\t\t\t}\n\n\t\t\t\tthis._pPauseAndRetrieveDependencies();\n\t\t\t}\n\t\t}\n\n\t\treturn ParserBase.MORE_TO_PARSE;\n\t}\n\n\tpublic _pStartParsing(frameLimit:number)\n\t{\n\t\tsuper._pStartParsing(frameLimit);\n\n\t\t//create a content object for Loaders\n\t\tthis._pContent = new DisplayObjectContainer();\n\t}\n\n\t/**\n\t * Reads in all that MD2 Header data that is declared as private variables.\n\t * I know its a lot, and it looks ugly, but only way to do it in Flash\n\t */\n\tprivate parseHeader():void\n\t{\n\t\tthis._ident = this._byteData.readInt();\n\t\tthis._version = this._byteData.readInt();\n\t\tthis._skinWidth = this._byteData.readInt();\n\t\tthis._skinHeight = this._byteData.readInt();\n\t\t//skip this._frameSize\n\t\tthis._byteData.readInt();\n\t\tthis._numSkins = this._byteData.readInt();\n\t\tthis._numVertices = this._byteData.readInt();\n\t\tthis._numST = this._byteData.readInt();\n\t\tthis._numTris = this._byteData.readInt();\n\t\t//skip this._numGlCmds\n\t\tthis._byteData.readInt();\n\t\tthis._numFrames = this._byteData.readInt();\n\t\tthis._offsetSkins = this._byteData.readInt();\n\t\tthis._offsetST = this._byteData.readInt();\n\t\tthis._offsetTris = this._byteData.readInt();\n\t\tthis._offsetFrames = this._byteData.readInt();\n\t\t//skip this._offsetGlCmds\n\t\tthis._byteData.readInt();\n\t\tthis._offsetEnd = this._byteData.readInt();\n\n\t\tthis._parsedHeader = true;\n\t}\n\n\t/**\n\t * Parses the file names for the materials.\n\t */\n\tprivate parseMaterialNames():void\n\t{\n\t\tvar url:string;\n\t\tvar name:string;\n\t\tvar extIndex:number /*int*/;\n\t\tvar slashIndex:number /*int*/;\n\t\tthis._materialNames = new Array();\n\t\tthis._byteData.position = this._offsetSkins;\n\n\t\tvar regExp:RegExp = new RegExp(\"[^a-zA-Z0-9\\\\_\\/.]\", \"g\");\n\t\tfor (var i:number /*uint*/ = 0; i < this._numSkins; ++i) {\n\t\t\tname = this._byteData.readUTFBytes(64);\n\t\t\tname = name.replace(regExp, \"\");\n\t\t\textIndex = name.lastIndexOf(\".\");\n\t\t\tif (this._ignoreTexturePath)\n\t\t\t\tslashIndex = name.lastIndexOf(\"/\");\n\t\t\tif (name.toLowerCase().indexOf(\".jpg\") == -1 && name.toLowerCase().indexOf(\".png\") == -1) {\n\t\t\t\tname = name.substring(slashIndex + 1, extIndex);\n\t\t\t\turl = name + \".\" + this._textureType;\n\t\t\t} else {\n\t\t\t\turl = name;\n\t\t\t}\n\n\t\t\tthis._materialNames[i] = name;\n\n\t\t\t// only support 1 skin TODO: really?\n\t\t\tif (this.dependencies.length == 0)\n\t\t\t\tthis._pAddDependency(name, new URLRequest(url));\n\t\t}\n\n\t\tif (this._materialNames.length > 0)\n\t\t\tthis._mesh.material.name = this._materialNames[0]; else\n\t\t\tthis.materialFinal = true;\n\t}\n\n\t/**\n\t * Parses the uv data for the mesh.\n\t */\n\tprivate parseUV():void\n\t{\n\t\tvar j:number /*uint*/ = 0;\n\n\t\tthis._uvs = new Array(this._numST*2);\n\t\tthis._byteData.position = this._offsetST;\n\t\tfor (var i:number /*uint*/ = 0; i < this._numST; i++) {\n\t\t\tthis._uvs[j++] = this._byteData.readShort()/this._skinWidth;\n\t\t\tthis._uvs[j++] = this._byteData.readShort()/this._skinHeight;\n\t\t}\n\n\t\tthis._parsedUV = true;\n\t}\n\n\t/**\n\t * Parses unique indices for the faces.\n\t */\n\tprivate parseFaces():void\n\t{\n\t\tvar a:number /*uint*/, b:number /*uint*/, c:number /*uint*/, ta:number /*uint*/, tb:number /*uint*/, tc:number /*uint*/;\n\t\tvar i:number /*uint*/;\n\n\t\tthis._vertIndices = new Array();\n\t\tthis._uvIndices = new Array();\n\t\tthis._indices = new Array() /*uint*/;\n\n\t\tthis._byteData.position = this._offsetTris;\n\n\t\tfor (i = 0; i < this._numTris; i++) {\n\t\t\t//collect vertex indices\n\t\t\ta = this._byteData.readUnsignedShort();\n\t\t\tb = this._byteData.readUnsignedShort();\n\t\t\tc = this._byteData.readUnsignedShort();\n\n\t\t\t//collect uv indices\n\t\t\tta = this._byteData.readUnsignedShort();\n\t\t\ttb = this._byteData.readUnsignedShort();\n\t\t\ttc = this._byteData.readUnsignedShort();\n\n\t\t\tthis.addIndex(a, ta);\n\t\t\tthis.addIndex(b, tb);\n\t\t\tthis.addIndex(c, tc);\n\t\t}\n\n\t\tvar len:number /*uint*/ = this._uvIndices.length;\n\t\tthis._finalUV = new Array(len*2);\n\n\t\tfor (i = 0; i < len; ++i) {\n\t\t\tthis._finalUV[i << 1] = this._uvs[this._uvIndices[i] << 1];\n\t\t\tthis._finalUV[(i << 1) + 1] = this._uvs[(this._uvIndices[i] << 1) + 1];\n\t\t}\n\n\t\tthis._parsedFaces = true;\n\t}\n\n\t/**\n\t * Adds a face index to the list if it doesn't exist yet, based on vertexIndex and uvIndex, and adds the\n\t * corresponding vertex and uv data in the correct location.\n\t * @param vertexIndex The original index in the vertex list.\n\t * @param uvIndex The original index in the uv list.\n\t */\n\tprivate addIndex(vertexIndex:number /*uint*/, uvIndex:number /*uint*/):void\n\t{\n\t\tvar index:number /*int*/ = this.findIndex(vertexIndex, uvIndex);\n\n\t\tif (index == -1) {\n\t\t\tthis._indices.push(this._vertIndices.length);\n\t\t\tthis._vertIndices.push(vertexIndex);\n\t\t\tthis._uvIndices.push(uvIndex);\n\t\t} else\n\t\t\tthis._indices.push(index);\n\t}\n\n\t/**\n\t * Finds the final index corresponding to the original MD2's vertex and uv indices. Returns -1 if it wasn't added yet.\n\t * @param vertexIndex The original index in the vertex list.\n\t * @param uvIndex The original index in the uv list.\n\t * @return The index of the final mesh corresponding to the original vertex and uv index. -1 if it doesn't exist yet.\n\t */\n\tprivate findIndex(vertexIndex:number /*uint*/, uvIndex:number /*uint*/):number /*int*/\n\t{\n\t\tvar len:number /*uint*/ = this._vertIndices.length;\n\n\t\tfor (var i:number /*uint*/ = 0; i < len; ++i) {\n\t\t\tif (this._vertIndices[i] == vertexIndex && this._uvIndices[i] == uvIndex)\n\t\t\t\treturn i;\n\t\t}\n\n\t\treturn -1;\n\t}\n\n\t/**\n\t * Parses all the frame geometries.\n\t */\n\tprivate parseFrames():void\n\t{\n\t\tvar sx:number, sy:number, sz:number;\n\t\tvar tx:number, ty:number, tz:number;\n\t\tvar geometry:Geometry;\n\t\tvar subGeom:TriangleSubGeometry;\n\t\tvar vertLen:number /*uint*/ = this._vertIndices.length;\n\t\tvar fvertices:Array;\n\t\tvar tvertices:Array;\n\t\tvar i:number /*uint*/, j:number /*int*/, k:number /*uint*/;\n\t\t//var ch : number /*uint*/;\n\t\tvar name:string = \"\";\n\t\tvar prevClip:VertexClipNode = null;\n\n\t\tthis._byteData.position = this._offsetFrames;\n\n\t\tfor (i = 0; i < this._numFrames; i++) {\n\n\t\t\ttvertices = new Array();\n\t\t\tfvertices = new Array(vertLen*3);\n\n\t\t\tsx = this._byteData.readFloat();\n\t\t\tsy = this._byteData.readFloat();\n\t\t\tsz = this._byteData.readFloat();\n\n\t\t\ttx = this._byteData.readFloat();\n\t\t\tty = this._byteData.readFloat();\n\t\t\ttz = this._byteData.readFloat();\n\n\t\t\tname = this.readFrameName();\n\n\t\t\t// Note, the extra data.position++ in the for loop is there\n\t\t\t// to skip over a byte that holds the \"vertex normal index\"\n\t\t\tfor (j = 0; j < this._numVertices; j++, this._byteData.position++)\n\t\t\t\ttvertices.push(sx*this._byteData.readUnsignedByte() + tx, sy*this._byteData.readUnsignedByte() + ty, sz*this._byteData.readUnsignedByte() + tz);\n\n\t\t\tk = 0;\n\t\t\tfor (j = 0; j < vertLen; j++) {\n\t\t\t\tfvertices[k++] = tvertices[this._vertIndices[j]*3];\n\t\t\t\tfvertices[k++] = tvertices[this._vertIndices[j]*3 + 2];\n\t\t\t\tfvertices[k++] = tvertices[this._vertIndices[j]*3 + 1];\n\t\t\t}\n\n\t\t\tsubGeom = new TriangleSubGeometry(true);\n\n\t\t\tif (this._firstSubGeom == null)\n\t\t\t\tthis._firstSubGeom = subGeom;\n\n\t\t\tgeometry = new Geometry();\n\t\t\tgeometry.addSubGeometry(subGeom);\n\n\t\t\tsubGeom.updateIndices(this._indices);\n\t\t\tsubGeom.updatePositions(fvertices);\n\t\t\tsubGeom.updateUVs(this._finalUV);\n\t\t\tsubGeom.vertexNormals;\n\t\t\tsubGeom.vertexTangents;\n\t\t\tsubGeom.autoDeriveNormals = false;\n\t\t\tsubGeom.autoDeriveTangents = false;\n\n\t\t\tvar clip:VertexClipNode = this._clipNodes[name];\n\n\t\t\tif (!clip) {\n\t\t\t\t// If another sequence was parsed before this one, starting\n\t\t\t\t// a new state means the previous one is complete and can\n\t\t\t\t// hence be finalized.\n\t\t\t\tif (prevClip) {\n\t\t\t\t\tthis._pFinalizeAsset(prevClip);\n\t\t\t\t\tthis._animationSet.addAnimation(prevClip);\n\t\t\t\t}\n\n\t\t\t\tclip = new VertexClipNode();\n\t\t\t\tclip.name = name;\n\t\t\t\tclip.stitchFinalFrame = true;\n\n\t\t\t\tthis._clipNodes[name] = clip;\n\n\t\t\t\tprevClip = clip;\n\t\t\t}\n\t\t\tclip.addFrame(geometry, 1000/MD2Parser.FPS);\n\t\t}\n\n\t\t// Finalize the last state\n\t\tif (prevClip) {\n\t\t\tthis._pFinalizeAsset(prevClip);\n\t\t\tthis._animationSet.addAnimation(prevClip);\n\t\t}\n\n\t\t// Force this._pFinalizeAsset() to decide name\n\t\tthis._pFinalizeAsset(this._animationSet);\n\n\t\tthis._parsedFrames = true;\n\t}\n\n\tprivate readFrameName():string\n\t{\n\t\tvar name:string = \"\";\n\t\tvar k:number /*uint*/ = 0;\n\t\tfor (var j:number /*uint*/ = 0; j < 16; j++) {\n\t\t\tvar ch:number /*uint*/ = this._byteData.readUnsignedByte();\n\n\t\t\tif (Math.floor(ch) > 0x39 && Math.floor(ch) <= 0x7A && k == 0)\n\t\t\t\tname += String.fromCharCode(ch);\n\n\t\t\tif (Math.floor(ch) >= 0x30 && Math.floor(ch) <= 0x39)\n\t\t\t\tk++;\n\t\t}\n\t\treturn name;\n\t}\n}\n\nexport = MD2Parser;", + "import Quaternion\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Quaternion\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport URLLoaderDataFormat\t\t\t\t= require(\"awayjs-core/lib/core/net/URLLoaderDataFormat\");\nimport ParserBase\t\t\t\t\t\t= require(\"awayjs-core/lib/parsers/ParserBase\");\n\nimport JointPose\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/JointPose\");\nimport SkeletonPose\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/SkeletonPose\");\nimport SkeletonClipNode\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/nodes/SkeletonClipNode\");\nimport BaseFrameData\t\t\t\t\t= require(\"awayjs-renderergl/lib/parsers/data/BaseFrameData\");\nimport BoundsData\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/parsers/data/BoundsData\");\nimport FrameData\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/parsers/data/FrameData\");\nimport HierarchyData\t\t\t\t\t= require(\"awayjs-renderergl/lib/parsers/data/HierarchyData\");\n\n/**\n * MD5AnimParser provides a parser for the md5anim data type, providing an animation sequence for the md5 format.\n *\n * todo: optimize\n */\nclass MD5AnimParser extends ParserBase\n{\n\tprivate _textData:string;\n\tprivate _startedParsing:boolean;\n\tpublic static VERSION_TOKEN:string = \"MD5Version\";\n\tpublic static COMMAND_LINE_TOKEN:string = \"commandline\";\n\tpublic static NUM_FRAMES_TOKEN:string = \"numFrames\";\n\tpublic static NUM_JOINTS_TOKEN:string = \"numJoints\";\n\tpublic static FRAME_RATE_TOKEN:string = \"frameRate\";\n\tpublic static NUM_ANIMATED_COMPONENTS_TOKEN:string = \"numAnimatedComponents\";\n\n\tpublic static HIERARCHY_TOKEN:string = \"hierarchy\";\n\tpublic static BOUNDS_TOKEN:string = \"bounds\";\n\tpublic static BASE_FRAME_TOKEN:string = \"baseframe\";\n\tpublic static FRAME_TOKEN:string = \"frame\";\n\n\tpublic static COMMENT_TOKEN:string = \"//\";\n\n\tprivate _parseIndex:number /*int*/ = 0;\n\tprivate _reachedEOF:boolean;\n\tprivate _line:number /*int*/ = 0;\n\tprivate _charLineIndex:number /*int*/ = 0;\n\tprivate _version:number /*int*/;\n\tprivate _frameRate:number /*int*/;\n\tprivate _numFrames:number /*int*/;\n\tprivate _numJoints:number /*int*/;\n\tprivate _numAnimatedComponents:number /*int*/;\n\n\tprivate _hierarchy:Array;\n\tprivate _bounds:Array;\n\tprivate _frameData:Array;\n\tprivate _baseFrameData:Array;\n\n\tprivate _rotationQuat:Quaternion;\n\tprivate _clip:SkeletonClipNode;\n\n\t/**\n\t * Creates a new MD5AnimParser object.\n\t * @param uri The url or id of the data or file to be parsed.\n\t * @param extra The holder for extra contextual data that the parser might need.\n\t */\n\tconstructor(additionalRotationAxis:Vector3D = null, additionalRotationRadians:number = 0)\n\t{\n\t\tsuper(URLLoaderDataFormat.TEXT);\n\t\tthis._rotationQuat = new Quaternion();\n\t\tvar t1:Quaternion = new Quaternion();\n\t\tvar t2:Quaternion = new Quaternion();\n\n\t\tt1.fromAxisAngle(Vector3D.X_AXIS, -Math.PI*.5);\n\t\tt2.fromAxisAngle(Vector3D.Y_AXIS, -Math.PI*.5);\n\n\t\tthis._rotationQuat.multiply(t2, t1);\n\n\t\tif (additionalRotationAxis) {\n\t\t\tthis._rotationQuat.multiply(t2, t1);\n\t\t\tt1.fromAxisAngle(additionalRotationAxis, additionalRotationRadians);\n\t\t\tthis._rotationQuat.multiply(t1, this._rotationQuat);\n\t\t}\n\t}\n\n\t/**\n\t * Indicates whether or not a given file extension is supported by the parser.\n\t * @param extension The file extension of a potential file to be parsed.\n\t * @return Whether or not the given file type is supported.\n\t */\n\tpublic static supportsType(extension:string):boolean\n\t{\n\t\textension = extension.toLowerCase();\n\t\treturn extension == \"md5anim\";\n\t}\n\n\t/**\n\t * Tests whether a data block can be parsed by the parser.\n\t * @param data The data block to potentially be parsed.\n\t * @return Whether or not the given data is supported.\n\t */\n\tpublic static supportsData(data:any):boolean\n\t{\n\t\treturn false;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pProceedParsing():boolean\n\t{\n\t\tvar token:string;\n\n\t\tif (!this._startedParsing) {\n\t\t\tthis._textData = this._pGetTextData();\n\t\t\tthis._startedParsing = true;\n\t\t}\n\n\t\twhile (this._pHasTime()) {\n\t\t\ttoken = this.getNextToken();\n\t\t\tswitch (token) {\n\t\t\t\tcase MD5AnimParser.COMMENT_TOKEN:\n\t\t\t\t\tthis.ignoreLine();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"\":\n\t\t\t\t\t// can occur at the end of a file\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5AnimParser.VERSION_TOKEN:\n\t\t\t\t\tthis._version = this.getNextInt();\n\t\t\t\t\tif (this._version != 10)\n\t\t\t\t\t\tthrow new Error(\"Unknown version number encountered!\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5AnimParser.COMMAND_LINE_TOKEN:\n\t\t\t\t\tthis.parseCMD();\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5AnimParser.NUM_FRAMES_TOKEN:\n\t\t\t\t\tthis._numFrames = this.getNextInt();\n\t\t\t\t\tthis._bounds = new Array();\n\t\t\t\t\tthis._frameData = new Array();\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5AnimParser.NUM_JOINTS_TOKEN:\n\t\t\t\t\tthis._numJoints = this.getNextInt();\n\t\t\t\t\tthis._hierarchy = new Array(this._numJoints);\n\t\t\t\t\tthis._baseFrameData = new Array(this._numJoints);\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5AnimParser.FRAME_RATE_TOKEN:\n\t\t\t\t\tthis._frameRate = this.getNextInt();\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5AnimParser.NUM_ANIMATED_COMPONENTS_TOKEN:\n\t\t\t\t\tthis._numAnimatedComponents = this.getNextInt();\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5AnimParser.HIERARCHY_TOKEN:\n\t\t\t\t\tthis.parseHierarchy();\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5AnimParser.BOUNDS_TOKEN:\n\t\t\t\t\tthis.parseBounds();\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5AnimParser.BASE_FRAME_TOKEN:\n\t\t\t\t\tthis.parseBaseFrame();\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5AnimParser.FRAME_TOKEN:\n\t\t\t\t\tthis.parseFrame();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif (!this._reachedEOF)\n\t\t\t\t\t\tthis.sendUnknownKeywordError();\n\t\t\t}\n\n\t\t\tif (this._reachedEOF) {\n\t\t\t\tthis._clip = new SkeletonClipNode();\n\t\t\t\tthis.translateClip();\n\t\t\t\tthis._pFinalizeAsset(this._clip);\n\t\t\t\treturn ParserBase.PARSING_DONE;\n\t\t\t}\n\t\t}\n\t\treturn ParserBase.MORE_TO_PARSE;\n\t}\n\n\t/**\n\t * Converts all key frame data to an SkinnedAnimationSequence.\n\t */\n\tprivate translateClip():void\n\t{\n\t\tfor (var i:number /*int*/ = 0; i < this._numFrames; ++i)\n\t\t\tthis._clip.addFrame(this.translatePose(this._frameData[i]), 1000/this._frameRate);\n\t}\n\n\t/**\n\t * Converts a single key frame data to a SkeletonPose.\n\t * @param frameData The actual frame data.\n\t * @return A SkeletonPose containing the frame data's pose.\n\t */\n\tprivate translatePose(frameData:FrameData):SkeletonPose\n\t{\n\t\tvar hierarchy:HierarchyData;\n\t\tvar pose:JointPose;\n\t\tvar base:BaseFrameData;\n\t\tvar flags:number /*int*/;\n\t\tvar j:number /*int*/;\n\t\tvar translate:Vector3D = new Vector3D();\n\t\tvar orientation:Quaternion = new Quaternion();\n\t\tvar components:Array = frameData.components;\n\t\tvar skelPose:SkeletonPose = new SkeletonPose();\n\t\tvar jointPoses:Array = skelPose.jointPoses;\n\n\t\tfor (var i:number /*int*/ = 0; i < this._numJoints; ++i) {\n\t\t\tj = 0;\n\t\t\tpose = new JointPose();\n\t\t\thierarchy = this._hierarchy[i];\n\t\t\tbase = this._baseFrameData[i];\n\t\t\tflags = hierarchy.flags;\n\t\t\ttranslate.x = base.position.x;\n\t\t\ttranslate.y = base.position.y;\n\t\t\ttranslate.z = base.position.z;\n\t\t\torientation.x = base.orientation.x;\n\t\t\torientation.y = base.orientation.y;\n\t\t\torientation.z = base.orientation.z;\n\n\t\t\tif (flags & 1)\n\t\t\t\ttranslate.x = components[hierarchy.startIndex + (j++)];\n\t\t\tif (flags & 2)\n\t\t\t\ttranslate.y = components[hierarchy.startIndex + (j++)];\n\t\t\tif (flags & 4)\n\t\t\t\ttranslate.z = components[hierarchy.startIndex + (j++)];\n\t\t\tif (flags & 8)\n\t\t\t\torientation.x = components[hierarchy.startIndex + (j++)];\n\t\t\tif (flags & 16)\n\t\t\t\torientation.y = components[hierarchy.startIndex + (j++)];\n\t\t\tif (flags & 32)\n\t\t\t\torientation.z = components[hierarchy.startIndex + (j++)];\n\n\t\t\tvar w:number = 1 - orientation.x*orientation.x - orientation.y*orientation.y - orientation.z*orientation.z;\n\t\t\torientation.w = w < 0? 0 : -Math.sqrt(w);\n\n\t\t\tif (hierarchy.parentIndex < 0) {\n\t\t\t\tpose.orientation.multiply(this._rotationQuat, orientation);\n\t\t\t\tpose.translation = this._rotationQuat.rotatePoint(translate);\n\t\t\t} else {\n\t\t\t\tpose.orientation.copyFrom(orientation);\n\t\t\t\tpose.translation.x = translate.x;\n\t\t\t\tpose.translation.y = translate.y;\n\t\t\t\tpose.translation.z = translate.z;\n\t\t\t}\n\t\t\tpose.orientation.y = -pose.orientation.y;\n\t\t\tpose.orientation.z = -pose.orientation.z;\n\t\t\tpose.translation.x = -pose.translation.x;\n\n\t\t\tjointPoses[i] = pose;\n\t\t}\n\n\t\treturn skelPose;\n\t}\n\n\t/**\n\t * Parses the skeleton's hierarchy data.\n\t */\n\tprivate parseHierarchy():void\n\t{\n\t\tvar ch:string;\n\t\tvar data:HierarchyData;\n\t\tvar token:string = this.getNextToken();\n\t\tvar i:number /*int*/ = 0;\n\n\t\tif (token != \"{\")\n\t\t\tthis.sendUnknownKeywordError();\n\n\t\tdo {\n\t\t\tif (this._reachedEOF)\n\t\t\t\tthis.sendEOFError();\n\t\t\tdata = new HierarchyData();\n\t\t\tdata.name = this.parseLiteralstring();\n\t\t\tdata.parentIndex = this.getNextInt();\n\t\t\tdata.flags = this.getNextInt();\n\t\t\tdata.startIndex = this.getNextInt();\n\t\t\tthis._hierarchy[i++] = data;\n\n\t\t\tch = this.getNextChar();\n\n\t\t\tif (ch == \"/\") {\n\t\t\t\tthis.putBack();\n\t\t\t\tch = this.getNextToken();\n\t\t\t\tif (ch == MD5AnimParser.COMMENT_TOKEN)\n\t\t\t\t\tthis.ignoreLine();\n\t\t\t\tch = this.getNextChar();\n\t\t\t}\n\n\t\t\tif (ch != \"}\")\n\t\t\t\tthis.putBack();\n\n\t\t} while (ch != \"}\");\n\t}\n\n\t/**\n\t * Parses frame bounds.\n\t */\n\tprivate parseBounds():void\n\t{\n\t\tvar ch:string;\n\t\tvar data:BoundsData;\n\t\tvar token:string = this.getNextToken();\n\t\tvar i:number /*int*/ = 0;\n\n\t\tif (token != \"{\")\n\t\t\tthis.sendUnknownKeywordError();\n\n\t\tdo {\n\t\t\tif (this._reachedEOF)\n\t\t\t\tthis.sendEOFError();\n\t\t\tdata = new BoundsData();\n\t\t\tdata.min = this.parseVector3D();\n\t\t\tdata.max = this.parseVector3D();\n\t\t\tthis._bounds[i++] = data;\n\n\t\t\tch = this.getNextChar();\n\n\t\t\tif (ch == \"/\") {\n\t\t\t\tthis.putBack();\n\t\t\t\tch = this.getNextToken();\n\t\t\t\tif (ch == MD5AnimParser.COMMENT_TOKEN)\n\t\t\t\t\tthis.ignoreLine();\n\t\t\t\tch = this.getNextChar();\n\t\t\t}\n\n\t\t\tif (ch != \"}\")\n\t\t\t\tthis.putBack();\n\n\t\t} while (ch != \"}\");\n\t}\n\n\t/**\n\t * Parses the base frame.\n\t */\n\tprivate parseBaseFrame():void\n\t{\n\t\tvar ch:string;\n\t\tvar data:BaseFrameData;\n\t\tvar token:string = this.getNextToken();\n\t\tvar i:number /*int*/ = 0;\n\n\t\tif (token != \"{\")\n\t\t\tthis.sendUnknownKeywordError();\n\n\t\tdo {\n\t\t\tif (this._reachedEOF)\n\t\t\t\tthis.sendEOFError();\n\t\t\tdata = new BaseFrameData();\n\t\t\tdata.position = this.parseVector3D();\n\t\t\tdata.orientation = this.parseQuaternion();\n\t\t\tthis._baseFrameData[i++] = data;\n\n\t\t\tch = this.getNextChar();\n\n\t\t\tif (ch == \"/\") {\n\t\t\t\tthis.putBack();\n\t\t\t\tch = this.getNextToken();\n\t\t\t\tif (ch == MD5AnimParser.COMMENT_TOKEN)\n\t\t\t\t\tthis.ignoreLine();\n\t\t\t\tch = this.getNextChar();\n\t\t\t}\n\n\t\t\tif (ch != \"}\")\n\t\t\t\tthis.putBack();\n\n\t\t} while (ch != \"}\");\n\t}\n\n\t/**\n\t * Parses a single frame.\n\t */\n\tprivate parseFrame():void\n\t{\n\t\tvar ch:string;\n\t\tvar data:FrameData;\n\t\tvar token:string;\n\t\tvar frameIndex:number /*int*/;\n\n\t\tframeIndex = this.getNextInt();\n\n\t\ttoken = this.getNextToken();\n\t\tif (token != \"{\")\n\t\t\tthis.sendUnknownKeywordError();\n\n\t\tdo {\n\t\t\tif (this._reachedEOF)\n\t\t\t\tthis.sendEOFError();\n\t\t\tdata = new FrameData();\n\t\t\tdata.components = new Array(this._numAnimatedComponents);\n\n\t\t\tfor (var i:number /*int*/ = 0; i < this._numAnimatedComponents; ++i)\n\t\t\t\tdata.components[i] = this.getNextNumber();\n\n\t\t\tthis._frameData[frameIndex] = data;\n\n\t\t\tch = this.getNextChar();\n\n\t\t\tif (ch == \"/\") {\n\t\t\t\tthis.putBack();\n\t\t\t\tch = this.getNextToken();\n\t\t\t\tif (ch == MD5AnimParser.COMMENT_TOKEN)\n\t\t\t\t\tthis.ignoreLine();\n\t\t\t\tch = this.getNextChar();\n\t\t\t}\n\n\t\t\tif (ch != \"}\")\n\t\t\t\tthis.putBack();\n\n\t\t} while (ch != \"}\");\n\t}\n\n\t/**\n\t * Puts back the last read character into the data stream.\n\t */\n\tprivate putBack():void\n\t{\n\t\tthis._parseIndex--;\n\t\tthis._charLineIndex--;\n\t\tthis._reachedEOF = this._parseIndex >= this._textData.length;\n\t}\n\n\t/**\n\t * Gets the next token in the data stream.\n\t */\n\tprivate getNextToken():string\n\t{\n\t\tvar ch:string;\n\t\tvar token:string = \"\";\n\n\t\twhile (!this._reachedEOF) {\n\t\t\tch = this.getNextChar();\n\t\t\tif (ch == \" \" || ch == \"\\r\" || ch == \"\\n\" || ch == \"\\t\") {\n\t\t\t\tif (token != MD5AnimParser.COMMENT_TOKEN)\n\t\t\t\t\tthis.skipWhiteSpace();\n\t\t\t\tif (token != \"\")\n\t\t\t\t\treturn token;\n\t\t\t} else\n\t\t\t\ttoken += ch;\n\n\t\t\tif (token == MD5AnimParser.COMMENT_TOKEN)\n\t\t\t\treturn token;\n\t\t}\n\n\t\treturn token;\n\t}\n\n\t/**\n\t * Skips all whitespace in the data stream.\n\t */\n\tprivate skipWhiteSpace():void\n\t{\n\t\tvar ch:string;\n\n\t\tdo\n\t\t\tch = this.getNextChar(); while (ch == \"\\n\" || ch == \" \" || ch == \"\\r\" || ch == \"\\t\");\n\n\t\tthis.putBack();\n\t}\n\n\t/**\n\t * Skips to the next line.\n\t */\n\tprivate ignoreLine():void\n\t{\n\t\tvar ch:string;\n\t\twhile (!this._reachedEOF && ch != \"\\n\")\n\t\t\tch = this.getNextChar();\n\t}\n\n\t/**\n\t * Retrieves the next single character in the data stream.\n\t */\n\tprivate getNextChar():string\n\t{\n\t\tvar ch:string = this._textData.charAt(this._parseIndex++);\n\n\t\tif (ch == \"\\n\") {\n\t\t\t++this._line;\n\t\t\tthis._charLineIndex = 0;\n\t\t} else if (ch != \"\\r\")\n\t\t\t++this._charLineIndex;\n\n\t\tif (this._parseIndex == this._textData.length)\n\t\t\tthis._reachedEOF = true;\n\n\t\treturn ch;\n\t}\n\n\t/**\n\t * Retrieves the next integer in the data stream.\n\t */\n\tprivate getNextInt():number /*int*/\n\t{\n\t\tvar i:number = parseInt(this.getNextToken());\n\t\tif (isNaN(i))\n\t\t\tthis.sendParseError(\"int type\");\n\t\treturn i;\n\t}\n\n\t/**\n\t * Retrieves the next floating point number in the data stream.\n\t */\n\tprivate getNextNumber():number\n\t{\n\t\tvar f:number = parseFloat(this.getNextToken());\n\t\tif (isNaN(f))\n\t\t\tthis.sendParseError(\"float type\");\n\t\treturn f;\n\t}\n\n\t/**\n\t * Retrieves the next 3d vector in the data stream.\n\t */\n\tprivate parseVector3D():Vector3D\n\t{\n\t\tvar vec:Vector3D = new Vector3D();\n\t\tvar ch:string = this.getNextToken();\n\n\t\tif (ch != \"(\")\n\t\t\tthis.sendParseError(\"(\");\n\t\tvec.x = this.getNextNumber();\n\t\tvec.y = this.getNextNumber();\n\t\tvec.z = this.getNextNumber();\n\n\t\tif (this.getNextToken() != \")\")\n\t\t\tthis.sendParseError(\")\");\n\n\t\treturn vec;\n\t}\n\n\t/**\n\t * Retrieves the next quaternion in the data stream.\n\t */\n\tprivate parseQuaternion():Quaternion\n\t{\n\t\tvar quat:Quaternion = new Quaternion();\n\t\tvar ch:string = this.getNextToken();\n\n\t\tif (ch != \"(\")\n\t\t\tthis.sendParseError(\"(\");\n\t\tquat.x = this.getNextNumber();\n\t\tquat.y = this.getNextNumber();\n\t\tquat.z = this.getNextNumber();\n\n\t\t// quat supposed to be unit length\n\t\tvar t:number = 1 - (quat.x*quat.x) - (quat.y*quat.y) - (quat.z*quat.z);\n\t\tquat.w = t < 0? 0 : -Math.sqrt(t);\n\n\t\tif (this.getNextToken() != \")\")\n\t\t\tthis.sendParseError(\")\");\n\n\t\treturn quat;\n\t}\n\n\t/**\n\t * Parses the command line data.\n\t */\n\tprivate parseCMD():void\n\t{\n\t\t// just ignore the command line property\n\t\tthis.parseLiteralstring();\n\t}\n\n\t/**\n\t * Retrieves the next literal string in the data stream. A literal string is a sequence of characters bounded\n\t * by double quotes.\n\t */\n\tprivate parseLiteralstring():string\n\t{\n\t\tthis.skipWhiteSpace();\n\n\t\tvar ch:string = this.getNextChar();\n\t\tvar str:string = \"\";\n\n\t\tif (ch != \"\\\"\")\n\t\t\tthis.sendParseError(\"\\\"\");\n\n\t\tdo {\n\t\t\tif (this._reachedEOF)\n\t\t\t\tthis.sendEOFError();\n\t\t\tch = this.getNextChar();\n\t\t\tif (ch != \"\\\"\")\n\t\t\t\tstr += ch;\n\t\t} while (ch != \"\\\"\");\n\n\t\treturn str;\n\t}\n\n\t/**\n\t * Throws an end-of-file error when a premature end of file was encountered.\n\t */\n\tprivate sendEOFError():void\n\t{\n\t\tthrow new Error(\"Unexpected end of file\");\n\t}\n\n\t/**\n\t * Throws an error when an unexpected token was encountered.\n\t * @param expected The token type that was actually expected.\n\t */\n\tprivate sendParseError(expected:string):void\n\t{\n\t\tthrow new Error(\"Unexpected token at line \" + (this._line + 1) + \", character \" + this._charLineIndex + \". \" + expected + \" expected, but \" + this._textData.charAt(this._parseIndex - 1) + \" encountered\");\n\t}\n\n\t/**\n\t * Throws an error when an unknown keyword was encountered.\n\t */\n\tprivate sendUnknownKeywordError():void\n\t{\n\t\tthrow new Error(\"Unknown keyword at line \" + (this._line + 1) + \", character \" + this._charLineIndex + \". \");\n\t}\n}\n\nexport = MD5AnimParser;", + "import DisplayObjectContainer\t\t\t= require(\"awayjs-core/lib/containers/DisplayObjectContainer\");\nimport Geometry\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/base/Geometry\");\nimport TriangleSubGeometry\t\t\t\t= require(\"awayjs-core/lib/core/base/TriangleSubGeometry\");\nimport Matrix3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Matrix3D\");\nimport Quaternion\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Quaternion\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport URLLoaderDataFormat\t\t\t\t= require(\"awayjs-core/lib/core/net/URLLoaderDataFormat\");\nimport Mesh\t\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Mesh\");\nimport ParserBase\t\t\t\t\t\t= require(\"awayjs-core/lib/parsers/ParserBase\");\n\nimport SkeletonAnimationSet\t\t\t\t= require(\"awayjs-renderergl/lib/animators/SkeletonAnimationSet\");\nimport Skeleton\t\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/Skeleton\");\nimport SkeletonJoint\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/SkeletonJoint\");\n\n// todo: create animation system, parse skeleton\n\n/**\n * MD5MeshParser provides a parser for the md5mesh data type, providing the geometry of the md5 format.\n *\n * todo: optimize\n */\nclass MD5MeshParser extends ParserBase\n{\n\tprivate _textData:string;\n\tprivate _startedParsing:boolean;\n\tpublic static VERSION_TOKEN:string = \"MD5Version\";\n\tpublic static COMMAND_LINE_TOKEN:string = \"commandline\";\n\tpublic static NUM_JOINTS_TOKEN:string = \"numJoints\";\n\tpublic static NUM_MESHES_TOKEN:string = \"numMeshes\";\n\tpublic static COMMENT_TOKEN:string = \"//\";\n\tpublic static JOINTS_TOKEN:string = \"joints\";\n\tpublic static MESH_TOKEN:string = \"mesh\";\n\n\tpublic static MESH_SHADER_TOKEN:string = \"shader\";\n\tpublic static MESH_NUM_VERTS_TOKEN:string = \"numverts\";\n\tpublic static MESH_VERT_TOKEN:string = \"vert\";\n\tpublic static MESH_NUM_TRIS_TOKEN:string = \"numtris\";\n\tpublic static MESH_TRI_TOKEN:string = \"tri\";\n\tpublic static MESH_NUM_WEIGHTS_TOKEN:string = \"numweights\";\n\tpublic static MESH_WEIGHT_TOKEN:string = \"weight\";\n\n\tprivate _parseIndex:number /*int*/ = 0;\n\tprivate _reachedEOF:boolean;\n\tprivate _line:number /*int*/ = 0;\n\tprivate _charLineIndex:number /*int*/ = 0;\n\tprivate _version:number /*int*/;\n\tprivate _numJoints:number /*int*/;\n\tprivate _numMeshes:number /*int*/;\n\n\tprivate _mesh:Mesh;\n\tprivate _shaders:Array;\n\n\tprivate _maxJointCount:number /*int*/;\n\tprivate _meshData:Array;\n\tprivate _bindPoses:Array;\n\tprivate _geometry:Geometry;\n\n\tprivate _skeleton:Skeleton;\n\tprivate _animationSet:SkeletonAnimationSet;\n\n\tprivate _rotationQuat:Quaternion;\n\n\t/**\n\t * Creates a new MD5MeshParser object.\n\t */\n\tconstructor(additionalRotationAxis:Vector3D = null, additionalRotationRadians:number = 0)\n\t{\n\t\tsuper(URLLoaderDataFormat.TEXT);\n\t\tthis._rotationQuat = new Quaternion();\n\n\t\tthis._rotationQuat.fromAxisAngle(Vector3D.X_AXIS, -Math.PI*.5);\n\n\t\tif (additionalRotationAxis) {\n\t\t\tvar quat:Quaternion = new Quaternion();\n\t\t\tquat.fromAxisAngle(additionalRotationAxis, additionalRotationRadians);\n\t\t\tthis._rotationQuat.multiply(this._rotationQuat, quat);\n\t\t}\n\t}\n\n\t/**\n\t * Indicates whether or not a given file extension is supported by the parser.\n\t * @param extension The file extension of a potential file to be parsed.\n\t * @return Whether or not the given file type is supported.\n\t */\n\tpublic static supportsType(extension:string):boolean\n\t{\n\t\textension = extension.toLowerCase();\n\t\treturn extension == \"md5mesh\";\n\t}\n\n\t/**\n\t * Tests whether a data block can be parsed by the parser.\n\t * @param data The data block to potentially be parsed.\n\t * @return Whether or not the given data is supported.\n\t */\n\tpublic static supportsData(data:any):boolean\n\t{\n\t\treturn false;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pProceedParsing():boolean\n\t{\n\t\tvar token:string;\n\n\t\tif (!this._startedParsing) {\n\t\t\tthis._textData = this._pGetTextData();\n\t\t\tthis._startedParsing = true;\n\t\t}\n\n\t\twhile (this._pHasTime()) {\n\t\t\ttoken = this.getNextToken();\n\t\t\tswitch (token) {\n\t\t\t\tcase MD5MeshParser.COMMENT_TOKEN:\n\t\t\t\t\tthis.ignoreLine();\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5MeshParser.VERSION_TOKEN:\n\t\t\t\t\tthis._version = this.getNextInt();\n\t\t\t\t\tif (this._version != 10)\n\t\t\t\t\t\tthrow new Error(\"Unknown version number encountered!\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5MeshParser.COMMAND_LINE_TOKEN:\n\t\t\t\t\tthis.parseCMD();\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5MeshParser.NUM_JOINTS_TOKEN:\n\t\t\t\t\tthis._numJoints = this.getNextInt();\n\t\t\t\t\tthis._bindPoses = new Array(this._numJoints);\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5MeshParser.NUM_MESHES_TOKEN:\n\t\t\t\t\tthis._numMeshes = this.getNextInt();\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5MeshParser.JOINTS_TOKEN:\n\t\t\t\t\tthis.parseJoints();\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5MeshParser.MESH_TOKEN:\n\t\t\t\t\tthis.parseMesh();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif (!this._reachedEOF)\n\t\t\t\t\t\tthis.sendUnknownKeywordError();\n\t\t\t}\n\n\t\t\tif (this._reachedEOF) {\n\t\t\t\tthis.calculateMaxJointCount();\n\t\t\t\tthis._animationSet = new SkeletonAnimationSet(this._maxJointCount);\n\n\t\t\t\tthis._mesh = new Mesh(new Geometry(), null);\n\t\t\t\tthis._geometry = this._mesh.geometry;\n\n\t\t\t\tfor (var i:number /*int*/ = 0; i < this._meshData.length; ++i)\n\t\t\t\t\tthis._geometry.addSubGeometry(this.translateGeom(this._meshData[i].vertexData, this._meshData[i].weightData, this._meshData[i].indices));\n\n\t\t\t\t//_geometry.animation = _animation;\n\t\t\t\t//\t\t\t\t\t_mesh.animationController = _animationController;\n\n\t\t\t\t//add to the content property\n\t\t\t\t( this._pContent).addChild(this._mesh);\n\n\t\t\t\tthis._pFinalizeAsset(this._geometry);\n\t\t\t\tthis._pFinalizeAsset(this._mesh);\n\t\t\t\tthis._pFinalizeAsset(this._skeleton);\n\t\t\t\tthis._pFinalizeAsset(this._animationSet);\n\t\t\t\treturn ParserBase.PARSING_DONE;\n\t\t\t}\n\t\t}\n\t\treturn ParserBase.MORE_TO_PARSE;\n\t}\n\n\tpublic _pStartParsing(frameLimit:number)\n\t{\n\t\tsuper._pStartParsing(frameLimit);\n\n\t\t//create a content object for Loaders\n\t\tthis._pContent = new DisplayObjectContainer();\n\t}\n\n\tprivate calculateMaxJointCount():void\n\t{\n\t\tthis._maxJointCount = 0;\n\n\t\tvar numMeshData:number /*int*/ = this._meshData.length;\n\t\tfor (var i:number /*int*/ = 0; i < numMeshData; ++i) {\n\t\t\tvar meshData:MeshData = this._meshData[i];\n\t\t\tvar vertexData:Array = meshData.vertexData;\n\t\t\tvar numVerts:number /*int*/ = vertexData.length;\n\n\t\t\tfor (var j:number /*int*/ = 0; j < numVerts; ++j) {\n\t\t\t\tvar zeroWeights:number /*int*/ = this.countZeroWeightJoints(vertexData[j], meshData.weightData);\n\t\t\t\tvar totalJoints:number /*int*/ = vertexData[j].countWeight - zeroWeights;\n\t\t\t\tif (totalJoints > this._maxJointCount)\n\t\t\t\t\tthis._maxJointCount = totalJoints;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate countZeroWeightJoints(vertex:VertexData, weights:Array):number /*int*/\n\t{\n\t\tvar start:number /*int*/ = vertex.startWeight;\n\t\tvar end:number /*int*/ = vertex.startWeight + vertex.countWeight;\n\t\tvar count:number /*int*/ = 0;\n\t\tvar weight:number;\n\n\t\tfor (var i:number /*int*/ = start; i < end; ++i) {\n\t\t\tweight = weights[i].bias;\n\t\t\tif (weight == 0)\n\t\t\t\t++count;\n\t\t}\n\n\t\treturn count;\n\t}\n\n\t/**\n\t * Parses the skeleton's joints.\n\t */\n\tprivate parseJoints():void\n\t{\n\t\tvar ch:string;\n\t\tvar joint:SkeletonJoint;\n\t\tvar pos:Vector3D;\n\t\tvar quat:Quaternion;\n\t\tvar i:number /*int*/ = 0;\n\t\tvar token:string = this.getNextToken();\n\n\t\tif (token != \"{\")\n\t\t\tthis.sendUnknownKeywordError();\n\n\t\tthis._skeleton = new Skeleton();\n\n\t\tdo {\n\t\t\tif (this._reachedEOF)\n\t\t\t\tthis.sendEOFError();\n\t\t\tjoint = new SkeletonJoint();\n\t\t\tjoint.name = this.parseLiteralstring();\n\t\t\tjoint.parentIndex = this.getNextInt();\n\t\t\tpos = this.parseVector3D();\n\t\t\tpos = this._rotationQuat.rotatePoint(pos);\n\t\t\tquat = this.parseQuaternion();\n\n\t\t\t// todo: check if this is correct, or maybe we want to actually store it as quats?\n\t\t\tthis._bindPoses[i] = quat.toMatrix3D();\n\t\t\tthis._bindPoses[i].appendTranslation(pos.x, pos.y, pos.z);\n\t\t\tvar inv:Matrix3D = this._bindPoses[i].clone();\n\t\t\tinv.invert();\n\t\t\tjoint.inverseBindPose = inv.rawData;\n\n\t\t\tthis._skeleton.joints[i++] = joint;\n\n\t\t\tch = this.getNextChar();\n\n\t\t\tif (ch == \"/\") {\n\t\t\t\tthis.putBack();\n\t\t\t\tch = this.getNextToken();\n\t\t\t\tif (ch == MD5MeshParser.COMMENT_TOKEN)\n\t\t\t\t\tthis.ignoreLine();\n\t\t\t\tch = this.getNextChar();\n\n\t\t\t}\n\n\t\t\tif (ch != \"}\")\n\t\t\t\tthis.putBack();\n\t\t} while (ch != \"}\");\n\t}\n\n\t/**\n\t * Puts back the last read character into the data stream.\n\t */\n\tprivate putBack():void\n\t{\n\t\tthis._parseIndex--;\n\t\tthis._charLineIndex--;\n\t\tthis._reachedEOF = this._parseIndex >= this._textData.length;\n\t}\n\n\t/**\n\t * Parses the mesh geometry.\n\t */\n\tprivate parseMesh():void\n\t{\n\t\tvar token:string = this.getNextToken();\n\t\tvar ch:string;\n\t\tvar vertexData:Array;\n\t\tvar weights:Array;\n\t\tvar indices:Array /*uint*/;\n\n\t\tif (token != \"{\")\n\t\t\tthis.sendUnknownKeywordError();\n\n\t\tif (this._shaders == null)\n\t\t\tthis._shaders = new Array();\n\n\t\twhile (ch != \"}\") {\n\t\t\tch = this.getNextToken();\n\t\t\tswitch (ch) {\n\t\t\t\tcase MD5MeshParser.COMMENT_TOKEN:\n\t\t\t\t\tthis.ignoreLine();\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5MeshParser.MESH_SHADER_TOKEN:\n\t\t\t\t\tthis._shaders.push(this.parseLiteralstring());\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5MeshParser.MESH_NUM_VERTS_TOKEN:\n\t\t\t\t\tvertexData = new Array(this.getNextInt());\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5MeshParser.MESH_NUM_TRIS_TOKEN:\n\t\t\t\t\tindices = new Array(this.getNextInt()*3) /*uint*/;\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5MeshParser.MESH_NUM_WEIGHTS_TOKEN:\n\t\t\t\t\tweights = new Array(this.getNextInt());\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5MeshParser.MESH_VERT_TOKEN:\n\t\t\t\t\tthis.parseVertex(vertexData);\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5MeshParser.MESH_TRI_TOKEN:\n\t\t\t\t\tthis.parseTri(indices);\n\t\t\t\t\tbreak;\n\t\t\t\tcase MD5MeshParser.MESH_WEIGHT_TOKEN:\n\t\t\t\t\tthis.parseJoint(weights);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (this._meshData == null)\n\t\t\tthis._meshData = new Array();\n\n\t\tvar i:number /*uint*/ = this._meshData.length;\n\t\tthis._meshData[i] = new MeshData();\n\t\tthis._meshData[i].vertexData = vertexData;\n\t\tthis._meshData[i].weightData = weights;\n\t\tthis._meshData[i].indices = indices;\n\t}\n\n\t/**\n\t * Converts the mesh data to a SkinnedSub instance.\n\t * @param vertexData The mesh's vertices.\n\t * @param weights The joint weights per vertex.\n\t * @param indices The indices for the faces.\n\t * @return A SubGeometry instance containing all geometrical data for the current mesh.\n\t */\n\tprivate translateGeom(vertexData:Array, weights:Array, indices:Array /*uint*/):TriangleSubGeometry\n\t{\n\t\tvar len:number /*int*/ = vertexData.length;\n\t\tvar v1:number /*int*/, v2:number /*int*/, v3:number /*int*/;\n\t\tvar vertex:VertexData;\n\t\tvar weight:JointData;\n\t\tvar bindPose:Matrix3D;\n\t\tvar pos:Vector3D;\n\t\tvar subGeom:TriangleSubGeometry = new TriangleSubGeometry(true);\n\t\tvar uvs:Array = new Array(len*2);\n\t\tvar vertices:Array = new Array(len*3);\n\t\tvar jointIndices:Array = new Array(len*this._maxJointCount);\n\t\tvar jointWeights:Array = new Array(len*this._maxJointCount);\n\t\tvar l:number /*int*/ = 0;\n\t\tvar nonZeroWeights:number /*int*/;\n\n\t\tfor (var i:number /*int*/ = 0; i < len; ++i) {\n\t\t\tvertex = vertexData[i];\n\t\t\tv1 = vertex.index*3;\n\t\t\tv2 = v1 + 1;\n\t\t\tv3 = v1 + 2;\n\t\t\tvertices[v1] = vertices[v2] = vertices[v3] = 0;\n\n\t\t\tnonZeroWeights = 0;\n\t\t\tfor (var j:number /*int*/ = 0; j < vertex.countWeight; ++j) {\n\t\t\t\tweight = weights[vertex.startWeight + j];\n\t\t\t\tif (weight.bias > 0) {\n\t\t\t\t\tbindPose = this._bindPoses[weight.joint];\n\t\t\t\t\tpos = bindPose.transformVector(weight.pos);\n\t\t\t\t\tvertices[v1] += pos.x*weight.bias;\n\t\t\t\t\tvertices[v2] += pos.y*weight.bias;\n\t\t\t\t\tvertices[v3] += pos.z*weight.bias;\n\n\t\t\t\t\t// indices need to be multiplied by 3 (amount of matrix registers)\n\t\t\t\t\tjointIndices[l] = weight.joint*3;\n\t\t\t\t\tjointWeights[l++] = weight.bias;\n\t\t\t\t\t++nonZeroWeights;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (j = nonZeroWeights; j < this._maxJointCount; ++j) {\n\t\t\t\tjointIndices[l] = 0;\n\t\t\t\tjointWeights[l++] = 0;\n\t\t\t}\n\n\t\t\tv1 = vertex.index << 1;\n\t\t\tuvs[v1++] = vertex.s;\n\t\t\tuvs[v1] = vertex.t;\n\t\t}\n\n\t\tsubGeom.jointsPerVertex = this._maxJointCount;\n\t\tsubGeom.updateIndices(indices);\n\t\tsubGeom.updatePositions(vertices);\n\t\tsubGeom.updateUVs(uvs);\n\t\tsubGeom.updateJointIndices(jointIndices);\n\t\tsubGeom.updateJointWeights(jointWeights);\n\t\t// cause explicit updates\n\t\tsubGeom.vertexNormals;\n\t\tsubGeom.vertexTangents;\n\t\t// turn auto updates off because they may be animated and set explicitly\n\t\tsubGeom.autoDeriveTangents = false;\n\t\tsubGeom.autoDeriveNormals = false;\n\n\t\treturn subGeom;\n\t}\n\n\t/**\n\t * Retrieve the next triplet of vertex indices that form a face.\n\t * @param indices The index list in which to store the read data.\n\t */\n\tprivate parseTri(indices:Array /*uint*/):void\n\t{\n\t\tvar index:number /*int*/ = this.getNextInt()*3;\n\t\tindices[index] = this.getNextInt();\n\t\tindices[index + 1] = this.getNextInt();\n\t\tindices[index + 2] = this.getNextInt();\n\t}\n\n\t/**\n\t * Reads a new joint data set for a single joint.\n\t * @param weights the target list to contain the weight data.\n\t */\n\tprivate parseJoint(weights:Array):void\n\t{\n\t\tvar weight:JointData = new JointData();\n\t\tweight.index = this.getNextInt();\n\t\tweight.joint = this.getNextInt();\n\t\tweight.bias = this.getNextNumber();\n\t\tweight.pos = this.parseVector3D();\n\t\tweights[weight.index] = weight;\n\t}\n\n\t/**\n\t * Reads the data for a single vertex.\n\t * @param vertexData The list to contain the vertex data.\n\t */\n\tprivate parseVertex(vertexData:Array):void\n\t{\n\t\tvar vertex:VertexData = new VertexData();\n\t\tvertex.index = this.getNextInt();\n\t\tthis.parseUV(vertex);\n\t\tvertex.startWeight = this.getNextInt();\n\t\tvertex.countWeight = this.getNextInt();\n\t\t//\t\t\tif (vertex.countWeight > _maxJointCount) _maxJointCount = vertex.countWeight;\n\t\tvertexData[vertex.index] = vertex;\n\t}\n\n\t/**\n\t * Reads the next uv coordinate.\n\t * @param vertexData The vertexData to contain the UV coordinates.\n\t */\n\tprivate parseUV(vertexData:VertexData):void\n\t{\n\t\tvar ch:string = this.getNextToken();\n\t\tif (ch != \"(\")\n\t\t\tthis.sendParseError(\"(\");\n\t\tvertexData.s = this.getNextNumber();\n\t\tvertexData.t = this.getNextNumber();\n\n\t\tif (this.getNextToken() != \")\")\n\t\t\tthis.sendParseError(\")\");\n\t}\n\n\t/**\n\t * Gets the next token in the data stream.\n\t */\n\tprivate getNextToken():string\n\t{\n\t\tvar ch:string;\n\t\tvar token:string = \"\";\n\n\t\twhile (!this._reachedEOF) {\n\t\t\tch = this.getNextChar();\n\t\t\tif (ch == \" \" || ch == \"\\r\" || ch == \"\\n\" || ch == \"\\t\") {\n\t\t\t\tif (token != MD5MeshParser.COMMENT_TOKEN)\n\t\t\t\t\tthis.skipWhiteSpace();\n\t\t\t\tif (token != \"\")\n\t\t\t\t\treturn token;\n\t\t\t} else\n\t\t\t\ttoken += ch;\n\n\t\t\tif (token == MD5MeshParser.COMMENT_TOKEN)\n\t\t\t\treturn token;\n\t\t}\n\n\t\treturn token;\n\t}\n\n\t/**\n\t * Skips all whitespace in the data stream.\n\t */\n\tprivate skipWhiteSpace():void\n\t{\n\t\tvar ch:string;\n\n\t\tdo\n\t\t\tch = this.getNextChar(); while (ch == \"\\n\" || ch == \" \" || ch == \"\\r\" || ch == \"\\t\");\n\n\t\tthis.putBack();\n\t}\n\n\t/**\n\t * Skips to the next line.\n\t */\n\tprivate ignoreLine():void\n\t{\n\t\tvar ch:string;\n\t\twhile (!this._reachedEOF && ch != \"\\n\")\n\t\t\tch = this.getNextChar();\n\t}\n\n\t/**\n\t * Retrieves the next single character in the data stream.\n\t */\n\tprivate getNextChar():string\n\t{\n\t\tvar ch:string = this._textData.charAt(this._parseIndex++);\n\n\t\tif (ch == \"\\n\") {\n\t\t\t++this._line;\n\t\t\tthis._charLineIndex = 0;\n\t\t} else if (ch != \"\\r\")\n\t\t\t++this._charLineIndex;\n\n\t\tif (this._parseIndex >= this._textData.length)\n\t\t\tthis._reachedEOF = true;\n\n\t\treturn ch;\n\t}\n\n\t/**\n\t * Retrieves the next integer in the data stream.\n\t */\n\tprivate getNextInt():number /*int*/\n\t{\n\t\tvar i:number = parseInt(this.getNextToken());\n\t\tif (isNaN(i))\n\t\t\tthis.sendParseError(\"int type\");\n\t\treturn i;\n\t}\n\n\t/**\n\t * Retrieves the next floating point number in the data stream.\n\t */\n\tprivate getNextNumber():number\n\t{\n\t\tvar f:number = parseFloat(this.getNextToken());\n\t\tif (isNaN(f))\n\t\t\tthis.sendParseError(\"float type\");\n\t\treturn f;\n\t}\n\n\t/**\n\t * Retrieves the next 3d vector in the data stream.\n\t */\n\tprivate parseVector3D():Vector3D\n\t{\n\t\tvar vec:Vector3D = new Vector3D();\n\t\tvar ch:string = this.getNextToken();\n\n\t\tif (ch != \"(\")\n\t\t\tthis.sendParseError(\"(\");\n\t\tvec.x = -this.getNextNumber();\n\t\tvec.y = this.getNextNumber();\n\t\tvec.z = this.getNextNumber();\n\n\t\tif (this.getNextToken() != \")\")\n\t\t\tthis.sendParseError(\")\");\n\n\t\treturn vec;\n\t}\n\n\t/**\n\t * Retrieves the next quaternion in the data stream.\n\t */\n\tprivate parseQuaternion():Quaternion\n\t{\n\t\tvar quat:Quaternion = new Quaternion();\n\t\tvar ch:string = this.getNextToken();\n\n\t\tif (ch != \"(\")\n\t\t\tthis.sendParseError(\"(\");\n\t\tquat.x = this.getNextNumber();\n\t\tquat.y = -this.getNextNumber();\n\t\tquat.z = -this.getNextNumber();\n\n\t\t// quat supposed to be unit length\n\t\tvar t:number = 1 - quat.x*quat.x - quat.y*quat.y - quat.z*quat.z;\n\t\tquat.w = t < 0? 0 : -Math.sqrt(t);\n\n\t\tif (this.getNextToken() != \")\")\n\t\t\tthis.sendParseError(\")\");\n\n\t\tvar rotQuat:Quaternion = new Quaternion();\n\t\trotQuat.multiply(this._rotationQuat, quat);\n\t\treturn rotQuat;\n\t}\n\n\t/**\n\t * Parses the command line data.\n\t */\n\tprivate parseCMD():void\n\t{\n\t\t// just ignore the command line property\n\t\tthis.parseLiteralstring();\n\t}\n\n\t/**\n\t * Retrieves the next literal string in the data stream. A literal string is a sequence of characters bounded\n\t * by double quotes.\n\t */\n\tprivate parseLiteralstring():string\n\t{\n\t\tthis.skipWhiteSpace();\n\n\t\tvar ch:string = this.getNextChar();\n\t\tvar str:string = \"\";\n\n\t\tif (ch != \"\\\"\")\n\t\t\tthis.sendParseError(\"\\\"\");\n\n\t\tdo {\n\t\t\tif (this._reachedEOF)\n\t\t\t\tthis.sendEOFError();\n\t\t\tch = this.getNextChar();\n\t\t\tif (ch != \"\\\"\")\n\t\t\t\tstr += ch;\n\t\t} while (ch != \"\\\"\");\n\n\t\treturn str;\n\t}\n\n\t/**\n\t * Throws an end-of-file error when a premature end of file was encountered.\n\t */\n\tprivate sendEOFError():void\n\t{\n\t\tthrow new Error(\"Unexpected end of file\");\n\t}\n\n\t/**\n\t * Throws an error when an unexpected token was encountered.\n\t * @param expected The token type that was actually expected.\n\t */\n\tprivate sendParseError(expected:string):void\n\t{\n\t\tthrow new Error(\"Unexpected token at line \" + (this._line + 1) + \", character \" + this._charLineIndex + \". \" + expected + \" expected, but \" + this._textData.charAt(this._parseIndex - 1) + \" encountered\");\n\t}\n\n\t/**\n\t * Throws an error when an unknown keyword was encountered.\n\t */\n\tprivate sendUnknownKeywordError():void\n\t{\n\t\tthrow new Error(\"Unknown keyword at line \" + (this._line + 1) + \", character \" + this._charLineIndex + \". \");\n\t}\n}\n\nexport = MD5MeshParser;\n\n\nclass VertexData\n{\n\tpublic index:number /*int*/;\n\tpublic s:number;\n\tpublic t:number;\n\tpublic startWeight:number /*int*/;\n\tpublic countWeight:number /*int*/;\n}\n\nclass JointData\n{\n\tpublic index:number /*int*/;\n\tpublic joint:number /*int*/;\n\tpublic bias:number;\n\tpublic pos:Vector3D;\n}\n\nclass MeshData\n{\n\tpublic vertexData:Array;\n\tpublic weightData:Array;\n\tpublic indices:Array /*uint*/;\n}\n", + "import DisplayObjectContainer\t\t\t= require(\"awayjs-core/lib/containers/DisplayObjectContainer\");\nimport Geometry\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/base/Geometry\");\nimport TriangleSubGeometry\t\t\t\t= require(\"awayjs-core/lib/core/base/TriangleSubGeometry\");\nimport Matrix3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Matrix3D\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport AssetType\t\t\t\t\t\t= require(\"awayjs-core/lib/core/library/AssetType\");\nimport IAsset\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/library/IAsset\");\nimport URLLoaderDataFormat\t\t\t\t= require(\"awayjs-core/lib/core/net/URLLoaderDataFormat\");\nimport URLRequest\t\t\t\t\t\t= require(\"awayjs-core/lib/core/net/URLRequest\");\nimport Mesh\t\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Mesh\");\nimport ParserBase\t\t\t\t\t\t= require(\"awayjs-core/lib/parsers/ParserBase\");\nimport ParserUtils\t\t\t\t\t\t= require(\"awayjs-core/lib/parsers/ParserUtils\");\nimport ResourceDependency\t\t\t\t= require(\"awayjs-core/lib/parsers/ResourceDependency\");\nimport Texture2DBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/Texture2DBase\");\nimport TextureProxyBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/TextureProxyBase\");\nimport ByteArray\t\t\t\t\t\t= require(\"awayjs-core/lib/utils/ByteArray\");\nimport MaterialBase\t\t\t\t\t\t= require(\"awayjs-core/lib/materials/MaterialBase\");\n\nimport DefaultMaterialManager\t\t\t= require(\"awayjs-stagegl/lib/materials/utils/DefaultMaterialManager\");\nimport TriangleMethodMaterial\t\t\t= require(\"awayjs-stagegl/lib/materials/TriangleMethodMaterial\");\nimport TriangleMaterialMode\t\t\t\t= require(\"awayjs-stagegl/lib/materials/TriangleMaterialMode\");\n\nimport FaceVO\t\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/parsers/data/FaceVO\");\nimport MaterialVO\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/parsers/data/MaterialVO\");\nimport ObjectVO\t\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/parsers/data/ObjectVO\");\nimport TextureVO\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/parsers/data/TextureVO\");\nimport VertexVO\t\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/parsers/data/VertexVO\");\n\n/**\n * Max3DSParser provides a parser for the 3ds data type.\n */\nclass Max3DSParser extends ParserBase\n{\n\tprivate _byteData:ByteArray;\n\n\tprivate _textures:Object;\n\tprivate _materials:Object;\n\tprivate _unfinalized_objects:Object;\n\n\tprivate _cur_obj_end:number;\n\tprivate _cur_obj:ObjectVO;\n\n\tprivate _cur_mat_end:number;\n\tprivate _cur_mat:MaterialVO;\n\tprivate _useSmoothingGroups:boolean;\n\n\t/**\n\t * Creates a new Max3DSParser object.\n\t *\n\t * @param useSmoothingGroups Determines whether the parser looks for smoothing groups in the 3ds file or assumes uniform smoothing. Defaults to true.\n\t */\n\tconstructor(useSmoothingGroups:boolean = true)\n\t{\n\t\tsuper(URLLoaderDataFormat.ARRAY_BUFFER);\n\n\t\tthis._useSmoothingGroups = useSmoothingGroups;\n\t}\n\n\t/**\n\t * Indicates whether or not a given file extension is supported by the parser.\n\t * @param extension The file extension of a potential file to be parsed.\n\t * @return Whether or not the given file type is supported.\n\t */\n\tpublic static supportsType(extension:string):boolean\n\t{\n\t\textension = extension.toLowerCase();\n\t\treturn extension == \"3ds\";\n\t}\n\n\t/**\n\t * Tests whether a data block can be parsed by the parser.\n\t * @param data The data block to potentially be parsed.\n\t * @return Whether or not the given data is supported.\n\t */\n\tpublic static supportsData(data:any):boolean\n\t{\n\t\tvar ba:ByteArray;\n\n\t\tba = ParserUtils.toByteArray(data);\n\t\tif (ba) {\n\t\t\tba.position = 0;\n\t\t\tif (ba.readShort() == 0x4d4d)\n\t\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iResolveDependency(resourceDependency:ResourceDependency):void\n\t{\n\t\tif (resourceDependency.assets.length == 1) {\n\t\t\tvar asset:IAsset;\n\n\t\t\tasset = resourceDependency.assets[0];\n\t\t\tif (asset.assetType == AssetType.TEXTURE) {\n\t\t\t\tvar tex:TextureVO;\n\n\t\t\t\ttex = this._textures[resourceDependency.id];\n\t\t\t\ttex.texture = asset;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iResolveDependencyFailure(resourceDependency:ResourceDependency):void\n\t{\n\t\t// TODO: Implement\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pProceedParsing():boolean\n\t{\n\t\tif (!this._byteData) {\n\t\t\tthis._byteData = this._pGetByteData();\n\t\t\tthis._byteData.position = 0;\n\n\t\t\t//----------------------------------------------------------------------------\n\t\t\t// LITTLE_ENDIAN - Default for ArrayBuffer / Not implemented in ByteArray\n\t\t\t//----------------------------------------------------------------------------\n\t\t\t//this._byteData.endian = Endian.LITTLE_ENDIAN;// Should be default\n\t\t\t//----------------------------------------------------------------------------\n\n\t\t\tthis._textures = {};\n\t\t\tthis._materials = {};\n\t\t\tthis._unfinalized_objects = {};\n\t\t}\n\n\t\t// TODO: With this construct, the loop will run no-op for as long\n\t\t// as there is time once file has finished reading. Consider a nice\n\t\t// way to stop loop when byte array is empty, without putting it in\n\t\t// the while-conditional, which will prevent finalizations from\n\t\t// happening after the last chunk.\n\t\twhile (this._pHasTime()) {\n\n\t\t\t// If we are currently working on an object, and the most recent chunk was\n\t\t\t// the last one in that object, finalize the current object.\n\t\t\tif (this._cur_mat && this._byteData.position >= this._cur_mat_end)\n\t\t\t\tthis.finalizeCurrentMaterial();\n\t\t\telse if (this._cur_obj && this._byteData.position >= this._cur_obj_end) {\n\t\t\t\t// Can't finalize at this point, because we have to wait until the full\n\t\t\t\t// animation section has been parsed for any potential pivot definitions\n\t\t\t\tthis._unfinalized_objects[this._cur_obj.name] = this._cur_obj;\n\t\t\t\tthis._cur_obj_end = Number.MAX_VALUE /*uint*/;\n\t\t\t\tthis._cur_obj = null;\n\t\t\t}\n\n\t\t\tif (this._byteData.getBytesAvailable() > 0) {\n\t\t\t\tvar cid:number /*uint*/;\n\t\t\t\tvar len:number /*uint*/;\n\t\t\t\tvar end:number /*uint*/;\n\n\t\t\t\tcid = this._byteData.readUnsignedShort();\n\t\t\t\tlen = this._byteData.readUnsignedInt();\n\t\t\t\tend = this._byteData.position + (len - 6);\n\n\t\t\t\tswitch (cid) {\n\t\t\t\t\tcase 0x4D4D: // MAIN3DS\n\t\t\t\t\tcase 0x3D3D: // EDIT3DS\n\t\t\t\t\tcase 0xB000: // KEYF3DS\n\t\t\t\t\t\t// This types are \"container chunks\" and contain only\n\t\t\t\t\t\t// sub-chunks (no data on their own.) This means that\n\t\t\t\t\t\t// there is nothing more to parse at this point, and\n\t\t\t\t\t\t// instead we should progress to the next chunk, which\n\t\t\t\t\t\t// will be the first sub-chunk of this one.\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 0xAFFF: // MATERIAL\n\t\t\t\t\t\tthis._cur_mat_end = end;\n\t\t\t\t\t\tthis._cur_mat = this.parseMaterial();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 0x4000: // EDIT_OBJECT\n\t\t\t\t\t\tthis._cur_obj_end = end;\n\t\t\t\t\t\tthis._cur_obj = new ObjectVO();\n\t\t\t\t\t\tthis._cur_obj.name = this.readNulTermstring();\n\t\t\t\t\t\tthis._cur_obj.materials = new Array();\n\t\t\t\t\t\tthis._cur_obj.materialFaces = {};\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 0x4100: // OBJ_TRIMESH\n\t\t\t\t\t\tthis._cur_obj.type = AssetType.MESH;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 0x4110: // TRI_VERTEXL\n\t\t\t\t\t\tthis.parseVertexList();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 0x4120: // TRI_FACELIST\n\t\t\t\t\t\tthis.parseFaceList();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 0x4140: // TRI_MAPPINGCOORDS\n\t\t\t\t\t\tthis.parseUVList();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 0x4130: // Face materials\n\t\t\t\t\t\tthis.parseFaceMaterialList();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 0x4160: // Transform\n\t\t\t\t\t\tthis._cur_obj.transform = this.readTransform();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 0xB002: // Object animation (including pivot)\n\t\t\t\t\t\tthis.parseObjectAnimation(end);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 0x4150: // Smoothing groups\n\t\t\t\t\t\tthis.parseSmoothingGroups();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// Skip this (unknown) chunk\n\t\t\t\t\t\tthis._byteData.position += (len - 6);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Pause parsing if there were any dependencies found during this\n\t\t\t\t// iteration (i.e. if there are any dependencies that need to be\n\t\t\t\t// retrieved at this time.)\n\t\t\t\tif (this.dependencies.length) {\n\t\t\t\t\tthis._pPauseAndRetrieveDependencies();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// More parsing is required if the entire byte array has not yet\n\t\t// been read, or if there is a currently non-finalized object in\n\t\t// the pipeline.\n\t\tif (this._byteData.getBytesAvailable() || this._cur_obj || this._cur_mat) {\n\t\t\treturn ParserBase.MORE_TO_PARSE;\n\t\t} else {\n\t\t\tvar name:string;\n\n\t\t\t// Finalize any remaining objects before ending.\n\t\t\tfor (name in this._unfinalized_objects) {\n\t\t\t\tvar obj:DisplayObjectContainer;\n\t\t\t\tobj = this.constructObject(this._unfinalized_objects[name]);\n\t\t\t\tif (obj) {\n\t\t\t\t\t//add to the content property\n\t\t\t\t\t( this._pContent).addChild(obj);\n\n\t\t\t\t\tthis._pFinalizeAsset(obj, name);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn ParserBase.PARSING_DONE;\n\t\t}\n\t}\n\n\tpublic _pStartParsing(frameLimit:number)\n\t{\n\t\tsuper._pStartParsing(frameLimit);\n\n\t\t//create a content object for Loaders\n\t\tthis._pContent = new DisplayObjectContainer();\n\t}\n\n\tprivate parseMaterial():MaterialVO\n\t{\n\t\tvar mat:MaterialVO;\n\n\t\tmat = new MaterialVO();\n\n\t\twhile (this._byteData.position < this._cur_mat_end) {\n\t\t\tvar cid:number /*uint*/;\n\t\t\tvar len:number /*uint*/;\n\t\t\tvar end:number /*uint*/;\n\n\t\t\tcid = this._byteData.readUnsignedShort();\n\t\t\tlen = this._byteData.readUnsignedInt();\n\t\t\tend = this._byteData.position + (len - 6);\n\n\t\t\tswitch (cid) {\n\t\t\t\tcase 0xA000: // Material name\n\t\t\t\t\tmat.name = this.readNulTermstring();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 0xA010: // Ambient color\n\t\t\t\t\tmat.ambientColor = this.readColor();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 0xA020: // Diffuse color\n\t\t\t\t\tmat.diffuseColor = this.readColor();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 0xA030: // Specular color\n\t\t\t\t\tmat.specularColor = this.readColor();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 0xA081: // Two-sided, existence indicates \"true\"\n\t\t\t\t\tmat.twoSided = true;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 0xA200: // Main (color) texture\n\t\t\t\t\tmat.colorMap = this.parseTexture(end);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 0xA204: // Specular map\n\t\t\t\t\tmat.specularMap = this.parseTexture(end);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthis._byteData.position = end;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn mat;\n\t}\n\n\tprivate parseTexture(end:number /*uint*/):TextureVO\n\t{\n\t\tvar tex:TextureVO;\n\n\t\ttex = new TextureVO();\n\n\t\twhile (this._byteData.position < end) {\n\t\t\tvar cid:number /*uint*/;\n\t\t\tvar len:number /*uint*/;\n\n\t\t\tcid = this._byteData.readUnsignedShort();\n\t\t\tlen = this._byteData.readUnsignedInt();\n\n\t\t\tswitch (cid) {\n\t\t\t\tcase 0xA300:\n\t\t\t\t\ttex.url = this.readNulTermstring();\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t// Skip this unknown texture sub-chunk\n\t\t\t\t\tthis._byteData.position += (len - 6);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tthis._textures[tex.url] = tex;\n\t\tthis._pAddDependency(tex.url, new URLRequest(tex.url));\n\n\t\treturn tex;\n\t}\n\n\tprivate parseVertexList():void\n\t{\n\t\tvar i:number /*uint*/;\n\t\tvar len:number /*uint*/;\n\t\tvar count:number /*uint*/;\n\n\t\tcount = this._byteData.readUnsignedShort();\n\t\tthis._cur_obj.verts = new Array(count*3);\n\n\t\ti = 0;\n\t\tlen = this._cur_obj.verts.length;\n\t\twhile (i < len) {\n\t\t\tvar x:number, y:number, z:number;\n\n\t\t\tx = this._byteData.readFloat();\n\t\t\ty = this._byteData.readFloat();\n\t\t\tz = this._byteData.readFloat();\n\n\t\t\tthis._cur_obj.verts[i++] = x;\n\t\t\tthis._cur_obj.verts[i++] = z;\n\t\t\tthis._cur_obj.verts[i++] = y;\n\t\t}\n\t}\n\n\tprivate parseFaceList():void\n\t{\n\t\tvar i:number /*uint*/;\n\t\tvar len:number /*uint*/;\n\t\tvar count:number /*uint*/;\n\n\t\tcount = this._byteData.readUnsignedShort();\n\t\tthis._cur_obj.indices = new Array(count*3) /*uint*/;\n\n\t\ti = 0;\n\t\tlen = this._cur_obj.indices.length;\n\t\twhile (i < len) {\n\t\t\tvar i0:number /*uint*/, i1:number /*uint*/, i2:number /*uint*/;\n\n\t\t\ti0 = this._byteData.readUnsignedShort();\n\t\t\ti1 = this._byteData.readUnsignedShort();\n\t\t\ti2 = this._byteData.readUnsignedShort();\n\n\t\t\tthis._cur_obj.indices[i++] = i0;\n\t\t\tthis._cur_obj.indices[i++] = i2;\n\t\t\tthis._cur_obj.indices[i++] = i1;\n\n\t\t\t// Skip \"face info\", irrelevant in Away3D\n\t\t\tthis._byteData.position += 2;\n\t\t}\n\n\t\tthis._cur_obj.smoothingGroups = new Array(count) /*uint*/;\n\t}\n\n\tprivate parseSmoothingGroups():void\n\t{\n\t\tvar len:number /*uint*/ = this._cur_obj.indices.length/3;\n\t\tvar i:number /*uint*/ = 0;\n\t\twhile (i < len) {\n\t\t\tthis._cur_obj.smoothingGroups[i] = this._byteData.readUnsignedInt();\n\t\t\ti++;\n\t\t}\n\t}\n\n\tprivate parseUVList():void\n\t{\n\t\tvar i:number /*uint*/;\n\t\tvar len:number /*uint*/;\n\t\tvar count:number /*uint*/;\n\n\t\tcount = this._byteData.readUnsignedShort();\n\t\tthis._cur_obj.uvs = new Array(count*2);\n\n\t\ti = 0;\n\t\tlen = this._cur_obj.uvs.length;\n\t\twhile (i < len) {\n\t\t\tthis._cur_obj.uvs[i++] = this._byteData.readFloat();\n\t\t\tthis._cur_obj.uvs[i++] = 1.0 - this._byteData.readFloat();\n\t\t}\n\t}\n\n\tprivate parseFaceMaterialList():void\n\t{\n\t\tvar mat:string;\n\t\tvar count:number /*uint*/;\n\t\tvar i:number /*uint*/;\n\t\tvar faces:Array /*uint*/;\n\n\t\tmat = this.readNulTermstring();\n\t\tcount = this._byteData.readUnsignedShort();\n\n\t\tfaces = new Array(count) /*uint*/;\n\t\ti = 0;\n\t\twhile (i < faces.length)\n\t\t\tfaces[i++] = this._byteData.readUnsignedShort();\n\n\t\tthis._cur_obj.materials.push(mat);\n\t\tthis._cur_obj.materialFaces[mat] = faces;\n\t}\n\n\tprivate parseObjectAnimation(end:number):void\n\t{\n\t\tvar vo:ObjectVO;\n\t\tvar obj:DisplayObjectContainer;\n\t\tvar pivot:Vector3D;\n\t\tvar name:string;\n\t\tvar hier:number /*uint*/;\n\n\t\t// Pivot defaults to origin\n\t\tpivot = new Vector3D;\n\n\t\twhile (this._byteData.position < end) {\n\t\t\tvar cid:number /*uint*/;\n\t\t\tvar len:number /*uint*/;\n\n\t\t\tcid = this._byteData.readUnsignedShort();\n\t\t\tlen = this._byteData.readUnsignedInt();\n\n\t\t\tswitch (cid) {\n\t\t\t\tcase 0xb010: // Name/hierarchy\n\t\t\t\t\tname = this.readNulTermstring();\n\t\t\t\t\tthis._byteData.position += 4;\n\t\t\t\t\thier = this._byteData.readShort();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 0xb013: // Pivot\n\t\t\t\t\tpivot.x = this._byteData.readFloat();\n\t\t\t\t\tpivot.z = this._byteData.readFloat();\n\t\t\t\t\tpivot.y = this._byteData.readFloat();\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthis._byteData.position += (len - 6);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// If name is \"$$$DUMMY\" this is an empty object (e.g. a container)\n\t\t// and will be ignored in this version of the parser\n\t\t// TODO: Implement containers in 3DS parser.\n\t\tif (name != '$$$DUMMY' && this._unfinalized_objects.hasOwnProperty(name)) {\n\t\t\tvo = this._unfinalized_objects[name];\n\t\t\tobj = this.constructObject(vo, pivot);\n\n\t\t\tif (obj) {\n\t\t\t\t//add to the content property\n\t\t\t\t( this._pContent).addChild(obj);\n\n\t\t\t\tthis._pFinalizeAsset(obj, vo.name);\n\t\t\t}\n\n\n\t\t\tdelete this._unfinalized_objects[name];\n\t\t}\n\t}\n\n\tprivate constructObject(obj:ObjectVO, pivot:Vector3D = null):DisplayObjectContainer\n\t{\n\t\tif (obj.type == AssetType.MESH) {\n\t\t\tvar i:number /*uint*/;\n\t\t\tvar sub:TriangleSubGeometry;\n\t\t\tvar geom:Geometry;\n\t\t\tvar mat:MaterialBase;\n\t\t\tvar mesh:Mesh;\n\t\t\tvar mtx:Matrix3D;\n\t\t\tvar vertices:Array;\n\t\t\tvar faces:Array;\n\n\t\t\tif (obj.materials.length > 1)\n\t\t\t\tconsole.log(\"The Away3D 3DS parser does not support multiple materials per mesh at this point.\");\n\n\t\t\t// Ignore empty objects\n\t\t\tif (!obj.indices || obj.indices.length == 0)\n\t\t\t\treturn null;\n\n\t\t\tvertices = new Array(obj.verts.length/3);\n\t\t\tfaces = new Array(obj.indices.length/3);\n\n\t\t\tthis.prepareData(vertices, faces, obj);\n\n\t\t\tif (this._useSmoothingGroups)\n\t\t\t\tthis.applySmoothGroups(vertices, faces);\n\n\t\t\tobj.verts = new Array(vertices.length*3);\n\t\t\tfor (i = 0; i < vertices.length; i++) {\n\t\t\t\tobj.verts[i*3] = vertices[i].x;\n\t\t\t\tobj.verts[i*3 + 1] = vertices[i].y;\n\t\t\t\tobj.verts[i*3 + 2] = vertices[i].z;\n\t\t\t}\n\t\t\tobj.indices = new Array(faces.length*3) /*uint*/;\n\n\t\t\tfor (i = 0; i < faces.length; i++) {\n\t\t\t\tobj.indices[i*3] = faces[i].a;\n\t\t\t\tobj.indices[i*3 + 1] = faces[i].b;\n\t\t\t\tobj.indices[i*3 + 2] = faces[i].c;\n\t\t\t}\n\n\t\t\tif (obj.uvs) {\n\t\t\t\t// If the object had UVs to start with, use UVs generated by\n\t\t\t\t// smoothing group splitting algorithm. Otherwise those UVs\n\t\t\t\t// will be nonsense and should be skipped.\n\t\t\t\tobj.uvs = new Array(vertices.length*2);\n\t\t\t\tfor (i = 0; i < vertices.length; i++) {\n\t\t\t\t\tobj.uvs[i*2] = vertices[i].u;\n\t\t\t\t\tobj.uvs[i*2 + 1] = vertices[i].v;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tgeom = new Geometry();\n\n\t\t\t// Construct sub-geometries (potentially splitting buffers)\n\t\t\t// and add them to geometry.\n\t\t\tsub = new TriangleSubGeometry(true);\n\t\t\tsub.updateIndices(obj.indices);\n\t\t\tsub.updatePositions(obj.verts);\n\t\t\tsub.updateUVs(obj.uvs);\n\n\t\t\tgeom.addSubGeometry(sub);\n\n\t\t\tif (obj.materials.length > 0) {\n\t\t\t\tvar mname:string;\n\t\t\t\tmname = obj.materials[0];\n\t\t\t\tmat = this._materials[mname].material;\n\t\t\t}\n\n\t\t\t// Apply pivot translation to geometry if a pivot was\n\t\t\t// found while parsing the keyframe chunk earlier.\n\t\t\tif (pivot) {\n\t\t\t\tif (obj.transform) {\n\t\t\t\t\t// If a transform was found while parsing the\n\t\t\t\t\t// object chunk, use it to find the local pivot vector\n\t\t\t\t\tvar dat:Array = obj.transform.concat();\n\t\t\t\t\tdat[12] = 0;\n\t\t\t\t\tdat[13] = 0;\n\t\t\t\t\tdat[14] = 0;\n\t\t\t\t\tmtx = new Matrix3D(dat);\n\t\t\t\t\tpivot = mtx.transformVector(pivot);\n\t\t\t\t}\n\n\t\t\t\tpivot.scaleBy(-1);\n\n\t\t\t\tmtx = new Matrix3D();\n\t\t\t\tmtx.appendTranslation(pivot.x, pivot.y, pivot.z);\n\t\t\t\tgeom.applyTransformation(mtx);\n\t\t\t}\n\n\t\t\t// Apply transformation to geometry if a transformation\n\t\t\t// was found while parsing the object chunk earlier.\n\t\t\tif (obj.transform) {\n\t\t\t\tmtx = new Matrix3D(obj.transform);\n\t\t\t\tmtx.invert();\n\t\t\t\tgeom.applyTransformation(mtx);\n\t\t\t}\n\n\t\t\t// Final transform applied to geometry. Finalize the geometry,\n\t\t\t// which will no longer be modified after this point.\n\t\t\tthis._pFinalizeAsset(geom, obj.name.concat('_geom'));\n\n\t\t\t// Build mesh and return it\n\t\t\tmesh = new Mesh(geom, mat);\n\t\t\tmesh.transform.matrix3D = new Matrix3D(obj.transform);\n\t\t\treturn mesh;\n\t\t}\n\n\t\t// If reached, unknown\n\t\treturn null;\n\t}\n\n\tprivate prepareData(vertices:Array, faces:Array, obj:ObjectVO):void\n\t{\n\t\t// convert raw ObjectVO's data to structured VertexVO and FaceVO\n\t\tvar i:number /*int*/;\n\t\tvar j:number /*int*/;\n\t\tvar k:number /*int*/;\n\t\tvar len:number /*int*/ = obj.verts.length;\n\t\tfor (i = 0, j = 0, k = 0; i < len;) {\n\t\t\tvar v:VertexVO = new VertexVO;\n\t\t\tv.x = obj.verts[i++];\n\t\t\tv.y = obj.verts[i++];\n\t\t\tv.z = obj.verts[i++];\n\t\t\tif (obj.uvs) {\n\t\t\t\tv.u = obj.uvs[j++];\n\t\t\t\tv.v = obj.uvs[j++];\n\t\t\t}\n\t\t\tvertices[k++] = v;\n\t\t}\n\t\tlen = obj.indices.length;\n\t\tfor (i = 0, k = 0; i < len;) {\n\t\t\tvar f:FaceVO = new FaceVO();\n\t\t\tf.a = obj.indices[i++];\n\t\t\tf.b = obj.indices[i++];\n\t\t\tf.c = obj.indices[i++];\n\t\t\tf.smoothGroup = obj.smoothingGroups[k] || 0;\n\t\t\tfaces[k++] = f;\n\t\t}\n\t}\n\n\tprivate applySmoothGroups(vertices:Array, faces:Array):void\n\t{\n\t\t// clone vertices according to following rule:\n\t\t// clone if vertex's in faces from groups 1+2 and 3\n\t\t// don't clone if vertex's in faces from groups 1+2, 3 and 1+3\n\n\t\tvar i:number /*int*/;\n\t\tvar j:number /*int*/;\n\t\tvar k:number /*int*/;\n\t\tvar l:number /*int*/;\n\t\tvar len:number /*int*/;\n\t\tvar numVerts:number /*uint*/ = vertices.length;\n\t\tvar numFaces:number /*uint*/ = faces.length;\n\n\t\t// extract groups data for vertices\n\t\tvar vGroups:Array> /*uint*/ = new Array>(numVerts) /*uint*/;\n\t\tfor (i = 0; i < numVerts; i++)\n\t\t\tvGroups[i] = new Array() /*uint*/;\n\t\tfor (i = 0; i < numFaces; i++) {\n\t\t\tvar face:FaceVO = faces[i];\n\t\t\tfor (j = 0; j < 3; j++) {\n\t\t\t\tvar groups:Array /*uint*/ = vGroups[(j == 0)? face.a : ((j == 1)? face.b : face.c)];\n\t\t\t\tvar group:number /*uint*/ = face.smoothGroup;\n\t\t\t\tfor (k = groups.length - 1; k >= 0; k--) {\n\t\t\t\t\tif ((group & groups[k]) > 0) {\n\t\t\t\t\t\tgroup |= groups[k];\n\t\t\t\t\t\tgroups.splice(k, 1);\n\t\t\t\t\t\tk = groups.length - 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tgroups.push(group);\n\t\t\t}\n\t\t}\n\t\t// clone vertices\n\t\tvar vClones:Array> /*uint*/ = new Array>(numVerts) /*uint*/;\n\t\tfor (i = 0; i < numVerts; i++) {\n\t\t\tif ((len = vGroups[i].length) < 1)\n\t\t\t\tcontinue;\n\t\t\tvar clones:Array /*uint*/ = new Array(len) /*uint*/;\n\t\t\tvClones[i] = clones;\n\t\t\tclones[0] = i;\n\t\t\tvar v0:VertexVO = vertices[i];\n\t\t\tfor (j = 1; j < len; j++) {\n\t\t\t\tvar v1:VertexVO = new VertexVO;\n\t\t\t\tv1.x = v0.x;\n\t\t\t\tv1.y = v0.y;\n\t\t\t\tv1.z = v0.z;\n\t\t\t\tv1.u = v0.u;\n\t\t\t\tv1.v = v0.v;\n\t\t\t\tclones[j] = vertices.length;\n\t\t\t\tvertices.push(v1);\n\t\t\t}\n\t\t}\n\t\tnumVerts = vertices.length;\n\n\t\tfor (i = 0; i < numFaces; i++) {\n\t\t\tface = faces[i];\n\t\t\tgroup = face.smoothGroup;\n\t\t\tfor (j = 0; j < 3; j++) {\n\t\t\t\tk = (j == 0)? face.a : ((j == 1)? face.b : face.c);\n\t\t\t\tgroups = vGroups[k];\n\t\t\t\tlen = groups.length;\n\t\t\t\tclones = vClones[k];\n\t\t\t\tfor (l = 0; l < len; l++) {\n\t\t\t\t\tif (((group == 0) && (groups[l] == 0)) || ((group & groups[l]) > 0)) {\n\t\t\t\t\t\tvar index:number /*uint*/ = clones[l];\n\t\t\t\t\t\tif (group == 0) {\n\t\t\t\t\t\t\t// vertex is unique if no smoothGroup found\n\t\t\t\t\t\t\tgroups.splice(l, 1);\n\t\t\t\t\t\t\tclones.splice(l, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (j == 0)\n\t\t\t\t\t\t\tface.a = index; else if (j == 1)\n\t\t\t\t\t\t\tface.b = index; else\n\t\t\t\t\t\t\tface.c = index;\n\t\t\t\t\t\tl = len;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate finalizeCurrentMaterial():void\n\t{\n\t\tvar mat:TriangleMethodMaterial;\n\n\t\tif (this._cur_mat.colorMap)\n\t\t\tmat = new TriangleMethodMaterial(this._cur_mat.colorMap.texture || DefaultMaterialManager.getDefaultTexture());\n\t\telse\n\t\t\tmat = new TriangleMethodMaterial(this._cur_mat.ambientColor);\n\n\t\tmat.diffuseColor = this._cur_mat.diffuseColor;\n\t\tmat.specularColor = this._cur_mat.specularColor;\n\n\t\tif (this.materialMode >= 2)\n\t\t\tmat.materialMode = TriangleMaterialMode.MULTI_PASS\n\n\t\tmat.bothSides = this._cur_mat.twoSided;\n\n\t\tthis._pFinalizeAsset(mat, this._cur_mat.name);\n\n\t\tthis._materials[this._cur_mat.name] = this._cur_mat;\n\t\tthis._cur_mat.material = mat;\n\n\t\tthis._cur_mat = null;\n\t}\n\n\tprivate readNulTermstring():string\n\t{\n\t\tvar chr:number /*int*/;\n\t\tvar str:string = \"\";\n\n\t\twhile ((chr = this._byteData.readUnsignedByte()) > 0)\n\t\t\tstr += String.fromCharCode(chr);\n\n\t\treturn str;\n\t}\n\n\tprivate readTransform():Array\n\t{\n\t\tvar data:Array;\n\n\t\tdata = new Array(16);\n\n\t\t// X axis\n\t\tdata[0] = this._byteData.readFloat(); // X\n\t\tdata[2] = this._byteData.readFloat(); // Z\n\t\tdata[1] = this._byteData.readFloat(); // Y\n\t\tdata[3] = 0;\n\n\t\t// Z axis\n\t\tdata[8] = this._byteData.readFloat(); // X\n\t\tdata[10] = this._byteData.readFloat(); // Z\n\t\tdata[9] = this._byteData.readFloat(); // Y\n\t\tdata[11] = 0;\n\n\t\t// Y Axis\n\t\tdata[4] = this._byteData.readFloat(); // X\n\t\tdata[6] = this._byteData.readFloat(); // Z\n\t\tdata[5] = this._byteData.readFloat(); // Y\n\t\tdata[7] = 0;\n\n\t\t// Translation\n\t\tdata[12] = this._byteData.readFloat(); // X\n\t\tdata[14] = this._byteData.readFloat(); // Z\n\t\tdata[13] = this._byteData.readFloat(); // Y\n\t\tdata[15] = 1;\n\n\t\treturn data;\n\t}\n\n\tprivate readColor():number /*int*/\n\t{\n\t\tvar cid:number /*int*/;\n\t\tvar len:number /*int*/;\n\t\tvar r:number /*int*/, g:number /*int*/, b:number /*int*/;\n\n\t\tcid = this._byteData.readUnsignedShort();\n\t\tlen = this._byteData.readUnsignedInt();\n\n\t\tswitch (cid) {\n\t\t\tcase 0x0010: // Floats\n\t\t\t\tr = this._byteData.readFloat()*255;\n\t\t\t\tg = this._byteData.readFloat()*255;\n\t\t\t\tb = this._byteData.readFloat()*255;\n\t\t\t\tbreak;\n\t\t\tcase 0x0011: // 24-bit color\n\t\t\t\tr = this._byteData.readUnsignedByte();\n\t\t\t\tg = this._byteData.readUnsignedByte();\n\t\t\t\tb = this._byteData.readUnsignedByte();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthis._byteData.position += (len - 6);\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn (r << 16) | (g << 8) | b;\n\t}\n}\n\nexport = Max3DSParser;\n\n\n", + "import DisplayObjectContainer\t\t\t= require(\"awayjs-core/lib/containers/DisplayObjectContainer\");\nimport TriangleSubGeometry\t\t\t\t= require(\"awayjs-core/lib/core/base/TriangleSubGeometry\");\nimport Geometry\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/base/Geometry\");\nimport Matrix3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Matrix3D\");\nimport Quaternion\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Quaternion\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\nimport AssetType\t\t\t\t\t\t= require(\"awayjs-core/lib/core/library/AssetType\");\nimport IAsset\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/library/IAsset\");\nimport URLLoaderDataFormat\t\t\t\t= require(\"awayjs-core/lib/core/net/URLLoaderDataFormat\");\nimport URLRequest\t\t\t\t\t\t= require(\"awayjs-core/lib/core/net/URLRequest\");\nimport Mesh\t\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Mesh\");\nimport MaterialBase\t\t\t\t\t\t= require(\"awayjs-core/lib/materials/MaterialBase\");\nimport ParserBase\t\t\t\t\t\t= require(\"awayjs-core/lib/parsers/ParserBase\");\nimport ParserUtils\t\t\t\t\t\t= require(\"awayjs-core/lib/parsers/ParserUtils\");\nimport ResourceDependency\t\t\t\t= require(\"awayjs-core/lib/parsers/ResourceDependency\");\nimport Texture2DBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/Texture2DBase\");\n\nimport DefaultMaterialManager\t\t\t= require(\"awayjs-stagegl/lib/materials/utils/DefaultMaterialManager\");\nimport SpecularBasicMethod\t\t\t\t= require(\"awayjs-stagegl/lib/materials/methods/SpecularBasicMethod\");\nimport TriangleMethodMaterial\t\t\t= require(\"awayjs-stagegl/lib/materials/TriangleMethodMaterial\");\nimport TriangleMaterialMode\t\t\t\t= require(\"awayjs-stagegl/lib/materials/TriangleMaterialMode\");\n\n/**\n * OBJParser provides a parser for the OBJ data type.\n */\nclass OBJParser extends ParserBase\n{\n\tprivate _textData:string;\n\tprivate _startedParsing:boolean;\n\tprivate _charIndex:number;\n\tprivate _oldIndex:number;\n\tprivate _stringLength:number;\n\tprivate _currentObject:ObjectGroup;\n\tprivate _currentGroup:Group;\n\tprivate _currentMaterialGroup:MaterialGroup;\n\tprivate _objects:Array;\n\tprivate _materialIDs:string[];\n\tprivate _materialLoaded:Array;\n\tprivate _materialSpecularData:Array;\n\tprivate _meshes:Array;\n\tprivate _lastMtlID:string;\n\tprivate _objectIndex:number;\n\tprivate _realIndices;\n\tprivate _vertexIndex:number;\n\tprivate _vertices:Array;\n\tprivate _vertexNormals:Array;\n\tprivate _uvs:Array;\n\tprivate _scale:number;\n\tprivate _mtlLib:boolean;\n\tprivate _mtlLibLoaded:boolean = true;\n\tprivate _activeMaterialID:string = \"\";\n\n\t/**\n\t * Creates a new OBJParser object.\n\t * @param uri The url or id of the data or file to be parsed.\n\t * @param extra The holder for extra contextual data that the parser might need.\n\t */\n\tconstructor(scale:number = 1)\n\t{\n\t\tsuper(URLLoaderDataFormat.TEXT);\n\t\tthis._scale = scale;\n\t}\n\n\t/**\n\t * Scaling factor applied directly to vertices data\n\t * @param value The scaling factor.\n\t */\n\tpublic set scale(value:number)\n\t{\n\t\tthis._scale = value;\n\t}\n\n\t/**\n\t * Indicates whether or not a given file extension is supported by the parser.\n\t * @param extension The file extension of a potential file to be parsed.\n\t * @return Whether or not the given file type is supported.\n\t */\n\tpublic static supportsType(extension:string):boolean\n\t{\n\t\textension = extension.toLowerCase();\n\t\treturn extension == \"obj\";\n\t}\n\n\t/**\n\t * Tests whether a data block can be parsed by the parser.\n\t * @param data The data block to potentially be parsed.\n\t * @return Whether or not the given data is supported.\n\t */\n\tpublic static supportsData(data:any):boolean\n\t{\n\t\tvar content:string = ParserUtils.toString(data);\n\t\tvar hasV:boolean = false;\n\t\tvar hasF:boolean = false;\n\n\t\tif (content) {\n\t\t\thasV = content.indexOf(\"\\nv \") != -1;\n\t\t\thasF = content.indexOf(\"\\nf \") != -1;\n\t\t}\n\n\t\treturn hasV && hasF;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iResolveDependency(resourceDependency:ResourceDependency)\n\t{\n\t\tif (resourceDependency.id == 'mtl') {\n\t\t\tvar str:string = ParserUtils.toString(resourceDependency.data);\n\t\t\tthis.parseMtl(str);\n\n\t\t} else {\n\t\t\tvar asset:IAsset;\n\n\t\t\tif (resourceDependency.assets.length != 1) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tasset = resourceDependency.assets[0];\n\n\t\t\tif (asset.assetType == AssetType.TEXTURE) {\n\n\t\t\t\tvar lm:LoadedMaterial = new LoadedMaterial();\n\t\t\t\tlm.materialID = resourceDependency.id;\n\t\t\t\tlm.texture = asset;\n\n\t\t\t\tthis._materialLoaded.push(lm);\n\n\t\t\t\tif (this._meshes.length > 0) {\n\t\t\t\t\tthis.applyMaterial(lm);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _iResolveDependencyFailure(resourceDependency:ResourceDependency)\n\t{\n\t\tif (resourceDependency.id == \"mtl\") {\n\t\t\tthis._mtlLib = false;\n\t\t\tthis._mtlLibLoaded = false;\n\t\t} else {\n\t\t\tvar lm:LoadedMaterial = new LoadedMaterial();\n\t\t\tlm.materialID = resourceDependency.id;\n\t\t\tthis._materialLoaded.push(lm);\n\t\t}\n\n\t\tif (this._meshes.length > 0)\n\t\t\tthis.applyMaterial(lm);\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic _pProceedParsing():boolean\n\t{\n\t\tvar line:string;\n\t\tvar creturn:string = String.fromCharCode(10);\n\t\tvar trunk;\n\n\t\tif (!this._startedParsing) {\n\t\t\tthis._textData = this._pGetTextData();\n\t\t\t// Merge linebreaks that are immediately preceeded by\n\t\t\t// the \"escape\" backward slash into single lines.\n\t\t\tthis._textData = this._textData.replace(/\\\\[\\r\\n]+\\s*/gm, ' ');\n\t\t}\n\n\t\tif (this._textData.indexOf(creturn) == -1)\n\t\t\tcreturn = String.fromCharCode(13);\n\n\t\tif (!this._startedParsing) {\n\t\t\tthis._startedParsing = true;\n\t\t\tthis._vertices = new Array();\n\t\t\tthis._vertexNormals = new Array();\n\t\t\tthis._materialIDs = new Array();\n\t\t\tthis._materialLoaded = new Array();\n\t\t\tthis._meshes = new Array();\n\t\t\tthis._uvs = new Array();\n\t\t\tthis._stringLength = this._textData.length;\n\t\t\tthis._charIndex = this._textData.indexOf(creturn, 0);\n\t\t\tthis._oldIndex = 0;\n\t\t\tthis._objects = new Array();\n\t\t\tthis._objectIndex = 0;\n\t\t}\n\n\t\twhile (this._charIndex < this._stringLength && this._pHasTime()) {\n\t\t\tthis._charIndex = this._textData.indexOf(creturn, this._oldIndex);\n\n\t\t\tif (this._charIndex == -1)\n\t\t\t\tthis._charIndex = this._stringLength;\n\n\t\t\tline = this._textData.substring(this._oldIndex, this._charIndex);\n\t\t\tline = line.split('\\r').join(\"\");\n\t\t\tline = line.replace(\" \", \" \");\n\t\t\ttrunk = line.split(\" \");\n\t\t\tthis._oldIndex = this._charIndex + 1;\n\t\t\tthis.parseLine(trunk);\n\n\t\t\t// If whatever was parsed on this line resulted in the\n\t\t\t// parsing being paused to retrieve dependencies, break\n\t\t\t// here and do not continue parsing until un-paused.\n\t\t\tif (this.parsingPaused) {\n\t\t\t\treturn ParserBase.MORE_TO_PARSE;\n\t\t\t}\n\n\t\t}\n\n\t\tif (this._charIndex >= this._stringLength) {\n\n\t\t\tif (this._mtlLib && !this._mtlLibLoaded) {\n\t\t\t\treturn ParserBase.MORE_TO_PARSE;\n\t\t\t}\n\n\t\t\tthis.translate();\n\t\t\tthis.applyMaterials();\n\n\t\t\treturn ParserBase.PARSING_DONE;\n\t\t}\n\n\t\treturn ParserBase.MORE_TO_PARSE;\n\t}\n\n\tpublic _pStartParsing(frameLimit:number)\n\t{\n\t\tsuper._pStartParsing(frameLimit);\n\n\t\t//create a content object for Loaders\n\t\tthis._pContent = new DisplayObjectContainer();\n\t}\n\n\t/**\n\t * Parses a single line in the OBJ file.\n\t */\n\tprivate parseLine(trunk)\n\t{\n\t\tswitch (trunk[0]) {\n\n\t\t\tcase \"mtllib\":\n\n\t\t\t\tthis._mtlLib = true;\n\t\t\t\tthis._mtlLibLoaded = false;\n\t\t\t\tthis.loadMtl(trunk[1]);\n\n\t\t\t\tbreak;\n\n\t\t\tcase \"g\":\n\n\t\t\t\tthis.createGroup(trunk);\n\n\t\t\t\tbreak;\n\n\t\t\tcase \"o\":\n\n\t\t\t\tthis.createObject(trunk);\n\n\t\t\t\tbreak;\n\n\t\t\tcase \"usemtl\":\n\n\t\t\t\tif (this._mtlLib) {\n\n\t\t\t\t\tif (!trunk[1])\n\t\t\t\t\t\ttrunk[1] = \"def000\";\n\n\t\t\t\t\tthis._materialIDs.push(trunk[1]);\n\t\t\t\t\tthis._activeMaterialID = trunk[1];\n\n\t\t\t\t\tif (this._currentGroup)\n\t\t\t\t\t\tthis._currentGroup.materialID = this._activeMaterialID;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase \"v\":\n\n\t\t\t\tthis.parseVertex(trunk);\n\n\t\t\t\tbreak;\n\n\t\t\tcase \"vt\":\n\n\t\t\t\tthis.parseUV(trunk);\n\n\t\t\t\tbreak;\n\n\t\t\tcase \"vn\":\n\n\t\t\t\tthis.parseVertexNormal(trunk);\n\n\t\t\t\tbreak;\n\n\t\t\tcase \"f\":\n\n\t\t\t\tthis.parseFace(trunk);\n\n\t\t}\n\t}\n\n\t/**\n\t * Converts the parsed data into an Away3D scenegraph structure\n\t */\n\tprivate translate()\n\t{\n\t\tfor (var objIndex:number = 0; objIndex < this._objects.length; ++objIndex) {\n\t\t\tvar groups:Array = this._objects[objIndex].groups;\n\t\t\tvar numGroups:number = groups.length;\n\t\t\tvar materialGroups:Array;\n\t\t\tvar numMaterialGroups:number;\n\t\t\tvar geometry:Geometry;\n\t\t\tvar mesh:Mesh;\n\n\t\t\tvar m:number;\n\t\t\tvar sm:number;\n\t\t\tvar bmMaterial:TriangleMethodMaterial;\n\n\t\t\tfor (var g:number = 0; g < numGroups; ++g) {\n\t\t\t\tgeometry = new Geometry();\n\t\t\t\tmaterialGroups = groups[g].materialGroups;\n\t\t\t\tnumMaterialGroups = materialGroups.length;\n\n\t\t\t\tfor (m = 0; m < numMaterialGroups; ++m)\n\t\t\t\t\tthis.translateMaterialGroup(materialGroups[m], geometry);\n\n\t\t\t\tif (geometry.subGeometries.length == 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// Finalize and force type-based name\n\t\t\t\tthis._pFinalizeAsset( geometry);//, \"\");\n\n\t\t\t\tbmMaterial = new TriangleMethodMaterial(DefaultMaterialManager.getDefaultTexture());\n\n\t\t\t\t//check for multipass\n\t\t\t\tif (this.materialMode >= 2)\n\t\t\t\t\tbmMaterial.materialMode = TriangleMaterialMode.MULTI_PASS;\n\n\t\t\t\tmesh = new Mesh(geometry, bmMaterial);\n\n\t\t\t\tif (this._objects[objIndex].name) {\n\t\t\t\t\t// this is a full independent object ('o' tag in OBJ file)\n\t\t\t\t\tmesh.name = this._objects[objIndex].name;\n\n\t\t\t\t} else if (groups[g].name) {\n\n\t\t\t\t\t// this is a group so the sub groups contain the actual mesh object names ('g' tag in OBJ file)\n\t\t\t\t\tmesh.name = groups[g].name;\n\n\t\t\t\t} else {\n\t\t\t\t\t// No name stored. Use empty string which will force it\n\t\t\t\t\t// to be overridden by finalizeAsset() to type default.\n\t\t\t\t\tmesh.name = \"\";\n\t\t\t\t}\n\n\t\t\t\tthis._meshes.push(mesh);\n\n\t\t\t\tif (groups[g].materialID != \"\")\n\t\t\t\t\tbmMaterial.name = groups[g].materialID + \"~\" + mesh.name; else\n\t\t\t\t\tbmMaterial.name = this._lastMtlID + \"~\" + mesh.name;\n\n\t\t\t\tif (mesh.subMeshes.length > 1) {\n\t\t\t\t\tfor (sm = 1; sm < mesh.subMeshes.length; ++sm)\n\t\t\t\t\t\tmesh.subMeshes[sm].material = bmMaterial;\n\t\t\t\t}\n\n\t\t\t\t//add to the content property\n\t\t\t\t( this._pContent).addChild(mesh);\n\n\t\t\t\tthis._pFinalizeAsset( mesh);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Translates an obj's material group to a subgeometry.\n\t * @param materialGroup The material group data to convert.\n\t * @param geometry The Geometry to contain the converted SubGeometry.\n\t */\n\tprivate translateMaterialGroup(materialGroup:MaterialGroup, geometry:Geometry)\n\t{\n\t\tvar faces:Array = materialGroup.faces;\n\t\tvar face:FaceData;\n\t\tvar numFaces:number = faces.length;\n\t\tvar numVerts:number;\n\t\tvar sub:TriangleSubGeometry;\n\n\t\tvar vertices:Array = new Array();\n\t\tvar uvs:Array = new Array();\n\t\tvar normals:Array = new Array();\n\t\tvar indices:Array /*uint*/ = new Array();\n\n\t\tthis._realIndices = [];\n\t\tthis._vertexIndex = 0;\n\n\t\tvar j:number;\n\t\tfor (var i:number = 0; i < numFaces; ++i) {\n\n\t\t\tface = faces[i];\n\t\t\tnumVerts = face.indexIds.length - 1;\n\n\t\t\tfor (j = 1; j < numVerts; ++j) {\n\n\t\t\t\tthis.translateVertexData(face, j, vertices, uvs, indices, normals);\n\t\t\t\tthis.translateVertexData(face, 0, vertices, uvs, indices, normals);\n\t\t\t\tthis.translateVertexData(face, j + 1, vertices, uvs, indices, normals);\n\t\t\t}\n\t\t}\n\t\tif (vertices.length > 0) {\n\t\t\tsub = new TriangleSubGeometry(true);\n\t\t\tsub.autoDeriveNormals = normals.length? false : true;\n\t\t\tsub.updateIndices(indices);\n\t\t\tsub.updatePositions(vertices);\n\t\t\tsub.updateVertexNormals(normals);\n\t\t\tsub.updateUVs(uvs);\n\n\t\t\tgeometry.addSubGeometry(sub);\n\t\t}\n\t}\n\n\tprivate translateVertexData(face:FaceData, vertexIndex:number, vertices:Array, uvs:Array, indices:Array /*uint*/, normals:Array)\n\t{\n\t\tvar index:number;\n\t\tvar vertex:Vertex;\n\t\tvar vertexNormal:Vertex;\n\t\tvar uv:UV;\n\n\t\tif (!this._realIndices[face.indexIds[vertexIndex]]) {\n\n\t\t\tindex = this._vertexIndex;\n\t\t\tthis._realIndices[face.indexIds[vertexIndex]] = ++this._vertexIndex;\n\t\t\tvertex = this._vertices[face.vertexIndices[vertexIndex] - 1];\n\t\t\tvertices.push(vertex.x*this._scale, vertex.y*this._scale, vertex.z*this._scale);\n\n\t\t\tif (face.normalIndices.length > 0) {\n\t\t\t\tvertexNormal = this._vertexNormals[face.normalIndices[vertexIndex] - 1];\n\t\t\t\tnormals.push(vertexNormal.x, vertexNormal.y, vertexNormal.z);\n\t\t\t}\n\n\t\t\tif (face.uvIndices.length > 0) {\n\n\t\t\t\ttry {\n\t\t\t\t\tuv = this._uvs[face.uvIndices[vertexIndex] - 1];\n\t\t\t\t\tuvs.push(uv.u, uv.v);\n\n\t\t\t\t} catch (e) {\n\n\t\t\t\t\tswitch (vertexIndex) {\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\tuvs.push(0, 1);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tuvs.push(.5, 0);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tuvs.push(1, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\t\t\tindex = this._realIndices[face.indexIds[vertexIndex]] - 1;\n\t\t}\n\n\t\tindices.push(index);\n\t}\n\n\t/**\n\t * Creates a new object group.\n\t * @param trunk The data block containing the object tag and its parameters\n\t */\n\tprivate createObject(trunk)\n\t{\n\t\tthis._currentGroup = null;\n\t\tthis._currentMaterialGroup = null;\n\t\tthis._objects.push(this._currentObject = new ObjectGroup());\n\n\t\tif (trunk)\n\t\t\tthis._currentObject.name = trunk[1];\n\t}\n\n\t/**\n\t * Creates a new group.\n\t * @param trunk The data block containing the group tag and its parameters\n\t */\n\tprivate createGroup(trunk)\n\t{\n\t\tif (!this._currentObject)\n\t\t\tthis.createObject(null);\n\t\tthis._currentGroup = new Group();\n\n\t\tthis._currentGroup.materialID = this._activeMaterialID;\n\n\t\tif (trunk)\n\t\t\tthis._currentGroup.name = trunk[1];\n\t\tthis._currentObject.groups.push(this._currentGroup);\n\n\t\tthis.createMaterialGroup(null);\n\t}\n\n\t/**\n\t * Creates a new material group.\n\t * @param trunk The data block containing the material tag and its parameters\n\t */\n\tprivate createMaterialGroup(trunk)\n\t{\n\t\tthis._currentMaterialGroup = new MaterialGroup();\n\t\tif (trunk)\n\t\t\tthis._currentMaterialGroup.url = trunk[1];\n\t\tthis._currentGroup.materialGroups.push(this._currentMaterialGroup);\n\t}\n\n\t/**\n\t * Reads the next vertex coordinates.\n\t * @param trunk The data block containing the vertex tag and its parameters\n\t */\n\tprivate parseVertex(trunk)\n\t{\n\t\t//for the very rare cases of other delimiters/charcodes seen in some obj files\n\n\t\tvar v1:number, v2:number , v3:number;\n\t\tif (trunk.length > 4) {\n\t\t\tvar nTrunk = [];\n\t\t\tvar val:number;\n\n\t\t\tfor (var i:number = 1; i < trunk.length; ++i) {\n\t\t\t\tval = parseFloat(trunk[i]);\n\t\t\t\tif (!isNaN(val))\n\t\t\t\t\tnTrunk.push(val);\n\t\t\t}\n\n\t\t\tv1 = nTrunk[0];\n\t\t\tv2 = nTrunk[1];\n\t\t\tv3 = -nTrunk[2];\n\t\t\tthis._vertices.push(new Vertex(v1, v2, v3));\n\n\t\t} else {\n\t\t\tv1 = parseFloat(trunk[1]);\n\t\t\tv2 = parseFloat(trunk[2]);\n\t\t\tv3 = -parseFloat(trunk[3]);\n\n\t\t\tthis._vertices.push(new Vertex(v1, v2, v3));\n\t\t}\n\n\t}\n\n\t/**\n\t * Reads the next uv coordinates.\n\t * @param trunk The data block containing the uv tag and its parameters\n\t */\n\tprivate parseUV(trunk)\n\t{\n\t\tif (trunk.length > 3) {\n\t\t\tvar nTrunk = [];\n\t\t\tvar val:number;\n\t\t\tfor (var i:number = 1; i < trunk.length; ++i) {\n\t\t\t\tval = parseFloat(trunk[i]);\n\t\t\t\tif (!isNaN(val))\n\t\t\t\t\tnTrunk.push(val);\n\t\t\t}\n\t\t\tthis._uvs.push(new UV(nTrunk[0], 1 - nTrunk[1]));\n\n\t\t} else {\n\t\t\tthis._uvs.push(new UV(parseFloat(trunk[1]), 1 - parseFloat(trunk[2])));\n\t\t}\n\n\t}\n\n\t/**\n\t * Reads the next vertex normal coordinates.\n\t * @param trunk The data block containing the vertex normal tag and its parameters\n\t */\n\tprivate parseVertexNormal(trunk)\n\t{\n\t\tif (trunk.length > 4) {\n\t\t\tvar nTrunk = [];\n\t\t\tvar val:number;\n\t\t\tfor (var i:number = 1; i < trunk.length; ++i) {\n\t\t\t\tval = parseFloat(trunk[i]);\n\t\t\t\tif (!isNaN(val))\n\t\t\t\t\tnTrunk.push(val);\n\t\t\t}\n\t\t\tthis._vertexNormals.push(new Vertex(nTrunk[0], nTrunk[1], -nTrunk[2]));\n\n\t\t} else {\n\t\t\tthis._vertexNormals.push(new Vertex(parseFloat(trunk[1]), parseFloat(trunk[2]), -parseFloat(trunk[3])));\n\t\t}\n\t}\n\n\t/**\n\t * Reads the next face's indices.\n\t * @param trunk The data block containing the face tag and its parameters\n\t */\n\tprivate parseFace(trunk)\n\t{\n\t\tvar len:number = trunk.length;\n\t\tvar face:FaceData = new FaceData();\n\n\t\tif (!this._currentGroup) {\n\t\t\tthis.createGroup(null);\n\t\t}\n\n\t\tvar indices;\n\t\tfor (var i:number = 1; i < len; ++i) {\n\n\t\t\tif (trunk[i] == \"\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tindices = trunk[i].split(\"/\");\n\t\t\tface.vertexIndices.push(this.parseIndex(parseInt(indices[0]), this._vertices.length));\n\n\t\t\tif (indices[1] && String(indices[1]).length > 0)\n\t\t\t\tface.uvIndices.push(this.parseIndex(parseInt(indices[1]), this._uvs.length));\n\n\t\t\tif (indices[2] && String(indices[2]).length > 0)\n\t\t\t\tface.normalIndices.push(this.parseIndex(parseInt(indices[2]), this._vertexNormals.length));\n\n\t\t\tface.indexIds.push(trunk[i]);\n\t\t}\n\n\t\tthis._currentMaterialGroup.faces.push(face);\n\t}\n\n\t/**\n\t * This is a hack around negative face coords\n\t */\n\tprivate parseIndex(index:number, length:number):number\n\t{\n\t\tif (index < 0)\n\t\t\treturn index + length + 1; else\n\t\t\treturn index;\n\t}\n\n\tprivate parseMtl(data:string)\n\t{\n\t\tvar materialDefinitions = data.split('newmtl');\n\t\tvar lines;\n\t\tvar trunk;\n\t\tvar j:number;\n\n\t\tvar basicSpecularMethod:SpecularBasicMethod;\n\t\tvar useSpecular:boolean;\n\t\tvar useColor:boolean;\n\t\tvar diffuseColor:number;\n\t\tvar color:number;\n\t\tvar specularColor:number;\n\t\tvar specular:number;\n\t\tvar alpha:number;\n\t\tvar mapkd:string;\n\n\t\tfor (var i:number = 0; i < materialDefinitions.length; ++i) {\n\n\n\t\t\tlines = (materialDefinitions[i].split('\\r')).join(\"\").split('\\n');\n\t\t\t//lines = (materialDefinitions[i].split('\\r') as Array).join(\"\").split('\\n');\n\n\t\t\tif (lines.length == 1)\n\t\t\t\tlines = materialDefinitions[i].split(String.fromCharCode(13));\n\n\t\t\tdiffuseColor = color = specularColor = 0xFFFFFF;\n\t\t\tspecular = 0;\n\t\t\tuseSpecular = false;\n\t\t\tuseColor = false;\n\t\t\talpha = 1;\n\t\t\tmapkd = \"\";\n\n\t\t\tfor (j = 0; j < lines.length; ++j) {\n\n\t\t\t\tlines[j] = lines[j].replace(/\\s+$/, \"\");\n\n\t\t\t\tif (lines[j].substring(0, 1) != \"#\" && (j == 0 || lines[j] != \"\")) {\n\t\t\t\t\ttrunk = lines[j].split(\" \");\n\n\t\t\t\t\tif (String(trunk[0]).charCodeAt(0) == 9 || String(trunk[0]).charCodeAt(0) == 32)\n\t\t\t\t\t\ttrunk[0] = trunk[0].substring(1, trunk[0].length);\n\n\t\t\t\t\tif (j == 0) {\n\t\t\t\t\t\tthis._lastMtlID = trunk.join(\"\");\n\t\t\t\t\t\tthis._lastMtlID = (this._lastMtlID == \"\")? \"def000\" : this._lastMtlID;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tswitch (trunk[0]) {\n\n\t\t\t\t\t\t\tcase \"Ka\":\n\t\t\t\t\t\t\t\tif (trunk[1] && !isNaN(Number(trunk[1])) && trunk[2] && !isNaN(Number(trunk[2])) && trunk[3] && !isNaN(Number(trunk[3])))\n\t\t\t\t\t\t\t\t\tcolor = trunk[1]*255 << 16 | trunk[2]*255 << 8 | trunk[3]*255;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase \"Ks\":\n\t\t\t\t\t\t\t\tif (trunk[1] && !isNaN(Number(trunk[1])) && trunk[2] && !isNaN(Number(trunk[2])) && trunk[3] && !isNaN(Number(trunk[3]))) {\n\t\t\t\t\t\t\t\t\tspecularColor = trunk[1]*255 << 16 | trunk[2]*255 << 8 | trunk[3]*255;\n\t\t\t\t\t\t\t\t\tuseSpecular = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase \"Ns\":\n\t\t\t\t\t\t\t\tif (trunk[1] && !isNaN(Number(trunk[1])))\n\t\t\t\t\t\t\t\t\tspecular = Number(trunk[1])*0.001;\n\t\t\t\t\t\t\t\tif (specular == 0)\n\t\t\t\t\t\t\t\t\tuseSpecular = false;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase \"Kd\":\n\t\t\t\t\t\t\t\tif (trunk[1] && !isNaN(Number(trunk[1])) && trunk[2] && !isNaN(Number(trunk[2])) && trunk[3] && !isNaN(Number(trunk[3]))) {\n\t\t\t\t\t\t\t\t\tdiffuseColor = trunk[1]*255 << 16 | trunk[2]*255 << 8 | trunk[3]*255;\n\t\t\t\t\t\t\t\t\tuseColor = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase \"tr\":\n\t\t\t\t\t\t\tcase \"d\":\n\t\t\t\t\t\t\t\tif (trunk[1] && !isNaN(Number(trunk[1])))\n\t\t\t\t\t\t\t\t\talpha = Number(trunk[1]);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase \"map_Kd\":\n\t\t\t\t\t\t\t\tmapkd = this.parseMapKdString(trunk);\n\t\t\t\t\t\t\t\tmapkd = mapkd.replace(/\\\\/g, \"/\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (mapkd != \"\") {\n\n\t\t\t\tif (useSpecular) {\n\n\t\t\t\t\tbasicSpecularMethod = new SpecularBasicMethod();\n\t\t\t\t\tbasicSpecularMethod.specularColor = specularColor;\n\t\t\t\t\tbasicSpecularMethod.specular = specular;\n\n\t\t\t\t\tvar specularData:SpecularData = new SpecularData();\n\t\t\t\t\tspecularData.alpha = alpha;\n\t\t\t\t\tspecularData.basicSpecularMethod = basicSpecularMethod;\n\t\t\t\t\tspecularData.materialID = this._lastMtlID;\n\n\t\t\t\t\tif (!this._materialSpecularData)\n\t\t\t\t\t\tthis._materialSpecularData = new Array();\n\n\t\t\t\t\tthis._materialSpecularData.push(specularData);\n\n\t\t\t\t}\n\n\t\t\t\tthis._pAddDependency(this._lastMtlID, new URLRequest(mapkd));\n\n\t\t\t} else if (useColor && !isNaN(color)) {\n\n\t\t\t\tvar lm:LoadedMaterial = new LoadedMaterial();\n\t\t\t\tlm.materialID = this._lastMtlID;\n\n\t\t\t\tif (alpha == 0)\n\t\t\t\t\tconsole.log(\"Warning: an alpha value of 0 was found in mtl color tag (Tr or d) ref:\" + this._lastMtlID + \", mesh(es) using it will be invisible!\");\n\n\t\t\t\tvar cm:TriangleMethodMaterial;\n\n\t\t\t\tif (this.materialMode < 2) {\n\t\t\t\t\tcm = new TriangleMethodMaterial(color);\n\n\t\t\t\t\tvar colorMat:TriangleMethodMaterial = cm;\n\n\t\t\t\t\tcolorMat.alpha = alpha;\n\t\t\t\t\tcolorMat.diffuseColor = diffuseColor;\n\t\t\t\t\tcolorMat.repeat = true;\n\n\t\t\t\t\tif (useSpecular) {\n\t\t\t\t\t\tcolorMat.specularColor = specularColor;\n\t\t\t\t\t\tcolorMat.specular = specular;\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tcm = new TriangleMethodMaterial(color);\n\t\t\t\t\tcm.materialMode = TriangleMaterialMode.MULTI_PASS;\n\n\t\t\t\t\tvar colorMultiMat:TriangleMethodMaterial = cm;\n\n\n\t\t\t\t\tcolorMultiMat.diffuseColor = diffuseColor;\n\t\t\t\t\tcolorMultiMat.repeat = true;\n\n\t\t\t\t\tif (useSpecular) {\n\t\t\t\t\t\tcolorMultiMat.specularColor = specularColor;\n\t\t\t\t\t\tcolorMultiMat.specular = specular;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlm.cm = cm;\n\n\t\t\t\tthis._materialLoaded.push(lm);\n\n\t\t\t\tif (this._meshes.length > 0)\n\t\t\t\t\tthis.applyMaterial(lm);\n\n\t\t\t}\n\t\t}\n\n\t\tthis._mtlLibLoaded = true;\n\t}\n\n\tprivate parseMapKdString(trunk):string\n\t{\n\t\tvar url:string = \"\";\n\t\tvar i:number;\n\t\tvar breakflag:boolean;\n\n\t\tfor (i = 1; i < trunk.length;) {\n\t\t\tswitch (trunk[i]) {\n\t\t\t\tcase \"-blendu\":\n\t\t\t\tcase \"-blendv\":\n\t\t\t\tcase \"-cc\":\n\t\t\t\tcase \"-clamp\":\n\t\t\t\tcase \"-texres\":\n\t\t\t\t\ti += 2; //Skip ahead 1 attribute\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-mm\":\n\t\t\t\t\ti += 3; //Skip ahead 2 attributes\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-o\":\n\t\t\t\tcase \"-s\":\n\t\t\t\tcase \"-t\":\n\t\t\t\t\ti += 4; //Skip ahead 3 attributes\n\t\t\t\t\tcontinue;\n\t\t\t\tdefault:\n\t\t\t\t\tbreakflag = true;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (breakflag)\n\t\t\t\tbreak;\n\t\t}\n\n\t\t//Reconstruct URL/filename\n\t\tfor (i; i < trunk.length; i++) {\n\t\t\turl += trunk[i];\n\t\t\turl += \" \";\n\t\t}\n\n\t\t//Remove the extraneous space and/or newline from the right side\n\t\turl = url.replace(/\\s+$/, \"\");\n\n\t\treturn url;\n\t}\n\n\tprivate loadMtl(mtlurl:string)\n\t{\n\t\t// Add raw-data dependency to queue and load dependencies now,\n\t\t// which will pause the parsing in the meantime.\n\t\tthis._pAddDependency('mtl', new URLRequest(mtlurl), true);\n\t\tthis._pPauseAndRetrieveDependencies();//\n\t}\n\n\tprivate applyMaterial(lm:LoadedMaterial)\n\t{\n\t\tvar decomposeID;\n\t\tvar mesh:Mesh;\n\t\tvar tm:TriangleMethodMaterial;\n\t\tvar j:number;\n\t\tvar specularData:SpecularData;\n\n\t\tfor (var i:number = 0; i < this._meshes.length; ++i) {\n\t\t\tmesh = this._meshes[i];\n\t\t\tdecomposeID = mesh.material.name.split(\"~\");\n\n\t\t\tif (decomposeID[0] == lm.materialID) {\n\n\t\t\t\tif (lm.cm) {\n\t\t\t\t\tif (mesh.material)\n\t\t\t\t\t\tmesh.material = null;\n\t\t\t\t\tmesh.material = lm.cm;\n\n\t\t\t\t} else if (lm.texture) {\n\t\t\t\t\tif (this.materialMode < 2) { // if materialMode is 0 or 1, we create a SinglePass\n\t\t\t\t\t\ttm = mesh.material;\n\n\t\t\t\t\t\ttm.texture = lm.texture;\n\t\t\t\t\t\ttm.color = lm.color;\n\t\t\t\t\t\ttm.alpha = lm.alpha;\n\t\t\t\t\t\ttm.repeat = true;\n\n\t\t\t\t\t\tif (lm.specularMethod) {\n\n\t\t\t\t\t\t\t// By setting the specularMethod property to null before assigning\n\t\t\t\t\t\t\t// the actual method instance, we avoid having the properties of\n\t\t\t\t\t\t\t// the new method being overridden with the settings from the old\n\t\t\t\t\t\t\t// one, which is default behavior of the setter.\n\t\t\t\t\t\t\ttm.specularMethod = null;\n\t\t\t\t\t\t\ttm.specularMethod = lm.specularMethod;\n\n\t\t\t\t\t\t} else if (this._materialSpecularData) {\n\n\t\t\t\t\t\t\tfor (j = 0; j < this._materialSpecularData.length; ++j) {\n\t\t\t\t\t\t\t\tspecularData = this._materialSpecularData[j];\n\n\t\t\t\t\t\t\t\tif (specularData.materialID == lm.materialID) {\n\t\t\t\t\t\t\t\t\ttm.specularMethod = null; // Prevent property overwrite (see above)\n\t\t\t\t\t\t\t\t\ttm.specularMethod = specularData.basicSpecularMethod;\n\t\t\t\t\t\t\t\t\ttm.color = specularData.color;\n\t\t\t\t\t\t\t\t\ttm.alpha = specularData.alpha;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else { //if materialMode==2 this is a MultiPassTexture\n\t\t\t\t\t\ttm = mesh.material;\n\t\t\t\t\t\ttm.materialMode = TriangleMaterialMode.MULTI_PASS;\n\n\t\t\t\t\t\ttm.texture = lm.texture;\n\t\t\t\t\t\ttm.color = lm.color;\n\t\t\t\t\t\ttm.repeat = true;\n\n\t\t\t\t\t\tif (lm.specularMethod) {\n\t\t\t\t\t\t\t// By setting the specularMethod property to null before assigning\n\t\t\t\t\t\t\t// the actual method instance, we avoid having the properties of\n\t\t\t\t\t\t\t// the new method being overridden with the settings from the old\n\t\t\t\t\t\t\t// one, which is default behavior of the setter.\n\t\t\t\t\t\t\ttm.specularMethod = null;\n\t\t\t\t\t\t\ttm.specularMethod = lm.specularMethod;\n\t\t\t\t\t\t} else if (this._materialSpecularData) {\n\t\t\t\t\t\t\tfor (j = 0; j < this._materialSpecularData.length; ++j) {\n\t\t\t\t\t\t\t\tspecularData = this._materialSpecularData[j];\n\n\t\t\t\t\t\t\t\tif (specularData.materialID == lm.materialID) {\n\t\t\t\t\t\t\t\t\ttm.specularMethod = null; // Prevent property overwrite (see above)\n\t\t\t\t\t\t\t\t\ttm.specularMethod = specularData.basicSpecularMethod;\n\t\t\t\t\t\t\t\t\ttm.color = specularData.color;\n\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tmesh.material.name = decomposeID[1]? decomposeID[1] : decomposeID[0];\n\t\t\t\tthis._meshes.splice(i, 1);\n\t\t\t\t--i;\n\t\t\t}\n\t\t}\n\n\t\tif (lm.cm || tm)\n\t\t\tthis._pFinalizeAsset(lm.cm || tm);\n\t}\n\n\tprivate applyMaterials()\n\t{\n\t\tif (this._materialLoaded.length == 0)\n\t\t\treturn;\n\n\t\tfor (var i:number = 0; i < this._materialLoaded.length; ++i)\n\t\t\tthis.applyMaterial(this._materialLoaded[i]);\n\t}\n}\n\nexport = OBJParser;\n\nclass ObjectGroup\n{\n\tpublic name:string;\n\tpublic groups:Group[] = new Array();\n}\n\nclass Group\n{\n\tpublic name:string;\n\tpublic materialID:string;\n\tpublic materialGroups:MaterialGroup[] = new Array();\n}\n\nclass MaterialGroup\n{\n\tpublic url:string;\n\tpublic faces:FaceData[] = new Array();\n}\n\nclass SpecularData\n{\n\tpublic materialID:string;\n\tpublic basicSpecularMethod:SpecularBasicMethod;\n\tpublic color:number = 0xFFFFFF;\n\tpublic alpha:number = 1;\n}\n\nclass LoadedMaterial\n{\n\tpublic materialID:string;\n\tpublic texture:Texture2DBase;\n\tpublic cm:MaterialBase;\n\tpublic specularMethod:SpecularBasicMethod;\n\tpublic color:number = 0xFFFFFF;\n\tpublic alpha:number = 1;\n}\n\nclass FaceData\n{\n\tpublic vertexIndices:Array /*uint*/ = new Array();\n\tpublic uvIndices:Array /*uint*/ = new Array();\n\tpublic normalIndices:Array /*uint*/ = new Array();\n\tpublic indexIds:string[] = new Array(); // used for real index lookups\n}\n\n/**\n* Texture coordinates value object.\n*/\nclass UV\n{\n\tprivate _u:number;\n\tprivate _v:number;\n\n\t/**\n\t * Creates a new UV object.\n\t *\n\t * @param u [optional] The horizontal coordinate of the texture value. Defaults to 0.\n\t * @param v [optional] The vertical coordinate of the texture value. Defaults to 0.\n\t */\n\tconstructor(u:number = 0, v:number = 0)\n\t{\n\t\tthis._u = u;\n\t\tthis._v = v;\n\t}\n\n\t/**\n\t * Defines the vertical coordinate of the texture value.\n\t */\n\tpublic get v():number\n\t{\n\t\treturn this._v;\n\t}\n\n\tpublic set v(value:number)\n\t{\n\t\tthis._v = value;\n\t}\n\n\t/**\n\t * Defines the horizontal coordinate of the texture value.\n\t */\n\tpublic get u():number\n\t{\n\t\treturn this._u;\n\t}\n\n\tpublic set u(value:number)\n\t{\n\t\tthis._u = value;\n\t}\n\n\t/**\n\t * returns a new UV value Object\n\t */\n\tpublic clone():UV\n\t{\n\t\treturn new UV(this._u, this._v);\n\t}\n\n\t/**\n\t * returns the value object as a string for trace/debug purpose\n\t */\n\tpublic toString():string\n\t{\n\t\treturn this._u + \",\" + this._v;\n\t}\n}\n\nclass Vertex\n{\n\tprivate _x:number;\n\tprivate _y:number;\n\tprivate _z:number;\n\tprivate _index:number;\n\n\t/**\n\t * Creates a new Vertex value object.\n\t *\n\t * @param x [optional] The x value. Defaults to 0.\n\t * @param y [optional] The y value. Defaults to 0.\n\t * @param z [optional] The z value. Defaults to 0.\n\t * @param index [optional] The index value. Defaults is NaN.\n\t */\n\tconstructor(x:number = 0, y:number = 0, z:number = 0, index:number = 0)\n\t{\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._index = index;\n\t}\n\n\t/**\n\t * To define/store the index of value object\n\t * @param ind The index\n\t */\n\tpublic set index(ind:number)\n\t{\n\t\tthis._index = ind;\n\t}\n\n\tpublic get index():number\n\t{\n\t\treturn this._index;\n\t}\n\n\t/**\n\t * To define/store the x value of the value object\n\t * @param value The x value\n\t */\n\tpublic get x():number\n\t{\n\t\treturn this._x;\n\t}\n\n\tpublic set x(value:number)\n\t{\n\t\tthis._x = value;\n\t}\n\n\t/**\n\t * To define/store the y value of the value object\n\t * @param value The y value\n\t */\n\tpublic get y():number\n\t{\n\t\treturn this._y;\n\t}\n\n\tpublic set y(value:number)\n\t{\n\t\tthis._y = value;\n\t}\n\n\t/**\n\t * To define/store the z value of the value object\n\t * @param value The z value\n\t */\n\tpublic get z():number\n\t{\n\t\treturn this._z;\n\t}\n\n\tpublic set z(value:number)\n\t{\n\t\tthis._z = value;\n\t}\n\n\t/**\n\t * returns a new Vertex value Object\n\t */\n\tpublic clone():Vertex\n\t{\n\t\treturn new Vertex(this._x, this._y, this._z);\n\t}\n}", + "import AssetLoader\t\t\t\t\t\t= require(\"awayjs-core/lib/core/library/AssetLoader\");\n\nimport AWDParser\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/parsers/AWDParser\");\nimport Max3DSParser\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/parsers/Max3DSParser\");\nimport MD2Parser\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/parsers/MD2Parser\");\nimport OBJParser\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/parsers/OBJParser\");\n\n/**\n *\n */\nclass Parsers\n{\n\t/**\n\t * A list of all parsers that come bundled with Away3D. Use this to quickly\n\t * enable support for all bundled parsers to the file format auto-detection\n\t * feature, using any of the enableParsers() methods on loaders, e.g.:\n\t *\n\t * AssetLibrary.enableParsers(Parsers.ALL_BUNDLED);\n\t *\n\t * Beware however that this requires all parser classes to be included in the\n\t * SWF file, which will add 50-100 kb to the file. When only a limited set of\n\t * file formats are used, SWF file size can be saved by adding the parsers\n\t * individually using AssetLibrary.enableParser()\n\t *\n\t * A third way is to specify a parser for each loaded file, thereby bypassing\n\t * the auto-detection mechanisms altogether, while at the same time allowing\n\t * any properties that are unique to that parser to be set for that load.\n\t *\n\t * The bundled parsers are:\n\t *\n\t *
    \n\t *
  • AC3D (.ac)
  • \n\t *
  • Away Data version 1 ASCII and version 2 binary (.awd). AWD1 BSP unsupported
  • \n\t *
  • 3DMax (.3ds)
  • \n\t *
  • DXF (.dxf)
  • \n\t *
  • Quake 2 MD2 models (.md2)
  • \n\t *
  • Doom 3 MD5 animation clips (.md5anim)
  • \n\t *
  • Doom 3 MD5 meshes (.md5mesh)
  • \n\t *
  • Wavefront OBJ (.obj)
  • \n\t *
  • Collada (.dae)
  • \n\t *
  • Images (.jpg, .png)
  • \n\t *
\n\t *\n\t * @see away.library.AssetLibrary.enableParser\n\t */\n\tpublic static ALL_BUNDLED:Array = Array(AWDParser, Max3DSParser, MD2Parser, OBJParser);\n\n\t/**\n\t * Short-hand function to enable all bundled parsers for auto-detection. In practice,\n\t * this is the same as invoking enableParsers(Parsers.ALL_BUNDLED) on any of the\n\t * loader classes SingleFileLoader, AssetLoader, AssetLibrary or Loader3D.\n\t *\n\t * See notes about file size in the documentation for the ALL_BUNDLED constant.\n\t *\n\t * @see away.parsers.Parsers.ALL_BUNDLED\n\t */\n\tpublic static enableAllBundled():void\n\t{\n\t\tAssetLoader.enableParsers(Parsers.ALL_BUNDLED);\n\t}\n}\n\nexport = Parsers;", + "import ByteArray\t\t\t\t\t\t= require(\"awayjs-core/lib/utils/ByteArray\");\n\n/**\n *\n */\nclass AWDBlock\n{\n\tpublic id:number;\n\tpublic name:string;\n\tpublic data:any;\n\tpublic len:any;\n\tpublic geoID:number;\n\tpublic extras:Object;\n\tpublic bytes:ByteArray;\n\tpublic errorMessages:Array;\n\tpublic uvsForVertexAnimation:Array>;\n\n\tconstructor()\n\t{\n\t}\n\n\tpublic dispose()\n\t{\n\n\t\tthis.id = null;\n\t\tthis.bytes = null;\n\t\tthis.errorMessages = null;\n\t\tthis.uvsForVertexAnimation = null;\n\n\t}\n\n\tpublic addError(errorMsg:string):void\n\t{\n\t\tif (!this.errorMessages)\n\t\t\tthis.errorMessages = new Array();\n\n\t\tthis.errorMessages.push(errorMsg);\n\t}\n}\n\nexport = AWDBlock;", + "class AWDProperties\n{\n\tpublic set(key:number, value:any):void\n\t{\n\t\tthis[ key.toString() ] = value;\n\t}\n\n\tpublic get(key:number, fallback:any):any\n\t{\n\t\tif (this.hasOwnProperty(key.toString())) {\n\t\t\treturn this[key.toString()];\n\t\t} else {\n\t\t\treturn fallback;\n\t\t}\n\t}\n}\n\nexport = AWDProperties;", + "import Quaternion\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Quaternion\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\n/**\n * \n */\nclass BaseFrameData\n{\n\t/**\n\t *\n\t */\n\tpublic position:Vector3D;\n\n\t/**\n\t *\n\t */\n\tpublic orientation:Quaternion;\n}\n\nexport = BaseFrameData;", + "/**\n *\n */\nclass BitFlags\n{\n\tpublic static FLAG1:number = 1;\n\tpublic static FLAG2:number = 2;\n\tpublic static FLAG3:number = 4;\n\tpublic static FLAG4:number = 8;\n\tpublic static FLAG5:number = 16;\n\tpublic static FLAG6:number = 32;\n\tpublic static FLAG7:number = 64;\n\tpublic static FLAG8:number = 128;\n\tpublic static FLAG9:number = 256;\n\tpublic static FLAG10:number = 512;\n\tpublic static FLAG11:number = 1024;\n\tpublic static FLAG12:number = 2048;\n\tpublic static FLAG13:number = 4096;\n\tpublic static FLAG14:number = 8192;\n\tpublic static FLAG15:number = 16384;\n\tpublic static FLAG16:number = 32768;\n\n\tpublic static test(flags:number, testFlag:number):boolean\n\t{\n\t\treturn (flags & testFlag) == testFlag;\n\t}\n}\n\nexport = BitFlags;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\n/**\n * \n */\nclass BoundsData\n{\n\t/**\n\t *\n\t */\n\tpublic min:Vector3D;\n\n\t/**\n\t *\n\t */\n\tpublic max:Vector3D;\n}\n\nexport = BoundsData;", + "/**\n *\n */\nclass FaceVO\n{\n\tpublic a:number /*int*/;\n\tpublic b:number /*int*/;\n\tpublic c:number /*int*/;\n\tpublic smoothGroup:number /*int*/;\n}\n\nexport = FaceVO;", + "/**\n *\n */\nclass FrameData\n{\n\t/**\n\t *\n\t */\n\tpublic index:number /*int*/;\n\n\t/**\n\t *\n\t */\n\tpublic components:Array;\n}\n\nexport = FrameData;", + "/**\n *\n */\nclass HierarchyData\n{\n\t/**\n\t *\n\t */\n\tpublic name:string;\n\n\t/**\n\t *\n\t */\n\tpublic parentIndex:number /*int*/;\n\n\t/**\n\t *\n\t */\n\tpublic flags:number /*int*/;\n\n\t/**\n\t *\n\t */\n\tpublic startIndex:number /*int*/;\n}\n\nexport = HierarchyData;", + "import MaterialBase\t\t\t\t\t\t= require(\"awayjs-core/lib/materials/MaterialBase\");\n\nimport TextureVO\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/parsers/data/TextureVO\");\n\n/**\n *\n */\nclass MaterialVO\n{\n\tpublic name:string;\n\tpublic ambientColor:number /*int*/;\n\tpublic diffuseColor:number /*int*/;\n\tpublic specularColor:number /*int*/;\n\tpublic twoSided:boolean;\n\tpublic colorMap:TextureVO;\n\tpublic specularMap:TextureVO;\n\tpublic material:MaterialBase;\n}\n\nexport = MaterialVO;", + "class ObjectVO\n{\n\tpublic name:string;\n\tpublic type:string;\n\tpublic pivotX:number;\n\tpublic pivotY:number;\n\tpublic pivotZ:number;\n\tpublic transform:Array;\n\tpublic verts:Array;\n\tpublic indices:Array /*int*/;\n\tpublic uvs:Array;\n\tpublic materialFaces:Object;\n\tpublic materials:Array;\n\tpublic smoothingGroups:Array /*int*/;\n}\n\nexport = ObjectVO;", + "import Texture2DBase\t\t\t\t\t= require(\"awayjs-core/lib/textures/Texture2DBase\");\n\n/**\n *\n */\nclass TextureVO\n{\n\tpublic url:string;\n\tpublic texture:Texture2DBase;\n}\n\nexport = TextureVO;", + "import Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nclass VertexVO\n{\n\tpublic x:number;\n\tpublic y:number;\n\tpublic z:number;\n\tpublic u:number;\n\tpublic v:number;\n\tpublic normal:Vector3D;\n\tpublic tangent:Vector3D;\n}\n\nexport = VertexVO;", + "import DisplayObjectContainer\t\t\t= require(\"awayjs-core/lib/containers/DisplayObjectContainer\");\nimport Geometry\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/base/Geometry\");\nimport TriangleSubGeometry\t\t\t\t= require(\"awayjs-core/lib/core/base/TriangleSubGeometry\");\nimport Matrix3DUtils\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Matrix3DUtils\");\nimport Mesh\t\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Mesh\");\nimport MaterialBase\t\t\t\t\t\t= require(\"awayjs-core/lib/materials/MaterialBase\");\n\n/**\n * Class Merge merges two or more static meshes into one.Merge\n */\nclass Merge\n{\n\n\t//private const LIMIT:uint = 196605;\n\tprivate _objectSpace:boolean;\n\tprivate _keepMaterial:boolean;\n\tprivate _disposeSources:boolean;\n\tprivate _geomVOs:Array;\n\tprivate _toDispose:Array;\n\n\t/**\n\t * @param keepMaterial [optional] Determines if the merged object uses the recevier mesh material information or keeps its source material(s). Defaults to false.\n\t * If false and receiver object has multiple materials, the last material found in receiver submeshes is applied to the merged submesh(es).\n\t * @param disposeSources [optional] Determines if the mesh and geometry source(s) used for the merging are disposed. Defaults to false.\n\t * If true, only receiver geometry and resulting mesh are kept in memory.\n\t * @param objectSpace [optional] Determines if source mesh(es) is/are merged using objectSpace or worldspace. Defaults to false.\n\t */\n\tconstructor(keepMaterial:boolean = false, disposeSources:boolean = false, objectSpace:boolean = false)\n\t{\n\t\tthis._keepMaterial = keepMaterial;\n\t\tthis._disposeSources = disposeSources;\n\t\tthis._objectSpace = objectSpace;\n\t}\n\n\t/**\n\t * Determines if the mesh and geometry source(s) used for the merging are disposed. Defaults to false.\n\t */\n\tpublic set disposeSources(b:boolean)\n\t{\n\t\tthis._disposeSources = b;\n\t}\n\n\tpublic get disposeSources():boolean\n\t{\n\t\treturn this._disposeSources;\n\t}\n\n\t/**\n\t * Determines if the material source(s) used for the merging are disposed. Defaults to false.\n\t */\n\tpublic set keepMaterial(b:boolean)\n\t{\n\t\tthis._keepMaterial = b;\n\t}\n\n\tpublic get keepMaterial():boolean\n\t{\n\t\treturn this._keepMaterial;\n\t}\n\n\t/**\n\t * Determines if source mesh(es) is/are merged using objectSpace or worldspace. Defaults to false.\n\t */\n\tpublic set objectSpace(b:boolean)\n\t{\n\t\tthis._objectSpace = b;\n\t}\n\n\tpublic get objectSpace():boolean\n\t{\n\t\treturn this._objectSpace;\n\t}\n\n\t/**\n\t * Merges all the children of a container into a single Mesh. If no Mesh object is found, method returns the receiver without modification.\n\t *\n\t * @param receiver The Mesh to receive the merged contents of the container.\n\t * @param objectContainer The DisplayObjectContainer holding the meshes to be mergd.\n\t *\n\t * @return The merged Mesh instance.\n\t */\n\tpublic applyToContainer(receiver:Mesh, objectContainer:DisplayObjectContainer)\n\t{\n\t\tthis.reset();\n\n\t\t//collect container meshes\n\t\tthis.parseContainer(receiver, objectContainer);\n\n\t\t//collect receiver\n\t\tthis.collect(receiver, false);\n\n\t\t//merge to receiver\n\t\tthis.merge(receiver, this._disposeSources);\n\t}\n\n\t/**\n\t * Merges all the meshes found in the Array<Mesh> into a single Mesh.\n\t *\n\t * @param receiver The Mesh to receive the merged contents of the meshes.\n\t * @param meshes A series of Meshes to be merged with the reciever mesh.\n\t */\n\tpublic applyToMeshes(receiver:Mesh, meshes:Array)\n\t{\n\t\tthis.reset();\n\n\t\tif (!meshes.length)\n\t\t\treturn;\n\n\t\t//collect meshes in vector\n\t\tfor (var i:number /*uint*/ = 0; i < meshes.length; i++)\n\t\t\tif (meshes[i] != receiver)\n\t\t\t\tthis.collect(meshes[i], this._disposeSources);\n\n\t\t//collect receiver\n\t\tthis.collect(receiver, false);\n\n\t\t//merge to receiver\n\t\tthis.merge(receiver, this._disposeSources);\n\t}\n\n\t/**\n\t * Merges 2 meshes into one. It is recommand to use apply when 2 meshes are to be merged. If more need to be merged, use either applyToMeshes or applyToContainer methods.\n\t *\n\t * @param receiver The Mesh to receive the merged contents of both meshes.\n\t * @param mesh The Mesh to be merged with the receiver mesh\n\t */\n\tpublic apply(receiver:Mesh, mesh:Mesh)\n\t{\n\t\tthis.reset();\n\n\t\t//collect mesh\n\t\tthis.collect(mesh, this._disposeSources);\n\n\t\t//collect receiver\n\t\tthis.collect(receiver, false);\n\n\t\t//merge to receiver\n\t\tthis.merge(receiver, this._disposeSources);\n\t}\n\n\tprivate reset()\n\t{\n\t\tthis._toDispose = new Array();\n\t\tthis._geomVOs = new Array();\n\t}\n\n\tprivate merge(destMesh:Mesh, dispose:boolean)\n\t{\n\t\tvar i:number /*uint*/;\n\t\tvar subIdx:number /*uint*/;\n\t\tvar oldGeom:Geometry;\n\t\tvar destGeom:Geometry;\n\t\tvar useSubMaterials:boolean;\n\n\t\toldGeom = destMesh.geometry;\n\t\tdestGeom = destMesh.geometry = new Geometry();\n\t\tsubIdx = destMesh.subMeshes.length;\n\n\t\t// Only apply materials directly to sub-meshes if necessary,\n\t\t// i.e. if there is more than one material available.\n\t\tuseSubMaterials = (this._geomVOs.length > 1);\n\n\t\tfor (i = 0; i < this._geomVOs.length; i++) {\n\t\t\tvar s:number /*uint*/;\n\t\t\tvar data:GeometryVO;\n\t\t\tvar sub:TriangleSubGeometry = new TriangleSubGeometry(true);\n\t\t\tsub.autoDeriveNormals = false;\n\t\t\tsub.autoDeriveTangents = false;\n\n\t\t\tdata = this._geomVOs[i];\n\t\t\tsub.updateIndices(data.indices);\n\t\t\tsub.updatePositions(data.vertices);\n\t\t\tsub.updateVertexNormals(data.normals);\n\t\t\tsub.updateVertexTangents(data.tangents);\n\t\t\tsub.updateUVs(data.uvs);\n\n\t\t\tdestGeom.addSubGeometry(sub);\n\n\t\t\tif (this._keepMaterial && useSubMaterials)\n\t\t\t\tdestMesh.subMeshes[subIdx].material = data.material;\n\t\t}\n\n\t\tif (this._keepMaterial && !useSubMaterials && this._geomVOs.length)\n\t\t\tdestMesh.material = this._geomVOs[0].material;\n\n\t\tif (dispose) {\n\t\t\tvar m:Mesh;\n\t\t\tvar len:number = this._toDispose.length;\n\t\t\tfor (var i:number; i < len; i++) {\n\t\t\t\tm = this._toDispose[i];\n\t\t\t\tm.geometry.dispose();\n\t\t\t\tm.dispose();\n\t\t\t}\n\n\t\t\t//dispose of the original receiver geometry\n\t\t\toldGeom.dispose();\n\t\t}\n\n\t\tthis._toDispose = null;\n\t}\n\n\tprivate collect(mesh:Mesh, dispose:boolean)\n\t{\n\t\tif (mesh.geometry) {\n\t\t\tvar subIdx:number /*uint*/;\n\t\t\tvar subGeometries:Array = > mesh.geometry.subGeometries;\n\t\t\tvar calc:number /*uint*/;\n\t\t\tfor (subIdx = 0; subIdx < subGeometries.length; subIdx++) {\n\t\t\t\tvar i:number /*uint*/;\n\t\t\t\tvar len:number /*uint*/;\n\t\t\t\tvar iIdx:number /*uint*/, vIdx:number /*uint*/, nIdx:number /*uint*/, tIdx:number /*uint*/, uIdx:number /*uint*/;\n\t\t\t\tvar indexOffset:number /*uint*/;\n\t\t\t\tvar subGeom:TriangleSubGeometry;\n\t\t\t\tvar vo:GeometryVO;\n\t\t\t\tvar vertices:Array;\n\t\t\t\tvar normals:Array;\n\t\t\t\tvar tangents:Array;\n\t\t\t\tvar pd:Array, nd:Array, td:Array, ud:Array;\n\n\t\t\t\tsubGeom = subGeometries[subIdx];\n\t\t\t\tpd = subGeom.positions;\n\t\t\t\tnd = subGeom.vertexNormals;\n\t\t\t\ttd = subGeom.vertexTangents;\n\t\t\t\tud = subGeom.uvs;\n\n\t\t\t\t// Get (or create) a VO for this material\n\t\t\t\tvo = this.getSubGeomData(mesh.subMeshes[subIdx].material || mesh.material);\n\n\t\t\t\t// Vertices and normals are copied to temporary vectors, to be transformed\n\t\t\t\t// before concatenated onto those of the data. This is unnecessary if no\n\t\t\t\t// transformation will be performed, i.e. for object space merging.\n\t\t\t\tvertices = (this._objectSpace)? vo.vertices : new Array();\n\t\t\t\tnormals = (this._objectSpace)? vo.normals : new Array();\n\t\t\t\ttangents = (this._objectSpace)? vo.tangents : new Array();\n\n\t\t\t\t// Copy over vertex attributes\n\t\t\t\tvIdx = vertices.length;\n\t\t\t\tnIdx = normals.length;\n\t\t\t\ttIdx = tangents.length;\n\t\t\t\tuIdx = vo.uvs.length;\n\t\t\t\tlen = subGeom.numVertices;\n\t\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\t\tcalc = i*3;\n\n\t\t\t\t\t// Position\n\t\t\t\t\tvertices[vIdx++] = pd[calc];\n\t\t\t\t\tvertices[vIdx++] = pd[calc + 1];\n\t\t\t\t\tvertices[vIdx++] = pd[calc + 2];\n\n\t\t\t\t\t// Normal\n\t\t\t\t\tnormals[nIdx++] = nd[calc];\n\t\t\t\t\tnormals[nIdx++] = nd[calc + 1];\n\t\t\t\t\tnormals[nIdx++] = nd[calc + 2];\n\n\t\t\t\t\t// Tangent\n\t\t\t\t\ttangents[tIdx++] = td[calc];\n\t\t\t\t\ttangents[tIdx++] = td[calc + 1];\n\t\t\t\t\ttangents[tIdx++] = td[calc + 2];\n\n\t\t\t\t\t// UV\n\t\t\t\t\tvo.uvs[uIdx++] = ud[i*2];\n\t\t\t\t\tvo.uvs[uIdx++] = ud[i*2 + 1];\n\t\t\t\t}\n\n\t\t\t\t// Copy over triangle indices\n\t\t\t\tindexOffset = (!this._objectSpace)? vo.vertices.length/3 :0;\n\t\t\t\tiIdx = vo.indices.length;\n\t\t\t\tlen = subGeom.numTriangles;\n\t\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\t\tcalc = i*3;\n\t\t\t\t\tvo.indices[iIdx++] = subGeom.indices[calc] + indexOffset;\n\t\t\t\t\tvo.indices[iIdx++] = subGeom.indices[calc + 1] + indexOffset;\n\t\t\t\t\tvo.indices[iIdx++] = subGeom.indices[calc + 2] + indexOffset;\n\t\t\t\t}\n\n\t\t\t\tif (!this._objectSpace) {\n\t\t\t\t\tmesh.sceneTransform.transformVectors(vertices, vertices);\n\t\t\t\t\tMatrix3DUtils.deltaTransformVectors(mesh.sceneTransform, normals, normals);\n\t\t\t\t\tMatrix3DUtils.deltaTransformVectors(mesh.sceneTransform, tangents, tangents);\n\n\t\t\t\t\t// Copy vertex data from temporary (transformed) vectors\n\t\t\t\t\tvIdx = vo.vertices.length;\n\t\t\t\t\tnIdx = vo.normals.length;\n\t\t\t\t\ttIdx = vo.tangents.length;\n\t\t\t\t\tlen = vertices.length;\n\t\t\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\t\t\tvo.vertices[vIdx++] = vertices[i];\n\t\t\t\t\t\tvo.normals[nIdx++] = normals[i];\n\t\t\t\t\t\tvo.tangents[tIdx++] = tangents[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (dispose)\n\t\t\t\tthis._toDispose.push(mesh);\n\t\t}\n\t}\n\n\tprivate getSubGeomData(material:MaterialBase):GeometryVO\n\t{\n\t\tvar data:GeometryVO;\n\n\t\tif (this._keepMaterial) {\n\t\t\tvar i:number /*uint*/;\n\t\t\tvar len:number /*uint*/;\n\n\t\t\tlen = this._geomVOs.length;\n\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\tif (this._geomVOs[i].material == material) {\n\t\t\t\t\tdata = this._geomVOs[i];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (this._geomVOs.length) {\n\t\t\t// If materials are not to be kept, all data can be\n\t\t\t// put into a single VO, so return that one.\n\t\t\tdata = this._geomVOs[0];\n\t\t}\n\n\t\t// No data (for this material) found, create new.\n\t\tif (!data) {\n\t\t\tdata = new GeometryVO();\n\t\t\tdata.vertices = new Array();\n\t\t\tdata.normals = new Array();\n\t\t\tdata.tangents = new Array();\n\t\t\tdata.uvs = new Array();\n\t\t\tdata.indices = new Array();\n\t\t\tdata.material = material;\n\n\t\t\tthis._geomVOs.push(data);\n\t\t}\n\n\t\treturn data;\n\t}\n\n\tprivate parseContainer(receiver:Mesh, object:DisplayObjectContainer)\n\t{\n\t\tvar child:DisplayObjectContainer;\n\t\tvar i:number /*uint*/;\n\n\t\tif (object instanceof Mesh && object != ( receiver))\n\t\t\tthis.collect( object, this._disposeSources);\n\n\t\tfor (i = 0; i < object.numChildren; ++i) {\n\t\t\tchild = object.getChildAt(i);\n\t\t\tthis.parseContainer(receiver, child);\n\t\t}\n\t}\n}\n\nexport = Merge;\n\nclass GeometryVO\n{\n\tpublic uvs:Array;\n\tpublic vertices:Array;\n\tpublic normals:Array;\n\tpublic tangents:Array;\n\tpublic indices:Array;\n\tpublic material:MaterialBase;\n}\n", + "import Matrix\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Matrix\");\nimport Matrix3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Matrix3D\");\n\n/**\n * ...\n */\nclass ParticleGeometryTransform\n{\n\tprivate _defaultVertexTransform:Matrix3D;\n\tprivate _defaultInvVertexTransform:Matrix3D;\n\tprivate _defaultUVTransform:Matrix;\n\n\tpublic set vertexTransform(value:Matrix3D)\n\t{\n\t\tthis._defaultVertexTransform = value;\n\t\tthis._defaultInvVertexTransform = value.clone();\n\t\tthis._defaultInvVertexTransform.invert();\n\t\tthis._defaultInvVertexTransform.transpose();\n\t}\n\n\tpublic set UVTransform(value:Matrix)\n\t{\n\t\tthis._defaultUVTransform = value;\n\t}\n\n\tpublic get UVTransform():Matrix\n\t{\n\t\treturn this._defaultUVTransform;\n\t}\n\n\tpublic get vertexTransform():Matrix3D\n\t{\n\t\treturn this._defaultVertexTransform;\n\t}\n\n\tpublic get invVertexTransform():Matrix3D\n\t{\n\t\treturn this._defaultInvVertexTransform;\n\t}\n}\n\nexport = ParticleGeometryTransform;", + "import Geometry\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/base/Geometry\");\nimport TriangleSubGeometry\t\t\t\t= require(\"awayjs-core/lib/core/base/TriangleSubGeometry\");\nimport Matrix\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Matrix\");\nimport Matrix3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Matrix3D\");\nimport Point\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Point\");\nimport Vector3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Vector3D\");\n\nimport Mesh\t\t\t\t\t\t\t\t= require(\"awayjs-core/lib/entities/Mesh\");\nimport MaterialBase\t\t\t\t\t\t= require(\"awayjs-core/lib/materials/MaterialBase\");\n\nimport ParticleData\t\t\t\t\t\t= require(\"awayjs-renderergl/lib/animators/data/ParticleData\");\nimport ParticleGeometry\t\t\t\t\t= require(\"awayjs-renderergl/lib/core/base/ParticleGeometry\");\nimport ParticleGeometryTransform\t\t= require(\"awayjs-renderergl/lib/tools/data/ParticleGeometryTransform\");\n\n/**\n * ...\n */\nclass ParticleGeometryHelper\n{\n\tpublic static MAX_VERTEX:number /*int*/ = 65535;\n\n\tpublic static generateGeometry(geometries:Array, transforms:Array = null):ParticleGeometry\n\t{\n\t\tvar indicesVector:Array> /*uint*/ = new Array>() /*uint*/;\n\t\tvar positionsVector:Array> = new Array>();\n\t\tvar normalsVector:Array> = new Array>();\n\t\tvar tangentsVector:Array> = new Array>();\n\t\tvar uvsVector:Array> = new Array>();\n\t\tvar vertexCounters:Array /*uint*/ = new Array() /*uint*/;\n\t\tvar particles:Array = new Array();\n\t\tvar subGeometries:Array = new Array();\n\t\tvar numParticles:number /*uint*/ = geometries.length;\n\n\t\tvar sourceSubGeometries:Array;\n\t\tvar sourceSubGeometry:TriangleSubGeometry;\n\t\tvar numSubGeometries:number /*uint*/;\n\t\tvar indices:Array /*uint*/;\n\t\tvar positions:Array;\n\t\tvar normals:Array;\n\t\tvar tangents:Array;\n\t\tvar uvs:Array;\n\t\tvar vertexCounter:number /*uint*/;\n\t\tvar subGeometry:TriangleSubGeometry;\n\t\tvar i:number /*int*/;\n\t\tvar j:number /*int*/;\n\t\tvar sub2SubMap:Array /*int*/ = new Array() /*int*/;\n\n\t\tvar tempVertex:Vector3D = new Vector3D;\n\t\tvar tempNormal:Vector3D = new Vector3D;\n\t\tvar tempTangents:Vector3D = new Vector3D;\n\t\tvar tempUV:Point = new Point;\n\n\t\tfor (i = 0; i < numParticles; i++) {\n\t\t\tsourceSubGeometries = > geometries[i].subGeometries;\n\t\t\tnumSubGeometries = sourceSubGeometries.length;\n\t\t\tfor (var srcIndex:number /*int*/ = 0; srcIndex < numSubGeometries; srcIndex++) {\n\t\t\t\t//create a different particle subgeometry group for each source subgeometry in a particle.\n\t\t\t\tif (sub2SubMap.length <= srcIndex) {\n\t\t\t\t\tsub2SubMap.push(subGeometries.length);\n\t\t\t\t\tindicesVector.push(new Array() /*uint*/);\n\t\t\t\t\tpositionsVector.push(new Array());\n\t\t\t\t\tnormalsVector.push(new Array());\n\t\t\t\t\ttangentsVector.push(new Array());\n\t\t\t\t\tuvsVector.push(new Array());\n\t\t\t\t\tsubGeometries.push(new TriangleSubGeometry(true));\n\t\t\t\t\tvertexCounters.push(0);\n\t\t\t\t}\n\n\t\t\t\tsourceSubGeometry = sourceSubGeometries[srcIndex];\n\n\t\t\t\t//add a new particle subgeometry if this source subgeometry will take us over the maxvertex limit\n\t\t\t\tif (sourceSubGeometry.numVertices + vertexCounters[sub2SubMap[srcIndex]] > ParticleGeometryHelper.MAX_VERTEX) {\n\t\t\t\t\t//update submap and add new subgeom vectors\n\t\t\t\t\tsub2SubMap[srcIndex] = subGeometries.length;\n\t\t\t\t\tindicesVector.push(new Array() /*uint*/);\n\t\t\t\t\tpositionsVector.push(new Array());\n\t\t\t\t\tnormalsVector.push(new Array());\n\t\t\t\t\ttangentsVector.push(new Array());\n\t\t\t\t\tuvsVector.push(new Array());\n\t\t\t\t\tsubGeometries.push(new TriangleSubGeometry(true));\n\t\t\t\t\tvertexCounters.push(0);\n\t\t\t\t}\n\n\t\t\t\tj = sub2SubMap[srcIndex];\n\n\t\t\t\t//select the correct vector\n\t\t\t\tindices = indicesVector[j];\n\t\t\t\tpositions = positionsVector[j];\n\t\t\t\tnormals = normalsVector[j];\n\t\t\t\ttangents = tangentsVector[j];\n\t\t\t\tuvs = uvsVector[j];\n\t\t\t\tvertexCounter = vertexCounters[j];\n\t\t\t\tsubGeometry = subGeometries[j];\n\n\t\t\t\tvar particleData:ParticleData = new ParticleData();\n\t\t\t\tparticleData.numVertices = sourceSubGeometry.numVertices;\n\t\t\t\tparticleData.startVertexIndex = vertexCounter;\n\t\t\t\tparticleData.particleIndex = i;\n\t\t\t\tparticleData.subGeometry = subGeometry;\n\t\t\t\tparticles.push(particleData);\n\n\t\t\t\tvertexCounters[j] += sourceSubGeometry.numVertices;\n\n\t\t\t\tvar k:number /*int*/;\n\t\t\t\tvar tempLen:number /*int*/;\n\t\t\t\tvar compact:TriangleSubGeometry = sourceSubGeometry;\n\t\t\t\tvar product:number /*uint*/;\n\t\t\t\tvar sourcePositions:Array;\n\t\t\t\tvar sourceNormals:Array;\n\t\t\t\tvar sourceTangents:Array;\n\t\t\t\tvar sourceUVs:Array;\n\n\t\t\t\tif (compact) {\n\t\t\t\t\ttempLen = compact.numVertices;\n\t\t\t\t\tcompact.numTriangles;\n\t\t\t\t\tsourcePositions = compact.positions;\n\t\t\t\t\tsourceNormals = compact.vertexNormals;\n\t\t\t\t\tsourceTangents = compact.vertexTangents;\n\t\t\t\t\tsourceUVs = compact.uvs;\n\n\t\t\t\t\tif (transforms) {\n\t\t\t\t\t\tvar particleGeometryTransform:ParticleGeometryTransform = transforms[i];\n\t\t\t\t\t\tvar vertexTransform:Matrix3D = particleGeometryTransform.vertexTransform;\n\t\t\t\t\t\tvar invVertexTransform:Matrix3D = particleGeometryTransform.invVertexTransform;\n\t\t\t\t\t\tvar UVTransform:Matrix = particleGeometryTransform.UVTransform;\n\n\t\t\t\t\t\tfor (k = 0; k < tempLen; k++) {\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t * 0 - 2: vertex position X, Y, Z\n\t\t\t\t\t\t\t * 3 - 5: normal X, Y, Z\n\t\t\t\t\t\t\t * 6 - 8: tangent X, Y, Z\n\t\t\t\t\t\t\t * 9 - 10: U V\n\t\t\t\t\t\t\t * 11 - 12: Secondary U V*/\n\t\t\t\t\t\t\tproduct = k*3;\n\t\t\t\t\t\t\ttempVertex.x = sourcePositions[product];\n\t\t\t\t\t\t\ttempVertex.y = sourcePositions[product + 1];\n\t\t\t\t\t\t\ttempVertex.z = sourcePositions[product + 2];\n\t\t\t\t\t\t\ttempNormal.x = sourceNormals[product];\n\t\t\t\t\t\t\ttempNormal.y = sourceNormals[product + 1];\n\t\t\t\t\t\t\ttempNormal.z = sourceNormals[product + 2];\n\t\t\t\t\t\t\ttempTangents.x = sourceTangents[product];\n\t\t\t\t\t\t\ttempTangents.y = sourceTangents[product + 1];\n\t\t\t\t\t\t\ttempTangents.z = sourceTangents[product + 2];\n\t\t\t\t\t\t\ttempUV.x = sourceUVs[k*2];\n\t\t\t\t\t\t\ttempUV.y = sourceUVs[k*2 + 1];\n\t\t\t\t\t\t\tif (vertexTransform) {\n\t\t\t\t\t\t\t\ttempVertex = vertexTransform.transformVector(tempVertex);\n\t\t\t\t\t\t\t\ttempNormal = invVertexTransform.deltaTransformVector(tempNormal);\n\t\t\t\t\t\t\t\ttempTangents = invVertexTransform.deltaTransformVector(tempNormal);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (UVTransform)\n\t\t\t\t\t\t\t\ttempUV = UVTransform.transformPoint(tempUV);\n\t\t\t\t\t\t\t//this is faster than that only push one data\n\t\t\t\t\t\t\tsourcePositions.push(tempVertex.x, tempVertex.y, tempVertex.z);\n\t\t\t\t\t\t\tsourceNormals.push(tempNormal.x, tempNormal.y, tempNormal.z);\n\t\t\t\t\t\t\tsourceTangents.push(tempTangents.x, tempTangents.y, tempTangents.z);\n\t\t\t\t\t\t\tsourceUVs.push(tempUV.x, tempUV.y);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor (k = 0; k < tempLen; k++) {\n\t\t\t\t\t\t\tproduct = k*3;\n\t\t\t\t\t\t\t//this is faster than that only push one data\n\t\t\t\t\t\t\tpositions.push(sourcePositions[product], sourcePositions[product + 1], sourcePositions[product + 2]);\n\t\t\t\t\t\t\tnormals.push(sourceNormals[product], sourceNormals[product + 1], sourceNormals[product + 2]);\n\t\t\t\t\t\t\ttangents.push(sourceTangents[product], sourceTangents[product + 1], sourceTangents[product + 2]);\n\t\t\t\t\t\t\tuvs.push(sourceUVs[k*2], sourceUVs[k*2 + 1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//Todo\n\t\t\t\t}\n\n\t\t\t\tvar sourceIndices:Array /*uint*/ = sourceSubGeometry.indices;\n\t\t\t\ttempLen = sourceSubGeometry.numTriangles;\n\t\t\t\tfor (k = 0; k < tempLen; k++) {\n\t\t\t\t\tproduct = k*3;\n\t\t\t\t\tindices.push(sourceIndices[product] + vertexCounter, sourceIndices[product + 1] + vertexCounter, sourceIndices[product + 2] + vertexCounter);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvar particleGeometry:ParticleGeometry = new ParticleGeometry();\n\t\tparticleGeometry.particles = particles;\n\t\tparticleGeometry.numParticles = numParticles;\n\n\t\tnumParticles = subGeometries.length;\n\t\tfor (i = 0; i < numParticles; i++) {\n\t\t\tsubGeometry = subGeometries[i];\n\t\t\tsubGeometry.autoDeriveNormals = false;\n\t\t\tsubGeometry.autoDeriveTangents = false;\n\t\t\tsubGeometry.updateIndices(indicesVector[i]);\n\t\t\tsubGeometry.updatePositions(positionsVector[i]);\n\t\t\tsubGeometry.updateVertexNormals(normalsVector[i]);\n\t\t\tsubGeometry.updateVertexTangents(tangentsVector[i]);\n\t\t\tsubGeometry.updateUVs(uvsVector[i]);\n\t\t\tparticleGeometry.addSubGeometry(subGeometry);\n\t\t}\n\n\t\treturn particleGeometry;\n\t}\n}\n\nexport = ParticleGeometryHelper;", + "import Matrix3D\t\t\t\t\t\t\t= require(\"awayjs-core/lib/core/geom/Matrix3D\");\n\n/**\n *\n */\nclass PerspectiveMatrix3D extends Matrix3D\n{\n\tconstructor(v:Array = null)\n\t{\n\t\tsuper(v);\n\t}\n\n\tpublic perspectiveFieldOfViewLH(fieldOfViewY:number, aspectRatio:number, zNear:number, zFar:number)\n\t{\n\t\tvar yScale:number = 1/Math.tan(fieldOfViewY/2);\n\t\tvar xScale:number = yScale/aspectRatio;\n\n\t\tthis.copyRawDataFrom([xScale, 0.0, 0.0, 0.0, 0.0, yScale, 0.0, 0.0, 0.0, 0.0, zFar/(zFar - zNear), 1.0, 0.0, 0.0, (zNear*zFar)/(zNear - zFar), 0.0]);\n\t}\n}\n\nexport = PerspectiveMatrix3D;" + ] +} \ No newline at end of file diff --git a/build/stagegl-extensions.next.d.ts b/build/stagegl-extensions.next.d.ts deleted file mode 100644 index 4ac612e8b..000000000 --- a/build/stagegl-extensions.next.d.ts +++ /dev/null @@ -1,5318 +0,0 @@ -/// -/// -/// -declare module away.events { - /** - * Dispatched to notify changes in an animation state's state. - */ - class AnimationStateEvent extends Event { - /** - * Dispatched when a non-looping clip node inside an animation state reaches the end of its timeline. - */ - static PLAYBACK_COMPLETE: string; - static TRANSITION_COMPLETE: string; - private _animator; - private _animationState; - private _animationNode; - /** - * Create a new AnimatonStateEvent - * - * @param type The event type. - * @param animator The animation state object that is the subject of this event. - * @param animationNode The animation node inside the animation state from which the event originated. - */ - constructor(type: string, animator: animators.AnimatorBase, animationState: animators.IAnimationState, animationNode: animators.AnimationNodeBase); - /** - * The animator object that is the subject of this event. - */ - public animator : animators.AnimatorBase; - /** - * The animation state object that is the subject of this event. - */ - public animationState : animators.IAnimationState; - /** - * The animation node inside the animation state from which the event originated. - */ - public animationNode : animators.AnimationNodeBase; - /** - * Clones the event. - * - * @return An exact duplicate of the current object. - */ - public clone(): Event; - } -} -/** -* @module away.base -*/ -declare module away.base { - /** - * @class away.base.ParticleGeometry - */ - class ParticleGeometry extends Geometry { - public particles: animators.ParticleData[]; - public numParticles: number; - } -} -/** -* @module away.pick -*/ -declare module away.pick { - /** - * An abstract base class for all picking collider classes. It should not be instantiated directly. - * - * @class away.pick.PickingColliderBase - */ - class PickingColliderBase { - private _billboardRenderablePool; - private _subMeshRenderablePool; - public rayPosition: geom.Vector3D; - public rayDirection: geom.Vector3D; - constructor(); - public _pPetCollisionNormal(indexData: number[], vertexData: number[], triangleIndex: number): geom.Vector3D; - public _pGetCollisionUV(indexData: number[], uvData: number[], triangleIndex: number, v: number, w: number, u: number, uvOffset: number, uvStride: number): geom.Point; - /** - * @inheritDoc - */ - public _pTestRenderableCollision(renderable: pool.RenderableBase, pickingCollisionVO: PickingCollisionVO, shortestCollisionDistance: number): boolean; - /** - * @inheritDoc - */ - public setLocalRay(localPosition: geom.Vector3D, localDirection: geom.Vector3D): void; - /** - * Tests a Billboard object for a collision with the picking ray. - * - * @param billboard The billboard instance to be tested. - * @param pickingCollisionVO The collision object used to store the collision results - * @param shortestCollisionDistance The current value of the shortest distance to a detected collision along the ray. - * @param findClosest - */ - public testBillboardCollision(billboard: entities.Billboard, pickingCollisionVO: PickingCollisionVO, shortestCollisionDistance: number): boolean; - /** - * Tests a Mesh object for a collision with the picking ray. - * - * @param mesh The mesh instance to be tested. - * @param pickingCollisionVO The collision object used to store the collision results - * @param shortestCollisionDistance The current value of the shortest distance to a detected collision along the ray. - * @param findClosest - */ - public testMeshCollision(mesh: entities.Mesh, pickingCollisionVO: PickingCollisionVO, shortestCollisionDistance: number, findClosest: boolean): boolean; - } -} -/** -* @module away.pick -*/ -declare module away.pick { - /** - * Pure JS picking collider for display objects. Used with the RaycastPicker picking object. - * - * @see away.base.DisplayObject#pickingCollider - * @see away.pick.RaycastPicker - * - * @class away.pick.JSPickingCollider - */ - class JSPickingCollider extends PickingColliderBase implements IPickingCollider { - private _findClosestCollision; - /** - * Creates a new JSPickingCollider object. - * - * @param findClosestCollision Determines whether the picking collider searches for the closest collision along the ray. Defaults to false. - */ - constructor(findClosestCollision?: boolean); - /** - * @inheritDoc - */ - public _pTestRenderableCollision(renderable: pool.RenderableBase, pickingCollisionVO: PickingCollisionVO, shortestCollisionDistance: number): boolean; - } -} -/** -* @module away.pick -*/ -declare module away.pick { - /** - * Picks a 3d object from a view or scene by performing a separate render pass on the scene around the area being picked using key color values, - * then reading back the color value of the pixel in the render representing the picking ray. Requires multiple passes and readbacks for retriving details - * on an entity that has its shaderPickingDetails property set to true. - * - * A read-back operation from any GPU is not a very efficient process, and the amount of processing used can vary significantly between different hardware. - * - * @see away.entities.Entity#shaderPickingDetails - * - * @class away.pick.ShaderPicker - */ - class ShaderPicker implements IPicker { - private _opaqueRenderableHead; - private _blendedRenderableHead; - private _stage; - private _context; - private _onlyMouseEnabled; - private _objectProgram; - private _triangleProgram; - private _bitmapData; - private _viewportData; - private _boundOffsetScale; - private _id; - private _interactives; - private _interactiveId; - private _hitColor; - private _projX; - private _projY; - private _hitRenderable; - private _hitEntity; - private _localHitPosition; - private _hitUV; - private _faceIndex; - private _subGeometryIndex; - private _localHitNormal; - private _rayPos; - private _rayDir; - private _potentialFound; - private static MOUSE_SCISSOR_RECT; - private _shaderPickingDetails; - /** - * @inheritDoc - */ - public onlyMouseEnabled : boolean; - /** - * Creates a new ShaderPicker object. - * - * @param shaderPickingDetails Determines whether the picker includes a second pass to calculate extra - * properties such as uv and normal coordinates. - */ - constructor(shaderPickingDetails?: boolean); - /** - * @inheritDoc - */ - public getViewCollision(x: number, y: number, view: containers.View): PickingCollisionVO; - /** - * @inheritDoc - */ - public getSceneCollision(position: geom.Vector3D, direction: geom.Vector3D, scene: containers.Scene): PickingCollisionVO; - /** - * @inheritDoc - */ - public pDraw(entityCollector: traverse.EntityCollector, target: stagegl.ITextureBase): void; - /** - * Draw a list of renderables. - * @param renderables The renderables to draw. - * @param camera The camera for which to render. - */ - private drawRenderables(renderable, camera); - private updateRay(camera); - /** - * Creates the Program that color-codes objects. - */ - private initObjectProgram(); - /** - * Creates the Program that renders positions. - */ - private initTriangleProgram(); - /** - * Gets more detailed information about the hir position, if required. - * @param camera The camera used to view the hit object. - */ - private getHitDetails(camera); - /** - * Finds a first-guess approximate position about the hit position. - * - * @param camera The camera used to view the hit object. - */ - private getApproximatePosition(camera); - /** - * Use the approximate position info to find the face under the mouse position from which we can derive the precise - * ray-face intersection point, then use barycentric coordinates to figure out the uv coordinates, etc. - * @param camera The camera used to view the hit object. - */ - private getPreciseDetails(camera); - /** - * Finds the precise hit position by unprojecting the screen coordinate back unto the hit face's plane and - * calculating the intersection point. - * @param camera The camera used to render the object. - * @param invSceneTransform The inverse scene transformation of the hit object. - * @param nx The x-coordinate of the face's plane normal. - * @param ny The y-coordinate of the face plane normal. - * @param nz The z-coordinate of the face plane normal. - * @param px The x-coordinate of a point on the face's plane (ie a face vertex) - * @param py The y-coordinate of a point on the face's plane (ie a face vertex) - * @param pz The z-coordinate of a point on the face's plane (ie a face vertex) - */ - private getPrecisePosition(invSceneTransform, nx, ny, nz, px, py, pz); - public dispose(): void; - } -} -declare module away.materials { - /** - * AmbientEnvMapMethod provides a diffuse shading method that uses a diffuse irradiance environment map to - * approximate global lighting rather than lights. - */ - class AmbientEnvMapMethod extends AmbientBasicMethod { - private _cubeTexture; - /** - * Creates a new AmbientEnvMapMethod object. - * - * @param envMap The cube environment map to use for the ambient lighting. - */ - constructor(envMap: textures.CubeTextureBase); - /** - * @inheritDoc - */ - public iInitVO(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * The cube environment map to use for the diffuse lighting. - */ - public envMap : textures.CubeTextureBase; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, regCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - } -} -declare module away.materials { - /** - * DiffuseCompositeMethod provides a base class for diffuse methods that wrap a diffuse method to alter the - * calculated diffuse reflection strength. - */ - class DiffuseCompositeMethod extends DiffuseBasicMethod { - public pBaseMethod: DiffuseBasicMethod; - private _onShaderInvalidatedDelegate; - /** - * Creates a new DiffuseCompositeMethod object. - * - * @param modulateMethod The method which will add the code to alter the base method's strength. It needs to have the signature clampDiffuse(t:ShaderRegisterElement, regCache:ShaderRegisterCache):string, in which t.w will contain the diffuse strength. - * @param baseMethod The base diffuse method on which this method's shading is based. - */ - constructor(modulateMethod: (shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData) => string, baseMethod?: DiffuseBasicMethod); - /** - * The base diffuse method on which this method's shading is based. - */ - public baseMethod : DiffuseBasicMethod; - /** - * @inheritDoc - */ - public iInitVO(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; - /** - * @inheritDoc - */ - public iInitConstants(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; - /** - * @inheritDoc - */ - public dispose(): void; - /** - * @inheritDoc - */ - /** - * @inheritDoc - */ - public texture : textures.Texture2DBase; - /** - * @inheritDoc - */ - /** - * @inheritDoc - */ - public diffuseColor : number; - /** - * @inheritDoc - */ - /** - * @inheritDoc - */ - public ambientColor : number; - /** - * @inheritDoc - */ - public iGetFragmentPreLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iGetFragmentCodePerLight(shaderObject: ShaderLightingObject, methodVO: MethodVO, lightDirReg: ShaderRegisterElement, lightColReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iGetFragmentCodePerProbe(shaderObject: ShaderLightingObject, methodVO: MethodVO, cubeMapReg: ShaderRegisterElement, weightRegister: string, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public iSetRenderState(shaderObject: ShaderLightingObject, methodVO: MethodVO, renderable: pool.RenderableBase, stage: base.Stage, camera: entities.Camera): void; - /** - * @inheritDoc - */ - public iDeactivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public iGetVertexCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iGetFragmentPostLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iReset(): void; - /** - * @inheritDoc - */ - public iCleanCompilationData(): void; - /** - * Called when the base method's shader code is invalidated. - */ - private onShaderInvalidated(event); - } -} -declare module away.materials { - /** - * DiffuseCelMethod provides a shading method to add diffuse cel (cartoon) shading. - */ - class DiffuseCelMethod extends DiffuseCompositeMethod { - private _levels; - private _dataReg; - private _smoothness; - /** - * Creates a new DiffuseCelMethod object. - * @param levels The amount of shadow gradations. - * @param baseMethod An optional diffuse method on which the cartoon shading is based. If omitted, DiffuseBasicMethod is used. - */ - constructor(levels?: number, baseMethod?: DiffuseBasicMethod); - /** - * @inheritDoc - */ - public iInitConstants(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; - /** - * The amount of shadow gradations. - */ - public levels : number; - /** - * The smoothness of the edge between 2 shading levels. - */ - public smoothness : number; - /** - * @inheritDoc - */ - public iCleanCompilationData(): void; - /** - * @inheritDoc - */ - public iGetFragmentPreLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: base.Stage): void; - /** - * Snaps the diffuse shading of the wrapped method to one of the levels. - * @param vo The MethodVO used to compile the current shader. - * @param t The register containing the diffuse strength in the "w" component. - * @param regCache The register cache used for the shader compilation. - * @param sharedRegisters The shared register data for this shader. - * @return The AGAL fragment code for the method. - */ - private clampDiffuse(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); - } -} -declare module away.materials { - /** - * DiffuseDepthMethod provides a debug method to visualise depth maps - */ - class DiffuseDepthMethod extends DiffuseBasicMethod { - /** - * Creates a new DiffuseBasicMethod object. - */ - constructor(); - /** - * @inheritDoc - */ - public iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * @inheritDoc - */ - public iGetFragmentPostLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - } -} -declare module away.materials { - /** - * DiffuseGradientMethod is an alternative to DiffuseBasicMethod in which the shading can be modulated with a gradient - * to introduce color-tinted shading as opposed to the single-channel diffuse strength. This can be used as a crude - * approximation to subsurface scattering (for instance, the mid-range shading for skin can be tinted red to similate - * scattered light within the skin attributing to the final colour) - */ - class DiffuseGradientMethod extends DiffuseBasicMethod { - private _gradientTextureRegister; - private _gradient; - /** - * Creates a new DiffuseGradientMethod object. - * @param gradient A texture that contains the light colour based on the angle. This can be used to change - * the light colour due to subsurface scattering when the surface faces away from the light. - */ - constructor(gradient: textures.Texture2DBase); - /** - * A texture that contains the light colour based on the angle. This can be used to change the light colour - * due to subsurface scattering when the surface faces away from the light. - */ - public gradient : textures.Texture2DBase; - /** - * @inheritDoc - */ - public iCleanCompilationData(): void; - /** - * @inheritDoc - */ - public iGetFragmentPreLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iGetFragmentCodePerLight(shaderObject: ShaderLightingObject, methodVO: MethodVO, lightDirReg: ShaderRegisterElement, lightColReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public pApplyShadow(shaderObject: ShaderLightingObject, methodVO: MethodVO, regCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: base.Stage): void; - } -} -declare module away.materials { - /** - * DiffuseLightMapMethod provides a diffuse shading method that uses a light map to modulate the calculated diffuse - * lighting. It is different from EffectLightMapMethod in that the latter modulates the entire calculated pixel color, rather - * than only the diffuse lighting value. - */ - class DiffuseLightMapMethod extends DiffuseCompositeMethod { - /** - * Indicates the light map should be multiplied with the calculated shading result. - * This can be used to add pre-calculated shadows or occlusion. - */ - static MULTIPLY: string; - /** - * Indicates the light map should be added into the calculated shading result. - * This can be used to add pre-calculated lighting or global illumination. - */ - static ADD: string; - private _lightMapTexture; - private _blendMode; - private _useSecondaryUV; - /** - * Creates a new DiffuseLightMapMethod method. - * - * @param lightMap The texture containing the light map. - * @param blendMode The blend mode with which the light map should be applied to the lighting result. - * @param useSecondaryUV Indicates whether the secondary UV set should be used to map the light map. - * @param baseMethod The diffuse method used to calculate the regular diffuse-based lighting. - */ - constructor(lightMap: textures.Texture2DBase, blendMode?: string, useSecondaryUV?: boolean, baseMethod?: DiffuseBasicMethod); - /** - * @inheritDoc - */ - public iInitVO(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; - /** - * The blend mode with which the light map should be applied to the lighting result. - * - * @see DiffuseLightMapMethod.ADD - * @see DiffuseLightMapMethod.MULTIPLY - */ - public blendMode : string; - /** - * The texture containing the light map data. - */ - public lightMapTexture : textures.Texture2DBase; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public iGetFragmentPostLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - } -} -declare module away.materials { - /** - * DiffuseWrapMethod is an alternative to DiffuseBasicMethod in which the light is allowed to be "wrapped around" the normally dark area, to some extent. - * It can be used as a crude approximation to Oren-Nayar or simple subsurface scattering. - */ - class DiffuseWrapMethod extends DiffuseBasicMethod { - private _wrapDataRegister; - private _wrapFactor; - /** - * Creates a new DiffuseWrapMethod object. - * @param wrapFactor A factor to indicate the amount by which the light is allowed to wrap - */ - constructor(wrapFactor?: number); - /** - * @inheritDoc - */ - public iCleanCompilationData(): void; - /** - * A factor to indicate the amount by which the light is allowed to wrap. - */ - public wrapFactor : number; - /** - * @inheritDoc - */ - public iGetFragmentPreLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iGetFragmentCodePerLight(shaderObject: ShaderLightingObject, methodVO: MethodVO, lightDirReg: ShaderRegisterElement, lightColReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: base.Stage): void; - } -} -declare module away.materials { - /** - * EffectAlphaMaskMethod allows the use of an additional texture to specify the alpha value of the material. When used - * with the secondary uv set, it allows for a tiled main texture with independently varying alpha (useful for water - * etc). - */ - class EffectAlphaMaskMethod extends EffectMethodBase { - private _texture; - private _useSecondaryUV; - /** - * Creates a new EffectAlphaMaskMethod object. - * - * @param texture The texture to use as the alpha mask. - * @param useSecondaryUV Indicated whether or not the secondary uv set for the mask. This allows mapping alpha independently. - */ - constructor(texture: textures.Texture2DBase, useSecondaryUV?: boolean); - /** - * @inheritDoc - */ - public iInitVO(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * Indicated whether or not the secondary uv set for the mask. This allows mapping alpha independently, for - * instance to tile the main texture and normal map while providing untiled alpha, for example to define the - * transparency over a tiled water surface. - */ - public useSecondaryUV : boolean; - /** - * The texture to use as the alpha mask. - */ - public texture : textures.Texture2DBase; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - } -} -declare module away.materials { - /** - * EffectColorMatrixMethod provides a shading method that changes the colour of a material analogous to a ColorMatrixFilter. - */ - class EffectColorMatrixMethod extends EffectMethodBase { - private _matrix; - /** - * Creates a new EffectColorTransformMethod. - * - * @param matrix An array of 20 items for 4 x 5 color transform. - */ - constructor(matrix: number[]); - /** - * The 4 x 5 matrix to transform the color of the material. - */ - public colorMatrix : number[]; - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - } -} -declare module away.materials { - /** - * EffectEnvMapMethod provides a material method to perform reflection mapping using cube maps. - */ - class EffectEnvMapMethod extends EffectMethodBase { - private _cubeTexture; - private _alpha; - private _mask; - /** - * Creates an EffectEnvMapMethod object. - * @param envMap The environment map containing the reflected scene. - * @param alpha The reflectivity of the surface. - */ - constructor(envMap: textures.CubeTextureBase, alpha?: number); - /** - * An optional texture to modulate the reflectivity of the surface. - */ - public mask : textures.Texture2DBase; - /** - * @inheritDoc - */ - public iInitVO(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * The cubic environment map containing the reflected scene. - */ - public envMap : textures.CubeTextureBase; - /** - * @inheritDoc - */ - public dispose(): void; - /** - * The reflectivity of the surface. - */ - public alpha : number; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - } -} -declare module away.materials { - /** - * EffectFogMethod provides a method to add distance-based fog to a material. - */ - class EffectFogMethod extends EffectMethodBase { - private _minDistance; - private _maxDistance; - private _fogColor; - private _fogR; - private _fogG; - private _fogB; - /** - * Creates a new EffectFogMethod object. - * @param minDistance The distance from which the fog starts appearing. - * @param maxDistance The distance at which the fog is densest. - * @param fogColor The colour of the fog. - */ - constructor(minDistance: number, maxDistance: number, fogColor?: number); - /** - * @inheritDoc - */ - public iInitVO(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; - /** - * @inheritDoc - */ - public iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * The distance from which the fog starts appearing. - */ - public minDistance : number; - /** - * The distance at which the fog is densest. - */ - public maxDistance : number; - /** - * The colour of the fog. - */ - public fogColor : number; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - } -} -declare module away.materials { - /** - * EffectFresnelEnvMapMethod provides a method to add fresnel-based reflectivity to an object using cube maps, which gets - * stronger as the viewing angle becomes more grazing. - */ - class EffectFresnelEnvMapMethod extends EffectMethodBase { - private _cubeTexture; - private _fresnelPower; - private _normalReflectance; - private _alpha; - private _mask; - /** - * Creates a new EffectFresnelEnvMapMethod object. - * - * @param envMap The environment map containing the reflected scene. - * @param alpha The reflectivity of the material. - */ - constructor(envMap: textures.CubeTextureBase, alpha?: number); - /** - * @inheritDoc - */ - public iInitVO(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * @inheritDoc - */ - public iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * An optional texture to modulate the reflectivity of the surface. - */ - public mask : textures.Texture2DBase; - /** - * The power used in the Fresnel equation. Higher values make the fresnel effect more pronounced. Defaults to 5. - */ - public fresnelPower : number; - /** - * The cubic environment map containing the reflected scene. - */ - public envMap : textures.CubeTextureBase; - /** - * The reflectivity of the surface. - */ - public alpha : number; - /** - * The minimum amount of reflectance, ie the reflectance when the view direction is normal to the surface or light direction. - */ - public normalReflectance : number; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - } -} -declare module away.materials { - /** - * EffectLightMapMethod provides a method that allows applying a light map texture to the calculated pixel colour. - * It is different from DiffuseLightMapMethod in that the latter only modulates the diffuse shading value rather - * than the whole pixel colour. - */ - class EffectLightMapMethod extends EffectMethodBase { - /** - * Indicates the light map should be multiplied with the calculated shading result. - */ - static MULTIPLY: string; - /** - * Indicates the light map should be added into the calculated shading result. - */ - static ADD: string; - private _texture; - private _blendMode; - private _useSecondaryUV; - /** - * Creates a new EffectLightMapMethod object. - * - * @param texture The texture containing the light map. - * @param blendMode The blend mode with which the light map should be applied to the lighting result. - * @param useSecondaryUV Indicates whether the secondary UV set should be used to map the light map. - */ - constructor(texture: textures.Texture2DBase, blendMode?: string, useSecondaryUV?: boolean); - /** - * @inheritDoc - */ - public iInitVO(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * The blend mode with which the light map should be applied to the lighting result. - * - * @see EffectLightMapMethod.ADD - * @see EffectLightMapMethod.MULTIPLY - */ - public blendMode : string; - /** - * The texture containing the light map. - */ - public texture : textures.Texture2DBase; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - } -} -declare module away.materials { - /** - * EffectRefractionEnvMapMethod provides a method to add refracted transparency based on cube maps. - */ - class EffectRefractionEnvMapMethod extends EffectMethodBase { - private _envMap; - private _dispersionR; - private _dispersionG; - private _dispersionB; - private _useDispersion; - private _refractionIndex; - private _alpha; - /** - * Creates a new EffectRefractionEnvMapMethod object. Example values for dispersion are: dispersionR: -0.03, dispersionG: -0.01, dispersionB: = .0015 - * - * @param envMap The environment map containing the refracted scene. - * @param refractionIndex The refractive index of the material. - * @param dispersionR The amount of chromatic dispersion of the red channel. Defaults to 0 (none). - * @param dispersionG The amount of chromatic dispersion of the green channel. Defaults to 0 (none). - * @param dispersionB The amount of chromatic dispersion of the blue channel. Defaults to 0 (none). - */ - constructor(envMap: textures.CubeTextureBase, refractionIndex?: number, dispersionR?: number, dispersionG?: number, dispersionB?: number); - /** - * @inheritDoc - */ - public iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * @inheritDoc - */ - public iInitVO(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * The cube environment map to use for the refraction. - */ - public envMap : textures.CubeTextureBase; - /** - * The refractive index of the material. - */ - public refractionIndex : number; - /** - * The amount of chromatic dispersion of the red channel. Defaults to 0 (none). - */ - public dispersionR : number; - /** - * The amount of chromatic dispersion of the green channel. Defaults to 0 (none). - */ - public dispersionG : number; - /** - * The amount of chromatic dispersion of the blue channel. Defaults to 0 (none). - */ - public dispersionB : number; - /** - * The amount of transparency of the object. Warning: the alpha applies to the refracted color, not the actual - * material. A value of 1 will make it appear fully transparent. - */ - public alpha : number; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - } -} -declare module away.materials { - /** - * EffectRimLightMethod provides a method to add rim lighting to a material. This adds a glow-like effect to edges of objects. - */ - class EffectRimLightMethod extends EffectMethodBase { - static ADD: string; - static MULTIPLY: string; - static MIX: string; - private _color; - private _blendMode; - private _colorR; - private _colorG; - private _colorB; - private _strength; - private _power; - /** - * Creates a new EffectRimLightMethod object. - * - * @param color The colour of the rim light. - * @param strength The strength of the rim light. - * @param power The power of the rim light. Higher values will result in a higher edge fall-off. - * @param blend The blend mode with which to add the light to the object. - */ - constructor(color?: number, strength?: number, power?: number, blend?: string); - /** - * @inheritDoc - */ - public iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * @inheritDoc - */ - public iInitVO(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * The blend mode with which to add the light to the object. - * - * EffectRimLightMethod.MULTIPLY multiplies the rim light with the material's colour. - * EffectRimLightMethod.ADD adds the rim light with the material's colour. - * EffectRimLightMethod.MIX provides normal alpha blending. - */ - public blendMode : string; - /** - * The color of the rim light. - */ - public color : number; - /** - * The strength of the rim light. - */ - public strength : number; - /** - * The power of the rim light. Higher values will result in a higher edge fall-off. - */ - public power : number; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - } -} -declare module away.materials { - /** - * NormalHeightMapMethod provides a normal map method that uses a height map to calculate the normals. - */ - class NormalHeightMapMethod extends NormalBasicMethod { - private _worldXYRatio; - private _worldXZRatio; - /** - * Creates a new NormalHeightMapMethod method. - * - * @param heightMap The texture containing the height data. 0 means low, 1 means high. - * @param worldWidth The width of the 'world'. This is used to map uv coordinates' u component to scene dimensions. - * @param worldHeight The height of the 'world'. This is used to map the height map values to scene dimensions. - * @param worldDepth The depth of the 'world'. This is used to map uv coordinates' v component to scene dimensions. - */ - constructor(heightMap: textures.Texture2DBase, worldWidth: number, worldHeight: number, worldDepth: number); - /** - * @inheritDoc - */ - public iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * @inheritDoc - */ - public tangentSpace : boolean; - /** - * @inheritDoc - */ - public copyFrom(method: ShadingMethodBase): void; - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - } -} -declare module away.materials { - /** - * NormalSimpleWaterMethod provides a basic normal map method to create water ripples by translating two wave normal maps. - */ - class NormalSimpleWaterMethod extends NormalBasicMethod { - private _texture2; - private _normalTextureRegister2; - private _useSecondNormalMap; - private _water1OffsetX; - private _water1OffsetY; - private _water2OffsetX; - private _water2OffsetY; - /** - * Creates a new NormalSimpleWaterMethod object. - * @param waveMap1 A normal map containing one layer of a wave structure. - * @param waveMap2 A normal map containing a second layer of a wave structure. - */ - constructor(waveMap1: textures.Texture2DBase, waveMap2: textures.Texture2DBase); - /** - * @inheritDoc - */ - public iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * @inheritDoc - */ - public iInitVO(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * The translation of the first wave layer along the X-axis. - */ - public water1OffsetX : number; - /** - * The translation of the first wave layer along the Y-axis. - */ - public water1OffsetY : number; - /** - * The translation of the second wave layer along the X-axis. - */ - public water2OffsetX : number; - /** - * The translation of the second wave layer along the Y-axis. - */ - public water2OffsetY : number; - /** - * A second normal map that will be combined with the first to create a wave-like animation pattern. - */ - public secondaryNormalMap : textures.Texture2DBase; - /** - * @inheritDoc - */ - public iCleanCompilationData(): void; - /** - * @inheritDoc - */ - public dispose(): void; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - } -} -declare module away.materials { - /** - * ShadowCascadeMethod is a shadow map method to apply cascade shadow mapping on materials. - * Must be used with a DirectionalLight with a CascadeShadowMapper assigned to its shadowMapper property. - * - * @see away.lights.CascadeShadowMapper - */ - class ShadowCascadeMethod extends ShadowMapMethodBase { - private _baseMethod; - private _cascadeShadowMapper; - private _depthMapCoordVaryings; - private _cascadeProjections; - /** - * Creates a new ShadowCascadeMethod object. - * - * @param shadowMethodBase The shadow map sampling method used to sample individual cascades (fe: ShadowHardMethod, ShadowSoftMethod) - */ - constructor(shadowMethodBase: ShadowMethodBase); - /** - * The shadow map sampling method used to sample individual cascades. These are typically those used in conjunction - * with a DirectionalShadowMapper. - * - * @see ShadowHardMethod - * @see ShadowSoftMethod - */ - public baseMethod : ShadowMethodBase; - /** - * @inheritDoc - */ - public iInitVO(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; - /** - * @inheritDoc - */ - public iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * @inheritDoc - */ - public iCleanCompilationData(): void; - /** - * @inheritDoc - */ - public iGetVertexCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * Creates the registers for the cascades' projection coordinates. - */ - private initProjectionsRegs(registerCache); - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public iSetRenderState(shaderObject: ShaderObjectBase, methodVO: MethodVO, renderable: pool.RenderableBase, stage: base.Stage, camera: entities.Camera): void; - /** - * Called when the shadow mappers cascade configuration changes. - */ - private onCascadeChange(event); - /** - * Called when the base method's shader code is invalidated. - */ - private onShaderInvalidated(event); - } -} -declare module away.materials { - /** - * ShadowDitheredMethod provides a soft shadowing technique by randomly distributing sample points differently for each fragment. - */ - class ShadowDitheredMethod extends ShadowMethodBase { - private static _grainTexture; - private static _grainUsages; - private static _grainBitmapData; - private _depthMapSize; - private _range; - private _numSamples; - /** - * Creates a new ShadowDitheredMethod object. - * @param castingLight The light casting the shadows - * @param numSamples The amount of samples to take for dithering. Minimum 1, maximum 24. - */ - constructor(castingLight: entities.DirectionalLight, numSamples?: number, range?: number); - /** - * The amount of samples to take for dithering. Minimum 1, maximum 24. The actual maximum may depend on the - * complexity of the shader. - */ - public numSamples : number; - /** - * @inheritDoc - */ - public iInitVO(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; - /** - * @inheritDoc - */ - public iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * The range in the shadow map in which to distribute the samples. - */ - public range : number; - /** - * Creates a texture containing the dithering noise texture. - */ - private initGrainTexture(); - /** - * @inheritDoc - */ - public dispose(): void; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public _pGetPlanarFragmentCode(methodVO: MethodVO, targetReg: ShaderRegisterElement, regCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * Get the actual shader code for shadow mapping - * @param regCache The register cache managing the registers. - * @param depthMapRegister The texture register containing the depth map. - * @param decReg The register containing the depth map decoding data. - * @param targetReg The target register to add the shadow coverage. - */ - private getSampleCode(customDataReg, depthMapRegister, decReg, targetReg, regCache, sharedRegisters); - /** - * Adds the code for another tap to the shader code. - * @param uvReg The uv register for the tap. - * @param depthMapRegister The texture register containing the depth map. - * @param decReg The register containing the depth map decoding data. - * @param targetReg The target register to add the tap comparison result. - * @param regCache The register cache managing the registers. - * @return - */ - private addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); - /** - * @inheritDoc - */ - public iActivateForCascade(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public _iGetCascadeFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, decodeRegister: ShaderRegisterElement, depthTexture: ShaderRegisterElement, depthProjection: ShaderRegisterElement, targetRegister: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - } -} -declare module away.materials { - /** - * ShadowFilteredMethod provides a softened shadowing technique by bilinearly interpolating shadow comparison - * results of neighbouring pixels. - */ - class ShadowFilteredMethod extends ShadowMethodBase { - /** - * Creates a new DiffuseBasicMethod object. - * - * @param castingLight The light casting the shadow - */ - constructor(castingLight: entities.DirectionalLight); - /** - * @inheritDoc - */ - public iInitConstants(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; - /** - * @inheritDoc - */ - public _pGetPlanarFragmentCode(methodVO: MethodVO, targetReg: ShaderRegisterElement, regCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iActivateForCascade(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public _iGetCascadeFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, decodeRegister: ShaderRegisterElement, depthTexture: ShaderRegisterElement, depthProjection: ShaderRegisterElement, targetRegister: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - } -} -declare module away.materials { - /** - * ShadowNearMethod provides a shadow map method that restricts the shadowed area near the camera to optimize - * shadow map usage. This method needs to be used in conjunction with a NearDirectionalShadowMapper. - * - * @see away.lights.NearDirectionalShadowMapper - */ - class ShadowNearMethod extends ShadowMethodBase { - private _baseMethod; - private _fadeRatio; - private _nearShadowMapper; - private _onShaderInvalidatedDelegate; - /** - * Creates a new ShadowNearMethod object. - * @param baseMethod The shadow map sampling method used to sample individual cascades (fe: ShadowHardMethod, ShadowSoftMethod) - * @param fadeRatio The amount of shadow fading to the outer shadow area. A value of 1 would mean the shadows start fading from the camera's near plane. - */ - constructor(baseMethod: ShadowMethodBase, fadeRatio?: number); - /** - * The base shadow map method on which this method's shading is based. - */ - public baseMethod : ShadowMethodBase; - /** - * @inheritDoc - */ - public iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * @inheritDoc - */ - public iInitVO(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; - /** - * @inheritDoc - */ - public dispose(): void; - /** - * @inheritDoc - */ - public alpha : number; - /** - * @inheritDoc - */ - public epsilon : number; - /** - * The amount of shadow fading to the outer shadow area. A value of 1 would mean the shadows start fading from the camera's near plane. - */ - public fadeRatio : number; - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public iDeactivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public iSetRenderState(shaderObject: ShaderObjectBase, methodVO: MethodVO, renderable: pool.RenderableBase, stage: base.Stage, camera: entities.Camera): void; - /** - * @inheritDoc - */ - public iGetVertexCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iReset(): void; - /** - * @inheritDoc - */ - public iCleanCompilationData(): void; - /** - * Called when the base method's shader code is invalidated. - */ - private onShaderInvalidated(event); - } -} -declare module away.materials { - /** - * ShadowSoftMethod provides a soft shadowing technique by randomly distributing sample points. - */ - class ShadowSoftMethod extends ShadowMethodBase { - private _range; - private _numSamples; - private _offsets; - /** - * Creates a new DiffuseBasicMethod object. - * - * @param castingLight The light casting the shadows - * @param numSamples The amount of samples to take for dithering. Minimum 1, maximum 32. - */ - constructor(castingLight: entities.DirectionalLight, numSamples?: number, range?: number); - /** - * The amount of samples to take for dithering. Minimum 1, maximum 32. The actual maximum may depend on the - * complexity of the shader. - */ - public numSamples : number; - /** - * The range in the shadow map in which to distribute the samples. - */ - public range : number; - /** - * @inheritDoc - */ - public iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public _pGetPlanarFragmentCode(methodVO: MethodVO, targetReg: ShaderRegisterElement, regCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * Adds the code for another tap to the shader code. - * @param uv The uv register for the tap. - * @param texture The texture register containing the depth map. - * @param decode The register containing the depth map decoding data. - * @param target The target register to add the tap comparison result. - * @param regCache The register cache managing the registers. - * @return - */ - private addSample(uv, texture, decode, target, regCache); - /** - * @inheritDoc - */ - public iActivateForCascade(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public _iGetCascadeFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, decodeRegister: ShaderRegisterElement, depthTexture: ShaderRegisterElement, depthProjection: ShaderRegisterElement, targetRegister: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * Get the actual shader code for shadow mapping - * @param regCache The register cache managing the registers. - * @param depthTexture The texture register containing the depth map. - * @param decodeRegister The register containing the depth map decoding data. - * @param targetReg The target register to add the shadow coverage. - * @param dataReg The register containing additional data. - */ - private getSampleCode(regCache, depthTexture, decodeRegister, targetRegister, dataReg); - } -} -declare module away.materials { - /** - * SpecularCompositeMethod provides a base class for specular methods that wrap a specular method to alter the - * calculated specular reflection strength. - */ - class SpecularCompositeMethod extends SpecularBasicMethod { - private _baseMethod; - private _onShaderInvalidatedDelegate; - /** - * Creates a new SpecularCompositeMethod object. - * - * @param modulateMethod The method which will add the code to alter the base method's strength. It needs to have the signature modSpecular(t:ShaderRegisterElement, regCache:ShaderRegisterCache):string, in which t.w will contain the specular strength and t.xyz will contain the half-vector or the reflection vector. - * @param baseMethod The base specular method on which this method's shading is based. - */ - constructor(modulateMethod: (shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData) => string, baseMethod?: SpecularBasicMethod); - /** - * @inheritDoc - */ - public iInitVO(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; - /** - * @inheritDoc - */ - public iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * The base specular method on which this method's shading is based. - */ - public baseMethod : SpecularBasicMethod; - /** - * @inheritDoc - */ - public gloss : number; - /** - * @inheritDoc - */ - public specular : number; - /** - * @inheritDoc - */ - public passes : MaterialPassBase[]; - /** - * @inheritDoc - */ - public dispose(): void; - /** - * @inheritDoc - */ - public texture : textures.Texture2DBase; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public iSetRenderState(shaderObject: ShaderLightingObject, methodVO: MethodVO, renderable: pool.RenderableBase, stage: base.Stage, camera: entities.Camera): void; - /** - * @inheritDoc - */ - public iDeactivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public iGetVertexCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iGetFragmentPreLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iGetFragmentCodePerLight(shaderObject: ShaderLightingObject, methodVO: MethodVO, lightDirReg: ShaderRegisterElement, lightColReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - * @return - */ - public iGetFragmentCodePerProbe(shaderObject: ShaderLightingObject, methodVO: MethodVO, cubeMapReg: ShaderRegisterElement, weightRegister: string, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iGetFragmentPostLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iReset(): void; - /** - * @inheritDoc - */ - public iCleanCompilationData(): void; - /** - * Called when the base method's shader code is invalidated. - */ - private onShaderInvalidated(event); - } -} -/** -* -*/ -declare module away.materials { - /** - * SpecularAnisotropicMethod provides a specular method resulting in anisotropic highlights. These are typical for - * surfaces with microfacet details such as tiny grooves. In particular, this uses the Heidrich-Seidel distrubution. - * The tangent vectors are used as the surface groove directions. - */ - class SpecularAnisotropicMethod extends SpecularBasicMethod { - /** - * Creates a new SpecularAnisotropicMethod object. - */ - constructor(); - /** - * @inheritDoc - */ - public iInitVO(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; - /** - * @inheritDoc - */ - public iGetFragmentCodePerLight(shaderObject: ShaderLightingObject, methodVO: MethodVO, lightDirReg: ShaderRegisterElement, lightColReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - } -} -declare module away.materials { - /** - * SpecularCelMethod provides a shading method to add specular cel (cartoon) shading. - */ - class SpecularCelMethod extends SpecularCompositeMethod { - private _dataReg; - private _smoothness; - private _specularCutOff; - /** - * Creates a new SpecularCelMethod object. - * @param specularCutOff The threshold at which the specular highlight should be shown. - * @param baseMethod An optional specular method on which the cartoon shading is based. If ommitted, SpecularBasicMethod is used. - */ - constructor(specularCutOff?: number, baseMethod?: SpecularBasicMethod); - /** - * The smoothness of the highlight edge. - */ - public smoothness : number; - /** - * The threshold at which the specular highlight should be shown. - */ - public specularCutOff : number; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public iCleanCompilationData(): void; - /** - * Snaps the specular shading strength of the wrapped method to zero or one, depending on whether or not it exceeds the specularCutOff - * @param vo The MethodVO used to compile the current shader. - * @param t The register containing the specular strength in the "w" component, and either the half-vector or the reflection vector in "xyz". - * @param regCache The register cache used for the shader compilation. - * @param sharedRegisters The shared register data for this shader. - * @return The AGAL fragment code for the method. - */ - private clampSpecular(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); - /** - * @inheritDoc - */ - public iGetFragmentPreLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - } -} -declare module away.materials { - /** - * SpecularFresnelMethod provides a specular shading method that causes stronger highlights on grazing view angles. - */ - class SpecularFresnelMethod extends SpecularCompositeMethod { - private _dataReg; - private _incidentLight; - private _fresnelPower; - private _normalReflectance; - /** - * Creates a new SpecularFresnelMethod object. - * @param basedOnSurface Defines whether the fresnel effect should be based on the view angle on the surface (if true), or on the angle between the light and the view. - * @param baseMethod The specular method to which the fresnel equation. Defaults to SpecularBasicMethod. - */ - constructor(basedOnSurface?: boolean, baseMethod?: SpecularBasicMethod); - /** - * @inheritDoc - */ - public iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * Defines whether the fresnel effect should be based on the view angle on the surface (if true), or on the angle between the light and the view. - */ - public basedOnSurface : boolean; - /** - * The power used in the Fresnel equation. Higher values make the fresnel effect more pronounced. Defaults to 5. - */ - public fresnelPower : number; - /** - * @inheritDoc - */ - public iCleanCompilationData(): void; - /** - * The minimum amount of reflectance, ie the reflectance when the view direction is normal to the surface or light direction. - */ - public normalReflectance : number; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public iGetFragmentPreLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * Applies the fresnel effect to the specular strength. - * - * @param vo The MethodVO object containing the method data for the currently compiled material pass. - * @param target The register containing the specular strength in the "w" component, and the half-vector/reflection vector in "xyz". - * @param regCache The register cache used for the shader compilation. - * @param sharedRegisters The shared registers created by the compiler. - * @return The AGAL fragment code for the method. - */ - private modulateSpecular(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); - } -} -declare module away.materials { - /** - * SpecularPhongMethod provides a specular method that provides Phong highlights. - */ - class SpecularPhongMethod extends SpecularBasicMethod { - /** - * Creates a new SpecularPhongMethod object. - */ - constructor(); - /** - * @inheritDoc - */ - public iGetFragmentCodePerLight(shaderObject: ShaderLightingObject, methodVO: MethodVO, lightDirReg: ShaderRegisterElement, lightColReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - } -} -declare module away.utils { - class PerspectiveMatrix3D extends geom.Matrix3D { - constructor(v?: number[]); - public perspectiveFieldOfViewLH(fieldOfViewY: number, aspectRatio: number, zNear: number, zFar: number): void; - } -} -declare module away.animators { - /** - * ... - */ - class AnimationSubGeometry { - static SUBGEOM_ID_COUNT: number; - public _pVertexData: number[]; - public _pVertexBuffer: stagegl.IVertexBuffer[]; - public _pBufferContext: stagegl.IContextStageGL[]; - public _pBufferDirty: boolean[]; - private _numVertices; - private _totalLenOfOneVertex; - public numProcessedVertices: number; - public previousTime: number; - public animationParticles: ParticleAnimationData[]; - /** - * An id for this animation subgeometry, used to identify animation subgeometries when using animation sets. - * - * @private - */ - public _iUniqueId: number; - constructor(); - public createVertexData(numVertices: number, totalLenOfOneVertex: number): void; - public activateVertexBuffer(index: number, bufferOffset: number, stage: base.Stage, format: string): void; - public dispose(): void; - public invalidateBuffer(): void; - public vertexData : number[]; - public numVertices : number; - public totalLenOfOneVertex : number; - } -} -declare module away.animators { - class ColorSegmentPoint { - private _color; - private _life; - constructor(life: number, color: geom.ColorTransform); - public color : geom.ColorTransform; - public life : number; - } -} -declare module away.animators { - /** - * Contains transformation data for a skeleton joint, used for skeleton animation. - * - * @see away.animation.Skeleton - * @see away.animation.SkeletonJoint - * - * todo: support (uniform) scale - */ - class JointPose { - /** - * The name of the joint to which the pose is associated - */ - public name: string; - /** - * The rotation of the pose stored as a quaternion - */ - public orientation: geom.Quaternion; - /** - * The translation of the pose - */ - public translation: geom.Vector3D; - constructor(); - /** - * Converts the transformation to a Matrix3D representation. - * - * @param target An optional target matrix to store the transformation. If not provided, it will create a new instance. - * @return The transformation matrix of the pose. - */ - public toMatrix3D(target?: geom.Matrix3D): geom.Matrix3D; - /** - * Copies the transformation data from a source pose object into the existing pose object. - * - * @param pose The source pose to copy from. - */ - public copyFrom(pose: JointPose): void; - } -} -declare module away.animators { - /** - * ... - */ - class ParticleAnimationData { - public index: number; - public startTime: number; - public totalTime: number; - public duration: number; - public delay: number; - public startVertexIndex: number; - public numVertices: number; - constructor(index: number, startTime: number, duration: number, delay: number, particle: ParticleData); - } -} -declare module away.animators { - class ParticleData { - public particleIndex: number; - public numVertices: number; - public startVertexIndex: number; - public subGeometry: base.TriangleSubGeometry; - } -} -declare module away.animators { - /** - * Dynamic class for holding the local properties of a particle, used for processing the static properties - * of particles in the particle animation set before beginning upload to the GPU. - */ - class ParticleProperties { - /** - * The index of the current particle being set. - */ - public index: number; - /** - * The total number of particles being processed by the particle animation set. - */ - public total: number; - /** - * The start time of the particle. - */ - public startTime: number; - /** - * The duration of the particle, an optional value used when the particle aniamtion set settings for useDuration are enabled in the constructor. - * - * @see away.animators.ParticleAnimationSet - */ - public duration: number; - /** - * The delay between cycles of the particle, an optional value used when the particle aniamtion set settings for useLooping and useDelay are enabled in the constructor. - * - * @see away.animators.ParticleAnimationSet - */ - public delay: number; - } -} -declare module away.animators { - /** - * Options for setting the properties mode of a particle animation node. - */ - class ParticlePropertiesMode { - /** - * Mode that defines the particle node as acting on global properties (ie. the properties set in the node constructor or the corresponding animation state). - */ - static GLOBAL: number; - /** - * Mode that defines the particle node as acting on local static properties (ie. the properties of particles set in the initialising on the animation set). - */ - static LOCAL_STATIC: number; - /** - * Mode that defines the particle node as acting on local dynamic properties (ie. the properties of the particles set in the corresponding animation state). - */ - static LOCAL_DYNAMIC: number; - } -} -declare module away.animators { - /** - * A Skeleton object is a hierarchical grouping of joint objects that can be used for skeletal animation. - * - * @see away.animators.SkeletonJoint - */ - class Skeleton extends library.NamedAssetBase implements library.IAsset { - /** - * A flat list of joint objects that comprise the skeleton. Every joint except for the root has a parentIndex - * property that is an index into this list. - * A child joint should always have a higher index than its parent. - */ - public joints: SkeletonJoint[]; - /** - * The total number of joints in the skeleton. - */ - public numJoints : number; - /** - * Creates a new Skeleton object - */ - constructor(); - /** - * Returns the joint object in the skeleton with the given name, otherwise returns a null object. - * - * @param jointName The name of the joint object to be found. - * @return The joint object with the given name. - * - * @see #joints - */ - public jointFromName(jointName: string): SkeletonJoint; - /** - * Returns the joint index, given the joint name. -1 is returned if the joint name is not found. - * - * @param jointName The name of the joint object to be found. - * @return The index of the joint object in the joints Array - * - * @see #joints - */ - public jointIndexFromName(jointName: string): number; - /** - * @inheritDoc - */ - public dispose(): void; - /** - * @inheritDoc - */ - public assetType : string; - } -} -declare module away.animators { - /** - * Options for setting the animation mode of a vertex animator object. - * - * @see away.animators.VertexAnimator - */ - class VertexAnimationMode { - /** - * Animation mode that adds all outputs from active vertex animation state to form the current vertex animation pose. - */ - static ADDITIVE: string; - /** - * Animation mode that picks the output from a single vertex animation state to form the current vertex animation pose. - */ - static ABSOLUTE: string; - } -} -declare module away.animators { - /** - * A value obect representing a single joint in a skeleton object. - * - * @see away.animators.Skeleton - */ - class SkeletonJoint { - /** - * The index of the parent joint in the skeleton's joints vector. - * - * @see away.animators.Skeleton#joints - */ - public parentIndex: number; - /** - * The name of the joint - */ - public name: string; - /** - * The inverse bind pose matrix, as raw data, used to transform vertices to bind joint space in preparation for transformation using the joint matrix. - */ - public inverseBindPose: number[]; - /** - * Creates a new SkeletonJoint object - */ - constructor(); - } -} -declare module away.animators { - /** - * A collection of pose objects, determining the pose for an entire skeleton. - * The jointPoses vector object corresponds to a skeleton's joints vector object, however, there is no - * reference to a skeleton's instance, since several skeletons can be influenced by the same pose (eg: animation - * clips are added to any animator with a valid skeleton) - * - * @see away.animators.Skeleton - * @see away.animators.JointPose - */ - class SkeletonPose extends library.NamedAssetBase implements library.IAsset { - /** - * A flat list of pose objects that comprise the skeleton pose. The pose indices correspond to the target skeleton's joint indices. - * - * @see away.animators.Skeleton#joints - */ - public jointPoses: JointPose[]; - /** - * The total number of joint poses in the skeleton pose. - */ - public numJointPoses : number; - /** - * Creates a new SkeletonPose object. - */ - constructor(); - /** - * @inheritDoc - */ - public assetType : string; - /** - * Returns the joint pose object with the given joint name, otherwise returns a null object. - * - * @param jointName The name of the joint object whose pose is to be found. - * @return The pose object with the given joint name. - */ - public jointPoseFromName(jointName: string): JointPose; - /** - * Returns the pose index, given the joint name. -1 is returned if the joint name is not found in the pose. - * - * @param The name of the joint object whose pose is to be found. - * @return The index of the pose object in the jointPoses Array - * - * @see #jointPoses - */ - public jointPoseIndexFromName(jointName: string): number; - /** - * Creates a copy of the SkeletonPose object, with a dulpicate of its component joint poses. - * - * @return SkeletonPose - */ - public clone(): SkeletonPose; - /** - * @inheritDoc - */ - public dispose(): void; - } -} -declare module away.animators { - /** - * Provides an abstract base class for nodes with time-based animation data in an animation blend tree. - */ - class AnimationClipNodeBase extends AnimationNodeBase { - public _pLooping: boolean; - public _pTotalDuration: number; - public _pLastFrame: number; - public _pStitchDirty: boolean; - public _pStitchFinalFrame: boolean; - public _pNumFrames: number; - public _pDurations: number[]; - public _pTotalDelta: geom.Vector3D; - public fixedFrameRate: boolean; - /** - * Determines whether the contents of the animation node have looping characteristics enabled. - */ - public looping : boolean; - /** - * Defines if looping content blends the final frame of animation data with the first (true) or works on the - * assumption that both first and last frames are identical (false). Defaults to false. - */ - public stitchFinalFrame : boolean; - public totalDuration : number; - public totalDelta : geom.Vector3D; - public lastFrame : number; - /** - * Returns a vector of time values representing the duration (in milliseconds) of each animation frame in the clip. - */ - public durations : number[]; - /** - * Creates a new AnimationClipNodeBase object. - */ - constructor(); - /** - * Updates the node's final frame stitch state. - * - * @see #stitchFinalFrame - */ - public _pUpdateStitch(): void; - } -} -declare module away.animators { - /** - * Provides an abstract base class for particle animation nodes. - */ - class ParticleNodeBase extends AnimationNodeBase { - private _priority; - public _pMode: number; - public _pDataLength: number; - public _pOneData: number[]; - public _iDataOffset: number; - private static GLOBAL; - private static LOCAL_STATIC; - private static LOCAL_DYNAMIC; - private static MODES; - /** - * Returns the property mode of the particle animation node. Typically set in the node constructor - * - * @see away.animators.ParticlePropertiesMode - */ - public mode : number; - /** - * Returns the priority of the particle animation node, used to order the agal generated in a particle animation set. Set automatically on instantiation. - * - * @see away.animators.ParticleAnimationSet - * @see #getAGALVertexCode - */ - public priority : number; - /** - * Returns the length of the data used by the node when in LOCAL_STATIC mode. Used to generate the local static data of the particle animation set. - * - * @see away.animators.ParticleAnimationSet - * @see #getAGALVertexCode - */ - public dataLength : number; - /** - * Returns the generated data vector of the node after one particle pass during the generation of all local static data of the particle animation set. - * - * @see away.animators.ParticleAnimationSet - * @see #generatePropertyOfOneParticle - */ - public oneData : number[]; - /** - * Creates a new ParticleNodeBase object. - * - * @param name Defines the generic name of the particle animation node. - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param dataLength Defines the length of the data used by the node when in LOCAL_STATIC mode. - * @param [optional] priority the priority of the particle animation node, used to order the agal generated in a particle animation set. Defaults to 1. - */ - constructor(name: string, mode: number, dataLength: number, priority?: number); - /** - * Returns the AGAL code of the particle animation node for use in the vertex shader. - */ - public getAGALVertexCode(shaderObject: materials.ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; - /** - * Returns the AGAL code of the particle animation node for use in the fragment shader. - */ - public getAGALFragmentCode(shaderObject: materials.ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; - /** - * Returns the AGAL code of the particle animation node for use in the fragment shader when UV coordinates are required. - */ - public getAGALUVCode(shaderObject: materials.ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; - /** - * Called internally by the particle animation set when assigning the set of static properties originally defined by the initParticleFunc of the set. - * - * @see away.animators.ParticleAnimationSet#initParticleFunc - */ - public _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; - /** - * Called internally by the particle animation set when determining the requirements of the particle animation node AGAL. - */ - public _iProcessAnimationSetting(particleAnimationSet: ParticleAnimationSet): void; - } -} -declare module away.animators { - /** - * A particle animation node used to apply a constant acceleration vector to the motion of a particle. - */ - class ParticleAccelerationNode extends ParticleNodeBase { - /** @private */ - static ACCELERATION_INDEX: number; - /** @private */ - public _acceleration: geom.Vector3D; - /** - * Reference for acceleration node properties on a single particle (when in local property mode). - * Expects a Vector3D object representing the direction of acceleration on the particle. - */ - static ACCELERATION_VECTOR3D: string; - /** - * Creates a new ParticleAccelerationNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] acceleration Defines the default acceleration vector of the node, used when in global mode. - */ - constructor(mode: number, acceleration?: geom.Vector3D); - /** - * @inheritDoc - */ - public pGetAGALVertexCode(shaderObject: materials.ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; - /** - * @inheritDoc - */ - public getAnimationState(animator: AnimatorBase): ParticleAccelerationState; - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; - } -} -declare module away.animators { - /** - * A particle animation node used to control the position of a particle over time along a bezier curve. - */ - class ParticleBezierCurveNode extends ParticleNodeBase { - /** @private */ - static BEZIER_CONTROL_INDEX: number; - /** @private */ - static BEZIER_END_INDEX: number; - /** @private */ - public _iControlPoint: geom.Vector3D; - /** @private */ - public _iEndPoint: geom.Vector3D; - /** - * Reference for bezier curve node properties on a single particle (when in local property mode). - * Expects a Vector3D object representing the control point position (0, 1, 2) of the curve. - */ - static BEZIER_CONTROL_VECTOR3D: string; - /** - * Reference for bezier curve node properties on a single particle (when in local property mode). - * Expects a Vector3D object representing the end point position (0, 1, 2) of the curve. - */ - static BEZIER_END_VECTOR3D: string; - /** - * Creates a new ParticleBezierCurveNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] controlPoint Defines the default control point of the node, used when in global mode. - * @param [optional] endPoint Defines the default end point of the node, used when in global mode. - */ - constructor(mode: number, controlPoint?: geom.Vector3D, endPoint?: geom.Vector3D); - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject: materials.ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; - /** - * @inheritDoc - */ - public getAnimationState(animator: AnimatorBase): ParticleBezierCurveState; - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; - } -} -declare module away.animators { - /** - * A particle animation node that controls the rotation of a particle to always face the camera. - */ - class ParticleBillboardNode extends ParticleNodeBase { - /** @private */ - static MATRIX_INDEX: number; - /** @private */ - public _iBillboardAxis: geom.Vector3D; - /** - * Creates a new ParticleBillboardNode - */ - constructor(billboardAxis?: geom.Vector3D); - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject: materials.ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; - /** - * @inheritDoc - */ - public getAnimationState(animator: AnimatorBase): ParticleBillboardState; - /** - * @inheritDoc - */ - public _iProcessAnimationSetting(particleAnimationSet: ParticleAnimationSet): void; - } -} -declare module away.animators { - /** - * A particle animation node used to control the color variation of a particle over time. - */ - class ParticleColorNode extends ParticleNodeBase { - /** @private */ - static START_MULTIPLIER_INDEX: number; - /** @private */ - static DELTA_MULTIPLIER_INDEX: number; - /** @private */ - static START_OFFSET_INDEX: number; - /** @private */ - static DELTA_OFFSET_INDEX: number; - /** @private */ - static CYCLE_INDEX: number; - /** @private */ - public _iUsesMultiplier: boolean; - /** @private */ - public _iUsesOffset: boolean; - /** @private */ - public _iUsesCycle: boolean; - /** @private */ - public _iUsesPhase: boolean; - /** @private */ - public _iStartColor: geom.ColorTransform; - /** @private */ - public _iEndColor: geom.ColorTransform; - /** @private */ - public _iCycleDuration: number; - /** @private */ - public _iCyclePhase: number; - /** - * Reference for color node properties on a single particle (when in local property mode). - * Expects a ColorTransform object representing the start color transform applied to the particle. - */ - static COLOR_START_COLORTRANSFORM: string; - /** - * Reference for color node properties on a single particle (when in local property mode). - * Expects a ColorTransform object representing the end color transform applied to the particle. - */ - static COLOR_END_COLORTRANSFORM: string; - /** - * Creates a new ParticleColorNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] usesMultiplier Defines whether the node uses multiplier data in the shader for its color transformations. Defaults to true. - * @param [optional] usesOffset Defines whether the node uses offset data in the shader for its color transformations. Defaults to true. - * @param [optional] usesCycle Defines whether the node uses the cycleDuration property in the shader to calculate the period of the animation independent of particle duration. Defaults to false. - * @param [optional] usesPhase Defines whether the node uses the cyclePhase property in the shader to calculate a starting offset to the cycle rotation of the particle. Defaults to false. - * @param [optional] startColor Defines the default start color transform of the node, when in global mode. - * @param [optional] endColor Defines the default end color transform of the node, when in global mode. - * @param [optional] cycleDuration Defines the duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. - * @param [optional] cyclePhase Defines the phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. - */ - constructor(mode: number, usesMultiplier?: boolean, usesOffset?: boolean, usesCycle?: boolean, usesPhase?: boolean, startColor?: geom.ColorTransform, endColor?: geom.ColorTransform, cycleDuration?: number, cyclePhase?: number); - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject: materials.ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; - /** - * @inheritDoc - */ - public getAnimationState(animator: AnimatorBase): ParticleColorState; - /** - * @inheritDoc - */ - public _iProcessAnimationSetting(particleAnimationSet: ParticleAnimationSet): void; - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; - } -} -declare module away.animators { - /** - * A particle animation node used to create a follow behaviour on a particle system. - */ - class ParticleFollowNode extends ParticleNodeBase { - /** @private */ - static FOLLOW_POSITION_INDEX: number; - /** @private */ - static FOLLOW_ROTATION_INDEX: number; - /** @private */ - public _iUsesPosition: boolean; - /** @private */ - public _iUsesRotation: boolean; - /** @private */ - public _iSmooth: boolean; - /** - * Creates a new ParticleFollowNode - * - * @param [optional] usesPosition Defines wehether the individual particle reacts to the position of the target. - * @param [optional] usesRotation Defines wehether the individual particle reacts to the rotation of the target. - * @param [optional] smooth Defines wehether the state calculate the interpolated value. - */ - constructor(usesPosition?: boolean, usesRotation?: boolean, smooth?: boolean); - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject: materials.ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; - /** - * @inheritDoc - */ - public getAnimationState(animator: AnimatorBase): ParticleFollowState; - } -} -declare module away.animators { - class ParticleInitialColorNode extends ParticleNodeBase { - /** @private */ - static MULTIPLIER_INDEX: number; - /** @private */ - static OFFSET_INDEX: number; - /** @private */ - public _iUsesMultiplier: boolean; - /** @private */ - public _iUsesOffset: boolean; - /** @private */ - public _iInitialColor: geom.ColorTransform; - /** - * Reference for color node properties on a single particle (when in local property mode). - * Expects a ColorTransform object representing the color transform applied to the particle. - */ - static COLOR_INITIAL_COLORTRANSFORM: string; - constructor(mode: number, usesMultiplier?: boolean, usesOffset?: boolean, initialColor?: geom.ColorTransform); - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject: materials.ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; - /** - * @inheritDoc - */ - public _iProcessAnimationSetting(particleAnimationSet: ParticleAnimationSet): void; - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; - } -} -declare module away.animators { - /** - * A particle animation node used to control the position of a particle over time around a circular orbit. - */ - class ParticleOrbitNode extends ParticleNodeBase { - /** @private */ - static ORBIT_INDEX: number; - /** @private */ - static EULERS_INDEX: number; - /** @private */ - public _iUsesEulers: boolean; - /** @private */ - public _iUsesCycle: boolean; - /** @private */ - public _iUsesPhase: boolean; - /** @private */ - public _iRadius: number; - /** @private */ - public _iCycleDuration: number; - /** @private */ - public _iCyclePhase: number; - /** @private */ - public _iEulers: geom.Vector3D; - /** - * Reference for orbit node properties on a single particle (when in local property mode). - * Expects a Vector3D object representing the radius (x), cycle speed (y) and cycle phase (z) of the motion on the particle. - */ - static ORBIT_VECTOR3D: string; - /** - * Creates a new ParticleOrbitNode object. - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] usesEulers Defines whether the node uses the eulers property in the shader to calculate a rotation on the orbit. Defaults to true. - * @param [optional] usesCycle Defines whether the node uses the cycleDuration property in the shader to calculate the period of the orbit independent of particle duration. Defaults to false. - * @param [optional] usesPhase Defines whether the node uses the cyclePhase property in the shader to calculate a starting offset to the cycle rotation of the particle. Defaults to false. - * @param [optional] radius Defines the radius of the orbit when in global mode. Defaults to 100. - * @param [optional] cycleDuration Defines the duration of the orbit in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. - * @param [optional] cyclePhase Defines the phase of the orbit in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. - * @param [optional] eulers Defines the euler rotation in degrees, applied to the orientation of the orbit when in global mode. - */ - constructor(mode: number, usesEulers?: boolean, usesCycle?: boolean, usesPhase?: boolean, radius?: number, cycleDuration?: number, cyclePhase?: number, eulers?: geom.Vector3D); - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject: materials.ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; - /** - * @inheritDoc - */ - public getAnimationState(animator: AnimatorBase): ParticleOrbitState; - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; - } -} -declare module away.animators { - /** - * A particle animation node used to control the position of a particle over time using simple harmonic motion. - */ - class ParticleOscillatorNode extends ParticleNodeBase { - /** @private */ - static OSCILLATOR_INDEX: number; - /** @private */ - public _iOscillator: geom.Vector3D; - /** - * Reference for ocsillator node properties on a single particle (when in local property mode). - * Expects a Vector3D object representing the axis (x,y,z) and cycle speed (w) of the motion on the particle. - */ - static OSCILLATOR_VECTOR3D: string; - /** - * Creates a new ParticleOscillatorNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] oscillator Defines the default oscillator axis (x, y, z) and cycleDuration (w) of the node, used when in global mode. - */ - constructor(mode: number, oscillator?: geom.Vector3D); - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject: materials.ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; - /** - * @inheritDoc - */ - public getAnimationState(animator: AnimatorBase): ParticleOscillatorState; - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; - } -} -declare module away.animators { - /** - * A particle animation node used to set the starting position of a particle. - */ - class ParticlePositionNode extends ParticleNodeBase { - /** @private */ - static POSITION_INDEX: number; - /** @private */ - public _iPosition: geom.Vector3D; - /** - * Reference for position node properties on a single particle (when in local property mode). - * Expects a Vector3D object representing position of the particle. - */ - static POSITION_VECTOR3D: string; - /** - * Creates a new ParticlePositionNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] position Defines the default position of the particle when in global mode. Defaults to 0,0,0. - */ - constructor(mode: number, position?: geom.Vector3D); - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject: materials.ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; - /** - * @inheritDoc - */ - public getAnimationState(animator: AnimatorBase): ParticlePositionState; - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; - } -} -declare module away.animators { - /** - * A particle animation node used to control the rotation of a particle to match its heading vector. - */ - class ParticleRotateToHeadingNode extends ParticleNodeBase { - /** @private */ - static MATRIX_INDEX: number; - /** - * Creates a new ParticleBillboardNode - */ - constructor(); - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject: materials.ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; - /** - * @inheritDoc - */ - public getAnimationState(animator: AnimatorBase): ParticleRotateToHeadingState; - /** - * @inheritDoc - */ - public _iProcessAnimationSetting(particleAnimationSet: ParticleAnimationSet): void; - } -} -declare module away.animators { - /** - * A particle animation node used to control the rotation of a particle to face to a position - */ - class ParticleRotateToPositionNode extends ParticleNodeBase { - /** @private */ - static MATRIX_INDEX: number; - /** @private */ - static POSITION_INDEX: number; - /** @private */ - public _iPosition: geom.Vector3D; - /** - * Reference for the position the particle will rotate to face for a single particle (when in local property mode). - * Expects a Vector3D object representing the position that the particle must face. - */ - static POSITION_VECTOR3D: string; - /** - * Creates a new ParticleRotateToPositionNode - */ - constructor(mode: number, position?: geom.Vector3D); - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject: materials.ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; - /** - * @inheritDoc - */ - public getAnimationState(animator: AnimatorBase): ParticleRotateToPositionState; - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; - } -} -declare module away.animators { - /** - * A particle animation node used to set the starting rotational velocity of a particle. - */ - class ParticleRotationalVelocityNode extends ParticleNodeBase { - /** @private */ - static ROTATIONALVELOCITY_INDEX: number; - /** @private */ - public _iRotationalVelocity: geom.Vector3D; - /** - * Reference for rotational velocity node properties on a single particle (when in local property mode). - * Expects a Vector3D object representing the rotational velocity around an axis of the particle. - */ - static ROTATIONALVELOCITY_VECTOR3D: string; - /** - * Creates a new ParticleRotationalVelocityNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - */ - constructor(mode: number, rotationalVelocity?: geom.Vector3D); - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject: materials.ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; - /** - * @inheritDoc - */ - public getAnimationState(animator: AnimatorBase): ParticleRotationalVelocityState; - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; - } -} -declare module away.animators { - /** - * A particle animation node used to control the scale variation of a particle over time. - */ - class ParticleScaleNode extends ParticleNodeBase { - /** @private */ - static SCALE_INDEX: number; - /** @private */ - public _iUsesCycle: boolean; - /** @private */ - public _iUsesPhase: boolean; - /** @private */ - public _iMinScale: number; - /** @private */ - public _iMaxScale: number; - /** @private */ - public _iCycleDuration: number; - /** @private */ - public _iCyclePhase: number; - /** - * Reference for scale node properties on a single particle (when in local property mode). - * Expects a Vector3D representing the min scale (x), max scale(y), optional cycle speed (z) and phase offset (w) applied to the particle. - */ - static SCALE_VECTOR3D: string; - /** - * Creates a new ParticleScaleNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] usesCycle Defines whether the node uses the cycleDuration property in the shader to calculate the period of animation independent of particle duration. Defaults to false. - * @param [optional] usesPhase Defines whether the node uses the cyclePhase property in the shader to calculate a starting offset to the animation cycle. Defaults to false. - * @param [optional] minScale Defines the default min scale transform of the node, when in global mode. Defaults to 1. - * @param [optional] maxScale Defines the default max color transform of the node, when in global mode. Defaults to 1. - * @param [optional] cycleDuration Defines the default duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. - * @param [optional] cyclePhase Defines the default phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. - */ - constructor(mode: number, usesCycle: boolean, usesPhase: boolean, minScale?: number, maxScale?: number, cycleDuration?: number, cyclePhase?: number); - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject: materials.ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; - /** - * @inheritDoc - */ - public getAnimationState(animator: AnimatorBase): ParticleScaleState; - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; - } -} -declare module away.animators { - class ParticleSegmentedColorNode extends ParticleNodeBase { - /** @private */ - static START_MULTIPLIER_INDEX: number; - /** @private */ - static START_OFFSET_INDEX: number; - /** @private */ - static TIME_DATA_INDEX: number; - /** @private */ - public _iUsesMultiplier: boolean; - /** @private */ - public _iUsesOffset: boolean; - /** @private */ - public _iStartColor: geom.ColorTransform; - /** @private */ - public _iEndColor: geom.ColorTransform; - /** @private */ - public _iNumSegmentPoint: number; - /** @private */ - public _iSegmentPoints: ColorSegmentPoint[]; - constructor(usesMultiplier: boolean, usesOffset: boolean, numSegmentPoint: number, startColor: geom.ColorTransform, endColor: geom.ColorTransform, segmentPoints: ColorSegmentPoint[]); - /** - * @inheritDoc - */ - public _iProcessAnimationSetting(particleAnimationSet: ParticleAnimationSet): void; - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject: materials.ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; - } -} -declare module away.animators { - /** - * A particle animation node used when a spritesheet texture is required to animate the particle. - * NB: to enable use of this node, the repeat property on the material has to be set to true. - */ - class ParticleSpriteSheetNode extends ParticleNodeBase { - /** @private */ - static UV_INDEX_0: number; - /** @private */ - static UV_INDEX_1: number; - /** @private */ - public _iUsesCycle: boolean; - /** @private */ - public _iUsesPhase: boolean; - /** @private */ - public _iTotalFrames: number; - /** @private */ - public _iNumColumns: number; - /** @private */ - public _iNumRows: number; - /** @private */ - public _iCycleDuration: number; - /** @private */ - public _iCyclePhase: number; - /** - * Reference for spritesheet node properties on a single particle (when in local property mode). - * Expects a Vector3D representing the cycleDuration (x), optional phaseTime (y). - */ - static UV_VECTOR3D: string; - /** - * Defines the number of columns in the spritesheet, when in global mode. Defaults to 1. Read only. - */ - public numColumns : number; - /** - * Defines the number of rows in the spritesheet, when in global mode. Defaults to 1. Read only. - */ - public numRows : number; - /** - * Defines the total number of frames used by the spritesheet, when in global mode. Defaults to the number defined by numColumns and numRows. Read only. - */ - public totalFrames : number; - /** - * Creates a new ParticleSpriteSheetNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] numColumns Defines the number of columns in the spritesheet, when in global mode. Defaults to 1. - * @param [optional] numRows Defines the number of rows in the spritesheet, when in global mode. Defaults to 1. - * @param [optional] cycleDuration Defines the default cycle duration in seconds, when in global mode. Defaults to 1. - * @param [optional] cyclePhase Defines the default cycle phase, when in global mode. Defaults to 0. - * @param [optional] totalFrames Defines the total number of frames used by the spritesheet, when in global mode. Defaults to the number defined by numColumns and numRows. - * @param [optional] looping Defines whether the spritesheet animation is set to loop indefinitely. Defaults to true. - */ - constructor(mode: number, usesCycle: boolean, usesPhase: boolean, numColumns?: number, numRows?: number, cycleDuration?: number, cyclePhase?: number, totalFrames?: number); - /** - * @inheritDoc - */ - public getAGALUVCode(shaderObject: materials.ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; - /** - * @inheritDoc - */ - public getAnimationState(animator: AnimatorBase): ParticleSpriteSheetState; - /** - * @inheritDoc - */ - public _iProcessAnimationSetting(particleAnimationSet: ParticleAnimationSet): void; - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; - } -} -declare module away.animators { - /** - * A particle animation node used as the base node for timekeeping inside a particle. Automatically added to a particle animation set on instatiation. - */ - class ParticleTimeNode extends ParticleNodeBase { - /** @private */ - static TIME_STREAM_INDEX: number; - /** @private */ - static TIME_CONSTANT_INDEX: number; - /** @private */ - public _iUsesDuration: boolean; - /** @private */ - public _iUsesDelay: boolean; - /** @private */ - public _iUsesLooping: boolean; - /** - * Creates a new ParticleTimeNode - * - * @param [optional] usesDuration Defines whether the node uses the duration data in the static properties to determine how long a particle is visible for. Defaults to false. - * @param [optional] usesDelay Defines whether the node uses the delay data in the static properties to determine how long a particle is hidden for. Defaults to false. Requires usesDuration to be true. - * @param [optional] usesLooping Defines whether the node creates a looping timeframe for each particle determined by the startTime, duration and delay data in the static properties function. Defaults to false. Requires usesLooping to be true. - */ - constructor(usesDuration?: boolean, usesLooping?: boolean, usesDelay?: boolean); - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject: materials.ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; - /** - * @inheritDoc - */ - public getAnimationState(animator: AnimatorBase): ParticleTimeState; - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; - } -} -declare module away.animators { - /** - * A particle animation node used to control the UV offset and scale of a particle over time. - */ - class ParticleUVNode extends ParticleNodeBase { - /** @private */ - static UV_INDEX: number; - /** @private */ - public _iUvData: geom.Vector3D; - /** - * - */ - static U_AXIS: string; - /** - * - */ - static V_AXIS: string; - private _cycle; - private _scale; - private _axis; - /** - * Creates a new ParticleTimeNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] cycle Defines whether the time track is in loop mode. Defaults to false. - * @param [optional] scale Defines whether the time track is in loop mode. Defaults to false. - * @param [optional] axis Defines whether the time track is in loop mode. Defaults to false. - */ - constructor(mode: number, cycle?: number, scale?: number, axis?: string); - /** - * - */ - public cycle : number; - /** - * - */ - public scale : number; - /** - * - */ - public axis : string; - /** - * @inheritDoc - */ - public getAGALUVCode(shaderObject: materials.ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; - /** - * @inheritDoc - */ - public getAnimationState(animator: AnimatorBase): ParticleUVState; - private updateUVData(); - /** - * @inheritDoc - */ - public _iProcessAnimationSetting(particleAnimationSet: ParticleAnimationSet): void; - } -} -declare module away.animators { - /** - * A particle animation node used to set the starting velocity of a particle. - */ - class ParticleVelocityNode extends ParticleNodeBase { - /** @private */ - static VELOCITY_INDEX: number; - /** @private */ - public _iVelocity: geom.Vector3D; - /** - * Reference for velocity node properties on a single particle (when in local property mode). - * Expects a Vector3D object representing the direction of movement on the particle. - */ - static VELOCITY_VECTOR3D: string; - /** - * Creates a new ParticleVelocityNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] velocity Defines the default velocity vector of the node, used when in global mode. - */ - constructor(mode: number, velocity?: geom.Vector3D); - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject: materials.ShaderObjectBase, animationRegisterCache: AnimationRegisterCache): string; - /** - * @inheritDoc - */ - public getAnimationState(animator: AnimatorBase): ParticleVelocityState; - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param: ParticleProperties): void; - } -} -declare module away.animators { - /** - * A skeleton animation node that uses two animation node inputs to blend a lineraly interpolated output of a skeleton pose. - */ - class SkeletonBinaryLERPNode extends AnimationNodeBase { - /** - * Defines input node A to use for the blended output. - */ - public inputA: AnimationNodeBase; - /** - * Defines input node B to use for the blended output. - */ - public inputB: AnimationNodeBase; - /** - * Creates a new SkeletonBinaryLERPNode object. - */ - constructor(); - /** - * @inheritDoc - */ - public getAnimationState(animator: AnimatorBase): SkeletonBinaryLERPState; - } -} -declare module away.animators { - /** - * A skeleton animation node containing time-based animation data as individual skeleton poses. - */ - class SkeletonClipNode extends AnimationClipNodeBase { - private _frames; - /** - * Determines whether to use SLERP equations (true) or LERP equations (false) in the calculation - * of the output skeleton pose. Defaults to false. - */ - public highQuality: boolean; - /** - * Returns a vector of skeleton poses representing the pose of each animation frame in the clip. - */ - public frames : SkeletonPose[]; - /** - * Creates a new SkeletonClipNode object. - */ - constructor(); - /** - * Adds a skeleton pose frame to the internal timeline of the animation node. - * - * @param skeletonPose The skeleton pose object to add to the timeline of the node. - * @param duration The specified duration of the frame in milliseconds. - */ - public addFrame(skeletonPose: SkeletonPose, duration: number): void; - /** - * @inheritDoc - */ - public getAnimationState(animator: AnimatorBase): SkeletonClipState; - /** - * @inheritDoc - */ - public _pUpdateStitch(): void; - } -} -declare module away.animators { - /** - * A skeleton animation node that uses a difference input pose with a base input pose to blend a linearly interpolated output of a skeleton pose. - */ - class SkeletonDifferenceNode extends AnimationNodeBase { - /** - * Defines a base input node to use for the blended output. - */ - public baseInput: AnimationNodeBase; - /** - * Defines a difference input node to use for the blended output. - */ - public differenceInput: AnimationNodeBase; - /** - * Creates a new SkeletonAdditiveNode object. - */ - constructor(); - /** - * @inheritDoc - */ - public getAnimationState(animator: AnimatorBase): SkeletonDifferenceState; - } -} -declare module away.animators { - /** - * A skeleton animation node that uses four directional input poses with an input direction to blend a linearly interpolated output of a skeleton pose. - */ - class SkeletonDirectionalNode extends AnimationNodeBase { - /** - * Defines the forward configured input node to use for the blended output. - */ - public forward: AnimationNodeBase; - /** - * Defines the backwards configured input node to use for the blended output. - */ - public backward: AnimationNodeBase; - /** - * Defines the left configured input node to use for the blended output. - */ - public left: AnimationNodeBase; - /** - * Defines the right configured input node to use for the blended output. - */ - public right: AnimationNodeBase; - constructor(); - /** - * @inheritDoc - */ - public getAnimationState(animator: AnimatorBase): SkeletonDirectionalState; - } -} -declare module away.animators { - /** - * A skeleton animation node that uses an n-dimensional array of animation node inputs to blend a lineraly interpolated output of a skeleton pose. - */ - class SkeletonNaryLERPNode extends AnimationNodeBase { - public _iInputs: AnimationNodeBase[]; - private _numInputs; - public numInputs : number; - /** - * Creates a new SkeletonNaryLERPNode object. - */ - constructor(); - /** - * Returns an integer representing the input index of the given skeleton animation node. - * - * @param input The skeleton animation node for with the input index is requested. - */ - public getInputIndex(input: AnimationNodeBase): number; - /** - * Returns the skeleton animation node object that resides at the given input index. - * - * @param index The input index for which the skeleton animation node is requested. - */ - public getInputAt(index: number): AnimationNodeBase; - /** - * Adds a new skeleton animation node input to the animation node. - */ - public addInput(input: AnimationNodeBase): void; - /** - * @inheritDoc - */ - public getAnimationState(animator: AnimatorBase): SkeletonNaryLERPState; - } -} -declare module away.animators { - /** - * A vertex animation node containing time-based animation data as individual geometry obejcts. - */ - class VertexClipNode extends AnimationClipNodeBase { - private _frames; - private _translations; - /** - * Returns a vector of geometry frames representing the vertex values of each animation frame in the clip. - */ - public frames : base.Geometry[]; - /** - * Creates a new VertexClipNode object. - */ - constructor(); - /** - * Adds a geometry object to the internal timeline of the animation node. - * - * @param geometry The geometry object to add to the timeline of the node. - * @param duration The specified duration of the frame in milliseconds. - * @param translation The absolute translation of the frame, used in root delta calculations for mesh movement. - */ - public addFrame(geometry: base.Geometry, duration: number, translation?: geom.Vector3D): void; - /** - * @inheritDoc - */ - public _pUpdateStitch(): void; - } -} -declare module away.animators { - interface ISkeletonAnimationState extends IAnimationState { - /** - * Returns the output skeleton pose of the animation node. - */ - getSkeletonPose(skeleton: Skeleton): SkeletonPose; - } -} -declare module away.animators { - /** - * Provides an interface for animation node classes that hold animation data for use in the Vertex animator class. - * - * @see away.animators.VertexAnimator - */ - interface IVertexAnimationState extends IAnimationState { - /** - * Returns the current geometry frame of animation in the clip based on the internal playhead position. - */ - currentGeometry: base.Geometry; - /** - * Returns the current geometry frame of animation in the clip based on the internal playhead position. - */ - nextGeometry: base.Geometry; - /** - * Returns a fractional value between 0 and 1 representing the blending ratio of the current playhead position - * between the current geometry frame (0) and next geometry frame (1) of the animation. - */ - blendWeight: number; - } -} -declare module away.animators { - /** - * - */ - class AnimationStateBase implements IAnimationState { - public _pAnimationNode: AnimationNodeBase; - public _pRootDelta: geom.Vector3D; - public _pPositionDeltaDirty: boolean; - public _pTime: number; - public _pStartTime: number; - public _pAnimator: AnimatorBase; - /** - * Returns a 3d vector representing the translation delta of the animating entity for the current timestep of animation - */ - public positionDelta : geom.Vector3D; - constructor(animator: AnimatorBase, animationNode: AnimationNodeBase); - /** - * Resets the start time of the node to a new value. - * - * @param startTime The absolute start time (in milliseconds) of the node's starting time. - */ - public offset(startTime: number): void; - /** - * Updates the configuration of the node to its current state. - * - * @param time The absolute time (in milliseconds) of the animator's play head position. - * - * @see away.animators.AnimatorBase#update() - */ - public update(time: number): void; - /** - * Sets the animation phase of the node. - * - * @param value The phase value to use. 0 represents the beginning of an animation clip, 1 represents the end. - */ - public phase(value: number): void; - /** - * Updates the node's internal playhead position. - * - * @param time The local time (in milliseconds) of the node's playhead position. - */ - public _pUpdateTime(time: number): void; - /** - * Updates the node's root delta position - */ - public _pUpdatePositionDelta(): void; - } -} -declare module away.animators { - /** - * ... - */ - class ParticleStateBase extends AnimationStateBase { - private _particleNode; - public _pDynamicProperties: geom.Vector3D[]; - public _pDynamicPropertiesDirty: Object; - public _pNeedUpdateTime: boolean; - constructor(animator: ParticleAnimator, particleNode: ParticleNodeBase, needUpdateTime?: boolean); - public needUpdateTime : boolean; - public setRenderState(stage: base.Stage, renderable: pool.RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: entities.Camera): void; - public _pUpdateDynamicProperties(animationSubGeometry: AnimationSubGeometry): void; - } -} -declare module away.animators { - /** - * ... - */ - class ParticleAccelerationState extends ParticleStateBase { - private _particleAccelerationNode; - private _acceleration; - private _halfAcceleration; - /** - * Defines the acceleration vector of the state, used when in global mode. - */ - public acceleration : geom.Vector3D; - constructor(animator: ParticleAnimator, particleAccelerationNode: ParticleAccelerationNode); - /** - * @inheritDoc - */ - public setRenderState(stage: base.Stage, renderable: pool.RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: entities.Camera): void; - private updateAccelerationData(); - } -} -declare module away.animators { - /** - * ... - */ - class ParticleBezierCurveState extends ParticleStateBase { - private _particleBezierCurveNode; - private _controlPoint; - private _endPoint; - /** - * Defines the default control point of the node, used when in global mode. - */ - public controlPoint : geom.Vector3D; - /** - * Defines the default end point of the node, used when in global mode. - */ - public endPoint : geom.Vector3D; - constructor(animator: ParticleAnimator, particleBezierCurveNode: ParticleBezierCurveNode); - public setRenderState(stage: base.Stage, renderable: pool.RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: entities.Camera): void; - } -} -declare module away.animators { - /** - * ... - */ - class ParticleBillboardState extends ParticleStateBase { - private _matrix; - private _billboardAxis; - /** - * - */ - constructor(animator: ParticleAnimator, particleNode: ParticleBillboardNode); - public setRenderState(stage: base.Stage, renderable: pool.RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: entities.Camera): void; - /** - * Defines the billboard axis. - */ - public billboardAxis : geom.Vector3D; - } -} -declare module away.animators { - /** - * ... - * @author ... - */ - class ParticleColorState extends ParticleStateBase { - private _particleColorNode; - private _usesMultiplier; - private _usesOffset; - private _usesCycle; - private _usesPhase; - private _startColor; - private _endColor; - private _cycleDuration; - private _cyclePhase; - private _cycleData; - private _startMultiplierData; - private _deltaMultiplierData; - private _startOffsetData; - private _deltaOffsetData; - /** - * Defines the start color transform of the state, when in global mode. - */ - public startColor : geom.ColorTransform; - /** - * Defines the end color transform of the state, when in global mode. - */ - public endColor : geom.ColorTransform; - /** - * Defines the duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. - */ - public cycleDuration : number; - /** - * Defines the phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. - */ - public cyclePhase : number; - constructor(animator: ParticleAnimator, particleColorNode: ParticleColorNode); - public setRenderState(stage: base.Stage, renderable: pool.RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: entities.Camera): void; - private updateColorData(); - } -} -declare module away.animators { - /** - * ... - */ - class ParticleFollowState extends ParticleStateBase { - private _particleFollowNode; - private _followTarget; - private _targetPos; - private _targetEuler; - private _prePos; - private _preEuler; - private _smooth; - private _temp; - constructor(animator: ParticleAnimator, particleFollowNode: ParticleFollowNode); - public followTarget : base.DisplayObject; - public smooth : boolean; - /** - * @inheritDoc - */ - public setRenderState(stage: base.Stage, renderable: pool.RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: entities.Camera): void; - private processPosition(currentTime, deltaTime, animationSubGeometry); - private precessRotation(currentTime, deltaTime, animationSubGeometry); - private processPositionAndRotation(currentTime, deltaTime, animationSubGeometry); - } -} -declare module away.animators { - class ParticleInitialColorState extends ParticleStateBase { - private _particleInitialColorNode; - private _usesMultiplier; - private _usesOffset; - private _initialColor; - private _multiplierData; - private _offsetData; - constructor(animator: ParticleAnimator, particleInitialColorNode: ParticleInitialColorNode); - /** - * Defines the initial color transform of the state, when in global mode. - */ - public initialColor : geom.ColorTransform; - /** - * @inheritDoc - */ - public setRenderState(stage: base.Stage, renderable: pool.RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: entities.Camera): void; - private updateColorData(); - } -} -declare module away.animators { - /** - * ... - */ - class ParticleOrbitState extends ParticleStateBase { - private _particleOrbitNode; - private _usesEulers; - private _usesCycle; - private _usesPhase; - private _radius; - private _cycleDuration; - private _cyclePhase; - private _eulers; - private _orbitData; - private _eulersMatrix; - /** - * Defines the radius of the orbit when in global mode. Defaults to 100. - */ - public radius : number; - /** - * Defines the duration of the orbit in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. - */ - public cycleDuration : number; - /** - * Defines the phase of the orbit in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. - */ - public cyclePhase : number; - /** - * Defines the euler rotation in degrees, applied to the orientation of the orbit when in global mode. - */ - public eulers : geom.Vector3D; - constructor(animator: ParticleAnimator, particleOrbitNode: ParticleOrbitNode); - public setRenderState(stage: base.Stage, renderable: pool.RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: entities.Camera): void; - private updateOrbitData(); - } -} -declare module away.animators { - /** - * ... - */ - class ParticleOscillatorState extends ParticleStateBase { - private _particleOscillatorNode; - private _oscillator; - private _oscillatorData; - /** - * Defines the default oscillator axis (x, y, z) and cycleDuration (w) of the state, used when in global mode. - */ - public oscillator : geom.Vector3D; - constructor(animator: ParticleAnimator, particleOscillatorNode: ParticleOscillatorNode); - /** - * @inheritDoc - */ - public setRenderState(stage: base.Stage, renderable: pool.RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: entities.Camera): void; - private updateOscillatorData(); - } -} -declare module away.animators { - /** - * ... - * @author ... - */ - class ParticlePositionState extends ParticleStateBase { - private _particlePositionNode; - private _position; - /** - * Defines the position of the particle when in global mode. Defaults to 0,0,0. - */ - public position : geom.Vector3D; - /** - * - */ - public getPositions(): geom.Vector3D[]; - public setPositions(value: geom.Vector3D[]): void; - constructor(animator: ParticleAnimator, particlePositionNode: ParticlePositionNode); - /** - * @inheritDoc - */ - public setRenderState(stage: base.Stage, renderable: pool.RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: entities.Camera): void; - } -} -declare module away.animators { - /** - * ... - */ - class ParticleRotateToHeadingState extends ParticleStateBase { - private _matrix; - constructor(animator: ParticleAnimator, particleNode: ParticleNodeBase); - public setRenderState(stage: base.Stage, renderable: pool.RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: entities.Camera): void; - } -} -declare module away.animators { - /** - * ... - */ - class ParticleRotateToPositionState extends ParticleStateBase { - private _particleRotateToPositionNode; - private _position; - private _matrix; - private _offset; - /** - * Defines the position of the point the particle will rotate to face when in global mode. Defaults to 0,0,0. - */ - public position : geom.Vector3D; - constructor(animator: ParticleAnimator, particleRotateToPositionNode: ParticleRotateToPositionNode); - public setRenderState(stage: base.Stage, renderable: pool.RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: entities.Camera): void; - } -} -declare module away.animators { - /** - * ... - */ - class ParticleRotationalVelocityState extends ParticleStateBase { - private _particleRotationalVelocityNode; - private _rotationalVelocityData; - private _rotationalVelocity; - /** - * Defines the default rotationalVelocity of the state, used when in global mode. - */ - public rotationalVelocity : geom.Vector3D; - /** - * - */ - public getRotationalVelocities(): geom.Vector3D[]; - public setRotationalVelocities(value: geom.Vector3D[]): void; - constructor(animator: ParticleAnimator, particleRotationNode: ParticleRotationalVelocityNode); - /** - * @inheritDoc - */ - public setRenderState(stage: base.Stage, renderable: pool.RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: entities.Camera): void; - private updateRotationalVelocityData(); - } -} -declare module away.animators { - /** - * ... - */ - class ParticleScaleState extends ParticleStateBase { - private _particleScaleNode; - private _usesCycle; - private _usesPhase; - private _minScale; - private _maxScale; - private _cycleDuration; - private _cyclePhase; - private _scaleData; - /** - * Defines the end scale of the state, when in global mode. Defaults to 1. - */ - public minScale : number; - /** - * Defines the end scale of the state, when in global mode. Defaults to 1. - */ - public maxScale : number; - /** - * Defines the duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. - */ - public cycleDuration : number; - /** - * Defines the phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. - */ - public cyclePhase : number; - constructor(animator: ParticleAnimator, particleScaleNode: ParticleScaleNode); - public setRenderState(stage: base.Stage, renderable: pool.RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: entities.Camera): void; - private updateScaleData(); - } -} -declare module away.animators { - class ParticleSegmentedColorState extends ParticleStateBase { - private _usesMultiplier; - private _usesOffset; - private _startColor; - private _endColor; - private _segmentPoints; - private _numSegmentPoint; - private _timeLifeData; - private _multiplierData; - private _offsetData; - /** - * Defines the start color transform of the state, when in global mode. - */ - public startColor : geom.ColorTransform; - /** - * Defines the end color transform of the state, when in global mode. - */ - public endColor : geom.ColorTransform; - /** - * Defines the number of segments. - */ - public numSegmentPoint : number; - /** - * Defines the key points of color - */ - public segmentPoints : ColorSegmentPoint[]; - public usesMultiplier : boolean; - public usesOffset : boolean; - constructor(animator: ParticleAnimator, particleSegmentedColorNode: ParticleSegmentedColorNode); - public setRenderState(stage: base.Stage, renderable: pool.RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: entities.Camera): void; - private updateColorData(); - } -} -declare module away.animators { - /** - * ... - */ - class ParticleSpriteSheetState extends ParticleStateBase { - private _particleSpriteSheetNode; - private _usesCycle; - private _usesPhase; - private _totalFrames; - private _numColumns; - private _numRows; - private _cycleDuration; - private _cyclePhase; - private _spriteSheetData; - /** - * Defines the cycle phase, when in global mode. Defaults to zero. - */ - public cyclePhase : number; - /** - * Defines the cycle duration in seconds, when in global mode. Defaults to 1. - */ - public cycleDuration : number; - constructor(animator: ParticleAnimator, particleSpriteSheetNode: ParticleSpriteSheetNode); - public setRenderState(stage: base.Stage, renderable: pool.RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: entities.Camera): void; - private updateSpriteSheetData(); - } -} -declare module away.animators { - /** - * ... - */ - class ParticleTimeState extends ParticleStateBase { - private _particleTimeNode; - constructor(animator: ParticleAnimator, particleTimeNode: ParticleTimeNode); - public setRenderState(stage: base.Stage, renderable: pool.RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: entities.Camera): void; - } -} -declare module away.animators { - /** - * ... - */ - class ParticleUVState extends ParticleStateBase { - private _particleUVNode; - constructor(animator: ParticleAnimator, particleUVNode: ParticleUVNode); - public setRenderState(stage: base.Stage, renderable: pool.RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: entities.Camera): void; - } -} -declare module away.animators { - /** - * ... - */ - class ParticleVelocityState extends ParticleStateBase { - private _particleVelocityNode; - private _velocity; - /** - * Defines the default velocity vector of the state, used when in global mode. - */ - public velocity : geom.Vector3D; - /** - * - */ - public getVelocities(): geom.Vector3D[]; - public setVelocities(value: geom.Vector3D[]): void; - constructor(animator: ParticleAnimator, particleVelocityNode: ParticleVelocityNode); - public setRenderState(stage: base.Stage, renderable: pool.RenderableBase, animationSubGeometry: AnimationSubGeometry, animationRegisterCache: AnimationRegisterCache, camera: entities.Camera): void; - } -} -declare module away.animators { - /** - * - */ - class AnimationClipState extends AnimationStateBase { - private _animationClipNode; - private _animationStatePlaybackComplete; - public _pBlendWeight: number; - public _pCurrentFrame: number; - public _pNextFrame: number; - public _pOldFrame: number; - public _pTimeDir: number; - public _pFramesDirty: boolean; - /** - * Returns a fractional value between 0 and 1 representing the blending ratio of the current playhead position - * between the current frame (0) and next frame (1) of the animation. - * - * @see #currentFrame - * @see #nextFrame - */ - public blendWeight : number; - /** - * Returns the current frame of animation in the clip based on the internal playhead position. - */ - public currentFrame : number; - /** - * Returns the next frame of animation in the clip based on the internal playhead position. - */ - public nextFrame : number; - constructor(animator: AnimatorBase, animationClipNode: AnimationClipNodeBase); - /** - * @inheritDoc - */ - public update(time: number): void; - /** - * @inheritDoc - */ - public phase(value: number): void; - /** - * @inheritDoc - */ - public _pUpdateTime(time: number): void; - /** - * Updates the nodes internal playhead to determine the current and next animation frame, and the blendWeight between the two. - * - * @see #currentFrame - * @see #nextFrame - * @see #blendWeight - */ - public _pUpdateFrames(): void; - private notifyPlaybackComplete(); - } -} -declare module away.animators { - /** - * - */ - class SkeletonBinaryLERPState extends AnimationStateBase implements ISkeletonAnimationState { - private _blendWeight; - private _skeletonAnimationNode; - private _skeletonPose; - private _skeletonPoseDirty; - private _inputA; - private _inputB; - /** - * Defines a fractional value between 0 and 1 representing the blending ratio between inputA (0) and inputB (1), - * used to produce the skeleton pose output. - * - * @see inputA - * @see inputB - */ - public blendWeight : number; - constructor(animator: AnimatorBase, skeletonAnimationNode: SkeletonBinaryLERPNode); - /** - * @inheritDoc - */ - public phase(value: number): void; - /** - * @inheritDoc - */ - public _pUpdateTime(time: number): void; - /** - * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. - */ - public getSkeletonPose(skeleton: Skeleton): SkeletonPose; - /** - * @inheritDoc - */ - public _pUpdatePositionDelta(): void; - /** - * Updates the output skeleton pose of the node based on the blendWeight value between input nodes. - * - * @param skeleton The skeleton used by the animator requesting the ouput pose. - */ - private updateSkeletonPose(skeleton); - } -} -declare module away.animators { - /** - * - */ - class SkeletonClipState extends AnimationClipState implements ISkeletonAnimationState { - private _rootPos; - private _frames; - private _skeletonClipNode; - private _skeletonPose; - private _skeletonPoseDirty; - private _currentPose; - private _nextPose; - /** - * Returns the current skeleton pose frame of animation in the clip based on the internal playhead position. - */ - public currentPose : SkeletonPose; - /** - * Returns the next skeleton pose frame of animation in the clip based on the internal playhead position. - */ - public nextPose : SkeletonPose; - constructor(animator: AnimatorBase, skeletonClipNode: SkeletonClipNode); - /** - * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. - */ - public getSkeletonPose(skeleton: Skeleton): SkeletonPose; - /** - * @inheritDoc - */ - public _pUpdateTime(time: number): void; - /** - * @inheritDoc - */ - public _pUpdateFrames(): void; - /** - * Updates the output skeleton pose of the node based on the internal playhead position. - * - * @param skeleton The skeleton used by the animator requesting the ouput pose. - */ - private updateSkeletonPose(skeleton); - /** - * @inheritDoc - */ - public _pUpdatePositionDelta(): void; - } -} -declare module away.animators { - /** - * - */ - class SkeletonDifferenceState extends AnimationStateBase implements ISkeletonAnimationState { - private _blendWeight; - private static _tempQuat; - private _skeletonAnimationNode; - private _skeletonPose; - private _skeletonPoseDirty; - private _baseInput; - private _differenceInput; - /** - * Defines a fractional value between 0 and 1 representing the blending ratio between the base input (0) and difference input (1), - * used to produce the skeleton pose output. - * - * @see #baseInput - * @see #differenceInput - */ - public blendWeight : number; - constructor(animator: AnimatorBase, skeletonAnimationNode: SkeletonDifferenceNode); - /** - * @inheritDoc - */ - public phase(value: number): void; - /** - * @inheritDoc - */ - public _pUpdateTime(time: number): void; - /** - * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. - */ - public getSkeletonPose(skeleton: Skeleton): SkeletonPose; - /** - * @inheritDoc - */ - public _pUpdatePositionDelta(): void; - /** - * Updates the output skeleton pose of the node based on the blendWeight value between base input and difference input nodes. - * - * @param skeleton The skeleton used by the animator requesting the ouput pose. - */ - private updateSkeletonPose(skeleton); - } -} -declare module away.animators { - /** - * - */ - class SkeletonDirectionalState extends AnimationStateBase implements ISkeletonAnimationState { - private _skeletonAnimationNode; - private _skeletonPose; - private _skeletonPoseDirty; - private _inputA; - private _inputB; - private _blendWeight; - private _direction; - private _blendDirty; - private _forward; - private _backward; - private _left; - private _right; - /** - * Defines the direction in degrees of the aniamtion between the forwards (0), right(90) backwards (180) and left(270) input nodes, - * used to produce the skeleton pose output. - */ - public direction : number; - constructor(animator: AnimatorBase, skeletonAnimationNode: SkeletonDirectionalNode); - /** - * @inheritDoc - */ - public phase(value: number): void; - /** - * @inheritDoc - */ - public _pUdateTime(time: number): void; - /** - * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. - */ - public getSkeletonPose(skeleton: Skeleton): SkeletonPose; - /** - * @inheritDoc - */ - public _pUpdatePositionDelta(): void; - /** - * Updates the output skeleton pose of the node based on the direction value between forward, backwards, left and right input nodes. - * - * @param skeleton The skeleton used by the animator requesting the ouput pose. - */ - private updateSkeletonPose(skeleton); - /** - * Updates the blend value for the animation output based on the direction value between forward, backwards, left and right input nodes. - * - * @private - */ - private updateBlend(); - } -} -declare module away.animators { - /** - * - */ - class SkeletonNaryLERPState extends AnimationStateBase implements ISkeletonAnimationState { - private _skeletonAnimationNode; - private _skeletonPose; - private _skeletonPoseDirty; - private _blendWeights; - private _inputs; - constructor(animator: AnimatorBase, skeletonAnimationNode: SkeletonNaryLERPNode); - /** - * @inheritDoc - */ - public phase(value: number): void; - /** - * @inheritDoc - */ - public _pUdateTime(time: number): void; - /** - * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. - */ - public getSkeletonPose(skeleton: Skeleton): SkeletonPose; - /** - * Returns the blend weight of the skeleton aniamtion node that resides at the given input index. - * - * @param index The input index for which the skeleton animation node blend weight is requested. - */ - public getBlendWeightAt(index: number): number; - /** - * Sets the blend weight of the skeleton aniamtion node that resides at the given input index. - * - * @param index The input index on which the skeleton animation node blend weight is to be set. - * @param blendWeight The blend weight value to use for the given skeleton animation node index. - */ - public setBlendWeightAt(index: number, blendWeight: number): void; - /** - * @inheritDoc - */ - public _pUpdatePositionDelta(): void; - /** - * Updates the output skeleton pose of the node based on the blend weight values given to the input nodes. - * - * @param skeleton The skeleton used by the animator requesting the ouput pose. - */ - private updateSkeletonPose(skeleton); - } -} -declare module away.animators { - /** - * - */ - class VertexClipState extends AnimationClipState implements IVertexAnimationState { - private _frames; - private _vertexClipNode; - private _currentGeometry; - private _nextGeometry; - /** - * @inheritDoc - */ - public currentGeometry : base.Geometry; - /** - * @inheritDoc - */ - public nextGeometry : base.Geometry; - constructor(animator: AnimatorBase, vertexClipNode: VertexClipNode); - /** - * @inheritDoc - */ - public _pUpdateFrames(): void; - /** - * @inheritDoc - */ - public _pUpdatePositionDelta(): void; - } -} -declare module away.animators { - interface IAnimationTransition { - getAnimationNode(animator: AnimatorBase, startNode: AnimationNodeBase, endNode: AnimationNodeBase, startTime: number): AnimationNodeBase; - } -} -declare module away.animators { - class CrossfadeTransition implements IAnimationTransition { - public blendSpeed: number; - constructor(blendSpeed: number); - public getAnimationNode(animator: AnimatorBase, startNode: AnimationNodeBase, endNode: AnimationNodeBase, startBlend: number): AnimationNodeBase; - } -} -declare module away.animators { - /** - * A skeleton animation node that uses two animation node inputs to blend a lineraly interpolated output of a skeleton pose. - */ - class CrossfadeTransitionNode extends SkeletonBinaryLERPNode { - public blendSpeed: number; - public startBlend: number; - /** - * Creates a new CrossfadeTransitionNode object. - */ - constructor(); - } -} -declare module away.animators { - /** - * - */ - class CrossfadeTransitionState extends SkeletonBinaryLERPState { - private _crossfadeTransitionNode; - private _animationStateTransitionComplete; - constructor(animator: AnimatorBase, skeletonAnimationNode: CrossfadeTransitionNode); - /** - * @inheritDoc - */ - public _pUpdateTime(time: number): void; - } -} -declare module away.animators { - /** - * The animation data set used by particle-based animators, containing particle animation data. - * - * @see away.animators.ParticleAnimator - */ - class ParticleAnimationSet extends AnimationSetBase implements IAnimationSet { - /** @private */ - public _iAnimationRegisterCache: AnimationRegisterCache; - private _timeNode; - /** - * Property used by particle nodes that require compilation at the end of the shader - */ - static POST_PRIORITY: number; - /** - * Property used by particle nodes that require color compilation - */ - static COLOR_PRIORITY: number; - private _animationSubGeometries; - private _particleNodes; - private _localDynamicNodes; - private _localStaticNodes; - private _totalLenOfOneVertex; - public hasUVNode: boolean; - public needVelocity: boolean; - public hasBillboard: boolean; - public hasColorMulNode: boolean; - public hasColorAddNode: boolean; - /** - * Initialiser function for static particle properties. Needs to reference a with the following format - * - * - * initParticleFunc(prop:ParticleProperties) - * { - * //code for settings local properties - * } - * - * - * Aside from setting any properties required in particle animation nodes using local static properties, the initParticleFunc function - * is required to time node requirements as they may be needed. These properties on the ParticleProperties object can include - * startTime, duration and delay. The use of these properties is determined by the setting - * arguments passed in the constructor of the particle animation set. By default, only the startTime property is required. - */ - public initParticleFunc: Function; - /** - * Initialiser function scope for static particle properties - */ - public initParticleScope: Object; - /** - * Creates a new ParticleAnimationSet - * - * @param [optional] usesDuration Defines whether the animation set uses the duration data in its static properties to determine how long a particle is visible for. Defaults to false. - * @param [optional] usesLooping Defines whether the animation set uses a looping timeframe for each particle determined by the startTime, duration and delay data in its static properties function. Defaults to false. Requires usesDuration to be true. - * @param [optional] usesDelay Defines whether the animation set uses the delay data in its static properties to determine how long a particle is hidden for. Defaults to false. Requires usesLooping to be true. - */ - constructor(usesDuration?: boolean, usesLooping?: boolean, usesDelay?: boolean); - /** - * Returns a vector of the particle animation nodes contained within the set. - */ - public particleNodes : ParticleNodeBase[]; - /** - * @inheritDoc - */ - public addAnimation(node: AnimationNodeBase): void; - /** - * @inheritDoc - */ - public activate(shaderObject: materials.ShaderObjectBase, stage: base.Stage): void; - /** - * @inheritDoc - */ - public deactivate(shaderObject: materials.ShaderObjectBase, stage: base.Stage): void; - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject: materials.ShaderObjectBase): string; - /** - * @inheritDoc - */ - public getAGALUVCode(shaderObject: materials.ShaderObjectBase): string; - /** - * @inheritDoc - */ - public getAGALFragmentCode(shaderObject: materials.ShaderObjectBase, shadedTarget: string): string; - /** - * @inheritDoc - */ - public doneAGALCode(shaderObject: materials.ShaderObjectBase): void; - /** - * @inheritDoc - */ - public usesCPU : boolean; - /** - * @inheritDoc - */ - public cancelGPUCompatibility(): void; - public dispose(): void; - public getAnimationSubGeometry(subMesh: base.ISubMesh): any; - /** @private */ - public _iGenerateAnimationSubGeometries(mesh: entities.Mesh): void; - } -} -declare module away.animators { - /** - * Provides an interface for assigning paricle-based animation data sets to mesh-based entity objects - * and controlling the various available states of animation through an interative playhead that can be - * automatically updated or manually triggered. - * - * Requires that the containing geometry of the parent mesh is particle geometry - * - * @see away.base.ParticleGeometry - */ - class ParticleAnimator extends AnimatorBase { - private _particleAnimationSet; - private _animationParticleStates; - private _animatorParticleStates; - private _timeParticleStates; - private _totalLenOfOneVertex; - private _animatorSubGeometries; - /** - * Creates a new ParticleAnimator object. - * - * @param particleAnimationSet The animation data set containing the particle animations used by the animator. - */ - constructor(particleAnimationSet: ParticleAnimationSet); - /** - * @inheritDoc - */ - public clone(): AnimatorBase; - /** - * @inheritDoc - */ - public setRenderState(shaderObject: materials.ShaderObjectBase, renderable: pool.RenderableBase, stage: base.Stage, camera: entities.Camera, vertexConstantOffset: number, vertexStreamOffset: number): void; - /** - * @inheritDoc - */ - public testGPUCompatibility(shaderObject: materials.ShaderObjectBase): void; - /** - * @inheritDoc - */ - public start(): void; - /** - * @inheritDoc - */ - public _pUpdateDeltaTime(dt: number): void; - /** - * @inheritDoc - */ - public resetTime(offset?: number): void; - public dispose(): void; - private getAnimatorSubGeometry(subMesh); - } -} -declare module away.animators { - /** - * Provides an interface for assigning skeleton-based animation data sets to mesh-based entity objects - * and controlling the various available states of animation through an interative playhead that can be - * automatically updated or manually triggered. - */ - class SkeletonAnimator extends AnimatorBase { - private _globalMatrices; - private _globalPose; - private _globalPropertiesDirty; - private _numJoints; - private _morphedSubGeometry; - private _morphedSubGeometryDirty; - private _condensedMatrices; - private _skeleton; - private _forceCPU; - private _useCondensedIndices; - private _jointsPerVertex; - private _activeSkeletonState; - private _onTransitionCompleteDelegate; - private _onIndicesUpdateDelegate; - private _onVerticesUpdateDelegate; - /** - * returns the calculated global matrices of the current skeleton pose. - * - * @see #globalPose - */ - public globalMatrices : number[]; - /** - * returns the current skeleton pose output from the animator. - * - * @see away.animators.data.SkeletonPose - */ - public globalPose : SkeletonPose; - /** - * Returns the skeleton object in use by the animator - this defines the number and heirarchy of joints used by the - * skinned geoemtry to which skeleon animator is applied. - */ - public skeleton : Skeleton; - /** - * Indicates whether the skeleton animator is disabled by default for GPU rendering, something that allows the animator to perform calculation on the GPU. - * Defaults to false. - */ - public forceCPU : boolean; - /** - * Offers the option of enabling GPU accelerated animation on skeletons larger than 32 joints - * by condensing the number of joint index values required per mesh. Only applicable to - * skeleton animations that utilise more than one mesh object. Defaults to false. - */ - public useCondensedIndices : boolean; - /** - * Creates a new SkeletonAnimator object. - * - * @param skeletonAnimationSet The animation data set containing the skeleton animations used by the animator. - * @param skeleton The skeleton object used for calculating the resulting global matrices for transforming skinned mesh data. - * @param forceCPU Optional value that only allows the animator to perform calculation on the CPU. Defaults to false. - */ - constructor(animationSet: SkeletonAnimationSet, skeleton: Skeleton, forceCPU?: boolean); - /** - * @inheritDoc - */ - public clone(): AnimatorBase; - /** - * Plays an animation state registered with the given name in the animation data set. - * - * @param name The data set name of the animation state to be played. - * @param transition An optional transition object that determines how the animator will transition from the currently active animation state. - * @param offset An option offset time (in milliseconds) that resets the state's internal clock to the absolute time of the animator plus the offset value. Required for non-looping animation states. - */ - public play(name: string, transition?: IAnimationTransition, offset?: number): void; - /** - * @inheritDoc - */ - public setRenderState(shaderObject: materials.ShaderObjectBase, renderable: pool.RenderableBase, stage: base.Stage, camera: entities.Camera, vertexConstantOffset: number, vertexStreamOffset: number): void; - /** - * @inheritDoc - */ - public testGPUCompatibility(shaderObject: materials.ShaderObjectBase): void; - /** - * Applies the calculated time delta to the active animation state node or state transition object. - */ - public _pUpdateDeltaTime(dt: number): void; - private updateCondensedMatrices(condensedIndexLookUp, numJoints); - private updateGlobalProperties(); - public getRenderableSubGeometry(renderable: pool.TriangleSubMeshRenderable, sourceSubGeometry: base.TriangleSubGeometry): base.TriangleSubGeometry; - /** - * If the animation can't be performed on GPU, transform vertices manually - * @param subGeom The subgeometry containing the weights and joint index data per vertex. - * @param pass The material pass for which we need to transform the vertices - */ - public morphSubGeometry(renderable: pool.TriangleSubMeshRenderable, sourceSubGeometry: base.TriangleSubGeometry): void; - /** - * Converts a local hierarchical skeleton pose to a global pose - * @param targetPose The SkeletonPose object that will contain the global pose. - * @param skeleton The skeleton containing the joints, and as such, the hierarchical data to transform to global poses. - */ - private localToGlobalPose(sourcePose, targetPose, skeleton); - private onTransitionComplete(event); - private onIndicesUpdate(event); - private onVerticesUpdate(event); - } -} -declare module away.animators { - /** - * The animation data set used by skeleton-based animators, containing skeleton animation data. - * - * @see away.animators.SkeletonAnimator - */ - class SkeletonAnimationSet extends AnimationSetBase implements IAnimationSet { - private _jointsPerVertex; - /** - * Returns the amount of skeleton joints that can be linked to a single vertex via skinned weight values. For GPU-base animation, the - * maximum allowed value is 4. - */ - public jointsPerVertex : number; - /** - * Creates a new SkeletonAnimationSet object. - * - * @param jointsPerVertex Sets the amount of skeleton joints that can be linked to a single vertex via skinned weight values. For GPU-base animation, the maximum allowed value is 4. Defaults to 4. - */ - constructor(jointsPerVertex?: number); - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject: materials.ShaderObjectBase): string; - /** - * @inheritDoc - */ - public activate(shaderObject: materials.ShaderObjectBase, stage: base.Stage): void; - /** - * @inheritDoc - */ - public deactivate(shaderObject: materials.ShaderObjectBase, stage: base.Stage): void; - /** - * @inheritDoc - */ - public getAGALFragmentCode(shaderObject: materials.ShaderObjectBase, shadedTarget: string): string; - /** - * @inheritDoc - */ - public getAGALUVCode(shaderObject: materials.ShaderObjectBase): string; - /** - * @inheritDoc - */ - public doneAGALCode(shaderObject: materials.ShaderObjectBase): void; - } -} -declare module away.animators { - /** - * The animation data set used by vertex-based animators, containing vertex animation state data. - * - * @see away.animators.VertexAnimator - */ - class VertexAnimationSet extends AnimationSetBase implements IAnimationSet { - private _numPoses; - private _blendMode; - /** - * Returns the number of poses made available at once to the GPU animation code. - */ - public numPoses : number; - /** - * Returns the active blend mode of the vertex animator object. - */ - public blendMode : string; - /** - * Creates a new VertexAnimationSet object. - * - * @param numPoses The number of poses made available at once to the GPU animation code. - * @param blendMode Optional value for setting the animation mode of the vertex animator object. - * - * @see away3d.animators.data.VertexAnimationMode - */ - constructor(numPoses?: number, blendMode?: string); - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject: materials.ShaderObjectBase): string; - /** - * @inheritDoc - */ - public activate(shaderObject: materials.ShaderObjectBase, stage: base.Stage): void; - /** - * @inheritDoc - */ - public deactivate(shaderObject: materials.ShaderObjectBase, stage: base.Stage): void; - /** - * @inheritDoc - */ - public getAGALFragmentCode(shaderObject: materials.ShaderObjectBase, shadedTarget: string): string; - /** - * @inheritDoc - */ - public getAGALUVCode(shaderObject: materials.ShaderObjectBase): string; - /** - * @inheritDoc - */ - public doneAGALCode(shaderObject: materials.ShaderObjectBase): void; - /** - * Generates the vertex AGAL code for absolute blending. - */ - private getAbsoluteAGALCode(shaderObject); - /** - * Generates the vertex AGAL code for additive blending. - */ - private getAdditiveAGALCode(shaderObject); - } -} -declare module away.animators { - /** - * Provides an interface for assigning vertex-based animation data sets to mesh-based entity objects - * and controlling the various available states of animation through an interative playhead that can be - * automatically updated or manually triggered. - */ - class VertexAnimator extends AnimatorBase { - private _vertexAnimationSet; - private _poses; - private _weights; - private _numPoses; - private _blendMode; - private _activeVertexState; - /** - * Creates a new VertexAnimator object. - * - * @param vertexAnimationSet The animation data set containing the vertex animations used by the animator. - */ - constructor(vertexAnimationSet: VertexAnimationSet); - /** - * @inheritDoc - */ - public clone(): AnimatorBase; - /** - * Plays a sequence with a given name. If the sequence is not found, it may not be loaded yet, and it will retry every frame. - * @param sequenceName The name of the clip to be played. - */ - public play(name: string, transition?: IAnimationTransition, offset?: number): void; - /** - * @inheritDoc - */ - public _pUpdateDeltaTime(dt: number): void; - /** - * @inheritDoc - */ - public setRenderState(shaderObject: materials.ShaderObjectBase, renderable: pool.RenderableBase, stage: base.Stage, camera: entities.Camera, vertexConstantOffset: number, vertexStreamOffset: number): void; - private setNullPose(shaderObject, renderable, stage, vertexConstantOffset, vertexStreamOffset); - /** - * Verifies if the animation will be used on cpu. Needs to be true for all passes for a material to be able to use it on gpu. - * Needs to be called if gpu code is potentially required. - */ - public testGPUCompatibility(shaderObject: materials.ShaderObjectBase): void; - public getRenderableSubGeometry(renderable: pool.TriangleSubMeshRenderable, sourceSubGeometry: base.TriangleSubGeometry): base.TriangleSubGeometry; - } -} -declare module away.parsers { - /** - * OBJParser provides a parser for the OBJ data type. - */ - class OBJParser extends ParserBase { - private _textData; - private _startedParsing; - private _charIndex; - private _oldIndex; - private _stringLength; - private _currentObject; - private _currentGroup; - private _currentMaterialGroup; - private _objects; - private _materialIDs; - private _materialLoaded; - private _materialSpecularData; - private _meshes; - private _lastMtlID; - private _objectIndex; - private _realIndices; - private _vertexIndex; - private _vertices; - private _vertexNormals; - private _uvs; - private _scale; - private _mtlLib; - private _mtlLibLoaded; - private _activeMaterialID; - /** - * Creates a new OBJParser object. - * @param uri The url or id of the data or file to be parsed. - * @param extra The holder for extra contextual data that the parser might need. - */ - constructor(scale?: number); - /** - * Scaling factor applied directly to vertices data - * @param value The scaling factor. - */ - public scale : number; - /** - * Indicates whether or not a given file extension is supported by the parser. - * @param extension The file extension of a potential file to be parsed. - * @return Whether or not the given file type is supported. - */ - static supportsType(extension: string): boolean; - /** - * Tests whether a data block can be parsed by the parser. - * @param data The data block to potentially be parsed. - * @return Whether or not the given data is supported. - */ - static supportsData(data: any): boolean; - /** - * @inheritDoc - */ - public _iResolveDependency(resourceDependency: ResourceDependency): void; - /** - * @inheritDoc - */ - public _iResolveDependencyFailure(resourceDependency: ResourceDependency): void; - /** - * @inheritDoc - */ - public _pProceedParsing(): boolean; - public _pStartParsing(frameLimit: number): void; - /** - * Parses a single line in the OBJ file. - */ - private parseLine(trunk); - /** - * Converts the parsed data into an Away3D scenegraph structure - */ - private translate(); - /** - * Translates an obj's material group to a subgeometry. - * @param materialGroup The material group data to convert. - * @param geometry The Geometry to contain the converted SubGeometry. - */ - private translateMaterialGroup(materialGroup, geometry); - private translateVertexData(face, vertexIndex, vertices, uvs, indices, normals); - /** - * Creates a new object group. - * @param trunk The data block containing the object tag and its parameters - */ - private createObject(trunk); - /** - * Creates a new group. - * @param trunk The data block containing the group tag and its parameters - */ - private createGroup(trunk); - /** - * Creates a new material group. - * @param trunk The data block containing the material tag and its parameters - */ - private createMaterialGroup(trunk); - /** - * Reads the next vertex coordinates. - * @param trunk The data block containing the vertex tag and its parameters - */ - private parseVertex(trunk); - /** - * Reads the next uv coordinates. - * @param trunk The data block containing the uv tag and its parameters - */ - private parseUV(trunk); - /** - * Reads the next vertex normal coordinates. - * @param trunk The data block containing the vertex normal tag and its parameters - */ - private parseVertexNormal(trunk); - /** - * Reads the next face's indices. - * @param trunk The data block containing the face tag and its parameters - */ - private parseFace(trunk); - /** - * This is a hack around negative face coords - */ - private parseIndex(index, length); - private parseMtl(data); - private parseMapKdString(trunk); - private loadMtl(mtlurl); - private applyMaterial(lm); - private applyMaterials(); - } -} -declare class ObjectGroup { - public name: string; - public groups: Group[]; -} -declare class Group { - public name: string; - public materialID: string; - public materialGroups: MaterialGroup[]; -} -declare class MaterialGroup { - public url: string; - public faces: FaceData[]; -} -declare class SpecularData { - public materialID: string; - public basicSpecularMethod: away.materials.SpecularBasicMethod; - public color: number; - public alpha: number; -} -declare class LoadedMaterial { - public materialID: string; - public texture: away.textures.Texture2DBase; - public cm: away.materials.MaterialBase; - public specularMethod: away.materials.SpecularBasicMethod; - public color: number; - public alpha: number; -} -declare class FaceData { - public vertexIndices: number[]; - public uvIndices: number[]; - public normalIndices: number[]; - public indexIds: string[]; -} -/** -* Texture coordinates value object. -*/ -declare class UV { - private _u; - private _v; - /** - * Creates a new UV object. - * - * @param u [optional] The horizontal coordinate of the texture value. Defaults to 0. - * @param v [optional] The vertical coordinate of the texture value. Defaults to 0. - */ - constructor(u?: number, v?: number); - /** - * Defines the vertical coordinate of the texture value. - */ - public v : number; - /** - * Defines the horizontal coordinate of the texture value. - */ - public u : number; - /** - * returns a new UV value Object - */ - public clone(): UV; - /** - * returns the value object as a string for trace/debug purpose - */ - public toString(): string; -} -declare class Vertex { - private _x; - private _y; - private _z; - private _index; - /** - * Creates a new Vertex value object. - * - * @param x [optional] The x value. Defaults to 0. - * @param y [optional] The y value. Defaults to 0. - * @param z [optional] The z value. Defaults to 0. - * @param index [optional] The index value. Defaults is NaN. - */ - constructor(x?: number, y?: number, z?: number, index?: number); - /** - * To define/store the index of value object - * @param ind The index - */ - public index : number; - /** - * To define/store the x value of the value object - * @param value The x value - */ - public x : number; - /** - * To define/store the y value of the value object - * @param value The y value - */ - public y : number; - /** - * To define/store the z value of the value object - * @param value The z value - */ - public z : number; - /** - * returns a new Vertex value Object - */ - public clone(): Vertex; -} -declare module away.parsers { - /** - * AWDParser provides a parser for the AWD data type. - */ - class AWDParser extends ParserBase { - private _debug; - private _byteData; - private _startedParsing; - private _cur_block_id; - private _blocks; - private _newBlockBytes; - private _version; - private _compression; - private _accuracyOnBlocks; - private _accuracyMatrix; - private _accuracyGeo; - private _accuracyProps; - private _matrixNrType; - private _geoNrType; - private _propsNrType; - private _streaming; - private _texture_users; - private _parsed_header; - private _body; - private _defaultTexture; - private _cubeTextures; - private _defaultBitmapMaterial; - private _defaultCubeTexture; - static COMPRESSIONMODE_LZMA: string; - static UNCOMPRESSED: number; - static DEFLATE: number; - static LZMA: number; - static INT8: number; - static INT16: number; - static INT32: number; - static UINT8: number; - static UINT16: number; - static UINT32: number; - static FLOAT32: number; - static FLOAT64: number; - static BOOL: number; - static COLOR: number; - static BADDR: number; - static AWDSTRING: number; - static AWDBYTEARRAY: number; - static VECTOR2x1: number; - static VECTOR3x1: number; - static VECTOR4x1: number; - static MTX3x2: number; - static MTX3x3: number; - static MTX4x3: number; - static MTX4x4: number; - private blendModeDic; - private _depthSizeDic; - /** - * Creates a new AWDParser object. - * @param uri The url or id of the data or file to be parsed. - * @param extra The holder for extra contextual data that the parser might need. - */ - constructor(); - /** - * Indicates whether or not a given file extension is supported by the parser. - * @param extension The file extension of a potential file to be parsed. - * @return Whether or not the given file type is supported. - */ - static supportsType(extension: string): boolean; - /** - * Tests whether a data block can be parsed by the parser. - * @param data The data block to potentially be parsed. - * @return Whether or not the given data is supported. - */ - static supportsData(data: any): boolean; - /** - * @inheritDoc - */ - public _iResolveDependency(resourceDependency: ResourceDependency): void; - /** - * @inheritDoc - */ - public _iResolveDependencyFailure(resourceDependency: ResourceDependency): void; - /** - * Resolve a dependency name - * - * @param resourceDependency The dependency to be resolved. - */ - public _iResolveDependencyName(resourceDependency: ResourceDependency, asset: library.IAsset): string; - /** - * @inheritDoc - */ - public _pProceedParsing(): boolean; - public _pStartParsing(frameLimit: number): void; - private dispose(); - private parseNextBlock(); - private parseTriangleGeometrieBlock(blockID); - private parsePrimitves(blockID); - private parseContainer(blockID); - private parseMeshInstance(blockID); - private parseSkyboxInstance(blockID); - private parseLight(blockID); - private parseCamera(blockID); - private parseLightPicker(blockID); - private parseMaterial(blockID); - private parseMaterial_v1(blockID); - private parseTexture(blockID); - private parseCubeTexture(blockID); - private parseSharedMethodBlock(blockID); - private parseShadowMethodBlock(blockID); - private parseCommand(blockID); - private parseMetaData(blockID); - private parseNameSpace(blockID); - private parseShadowMethodList(light, blockID); - private parseSkeleton(blockID); - private parseSkeletonPose(blockID); - private parseSkeletonAnimation(blockID); - private parseMeshPoseAnimation(blockID, poseOnly?); - private parseVertexAnimationSet(blockID); - private parseAnimatorSet(blockID); - private parseSharedMethodList(blockID); - private parseUserAttributes(); - private parseProperties(expected); - private parseAttrValue(type, len); - private parseHeader(); - private getUVForVertexAnimation(meshID); - private parseVarStr(); - private getAssetByID(assetID, assetTypesToGet, extraTypeInfo?); - private getDefaultAsset(assetType, extraTypeInfo); - private getDefaultMaterial(); - private getDefaultTexture(); - private getDefaultCubeTexture(); - private readNumber(precision?); - private parseMatrix3D(); - private parseMatrix32RawData(); - private parseMatrix43RawData(); - } -} -declare class AWDBlock { - public id: number; - public name: string; - public data: any; - public len: any; - public geoID: number; - public extras: Object; - public bytes: away.utils.ByteArray; - public errorMessages: string[]; - public uvsForVertexAnimation: number[][]; - constructor(); - public dispose(): void; - public addError(errorMsg: string): void; -} -declare class bitFlags { - static FLAG1: number; - static FLAG2: number; - static FLAG3: number; - static FLAG4: number; - static FLAG5: number; - static FLAG6: number; - static FLAG7: number; - static FLAG8: number; - static FLAG9: number; - static FLAG10: number; - static FLAG11: number; - static FLAG12: number; - static FLAG13: number; - static FLAG14: number; - static FLAG15: number; - static FLAG16: number; - static test(flags: number, testFlag: number): boolean; -} -declare class AWDProperties { - public set(key: number, value: any): void; - public get(key: number, fallback: any): any; -} -declare module away.parsers { - /** - * Max3DSParser provides a parser for the 3ds data type. - */ - class Max3DSParser extends ParserBase { - private _byteData; - private _textures; - private _materials; - private _unfinalized_objects; - private _cur_obj_end; - private _cur_obj; - private _cur_mat_end; - private _cur_mat; - private _useSmoothingGroups; - /** - * Creates a new Max3DSParser object. - * - * @param useSmoothingGroups Determines whether the parser looks for smoothing groups in the 3ds file or assumes uniform smoothing. Defaults to true. - */ - constructor(useSmoothingGroups?: boolean); - /** - * Indicates whether or not a given file extension is supported by the parser. - * @param extension The file extension of a potential file to be parsed. - * @return Whether or not the given file type is supported. - */ - static supportsType(extension: string): boolean; - /** - * Tests whether a data block can be parsed by the parser. - * @param data The data block to potentially be parsed. - * @return Whether or not the given data is supported. - */ - static supportsData(data: any): boolean; - /** - * @inheritDoc - */ - public _iResolveDependency(resourceDependency: ResourceDependency): void; - /** - * @inheritDoc - */ - public _iResolveDependencyFailure(resourceDependency: ResourceDependency): void; - /** - * @inheritDoc - */ - public _pProceedParsing(): boolean; - public _pStartParsing(frameLimit: number): void; - private parseMaterial(); - private parseTexture(end); - private parseVertexList(); - private parseFaceList(); - private parseSmoothingGroups(); - private parseUVList(); - private parseFaceMaterialList(); - private parseObjectAnimation(end); - private constructObject(obj, pivot?); - private prepareData(vertices, faces, obj); - private applySmoothGroups(vertices, faces); - private finalizeCurrentMaterial(); - private readNulTermstring(); - private readTransform(); - private readColor(); - } -} -declare class TextureVO { - public url: string; - public texture: away.textures.Texture2DBase; -} -declare class MaterialVO { - public name: string; - public ambientColor: number; - public diffuseColor: number; - public specularColor: number; - public twoSided: boolean; - public colorMap: TextureVO; - public specularMap: TextureVO; - public material: away.materials.MaterialBase; -} -declare class ObjectVO { - public name: string; - public type: string; - public pivotX: number; - public pivotY: number; - public pivotZ: number; - public transform: number[]; - public verts: number[]; - public indices: number[]; - public uvs: number[]; - public materialFaces: Object; - public materials: string[]; - public smoothingGroups: number[]; -} -declare class VertexVO { - public x: number; - public y: number; - public z: number; - public u: number; - public v: number; - public normal: away.geom.Vector3D; - public tangent: away.geom.Vector3D; -} -declare class FaceVO { - public a: number; - public b: number; - public c: number; - public smoothGroup: number; -} -declare module away.parsers { - /** - * MD2Parser provides a parser for the MD2 data type. - */ - class MD2Parser extends ParserBase { - static FPS: number; - private _clipNodes; - private _byteData; - private _startedParsing; - private _parsedHeader; - private _parsedUV; - private _parsedFaces; - private _parsedFrames; - private _ident; - private _version; - private _skinWidth; - private _skinHeight; - private _numSkins; - private _numVertices; - private _numST; - private _numTris; - private _numFrames; - private _offsetSkins; - private _offsetST; - private _offsetTris; - private _offsetFrames; - private _offsetEnd; - private _uvIndices; - private _indices; - private _vertIndices; - private _animationSet; - private _firstSubGeom; - private _uvs; - private _finalUV; - private _materialNames; - private _textureType; - private _ignoreTexturePath; - private _mesh; - private _geometry; - private materialFinal; - private geoCreated; - /** - * Creates a new MD2Parser object. - * @param textureType The extension of the texture (e.g. jpg/png/...) - * @param ignoreTexturePath If true, the path of the texture is ignored - */ - constructor(textureType?: string, ignoreTexturePath?: boolean); - /** - * Indicates whether or not a given file extension is supported by the parser. - * @param extension The file extension of a potential file to be parsed. - * @return Whether or not the given file type is supported. - */ - static supportsType(extension: string): boolean; - /** - * Tests whether a data block can be parsed by the parser. - * @param data The data block to potentially be parsed. - * @return Whether or not the given data is supported. - */ - static supportsData(data: any): boolean; - /** - * @inheritDoc - */ - public _iResolveDependency(resourceDependency: ResourceDependency): void; - /** - * @inheritDoc - */ - public _iResolveDependencyFailure(resourceDependency: ResourceDependency): void; - /** - * @inheritDoc - */ - public _pProceedParsing(): boolean; - public _pStartParsing(frameLimit: number): void; - /** - * Reads in all that MD2 Header data that is declared as private variables. - * I know its a lot, and it looks ugly, but only way to do it in Flash - */ - private parseHeader(); - /** - * Parses the file names for the materials. - */ - private parseMaterialNames(); - /** - * Parses the uv data for the mesh. - */ - private parseUV(); - /** - * Parses unique indices for the faces. - */ - private parseFaces(); - /** - * Adds a face index to the list if it doesn't exist yet, based on vertexIndex and uvIndex, and adds the - * corresponding vertex and uv data in the correct location. - * @param vertexIndex The original index in the vertex list. - * @param uvIndex The original index in the uv list. - */ - private addIndex(vertexIndex, uvIndex); - /** - * Finds the final index corresponding to the original MD2's vertex and uv indices. Returns -1 if it wasn't added yet. - * @param vertexIndex The original index in the vertex list. - * @param uvIndex The original index in the uv list. - * @return The index of the final mesh corresponding to the original vertex and uv index. -1 if it doesn't exist yet. - */ - private findIndex(vertexIndex, uvIndex); - /** - * Parses all the frame geometries. - */ - private parseFrames(); - private readFrameName(); - } -} -declare module away.parsers { - /** - * MD5AnimParser provides a parser for the md5anim data type, providing an animation sequence for the md5 format. - * - * todo: optimize - */ - class MD5AnimParser extends ParserBase { - private _textData; - private _startedParsing; - static VERSION_TOKEN: string; - static COMMAND_LINE_TOKEN: string; - static NUM_FRAMES_TOKEN: string; - static NUM_JOINTS_TOKEN: string; - static FRAME_RATE_TOKEN: string; - static NUM_ANIMATED_COMPONENTS_TOKEN: string; - static HIERARCHY_TOKEN: string; - static BOUNDS_TOKEN: string; - static BASE_FRAME_TOKEN: string; - static FRAME_TOKEN: string; - static COMMENT_TOKEN: string; - private _parseIndex; - private _reachedEOF; - private _line; - private _charLineIndex; - private _version; - private _frameRate; - private _numFrames; - private _numJoints; - private _numAnimatedComponents; - private _hierarchy; - private _bounds; - private _frameData; - private _baseFrameData; - private _rotationQuat; - private _clip; - /** - * Creates a new MD5AnimParser object. - * @param uri The url or id of the data or file to be parsed. - * @param extra The holder for extra contextual data that the parser might need. - */ - constructor(additionalRotationAxis?: geom.Vector3D, additionalRotationRadians?: number); - /** - * Indicates whether or not a given file extension is supported by the parser. - * @param extension The file extension of a potential file to be parsed. - * @return Whether or not the given file type is supported. - */ - static supportsType(extension: string): boolean; - /** - * Tests whether a data block can be parsed by the parser. - * @param data The data block to potentially be parsed. - * @return Whether or not the given data is supported. - */ - static supportsData(data: any): boolean; - /** - * @inheritDoc - */ - public _pProceedParsing(): boolean; - /** - * Converts all key frame data to an SkinnedAnimationSequence. - */ - private translateClip(); - /** - * Converts a single key frame data to a SkeletonPose. - * @param frameData The actual frame data. - * @return A SkeletonPose containing the frame data's pose. - */ - private translatePose(frameData); - /** - * Parses the skeleton's hierarchy data. - */ - private parseHierarchy(); - /** - * Parses frame bounds. - */ - private parseBounds(); - /** - * Parses the base frame. - */ - private parseBaseFrame(); - /** - * Parses a single frame. - */ - private parseFrame(); - /** - * Puts back the last read character into the data stream. - */ - private putBack(); - /** - * Gets the next token in the data stream. - */ - private getNextToken(); - /** - * Skips all whitespace in the data stream. - */ - private skipWhiteSpace(); - /** - * Skips to the next line. - */ - private ignoreLine(); - /** - * Retrieves the next single character in the data stream. - */ - private getNextChar(); - /** - * Retrieves the next integer in the data stream. - */ - private getNextInt(); - /** - * Retrieves the next floating point number in the data stream. - */ - private getNextNumber(); - /** - * Retrieves the next 3d vector in the data stream. - */ - private parseVector3D(); - /** - * Retrieves the next quaternion in the data stream. - */ - private parseQuaternion(); - /** - * Parses the command line data. - */ - private parseCMD(); - /** - * Retrieves the next literal string in the data stream. A literal string is a sequence of characters bounded - * by double quotes. - */ - private parseLiteralstring(); - /** - * Throws an end-of-file error when a premature end of file was encountered. - */ - private sendEOFError(); - /** - * Throws an error when an unexpected token was encountered. - * @param expected The token type that was actually expected. - */ - private sendParseError(expected); - /** - * Throws an error when an unknown keyword was encountered. - */ - private sendUnknownKeywordError(); - } -} -declare class HierarchyData { - public name: string; - public parentIndex: number; - public flags: number; - public startIndex: number; - public HierarchyData(): void; -} -declare class BoundsData { - public min: away.geom.Vector3D; - public max: away.geom.Vector3D; - public BoundsData(): void; -} -declare class BaseFrameData { - public position: away.geom.Vector3D; - public orientation: away.geom.Quaternion; - public BaseFrameData(): void; -} -declare class FrameData { - public index: number; - public components: number[]; - public FrameData(): void; -} -declare module away.parsers { - /** - * MD5MeshParser provides a parser for the md5mesh data type, providing the geometry of the md5 format. - * - * todo: optimize - */ - class MD5MeshParser extends ParserBase { - private _textData; - private _startedParsing; - static VERSION_TOKEN: string; - static COMMAND_LINE_TOKEN: string; - static NUM_JOINTS_TOKEN: string; - static NUM_MESHES_TOKEN: string; - static COMMENT_TOKEN: string; - static JOINTS_TOKEN: string; - static MESH_TOKEN: string; - static MESH_SHADER_TOKEN: string; - static MESH_NUM_VERTS_TOKEN: string; - static MESH_VERT_TOKEN: string; - static MESH_NUM_TRIS_TOKEN: string; - static MESH_TRI_TOKEN: string; - static MESH_NUM_WEIGHTS_TOKEN: string; - static MESH_WEIGHT_TOKEN: string; - private _parseIndex; - private _reachedEOF; - private _line; - private _charLineIndex; - private _version; - private _numJoints; - private _numMeshes; - private _mesh; - private _shaders; - private _maxJointCount; - private _meshData; - private _bindPoses; - private _geometry; - private _skeleton; - private _animationSet; - private _rotationQuat; - /** - * Creates a new MD5MeshParser object. - */ - constructor(additionalRotationAxis?: geom.Vector3D, additionalRotationRadians?: number); - /** - * Indicates whether or not a given file extension is supported by the parser. - * @param extension The file extension of a potential file to be parsed. - * @return Whether or not the given file type is supported. - */ - static supportsType(extension: string): boolean; - /** - * Tests whether a data block can be parsed by the parser. - * @param data The data block to potentially be parsed. - * @return Whether or not the given data is supported. - */ - static supportsData(data: any): boolean; - /** - * @inheritDoc - */ - public _pProceedParsing(): boolean; - public _pStartParsing(frameLimit: number): void; - private calculateMaxJointCount(); - private countZeroWeightJoints(vertex, weights); - /** - * Parses the skeleton's joints. - */ - private parseJoints(); - /** - * Puts back the last read character into the data stream. - */ - private putBack(); - /** - * Parses the mesh geometry. - */ - private parseMesh(); - /** - * Converts the mesh data to a SkinnedSub instance. - * @param vertexData The mesh's vertices. - * @param weights The joint weights per vertex. - * @param indices The indices for the faces. - * @return A SubGeometry instance containing all geometrical data for the current mesh. - */ - private translateGeom(vertexData, weights, indices); - /** - * Retrieve the next triplet of vertex indices that form a face. - * @param indices The index list in which to store the read data. - */ - private parseTri(indices); - /** - * Reads a new joint data set for a single joint. - * @param weights the target list to contain the weight data. - */ - private parseJoint(weights); - /** - * Reads the data for a single vertex. - * @param vertexData The list to contain the vertex data. - */ - private parseVertex(vertexData); - /** - * Reads the next uv coordinate. - * @param vertexData The vertexData to contain the UV coordinates. - */ - private parseUV(vertexData); - /** - * Gets the next token in the data stream. - */ - private getNextToken(); - /** - * Skips all whitespace in the data stream. - */ - private skipWhiteSpace(); - /** - * Skips to the next line. - */ - private ignoreLine(); - /** - * Retrieves the next single character in the data stream. - */ - private getNextChar(); - /** - * Retrieves the next integer in the data stream. - */ - private getNextInt(); - /** - * Retrieves the next floating point number in the data stream. - */ - private getNextNumber(); - /** - * Retrieves the next 3d vector in the data stream. - */ - private parseVector3D(); - /** - * Retrieves the next quaternion in the data stream. - */ - private parseQuaternion(); - /** - * Parses the command line data. - */ - private parseCMD(); - /** - * Retrieves the next literal string in the data stream. A literal string is a sequence of characters bounded - * by double quotes. - */ - private parseLiteralstring(); - /** - * Throws an end-of-file error when a premature end of file was encountered. - */ - private sendEOFError(); - /** - * Throws an error when an unexpected token was encountered. - * @param expected The token type that was actually expected. - */ - private sendParseError(expected); - /** - * Throws an error when an unknown keyword was encountered. - */ - private sendUnknownKeywordError(); - } -} -declare class VertexData { - public index: number; - public s: number; - public t: number; - public startWeight: number; - public countWeight: number; -} -declare class JointData { - public index: number; - public joint: number; - public bias: number; - public pos: away.geom.Vector3D; -} -declare class MeshData { - public vertexData: VertexData[]; - public weightData: JointData[]; - public indices: number[]; -} -declare module away.parsers { - class Parsers { - /** - * A list of all parsers that come bundled with Away3D. Use this to quickly - * enable support for all bundled parsers to the file format auto-detection - * feature, using any of the enableParsers() methods on loaders, e.g.: - * - * AssetLibrary.enableParsers(Parsers.ALL_BUNDLED); - * - * Beware however that this requires all parser classes to be included in the - * SWF file, which will add 50-100 kb to the file. When only a limited set of - * file formats are used, SWF file size can be saved by adding the parsers - * individually using AssetLibrary.enableParser() - * - * A third way is to specify a parser for each loaded file, thereby bypassing - * the auto-detection mechanisms altogether, while at the same time allowing - * any properties that are unique to that parser to be set for that load. - * - * The bundled parsers are: - * - *
    - *
  • AC3D (.ac)
  • - *
  • Away Data version 1 ASCII and version 2 binary (.awd). AWD1 BSP unsupported
  • - *
  • 3DMax (.3ds)
  • - *
  • DXF (.dxf)
  • - *
  • Quake 2 MD2 models (.md2)
  • - *
  • Doom 3 MD5 animation clips (.md5anim)
  • - *
  • Doom 3 MD5 meshes (.md5mesh)
  • - *
  • Wavefront OBJ (.obj)
  • - *
  • Collada (.dae)
  • - *
  • Images (.jpg, .png)
  • - *
- * - * @see away.library.AssetLibrary.enableParser - */ - static ALL_BUNDLED: Object[]; - /** - * Short-hand function to enable all bundled parsers for auto-detection. In practice, - * this is the same as invoking enableParsers(Parsers.ALL_BUNDLED) on any of the - * loader classes SingleFileLoader, AssetLoader, AssetLibrary or Loader3D. - * - * See notes about file size in the documentation for the ALL_BUNDLED constant. - * - * @see away.parsers.Parsers.ALL_BUNDLED - */ - static enableAllBundled(): void; - } -} -declare module away.commands { - /** - * Class Merge merges two or more static meshes into one.Merge - */ - class Merge { - private _objectSpace; - private _keepMaterial; - private _disposeSources; - private _geomVOs; - private _toDispose; - /** - * @param keepMaterial [optional] Determines if the merged object uses the recevier mesh material information or keeps its source material(s). Defaults to false. - * If false and receiver object has multiple materials, the last material found in receiver submeshes is applied to the merged submesh(es). - * @param disposeSources [optional] Determines if the mesh and geometry source(s) used for the merging are disposed. Defaults to false. - * If true, only receiver geometry and resulting mesh are kept in memory. - * @param objectSpace [optional] Determines if source mesh(es) is/are merged using objectSpace or worldspace. Defaults to false. - */ - constructor(keepMaterial?: boolean, disposeSources?: boolean, objectSpace?: boolean); - /** - * Determines if the mesh and geometry source(s) used for the merging are disposed. Defaults to false. - */ - public disposeSources : boolean; - /** - * Determines if the material source(s) used for the merging are disposed. Defaults to false. - */ - public keepMaterial : boolean; - /** - * Determines if source mesh(es) is/are merged using objectSpace or worldspace. Defaults to false. - */ - public objectSpace : boolean; - /** - * Merges all the children of a container into a single Mesh. If no Mesh object is found, method returns the receiver without modification. - * - * @param receiver The Mesh to receive the merged contents of the container. - * @param objectContainer The DisplayObjectContainer holding the meshes to be mergd. - * - * @return The merged Mesh instance. - */ - public applyToContainer(receiver: entities.Mesh, objectContainer: containers.DisplayObjectContainer): void; - /** - * Merges all the meshes found in the Array<Mesh> into a single Mesh. - * - * @param receiver The Mesh to receive the merged contents of the meshes. - * @param meshes A series of Meshes to be merged with the reciever mesh. - */ - public applyToMeshes(receiver: entities.Mesh, meshes: entities.Mesh[]): void; - /** - * Merges 2 meshes into one. It is recommand to use apply when 2 meshes are to be merged. If more need to be merged, use either applyToMeshes or applyToContainer methods. - * - * @param receiver The Mesh to receive the merged contents of both meshes. - * @param mesh The Mesh to be merged with the receiver mesh - */ - public apply(receiver: entities.Mesh, mesh: entities.Mesh): void; - private reset(); - private merge(destMesh, dispose); - private collect(mesh, dispose); - private getSubGeomData(material); - private parseContainer(receiver, object); - } -} -declare class GeometryVO { - public uvs: number[]; - public vertices: number[]; - public normals: number[]; - public tangents: number[]; - public indices: number[]; - public material: away.materials.MaterialBase; -} -declare module away.tools { - /** - * ... - */ - class ParticleGeometryTransform { - private _defaultVertexTransform; - private _defaultInvVertexTransform; - private _defaultUVTransform; - public UVTransform : geom.Matrix; - public vertexTransform : geom.Matrix3D; - public invVertexTransform : geom.Matrix3D; - } -} -declare module away.tools { - /** - * ... - */ - class ParticleGeometryHelper { - static MAX_VERTEX: number; - static generateGeometry(geometries: base.Geometry[], transforms?: ParticleGeometryTransform[]): base.ParticleGeometry; - } -} -declare module away { - class StageGLRenderer extends events.EventDispatcher { - constructor(); - } -} diff --git a/build/stagegl-extensions.next.js b/build/stagegl-extensions.next.js deleted file mode 100644 index f58a3b583..000000000 --- a/build/stagegl-extensions.next.js +++ /dev/null @@ -1,19612 +0,0 @@ -/// -var __extends = this.__extends || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); -}; -var away; -(function (away) { - (function (events) { - /** - * Dispatched to notify changes in an animation state's state. - */ - var AnimationStateEvent = (function (_super) { - __extends(AnimationStateEvent, _super); - /** - * Create a new AnimatonStateEvent - * - * @param type The event type. - * @param animator The animation state object that is the subject of this event. - * @param animationNode The animation node inside the animation state from which the event originated. - */ - function AnimationStateEvent(type, animator, animationState, animationNode) { - _super.call(this, type); - - this._animator = animator; - this._animationState = animationState; - this._animationNode = animationNode; - } - Object.defineProperty(AnimationStateEvent.prototype, "animator", { - /** - * The animator object that is the subject of this event. - */ - get: function () { - return this._animator; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(AnimationStateEvent.prototype, "animationState", { - /** - * The animation state object that is the subject of this event. - */ - get: function () { - return this._animationState; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(AnimationStateEvent.prototype, "animationNode", { - /** - * The animation node inside the animation state from which the event originated. - */ - get: function () { - return this._animationNode; - }, - enumerable: true, - configurable: true - }); - - /** - * Clones the event. - * - * @return An exact duplicate of the current object. - */ - AnimationStateEvent.prototype.clone = function () { - return new AnimationStateEvent(this.type, this._animator, this._animationState, this._animationNode); - }; - AnimationStateEvent.PLAYBACK_COMPLETE = "playbackComplete"; - - AnimationStateEvent.TRANSITION_COMPLETE = "transitionComplete"; - return AnimationStateEvent; - })(events.Event); - events.AnimationStateEvent = AnimationStateEvent; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.base - */ - (function (base) { - /** - * @class away.base.ParticleGeometry - */ - var ParticleGeometry = (function (_super) { - __extends(ParticleGeometry, _super); - function ParticleGeometry() { - _super.apply(this, arguments); - } - return ParticleGeometry; - })(base.Geometry); - base.ParticleGeometry = ParticleGeometry; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.pick - */ - (function (pick) { - /** - * An abstract base class for all picking collider classes. It should not be instantiated directly. - * - * @class away.pick.PickingColliderBase - */ - var PickingColliderBase = (function () { - function PickingColliderBase() { - this._billboardRenderablePool = away.pool.RenderablePool.getPool(away.pool.BillboardRenderable); - this._subMeshRenderablePool = away.pool.RenderablePool.getPool(away.pool.TriangleSubMeshRenderable); - } - PickingColliderBase.prototype._pPetCollisionNormal = function (indexData /*uint*/ , vertexData, triangleIndex) { - var normal = new away.geom.Vector3D(); - var i0 = indexData[triangleIndex] * 3; - var i1 = indexData[triangleIndex + 1] * 3; - var i2 = indexData[triangleIndex + 2] * 3; - var p0 = new away.geom.Vector3D(vertexData[i0], vertexData[i0 + 1], vertexData[i0 + 2]); - var p1 = new away.geom.Vector3D(vertexData[i1], vertexData[i1 + 1], vertexData[i1 + 2]); - var p2 = new away.geom.Vector3D(vertexData[i2], vertexData[i2 + 1], vertexData[i2 + 2]); - var side0 = p1.subtract(p0); - var side1 = p2.subtract(p0); - normal = side0.crossProduct(side1); - normal.normalize(); - return normal; - }; - - PickingColliderBase.prototype._pGetCollisionUV = function (indexData /*uint*/ , uvData, triangleIndex, v, w, u, uvOffset, uvStride) { - var uv = new away.geom.Point(); - var uIndex = indexData[triangleIndex] * uvStride + uvOffset; - var uv0 = new away.geom.Vector3D(uvData[uIndex], uvData[uIndex + 1]); - uIndex = indexData[triangleIndex + 1] * uvStride + uvOffset; - var uv1 = new away.geom.Vector3D(uvData[uIndex], uvData[uIndex + 1]); - uIndex = indexData[triangleIndex + 2] * uvStride + uvOffset; - var uv2 = new away.geom.Vector3D(uvData[uIndex], uvData[uIndex + 1]); - uv.x = u * uv0.x + v * uv1.x + w * uv2.x; - uv.y = u * uv0.y + v * uv1.y + w * uv2.y; - return uv; - }; - - /** - * @inheritDoc - */ - PickingColliderBase.prototype._pTestRenderableCollision = function (renderable, pickingCollisionVO, shortestCollisionDistance) { - throw new away.errors.AbstractMethodError(); - }; - - /** - * @inheritDoc - */ - PickingColliderBase.prototype.setLocalRay = function (localPosition, localDirection) { - this.rayPosition = localPosition; - this.rayDirection = localDirection; - }; - - /** - * Tests a Billboard object for a collision with the picking ray. - * - * @param billboard The billboard instance to be tested. - * @param pickingCollisionVO The collision object used to store the collision results - * @param shortestCollisionDistance The current value of the shortest distance to a detected collision along the ray. - * @param findClosest - */ - PickingColliderBase.prototype.testBillboardCollision = function (billboard, pickingCollisionVO, shortestCollisionDistance) { - this.setLocalRay(pickingCollisionVO.localRayPosition, pickingCollisionVO.localRayDirection); - pickingCollisionVO.materialOwner = null; - - if (this._pTestRenderableCollision(this._billboardRenderablePool.getItem(billboard), pickingCollisionVO, shortestCollisionDistance)) { - shortestCollisionDistance = pickingCollisionVO.rayEntryDistance; - - pickingCollisionVO.materialOwner = billboard; - - return true; - } - - return false; - }; - - /** - * Tests a Mesh object for a collision with the picking ray. - * - * @param mesh The mesh instance to be tested. - * @param pickingCollisionVO The collision object used to store the collision results - * @param shortestCollisionDistance The current value of the shortest distance to a detected collision along the ray. - * @param findClosest - */ - PickingColliderBase.prototype.testMeshCollision = function (mesh, pickingCollisionVO, shortestCollisionDistance, findClosest) { - this.setLocalRay(pickingCollisionVO.localRayPosition, pickingCollisionVO.localRayDirection); - pickingCollisionVO.materialOwner = null; - - var subMesh; - - var len = mesh.subMeshes.length; - for (var i = 0; i < len; ++i) { - subMesh = mesh.subMeshes[i]; - - if (this._pTestRenderableCollision(this._subMeshRenderablePool.getItem(subMesh), pickingCollisionVO, shortestCollisionDistance)) { - shortestCollisionDistance = pickingCollisionVO.rayEntryDistance; - - pickingCollisionVO.materialOwner = subMesh; - - if (!findClosest) - return true; - } - } - - return pickingCollisionVO.materialOwner != null; - }; - return PickingColliderBase; - })(); - pick.PickingColliderBase = PickingColliderBase; - })(away.pick || (away.pick = {})); - var pick = away.pick; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.pick - */ - (function (pick) { - var SubGeometry = away.base.TriangleSubGeometry; - - /** - * Pure JS picking collider for display objects. Used with the RaycastPicker picking object. - * - * @see away.base.DisplayObject#pickingCollider - * @see away.pick.RaycastPicker - * - * @class away.pick.JSPickingCollider - */ - var JSPickingCollider = (function (_super) { - __extends(JSPickingCollider, _super); - /** - * Creates a new JSPickingCollider object. - * - * @param findClosestCollision Determines whether the picking collider searches for the closest collision along the ray. Defaults to false. - */ - function JSPickingCollider(findClosestCollision) { - if (typeof findClosestCollision === "undefined") { findClosestCollision = false; } - _super.call(this); - - this._findClosestCollision = findClosestCollision; - } - /** - * @inheritDoc - */ - JSPickingCollider.prototype._pTestRenderableCollision = function (renderable, pickingCollisionVO, shortestCollisionDistance) { - var t; - var i0, i1, i2; - var rx, ry, rz; - var nx, ny, nz; - var cx, cy, cz; - var coeff, u, v, w; - var p0x, p0y, p0z; - var p1x, p1y, p1z; - var p2x, p2y, p2z; - var s0x, s0y, s0z; - var s1x, s1y, s1z; - var nl, nDotV, D, disToPlane; - var Q1Q2, Q1Q1, Q2Q2, RQ1, RQ2; - var indexData = renderable.getIndexData().data; - var collisionTriangleIndex = -1; - var bothSides = renderable.materialOwner.material.bothSides; - - var positionData = renderable.getVertexData(SubGeometry.POSITION_DATA).data; - var positionStride = renderable.getVertexData(SubGeometry.POSITION_DATA).dataPerVertex; - var positionOffset = renderable.getVertexOffset(SubGeometry.POSITION_DATA); - var uvData = renderable.getVertexData(SubGeometry.UV_DATA).data; - var uvStride = renderable.getVertexData(SubGeometry.UV_DATA).dataPerVertex; - var uvOffset = renderable.getVertexOffset(SubGeometry.UV_DATA); - var numIndices = indexData.length; - - for (var index = 0; index < numIndices; index += 3) { - // evaluate triangle indices - i0 = positionOffset + indexData[index] * positionStride; - i1 = positionOffset + indexData[(index + 1)] * positionStride; - i2 = positionOffset + indexData[(index + 2)] * positionStride; - - // evaluate triangle positions - p0x = positionData[i0]; - p0y = positionData[(i0 + 1)]; - p0z = positionData[(i0 + 2)]; - p1x = positionData[i1]; - p1y = positionData[(i1 + 1)]; - p1z = positionData[(i1 + 2)]; - p2x = positionData[i2]; - p2y = positionData[(i2 + 1)]; - p2z = positionData[(i2 + 2)]; - - // evaluate sides and triangle normal - s0x = p1x - p0x; // s0 = p1 - p0 - s0y = p1y - p0y; - s0z = p1z - p0z; - s1x = p2x - p0x; // s1 = p2 - p0 - s1y = p2y - p0y; - s1z = p2z - p0z; - nx = s0y * s1z - s0z * s1y; // n = s0 x s1 - ny = s0z * s1x - s0x * s1z; - nz = s0x * s1y - s0y * s1x; - nl = 1 / Math.sqrt(nx * nx + ny * ny + nz * nz); // normalize n - nx *= nl; - ny *= nl; - nz *= nl; - - // -- plane intersection test -- - nDotV = nx * this.rayDirection.x + ny * +this.rayDirection.y + nz * this.rayDirection.z; // rayDirection . normal - if ((!bothSides && nDotV < 0.0) || (bothSides && nDotV != 0.0)) { - // find collision t - D = -(nx * p0x + ny * p0y + nz * p0z); - disToPlane = -(nx * this.rayPosition.x + ny * this.rayPosition.y + nz * this.rayPosition.z + D); - t = disToPlane / nDotV; - - // find collision point - cx = this.rayPosition.x + t * this.rayDirection.x; - cy = this.rayPosition.y + t * this.rayDirection.y; - cz = this.rayPosition.z + t * this.rayDirection.z; - - // collision point inside triangle? ( using barycentric coordinates ) - Q1Q2 = s0x * s1x + s0y * s1y + s0z * s1z; - Q1Q1 = s0x * s0x + s0y * s0y + s0z * s0z; - Q2Q2 = s1x * s1x + s1y * s1y + s1z * s1z; - rx = cx - p0x; - ry = cy - p0y; - rz = cz - p0z; - RQ1 = rx * s0x + ry * s0y + rz * s0z; - RQ2 = rx * s1x + ry * s1y + rz * s1z; - coeff = 1 / (Q1Q1 * Q2Q2 - Q1Q2 * Q1Q2); - v = coeff * (Q2Q2 * RQ1 - Q1Q2 * RQ2); - w = coeff * (-Q1Q2 * RQ1 + Q1Q1 * RQ2); - if (v < 0) - continue; - if (w < 0) - continue; - u = 1 - v - w; - if (!(u < 0) && t > 0 && t < shortestCollisionDistance) { - shortestCollisionDistance = t; - collisionTriangleIndex = index / 3; - pickingCollisionVO.rayEntryDistance = t; - pickingCollisionVO.localPosition = new away.geom.Vector3D(cx, cy, cz); - pickingCollisionVO.localNormal = new away.geom.Vector3D(nx, ny, nz); - pickingCollisionVO.uv = this._pGetCollisionUV(indexData, uvData, index, v, w, u, uvOffset, uvStride); - pickingCollisionVO.index = index; - - // pickingCollisionVO.subGeometryIndex = this.pGetMeshSubMeshIndex(renderable); - // if not looking for best hit, first found will do... - if (!this._findClosestCollision) - return true; - } - } - } - - if (collisionTriangleIndex >= 0) - return true; - - return false; - }; - return JSPickingCollider; - })(pick.PickingColliderBase); - pick.JSPickingCollider = JSPickingCollider; - })(away.pick || (away.pick = {})); - var pick = away.pick; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.pick - */ - (function (pick) { - var BitmapData = away.base.BitmapData; - - var TriangleSubGeometry = away.base.TriangleSubGeometry; - - var Matrix3DUtils = away.geom.Matrix3DUtils; - var Point = away.geom.Point; - var Rectangle = away.geom.Rectangle; - var Vector3D = away.geom.Vector3D; - - var ContextGLBlendFactor = away.stagegl.ContextGLBlendFactor; - var ContextGLClearMask = away.stagegl.ContextGLClearMask; - var ContextGLCompareMode = away.stagegl.ContextGLCompareMode; - var ContextGLProgramType = away.stagegl.ContextGLProgramType; - var ContextGLTriangleFace = away.stagegl.ContextGLTriangleFace; - - /** - * Picks a 3d object from a view or scene by performing a separate render pass on the scene around the area being picked using key color values, - * then reading back the color value of the pixel in the render representing the picking ray. Requires multiple passes and readbacks for retriving details - * on an entity that has its shaderPickingDetails property set to true. - * - * A read-back operation from any GPU is not a very efficient process, and the amount of processing used can vary significantly between different hardware. - * - * @see away.entities.Entity#shaderPickingDetails - * - * @class away.pick.ShaderPicker - */ - var ShaderPicker = (function () { - /** - * Creates a new ShaderPicker object. - * - * @param shaderPickingDetails Determines whether the picker includes a second pass to calculate extra - * properties such as uv and normal coordinates. - */ - function ShaderPicker(shaderPickingDetails) { - if (typeof shaderPickingDetails === "undefined") { shaderPickingDetails = false; } - this._onlyMouseEnabled = true; - this._interactives = new Array(); - this._localHitPosition = new Vector3D(); - this._hitUV = new Point(); - this._localHitNormal = new Vector3D(); - this._rayPos = new Vector3D(); - this._rayDir = new Vector3D(); - this._shaderPickingDetails = shaderPickingDetails; - - this._id = new Array(4); - this._viewportData = new Array(4); // first 2 contain scale, last 2 translation - this._boundOffsetScale = new Array(8); // first 2 contain scale, last 2 translation - this._boundOffsetScale[3] = 0; - this._boundOffsetScale[7] = 1; - } - Object.defineProperty(ShaderPicker.prototype, "onlyMouseEnabled", { - /** - * @inheritDoc - */ - get: function () { - return this._onlyMouseEnabled; - }, - set: function (value) { - this._onlyMouseEnabled = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - ShaderPicker.prototype.getViewCollision = function (x, y, view) { - var collector = view.iEntityCollector; - - this._stage = view.renderer.stage; - - if (!this._stage) - return null; - - this._context = this._stage.context; - - this._viewportData[0] = view.width; - this._viewportData[1] = view.height; - this._viewportData[2] = -(this._projX = 2 * x / view.width - 1); - this._viewportData[3] = this._projY = 2 * y / view.height - 1; - - // _potentialFound will be set to true if any object is actually rendered - this._potentialFound = false; - - //reset head values - this._blendedRenderableHead = null; - this._opaqueRenderableHead = null; - - this.pDraw(collector, null); - - // clear buffers - this._context.setVertexBufferAt(0, null); - - if (!this._context || !this._potentialFound) - return null; - - if (!this._bitmapData) - this._bitmapData = new BitmapData(1, 1, false, 0); - - this._context.drawToBitmapData(this._bitmapData); - this._hitColor = this._bitmapData.getPixel(0, 0); - - if (!this._hitColor) { - this._context.present(); - return null; - } - - this._hitRenderable = this._interactives[this._hitColor - 1]; - this._hitEntity = this._hitRenderable.sourceEntity; - - if (this._onlyMouseEnabled && !this._hitEntity._iIsMouseEnabled()) - return null; - - var _collisionVO = this._hitEntity._iPickingCollisionVO; - if (this._shaderPickingDetails) { - this.getHitDetails(view.camera); - _collisionVO.localPosition = this._localHitPosition; - _collisionVO.localNormal = this._localHitNormal; - _collisionVO.uv = this._hitUV; - _collisionVO.index = this._faceIndex; - //_collisionVO.subGeometryIndex = this._subGeometryIndex; - } else { - _collisionVO.localPosition = null; - _collisionVO.localNormal = null; - _collisionVO.uv = null; - _collisionVO.index = 0; - //_collisionVO.subGeometryIndex = 0; - } - - return _collisionVO; - }; - - //*/ - /** - * @inheritDoc - */ - ShaderPicker.prototype.getSceneCollision = function (position, direction, scene) { - return null; - }; - - /** - * @inheritDoc - */ - ShaderPicker.prototype.pDraw = function (entityCollector, target) { - var camera = entityCollector.camera; - - this._context.clear(0, 0, 0, 1); - this._stage.scissorRect = ShaderPicker.MOUSE_SCISSOR_RECT; - - this._interactives.length = this._interactiveId = 0; - - if (!this._objectProgram) - this.initObjectProgram(); - - this._context.setBlendFactors(ContextGLBlendFactor.ONE, ContextGLBlendFactor.ZERO); - this._context.setDepthTest(true, ContextGLCompareMode.LESS); - this._context.setProgram(this._objectProgram); - this._context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX, 4, this._viewportData, 1); - //this.drawRenderables(entityCollector.opaqueRenderableHead, camera); - //this.drawRenderables(entityCollector.blendedRenderableHead, camera); - //TODO: reimplement ShaderPicker inheriting from RendererBase - }; - - /** - * Draw a list of renderables. - * @param renderables The renderables to draw. - * @param camera The camera for which to render. - */ - ShaderPicker.prototype.drawRenderables = function (renderable, camera) { - var matrix = Matrix3DUtils.CALCULATION_MATRIX; - var viewProjection = camera.viewProjection; - - while (renderable) { - // it's possible that the renderable was already removed from the scene - if (!renderable.sourceEntity.scene || !renderable.sourceEntity._iIsMouseEnabled()) { - renderable = renderable.next; - continue; - } - - this._potentialFound = true; - - this._context.setCulling(renderable.materialOwner.material.bothSides ? ContextGLTriangleFace.NONE : ContextGLTriangleFace.BACK, camera.projection.coordinateSystem); - - this._interactives[this._interactiveId++] = renderable; - - // color code so that reading from bitmapdata will contain the correct value - this._id[1] = (this._interactiveId >> 8) / 255; // on green channel - this._id[2] = (this._interactiveId & 0xff) / 255; // on blue channel - - matrix.copyFrom(renderable.sourceEntity.getRenderSceneTransform(camera)); - matrix.append(viewProjection); - this._context.setProgramConstantsFromMatrix(ContextGLProgramType.VERTEX, 0, matrix, true); - this._context.setProgramConstantsFromArray(ContextGLProgramType.FRAGMENT, 0, this._id, 1); - this._context.activateBuffer(0, renderable.getVertexData(TriangleSubGeometry.POSITION_DATA), renderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA), TriangleSubGeometry.POSITION_FORMAT); - this._context.drawTriangles(this._context.getIndexBuffer(renderable.getIndexData()), 0, renderable.numTriangles); - - renderable = renderable.next; - } - }; - - ShaderPicker.prototype.updateRay = function (camera) { - this._rayPos = camera.scenePosition; - - this._rayDir = camera.getRay(this._projX, this._projY, 1); - this._rayDir.normalize(); - }; - - /** - * Creates the Program that color-codes objects. - */ - ShaderPicker.prototype.initObjectProgram = function () { - var vertexCode; - var fragmentCode; - - this._objectProgram = this._context.createProgram(); - - vertexCode = "m44 vt0, va0, vc0 \n" + "mul vt1.xy, vt0.w, vc4.zw \n" + "add vt0.xy, vt0.xy, vt1.xy \n" + "mul vt0.xy, vt0.xy, vc4.xy \n" + "mov op, vt0 \n"; - fragmentCode = "mov oc, fc0"; // write identifier - - away.Debug.throwPIR('ShaderPicker', 'initTriangleProgram', 'Dependency: initObjectProgram'); - //_objectProgram.upload(new AGALMiniAssembler().assemble(ContextGLProgramType.VERTEX, vertexCode),new AGALMiniAssembler().assemble(ContextGLProgramType.FRAGMENT, fragmentCode)); - }; - - /** - * Creates the Program that renders positions. - */ - ShaderPicker.prototype.initTriangleProgram = function () { - var vertexCode; - var fragmentCode; - - this._triangleProgram = this._context.createProgram(); - - // todo: add animation code - vertexCode = "add vt0, va0, vc5 \n" + "mul vt0, vt0, vc6 \n" + "mov v0, vt0 \n" + "m44 vt0, va0, vc0 \n" + "mul vt1.xy, vt0.w, vc4.zw \n" + "add vt0.xy, vt0.xy, vt1.xy \n" + "mul vt0.xy, vt0.xy, vc4.xy \n" + "mov op, vt0 \n"; - fragmentCode = "mov oc, v0"; // write identifier - - var vertexByteCode = (new aglsl.assembler.AGALMiniAssembler().assemble("part vertex 1\n" + vertexCode + "endpart"))['vertex'].data; - var fragmentByteCode = (new aglsl.assembler.AGALMiniAssembler().assemble("part fragment 1\n" + fragmentCode + "endpart"))['fragment'].data; - this._triangleProgram.upload(vertexByteCode, fragmentByteCode); - }; - - /** - * Gets more detailed information about the hir position, if required. - * @param camera The camera used to view the hit object. - */ - ShaderPicker.prototype.getHitDetails = function (camera) { - this.getApproximatePosition(camera); - this.getPreciseDetails(camera); - }; - - /** - * Finds a first-guess approximate position about the hit position. - * - * @param camera The camera used to view the hit object. - */ - ShaderPicker.prototype.getApproximatePosition = function (camera) { - var bounds = this._hitRenderable.sourceEntity.bounds.aabb; - var col; - var scX, scY, scZ; - var offsX, offsY, offsZ; - var localViewProjection = Matrix3DUtils.CALCULATION_MATRIX; - - localViewProjection.copyFrom(this._hitRenderable.sourceEntity.getRenderSceneTransform(camera)); - localViewProjection.append(camera.viewProjection); - if (!this._triangleProgram) { - this.initTriangleProgram(); - } - - this._boundOffsetScale[4] = 1 / (scX = bounds.width); - this._boundOffsetScale[5] = 1 / (scY = bounds.height); - this._boundOffsetScale[6] = 1 / (scZ = bounds.depth); - this._boundOffsetScale[0] = offsX = -bounds.x; - this._boundOffsetScale[1] = offsY = -bounds.y; - this._boundOffsetScale[2] = offsZ = -bounds.z; - - this._context.setProgram(this._triangleProgram); - this._context.clear(0, 0, 0, 0, 1, 0, ContextGLClearMask.DEPTH); - this._context.setScissorRectangle(ShaderPicker.MOUSE_SCISSOR_RECT); - this._context.setProgramConstantsFromMatrix(ContextGLProgramType.VERTEX, 0, localViewProjection, true); - this._context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX, 5, this._boundOffsetScale, 2); - - this._context.activateBuffer(0, this._hitRenderable.getVertexData(TriangleSubGeometry.POSITION_DATA), this._hitRenderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA), TriangleSubGeometry.POSITION_FORMAT); - this._context.drawTriangles(this._context.getIndexBuffer(this._hitRenderable.getIndexData()), 0, this._hitRenderable.numTriangles); - - this._context.drawToBitmapData(this._bitmapData); - - col = this._bitmapData.getPixel(0, 0); - - this._localHitPosition.x = ((col >> 16) & 0xff) * scX / 255 - offsX; - this._localHitPosition.y = ((col >> 8) & 0xff) * scY / 255 - offsY; - this._localHitPosition.z = (col & 0xff) * scZ / 255 - offsZ; - }; - - /** - * Use the approximate position info to find the face under the mouse position from which we can derive the precise - * ray-face intersection point, then use barycentric coordinates to figure out the uv coordinates, etc. - * @param camera The camera used to view the hit object. - */ - ShaderPicker.prototype.getPreciseDetails = function (camera) { - var len = indices.length; - var x1, y1, z1; - var x2, y2, z2; - var x3, y3, z3; - var i = 0, j = 1, k = 2; - var t1, t2, t3; - var v0x, v0y, v0z; - var v1x, v1y, v1z; - var v2x, v2y, v2z; - var ni1, ni2, ni3; - var n1, n2, n3, nLength; - var dot00, dot01, dot02, dot11, dot12; - var s, t, invDenom; - var x = this._localHitPosition.x, y = this._localHitPosition.y, z = this._localHitPosition.z; - var u, v; - var ui1, ui2, ui3; - var s0x, s0y, s0z; - var s1x, s1y, s1z; - var nl; - var indices = this._hitRenderable.getIndexData().data; - - var positions = this._hitRenderable.getVertexData(TriangleSubGeometry.POSITION_DATA).data; - var positionStride = this._hitRenderable.getVertexData(TriangleSubGeometry.POSITION_DATA).dataPerVertex; - var positionOffset = this._hitRenderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA); - - var uvs = this._hitRenderable.getVertexData(TriangleSubGeometry.UV_DATA).data; - var uvStride = this._hitRenderable.getVertexData(TriangleSubGeometry.UV_DATA).dataPerVertex; - var uvOffset = this._hitRenderable.getVertexOffset(TriangleSubGeometry.UV_DATA); - - var normals = this._hitRenderable.getVertexData(TriangleSubGeometry.NORMAL_DATA).data; - var normalStride = this._hitRenderable.getVertexData(TriangleSubGeometry.NORMAL_DATA).dataPerVertex; - var normalOffset = this._hitRenderable.getVertexOffset(TriangleSubGeometry.NORMAL_DATA); - - this.updateRay(camera); - - while (i < len) { - t1 = positionOffset + indices[i] * positionStride; - t2 = positionOffset + indices[j] * positionStride; - t3 = positionOffset + indices[k] * positionStride; - x1 = positions[t1]; - y1 = positions[t1 + 1]; - z1 = positions[t1 + 2]; - x2 = positions[t2]; - y2 = positions[t2 + 1]; - z2 = positions[t2 + 2]; - x3 = positions[t3]; - y3 = positions[t3 + 1]; - z3 = positions[t3 + 2]; - - // if within bounds - if (!((x < x1 && x < x2 && x < x3) || (y < y1 && y < y2 && y < y3) || (z < z1 && z < z2 && z < z3) || (x > x1 && x > x2 && x > x3) || (y > y1 && y > y2 && y > y3) || (z > z1 && z > z2 && z > z3))) { - // calculate barycentric coords for approximated position - v0x = x3 - x1; - v0y = y3 - y1; - v0z = z3 - z1; - v1x = x2 - x1; - v1y = y2 - y1; - v1z = z2 - z1; - v2x = x - x1; - v2y = y - y1; - v2z = z - z1; - dot00 = v0x * v0x + v0y * v0y + v0z * v0z; - dot01 = v0x * v1x + v0y * v1y + v0z * v1z; - dot02 = v0x * v2x + v0y * v2y + v0z * v2z; - dot11 = v1x * v1x + v1y * v1y + v1z * v1z; - dot12 = v1x * v2x + v1y * v2y + v1z * v2z; - invDenom = 1 / (dot00 * dot11 - dot01 * dot01); - s = (dot11 * dot02 - dot01 * dot12) * invDenom; - t = (dot00 * dot12 - dot01 * dot02) * invDenom; - - // if inside the current triangle, fetch details hit information - if (s >= 0 && t >= 0 && (s + t) <= 1) { - ni1 = normalOffset + indices[i] * normalStride; - ni2 = normalOffset + indices[j] * normalStride; - ni3 = normalOffset + indices[k] * normalStride; - - n1 = indices[ni1] + indices[ni2] + indices[ni3]; - n2 = indices[ni1 + 1] + indices[ni2 + 1] + indices[ni3 + 1]; - n3 = indices[ni1 + 2] + indices[ni2 + 2] + indices[ni3 + 2]; - - nLength = Math.sqrt(n1 * n1 + n2 * n2 + n3 * n3); - - n1 /= nLength; - n2 /= nLength; - n3 /= nLength; - - // this is def the triangle, now calculate precise coords - this.getPrecisePosition(this._hitRenderable.sourceEntity.inverseSceneTransform, n1, n2, n3, x1, y1, z1); - - v2x = this._localHitPosition.x - x1; - v2y = this._localHitPosition.y - y1; - v2z = this._localHitPosition.z - z1; - - s0x = x2 - x1; // s0 = p1 - p0 - s0y = y2 - y1; - s0z = z2 - z1; - s1x = x3 - x1; // s1 = p2 - p0 - s1y = y3 - y1; - s1z = z3 - z1; - this._localHitNormal.x = s0y * s1z - s0z * s1y; // n = s0 x s1 - this._localHitNormal.y = s0z * s1x - s0x * s1z; - this._localHitNormal.z = s0x * s1y - s0y * s1x; - nl = 1 / Math.sqrt(this._localHitNormal.x * this._localHitNormal.x + this._localHitNormal.y * this._localHitNormal.y + this._localHitNormal.z * this._localHitNormal.z); // normalize n - this._localHitNormal.x *= nl; - this._localHitNormal.y *= nl; - this._localHitNormal.z *= nl; - - dot02 = v0x * v2x + v0y * v2y + v0z * v2z; - dot12 = v1x * v2x + v1y * v2y + v1z * v2z; - s = (dot11 * dot02 - dot01 * dot12) * invDenom; - t = (dot00 * dot12 - dot01 * dot02) * invDenom; - - ui1 = uvOffset + indices[i] * uvStride; - ui2 = uvOffset + indices[j] * uvStride; - ui3 = uvOffset + indices[k] * uvStride; - - u = uvs[ui1]; - v = uvs[ui1 + 1]; - this._hitUV.x = u + t * (uvs[ui2] - u) + s * (uvs[ui3] - u); - this._hitUV.y = v + t * (uvs[ui2 + 1] - v) + s * (uvs[ui3 + 1] - v); - - this._faceIndex = i; - - //TODO add back subGeometryIndex value - //this._subGeometryIndex = away.utils.GeometryUtils.getMeshSubGeometryIndex(subGeom); - return; - } - } - - i += 3; - j += 3; - k += 3; - } - }; - - /** - * Finds the precise hit position by unprojecting the screen coordinate back unto the hit face's plane and - * calculating the intersection point. - * @param camera The camera used to render the object. - * @param invSceneTransform The inverse scene transformation of the hit object. - * @param nx The x-coordinate of the face's plane normal. - * @param ny The y-coordinate of the face plane normal. - * @param nz The z-coordinate of the face plane normal. - * @param px The x-coordinate of a point on the face's plane (ie a face vertex) - * @param py The y-coordinate of a point on the face's plane (ie a face vertex) - * @param pz The z-coordinate of a point on the face's plane (ie a face vertex) - */ - ShaderPicker.prototype.getPrecisePosition = function (invSceneTransform, nx, ny, nz, px, py, pz) { - // calculate screen ray and find exact intersection position with triangle - var rx, ry, rz; - var ox, oy, oz; - var t; - var raw = Matrix3DUtils.RAW_DATA_CONTAINER; - var cx = this._rayPos.x, cy = this._rayPos.y, cz = this._rayPos.z; - - // unprojected projection point, gives ray dir in cam space - ox = this._rayDir.x; - oy = this._rayDir.y; - oz = this._rayDir.z; - - // transform ray dir and origin (cam pos) to object space - //invSceneTransform.copyRawDataTo( raw ); - invSceneTransform.copyRawDataTo(raw); - rx = raw[0] * ox + raw[4] * oy + raw[8] * oz; - ry = raw[1] * ox + raw[5] * oy + raw[9] * oz; - rz = raw[2] * ox + raw[6] * oy + raw[10] * oz; - - ox = raw[0] * cx + raw[4] * cy + raw[8] * cz + raw[12]; - oy = raw[1] * cx + raw[5] * cy + raw[9] * cz + raw[13]; - oz = raw[2] * cx + raw[6] * cy + raw[10] * cz + raw[14]; - - t = ((px - ox) * nx + (py - oy) * ny + (pz - oz) * nz) / (rx * nx + ry * ny + rz * nz); - - this._localHitPosition.x = ox + rx * t; - this._localHitPosition.y = oy + ry * t; - this._localHitPosition.z = oz + rz * t; - }; - - ShaderPicker.prototype.dispose = function () { - this._bitmapData.dispose(); - if (this._triangleProgram) - this._triangleProgram.dispose(); - - if (this._objectProgram) - this._objectProgram.dispose(); - - this._triangleProgram = null; - this._objectProgram = null; - this._bitmapData = null; - this._hitRenderable = null; - this._hitEntity = null; - }; - ShaderPicker.MOUSE_SCISSOR_RECT = new Rectangle(0, 0, 1, 1); - return ShaderPicker; - })(); - pick.ShaderPicker = ShaderPicker; - })(away.pick || (away.pick = {})); - var pick = away.pick; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * AmbientEnvMapMethod provides a diffuse shading method that uses a diffuse irradiance environment map to - * approximate global lighting rather than lights. - */ - var AmbientEnvMapMethod = (function (_super) { - __extends(AmbientEnvMapMethod, _super); - /** - * Creates a new AmbientEnvMapMethod object. - * - * @param envMap The cube environment map to use for the ambient lighting. - */ - function AmbientEnvMapMethod(envMap) { - _super.call(this); - this._cubeTexture = envMap; - } - /** - * @inheritDoc - */ - AmbientEnvMapMethod.prototype.iInitVO = function (shaderObject, methodVO) { - _super.prototype.iInitVO.call(this, shaderObject, methodVO); - - methodVO.needsNormals = true; - }; - - Object.defineProperty(AmbientEnvMapMethod.prototype, "envMap", { - /** - * The cube environment map to use for the diffuse lighting. - */ - get: function () { - return this._cubeTexture; - }, - set: function (value) { - this._cubeTexture = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - AmbientEnvMapMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); - - stage.context.activateCubeTexture(methodVO.texturesIndex, this._cubeTexture); - }; - - /** - * @inheritDoc - */ - AmbientEnvMapMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, regCache, sharedRegisters) { - var code = ""; - var ambientInputRegister; - var cubeMapReg = regCache.getFreeTextureReg(); - methodVO.texturesIndex = cubeMapReg.index; - - code += materials.ShaderCompilerHelper.getTexCubeSampleCode(targetReg, cubeMapReg, this._cubeTexture, shaderObject.useSmoothTextures, shaderObject.useMipmapping, sharedRegisters.normalFragment); - - ambientInputRegister = regCache.getFreeFragmentConstant(); - methodVO.fragmentConstantsIndex = ambientInputRegister.index; - - code += "add " + targetReg + ".xyz, " + targetReg + ".xyz, " + ambientInputRegister + ".xyz\n"; - - return code; - }; - return AmbientEnvMapMethod; - })(materials.AmbientBasicMethod); - materials.AmbientEnvMapMethod = AmbientEnvMapMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (materials) { - var ShadingMethodEvent = away.events.ShadingMethodEvent; - - /** - * DiffuseCompositeMethod provides a base class for diffuse methods that wrap a diffuse method to alter the - * calculated diffuse reflection strength. - */ - var DiffuseCompositeMethod = (function (_super) { - __extends(DiffuseCompositeMethod, _super); - /** - * Creates a new DiffuseCompositeMethod object. - * - * @param modulateMethod The method which will add the code to alter the base method's strength. It needs to have the signature clampDiffuse(t:ShaderRegisterElement, regCache:ShaderRegisterCache):string, in which t.w will contain the diffuse strength. - * @param baseMethod The base diffuse method on which this method's shading is based. - */ - function DiffuseCompositeMethod(modulateMethod, baseMethod) { - if (typeof baseMethod === "undefined") { baseMethod = null; } - var _this = this; - _super.call(this); - - this._onShaderInvalidatedDelegate = function (event) { - return _this.onShaderInvalidated(event); - }; - - this.pBaseMethod = baseMethod || new materials.DiffuseBasicMethod(); - this.pBaseMethod._iModulateMethod = modulateMethod; - this.pBaseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - } - Object.defineProperty(DiffuseCompositeMethod.prototype, "baseMethod", { - /** - * The base diffuse method on which this method's shading is based. - */ - get: function () { - return this.pBaseMethod; - }, - set: function (value) { - if (this.pBaseMethod == value) - return; - - this.pBaseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - this.pBaseMethod = value; - this.pBaseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - this.iInvalidateShaderProgram(); - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - DiffuseCompositeMethod.prototype.iInitVO = function (shaderObject, methodVO) { - this.pBaseMethod.iInitVO(shaderObject, methodVO); - }; - - /** - * @inheritDoc - */ - DiffuseCompositeMethod.prototype.iInitConstants = function (shaderObject, methodVO) { - this.pBaseMethod.iInitConstants(shaderObject, methodVO); - }; - - /** - * @inheritDoc - */ - DiffuseCompositeMethod.prototype.dispose = function () { - this.pBaseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - this.pBaseMethod.dispose(); - }; - - Object.defineProperty(DiffuseCompositeMethod.prototype, "texture", { - /** - * @inheritDoc - */ - get: function () { - return this.pBaseMethod.texture; - }, - /** - * @inheritDoc - */ - set: function (value) { - this.pBaseMethod.texture = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DiffuseCompositeMethod.prototype, "diffuseColor", { - /** - * @inheritDoc - */ - get: function () { - return this.pBaseMethod.diffuseColor; - }, - /** - * @inheritDoc - */ - set: function (value) { - this.pBaseMethod.diffuseColor = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DiffuseCompositeMethod.prototype, "ambientColor", { - /** - * @inheritDoc - */ - get: function () { - return this.pBaseMethod.ambientColor; - }, - /** - * @inheritDoc - */ - set: function (value) { - this.pBaseMethod.ambientColor = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - DiffuseCompositeMethod.prototype.iGetFragmentPreLightingCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { - return this.pBaseMethod.iGetFragmentPreLightingCode(shaderObject, methodVO, registerCache, sharedRegisters); - }; - - /** - * @inheritDoc - */ - DiffuseCompositeMethod.prototype.iGetFragmentCodePerLight = function (shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters) { - var code = this.pBaseMethod.iGetFragmentCodePerLight(shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters); - this._pTotalLightColorReg = this.pBaseMethod._pTotalLightColorReg; - return code; - }; - - /** - * @inheritDoc - */ - DiffuseCompositeMethod.prototype.iGetFragmentCodePerProbe = function (shaderObject, methodVO, cubeMapReg, weightRegister, registerCache, sharedRegisters) { - var code = this.pBaseMethod.iGetFragmentCodePerProbe(shaderObject, methodVO, cubeMapReg, weightRegister, registerCache, sharedRegisters); - this._pTotalLightColorReg = this.pBaseMethod._pTotalLightColorReg; - return code; - }; - - /** - * @inheritDoc - */ - DiffuseCompositeMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - this.pBaseMethod.iActivate(shaderObject, methodVO, stage); - }; - - /** - * @inheritDoc - */ - DiffuseCompositeMethod.prototype.iSetRenderState = function (shaderObject, methodVO, renderable, stage, camera) { - this.pBaseMethod.iSetRenderState(shaderObject, methodVO, renderable, stage, camera); - }; - - /** - * @inheritDoc - */ - DiffuseCompositeMethod.prototype.iDeactivate = function (shaderObject, methodVO, stage) { - this.pBaseMethod.iDeactivate(shaderObject, methodVO, stage); - }; - - /** - * @inheritDoc - */ - DiffuseCompositeMethod.prototype.iGetVertexCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { - return this.pBaseMethod.iGetVertexCode(shaderObject, methodVO, registerCache, sharedRegisters); - }; - - /** - * @inheritDoc - */ - DiffuseCompositeMethod.prototype.iGetFragmentPostLightingCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - return this.pBaseMethod.iGetFragmentPostLightingCode(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); - }; - - /** - * @inheritDoc - */ - DiffuseCompositeMethod.prototype.iReset = function () { - this.pBaseMethod.iReset(); - }; - - /** - * @inheritDoc - */ - DiffuseCompositeMethod.prototype.iCleanCompilationData = function () { - _super.prototype.iCleanCompilationData.call(this); - this.pBaseMethod.iCleanCompilationData(); - }; - - /** - * Called when the base method's shader code is invalidated. - */ - DiffuseCompositeMethod.prototype.onShaderInvalidated = function (event) { - this.iInvalidateShaderProgram(); - }; - return DiffuseCompositeMethod; - })(materials.DiffuseBasicMethod); - materials.DiffuseCompositeMethod = DiffuseCompositeMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * DiffuseCelMethod provides a shading method to add diffuse cel (cartoon) shading. - */ - var DiffuseCelMethod = (function (_super) { - __extends(DiffuseCelMethod, _super); - /** - * Creates a new DiffuseCelMethod object. - * @param levels The amount of shadow gradations. - * @param baseMethod An optional diffuse method on which the cartoon shading is based. If omitted, DiffuseBasicMethod is used. - */ - function DiffuseCelMethod(levels, baseMethod) { - if (typeof levels === "undefined") { levels = 3; } - if (typeof baseMethod === "undefined") { baseMethod = null; } - var _this = this; - _super.call(this, null, baseMethod); - this._smoothness = .1; - - this.baseMethod._iModulateMethod = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - return _this.clampDiffuse(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); - }; - - this._levels = levels; - } - /** - * @inheritDoc - */ - DiffuseCelMethod.prototype.iInitConstants = function (shaderObject, methodVO) { - var data = shaderObject.fragmentConstantData; - var index = methodVO.secondaryFragmentConstantsIndex; - _super.prototype.iInitConstants.call(this, shaderObject, methodVO); - data[index + 1] = 1; - data[index + 2] = 0; - }; - - Object.defineProperty(DiffuseCelMethod.prototype, "levels", { - /** - * The amount of shadow gradations. - */ - get: function () { - return this._levels; - }, - set: function (value /*uint*/ ) { - this._levels = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DiffuseCelMethod.prototype, "smoothness", { - /** - * The smoothness of the edge between 2 shading levels. - */ - get: function () { - return this._smoothness; - }, - set: function (value) { - this._smoothness = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - DiffuseCelMethod.prototype.iCleanCompilationData = function () { - _super.prototype.iCleanCompilationData.call(this); - this._dataReg = null; - }; - - /** - * @inheritDoc - */ - DiffuseCelMethod.prototype.iGetFragmentPreLightingCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { - this._dataReg = registerCache.getFreeFragmentConstant(); - methodVO.secondaryFragmentConstantsIndex = this._dataReg.index * 4; - - return _super.prototype.iGetFragmentPreLightingCode.call(this, shaderObject, methodVO, registerCache, sharedRegisters); - }; - - /** - * @inheritDoc - */ - DiffuseCelMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); - var data = shaderObject.fragmentConstantData; - var index = methodVO.secondaryFragmentConstantsIndex; - data[index] = this._levels; - data[index + 3] = this._smoothness; - }; - - /** - * Snaps the diffuse shading of the wrapped method to one of the levels. - * @param vo The MethodVO used to compile the current shader. - * @param t The register containing the diffuse strength in the "w" component. - * @param regCache The register cache used for the shader compilation. - * @param sharedRegisters The shared register data for this shader. - * @return The AGAL fragment code for the method. - */ - DiffuseCelMethod.prototype.clampDiffuse = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - return "mul " + targetReg + ".w, " + targetReg + ".w, " + this._dataReg + ".x\n" + "frc " + targetReg + ".z, " + targetReg + ".w\n" + "sub " + targetReg + ".y, " + targetReg + ".w, " + targetReg + ".z\n" + "mov " + targetReg + ".x, " + this._dataReg + ".x\n" + "sub " + targetReg + ".x, " + targetReg + ".x, " + this._dataReg + ".y\n" + "rcp " + targetReg + ".x," + targetReg + ".x\n" + "mul " + targetReg + ".w, " + targetReg + ".y, " + targetReg + ".x\n" + "sub " + targetReg + ".y, " + targetReg + ".w, " + targetReg + ".x\n" + "div " + targetReg + ".z, " + targetReg + ".z, " + this._dataReg + ".w\n" + "sat " + targetReg + ".z, " + targetReg + ".z\n" + "mul " + targetReg + ".w, " + targetReg + ".w, " + targetReg + ".z\n" + "sub " + targetReg + ".z, " + this._dataReg + ".y, " + targetReg + ".z\n" + "mul " + targetReg + ".y, " + targetReg + ".y, " + targetReg + ".z\n" + "add " + targetReg + ".w, " + targetReg + ".w, " + targetReg + ".y\n" + "sat " + targetReg + ".w, " + targetReg + ".w\n"; - }; - return DiffuseCelMethod; - })(materials.DiffuseCompositeMethod); - materials.DiffuseCelMethod = DiffuseCelMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * DiffuseDepthMethod provides a debug method to visualise depth maps - */ - var DiffuseDepthMethod = (function (_super) { - __extends(DiffuseDepthMethod, _super); - /** - * Creates a new DiffuseBasicMethod object. - */ - function DiffuseDepthMethod() { - _super.call(this); - } - /** - * @inheritDoc - */ - DiffuseDepthMethod.prototype.iInitConstants = function (shaderObject, methodVO) { - var data = shaderObject.fragmentConstantData; - var index = methodVO.fragmentConstantsIndex; - data[index] = 1.0; - data[index + 1] = 1 / 255.0; - data[index + 2] = 1 / 65025.0; - data[index + 3] = 1 / 16581375.0; - }; - - /** - * @inheritDoc - */ - DiffuseDepthMethod.prototype.iGetFragmentPostLightingCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - var code = ""; - var temp; - var decReg; - - if (!this._pUseTexture) - throw new Error("DiffuseDepthMethod requires texture!"); - - // incorporate input from ambient - if (shaderObject.numLights > 0) { - if (sharedRegisters.shadowTarget) - code += "mul " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ".xyz, " + sharedRegisters.shadowTarget + ".w\n"; - code += "add " + targetReg + ".xyz, " + this._pTotalLightColorReg + ".xyz, " + targetReg + ".xyz\n" + "sat " + targetReg + ".xyz, " + targetReg + ".xyz\n"; - registerCache.removeFragmentTempUsage(this._pTotalLightColorReg); - } - - temp = shaderObject.numLights > 0 ? registerCache.getFreeFragmentVectorTemp() : targetReg; - - this._pDiffuseInputRegister = registerCache.getFreeTextureReg(); - methodVO.texturesIndex = this._pDiffuseInputRegister.index; - decReg = registerCache.getFreeFragmentConstant(); - methodVO.fragmentConstantsIndex = decReg.index * 4; - code += materials.ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, this._pDiffuseInputRegister, this.texture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping) + "dp4 " + temp + ".x, " + temp + ", " + decReg + "\n" + "mov " + temp + ".yz, " + temp + ".xx \n" + "mov " + temp + ".w, " + decReg + ".x\n" + "sub " + temp + ".xyz, " + decReg + ".xxx, " + temp + ".xyz\n"; - - if (shaderObject.numLights == 0) - return code; - - code += "mul " + targetReg + ".xyz, " + temp + ".xyz, " + targetReg + ".xyz\n" + "mov " + targetReg + ".w, " + temp + ".w\n"; - - return code; - }; - return DiffuseDepthMethod; - })(materials.DiffuseBasicMethod); - materials.DiffuseDepthMethod = DiffuseDepthMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * DiffuseGradientMethod is an alternative to DiffuseBasicMethod in which the shading can be modulated with a gradient - * to introduce color-tinted shading as opposed to the single-channel diffuse strength. This can be used as a crude - * approximation to subsurface scattering (for instance, the mid-range shading for skin can be tinted red to similate - * scattered light within the skin attributing to the final colour) - */ - var DiffuseGradientMethod = (function (_super) { - __extends(DiffuseGradientMethod, _super); - /** - * Creates a new DiffuseGradientMethod object. - * @param gradient A texture that contains the light colour based on the angle. This can be used to change - * the light colour due to subsurface scattering when the surface faces away from the light. - */ - function DiffuseGradientMethod(gradient) { - _super.call(this); - - this._gradient = gradient; - } - Object.defineProperty(DiffuseGradientMethod.prototype, "gradient", { - /** - * A texture that contains the light colour based on the angle. This can be used to change the light colour - * due to subsurface scattering when the surface faces away from the light. - */ - get: function () { - return this._gradient; - }, - set: function (value) { - if (value.hasMipmaps != this._gradient.hasMipmaps || value.format != this._gradient.format) - this.iInvalidateShaderProgram(); - this._gradient = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - DiffuseGradientMethod.prototype.iCleanCompilationData = function () { - _super.prototype.iCleanCompilationData.call(this); - this._gradientTextureRegister = null; - }; - - /** - * @inheritDoc - */ - DiffuseGradientMethod.prototype.iGetFragmentPreLightingCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { - var code = _super.prototype.iGetFragmentPreLightingCode.call(this, shaderObject, methodVO, registerCache, sharedRegisters); - this._pIsFirstLight = true; - - if (shaderObject.numLights > 0) { - this._gradientTextureRegister = registerCache.getFreeTextureReg(); - methodVO.secondaryTexturesIndex = this._gradientTextureRegister.index; - } - return code; - }; - - /** - * @inheritDoc - */ - DiffuseGradientMethod.prototype.iGetFragmentCodePerLight = function (shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters) { - var code = ""; - var t; - - // write in temporary if not first light, so we can add to total diffuse colour - if (this._pIsFirstLight) - t = this._pTotalLightColorReg; - else { - t = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(t, 1); - } - - code += "dp3 " + t + ".w, " + lightDirReg + ".xyz, " + sharedRegisters.normalFragment + ".xyz\n" + "mul " + t + ".w, " + t + ".w, " + sharedRegisters.commons + ".x\n" + "add " + t + ".w, " + t + ".w, " + sharedRegisters.commons + ".x\n" + "mul " + t + ".xyz, " + t + ".w, " + lightDirReg + ".w\n"; - - if (this._iModulateMethod != null) - code += this._iModulateMethod(shaderObject, methodVO, t, registerCache, sharedRegisters); - - code += materials.ShaderCompilerHelper.getTex2DSampleCode(t, sharedRegisters, this._gradientTextureRegister, this._gradient, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, t, "clamp") + "mul " + t + ".xyz, " + t + ".xyz, " + lightColReg + ".xyz\n"; - - if (!this._pIsFirstLight) { - code += "add " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ".xyz, " + t + ".xyz\n"; - registerCache.removeFragmentTempUsage(t); - } - - this._pIsFirstLight = false; - - return code; - }; - - /** - * @inheritDoc - */ - DiffuseGradientMethod.prototype.pApplyShadow = function (shaderObject, methodVO, regCache, sharedRegisters) { - var t = regCache.getFreeFragmentVectorTemp(); - - return "mov " + t + ", " + sharedRegisters.shadowTarget + ".wwww\n" + materials.ShaderCompilerHelper.getTex2DSampleCode(t, sharedRegisters, this._gradientTextureRegister, this._gradient, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, t, "clamp") + "mul " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ", " + t + "\n"; - }; - - /** - * @inheritDoc - */ - DiffuseGradientMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); - - stage.context.activateTexture(methodVO.secondaryTexturesIndex, this._gradient); - }; - return DiffuseGradientMethod; - })(materials.DiffuseBasicMethod); - materials.DiffuseGradientMethod = DiffuseGradientMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * DiffuseLightMapMethod provides a diffuse shading method that uses a light map to modulate the calculated diffuse - * lighting. It is different from EffectLightMapMethod in that the latter modulates the entire calculated pixel color, rather - * than only the diffuse lighting value. - */ - var DiffuseLightMapMethod = (function (_super) { - __extends(DiffuseLightMapMethod, _super); - /** - * Creates a new DiffuseLightMapMethod method. - * - * @param lightMap The texture containing the light map. - * @param blendMode The blend mode with which the light map should be applied to the lighting result. - * @param useSecondaryUV Indicates whether the secondary UV set should be used to map the light map. - * @param baseMethod The diffuse method used to calculate the regular diffuse-based lighting. - */ - function DiffuseLightMapMethod(lightMap, blendMode, useSecondaryUV, baseMethod) { - if (typeof blendMode === "undefined") { blendMode = "multiply"; } - if (typeof useSecondaryUV === "undefined") { useSecondaryUV = false; } - if (typeof baseMethod === "undefined") { baseMethod = null; } - _super.call(this, null, baseMethod); - - this._useSecondaryUV = useSecondaryUV; - this._lightMapTexture = lightMap; - this.blendMode = blendMode; - } - /** - * @inheritDoc - */ - DiffuseLightMapMethod.prototype.iInitVO = function (shaderObject, methodVO) { - methodVO.needsSecondaryUV = this._useSecondaryUV; - methodVO.needsUV = !this._useSecondaryUV; - }; - - Object.defineProperty(DiffuseLightMapMethod.prototype, "blendMode", { - /** - * The blend mode with which the light map should be applied to the lighting result. - * - * @see DiffuseLightMapMethod.ADD - * @see DiffuseLightMapMethod.MULTIPLY - */ - get: function () { - return this._blendMode; - }, - set: function (value) { - if (value != DiffuseLightMapMethod.ADD && value != DiffuseLightMapMethod.MULTIPLY) - throw new Error("Unknown blendmode!"); - - if (this._blendMode == value) - return; - - this._blendMode = value; - - this.iInvalidateShaderProgram(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DiffuseLightMapMethod.prototype, "lightMapTexture", { - /** - * The texture containing the light map data. - */ - get: function () { - return this._lightMapTexture; - }, - set: function (value) { - this._lightMapTexture = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - DiffuseLightMapMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - stage.context.activateTexture(methodVO.secondaryTexturesIndex, this._lightMapTexture); - - _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); - }; - - /** - * @inheritDoc - */ - DiffuseLightMapMethod.prototype.iGetFragmentPostLightingCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - var code; - var lightMapReg = registerCache.getFreeTextureReg(); - var temp = registerCache.getFreeFragmentVectorTemp(); - methodVO.secondaryTexturesIndex = lightMapReg.index; - - code = materials.ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, lightMapReg, this._lightMapTexture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, sharedRegisters.secondaryUVVarying); - - switch (this._blendMode) { - case DiffuseLightMapMethod.MULTIPLY: - code += "mul " + this._pTotalLightColorReg + ", " + this._pTotalLightColorReg + ", " + temp + "\n"; - break; - case DiffuseLightMapMethod.ADD: - code += "add " + this._pTotalLightColorReg + ", " + this._pTotalLightColorReg + ", " + temp + "\n"; - break; - } - - code += _super.prototype.iGetFragmentPostLightingCode.call(this, shaderObject, methodVO, targetReg, registerCache, sharedRegisters); - - return code; - }; - DiffuseLightMapMethod.MULTIPLY = "multiply"; - - DiffuseLightMapMethod.ADD = "add"; - return DiffuseLightMapMethod; - })(materials.DiffuseCompositeMethod); - materials.DiffuseLightMapMethod = DiffuseLightMapMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * DiffuseWrapMethod is an alternative to DiffuseBasicMethod in which the light is allowed to be "wrapped around" the normally dark area, to some extent. - * It can be used as a crude approximation to Oren-Nayar or simple subsurface scattering. - */ - var DiffuseWrapMethod = (function (_super) { - __extends(DiffuseWrapMethod, _super); - /** - * Creates a new DiffuseWrapMethod object. - * @param wrapFactor A factor to indicate the amount by which the light is allowed to wrap - */ - function DiffuseWrapMethod(wrapFactor) { - if (typeof wrapFactor === "undefined") { wrapFactor = .5; } - _super.call(this); - - this.wrapFactor = wrapFactor; - } - /** - * @inheritDoc - */ - DiffuseWrapMethod.prototype.iCleanCompilationData = function () { - _super.prototype.iCleanCompilationData.call(this); - - this._wrapDataRegister = null; - }; - - Object.defineProperty(DiffuseWrapMethod.prototype, "wrapFactor", { - /** - * A factor to indicate the amount by which the light is allowed to wrap. - */ - get: function () { - return this._wrapFactor; - }, - set: function (value) { - this._wrapFactor = value; - this._wrapFactor = 1 / (value + 1); - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - DiffuseWrapMethod.prototype.iGetFragmentPreLightingCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { - var code = _super.prototype.iGetFragmentPreLightingCode.call(this, shaderObject, methodVO, registerCache, sharedRegisters); - this._pIsFirstLight = true; - this._wrapDataRegister = registerCache.getFreeFragmentConstant(); - methodVO.secondaryFragmentConstantsIndex = this._wrapDataRegister.index * 4; - - return code; - }; - - /** - * @inheritDoc - */ - DiffuseWrapMethod.prototype.iGetFragmentCodePerLight = function (shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters) { - var code = ""; - var t; - - // write in temporary if not first light, so we can add to total diffuse colour - if (this._pIsFirstLight) { - t = this._pTotalLightColorReg; - } else { - t = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(t, 1); - } - - code += "dp3 " + t + ".x, " + lightDirReg + ".xyz, " + sharedRegisters.normalFragment + ".xyz\n" + "add " + t + ".y, " + t + ".x, " + this._wrapDataRegister + ".x\n" + "mul " + t + ".y, " + t + ".y, " + this._wrapDataRegister + ".y\n" + "sat " + t + ".w, " + t + ".y\n" + "mul " + t + ".xz, " + t + ".w, " + lightDirReg + ".wz\n"; - - if (this._iModulateMethod != null) - code += this._iModulateMethod(shaderObject, methodVO, lightDirReg, registerCache, sharedRegisters); - - code += "mul " + t + ", " + t + ".x, " + lightColReg + "\n"; - - if (!this._pIsFirstLight) { - code += "add " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ".xyz, " + t + ".xyz\n"; - registerCache.removeFragmentTempUsage(t); - } - - this._pIsFirstLight = false; - - return code; - }; - - /** - * @inheritDoc - */ - DiffuseWrapMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); - - var index = methodVO.secondaryFragmentConstantsIndex; - var data = shaderObject.fragmentConstantData; - data[index] = this._wrapFactor; - data[index + 1] = 1 / (this._wrapFactor + 1); - }; - return DiffuseWrapMethod; - })(materials.DiffuseBasicMethod); - materials.DiffuseWrapMethod = DiffuseWrapMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * EffectAlphaMaskMethod allows the use of an additional texture to specify the alpha value of the material. When used - * with the secondary uv set, it allows for a tiled main texture with independently varying alpha (useful for water - * etc). - */ - var EffectAlphaMaskMethod = (function (_super) { - __extends(EffectAlphaMaskMethod, _super); - /** - * Creates a new EffectAlphaMaskMethod object. - * - * @param texture The texture to use as the alpha mask. - * @param useSecondaryUV Indicated whether or not the secondary uv set for the mask. This allows mapping alpha independently. - */ - function EffectAlphaMaskMethod(texture, useSecondaryUV) { - if (typeof useSecondaryUV === "undefined") { useSecondaryUV = false; } - _super.call(this); - - this._texture = texture; - this._useSecondaryUV = useSecondaryUV; - } - /** - * @inheritDoc - */ - EffectAlphaMaskMethod.prototype.iInitVO = function (shaderObject, methodVO) { - methodVO.needsSecondaryUV = this._useSecondaryUV; - methodVO.needsUV = !this._useSecondaryUV; - }; - - Object.defineProperty(EffectAlphaMaskMethod.prototype, "useSecondaryUV", { - /** - * Indicated whether or not the secondary uv set for the mask. This allows mapping alpha independently, for - * instance to tile the main texture and normal map while providing untiled alpha, for example to define the - * transparency over a tiled water surface. - */ - get: function () { - return this._useSecondaryUV; - }, - set: function (value) { - if (this._useSecondaryUV == value) - return; - this._useSecondaryUV = value; - this.iInvalidateShaderProgram(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(EffectAlphaMaskMethod.prototype, "texture", { - /** - * The texture to use as the alpha mask. - */ - get: function () { - return this._texture; - }, - set: function (value) { - this._texture = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - EffectAlphaMaskMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - stage.context.activateTexture(methodVO.texturesIndex, this._texture); - }; - - /** - * @inheritDoc - */ - EffectAlphaMaskMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - var textureReg = registerCache.getFreeTextureReg(); - var temp = registerCache.getFreeFragmentVectorTemp(); - var uvReg = this._useSecondaryUV ? sharedRegisters.secondaryUVVarying : sharedRegisters.uvVarying; - methodVO.texturesIndex = textureReg.index; - - return materials.ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, textureReg, this._texture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, uvReg) + "mul " + targetReg + ", " + targetReg + ", " + temp + ".x\n"; - }; - return EffectAlphaMaskMethod; - })(materials.EffectMethodBase); - materials.EffectAlphaMaskMethod = EffectAlphaMaskMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * EffectColorMatrixMethod provides a shading method that changes the colour of a material analogous to a ColorMatrixFilter. - */ - var EffectColorMatrixMethod = (function (_super) { - __extends(EffectColorMatrixMethod, _super); - /** - * Creates a new EffectColorTransformMethod. - * - * @param matrix An array of 20 items for 4 x 5 color transform. - */ - function EffectColorMatrixMethod(matrix) { - _super.call(this); - - if (matrix.length != 20) - throw new Error("Matrix length must be 20!"); - - this._matrix = matrix; - } - Object.defineProperty(EffectColorMatrixMethod.prototype, "colorMatrix", { - /** - * The 4 x 5 matrix to transform the color of the material. - */ - get: function () { - return this._matrix; - }, - set: function (value) { - this._matrix = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - EffectColorMatrixMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - var code = ""; - var colorMultReg = registerCache.getFreeFragmentConstant(); - registerCache.getFreeFragmentConstant(); - registerCache.getFreeFragmentConstant(); - registerCache.getFreeFragmentConstant(); - - var colorOffsetReg = registerCache.getFreeFragmentConstant(); - - methodVO.fragmentConstantsIndex = colorMultReg.index * 4; - - var temp = registerCache.getFreeFragmentVectorTemp(); - - code += "m44 " + temp + ", " + targetReg + ", " + colorMultReg + "\n" + "add " + targetReg + ", " + temp + ", " + colorOffsetReg + "\n"; - - return code; - }; - - /** - * @inheritDoc - */ - EffectColorMatrixMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - var matrix = this._matrix; - var index = methodVO.fragmentConstantsIndex; - var data = shaderObject.fragmentConstantData; - - // r - data[index] = matrix[0]; - data[index + 1] = matrix[1]; - data[index + 2] = matrix[2]; - data[index + 3] = matrix[3]; - - // g - data[index + 4] = matrix[5]; - data[index + 5] = matrix[6]; - data[index + 6] = matrix[7]; - data[index + 7] = matrix[8]; - - // b - data[index + 8] = matrix[10]; - data[index + 9] = matrix[11]; - data[index + 10] = matrix[12]; - data[index + 11] = matrix[13]; - - // a - data[index + 12] = matrix[15]; - data[index + 13] = matrix[16]; - data[index + 14] = matrix[17]; - data[index + 15] = matrix[18]; - - // rgba offset - data[index + 16] = matrix[4]; - data[index + 17] = matrix[9]; - data[index + 18] = matrix[14]; - data[index + 19] = matrix[19]; - }; - return EffectColorMatrixMethod; - })(materials.EffectMethodBase); - materials.EffectColorMatrixMethod = EffectColorMatrixMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * EffectEnvMapMethod provides a material method to perform reflection mapping using cube maps. - */ - var EffectEnvMapMethod = (function (_super) { - __extends(EffectEnvMapMethod, _super); - /** - * Creates an EffectEnvMapMethod object. - * @param envMap The environment map containing the reflected scene. - * @param alpha The reflectivity of the surface. - */ - function EffectEnvMapMethod(envMap, alpha) { - if (typeof alpha === "undefined") { alpha = 1; } - _super.call(this); - this._cubeTexture = envMap; - this._alpha = alpha; - } - Object.defineProperty(EffectEnvMapMethod.prototype, "mask", { - /** - * An optional texture to modulate the reflectivity of the surface. - */ - get: function () { - return this._mask; - }, - set: function (value) { - if (value != this._mask || (value && this._mask && (value.hasMipmaps != this._mask.hasMipmaps || value.format != this._mask.format))) - this.iInvalidateShaderProgram(); - - this._mask = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - EffectEnvMapMethod.prototype.iInitVO = function (shaderObject, methodVO) { - methodVO.needsNormals = true; - methodVO.needsView = true; - methodVO.needsUV = this._mask != null; - }; - - Object.defineProperty(EffectEnvMapMethod.prototype, "envMap", { - /** - * The cubic environment map containing the reflected scene. - */ - get: function () { - return this._cubeTexture; - }, - set: function (value) { - this._cubeTexture = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - EffectEnvMapMethod.prototype.dispose = function () { - }; - - Object.defineProperty(EffectEnvMapMethod.prototype, "alpha", { - /** - * The reflectivity of the surface. - */ - get: function () { - return this._alpha; - }, - set: function (value) { - this._alpha = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - EffectEnvMapMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - shaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex] = this._alpha; - - stage.context.activateCubeTexture(methodVO.texturesIndex, this._cubeTexture); - if (this._mask) - stage.context.activateTexture(methodVO.texturesIndex + 1, this._mask); - }; - - /** - * @inheritDoc - */ - EffectEnvMapMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - var dataRegister = registerCache.getFreeFragmentConstant(); - var temp = registerCache.getFreeFragmentVectorTemp(); - var code = ""; - var cubeMapReg = registerCache.getFreeTextureReg(); - - methodVO.texturesIndex = cubeMapReg.index; - methodVO.fragmentConstantsIndex = dataRegister.index * 4; - - registerCache.addFragmentTempUsages(temp, 1); - var temp2 = registerCache.getFreeFragmentVectorTemp(); - - // r = I - 2(I.N)*N - code += "dp3 " + temp + ".w, " + sharedRegisters.viewDirFragment + ".xyz, " + sharedRegisters.normalFragment + ".xyz\n" + "add " + temp + ".w, " + temp + ".w, " + temp + ".w\n" + "mul " + temp + ".xyz, " + sharedRegisters.normalFragment + ".xyz, " + temp + ".w\n" + "sub " + temp + ".xyz, " + temp + ".xyz, " + sharedRegisters.viewDirFragment + ".xyz\n" + materials.ShaderCompilerHelper.getTexCubeSampleCode(temp, cubeMapReg, this._cubeTexture, shaderObject.useSmoothTextures, shaderObject.useMipmapping, temp) + "sub " + temp2 + ".w, " + temp + ".w, fc0.x\n" + "kil " + temp2 + ".w\n" + "sub " + temp + ", " + temp + ", " + targetReg + "\n"; - - if (this._mask) - code += materials.ShaderCompilerHelper.getTex2DSampleCode(temp2, sharedRegisters, registerCache.getFreeTextureReg(), this._mask, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping) + "mul " + temp + ", " + temp2 + ", " + temp + "\n"; - - code += "mul " + temp + ", " + temp + ", " + dataRegister + ".x\n" + "add " + targetReg + ", " + targetReg + ", " + temp + "\n"; - - registerCache.removeFragmentTempUsage(temp); - - return code; - }; - return EffectEnvMapMethod; - })(materials.EffectMethodBase); - materials.EffectEnvMapMethod = EffectEnvMapMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * EffectFogMethod provides a method to add distance-based fog to a material. - */ - var EffectFogMethod = (function (_super) { - __extends(EffectFogMethod, _super); - /** - * Creates a new EffectFogMethod object. - * @param minDistance The distance from which the fog starts appearing. - * @param maxDistance The distance at which the fog is densest. - * @param fogColor The colour of the fog. - */ - function EffectFogMethod(minDistance, maxDistance, fogColor) { - if (typeof fogColor === "undefined") { fogColor = 0x808080; } - _super.call(this); - this._minDistance = 0; - this._maxDistance = 1000; - this.minDistance = minDistance; - this.maxDistance = maxDistance; - this.fogColor = fogColor; - } - /** - * @inheritDoc - */ - EffectFogMethod.prototype.iInitVO = function (shaderObject, methodVO) { - methodVO.needsProjection = true; - }; - - /** - * @inheritDoc - */ - EffectFogMethod.prototype.iInitConstants = function (shaderObject, methodVO) { - var data = shaderObject.fragmentConstantData; - var index = methodVO.fragmentConstantsIndex; - data[index + 3] = 1; - data[index + 6] = 0; - data[index + 7] = 0; - }; - - Object.defineProperty(EffectFogMethod.prototype, "minDistance", { - /** - * The distance from which the fog starts appearing. - */ - get: function () { - return this._minDistance; - }, - set: function (value) { - this._minDistance = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(EffectFogMethod.prototype, "maxDistance", { - /** - * The distance at which the fog is densest. - */ - get: function () { - return this._maxDistance; - }, - set: function (value) { - this._maxDistance = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(EffectFogMethod.prototype, "fogColor", { - /** - * The colour of the fog. - */ - get: function () { - return this._fogColor; - }, - set: function (value /*uint*/ ) { - this._fogColor = value; - this._fogR = ((value >> 16) & 0xff) / 0xff; - this._fogG = ((value >> 8) & 0xff) / 0xff; - this._fogB = (value & 0xff) / 0xff; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - EffectFogMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - var data = shaderObject.fragmentConstantData; - var index = methodVO.fragmentConstantsIndex; - data[index] = this._fogR; - data[index + 1] = this._fogG; - data[index + 2] = this._fogB; - data[index + 4] = this._minDistance; - data[index + 5] = 1 / (this._maxDistance - this._minDistance); - }; - - /** - * @inheritDoc - */ - EffectFogMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - var fogColor = registerCache.getFreeFragmentConstant(); - var fogData = registerCache.getFreeFragmentConstant(); - var temp = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(temp, 1); - var temp2 = registerCache.getFreeFragmentVectorTemp(); - var code = ""; - methodVO.fragmentConstantsIndex = fogColor.index * 4; - - code += "sub " + temp2 + ".w, " + sharedRegisters.projectionFragment + ".z, " + fogData + ".x\n" + "mul " + temp2 + ".w, " + temp2 + ".w, " + fogData + ".y\n" + "sat " + temp2 + ".w, " + temp2 + ".w\n" + "sub " + temp + ", " + fogColor + ", " + targetReg + "\n" + "mul " + temp + ", " + temp + ", " + temp2 + ".w\n" + "add " + targetReg + ", " + targetReg + ", " + temp + "\n"; // fogRatio*(fogColor- col) + col - - registerCache.removeFragmentTempUsage(temp); - - return code; - }; - return EffectFogMethod; - })(materials.EffectMethodBase); - materials.EffectFogMethod = EffectFogMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * EffectFresnelEnvMapMethod provides a method to add fresnel-based reflectivity to an object using cube maps, which gets - * stronger as the viewing angle becomes more grazing. - */ - var EffectFresnelEnvMapMethod = (function (_super) { - __extends(EffectFresnelEnvMapMethod, _super); - /** - * Creates a new EffectFresnelEnvMapMethod object. - * - * @param envMap The environment map containing the reflected scene. - * @param alpha The reflectivity of the material. - */ - function EffectFresnelEnvMapMethod(envMap, alpha) { - if (typeof alpha === "undefined") { alpha = 1; } - _super.call(this); - this._fresnelPower = 5; - this._normalReflectance = 0; - - this._cubeTexture = envMap; - this._alpha = alpha; - } - /** - * @inheritDoc - */ - EffectFresnelEnvMapMethod.prototype.iInitVO = function (shaderObject, methodVO) { - methodVO.needsNormals = true; - methodVO.needsView = true; - methodVO.needsUV = this._mask != null; - }; - - /** - * @inheritDoc - */ - EffectFresnelEnvMapMethod.prototype.iInitConstants = function (shaderObject, methodVO) { - shaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex + 3] = 1; - }; - - Object.defineProperty(EffectFresnelEnvMapMethod.prototype, "mask", { - /** - * An optional texture to modulate the reflectivity of the surface. - */ - get: function () { - return this._mask; - }, - set: function (value) { - if (Boolean(value) != Boolean(this._mask) || (value && this._mask && (value.hasMipmaps != this._mask.hasMipmaps || value.format != this._mask.format))) { - this.iInvalidateShaderProgram(); - } - this._mask = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(EffectFresnelEnvMapMethod.prototype, "fresnelPower", { - /** - * The power used in the Fresnel equation. Higher values make the fresnel effect more pronounced. Defaults to 5. - */ - get: function () { - return this._fresnelPower; - }, - set: function (value) { - this._fresnelPower = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(EffectFresnelEnvMapMethod.prototype, "envMap", { - /** - * The cubic environment map containing the reflected scene. - */ - get: function () { - return this._cubeTexture; - }, - set: function (value) { - this._cubeTexture = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(EffectFresnelEnvMapMethod.prototype, "alpha", { - /** - * The reflectivity of the surface. - */ - get: function () { - return this._alpha; - }, - set: function (value) { - this._alpha = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(EffectFresnelEnvMapMethod.prototype, "normalReflectance", { - /** - * The minimum amount of reflectance, ie the reflectance when the view direction is normal to the surface or light direction. - */ - get: function () { - return this._normalReflectance; - }, - set: function (value) { - this._normalReflectance = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - EffectFresnelEnvMapMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - var data = shaderObject.fragmentConstantData; - var index = methodVO.fragmentConstantsIndex; - data[index] = this._alpha; - data[index + 1] = this._normalReflectance; - data[index + 2] = this._fresnelPower; - - stage.context.activateCubeTexture(methodVO.texturesIndex, this._cubeTexture); - - if (this._mask) - stage.context.activateTexture(methodVO.texturesIndex + 1, this._mask); - }; - - /** - * @inheritDoc - */ - EffectFresnelEnvMapMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - var dataRegister = registerCache.getFreeFragmentConstant(); - var temp = registerCache.getFreeFragmentVectorTemp(); - var code = ""; - var cubeMapReg = registerCache.getFreeTextureReg(); - var viewDirReg = sharedRegisters.viewDirFragment; - var normalReg = sharedRegisters.normalFragment; - - methodVO.texturesIndex = cubeMapReg.index; - methodVO.fragmentConstantsIndex = dataRegister.index * 4; - - registerCache.addFragmentTempUsages(temp, 1); - var temp2 = registerCache.getFreeFragmentVectorTemp(); - - // r = V - 2(V.N)*N - code += "dp3 " + temp + ".w, " + viewDirReg + ".xyz, " + normalReg + ".xyz\n" + "add " + temp + ".w, " + temp + ".w, " + temp + ".w\n" + "mul " + temp + ".xyz, " + normalReg + ".xyz, " + temp + ".w\n" + "sub " + temp + ".xyz, " + temp + ".xyz, " + viewDirReg + ".xyz\n" + materials.ShaderCompilerHelper.getTexCubeSampleCode(temp, cubeMapReg, this._cubeTexture, shaderObject.useSmoothTextures, shaderObject.useMipmapping, temp) + "sub " + temp2 + ".w, " + temp + ".w, fc0.x\n" + "kil " + temp2 + ".w\n" + "sub " + temp + ", " + temp + ", " + targetReg + "\n"; - - // calculate fresnel term - code += "dp3 " + viewDirReg + ".w, " + viewDirReg + ".xyz, " + normalReg + ".xyz\n" + "sub " + viewDirReg + ".w, " + dataRegister + ".w, " + viewDirReg + ".w\n" + "pow " + viewDirReg + ".w, " + viewDirReg + ".w, " + dataRegister + ".z\n" + "sub " + normalReg + ".w, " + dataRegister + ".w, " + viewDirReg + ".w\n" + "mul " + normalReg + ".w, " + dataRegister + ".y, " + normalReg + ".w\n" + "add " + viewDirReg + ".w, " + viewDirReg + ".w, " + normalReg + ".w\n" + "mul " + viewDirReg + ".w, " + dataRegister + ".x, " + viewDirReg + ".w\n"; - - if (this._mask) { - var maskReg = registerCache.getFreeTextureReg(); - code += materials.ShaderCompilerHelper.getTex2DSampleCode(temp2, sharedRegisters, maskReg, this._mask, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping) + "mul " + viewDirReg + ".w, " + temp2 + ".x, " + viewDirReg + ".w\n"; - } - - // blend - code += "mul " + temp + ", " + temp + ", " + viewDirReg + ".w\n" + "add " + targetReg + ", " + targetReg + ", " + temp + "\n"; - - registerCache.removeFragmentTempUsage(temp); - - return code; - }; - return EffectFresnelEnvMapMethod; - })(materials.EffectMethodBase); - materials.EffectFresnelEnvMapMethod = EffectFresnelEnvMapMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * EffectLightMapMethod provides a method that allows applying a light map texture to the calculated pixel colour. - * It is different from DiffuseLightMapMethod in that the latter only modulates the diffuse shading value rather - * than the whole pixel colour. - */ - var EffectLightMapMethod = (function (_super) { - __extends(EffectLightMapMethod, _super); - /** - * Creates a new EffectLightMapMethod object. - * - * @param texture The texture containing the light map. - * @param blendMode The blend mode with which the light map should be applied to the lighting result. - * @param useSecondaryUV Indicates whether the secondary UV set should be used to map the light map. - */ - function EffectLightMapMethod(texture, blendMode, useSecondaryUV) { - if (typeof blendMode === "undefined") { blendMode = "multiply"; } - if (typeof useSecondaryUV === "undefined") { useSecondaryUV = false; } - _super.call(this); - this._useSecondaryUV = useSecondaryUV; - this._texture = texture; - this.blendMode = blendMode; - } - /** - * @inheritDoc - */ - EffectLightMapMethod.prototype.iInitVO = function (shaderObject, methodVO) { - methodVO.needsUV = !this._useSecondaryUV; - methodVO.needsSecondaryUV = this._useSecondaryUV; - }; - - Object.defineProperty(EffectLightMapMethod.prototype, "blendMode", { - /** - * The blend mode with which the light map should be applied to the lighting result. - * - * @see EffectLightMapMethod.ADD - * @see EffectLightMapMethod.MULTIPLY - */ - get: function () { - return this._blendMode; - }, - set: function (value) { - if (value != EffectLightMapMethod.ADD && value != EffectLightMapMethod.MULTIPLY) - throw new Error("Unknown blendmode!"); - if (this._blendMode == value) - return; - this._blendMode = value; - this.iInvalidateShaderProgram(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(EffectLightMapMethod.prototype, "texture", { - /** - * The texture containing the light map. - */ - get: function () { - return this._texture; - }, - set: function (value) { - if (value.hasMipmaps != this._texture.hasMipmaps || value.format != this._texture.format) - this.iInvalidateShaderProgram(); - this._texture = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - EffectLightMapMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - stage.context.activateTexture(methodVO.texturesIndex, this._texture); - - _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); - }; - - /** - * @inheritDoc - */ - EffectLightMapMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - var code; - var lightMapReg = registerCache.getFreeTextureReg(); - var temp = registerCache.getFreeFragmentVectorTemp(); - methodVO.texturesIndex = lightMapReg.index; - - code = materials.ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, lightMapReg, this._texture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, this._useSecondaryUV ? sharedRegisters.secondaryUVVarying : sharedRegisters.uvVarying); - - switch (this._blendMode) { - case EffectLightMapMethod.MULTIPLY: - code += "mul " + targetReg + ", " + targetReg + ", " + temp + "\n"; - break; - case EffectLightMapMethod.ADD: - code += "add " + targetReg + ", " + targetReg + ", " + temp + "\n"; - break; - } - - return code; - }; - EffectLightMapMethod.MULTIPLY = "multiply"; - - EffectLightMapMethod.ADD = "add"; - return EffectLightMapMethod; - })(materials.EffectMethodBase); - materials.EffectLightMapMethod = EffectLightMapMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * EffectRefractionEnvMapMethod provides a method to add refracted transparency based on cube maps. - */ - var EffectRefractionEnvMapMethod = (function (_super) { - __extends(EffectRefractionEnvMapMethod, _super); - /** - * Creates a new EffectRefractionEnvMapMethod object. Example values for dispersion are: dispersionR: -0.03, dispersionG: -0.01, dispersionB: = .0015 - * - * @param envMap The environment map containing the refracted scene. - * @param refractionIndex The refractive index of the material. - * @param dispersionR The amount of chromatic dispersion of the red channel. Defaults to 0 (none). - * @param dispersionG The amount of chromatic dispersion of the green channel. Defaults to 0 (none). - * @param dispersionB The amount of chromatic dispersion of the blue channel. Defaults to 0 (none). - */ - function EffectRefractionEnvMapMethod(envMap, refractionIndex, dispersionR, dispersionG, dispersionB) { - if (typeof refractionIndex === "undefined") { refractionIndex = .1; } - if (typeof dispersionR === "undefined") { dispersionR = 0; } - if (typeof dispersionG === "undefined") { dispersionG = 0; } - if (typeof dispersionB === "undefined") { dispersionB = 0; } - _super.call(this); - this._dispersionR = 0; - this._dispersionG = 0; - this._dispersionB = 0; - this._alpha = 1; - this._envMap = envMap; - this._dispersionR = dispersionR; - this._dispersionG = dispersionG; - this._dispersionB = dispersionB; - this._useDispersion = !(this._dispersionR == this._dispersionB && this._dispersionR == this._dispersionG); - this._refractionIndex = refractionIndex; - } - /** - * @inheritDoc - */ - EffectRefractionEnvMapMethod.prototype.iInitConstants = function (shaderObject, methodVO) { - var index = methodVO.fragmentConstantsIndex; - var data = shaderObject.fragmentConstantData; - data[index + 4] = 1; - data[index + 5] = 0; - data[index + 7] = 1; - }; - - /** - * @inheritDoc - */ - EffectRefractionEnvMapMethod.prototype.iInitVO = function (shaderObject, methodVO) { - methodVO.needsNormals = true; - methodVO.needsView = true; - }; - - Object.defineProperty(EffectRefractionEnvMapMethod.prototype, "envMap", { - /** - * The cube environment map to use for the refraction. - */ - get: function () { - return this._envMap; - }, - set: function (value) { - this._envMap = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(EffectRefractionEnvMapMethod.prototype, "refractionIndex", { - /** - * The refractive index of the material. - */ - get: function () { - return this._refractionIndex; - }, - set: function (value) { - this._refractionIndex = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(EffectRefractionEnvMapMethod.prototype, "dispersionR", { - /** - * The amount of chromatic dispersion of the red channel. Defaults to 0 (none). - */ - get: function () { - return this._dispersionR; - }, - set: function (value) { - this._dispersionR = value; - - var useDispersion = !(this._dispersionR == this._dispersionB && this._dispersionR == this._dispersionG); - if (this._useDispersion != useDispersion) { - this.iInvalidateShaderProgram(); - this._useDispersion = useDispersion; - } - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(EffectRefractionEnvMapMethod.prototype, "dispersionG", { - /** - * The amount of chromatic dispersion of the green channel. Defaults to 0 (none). - */ - get: function () { - return this._dispersionG; - }, - set: function (value) { - this._dispersionG = value; - - var useDispersion = !(this._dispersionR == this._dispersionB && this._dispersionR == this._dispersionG); - if (this._useDispersion != useDispersion) { - this.iInvalidateShaderProgram(); - this._useDispersion = useDispersion; - } - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(EffectRefractionEnvMapMethod.prototype, "dispersionB", { - /** - * The amount of chromatic dispersion of the blue channel. Defaults to 0 (none). - */ - get: function () { - return this._dispersionB; - }, - set: function (value) { - this._dispersionB = value; - - var useDispersion = !(this._dispersionR == this._dispersionB && this._dispersionR == this._dispersionG); - if (this._useDispersion != useDispersion) { - this.iInvalidateShaderProgram(); - this._useDispersion = useDispersion; - } - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(EffectRefractionEnvMapMethod.prototype, "alpha", { - /** - * The amount of transparency of the object. Warning: the alpha applies to the refracted color, not the actual - * material. A value of 1 will make it appear fully transparent. - */ - get: function () { - return this._alpha; - }, - set: function (value) { - this._alpha = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - EffectRefractionEnvMapMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - var index = methodVO.fragmentConstantsIndex; - var data = shaderObject.fragmentConstantData; - - data[index] = this._dispersionR + this._refractionIndex; - - if (this._useDispersion) { - data[index + 1] = this._dispersionG + this._refractionIndex; - data[index + 2] = this._dispersionB + this._refractionIndex; - } - data[index + 3] = this._alpha; - - stage.context.activateCubeTexture(methodVO.texturesIndex, this._envMap); - }; - - /** - * @inheritDoc - */ - EffectRefractionEnvMapMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - // todo: data2.x could use common reg, so only 1 reg is used - var data = registerCache.getFreeFragmentConstant(); - var data2 = registerCache.getFreeFragmentConstant(); - var code = ""; - var cubeMapReg = registerCache.getFreeTextureReg(); - var refractionDir; - var refractionColor; - var temp; - - methodVO.texturesIndex = cubeMapReg.index; - methodVO.fragmentConstantsIndex = data.index * 4; - - refractionDir = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(refractionDir, 1); - refractionColor = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(refractionColor, 1); - - temp = registerCache.getFreeFragmentVectorTemp(); - - var viewDirReg = sharedRegisters.viewDirFragment; - var normalReg = sharedRegisters.normalFragment; - - code += "neg " + viewDirReg + ".xyz, " + viewDirReg + ".xyz\n"; - - code += "dp3 " + temp + ".x, " + viewDirReg + ".xyz, " + normalReg + ".xyz\n" + "mul " + temp + ".w, " + temp + ".x, " + temp + ".x\n" + "sub " + temp + ".w, " + data2 + ".x, " + temp + ".w\n" + "mul " + temp + ".w, " + data + ".x, " + temp + ".w\n" + "mul " + temp + ".w, " + data + ".x, " + temp + ".w\n" + "sub " + temp + ".w, " + data2 + ".x, " + temp + ".w\n" + "sqt " + temp + ".y, " + temp + ".w\n" + "mul " + temp + ".x, " + data + ".x, " + temp + ".x\n" + "add " + temp + ".x, " + temp + ".x, " + temp + ".y\n" + "mul " + temp + ".xyz, " + temp + ".x, " + normalReg + ".xyz\n" + "mul " + refractionDir + ", " + data + ".x, " + viewDirReg + "\n" + "sub " + refractionDir + ".xyz, " + refractionDir + ".xyz, " + temp + ".xyz\n" + "nrm " + refractionDir + ".xyz, " + refractionDir + ".xyz\n"; - code += materials.ShaderCompilerHelper.getTexCubeSampleCode(refractionColor, cubeMapReg, this._envMap, shaderObject.useSmoothTextures, shaderObject.useMipmapping, refractionDir) + "sub " + refractionColor + ".w, " + refractionColor + ".w, fc0.x \n" + "kil " + refractionColor + ".w\n"; - - if (this._useDispersion) { - // GREEN - code += "dp3 " + temp + ".x, " + viewDirReg + ".xyz, " + normalReg + ".xyz\n" + "mul " + temp + ".w, " + temp + ".x, " + temp + ".x\n" + "sub " + temp + ".w, " + data2 + ".x, " + temp + ".w\n" + "mul " + temp + ".w, " + data + ".y, " + temp + ".w\n" + "mul " + temp + ".w, " + data + ".y, " + temp + ".w\n" + "sub " + temp + ".w, " + data2 + ".x, " + temp + ".w\n" + "sqt " + temp + ".y, " + temp + ".w\n" + "mul " + temp + ".x, " + data + ".y, " + temp + ".x\n" + "add " + temp + ".x, " + temp + ".x, " + temp + ".y\n" + "mul " + temp + ".xyz, " + temp + ".x, " + normalReg + ".xyz\n" + "mul " + refractionDir + ", " + data + ".y, " + viewDirReg + "\n" + "sub " + refractionDir + ".xyz, " + refractionDir + ".xyz, " + temp + ".xyz\n" + "nrm " + refractionDir + ".xyz, " + refractionDir + ".xyz\n"; - code += materials.ShaderCompilerHelper.getTexCubeSampleCode(temp, cubeMapReg, this._envMap, shaderObject.useSmoothTextures, shaderObject.useMipmapping, refractionDir) + "mov " + refractionColor + ".y, " + temp + ".y\n"; - - // BLUE - code += "dp3 " + temp + ".x, " + viewDirReg + ".xyz, " + normalReg + ".xyz\n" + "mul " + temp + ".w, " + temp + ".x, " + temp + ".x\n" + "sub " + temp + ".w, " + data2 + ".x, " + temp + ".w\n" + "mul " + temp + ".w, " + data + ".z, " + temp + ".w\n" + "mul " + temp + ".w, " + data + ".z, " + temp + ".w\n" + "sub " + temp + ".w, " + data2 + ".x, " + temp + ".w\n" + "sqt " + temp + ".y, " + temp + ".w\n" + "mul " + temp + ".x, " + data + ".z, " + temp + ".x\n" + "add " + temp + ".x, " + temp + ".x, " + temp + ".y\n" + "mul " + temp + ".xyz, " + temp + ".x, " + normalReg + ".xyz\n" + "mul " + refractionDir + ", " + data + ".z, " + viewDirReg + "\n" + "sub " + refractionDir + ".xyz, " + refractionDir + ".xyz, " + temp + ".xyz\n" + "nrm " + refractionDir + ".xyz, " + refractionDir + ".xyz\n"; - code += materials.ShaderCompilerHelper.getTexCubeSampleCode(temp, cubeMapReg, this._envMap, shaderObject.useSmoothTextures, shaderObject.useMipmapping, refractionDir) + "mov " + refractionColor + ".z, " + temp + ".z\n"; - } - - registerCache.removeFragmentTempUsage(refractionDir); - - code += "sub " + refractionColor + ".xyz, " + refractionColor + ".xyz, " + targetReg + ".xyz\n" + "mul " + refractionColor + ".xyz, " + refractionColor + ".xyz, " + data + ".w\n" + "add " + targetReg + ".xyz, " + targetReg + ".xyz, " + refractionColor + ".xyz\n"; - - registerCache.removeFragmentTempUsage(refractionColor); - - // restore - code += "neg " + viewDirReg + ".xyz, " + viewDirReg + ".xyz\n"; - - return code; - }; - return EffectRefractionEnvMapMethod; - })(materials.EffectMethodBase); - materials.EffectRefractionEnvMapMethod = EffectRefractionEnvMapMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * EffectRimLightMethod provides a method to add rim lighting to a material. This adds a glow-like effect to edges of objects. - */ - var EffectRimLightMethod = (function (_super) { - __extends(EffectRimLightMethod, _super); - /** - * Creates a new EffectRimLightMethod object. - * - * @param color The colour of the rim light. - * @param strength The strength of the rim light. - * @param power The power of the rim light. Higher values will result in a higher edge fall-off. - * @param blend The blend mode with which to add the light to the object. - */ - function EffectRimLightMethod(color, strength, power, blend) { - if (typeof color === "undefined") { color = 0xffffff; } - if (typeof strength === "undefined") { strength = .4; } - if (typeof power === "undefined") { power = 2; } - if (typeof blend === "undefined") { blend = "mix"; } - _super.call(this); - - this._blendMode = blend; - this._strength = strength; - this._power = power; - - this.color = color; - } - /** - * @inheritDoc - */ - EffectRimLightMethod.prototype.iInitConstants = function (shaderObject, methodVO) { - shaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex + 3] = 1; - }; - - /** - * @inheritDoc - */ - EffectRimLightMethod.prototype.iInitVO = function (shaderObject, methodVO) { - methodVO.needsNormals = true; - methodVO.needsView = true; - }; - - Object.defineProperty(EffectRimLightMethod.prototype, "blendMode", { - /** - * The blend mode with which to add the light to the object. - * - * EffectRimLightMethod.MULTIPLY multiplies the rim light with the material's colour. - * EffectRimLightMethod.ADD adds the rim light with the material's colour. - * EffectRimLightMethod.MIX provides normal alpha blending. - */ - get: function () { - return this._blendMode; - }, - set: function (value) { - if (this._blendMode == value) - return; - this._blendMode = value; - this.iInvalidateShaderProgram(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(EffectRimLightMethod.prototype, "color", { - /** - * The color of the rim light. - */ - get: function () { - return this._color; - }, - set: function (value /*uint*/ ) { - this._color = value; - this._colorR = ((value >> 16) & 0xff) / 0xff; - this._colorG = ((value >> 8) & 0xff) / 0xff; - this._colorB = (value & 0xff) / 0xff; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(EffectRimLightMethod.prototype, "strength", { - /** - * The strength of the rim light. - */ - get: function () { - return this._strength; - }, - set: function (value) { - this._strength = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(EffectRimLightMethod.prototype, "power", { - /** - * The power of the rim light. Higher values will result in a higher edge fall-off. - */ - get: function () { - return this._power; - }, - set: function (value) { - this._power = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - EffectRimLightMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - var index = methodVO.fragmentConstantsIndex; - var data = shaderObject.fragmentConstantData; - data[index] = this._colorR; - data[index + 1] = this._colorG; - data[index + 2] = this._colorB; - data[index + 4] = this._strength; - data[index + 5] = this._power; - }; - - /** - * @inheritDoc - */ - EffectRimLightMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - var dataRegister = registerCache.getFreeFragmentConstant(); - var dataRegister2 = registerCache.getFreeFragmentConstant(); - var temp = registerCache.getFreeFragmentVectorTemp(); - var code = ""; - - methodVO.fragmentConstantsIndex = dataRegister.index * 4; - - code += "dp3 " + temp + ".x, " + sharedRegisters.viewDirFragment + ".xyz, " + sharedRegisters.normalFragment + ".xyz\n" + "sat " + temp + ".x, " + temp + ".x\n" + "sub " + temp + ".x, " + dataRegister + ".w, " + temp + ".x\n" + "pow " + temp + ".x, " + temp + ".x, " + dataRegister2 + ".y\n" + "mul " + temp + ".x, " + temp + ".x, " + dataRegister2 + ".x\n" + "sub " + temp + ".x, " + dataRegister + ".w, " + temp + ".x\n" + "mul " + targetReg + ".xyz, " + targetReg + ".xyz, " + temp + ".x\n" + "sub " + temp + ".w, " + dataRegister + ".w, " + temp + ".x\n"; - - if (this._blendMode == EffectRimLightMethod.ADD) { - code += "mul " + temp + ".xyz, " + temp + ".w, " + dataRegister + ".xyz\n" + "add " + targetReg + ".xyz, " + targetReg + ".xyz, " + temp + ".xyz\n"; - } else if (this._blendMode == EffectRimLightMethod.MULTIPLY) { - code += "mul " + temp + ".xyz, " + temp + ".w, " + dataRegister + ".xyz\n" + "mul " + targetReg + ".xyz, " + targetReg + ".xyz, " + temp + ".xyz\n"; - } else { - code += "sub " + temp + ".xyz, " + dataRegister + ".xyz, " + targetReg + ".xyz\n" + "mul " + temp + ".xyz, " + temp + ".xyz, " + temp + ".w\n" + "add " + targetReg + ".xyz, " + targetReg + ".xyz, " + temp + ".xyz\n"; - } - - return code; - }; - EffectRimLightMethod.ADD = "add"; - EffectRimLightMethod.MULTIPLY = "multiply"; - EffectRimLightMethod.MIX = "mix"; - return EffectRimLightMethod; - })(materials.EffectMethodBase); - materials.EffectRimLightMethod = EffectRimLightMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * NormalHeightMapMethod provides a normal map method that uses a height map to calculate the normals. - */ - var NormalHeightMapMethod = (function (_super) { - __extends(NormalHeightMapMethod, _super); - /** - * Creates a new NormalHeightMapMethod method. - * - * @param heightMap The texture containing the height data. 0 means low, 1 means high. - * @param worldWidth The width of the 'world'. This is used to map uv coordinates' u component to scene dimensions. - * @param worldHeight The height of the 'world'. This is used to map the height map values to scene dimensions. - * @param worldDepth The depth of the 'world'. This is used to map uv coordinates' v component to scene dimensions. - */ - function NormalHeightMapMethod(heightMap, worldWidth, worldHeight, worldDepth) { - _super.call(this); - - this.normalMap = heightMap; - this._worldXYRatio = worldWidth / worldHeight; - this._worldXZRatio = worldDepth / worldHeight; - } - /** - * @inheritDoc - */ - NormalHeightMapMethod.prototype.iInitConstants = function (shaderObject, methodVO) { - var index = methodVO.fragmentConstantsIndex; - var data = shaderObject.fragmentConstantData; - data[index] = 1 / this.normalMap.width; - data[index + 1] = 1 / this.normalMap.height; - data[index + 2] = 0; - data[index + 3] = 1; - data[index + 4] = this._worldXYRatio; - data[index + 5] = this._worldXZRatio; - }; - - Object.defineProperty(NormalHeightMapMethod.prototype, "tangentSpace", { - /** - * @inheritDoc - */ - get: function () { - return false; - }, - enumerable: true, - configurable: true - }); - - /** - * @inheritDoc - */ - NormalHeightMapMethod.prototype.copyFrom = function (method) { - _super.prototype.copyFrom.call(this, method); - - this._worldXYRatio = method._worldXYRatio; - this._worldXZRatio = method._worldXZRatio; - }; - - /** - * @inheritDoc - */ - NormalHeightMapMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - var temp = registerCache.getFreeFragmentVectorTemp(); - var dataReg = registerCache.getFreeFragmentConstant(); - var dataReg2 = registerCache.getFreeFragmentConstant(); - this._pNormalTextureRegister = registerCache.getFreeTextureReg(); - methodVO.texturesIndex = this._pNormalTextureRegister.index; - methodVO.fragmentConstantsIndex = dataReg.index * 4; - - return materials.ShaderCompilerHelper.getTex2DSampleCode(targetReg, sharedRegisters, this._pNormalTextureRegister, this.normalMap, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, sharedRegisters.uvVarying, "clamp") + "add " + temp + ", " + sharedRegisters.uvVarying + ", " + dataReg + ".xzzz\n" + materials.ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, this._pNormalTextureRegister, this.normalMap, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, temp, "clamp") + "sub " + targetReg + ".x, " + targetReg + ".x, " + temp + ".x\n" + "add " + temp + ", " + sharedRegisters.uvVarying + ", " + dataReg + ".zyzz\n" + materials.ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, this._pNormalTextureRegister, this.normalMap, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, temp, "clamp") + "sub " + targetReg + ".z, " + targetReg + ".z, " + temp + ".x\n" + "mov " + targetReg + ".y, " + dataReg + ".w\n" + "mul " + targetReg + ".xz, " + targetReg + ".xz, " + dataReg2 + ".xy\n" + "nrm " + targetReg + ".xyz, " + targetReg + ".xyz\n"; - }; - return NormalHeightMapMethod; - })(materials.NormalBasicMethod); - materials.NormalHeightMapMethod = NormalHeightMapMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * NormalSimpleWaterMethod provides a basic normal map method to create water ripples by translating two wave normal maps. - */ - var NormalSimpleWaterMethod = (function (_super) { - __extends(NormalSimpleWaterMethod, _super); - /** - * Creates a new NormalSimpleWaterMethod object. - * @param waveMap1 A normal map containing one layer of a wave structure. - * @param waveMap2 A normal map containing a second layer of a wave structure. - */ - function NormalSimpleWaterMethod(waveMap1, waveMap2) { - _super.call(this); - this._useSecondNormalMap = false; - this._water1OffsetX = 0; - this._water1OffsetY = 0; - this._water2OffsetX = 0; - this._water2OffsetY = 0; - this.normalMap = waveMap1; - this.secondaryNormalMap = waveMap2; - } - /** - * @inheritDoc - */ - NormalSimpleWaterMethod.prototype.iInitConstants = function (shaderObject, methodVO) { - var index = methodVO.fragmentConstantsIndex; - var data = shaderObject.fragmentConstantData; - data[index] = .5; - data[index + 1] = 0; - data[index + 2] = 0; - data[index + 3] = 1; - }; - - /** - * @inheritDoc - */ - NormalSimpleWaterMethod.prototype.iInitVO = function (shaderObject, methodVO) { - _super.prototype.iInitVO.call(this, shaderObject, methodVO); - - this._useSecondNormalMap = this.normalMap != this.secondaryNormalMap; - }; - - Object.defineProperty(NormalSimpleWaterMethod.prototype, "water1OffsetX", { - /** - * The translation of the first wave layer along the X-axis. - */ - get: function () { - return this._water1OffsetX; - }, - set: function (value) { - this._water1OffsetX = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(NormalSimpleWaterMethod.prototype, "water1OffsetY", { - /** - * The translation of the first wave layer along the Y-axis. - */ - get: function () { - return this._water1OffsetY; - }, - set: function (value) { - this._water1OffsetY = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(NormalSimpleWaterMethod.prototype, "water2OffsetX", { - /** - * The translation of the second wave layer along the X-axis. - */ - get: function () { - return this._water2OffsetX; - }, - set: function (value) { - this._water2OffsetX = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(NormalSimpleWaterMethod.prototype, "water2OffsetY", { - /** - * The translation of the second wave layer along the Y-axis. - */ - get: function () { - return this._water2OffsetY; - }, - set: function (value) { - this._water2OffsetY = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(NormalSimpleWaterMethod.prototype, "secondaryNormalMap", { - /** - * A second normal map that will be combined with the first to create a wave-like animation pattern. - */ - get: function () { - return this._texture2; - }, - set: function (value) { - this._texture2 = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - NormalSimpleWaterMethod.prototype.iCleanCompilationData = function () { - _super.prototype.iCleanCompilationData.call(this); - this._normalTextureRegister2 = null; - }; - - /** - * @inheritDoc - */ - NormalSimpleWaterMethod.prototype.dispose = function () { - _super.prototype.dispose.call(this); - this._texture2 = null; - }; - - /** - * @inheritDoc - */ - NormalSimpleWaterMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); - - var data = shaderObject.fragmentConstantData; - var index = methodVO.fragmentConstantsIndex; - - data[index + 4] = this._water1OffsetX; - data[index + 5] = this._water1OffsetY; - data[index + 6] = this._water2OffsetX; - data[index + 7] = this._water2OffsetY; - - //if (this._useSecondNormalMap >= 0) - if (this._useSecondNormalMap) - stage.context.activateTexture(methodVO.texturesIndex + 1, this._texture2); - }; - - /** - * @inheritDoc - */ - NormalSimpleWaterMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - var temp = registerCache.getFreeFragmentVectorTemp(); - var dataReg = registerCache.getFreeFragmentConstant(); - var dataReg2 = registerCache.getFreeFragmentConstant(); - this._pNormalTextureRegister = registerCache.getFreeTextureReg(); - this._normalTextureRegister2 = this._useSecondNormalMap ? registerCache.getFreeTextureReg() : this._pNormalTextureRegister; - methodVO.texturesIndex = this._pNormalTextureRegister.index; - - methodVO.fragmentConstantsIndex = dataReg.index * 4; - - return "add " + temp + ", " + sharedRegisters.uvVarying + ", " + dataReg2 + ".xyxy\n" + materials.ShaderCompilerHelper.getTex2DSampleCode(targetReg, sharedRegisters, this._pNormalTextureRegister, this.normalMap, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, temp) + "add " + temp + ", " + sharedRegisters.uvVarying + ", " + dataReg2 + ".zwzw\n" + materials.ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, this._normalTextureRegister2, this._texture2, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, temp) + "add " + targetReg + ", " + targetReg + ", " + temp + " \n" + "mul " + targetReg + ", " + targetReg + ", " + dataReg + ".x \n" + "sub " + targetReg + ".xyz, " + targetReg + ".xyz, " + sharedRegisters.commons + ".xxx \n" + "nrm " + targetReg + ".xyz, " + targetReg + ".xyz \n"; - }; - return NormalSimpleWaterMethod; - })(materials.NormalBasicMethod); - materials.NormalSimpleWaterMethod = NormalSimpleWaterMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var DirectionalLight = away.entities.DirectionalLight; - var Event = away.events.Event; - var ShadingMethodEvent = away.events.ShadingMethodEvent; - - /** - * ShadowCascadeMethod is a shadow map method to apply cascade shadow mapping on materials. - * Must be used with a DirectionalLight with a CascadeShadowMapper assigned to its shadowMapper property. - * - * @see away.lights.CascadeShadowMapper - */ - var ShadowCascadeMethod = (function (_super) { - __extends(ShadowCascadeMethod, _super); - /** - * Creates a new ShadowCascadeMethod object. - * - * @param shadowMethodBase The shadow map sampling method used to sample individual cascades (fe: ShadowHardMethod, ShadowSoftMethod) - */ - function ShadowCascadeMethod(shadowMethodBase) { - var _this = this; - _super.call(this, shadowMethodBase.castingLight); - - this._baseMethod = shadowMethodBase; - if (!(this._pCastingLight instanceof DirectionalLight)) - throw new Error("ShadowCascadeMethod is only compatible with DirectionalLight"); - - this._cascadeShadowMapper = this._pCastingLight.shadowMapper; - - if (!this._cascadeShadowMapper) - throw new Error("ShadowCascadeMethod requires a light that has a CascadeShadowMapper instance assigned to shadowMapper."); - - this._cascadeShadowMapper.addEventListener(Event.CHANGE, function (event) { - return _this.onCascadeChange(event); - }); - this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, function (event) { - return _this.onShaderInvalidated(event); - }); - } - Object.defineProperty(ShadowCascadeMethod.prototype, "baseMethod", { - /** - * The shadow map sampling method used to sample individual cascades. These are typically those used in conjunction - * with a DirectionalShadowMapper. - * - * @see ShadowHardMethod - * @see ShadowSoftMethod - */ - get: function () { - return this._baseMethod; - }, - set: function (value) { - var _this = this; - if (this._baseMethod == value) - return; - - this._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, function (event) { - return _this.onShaderInvalidated(event); - }); - this._baseMethod = value; - this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, function (event) { - return _this.onShaderInvalidated(event); - }); - this.iInvalidateShaderProgram(); - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - ShadowCascadeMethod.prototype.iInitVO = function (shaderObject, methodVO) { - var tempVO = new materials.MethodVO(this._baseMethod); - this._baseMethod.iInitVO(shaderObject, tempVO); - - methodVO.needsGlobalVertexPos = true; - methodVO.needsProjection = true; - }; - - /** - * @inheritDoc - */ - ShadowCascadeMethod.prototype.iInitConstants = function (shaderObject, methodVO) { - var fragmentData = shaderObject.fragmentConstantData; - var vertexData = shaderObject.vertexConstantData; - var index = methodVO.fragmentConstantsIndex; - fragmentData[index] = 1.0; - fragmentData[index + 1] = 1 / 255.0; - fragmentData[index + 2] = 1 / 65025.0; - fragmentData[index + 3] = 1 / 16581375.0; - - fragmentData[index + 6] = .5; - fragmentData[index + 7] = -.5; - - index = methodVO.vertexConstantsIndex; - vertexData[index] = .5; - vertexData[index + 1] = -.5; - vertexData[index + 2] = 0; - }; - - /** - * @inheritDoc - */ - ShadowCascadeMethod.prototype.iCleanCompilationData = function () { - _super.prototype.iCleanCompilationData.call(this); - this._cascadeProjections = null; - this._depthMapCoordVaryings = null; - }; - - /** - * @inheritDoc - */ - ShadowCascadeMethod.prototype.iGetVertexCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { - var code = ""; - var dataReg = registerCache.getFreeVertexConstant(); - - this.initProjectionsRegs(registerCache); - methodVO.vertexConstantsIndex = dataReg.index * 4; - - var temp = registerCache.getFreeVertexVectorTemp(); - - for (var i = 0; i < this._cascadeShadowMapper.numCascades; ++i) { - code += "m44 " + temp + ", " + sharedRegisters.globalPositionVertex + ", " + this._cascadeProjections[i] + "\n" + "add " + this._depthMapCoordVaryings[i] + ", " + temp + ", " + dataReg + ".zzwz\n"; - } - - return code; - }; - - /** - * Creates the registers for the cascades' projection coordinates. - */ - ShadowCascadeMethod.prototype.initProjectionsRegs = function (registerCache) { - this._cascadeProjections = new Array(this._cascadeShadowMapper.numCascades); - this._depthMapCoordVaryings = new Array(this._cascadeShadowMapper.numCascades); - - for (var i = 0; i < this._cascadeShadowMapper.numCascades; ++i) { - this._depthMapCoordVaryings[i] = registerCache.getFreeVarying(); - this._cascadeProjections[i] = registerCache.getFreeVertexConstant(); - registerCache.getFreeVertexConstant(); - registerCache.getFreeVertexConstant(); - registerCache.getFreeVertexConstant(); - } - }; - - /** - * @inheritDoc - */ - ShadowCascadeMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - var numCascades = this._cascadeShadowMapper.numCascades; - var depthMapRegister = registerCache.getFreeTextureReg(); - var decReg = registerCache.getFreeFragmentConstant(); - var dataReg = registerCache.getFreeFragmentConstant(); - var planeDistanceReg = registerCache.getFreeFragmentConstant(); - var planeDistances = Array(planeDistanceReg + ".x", planeDistanceReg + ".y", planeDistanceReg + ".z", planeDistanceReg + ".w"); - var code; - - methodVO.fragmentConstantsIndex = decReg.index * 4; - methodVO.texturesIndex = depthMapRegister.index; - - var inQuad = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(inQuad, 1); - var uvCoord = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(uvCoord, 1); - - // assume lowest partition is selected, will be overwritten later otherwise - code = "mov " + uvCoord + ", " + this._depthMapCoordVaryings[numCascades - 1] + "\n"; - - for (var i = numCascades - 2; i >= 0; --i) { - var uvProjection = this._depthMapCoordVaryings[i]; - - // calculate if in texturemap (result == 0 or 1, only 1 for a single partition) - code += "slt " + inQuad + ".z, " + sharedRegisters.projectionFragment + ".z, " + planeDistances[i] + "\n"; // z = x > minX, w = y > minY - - var temp = registerCache.getFreeFragmentVectorTemp(); - - // linearly interpolate between old and new uv coords using predicate value == conditional toggle to new value if predicate == 1 (true) - code += "sub " + temp + ", " + uvProjection + ", " + uvCoord + "\n" + "mul " + temp + ", " + temp + ", " + inQuad + ".z\n" + "add " + uvCoord + ", " + uvCoord + ", " + temp + "\n"; - } - - registerCache.removeFragmentTempUsage(inQuad); - - code += "div " + uvCoord + ", " + uvCoord + ", " + uvCoord + ".w\n" + "mul " + uvCoord + ".xy, " + uvCoord + ".xy, " + dataReg + ".zw\n" + "add " + uvCoord + ".xy, " + uvCoord + ".xy, " + dataReg + ".zz\n"; - - code += this._baseMethod._iGetCascadeFragmentCode(shaderObject, methodVO, decReg, depthMapRegister, uvCoord, targetReg, registerCache, sharedRegisters) + "add " + targetReg + ".w, " + targetReg + ".w, " + dataReg + ".y\n"; - - registerCache.removeFragmentTempUsage(uvCoord); - - return code; - }; - - /** - * @inheritDoc - */ - ShadowCascadeMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - stage.context.activateTexture(methodVO.texturesIndex, this._pCastingLight.shadowMapper.depthMap); - - var vertexData = shaderObject.vertexConstantData; - var vertexIndex = methodVO.vertexConstantsIndex; - - shaderObject.vertexConstantData[methodVO.vertexConstantsIndex + 3] = -1 / (this._cascadeShadowMapper.depth * this._pEpsilon); - - var numCascades = this._cascadeShadowMapper.numCascades; - vertexIndex += 4; - for (var k = 0; k < numCascades; ++k) { - this._cascadeShadowMapper.getDepthProjections(k).copyRawDataTo(vertexData, vertexIndex, true); - vertexIndex += 16; - } - - var fragmentData = shaderObject.fragmentConstantData; - var fragmentIndex = methodVO.fragmentConstantsIndex; - fragmentData[fragmentIndex + 5] = 1 - this._pAlpha; - - var nearPlaneDistances = this._cascadeShadowMapper._iNearPlaneDistances; - - fragmentIndex += 8; - for (var i = 0; i < numCascades; ++i) - fragmentData[fragmentIndex + i] = nearPlaneDistances[i]; - - this._baseMethod.iActivateForCascade(shaderObject, methodVO, stage); - }; - - /** - * @inheritDoc - */ - ShadowCascadeMethod.prototype.iSetRenderState = function (shaderObject, methodVO, renderable, stage, camera) { - }; - - /** - * Called when the shadow mappers cascade configuration changes. - */ - ShadowCascadeMethod.prototype.onCascadeChange = function (event) { - this.iInvalidateShaderProgram(); - }; - - /** - * Called when the base method's shader code is invalidated. - */ - ShadowCascadeMethod.prototype.onShaderInvalidated = function (event) { - this.iInvalidateShaderProgram(); - }; - return ShadowCascadeMethod; - })(materials.ShadowMapMethodBase); - materials.ShadowCascadeMethod = ShadowCascadeMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var BitmapData = away.base.BitmapData; - - var BitmapTexture = away.textures.BitmapTexture; - - /** - * ShadowDitheredMethod provides a soft shadowing technique by randomly distributing sample points differently for each fragment. - */ - var ShadowDitheredMethod = (function (_super) { - __extends(ShadowDitheredMethod, _super); - /** - * Creates a new ShadowDitheredMethod object. - * @param castingLight The light casting the shadows - * @param numSamples The amount of samples to take for dithering. Minimum 1, maximum 24. - */ - function ShadowDitheredMethod(castingLight, numSamples, range) { - if (typeof numSamples === "undefined") { numSamples = 4; } - if (typeof range === "undefined") { range = 1; } - _super.call(this, castingLight); - - this._depthMapSize = this._pCastingLight.shadowMapper.depthMapSize; - - this.numSamples = numSamples; - this.range = range; - - ++ShadowDitheredMethod._grainUsages; - - if (!ShadowDitheredMethod._grainTexture) - this.initGrainTexture(); - } - Object.defineProperty(ShadowDitheredMethod.prototype, "numSamples", { - /** - * The amount of samples to take for dithering. Minimum 1, maximum 24. The actual maximum may depend on the - * complexity of the shader. - */ - get: function () { - return this._numSamples; - }, - set: function (value /*int*/ ) { - this._numSamples = value; - if (this._numSamples < 1) - this._numSamples = 1; - else if (this._numSamples > 24) - this._numSamples = 24; - this.iInvalidateShaderProgram(); - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - ShadowDitheredMethod.prototype.iInitVO = function (shaderObject, methodVO) { - _super.prototype.iInitVO.call(this, shaderObject, methodVO); - - methodVO.needsProjection = true; - }; - - /** - * @inheritDoc - */ - ShadowDitheredMethod.prototype.iInitConstants = function (shaderObject, methodVO) { - _super.prototype.iInitConstants.call(this, shaderObject, methodVO); - - var fragmentData = shaderObject.fragmentConstantData; - var index = methodVO.fragmentConstantsIndex; - fragmentData[index + 8] = 1 / this._numSamples; - }; - - Object.defineProperty(ShadowDitheredMethod.prototype, "range", { - /** - * The range in the shadow map in which to distribute the samples. - */ - get: function () { - return this._range * 2; - }, - set: function (value) { - this._range = value / 2; - }, - enumerable: true, - configurable: true - }); - - - /** - * Creates a texture containing the dithering noise texture. - */ - ShadowDitheredMethod.prototype.initGrainTexture = function () { - ShadowDitheredMethod._grainBitmapData = new BitmapData(64, 64, false); - var vec = new Array(); - var len = 4096; - var step = 1 / (this._depthMapSize * this._range); - var r, g; - - for (var i = 0; i < len; ++i) { - r = 2 * (Math.random() - .5); - g = 2 * (Math.random() - .5); - if (r < 0) - r -= step; - else - r += step; - if (g < 0) - g -= step; - else - g += step; - if (r > 1) - r = 1; - else if (r < -1) - r = -1; - if (g > 1) - g = 1; - else if (g < -1) - g = -1; - vec[i] = (Math.floor((r * .5 + .5) * 0xff) << 16) | (Math.floor((g * .5 + .5) * 0xff) << 8); - } - - ShadowDitheredMethod._grainBitmapData.setVector(ShadowDitheredMethod._grainBitmapData.rect, vec); - ShadowDitheredMethod._grainTexture = new BitmapTexture(ShadowDitheredMethod._grainBitmapData); - }; - - /** - * @inheritDoc - */ - ShadowDitheredMethod.prototype.dispose = function () { - if (--ShadowDitheredMethod._grainUsages == 0) { - ShadowDitheredMethod._grainTexture.dispose(); - ShadowDitheredMethod._grainBitmapData.dispose(); - ShadowDitheredMethod._grainTexture = null; - } - }; - - /** - * @inheritDoc - */ - ShadowDitheredMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); - - var data = shaderObject.fragmentConstantData; - var index = methodVO.fragmentConstantsIndex; - data[index + 9] = (stage.width - 1) / 63; - data[index + 10] = (stage.height - 1) / 63; - data[index + 11] = 2 * this._range / this._depthMapSize; - stage.context.activateTexture(methodVO.texturesIndex + 1, ShadowDitheredMethod._grainTexture); - }; - - /** - * @inheritDoc - */ - ShadowDitheredMethod.prototype._pGetPlanarFragmentCode = function (methodVO, targetReg, regCache, sharedRegisters) { - var depthMapRegister = regCache.getFreeTextureReg(); - var decReg = regCache.getFreeFragmentConstant(); - var dataReg = regCache.getFreeFragmentConstant(); - var customDataReg = regCache.getFreeFragmentConstant(); - - methodVO.fragmentConstantsIndex = decReg.index * 4; - methodVO.texturesIndex = depthMapRegister.index; - - return this.getSampleCode(customDataReg, depthMapRegister, decReg, targetReg, regCache, sharedRegisters); - }; - - /** - * Get the actual shader code for shadow mapping - * @param regCache The register cache managing the registers. - * @param depthMapRegister The texture register containing the depth map. - * @param decReg The register containing the depth map decoding data. - * @param targetReg The target register to add the shadow coverage. - */ - ShadowDitheredMethod.prototype.getSampleCode = function (customDataReg, depthMapRegister, decReg, targetReg, regCache, sharedRegisters) { - var code = ""; - var grainRegister = regCache.getFreeTextureReg(); - var uvReg = regCache.getFreeFragmentVectorTemp(); - var numSamples = this._numSamples; - regCache.addFragmentTempUsages(uvReg, 1); - - var temp = regCache.getFreeFragmentVectorTemp(); - - var projectionReg = sharedRegisters.projectionFragment; - - code += "div " + uvReg + ", " + projectionReg + ", " + projectionReg + ".w\n" + "mul " + uvReg + ".xy, " + uvReg + ".xy, " + customDataReg + ".yz\n"; - - while (numSamples > 0) { - if (numSamples == this._numSamples) - code += "tex " + uvReg + ", " + uvReg + ", " + grainRegister + " <2d,nearest,repeat,mipnone>\n"; - else - code += "tex " + uvReg + ", " + uvReg + ".zwxy, " + grainRegister + " <2d,nearest,repeat,mipnone>\n"; - - // keep grain in uvReg.zw - code += "sub " + uvReg + ".zw, " + uvReg + ".xy, fc0.xx\n" + "mul " + uvReg + ".zw, " + uvReg + ".zw, " + customDataReg + ".w\n"; // (tex unpack scale and tex scale in one) - - if (numSamples == this._numSamples) { - // first sample - code += "add " + uvReg + ".xy, " + uvReg + ".zw, " + this._pDepthMapCoordReg + ".xy\n" + "tex " + temp + ", " + uvReg + ", " + depthMapRegister + " <2d,nearest,clamp,mipnone>\n" + "dp4 " + temp + ".z, " + temp + ", " + decReg + "\n" + "slt " + targetReg + ".w, " + this._pDepthMapCoordReg + ".z, " + temp + ".z\n"; // 0 if in shadow - } else { - code += this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); - } - - if (numSamples > 4) - code += "add " + uvReg + ".xy, " + uvReg + ".xy, " + uvReg + ".zw\n" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); - - if (numSamples > 1) - code += "sub " + uvReg + ".xy, " + this._pDepthMapCoordReg + ".xy, " + uvReg + ".zw\n" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); - - if (numSamples > 5) - code += "sub " + uvReg + ".xy, " + uvReg + ".xy, " + uvReg + ".zw\n" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); - - if (numSamples > 2) { - code += "neg " + uvReg + ".w, " + uvReg + ".w\n"; // will be rotated 90 degrees when being accessed as wz - code += "add " + uvReg + ".xy, " + uvReg + ".wz, " + this._pDepthMapCoordReg + ".xy\n" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); - } - - if (numSamples > 6) - code += "add " + uvReg + ".xy, " + uvReg + ".xy, " + uvReg + ".wz\n" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); - - if (numSamples > 3) - code += "sub " + uvReg + ".xy, " + this._pDepthMapCoordReg + ".xy, " + uvReg + ".wz\n" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); - - if (numSamples > 7) - code += "sub " + uvReg + ".xy, " + uvReg + ".xy, " + uvReg + ".wz\n" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); - - numSamples -= 8; - } - - regCache.removeFragmentTempUsage(uvReg); - code += "mul " + targetReg + ".w, " + targetReg + ".w, " + customDataReg + ".x\n"; // average - return code; - }; - - /** - * Adds the code for another tap to the shader code. - * @param uvReg The uv register for the tap. - * @param depthMapRegister The texture register containing the depth map. - * @param decReg The register containing the depth map decoding data. - * @param targetReg The target register to add the tap comparison result. - * @param regCache The register cache managing the registers. - * @return - */ - ShadowDitheredMethod.prototype.addSample = function (uvReg, depthMapRegister, decReg, targetReg, regCache) { - var temp = regCache.getFreeFragmentVectorTemp(); - - return "tex " + temp + ", " + uvReg + ", " + depthMapRegister + " <2d,nearest,clamp,mipnone>\n" + "dp4 " + temp + ".z, " + temp + ", " + decReg + "\n" + "slt " + temp + ".z, " + this._pDepthMapCoordReg + ".z, " + temp + ".z\n" + "add " + targetReg + ".w, " + targetReg + ".w, " + temp + ".z\n"; - }; - - /** - * @inheritDoc - */ - ShadowDitheredMethod.prototype.iActivateForCascade = function (shaderObject, methodVO, stage) { - var data = shaderObject.fragmentConstantData; - var index = methodVO.secondaryFragmentConstantsIndex; - data[index] = 1 / this._numSamples; - data[index + 1] = (stage.width - 1) / 63; - data[index + 2] = (stage.height - 1) / 63; - data[index + 3] = 2 * this._range / this._depthMapSize; - - stage.context.activateTexture(methodVO.texturesIndex + 1, ShadowDitheredMethod._grainTexture); - }; - - /** - * @inheritDoc - */ - ShadowDitheredMethod.prototype._iGetCascadeFragmentCode = function (shaderObject, methodVO, decodeRegister, depthTexture, depthProjection, targetRegister, registerCache, sharedRegisters) { - this._pDepthMapCoordReg = depthProjection; - - var dataReg = registerCache.getFreeFragmentConstant(); - methodVO.secondaryFragmentConstantsIndex = dataReg.index * 4; - - return this.getSampleCode(dataReg, depthTexture, decodeRegister, targetRegister, registerCache, sharedRegisters); - }; - return ShadowDitheredMethod; - })(materials.ShadowMethodBase); - materials.ShadowDitheredMethod = ShadowDitheredMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * ShadowFilteredMethod provides a softened shadowing technique by bilinearly interpolating shadow comparison - * results of neighbouring pixels. - */ - var ShadowFilteredMethod = (function (_super) { - __extends(ShadowFilteredMethod, _super); - /** - * Creates a new DiffuseBasicMethod object. - * - * @param castingLight The light casting the shadow - */ - function ShadowFilteredMethod(castingLight) { - _super.call(this, castingLight); - } - /** - * @inheritDoc - */ - ShadowFilteredMethod.prototype.iInitConstants = function (shaderObject, methodVO) { - _super.prototype.iInitConstants.call(this, shaderObject, methodVO); - - var fragmentData = shaderObject.fragmentConstantData; - var index = methodVO.fragmentConstantsIndex; - fragmentData[index + 8] = .5; - var size = this.castingLight.shadowMapper.depthMapSize; - fragmentData[index + 9] = size; - fragmentData[index + 10] = 1 / size; - }; - - /** - * @inheritDoc - */ - ShadowFilteredMethod.prototype._pGetPlanarFragmentCode = function (methodVO, targetReg, regCache, sharedRegisters) { - var depthMapRegister = regCache.getFreeTextureReg(); - var decReg = regCache.getFreeFragmentConstant(); - var dataReg = regCache.getFreeFragmentConstant(); - - // TODO: not used - dataReg = dataReg; - var customDataReg = regCache.getFreeFragmentConstant(); - var depthCol = regCache.getFreeFragmentVectorTemp(); - var uvReg; - var code = ""; - methodVO.fragmentConstantsIndex = decReg.index * 4; - - regCache.addFragmentTempUsages(depthCol, 1); - - uvReg = regCache.getFreeFragmentVectorTemp(); - regCache.addFragmentTempUsages(uvReg, 1); - - code += "mov " + uvReg + ", " + this._pDepthMapCoordReg + "\n" + "tex " + depthCol + ", " + this._pDepthMapCoordReg + ", " + depthMapRegister + " <2d, nearest, clamp>\n" + "dp4 " + depthCol + ".z, " + depthCol + ", " + decReg + "\n" + "slt " + uvReg + ".z, " + this._pDepthMapCoordReg + ".z, " + depthCol + ".z\n" + "add " + uvReg + ".x, " + this._pDepthMapCoordReg + ".x, " + customDataReg + ".z\n" + "tex " + depthCol + ", " + uvReg + ", " + depthMapRegister + " <2d, nearest, clamp>\n" + "dp4 " + depthCol + ".z, " + depthCol + ", " + decReg + "\n" + "slt " + uvReg + ".w, " + this._pDepthMapCoordReg + ".z, " + depthCol + ".z\n" + "mul " + depthCol + ".x, " + this._pDepthMapCoordReg + ".x, " + customDataReg + ".y\n" + "frc " + depthCol + ".x, " + depthCol + ".x\n" + "sub " + uvReg + ".w, " + uvReg + ".w, " + uvReg + ".z\n" + "mul " + uvReg + ".w, " + uvReg + ".w, " + depthCol + ".x\n" + "add " + targetReg + ".w, " + uvReg + ".z, " + uvReg + ".w\n" + "mov " + uvReg + ".x, " + this._pDepthMapCoordReg + ".x\n" + "add " + uvReg + ".y, " + this._pDepthMapCoordReg + ".y, " + customDataReg + ".z\n" + "tex " + depthCol + ", " + uvReg + ", " + depthMapRegister + " <2d, nearest, clamp>\n" + "dp4 " + depthCol + ".z, " + depthCol + ", " + decReg + "\n" + "slt " + uvReg + ".z, " + this._pDepthMapCoordReg + ".z, " + depthCol + ".z\n" + "add " + uvReg + ".x, " + this._pDepthMapCoordReg + ".x, " + customDataReg + ".z\n" + "tex " + depthCol + ", " + uvReg + ", " + depthMapRegister + " <2d, nearest, clamp>\n" + "dp4 " + depthCol + ".z, " + depthCol + ", " + decReg + "\n" + "slt " + uvReg + ".w, " + this._pDepthMapCoordReg + ".z, " + depthCol + ".z\n" + "mul " + depthCol + ".x, " + this._pDepthMapCoordReg + ".x, " + customDataReg + ".y\n" + "frc " + depthCol + ".x, " + depthCol + ".x\n" + "sub " + uvReg + ".w, " + uvReg + ".w, " + uvReg + ".z\n" + "mul " + uvReg + ".w, " + uvReg + ".w, " + depthCol + ".x\n" + "add " + uvReg + ".w, " + uvReg + ".z, " + uvReg + ".w\n" + "mul " + depthCol + ".x, " + this._pDepthMapCoordReg + ".y, " + customDataReg + ".y\n" + "frc " + depthCol + ".x, " + depthCol + ".x\n" + "sub " + uvReg + ".w, " + uvReg + ".w, " + targetReg + ".w\n" + "mul " + uvReg + ".w, " + uvReg + ".w, " + depthCol + ".x\n" + "add " + targetReg + ".w, " + targetReg + ".w, " + uvReg + ".w\n"; - - regCache.removeFragmentTempUsage(depthCol); - regCache.removeFragmentTempUsage(uvReg); - - methodVO.texturesIndex = depthMapRegister.index; - - return code; - }; - - /** - * @inheritDoc - */ - ShadowFilteredMethod.prototype.iActivateForCascade = function (shaderObject, methodVO, stage) { - var size = this.castingLight.shadowMapper.depthMapSize; - var index = methodVO.secondaryFragmentConstantsIndex; - var data = shaderObject.fragmentConstantData; - data[index] = size; - data[index + 1] = 1 / size; - }; - - /** - * @inheritDoc - */ - ShadowFilteredMethod.prototype._iGetCascadeFragmentCode = function (shaderObject, methodVO, decodeRegister, depthTexture, depthProjection, targetRegister, registerCache, sharedRegisters) { - var code; - var dataReg = registerCache.getFreeFragmentConstant(); - methodVO.secondaryFragmentConstantsIndex = dataReg.index * 4; - var temp = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(temp, 1); - var predicate = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(predicate, 1); - - code = "tex " + temp + ", " + depthProjection + ", " + depthTexture + " <2d, nearest, clamp>\n" + "dp4 " + temp + ".z, " + temp + ", " + decodeRegister + "\n" + "slt " + predicate + ".x, " + depthProjection + ".z, " + temp + ".z\n" + "add " + depthProjection + ".x, " + depthProjection + ".x, " + dataReg + ".y\n" + "tex " + temp + ", " + depthProjection + ", " + depthTexture + " <2d, nearest, clamp>\n" + "dp4 " + temp + ".z, " + temp + ", " + decodeRegister + "\n" + "slt " + predicate + ".z, " + depthProjection + ".z, " + temp + ".z\n" + "add " + depthProjection + ".y, " + depthProjection + ".y, " + dataReg + ".y\n" + "tex " + temp + ", " + depthProjection + ", " + depthTexture + " <2d, nearest, clamp>\n" + "dp4 " + temp + ".z, " + temp + ", " + decodeRegister + "\n" + "slt " + predicate + ".w, " + depthProjection + ".z, " + temp + ".z\n" + "sub " + depthProjection + ".x, " + depthProjection + ".x, " + dataReg + ".y\n" + "tex " + temp + ", " + depthProjection + ", " + depthTexture + " <2d, nearest, clamp>\n" + "dp4 " + temp + ".z, " + temp + ", " + decodeRegister + "\n" + "slt " + predicate + ".y, " + depthProjection + ".z, " + temp + ".z\n" + "mul " + temp + ".xy, " + depthProjection + ".xy, " + dataReg + ".x\n" + "frc " + temp + ".xy, " + temp + ".xy\n" + "sub " + depthProjection + ", " + predicate + ".xyzw, " + predicate + ".zwxy\n" + "mul " + depthProjection + ", " + depthProjection + ", " + temp + ".x\n" + "add " + predicate + ".xy, " + predicate + ".xy, " + depthProjection + ".zw\n" + "sub " + predicate + ".y, " + predicate + ".y, " + predicate + ".x\n" + "mul " + predicate + ".y, " + predicate + ".y, " + temp + ".y\n" + "add " + targetRegister + ".w, " + predicate + ".x, " + predicate + ".y\n"; - - registerCache.removeFragmentTempUsage(temp); - registerCache.removeFragmentTempUsage(predicate); - return code; - }; - return ShadowFilteredMethod; - })(materials.ShadowMethodBase); - materials.ShadowFilteredMethod = ShadowFilteredMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var ShadingMethodEvent = away.events.ShadingMethodEvent; - - // TODO: shadow mappers references in materials should be an interface so that this class should NOT extend ShadowMapMethodBase just for some delegation work - /** - * ShadowNearMethod provides a shadow map method that restricts the shadowed area near the camera to optimize - * shadow map usage. This method needs to be used in conjunction with a NearDirectionalShadowMapper. - * - * @see away.lights.NearDirectionalShadowMapper - */ - var ShadowNearMethod = (function (_super) { - __extends(ShadowNearMethod, _super); - /** - * Creates a new ShadowNearMethod object. - * @param baseMethod The shadow map sampling method used to sample individual cascades (fe: ShadowHardMethod, ShadowSoftMethod) - * @param fadeRatio The amount of shadow fading to the outer shadow area. A value of 1 would mean the shadows start fading from the camera's near plane. - */ - function ShadowNearMethod(baseMethod, fadeRatio) { - if (typeof fadeRatio === "undefined") { fadeRatio = .1; } - var _this = this; - _super.call(this, baseMethod.castingLight); - - this._onShaderInvalidatedDelegate = function (event) { - return _this.onShaderInvalidated(event); - }; - - this._baseMethod = baseMethod; - this._fadeRatio = fadeRatio; - this._nearShadowMapper = this._pCastingLight.shadowMapper; - if (!this._nearShadowMapper) - throw new Error("ShadowNearMethod requires a light that has a NearDirectionalShadowMapper instance assigned to shadowMapper."); - this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - } - Object.defineProperty(ShadowNearMethod.prototype, "baseMethod", { - /** - * The base shadow map method on which this method's shading is based. - */ - get: function () { - return this._baseMethod; - }, - set: function (value) { - if (this._baseMethod == value) - return; - this._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - this._baseMethod = value; - this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - this.iInvalidateShaderProgram(); - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - ShadowNearMethod.prototype.iInitConstants = function (shaderObject, methodVO) { - _super.prototype.iInitConstants.call(this, shaderObject, methodVO); - this._baseMethod.iInitConstants(shaderObject, methodVO); - - var fragmentData = shaderObject.fragmentConstantData; - var index = methodVO.secondaryFragmentConstantsIndex; - fragmentData[index + 2] = 0; - fragmentData[index + 3] = 1; - }; - - /** - * @inheritDoc - */ - ShadowNearMethod.prototype.iInitVO = function (shaderObject, methodVO) { - this._baseMethod.iInitVO(shaderObject, methodVO); - - methodVO.needsProjection = true; - }; - - /** - * @inheritDoc - */ - ShadowNearMethod.prototype.dispose = function () { - this._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - }; - - Object.defineProperty(ShadowNearMethod.prototype, "alpha", { - /** - * @inheritDoc - */ - get: function () { - return this._baseMethod.alpha; - }, - set: function (value) { - this._baseMethod.alpha = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ShadowNearMethod.prototype, "epsilon", { - /** - * @inheritDoc - */ - get: function () { - return this._baseMethod.epsilon; - }, - set: function (value) { - this._baseMethod.epsilon = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ShadowNearMethod.prototype, "fadeRatio", { - /** - * The amount of shadow fading to the outer shadow area. A value of 1 would mean the shadows start fading from the camera's near plane. - */ - get: function () { - return this._fadeRatio; - }, - set: function (value) { - this._fadeRatio = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - ShadowNearMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - var code = this._baseMethod.iGetFragmentCode(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); - - var dataReg = registerCache.getFreeFragmentConstant(); - var temp = registerCache.getFreeFragmentSingleTemp(); - methodVO.secondaryFragmentConstantsIndex = dataReg.index * 4; - - code += "abs " + temp + ", " + sharedRegisters.projectionFragment + ".w\n" + "sub " + temp + ", " + temp + ", " + dataReg + ".x\n" + "mul " + temp + ", " + temp + ", " + dataReg + ".y\n" + "sat " + temp + ", " + temp + "\n" + "sub " + temp + ", " + dataReg + ".w," + temp + "\n" + "sub " + targetReg + ".w, " + dataReg + ".w," + targetReg + ".w\n" + "mul " + targetReg + ".w, " + targetReg + ".w, " + temp + "\n" + "sub " + targetReg + ".w, " + dataReg + ".w," + targetReg + ".w\n"; - - return code; - }; - - /** - * @inheritDoc - */ - ShadowNearMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - this._baseMethod.iActivate(shaderObject, methodVO, stage); - }; - - /** - * @inheritDoc - */ - ShadowNearMethod.prototype.iDeactivate = function (shaderObject, methodVO, stage) { - this._baseMethod.iDeactivate(shaderObject, methodVO, stage); - }; - - /** - * @inheritDoc - */ - ShadowNearMethod.prototype.iSetRenderState = function (shaderObject, methodVO, renderable, stage, camera) { - // todo: move this to activate (needs camera) - var near = camera.projection.near; - var d = camera.projection.far - near; - var maxDistance = this._nearShadowMapper.coverageRatio; - var minDistance = maxDistance * (1 - this._fadeRatio); - - maxDistance = near + maxDistance * d; - minDistance = near + minDistance * d; - - var fragmentData = shaderObject.fragmentConstantData; - var index = methodVO.secondaryFragmentConstantsIndex; - fragmentData[index] = minDistance; - fragmentData[index + 1] = 1 / (maxDistance - minDistance); - - this._baseMethod.iSetRenderState(shaderObject, methodVO, renderable, stage, camera); - }; - - /** - * @inheritDoc - */ - ShadowNearMethod.prototype.iGetVertexCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { - return this._baseMethod.iGetVertexCode(shaderObject, methodVO, registerCache, sharedRegisters); - }; - - /** - * @inheritDoc - */ - ShadowNearMethod.prototype.iReset = function () { - this._baseMethod.iReset(); - }; - - /** - * @inheritDoc - */ - ShadowNearMethod.prototype.iCleanCompilationData = function () { - _super.prototype.iCleanCompilationData.call(this); - this._baseMethod.iCleanCompilationData(); - }; - - /** - * Called when the base method's shader code is invalidated. - */ - ShadowNearMethod.prototype.onShaderInvalidated = function (event) { - this.iInvalidateShaderProgram(); - }; - return ShadowNearMethod; - })(materials.ShadowMethodBase); - materials.ShadowNearMethod = ShadowNearMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * ShadowSoftMethod provides a soft shadowing technique by randomly distributing sample points. - */ - var ShadowSoftMethod = (function (_super) { - __extends(ShadowSoftMethod, _super); - /** - * Creates a new DiffuseBasicMethod object. - * - * @param castingLight The light casting the shadows - * @param numSamples The amount of samples to take for dithering. Minimum 1, maximum 32. - */ - function ShadowSoftMethod(castingLight, numSamples, range) { - if (typeof numSamples === "undefined") { numSamples = 5; } - if (typeof range === "undefined") { range = 1; } - _super.call(this, castingLight); - this._range = 1; - - this.numSamples = numSamples; - this.range = range; - } - Object.defineProperty(ShadowSoftMethod.prototype, "numSamples", { - /** - * The amount of samples to take for dithering. Minimum 1, maximum 32. The actual maximum may depend on the - * complexity of the shader. - */ - get: function () { - return this._numSamples; - }, - set: function (value /*int*/ ) { - this._numSamples = value; - if (this._numSamples < 1) - this._numSamples = 1; - else if (this._numSamples > 32) - this._numSamples = 32; - - this._offsets = away.geom.PoissonLookup.getDistribution(this._numSamples); - this.iInvalidateShaderProgram(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ShadowSoftMethod.prototype, "range", { - /** - * The range in the shadow map in which to distribute the samples. - */ - get: function () { - return this._range; - }, - set: function (value) { - this._range = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - ShadowSoftMethod.prototype.iInitConstants = function (shaderObject, methodVO) { - _super.prototype.iInitConstants.call(this, shaderObject, methodVO); - - shaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex + 8] = 1 / this._numSamples; - shaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex + 9] = 0; - }; - - /** - * @inheritDoc - */ - ShadowSoftMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); - - var texRange = .5 * this._range / this._pCastingLight.shadowMapper.depthMapSize; - var data = shaderObject.fragmentConstantData; - var index = methodVO.fragmentConstantsIndex + 10; - var len = this._numSamples << 1; - - for (var i = 0; i < len; ++i) - data[index + i] = this._offsets[i] * texRange; - }; - - /** - * @inheritDoc - */ - ShadowSoftMethod.prototype._pGetPlanarFragmentCode = function (methodVO, targetReg, regCache, sharedRegisters) { - // todo: move some things to super - var depthMapRegister = regCache.getFreeTextureReg(); - var decReg = regCache.getFreeFragmentConstant(); - var dataReg = regCache.getFreeFragmentConstant(); - var customDataReg = regCache.getFreeFragmentConstant(); - - methodVO.fragmentConstantsIndex = decReg.index * 4; - methodVO.texturesIndex = depthMapRegister.index; - - return this.getSampleCode(regCache, depthMapRegister, decReg, targetReg, customDataReg); - }; - - /** - * Adds the code for another tap to the shader code. - * @param uv The uv register for the tap. - * @param texture The texture register containing the depth map. - * @param decode The register containing the depth map decoding data. - * @param target The target register to add the tap comparison result. - * @param regCache The register cache managing the registers. - * @return - */ - ShadowSoftMethod.prototype.addSample = function (uv, texture, decode, target, regCache) { - var temp = regCache.getFreeFragmentVectorTemp(); - return "tex " + temp + ", " + uv + ", " + texture + " <2d,nearest,clamp>\n" + "dp4 " + temp + ".z, " + temp + ", " + decode + "\n" + "slt " + uv + ".w, " + this._pDepthMapCoordReg + ".z, " + temp + ".z\n" + "add " + target + ".w, " + target + ".w, " + uv + ".w\n"; - }; - - /** - * @inheritDoc - */ - ShadowSoftMethod.prototype.iActivateForCascade = function (shaderObject, methodVO, stage) { - _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); - - var texRange = this._range / this._pCastingLight.shadowMapper.depthMapSize; - var data = shaderObject.fragmentConstantData; - var index = methodVO.secondaryFragmentConstantsIndex; - var len = this._numSamples << 1; - data[index] = 1 / this._numSamples; - data[index + 1] = 0; - index += 2; - - for (var i = 0; i < len; ++i) - data[index + i] = this._offsets[i] * texRange; - - if (len % 4 == 0) { - data[index + len] = 0; - data[index + len + 1] = 0; - } - }; - - /** - * @inheritDoc - */ - ShadowSoftMethod.prototype._iGetCascadeFragmentCode = function (shaderObject, methodVO, decodeRegister, depthTexture, depthProjection, targetRegister, registerCache, sharedRegisters) { - this._pDepthMapCoordReg = depthProjection; - - var dataReg = registerCache.getFreeFragmentConstant(); - methodVO.secondaryFragmentConstantsIndex = dataReg.index * 4; - - return this.getSampleCode(registerCache, depthTexture, decodeRegister, targetRegister, dataReg); - }; - - /** - * Get the actual shader code for shadow mapping - * @param regCache The register cache managing the registers. - * @param depthTexture The texture register containing the depth map. - * @param decodeRegister The register containing the depth map decoding data. - * @param targetReg The target register to add the shadow coverage. - * @param dataReg The register containing additional data. - */ - ShadowSoftMethod.prototype.getSampleCode = function (regCache, depthTexture, decodeRegister, targetRegister, dataReg) { - var uvReg; - var code; - var offsets = new Array(dataReg + ".zw"); - uvReg = regCache.getFreeFragmentVectorTemp(); - regCache.addFragmentTempUsages(uvReg, 1); - - var temp = regCache.getFreeFragmentVectorTemp(); - - var numRegs = this._numSamples >> 1; - for (var i = 0; i < numRegs; ++i) { - var reg = regCache.getFreeFragmentConstant(); - offsets.push(reg + ".xy"); - offsets.push(reg + ".zw"); - } - - for (i = 0; i < this._numSamples; ++i) { - if (i == 0) { - code = "add " + uvReg + ", " + this._pDepthMapCoordReg + ", " + dataReg + ".zwyy\n" + "tex " + temp + ", " + uvReg + ", " + depthTexture + " <2d,nearest,clamp>\n" + "dp4 " + temp + ".z, " + temp + ", " + decodeRegister + "\n" + "slt " + targetRegister + ".w, " + this._pDepthMapCoordReg + ".z, " + temp + ".z\n"; // 0 if in shadow; - } else { - code += "add " + uvReg + ".xy, " + this._pDepthMapCoordReg + ".xy, " + offsets[i] + "\n" + this.addSample(uvReg, depthTexture, decodeRegister, targetRegister, regCache); - } - } - - regCache.removeFragmentTempUsage(uvReg); - - code += "mul " + targetRegister + ".w, " + targetRegister + ".w, " + dataReg + ".x\n"; // average - - return code; - }; - return ShadowSoftMethod; - })(materials.ShadowMethodBase); - materials.ShadowSoftMethod = ShadowSoftMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var Delegate = away.utils.Delegate; - - var ShadingMethodEvent = away.events.ShadingMethodEvent; - - /** - * SpecularCompositeMethod provides a base class for specular methods that wrap a specular method to alter the - * calculated specular reflection strength. - */ - var SpecularCompositeMethod = (function (_super) { - __extends(SpecularCompositeMethod, _super); - /** - * Creates a new SpecularCompositeMethod object. - * - * @param modulateMethod The method which will add the code to alter the base method's strength. It needs to have the signature modSpecular(t:ShaderRegisterElement, regCache:ShaderRegisterCache):string, in which t.w will contain the specular strength and t.xyz will contain the half-vector or the reflection vector. - * @param baseMethod The base specular method on which this method's shading is based. - */ - function SpecularCompositeMethod(modulateMethod, baseMethod) { - if (typeof baseMethod === "undefined") { baseMethod = null; } - _super.call(this); - - this._onShaderInvalidatedDelegate = Delegate.create(this, this.onShaderInvalidated); - - this._baseMethod = baseMethod || new materials.SpecularBasicMethod(); - this._baseMethod._iModulateMethod = modulateMethod; - this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - } - /** - * @inheritDoc - */ - SpecularCompositeMethod.prototype.iInitVO = function (shaderObject, methodVO) { - this._baseMethod.iInitVO(shaderObject, methodVO); - }; - - /** - * @inheritDoc - */ - SpecularCompositeMethod.prototype.iInitConstants = function (shaderObject, methodVO) { - this._baseMethod.iInitConstants(shaderObject, methodVO); - }; - - Object.defineProperty(SpecularCompositeMethod.prototype, "baseMethod", { - /** - * The base specular method on which this method's shading is based. - */ - get: function () { - return this._baseMethod; - }, - set: function (value) { - if (this._baseMethod == value) - return; - - this._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - this._baseMethod = value; - this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - this.iInvalidateShaderProgram(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(SpecularCompositeMethod.prototype, "gloss", { - /** - * @inheritDoc - */ - get: function () { - return this._baseMethod.gloss; - }, - set: function (value) { - this._baseMethod.gloss = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(SpecularCompositeMethod.prototype, "specular", { - /** - * @inheritDoc - */ - get: function () { - return this._baseMethod.specular; - }, - set: function (value) { - this._baseMethod.specular = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(SpecularCompositeMethod.prototype, "passes", { - /** - * @inheritDoc - */ - get: function () { - return this._baseMethod.passes; - }, - enumerable: true, - configurable: true - }); - - /** - * @inheritDoc - */ - SpecularCompositeMethod.prototype.dispose = function () { - this._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - this._baseMethod.dispose(); - }; - - Object.defineProperty(SpecularCompositeMethod.prototype, "texture", { - /** - * @inheritDoc - */ - get: function () { - return this._baseMethod.texture; - }, - set: function (value) { - this._baseMethod.texture = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - SpecularCompositeMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - this._baseMethod.iActivate(shaderObject, methodVO, stage); - }; - - /** - * @inheritDoc - */ - SpecularCompositeMethod.prototype.iSetRenderState = function (shaderObject, methodVO, renderable, stage, camera) { - this._baseMethod.iSetRenderState(shaderObject, methodVO, renderable, stage, camera); - }; - - /** - * @inheritDoc - */ - SpecularCompositeMethod.prototype.iDeactivate = function (shaderObject, methodVO, stage) { - this._baseMethod.iDeactivate(shaderObject, methodVO, stage); - }; - - /** - * @inheritDoc - */ - SpecularCompositeMethod.prototype.iGetVertexCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { - return this._baseMethod.iGetVertexCode(shaderObject, methodVO, registerCache, sharedRegisters); - }; - - /** - * @inheritDoc - */ - SpecularCompositeMethod.prototype.iGetFragmentPreLightingCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { - return this._baseMethod.iGetFragmentPreLightingCode(shaderObject, methodVO, registerCache, sharedRegisters); - }; - - /** - * @inheritDoc - */ - SpecularCompositeMethod.prototype.iGetFragmentCodePerLight = function (shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters) { - return this._baseMethod.iGetFragmentCodePerLight(shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters); - }; - - /** - * @inheritDoc - * @return - */ - SpecularCompositeMethod.prototype.iGetFragmentCodePerProbe = function (shaderObject, methodVO, cubeMapReg, weightRegister, registerCache, sharedRegisters) { - return this._baseMethod.iGetFragmentCodePerProbe(shaderObject, methodVO, cubeMapReg, weightRegister, registerCache, sharedRegisters); - }; - - /** - * @inheritDoc - */ - SpecularCompositeMethod.prototype.iGetFragmentPostLightingCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - return this._baseMethod.iGetFragmentPostLightingCode(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); - }; - - /** - * @inheritDoc - */ - SpecularCompositeMethod.prototype.iReset = function () { - this._baseMethod.iReset(); - }; - - /** - * @inheritDoc - */ - SpecularCompositeMethod.prototype.iCleanCompilationData = function () { - _super.prototype.iCleanCompilationData.call(this); - this._baseMethod.iCleanCompilationData(); - }; - - /** - * Called when the base method's shader code is invalidated. - */ - SpecularCompositeMethod.prototype.onShaderInvalidated = function (event) { - this.iInvalidateShaderProgram(); - }; - return SpecularCompositeMethod; - })(materials.SpecularBasicMethod); - materials.SpecularCompositeMethod = SpecularCompositeMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * - */ - (function (materials) { - /** - * SpecularAnisotropicMethod provides a specular method resulting in anisotropic highlights. These are typical for - * surfaces with microfacet details such as tiny grooves. In particular, this uses the Heidrich-Seidel distrubution. - * The tangent vectors are used as the surface groove directions. - */ - var SpecularAnisotropicMethod = (function (_super) { - __extends(SpecularAnisotropicMethod, _super); - /** - * Creates a new SpecularAnisotropicMethod object. - */ - function SpecularAnisotropicMethod() { - _super.call(this); - } - /** - * @inheritDoc - */ - SpecularAnisotropicMethod.prototype.iInitVO = function (shaderObject, methodVO) { - methodVO.needsTangents = true; - methodVO.needsView = true; - }; - - /** - * @inheritDoc - */ - SpecularAnisotropicMethod.prototype.iGetFragmentCodePerLight = function (shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters) { - var code = ""; - var t; - - if (this._pIsFirstLight) - t = this._pTotalLightColorReg; - else { - t = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(t, 1); - } - - // (sin(l,t) * sin(v,t) - cos(l,t)*cos(v,t)) ^ k - code += "nrm " + t + ".xyz, " + sharedRegisters.tangentVarying + ".xyz\n" + "dp3 " + t + ".w, " + t + ".xyz, " + lightDirReg + ".xyz\n" + "dp3 " + t + ".z, " + t + ".xyz, " + sharedRegisters.viewDirFragment + ".xyz\n"; - - // (sin(t.w) * sin(t.z) - cos(t.w)*cos(t.z)) ^ k - code += "sin " + t + ".x, " + t + ".w\n" + "sin " + t + ".y, " + t + ".z\n" + "mul " + t + ".x, " + t + ".x, " + t + ".y\n" + "cos " + t + ".z, " + t + ".z\n" + "cos " + t + ".w, " + t + ".w\n" + "mul " + t + ".w, " + t + ".w, " + t + ".z\n" + "sub " + t + ".w, " + t + ".x, " + t + ".w\n"; - - if (this._pUseTexture) { - // apply gloss modulation from texture - code += "mul " + this._pSpecularTexData + ".w, " + this._pSpecularTexData + ".y, " + this._pSpecularDataRegister + ".w\n" + "pow " + t + ".w, " + t + ".w, " + this._pSpecularTexData + ".w\n"; - } else - code += "pow " + t + ".w, " + t + ".w, " + this._pSpecularDataRegister + ".w\n"; - - // attenuate - code += "mul " + t + ".w, " + t + ".w, " + lightDirReg + ".w\n"; - - if (this._iModulateMethod != null) - code += this._iModulateMethod(shaderObject, methodVO, t, registerCache, sharedRegisters); - - code += "mul " + t + ".xyz, " + lightColReg + ".xyz, " + t + ".w\n"; - - if (!this._pIsFirstLight) { - code += "add " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ".xyz, " + t + ".xyz\n"; - registerCache.removeFragmentTempUsage(t); - } - - this._pIsFirstLight = false; - - return code; - }; - return SpecularAnisotropicMethod; - })(materials.SpecularBasicMethod); - materials.SpecularAnisotropicMethod = SpecularAnisotropicMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * SpecularCelMethod provides a shading method to add specular cel (cartoon) shading. - */ - var SpecularCelMethod = (function (_super) { - __extends(SpecularCelMethod, _super); - /** - * Creates a new SpecularCelMethod object. - * @param specularCutOff The threshold at which the specular highlight should be shown. - * @param baseMethod An optional specular method on which the cartoon shading is based. If ommitted, SpecularBasicMethod is used. - */ - function SpecularCelMethod(specularCutOff, baseMethod) { - if (typeof specularCutOff === "undefined") { specularCutOff = .5; } - if (typeof baseMethod === "undefined") { baseMethod = null; } - var _this = this; - _super.call(this, null, baseMethod); - this._smoothness = .1; - this._specularCutOff = .1; - - this.baseMethod._iModulateMethod = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - return _this.clampSpecular(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); - }; - - this._specularCutOff = specularCutOff; - } - Object.defineProperty(SpecularCelMethod.prototype, "smoothness", { - /** - * The smoothness of the highlight edge. - */ - get: function () { - return this._smoothness; - }, - set: function (value) { - this._smoothness = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(SpecularCelMethod.prototype, "specularCutOff", { - /** - * The threshold at which the specular highlight should be shown. - */ - get: function () { - return this._specularCutOff; - }, - set: function (value) { - this._specularCutOff = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - SpecularCelMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); - - var index = methodVO.secondaryFragmentConstantsIndex; - var data = shaderObject.fragmentConstantData; - data[index] = this._smoothness; - data[index + 1] = this._specularCutOff; - }; - - /** - * @inheritDoc - */ - SpecularCelMethod.prototype.iCleanCompilationData = function () { - _super.prototype.iCleanCompilationData.call(this); - this._dataReg = null; - }; - - /** - * Snaps the specular shading strength of the wrapped method to zero or one, depending on whether or not it exceeds the specularCutOff - * @param vo The MethodVO used to compile the current shader. - * @param t The register containing the specular strength in the "w" component, and either the half-vector or the reflection vector in "xyz". - * @param regCache The register cache used for the shader compilation. - * @param sharedRegisters The shared register data for this shader. - * @return The AGAL fragment code for the method. - */ - SpecularCelMethod.prototype.clampSpecular = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - return "sub " + targetReg + ".y, " + targetReg + ".w, " + this._dataReg + ".y\n" + "div " + targetReg + ".y, " + targetReg + ".y, " + this._dataReg + ".x\n" + "sat " + targetReg + ".y, " + targetReg + ".y\n" + "sge " + targetReg + ".w, " + targetReg + ".w, " + this._dataReg + ".y\n" + "mul " + targetReg + ".w, " + targetReg + ".w, " + targetReg + ".y\n"; - }; - - /** - * @inheritDoc - */ - SpecularCelMethod.prototype.iGetFragmentPreLightingCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { - this._dataReg = registerCache.getFreeFragmentConstant(); - methodVO.secondaryFragmentConstantsIndex = this._dataReg.index * 4; - - return _super.prototype.iGetFragmentPreLightingCode.call(this, shaderObject, methodVO, registerCache, sharedRegisters); - }; - return SpecularCelMethod; - })(materials.SpecularCompositeMethod); - materials.SpecularCelMethod = SpecularCelMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * SpecularFresnelMethod provides a specular shading method that causes stronger highlights on grazing view angles. - */ - var SpecularFresnelMethod = (function (_super) { - __extends(SpecularFresnelMethod, _super); - /** - * Creates a new SpecularFresnelMethod object. - * @param basedOnSurface Defines whether the fresnel effect should be based on the view angle on the surface (if true), or on the angle between the light and the view. - * @param baseMethod The specular method to which the fresnel equation. Defaults to SpecularBasicMethod. - */ - function SpecularFresnelMethod(basedOnSurface, baseMethod) { - if (typeof basedOnSurface === "undefined") { basedOnSurface = true; } - if (typeof baseMethod === "undefined") { baseMethod = null; } - var _this = this; - // may want to offer diff speculars - _super.call(this, null, baseMethod); - this._fresnelPower = 5; - this._normalReflectance = .028; - - this.baseMethod._iModulateMethod = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - return _this.modulateSpecular(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); - }; - - this._incidentLight = !basedOnSurface; - } - /** - * @inheritDoc - */ - SpecularFresnelMethod.prototype.iInitConstants = function (shaderObject, methodVO) { - var index = methodVO.secondaryFragmentConstantsIndex; - shaderObject.fragmentConstantData[index + 2] = 1; - shaderObject.fragmentConstantData[index + 3] = 0; - }; - - Object.defineProperty(SpecularFresnelMethod.prototype, "basedOnSurface", { - /** - * Defines whether the fresnel effect should be based on the view angle on the surface (if true), or on the angle between the light and the view. - */ - get: function () { - return !this._incidentLight; - }, - set: function (value) { - if (this._incidentLight != value) - return; - - this._incidentLight = !value; - - this.iInvalidateShaderProgram(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(SpecularFresnelMethod.prototype, "fresnelPower", { - /** - * The power used in the Fresnel equation. Higher values make the fresnel effect more pronounced. Defaults to 5. - */ - get: function () { - return this._fresnelPower; - }, - set: function (value) { - this._fresnelPower = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - SpecularFresnelMethod.prototype.iCleanCompilationData = function () { - _super.prototype.iCleanCompilationData.call(this); - this._dataReg = null; - }; - - Object.defineProperty(SpecularFresnelMethod.prototype, "normalReflectance", { - /** - * The minimum amount of reflectance, ie the reflectance when the view direction is normal to the surface or light direction. - */ - get: function () { - return this._normalReflectance; - }, - set: function (value) { - this._normalReflectance = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - SpecularFresnelMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - _super.prototype.iActivate.call(this, shaderObject, methodVO, stage); - - var fragmentData = shaderObject.fragmentConstantData; - - var index = methodVO.secondaryFragmentConstantsIndex; - fragmentData[index] = this._normalReflectance; - fragmentData[index + 1] = this._fresnelPower; - }; - - /** - * @inheritDoc - */ - SpecularFresnelMethod.prototype.iGetFragmentPreLightingCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { - this._dataReg = registerCache.getFreeFragmentConstant(); - - console.log('SpecularFresnelMethod', 'iGetFragmentPreLightingCode', this._dataReg); - - methodVO.secondaryFragmentConstantsIndex = this._dataReg.index * 4; - - return _super.prototype.iGetFragmentPreLightingCode.call(this, shaderObject, methodVO, registerCache, sharedRegisters); - }; - - /** - * Applies the fresnel effect to the specular strength. - * - * @param vo The MethodVO object containing the method data for the currently compiled material pass. - * @param target The register containing the specular strength in the "w" component, and the half-vector/reflection vector in "xyz". - * @param regCache The register cache used for the shader compilation. - * @param sharedRegisters The shared registers created by the compiler. - * @return The AGAL fragment code for the method. - */ - SpecularFresnelMethod.prototype.modulateSpecular = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - var code; - - code = "dp3 " + targetReg + ".y, " + sharedRegisters.viewDirFragment + ".xyz, " + (this._incidentLight ? targetReg : sharedRegisters.normalFragment) + ".xyz\n" + "sub " + targetReg + ".y, " + this._dataReg + ".z, " + targetReg + ".y\n" + "pow " + targetReg + ".x, " + targetReg + ".y, " + this._dataReg + ".y\n" + "sub " + targetReg + ".y, " + this._dataReg + ".z, " + targetReg + ".y\n" + "mul " + targetReg + ".y, " + this._dataReg + ".x, " + targetReg + ".y\n" + "add " + targetReg + ".y, " + targetReg + ".x, " + targetReg + ".y\n" + "mul " + targetReg + ".w, " + targetReg + ".w, " + targetReg + ".y\n"; - - console.log('SpecularFresnelMethod', 'modulateSpecular', code); - - return code; - }; - return SpecularFresnelMethod; - })(materials.SpecularCompositeMethod); - materials.SpecularFresnelMethod = SpecularFresnelMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * SpecularPhongMethod provides a specular method that provides Phong highlights. - */ - var SpecularPhongMethod = (function (_super) { - __extends(SpecularPhongMethod, _super); - /** - * Creates a new SpecularPhongMethod object. - */ - function SpecularPhongMethod() { - _super.call(this); - } - /** - * @inheritDoc - */ - SpecularPhongMethod.prototype.iGetFragmentCodePerLight = function (shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters) { - var code = ""; - var t; - - if (this._pIsFirstLight) { - t = this._pTotalLightColorReg; - } else { - t = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(t, 1); - } - - var viewDirReg = sharedRegisters.viewDirFragment; - var normalReg = sharedRegisters.normalFragment; - - // phong model - code += "dp3 " + t + ".w, " + lightDirReg + ", " + normalReg + "\n" + "add " + t + ".w, " + t + ".w, " + t + ".w\n" + "mul " + t + ".xyz, " + normalReg + ", " + t + ".w\n" + "sub " + t + ".xyz, " + t + ", " + lightDirReg + "\n" + "add " + t + ".w, " + t + ".w, " + sharedRegisters.commons + ".w\n" + "sat " + t + ".w, " + t + ".w\n" + "mul " + t + ".xyz, " + t + ", " + t + ".w\n" + "dp3 " + t + ".w, " + t + ", " + viewDirReg + "\n" + "sat " + t + ".w, " + t + ".w\n"; - - if (this._pUseTexture) { - // apply gloss modulation from texture - code += "mul " + this._pSpecularTexData + ".w, " + this._pSpecularTexData + ".y, " + this._pSpecularDataRegister + ".w\n" + "pow " + t + ".w, " + t + ".w, " + this._pSpecularTexData + ".w\n"; - } else - code += "pow " + t + ".w, " + t + ".w, " + this._pSpecularDataRegister + ".w\n"; - - // attenuate - if (shaderObject.usesLightFallOff) - code += "mul " + t + ".w, " + t + ".w, " + lightDirReg + ".w\n"; - - if (this._iModulateMethod != null) - code += this._iModulateMethod(shaderObject, methodVO, t, registerCache, sharedRegisters); - - code += "mul " + t + ".xyz, " + lightColReg + ".xyz, " + t + ".w\n"; - - if (!this._pIsFirstLight) { - code += "add " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ".xyz, " + t + ".xyz\n"; - registerCache.removeFragmentTempUsage(t); - } - - this._pIsFirstLight = false; - - return code; - }; - return SpecularPhongMethod; - })(materials.SpecularBasicMethod); - materials.SpecularPhongMethod = SpecularPhongMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (utils) { - var PerspectiveMatrix3D = (function (_super) { - __extends(PerspectiveMatrix3D, _super); - function PerspectiveMatrix3D(v) { - if (typeof v === "undefined") { v = null; } - _super.call(this, v); - } - PerspectiveMatrix3D.prototype.perspectiveFieldOfViewLH = function (fieldOfViewY, aspectRatio, zNear, zFar) { - var yScale = 1 / Math.tan(fieldOfViewY / 2); - var xScale = yScale / aspectRatio; - this.copyRawDataFrom([xScale, 0.0, 0.0, 0.0, 0.0, yScale, 0.0, 0.0, 0.0, 0.0, zFar / (zFar - zNear), 1.0, 0.0, 0.0, (zNear * zFar) / (zNear - zFar), 0.0]); - }; - return PerspectiveMatrix3D; - })(away.geom.Matrix3D); - utils.PerspectiveMatrix3D = PerspectiveMatrix3D; - })(away.utils || (away.utils = {})); - var utils = away.utils; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * ... - */ - var AnimationSubGeometry = (function () { - function AnimationSubGeometry() { - this._pVertexBuffer = new Array(8); - this._pBufferContext = new Array(8); - this._pBufferDirty = new Array(8); - this.numProcessedVertices = 0; - this.previousTime = Number.NEGATIVE_INFINITY; - this.animationParticles = new Array(); - for (var i = 0; i < 8; i++) - this._pBufferDirty[i] = true; - - this._iUniqueId = AnimationSubGeometry.SUBGEOM_ID_COUNT++; - } - AnimationSubGeometry.prototype.createVertexData = function (numVertices /*uint*/ , totalLenOfOneVertex /*uint*/ ) { - this._numVertices = numVertices; - this._totalLenOfOneVertex = totalLenOfOneVertex; - this._pVertexData = new Array(numVertices * totalLenOfOneVertex); - }; - - AnimationSubGeometry.prototype.activateVertexBuffer = function (index /*int*/ , bufferOffset /*int*/ , stage, format) { - var contextIndex = stage.stageIndex; - var context = stage.context; - - var buffer = this._pVertexBuffer[contextIndex]; - if (!buffer || this._pBufferContext[contextIndex] != context) { - buffer = this._pVertexBuffer[contextIndex] = context.createVertexBuffer(this._numVertices, this._totalLenOfOneVertex); - this._pBufferContext[contextIndex] = context; - this._pBufferDirty[contextIndex] = true; - } - if (this._pBufferDirty[contextIndex]) { - buffer.uploadFromArray(this._pVertexData, 0, this._numVertices); - this._pBufferDirty[contextIndex] = false; - } - context.setVertexBufferAt(index, buffer, bufferOffset, format); - }; - - AnimationSubGeometry.prototype.dispose = function () { - while (this._pVertexBuffer.length) { - var vertexBuffer = this._pVertexBuffer.pop(); - - if (vertexBuffer) - vertexBuffer.dispose(); - } - }; - - AnimationSubGeometry.prototype.invalidateBuffer = function () { - for (var i = 0; i < 8; i++) - this._pBufferDirty[i] = true; - }; - - Object.defineProperty(AnimationSubGeometry.prototype, "vertexData", { - get: function () { - return this._pVertexData; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(AnimationSubGeometry.prototype, "numVertices", { - get: function () { - return this._numVertices; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(AnimationSubGeometry.prototype, "totalLenOfOneVertex", { - get: function () { - return this._totalLenOfOneVertex; - }, - enumerable: true, - configurable: true - }); - AnimationSubGeometry.SUBGEOM_ID_COUNT = 0; - return AnimationSubGeometry; - })(); - animators.AnimationSubGeometry = AnimationSubGeometry; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ColorSegmentPoint = (function () { - function ColorSegmentPoint(life, color) { - //0= 1) - throw (new Error("life exceeds range (0,1)")); - this._life = life; - this._color = color; - } - Object.defineProperty(ColorSegmentPoint.prototype, "color", { - get: function () { - return this._color; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ColorSegmentPoint.prototype, "life", { - get: function () { - return this._life; - }, - enumerable: true, - configurable: true - }); - return ColorSegmentPoint; - })(); - animators.ColorSegmentPoint = ColorSegmentPoint; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var Vector3D = away.geom.Vector3D; - var Matrix3D = away.geom.Matrix3D; - var Quaternion = away.geom.Quaternion; - - /** - * Contains transformation data for a skeleton joint, used for skeleton animation. - * - * @see away.animation.Skeleton - * @see away.animation.SkeletonJoint - * - * todo: support (uniform) scale - */ - var JointPose = (function () { - function JointPose() { - /** - * The rotation of the pose stored as a quaternion - */ - this.orientation = new Quaternion(); - /** - * The translation of the pose - */ - this.translation = new Vector3D(); - } - /** - * Converts the transformation to a Matrix3D representation. - * - * @param target An optional target matrix to store the transformation. If not provided, it will create a new instance. - * @return The transformation matrix of the pose. - */ - JointPose.prototype.toMatrix3D = function (target) { - if (typeof target === "undefined") { target = null; } - if (target == null) - target = new Matrix3D(); - - this.orientation.toMatrix3D(target); - target.appendTranslation(this.translation.x, this.translation.y, this.translation.z); - return target; - }; - - /** - * Copies the transformation data from a source pose object into the existing pose object. - * - * @param pose The source pose to copy from. - */ - JointPose.prototype.copyFrom = function (pose) { - var or = pose.orientation; - var tr = pose.translation; - this.orientation.x = or.x; - this.orientation.y = or.y; - this.orientation.z = or.z; - this.orientation.w = or.w; - this.translation.x = tr.x; - this.translation.y = tr.y; - this.translation.z = tr.z; - }; - return JointPose; - })(); - animators.JointPose = JointPose; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * ... - */ - var ParticleAnimationData = (function () { - function ParticleAnimationData(index /*uint*/ , startTime, duration, delay, particle) { - this.index = index; - this.startTime = startTime; - this.totalTime = duration + delay; - this.duration = duration; - this.delay = delay; - this.startVertexIndex = particle.startVertexIndex; - this.numVertices = particle.numVertices; - } - return ParticleAnimationData; - })(); - animators.ParticleAnimationData = ParticleAnimationData; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ParticleData = (function () { - function ParticleData() { - } - return ParticleData; - })(); - animators.ParticleData = ParticleData; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * Dynamic class for holding the local properties of a particle, used for processing the static properties - * of particles in the particle animation set before beginning upload to the GPU. - */ - var ParticleProperties = (function () { - function ParticleProperties() { - } - return ParticleProperties; - })(); - animators.ParticleProperties = ParticleProperties; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * Options for setting the properties mode of a particle animation node. - */ - var ParticlePropertiesMode = (function () { - function ParticlePropertiesMode() { - } - ParticlePropertiesMode.GLOBAL = 0; - - ParticlePropertiesMode.LOCAL_STATIC = 1; - - ParticlePropertiesMode.LOCAL_DYNAMIC = 2; - return ParticlePropertiesMode; - })(); - animators.ParticlePropertiesMode = ParticlePropertiesMode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var AssetType = away.library.AssetType; - - /** - * A Skeleton object is a hierarchical grouping of joint objects that can be used for skeletal animation. - * - * @see away.animators.SkeletonJoint - */ - var Skeleton = (function (_super) { - __extends(Skeleton, _super); - /** - * Creates a new Skeleton object - */ - function Skeleton() { - _super.call(this); - - // in the long run, it might be a better idea to not store Joint objects, but keep all data in Vectors, that we can upload easily? - this.joints = new Array(); - } - Object.defineProperty(Skeleton.prototype, "numJoints", { - /** - * The total number of joints in the skeleton. - */ - get: function () { - return this.joints.length; - }, - enumerable: true, - configurable: true - }); - - /** - * Returns the joint object in the skeleton with the given name, otherwise returns a null object. - * - * @param jointName The name of the joint object to be found. - * @return The joint object with the given name. - * - * @see #joints - */ - Skeleton.prototype.jointFromName = function (jointName) { - var jointIndex = this.jointIndexFromName(jointName); - if (jointIndex != -1) - return this.joints[jointIndex]; - else - return null; - }; - - /** - * Returns the joint index, given the joint name. -1 is returned if the joint name is not found. - * - * @param jointName The name of the joint object to be found. - * @return The index of the joint object in the joints Array - * - * @see #joints - */ - Skeleton.prototype.jointIndexFromName = function (jointName) { - // this is implemented as a linear search, rather than a possibly - // more optimal method (Dictionary lookup, for example) because: - // a) it is assumed that it will be called once for each joint - // b) it is assumed that it will be called only during load, and not during main loop - // c) maintaining a dictionary (for safety) would dictate an interface to access SkeletonJoints, - // rather than direct array access. this would be sub-optimal. - var jointIndex; - var joint; - for (var i; i < this.joints.length; i++) { - joint = this.joints[i]; - if (joint.name == jointName) - return jointIndex; - jointIndex++; - } - - return -1; - }; - - /** - * @inheritDoc - */ - Skeleton.prototype.dispose = function () { - this.joints.length = 0; - }; - - Object.defineProperty(Skeleton.prototype, "assetType", { - /** - * @inheritDoc - */ - get: function () { - return AssetType.SKELETON; - }, - enumerable: true, - configurable: true - }); - return Skeleton; - })(away.library.NamedAssetBase); - animators.Skeleton = Skeleton; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * Options for setting the animation mode of a vertex animator object. - * - * @see away.animators.VertexAnimator - */ - var VertexAnimationMode = (function () { - function VertexAnimationMode() { - } - VertexAnimationMode.ADDITIVE = "additive"; - - VertexAnimationMode.ABSOLUTE = "absolute"; - return VertexAnimationMode; - })(); - animators.VertexAnimationMode = VertexAnimationMode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * A value obect representing a single joint in a skeleton object. - * - * @see away.animators.Skeleton - */ - var SkeletonJoint = (function () { - /** - * Creates a new SkeletonJoint object - */ - function SkeletonJoint() { - /** - * The index of the parent joint in the skeleton's joints vector. - * - * @see away.animators.Skeleton#joints - */ - this.parentIndex = -1; - } - return SkeletonJoint; - })(); - animators.SkeletonJoint = SkeletonJoint; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var AssetType = away.library.AssetType; - - /** - * A collection of pose objects, determining the pose for an entire skeleton. - * The jointPoses vector object corresponds to a skeleton's joints vector object, however, there is no - * reference to a skeleton's instance, since several skeletons can be influenced by the same pose (eg: animation - * clips are added to any animator with a valid skeleton) - * - * @see away.animators.Skeleton - * @see away.animators.JointPose - */ - var SkeletonPose = (function (_super) { - __extends(SkeletonPose, _super); - /** - * Creates a new SkeletonPose object. - */ - function SkeletonPose() { - _super.call(this); - - this.jointPoses = new Array(); - } - Object.defineProperty(SkeletonPose.prototype, "numJointPoses", { - /** - * The total number of joint poses in the skeleton pose. - */ - get: function () { - return this.jointPoses.length; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(SkeletonPose.prototype, "assetType", { - /** - * @inheritDoc - */ - get: function () { - return AssetType.SKELETON_POSE; - }, - enumerable: true, - configurable: true - }); - - /** - * Returns the joint pose object with the given joint name, otherwise returns a null object. - * - * @param jointName The name of the joint object whose pose is to be found. - * @return The pose object with the given joint name. - */ - SkeletonPose.prototype.jointPoseFromName = function (jointName) { - var jointPoseIndex = this.jointPoseIndexFromName(jointName); - if (jointPoseIndex != -1) - return this.jointPoses[jointPoseIndex]; - else - return null; - }; - - /** - * Returns the pose index, given the joint name. -1 is returned if the joint name is not found in the pose. - * - * @param The name of the joint object whose pose is to be found. - * @return The index of the pose object in the jointPoses Array - * - * @see #jointPoses - */ - SkeletonPose.prototype.jointPoseIndexFromName = function (jointName) { - // this is implemented as a linear search, rather than a possibly - // more optimal method (Dictionary lookup, for example) because: - // a) it is assumed that it will be called once for each joint - // b) it is assumed that it will be called only during load, and not during main loop - // c) maintaining a dictionary (for safety) would dictate an interface to access JointPoses, - // rather than direct array access. this would be sub-optimal. - var jointPoseIndex; - var jointPose; - for (var i; i < this.jointPoses.length; i++) { - jointPose = this.jointPoses[i]; - if (jointPose.name == jointName) - return jointPoseIndex; - jointPoseIndex++; - } - - return -1; - }; - - /** - * Creates a copy of the SkeletonPose object, with a dulpicate of its component joint poses. - * - * @return SkeletonPose - */ - SkeletonPose.prototype.clone = function () { - var clone = new SkeletonPose(); - var numJointPoses = this.jointPoses.length; - for (var i = 0; i < numJointPoses; i++) { - var cloneJointPose = new animators.JointPose(); - var thisJointPose = this.jointPoses[i]; - cloneJointPose.name = thisJointPose.name; - cloneJointPose.copyFrom(thisJointPose); - clone.jointPoses[i] = cloneJointPose; - } - return clone; - }; - - /** - * @inheritDoc - */ - SkeletonPose.prototype.dispose = function () { - this.jointPoses.length = 0; - }; - return SkeletonPose; - })(away.library.NamedAssetBase); - animators.SkeletonPose = SkeletonPose; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * Provides an abstract base class for nodes with time-based animation data in an animation blend tree. - */ - var AnimationClipNodeBase = (function (_super) { - __extends(AnimationClipNodeBase, _super); - /** - * Creates a new AnimationClipNodeBase object. - */ - function AnimationClipNodeBase() { - _super.call(this); - this._pLooping = true; - this._pTotalDuration = 0; - this._pStitchDirty = true; - this._pStitchFinalFrame = false; - this._pNumFrames = 0; - this._pDurations = new Array(); - /*uint*/ - this._pTotalDelta = new away.geom.Vector3D(); - this.fixedFrameRate = true; - } - Object.defineProperty(AnimationClipNodeBase.prototype, "looping", { - /** - * Determines whether the contents of the animation node have looping characteristics enabled. - */ - get: function () { - return this._pLooping; - }, - set: function (value) { - if (this._pLooping == value) - return; - - this._pLooping = value; - - this._pStitchDirty = true; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(AnimationClipNodeBase.prototype, "stitchFinalFrame", { - /** - * Defines if looping content blends the final frame of animation data with the first (true) or works on the - * assumption that both first and last frames are identical (false). Defaults to false. - */ - get: function () { - return this._pStitchFinalFrame; - }, - set: function (value) { - if (this._pStitchFinalFrame == value) - return; - - this._pStitchFinalFrame = value; - - this._pStitchDirty = true; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(AnimationClipNodeBase.prototype, "totalDuration", { - get: function () { - if (this._pStitchDirty) - this._pUpdateStitch(); - - return this._pTotalDuration; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(AnimationClipNodeBase.prototype, "totalDelta", { - get: function () { - if (this._pStitchDirty) - this._pUpdateStitch(); - - return this._pTotalDelta; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(AnimationClipNodeBase.prototype, "lastFrame", { - get: function () { - if (this._pStitchDirty) - this._pUpdateStitch(); - - return this._pLastFrame; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(AnimationClipNodeBase.prototype, "durations", { - /** - * Returns a vector of time values representing the duration (in milliseconds) of each animation frame in the clip. - */ - get: function () { - return this._pDurations; - }, - enumerable: true, - configurable: true - }); - - /** - * Updates the node's final frame stitch state. - * - * @see #stitchFinalFrame - */ - AnimationClipNodeBase.prototype._pUpdateStitch = function () { - this._pStitchDirty = false; - - this._pLastFrame = (this._pStitchFinalFrame) ? this._pNumFrames : this._pNumFrames - 1; - - this._pTotalDuration = 0; - this._pTotalDelta.x = 0; - this._pTotalDelta.y = 0; - this._pTotalDelta.z = 0; - }; - return AnimationClipNodeBase; - })(animators.AnimationNodeBase); - animators.AnimationClipNodeBase = AnimationClipNodeBase; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * Provides an abstract base class for particle animation nodes. - */ - var ParticleNodeBase = (function (_super) { - __extends(ParticleNodeBase, _super); - /** - * Creates a new ParticleNodeBase object. - * - * @param name Defines the generic name of the particle animation node. - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param dataLength Defines the length of the data used by the node when in LOCAL_STATIC mode. - * @param [optional] priority the priority of the particle animation node, used to order the agal generated in a particle animation set. Defaults to 1. - */ - function ParticleNodeBase(name, mode /*uint*/ , dataLength /*uint*/ , priority) { - if (typeof priority === "undefined") { priority = 1; } - _super.call(this); - this._pDataLength = 3; - - name = name + ParticleNodeBase.MODES[mode]; - - this.name = name; - this._pMode = mode; - this._priority = priority; - this._pDataLength = dataLength; - - this._pOneData = new Array(this._pDataLength); - } - Object.defineProperty(ParticleNodeBase.prototype, "mode", { - /** - * Returns the property mode of the particle animation node. Typically set in the node constructor - * - * @see away.animators.ParticlePropertiesMode - */ - get: function () { - return this._pMode; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ParticleNodeBase.prototype, "priority", { - /** - * Returns the priority of the particle animation node, used to order the agal generated in a particle animation set. Set automatically on instantiation. - * - * @see away.animators.ParticleAnimationSet - * @see #getAGALVertexCode - */ - get: function () { - return this._priority; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ParticleNodeBase.prototype, "dataLength", { - /** - * Returns the length of the data used by the node when in LOCAL_STATIC mode. Used to generate the local static data of the particle animation set. - * - * @see away.animators.ParticleAnimationSet - * @see #getAGALVertexCode - */ - get: function () { - return this._pDataLength; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ParticleNodeBase.prototype, "oneData", { - /** - * Returns the generated data vector of the node after one particle pass during the generation of all local static data of the particle animation set. - * - * @see away.animators.ParticleAnimationSet - * @see #generatePropertyOfOneParticle - */ - get: function () { - return this._pOneData; - }, - enumerable: true, - configurable: true - }); - - /** - * Returns the AGAL code of the particle animation node for use in the vertex shader. - */ - ParticleNodeBase.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { - return ""; - }; - - /** - * Returns the AGAL code of the particle animation node for use in the fragment shader. - */ - ParticleNodeBase.prototype.getAGALFragmentCode = function (shaderObject, animationRegisterCache) { - return ""; - }; - - /** - * Returns the AGAL code of the particle animation node for use in the fragment shader when UV coordinates are required. - */ - ParticleNodeBase.prototype.getAGALUVCode = function (shaderObject, animationRegisterCache) { - return ""; - }; - - /** - * Called internally by the particle animation set when assigning the set of static properties originally defined by the initParticleFunc of the set. - * - * @see away.animators.ParticleAnimationSet#initParticleFunc - */ - ParticleNodeBase.prototype._iGeneratePropertyOfOneParticle = function (param) { - }; - - /** - * Called internally by the particle animation set when determining the requirements of the particle animation node AGAL. - */ - ParticleNodeBase.prototype._iProcessAnimationSetting = function (particleAnimationSet) { - }; - ParticleNodeBase.GLOBAL = 'Global'; - ParticleNodeBase.LOCAL_STATIC = 'LocalStatic'; - ParticleNodeBase.LOCAL_DYNAMIC = 'LocalDynamic'; - - ParticleNodeBase.MODES = { - 0: ParticleNodeBase.GLOBAL, - 1: ParticleNodeBase.LOCAL_STATIC, - 2: ParticleNodeBase.LOCAL_DYNAMIC - }; - return ParticleNodeBase; - })(animators.AnimationNodeBase); - animators.ParticleNodeBase = ParticleNodeBase; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var Vector3D = away.geom.Vector3D; - - /** - * A particle animation node used to apply a constant acceleration vector to the motion of a particle. - */ - var ParticleAccelerationNode = (function (_super) { - __extends(ParticleAccelerationNode, _super); - /** - * Creates a new ParticleAccelerationNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] acceleration Defines the default acceleration vector of the node, used when in global mode. - */ - function ParticleAccelerationNode(mode /*uint*/ , acceleration) { - if (typeof acceleration === "undefined") { acceleration = null; } - _super.call(this, "ParticleAcceleration", mode, 3); - - this._pStateClass = animators.ParticleAccelerationState; - - this._acceleration = acceleration || new Vector3D(); - } - /** - * @inheritDoc - */ - ParticleAccelerationNode.prototype.pGetAGALVertexCode = function (shaderObject, animationRegisterCache) { - var accelerationValue = (this._pMode == animators.ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleAccelerationNode.ACCELERATION_INDEX, accelerationValue.index); - - var temp = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(temp, 1); - - var code = "mul " + temp + "," + animationRegisterCache.vertexTime + "," + accelerationValue + "\n"; - - if (animationRegisterCache.needVelocity) { - var temp2 = animationRegisterCache.getFreeVertexVectorTemp(); - code += "mul " + temp2 + "," + temp + "," + animationRegisterCache.vertexTwoConst + "\n"; - code += "add " + animationRegisterCache.velocityTarget + ".xyz," + temp2 + ".xyz," + animationRegisterCache.velocityTarget + ".xyz\n"; - } - animationRegisterCache.removeVertexTempUsage(temp); - - code += "mul " + temp + "," + temp + "," + animationRegisterCache.vertexTime + "\n"; - code += "add " + animationRegisterCache.positionTarget + ".xyz," + temp + "," + animationRegisterCache.positionTarget + ".xyz\n"; - return code; - }; - - /** - * @inheritDoc - */ - ParticleAccelerationNode.prototype.getAnimationState = function (animator) { - return animator.getAnimationState(this); - }; - - /** - * @inheritDoc - */ - ParticleAccelerationNode.prototype._iGeneratePropertyOfOneParticle = function (param) { - var tempAcceleration = param[ParticleAccelerationNode.ACCELERATION_VECTOR3D]; - if (!tempAcceleration) - throw new Error("there is no " + ParticleAccelerationNode.ACCELERATION_VECTOR3D + " in param!"); - - this._pOneData[0] = tempAcceleration.x / 2; - this._pOneData[1] = tempAcceleration.y / 2; - this._pOneData[2] = tempAcceleration.z / 2; - }; - ParticleAccelerationNode.ACCELERATION_INDEX = 0; - - ParticleAccelerationNode.ACCELERATION_VECTOR3D = "AccelerationVector3D"; - return ParticleAccelerationNode; - })(animators.ParticleNodeBase); - animators.ParticleAccelerationNode = ParticleAccelerationNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var Vector3D = away.geom.Vector3D; - - var ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used to control the position of a particle over time along a bezier curve. - */ - var ParticleBezierCurveNode = (function (_super) { - __extends(ParticleBezierCurveNode, _super); - /** - * Creates a new ParticleBezierCurveNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] controlPoint Defines the default control point of the node, used when in global mode. - * @param [optional] endPoint Defines the default end point of the node, used when in global mode. - */ - function ParticleBezierCurveNode(mode /*uint*/ , controlPoint, endPoint) { - if (typeof controlPoint === "undefined") { controlPoint = null; } - if (typeof endPoint === "undefined") { endPoint = null; } - _super.call(this, "ParticleBezierCurve", mode, 6); - - this._pStateClass = animators.ParticleBezierCurveState; - - this._iControlPoint = controlPoint || new Vector3D(); - this._iEndPoint = endPoint || new Vector3D(); - } - /** - * @inheritDoc - */ - ParticleBezierCurveNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { - var controlValue = (this._pMode == animators.ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleBezierCurveNode.BEZIER_CONTROL_INDEX, controlValue.index); - - var endValue = (this._pMode == animators.ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleBezierCurveNode.BEZIER_END_INDEX, endValue.index); - - var temp = animationRegisterCache.getFreeVertexVectorTemp(); - var rev_time = new ShaderRegisterElement(temp.regName, temp.index, 0); - var time_2 = new ShaderRegisterElement(temp.regName, temp.index, 1); - var time_temp = new ShaderRegisterElement(temp.regName, temp.index, 2); - animationRegisterCache.addVertexTempUsages(temp, 1); - var temp2 = animationRegisterCache.getFreeVertexVectorTemp(); - var distance = new ShaderRegisterElement(temp2.regName, temp2.index); - animationRegisterCache.removeVertexTempUsage(temp); - - var code = ""; - code += "sub " + rev_time + "," + animationRegisterCache.vertexOneConst + "," + animationRegisterCache.vertexLife + "\n"; - code += "mul " + time_2 + "," + animationRegisterCache.vertexLife + "," + animationRegisterCache.vertexLife + "\n"; - - code += "mul " + time_temp + "," + animationRegisterCache.vertexLife + "," + rev_time + "\n"; - code += "mul " + time_temp + "," + time_temp + "," + animationRegisterCache.vertexTwoConst + "\n"; - code += "mul " + distance + ".xyz," + time_temp + "," + controlValue + "\n"; - code += "add " + animationRegisterCache.positionTarget + ".xyz," + distance + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; - code += "mul " + distance + ".xyz," + time_2 + "," + endValue + "\n"; - code += "add " + animationRegisterCache.positionTarget + ".xyz," + distance + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; - - if (animationRegisterCache.needVelocity) { - code += "mul " + time_2 + "," + animationRegisterCache.vertexLife + "," + animationRegisterCache.vertexTwoConst + "\n"; - code += "sub " + time_temp + "," + animationRegisterCache.vertexOneConst + "," + time_2 + "\n"; - code += "mul " + time_temp + "," + animationRegisterCache.vertexTwoConst + "," + time_temp + "\n"; - code += "mul " + distance + ".xyz," + controlValue + "," + time_temp + "\n"; - code += "add " + animationRegisterCache.velocityTarget + ".xyz," + distance + ".xyz," + animationRegisterCache.velocityTarget + ".xyz\n"; - code += "mul " + distance + ".xyz," + endValue + "," + time_2 + "\n"; - code += "add " + animationRegisterCache.velocityTarget + ".xyz," + distance + ".xyz," + animationRegisterCache.velocityTarget + ".xyz\n"; - } - - return code; - }; - - /** - * @inheritDoc - */ - ParticleBezierCurveNode.prototype.getAnimationState = function (animator) { - return animator.getAnimationState(this); - }; - - /** - * @inheritDoc - */ - ParticleBezierCurveNode.prototype._iGeneratePropertyOfOneParticle = function (param) { - var bezierControl = param[ParticleBezierCurveNode.BEZIER_CONTROL_VECTOR3D]; - if (!bezierControl) - throw new Error("there is no " + ParticleBezierCurveNode.BEZIER_CONTROL_VECTOR3D + " in param!"); - - var bezierEnd = param[ParticleBezierCurveNode.BEZIER_END_VECTOR3D]; - if (!bezierEnd) - throw new Error("there is no " + ParticleBezierCurveNode.BEZIER_END_VECTOR3D + " in param!"); - - this._pOneData[0] = bezierControl.x; - this._pOneData[1] = bezierControl.y; - this._pOneData[2] = bezierControl.z; - this._pOneData[3] = bezierEnd.x; - this._pOneData[4] = bezierEnd.y; - this._pOneData[5] = bezierEnd.z; - }; - ParticleBezierCurveNode.BEZIER_CONTROL_INDEX = 0; - - ParticleBezierCurveNode.BEZIER_END_INDEX = 1; - - ParticleBezierCurveNode.BEZIER_CONTROL_VECTOR3D = "BezierControlVector3D"; - - ParticleBezierCurveNode.BEZIER_END_VECTOR3D = "BezierEndVector3D"; - return ParticleBezierCurveNode; - })(animators.ParticleNodeBase); - animators.ParticleBezierCurveNode = ParticleBezierCurveNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * A particle animation node that controls the rotation of a particle to always face the camera. - */ - var ParticleBillboardNode = (function (_super) { - __extends(ParticleBillboardNode, _super); - /** - * Creates a new ParticleBillboardNode - */ - function ParticleBillboardNode(billboardAxis) { - if (typeof billboardAxis === "undefined") { billboardAxis = null; } - _super.call(this, "ParticleBillboard", animators.ParticlePropertiesMode.GLOBAL, 0, 4); - - this._pStateClass = animators.ParticleBillboardState; - - this._iBillboardAxis = billboardAxis; - } - /** - * @inheritDoc - */ - ParticleBillboardNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { - var rotationMatrixRegister = animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.setRegisterIndex(this, ParticleBillboardNode.MATRIX_INDEX, rotationMatrixRegister.index); - animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.getFreeVertexConstant(); - - var temp = animationRegisterCache.getFreeVertexVectorTemp(); - - var code = "m33 " + temp + ".xyz," + animationRegisterCache.scaleAndRotateTarget + "," + rotationMatrixRegister + "\n" + "mov " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp + "\n"; - - var shaderRegisterElement; - for (var i = 0; i < animationRegisterCache.rotationRegisters.length; i++) { - shaderRegisterElement = animationRegisterCache.rotationRegisters[i]; - code += "m33 " + temp + ".xyz," + shaderRegisterElement + "," + rotationMatrixRegister + "\n" + "mov " + shaderRegisterElement + ".xyz," + shaderRegisterElement + "\n"; - } - - return code; - }; - - /** - * @inheritDoc - */ - ParticleBillboardNode.prototype.getAnimationState = function (animator) { - return animator.getAnimationState(this); - }; - - /** - * @inheritDoc - */ - ParticleBillboardNode.prototype._iProcessAnimationSetting = function (particleAnimationSet) { - particleAnimationSet.hasBillboard = true; - }; - ParticleBillboardNode.MATRIX_INDEX = 0; - return ParticleBillboardNode; - })(animators.ParticleNodeBase); - animators.ParticleBillboardNode = ParticleBillboardNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ColorTransform = away.geom.ColorTransform; - - /** - * A particle animation node used to control the color variation of a particle over time. - */ - var ParticleColorNode = (function (_super) { - __extends(ParticleColorNode, _super); - /** - * Creates a new ParticleColorNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] usesMultiplier Defines whether the node uses multiplier data in the shader for its color transformations. Defaults to true. - * @param [optional] usesOffset Defines whether the node uses offset data in the shader for its color transformations. Defaults to true. - * @param [optional] usesCycle Defines whether the node uses the cycleDuration property in the shader to calculate the period of the animation independent of particle duration. Defaults to false. - * @param [optional] usesPhase Defines whether the node uses the cyclePhase property in the shader to calculate a starting offset to the cycle rotation of the particle. Defaults to false. - * @param [optional] startColor Defines the default start color transform of the node, when in global mode. - * @param [optional] endColor Defines the default end color transform of the node, when in global mode. - * @param [optional] cycleDuration Defines the duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. - * @param [optional] cyclePhase Defines the phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. - */ - function ParticleColorNode(mode /*uint*/ , usesMultiplier, usesOffset, usesCycle, usesPhase, startColor, endColor, cycleDuration, cyclePhase) { - if (typeof usesMultiplier === "undefined") { usesMultiplier = true; } - if (typeof usesOffset === "undefined") { usesOffset = true; } - if (typeof usesCycle === "undefined") { usesCycle = false; } - if (typeof usesPhase === "undefined") { usesPhase = false; } - if (typeof startColor === "undefined") { startColor = null; } - if (typeof endColor === "undefined") { endColor = null; } - if (typeof cycleDuration === "undefined") { cycleDuration = 1; } - if (typeof cyclePhase === "undefined") { cyclePhase = 0; } - _super.call(this, "ParticleColor", mode, (usesMultiplier && usesOffset) ? 16 : 8, animators.ParticleAnimationSet.COLOR_PRIORITY); - - this._pStateClass = animators.ParticleColorState; - - this._iUsesMultiplier = usesMultiplier; - this._iUsesOffset = usesOffset; - this._iUsesCycle = usesCycle; - this._iUsesPhase = usesPhase; - - this._iStartColor = startColor || new ColorTransform(); - this._iEndColor = endColor || new ColorTransform(); - this._iCycleDuration = cycleDuration; - this._iCyclePhase = cyclePhase; - } - /** - * @inheritDoc - */ - ParticleColorNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { - var code = ""; - if (animationRegisterCache.needFragmentAnimation) { - var temp = animationRegisterCache.getFreeVertexVectorTemp(); - - if (this._iUsesCycle) { - var cycleConst = animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.setRegisterIndex(this, ParticleColorNode.CYCLE_INDEX, cycleConst.index); - - animationRegisterCache.addVertexTempUsages(temp, 1); - var sin = animationRegisterCache.getFreeVertexSingleTemp(); - animationRegisterCache.removeVertexTempUsage(temp); - - code += "mul " + sin + "," + animationRegisterCache.vertexTime + "," + cycleConst + ".x\n"; - - if (this._iUsesPhase) - code += "add " + sin + "," + sin + "," + cycleConst + ".y\n"; - - code += "sin " + sin + "," + sin + "\n"; - } - - if (this._iUsesMultiplier) { - var startMultiplierValue = (this._pMode == animators.ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - var deltaMultiplierValue = (this._pMode == animators.ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - - animationRegisterCache.setRegisterIndex(this, ParticleColorNode.START_MULTIPLIER_INDEX, startMultiplierValue.index); - animationRegisterCache.setRegisterIndex(this, ParticleColorNode.DELTA_MULTIPLIER_INDEX, deltaMultiplierValue.index); - - code += "mul " + temp + "," + deltaMultiplierValue + "," + (this._iUsesCycle ? sin : animationRegisterCache.vertexLife) + "\n"; - code += "add " + temp + "," + temp + "," + startMultiplierValue + "\n"; - code += "mul " + animationRegisterCache.colorMulTarget + "," + temp + "," + animationRegisterCache.colorMulTarget + "\n"; - } - - if (this._iUsesOffset) { - var startOffsetValue = (this._pMode == animators.ParticlePropertiesMode.LOCAL_STATIC) ? animationRegisterCache.getFreeVertexAttribute() : animationRegisterCache.getFreeVertexConstant(); - var deltaOffsetValue = (this._pMode == animators.ParticlePropertiesMode.LOCAL_STATIC) ? animationRegisterCache.getFreeVertexAttribute() : animationRegisterCache.getFreeVertexConstant(); - - animationRegisterCache.setRegisterIndex(this, ParticleColorNode.START_OFFSET_INDEX, startOffsetValue.index); - animationRegisterCache.setRegisterIndex(this, ParticleColorNode.DELTA_OFFSET_INDEX, deltaOffsetValue.index); - - code += "mul " + temp + "," + deltaOffsetValue + "," + (this._iUsesCycle ? sin : animationRegisterCache.vertexLife) + "\n"; - code += "add " + temp + "," + temp + "," + startOffsetValue + "\n"; - code += "add " + animationRegisterCache.colorAddTarget + "," + temp + "," + animationRegisterCache.colorAddTarget + "\n"; - } - } - - return code; - }; - - /** - * @inheritDoc - */ - ParticleColorNode.prototype.getAnimationState = function (animator) { - return animator.getAnimationState(this); - }; - - /** - * @inheritDoc - */ - ParticleColorNode.prototype._iProcessAnimationSetting = function (particleAnimationSet) { - if (this._iUsesMultiplier) - particleAnimationSet.hasColorMulNode = true; - if (this._iUsesOffset) - particleAnimationSet.hasColorAddNode = true; - }; - - /** - * @inheritDoc - */ - ParticleColorNode.prototype._iGeneratePropertyOfOneParticle = function (param) { - var startColor = param[ParticleColorNode.COLOR_START_COLORTRANSFORM]; - if (!startColor) - throw (new Error("there is no " + ParticleColorNode.COLOR_START_COLORTRANSFORM + " in param!")); - - var endColor = param[ParticleColorNode.COLOR_END_COLORTRANSFORM]; - if (!endColor) - throw (new Error("there is no " + ParticleColorNode.COLOR_END_COLORTRANSFORM + " in param!")); - - var i = 0; - - if (!this._iUsesCycle) { - //multiplier - if (this._iUsesMultiplier) { - this._pOneData[i++] = startColor.redMultiplier; - this._pOneData[i++] = startColor.greenMultiplier; - this._pOneData[i++] = startColor.blueMultiplier; - this._pOneData[i++] = startColor.alphaMultiplier; - this._pOneData[i++] = endColor.redMultiplier - startColor.redMultiplier; - this._pOneData[i++] = endColor.greenMultiplier - startColor.greenMultiplier; - this._pOneData[i++] = endColor.blueMultiplier - startColor.blueMultiplier; - this._pOneData[i++] = endColor.alphaMultiplier - startColor.alphaMultiplier; - } - - //offset - if (this._iUsesOffset) { - this._pOneData[i++] = startColor.redOffset / 255; - this._pOneData[i++] = startColor.greenOffset / 255; - this._pOneData[i++] = startColor.blueOffset / 255; - this._pOneData[i++] = startColor.alphaOffset / 255; - this._pOneData[i++] = (endColor.redOffset - startColor.redOffset) / 255; - this._pOneData[i++] = (endColor.greenOffset - startColor.greenOffset) / 255; - this._pOneData[i++] = (endColor.blueOffset - startColor.blueOffset) / 255; - this._pOneData[i++] = (endColor.alphaOffset - startColor.alphaOffset) / 255; - } - } else { - //multiplier - if (this._iUsesMultiplier) { - this._pOneData[i++] = (startColor.redMultiplier + endColor.redMultiplier) / 2; - this._pOneData[i++] = (startColor.greenMultiplier + endColor.greenMultiplier) / 2; - this._pOneData[i++] = (startColor.blueMultiplier + endColor.blueMultiplier) / 2; - this._pOneData[i++] = (startColor.alphaMultiplier + endColor.alphaMultiplier) / 2; - this._pOneData[i++] = (startColor.redMultiplier - endColor.redMultiplier) / 2; - this._pOneData[i++] = (startColor.greenMultiplier - endColor.greenMultiplier) / 2; - this._pOneData[i++] = (startColor.blueMultiplier - endColor.blueMultiplier) / 2; - this._pOneData[i++] = (startColor.alphaMultiplier - endColor.alphaMultiplier) / 2; - } - - //offset - if (this._iUsesOffset) { - this._pOneData[i++] = (startColor.redOffset + endColor.redOffset) / (255 * 2); - this._pOneData[i++] = (startColor.greenOffset + endColor.greenOffset) / (255 * 2); - this._pOneData[i++] = (startColor.blueOffset + endColor.blueOffset) / (255 * 2); - this._pOneData[i++] = (startColor.alphaOffset + endColor.alphaOffset) / (255 * 2); - this._pOneData[i++] = (startColor.redOffset - endColor.redOffset) / (255 * 2); - this._pOneData[i++] = (startColor.greenOffset - endColor.greenOffset) / (255 * 2); - this._pOneData[i++] = (startColor.blueOffset - endColor.blueOffset) / (255 * 2); - this._pOneData[i++] = (startColor.alphaOffset - endColor.alphaOffset) / (255 * 2); - } - } - }; - ParticleColorNode.START_MULTIPLIER_INDEX = 0; - - ParticleColorNode.DELTA_MULTIPLIER_INDEX = 1; - - ParticleColorNode.START_OFFSET_INDEX = 2; - - ParticleColorNode.DELTA_OFFSET_INDEX = 3; - - ParticleColorNode.CYCLE_INDEX = 4; - - ParticleColorNode.COLOR_START_COLORTRANSFORM = "ColorStartColorTransform"; - - ParticleColorNode.COLOR_END_COLORTRANSFORM = "ColorEndColorTransform"; - return ParticleColorNode; - })(animators.ParticleNodeBase); - animators.ParticleColorNode = ParticleColorNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * A particle animation node used to create a follow behaviour on a particle system. - */ - var ParticleFollowNode = (function (_super) { - __extends(ParticleFollowNode, _super); - /** - * Creates a new ParticleFollowNode - * - * @param [optional] usesPosition Defines wehether the individual particle reacts to the position of the target. - * @param [optional] usesRotation Defines wehether the individual particle reacts to the rotation of the target. - * @param [optional] smooth Defines wehether the state calculate the interpolated value. - */ - function ParticleFollowNode(usesPosition, usesRotation, smooth) { - if (typeof usesPosition === "undefined") { usesPosition = true; } - if (typeof usesRotation === "undefined") { usesRotation = true; } - if (typeof smooth === "undefined") { smooth = false; } - _super.call(this, "ParticleFollow", animators.ParticlePropertiesMode.LOCAL_DYNAMIC, (usesPosition && usesRotation) ? 6 : 3, animators.ParticleAnimationSet.POST_PRIORITY); - - this._pStateClass = animators.ParticleFollowState; - - this._iUsesPosition = usesPosition; - this._iUsesRotation = usesRotation; - this._iSmooth = smooth; - } - /** - * @inheritDoc - */ - ParticleFollowNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { - //TODO: use Quaternion to implement this function - var code = ""; - if (this._iUsesRotation) { - var rotationAttribute = animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleFollowNode.FOLLOW_ROTATION_INDEX, rotationAttribute.index); - - var temp1 = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(temp1, 1); - var temp2 = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(temp2, 1); - var temp3 = animationRegisterCache.getFreeVertexVectorTemp(); - - var temp4; - if (animationRegisterCache.hasBillboard) { - animationRegisterCache.addVertexTempUsages(temp3, 1); - temp4 = animationRegisterCache.getFreeVertexVectorTemp(); - } - - animationRegisterCache.removeVertexTempUsage(temp1); - animationRegisterCache.removeVertexTempUsage(temp2); - if (animationRegisterCache.hasBillboard) - animationRegisterCache.removeVertexTempUsage(temp3); - - var len = animationRegisterCache.rotationRegisters.length; - var i; - - //x axis - code += "mov " + temp1 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp1 + ".x," + animationRegisterCache.vertexOneConst + "\n"; - code += "mov " + temp3 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "sin " + temp3 + ".y," + rotationAttribute + ".x\n"; - code += "cos " + temp3 + ".z," + rotationAttribute + ".x\n"; - code += "mov " + temp2 + ".x," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp2 + ".y," + temp3 + ".z\n"; - code += "neg " + temp2 + ".z," + temp3 + ".y\n"; - - if (animationRegisterCache.hasBillboard) - code += "m33 " + temp4 + ".xyz," + animationRegisterCache.positionTarget + ".xyz," + temp1 + "\n"; - else { - code += "m33 " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp1 + "\n"; - for (i = 0; i < len; i++) - code += "m33 " + animationRegisterCache.rotationRegisters[i] + ".xyz," + animationRegisterCache.rotationRegisters[i] + "," + temp1 + "\n"; - } - - //y axis - code += "mov " + temp1 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "cos " + temp1 + ".x," + rotationAttribute + ".y\n"; - code += "sin " + temp1 + ".z," + rotationAttribute + ".y\n"; - code += "mov " + temp2 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp2 + ".y," + animationRegisterCache.vertexOneConst + "\n"; - code += "mov " + temp3 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "neg " + temp3 + ".x," + temp1 + ".z\n"; - code += "mov " + temp3 + ".z," + temp1 + ".x\n"; - - if (animationRegisterCache.hasBillboard) - code += "m33 " + temp4 + ".xyz," + temp4 + ".xyz," + temp1 + "\n"; - else { - code += "m33 " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp1 + "\n"; - for (i = 0; i < len; i++) - code += "m33 " + animationRegisterCache.rotationRegisters[i] + ".xyz," + animationRegisterCache.rotationRegisters[i] + "," + temp1 + "\n"; - } - - //z axis - code += "mov " + temp2 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "sin " + temp2 + ".x," + rotationAttribute + ".z\n"; - code += "cos " + temp2 + ".y," + rotationAttribute + ".z\n"; - code += "mov " + temp1 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp1 + ".x," + temp2 + ".y\n"; - code += "neg " + temp1 + ".y," + temp2 + ".x\n"; - code += "mov " + temp3 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp3 + ".z," + animationRegisterCache.vertexOneConst + "\n"; - - if (animationRegisterCache.hasBillboard) { - code += "m33 " + temp4 + ".xyz," + temp4 + ".xyz," + temp1 + "\n"; - code += "sub " + temp4 + ".xyz," + temp4 + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; - code += "add " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp4 + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; - } else { - code += "m33 " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp1 + "\n"; - for (i = 0; i < len; i++) - code += "m33 " + animationRegisterCache.rotationRegisters[i] + ".xyz," + animationRegisterCache.rotationRegisters[i] + "," + temp1 + "\n"; - } - } - - if (this._iUsesPosition) { - var positionAttribute = animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleFollowNode.FOLLOW_POSITION_INDEX, positionAttribute.index); - code += "add " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + positionAttribute + "," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; - } - - return code; - }; - - /** - * @inheritDoc - */ - ParticleFollowNode.prototype.getAnimationState = function (animator) { - return animator.getAnimationState(this); - }; - ParticleFollowNode.FOLLOW_POSITION_INDEX = 0; - - ParticleFollowNode.FOLLOW_ROTATION_INDEX = 1; - return ParticleFollowNode; - })(animators.ParticleNodeBase); - animators.ParticleFollowNode = ParticleFollowNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ColorTransform = away.geom.ColorTransform; - - var ParticleInitialColorNode = (function (_super) { - __extends(ParticleInitialColorNode, _super); - function ParticleInitialColorNode(mode /*uint*/ , usesMultiplier, usesOffset, initialColor) { - if (typeof usesMultiplier === "undefined") { usesMultiplier = true; } - if (typeof usesOffset === "undefined") { usesOffset = false; } - if (typeof initialColor === "undefined") { initialColor = null; } - _super.call(this, "ParticleInitialColor", mode, (usesMultiplier && usesOffset) ? 8 : 4, animators.ParticleAnimationSet.COLOR_PRIORITY); - - this._pStateClass = animators.ParticleInitialColorState; - - this._iUsesMultiplier = usesMultiplier; - this._iUsesOffset = usesOffset; - this._iInitialColor = initialColor || new ColorTransform(); - } - /** - * @inheritDoc - */ - ParticleInitialColorNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { - var code = ""; - if (animationRegisterCache.needFragmentAnimation) { - if (this._iUsesMultiplier) { - var multiplierValue = (this._pMode == animators.ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleInitialColorNode.MULTIPLIER_INDEX, multiplierValue.index); - - code += "mul " + animationRegisterCache.colorMulTarget + "," + multiplierValue + "," + animationRegisterCache.colorMulTarget + "\n"; - } - - if (this._iUsesOffset) { - var offsetValue = (this._pMode == animators.ParticlePropertiesMode.LOCAL_STATIC) ? animationRegisterCache.getFreeVertexAttribute() : animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.setRegisterIndex(this, ParticleInitialColorNode.OFFSET_INDEX, offsetValue.index); - - code += "add " + animationRegisterCache.colorAddTarget + "," + offsetValue + "," + animationRegisterCache.colorAddTarget + "\n"; - } - } - - return code; - }; - - /** - * @inheritDoc - */ - ParticleInitialColorNode.prototype._iProcessAnimationSetting = function (particleAnimationSet) { - if (this._iUsesMultiplier) - particleAnimationSet.hasColorMulNode = true; - if (this._iUsesOffset) - particleAnimationSet.hasColorAddNode = true; - }; - - /** - * @inheritDoc - */ - ParticleInitialColorNode.prototype._iGeneratePropertyOfOneParticle = function (param) { - var initialColor = param[ParticleInitialColorNode.COLOR_INITIAL_COLORTRANSFORM]; - if (!initialColor) - throw (new Error("there is no " + ParticleInitialColorNode.COLOR_INITIAL_COLORTRANSFORM + " in param!")); - - var i = 0; - - //multiplier - if (this._iUsesMultiplier) { - this._pOneData[i++] = initialColor.redMultiplier; - this._pOneData[i++] = initialColor.greenMultiplier; - this._pOneData[i++] = initialColor.blueMultiplier; - this._pOneData[i++] = initialColor.alphaMultiplier; - } - - //offset - if (this._iUsesOffset) { - this._pOneData[i++] = initialColor.redOffset / 255; - this._pOneData[i++] = initialColor.greenOffset / 255; - this._pOneData[i++] = initialColor.blueOffset / 255; - this._pOneData[i++] = initialColor.alphaOffset / 255; - } - }; - ParticleInitialColorNode.MULTIPLIER_INDEX = 0; - - ParticleInitialColorNode.OFFSET_INDEX = 1; - - ParticleInitialColorNode.COLOR_INITIAL_COLORTRANSFORM = "ColorInitialColorTransform"; - return ParticleInitialColorNode; - })(animators.ParticleNodeBase); - animators.ParticleInitialColorNode = ParticleInitialColorNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var Vector3D = away.geom.Vector3D; - - var ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used to control the position of a particle over time around a circular orbit. - */ - var ParticleOrbitNode = (function (_super) { - __extends(ParticleOrbitNode, _super); - /** - * Creates a new ParticleOrbitNode object. - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] usesEulers Defines whether the node uses the eulers property in the shader to calculate a rotation on the orbit. Defaults to true. - * @param [optional] usesCycle Defines whether the node uses the cycleDuration property in the shader to calculate the period of the orbit independent of particle duration. Defaults to false. - * @param [optional] usesPhase Defines whether the node uses the cyclePhase property in the shader to calculate a starting offset to the cycle rotation of the particle. Defaults to false. - * @param [optional] radius Defines the radius of the orbit when in global mode. Defaults to 100. - * @param [optional] cycleDuration Defines the duration of the orbit in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. - * @param [optional] cyclePhase Defines the phase of the orbit in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. - * @param [optional] eulers Defines the euler rotation in degrees, applied to the orientation of the orbit when in global mode. - */ - function ParticleOrbitNode(mode /*uint*/ , usesEulers, usesCycle, usesPhase, radius, cycleDuration, cyclePhase, eulers) { - if (typeof usesEulers === "undefined") { usesEulers = true; } - if (typeof usesCycle === "undefined") { usesCycle = false; } - if (typeof usesPhase === "undefined") { usesPhase = false; } - if (typeof radius === "undefined") { radius = 100; } - if (typeof cycleDuration === "undefined") { cycleDuration = 1; } - if (typeof cyclePhase === "undefined") { cyclePhase = 0; } - if (typeof eulers === "undefined") { eulers = null; } - var len = 3; - if (usesPhase) - len++; - _super.call(this, "ParticleOrbit", mode, len); - - this._pStateClass = animators.ParticleOrbitState; - - this._iUsesEulers = usesEulers; - this._iUsesCycle = usesCycle; - this._iUsesPhase = usesPhase; - - this._iRadius = radius; - this._iCycleDuration = cycleDuration; - this._iCyclePhase = cyclePhase; - this._iEulers = eulers || new Vector3D(); - } - /** - * @inheritDoc - */ - ParticleOrbitNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { - var orbitRegister = (this._pMode == animators.ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleOrbitNode.ORBIT_INDEX, orbitRegister.index); - - var eulersMatrixRegister = animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.setRegisterIndex(this, ParticleOrbitNode.EULERS_INDEX, eulersMatrixRegister.index); - animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.getFreeVertexConstant(); - - var temp1 = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(temp1, 1); - var distance = new ShaderRegisterElement(temp1.regName, temp1.index); - - var temp2 = animationRegisterCache.getFreeVertexVectorTemp(); - var cos = new ShaderRegisterElement(temp2.regName, temp2.index, 0); - var sin = new ShaderRegisterElement(temp2.regName, temp2.index, 1); - var degree = new ShaderRegisterElement(temp2.regName, temp2.index, 2); - animationRegisterCache.removeVertexTempUsage(temp1); - - var code = ""; - - if (this._iUsesCycle) { - code += "mul " + degree + "," + animationRegisterCache.vertexTime + "," + orbitRegister + ".y\n"; - - if (this._iUsesPhase) - code += "add " + degree + "," + degree + "," + orbitRegister + ".w\n"; - } else - code += "mul " + degree + "," + animationRegisterCache.vertexLife + "," + orbitRegister + ".y\n"; - - code += "cos " + cos + "," + degree + "\n"; - code += "sin " + sin + "," + degree + "\n"; - code += "mul " + distance + ".x," + cos + "," + orbitRegister + ".x\n"; - code += "mul " + distance + ".y," + sin + "," + orbitRegister + ".x\n"; - code += "mov " + distance + ".wz" + animationRegisterCache.vertexZeroConst + "\n"; - if (this._iUsesEulers) - code += "m44 " + distance + "," + distance + "," + eulersMatrixRegister + "\n"; - code += "add " + animationRegisterCache.positionTarget + ".xyz," + distance + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; - - if (animationRegisterCache.needVelocity) { - code += "neg " + distance + ".x," + sin + "\n"; - code += "mov " + distance + ".y," + cos + "\n"; - code += "mov " + distance + ".zw," + animationRegisterCache.vertexZeroConst + "\n"; - if (this._iUsesEulers) - code += "m44 " + distance + "," + distance + "," + eulersMatrixRegister + "\n"; - code += "mul " + distance + "," + distance + "," + orbitRegister + ".z\n"; - code += "div " + distance + "," + distance + "," + orbitRegister + ".y\n"; - if (!this._iUsesCycle) - code += "div " + distance + "," + distance + "," + animationRegisterCache.vertexLife + "\n"; - code += "add " + animationRegisterCache.velocityTarget + ".xyz," + animationRegisterCache.velocityTarget + ".xyz," + distance + ".xyz\n"; - } - return code; - }; - - /** - * @inheritDoc - */ - ParticleOrbitNode.prototype.getAnimationState = function (animator) { - return animator.getAnimationState(this); - }; - - /** - * @inheritDoc - */ - ParticleOrbitNode.prototype._iGeneratePropertyOfOneParticle = function (param) { - //Vector3D.x is radius, Vector3D.y is cycle duration, Vector3D.z is phase - var orbit = param[ParticleOrbitNode.ORBIT_VECTOR3D]; - if (!orbit) - throw new Error("there is no " + ParticleOrbitNode.ORBIT_VECTOR3D + " in param!"); - - this._pOneData[0] = orbit.x; - if (this._iUsesCycle && orbit.y <= 0) - throw (new Error("the cycle duration must be greater than zero")); - this._pOneData[1] = Math.PI * 2 / (!this._iUsesCycle ? 1 : orbit.y); - this._pOneData[2] = orbit.x * Math.PI * 2; - if (this._iUsesPhase) - this._pOneData[3] = orbit.z * Math.PI / 180; - }; - ParticleOrbitNode.ORBIT_INDEX = 0; - - ParticleOrbitNode.EULERS_INDEX = 1; - - ParticleOrbitNode.ORBIT_VECTOR3D = "OrbitVector3D"; - return ParticleOrbitNode; - })(animators.ParticleNodeBase); - animators.ParticleOrbitNode = ParticleOrbitNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var Vector3D = away.geom.Vector3D; - - var ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used to control the position of a particle over time using simple harmonic motion. - */ - var ParticleOscillatorNode = (function (_super) { - __extends(ParticleOscillatorNode, _super); - /** - * Creates a new ParticleOscillatorNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] oscillator Defines the default oscillator axis (x, y, z) and cycleDuration (w) of the node, used when in global mode. - */ - function ParticleOscillatorNode(mode /*uint*/ , oscillator) { - if (typeof oscillator === "undefined") { oscillator = null; } - _super.call(this, "ParticleOscillator", mode, 4); - - this._pStateClass = animators.ParticleOscillatorState; - - this._iOscillator = oscillator || new Vector3D(); - } - /** - * @inheritDoc - */ - ParticleOscillatorNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { - var oscillatorRegister = (this._pMode == animators.ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleOscillatorNode.OSCILLATOR_INDEX, oscillatorRegister.index); - var temp = animationRegisterCache.getFreeVertexVectorTemp(); - var dgree = new ShaderRegisterElement(temp.regName, temp.index, 0); - var sin = new ShaderRegisterElement(temp.regName, temp.index, 1); - var cos = new ShaderRegisterElement(temp.regName, temp.index, 2); - animationRegisterCache.addVertexTempUsages(temp, 1); - var temp2 = animationRegisterCache.getFreeVertexVectorTemp(); - var distance = new ShaderRegisterElement(temp2.regName, temp2.index); - animationRegisterCache.removeVertexTempUsage(temp); - - var code = ""; - code += "mul " + dgree + "," + animationRegisterCache.vertexTime + "," + oscillatorRegister + ".w\n"; - code += "sin " + sin + "," + dgree + "\n"; - code += "mul " + distance + ".xyz," + sin + "," + oscillatorRegister + ".xyz\n"; - code += "add " + animationRegisterCache.positionTarget + ".xyz," + distance + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; - - if (animationRegisterCache.needVelocity) { - code += "cos " + cos + "," + dgree + "\n"; - code += "mul " + distance + ".xyz," + cos + "," + oscillatorRegister + ".xyz\n"; - code += "add " + animationRegisterCache.velocityTarget + ".xyz," + distance + ".xyz," + animationRegisterCache.velocityTarget + ".xyz\n"; - } - - return code; - }; - - /** - * @inheritDoc - */ - ParticleOscillatorNode.prototype.getAnimationState = function (animator) { - return animator.getAnimationState(this); - }; - - /** - * @inheritDoc - */ - ParticleOscillatorNode.prototype._iGeneratePropertyOfOneParticle = function (param) { - //(Vector3D.x,Vector3D.y,Vector3D.z) is oscillator axis, Vector3D.w is oscillator cycle duration - var drift = param[ParticleOscillatorNode.OSCILLATOR_VECTOR3D]; - if (!drift) - throw (new Error("there is no " + ParticleOscillatorNode.OSCILLATOR_VECTOR3D + " in param!")); - - this._pOneData[0] = drift.x; - this._pOneData[1] = drift.y; - this._pOneData[2] = drift.z; - if (drift.w <= 0) - throw (new Error("the cycle duration must greater than zero")); - this._pOneData[3] = Math.PI * 2 / drift.w; - }; - ParticleOscillatorNode.OSCILLATOR_INDEX = 0; - - ParticleOscillatorNode.OSCILLATOR_VECTOR3D = "OscillatorVector3D"; - return ParticleOscillatorNode; - })(animators.ParticleNodeBase); - animators.ParticleOscillatorNode = ParticleOscillatorNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var Vector3D = away.geom.Vector3D; - - /** - * A particle animation node used to set the starting position of a particle. - */ - var ParticlePositionNode = (function (_super) { - __extends(ParticlePositionNode, _super); - /** - * Creates a new ParticlePositionNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] position Defines the default position of the particle when in global mode. Defaults to 0,0,0. - */ - function ParticlePositionNode(mode /*uint*/ , position) { - if (typeof position === "undefined") { position = null; } - _super.call(this, "ParticlePosition", mode, 3); - - this._pStateClass = animators.ParticlePositionState; - - this._iPosition = position || new Vector3D(); - } - /** - * @inheritDoc - */ - ParticlePositionNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { - var positionAttribute = (this._pMode == animators.ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticlePositionNode.POSITION_INDEX, positionAttribute.index); - - return "add " + animationRegisterCache.positionTarget + ".xyz," + positionAttribute + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; - }; - - /** - * @inheritDoc - */ - ParticlePositionNode.prototype.getAnimationState = function (animator) { - return animator.getAnimationState(this); - }; - - /** - * @inheritDoc - */ - ParticlePositionNode.prototype._iGeneratePropertyOfOneParticle = function (param) { - var offset = param[ParticlePositionNode.POSITION_VECTOR3D]; - if (!offset) - throw (new Error("there is no " + ParticlePositionNode.POSITION_VECTOR3D + " in param!")); - - this._pOneData[0] = offset.x; - this._pOneData[1] = offset.y; - this._pOneData[2] = offset.z; - }; - ParticlePositionNode.POSITION_INDEX = 0; - - ParticlePositionNode.POSITION_VECTOR3D = "PositionVector3D"; - return ParticlePositionNode; - })(animators.ParticleNodeBase); - animators.ParticlePositionNode = ParticlePositionNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used to control the rotation of a particle to match its heading vector. - */ - var ParticleRotateToHeadingNode = (function (_super) { - __extends(ParticleRotateToHeadingNode, _super); - /** - * Creates a new ParticleBillboardNode - */ - function ParticleRotateToHeadingNode() { - _super.call(this, "ParticleRotateToHeading", animators.ParticlePropertiesMode.GLOBAL, 0, 3); - - this._pStateClass = animators.ParticleRotateToHeadingState; - } - /** - * @inheritDoc - */ - ParticleRotateToHeadingNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { - var code = ""; - var len = animationRegisterCache.rotationRegisters.length; - var i; - if (animationRegisterCache.hasBillboard) { - var temp1 = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(temp1, 1); - var temp2 = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(temp2, 1); - var temp3 = animationRegisterCache.getFreeVertexVectorTemp(); - - var rotationMatrixRegister = animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.setRegisterIndex(this, ParticleRotateToHeadingNode.MATRIX_INDEX, rotationMatrixRegister.index); - animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.getFreeVertexConstant(); - - animationRegisterCache.removeVertexTempUsage(temp1); - animationRegisterCache.removeVertexTempUsage(temp2); - - //process the velocity - code += "m33 " + temp1 + ".xyz," + animationRegisterCache.velocityTarget + ".xyz," + rotationMatrixRegister + "\n"; - - code += "mov " + temp3 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp3 + ".xy," + temp1 + ".xy\n"; - code += "nrm " + temp3 + ".xyz," + temp3 + ".xyz\n"; - - //temp3.x=cos,temp3.y=sin - //only process z axis - code += "mov " + temp2 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp2 + ".x," + temp3 + ".y\n"; - code += "mov " + temp2 + ".y," + temp3 + ".x\n"; - code += "mov " + temp1 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp1 + ".x," + temp3 + ".x\n"; - code += "neg " + temp1 + ".y," + temp3 + ".y\n"; - code += "mov " + temp3 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp3 + ".z," + animationRegisterCache.vertexOneConst + "\n"; - code += "m33 " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp1 + "\n"; - for (i = 0; i < len; i++) - code += "m33 " + animationRegisterCache.rotationRegisters[i] + ".xyz," + animationRegisterCache.rotationRegisters[i] + "," + temp1 + "\n"; - } else { - var nrmVel = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(nrmVel, 1); - - var xAxis = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(xAxis, 1); - - var R = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(R, 1); - var R_rev = animationRegisterCache.getFreeVertexVectorTemp(); - var cos = new ShaderRegisterElement(R.regName, R.index, 3); - var sin = new ShaderRegisterElement(R_rev.regName, R_rev.index, 3); - var cos2 = new ShaderRegisterElement(nrmVel.regName, nrmVel.index, 3); - var tempSingle = sin; - - animationRegisterCache.removeVertexTempUsage(nrmVel); - animationRegisterCache.removeVertexTempUsage(xAxis); - animationRegisterCache.removeVertexTempUsage(R); - - code += "mov " + xAxis + ".x," + animationRegisterCache.vertexOneConst + "\n"; - code += "mov " + xAxis + ".yz," + animationRegisterCache.vertexZeroConst + "\n"; - - code += "nrm " + nrmVel + ".xyz," + animationRegisterCache.velocityTarget + ".xyz\n"; - code += "dp3 " + cos2 + "," + nrmVel + ".xyz," + xAxis + ".xyz\n"; - code += "crs " + nrmVel + ".xyz," + xAxis + ".xyz," + nrmVel + ".xyz\n"; - code += "nrm " + nrmVel + ".xyz," + nrmVel + ".xyz\n"; - - //use R as temp to judge if nrm is (0,0,0). - //if nrm is (0,0,0) ,change it to (0,0,1). - code += "dp3 " + R + ".x," + nrmVel + ".xyz," + nrmVel + ".xyz\n"; - code += "sge " + R + ".x," + animationRegisterCache.vertexZeroConst + "," + R + ".x\n"; - code += "add " + nrmVel + ".z," + R + ".x," + nrmVel + ".z\n"; - - code += "add " + tempSingle + "," + cos2 + "," + animationRegisterCache.vertexOneConst + "\n"; - code += "div " + tempSingle + "," + tempSingle + "," + animationRegisterCache.vertexTwoConst + "\n"; - code += "sqt " + cos + "," + tempSingle + "\n"; - - code += "sub " + tempSingle + "," + animationRegisterCache.vertexOneConst + "," + cos2 + "\n"; - code += "div " + tempSingle + "," + tempSingle + "," + animationRegisterCache.vertexTwoConst + "\n"; - code += "sqt " + sin + "," + tempSingle + "\n"; - - code += "mul " + R + ".xyz," + sin + "," + nrmVel + ".xyz\n"; - - //use cos as R.w - code += "mul " + R_rev + ".xyz," + sin + "," + nrmVel + ".xyz\n"; - code += "neg " + R_rev + ".xyz," + R_rev + ".xyz\n"; - - //use cos as R_rev.w - //nrmVel and xAxis are used as temp register - code += "crs " + nrmVel + ".xyz," + R + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; - - //use cos as R.w - code += "mul " + xAxis + ".xyz," + cos + "," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; - code += "add " + nrmVel + ".xyz," + nrmVel + ".xyz," + xAxis + ".xyz\n"; - code += "dp3 " + xAxis + ".w," + R + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; - code += "neg " + nrmVel + ".w," + xAxis + ".w\n"; - - code += "crs " + R + ".xyz," + nrmVel + ".xyz," + R_rev + ".xyz\n"; - - //code += "mul " + xAxis + ".xyzw," + nrmVel + ".xyzw," +R_rev + ".w\n"; - code += "mul " + xAxis + ".xyzw," + nrmVel + ".xyzw," + cos + "\n"; - code += "add " + R + ".xyz," + R + ".xyz," + xAxis + ".xyz\n"; - code += "mul " + xAxis + ".xyz," + nrmVel + ".w," + R_rev + ".xyz\n"; - - code += "add " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + R + ".xyz," + xAxis + ".xyz\n"; - - for (i = 0; i < len; i++) { - //just repeat the calculate above - //because of the limited registers, no need to optimise - code += "mov " + xAxis + ".x," + animationRegisterCache.vertexOneConst + "\n"; - code += "mov " + xAxis + ".yz," + animationRegisterCache.vertexZeroConst + "\n"; - code += "nrm " + nrmVel + ".xyz," + animationRegisterCache.velocityTarget + ".xyz\n"; - code += "dp3 " + cos2 + "," + nrmVel + ".xyz," + xAxis + ".xyz\n"; - code += "crs " + nrmVel + ".xyz," + xAxis + ".xyz," + nrmVel + ".xyz\n"; - code += "nrm " + nrmVel + ".xyz," + nrmVel + ".xyz\n"; - code += "dp3 " + R + ".x," + nrmVel + ".xyz," + nrmVel + ".xyz\n"; - code += "sge " + R + ".x," + animationRegisterCache.vertexZeroConst + "," + R + ".x\n"; - code += "add " + nrmVel + ".z," + R + ".x," + nrmVel + ".z\n"; - code += "add " + tempSingle + "," + cos2 + "," + animationRegisterCache.vertexOneConst + "\n"; - code += "div " + tempSingle + "," + tempSingle + "," + animationRegisterCache.vertexTwoConst + "\n"; - code += "sqt " + cos + "," + tempSingle + "\n"; - code += "sub " + tempSingle + "," + animationRegisterCache.vertexOneConst + "," + cos2 + "\n"; - code += "div " + tempSingle + "," + tempSingle + "," + animationRegisterCache.vertexTwoConst + "\n"; - code += "sqt " + sin + "," + tempSingle + "\n"; - code += "mul " + R + ".xyz," + sin + "," + nrmVel + ".xyz\n"; - code += "mul " + R_rev + ".xyz," + sin + "," + nrmVel + ".xyz\n"; - code += "neg " + R_rev + ".xyz," + R_rev + ".xyz\n"; - code += "crs " + nrmVel + ".xyz," + R + ".xyz," + animationRegisterCache.rotationRegisters[i] + ".xyz\n"; - code += "mul " + xAxis + ".xyz," + cos + "," + animationRegisterCache.rotationRegisters[i] + ".xyz\n"; - code += "add " + nrmVel + ".xyz," + nrmVel + ".xyz," + xAxis + ".xyz\n"; - code += "dp3 " + xAxis + ".w," + R + ".xyz," + animationRegisterCache.rotationRegisters[i] + ".xyz\n"; - code += "neg " + nrmVel + ".w," + xAxis + ".w\n"; - code += "crs " + R + ".xyz," + nrmVel + ".xyz," + R_rev + ".xyz\n"; - code += "mul " + xAxis + ".xyzw," + nrmVel + ".xyzw," + cos + "\n"; - code += "add " + R + ".xyz," + R + ".xyz," + xAxis + ".xyz\n"; - code += "mul " + xAxis + ".xyz," + nrmVel + ".w," + R_rev + ".xyz\n"; - code += "add " + animationRegisterCache.rotationRegisters[i] + ".xyz," + R + ".xyz," + xAxis + ".xyz\n"; - } - } - return code; - }; - - /** - * @inheritDoc - */ - ParticleRotateToHeadingNode.prototype.getAnimationState = function (animator) { - return animator.getAnimationState(this); - }; - - /** - * @inheritDoc - */ - ParticleRotateToHeadingNode.prototype._iProcessAnimationSetting = function (particleAnimationSet) { - particleAnimationSet.needVelocity = true; - }; - ParticleRotateToHeadingNode.MATRIX_INDEX = 0; - return ParticleRotateToHeadingNode; - })(animators.ParticleNodeBase); - animators.ParticleRotateToHeadingNode = ParticleRotateToHeadingNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var Vector3D = away.geom.Vector3D; - - var ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used to control the rotation of a particle to face to a position - */ - var ParticleRotateToPositionNode = (function (_super) { - __extends(ParticleRotateToPositionNode, _super); - /** - * Creates a new ParticleRotateToPositionNode - */ - function ParticleRotateToPositionNode(mode /*uint*/ , position) { - if (typeof position === "undefined") { position = null; } - _super.call(this, "ParticleRotateToPosition", mode, 3, 3); - - this._pStateClass = animators.ParticleRotateToPositionState; - - this._iPosition = position || new Vector3D(); - } - /** - * @inheritDoc - */ - ParticleRotateToPositionNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { - var positionAttribute = (this._pMode == animators.ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleRotateToPositionNode.POSITION_INDEX, positionAttribute.index); - - var code = ""; - var len = animationRegisterCache.rotationRegisters.length; - var i; - if (animationRegisterCache.hasBillboard) { - var temp1 = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(temp1, 1); - var temp2 = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(temp2, 1); - var temp3 = animationRegisterCache.getFreeVertexVectorTemp(); - - var rotationMatrixRegister = animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.setRegisterIndex(this, ParticleRotateToPositionNode.MATRIX_INDEX, rotationMatrixRegister.index); - animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.getFreeVertexConstant(); - - animationRegisterCache.removeVertexTempUsage(temp1); - animationRegisterCache.removeVertexTempUsage(temp2); - - //process the position - code += "sub " + temp1 + ".xyz," + positionAttribute + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; - code += "m33 " + temp1 + ".xyz," + temp1 + ".xyz," + rotationMatrixRegister + "\n"; - - code += "mov " + temp3 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp3 + ".xy," + temp1 + ".xy\n"; - code += "nrm " + temp3 + ".xyz," + temp3 + ".xyz\n"; - - //temp3.x=cos,temp3.y=sin - //only process z axis - code += "mov " + temp2 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp2 + ".x," + temp3 + ".y\n"; - code += "mov " + temp2 + ".y," + temp3 + ".x\n"; - code += "mov " + temp1 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp1 + ".x," + temp3 + ".x\n"; - code += "neg " + temp1 + ".y," + temp3 + ".y\n"; - code += "mov " + temp3 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp3 + ".z," + animationRegisterCache.vertexOneConst + "\n"; - code += "m33 " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp1 + "\n"; - for (i = 0; i < len; i++) - code += "m33 " + animationRegisterCache.rotationRegisters[i] + ".xyz," + animationRegisterCache.rotationRegisters[i] + "," + temp1 + "\n"; - } else { - var nrmDirection = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(nrmDirection, 1); - - var temp = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(temp, 1); - var cos = new ShaderRegisterElement(temp.regName, temp.index, 0); - var sin = new ShaderRegisterElement(temp.regName, temp.index, 1); - var o_temp = new ShaderRegisterElement(temp.regName, temp.index, 2); - var tempSingle = new ShaderRegisterElement(temp.regName, temp.index, 3); - - var R = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(R, 1); - - animationRegisterCache.removeVertexTempUsage(nrmDirection); - animationRegisterCache.removeVertexTempUsage(temp); - animationRegisterCache.removeVertexTempUsage(R); - - code += "sub " + nrmDirection + ".xyz," + positionAttribute + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; - code += "nrm " + nrmDirection + ".xyz," + nrmDirection + ".xyz\n"; - - code += "mov " + sin + "," + nrmDirection + ".y\n"; - code += "mul " + cos + "," + sin + "," + sin + "\n"; - code += "sub " + cos + "," + animationRegisterCache.vertexOneConst + "," + cos + "\n"; - code += "sqt " + cos + "," + cos + "\n"; - - code += "mul " + R + ".x," + cos + "," + animationRegisterCache.scaleAndRotateTarget + ".y\n"; - code += "mul " + R + ".y," + sin + "," + animationRegisterCache.scaleAndRotateTarget + ".z\n"; - code += "mul " + R + ".z," + sin + "," + animationRegisterCache.scaleAndRotateTarget + ".y\n"; - code += "mul " + R + ".w," + cos + "," + animationRegisterCache.scaleAndRotateTarget + ".z\n"; - - code += "sub " + animationRegisterCache.scaleAndRotateTarget + ".y," + R + ".x," + R + ".y\n"; - code += "add " + animationRegisterCache.scaleAndRotateTarget + ".z," + R + ".z," + R + ".w\n"; - - code += "abs " + R + ".y," + nrmDirection + ".y\n"; - code += "sge " + R + ".z," + R + ".y," + animationRegisterCache.vertexOneConst + "\n"; - code += "mul " + R + ".x," + R + ".y," + nrmDirection + ".y\n"; - - //judgu if nrmDirection=(0,1,0); - code += "mov " + nrmDirection + ".y," + animationRegisterCache.vertexZeroConst + "\n"; - code += "dp3 " + sin + "," + nrmDirection + ".xyz," + nrmDirection + ".xyz\n"; - code += "sge " + tempSingle + "," + animationRegisterCache.vertexZeroConst + "," + sin + "\n"; - - code += "mov " + nrmDirection + ".y," + animationRegisterCache.vertexZeroConst + "\n"; - code += "nrm " + nrmDirection + ".xyz," + nrmDirection + ".xyz\n"; - - code += "sub " + sin + "," + animationRegisterCache.vertexOneConst + "," + tempSingle + "\n"; - code += "mul " + sin + "," + sin + "," + nrmDirection + ".x\n"; - - code += "mov " + cos + "," + nrmDirection + ".z\n"; - code += "neg " + cos + "," + cos + "\n"; - code += "sub " + o_temp + "," + animationRegisterCache.vertexOneConst + "," + cos + "\n"; - code += "mul " + o_temp + "," + R + ".x," + tempSingle + "\n"; - code += "add " + cos + "," + cos + "," + o_temp + "\n"; - - code += "mul " + R + ".x," + cos + "," + animationRegisterCache.scaleAndRotateTarget + ".x\n"; - code += "mul " + R + ".y," + sin + "," + animationRegisterCache.scaleAndRotateTarget + ".z\n"; - code += "mul " + R + ".z," + sin + "," + animationRegisterCache.scaleAndRotateTarget + ".x\n"; - code += "mul " + R + ".w," + cos + "," + animationRegisterCache.scaleAndRotateTarget + ".z\n"; - - code += "sub " + animationRegisterCache.scaleAndRotateTarget + ".x," + R + ".x," + R + ".y\n"; - code += "add " + animationRegisterCache.scaleAndRotateTarget + ".z," + R + ".z," + R + ".w\n"; - - for (i = 0; i < len; i++) { - //just repeat the calculate above - //because of the limited registers, no need to optimise - code += "sub " + nrmDirection + ".xyz," + positionAttribute + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; - code += "nrm " + nrmDirection + ".xyz," + nrmDirection + ".xyz\n"; - code += "mov " + sin + "," + nrmDirection + ".y\n"; - code += "mul " + cos + "," + sin + "," + sin + "\n"; - code += "sub " + cos + "," + animationRegisterCache.vertexOneConst + "," + cos + "\n"; - code += "sqt " + cos + "," + cos + "\n"; - code += "mul " + R + ".x," + cos + "," + animationRegisterCache.rotationRegisters[i] + ".y\n"; - code += "mul " + R + ".y," + sin + "," + animationRegisterCache.rotationRegisters[i] + ".z\n"; - code += "mul " + R + ".z," + sin + "," + animationRegisterCache.rotationRegisters[i] + ".y\n"; - code += "mul " + R + ".w," + cos + "," + animationRegisterCache.rotationRegisters[i] + ".z\n"; - code += "sub " + animationRegisterCache.rotationRegisters[i] + ".y," + R + ".x," + R + ".y\n"; - code += "add " + animationRegisterCache.rotationRegisters[i] + ".z," + R + ".z," + R + ".w\n"; - code += "abs " + R + ".y," + nrmDirection + ".y\n"; - code += "sge " + R + ".z," + R + ".y," + animationRegisterCache.vertexOneConst + "\n"; - code += "mul " + R + ".x," + R + ".y," + nrmDirection + ".y\n"; - code += "mov " + nrmDirection + ".y," + animationRegisterCache.vertexZeroConst + "\n"; - code += "dp3 " + sin + "," + nrmDirection + ".xyz," + nrmDirection + ".xyz\n"; - code += "sge " + tempSingle + "," + animationRegisterCache.vertexZeroConst + "," + sin + "\n"; - code += "mov " + nrmDirection + ".y," + animationRegisterCache.vertexZeroConst + "\n"; - code += "nrm " + nrmDirection + ".xyz," + nrmDirection + ".xyz\n"; - code += "sub " + sin + "," + animationRegisterCache.vertexOneConst + "," + tempSingle + "\n"; - code += "mul " + sin + "," + sin + "," + nrmDirection + ".x\n"; - code += "mov " + cos + "," + nrmDirection + ".z\n"; - code += "neg " + cos + "," + cos + "\n"; - code += "sub " + o_temp + "," + animationRegisterCache.vertexOneConst + "," + cos + "\n"; - code += "mul " + o_temp + "," + R + ".x," + tempSingle + "\n"; - code += "add " + cos + "," + cos + "," + o_temp + "\n"; - code += "mul " + R + ".x," + cos + "," + animationRegisterCache.rotationRegisters[i] + ".x\n"; - code += "mul " + R + ".y," + sin + "," + animationRegisterCache.rotationRegisters[i] + ".z\n"; - code += "mul " + R + ".z," + sin + "," + animationRegisterCache.rotationRegisters[i] + ".x\n"; - code += "mul " + R + ".w," + cos + "," + animationRegisterCache.rotationRegisters[i] + ".z\n"; - code += "sub " + animationRegisterCache.rotationRegisters[i] + ".x," + R + ".x," + R + ".y\n"; - code += "add " + animationRegisterCache.rotationRegisters[i] + ".z," + R + ".z," + R + ".w\n"; - } - } - return code; - }; - - /** - * @inheritDoc - */ - ParticleRotateToPositionNode.prototype.getAnimationState = function (animator) { - return animator.getAnimationState(this); - }; - - /** - * @inheritDoc - */ - ParticleRotateToPositionNode.prototype._iGeneratePropertyOfOneParticle = function (param) { - var offset = param[ParticleRotateToPositionNode.POSITION_VECTOR3D]; - if (!offset) - throw (new Error("there is no " + ParticleRotateToPositionNode.POSITION_VECTOR3D + " in param!")); - - this._pOneData[0] = offset.x; - this._pOneData[1] = offset.y; - this._pOneData[2] = offset.z; - }; - ParticleRotateToPositionNode.MATRIX_INDEX = 0; - - ParticleRotateToPositionNode.POSITION_INDEX = 1; - - ParticleRotateToPositionNode.POSITION_VECTOR3D = "RotateToPositionVector3D"; - return ParticleRotateToPositionNode; - })(animators.ParticleNodeBase); - animators.ParticleRotateToPositionNode = ParticleRotateToPositionNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var Vector3D = away.geom.Vector3D; - - var ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used to set the starting rotational velocity of a particle. - */ - var ParticleRotationalVelocityNode = (function (_super) { - __extends(ParticleRotationalVelocityNode, _super); - /** - * Creates a new ParticleRotationalVelocityNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - */ - function ParticleRotationalVelocityNode(mode /*uint*/ , rotationalVelocity) { - if (typeof rotationalVelocity === "undefined") { rotationalVelocity = null; } - _super.call(this, "ParticleRotationalVelocity", mode, 4); - - this._pStateClass = animators.ParticleRotationalVelocityState; - - this._iRotationalVelocity = rotationalVelocity || new Vector3D(); - } - /** - * @inheritDoc - */ - ParticleRotationalVelocityNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { - var rotationRegister = (this._pMode == animators.ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleRotationalVelocityNode.ROTATIONALVELOCITY_INDEX, rotationRegister.index); - - var nrmVel = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(nrmVel, 1); - - var xAxis = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(xAxis, 1); - - var temp = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(temp, 1); - var Rtemp = new ShaderRegisterElement(temp.regName, temp.index); - var R_rev = animationRegisterCache.getFreeVertexVectorTemp(); - R_rev = new ShaderRegisterElement(R_rev.regName, R_rev.index); - - var cos = new ShaderRegisterElement(Rtemp.regName, Rtemp.index, 3); - var sin = new ShaderRegisterElement(R_rev.regName, R_rev.index, 3); - - animationRegisterCache.removeVertexTempUsage(nrmVel); - animationRegisterCache.removeVertexTempUsage(xAxis); - animationRegisterCache.removeVertexTempUsage(temp); - - var code = ""; - code += "mov " + nrmVel + ".xyz," + rotationRegister + ".xyz\n"; - code += "mov " + nrmVel + ".w," + animationRegisterCache.vertexZeroConst + "\n"; - - code += "mul " + cos + "," + animationRegisterCache.vertexTime + "," + rotationRegister + ".w\n"; - - code += "sin " + sin + "," + cos + "\n"; - code += "cos " + cos + "," + cos + "\n"; - - code += "mul " + Rtemp + ".xyz," + sin + "," + nrmVel + ".xyz\n"; - - code += "mul " + R_rev + ".xyz," + sin + "," + nrmVel + ".xyz\n"; - code += "neg " + R_rev + ".xyz," + R_rev + ".xyz\n"; - - //nrmVel and xAxis are used as temp register - code += "crs " + nrmVel + ".xyz," + Rtemp + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; - - code += "mul " + xAxis + ".xyz," + cos + "," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; - code += "add " + nrmVel + ".xyz," + nrmVel + ".xyz," + xAxis + ".xyz\n"; - code += "dp3 " + xAxis + ".w," + Rtemp + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; - code += "neg " + nrmVel + ".w," + xAxis + ".w\n"; - - code += "crs " + Rtemp + ".xyz," + nrmVel + ".xyz," + R_rev + ".xyz\n"; - - //use cos as R_rev.w - code += "mul " + xAxis + ".xyzw," + nrmVel + ".xyzw," + cos + "\n"; - code += "add " + Rtemp + ".xyz," + Rtemp + ".xyz," + xAxis + ".xyz\n"; - code += "mul " + xAxis + ".xyz," + nrmVel + ".w," + R_rev + ".xyz\n"; - - code += "add " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + Rtemp + ".xyz," + xAxis + ".xyz\n"; - - var len = animationRegisterCache.rotationRegisters.length; - for (var i = 0; i < len; i++) { - code += "mov " + nrmVel + ".xyz," + rotationRegister + ".xyz\n"; - code += "mov " + nrmVel + ".w," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mul " + cos + "," + animationRegisterCache.vertexTime + "," + rotationRegister + ".w\n"; - code += "sin " + sin + "," + cos + "\n"; - code += "cos " + cos + "," + cos + "\n"; - code += "mul " + Rtemp + ".xyz," + sin + "," + nrmVel + ".xyz\n"; - code += "mul " + R_rev + ".xyz," + sin + "," + nrmVel + ".xyz\n"; - code += "neg " + R_rev + ".xyz," + R_rev + ".xyz\n"; - code += "crs " + nrmVel + ".xyz," + Rtemp + ".xyz," + animationRegisterCache.rotationRegisters[i] + ".xyz\n"; - code += "mul " + xAxis + ".xyz," + cos + "," + animationRegisterCache.rotationRegisters[i] + "\n"; - code += "add " + nrmVel + ".xyz," + nrmVel + ".xyz," + xAxis + ".xyz\n"; - code += "dp3 " + xAxis + ".w," + Rtemp + ".xyz," + animationRegisterCache.rotationRegisters[i] + "\n"; - code += "neg " + nrmVel + ".w," + xAxis + ".w\n"; - code += "crs " + Rtemp + ".xyz," + nrmVel + ".xyz," + R_rev + ".xyz\n"; - code += "mul " + xAxis + ".xyzw," + nrmVel + ".xyzw," + cos + "\n"; - code += "add " + Rtemp + ".xyz," + Rtemp + ".xyz," + xAxis + ".xyz\n"; - code += "mul " + xAxis + ".xyz," + nrmVel + ".w," + R_rev + ".xyz\n"; - code += "add " + animationRegisterCache.rotationRegisters[i] + "," + Rtemp + ".xyz," + xAxis + ".xyz\n"; - } - return code; - }; - - /** - * @inheritDoc - */ - ParticleRotationalVelocityNode.prototype.getAnimationState = function (animator) { - return animator.getAnimationState(this); - }; - - /** - * @inheritDoc - */ - ParticleRotationalVelocityNode.prototype._iGeneratePropertyOfOneParticle = function (param) { - //(Vector3d.x,Vector3d.y,Vector3d.z) is rotation axis,Vector3d.w is cycle duration - var rotate = param[ParticleRotationalVelocityNode.ROTATIONALVELOCITY_VECTOR3D]; - if (!rotate) - throw (new Error("there is no " + ParticleRotationalVelocityNode.ROTATIONALVELOCITY_VECTOR3D + " in param!")); - - if (rotate.length <= 0) - rotate.z = 1; //set the default direction - else - rotate.normalize(); - - this._pOneData[0] = rotate.x; - this._pOneData[1] = rotate.y; - this._pOneData[2] = rotate.z; - if (rotate.w <= 0) - throw (new Error("the cycle duration must greater than zero")); - - // it's used as angle/2 in agal - this._pOneData[3] = Math.PI / rotate.w; - }; - ParticleRotationalVelocityNode.ROTATIONALVELOCITY_INDEX = 0; - - ParticleRotationalVelocityNode.ROTATIONALVELOCITY_VECTOR3D = "RotationalVelocityVector3D"; - return ParticleRotationalVelocityNode; - })(animators.ParticleNodeBase); - animators.ParticleRotationalVelocityNode = ParticleRotationalVelocityNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * A particle animation node used to control the scale variation of a particle over time. - */ - var ParticleScaleNode = (function (_super) { - __extends(ParticleScaleNode, _super); - /** - * Creates a new ParticleScaleNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] usesCycle Defines whether the node uses the cycleDuration property in the shader to calculate the period of animation independent of particle duration. Defaults to false. - * @param [optional] usesPhase Defines whether the node uses the cyclePhase property in the shader to calculate a starting offset to the animation cycle. Defaults to false. - * @param [optional] minScale Defines the default min scale transform of the node, when in global mode. Defaults to 1. - * @param [optional] maxScale Defines the default max color transform of the node, when in global mode. Defaults to 1. - * @param [optional] cycleDuration Defines the default duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. - * @param [optional] cyclePhase Defines the default phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. - */ - function ParticleScaleNode(mode /*uint*/ , usesCycle, usesPhase, minScale, maxScale, cycleDuration, cyclePhase) { - if (typeof minScale === "undefined") { minScale = 1; } - if (typeof maxScale === "undefined") { maxScale = 1; } - if (typeof cycleDuration === "undefined") { cycleDuration = 1; } - if (typeof cyclePhase === "undefined") { cyclePhase = 0; } - _super.call(this, "ParticleScale", mode, (usesCycle && usesPhase) ? 4 : ((usesCycle || usesPhase) ? 3 : 2), 3); - - this._pStateClass = animators.ParticleScaleState; - - this._iUsesCycle = usesCycle; - this._iUsesPhase = usesPhase; - - this._iMinScale = minScale; - this._iMaxScale = maxScale; - this._iCycleDuration = cycleDuration; - this._iCyclePhase = cyclePhase; - } - /** - * @inheritDoc - */ - ParticleScaleNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { - var code = ""; - var temp = animationRegisterCache.getFreeVertexSingleTemp(); - - var scaleRegister = (this._pMode == animators.ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleScaleNode.SCALE_INDEX, scaleRegister.index); - - if (this._iUsesCycle) { - code += "mul " + temp + "," + animationRegisterCache.vertexTime + "," + scaleRegister + ".z\n"; - - if (this._iUsesPhase) - code += "add " + temp + "," + temp + "," + scaleRegister + ".w\n"; - - code += "sin " + temp + "," + temp + "\n"; - } - - code += "mul " + temp + "," + scaleRegister + ".y," + ((this._iUsesCycle) ? temp : animationRegisterCache.vertexLife) + "\n"; - code += "add " + temp + "," + scaleRegister + ".x," + temp + "\n"; - code += "mul " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp + "\n"; - - return code; - }; - - /** - * @inheritDoc - */ - ParticleScaleNode.prototype.getAnimationState = function (animator) { - return animator.getAnimationState(this); - }; - - /** - * @inheritDoc - */ - ParticleScaleNode.prototype._iGeneratePropertyOfOneParticle = function (param) { - var scale = param[ParticleScaleNode.SCALE_VECTOR3D]; - if (!scale) - throw (new Error("there is no " + ParticleScaleNode.SCALE_VECTOR3D + " in param!")); - - if (this._iUsesCycle) { - this._pOneData[0] = (scale.x + scale.y) / 2; - this._pOneData[1] = Math.abs(scale.x - scale.y) / 2; - if (scale.z <= 0) - throw (new Error("the cycle duration must be greater than zero")); - this._pOneData[2] = Math.PI * 2 / scale.z; - if (this._iUsesPhase) - this._pOneData[3] = scale.w * Math.PI / 180; - } else { - this._pOneData[0] = scale.x; - this._pOneData[1] = scale.y - scale.x; - } - }; - ParticleScaleNode.SCALE_INDEX = 0; - - ParticleScaleNode.SCALE_VECTOR3D = "ScaleVector3D"; - return ParticleScaleNode; - })(animators.ParticleNodeBase); - animators.ParticleScaleNode = ParticleScaleNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ShaderRegisterElement = away.materials.ShaderRegisterElement; - - var ParticleSegmentedColorNode = (function (_super) { - __extends(ParticleSegmentedColorNode, _super); - function ParticleSegmentedColorNode(usesMultiplier, usesOffset, numSegmentPoint /*int*/ , startColor, endColor, segmentPoints) { - //because of the stage3d register limitation, it only support the global mode - _super.call(this, "ParticleSegmentedColor", animators.ParticlePropertiesMode.GLOBAL, 0, animators.ParticleAnimationSet.COLOR_PRIORITY); - - this._pStateClass = animators.ParticleSegmentedColorState; - - if (numSegmentPoint > 4) - throw (new Error("the numSegmentPoint must be less or equal 4")); - this._iUsesMultiplier = usesMultiplier; - this._iUsesOffset = usesOffset; - this._iNumSegmentPoint = numSegmentPoint; - this._iStartColor = startColor; - this._iEndColor = endColor; - this._iSegmentPoints = segmentPoints; - } - /** - * @inheritDoc - */ - ParticleSegmentedColorNode.prototype._iProcessAnimationSetting = function (particleAnimationSet) { - if (this._iUsesMultiplier) - particleAnimationSet.hasColorMulNode = true; - if (this._iUsesOffset) - particleAnimationSet.hasColorAddNode = true; - }; - - /** - * @inheritDoc - */ - ParticleSegmentedColorNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { - var code = ""; - if (animationRegisterCache.needFragmentAnimation) { - var accMultiplierColor; - - //var accOffsetColor:ShaderRegisterElement; - if (this._iUsesMultiplier) { - accMultiplierColor = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(accMultiplierColor, 1); - } - - var tempColor = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(tempColor, 1); - - var temp = animationRegisterCache.getFreeVertexVectorTemp(); - var accTime = new ShaderRegisterElement(temp.regName, temp.index, 0); - var tempTime = new ShaderRegisterElement(temp.regName, temp.index, 1); - - if (this._iUsesMultiplier) - animationRegisterCache.removeVertexTempUsage(accMultiplierColor); - - animationRegisterCache.removeVertexTempUsage(tempColor); - - //for saving all the life values (at most 4) - var lifeTimeRegister = animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.setRegisterIndex(this, ParticleSegmentedColorNode.TIME_DATA_INDEX, lifeTimeRegister.index); - - var i; - - var startMulValue; - var deltaMulValues; - if (this._iUsesMultiplier) { - startMulValue = animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.setRegisterIndex(this, ParticleSegmentedColorNode.START_MULTIPLIER_INDEX, startMulValue.index); - deltaMulValues = new Array(); - for (i = 0; i < this._iNumSegmentPoint + 1; i++) - deltaMulValues.push(animationRegisterCache.getFreeVertexConstant()); - } - - var startOffsetValue; - var deltaOffsetValues; - if (this._iUsesOffset) { - startOffsetValue = animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.setRegisterIndex(this, ParticleSegmentedColorNode.START_OFFSET_INDEX, startOffsetValue.index); - deltaOffsetValues = new Array(); - for (i = 0; i < this._iNumSegmentPoint + 1; i++) - deltaOffsetValues.push(animationRegisterCache.getFreeVertexConstant()); - } - - if (this._iUsesMultiplier) - code += "mov " + accMultiplierColor + "," + startMulValue + "\n"; - if (this._iUsesOffset) - code += "add " + animationRegisterCache.colorAddTarget + "," + animationRegisterCache.colorAddTarget + "," + startOffsetValue + "\n"; - - for (i = 0; i < this._iNumSegmentPoint; i++) { - switch (i) { - case 0: - code += "min " + tempTime + "," + animationRegisterCache.vertexLife + "," + lifeTimeRegister + ".x\n"; - break; - case 1: - code += "sub " + accTime + "," + animationRegisterCache.vertexLife + "," + lifeTimeRegister + ".x\n"; - code += "max " + tempTime + "," + accTime + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "min " + tempTime + "," + tempTime + "," + lifeTimeRegister + ".y\n"; - break; - case 2: - code += "sub " + accTime + "," + accTime + "," + lifeTimeRegister + ".y\n"; - code += "max " + tempTime + "," + accTime + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "min " + tempTime + "," + tempTime + "," + lifeTimeRegister + ".z\n"; - break; - case 3: - code += "sub " + accTime + "," + accTime + "," + lifeTimeRegister + ".z\n"; - code += "max " + tempTime + "," + accTime + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "min " + tempTime + "," + tempTime + "," + lifeTimeRegister + ".w\n"; - break; - } - if (this._iUsesMultiplier) { - code += "mul " + tempColor + "," + tempTime + "," + deltaMulValues[i] + "\n"; - code += "add " + accMultiplierColor + "," + accMultiplierColor + "," + tempColor + "\n"; - } - if (this._iUsesOffset) { - code += "mul " + tempColor + "," + tempTime + "," + deltaOffsetValues[i] + "\n"; - code += "add " + animationRegisterCache.colorAddTarget + "," + animationRegisterCache.colorAddTarget + "," + tempColor + "\n"; - } - } - - //for the last segment: - if (this._iNumSegmentPoint == 0) - tempTime = animationRegisterCache.vertexLife; - else { - switch (this._iNumSegmentPoint) { - case 1: - code += "sub " + accTime + "," + animationRegisterCache.vertexLife + "," + lifeTimeRegister + ".x\n"; - break; - case 2: - code += "sub " + accTime + "," + accTime + "," + lifeTimeRegister + ".y\n"; - break; - case 3: - code += "sub " + accTime + "," + accTime + "," + lifeTimeRegister + ".z\n"; - break; - case 4: - code += "sub " + accTime + "," + accTime + "," + lifeTimeRegister + ".w\n"; - break; - } - code += "max " + tempTime + "," + accTime + "," + animationRegisterCache.vertexZeroConst + "\n"; - } - if (this._iUsesMultiplier) { - code += "mul " + tempColor + "," + tempTime + "," + deltaMulValues[this._iNumSegmentPoint] + "\n"; - code += "add " + accMultiplierColor + "," + accMultiplierColor + "," + tempColor + "\n"; - code += "mul " + animationRegisterCache.colorMulTarget + "," + animationRegisterCache.colorMulTarget + "," + accMultiplierColor + "\n"; - } - if (this._iUsesOffset) { - code += "mul " + tempColor + "," + tempTime + "," + deltaOffsetValues[this._iNumSegmentPoint] + "\n"; - code += "add " + animationRegisterCache.colorAddTarget + "," + animationRegisterCache.colorAddTarget + "," + tempColor + "\n"; - } - } - return code; - }; - ParticleSegmentedColorNode.START_MULTIPLIER_INDEX = 0; - - ParticleSegmentedColorNode.START_OFFSET_INDEX = 1; - - ParticleSegmentedColorNode.TIME_DATA_INDEX = 2; - return ParticleSegmentedColorNode; - })(animators.ParticleNodeBase); - animators.ParticleSegmentedColorNode = ParticleSegmentedColorNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used when a spritesheet texture is required to animate the particle. - * NB: to enable use of this node, the repeat property on the material has to be set to true. - */ - var ParticleSpriteSheetNode = (function (_super) { - __extends(ParticleSpriteSheetNode, _super); - /** - * Creates a new ParticleSpriteSheetNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] numColumns Defines the number of columns in the spritesheet, when in global mode. Defaults to 1. - * @param [optional] numRows Defines the number of rows in the spritesheet, when in global mode. Defaults to 1. - * @param [optional] cycleDuration Defines the default cycle duration in seconds, when in global mode. Defaults to 1. - * @param [optional] cyclePhase Defines the default cycle phase, when in global mode. Defaults to 0. - * @param [optional] totalFrames Defines the total number of frames used by the spritesheet, when in global mode. Defaults to the number defined by numColumns and numRows. - * @param [optional] looping Defines whether the spritesheet animation is set to loop indefinitely. Defaults to true. - */ - function ParticleSpriteSheetNode(mode /*uint*/ , usesCycle, usesPhase, numColumns, numRows, cycleDuration, cyclePhase, totalFrames) { - if (typeof numColumns === "undefined") { numColumns = 1; } - if (typeof numRows === "undefined") { numRows = 1; } - if (typeof cycleDuration === "undefined") { cycleDuration = 1; } - if (typeof cyclePhase === "undefined") { cyclePhase = 0; } - if (typeof totalFrames === "undefined") { totalFrames = Number.MAX_VALUE; } - _super.call(this, "ParticleSpriteSheet", mode, usesCycle ? (usesPhase ? 3 : 2) : 1, animators.ParticleAnimationSet.POST_PRIORITY + 1); - - this._pStateClass = animators.ParticleSpriteSheetState; - - this._iUsesCycle = usesCycle; - this._iUsesPhase = usesPhase; - - this._iNumColumns = numColumns; - this._iNumRows = numRows; - this._iCyclePhase = cyclePhase; - this._iCycleDuration = cycleDuration; - this._iTotalFrames = Math.min(totalFrames, numColumns * numRows); - } - Object.defineProperty(ParticleSpriteSheetNode.prototype, "numColumns", { - /** - * Defines the number of columns in the spritesheet, when in global mode. Defaults to 1. Read only. - */ - get: function () { - return this._iNumColumns; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ParticleSpriteSheetNode.prototype, "numRows", { - /** - * Defines the number of rows in the spritesheet, when in global mode. Defaults to 1. Read only. - */ - get: function () { - return this._iNumRows; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ParticleSpriteSheetNode.prototype, "totalFrames", { - /** - * Defines the total number of frames used by the spritesheet, when in global mode. Defaults to the number defined by numColumns and numRows. Read only. - */ - get: function () { - return this._iTotalFrames; - }, - enumerable: true, - configurable: true - }); - - /** - * @inheritDoc - */ - ParticleSpriteSheetNode.prototype.getAGALUVCode = function (shaderObject, animationRegisterCache) { - //get 2 vc - var uvParamConst1 = animationRegisterCache.getFreeVertexConstant(); - var uvParamConst2 = (this._pMode == animators.ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleSpriteSheetNode.UV_INDEX_0, uvParamConst1.index); - animationRegisterCache.setRegisterIndex(this, ParticleSpriteSheetNode.UV_INDEX_1, uvParamConst2.index); - - var uTotal = new ShaderRegisterElement(uvParamConst1.regName, uvParamConst1.index, 0); - var uStep = new ShaderRegisterElement(uvParamConst1.regName, uvParamConst1.index, 1); - var vStep = new ShaderRegisterElement(uvParamConst1.regName, uvParamConst1.index, 2); - - var uSpeed = new ShaderRegisterElement(uvParamConst2.regName, uvParamConst2.index, 0); - var cycle = new ShaderRegisterElement(uvParamConst2.regName, uvParamConst2.index, 1); - var phaseTime = new ShaderRegisterElement(uvParamConst2.regName, uvParamConst2.index, 2); - - var temp = animationRegisterCache.getFreeVertexVectorTemp(); - var time = new ShaderRegisterElement(temp.regName, temp.index, 0); - var vOffset = new ShaderRegisterElement(temp.regName, temp.index, 1); - temp = new ShaderRegisterElement(temp.regName, temp.index, 2); - var temp2 = new ShaderRegisterElement(temp.regName, temp.index, 3); - - var u = new ShaderRegisterElement(animationRegisterCache.uvTarget.regName, animationRegisterCache.uvTarget.index, 0); - var v = new ShaderRegisterElement(animationRegisterCache.uvTarget.regName, animationRegisterCache.uvTarget.index, 1); - - var code = ""; - - //scale uv - code += "mul " + u + "," + u + "," + uStep + "\n"; - if (this._iNumRows > 1) - code += "mul " + v + "," + v + "," + vStep + "\n"; - - if (this._iUsesCycle) { - if (this._iUsesPhase) - code += "add " + time + "," + animationRegisterCache.vertexTime + "," + phaseTime + "\n"; - else - code += "mov " + time + "," + animationRegisterCache.vertexTime + "\n"; - code += "div " + time + "," + time + "," + cycle + "\n"; - code += "frc " + time + "," + time + "\n"; - code += "mul " + time + "," + time + "," + cycle + "\n"; - code += "mul " + temp + "," + time + "," + uSpeed + "\n"; - } else - code += "mul " + temp.toString() + "," + animationRegisterCache.vertexLife + "," + uTotal + "\n"; - - if (this._iNumRows > 1) { - code += "frc " + temp2 + "," + temp + "\n"; - code += "sub " + vOffset + "," + temp + "," + temp2 + "\n"; - code += "mul " + vOffset + "," + vOffset + "," + vStep + "\n"; - code += "add " + v + "," + v + "," + vOffset + "\n"; - } - - code += "div " + temp2 + "," + temp + "," + uStep + "\n"; - code += "frc " + temp + "," + temp2 + "\n"; - code += "sub " + temp2 + "," + temp2 + "," + temp + "\n"; - code += "mul " + temp + "," + temp2 + "," + uStep + "\n"; - - if (this._iNumRows > 1) - code += "frc " + temp + "," + temp + "\n"; - code += "add " + u + "," + u + "," + temp + "\n"; - - return code; - }; - - /** - * @inheritDoc - */ - ParticleSpriteSheetNode.prototype.getAnimationState = function (animator) { - return animator.getAnimationState(this); - }; - - /** - * @inheritDoc - */ - ParticleSpriteSheetNode.prototype._iProcessAnimationSetting = function (particleAnimationSet) { - particleAnimationSet.hasUVNode = true; - }; - - /** - * @inheritDoc - */ - ParticleSpriteSheetNode.prototype._iGeneratePropertyOfOneParticle = function (param) { - if (this._iUsesCycle) { - var uvCycle = param[ParticleSpriteSheetNode.UV_VECTOR3D]; - if (!uvCycle) - throw (new Error("there is no " + ParticleSpriteSheetNode.UV_VECTOR3D + " in param!")); - if (uvCycle.x <= 0) - throw (new Error("the cycle duration must be greater than zero")); - var uTotal = this._iTotalFrames / this._iNumColumns; - this._pOneData[0] = uTotal / uvCycle.x; - this._pOneData[1] = uvCycle.x; - if (this._iUsesPhase) - this._pOneData[2] = uvCycle.y; - } - }; - ParticleSpriteSheetNode.UV_INDEX_0 = 0; - - ParticleSpriteSheetNode.UV_INDEX_1 = 1; - - ParticleSpriteSheetNode.UV_VECTOR3D = "UVVector3D"; - return ParticleSpriteSheetNode; - })(animators.ParticleNodeBase); - animators.ParticleSpriteSheetNode = ParticleSpriteSheetNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * A particle animation node used as the base node for timekeeping inside a particle. Automatically added to a particle animation set on instatiation. - */ - var ParticleTimeNode = (function (_super) { - __extends(ParticleTimeNode, _super); - /** - * Creates a new ParticleTimeNode - * - * @param [optional] usesDuration Defines whether the node uses the duration data in the static properties to determine how long a particle is visible for. Defaults to false. - * @param [optional] usesDelay Defines whether the node uses the delay data in the static properties to determine how long a particle is hidden for. Defaults to false. Requires usesDuration to be true. - * @param [optional] usesLooping Defines whether the node creates a looping timeframe for each particle determined by the startTime, duration and delay data in the static properties function. Defaults to false. Requires usesLooping to be true. - */ - function ParticleTimeNode(usesDuration, usesLooping, usesDelay) { - if (typeof usesDuration === "undefined") { usesDuration = false; } - if (typeof usesLooping === "undefined") { usesLooping = false; } - if (typeof usesDelay === "undefined") { usesDelay = false; } - this._pStateClass = animators.ParticleTimeState; - - this._iUsesDuration = usesDuration; - this._iUsesLooping = usesLooping; - this._iUsesDelay = usesDelay; - - _super.call(this, "ParticleTime", animators.ParticlePropertiesMode.LOCAL_STATIC, 4, 0); - } - /** - * @inheritDoc - */ - ParticleTimeNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { - var timeStreamRegister = animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleTimeNode.TIME_STREAM_INDEX, timeStreamRegister.index); - var timeConst = animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.setRegisterIndex(this, ParticleTimeNode.TIME_CONSTANT_INDEX, timeConst.index); - - var code = ""; - code += "sub " + animationRegisterCache.vertexTime + "," + timeConst + "," + timeStreamRegister + ".x\n"; - - //if time=0,set the position to zero. - var temp = animationRegisterCache.getFreeVertexSingleTemp(); - code += "sge " + temp + "," + animationRegisterCache.vertexTime + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mul " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp + "\n"; - if (this._iUsesDuration) { - if (this._iUsesLooping) { - var div = animationRegisterCache.getFreeVertexSingleTemp(); - if (this._iUsesDelay) { - code += "div " + div + "," + animationRegisterCache.vertexTime + "," + timeStreamRegister + ".z\n"; - code += "frc " + div + "," + div + "\n"; - code += "mul " + animationRegisterCache.vertexTime + "," + div + "," + timeStreamRegister + ".z\n"; - code += "slt " + div + "," + animationRegisterCache.vertexTime + "," + timeStreamRegister + ".y\n"; - code += "mul " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + div + "\n"; - } else { - code += "mul " + div + "," + animationRegisterCache.vertexTime + "," + timeStreamRegister + ".w\n"; - code += "frc " + div + "," + div + "\n"; - code += "mul " + animationRegisterCache.vertexTime + "," + div + "," + timeStreamRegister + ".y\n"; - } - } else { - var sge = animationRegisterCache.getFreeVertexSingleTemp(); - code += "sge " + sge + "," + timeStreamRegister + ".y," + animationRegisterCache.vertexTime + "\n"; - code += "mul " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + sge + "\n"; - } - } - code += "mul " + animationRegisterCache.vertexLife + "," + animationRegisterCache.vertexTime + "," + timeStreamRegister + ".w\n"; - return code; - }; - - /** - * @inheritDoc - */ - ParticleTimeNode.prototype.getAnimationState = function (animator) { - return animator.getAnimationState(this); - }; - - /** - * @inheritDoc - */ - ParticleTimeNode.prototype._iGeneratePropertyOfOneParticle = function (param) { - this._pOneData[0] = param.startTime; - this._pOneData[1] = param.duration; - this._pOneData[2] = param.delay + param.duration; - this._pOneData[3] = 1 / param.duration; - }; - ParticleTimeNode.TIME_STREAM_INDEX = 0; - - ParticleTimeNode.TIME_CONSTANT_INDEX = 1; - return ParticleTimeNode; - })(animators.ParticleNodeBase); - animators.ParticleTimeNode = ParticleTimeNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var Vector3D = away.geom.Vector3D; - - var ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used to control the UV offset and scale of a particle over time. - */ - var ParticleUVNode = (function (_super) { - __extends(ParticleUVNode, _super); - /** - * Creates a new ParticleTimeNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] cycle Defines whether the time track is in loop mode. Defaults to false. - * @param [optional] scale Defines whether the time track is in loop mode. Defaults to false. - * @param [optional] axis Defines whether the time track is in loop mode. Defaults to false. - */ - function ParticleUVNode(mode /*uint*/ , cycle, scale, axis) { - if (typeof cycle === "undefined") { cycle = 1; } - if (typeof scale === "undefined") { scale = 1; } - if (typeof axis === "undefined") { axis = "x"; } - //because of the stage3d register limitation, it only support the global mode - _super.call(this, "ParticleUV", animators.ParticlePropertiesMode.GLOBAL, 4, animators.ParticleAnimationSet.POST_PRIORITY + 1); - - this._pStateClass = animators.ParticleUVState; - - this._cycle = cycle; - this._scale = scale; - this._axis = axis; - - this.updateUVData(); - } - Object.defineProperty(ParticleUVNode.prototype, "cycle", { - /** - * - */ - get: function () { - return this._cycle; - }, - set: function (value) { - this._cycle = value; - - this.updateUVData(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ParticleUVNode.prototype, "scale", { - /** - * - */ - get: function () { - return this._scale; - }, - set: function (value) { - this._scale = value; - - this.updateUVData(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ParticleUVNode.prototype, "axis", { - /** - * - */ - get: function () { - return this._axis; - }, - set: function (value) { - this._axis = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - ParticleUVNode.prototype.getAGALUVCode = function (shaderObject, animationRegisterCache) { - var code = ""; - - var uvConst = animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.setRegisterIndex(this, ParticleUVNode.UV_INDEX, uvConst.index); - - var axisIndex = this._axis == "x" ? 0 : (this._axis == "y" ? 1 : 2); - - var target = new ShaderRegisterElement(animationRegisterCache.uvTarget.regName, animationRegisterCache.uvTarget.index, axisIndex); - - var sin = animationRegisterCache.getFreeVertexSingleTemp(); - - if (this._scale != 1) - code += "mul " + target + "," + target + "," + uvConst + ".y\n"; - - code += "mul " + sin + "," + animationRegisterCache.vertexTime + "," + uvConst + ".x\n"; - code += "sin " + sin + "," + sin + "\n"; - code += "add " + target + "," + target + "," + sin + "\n"; - - return code; - }; - - /** - * @inheritDoc - */ - ParticleUVNode.prototype.getAnimationState = function (animator) { - return animator.getAnimationState(this); - }; - - ParticleUVNode.prototype.updateUVData = function () { - this._iUvData = new Vector3D(Math.PI * 2 / this._cycle, this._scale, 0, 0); - }; - - /** - * @inheritDoc - */ - ParticleUVNode.prototype._iProcessAnimationSetting = function (particleAnimationSet) { - particleAnimationSet.hasUVNode = true; - }; - ParticleUVNode.UV_INDEX = 0; - - ParticleUVNode.U_AXIS = "x"; - - ParticleUVNode.V_AXIS = "y"; - return ParticleUVNode; - })(animators.ParticleNodeBase); - animators.ParticleUVNode = ParticleUVNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var Vector3D = away.geom.Vector3D; - - /** - * A particle animation node used to set the starting velocity of a particle. - */ - var ParticleVelocityNode = (function (_super) { - __extends(ParticleVelocityNode, _super); - /** - * Creates a new ParticleVelocityNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] velocity Defines the default velocity vector of the node, used when in global mode. - */ - function ParticleVelocityNode(mode /*uint*/ , velocity) { - if (typeof velocity === "undefined") { velocity = null; } - _super.call(this, "ParticleVelocity", mode, 3); - - this._pStateClass = animators.ParticleVelocityState; - - this._iVelocity = velocity || new Vector3D(); - } - /** - * @inheritDoc - */ - ParticleVelocityNode.prototype.getAGALVertexCode = function (shaderObject, animationRegisterCache) { - var velocityValue = (this._pMode == animators.ParticlePropertiesMode.GLOBAL) ? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleVelocityNode.VELOCITY_INDEX, velocityValue.index); - - var distance = animationRegisterCache.getFreeVertexVectorTemp(); - var code = ""; - code += "mul " + distance + "," + animationRegisterCache.vertexTime + "," + velocityValue + "\n"; - code += "add " + animationRegisterCache.positionTarget + ".xyz," + distance + "," + animationRegisterCache.positionTarget + ".xyz\n"; - - if (animationRegisterCache.needVelocity) - code += "add " + animationRegisterCache.velocityTarget + ".xyz," + velocityValue + ".xyz," + animationRegisterCache.velocityTarget + ".xyz\n"; - - return code; - }; - - /** - * @inheritDoc - */ - ParticleVelocityNode.prototype.getAnimationState = function (animator) { - return animator.getAnimationState(this); - }; - - /** - * @inheritDoc - */ - ParticleVelocityNode.prototype._iGeneratePropertyOfOneParticle = function (param) { - var _tempVelocity = param[ParticleVelocityNode.VELOCITY_VECTOR3D]; - if (!_tempVelocity) - throw new Error("there is no " + ParticleVelocityNode.VELOCITY_VECTOR3D + " in param!"); - - this._pOneData[0] = _tempVelocity.x; - this._pOneData[1] = _tempVelocity.y; - this._pOneData[2] = _tempVelocity.z; - }; - ParticleVelocityNode.VELOCITY_INDEX = 0; - - ParticleVelocityNode.VELOCITY_VECTOR3D = "VelocityVector3D"; - return ParticleVelocityNode; - })(animators.ParticleNodeBase); - animators.ParticleVelocityNode = ParticleVelocityNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * A skeleton animation node that uses two animation node inputs to blend a lineraly interpolated output of a skeleton pose. - */ - var SkeletonBinaryLERPNode = (function (_super) { - __extends(SkeletonBinaryLERPNode, _super); - /** - * Creates a new SkeletonBinaryLERPNode object. - */ - function SkeletonBinaryLERPNode() { - _super.call(this); - - this._pStateClass = animators.SkeletonBinaryLERPState; - } - /** - * @inheritDoc - */ - SkeletonBinaryLERPNode.prototype.getAnimationState = function (animator) { - return animator.getAnimationState(this); - }; - return SkeletonBinaryLERPNode; - })(animators.AnimationNodeBase); - animators.SkeletonBinaryLERPNode = SkeletonBinaryLERPNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * A skeleton animation node containing time-based animation data as individual skeleton poses. - */ - var SkeletonClipNode = (function (_super) { - __extends(SkeletonClipNode, _super); - /** - * Creates a new SkeletonClipNode object. - */ - function SkeletonClipNode() { - _super.call(this); - this._frames = new Array(); - /** - * Determines whether to use SLERP equations (true) or LERP equations (false) in the calculation - * of the output skeleton pose. Defaults to false. - */ - this.highQuality = false; - - this._pStateClass = animators.SkeletonClipState; - } - Object.defineProperty(SkeletonClipNode.prototype, "frames", { - /** - * Returns a vector of skeleton poses representing the pose of each animation frame in the clip. - */ - get: function () { - return this._frames; - }, - enumerable: true, - configurable: true - }); - - /** - * Adds a skeleton pose frame to the internal timeline of the animation node. - * - * @param skeletonPose The skeleton pose object to add to the timeline of the node. - * @param duration The specified duration of the frame in milliseconds. - */ - SkeletonClipNode.prototype.addFrame = function (skeletonPose, duration /*number /*uint*/ ) { - this._frames.push(skeletonPose); - this._pDurations.push(duration); - - this._pNumFrames = this._pDurations.length; - - this._pStitchDirty = true; - }; - - /** - * @inheritDoc - */ - SkeletonClipNode.prototype.getAnimationState = function (animator) { - return animator.getAnimationState(this); - }; - - /** - * @inheritDoc - */ - SkeletonClipNode.prototype._pUpdateStitch = function () { - _super.prototype._pUpdateStitch.call(this); - - var i = this._pNumFrames - 1; - var p1, p2, delta; - while (i--) { - this._pTotalDuration += this._pDurations[i]; - p1 = this._frames[i].jointPoses[0].translation; - p2 = this._frames[i + 1].jointPoses[0].translation; - delta = p2.subtract(p1); - this._pTotalDelta.x += delta.x; - this._pTotalDelta.y += delta.y; - this._pTotalDelta.z += delta.z; - } - - if (this._pStitchFinalFrame || !this._pLooping) { - this._pTotalDuration += this._pDurations[this._pNumFrames - 1]; - p1 = this._frames[0].jointPoses[0].translation; - p2 = this._frames[1].jointPoses[0].translation; - delta = p2.subtract(p1); - this._pTotalDelta.x += delta.x; - this._pTotalDelta.y += delta.y; - this._pTotalDelta.z += delta.z; - } - }; - return SkeletonClipNode; - })(animators.AnimationClipNodeBase); - animators.SkeletonClipNode = SkeletonClipNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * A skeleton animation node that uses a difference input pose with a base input pose to blend a linearly interpolated output of a skeleton pose. - */ - var SkeletonDifferenceNode = (function (_super) { - __extends(SkeletonDifferenceNode, _super); - /** - * Creates a new SkeletonAdditiveNode object. - */ - function SkeletonDifferenceNode() { - _super.call(this); - - this._pStateClass = animators.SkeletonDifferenceState; - } - /** - * @inheritDoc - */ - SkeletonDifferenceNode.prototype.getAnimationState = function (animator) { - return animator.getAnimationState(this); - }; - return SkeletonDifferenceNode; - })(animators.AnimationNodeBase); - animators.SkeletonDifferenceNode = SkeletonDifferenceNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * A skeleton animation node that uses four directional input poses with an input direction to blend a linearly interpolated output of a skeleton pose. - */ - var SkeletonDirectionalNode = (function (_super) { - __extends(SkeletonDirectionalNode, _super); - function SkeletonDirectionalNode() { - _super.call(this); - - this._pStateClass = animators.SkeletonDirectionalState; - } - /** - * @inheritDoc - */ - SkeletonDirectionalNode.prototype.getAnimationState = function (animator) { - return animator.getAnimationState(this); - }; - return SkeletonDirectionalNode; - })(animators.AnimationNodeBase); - animators.SkeletonDirectionalNode = SkeletonDirectionalNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * A skeleton animation node that uses an n-dimensional array of animation node inputs to blend a lineraly interpolated output of a skeleton pose. - */ - var SkeletonNaryLERPNode = (function (_super) { - __extends(SkeletonNaryLERPNode, _super); - /** - * Creates a new SkeletonNaryLERPNode object. - */ - function SkeletonNaryLERPNode() { - _super.call(this); - this._iInputs = new Array(); - - this._pStateClass = animators.SkeletonNaryLERPState; - } - Object.defineProperty(SkeletonNaryLERPNode.prototype, "numInputs", { - get: function () { - return this._numInputs; - }, - enumerable: true, - configurable: true - }); - - /** - * Returns an integer representing the input index of the given skeleton animation node. - * - * @param input The skeleton animation node for with the input index is requested. - */ - SkeletonNaryLERPNode.prototype.getInputIndex = function (input) { - return this._iInputs.indexOf(input); - }; - - /** - * Returns the skeleton animation node object that resides at the given input index. - * - * @param index The input index for which the skeleton animation node is requested. - */ - SkeletonNaryLERPNode.prototype.getInputAt = function (index /*uint*/ ) { - return this._iInputs[index]; - }; - - /** - * Adds a new skeleton animation node input to the animation node. - */ - SkeletonNaryLERPNode.prototype.addInput = function (input) { - this._iInputs[this._numInputs++] = input; - }; - - /** - * @inheritDoc - */ - SkeletonNaryLERPNode.prototype.getAnimationState = function (animator) { - return animator.getAnimationState(this); - }; - return SkeletonNaryLERPNode; - })(animators.AnimationNodeBase); - animators.SkeletonNaryLERPNode = SkeletonNaryLERPNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * A vertex animation node containing time-based animation data as individual geometry obejcts. - */ - var VertexClipNode = (function (_super) { - __extends(VertexClipNode, _super); - /** - * Creates a new VertexClipNode object. - */ - function VertexClipNode() { - _super.call(this); - this._frames = new Array(); - this._translations = new Array(); - - this._pStateClass = away.animators.VertexClipState; - } - Object.defineProperty(VertexClipNode.prototype, "frames", { - /** - * Returns a vector of geometry frames representing the vertex values of each animation frame in the clip. - */ - get: function () { - return this._frames; - }, - enumerable: true, - configurable: true - }); - - /** - * Adds a geometry object to the internal timeline of the animation node. - * - * @param geometry The geometry object to add to the timeline of the node. - * @param duration The specified duration of the frame in milliseconds. - * @param translation The absolute translation of the frame, used in root delta calculations for mesh movement. - */ - VertexClipNode.prototype.addFrame = function (geometry, duration /*uint*/ , translation) { - if (typeof translation === "undefined") { translation = null; } - this._frames.push(geometry); - this._pDurations.push(duration); - this._translations.push(translation || new away.geom.Vector3D()); - - this._pNumFrames = this._pDurations.length; - - this._pStitchDirty = true; - }; - - /** - * @inheritDoc - */ - VertexClipNode.prototype._pUpdateStitch = function () { - _super.prototype._pUpdateStitch.call(this); - - var i = this._pNumFrames - 1; - var p1, p2, delta; - while (i--) { - this._pTotalDuration += this._pDurations[i]; - p1 = this._translations[i]; - p2 = this._translations[i + 1]; - delta = p2.subtract(p1); - this._pTotalDelta.x += delta.x; - this._pTotalDelta.y += delta.y; - this._pTotalDelta.z += delta.z; - } - - if (this._pNumFrames > 1 && (this._pStitchFinalFrame || !this._pLooping)) { - this._pTotalDuration += this._pDurations[this._pNumFrames - 1]; - p1 = this._translations[0]; - p2 = this._translations[1]; - delta = p2.subtract(p1); - this._pTotalDelta.x += delta.x; - this._pTotalDelta.y += delta.y; - this._pTotalDelta.z += delta.z; - } - }; - return VertexClipNode; - })(animators.AnimationClipNodeBase); - animators.VertexClipNode = VertexClipNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -/// -var away; -(function (away) { - /// - (function (animators) { - /** - * - */ - var AnimationStateBase = (function () { - function AnimationStateBase(animator, animationNode) { - this._pRootDelta = new away.geom.Vector3D(); - this._pPositionDeltaDirty = true; - this._pStartTime = 0; - this._pAnimator = animator; - this._pAnimationNode = animationNode; - } - Object.defineProperty(AnimationStateBase.prototype, "positionDelta", { - /** - * Returns a 3d vector representing the translation delta of the animating entity for the current timestep of animation - */ - get: function () { - if (this._pPositionDeltaDirty) { - this._pUpdatePositionDelta(); - } - - return this._pRootDelta; - }, - enumerable: true, - configurable: true - }); - - /** - * Resets the start time of the node to a new value. - * - * @param startTime The absolute start time (in milliseconds) of the node's starting time. - */ - AnimationStateBase.prototype.offset = function (startTime) { - this._pStartTime = startTime; - - this._pPositionDeltaDirty = true; - }; - - /** - * Updates the configuration of the node to its current state. - * - * @param time The absolute time (in milliseconds) of the animator's play head position. - * - * @see away.animators.AnimatorBase#update() - */ - AnimationStateBase.prototype.update = function (time) { - if (this._pTime == time - this._pStartTime) { - return; - } - - this._pUpdateTime(time); - }; - - /** - * Sets the animation phase of the node. - * - * @param value The phase value to use. 0 represents the beginning of an animation clip, 1 represents the end. - */ - AnimationStateBase.prototype.phase = function (value) { - }; - - /** - * Updates the node's internal playhead position. - * - * @param time The local time (in milliseconds) of the node's playhead position. - */ - AnimationStateBase.prototype._pUpdateTime = function (time) { - this._pTime = time - this._pStartTime; - - this._pPositionDeltaDirty = true; - }; - - /** - * Updates the node's root delta position - */ - AnimationStateBase.prototype._pUpdatePositionDelta = function () { - }; - return AnimationStateBase; - })(); - animators.AnimationStateBase = AnimationStateBase; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * ... - */ - var ParticleStateBase = (function (_super) { - __extends(ParticleStateBase, _super); - function ParticleStateBase(animator, particleNode, needUpdateTime) { - if (typeof needUpdateTime === "undefined") { needUpdateTime = false; } - _super.call(this, animator, particleNode); - this._pDynamicProperties = new Array(); - this._pDynamicPropertiesDirty = new Object(); - - this._particleNode = particleNode; - this._pNeedUpdateTime = needUpdateTime; - } - Object.defineProperty(ParticleStateBase.prototype, "needUpdateTime", { - get: function () { - return this._pNeedUpdateTime; - }, - enumerable: true, - configurable: true - }); - - ParticleStateBase.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { - }; - - ParticleStateBase.prototype._pUpdateDynamicProperties = function (animationSubGeometry) { - this._pDynamicPropertiesDirty[animationSubGeometry._iUniqueId] = true; - - var animationParticles = animationSubGeometry.animationParticles; - var vertexData = animationSubGeometry.vertexData; - var totalLenOfOneVertex = animationSubGeometry.totalLenOfOneVertex; - var dataLength = this._particleNode.dataLength; - var dataOffset = this._particleNode._iDataOffset; - var vertexLength; - - // var particleOffset:number /*uint*/; - var startingOffset; - var vertexOffset; - var data; - var animationParticle; - - // var numParticles:number /*uint*/ = _positions.length/dataLength; - var numParticles = this._pDynamicProperties.length; - var i = 0; - var j = 0; - var k = 0; - - while (i < numParticles) { - while (j < numParticles && (animationParticle = animationParticles[j]).index == i) { - data = this._pDynamicProperties[i]; - vertexLength = animationParticle.numVertices * totalLenOfOneVertex; - startingOffset = animationParticle.startVertexIndex * totalLenOfOneVertex + dataOffset; - - for (k = 0; k < vertexLength; k += totalLenOfOneVertex) { - vertexOffset = startingOffset + k; - - for (k = 0; k < vertexLength; k += totalLenOfOneVertex) { - vertexOffset = startingOffset + k; - vertexData[vertexOffset++] = data.x; - vertexData[vertexOffset++] = data.y; - vertexData[vertexOffset++] = data.z; - - if (dataLength == 4) - vertexData[vertexOffset++] = data.w; - } - //loop through each value in the particle vertex - // switch(dataLength) { - // case 4: - // vertexData[vertexOffset++] = _positions[particleOffset++]; - // case 3: - // vertexData[vertexOffset++] = _positions[particleOffset++]; - // case 2: - // vertexData[vertexOffset++] = _positions[particleOffset++]; - // case 1: - // vertexData[vertexOffset++] = _positions[particleOffset++]; - // } - } - j++; - } - i++; - } - - animationSubGeometry.invalidateBuffer(); - }; - return ParticleStateBase; - })(animators.AnimationStateBase); - animators.ParticleStateBase = ParticleStateBase; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat; - var Vector3D = away.geom.Vector3D; - - /** - * ... - */ - var ParticleAccelerationState = (function (_super) { - __extends(ParticleAccelerationState, _super); - function ParticleAccelerationState(animator, particleAccelerationNode) { - _super.call(this, animator, particleAccelerationNode); - - this._particleAccelerationNode = particleAccelerationNode; - this._acceleration = this._particleAccelerationNode._acceleration; - - this.updateAccelerationData(); - } - Object.defineProperty(ParticleAccelerationState.prototype, "acceleration", { - /** - * Defines the acceleration vector of the state, used when in global mode. - */ - get: function () { - return this._acceleration; - }, - set: function (value) { - this._acceleration.x = value.x; - this._acceleration.y = value.y; - this._acceleration.z = value.z; - - this.updateAccelerationData(); - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - ParticleAccelerationState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { - var index = animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleAccelerationNode.ACCELERATION_INDEX); - - if (this._particleAccelerationNode.mode == animators.ParticlePropertiesMode.LOCAL_STATIC) - animationSubGeometry.activateVertexBuffer(index, this._particleAccelerationNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); - else - animationRegisterCache.setVertexConst(index, this._halfAcceleration.x, this._halfAcceleration.y, this._halfAcceleration.z); - }; - - ParticleAccelerationState.prototype.updateAccelerationData = function () { - if (this._particleAccelerationNode.mode == animators.ParticlePropertiesMode.GLOBAL) - this._halfAcceleration = new Vector3D(this._acceleration.x / 2, this._acceleration.y / 2, this._acceleration.z / 2); - }; - return ParticleAccelerationState; - })(animators.ParticleStateBase); - animators.ParticleAccelerationState = ParticleAccelerationState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat; - - /** - * ... - */ - var ParticleBezierCurveState = (function (_super) { - __extends(ParticleBezierCurveState, _super); - function ParticleBezierCurveState(animator, particleBezierCurveNode) { - _super.call(this, animator, particleBezierCurveNode); - - this._particleBezierCurveNode = particleBezierCurveNode; - this._controlPoint = this._particleBezierCurveNode._iControlPoint; - this._endPoint = this._particleBezierCurveNode._iEndPoint; - } - Object.defineProperty(ParticleBezierCurveState.prototype, "controlPoint", { - /** - * Defines the default control point of the node, used when in global mode. - */ - get: function () { - return this._controlPoint; - }, - set: function (value) { - this._controlPoint = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ParticleBezierCurveState.prototype, "endPoint", { - /** - * Defines the default end point of the node, used when in global mode. - */ - get: function () { - return this._endPoint; - }, - set: function (value) { - this._endPoint = value; - }, - enumerable: true, - configurable: true - }); - - - ParticleBezierCurveState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { - var controlIndex = animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleBezierCurveNode.BEZIER_CONTROL_INDEX); - var endIndex = animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleBezierCurveNode.BEZIER_END_INDEX); - - if (this._particleBezierCurveNode.mode == animators.ParticlePropertiesMode.LOCAL_STATIC) { - animationSubGeometry.activateVertexBuffer(controlIndex, this._particleBezierCurveNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); - animationSubGeometry.activateVertexBuffer(endIndex, this._particleBezierCurveNode._iDataOffset + 3, stage, ContextGLVertexBufferFormat.FLOAT_3); - } else { - animationRegisterCache.setVertexConst(controlIndex, this._controlPoint.x, this._controlPoint.y, this._controlPoint.z); - animationRegisterCache.setVertexConst(endIndex, this._endPoint.x, this._endPoint.y, this._endPoint.z); - } - }; - return ParticleBezierCurveState; - })(animators.ParticleStateBase); - animators.ParticleBezierCurveState = ParticleBezierCurveState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var Matrix3D = away.geom.Matrix3D; - var Orientation3D = away.geom.Orientation3D; - - var MathConsts = away.geom.MathConsts; - - /** - * ... - */ - var ParticleBillboardState = (function (_super) { - __extends(ParticleBillboardState, _super); - /** - * - */ - function ParticleBillboardState(animator, particleNode) { - _super.call(this, animator, particleNode); - this._matrix = new Matrix3D; - - this._billboardAxis = particleNode._iBillboardAxis; - } - ParticleBillboardState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { - var comps; - if (this._billboardAxis) { - var pos = renderable.sourceEntity.sceneTransform.position; - var look = camera.sceneTransform.position.subtract(pos); - var right = look.crossProduct(this._billboardAxis); - right.normalize(); - look = this.billboardAxis.crossProduct(right); - look.normalize(); - - //create a quick inverse projection matrix - this._matrix.copyFrom(renderable.sourceEntity.sceneTransform); - comps = this._matrix.decompose(Orientation3D.AXIS_ANGLE); - this._matrix.copyColumnFrom(0, right); - this._matrix.copyColumnFrom(1, this.billboardAxis); - this._matrix.copyColumnFrom(2, look); - this._matrix.copyColumnFrom(3, pos); - this._matrix.appendRotation(-comps[1].w * MathConsts.RADIANS_TO_DEGREES, comps[1]); - } else { - //create a quick inverse projection matrix - this._matrix.copyFrom(renderable.sourceEntity.sceneTransform); - this._matrix.append(camera.inverseSceneTransform); - - //decompose using axis angle rotations - comps = this._matrix.decompose(Orientation3D.AXIS_ANGLE); - - //recreate the matrix with just the rotation data - this._matrix.identity(); - this._matrix.appendRotation(-comps[1].w * MathConsts.RADIANS_TO_DEGREES, comps[1]); - } - - //set a new matrix transform constant - animationRegisterCache.setVertexConstFromMatrix(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleBillboardNode.MATRIX_INDEX), this._matrix); - }; - - Object.defineProperty(ParticleBillboardState.prototype, "billboardAxis", { - /** - * Defines the billboard axis. - */ - get: function () { - return this.billboardAxis; - }, - set: function (value) { - this.billboardAxis = value ? value.clone() : null; - if (this.billboardAxis) - this.billboardAxis.normalize(); - }, - enumerable: true, - configurable: true - }); - - return ParticleBillboardState; - })(animators.ParticleStateBase); - animators.ParticleBillboardState = ParticleBillboardState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat; - - var Vector3D = away.geom.Vector3D; - - /** - * ... - * @author ... - */ - var ParticleColorState = (function (_super) { - __extends(ParticleColorState, _super); - function ParticleColorState(animator, particleColorNode) { - _super.call(this, animator, particleColorNode); - - this._particleColorNode = particleColorNode; - this._usesMultiplier = this._particleColorNode._iUsesMultiplier; - this._usesOffset = this._particleColorNode._iUsesOffset; - this._usesCycle = this._particleColorNode._iUsesCycle; - this._usesPhase = this._particleColorNode._iUsesPhase; - this._startColor = this._particleColorNode._iStartColor; - this._endColor = this._particleColorNode._iEndColor; - this._cycleDuration = this._particleColorNode._iCycleDuration; - this._cyclePhase = this._particleColorNode._iCyclePhase; - - this.updateColorData(); - } - Object.defineProperty(ParticleColorState.prototype, "startColor", { - /** - * Defines the start color transform of the state, when in global mode. - */ - get: function () { - return this._startColor; - }, - set: function (value) { - this._startColor = value; - - this.updateColorData(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ParticleColorState.prototype, "endColor", { - /** - * Defines the end color transform of the state, when in global mode. - */ - get: function () { - return this._endColor; - }, - set: function (value) { - this._endColor = value; - - this.updateColorData(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ParticleColorState.prototype, "cycleDuration", { - /** - * Defines the duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. - */ - get: function () { - return this._cycleDuration; - }, - set: function (value) { - this._cycleDuration = value; - - this.updateColorData(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ParticleColorState.prototype, "cyclePhase", { - /** - * Defines the phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. - */ - get: function () { - return this._cyclePhase; - }, - set: function (value) { - this._cyclePhase = value; - - this.updateColorData(); - }, - enumerable: true, - configurable: true - }); - - - ParticleColorState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { - if (animationRegisterCache.needFragmentAnimation) { - var dataOffset = this._particleColorNode._iDataOffset; - if (this._usesCycle) - animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleColorNode.CYCLE_INDEX), this._cycleData.x, this._cycleData.y, this._cycleData.z, this._cycleData.w); - - if (this._usesMultiplier) { - if (this._particleColorNode.mode == animators.ParticlePropertiesMode.LOCAL_STATIC) { - animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleColorNode.START_MULTIPLIER_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); - dataOffset += 4; - animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleColorNode.DELTA_MULTIPLIER_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); - dataOffset += 4; - } else { - animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleColorNode.START_MULTIPLIER_INDEX), this._startMultiplierData.x, this._startMultiplierData.y, this._startMultiplierData.z, this._startMultiplierData.w); - animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleColorNode.DELTA_MULTIPLIER_INDEX), this._deltaMultiplierData.x, this._deltaMultiplierData.y, this._deltaMultiplierData.z, this._deltaMultiplierData.w); - } - } - if (this._usesOffset) { - if (this._particleColorNode.mode == animators.ParticlePropertiesMode.LOCAL_STATIC) { - animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleColorNode.START_OFFSET_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); - dataOffset += 4; - animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleColorNode.DELTA_OFFSET_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); - dataOffset += 4; - } else { - animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleColorNode.START_OFFSET_INDEX), this._startOffsetData.x, this._startOffsetData.y, this._startOffsetData.z, this._startOffsetData.w); - animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleColorNode.DELTA_OFFSET_INDEX), this._deltaOffsetData.x, this._deltaOffsetData.y, this._deltaOffsetData.z, this._deltaOffsetData.w); - } - } - } - }; - - ParticleColorState.prototype.updateColorData = function () { - if (this._usesCycle) { - if (this._cycleDuration <= 0) - throw (new Error("the cycle duration must be greater than zero")); - this._cycleData = new Vector3D(Math.PI * 2 / this._cycleDuration, this._cyclePhase * Math.PI / 180, 0, 0); - } - if (this._particleColorNode.mode == animators.ParticlePropertiesMode.GLOBAL) { - if (this._usesCycle) { - if (this._usesMultiplier) { - this._startMultiplierData = new Vector3D((this._startColor.redMultiplier + this._endColor.redMultiplier) / 2, (this._startColor.greenMultiplier + this._endColor.greenMultiplier) / 2, (this._startColor.blueMultiplier + this._endColor.blueMultiplier) / 2, (this._startColor.alphaMultiplier + this._endColor.alphaMultiplier) / 2); - this._deltaMultiplierData = new Vector3D((this._endColor.redMultiplier - this._startColor.redMultiplier) / 2, (this._endColor.greenMultiplier - this._startColor.greenMultiplier) / 2, (this._endColor.blueMultiplier - this._startColor.blueMultiplier) / 2, (this._endColor.alphaMultiplier - this._startColor.alphaMultiplier) / 2); - } - - if (this._usesOffset) { - this._startOffsetData = new Vector3D((this._startColor.redOffset + this._endColor.redOffset) / (255 * 2), (this._startColor.greenOffset + this._endColor.greenOffset) / (255 * 2), (this._startColor.blueOffset + this._endColor.blueOffset) / (255 * 2), (this._startColor.alphaOffset + this._endColor.alphaOffset) / (255 * 2)); - this._deltaOffsetData = new Vector3D((this._endColor.redOffset - this._startColor.redOffset) / (255 * 2), (this._endColor.greenOffset - this._startColor.greenOffset) / (255 * 2), (this._endColor.blueOffset - this._startColor.blueOffset) / (255 * 2), (this._endColor.alphaOffset - this._startColor.alphaOffset) / (255 * 2)); - } - } else { - if (this._usesMultiplier) { - this._startMultiplierData = new Vector3D(this._startColor.redMultiplier, this._startColor.greenMultiplier, this._startColor.blueMultiplier, this._startColor.alphaMultiplier); - this._deltaMultiplierData = new Vector3D((this._endColor.redMultiplier - this._startColor.redMultiplier), (this._endColor.greenMultiplier - this._startColor.greenMultiplier), (this._endColor.blueMultiplier - this._startColor.blueMultiplier), (this._endColor.alphaMultiplier - this._startColor.alphaMultiplier)); - } - - if (this._usesOffset) { - this._startOffsetData = new Vector3D(this._startColor.redOffset / 255, this._startColor.greenOffset / 255, this._startColor.blueOffset / 255, this._startColor.alphaOffset / 255); - this._deltaOffsetData = new Vector3D((this._endColor.redOffset - this._startColor.redOffset) / 255, (this._endColor.greenOffset - this._startColor.greenOffset) / 255, (this._endColor.blueOffset - this._startColor.blueOffset) / 255, (this._endColor.alphaOffset - this._startColor.alphaOffset) / 255); - } - } - } - }; - return ParticleColorState; - })(animators.ParticleStateBase); - animators.ParticleColorState = ParticleColorState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat; - var Vector3D = away.geom.Vector3D; - - var MathConsts = away.geom.MathConsts; - - /** - * ... - */ - var ParticleFollowState = (function (_super) { - __extends(ParticleFollowState, _super); - function ParticleFollowState(animator, particleFollowNode) { - _super.call(this, animator, particleFollowNode, true); - this._targetPos = new Vector3D(); - this._targetEuler = new Vector3D(); - //temporary vector3D for calculation - this._temp = new Vector3D(); - - this._particleFollowNode = particleFollowNode; - this._smooth = particleFollowNode._iSmooth; - } - Object.defineProperty(ParticleFollowState.prototype, "followTarget", { - get: function () { - return this._followTarget; - }, - set: function (value) { - this._followTarget = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ParticleFollowState.prototype, "smooth", { - get: function () { - return this._smooth; - }, - set: function (value) { - this._smooth = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - ParticleFollowState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { - if (this._followTarget) { - if (this._particleFollowNode._iUsesPosition) { - this._targetPos.x = this._followTarget.transform.position.x / renderable.sourceEntity.scaleX; - this._targetPos.y = this._followTarget.transform.position.y / renderable.sourceEntity.scaleY; - this._targetPos.z = this._followTarget.transform.position.z / renderable.sourceEntity.scaleZ; - } - if (this._particleFollowNode._iUsesRotation) { - this._targetEuler.x = this._followTarget.rotationX; - this._targetEuler.y = this._followTarget.rotationY; - this._targetEuler.z = this._followTarget.rotationZ; - this._targetEuler.scaleBy(MathConsts.DEGREES_TO_RADIANS); - } - } - - //initialization - if (!this._prePos) - this._prePos = this._targetPos.clone(); - if (!this._preEuler) - this._preEuler = this._targetEuler.clone(); - - var currentTime = this._pTime / 1000; - var previousTime = animationSubGeometry.previousTime; - var deltaTime = currentTime - previousTime; - - var needProcess = previousTime != currentTime; - - if (this._particleFollowNode._iUsesPosition && this._particleFollowNode._iUsesRotation) { - if (needProcess) - this.processPositionAndRotation(currentTime, deltaTime, animationSubGeometry); - - animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleFollowNode.FOLLOW_POSITION_INDEX), this._particleFollowNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); - animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleFollowNode.FOLLOW_ROTATION_INDEX), this._particleFollowNode._iDataOffset + 3, stage, ContextGLVertexBufferFormat.FLOAT_3); - } else if (this._particleFollowNode._iUsesPosition) { - if (needProcess) - this.processPosition(currentTime, deltaTime, animationSubGeometry); - - animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleFollowNode.FOLLOW_POSITION_INDEX), this._particleFollowNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); - } else if (this._particleFollowNode._iUsesRotation) { - if (needProcess) - this.precessRotation(currentTime, deltaTime, animationSubGeometry); - - animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleFollowNode.FOLLOW_ROTATION_INDEX), this._particleFollowNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); - } - - this._prePos.copyFrom(this._targetPos); - this._targetEuler.copyFrom(this._targetEuler); - animationSubGeometry.previousTime = currentTime; - }; - - ParticleFollowState.prototype.processPosition = function (currentTime, deltaTime, animationSubGeometry) { - var data = animationSubGeometry.animationParticles; - var vertexData = animationSubGeometry.vertexData; - - var changed = false; - var len = data.length; - var interpolatedPos; - var posVelocity; - if (this._smooth) { - posVelocity = this._prePos.subtract(this._targetPos); - posVelocity.scaleBy(1 / deltaTime); - } else - interpolatedPos = this._targetPos; - for (var i = 0; i < len; i++) { - var k = (currentTime - data[i].startTime) / data[i].totalTime; - var t = (k - Math.floor(k)) * data[i].totalTime; - if (t - deltaTime <= 0) { - var inc = data[i].startVertexIndex * animationSubGeometry.totalLenOfOneVertex + this._particleFollowNode._iDataOffset; - - if (this._smooth) { - this._temp.copyFrom(posVelocity); - this._temp.scaleBy(t); - interpolatedPos = this._targetPos.add(this._temp); - } - - if (vertexData[inc] != interpolatedPos.x || vertexData[inc + 1] != interpolatedPos.y || vertexData[inc + 2] != interpolatedPos.z) { - changed = true; - for (var j = 0; j < data[i].numVertices; j++) { - vertexData[inc++] = interpolatedPos.x; - vertexData[inc++] = interpolatedPos.y; - vertexData[inc++] = interpolatedPos.z; - } - } - } - } - if (changed) - animationSubGeometry.invalidateBuffer(); - }; - - ParticleFollowState.prototype.precessRotation = function (currentTime, deltaTime, animationSubGeometry) { - var data = animationSubGeometry.animationParticles; - var vertexData = animationSubGeometry.vertexData; - - var changed = false; - var len = data.length; - - var interpolatedRotation; - var rotationVelocity; - - if (this._smooth) { - rotationVelocity = this._preEuler.subtract(this._targetEuler); - rotationVelocity.scaleBy(1 / deltaTime); - } else - interpolatedRotation = this._targetEuler; - - for (var i = 0; i < len; i++) { - var k = (currentTime - data[i].startTime) / data[i].totalTime; - var t = (k - Math.floor(k)) * data[i].totalTime; - if (t - deltaTime <= 0) { - var inc = data[i].startVertexIndex * animationSubGeometry.totalLenOfOneVertex + this._particleFollowNode._iDataOffset; - - if (this._smooth) { - this._temp.copyFrom(rotationVelocity); - this._temp.scaleBy(t); - interpolatedRotation = this._targetEuler.add(this._temp); - } - - if (vertexData[inc] != interpolatedRotation.x || vertexData[inc + 1] != interpolatedRotation.y || vertexData[inc + 2] != interpolatedRotation.z) { - changed = true; - for (var j = 0; j < data[i].numVertices; j++) { - vertexData[inc++] = interpolatedRotation.x; - vertexData[inc++] = interpolatedRotation.y; - vertexData[inc++] = interpolatedRotation.z; - } - } - } - } - if (changed) - animationSubGeometry.invalidateBuffer(); - }; - - ParticleFollowState.prototype.processPositionAndRotation = function (currentTime, deltaTime, animationSubGeometry) { - var data = animationSubGeometry.animationParticles; - var vertexData = animationSubGeometry.vertexData; - - var changed = false; - var len = data.length; - - var interpolatedPos; - var interpolatedRotation; - - var posVelocity; - var rotationVelocity; - if (this._smooth) { - posVelocity = this._prePos.subtract(this._targetPos); - posVelocity.scaleBy(1 / deltaTime); - rotationVelocity = this._preEuler.subtract(this._targetEuler); - rotationVelocity.scaleBy(1 / deltaTime); - } else { - interpolatedPos = this._targetPos; - interpolatedRotation = this._targetEuler; - } - - for (var i = 0; i < len; i++) { - var k = (currentTime - data[i].startTime) / data[i].totalTime; - var t = (k - Math.floor(k)) * data[i].totalTime; - if (t - deltaTime <= 0) { - var inc = data[i].startVertexIndex * animationSubGeometry.totalLenOfOneVertex + this._particleFollowNode._iDataOffset; - if (this._smooth) { - this._temp.copyFrom(posVelocity); - this._temp.scaleBy(t); - interpolatedPos = this._targetPos.add(this._temp); - - this._temp.copyFrom(rotationVelocity); - this._temp.scaleBy(t); - interpolatedRotation = this._targetEuler.add(this._temp); - } - - if (vertexData[inc] != interpolatedPos.x || vertexData[inc + 1] != interpolatedPos.y || vertexData[inc + 2] != interpolatedPos.z || vertexData[inc + 3] != interpolatedRotation.x || vertexData[inc + 4] != interpolatedRotation.y || vertexData[inc + 5] != interpolatedRotation.z) { - changed = true; - for (var j = 0; j < data[i].numVertices; j++) { - vertexData[inc++] = interpolatedPos.x; - vertexData[inc++] = interpolatedPos.y; - vertexData[inc++] = interpolatedPos.z; - vertexData[inc++] = interpolatedRotation.x; - vertexData[inc++] = interpolatedRotation.y; - vertexData[inc++] = interpolatedRotation.z; - } - } - } - } - if (changed) - animationSubGeometry.invalidateBuffer(); - }; - return ParticleFollowState; - })(animators.ParticleStateBase); - animators.ParticleFollowState = ParticleFollowState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat; - - var Vector3D = away.geom.Vector3D; - - var ParticleInitialColorState = (function (_super) { - __extends(ParticleInitialColorState, _super); - function ParticleInitialColorState(animator, particleInitialColorNode) { - _super.call(this, animator, particleInitialColorNode); - - this._particleInitialColorNode = particleInitialColorNode; - this._usesMultiplier = particleInitialColorNode._iUsesMultiplier; - this._usesOffset = particleInitialColorNode._iUsesOffset; - this._initialColor = particleInitialColorNode._iInitialColor; - - this.updateColorData(); - } - Object.defineProperty(ParticleInitialColorState.prototype, "initialColor", { - /** - * Defines the initial color transform of the state, when in global mode. - */ - get: function () { - return this._initialColor; - }, - set: function (value) { - this._initialColor = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - ParticleInitialColorState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { - // TODO: not used - renderable = renderable; - camera = camera; - - if (animationRegisterCache.needFragmentAnimation) { - if (this._particleInitialColorNode.mode == animators.ParticlePropertiesMode.LOCAL_STATIC) { - var dataOffset = this._particleInitialColorNode._iDataOffset; - if (this._usesMultiplier) { - animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleInitialColorNode.MULTIPLIER_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); - dataOffset += 4; - } - if (this._usesOffset) - animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleInitialColorNode.OFFSET_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); - } else { - if (this._usesMultiplier) - animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleInitialColorNode.MULTIPLIER_INDEX), this._multiplierData.x, this._multiplierData.y, this._multiplierData.z, this._multiplierData.w); - if (this._usesOffset) - animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleInitialColorNode.OFFSET_INDEX), this._offsetData.x, this._offsetData.y, this._offsetData.z, this._offsetData.w); - } - } - }; - - ParticleInitialColorState.prototype.updateColorData = function () { - if (this._particleInitialColorNode.mode == animators.ParticlePropertiesMode.GLOBAL) { - if (this._usesMultiplier) - this._multiplierData = new Vector3D(this._initialColor.redMultiplier, this._initialColor.greenMultiplier, this._initialColor.blueMultiplier, this._initialColor.alphaMultiplier); - if (this._usesOffset) - this._offsetData = new Vector3D(this._initialColor.redOffset / 255, this._initialColor.greenOffset / 255, this._initialColor.blueOffset / 255, this._initialColor.alphaOffset / 255); - } - }; - return ParticleInitialColorState; - })(animators.ParticleStateBase); - animators.ParticleInitialColorState = ParticleInitialColorState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat; - var Matrix3D = away.geom.Matrix3D; - var Vector3D = away.geom.Vector3D; - - /** - * ... - */ - var ParticleOrbitState = (function (_super) { - __extends(ParticleOrbitState, _super); - function ParticleOrbitState(animator, particleOrbitNode) { - _super.call(this, animator, particleOrbitNode); - - this._particleOrbitNode = particleOrbitNode; - this._usesEulers = this._particleOrbitNode._iUsesEulers; - this._usesCycle = this._particleOrbitNode._iUsesCycle; - this._usesPhase = this._particleOrbitNode._iUsesPhase; - this._eulers = this._particleOrbitNode._iEulers; - this._radius = this._particleOrbitNode._iRadius; - this._cycleDuration = this._particleOrbitNode._iCycleDuration; - this._cyclePhase = this._particleOrbitNode._iCyclePhase; - this.updateOrbitData(); - } - Object.defineProperty(ParticleOrbitState.prototype, "radius", { - /** - * Defines the radius of the orbit when in global mode. Defaults to 100. - */ - get: function () { - return this._radius; - }, - set: function (value) { - this._radius = value; - - this.updateOrbitData(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ParticleOrbitState.prototype, "cycleDuration", { - /** - * Defines the duration of the orbit in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. - */ - get: function () { - return this._cycleDuration; - }, - set: function (value) { - this._cycleDuration = value; - - this.updateOrbitData(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ParticleOrbitState.prototype, "cyclePhase", { - /** - * Defines the phase of the orbit in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. - */ - get: function () { - return this._cyclePhase; - }, - set: function (value) { - this._cyclePhase = value; - - this.updateOrbitData(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ParticleOrbitState.prototype, "eulers", { - /** - * Defines the euler rotation in degrees, applied to the orientation of the orbit when in global mode. - */ - get: function () { - return this._eulers; - }, - set: function (value) { - this._eulers = value; - - this.updateOrbitData(); - }, - enumerable: true, - configurable: true - }); - - - ParticleOrbitState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { - var index = animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleOrbitNode.ORBIT_INDEX); - - if (this._particleOrbitNode.mode == animators.ParticlePropertiesMode.LOCAL_STATIC) { - if (this._usesPhase) - animationSubGeometry.activateVertexBuffer(index, this._particleOrbitNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); - else - animationSubGeometry.activateVertexBuffer(index, this._particleOrbitNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); - } else - animationRegisterCache.setVertexConst(index, this._orbitData.x, this._orbitData.y, this._orbitData.z, this._orbitData.w); - - if (this._usesEulers) - animationRegisterCache.setVertexConstFromMatrix(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleOrbitNode.EULERS_INDEX), this._eulersMatrix); - }; - - ParticleOrbitState.prototype.updateOrbitData = function () { - if (this._usesEulers) { - this._eulersMatrix = new Matrix3D(); - this._eulersMatrix.appendRotation(this._eulers.x, Vector3D.X_AXIS); - this._eulersMatrix.appendRotation(this._eulers.y, Vector3D.Y_AXIS); - this._eulersMatrix.appendRotation(this._eulers.z, Vector3D.Z_AXIS); - } - if (this._particleOrbitNode.mode == animators.ParticlePropertiesMode.GLOBAL) { - this._orbitData = new Vector3D(this._radius, 0, this._radius * Math.PI * 2, this._cyclePhase * Math.PI / 180); - if (this._usesCycle) { - if (this._cycleDuration <= 0) - throw (new Error("the cycle duration must be greater than zero")); - this._orbitData.y = Math.PI * 2 / this._cycleDuration; - } else - this._orbitData.y = Math.PI * 2; - } - }; - return ParticleOrbitState; - })(animators.ParticleStateBase); - animators.ParticleOrbitState = ParticleOrbitState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat; - var Vector3D = away.geom.Vector3D; - - /** - * ... - */ - var ParticleOscillatorState = (function (_super) { - __extends(ParticleOscillatorState, _super); - function ParticleOscillatorState(animator, particleOscillatorNode) { - _super.call(this, animator, particleOscillatorNode); - - this._particleOscillatorNode = particleOscillatorNode; - this._oscillator = this._particleOscillatorNode._iOscillator; - - this.updateOscillatorData(); - } - Object.defineProperty(ParticleOscillatorState.prototype, "oscillator", { - /** - * Defines the default oscillator axis (x, y, z) and cycleDuration (w) of the state, used when in global mode. - */ - get: function () { - return this._oscillator; - }, - set: function (value) { - this._oscillator = value; - - this.updateOscillatorData(); - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - ParticleOscillatorState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { - var index = animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleOscillatorNode.OSCILLATOR_INDEX); - - if (this._particleOscillatorNode.mode == animators.ParticlePropertiesMode.LOCAL_STATIC) - animationSubGeometry.activateVertexBuffer(index, this._particleOscillatorNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); - else - animationRegisterCache.setVertexConst(index, this._oscillatorData.x, this._oscillatorData.y, this._oscillatorData.z, this._oscillatorData.w); - }; - - ParticleOscillatorState.prototype.updateOscillatorData = function () { - if (this._particleOscillatorNode.mode == animators.ParticlePropertiesMode.GLOBAL) { - if (this._oscillator.w <= 0) - throw (new Error("the cycle duration must greater than zero")); - - if (this._oscillatorData == null) - this._oscillatorData = new Vector3D(); - - this._oscillatorData.x = this._oscillator.x; - this._oscillatorData.y = this._oscillator.y; - this._oscillatorData.z = this._oscillator.z; - this._oscillatorData.w = Math.PI * 2 / this._oscillator.w; - } - }; - return ParticleOscillatorState; - })(animators.ParticleStateBase); - animators.ParticleOscillatorState = ParticleOscillatorState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat; - - /** - * ... - * @author ... - */ - var ParticlePositionState = (function (_super) { - __extends(ParticlePositionState, _super); - function ParticlePositionState(animator, particlePositionNode) { - _super.call(this, animator, particlePositionNode); - - this._particlePositionNode = particlePositionNode; - this._position = this._particlePositionNode._iPosition; - } - Object.defineProperty(ParticlePositionState.prototype, "position", { - /** - * Defines the position of the particle when in global mode. Defaults to 0,0,0. - */ - get: function () { - return this._position; - }, - set: function (value) { - this._position = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * - */ - ParticlePositionState.prototype.getPositions = function () { - return this._pDynamicProperties; - }; - - ParticlePositionState.prototype.setPositions = function (value) { - this._pDynamicProperties = value; - - this._pDynamicPropertiesDirty = new Object(); - }; - - /** - * @inheritDoc - */ - ParticlePositionState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { - if (this._particlePositionNode.mode == animators.ParticlePropertiesMode.LOCAL_DYNAMIC && !this._pDynamicPropertiesDirty[animationSubGeometry._iUniqueId]) - this._pUpdateDynamicProperties(animationSubGeometry); - - var index = animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticlePositionNode.POSITION_INDEX); - - if (this._particlePositionNode.mode == animators.ParticlePropertiesMode.GLOBAL) - animationRegisterCache.setVertexConst(index, this._position.x, this._position.y, this._position.z); - else - animationSubGeometry.activateVertexBuffer(index, this._particlePositionNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); - }; - return ParticlePositionState; - })(animators.ParticleStateBase); - animators.ParticlePositionState = ParticlePositionState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var Matrix3D = away.geom.Matrix3D; - - /** - * ... - */ - var ParticleRotateToHeadingState = (function (_super) { - __extends(ParticleRotateToHeadingState, _super); - function ParticleRotateToHeadingState(animator, particleNode) { - _super.call(this, animator, particleNode); - this._matrix = new Matrix3D(); - } - ParticleRotateToHeadingState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { - if (animationRegisterCache.hasBillboard) { - this._matrix.copyFrom(renderable.sourceEntity.sceneTransform); - this._matrix.append(camera.inverseSceneTransform); - animationRegisterCache.setVertexConstFromMatrix(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleRotateToHeadingNode.MATRIX_INDEX), this._matrix); - } - }; - return ParticleRotateToHeadingState; - })(animators.ParticleStateBase); - animators.ParticleRotateToHeadingState = ParticleRotateToHeadingState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat; - - var Matrix3D = away.geom.Matrix3D; - - /** - * ... - */ - var ParticleRotateToPositionState = (function (_super) { - __extends(ParticleRotateToPositionState, _super); - function ParticleRotateToPositionState(animator, particleRotateToPositionNode) { - _super.call(this, animator, particleRotateToPositionNode); - this._matrix = new Matrix3D(); - - this._particleRotateToPositionNode = particleRotateToPositionNode; - this._position = this._particleRotateToPositionNode._iPosition; - } - Object.defineProperty(ParticleRotateToPositionState.prototype, "position", { - /** - * Defines the position of the point the particle will rotate to face when in global mode. Defaults to 0,0,0. - */ - get: function () { - return this._position; - }, - set: function (value) { - this._position = value; - }, - enumerable: true, - configurable: true - }); - - - ParticleRotateToPositionState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { - var index = animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleRotateToPositionNode.POSITION_INDEX); - - if (animationRegisterCache.hasBillboard) { - this._matrix.copyFrom(renderable.sourceEntity.sceneTransform); - this._matrix.append(camera.inverseSceneTransform); - animationRegisterCache.setVertexConstFromMatrix(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleRotateToPositionNode.MATRIX_INDEX), this._matrix); - } - - if (this._particleRotateToPositionNode.mode == animators.ParticlePropertiesMode.GLOBAL) { - this._offset = renderable.sourceEntity.inverseSceneTransform.transformVector(this._position); - animationRegisterCache.setVertexConst(index, this._offset.x, this._offset.y, this._offset.z); - } else - animationSubGeometry.activateVertexBuffer(index, this._particleRotateToPositionNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); - }; - return ParticleRotateToPositionState; - })(animators.ParticleStateBase); - animators.ParticleRotateToPositionState = ParticleRotateToPositionState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat; - var Vector3D = away.geom.Vector3D; - - /** - * ... - */ - var ParticleRotationalVelocityState = (function (_super) { - __extends(ParticleRotationalVelocityState, _super); - function ParticleRotationalVelocityState(animator, particleRotationNode) { - _super.call(this, animator, particleRotationNode); - - this._particleRotationalVelocityNode = particleRotationNode; - this._rotationalVelocity = this._particleRotationalVelocityNode._iRotationalVelocity; - - this.updateRotationalVelocityData(); - } - Object.defineProperty(ParticleRotationalVelocityState.prototype, "rotationalVelocity", { - /** - * Defines the default rotationalVelocity of the state, used when in global mode. - */ - get: function () { - return this._rotationalVelocity; - }, - set: function (value) { - this._rotationalVelocity = value; - - this.updateRotationalVelocityData(); - }, - enumerable: true, - configurable: true - }); - - - /** - * - */ - ParticleRotationalVelocityState.prototype.getRotationalVelocities = function () { - return this._pDynamicProperties; - }; - - ParticleRotationalVelocityState.prototype.setRotationalVelocities = function (value) { - this._pDynamicProperties = value; - - this._pDynamicPropertiesDirty = new Object(); - }; - - /** - * @inheritDoc - */ - ParticleRotationalVelocityState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { - if (this._particleRotationalVelocityNode.mode == animators.ParticlePropertiesMode.LOCAL_DYNAMIC && !this._pDynamicPropertiesDirty[animationSubGeometry._iUniqueId]) - this._pUpdateDynamicProperties(animationSubGeometry); - - var index = animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleRotationalVelocityNode.ROTATIONALVELOCITY_INDEX); - - if (this._particleRotationalVelocityNode.mode == animators.ParticlePropertiesMode.GLOBAL) - animationRegisterCache.setVertexConst(index, this._rotationalVelocityData.x, this._rotationalVelocityData.y, this._rotationalVelocityData.z, this._rotationalVelocityData.w); - else - animationSubGeometry.activateVertexBuffer(index, this._particleRotationalVelocityNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); - }; - - ParticleRotationalVelocityState.prototype.updateRotationalVelocityData = function () { - if (this._particleRotationalVelocityNode.mode == animators.ParticlePropertiesMode.GLOBAL) { - if (this._rotationalVelocity.w <= 0) - throw (new Error("the cycle duration must greater than zero")); - var rotation = this._rotationalVelocity.clone(); - - if (rotation.length <= 0) - rotation.z = 1; //set the default direction - else - rotation.normalize(); - - // w is used as angle/2 in agal - this._rotationalVelocityData = new Vector3D(rotation.x, rotation.y, rotation.z, Math.PI / rotation.w); - } - }; - return ParticleRotationalVelocityState; - })(animators.ParticleStateBase); - animators.ParticleRotationalVelocityState = ParticleRotationalVelocityState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat; - var Vector3D = away.geom.Vector3D; - - /** - * ... - */ - var ParticleScaleState = (function (_super) { - __extends(ParticleScaleState, _super); - function ParticleScaleState(animator, particleScaleNode) { - _super.call(this, animator, particleScaleNode); - - this._particleScaleNode = particleScaleNode; - this._usesCycle = this._particleScaleNode._iUsesCycle; - this._usesPhase = this._particleScaleNode._iUsesPhase; - this._minScale = this._particleScaleNode._iMinScale; - this._maxScale = this._particleScaleNode._iMaxScale; - this._cycleDuration = this._particleScaleNode._iCycleDuration; - this._cyclePhase = this._particleScaleNode._iCyclePhase; - - this.updateScaleData(); - } - Object.defineProperty(ParticleScaleState.prototype, "minScale", { - /** - * Defines the end scale of the state, when in global mode. Defaults to 1. - */ - get: function () { - return this._minScale; - }, - set: function (value) { - this._minScale = value; - - this.updateScaleData(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ParticleScaleState.prototype, "maxScale", { - /** - * Defines the end scale of the state, when in global mode. Defaults to 1. - */ - get: function () { - return this._maxScale; - }, - set: function (value) { - this._maxScale = value; - - this.updateScaleData(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ParticleScaleState.prototype, "cycleDuration", { - /** - * Defines the duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. - */ - get: function () { - return this._cycleDuration; - }, - set: function (value) { - this._cycleDuration = value; - - this.updateScaleData(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ParticleScaleState.prototype, "cyclePhase", { - /** - * Defines the phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. - */ - get: function () { - return this._cyclePhase; - }, - set: function (value) { - this._cyclePhase = value; - - this.updateScaleData(); - }, - enumerable: true, - configurable: true - }); - - - ParticleScaleState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { - var index = animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleScaleNode.SCALE_INDEX); - - if (this._particleScaleNode.mode == animators.ParticlePropertiesMode.LOCAL_STATIC) { - if (this._usesCycle) { - if (this._usesPhase) - animationSubGeometry.activateVertexBuffer(index, this._particleScaleNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); - else - animationSubGeometry.activateVertexBuffer(index, this._particleScaleNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); - } else - animationSubGeometry.activateVertexBuffer(index, this._particleScaleNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_2); - } else - animationRegisterCache.setVertexConst(index, this._scaleData.x, this._scaleData.y, this._scaleData.z, this._scaleData.w); - }; - - ParticleScaleState.prototype.updateScaleData = function () { - if (this._particleScaleNode.mode == animators.ParticlePropertiesMode.GLOBAL) { - if (this._usesCycle) { - if (this._cycleDuration <= 0) - throw (new Error("the cycle duration must be greater than zero")); - this._scaleData = new Vector3D((this._minScale + this._maxScale) / 2, Math.abs(this._minScale - this._maxScale) / 2, Math.PI * 2 / this._cycleDuration, this._cyclePhase * Math.PI / 180); - } else - this._scaleData = new Vector3D(this._minScale, this._maxScale - this._minScale, 0, 0); - } - }; - return ParticleScaleState; - })(animators.ParticleStateBase); - animators.ParticleScaleState = ParticleScaleState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ParticleSegmentedColorState = (function (_super) { - __extends(ParticleSegmentedColorState, _super); - function ParticleSegmentedColorState(animator, particleSegmentedColorNode) { - _super.call(this, animator, particleSegmentedColorNode); - - this._usesMultiplier = particleSegmentedColorNode._iUsesMultiplier; - this._usesOffset = particleSegmentedColorNode._iUsesOffset; - this._startColor = particleSegmentedColorNode._iStartColor; - this._endColor = particleSegmentedColorNode._iEndColor; - this._segmentPoints = particleSegmentedColorNode._iSegmentPoints; - this._numSegmentPoint = particleSegmentedColorNode._iNumSegmentPoint; - this.updateColorData(); - } - Object.defineProperty(ParticleSegmentedColorState.prototype, "startColor", { - /** - * Defines the start color transform of the state, when in global mode. - */ - get: function () { - return this._startColor; - }, - set: function (value) { - this._startColor = value; - - this.updateColorData(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ParticleSegmentedColorState.prototype, "endColor", { - /** - * Defines the end color transform of the state, when in global mode. - */ - get: function () { - return this._endColor; - }, - set: function (value) { - this._endColor = value; - this.updateColorData(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ParticleSegmentedColorState.prototype, "numSegmentPoint", { - /** - * Defines the number of segments. - */ - get: function () { - return this._numSegmentPoint; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ParticleSegmentedColorState.prototype, "segmentPoints", { - /** - * Defines the key points of color - */ - get: function () { - return this._segmentPoints; - }, - set: function (value) { - this._segmentPoints = value; - this.updateColorData(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ParticleSegmentedColorState.prototype, "usesMultiplier", { - get: function () { - return this._usesMultiplier; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ParticleSegmentedColorState.prototype, "usesOffset", { - get: function () { - return this._usesOffset; - }, - enumerable: true, - configurable: true - }); - - ParticleSegmentedColorState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { - if (animationRegisterCache.needFragmentAnimation) { - if (this._numSegmentPoint > 0) - animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleSegmentedColorNode.TIME_DATA_INDEX), this._timeLifeData[0], this._timeLifeData[1], this._timeLifeData[2], this._timeLifeData[3]); - if (this._usesMultiplier) - animationRegisterCache.setVertexConstFromArray(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleSegmentedColorNode.START_MULTIPLIER_INDEX), this._multiplierData); - if (this._usesOffset) - animationRegisterCache.setVertexConstFromArray(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleSegmentedColorNode.START_OFFSET_INDEX), this._offsetData); - } - }; - - ParticleSegmentedColorState.prototype.updateColorData = function () { - this._timeLifeData = new Array(); - this._multiplierData = new Array(); - this._offsetData = new Array(); - var i; - for (i = 0; i < this._numSegmentPoint; i++) { - if (i == 0) - this._timeLifeData.push(this._segmentPoints[i].life); - else - this._timeLifeData.push(this._segmentPoints[i].life - this._segmentPoints[i - 1].life); - } - if (this._numSegmentPoint == 0) - this._timeLifeData.push(1); - else - this._timeLifeData.push(1 - this._segmentPoints[i - 1].life); - - if (this._usesMultiplier) { - this._multiplierData.push(this._startColor.redMultiplier, this._startColor.greenMultiplier, this._startColor.blueMultiplier, this._startColor.alphaMultiplier); - for (i = 0; i < this._numSegmentPoint; i++) { - if (i == 0) - this._multiplierData.push((this._segmentPoints[i].color.redMultiplier - this._startColor.redMultiplier) / this._timeLifeData[i], (this._segmentPoints[i].color.greenMultiplier - this._startColor.greenMultiplier) / this._timeLifeData[i], (this._segmentPoints[i].color.blueMultiplier - this._startColor.blueMultiplier) / this._timeLifeData[i], (this._segmentPoints[i].color.alphaMultiplier - this._startColor.alphaMultiplier) / this._timeLifeData[i]); - else - this._multiplierData.push((this._segmentPoints[i].color.redMultiplier - this._segmentPoints[i - 1].color.redMultiplier) / this._timeLifeData[i], (this._segmentPoints[i].color.greenMultiplier - this._segmentPoints[i - 1].color.greenMultiplier) / this._timeLifeData[i], (this._segmentPoints[i].color.blueMultiplier - this._segmentPoints[i - 1].color.blueMultiplier) / this._timeLifeData[i], (this._segmentPoints[i].color.alphaMultiplier - this._segmentPoints[i - 1].color.alphaMultiplier) / this._timeLifeData[i]); - } - if (this._numSegmentPoint == 0) - this._multiplierData.push(this._endColor.redMultiplier - this._startColor.redMultiplier, this._endColor.greenMultiplier - this._startColor.greenMultiplier, this._endColor.blueMultiplier - this._startColor.blueMultiplier, this._endColor.alphaMultiplier - this._startColor.alphaMultiplier); - else - this._multiplierData.push((this._endColor.redMultiplier - this._segmentPoints[i - 1].color.redMultiplier) / this._timeLifeData[i], (this._endColor.greenMultiplier - this._segmentPoints[i - 1].color.greenMultiplier) / this._timeLifeData[i], (this._endColor.blueMultiplier - this._segmentPoints[i - 1].color.blueMultiplier) / this._timeLifeData[i], (this._endColor.alphaMultiplier - this._segmentPoints[i - 1].color.alphaMultiplier) / this._timeLifeData[i]); - } - - if (this._usesOffset) { - this._offsetData.push(this._startColor.redOffset / 255, this._startColor.greenOffset / 255, this._startColor.blueOffset / 255, this._startColor.alphaOffset / 255); - for (i = 0; i < this._numSegmentPoint; i++) { - if (i == 0) - this._offsetData.push((this._segmentPoints[i].color.redOffset - this._startColor.redOffset) / this._timeLifeData[i] / 255, (this._segmentPoints[i].color.greenOffset - this._startColor.greenOffset) / this._timeLifeData[i] / 255, (this._segmentPoints[i].color.blueOffset - this._startColor.blueOffset) / this._timeLifeData[i] / 255, (this._segmentPoints[i].color.alphaOffset - this._startColor.alphaOffset) / this._timeLifeData[i] / 255); - else - this._offsetData.push((this._segmentPoints[i].color.redOffset - this._segmentPoints[i - 1].color.redOffset) / this._timeLifeData[i] / 255, (this._segmentPoints[i].color.greenOffset - this._segmentPoints[i - 1].color.greenOffset) / this._timeLifeData[i] / 255, (this._segmentPoints[i].color.blueOffset - this._segmentPoints[i - 1].color.blueOffset) / this._timeLifeData[i] / 255, (this._segmentPoints[i].color.alphaOffset - this._segmentPoints[i - 1].color.alphaOffset) / this._timeLifeData[i] / 255); - } - if (this._numSegmentPoint == 0) - this._offsetData.push((this._endColor.redOffset - this._startColor.redOffset) / 255, (this._endColor.greenOffset - this._startColor.greenOffset) / 255, (this._endColor.blueOffset - this._startColor.blueOffset) / 255, (this._endColor.alphaOffset - this._startColor.alphaOffset) / 255); - else - this._offsetData.push((this._endColor.redOffset - this._segmentPoints[i - 1].color.redOffset) / this._timeLifeData[i] / 255, (this._endColor.greenOffset - this._segmentPoints[i - 1].color.greenOffset) / this._timeLifeData[i] / 255, (this._endColor.blueOffset - this._segmentPoints[i - 1].color.blueOffset) / this._timeLifeData[i] / 255, (this._endColor.alphaOffset - this._segmentPoints[i - 1].color.alphaOffset) / this._timeLifeData[i] / 255); - } - - //cut off the data - this._timeLifeData.length = 4; - }; - return ParticleSegmentedColorState; - })(animators.ParticleStateBase); - animators.ParticleSegmentedColorState = ParticleSegmentedColorState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat; - - /** - * ... - */ - var ParticleSpriteSheetState = (function (_super) { - __extends(ParticleSpriteSheetState, _super); - function ParticleSpriteSheetState(animator, particleSpriteSheetNode) { - _super.call(this, animator, particleSpriteSheetNode); - - this._particleSpriteSheetNode = particleSpriteSheetNode; - - this._usesCycle = this._particleSpriteSheetNode._iUsesCycle; - this._usesPhase = this._particleSpriteSheetNode._iUsesCycle; - this._totalFrames = this._particleSpriteSheetNode._iTotalFrames; - this._numColumns = this._particleSpriteSheetNode._iNumColumns; - this._numRows = this._particleSpriteSheetNode._iNumRows; - this._cycleDuration = this._particleSpriteSheetNode._iCycleDuration; - this._cyclePhase = this._particleSpriteSheetNode._iCyclePhase; - - this.updateSpriteSheetData(); - } - Object.defineProperty(ParticleSpriteSheetState.prototype, "cyclePhase", { - /** - * Defines the cycle phase, when in global mode. Defaults to zero. - */ - get: function () { - return this._cyclePhase; - }, - set: function (value) { - this._cyclePhase = value; - - this.updateSpriteSheetData(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ParticleSpriteSheetState.prototype, "cycleDuration", { - /** - * Defines the cycle duration in seconds, when in global mode. Defaults to 1. - */ - get: function () { - return this._cycleDuration; - }, - set: function (value) { - this._cycleDuration = value; - - this.updateSpriteSheetData(); - }, - enumerable: true, - configurable: true - }); - - - ParticleSpriteSheetState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { - if (animationRegisterCache.needUVAnimation) { - animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleSpriteSheetNode.UV_INDEX_0), this._spriteSheetData[0], this._spriteSheetData[1], this._spriteSheetData[2], this._spriteSheetData[3]); - if (this._usesCycle) { - var index = animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleSpriteSheetNode.UV_INDEX_1); - if (this._particleSpriteSheetNode.mode == animators.ParticlePropertiesMode.LOCAL_STATIC) { - if (this._usesPhase) - animationSubGeometry.activateVertexBuffer(index, this._particleSpriteSheetNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); - else - animationSubGeometry.activateVertexBuffer(index, this._particleSpriteSheetNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_2); - } else - animationRegisterCache.setVertexConst(index, this._spriteSheetData[4], this._spriteSheetData[5]); - } - } - }; - - ParticleSpriteSheetState.prototype.updateSpriteSheetData = function () { - this._spriteSheetData = new Array(8); - - var uTotal = this._totalFrames / this._numColumns; - - this._spriteSheetData[0] = uTotal; - this._spriteSheetData[1] = 1 / this._numColumns; - this._spriteSheetData[2] = 1 / this._numRows; - - if (this._usesCycle) { - if (this._cycleDuration <= 0) - throw (new Error("the cycle duration must be greater than zero")); - this._spriteSheetData[4] = uTotal / this._cycleDuration; - this._spriteSheetData[5] = this._cycleDuration; - if (this._usesPhase) - this._spriteSheetData[6] = this._cyclePhase; - } - }; - return ParticleSpriteSheetState; - })(animators.ParticleStateBase); - animators.ParticleSpriteSheetState = ParticleSpriteSheetState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat; - - /** - * ... - */ - var ParticleTimeState = (function (_super) { - __extends(ParticleTimeState, _super); - function ParticleTimeState(animator, particleTimeNode) { - _super.call(this, animator, particleTimeNode, true); - - this._particleTimeNode = particleTimeNode; - } - ParticleTimeState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { - animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleTimeNode.TIME_STREAM_INDEX), this._particleTimeNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); - - var particleTime = this._pTime / 1000; - animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleTimeNode.TIME_CONSTANT_INDEX), particleTime, particleTime, particleTime, particleTime); - }; - return ParticleTimeState; - })(animators.ParticleStateBase); - animators.ParticleTimeState = ParticleTimeState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * ... - */ - var ParticleUVState = (function (_super) { - __extends(ParticleUVState, _super); - function ParticleUVState(animator, particleUVNode) { - _super.call(this, animator, particleUVNode); - - this._particleUVNode = particleUVNode; - } - ParticleUVState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { - if (animationRegisterCache.needUVAnimation) { - var index = animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleUVNode.UV_INDEX); - var data = this._particleUVNode._iUvData; - animationRegisterCache.setVertexConst(index, data.x, data.y); - } - }; - return ParticleUVState; - })(animators.ParticleStateBase); - animators.ParticleUVState = ParticleUVState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat; - - /** - * ... - */ - var ParticleVelocityState = (function (_super) { - __extends(ParticleVelocityState, _super); - function ParticleVelocityState(animator, particleVelocityNode) { - _super.call(this, animator, particleVelocityNode); - - this._particleVelocityNode = particleVelocityNode; - this._velocity = this._particleVelocityNode._iVelocity; - } - Object.defineProperty(ParticleVelocityState.prototype, "velocity", { - /** - * Defines the default velocity vector of the state, used when in global mode. - */ - get: function () { - return this._velocity; - }, - set: function (value) { - this._velocity = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * - */ - ParticleVelocityState.prototype.getVelocities = function () { - return this._pDynamicProperties; - }; - - ParticleVelocityState.prototype.setVelocities = function (value) { - this._pDynamicProperties = value; - - this._pDynamicPropertiesDirty = new Object(); - }; - - ParticleVelocityState.prototype.setRenderState = function (stage, renderable, animationSubGeometry, animationRegisterCache, camera) { - if (this._particleVelocityNode.mode == animators.ParticlePropertiesMode.LOCAL_DYNAMIC && !this._pDynamicPropertiesDirty[animationSubGeometry._iUniqueId]) - this._pUpdateDynamicProperties(animationSubGeometry); - - var index = animationRegisterCache.getRegisterIndex(this._pAnimationNode, animators.ParticleVelocityNode.VELOCITY_INDEX); - - if (this._particleVelocityNode.mode == animators.ParticlePropertiesMode.GLOBAL) - animationRegisterCache.setVertexConst(index, this._velocity.x, this._velocity.y, this._velocity.z); - else - animationSubGeometry.activateVertexBuffer(index, this._particleVelocityNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); - }; - return ParticleVelocityState; - })(animators.ParticleStateBase); - animators.ParticleVelocityState = ParticleVelocityState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (animators) { - /** - * - */ - var AnimationClipState = (function (_super) { - __extends(AnimationClipState, _super); - function AnimationClipState(animator, animationClipNode) { - _super.call(this, animator, animationClipNode); - this._pFramesDirty = true; - - this._animationClipNode = animationClipNode; - } - Object.defineProperty(AnimationClipState.prototype, "blendWeight", { - /** - * Returns a fractional value between 0 and 1 representing the blending ratio of the current playhead position - * between the current frame (0) and next frame (1) of the animation. - * - * @see #currentFrame - * @see #nextFrame - */ - get: function () { - if (this._pFramesDirty) - this._pUpdateFrames(); - - return this._pBlendWeight; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(AnimationClipState.prototype, "currentFrame", { - /** - * Returns the current frame of animation in the clip based on the internal playhead position. - */ - get: function () { - if (this._pFramesDirty) - this._pUpdateFrames(); - - return this._pCurrentFrame; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(AnimationClipState.prototype, "nextFrame", { - /** - * Returns the next frame of animation in the clip based on the internal playhead position. - */ - get: function () { - if (this._pFramesDirty) - this._pUpdateFrames(); - - return this._pNextFrame; - }, - enumerable: true, - configurable: true - }); - - /** - * @inheritDoc - */ - AnimationClipState.prototype.update = function (time /*int*/ ) { - if (!this._animationClipNode.looping) { - if (time > this._pStartTime + this._animationClipNode.totalDuration) - time = this._pStartTime + this._animationClipNode.totalDuration; - else if (time < this._pStartTime) - time = this._pStartTime; - } - - if (this._pTime == time - this._pStartTime) - return; - - this._pUpdateTime(time); - }; - - /** - * @inheritDoc - */ - AnimationClipState.prototype.phase = function (value) { - var time = value * this._animationClipNode.totalDuration + this._pStartTime; - - if (this._pTime == time - this._pStartTime) - return; - - this._pUpdateTime(time); - }; - - /** - * @inheritDoc - */ - AnimationClipState.prototype._pUpdateTime = function (time /*int*/ ) { - this._pFramesDirty = true; - - this._pTimeDir = (time - this._pStartTime > this._pTime) ? 1 : -1; - - _super.prototype._pUpdateTime.call(this, time); - }; - - /** - * Updates the nodes internal playhead to determine the current and next animation frame, and the blendWeight between the two. - * - * @see #currentFrame - * @see #nextFrame - * @see #blendWeight - */ - AnimationClipState.prototype._pUpdateFrames = function () { - this._pFramesDirty = false; - - var looping = this._animationClipNode.looping; - var totalDuration = this._animationClipNode.totalDuration; - var lastFrame = this._animationClipNode.lastFrame; - var time = this._pTime; - - //trace("time", time, totalDuration) - if (looping && (time >= totalDuration || time < 0)) { - time %= totalDuration; - if (time < 0) - time += totalDuration; - } - - if (!looping && time >= totalDuration) { - this.notifyPlaybackComplete(); - this._pCurrentFrame = lastFrame; - this._pNextFrame = lastFrame; - this._pBlendWeight = 0; - } else if (!looping && time <= 0) { - this._pCurrentFrame = 0; - this._pNextFrame = 0; - this._pBlendWeight = 0; - } else if (this._animationClipNode.fixedFrameRate) { - var t = time / totalDuration * lastFrame; - this._pCurrentFrame = Math.floor(t); - this._pBlendWeight = t - this._pCurrentFrame; - this._pNextFrame = this._pCurrentFrame + 1; - } else { - this._pCurrentFrame = 0; - this._pNextFrame = 0; - - var dur = 0, frameTime; - var durations = this._animationClipNode.durations; - - do { - frameTime = dur; - dur += durations[this._pNextFrame]; - this._pCurrentFrame = this._pNextFrame++; - } while(time > dur); - - if (this._pCurrentFrame == lastFrame) { - this._pCurrentFrame = 0; - this._pNextFrame = 1; - } - - this._pBlendWeight = (time - frameTime) / durations[this._pCurrentFrame]; - } - }; - - AnimationClipState.prototype.notifyPlaybackComplete = function () { - if (this._animationStatePlaybackComplete == null) - this._animationStatePlaybackComplete = new away.events.AnimationStateEvent(away.events.AnimationStateEvent.PLAYBACK_COMPLETE, this._pAnimator, this, this._animationClipNode); - - this._animationClipNode.dispatchEvent(this._animationStatePlaybackComplete); - }; - return AnimationClipState; - })(animators.AnimationStateBase); - animators.AnimationClipState = AnimationClipState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * - */ - var SkeletonBinaryLERPState = (function (_super) { - __extends(SkeletonBinaryLERPState, _super); - function SkeletonBinaryLERPState(animator, skeletonAnimationNode) { - _super.call(this, animator, skeletonAnimationNode); - this._blendWeight = 0; - this._skeletonPose = new animators.SkeletonPose(); - this._skeletonPoseDirty = true; - - this._skeletonAnimationNode = skeletonAnimationNode; - - this._inputA = animator.getAnimationState(this._skeletonAnimationNode.inputA); - this._inputB = animator.getAnimationState(this._skeletonAnimationNode.inputB); - } - Object.defineProperty(SkeletonBinaryLERPState.prototype, "blendWeight", { - /** - * Defines a fractional value between 0 and 1 representing the blending ratio between inputA (0) and inputB (1), - * used to produce the skeleton pose output. - * - * @see inputA - * @see inputB - */ - get: function () { - return this._blendWeight; - }, - set: function (value) { - this._blendWeight = value; - - this._pPositionDeltaDirty = true; - this._skeletonPoseDirty = true; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - SkeletonBinaryLERPState.prototype.phase = function (value) { - this._skeletonPoseDirty = true; - - this._pPositionDeltaDirty = true; - - this._inputA.phase(value); - this._inputB.phase(value); - }; - - /** - * @inheritDoc - */ - SkeletonBinaryLERPState.prototype._pUpdateTime = function (time /*int*/ ) { - this._skeletonPoseDirty = true; - - this._inputA.update(time); - this._inputB.update(time); - - _super.prototype._pUpdateTime.call(this, time); - }; - - /** - * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. - */ - SkeletonBinaryLERPState.prototype.getSkeletonPose = function (skeleton) { - if (this._skeletonPoseDirty) - this.updateSkeletonPose(skeleton); - - return this._skeletonPose; - }; - - /** - * @inheritDoc - */ - SkeletonBinaryLERPState.prototype._pUpdatePositionDelta = function () { - this._pPositionDeltaDirty = false; - - var deltA = this._inputA.positionDelta; - var deltB = this._inputB.positionDelta; - - this._pRootDelta.x = deltA.x + this._blendWeight * (deltB.x - deltA.x); - this._pRootDelta.y = deltA.y + this._blendWeight * (deltB.y - deltA.y); - this._pRootDelta.z = deltA.z + this._blendWeight * (deltB.z - deltA.z); - }; - - /** - * Updates the output skeleton pose of the node based on the blendWeight value between input nodes. - * - * @param skeleton The skeleton used by the animator requesting the ouput pose. - */ - SkeletonBinaryLERPState.prototype.updateSkeletonPose = function (skeleton) { - this._skeletonPoseDirty = false; - - var endPose; - var endPoses = this._skeletonPose.jointPoses; - var poses1 = this._inputA.getSkeletonPose(skeleton).jointPoses; - var poses2 = this._inputB.getSkeletonPose(skeleton).jointPoses; - var pose1, pose2; - var p1, p2; - var tr; - var numJoints = skeleton.numJoints; - - // :s - if (endPoses.length != numJoints) - endPoses.length = numJoints; - - for (var i = 0; i < numJoints; ++i) { - endPose = endPoses[i]; - - if (endPose == null) - endPose = endPoses[i] = new animators.JointPose(); - - pose1 = poses1[i]; - pose2 = poses2[i]; - p1 = pose1.translation; - p2 = pose2.translation; - - endPose.orientation.lerp(pose1.orientation, pose2.orientation, this._blendWeight); - - tr = endPose.translation; - tr.x = p1.x + this._blendWeight * (p2.x - p1.x); - tr.y = p1.y + this._blendWeight * (p2.y - p1.y); - tr.z = p1.z + this._blendWeight * (p2.z - p1.z); - } - }; - return SkeletonBinaryLERPState; - })(animators.AnimationStateBase); - animators.SkeletonBinaryLERPState = SkeletonBinaryLERPState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var Vector3D = away.geom.Vector3D; - - /** - * - */ - var SkeletonClipState = (function (_super) { - __extends(SkeletonClipState, _super); - function SkeletonClipState(animator, skeletonClipNode) { - _super.call(this, animator, skeletonClipNode); - this._rootPos = new Vector3D(); - this._skeletonPose = new animators.SkeletonPose(); - this._skeletonPoseDirty = true; - - this._skeletonClipNode = skeletonClipNode; - this._frames = this._skeletonClipNode.frames; - } - Object.defineProperty(SkeletonClipState.prototype, "currentPose", { - /** - * Returns the current skeleton pose frame of animation in the clip based on the internal playhead position. - */ - get: function () { - if (this._pFramesDirty) - this._pUpdateFrames(); - - return this._currentPose; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(SkeletonClipState.prototype, "nextPose", { - /** - * Returns the next skeleton pose frame of animation in the clip based on the internal playhead position. - */ - get: function () { - if (this._pFramesDirty) - this._pUpdateFrames(); - - return this._nextPose; - }, - enumerable: true, - configurable: true - }); - - /** - * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. - */ - SkeletonClipState.prototype.getSkeletonPose = function (skeleton) { - if (this._skeletonPoseDirty) - this.updateSkeletonPose(skeleton); - - return this._skeletonPose; - }; - - /** - * @inheritDoc - */ - SkeletonClipState.prototype._pUpdateTime = function (time /*int*/ ) { - this._skeletonPoseDirty = true; - - _super.prototype._pUpdateTime.call(this, time); - }; - - /** - * @inheritDoc - */ - SkeletonClipState.prototype._pUpdateFrames = function () { - _super.prototype._pUpdateFrames.call(this); - - this._currentPose = this._frames[this._pCurrentFrame]; - - if (this._skeletonClipNode.looping && this._pNextFrame >= this._skeletonClipNode.lastFrame) { - this._nextPose = this._frames[0]; - this._pAnimator.dispatchCycleEvent(); - } else - this._nextPose = this._frames[this._pNextFrame]; - }; - - /** - * Updates the output skeleton pose of the node based on the internal playhead position. - * - * @param skeleton The skeleton used by the animator requesting the ouput pose. - */ - SkeletonClipState.prototype.updateSkeletonPose = function (skeleton) { - this._skeletonPoseDirty = false; - - if (!this._skeletonClipNode.totalDuration) - return; - - if (this._pFramesDirty) - this._pUpdateFrames(); - - var currentPose = this._currentPose.jointPoses; - var nextPose = this._nextPose.jointPoses; - var numJoints = skeleton.numJoints; - var p1, p2; - var pose1, pose2; - var endPoses = this._skeletonPose.jointPoses; - var endPose; - var tr; - - // :s - if (endPoses.length != numJoints) - endPoses.length = numJoints; - - if ((numJoints != currentPose.length) || (numJoints != nextPose.length)) - throw new Error("joint counts don't match!"); - - for (var i = 0; i < numJoints; ++i) { - endPose = endPoses[i]; - - if (endPose == null) - endPose = endPoses[i] = new animators.JointPose(); - - pose1 = currentPose[i]; - pose2 = nextPose[i]; - p1 = pose1.translation; - p2 = pose2.translation; - - if (this._skeletonClipNode.highQuality) - endPose.orientation.slerp(pose1.orientation, pose2.orientation, this._pBlendWeight); - else - endPose.orientation.lerp(pose1.orientation, pose2.orientation, this._pBlendWeight); - - if (i > 0) { - tr = endPose.translation; - tr.x = p1.x + this._pBlendWeight * (p2.x - p1.x); - tr.y = p1.y + this._pBlendWeight * (p2.y - p1.y); - tr.z = p1.z + this._pBlendWeight * (p2.z - p1.z); - } - } - }; - - /** - * @inheritDoc - */ - SkeletonClipState.prototype._pUpdatePositionDelta = function () { - this._pPositionDeltaDirty = false; - - if (this._pFramesDirty) - this._pUpdateFrames(); - - var p1, p2, p3; - var totalDelta = this._skeletonClipNode.totalDelta; - - // jumping back, need to reset position - if ((this._pTimeDir > 0 && this._pNextFrame < this._pOldFrame) || (this._pTimeDir < 0 && this._pNextFrame > this._pOldFrame)) { - this._rootPos.x -= totalDelta.x * this._pTimeDir; - this._rootPos.y -= totalDelta.y * this._pTimeDir; - this._rootPos.z -= totalDelta.z * this._pTimeDir; - } - - var dx = this._rootPos.x; - var dy = this._rootPos.y; - var dz = this._rootPos.z; - - if (this._skeletonClipNode.stitchFinalFrame && this._pNextFrame == this._skeletonClipNode.lastFrame) { - p1 = this._frames[0].jointPoses[0].translation; - p2 = this._frames[1].jointPoses[0].translation; - p3 = this._currentPose.jointPoses[0].translation; - - this._rootPos.x = p3.x + p1.x + this._pBlendWeight * (p2.x - p1.x); - this._rootPos.y = p3.y + p1.y + this._pBlendWeight * (p2.y - p1.y); - this._rootPos.z = p3.z + p1.z + this._pBlendWeight * (p2.z - p1.z); - } else { - p1 = this._currentPose.jointPoses[0].translation; - p2 = this._frames[this._pNextFrame].jointPoses[0].translation; //cover the instances where we wrap the pose but still want the final frame translation values - this._rootPos.x = p1.x + this._pBlendWeight * (p2.x - p1.x); - this._rootPos.y = p1.y + this._pBlendWeight * (p2.y - p1.y); - this._rootPos.z = p1.z + this._pBlendWeight * (p2.z - p1.z); - } - - this._pRootDelta.x = this._rootPos.x - dx; - this._pRootDelta.y = this._rootPos.y - dy; - this._pRootDelta.z = this._rootPos.z - dz; - - this._pOldFrame = this._pNextFrame; - }; - return SkeletonClipState; - })(animators.AnimationClipState); - animators.SkeletonClipState = SkeletonClipState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var Quaternion = away.geom.Quaternion; - - /** - * - */ - var SkeletonDifferenceState = (function (_super) { - __extends(SkeletonDifferenceState, _super); - function SkeletonDifferenceState(animator, skeletonAnimationNode) { - _super.call(this, animator, skeletonAnimationNode); - this._blendWeight = 0; - this._skeletonPose = new animators.SkeletonPose(); - this._skeletonPoseDirty = true; - - this._skeletonAnimationNode = skeletonAnimationNode; - - this._baseInput = animator.getAnimationState(this._skeletonAnimationNode.baseInput); - this._differenceInput = animator.getAnimationState(this._skeletonAnimationNode.differenceInput); - } - Object.defineProperty(SkeletonDifferenceState.prototype, "blendWeight", { - /** - * Defines a fractional value between 0 and 1 representing the blending ratio between the base input (0) and difference input (1), - * used to produce the skeleton pose output. - * - * @see #baseInput - * @see #differenceInput - */ - get: function () { - return this._blendWeight; - }, - set: function (value) { - this._blendWeight = value; - - this._pPositionDeltaDirty = true; - this._skeletonPoseDirty = true; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - SkeletonDifferenceState.prototype.phase = function (value) { - this._skeletonPoseDirty = true; - - this._pPositionDeltaDirty = true; - - this._baseInput.phase(value); - this._baseInput.phase(value); - }; - - /** - * @inheritDoc - */ - SkeletonDifferenceState.prototype._pUpdateTime = function (time /*int*/ ) { - this._skeletonPoseDirty = true; - - this._baseInput.update(time); - this._differenceInput.update(time); - - _super.prototype._pUpdateTime.call(this, time); - }; - - /** - * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. - */ - SkeletonDifferenceState.prototype.getSkeletonPose = function (skeleton) { - if (this._skeletonPoseDirty) - this.updateSkeletonPose(skeleton); - - return this._skeletonPose; - }; - - /** - * @inheritDoc - */ - SkeletonDifferenceState.prototype._pUpdatePositionDelta = function () { - this._pPositionDeltaDirty = false; - - var deltA = this._baseInput.positionDelta; - var deltB = this._differenceInput.positionDelta; - - this.positionDelta.x = deltA.x + this._blendWeight * deltB.x; - this.positionDelta.y = deltA.y + this._blendWeight * deltB.y; - this.positionDelta.z = deltA.z + this._blendWeight * deltB.z; - }; - - /** - * Updates the output skeleton pose of the node based on the blendWeight value between base input and difference input nodes. - * - * @param skeleton The skeleton used by the animator requesting the ouput pose. - */ - SkeletonDifferenceState.prototype.updateSkeletonPose = function (skeleton) { - this._skeletonPoseDirty = false; - - var endPose; - var endPoses = this._skeletonPose.jointPoses; - var basePoses = this._baseInput.getSkeletonPose(skeleton).jointPoses; - var diffPoses = this._differenceInput.getSkeletonPose(skeleton).jointPoses; - var base, diff; - var basePos, diffPos; - var tr; - var numJoints = skeleton.numJoints; - - // :s - if (endPoses.length != numJoints) - endPoses.length = numJoints; - - for (var i = 0; i < numJoints; ++i) { - endPose = endPoses[i]; - - if (endPose == null) - endPose = endPoses[i] = new animators.JointPose(); - - base = basePoses[i]; - diff = diffPoses[i]; - basePos = base.translation; - diffPos = diff.translation; - - SkeletonDifferenceState._tempQuat.multiply(diff.orientation, base.orientation); - endPose.orientation.lerp(base.orientation, SkeletonDifferenceState._tempQuat, this._blendWeight); - - tr = endPose.translation; - tr.x = basePos.x + this._blendWeight * diffPos.x; - tr.y = basePos.y + this._blendWeight * diffPos.y; - tr.z = basePos.z + this._blendWeight * diffPos.z; - } - }; - SkeletonDifferenceState._tempQuat = new Quaternion(); - return SkeletonDifferenceState; - })(animators.AnimationStateBase); - animators.SkeletonDifferenceState = SkeletonDifferenceState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * - */ - var SkeletonDirectionalState = (function (_super) { - __extends(SkeletonDirectionalState, _super); - function SkeletonDirectionalState(animator, skeletonAnimationNode) { - _super.call(this, animator, skeletonAnimationNode); - this._skeletonPose = new animators.SkeletonPose(); - this._skeletonPoseDirty = true; - this._blendWeight = 0; - this._direction = 0; - this._blendDirty = true; - - this._skeletonAnimationNode = skeletonAnimationNode; - - this._forward = animator.getAnimationState(this._skeletonAnimationNode.forward); - this._backward = animator.getAnimationState(this._skeletonAnimationNode.backward); - this._left = animator.getAnimationState(this._skeletonAnimationNode.left); - this._right = animator.getAnimationState(this._skeletonAnimationNode.right); - } - - Object.defineProperty(SkeletonDirectionalState.prototype, "direction", { - get: function () { - return this._direction; - }, - /** - * Defines the direction in degrees of the aniamtion between the forwards (0), right(90) backwards (180) and left(270) input nodes, - * used to produce the skeleton pose output. - */ - set: function (value) { - if (this._direction == value) - return; - - this._direction = value; - - this._blendDirty = true; - - this._skeletonPoseDirty = true; - this._pPositionDeltaDirty = true; - }, - enumerable: true, - configurable: true - }); - - /** - * @inheritDoc - */ - SkeletonDirectionalState.prototype.phase = function (value) { - if (this._blendDirty) - this.updateBlend(); - - this._skeletonPoseDirty = true; - - this._pPositionDeltaDirty = true; - - this._inputA.phase(value); - this._inputB.phase(value); - }; - - /** - * @inheritDoc - */ - SkeletonDirectionalState.prototype._pUdateTime = function (time /*int*/ ) { - if (this._blendDirty) - this.updateBlend(); - - this._skeletonPoseDirty = true; - - this._inputA.update(time); - this._inputB.update(time); - - _super.prototype._pUpdateTime.call(this, time); - }; - - /** - * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. - */ - SkeletonDirectionalState.prototype.getSkeletonPose = function (skeleton) { - if (this._skeletonPoseDirty) - this.updateSkeletonPose(skeleton); - - return this._skeletonPose; - }; - - /** - * @inheritDoc - */ - SkeletonDirectionalState.prototype._pUpdatePositionDelta = function () { - this._pPositionDeltaDirty = false; - - if (this._blendDirty) - this.updateBlend(); - - var deltA = this._inputA.positionDelta; - var deltB = this._inputB.positionDelta; - - this.positionDelta.x = deltA.x + this._blendWeight * (deltB.x - deltA.x); - this.positionDelta.y = deltA.y + this._blendWeight * (deltB.y - deltA.y); - this.positionDelta.z = deltA.z + this._blendWeight * (deltB.z - deltA.z); - }; - - /** - * Updates the output skeleton pose of the node based on the direction value between forward, backwards, left and right input nodes. - * - * @param skeleton The skeleton used by the animator requesting the ouput pose. - */ - SkeletonDirectionalState.prototype.updateSkeletonPose = function (skeleton) { - this._skeletonPoseDirty = false; - - if (this._blendDirty) - this.updateBlend(); - - var endPose; - var endPoses = this._skeletonPose.jointPoses; - var poses1 = this._inputA.getSkeletonPose(skeleton).jointPoses; - var poses2 = this._inputB.getSkeletonPose(skeleton).jointPoses; - var pose1, pose2; - var p1, p2; - var tr; - var numJoints = skeleton.numJoints; - - // :s - if (endPoses.length != numJoints) - endPoses.length = numJoints; - - for (var i = 0; i < numJoints; ++i) { - endPose = endPoses[i]; - - if (endPose == null) - endPose = endPoses[i] = new animators.JointPose(); - - pose1 = poses1[i]; - pose2 = poses2[i]; - p1 = pose1.translation; - p2 = pose2.translation; - - endPose.orientation.lerp(pose1.orientation, pose2.orientation, this._blendWeight); - - tr = endPose.translation; - tr.x = p1.x + this._blendWeight * (p2.x - p1.x); - tr.y = p1.y + this._blendWeight * (p2.y - p1.y); - tr.z = p1.z + this._blendWeight * (p2.z - p1.z); - } - }; - - /** - * Updates the blend value for the animation output based on the direction value between forward, backwards, left and right input nodes. - * - * @private - */ - SkeletonDirectionalState.prototype.updateBlend = function () { - this._blendDirty = false; - - if (this._direction < 0 || this._direction > 360) { - this._direction %= 360; - if (this._direction < 0) - this._direction += 360; - } - - if (this._direction < 90) { - this._inputA = this._forward; - this._inputB = this._right; - this._blendWeight = this._direction / 90; - } else if (this._direction < 180) { - this._inputA = this._right; - this._inputB = this._backward; - this._blendWeight = (this._direction - 90) / 90; - } else if (this._direction < 270) { - this._inputA = this._backward; - this._inputB = this._left; - this._blendWeight = (this._direction - 180) / 90; - } else { - this._inputA = this._left; - this._inputB = this._forward; - this._blendWeight = (this._direction - 270) / 90; - } - }; - return SkeletonDirectionalState; - })(animators.AnimationStateBase); - animators.SkeletonDirectionalState = SkeletonDirectionalState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * - */ - var SkeletonNaryLERPState = (function (_super) { - __extends(SkeletonNaryLERPState, _super); - function SkeletonNaryLERPState(animator, skeletonAnimationNode) { - _super.call(this, animator, skeletonAnimationNode); - this._skeletonPose = new animators.SkeletonPose(); - this._skeletonPoseDirty = true; - this._blendWeights = new Array(); - this._inputs = new Array(); - - this._skeletonAnimationNode = skeletonAnimationNode; - - var i = this._skeletonAnimationNode.numInputs; - - while (i--) - this._inputs[i] = animator.getAnimationState(this._skeletonAnimationNode._iInputs[i]); - } - /** - * @inheritDoc - */ - SkeletonNaryLERPState.prototype.phase = function (value) { - this._skeletonPoseDirty = true; - - this._pPositionDeltaDirty = true; - - for (var j = 0; j < this._skeletonAnimationNode.numInputs; ++j) { - if (this._blendWeights[j]) - this._inputs[j].update(value); - } - }; - - /** - * @inheritDoc - */ - SkeletonNaryLERPState.prototype._pUdateTime = function (time /*int*/ ) { - for (var j = 0; j < this._skeletonAnimationNode.numInputs; ++j) { - if (this._blendWeights[j]) - this._inputs[j].update(time); - } - - _super.prototype._pUpdateTime.call(this, time); - }; - - /** - * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. - */ - SkeletonNaryLERPState.prototype.getSkeletonPose = function (skeleton) { - if (this._skeletonPoseDirty) - this.updateSkeletonPose(skeleton); - - return this._skeletonPose; - }; - - /** - * Returns the blend weight of the skeleton aniamtion node that resides at the given input index. - * - * @param index The input index for which the skeleton animation node blend weight is requested. - */ - SkeletonNaryLERPState.prototype.getBlendWeightAt = function (index /*uint*/ ) { - return this._blendWeights[index]; - }; - - /** - * Sets the blend weight of the skeleton aniamtion node that resides at the given input index. - * - * @param index The input index on which the skeleton animation node blend weight is to be set. - * @param blendWeight The blend weight value to use for the given skeleton animation node index. - */ - SkeletonNaryLERPState.prototype.setBlendWeightAt = function (index /*uint*/ , blendWeight) { - this._blendWeights[index] = blendWeight; - - this._pPositionDeltaDirty = true; - this._skeletonPoseDirty = true; - }; - - /** - * @inheritDoc - */ - SkeletonNaryLERPState.prototype._pUpdatePositionDelta = function () { - this._pPositionDeltaDirty = false; - - var delta; - var weight; - - this.positionDelta.x = 0; - this.positionDelta.y = 0; - this.positionDelta.z = 0; - - for (var j = 0; j < this._skeletonAnimationNode.numInputs; ++j) { - weight = this._blendWeights[j]; - - if (weight) { - delta = this._inputs[j].positionDelta; - this.positionDelta.x += weight * delta.x; - this.positionDelta.y += weight * delta.y; - this.positionDelta.z += weight * delta.z; - } - } - }; - - /** - * Updates the output skeleton pose of the node based on the blend weight values given to the input nodes. - * - * @param skeleton The skeleton used by the animator requesting the ouput pose. - */ - SkeletonNaryLERPState.prototype.updateSkeletonPose = function (skeleton) { - this._skeletonPoseDirty = false; - - var weight; - var endPoses = this._skeletonPose.jointPoses; - var poses; - var endPose, pose; - var endTr, tr; - var endQuat, q; - var firstPose; - var i; - var w0, x0, y0, z0; - var w1, x1, y1, z1; - var numJoints = skeleton.numJoints; - - // :s - if (endPoses.length != numJoints) - endPoses.length = numJoints; - - for (var j = 0; j < this._skeletonAnimationNode.numInputs; ++j) { - weight = this._blendWeights[j]; - - if (!weight) - continue; - - poses = this._inputs[j].getSkeletonPose(skeleton).jointPoses; - - if (!firstPose) { - firstPose = poses; - for (i = 0; i < numJoints; ++i) { - endPose = endPoses[i]; - - if (endPose == null) - endPose = endPoses[i] = new animators.JointPose(); - - pose = poses[i]; - q = pose.orientation; - tr = pose.translation; - - endQuat = endPose.orientation; - - endQuat.x = weight * q.x; - endQuat.y = weight * q.y; - endQuat.z = weight * q.z; - endQuat.w = weight * q.w; - - endTr = endPose.translation; - endTr.x = weight * tr.x; - endTr.y = weight * tr.y; - endTr.z = weight * tr.z; - } - } else { - for (i = 0; i < skeleton.numJoints; ++i) { - endPose = endPoses[i]; - pose = poses[i]; - - q = firstPose[i].orientation; - x0 = q.x; - y0 = q.y; - z0 = q.z; - w0 = q.w; - - q = pose.orientation; - tr = pose.translation; - - x1 = q.x; - y1 = q.y; - z1 = q.z; - w1 = q.w; - - // find shortest direction - if (x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1 < 0) { - x1 = -x1; - y1 = -y1; - z1 = -z1; - w1 = -w1; - } - endQuat = endPose.orientation; - endQuat.x += weight * x1; - endQuat.y += weight * y1; - endQuat.z += weight * z1; - endQuat.w += weight * w1; - - endTr = endPose.translation; - endTr.x += weight * tr.x; - endTr.y += weight * tr.y; - endTr.z += weight * tr.z; - } - } - } - - for (i = 0; i < skeleton.numJoints; ++i) - endPoses[i].orientation.normalize(); - }; - return SkeletonNaryLERPState; - })(animators.AnimationStateBase); - animators.SkeletonNaryLERPState = SkeletonNaryLERPState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * - */ - var VertexClipState = (function (_super) { - __extends(VertexClipState, _super); - function VertexClipState(animator, vertexClipNode) { - _super.call(this, animator, vertexClipNode); - - this._vertexClipNode = vertexClipNode; - this._frames = this._vertexClipNode.frames; - } - Object.defineProperty(VertexClipState.prototype, "currentGeometry", { - /** - * @inheritDoc - */ - get: function () { - if (this._pFramesDirty) - this._pUpdateFrames(); - - return this._currentGeometry; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(VertexClipState.prototype, "nextGeometry", { - /** - * @inheritDoc - */ - get: function () { - if (this._pFramesDirty) - this._pUpdateFrames(); - - return this._nextGeometry; - }, - enumerable: true, - configurable: true - }); - - /** - * @inheritDoc - */ - VertexClipState.prototype._pUpdateFrames = function () { - _super.prototype._pUpdateFrames.call(this); - - this._currentGeometry = this._frames[this._pCurrentFrame]; - - if (this._vertexClipNode.looping && this._pNextFrame >= this._vertexClipNode.lastFrame) { - this._nextGeometry = this._frames[0]; - this._pAnimator.dispatchCycleEvent(); - } else - this._nextGeometry = this._frames[this._pNextFrame]; - }; - - /** - * @inheritDoc - */ - VertexClipState.prototype._pUpdatePositionDelta = function () { - //TODO:implement positiondelta functionality for vertex animations - }; - return VertexClipState; - })(animators.AnimationClipState); - animators.VertexClipState = VertexClipState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -/// -var away; -(function (away) { - (function (animators) { - var CrossfadeTransition = (function () { - function CrossfadeTransition(blendSpeed) { - this.blendSpeed = 0.5; - this.blendSpeed = blendSpeed; - } - CrossfadeTransition.prototype.getAnimationNode = function (animator, startNode, endNode, startBlend /*int*/ ) { - var crossFadeTransitionNode = new animators.CrossfadeTransitionNode(); - crossFadeTransitionNode.inputA = startNode; - crossFadeTransitionNode.inputB = endNode; - crossFadeTransitionNode.blendSpeed = this.blendSpeed; - crossFadeTransitionNode.startBlend = startBlend; - - return crossFadeTransitionNode; - }; - return CrossfadeTransition; - })(); - animators.CrossfadeTransition = CrossfadeTransition; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * A skeleton animation node that uses two animation node inputs to blend a lineraly interpolated output of a skeleton pose. - */ - var CrossfadeTransitionNode = (function (_super) { - __extends(CrossfadeTransitionNode, _super); - /** - * Creates a new CrossfadeTransitionNode object. - */ - function CrossfadeTransitionNode() { - _super.call(this); - - this._pStateClass = animators.CrossfadeTransitionState; - } - return CrossfadeTransitionNode; - })(animators.SkeletonBinaryLERPNode); - animators.CrossfadeTransitionNode = CrossfadeTransitionNode; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var AnimationStateEvent = away.events.AnimationStateEvent; - - /** - * - */ - var CrossfadeTransitionState = (function (_super) { - __extends(CrossfadeTransitionState, _super); - function CrossfadeTransitionState(animator, skeletonAnimationNode) { - _super.call(this, animator, skeletonAnimationNode); - - this._crossfadeTransitionNode = skeletonAnimationNode; - } - /** - * @inheritDoc - */ - CrossfadeTransitionState.prototype._pUpdateTime = function (time /*int*/ ) { - this.blendWeight = Math.abs(time - this._crossfadeTransitionNode.startBlend) / (1000 * this._crossfadeTransitionNode.blendSpeed); - - if (this.blendWeight >= 1) { - this.blendWeight = 1; - - if (this._animationStateTransitionComplete == null) - this._animationStateTransitionComplete = new AnimationStateEvent(AnimationStateEvent.TRANSITION_COMPLETE, this._pAnimator, this, this._crossfadeTransitionNode); - - this._crossfadeTransitionNode.dispatchEvent(this._animationStateTransitionComplete); - } - - _super.prototype._pUpdateTime.call(this, time); - }; - return CrossfadeTransitionState; - })(animators.SkeletonBinaryLERPState); - animators.CrossfadeTransitionState = CrossfadeTransitionState; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * The animation data set used by particle-based animators, containing particle animation data. - * - * @see away.animators.ParticleAnimator - */ - var ParticleAnimationSet = (function (_super) { - __extends(ParticleAnimationSet, _super); - /** - * Creates a new ParticleAnimationSet - * - * @param [optional] usesDuration Defines whether the animation set uses the duration data in its static properties to determine how long a particle is visible for. Defaults to false. - * @param [optional] usesLooping Defines whether the animation set uses a looping timeframe for each particle determined by the startTime, duration and delay data in its static properties function. Defaults to false. Requires usesDuration to be true. - * @param [optional] usesDelay Defines whether the animation set uses the delay data in its static properties to determine how long a particle is hidden for. Defaults to false. Requires usesLooping to be true. - */ - function ParticleAnimationSet(usesDuration, usesLooping, usesDelay) { - if (typeof usesDuration === "undefined") { usesDuration = false; } - if (typeof usesLooping === "undefined") { usesLooping = false; } - if (typeof usesDelay === "undefined") { usesDelay = false; } - _super.call(this); - this._animationSubGeometries = new Object(); - this._particleNodes = new Array(); - this._localDynamicNodes = new Array(); - this._localStaticNodes = new Array(); - this._totalLenOfOneVertex = 0; - - //automatically add a particle time node to the set - this.addAnimation(this._timeNode = new animators.ParticleTimeNode(usesDuration, usesLooping, usesDelay)); - } - Object.defineProperty(ParticleAnimationSet.prototype, "particleNodes", { - /** - * Returns a vector of the particle animation nodes contained within the set. - */ - get: function () { - return this._particleNodes; - }, - enumerable: true, - configurable: true - }); - - /** - * @inheritDoc - */ - ParticleAnimationSet.prototype.addAnimation = function (node) { - var i; - var n = node; - n._iProcessAnimationSetting(this); - if (n.mode == animators.ParticlePropertiesMode.LOCAL_STATIC) { - n._iDataOffset = this._totalLenOfOneVertex; - this._totalLenOfOneVertex += n.dataLength; - this._localStaticNodes.push(n); - } else if (n.mode == animators.ParticlePropertiesMode.LOCAL_DYNAMIC) - this._localDynamicNodes.push(n); - - for (i = this._particleNodes.length - 1; i >= 0; i--) { - if (this._particleNodes[i].priority <= n.priority) - break; - } - - this._particleNodes.splice(i + 1, 0, n); - - _super.prototype.addAnimation.call(this, node); - }; - - /** - * @inheritDoc - */ - ParticleAnimationSet.prototype.activate = function (shaderObject, stage) { - // this._iAnimationRegisterCache = pass.animationRegisterCache; - }; - - /** - * @inheritDoc - */ - ParticleAnimationSet.prototype.deactivate = function (shaderObject, stage) { - // var context:IContextStageGL = stage.context; - // var offset:number /*int*/ = this._iAnimationRegisterCache.vertexAttributesOffset; - // var used:number /*int*/ = this._iAnimationRegisterCache.numUsedStreams; - // for (var i:number /*int*/ = offset; i < used; i++) - // context.setVertexBufferAt(i, null); - }; - - /** - * @inheritDoc - */ - ParticleAnimationSet.prototype.getAGALVertexCode = function (shaderObject) { - //grab animationRegisterCache from the materialpassbase or create a new one if the first time - this._iAnimationRegisterCache = shaderObject.animationRegisterCache; - - if (this._iAnimationRegisterCache == null) - this._iAnimationRegisterCache = shaderObject.animationRegisterCache = new animators.AnimationRegisterCache(shaderObject.profile); - - //reset animationRegisterCache - this._iAnimationRegisterCache.vertexConstantOffset = shaderObject.numUsedVertexConstants; - this._iAnimationRegisterCache.vertexAttributesOffset = shaderObject.numUsedStreams; - this._iAnimationRegisterCache.varyingsOffset = shaderObject.numUsedVaryings; - this._iAnimationRegisterCache.fragmentConstantOffset = shaderObject.numUsedFragmentConstants; - this._iAnimationRegisterCache.hasUVNode = this.hasUVNode; - this._iAnimationRegisterCache.needVelocity = this.needVelocity; - this._iAnimationRegisterCache.hasBillboard = this.hasBillboard; - this._iAnimationRegisterCache.sourceRegisters = shaderObject.animatableAttributes; - this._iAnimationRegisterCache.targetRegisters = shaderObject.animationTargetRegisters; - this._iAnimationRegisterCache.needFragmentAnimation = shaderObject.usesFragmentAnimation; - this._iAnimationRegisterCache.needUVAnimation = !shaderObject.usesUVTransform; - this._iAnimationRegisterCache.hasColorAddNode = this.hasColorAddNode; - this._iAnimationRegisterCache.hasColorMulNode = this.hasColorMulNode; - this._iAnimationRegisterCache.reset(); - - var code = ""; - - code += this._iAnimationRegisterCache.getInitCode(); - - var node; - var i; - - for (i = 0; i < this._particleNodes.length; i++) { - node = this._particleNodes[i]; - if (node.priority < ParticleAnimationSet.POST_PRIORITY) - code += node.getAGALVertexCode(shaderObject, this._iAnimationRegisterCache); - } - - code += this._iAnimationRegisterCache.getCombinationCode(); - - for (i = 0; i < this._particleNodes.length; i++) { - node = this._particleNodes[i]; - if (node.priority >= ParticleAnimationSet.POST_PRIORITY && node.priority < ParticleAnimationSet.COLOR_PRIORITY) - code += node.getAGALVertexCode(shaderObject, this._iAnimationRegisterCache); - } - - code += this._iAnimationRegisterCache.initColorRegisters(); - - for (i = 0; i < this._particleNodes.length; i++) { - node = this._particleNodes[i]; - if (node.priority >= ParticleAnimationSet.COLOR_PRIORITY) - code += node.getAGALVertexCode(shaderObject, this._iAnimationRegisterCache); - } - code += this._iAnimationRegisterCache.getColorPassCode(); - return code; - }; - - /** - * @inheritDoc - */ - ParticleAnimationSet.prototype.getAGALUVCode = function (shaderObject) { - var code = ""; - if (this.hasUVNode) { - this._iAnimationRegisterCache.setUVSourceAndTarget(shaderObject.uvSource, shaderObject.uvTarget); - code += "mov " + this._iAnimationRegisterCache.uvTarget + ".xy," + this._iAnimationRegisterCache.uvAttribute.toString() + "\n"; - var node; - for (var i = 0; i < this._particleNodes.length; i++) - node = this._particleNodes[i]; - code += node.getAGALUVCode(shaderObject, this._iAnimationRegisterCache); - code += "mov " + this._iAnimationRegisterCache.uvVar.toString() + "," + this._iAnimationRegisterCache.uvTarget + ".xy\n"; - } else - code += "mov " + shaderObject.uvTarget + "," + shaderObject.uvSource + "\n"; - return code; - }; - - /** - * @inheritDoc - */ - ParticleAnimationSet.prototype.getAGALFragmentCode = function (shaderObject, shadedTarget) { - return this._iAnimationRegisterCache.getColorCombinationCode(shadedTarget); - }; - - /** - * @inheritDoc - */ - ParticleAnimationSet.prototype.doneAGALCode = function (shaderObject) { - this._iAnimationRegisterCache.setDataLength(); - - //set vertexZeroConst,vertexOneConst,vertexTwoConst - this._iAnimationRegisterCache.setVertexConst(this._iAnimationRegisterCache.vertexZeroConst.index, 0, 1, 2, 0); - }; - - Object.defineProperty(ParticleAnimationSet.prototype, "usesCPU", { - /** - * @inheritDoc - */ - get: function () { - return false; - }, - enumerable: true, - configurable: true - }); - - /** - * @inheritDoc - */ - ParticleAnimationSet.prototype.cancelGPUCompatibility = function () { - }; - - ParticleAnimationSet.prototype.dispose = function () { - for (var key in this._animationSubGeometries) - this._animationSubGeometries[key].dispose(); - - _super.prototype.dispose.call(this); - }; - - ParticleAnimationSet.prototype.getAnimationSubGeometry = function (subMesh) { - var mesh = subMesh.parentMesh; - var animationSubGeometry = (mesh.shareAnimationGeometry) ? this._animationSubGeometries[subMesh.subGeometry.id] : this._animationSubGeometries[subMesh.id]; - - if (animationSubGeometry) - return animationSubGeometry; - - this._iGenerateAnimationSubGeometries(mesh); - - return (mesh.shareAnimationGeometry) ? this._animationSubGeometries[subMesh.subGeometry.id] : this._animationSubGeometries[subMesh.id]; - }; - - /** @private */ - ParticleAnimationSet.prototype._iGenerateAnimationSubGeometries = function (mesh) { - if (this.initParticleFunc == null) - throw (new Error("no initParticleFunc set")); - - var geometry = mesh.geometry; - - if (!geometry) - throw (new Error("Particle animation can only be performed on a ParticleGeometry object")); - - var i, j, k; - var animationSubGeometry; - var newAnimationSubGeometry = false; - var subGeometry; - var subMesh; - var localNode; - - for (i = 0; i < mesh.subMeshes.length; i++) { - subMesh = mesh.subMeshes[i]; - subGeometry = subMesh.subGeometry; - if (mesh.shareAnimationGeometry) { - animationSubGeometry = this._animationSubGeometries[subGeometry.id]; - - if (animationSubGeometry) - continue; - } - - animationSubGeometry = new animators.AnimationSubGeometry(); - - if (mesh.shareAnimationGeometry) - this._animationSubGeometries[subGeometry.id] = animationSubGeometry; - else - this._animationSubGeometries[subMesh.id] = animationSubGeometry; - - newAnimationSubGeometry = true; - - //create the vertexData vector that will be used for local node data - animationSubGeometry.createVertexData(subGeometry.numVertices, this._totalLenOfOneVertex); - } - - if (!newAnimationSubGeometry) - return; - - var particles = geometry.particles; - var particlesLength = particles.length; - var numParticles = geometry.numParticles; - var particleProperties = new animators.ParticleProperties(); - var particle; - - var oneDataLen; - var oneDataOffset; - var counterForVertex; - var counterForOneData; - var oneData; - var numVertices; - var vertexData; - var vertexLength; - var startingOffset; - var vertexOffset; - - //default values for particle param - particleProperties.total = numParticles; - particleProperties.startTime = 0; - particleProperties.duration = 1000; - particleProperties.delay = 0.1; - - i = 0; - j = 0; - while (i < numParticles) { - particleProperties.index = i; - - //call the init on the particle parameters - this.initParticleFunc.call(this.initParticleScope, particleProperties); - - for (k = 0; k < this._localStaticNodes.length; k++) - this._localStaticNodes[k]._iGeneratePropertyOfOneParticle(particleProperties); - - while (j < particlesLength && (particle = particles[j]).particleIndex == i) { - for (k = 0; k < mesh.subMeshes.length; k++) { - subMesh = mesh.subMeshes[k]; - if (subMesh.subGeometry == particle.subGeometry) { - animationSubGeometry = (mesh.shareAnimationGeometry) ? this._animationSubGeometries[subMesh.subGeometry.id] : this._animationSubGeometries[subMesh.id]; - break; - } - } - numVertices = particle.numVertices; - vertexData = animationSubGeometry.vertexData; - vertexLength = numVertices * this._totalLenOfOneVertex; - startingOffset = animationSubGeometry.numProcessedVertices * this._totalLenOfOneVertex; - - for (k = 0; k < this._localStaticNodes.length; k++) { - localNode = this._localStaticNodes[k]; - oneData = localNode.oneData; - oneDataLen = localNode.dataLength; - oneDataOffset = startingOffset + localNode._iDataOffset; - - for (counterForVertex = 0; counterForVertex < vertexLength; counterForVertex += this._totalLenOfOneVertex) { - vertexOffset = oneDataOffset + counterForVertex; - - for (counterForOneData = 0; counterForOneData < oneDataLen; counterForOneData++) - vertexData[vertexOffset + counterForOneData] = oneData[counterForOneData]; - } - } - - //store particle properties if they need to be retreived for dynamic local nodes - if (this._localDynamicNodes.length) - animationSubGeometry.animationParticles.push(new animators.ParticleAnimationData(i, particleProperties.startTime, particleProperties.duration, particleProperties.delay, particle)); - - animationSubGeometry.numProcessedVertices += numVertices; - - //next index - j++; - } - - //next particle - i++; - } - }; - ParticleAnimationSet.POST_PRIORITY = 9; - - ParticleAnimationSet.COLOR_PRIORITY = 18; - return ParticleAnimationSet; - })(animators.AnimationSetBase); - animators.ParticleAnimationSet = ParticleAnimationSet; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ContextGLProgramType = away.stagegl.ContextGLProgramType; - - /** - * Provides an interface for assigning paricle-based animation data sets to mesh-based entity objects - * and controlling the various available states of animation through an interative playhead that can be - * automatically updated or manually triggered. - * - * Requires that the containing geometry of the parent mesh is particle geometry - * - * @see away.base.ParticleGeometry - */ - var ParticleAnimator = (function (_super) { - __extends(ParticleAnimator, _super); - /** - * Creates a new ParticleAnimator object. - * - * @param particleAnimationSet The animation data set containing the particle animations used by the animator. - */ - function ParticleAnimator(particleAnimationSet) { - _super.call(this, particleAnimationSet); - this._animationParticleStates = new Array(); - this._animatorParticleStates = new Array(); - this._timeParticleStates = new Array(); - this._totalLenOfOneVertex = 0; - this._animatorSubGeometries = new Object(); - this._particleAnimationSet = particleAnimationSet; - - var state; - var node; - - for (var i = 0; i < this._particleAnimationSet.particleNodes.length; i++) { - node = this._particleAnimationSet.particleNodes[i]; - state = this.getAnimationState(node); - if (node.mode == animators.ParticlePropertiesMode.LOCAL_DYNAMIC) { - this._animatorParticleStates.push(state); - node._iDataOffset = this._totalLenOfOneVertex; - this._totalLenOfOneVertex += node.dataLength; - } else { - this._animationParticleStates.push(state); - } - if (state.needUpdateTime) - this._timeParticleStates.push(state); - } - } - /** - * @inheritDoc - */ - ParticleAnimator.prototype.clone = function () { - return new ParticleAnimator(this._particleAnimationSet); - }; - - /** - * @inheritDoc - */ - ParticleAnimator.prototype.setRenderState = function (shaderObject, renderable, stage, camera, vertexConstantOffset /*int*/ , vertexStreamOffset /*int*/ ) { - var animationRegisterCache = this._particleAnimationSet._iAnimationRegisterCache; - - var subMesh = renderable.subMesh; - var state; - var i; - - if (!subMesh) - throw (new Error("Must be subMesh")); - - //process animation sub geometries - var animationSubGeometry = this._particleAnimationSet.getAnimationSubGeometry(subMesh); - - for (i = 0; i < this._animationParticleStates.length; i++) - this._animationParticleStates[i].setRenderState(stage, renderable, animationSubGeometry, animationRegisterCache, camera); - - //process animator subgeometries - var animatorSubGeometry = this.getAnimatorSubGeometry(subMesh); - - for (i = 0; i < this._animatorParticleStates.length; i++) - this._animatorParticleStates[i].setRenderState(stage, renderable, animatorSubGeometry, animationRegisterCache, camera); - - stage.context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX, animationRegisterCache.vertexConstantOffset, animationRegisterCache.vertexConstantData, animationRegisterCache.numVertexConstant); - - if (animationRegisterCache.numFragmentConstant > 0) - stage.context.setProgramConstantsFromArray(ContextGLProgramType.FRAGMENT, animationRegisterCache.fragmentConstantOffset, animationRegisterCache.fragmentConstantData, animationRegisterCache.numFragmentConstant); - }; - - /** - * @inheritDoc - */ - ParticleAnimator.prototype.testGPUCompatibility = function (shaderObject) { - }; - - /** - * @inheritDoc - */ - ParticleAnimator.prototype.start = function () { - _super.prototype.start.call(this); - - for (var i = 0; i < this._timeParticleStates.length; i++) - this._timeParticleStates[i].offset(this._pAbsoluteTime); - }; - - /** - * @inheritDoc - */ - ParticleAnimator.prototype._pUpdateDeltaTime = function (dt) { - this._pAbsoluteTime += dt; - - for (var i = 0; i < this._timeParticleStates.length; i++) - this._timeParticleStates[i].update(this._pAbsoluteTime); - }; - - /** - * @inheritDoc - */ - ParticleAnimator.prototype.resetTime = function (offset) { - if (typeof offset === "undefined") { offset = 0; } - for (var i = 0; i < this._timeParticleStates.length; i++) - this._timeParticleStates[i].offset(this._pAbsoluteTime + offset); - this.update(this.time); - }; - - ParticleAnimator.prototype.dispose = function () { - for (var key in this._animatorSubGeometries) - this._animatorSubGeometries[key].dispose(); - }; - - ParticleAnimator.prototype.getAnimatorSubGeometry = function (subMesh) { - if (!this._animatorParticleStates.length) - return; - - var subGeometry = subMesh.subGeometry; - var animatorSubGeometry = this._animatorSubGeometries[subGeometry.id] = new animators.AnimationSubGeometry(); - - //create the vertexData vector that will be used for local state data - animatorSubGeometry.createVertexData(subGeometry.numVertices, this._totalLenOfOneVertex); - - //pass the particles data to the animator subGeometry - animatorSubGeometry.animationParticles = this._particleAnimationSet.getAnimationSubGeometry(subMesh).animationParticles; - }; - return ParticleAnimator; - })(animators.AnimatorBase); - animators.ParticleAnimator = ParticleAnimator; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var TriangleSubGeometry = away.base.TriangleSubGeometry; - - var AnimationStateEvent = away.events.AnimationStateEvent; - - var ContextGLProgramType = away.stagegl.ContextGLProgramType; - - /** - * Provides an interface for assigning skeleton-based animation data sets to mesh-based entity objects - * and controlling the various available states of animation through an interative playhead that can be - * automatically updated or manually triggered. - */ - var SkeletonAnimator = (function (_super) { - __extends(SkeletonAnimator, _super); - /** - * Creates a new SkeletonAnimator object. - * - * @param skeletonAnimationSet The animation data set containing the skeleton animations used by the animator. - * @param skeleton The skeleton object used for calculating the resulting global matrices for transforming skinned mesh data. - * @param forceCPU Optional value that only allows the animator to perform calculation on the CPU. Defaults to false. - */ - function SkeletonAnimator(animationSet, skeleton, forceCPU) { - if (typeof forceCPU === "undefined") { forceCPU = false; } - var _this = this; - _super.call(this, animationSet); - this._globalPose = new animators.SkeletonPose(); - this._morphedSubGeometry = new Object(); - this._morphedSubGeometryDirty = new Object(); - - this._skeleton = skeleton; - this._forceCPU = forceCPU; - this._jointsPerVertex = animationSet.jointsPerVertex; - - this._numJoints = this._skeleton.numJoints; - this._globalMatrices = new Array(this._numJoints * 12); - - var j = 0; - for (var i = 0; i < this._numJoints; ++i) { - this._globalMatrices[j++] = 1; - this._globalMatrices[j++] = 0; - this._globalMatrices[j++] = 0; - this._globalMatrices[j++] = 0; - this._globalMatrices[j++] = 0; - this._globalMatrices[j++] = 1; - this._globalMatrices[j++] = 0; - this._globalMatrices[j++] = 0; - this._globalMatrices[j++] = 0; - this._globalMatrices[j++] = 0; - this._globalMatrices[j++] = 1; - this._globalMatrices[j++] = 0; - } - - this._onTransitionCompleteDelegate = function (event) { - return _this.onTransitionComplete(event); - }; - this._onIndicesUpdateDelegate = function (event) { - return _this.onIndicesUpdate(event); - }; - this._onVerticesUpdateDelegate = function (event) { - return _this.onVerticesUpdate(event); - }; - } - Object.defineProperty(SkeletonAnimator.prototype, "globalMatrices", { - /** - * returns the calculated global matrices of the current skeleton pose. - * - * @see #globalPose - */ - get: function () { - if (this._globalPropertiesDirty) - this.updateGlobalProperties(); - - return this._globalMatrices; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(SkeletonAnimator.prototype, "globalPose", { - /** - * returns the current skeleton pose output from the animator. - * - * @see away.animators.data.SkeletonPose - */ - get: function () { - if (this._globalPropertiesDirty) - this.updateGlobalProperties(); - - return this._globalPose; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(SkeletonAnimator.prototype, "skeleton", { - /** - * Returns the skeleton object in use by the animator - this defines the number and heirarchy of joints used by the - * skinned geoemtry to which skeleon animator is applied. - */ - get: function () { - return this._skeleton; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(SkeletonAnimator.prototype, "forceCPU", { - /** - * Indicates whether the skeleton animator is disabled by default for GPU rendering, something that allows the animator to perform calculation on the GPU. - * Defaults to false. - */ - get: function () { - return this._forceCPU; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(SkeletonAnimator.prototype, "useCondensedIndices", { - /** - * Offers the option of enabling GPU accelerated animation on skeletons larger than 32 joints - * by condensing the number of joint index values required per mesh. Only applicable to - * skeleton animations that utilise more than one mesh object. Defaults to false. - */ - get: function () { - return this._useCondensedIndices; - }, - set: function (value) { - this._useCondensedIndices = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - SkeletonAnimator.prototype.clone = function () { - /* The cast to SkeletonAnimationSet should never fail, as _animationSet can only be set - through the constructor, which will only accept a SkeletonAnimationSet. */ - return new SkeletonAnimator(this._pAnimationSet, this._skeleton, this._forceCPU); - }; - - /** - * Plays an animation state registered with the given name in the animation data set. - * - * @param name The data set name of the animation state to be played. - * @param transition An optional transition object that determines how the animator will transition from the currently active animation state. - * @param offset An option offset time (in milliseconds) that resets the state's internal clock to the absolute time of the animator plus the offset value. Required for non-looping animation states. - */ - SkeletonAnimator.prototype.play = function (name, transition, offset) { - if (typeof transition === "undefined") { transition = null; } - if (typeof offset === "undefined") { offset = NaN; } - if (this._pActiveAnimationName == name) - return; - - this._pActiveAnimationName = name; - - if (!this._pAnimationSet.hasAnimation(name)) - throw new Error("Animation root node " + name + " not found!"); - - if (transition && this._pActiveNode) { - //setup the transition - this._pActiveNode = transition.getAnimationNode(this, this._pActiveNode, this._pAnimationSet.getAnimation(name), this._pAbsoluteTime); - this._pActiveNode.addEventListener(AnimationStateEvent.TRANSITION_COMPLETE, this._onTransitionCompleteDelegate); - } else - this._pActiveNode = this._pAnimationSet.getAnimation(name); - - this._pActiveState = this.getAnimationState(this._pActiveNode); - - if (this.updatePosition) { - //update straight away to reset position deltas - this._pActiveState.update(this._pAbsoluteTime); - this._pActiveState.positionDelta; - } - - this._activeSkeletonState = this._pActiveState; - - this.start(); - - //apply a time offset if specified - if (!isNaN(offset)) - this.reset(name, offset); - }; - - /** - * @inheritDoc - */ - SkeletonAnimator.prototype.setRenderState = function (shaderObject, renderable, stage, camera, vertexConstantOffset /*int*/ , vertexStreamOffset /*int*/ ) { - // do on request of globalProperties - if (this._globalPropertiesDirty) - this.updateGlobalProperties(); - - var subGeometry = renderable.subMesh.subGeometry; - - subGeometry.useCondensedIndices = this._useCondensedIndices; - - if (this._useCondensedIndices) { - // using a condensed data set - this.updateCondensedMatrices(subGeometry.condensedIndexLookUp, subGeometry.numCondensedJoints); - stage.context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX, vertexConstantOffset, this._condensedMatrices, subGeometry.numCondensedJoints * 3); - } else { - if (this._pAnimationSet.usesCPU) { - if (this._morphedSubGeometryDirty[subGeometry.id]) - this.morphSubGeometry(renderable, subGeometry); - - return; - } - stage.context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX, vertexConstantOffset, this._globalMatrices, this._numJoints * 3); - } - - stage.context.activateBuffer(vertexStreamOffset, renderable.getVertexData(TriangleSubGeometry.JOINT_INDEX_DATA), renderable.getVertexOffset(TriangleSubGeometry.JOINT_INDEX_DATA), renderable.JOINT_INDEX_FORMAT); - stage.context.activateBuffer(vertexStreamOffset + 1, renderable.getVertexData(TriangleSubGeometry.JOINT_WEIGHT_DATA), renderable.getVertexOffset(TriangleSubGeometry.JOINT_WEIGHT_DATA), renderable.JOINT_WEIGHT_FORMAT); - }; - - /** - * @inheritDoc - */ - SkeletonAnimator.prototype.testGPUCompatibility = function (shaderObject) { - if (!this._useCondensedIndices && (this._forceCPU || this._jointsPerVertex > 4 || shaderObject.numUsedVertexConstants + this._numJoints * 3 > 128)) - this._pAnimationSet.cancelGPUCompatibility(); - }; - - /** - * Applies the calculated time delta to the active animation state node or state transition object. - */ - SkeletonAnimator.prototype._pUpdateDeltaTime = function (dt) { - _super.prototype._pUpdateDeltaTime.call(this, dt); - - //invalidate pose matrices - this._globalPropertiesDirty = true; - - //trigger geometry invalidation if using CPU animation - if (this._pAnimationSet.usesCPU) - for (var key in this._morphedSubGeometryDirty) - this._morphedSubGeometryDirty[key] = true; - }; - - SkeletonAnimator.prototype.updateCondensedMatrices = function (condensedIndexLookUp /*uint*/ , numJoints /*uint*/ ) { - var i = 0, j = 0; - var len; - var srcIndex; - - this._condensedMatrices = new Array(); - - do { - srcIndex = condensedIndexLookUp[i] * 4; - len = srcIndex + 12; - - while (srcIndex < len) - this._condensedMatrices[j++] = this._globalMatrices[srcIndex++]; - } while(++i < numJoints); - }; - - SkeletonAnimator.prototype.updateGlobalProperties = function () { - this._globalPropertiesDirty = false; - - //get global pose - this.localToGlobalPose(this._activeSkeletonState.getSkeletonPose(this._skeleton), this._globalPose, this._skeleton); - - // convert pose to matrix - var mtxOffset = 0; - var globalPoses = this._globalPose.jointPoses; - var raw; - var ox, oy, oz, ow; - var xy2, xz2, xw2; - var yz2, yw2, zw2; - var n11, n12, n13; - var n21, n22, n23; - var n31, n32, n33; - var m11, m12, m13, m14; - var m21, m22, m23, m24; - var m31, m32, m33, m34; - var joints = this._skeleton.joints; - var pose; - var quat; - var vec; - var t; - - for (var i = 0; i < this._numJoints; ++i) { - pose = globalPoses[i]; - quat = pose.orientation; - vec = pose.translation; - ox = quat.x; - oy = quat.y; - oz = quat.z; - ow = quat.w; - - xy2 = (t = 2.0 * ox) * oy; - xz2 = t * oz; - xw2 = t * ow; - yz2 = (t = 2.0 * oy) * oz; - yw2 = t * ow; - zw2 = 2.0 * oz * ow; - - yz2 = 2.0 * oy * oz; - yw2 = 2.0 * oy * ow; - zw2 = 2.0 * oz * ow; - ox *= ox; - oy *= oy; - oz *= oz; - ow *= ow; - - n11 = (t = ox - oy) - oz + ow; - n12 = xy2 - zw2; - n13 = xz2 + yw2; - n21 = xy2 + zw2; - n22 = -t - oz + ow; - n23 = yz2 - xw2; - n31 = xz2 - yw2; - n32 = yz2 + xw2; - n33 = -ox - oy + oz + ow; - - // prepend inverse bind pose - raw = joints[i].inverseBindPose; - m11 = raw[0]; - m12 = raw[4]; - m13 = raw[8]; - m14 = raw[12]; - m21 = raw[1]; - m22 = raw[5]; - m23 = raw[9]; - m24 = raw[13]; - m31 = raw[2]; - m32 = raw[6]; - m33 = raw[10]; - m34 = raw[14]; - - this._globalMatrices[mtxOffset] = n11 * m11 + n12 * m21 + n13 * m31; - this._globalMatrices[mtxOffset + 1] = n11 * m12 + n12 * m22 + n13 * m32; - this._globalMatrices[mtxOffset + 2] = n11 * m13 + n12 * m23 + n13 * m33; - this._globalMatrices[mtxOffset + 3] = n11 * m14 + n12 * m24 + n13 * m34 + vec.x; - this._globalMatrices[mtxOffset + 4] = n21 * m11 + n22 * m21 + n23 * m31; - this._globalMatrices[mtxOffset + 5] = n21 * m12 + n22 * m22 + n23 * m32; - this._globalMatrices[mtxOffset + 6] = n21 * m13 + n22 * m23 + n23 * m33; - this._globalMatrices[mtxOffset + 7] = n21 * m14 + n22 * m24 + n23 * m34 + vec.y; - this._globalMatrices[mtxOffset + 8] = n31 * m11 + n32 * m21 + n33 * m31; - this._globalMatrices[mtxOffset + 9] = n31 * m12 + n32 * m22 + n33 * m32; - this._globalMatrices[mtxOffset + 10] = n31 * m13 + n32 * m23 + n33 * m33; - this._globalMatrices[mtxOffset + 11] = n31 * m14 + n32 * m24 + n33 * m34 + vec.z; - - mtxOffset = mtxOffset + 12; - } - }; - - SkeletonAnimator.prototype.getRenderableSubGeometry = function (renderable, sourceSubGeometry) { - this._morphedSubGeometryDirty[sourceSubGeometry.id] = true; - - //early out for GPU animations - if (!this._pAnimationSet.usesCPU) - return sourceSubGeometry; - - var targetSubGeometry; - - if (!(targetSubGeometry = this._morphedSubGeometry[sourceSubGeometry.id])) { - //not yet stored - targetSubGeometry = this._morphedSubGeometry[sourceSubGeometry.id] = sourceSubGeometry.clone(); - - //turn off auto calculations on the morphed geometry - targetSubGeometry.autoDeriveNormals = false; - targetSubGeometry.autoDeriveTangents = false; - targetSubGeometry.autoDeriveUVs = false; - - //add event listeners for any changes in UV values on the source geometry - sourceSubGeometry.addEventListener(away.events.SubGeometryEvent.INDICES_UPDATED, this._onIndicesUpdateDelegate); - sourceSubGeometry.addEventListener(away.events.SubGeometryEvent.VERTICES_UPDATED, this._onVerticesUpdateDelegate); - } - - return targetSubGeometry; - }; - - /** - * If the animation can't be performed on GPU, transform vertices manually - * @param subGeom The subgeometry containing the weights and joint index data per vertex. - * @param pass The material pass for which we need to transform the vertices - */ - SkeletonAnimator.prototype.morphSubGeometry = function (renderable, sourceSubGeometry) { - this._morphedSubGeometryDirty[sourceSubGeometry.id] = false; - - var sourcePositions = sourceSubGeometry.positions; - var sourceNormals = sourceSubGeometry.vertexNormals; - var sourceTangents = sourceSubGeometry.vertexTangents; - - var jointIndices = sourceSubGeometry.jointIndices; - var jointWeights = sourceSubGeometry.jointWeights; - - var targetSubGeometry = this._morphedSubGeometry[sourceSubGeometry.id]; - - var targetPositions = targetSubGeometry.positions; - var targetNormals = targetSubGeometry.vertexNormals; - var targetTangents = targetSubGeometry.vertexTangents; - - var index = 0; - var j = 0; - var k; - var vx, vy, vz; - var nx, ny, nz; - var tx, ty, tz; - var len = sourcePositions.length; - var weight; - var vertX, vertY, vertZ; - var normX, normY, normZ; - var tangX, tangY, tangZ; - var m11, m12, m13, m14; - var m21, m22, m23, m24; - var m31, m32, m33, m34; - - while (index < len) { - vertX = sourcePositions[index]; - vertY = sourcePositions[index + 1]; - vertZ = sourcePositions[index + 2]; - normX = sourceNormals[index]; - normY = sourceNormals[index + 1]; - normZ = sourceNormals[index + 2]; - tangX = sourceTangents[index]; - tangY = sourceTangents[index + 1]; - tangZ = sourceTangents[index + 2]; - vx = 0; - vy = 0; - vz = 0; - nx = 0; - ny = 0; - nz = 0; - tx = 0; - ty = 0; - tz = 0; - k = 0; - while (k < this._jointsPerVertex) { - weight = jointWeights[j]; - if (weight > 0) { - // implicit /3*12 (/3 because indices are multiplied by 3 for gpu matrix access, *12 because it's the matrix size) - var mtxOffset = jointIndices[j++] << 2; - m11 = this._globalMatrices[mtxOffset]; - m12 = this._globalMatrices[mtxOffset + 1]; - m13 = this._globalMatrices[mtxOffset + 2]; - m14 = this._globalMatrices[mtxOffset + 3]; - m21 = this._globalMatrices[mtxOffset + 4]; - m22 = this._globalMatrices[mtxOffset + 5]; - m23 = this._globalMatrices[mtxOffset + 6]; - m24 = this._globalMatrices[mtxOffset + 7]; - m31 = this._globalMatrices[mtxOffset + 8]; - m32 = this._globalMatrices[mtxOffset + 9]; - m33 = this._globalMatrices[mtxOffset + 10]; - m34 = this._globalMatrices[mtxOffset + 11]; - vx += weight * (m11 * vertX + m12 * vertY + m13 * vertZ + m14); - vy += weight * (m21 * vertX + m22 * vertY + m23 * vertZ + m24); - vz += weight * (m31 * vertX + m32 * vertY + m33 * vertZ + m34); - nx += weight * (m11 * normX + m12 * normY + m13 * normZ); - ny += weight * (m21 * normX + m22 * normY + m23 * normZ); - nz += weight * (m31 * normX + m32 * normY + m33 * normZ); - tx += weight * (m11 * tangX + m12 * tangY + m13 * tangZ); - ty += weight * (m21 * tangX + m22 * tangY + m23 * tangZ); - tz += weight * (m31 * tangX + m32 * tangY + m33 * tangZ); - ++k; - } else { - j += (this._jointsPerVertex - k); - k = this._jointsPerVertex; - } - } - - targetPositions[index] = vx; - targetPositions[index + 1] = vy; - targetPositions[index + 2] = vz; - targetNormals[index] = nx; - targetNormals[index + 1] = ny; - targetNormals[index + 2] = nz; - targetTangents[index] = tx; - targetTangents[index + 1] = ty; - targetTangents[index + 2] = tz; - - index += 3; - } - - targetSubGeometry.updatePositions(targetPositions); - targetSubGeometry.updateVertexNormals(targetNormals); - targetSubGeometry.updateVertexTangents(targetTangents); - }; - - /** - * Converts a local hierarchical skeleton pose to a global pose - * @param targetPose The SkeletonPose object that will contain the global pose. - * @param skeleton The skeleton containing the joints, and as such, the hierarchical data to transform to global poses. - */ - SkeletonAnimator.prototype.localToGlobalPose = function (sourcePose, targetPose, skeleton) { - var globalPoses = targetPose.jointPoses; - var globalJointPose; - var joints = skeleton.joints; - var len = sourcePose.numJointPoses; - var jointPoses = sourcePose.jointPoses; - var parentIndex; - var joint; - var parentPose; - var pose; - var or; - var tr; - var t; - var q; - - var x1, y1, z1, w1; - var x2, y2, z2, w2; - var x3, y3, z3; - - // :s - if (globalPoses.length != len) - globalPoses.length = len; - - for (var i = 0; i < len; ++i) { - globalJointPose = globalPoses[i]; - - if (globalJointPose == null) - globalJointPose = globalPoses[i] = new animators.JointPose(); - - joint = joints[i]; - parentIndex = joint.parentIndex; - pose = jointPoses[i]; - - q = globalJointPose.orientation; - t = globalJointPose.translation; - - if (parentIndex < 0) { - tr = pose.translation; - or = pose.orientation; - q.x = or.x; - q.y = or.y; - q.z = or.z; - q.w = or.w; - t.x = tr.x; - t.y = tr.y; - t.z = tr.z; - } else { - // append parent pose - parentPose = globalPoses[parentIndex]; - - // rotate point - or = parentPose.orientation; - tr = pose.translation; - x2 = or.x; - y2 = or.y; - z2 = or.z; - w2 = or.w; - x3 = tr.x; - y3 = tr.y; - z3 = tr.z; - - w1 = -x2 * x3 - y2 * y3 - z2 * z3; - x1 = w2 * x3 + y2 * z3 - z2 * y3; - y1 = w2 * y3 - x2 * z3 + z2 * x3; - z1 = w2 * z3 + x2 * y3 - y2 * x3; - - // append parent translation - tr = parentPose.translation; - t.x = -w1 * x2 + x1 * w2 - y1 * z2 + z1 * y2 + tr.x; - t.y = -w1 * y2 + x1 * z2 + y1 * w2 - z1 * x2 + tr.y; - t.z = -w1 * z2 - x1 * y2 + y1 * x2 + z1 * w2 + tr.z; - - // append parent orientation - x1 = or.x; - y1 = or.y; - z1 = or.z; - w1 = or.w; - or = pose.orientation; - x2 = or.x; - y2 = or.y; - z2 = or.z; - w2 = or.w; - - q.w = w1 * w2 - x1 * x2 - y1 * y2 - z1 * z2; - q.x = w1 * x2 + x1 * w2 + y1 * z2 - z1 * y2; - q.y = w1 * y2 - x1 * z2 + y1 * w2 + z1 * x2; - q.z = w1 * z2 + x1 * y2 - y1 * x2 + z1 * w2; - } - } - }; - - SkeletonAnimator.prototype.onTransitionComplete = function (event) { - if (event.type == AnimationStateEvent.TRANSITION_COMPLETE) { - event.animationNode.removeEventListener(AnimationStateEvent.TRANSITION_COMPLETE, this._onTransitionCompleteDelegate); - - //if this is the current active state transition, revert control to the active node - if (this._pActiveState == event.animationState) { - this._pActiveNode = this._pAnimationSet.getAnimation(this._pActiveAnimationName); - this._pActiveState = this.getAnimationState(this._pActiveNode); - this._activeSkeletonState = this._pActiveState; - } - } - }; - - SkeletonAnimator.prototype.onIndicesUpdate = function (event) { - var subGeometry = event.target; - - this._morphedSubGeometry[subGeometry.id].updateIndices(subGeometry.indices); - }; - - SkeletonAnimator.prototype.onVerticesUpdate = function (event) { - var subGeometry = event.target; - var morphGeometry = this._morphedSubGeometry[subGeometry.id]; - - switch (event.dataType) { - case TriangleSubGeometry.UV_DATA: - morphGeometry.updateUVs(subGeometry.uvs); - case TriangleSubGeometry.SECONDARY_UV_DATA: - morphGeometry.updateUVs(subGeometry.secondaryUVs); - } - }; - return SkeletonAnimator; - })(animators.AnimatorBase); - animators.SkeletonAnimator = SkeletonAnimator; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * The animation data set used by skeleton-based animators, containing skeleton animation data. - * - * @see away.animators.SkeletonAnimator - */ - var SkeletonAnimationSet = (function (_super) { - __extends(SkeletonAnimationSet, _super); - /** - * Creates a new SkeletonAnimationSet object. - * - * @param jointsPerVertex Sets the amount of skeleton joints that can be linked to a single vertex via skinned weight values. For GPU-base animation, the maximum allowed value is 4. Defaults to 4. - */ - function SkeletonAnimationSet(jointsPerVertex) { - if (typeof jointsPerVertex === "undefined") { jointsPerVertex = 4; } - _super.call(this); - - this._jointsPerVertex = jointsPerVertex; - } - Object.defineProperty(SkeletonAnimationSet.prototype, "jointsPerVertex", { - /** - * Returns the amount of skeleton joints that can be linked to a single vertex via skinned weight values. For GPU-base animation, the - * maximum allowed value is 4. - */ - get: function () { - return this._jointsPerVertex; - }, - enumerable: true, - configurable: true - }); - - /** - * @inheritDoc - */ - SkeletonAnimationSet.prototype.getAGALVertexCode = function (shaderObject) { - var len = shaderObject.animatableAttributes.length; - - var indexOffset0 = shaderObject.numUsedVertexConstants; - var indexOffset1 = indexOffset0 + 1; - var indexOffset2 = indexOffset0 + 2; - var indexStream = "va" + shaderObject.numUsedStreams; - var weightStream = "va" + (shaderObject.numUsedStreams + 1); - var indices = [indexStream + ".x", indexStream + ".y", indexStream + ".z", indexStream + ".w"]; - var weights = [weightStream + ".x", weightStream + ".y", weightStream + ".z", weightStream + ".w"]; - var temp1 = this._pFindTempReg(shaderObject.animationTargetRegisters); - var temp2 = this._pFindTempReg(shaderObject.animationTargetRegisters, temp1); - var dot = "dp4"; - var code = ""; - - for (var i = 0; i < len; ++i) { - var src = shaderObject.animatableAttributes[i]; - - for (var j = 0; j < this._jointsPerVertex; ++j) { - code += dot + " " + temp1 + ".x, " + src + ", vc[" + indices[j] + "+" + indexOffset0 + "]\n" + dot + " " + temp1 + ".y, " + src + ", vc[" + indices[j] + "+" + indexOffset1 + "]\n" + dot + " " + temp1 + ".z, " + src + ", vc[" + indices[j] + "+" + indexOffset2 + "]\n" + "mov " + temp1 + ".w, " + src + ".w\n" + "mul " + temp1 + ", " + temp1 + ", " + weights[j] + "\n"; // apply weight - - // add or mov to target. Need to write to a temp reg first, because an output can be a target - if (j == 0) - code += "mov " + temp2 + ", " + temp1 + "\n"; - else - code += "add " + temp2 + ", " + temp2 + ", " + temp1 + "\n"; - } - - // switch to dp3 once positions have been transformed, from now on, it should only be vectors instead of points - dot = "dp3"; - code += "mov " + shaderObject.animationTargetRegisters[i] + ", " + temp2 + "\n"; - } - - return code; - }; - - /** - * @inheritDoc - */ - SkeletonAnimationSet.prototype.activate = function (shaderObject, stage) { - }; - - /** - * @inheritDoc - */ - SkeletonAnimationSet.prototype.deactivate = function (shaderObject, stage) { - // var streamOffset:number /*uint*/ = pass.numUsedStreams; - // var context:IContextStageGL = stage.context; - // context.setVertexBufferAt(streamOffset, null); - // context.setVertexBufferAt(streamOffset + 1, null); - }; - - /** - * @inheritDoc - */ - SkeletonAnimationSet.prototype.getAGALFragmentCode = function (shaderObject, shadedTarget) { - return ""; - }; - - /** - * @inheritDoc - */ - SkeletonAnimationSet.prototype.getAGALUVCode = function (shaderObject) { - return "mov " + shaderObject.uvTarget + "," + shaderObject.uvSource + "\n"; - }; - - /** - * @inheritDoc - */ - SkeletonAnimationSet.prototype.doneAGALCode = function (shaderObject) { - }; - return SkeletonAnimationSet; - })(animators.AnimationSetBase); - animators.SkeletonAnimationSet = SkeletonAnimationSet; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - /** - * The animation data set used by vertex-based animators, containing vertex animation state data. - * - * @see away.animators.VertexAnimator - */ - var VertexAnimationSet = (function (_super) { - __extends(VertexAnimationSet, _super); - /** - * Returns whether or not normal data is used in last set GPU pass of the vertex shader. - */ - // public get useNormals():boolean - // { - // return this._uploadNormals; - // } - /** - * Creates a new VertexAnimationSet object. - * - * @param numPoses The number of poses made available at once to the GPU animation code. - * @param blendMode Optional value for setting the animation mode of the vertex animator object. - * - * @see away3d.animators.data.VertexAnimationMode - */ - function VertexAnimationSet(numPoses, blendMode) { - if (typeof numPoses === "undefined") { numPoses = 2; } - if (typeof blendMode === "undefined") { blendMode = "absolute"; } - _super.call(this); - this._numPoses = numPoses; - this._blendMode = blendMode; - } - Object.defineProperty(VertexAnimationSet.prototype, "numPoses", { - /** - * Returns the number of poses made available at once to the GPU animation code. - */ - get: function () { - return this._numPoses; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(VertexAnimationSet.prototype, "blendMode", { - /** - * Returns the active blend mode of the vertex animator object. - */ - get: function () { - return this._blendMode; - }, - enumerable: true, - configurable: true - }); - - /** - * @inheritDoc - */ - VertexAnimationSet.prototype.getAGALVertexCode = function (shaderObject) { - if (this._blendMode == away.animators.VertexAnimationMode.ABSOLUTE) - return this.getAbsoluteAGALCode(shaderObject); - else - return this.getAdditiveAGALCode(shaderObject); - }; - - /** - * @inheritDoc - */ - VertexAnimationSet.prototype.activate = function (shaderObject, stage) { - // var uID:number = pass._iUniqueId; - // this._uploadNormals = this._useNormals[uID]; - // this._uploadTangents = this._useTangents[uID]; - }; - - /** - * @inheritDoc - */ - VertexAnimationSet.prototype.deactivate = function (shaderObject, stage) { - // var uID:number = pass._iUniqueId; - // var index:number /*uint*/ = this._streamIndices[uID]; - // var context:IContextStageGL = stage.context; - // context.setVertexBufferAt(index, null); - // if (this._uploadNormals) - // context.setVertexBufferAt(index + 1, null); - // if (this._uploadTangents) - // context.setVertexBufferAt(index + 2, null); - }; - - /** - * @inheritDoc - */ - VertexAnimationSet.prototype.getAGALFragmentCode = function (shaderObject, shadedTarget) { - return ""; - }; - - /** - * @inheritDoc - */ - VertexAnimationSet.prototype.getAGALUVCode = function (shaderObject) { - return "mov " + shaderObject.uvTarget + "," + shaderObject.uvSource + "\n"; - }; - - /** - * @inheritDoc - */ - VertexAnimationSet.prototype.doneAGALCode = function (shaderObject) { - }; - - /** - * Generates the vertex AGAL code for absolute blending. - */ - VertexAnimationSet.prototype.getAbsoluteAGALCode = function (shaderObject) { - var code = ""; - var temp1 = this._pFindTempReg(shaderObject.animationTargetRegisters); - var temp2 = this._pFindTempReg(shaderObject.animationTargetRegisters, temp1); - var regs = new Array("x", "y", "z", "w"); - var len = shaderObject.animatableAttributes.length; - var constantReg = "vc" + shaderObject.numUsedVertexConstants; - - if (len > 2) - len = 2; - var streamIndex = shaderObject.numUsedStreams; - - for (var i = 0; i < len; ++i) { - code += "mul " + temp1 + ", " + shaderObject.animatableAttributes[i] + ", " + constantReg + "." + regs[0] + "\n"; - - for (var j = 1; j < this._numPoses; ++j) { - code += "mul " + temp2 + ", va" + streamIndex + ", " + constantReg + "." + regs[j] + "\n"; - - if (j < this._numPoses - 1) - code += "add " + temp1 + ", " + temp1 + ", " + temp2 + "\n"; - - ++streamIndex; - } - - code += "add " + shaderObject.animationTargetRegisters[i] + ", " + temp1 + ", " + temp2 + "\n"; - } - - // add code for bitangents if tangents are used - if (shaderObject.tangentDependencies > 0 || shaderObject.outputsNormals) { - code += "dp3 " + temp1 + ".x, " + shaderObject.animatableAttributes[2] + ", " + shaderObject.animationTargetRegisters[1] + "\n" + "mul " + temp1 + ", " + shaderObject.animationTargetRegisters[1] + ", " + temp1 + ".x\n" + "sub " + shaderObject.animationTargetRegisters[2] + ", " + shaderObject.animationTargetRegisters[2] + ", " + temp1 + "\n"; - } - return code; - }; - - /** - * Generates the vertex AGAL code for additive blending. - */ - VertexAnimationSet.prototype.getAdditiveAGALCode = function (shaderObject) { - var code = ""; - var len = shaderObject.animatableAttributes.length; - var regs = ["x", "y", "z", "w"]; - var temp1 = this._pFindTempReg(shaderObject.animationTargetRegisters); - var k; - - var streamIndex = shaderObject.numUsedStreams; - - if (len > 2) - len = 2; - - code += "mov " + shaderObject.animationTargetRegisters[0] + ", " + shaderObject.animatableAttributes[0] + "\n"; - if (shaderObject.normalDependencies > 0) - code += "mov " + shaderObject.animationTargetRegisters[1] + ", " + shaderObject.animatableAttributes[1] + "\n"; - - for (var i = 0; i < len; ++i) { - for (var j = 0; j < this._numPoses; ++j) { - code += "mul " + temp1 + ", va" + (streamIndex + k) + ", vc" + shaderObject.numUsedVertexConstants + "." + regs[j] + "\n" + "add " + shaderObject.animationTargetRegisters[i] + ", " + shaderObject.animationTargetRegisters[i] + ", " + temp1 + "\n"; - k++; - } - } - - if (shaderObject.tangentDependencies > 0 || shaderObject.outputsNormals) { - code += "dp3 " + temp1 + ".x, " + shaderObject.animatableAttributes[2] + ", " + shaderObject.animationTargetRegisters[1] + "\n" + "mul " + temp1 + ", " + shaderObject.animationTargetRegisters[1] + ", " + temp1 + ".x\n" + "sub " + shaderObject.animationTargetRegisters[2] + ", " + shaderObject.animatableAttributes[2] + ", " + temp1 + "\n"; - } - - return code; - }; - return VertexAnimationSet; - })(animators.AnimationSetBase); - animators.VertexAnimationSet = VertexAnimationSet; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var TriangleSubGeometry = away.base.TriangleSubGeometry; - - var VertexDataPool = away.pool.VertexDataPool; - - /** - * Provides an interface for assigning vertex-based animation data sets to mesh-based entity objects - * and controlling the various available states of animation through an interative playhead that can be - * automatically updated or manually triggered. - */ - var VertexAnimator = (function (_super) { - __extends(VertexAnimator, _super); - /** - * Creates a new VertexAnimator object. - * - * @param vertexAnimationSet The animation data set containing the vertex animations used by the animator. - */ - function VertexAnimator(vertexAnimationSet) { - _super.call(this, vertexAnimationSet); - this._poses = new Array(); - this._weights = Array(1, 0, 0, 0); - - this._vertexAnimationSet = vertexAnimationSet; - this._numPoses = vertexAnimationSet.numPoses; - this._blendMode = vertexAnimationSet.blendMode; - } - /** - * @inheritDoc - */ - VertexAnimator.prototype.clone = function () { - return new VertexAnimator(this._vertexAnimationSet); - }; - - /** - * Plays a sequence with a given name. If the sequence is not found, it may not be loaded yet, and it will retry every frame. - * @param sequenceName The name of the clip to be played. - */ - VertexAnimator.prototype.play = function (name, transition, offset) { - if (typeof transition === "undefined") { transition = null; } - if (typeof offset === "undefined") { offset = NaN; } - if (this._pActiveAnimationName == name) - return; - - this._pActiveAnimationName = name; - - //TODO: implement transitions in vertex animator - if (!this._pAnimationSet.hasAnimation(name)) - throw new Error("Animation root node " + name + " not found!"); - - this._pActiveNode = this._pAnimationSet.getAnimation(name); - - this._pActiveState = this.getAnimationState(this._pActiveNode); - - if (this.updatePosition) { - //update straight away to reset position deltas - this._pActiveState.update(this._pAbsoluteTime); - this._pActiveState.positionDelta; - } - - this._activeVertexState = this._pActiveState; - - this.start(); - - //apply a time offset if specified - if (!isNaN(offset)) - this.reset(name, offset); - }; - - /** - * @inheritDoc - */ - VertexAnimator.prototype._pUpdateDeltaTime = function (dt) { - _super.prototype._pUpdateDeltaTime.call(this, dt); - - var geometryFlag = false; - - if (this._poses[0] != this._activeVertexState.currentGeometry) { - this._poses[0] = this._activeVertexState.currentGeometry; - geometryFlag = true; - } - - if (this._poses[1] != this._activeVertexState.nextGeometry) { - this._poses[1] = this._activeVertexState.nextGeometry; - geometryFlag = true; - } - - this._weights[0] = 1 - (this._weights[1] = this._activeVertexState.blendWeight); - - if (geometryFlag) { - //invalidate meshes - var mesh; - var len = this._pOwners.length; - for (var i = 0; i < len; i++) { - mesh = this._pOwners[i]; - mesh._iInvalidateRenderableGeometries(); - } - } - }; - - /** - * @inheritDoc - */ - VertexAnimator.prototype.setRenderState = function (shaderObject, renderable, stage, camera, vertexConstantOffset /*int*/ , vertexStreamOffset /*int*/ ) { - // todo: add code for when running on cpu - // if no poses defined, set temp data - if (!this._poses.length) { - this.setNullPose(shaderObject, renderable, stage, vertexConstantOffset, vertexStreamOffset); - return; - } - - // this type of animation can only be SubMesh - var subMesh = renderable.subMesh; - var subGeom; - var i; - var len = this._numPoses; - - stage.context.setProgramConstantsFromArray(away.stagegl.ContextGLProgramType.VERTEX, vertexConstantOffset, this._weights, 1); - - if (this._blendMode == animators.VertexAnimationMode.ABSOLUTE) - i = 1; - else - i = 0; - - for (; i < len; ++i) { - subGeom = this._poses[i].subGeometries[subMesh._iIndex] || subMesh.subGeometry; - - stage.context.activateBuffer(vertexStreamOffset++, VertexDataPool.getItem(subGeom, renderable.getIndexData(), TriangleSubGeometry.POSITION_DATA), subGeom.getOffset(TriangleSubGeometry.POSITION_DATA), TriangleSubGeometry.POSITION_FORMAT); - - if (shaderObject.normalDependencies > 0) - stage.context.activateBuffer(vertexStreamOffset++, VertexDataPool.getItem(subGeom, renderable.getIndexData(), TriangleSubGeometry.NORMAL_DATA), subGeom.getOffset(TriangleSubGeometry.NORMAL_DATA), TriangleSubGeometry.NORMAL_FORMAT); - } - }; - - VertexAnimator.prototype.setNullPose = function (shaderObject, renderable, stage, vertexConstantOffset /*int*/ , vertexStreamOffset /*int*/ ) { - stage.context.setProgramConstantsFromArray(away.stagegl.ContextGLProgramType.VERTEX, vertexConstantOffset, this._weights, 1); - - if (this._blendMode == animators.VertexAnimationMode.ABSOLUTE) { - var len = this._numPoses; - for (var i = 1; i < len; ++i) { - stage.context.activateBuffer(vertexStreamOffset++, renderable.getVertexData(TriangleSubGeometry.POSITION_DATA), renderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA), TriangleSubGeometry.POSITION_FORMAT); - - if (shaderObject.normalDependencies > 0) - stage.context.activateBuffer(vertexStreamOffset++, renderable.getVertexData(TriangleSubGeometry.NORMAL_DATA), renderable.getVertexOffset(TriangleSubGeometry.NORMAL_DATA), TriangleSubGeometry.NORMAL_FORMAT); - } - } - // todo: set temp data for additive? - }; - - /** - * Verifies if the animation will be used on cpu. Needs to be true for all passes for a material to be able to use it on gpu. - * Needs to be called if gpu code is potentially required. - */ - VertexAnimator.prototype.testGPUCompatibility = function (shaderObject) { - }; - - VertexAnimator.prototype.getRenderableSubGeometry = function (renderable, sourceSubGeometry) { - if (this._blendMode == animators.VertexAnimationMode.ABSOLUTE && this._poses.length) - return this._poses[0].subGeometries[renderable.subMesh._iIndex] || sourceSubGeometry; - - //nothing to do here - return sourceSubGeometry; - }; - return VertexAnimator; - })(animators.AnimatorBase); - animators.VertexAnimator = VertexAnimator; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (parsers) { - var TriangleSubGeometry = away.base.TriangleSubGeometry; - var Mesh = away.entities.Mesh; - var DefaultMaterialManager = away.materials.DefaultMaterialManager; - var BasicSpecularMethod = away.materials.SpecularBasicMethod; - var TriangleMethodMaterial = away.materials.TriangleMethodMaterial; - var TriangleMaterialMode = away.materials.TriangleMaterialMode; - var URLLoaderDataFormat = away.net.URLLoaderDataFormat; - - /** - * OBJParser provides a parser for the OBJ data type. - */ - var OBJParser = (function (_super) { - __extends(OBJParser, _super); - /** - * Creates a new OBJParser object. - * @param uri The url or id of the data or file to be parsed. - * @param extra The holder for extra contextual data that the parser might need. - */ - function OBJParser(scale) { - if (typeof scale === "undefined") { scale = 1; } - _super.call(this, URLLoaderDataFormat.TEXT); - this._mtlLibLoaded = true; - this._activeMaterialID = ""; - this._scale = scale; - } - Object.defineProperty(OBJParser.prototype, "scale", { - /** - * Scaling factor applied directly to vertices data - * @param value The scaling factor. - */ - set: function (value) { - this._scale = value; - }, - enumerable: true, - configurable: true - }); - - /** - * Indicates whether or not a given file extension is supported by the parser. - * @param extension The file extension of a potential file to be parsed. - * @return Whether or not the given file type is supported. - */ - OBJParser.supportsType = function (extension) { - extension = extension.toLowerCase(); - return extension == "obj"; - }; - - /** - * Tests whether a data block can be parsed by the parser. - * @param data The data block to potentially be parsed. - * @return Whether or not the given data is supported. - */ - OBJParser.supportsData = function (data) { - var content = parsers.ParserUtils.toString(data); - var hasV = false; - var hasF = false; - - if (content) { - hasV = content.indexOf("\nv ") != -1; - hasF = content.indexOf("\nf ") != -1; - } - - return hasV && hasF; - }; - - /** - * @inheritDoc - */ - OBJParser.prototype._iResolveDependency = function (resourceDependency) { - if (resourceDependency.id == 'mtl') { - var str = parsers.ParserUtils.toString(resourceDependency.data); - this.parseMtl(str); - } else { - var asset; - - if (resourceDependency.assets.length != 1) { - return; - } - - asset = resourceDependency.assets[0]; - - if (asset.assetType == away.library.AssetType.TEXTURE) { - var lm = new LoadedMaterial(); - lm.materialID = resourceDependency.id; - lm.texture = asset; - - this._materialLoaded.push(lm); - - if (this._meshes.length > 0) { - this.applyMaterial(lm); - } - } - } - }; - - /** - * @inheritDoc - */ - OBJParser.prototype._iResolveDependencyFailure = function (resourceDependency) { - if (resourceDependency.id == "mtl") { - this._mtlLib = false; - this._mtlLibLoaded = false; - } else { - var lm = new LoadedMaterial(); - lm.materialID = resourceDependency.id; - this._materialLoaded.push(lm); - } - - if (this._meshes.length > 0) - this.applyMaterial(lm); - }; - - /** - * @inheritDoc - */ - OBJParser.prototype._pProceedParsing = function () { - var line; - var creturn = String.fromCharCode(10); - var trunk; - - if (!this._startedParsing) { - this._textData = this._pGetTextData(); - - // Merge linebreaks that are immediately preceeded by - // the "escape" backward slash into single lines. - this._textData = this._textData.replace(/\\[\r\n]+\s*/gm, ' '); - } - - if (this._textData.indexOf(creturn) == -1) - creturn = String.fromCharCode(13); - - if (!this._startedParsing) { - this._startedParsing = true; - this._vertices = new Array(); - this._vertexNormals = new Array(); - this._materialIDs = new Array(); - this._materialLoaded = new Array(); - this._meshes = new Array(); - this._uvs = new Array(); - this._stringLength = this._textData.length; - this._charIndex = this._textData.indexOf(creturn, 0); - this._oldIndex = 0; - this._objects = new Array(); - this._objectIndex = 0; - } - - while (this._charIndex < this._stringLength && this._pHasTime()) { - this._charIndex = this._textData.indexOf(creturn, this._oldIndex); - - if (this._charIndex == -1) - this._charIndex = this._stringLength; - - line = this._textData.substring(this._oldIndex, this._charIndex); - line = line.split('\r').join(""); - line = line.replace(" ", " "); - trunk = line.split(" "); - this._oldIndex = this._charIndex + 1; - this.parseLine(trunk); - - // If whatever was parsed on this line resulted in the - // parsing being paused to retrieve dependencies, break - // here and do not continue parsing until un-paused. - if (this.parsingPaused) { - return parsers.ParserBase.MORE_TO_PARSE; - } - } - - if (this._charIndex >= this._stringLength) { - if (this._mtlLib && !this._mtlLibLoaded) { - return parsers.ParserBase.MORE_TO_PARSE; - } - - this.translate(); - this.applyMaterials(); - - return parsers.ParserBase.PARSING_DONE; - } - - return parsers.ParserBase.MORE_TO_PARSE; - }; - - OBJParser.prototype._pStartParsing = function (frameLimit) { - _super.prototype._pStartParsing.call(this, frameLimit); - - //create a content object for Loaders - this._pContent = new away.containers.DisplayObjectContainer(); - }; - - /** - * Parses a single line in the OBJ file. - */ - OBJParser.prototype.parseLine = function (trunk) { - switch (trunk[0]) { - case "mtllib": - this._mtlLib = true; - this._mtlLibLoaded = false; - this.loadMtl(trunk[1]); - - break; - - case "g": - this.createGroup(trunk); - - break; - - case "o": - this.createObject(trunk); - - break; - - case "usemtl": - if (this._mtlLib) { - if (!trunk[1]) - trunk[1] = "def000"; - - this._materialIDs.push(trunk[1]); - this._activeMaterialID = trunk[1]; - - if (this._currentGroup) - this._currentGroup.materialID = this._activeMaterialID; - } - - break; - - case "v": - this.parseVertex(trunk); - - break; - - case "vt": - this.parseUV(trunk); - - break; - - case "vn": - this.parseVertexNormal(trunk); - - break; - - case "f": - this.parseFace(trunk); - } - }; - - /** - * Converts the parsed data into an Away3D scenegraph structure - */ - OBJParser.prototype.translate = function () { - for (var objIndex = 0; objIndex < this._objects.length; ++objIndex) { - var groups = this._objects[objIndex].groups; - var numGroups = groups.length; - var materialGroups; - var numMaterialGroups; - var geometry; - var mesh; - - var m; - var sm; - var bmMaterial; - - for (var g = 0; g < numGroups; ++g) { - geometry = new away.base.Geometry(); - materialGroups = groups[g].materialGroups; - numMaterialGroups = materialGroups.length; - - for (m = 0; m < numMaterialGroups; ++m) - this.translateMaterialGroup(materialGroups[m], geometry); - - if (geometry.subGeometries.length == 0) - continue; - - // Finalize and force type-based name - this._pFinalizeAsset(geometry); //, ""); - - bmMaterial = new TriangleMethodMaterial(DefaultMaterialManager.getDefaultTexture()); - - //check for multipass - if (this.materialMode >= 2) - bmMaterial.materialMode = TriangleMaterialMode.MULTI_PASS; - - mesh = new Mesh(geometry, bmMaterial); - - if (this._objects[objIndex].name) { - // this is a full independent object ('o' tag in OBJ file) - mesh.name = this._objects[objIndex].name; - } else if (groups[g].name) { - // this is a group so the sub groups contain the actual mesh object names ('g' tag in OBJ file) - mesh.name = groups[g].name; - } else { - // No name stored. Use empty string which will force it - // to be overridden by finalizeAsset() to type default. - mesh.name = ""; - } - - this._meshes.push(mesh); - - if (groups[g].materialID != "") - bmMaterial.name = groups[g].materialID + "~" + mesh.name; - else - bmMaterial.name = this._lastMtlID + "~" + mesh.name; - - if (mesh.subMeshes.length > 1) { - for (sm = 1; sm < mesh.subMeshes.length; ++sm) - mesh.subMeshes[sm].material = bmMaterial; - } - - //add to the content property - this._pContent.addChild(mesh); - - this._pFinalizeAsset(mesh); - } - } - }; - - /** - * Translates an obj's material group to a subgeometry. - * @param materialGroup The material group data to convert. - * @param geometry The Geometry to contain the converted SubGeometry. - */ - OBJParser.prototype.translateMaterialGroup = function (materialGroup, geometry) { - var faces = materialGroup.faces; - var face; - var numFaces = faces.length; - var numVerts; - var sub; - - var vertices = new Array(); - var uvs = new Array(); - var normals = new Array(); - var indices = new Array(); - - this._realIndices = []; - this._vertexIndex = 0; - - var j; - for (var i = 0; i < numFaces; ++i) { - face = faces[i]; - numVerts = face.indexIds.length - 1; - - for (j = 1; j < numVerts; ++j) { - this.translateVertexData(face, j, vertices, uvs, indices, normals); - this.translateVertexData(face, 0, vertices, uvs, indices, normals); - this.translateVertexData(face, j + 1, vertices, uvs, indices, normals); - } - } - if (vertices.length > 0) { - sub = new TriangleSubGeometry(true); - sub.autoDeriveNormals = normals.length ? false : true; - sub.updateIndices(indices); - sub.updatePositions(vertices); - sub.updateVertexNormals(normals); - sub.updateUVs(uvs); - - geometry.addSubGeometry(sub); - } - }; - - OBJParser.prototype.translateVertexData = function (face, vertexIndex, vertices, uvs, indices /*uint*/ , normals) { - var index; - var vertex; - var vertexNormal; - var uv; - - if (!this._realIndices[face.indexIds[vertexIndex]]) { - index = this._vertexIndex; - this._realIndices[face.indexIds[vertexIndex]] = ++this._vertexIndex; - vertex = this._vertices[face.vertexIndices[vertexIndex] - 1]; - vertices.push(vertex.x * this._scale, vertex.y * this._scale, vertex.z * this._scale); - - if (face.normalIndices.length > 0) { - vertexNormal = this._vertexNormals[face.normalIndices[vertexIndex] - 1]; - normals.push(vertexNormal.x, vertexNormal.y, vertexNormal.z); - } - - if (face.uvIndices.length > 0) { - try { - uv = this._uvs[face.uvIndices[vertexIndex] - 1]; - uvs.push(uv.u, uv.v); - } catch (e) { - switch (vertexIndex) { - case 0: - uvs.push(0, 1); - break; - case 1: - uvs.push(.5, 0); - break; - case 2: - uvs.push(1, 1); - } - } - } - } else { - index = this._realIndices[face.indexIds[vertexIndex]] - 1; - } - - indices.push(index); - }; - - /** - * Creates a new object group. - * @param trunk The data block containing the object tag and its parameters - */ - OBJParser.prototype.createObject = function (trunk) { - this._currentGroup = null; - this._currentMaterialGroup = null; - this._objects.push(this._currentObject = new ObjectGroup()); - - if (trunk) - this._currentObject.name = trunk[1]; - }; - - /** - * Creates a new group. - * @param trunk The data block containing the group tag and its parameters - */ - OBJParser.prototype.createGroup = function (trunk) { - if (!this._currentObject) - this.createObject(null); - this._currentGroup = new Group(); - - this._currentGroup.materialID = this._activeMaterialID; - - if (trunk) - this._currentGroup.name = trunk[1]; - this._currentObject.groups.push(this._currentGroup); - - this.createMaterialGroup(null); - }; - - /** - * Creates a new material group. - * @param trunk The data block containing the material tag and its parameters - */ - OBJParser.prototype.createMaterialGroup = function (trunk) { - this._currentMaterialGroup = new MaterialGroup(); - if (trunk) - this._currentMaterialGroup.url = trunk[1]; - this._currentGroup.materialGroups.push(this._currentMaterialGroup); - }; - - /** - * Reads the next vertex coordinates. - * @param trunk The data block containing the vertex tag and its parameters - */ - OBJParser.prototype.parseVertex = function (trunk) { - //for the very rare cases of other delimiters/charcodes seen in some obj files - var v1, v2, v3; - if (trunk.length > 4) { - var nTrunk = []; - var val; - - for (var i = 1; i < trunk.length; ++i) { - val = parseFloat(trunk[i]); - if (!isNaN(val)) - nTrunk.push(val); - } - - v1 = nTrunk[0]; - v2 = nTrunk[1]; - v3 = -nTrunk[2]; - this._vertices.push(new Vertex(v1, v2, v3)); - } else { - v1 = parseFloat(trunk[1]); - v2 = parseFloat(trunk[2]); - v3 = -parseFloat(trunk[3]); - - this._vertices.push(new Vertex(v1, v2, v3)); - } - }; - - /** - * Reads the next uv coordinates. - * @param trunk The data block containing the uv tag and its parameters - */ - OBJParser.prototype.parseUV = function (trunk) { - if (trunk.length > 3) { - var nTrunk = []; - var val; - for (var i = 1; i < trunk.length; ++i) { - val = parseFloat(trunk[i]); - if (!isNaN(val)) - nTrunk.push(val); - } - this._uvs.push(new UV(nTrunk[0], 1 - nTrunk[1])); - } else { - this._uvs.push(new UV(parseFloat(trunk[1]), 1 - parseFloat(trunk[2]))); - } - }; - - /** - * Reads the next vertex normal coordinates. - * @param trunk The data block containing the vertex normal tag and its parameters - */ - OBJParser.prototype.parseVertexNormal = function (trunk) { - if (trunk.length > 4) { - var nTrunk = []; - var val; - for (var i = 1; i < trunk.length; ++i) { - val = parseFloat(trunk[i]); - if (!isNaN(val)) - nTrunk.push(val); - } - this._vertexNormals.push(new Vertex(nTrunk[0], nTrunk[1], -nTrunk[2])); - } else { - this._vertexNormals.push(new Vertex(parseFloat(trunk[1]), parseFloat(trunk[2]), -parseFloat(trunk[3]))); - } - }; - - /** - * Reads the next face's indices. - * @param trunk The data block containing the face tag and its parameters - */ - OBJParser.prototype.parseFace = function (trunk) { - var len = trunk.length; - var face = new FaceData(); - - if (!this._currentGroup) { - this.createGroup(null); - } - - var indices; - for (var i = 1; i < len; ++i) { - if (trunk[i] == "") { - continue; - } - - indices = trunk[i].split("/"); - face.vertexIndices.push(this.parseIndex(parseInt(indices[0]), this._vertices.length)); - - if (indices[1] && String(indices[1]).length > 0) - face.uvIndices.push(this.parseIndex(parseInt(indices[1]), this._uvs.length)); - - if (indices[2] && String(indices[2]).length > 0) - face.normalIndices.push(this.parseIndex(parseInt(indices[2]), this._vertexNormals.length)); - - face.indexIds.push(trunk[i]); - } - - this._currentMaterialGroup.faces.push(face); - }; - - /** - * This is a hack around negative face coords - */ - OBJParser.prototype.parseIndex = function (index, length) { - if (index < 0) - return index + length + 1; - else - return index; - }; - - OBJParser.prototype.parseMtl = function (data) { - var materialDefinitions = data.split('newmtl'); - var lines; - var trunk; - var j; - - var basicSpecularMethod; - var useSpecular; - var useColor; - var diffuseColor; - var color; - var specularColor; - var specular; - var alpha; - var mapkd; - - for (var i = 0; i < materialDefinitions.length; ++i) { - lines = (materialDefinitions[i].split('\r')).join("").split('\n'); - - //lines = (materialDefinitions[i].split('\r') as Array).join("").split('\n'); - if (lines.length == 1) - lines = materialDefinitions[i].split(String.fromCharCode(13)); - - diffuseColor = color = specularColor = 0xFFFFFF; - specular = 0; - useSpecular = false; - useColor = false; - alpha = 1; - mapkd = ""; - - for (j = 0; j < lines.length; ++j) { - lines[j] = lines[j].replace(/\s+$/, ""); - - if (lines[j].substring(0, 1) != "#" && (j == 0 || lines[j] != "")) { - trunk = lines[j].split(" "); - - if (String(trunk[0]).charCodeAt(0) == 9 || String(trunk[0]).charCodeAt(0) == 32) - trunk[0] = trunk[0].substring(1, trunk[0].length); - - if (j == 0) { - this._lastMtlID = trunk.join(""); - this._lastMtlID = (this._lastMtlID == "") ? "def000" : this._lastMtlID; - } else { - switch (trunk[0]) { - case "Ka": - if (trunk[1] && !isNaN(Number(trunk[1])) && trunk[2] && !isNaN(Number(trunk[2])) && trunk[3] && !isNaN(Number(trunk[3]))) - color = trunk[1] * 255 << 16 | trunk[2] * 255 << 8 | trunk[3] * 255; - break; - - case "Ks": - if (trunk[1] && !isNaN(Number(trunk[1])) && trunk[2] && !isNaN(Number(trunk[2])) && trunk[3] && !isNaN(Number(trunk[3]))) { - specularColor = trunk[1] * 255 << 16 | trunk[2] * 255 << 8 | trunk[3] * 255; - useSpecular = true; - } - break; - - case "Ns": - if (trunk[1] && !isNaN(Number(trunk[1]))) - specular = Number(trunk[1]) * 0.001; - if (specular == 0) - useSpecular = false; - break; - - case "Kd": - if (trunk[1] && !isNaN(Number(trunk[1])) && trunk[2] && !isNaN(Number(trunk[2])) && trunk[3] && !isNaN(Number(trunk[3]))) { - diffuseColor = trunk[1] * 255 << 16 | trunk[2] * 255 << 8 | trunk[3] * 255; - useColor = true; - } - break; - - case "tr": - case "d": - if (trunk[1] && !isNaN(Number(trunk[1]))) - alpha = Number(trunk[1]); - break; - - case "map_Kd": - mapkd = this.parseMapKdString(trunk); - mapkd = mapkd.replace(/\\/g, "/"); - } - } - } - } - - if (mapkd != "") { - if (useSpecular) { - basicSpecularMethod = new BasicSpecularMethod(); - basicSpecularMethod.specularColor = specularColor; - basicSpecularMethod.specular = specular; - - var specularData = new SpecularData(); - specularData.alpha = alpha; - specularData.basicSpecularMethod = basicSpecularMethod; - specularData.materialID = this._lastMtlID; - - if (!this._materialSpecularData) - this._materialSpecularData = new Array(); - - this._materialSpecularData.push(specularData); - } - - this._pAddDependency(this._lastMtlID, new away.net.URLRequest(mapkd)); - } else if (useColor && !isNaN(color)) { - var lm = new LoadedMaterial(); - lm.materialID = this._lastMtlID; - - if (alpha == 0) - console.log("Warning: an alpha value of 0 was found in mtl color tag (Tr or d) ref:" + this._lastMtlID + ", mesh(es) using it will be invisible!"); - - var cm; - - if (this.materialMode < 2) { - cm = new TriangleMethodMaterial(color); - - var colorMat = cm; - - colorMat.alpha = alpha; - colorMat.diffuseColor = diffuseColor; - colorMat.repeat = true; - - if (useSpecular) { - colorMat.specularColor = specularColor; - colorMat.specular = specular; - } - } else { - cm = new TriangleMethodMaterial(color); - cm.materialMode = TriangleMaterialMode.MULTI_PASS; - - var colorMultiMat = cm; - - colorMultiMat.diffuseColor = diffuseColor; - colorMultiMat.repeat = true; - - if (useSpecular) { - colorMultiMat.specularColor = specularColor; - colorMultiMat.specular = specular; - } - } - - lm.cm = cm; - - this._materialLoaded.push(lm); - - if (this._meshes.length > 0) - this.applyMaterial(lm); - } - } - - this._mtlLibLoaded = true; - }; - - OBJParser.prototype.parseMapKdString = function (trunk) { - var url = ""; - var i; - var breakflag; - - for (i = 1; i < trunk.length;) { - switch (trunk[i]) { - case "-blendu": - case "-blendv": - case "-cc": - case "-clamp": - case "-texres": - i += 2; //Skip ahead 1 attribute - break; - case "-mm": - i += 3; //Skip ahead 2 attributes - break; - case "-o": - case "-s": - case "-t": - i += 4; //Skip ahead 3 attributes - continue; - default: - breakflag = true; - break; - } - - if (breakflag) - break; - } - - for (i; i < trunk.length; i++) { - url += trunk[i]; - url += " "; - } - - //Remove the extraneous space and/or newline from the right side - url = url.replace(/\s+$/, ""); - - return url; - }; - - OBJParser.prototype.loadMtl = function (mtlurl) { - // Add raw-data dependency to queue and load dependencies now, - // which will pause the parsing in the meantime. - this._pAddDependency('mtl', new away.net.URLRequest(mtlurl), true); - this._pPauseAndRetrieveDependencies(); // - }; - - OBJParser.prototype.applyMaterial = function (lm) { - var decomposeID; - var mesh; - var tm; - var j; - var specularData; - - for (var i = 0; i < this._meshes.length; ++i) { - mesh = this._meshes[i]; - decomposeID = mesh.material.name.split("~"); - - if (decomposeID[0] == lm.materialID) { - if (lm.cm) { - if (mesh.material) - mesh.material = null; - mesh.material = lm.cm; - } else if (lm.texture) { - if (this.materialMode < 2) { - tm = mesh.material; - - tm.texture = lm.texture; - tm.color = lm.color; - tm.alpha = lm.alpha; - tm.repeat = true; - - if (lm.specularMethod) { - // By setting the specularMethod property to null before assigning - // the actual method instance, we avoid having the properties of - // the new method being overridden with the settings from the old - // one, which is default behavior of the setter. - tm.specularMethod = null; - tm.specularMethod = lm.specularMethod; - } else if (this._materialSpecularData) { - for (j = 0; j < this._materialSpecularData.length; ++j) { - specularData = this._materialSpecularData[j]; - - if (specularData.materialID == lm.materialID) { - tm.specularMethod = null; // Prevent property overwrite (see above) - tm.specularMethod = specularData.basicSpecularMethod; - tm.color = specularData.color; - tm.alpha = specularData.alpha; - break; - } - } - } - } else { - tm = mesh.material; - tm.materialMode = TriangleMaterialMode.MULTI_PASS; - - tm.texture = lm.texture; - tm.color = lm.color; - tm.repeat = true; - - if (lm.specularMethod) { - // By setting the specularMethod property to null before assigning - // the actual method instance, we avoid having the properties of - // the new method being overridden with the settings from the old - // one, which is default behavior of the setter. - tm.specularMethod = null; - tm.specularMethod = lm.specularMethod; - } else if (this._materialSpecularData) { - for (j = 0; j < this._materialSpecularData.length; ++j) { - specularData = this._materialSpecularData[j]; - - if (specularData.materialID == lm.materialID) { - tm.specularMethod = null; // Prevent property overwrite (see above) - tm.specularMethod = specularData.basicSpecularMethod; - tm.color = specularData.color; - - break; - } - } - } - } - } - - mesh.material.name = decomposeID[1] ? decomposeID[1] : decomposeID[0]; - this._meshes.splice(i, 1); - --i; - } - } - - if (lm.cm || tm) - this._pFinalizeAsset(lm.cm || tm); - }; - - OBJParser.prototype.applyMaterials = function () { - if (this._materialLoaded.length == 0) - return; - - for (var i = 0; i < this._materialLoaded.length; ++i) - this.applyMaterial(this._materialLoaded[i]); - }; - return OBJParser; - })(parsers.ParserBase); - parsers.OBJParser = OBJParser; - })(away.parsers || (away.parsers = {})); - var parsers = away.parsers; -})(away || (away = {})); - -var BasicSpecularMethod = away.materials.SpecularBasicMethod; -var MaterialBase = away.materials.MaterialBase; -var Texture2DBase = away.textures.Texture2DBase; - -var ObjectGroup = (function () { - function ObjectGroup() { - this.groups = new Array(); - } - return ObjectGroup; -})(); - -var Group = (function () { - function Group() { - this.materialGroups = new Array(); - } - return Group; -})(); - -var MaterialGroup = (function () { - function MaterialGroup() { - this.faces = new Array(); - } - return MaterialGroup; -})(); - -var SpecularData = (function () { - function SpecularData() { - this.color = 0xFFFFFF; - this.alpha = 1; - } - return SpecularData; -})(); - -var LoadedMaterial = (function () { - function LoadedMaterial() { - this.color = 0xFFFFFF; - this.alpha = 1; - } - return LoadedMaterial; -})(); - -var FaceData = (function () { - function FaceData() { - this.vertexIndices = new Array(); - this.uvIndices = new Array(); - this.normalIndices = new Array(); - this.indexIds = new Array(); - } - return FaceData; -})(); - -/** -* Texture coordinates value object. -*/ -var UV = (function () { - /** - * Creates a new UV object. - * - * @param u [optional] The horizontal coordinate of the texture value. Defaults to 0. - * @param v [optional] The vertical coordinate of the texture value. Defaults to 0. - */ - function UV(u, v) { - if (typeof u === "undefined") { u = 0; } - if (typeof v === "undefined") { v = 0; } - this._u = u; - this._v = v; - } - Object.defineProperty(UV.prototype, "v", { - /** - * Defines the vertical coordinate of the texture value. - */ - get: function () { - return this._v; - }, - set: function (value) { - this._v = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(UV.prototype, "u", { - /** - * Defines the horizontal coordinate of the texture value. - */ - get: function () { - return this._u; - }, - set: function (value) { - this._u = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * returns a new UV value Object - */ - UV.prototype.clone = function () { - return new UV(this._u, this._v); - }; - - /** - * returns the value object as a string for trace/debug purpose - */ - UV.prototype.toString = function () { - return this._u + "," + this._v; - }; - return UV; -})(); - -var Vertex = (function () { - /** - * Creates a new Vertex value object. - * - * @param x [optional] The x value. Defaults to 0. - * @param y [optional] The y value. Defaults to 0. - * @param z [optional] The z value. Defaults to 0. - * @param index [optional] The index value. Defaults is NaN. - */ - function Vertex(x, y, z, index) { - if (typeof x === "undefined") { x = 0; } - if (typeof y === "undefined") { y = 0; } - if (typeof z === "undefined") { z = 0; } - if (typeof index === "undefined") { index = 0; } - this._x = x; - this._y = y; - this._z = z; - this._index = index; - } - - Object.defineProperty(Vertex.prototype, "index", { - get: function () { - return this._index; - }, - /** - * To define/store the index of value object - * @param ind The index - */ - set: function (ind) { - this._index = ind; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Vertex.prototype, "x", { - /** - * To define/store the x value of the value object - * @param value The x value - */ - get: function () { - return this._x; - }, - set: function (value) { - this._x = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Vertex.prototype, "y", { - /** - * To define/store the y value of the value object - * @param value The y value - */ - get: function () { - return this._y; - }, - set: function (value) { - this._y = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Vertex.prototype, "z", { - /** - * To define/store the z value of the value object - * @param value The z value - */ - get: function () { - return this._z; - }, - set: function (value) { - this._z = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * returns a new Vertex value Object - */ - Vertex.prototype.clone = function () { - return new Vertex(this._x, this._y, this._z); - }; - return Vertex; -})(); -/// -var away; -(function (away) { - (function (parsers) { - var JointPose = away.animators.JointPose; - var Skeleton = away.animators.Skeleton; - var SkeletonAnimationSet = away.animators.SkeletonAnimationSet; - var SkeletonAnimator = away.animators.SkeletonAnimator; - var SkeletonClipNode = away.animators.SkeletonClipNode; - var SkeletonPose = away.animators.SkeletonPose; - var SkeletonJoint = away.animators.SkeletonJoint; - var VertexAnimationSet = away.animators.VertexAnimationSet; - var VertexAnimator = away.animators.VertexAnimator; - var VertexClipNode = away.animators.VertexClipNode; - var BlendMode = away.base.BlendMode; - var Geometry = away.base.Geometry; - - var TriangleSubGeometry = away.base.TriangleSubGeometry; - var Mesh = away.entities.Mesh; - var DirectionalLight = away.entities.DirectionalLight; - var PointLight = away.entities.PointLight; - var ColorTransform = away.geom.ColorTransform; - var Matrix3D = away.geom.Matrix3D; - var AssetType = away.library.AssetType; - var AmbientEnvMapMethod = away.materials.AmbientEnvMapMethod; - var DefaultMaterialManager = away.materials.DefaultMaterialManager; - var DiffuseDepthMethod = away.materials.DiffuseDepthMethod; - var DiffuseCelMethod = away.materials.DiffuseCelMethod; - - // import DiffuseSubSurfaceMethod = away.materials.DiffuseSubSurfaceMethod; - var DiffuseGradientMethod = away.materials.DiffuseGradientMethod; - var DiffuseLightMapMethod = away.materials.DiffuseLightMapMethod; - var DiffuseWrapMethod = away.materials.DiffuseWrapMethod; - var EffectAlphaMaskMethod = away.materials.EffectAlphaMaskMethod; - var EffectColorMatrixMethod = away.materials.EffectColorMatrixMethod; - var EffectColorTransformMethod = away.materials.EffectColorTransformMethod; - var EffectEnvMapMethod = away.materials.EffectEnvMapMethod; - var EffectFogMethod = away.materials.EffectFogMethod; - var EffectFresnelEnvMapMethod = away.materials.EffectFresnelEnvMapMethod; - var EffectLightMapMethod = away.materials.EffectLightMapMethod; - - var EffectRimLightMethod = away.materials.EffectRimLightMethod; - - var NormalSimpleWaterMethod = away.materials.NormalSimpleWaterMethod; - var TriangleMethodMaterial = away.materials.TriangleMethodMaterial; - var TriangleMaterialMode = away.materials.TriangleMaterialMode; - var ShadowDitheredMethod = away.materials.ShadowDitheredMethod; - var ShadowFilteredMethod = away.materials.ShadowFilteredMethod; - var SkyboxMaterial = away.materials.SkyboxMaterial; - var SpecularFresnelMethod = away.materials.SpecularFresnelMethod; - var ShadowHardMethod = away.materials.ShadowHardMethod; - var SpecularAnisotropicMethod = away.materials.SpecularAnisotropicMethod; - var SpecularCelMethod = away.materials.SpecularCelMethod; - var SpecularPhongMethod = away.materials.SpecularPhongMethod; - var ShadowNearMethod = away.materials.ShadowNearMethod; - var CubeMapShadowMapper = away.materials.CubeMapShadowMapper; - var DirectionalShadowMapper = away.materials.DirectionalShadowMapper; - - var ShadowSoftMethod = away.materials.ShadowSoftMethod; - var StaticLightPicker = away.materials.StaticLightPicker; - var URLLoaderDataFormat = away.net.URLLoaderDataFormat; - var ParserBase = away.parsers.ParserBase; - var ParserUtils = away.parsers.ParserUtils; - - var BitmapCubeTexture = away.textures.BitmapCubeTexture; - - var ImageCubeTexture = away.textures.ImageCubeTexture; - var ImageTexture = away.textures.ImageTexture; - - var ByteArray = away.utils.ByteArray; - - /** - * AWDParser provides a parser for the AWD data type. - */ - var AWDParser = (function (_super) { - __extends(AWDParser, _super); - /** - * Creates a new AWDParser object. - * @param uri The url or id of the data or file to be parsed. - * @param extra The holder for extra contextual data that the parser might need. - */ - function AWDParser() { - _super.call(this, URLLoaderDataFormat.ARRAY_BUFFER); - //set to "true" to have some console.logs in the Console - this._debug = false; - this._startedParsing = false; - this._texture_users = {}; - this._parsed_header = false; - - this._blocks = new Array(); - this._blocks[0] = new AWDBlock(); - this._blocks[0].data = null; // Zero address means null in AWD - - this.blendModeDic = new Array(); // used to translate ints to blendMode-strings - this.blendModeDic.push(BlendMode.NORMAL); - this.blendModeDic.push(BlendMode.ADD); - this.blendModeDic.push(BlendMode.ALPHA); - this.blendModeDic.push(BlendMode.DARKEN); - this.blendModeDic.push(BlendMode.DIFFERENCE); - this.blendModeDic.push(BlendMode.ERASE); - this.blendModeDic.push(BlendMode.HARDLIGHT); - this.blendModeDic.push(BlendMode.INVERT); - this.blendModeDic.push(BlendMode.LAYER); - this.blendModeDic.push(BlendMode.LIGHTEN); - this.blendModeDic.push(BlendMode.MULTIPLY); - this.blendModeDic.push(BlendMode.NORMAL); - this.blendModeDic.push(BlendMode.OVERLAY); - this.blendModeDic.push(BlendMode.SCREEN); - this.blendModeDic.push(BlendMode.SHADER); - this.blendModeDic.push(BlendMode.OVERLAY); - - this._depthSizeDic = new Array(); // used to translate ints to depthSize-values - this._depthSizeDic.push(256); - this._depthSizeDic.push(512); - this._depthSizeDic.push(2048); - this._depthSizeDic.push(1024); - this._version = Array(); // will contain 2 int (major-version, minor-version) for awd-version-check - } - /** - * Indicates whether or not a given file extension is supported by the parser. - * @param extension The file extension of a potential file to be parsed. - * @return Whether or not the given file type is supported. - */ - AWDParser.supportsType = function (extension) { - extension = extension.toLowerCase(); - return extension == "awd"; - }; - - /** - * Tests whether a data block can be parsed by the parser. - * @param data The data block to potentially be parsed. - * @return Whether or not the given data is supported. - */ - AWDParser.supportsData = function (data) { - return (away.parsers.ParserUtils.toString(data, 3) == 'AWD'); - }; - - /** - * @inheritDoc - */ - AWDParser.prototype._iResolveDependency = function (resourceDependency) { - // this will be called when Dependency has finished loading. - // the Assets waiting for this Bitmap, can be Texture or CubeTexture. - // if the Bitmap is awaited by a CubeTexture, we need to check if its the last Bitmap of the CubeTexture, - // so we know if we have to finalize the Asset (CubeTexture) or not. - if (resourceDependency.assets.length == 1) { - var isCubeTextureArray = resourceDependency.id.split("#"); - var ressourceID = isCubeTextureArray[0]; - var asset; - var thisBitmapTexture; - var block; - - if (isCubeTextureArray.length == 1) { - asset = resourceDependency.assets[0]; - if (asset) { - var mat; - var users; - - block = this._blocks[resourceDependency.id]; - block.data = asset; // Store finished asset - - // Reset name of texture to the one defined in the AWD file, - // as opposed to whatever the image parser came up with. - asset.resetAssetPath(block.name, null, true); - block.name = asset.name; - - // Finalize texture asset to dispatch texture event, which was - // previously suppressed while the dependency was loaded. - this._pFinalizeAsset(asset); - - if (this._debug) { - console.log("Successfully loaded Bitmap for texture"); - console.log("Parsed texture: Name = " + block.name); - } - } - } - - if (isCubeTextureArray.length > 1) { - thisBitmapTexture = resourceDependency.assets[0]; - - var tx = thisBitmapTexture; - - this._cubeTextures[isCubeTextureArray[1]] = tx.htmlImageElement; // ? - this._texture_users[ressourceID].push(1); - - if (this._debug) { - console.log("Successfully loaded Bitmap " + this._texture_users[ressourceID].length + " / 6 for Cubetexture"); - } - if (this._texture_users[ressourceID].length == this._cubeTextures.length) { - var posX = this._cubeTextures[0]; - var negX = this._cubeTextures[1]; - var posY = this._cubeTextures[2]; - var negY = this._cubeTextures[3]; - var posZ = this._cubeTextures[4]; - var negZ = this._cubeTextures[5]; - - asset = new ImageCubeTexture(posX, negX, posY, negY, posZ, negZ); - block = this._blocks[ressourceID]; - block.data = asset; // Store finished asset - - // Reset name of texture to the one defined in the AWD file, - // as opposed to whatever the image parser came up with. - asset.resetAssetPath(block.name, null, true); - block.name = asset.name; - - // Finalize texture asset to dispatch texture event, which was - // previously suppressed while the dependency was loaded. - this._pFinalizeAsset(asset); - if (this._debug) { - console.log("Parsed CubeTexture: Name = " + block.name); - } - } - } - } - }; - - /** - * @inheritDoc - */ - AWDParser.prototype._iResolveDependencyFailure = function (resourceDependency) { - //not used - if a dependcy fails, the awaiting Texture or CubeTexture will never be finalized, and the default-bitmaps will be used. - // this means, that if one Bitmap of a CubeTexture fails, the CubeTexture will have the DefaultTexture applied for all six Bitmaps. - }; - - /** - * Resolve a dependency name - * - * @param resourceDependency The dependency to be resolved. - */ - AWDParser.prototype._iResolveDependencyName = function (resourceDependency, asset) { - var oldName = asset.name; - - if (asset) { - var block = this._blocks[parseInt(resourceDependency.id)]; - - // Reset name of texture to the one defined in the AWD file, - // as opposed to whatever the image parser came up with. - asset.resetAssetPath(block.name, null, true); - } - - var newName = asset.name; - - asset.name = oldName; - - return newName; - }; - - /** - * @inheritDoc - */ - AWDParser.prototype._pProceedParsing = function () { - if (!this._startedParsing) { - this._byteData = this._pGetByteData(); //getByteData(); - this._startedParsing = true; - } - - if (!this._parsed_header) { - //---------------------------------------------------------------------------- - // LITTLE_ENDIAN - Default for ArrayBuffer / Not implemented in ByteArray - //---------------------------------------------------------------------------- - //this._byteData.endian = Endian.LITTLE_ENDIAN; - //---------------------------------------------------------------------------- - //---------------------------------------------------------------------------- - // Parse header and decompress body if needed - this.parseHeader(); - - switch (this._compression) { - case AWDParser.DEFLATE: - case AWDParser.LZMA: - this._pDieWithError('Compressed AWD formats not yet supported'); - break; - - case AWDParser.UNCOMPRESSED: - this._body = this._byteData; - break; - } - - this._parsed_header = true; - //---------------------------------------------------------------------------- - // LITTLE_ENDIAN - Default for ArrayBuffer / Not implemented in ByteArray - //---------------------------------------------------------------------------- - //this._body.endian = Endian.LITTLE_ENDIAN;// Should be default - //---------------------------------------------------------------------------- - } - - if (this._body) { - while (this._body.getBytesAvailable() > 0 && !this.parsingPaused) { - this.parseNextBlock(); - } - - //---------------------------------------------------------------------------- - // Return complete status - if (this._body.getBytesAvailable() == 0) { - this.dispose(); - return ParserBase.PARSING_DONE; - } else { - return ParserBase.MORE_TO_PARSE; - } - } else { - switch (this._compression) { - case AWDParser.DEFLATE: - case AWDParser.LZMA: - if (this._debug) { - console.log("(!) AWDParser Error: Compressed AWD formats not yet supported (!)"); - } - - break; - } - - // Error - most likely _body not set because we do not support compression. - return ParserBase.PARSING_DONE; - } - }; - - AWDParser.prototype._pStartParsing = function (frameLimit) { - _super.prototype._pStartParsing.call(this, frameLimit); - - //create a content object for Loaders - this._pContent = new away.containers.DisplayObjectContainer(); - }; - - AWDParser.prototype.dispose = function () { - for (var c in this._blocks) { - var b = this._blocks[c]; - b.dispose(); - } - }; - - AWDParser.prototype.parseNextBlock = function () { - var block; - var assetData; - var isParsed = false; - var ns; - var type; - var flags; - var len; - - this._cur_block_id = this._body.readUnsignedInt(); - - ns = this._body.readUnsignedByte(); - type = this._body.readUnsignedByte(); - flags = this._body.readUnsignedByte(); - len = this._body.readUnsignedInt(); - - var blockCompression = bitFlags.test(flags, bitFlags.FLAG4); - var blockCompressionLZMA = bitFlags.test(flags, bitFlags.FLAG5); - - if (this._accuracyOnBlocks) { - this._accuracyMatrix = bitFlags.test(flags, bitFlags.FLAG1); - this._accuracyGeo = bitFlags.test(flags, bitFlags.FLAG2); - this._accuracyProps = bitFlags.test(flags, bitFlags.FLAG3); - this._geoNrType = AWDParser.FLOAT32; - - if (this._accuracyGeo) { - this._geoNrType = AWDParser.FLOAT64; - } - - this._matrixNrType = AWDParser.FLOAT32; - - if (this._accuracyMatrix) { - this._matrixNrType = AWDParser.FLOAT64; - } - - this._propsNrType = AWDParser.FLOAT32; - - if (this._accuracyProps) { - this._propsNrType = AWDParser.FLOAT64; - } - } - - var blockEndAll = this._body.position + len; - - if (len > this._body.getBytesAvailable()) { - this._pDieWithError('AWD2 block length is bigger than the bytes that are available!'); - this._body.position += this._body.getBytesAvailable(); - return; - } - this._newBlockBytes = new ByteArray(); - - this._body.readBytes(this._newBlockBytes, 0, len); - - //---------------------------------------------------------------------------- - // Compressed AWD Formats not yet supported - if (blockCompression) { - this._pDieWithError('Compressed AWD formats not yet supported'); - /* - if (blockCompressionLZMA) - { - this._newBlockBytes.uncompress(AWDParser.COMPRESSIONMODE_LZMA); - } - else - { - this._newBlockBytes.uncompress(); - } - */ - } - - //---------------------------------------------------------------------------- - // LITTLE_ENDIAN - Default for ArrayBuffer / Not implemented in ByteArray - //---------------------------------------------------------------------------- - //this._newBlockBytes.endian = Endian.LITTLE_ENDIAN; - //---------------------------------------------------------------------------- - this._newBlockBytes.position = 0; - block = new AWDBlock(); - block.len = this._newBlockBytes.position + len; - block.id = this._cur_block_id; - - var blockEndBlock = this._newBlockBytes.position + len; - - if (blockCompression) { - this._pDieWithError('Compressed AWD formats not yet supported'); - //blockEndBlock = this._newBlockBytes.position + this._newBlockBytes.length; - //block.len = blockEndBlock; - } - - if (this._debug) { - console.log("AWDBlock: ID = " + this._cur_block_id + " | TypeID = " + type + " | Compression = " + blockCompression + " | Matrix-Precision = " + this._accuracyMatrix + " | Geometry-Precision = " + this._accuracyGeo + " | Properties-Precision = " + this._accuracyProps); - } - - this._blocks[this._cur_block_id] = block; - - if ((this._version[0] == 2) && (this._version[1] == 1)) { - switch (type) { - case 11: - this.parsePrimitves(this._cur_block_id); - isParsed = true; - break; - case 31: - this.parseSkyboxInstance(this._cur_block_id); - isParsed = true; - break; - case 41: - this.parseLight(this._cur_block_id); - isParsed = true; - break; - case 42: - this.parseCamera(this._cur_block_id); - isParsed = true; - break; - - case 51: - this.parseLightPicker(this._cur_block_id); - isParsed = true; - break; - case 81: - this.parseMaterial_v1(this._cur_block_id); - isParsed = true; - break; - case 83: - this.parseCubeTexture(this._cur_block_id); - isParsed = true; - break; - case 91: - this.parseSharedMethodBlock(this._cur_block_id); - isParsed = true; - break; - case 92: - this.parseShadowMethodBlock(this._cur_block_id); - isParsed = true; - break; - case 111: - this.parseMeshPoseAnimation(this._cur_block_id, true); - isParsed = true; - break; - case 112: - this.parseMeshPoseAnimation(this._cur_block_id); - isParsed = true; - break; - case 113: - this.parseVertexAnimationSet(this._cur_block_id); - isParsed = true; - break; - case 122: - this.parseAnimatorSet(this._cur_block_id); - isParsed = true; - break; - case 253: - this.parseCommand(this._cur_block_id); - isParsed = true; - break; - } - //*/ - } - - //* - if (isParsed == false) { - switch (type) { - case 1: - this.parseTriangleGeometrieBlock(this._cur_block_id); - break; - case 22: - this.parseContainer(this._cur_block_id); - break; - case 23: - this.parseMeshInstance(this._cur_block_id); - break; - case 81: - this.parseMaterial(this._cur_block_id); - break; - case 82: - this.parseTexture(this._cur_block_id); - break; - case 101: - this.parseSkeleton(this._cur_block_id); - break; - case 102: - this.parseSkeletonPose(this._cur_block_id); - break; - case 103: - this.parseSkeletonAnimation(this._cur_block_id); - break; - case 121: - - case 254: - this.parseNameSpace(this._cur_block_id); - break; - case 255: - this.parseMetaData(this._cur_block_id); - break; - default: - if (this._debug) { - console.log("AWDBlock: Unknown BlockType (BlockID = " + this._cur_block_id + ") - Skip " + len + " bytes"); - } - this._newBlockBytes.position += len; - break; - } - } - - //*/ - var msgCnt = 0; - if (this._newBlockBytes.position == blockEndBlock) { - if (this._debug) { - if (block.errorMessages) { - while (msgCnt < block.errorMessages.length) { - console.log(" (!) Error: " + block.errorMessages[msgCnt] + " (!)"); - msgCnt++; - } - } - } - if (this._debug) { - console.log("\n"); - } - } else { - if (this._debug) { - console.log(" (!)(!)(!) Error while reading AWDBlock ID " + this._cur_block_id + " = skip to next block"); - - if (block.errorMessages) { - while (msgCnt < block.errorMessages.length) { - console.log(" (!) Error: " + block.errorMessages[msgCnt] + " (!)"); - msgCnt++; - } - } - } - } - - this._body.position = blockEndAll; - this._newBlockBytes = null; - }; - - //--Parser Blocks--------------------------------------------------------------------------- - //Block ID = 1 - AWDParser.prototype.parseTriangleGeometrieBlock = function (blockID) { - var geom = new away.base.Geometry(); - - // Read name and sub count - var name = this.parseVarStr(); - var num_subs = this._newBlockBytes.readUnsignedShort(); - - // Read optional properties - var props = this.parseProperties({ 1: this._geoNrType, 2: this._geoNrType }); - var geoScaleU = props.get(1, 1); - var geoScaleV = props.get(2, 1); - - // Loop through sub meshes - var subs_parsed = 0; - while (subs_parsed < num_subs) { - var i; - var sm_len, sm_end; - var sub_geom; - var w_indices; - var weights; - - sm_len = this._newBlockBytes.readUnsignedInt(); - sm_end = this._newBlockBytes.position + sm_len; - - // Ignore for now - var subProps = this.parseProperties({ 1: this._geoNrType, 2: this._geoNrType }); - - while (this._newBlockBytes.position < sm_end) { - var idx = 0; - var str_ftype, str_type, str_len, str_end; - - // Type, field type, length - str_type = this._newBlockBytes.readUnsignedByte(); - str_ftype = this._newBlockBytes.readUnsignedByte(); - str_len = this._newBlockBytes.readUnsignedInt(); - str_end = this._newBlockBytes.position + str_len; - - var x, y, z; - - if (str_type == 1) { - var verts = new Array(); - - while (this._newBlockBytes.position < str_end) { - // TODO: Respect stream field type - x = this.readNumber(this._accuracyGeo); - y = this.readNumber(this._accuracyGeo); - z = this.readNumber(this._accuracyGeo); - - verts[idx++] = x; - verts[idx++] = y; - verts[idx++] = z; - } - } else if (str_type == 2) { - var indices = new Array(); - - while (this._newBlockBytes.position < str_end) { - // TODO: Respect stream field type - indices[idx++] = this._newBlockBytes.readUnsignedShort(); - } - } else if (str_type == 3) { - var uvs = new Array(); - while (this._newBlockBytes.position < str_end) { - uvs[idx++] = this.readNumber(this._accuracyGeo); - } - } else if (str_type == 4) { - var normals = new Array(); - - while (this._newBlockBytes.position < str_end) { - normals[idx++] = this.readNumber(this._accuracyGeo); - } - } else if (str_type == 6) { - w_indices = Array(); - - while (this._newBlockBytes.position < str_end) { - w_indices[idx++] = this._newBlockBytes.readUnsignedShort() * 3; // TODO: Respect stream field type - } - } else if (str_type == 7) { - weights = new Array(); - - while (this._newBlockBytes.position < str_end) { - weights[idx++] = this.readNumber(this._accuracyGeo); - } - } else { - this._newBlockBytes.position = str_end; - } - } - - this.parseUserAttributes(); // Ignore sub-mesh attributes for now - - sub_geom = new TriangleSubGeometry(true); - if (weights) - sub_geom.jointsPerVertex = weights.length / (verts.length / 3); - if (normals) - sub_geom.autoDeriveNormals = false; - if (uvs) - sub_geom.autoDeriveUVs = false; - sub_geom.updateIndices(indices); - sub_geom.updatePositions(verts); - sub_geom.updateVertexNormals(normals); - sub_geom.updateUVs(uvs); - sub_geom.updateVertexTangents(null); - sub_geom.updateJointWeights(weights); - sub_geom.updateJointIndices(w_indices); - - var scaleU = subProps.get(1, 1); - var scaleV = subProps.get(2, 1); - var setSubUVs = false; - - if ((geoScaleU != scaleU) || (geoScaleV != scaleV)) { - setSubUVs = true; - scaleU = geoScaleU / scaleU; - scaleV = geoScaleV / scaleV; - } - - if (setSubUVs) - sub_geom.scaleUV(scaleU, scaleV); - - geom.addSubGeometry(sub_geom); - - // TODO: Somehow map in-sub to out-sub indices to enable look-up - // when creating meshes (and their material assignments.) - subs_parsed++; - } - if ((geoScaleU != 1) || (geoScaleV != 1)) - geom.scaleUV(geoScaleU, geoScaleV); - this.parseUserAttributes(); - this._pFinalizeAsset(geom, name); - this._blocks[blockID].data = geom; - - if (this._debug) { - console.log("Parsed a TriangleGeometry: Name = " + name + "| Id = " + sub_geom.id); - } - }; - - //Block ID = 11 - AWDParser.prototype.parsePrimitves = function (blockID) { - var name; - var prefab; - var primType; - var subs_parsed; - var props; - var bsm; - - // Read name and sub count - name = this.parseVarStr(); - primType = this._newBlockBytes.readUnsignedByte(); - props = this.parseProperties({ 101: this._geoNrType, 102: this._geoNrType, 103: this._geoNrType, 110: this._geoNrType, 111: this._geoNrType, 301: AWDParser.UINT16, 302: AWDParser.UINT16, 303: AWDParser.UINT16, 701: AWDParser.BOOL, 702: AWDParser.BOOL, 703: AWDParser.BOOL, 704: AWDParser.BOOL }); - - var primitiveTypes = ["Unsupported Type-ID", "PrimitivePlanePrefab", "PrimitiveCubePrefab", "PrimitiveSpherePrefab", "PrimitiveCylinderPrefab", "PrimitivesConePrefab", "PrimitivesCapsulePrefab", "PrimitivesTorusPrefab"]; - - switch (primType) { - case 1: - prefab = new away.prefabs.PrimitivePlanePrefab(props.get(101, 100), props.get(102, 100), props.get(301, 1), props.get(302, 1), props.get(701, true), props.get(702, false)); - break; - - case 2: - prefab = new away.prefabs.PrimitiveCubePrefab(props.get(101, 100), props.get(102, 100), props.get(103, 100), props.get(301, 1), props.get(302, 1), props.get(303, 1), props.get(701, true)); - break; - - case 3: - prefab = new away.prefabs.PrimitiveSpherePrefab(props.get(101, 50), props.get(301, 16), props.get(302, 12), props.get(701, true)); - break; - - case 4: - prefab = new away.prefabs.PrimitiveCylinderPrefab(props.get(101, 50), props.get(102, 50), props.get(103, 100), props.get(301, 16), props.get(302, 1), true, true, true); // bool701, bool702, bool703, bool704); - if (!props.get(701, true)) - prefab.topClosed = false; - if (!props.get(702, true)) - prefab.bottomClosed = false; - if (!props.get(703, true)) - prefab.yUp = false; - - break; - - case 5: - prefab = new away.prefabs.PrimitiveConePrefab(props.get(101, 50), props.get(102, 100), props.get(301, 16), props.get(302, 1), props.get(701, true), props.get(702, true)); - break; - - case 6: - prefab = new away.prefabs.PrimitiveCapsulePrefab(props.get(101, 50), props.get(102, 100), props.get(301, 16), props.get(302, 15), props.get(701, true)); - break; - - case 7: - prefab = new away.prefabs.PrimitiveTorusPrefab(props.get(101, 50), props.get(102, 50), props.get(301, 16), props.get(302, 8), props.get(701, true)); - break; - - default: - prefab = new away.prefabs.PrefabBase(); - console.log("ERROR: UNSUPPORTED PREFAB_TYPE"); - break; - } - - if ((props.get(110, 1) != 1) || (props.get(111, 1) != 1)) { - //geom.subGeometries; - //geom.scaleUV(props.get(110, 1), props.get(111, 1)); //TODO add back scaling to prefabs - } - - this.parseUserAttributes(); - prefab.name = name; - this._pFinalizeAsset(prefab, name); - this._blocks[blockID].data = prefab; - - if (this._debug) { - if ((primType < 0) || (primType > 7)) { - primType = 0; - } - console.log("Parsed a Primivite: Name = " + name + "| type = " + primitiveTypes[primType]); - } - }; - - // Block ID = 22 - AWDParser.prototype.parseContainer = function (blockID) { - var name; - var par_id; - var mtx; - var ctr; - var parent; - - par_id = this._newBlockBytes.readUnsignedInt(); - mtx = this.parseMatrix3D(); - name = this.parseVarStr(); - - var parentName = "Root (TopLevel)"; - ctr = new away.containers.DisplayObjectContainer(); - ctr.transform.matrix3D = mtx; - - var returnedArray = this.getAssetByID(par_id, [AssetType.CONTAINER, AssetType.LIGHT, AssetType.MESH]); - - if (returnedArray[0]) { - var obj = returnedArray[1].addChild(ctr); - parentName = returnedArray[1].name; - } else if (par_id > 0) { - this._blocks[blockID].addError("Could not find a parent for this ObjectContainer3D"); - } else { - //add to the content property - this._pContent.addChild(ctr); - } - - // in AWD version 2.1 we read the Container properties - if ((this._version[0] == 2) && (this._version[1] == 1)) { - var props = this.parseProperties({ 1: this._matrixNrType, 2: this._matrixNrType, 3: this._matrixNrType, 4: AWDParser.UINT8 }); - ctr.pivot = new away.geom.Vector3D(props.get(1, 0), props.get(2, 0), props.get(3, 0)); - } else { - this.parseProperties(null); - } - - // the extraProperties should only be set for AWD2.1-Files, but is read for both versions - ctr.extra = this.parseUserAttributes(); - - this._pFinalizeAsset(ctr, name); - this._blocks[blockID].data = ctr; - - if (this._debug) { - console.log("Parsed a Container: Name = '" + name + "' | Parent-Name = " + parentName); - } - }; - - // Block ID = 23 - AWDParser.prototype.parseMeshInstance = function (blockID) { - var num_materials; - var materials_parsed; - var parent; - var par_id = this._newBlockBytes.readUnsignedInt(); - var mtx = this.parseMatrix3D(); - var name = this.parseVarStr(); - var parentName = "Root (TopLevel)"; - var data_id = this._newBlockBytes.readUnsignedInt(); - var geom; - var returnedArrayGeometry = this.getAssetByID(data_id, [AssetType.GEOMETRY]); - - if (returnedArrayGeometry[0]) { - geom = returnedArrayGeometry[1]; - } else { - this._blocks[blockID].addError("Could not find a Geometry for this Mesh. A empty Geometry is created!"); - geom = new away.base.Geometry(); - } - - this._blocks[blockID].geoID = data_id; - var materials = new Array(); - num_materials = this._newBlockBytes.readUnsignedShort(); - - var materialNames = new Array(); - materials_parsed = 0; - - var returnedArrayMaterial; - - while (materials_parsed < num_materials) { - var mat_id; - mat_id = this._newBlockBytes.readUnsignedInt(); - returnedArrayMaterial = this.getAssetByID(mat_id, [AssetType.MATERIAL]); - if ((!returnedArrayMaterial[0]) && (mat_id > 0)) { - this._blocks[blockID].addError("Could not find Material Nr " + materials_parsed + " (ID = " + mat_id + " ) for this Mesh"); - } - - var m = returnedArrayMaterial[1]; - - materials.push(m); - materialNames.push(m.name); - - materials_parsed++; - } - - var mesh = new Mesh(geom, null); - mesh.transform.matrix3D = mtx; - - var returnedArrayParent = this.getAssetByID(par_id, [AssetType.CONTAINER, AssetType.LIGHT, AssetType.MESH]); - - if (returnedArrayParent[0]) { - var objC = returnedArrayParent[1]; - objC.addChild(mesh); - parentName = objC.name; - } else if (par_id > 0) { - this._blocks[blockID].addError("Could not find a parent for this Mesh"); - } else { - //add to the content property - this._pContent.addChild(mesh); - } - - if (materials.length >= 1 && mesh.subMeshes.length == 1) { - mesh.material = materials[0]; - } else if (materials.length > 1) { - var i; - - for (i = 0; i < mesh.subMeshes.length; i++) { - mesh.subMeshes[i].material = materials[Math.min(materials.length - 1, i)]; - } - } - if ((this._version[0] == 2) && (this._version[1] == 1)) { - var props = this.parseProperties({ 1: this._matrixNrType, 2: this._matrixNrType, 3: this._matrixNrType, 4: AWDParser.UINT8, 5: AWDParser.BOOL }); - mesh.pivot = new away.geom.Vector3D(props.get(1, 0), props.get(2, 0), props.get(3, 0)); - mesh.castsShadows = props.get(5, true); - } else { - this.parseProperties(null); - } - - mesh.extra = this.parseUserAttributes(); - - this._pFinalizeAsset(mesh, name); - this._blocks[blockID].data = mesh; - - if (this._debug) { - console.log("Parsed a Mesh: Name = '" + name + "' | Parent-Name = " + parentName + "| Geometry-Name = " + geom.name + " | SubMeshes = " + mesh.subMeshes.length + " | Mat-Names = " + materialNames.toString()); - } - }; - - //Block ID 31 - AWDParser.prototype.parseSkyboxInstance = function (blockID) { - var name = this.parseVarStr(); - var cubeTexAddr = this._newBlockBytes.readUnsignedInt(); - - var returnedArrayCubeTex = this.getAssetByID(cubeTexAddr, [AssetType.TEXTURE], "CubeTexture"); - if ((!returnedArrayCubeTex[0]) && (cubeTexAddr != 0)) - this._blocks[blockID].addError("Could not find the Cubetexture (ID = " + cubeTexAddr + " ) for this Skybox"); - var asset = new away.entities.Skybox(new SkyboxMaterial(returnedArrayCubeTex[1])); - - this.parseProperties(null); - asset.extra = this.parseUserAttributes(); - this._pFinalizeAsset(asset, name); - this._blocks[blockID].data = asset; - if (this._debug) - console.log("Parsed a Skybox: Name = '" + name + "' | CubeTexture-Name = " + returnedArrayCubeTex[1].name); - }; - - //Block ID = 41 - AWDParser.prototype.parseLight = function (blockID) { - var light; - var newShadowMapper; - - var par_id = this._newBlockBytes.readUnsignedInt(); - var mtx = this.parseMatrix3D(); - var name = this.parseVarStr(); - var lightType = this._newBlockBytes.readUnsignedByte(); - var props = this.parseProperties({ 1: this._propsNrType, 2: this._propsNrType, 3: AWDParser.COLOR, 4: this._propsNrType, 5: this._propsNrType, 6: AWDParser.BOOL, 7: AWDParser.COLOR, 8: this._propsNrType, 9: AWDParser.UINT8, 10: AWDParser.UINT8, 11: this._propsNrType, 12: AWDParser.UINT16, 21: this._matrixNrType, 22: this._matrixNrType, 23: this._matrixNrType }); - var shadowMapperType = props.get(9, 0); - var parentName = "Root (TopLevel)"; - var lightTypes = ["Unsupported LightType", "PointLight", "DirectionalLight"]; - var shadowMapperTypes = ["No ShadowMapper", "DirectionalShadowMapper", "NearDirectionalShadowMapper", "CascadeShadowMapper", "CubeMapShadowMapper"]; - - if (lightType == 1) { - light = new PointLight(); - - light.radius = props.get(1, 90000); - light.fallOff = props.get(2, 100000); - - if (shadowMapperType > 0) { - if (shadowMapperType == 4) { - newShadowMapper = new CubeMapShadowMapper(); - } - } - - light.transform.matrix3D = mtx; - } - - if (lightType == 2) { - light = new DirectionalLight(props.get(21, 0), props.get(22, -1), props.get(23, 1)); - - if (shadowMapperType > 0) { - if (shadowMapperType == 1) { - newShadowMapper = new DirectionalShadowMapper(); - } - //if (shadowMapperType == 2) - // newShadowMapper = new NearDirectionalShadowMapper(props.get(11, 0.5)); - //if (shadowMapperType == 3) - // newShadowMapper = new CascadeShadowMapper(props.get(12, 3)); - } - } - light.color = props.get(3, 0xffffff); - light.specular = props.get(4, 1.0); - light.diffuse = props.get(5, 1.0); - light.ambientColor = props.get(7, 0xffffff); - light.ambient = props.get(8, 0.0); - - // if a shadowMapper has been created, adjust the depthMapSize if needed, assign to light and set castShadows to true - if (newShadowMapper) { - if (newShadowMapper instanceof CubeMapShadowMapper) { - if (props.get(10, 1) != 1) { - newShadowMapper.depthMapSize = this._depthSizeDic[props.get(10, 1)]; - } - } else { - if (props.get(10, 2) != 2) { - newShadowMapper.depthMapSize = this._depthSizeDic[props.get(10, 2)]; - } - } - - light.shadowMapper = newShadowMapper; - light.castsShadows = true; - } - - if (par_id != 0) { - var returnedArrayParent = this.getAssetByID(par_id, [AssetType.CONTAINER, AssetType.LIGHT, AssetType.MESH]); - - if (returnedArrayParent[0]) { - returnedArrayParent[1].addChild(light); - parentName = returnedArrayParent[1].name; - } else { - this._blocks[blockID].addError("Could not find a parent for this Light"); - } - } else { - //add to the content property - this._pContent.addChild(light); - } - - this.parseUserAttributes(); - - this._pFinalizeAsset(light, name); - - this._blocks[blockID].data = light; - - if (this._debug) - console.log("Parsed a Light: Name = '" + name + "' | Type = " + lightTypes[lightType] + " | Parent-Name = " + parentName + " | ShadowMapper-Type = " + shadowMapperTypes[shadowMapperType]); - }; - - //Block ID = 43 - AWDParser.prototype.parseCamera = function (blockID) { - var par_id = this._newBlockBytes.readUnsignedInt(); - var mtx = this.parseMatrix3D(); - var name = this.parseVarStr(); - var parentName = "Root (TopLevel)"; - var projection; - - this._newBlockBytes.readUnsignedByte(); //set as active camera - this._newBlockBytes.readShort(); //lengthof lenses - not used yet - - var projectiontype = this._newBlockBytes.readShort(); - var props = this.parseProperties({ 101: this._propsNrType, 102: this._propsNrType, 103: this._propsNrType, 104: this._propsNrType }); - - switch (projectiontype) { - case 5001: - projection = new away.projections.PerspectiveProjection(props.get(101, 60)); - break; - case 5002: - projection = new away.projections.OrthographicProjection(props.get(101, 500)); - break; - case 5003: - projection = new away.projections.OrthographicOffCenterProjection(props.get(101, -400), props.get(102, 400), props.get(103, -300), props.get(104, 300)); - break; - default: - console.log("unsupportedLenstype"); - return; - } - - var camera = new away.entities.Camera(projection); - camera.transform.matrix3D = mtx; - - var returnedArrayParent = this.getAssetByID(par_id, [AssetType.CONTAINER, AssetType.LIGHT, AssetType.MESH]); - - if (returnedArrayParent[0]) { - var objC = returnedArrayParent[1]; - objC.addChild(camera); - - parentName = objC.name; - } else if (par_id > 0) { - this._blocks[blockID].addError("Could not find a parent for this Camera"); - } else { - //add to the content property - this._pContent.addChild(camera); - } - - camera.name = name; - props = this.parseProperties({ 1: this._matrixNrType, 2: this._matrixNrType, 3: this._matrixNrType, 4: AWDParser.UINT8 }); - camera.pivot = new away.geom.Vector3D(props.get(1, 0), props.get(2, 0), props.get(3, 0)); - camera.extra = this.parseUserAttributes(); - - this._pFinalizeAsset(camera, name); - - this._blocks[blockID].data = camera; - - if (this._debug) { - console.log("Parsed a Camera: Name = '" + name + "' | Projectiontype = " + projection + " | Parent-Name = " + parentName); - } - }; - - //Block ID = 51 - AWDParser.prototype.parseLightPicker = function (blockID) { - var name = this.parseVarStr(); - var numLights = this._newBlockBytes.readUnsignedShort(); - var lightsArray = new Array(); - var k = 0; - var lightID = 0; - - var returnedArrayLight; - var lightsArrayNames = new Array(); - - for (k = 0; k < numLights; k++) { - lightID = this._newBlockBytes.readUnsignedInt(); - returnedArrayLight = this.getAssetByID(lightID, [AssetType.LIGHT]); - - if (returnedArrayLight[0]) { - lightsArray.push(returnedArrayLight[1]); - lightsArrayNames.push(returnedArrayLight[1].name); - } else { - this._blocks[blockID].addError("Could not find a Light Nr " + k + " (ID = " + lightID + " ) for this LightPicker"); - } - } - - if (lightsArray.length == 0) { - this._blocks[blockID].addError("Could not create this LightPicker, cause no Light was found."); - this.parseUserAttributes(); - return; - } - - var lightPick = new StaticLightPicker(lightsArray); - lightPick.name = name; - - this.parseUserAttributes(); - this._pFinalizeAsset(lightPick, name); - - this._blocks[blockID].data = lightPick; - if (this._debug) { - console.log("Parsed a StaticLightPicker: Name = '" + name + "' | Texture-Name = " + lightsArrayNames.toString()); - } - }; - - //Block ID = 81 - AWDParser.prototype.parseMaterial = function (blockID) { - // TODO: not used - ////blockLength = block.len; - var name; - var type; - var props; - var mat; - var attributes; - var finalize; - var num_methods; - var methods_parsed; - var returnedArray; - - name = this.parseVarStr(); - type = this._newBlockBytes.readUnsignedByte(); - num_methods = this._newBlockBytes.readUnsignedByte(); - - // Read material numerical properties - // (1=color, 2=bitmap url, 10=alpha, 11=alpha_blending, 12=alpha_threshold, 13=repeat) - props = this.parseProperties({ 1: AWDParser.INT32, 2: AWDParser.BADDR, 10: this._propsNrType, 11: AWDParser.BOOL, 12: this._propsNrType, 13: AWDParser.BOOL }); - - methods_parsed = 0; - while (methods_parsed < num_methods) { - var method_type; - - method_type = this._newBlockBytes.readUnsignedShort(); - this.parseProperties(null); - this.parseUserAttributes(); - methods_parsed += 1; - } - var debugString = ""; - attributes = this.parseUserAttributes(); - if (type === 1) { - debugString += "Parsed a ColorMaterial(SinglePass): Name = '" + name + "' | "; - var color; - color = props.get(1, 0xffffff); - if (this.materialMode < 2) { - mat = new TriangleMethodMaterial(color, props.get(10, 1.0)); - } else { - mat = new TriangleMethodMaterial(color); - mat.materialMode = TriangleMaterialMode.MULTI_PASS; - } - } else if (type === 2) { - var tex_addr = props.get(2, 0); - - returnedArray = this.getAssetByID(tex_addr, [AssetType.TEXTURE]); - - if ((!returnedArray[0]) && (tex_addr > 0)) - this._blocks[blockID].addError("Could not find the DiffsueTexture (ID = " + tex_addr + " ) for this Material"); - - mat = new TriangleMethodMaterial(returnedArray[1]); - - if (this.materialMode < 2) { - mat.alphaBlending = props.get(11, false); - mat.alpha = props.get(10, 1.0); - debugString += "Parsed a TriangleMethodMaterial(SinglePass): Name = '" + name + "' | Texture-Name = " + mat.name; - } else { - mat.materialMode = TriangleMaterialMode.MULTI_PASS; - debugString += "Parsed a TriangleMethodMaterial(MultiPass): Name = '" + name + "' | Texture-Name = " + mat.name; - } - } - - mat.extra = attributes; - mat.alphaThreshold = props.get(12, 0.0); - mat.repeat = props.get(13, false); - this._pFinalizeAsset(mat, name); - this._blocks[blockID].data = mat; - - if (this._debug) { - console.log(debugString); - } - }; - - // Block ID = 81 AWD2.1 - AWDParser.prototype.parseMaterial_v1 = function (blockID) { - var mat; - var normalTexture; - var specTexture; - var returnedArray; - - var name = this.parseVarStr(); - var type = this._newBlockBytes.readUnsignedByte(); - var num_methods = this._newBlockBytes.readUnsignedByte(); - var props = this.parseProperties({ 1: AWDParser.UINT32, 2: AWDParser.BADDR, 3: AWDParser.BADDR, 4: AWDParser.UINT8, 5: AWDParser.BOOL, 6: AWDParser.BOOL, 7: AWDParser.BOOL, 8: AWDParser.BOOL, 9: AWDParser.UINT8, 10: this._propsNrType, 11: AWDParser.BOOL, 12: this._propsNrType, 13: AWDParser.BOOL, 15: this._propsNrType, 16: AWDParser.UINT32, 17: AWDParser.BADDR, 18: this._propsNrType, 19: this._propsNrType, 20: AWDParser.UINT32, 21: AWDParser.BADDR, 22: AWDParser.BADDR }); - var spezialType = props.get(4, 0); - var debugString = ""; - - if (spezialType >= 2) { - this._blocks[blockID].addError("Material-spezialType '" + spezialType + "' is not supported, can only be 0:singlePass, 1:MultiPass !"); - return; - } - - if (this.materialMode == 1) - spezialType = 0; - else if (this.materialMode == 2) - spezialType = 1; - - if (spezialType < 2) { - if (type == 1) { - var color = props.get(1, 0xcccccc); - - if (spezialType == 1) { - mat = new TriangleMethodMaterial(color); - mat.materialMode = TriangleMaterialMode.MULTI_PASS; - debugString += "Parsed a ColorMaterial(MultiPass): Name = '" + name + "' | "; - } else { - mat = new TriangleMethodMaterial(color, props.get(10, 1.0)); - mat.alphaBlending = props.get(11, false); - debugString += "Parsed a ColorMaterial(SinglePass): Name = '" + name + "' | "; - } - } else if (type == 2) { - var tex_addr = props.get(2, 0); - returnedArray = this.getAssetByID(tex_addr, [AssetType.TEXTURE]); - - if ((!returnedArray[0]) && (tex_addr > 0)) - this._blocks[blockID].addError("Could not find the AmbientTexture (ID = " + tex_addr + " ) for this TriangleMethodMaterial"); - - var texture = returnedArray[1]; - - mat = new TriangleMethodMaterial(texture); - - if (spezialType == 1) { - mat.materialMode = TriangleMaterialMode.MULTI_PASS; - - debugString += "Parsed a TriangleMethodMaterial(MultiPass): Name = '" + name + "' | Texture-Name = " + texture.name; - } else { - mat.alpha = props.get(10, 1.0); - mat.alphaBlending = props.get(11, false); - - debugString += "Parsed a TriangleMethodMaterial(SinglePass): Name = '" + name + "' | Texture-Name = " + texture.name; - } - } - - var diffuseTexture; - var diffuseTex_addr = props.get(17, 0); - - returnedArray = this.getAssetByID(diffuseTex_addr, [AssetType.TEXTURE]); - - if ((!returnedArray[0]) && (diffuseTex_addr != 0)) { - this._blocks[blockID].addError("Could not find the DiffuseTexture (ID = " + diffuseTex_addr + " ) for this TriangleMethodMaterial"); - } - - if (returnedArray[0]) - diffuseTexture = returnedArray[1]; - - if (diffuseTexture) { - mat.diffuseTexture = diffuseTexture; - debugString += " | DiffuseTexture-Name = " + diffuseTexture.name; - } - - var normalTex_addr = props.get(3, 0); - - returnedArray = this.getAssetByID(normalTex_addr, [AssetType.TEXTURE]); - - if ((!returnedArray[0]) && (normalTex_addr != 0)) { - this._blocks[blockID].addError("Could not find the NormalTexture (ID = " + normalTex_addr + " ) for this TriangleMethodMaterial"); - } - - if (returnedArray[0]) { - normalTexture = returnedArray[1]; - debugString += " | NormalTexture-Name = " + normalTexture.name; - } - - var specTex_addr = props.get(21, 0); - returnedArray = this.getAssetByID(specTex_addr, [AssetType.TEXTURE]); - - if ((!returnedArray[0]) && (specTex_addr != 0)) { - this._blocks[blockID].addError("Could not find the SpecularTexture (ID = " + specTex_addr + " ) for this TriangleMethodMaterial"); - } - if (returnedArray[0]) { - specTexture = returnedArray[1]; - debugString += " | SpecularTexture-Name = " + specTexture.name; - } - - var lightPickerAddr = props.get(22, 0); - returnedArray = this.getAssetByID(lightPickerAddr, [AssetType.LIGHT_PICKER]); - - if ((!returnedArray[0]) && (lightPickerAddr)) { - this._blocks[blockID].addError("Could not find the LightPicker (ID = " + lightPickerAddr + " ) for this TriangleMethodMaterial"); - } else { - mat.lightPicker = returnedArray[1]; - //debugString+=" | Lightpicker-Name = "+LightPickerBase(returnedArray[1]).name; - } - - mat.smooth = props.get(5, true); - mat.mipmap = props.get(6, true); - mat.bothSides = props.get(7, false); - mat.alphaPremultiplied = props.get(8, false); - mat.blendMode = this.blendModeDic[props.get(9, 0)]; - mat.repeat = props.get(13, false); - - if (normalTexture) - mat.normalMap = normalTexture; - - if (specTexture) - mat.specularMap = specTexture; - - mat.alphaThreshold = props.get(12, 0.0); - mat.ambient = props.get(15, 1.0); - mat.diffuseColor = props.get(16, 0xffffff); - mat.specular = props.get(18, 1.0); - mat.gloss = props.get(19, 50); - mat.specularColor = props.get(20, 0xffffff); - - var methods_parsed = 0; - var targetID; - - while (methods_parsed < num_methods) { - var method_type; - method_type = this._newBlockBytes.readUnsignedShort(); - - props = this.parseProperties({ 1: AWDParser.BADDR, 2: AWDParser.BADDR, 3: AWDParser.BADDR, 101: this._propsNrType, 102: this._propsNrType, 103: this._propsNrType, 201: AWDParser.UINT32, 202: AWDParser.UINT32, 301: AWDParser.UINT16, 302: AWDParser.UINT16, 401: AWDParser.UINT8, 402: AWDParser.UINT8, 601: AWDParser.COLOR, 602: AWDParser.COLOR, 701: AWDParser.BOOL, 702: AWDParser.BOOL, 801: AWDParser.MTX4x4 }); - - switch (method_type) { - case 999: - targetID = props.get(1, 0); - returnedArray = this.getAssetByID(targetID, [AssetType.EFFECTS_METHOD]); - - if (!returnedArray[0]) { - this._blocks[blockID].addError("Could not find the EffectMethod (ID = " + targetID + " ) for this Material"); - } else { - mat.addEffectMethod(returnedArray[1]); - - debugString += " | EffectMethod-Name = " + returnedArray[1].name; - } - - break; - - case 998: - targetID = props.get(1, 0); - returnedArray = this.getAssetByID(targetID, [AssetType.SHADOW_MAP_METHOD]); - - if (!returnedArray[0]) { - this._blocks[blockID].addError("Could not find the ShadowMethod (ID = " + targetID + " ) for this Material"); - } else { - mat.shadowMethod = returnedArray[1]; - debugString += " | ShadowMethod-Name = " + returnedArray[1].name; - } - - break; - - case 1: - targetID = props.get(1, 0); - returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE], "CubeTexture"); - if (!returnedArray[0]) - this._blocks[blockID].addError("Could not find the EnvMap (ID = " + targetID + " ) for this EnvMapAmbientMethodMaterial"); - mat.ambientMethod = new AmbientEnvMapMethod(returnedArray[1]); - debugString += " | AmbientEnvMapMethod | EnvMap-Name =" + returnedArray[1].name; - break; - - case 51: - mat.diffuseMethod = new DiffuseDepthMethod(); - debugString += " | DiffuseDepthMethod"; - break; - case 52: - targetID = props.get(1, 0); - returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]); - if (!returnedArray[0]) - this._blocks[blockID].addError("Could not find the GradientDiffuseTexture (ID = " + targetID + " ) for this GradientDiffuseMethod"); - mat.diffuseMethod = new DiffuseGradientMethod(returnedArray[1]); - debugString += " | DiffuseGradientMethod | GradientDiffuseTexture-Name =" + returnedArray[1].name; - break; - case 53: - mat.diffuseMethod = new DiffuseWrapMethod(props.get(101, 5)); - debugString += " | DiffuseWrapMethod"; - break; - case 54: - targetID = props.get(1, 0); - returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]); - if (!returnedArray[0]) - this._blocks[blockID].addError("Could not find the LightMap (ID = " + targetID + " ) for this LightMapDiffuseMethod"); - mat.diffuseMethod = new DiffuseLightMapMethod(returnedArray[1], this.blendModeDic[props.get(401, 10)], false, mat.diffuseMethod); - debugString += " | DiffuseLightMapMethod | LightMapTexture-Name =" + returnedArray[1].name; - break; - case 55: - mat.diffuseMethod = new DiffuseCelMethod(props.get(401, 3), mat.diffuseMethod); - mat.diffuseMethod.smoothness = props.get(101, 0.1); - debugString += " | DiffuseCelMethod"; - break; - case 56: - break; - - case 101: - mat.specularMethod = new SpecularAnisotropicMethod(); - debugString += " | SpecularAnisotropicMethod"; - break; - case 102: - mat.specularMethod = new SpecularPhongMethod(); - debugString += " | SpecularPhongMethod"; - break; - case 103: - mat.specularMethod = new SpecularCelMethod(props.get(101, 0.5), mat.specularMethod); - mat.specularMethod.smoothness = props.get(102, 0.1); - debugString += " | SpecularCelMethod"; - break; - case 104: - mat.specularMethod = new SpecularFresnelMethod(props.get(701, true), mat.specularMethod); - mat.specularMethod.fresnelPower = props.get(101, 5); - mat.specularMethod.normalReflectance = props.get(102, 0.1); - debugString += " | SpecularFresnelMethod"; - break; - case 151: - break; - case 152: - targetID = props.get(1, 0); - returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]); - if (!returnedArray[0]) - this._blocks[blockID].addError("Could not find the SecoundNormalMap (ID = " + targetID + " ) for this SimpleWaterNormalMethod"); - if (!mat.normalMap) - this._blocks[blockID].addError("Could not find a normal Map on this Material to use with this SimpleWaterNormalMethod"); - - mat.normalMap = returnedArray[1]; - mat.normalMethod = new NormalSimpleWaterMethod(mat.normalMap, returnedArray[1]); - debugString += " | NormalSimpleWaterMethod | Second-NormalTexture-Name = " + returnedArray[1].name; - break; - } - this.parseUserAttributes(); - methods_parsed += 1; - } - } - mat.extra = this.parseUserAttributes(); - this._pFinalizeAsset(mat, name); - - this._blocks[blockID].data = mat; - if (this._debug) { - console.log(debugString); - } - }; - - //Block ID = 82 - AWDParser.prototype.parseTexture = function (blockID) { - var asset; - - this._blocks[blockID].name = this.parseVarStr(); - - var type = this._newBlockBytes.readUnsignedByte(); - var data_len; - - this._texture_users[this._cur_block_id.toString()] = []; - - // External - if (type == 0) { - data_len = this._newBlockBytes.readUnsignedInt(); - var url; - url = this._newBlockBytes.readUTFBytes(data_len); - this._pAddDependency(this._cur_block_id.toString(), new away.net.URLRequest(url), false, null, true); - } else { - data_len = this._newBlockBytes.readUnsignedInt(); - - var data; - data = new ByteArray(); - this._newBlockBytes.readBytes(data, 0, data_len); - - // - // AWDParser - Fix for FireFox Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=715075 . - // - // Converting data to image here instead of parser - fix FireFox bug where image width / height is 0 when created from data - // This gives the browser time to initialise image width / height. - this._pAddDependency(this._cur_block_id.toString(), null, false, ParserUtils.byteArrayToImage(data), true); - //this._pAddDependency(this._cur_block_id.toString(), null, false, data, true); - } - - // Ignore for now - this.parseProperties(null); - this._blocks[blockID].extras = this.parseUserAttributes(); - this._pPauseAndRetrieveDependencies(); - this._blocks[blockID].data = asset; - - if (this._debug) { - var textureStylesNames = ["external", "embed"]; - console.log("Start parsing a " + textureStylesNames[type] + " Bitmap for Texture"); - } - }; - - //Block ID = 83 - AWDParser.prototype.parseCubeTexture = function (blockID) { - //blockLength = block.len; - var data_len; - var asset; - var i; - - this._cubeTextures = new Array(); - this._texture_users[this._cur_block_id.toString()] = []; - - var type = this._newBlockBytes.readUnsignedByte(); - - this._blocks[blockID].name = this.parseVarStr(); - - for (i = 0; i < 6; i++) { - this._texture_users[this._cur_block_id.toString()] = []; - this._cubeTextures.push(null); - - // External - if (type == 0) { - data_len = this._newBlockBytes.readUnsignedInt(); - var url; - url = this._newBlockBytes.readUTFBytes(data_len); - - this._pAddDependency(this._cur_block_id.toString() + "#" + i, new away.net.URLRequest(url), false, null, true); - } else { - data_len = this._newBlockBytes.readUnsignedInt(); - var data; - data = new ByteArray(); - - this._newBlockBytes.readBytes(data, 0, data_len); - - this._pAddDependency(this._cur_block_id.toString() + "#" + i, null, false, ParserUtils.byteArrayToImage(data), true); - } - } - - // Ignore for now - this.parseProperties(null); - this._blocks[blockID].extras = this.parseUserAttributes(); - this._pPauseAndRetrieveDependencies(); - this._blocks[blockID].data = asset; - - if (this._debug) { - var textureStylesNames = ["external", "embed"]; - console.log("Start parsing 6 " + textureStylesNames[type] + " Bitmaps for CubeTexture"); - } - }; - - //Block ID = 91 - AWDParser.prototype.parseSharedMethodBlock = function (blockID) { - var asset; - - this._blocks[blockID].name = this.parseVarStr(); - asset = this.parseSharedMethodList(blockID); - this.parseUserAttributes(); - this._blocks[blockID].data = asset; - this._pFinalizeAsset(asset, this._blocks[blockID].name); - this._blocks[blockID].data = asset; - - if (this._debug) { - console.log("Parsed a EffectMethod: Name = " + asset.name + " Type = " + asset); - } - }; - - //Block ID = 92 - AWDParser.prototype.parseShadowMethodBlock = function (blockID) { - var type; - var data_len; - var asset; - var shadowLightID; - this._blocks[blockID].name = this.parseVarStr(); - - shadowLightID = this._newBlockBytes.readUnsignedInt(); - var returnedArray = this.getAssetByID(shadowLightID, [AssetType.LIGHT]); - - if (!returnedArray[0]) { - this._blocks[blockID].addError("Could not find the TargetLight (ID = " + shadowLightID + " ) for this ShadowMethod - ShadowMethod not created"); - return; - } - - asset = this.parseShadowMethodList(returnedArray[1], blockID); - - if (!asset) - return; - - this.parseUserAttributes(); // Ignore for now - this._pFinalizeAsset(asset, this._blocks[blockID].name); - this._blocks[blockID].data = asset; - - if (this._debug) { - console.log("Parsed a ShadowMapMethodMethod: Name = " + asset.name + " | Type = " + asset + " | Light-Name = ", returnedArray[1].name); - } - }; - - //Block ID = 253 - AWDParser.prototype.parseCommand = function (blockID) { - var hasBlocks = (this._newBlockBytes.readUnsignedByte() == 1); - var par_id = this._newBlockBytes.readUnsignedInt(); - var mtx = this.parseMatrix3D(); - var name = this.parseVarStr(); - - var parentObject; - var targetObject; - - var returnedArray = this.getAssetByID(par_id, [AssetType.CONTAINER, AssetType.LIGHT, AssetType.MESH]); - - if (returnedArray[0]) { - parentObject = returnedArray[1]; - } - - var numCommands = this._newBlockBytes.readShort(); - var typeCommand = this._newBlockBytes.readShort(); - - var props = this.parseProperties({ 1: AWDParser.BADDR }); - - switch (typeCommand) { - case 1: - var targetID = props.get(1, 0); - var returnedArrayTarget = this.getAssetByID(targetID, [AssetType.LIGHT, AssetType.TEXTURE_PROJECTOR]); - - if ((!returnedArrayTarget[0]) && (targetID != 0)) { - this._blocks[blockID].addError("Could not find the light (ID = " + targetID + " ( for this CommandBock!"); - return; - } - - targetObject = returnedArrayTarget[1]; - - if (parentObject) { - parentObject.addChild(targetObject); - } - - targetObject.transform.matrix3D = mtx; - - break; - } - - if (targetObject) { - props = this.parseProperties({ 1: this._matrixNrType, 2: this._matrixNrType, 3: this._matrixNrType, 4: AWDParser.UINT8 }); - - targetObject.pivot = new away.geom.Vector3D(props.get(1, 0), props.get(2, 0), props.get(3, 0)); - targetObject.extra = this.parseUserAttributes(); - } - this._blocks[blockID].data = targetObject; - - if (this._debug) { - console.log("Parsed a CommandBlock: Name = '" + name); - } - }; - - //blockID 255 - AWDParser.prototype.parseMetaData = function (blockID) { - var props = this.parseProperties({ 1: AWDParser.UINT32, 2: AWDParser.AWDSTRING, 3: AWDParser.AWDSTRING, 4: AWDParser.AWDSTRING, 5: AWDParser.AWDSTRING }); - - if (this._debug) { - console.log("Parsed a MetaDataBlock: TimeStamp = " + props.get(1, 0)); - console.log(" EncoderName = " + props.get(2, "unknown")); - console.log(" EncoderVersion = " + props.get(3, "unknown")); - console.log(" GeneratorName = " + props.get(4, "unknown")); - console.log(" GeneratorVersion = " + props.get(5, "unknown")); - } - }; - - //blockID 254 - AWDParser.prototype.parseNameSpace = function (blockID) { - var id = this._newBlockBytes.readUnsignedByte(); - var nameSpaceString = this.parseVarStr(); - if (this._debug) - console.log("Parsed a NameSpaceBlock: ID = " + id + " | String = " + nameSpaceString); - }; - - //--Parser UTILS--------------------------------------------------------------------------- - // this functions reads and creates a ShadowMethodMethod - AWDParser.prototype.parseShadowMethodList = function (light, blockID) { - var methodType = this._newBlockBytes.readUnsignedShort(); - var shadowMethod; - var props = this.parseProperties({ 1: AWDParser.BADDR, 2: AWDParser.BADDR, 3: AWDParser.BADDR, 101: this._propsNrType, 102: this._propsNrType, 103: this._propsNrType, 201: AWDParser.UINT32, 202: AWDParser.UINT32, 301: AWDParser.UINT16, 302: AWDParser.UINT16, 401: AWDParser.UINT8, 402: AWDParser.UINT8, 601: AWDParser.COLOR, 602: AWDParser.COLOR, 701: AWDParser.BOOL, 702: AWDParser.BOOL, 801: AWDParser.MTX4x4 }); - - var targetID; - var returnedArray; - switch (methodType) { - case 1002: - targetID = props.get(1, 0); - returnedArray = this.getAssetByID(targetID, [AssetType.SHADOW_MAP_METHOD]); - if (!returnedArray[0]) { - this._blocks[blockID].addError("Could not find the ShadowBaseMethod (ID = " + targetID + " ) for this ShadowNearMethod - ShadowMethod not created"); - return shadowMethod; - } - shadowMethod = new ShadowNearMethod(returnedArray[1]); - break; - case 1101: - shadowMethod = new ShadowFilteredMethod(light); - shadowMethod.alpha = props.get(101, 1); - shadowMethod.epsilon = props.get(102, 0.002); - break; - - case 1102: - shadowMethod = new ShadowDitheredMethod(light, props.get(201, 5)); - shadowMethod.alpha = props.get(101, 1); - shadowMethod.epsilon = props.get(102, 0.002); - shadowMethod.range = props.get(103, 1); - - break; - case 1103: - shadowMethod = new ShadowSoftMethod(light, props.get(201, 5)); - shadowMethod.alpha = props.get(101, 1); - shadowMethod.epsilon = props.get(102, 0.002); - shadowMethod.range = props.get(103, 1); - - break; - case 1104: - shadowMethod = new ShadowHardMethod(light); - shadowMethod.alpha = props.get(101, 1); - shadowMethod.epsilon = props.get(102, 0.002); - break; - } - this.parseUserAttributes(); - return shadowMethod; - }; - - //Block ID 101 - AWDParser.prototype.parseSkeleton = function (blockID /*uint*/ ) { - var name = this.parseVarStr(); - var num_joints = this._newBlockBytes.readUnsignedShort(); - var skeleton = new Skeleton(); - this.parseProperties(null); // Discard properties for now - - var joints_parsed = 0; - while (joints_parsed < num_joints) { - var joint; - var ibp; - - // Ignore joint id - this._newBlockBytes.readUnsignedShort(); - joint = new SkeletonJoint(); - joint.parentIndex = this._newBlockBytes.readUnsignedShort() - 1; // 0=null in AWD - joint.name = this.parseVarStr(); - - ibp = this.parseMatrix3D(); - joint.inverseBindPose = ibp.rawData; - - // Ignore joint props/attributes for now - this.parseProperties(null); - this.parseUserAttributes(); - skeleton.joints.push(joint); - joints_parsed++; - } - - // Discard attributes for now - this.parseUserAttributes(); - this._pFinalizeAsset(skeleton, name); - this._blocks[blockID].data = skeleton; - if (this._debug) - console.log("Parsed a Skeleton: Name = " + skeleton.name + " | Number of Joints = " + joints_parsed); - }; - - //Block ID = 102 - AWDParser.prototype.parseSkeletonPose = function (blockID /*uint*/ ) { - var name = this.parseVarStr(); - var num_joints = this._newBlockBytes.readUnsignedShort(); - this.parseProperties(null); // Ignore properties for now - - var pose = new SkeletonPose(); - - var joints_parsed = 0; - while (joints_parsed < num_joints) { - var joint_pose; - var has_transform; - joint_pose = new JointPose(); - has_transform = this._newBlockBytes.readUnsignedByte(); - if (has_transform == 1) { - var mtx_data = this.parseMatrix43RawData(); - - var mtx = new Matrix3D(mtx_data); - joint_pose.orientation.fromMatrix(mtx); - joint_pose.translation.copyFrom(mtx.position); - - pose.jointPoses[joints_parsed] = joint_pose; - } - joints_parsed++; - } - - // Skip attributes for now - this.parseUserAttributes(); - this._pFinalizeAsset(pose, name); - this._blocks[blockID].data = pose; - if (this._debug) - console.log("Parsed a SkeletonPose: Name = " + pose.name + " | Number of Joints = " + joints_parsed); - }; - - //blockID 103 - AWDParser.prototype.parseSkeletonAnimation = function (blockID /*uint*/ ) { - var frame_dur; - var pose_addr; - var name = this.parseVarStr(); - var clip = new SkeletonClipNode(); - var num_frames = this._newBlockBytes.readUnsignedShort(); - this.parseProperties(null); // Ignore properties for now - - var frames_parsed = 0; - var returnedArray; - while (frames_parsed < num_frames) { - pose_addr = this._newBlockBytes.readUnsignedInt(); - frame_dur = this._newBlockBytes.readUnsignedShort(); - returnedArray = this.getAssetByID(pose_addr, [AssetType.SKELETON_POSE]); - if (!returnedArray[0]) - this._blocks[blockID].addError("Could not find the SkeletonPose Frame # " + frames_parsed + " (ID = " + pose_addr + " ) for this SkeletonClipNode"); - else - clip.addFrame(this._blocks[pose_addr].data, frame_dur); - frames_parsed++; - } - if (clip.frames.length == 0) { - this._blocks[blockID].addError("Could not this SkeletonClipNode, because no Frames where set."); - return; - } - - // Ignore attributes for now - this.parseUserAttributes(); - this._pFinalizeAsset(clip, name); - this._blocks[blockID].data = clip; - if (this._debug) - console.log("Parsed a SkeletonClipNode: Name = " + clip.name + " | Number of Frames = " + clip.frames.length); - }; - - //Block ID = 111 / Block ID = 112 - AWDParser.prototype.parseMeshPoseAnimation = function (blockID /*uint*/ , poseOnly) { - if (typeof poseOnly === "undefined") { poseOnly = false; } - var num_frames = 1; - var num_submeshes; - var frames_parsed; - var subMeshParsed; - var frame_dur; - var x; - var y; - var z; - var str_len; - var str_end; - var geometry; - var subGeom; - var idx = 0; - var clip = new VertexClipNode(); - var indices; - var verts; - var num_Streams = 0; - var streamsParsed = 0; - var streamtypes = new Array(); - var props; - var thisGeo; - var name = this.parseVarStr(); - var geoAdress = this._newBlockBytes.readUnsignedInt(); - var returnedArray = this.getAssetByID(geoAdress, [AssetType.GEOMETRY]); - if (!returnedArray[0]) { - this._blocks[blockID].addError("Could not find the target-Geometry-Object " + geoAdress + " ) for this VertexClipNode"); - return; - } - var uvs = this.getUVForVertexAnimation(geoAdress); - if (!poseOnly) - num_frames = this._newBlockBytes.readUnsignedShort(); - - num_submeshes = this._newBlockBytes.readUnsignedShort(); - num_Streams = this._newBlockBytes.readUnsignedShort(); - streamsParsed = 0; - while (streamsParsed < num_Streams) { - streamtypes.push(this._newBlockBytes.readUnsignedShort()); - streamsParsed++; - } - props = this.parseProperties({ 1: AWDParser.BOOL, 2: AWDParser.BOOL }); - - clip.looping = props.get(1, true); - clip.stitchFinalFrame = props.get(2, false); - - frames_parsed = 0; - while (frames_parsed < num_frames) { - frame_dur = this._newBlockBytes.readUnsignedShort(); - geometry = new Geometry(); - subMeshParsed = 0; - while (subMeshParsed < num_submeshes) { - streamsParsed = 0; - str_len = this._newBlockBytes.readUnsignedInt(); - str_end = this._newBlockBytes.position + str_len; - while (streamsParsed < num_Streams) { - if (streamtypes[streamsParsed] == 1) { - indices = returnedArray[1].subGeometries[subMeshParsed].indices; - verts = new Array(); - idx = 0; - while (this._newBlockBytes.position < str_end) { - x = this.readNumber(this._accuracyGeo); - y = this.readNumber(this._accuracyGeo); - z = this.readNumber(this._accuracyGeo); - verts[idx++] = x; - verts[idx++] = y; - verts[idx++] = z; - } - subGeom = new TriangleSubGeometry(true); - subGeom.updateIndices(indices); - subGeom.updatePositions(verts); - subGeom.updateUVs(uvs[subMeshParsed]); - subGeom.updateVertexNormals(null); - subGeom.updateVertexTangents(null); - subGeom.autoDeriveNormals = false; - subGeom.autoDeriveTangents = false; - subMeshParsed++; - geometry.addSubGeometry(subGeom); - } else - this._newBlockBytes.position = str_end; - streamsParsed++; - } - } - clip.addFrame(geometry, frame_dur); - frames_parsed++; - } - this.parseUserAttributes(); - this._pFinalizeAsset(clip, name); - - this._blocks[blockID].data = clip; - if (this._debug) - console.log("Parsed a VertexClipNode: Name = " + clip.name + " | Target-Geometry-Name = " + returnedArray[1].name + " | Number of Frames = " + clip.frames.length); - }; - - //BlockID 113 - AWDParser.prototype.parseVertexAnimationSet = function (blockID /*uint*/ ) { - var poseBlockAdress; - var outputString = ""; - var name = this.parseVarStr(); - var num_frames = this._newBlockBytes.readUnsignedShort(); - var props = this.parseProperties({ 1: AWDParser.UINT16 }); - var frames_parsed = 0; - var skeletonFrames = new Array(); - var vertexFrames = new Array(); - while (frames_parsed < num_frames) { - poseBlockAdress = this._newBlockBytes.readUnsignedInt(); - var returnedArray = this.getAssetByID(poseBlockAdress, [AssetType.ANIMATION_NODE]); - if (!returnedArray[0]) - this._blocks[blockID].addError("Could not find the AnimationClipNode Nr " + frames_parsed + " ( " + poseBlockAdress + " ) for this AnimationSet"); - else { - if (returnedArray[1] instanceof VertexClipNode) - vertexFrames.push(returnedArray[1]); - if (returnedArray[1] instanceof SkeletonClipNode) - skeletonFrames.push(returnedArray[1]); - } - frames_parsed++; - } - if ((vertexFrames.length == 0) && (skeletonFrames.length == 0)) { - this._blocks[blockID].addError("Could not create this AnimationSet, because it contains no animations"); - return; - } - this.parseUserAttributes(); - if (vertexFrames.length > 0) { - var newVertexAnimationSet = new VertexAnimationSet(); - for (var i = 0; i < vertexFrames.length; i++) - newVertexAnimationSet.addAnimation(vertexFrames[i]); - this._pFinalizeAsset(newVertexAnimationSet, name); - this._blocks[blockID].data = newVertexAnimationSet; - if (this._debug) - console.log("Parsed a VertexAnimationSet: Name = " + name + " | Animations = " + newVertexAnimationSet.animations.length + " | Animation-Names = " + newVertexAnimationSet.animationNames.toString()); - } else if (skeletonFrames.length > 0) { - returnedArray = this.getAssetByID(poseBlockAdress, [AssetType.ANIMATION_NODE]); - var newSkeletonAnimationSet = new SkeletonAnimationSet(props.get(1, 4)); - for (var i = 0; i < skeletonFrames.length; i++) - newSkeletonAnimationSet.addAnimation(skeletonFrames[i]); - this._pFinalizeAsset(newSkeletonAnimationSet, name); - this._blocks[blockID].data = newSkeletonAnimationSet; - if (this._debug) - console.log("Parsed a SkeletonAnimationSet: Name = " + name + " | Animations = " + newSkeletonAnimationSet.animations.length + " | Animation-Names = " + newSkeletonAnimationSet.animationNames.toString()); - } - }; - - //BlockID 122 - AWDParser.prototype.parseAnimatorSet = function (blockID /*uint*/ ) { - var targetMesh; - var animSetBlockAdress; - var targetAnimationSet; - var outputString = ""; - var name = this.parseVarStr(); - var type = this._newBlockBytes.readUnsignedShort(); - - var props = this.parseProperties({ 1: AWDParser.BADDR }); - - animSetBlockAdress = this._newBlockBytes.readUnsignedInt(); - var targetMeshLength = this._newBlockBytes.readUnsignedShort(); - var meshAdresses = new Array(); - for (var i = 0; i < targetMeshLength; i++) - meshAdresses.push(this._newBlockBytes.readUnsignedInt()); - - var activeState = this._newBlockBytes.readUnsignedShort(); - var autoplay = (this._newBlockBytes.readUnsignedByte() == 1); - this.parseUserAttributes(); - this.parseUserAttributes(); - - var returnedArray; - var targetMeshes = new Array(); - - for (i = 0; i < meshAdresses.length; i++) { - returnedArray = this.getAssetByID(meshAdresses[i], [AssetType.MESH]); - if (returnedArray[0]) - targetMeshes.push(returnedArray[1]); - } - returnedArray = this.getAssetByID(animSetBlockAdress, [AssetType.ANIMATION_SET]); - if (!returnedArray[0]) { - this._blocks[blockID].addError("Could not find the AnimationSet ( " + animSetBlockAdress + " ) for this Animator"); - ; - return; - } - targetAnimationSet = returnedArray[1]; - var thisAnimator; - if (type == 1) { - returnedArray = this.getAssetByID(props.get(1, 0), [AssetType.SKELETON]); - if (!returnedArray[0]) { - this._blocks[blockID].addError("Could not find the Skeleton ( " + props.get(1, 0) + " ) for this Animator"); - return; - } - thisAnimator = new SkeletonAnimator(targetAnimationSet, returnedArray[1]); - } else if (type == 2) - thisAnimator = new VertexAnimator(targetAnimationSet); - - this._pFinalizeAsset(thisAnimator, name); - this._blocks[blockID].data = thisAnimator; - for (i = 0; i < targetMeshes.length; i++) { - if (type == 1) - targetMeshes[i].animator = thisAnimator; - if (type == 2) - targetMeshes[i].animator = thisAnimator; - } - if (this._debug) - console.log("Parsed a Animator: Name = " + name); - }; - - // this functions reads and creates a EffectMethod - AWDParser.prototype.parseSharedMethodList = function (blockID) { - var methodType = this._newBlockBytes.readUnsignedShort(); - var effectMethodReturn; - - var props = this.parseProperties({ 1: AWDParser.BADDR, 2: AWDParser.BADDR, 3: AWDParser.BADDR, 101: this._propsNrType, 102: this._propsNrType, 103: this._propsNrType, 104: this._propsNrType, 105: this._propsNrType, 106: this._propsNrType, 107: this._propsNrType, 201: AWDParser.UINT32, 202: AWDParser.UINT32, 301: AWDParser.UINT16, 302: AWDParser.UINT16, 401: AWDParser.UINT8, 402: AWDParser.UINT8, 601: AWDParser.COLOR, 602: AWDParser.COLOR, 701: AWDParser.BOOL, 702: AWDParser.BOOL }); - var targetID; - var returnedArray; - - switch (methodType) { - case 401: - effectMethodReturn = new EffectColorMatrixMethod(props.get(101, new Array(0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1))); - break; - case 402: - effectMethodReturn = new EffectColorTransformMethod(); - var offCol = props.get(601, 0x00000000); - effectMethodReturn.colorTransform = new ColorTransform(props.get(102, 1), props.get(103, 1), props.get(104, 1), props.get(101, 1), ((offCol >> 16) & 0xFF), ((offCol >> 8) & 0xFF), (offCol & 0xFF), ((offCol >> 24) & 0xFF)); - break; - case 403: - targetID = props.get(1, 0); - console.log('ENV MAP', targetID); - - returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE], "CubeTexture"); - if (!returnedArray[0]) - this._blocks[blockID].addError("Could not find the EnvMap (ID = " + targetID + " ) for this EnvMapMethod"); - effectMethodReturn = new EffectEnvMapMethod(returnedArray[1], props.get(101, 1)); - targetID = props.get(2, 0); - if (targetID > 0) { - returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]); - if (!returnedArray[0]) - this._blocks[blockID].addError("Could not find the Mask-texture (ID = " + targetID + " ) for this EnvMapMethod"); - // Todo: test mask with EnvMapMethod - //( effectMethodReturn).mask = returnedArray[1]; - } - break; - case 404: - targetID = props.get(1, 0); - returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]); - if (!returnedArray[0]) - this._blocks[blockID].addError("Could not find the LightMap (ID = " + targetID + " ) for this LightMapMethod"); - effectMethodReturn = new EffectLightMapMethod(returnedArray[1], this.blendModeDic[props.get(401, 10)]); //usesecondaryUV not set - break; - - case 406: - effectMethodReturn = new EffectRimLightMethod(props.get(601, 0xffffff), props.get(101, 0.4), props.get(101, 2)); //blendMode - break; - case 407: - targetID = props.get(1, 0); - returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]); - if (!returnedArray[0]) - this._blocks[blockID].addError("Could not find the Alpha-texture (ID = " + targetID + " ) for this AlphaMaskMethod"); - effectMethodReturn = new EffectAlphaMaskMethod(returnedArray[1], props.get(701, false)); - break; - - case 410: - targetID = props.get(1, 0); - returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE], "CubeTexture"); - if (!returnedArray[0]) - this._blocks[blockID].addError("Could not find the EnvMap (ID = " + targetID + " ) for this FresnelEnvMapMethod"); - effectMethodReturn = new EffectFresnelEnvMapMethod(returnedArray[1], props.get(101, 1)); - break; - case 411: - effectMethodReturn = new EffectFogMethod(props.get(101, 0), props.get(102, 1000), props.get(601, 0x808080)); - break; - } - this.parseUserAttributes(); - return effectMethodReturn; - }; - - AWDParser.prototype.parseUserAttributes = function () { - var attributes; - var list_len; - var attibuteCnt; - - list_len = this._newBlockBytes.readUnsignedInt(); - - if (list_len > 0) { - var list_end; - - attributes = {}; - - list_end = this._newBlockBytes.position + list_len; - - while (this._newBlockBytes.position < list_end) { - var ns_id; - var attr_key; - var attr_type; - var attr_len; - var attr_val; - - // TODO: Properly tend to namespaces in attributes - ns_id = this._newBlockBytes.readUnsignedByte(); - attr_key = this.parseVarStr(); - attr_type = this._newBlockBytes.readUnsignedByte(); - attr_len = this._newBlockBytes.readUnsignedInt(); - - if ((this._newBlockBytes.position + attr_len) > list_end) { - console.log(" Error in reading attribute # " + attibuteCnt + " = skipped to end of attribute-list"); - this._newBlockBytes.position = list_end; - return attributes; - } - - switch (attr_type) { - case AWDParser.AWDSTRING: - attr_val = this._newBlockBytes.readUTFBytes(attr_len); - break; - case AWDParser.INT8: - attr_val = this._newBlockBytes.readByte(); - break; - case AWDParser.INT16: - attr_val = this._newBlockBytes.readShort(); - break; - case AWDParser.INT32: - attr_val = this._newBlockBytes.readInt(); - break; - case AWDParser.BOOL: - case AWDParser.UINT8: - attr_val = this._newBlockBytes.readUnsignedByte(); - break; - case AWDParser.UINT16: - attr_val = this._newBlockBytes.readUnsignedShort(); - break; - case AWDParser.UINT32: - case AWDParser.BADDR: - attr_val = this._newBlockBytes.readUnsignedInt(); - break; - case AWDParser.FLOAT32: - attr_val = this._newBlockBytes.readFloat(); - break; - case AWDParser.FLOAT64: - attr_val = this._newBlockBytes.readDouble(); - break; - default: - attr_val = 'unimplemented attribute type ' + attr_type; - this._newBlockBytes.position += attr_len; - break; - } - - if (this._debug) { - console.log("attribute = name: " + attr_key + " / value = " + attr_val); - } - - attributes[attr_key] = attr_val; - attibuteCnt += 1; - } - } - - return attributes; - }; - - AWDParser.prototype.parseProperties = function (expected) { - var list_end; - var list_len; - var propertyCnt = 0; - var props = new AWDProperties(); - - list_len = this._newBlockBytes.readUnsignedInt(); - list_end = this._newBlockBytes.position + list_len; - - if (expected) { - while (this._newBlockBytes.position < list_end) { - var len; - var key; - var type; - - key = this._newBlockBytes.readUnsignedShort(); - len = this._newBlockBytes.readUnsignedInt(); - - if ((this._newBlockBytes.position + len) > list_end) { - console.log(" Error in reading property # " + propertyCnt + " = skipped to end of propertie-list"); - this._newBlockBytes.position = list_end; - return props; - } - - if (expected.hasOwnProperty(key.toString())) { - type = expected[key]; - props.set(key, this.parseAttrValue(type, len)); - } else { - this._newBlockBytes.position += len; - } - - propertyCnt += 1; - } - } else { - this._newBlockBytes.position = list_end; - } - - return props; - }; - - AWDParser.prototype.parseAttrValue = function (type, len) { - var elem_len; - var read_func; - - switch (type) { - case AWDParser.BOOL: - case AWDParser.INT8: - elem_len = 1; - read_func = this._newBlockBytes.readByte; - break; - - case AWDParser.INT16: - elem_len = 2; - read_func = this._newBlockBytes.readShort; - break; - - case AWDParser.INT32: - elem_len = 4; - read_func = this._newBlockBytes.readInt; - break; - - case AWDParser.UINT8: - elem_len = 1; - read_func = this._newBlockBytes.readUnsignedByte; - break; - - case AWDParser.UINT16: - elem_len = 2; - read_func = this._newBlockBytes.readUnsignedShort; - break; - - case AWDParser.UINT32: - case AWDParser.COLOR: - case AWDParser.BADDR: - elem_len = 4; - read_func = this._newBlockBytes.readUnsignedInt; - break; - - case AWDParser.FLOAT32: - elem_len = 4; - read_func = this._newBlockBytes.readFloat; - break; - - case AWDParser.FLOAT64: - elem_len = 8; - read_func = this._newBlockBytes.readDouble; - break; - - case AWDParser.AWDSTRING: - return this._newBlockBytes.readUTFBytes(len); - - case AWDParser.VECTOR2x1: - case AWDParser.VECTOR3x1: - case AWDParser.VECTOR4x1: - case AWDParser.MTX3x2: - case AWDParser.MTX3x3: - case AWDParser.MTX4x3: - case AWDParser.MTX4x4: - elem_len = 8; - read_func = this._newBlockBytes.readDouble; - break; - } - - if (elem_len < len) { - var list = []; - var num_read = 0; - var num_elems = len / elem_len; - - while (num_read < num_elems) { - list.push(read_func.apply(this._newBlockBytes)); // list.push(read_func()); - num_read++; - } - - return list; - } else { - var val = read_func.apply(this._newBlockBytes); - return val; - } - }; - - AWDParser.prototype.parseHeader = function () { - var flags; - var body_len; - - this._byteData.position = 3; // Skip magic string and parse version - - this._version[0] = this._byteData.readUnsignedByte(); - this._version[1] = this._byteData.readUnsignedByte(); - - flags = this._byteData.readUnsignedShort(); // Parse bit flags - - this._streaming = bitFlags.test(flags, bitFlags.FLAG1); - - if ((this._version[0] == 2) && (this._version[1] == 1)) { - this._accuracyMatrix = bitFlags.test(flags, bitFlags.FLAG2); - this._accuracyGeo = bitFlags.test(flags, bitFlags.FLAG3); - this._accuracyProps = bitFlags.test(flags, bitFlags.FLAG4); - } - - // if we set _accuracyOnBlocks, the precision-values are read from each block-header. - // set storagePrecision types - this._geoNrType = AWDParser.FLOAT32; - - if (this._accuracyGeo) { - this._geoNrType = AWDParser.FLOAT64; - } - - this._matrixNrType = AWDParser.FLOAT32; - - if (this._accuracyMatrix) { - this._matrixNrType = AWDParser.FLOAT64; - } - - this._propsNrType = AWDParser.FLOAT32; - - if (this._accuracyProps) { - this._propsNrType = AWDParser.FLOAT64; - } - - this._compression = this._byteData.readUnsignedByte(); // compression - - if (this._debug) { - console.log("Import AWDFile of version = " + this._version[0] + " - " + this._version[1]); - console.log("Global Settings = Compression = " + this._compression + " | Streaming = " + this._streaming + " | Matrix-Precision = " + this._accuracyMatrix + " | Geometry-Precision = " + this._accuracyGeo + " | Properties-Precision = " + this._accuracyProps); - } - - // Check file integrity - body_len = this._byteData.readUnsignedInt(); - if (!this._streaming && body_len != this._byteData.getBytesAvailable()) { - this._pDieWithError('AWD2 body length does not match header integrity field'); - } - }; - - // Helper - functions - AWDParser.prototype.getUVForVertexAnimation = function (meshID /*uint*/ ) { - if (this._blocks[meshID].data instanceof Mesh) - meshID = this._blocks[meshID].geoID; - if (this._blocks[meshID].uvsForVertexAnimation) - return this._blocks[meshID].uvsForVertexAnimation; - var geometry = this._blocks[meshID].data; - var geoCnt = 0; - var ud; - var uStride; - var uOffs; - var numPoints; - var i; - var newUvs; - var sub_geom; - this._blocks[meshID].uvsForVertexAnimation = new Array(); - while (geoCnt < geometry.subGeometries.length) { - newUvs = new Array(); - sub_geom = geometry.subGeometries[geoCnt]; - numPoints = sub_geom.numVertices; - ud = sub_geom.uvs; - uStride = sub_geom.getStride(TriangleSubGeometry.UV_DATA); - uOffs = sub_geom.getOffset(TriangleSubGeometry.UV_DATA); - for (i = 0; i < numPoints; i++) { - newUvs.push(ud[uOffs + i * uStride + 0]); - newUvs.push(ud[uOffs + i * uStride + 1]); - } - this._blocks[meshID].uvsForVertexAnimation.push(newUvs); - geoCnt++; - } - return this._blocks[meshID].uvsForVertexAnimation; - }; - - AWDParser.prototype.parseVarStr = function () { - var len = this._newBlockBytes.readUnsignedShort(); - return this._newBlockBytes.readUTFBytes(len); - }; - - AWDParser.prototype.getAssetByID = function (assetID, assetTypesToGet, extraTypeInfo) { - if (typeof extraTypeInfo === "undefined") { extraTypeInfo = "SingleTexture"; } - var returnArray = new Array(); - var typeCnt = 0; - if (assetID > 0) { - if (this._blocks[assetID]) { - if (this._blocks[assetID].data) { - while (typeCnt < assetTypesToGet.length) { - var iasset = this._blocks[assetID].data; - - if (iasset.assetType == assetTypesToGet[typeCnt]) { - //if the right assetType was found - if ((assetTypesToGet[typeCnt] == AssetType.TEXTURE) && (extraTypeInfo == "CubeTexture")) { - if (this._blocks[assetID].data instanceof ImageCubeTexture) { - returnArray.push(true); - returnArray.push(this._blocks[assetID].data); - return returnArray; - } - } - if ((assetTypesToGet[typeCnt] == AssetType.TEXTURE) && (extraTypeInfo == "SingleTexture")) { - if (this._blocks[assetID].data instanceof ImageTexture) { - returnArray.push(true); - returnArray.push(this._blocks[assetID].data); - return returnArray; - } - } else { - returnArray.push(true); - returnArray.push(this._blocks[assetID].data); - return returnArray; - } - } - - //if ((assetTypesToGet[typeCnt] == AssetType.GEOMETRY) && (IAsset(_blocks[assetID].data).assetType == AssetType.MESH)) { - if ((assetTypesToGet[typeCnt] == AssetType.GEOMETRY) && (iasset.assetType == AssetType.MESH)) { - var mesh = this._blocks[assetID].data; - - returnArray.push(true); - returnArray.push(mesh.geometry); - return returnArray; - } - - typeCnt++; - } - } - } - } - - // if the has not returned anything yet, the asset is not found, or the found asset is not the right type. - returnArray.push(false); - returnArray.push(this.getDefaultAsset(assetTypesToGet[0], extraTypeInfo)); - return returnArray; - }; - - AWDParser.prototype.getDefaultAsset = function (assetType, extraTypeInfo) { - switch (true) { - case (assetType == AssetType.TEXTURE): - if (extraTypeInfo == "CubeTexture") - return this.getDefaultCubeTexture(); - if (extraTypeInfo == "SingleTexture") - return this.getDefaultTexture(); - break; - case (assetType == AssetType.MATERIAL): - return this.getDefaultMaterial(); - break; - default: - break; - } - - return null; - }; - - AWDParser.prototype.getDefaultMaterial = function () { - if (!this._defaultBitmapMaterial) - this._defaultBitmapMaterial = DefaultMaterialManager.getDefaultMaterial(); - - return this._defaultBitmapMaterial; - }; - - AWDParser.prototype.getDefaultTexture = function () { - if (!this._defaultTexture) - this._defaultTexture = DefaultMaterialManager.getDefaultTexture(); - - return this._defaultTexture; - }; - - AWDParser.prototype.getDefaultCubeTexture = function () { - if (!this._defaultCubeTexture) { - var defaultBitmap = DefaultMaterialManager.createCheckeredBitmapData(); - - this._defaultCubeTexture = new BitmapCubeTexture(defaultBitmap, defaultBitmap, defaultBitmap, defaultBitmap, defaultBitmap, defaultBitmap); - this._defaultCubeTexture.name = "defaultCubeTexture"; - } - - return this._defaultCubeTexture; - }; - - AWDParser.prototype.readNumber = function (precision) { - if (typeof precision === "undefined") { precision = false; } - if (precision) - return this._newBlockBytes.readDouble(); - return this._newBlockBytes.readFloat(); - }; - - AWDParser.prototype.parseMatrix3D = function () { - return new Matrix3D(this.parseMatrix43RawData()); - }; - - AWDParser.prototype.parseMatrix32RawData = function () { - var i; - var mtx_raw = new Array(6); - for (i = 0; i < 6; i++) { - mtx_raw[i] = this._newBlockBytes.readFloat(); - } - - return mtx_raw; - }; - - AWDParser.prototype.parseMatrix43RawData = function () { - var mtx_raw = new Array(16); - - mtx_raw[0] = this.readNumber(this._accuracyMatrix); - mtx_raw[1] = this.readNumber(this._accuracyMatrix); - mtx_raw[2] = this.readNumber(this._accuracyMatrix); - mtx_raw[3] = 0.0; - mtx_raw[4] = this.readNumber(this._accuracyMatrix); - mtx_raw[5] = this.readNumber(this._accuracyMatrix); - mtx_raw[6] = this.readNumber(this._accuracyMatrix); - mtx_raw[7] = 0.0; - mtx_raw[8] = this.readNumber(this._accuracyMatrix); - mtx_raw[9] = this.readNumber(this._accuracyMatrix); - mtx_raw[10] = this.readNumber(this._accuracyMatrix); - mtx_raw[11] = 0.0; - mtx_raw[12] = this.readNumber(this._accuracyMatrix); - mtx_raw[13] = this.readNumber(this._accuracyMatrix); - mtx_raw[14] = this.readNumber(this._accuracyMatrix); - mtx_raw[15] = 1.0; - - //TODO: fix max exporter to remove NaN values in joint 0 inverse bind pose - if (isNaN(mtx_raw[0])) { - mtx_raw[0] = 1; - mtx_raw[1] = 0; - mtx_raw[2] = 0; - mtx_raw[4] = 0; - mtx_raw[5] = 1; - mtx_raw[6] = 0; - mtx_raw[8] = 0; - mtx_raw[9] = 0; - mtx_raw[10] = 1; - mtx_raw[12] = 0; - mtx_raw[13] = 0; - mtx_raw[14] = 0; - } - - return mtx_raw; - }; - AWDParser.COMPRESSIONMODE_LZMA = "lzma"; - AWDParser.UNCOMPRESSED = 0; - AWDParser.DEFLATE = 1; - AWDParser.LZMA = 2; - AWDParser.INT8 = 1; - AWDParser.INT16 = 2; - AWDParser.INT32 = 3; - AWDParser.UINT8 = 4; - AWDParser.UINT16 = 5; - AWDParser.UINT32 = 6; - AWDParser.FLOAT32 = 7; - AWDParser.FLOAT64 = 8; - AWDParser.BOOL = 21; - AWDParser.COLOR = 22; - AWDParser.BADDR = 23; - AWDParser.AWDSTRING = 31; - AWDParser.AWDBYTEARRAY = 32; - AWDParser.VECTOR2x1 = 41; - AWDParser.VECTOR3x1 = 42; - AWDParser.VECTOR4x1 = 43; - AWDParser.MTX3x2 = 44; - AWDParser.MTX3x3 = 45; - AWDParser.MTX4x3 = 46; - AWDParser.MTX4x4 = 47; - return AWDParser; - })(away.parsers.ParserBase); - parsers.AWDParser = AWDParser; - })(away.parsers || (away.parsers = {})); - var parsers = away.parsers; -})(away || (away = {})); - -var AWDBlock = (function () { - function AWDBlock() { - } - AWDBlock.prototype.dispose = function () { - this.id = null; - this.bytes = null; - this.errorMessages = null; - this.uvsForVertexAnimation = null; - }; - - AWDBlock.prototype.addError = function (errorMsg) { - if (!this.errorMessages) - this.errorMessages = new Array(); - this.errorMessages.push(errorMsg); - }; - return AWDBlock; -})(); - -var bitFlags = (function () { - function bitFlags() { - } - bitFlags.test = function (flags, testFlag) { - return (flags & testFlag) == testFlag; - }; - bitFlags.FLAG1 = 1; - bitFlags.FLAG2 = 2; - bitFlags.FLAG3 = 4; - bitFlags.FLAG4 = 8; - bitFlags.FLAG5 = 16; - bitFlags.FLAG6 = 32; - bitFlags.FLAG7 = 64; - bitFlags.FLAG8 = 128; - bitFlags.FLAG9 = 256; - bitFlags.FLAG10 = 512; - bitFlags.FLAG11 = 1024; - bitFlags.FLAG12 = 2048; - bitFlags.FLAG13 = 4096; - bitFlags.FLAG14 = 8192; - bitFlags.FLAG15 = 16384; - bitFlags.FLAG16 = 32768; - return bitFlags; -})(); - -var AWDProperties = (function () { - function AWDProperties() { - } - AWDProperties.prototype.set = function (key, value) { - this[key.toString()] = value; - }; - - AWDProperties.prototype.get = function (key, fallback) { - if (this.hasOwnProperty(key.toString())) { - return this[key.toString()]; - } else { - return fallback; - } - }; - return AWDProperties; -})(); -/// -var away; -(function (away) { - (function (parsers) { - var SubGeometry = away.base.TriangleSubGeometry; - var DefaultMaterialManager = away.materials.DefaultMaterialManager; - var TriangleMethodMaterial = away.materials.TriangleMethodMaterial; - var TriangleMaterialMode = away.materials.TriangleMaterialMode; - var URLLoaderDataFormat = away.net.URLLoaderDataFormat; - - /** - * Max3DSParser provides a parser for the 3ds data type. - */ - var Max3DSParser = (function (_super) { - __extends(Max3DSParser, _super); - /** - * Creates a new Max3DSParser object. - * - * @param useSmoothingGroups Determines whether the parser looks for smoothing groups in the 3ds file or assumes uniform smoothing. Defaults to true. - */ - function Max3DSParser(useSmoothingGroups) { - if (typeof useSmoothingGroups === "undefined") { useSmoothingGroups = true; } - _super.call(this, URLLoaderDataFormat.ARRAY_BUFFER); - - this._useSmoothingGroups = useSmoothingGroups; - } - /** - * Indicates whether or not a given file extension is supported by the parser. - * @param extension The file extension of a potential file to be parsed. - * @return Whether or not the given file type is supported. - */ - Max3DSParser.supportsType = function (extension) { - extension = extension.toLowerCase(); - return extension == "3ds"; - }; - - /** - * Tests whether a data block can be parsed by the parser. - * @param data The data block to potentially be parsed. - * @return Whether or not the given data is supported. - */ - Max3DSParser.supportsData = function (data) { - var ba; - - ba = parsers.ParserUtils.toByteArray(data); - if (ba) { - ba.position = 0; - if (ba.readShort() == 0x4d4d) - return true; - } - - return false; - }; - - /** - * @inheritDoc - */ - Max3DSParser.prototype._iResolveDependency = function (resourceDependency) { - if (resourceDependency.assets.length == 1) { - var asset; - - asset = resourceDependency.assets[0]; - if (asset.assetType == away.library.AssetType.TEXTURE) { - var tex; - - tex = this._textures[resourceDependency.id]; - tex.texture = asset; - } - } - }; - - /** - * @inheritDoc - */ - Max3DSParser.prototype._iResolveDependencyFailure = function (resourceDependency) { - // TODO: Implement - }; - - /** - * @inheritDoc - */ - Max3DSParser.prototype._pProceedParsing = function () { - if (!this._byteData) { - this._byteData = this._pGetByteData(); - this._byteData.position = 0; - - //---------------------------------------------------------------------------- - // LITTLE_ENDIAN - Default for ArrayBuffer / Not implemented in ByteArray - //---------------------------------------------------------------------------- - //this._byteData.endian = Endian.LITTLE_ENDIAN;// Should be default - //---------------------------------------------------------------------------- - this._textures = {}; - this._materials = {}; - this._unfinalized_objects = {}; - } - - while (this._pHasTime()) { - // If we are currently working on an object, and the most recent chunk was - // the last one in that object, finalize the current object. - if (this._cur_mat && this._byteData.position >= this._cur_mat_end) - this.finalizeCurrentMaterial(); - else if (this._cur_obj && this._byteData.position >= this._cur_obj_end) { - // Can't finalize at this point, because we have to wait until the full - // animation section has been parsed for any potential pivot definitions - this._unfinalized_objects[this._cur_obj.name] = this._cur_obj; - this._cur_obj_end = Number.MAX_VALUE; - this._cur_obj = null; - } - - if (this._byteData.getBytesAvailable() > 0) { - var cid; - var len; - var end; - - cid = this._byteData.readUnsignedShort(); - len = this._byteData.readUnsignedInt(); - end = this._byteData.position + (len - 6); - - switch (cid) { - case 0x4D4D: - case 0x3D3D: - case 0xB000: - continue; - break; - - case 0xAFFF: - this._cur_mat_end = end; - this._cur_mat = this.parseMaterial(); - break; - - case 0x4000: - this._cur_obj_end = end; - this._cur_obj = new ObjectVO(); - this._cur_obj.name = this.readNulTermstring(); - this._cur_obj.materials = new Array(); - this._cur_obj.materialFaces = {}; - break; - - case 0x4100: - this._cur_obj.type = away.library.AssetType.MESH; - break; - - case 0x4110: - this.parseVertexList(); - break; - - case 0x4120: - this.parseFaceList(); - break; - - case 0x4140: - this.parseUVList(); - break; - - case 0x4130: - this.parseFaceMaterialList(); - break; - - case 0x4160: - this._cur_obj.transform = this.readTransform(); - break; - - case 0xB002: - this.parseObjectAnimation(end); - break; - - case 0x4150: - this.parseSmoothingGroups(); - break; - - default: - // Skip this (unknown) chunk - this._byteData.position += (len - 6); - break; - } - - // Pause parsing if there were any dependencies found during this - // iteration (i.e. if there are any dependencies that need to be - // retrieved at this time.) - if (this.dependencies.length) { - this._pPauseAndRetrieveDependencies(); - break; - } - } - } - - // More parsing is required if the entire byte array has not yet - // been read, or if there is a currently non-finalized object in - // the pipeline. - if (this._byteData.getBytesAvailable() || this._cur_obj || this._cur_mat) { - return parsers.ParserBase.MORE_TO_PARSE; - } else { - var name; - - for (name in this._unfinalized_objects) { - var obj; - obj = this.constructObject(this._unfinalized_objects[name]); - if (obj) { - //add to the content property - this._pContent.addChild(obj); - - this._pFinalizeAsset(obj, name); - } - } - - return parsers.ParserBase.PARSING_DONE; - } - }; - - Max3DSParser.prototype._pStartParsing = function (frameLimit) { - _super.prototype._pStartParsing.call(this, frameLimit); - - //create a content object for Loaders - this._pContent = new away.containers.DisplayObjectContainer(); - }; - - Max3DSParser.prototype.parseMaterial = function () { - var mat; - - mat = new MaterialVO(); - - while (this._byteData.position < this._cur_mat_end) { - var cid; - var len; - var end; - - cid = this._byteData.readUnsignedShort(); - len = this._byteData.readUnsignedInt(); - end = this._byteData.position + (len - 6); - - switch (cid) { - case 0xA000: - mat.name = this.readNulTermstring(); - break; - - case 0xA010: - mat.ambientColor = this.readColor(); - break; - - case 0xA020: - mat.diffuseColor = this.readColor(); - break; - - case 0xA030: - mat.specularColor = this.readColor(); - break; - - case 0xA081: - mat.twoSided = true; - break; - - case 0xA200: - mat.colorMap = this.parseTexture(end); - break; - - case 0xA204: - mat.specularMap = this.parseTexture(end); - break; - - default: - this._byteData.position = end; - break; - } - } - - return mat; - }; - - Max3DSParser.prototype.parseTexture = function (end /*uint*/ ) { - var tex; - - tex = new TextureVO(); - - while (this._byteData.position < end) { - var cid; - var len; - - cid = this._byteData.readUnsignedShort(); - len = this._byteData.readUnsignedInt(); - - switch (cid) { - case 0xA300: - tex.url = this.readNulTermstring(); - break; - - default: - // Skip this unknown texture sub-chunk - this._byteData.position += (len - 6); - break; - } - } - - this._textures[tex.url] = tex; - this._pAddDependency(tex.url, new away.net.URLRequest(tex.url)); - - return tex; - }; - - Max3DSParser.prototype.parseVertexList = function () { - var i; - var len; - var count; - - count = this._byteData.readUnsignedShort(); - this._cur_obj.verts = new Array(count * 3); - - i = 0; - len = this._cur_obj.verts.length; - while (i < len) { - var x, y, z; - - x = this._byteData.readFloat(); - y = this._byteData.readFloat(); - z = this._byteData.readFloat(); - - this._cur_obj.verts[i++] = x; - this._cur_obj.verts[i++] = z; - this._cur_obj.verts[i++] = y; - } - }; - - Max3DSParser.prototype.parseFaceList = function () { - var i; - var len; - var count; - - count = this._byteData.readUnsignedShort(); - this._cur_obj.indices = new Array(count * 3); - - i = 0; - len = this._cur_obj.indices.length; - while (i < len) { - var i0, i1, i2; - - i0 = this._byteData.readUnsignedShort(); - i1 = this._byteData.readUnsignedShort(); - i2 = this._byteData.readUnsignedShort(); - - this._cur_obj.indices[i++] = i0; - this._cur_obj.indices[i++] = i2; - this._cur_obj.indices[i++] = i1; - - // Skip "face info", irrelevant in Away3D - this._byteData.position += 2; - } - - this._cur_obj.smoothingGroups = new Array(count); - }; - - Max3DSParser.prototype.parseSmoothingGroups = function () { - var len = this._cur_obj.indices.length / 3; - var i = 0; - while (i < len) { - this._cur_obj.smoothingGroups[i] = this._byteData.readUnsignedInt(); - i++; - } - }; - - Max3DSParser.prototype.parseUVList = function () { - var i; - var len; - var count; - - count = this._byteData.readUnsignedShort(); - this._cur_obj.uvs = new Array(count * 2); - - i = 0; - len = this._cur_obj.uvs.length; - while (i < len) { - this._cur_obj.uvs[i++] = this._byteData.readFloat(); - this._cur_obj.uvs[i++] = 1.0 - this._byteData.readFloat(); - } - }; - - Max3DSParser.prototype.parseFaceMaterialList = function () { - var mat; - var count; - var i; - var faces; - - mat = this.readNulTermstring(); - count = this._byteData.readUnsignedShort(); - - faces = new Array(count); - i = 0; - while (i < faces.length) - faces[i++] = this._byteData.readUnsignedShort(); - - this._cur_obj.materials.push(mat); - this._cur_obj.materialFaces[mat] = faces; - }; - - Max3DSParser.prototype.parseObjectAnimation = function (end) { - var vo; - var obj; - var pivot; - var name; - var hier; - - // Pivot defaults to origin - pivot = new away.geom.Vector3D; - - while (this._byteData.position < end) { - var cid; - var len; - - cid = this._byteData.readUnsignedShort(); - len = this._byteData.readUnsignedInt(); - - switch (cid) { - case 0xb010: - name = this.readNulTermstring(); - this._byteData.position += 4; - hier = this._byteData.readShort(); - break; - - case 0xb013: - pivot.x = this._byteData.readFloat(); - pivot.z = this._byteData.readFloat(); - pivot.y = this._byteData.readFloat(); - break; - - default: - this._byteData.position += (len - 6); - break; - } - } - - // If name is "$$$DUMMY" this is an empty object (e.g. a container) - // and will be ignored in this version of the parser - // TODO: Implement containers in 3DS parser. - if (name != '$$$DUMMY' && this._unfinalized_objects.hasOwnProperty(name)) { - vo = this._unfinalized_objects[name]; - obj = this.constructObject(vo, pivot); - - if (obj) { - //add to the content property - this._pContent.addChild(obj); - - this._pFinalizeAsset(obj, vo.name); - } - - delete this._unfinalized_objects[name]; - } - }; - - Max3DSParser.prototype.constructObject = function (obj, pivot) { - if (typeof pivot === "undefined") { pivot = null; } - if (obj.type == away.library.AssetType.MESH) { - var i; - var sub; - var geom; - var mat; - var mesh; - var mtx; - var vertices; - var faces; - - if (obj.materials.length > 1) - console.log("The Away3D 3DS parser does not support multiple materials per mesh at this point."); - - // Ignore empty objects - if (!obj.indices || obj.indices.length == 0) - return null; - - vertices = new Array(obj.verts.length / 3); - faces = new Array(obj.indices.length / 3); - - this.prepareData(vertices, faces, obj); - - if (this._useSmoothingGroups) - this.applySmoothGroups(vertices, faces); - - obj.verts = new Array(vertices.length * 3); - for (i = 0; i < vertices.length; i++) { - obj.verts[i * 3] = vertices[i].x; - obj.verts[i * 3 + 1] = vertices[i].y; - obj.verts[i * 3 + 2] = vertices[i].z; - } - obj.indices = new Array(faces.length * 3); - - for (i = 0; i < faces.length; i++) { - obj.indices[i * 3] = faces[i].a; - obj.indices[i * 3 + 1] = faces[i].b; - obj.indices[i * 3 + 2] = faces[i].c; - } - - if (obj.uvs) { - // If the object had UVs to start with, use UVs generated by - // smoothing group splitting algorithm. Otherwise those UVs - // will be nonsense and should be skipped. - obj.uvs = new Array(vertices.length * 2); - for (i = 0; i < vertices.length; i++) { - obj.uvs[i * 2] = vertices[i].u; - obj.uvs[i * 2 + 1] = vertices[i].v; - } - } - - geom = new away.base.Geometry(); - - // Construct sub-geometries (potentially splitting buffers) - // and add them to geometry. - sub = new SubGeometry(true); - sub.updateIndices(obj.indices); - sub.updatePositions(obj.verts); - sub.updateUVs(obj.uvs); - - geom.addSubGeometry(sub); - - if (obj.materials.length > 0) { - var mname; - mname = obj.materials[0]; - mat = this._materials[mname].material; - } - - // Apply pivot translation to geometry if a pivot was - // found while parsing the keyframe chunk earlier. - if (pivot) { - if (obj.transform) { - // If a transform was found while parsing the - // object chunk, use it to find the local pivot vector - var dat = obj.transform.concat(); - dat[12] = 0; - dat[13] = 0; - dat[14] = 0; - mtx = new away.geom.Matrix3D(dat); - pivot = mtx.transformVector(pivot); - } - - pivot.scaleBy(-1); - - mtx = new away.geom.Matrix3D(); - mtx.appendTranslation(pivot.x, pivot.y, pivot.z); - geom.applyTransformation(mtx); - } - - // Apply transformation to geometry if a transformation - // was found while parsing the object chunk earlier. - if (obj.transform) { - mtx = new away.geom.Matrix3D(obj.transform); - mtx.invert(); - geom.applyTransformation(mtx); - } - - // Final transform applied to geometry. Finalize the geometry, - // which will no longer be modified after this point. - this._pFinalizeAsset(geom, obj.name.concat('_geom')); - - // Build mesh and return it - mesh = new away.entities.Mesh(geom, mat); - mesh.transform.matrix3D = new away.geom.Matrix3D(obj.transform); - return mesh; - } - - // If reached, unknown - return null; - }; - - Max3DSParser.prototype.prepareData = function (vertices, faces, obj) { - // convert raw ObjectVO's data to structured VertexVO and FaceVO - var i; - var j; - var k; - var len = obj.verts.length; - for (i = 0, j = 0, k = 0; i < len;) { - var v = new VertexVO; - v.x = obj.verts[i++]; - v.y = obj.verts[i++]; - v.z = obj.verts[i++]; - if (obj.uvs) { - v.u = obj.uvs[j++]; - v.v = obj.uvs[j++]; - } - vertices[k++] = v; - } - len = obj.indices.length; - for (i = 0, k = 0; i < len;) { - var f = new FaceVO(); - f.a = obj.indices[i++]; - f.b = obj.indices[i++]; - f.c = obj.indices[i++]; - f.smoothGroup = obj.smoothingGroups[k] || 0; - faces[k++] = f; - } - }; - - Max3DSParser.prototype.applySmoothGroups = function (vertices, faces) { - // clone vertices according to following rule: - // clone if vertex's in faces from groups 1+2 and 3 - // don't clone if vertex's in faces from groups 1+2, 3 and 1+3 - var i; - var j; - var k; - var l; - var len; - var numVerts = vertices.length; - var numFaces = faces.length; - - // extract groups data for vertices - var vGroups = new Array(numVerts); - for (i = 0; i < numVerts; i++) - vGroups[i] = new Array(); - for (i = 0; i < numFaces; i++) { - var face = faces[i]; - for (j = 0; j < 3; j++) { - var groups = vGroups[(j == 0) ? face.a : ((j == 1) ? face.b : face.c)]; - var group = face.smoothGroup; - for (k = groups.length - 1; k >= 0; k--) { - if ((group & groups[k]) > 0) { - group |= groups[k]; - groups.splice(k, 1); - k = groups.length - 1; - } - } - groups.push(group); - } - } - - // clone vertices - var vClones = new Array(numVerts); - for (i = 0; i < numVerts; i++) { - if ((len = vGroups[i].length) < 1) - continue; - var clones = new Array(len); - vClones[i] = clones; - clones[0] = i; - var v0 = vertices[i]; - for (j = 1; j < len; j++) { - var v1 = new VertexVO; - v1.x = v0.x; - v1.y = v0.y; - v1.z = v0.z; - v1.u = v0.u; - v1.v = v0.v; - clones[j] = vertices.length; - vertices.push(v1); - } - } - numVerts = vertices.length; - - for (i = 0; i < numFaces; i++) { - face = faces[i]; - group = face.smoothGroup; - for (j = 0; j < 3; j++) { - k = (j == 0) ? face.a : ((j == 1) ? face.b : face.c); - groups = vGroups[k]; - len = groups.length; - clones = vClones[k]; - for (l = 0; l < len; l++) { - if (((group == 0) && (groups[l] == 0)) || ((group & groups[l]) > 0)) { - var index = clones[l]; - if (group == 0) { - // vertex is unique if no smoothGroup found - groups.splice(l, 1); - clones.splice(l, 1); - } - if (j == 0) - face.a = index; - else if (j == 1) - face.b = index; - else - face.c = index; - l = len; - } - } - } - } - }; - - Max3DSParser.prototype.finalizeCurrentMaterial = function () { - var mat; - - if (this._cur_mat.colorMap) - mat = new TriangleMethodMaterial(this._cur_mat.colorMap.texture || DefaultMaterialManager.getDefaultTexture()); - else - mat = new TriangleMethodMaterial(this._cur_mat.ambientColor); - - mat.diffuseColor = this._cur_mat.diffuseColor; - mat.specularColor = this._cur_mat.specularColor; - - if (this.materialMode >= 2) - mat.materialMode = TriangleMaterialMode.MULTI_PASS; - - mat.bothSides = this._cur_mat.twoSided; - - this._pFinalizeAsset(mat, this._cur_mat.name); - - this._materials[this._cur_mat.name] = this._cur_mat; - this._cur_mat.material = mat; - - this._cur_mat = null; - }; - - Max3DSParser.prototype.readNulTermstring = function () { - var chr; - var str = ""; - - while ((chr = this._byteData.readUnsignedByte()) > 0) - str += String.fromCharCode(chr); - - return str; - }; - - Max3DSParser.prototype.readTransform = function () { - var data; - - data = new Array(16); - - // X axis - data[0] = this._byteData.readFloat(); // X - data[2] = this._byteData.readFloat(); // Z - data[1] = this._byteData.readFloat(); // Y - data[3] = 0; - - // Z axis - data[8] = this._byteData.readFloat(); // X - data[10] = this._byteData.readFloat(); // Z - data[9] = this._byteData.readFloat(); // Y - data[11] = 0; - - // Y Axis - data[4] = this._byteData.readFloat(); // X - data[6] = this._byteData.readFloat(); // Z - data[5] = this._byteData.readFloat(); // Y - data[7] = 0; - - // Translation - data[12] = this._byteData.readFloat(); // X - data[14] = this._byteData.readFloat(); // Z - data[13] = this._byteData.readFloat(); // Y - data[15] = 1; - - return data; - }; - - Max3DSParser.prototype.readColor = function () { - var cid; - var len; - var r, g, b; - - cid = this._byteData.readUnsignedShort(); - len = this._byteData.readUnsignedInt(); - - switch (cid) { - case 0x0010: - r = this._byteData.readFloat() * 255; - g = this._byteData.readFloat() * 255; - b = this._byteData.readFloat() * 255; - break; - case 0x0011: - r = this._byteData.readUnsignedByte(); - g = this._byteData.readUnsignedByte(); - b = this._byteData.readUnsignedByte(); - break; - default: - this._byteData.position += (len - 6); - break; - } - - return (r << 16) | (g << 8) | b; - }; - return Max3DSParser; - })(parsers.ParserBase); - parsers.Max3DSParser = Max3DSParser; - })(away.parsers || (away.parsers = {})); - var parsers = away.parsers; -})(away || (away = {})); - -var Vector3D = away.geom.Vector3D; - -var TextureVO = (function () { - function TextureVO() { - } - return TextureVO; -})(); - -var MaterialVO = (function () { - function MaterialVO() { - } - return MaterialVO; -})(); - -var ObjectVO = (function () { - function ObjectVO() { - } - return ObjectVO; -})(); - -var VertexVO = (function () { - function VertexVO() { - } - return VertexVO; -})(); - -var FaceVO = (function () { - function FaceVO() { - } - return FaceVO; -})(); -/// -var away; -(function (away) { - (function (parsers) { - var Geometry = away.base.Geometry; - var TriangleSubGeometry = away.base.TriangleSubGeometry; - var VertexAnimationSet = away.animators.VertexAnimationSet; - var VertexClipNode = away.animators.VertexClipNode; - var DefaultMaterialManager = away.materials.DefaultMaterialManager; - var TriangleMethodMaterial = away.materials.TriangleMethodMaterial; - var TriangleMaterialMode = away.materials.TriangleMaterialMode; - var URLLoaderDataFormat = away.net.URLLoaderDataFormat; - - /** - * MD2Parser provides a parser for the MD2 data type. - */ - var MD2Parser = (function (_super) { - __extends(MD2Parser, _super); - /** - * Creates a new MD2Parser object. - * @param textureType The extension of the texture (e.g. jpg/png/...) - * @param ignoreTexturePath If true, the path of the texture is ignored - */ - function MD2Parser(textureType, ignoreTexturePath) { - if (typeof textureType === "undefined") { textureType = "jpg"; } - if (typeof ignoreTexturePath === "undefined") { ignoreTexturePath = true; } - _super.call(this, URLLoaderDataFormat.ARRAY_BUFFER); - this._clipNodes = new Object(); - // the current subgeom being built - this._animationSet = new VertexAnimationSet(); - this.materialFinal = false; - this.geoCreated = false; - this._textureType = textureType; - this._ignoreTexturePath = ignoreTexturePath; - } - /** - * Indicates whether or not a given file extension is supported by the parser. - * @param extension The file extension of a potential file to be parsed. - * @return Whether or not the given file type is supported. - */ - MD2Parser.supportsType = function (extension) { - extension = extension.toLowerCase(); - return extension == "md2"; - }; - - /** - * Tests whether a data block can be parsed by the parser. - * @param data The data block to potentially be parsed. - * @return Whether or not the given data is supported. - */ - MD2Parser.supportsData = function (data) { - return (parsers.ParserUtils.toString(data, 4) == 'IDP2'); - }; - - /** - * @inheritDoc - */ - MD2Parser.prototype._iResolveDependency = function (resourceDependency) { - if (resourceDependency.assets.length != 1) - return; - - var asset = resourceDependency.assets[0]; - - if (asset) { - var material = new TriangleMethodMaterial(asset); - - if (this.materialMode >= 2) - material.materialMode = TriangleMaterialMode.MULTI_PASS; - - //add to the content property - this._pContent.addChild(this._mesh); - - material.name = this._mesh.material.name; - this._mesh.material = material; - this._pFinalizeAsset(material); - this._pFinalizeAsset(this._mesh.geometry); - this._pFinalizeAsset(this._mesh); - } - this.materialFinal = true; - }; - - /** - * @inheritDoc - */ - MD2Parser.prototype._iResolveDependencyFailure = function (resourceDependency) { - // apply system default - if (this.materialMode < 2) { - this._mesh.material = DefaultMaterialManager.getDefaultMaterial(); - } else { - this._mesh.material = new TriangleMethodMaterial(away.materials.DefaultMaterialManager.getDefaultTexture()); - this._mesh.material.materialMode = TriangleMaterialMode.MULTI_PASS; - } - - //add to the content property - this._pContent.addChild(this._mesh); - - this._pFinalizeAsset(this._mesh.geometry); - this._pFinalizeAsset(this._mesh); - this.materialFinal = true; - }; - - /** - * @inheritDoc - */ - MD2Parser.prototype._pProceedParsing = function () { - if (!this._startedParsing) { - this._byteData = this._pGetByteData(); - this._startedParsing = true; - - // Reset bytearray read position (which may have been - // moved forward by the supportsData() function.) - this._byteData.position = 0; - } - - while (this._pHasTime()) { - if (!this._parsedHeader) { - //---------------------------------------------------------------------------- - // LITTLE_ENDIAN - Default for ArrayBuffer / Not implemented in ByteArray - //---------------------------------------------------------------------------- - //this._byteData.endian = Endian.LITTLE_ENDIAN; - // TODO: Create a mesh only when encountered (if it makes sense - // for this file format) and return it using this._pFinalizeAsset() - this._geometry = new Geometry(); - this._mesh = new away.entities.Mesh(this._geometry, null); - if (this.materialMode < 2) { - this._mesh.material = DefaultMaterialManager.getDefaultMaterial(); - } else { - this._mesh.material = new TriangleMethodMaterial(DefaultMaterialManager.getDefaultTexture()); - this._mesh.material.materialMode = TriangleMaterialMode.MULTI_PASS; - } - - //_geometry.animation = new VertexAnimation(2, VertexAnimationMode.ABSOLUTE); - //_animator = new VertexAnimator(VertexAnimationState(_mesh.animationState)); - // Parse header and decompress body - this.parseHeader(); - this.parseMaterialNames(); - } else if (!this._parsedUV) { - this.parseUV(); - } else if (!this._parsedFaces) { - this.parseFaces(); - } else if (!this._parsedFrames) { - this.parseFrames(); - } else if ((this.geoCreated) && (this.materialFinal)) { - return away.parsers.ParserBase.PARSING_DONE; - } else if (!this.geoCreated) { - this.geoCreated = true; - - //create default subgeometry - this._geometry.addSubGeometry(this._firstSubGeom.clone()); - - // Force name to be chosen by this._pFinalizeAsset() - this._mesh.name = ""; - if (this.materialFinal) { - //add to the content property - this._pContent.addChild(this._mesh); - - this._pFinalizeAsset(this._mesh.geometry); - this._pFinalizeAsset(this._mesh); - } - - this._pPauseAndRetrieveDependencies(); - } - } - - return away.parsers.ParserBase.MORE_TO_PARSE; - }; - - MD2Parser.prototype._pStartParsing = function (frameLimit) { - _super.prototype._pStartParsing.call(this, frameLimit); - - //create a content object for Loaders - this._pContent = new away.containers.DisplayObjectContainer(); - }; - - /** - * Reads in all that MD2 Header data that is declared as private variables. - * I know its a lot, and it looks ugly, but only way to do it in Flash - */ - MD2Parser.prototype.parseHeader = function () { - this._ident = this._byteData.readInt(); - this._version = this._byteData.readInt(); - this._skinWidth = this._byteData.readInt(); - this._skinHeight = this._byteData.readInt(); - - //skip this._frameSize - this._byteData.readInt(); - this._numSkins = this._byteData.readInt(); - this._numVertices = this._byteData.readInt(); - this._numST = this._byteData.readInt(); - this._numTris = this._byteData.readInt(); - - //skip this._numGlCmds - this._byteData.readInt(); - this._numFrames = this._byteData.readInt(); - this._offsetSkins = this._byteData.readInt(); - this._offsetST = this._byteData.readInt(); - this._offsetTris = this._byteData.readInt(); - this._offsetFrames = this._byteData.readInt(); - - //skip this._offsetGlCmds - this._byteData.readInt(); - this._offsetEnd = this._byteData.readInt(); - - this._parsedHeader = true; - }; - - /** - * Parses the file names for the materials. - */ - MD2Parser.prototype.parseMaterialNames = function () { - var url; - var name; - var extIndex; - var slashIndex; - this._materialNames = new Array(); - this._byteData.position = this._offsetSkins; - - var regExp = new RegExp("[^a-zA-Z0-9\\_\/.]", "g"); - for (var i = 0; i < this._numSkins; ++i) { - name = this._byteData.readUTFBytes(64); - name = name.replace(regExp, ""); - extIndex = name.lastIndexOf("."); - if (this._ignoreTexturePath) - slashIndex = name.lastIndexOf("/"); - if (name.toLowerCase().indexOf(".jpg") == -1 && name.toLowerCase().indexOf(".png") == -1) { - name = name.substring(slashIndex + 1, extIndex); - url = name + "." + this._textureType; - } else { - url = name; - } - - this._materialNames[i] = name; - - // only support 1 skin TODO: really? - if (this.dependencies.length == 0) - this._pAddDependency(name, new away.net.URLRequest(url)); - } - - if (this._materialNames.length > 0) - this._mesh.material.name = this._materialNames[0]; - else - this.materialFinal = true; - }; - - /** - * Parses the uv data for the mesh. - */ - MD2Parser.prototype.parseUV = function () { - var j = 0; - - this._uvs = new Array(this._numST * 2); - this._byteData.position = this._offsetST; - for (var i = 0; i < this._numST; i++) { - this._uvs[j++] = this._byteData.readShort() / this._skinWidth; - this._uvs[j++] = this._byteData.readShort() / this._skinHeight; - } - - this._parsedUV = true; - }; - - /** - * Parses unique indices for the faces. - */ - MD2Parser.prototype.parseFaces = function () { - var a, b, c, ta, tb, tc; - var i; - - this._vertIndices = new Array(); - this._uvIndices = new Array(); - this._indices = new Array(); - - this._byteData.position = this._offsetTris; - - for (i = 0; i < this._numTris; i++) { - //collect vertex indices - a = this._byteData.readUnsignedShort(); - b = this._byteData.readUnsignedShort(); - c = this._byteData.readUnsignedShort(); - - //collect uv indices - ta = this._byteData.readUnsignedShort(); - tb = this._byteData.readUnsignedShort(); - tc = this._byteData.readUnsignedShort(); - - this.addIndex(a, ta); - this.addIndex(b, tb); - this.addIndex(c, tc); - } - - var len = this._uvIndices.length; - this._finalUV = new Array(len * 2); - - for (i = 0; i < len; ++i) { - this._finalUV[i << 1] = this._uvs[this._uvIndices[i] << 1]; - this._finalUV[(i << 1) + 1] = this._uvs[(this._uvIndices[i] << 1) + 1]; - } - - this._parsedFaces = true; - }; - - /** - * Adds a face index to the list if it doesn't exist yet, based on vertexIndex and uvIndex, and adds the - * corresponding vertex and uv data in the correct location. - * @param vertexIndex The original index in the vertex list. - * @param uvIndex The original index in the uv list. - */ - MD2Parser.prototype.addIndex = function (vertexIndex /*uint*/ , uvIndex /*uint*/ ) { - var index = this.findIndex(vertexIndex, uvIndex); - - if (index == -1) { - this._indices.push(this._vertIndices.length); - this._vertIndices.push(vertexIndex); - this._uvIndices.push(uvIndex); - } else - this._indices.push(index); - }; - - /** - * Finds the final index corresponding to the original MD2's vertex and uv indices. Returns -1 if it wasn't added yet. - * @param vertexIndex The original index in the vertex list. - * @param uvIndex The original index in the uv list. - * @return The index of the final mesh corresponding to the original vertex and uv index. -1 if it doesn't exist yet. - */ - MD2Parser.prototype.findIndex = function (vertexIndex /*uint*/ , uvIndex /*uint*/ ) { - var len = this._vertIndices.length; - - for (var i = 0; i < len; ++i) { - if (this._vertIndices[i] == vertexIndex && this._uvIndices[i] == uvIndex) - return i; - } - - return -1; - }; - - /** - * Parses all the frame geometries. - */ - MD2Parser.prototype.parseFrames = function () { - var sx, sy, sz; - var tx, ty, tz; - var geometry; - var subGeom; - var vertLen = this._vertIndices.length; - var fvertices; - var tvertices; - var i, j, k; - - //var ch : number /*uint*/; - var name = ""; - var prevClip = null; - - this._byteData.position = this._offsetFrames; - - for (i = 0; i < this._numFrames; i++) { - tvertices = new Array(); - fvertices = new Array(vertLen * 3); - - sx = this._byteData.readFloat(); - sy = this._byteData.readFloat(); - sz = this._byteData.readFloat(); - - tx = this._byteData.readFloat(); - ty = this._byteData.readFloat(); - tz = this._byteData.readFloat(); - - name = this.readFrameName(); - - for (j = 0; j < this._numVertices; j++, this._byteData.position++) - tvertices.push(sx * this._byteData.readUnsignedByte() + tx, sy * this._byteData.readUnsignedByte() + ty, sz * this._byteData.readUnsignedByte() + tz); - - k = 0; - for (j = 0; j < vertLen; j++) { - fvertices[k++] = tvertices[this._vertIndices[j] * 3]; - fvertices[k++] = tvertices[this._vertIndices[j] * 3 + 2]; - fvertices[k++] = tvertices[this._vertIndices[j] * 3 + 1]; - } - - subGeom = new TriangleSubGeometry(true); - - if (this._firstSubGeom == null) - this._firstSubGeom = subGeom; - - geometry = new Geometry(); - geometry.addSubGeometry(subGeom); - - subGeom.updateIndices(this._indices); - subGeom.updatePositions(fvertices); - subGeom.updateUVs(this._finalUV); - subGeom.vertexNormals; - subGeom.vertexTangents; - subGeom.autoDeriveNormals = false; - subGeom.autoDeriveTangents = false; - - var clip = this._clipNodes[name]; - - if (!clip) { - // If another sequence was parsed before this one, starting - // a new state means the previous one is complete and can - // hence be finalized. - if (prevClip) { - this._pFinalizeAsset(prevClip); - this._animationSet.addAnimation(prevClip); - } - - clip = new VertexClipNode(); - clip.name = name; - clip.stitchFinalFrame = true; - - this._clipNodes[name] = clip; - - prevClip = clip; - } - clip.addFrame(geometry, 1000 / away.parsers.MD2Parser.FPS); - } - - // Finalize the last state - if (prevClip) { - this._pFinalizeAsset(prevClip); - this._animationSet.addAnimation(prevClip); - } - - // Force this._pFinalizeAsset() to decide name - this._pFinalizeAsset(this._animationSet); - - this._parsedFrames = true; - }; - - MD2Parser.prototype.readFrameName = function () { - var name = ""; - var k = 0; - for (var j = 0; j < 16; j++) { - var ch = this._byteData.readUnsignedByte(); - - if (Math.floor(ch) > 0x39 && Math.floor(ch) <= 0x7A && k == 0) - name += String.fromCharCode(ch); - - if (Math.floor(ch) >= 0x30 && Math.floor(ch) <= 0x39) - k++; - } - return name; - }; - MD2Parser.FPS = 6; - return MD2Parser; - })(parsers.ParserBase); - parsers.MD2Parser = MD2Parser; - })(away.parsers || (away.parsers = {})); - var parsers = away.parsers; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (parsers) { - var JointPose = away.animators.JointPose; - var SkeletonPose = away.animators.SkeletonPose; - var SkeletonClipNode = away.animators.SkeletonClipNode; - var Quaternion = away.geom.Quaternion; - var Vector3D = away.geom.Vector3D; - var URLLoaderDataFormat = away.net.URLLoaderDataFormat; - - /** - * MD5AnimParser provides a parser for the md5anim data type, providing an animation sequence for the md5 format. - * - * todo: optimize - */ - var MD5AnimParser = (function (_super) { - __extends(MD5AnimParser, _super); - /** - * Creates a new MD5AnimParser object. - * @param uri The url or id of the data or file to be parsed. - * @param extra The holder for extra contextual data that the parser might need. - */ - function MD5AnimParser(additionalRotationAxis, additionalRotationRadians) { - if (typeof additionalRotationAxis === "undefined") { additionalRotationAxis = null; } - if (typeof additionalRotationRadians === "undefined") { additionalRotationRadians = 0; } - _super.call(this, URLLoaderDataFormat.TEXT); - this._parseIndex = 0; - this._line = 0; - this._charLineIndex = 0; - this._rotationQuat = new Quaternion(); - var t1 = new Quaternion(); - var t2 = new Quaternion(); - - t1.fromAxisAngle(Vector3D.X_AXIS, -Math.PI * .5); - t2.fromAxisAngle(Vector3D.Y_AXIS, -Math.PI * .5); - - this._rotationQuat.multiply(t2, t1); - - if (additionalRotationAxis) { - this._rotationQuat.multiply(t2, t1); - t1.fromAxisAngle(additionalRotationAxis, additionalRotationRadians); - this._rotationQuat.multiply(t1, this._rotationQuat); - } - } - /** - * Indicates whether or not a given file extension is supported by the parser. - * @param extension The file extension of a potential file to be parsed. - * @return Whether or not the given file type is supported. - */ - MD5AnimParser.supportsType = function (extension) { - extension = extension.toLowerCase(); - return extension == "md5anim"; - }; - - /** - * Tests whether a data block can be parsed by the parser. - * @param data The data block to potentially be parsed. - * @return Whether or not the given data is supported. - */ - MD5AnimParser.supportsData = function (data) { - return false; - }; - - /** - * @inheritDoc - */ - MD5AnimParser.prototype._pProceedParsing = function () { - var token; - - if (!this._startedParsing) { - this._textData = this._pGetTextData(); - this._startedParsing = true; - } - - while (this._pHasTime()) { - token = this.getNextToken(); - switch (token) { - case MD5AnimParser.COMMENT_TOKEN: - this.ignoreLine(); - break; - case "": - break; - case MD5AnimParser.VERSION_TOKEN: - this._version = this.getNextInt(); - if (this._version != 10) - throw new Error("Unknown version number encountered!"); - break; - case MD5AnimParser.COMMAND_LINE_TOKEN: - this.parseCMD(); - break; - case MD5AnimParser.NUM_FRAMES_TOKEN: - this._numFrames = this.getNextInt(); - this._bounds = new Array(); - this._frameData = new Array(); - break; - case MD5AnimParser.NUM_JOINTS_TOKEN: - this._numJoints = this.getNextInt(); - this._hierarchy = new Array(this._numJoints); - this._baseFrameData = new Array(this._numJoints); - break; - case MD5AnimParser.FRAME_RATE_TOKEN: - this._frameRate = this.getNextInt(); - break; - case MD5AnimParser.NUM_ANIMATED_COMPONENTS_TOKEN: - this._numAnimatedComponents = this.getNextInt(); - break; - case MD5AnimParser.HIERARCHY_TOKEN: - this.parseHierarchy(); - break; - case MD5AnimParser.BOUNDS_TOKEN: - this.parseBounds(); - break; - case MD5AnimParser.BASE_FRAME_TOKEN: - this.parseBaseFrame(); - break; - case MD5AnimParser.FRAME_TOKEN: - this.parseFrame(); - break; - default: - if (!this._reachedEOF) - this.sendUnknownKeywordError(); - } - - if (this._reachedEOF) { - this._clip = new SkeletonClipNode(); - this.translateClip(); - this._pFinalizeAsset(this._clip); - return parsers.ParserBase.PARSING_DONE; - } - } - return parsers.ParserBase.MORE_TO_PARSE; - }; - - /** - * Converts all key frame data to an SkinnedAnimationSequence. - */ - MD5AnimParser.prototype.translateClip = function () { - for (var i = 0; i < this._numFrames; ++i) - this._clip.addFrame(this.translatePose(this._frameData[i]), 1000 / this._frameRate); - }; - - /** - * Converts a single key frame data to a SkeletonPose. - * @param frameData The actual frame data. - * @return A SkeletonPose containing the frame data's pose. - */ - MD5AnimParser.prototype.translatePose = function (frameData) { - var hierarchy; - var pose; - var base; - var flags; - var j; - var translate = new Vector3D(); - var orientation = new Quaternion(); - var components = frameData.components; - var skelPose = new SkeletonPose(); - var jointPoses = skelPose.jointPoses; - - for (var i = 0; i < this._numJoints; ++i) { - j = 0; - pose = new JointPose(); - hierarchy = this._hierarchy[i]; - base = this._baseFrameData[i]; - flags = hierarchy.flags; - translate.x = base.position.x; - translate.y = base.position.y; - translate.z = base.position.z; - orientation.x = base.orientation.x; - orientation.y = base.orientation.y; - orientation.z = base.orientation.z; - - if (flags & 1) - translate.x = components[hierarchy.startIndex + (j++)]; - if (flags & 2) - translate.y = components[hierarchy.startIndex + (j++)]; - if (flags & 4) - translate.z = components[hierarchy.startIndex + (j++)]; - if (flags & 8) - orientation.x = components[hierarchy.startIndex + (j++)]; - if (flags & 16) - orientation.y = components[hierarchy.startIndex + (j++)]; - if (flags & 32) - orientation.z = components[hierarchy.startIndex + (j++)]; - - var w = 1 - orientation.x * orientation.x - orientation.y * orientation.y - orientation.z * orientation.z; - orientation.w = w < 0 ? 0 : -Math.sqrt(w); - - if (hierarchy.parentIndex < 0) { - pose.orientation.multiply(this._rotationQuat, orientation); - pose.translation = this._rotationQuat.rotatePoint(translate); - } else { - pose.orientation.copyFrom(orientation); - pose.translation.x = translate.x; - pose.translation.y = translate.y; - pose.translation.z = translate.z; - } - pose.orientation.y = -pose.orientation.y; - pose.orientation.z = -pose.orientation.z; - pose.translation.x = -pose.translation.x; - - jointPoses[i] = pose; - } - - return skelPose; - }; - - /** - * Parses the skeleton's hierarchy data. - */ - MD5AnimParser.prototype.parseHierarchy = function () { - var ch; - var data; - var token = this.getNextToken(); - var i = 0; - - if (token != "{") - this.sendUnknownKeywordError(); - - do { - if (this._reachedEOF) - this.sendEOFError(); - data = new HierarchyData(); - data.name = this.parseLiteralstring(); - data.parentIndex = this.getNextInt(); - data.flags = this.getNextInt(); - data.startIndex = this.getNextInt(); - this._hierarchy[i++] = data; - - ch = this.getNextChar(); - - if (ch == "/") { - this.putBack(); - ch = this.getNextToken(); - if (ch == MD5AnimParser.COMMENT_TOKEN) - this.ignoreLine(); - ch = this.getNextChar(); - } - - if (ch != "}") - this.putBack(); - } while(ch != "}"); - }; - - /** - * Parses frame bounds. - */ - MD5AnimParser.prototype.parseBounds = function () { - var ch; - var data; - var token = this.getNextToken(); - var i = 0; - - if (token != "{") - this.sendUnknownKeywordError(); - - do { - if (this._reachedEOF) - this.sendEOFError(); - data = new BoundsData(); - data.min = this.parseVector3D(); - data.max = this.parseVector3D(); - this._bounds[i++] = data; - - ch = this.getNextChar(); - - if (ch == "/") { - this.putBack(); - ch = this.getNextToken(); - if (ch == MD5AnimParser.COMMENT_TOKEN) - this.ignoreLine(); - ch = this.getNextChar(); - } - - if (ch != "}") - this.putBack(); - } while(ch != "}"); - }; - - /** - * Parses the base frame. - */ - MD5AnimParser.prototype.parseBaseFrame = function () { - var ch; - var data; - var token = this.getNextToken(); - var i = 0; - - if (token != "{") - this.sendUnknownKeywordError(); - - do { - if (this._reachedEOF) - this.sendEOFError(); - data = new BaseFrameData(); - data.position = this.parseVector3D(); - data.orientation = this.parseQuaternion(); - this._baseFrameData[i++] = data; - - ch = this.getNextChar(); - - if (ch == "/") { - this.putBack(); - ch = this.getNextToken(); - if (ch == MD5AnimParser.COMMENT_TOKEN) - this.ignoreLine(); - ch = this.getNextChar(); - } - - if (ch != "}") - this.putBack(); - } while(ch != "}"); - }; - - /** - * Parses a single frame. - */ - MD5AnimParser.prototype.parseFrame = function () { - var ch; - var data; - var token; - var frameIndex; - - frameIndex = this.getNextInt(); - - token = this.getNextToken(); - if (token != "{") - this.sendUnknownKeywordError(); - - do { - if (this._reachedEOF) - this.sendEOFError(); - data = new FrameData(); - data.components = new Array(this._numAnimatedComponents); - - for (var i = 0; i < this._numAnimatedComponents; ++i) - data.components[i] = this.getNextNumber(); - - this._frameData[frameIndex] = data; - - ch = this.getNextChar(); - - if (ch == "/") { - this.putBack(); - ch = this.getNextToken(); - if (ch == MD5AnimParser.COMMENT_TOKEN) - this.ignoreLine(); - ch = this.getNextChar(); - } - - if (ch != "}") - this.putBack(); - } while(ch != "}"); - }; - - /** - * Puts back the last read character into the data stream. - */ - MD5AnimParser.prototype.putBack = function () { - this._parseIndex--; - this._charLineIndex--; - this._reachedEOF = this._parseIndex >= this._textData.length; - }; - - /** - * Gets the next token in the data stream. - */ - MD5AnimParser.prototype.getNextToken = function () { - var ch; - var token = ""; - - while (!this._reachedEOF) { - ch = this.getNextChar(); - if (ch == " " || ch == "\r" || ch == "\n" || ch == "\t") { - if (token != MD5AnimParser.COMMENT_TOKEN) - this.skipWhiteSpace(); - if (token != "") - return token; - } else - token += ch; - - if (token == MD5AnimParser.COMMENT_TOKEN) - return token; - } - - return token; - }; - - /** - * Skips all whitespace in the data stream. - */ - MD5AnimParser.prototype.skipWhiteSpace = function () { - var ch; - - do - ch = this.getNextChar(); while(ch == "\n" || ch == " " || ch == "\r" || ch == "\t"); - - this.putBack(); - }; - - /** - * Skips to the next line. - */ - MD5AnimParser.prototype.ignoreLine = function () { - var ch; - while (!this._reachedEOF && ch != "\n") - ch = this.getNextChar(); - }; - - /** - * Retrieves the next single character in the data stream. - */ - MD5AnimParser.prototype.getNextChar = function () { - var ch = this._textData.charAt(this._parseIndex++); - - if (ch == "\n") { - ++this._line; - this._charLineIndex = 0; - } else if (ch != "\r") - ++this._charLineIndex; - - if (this._parseIndex == this._textData.length) - this._reachedEOF = true; - - return ch; - }; - - /** - * Retrieves the next integer in the data stream. - */ - MD5AnimParser.prototype.getNextInt = function () { - var i = parseInt(this.getNextToken()); - if (isNaN(i)) - this.sendParseError("int type"); - return i; - }; - - /** - * Retrieves the next floating point number in the data stream. - */ - MD5AnimParser.prototype.getNextNumber = function () { - var f = parseFloat(this.getNextToken()); - if (isNaN(f)) - this.sendParseError("float type"); - return f; - }; - - /** - * Retrieves the next 3d vector in the data stream. - */ - MD5AnimParser.prototype.parseVector3D = function () { - var vec = new Vector3D(); - var ch = this.getNextToken(); - - if (ch != "(") - this.sendParseError("("); - vec.x = this.getNextNumber(); - vec.y = this.getNextNumber(); - vec.z = this.getNextNumber(); - - if (this.getNextToken() != ")") - this.sendParseError(")"); - - return vec; - }; - - /** - * Retrieves the next quaternion in the data stream. - */ - MD5AnimParser.prototype.parseQuaternion = function () { - var quat = new Quaternion(); - var ch = this.getNextToken(); - - if (ch != "(") - this.sendParseError("("); - quat.x = this.getNextNumber(); - quat.y = this.getNextNumber(); - quat.z = this.getNextNumber(); - - // quat supposed to be unit length - var t = 1 - (quat.x * quat.x) - (quat.y * quat.y) - (quat.z * quat.z); - quat.w = t < 0 ? 0 : -Math.sqrt(t); - - if (this.getNextToken() != ")") - this.sendParseError(")"); - - return quat; - }; - - /** - * Parses the command line data. - */ - MD5AnimParser.prototype.parseCMD = function () { - // just ignore the command line property - this.parseLiteralstring(); - }; - - /** - * Retrieves the next literal string in the data stream. A literal string is a sequence of characters bounded - * by double quotes. - */ - MD5AnimParser.prototype.parseLiteralstring = function () { - this.skipWhiteSpace(); - - var ch = this.getNextChar(); - var str = ""; - - if (ch != "\"") - this.sendParseError("\""); - - do { - if (this._reachedEOF) - this.sendEOFError(); - ch = this.getNextChar(); - if (ch != "\"") - str += ch; - } while(ch != "\""); - - return str; - }; - - /** - * Throws an end-of-file error when a premature end of file was encountered. - */ - MD5AnimParser.prototype.sendEOFError = function () { - throw new Error("Unexpected end of file"); - }; - - /** - * Throws an error when an unexpected token was encountered. - * @param expected The token type that was actually expected. - */ - MD5AnimParser.prototype.sendParseError = function (expected) { - throw new Error("Unexpected token at line " + (this._line + 1) + ", character " + this._charLineIndex + ". " + expected + " expected, but " + this._textData.charAt(this._parseIndex - 1) + " encountered"); - }; - - /** - * Throws an error when an unknown keyword was encountered. - */ - MD5AnimParser.prototype.sendUnknownKeywordError = function () { - throw new Error("Unknown keyword at line " + (this._line + 1) + ", character " + this._charLineIndex + ". "); - }; - MD5AnimParser.VERSION_TOKEN = "MD5Version"; - MD5AnimParser.COMMAND_LINE_TOKEN = "commandline"; - MD5AnimParser.NUM_FRAMES_TOKEN = "numFrames"; - MD5AnimParser.NUM_JOINTS_TOKEN = "numJoints"; - MD5AnimParser.FRAME_RATE_TOKEN = "frameRate"; - MD5AnimParser.NUM_ANIMATED_COMPONENTS_TOKEN = "numAnimatedComponents"; - - MD5AnimParser.HIERARCHY_TOKEN = "hierarchy"; - MD5AnimParser.BOUNDS_TOKEN = "bounds"; - MD5AnimParser.BASE_FRAME_TOKEN = "baseframe"; - MD5AnimParser.FRAME_TOKEN = "frame"; - - MD5AnimParser.COMMENT_TOKEN = "//"; - return MD5AnimParser; - })(parsers.ParserBase); - parsers.MD5AnimParser = MD5AnimParser; - })(away.parsers || (away.parsers = {})); - var parsers = away.parsers; -})(away || (away = {})); - -// value objects -var HierarchyData = (function () { - function HierarchyData() { - } - HierarchyData.prototype.HierarchyData = function () { - }; - return HierarchyData; -})(); - -var BoundsData = (function () { - function BoundsData() { - } - BoundsData.prototype.BoundsData = function () { - }; - return BoundsData; -})(); - -var BaseFrameData = (function () { - function BaseFrameData() { - } - BaseFrameData.prototype.BaseFrameData = function () { - }; - return BaseFrameData; -})(); - -var FrameData = (function () { - function FrameData() { - } - FrameData.prototype.FrameData = function () { - }; - return FrameData; -})(); -/// -var away; -(function (away) { - (function (parsers) { - var SkeletonAnimationSet = away.animators.SkeletonAnimationSet; - var Skeleton = away.animators.Skeleton; - var SkeletonJoint = away.animators.SkeletonJoint; - var Geometry = away.base.Geometry; - var TriangleSubGeometry = away.base.TriangleSubGeometry; - - var Quaternion = away.geom.Quaternion; - var Vector3D = away.geom.Vector3D; - var Mesh = away.entities.Mesh; - var URLLoaderDataFormat = away.net.URLLoaderDataFormat; - - // todo: create animation system, parse skeleton - /** - * MD5MeshParser provides a parser for the md5mesh data type, providing the geometry of the md5 format. - * - * todo: optimize - */ - var MD5MeshParser = (function (_super) { - __extends(MD5MeshParser, _super); - /** - * Creates a new MD5MeshParser object. - */ - function MD5MeshParser(additionalRotationAxis, additionalRotationRadians) { - if (typeof additionalRotationAxis === "undefined") { additionalRotationAxis = null; } - if (typeof additionalRotationRadians === "undefined") { additionalRotationRadians = 0; } - _super.call(this, URLLoaderDataFormat.TEXT); - this._parseIndex = 0; - this._line = 0; - this._charLineIndex = 0; - this._rotationQuat = new Quaternion(); - - this._rotationQuat.fromAxisAngle(Vector3D.X_AXIS, -Math.PI * .5); - - if (additionalRotationAxis) { - var quat = new Quaternion(); - quat.fromAxisAngle(additionalRotationAxis, additionalRotationRadians); - this._rotationQuat.multiply(this._rotationQuat, quat); - } - } - /** - * Indicates whether or not a given file extension is supported by the parser. - * @param extension The file extension of a potential file to be parsed. - * @return Whether or not the given file type is supported. - */ - MD5MeshParser.supportsType = function (extension) { - extension = extension.toLowerCase(); - return extension == "md5mesh"; - }; - - /** - * Tests whether a data block can be parsed by the parser. - * @param data The data block to potentially be parsed. - * @return Whether or not the given data is supported. - */ - MD5MeshParser.supportsData = function (data) { - return false; - }; - - /** - * @inheritDoc - */ - MD5MeshParser.prototype._pProceedParsing = function () { - var token; - - if (!this._startedParsing) { - this._textData = this._pGetTextData(); - this._startedParsing = true; - } - - while (this._pHasTime()) { - token = this.getNextToken(); - switch (token) { - case MD5MeshParser.COMMENT_TOKEN: - this.ignoreLine(); - break; - case MD5MeshParser.VERSION_TOKEN: - this._version = this.getNextInt(); - if (this._version != 10) - throw new Error("Unknown version number encountered!"); - break; - case MD5MeshParser.COMMAND_LINE_TOKEN: - this.parseCMD(); - break; - case MD5MeshParser.NUM_JOINTS_TOKEN: - this._numJoints = this.getNextInt(); - this._bindPoses = new Array(this._numJoints); - break; - case MD5MeshParser.NUM_MESHES_TOKEN: - this._numMeshes = this.getNextInt(); - break; - case MD5MeshParser.JOINTS_TOKEN: - this.parseJoints(); - break; - case MD5MeshParser.MESH_TOKEN: - this.parseMesh(); - break; - default: - if (!this._reachedEOF) - this.sendUnknownKeywordError(); - } - - if (this._reachedEOF) { - this.calculateMaxJointCount(); - this._animationSet = new SkeletonAnimationSet(this._maxJointCount); - - this._mesh = new Mesh(new Geometry(), null); - this._geometry = this._mesh.geometry; - - for (var i = 0; i < this._meshData.length; ++i) - this._geometry.addSubGeometry(this.translateGeom(this._meshData[i].vertexData, this._meshData[i].weightData, this._meshData[i].indices)); - - //_geometry.animation = _animation; - // _mesh.animationController = _animationController; - //add to the content property - this._pContent.addChild(this._mesh); - - this._pFinalizeAsset(this._geometry); - this._pFinalizeAsset(this._mesh); - this._pFinalizeAsset(this._skeleton); - this._pFinalizeAsset(this._animationSet); - return parsers.ParserBase.PARSING_DONE; - } - } - return parsers.ParserBase.MORE_TO_PARSE; - }; - - MD5MeshParser.prototype._pStartParsing = function (frameLimit) { - _super.prototype._pStartParsing.call(this, frameLimit); - - //create a content object for Loaders - this._pContent = new away.containers.DisplayObjectContainer(); - }; - - MD5MeshParser.prototype.calculateMaxJointCount = function () { - this._maxJointCount = 0; - - var numMeshData = this._meshData.length; - for (var i = 0; i < numMeshData; ++i) { - var meshData = this._meshData[i]; - var vertexData = meshData.vertexData; - var numVerts = vertexData.length; - - for (var j = 0; j < numVerts; ++j) { - var zeroWeights = this.countZeroWeightJoints(vertexData[j], meshData.weightData); - var totalJoints = vertexData[j].countWeight - zeroWeights; - if (totalJoints > this._maxJointCount) - this._maxJointCount = totalJoints; - } - } - }; - - MD5MeshParser.prototype.countZeroWeightJoints = function (vertex, weights) { - var start = vertex.startWeight; - var end = vertex.startWeight + vertex.countWeight; - var count = 0; - var weight; - - for (var i = start; i < end; ++i) { - weight = weights[i].bias; - if (weight == 0) - ++count; - } - - return count; - }; - - /** - * Parses the skeleton's joints. - */ - MD5MeshParser.prototype.parseJoints = function () { - var ch; - var joint; - var pos; - var quat; - var i = 0; - var token = this.getNextToken(); - - if (token != "{") - this.sendUnknownKeywordError(); - - this._skeleton = new Skeleton(); - - do { - if (this._reachedEOF) - this.sendEOFError(); - joint = new SkeletonJoint(); - joint.name = this.parseLiteralstring(); - joint.parentIndex = this.getNextInt(); - pos = this.parseVector3D(); - pos = this._rotationQuat.rotatePoint(pos); - quat = this.parseQuaternion(); - - // todo: check if this is correct, or maybe we want to actually store it as quats? - this._bindPoses[i] = quat.toMatrix3D(); - this._bindPoses[i].appendTranslation(pos.x, pos.y, pos.z); - var inv = this._bindPoses[i].clone(); - inv.invert(); - joint.inverseBindPose = inv.rawData; - - this._skeleton.joints[i++] = joint; - - ch = this.getNextChar(); - - if (ch == "/") { - this.putBack(); - ch = this.getNextToken(); - if (ch == MD5MeshParser.COMMENT_TOKEN) - this.ignoreLine(); - ch = this.getNextChar(); - } - - if (ch != "}") - this.putBack(); - } while(ch != "}"); - }; - - /** - * Puts back the last read character into the data stream. - */ - MD5MeshParser.prototype.putBack = function () { - this._parseIndex--; - this._charLineIndex--; - this._reachedEOF = this._parseIndex >= this._textData.length; - }; - - /** - * Parses the mesh geometry. - */ - MD5MeshParser.prototype.parseMesh = function () { - var token = this.getNextToken(); - var ch; - var vertexData; - var weights; - var indices; - - if (token != "{") - this.sendUnknownKeywordError(); - - if (this._shaders == null) - this._shaders = new Array(); - - while (ch != "}") { - ch = this.getNextToken(); - switch (ch) { - case MD5MeshParser.COMMENT_TOKEN: - this.ignoreLine(); - break; - case MD5MeshParser.MESH_SHADER_TOKEN: - this._shaders.push(this.parseLiteralstring()); - break; - case MD5MeshParser.MESH_NUM_VERTS_TOKEN: - vertexData = new Array(this.getNextInt()); - break; - case MD5MeshParser.MESH_NUM_TRIS_TOKEN: - indices = new Array(this.getNextInt() * 3); - break; - case MD5MeshParser.MESH_NUM_WEIGHTS_TOKEN: - weights = new Array(this.getNextInt()); - break; - case MD5MeshParser.MESH_VERT_TOKEN: - this.parseVertex(vertexData); - break; - case MD5MeshParser.MESH_TRI_TOKEN: - this.parseTri(indices); - break; - case MD5MeshParser.MESH_WEIGHT_TOKEN: - this.parseJoint(weights); - break; - } - } - - if (this._meshData == null) - this._meshData = new Array(); - - var i = this._meshData.length; - this._meshData[i] = new MeshData(); - this._meshData[i].vertexData = vertexData; - this._meshData[i].weightData = weights; - this._meshData[i].indices = indices; - }; - - /** - * Converts the mesh data to a SkinnedSub instance. - * @param vertexData The mesh's vertices. - * @param weights The joint weights per vertex. - * @param indices The indices for the faces. - * @return A SubGeometry instance containing all geometrical data for the current mesh. - */ - MD5MeshParser.prototype.translateGeom = function (vertexData, weights, indices /*uint*/ ) { - var len = vertexData.length; - var v1, v2, v3; - var vertex; - var weight; - var bindPose; - var pos; - var subGeom = new TriangleSubGeometry(true); - var uvs = new Array(len * 2); - var vertices = new Array(len * 3); - var jointIndices = new Array(len * this._maxJointCount); - var jointWeights = new Array(len * this._maxJointCount); - var l = 0; - var nonZeroWeights; - - for (var i = 0; i < len; ++i) { - vertex = vertexData[i]; - v1 = vertex.index * 3; - v2 = v1 + 1; - v3 = v1 + 2; - vertices[v1] = vertices[v2] = vertices[v3] = 0; - - nonZeroWeights = 0; - for (var j = 0; j < vertex.countWeight; ++j) { - weight = weights[vertex.startWeight + j]; - if (weight.bias > 0) { - bindPose = this._bindPoses[weight.joint]; - pos = bindPose.transformVector(weight.pos); - vertices[v1] += pos.x * weight.bias; - vertices[v2] += pos.y * weight.bias; - vertices[v3] += pos.z * weight.bias; - - // indices need to be multiplied by 3 (amount of matrix registers) - jointIndices[l] = weight.joint * 3; - jointWeights[l++] = weight.bias; - ++nonZeroWeights; - } - } - - for (j = nonZeroWeights; j < this._maxJointCount; ++j) { - jointIndices[l] = 0; - jointWeights[l++] = 0; - } - - v1 = vertex.index << 1; - uvs[v1++] = vertex.s; - uvs[v1] = vertex.t; - } - - subGeom.jointsPerVertex = this._maxJointCount; - subGeom.updateIndices(indices); - subGeom.updatePositions(vertices); - subGeom.updateUVs(uvs); - subGeom.updateJointIndices(jointIndices); - subGeom.updateJointWeights(jointWeights); - - // cause explicit updates - subGeom.vertexNormals; - subGeom.vertexTangents; - - // turn auto updates off because they may be animated and set explicitly - subGeom.autoDeriveTangents = false; - subGeom.autoDeriveNormals = false; - - return subGeom; - }; - - /** - * Retrieve the next triplet of vertex indices that form a face. - * @param indices The index list in which to store the read data. - */ - MD5MeshParser.prototype.parseTri = function (indices /*uint*/ ) { - var index = this.getNextInt() * 3; - indices[index] = this.getNextInt(); - indices[index + 1] = this.getNextInt(); - indices[index + 2] = this.getNextInt(); - }; - - /** - * Reads a new joint data set for a single joint. - * @param weights the target list to contain the weight data. - */ - MD5MeshParser.prototype.parseJoint = function (weights) { - var weight = new JointData(); - weight.index = this.getNextInt(); - weight.joint = this.getNextInt(); - weight.bias = this.getNextNumber(); - weight.pos = this.parseVector3D(); - weights[weight.index] = weight; - }; - - /** - * Reads the data for a single vertex. - * @param vertexData The list to contain the vertex data. - */ - MD5MeshParser.prototype.parseVertex = function (vertexData) { - var vertex = new VertexData(); - vertex.index = this.getNextInt(); - this.parseUV(vertex); - vertex.startWeight = this.getNextInt(); - vertex.countWeight = this.getNextInt(); - - // if (vertex.countWeight > _maxJointCount) _maxJointCount = vertex.countWeight; - vertexData[vertex.index] = vertex; - }; - - /** - * Reads the next uv coordinate. - * @param vertexData The vertexData to contain the UV coordinates. - */ - MD5MeshParser.prototype.parseUV = function (vertexData) { - var ch = this.getNextToken(); - if (ch != "(") - this.sendParseError("("); - vertexData.s = this.getNextNumber(); - vertexData.t = this.getNextNumber(); - - if (this.getNextToken() != ")") - this.sendParseError(")"); - }; - - /** - * Gets the next token in the data stream. - */ - MD5MeshParser.prototype.getNextToken = function () { - var ch; - var token = ""; - - while (!this._reachedEOF) { - ch = this.getNextChar(); - if (ch == " " || ch == "\r" || ch == "\n" || ch == "\t") { - if (token != MD5MeshParser.COMMENT_TOKEN) - this.skipWhiteSpace(); - if (token != "") - return token; - } else - token += ch; - - if (token == MD5MeshParser.COMMENT_TOKEN) - return token; - } - - return token; - }; - - /** - * Skips all whitespace in the data stream. - */ - MD5MeshParser.prototype.skipWhiteSpace = function () { - var ch; - - do - ch = this.getNextChar(); while(ch == "\n" || ch == " " || ch == "\r" || ch == "\t"); - - this.putBack(); - }; - - /** - * Skips to the next line. - */ - MD5MeshParser.prototype.ignoreLine = function () { - var ch; - while (!this._reachedEOF && ch != "\n") - ch = this.getNextChar(); - }; - - /** - * Retrieves the next single character in the data stream. - */ - MD5MeshParser.prototype.getNextChar = function () { - var ch = this._textData.charAt(this._parseIndex++); - - if (ch == "\n") { - ++this._line; - this._charLineIndex = 0; - } else if (ch != "\r") - ++this._charLineIndex; - - if (this._parseIndex >= this._textData.length) - this._reachedEOF = true; - - return ch; - }; - - /** - * Retrieves the next integer in the data stream. - */ - MD5MeshParser.prototype.getNextInt = function () { - var i = parseInt(this.getNextToken()); - if (isNaN(i)) - this.sendParseError("int type"); - return i; - }; - - /** - * Retrieves the next floating point number in the data stream. - */ - MD5MeshParser.prototype.getNextNumber = function () { - var f = parseFloat(this.getNextToken()); - if (isNaN(f)) - this.sendParseError("float type"); - return f; - }; - - /** - * Retrieves the next 3d vector in the data stream. - */ - MD5MeshParser.prototype.parseVector3D = function () { - var vec = new Vector3D(); - var ch = this.getNextToken(); - - if (ch != "(") - this.sendParseError("("); - vec.x = -this.getNextNumber(); - vec.y = this.getNextNumber(); - vec.z = this.getNextNumber(); - - if (this.getNextToken() != ")") - this.sendParseError(")"); - - return vec; - }; - - /** - * Retrieves the next quaternion in the data stream. - */ - MD5MeshParser.prototype.parseQuaternion = function () { - var quat = new Quaternion(); - var ch = this.getNextToken(); - - if (ch != "(") - this.sendParseError("("); - quat.x = this.getNextNumber(); - quat.y = -this.getNextNumber(); - quat.z = -this.getNextNumber(); - - // quat supposed to be unit length - var t = 1 - quat.x * quat.x - quat.y * quat.y - quat.z * quat.z; - quat.w = t < 0 ? 0 : -Math.sqrt(t); - - if (this.getNextToken() != ")") - this.sendParseError(")"); - - var rotQuat = new Quaternion(); - rotQuat.multiply(this._rotationQuat, quat); - return rotQuat; - }; - - /** - * Parses the command line data. - */ - MD5MeshParser.prototype.parseCMD = function () { - // just ignore the command line property - this.parseLiteralstring(); - }; - - /** - * Retrieves the next literal string in the data stream. A literal string is a sequence of characters bounded - * by double quotes. - */ - MD5MeshParser.prototype.parseLiteralstring = function () { - this.skipWhiteSpace(); - - var ch = this.getNextChar(); - var str = ""; - - if (ch != "\"") - this.sendParseError("\""); - - do { - if (this._reachedEOF) - this.sendEOFError(); - ch = this.getNextChar(); - if (ch != "\"") - str += ch; - } while(ch != "\""); - - return str; - }; - - /** - * Throws an end-of-file error when a premature end of file was encountered. - */ - MD5MeshParser.prototype.sendEOFError = function () { - throw new Error("Unexpected end of file"); - }; - - /** - * Throws an error when an unexpected token was encountered. - * @param expected The token type that was actually expected. - */ - MD5MeshParser.prototype.sendParseError = function (expected) { - throw new Error("Unexpected token at line " + (this._line + 1) + ", character " + this._charLineIndex + ". " + expected + " expected, but " + this._textData.charAt(this._parseIndex - 1) + " encountered"); - }; - - /** - * Throws an error when an unknown keyword was encountered. - */ - MD5MeshParser.prototype.sendUnknownKeywordError = function () { - throw new Error("Unknown keyword at line " + (this._line + 1) + ", character " + this._charLineIndex + ". "); - }; - MD5MeshParser.VERSION_TOKEN = "MD5Version"; - MD5MeshParser.COMMAND_LINE_TOKEN = "commandline"; - MD5MeshParser.NUM_JOINTS_TOKEN = "numJoints"; - MD5MeshParser.NUM_MESHES_TOKEN = "numMeshes"; - MD5MeshParser.COMMENT_TOKEN = "//"; - MD5MeshParser.JOINTS_TOKEN = "joints"; - MD5MeshParser.MESH_TOKEN = "mesh"; - - MD5MeshParser.MESH_SHADER_TOKEN = "shader"; - MD5MeshParser.MESH_NUM_VERTS_TOKEN = "numverts"; - MD5MeshParser.MESH_VERT_TOKEN = "vert"; - MD5MeshParser.MESH_NUM_TRIS_TOKEN = "numtris"; - MD5MeshParser.MESH_TRI_TOKEN = "tri"; - MD5MeshParser.MESH_NUM_WEIGHTS_TOKEN = "numweights"; - MD5MeshParser.MESH_WEIGHT_TOKEN = "weight"; - return MD5MeshParser; - })(parsers.ParserBase); - parsers.MD5MeshParser = MD5MeshParser; - })(away.parsers || (away.parsers = {})); - var parsers = away.parsers; -})(away || (away = {})); - -var VertexData = (function () { - function VertexData() { - } - return VertexData; -})(); - -var JointData = (function () { - function JointData() { - } - return JointData; -})(); - -var MeshData = (function () { - function MeshData() { - } - return MeshData; -})(); -/// -var away; -(function (away) { - (function (parsers) { - var AssetLoader = away.library.AssetLoader; - - var Parsers = (function () { - function Parsers() { - } - /** - * Short-hand function to enable all bundled parsers for auto-detection. In practice, - * this is the same as invoking enableParsers(Parsers.ALL_BUNDLED) on any of the - * loader classes SingleFileLoader, AssetLoader, AssetLibrary or Loader3D. - * - * See notes about file size in the documentation for the ALL_BUNDLED constant. - * - * @see away.parsers.Parsers.ALL_BUNDLED - */ - Parsers.enableAllBundled = function () { - AssetLoader.enableParsers(Parsers.ALL_BUNDLED); - }; - Parsers.ALL_BUNDLED = Array(parsers.AWDParser, parsers.Max3DSParser, parsers.MD2Parser, parsers.OBJParser); - return Parsers; - })(); - parsers.Parsers = Parsers; - })(away.parsers || (away.parsers = {})); - var parsers = away.parsers; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (commands) { - var Geometry = away.base.Geometry; - var TriangleSubGeometry = away.base.TriangleSubGeometry; - var Matrix3DUtils = away.geom.Matrix3DUtils; - var Mesh = away.entities.Mesh; - - /** - * Class Merge merges two or more static meshes into one.Merge - */ - var Merge = (function () { - /** - * @param keepMaterial [optional] Determines if the merged object uses the recevier mesh material information or keeps its source material(s). Defaults to false. - * If false and receiver object has multiple materials, the last material found in receiver submeshes is applied to the merged submesh(es). - * @param disposeSources [optional] Determines if the mesh and geometry source(s) used for the merging are disposed. Defaults to false. - * If true, only receiver geometry and resulting mesh are kept in memory. - * @param objectSpace [optional] Determines if source mesh(es) is/are merged using objectSpace or worldspace. Defaults to false. - */ - function Merge(keepMaterial, disposeSources, objectSpace) { - if (typeof keepMaterial === "undefined") { keepMaterial = false; } - if (typeof disposeSources === "undefined") { disposeSources = false; } - if (typeof objectSpace === "undefined") { objectSpace = false; } - this._keepMaterial = keepMaterial; - this._disposeSources = disposeSources; - this._objectSpace = objectSpace; - } - - Object.defineProperty(Merge.prototype, "disposeSources", { - get: function () { - return this._disposeSources; - }, - /** - * Determines if the mesh and geometry source(s) used for the merging are disposed. Defaults to false. - */ - set: function (b) { - this._disposeSources = b; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Merge.prototype, "keepMaterial", { - get: function () { - return this._keepMaterial; - }, - /** - * Determines if the material source(s) used for the merging are disposed. Defaults to false. - */ - set: function (b) { - this._keepMaterial = b; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Merge.prototype, "objectSpace", { - get: function () { - return this._objectSpace; - }, - /** - * Determines if source mesh(es) is/are merged using objectSpace or worldspace. Defaults to false. - */ - set: function (b) { - this._objectSpace = b; - }, - enumerable: true, - configurable: true - }); - - /** - * Merges all the children of a container into a single Mesh. If no Mesh object is found, method returns the receiver without modification. - * - * @param receiver The Mesh to receive the merged contents of the container. - * @param objectContainer The DisplayObjectContainer holding the meshes to be mergd. - * - * @return The merged Mesh instance. - */ - Merge.prototype.applyToContainer = function (receiver, objectContainer) { - this.reset(); - - //collect container meshes - this.parseContainer(receiver, objectContainer); - - //collect receiver - this.collect(receiver, false); - - //merge to receiver - this.merge(receiver, this._disposeSources); - }; - - /** - * Merges all the meshes found in the Array<Mesh> into a single Mesh. - * - * @param receiver The Mesh to receive the merged contents of the meshes. - * @param meshes A series of Meshes to be merged with the reciever mesh. - */ - Merge.prototype.applyToMeshes = function (receiver, meshes) { - this.reset(); - - if (!meshes.length) - return; - - for (var i = 0; i < meshes.length; i++) - if (meshes[i] != receiver) - this.collect(meshes[i], this._disposeSources); - - //collect receiver - this.collect(receiver, false); - - //merge to receiver - this.merge(receiver, this._disposeSources); - }; - - /** - * Merges 2 meshes into one. It is recommand to use apply when 2 meshes are to be merged. If more need to be merged, use either applyToMeshes or applyToContainer methods. - * - * @param receiver The Mesh to receive the merged contents of both meshes. - * @param mesh The Mesh to be merged with the receiver mesh - */ - Merge.prototype.apply = function (receiver, mesh) { - this.reset(); - - //collect mesh - this.collect(mesh, this._disposeSources); - - //collect receiver - this.collect(receiver, false); - - //merge to receiver - this.merge(receiver, this._disposeSources); - }; - - Merge.prototype.reset = function () { - this._toDispose = new Array(); - this._geomVOs = new Array(); - }; - - Merge.prototype.merge = function (destMesh, dispose) { - var i; - var subIdx; - var oldGeom; - var destGeom; - var useSubMaterials; - - oldGeom = destMesh.geometry; - destGeom = destMesh.geometry = new Geometry(); - subIdx = destMesh.subMeshes.length; - - // Only apply materials directly to sub-meshes if necessary, - // i.e. if there is more than one material available. - useSubMaterials = (this._geomVOs.length > 1); - - for (i = 0; i < this._geomVOs.length; i++) { - var s; - var data; - var sub = new TriangleSubGeometry(true); - sub.autoDeriveNormals = false; - sub.autoDeriveTangents = false; - - data = this._geomVOs[i]; - sub.updateIndices(data.indices); - sub.updatePositions(data.vertices); - sub.updateVertexNormals(data.normals); - sub.updateVertexTangents(data.tangents); - sub.updateUVs(data.uvs); - - destGeom.addSubGeometry(sub); - - if (this._keepMaterial && useSubMaterials) - destMesh.subMeshes[subIdx].material = data.material; - } - - if (this._keepMaterial && !useSubMaterials && this._geomVOs.length) - destMesh.material = this._geomVOs[0].material; - - if (dispose) { - var m; - var len = this._toDispose.length; - for (var i; i < len; i++) { - m = this._toDispose[i]; - m.geometry.dispose(); - m.dispose(); - } - - //dispose of the original receiver geometry - oldGeom.dispose(); - } - - this._toDispose = null; - }; - - Merge.prototype.collect = function (mesh, dispose) { - if (mesh.geometry) { - var subIdx; - var subGeometries = mesh.geometry.subGeometries; - var calc; - for (subIdx = 0; subIdx < subGeometries.length; subIdx++) { - var i; - var len; - var iIdx, vIdx, nIdx, tIdx, uIdx; - var indexOffset; - var subGeom; - var vo; - var vertices; - var normals; - var tangents; - var pd, nd, td, ud; - - subGeom = subGeometries[subIdx]; - pd = subGeom.positions; - nd = subGeom.vertexNormals; - td = subGeom.vertexTangents; - ud = subGeom.uvs; - - // Get (or create) a VO for this material - vo = this.getSubGeomData(mesh.subMeshes[subIdx].material || mesh.material); - - // Vertices and normals are copied to temporary vectors, to be transformed - // before concatenated onto those of the data. This is unnecessary if no - // transformation will be performed, i.e. for object space merging. - vertices = (this._objectSpace) ? vo.vertices : new Array(); - normals = (this._objectSpace) ? vo.normals : new Array(); - tangents = (this._objectSpace) ? vo.tangents : new Array(); - - // Copy over vertex attributes - vIdx = vertices.length; - nIdx = normals.length; - tIdx = tangents.length; - uIdx = vo.uvs.length; - len = subGeom.numVertices; - for (i = 0; i < len; i++) { - calc = i * 3; - - // Position - vertices[vIdx++] = pd[calc]; - vertices[vIdx++] = pd[calc + 1]; - vertices[vIdx++] = pd[calc + 2]; - - // Normal - normals[nIdx++] = nd[calc]; - normals[nIdx++] = nd[calc + 1]; - normals[nIdx++] = nd[calc + 2]; - - // Tangent - tangents[tIdx++] = td[calc]; - tangents[tIdx++] = td[calc + 1]; - tangents[tIdx++] = td[calc + 2]; - - // UV - vo.uvs[uIdx++] = ud[i * 2]; - vo.uvs[uIdx++] = ud[i * 2 + 1]; - } - - // Copy over triangle indices - indexOffset = (!this._objectSpace) ? vo.vertices.length / 3 : 0; - iIdx = vo.indices.length; - len = subGeom.numTriangles; - for (i = 0; i < len; i++) { - calc = i * 3; - vo.indices[iIdx++] = subGeom.indices[calc] + indexOffset; - vo.indices[iIdx++] = subGeom.indices[calc + 1] + indexOffset; - vo.indices[iIdx++] = subGeom.indices[calc + 2] + indexOffset; - } - - if (!this._objectSpace) { - mesh.sceneTransform.transformVectors(vertices, vertices); - Matrix3DUtils.deltaTransformVectors(mesh.sceneTransform, normals, normals); - Matrix3DUtils.deltaTransformVectors(mesh.sceneTransform, tangents, tangents); - - // Copy vertex data from temporary (transformed) vectors - vIdx = vo.vertices.length; - nIdx = vo.normals.length; - tIdx = vo.tangents.length; - len = vertices.length; - for (i = 0; i < len; i++) { - vo.vertices[vIdx++] = vertices[i]; - vo.normals[nIdx++] = normals[i]; - vo.tangents[tIdx++] = tangents[i]; - } - } - } - - if (dispose) - this._toDispose.push(mesh); - } - }; - - Merge.prototype.getSubGeomData = function (material) { - var data; - - if (this._keepMaterial) { - var i; - var len; - - len = this._geomVOs.length; - for (i = 0; i < len; i++) { - if (this._geomVOs[i].material == material) { - data = this._geomVOs[i]; - break; - } - } - } else if (this._geomVOs.length) { - // If materials are not to be kept, all data can be - // put into a single VO, so return that one. - data = this._geomVOs[0]; - } - - // No data (for this material) found, create new. - if (!data) { - data = new GeometryVO(); - data.vertices = new Array(); - data.normals = new Array(); - data.tangents = new Array(); - data.uvs = new Array(); - data.indices = new Array(); - data.material = material; - - this._geomVOs.push(data); - } - - return data; - }; - - Merge.prototype.parseContainer = function (receiver, object) { - var child; - var i; - - if (object instanceof Mesh && object != receiver) - this.collect(object, this._disposeSources); - - for (i = 0; i < object.numChildren; ++i) { - child = object.getChildAt(i); - this.parseContainer(receiver, child); - } - }; - return Merge; - })(); - commands.Merge = Merge; - })(away.commands || (away.commands = {})); - var commands = away.commands; -})(away || (away = {})); - -var GeometryVO = (function () { - function GeometryVO() { - } - return GeometryVO; -})(); -/// -var away; -(function (away) { - (function (tools) { - /** - * ... - */ - var ParticleGeometryTransform = (function () { - function ParticleGeometryTransform() { - } - - - Object.defineProperty(ParticleGeometryTransform.prototype, "UVTransform", { - get: function () { - return this._defaultUVTransform; - }, - set: function (value) { - this._defaultUVTransform = value; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ParticleGeometryTransform.prototype, "vertexTransform", { - get: function () { - return this._defaultVertexTransform; - }, - set: function (value) { - this._defaultVertexTransform = value; - this._defaultInvVertexTransform = value.clone(); - this._defaultInvVertexTransform.invert(); - this._defaultInvVertexTransform.transpose(); - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ParticleGeometryTransform.prototype, "invVertexTransform", { - get: function () { - return this._defaultInvVertexTransform; - }, - enumerable: true, - configurable: true - }); - return ParticleGeometryTransform; - })(); - tools.ParticleGeometryTransform = ParticleGeometryTransform; - })(away.tools || (away.tools = {})); - var tools = away.tools; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (tools) { - var ParticleData = away.animators.ParticleData; - var ParticleGeometry = away.base.ParticleGeometry; - - var TriangleSubGeometry = away.base.TriangleSubGeometry; - - var Point = away.geom.Point; - var Vector3D = away.geom.Vector3D; - - /** - * ... - */ - var ParticleGeometryHelper = (function () { - function ParticleGeometryHelper() { - } - ParticleGeometryHelper.generateGeometry = function (geometries, transforms) { - if (typeof transforms === "undefined") { transforms = null; } - var indicesVector = new Array(); - var positionsVector = new Array(); - var normalsVector = new Array(); - var tangentsVector = new Array(); - var uvsVector = new Array(); - var vertexCounters = new Array(); - var particles = new Array(); - var subGeometries = new Array(); - var numParticles = geometries.length; - - var sourceSubGeometries; - var sourceSubGeometry; - var numSubGeometries; - var indices; - var positions; - var normals; - var tangents; - var uvs; - var vertexCounter; - var subGeometry; - var i; - var j; - var sub2SubMap = new Array(); - - var tempVertex = new Vector3D; - var tempNormal = new Vector3D; - var tempTangents = new Vector3D; - var tempUV = new Point; - - for (i = 0; i < numParticles; i++) { - sourceSubGeometries = geometries[i].subGeometries; - numSubGeometries = sourceSubGeometries.length; - for (var srcIndex = 0; srcIndex < numSubGeometries; srcIndex++) { - //create a different particle subgeometry group for each source subgeometry in a particle. - if (sub2SubMap.length <= srcIndex) { - sub2SubMap.push(subGeometries.length); - indicesVector.push(new Array()); - positionsVector.push(new Array()); - normalsVector.push(new Array()); - tangentsVector.push(new Array()); - uvsVector.push(new Array()); - subGeometries.push(new TriangleSubGeometry(true)); - vertexCounters.push(0); - } - - sourceSubGeometry = sourceSubGeometries[srcIndex]; - - //add a new particle subgeometry if this source subgeometry will take us over the maxvertex limit - if (sourceSubGeometry.numVertices + vertexCounters[sub2SubMap[srcIndex]] > ParticleGeometryHelper.MAX_VERTEX) { - //update submap and add new subgeom vectors - sub2SubMap[srcIndex] = subGeometries.length; - indicesVector.push(new Array()); - positionsVector.push(new Array()); - normalsVector.push(new Array()); - tangentsVector.push(new Array()); - uvsVector.push(new Array()); - subGeometries.push(new TriangleSubGeometry(true)); - vertexCounters.push(0); - } - - j = sub2SubMap[srcIndex]; - - //select the correct vector - indices = indicesVector[j]; - positions = positionsVector[j]; - normals = normalsVector[j]; - tangents = tangentsVector[j]; - uvs = uvsVector[j]; - vertexCounter = vertexCounters[j]; - subGeometry = subGeometries[j]; - - var particleData = new ParticleData(); - particleData.numVertices = sourceSubGeometry.numVertices; - particleData.startVertexIndex = vertexCounter; - particleData.particleIndex = i; - particleData.subGeometry = subGeometry; - particles.push(particleData); - - vertexCounters[j] += sourceSubGeometry.numVertices; - - var k; - var tempLen; - var compact = sourceSubGeometry; - var product; - var sourcePositions; - var sourceNormals; - var sourceTangents; - var sourceUVs; - - if (compact) { - tempLen = compact.numVertices; - compact.numTriangles; - sourcePositions = compact.positions; - sourceNormals = compact.vertexNormals; - sourceTangents = compact.vertexTangents; - sourceUVs = compact.uvs; - - if (transforms) { - var particleGeometryTransform = transforms[i]; - var vertexTransform = particleGeometryTransform.vertexTransform; - var invVertexTransform = particleGeometryTransform.invVertexTransform; - var UVTransform = particleGeometryTransform.UVTransform; - - for (k = 0; k < tempLen; k++) { - /* - * 0 - 2: vertex position X, Y, Z - * 3 - 5: normal X, Y, Z - * 6 - 8: tangent X, Y, Z - * 9 - 10: U V - * 11 - 12: Secondary U V*/ - product = k * 3; - tempVertex.x = sourcePositions[product]; - tempVertex.y = sourcePositions[product + 1]; - tempVertex.z = sourcePositions[product + 2]; - tempNormal.x = sourceNormals[product]; - tempNormal.y = sourceNormals[product + 1]; - tempNormal.z = sourceNormals[product + 2]; - tempTangents.x = sourceTangents[product]; - tempTangents.y = sourceTangents[product + 1]; - tempTangents.z = sourceTangents[product + 2]; - tempUV.x = sourceUVs[k * 2]; - tempUV.y = sourceUVs[k * 2 + 1]; - if (vertexTransform) { - tempVertex = vertexTransform.transformVector(tempVertex); - tempNormal = invVertexTransform.deltaTransformVector(tempNormal); - tempTangents = invVertexTransform.deltaTransformVector(tempNormal); - } - if (UVTransform) - tempUV = UVTransform.transformPoint(tempUV); - - //this is faster than that only push one data - sourcePositions.push(tempVertex.x, tempVertex.y, tempVertex.z); - sourceNormals.push(tempNormal.x, tempNormal.y, tempNormal.z); - sourceTangents.push(tempTangents.x, tempTangents.y, tempTangents.z); - sourceUVs.push(tempUV.x, tempUV.y); - } - } else { - for (k = 0; k < tempLen; k++) { - product = k * 3; - - //this is faster than that only push one data - positions.push(sourcePositions[product], sourcePositions[product + 1], sourcePositions[product + 2]); - normals.push(sourceNormals[product], sourceNormals[product + 1], sourceNormals[product + 2]); - tangents.push(sourceTangents[product], sourceTangents[product + 1], sourceTangents[product + 2]); - uvs.push(sourceUVs[k * 2], sourceUVs[k * 2 + 1]); - } - } - } else { - //Todo - } - - var sourceIndices = sourceSubGeometry.indices; - tempLen = sourceSubGeometry.numTriangles; - for (k = 0; k < tempLen; k++) { - product = k * 3; - indices.push(sourceIndices[product] + vertexCounter, sourceIndices[product + 1] + vertexCounter, sourceIndices[product + 2] + vertexCounter); - } - } - } - - var particleGeometry = new ParticleGeometry(); - particleGeometry.particles = particles; - particleGeometry.numParticles = numParticles; - - numParticles = subGeometries.length; - for (i = 0; i < numParticles; i++) { - subGeometry = subGeometries[i]; - subGeometry.autoDeriveNormals = false; - subGeometry.autoDeriveTangents = false; - subGeometry.updateIndices(indicesVector[i]); - subGeometry.updatePositions(positionsVector[i]); - subGeometry.updateVertexNormals(normalsVector[i]); - subGeometry.updateVertexTangents(tangentsVector[i]); - subGeometry.updateUVs(uvsVector[i]); - particleGeometry.addSubGeometry(subGeometry); - } - - return particleGeometry; - }; - ParticleGeometryHelper.MAX_VERTEX = 65535; - return ParticleGeometryHelper; - })(); - tools.ParticleGeometryHelper = ParticleGeometryHelper; - })(away.tools || (away.tools = {})); - var tools = away.tools; -})(away || (away = {})); -/********************************************************************************************************************************************************************************************************** -* This file contains a reference to all the classes used in the project. -******************************************************************************************************************************************************************************************************** -* -* The TypeScript compiler exports classes in a non deterministic manner, as the extend functionality copies the prototype chain -* of one object onto another during initialisation and load (to create extensible functionality), the non deterministic nature of the -* compiler can result in an extend operation referencing a class that is undefined and not yet loaded - which throw an JavaScript error. -* -* This file provides the compiler with a strict order in which to export the TypeScript classes to mitigate undefined extend errors -* -* @see https://typescript.codeplex.com/workitem/1356 @see https://typescript.codeplex.com/workitem/913 -* -*********************************************************************************************************************************************************************************************************/ -/// -/// -/// -/// -/// -/// -/// -/// -// -/// -/// -/// -/// -/// -/// -// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -away.Debug.THROW_ERRORS = false; -away.Debug.LOG_PI_ERRORS = false; - -var away; -(function (away) { - var StageGLRenderer = (function (_super) { - __extends(StageGLRenderer, _super); - function StageGLRenderer() { - _super.call(this); - } - return StageGLRenderer; - })(away.events.EventDispatcher); - away.StageGLRenderer = StageGLRenderer; -})(away || (away = {})); -//# sourceMappingURL=stagegl-extensions.next.js.map diff --git a/build/stagegl-extensions.next.js.map b/build/stagegl-extensions.next.js.map deleted file mode 100644 index 40508d0c3..000000000 --- a/build/stagegl-extensions.next.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stagegl-extensions.next.js","sourceRoot":"","sources":["../src/away/events/AnimationStateEvent.ts","../src/away/core/base/ParticleGeometry.ts","../src/away/core/pick/PickingColliderBase.ts","../src/away/core/pick/JSPickingCollider.ts","../src/away/core/pick/ShaderPicker.ts","../src/away/materials/methods/AmbientEnvMapMethod.ts","../src/away/materials/methods/DiffuseCompositeMethod.ts","../src/away/materials/methods/DiffuseCelMethod.ts","../src/away/materials/methods/DiffuseDepthMethod.ts","../src/away/materials/methods/DiffuseGradientMethod.ts","../src/away/materials/methods/DiffuseLightMapMethod.ts","../src/away/materials/methods/DiffuseWrapMethod.ts","../src/away/materials/methods/EffectAlphaMaskMethod.ts","../src/away/materials/methods/EffectColorMatrixMethod.ts","../src/away/materials/methods/EffectEnvMapMethod.ts","../src/away/materials/methods/EffectFogMethod.ts","../src/away/materials/methods/EffectFresnelEnvMapMethod.ts","../src/away/materials/methods/EffectLightMapMethod.ts","../src/away/materials/methods/EffectRefractionEnvMapMethod.ts","../src/away/materials/methods/EffectRimLightMethod.ts","../src/away/materials/methods/NormalHeightMapMethod.ts","../src/away/materials/methods/NormalSimpleWaterMethod.ts","../src/away/materials/methods/ShadowCascadeMethod.ts","../src/away/materials/methods/ShadowDitheredMethod.ts","../src/away/materials/methods/ShadowFilteredMethod.ts","../src/away/materials/methods/ShadowNearMethod.ts","../src/away/materials/methods/ShadowSoftMethod.ts","../src/away/materials/methods/SpecularCompositeMethod.ts","../src/away/materials/methods/SpecularAnisotropicMethod.ts","../src/away/materials/methods/SpecularCelMethod.ts","../src/away/materials/methods/SpecularFresnelMethod.ts","../src/away/materials/methods/SpecularPhongMethod.ts","../src/away/utils/PerspectiveMatrix3D.ts","../src/away/animators/data/AnimationSubGeometry.ts","../src/away/animators/data/ColorSegmentPoint.ts","../src/away/animators/data/JointPose.ts","../src/away/animators/data/ParticleAnimationData.ts","../src/away/animators/data/ParticleData.ts","../src/away/animators/data/ParticleProperties.ts","../src/away/animators/data/ParticlePropertiesMode.ts","../src/away/animators/data/Skeleton.ts","../src/away/animators/data/VertexAnimationMode.ts","../src/away/animators/data/SkeletonJoint.ts","../src/away/animators/data/SkeletonPose.ts","../src/away/animators/nodes/AnimationClipNodeBase.ts","../src/away/animators/nodes/ParticleNodeBase.ts","../src/away/animators/nodes/ParticleAccelerationNode.ts","../src/away/animators/nodes/ParticleBezierCurveNode.ts","../src/away/animators/nodes/ParticleBillboardNode.ts","../src/away/animators/nodes/ParticleColorNode.ts","../src/away/animators/nodes/ParticleFollowNode.ts","../src/away/animators/nodes/ParticleInitialColorNode.ts","../src/away/animators/nodes/ParticleOrbitNode.ts","../src/away/animators/nodes/ParticleOscillatorNode.ts","../src/away/animators/nodes/ParticlePositionNode.ts","../src/away/animators/nodes/ParticleRotateToHeadingNode.ts","../src/away/animators/nodes/ParticleRotateToPositionNode.ts","../src/away/animators/nodes/ParticleRotationalVelocityNode.ts","../src/away/animators/nodes/ParticleScaleNode.ts","../src/away/animators/nodes/ParticleSegmentedColorNode.ts","../src/away/animators/nodes/ParticleSpriteSheetNode.ts","../src/away/animators/nodes/ParticleTimeNode.ts","../src/away/animators/nodes/ParticleUVNode.ts","../src/away/animators/nodes/ParticleVelocityNode.ts","../src/away/animators/nodes/SkeletonBinaryLERPNode.ts","../src/away/animators/nodes/SkeletonClipNode.ts","../src/away/animators/nodes/SkeletonDifferenceNode.ts","../src/away/animators/nodes/SkeletonDirectionalNode.ts","../src/away/animators/nodes/SkeletonNaryLERPNode.ts","../src/away/animators/nodes/VertexClipNode.ts","../src/away/animators/states/ISkeletonAnimationState.ts","../src/away/animators/states/IVertexAnimationState.ts","../src/away/animators/states/AnimationStateBase.ts","../src/away/animators/states/ParticleStateBase.ts","../src/away/animators/states/ParticleAccelerationState.ts","../src/away/animators/states/ParticleBezierCurveState.ts","../src/away/animators/states/ParticleBillboardState.ts","../src/away/animators/states/ParticleColorState.ts","../src/away/animators/states/ParticleFollowState.ts","../src/away/animators/states/ParticleInitialColorState.ts","../src/away/animators/states/ParticleOrbitState.ts","../src/away/animators/states/ParticleOscillatorState.ts","../src/away/animators/states/ParticlePositionState.ts","../src/away/animators/states/ParticleRotateToHeadingState.ts","../src/away/animators/states/ParticleRotateToPositionState.ts","../src/away/animators/states/ParticleRotationalVelocityState.ts","../src/away/animators/states/ParticleScaleState.ts","../src/away/animators/states/ParticleSegmentedColorState.ts","../src/away/animators/states/ParticleSpriteSheetState.ts","../src/away/animators/states/ParticleTimeState.ts","../src/away/animators/states/ParticleUVState.ts","../src/away/animators/states/ParticleVelocityState.ts","../src/away/animators/states/AnimationClipState.ts","../src/away/animators/states/SkeletonBinaryLERPState.ts","../src/away/animators/states/SkeletonClipState.ts","../src/away/animators/states/SkeletonDifferenceState.ts","../src/away/animators/states/SkeletonDirectionalState.ts","../src/away/animators/states/SkeletonNaryLERPState.ts","../src/away/animators/states/VertexClipState.ts","../src/away/animators/transitions/IAnimationTransition.ts","../src/away/animators/transitions/CrossfadeTransition.ts","../src/away/animators/transitions/CrossfadeTransitionNode.ts","../src/away/animators/transitions/CrossfadeTransitionState.ts","../src/away/animators/ParticleAnimationSet.ts","../src/away/animators/ParticleAnimator.ts","../src/away/animators/SkeletonAnimator.ts","../src/away/animators/SkeletonAnimationSet.ts","../src/away/animators/VertexAnimationSet.ts","../src/away/animators/VertexAnimator.ts","../src/away/parsers/OBJParser.ts","../src/away/parsers/AWDParser.ts","../src/away/parsers/Max3DSParser.ts","../src/away/parsers/MD2Parser.ts","../src/away/parsers/MD5AnimParser.ts","../src/away/parsers/MD5MeshParser.ts","../src/away/parsers/Parsers.ts","../src/away/tools/commands/Merge.ts","../src/away/tools/data/ParticleGeometryTransform.ts","../src/away/tools/helpers/ParticleGeometryHelper.ts","../src/away/_definitions.ts","../src/StageGLExtensions.ts"],"names":["away","away.events","away.events.AnimationStateEvent","away.events.AnimationStateEvent.constructor","away.events.AnimationStateEvent.clone","away.base","away.base.ParticleGeometry","away.base.ParticleGeometry.constructor","away.pick","away.pick.PickingColliderBase","away.pick.PickingColliderBase.constructor","away.pick.PickingColliderBase._pPetCollisionNormal","away.pick.PickingColliderBase._pGetCollisionUV","away.pick.PickingColliderBase._pTestRenderableCollision","away.pick.PickingColliderBase.setLocalRay","away.pick.PickingColliderBase.testBillboardCollision","away.pick.PickingColliderBase.testMeshCollision","away.pick.JSPickingCollider","away.pick.JSPickingCollider.constructor","away.pick.JSPickingCollider._pTestRenderableCollision","away.pick.ShaderPicker","away.pick.ShaderPicker.constructor","away.pick.ShaderPicker.getViewCollision","away.pick.ShaderPicker.getSceneCollision","away.pick.ShaderPicker.pDraw","away.pick.ShaderPicker.drawRenderables","away.pick.ShaderPicker.updateRay","away.pick.ShaderPicker.initObjectProgram","away.pick.ShaderPicker.initTriangleProgram","away.pick.ShaderPicker.getHitDetails","away.pick.ShaderPicker.getApproximatePosition","away.pick.ShaderPicker.getPreciseDetails","away.pick.ShaderPicker.getPrecisePosition","away.pick.ShaderPicker.dispose","away.materials","away.materials.AmbientEnvMapMethod","away.materials.AmbientEnvMapMethod.constructor","away.materials.AmbientEnvMapMethod.iInitVO","away.materials.AmbientEnvMapMethod.iActivate","away.materials.AmbientEnvMapMethod.iGetFragmentCode","away.materials.DiffuseCompositeMethod","away.materials.DiffuseCompositeMethod.constructor","away.materials.DiffuseCompositeMethod.iInitVO","away.materials.DiffuseCompositeMethod.iInitConstants","away.materials.DiffuseCompositeMethod.dispose","away.materials.DiffuseCompositeMethod.iGetFragmentPreLightingCode","away.materials.DiffuseCompositeMethod.iGetFragmentCodePerLight","away.materials.DiffuseCompositeMethod.iGetFragmentCodePerProbe","away.materials.DiffuseCompositeMethod.iActivate","away.materials.DiffuseCompositeMethod.iSetRenderState","away.materials.DiffuseCompositeMethod.iDeactivate","away.materials.DiffuseCompositeMethod.iGetVertexCode","away.materials.DiffuseCompositeMethod.iGetFragmentPostLightingCode","away.materials.DiffuseCompositeMethod.iReset","away.materials.DiffuseCompositeMethod.iCleanCompilationData","away.materials.DiffuseCompositeMethod.onShaderInvalidated","away.materials.DiffuseCelMethod","away.materials.DiffuseCelMethod.constructor","away.materials.DiffuseCelMethod.iInitConstants","away.materials.DiffuseCelMethod.iCleanCompilationData","away.materials.DiffuseCelMethod.iGetFragmentPreLightingCode","away.materials.DiffuseCelMethod.iActivate","away.materials.DiffuseCelMethod.clampDiffuse","away.materials.DiffuseDepthMethod","away.materials.DiffuseDepthMethod.constructor","away.materials.DiffuseDepthMethod.iInitConstants","away.materials.DiffuseDepthMethod.iGetFragmentPostLightingCode","away.materials.DiffuseGradientMethod","away.materials.DiffuseGradientMethod.constructor","away.materials.DiffuseGradientMethod.iCleanCompilationData","away.materials.DiffuseGradientMethod.iGetFragmentPreLightingCode","away.materials.DiffuseGradientMethod.iGetFragmentCodePerLight","away.materials.DiffuseGradientMethod.pApplyShadow","away.materials.DiffuseGradientMethod.iActivate","away.materials.DiffuseLightMapMethod","away.materials.DiffuseLightMapMethod.constructor","away.materials.DiffuseLightMapMethod.iInitVO","away.materials.DiffuseLightMapMethod.iActivate","away.materials.DiffuseLightMapMethod.iGetFragmentPostLightingCode","away.materials.DiffuseWrapMethod","away.materials.DiffuseWrapMethod.constructor","away.materials.DiffuseWrapMethod.iCleanCompilationData","away.materials.DiffuseWrapMethod.iGetFragmentPreLightingCode","away.materials.DiffuseWrapMethod.iGetFragmentCodePerLight","away.materials.DiffuseWrapMethod.iActivate","away.materials.EffectAlphaMaskMethod","away.materials.EffectAlphaMaskMethod.constructor","away.materials.EffectAlphaMaskMethod.iInitVO","away.materials.EffectAlphaMaskMethod.iActivate","away.materials.EffectAlphaMaskMethod.iGetFragmentCode","away.materials.EffectColorMatrixMethod","away.materials.EffectColorMatrixMethod.constructor","away.materials.EffectColorMatrixMethod.iGetFragmentCode","away.materials.EffectColorMatrixMethod.iActivate","away.materials.EffectEnvMapMethod","away.materials.EffectEnvMapMethod.constructor","away.materials.EffectEnvMapMethod.iInitVO","away.materials.EffectEnvMapMethod.dispose","away.materials.EffectEnvMapMethod.iActivate","away.materials.EffectEnvMapMethod.iGetFragmentCode","away.materials.EffectFogMethod","away.materials.EffectFogMethod.constructor","away.materials.EffectFogMethod.iInitVO","away.materials.EffectFogMethod.iInitConstants","away.materials.EffectFogMethod.iActivate","away.materials.EffectFogMethod.iGetFragmentCode","away.materials.EffectFresnelEnvMapMethod","away.materials.EffectFresnelEnvMapMethod.constructor","away.materials.EffectFresnelEnvMapMethod.iInitVO","away.materials.EffectFresnelEnvMapMethod.iInitConstants","away.materials.EffectFresnelEnvMapMethod.iActivate","away.materials.EffectFresnelEnvMapMethod.iGetFragmentCode","away.materials.EffectLightMapMethod","away.materials.EffectLightMapMethod.constructor","away.materials.EffectLightMapMethod.iInitVO","away.materials.EffectLightMapMethod.iActivate","away.materials.EffectLightMapMethod.iGetFragmentCode","away.materials.EffectRefractionEnvMapMethod","away.materials.EffectRefractionEnvMapMethod.constructor","away.materials.EffectRefractionEnvMapMethod.iInitConstants","away.materials.EffectRefractionEnvMapMethod.iInitVO","away.materials.EffectRefractionEnvMapMethod.iActivate","away.materials.EffectRefractionEnvMapMethod.iGetFragmentCode","away.materials.EffectRimLightMethod","away.materials.EffectRimLightMethod.constructor","away.materials.EffectRimLightMethod.iInitConstants","away.materials.EffectRimLightMethod.iInitVO","away.materials.EffectRimLightMethod.iActivate","away.materials.EffectRimLightMethod.iGetFragmentCode","away.materials.NormalHeightMapMethod","away.materials.NormalHeightMapMethod.constructor","away.materials.NormalHeightMapMethod.iInitConstants","away.materials.NormalHeightMapMethod.copyFrom","away.materials.NormalHeightMapMethod.iGetFragmentCode","away.materials.NormalSimpleWaterMethod","away.materials.NormalSimpleWaterMethod.constructor","away.materials.NormalSimpleWaterMethod.iInitConstants","away.materials.NormalSimpleWaterMethod.iInitVO","away.materials.NormalSimpleWaterMethod.iCleanCompilationData","away.materials.NormalSimpleWaterMethod.dispose","away.materials.NormalSimpleWaterMethod.iActivate","away.materials.NormalSimpleWaterMethod.iGetFragmentCode","away.materials.ShadowCascadeMethod","away.materials.ShadowCascadeMethod.constructor","away.materials.ShadowCascadeMethod.iInitVO","away.materials.ShadowCascadeMethod.iInitConstants","away.materials.ShadowCascadeMethod.iCleanCompilationData","away.materials.ShadowCascadeMethod.iGetVertexCode","away.materials.ShadowCascadeMethod.initProjectionsRegs","away.materials.ShadowCascadeMethod.iGetFragmentCode","away.materials.ShadowCascadeMethod.iActivate","away.materials.ShadowCascadeMethod.iSetRenderState","away.materials.ShadowCascadeMethod.onCascadeChange","away.materials.ShadowCascadeMethod.onShaderInvalidated","away.materials.ShadowDitheredMethod","away.materials.ShadowDitheredMethod.constructor","away.materials.ShadowDitheredMethod.iInitVO","away.materials.ShadowDitheredMethod.iInitConstants","away.materials.ShadowDitheredMethod.initGrainTexture","away.materials.ShadowDitheredMethod.dispose","away.materials.ShadowDitheredMethod.iActivate","away.materials.ShadowDitheredMethod._pGetPlanarFragmentCode","away.materials.ShadowDitheredMethod.getSampleCode","away.materials.ShadowDitheredMethod.addSample","away.materials.ShadowDitheredMethod.iActivateForCascade","away.materials.ShadowDitheredMethod._iGetCascadeFragmentCode","away.materials.ShadowFilteredMethod","away.materials.ShadowFilteredMethod.constructor","away.materials.ShadowFilteredMethod.iInitConstants","away.materials.ShadowFilteredMethod._pGetPlanarFragmentCode","away.materials.ShadowFilteredMethod.iActivateForCascade","away.materials.ShadowFilteredMethod._iGetCascadeFragmentCode","away.materials.ShadowNearMethod","away.materials.ShadowNearMethod.constructor","away.materials.ShadowNearMethod.iInitConstants","away.materials.ShadowNearMethod.iInitVO","away.materials.ShadowNearMethod.dispose","away.materials.ShadowNearMethod.iGetFragmentCode","away.materials.ShadowNearMethod.iActivate","away.materials.ShadowNearMethod.iDeactivate","away.materials.ShadowNearMethod.iSetRenderState","away.materials.ShadowNearMethod.iGetVertexCode","away.materials.ShadowNearMethod.iReset","away.materials.ShadowNearMethod.iCleanCompilationData","away.materials.ShadowNearMethod.onShaderInvalidated","away.materials.ShadowSoftMethod","away.materials.ShadowSoftMethod.constructor","away.materials.ShadowSoftMethod.iInitConstants","away.materials.ShadowSoftMethod.iActivate","away.materials.ShadowSoftMethod._pGetPlanarFragmentCode","away.materials.ShadowSoftMethod.addSample","away.materials.ShadowSoftMethod.iActivateForCascade","away.materials.ShadowSoftMethod._iGetCascadeFragmentCode","away.materials.ShadowSoftMethod.getSampleCode","away.materials.SpecularCompositeMethod","away.materials.SpecularCompositeMethod.constructor","away.materials.SpecularCompositeMethod.iInitVO","away.materials.SpecularCompositeMethod.iInitConstants","away.materials.SpecularCompositeMethod.dispose","away.materials.SpecularCompositeMethod.iActivate","away.materials.SpecularCompositeMethod.iSetRenderState","away.materials.SpecularCompositeMethod.iDeactivate","away.materials.SpecularCompositeMethod.iGetVertexCode","away.materials.SpecularCompositeMethod.iGetFragmentPreLightingCode","away.materials.SpecularCompositeMethod.iGetFragmentCodePerLight","away.materials.SpecularCompositeMethod.iGetFragmentCodePerProbe","away.materials.SpecularCompositeMethod.iGetFragmentPostLightingCode","away.materials.SpecularCompositeMethod.iReset","away.materials.SpecularCompositeMethod.iCleanCompilationData","away.materials.SpecularCompositeMethod.onShaderInvalidated","away.materials.SpecularAnisotropicMethod","away.materials.SpecularAnisotropicMethod.constructor","away.materials.SpecularAnisotropicMethod.iInitVO","away.materials.SpecularAnisotropicMethod.iGetFragmentCodePerLight","away.materials.SpecularCelMethod","away.materials.SpecularCelMethod.constructor","away.materials.SpecularCelMethod.iActivate","away.materials.SpecularCelMethod.iCleanCompilationData","away.materials.SpecularCelMethod.clampSpecular","away.materials.SpecularCelMethod.iGetFragmentPreLightingCode","away.materials.SpecularFresnelMethod","away.materials.SpecularFresnelMethod.constructor","away.materials.SpecularFresnelMethod.iInitConstants","away.materials.SpecularFresnelMethod.iCleanCompilationData","away.materials.SpecularFresnelMethod.iActivate","away.materials.SpecularFresnelMethod.iGetFragmentPreLightingCode","away.materials.SpecularFresnelMethod.modulateSpecular","away.materials.SpecularPhongMethod","away.materials.SpecularPhongMethod.constructor","away.materials.SpecularPhongMethod.iGetFragmentCodePerLight","away.utils","away.utils.PerspectiveMatrix3D","away.utils.PerspectiveMatrix3D.constructor","away.utils.PerspectiveMatrix3D.perspectiveFieldOfViewLH","away.animators","away.animators.AnimationSubGeometry","away.animators.AnimationSubGeometry.constructor","away.animators.AnimationSubGeometry.createVertexData","away.animators.AnimationSubGeometry.activateVertexBuffer","away.animators.AnimationSubGeometry.dispose","away.animators.AnimationSubGeometry.invalidateBuffer","away.animators.ColorSegmentPoint","away.animators.ColorSegmentPoint.constructor","away.animators.JointPose","away.animators.JointPose.constructor","away.animators.JointPose.toMatrix3D","away.animators.JointPose.copyFrom","away.animators.ParticleAnimationData","away.animators.ParticleAnimationData.constructor","away.animators.ParticleData","away.animators.ParticleData.constructor","away.animators.ParticleProperties","away.animators.ParticleProperties.constructor","away.animators.ParticlePropertiesMode","away.animators.ParticlePropertiesMode.constructor","away.animators.Skeleton","away.animators.Skeleton.constructor","away.animators.Skeleton.jointFromName","away.animators.Skeleton.jointIndexFromName","away.animators.Skeleton.dispose","away.animators.VertexAnimationMode","away.animators.VertexAnimationMode.constructor","away.animators.SkeletonJoint","away.animators.SkeletonJoint.constructor","away.animators.SkeletonPose","away.animators.SkeletonPose.constructor","away.animators.SkeletonPose.jointPoseFromName","away.animators.SkeletonPose.jointPoseIndexFromName","away.animators.SkeletonPose.clone","away.animators.SkeletonPose.dispose","away.animators.AnimationClipNodeBase","away.animators.AnimationClipNodeBase.constructor","away.animators.AnimationClipNodeBase._pUpdateStitch","away.animators.ParticleNodeBase","away.animators.ParticleNodeBase.constructor","away.animators.ParticleNodeBase.getAGALVertexCode","away.animators.ParticleNodeBase.getAGALFragmentCode","away.animators.ParticleNodeBase.getAGALUVCode","away.animators.ParticleNodeBase._iGeneratePropertyOfOneParticle","away.animators.ParticleNodeBase._iProcessAnimationSetting","away.animators.ParticleAccelerationNode","away.animators.ParticleAccelerationNode.constructor","away.animators.ParticleAccelerationNode.pGetAGALVertexCode","away.animators.ParticleAccelerationNode.getAnimationState","away.animators.ParticleAccelerationNode._iGeneratePropertyOfOneParticle","away.animators.ParticleBezierCurveNode","away.animators.ParticleBezierCurveNode.constructor","away.animators.ParticleBezierCurveNode.getAGALVertexCode","away.animators.ParticleBezierCurveNode.getAnimationState","away.animators.ParticleBezierCurveNode._iGeneratePropertyOfOneParticle","away.animators.ParticleBillboardNode","away.animators.ParticleBillboardNode.constructor","away.animators.ParticleBillboardNode.getAGALVertexCode","away.animators.ParticleBillboardNode.getAnimationState","away.animators.ParticleBillboardNode._iProcessAnimationSetting","away.animators.ParticleColorNode","away.animators.ParticleColorNode.constructor","away.animators.ParticleColorNode.getAGALVertexCode","away.animators.ParticleColorNode.getAnimationState","away.animators.ParticleColorNode._iProcessAnimationSetting","away.animators.ParticleColorNode._iGeneratePropertyOfOneParticle","away.animators.ParticleFollowNode","away.animators.ParticleFollowNode.constructor","away.animators.ParticleFollowNode.getAGALVertexCode","away.animators.ParticleFollowNode.getAnimationState","away.animators.ParticleInitialColorNode","away.animators.ParticleInitialColorNode.constructor","away.animators.ParticleInitialColorNode.getAGALVertexCode","away.animators.ParticleInitialColorNode._iProcessAnimationSetting","away.animators.ParticleInitialColorNode._iGeneratePropertyOfOneParticle","away.animators.ParticleOrbitNode","away.animators.ParticleOrbitNode.constructor","away.animators.ParticleOrbitNode.getAGALVertexCode","away.animators.ParticleOrbitNode.getAnimationState","away.animators.ParticleOrbitNode._iGeneratePropertyOfOneParticle","away.animators.ParticleOscillatorNode","away.animators.ParticleOscillatorNode.constructor","away.animators.ParticleOscillatorNode.getAGALVertexCode","away.animators.ParticleOscillatorNode.getAnimationState","away.animators.ParticleOscillatorNode._iGeneratePropertyOfOneParticle","away.animators.ParticlePositionNode","away.animators.ParticlePositionNode.constructor","away.animators.ParticlePositionNode.getAGALVertexCode","away.animators.ParticlePositionNode.getAnimationState","away.animators.ParticlePositionNode._iGeneratePropertyOfOneParticle","away.animators.ParticleRotateToHeadingNode","away.animators.ParticleRotateToHeadingNode.constructor","away.animators.ParticleRotateToHeadingNode.getAGALVertexCode","away.animators.ParticleRotateToHeadingNode.getAnimationState","away.animators.ParticleRotateToHeadingNode._iProcessAnimationSetting","away.animators.ParticleRotateToPositionNode","away.animators.ParticleRotateToPositionNode.constructor","away.animators.ParticleRotateToPositionNode.getAGALVertexCode","away.animators.ParticleRotateToPositionNode.getAnimationState","away.animators.ParticleRotateToPositionNode._iGeneratePropertyOfOneParticle","away.animators.ParticleRotationalVelocityNode","away.animators.ParticleRotationalVelocityNode.constructor","away.animators.ParticleRotationalVelocityNode.getAGALVertexCode","away.animators.ParticleRotationalVelocityNode.getAnimationState","away.animators.ParticleRotationalVelocityNode._iGeneratePropertyOfOneParticle","away.animators.ParticleScaleNode","away.animators.ParticleScaleNode.constructor","away.animators.ParticleScaleNode.getAGALVertexCode","away.animators.ParticleScaleNode.getAnimationState","away.animators.ParticleScaleNode._iGeneratePropertyOfOneParticle","away.animators.ParticleSegmentedColorNode","away.animators.ParticleSegmentedColorNode.constructor","away.animators.ParticleSegmentedColorNode._iProcessAnimationSetting","away.animators.ParticleSegmentedColorNode.getAGALVertexCode","away.animators.ParticleSpriteSheetNode","away.animators.ParticleSpriteSheetNode.constructor","away.animators.ParticleSpriteSheetNode.getAGALUVCode","away.animators.ParticleSpriteSheetNode.getAnimationState","away.animators.ParticleSpriteSheetNode._iProcessAnimationSetting","away.animators.ParticleSpriteSheetNode._iGeneratePropertyOfOneParticle","away.animators.ParticleTimeNode","away.animators.ParticleTimeNode.constructor","away.animators.ParticleTimeNode.getAGALVertexCode","away.animators.ParticleTimeNode.getAnimationState","away.animators.ParticleTimeNode._iGeneratePropertyOfOneParticle","away.animators.ParticleUVNode","away.animators.ParticleUVNode.constructor","away.animators.ParticleUVNode.getAGALUVCode","away.animators.ParticleUVNode.getAnimationState","away.animators.ParticleUVNode.updateUVData","away.animators.ParticleUVNode._iProcessAnimationSetting","away.animators.ParticleVelocityNode","away.animators.ParticleVelocityNode.constructor","away.animators.ParticleVelocityNode.getAGALVertexCode","away.animators.ParticleVelocityNode.getAnimationState","away.animators.ParticleVelocityNode._iGeneratePropertyOfOneParticle","away.animators.SkeletonBinaryLERPNode","away.animators.SkeletonBinaryLERPNode.constructor","away.animators.SkeletonBinaryLERPNode.getAnimationState","away.animators.SkeletonClipNode","away.animators.SkeletonClipNode.constructor","away.animators.SkeletonClipNode.addFrame","away.animators.SkeletonClipNode.getAnimationState","away.animators.SkeletonClipNode._pUpdateStitch","away.animators.SkeletonDifferenceNode","away.animators.SkeletonDifferenceNode.constructor","away.animators.SkeletonDifferenceNode.getAnimationState","away.animators.SkeletonDirectionalNode","away.animators.SkeletonDirectionalNode.constructor","away.animators.SkeletonDirectionalNode.getAnimationState","away.animators.SkeletonNaryLERPNode","away.animators.SkeletonNaryLERPNode.constructor","away.animators.SkeletonNaryLERPNode.getInputIndex","away.animators.SkeletonNaryLERPNode.getInputAt","away.animators.SkeletonNaryLERPNode.addInput","away.animators.SkeletonNaryLERPNode.getAnimationState","away.animators.VertexClipNode","away.animators.VertexClipNode.constructor","away.animators.VertexClipNode.addFrame","away.animators.VertexClipNode._pUpdateStitch","away.animators.AnimationStateBase","away.animators.AnimationStateBase.constructor","away.animators.AnimationStateBase.offset","away.animators.AnimationStateBase.update","away.animators.AnimationStateBase.phase","away.animators.AnimationStateBase._pUpdateTime","away.animators.AnimationStateBase._pUpdatePositionDelta","away.animators.ParticleStateBase","away.animators.ParticleStateBase.constructor","away.animators.ParticleStateBase.setRenderState","away.animators.ParticleStateBase._pUpdateDynamicProperties","away.animators.ParticleAccelerationState","away.animators.ParticleAccelerationState.constructor","away.animators.ParticleAccelerationState.setRenderState","away.animators.ParticleAccelerationState.updateAccelerationData","away.animators.ParticleBezierCurveState","away.animators.ParticleBezierCurveState.constructor","away.animators.ParticleBezierCurveState.setRenderState","away.animators.ParticleBillboardState","away.animators.ParticleBillboardState.constructor","away.animators.ParticleBillboardState.setRenderState","away.animators.ParticleColorState","away.animators.ParticleColorState.constructor","away.animators.ParticleColorState.setRenderState","away.animators.ParticleColorState.updateColorData","away.animators.ParticleFollowState","away.animators.ParticleFollowState.constructor","away.animators.ParticleFollowState.setRenderState","away.animators.ParticleFollowState.processPosition","away.animators.ParticleFollowState.precessRotation","away.animators.ParticleFollowState.processPositionAndRotation","away.animators.ParticleInitialColorState","away.animators.ParticleInitialColorState.constructor","away.animators.ParticleInitialColorState.setRenderState","away.animators.ParticleInitialColorState.updateColorData","away.animators.ParticleOrbitState","away.animators.ParticleOrbitState.constructor","away.animators.ParticleOrbitState.setRenderState","away.animators.ParticleOrbitState.updateOrbitData","away.animators.ParticleOscillatorState","away.animators.ParticleOscillatorState.constructor","away.animators.ParticleOscillatorState.setRenderState","away.animators.ParticleOscillatorState.updateOscillatorData","away.animators.ParticlePositionState","away.animators.ParticlePositionState.constructor","away.animators.ParticlePositionState.getPositions","away.animators.ParticlePositionState.setPositions","away.animators.ParticlePositionState.setRenderState","away.animators.ParticleRotateToHeadingState","away.animators.ParticleRotateToHeadingState.constructor","away.animators.ParticleRotateToHeadingState.setRenderState","away.animators.ParticleRotateToPositionState","away.animators.ParticleRotateToPositionState.constructor","away.animators.ParticleRotateToPositionState.setRenderState","away.animators.ParticleRotationalVelocityState","away.animators.ParticleRotationalVelocityState.constructor","away.animators.ParticleRotationalVelocityState.getRotationalVelocities","away.animators.ParticleRotationalVelocityState.setRotationalVelocities","away.animators.ParticleRotationalVelocityState.setRenderState","away.animators.ParticleRotationalVelocityState.updateRotationalVelocityData","away.animators.ParticleScaleState","away.animators.ParticleScaleState.constructor","away.animators.ParticleScaleState.setRenderState","away.animators.ParticleScaleState.updateScaleData","away.animators.ParticleSegmentedColorState","away.animators.ParticleSegmentedColorState.constructor","away.animators.ParticleSegmentedColorState.setRenderState","away.animators.ParticleSegmentedColorState.updateColorData","away.animators.ParticleSpriteSheetState","away.animators.ParticleSpriteSheetState.constructor","away.animators.ParticleSpriteSheetState.setRenderState","away.animators.ParticleSpriteSheetState.updateSpriteSheetData","away.animators.ParticleTimeState","away.animators.ParticleTimeState.constructor","away.animators.ParticleTimeState.setRenderState","away.animators.ParticleUVState","away.animators.ParticleUVState.constructor","away.animators.ParticleUVState.setRenderState","away.animators.ParticleVelocityState","away.animators.ParticleVelocityState.constructor","away.animators.ParticleVelocityState.getVelocities","away.animators.ParticleVelocityState.setVelocities","away.animators.ParticleVelocityState.setRenderState","away.animators.AnimationClipState","away.animators.AnimationClipState.constructor","away.animators.AnimationClipState.update","away.animators.AnimationClipState.phase","away.animators.AnimationClipState._pUpdateTime","away.animators.AnimationClipState._pUpdateFrames","away.animators.AnimationClipState.notifyPlaybackComplete","away.animators.SkeletonBinaryLERPState","away.animators.SkeletonBinaryLERPState.constructor","away.animators.SkeletonBinaryLERPState.phase","away.animators.SkeletonBinaryLERPState._pUpdateTime","away.animators.SkeletonBinaryLERPState.getSkeletonPose","away.animators.SkeletonBinaryLERPState._pUpdatePositionDelta","away.animators.SkeletonBinaryLERPState.updateSkeletonPose","away.animators.SkeletonClipState","away.animators.SkeletonClipState.constructor","away.animators.SkeletonClipState.getSkeletonPose","away.animators.SkeletonClipState._pUpdateTime","away.animators.SkeletonClipState._pUpdateFrames","away.animators.SkeletonClipState.updateSkeletonPose","away.animators.SkeletonClipState._pUpdatePositionDelta","away.animators.SkeletonDifferenceState","away.animators.SkeletonDifferenceState.constructor","away.animators.SkeletonDifferenceState.phase","away.animators.SkeletonDifferenceState._pUpdateTime","away.animators.SkeletonDifferenceState.getSkeletonPose","away.animators.SkeletonDifferenceState._pUpdatePositionDelta","away.animators.SkeletonDifferenceState.updateSkeletonPose","away.animators.SkeletonDirectionalState","away.animators.SkeletonDirectionalState.constructor","away.animators.SkeletonDirectionalState.phase","away.animators.SkeletonDirectionalState._pUdateTime","away.animators.SkeletonDirectionalState.getSkeletonPose","away.animators.SkeletonDirectionalState._pUpdatePositionDelta","away.animators.SkeletonDirectionalState.updateSkeletonPose","away.animators.SkeletonDirectionalState.updateBlend","away.animators.SkeletonNaryLERPState","away.animators.SkeletonNaryLERPState.constructor","away.animators.SkeletonNaryLERPState.phase","away.animators.SkeletonNaryLERPState._pUdateTime","away.animators.SkeletonNaryLERPState.getSkeletonPose","away.animators.SkeletonNaryLERPState.getBlendWeightAt","away.animators.SkeletonNaryLERPState.setBlendWeightAt","away.animators.SkeletonNaryLERPState._pUpdatePositionDelta","away.animators.SkeletonNaryLERPState.updateSkeletonPose","away.animators.VertexClipState","away.animators.VertexClipState.constructor","away.animators.VertexClipState._pUpdateFrames","away.animators.VertexClipState._pUpdatePositionDelta","away.animators.CrossfadeTransition","away.animators.CrossfadeTransition.constructor","away.animators.CrossfadeTransition.getAnimationNode","away.animators.CrossfadeTransitionNode","away.animators.CrossfadeTransitionNode.constructor","away.animators.CrossfadeTransitionState","away.animators.CrossfadeTransitionState.constructor","away.animators.CrossfadeTransitionState._pUpdateTime","away.animators.ParticleAnimationSet","away.animators.ParticleAnimationSet.constructor","away.animators.ParticleAnimationSet.addAnimation","away.animators.ParticleAnimationSet.activate","away.animators.ParticleAnimationSet.deactivate","away.animators.ParticleAnimationSet.getAGALVertexCode","away.animators.ParticleAnimationSet.getAGALUVCode","away.animators.ParticleAnimationSet.getAGALFragmentCode","away.animators.ParticleAnimationSet.doneAGALCode","away.animators.ParticleAnimationSet.cancelGPUCompatibility","away.animators.ParticleAnimationSet.dispose","away.animators.ParticleAnimationSet.getAnimationSubGeometry","away.animators.ParticleAnimationSet._iGenerateAnimationSubGeometries","away.animators.ParticleAnimator","away.animators.ParticleAnimator.constructor","away.animators.ParticleAnimator.clone","away.animators.ParticleAnimator.setRenderState","away.animators.ParticleAnimator.testGPUCompatibility","away.animators.ParticleAnimator.start","away.animators.ParticleAnimator._pUpdateDeltaTime","away.animators.ParticleAnimator.resetTime","away.animators.ParticleAnimator.dispose","away.animators.ParticleAnimator.getAnimatorSubGeometry","away.animators.SkeletonAnimator","away.animators.SkeletonAnimator.constructor","away.animators.SkeletonAnimator.clone","away.animators.SkeletonAnimator.play","away.animators.SkeletonAnimator.setRenderState","away.animators.SkeletonAnimator.testGPUCompatibility","away.animators.SkeletonAnimator._pUpdateDeltaTime","away.animators.SkeletonAnimator.updateCondensedMatrices","away.animators.SkeletonAnimator.updateGlobalProperties","away.animators.SkeletonAnimator.getRenderableSubGeometry","away.animators.SkeletonAnimator.morphSubGeometry","away.animators.SkeletonAnimator.localToGlobalPose","away.animators.SkeletonAnimator.onTransitionComplete","away.animators.SkeletonAnimator.onIndicesUpdate","away.animators.SkeletonAnimator.onVerticesUpdate","away.animators.SkeletonAnimationSet","away.animators.SkeletonAnimationSet.constructor","away.animators.SkeletonAnimationSet.getAGALVertexCode","away.animators.SkeletonAnimationSet.activate","away.animators.SkeletonAnimationSet.deactivate","away.animators.SkeletonAnimationSet.getAGALFragmentCode","away.animators.SkeletonAnimationSet.getAGALUVCode","away.animators.SkeletonAnimationSet.doneAGALCode","away.animators.VertexAnimationSet","away.animators.VertexAnimationSet.constructor","away.animators.VertexAnimationSet.getAGALVertexCode","away.animators.VertexAnimationSet.activate","away.animators.VertexAnimationSet.deactivate","away.animators.VertexAnimationSet.getAGALFragmentCode","away.animators.VertexAnimationSet.getAGALUVCode","away.animators.VertexAnimationSet.doneAGALCode","away.animators.VertexAnimationSet.getAbsoluteAGALCode","away.animators.VertexAnimationSet.getAdditiveAGALCode","away.animators.VertexAnimator","away.animators.VertexAnimator.constructor","away.animators.VertexAnimator.clone","away.animators.VertexAnimator.play","away.animators.VertexAnimator._pUpdateDeltaTime","away.animators.VertexAnimator.setRenderState","away.animators.VertexAnimator.setNullPose","away.animators.VertexAnimator.testGPUCompatibility","away.animators.VertexAnimator.getRenderableSubGeometry","away.parsers","away.parsers.OBJParser","away.parsers.OBJParser.constructor","away.parsers.OBJParser.supportsType","away.parsers.OBJParser.supportsData","away.parsers.OBJParser._iResolveDependency","away.parsers.OBJParser._iResolveDependencyFailure","away.parsers.OBJParser._pProceedParsing","away.parsers.OBJParser._pStartParsing","away.parsers.OBJParser.parseLine","away.parsers.OBJParser.translate","away.parsers.OBJParser.translateMaterialGroup","away.parsers.OBJParser.translateVertexData","away.parsers.OBJParser.createObject","away.parsers.OBJParser.createGroup","away.parsers.OBJParser.createMaterialGroup","away.parsers.OBJParser.parseVertex","away.parsers.OBJParser.parseUV","away.parsers.OBJParser.parseVertexNormal","away.parsers.OBJParser.parseFace","away.parsers.OBJParser.parseIndex","away.parsers.OBJParser.parseMtl","away.parsers.OBJParser.parseMapKdString","away.parsers.OBJParser.loadMtl","away.parsers.OBJParser.applyMaterial","away.parsers.OBJParser.applyMaterials","ObjectGroup","ObjectGroup.constructor","Group","Group.constructor","MaterialGroup","MaterialGroup.constructor","SpecularData","SpecularData.constructor","LoadedMaterial","LoadedMaterial.constructor","FaceData","FaceData.constructor","UV","UV.constructor","UV.clone","UV.toString","Vertex","Vertex.constructor","Vertex.clone","away.parsers.AWDParser","away.parsers.AWDParser.constructor","away.parsers.AWDParser.supportsType","away.parsers.AWDParser.supportsData","away.parsers.AWDParser._iResolveDependency","away.parsers.AWDParser._iResolveDependencyFailure","away.parsers.AWDParser._iResolveDependencyName","away.parsers.AWDParser._pProceedParsing","away.parsers.AWDParser._pStartParsing","away.parsers.AWDParser.dispose","away.parsers.AWDParser.parseNextBlock","away.parsers.AWDParser.parseTriangleGeometrieBlock","away.parsers.AWDParser.parsePrimitves","away.parsers.AWDParser.parseContainer","away.parsers.AWDParser.parseMeshInstance","away.parsers.AWDParser.parseSkyboxInstance","away.parsers.AWDParser.parseLight","away.parsers.AWDParser.parseCamera","away.parsers.AWDParser.parseLightPicker","away.parsers.AWDParser.parseMaterial","away.parsers.AWDParser.parseMaterial_v1","away.parsers.AWDParser.parseTexture","away.parsers.AWDParser.parseCubeTexture","away.parsers.AWDParser.parseSharedMethodBlock","away.parsers.AWDParser.parseShadowMethodBlock","away.parsers.AWDParser.parseCommand","away.parsers.AWDParser.parseMetaData","away.parsers.AWDParser.parseNameSpace","away.parsers.AWDParser.parseShadowMethodList","away.parsers.AWDParser.parseSkeleton","away.parsers.AWDParser.parseSkeletonPose","away.parsers.AWDParser.parseSkeletonAnimation","away.parsers.AWDParser.parseMeshPoseAnimation","away.parsers.AWDParser.parseVertexAnimationSet","away.parsers.AWDParser.parseAnimatorSet","away.parsers.AWDParser.parseSharedMethodList","away.parsers.AWDParser.parseUserAttributes","away.parsers.AWDParser.parseProperties","away.parsers.AWDParser.parseAttrValue","away.parsers.AWDParser.parseHeader","away.parsers.AWDParser.getUVForVertexAnimation","away.parsers.AWDParser.parseVarStr","away.parsers.AWDParser.getAssetByID","away.parsers.AWDParser.getDefaultAsset","away.parsers.AWDParser.getDefaultMaterial","away.parsers.AWDParser.getDefaultTexture","away.parsers.AWDParser.getDefaultCubeTexture","away.parsers.AWDParser.readNumber","away.parsers.AWDParser.parseMatrix3D","away.parsers.AWDParser.parseMatrix32RawData","away.parsers.AWDParser.parseMatrix43RawData","AWDBlock","AWDBlock.constructor","AWDBlock.dispose","AWDBlock.addError","bitFlags","bitFlags.constructor","bitFlags.test","AWDProperties","AWDProperties.constructor","AWDProperties.set","AWDProperties.get","away.parsers.Max3DSParser","away.parsers.Max3DSParser.constructor","away.parsers.Max3DSParser.supportsType","away.parsers.Max3DSParser.supportsData","away.parsers.Max3DSParser._iResolveDependency","away.parsers.Max3DSParser._iResolveDependencyFailure","away.parsers.Max3DSParser._pProceedParsing","away.parsers.Max3DSParser._pStartParsing","away.parsers.Max3DSParser.parseMaterial","away.parsers.Max3DSParser.parseTexture","away.parsers.Max3DSParser.parseVertexList","away.parsers.Max3DSParser.parseFaceList","away.parsers.Max3DSParser.parseSmoothingGroups","away.parsers.Max3DSParser.parseUVList","away.parsers.Max3DSParser.parseFaceMaterialList","away.parsers.Max3DSParser.parseObjectAnimation","away.parsers.Max3DSParser.constructObject","away.parsers.Max3DSParser.prepareData","away.parsers.Max3DSParser.applySmoothGroups","away.parsers.Max3DSParser.finalizeCurrentMaterial","away.parsers.Max3DSParser.readNulTermstring","away.parsers.Max3DSParser.readTransform","away.parsers.Max3DSParser.readColor","TextureVO","TextureVO.constructor","MaterialVO","MaterialVO.constructor","ObjectVO","ObjectVO.constructor","VertexVO","VertexVO.constructor","FaceVO","FaceVO.constructor","away.parsers.MD2Parser","away.parsers.MD2Parser.constructor","away.parsers.MD2Parser.supportsType","away.parsers.MD2Parser.supportsData","away.parsers.MD2Parser._iResolveDependency","away.parsers.MD2Parser._iResolveDependencyFailure","away.parsers.MD2Parser._pProceedParsing","away.parsers.MD2Parser._pStartParsing","away.parsers.MD2Parser.parseHeader","away.parsers.MD2Parser.parseMaterialNames","away.parsers.MD2Parser.parseUV","away.parsers.MD2Parser.parseFaces","away.parsers.MD2Parser.addIndex","away.parsers.MD2Parser.findIndex","away.parsers.MD2Parser.parseFrames","away.parsers.MD2Parser.readFrameName","away.parsers.MD5AnimParser","away.parsers.MD5AnimParser.constructor","away.parsers.MD5AnimParser.supportsType","away.parsers.MD5AnimParser.supportsData","away.parsers.MD5AnimParser._pProceedParsing","away.parsers.MD5AnimParser.translateClip","away.parsers.MD5AnimParser.translatePose","away.parsers.MD5AnimParser.parseHierarchy","away.parsers.MD5AnimParser.parseBounds","away.parsers.MD5AnimParser.parseBaseFrame","away.parsers.MD5AnimParser.parseFrame","away.parsers.MD5AnimParser.putBack","away.parsers.MD5AnimParser.getNextToken","away.parsers.MD5AnimParser.skipWhiteSpace","away.parsers.MD5AnimParser.ignoreLine","away.parsers.MD5AnimParser.getNextChar","away.parsers.MD5AnimParser.getNextInt","away.parsers.MD5AnimParser.getNextNumber","away.parsers.MD5AnimParser.parseVector3D","away.parsers.MD5AnimParser.parseQuaternion","away.parsers.MD5AnimParser.parseCMD","away.parsers.MD5AnimParser.parseLiteralstring","away.parsers.MD5AnimParser.sendEOFError","away.parsers.MD5AnimParser.sendParseError","away.parsers.MD5AnimParser.sendUnknownKeywordError","HierarchyData","HierarchyData.constructor","HierarchyData.HierarchyData","BoundsData","BoundsData.constructor","BoundsData.BoundsData","BaseFrameData","BaseFrameData.constructor","BaseFrameData.BaseFrameData","FrameData","FrameData.constructor","FrameData.FrameData","away.parsers.MD5MeshParser","away.parsers.MD5MeshParser.constructor","away.parsers.MD5MeshParser.supportsType","away.parsers.MD5MeshParser.supportsData","away.parsers.MD5MeshParser._pProceedParsing","away.parsers.MD5MeshParser._pStartParsing","away.parsers.MD5MeshParser.calculateMaxJointCount","away.parsers.MD5MeshParser.countZeroWeightJoints","away.parsers.MD5MeshParser.parseJoints","away.parsers.MD5MeshParser.putBack","away.parsers.MD5MeshParser.parseMesh","away.parsers.MD5MeshParser.translateGeom","away.parsers.MD5MeshParser.parseTri","away.parsers.MD5MeshParser.parseJoint","away.parsers.MD5MeshParser.parseVertex","away.parsers.MD5MeshParser.parseUV","away.parsers.MD5MeshParser.getNextToken","away.parsers.MD5MeshParser.skipWhiteSpace","away.parsers.MD5MeshParser.ignoreLine","away.parsers.MD5MeshParser.getNextChar","away.parsers.MD5MeshParser.getNextInt","away.parsers.MD5MeshParser.getNextNumber","away.parsers.MD5MeshParser.parseVector3D","away.parsers.MD5MeshParser.parseQuaternion","away.parsers.MD5MeshParser.parseCMD","away.parsers.MD5MeshParser.parseLiteralstring","away.parsers.MD5MeshParser.sendEOFError","away.parsers.MD5MeshParser.sendParseError","away.parsers.MD5MeshParser.sendUnknownKeywordError","VertexData","VertexData.constructor","JointData","JointData.constructor","MeshData","MeshData.constructor","away.parsers.Parsers","away.parsers.Parsers.constructor","away.parsers.Parsers.enableAllBundled","away.commands","away.commands.Merge","away.commands.Merge.constructor","away.commands.Merge.applyToContainer","away.commands.Merge.applyToMeshes","away.commands.Merge.apply","away.commands.Merge.reset","away.commands.Merge.merge","away.commands.Merge.collect","away.commands.Merge.getSubGeomData","away.commands.Merge.parseContainer","GeometryVO","GeometryVO.constructor","away.tools","away.tools.ParticleGeometryTransform","away.tools.ParticleGeometryTransform.constructor","away.tools.ParticleGeometryHelper","away.tools.ParticleGeometryHelper.constructor","away.tools.ParticleGeometryHelper.generateGeometry","away.StageGLRenderer","away.StageGLRenderer.constructor"],"mappings":"AAAA,yCAAyC;;;;;;;AAEzC,IAAO,IAAI;AAoEV,CApED,UAAO,IAAI;KAAXA,UAAYA,MAAMA;QAEjBC;;UAEGA;QACHA;YAAyCC,sCAAKA;YAoB7CA;;;;;;cADGA;YACHA,6BAAYA,IAAWA,EAAEA,QAAoCA,EAAEA,cAA6CA,EAAEA,aAA8CA;gBAE3JC,WAAMA,OAAAA,IAAIA,CAACA;;gBAEXA,IAAIA,CAACA,SAASA,GAAGA,QAAQA;gBACzBA,IAAIA,CAACA,eAAeA,GAAGA,cAAcA;gBACrCA,IAAIA,CAACA,cAAcA,GAAGA,aAAaA;YACpCA,CAACA;YAKDD;gBAAAA;;kBADGA;qBACHA;oBAECA,OAAOA,IAAIA,CAACA,SAASA;gBACtBA,CAACA;;;;AAAAA;YAKDA;gBAAAA;;kBADGA;qBACHA;oBAECA,OAAOA,IAAIA,CAACA,eAAeA;gBAC5BA,C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;wBACtBA,IAAIA,CAACA,SAASA,CAACA,CAACA,EAAEA,CAACA,GAAGA,CAACA,UAAUA,CAACA,SAASA,GAAGA,QAAQA,CAACA,SAASA,CAACA,GAACA,CAACA,GAAGA,GAACA,CAACA,CAACA;wBACzEA,IAAIA,CAACA,SAASA,CAACA,CAACA,EAAEA,CAACA,GAAGA,CAACA,UAAUA,CAACA,WAAWA,GAAGA,QAAQA,CAACA,WAAWA,CAACA,GAACA,CAACA,GAAGA,GAACA,CAACA,CAACA;wBAC7EA,IAAIA,CAACA,SAASA,CAACA,CAACA,EAAEA,CAACA,GAAGA,CAACA,UAAUA,CAACA,UAAUA,GAAGA,QAAQA,CAACA,UAAUA,CAACA,GAACA,CAACA,GAAGA,GAACA,CAACA,CAACA;wBAC3EA,IAAIA,CAACA,SAASA,CAACA,CAACA,EAAEA,CAACA,GAAGA,CAACA,UAAUA,CAACA,WAAWA,GAAGA,QAAQA,CAACA,WAAWA,CAACA,GAACA,CAACA,GAAGA,GAACA,CAACA,CAACA;wBAC7EA,IAAIA,CAACA,SAASA,CAACA,CAACA,EAAEA,CAACA,GAAGA,CAACA,UAAUA,CAACA,SAASA,GAAGA,QAAQA,CAACA,SAASA,CAACA,GAACA,CAACA,GAAGA,GAACA,CAACA,CAACA;wBACzEA,IAAIA,CAACA,SAASA,CAACA,CAACA,EAAEA,CAACA,GAAGA,CAACA,UAAUA,CAACA,WAAWA,GAAGA,QAAQA,CAACA,WAAWA,CAACA,GAACA,CAACA,GAAGA,GAACA,CAACA,CAACA;wBAC7EA,IAAIA,CAACA,SAASA,CAACA,CAACA,EAAEA,CAACA,GAAGA,CAACA,UAAUA,CAACA,UAAUA,GAAGA,QAAQA,CAACA,UAAUA,CAACA,GAACA,CAACA,GAAGA,GAACA,CAACA,CAACA;wBAC3EA,IAAIA,CAACA,SAASA,CAACA,CAACA,EAAEA,CAACA,GAAGA,CAACA,UAAUA,CAACA,WAAWA,GAAGA,QAAQA,CAACA,WAAWA,CAACA,GAACA,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AWA,CAACA,eAAeA,CAACA,GAACA,CAACA,CAACA;yBAC9TA;;wBAEDA,IAAIA,IAAIA,CAACA,WAAWA,CAAEA;4BACrBA,IAAIA,CAACA,gBAAgBA,GAAGA,IAAIA,QAAQA,CAACA,CAACA,IAAIA,CAACA,WAAWA,CAACA,SAASA,GAAGA,IAAIA,CAACA,SAASA,CAACA,SAASA,CAACA,GAACA,CAACA,GAAGA,GAACA,CAACA,CAACA,EAAEA,CAACA,IAAIA,CAACA,WAAWA,CAACA,WAAWA,GAAGA,IAAIA,CAACA,SAASA,CAACA,WAAWA,CAACA,GAACA,CAACA,GAAGA,GAACA,CAACA,CAACA,EAAEA,CAACA,IAAIA,CAACA,WAAWA,CAACA,UAAUA,GAAGA,IAAIA,CAACA,SAASA,CAACA,UAAUA,CAACA,GAACA,CAACA,GAAGA,GAACA,CAACA,CAACA,EAAEA,CAACA,IAAIA,CAACA,WAAWA,CAACA,WAAWA,GAAGA,IAAIA,CAACA,SAASA,CAACA,WAAWA,CAACA,GAACA,CAACA,GAAGA,GAACA,CAACA,CAACA,CAACA;4BAClTA,IAAIA,CAACA,gBAAgBA,GAAGA,IAAIA,QAAQA,CAACA,CAACA,IAAIA,CAACA,SAASA,CAACA,SAASA,GAAGA,IAAIA,CAACA,WAAWA,CAACA,SAASA,CAACA,GAACA,CAACA,GAAGA,GAACA,CAACA,CAACA,EAAEA,CAACA,IAAIA,CAACA,SAASA,CAACA,WAAWA,GAAGA,IAAIA,CAACA,WAAWA,CAACA,WAAWA,CAACA,GAACA,CAACA,GAAGA,GAACA,CAACA,CAACA,EAAEA,CAACA,IAAIA,CAACA,SAASA,CAACA,UAAUA,GAAGA,IAAIA,CAACA,WAAWA,CAACA,UAAUA,CAACA,GAACA,CAACA,GAAGA,GAACA,CAACA,CAACA,EAAEA,CAACA,IAAIA,CAACA,SAASA,CAACA,WAAWA,GAAGA,IAAIA,CAACA,WAAWA,CAACA,WAAWA,CAACA,GAACA,CAACA,GAAGA,GAACA,CAAC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AGA,IAAIA,CAACA,gBAAgBA,EAAEA,CAACA,EAAEA,CAAEA;wBAC3CA,IAAIA,CAACA,IAAIA,CAACA;4BACTA,IAAIA,CAACA,eAAeA,CAACA,IAAIA,CAACA,CAACA,IAAIA,CAACA,cAAcA,CAACA,CAACA,CAACA,CAACA,KAAKA,CAACA,aAAaA,GAAGA,IAAIA,CAACA,WAAWA,CAACA,aAAaA,CAACA,GAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,CAACA,EAAEA,CAACA,IAAIA,CAACA,cAAcA,CAACA,CAACA,CAACA,CAACA,KAAKA,CAACA,eAAeA,GAAGA,IAAIA,CAACA,WAAWA,CAACA,eAAeA,CAACA,GAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,CAACA,EAAEA,CAACA,IAAIA,CAACA,cAAcA,CAACA,CAACA,CAACA,CAACA,KAAKA,CAACA,cAAcA,GAAGA,IAAIA,CAACA,WAAWA,CAACA,cAAcA,CAACA,GAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,CAACA,EAAEA,CAACA,IAAIA,CAACA,cAAcA,CAACA,CAACA,CAACA,CAACA,KAAKA,CAACA,eAAeA,GAAGA,IAAIA,CAACA,WAAWA,CAACA,eAAeA,CAACA,GAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,CAACA,CAACA;;4BAEvbA,IAAIA,CAACA,eAAeA,CAACA,IAAIA,CAACA,CAACA,IAAIA,CAACA,cAAcA,CAACA,CAACA,CAACA,CAACA,KAAKA,CAACA,aAAaA,GAAGA,IAAIA,CAACA,cAAcA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,KAAKA,CAACA,aAAaA,CAACA,GAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,CAACA,EAAEA,CAACA,IAAIA,CAACA,cAAcA,CAACA,CAACA,CAACA,CAACA,KAAKA,CAACA,eAAeA,GAAGA,IAAIA,CAACA,cAAcA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,KAAKA,CAACA,eA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ACA,GAAGA,CAACA,CAACA,CAACA,KAAKA,CAACA,eAAeA,CAACA,GAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,CAACA,EAAEA,CAACA,IAAIA,CAACA,SAASA,CAACA,cAAcA,GAAGA,IAAIA,CAACA,cAAcA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,KAAKA,CAACA,cAAcA,CAACA,GAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,CAACA,EAAEA,CAACA,IAAIA,CAACA,SAASA,CAACA,eAAeA,GAAGA,IAAIA,CAACA,cAAcA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,KAAKA,CAACA,eAAeA,CAACA,GAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,CAACA,CAACA,CAACA;iBACjcA;;gBAEDA,IAAIA,IAAIA,CAACA,WAAWA,CAAEA;oBACrBA,IAAIA,CAACA,WAAWA,CAACA,IAAIA,CAACA,IAAIA,CAACA,WAAWA,CAACA,SAASA,GAACA,GAAGA,EAAEA,IAAIA,CAACA,WAAWA,CAACA,WAAWA,GAACA,GAAGA,EAAEA,IAAIA,CAACA,WAAWA,CAACA,UAAUA,GAACA,GAAGA,EAAEA,IAAIA,CAACA,WAAWA,CAACA,WAAWA,GAACA,GAAGA,CAACA;oBAC1JA,KAAKA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,IAAIA,CAACA,gBAAgBA,EAAEA,CAACA,EAAEA,CAAEA;wBAC3CA,IAAIA,CAACA,IAAIA,CAACA;4BACTA,IAAIA,CAACA,WAAWA,CAACA,IAAIA,CAACA,CAACA,IAAIA,CAACA,cAAcA,CAACA,CAACA,CAACA,CAACA,KAAKA,CAACA,SAASA,GAAGA,IAAIA,CAACA,WAAWA,CAACA,SAASA,CAACA,GAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,CAACA,GAACA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,cAAcA,CAACA,CAACA,CAACA,CAACA,KAAKA,CAACA,WAAWA,GAAGA,IAAIA,CAACA,WAAWA,CAACA,WAAWA,CAACA,GAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,CAACA,GAACA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,cAAcA,CAACA,CAACA,CAACA,CAACA,KAAKA,CAACA,UAAUA,GAAGA,IAAIA,CAACA,WAAWA,CAACA,UAAUA,CAACA,GAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,CAACA,GAACA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,cAAcA,CAACA,CAACA,CAACA,CAACA,KAAKA,CAACA,WAAWA,GAAGA,IAAIA,CAACA,WAAWA,CAACA,WAAWA,CAACA,GAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,CAACA,GAACA,GAAGA,CAACA;;4BAEnaA,IAAIA,CAACA,WAAWA,CAACA,IAAIA,CAACA,CAACA,IAAIA,CAACA,cAAcA,CAACA,CAACA,CAACA,CAACA,KAAKA,CAACA,SAASA,GAAGA,IAAIA,CAACA,cAAcA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,KAAKA,CAACA,SAASA,CAACA,GAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,CAACA,GAACA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,cAAcA,CAACA,CAACA,CAACA,CAACA,KAAKA,CAACA,WAAWA,GAAGA,IAAIA,CAACA,cAAcA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,KAAKA,CAACA,WAAWA,CAACA,GAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,CAACA,GAACA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,cAAcA,CAACA,CAACA,CAACA,CAACA,KAAKA,CAACA,UAAUA,GAAGA,IAAIA,CAACA,cAAcA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,KAAKA,CAACA,UAAUA,CAACA,GAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,CAACA,GAACA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,cAAcA,CAACA,CAACA,CAACA,CAACA,KAAKA,CAACA,WAAWA,GAAGA,IAAIA,CAACA,cAAcA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,KAAKA,CAACA,WAAWA,CAACA,GAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,CAACA,GAACA,GAAGA,CAACA,CAACA;qBACreA;oBACDA,IAAIA,IAAIA,CAACA,gBAAgBA,IAAIA,CAACA;wBAC7BA,IAAIA,CAACA,WAAWA,CAACA,IAAIA,CAACA,CAACA,IAAIA,CAACA,SAASA,CAACA,SAASA,GAAGA,IAAIA,CAACA,WAAWA,CAACA,SAASA,CAACA,GAACA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,SAASA,CAACA,WAAWA,GAAGA,IAAIA,CAACA,WAAWA,CAACA,WAAWA,CAACA,GAACA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,SAASA,CAACA,UAAUA,GAAGA,IAAIA,CAACA,WAAWA,CAACA,UAAUA,CAACA,GAACA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,SAASA,CAACA,WAAWA,GAAGA,IAAIA,CAACA,WAAWA,CAACA,WAAWA,CAACA,GAACA,GAAGA,CAACA;;wBAEnRA,IAAIA,CAACA,WAAWA,CAACA,IAAIA,CAACA,CAACA,IAAIA,CAACA,SAASA,CAACA,SAASA,GAAGA,IAAIA,CAACA,cAAcA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,KAAKA,CAACA,SAASA,CAACA,GAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,CAACA,GAACA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,SAASA,CAACA,WAAWA,GAAGA,IAAIA,CAACA,cAAcA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,KAAKA,CAACA,WAAWA,CAACA,GAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,CAACA,GAACA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,SAASA,CAACA,UAAUA,GAAGA,IAAIA,CAACA,c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AACA,CAACA,CAACA,CAACA;oCAEhBA,KAAKA,IAAIA;wCACRA,IAAIA,KAAKA,CAACA,CAACA,CAACA,IAAIA,CAACA,KAAKA,CAACA,MAAMA,CAACA,KAAKA,CAACA,CAACA,CAACA,CAACA,CAACA,IAAIA,KAAKA,CAACA,CAACA,CAACA,IAAIA,CAACA,KAAKA,CAACA,MAAMA,CAACA,KAAKA,CAACA,CAACA,CAACA,CAACA,CAACA,IAAIA,KAAKA,CAACA,CAACA,CAACA,IAAIA,CAACA,KAAKA,CAACA,MAAMA,CAACA,KAAKA,CAACA,CAACA,CAACA,CAACA,CAACA;4CACvHA,KAAKA,GAAGA,KAAKA,CAACA,CAACA,CAACA,GAACA,GAAGA,IAAIA,EAAEA,GAAGA,KAAKA,CAACA,CAACA,CAACA,GAACA,GAAGA,IAAIA,CAACA,GAAGA,KAAKA,CAACA,CAACA,CAACA,GAACA,GAAGA,CAACA;wCAC/DA,KAAMA;AAAAA;oCAEPA,KAAKA,IAAIA;wCACRA,IAAIA,KAAKA,CAACA,CAACA,CAACA,IAAIA,CAACA,KAAKA,CAACA,MAAMA,CAACA,KAAKA,CAACA,CAACA,CAACA,CAACA,CAACA,IAAIA,KAAKA,CAACA,CAACA,CAACA,IAAIA,CAACA,KAAKA,CAACA,MAAMA,CAACA,KAAKA,CAACA,CAACA,CAACA,CAACA,CAACA,IAAIA,KAAKA,CAACA,CAACA,CAACA,IAAIA,CAACA,KAAKA,CAACA,MAAMA,CAACA,KAAKA,CAACA,CAACA,CAACA,CAACA,CAACA,CAAEA;4CACzHA,aAAaA,GAAGA,KAAKA,CAACA,CAACA,CAACA,GAACA,GAAGA,IAAIA,EAAEA,GAAGA,KAAKA,CAACA,CAACA,CAACA,GAACA,GAAGA,IAAIA,CAACA,GAAGA,KAAKA,CAACA,CAACA,CAACA,GAACA,GAAGA;4CACrEA,WAAWA,GAAGA,IAAIA;yCAClBA;wCACDA,KAAMA;AAAAA;oCAEPA,KAAKA,IAAIA;wCACRA,IA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KA,CAASA,EAAEA,CAACA;;gBAE5BA,SAASA;gBACTA,IAAIA,CAACA,CAACA,CAACA,GAAGA,IAAIA,CAACA,SAASA,CAACA,SAASA,CAACA,CAACA,EAAEA,IAAIA;gBAC1CA,IAAIA,CAACA,CAACA,CAACA,GAAGA,IAAIA,CAACA,SAASA,CAACA,SAASA,CAACA,CAACA,EAAEA,IAAIA;gBAC1CA,IAAIA,CAACA,CAACA,CAACA,GAAGA,IAAIA,CAACA,SAASA,CAACA,SAASA,CAACA,CAACA,EAAEA,IAAIA;gBAC1CA,IAAIA,CAACA,CAACA,CAACA,GAAGA,CAACA;;gBAEXA,SAASA;gBACTA,IAAIA,CAACA,CAACA,CAACA,GAAGA,IAAIA,CAACA,SAASA,CAACA,SAASA,CAACA,CAACA,EAAEA,IAAIA;gBAC1CA,IAAIA,CAACA,EAAEA,CAACA,GAAGA,IAAIA,CAACA,SAASA,CAACA,SAASA,CAACA,CAACA,EAAEA,IAAIA;gBAC3CA,IAAIA,CAACA,CAACA,CAACA,GAAGA,IAAIA,CAACA,SAASA,CAACA,SAASA,CAACA,CAACA,EAAEA,IAAIA;gBAC1CA,IAAIA,CAACA,EAAEA,CAACA,GAAGA,CAACA;;gBAEZA,SAASA;gBACTA,IAAIA,CAACA,CAACA,CAACA,GAAGA,IAAIA,CAACA,SAASA,CAACA,SAASA,CAACA,CAACA,EAAEA,IAAIA;gBAC1CA,IAAIA,CAACA,CAACA,CAACA,GAAGA,IAAIA,CAACA,SAASA,CAACA,SAASA,CAACA,CAACA,EAAEA,IAAIA;gBAC1CA,IAAIA,CAACA,CAACA,CAACA,GAAGA,IAAIA,CAACA,SAASA,CAACA,SAASA,CAACA,CAACA,EAAEA,IAAIA;gBAC1CA,IAAIA,CAACA,CAACA,CAACA,GAAGA,CAACA;;gBAEXA,cAAcA;gBACdA,IAAIA,CAACA,EAAEA,CAACA,GAAGA,IAAIA,CAACA,SAASA,CAACA,SAASA,CAACA,CAACA,EAAEA,IAAIA;gBAC3C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,CAACA,SAASA,CAACA,SAASA,CAACA,CAACA;oBAC/BA,EAAEA,GAAGA,IAAIA,CAACA,SAASA,CAACA,SAASA,CAACA,CAACA;oBAC/BA,EAAEA,GAAGA,IAAIA,CAACA,SAASA,CAACA,SAASA,CAACA,CAACA;;oBAE/BA,EAAEA,GAAGA,IAAIA,CAACA,SAASA,CAACA,SAASA,CAACA,CAACA;oBAC/BA,EAAEA,GAAGA,IAAIA,CAACA,SAASA,CAACA,SAASA,CAACA,CAACA;oBAC/BA,EAAEA,GAAGA,IAAIA,CAACA,SAASA,CAACA,SAASA,CAACA,CAACA;;oBAE/BA,IAAIA,GAAGA,IAAIA,CAACA,aAAaA,CAACA,CAACA;;oBAI3BA,KAAKA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,IAAIA,CAACA,YAAYA,EAAEA,CAACA,EAAEA,EAAEA,IAAIA,CAACA,SAASA,CAACA,QAAQA,EAAEA;wBAChEA,SAASA,CAACA,IAAIA,CAACA,EAAEA,GAACA,IAAIA,CAACA,SAASA,CAACA,gBAAgBA,CAACA,CAACA,GAAGA,EAAEA,EAAEA,EAAEA,GAACA,IAAIA,CAACA,SAASA,CAACA,gBAAgBA,CAACA,CAACA,GAAGA,EAAEA,EAAEA,EAAEA,GAACA,IAAIA,CAACA,SAASA,CAACA,gBAAgBA,CAACA,CAACA,GAAGA,EAAEA,CAACA,CAACA;;oBAEjJA,CAACA,GAAGA,CAACA;oBACLA,KAAKA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,OAAOA,EAAEA,CAACA,EAAEA,CAAEA;wBAC7BA,SAASA,CAACA,CAACA,EAAEA,CAACA,GAAGA,SAASA,CAACA,IAAIA,CAACA,YAAYA,CAACA,CAACA,CAACA,GAACA,CAACA,CAACA;wBAClDA,SAASA,CAACA,CAACA,EAAEA,CAACA,GAAGA,SAASA,CAACA,IAAIA,CAACA,YAAYA,CAACA,CAACA,CAACA,GAACA,CAACA,GAAGA,CAACA,CAACA;wBACt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--git a/build/stagegl-extensions.next.min.js b/build/stagegl-extensions.next.min.js deleted file mode 100644 index 3789dffa4..000000000 --- a/build/stagegl-extensions.next.min.js +++ /dev/null @@ -1,15 +0,0 @@ -var __extends=this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);__.prototype=b.prototype,d.prototype=new __},away;!function(away){!function(events){var AnimationStateEvent=function(_super){function AnimationStateEvent(type,animator,animationState,animationNode){_super.call(this,type),this._animator=animator,this._animationState=animationState,this._animationNode=animationNode}return __extends(AnimationStateEvent,_super),Object.defineProperty(AnimationStateEvent.prototype,"animator",{get:function(){return this._animator},enumerable:!0,configurable:!0}),Object.defineProperty(AnimationStateEvent.prototype,"animationState",{get:function(){return this._animationState},enumerable:!0,configurable:!0}),Object.defineProperty(AnimationStateEvent.prototype,"animationNode",{get:function(){return this._animationNode},enumerable:!0,configurable:!0}),AnimationStateEvent.prototype.clone=function(){return new AnimationStateEvent(this.type,this._animator,this._animationState,this._animationNode)},AnimationStateEvent.PLAYBACK_COMPLETE="playbackComplete",AnimationStateEvent.TRANSITION_COMPLETE="transitionComplete",AnimationStateEvent}(events.Event);events.AnimationStateEvent=AnimationStateEvent}(away.events||(away.events={})),away.events}(away||(away={}));var away;!function(away){!function(base){var ParticleGeometry=function(_super){function ParticleGeometry(){_super.apply(this,arguments)}return __extends(ParticleGeometry,_super),ParticleGeometry}(base.Geometry);base.ParticleGeometry=ParticleGeometry}(away.base||(away.base={})),away.base}(away||(away={}));var away;!function(away){!function(pick){var PickingColliderBase=function(){function PickingColliderBase(){this._billboardRenderablePool=away.pool.RenderablePool.getPool(away.pool.BillboardRenderable),this._subMeshRenderablePool=away.pool.RenderablePool.getPool(away.pool.TriangleSubMeshRenderable)}return PickingColliderBase.prototype._pPetCollisionNormal=function(indexData,vertexData,triangleIndex){var normal=new away.geom.Vector3D,i0=3*indexData[triangleIndex],i1=3*indexData[triangleIndex+1],i2=3*indexData[triangleIndex+2],p0=new away.geom.Vector3D(vertexData[i0],vertexData[i0+1],vertexData[i0+2]),p1=new away.geom.Vector3D(vertexData[i1],vertexData[i1+1],vertexData[i1+2]),p2=new away.geom.Vector3D(vertexData[i2],vertexData[i2+1],vertexData[i2+2]),side0=p1.subtract(p0),side1=p2.subtract(p0);return normal=side0.crossProduct(side1),normal.normalize(),normal},PickingColliderBase.prototype._pGetCollisionUV=function(indexData,uvData,triangleIndex,v,w,u,uvOffset,uvStride){var uv=new away.geom.Point,uIndex=indexData[triangleIndex]*uvStride+uvOffset,uv0=new away.geom.Vector3D(uvData[uIndex],uvData[uIndex+1]);uIndex=indexData[triangleIndex+1]*uvStride+uvOffset;var uv1=new away.geom.Vector3D(uvData[uIndex],uvData[uIndex+1]);uIndex=indexData[triangleIndex+2]*uvStride+uvOffset;var uv2=new away.geom.Vector3D(uvData[uIndex],uvData[uIndex+1]);return uv.x=u*uv0.x+v*uv1.x+w*uv2.x,uv.y=u*uv0.y+v*uv1.y+w*uv2.y,uv},PickingColliderBase.prototype._pTestRenderableCollision=function(){throw new away.errors.AbstractMethodError},PickingColliderBase.prototype.setLocalRay=function(localPosition,localDirection){this.rayPosition=localPosition,this.rayDirection=localDirection},PickingColliderBase.prototype.testBillboardCollision=function(billboard,pickingCollisionVO,shortestCollisionDistance){return this.setLocalRay(pickingCollisionVO.localRayPosition,pickingCollisionVO.localRayDirection),pickingCollisionVO.materialOwner=null,this._pTestRenderableCollision(this._billboardRenderablePool.getItem(billboard),pickingCollisionVO,shortestCollisionDistance)?(shortestCollisionDistance=pickingCollisionVO.rayEntryDistance,pickingCollisionVO.materialOwner=billboard,!0):!1},PickingColliderBase.prototype.testMeshCollision=function(mesh,pickingCollisionVO,shortestCollisionDistance,findClosest){this.setLocalRay(pickingCollisionVO.localRayPosition,pickingCollisionVO.localRayDirection),pickingCollisionVO.materialOwner=null;for(var subMesh,len=mesh.subMeshes.length,i=0;len>i;++i)if(subMesh=mesh.subMeshes[i],this._pTestRenderableCollision(this._subMeshRenderablePool.getItem(subMesh),pickingCollisionVO,shortestCollisionDistance)&&(shortestCollisionDistance=pickingCollisionVO.rayEntryDistance,pickingCollisionVO.materialOwner=subMesh,!findClosest))return!0;return null!=pickingCollisionVO.materialOwner},PickingColliderBase}();pick.PickingColliderBase=PickingColliderBase}(away.pick||(away.pick={})),away.pick}(away||(away={}));var away;!function(away){!function(pick){var SubGeometry=away.base.TriangleSubGeometry,JSPickingCollider=function(_super){function JSPickingCollider(findClosestCollision){"undefined"==typeof findClosestCollision&&(findClosestCollision=!1),_super.call(this),this._findClosestCollision=findClosestCollision}return __extends(JSPickingCollider,_super),JSPickingCollider.prototype._pTestRenderableCollision=function(renderable,pickingCollisionVO,shortestCollisionDistance){for(var t,i0,i1,i2,rx,ry,rz,nx,ny,nz,cx,cy,cz,coeff,u,v,w,p0x,p0y,p0z,p1x,p1y,p1z,p2x,p2y,p2z,s0x,s0y,s0z,s1x,s1y,s1z,nl,nDotV,D,disToPlane,Q1Q2,Q1Q1,Q2Q2,RQ1,RQ2,indexData=renderable.getIndexData().data,collisionTriangleIndex=-1,bothSides=renderable.materialOwner.material.bothSides,positionData=renderable.getVertexData(SubGeometry.POSITION_DATA).data,positionStride=renderable.getVertexData(SubGeometry.POSITION_DATA).dataPerVertex,positionOffset=renderable.getVertexOffset(SubGeometry.POSITION_DATA),uvData=renderable.getVertexData(SubGeometry.UV_DATA).data,uvStride=renderable.getVertexData(SubGeometry.UV_DATA).dataPerVertex,uvOffset=renderable.getVertexOffset(SubGeometry.UV_DATA),numIndices=indexData.length,index=0;numIndices>index;index+=3)if(i0=positionOffset+indexData[index]*positionStride,i1=positionOffset+indexData[index+1]*positionStride,i2=positionOffset+indexData[index+2]*positionStride,p0x=positionData[i0],p0y=positionData[i0+1],p0z=positionData[i0+2],p1x=positionData[i1],p1y=positionData[i1+1],p1z=positionData[i1+2],p2x=positionData[i2],p2y=positionData[i2+1],p2z=positionData[i2+2],s0x=p1x-p0x,s0y=p1y-p0y,s0z=p1z-p0z,s1x=p2x-p0x,s1y=p2y-p0y,s1z=p2z-p0z,nx=s0y*s1z-s0z*s1y,ny=s0z*s1x-s0x*s1z,nz=s0x*s1y-s0y*s1x,nl=1/Math.sqrt(nx*nx+ny*ny+nz*nz),nx*=nl,ny*=nl,nz*=nl,nDotV=nx*this.rayDirection.x+ny*+this.rayDirection.y+nz*this.rayDirection.z,!bothSides&&0>nDotV||bothSides&&0!=nDotV){if(D=-(nx*p0x+ny*p0y+nz*p0z),disToPlane=-(nx*this.rayPosition.x+ny*this.rayPosition.y+nz*this.rayPosition.z+D),t=disToPlane/nDotV,cx=this.rayPosition.x+t*this.rayDirection.x,cy=this.rayPosition.y+t*this.rayDirection.y,cz=this.rayPosition.z+t*this.rayDirection.z,Q1Q2=s0x*s1x+s0y*s1y+s0z*s1z,Q1Q1=s0x*s0x+s0y*s0y+s0z*s0z,Q2Q2=s1x*s1x+s1y*s1y+s1z*s1z,rx=cx-p0x,ry=cy-p0y,rz=cz-p0z,RQ1=rx*s0x+ry*s0y+rz*s0z,RQ2=rx*s1x+ry*s1y+rz*s1z,coeff=1/(Q1Q1*Q2Q2-Q1Q2*Q1Q2),v=coeff*(Q2Q2*RQ1-Q1Q2*RQ2),w=coeff*(-Q1Q2*RQ1+Q1Q1*RQ2),0>v)continue;if(0>w)continue;if(u=1-v-w,!(0>u)&&t>0&&shortestCollisionDistance>t&&(shortestCollisionDistance=t,collisionTriangleIndex=index/3,pickingCollisionVO.rayEntryDistance=t,pickingCollisionVO.localPosition=new away.geom.Vector3D(cx,cy,cz),pickingCollisionVO.localNormal=new away.geom.Vector3D(nx,ny,nz),pickingCollisionVO.uv=this._pGetCollisionUV(indexData,uvData,index,v,w,u,uvOffset,uvStride),pickingCollisionVO.index=index,!this._findClosestCollision))return!0}return collisionTriangleIndex>=0?!0:!1},JSPickingCollider}(pick.PickingColliderBase);pick.JSPickingCollider=JSPickingCollider}(away.pick||(away.pick={})),away.pick}(away||(away={}));var away;!function(away){!function(pick){var BitmapData=away.base.BitmapData,TriangleSubGeometry=away.base.TriangleSubGeometry,Matrix3DUtils=away.geom.Matrix3DUtils,Point=away.geom.Point,Rectangle=away.geom.Rectangle,Vector3D=away.geom.Vector3D,ContextGLBlendFactor=away.stagegl.ContextGLBlendFactor,ContextGLClearMask=away.stagegl.ContextGLClearMask,ContextGLCompareMode=away.stagegl.ContextGLCompareMode,ContextGLProgramType=away.stagegl.ContextGLProgramType,ContextGLTriangleFace=away.stagegl.ContextGLTriangleFace,ShaderPicker=function(){function ShaderPicker(shaderPickingDetails){"undefined"==typeof shaderPickingDetails&&(shaderPickingDetails=!1),this._onlyMouseEnabled=!0,this._interactives=new Array,this._localHitPosition=new Vector3D,this._hitUV=new Point,this._localHitNormal=new Vector3D,this._rayPos=new Vector3D,this._rayDir=new Vector3D,this._shaderPickingDetails=shaderPickingDetails,this._id=new Array(4),this._viewportData=new Array(4),this._boundOffsetScale=new Array(8),this._boundOffsetScale[3]=0,this._boundOffsetScale[7]=1}return Object.defineProperty(ShaderPicker.prototype,"onlyMouseEnabled",{get:function(){return this._onlyMouseEnabled},set:function(value){this._onlyMouseEnabled=value},enumerable:!0,configurable:!0}),ShaderPicker.prototype.getViewCollision=function(x,y,view){var collector=view.iEntityCollector;if(this._stage=view.renderer.stage,!this._stage)return null;if(this._context=this._stage.context,this._viewportData[0]=view.width,this._viewportData[1]=view.height,this._viewportData[2]=-(this._projX=2*x/view.width-1),this._viewportData[3]=this._projY=2*y/view.height-1,this._potentialFound=!1,this._blendedRenderableHead=null,this._opaqueRenderableHead=null,this.pDraw(collector,null),this._context.setVertexBufferAt(0,null),!this._context||!this._potentialFound)return null;if(this._bitmapData||(this._bitmapData=new BitmapData(1,1,!1,0)),this._context.drawToBitmapData(this._bitmapData),this._hitColor=this._bitmapData.getPixel(0,0),!this._hitColor)return this._context.present(),null;if(this._hitRenderable=this._interactives[this._hitColor-1],this._hitEntity=this._hitRenderable.sourceEntity,this._onlyMouseEnabled&&!this._hitEntity._iIsMouseEnabled())return null;var _collisionVO=this._hitEntity._iPickingCollisionVO;return this._shaderPickingDetails?(this.getHitDetails(view.camera),_collisionVO.localPosition=this._localHitPosition,_collisionVO.localNormal=this._localHitNormal,_collisionVO.uv=this._hitUV,_collisionVO.index=this._faceIndex):(_collisionVO.localPosition=null,_collisionVO.localNormal=null,_collisionVO.uv=null,_collisionVO.index=0),_collisionVO},ShaderPicker.prototype.getSceneCollision=function(){return null},ShaderPicker.prototype.pDraw=function(entityCollector){entityCollector.camera,this._context.clear(0,0,0,1),this._stage.scissorRect=ShaderPicker.MOUSE_SCISSOR_RECT,this._interactives.length=this._interactiveId=0,this._objectProgram||this.initObjectProgram(),this._context.setBlendFactors(ContextGLBlendFactor.ONE,ContextGLBlendFactor.ZERO),this._context.setDepthTest(!0,ContextGLCompareMode.LESS),this._context.setProgram(this._objectProgram),this._context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX,4,this._viewportData,1)},ShaderPicker.prototype.drawRenderables=function(renderable,camera){for(var matrix=Matrix3DUtils.CALCULATION_MATRIX,viewProjection=camera.viewProjection;renderable;)renderable.sourceEntity.scene&&renderable.sourceEntity._iIsMouseEnabled()?(this._potentialFound=!0,this._context.setCulling(renderable.materialOwner.material.bothSides?ContextGLTriangleFace.NONE:ContextGLTriangleFace.BACK,camera.projection.coordinateSystem),this._interactives[this._interactiveId++]=renderable,this._id[1]=(this._interactiveId>>8)/255,this._id[2]=(255&this._interactiveId)/255,matrix.copyFrom(renderable.sourceEntity.getRenderSceneTransform(camera)),matrix.append(viewProjection),this._context.setProgramConstantsFromMatrix(ContextGLProgramType.VERTEX,0,matrix,!0),this._context.setProgramConstantsFromArray(ContextGLProgramType.FRAGMENT,0,this._id,1),this._context.activateBuffer(0,renderable.getVertexData(TriangleSubGeometry.POSITION_DATA),renderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA),TriangleSubGeometry.POSITION_FORMAT),this._context.drawTriangles(this._context.getIndexBuffer(renderable.getIndexData()),0,renderable.numTriangles),renderable=renderable.next):renderable=renderable.next},ShaderPicker.prototype.updateRay=function(camera){this._rayPos=camera.scenePosition,this._rayDir=camera.getRay(this._projX,this._projY,1),this._rayDir.normalize()},ShaderPicker.prototype.initObjectProgram=function(){var vertexCode,fragmentCode;this._objectProgram=this._context.createProgram(),vertexCode="m44 vt0, va0, vc0 \nmul vt1.xy, vt0.w, vc4.zw \nadd vt0.xy, vt0.xy, vt1.xy \nmul vt0.xy, vt0.xy, vc4.xy \nmov op, vt0 \n",fragmentCode="mov oc, fc0",away.Debug.throwPIR("ShaderPicker","initTriangleProgram","Dependency: initObjectProgram")},ShaderPicker.prototype.initTriangleProgram=function(){var vertexCode,fragmentCode;this._triangleProgram=this._context.createProgram(),vertexCode="add vt0, va0, vc5 \nmul vt0, vt0, vc6 \nmov v0, vt0 \nm44 vt0, va0, vc0 \nmul vt1.xy, vt0.w, vc4.zw \nadd vt0.xy, vt0.xy, vt1.xy \nmul vt0.xy, vt0.xy, vc4.xy \nmov op, vt0 \n",fragmentCode="mov oc, v0";var vertexByteCode=(new aglsl.assembler.AGALMiniAssembler).assemble("part vertex 1\n"+vertexCode+"endpart").vertex.data,fragmentByteCode=(new aglsl.assembler.AGALMiniAssembler).assemble("part fragment 1\n"+fragmentCode+"endpart").fragment.data;this._triangleProgram.upload(vertexByteCode,fragmentByteCode)},ShaderPicker.prototype.getHitDetails=function(camera){this.getApproximatePosition(camera),this.getPreciseDetails(camera)},ShaderPicker.prototype.getApproximatePosition=function(camera){var col,scX,scY,scZ,offsX,offsY,offsZ,bounds=this._hitRenderable.sourceEntity.bounds.aabb,localViewProjection=Matrix3DUtils.CALCULATION_MATRIX;localViewProjection.copyFrom(this._hitRenderable.sourceEntity.getRenderSceneTransform(camera)),localViewProjection.append(camera.viewProjection),this._triangleProgram||this.initTriangleProgram(),this._boundOffsetScale[4]=1/(scX=bounds.width),this._boundOffsetScale[5]=1/(scY=bounds.height),this._boundOffsetScale[6]=1/(scZ=bounds.depth),this._boundOffsetScale[0]=offsX=-bounds.x,this._boundOffsetScale[1]=offsY=-bounds.y,this._boundOffsetScale[2]=offsZ=-bounds.z,this._context.setProgram(this._triangleProgram),this._context.clear(0,0,0,0,1,0,ContextGLClearMask.DEPTH),this._context.setScissorRectangle(ShaderPicker.MOUSE_SCISSOR_RECT),this._context.setProgramConstantsFromMatrix(ContextGLProgramType.VERTEX,0,localViewProjection,!0),this._context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX,5,this._boundOffsetScale,2),this._context.activateBuffer(0,this._hitRenderable.getVertexData(TriangleSubGeometry.POSITION_DATA),this._hitRenderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA),TriangleSubGeometry.POSITION_FORMAT),this._context.drawTriangles(this._context.getIndexBuffer(this._hitRenderable.getIndexData()),0,this._hitRenderable.numTriangles),this._context.drawToBitmapData(this._bitmapData),col=this._bitmapData.getPixel(0,0),this._localHitPosition.x=(255&col>>16)*scX/255-offsX,this._localHitPosition.y=(255&col>>8)*scY/255-offsY,this._localHitPosition.z=(255&col)*scZ/255-offsZ},ShaderPicker.prototype.getPreciseDetails=function(camera){var x1,y1,z1,x2,y2,z2,x3,y3,z3,t1,t2,t3,v0x,v0y,v0z,v1x,v1y,v1z,v2x,v2y,v2z,ni1,ni2,ni3,n1,n2,n3,nLength,dot00,dot01,dot02,dot11,dot12,s,t,invDenom,u,v,ui1,ui2,ui3,s0x,s0y,s0z,s1x,s1y,s1z,nl,len=indices.length,i=0,j=1,k=2,x=this._localHitPosition.x,y=this._localHitPosition.y,z=this._localHitPosition.z,indices=this._hitRenderable.getIndexData().data,positions=this._hitRenderable.getVertexData(TriangleSubGeometry.POSITION_DATA).data,positionStride=this._hitRenderable.getVertexData(TriangleSubGeometry.POSITION_DATA).dataPerVertex,positionOffset=this._hitRenderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA),uvs=this._hitRenderable.getVertexData(TriangleSubGeometry.UV_DATA).data,uvStride=this._hitRenderable.getVertexData(TriangleSubGeometry.UV_DATA).dataPerVertex,uvOffset=this._hitRenderable.getVertexOffset(TriangleSubGeometry.UV_DATA);this._hitRenderable.getVertexData(TriangleSubGeometry.NORMAL_DATA).data;var normalStride=this._hitRenderable.getVertexData(TriangleSubGeometry.NORMAL_DATA).dataPerVertex,normalOffset=this._hitRenderable.getVertexOffset(TriangleSubGeometry.NORMAL_DATA);for(this.updateRay(camera);len>i;){if(t1=positionOffset+indices[i]*positionStride,t2=positionOffset+indices[j]*positionStride,t3=positionOffset+indices[k]*positionStride,x1=positions[t1],y1=positions[t1+1],z1=positions[t1+2],x2=positions[t2],y2=positions[t2+1],z2=positions[t2+2],x3=positions[t3],y3=positions[t3+1],z3=positions[t3+2],!(x1>x&&x2>x&&x3>x||y1>y&&y2>y&&y3>y||z1>z&&z2>z&&z3>z||x>x1&&x>x2&&x>x3||y>y1&&y>y2&&y>y3||z>z1&&z>z2&&z>z3)&&(v0x=x3-x1,v0y=y3-y1,v0z=z3-z1,v1x=x2-x1,v1y=y2-y1,v1z=z2-z1,v2x=x-x1,v2y=y-y1,v2z=z-z1,dot00=v0x*v0x+v0y*v0y+v0z*v0z,dot01=v0x*v1x+v0y*v1y+v0z*v1z,dot02=v0x*v2x+v0y*v2y+v0z*v2z,dot11=v1x*v1x+v1y*v1y+v1z*v1z,dot12=v1x*v2x+v1y*v2y+v1z*v2z,invDenom=1/(dot00*dot11-dot01*dot01),s=(dot11*dot02-dot01*dot12)*invDenom,t=(dot00*dot12-dot01*dot02)*invDenom,s>=0&&t>=0&&1>=s+t))return ni1=normalOffset+indices[i]*normalStride,ni2=normalOffset+indices[j]*normalStride,ni3=normalOffset+indices[k]*normalStride,n1=indices[ni1]+indices[ni2]+indices[ni3],n2=indices[ni1+1]+indices[ni2+1]+indices[ni3+1],n3=indices[ni1+2]+indices[ni2+2]+indices[ni3+2],nLength=Math.sqrt(n1*n1+n2*n2+n3*n3),n1/=nLength,n2/=nLength,n3/=nLength,this.getPrecisePosition(this._hitRenderable.sourceEntity.inverseSceneTransform,n1,n2,n3,x1,y1,z1),v2x=this._localHitPosition.x-x1,v2y=this._localHitPosition.y-y1,v2z=this._localHitPosition.z-z1,s0x=x2-x1,s0y=y2-y1,s0z=z2-z1,s1x=x3-x1,s1y=y3-y1,s1z=z3-z1,this._localHitNormal.x=s0y*s1z-s0z*s1y,this._localHitNormal.y=s0z*s1x-s0x*s1z,this._localHitNormal.z=s0x*s1y-s0y*s1x,nl=1/Math.sqrt(this._localHitNormal.x*this._localHitNormal.x+this._localHitNormal.y*this._localHitNormal.y+this._localHitNormal.z*this._localHitNormal.z),this._localHitNormal.x*=nl,this._localHitNormal.y*=nl,this._localHitNormal.z*=nl,dot02=v0x*v2x+v0y*v2y+v0z*v2z,dot12=v1x*v2x+v1y*v2y+v1z*v2z,s=(dot11*dot02-dot01*dot12)*invDenom,t=(dot00*dot12-dot01*dot02)*invDenom,ui1=uvOffset+indices[i]*uvStride,ui2=uvOffset+indices[j]*uvStride,ui3=uvOffset+indices[k]*uvStride,u=uvs[ui1],v=uvs[ui1+1],this._hitUV.x=u+t*(uvs[ui2]-u)+s*(uvs[ui3]-u),this._hitUV.y=v+t*(uvs[ui2+1]-v)+s*(uvs[ui3+1]-v),this._faceIndex=i,void 0;i+=3,j+=3,k+=3}},ShaderPicker.prototype.getPrecisePosition=function(invSceneTransform,nx,ny,nz,px,py,pz){var rx,ry,rz,ox,oy,oz,t,raw=Matrix3DUtils.RAW_DATA_CONTAINER,cx=this._rayPos.x,cy=this._rayPos.y,cz=this._rayPos.z;ox=this._rayDir.x,oy=this._rayDir.y,oz=this._rayDir.z,invSceneTransform.copyRawDataTo(raw),rx=raw[0]*ox+raw[4]*oy+raw[8]*oz,ry=raw[1]*ox+raw[5]*oy+raw[9]*oz,rz=raw[2]*ox+raw[6]*oy+raw[10]*oz,ox=raw[0]*cx+raw[4]*cy+raw[8]*cz+raw[12],oy=raw[1]*cx+raw[5]*cy+raw[9]*cz+raw[13],oz=raw[2]*cx+raw[6]*cy+raw[10]*cz+raw[14],t=((px-ox)*nx+(py-oy)*ny+(pz-oz)*nz)/(rx*nx+ry*ny+rz*nz),this._localHitPosition.x=ox+rx*t,this._localHitPosition.y=oy+ry*t,this._localHitPosition.z=oz+rz*t},ShaderPicker.prototype.dispose=function(){this._bitmapData.dispose(),this._triangleProgram&&this._triangleProgram.dispose(),this._objectProgram&&this._objectProgram.dispose(),this._triangleProgram=null,this._objectProgram=null,this._bitmapData=null,this._hitRenderable=null,this._hitEntity=null},ShaderPicker.MOUSE_SCISSOR_RECT=new Rectangle(0,0,1,1),ShaderPicker}();pick.ShaderPicker=ShaderPicker}(away.pick||(away.pick={})),away.pick}(away||(away={}));var away;!function(away){!function(materials){var AmbientEnvMapMethod=function(_super){function AmbientEnvMapMethod(envMap){_super.call(this),this._cubeTexture=envMap}return __extends(AmbientEnvMapMethod,_super),AmbientEnvMapMethod.prototype.iInitVO=function(shaderObject,methodVO){_super.prototype.iInitVO.call(this,shaderObject,methodVO),methodVO.needsNormals=!0},Object.defineProperty(AmbientEnvMapMethod.prototype,"envMap",{get:function(){return this._cubeTexture},set:function(value){this._cubeTexture=value},enumerable:!0,configurable:!0}),AmbientEnvMapMethod.prototype.iActivate=function(shaderObject,methodVO,stage){_super.prototype.iActivate.call(this,shaderObject,methodVO,stage),stage.context.activateCubeTexture(methodVO.texturesIndex,this._cubeTexture)},AmbientEnvMapMethod.prototype.iGetFragmentCode=function(shaderObject,methodVO,targetReg,regCache,sharedRegisters){var ambientInputRegister,code="",cubeMapReg=regCache.getFreeTextureReg();return methodVO.texturesIndex=cubeMapReg.index,code+=materials.ShaderCompilerHelper.getTexCubeSampleCode(targetReg,cubeMapReg,this._cubeTexture,shaderObject.useSmoothTextures,shaderObject.useMipmapping,sharedRegisters.normalFragment),ambientInputRegister=regCache.getFreeFragmentConstant(),methodVO.fragmentConstantsIndex=ambientInputRegister.index,code+="add "+targetReg+".xyz, "+targetReg+".xyz, "+ambientInputRegister+".xyz\n"},AmbientEnvMapMethod}(materials.AmbientBasicMethod);materials.AmbientEnvMapMethod=AmbientEnvMapMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var ShadingMethodEvent=away.events.ShadingMethodEvent,DiffuseCompositeMethod=function(_super){function DiffuseCompositeMethod(modulateMethod,baseMethod){"undefined"==typeof baseMethod&&(baseMethod=null);var _this=this;_super.call(this),this._onShaderInvalidatedDelegate=function(event){return _this.onShaderInvalidated(event)},this.pBaseMethod=baseMethod||new materials.DiffuseBasicMethod,this.pBaseMethod._iModulateMethod=modulateMethod,this.pBaseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED,this._onShaderInvalidatedDelegate)}return __extends(DiffuseCompositeMethod,_super),Object.defineProperty(DiffuseCompositeMethod.prototype,"baseMethod",{get:function(){return this.pBaseMethod},set:function(value){this.pBaseMethod!=value&&(this.pBaseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED,this._onShaderInvalidatedDelegate),this.pBaseMethod=value,this.pBaseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED,this._onShaderInvalidatedDelegate),this.iInvalidateShaderProgram())},enumerable:!0,configurable:!0}),DiffuseCompositeMethod.prototype.iInitVO=function(shaderObject,methodVO){this.pBaseMethod.iInitVO(shaderObject,methodVO)},DiffuseCompositeMethod.prototype.iInitConstants=function(shaderObject,methodVO){this.pBaseMethod.iInitConstants(shaderObject,methodVO)},DiffuseCompositeMethod.prototype.dispose=function(){this.pBaseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED,this._onShaderInvalidatedDelegate),this.pBaseMethod.dispose()},Object.defineProperty(DiffuseCompositeMethod.prototype,"texture",{get:function(){return this.pBaseMethod.texture},set:function(value){this.pBaseMethod.texture=value},enumerable:!0,configurable:!0}),Object.defineProperty(DiffuseCompositeMethod.prototype,"diffuseColor",{get:function(){return this.pBaseMethod.diffuseColor},set:function(value){this.pBaseMethod.diffuseColor=value},enumerable:!0,configurable:!0}),Object.defineProperty(DiffuseCompositeMethod.prototype,"ambientColor",{get:function(){return this.pBaseMethod.ambientColor},set:function(value){this.pBaseMethod.ambientColor=value},enumerable:!0,configurable:!0}),DiffuseCompositeMethod.prototype.iGetFragmentPreLightingCode=function(shaderObject,methodVO,registerCache,sharedRegisters){return this.pBaseMethod.iGetFragmentPreLightingCode(shaderObject,methodVO,registerCache,sharedRegisters)},DiffuseCompositeMethod.prototype.iGetFragmentCodePerLight=function(shaderObject,methodVO,lightDirReg,lightColReg,registerCache,sharedRegisters){var code=this.pBaseMethod.iGetFragmentCodePerLight(shaderObject,methodVO,lightDirReg,lightColReg,registerCache,sharedRegisters);return this._pTotalLightColorReg=this.pBaseMethod._pTotalLightColorReg,code},DiffuseCompositeMethod.prototype.iGetFragmentCodePerProbe=function(shaderObject,methodVO,cubeMapReg,weightRegister,registerCache,sharedRegisters){var code=this.pBaseMethod.iGetFragmentCodePerProbe(shaderObject,methodVO,cubeMapReg,weightRegister,registerCache,sharedRegisters);return this._pTotalLightColorReg=this.pBaseMethod._pTotalLightColorReg,code},DiffuseCompositeMethod.prototype.iActivate=function(shaderObject,methodVO,stage){this.pBaseMethod.iActivate(shaderObject,methodVO,stage)},DiffuseCompositeMethod.prototype.iSetRenderState=function(shaderObject,methodVO,renderable,stage,camera){this.pBaseMethod.iSetRenderState(shaderObject,methodVO,renderable,stage,camera)},DiffuseCompositeMethod.prototype.iDeactivate=function(shaderObject,methodVO,stage){this.pBaseMethod.iDeactivate(shaderObject,methodVO,stage)},DiffuseCompositeMethod.prototype.iGetVertexCode=function(shaderObject,methodVO,registerCache,sharedRegisters){return this.pBaseMethod.iGetVertexCode(shaderObject,methodVO,registerCache,sharedRegisters)},DiffuseCompositeMethod.prototype.iGetFragmentPostLightingCode=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){return this.pBaseMethod.iGetFragmentPostLightingCode(shaderObject,methodVO,targetReg,registerCache,sharedRegisters)},DiffuseCompositeMethod.prototype.iReset=function(){this.pBaseMethod.iReset()},DiffuseCompositeMethod.prototype.iCleanCompilationData=function(){_super.prototype.iCleanCompilationData.call(this),this.pBaseMethod.iCleanCompilationData()},DiffuseCompositeMethod.prototype.onShaderInvalidated=function(){this.iInvalidateShaderProgram()},DiffuseCompositeMethod}(materials.DiffuseBasicMethod);materials.DiffuseCompositeMethod=DiffuseCompositeMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var DiffuseCelMethod=function(_super){function DiffuseCelMethod(levels,baseMethod){"undefined"==typeof levels&&(levels=3),"undefined"==typeof baseMethod&&(baseMethod=null);var _this=this;_super.call(this,null,baseMethod),this._smoothness=.1,this.baseMethod._iModulateMethod=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){return _this.clampDiffuse(shaderObject,methodVO,targetReg,registerCache,sharedRegisters)},this._levels=levels}return __extends(DiffuseCelMethod,_super),DiffuseCelMethod.prototype.iInitConstants=function(shaderObject,methodVO){var data=shaderObject.fragmentConstantData,index=methodVO.secondaryFragmentConstantsIndex;_super.prototype.iInitConstants.call(this,shaderObject,methodVO),data[index+1]=1,data[index+2]=0},Object.defineProperty(DiffuseCelMethod.prototype,"levels",{get:function(){return this._levels},set:function(value){this._levels=value},enumerable:!0,configurable:!0}),Object.defineProperty(DiffuseCelMethod.prototype,"smoothness",{get:function(){return this._smoothness},set:function(value){this._smoothness=value},enumerable:!0,configurable:!0}),DiffuseCelMethod.prototype.iCleanCompilationData=function(){_super.prototype.iCleanCompilationData.call(this),this._dataReg=null},DiffuseCelMethod.prototype.iGetFragmentPreLightingCode=function(shaderObject,methodVO,registerCache,sharedRegisters){return this._dataReg=registerCache.getFreeFragmentConstant(),methodVO.secondaryFragmentConstantsIndex=4*this._dataReg.index,_super.prototype.iGetFragmentPreLightingCode.call(this,shaderObject,methodVO,registerCache,sharedRegisters)},DiffuseCelMethod.prototype.iActivate=function(shaderObject,methodVO,stage){_super.prototype.iActivate.call(this,shaderObject,methodVO,stage);var data=shaderObject.fragmentConstantData,index=methodVO.secondaryFragmentConstantsIndex;data[index]=this._levels,data[index+3]=this._smoothness},DiffuseCelMethod.prototype.clampDiffuse=function(shaderObject,methodVO,targetReg){return"mul "+targetReg+".w, "+targetReg+".w, "+this._dataReg+".x\n"+"frc "+targetReg+".z, "+targetReg+".w\n"+"sub "+targetReg+".y, "+targetReg+".w, "+targetReg+".z\n"+"mov "+targetReg+".x, "+this._dataReg+".x\n"+"sub "+targetReg+".x, "+targetReg+".x, "+this._dataReg+".y\n"+"rcp "+targetReg+".x,"+targetReg+".x\n"+"mul "+targetReg+".w, "+targetReg+".y, "+targetReg+".x\n"+"sub "+targetReg+".y, "+targetReg+".w, "+targetReg+".x\n"+"div "+targetReg+".z, "+targetReg+".z, "+this._dataReg+".w\n"+"sat "+targetReg+".z, "+targetReg+".z\n"+"mul "+targetReg+".w, "+targetReg+".w, "+targetReg+".z\n"+"sub "+targetReg+".z, "+this._dataReg+".y, "+targetReg+".z\n"+"mul "+targetReg+".y, "+targetReg+".y, "+targetReg+".z\n"+"add "+targetReg+".w, "+targetReg+".w, "+targetReg+".y\n"+"sat "+targetReg+".w, "+targetReg+".w\n"},DiffuseCelMethod}(materials.DiffuseCompositeMethod);materials.DiffuseCelMethod=DiffuseCelMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var DiffuseDepthMethod=function(_super){function DiffuseDepthMethod(){_super.call(this)}return __extends(DiffuseDepthMethod,_super),DiffuseDepthMethod.prototype.iInitConstants=function(shaderObject,methodVO){var data=shaderObject.fragmentConstantData,index=methodVO.fragmentConstantsIndex;data[index]=1,data[index+1]=1/255,data[index+2]=1/65025,data[index+3]=1/16581375},DiffuseDepthMethod.prototype.iGetFragmentPostLightingCode=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){var temp,decReg,code="";if(!this._pUseTexture)throw new Error("DiffuseDepthMethod requires texture!");return shaderObject.numLights>0&&(sharedRegisters.shadowTarget&&(code+="mul "+this._pTotalLightColorReg+".xyz, "+this._pTotalLightColorReg+".xyz, "+sharedRegisters.shadowTarget+".w\n"),code+="add "+targetReg+".xyz, "+this._pTotalLightColorReg+".xyz, "+targetReg+".xyz\n"+"sat "+targetReg+".xyz, "+targetReg+".xyz\n",registerCache.removeFragmentTempUsage(this._pTotalLightColorReg)),temp=shaderObject.numLights>0?registerCache.getFreeFragmentVectorTemp():targetReg,this._pDiffuseInputRegister=registerCache.getFreeTextureReg(),methodVO.texturesIndex=this._pDiffuseInputRegister.index,decReg=registerCache.getFreeFragmentConstant(),methodVO.fragmentConstantsIndex=4*decReg.index,code+=materials.ShaderCompilerHelper.getTex2DSampleCode(temp,sharedRegisters,this._pDiffuseInputRegister,this.texture,shaderObject.useSmoothTextures,shaderObject.repeatTextures,shaderObject.useMipmapping)+"dp4 "+temp+".x, "+temp+", "+decReg+"\n"+"mov "+temp+".yz, "+temp+".xx \n"+"mov "+temp+".w, "+decReg+".x\n"+"sub "+temp+".xyz, "+decReg+".xxx, "+temp+".xyz\n",0==shaderObject.numLights?code:code+="mul "+targetReg+".xyz, "+temp+".xyz, "+targetReg+".xyz\n"+"mov "+targetReg+".w, "+temp+".w\n"},DiffuseDepthMethod}(materials.DiffuseBasicMethod);materials.DiffuseDepthMethod=DiffuseDepthMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var DiffuseGradientMethod=function(_super){function DiffuseGradientMethod(gradient){_super.call(this),this._gradient=gradient}return __extends(DiffuseGradientMethod,_super),Object.defineProperty(DiffuseGradientMethod.prototype,"gradient",{get:function(){return this._gradient},set:function(value){(value.hasMipmaps!=this._gradient.hasMipmaps||value.format!=this._gradient.format)&&this.iInvalidateShaderProgram(),this._gradient=value},enumerable:!0,configurable:!0}),DiffuseGradientMethod.prototype.iCleanCompilationData=function(){_super.prototype.iCleanCompilationData.call(this),this._gradientTextureRegister=null},DiffuseGradientMethod.prototype.iGetFragmentPreLightingCode=function(shaderObject,methodVO,registerCache,sharedRegisters){var code=_super.prototype.iGetFragmentPreLightingCode.call(this,shaderObject,methodVO,registerCache,sharedRegisters);return this._pIsFirstLight=!0,shaderObject.numLights>0&&(this._gradientTextureRegister=registerCache.getFreeTextureReg(),methodVO.secondaryTexturesIndex=this._gradientTextureRegister.index),code},DiffuseGradientMethod.prototype.iGetFragmentCodePerLight=function(shaderObject,methodVO,lightDirReg,lightColReg,registerCache,sharedRegisters){var t,code="";return this._pIsFirstLight?t=this._pTotalLightColorReg:(t=registerCache.getFreeFragmentVectorTemp(),registerCache.addFragmentTempUsages(t,1)),code+="dp3 "+t+".w, "+lightDirReg+".xyz, "+sharedRegisters.normalFragment+".xyz\n"+"mul "+t+".w, "+t+".w, "+sharedRegisters.commons+".x\n"+"add "+t+".w, "+t+".w, "+sharedRegisters.commons+".x\n"+"mul "+t+".xyz, "+t+".w, "+lightDirReg+".w\n",null!=this._iModulateMethod&&(code+=this._iModulateMethod(shaderObject,methodVO,t,registerCache,sharedRegisters)),code+=materials.ShaderCompilerHelper.getTex2DSampleCode(t,sharedRegisters,this._gradientTextureRegister,this._gradient,shaderObject.useSmoothTextures,shaderObject.repeatTextures,shaderObject.useMipmapping,t,"clamp")+"mul "+t+".xyz, "+t+".xyz, "+lightColReg+".xyz\n",this._pIsFirstLight||(code+="add "+this._pTotalLightColorReg+".xyz, "+this._pTotalLightColorReg+".xyz, "+t+".xyz\n",registerCache.removeFragmentTempUsage(t)),this._pIsFirstLight=!1,code -},DiffuseGradientMethod.prototype.pApplyShadow=function(shaderObject,methodVO,regCache,sharedRegisters){var t=regCache.getFreeFragmentVectorTemp();return"mov "+t+", "+sharedRegisters.shadowTarget+".wwww\n"+materials.ShaderCompilerHelper.getTex2DSampleCode(t,sharedRegisters,this._gradientTextureRegister,this._gradient,shaderObject.useSmoothTextures,shaderObject.repeatTextures,shaderObject.useMipmapping,t,"clamp")+"mul "+this._pTotalLightColorReg+".xyz, "+this._pTotalLightColorReg+", "+t+"\n"},DiffuseGradientMethod.prototype.iActivate=function(shaderObject,methodVO,stage){_super.prototype.iActivate.call(this,shaderObject,methodVO,stage),stage.context.activateTexture(methodVO.secondaryTexturesIndex,this._gradient)},DiffuseGradientMethod}(materials.DiffuseBasicMethod);materials.DiffuseGradientMethod=DiffuseGradientMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var DiffuseLightMapMethod=function(_super){function DiffuseLightMapMethod(lightMap,blendMode,useSecondaryUV,baseMethod){"undefined"==typeof blendMode&&(blendMode="multiply"),"undefined"==typeof useSecondaryUV&&(useSecondaryUV=!1),"undefined"==typeof baseMethod&&(baseMethod=null),_super.call(this,null,baseMethod),this._useSecondaryUV=useSecondaryUV,this._lightMapTexture=lightMap,this.blendMode=blendMode}return __extends(DiffuseLightMapMethod,_super),DiffuseLightMapMethod.prototype.iInitVO=function(shaderObject,methodVO){methodVO.needsSecondaryUV=this._useSecondaryUV,methodVO.needsUV=!this._useSecondaryUV},Object.defineProperty(DiffuseLightMapMethod.prototype,"blendMode",{get:function(){return this._blendMode},set:function(value){if(value!=DiffuseLightMapMethod.ADD&&value!=DiffuseLightMapMethod.MULTIPLY)throw new Error("Unknown blendmode!");this._blendMode!=value&&(this._blendMode=value,this.iInvalidateShaderProgram())},enumerable:!0,configurable:!0}),Object.defineProperty(DiffuseLightMapMethod.prototype,"lightMapTexture",{get:function(){return this._lightMapTexture},set:function(value){this._lightMapTexture=value},enumerable:!0,configurable:!0}),DiffuseLightMapMethod.prototype.iActivate=function(shaderObject,methodVO,stage){stage.context.activateTexture(methodVO.secondaryTexturesIndex,this._lightMapTexture),_super.prototype.iActivate.call(this,shaderObject,methodVO,stage)},DiffuseLightMapMethod.prototype.iGetFragmentPostLightingCode=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){var code,lightMapReg=registerCache.getFreeTextureReg(),temp=registerCache.getFreeFragmentVectorTemp();switch(methodVO.secondaryTexturesIndex=lightMapReg.index,code=materials.ShaderCompilerHelper.getTex2DSampleCode(temp,sharedRegisters,lightMapReg,this._lightMapTexture,shaderObject.useSmoothTextures,shaderObject.repeatTextures,shaderObject.useMipmapping,sharedRegisters.secondaryUVVarying),this._blendMode){case DiffuseLightMapMethod.MULTIPLY:code+="mul "+this._pTotalLightColorReg+", "+this._pTotalLightColorReg+", "+temp+"\n";break;case DiffuseLightMapMethod.ADD:code+="add "+this._pTotalLightColorReg+", "+this._pTotalLightColorReg+", "+temp+"\n"}return code+=_super.prototype.iGetFragmentPostLightingCode.call(this,shaderObject,methodVO,targetReg,registerCache,sharedRegisters)},DiffuseLightMapMethod.MULTIPLY="multiply",DiffuseLightMapMethod.ADD="add",DiffuseLightMapMethod}(materials.DiffuseCompositeMethod);materials.DiffuseLightMapMethod=DiffuseLightMapMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var DiffuseWrapMethod=function(_super){function DiffuseWrapMethod(wrapFactor){"undefined"==typeof wrapFactor&&(wrapFactor=.5),_super.call(this),this.wrapFactor=wrapFactor}return __extends(DiffuseWrapMethod,_super),DiffuseWrapMethod.prototype.iCleanCompilationData=function(){_super.prototype.iCleanCompilationData.call(this),this._wrapDataRegister=null},Object.defineProperty(DiffuseWrapMethod.prototype,"wrapFactor",{get:function(){return this._wrapFactor},set:function(value){this._wrapFactor=value,this._wrapFactor=1/(value+1)},enumerable:!0,configurable:!0}),DiffuseWrapMethod.prototype.iGetFragmentPreLightingCode=function(shaderObject,methodVO,registerCache,sharedRegisters){var code=_super.prototype.iGetFragmentPreLightingCode.call(this,shaderObject,methodVO,registerCache,sharedRegisters);return this._pIsFirstLight=!0,this._wrapDataRegister=registerCache.getFreeFragmentConstant(),methodVO.secondaryFragmentConstantsIndex=4*this._wrapDataRegister.index,code},DiffuseWrapMethod.prototype.iGetFragmentCodePerLight=function(shaderObject,methodVO,lightDirReg,lightColReg,registerCache,sharedRegisters){var t,code="";return this._pIsFirstLight?t=this._pTotalLightColorReg:(t=registerCache.getFreeFragmentVectorTemp(),registerCache.addFragmentTempUsages(t,1)),code+="dp3 "+t+".x, "+lightDirReg+".xyz, "+sharedRegisters.normalFragment+".xyz\n"+"add "+t+".y, "+t+".x, "+this._wrapDataRegister+".x\n"+"mul "+t+".y, "+t+".y, "+this._wrapDataRegister+".y\n"+"sat "+t+".w, "+t+".y\n"+"mul "+t+".xz, "+t+".w, "+lightDirReg+".wz\n",null!=this._iModulateMethod&&(code+=this._iModulateMethod(shaderObject,methodVO,lightDirReg,registerCache,sharedRegisters)),code+="mul "+t+", "+t+".x, "+lightColReg+"\n",this._pIsFirstLight||(code+="add "+this._pTotalLightColorReg+".xyz, "+this._pTotalLightColorReg+".xyz, "+t+".xyz\n",registerCache.removeFragmentTempUsage(t)),this._pIsFirstLight=!1,code},DiffuseWrapMethod.prototype.iActivate=function(shaderObject,methodVO,stage){_super.prototype.iActivate.call(this,shaderObject,methodVO,stage);var index=methodVO.secondaryFragmentConstantsIndex,data=shaderObject.fragmentConstantData;data[index]=this._wrapFactor,data[index+1]=1/(this._wrapFactor+1)},DiffuseWrapMethod}(materials.DiffuseBasicMethod);materials.DiffuseWrapMethod=DiffuseWrapMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var EffectAlphaMaskMethod=function(_super){function EffectAlphaMaskMethod(texture,useSecondaryUV){"undefined"==typeof useSecondaryUV&&(useSecondaryUV=!1),_super.call(this),this._texture=texture,this._useSecondaryUV=useSecondaryUV}return __extends(EffectAlphaMaskMethod,_super),EffectAlphaMaskMethod.prototype.iInitVO=function(shaderObject,methodVO){methodVO.needsSecondaryUV=this._useSecondaryUV,methodVO.needsUV=!this._useSecondaryUV},Object.defineProperty(EffectAlphaMaskMethod.prototype,"useSecondaryUV",{get:function(){return this._useSecondaryUV},set:function(value){this._useSecondaryUV!=value&&(this._useSecondaryUV=value,this.iInvalidateShaderProgram())},enumerable:!0,configurable:!0}),Object.defineProperty(EffectAlphaMaskMethod.prototype,"texture",{get:function(){return this._texture},set:function(value){this._texture=value},enumerable:!0,configurable:!0}),EffectAlphaMaskMethod.prototype.iActivate=function(shaderObject,methodVO,stage){stage.context.activateTexture(methodVO.texturesIndex,this._texture)},EffectAlphaMaskMethod.prototype.iGetFragmentCode=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){var textureReg=registerCache.getFreeTextureReg(),temp=registerCache.getFreeFragmentVectorTemp(),uvReg=this._useSecondaryUV?sharedRegisters.secondaryUVVarying:sharedRegisters.uvVarying;return methodVO.texturesIndex=textureReg.index,materials.ShaderCompilerHelper.getTex2DSampleCode(temp,sharedRegisters,textureReg,this._texture,shaderObject.useSmoothTextures,shaderObject.repeatTextures,shaderObject.useMipmapping,uvReg)+"mul "+targetReg+", "+targetReg+", "+temp+".x\n"},EffectAlphaMaskMethod}(materials.EffectMethodBase);materials.EffectAlphaMaskMethod=EffectAlphaMaskMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var EffectColorMatrixMethod=function(_super){function EffectColorMatrixMethod(matrix){if(_super.call(this),20!=matrix.length)throw new Error("Matrix length must be 20!");this._matrix=matrix}return __extends(EffectColorMatrixMethod,_super),Object.defineProperty(EffectColorMatrixMethod.prototype,"colorMatrix",{get:function(){return this._matrix},set:function(value){this._matrix=value},enumerable:!0,configurable:!0}),EffectColorMatrixMethod.prototype.iGetFragmentCode=function(shaderObject,methodVO,targetReg,registerCache){var code="",colorMultReg=registerCache.getFreeFragmentConstant();registerCache.getFreeFragmentConstant(),registerCache.getFreeFragmentConstant(),registerCache.getFreeFragmentConstant();var colorOffsetReg=registerCache.getFreeFragmentConstant();methodVO.fragmentConstantsIndex=4*colorMultReg.index;var temp=registerCache.getFreeFragmentVectorTemp();return code+="m44 "+temp+", "+targetReg+", "+colorMultReg+"\n"+"add "+targetReg+", "+temp+", "+colorOffsetReg+"\n"},EffectColorMatrixMethod.prototype.iActivate=function(shaderObject,methodVO){var matrix=this._matrix,index=methodVO.fragmentConstantsIndex,data=shaderObject.fragmentConstantData;data[index]=matrix[0],data[index+1]=matrix[1],data[index+2]=matrix[2],data[index+3]=matrix[3],data[index+4]=matrix[5],data[index+5]=matrix[6],data[index+6]=matrix[7],data[index+7]=matrix[8],data[index+8]=matrix[10],data[index+9]=matrix[11],data[index+10]=matrix[12],data[index+11]=matrix[13],data[index+12]=matrix[15],data[index+13]=matrix[16],data[index+14]=matrix[17],data[index+15]=matrix[18],data[index+16]=matrix[4],data[index+17]=matrix[9],data[index+18]=matrix[14],data[index+19]=matrix[19]},EffectColorMatrixMethod}(materials.EffectMethodBase);materials.EffectColorMatrixMethod=EffectColorMatrixMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var EffectEnvMapMethod=function(_super){function EffectEnvMapMethod(envMap,alpha){"undefined"==typeof alpha&&(alpha=1),_super.call(this),this._cubeTexture=envMap,this._alpha=alpha}return __extends(EffectEnvMapMethod,_super),Object.defineProperty(EffectEnvMapMethod.prototype,"mask",{get:function(){return this._mask},set:function(value){(value!=this._mask||value&&this._mask&&(value.hasMipmaps!=this._mask.hasMipmaps||value.format!=this._mask.format))&&this.iInvalidateShaderProgram(),this._mask=value},enumerable:!0,configurable:!0}),EffectEnvMapMethod.prototype.iInitVO=function(shaderObject,methodVO){methodVO.needsNormals=!0,methodVO.needsView=!0,methodVO.needsUV=null!=this._mask},Object.defineProperty(EffectEnvMapMethod.prototype,"envMap",{get:function(){return this._cubeTexture},set:function(value){this._cubeTexture=value},enumerable:!0,configurable:!0}),EffectEnvMapMethod.prototype.dispose=function(){},Object.defineProperty(EffectEnvMapMethod.prototype,"alpha",{get:function(){return this._alpha},set:function(value){this._alpha=value},enumerable:!0,configurable:!0}),EffectEnvMapMethod.prototype.iActivate=function(shaderObject,methodVO,stage){shaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex]=this._alpha,stage.context.activateCubeTexture(methodVO.texturesIndex,this._cubeTexture),this._mask&&stage.context.activateTexture(methodVO.texturesIndex+1,this._mask)},EffectEnvMapMethod.prototype.iGetFragmentCode=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){var dataRegister=registerCache.getFreeFragmentConstant(),temp=registerCache.getFreeFragmentVectorTemp(),code="",cubeMapReg=registerCache.getFreeTextureReg();methodVO.texturesIndex=cubeMapReg.index,methodVO.fragmentConstantsIndex=4*dataRegister.index,registerCache.addFragmentTempUsages(temp,1);var temp2=registerCache.getFreeFragmentVectorTemp();return code+="dp3 "+temp+".w, "+sharedRegisters.viewDirFragment+".xyz, "+sharedRegisters.normalFragment+".xyz\n"+"add "+temp+".w, "+temp+".w, "+temp+".w\n"+"mul "+temp+".xyz, "+sharedRegisters.normalFragment+".xyz, "+temp+".w\n"+"sub "+temp+".xyz, "+temp+".xyz, "+sharedRegisters.viewDirFragment+".xyz\n"+materials.ShaderCompilerHelper.getTexCubeSampleCode(temp,cubeMapReg,this._cubeTexture,shaderObject.useSmoothTextures,shaderObject.useMipmapping,temp)+"sub "+temp2+".w, "+temp+".w, fc0.x\n"+"kil "+temp2+".w\n"+"sub "+temp+", "+temp+", "+targetReg+"\n",this._mask&&(code+=materials.ShaderCompilerHelper.getTex2DSampleCode(temp2,sharedRegisters,registerCache.getFreeTextureReg(),this._mask,shaderObject.useSmoothTextures,shaderObject.repeatTextures,shaderObject.useMipmapping)+"mul "+temp+", "+temp2+", "+temp+"\n"),code+="mul "+temp+", "+temp+", "+dataRegister+".x\n"+"add "+targetReg+", "+targetReg+", "+temp+"\n",registerCache.removeFragmentTempUsage(temp),code},EffectEnvMapMethod}(materials.EffectMethodBase);materials.EffectEnvMapMethod=EffectEnvMapMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var EffectFogMethod=function(_super){function EffectFogMethod(minDistance,maxDistance,fogColor){"undefined"==typeof fogColor&&(fogColor=8421504),_super.call(this),this._minDistance=0,this._maxDistance=1e3,this.minDistance=minDistance,this.maxDistance=maxDistance,this.fogColor=fogColor}return __extends(EffectFogMethod,_super),EffectFogMethod.prototype.iInitVO=function(shaderObject,methodVO){methodVO.needsProjection=!0},EffectFogMethod.prototype.iInitConstants=function(shaderObject,methodVO){var data=shaderObject.fragmentConstantData,index=methodVO.fragmentConstantsIndex;data[index+3]=1,data[index+6]=0,data[index+7]=0},Object.defineProperty(EffectFogMethod.prototype,"minDistance",{get:function(){return this._minDistance},set:function(value){this._minDistance=value},enumerable:!0,configurable:!0}),Object.defineProperty(EffectFogMethod.prototype,"maxDistance",{get:function(){return this._maxDistance},set:function(value){this._maxDistance=value},enumerable:!0,configurable:!0}),Object.defineProperty(EffectFogMethod.prototype,"fogColor",{get:function(){return this._fogColor},set:function(value){this._fogColor=value,this._fogR=(255&value>>16)/255,this._fogG=(255&value>>8)/255,this._fogB=(255&value)/255},enumerable:!0,configurable:!0}),EffectFogMethod.prototype.iActivate=function(shaderObject,methodVO){var data=shaderObject.fragmentConstantData,index=methodVO.fragmentConstantsIndex;data[index]=this._fogR,data[index+1]=this._fogG,data[index+2]=this._fogB,data[index+4]=this._minDistance,data[index+5]=1/(this._maxDistance-this._minDistance)},EffectFogMethod.prototype.iGetFragmentCode=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){var fogColor=registerCache.getFreeFragmentConstant(),fogData=registerCache.getFreeFragmentConstant(),temp=registerCache.getFreeFragmentVectorTemp();registerCache.addFragmentTempUsages(temp,1);var temp2=registerCache.getFreeFragmentVectorTemp(),code="";return methodVO.fragmentConstantsIndex=4*fogColor.index,code+="sub "+temp2+".w, "+sharedRegisters.projectionFragment+".z, "+fogData+".x\n"+"mul "+temp2+".w, "+temp2+".w, "+fogData+".y\n"+"sat "+temp2+".w, "+temp2+".w\n"+"sub "+temp+", "+fogColor+", "+targetReg+"\n"+"mul "+temp+", "+temp+", "+temp2+".w\n"+"add "+targetReg+", "+targetReg+", "+temp+"\n",registerCache.removeFragmentTempUsage(temp),code},EffectFogMethod}(materials.EffectMethodBase);materials.EffectFogMethod=EffectFogMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var EffectFresnelEnvMapMethod=function(_super){function EffectFresnelEnvMapMethod(envMap,alpha){"undefined"==typeof alpha&&(alpha=1),_super.call(this),this._fresnelPower=5,this._normalReflectance=0,this._cubeTexture=envMap,this._alpha=alpha}return __extends(EffectFresnelEnvMapMethod,_super),EffectFresnelEnvMapMethod.prototype.iInitVO=function(shaderObject,methodVO){methodVO.needsNormals=!0,methodVO.needsView=!0,methodVO.needsUV=null!=this._mask},EffectFresnelEnvMapMethod.prototype.iInitConstants=function(shaderObject,methodVO){shaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex+3]=1},Object.defineProperty(EffectFresnelEnvMapMethod.prototype,"mask",{get:function(){return this._mask},set:function(value){(Boolean(value)!=Boolean(this._mask)||value&&this._mask&&(value.hasMipmaps!=this._mask.hasMipmaps||value.format!=this._mask.format))&&this.iInvalidateShaderProgram(),this._mask=value},enumerable:!0,configurable:!0}),Object.defineProperty(EffectFresnelEnvMapMethod.prototype,"fresnelPower",{get:function(){return this._fresnelPower},set:function(value){this._fresnelPower=value},enumerable:!0,configurable:!0}),Object.defineProperty(EffectFresnelEnvMapMethod.prototype,"envMap",{get:function(){return this._cubeTexture},set:function(value){this._cubeTexture=value},enumerable:!0,configurable:!0}),Object.defineProperty(EffectFresnelEnvMapMethod.prototype,"alpha",{get:function(){return this._alpha},set:function(value){this._alpha=value},enumerable:!0,configurable:!0}),Object.defineProperty(EffectFresnelEnvMapMethod.prototype,"normalReflectance",{get:function(){return this._normalReflectance},set:function(value){this._normalReflectance=value},enumerable:!0,configurable:!0}),EffectFresnelEnvMapMethod.prototype.iActivate=function(shaderObject,methodVO,stage){var data=shaderObject.fragmentConstantData,index=methodVO.fragmentConstantsIndex;data[index]=this._alpha,data[index+1]=this._normalReflectance,data[index+2]=this._fresnelPower,stage.context.activateCubeTexture(methodVO.texturesIndex,this._cubeTexture),this._mask&&stage.context.activateTexture(methodVO.texturesIndex+1,this._mask)},EffectFresnelEnvMapMethod.prototype.iGetFragmentCode=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){var dataRegister=registerCache.getFreeFragmentConstant(),temp=registerCache.getFreeFragmentVectorTemp(),code="",cubeMapReg=registerCache.getFreeTextureReg(),viewDirReg=sharedRegisters.viewDirFragment,normalReg=sharedRegisters.normalFragment;methodVO.texturesIndex=cubeMapReg.index,methodVO.fragmentConstantsIndex=4*dataRegister.index,registerCache.addFragmentTempUsages(temp,1);var temp2=registerCache.getFreeFragmentVectorTemp();if(code+="dp3 "+temp+".w, "+viewDirReg+".xyz, "+normalReg+".xyz\n"+"add "+temp+".w, "+temp+".w, "+temp+".w\n"+"mul "+temp+".xyz, "+normalReg+".xyz, "+temp+".w\n"+"sub "+temp+".xyz, "+temp+".xyz, "+viewDirReg+".xyz\n"+materials.ShaderCompilerHelper.getTexCubeSampleCode(temp,cubeMapReg,this._cubeTexture,shaderObject.useSmoothTextures,shaderObject.useMipmapping,temp)+"sub "+temp2+".w, "+temp+".w, fc0.x\n"+"kil "+temp2+".w\n"+"sub "+temp+", "+temp+", "+targetReg+"\n",code+="dp3 "+viewDirReg+".w, "+viewDirReg+".xyz, "+normalReg+".xyz\n"+"sub "+viewDirReg+".w, "+dataRegister+".w, "+viewDirReg+".w\n"+"pow "+viewDirReg+".w, "+viewDirReg+".w, "+dataRegister+".z\n"+"sub "+normalReg+".w, "+dataRegister+".w, "+viewDirReg+".w\n"+"mul "+normalReg+".w, "+dataRegister+".y, "+normalReg+".w\n"+"add "+viewDirReg+".w, "+viewDirReg+".w, "+normalReg+".w\n"+"mul "+viewDirReg+".w, "+dataRegister+".x, "+viewDirReg+".w\n",this._mask){var maskReg=registerCache.getFreeTextureReg();code+=materials.ShaderCompilerHelper.getTex2DSampleCode(temp2,sharedRegisters,maskReg,this._mask,shaderObject.useSmoothTextures,shaderObject.repeatTextures,shaderObject.useMipmapping)+"mul "+viewDirReg+".w, "+temp2+".x, "+viewDirReg+".w\n"}return code+="mul "+temp+", "+temp+", "+viewDirReg+".w\n"+"add "+targetReg+", "+targetReg+", "+temp+"\n",registerCache.removeFragmentTempUsage(temp),code},EffectFresnelEnvMapMethod}(materials.EffectMethodBase);materials.EffectFresnelEnvMapMethod=EffectFresnelEnvMapMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var EffectLightMapMethod=function(_super){function EffectLightMapMethod(texture,blendMode,useSecondaryUV){"undefined"==typeof blendMode&&(blendMode="multiply"),"undefined"==typeof useSecondaryUV&&(useSecondaryUV=!1),_super.call(this),this._useSecondaryUV=useSecondaryUV,this._texture=texture,this.blendMode=blendMode}return __extends(EffectLightMapMethod,_super),EffectLightMapMethod.prototype.iInitVO=function(shaderObject,methodVO){methodVO.needsUV=!this._useSecondaryUV,methodVO.needsSecondaryUV=this._useSecondaryUV},Object.defineProperty(EffectLightMapMethod.prototype,"blendMode",{get:function(){return this._blendMode},set:function(value){if(value!=EffectLightMapMethod.ADD&&value!=EffectLightMapMethod.MULTIPLY)throw new Error("Unknown blendmode!");this._blendMode!=value&&(this._blendMode=value,this.iInvalidateShaderProgram())},enumerable:!0,configurable:!0}),Object.defineProperty(EffectLightMapMethod.prototype,"texture",{get:function(){return this._texture},set:function(value){(value.hasMipmaps!=this._texture.hasMipmaps||value.format!=this._texture.format)&&this.iInvalidateShaderProgram(),this._texture=value},enumerable:!0,configurable:!0}),EffectLightMapMethod.prototype.iActivate=function(shaderObject,methodVO,stage){stage.context.activateTexture(methodVO.texturesIndex,this._texture),_super.prototype.iActivate.call(this,shaderObject,methodVO,stage)},EffectLightMapMethod.prototype.iGetFragmentCode=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){var code,lightMapReg=registerCache.getFreeTextureReg(),temp=registerCache.getFreeFragmentVectorTemp();switch(methodVO.texturesIndex=lightMapReg.index,code=materials.ShaderCompilerHelper.getTex2DSampleCode(temp,sharedRegisters,lightMapReg,this._texture,shaderObject.useSmoothTextures,shaderObject.repeatTextures,shaderObject.useMipmapping,this._useSecondaryUV?sharedRegisters.secondaryUVVarying:sharedRegisters.uvVarying),this._blendMode){case EffectLightMapMethod.MULTIPLY:code+="mul "+targetReg+", "+targetReg+", "+temp+"\n";break;case EffectLightMapMethod.ADD:code+="add "+targetReg+", "+targetReg+", "+temp+"\n"}return code},EffectLightMapMethod.MULTIPLY="multiply",EffectLightMapMethod.ADD="add",EffectLightMapMethod}(materials.EffectMethodBase);materials.EffectLightMapMethod=EffectLightMapMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var EffectRefractionEnvMapMethod=function(_super){function EffectRefractionEnvMapMethod(envMap,refractionIndex,dispersionR,dispersionG,dispersionB){"undefined"==typeof refractionIndex&&(refractionIndex=.1),"undefined"==typeof dispersionR&&(dispersionR=0),"undefined"==typeof dispersionG&&(dispersionG=0),"undefined"==typeof dispersionB&&(dispersionB=0),_super.call(this),this._dispersionR=0,this._dispersionG=0,this._dispersionB=0,this._alpha=1,this._envMap=envMap,this._dispersionR=dispersionR,this._dispersionG=dispersionG,this._dispersionB=dispersionB,this._useDispersion=!(this._dispersionR==this._dispersionB&&this._dispersionR==this._dispersionG),this._refractionIndex=refractionIndex}return __extends(EffectRefractionEnvMapMethod,_super),EffectRefractionEnvMapMethod.prototype.iInitConstants=function(shaderObject,methodVO){var index=methodVO.fragmentConstantsIndex,data=shaderObject.fragmentConstantData;data[index+4]=1,data[index+5]=0,data[index+7]=1},EffectRefractionEnvMapMethod.prototype.iInitVO=function(shaderObject,methodVO){methodVO.needsNormals=!0,methodVO.needsView=!0},Object.defineProperty(EffectRefractionEnvMapMethod.prototype,"envMap",{get:function(){return this._envMap},set:function(value){this._envMap=value},enumerable:!0,configurable:!0}),Object.defineProperty(EffectRefractionEnvMapMethod.prototype,"refractionIndex",{get:function(){return this._refractionIndex},set:function(value){this._refractionIndex=value},enumerable:!0,configurable:!0}),Object.defineProperty(EffectRefractionEnvMapMethod.prototype,"dispersionR",{get:function(){return this._dispersionR},set:function(value){this._dispersionR=value;var useDispersion=!(this._dispersionR==this._dispersionB&&this._dispersionR==this._dispersionG);this._useDispersion!=useDispersion&&(this.iInvalidateShaderProgram(),this._useDispersion=useDispersion)},enumerable:!0,configurable:!0}),Object.defineProperty(EffectRefractionEnvMapMethod.prototype,"dispersionG",{get:function(){return this._dispersionG},set:function(value){this._dispersionG=value;var useDispersion=!(this._dispersionR==this._dispersionB&&this._dispersionR==this._dispersionG);this._useDispersion!=useDispersion&&(this.iInvalidateShaderProgram(),this._useDispersion=useDispersion)},enumerable:!0,configurable:!0}),Object.defineProperty(EffectRefractionEnvMapMethod.prototype,"dispersionB",{get:function(){return this._dispersionB},set:function(value){this._dispersionB=value;var useDispersion=!(this._dispersionR==this._dispersionB&&this._dispersionR==this._dispersionG);this._useDispersion!=useDispersion&&(this.iInvalidateShaderProgram(),this._useDispersion=useDispersion)},enumerable:!0,configurable:!0}),Object.defineProperty(EffectRefractionEnvMapMethod.prototype,"alpha",{get:function(){return this._alpha},set:function(value){this._alpha=value},enumerable:!0,configurable:!0}),EffectRefractionEnvMapMethod.prototype.iActivate=function(shaderObject,methodVO,stage){var index=methodVO.fragmentConstantsIndex,data=shaderObject.fragmentConstantData;data[index]=this._dispersionR+this._refractionIndex,this._useDispersion&&(data[index+1]=this._dispersionG+this._refractionIndex,data[index+2]=this._dispersionB+this._refractionIndex),data[index+3]=this._alpha,stage.context.activateCubeTexture(methodVO.texturesIndex,this._envMap)},EffectRefractionEnvMapMethod.prototype.iGetFragmentCode=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){var refractionDir,refractionColor,temp,data=registerCache.getFreeFragmentConstant(),data2=registerCache.getFreeFragmentConstant(),code="",cubeMapReg=registerCache.getFreeTextureReg();methodVO.texturesIndex=cubeMapReg.index,methodVO.fragmentConstantsIndex=4*data.index,refractionDir=registerCache.getFreeFragmentVectorTemp(),registerCache.addFragmentTempUsages(refractionDir,1),refractionColor=registerCache.getFreeFragmentVectorTemp(),registerCache.addFragmentTempUsages(refractionColor,1),temp=registerCache.getFreeFragmentVectorTemp();var viewDirReg=sharedRegisters.viewDirFragment,normalReg=sharedRegisters.normalFragment;return code+="neg "+viewDirReg+".xyz, "+viewDirReg+".xyz\n",code+="dp3 "+temp+".x, "+viewDirReg+".xyz, "+normalReg+".xyz\n"+"mul "+temp+".w, "+temp+".x, "+temp+".x\n"+"sub "+temp+".w, "+data2+".x, "+temp+".w\n"+"mul "+temp+".w, "+data+".x, "+temp+".w\n"+"mul "+temp+".w, "+data+".x, "+temp+".w\n"+"sub "+temp+".w, "+data2+".x, "+temp+".w\n"+"sqt "+temp+".y, "+temp+".w\n"+"mul "+temp+".x, "+data+".x, "+temp+".x\n"+"add "+temp+".x, "+temp+".x, "+temp+".y\n"+"mul "+temp+".xyz, "+temp+".x, "+normalReg+".xyz\n"+"mul "+refractionDir+", "+data+".x, "+viewDirReg+"\n"+"sub "+refractionDir+".xyz, "+refractionDir+".xyz, "+temp+".xyz\n"+"nrm "+refractionDir+".xyz, "+refractionDir+".xyz\n",code+=materials.ShaderCompilerHelper.getTexCubeSampleCode(refractionColor,cubeMapReg,this._envMap,shaderObject.useSmoothTextures,shaderObject.useMipmapping,refractionDir)+"sub "+refractionColor+".w, "+refractionColor+".w, fc0.x \n"+"kil "+refractionColor+".w\n",this._useDispersion&&(code+="dp3 "+temp+".x, "+viewDirReg+".xyz, "+normalReg+".xyz\n"+"mul "+temp+".w, "+temp+".x, "+temp+".x\n"+"sub "+temp+".w, "+data2+".x, "+temp+".w\n"+"mul "+temp+".w, "+data+".y, "+temp+".w\n"+"mul "+temp+".w, "+data+".y, "+temp+".w\n"+"sub "+temp+".w, "+data2+".x, "+temp+".w\n"+"sqt "+temp+".y, "+temp+".w\n"+"mul "+temp+".x, "+data+".y, "+temp+".x\n"+"add "+temp+".x, "+temp+".x, "+temp+".y\n"+"mul "+temp+".xyz, "+temp+".x, "+normalReg+".xyz\n"+"mul "+refractionDir+", "+data+".y, "+viewDirReg+"\n"+"sub "+refractionDir+".xyz, "+refractionDir+".xyz, "+temp+".xyz\n"+"nrm "+refractionDir+".xyz, "+refractionDir+".xyz\n",code+=materials.ShaderCompilerHelper.getTexCubeSampleCode(temp,cubeMapReg,this._envMap,shaderObject.useSmoothTextures,shaderObject.useMipmapping,refractionDir)+"mov "+refractionColor+".y, "+temp+".y\n",code+="dp3 "+temp+".x, "+viewDirReg+".xyz, "+normalReg+".xyz\n"+"mul "+temp+".w, "+temp+".x, "+temp+".x\n"+"sub "+temp+".w, "+data2+".x, "+temp+".w\n"+"mul "+temp+".w, "+data+".z, "+temp+".w\n"+"mul "+temp+".w, "+data+".z, "+temp+".w\n"+"sub "+temp+".w, "+data2+".x, "+temp+".w\n"+"sqt "+temp+".y, "+temp+".w\n"+"mul "+temp+".x, "+data+".z, "+temp+".x\n"+"add "+temp+".x, "+temp+".x, "+temp+".y\n"+"mul "+temp+".xyz, "+temp+".x, "+normalReg+".xyz\n"+"mul "+refractionDir+", "+data+".z, "+viewDirReg+"\n"+"sub "+refractionDir+".xyz, "+refractionDir+".xyz, "+temp+".xyz\n"+"nrm "+refractionDir+".xyz, "+refractionDir+".xyz\n",code+=materials.ShaderCompilerHelper.getTexCubeSampleCode(temp,cubeMapReg,this._envMap,shaderObject.useSmoothTextures,shaderObject.useMipmapping,refractionDir)+"mov "+refractionColor+".z, "+temp+".z\n"),registerCache.removeFragmentTempUsage(refractionDir),code+="sub "+refractionColor+".xyz, "+refractionColor+".xyz, "+targetReg+".xyz\n"+"mul "+refractionColor+".xyz, "+refractionColor+".xyz, "+data+".w\n"+"add "+targetReg+".xyz, "+targetReg+".xyz, "+refractionColor+".xyz\n",registerCache.removeFragmentTempUsage(refractionColor),code+="neg "+viewDirReg+".xyz, "+viewDirReg+".xyz\n"},EffectRefractionEnvMapMethod}(materials.EffectMethodBase);materials.EffectRefractionEnvMapMethod=EffectRefractionEnvMapMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var EffectRimLightMethod=function(_super){function EffectRimLightMethod(color,strength,power,blend){"undefined"==typeof color&&(color=16777215),"undefined"==typeof strength&&(strength=.4),"undefined"==typeof power&&(power=2),"undefined"==typeof blend&&(blend="mix"),_super.call(this),this._blendMode=blend,this._strength=strength,this._power=power,this.color=color}return __extends(EffectRimLightMethod,_super),EffectRimLightMethod.prototype.iInitConstants=function(shaderObject,methodVO){shaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex+3]=1},EffectRimLightMethod.prototype.iInitVO=function(shaderObject,methodVO){methodVO.needsNormals=!0,methodVO.needsView=!0},Object.defineProperty(EffectRimLightMethod.prototype,"blendMode",{get:function(){return this._blendMode},set:function(value){this._blendMode!=value&&(this._blendMode=value,this.iInvalidateShaderProgram())},enumerable:!0,configurable:!0}),Object.defineProperty(EffectRimLightMethod.prototype,"color",{get:function(){return this._color},set:function(value){this._color=value,this._colorR=(255&value>>16)/255,this._colorG=(255&value>>8)/255,this._colorB=(255&value)/255},enumerable:!0,configurable:!0}),Object.defineProperty(EffectRimLightMethod.prototype,"strength",{get:function(){return this._strength},set:function(value){this._strength=value},enumerable:!0,configurable:!0}),Object.defineProperty(EffectRimLightMethod.prototype,"power",{get:function(){return this._power},set:function(value){this._power=value},enumerable:!0,configurable:!0}),EffectRimLightMethod.prototype.iActivate=function(shaderObject,methodVO){var index=methodVO.fragmentConstantsIndex,data=shaderObject.fragmentConstantData;data[index]=this._colorR,data[index+1]=this._colorG,data[index+2]=this._colorB,data[index+4]=this._strength,data[index+5]=this._power},EffectRimLightMethod.prototype.iGetFragmentCode=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){var dataRegister=registerCache.getFreeFragmentConstant(),dataRegister2=registerCache.getFreeFragmentConstant(),temp=registerCache.getFreeFragmentVectorTemp(),code="";return methodVO.fragmentConstantsIndex=4*dataRegister.index,code+="dp3 "+temp+".x, "+sharedRegisters.viewDirFragment+".xyz, "+sharedRegisters.normalFragment+".xyz\n"+"sat "+temp+".x, "+temp+".x\n"+"sub "+temp+".x, "+dataRegister+".w, "+temp+".x\n"+"pow "+temp+".x, "+temp+".x, "+dataRegister2+".y\n"+"mul "+temp+".x, "+temp+".x, "+dataRegister2+".x\n"+"sub "+temp+".x, "+dataRegister+".w, "+temp+".x\n"+"mul "+targetReg+".xyz, "+targetReg+".xyz, "+temp+".x\n"+"sub "+temp+".w, "+dataRegister+".w, "+temp+".x\n",code+=this._blendMode==EffectRimLightMethod.ADD?"mul "+temp+".xyz, "+temp+".w, "+dataRegister+".xyz\n"+"add "+targetReg+".xyz, "+targetReg+".xyz, "+temp+".xyz\n":this._blendMode==EffectRimLightMethod.MULTIPLY?"mul "+temp+".xyz, "+temp+".w, "+dataRegister+".xyz\n"+"mul "+targetReg+".xyz, "+targetReg+".xyz, "+temp+".xyz\n":"sub "+temp+".xyz, "+dataRegister+".xyz, "+targetReg+".xyz\n"+"mul "+temp+".xyz, "+temp+".xyz, "+temp+".w\n"+"add "+targetReg+".xyz, "+targetReg+".xyz, "+temp+".xyz\n" -},EffectRimLightMethod.ADD="add",EffectRimLightMethod.MULTIPLY="multiply",EffectRimLightMethod.MIX="mix",EffectRimLightMethod}(materials.EffectMethodBase);materials.EffectRimLightMethod=EffectRimLightMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var NormalHeightMapMethod=function(_super){function NormalHeightMapMethod(heightMap,worldWidth,worldHeight,worldDepth){_super.call(this),this.normalMap=heightMap,this._worldXYRatio=worldWidth/worldHeight,this._worldXZRatio=worldDepth/worldHeight}return __extends(NormalHeightMapMethod,_super),NormalHeightMapMethod.prototype.iInitConstants=function(shaderObject,methodVO){var index=methodVO.fragmentConstantsIndex,data=shaderObject.fragmentConstantData;data[index]=1/this.normalMap.width,data[index+1]=1/this.normalMap.height,data[index+2]=0,data[index+3]=1,data[index+4]=this._worldXYRatio,data[index+5]=this._worldXZRatio},Object.defineProperty(NormalHeightMapMethod.prototype,"tangentSpace",{get:function(){return!1},enumerable:!0,configurable:!0}),NormalHeightMapMethod.prototype.copyFrom=function(method){_super.prototype.copyFrom.call(this,method),this._worldXYRatio=method._worldXYRatio,this._worldXZRatio=method._worldXZRatio},NormalHeightMapMethod.prototype.iGetFragmentCode=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){var temp=registerCache.getFreeFragmentVectorTemp(),dataReg=registerCache.getFreeFragmentConstant(),dataReg2=registerCache.getFreeFragmentConstant();return this._pNormalTextureRegister=registerCache.getFreeTextureReg(),methodVO.texturesIndex=this._pNormalTextureRegister.index,methodVO.fragmentConstantsIndex=4*dataReg.index,materials.ShaderCompilerHelper.getTex2DSampleCode(targetReg,sharedRegisters,this._pNormalTextureRegister,this.normalMap,shaderObject.useSmoothTextures,shaderObject.repeatTextures,shaderObject.useMipmapping,sharedRegisters.uvVarying,"clamp")+"add "+temp+", "+sharedRegisters.uvVarying+", "+dataReg+".xzzz\n"+materials.ShaderCompilerHelper.getTex2DSampleCode(temp,sharedRegisters,this._pNormalTextureRegister,this.normalMap,shaderObject.useSmoothTextures,shaderObject.repeatTextures,shaderObject.useMipmapping,temp,"clamp")+"sub "+targetReg+".x, "+targetReg+".x, "+temp+".x\n"+"add "+temp+", "+sharedRegisters.uvVarying+", "+dataReg+".zyzz\n"+materials.ShaderCompilerHelper.getTex2DSampleCode(temp,sharedRegisters,this._pNormalTextureRegister,this.normalMap,shaderObject.useSmoothTextures,shaderObject.repeatTextures,shaderObject.useMipmapping,temp,"clamp")+"sub "+targetReg+".z, "+targetReg+".z, "+temp+".x\n"+"mov "+targetReg+".y, "+dataReg+".w\n"+"mul "+targetReg+".xz, "+targetReg+".xz, "+dataReg2+".xy\n"+"nrm "+targetReg+".xyz, "+targetReg+".xyz\n"},NormalHeightMapMethod}(materials.NormalBasicMethod);materials.NormalHeightMapMethod=NormalHeightMapMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var NormalSimpleWaterMethod=function(_super){function NormalSimpleWaterMethod(waveMap1,waveMap2){_super.call(this),this._useSecondNormalMap=!1,this._water1OffsetX=0,this._water1OffsetY=0,this._water2OffsetX=0,this._water2OffsetY=0,this.normalMap=waveMap1,this.secondaryNormalMap=waveMap2}return __extends(NormalSimpleWaterMethod,_super),NormalSimpleWaterMethod.prototype.iInitConstants=function(shaderObject,methodVO){var index=methodVO.fragmentConstantsIndex,data=shaderObject.fragmentConstantData;data[index]=.5,data[index+1]=0,data[index+2]=0,data[index+3]=1},NormalSimpleWaterMethod.prototype.iInitVO=function(shaderObject,methodVO){_super.prototype.iInitVO.call(this,shaderObject,methodVO),this._useSecondNormalMap=this.normalMap!=this.secondaryNormalMap},Object.defineProperty(NormalSimpleWaterMethod.prototype,"water1OffsetX",{get:function(){return this._water1OffsetX},set:function(value){this._water1OffsetX=value},enumerable:!0,configurable:!0}),Object.defineProperty(NormalSimpleWaterMethod.prototype,"water1OffsetY",{get:function(){return this._water1OffsetY},set:function(value){this._water1OffsetY=value},enumerable:!0,configurable:!0}),Object.defineProperty(NormalSimpleWaterMethod.prototype,"water2OffsetX",{get:function(){return this._water2OffsetX},set:function(value){this._water2OffsetX=value},enumerable:!0,configurable:!0}),Object.defineProperty(NormalSimpleWaterMethod.prototype,"water2OffsetY",{get:function(){return this._water2OffsetY},set:function(value){this._water2OffsetY=value},enumerable:!0,configurable:!0}),Object.defineProperty(NormalSimpleWaterMethod.prototype,"secondaryNormalMap",{get:function(){return this._texture2},set:function(value){this._texture2=value},enumerable:!0,configurable:!0}),NormalSimpleWaterMethod.prototype.iCleanCompilationData=function(){_super.prototype.iCleanCompilationData.call(this),this._normalTextureRegister2=null},NormalSimpleWaterMethod.prototype.dispose=function(){_super.prototype.dispose.call(this),this._texture2=null},NormalSimpleWaterMethod.prototype.iActivate=function(shaderObject,methodVO,stage){_super.prototype.iActivate.call(this,shaderObject,methodVO,stage);var data=shaderObject.fragmentConstantData,index=methodVO.fragmentConstantsIndex;data[index+4]=this._water1OffsetX,data[index+5]=this._water1OffsetY,data[index+6]=this._water2OffsetX,data[index+7]=this._water2OffsetY,this._useSecondNormalMap&&stage.context.activateTexture(methodVO.texturesIndex+1,this._texture2)},NormalSimpleWaterMethod.prototype.iGetFragmentCode=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){var temp=registerCache.getFreeFragmentVectorTemp(),dataReg=registerCache.getFreeFragmentConstant(),dataReg2=registerCache.getFreeFragmentConstant();return this._pNormalTextureRegister=registerCache.getFreeTextureReg(),this._normalTextureRegister2=this._useSecondNormalMap?registerCache.getFreeTextureReg():this._pNormalTextureRegister,methodVO.texturesIndex=this._pNormalTextureRegister.index,methodVO.fragmentConstantsIndex=4*dataReg.index,"add "+temp+", "+sharedRegisters.uvVarying+", "+dataReg2+".xyxy\n"+materials.ShaderCompilerHelper.getTex2DSampleCode(targetReg,sharedRegisters,this._pNormalTextureRegister,this.normalMap,shaderObject.useSmoothTextures,shaderObject.repeatTextures,shaderObject.useMipmapping,temp)+"add "+temp+", "+sharedRegisters.uvVarying+", "+dataReg2+".zwzw\n"+materials.ShaderCompilerHelper.getTex2DSampleCode(temp,sharedRegisters,this._normalTextureRegister2,this._texture2,shaderObject.useSmoothTextures,shaderObject.repeatTextures,shaderObject.useMipmapping,temp)+"add "+targetReg+", "+targetReg+", "+temp+" \n"+"mul "+targetReg+", "+targetReg+", "+dataReg+".x \n"+"sub "+targetReg+".xyz, "+targetReg+".xyz, "+sharedRegisters.commons+".xxx \n"+"nrm "+targetReg+".xyz, "+targetReg+".xyz \n"},NormalSimpleWaterMethod}(materials.NormalBasicMethod);materials.NormalSimpleWaterMethod=NormalSimpleWaterMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var DirectionalLight=away.entities.DirectionalLight,Event=away.events.Event,ShadingMethodEvent=away.events.ShadingMethodEvent,ShadowCascadeMethod=function(_super){function ShadowCascadeMethod(shadowMethodBase){var _this=this;if(_super.call(this,shadowMethodBase.castingLight),this._baseMethod=shadowMethodBase,!(this._pCastingLight instanceof DirectionalLight))throw new Error("ShadowCascadeMethod is only compatible with DirectionalLight");if(this._cascadeShadowMapper=this._pCastingLight.shadowMapper,!this._cascadeShadowMapper)throw new Error("ShadowCascadeMethod requires a light that has a CascadeShadowMapper instance assigned to shadowMapper.");this._cascadeShadowMapper.addEventListener(Event.CHANGE,function(event){return _this.onCascadeChange(event)}),this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED,function(event){return _this.onShaderInvalidated(event)})}return __extends(ShadowCascadeMethod,_super),Object.defineProperty(ShadowCascadeMethod.prototype,"baseMethod",{get:function(){return this._baseMethod},set:function(value){var _this=this;this._baseMethod!=value&&(this._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED,function(event){return _this.onShaderInvalidated(event)}),this._baseMethod=value,this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED,function(event){return _this.onShaderInvalidated(event)}),this.iInvalidateShaderProgram())},enumerable:!0,configurable:!0}),ShadowCascadeMethod.prototype.iInitVO=function(shaderObject,methodVO){var tempVO=new materials.MethodVO(this._baseMethod);this._baseMethod.iInitVO(shaderObject,tempVO),methodVO.needsGlobalVertexPos=!0,methodVO.needsProjection=!0},ShadowCascadeMethod.prototype.iInitConstants=function(shaderObject,methodVO){var fragmentData=shaderObject.fragmentConstantData,vertexData=shaderObject.vertexConstantData,index=methodVO.fragmentConstantsIndex;fragmentData[index]=1,fragmentData[index+1]=1/255,fragmentData[index+2]=1/65025,fragmentData[index+3]=1/16581375,fragmentData[index+6]=.5,fragmentData[index+7]=-.5,index=methodVO.vertexConstantsIndex,vertexData[index]=.5,vertexData[index+1]=-.5,vertexData[index+2]=0},ShadowCascadeMethod.prototype.iCleanCompilationData=function(){_super.prototype.iCleanCompilationData.call(this),this._cascadeProjections=null,this._depthMapCoordVaryings=null},ShadowCascadeMethod.prototype.iGetVertexCode=function(shaderObject,methodVO,registerCache,sharedRegisters){var code="",dataReg=registerCache.getFreeVertexConstant();this.initProjectionsRegs(registerCache),methodVO.vertexConstantsIndex=4*dataReg.index;for(var temp=registerCache.getFreeVertexVectorTemp(),i=0;i=0;--i){var uvProjection=this._depthMapCoordVaryings[i];code+="slt "+inQuad+".z, "+sharedRegisters.projectionFragment+".z, "+planeDistances[i]+"\n";var temp=registerCache.getFreeFragmentVectorTemp();code+="sub "+temp+", "+uvProjection+", "+uvCoord+"\n"+"mul "+temp+", "+temp+", "+inQuad+".z\n"+"add "+uvCoord+", "+uvCoord+", "+temp+"\n"}return registerCache.removeFragmentTempUsage(inQuad),code+="div "+uvCoord+", "+uvCoord+", "+uvCoord+".w\n"+"mul "+uvCoord+".xy, "+uvCoord+".xy, "+dataReg+".zw\n"+"add "+uvCoord+".xy, "+uvCoord+".xy, "+dataReg+".zz\n",code+=this._baseMethod._iGetCascadeFragmentCode(shaderObject,methodVO,decReg,depthMapRegister,uvCoord,targetReg,registerCache,sharedRegisters)+"add "+targetReg+".w, "+targetReg+".w, "+dataReg+".y\n",registerCache.removeFragmentTempUsage(uvCoord),code},ShadowCascadeMethod.prototype.iActivate=function(shaderObject,methodVO,stage){stage.context.activateTexture(methodVO.texturesIndex,this._pCastingLight.shadowMapper.depthMap);var vertexData=shaderObject.vertexConstantData,vertexIndex=methodVO.vertexConstantsIndex;shaderObject.vertexConstantData[methodVO.vertexConstantsIndex+3]=-1/(this._cascadeShadowMapper.depth*this._pEpsilon);var numCascades=this._cascadeShadowMapper.numCascades;vertexIndex+=4;for(var k=0;numCascades>k;++k)this._cascadeShadowMapper.getDepthProjections(k).copyRawDataTo(vertexData,vertexIndex,!0),vertexIndex+=16;var fragmentData=shaderObject.fragmentConstantData,fragmentIndex=methodVO.fragmentConstantsIndex;fragmentData[fragmentIndex+5]=1-this._pAlpha;var nearPlaneDistances=this._cascadeShadowMapper._iNearPlaneDistances;fragmentIndex+=8;for(var i=0;numCascades>i;++i)fragmentData[fragmentIndex+i]=nearPlaneDistances[i];this._baseMethod.iActivateForCascade(shaderObject,methodVO,stage)},ShadowCascadeMethod.prototype.iSetRenderState=function(){},ShadowCascadeMethod.prototype.onCascadeChange=function(){this.iInvalidateShaderProgram()},ShadowCascadeMethod.prototype.onShaderInvalidated=function(){this.iInvalidateShaderProgram()},ShadowCascadeMethod}(materials.ShadowMapMethodBase);materials.ShadowCascadeMethod=ShadowCascadeMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var BitmapData=away.base.BitmapData,BitmapTexture=away.textures.BitmapTexture,ShadowDitheredMethod=function(_super){function ShadowDitheredMethod(castingLight,numSamples,range){"undefined"==typeof numSamples&&(numSamples=4),"undefined"==typeof range&&(range=1),_super.call(this,castingLight),this._depthMapSize=this._pCastingLight.shadowMapper.depthMapSize,this.numSamples=numSamples,this.range=range,++ShadowDitheredMethod._grainUsages,ShadowDitheredMethod._grainTexture||this.initGrainTexture()}return __extends(ShadowDitheredMethod,_super),Object.defineProperty(ShadowDitheredMethod.prototype,"numSamples",{get:function(){return this._numSamples},set:function(value){this._numSamples=value,this._numSamples<1?this._numSamples=1:this._numSamples>24&&(this._numSamples=24),this.iInvalidateShaderProgram()},enumerable:!0,configurable:!0}),ShadowDitheredMethod.prototype.iInitVO=function(shaderObject,methodVO){_super.prototype.iInitVO.call(this,shaderObject,methodVO),methodVO.needsProjection=!0},ShadowDitheredMethod.prototype.iInitConstants=function(shaderObject,methodVO){_super.prototype.iInitConstants.call(this,shaderObject,methodVO);var fragmentData=shaderObject.fragmentConstantData,index=methodVO.fragmentConstantsIndex;fragmentData[index+8]=1/this._numSamples},Object.defineProperty(ShadowDitheredMethod.prototype,"range",{get:function(){return 2*this._range},set:function(value){this._range=value/2},enumerable:!0,configurable:!0}),ShadowDitheredMethod.prototype.initGrainTexture=function(){ShadowDitheredMethod._grainBitmapData=new BitmapData(64,64,!1);for(var r,g,vec=new Array,len=4096,step=1/(this._depthMapSize*this._range),i=0;len>i;++i)r=2*(Math.random()-.5),g=2*(Math.random()-.5),0>r?r-=step:r+=step,0>g?g-=step:g+=step,r>1?r=1:-1>r&&(r=-1),g>1?g=1:-1>g&&(g=-1),vec[i]=Math.floor(255*(.5*r+.5))<<16|Math.floor(255*(.5*g+.5))<<8;ShadowDitheredMethod._grainBitmapData.setVector(ShadowDitheredMethod._grainBitmapData.rect,vec),ShadowDitheredMethod._grainTexture=new BitmapTexture(ShadowDitheredMethod._grainBitmapData)},ShadowDitheredMethod.prototype.dispose=function(){0==--ShadowDitheredMethod._grainUsages&&(ShadowDitheredMethod._grainTexture.dispose(),ShadowDitheredMethod._grainBitmapData.dispose(),ShadowDitheredMethod._grainTexture=null)},ShadowDitheredMethod.prototype.iActivate=function(shaderObject,methodVO,stage){_super.prototype.iActivate.call(this,shaderObject,methodVO,stage);var data=shaderObject.fragmentConstantData,index=methodVO.fragmentConstantsIndex;data[index+9]=(stage.width-1)/63,data[index+10]=(stage.height-1)/63,data[index+11]=2*this._range/this._depthMapSize,stage.context.activateTexture(methodVO.texturesIndex+1,ShadowDitheredMethod._grainTexture)},ShadowDitheredMethod.prototype._pGetPlanarFragmentCode=function(methodVO,targetReg,regCache,sharedRegisters){var depthMapRegister=regCache.getFreeTextureReg(),decReg=regCache.getFreeFragmentConstant();regCache.getFreeFragmentConstant();var customDataReg=regCache.getFreeFragmentConstant();return methodVO.fragmentConstantsIndex=4*decReg.index,methodVO.texturesIndex=depthMapRegister.index,this.getSampleCode(customDataReg,depthMapRegister,decReg,targetReg,regCache,sharedRegisters)},ShadowDitheredMethod.prototype.getSampleCode=function(customDataReg,depthMapRegister,decReg,targetReg,regCache,sharedRegisters){var code="",grainRegister=regCache.getFreeTextureReg(),uvReg=regCache.getFreeFragmentVectorTemp(),numSamples=this._numSamples;regCache.addFragmentTempUsages(uvReg,1);var temp=regCache.getFreeFragmentVectorTemp(),projectionReg=sharedRegisters.projectionFragment;for(code+="div "+uvReg+", "+projectionReg+", "+projectionReg+".w\n"+"mul "+uvReg+".xy, "+uvReg+".xy, "+customDataReg+".yz\n";numSamples>0;)code+=numSamples==this._numSamples?"tex "+uvReg+", "+uvReg+", "+grainRegister+" <2d,nearest,repeat,mipnone>\n":"tex "+uvReg+", "+uvReg+".zwxy, "+grainRegister+" <2d,nearest,repeat,mipnone>\n",code+="sub "+uvReg+".zw, "+uvReg+".xy, fc0.xx\n"+"mul "+uvReg+".zw, "+uvReg+".zw, "+customDataReg+".w\n",code+=numSamples==this._numSamples?"add "+uvReg+".xy, "+uvReg+".zw, "+this._pDepthMapCoordReg+".xy\n"+"tex "+temp+", "+uvReg+", "+depthMapRegister+" <2d,nearest,clamp,mipnone>\n"+"dp4 "+temp+".z, "+temp+", "+decReg+"\n"+"slt "+targetReg+".w, "+this._pDepthMapCoordReg+".z, "+temp+".z\n":this.addSample(uvReg,depthMapRegister,decReg,targetReg,regCache),numSamples>4&&(code+="add "+uvReg+".xy, "+uvReg+".xy, "+uvReg+".zw\n"+this.addSample(uvReg,depthMapRegister,decReg,targetReg,regCache)),numSamples>1&&(code+="sub "+uvReg+".xy, "+this._pDepthMapCoordReg+".xy, "+uvReg+".zw\n"+this.addSample(uvReg,depthMapRegister,decReg,targetReg,regCache)),numSamples>5&&(code+="sub "+uvReg+".xy, "+uvReg+".xy, "+uvReg+".zw\n"+this.addSample(uvReg,depthMapRegister,decReg,targetReg,regCache)),numSamples>2&&(code+="neg "+uvReg+".w, "+uvReg+".w\n",code+="add "+uvReg+".xy, "+uvReg+".wz, "+this._pDepthMapCoordReg+".xy\n"+this.addSample(uvReg,depthMapRegister,decReg,targetReg,regCache)),numSamples>6&&(code+="add "+uvReg+".xy, "+uvReg+".xy, "+uvReg+".wz\n"+this.addSample(uvReg,depthMapRegister,decReg,targetReg,regCache)),numSamples>3&&(code+="sub "+uvReg+".xy, "+this._pDepthMapCoordReg+".xy, "+uvReg+".wz\n"+this.addSample(uvReg,depthMapRegister,decReg,targetReg,regCache)),numSamples>7&&(code+="sub "+uvReg+".xy, "+uvReg+".xy, "+uvReg+".wz\n"+this.addSample(uvReg,depthMapRegister,decReg,targetReg,regCache)),numSamples-=8;return regCache.removeFragmentTempUsage(uvReg),code+="mul "+targetReg+".w, "+targetReg+".w, "+customDataReg+".x\n"},ShadowDitheredMethod.prototype.addSample=function(uvReg,depthMapRegister,decReg,targetReg,regCache){var temp=regCache.getFreeFragmentVectorTemp();return"tex "+temp+", "+uvReg+", "+depthMapRegister+" <2d,nearest,clamp,mipnone>\n"+"dp4 "+temp+".z, "+temp+", "+decReg+"\n"+"slt "+temp+".z, "+this._pDepthMapCoordReg+".z, "+temp+".z\n"+"add "+targetReg+".w, "+targetReg+".w, "+temp+".z\n"},ShadowDitheredMethod.prototype.iActivateForCascade=function(shaderObject,methodVO,stage){var data=shaderObject.fragmentConstantData,index=methodVO.secondaryFragmentConstantsIndex;data[index]=1/this._numSamples,data[index+1]=(stage.width-1)/63,data[index+2]=(stage.height-1)/63,data[index+3]=2*this._range/this._depthMapSize,stage.context.activateTexture(methodVO.texturesIndex+1,ShadowDitheredMethod._grainTexture)},ShadowDitheredMethod.prototype._iGetCascadeFragmentCode=function(shaderObject,methodVO,decodeRegister,depthTexture,depthProjection,targetRegister,registerCache,sharedRegisters){this._pDepthMapCoordReg=depthProjection;var dataReg=registerCache.getFreeFragmentConstant();return methodVO.secondaryFragmentConstantsIndex=4*dataReg.index,this.getSampleCode(dataReg,depthTexture,decodeRegister,targetRegister,registerCache,sharedRegisters)},ShadowDitheredMethod}(materials.ShadowMethodBase);materials.ShadowDitheredMethod=ShadowDitheredMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var ShadowFilteredMethod=function(_super){function ShadowFilteredMethod(castingLight){_super.call(this,castingLight)}return __extends(ShadowFilteredMethod,_super),ShadowFilteredMethod.prototype.iInitConstants=function(shaderObject,methodVO){_super.prototype.iInitConstants.call(this,shaderObject,methodVO);var fragmentData=shaderObject.fragmentConstantData,index=methodVO.fragmentConstantsIndex;fragmentData[index+8]=.5;var size=this.castingLight.shadowMapper.depthMapSize;fragmentData[index+9]=size,fragmentData[index+10]=1/size},ShadowFilteredMethod.prototype._pGetPlanarFragmentCode=function(methodVO,targetReg,regCache){var depthMapRegister=regCache.getFreeTextureReg(),decReg=regCache.getFreeFragmentConstant(),dataReg=regCache.getFreeFragmentConstant();dataReg=dataReg;var uvReg,customDataReg=regCache.getFreeFragmentConstant(),depthCol=regCache.getFreeFragmentVectorTemp(),code="";return methodVO.fragmentConstantsIndex=4*decReg.index,regCache.addFragmentTempUsages(depthCol,1),uvReg=regCache.getFreeFragmentVectorTemp(),regCache.addFragmentTempUsages(uvReg,1),code+="mov "+uvReg+", "+this._pDepthMapCoordReg+"\n"+"tex "+depthCol+", "+this._pDepthMapCoordReg+", "+depthMapRegister+" <2d, nearest, clamp>\n"+"dp4 "+depthCol+".z, "+depthCol+", "+decReg+"\n"+"slt "+uvReg+".z, "+this._pDepthMapCoordReg+".z, "+depthCol+".z\n"+"add "+uvReg+".x, "+this._pDepthMapCoordReg+".x, "+customDataReg+".z\n"+"tex "+depthCol+", "+uvReg+", "+depthMapRegister+" <2d, nearest, clamp>\n"+"dp4 "+depthCol+".z, "+depthCol+", "+decReg+"\n"+"slt "+uvReg+".w, "+this._pDepthMapCoordReg+".z, "+depthCol+".z\n"+"mul "+depthCol+".x, "+this._pDepthMapCoordReg+".x, "+customDataReg+".y\n"+"frc "+depthCol+".x, "+depthCol+".x\n"+"sub "+uvReg+".w, "+uvReg+".w, "+uvReg+".z\n"+"mul "+uvReg+".w, "+uvReg+".w, "+depthCol+".x\n"+"add "+targetReg+".w, "+uvReg+".z, "+uvReg+".w\n"+"mov "+uvReg+".x, "+this._pDepthMapCoordReg+".x\n"+"add "+uvReg+".y, "+this._pDepthMapCoordReg+".y, "+customDataReg+".z\n"+"tex "+depthCol+", "+uvReg+", "+depthMapRegister+" <2d, nearest, clamp>\n"+"dp4 "+depthCol+".z, "+depthCol+", "+decReg+"\n"+"slt "+uvReg+".z, "+this._pDepthMapCoordReg+".z, "+depthCol+".z\n"+"add "+uvReg+".x, "+this._pDepthMapCoordReg+".x, "+customDataReg+".z\n"+"tex "+depthCol+", "+uvReg+", "+depthMapRegister+" <2d, nearest, clamp>\n"+"dp4 "+depthCol+".z, "+depthCol+", "+decReg+"\n"+"slt "+uvReg+".w, "+this._pDepthMapCoordReg+".z, "+depthCol+".z\n"+"mul "+depthCol+".x, "+this._pDepthMapCoordReg+".x, "+customDataReg+".y\n"+"frc "+depthCol+".x, "+depthCol+".x\n"+"sub "+uvReg+".w, "+uvReg+".w, "+uvReg+".z\n"+"mul "+uvReg+".w, "+uvReg+".w, "+depthCol+".x\n"+"add "+uvReg+".w, "+uvReg+".z, "+uvReg+".w\n"+"mul "+depthCol+".x, "+this._pDepthMapCoordReg+".y, "+customDataReg+".y\n"+"frc "+depthCol+".x, "+depthCol+".x\n"+"sub "+uvReg+".w, "+uvReg+".w, "+targetReg+".w\n"+"mul "+uvReg+".w, "+uvReg+".w, "+depthCol+".x\n"+"add "+targetReg+".w, "+targetReg+".w, "+uvReg+".w\n",regCache.removeFragmentTempUsage(depthCol),regCache.removeFragmentTempUsage(uvReg),methodVO.texturesIndex=depthMapRegister.index,code},ShadowFilteredMethod.prototype.iActivateForCascade=function(shaderObject,methodVO){var size=this.castingLight.shadowMapper.depthMapSize,index=methodVO.secondaryFragmentConstantsIndex,data=shaderObject.fragmentConstantData;data[index]=size,data[index+1]=1/size},ShadowFilteredMethod.prototype._iGetCascadeFragmentCode=function(shaderObject,methodVO,decodeRegister,depthTexture,depthProjection,targetRegister,registerCache){var code,dataReg=registerCache.getFreeFragmentConstant();methodVO.secondaryFragmentConstantsIndex=4*dataReg.index;var temp=registerCache.getFreeFragmentVectorTemp();registerCache.addFragmentTempUsages(temp,1);var predicate=registerCache.getFreeFragmentVectorTemp();return registerCache.addFragmentTempUsages(predicate,1),code="tex "+temp+", "+depthProjection+", "+depthTexture+" <2d, nearest, clamp>\n"+"dp4 "+temp+".z, "+temp+", "+decodeRegister+"\n"+"slt "+predicate+".x, "+depthProjection+".z, "+temp+".z\n"+"add "+depthProjection+".x, "+depthProjection+".x, "+dataReg+".y\n"+"tex "+temp+", "+depthProjection+", "+depthTexture+" <2d, nearest, clamp>\n"+"dp4 "+temp+".z, "+temp+", "+decodeRegister+"\n"+"slt "+predicate+".z, "+depthProjection+".z, "+temp+".z\n"+"add "+depthProjection+".y, "+depthProjection+".y, "+dataReg+".y\n"+"tex "+temp+", "+depthProjection+", "+depthTexture+" <2d, nearest, clamp>\n"+"dp4 "+temp+".z, "+temp+", "+decodeRegister+"\n"+"slt "+predicate+".w, "+depthProjection+".z, "+temp+".z\n"+"sub "+depthProjection+".x, "+depthProjection+".x, "+dataReg+".y\n"+"tex "+temp+", "+depthProjection+", "+depthTexture+" <2d, nearest, clamp>\n"+"dp4 "+temp+".z, "+temp+", "+decodeRegister+"\n"+"slt "+predicate+".y, "+depthProjection+".z, "+temp+".z\n"+"mul "+temp+".xy, "+depthProjection+".xy, "+dataReg+".x\n"+"frc "+temp+".xy, "+temp+".xy\n"+"sub "+depthProjection+", "+predicate+".xyzw, "+predicate+".zwxy\n"+"mul "+depthProjection+", "+depthProjection+", "+temp+".x\n"+"add "+predicate+".xy, "+predicate+".xy, "+depthProjection+".zw\n"+"sub "+predicate+".y, "+predicate+".y, "+predicate+".x\n"+"mul "+predicate+".y, "+predicate+".y, "+temp+".y\n"+"add "+targetRegister+".w, "+predicate+".x, "+predicate+".y\n",registerCache.removeFragmentTempUsage(temp),registerCache.removeFragmentTempUsage(predicate),code},ShadowFilteredMethod}(materials.ShadowMethodBase);materials.ShadowFilteredMethod=ShadowFilteredMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var ShadingMethodEvent=away.events.ShadingMethodEvent,ShadowNearMethod=function(_super){function ShadowNearMethod(baseMethod,fadeRatio){"undefined"==typeof fadeRatio&&(fadeRatio=.1);var _this=this;if(_super.call(this,baseMethod.castingLight),this._onShaderInvalidatedDelegate=function(event){return _this.onShaderInvalidated(event)},this._baseMethod=baseMethod,this._fadeRatio=fadeRatio,this._nearShadowMapper=this._pCastingLight.shadowMapper,!this._nearShadowMapper)throw new Error("ShadowNearMethod requires a light that has a NearDirectionalShadowMapper instance assigned to shadowMapper.");this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED,this._onShaderInvalidatedDelegate)}return __extends(ShadowNearMethod,_super),Object.defineProperty(ShadowNearMethod.prototype,"baseMethod",{get:function(){return this._baseMethod},set:function(value){this._baseMethod!=value&&(this._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED,this._onShaderInvalidatedDelegate),this._baseMethod=value,this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED,this._onShaderInvalidatedDelegate),this.iInvalidateShaderProgram())},enumerable:!0,configurable:!0}),ShadowNearMethod.prototype.iInitConstants=function(shaderObject,methodVO){_super.prototype.iInitConstants.call(this,shaderObject,methodVO),this._baseMethod.iInitConstants(shaderObject,methodVO);var fragmentData=shaderObject.fragmentConstantData,index=methodVO.secondaryFragmentConstantsIndex;fragmentData[index+2]=0,fragmentData[index+3]=1},ShadowNearMethod.prototype.iInitVO=function(shaderObject,methodVO){this._baseMethod.iInitVO(shaderObject,methodVO),methodVO.needsProjection=!0},ShadowNearMethod.prototype.dispose=function(){this._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED,this._onShaderInvalidatedDelegate)},Object.defineProperty(ShadowNearMethod.prototype,"alpha",{get:function(){return this._baseMethod.alpha},set:function(value){this._baseMethod.alpha=value},enumerable:!0,configurable:!0}),Object.defineProperty(ShadowNearMethod.prototype,"epsilon",{get:function(){return this._baseMethod.epsilon},set:function(value){this._baseMethod.epsilon=value},enumerable:!0,configurable:!0}),Object.defineProperty(ShadowNearMethod.prototype,"fadeRatio",{get:function(){return this._fadeRatio},set:function(value){this._fadeRatio=value},enumerable:!0,configurable:!0}),ShadowNearMethod.prototype.iGetFragmentCode=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){var code=this._baseMethod.iGetFragmentCode(shaderObject,methodVO,targetReg,registerCache,sharedRegisters),dataReg=registerCache.getFreeFragmentConstant(),temp=registerCache.getFreeFragmentSingleTemp();return methodVO.secondaryFragmentConstantsIndex=4*dataReg.index,code+="abs "+temp+", "+sharedRegisters.projectionFragment+".w\n"+"sub "+temp+", "+temp+", "+dataReg+".x\n"+"mul "+temp+", "+temp+", "+dataReg+".y\n"+"sat "+temp+", "+temp+"\n"+"sub "+temp+", "+dataReg+".w,"+temp+"\n"+"sub "+targetReg+".w, "+dataReg+".w,"+targetReg+".w\n"+"mul "+targetReg+".w, "+targetReg+".w, "+temp+"\n"+"sub "+targetReg+".w, "+dataReg+".w,"+targetReg+".w\n"},ShadowNearMethod.prototype.iActivate=function(shaderObject,methodVO,stage){this._baseMethod.iActivate(shaderObject,methodVO,stage)},ShadowNearMethod.prototype.iDeactivate=function(shaderObject,methodVO,stage){this._baseMethod.iDeactivate(shaderObject,methodVO,stage)},ShadowNearMethod.prototype.iSetRenderState=function(shaderObject,methodVO,renderable,stage,camera){var near=camera.projection.near,d=camera.projection.far-near,maxDistance=this._nearShadowMapper.coverageRatio,minDistance=maxDistance*(1-this._fadeRatio);maxDistance=near+maxDistance*d,minDistance=near+minDistance*d;var fragmentData=shaderObject.fragmentConstantData,index=methodVO.secondaryFragmentConstantsIndex;fragmentData[index]=minDistance,fragmentData[index+1]=1/(maxDistance-minDistance),this._baseMethod.iSetRenderState(shaderObject,methodVO,renderable,stage,camera)},ShadowNearMethod.prototype.iGetVertexCode=function(shaderObject,methodVO,registerCache,sharedRegisters){return this._baseMethod.iGetVertexCode(shaderObject,methodVO,registerCache,sharedRegisters)},ShadowNearMethod.prototype.iReset=function(){this._baseMethod.iReset()},ShadowNearMethod.prototype.iCleanCompilationData=function(){_super.prototype.iCleanCompilationData.call(this),this._baseMethod.iCleanCompilationData()},ShadowNearMethod.prototype.onShaderInvalidated=function(){this.iInvalidateShaderProgram()},ShadowNearMethod}(materials.ShadowMethodBase);materials.ShadowNearMethod=ShadowNearMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var ShadowSoftMethod=function(_super){function ShadowSoftMethod(castingLight,numSamples,range){"undefined"==typeof numSamples&&(numSamples=5),"undefined"==typeof range&&(range=1),_super.call(this,castingLight),this._range=1,this.numSamples=numSamples,this.range=range}return __extends(ShadowSoftMethod,_super),Object.defineProperty(ShadowSoftMethod.prototype,"numSamples",{get:function(){return this._numSamples},set:function(value){this._numSamples=value,this._numSamples<1?this._numSamples=1:this._numSamples>32&&(this._numSamples=32),this._offsets=away.geom.PoissonLookup.getDistribution(this._numSamples),this.iInvalidateShaderProgram()},enumerable:!0,configurable:!0}),Object.defineProperty(ShadowSoftMethod.prototype,"range",{get:function(){return this._range},set:function(value){this._range=value},enumerable:!0,configurable:!0}),ShadowSoftMethod.prototype.iInitConstants=function(shaderObject,methodVO){_super.prototype.iInitConstants.call(this,shaderObject,methodVO),shaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex+8]=1/this._numSamples,shaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex+9]=0},ShadowSoftMethod.prototype.iActivate=function(shaderObject,methodVO,stage){_super.prototype.iActivate.call(this,shaderObject,methodVO,stage); -for(var texRange=.5*this._range/this._pCastingLight.shadowMapper.depthMapSize,data=shaderObject.fragmentConstantData,index=methodVO.fragmentConstantsIndex+10,len=this._numSamples<<1,i=0;len>i;++i)data[index+i]=this._offsets[i]*texRange},ShadowSoftMethod.prototype._pGetPlanarFragmentCode=function(methodVO,targetReg,regCache){var depthMapRegister=regCache.getFreeTextureReg(),decReg=regCache.getFreeFragmentConstant();regCache.getFreeFragmentConstant();var customDataReg=regCache.getFreeFragmentConstant();return methodVO.fragmentConstantsIndex=4*decReg.index,methodVO.texturesIndex=depthMapRegister.index,this.getSampleCode(regCache,depthMapRegister,decReg,targetReg,customDataReg)},ShadowSoftMethod.prototype.addSample=function(uv,texture,decode,target,regCache){var temp=regCache.getFreeFragmentVectorTemp();return"tex "+temp+", "+uv+", "+texture+" <2d,nearest,clamp>\n"+"dp4 "+temp+".z, "+temp+", "+decode+"\n"+"slt "+uv+".w, "+this._pDepthMapCoordReg+".z, "+temp+".z\n"+"add "+target+".w, "+target+".w, "+uv+".w\n"},ShadowSoftMethod.prototype.iActivateForCascade=function(shaderObject,methodVO,stage){_super.prototype.iActivate.call(this,shaderObject,methodVO,stage);var texRange=this._range/this._pCastingLight.shadowMapper.depthMapSize,data=shaderObject.fragmentConstantData,index=methodVO.secondaryFragmentConstantsIndex,len=this._numSamples<<1;data[index]=1/this._numSamples,data[index+1]=0,index+=2;for(var i=0;len>i;++i)data[index+i]=this._offsets[i]*texRange;0==len%4&&(data[index+len]=0,data[index+len+1]=0)},ShadowSoftMethod.prototype._iGetCascadeFragmentCode=function(shaderObject,methodVO,decodeRegister,depthTexture,depthProjection,targetRegister,registerCache){this._pDepthMapCoordReg=depthProjection;var dataReg=registerCache.getFreeFragmentConstant();return methodVO.secondaryFragmentConstantsIndex=4*dataReg.index,this.getSampleCode(registerCache,depthTexture,decodeRegister,targetRegister,dataReg)},ShadowSoftMethod.prototype.getSampleCode=function(regCache,depthTexture,decodeRegister,targetRegister,dataReg){var uvReg,code,offsets=new Array(dataReg+".zw");uvReg=regCache.getFreeFragmentVectorTemp(),regCache.addFragmentTempUsages(uvReg,1);for(var temp=regCache.getFreeFragmentVectorTemp(),numRegs=this._numSamples>>1,i=0;numRegs>i;++i){var reg=regCache.getFreeFragmentConstant();offsets.push(reg+".xy"),offsets.push(reg+".zw")}for(i=0;i\n"+"dp4 "+temp+".z, "+temp+", "+decodeRegister+"\n"+"slt "+targetRegister+".w, "+this._pDepthMapCoordReg+".z, "+temp+".z\n":code+="add "+uvReg+".xy, "+this._pDepthMapCoordReg+".xy, "+offsets[i]+"\n"+this.addSample(uvReg,depthTexture,decodeRegister,targetRegister,regCache);return regCache.removeFragmentTempUsage(uvReg),code+="mul "+targetRegister+".w, "+targetRegister+".w, "+dataReg+".x\n"},ShadowSoftMethod}(materials.ShadowMethodBase);materials.ShadowSoftMethod=ShadowSoftMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var Delegate=away.utils.Delegate,ShadingMethodEvent=away.events.ShadingMethodEvent,SpecularCompositeMethod=function(_super){function SpecularCompositeMethod(modulateMethod,baseMethod){"undefined"==typeof baseMethod&&(baseMethod=null),_super.call(this),this._onShaderInvalidatedDelegate=Delegate.create(this,this.onShaderInvalidated),this._baseMethod=baseMethod||new materials.SpecularBasicMethod,this._baseMethod._iModulateMethod=modulateMethod,this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED,this._onShaderInvalidatedDelegate)}return __extends(SpecularCompositeMethod,_super),SpecularCompositeMethod.prototype.iInitVO=function(shaderObject,methodVO){this._baseMethod.iInitVO(shaderObject,methodVO)},SpecularCompositeMethod.prototype.iInitConstants=function(shaderObject,methodVO){this._baseMethod.iInitConstants(shaderObject,methodVO)},Object.defineProperty(SpecularCompositeMethod.prototype,"baseMethod",{get:function(){return this._baseMethod},set:function(value){this._baseMethod!=value&&(this._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED,this._onShaderInvalidatedDelegate),this._baseMethod=value,this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED,this._onShaderInvalidatedDelegate),this.iInvalidateShaderProgram())},enumerable:!0,configurable:!0}),Object.defineProperty(SpecularCompositeMethod.prototype,"gloss",{get:function(){return this._baseMethod.gloss},set:function(value){this._baseMethod.gloss=value},enumerable:!0,configurable:!0}),Object.defineProperty(SpecularCompositeMethod.prototype,"specular",{get:function(){return this._baseMethod.specular},set:function(value){this._baseMethod.specular=value},enumerable:!0,configurable:!0}),Object.defineProperty(SpecularCompositeMethod.prototype,"passes",{get:function(){return this._baseMethod.passes},enumerable:!0,configurable:!0}),SpecularCompositeMethod.prototype.dispose=function(){this._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED,this._onShaderInvalidatedDelegate),this._baseMethod.dispose()},Object.defineProperty(SpecularCompositeMethod.prototype,"texture",{get:function(){return this._baseMethod.texture},set:function(value){this._baseMethod.texture=value},enumerable:!0,configurable:!0}),SpecularCompositeMethod.prototype.iActivate=function(shaderObject,methodVO,stage){this._baseMethod.iActivate(shaderObject,methodVO,stage)},SpecularCompositeMethod.prototype.iSetRenderState=function(shaderObject,methodVO,renderable,stage,camera){this._baseMethod.iSetRenderState(shaderObject,methodVO,renderable,stage,camera)},SpecularCompositeMethod.prototype.iDeactivate=function(shaderObject,methodVO,stage){this._baseMethod.iDeactivate(shaderObject,methodVO,stage)},SpecularCompositeMethod.prototype.iGetVertexCode=function(shaderObject,methodVO,registerCache,sharedRegisters){return this._baseMethod.iGetVertexCode(shaderObject,methodVO,registerCache,sharedRegisters)},SpecularCompositeMethod.prototype.iGetFragmentPreLightingCode=function(shaderObject,methodVO,registerCache,sharedRegisters){return this._baseMethod.iGetFragmentPreLightingCode(shaderObject,methodVO,registerCache,sharedRegisters)},SpecularCompositeMethod.prototype.iGetFragmentCodePerLight=function(shaderObject,methodVO,lightDirReg,lightColReg,registerCache,sharedRegisters){return this._baseMethod.iGetFragmentCodePerLight(shaderObject,methodVO,lightDirReg,lightColReg,registerCache,sharedRegisters)},SpecularCompositeMethod.prototype.iGetFragmentCodePerProbe=function(shaderObject,methodVO,cubeMapReg,weightRegister,registerCache,sharedRegisters){return this._baseMethod.iGetFragmentCodePerProbe(shaderObject,methodVO,cubeMapReg,weightRegister,registerCache,sharedRegisters)},SpecularCompositeMethod.prototype.iGetFragmentPostLightingCode=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){return this._baseMethod.iGetFragmentPostLightingCode(shaderObject,methodVO,targetReg,registerCache,sharedRegisters)},SpecularCompositeMethod.prototype.iReset=function(){this._baseMethod.iReset()},SpecularCompositeMethod.prototype.iCleanCompilationData=function(){_super.prototype.iCleanCompilationData.call(this),this._baseMethod.iCleanCompilationData()},SpecularCompositeMethod.prototype.onShaderInvalidated=function(){this.iInvalidateShaderProgram()},SpecularCompositeMethod}(materials.SpecularBasicMethod);materials.SpecularCompositeMethod=SpecularCompositeMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var SpecularAnisotropicMethod=function(_super){function SpecularAnisotropicMethod(){_super.call(this)}return __extends(SpecularAnisotropicMethod,_super),SpecularAnisotropicMethod.prototype.iInitVO=function(shaderObject,methodVO){methodVO.needsTangents=!0,methodVO.needsView=!0},SpecularAnisotropicMethod.prototype.iGetFragmentCodePerLight=function(shaderObject,methodVO,lightDirReg,lightColReg,registerCache,sharedRegisters){var t,code="";return this._pIsFirstLight?t=this._pTotalLightColorReg:(t=registerCache.getFreeFragmentVectorTemp(),registerCache.addFragmentTempUsages(t,1)),code+="nrm "+t+".xyz, "+sharedRegisters.tangentVarying+".xyz\n"+"dp3 "+t+".w, "+t+".xyz, "+lightDirReg+".xyz\n"+"dp3 "+t+".z, "+t+".xyz, "+sharedRegisters.viewDirFragment+".xyz\n",code+="sin "+t+".x, "+t+".w\n"+"sin "+t+".y, "+t+".z\n"+"mul "+t+".x, "+t+".x, "+t+".y\n"+"cos "+t+".z, "+t+".z\n"+"cos "+t+".w, "+t+".w\n"+"mul "+t+".w, "+t+".w, "+t+".z\n"+"sub "+t+".w, "+t+".x, "+t+".w\n",code+=this._pUseTexture?"mul "+this._pSpecularTexData+".w, "+this._pSpecularTexData+".y, "+this._pSpecularDataRegister+".w\n"+"pow "+t+".w, "+t+".w, "+this._pSpecularTexData+".w\n":"pow "+t+".w, "+t+".w, "+this._pSpecularDataRegister+".w\n",code+="mul "+t+".w, "+t+".w, "+lightDirReg+".w\n",null!=this._iModulateMethod&&(code+=this._iModulateMethod(shaderObject,methodVO,t,registerCache,sharedRegisters)),code+="mul "+t+".xyz, "+lightColReg+".xyz, "+t+".w\n",this._pIsFirstLight||(code+="add "+this._pTotalLightColorReg+".xyz, "+this._pTotalLightColorReg+".xyz, "+t+".xyz\n",registerCache.removeFragmentTempUsage(t)),this._pIsFirstLight=!1,code},SpecularAnisotropicMethod}(materials.SpecularBasicMethod);materials.SpecularAnisotropicMethod=SpecularAnisotropicMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var SpecularCelMethod=function(_super){function SpecularCelMethod(specularCutOff,baseMethod){"undefined"==typeof specularCutOff&&(specularCutOff=.5),"undefined"==typeof baseMethod&&(baseMethod=null);var _this=this;_super.call(this,null,baseMethod),this._smoothness=.1,this._specularCutOff=.1,this.baseMethod._iModulateMethod=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){return _this.clampSpecular(shaderObject,methodVO,targetReg,registerCache,sharedRegisters)},this._specularCutOff=specularCutOff}return __extends(SpecularCelMethod,_super),Object.defineProperty(SpecularCelMethod.prototype,"smoothness",{get:function(){return this._smoothness},set:function(value){this._smoothness=value},enumerable:!0,configurable:!0}),Object.defineProperty(SpecularCelMethod.prototype,"specularCutOff",{get:function(){return this._specularCutOff},set:function(value){this._specularCutOff=value},enumerable:!0,configurable:!0}),SpecularCelMethod.prototype.iActivate=function(shaderObject,methodVO,stage){_super.prototype.iActivate.call(this,shaderObject,methodVO,stage);var index=methodVO.secondaryFragmentConstantsIndex,data=shaderObject.fragmentConstantData;data[index]=this._smoothness,data[index+1]=this._specularCutOff},SpecularCelMethod.prototype.iCleanCompilationData=function(){_super.prototype.iCleanCompilationData.call(this),this._dataReg=null},SpecularCelMethod.prototype.clampSpecular=function(shaderObject,methodVO,targetReg){return"sub "+targetReg+".y, "+targetReg+".w, "+this._dataReg+".y\n"+"div "+targetReg+".y, "+targetReg+".y, "+this._dataReg+".x\n"+"sat "+targetReg+".y, "+targetReg+".y\n"+"sge "+targetReg+".w, "+targetReg+".w, "+this._dataReg+".y\n"+"mul "+targetReg+".w, "+targetReg+".w, "+targetReg+".y\n"},SpecularCelMethod.prototype.iGetFragmentPreLightingCode=function(shaderObject,methodVO,registerCache,sharedRegisters){return this._dataReg=registerCache.getFreeFragmentConstant(),methodVO.secondaryFragmentConstantsIndex=4*this._dataReg.index,_super.prototype.iGetFragmentPreLightingCode.call(this,shaderObject,methodVO,registerCache,sharedRegisters)},SpecularCelMethod}(materials.SpecularCompositeMethod);materials.SpecularCelMethod=SpecularCelMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var SpecularFresnelMethod=function(_super){function SpecularFresnelMethod(basedOnSurface,baseMethod){"undefined"==typeof basedOnSurface&&(basedOnSurface=!0),"undefined"==typeof baseMethod&&(baseMethod=null);var _this=this;_super.call(this,null,baseMethod),this._fresnelPower=5,this._normalReflectance=.028,this.baseMethod._iModulateMethod=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){return _this.modulateSpecular(shaderObject,methodVO,targetReg,registerCache,sharedRegisters)},this._incidentLight=!basedOnSurface}return __extends(SpecularFresnelMethod,_super),SpecularFresnelMethod.prototype.iInitConstants=function(shaderObject,methodVO){var index=methodVO.secondaryFragmentConstantsIndex;shaderObject.fragmentConstantData[index+2]=1,shaderObject.fragmentConstantData[index+3]=0},Object.defineProperty(SpecularFresnelMethod.prototype,"basedOnSurface",{get:function(){return!this._incidentLight},set:function(value){this._incidentLight==value&&(this._incidentLight=!value,this.iInvalidateShaderProgram())},enumerable:!0,configurable:!0}),Object.defineProperty(SpecularFresnelMethod.prototype,"fresnelPower",{get:function(){return this._fresnelPower},set:function(value){this._fresnelPower=value},enumerable:!0,configurable:!0}),SpecularFresnelMethod.prototype.iCleanCompilationData=function(){_super.prototype.iCleanCompilationData.call(this),this._dataReg=null},Object.defineProperty(SpecularFresnelMethod.prototype,"normalReflectance",{get:function(){return this._normalReflectance},set:function(value){this._normalReflectance=value},enumerable:!0,configurable:!0}),SpecularFresnelMethod.prototype.iActivate=function(shaderObject,methodVO,stage){_super.prototype.iActivate.call(this,shaderObject,methodVO,stage);var fragmentData=shaderObject.fragmentConstantData,index=methodVO.secondaryFragmentConstantsIndex;fragmentData[index]=this._normalReflectance,fragmentData[index+1]=this._fresnelPower},SpecularFresnelMethod.prototype.iGetFragmentPreLightingCode=function(shaderObject,methodVO,registerCache,sharedRegisters){return this._dataReg=registerCache.getFreeFragmentConstant(),console.log("SpecularFresnelMethod","iGetFragmentPreLightingCode",this._dataReg),methodVO.secondaryFragmentConstantsIndex=4*this._dataReg.index,_super.prototype.iGetFragmentPreLightingCode.call(this,shaderObject,methodVO,registerCache,sharedRegisters)},SpecularFresnelMethod.prototype.modulateSpecular=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){var code;return code="dp3 "+targetReg+".y, "+sharedRegisters.viewDirFragment+".xyz, "+(this._incidentLight?targetReg:sharedRegisters.normalFragment)+".xyz\n"+"sub "+targetReg+".y, "+this._dataReg+".z, "+targetReg+".y\n"+"pow "+targetReg+".x, "+targetReg+".y, "+this._dataReg+".y\n"+"sub "+targetReg+".y, "+this._dataReg+".z, "+targetReg+".y\n"+"mul "+targetReg+".y, "+this._dataReg+".x, "+targetReg+".y\n"+"add "+targetReg+".y, "+targetReg+".x, "+targetReg+".y\n"+"mul "+targetReg+".w, "+targetReg+".w, "+targetReg+".y\n",console.log("SpecularFresnelMethod","modulateSpecular",code),code},SpecularFresnelMethod}(materials.SpecularCompositeMethod);materials.SpecularFresnelMethod=SpecularFresnelMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(materials){var SpecularPhongMethod=function(_super){function SpecularPhongMethod(){_super.call(this)}return __extends(SpecularPhongMethod,_super),SpecularPhongMethod.prototype.iGetFragmentCodePerLight=function(shaderObject,methodVO,lightDirReg,lightColReg,registerCache,sharedRegisters){var t,code="";this._pIsFirstLight?t=this._pTotalLightColorReg:(t=registerCache.getFreeFragmentVectorTemp(),registerCache.addFragmentTempUsages(t,1));var viewDirReg=sharedRegisters.viewDirFragment,normalReg=sharedRegisters.normalFragment;return code+="dp3 "+t+".w, "+lightDirReg+", "+normalReg+"\n"+"add "+t+".w, "+t+".w, "+t+".w\n"+"mul "+t+".xyz, "+normalReg+", "+t+".w\n"+"sub "+t+".xyz, "+t+", "+lightDirReg+"\n"+"add "+t+".w, "+t+".w, "+sharedRegisters.commons+".w\n"+"sat "+t+".w, "+t+".w\n"+"mul "+t+".xyz, "+t+", "+t+".w\n"+"dp3 "+t+".w, "+t+", "+viewDirReg+"\n"+"sat "+t+".w, "+t+".w\n",code+=this._pUseTexture?"mul "+this._pSpecularTexData+".w, "+this._pSpecularTexData+".y, "+this._pSpecularDataRegister+".w\n"+"pow "+t+".w, "+t+".w, "+this._pSpecularTexData+".w\n":"pow "+t+".w, "+t+".w, "+this._pSpecularDataRegister+".w\n",shaderObject.usesLightFallOff&&(code+="mul "+t+".w, "+t+".w, "+lightDirReg+".w\n"),null!=this._iModulateMethod&&(code+=this._iModulateMethod(shaderObject,methodVO,t,registerCache,sharedRegisters)),code+="mul "+t+".xyz, "+lightColReg+".xyz, "+t+".w\n",this._pIsFirstLight||(code+="add "+this._pTotalLightColorReg+".xyz, "+this._pTotalLightColorReg+".xyz, "+t+".xyz\n",registerCache.removeFragmentTempUsage(t)),this._pIsFirstLight=!1,code},SpecularPhongMethod}(materials.SpecularBasicMethod);materials.SpecularPhongMethod=SpecularPhongMethod}(away.materials||(away.materials={})),away.materials}(away||(away={}));var away;!function(away){!function(utils){var PerspectiveMatrix3D=function(_super){function PerspectiveMatrix3D(v){"undefined"==typeof v&&(v=null),_super.call(this,v)}return __extends(PerspectiveMatrix3D,_super),PerspectiveMatrix3D.prototype.perspectiveFieldOfViewLH=function(fieldOfViewY,aspectRatio,zNear,zFar){var yScale=1/Math.tan(fieldOfViewY/2),xScale=yScale/aspectRatio;this.copyRawDataFrom([xScale,0,0,0,0,yScale,0,0,0,0,zFar/(zFar-zNear),1,0,0,zNear*zFar/(zNear-zFar),0])},PerspectiveMatrix3D}(away.geom.Matrix3D);utils.PerspectiveMatrix3D=PerspectiveMatrix3D}(away.utils||(away.utils={})),away.utils}(away||(away={}));var away;!function(away){!function(animators){var AnimationSubGeometry=function(){function AnimationSubGeometry(){this._pVertexBuffer=new Array(8),this._pBufferContext=new Array(8),this._pBufferDirty=new Array(8),this.numProcessedVertices=0,this.previousTime=Number.NEGATIVE_INFINITY,this.animationParticles=new Array;for(var i=0;8>i;i++)this._pBufferDirty[i]=!0;this._iUniqueId=AnimationSubGeometry.SUBGEOM_ID_COUNT++}return AnimationSubGeometry.prototype.createVertexData=function(numVertices,totalLenOfOneVertex){this._numVertices=numVertices,this._totalLenOfOneVertex=totalLenOfOneVertex,this._pVertexData=new Array(numVertices*totalLenOfOneVertex)},AnimationSubGeometry.prototype.activateVertexBuffer=function(index,bufferOffset,stage,format){var contextIndex=stage.stageIndex,context=stage.context,buffer=this._pVertexBuffer[contextIndex];buffer&&this._pBufferContext[contextIndex]==context||(buffer=this._pVertexBuffer[contextIndex]=context.createVertexBuffer(this._numVertices,this._totalLenOfOneVertex),this._pBufferContext[contextIndex]=context,this._pBufferDirty[contextIndex]=!0),this._pBufferDirty[contextIndex]&&(buffer.uploadFromArray(this._pVertexData,0,this._numVertices),this._pBufferDirty[contextIndex]=!1),context.setVertexBufferAt(index,buffer,bufferOffset,format)},AnimationSubGeometry.prototype.dispose=function(){for(;this._pVertexBuffer.length;){var vertexBuffer=this._pVertexBuffer.pop();vertexBuffer&&vertexBuffer.dispose()}},AnimationSubGeometry.prototype.invalidateBuffer=function(){for(var i=0;8>i;i++)this._pBufferDirty[i]=!0},Object.defineProperty(AnimationSubGeometry.prototype,"vertexData",{get:function(){return this._pVertexData},enumerable:!0,configurable:!0}),Object.defineProperty(AnimationSubGeometry.prototype,"numVertices",{get:function(){return this._numVertices},enumerable:!0,configurable:!0}),Object.defineProperty(AnimationSubGeometry.prototype,"totalLenOfOneVertex",{get:function(){return this._totalLenOfOneVertex},enumerable:!0,configurable:!0}),AnimationSubGeometry.SUBGEOM_ID_COUNT=0,AnimationSubGeometry}();animators.AnimationSubGeometry=AnimationSubGeometry}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var ColorSegmentPoint=function(){function ColorSegmentPoint(life,color){if(0>=life||life>=1)throw new Error("life exceeds range (0,1)");this._life=life,this._color=color}return Object.defineProperty(ColorSegmentPoint.prototype,"color",{get:function(){return this._color},enumerable:!0,configurable:!0}),Object.defineProperty(ColorSegmentPoint.prototype,"life",{get:function(){return this._life},enumerable:!0,configurable:!0}),ColorSegmentPoint}();animators.ColorSegmentPoint=ColorSegmentPoint}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var Vector3D=away.geom.Vector3D,Matrix3D=away.geom.Matrix3D,Quaternion=away.geom.Quaternion,JointPose=function(){function JointPose(){this.orientation=new Quaternion,this.translation=new Vector3D}return JointPose.prototype.toMatrix3D=function(target){return"undefined"==typeof target&&(target=null),null==target&&(target=new Matrix3D),this.orientation.toMatrix3D(target),target.appendTranslation(this.translation.x,this.translation.y,this.translation.z),target},JointPose.prototype.copyFrom=function(pose){var or=pose.orientation,tr=pose.translation;this.orientation.x=or.x,this.orientation.y=or.y,this.orientation.z=or.z,this.orientation.w=or.w,this.translation.x=tr.x,this.translation.y=tr.y,this.translation.z=tr.z},JointPose}();animators.JointPose=JointPose}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var ParticleAnimationData=function(){function ParticleAnimationData(index,startTime,duration,delay,particle){this.index=index,this.startTime=startTime,this.totalTime=duration+delay,this.duration=duration,this.delay=delay,this.startVertexIndex=particle.startVertexIndex,this.numVertices=particle.numVertices}return ParticleAnimationData}();animators.ParticleAnimationData=ParticleAnimationData}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var ParticleData=function(){function ParticleData(){}return ParticleData}();animators.ParticleData=ParticleData}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var ParticleProperties=function(){function ParticleProperties(){}return ParticleProperties}();animators.ParticleProperties=ParticleProperties}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var ParticlePropertiesMode=function(){function ParticlePropertiesMode(){}return ParticlePropertiesMode.GLOBAL=0,ParticlePropertiesMode.LOCAL_STATIC=1,ParticlePropertiesMode.LOCAL_DYNAMIC=2,ParticlePropertiesMode}();animators.ParticlePropertiesMode=ParticlePropertiesMode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var AssetType=away.library.AssetType,Skeleton=function(_super){function Skeleton(){_super.call(this),this.joints=new Array}return __extends(Skeleton,_super),Object.defineProperty(Skeleton.prototype,"numJoints",{get:function(){return this.joints.length},enumerable:!0,configurable:!0}),Skeleton.prototype.jointFromName=function(jointName){var jointIndex=this.jointIndexFromName(jointName);return-1!=jointIndex?this.joints[jointIndex]:null},Skeleton.prototype.jointIndexFromName=function(jointName){for(var jointIndex,joint,i;ii;i++){var cloneJointPose=new animators.JointPose,thisJointPose=this.jointPoses[i];cloneJointPose.name=thisJointPose.name,cloneJointPose.copyFrom(thisJointPose),clone.jointPoses[i]=cloneJointPose}return clone},SkeletonPose.prototype.dispose=function(){this.jointPoses.length=0},SkeletonPose}(away.library.NamedAssetBase);animators.SkeletonPose=SkeletonPose}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var AnimationClipNodeBase=function(_super){function AnimationClipNodeBase(){_super.call(this),this._pLooping=!0,this._pTotalDuration=0,this._pStitchDirty=!0,this._pStitchFinalFrame=!1,this._pNumFrames=0,this._pDurations=new Array,this._pTotalDelta=new away.geom.Vector3D,this.fixedFrameRate=!0}return __extends(AnimationClipNodeBase,_super),Object.defineProperty(AnimationClipNodeBase.prototype,"looping",{get:function(){return this._pLooping},set:function(value){this._pLooping!=value&&(this._pLooping=value,this._pStitchDirty=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(AnimationClipNodeBase.prototype,"stitchFinalFrame",{get:function(){return this._pStitchFinalFrame},set:function(value){this._pStitchFinalFrame!=value&&(this._pStitchFinalFrame=value,this._pStitchDirty=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(AnimationClipNodeBase.prototype,"totalDuration",{get:function(){return this._pStitchDirty&&this._pUpdateStitch(),this._pTotalDuration},enumerable:!0,configurable:!0}),Object.defineProperty(AnimationClipNodeBase.prototype,"totalDelta",{get:function(){return this._pStitchDirty&&this._pUpdateStitch(),this._pTotalDelta},enumerable:!0,configurable:!0}),Object.defineProperty(AnimationClipNodeBase.prototype,"lastFrame",{get:function(){return this._pStitchDirty&&this._pUpdateStitch(),this._pLastFrame},enumerable:!0,configurable:!0}),Object.defineProperty(AnimationClipNodeBase.prototype,"durations",{get:function(){return this._pDurations},enumerable:!0,configurable:!0}),AnimationClipNodeBase.prototype._pUpdateStitch=function(){this._pStitchDirty=!1,this._pLastFrame=this._pStitchFinalFrame?this._pNumFrames:this._pNumFrames-1,this._pTotalDuration=0,this._pTotalDelta.x=0,this._pTotalDelta.y=0,this._pTotalDelta.z=0},AnimationClipNodeBase}(animators.AnimationNodeBase);animators.AnimationClipNodeBase=AnimationClipNodeBase}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var ParticleNodeBase=function(_super){function ParticleNodeBase(name,mode,dataLength,priority){"undefined"==typeof priority&&(priority=1),_super.call(this),this._pDataLength=3,name+=ParticleNodeBase.MODES[mode],this.name=name,this._pMode=mode,this._priority=priority,this._pDataLength=dataLength,this._pOneData=new Array(this._pDataLength)}return __extends(ParticleNodeBase,_super),Object.defineProperty(ParticleNodeBase.prototype,"mode",{get:function(){return this._pMode},enumerable:!0,configurable:!0}),Object.defineProperty(ParticleNodeBase.prototype,"priority",{get:function(){return this._priority},enumerable:!0,configurable:!0}),Object.defineProperty(ParticleNodeBase.prototype,"dataLength",{get:function(){return this._pDataLength},enumerable:!0,configurable:!0}),Object.defineProperty(ParticleNodeBase.prototype,"oneData",{get:function(){return this._pOneData},enumerable:!0,configurable:!0}),ParticleNodeBase.prototype.getAGALVertexCode=function(){return""},ParticleNodeBase.prototype.getAGALFragmentCode=function(){return""},ParticleNodeBase.prototype.getAGALUVCode=function(){return""},ParticleNodeBase.prototype._iGeneratePropertyOfOneParticle=function(){},ParticleNodeBase.prototype._iProcessAnimationSetting=function(){},ParticleNodeBase.GLOBAL="Global",ParticleNodeBase.LOCAL_STATIC="LocalStatic",ParticleNodeBase.LOCAL_DYNAMIC="LocalDynamic",ParticleNodeBase.MODES={0:ParticleNodeBase.GLOBAL,1:ParticleNodeBase.LOCAL_STATIC,2:ParticleNodeBase.LOCAL_DYNAMIC},ParticleNodeBase}(animators.AnimationNodeBase);animators.ParticleNodeBase=ParticleNodeBase}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var Vector3D=away.geom.Vector3D,ParticleAccelerationNode=function(_super){function ParticleAccelerationNode(mode,acceleration){"undefined"==typeof acceleration&&(acceleration=null),_super.call(this,"ParticleAcceleration",mode,3),this._pStateClass=animators.ParticleAccelerationState,this._acceleration=acceleration||new Vector3D}return __extends(ParticleAccelerationNode,_super),ParticleAccelerationNode.prototype.pGetAGALVertexCode=function(shaderObject,animationRegisterCache){var accelerationValue=this._pMode==animators.ParticlePropertiesMode.GLOBAL?animationRegisterCache.getFreeVertexConstant():animationRegisterCache.getFreeVertexAttribute();animationRegisterCache.setRegisterIndex(this,ParticleAccelerationNode.ACCELERATION_INDEX,accelerationValue.index);var temp=animationRegisterCache.getFreeVertexVectorTemp();animationRegisterCache.addVertexTempUsages(temp,1);var code="mul "+temp+","+animationRegisterCache.vertexTime+","+accelerationValue+"\n";if(animationRegisterCache.needVelocity){var temp2=animationRegisterCache.getFreeVertexVectorTemp();code+="mul "+temp2+","+temp+","+animationRegisterCache.vertexTwoConst+"\n",code+="add "+animationRegisterCache.velocityTarget+".xyz,"+temp2+".xyz,"+animationRegisterCache.velocityTarget+".xyz\n"}return animationRegisterCache.removeVertexTempUsage(temp),code+="mul "+temp+","+temp+","+animationRegisterCache.vertexTime+"\n",code+="add "+animationRegisterCache.positionTarget+".xyz,"+temp+","+animationRegisterCache.positionTarget+".xyz\n"},ParticleAccelerationNode.prototype.getAnimationState=function(animator){return animator.getAnimationState(this)},ParticleAccelerationNode.prototype._iGeneratePropertyOfOneParticle=function(param){var tempAcceleration=param[ParticleAccelerationNode.ACCELERATION_VECTOR3D];if(!tempAcceleration)throw new Error("there is no "+ParticleAccelerationNode.ACCELERATION_VECTOR3D+" in param!");this._pOneData[0]=tempAcceleration.x/2,this._pOneData[1]=tempAcceleration.y/2,this._pOneData[2]=tempAcceleration.z/2},ParticleAccelerationNode.ACCELERATION_INDEX=0,ParticleAccelerationNode.ACCELERATION_VECTOR3D="AccelerationVector3D",ParticleAccelerationNode}(animators.ParticleNodeBase);animators.ParticleAccelerationNode=ParticleAccelerationNode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var Vector3D=away.geom.Vector3D,ShaderRegisterElement=away.materials.ShaderRegisterElement,ParticleBezierCurveNode=function(_super){function ParticleBezierCurveNode(mode,controlPoint,endPoint){"undefined"==typeof controlPoint&&(controlPoint=null),"undefined"==typeof endPoint&&(endPoint=null),_super.call(this,"ParticleBezierCurve",mode,6),this._pStateClass=animators.ParticleBezierCurveState,this._iControlPoint=controlPoint||new Vector3D,this._iEndPoint=endPoint||new Vector3D -}return __extends(ParticleBezierCurveNode,_super),ParticleBezierCurveNode.prototype.getAGALVertexCode=function(shaderObject,animationRegisterCache){var controlValue=this._pMode==animators.ParticlePropertiesMode.GLOBAL?animationRegisterCache.getFreeVertexConstant():animationRegisterCache.getFreeVertexAttribute();animationRegisterCache.setRegisterIndex(this,ParticleBezierCurveNode.BEZIER_CONTROL_INDEX,controlValue.index);var endValue=this._pMode==animators.ParticlePropertiesMode.GLOBAL?animationRegisterCache.getFreeVertexConstant():animationRegisterCache.getFreeVertexAttribute();animationRegisterCache.setRegisterIndex(this,ParticleBezierCurveNode.BEZIER_END_INDEX,endValue.index);var temp=animationRegisterCache.getFreeVertexVectorTemp(),rev_time=new ShaderRegisterElement(temp.regName,temp.index,0),time_2=new ShaderRegisterElement(temp.regName,temp.index,1),time_temp=new ShaderRegisterElement(temp.regName,temp.index,2);animationRegisterCache.addVertexTempUsages(temp,1);var temp2=animationRegisterCache.getFreeVertexVectorTemp(),distance=new ShaderRegisterElement(temp2.regName,temp2.index);animationRegisterCache.removeVertexTempUsage(temp);var code="";return code+="sub "+rev_time+","+animationRegisterCache.vertexOneConst+","+animationRegisterCache.vertexLife+"\n",code+="mul "+time_2+","+animationRegisterCache.vertexLife+","+animationRegisterCache.vertexLife+"\n",code+="mul "+time_temp+","+animationRegisterCache.vertexLife+","+rev_time+"\n",code+="mul "+time_temp+","+time_temp+","+animationRegisterCache.vertexTwoConst+"\n",code+="mul "+distance+".xyz,"+time_temp+","+controlValue+"\n",code+="add "+animationRegisterCache.positionTarget+".xyz,"+distance+".xyz,"+animationRegisterCache.positionTarget+".xyz\n",code+="mul "+distance+".xyz,"+time_2+","+endValue+"\n",code+="add "+animationRegisterCache.positionTarget+".xyz,"+distance+".xyz,"+animationRegisterCache.positionTarget+".xyz\n",animationRegisterCache.needVelocity&&(code+="mul "+time_2+","+animationRegisterCache.vertexLife+","+animationRegisterCache.vertexTwoConst+"\n",code+="sub "+time_temp+","+animationRegisterCache.vertexOneConst+","+time_2+"\n",code+="mul "+time_temp+","+animationRegisterCache.vertexTwoConst+","+time_temp+"\n",code+="mul "+distance+".xyz,"+controlValue+","+time_temp+"\n",code+="add "+animationRegisterCache.velocityTarget+".xyz,"+distance+".xyz,"+animationRegisterCache.velocityTarget+".xyz\n",code+="mul "+distance+".xyz,"+endValue+","+time_2+"\n",code+="add "+animationRegisterCache.velocityTarget+".xyz,"+distance+".xyz,"+animationRegisterCache.velocityTarget+".xyz\n"),code},ParticleBezierCurveNode.prototype.getAnimationState=function(animator){return animator.getAnimationState(this)},ParticleBezierCurveNode.prototype._iGeneratePropertyOfOneParticle=function(param){var bezierControl=param[ParticleBezierCurveNode.BEZIER_CONTROL_VECTOR3D];if(!bezierControl)throw new Error("there is no "+ParticleBezierCurveNode.BEZIER_CONTROL_VECTOR3D+" in param!");var bezierEnd=param[ParticleBezierCurveNode.BEZIER_END_VECTOR3D];if(!bezierEnd)throw new Error("there is no "+ParticleBezierCurveNode.BEZIER_END_VECTOR3D+" in param!");this._pOneData[0]=bezierControl.x,this._pOneData[1]=bezierControl.y,this._pOneData[2]=bezierControl.z,this._pOneData[3]=bezierEnd.x,this._pOneData[4]=bezierEnd.y,this._pOneData[5]=bezierEnd.z},ParticleBezierCurveNode.BEZIER_CONTROL_INDEX=0,ParticleBezierCurveNode.BEZIER_END_INDEX=1,ParticleBezierCurveNode.BEZIER_CONTROL_VECTOR3D="BezierControlVector3D",ParticleBezierCurveNode.BEZIER_END_VECTOR3D="BezierEndVector3D",ParticleBezierCurveNode}(animators.ParticleNodeBase);animators.ParticleBezierCurveNode=ParticleBezierCurveNode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var ParticleBillboardNode=function(_super){function ParticleBillboardNode(billboardAxis){"undefined"==typeof billboardAxis&&(billboardAxis=null),_super.call(this,"ParticleBillboard",animators.ParticlePropertiesMode.GLOBAL,0,4),this._pStateClass=animators.ParticleBillboardState,this._iBillboardAxis=billboardAxis}return __extends(ParticleBillboardNode,_super),ParticleBillboardNode.prototype.getAGALVertexCode=function(shaderObject,animationRegisterCache){var rotationMatrixRegister=animationRegisterCache.getFreeVertexConstant();animationRegisterCache.setRegisterIndex(this,ParticleBillboardNode.MATRIX_INDEX,rotationMatrixRegister.index),animationRegisterCache.getFreeVertexConstant(),animationRegisterCache.getFreeVertexConstant(),animationRegisterCache.getFreeVertexConstant();for(var shaderRegisterElement,temp=animationRegisterCache.getFreeVertexVectorTemp(),code="m33 "+temp+".xyz,"+animationRegisterCache.scaleAndRotateTarget+","+rotationMatrixRegister+"\n"+"mov "+animationRegisterCache.scaleAndRotateTarget+".xyz,"+temp+"\n",i=0;ii;i++)code+="m33 "+animationRegisterCache.rotationRegisters[i]+".xyz,"+animationRegisterCache.rotationRegisters[i]+","+temp1+"\n";if(code+="mov "+temp1+","+animationRegisterCache.vertexZeroConst+"\n",code+="cos "+temp1+".x,"+rotationAttribute+".y\n",code+="sin "+temp1+".z,"+rotationAttribute+".y\n",code+="mov "+temp2+","+animationRegisterCache.vertexZeroConst+"\n",code+="mov "+temp2+".y,"+animationRegisterCache.vertexOneConst+"\n",code+="mov "+temp3+","+animationRegisterCache.vertexZeroConst+"\n",code+="neg "+temp3+".x,"+temp1+".z\n",code+="mov "+temp3+".z,"+temp1+".x\n",animationRegisterCache.hasBillboard)code+="m33 "+temp4+".xyz,"+temp4+".xyz,"+temp1+"\n";else for(code+="m33 "+animationRegisterCache.scaleAndRotateTarget+".xyz,"+animationRegisterCache.scaleAndRotateTarget+".xyz,"+temp1+"\n",i=0;len>i;i++)code+="m33 "+animationRegisterCache.rotationRegisters[i]+".xyz,"+animationRegisterCache.rotationRegisters[i]+","+temp1+"\n";if(code+="mov "+temp2+","+animationRegisterCache.vertexZeroConst+"\n",code+="sin "+temp2+".x,"+rotationAttribute+".z\n",code+="cos "+temp2+".y,"+rotationAttribute+".z\n",code+="mov "+temp1+","+animationRegisterCache.vertexZeroConst+"\n",code+="mov "+temp1+".x,"+temp2+".y\n",code+="neg "+temp1+".y,"+temp2+".x\n",code+="mov "+temp3+","+animationRegisterCache.vertexZeroConst+"\n",code+="mov "+temp3+".z,"+animationRegisterCache.vertexOneConst+"\n",animationRegisterCache.hasBillboard)code+="m33 "+temp4+".xyz,"+temp4+".xyz,"+temp1+"\n",code+="sub "+temp4+".xyz,"+temp4+".xyz,"+animationRegisterCache.positionTarget+".xyz\n",code+="add "+animationRegisterCache.scaleAndRotateTarget+".xyz,"+temp4+".xyz,"+animationRegisterCache.scaleAndRotateTarget+".xyz\n";else for(code+="m33 "+animationRegisterCache.scaleAndRotateTarget+".xyz,"+animationRegisterCache.scaleAndRotateTarget+".xyz,"+temp1+"\n",i=0;len>i;i++)code+="m33 "+animationRegisterCache.rotationRegisters[i]+".xyz,"+animationRegisterCache.rotationRegisters[i]+","+temp1+"\n"}if(this._iUsesPosition){var positionAttribute=animationRegisterCache.getFreeVertexAttribute();animationRegisterCache.setRegisterIndex(this,ParticleFollowNode.FOLLOW_POSITION_INDEX,positionAttribute.index),code+="add "+animationRegisterCache.scaleAndRotateTarget+".xyz,"+positionAttribute+","+animationRegisterCache.scaleAndRotateTarget+".xyz\n"}return code},ParticleFollowNode.prototype.getAnimationState=function(animator){return animator.getAnimationState(this)},ParticleFollowNode.FOLLOW_POSITION_INDEX=0,ParticleFollowNode.FOLLOW_ROTATION_INDEX=1,ParticleFollowNode}(animators.ParticleNodeBase);animators.ParticleFollowNode=ParticleFollowNode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var ColorTransform=away.geom.ColorTransform,ParticleInitialColorNode=function(_super){function ParticleInitialColorNode(mode,usesMultiplier,usesOffset,initialColor){"undefined"==typeof usesMultiplier&&(usesMultiplier=!0),"undefined"==typeof usesOffset&&(usesOffset=!1),"undefined"==typeof initialColor&&(initialColor=null),_super.call(this,"ParticleInitialColor",mode,usesMultiplier&&usesOffset?8:4,animators.ParticleAnimationSet.COLOR_PRIORITY),this._pStateClass=animators.ParticleInitialColorState,this._iUsesMultiplier=usesMultiplier,this._iUsesOffset=usesOffset,this._iInitialColor=initialColor||new ColorTransform}return __extends(ParticleInitialColorNode,_super),ParticleInitialColorNode.prototype.getAGALVertexCode=function(shaderObject,animationRegisterCache){var code="";if(animationRegisterCache.needFragmentAnimation){if(this._iUsesMultiplier){var multiplierValue=this._pMode==animators.ParticlePropertiesMode.GLOBAL?animationRegisterCache.getFreeVertexConstant():animationRegisterCache.getFreeVertexAttribute();animationRegisterCache.setRegisterIndex(this,ParticleInitialColorNode.MULTIPLIER_INDEX,multiplierValue.index),code+="mul "+animationRegisterCache.colorMulTarget+","+multiplierValue+","+animationRegisterCache.colorMulTarget+"\n"}if(this._iUsesOffset){var offsetValue=this._pMode==animators.ParticlePropertiesMode.LOCAL_STATIC?animationRegisterCache.getFreeVertexAttribute():animationRegisterCache.getFreeVertexConstant();animationRegisterCache.setRegisterIndex(this,ParticleInitialColorNode.OFFSET_INDEX,offsetValue.index),code+="add "+animationRegisterCache.colorAddTarget+","+offsetValue+","+animationRegisterCache.colorAddTarget+"\n"}}return code},ParticleInitialColorNode.prototype._iProcessAnimationSetting=function(particleAnimationSet){this._iUsesMultiplier&&(particleAnimationSet.hasColorMulNode=!0),this._iUsesOffset&&(particleAnimationSet.hasColorAddNode=!0)},ParticleInitialColorNode.prototype._iGeneratePropertyOfOneParticle=function(param){var initialColor=param[ParticleInitialColorNode.COLOR_INITIAL_COLORTRANSFORM];if(!initialColor)throw new Error("there is no "+ParticleInitialColorNode.COLOR_INITIAL_COLORTRANSFORM+" in param!");var i=0;this._iUsesMultiplier&&(this._pOneData[i++]=initialColor.redMultiplier,this._pOneData[i++]=initialColor.greenMultiplier,this._pOneData[i++]=initialColor.blueMultiplier,this._pOneData[i++]=initialColor.alphaMultiplier),this._iUsesOffset&&(this._pOneData[i++]=initialColor.redOffset/255,this._pOneData[i++]=initialColor.greenOffset/255,this._pOneData[i++]=initialColor.blueOffset/255,this._pOneData[i++]=initialColor.alphaOffset/255)},ParticleInitialColorNode.MULTIPLIER_INDEX=0,ParticleInitialColorNode.OFFSET_INDEX=1,ParticleInitialColorNode.COLOR_INITIAL_COLORTRANSFORM="ColorInitialColorTransform",ParticleInitialColorNode}(animators.ParticleNodeBase);animators.ParticleInitialColorNode=ParticleInitialColorNode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var Vector3D=away.geom.Vector3D,ShaderRegisterElement=away.materials.ShaderRegisterElement,ParticleOrbitNode=function(_super){function ParticleOrbitNode(mode,usesEulers,usesCycle,usesPhase,radius,cycleDuration,cyclePhase,eulers){"undefined"==typeof usesEulers&&(usesEulers=!0),"undefined"==typeof usesCycle&&(usesCycle=!1),"undefined"==typeof usesPhase&&(usesPhase=!1),"undefined"==typeof radius&&(radius=100),"undefined"==typeof cycleDuration&&(cycleDuration=1),"undefined"==typeof cyclePhase&&(cyclePhase=0),"undefined"==typeof eulers&&(eulers=null);var len=3;usesPhase&&len++,_super.call(this,"ParticleOrbit",mode,len),this._pStateClass=animators.ParticleOrbitState,this._iUsesEulers=usesEulers,this._iUsesCycle=usesCycle,this._iUsesPhase=usesPhase,this._iRadius=radius,this._iCycleDuration=cycleDuration,this._iCyclePhase=cyclePhase,this._iEulers=eulers||new Vector3D}return __extends(ParticleOrbitNode,_super),ParticleOrbitNode.prototype.getAGALVertexCode=function(shaderObject,animationRegisterCache){var orbitRegister=this._pMode==animators.ParticlePropertiesMode.GLOBAL?animationRegisterCache.getFreeVertexConstant():animationRegisterCache.getFreeVertexAttribute();animationRegisterCache.setRegisterIndex(this,ParticleOrbitNode.ORBIT_INDEX,orbitRegister.index);var eulersMatrixRegister=animationRegisterCache.getFreeVertexConstant();animationRegisterCache.setRegisterIndex(this,ParticleOrbitNode.EULERS_INDEX,eulersMatrixRegister.index),animationRegisterCache.getFreeVertexConstant(),animationRegisterCache.getFreeVertexConstant(),animationRegisterCache.getFreeVertexConstant();var temp1=animationRegisterCache.getFreeVertexVectorTemp();animationRegisterCache.addVertexTempUsages(temp1,1);var distance=new ShaderRegisterElement(temp1.regName,temp1.index),temp2=animationRegisterCache.getFreeVertexVectorTemp(),cos=new ShaderRegisterElement(temp2.regName,temp2.index,0),sin=new ShaderRegisterElement(temp2.regName,temp2.index,1),degree=new ShaderRegisterElement(temp2.regName,temp2.index,2);animationRegisterCache.removeVertexTempUsage(temp1);var code="";return this._iUsesCycle?(code+="mul "+degree+","+animationRegisterCache.vertexTime+","+orbitRegister+".y\n",this._iUsesPhase&&(code+="add "+degree+","+degree+","+orbitRegister+".w\n")):code+="mul "+degree+","+animationRegisterCache.vertexLife+","+orbitRegister+".y\n",code+="cos "+cos+","+degree+"\n",code+="sin "+sin+","+degree+"\n",code+="mul "+distance+".x,"+cos+","+orbitRegister+".x\n",code+="mul "+distance+".y,"+sin+","+orbitRegister+".x\n",code+="mov "+distance+".wz"+animationRegisterCache.vertexZeroConst+"\n",this._iUsesEulers&&(code+="m44 "+distance+","+distance+","+eulersMatrixRegister+"\n"),code+="add "+animationRegisterCache.positionTarget+".xyz,"+distance+".xyz,"+animationRegisterCache.positionTarget+".xyz\n",animationRegisterCache.needVelocity&&(code+="neg "+distance+".x,"+sin+"\n",code+="mov "+distance+".y,"+cos+"\n",code+="mov "+distance+".zw,"+animationRegisterCache.vertexZeroConst+"\n",this._iUsesEulers&&(code+="m44 "+distance+","+distance+","+eulersMatrixRegister+"\n"),code+="mul "+distance+","+distance+","+orbitRegister+".z\n",code+="div "+distance+","+distance+","+orbitRegister+".y\n",this._iUsesCycle||(code+="div "+distance+","+distance+","+animationRegisterCache.vertexLife+"\n"),code+="add "+animationRegisterCache.velocityTarget+".xyz,"+animationRegisterCache.velocityTarget+".xyz,"+distance+".xyz\n"),code},ParticleOrbitNode.prototype.getAnimationState=function(animator){return animator.getAnimationState(this)},ParticleOrbitNode.prototype._iGeneratePropertyOfOneParticle=function(param){var orbit=param[ParticleOrbitNode.ORBIT_VECTOR3D];if(!orbit)throw new Error("there is no "+ParticleOrbitNode.ORBIT_VECTOR3D+" in param!");if(this._pOneData[0]=orbit.x,this._iUsesCycle&&orbit.y<=0)throw new Error("the cycle duration must be greater than zero");this._pOneData[1]=2*Math.PI/(this._iUsesCycle?orbit.y:1),this._pOneData[2]=2*orbit.x*Math.PI,this._iUsesPhase&&(this._pOneData[3]=orbit.z*Math.PI/180)},ParticleOrbitNode.ORBIT_INDEX=0,ParticleOrbitNode.EULERS_INDEX=1,ParticleOrbitNode.ORBIT_VECTOR3D="OrbitVector3D",ParticleOrbitNode}(animators.ParticleNodeBase);animators.ParticleOrbitNode=ParticleOrbitNode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var Vector3D=away.geom.Vector3D,ShaderRegisterElement=away.materials.ShaderRegisterElement,ParticleOscillatorNode=function(_super){function ParticleOscillatorNode(mode,oscillator){"undefined"==typeof oscillator&&(oscillator=null),_super.call(this,"ParticleOscillator",mode,4),this._pStateClass=animators.ParticleOscillatorState,this._iOscillator=oscillator||new Vector3D}return __extends(ParticleOscillatorNode,_super),ParticleOscillatorNode.prototype.getAGALVertexCode=function(shaderObject,animationRegisterCache){var oscillatorRegister=this._pMode==animators.ParticlePropertiesMode.GLOBAL?animationRegisterCache.getFreeVertexConstant():animationRegisterCache.getFreeVertexAttribute();animationRegisterCache.setRegisterIndex(this,ParticleOscillatorNode.OSCILLATOR_INDEX,oscillatorRegister.index);var temp=animationRegisterCache.getFreeVertexVectorTemp(),dgree=new ShaderRegisterElement(temp.regName,temp.index,0),sin=new ShaderRegisterElement(temp.regName,temp.index,1),cos=new ShaderRegisterElement(temp.regName,temp.index,2);animationRegisterCache.addVertexTempUsages(temp,1);var temp2=animationRegisterCache.getFreeVertexVectorTemp(),distance=new ShaderRegisterElement(temp2.regName,temp2.index);animationRegisterCache.removeVertexTempUsage(temp);var code="";return code+="mul "+dgree+","+animationRegisterCache.vertexTime+","+oscillatorRegister+".w\n",code+="sin "+sin+","+dgree+"\n",code+="mul "+distance+".xyz,"+sin+","+oscillatorRegister+".xyz\n",code+="add "+animationRegisterCache.positionTarget+".xyz,"+distance+".xyz,"+animationRegisterCache.positionTarget+".xyz\n",animationRegisterCache.needVelocity&&(code+="cos "+cos+","+dgree+"\n",code+="mul "+distance+".xyz,"+cos+","+oscillatorRegister+".xyz\n",code+="add "+animationRegisterCache.velocityTarget+".xyz,"+distance+".xyz,"+animationRegisterCache.velocityTarget+".xyz\n"),code},ParticleOscillatorNode.prototype.getAnimationState=function(animator){return animator.getAnimationState(this)},ParticleOscillatorNode.prototype._iGeneratePropertyOfOneParticle=function(param){var drift=param[ParticleOscillatorNode.OSCILLATOR_VECTOR3D];if(!drift)throw new Error("there is no "+ParticleOscillatorNode.OSCILLATOR_VECTOR3D+" in param!");if(this._pOneData[0]=drift.x,this._pOneData[1]=drift.y,this._pOneData[2]=drift.z,drift.w<=0)throw new Error("the cycle duration must greater than zero");this._pOneData[3]=2*Math.PI/drift.w},ParticleOscillatorNode.OSCILLATOR_INDEX=0,ParticleOscillatorNode.OSCILLATOR_VECTOR3D="OscillatorVector3D",ParticleOscillatorNode}(animators.ParticleNodeBase);animators.ParticleOscillatorNode=ParticleOscillatorNode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var Vector3D=away.geom.Vector3D,ParticlePositionNode=function(_super){function ParticlePositionNode(mode,position){"undefined"==typeof position&&(position=null),_super.call(this,"ParticlePosition",mode,3),this._pStateClass=animators.ParticlePositionState,this._iPosition=position||new Vector3D}return __extends(ParticlePositionNode,_super),ParticlePositionNode.prototype.getAGALVertexCode=function(shaderObject,animationRegisterCache){var positionAttribute=this._pMode==animators.ParticlePropertiesMode.GLOBAL?animationRegisterCache.getFreeVertexConstant():animationRegisterCache.getFreeVertexAttribute();return animationRegisterCache.setRegisterIndex(this,ParticlePositionNode.POSITION_INDEX,positionAttribute.index),"add "+animationRegisterCache.positionTarget+".xyz,"+positionAttribute+".xyz,"+animationRegisterCache.positionTarget+".xyz\n"},ParticlePositionNode.prototype.getAnimationState=function(animator){return animator.getAnimationState(this)},ParticlePositionNode.prototype._iGeneratePropertyOfOneParticle=function(param){var offset=param[ParticlePositionNode.POSITION_VECTOR3D];if(!offset)throw new Error("there is no "+ParticlePositionNode.POSITION_VECTOR3D+" in param!");this._pOneData[0]=offset.x,this._pOneData[1]=offset.y,this._pOneData[2]=offset.z},ParticlePositionNode.POSITION_INDEX=0,ParticlePositionNode.POSITION_VECTOR3D="PositionVector3D",ParticlePositionNode}(animators.ParticleNodeBase);animators.ParticlePositionNode=ParticlePositionNode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var ShaderRegisterElement=away.materials.ShaderRegisterElement,ParticleRotateToHeadingNode=function(_super){function ParticleRotateToHeadingNode(){_super.call(this,"ParticleRotateToHeading",animators.ParticlePropertiesMode.GLOBAL,0,3),this._pStateClass=animators.ParticleRotateToHeadingState}return __extends(ParticleRotateToHeadingNode,_super),ParticleRotateToHeadingNode.prototype.getAGALVertexCode=function(shaderObject,animationRegisterCache){var i,code="",len=animationRegisterCache.rotationRegisters.length;if(animationRegisterCache.hasBillboard){var temp1=animationRegisterCache.getFreeVertexVectorTemp();animationRegisterCache.addVertexTempUsages(temp1,1);var temp2=animationRegisterCache.getFreeVertexVectorTemp();animationRegisterCache.addVertexTempUsages(temp2,1);var temp3=animationRegisterCache.getFreeVertexVectorTemp(),rotationMatrixRegister=animationRegisterCache.getFreeVertexConstant();for(animationRegisterCache.setRegisterIndex(this,ParticleRotateToHeadingNode.MATRIX_INDEX,rotationMatrixRegister.index),animationRegisterCache.getFreeVertexConstant(),animationRegisterCache.getFreeVertexConstant(),animationRegisterCache.getFreeVertexConstant(),animationRegisterCache.removeVertexTempUsage(temp1),animationRegisterCache.removeVertexTempUsage(temp2),code+="m33 "+temp1+".xyz,"+animationRegisterCache.velocityTarget+".xyz,"+rotationMatrixRegister+"\n",code+="mov "+temp3+","+animationRegisterCache.vertexZeroConst+"\n",code+="mov "+temp3+".xy,"+temp1+".xy\n",code+="nrm "+temp3+".xyz,"+temp3+".xyz\n",code+="mov "+temp2+","+animationRegisterCache.vertexZeroConst+"\n",code+="mov "+temp2+".x,"+temp3+".y\n",code+="mov "+temp2+".y,"+temp3+".x\n",code+="mov "+temp1+","+animationRegisterCache.vertexZeroConst+"\n",code+="mov "+temp1+".x,"+temp3+".x\n",code+="neg "+temp1+".y,"+temp3+".y\n",code+="mov "+temp3+","+animationRegisterCache.vertexZeroConst+"\n",code+="mov "+temp3+".z,"+animationRegisterCache.vertexOneConst+"\n",code+="m33 "+animationRegisterCache.scaleAndRotateTarget+".xyz,"+animationRegisterCache.scaleAndRotateTarget+".xyz,"+temp1+"\n",i=0;len>i;i++)code+="m33 "+animationRegisterCache.rotationRegisters[i]+".xyz,"+animationRegisterCache.rotationRegisters[i]+","+temp1+"\n"}else{var nrmVel=animationRegisterCache.getFreeVertexVectorTemp();animationRegisterCache.addVertexTempUsages(nrmVel,1);var xAxis=animationRegisterCache.getFreeVertexVectorTemp();animationRegisterCache.addVertexTempUsages(xAxis,1);var R=animationRegisterCache.getFreeVertexVectorTemp();animationRegisterCache.addVertexTempUsages(R,1);var R_rev=animationRegisterCache.getFreeVertexVectorTemp(),cos=new ShaderRegisterElement(R.regName,R.index,3),sin=new ShaderRegisterElement(R_rev.regName,R_rev.index,3),cos2=new ShaderRegisterElement(nrmVel.regName,nrmVel.index,3),tempSingle=sin; -for(animationRegisterCache.removeVertexTempUsage(nrmVel),animationRegisterCache.removeVertexTempUsage(xAxis),animationRegisterCache.removeVertexTempUsage(R),code+="mov "+xAxis+".x,"+animationRegisterCache.vertexOneConst+"\n",code+="mov "+xAxis+".yz,"+animationRegisterCache.vertexZeroConst+"\n",code+="nrm "+nrmVel+".xyz,"+animationRegisterCache.velocityTarget+".xyz\n",code+="dp3 "+cos2+","+nrmVel+".xyz,"+xAxis+".xyz\n",code+="crs "+nrmVel+".xyz,"+xAxis+".xyz,"+nrmVel+".xyz\n",code+="nrm "+nrmVel+".xyz,"+nrmVel+".xyz\n",code+="dp3 "+R+".x,"+nrmVel+".xyz,"+nrmVel+".xyz\n",code+="sge "+R+".x,"+animationRegisterCache.vertexZeroConst+","+R+".x\n",code+="add "+nrmVel+".z,"+R+".x,"+nrmVel+".z\n",code+="add "+tempSingle+","+cos2+","+animationRegisterCache.vertexOneConst+"\n",code+="div "+tempSingle+","+tempSingle+","+animationRegisterCache.vertexTwoConst+"\n",code+="sqt "+cos+","+tempSingle+"\n",code+="sub "+tempSingle+","+animationRegisterCache.vertexOneConst+","+cos2+"\n",code+="div "+tempSingle+","+tempSingle+","+animationRegisterCache.vertexTwoConst+"\n",code+="sqt "+sin+","+tempSingle+"\n",code+="mul "+R+".xyz,"+sin+","+nrmVel+".xyz\n",code+="mul "+R_rev+".xyz,"+sin+","+nrmVel+".xyz\n",code+="neg "+R_rev+".xyz,"+R_rev+".xyz\n",code+="crs "+nrmVel+".xyz,"+R+".xyz,"+animationRegisterCache.scaleAndRotateTarget+".xyz\n",code+="mul "+xAxis+".xyz,"+cos+","+animationRegisterCache.scaleAndRotateTarget+".xyz\n",code+="add "+nrmVel+".xyz,"+nrmVel+".xyz,"+xAxis+".xyz\n",code+="dp3 "+xAxis+".w,"+R+".xyz,"+animationRegisterCache.scaleAndRotateTarget+".xyz\n",code+="neg "+nrmVel+".w,"+xAxis+".w\n",code+="crs "+R+".xyz,"+nrmVel+".xyz,"+R_rev+".xyz\n",code+="mul "+xAxis+".xyzw,"+nrmVel+".xyzw,"+cos+"\n",code+="add "+R+".xyz,"+R+".xyz,"+xAxis+".xyz\n",code+="mul "+xAxis+".xyz,"+nrmVel+".w,"+R_rev+".xyz\n",code+="add "+animationRegisterCache.scaleAndRotateTarget+".xyz,"+R+".xyz,"+xAxis+".xyz\n",i=0;len>i;i++)code+="mov "+xAxis+".x,"+animationRegisterCache.vertexOneConst+"\n",code+="mov "+xAxis+".yz,"+animationRegisterCache.vertexZeroConst+"\n",code+="nrm "+nrmVel+".xyz,"+animationRegisterCache.velocityTarget+".xyz\n",code+="dp3 "+cos2+","+nrmVel+".xyz,"+xAxis+".xyz\n",code+="crs "+nrmVel+".xyz,"+xAxis+".xyz,"+nrmVel+".xyz\n",code+="nrm "+nrmVel+".xyz,"+nrmVel+".xyz\n",code+="dp3 "+R+".x,"+nrmVel+".xyz,"+nrmVel+".xyz\n",code+="sge "+R+".x,"+animationRegisterCache.vertexZeroConst+","+R+".x\n",code+="add "+nrmVel+".z,"+R+".x,"+nrmVel+".z\n",code+="add "+tempSingle+","+cos2+","+animationRegisterCache.vertexOneConst+"\n",code+="div "+tempSingle+","+tempSingle+","+animationRegisterCache.vertexTwoConst+"\n",code+="sqt "+cos+","+tempSingle+"\n",code+="sub "+tempSingle+","+animationRegisterCache.vertexOneConst+","+cos2+"\n",code+="div "+tempSingle+","+tempSingle+","+animationRegisterCache.vertexTwoConst+"\n",code+="sqt "+sin+","+tempSingle+"\n",code+="mul "+R+".xyz,"+sin+","+nrmVel+".xyz\n",code+="mul "+R_rev+".xyz,"+sin+","+nrmVel+".xyz\n",code+="neg "+R_rev+".xyz,"+R_rev+".xyz\n",code+="crs "+nrmVel+".xyz,"+R+".xyz,"+animationRegisterCache.rotationRegisters[i]+".xyz\n",code+="mul "+xAxis+".xyz,"+cos+","+animationRegisterCache.rotationRegisters[i]+".xyz\n",code+="add "+nrmVel+".xyz,"+nrmVel+".xyz,"+xAxis+".xyz\n",code+="dp3 "+xAxis+".w,"+R+".xyz,"+animationRegisterCache.rotationRegisters[i]+".xyz\n",code+="neg "+nrmVel+".w,"+xAxis+".w\n",code+="crs "+R+".xyz,"+nrmVel+".xyz,"+R_rev+".xyz\n",code+="mul "+xAxis+".xyzw,"+nrmVel+".xyzw,"+cos+"\n",code+="add "+R+".xyz,"+R+".xyz,"+xAxis+".xyz\n",code+="mul "+xAxis+".xyz,"+nrmVel+".w,"+R_rev+".xyz\n",code+="add "+animationRegisterCache.rotationRegisters[i]+".xyz,"+R+".xyz,"+xAxis+".xyz\n"}return code},ParticleRotateToHeadingNode.prototype.getAnimationState=function(animator){return animator.getAnimationState(this)},ParticleRotateToHeadingNode.prototype._iProcessAnimationSetting=function(particleAnimationSet){particleAnimationSet.needVelocity=!0},ParticleRotateToHeadingNode.MATRIX_INDEX=0,ParticleRotateToHeadingNode}(animators.ParticleNodeBase);animators.ParticleRotateToHeadingNode=ParticleRotateToHeadingNode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var Vector3D=away.geom.Vector3D,ShaderRegisterElement=away.materials.ShaderRegisterElement,ParticleRotateToPositionNode=function(_super){function ParticleRotateToPositionNode(mode,position){"undefined"==typeof position&&(position=null),_super.call(this,"ParticleRotateToPosition",mode,3,3),this._pStateClass=animators.ParticleRotateToPositionState,this._iPosition=position||new Vector3D}return __extends(ParticleRotateToPositionNode,_super),ParticleRotateToPositionNode.prototype.getAGALVertexCode=function(shaderObject,animationRegisterCache){var positionAttribute=this._pMode==animators.ParticlePropertiesMode.GLOBAL?animationRegisterCache.getFreeVertexConstant():animationRegisterCache.getFreeVertexAttribute();animationRegisterCache.setRegisterIndex(this,ParticleRotateToPositionNode.POSITION_INDEX,positionAttribute.index);var i,code="",len=animationRegisterCache.rotationRegisters.length;if(animationRegisterCache.hasBillboard){var temp1=animationRegisterCache.getFreeVertexVectorTemp();animationRegisterCache.addVertexTempUsages(temp1,1);var temp2=animationRegisterCache.getFreeVertexVectorTemp();animationRegisterCache.addVertexTempUsages(temp2,1);var temp3=animationRegisterCache.getFreeVertexVectorTemp(),rotationMatrixRegister=animationRegisterCache.getFreeVertexConstant();for(animationRegisterCache.setRegisterIndex(this,ParticleRotateToPositionNode.MATRIX_INDEX,rotationMatrixRegister.index),animationRegisterCache.getFreeVertexConstant(),animationRegisterCache.getFreeVertexConstant(),animationRegisterCache.getFreeVertexConstant(),animationRegisterCache.removeVertexTempUsage(temp1),animationRegisterCache.removeVertexTempUsage(temp2),code+="sub "+temp1+".xyz,"+positionAttribute+".xyz,"+animationRegisterCache.positionTarget+".xyz\n",code+="m33 "+temp1+".xyz,"+temp1+".xyz,"+rotationMatrixRegister+"\n",code+="mov "+temp3+","+animationRegisterCache.vertexZeroConst+"\n",code+="mov "+temp3+".xy,"+temp1+".xy\n",code+="nrm "+temp3+".xyz,"+temp3+".xyz\n",code+="mov "+temp2+","+animationRegisterCache.vertexZeroConst+"\n",code+="mov "+temp2+".x,"+temp3+".y\n",code+="mov "+temp2+".y,"+temp3+".x\n",code+="mov "+temp1+","+animationRegisterCache.vertexZeroConst+"\n",code+="mov "+temp1+".x,"+temp3+".x\n",code+="neg "+temp1+".y,"+temp3+".y\n",code+="mov "+temp3+","+animationRegisterCache.vertexZeroConst+"\n",code+="mov "+temp3+".z,"+animationRegisterCache.vertexOneConst+"\n",code+="m33 "+animationRegisterCache.scaleAndRotateTarget+".xyz,"+animationRegisterCache.scaleAndRotateTarget+".xyz,"+temp1+"\n",i=0;len>i;i++)code+="m33 "+animationRegisterCache.rotationRegisters[i]+".xyz,"+animationRegisterCache.rotationRegisters[i]+","+temp1+"\n"}else{var nrmDirection=animationRegisterCache.getFreeVertexVectorTemp();animationRegisterCache.addVertexTempUsages(nrmDirection,1);var temp=animationRegisterCache.getFreeVertexVectorTemp();animationRegisterCache.addVertexTempUsages(temp,1);var cos=new ShaderRegisterElement(temp.regName,temp.index,0),sin=new ShaderRegisterElement(temp.regName,temp.index,1),o_temp=new ShaderRegisterElement(temp.regName,temp.index,2),tempSingle=new ShaderRegisterElement(temp.regName,temp.index,3),R=animationRegisterCache.getFreeVertexVectorTemp();for(animationRegisterCache.addVertexTempUsages(R,1),animationRegisterCache.removeVertexTempUsage(nrmDirection),animationRegisterCache.removeVertexTempUsage(temp),animationRegisterCache.removeVertexTempUsage(R),code+="sub "+nrmDirection+".xyz,"+positionAttribute+".xyz,"+animationRegisterCache.positionTarget+".xyz\n",code+="nrm "+nrmDirection+".xyz,"+nrmDirection+".xyz\n",code+="mov "+sin+","+nrmDirection+".y\n",code+="mul "+cos+","+sin+","+sin+"\n",code+="sub "+cos+","+animationRegisterCache.vertexOneConst+","+cos+"\n",code+="sqt "+cos+","+cos+"\n",code+="mul "+R+".x,"+cos+","+animationRegisterCache.scaleAndRotateTarget+".y\n",code+="mul "+R+".y,"+sin+","+animationRegisterCache.scaleAndRotateTarget+".z\n",code+="mul "+R+".z,"+sin+","+animationRegisterCache.scaleAndRotateTarget+".y\n",code+="mul "+R+".w,"+cos+","+animationRegisterCache.scaleAndRotateTarget+".z\n",code+="sub "+animationRegisterCache.scaleAndRotateTarget+".y,"+R+".x,"+R+".y\n",code+="add "+animationRegisterCache.scaleAndRotateTarget+".z,"+R+".z,"+R+".w\n",code+="abs "+R+".y,"+nrmDirection+".y\n",code+="sge "+R+".z,"+R+".y,"+animationRegisterCache.vertexOneConst+"\n",code+="mul "+R+".x,"+R+".y,"+nrmDirection+".y\n",code+="mov "+nrmDirection+".y,"+animationRegisterCache.vertexZeroConst+"\n",code+="dp3 "+sin+","+nrmDirection+".xyz,"+nrmDirection+".xyz\n",code+="sge "+tempSingle+","+animationRegisterCache.vertexZeroConst+","+sin+"\n",code+="mov "+nrmDirection+".y,"+animationRegisterCache.vertexZeroConst+"\n",code+="nrm "+nrmDirection+".xyz,"+nrmDirection+".xyz\n",code+="sub "+sin+","+animationRegisterCache.vertexOneConst+","+tempSingle+"\n",code+="mul "+sin+","+sin+","+nrmDirection+".x\n",code+="mov "+cos+","+nrmDirection+".z\n",code+="neg "+cos+","+cos+"\n",code+="sub "+o_temp+","+animationRegisterCache.vertexOneConst+","+cos+"\n",code+="mul "+o_temp+","+R+".x,"+tempSingle+"\n",code+="add "+cos+","+cos+","+o_temp+"\n",code+="mul "+R+".x,"+cos+","+animationRegisterCache.scaleAndRotateTarget+".x\n",code+="mul "+R+".y,"+sin+","+animationRegisterCache.scaleAndRotateTarget+".z\n",code+="mul "+R+".z,"+sin+","+animationRegisterCache.scaleAndRotateTarget+".x\n",code+="mul "+R+".w,"+cos+","+animationRegisterCache.scaleAndRotateTarget+".z\n",code+="sub "+animationRegisterCache.scaleAndRotateTarget+".x,"+R+".x,"+R+".y\n",code+="add "+animationRegisterCache.scaleAndRotateTarget+".z,"+R+".z,"+R+".w\n",i=0;len>i;i++)code+="sub "+nrmDirection+".xyz,"+positionAttribute+".xyz,"+animationRegisterCache.positionTarget+".xyz\n",code+="nrm "+nrmDirection+".xyz,"+nrmDirection+".xyz\n",code+="mov "+sin+","+nrmDirection+".y\n",code+="mul "+cos+","+sin+","+sin+"\n",code+="sub "+cos+","+animationRegisterCache.vertexOneConst+","+cos+"\n",code+="sqt "+cos+","+cos+"\n",code+="mul "+R+".x,"+cos+","+animationRegisterCache.rotationRegisters[i]+".y\n",code+="mul "+R+".y,"+sin+","+animationRegisterCache.rotationRegisters[i]+".z\n",code+="mul "+R+".z,"+sin+","+animationRegisterCache.rotationRegisters[i]+".y\n",code+="mul "+R+".w,"+cos+","+animationRegisterCache.rotationRegisters[i]+".z\n",code+="sub "+animationRegisterCache.rotationRegisters[i]+".y,"+R+".x,"+R+".y\n",code+="add "+animationRegisterCache.rotationRegisters[i]+".z,"+R+".z,"+R+".w\n",code+="abs "+R+".y,"+nrmDirection+".y\n",code+="sge "+R+".z,"+R+".y,"+animationRegisterCache.vertexOneConst+"\n",code+="mul "+R+".x,"+R+".y,"+nrmDirection+".y\n",code+="mov "+nrmDirection+".y,"+animationRegisterCache.vertexZeroConst+"\n",code+="dp3 "+sin+","+nrmDirection+".xyz,"+nrmDirection+".xyz\n",code+="sge "+tempSingle+","+animationRegisterCache.vertexZeroConst+","+sin+"\n",code+="mov "+nrmDirection+".y,"+animationRegisterCache.vertexZeroConst+"\n",code+="nrm "+nrmDirection+".xyz,"+nrmDirection+".xyz\n",code+="sub "+sin+","+animationRegisterCache.vertexOneConst+","+tempSingle+"\n",code+="mul "+sin+","+sin+","+nrmDirection+".x\n",code+="mov "+cos+","+nrmDirection+".z\n",code+="neg "+cos+","+cos+"\n",code+="sub "+o_temp+","+animationRegisterCache.vertexOneConst+","+cos+"\n",code+="mul "+o_temp+","+R+".x,"+tempSingle+"\n",code+="add "+cos+","+cos+","+o_temp+"\n",code+="mul "+R+".x,"+cos+","+animationRegisterCache.rotationRegisters[i]+".x\n",code+="mul "+R+".y,"+sin+","+animationRegisterCache.rotationRegisters[i]+".z\n",code+="mul "+R+".z,"+sin+","+animationRegisterCache.rotationRegisters[i]+".x\n",code+="mul "+R+".w,"+cos+","+animationRegisterCache.rotationRegisters[i]+".z\n",code+="sub "+animationRegisterCache.rotationRegisters[i]+".x,"+R+".x,"+R+".y\n",code+="add "+animationRegisterCache.rotationRegisters[i]+".z,"+R+".z,"+R+".w\n"}return code},ParticleRotateToPositionNode.prototype.getAnimationState=function(animator){return animator.getAnimationState(this)},ParticleRotateToPositionNode.prototype._iGeneratePropertyOfOneParticle=function(param){var offset=param[ParticleRotateToPositionNode.POSITION_VECTOR3D];if(!offset)throw new Error("there is no "+ParticleRotateToPositionNode.POSITION_VECTOR3D+" in param!");this._pOneData[0]=offset.x,this._pOneData[1]=offset.y,this._pOneData[2]=offset.z},ParticleRotateToPositionNode.MATRIX_INDEX=0,ParticleRotateToPositionNode.POSITION_INDEX=1,ParticleRotateToPositionNode.POSITION_VECTOR3D="RotateToPositionVector3D",ParticleRotateToPositionNode}(animators.ParticleNodeBase);animators.ParticleRotateToPositionNode=ParticleRotateToPositionNode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var Vector3D=away.geom.Vector3D,ShaderRegisterElement=away.materials.ShaderRegisterElement,ParticleRotationalVelocityNode=function(_super){function ParticleRotationalVelocityNode(mode,rotationalVelocity){"undefined"==typeof rotationalVelocity&&(rotationalVelocity=null),_super.call(this,"ParticleRotationalVelocity",mode,4),this._pStateClass=animators.ParticleRotationalVelocityState,this._iRotationalVelocity=rotationalVelocity||new Vector3D}return __extends(ParticleRotationalVelocityNode,_super),ParticleRotationalVelocityNode.prototype.getAGALVertexCode=function(shaderObject,animationRegisterCache){var rotationRegister=this._pMode==animators.ParticlePropertiesMode.GLOBAL?animationRegisterCache.getFreeVertexConstant():animationRegisterCache.getFreeVertexAttribute();animationRegisterCache.setRegisterIndex(this,ParticleRotationalVelocityNode.ROTATIONALVELOCITY_INDEX,rotationRegister.index);var nrmVel=animationRegisterCache.getFreeVertexVectorTemp();animationRegisterCache.addVertexTempUsages(nrmVel,1);var xAxis=animationRegisterCache.getFreeVertexVectorTemp();animationRegisterCache.addVertexTempUsages(xAxis,1);var temp=animationRegisterCache.getFreeVertexVectorTemp();animationRegisterCache.addVertexTempUsages(temp,1);var Rtemp=new ShaderRegisterElement(temp.regName,temp.index),R_rev=animationRegisterCache.getFreeVertexVectorTemp();R_rev=new ShaderRegisterElement(R_rev.regName,R_rev.index);var cos=new ShaderRegisterElement(Rtemp.regName,Rtemp.index,3),sin=new ShaderRegisterElement(R_rev.regName,R_rev.index,3);animationRegisterCache.removeVertexTempUsage(nrmVel),animationRegisterCache.removeVertexTempUsage(xAxis),animationRegisterCache.removeVertexTempUsage(temp);var code="";code+="mov "+nrmVel+".xyz,"+rotationRegister+".xyz\n",code+="mov "+nrmVel+".w,"+animationRegisterCache.vertexZeroConst+"\n",code+="mul "+cos+","+animationRegisterCache.vertexTime+","+rotationRegister+".w\n",code+="sin "+sin+","+cos+"\n",code+="cos "+cos+","+cos+"\n",code+="mul "+Rtemp+".xyz,"+sin+","+nrmVel+".xyz\n",code+="mul "+R_rev+".xyz,"+sin+","+nrmVel+".xyz\n",code+="neg "+R_rev+".xyz,"+R_rev+".xyz\n",code+="crs "+nrmVel+".xyz,"+Rtemp+".xyz,"+animationRegisterCache.scaleAndRotateTarget+".xyz\n",code+="mul "+xAxis+".xyz,"+cos+","+animationRegisterCache.scaleAndRotateTarget+".xyz\n",code+="add "+nrmVel+".xyz,"+nrmVel+".xyz,"+xAxis+".xyz\n",code+="dp3 "+xAxis+".w,"+Rtemp+".xyz,"+animationRegisterCache.scaleAndRotateTarget+".xyz\n",code+="neg "+nrmVel+".w,"+xAxis+".w\n",code+="crs "+Rtemp+".xyz,"+nrmVel+".xyz,"+R_rev+".xyz\n",code+="mul "+xAxis+".xyzw,"+nrmVel+".xyzw,"+cos+"\n",code+="add "+Rtemp+".xyz,"+Rtemp+".xyz,"+xAxis+".xyz\n",code+="mul "+xAxis+".xyz,"+nrmVel+".w,"+R_rev+".xyz\n",code+="add "+animationRegisterCache.scaleAndRotateTarget+".xyz,"+Rtemp+".xyz,"+xAxis+".xyz\n";for(var len=animationRegisterCache.rotationRegisters.length,i=0;len>i;i++)code+="mov "+nrmVel+".xyz,"+rotationRegister+".xyz\n",code+="mov "+nrmVel+".w,"+animationRegisterCache.vertexZeroConst+"\n",code+="mul "+cos+","+animationRegisterCache.vertexTime+","+rotationRegister+".w\n",code+="sin "+sin+","+cos+"\n",code+="cos "+cos+","+cos+"\n",code+="mul "+Rtemp+".xyz,"+sin+","+nrmVel+".xyz\n",code+="mul "+R_rev+".xyz,"+sin+","+nrmVel+".xyz\n",code+="neg "+R_rev+".xyz,"+R_rev+".xyz\n",code+="crs "+nrmVel+".xyz,"+Rtemp+".xyz,"+animationRegisterCache.rotationRegisters[i]+".xyz\n",code+="mul "+xAxis+".xyz,"+cos+","+animationRegisterCache.rotationRegisters[i]+"\n",code+="add "+nrmVel+".xyz,"+nrmVel+".xyz,"+xAxis+".xyz\n",code+="dp3 "+xAxis+".w,"+Rtemp+".xyz,"+animationRegisterCache.rotationRegisters[i]+"\n",code+="neg "+nrmVel+".w,"+xAxis+".w\n",code+="crs "+Rtemp+".xyz,"+nrmVel+".xyz,"+R_rev+".xyz\n",code+="mul "+xAxis+".xyzw,"+nrmVel+".xyzw,"+cos+"\n",code+="add "+Rtemp+".xyz,"+Rtemp+".xyz,"+xAxis+".xyz\n",code+="mul "+xAxis+".xyz,"+nrmVel+".w,"+R_rev+".xyz\n",code+="add "+animationRegisterCache.rotationRegisters[i]+","+Rtemp+".xyz,"+xAxis+".xyz\n";return code},ParticleRotationalVelocityNode.prototype.getAnimationState=function(animator){return animator.getAnimationState(this)},ParticleRotationalVelocityNode.prototype._iGeneratePropertyOfOneParticle=function(param){var rotate=param[ParticleRotationalVelocityNode.ROTATIONALVELOCITY_VECTOR3D];if(!rotate)throw new Error("there is no "+ParticleRotationalVelocityNode.ROTATIONALVELOCITY_VECTOR3D+" in param!");if(rotate.length<=0?rotate.z=1:rotate.normalize(),this._pOneData[0]=rotate.x,this._pOneData[1]=rotate.y,this._pOneData[2]=rotate.z,rotate.w<=0)throw new Error("the cycle duration must greater than zero");this._pOneData[3]=Math.PI/rotate.w},ParticleRotationalVelocityNode.ROTATIONALVELOCITY_INDEX=0,ParticleRotationalVelocityNode.ROTATIONALVELOCITY_VECTOR3D="RotationalVelocityVector3D",ParticleRotationalVelocityNode}(animators.ParticleNodeBase);animators.ParticleRotationalVelocityNode=ParticleRotationalVelocityNode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var ParticleScaleNode=function(_super){function ParticleScaleNode(mode,usesCycle,usesPhase,minScale,maxScale,cycleDuration,cyclePhase){"undefined"==typeof minScale&&(minScale=1),"undefined"==typeof maxScale&&(maxScale=1),"undefined"==typeof cycleDuration&&(cycleDuration=1),"undefined"==typeof cyclePhase&&(cyclePhase=0),_super.call(this,"ParticleScale",mode,usesCycle&&usesPhase?4:usesCycle||usesPhase?3:2,3),this._pStateClass=animators.ParticleScaleState,this._iUsesCycle=usesCycle,this._iUsesPhase=usesPhase,this._iMinScale=minScale,this._iMaxScale=maxScale,this._iCycleDuration=cycleDuration,this._iCyclePhase=cyclePhase}return __extends(ParticleScaleNode,_super),ParticleScaleNode.prototype.getAGALVertexCode=function(shaderObject,animationRegisterCache){var code="",temp=animationRegisterCache.getFreeVertexSingleTemp(),scaleRegister=this._pMode==animators.ParticlePropertiesMode.GLOBAL?animationRegisterCache.getFreeVertexConstant():animationRegisterCache.getFreeVertexAttribute();return animationRegisterCache.setRegisterIndex(this,ParticleScaleNode.SCALE_INDEX,scaleRegister.index),this._iUsesCycle&&(code+="mul "+temp+","+animationRegisterCache.vertexTime+","+scaleRegister+".z\n",this._iUsesPhase&&(code+="add "+temp+","+temp+","+scaleRegister+".w\n"),code+="sin "+temp+","+temp+"\n"),code+="mul "+temp+","+scaleRegister+".y,"+(this._iUsesCycle?temp:animationRegisterCache.vertexLife)+"\n",code+="add "+temp+","+scaleRegister+".x,"+temp+"\n",code+="mul "+animationRegisterCache.scaleAndRotateTarget+".xyz,"+animationRegisterCache.scaleAndRotateTarget+".xyz,"+temp+"\n"},ParticleScaleNode.prototype.getAnimationState=function(animator){return animator.getAnimationState(this)},ParticleScaleNode.prototype._iGeneratePropertyOfOneParticle=function(param){var scale=param[ParticleScaleNode.SCALE_VECTOR3D];if(!scale)throw new Error("there is no "+ParticleScaleNode.SCALE_VECTOR3D+" in param!");if(this._iUsesCycle){if(this._pOneData[0]=(scale.x+scale.y)/2,this._pOneData[1]=Math.abs(scale.x-scale.y)/2,scale.z<=0)throw new Error("the cycle duration must be greater than zero");this._pOneData[2]=2*Math.PI/scale.z,this._iUsesPhase&&(this._pOneData[3]=scale.w*Math.PI/180)}else this._pOneData[0]=scale.x,this._pOneData[1]=scale.y-scale.x},ParticleScaleNode.SCALE_INDEX=0,ParticleScaleNode.SCALE_VECTOR3D="ScaleVector3D",ParticleScaleNode}(animators.ParticleNodeBase);animators.ParticleScaleNode=ParticleScaleNode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var ShaderRegisterElement=away.materials.ShaderRegisterElement,ParticleSegmentedColorNode=function(_super){function ParticleSegmentedColorNode(usesMultiplier,usesOffset,numSegmentPoint,startColor,endColor,segmentPoints){if(_super.call(this,"ParticleSegmentedColor",animators.ParticlePropertiesMode.GLOBAL,0,animators.ParticleAnimationSet.COLOR_PRIORITY),this._pStateClass=animators.ParticleSegmentedColorState,numSegmentPoint>4)throw new Error("the numSegmentPoint must be less or equal 4");this._iUsesMultiplier=usesMultiplier,this._iUsesOffset=usesOffset,this._iNumSegmentPoint=numSegmentPoint,this._iStartColor=startColor,this._iEndColor=endColor,this._iSegmentPoints=segmentPoints}return __extends(ParticleSegmentedColorNode,_super),ParticleSegmentedColorNode.prototype._iProcessAnimationSetting=function(particleAnimationSet){this._iUsesMultiplier&&(particleAnimationSet.hasColorMulNode=!0),this._iUsesOffset&&(particleAnimationSet.hasColorAddNode=!0)},ParticleSegmentedColorNode.prototype.getAGALVertexCode=function(shaderObject,animationRegisterCache){var code="";if(animationRegisterCache.needFragmentAnimation){var accMultiplierColor;this._iUsesMultiplier&&(accMultiplierColor=animationRegisterCache.getFreeVertexVectorTemp(),animationRegisterCache.addVertexTempUsages(accMultiplierColor,1));var tempColor=animationRegisterCache.getFreeVertexVectorTemp();animationRegisterCache.addVertexTempUsages(tempColor,1);var temp=animationRegisterCache.getFreeVertexVectorTemp(),accTime=new ShaderRegisterElement(temp.regName,temp.index,0),tempTime=new ShaderRegisterElement(temp.regName,temp.index,1);this._iUsesMultiplier&&animationRegisterCache.removeVertexTempUsage(accMultiplierColor),animationRegisterCache.removeVertexTempUsage(tempColor);var lifeTimeRegister=animationRegisterCache.getFreeVertexConstant();animationRegisterCache.setRegisterIndex(this,ParticleSegmentedColorNode.TIME_DATA_INDEX,lifeTimeRegister.index);var i,startMulValue,deltaMulValues;if(this._iUsesMultiplier)for(startMulValue=animationRegisterCache.getFreeVertexConstant(),animationRegisterCache.setRegisterIndex(this,ParticleSegmentedColorNode.START_MULTIPLIER_INDEX,startMulValue.index),deltaMulValues=new Array,i=0;i1&&(code+="mul "+v+","+v+","+vStep+"\n"),this._iUsesCycle?(code+=this._iUsesPhase?"add "+time+","+animationRegisterCache.vertexTime+","+phaseTime+"\n":"mov "+time+","+animationRegisterCache.vertexTime+"\n",code+="div "+time+","+time+","+cycle+"\n",code+="frc "+time+","+time+"\n",code+="mul "+time+","+time+","+cycle+"\n",code+="mul "+temp+","+time+","+uSpeed+"\n"):code+="mul "+temp.toString()+","+animationRegisterCache.vertexLife+","+uTotal+"\n",this._iNumRows>1&&(code+="frc "+temp2+","+temp+"\n",code+="sub "+vOffset+","+temp+","+temp2+"\n",code+="mul "+vOffset+","+vOffset+","+vStep+"\n",code+="add "+v+","+v+","+vOffset+"\n"),code+="div "+temp2+","+temp+","+uStep+"\n",code+="frc "+temp+","+temp2+"\n",code+="sub "+temp2+","+temp2+","+temp+"\n",code+="mul "+temp+","+temp2+","+uStep+"\n",this._iNumRows>1&&(code+="frc "+temp+","+temp+"\n"),code+="add "+u+","+u+","+temp+"\n"},ParticleSpriteSheetNode.prototype.getAnimationState=function(animator){return animator.getAnimationState(this)},ParticleSpriteSheetNode.prototype._iProcessAnimationSetting=function(particleAnimationSet){particleAnimationSet.hasUVNode=!0},ParticleSpriteSheetNode.prototype._iGeneratePropertyOfOneParticle=function(param){if(this._iUsesCycle){var uvCycle=param[ParticleSpriteSheetNode.UV_VECTOR3D];if(!uvCycle)throw new Error("there is no "+ParticleSpriteSheetNode.UV_VECTOR3D+" in param!");if(uvCycle.x<=0)throw new Error("the cycle duration must be greater than zero");var uTotal=this._iTotalFrames/this._iNumColumns;this._pOneData[0]=uTotal/uvCycle.x,this._pOneData[1]=uvCycle.x,this._iUsesPhase&&(this._pOneData[2]=uvCycle.y)}},ParticleSpriteSheetNode.UV_INDEX_0=0,ParticleSpriteSheetNode.UV_INDEX_1=1,ParticleSpriteSheetNode.UV_VECTOR3D="UVVector3D",ParticleSpriteSheetNode}(animators.ParticleNodeBase);animators.ParticleSpriteSheetNode=ParticleSpriteSheetNode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var ParticleTimeNode=function(_super){function ParticleTimeNode(usesDuration,usesLooping,usesDelay){"undefined"==typeof usesDuration&&(usesDuration=!1),"undefined"==typeof usesLooping&&(usesLooping=!1),"undefined"==typeof usesDelay&&(usesDelay=!1),this._pStateClass=animators.ParticleTimeState,this._iUsesDuration=usesDuration,this._iUsesLooping=usesLooping,this._iUsesDelay=usesDelay,_super.call(this,"ParticleTime",animators.ParticlePropertiesMode.LOCAL_STATIC,4,0)}return __extends(ParticleTimeNode,_super),ParticleTimeNode.prototype.getAGALVertexCode=function(shaderObject,animationRegisterCache){var timeStreamRegister=animationRegisterCache.getFreeVertexAttribute();animationRegisterCache.setRegisterIndex(this,ParticleTimeNode.TIME_STREAM_INDEX,timeStreamRegister.index);var timeConst=animationRegisterCache.getFreeVertexConstant();animationRegisterCache.setRegisterIndex(this,ParticleTimeNode.TIME_CONSTANT_INDEX,timeConst.index);var code="";code+="sub "+animationRegisterCache.vertexTime+","+timeConst+","+timeStreamRegister+".x\n";var temp=animationRegisterCache.getFreeVertexSingleTemp();if(code+="sge "+temp+","+animationRegisterCache.vertexTime+","+animationRegisterCache.vertexZeroConst+"\n",code+="mul "+animationRegisterCache.scaleAndRotateTarget+".xyz,"+animationRegisterCache.scaleAndRotateTarget+".xyz,"+temp+"\n",this._iUsesDuration)if(this._iUsesLooping){var div=animationRegisterCache.getFreeVertexSingleTemp(); -this._iUsesDelay?(code+="div "+div+","+animationRegisterCache.vertexTime+","+timeStreamRegister+".z\n",code+="frc "+div+","+div+"\n",code+="mul "+animationRegisterCache.vertexTime+","+div+","+timeStreamRegister+".z\n",code+="slt "+div+","+animationRegisterCache.vertexTime+","+timeStreamRegister+".y\n",code+="mul "+animationRegisterCache.scaleAndRotateTarget+".xyz,"+animationRegisterCache.scaleAndRotateTarget+".xyz,"+div+"\n"):(code+="mul "+div+","+animationRegisterCache.vertexTime+","+timeStreamRegister+".w\n",code+="frc "+div+","+div+"\n",code+="mul "+animationRegisterCache.vertexTime+","+div+","+timeStreamRegister+".y\n")}else{var sge=animationRegisterCache.getFreeVertexSingleTemp();code+="sge "+sge+","+timeStreamRegister+".y,"+animationRegisterCache.vertexTime+"\n",code+="mul "+animationRegisterCache.scaleAndRotateTarget+".xyz,"+animationRegisterCache.scaleAndRotateTarget+".xyz,"+sge+"\n"}return code+="mul "+animationRegisterCache.vertexLife+","+animationRegisterCache.vertexTime+","+timeStreamRegister+".w\n"},ParticleTimeNode.prototype.getAnimationState=function(animator){return animator.getAnimationState(this)},ParticleTimeNode.prototype._iGeneratePropertyOfOneParticle=function(param){this._pOneData[0]=param.startTime,this._pOneData[1]=param.duration,this._pOneData[2]=param.delay+param.duration,this._pOneData[3]=1/param.duration},ParticleTimeNode.TIME_STREAM_INDEX=0,ParticleTimeNode.TIME_CONSTANT_INDEX=1,ParticleTimeNode}(animators.ParticleNodeBase);animators.ParticleTimeNode=ParticleTimeNode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var Vector3D=away.geom.Vector3D,ShaderRegisterElement=away.materials.ShaderRegisterElement,ParticleUVNode=function(_super){function ParticleUVNode(mode,cycle,scale,axis){"undefined"==typeof cycle&&(cycle=1),"undefined"==typeof scale&&(scale=1),"undefined"==typeof axis&&(axis="x"),_super.call(this,"ParticleUV",animators.ParticlePropertiesMode.GLOBAL,4,animators.ParticleAnimationSet.POST_PRIORITY+1),this._pStateClass=animators.ParticleUVState,this._cycle=cycle,this._scale=scale,this._axis=axis,this.updateUVData()}return __extends(ParticleUVNode,_super),Object.defineProperty(ParticleUVNode.prototype,"cycle",{get:function(){return this._cycle},set:function(value){this._cycle=value,this.updateUVData()},enumerable:!0,configurable:!0}),Object.defineProperty(ParticleUVNode.prototype,"scale",{get:function(){return this._scale},set:function(value){this._scale=value,this.updateUVData()},enumerable:!0,configurable:!0}),Object.defineProperty(ParticleUVNode.prototype,"axis",{get:function(){return this._axis},set:function(value){this._axis=value},enumerable:!0,configurable:!0}),ParticleUVNode.prototype.getAGALUVCode=function(shaderObject,animationRegisterCache){var code="",uvConst=animationRegisterCache.getFreeVertexConstant();animationRegisterCache.setRegisterIndex(this,ParticleUVNode.UV_INDEX,uvConst.index);var axisIndex="x"==this._axis?0:"y"==this._axis?1:2,target=new ShaderRegisterElement(animationRegisterCache.uvTarget.regName,animationRegisterCache.uvTarget.index,axisIndex),sin=animationRegisterCache.getFreeVertexSingleTemp();return 1!=this._scale&&(code+="mul "+target+","+target+","+uvConst+".y\n"),code+="mul "+sin+","+animationRegisterCache.vertexTime+","+uvConst+".x\n",code+="sin "+sin+","+sin+"\n",code+="add "+target+","+target+","+sin+"\n"},ParticleUVNode.prototype.getAnimationState=function(animator){return animator.getAnimationState(this)},ParticleUVNode.prototype.updateUVData=function(){this._iUvData=new Vector3D(2*Math.PI/this._cycle,this._scale,0,0)},ParticleUVNode.prototype._iProcessAnimationSetting=function(particleAnimationSet){particleAnimationSet.hasUVNode=!0},ParticleUVNode.UV_INDEX=0,ParticleUVNode.U_AXIS="x",ParticleUVNode.V_AXIS="y",ParticleUVNode}(animators.ParticleNodeBase);animators.ParticleUVNode=ParticleUVNode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var Vector3D=away.geom.Vector3D,ParticleVelocityNode=function(_super){function ParticleVelocityNode(mode,velocity){"undefined"==typeof velocity&&(velocity=null),_super.call(this,"ParticleVelocity",mode,3),this._pStateClass=animators.ParticleVelocityState,this._iVelocity=velocity||new Vector3D}return __extends(ParticleVelocityNode,_super),ParticleVelocityNode.prototype.getAGALVertexCode=function(shaderObject,animationRegisterCache){var velocityValue=this._pMode==animators.ParticlePropertiesMode.GLOBAL?animationRegisterCache.getFreeVertexConstant():animationRegisterCache.getFreeVertexAttribute();animationRegisterCache.setRegisterIndex(this,ParticleVelocityNode.VELOCITY_INDEX,velocityValue.index);var distance=animationRegisterCache.getFreeVertexVectorTemp(),code="";return code+="mul "+distance+","+animationRegisterCache.vertexTime+","+velocityValue+"\n",code+="add "+animationRegisterCache.positionTarget+".xyz,"+distance+","+animationRegisterCache.positionTarget+".xyz\n",animationRegisterCache.needVelocity&&(code+="add "+animationRegisterCache.velocityTarget+".xyz,"+velocityValue+".xyz,"+animationRegisterCache.velocityTarget+".xyz\n"),code},ParticleVelocityNode.prototype.getAnimationState=function(animator){return animator.getAnimationState(this)},ParticleVelocityNode.prototype._iGeneratePropertyOfOneParticle=function(param){var _tempVelocity=param[ParticleVelocityNode.VELOCITY_VECTOR3D];if(!_tempVelocity)throw new Error("there is no "+ParticleVelocityNode.VELOCITY_VECTOR3D+" in param!");this._pOneData[0]=_tempVelocity.x,this._pOneData[1]=_tempVelocity.y,this._pOneData[2]=_tempVelocity.z},ParticleVelocityNode.VELOCITY_INDEX=0,ParticleVelocityNode.VELOCITY_VECTOR3D="VelocityVector3D",ParticleVelocityNode}(animators.ParticleNodeBase);animators.ParticleVelocityNode=ParticleVelocityNode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var SkeletonBinaryLERPNode=function(_super){function SkeletonBinaryLERPNode(){_super.call(this),this._pStateClass=animators.SkeletonBinaryLERPState}return __extends(SkeletonBinaryLERPNode,_super),SkeletonBinaryLERPNode.prototype.getAnimationState=function(animator){return animator.getAnimationState(this)},SkeletonBinaryLERPNode}(animators.AnimationNodeBase);animators.SkeletonBinaryLERPNode=SkeletonBinaryLERPNode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var SkeletonClipNode=function(_super){function SkeletonClipNode(){_super.call(this),this._frames=new Array,this.highQuality=!1,this._pStateClass=animators.SkeletonClipState}return __extends(SkeletonClipNode,_super),Object.defineProperty(SkeletonClipNode.prototype,"frames",{get:function(){return this._frames},enumerable:!0,configurable:!0}),SkeletonClipNode.prototype.addFrame=function(skeletonPose,duration){this._frames.push(skeletonPose),this._pDurations.push(duration),this._pNumFrames=this._pDurations.length,this._pStitchDirty=!0},SkeletonClipNode.prototype.getAnimationState=function(animator){return animator.getAnimationState(this)},SkeletonClipNode.prototype._pUpdateStitch=function(){_super.prototype._pUpdateStitch.call(this);for(var p1,p2,delta,i=this._pNumFrames-1;i--;)this._pTotalDuration+=this._pDurations[i],p1=this._frames[i].jointPoses[0].translation,p2=this._frames[i+1].jointPoses[0].translation,delta=p2.subtract(p1),this._pTotalDelta.x+=delta.x,this._pTotalDelta.y+=delta.y,this._pTotalDelta.z+=delta.z;(this._pStitchFinalFrame||!this._pLooping)&&(this._pTotalDuration+=this._pDurations[this._pNumFrames-1],p1=this._frames[0].jointPoses[0].translation,p2=this._frames[1].jointPoses[0].translation,delta=p2.subtract(p1),this._pTotalDelta.x+=delta.x,this._pTotalDelta.y+=delta.y,this._pTotalDelta.z+=delta.z)},SkeletonClipNode}(animators.AnimationClipNodeBase);animators.SkeletonClipNode=SkeletonClipNode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var SkeletonDifferenceNode=function(_super){function SkeletonDifferenceNode(){_super.call(this),this._pStateClass=animators.SkeletonDifferenceState}return __extends(SkeletonDifferenceNode,_super),SkeletonDifferenceNode.prototype.getAnimationState=function(animator){return animator.getAnimationState(this)},SkeletonDifferenceNode}(animators.AnimationNodeBase);animators.SkeletonDifferenceNode=SkeletonDifferenceNode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var SkeletonDirectionalNode=function(_super){function SkeletonDirectionalNode(){_super.call(this),this._pStateClass=animators.SkeletonDirectionalState}return __extends(SkeletonDirectionalNode,_super),SkeletonDirectionalNode.prototype.getAnimationState=function(animator){return animator.getAnimationState(this)},SkeletonDirectionalNode}(animators.AnimationNodeBase);animators.SkeletonDirectionalNode=SkeletonDirectionalNode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var SkeletonNaryLERPNode=function(_super){function SkeletonNaryLERPNode(){_super.call(this),this._iInputs=new Array,this._pStateClass=animators.SkeletonNaryLERPState}return __extends(SkeletonNaryLERPNode,_super),Object.defineProperty(SkeletonNaryLERPNode.prototype,"numInputs",{get:function(){return this._numInputs},enumerable:!0,configurable:!0}),SkeletonNaryLERPNode.prototype.getInputIndex=function(input){return this._iInputs.indexOf(input)},SkeletonNaryLERPNode.prototype.getInputAt=function(index){return this._iInputs[index]},SkeletonNaryLERPNode.prototype.addInput=function(input){this._iInputs[this._numInputs++]=input},SkeletonNaryLERPNode.prototype.getAnimationState=function(animator){return animator.getAnimationState(this)},SkeletonNaryLERPNode}(animators.AnimationNodeBase);animators.SkeletonNaryLERPNode=SkeletonNaryLERPNode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var VertexClipNode=function(_super){function VertexClipNode(){_super.call(this),this._frames=new Array,this._translations=new Array,this._pStateClass=away.animators.VertexClipState}return __extends(VertexClipNode,_super),Object.defineProperty(VertexClipNode.prototype,"frames",{get:function(){return this._frames},enumerable:!0,configurable:!0}),VertexClipNode.prototype.addFrame=function(geometry,duration,translation){"undefined"==typeof translation&&(translation=null),this._frames.push(geometry),this._pDurations.push(duration),this._translations.push(translation||new away.geom.Vector3D),this._pNumFrames=this._pDurations.length,this._pStitchDirty=!0},VertexClipNode.prototype._pUpdateStitch=function(){_super.prototype._pUpdateStitch.call(this);for(var p1,p2,delta,i=this._pNumFrames-1;i--;)this._pTotalDuration+=this._pDurations[i],p1=this._translations[i],p2=this._translations[i+1],delta=p2.subtract(p1),this._pTotalDelta.x+=delta.x,this._pTotalDelta.y+=delta.y,this._pTotalDelta.z+=delta.z;this._pNumFrames>1&&(this._pStitchFinalFrame||!this._pLooping)&&(this._pTotalDuration+=this._pDurations[this._pNumFrames-1],p1=this._translations[0],p2=this._translations[1],delta=p2.subtract(p1),this._pTotalDelta.x+=delta.x,this._pTotalDelta.y+=delta.y,this._pTotalDelta.z+=delta.z)},VertexClipNode}(animators.AnimationClipNodeBase);animators.VertexClipNode=VertexClipNode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var AnimationStateBase=function(){function AnimationStateBase(animator,animationNode){this._pRootDelta=new away.geom.Vector3D,this._pPositionDeltaDirty=!0,this._pStartTime=0,this._pAnimator=animator,this._pAnimationNode=animationNode}return Object.defineProperty(AnimationStateBase.prototype,"positionDelta",{get:function(){return this._pPositionDeltaDirty&&this._pUpdatePositionDelta(),this._pRootDelta},enumerable:!0,configurable:!0}),AnimationStateBase.prototype.offset=function(startTime){this._pStartTime=startTime,this._pPositionDeltaDirty=!0},AnimationStateBase.prototype.update=function(time){this._pTime!=time-this._pStartTime&&this._pUpdateTime(time)},AnimationStateBase.prototype.phase=function(){},AnimationStateBase.prototype._pUpdateTime=function(time){this._pTime=time-this._pStartTime,this._pPositionDeltaDirty=!0},AnimationStateBase.prototype._pUpdatePositionDelta=function(){},AnimationStateBase}();animators.AnimationStateBase=AnimationStateBase}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var ParticleStateBase=function(_super){function ParticleStateBase(animator,particleNode,needUpdateTime){"undefined"==typeof needUpdateTime&&(needUpdateTime=!1),_super.call(this,animator,particleNode),this._pDynamicProperties=new Array,this._pDynamicPropertiesDirty=new Object,this._particleNode=particleNode,this._pNeedUpdateTime=needUpdateTime}return __extends(ParticleStateBase,_super),Object.defineProperty(ParticleStateBase.prototype,"needUpdateTime",{get:function(){return this._pNeedUpdateTime},enumerable:!0,configurable:!0}),ParticleStateBase.prototype.setRenderState=function(){},ParticleStateBase.prototype._pUpdateDynamicProperties=function(animationSubGeometry){this._pDynamicPropertiesDirty[animationSubGeometry._iUniqueId]=!0;for(var vertexLength,startingOffset,vertexOffset,data,animationParticle,animationParticles=animationSubGeometry.animationParticles,vertexData=animationSubGeometry.vertexData,totalLenOfOneVertex=animationSubGeometry.totalLenOfOneVertex,dataLength=this._particleNode.dataLength,dataOffset=this._particleNode._iDataOffset,numParticles=this._pDynamicProperties.length,i=0,j=0,k=0;numParticles>i;){for(;numParticles>j&&(animationParticle=animationParticles[j]).index==i;){for(data=this._pDynamicProperties[i],vertexLength=animationParticle.numVertices*totalLenOfOneVertex,startingOffset=animationParticle.startVertexIndex*totalLenOfOneVertex+dataOffset,k=0;vertexLength>k;k+=totalLenOfOneVertex)for(vertexOffset=startingOffset+k,k=0;vertexLength>k;k+=totalLenOfOneVertex)vertexOffset=startingOffset+k,vertexData[vertexOffset++]=data.x,vertexData[vertexOffset++]=data.y,vertexData[vertexOffset++]=data.z,4==dataLength&&(vertexData[vertexOffset++]=data.w);j++}i++}animationSubGeometry.invalidateBuffer()},ParticleStateBase}(animators.AnimationStateBase);animators.ParticleStateBase=ParticleStateBase}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var ContextGLVertexBufferFormat=away.stagegl.ContextGLVertexBufferFormat,Vector3D=away.geom.Vector3D,ParticleAccelerationState=function(_super){function ParticleAccelerationState(animator,particleAccelerationNode){_super.call(this,animator,particleAccelerationNode),this._particleAccelerationNode=particleAccelerationNode,this._acceleration=this._particleAccelerationNode._acceleration,this.updateAccelerationData()}return __extends(ParticleAccelerationState,_super),Object.defineProperty(ParticleAccelerationState.prototype,"acceleration",{get:function(){return this._acceleration},set:function(value){this._acceleration.x=value.x,this._acceleration.y=value.y,this._acceleration.z=value.z,this.updateAccelerationData()},enumerable:!0,configurable:!0}),ParticleAccelerationState.prototype.setRenderState=function(stage,renderable,animationSubGeometry,animationRegisterCache){var index=animationRegisterCache.getRegisterIndex(this._pAnimationNode,animators.ParticleAccelerationNode.ACCELERATION_INDEX);this._particleAccelerationNode.mode==animators.ParticlePropertiesMode.LOCAL_STATIC?animationSubGeometry.activateVertexBuffer(index,this._particleAccelerationNode._iDataOffset,stage,ContextGLVertexBufferFormat.FLOAT_3):animationRegisterCache.setVertexConst(index,this._halfAcceleration.x,this._halfAcceleration.y,this._halfAcceleration.z)},ParticleAccelerationState.prototype.updateAccelerationData=function(){this._particleAccelerationNode.mode==animators.ParticlePropertiesMode.GLOBAL&&(this._halfAcceleration=new Vector3D(this._acceleration.x/2,this._acceleration.y/2,this._acceleration.z/2))},ParticleAccelerationState}(animators.ParticleStateBase);animators.ParticleAccelerationState=ParticleAccelerationState}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var ContextGLVertexBufferFormat=away.stagegl.ContextGLVertexBufferFormat,ParticleBezierCurveState=function(_super){function ParticleBezierCurveState(animator,particleBezierCurveNode){_super.call(this,animator,particleBezierCurveNode),this._particleBezierCurveNode=particleBezierCurveNode,this._controlPoint=this._particleBezierCurveNode._iControlPoint,this._endPoint=this._particleBezierCurveNode._iEndPoint}return __extends(ParticleBezierCurveState,_super),Object.defineProperty(ParticleBezierCurveState.prototype,"controlPoint",{get:function(){return this._controlPoint},set:function(value){this._controlPoint=value},enumerable:!0,configurable:!0}),Object.defineProperty(ParticleBezierCurveState.prototype,"endPoint",{get:function(){return this._endPoint},set:function(value){this._endPoint=value},enumerable:!0,configurable:!0}),ParticleBezierCurveState.prototype.setRenderState=function(stage,renderable,animationSubGeometry,animationRegisterCache){var controlIndex=animationRegisterCache.getRegisterIndex(this._pAnimationNode,animators.ParticleBezierCurveNode.BEZIER_CONTROL_INDEX),endIndex=animationRegisterCache.getRegisterIndex(this._pAnimationNode,animators.ParticleBezierCurveNode.BEZIER_END_INDEX);this._particleBezierCurveNode.mode==animators.ParticlePropertiesMode.LOCAL_STATIC?(animationSubGeometry.activateVertexBuffer(controlIndex,this._particleBezierCurveNode._iDataOffset,stage,ContextGLVertexBufferFormat.FLOAT_3),animationSubGeometry.activateVertexBuffer(endIndex,this._particleBezierCurveNode._iDataOffset+3,stage,ContextGLVertexBufferFormat.FLOAT_3)):(animationRegisterCache.setVertexConst(controlIndex,this._controlPoint.x,this._controlPoint.y,this._controlPoint.z),animationRegisterCache.setVertexConst(endIndex,this._endPoint.x,this._endPoint.y,this._endPoint.z))},ParticleBezierCurveState}(animators.ParticleStateBase);animators.ParticleBezierCurveState=ParticleBezierCurveState}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var Matrix3D=away.geom.Matrix3D,Orientation3D=away.geom.Orientation3D,MathConsts=away.geom.MathConsts,ParticleBillboardState=function(_super){function ParticleBillboardState(animator,particleNode){_super.call(this,animator,particleNode),this._matrix=new Matrix3D,this._billboardAxis=particleNode._iBillboardAxis}return __extends(ParticleBillboardState,_super),ParticleBillboardState.prototype.setRenderState=function(stage,renderable,animationSubGeometry,animationRegisterCache,camera){var comps;if(this._billboardAxis){var pos=renderable.sourceEntity.sceneTransform.position,look=camera.sceneTransform.position.subtract(pos),right=look.crossProduct(this._billboardAxis);right.normalize(),look=this.billboardAxis.crossProduct(right),look.normalize(),this._matrix.copyFrom(renderable.sourceEntity.sceneTransform),comps=this._matrix.decompose(Orientation3D.AXIS_ANGLE),this._matrix.copyColumnFrom(0,right),this._matrix.copyColumnFrom(1,this.billboardAxis),this._matrix.copyColumnFrom(2,look),this._matrix.copyColumnFrom(3,pos),this._matrix.appendRotation(-comps[1].w*MathConsts.RADIANS_TO_DEGREES,comps[1])}else this._matrix.copyFrom(renderable.sourceEntity.sceneTransform),this._matrix.append(camera.inverseSceneTransform),comps=this._matrix.decompose(Orientation3D.AXIS_ANGLE),this._matrix.identity(),this._matrix.appendRotation(-comps[1].w*MathConsts.RADIANS_TO_DEGREES,comps[1]);animationRegisterCache.setVertexConstFromMatrix(animationRegisterCache.getRegisterIndex(this._pAnimationNode,animators.ParticleBillboardNode.MATRIX_INDEX),this._matrix)},Object.defineProperty(ParticleBillboardState.prototype,"billboardAxis",{get:function(){return this.billboardAxis},set:function(value){this.billboardAxis=value?value.clone():null,this.billboardAxis&&this.billboardAxis.normalize()},enumerable:!0,configurable:!0}),ParticleBillboardState}(animators.ParticleStateBase);animators.ParticleBillboardState=ParticleBillboardState}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var ContextGLVertexBufferFormat=away.stagegl.ContextGLVertexBufferFormat,Vector3D=away.geom.Vector3D,ParticleColorState=function(_super){function ParticleColorState(animator,particleColorNode){_super.call(this,animator,particleColorNode),this._particleColorNode=particleColorNode,this._usesMultiplier=this._particleColorNode._iUsesMultiplier,this._usesOffset=this._particleColorNode._iUsesOffset,this._usesCycle=this._particleColorNode._iUsesCycle,this._usesPhase=this._particleColorNode._iUsesPhase,this._startColor=this._particleColorNode._iStartColor,this._endColor=this._particleColorNode._iEndColor,this._cycleDuration=this._particleColorNode._iCycleDuration,this._cyclePhase=this._particleColorNode._iCyclePhase,this.updateColorData()}return __extends(ParticleColorState,_super),Object.defineProperty(ParticleColorState.prototype,"startColor",{get:function(){return this._startColor},set:function(value){this._startColor=value,this.updateColorData()},enumerable:!0,configurable:!0}),Object.defineProperty(ParticleColorState.prototype,"endColor",{get:function(){return this._endColor},set:function(value){this._endColor=value,this.updateColorData()},enumerable:!0,configurable:!0}),Object.defineProperty(ParticleColorState.prototype,"cycleDuration",{get:function(){return this._cycleDuration},set:function(value){this._cycleDuration=value,this.updateColorData()},enumerable:!0,configurable:!0}),Object.defineProperty(ParticleColorState.prototype,"cyclePhase",{get:function(){return this._cyclePhase},set:function(value){this._cyclePhase=value,this.updateColorData()},enumerable:!0,configurable:!0}),ParticleColorState.prototype.setRenderState=function(stage,renderable,animationSubGeometry,animationRegisterCache){if(animationRegisterCache.needFragmentAnimation){var dataOffset=this._particleColorNode._iDataOffset;this._usesCycle&&animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode,animators.ParticleColorNode.CYCLE_INDEX),this._cycleData.x,this._cycleData.y,this._cycleData.z,this._cycleData.w),this._usesMultiplier&&(this._particleColorNode.mode==animators.ParticlePropertiesMode.LOCAL_STATIC?(animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode,animators.ParticleColorNode.START_MULTIPLIER_INDEX),dataOffset,stage,ContextGLVertexBufferFormat.FLOAT_4),dataOffset+=4,animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode,animators.ParticleColorNode.DELTA_MULTIPLIER_INDEX),dataOffset,stage,ContextGLVertexBufferFormat.FLOAT_4),dataOffset+=4):(animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode,animators.ParticleColorNode.START_MULTIPLIER_INDEX),this._startMultiplierData.x,this._startMultiplierData.y,this._startMultiplierData.z,this._startMultiplierData.w),animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode,animators.ParticleColorNode.DELTA_MULTIPLIER_INDEX),this._deltaMultiplierData.x,this._deltaMultiplierData.y,this._deltaMultiplierData.z,this._deltaMultiplierData.w))),this._usesOffset&&(this._particleColorNode.mode==animators.ParticlePropertiesMode.LOCAL_STATIC?(animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode,animators.ParticleColorNode.START_OFFSET_INDEX),dataOffset,stage,ContextGLVertexBufferFormat.FLOAT_4),dataOffset+=4,animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode,animators.ParticleColorNode.DELTA_OFFSET_INDEX),dataOffset,stage,ContextGLVertexBufferFormat.FLOAT_4),dataOffset+=4):(animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode,animators.ParticleColorNode.START_OFFSET_INDEX),this._startOffsetData.x,this._startOffsetData.y,this._startOffsetData.z,this._startOffsetData.w),animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode,animators.ParticleColorNode.DELTA_OFFSET_INDEX),this._deltaOffsetData.x,this._deltaOffsetData.y,this._deltaOffsetData.z,this._deltaOffsetData.w)))}},ParticleColorState.prototype.updateColorData=function(){if(this._usesCycle){if(this._cycleDuration<=0)throw new Error("the cycle duration must be greater than zero");this._cycleData=new Vector3D(2*Math.PI/this._cycleDuration,this._cyclePhase*Math.PI/180,0,0)}this._particleColorNode.mode==animators.ParticlePropertiesMode.GLOBAL&&(this._usesCycle?(this._usesMultiplier&&(this._startMultiplierData=new Vector3D((this._startColor.redMultiplier+this._endColor.redMultiplier)/2,(this._startColor.greenMultiplier+this._endColor.greenMultiplier)/2,(this._startColor.blueMultiplier+this._endColor.blueMultiplier)/2,(this._startColor.alphaMultiplier+this._endColor.alphaMultiplier)/2),this._deltaMultiplierData=new Vector3D((this._endColor.redMultiplier-this._startColor.redMultiplier)/2,(this._endColor.greenMultiplier-this._startColor.greenMultiplier)/2,(this._endColor.blueMultiplier-this._startColor.blueMultiplier)/2,(this._endColor.alphaMultiplier-this._startColor.alphaMultiplier)/2)),this._usesOffset&&(this._startOffsetData=new Vector3D((this._startColor.redOffset+this._endColor.redOffset)/510,(this._startColor.greenOffset+this._endColor.greenOffset)/510,(this._startColor.blueOffset+this._endColor.blueOffset)/510,(this._startColor.alphaOffset+this._endColor.alphaOffset)/510),this._deltaOffsetData=new Vector3D((this._endColor.redOffset-this._startColor.redOffset)/510,(this._endColor.greenOffset-this._startColor.greenOffset)/510,(this._endColor.blueOffset-this._startColor.blueOffset)/510,(this._endColor.alphaOffset-this._startColor.alphaOffset)/510))):(this._usesMultiplier&&(this._startMultiplierData=new Vector3D(this._startColor.redMultiplier,this._startColor.greenMultiplier,this._startColor.blueMultiplier,this._startColor.alphaMultiplier),this._deltaMultiplierData=new Vector3D(this._endColor.redMultiplier-this._startColor.redMultiplier,this._endColor.greenMultiplier-this._startColor.greenMultiplier,this._endColor.blueMultiplier-this._startColor.blueMultiplier,this._endColor.alphaMultiplier-this._startColor.alphaMultiplier)),this._usesOffset&&(this._startOffsetData=new Vector3D(this._startColor.redOffset/255,this._startColor.greenOffset/255,this._startColor.blueOffset/255,this._startColor.alphaOffset/255),this._deltaOffsetData=new Vector3D((this._endColor.redOffset-this._startColor.redOffset)/255,(this._endColor.greenOffset-this._startColor.greenOffset)/255,(this._endColor.blueOffset-this._startColor.blueOffset)/255,(this._endColor.alphaOffset-this._startColor.alphaOffset)/255))))},ParticleColorState}(animators.ParticleStateBase);animators.ParticleColorState=ParticleColorState}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var ContextGLVertexBufferFormat=away.stagegl.ContextGLVertexBufferFormat,Vector3D=away.geom.Vector3D,MathConsts=away.geom.MathConsts,ParticleFollowState=function(_super){function ParticleFollowState(animator,particleFollowNode){_super.call(this,animator,particleFollowNode,!0),this._targetPos=new Vector3D,this._targetEuler=new Vector3D,this._temp=new Vector3D,this._particleFollowNode=particleFollowNode,this._smooth=particleFollowNode._iSmooth}return __extends(ParticleFollowState,_super),Object.defineProperty(ParticleFollowState.prototype,"followTarget",{get:function(){return this._followTarget},set:function(value){this._followTarget=value},enumerable:!0,configurable:!0}),Object.defineProperty(ParticleFollowState.prototype,"smooth",{get:function(){return this._smooth},set:function(value){this._smooth=value},enumerable:!0,configurable:!0}),ParticleFollowState.prototype.setRenderState=function(stage,renderable,animationSubGeometry,animationRegisterCache){this._followTarget&&(this._particleFollowNode._iUsesPosition&&(this._targetPos.x=this._followTarget.transform.position.x/renderable.sourceEntity.scaleX,this._targetPos.y=this._followTarget.transform.position.y/renderable.sourceEntity.scaleY,this._targetPos.z=this._followTarget.transform.position.z/renderable.sourceEntity.scaleZ),this._particleFollowNode._iUsesRotation&&(this._targetEuler.x=this._followTarget.rotationX,this._targetEuler.y=this._followTarget.rotationY,this._targetEuler.z=this._followTarget.rotationZ,this._targetEuler.scaleBy(MathConsts.DEGREES_TO_RADIANS))),this._prePos||(this._prePos=this._targetPos.clone()),this._preEuler||(this._preEuler=this._targetEuler.clone());var currentTime=this._pTime/1e3,previousTime=animationSubGeometry.previousTime,deltaTime=currentTime-previousTime,needProcess=previousTime!=currentTime;this._particleFollowNode._iUsesPosition&&this._particleFollowNode._iUsesRotation?(needProcess&&this.processPositionAndRotation(currentTime,deltaTime,animationSubGeometry),animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode,animators.ParticleFollowNode.FOLLOW_POSITION_INDEX),this._particleFollowNode._iDataOffset,stage,ContextGLVertexBufferFormat.FLOAT_3),animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode,animators.ParticleFollowNode.FOLLOW_ROTATION_INDEX),this._particleFollowNode._iDataOffset+3,stage,ContextGLVertexBufferFormat.FLOAT_3)):this._particleFollowNode._iUsesPosition?(needProcess&&this.processPosition(currentTime,deltaTime,animationSubGeometry),animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode,animators.ParticleFollowNode.FOLLOW_POSITION_INDEX),this._particleFollowNode._iDataOffset,stage,ContextGLVertexBufferFormat.FLOAT_3)):this._particleFollowNode._iUsesRotation&&(needProcess&&this.precessRotation(currentTime,deltaTime,animationSubGeometry),animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode,animators.ParticleFollowNode.FOLLOW_ROTATION_INDEX),this._particleFollowNode._iDataOffset,stage,ContextGLVertexBufferFormat.FLOAT_3)),this._prePos.copyFrom(this._targetPos),this._targetEuler.copyFrom(this._targetEuler),animationSubGeometry.previousTime=currentTime},ParticleFollowState.prototype.processPosition=function(currentTime,deltaTime,animationSubGeometry){var interpolatedPos,posVelocity,data=animationSubGeometry.animationParticles,vertexData=animationSubGeometry.vertexData,changed=!1,len=data.length;this._smooth?(posVelocity=this._prePos.subtract(this._targetPos),posVelocity.scaleBy(1/deltaTime)):interpolatedPos=this._targetPos;for(var i=0;len>i;i++){var k=(currentTime-data[i].startTime)/data[i].totalTime,t=(k-Math.floor(k))*data[i].totalTime;if(0>=t-deltaTime){var inc=data[i].startVertexIndex*animationSubGeometry.totalLenOfOneVertex+this._particleFollowNode._iDataOffset;if(this._smooth&&(this._temp.copyFrom(posVelocity),this._temp.scaleBy(t),interpolatedPos=this._targetPos.add(this._temp)),vertexData[inc]!=interpolatedPos.x||vertexData[inc+1]!=interpolatedPos.y||vertexData[inc+2]!=interpolatedPos.z){changed=!0;for(var j=0;ji;i++){var k=(currentTime-data[i].startTime)/data[i].totalTime,t=(k-Math.floor(k))*data[i].totalTime;if(0>=t-deltaTime){var inc=data[i].startVertexIndex*animationSubGeometry.totalLenOfOneVertex+this._particleFollowNode._iDataOffset;if(this._smooth&&(this._temp.copyFrom(rotationVelocity),this._temp.scaleBy(t),interpolatedRotation=this._targetEuler.add(this._temp)),vertexData[inc]!=interpolatedRotation.x||vertexData[inc+1]!=interpolatedRotation.y||vertexData[inc+2]!=interpolatedRotation.z){changed=!0;for(var j=0;ji;i++){var k=(currentTime-data[i].startTime)/data[i].totalTime,t=(k-Math.floor(k))*data[i].totalTime;if(0>=t-deltaTime){var inc=data[i].startVertexIndex*animationSubGeometry.totalLenOfOneVertex+this._particleFollowNode._iDataOffset;if(this._smooth&&(this._temp.copyFrom(posVelocity),this._temp.scaleBy(t),interpolatedPos=this._targetPos.add(this._temp),this._temp.copyFrom(rotationVelocity),this._temp.scaleBy(t),interpolatedRotation=this._targetEuler.add(this._temp)),vertexData[inc]!=interpolatedPos.x||vertexData[inc+1]!=interpolatedPos.y||vertexData[inc+2]!=interpolatedPos.z||vertexData[inc+3]!=interpolatedRotation.x||vertexData[inc+4]!=interpolatedRotation.y||vertexData[inc+5]!=interpolatedRotation.z){changed=!0;for(var j=0;j0&&animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode,animators.ParticleSegmentedColorNode.TIME_DATA_INDEX),this._timeLifeData[0],this._timeLifeData[1],this._timeLifeData[2],this._timeLifeData[3]),this._usesMultiplier&&animationRegisterCache.setVertexConstFromArray(animationRegisterCache.getRegisterIndex(this._pAnimationNode,animators.ParticleSegmentedColorNode.START_MULTIPLIER_INDEX),this._multiplierData),this._usesOffset&&animationRegisterCache.setVertexConstFromArray(animationRegisterCache.getRegisterIndex(this._pAnimationNode,animators.ParticleSegmentedColorNode.START_OFFSET_INDEX),this._offsetData))},ParticleSegmentedColorState.prototype.updateColorData=function(){this._timeLifeData=new Array,this._multiplierData=new Array,this._offsetData=new Array;var i;for(i=0;ithis._pStartTime+this._animationClipNode.totalDuration?time=this._pStartTime+this._animationClipNode.totalDuration:timethis._pTime?1:-1,_super.prototype._pUpdateTime.call(this,time)},AnimationClipState.prototype._pUpdateFrames=function(){this._pFramesDirty=!1;var looping=this._animationClipNode.looping,totalDuration=this._animationClipNode.totalDuration,lastFrame=this._animationClipNode.lastFrame,time=this._pTime;if(looping&&(time>=totalDuration||0>time)&&(time%=totalDuration,0>time&&(time+=totalDuration)),!looping&&time>=totalDuration)this.notifyPlaybackComplete(),this._pCurrentFrame=lastFrame,this._pNextFrame=lastFrame,this._pBlendWeight=0;else if(!looping&&0>=time)this._pCurrentFrame=0,this._pNextFrame=0,this._pBlendWeight=0;else if(this._animationClipNode.fixedFrameRate){var t=time/totalDuration*lastFrame;this._pCurrentFrame=Math.floor(t),this._pBlendWeight=t-this._pCurrentFrame,this._pNextFrame=this._pCurrentFrame+1}else{this._pCurrentFrame=0,this._pNextFrame=0;var frameTime,dur=0,durations=this._animationClipNode.durations;do frameTime=dur,dur+=durations[this._pNextFrame],this._pCurrentFrame=this._pNextFrame++;while(time>dur);this._pCurrentFrame==lastFrame&&(this._pCurrentFrame=0,this._pNextFrame=1),this._pBlendWeight=(time-frameTime)/durations[this._pCurrentFrame]}},AnimationClipState.prototype.notifyPlaybackComplete=function(){null==this._animationStatePlaybackComplete&&(this._animationStatePlaybackComplete=new away.events.AnimationStateEvent(away.events.AnimationStateEvent.PLAYBACK_COMPLETE,this._pAnimator,this,this._animationClipNode)),this._animationClipNode.dispatchEvent(this._animationStatePlaybackComplete)},AnimationClipState}(animators.AnimationStateBase);animators.AnimationClipState=AnimationClipState}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var SkeletonBinaryLERPState=function(_super){function SkeletonBinaryLERPState(animator,skeletonAnimationNode){_super.call(this,animator,skeletonAnimationNode),this._blendWeight=0,this._skeletonPose=new animators.SkeletonPose,this._skeletonPoseDirty=!0,this._skeletonAnimationNode=skeletonAnimationNode,this._inputA=animator.getAnimationState(this._skeletonAnimationNode.inputA),this._inputB=animator.getAnimationState(this._skeletonAnimationNode.inputB)}return __extends(SkeletonBinaryLERPState,_super),Object.defineProperty(SkeletonBinaryLERPState.prototype,"blendWeight",{get:function(){return this._blendWeight},set:function(value){this._blendWeight=value,this._pPositionDeltaDirty=!0,this._skeletonPoseDirty=!0},enumerable:!0,configurable:!0}),SkeletonBinaryLERPState.prototype.phase=function(value){this._skeletonPoseDirty=!0,this._pPositionDeltaDirty=!0,this._inputA.phase(value),this._inputB.phase(value)},SkeletonBinaryLERPState.prototype._pUpdateTime=function(time){this._skeletonPoseDirty=!0,this._inputA.update(time),this._inputB.update(time),_super.prototype._pUpdateTime.call(this,time)},SkeletonBinaryLERPState.prototype.getSkeletonPose=function(skeleton){return this._skeletonPoseDirty&&this.updateSkeletonPose(skeleton),this._skeletonPose},SkeletonBinaryLERPState.prototype._pUpdatePositionDelta=function(){this._pPositionDeltaDirty=!1;var deltA=this._inputA.positionDelta,deltB=this._inputB.positionDelta;this._pRootDelta.x=deltA.x+this._blendWeight*(deltB.x-deltA.x),this._pRootDelta.y=deltA.y+this._blendWeight*(deltB.y-deltA.y),this._pRootDelta.z=deltA.z+this._blendWeight*(deltB.z-deltA.z)},SkeletonBinaryLERPState.prototype.updateSkeletonPose=function(skeleton){this._skeletonPoseDirty=!1;var endPose,pose1,pose2,p1,p2,tr,endPoses=this._skeletonPose.jointPoses,poses1=this._inputA.getSkeletonPose(skeleton).jointPoses,poses2=this._inputB.getSkeletonPose(skeleton).jointPoses,numJoints=skeleton.numJoints;endPoses.length!=numJoints&&(endPoses.length=numJoints);for(var i=0;numJoints>i;++i)endPose=endPoses[i],null==endPose&&(endPose=endPoses[i]=new animators.JointPose),pose1=poses1[i],pose2=poses2[i],p1=pose1.translation,p2=pose2.translation,endPose.orientation.lerp(pose1.orientation,pose2.orientation,this._blendWeight),tr=endPose.translation,tr.x=p1.x+this._blendWeight*(p2.x-p1.x),tr.y=p1.y+this._blendWeight*(p2.y-p1.y),tr.z=p1.z+this._blendWeight*(p2.z-p1.z)},SkeletonBinaryLERPState}(animators.AnimationStateBase);animators.SkeletonBinaryLERPState=SkeletonBinaryLERPState}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var Vector3D=away.geom.Vector3D,SkeletonClipState=function(_super){function SkeletonClipState(animator,skeletonClipNode){_super.call(this,animator,skeletonClipNode),this._rootPos=new Vector3D,this._skeletonPose=new animators.SkeletonPose,this._skeletonPoseDirty=!0,this._skeletonClipNode=skeletonClipNode,this._frames=this._skeletonClipNode.frames}return __extends(SkeletonClipState,_super),Object.defineProperty(SkeletonClipState.prototype,"currentPose",{get:function(){return this._pFramesDirty&&this._pUpdateFrames(),this._currentPose},enumerable:!0,configurable:!0}),Object.defineProperty(SkeletonClipState.prototype,"nextPose",{get:function(){return this._pFramesDirty&&this._pUpdateFrames(),this._nextPose},enumerable:!0,configurable:!0}),SkeletonClipState.prototype.getSkeletonPose=function(skeleton){return this._skeletonPoseDirty&&this.updateSkeletonPose(skeleton),this._skeletonPose},SkeletonClipState.prototype._pUpdateTime=function(time){this._skeletonPoseDirty=!0,_super.prototype._pUpdateTime.call(this,time)},SkeletonClipState.prototype._pUpdateFrames=function(){_super.prototype._pUpdateFrames.call(this),this._currentPose=this._frames[this._pCurrentFrame],this._skeletonClipNode.looping&&this._pNextFrame>=this._skeletonClipNode.lastFrame?(this._nextPose=this._frames[0],this._pAnimator.dispatchCycleEvent()):this._nextPose=this._frames[this._pNextFrame]},SkeletonClipState.prototype.updateSkeletonPose=function(skeleton){if(this._skeletonPoseDirty=!1,this._skeletonClipNode.totalDuration){this._pFramesDirty&&this._pUpdateFrames();var p1,p2,pose1,pose2,endPose,tr,currentPose=this._currentPose.jointPoses,nextPose=this._nextPose.jointPoses,numJoints=skeleton.numJoints,endPoses=this._skeletonPose.jointPoses;if(endPoses.length!=numJoints&&(endPoses.length=numJoints),numJoints!=currentPose.length||numJoints!=nextPose.length)throw new Error("joint counts don't match!");for(var i=0;numJoints>i;++i)endPose=endPoses[i],null==endPose&&(endPose=endPoses[i]=new animators.JointPose),pose1=currentPose[i],pose2=nextPose[i],p1=pose1.translation,p2=pose2.translation,this._skeletonClipNode.highQuality?endPose.orientation.slerp(pose1.orientation,pose2.orientation,this._pBlendWeight):endPose.orientation.lerp(pose1.orientation,pose2.orientation,this._pBlendWeight),i>0&&(tr=endPose.translation,tr.x=p1.x+this._pBlendWeight*(p2.x-p1.x),tr.y=p1.y+this._pBlendWeight*(p2.y-p1.y),tr.z=p1.z+this._pBlendWeight*(p2.z-p1.z))}},SkeletonClipState.prototype._pUpdatePositionDelta=function(){this._pPositionDeltaDirty=!1,this._pFramesDirty&&this._pUpdateFrames();var p1,p2,p3,totalDelta=this._skeletonClipNode.totalDelta;(this._pTimeDir>0&&this._pNextFramethis._pOldFrame)&&(this._rootPos.x-=totalDelta.x*this._pTimeDir,this._rootPos.y-=totalDelta.y*this._pTimeDir,this._rootPos.z-=totalDelta.z*this._pTimeDir);var dx=this._rootPos.x,dy=this._rootPos.y,dz=this._rootPos.z;this._skeletonClipNode.stitchFinalFrame&&this._pNextFrame==this._skeletonClipNode.lastFrame?(p1=this._frames[0].jointPoses[0].translation,p2=this._frames[1].jointPoses[0].translation,p3=this._currentPose.jointPoses[0].translation,this._rootPos.x=p3.x+p1.x+this._pBlendWeight*(p2.x-p1.x),this._rootPos.y=p3.y+p1.y+this._pBlendWeight*(p2.y-p1.y),this._rootPos.z=p3.z+p1.z+this._pBlendWeight*(p2.z-p1.z)):(p1=this._currentPose.jointPoses[0].translation,p2=this._frames[this._pNextFrame].jointPoses[0].translation,this._rootPos.x=p1.x+this._pBlendWeight*(p2.x-p1.x),this._rootPos.y=p1.y+this._pBlendWeight*(p2.y-p1.y),this._rootPos.z=p1.z+this._pBlendWeight*(p2.z-p1.z)),this._pRootDelta.x=this._rootPos.x-dx,this._pRootDelta.y=this._rootPos.y-dy,this._pRootDelta.z=this._rootPos.z-dz,this._pOldFrame=this._pNextFrame},SkeletonClipState}(animators.AnimationClipState);animators.SkeletonClipState=SkeletonClipState}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var Quaternion=away.geom.Quaternion,SkeletonDifferenceState=function(_super){function SkeletonDifferenceState(animator,skeletonAnimationNode){_super.call(this,animator,skeletonAnimationNode),this._blendWeight=0,this._skeletonPose=new animators.SkeletonPose,this._skeletonPoseDirty=!0,this._skeletonAnimationNode=skeletonAnimationNode,this._baseInput=animator.getAnimationState(this._skeletonAnimationNode.baseInput),this._differenceInput=animator.getAnimationState(this._skeletonAnimationNode.differenceInput)}return __extends(SkeletonDifferenceState,_super),Object.defineProperty(SkeletonDifferenceState.prototype,"blendWeight",{get:function(){return this._blendWeight},set:function(value){this._blendWeight=value,this._pPositionDeltaDirty=!0,this._skeletonPoseDirty=!0},enumerable:!0,configurable:!0}),SkeletonDifferenceState.prototype.phase=function(value){this._skeletonPoseDirty=!0,this._pPositionDeltaDirty=!0,this._baseInput.phase(value),this._baseInput.phase(value)},SkeletonDifferenceState.prototype._pUpdateTime=function(time){this._skeletonPoseDirty=!0,this._baseInput.update(time),this._differenceInput.update(time),_super.prototype._pUpdateTime.call(this,time)},SkeletonDifferenceState.prototype.getSkeletonPose=function(skeleton){return this._skeletonPoseDirty&&this.updateSkeletonPose(skeleton),this._skeletonPose},SkeletonDifferenceState.prototype._pUpdatePositionDelta=function(){this._pPositionDeltaDirty=!1;var deltA=this._baseInput.positionDelta,deltB=this._differenceInput.positionDelta;this.positionDelta.x=deltA.x+this._blendWeight*deltB.x,this.positionDelta.y=deltA.y+this._blendWeight*deltB.y,this.positionDelta.z=deltA.z+this._blendWeight*deltB.z},SkeletonDifferenceState.prototype.updateSkeletonPose=function(skeleton){this._skeletonPoseDirty=!1;var endPose,base,diff,basePos,diffPos,tr,endPoses=this._skeletonPose.jointPoses,basePoses=this._baseInput.getSkeletonPose(skeleton).jointPoses,diffPoses=this._differenceInput.getSkeletonPose(skeleton).jointPoses,numJoints=skeleton.numJoints;endPoses.length!=numJoints&&(endPoses.length=numJoints);for(var i=0;numJoints>i;++i)endPose=endPoses[i],null==endPose&&(endPose=endPoses[i]=new animators.JointPose),base=basePoses[i],diff=diffPoses[i],basePos=base.translation,diffPos=diff.translation,SkeletonDifferenceState._tempQuat.multiply(diff.orientation,base.orientation),endPose.orientation.lerp(base.orientation,SkeletonDifferenceState._tempQuat,this._blendWeight),tr=endPose.translation,tr.x=basePos.x+this._blendWeight*diffPos.x,tr.y=basePos.y+this._blendWeight*diffPos.y,tr.z=basePos.z+this._blendWeight*diffPos.z},SkeletonDifferenceState._tempQuat=new Quaternion,SkeletonDifferenceState}(animators.AnimationStateBase);animators.SkeletonDifferenceState=SkeletonDifferenceState}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var SkeletonDirectionalState=function(_super){function SkeletonDirectionalState(animator,skeletonAnimationNode){_super.call(this,animator,skeletonAnimationNode),this._skeletonPose=new animators.SkeletonPose,this._skeletonPoseDirty=!0,this._blendWeight=0,this._direction=0,this._blendDirty=!0,this._skeletonAnimationNode=skeletonAnimationNode,this._forward=animator.getAnimationState(this._skeletonAnimationNode.forward),this._backward=animator.getAnimationState(this._skeletonAnimationNode.backward),this._left=animator.getAnimationState(this._skeletonAnimationNode.left),this._right=animator.getAnimationState(this._skeletonAnimationNode.right)}return __extends(SkeletonDirectionalState,_super),Object.defineProperty(SkeletonDirectionalState.prototype,"direction",{get:function(){return this._direction},set:function(value){this._direction!=value&&(this._direction=value,this._blendDirty=!0,this._skeletonPoseDirty=!0,this._pPositionDeltaDirty=!0)},enumerable:!0,configurable:!0}),SkeletonDirectionalState.prototype.phase=function(value){this._blendDirty&&this.updateBlend(),this._skeletonPoseDirty=!0,this._pPositionDeltaDirty=!0,this._inputA.phase(value),this._inputB.phase(value)},SkeletonDirectionalState.prototype._pUdateTime=function(time){this._blendDirty&&this.updateBlend(),this._skeletonPoseDirty=!0,this._inputA.update(time),this._inputB.update(time),_super.prototype._pUpdateTime.call(this,time)},SkeletonDirectionalState.prototype.getSkeletonPose=function(skeleton){return this._skeletonPoseDirty&&this.updateSkeletonPose(skeleton),this._skeletonPose},SkeletonDirectionalState.prototype._pUpdatePositionDelta=function(){this._pPositionDeltaDirty=!1,this._blendDirty&&this.updateBlend();var deltA=this._inputA.positionDelta,deltB=this._inputB.positionDelta;this.positionDelta.x=deltA.x+this._blendWeight*(deltB.x-deltA.x),this.positionDelta.y=deltA.y+this._blendWeight*(deltB.y-deltA.y),this.positionDelta.z=deltA.z+this._blendWeight*(deltB.z-deltA.z)},SkeletonDirectionalState.prototype.updateSkeletonPose=function(skeleton){this._skeletonPoseDirty=!1,this._blendDirty&&this.updateBlend();var endPose,pose1,pose2,p1,p2,tr,endPoses=this._skeletonPose.jointPoses,poses1=this._inputA.getSkeletonPose(skeleton).jointPoses,poses2=this._inputB.getSkeletonPose(skeleton).jointPoses,numJoints=skeleton.numJoints;endPoses.length!=numJoints&&(endPoses.length=numJoints);for(var i=0;numJoints>i;++i)endPose=endPoses[i],null==endPose&&(endPose=endPoses[i]=new animators.JointPose),pose1=poses1[i],pose2=poses2[i],p1=pose1.translation,p2=pose2.translation,endPose.orientation.lerp(pose1.orientation,pose2.orientation,this._blendWeight),tr=endPose.translation,tr.x=p1.x+this._blendWeight*(p2.x-p1.x),tr.y=p1.y+this._blendWeight*(p2.y-p1.y),tr.z=p1.z+this._blendWeight*(p2.z-p1.z)},SkeletonDirectionalState.prototype.updateBlend=function(){this._blendDirty=!1,(this._direction<0||this._direction>360)&&(this._direction%=360,this._direction<0&&(this._direction+=360)),this._direction<90?(this._inputA=this._forward,this._inputB=this._right,this._blendWeight=this._direction/90):this._direction<180?(this._inputA=this._right,this._inputB=this._backward,this._blendWeight=(this._direction-90)/90):this._direction<270?(this._inputA=this._backward,this._inputB=this._left,this._blendWeight=(this._direction-180)/90):(this._inputA=this._left,this._inputB=this._forward,this._blendWeight=(this._direction-270)/90)},SkeletonDirectionalState}(animators.AnimationStateBase);animators.SkeletonDirectionalState=SkeletonDirectionalState}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var SkeletonNaryLERPState=function(_super){function SkeletonNaryLERPState(animator,skeletonAnimationNode){_super.call(this,animator,skeletonAnimationNode),this._skeletonPose=new animators.SkeletonPose,this._skeletonPoseDirty=!0,this._blendWeights=new Array,this._inputs=new Array,this._skeletonAnimationNode=skeletonAnimationNode;for(var i=this._skeletonAnimationNode.numInputs;i--;)this._inputs[i]=animator.getAnimationState(this._skeletonAnimationNode._iInputs[i])}return __extends(SkeletonNaryLERPState,_super),SkeletonNaryLERPState.prototype.phase=function(value){this._skeletonPoseDirty=!0,this._pPositionDeltaDirty=!0;for(var j=0;jx0*x1+y0*y1+z0*z1+w0*w1&&(x1=-x1,y1=-y1,z1=-z1,w1=-w1),endQuat=endPose.orientation,endQuat.x+=weight*x1,endQuat.y+=weight*y1,endQuat.z+=weight*z1,endQuat.w+=weight*w1,endTr=endPose.translation,endTr.x+=weight*tr.x,endTr.y+=weight*tr.y,endTr.z+=weight*tr.z;else for(firstPose=poses,i=0;numJoints>i;++i)endPose=endPoses[i],null==endPose&&(endPose=endPoses[i]=new animators.JointPose),pose=poses[i],q=pose.orientation,tr=pose.translation,endQuat=endPose.orientation,endQuat.x=weight*q.x,endQuat.y=weight*q.y,endQuat.z=weight*q.z,endQuat.w=weight*q.w,endTr=endPose.translation,endTr.x=weight*tr.x,endTr.y=weight*tr.y,endTr.z=weight*tr.z;for(i=0;i=this._vertexClipNode.lastFrame?(this._nextGeometry=this._frames[0],this._pAnimator.dispatchCycleEvent()):this._nextGeometry=this._frames[this._pNextFrame]},VertexClipState.prototype._pUpdatePositionDelta=function(){},VertexClipState}(animators.AnimationClipState);animators.VertexClipState=VertexClipState}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var CrossfadeTransition=function(){function CrossfadeTransition(blendSpeed){this.blendSpeed=.5,this.blendSpeed=blendSpeed}return CrossfadeTransition.prototype.getAnimationNode=function(animator,startNode,endNode,startBlend){var crossFadeTransitionNode=new animators.CrossfadeTransitionNode;return crossFadeTransitionNode.inputA=startNode,crossFadeTransitionNode.inputB=endNode,crossFadeTransitionNode.blendSpeed=this.blendSpeed,crossFadeTransitionNode.startBlend=startBlend,crossFadeTransitionNode},CrossfadeTransition}();animators.CrossfadeTransition=CrossfadeTransition}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var CrossfadeTransitionNode=function(_super){function CrossfadeTransitionNode(){_super.call(this),this._pStateClass=animators.CrossfadeTransitionState}return __extends(CrossfadeTransitionNode,_super),CrossfadeTransitionNode}(animators.SkeletonBinaryLERPNode);animators.CrossfadeTransitionNode=CrossfadeTransitionNode}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var AnimationStateEvent=away.events.AnimationStateEvent,CrossfadeTransitionState=function(_super){function CrossfadeTransitionState(animator,skeletonAnimationNode){_super.call(this,animator,skeletonAnimationNode),this._crossfadeTransitionNode=skeletonAnimationNode}return __extends(CrossfadeTransitionState,_super),CrossfadeTransitionState.prototype._pUpdateTime=function(time){this.blendWeight=Math.abs(time-this._crossfadeTransitionNode.startBlend)/(1e3*this._crossfadeTransitionNode.blendSpeed),this.blendWeight>=1&&(this.blendWeight=1,null==this._animationStateTransitionComplete&&(this._animationStateTransitionComplete=new AnimationStateEvent(AnimationStateEvent.TRANSITION_COMPLETE,this._pAnimator,this,this._crossfadeTransitionNode)),this._crossfadeTransitionNode.dispatchEvent(this._animationStateTransitionComplete)),_super.prototype._pUpdateTime.call(this,time)},CrossfadeTransitionState}(animators.SkeletonBinaryLERPState);animators.CrossfadeTransitionState=CrossfadeTransitionState}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var ParticleAnimationSet=function(_super){function ParticleAnimationSet(usesDuration,usesLooping,usesDelay){"undefined"==typeof usesDuration&&(usesDuration=!1),"undefined"==typeof usesLooping&&(usesLooping=!1),"undefined"==typeof usesDelay&&(usesDelay=!1),_super.call(this),this._animationSubGeometries=new Object,this._particleNodes=new Array,this._localDynamicNodes=new Array,this._localStaticNodes=new Array,this._totalLenOfOneVertex=0,this.addAnimation(this._timeNode=new animators.ParticleTimeNode(usesDuration,usesLooping,usesDelay))}return __extends(ParticleAnimationSet,_super),Object.defineProperty(ParticleAnimationSet.prototype,"particleNodes",{get:function(){return this._particleNodes},enumerable:!0,configurable:!0}),ParticleAnimationSet.prototype.addAnimation=function(node){var i,n=node;for(n._iProcessAnimationSetting(this),n.mode==animators.ParticlePropertiesMode.LOCAL_STATIC?(n._iDataOffset=this._totalLenOfOneVertex,this._totalLenOfOneVertex+=n.dataLength,this._localStaticNodes.push(n)):n.mode==animators.ParticlePropertiesMode.LOCAL_DYNAMIC&&this._localDynamicNodes.push(n),i=this._particleNodes.length-1;i>=0&&!(this._particleNodes[i].priority<=n.priority);i--);this._particleNodes.splice(i+1,0,n),_super.prototype.addAnimation.call(this,node)},ParticleAnimationSet.prototype.activate=function(){},ParticleAnimationSet.prototype.deactivate=function(){},ParticleAnimationSet.prototype.getAGALVertexCode=function(shaderObject){this._iAnimationRegisterCache=shaderObject.animationRegisterCache,null==this._iAnimationRegisterCache&&(this._iAnimationRegisterCache=shaderObject.animationRegisterCache=new animators.AnimationRegisterCache(shaderObject.profile)),this._iAnimationRegisterCache.vertexConstantOffset=shaderObject.numUsedVertexConstants,this._iAnimationRegisterCache.vertexAttributesOffset=shaderObject.numUsedStreams,this._iAnimationRegisterCache.varyingsOffset=shaderObject.numUsedVaryings,this._iAnimationRegisterCache.fragmentConstantOffset=shaderObject.numUsedFragmentConstants,this._iAnimationRegisterCache.hasUVNode=this.hasUVNode,this._iAnimationRegisterCache.needVelocity=this.needVelocity,this._iAnimationRegisterCache.hasBillboard=this.hasBillboard,this._iAnimationRegisterCache.sourceRegisters=shaderObject.animatableAttributes,this._iAnimationRegisterCache.targetRegisters=shaderObject.animationTargetRegisters,this._iAnimationRegisterCache.needFragmentAnimation=shaderObject.usesFragmentAnimation,this._iAnimationRegisterCache.needUVAnimation=!shaderObject.usesUVTransform,this._iAnimationRegisterCache.hasColorAddNode=this.hasColorAddNode,this._iAnimationRegisterCache.hasColorMulNode=this.hasColorMulNode,this._iAnimationRegisterCache.reset();var code="";code+=this._iAnimationRegisterCache.getInitCode();var node,i;for(i=0;i=ParticleAnimationSet.POST_PRIORITY&&node.priority=ParticleAnimationSet.COLOR_PRIORITY&&(code+=node.getAGALVertexCode(shaderObject,this._iAnimationRegisterCache));return code+=this._iAnimationRegisterCache.getColorPassCode()},ParticleAnimationSet.prototype.getAGALUVCode=function(shaderObject){var code="";if(this.hasUVNode){this._iAnimationRegisterCache.setUVSourceAndTarget(shaderObject.uvSource,shaderObject.uvTarget),code+="mov "+this._iAnimationRegisterCache.uvTarget+".xy,"+this._iAnimationRegisterCache.uvAttribute.toString()+"\n";for(var node,i=0;ii;){for(particleProperties.index=i,this.initParticleFunc.call(this.initParticleScope,particleProperties),k=0;kj&&(particle=particles[j]).particleIndex==i;){for(k=0;kcounterForVertex;counterForVertex+=this._totalLenOfOneVertex)for(vertexOffset=oneDataOffset+counterForVertex,counterForOneData=0;oneDataLen>counterForOneData;counterForOneData++)vertexData[vertexOffset+counterForOneData]=oneData[counterForOneData];this._localDynamicNodes.length&&animationSubGeometry.animationParticles.push(new animators.ParticleAnimationData(i,particleProperties.startTime,particleProperties.duration,particleProperties.delay,particle)),animationSubGeometry.numProcessedVertices+=numVertices,j++}i++}}},ParticleAnimationSet.POST_PRIORITY=9,ParticleAnimationSet.COLOR_PRIORITY=18,ParticleAnimationSet}(animators.AnimationSetBase);animators.ParticleAnimationSet=ParticleAnimationSet}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var ContextGLProgramType=away.stagegl.ContextGLProgramType,ParticleAnimator=function(_super){function ParticleAnimator(particleAnimationSet){_super.call(this,particleAnimationSet),this._animationParticleStates=new Array,this._animatorParticleStates=new Array,this._timeParticleStates=new Array,this._totalLenOfOneVertex=0,this._animatorSubGeometries=new Object,this._particleAnimationSet=particleAnimationSet;for(var state,node,i=0;i0&&stage.context.setProgramConstantsFromArray(ContextGLProgramType.FRAGMENT,animationRegisterCache.fragmentConstantOffset,animationRegisterCache.fragmentConstantData,animationRegisterCache.numFragmentConstant)},ParticleAnimator.prototype.testGPUCompatibility=function(){},ParticleAnimator.prototype.start=function(){_super.prototype.start.call(this);for(var i=0;i4||shaderObject.numUsedVertexConstants+3*this._numJoints>128)&&this._pAnimationSet.cancelGPUCompatibility()},SkeletonAnimator.prototype._pUpdateDeltaTime=function(dt){if(_super.prototype._pUpdateDeltaTime.call(this,dt),this._globalPropertiesDirty=!0,this._pAnimationSet.usesCPU)for(var key in this._morphedSubGeometryDirty)this._morphedSubGeometryDirty[key]=!0},SkeletonAnimator.prototype.updateCondensedMatrices=function(condensedIndexLookUp,numJoints){var len,srcIndex,i=0,j=0;this._condensedMatrices=new Array;do for(srcIndex=4*condensedIndexLookUp[i],len=srcIndex+12;len>srcIndex;)this._condensedMatrices[j++]=this._globalMatrices[srcIndex++];while(++iindex;){for(vertX=sourcePositions[index],vertY=sourcePositions[index+1],vertZ=sourcePositions[index+2],normX=sourceNormals[index],normY=sourceNormals[index+1],normZ=sourceNormals[index+2],tangX=sourceTangents[index],tangY=sourceTangents[index+1],tangZ=sourceTangents[index+2],vx=0,vy=0,vz=0,nx=0,ny=0,nz=0,tx=0,ty=0,tz=0,k=0;k0){var mtxOffset=jointIndices[j++]<<2;m11=this._globalMatrices[mtxOffset],m12=this._globalMatrices[mtxOffset+1],m13=this._globalMatrices[mtxOffset+2],m14=this._globalMatrices[mtxOffset+3],m21=this._globalMatrices[mtxOffset+4],m22=this._globalMatrices[mtxOffset+5],m23=this._globalMatrices[mtxOffset+6],m24=this._globalMatrices[mtxOffset+7],m31=this._globalMatrices[mtxOffset+8],m32=this._globalMatrices[mtxOffset+9],m33=this._globalMatrices[mtxOffset+10],m34=this._globalMatrices[mtxOffset+11],vx+=weight*(m11*vertX+m12*vertY+m13*vertZ+m14),vy+=weight*(m21*vertX+m22*vertY+m23*vertZ+m24),vz+=weight*(m31*vertX+m32*vertY+m33*vertZ+m34),nx+=weight*(m11*normX+m12*normY+m13*normZ),ny+=weight*(m21*normX+m22*normY+m23*normZ),nz+=weight*(m31*normX+m32*normY+m33*normZ),tx+=weight*(m11*tangX+m12*tangY+m13*tangZ),ty+=weight*(m21*tangX+m22*tangY+m23*tangZ),tz+=weight*(m31*tangX+m32*tangY+m33*tangZ),++k}else j+=this._jointsPerVertex-k,k=this._jointsPerVertex;targetPositions[index]=vx,targetPositions[index+1]=vy,targetPositions[index+2]=vz,targetNormals[index]=nx,targetNormals[index+1]=ny,targetNormals[index+2]=nz,targetTangents[index]=tx,targetTangents[index+1]=ty,targetTangents[index+2]=tz,index+=3}targetSubGeometry.updatePositions(targetPositions),targetSubGeometry.updateVertexNormals(targetNormals),targetSubGeometry.updateVertexTangents(targetTangents)},SkeletonAnimator.prototype.localToGlobalPose=function(sourcePose,targetPose,skeleton){var globalJointPose,parentIndex,joint,parentPose,pose,or,tr,t,q,x1,y1,z1,w1,x2,y2,z2,w2,x3,y3,z3,globalPoses=targetPose.jointPoses,joints=skeleton.joints,len=sourcePose.numJointPoses,jointPoses=sourcePose.jointPoses;globalPoses.length!=len&&(globalPoses.length=len);for(var i=0;len>i;++i)globalJointPose=globalPoses[i],null==globalJointPose&&(globalJointPose=globalPoses[i]=new animators.JointPose),joint=joints[i],parentIndex=joint.parentIndex,pose=jointPoses[i],q=globalJointPose.orientation,t=globalJointPose.translation,0>parentIndex?(tr=pose.translation,or=pose.orientation,q.x=or.x,q.y=or.y,q.z=or.z,q.w=or.w,t.x=tr.x,t.y=tr.y,t.z=tr.z):(parentPose=globalPoses[parentIndex],or=parentPose.orientation,tr=pose.translation,x2=or.x,y2=or.y,z2=or.z,w2=or.w,x3=tr.x,y3=tr.y,z3=tr.z,w1=-x2*x3-y2*y3-z2*z3,x1=w2*x3+y2*z3-z2*y3,y1=w2*y3-x2*z3+z2*x3,z1=w2*z3+x2*y3-y2*x3,tr=parentPose.translation,t.x=-w1*x2+x1*w2-y1*z2+z1*y2+tr.x,t.y=-w1*y2+x1*z2+y1*w2-z1*x2+tr.y,t.z=-w1*z2-x1*y2+y1*x2+z1*w2+tr.z,x1=or.x,y1=or.y,z1=or.z,w1=or.w,or=pose.orientation,x2=or.x,y2=or.y,z2=or.z,w2=or.w,q.w=w1*w2-x1*x2-y1*y2-z1*z2,q.x=w1*x2+x1*w2+y1*z2-z1*y2,q.y=w1*y2-x1*z2+y1*w2+z1*x2,q.z=w1*z2+x1*y2-y1*x2+z1*w2)},SkeletonAnimator.prototype.onTransitionComplete=function(event){event.type==AnimationStateEvent.TRANSITION_COMPLETE&&(event.animationNode.removeEventListener(AnimationStateEvent.TRANSITION_COMPLETE,this._onTransitionCompleteDelegate),this._pActiveState==event.animationState&&(this._pActiveNode=this._pAnimationSet.getAnimation(this._pActiveAnimationName),this._pActiveState=this.getAnimationState(this._pActiveNode),this._activeSkeletonState=this._pActiveState))},SkeletonAnimator.prototype.onIndicesUpdate=function(event){var subGeometry=event.target;this._morphedSubGeometry[subGeometry.id].updateIndices(subGeometry.indices)},SkeletonAnimator.prototype.onVerticesUpdate=function(event){var subGeometry=event.target,morphGeometry=this._morphedSubGeometry[subGeometry.id];switch(event.dataType){case TriangleSubGeometry.UV_DATA:morphGeometry.updateUVs(subGeometry.uvs);case TriangleSubGeometry.SECONDARY_UV_DATA:morphGeometry.updateUVs(subGeometry.secondaryUVs)}},SkeletonAnimator}(animators.AnimatorBase);animators.SkeletonAnimator=SkeletonAnimator}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var SkeletonAnimationSet=function(_super){function SkeletonAnimationSet(jointsPerVertex){"undefined"==typeof jointsPerVertex&&(jointsPerVertex=4),_super.call(this),this._jointsPerVertex=jointsPerVertex}return __extends(SkeletonAnimationSet,_super),Object.defineProperty(SkeletonAnimationSet.prototype,"jointsPerVertex",{get:function(){return this._jointsPerVertex},enumerable:!0,configurable:!0}),SkeletonAnimationSet.prototype.getAGALVertexCode=function(shaderObject){for(var len=shaderObject.animatableAttributes.length,indexOffset0=shaderObject.numUsedVertexConstants,indexOffset1=indexOffset0+1,indexOffset2=indexOffset0+2,indexStream="va"+shaderObject.numUsedStreams,weightStream="va"+(shaderObject.numUsedStreams+1),indices=[indexStream+".x",indexStream+".y",indexStream+".z",indexStream+".w"],weights=[weightStream+".x",weightStream+".y",weightStream+".z",weightStream+".w"],temp1=this._pFindTempReg(shaderObject.animationTargetRegisters),temp2=this._pFindTempReg(shaderObject.animationTargetRegisters,temp1),dot="dp4",code="",i=0;len>i;++i){for(var src=shaderObject.animatableAttributes[i],j=0;j2&&(len=2);for(var streamIndex=shaderObject.numUsedStreams,i=0;len>i;++i){code+="mul "+temp1+", "+shaderObject.animatableAttributes[i]+", "+constantReg+"."+regs[0]+"\n";for(var j=1;j0||shaderObject.outputsNormals)&&(code+="dp3 "+temp1+".x, "+shaderObject.animatableAttributes[2]+", "+shaderObject.animationTargetRegisters[1]+"\n"+"mul "+temp1+", "+shaderObject.animationTargetRegisters[1]+", "+temp1+".x\n"+"sub "+shaderObject.animationTargetRegisters[2]+", "+shaderObject.animationTargetRegisters[2]+", "+temp1+"\n"),code},VertexAnimationSet.prototype.getAdditiveAGALCode=function(shaderObject){var k,code="",len=shaderObject.animatableAttributes.length,regs=["x","y","z","w"],temp1=this._pFindTempReg(shaderObject.animationTargetRegisters),streamIndex=shaderObject.numUsedStreams;len>2&&(len=2),code+="mov "+shaderObject.animationTargetRegisters[0]+", "+shaderObject.animatableAttributes[0]+"\n",shaderObject.normalDependencies>0&&(code+="mov "+shaderObject.animationTargetRegisters[1]+", "+shaderObject.animatableAttributes[1]+"\n");for(var i=0;len>i;++i)for(var j=0;j0||shaderObject.outputsNormals)&&(code+="dp3 "+temp1+".x, "+shaderObject.animatableAttributes[2]+", "+shaderObject.animationTargetRegisters[1]+"\n"+"mul "+temp1+", "+shaderObject.animationTargetRegisters[1]+", "+temp1+".x\n"+"sub "+shaderObject.animationTargetRegisters[2]+", "+shaderObject.animatableAttributes[2]+", "+temp1+"\n"),code},VertexAnimationSet}(animators.AnimationSetBase);animators.VertexAnimationSet=VertexAnimationSet}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(animators){var TriangleSubGeometry=away.base.TriangleSubGeometry,VertexDataPool=away.pool.VertexDataPool,VertexAnimator=function(_super){function VertexAnimator(vertexAnimationSet){_super.call(this,vertexAnimationSet),this._poses=new Array,this._weights=Array(1,0,0,0),this._vertexAnimationSet=vertexAnimationSet,this._numPoses=vertexAnimationSet.numPoses,this._blendMode=vertexAnimationSet.blendMode}return __extends(VertexAnimator,_super),VertexAnimator.prototype.clone=function(){return new VertexAnimator(this._vertexAnimationSet)},VertexAnimator.prototype.play=function(name,transition,offset){if("undefined"==typeof transition&&(transition=null),"undefined"==typeof offset&&(offset=0/0),this._pActiveAnimationName!=name){if(this._pActiveAnimationName=name,!this._pAnimationSet.hasAnimation(name))throw new Error("Animation root node "+name+" not found!");this._pActiveNode=this._pAnimationSet.getAnimation(name),this._pActiveState=this.getAnimationState(this._pActiveNode),this.updatePosition&&(this._pActiveState.update(this._pAbsoluteTime),this._pActiveState.positionDelta),this._activeVertexState=this._pActiveState,this.start(),isNaN(offset)||this.reset(name,offset)}},VertexAnimator.prototype._pUpdateDeltaTime=function(dt){_super.prototype._pUpdateDeltaTime.call(this,dt);var geometryFlag=!1;if(this._poses[0]!=this._activeVertexState.currentGeometry&&(this._poses[0]=this._activeVertexState.currentGeometry,geometryFlag=!0),this._poses[1]!=this._activeVertexState.nextGeometry&&(this._poses[1]=this._activeVertexState.nextGeometry,geometryFlag=!0),this._weights[0]=1-(this._weights[1]=this._activeVertexState.blendWeight),geometryFlag)for(var mesh,len=this._pOwners.length,i=0;len>i;i++)mesh=this._pOwners[i],mesh._iInvalidateRenderableGeometries()},VertexAnimator.prototype.setRenderState=function(shaderObject,renderable,stage,camera,vertexConstantOffset,vertexStreamOffset){if(!this._poses.length)return this.setNullPose(shaderObject,renderable,stage,vertexConstantOffset,vertexStreamOffset),void 0;var subGeom,i,subMesh=renderable.subMesh,len=this._numPoses;for(stage.context.setProgramConstantsFromArray(away.stagegl.ContextGLProgramType.VERTEX,vertexConstantOffset,this._weights,1),i=this._blendMode==animators.VertexAnimationMode.ABSOLUTE?1:0;len>i;++i)subGeom=this._poses[i].subGeometries[subMesh._iIndex]||subMesh.subGeometry,stage.context.activateBuffer(vertexStreamOffset++,VertexDataPool.getItem(subGeom,renderable.getIndexData(),TriangleSubGeometry.POSITION_DATA),subGeom.getOffset(TriangleSubGeometry.POSITION_DATA),TriangleSubGeometry.POSITION_FORMAT),shaderObject.normalDependencies>0&&stage.context.activateBuffer(vertexStreamOffset++,VertexDataPool.getItem(subGeom,renderable.getIndexData(),TriangleSubGeometry.NORMAL_DATA),subGeom.getOffset(TriangleSubGeometry.NORMAL_DATA),TriangleSubGeometry.NORMAL_FORMAT)},VertexAnimator.prototype.setNullPose=function(shaderObject,renderable,stage,vertexConstantOffset,vertexStreamOffset){if(stage.context.setProgramConstantsFromArray(away.stagegl.ContextGLProgramType.VERTEX,vertexConstantOffset,this._weights,1),this._blendMode==animators.VertexAnimationMode.ABSOLUTE)for(var len=this._numPoses,i=1;len>i;++i)stage.context.activateBuffer(vertexStreamOffset++,renderable.getVertexData(TriangleSubGeometry.POSITION_DATA),renderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA),TriangleSubGeometry.POSITION_FORMAT),shaderObject.normalDependencies>0&&stage.context.activateBuffer(vertexStreamOffset++,renderable.getVertexData(TriangleSubGeometry.NORMAL_DATA),renderable.getVertexOffset(TriangleSubGeometry.NORMAL_DATA),TriangleSubGeometry.NORMAL_FORMAT)},VertexAnimator.prototype.testGPUCompatibility=function(){},VertexAnimator.prototype.getRenderableSubGeometry=function(renderable,sourceSubGeometry){return this._blendMode==animators.VertexAnimationMode.ABSOLUTE&&this._poses.length?this._poses[0].subGeometries[renderable.subMesh._iIndex]||sourceSubGeometry:sourceSubGeometry},VertexAnimator}(animators.AnimatorBase);animators.VertexAnimator=VertexAnimator}(away.animators||(away.animators={})),away.animators}(away||(away={}));var away;!function(away){!function(parsers){var TriangleSubGeometry=away.base.TriangleSubGeometry,Mesh=away.entities.Mesh,DefaultMaterialManager=away.materials.DefaultMaterialManager,BasicSpecularMethod=away.materials.SpecularBasicMethod,TriangleMethodMaterial=away.materials.TriangleMethodMaterial,TriangleMaterialMode=away.materials.TriangleMaterialMode,URLLoaderDataFormat=away.net.URLLoaderDataFormat,OBJParser=function(_super){function OBJParser(scale){"undefined"==typeof scale&&(scale=1),_super.call(this,URLLoaderDataFormat.TEXT),this._mtlLibLoaded=!0,this._activeMaterialID="",this._scale=scale}return __extends(OBJParser,_super),Object.defineProperty(OBJParser.prototype,"scale",{set:function(value){this._scale=value},enumerable:!0,configurable:!0}),OBJParser.supportsType=function(extension){return extension=extension.toLowerCase(),"obj"==extension},OBJParser.supportsData=function(data){var content=parsers.ParserUtils.toString(data),hasV=!1,hasF=!1;return content&&(hasV=-1!=content.indexOf("\nv "),hasF=-1!=content.indexOf("\nf ")),hasV&&hasF},OBJParser.prototype._iResolveDependency=function(resourceDependency){if("mtl"==resourceDependency.id){var str=parsers.ParserUtils.toString(resourceDependency.data);this.parseMtl(str)}else{var asset;if(1!=resourceDependency.assets.length)return;if(asset=resourceDependency.assets[0],asset.assetType==away.library.AssetType.TEXTURE){var lm=new LoadedMaterial;lm.materialID=resourceDependency.id,lm.texture=asset,this._materialLoaded.push(lm),this._meshes.length>0&&this.applyMaterial(lm)}}},OBJParser.prototype._iResolveDependencyFailure=function(resourceDependency){if("mtl"==resourceDependency.id)this._mtlLib=!1,this._mtlLibLoaded=!1;else{var lm=new LoadedMaterial;lm.materialID=resourceDependency.id,this._materialLoaded.push(lm)}this._meshes.length>0&&this.applyMaterial(lm)},OBJParser.prototype._pProceedParsing=function(){var line,trunk,creturn=String.fromCharCode(10);for(this._startedParsing||(this._textData=this._pGetTextData(),this._textData=this._textData.replace(/\\[\r\n]+\s*/gm," ")),-1==this._textData.indexOf(creturn)&&(creturn=String.fromCharCode(13)),this._startedParsing||(this._startedParsing=!0,this._vertices=new Array,this._vertexNormals=new Array,this._materialIDs=new Array,this._materialLoaded=new Array,this._meshes=new Array,this._uvs=new Array,this._stringLength=this._textData.length,this._charIndex=this._textData.indexOf(creturn,0),this._oldIndex=0,this._objects=new Array,this._objectIndex=0);this._charIndex=this._stringLength?this._mtlLib&&!this._mtlLibLoaded?parsers.ParserBase.MORE_TO_PARSE:(this.translate(),this.applyMaterials(),parsers.ParserBase.PARSING_DONE):parsers.ParserBase.MORE_TO_PARSE},OBJParser.prototype._pStartParsing=function(frameLimit){_super.prototype._pStartParsing.call(this,frameLimit),this._pContent=new away.containers.DisplayObjectContainer},OBJParser.prototype.parseLine=function(trunk){switch(trunk[0]){case"mtllib":this._mtlLib=!0,this._mtlLibLoaded=!1,this.loadMtl(trunk[1]);break;case"g":this.createGroup(trunk);break;case"o":this.createObject(trunk);break;case"usemtl":this._mtlLib&&(trunk[1]||(trunk[1]="def000"),this._materialIDs.push(trunk[1]),this._activeMaterialID=trunk[1],this._currentGroup&&(this._currentGroup.materialID=this._activeMaterialID));break;case"v":this.parseVertex(trunk); -break;case"vt":this.parseUV(trunk);break;case"vn":this.parseVertexNormal(trunk);break;case"f":this.parseFace(trunk)}},OBJParser.prototype.translate=function(){for(var objIndex=0;objIndexg;++g){for(geometry=new away.base.Geometry,materialGroups=groups[g].materialGroups,numMaterialGroups=materialGroups.length,m=0;numMaterialGroups>m;++m)this.translateMaterialGroup(materialGroups[m],geometry);if(0!=geometry.subGeometries.length){if(this._pFinalizeAsset(geometry),bmMaterial=new TriangleMethodMaterial(DefaultMaterialManager.getDefaultTexture()),this.materialMode>=2&&(bmMaterial.materialMode=TriangleMaterialMode.MULTI_PASS),mesh=new Mesh(geometry,bmMaterial),mesh.name=this._objects[objIndex].name?this._objects[objIndex].name:groups[g].name?groups[g].name:"",this._meshes.push(mesh),bmMaterial.name=""!=groups[g].materialID?groups[g].materialID+"~"+mesh.name:this._lastMtlID+"~"+mesh.name,mesh.subMeshes.length>1)for(sm=1;smi;++i)for(face=faces[i],numVerts=face.indexIds.length-1,j=1;numVerts>j;++j)this.translateVertexData(face,j,vertices,uvs,indices,normals),this.translateVertexData(face,0,vertices,uvs,indices,normals),this.translateVertexData(face,j+1,vertices,uvs,indices,normals);vertices.length>0&&(sub=new TriangleSubGeometry(!0),sub.autoDeriveNormals=normals.length?!1:!0,sub.updateIndices(indices),sub.updatePositions(vertices),sub.updateVertexNormals(normals),sub.updateUVs(uvs),geometry.addSubGeometry(sub))},OBJParser.prototype.translateVertexData=function(face,vertexIndex,vertices,uvs,indices,normals){var index,vertex,vertexNormal,uv;if(this._realIndices[face.indexIds[vertexIndex]])index=this._realIndices[face.indexIds[vertexIndex]]-1;else if(index=this._vertexIndex,this._realIndices[face.indexIds[vertexIndex]]=++this._vertexIndex,vertex=this._vertices[face.vertexIndices[vertexIndex]-1],vertices.push(vertex.x*this._scale,vertex.y*this._scale,vertex.z*this._scale),face.normalIndices.length>0&&(vertexNormal=this._vertexNormals[face.normalIndices[vertexIndex]-1],normals.push(vertexNormal.x,vertexNormal.y,vertexNormal.z)),face.uvIndices.length>0)try{uv=this._uvs[face.uvIndices[vertexIndex]-1],uvs.push(uv.u,uv.v)}catch(e){switch(vertexIndex){case 0:uvs.push(0,1);break;case 1:uvs.push(.5,0);break;case 2:uvs.push(1,1)}}indices.push(index)},OBJParser.prototype.createObject=function(trunk){this._currentGroup=null,this._currentMaterialGroup=null,this._objects.push(this._currentObject=new ObjectGroup),trunk&&(this._currentObject.name=trunk[1])},OBJParser.prototype.createGroup=function(trunk){this._currentObject||this.createObject(null),this._currentGroup=new Group,this._currentGroup.materialID=this._activeMaterialID,trunk&&(this._currentGroup.name=trunk[1]),this._currentObject.groups.push(this._currentGroup),this.createMaterialGroup(null)},OBJParser.prototype.createMaterialGroup=function(trunk){this._currentMaterialGroup=new MaterialGroup,trunk&&(this._currentMaterialGroup.url=trunk[1]),this._currentGroup.materialGroups.push(this._currentMaterialGroup)},OBJParser.prototype.parseVertex=function(trunk){var v1,v2,v3;if(trunk.length>4){for(var val,nTrunk=[],i=1;i3){for(var val,nTrunk=[],i=1;i4){for(var val,nTrunk=[],i=1;ii;++i)""!=trunk[i]&&(indices=trunk[i].split("/"),face.vertexIndices.push(this.parseIndex(parseInt(indices[0]),this._vertices.length)),indices[1]&&String(indices[1]).length>0&&face.uvIndices.push(this.parseIndex(parseInt(indices[1]),this._uvs.length)),indices[2]&&String(indices[2]).length>0&&face.normalIndices.push(this.parseIndex(parseInt(indices[2]),this._vertexNormals.length)),face.indexIds.push(trunk[i]));this._currentMaterialGroup.faces.push(face)},OBJParser.prototype.parseIndex=function(index,length){return 0>index?index+length+1:index},OBJParser.prototype.parseMtl=function(data){for(var lines,trunk,j,basicSpecularMethod,useSpecular,useColor,diffuseColor,color,specularColor,specular,alpha,mapkd,materialDefinitions=data.split("newmtl"),i=0;i0&&this.applyMaterial(lm)}}this._mtlLibLoaded=!0},OBJParser.prototype.parseMapKdString=function(trunk){var i,breakflag,url="";for(i=1;i0&&!this.parsingPaused;)this.parseNextBlock();return 0==this._body.getBytesAvailable()?(this.dispose(),ParserBase.PARSING_DONE):ParserBase.MORE_TO_PARSE}switch(this._compression){case AWDParser.DEFLATE:case AWDParser.LZMA:this._debug&&console.log("(!) AWDParser Error: Compressed AWD formats not yet supported (!)")}return ParserBase.PARSING_DONE},AWDParser.prototype._pStartParsing=function(frameLimit){_super.prototype._pStartParsing.call(this,frameLimit),this._pContent=new away.containers.DisplayObjectContainer},AWDParser.prototype.dispose=function(){for(var c in this._blocks){var b=this._blocks[c];b.dispose()}},AWDParser.prototype.parseNextBlock=function(){var block,ns,type,flags,len,isParsed=!1;this._cur_block_id=this._body.readUnsignedInt(),ns=this._body.readUnsignedByte(),type=this._body.readUnsignedByte(),flags=this._body.readUnsignedByte(),len=this._body.readUnsignedInt();var blockCompression=bitFlags.test(flags,bitFlags.FLAG4);bitFlags.test(flags,bitFlags.FLAG5),this._accuracyOnBlocks&&(this._accuracyMatrix=bitFlags.test(flags,bitFlags.FLAG1),this._accuracyGeo=bitFlags.test(flags,bitFlags.FLAG2),this._accuracyProps=bitFlags.test(flags,bitFlags.FLAG3),this._geoNrType=AWDParser.FLOAT32,this._accuracyGeo&&(this._geoNrType=AWDParser.FLOAT64),this._matrixNrType=AWDParser.FLOAT32,this._accuracyMatrix&&(this._matrixNrType=AWDParser.FLOAT64),this._propsNrType=AWDParser.FLOAT32,this._accuracyProps&&(this._propsNrType=AWDParser.FLOAT64));var blockEndAll=this._body.position+len;if(len>this._body.getBytesAvailable())return this._pDieWithError("AWD2 block length is bigger than the bytes that are available!"),this._body.position+=this._body.getBytesAvailable(),void 0;this._newBlockBytes=new ByteArray,this._body.readBytes(this._newBlockBytes,0,len),blockCompression&&this._pDieWithError("Compressed AWD formats not yet supported"),this._newBlockBytes.position=0,block=new AWDBlock,block.len=this._newBlockBytes.position+len,block.id=this._cur_block_id;var blockEndBlock=this._newBlockBytes.position+len;if(blockCompression&&this._pDieWithError("Compressed AWD formats not yet supported"),this._debug&&console.log("AWDBlock: ID = "+this._cur_block_id+" | TypeID = "+type+" | Compression = "+blockCompression+" | Matrix-Precision = "+this._accuracyMatrix+" | Geometry-Precision = "+this._accuracyGeo+" | Properties-Precision = "+this._accuracyProps),this._blocks[this._cur_block_id]=block,2==this._version[0]&&1==this._version[1])switch(type){case 11:this.parsePrimitves(this._cur_block_id),isParsed=!0;break;case 31:this.parseSkyboxInstance(this._cur_block_id),isParsed=!0;break;case 41:this.parseLight(this._cur_block_id),isParsed=!0;break;case 42:this.parseCamera(this._cur_block_id),isParsed=!0;break;case 51:this.parseLightPicker(this._cur_block_id),isParsed=!0;break;case 81:this.parseMaterial_v1(this._cur_block_id),isParsed=!0;break;case 83:this.parseCubeTexture(this._cur_block_id),isParsed=!0;break;case 91:this.parseSharedMethodBlock(this._cur_block_id),isParsed=!0;break;case 92:this.parseShadowMethodBlock(this._cur_block_id),isParsed=!0;break;case 111:this.parseMeshPoseAnimation(this._cur_block_id,!0),isParsed=!0;break;case 112:this.parseMeshPoseAnimation(this._cur_block_id),isParsed=!0;break;case 113:this.parseVertexAnimationSet(this._cur_block_id),isParsed=!0;break;case 122:this.parseAnimatorSet(this._cur_block_id),isParsed=!0;break;case 253:this.parseCommand(this._cur_block_id),isParsed=!0}if(0==isParsed)switch(type){case 1:this.parseTriangleGeometrieBlock(this._cur_block_id);break;case 22:this.parseContainer(this._cur_block_id);break;case 23:this.parseMeshInstance(this._cur_block_id);break;case 81:this.parseMaterial(this._cur_block_id);break;case 82:this.parseTexture(this._cur_block_id);break;case 101:this.parseSkeleton(this._cur_block_id);break;case 102:this.parseSkeletonPose(this._cur_block_id);break;case 103:this.parseSkeletonAnimation(this._cur_block_id);break;case 121:case 254:this.parseNameSpace(this._cur_block_id);break;case 255:this.parseMetaData(this._cur_block_id);break;default:this._debug&&console.log("AWDBlock: Unknown BlockType (BlockID = "+this._cur_block_id+") - Skip "+len+" bytes"),this._newBlockBytes.position+=len}var msgCnt=0;if(this._newBlockBytes.position==blockEndBlock){if(this._debug&&block.errorMessages)for(;msgCntsubs_parsed;){var sm_len,sm_end,sub_geom,w_indices,weights;sm_len=this._newBlockBytes.readUnsignedInt(),sm_end=this._newBlockBytes.position+sm_len;for(var subProps=this.parseProperties({1:this._geoNrType,2:this._geoNrType});this._newBlockBytes.positionprimType||primType>7)&&(primType=0),console.log("Parsed a Primivite: Name = "+name+"| type = "+primitiveTypes[primType]))},AWDParser.prototype.parseContainer=function(blockID){var name,par_id,mtx,ctr;par_id=this._newBlockBytes.readUnsignedInt(),mtx=this.parseMatrix3D(),name=this.parseVarStr();var parentName="Root (TopLevel)";ctr=new away.containers.DisplayObjectContainer,ctr.transform.matrix3D=mtx;var returnedArray=this.getAssetByID(par_id,[AssetType.CONTAINER,AssetType.LIGHT,AssetType.MESH]);if(returnedArray[0]?(returnedArray[1].addChild(ctr),parentName=returnedArray[1].name):par_id>0?this._blocks[blockID].addError("Could not find a parent for this ObjectContainer3D"):this._pContent.addChild(ctr),2==this._version[0]&&1==this._version[1]){var props=this.parseProperties({1:this._matrixNrType,2:this._matrixNrType,3:this._matrixNrType,4:AWDParser.UINT8});ctr.pivot=new away.geom.Vector3D(props.get(1,0),props.get(2,0),props.get(3,0))}else this.parseProperties(null);ctr.extra=this.parseUserAttributes(),this._pFinalizeAsset(ctr,name),this._blocks[blockID].data=ctr,this._debug&&console.log("Parsed a Container: Name = '"+name+"' | Parent-Name = "+parentName)},AWDParser.prototype.parseMeshInstance=function(blockID){var num_materials,materials_parsed,geom,par_id=this._newBlockBytes.readUnsignedInt(),mtx=this.parseMatrix3D(),name=this.parseVarStr(),parentName="Root (TopLevel)",data_id=this._newBlockBytes.readUnsignedInt(),returnedArrayGeometry=this.getAssetByID(data_id,[AssetType.GEOMETRY]);returnedArrayGeometry[0]?geom=returnedArrayGeometry[1]:(this._blocks[blockID].addError("Could not find a Geometry for this Mesh. A empty Geometry is created!"),geom=new away.base.Geometry),this._blocks[blockID].geoID=data_id;var materials=new Array;num_materials=this._newBlockBytes.readUnsignedShort();var materialNames=new Array;materials_parsed=0;for(var returnedArrayMaterial;num_materials>materials_parsed;){var mat_id;mat_id=this._newBlockBytes.readUnsignedInt(),returnedArrayMaterial=this.getAssetByID(mat_id,[AssetType.MATERIAL]),!returnedArrayMaterial[0]&&mat_id>0&&this._blocks[blockID].addError("Could not find Material Nr "+materials_parsed+" (ID = "+mat_id+" ) for this Mesh");var m=returnedArrayMaterial[1];materials.push(m),materialNames.push(m.name),materials_parsed++}var mesh=new Mesh(geom,null);mesh.transform.matrix3D=mtx;var returnedArrayParent=this.getAssetByID(par_id,[AssetType.CONTAINER,AssetType.LIGHT,AssetType.MESH]);if(returnedArrayParent[0]){var objC=returnedArrayParent[1];objC.addChild(mesh),parentName=objC.name}else par_id>0?this._blocks[blockID].addError("Could not find a parent for this Mesh"):this._pContent.addChild(mesh);if(materials.length>=1&&1==mesh.subMeshes.length)mesh.material=materials[0];else if(materials.length>1){var i;for(i=0;i0&&4==shadowMapperType&&(newShadowMapper=new CubeMapShadowMapper),light.transform.matrix3D=mtx),2==lightType&&(light=new DirectionalLight(props.get(21,0),props.get(22,-1),props.get(23,1)),shadowMapperType>0&&1==shadowMapperType&&(newShadowMapper=new DirectionalShadowMapper)),light.color=props.get(3,16777215),light.specular=props.get(4,1),light.diffuse=props.get(5,1),light.ambientColor=props.get(7,16777215),light.ambient=props.get(8,0),newShadowMapper&&(newShadowMapper instanceof CubeMapShadowMapper?1!=props.get(10,1)&&(newShadowMapper.depthMapSize=this._depthSizeDic[props.get(10,1)]):2!=props.get(10,2)&&(newShadowMapper.depthMapSize=this._depthSizeDic[props.get(10,2)]),light.shadowMapper=newShadowMapper,light.castsShadows=!0),0!=par_id){var returnedArrayParent=this.getAssetByID(par_id,[AssetType.CONTAINER,AssetType.LIGHT,AssetType.MESH]);returnedArrayParent[0]?(returnedArrayParent[1].addChild(light),parentName=returnedArrayParent[1].name):this._blocks[blockID].addError("Could not find a parent for this Light")}else this._pContent.addChild(light);this.parseUserAttributes(),this._pFinalizeAsset(light,name),this._blocks[blockID].data=light,this._debug&&console.log("Parsed a Light: Name = '"+name+"' | Type = "+lightTypes[lightType]+" | Parent-Name = "+parentName+" | ShadowMapper-Type = "+shadowMapperTypes[shadowMapperType])},AWDParser.prototype.parseCamera=function(blockID){var projection,par_id=this._newBlockBytes.readUnsignedInt(),mtx=this.parseMatrix3D(),name=this.parseVarStr(),parentName="Root (TopLevel)";this._newBlockBytes.readUnsignedByte(),this._newBlockBytes.readShort();var projectiontype=this._newBlockBytes.readShort(),props=this.parseProperties({101:this._propsNrType,102:this._propsNrType,103:this._propsNrType,104:this._propsNrType});switch(projectiontype){case 5001:projection=new away.projections.PerspectiveProjection(props.get(101,60));break;case 5002:projection=new away.projections.OrthographicProjection(props.get(101,500));break;case 5003:projection=new away.projections.OrthographicOffCenterProjection(props.get(101,-400),props.get(102,400),props.get(103,-300),props.get(104,300));break;default:return console.log("unsupportedLenstype"),void 0}var camera=new away.entities.Camera(projection);camera.transform.matrix3D=mtx;var returnedArrayParent=this.getAssetByID(par_id,[AssetType.CONTAINER,AssetType.LIGHT,AssetType.MESH]);if(returnedArrayParent[0]){var objC=returnedArrayParent[1];objC.addChild(camera),parentName=objC.name}else par_id>0?this._blocks[blockID].addError("Could not find a parent for this Camera"):this._pContent.addChild(camera);camera.name=name,props=this.parseProperties({1:this._matrixNrType,2:this._matrixNrType,3:this._matrixNrType,4:AWDParser.UINT8}),camera.pivot=new away.geom.Vector3D(props.get(1,0),props.get(2,0),props.get(3,0)),camera.extra=this.parseUserAttributes(),this._pFinalizeAsset(camera,name),this._blocks[blockID].data=camera,this._debug&&console.log("Parsed a Camera: Name = '"+name+"' | Projectiontype = "+projection+" | Parent-Name = "+parentName)},AWDParser.prototype.parseLightPicker=function(blockID){var returnedArrayLight,name=this.parseVarStr(),numLights=this._newBlockBytes.readUnsignedShort(),lightsArray=new Array,k=0,lightID=0,lightsArrayNames=new Array;for(k=0;numLights>k;k++)lightID=this._newBlockBytes.readUnsignedInt(),returnedArrayLight=this.getAssetByID(lightID,[AssetType.LIGHT]),returnedArrayLight[0]?(lightsArray.push(returnedArrayLight[1]),lightsArrayNames.push(returnedArrayLight[1].name)):this._blocks[blockID].addError("Could not find a Light Nr "+k+" (ID = "+lightID+" ) for this LightPicker");if(0==lightsArray.length)return this._blocks[blockID].addError("Could not create this LightPicker, cause no Light was found."),this.parseUserAttributes(),void 0;var lightPick=new StaticLightPicker(lightsArray);lightPick.name=name,this.parseUserAttributes(),this._pFinalizeAsset(lightPick,name),this._blocks[blockID].data=lightPick,this._debug&&console.log("Parsed a StaticLightPicker: Name = '"+name+"' | Texture-Name = "+lightsArrayNames.toString())},AWDParser.prototype.parseMaterial=function(blockID){var name,type,props,mat,attributes,num_methods,methods_parsed,returnedArray;for(name=this.parseVarStr(),type=this._newBlockBytes.readUnsignedByte(),num_methods=this._newBlockBytes.readUnsignedByte(),props=this.parseProperties({1:AWDParser.INT32,2:AWDParser.BADDR,10:this._propsNrType,11:AWDParser.BOOL,12:this._propsNrType,13:AWDParser.BOOL}),methods_parsed=0;num_methods>methods_parsed;){var method_type;method_type=this._newBlockBytes.readUnsignedShort(),this.parseProperties(null),this.parseUserAttributes(),methods_parsed+=1}var debugString="";if(attributes=this.parseUserAttributes(),1===type){debugString+="Parsed a ColorMaterial(SinglePass): Name = '"+name+"' | ";var color;color=props.get(1,16777215),this.materialMode<2?mat=new TriangleMethodMaterial(color,props.get(10,1)):(mat=new TriangleMethodMaterial(color),mat.materialMode=TriangleMaterialMode.MULTI_PASS)}else if(2===type){var tex_addr=props.get(2,0);returnedArray=this.getAssetByID(tex_addr,[AssetType.TEXTURE]),!returnedArray[0]&&tex_addr>0&&this._blocks[blockID].addError("Could not find the DiffsueTexture (ID = "+tex_addr+" ) for this Material"),mat=new TriangleMethodMaterial(returnedArray[1]),this.materialMode<2?(mat.alphaBlending=props.get(11,!1),mat.alpha=props.get(10,1),debugString+="Parsed a TriangleMethodMaterial(SinglePass): Name = '"+name+"' | Texture-Name = "+mat.name):(mat.materialMode=TriangleMaterialMode.MULTI_PASS,debugString+="Parsed a TriangleMethodMaterial(MultiPass): Name = '"+name+"' | Texture-Name = "+mat.name)}mat.extra=attributes,mat.alphaThreshold=props.get(12,0),mat.repeat=props.get(13,!1),this._pFinalizeAsset(mat,name),this._blocks[blockID].data=mat,this._debug&&console.log(debugString)},AWDParser.prototype.parseMaterial_v1=function(blockID){var mat,normalTexture,specTexture,returnedArray,name=this.parseVarStr(),type=this._newBlockBytes.readUnsignedByte(),num_methods=this._newBlockBytes.readUnsignedByte(),props=this.parseProperties({1:AWDParser.UINT32,2:AWDParser.BADDR,3:AWDParser.BADDR,4:AWDParser.UINT8,5:AWDParser.BOOL,6:AWDParser.BOOL,7:AWDParser.BOOL,8:AWDParser.BOOL,9:AWDParser.UINT8,10:this._propsNrType,11:AWDParser.BOOL,12:this._propsNrType,13:AWDParser.BOOL,15:this._propsNrType,16:AWDParser.UINT32,17:AWDParser.BADDR,18:this._propsNrType,19:this._propsNrType,20:AWDParser.UINT32,21:AWDParser.BADDR,22:AWDParser.BADDR}),spezialType=props.get(4,0),debugString="";if(spezialType>=2)return this._blocks[blockID].addError("Material-spezialType '"+spezialType+"' is not supported, can only be 0:singlePass, 1:MultiPass !"),void 0;if(1==this.materialMode?spezialType=0:2==this.materialMode&&(spezialType=1),2>spezialType){if(1==type){var color=props.get(1,13421772);1==spezialType?(mat=new TriangleMethodMaterial(color),mat.materialMode=TriangleMaterialMode.MULTI_PASS,debugString+="Parsed a ColorMaterial(MultiPass): Name = '"+name+"' | "):(mat=new TriangleMethodMaterial(color,props.get(10,1)),mat.alphaBlending=props.get(11,!1),debugString+="Parsed a ColorMaterial(SinglePass): Name = '"+name+"' | ")}else if(2==type){var tex_addr=props.get(2,0);returnedArray=this.getAssetByID(tex_addr,[AssetType.TEXTURE]),!returnedArray[0]&&tex_addr>0&&this._blocks[blockID].addError("Could not find the AmbientTexture (ID = "+tex_addr+" ) for this TriangleMethodMaterial");var texture=returnedArray[1];mat=new TriangleMethodMaterial(texture),1==spezialType?(mat.materialMode=TriangleMaterialMode.MULTI_PASS,debugString+="Parsed a TriangleMethodMaterial(MultiPass): Name = '"+name+"' | Texture-Name = "+texture.name):(mat.alpha=props.get(10,1),mat.alphaBlending=props.get(11,!1),debugString+="Parsed a TriangleMethodMaterial(SinglePass): Name = '"+name+"' | Texture-Name = "+texture.name)}var diffuseTexture,diffuseTex_addr=props.get(17,0);returnedArray=this.getAssetByID(diffuseTex_addr,[AssetType.TEXTURE]),returnedArray[0]||0==diffuseTex_addr||this._blocks[blockID].addError("Could not find the DiffuseTexture (ID = "+diffuseTex_addr+" ) for this TriangleMethodMaterial"),returnedArray[0]&&(diffuseTexture=returnedArray[1]),diffuseTexture&&(mat.diffuseTexture=diffuseTexture,debugString+=" | DiffuseTexture-Name = "+diffuseTexture.name);var normalTex_addr=props.get(3,0);returnedArray=this.getAssetByID(normalTex_addr,[AssetType.TEXTURE]),returnedArray[0]||0==normalTex_addr||this._blocks[blockID].addError("Could not find the NormalTexture (ID = "+normalTex_addr+" ) for this TriangleMethodMaterial"),returnedArray[0]&&(normalTexture=returnedArray[1],debugString+=" | NormalTexture-Name = "+normalTexture.name);var specTex_addr=props.get(21,0);returnedArray=this.getAssetByID(specTex_addr,[AssetType.TEXTURE]),returnedArray[0]||0==specTex_addr||this._blocks[blockID].addError("Could not find the SpecularTexture (ID = "+specTex_addr+" ) for this TriangleMethodMaterial"),returnedArray[0]&&(specTexture=returnedArray[1],debugString+=" | SpecularTexture-Name = "+specTexture.name);var lightPickerAddr=props.get(22,0);returnedArray=this.getAssetByID(lightPickerAddr,[AssetType.LIGHT_PICKER]),!returnedArray[0]&&lightPickerAddr?this._blocks[blockID].addError("Could not find the LightPicker (ID = "+lightPickerAddr+" ) for this TriangleMethodMaterial"):mat.lightPicker=returnedArray[1],mat.smooth=props.get(5,!0),mat.mipmap=props.get(6,!0),mat.bothSides=props.get(7,!1),mat.alphaPremultiplied=props.get(8,!1),mat.blendMode=this.blendModeDic[props.get(9,0)],mat.repeat=props.get(13,!1),normalTexture&&(mat.normalMap=normalTexture),specTexture&&(mat.specularMap=specTexture),mat.alphaThreshold=props.get(12,0),mat.ambient=props.get(15,1),mat.diffuseColor=props.get(16,16777215),mat.specular=props.get(18,1),mat.gloss=props.get(19,50),mat.specularColor=props.get(20,16777215);for(var targetID,methods_parsed=0;num_methods>methods_parsed;){var method_type;switch(method_type=this._newBlockBytes.readUnsignedShort(),props=this.parseProperties({1:AWDParser.BADDR,2:AWDParser.BADDR,3:AWDParser.BADDR,101:this._propsNrType,102:this._propsNrType,103:this._propsNrType,201:AWDParser.UINT32,202:AWDParser.UINT32,301:AWDParser.UINT16,302:AWDParser.UINT16,401:AWDParser.UINT8,402:AWDParser.UINT8,601:AWDParser.COLOR,602:AWDParser.COLOR,701:AWDParser.BOOL,702:AWDParser.BOOL,801:AWDParser.MTX4x4}),method_type){case 999:targetID=props.get(1,0),returnedArray=this.getAssetByID(targetID,[AssetType.EFFECTS_METHOD]),returnedArray[0]?(mat.addEffectMethod(returnedArray[1]),debugString+=" | EffectMethod-Name = "+returnedArray[1].name):this._blocks[blockID].addError("Could not find the EffectMethod (ID = "+targetID+" ) for this Material");break;case 998:targetID=props.get(1,0),returnedArray=this.getAssetByID(targetID,[AssetType.SHADOW_MAP_METHOD]),returnedArray[0]?(mat.shadowMethod=returnedArray[1],debugString+=" | ShadowMethod-Name = "+returnedArray[1].name):this._blocks[blockID].addError("Could not find the ShadowMethod (ID = "+targetID+" ) for this Material");break;case 1:targetID=props.get(1,0),returnedArray=this.getAssetByID(targetID,[AssetType.TEXTURE],"CubeTexture"),returnedArray[0]||this._blocks[blockID].addError("Could not find the EnvMap (ID = "+targetID+" ) for this EnvMapAmbientMethodMaterial"),mat.ambientMethod=new AmbientEnvMapMethod(returnedArray[1]),debugString+=" | AmbientEnvMapMethod | EnvMap-Name ="+returnedArray[1].name;break;case 51:mat.diffuseMethod=new DiffuseDepthMethod,debugString+=" | DiffuseDepthMethod";break;case 52:targetID=props.get(1,0),returnedArray=this.getAssetByID(targetID,[AssetType.TEXTURE]),returnedArray[0]||this._blocks[blockID].addError("Could not find the GradientDiffuseTexture (ID = "+targetID+" ) for this GradientDiffuseMethod"),mat.diffuseMethod=new DiffuseGradientMethod(returnedArray[1]),debugString+=" | DiffuseGradientMethod | GradientDiffuseTexture-Name ="+returnedArray[1].name;break;case 53:mat.diffuseMethod=new DiffuseWrapMethod(props.get(101,5)),debugString+=" | DiffuseWrapMethod";break;case 54:targetID=props.get(1,0),returnedArray=this.getAssetByID(targetID,[AssetType.TEXTURE]),returnedArray[0]||this._blocks[blockID].addError("Could not find the LightMap (ID = "+targetID+" ) for this LightMapDiffuseMethod"),mat.diffuseMethod=new DiffuseLightMapMethod(returnedArray[1],this.blendModeDic[props.get(401,10)],!1,mat.diffuseMethod),debugString+=" | DiffuseLightMapMethod | LightMapTexture-Name ="+returnedArray[1].name;break;case 55:mat.diffuseMethod=new DiffuseCelMethod(props.get(401,3),mat.diffuseMethod),mat.diffuseMethod.smoothness=props.get(101,.1),debugString+=" | DiffuseCelMethod";break;case 56:break;case 101:mat.specularMethod=new SpecularAnisotropicMethod,debugString+=" | SpecularAnisotropicMethod";break;case 102:mat.specularMethod=new SpecularPhongMethod,debugString+=" | SpecularPhongMethod";break;case 103:mat.specularMethod=new SpecularCelMethod(props.get(101,.5),mat.specularMethod),mat.specularMethod.smoothness=props.get(102,.1),debugString+=" | SpecularCelMethod";break;case 104:mat.specularMethod=new SpecularFresnelMethod(props.get(701,!0),mat.specularMethod),mat.specularMethod.fresnelPower=props.get(101,5),mat.specularMethod.normalReflectance=props.get(102,.1),debugString+=" | SpecularFresnelMethod";break;case 151:break;case 152:targetID=props.get(1,0),returnedArray=this.getAssetByID(targetID,[AssetType.TEXTURE]),returnedArray[0]||this._blocks[blockID].addError("Could not find the SecoundNormalMap (ID = "+targetID+" ) for this SimpleWaterNormalMethod"),mat.normalMap||this._blocks[blockID].addError("Could not find a normal Map on this Material to use with this SimpleWaterNormalMethod"),mat.normalMap=returnedArray[1],mat.normalMethod=new NormalSimpleWaterMethod(mat.normalMap,returnedArray[1]),debugString+=" | NormalSimpleWaterMethod | Second-NormalTexture-Name = "+returnedArray[1].name}this.parseUserAttributes(),methods_parsed+=1}}mat.extra=this.parseUserAttributes(),this._pFinalizeAsset(mat,name),this._blocks[blockID].data=mat,this._debug&&console.log(debugString)},AWDParser.prototype.parseTexture=function(blockID){var asset;this._blocks[blockID].name=this.parseVarStr();var data_len,type=this._newBlockBytes.readUnsignedByte();if(this._texture_users[this._cur_block_id.toString()]=[],0==type){data_len=this._newBlockBytes.readUnsignedInt();var url;url=this._newBlockBytes.readUTFBytes(data_len),this._pAddDependency(this._cur_block_id.toString(),new away.net.URLRequest(url),!1,null,!0)}else{data_len=this._newBlockBytes.readUnsignedInt();var data;data=new ByteArray,this._newBlockBytes.readBytes(data,0,data_len),this._pAddDependency(this._cur_block_id.toString(),null,!1,ParserUtils.byteArrayToImage(data),!0)}if(this.parseProperties(null),this._blocks[blockID].extras=this.parseUserAttributes(),this._pPauseAndRetrieveDependencies(),this._blocks[blockID].data=asset,this._debug){var textureStylesNames=["external","embed"];console.log("Start parsing a "+textureStylesNames[type]+" Bitmap for Texture")}},AWDParser.prototype.parseCubeTexture=function(blockID){var data_len,asset,i;this._cubeTextures=new Array,this._texture_users[this._cur_block_id.toString()]=[];var type=this._newBlockBytes.readUnsignedByte();for(this._blocks[blockID].name=this.parseVarStr(),i=0;6>i;i++)if(this._texture_users[this._cur_block_id.toString()]=[],this._cubeTextures.push(null),0==type){data_len=this._newBlockBytes.readUnsignedInt();var url;url=this._newBlockBytes.readUTFBytes(data_len),this._pAddDependency(this._cur_block_id.toString()+"#"+i,new away.net.URLRequest(url),!1,null,!0)}else{data_len=this._newBlockBytes.readUnsignedInt();var data;data=new ByteArray,this._newBlockBytes.readBytes(data,0,data_len),this._pAddDependency(this._cur_block_id.toString()+"#"+i,null,!1,ParserUtils.byteArrayToImage(data),!0)}if(this.parseProperties(null),this._blocks[blockID].extras=this.parseUserAttributes(),this._pPauseAndRetrieveDependencies(),this._blocks[blockID].data=asset,this._debug){var textureStylesNames=["external","embed"];console.log("Start parsing 6 "+textureStylesNames[type]+" Bitmaps for CubeTexture")}},AWDParser.prototype.parseSharedMethodBlock=function(blockID){var asset;this._blocks[blockID].name=this.parseVarStr(),asset=this.parseSharedMethodList(blockID),this.parseUserAttributes(),this._blocks[blockID].data=asset,this._pFinalizeAsset(asset,this._blocks[blockID].name),this._blocks[blockID].data=asset,this._debug&&console.log("Parsed a EffectMethod: Name = "+asset.name+" Type = "+asset)},AWDParser.prototype.parseShadowMethodBlock=function(blockID){var asset,shadowLightID;this._blocks[blockID].name=this.parseVarStr(),shadowLightID=this._newBlockBytes.readUnsignedInt();var returnedArray=this.getAssetByID(shadowLightID,[AssetType.LIGHT]);return returnedArray[0]?(asset=this.parseShadowMethodList(returnedArray[1],blockID),asset&&(this.parseUserAttributes(),this._pFinalizeAsset(asset,this._blocks[blockID].name),this._blocks[blockID].data=asset,this._debug&&console.log("Parsed a ShadowMapMethodMethod: Name = "+asset.name+" | Type = "+asset+" | Light-Name = ",returnedArray[1].name)),void 0):(this._blocks[blockID].addError("Could not find the TargetLight (ID = "+shadowLightID+" ) for this ShadowMethod - ShadowMethod not created"),void 0)},AWDParser.prototype.parseCommand=function(blockID){1==this._newBlockBytes.readUnsignedByte();var parentObject,targetObject,par_id=this._newBlockBytes.readUnsignedInt(),mtx=this.parseMatrix3D(),name=this.parseVarStr(),returnedArray=this.getAssetByID(par_id,[AssetType.CONTAINER,AssetType.LIGHT,AssetType.MESH]);returnedArray[0]&&(parentObject=returnedArray[1]),this._newBlockBytes.readShort();var typeCommand=this._newBlockBytes.readShort(),props=this.parseProperties({1:AWDParser.BADDR});switch(typeCommand){case 1:var targetID=props.get(1,0),returnedArrayTarget=this.getAssetByID(targetID,[AssetType.LIGHT,AssetType.TEXTURE_PROJECTOR]);if(!returnedArrayTarget[0]&&0!=targetID)return this._blocks[blockID].addError("Could not find the light (ID = "+targetID+" ( for this CommandBock!"),void 0;targetObject=returnedArrayTarget[1],parentObject&&parentObject.addChild(targetObject),targetObject.transform.matrix3D=mtx}targetObject&&(props=this.parseProperties({1:this._matrixNrType,2:this._matrixNrType,3:this._matrixNrType,4:AWDParser.UINT8}),targetObject.pivot=new away.geom.Vector3D(props.get(1,0),props.get(2,0),props.get(3,0)),targetObject.extra=this.parseUserAttributes()),this._blocks[blockID].data=targetObject,this._debug&&console.log("Parsed a CommandBlock: Name = '"+name)},AWDParser.prototype.parseMetaData=function(){var props=this.parseProperties({1:AWDParser.UINT32,2:AWDParser.AWDSTRING,3:AWDParser.AWDSTRING,4:AWDParser.AWDSTRING,5:AWDParser.AWDSTRING});this._debug&&(console.log("Parsed a MetaDataBlock: TimeStamp = "+props.get(1,0)),console.log(" EncoderName = "+props.get(2,"unknown")),console.log(" EncoderVersion = "+props.get(3,"unknown")),console.log(" GeneratorName = "+props.get(4,"unknown")),console.log(" GeneratorVersion = "+props.get(5,"unknown")))},AWDParser.prototype.parseNameSpace=function(){var id=this._newBlockBytes.readUnsignedByte(),nameSpaceString=this.parseVarStr();this._debug&&console.log("Parsed a NameSpaceBlock: ID = "+id+" | String = "+nameSpaceString)},AWDParser.prototype.parseShadowMethodList=function(light,blockID){var shadowMethod,targetID,returnedArray,methodType=this._newBlockBytes.readUnsignedShort(),props=this.parseProperties({1:AWDParser.BADDR,2:AWDParser.BADDR,3:AWDParser.BADDR,101:this._propsNrType,102:this._propsNrType,103:this._propsNrType,201:AWDParser.UINT32,202:AWDParser.UINT32,301:AWDParser.UINT16,302:AWDParser.UINT16,401:AWDParser.UINT8,402:AWDParser.UINT8,601:AWDParser.COLOR,602:AWDParser.COLOR,701:AWDParser.BOOL,702:AWDParser.BOOL,801:AWDParser.MTX4x4});switch(methodType){case 1002:if(targetID=props.get(1,0),returnedArray=this.getAssetByID(targetID,[AssetType.SHADOW_MAP_METHOD]),!returnedArray[0])return this._blocks[blockID].addError("Could not find the ShadowBaseMethod (ID = "+targetID+" ) for this ShadowNearMethod - ShadowMethod not created"),shadowMethod;shadowMethod=new ShadowNearMethod(returnedArray[1]);break;case 1101:shadowMethod=new ShadowFilteredMethod(light),shadowMethod.alpha=props.get(101,1),shadowMethod.epsilon=props.get(102,.002);break;case 1102:shadowMethod=new ShadowDitheredMethod(light,props.get(201,5)),shadowMethod.alpha=props.get(101,1),shadowMethod.epsilon=props.get(102,.002),shadowMethod.range=props.get(103,1);break;case 1103:shadowMethod=new ShadowSoftMethod(light,props.get(201,5)),shadowMethod.alpha=props.get(101,1),shadowMethod.epsilon=props.get(102,.002),shadowMethod.range=props.get(103,1);break;case 1104:shadowMethod=new ShadowHardMethod(light),shadowMethod.alpha=props.get(101,1),shadowMethod.epsilon=props.get(102,.002)}return this.parseUserAttributes(),shadowMethod},AWDParser.prototype.parseSkeleton=function(blockID){var name=this.parseVarStr(),num_joints=this._newBlockBytes.readUnsignedShort(),skeleton=new Skeleton;this.parseProperties(null);for(var joints_parsed=0;num_joints>joints_parsed;){var joint,ibp;this._newBlockBytes.readUnsignedShort(),joint=new SkeletonJoint,joint.parentIndex=this._newBlockBytes.readUnsignedShort()-1,joint.name=this.parseVarStr(),ibp=this.parseMatrix3D(),joint.inverseBindPose=ibp.rawData,this.parseProperties(null),this.parseUserAttributes(),skeleton.joints.push(joint),joints_parsed++}this.parseUserAttributes(),this._pFinalizeAsset(skeleton,name),this._blocks[blockID].data=skeleton,this._debug&&console.log("Parsed a Skeleton: Name = "+skeleton.name+" | Number of Joints = "+joints_parsed)},AWDParser.prototype.parseSkeletonPose=function(blockID){var name=this.parseVarStr(),num_joints=this._newBlockBytes.readUnsignedShort();this.parseProperties(null);for(var pose=new SkeletonPose,joints_parsed=0;num_joints>joints_parsed;){var joint_pose,has_transform;if(joint_pose=new JointPose,has_transform=this._newBlockBytes.readUnsignedByte(),1==has_transform){var mtx_data=this.parseMatrix43RawData(),mtx=new Matrix3D(mtx_data);joint_pose.orientation.fromMatrix(mtx),joint_pose.translation.copyFrom(mtx.position),pose.jointPoses[joints_parsed]=joint_pose}joints_parsed++}this.parseUserAttributes(),this._pFinalizeAsset(pose,name),this._blocks[blockID].data=pose,this._debug&&console.log("Parsed a SkeletonPose: Name = "+pose.name+" | Number of Joints = "+joints_parsed)},AWDParser.prototype.parseSkeletonAnimation=function(blockID){var frame_dur,pose_addr,name=this.parseVarStr(),clip=new SkeletonClipNode,num_frames=this._newBlockBytes.readUnsignedShort();this.parseProperties(null);for(var returnedArray,frames_parsed=0;num_frames>frames_parsed;)pose_addr=this._newBlockBytes.readUnsignedInt(),frame_dur=this._newBlockBytes.readUnsignedShort(),returnedArray=this.getAssetByID(pose_addr,[AssetType.SKELETON_POSE]),returnedArray[0]?clip.addFrame(this._blocks[pose_addr].data,frame_dur):this._blocks[blockID].addError("Could not find the SkeletonPose Frame # "+frames_parsed+" (ID = "+pose_addr+" ) for this SkeletonClipNode"),frames_parsed++;return 0==clip.frames.length?(this._blocks[blockID].addError("Could not this SkeletonClipNode, because no Frames where set."),void 0):(this.parseUserAttributes(),this._pFinalizeAsset(clip,name),this._blocks[blockID].data=clip,this._debug&&console.log("Parsed a SkeletonClipNode: Name = "+clip.name+" | Number of Frames = "+clip.frames.length),void 0)},AWDParser.prototype.parseMeshPoseAnimation=function(blockID,poseOnly){"undefined"==typeof poseOnly&&(poseOnly=!1);var num_submeshes,frames_parsed,subMeshParsed,frame_dur,x,y,z,str_len,str_end,geometry,subGeom,indices,verts,props,num_frames=1,idx=0,clip=new VertexClipNode,num_Streams=0,streamsParsed=0,streamtypes=new Array,name=this.parseVarStr(),geoAdress=this._newBlockBytes.readUnsignedInt(),returnedArray=this.getAssetByID(geoAdress,[AssetType.GEOMETRY]);if(!returnedArray[0])return this._blocks[blockID].addError("Could not find the target-Geometry-Object "+geoAdress+" ) for this VertexClipNode"),void 0;var uvs=this.getUVForVertexAnimation(geoAdress);for(poseOnly||(num_frames=this._newBlockBytes.readUnsignedShort()),num_submeshes=this._newBlockBytes.readUnsignedShort(),num_Streams=this._newBlockBytes.readUnsignedShort(),streamsParsed=0;num_Streams>streamsParsed;)streamtypes.push(this._newBlockBytes.readUnsignedShort()),streamsParsed++;for(props=this.parseProperties({1:AWDParser.BOOL,2:AWDParser.BOOL}),clip.looping=props.get(1,!0),clip.stitchFinalFrame=props.get(2,!1),frames_parsed=0;num_frames>frames_parsed;){for(frame_dur=this._newBlockBytes.readUnsignedShort(),geometry=new Geometry,subMeshParsed=0;num_submeshes>subMeshParsed;)for(streamsParsed=0,str_len=this._newBlockBytes.readUnsignedInt(),str_end=this._newBlockBytes.position+str_len;num_Streams>streamsParsed;){if(1==streamtypes[streamsParsed]){for(indices=returnedArray[1].subGeometries[subMeshParsed].indices,verts=new Array,idx=0;this._newBlockBytes.position0){for(var newVertexAnimationSet=new VertexAnimationSet,i=0;i0&&(returnedArray=this.getAssetByID(targetID,[AssetType.TEXTURE]),returnedArray[0]||this._blocks[blockID].addError("Could not find the Mask-texture (ID = "+targetID+" ) for this EnvMapMethod"));break;case 404:targetID=props.get(1,0),returnedArray=this.getAssetByID(targetID,[AssetType.TEXTURE]),returnedArray[0]||this._blocks[blockID].addError("Could not find the LightMap (ID = "+targetID+" ) for this LightMapMethod"),effectMethodReturn=new EffectLightMapMethod(returnedArray[1],this.blendModeDic[props.get(401,10)]);break;case 406:effectMethodReturn=new EffectRimLightMethod(props.get(601,16777215),props.get(101,.4),props.get(101,2));break;case 407:targetID=props.get(1,0),returnedArray=this.getAssetByID(targetID,[AssetType.TEXTURE]),returnedArray[0]||this._blocks[blockID].addError("Could not find the Alpha-texture (ID = "+targetID+" ) for this AlphaMaskMethod"),effectMethodReturn=new EffectAlphaMaskMethod(returnedArray[1],props.get(701,!1));break;case 410:targetID=props.get(1,0),returnedArray=this.getAssetByID(targetID,[AssetType.TEXTURE],"CubeTexture"),returnedArray[0]||this._blocks[blockID].addError("Could not find the EnvMap (ID = "+targetID+" ) for this FresnelEnvMapMethod"),effectMethodReturn=new EffectFresnelEnvMapMethod(returnedArray[1],props.get(101,1));break;case 411:effectMethodReturn=new EffectFogMethod(props.get(101,0),props.get(102,1e3),props.get(601,8421504))}return this.parseUserAttributes(),effectMethodReturn},AWDParser.prototype.parseUserAttributes=function(){var attributes,list_len,attibuteCnt;if(list_len=this._newBlockBytes.readUnsignedInt(),list_len>0){var list_end;for(attributes={},list_end=this._newBlockBytes.position+list_len;this._newBlockBytes.positionlist_end)return console.log(" Error in reading attribute # "+attibuteCnt+" = skipped to end of attribute-list"),this._newBlockBytes.position=list_end,attributes;switch(attr_type){case AWDParser.AWDSTRING:attr_val=this._newBlockBytes.readUTFBytes(attr_len);break;case AWDParser.INT8:attr_val=this._newBlockBytes.readByte();break;case AWDParser.INT16:attr_val=this._newBlockBytes.readShort();break;case AWDParser.INT32:attr_val=this._newBlockBytes.readInt();break;case AWDParser.BOOL:case AWDParser.UINT8:attr_val=this._newBlockBytes.readUnsignedByte();break;case AWDParser.UINT16:attr_val=this._newBlockBytes.readUnsignedShort();break;case AWDParser.UINT32:case AWDParser.BADDR:attr_val=this._newBlockBytes.readUnsignedInt();break;case AWDParser.FLOAT32:attr_val=this._newBlockBytes.readFloat();break;case AWDParser.FLOAT64:attr_val=this._newBlockBytes.readDouble();break;default:attr_val="unimplemented attribute type "+attr_type,this._newBlockBytes.position+=attr_len}this._debug&&console.log("attribute = name: "+attr_key+" / value = "+attr_val),attributes[attr_key]=attr_val,attibuteCnt+=1}}return attributes},AWDParser.prototype.parseProperties=function(expected){var list_end,list_len,propertyCnt=0,props=new AWDProperties;if(list_len=this._newBlockBytes.readUnsignedInt(),list_end=this._newBlockBytes.position+list_len,expected)for(;this._newBlockBytes.positionlist_end)return console.log(" Error in reading property # "+propertyCnt+" = skipped to end of propertie-list"),this._newBlockBytes.position=list_end,props;expected.hasOwnProperty(key.toString())?(type=expected[key],props.set(key,this.parseAttrValue(type,len))):this._newBlockBytes.position+=len,propertyCnt+=1}else this._newBlockBytes.position=list_end;return props},AWDParser.prototype.parseAttrValue=function(type,len){var elem_len,read_func;switch(type){case AWDParser.BOOL:case AWDParser.INT8:elem_len=1,read_func=this._newBlockBytes.readByte;break;case AWDParser.INT16:elem_len=2,read_func=this._newBlockBytes.readShort;break;case AWDParser.INT32:elem_len=4,read_func=this._newBlockBytes.readInt;break;case AWDParser.UINT8:elem_len=1,read_func=this._newBlockBytes.readUnsignedByte;break;case AWDParser.UINT16:elem_len=2,read_func=this._newBlockBytes.readUnsignedShort;break;case AWDParser.UINT32:case AWDParser.COLOR:case AWDParser.BADDR:elem_len=4,read_func=this._newBlockBytes.readUnsignedInt;break;case AWDParser.FLOAT32:elem_len=4,read_func=this._newBlockBytes.readFloat;break;case AWDParser.FLOAT64:elem_len=8,read_func=this._newBlockBytes.readDouble;break;case AWDParser.AWDSTRING:return this._newBlockBytes.readUTFBytes(len);case AWDParser.VECTOR2x1:case AWDParser.VECTOR3x1:case AWDParser.VECTOR4x1:case AWDParser.MTX3x2:case AWDParser.MTX3x3:case AWDParser.MTX4x3:case AWDParser.MTX4x4:elem_len=8,read_func=this._newBlockBytes.readDouble}if(len>elem_len){for(var list=[],num_read=0,num_elems=len/elem_len;num_elems>num_read;)list.push(read_func.apply(this._newBlockBytes)),num_read++;return list}var val=read_func.apply(this._newBlockBytes);return val},AWDParser.prototype.parseHeader=function(){var flags,body_len;this._byteData.position=3,this._version[0]=this._byteData.readUnsignedByte(),this._version[1]=this._byteData.readUnsignedByte(),flags=this._byteData.readUnsignedShort(),this._streaming=bitFlags.test(flags,bitFlags.FLAG1),2==this._version[0]&&1==this._version[1]&&(this._accuracyMatrix=bitFlags.test(flags,bitFlags.FLAG2),this._accuracyGeo=bitFlags.test(flags,bitFlags.FLAG3),this._accuracyProps=bitFlags.test(flags,bitFlags.FLAG4)),this._geoNrType=AWDParser.FLOAT32,this._accuracyGeo&&(this._geoNrType=AWDParser.FLOAT64),this._matrixNrType=AWDParser.FLOAT32,this._accuracyMatrix&&(this._matrixNrType=AWDParser.FLOAT64),this._propsNrType=AWDParser.FLOAT32,this._accuracyProps&&(this._propsNrType=AWDParser.FLOAT64),this._compression=this._byteData.readUnsignedByte(),this._debug&&(console.log("Import AWDFile of version = "+this._version[0]+" - "+this._version[1]),console.log("Global Settings = Compression = "+this._compression+" | Streaming = "+this._streaming+" | Matrix-Precision = "+this._accuracyMatrix+" | Geometry-Precision = "+this._accuracyGeo+" | Properties-Precision = "+this._accuracyProps)),body_len=this._byteData.readUnsignedInt(),this._streaming||body_len==this._byteData.getBytesAvailable()||this._pDieWithError("AWD2 body length does not match header integrity field")},AWDParser.prototype.getUVForVertexAnimation=function(meshID){if(this._blocks[meshID].data instanceof Mesh&&(meshID=this._blocks[meshID].geoID),this._blocks[meshID].uvsForVertexAnimation)return this._blocks[meshID].uvsForVertexAnimation;var ud,uStride,uOffs,numPoints,i,newUvs,sub_geom,geometry=this._blocks[meshID].data,geoCnt=0;for(this._blocks[meshID].uvsForVertexAnimation=new Array;geoCnti;i++)newUvs.push(ud[uOffs+i*uStride+0]),newUvs.push(ud[uOffs+i*uStride+1]);this._blocks[meshID].uvsForVertexAnimation.push(newUvs),geoCnt++}return this._blocks[meshID].uvsForVertexAnimation},AWDParser.prototype.parseVarStr=function(){var len=this._newBlockBytes.readUnsignedShort();return this._newBlockBytes.readUTFBytes(len)},AWDParser.prototype.getAssetByID=function(assetID,assetTypesToGet,extraTypeInfo){"undefined"==typeof extraTypeInfo&&(extraTypeInfo="SingleTexture");var returnArray=new Array,typeCnt=0;if(assetID>0&&this._blocks[assetID]&&this._blocks[assetID].data)for(;typeCnti;i++)mtx_raw[i]=this._newBlockBytes.readFloat();return mtx_raw},AWDParser.prototype.parseMatrix43RawData=function(){var mtx_raw=new Array(16);return mtx_raw[0]=this.readNumber(this._accuracyMatrix),mtx_raw[1]=this.readNumber(this._accuracyMatrix),mtx_raw[2]=this.readNumber(this._accuracyMatrix),mtx_raw[3]=0,mtx_raw[4]=this.readNumber(this._accuracyMatrix),mtx_raw[5]=this.readNumber(this._accuracyMatrix),mtx_raw[6]=this.readNumber(this._accuracyMatrix),mtx_raw[7]=0,mtx_raw[8]=this.readNumber(this._accuracyMatrix),mtx_raw[9]=this.readNumber(this._accuracyMatrix),mtx_raw[10]=this.readNumber(this._accuracyMatrix),mtx_raw[11]=0,mtx_raw[12]=this.readNumber(this._accuracyMatrix),mtx_raw[13]=this.readNumber(this._accuracyMatrix),mtx_raw[14]=this.readNumber(this._accuracyMatrix),mtx_raw[15]=1,isNaN(mtx_raw[0])&&(mtx_raw[0]=1,mtx_raw[1]=0,mtx_raw[2]=0,mtx_raw[4]=0,mtx_raw[5]=1,mtx_raw[6]=0,mtx_raw[8]=0,mtx_raw[9]=0,mtx_raw[10]=1,mtx_raw[12]=0,mtx_raw[13]=0,mtx_raw[14]=0),mtx_raw},AWDParser.COMPRESSIONMODE_LZMA="lzma",AWDParser.UNCOMPRESSED=0,AWDParser.DEFLATE=1,AWDParser.LZMA=2,AWDParser.INT8=1,AWDParser.INT16=2,AWDParser.INT32=3,AWDParser.UINT8=4,AWDParser.UINT16=5,AWDParser.UINT32=6,AWDParser.FLOAT32=7,AWDParser.FLOAT64=8,AWDParser.BOOL=21,AWDParser.COLOR=22,AWDParser.BADDR=23,AWDParser.AWDSTRING=31,AWDParser.AWDBYTEARRAY=32,AWDParser.VECTOR2x1=41,AWDParser.VECTOR3x1=42,AWDParser.VECTOR4x1=43,AWDParser.MTX3x2=44,AWDParser.MTX3x3=45,AWDParser.MTX4x3=46,AWDParser.MTX4x4=47,AWDParser}(away.parsers.ParserBase);parsers.AWDParser=AWDParser}(away.parsers||(away.parsers={})),away.parsers}(away||(away={}));var AWDBlock=function(){function AWDBlock(){}return AWDBlock.prototype.dispose=function(){this.id=null,this.bytes=null,this.errorMessages=null,this.uvsForVertexAnimation=null},AWDBlock.prototype.addError=function(errorMsg){this.errorMessages||(this.errorMessages=new Array),this.errorMessages.push(errorMsg)},AWDBlock}(),bitFlags=function(){function bitFlags(){}return bitFlags.test=function(flags,testFlag){return(flags&testFlag)==testFlag},bitFlags.FLAG1=1,bitFlags.FLAG2=2,bitFlags.FLAG3=4,bitFlags.FLAG4=8,bitFlags.FLAG5=16,bitFlags.FLAG6=32,bitFlags.FLAG7=64,bitFlags.FLAG8=128,bitFlags.FLAG9=256,bitFlags.FLAG10=512,bitFlags.FLAG11=1024,bitFlags.FLAG12=2048,bitFlags.FLAG13=4096,bitFlags.FLAG14=8192,bitFlags.FLAG15=16384,bitFlags.FLAG16=32768,bitFlags}(),AWDProperties=function(){function AWDProperties(){}return AWDProperties.prototype.set=function(key,value){this[key.toString()]=value},AWDProperties.prototype.get=function(key,fallback){return this.hasOwnProperty(key.toString())?this[key.toString()]:fallback},AWDProperties}(),away;!function(away){!function(parsers){var SubGeometry=away.base.TriangleSubGeometry,DefaultMaterialManager=away.materials.DefaultMaterialManager,TriangleMethodMaterial=away.materials.TriangleMethodMaterial,TriangleMaterialMode=away.materials.TriangleMaterialMode,URLLoaderDataFormat=away.net.URLLoaderDataFormat,Max3DSParser=function(_super){function Max3DSParser(useSmoothingGroups){"undefined"==typeof useSmoothingGroups&&(useSmoothingGroups=!0),_super.call(this,URLLoaderDataFormat.ARRAY_BUFFER),this._useSmoothingGroups=useSmoothingGroups}return __extends(Max3DSParser,_super),Max3DSParser.supportsType=function(extension){return extension=extension.toLowerCase(),"3ds"==extension},Max3DSParser.supportsData=function(data){var ba;return ba=parsers.ParserUtils.toByteArray(data),ba&&(ba.position=0,19789==ba.readShort())?!0:!1},Max3DSParser.prototype._iResolveDependency=function(resourceDependency){if(1==resourceDependency.assets.length){var asset;if(asset=resourceDependency.assets[0],asset.assetType==away.library.AssetType.TEXTURE){var tex;tex=this._textures[resourceDependency.id],tex.texture=asset}}},Max3DSParser.prototype._iResolveDependencyFailure=function(){},Max3DSParser.prototype._pProceedParsing=function(){for(this._byteData||(this._byteData=this._pGetByteData(),this._byteData.position=0,this._textures={},this._materials={},this._unfinalized_objects={});this._pHasTime();)if(this._cur_mat&&this._byteData.position>=this._cur_mat_end?this.finalizeCurrentMaterial():this._cur_obj&&this._byteData.position>=this._cur_obj_end&&(this._unfinalized_objects[this._cur_obj.name]=this._cur_obj,this._cur_obj_end=Number.MAX_VALUE,this._cur_obj=null),this._byteData.getBytesAvailable()>0){var cid,len,end;switch(cid=this._byteData.readUnsignedShort(),len=this._byteData.readUnsignedInt(),end=this._byteData.position+(len-6),cid){case 19789:case 15677:case 45056:continue;case 45055:this._cur_mat_end=end,this._cur_mat=this.parseMaterial();break;case 16384:this._cur_obj_end=end,this._cur_obj=new ObjectVO,this._cur_obj.name=this.readNulTermstring(),this._cur_obj.materials=new Array,this._cur_obj.materialFaces={};break;case 16640:this._cur_obj.type=away.library.AssetType.MESH;break;case 16656:this.parseVertexList();break;case 16672:this.parseFaceList();break;case 16704:this.parseUVList();break;case 16688:this.parseFaceMaterialList();break;case 16736:this._cur_obj.transform=this.readTransform();break;case 45058:this.parseObjectAnimation(end);break;case 16720:this.parseSmoothingGroups();break;default:this._byteData.position+=len-6}if(this.dependencies.length){this._pPauseAndRetrieveDependencies();break}}if(this._byteData.getBytesAvailable()||this._cur_obj||this._cur_mat)return parsers.ParserBase.MORE_TO_PARSE;var name;for(name in this._unfinalized_objects){var obj;obj=this.constructObject(this._unfinalized_objects[name]),obj&&(this._pContent.addChild(obj),this._pFinalizeAsset(obj,name))}return parsers.ParserBase.PARSING_DONE},Max3DSParser.prototype._pStartParsing=function(frameLimit){_super.prototype._pStartParsing.call(this,frameLimit),this._pContent=new away.containers.DisplayObjectContainer},Max3DSParser.prototype.parseMaterial=function(){var mat;for(mat=new MaterialVO;this._byteData.positioni;){var x,y,z;x=this._byteData.readFloat(),y=this._byteData.readFloat(),z=this._byteData.readFloat(),this._cur_obj.verts[i++]=x,this._cur_obj.verts[i++]=z,this._cur_obj.verts[i++]=y}},Max3DSParser.prototype.parseFaceList=function(){var i,len,count;for(count=this._byteData.readUnsignedShort(),this._cur_obj.indices=new Array(3*count),i=0,len=this._cur_obj.indices.length;len>i;){var i0,i1,i2;i0=this._byteData.readUnsignedShort(),i1=this._byteData.readUnsignedShort(),i2=this._byteData.readUnsignedShort(),this._cur_obj.indices[i++]=i0,this._cur_obj.indices[i++]=i2,this._cur_obj.indices[i++]=i1,this._byteData.position+=2}this._cur_obj.smoothingGroups=new Array(count)},Max3DSParser.prototype.parseSmoothingGroups=function(){for(var len=this._cur_obj.indices.length/3,i=0;len>i;)this._cur_obj.smoothingGroups[i]=this._byteData.readUnsignedInt(),i++},Max3DSParser.prototype.parseUVList=function(){var i,len,count;for(count=this._byteData.readUnsignedShort(),this._cur_obj.uvs=new Array(2*count),i=0,len=this._cur_obj.uvs.length;len>i;)this._cur_obj.uvs[i++]=this._byteData.readFloat(),this._cur_obj.uvs[i++]=1-this._byteData.readFloat()},Max3DSParser.prototype.parseFaceMaterialList=function(){var mat,count,i,faces;for(mat=this.readNulTermstring(),count=this._byteData.readUnsignedShort(),faces=new Array(count),i=0;i1&&console.log("The Away3D 3DS parser does not support multiple materials per mesh at this point."),!obj.indices||0==obj.indices.length)return null;for(vertices=new Array(obj.verts.length/3),faces=new Array(obj.indices.length/3),this.prepareData(vertices,faces,obj),this._useSmoothingGroups&&this.applySmoothGroups(vertices,faces),obj.verts=new Array(3*vertices.length),i=0;i0){var mname;mname=obj.materials[0],mat=this._materials[mname].material}if(pivot){if(obj.transform){var dat=obj.transform.concat();dat[12]=0,dat[13]=0,dat[14]=0,mtx=new away.geom.Matrix3D(dat),pivot=mtx.transformVector(pivot)}pivot.scaleBy(-1),mtx=new away.geom.Matrix3D,mtx.appendTranslation(pivot.x,pivot.y,pivot.z),geom.applyTransformation(mtx)}return obj.transform&&(mtx=new away.geom.Matrix3D(obj.transform),mtx.invert(),geom.applyTransformation(mtx)),this._pFinalizeAsset(geom,obj.name.concat("_geom")),mesh=new away.entities.Mesh(geom,mat),mesh.transform.matrix3D=new away.geom.Matrix3D(obj.transform),mesh}return null},Max3DSParser.prototype.prepareData=function(vertices,faces,obj){var i,j,k,len=obj.verts.length;for(i=0,j=0,k=0;len>i;){var v=new VertexVO;v.x=obj.verts[i++],v.y=obj.verts[i++],v.z=obj.verts[i++],obj.uvs&&(v.u=obj.uvs[j++],v.v=obj.uvs[j++]),vertices[k++]=v}for(len=obj.indices.length,i=0,k=0;len>i;){var f=new FaceVO;f.a=obj.indices[i++],f.b=obj.indices[i++],f.c=obj.indices[i++],f.smoothGroup=obj.smoothingGroups[k]||0,faces[k++]=f}},Max3DSParser.prototype.applySmoothGroups=function(vertices,faces){var i,j,k,l,len,numVerts=vertices.length,numFaces=faces.length,vGroups=new Array(numVerts);for(i=0;numVerts>i;i++)vGroups[i]=new Array;for(i=0;numFaces>i;i++){var face=faces[i];for(j=0;3>j;j++){var groups=vGroups[0==j?face.a:1==j?face.b:face.c],group=face.smoothGroup;for(k=groups.length-1;k>=0;k--)(group&groups[k])>0&&(group|=groups[k],groups.splice(k,1),k=groups.length-1);groups.push(group)}}var vClones=new Array(numVerts);for(i=0;numVerts>i;i++)if(!((len=vGroups[i].length)<1)){var clones=new Array(len);vClones[i]=clones,clones[0]=i;var v0=vertices[i];for(j=1;len>j;j++){var v1=new VertexVO;v1.x=v0.x,v1.y=v0.y,v1.z=v0.z,v1.u=v0.u,v1.v=v0.v,clones[j]=vertices.length,vertices.push(v1)}}for(numVerts=vertices.length,i=0;numFaces>i;i++)for(face=faces[i],group=face.smoothGroup,j=0;3>j;j++)for(k=0==j?face.a:1==j?face.b:face.c,groups=vGroups[k],len=groups.length,clones=vClones[k],l=0;len>l;l++)if(0==group&&0==groups[l]||(group&groups[l])>0){var index=clones[l];0==group&&(groups.splice(l,1),clones.splice(l,1)),0==j?face.a=index:1==j?face.b=index:face.c=index,l=len}},Max3DSParser.prototype.finalizeCurrentMaterial=function(){var mat;mat=this._cur_mat.colorMap?new TriangleMethodMaterial(this._cur_mat.colorMap.texture||DefaultMaterialManager.getDefaultTexture()):new TriangleMethodMaterial(this._cur_mat.ambientColor),mat.diffuseColor=this._cur_mat.diffuseColor,mat.specularColor=this._cur_mat.specularColor,this.materialMode>=2&&(mat.materialMode=TriangleMaterialMode.MULTI_PASS),mat.bothSides=this._cur_mat.twoSided,this._pFinalizeAsset(mat,this._cur_mat.name),this._materials[this._cur_mat.name]=this._cur_mat,this._cur_mat.material=mat,this._cur_mat=null},Max3DSParser.prototype.readNulTermstring=function(){for(var chr,str="";(chr=this._byteData.readUnsignedByte())>0;)str+=String.fromCharCode(chr);return str},Max3DSParser.prototype.readTransform=function(){var data;return data=new Array(16),data[0]=this._byteData.readFloat(),data[2]=this._byteData.readFloat(),data[1]=this._byteData.readFloat(),data[3]=0,data[8]=this._byteData.readFloat(),data[10]=this._byteData.readFloat(),data[9]=this._byteData.readFloat(),data[11]=0,data[4]=this._byteData.readFloat(),data[6]=this._byteData.readFloat(),data[5]=this._byteData.readFloat(),data[7]=0,data[12]=this._byteData.readFloat(),data[14]=this._byteData.readFloat(),data[13]=this._byteData.readFloat(),data[15]=1,data},Max3DSParser.prototype.readColor=function(){var cid,len,r,g,b;switch(cid=this._byteData.readUnsignedShort(),len=this._byteData.readUnsignedInt(),cid){case 16:r=255*this._byteData.readFloat(),g=255*this._byteData.readFloat(),b=255*this._byteData.readFloat();break;case 17:r=this._byteData.readUnsignedByte(),g=this._byteData.readUnsignedByte(),b=this._byteData.readUnsignedByte();break;default:this._byteData.position+=len-6}return r<<16|g<<8|b},Max3DSParser}(parsers.ParserBase);parsers.Max3DSParser=Max3DSParser}(away.parsers||(away.parsers={})),away.parsers}(away||(away={}));var Vector3D=away.geom.Vector3D,TextureVO=function(){function TextureVO(){}return TextureVO}(),MaterialVO=function(){function MaterialVO(){}return MaterialVO}(),ObjectVO=function(){function ObjectVO(){}return ObjectVO}(),VertexVO=function(){function VertexVO(){}return VertexVO}(),FaceVO=function(){function FaceVO(){}return FaceVO}(),away;!function(away){!function(parsers){var Geometry=away.base.Geometry,TriangleSubGeometry=away.base.TriangleSubGeometry,VertexAnimationSet=away.animators.VertexAnimationSet,VertexClipNode=away.animators.VertexClipNode,DefaultMaterialManager=away.materials.DefaultMaterialManager,TriangleMethodMaterial=away.materials.TriangleMethodMaterial,TriangleMaterialMode=away.materials.TriangleMaterialMode,URLLoaderDataFormat=away.net.URLLoaderDataFormat,MD2Parser=function(_super){function MD2Parser(textureType,ignoreTexturePath){"undefined"==typeof textureType&&(textureType="jpg"),"undefined"==typeof ignoreTexturePath&&(ignoreTexturePath=!0),_super.call(this,URLLoaderDataFormat.ARRAY_BUFFER),this._clipNodes=new Object,this._animationSet=new VertexAnimationSet,this.materialFinal=!1,this.geoCreated=!1,this._textureType=textureType,this._ignoreTexturePath=ignoreTexturePath}return __extends(MD2Parser,_super),MD2Parser.supportsType=function(extension){return extension=extension.toLowerCase(),"md2"==extension},MD2Parser.supportsData=function(data){return"IDP2"==parsers.ParserUtils.toString(data,4)},MD2Parser.prototype._iResolveDependency=function(resourceDependency){if(1==resourceDependency.assets.length){var asset=resourceDependency.assets[0];if(asset){var material=new TriangleMethodMaterial(asset);this.materialMode>=2&&(material.materialMode=TriangleMaterialMode.MULTI_PASS),this._pContent.addChild(this._mesh),material.name=this._mesh.material.name,this._mesh.material=material,this._pFinalizeAsset(material),this._pFinalizeAsset(this._mesh.geometry),this._pFinalizeAsset(this._mesh)}this.materialFinal=!0}},MD2Parser.prototype._iResolveDependencyFailure=function(){this.materialMode<2?this._mesh.material=DefaultMaterialManager.getDefaultMaterial():(this._mesh.material=new TriangleMethodMaterial(away.materials.DefaultMaterialManager.getDefaultTexture()),this._mesh.material.materialMode=TriangleMaterialMode.MULTI_PASS),this._pContent.addChild(this._mesh),this._pFinalizeAsset(this._mesh.geometry),this._pFinalizeAsset(this._mesh),this.materialFinal=!0},MD2Parser.prototype._pProceedParsing=function(){for(this._startedParsing||(this._byteData=this._pGetByteData(),this._startedParsing=!0,this._byteData.position=0);this._pHasTime();)if(this._parsedHeader)if(this._parsedUV)if(this._parsedFaces)if(this._parsedFrames){if(this.geoCreated&&this.materialFinal)return away.parsers.ParserBase.PARSING_DONE;this.geoCreated||(this.geoCreated=!0,this._geometry.addSubGeometry(this._firstSubGeom.clone()),this._mesh.name="",this.materialFinal&&(this._pContent.addChild(this._mesh),this._pFinalizeAsset(this._mesh.geometry),this._pFinalizeAsset(this._mesh)),this._pPauseAndRetrieveDependencies())}else this.parseFrames();else this.parseFaces();else this.parseUV();else this._geometry=new Geometry,this._mesh=new away.entities.Mesh(this._geometry,null),this.materialMode<2?this._mesh.material=DefaultMaterialManager.getDefaultMaterial():(this._mesh.material=new TriangleMethodMaterial(DefaultMaterialManager.getDefaultTexture()),this._mesh.material.materialMode=TriangleMaterialMode.MULTI_PASS),this.parseHeader(),this.parseMaterialNames();return away.parsers.ParserBase.MORE_TO_PARSE},MD2Parser.prototype._pStartParsing=function(frameLimit){_super.prototype._pStartParsing.call(this,frameLimit),this._pContent=new away.containers.DisplayObjectContainer},MD2Parser.prototype.parseHeader=function(){this._ident=this._byteData.readInt(),this._version=this._byteData.readInt(),this._skinWidth=this._byteData.readInt(),this._skinHeight=this._byteData.readInt(),this._byteData.readInt(),this._numSkins=this._byteData.readInt(),this._numVertices=this._byteData.readInt(),this._numST=this._byteData.readInt(),this._numTris=this._byteData.readInt(),this._byteData.readInt(),this._numFrames=this._byteData.readInt(),this._offsetSkins=this._byteData.readInt(),this._offsetST=this._byteData.readInt(),this._offsetTris=this._byteData.readInt(),this._offsetFrames=this._byteData.readInt(),this._byteData.readInt(),this._offsetEnd=this._byteData.readInt(),this._parsedHeader=!0},MD2Parser.prototype.parseMaterialNames=function(){var url,name,extIndex,slashIndex;this._materialNames=new Array,this._byteData.position=this._offsetSkins;for(var regExp=new RegExp("[^a-zA-Z0-9\\_/.]","g"),i=0;i0?this._mesh.material.name=this._materialNames[0]:this.materialFinal=!0},MD2Parser.prototype.parseUV=function(){var j=0;this._uvs=new Array(2*this._numST),this._byteData.position=this._offsetST;for(var i=0;ii;++i)this._finalUV[i<<1]=this._uvs[this._uvIndices[i]<<1],this._finalUV[(i<<1)+1]=this._uvs[(this._uvIndices[i]<<1)+1];this._parsedFaces=!0},MD2Parser.prototype.addIndex=function(vertexIndex,uvIndex){var index=this.findIndex(vertexIndex,uvIndex);-1==index?(this._indices.push(this._vertIndices.length),this._vertIndices.push(vertexIndex),this._uvIndices.push(uvIndex)):this._indices.push(index)},MD2Parser.prototype.findIndex=function(vertexIndex,uvIndex){for(var len=this._vertIndices.length,i=0;len>i;++i)if(this._vertIndices[i]==vertexIndex&&this._uvIndices[i]==uvIndex)return i;return-1},MD2Parser.prototype.parseFrames=function(){var sx,sy,sz,tx,ty,tz,geometry,subGeom,fvertices,tvertices,i,j,k,vertLen=this._vertIndices.length,name="",prevClip=null;for(this._byteData.position=this._offsetFrames,i=0;ij;j++)fvertices[k++]=tvertices[3*this._vertIndices[j]],fvertices[k++]=tvertices[3*this._vertIndices[j]+2],fvertices[k++]=tvertices[3*this._vertIndices[j]+1];subGeom=new TriangleSubGeometry(!0),null==this._firstSubGeom&&(this._firstSubGeom=subGeom),geometry=new Geometry,geometry.addSubGeometry(subGeom),subGeom.updateIndices(this._indices),subGeom.updatePositions(fvertices),subGeom.updateUVs(this._finalUV),subGeom.vertexNormals,subGeom.vertexTangents,subGeom.autoDeriveNormals=!1,subGeom.autoDeriveTangents=!1;var clip=this._clipNodes[name];clip||(prevClip&&(this._pFinalizeAsset(prevClip),this._animationSet.addAnimation(prevClip)),clip=new VertexClipNode,clip.name=name,clip.stitchFinalFrame=!0,this._clipNodes[name]=clip,prevClip=clip),clip.addFrame(geometry,1e3/away.parsers.MD2Parser.FPS)}prevClip&&(this._pFinalizeAsset(prevClip),this._animationSet.addAnimation(prevClip)),this._pFinalizeAsset(this._animationSet),this._parsedFrames=!0},MD2Parser.prototype.readFrameName=function(){for(var name="",k=0,j=0;16>j;j++){var ch=this._byteData.readUnsignedByte();Math.floor(ch)>57&&Math.floor(ch)<=122&&0==k&&(name+=String.fromCharCode(ch)),Math.floor(ch)>=48&&Math.floor(ch)<=57&&k++}return name},MD2Parser.FPS=6,MD2Parser}(parsers.ParserBase);parsers.MD2Parser=MD2Parser}(away.parsers||(away.parsers={})),away.parsers}(away||(away={}));var away;!function(away){!function(parsers){var JointPose=away.animators.JointPose,SkeletonPose=away.animators.SkeletonPose,SkeletonClipNode=away.animators.SkeletonClipNode,Quaternion=away.geom.Quaternion,Vector3D=away.geom.Vector3D,URLLoaderDataFormat=away.net.URLLoaderDataFormat,MD5AnimParser=function(_super){function MD5AnimParser(additionalRotationAxis,additionalRotationRadians){"undefined"==typeof additionalRotationAxis&&(additionalRotationAxis=null),"undefined"==typeof additionalRotationRadians&&(additionalRotationRadians=0),_super.call(this,URLLoaderDataFormat.TEXT),this._parseIndex=0,this._line=0,this._charLineIndex=0,this._rotationQuat=new Quaternion;var t1=new Quaternion,t2=new Quaternion;t1.fromAxisAngle(Vector3D.X_AXIS,.5*-Math.PI),t2.fromAxisAngle(Vector3D.Y_AXIS,.5*-Math.PI),this._rotationQuat.multiply(t2,t1),additionalRotationAxis&&(this._rotationQuat.multiply(t2,t1),t1.fromAxisAngle(additionalRotationAxis,additionalRotationRadians),this._rotationQuat.multiply(t1,this._rotationQuat))}return __extends(MD5AnimParser,_super),MD5AnimParser.supportsType=function(extension){return extension=extension.toLowerCase(),"md5anim"==extension},MD5AnimParser.supportsData=function(){return!1},MD5AnimParser.prototype._pProceedParsing=function(){var token;for(this._startedParsing||(this._textData=this._pGetTextData(),this._startedParsing=!0);this._pHasTime();){switch(token=this.getNextToken()){case MD5AnimParser.COMMENT_TOKEN:this.ignoreLine();break;case"":break;case MD5AnimParser.VERSION_TOKEN:if(this._version=this.getNextInt(),10!=this._version)throw new Error("Unknown version number encountered!");break;case MD5AnimParser.COMMAND_LINE_TOKEN:this.parseCMD();break;case MD5AnimParser.NUM_FRAMES_TOKEN:this._numFrames=this.getNextInt(),this._bounds=new Array,this._frameData=new Array;break;case MD5AnimParser.NUM_JOINTS_TOKEN:this._numJoints=this.getNextInt(),this._hierarchy=new Array(this._numJoints),this._baseFrameData=new Array(this._numJoints);break;case MD5AnimParser.FRAME_RATE_TOKEN:this._frameRate=this.getNextInt();break;case MD5AnimParser.NUM_ANIMATED_COMPONENTS_TOKEN:this._numAnimatedComponents=this.getNextInt();break;case MD5AnimParser.HIERARCHY_TOKEN:this.parseHierarchy();break;case MD5AnimParser.BOUNDS_TOKEN:this.parseBounds();break;case MD5AnimParser.BASE_FRAME_TOKEN:this.parseBaseFrame();break;case MD5AnimParser.FRAME_TOKEN:this.parseFrame();break;default:this._reachedEOF||this.sendUnknownKeywordError()}if(this._reachedEOF)return this._clip=new SkeletonClipNode,this.translateClip(),this._pFinalizeAsset(this._clip),parsers.ParserBase.PARSING_DONE}return parsers.ParserBase.MORE_TO_PARSE},MD5AnimParser.prototype.translateClip=function(){for(var i=0;iw?0:-Math.sqrt(w),hierarchy.parentIndex<0?(pose.orientation.multiply(this._rotationQuat,orientation),pose.translation=this._rotationQuat.rotatePoint(translate)):(pose.orientation.copyFrom(orientation),pose.translation.x=translate.x,pose.translation.y=translate.y,pose.translation.z=translate.z),pose.orientation.y=-pose.orientation.y,pose.orientation.z=-pose.orientation.z,pose.translation.x=-pose.translation.x,jointPoses[i]=pose}return skelPose},MD5AnimParser.prototype.parseHierarchy=function(){var ch,data,token=this.getNextToken(),i=0;"{"!=token&&this.sendUnknownKeywordError();do this._reachedEOF&&this.sendEOFError(),data=new HierarchyData,data.name=this.parseLiteralstring(),data.parentIndex=this.getNextInt(),data.flags=this.getNextInt(),data.startIndex=this.getNextInt(),this._hierarchy[i++]=data,ch=this.getNextChar(),"/"==ch&&(this.putBack(),ch=this.getNextToken(),ch==MD5AnimParser.COMMENT_TOKEN&&this.ignoreLine(),ch=this.getNextChar()),"}"!=ch&&this.putBack();while("}"!=ch)},MD5AnimParser.prototype.parseBounds=function(){var ch,data,token=this.getNextToken(),i=0;"{"!=token&&this.sendUnknownKeywordError();do this._reachedEOF&&this.sendEOFError(),data=new BoundsData,data.min=this.parseVector3D(),data.max=this.parseVector3D(),this._bounds[i++]=data,ch=this.getNextChar(),"/"==ch&&(this.putBack(),ch=this.getNextToken(),ch==MD5AnimParser.COMMENT_TOKEN&&this.ignoreLine(),ch=this.getNextChar()),"}"!=ch&&this.putBack();while("}"!=ch)},MD5AnimParser.prototype.parseBaseFrame=function(){var ch,data,token=this.getNextToken(),i=0;"{"!=token&&this.sendUnknownKeywordError();do this._reachedEOF&&this.sendEOFError(),data=new BaseFrameData,data.position=this.parseVector3D(),data.orientation=this.parseQuaternion(),this._baseFrameData[i++]=data,ch=this.getNextChar(),"/"==ch&&(this.putBack(),ch=this.getNextToken(),ch==MD5AnimParser.COMMENT_TOKEN&&this.ignoreLine(),ch=this.getNextChar()),"}"!=ch&&this.putBack();while("}"!=ch)},MD5AnimParser.prototype.parseFrame=function(){var ch,data,token,frameIndex;frameIndex=this.getNextInt(),token=this.getNextToken(),"{"!=token&&this.sendUnknownKeywordError();do{this._reachedEOF&&this.sendEOFError(),data=new FrameData,data.components=new Array(this._numAnimatedComponents);for(var i=0;i=this._textData.length},MD5AnimParser.prototype.getNextToken=function(){for(var ch,token="";!this._reachedEOF;){if(ch=this.getNextChar()," "==ch||"\r"==ch||"\n"==ch||" "==ch){if(token!=MD5AnimParser.COMMENT_TOKEN&&this.skipWhiteSpace(),""!=token)return token}else token+=ch;if(token==MD5AnimParser.COMMENT_TOKEN)return token}return token},MD5AnimParser.prototype.skipWhiteSpace=function(){var ch;do ch=this.getNextChar();while("\n"==ch||" "==ch||"\r"==ch||" "==ch);this.putBack()},MD5AnimParser.prototype.ignoreLine=function(){for(var ch;!this._reachedEOF&&"\n"!=ch;)ch=this.getNextChar()},MD5AnimParser.prototype.getNextChar=function(){var ch=this._textData.charAt(this._parseIndex++);return"\n"==ch?(++this._line,this._charLineIndex=0):"\r"!=ch&&++this._charLineIndex,this._parseIndex==this._textData.length&&(this._reachedEOF=!0),ch},MD5AnimParser.prototype.getNextInt=function(){var i=parseInt(this.getNextToken());return isNaN(i)&&this.sendParseError("int type"),i},MD5AnimParser.prototype.getNextNumber=function(){var f=parseFloat(this.getNextToken());return isNaN(f)&&this.sendParseError("float type"),f},MD5AnimParser.prototype.parseVector3D=function(){var vec=new Vector3D,ch=this.getNextToken();return"("!=ch&&this.sendParseError("("),vec.x=this.getNextNumber(),vec.y=this.getNextNumber(),vec.z=this.getNextNumber(),")"!=this.getNextToken()&&this.sendParseError(")"),vec},MD5AnimParser.prototype.parseQuaternion=function(){var quat=new Quaternion,ch=this.getNextToken();"("!=ch&&this.sendParseError("("),quat.x=this.getNextNumber(),quat.y=this.getNextNumber(),quat.z=this.getNextNumber();var t=1-quat.x*quat.x-quat.y*quat.y-quat.z*quat.z;return quat.w=0>t?0:-Math.sqrt(t),")"!=this.getNextToken()&&this.sendParseError(")"),quat},MD5AnimParser.prototype.parseCMD=function(){this.parseLiteralstring()},MD5AnimParser.prototype.parseLiteralstring=function(){this.skipWhiteSpace();var ch=this.getNextChar(),str="";'"'!=ch&&this.sendParseError('"');do this._reachedEOF&&this.sendEOFError(),ch=this.getNextChar(),'"'!=ch&&(str+=ch);while('"'!=ch);return str},MD5AnimParser.prototype.sendEOFError=function(){throw new Error("Unexpected end of file")},MD5AnimParser.prototype.sendParseError=function(expected){throw new Error("Unexpected token at line "+(this._line+1)+", character "+this._charLineIndex+". "+expected+" expected, but "+this._textData.charAt(this._parseIndex-1)+" encountered")},MD5AnimParser.prototype.sendUnknownKeywordError=function(){throw new Error("Unknown keyword at line "+(this._line+1)+", character "+this._charLineIndex+". ")},MD5AnimParser.VERSION_TOKEN="MD5Version",MD5AnimParser.COMMAND_LINE_TOKEN="commandline",MD5AnimParser.NUM_FRAMES_TOKEN="numFrames",MD5AnimParser.NUM_JOINTS_TOKEN="numJoints",MD5AnimParser.FRAME_RATE_TOKEN="frameRate",MD5AnimParser.NUM_ANIMATED_COMPONENTS_TOKEN="numAnimatedComponents",MD5AnimParser.HIERARCHY_TOKEN="hierarchy",MD5AnimParser.BOUNDS_TOKEN="bounds",MD5AnimParser.BASE_FRAME_TOKEN="baseframe",MD5AnimParser.FRAME_TOKEN="frame",MD5AnimParser.COMMENT_TOKEN="//",MD5AnimParser}(parsers.ParserBase);parsers.MD5AnimParser=MD5AnimParser}(away.parsers||(away.parsers={})),away.parsers}(away||(away={}));var HierarchyData=function(){function HierarchyData(){}return HierarchyData.prototype.HierarchyData=function(){},HierarchyData}(),BoundsData=function(){function BoundsData(){}return BoundsData.prototype.BoundsData=function(){},BoundsData}(),BaseFrameData=function(){function BaseFrameData(){}return BaseFrameData.prototype.BaseFrameData=function(){},BaseFrameData}(),FrameData=function(){function FrameData(){}return FrameData.prototype.FrameData=function(){},FrameData}(),away;!function(away){!function(parsers){var SkeletonAnimationSet=away.animators.SkeletonAnimationSet,Skeleton=away.animators.Skeleton,SkeletonJoint=away.animators.SkeletonJoint,Geometry=away.base.Geometry,TriangleSubGeometry=away.base.TriangleSubGeometry,Quaternion=away.geom.Quaternion,Vector3D=away.geom.Vector3D,Mesh=away.entities.Mesh,URLLoaderDataFormat=away.net.URLLoaderDataFormat,MD5MeshParser=function(_super){function MD5MeshParser(additionalRotationAxis,additionalRotationRadians){if("undefined"==typeof additionalRotationAxis&&(additionalRotationAxis=null),"undefined"==typeof additionalRotationRadians&&(additionalRotationRadians=0),_super.call(this,URLLoaderDataFormat.TEXT),this._parseIndex=0,this._line=0,this._charLineIndex=0,this._rotationQuat=new Quaternion,this._rotationQuat.fromAxisAngle(Vector3D.X_AXIS,.5*-Math.PI),additionalRotationAxis){var quat=new Quaternion;quat.fromAxisAngle(additionalRotationAxis,additionalRotationRadians),this._rotationQuat.multiply(this._rotationQuat,quat)}}return __extends(MD5MeshParser,_super),MD5MeshParser.supportsType=function(extension){return extension=extension.toLowerCase(),"md5mesh"==extension},MD5MeshParser.supportsData=function(){return!1},MD5MeshParser.prototype._pProceedParsing=function(){var token;for(this._startedParsing||(this._textData=this._pGetTextData(),this._startedParsing=!0);this._pHasTime();){switch(token=this.getNextToken()){case MD5MeshParser.COMMENT_TOKEN:this.ignoreLine();break;case MD5MeshParser.VERSION_TOKEN:if(this._version=this.getNextInt(),10!=this._version)throw new Error("Unknown version number encountered!");break;case MD5MeshParser.COMMAND_LINE_TOKEN:this.parseCMD();break;case MD5MeshParser.NUM_JOINTS_TOKEN:this._numJoints=this.getNextInt(),this._bindPoses=new Array(this._numJoints);break;case MD5MeshParser.NUM_MESHES_TOKEN:this._numMeshes=this.getNextInt();break;case MD5MeshParser.JOINTS_TOKEN:this.parseJoints();break;case MD5MeshParser.MESH_TOKEN:this.parseMesh();break;default:this._reachedEOF||this.sendUnknownKeywordError()}if(this._reachedEOF){this.calculateMaxJointCount(),this._animationSet=new SkeletonAnimationSet(this._maxJointCount),this._mesh=new Mesh(new Geometry,null),this._geometry=this._mesh.geometry;for(var i=0;ii;++i)for(var meshData=this._meshData[i],vertexData=meshData.vertexData,numVerts=vertexData.length,j=0;numVerts>j;++j){var zeroWeights=this.countZeroWeightJoints(vertexData[j],meshData.weightData),totalJoints=vertexData[j].countWeight-zeroWeights;totalJoints>this._maxJointCount&&(this._maxJointCount=totalJoints)}},MD5MeshParser.prototype.countZeroWeightJoints=function(vertex,weights){for(var weight,start=vertex.startWeight,end=vertex.startWeight+vertex.countWeight,count=0,i=start;end>i;++i)weight=weights[i].bias,0==weight&&++count;return count},MD5MeshParser.prototype.parseJoints=function(){var ch,joint,pos,quat,i=0,token=this.getNextToken();"{"!=token&&this.sendUnknownKeywordError(),this._skeleton=new Skeleton;do{this._reachedEOF&&this.sendEOFError(),joint=new SkeletonJoint,joint.name=this.parseLiteralstring(),joint.parentIndex=this.getNextInt(),pos=this.parseVector3D(),pos=this._rotationQuat.rotatePoint(pos),quat=this.parseQuaternion(),this._bindPoses[i]=quat.toMatrix3D(),this._bindPoses[i].appendTranslation(pos.x,pos.y,pos.z);var inv=this._bindPoses[i].clone();inv.invert(),joint.inverseBindPose=inv.rawData,this._skeleton.joints[i++]=joint,ch=this.getNextChar(),"/"==ch&&(this.putBack(),ch=this.getNextToken(),ch==MD5MeshParser.COMMENT_TOKEN&&this.ignoreLine(),ch=this.getNextChar()),"}"!=ch&&this.putBack()}while("}"!=ch)},MD5MeshParser.prototype.putBack=function(){this._parseIndex--,this._charLineIndex--,this._reachedEOF=this._parseIndex>=this._textData.length},MD5MeshParser.prototype.parseMesh=function(){var ch,vertexData,weights,indices,token=this.getNextToken();for("{"!=token&&this.sendUnknownKeywordError(),null==this._shaders&&(this._shaders=new Array);"}"!=ch;)switch(ch=this.getNextToken()){case MD5MeshParser.COMMENT_TOKEN:this.ignoreLine();break;case MD5MeshParser.MESH_SHADER_TOKEN:this._shaders.push(this.parseLiteralstring());break;case MD5MeshParser.MESH_NUM_VERTS_TOKEN:vertexData=new Array(this.getNextInt());break;case MD5MeshParser.MESH_NUM_TRIS_TOKEN:indices=new Array(3*this.getNextInt());break;case MD5MeshParser.MESH_NUM_WEIGHTS_TOKEN:weights=new Array(this.getNextInt());break;case MD5MeshParser.MESH_VERT_TOKEN:this.parseVertex(vertexData);break;case MD5MeshParser.MESH_TRI_TOKEN:this.parseTri(indices);break;case MD5MeshParser.MESH_WEIGHT_TOKEN:this.parseJoint(weights)}null==this._meshData&&(this._meshData=new Array);var i=this._meshData.length;this._meshData[i]=new MeshData,this._meshData[i].vertexData=vertexData,this._meshData[i].weightData=weights,this._meshData[i].indices=indices},MD5MeshParser.prototype.translateGeom=function(vertexData,weights,indices){for(var v1,v2,v3,vertex,weight,bindPose,pos,nonZeroWeights,len=vertexData.length,subGeom=new TriangleSubGeometry(!0),uvs=new Array(2*len),vertices=new Array(3*len),jointIndices=new Array(len*this._maxJointCount),jointWeights=new Array(len*this._maxJointCount),l=0,i=0;len>i;++i){vertex=vertexData[i],v1=3*vertex.index,v2=v1+1,v3=v1+2,vertices[v1]=vertices[v2]=vertices[v3]=0,nonZeroWeights=0;for(var j=0;j0&&(bindPose=this._bindPoses[weight.joint],pos=bindPose.transformVector(weight.pos),vertices[v1]+=pos.x*weight.bias,vertices[v2]+=pos.y*weight.bias,vertices[v3]+=pos.z*weight.bias,jointIndices[l]=3*weight.joint,jointWeights[l++]=weight.bias,++nonZeroWeights);for(j=nonZeroWeights;j=this._textData.length&&(this._reachedEOF=!0),ch},MD5MeshParser.prototype.getNextInt=function(){var i=parseInt(this.getNextToken());return isNaN(i)&&this.sendParseError("int type"),i},MD5MeshParser.prototype.getNextNumber=function(){var f=parseFloat(this.getNextToken());return isNaN(f)&&this.sendParseError("float type"),f},MD5MeshParser.prototype.parseVector3D=function(){var vec=new Vector3D,ch=this.getNextToken();return"("!=ch&&this.sendParseError("("),vec.x=-this.getNextNumber(),vec.y=this.getNextNumber(),vec.z=this.getNextNumber(),")"!=this.getNextToken()&&this.sendParseError(")"),vec},MD5MeshParser.prototype.parseQuaternion=function(){var quat=new Quaternion,ch=this.getNextToken();"("!=ch&&this.sendParseError("("),quat.x=this.getNextNumber(),quat.y=-this.getNextNumber(),quat.z=-this.getNextNumber();var t=1-quat.x*quat.x-quat.y*quat.y-quat.z*quat.z;quat.w=0>t?0:-Math.sqrt(t),")"!=this.getNextToken()&&this.sendParseError(")");var rotQuat=new Quaternion;return rotQuat.multiply(this._rotationQuat,quat),rotQuat},MD5MeshParser.prototype.parseCMD=function(){this.parseLiteralstring()},MD5MeshParser.prototype.parseLiteralstring=function(){this.skipWhiteSpace();var ch=this.getNextChar(),str="";'"'!=ch&&this.sendParseError('"');do this._reachedEOF&&this.sendEOFError(),ch=this.getNextChar(),'"'!=ch&&(str+=ch);while('"'!=ch);return str},MD5MeshParser.prototype.sendEOFError=function(){throw new Error("Unexpected end of file")},MD5MeshParser.prototype.sendParseError=function(expected){throw new Error("Unexpected token at line "+(this._line+1)+", character "+this._charLineIndex+". "+expected+" expected, but "+this._textData.charAt(this._parseIndex-1)+" encountered")},MD5MeshParser.prototype.sendUnknownKeywordError=function(){throw new Error("Unknown keyword at line "+(this._line+1)+", character "+this._charLineIndex+". ")},MD5MeshParser.VERSION_TOKEN="MD5Version",MD5MeshParser.COMMAND_LINE_TOKEN="commandline",MD5MeshParser.NUM_JOINTS_TOKEN="numJoints",MD5MeshParser.NUM_MESHES_TOKEN="numMeshes",MD5MeshParser.COMMENT_TOKEN="//",MD5MeshParser.JOINTS_TOKEN="joints",MD5MeshParser.MESH_TOKEN="mesh",MD5MeshParser.MESH_SHADER_TOKEN="shader",MD5MeshParser.MESH_NUM_VERTS_TOKEN="numverts",MD5MeshParser.MESH_VERT_TOKEN="vert",MD5MeshParser.MESH_NUM_TRIS_TOKEN="numtris",MD5MeshParser.MESH_TRI_TOKEN="tri",MD5MeshParser.MESH_NUM_WEIGHTS_TOKEN="numweights",MD5MeshParser.MESH_WEIGHT_TOKEN="weight",MD5MeshParser}(parsers.ParserBase);parsers.MD5MeshParser=MD5MeshParser}(away.parsers||(away.parsers={})),away.parsers}(away||(away={}));var VertexData=function(){function VertexData(){}return VertexData}(),JointData=function(){function JointData(){}return JointData}(),MeshData=function(){function MeshData(){}return MeshData}(),away;!function(away){!function(parsers){var AssetLoader=away.library.AssetLoader,Parsers=function(){function Parsers(){}return Parsers.enableAllBundled=function(){AssetLoader.enableParsers(Parsers.ALL_BUNDLED)},Parsers.ALL_BUNDLED=Array(parsers.AWDParser,parsers.Max3DSParser,parsers.MD2Parser,parsers.OBJParser),Parsers}();parsers.Parsers=Parsers}(away.parsers||(away.parsers={})),away.parsers}(away||(away={}));var away;!function(away){!function(commands){var Geometry=away.base.Geometry,TriangleSubGeometry=away.base.TriangleSubGeometry,Matrix3DUtils=away.geom.Matrix3DUtils,Mesh=away.entities.Mesh,Merge=function(){function Merge(keepMaterial,disposeSources,objectSpace){"undefined"==typeof keepMaterial&&(keepMaterial=!1),"undefined"==typeof disposeSources&&(disposeSources=!1),"undefined"==typeof objectSpace&&(objectSpace=!1),this._keepMaterial=keepMaterial,this._disposeSources=disposeSources,this._objectSpace=objectSpace}return Object.defineProperty(Merge.prototype,"disposeSources",{get:function(){return this._disposeSources},set:function(b){this._disposeSources=b},enumerable:!0,configurable:!0}),Object.defineProperty(Merge.prototype,"keepMaterial",{get:function(){return this._keepMaterial},set:function(b){this._keepMaterial=b},enumerable:!0,configurable:!0}),Object.defineProperty(Merge.prototype,"objectSpace",{get:function(){return this._objectSpace},set:function(b){this._objectSpace=b},enumerable:!0,configurable:!0}),Merge.prototype.applyToContainer=function(receiver,objectContainer){this.reset(),this.parseContainer(receiver,objectContainer),this.collect(receiver,!1),this.merge(receiver,this._disposeSources)},Merge.prototype.applyToMeshes=function(receiver,meshes){if(this.reset(),meshes.length){for(var i=0;i1,i=0;ii;i++)m=this._toDispose[i],m.geometry.dispose(),m.dispose();oldGeom.dispose()}this._toDispose=null},Merge.prototype.collect=function(mesh,dispose){if(mesh.geometry){var subIdx,calc,subGeometries=mesh.geometry.subGeometries;for(subIdx=0;subIdxi;i++)calc=3*i,vertices[vIdx++]=pd[calc],vertices[vIdx++]=pd[calc+1],vertices[vIdx++]=pd[calc+2],normals[nIdx++]=nd[calc],normals[nIdx++]=nd[calc+1],normals[nIdx++]=nd[calc+2],tangents[tIdx++]=td[calc],tangents[tIdx++]=td[calc+1],tangents[tIdx++]=td[calc+2],vo.uvs[uIdx++]=ud[2*i],vo.uvs[uIdx++]=ud[2*i+1];for(indexOffset=this._objectSpace?0:vo.vertices.length/3,iIdx=vo.indices.length,len=subGeom.numTriangles,i=0;len>i;i++)calc=3*i,vo.indices[iIdx++]=subGeom.indices[calc]+indexOffset,vo.indices[iIdx++]=subGeom.indices[calc+1]+indexOffset,vo.indices[iIdx++]=subGeom.indices[calc+2]+indexOffset;if(!this._objectSpace)for(mesh.sceneTransform.transformVectors(vertices,vertices),Matrix3DUtils.deltaTransformVectors(mesh.sceneTransform,normals,normals),Matrix3DUtils.deltaTransformVectors(mesh.sceneTransform,tangents,tangents),vIdx=vo.vertices.length,nIdx=vo.normals.length,tIdx=vo.tangents.length,len=vertices.length,i=0;len>i;i++)vo.vertices[vIdx++]=vertices[i],vo.normals[nIdx++]=normals[i],vo.tangents[tIdx++]=tangents[i]}dispose&&this._toDispose.push(mesh)}},Merge.prototype.getSubGeomData=function(material){var data;if(this._keepMaterial){var i,len;for(len=this._geomVOs.length,i=0;len>i;i++)if(this._geomVOs[i].material==material){data=this._geomVOs[i];break}}else this._geomVOs.length&&(data=this._geomVOs[0]);return data||(data=new GeometryVO,data.vertices=new Array,data.normals=new Array,data.tangents=new Array,data.uvs=new Array,data.indices=new Array,data.material=material,this._geomVOs.push(data)),data},Merge.prototype.parseContainer=function(receiver,object){var child,i;for(object instanceof Mesh&&object!=receiver&&this.collect(object,this._disposeSources),i=0;ii;i++){sourceSubGeometries=geometries[i].subGeometries,numSubGeometries=sourceSubGeometries.length;for(var srcIndex=0;numSubGeometries>srcIndex;srcIndex++){sub2SubMap.length<=srcIndex&&(sub2SubMap.push(subGeometries.length),indicesVector.push(new Array),positionsVector.push(new Array),normalsVector.push(new Array),tangentsVector.push(new Array),uvsVector.push(new Array),subGeometries.push(new TriangleSubGeometry(!0)),vertexCounters.push(0)),sourceSubGeometry=sourceSubGeometries[srcIndex],sourceSubGeometry.numVertices+vertexCounters[sub2SubMap[srcIndex]]>ParticleGeometryHelper.MAX_VERTEX&&(sub2SubMap[srcIndex]=subGeometries.length,indicesVector.push(new Array),positionsVector.push(new Array),normalsVector.push(new Array),tangentsVector.push(new Array),uvsVector.push(new Array),subGeometries.push(new TriangleSubGeometry(!0)),vertexCounters.push(0)),j=sub2SubMap[srcIndex],indices=indicesVector[j],positions=positionsVector[j],normals=normalsVector[j],tangents=tangentsVector[j],uvs=uvsVector[j],vertexCounter=vertexCounters[j],subGeometry=subGeometries[j];var particleData=new ParticleData;particleData.numVertices=sourceSubGeometry.numVertices,particleData.startVertexIndex=vertexCounter,particleData.particleIndex=i,particleData.subGeometry=subGeometry,particles.push(particleData),vertexCounters[j]+=sourceSubGeometry.numVertices;var k,tempLen,product,sourcePositions,sourceNormals,sourceTangents,sourceUVs,compact=sourceSubGeometry;if(compact)if(tempLen=compact.numVertices,compact.numTriangles,sourcePositions=compact.positions,sourceNormals=compact.vertexNormals,sourceTangents=compact.vertexTangents,sourceUVs=compact.uvs,transforms){var particleGeometryTransform=transforms[i],vertexTransform=particleGeometryTransform.vertexTransform,invVertexTransform=particleGeometryTransform.invVertexTransform,UVTransform=particleGeometryTransform.UVTransform; -for(k=0;tempLen>k;k++)product=3*k,tempVertex.x=sourcePositions[product],tempVertex.y=sourcePositions[product+1],tempVertex.z=sourcePositions[product+2],tempNormal.x=sourceNormals[product],tempNormal.y=sourceNormals[product+1],tempNormal.z=sourceNormals[product+2],tempTangents.x=sourceTangents[product],tempTangents.y=sourceTangents[product+1],tempTangents.z=sourceTangents[product+2],tempUV.x=sourceUVs[2*k],tempUV.y=sourceUVs[2*k+1],vertexTransform&&(tempVertex=vertexTransform.transformVector(tempVertex),tempNormal=invVertexTransform.deltaTransformVector(tempNormal),tempTangents=invVertexTransform.deltaTransformVector(tempNormal)),UVTransform&&(tempUV=UVTransform.transformPoint(tempUV)),sourcePositions.push(tempVertex.x,tempVertex.y,tempVertex.z),sourceNormals.push(tempNormal.x,tempNormal.y,tempNormal.z),sourceTangents.push(tempTangents.x,tempTangents.y,tempTangents.z),sourceUVs.push(tempUV.x,tempUV.y)}else for(k=0;tempLen>k;k++)product=3*k,positions.push(sourcePositions[product],sourcePositions[product+1],sourcePositions[product+2]),normals.push(sourceNormals[product],sourceNormals[product+1],sourceNormals[product+2]),tangents.push(sourceTangents[product],sourceTangents[product+1],sourceTangents[product+2]),uvs.push(sourceUVs[2*k],sourceUVs[2*k+1]);var sourceIndices=sourceSubGeometry.indices;for(tempLen=sourceSubGeometry.numTriangles,k=0;tempLen>k;k++)product=3*k,indices.push(sourceIndices[product]+vertexCounter,sourceIndices[product+1]+vertexCounter,sourceIndices[product+2]+vertexCounter)}}var particleGeometry=new ParticleGeometry;for(particleGeometry.particles=particles,particleGeometry.numParticles=numParticles,numParticles=subGeometries.length,i=0;numParticles>i;i++)subGeometry=subGeometries[i],subGeometry.autoDeriveNormals=!1,subGeometry.autoDeriveTangents=!1,subGeometry.updateIndices(indicesVector[i]),subGeometry.updatePositions(positionsVector[i]),subGeometry.updateVertexNormals(normalsVector[i]),subGeometry.updateVertexTangents(tangentsVector[i]),subGeometry.updateUVs(uvsVector[i]),particleGeometry.addSubGeometry(subGeometry);return particleGeometry},ParticleGeometryHelper.MAX_VERTEX=65535,ParticleGeometryHelper}();tools.ParticleGeometryHelper=ParticleGeometryHelper}(away.tools||(away.tools={})),away.tools}(away||(away={})),away.Debug.THROW_ERRORS=!1,away.Debug.LOG_PI_ERRORS=!1;var away;!function(away){var StageGLRenderer=function(_super){function StageGLRenderer(){_super.call(this)}return __extends(StageGLRenderer,_super),StageGLRenderer}(away.events.EventDispatcher);away.StageGLRenderer=StageGLRenderer}(away||(away={})); \ No newline at end of file diff --git a/libs/awayjs-core.next.d.ts b/libs/awayjs-core.next.d.ts deleted file mode 100644 index 62cff7471..000000000 --- a/libs/awayjs-core.next.d.ts +++ /dev/null @@ -1,15640 +0,0 @@ -/// -declare module away.errors { - class Error { - private _errorID; - private _messsage; - private _name; - constructor(message?: string, id?: number, _name?: string); - /** - * - * @returns {string} - */ - /** - * - * @param value - */ - public message : string; - /** - * - * @returns {string} - */ - /** - * - * @param value - */ - public name : string; - /** - * - * @returns {number} - */ - public errorID : number; - } -} -declare module away.errors { - /** - * AbstractMethodError is thrown when an abstract method is called. The method in question should be overridden - * by a concrete subclass. - */ - class ArgumentError extends Error { - /** - * Create a new ArgumentError. - * - * @param message An optional message to override the default error message. - * @param id The id of the error. - */ - constructor(message?: string, id?: number); - } -} -declare module away.errors { - class CastError extends Error { - constructor(message: string); - } -} -declare module away.errors { - /** - * AbstractMethodError is thrown when an abstract method is called. The method in question should be overridden - * by a concrete subclass. - */ - class PartialImplementationError extends Error { - /** - * Create a new AbstractMethodError. - * @param message An optional message to override the default error message. - * @param id The id of the error. - */ - constructor(dependency?: string, id?: number); - } -} -declare module away.errors { - /** - * AbstractMethodError is thrown when an abstract method is called. The method in question should be overridden - * by a concrete subclass. - */ - class AbstractMethodError extends Error { - /** - * Create a new AbstractMethodError. - * @param message An optional message to override the default error message. - * @param id The id of the error. - */ - constructor(message?: string, id?: number); - } -} -declare module away.errors { - class DocumentError extends Error { - static DOCUMENT_DOES_NOT_EXIST: string; - constructor(message?: string, id?: number); - } -} -declare module away.errors { - /** - * RangeError is thrown when an index is accessed out of range of the number of - * available indices on an Array. - */ - class RangeError extends Error { - /** - * Create a new RangeError. - * - * @param message An optional message to override the default error message. - * @param id The id of the error. - */ - constructor(message?: string, id?: number); - } -} -/** -* Base event class -* @class away.events.Event -*/ -declare module away.events { - class Event { - static COMPLETE: string; - static OPEN: string; - static ENTER_FRAME: string; - static EXIT_FRAME: string; - static RESIZE: string; - static ERROR: string; - static CHANGE: string; - /** - * Type of event - * @property type - * @type String - */ - public type: string; - /** - * Reference to target object - * @property target - * @type Object - */ - public target: any; - constructor(type: string); - /** - * Clones the current event. - * @return An exact duplicate of the current event. - */ - public clone(): Event; - } -} -declare module away.events { - /** - * @class away.events.AssetEvent - */ - class AssetEvent extends Event { - /** - * - */ - static ASSET_COMPLETE: string; - /** - * - */ - static ASSET_RENAME: string; - /** - * - */ - static ASSET_CONFLICT_RESOLVED: string; - /** - * - */ - static TEXTURE_SIZE_ERROR: string; - private _asset; - private _prevName; - /** - * - */ - constructor(type: string, asset?: library.IAsset, prevName?: string); - /** - * - */ - public asset : library.IAsset; - /** - * - */ - public assetPrevName : string; - /** - * - */ - public clone(): Event; - } -} -/** -* @module away.events -*/ -declare module away.events { - /** - * @class away.events.CameraEvent - */ - class CameraEvent extends Event { - static PROJECTION_CHANGED: string; - private _camera; - constructor(type: string, camera: entities.Camera); - public camera : entities.Camera; - } -} -/** -* @module away.events -*/ -declare module away.events { - class DisplayObjectEvent extends Event { - static VISIBLITY_UPDATED: string; - static SCENETRANSFORM_CHANGED: string; - static SCENE_CHANGED: string; - static POSITION_CHANGED: string; - static ROTATION_CHANGED: string; - static SCALE_CHANGED: string; - public object: base.DisplayObject; - constructor(type: string, object: base.DisplayObject); - } -} -/** -* @module away.events -*/ -declare module away.events { - /** - * Base class for dispatching events - * - * @class away.events.EventDispatcher - * - */ - class EventDispatcher { - private listeners; - private target; - constructor(target?: any); - /** - * Add an event listener - * @method addEventListener - * @param {String} Name of event to add a listener for - * @param {Function} Callback function - */ - public addEventListener(type: string, listener: Function): void; - /** - * Remove an event listener - * @method removeEventListener - * @param {String} Name of event to remove a listener for - * @param {Function} Callback function - */ - public removeEventListener(type: string, listener: Function): void; - /** - * Dispatch an event - * @method dispatchEvent - * @param {Event} Event to dispatch - */ - public dispatchEvent(event: Event): void; - /** - * get Event Listener Index in array. Returns -1 if no listener is added - * @method getEventListenerIndex - * @param {String} Name of event to remove a listener for - * @param {Function} Callback function - */ - private getEventListenerIndex(type, listener); - /** - * check if an object has an event listener assigned to it - * @method hasListener - * @param {String} Name of event to remove a listener for - * @param {Function} Callback function - */ - public hasEventListener(type: string, listener?: Function): boolean; - } -} -declare module away.events { - /** - * Dispatched to notify changes in a geometry object's state. - * - * @class away.events.GeometryEvent - * @see away3d.core.base.Geometry - */ - class GeometryEvent extends Event { - /** - * Dispatched when a TriangleSubGeometry was added to the dispatching Geometry. - */ - static SUB_GEOMETRY_ADDED: string; - /** - * Dispatched when a TriangleSubGeometry was removed from the dispatching Geometry. - */ - static SUB_GEOMETRY_REMOVED: string; - static BOUNDS_INVALID: string; - private _subGeometry; - /** - * Create a new GeometryEvent - * @param type The event type. - * @param subGeometry An optional TriangleSubGeometry object that is the subject of this event. - */ - constructor(type: string, subGeometry?: base.SubGeometryBase); - /** - * The TriangleSubGeometry object that is the subject of this event, if appropriate. - */ - public subGeometry : base.SubGeometryBase; - /** - * Clones the event. - * @return An exact duplicate of the current object. - */ - public clone(): Event; - } -} -declare module away.events { - /** - * @class away.events.HTTPStatusEvent - */ - class HTTPStatusEvent extends Event { - static HTTP_STATUS: string; - public status: number; - constructor(type: string, status?: number); - } -} -/** -* @module away.events -*/ -declare module away.events { - /** - * Base interface for dispatching events - * - * @interface away.events.IEventDispatcher - * - */ - interface IEventDispatcher { - /** - * Add an event listener - * @method addEventListener - * @param {String} Name of event to add a listener for - * @param {Function} Callback function - */ - addEventListener(type: string, listener: Function): any; - /** - * Remove an event listener - * @method removeEventListener - * @param {String} Name of event to remove a listener for - * @param {Function} Callback function - */ - removeEventListener(type: string, listener: Function): any; - /** - * Dispatch an event - * @method dispatchEvent - * @param {Event} Event to dispatch - */ - dispatchEvent(event: Event): any; - /** - * check if an object has an event listener assigned to it - * @method hasListener - * @param {String} Name of event to remove a listener for - * @param {Function} Callback function - * @param {Object} Target object listener is added to - */ - hasEventListener(type: string, listener?: Function): boolean; - } -} -/** -* @module away.events -*/ -declare module away.events { - class IOErrorEvent extends Event { - static IO_ERROR: string; - constructor(type: string); - } -} -/** -* @module away.events -*/ -declare module away.events { - class LightEvent extends Event { - static CASTS_SHADOW_CHANGE: string; - constructor(type: string); - public clone(): Event; - } -} -/** -* @module away.events -*/ -declare module away.events { - class LoaderEvent extends Event { - /** - * Dispatched when a resource and all of its dependencies is retrieved. - */ - static RESOURCE_COMPLETE: string; - private _url; - private _content; - private _assets; - /** - * Create a new LoaderEvent object. - * - * @param type The event type. - * @param url The url of the loaded resource. - * @param assets The assets of the loaded resource. - */ - constructor(type: string, url?: string, content?: base.DisplayObject, assets?: library.IAsset[]); - /** - * The content returned if the resource has been loaded inside a Loader object. - */ - public content : base.DisplayObject; - /** - * The url of the loaded resource. - */ - public url : string; - /** - * The error string on loadError. - */ - public assets : library.IAsset[]; - /** - * Clones the current event. - * @return An exact duplicate of the current event. - */ - public clone(): Event; - } -} -/** -* @module away.events -*/ -declare module away.events { - class ParserEvent extends Event { - private _message; - /** - * Dispatched when parsing of an asset completed. - */ - static PARSE_COMPLETE: string; - /** - * Dispatched when an error occurs while parsing the data (e.g. because it's - * incorrectly formatted.) - */ - static PARSE_ERROR: string; - /** - * Dispatched when a parser is ready to have dependencies retrieved and resolved. - * This is an internal event that should rarely (if ever) be listened for by - * external classes. - */ - static READY_FOR_DEPENDENCIES: string; - constructor(type: string, message?: string); - /** - * Additional human-readable message. Usually supplied for ParserEvent.PARSE_ERROR events. - */ - public message : string; - public clone(): Event; - } -} -/** -* @module away.events -*/ -declare module away.events { - /** - * A MouseEvent is dispatched when a mouse event occurs over a mouseEnabled object in View. - * TODO: we don't have screenZ data, tho this should be easy to implement - */ - class MouseEvent extends Event { - public _iAllowedToPropagate: boolean; - public _iParentEvent: MouseEvent; - /** - * Defines the value of the type property of a mouseOver3d event object. - */ - static MOUSE_OVER: string; - /** - * Defines the value of the type property of a mouseOut3d event object. - */ - static MOUSE_OUT: string; - /** - * Defines the value of the type property of a mouseUp3d event object. - */ - static MOUSE_UP: string; - /** - * Defines the value of the type property of a mouseDown3d event object. - */ - static MOUSE_DOWN: string; - /** - * Defines the value of the type property of a mouseMove3d event object. - */ - static MOUSE_MOVE: string; - /** - * Defines the value of the type property of a click3d event object. - */ - static CLICK: string; - /** - * Defines the value of the type property of a doubleClick3d event object. - */ - static DOUBLE_CLICK: string; - /** - * Defines the value of the type property of a mouseWheel3d event object. - */ - static MOUSE_WHEEL: string; - /** - * The horizontal coordinate at which the event occurred in view coordinates. - */ - public screenX: number; - /** - * The vertical coordinate at which the event occurred in view coordinates. - */ - public screenY: number; - /** - * The view object inside which the event took place. - */ - public view: containers.View; - /** - * The 3d object inside which the event took place. - */ - public object: base.DisplayObject; - /** - * The material owner inside which the event took place. - */ - public materialOwner: base.IMaterialOwner; - /** - * The material of the 3d element inside which the event took place. - */ - public material: materials.MaterialBase; - /** - * The uv coordinate inside the draw primitive where the event took place. - */ - public uv: geom.Point; - /** - * The index of the face where the event took place. - */ - public index: number; - /** - * The index of the subGeometry where the event took place. - */ - public subGeometryIndex: number; - /** - * The position in object space where the event took place - */ - public localPosition: geom.Vector3D; - /** - * The normal in object space where the event took place - */ - public localNormal: geom.Vector3D; - /** - * Indicates whether the Control key is active (true) or inactive (false). - */ - public ctrlKey: boolean; - /** - * Indicates whether the Alt key is active (true) or inactive (false). - */ - public altKey: boolean; - /** - * Indicates whether the Shift key is active (true) or inactive (false). - */ - public shiftKey: boolean; - /** - * Indicates how many lines should be scrolled for each unit the user rotates the mouse wheel. - */ - public delta: number; - /** - * Create a new MouseEvent object. - * @param type The type of the MouseEvent. - */ - constructor(type: string); - /** - * @inheritDoc - */ - public bubbles : boolean; - /** - * @inheritDoc - */ - public stopPropagation(): void; - /** - * @inheritDoc - */ - public stopImmediatePropagation(): void; - /** - * Creates a copy of the MouseEvent object and sets the value of each property to match that of the original. - */ - public clone(): Event; - /** - * The position in scene space where the event took place - */ - public scenePosition : geom.Vector3D; - /** - * The normal in scene space where the event took place - */ - public sceneNormal : geom.Vector3D; - } -} -/** -* @module away.events -*/ -declare module away.events { - class MaterialEvent extends Event { - static SIZE_CHANGED: string; - constructor(type: string); - } -} -/** -* @module away.events -*/ -declare module away.events { - class ProgressEvent extends Event { - static PROGRESS: string; - public bytesLoaded: number; - public bytesTotal: number; - constructor(type: string); - } -} -/** -* @module away.events -*/ -declare module away.events { - class ProjectionEvent extends Event { - static MATRIX_CHANGED: string; - private _projection; - constructor(type: string, projection: projections.IProjection); - public projection : projections.IProjection; - } -} -/** -* @module away.events -*/ -declare module away.events { - class RendererEvent extends Event { - static VIEWPORT_UPDATED: string; - static SCISSOR_UPDATED: string; - constructor(type: string); - } -} -/** -* @module away.events -*/ -declare module away.events { - class SceneEvent extends Event { - /** - * - */ - static ADDED_TO_SCENE: string; - /** - * - */ - static REMOVED_FROM_SCENE: string; - /** - * - */ - static PARTITION_CHANGED: string; - /** - * - */ - public displayObject: base.DisplayObject; - constructor(type: string, displayObject: base.DisplayObject); - } -} -/** -* @module away.events -*/ -declare module away.events { - class StageEvent extends Event { - static CONTEXT_CREATED: string; - static CONTEXT_DISPOSED: string; - static CONTEXT_RECREATED: string; - static VIEWPORT_UPDATED: string; - constructor(type: string); - } -} -declare module away.events { - /** - * Dispatched to notify changes in a sub geometry object's state. - * - * @class away.events.SubGeometryEvent - * @see away3d.core.base.Geometry - */ - class SubGeometryEvent extends Event { - /** - * Dispatched when a TriangleSubGeometry's index data has been updated. - */ - static INDICES_UPDATED: string; - /** - * Dispatched when a TriangleSubGeometry's vertex data has been updated. - */ - static VERTICES_UPDATED: string; - private _dataType; - /** - * Create a new GeometryEvent - * @param type The event type. - * @param dataType An optional data type of the vertex data being updated. - */ - constructor(type: string, dataType?: string); - /** - * The data type of the vertex data. - */ - public dataType : string; - /** - * Clones the event. - * - * @return An exact duplicate of the current object. - */ - public clone(): Event; - } -} -/** -* @module away.events -*/ -declare module away.events { - class TimerEvent extends Event { - static TIMER: string; - static TIMER_COMPLETE: string; - constructor(type: string); - } -} -declare module away.utils { - class ByteArrayBase { - public position: number; - public length: number; - public _mode: string; - static Base64Key: string; - constructor(); - public writeByte(b: number): void; - public readByte(): number; - public writeUnsignedByte(b: number): void; - public readUnsignedByte(): number; - public writeUnsignedShort(b: number): void; - public readUnsignedShort(): number; - public writeUnsignedInt(b: number): void; - public readUnsignedInt(): number; - public writeFloat(b: number): void; - public toFloatBits(x: number): void; - public readFloat(b: number): void; - public fromFloatBits(x: number): void; - public getBytesAvailable(): number; - public toString(): string; - public compareEqual(other: any, count: any): boolean; - public writeBase64String(s: string): void; - public dumpToConsole(): void; - public readBase64String(count: number): string; - static internalGetBase64String(count: any, getUnsignedByteFunc: any, self: any): string; - } -} -declare module away.utils { - class ByteArray extends ByteArrayBase { - public maxlength: number; - public arraybytes: any; - public unalignedarraybytestemp: any; - constructor(); - public ensureWriteableSpace(n: number): void; - public setArrayBuffer(aBuffer: ArrayBuffer): void; - public getBytesAvailable(): number; - public ensureSpace(n: number): void; - public writeByte(b: number): void; - public readByte(): number; - public readBytes(bytes: ByteArray, offset?: number, length?: number): void; - public writeUnsignedByte(b: number): void; - public readUnsignedByte(): number; - public writeUnsignedShort(b: number): void; - public readUTFBytes(len: number): string; - public readInt(): number; - public readShort(): number; - public readDouble(): number; - public readUnsignedShort(): number; - public writeUnsignedInt(b: number): void; - public readUnsignedInt(): number; - public writeFloat(b: number): void; - public readFloat(): number; - } -} -declare module away.utils { - class ByteArrayBuffer extends ByteArrayBase { - public _bytes: number[]; - constructor(); - public writeByte(b: number): void; - public readByte(): number; - public writeUnsignedByte(b: number): void; - public readUnsignedByte(): number; - public writeUnsignedShort(b: number): void; - public readUnsignedShort(): number; - public writeUnsignedInt(b: number): void; - public readUnsignedInt(): number; - public writeFloat(b: number): void; - public toFloatBits(x: number): number; - public readFloat(b: number): number; - public fromFloatBits(x: number): number; - } -} -declare module away.utils { - class ColorUtils { - static float32ColorToARGB(float32Color: number): number[]; - private static componentToHex(c); - static RGBToHexString(argb: number[]): string; - static ARGBToHexString(argb: number[]): string; - } -} -declare module away.utils { - /** - * Helper class for casting assets to usable objects - */ - class Cast { - private static _colorNames; - private static _hexChars; - private static _notClasses; - private static _classes; - static string(data: any): string; - static byteArray(data: any): ByteArray; - private static isHex(str); - static tryColor(data: any): number; - static color(data: any): number; - static tryClass(name: string): any; - static bitmapData(data: any): base.BitmapData; - static bitmapTexture(data: any): textures.BitmapTexture; - } -} -declare module away.utils { - class CSS { - static setElementSize(element: HTMLElement, width: number, height: number): void; - static setElementWidth(element: HTMLElement, width: number): void; - static setElementHeight(element: HTMLElement, height: number): void; - static setElementX(element: HTMLElement, x: number): void; - static setElementY(element: HTMLElement, y: number): void; - static getElementVisibility(element: HTMLElement): boolean; - static setElementVisibility(element: HTMLElement, visible: boolean): void; - static setElementAlpha(element: HTMLElement, alpha: number): void; - static setElementPosition(element: HTMLElement, x: number, y: number, absolute?: boolean): void; - } -} -declare module away { - class Debug { - static THROW_ERRORS: boolean; - static ENABLE_LOG: boolean; - static LOG_PI_ERRORS: boolean; - private static keyword; - static breakpoint(): void; - static throwPIROnKeyWordOnly(str: string, enable?: boolean): void; - static throwPIR(clss: string, fnc: string, msg: string): void; - private static logPIR(clss, fnc, msg?); - static log(...args: any[]): void; - } -} -declare module away.utils { - class Delegate { - private _func; - constructor(func?: Function); - /** - Creates a functions wrapper for the original function so that it runs - in the provided context. - @parameter obj Context in which to run the function. - @paramater func Function to run. - */ - static create(obj: Object, func: Function): Function; - public createDelegate(obj: Object): Function; - } -} -declare module away.utils { - function getTimer(): number; -} -declare module away.utils { - class RequestAnimationFrame { - private _callback; - private _callbackContext; - private _active; - private _rafUpdateFunction; - private _prevTime; - private _dt; - private _currentTime; - private _argsArray; - private _getTimer; - constructor(callback: Function, callbackContext: Object); - /** - * - * @param callback - * @param callbackContext - */ - public setCallback(callback: Function, callbackContext: Object): void; - /** - * - */ - public start(): void; - /** - * - */ - public stop(): void; - /** - * - * @returns {boolean} - */ - public active : boolean; - /** - * - * @private - */ - private _tick(); - } -} -declare module away.utils { - class TextureUtils { - private static MAX_SIZE; - static isBitmapDataValid(bitmapData: base.BitmapData): boolean; - static isHTMLImageElementValid(image: HTMLImageElement): boolean; - static isDimensionValid(d: number): boolean; - static isPowerOfTwo(value: number): boolean; - static getBestPowerOf2(value: number): number; - } -} -declare module away.utils { - class Timer extends events.EventDispatcher { - private _delay; - private _repeatCount; - private _currentCount; - private _iid; - private _running; - constructor(delay: number, repeatCount?: number); - public currentCount : number; - public delay : number; - public repeatCount : number; - public reset(): void; - public running : boolean; - public start(): void; - public stop(): void; - private tick(); - } -} -/** -* A Box object is an area defined by its position, as indicated by its -* top-left-front corner point(x, y, z) and by its width, -* height and depth. -* -* -*

The x, y, z, width, -* height depth properties of the Box class are -* independent of each other; changing the value of one property has no effect -* on the others. However, the right, bottom and -* back properties are integrally related to those six -* properties. For example, if you change the value of the right -* property, the value of the width property changes; if you -* change the bottom property, the value of the -* height property changes.

-* -*

The following methods and properties use Box objects:

-* -*
    -*
  • The bounds property of the DisplayObject class
  • -*
-* -*

You can use the new Box() constructor to create a -* Box object.

-* -*

Note: The Box class does not define a cubic Shape -* display object. -*/ -declare module away.geom { - class Box { - private _depth; - private _height; - private _size; - private _bottomRightBack; - private _topLeftFront; - private _width; - /** - * The height of the box, in pixels. Changing the height value - * of a Box object has no effect on the x, y, - * z, depth and width properties. - */ - public height: number; - /** - * The width of the box, in pixels. Changing the width value - * of a Box object has no effect on the x, y, - * z, depth and height properties. - */ - public width: number; - /** - * The deoth of the box, in pixels. Changing the depth value - * of a Box object has no effect on the x, y, - * z, width and height properties. - */ - public depth: number; - /** - * The x coordinate of the top-left-front corner of the box. - * Changing the value of the x property of a Box object has no - * effect on the y, z, width, - * height and depth properties. - * - *

The value of the x property is equal to the value of the - * left property.

- */ - public x: number; - /** - * The y coordinate of the top-left-front corner of the box. - * Changing the value of the y property of a Box object has no - * effect on the x, z, width, - * height and depth properties. - * - *

The value of the y property is equal to the value of the - * top property.

- */ - public y: number; - /** - * The y coordinate of the top-left-front corner of the box. - * Changing the value of the z property of a Box object has no - * effect on the x, y, width, - * height and depth properties. - * - *

The value of the z property is equal to the value of the - * front property.

- */ - public z: number; - /** - * The sum of the z and height properties. - */ - public back : number; - /** - * The sum of the y and height properties. - */ - public bottom : number; - /** - * The location of the Box object's bottom-right corner, determined by the - * values of the right and bottom properties. - */ - public bottomRightBack : Vector3D; - /** - * The z coordinate of the top-left-front corner of the box. Changing - * the front property of a Box object has no effect on the - * x, y, width and height - * properties. However it does affect the depth property, - * whereas changing the z value does not affect the - * depth property. - * - *

The value of the left property is equal to the value of - * the x property.

- */ - public front : number; - /** - * The x coordinate of the top-left corner of the box. Changing the - * left property of a Box object has no effect on the - * y and height properties. However it does affect - * the width property, whereas changing the x value - * does not affect the width property. - * - *

The value of the left property is equal to the value of - * the x property.

- */ - public left : number; - /** - * The sum of the x and width properties. - */ - public right : number; - /** - * The size of the Box object, expressed as a Vector3D object with the - * values of the width, height and - * depth properties. - */ - public size : Vector3D; - /** - * The y coordinate of the top-left-front corner of the box. Changing - * the top property of a Box object has no effect on the - * x and width properties. However it does affect - * the height property, whereas changing the y - * value does not affect the height property. - * - *

The value of the top property is equal to the value of the - * y property.

- */ - public top : number; - /** - * The location of the Box object's top-left-front corner, determined by the - * x, y and z coordinates of the point. - */ - public topLeftFront : Vector3D; - /** - * Creates a new Box object with the top-left-front corner specified by the - * x, y and z parameters and with the - * specified width, height and depth - * parameters. If you call this public without parameters, a box with - * x, y, z, width, - * height and depth properties set to 0 is created. - * - * @param x The x coordinate of the top-left-front corner of the - * box. - * @param y The y coordinate of the top-left-front corner of the - * box. - * @param z The z coordinate of the top-left-front corner of the - * box. - * @param width The width of the box, in pixels. - * @param height The height of the box, in pixels. - * @param depth The depth of the box, in pixels. - */ - constructor(x?: number, y?: number, z?: number, width?: number, height?: number, depth?: number); - /** - * Returns a new Box object with the same values for the x, - * y, z, width, height - * and depth properties as the original Box object. - * - * @return A new Box object with the same values for the x, - * y, z, width, - * height and depth properties as the - * original Box object. - */ - public clone(): Box; - /** - * Determines whether the specified position is contained within the cubic - * region defined by this Box object. - * - * @param x The x coordinate(horizontal component) of the position. - * @param y The y coordinate(vertical component) of the position. - * @param z The z coordinate(longitudinal component) of the position. - * @return A value of true if the Box object contains the - * specified position; otherwise false. - */ - public contains(x: number, y: number, z: number): boolean; - /** - * Determines whether the specified position is contained within the cubic - * region defined by this Box object. This method is similar to the - * Box.contains() method, except that it takes a Vector3D - * object as a parameter. - * - * @param position The position, as represented by its x, y and - * z coordinates. - * @return A value of true if the Box object contains the - * specified position; otherwise false. - */ - public containsPoint(position: Vector3D): boolean; - /** - * Determines whether the Box object specified by the box - * parameter is contained within this Box object. A Box object is said to - * contain another if the second Box object falls entirely within the - * boundaries of the first. - * - * @param box The Box object being checked. - * @return A value of true if the Box object that you specify - * is contained by this Box object; otherwise false. - */ - public containsRect(box: Box): boolean; - /** - * Copies all of box data from the source Box object into the calling - * Box object. - * - * @param sourceBox The Box object from which to copy the data. - */ - public copyFrom(sourceBox: Box): void; - /** - * Determines whether the object specified in the toCompare - * parameter is equal to this Box object. This method compares the - * x, y, z, width, - * height and depth properties of an object against - * the same properties of this Box object. - * - * @param toCompare The box to compare to this Box object. - * @return A value of true if the object has exactly the same - * values for the x, y, z, - * width, height and depth - * properties as this Box object; otherwise false. - */ - public equals(toCompare: Box): boolean; - /** - * Increases the size of the Box object by the specified amounts, in - * pixels. The center point of the Box object stays the same, and its - * size increases to the left and right by the dx value, to - * the top and the bottom by the dy value, and to - * the front and the back by the dz value. - * - * @param dx The value to be added to the left and the right of the Box - * object. The following equation is used to calculate the new - * width and position of the box: - * @param dy The value to be added to the top and the bottom of the Box - * object. The following equation is used to calculate the new - * height and position of the box: - * @param dz The value to be added to the front and the back of the Box - * object. The following equation is used to calculate the new - * depth and position of the box: - */ - public inflate(dx: number, dy: number, dz: number): void; - /** - * Increases the size of the Box object. This method is similar to the - * Box.inflate() method except it takes a Vector3D object as - * a parameter. - * - *

The following two code examples give the same result:

- * - * @param delta The x property of this Vector3D object is used to - * increase the horizontal dimension of the Box object. - * The y property is used to increase the vertical - * dimension of the Box object. - * The z property is used to increase the - * longitudinal dimension of the Box object. - */ - public inflatePoint(delta: Vector3D): void; - /** - * If the Box object specified in the toIntersect parameter - * intersects with this Box object, returns the area of intersection - * as a Box object. If the boxes do not intersect, this method returns an - * empty Box object with its properties set to 0. - * - * @param toIntersect The Box object to compare against to see if it - * intersects with this Box object. - * @return A Box object that equals the area of intersection. If the - * boxes do not intersect, this method returns an empty Box - * object; that is, a box with its x, y, - * z, width, height, and - * depth properties set to 0. - */ - public intersection(toIntersect: Box): Box; - /** - * Determines whether the object specified in the toIntersect - * parameter intersects with this Box object. This method checks the - * x, y, z, width, - * height, and depth properties of the specified - * Box object to see if it intersects with this Box object. - * - * @param toIntersect The Box object to compare against this Box object. - * @return A value of true if the specified object intersects - * with this Box object; otherwise false. - */ - public intersects(toIntersect: Box): boolean; - /** - * Determines whether or not this Box object is empty. - * - * @return A value of true if the Box object's width, height or - * depth is less than or equal to 0; otherwise false. - */ - public isEmpty(): boolean; - /** - * Adjusts the location of the Box object, as determined by its - * top-left-front corner, by the specified amounts. - * - * @param dx Moves the x value of the Box object by this amount. - * @param dy Moves the y value of the Box object by this amount. - * @param dz Moves the z value of the Box object by this amount. - */ - public offset(dx: number, dy: number, dz: number): void; - /** - * Adjusts the location of the Box object using a Vector3D object as a - * parameter. This method is similar to the Box.offset() - * method, except that it takes a Vector3D object as a parameter. - * - * @param position A Vector3D object to use to offset this Box object. - */ - public offsetPosition(position: Vector3D): void; - /** - * Sets all of the Box object's properties to 0. A Box object is empty if its - * width, height or depth is less than or equal to 0. - * - *

This method sets the values of the x, y, - * z, width, height, and - * depth properties to 0.

- * - */ - public setEmpty(): void; - /** - * Sets the members of Box to the specified values - * - * @param xa The x coordinate of the top-left-front corner of the - * box. - * @param ya The y coordinate of the top-left-front corner of the - * box. - * @param yz The z coordinate of the top-left-front corner of the - * box. - * @param widtha The width of the box, in pixels. - * @param heighta The height of the box, in pixels. - * @param deptha The depth of the box, in pixels. - */ - public setTo(xa: number, ya: number, za: number, widtha: number, heighta: number, deptha: number): void; - /** - * Builds and returns a string that lists the horizontal, vertical and - * longitudinal positions and the width, height and depth of the Box object. - * - * @return A string listing the value of each of the following properties of - * the Box object: x, y, z, - * width, height, and depth. - */ - public toString(): string; - /** - * Adds two boxes together to create a new Box object, by filling - * in the horizontal, vertical and longitudinal space between the two boxes. - * - *

Note: The union() method ignores boxes with - * 0 as the height, width or depth value, such as: var - * box2:Box = new Box(300,300,300,50,50,0);

- * - * @param toUnion A Box object to add to this Box object. - * @return A new Box object that is the union of the two boxes. - */ - public union(toUnion: Box): Box; - } -} -/** -* The ColorTransform class lets you adjust the color values in a display -* object. The color adjustment or color transformation can be applied -* to all four channels: red, green, blue, and alpha transparency. -* -*

When a ColorTransform object is applied to a display object, a new value -* for each color channel is calculated like this:

-* -*
    -*
  • New red value = (old red value * redMultiplier) + -* redOffset
  • -*
  • New green value = (old green value * greenMultiplier) + -* greenOffset
  • -*
  • New blue value = (old blue value * blueMultiplier) + -* blueOffset
  • -*
  • New alpha value = (old alpha value * alphaMultiplier) + -* alphaOffset
  • -*
-* -*

If any of the color channel values is greater than 255 after the -* calculation, it is set to 255. If it is less than 0, it is set to 0.

-* -*

You can use ColorTransform objects in the following ways:

-* -*
    -*
  • In the colorTransform parameter of the -* colorTransform() method of the BitmapData class
  • -*
  • As the colorTransform property of a Transform object -* (which can be used as the transform property of a display -* object)
  • -*
-* -*

You must use the new ColorTransform() constructor to create -* a ColorTransform object before you can call the methods of the -* ColorTransform object.

-* -*

Color transformations do not apply to the background color of a movie -* clip(such as a loaded SWF object). They apply only to graphics and symbols -* that are attached to the movie clip.

-*/ -declare module away.geom { - class ColorTransform { - /** - * A decimal value that is multiplied with the alpha transparency channel - * value. - * - *

If you set the alpha transparency value of a display object directly by - * using the alpha property of the DisplayObject instance, it - * affects the value of the alphaMultiplier property of that - * display object's transform.colorTransform property.

- */ - public alphaMultiplier: number; - /** - * A number from -255 to 255 that is added to the alpha transparency channel - * value after it has been multiplied by the alphaMultiplier - * value. - */ - public alphaOffset: number; - /** - * A decimal value that is multiplied with the blue channel value. - */ - public blueMultiplier: number; - /** - * A number from -255 to 255 that is added to the blue channel value after it - * has been multiplied by the blueMultiplier value. - */ - public blueOffset: number; - /** - * A decimal value that is multiplied with the green channel value. - */ - public greenMultiplier: number; - /** - * A number from -255 to 255 that is added to the green channel value after - * it has been multiplied by the greenMultiplier value. - */ - public greenOffset: number; - /** - * A decimal value that is multiplied with the red channel value. - */ - public redMultiplier: number; - /** - * A number from -255 to 255 that is added to the red channel value after it - * has been multiplied by the redMultiplier value. - */ - public redOffset: number; - /** - * The RGB color value for a ColorTransform object. - * - *

When you set this property, it changes the three color offset values - * (redOffset, greenOffset, and - * blueOffset) accordingly, and it sets the three color - * multiplier values(redMultiplier, - * greenMultiplier, and blueMultiplier) to 0. The - * alpha transparency multiplier and offset values do not change.

- * - *

When you pass a value for this property, use the format - * 0xRRGGBB. RR, GG, and BB each consist of two - * hexadecimal digits that specify the offset of each color component. The 0x - * tells the ActionScript compiler that the number is a hexadecimal - * value.

- */ - public color : number; - /** - * Creates a ColorTransform object for a display object with the specified - * color channel values and alpha values. - * - * @param redMultiplier The value for the red multiplier, in the range from - * 0 to 1. - * @param greenMultiplier The value for the green multiplier, in the range - * from 0 to 1. - * @param blueMultiplier The value for the blue multiplier, in the range - * from 0 to 1. - * @param alphaMultiplier The value for the alpha transparency multiplier, in - * the range from 0 to 1. - * @param redOffset The offset value for the red color channel, in the - * range from -255 to 255. - * @param greenOffset The offset value for the green color channel, in - * the range from -255 to 255. - * @param blueOffset The offset for the blue color channel value, in the - * range from -255 to 255. - * @param alphaOffset The offset for alpha transparency channel value, in - * the range from -255 to 255. - */ - constructor(redMultiplier?: number, greenMultiplier?: number, blueMultiplier?: number, alphaMultiplier?: number, redOffset?: number, greenOffset?: number, blueOffset?: number, alphaOffset?: number); - /** - * Concatenates the ColorTranform object specified by the second - * parameter with the current ColorTransform object and sets the current - * object as the result, which is an additive combination of the two color - * transformations. When you apply the concatenated ColorTransform object, - * the effect is the same as applying the second color - * transformation after the original color transformation. - * - * @param second The ColorTransform object to be combined with the current - * ColorTransform object. - */ - public concat(second: ColorTransform): void; - } -} -declare module away.geom { - /** - * MathConsts provides some commonly used mathematical constants - */ - class MathConsts { - /** - * The amount to multiply with when converting radians to degrees. - */ - static RADIANS_TO_DEGREES: number; - /** - * The amount to multiply with when converting degrees to radians. - */ - static DEGREES_TO_RADIANS: number; - } -} -/** -* The Matrix class represents a transformation matrix that determines how to -* map points from one coordinate space to another. You can perform various -* graphical transformations on a display object by setting the properties of -* a Matrix object, applying that Matrix object to the matrix -* property of a Transform object, and then applying that Transform object as -* the transform property of the display object. These -* transformation functions include translation(x and y -* repositioning), rotation, scaling, and skewing. -* -*

Together these types of transformations are known as affine -* transformations. Affine transformations preserve the straightness of -* lines while transforming, so that parallel lines stay parallel.

-* -*

To apply a transformation matrix to a display object, you create a -* Transform object, set its matrix property to the -* transformation matrix, and then set the transform property of -* the display object to the Transform object. Matrix objects are also used as -* parameters of some methods, such as the following:

-* -*
    -*
  • The draw() method of a BitmapData object
  • -*
  • The beginBitmapFill() method, -* beginGradientFill() method, or -* lineGradientStyle() method of a Graphics object
  • -*
-* -*

A transformation matrix object is a 3 x 3 matrix with the following -* contents:

-* -*

In traditional transformation matrixes, the u, -* v, and w properties provide extra capabilities. -* The Matrix class can only operate in two-dimensional space, so it always -* assumes that the property values u and v are 0.0, -* and that the property value w is 1.0. The effective values of -* the matrix are as follows:

-* -*

You can get and set the values of all six of the other properties in a -* Matrix object: a, b, c, -* d, tx, and ty.

-* -*

The Matrix class supports the four major types of transformations: -* translation, scaling, rotation, and skewing. You can set three of these -* transformations by using specialized methods, as described in the following -* table:

-* -*

Each transformation function alters the current matrix properties so -* that you can effectively combine multiple transformations. To do this, you -* call more than one transformation function before applying the matrix to -* its display object target(by using the transform property of -* that display object).

-* -*

Use the new Matrix() constructor to create a Matrix object -* before you can call the methods of the Matrix object.

-*/ -declare module away.geom { - class Matrix { - /** - * The value that affects the positioning of pixels along the x axis - * when scaling or rotating an image. - */ - public a: number; - /** - * The value that affects the positioning of pixels along the y axis - * when rotating or skewing an image. - */ - public b: number; - /** - * The value that affects the positioning of pixels along the x axis - * when rotating or skewing an image. - */ - public c: number; - /** - * The value that affects the positioning of pixels along the y axis - * when scaling or rotating an image. - */ - public d: number; - /** - * The distance by which to translate each point along the x axis. - */ - public tx: number; - /** - * The distance by which to translate each point along the y axis. - */ - public ty: number; - /** - * Creates a new Matrix object with the specified parameters. In matrix - * notation, the properties are organized like this: - * - *

If you do not provide any parameters to the new Matrix() - * constructor, it creates an identity matrix with the following - * values:

- * - *

In matrix notation, the identity matrix looks like this:

- * - * @param a The value that affects the positioning of pixels along the - * x axis when scaling or rotating an image. - * @param b The value that affects the positioning of pixels along the - * y axis when rotating or skewing an image. - * @param c The value that affects the positioning of pixels along the - * x axis when rotating or skewing an image. - * @param d The value that affects the positioning of pixels along the - * y axis when scaling or rotating an image.. - * @param tx The distance by which to translate each point along the x - * axis. - * @param ty The distance by which to translate each point along the y - * axis. - */ - constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number); - /** - * Returns a new Matrix object that is a clone of this matrix, with an exact - * copy of the contained object. - * - * @return A Matrix object. - */ - public clone(): Matrix; - /** - * Concatenates a matrix with the current matrix, effectively combining the - * geometric effects of the two. In mathematical terms, concatenating two - * matrixes is the same as combining them using matrix multiplication. - * - *

For example, if matrix m1 scales an object by a factor of - * four, and matrix m2 rotates an object by 1.5707963267949 - * radians(Math.PI/2), then m1.concat(m2) - * transforms m1 into a matrix that scales an object by a factor - * of four and rotates the object by Math.PI/2 radians.

- * - *

This method replaces the source matrix with the concatenated matrix. If - * you want to concatenate two matrixes without altering either of the two - * source matrixes, first copy the source matrix by using the - * clone() method, as shown in the Class Examples section.

- * - * @param matrix The matrix to be concatenated to the source matrix. - */ - public concat(matrix: Matrix): void; - /** - * Copies a Vector3D object into specific column of the calling Matrix3D - * object. - * - * @param column The column from which to copy the data from. - * @param vector3D The Vector3D object from which to copy the data. - */ - public copyColumnFrom(column: number, vector3D: Vector3D): void; - /** - * Copies specific column of the calling Matrix object into the Vector3D - * object. The w element of the Vector3D object will not be changed. - * - * @param column The column from which to copy the data from. - * @param vector3D The Vector3D object from which to copy the data. - */ - public copyColumnTo(column: number, vector3D: Vector3D): void; - /** - * Copies all of the matrix data from the source Point object into the - * calling Matrix object. - * - * @param sourceMatrix The Matrix object from which to copy the data. - */ - public copyFrom(sourceMatrix: Matrix): void; - /** - * Copies a Vector3D object into specific row of the calling Matrix object. - * - * @param row The row from which to copy the data from. - * @param vector3D The Vector3D object from which to copy the data. - */ - public copyRowFrom(row: number, vector3D: Vector3D): void; - /** - * Copies specific row of the calling Matrix object into the Vector3D object. - * The w element of the Vector3D object will not be changed. - * - * @param row The row from which to copy the data from. - * @param vector3D The Vector3D object from which to copy the data. - */ - public copyRowTo(row: number, vector3D: Vector3D): void; - /** - * Includes parameters for scaling, rotation, and translation. When applied - * to a matrix it sets the matrix's values based on those parameters. - * - *

Using the createBox() method lets you obtain the same - * matrix as you would if you applied the identity(), - * rotate(), scale(), and translate() - * methods in succession. For example, mat1.createBox(2,2,Math.PI/4, - * 100, 100) has the same effect as the following:

- * - * @param scaleX The factor by which to scale horizontally. - * @param scaleY The factor by which scale vertically. - * @param rotation The amount to rotate, in radians. - * @param tx The number of pixels to translate(move) to the right - * along the x axis. - * @param ty The number of pixels to translate(move) down along the - * y axis. - */ - public createBox(scaleX: number, scaleY: number, rotation?: number, tx?: number, ty?: number): void; - /** - * Creates the specific style of matrix expected by the - * beginGradientFill() and lineGradientStyle() - * methods of the Graphics class. Width and height are scaled to a - * scaleX/scaleY pair and the - * tx/ty values are offset by half the width and - * height. - * - *

For example, consider a gradient with the following - * characteristics:

- * - *
    - *
  • GradientType.LINEAR
  • - *
  • Two colors, green and blue, with the ratios array set to [0, - * 255]
  • - *
  • SpreadMethod.PAD
  • - *
  • InterpolationMethod.LINEAR_RGB
  • - *
- * - *

The following illustrations show gradients in which the matrix was - * defined using the createGradientBox() method with different - * parameter settings:

- * - * @param width The width of the gradient box. - * @param height The height of the gradient box. - * @param rotation The amount to rotate, in radians. - * @param tx The distance, in pixels, to translate to the right along - * the x axis. This value is offset by half of the - * width parameter. - * @param ty The distance, in pixels, to translate down along the - * y axis. This value is offset by half of the - * height parameter. - */ - public createGradientBox(width: number, height: number, rotation?: number, tx?: number, ty?: number): void; - /** - * Given a point in the pretransform coordinate space, returns the - * coordinates of that point after the transformation occurs. Unlike the - * standard transformation applied using the transformPoint() - * method, the deltaTransformPoint() method's transformation - * does not consider the translation parameters tx and - * ty. - * - * @param point The point for which you want to get the result of the matrix - * transformation. - * @return The point resulting from applying the matrix transformation. - */ - public deltaTransformPoint(point: Point): Point; - /** - * Sets each matrix property to a value that causes a null transformation. An - * object transformed by applying an identity matrix will be identical to the - * original. - * - *

After calling the identity() method, the resulting matrix - * has the following properties: a=1, b=0, - * c=0, d=1, tx=0, - * ty=0.

- * - *

In matrix notation, the identity matrix looks like this:

- * - */ - public identity(): void; - /** - * Performs the opposite transformation of the original matrix. You can apply - * an inverted matrix to an object to undo the transformation performed when - * applying the original matrix. - */ - public invert(): void; - /** - * Returns a new Matrix object that is a clone of this matrix, with an exact - * copy of the contained object. - * - * @param matrix The matrix for which you want to get the result of the matrix - * transformation. - * @return A Matrix object. - */ - public multiply(matrix: Matrix): Matrix; - /** - * Applies a rotation transformation to the Matrix object. - * - *

The rotate() method alters the a, - * b, c, and d properties of the - * Matrix object. In matrix notation, this is the same as concatenating the - * current matrix with the following:

- * - * @param angle The rotation angle in radians. - */ - public rotate(angle: number): void; - /** - * Applies a scaling transformation to the matrix. The x axis is - * multiplied by sx, and the y axis it is multiplied by - * sy. - * - *

The scale() method alters the a and - * d properties of the Matrix object. In matrix notation, this - * is the same as concatenating the current matrix with the following - * matrix:

- * - * @param sx A multiplier used to scale the object along the x axis. - * @param sy A multiplier used to scale the object along the y axis. - */ - public scale(sx: number, sy: number): void; - /** - * Sets the members of Matrix to the specified values. - * - * @param a The value that affects the positioning of pixels along the - * x axis when scaling or rotating an image. - * @param b The value that affects the positioning of pixels along the - * y axis when rotating or skewing an image. - * @param c The value that affects the positioning of pixels along the - * x axis when rotating or skewing an image. - * @param d The value that affects the positioning of pixels along the - * y axis when scaling or rotating an image.. - * @param tx The distance by which to translate each point along the x - * axis. - * @param ty The distance by which to translate each point along the y - * axis. - */ - public setTo(a: number, b: number, c: number, d: number, tx: number, ty: number): void; - /** - * Returns a text value listing the properties of the Matrix object. - * - * @return A string containing the values of the properties of the Matrix - * object: a, b, c, - * d, tx, and ty. - */ - public toString(): string; - /** - * Returns the result of applying the geometric transformation represented by - * the Matrix object to the specified point. - * - * @param point The point for which you want to get the result of the Matrix - * transformation. - * @return The point resulting from applying the Matrix transformation. - */ - public transformPoint(point: Point): Point; - /** - * Translates the matrix along the x and y axes, as specified - * by the dx and dy parameters. - * - * @param dx The amount of movement along the x axis to the right, in - * pixels. - * @param dy The amount of movement down along the y axis, in pixels. - */ - public translate(dx: number, dy: number): void; - } -} -declare module away.geom { - class Matrix3D { - /** - * A Vector of 16 Numbers, where every four elements is a column of a 4x4 matrix. - * - *

An exception is thrown if the rawData property is set to a matrix that is not invertible. The Matrix3D - * object must be invertible. If a non-invertible matrix is needed, create a subclass of the Matrix3D object.

- */ - public rawData: number[]; - /** - * Creates a Matrix3D object. - */ - constructor(v?: number[]); - /** - * Appends the matrix by multiplying another Matrix3D object by the current Matrix3D object. - */ - public append(lhs: Matrix3D): void; - /** - * Appends an incremental rotation to a Matrix3D object. - */ - public appendRotation(degrees: number, axis: Vector3D): void; - /** - * Appends an incremental scale change along the x, y, and z axes to a Matrix3D object. - */ - public appendScale(xScale: number, yScale: number, zScale: number): void; - /** - * Appends an incremental translation, a repositioning along the x, y, and z axes, to a Matrix3D object. - */ - public appendTranslation(x: number, y: number, z: number): void; - /** - * Returns a new Matrix3D object that is an exact copy of the current Matrix3D object. - */ - public clone(): Matrix3D; - /** - * Copies a Vector3D object into specific column of the calling Matrix3D object. - */ - public copyColumnFrom(column: number, vector3D: Vector3D): void; - /** - * Copies specific column of the calling Matrix3D object into the Vector3D object. - */ - public copyColumnTo(column: number, vector3D: Vector3D): void; - /** - * Copies all of the matrix data from the source Matrix3D object into the calling Matrix3D object. - */ - public copyFrom(sourceMatrix3D: Matrix3D): void; - public copyRawDataFrom(vector: number[], index?: number, transpose?: boolean): void; - public copyRawDataTo(vector: number[], index?: number, transpose?: boolean): void; - /** - * Copies a Vector3D object into specific row of the calling Matrix3D object. - */ - public copyRowFrom(row: number, vector3D: Vector3D): void; - /** - * Copies specific row of the calling Matrix3D object into the Vector3D object. - */ - public copyRowTo(row: number, vector3D: Vector3D): void; - /** - * Copies this Matrix3D object into a destination Matrix3D object. - */ - public copyToMatrix3D(dest: Matrix3D): void; - /** - * Returns the transformation matrix's translation, rotation, and scale settings as a Vector of three Vector3D objects. - */ - public decompose(orientationStyle?: string): Vector3D[]; - /** - * Uses the transformation matrix without its translation elements to transform a Vector3D object from one space - * coordinate to another. - */ - public deltaTransformVector(v: Vector3D): Vector3D; - /** - * Converts the current matrix to an identity or unit matrix. - */ - public identity(): void; - /** - * [static] Interpolates the translation, rotation, and scale transformation of one matrix toward those of the target matrix. - */ - static interpolate(thisMat: Matrix3D, toMat: Matrix3D, percent: number): Matrix3D; - /** - * Interpolates this matrix towards the translation, rotation, and scale transformations of the target matrix. - */ - public interpolateTo(toMat: Matrix3D, percent: number): void; - /** - * Inverts the current matrix. - */ - public invert(): boolean; - /** - * Prepends a matrix by multiplying the current Matrix3D object by another Matrix3D object. - */ - public prepend(rhs: Matrix3D): void; - /** - * Prepends an incremental rotation to a Matrix3D object. - */ - public prependRotation(degrees: number, axis: Vector3D): void; - /** - * Prepends an incremental scale change along the x, y, and z axes to a Matrix3D object. - */ - public prependScale(xScale: number, yScale: number, zScale: number): void; - /** - * Prepends an incremental translation, a repositioning along the x, y, and z axes, to a Matrix3D object. - */ - public prependTranslation(x: number, y: number, z: number): void; - /** - * Sets the transformation matrix's translation, rotation, and scale settings. - */ - public recompose(components: Vector3D[]): boolean; - public transformVector(v: Vector3D): Vector3D; - /** - * Uses the transformation matrix to transform a Vector of Numbers from one coordinate space to another. - */ - public transformVectors(vin: number[], vout: number[]): void; - /** - * Converts the current Matrix3D object to a matrix where the rows and columns are swapped. - */ - public transpose(): void; - static getAxisRotation(x: number, y: number, z: number, degrees: number): Matrix3D; - /** - * [read-only] A Number that determines whether a matrix is invertible. - */ - public determinant : number; - /** - * A Vector3D object that holds the position, the 3D coordinate (x,y,z) of a display object within the - * transformation's frame of reference. - */ - public position : Vector3D; - public toFixed(decimalPlace: number): string; - public toString(): string; - } -} -declare module away.geom { - /** - * away.geom.Matrix3DUtils provides additional Matrix3D functions. - */ - class Matrix3DUtils { - /** - * A reference to a Vector to be used as a temporary raw data container, to prevent object creation. - */ - static RAW_DATA_CONTAINER: number[]; - static CALCULATION_MATRIX: Matrix3D; - /** - * Fills the 3d matrix object with values representing the transformation made by the given quaternion. - * - * @param quarternion The quarterion object to convert. - */ - static quaternion2matrix(quarternion: Quaternion, m?: Matrix3D): Matrix3D; - /** - * Returns a normalised Vector3D object representing the forward vector of the given matrix. - * @param m The Matrix3D object to use to get the forward vector - * @param v [optional] A vector holder to prevent make new Vector3D instance if already exists. Default is null. - * @return The forward vector - */ - static getForward(m: Matrix3D, v?: Vector3D): Vector3D; - /** - * Returns a normalised Vector3D object representing the up vector of the given matrix. - * @param m The Matrix3D object to use to get the up vector - * @param v [optional] A vector holder to prevent make new Vector3D instance if already exists. Default is null. - * @return The up vector - */ - static getUp(m: Matrix3D, v?: Vector3D): Vector3D; - /** - * Returns a normalised Vector3D object representing the right vector of the given matrix. - * @param m The Matrix3D object to use to get the right vector - * @param v [optional] A vector holder to prevent make new Vector3D instance if already exists. Default is null. - * @return The right vector - */ - static getRight(m: Matrix3D, v?: Vector3D): Vector3D; - /** - * Returns a boolean value representing whether there is any significant difference between the two given 3d matrices. - */ - static compare(m1: Matrix3D, m2: Matrix3D): boolean; - static lookAt(matrix: Matrix3D, pos: Vector3D, dir: Vector3D, up: Vector3D): void; - static reflection(plane: Plane3D, target?: Matrix3D): Matrix3D; - static transformVector(matrix: Matrix3D, vector: Vector3D, result?: Vector3D): Vector3D; - static deltaTransformVector(matrix: Matrix3D, vector: Vector3D, result?: Vector3D): Vector3D; - static getTranslation(transform: Matrix3D, result?: Vector3D): Vector3D; - static deltaTransformVectors(matrix: Matrix3D, vin: number[], vout: number[]): void; - } -} -declare module away.geom { - /** - * A Quaternion object which can be used to represent rotations. - */ - class Orientation3D { - static AXIS_ANGLE: string; - static EULER_ANGLES: string; - static QUATERNION: string; - } -} -/** -*

The PerspectiveProjection class provides an easy way to assign or modify -* the perspective transformations of a display object and all of its -* children. For more complex or custom perspective transformations, use the -* Matrix3D class. While the PerspectiveProjection class provides basic -* three-dimensional presentation properties, the Matrix3D class provides more -* detailed control over the three-dimensional presentation of display objects. -*

-* -*

Projection is a way of representing a three-dimensional object in a -* two-dimensional space, like a cube projected onto a computer screen. -* Perspective projection uses a viewing frustum (a rectangular pyramid) to -* model and project a three-dimensional world and its objects on the screen. -* The viewing frustum becomes increasingly wider as it moves further from the -* origin of the viewpoint. The origin of the viewpoint could be a camera or -* the eyes of an observer facing the screen. The projected perspective -* produces the illusion of three dimensions with depth and distance, where -* the objects closer to the screen appear larger than the objects farther -* from the screen.

-* -*

A default PerspectiveProjection object is a framework defined for -* perspective transformation of the root object, based on the field of view -* and aspect ratio (dimensions) of the stage. The projection center, the -* vanishing point, is set to the center of the stage, which means the -* three-dimensional display objects disappear toward the center of the stage -* as they move back in the z axis. The default viewpoint is at point (0,0) -* looking down the positive z axis. The y-axis points down toward the bottom -* of the screen. You can gain access to the root display object's perspective -* projection settings and change the field of view and projection center -* properties of the perspectiveProjection property through the root object's -* DisplayObject.transform property.

-* -*

You can also set a different perspective projection setting for a -* display object through the parent's perspective projection. First, create a -* PerspectiveProjection object and set its fieldOfView and -* projectionCenter properties. Next, assign the -* PerspectiveProjection object to the parent display object using the -* DisplayObject.transform property. The specified projection -* matrix and transformation will then apply to all the display object's -* three-dimensional children.

-* -*

To modify a perspective projection of the stage or root object: use the -* transform.matrix property of the root display object to gain -* access to the PerspectiveProjection object. Or, apply different perspective -* projection properties to a display object by setting the perspective -* projection properties of the display object's parent. The child display -* object inherits the new properties. Specifically, create a -* PerspectiveProjection object and set its properties, then assign the -* PerspectiveProjection object to the perspectiveProjection -* property of the parent display object's transform property. -* The specified projection transformation then applies to all the display -* object's three-dimensional children.

-* -*

Since both PerspectiveProjection and Matrix3D objects perform -* perspective transformations, do not assign both to a display object at the -* same time. Use the PerspectiveProjection object for focal length and -* projection center changes. For more control over the perspective -* transformation, create a perspective projection Matrix3D object.

-*/ -declare module away.geom { - class PerspectiveProjection { - private _matrix3D; - /** - * Specifies an angle, as a degree between 0 and 180, for the field of - * view in three dimensions. This value determines how strong the - * perspective transformation and distortion apply to a - * three-dimensional display object with a non-zero z-coordinate. - * - *

A degree close to 0 means that the screen's two-dimensional x- - * and y-coordinates are roughly the same as the three-dimensional x-, - * y-, and z-coordinates with little or no distortion. In other words, - * for a small angle, a display object moving down the z axis appears - * to stay near the same size and moves little.

- * - *

A value close to 180 degrees results in a fisheye projection effect: - * positions with a z value smaller than 0 are magnified, while - * positions with a z value larger than 0 are minimized. With a large - * angle, a display object moving down the z axis appears to change - * size quickly and moves a great distance. If the field of view is - * set to 0 or 180, nothing is seen on the screen.

- */ - public fieldOfView: number; - /** - * The distance between the eye or the viewpoint's origin (0,0,0) and - * the display object located in the z axis. During the perspective - * transformation, the focalLength is calculated - * dynamically using the angle of the field of view and the stage's - * aspect ratio (stage width divided by stage height). - * - * @see away.geom.PerspectiveProjection#fieldOfView - */ - public focalLength: number; - /** - * A two-dimensional point representing the center of the projection, - * the vanishing point for the display object. - * - *

The projectionCenter property is an offset to the - * default registration point that is the upper left of the stage, - * point (0,0). The default projection transformation center is in the - * middle of the stage, which means the three-dimensional display - * objects disappear toward the center of the stage as they move - * backwards in the z axis.

- */ - public projectionCenter: Point; - /** - * Creates an instance of a PerspectiveProjection object. - */ - constructor(); - /** - * Returns the underlying Matrix3D object of the display object. - * - *

A display object, like the root object, can have a - * PerspectiveProjection object without needing a Matrix3D property - * defined for its transformations. In fact, use either a - * PerspectiveProjection or a Matrix3D object to specify the - * perspective transformation. If when using the PerspectiveProjection - * object, a Matrix3D object was needed, the toMatrix3D() - * method can retrieve the underlying Matrix3D object of the display - * object. For example, the toMatrix3D() method can be - * used with the Utils3D.projectVectors() method.

- * - * @see away.geom.Matrix3D - */ - public toMatrix3D(): Matrix3D; - } -} -declare module away.geom { - class Plane3D { - /** - * The A coefficient of this plane. (Also the x dimension of the plane normal) - */ - public a: number; - /** - * The B coefficient of this plane. (Also the y dimension of the plane normal) - */ - public b: number; - /** - * The C coefficient of this plane. (Also the z dimension of the plane normal) - */ - public c: number; - /** - * The D coefficient of this plane. (Also the inverse dot product between normal and point) - */ - public d: number; - public _iAlignment: number; - static ALIGN_ANY: number; - static ALIGN_XY_AXIS: number; - static ALIGN_YZ_AXIS: number; - static ALIGN_XZ_AXIS: number; - /** - * Create a Plane3D with ABCD coefficients - */ - constructor(a?: number, b?: number, c?: number, d?: number); - /** - * Fills this Plane3D with the coefficients from 3 points in 3d space. - * @param p0 Vector3D - * @param p1 Vector3D - * @param p2 Vector3D - */ - public fromPoints(p0: Vector3D, p1: Vector3D, p2: Vector3D): void; - /** - * Fills this Plane3D with the coefficients from the plane's normal and a point in 3d space. - * @param normal Vector3D - * @param point Vector3D - */ - public fromNormalAndPoint(normal: Vector3D, point: Vector3D): void; - /** - * Normalize this Plane3D - * @return Plane3D This Plane3D. - */ - public normalize(): Plane3D; - /** - * Returns the signed distance between this Plane3D and the point p. - * @param p Vector3D - * @returns Number - */ - public distance(p: Vector3D): number; - /** - * Classify a point against this Plane3D. (in front, back or intersecting) - * @param p Vector3D - * @return int Plane3.FRONT or Plane3D.BACK or Plane3D.INTERSECT - */ - public classifyPoint(p: Vector3D, epsilon?: number): number; - public toString(): string; - } -} -declare module away.geom { - class PlaneClassification { - static BACK: number; - static FRONT: number; - static IN: number; - static OUT: number; - static INTERSECT: number; - } -} -/** -* The Point object represents a location in a two-dimensional coordinate -* system, where x represents the horizontal axis and y -* represents the vertical axis. -* -*

The following code creates a point at(0,0):

-* -*

Methods and properties of the following classes use Point objects:

-* -*
    -*
  • BitmapData
  • -*
  • DisplayObject
  • -*
  • DisplayObjectContainer
  • -*
  • DisplacementMapFilter
  • -*
  • NativeWindow
  • -*
  • Matrix
  • -*
  • Rectangle
  • -*
-* -*

You can use the new Point() constructor to create a Point -* object.

-*/ -declare module away.geom { - class Point { - /** - * The horizontal coordinate of the point. The default value is 0. - */ - public x: number; - /** - * The vertical coordinate of the point. The default value is 0. - */ - public y: number; - /** - * The length of the line segment from(0,0) to this point. - */ - public length : number; - /** - * Creates a new point. If you pass no parameters to this method, a point is - * created at(0,0). - * - * @param x The horizontal coordinate. - * @param y The vertical coordinate. - */ - constructor(x?: number, y?: number); - /** - * Adds the coordinates of another point to the coordinates of this point to - * create a new point. - * - * @param v The point to be added. - * @return The new point. - */ - public add(v: Point): Point; - /** - * Creates a copy of this Point object. - * - * @return The new Point object. - */ - public clone(): Point; - public copyFrom(sourcePoint: Point): void; - /** - * Determines whether two points are equal. Two points are equal if they have - * the same x and y values. - * - * @param toCompare The point to be compared. - * @return A value of true if the object is equal to this Point - * object; false if it is not equal. - */ - public equals(toCompare: Point): boolean; - /** - * Scales the line segment between(0,0) and the current point to a set - * length. - * - * @param thickness The scaling value. For example, if the current point is - * (0,5), and you normalize it to 1, the point returned is - * at(0,1). - */ - public normalize(thickness?: number): void; - /** - * Offsets the Point object by the specified amount. The value of - * dx is added to the original value of x to create the - * new x value. The value of dy is added to the original - * value of y to create the new y value. - * - * @param dx The amount by which to offset the horizontal coordinate, - * x. - * @param dy The amount by which to offset the vertical coordinate, y. - */ - public offset(dx: number, dy: number): void; - public setTo(xa: number, ya: number): void; - /** - * Subtracts the coordinates of another point from the coordinates of this - * point to create a new point. - * - * @param v The point to be subtracted. - * @return The new point. - */ - public subtract(v: Point): Point; - /** - * Returns a string that contains the values of the x and y - * coordinates. The string has the form "(x=x, - * y=y)", so calling the toString() method for a - * point at 23,17 would return "(x=23, y=17)". - * - * @return The string representation of the coordinates. - */ - public toString(): string; - /** - * Returns the distance between pt1 and pt2. - * - * @param pt1 The first point. - * @param pt2 The second point. - * @return The distance between the first and second points. - */ - static distance(pt1: Point, pt2: Point): number; - /** - * Determines a point between two specified points. The parameter - * f determines where the new interpolated point is located - * relative to the two end points specified by parameters pt1 - * and pt2. The closer the value of the parameter f - * is to 1.0, the closer the interpolated point is to the first - * point(parameter pt1). The closer the value of the parameter - * f is to 0, the closer the interpolated point is to the second - * point(parameter pt2). - * - * @param pt1 The first point. - * @param pt2 The second point. - * @param f The level of interpolation between the two points. Indicates - * where the new point will be, along the line between - * pt1 and pt2. If f=1, - * pt1 is returned; if f=0, - * pt2 is returned. - * @return The new, interpolated point. - */ - static interpolate(pt1: Point, pt2: Point, f: number): Point; - /** - * Converts a pair of polar coordinates to a Cartesian point coordinate. - * - * @param len The length coordinate of the polar pair. - * @param angle The angle, in radians, of the polar pair. - * @return The Cartesian point. - */ - static polar(len: number, angle: number): Point; - } -} -declare module away.geom { - class PoissonLookup { - static _distributions: number[][]; - static initDistributions(): void; - static getDistribution(n: number): number[]; - } -} -declare module away.geom { - /** - * A Quaternion object which can be used to represent rotations. - */ - class Quaternion { - /** - * The x value of the quaternion. - */ - public x: number; - /** - * The y value of the quaternion. - */ - public y: number; - /** - * The z value of the quaternion. - */ - public z: number; - /** - * The w value of the quaternion. - */ - public w: number; - /** - * Creates a new Quaternion object. - * @param x The x value of the quaternion. - * @param y The y value of the quaternion. - * @param z The z value of the quaternion. - * @param w The w value of the quaternion. - */ - constructor(x?: number, y?: number, z?: number, w?: number); - /** - * Returns the magnitude of the quaternion object. - */ - public magnitude : number; - /** - * Fills the quaternion object with the result from a multiplication of two quaternion objects. - * - * @param qa The first quaternion in the multiplication. - * @param qb The second quaternion in the multiplication. - */ - public multiply(qa: Quaternion, qb: Quaternion): void; - public multiplyVector(vector: Vector3D, target?: Quaternion): Quaternion; - /** - * Fills the quaternion object with values representing the given rotation around a vector. - * - * @param axis The axis around which to rotate - * @param angle The angle in radians of the rotation. - */ - public fromAxisAngle(axis: Vector3D, angle: number): void; - /** - * Spherically interpolates between two quaternions, providing an interpolation between rotations with constant angle change rate. - * @param qa The first quaternion to interpolate. - * @param qb The second quaternion to interpolate. - * @param t The interpolation weight, a value between 0 and 1. - */ - public slerp(qa: Quaternion, qb: Quaternion, t: number): void; - /** - * Linearly interpolates between two quaternions. - * @param qa The first quaternion to interpolate. - * @param qb The second quaternion to interpolate. - * @param t The interpolation weight, a value between 0 and 1. - */ - public lerp(qa: Quaternion, qb: Quaternion, t: number): void; - /** - * Fills the quaternion object with values representing the given euler rotation. - * - * @param ax The angle in radians of the rotation around the ax axis. - * @param ay The angle in radians of the rotation around the ay axis. - * @param az The angle in radians of the rotation around the az axis. - */ - public fromEulerAngles(ax: number, ay: number, az: number): void; - /** - * Fills a target Vector3D object with the Euler angles that form the rotation represented by this quaternion. - * @param target An optional Vector3D object to contain the Euler angles. If not provided, a new object is created. - * @return The Vector3D containing the Euler angles. - */ - public toEulerAngles(target?: Vector3D): Vector3D; - /** - * Normalises the quaternion object. - */ - public normalize(val?: number): void; - /** - * Used to trace the values of a quaternion. - * - * @return A string representation of the quaternion object. - */ - public toString(): string; - /** - * Converts the quaternion to a Matrix3D object representing an equivalent rotation. - * @param target An optional Matrix3D container to store the transformation in. If not provided, a new object is created. - * @return A Matrix3D object representing an equivalent rotation. - */ - public toMatrix3D(target?: Matrix3D): Matrix3D; - /** - * Extracts a quaternion rotation matrix out of a given Matrix3D object. - * @param matrix The Matrix3D out of which the rotation will be extracted. - */ - public fromMatrix(matrix: Matrix3D): void; - /** - * Converts the quaternion to a Vector.<Number> matrix representation of a rotation equivalent to this quaternion. - * @param target The Vector.<Number> to contain the raw matrix data. - * @param exclude4thRow If true, the last row will be omitted, and a 4x3 matrix will be generated instead of a 4x4. - */ - public toRawData(target: number[], exclude4thRow?: boolean): void; - /** - * Clones the quaternion. - * @return An exact duplicate of the current Quaternion. - */ - public clone(): Quaternion; - /** - * Rotates a point. - * @param vector The Vector3D object to be rotated. - * @param target An optional Vector3D object that will contain the rotated coordinates. If not provided, a new object will be created. - * @return A Vector3D object containing the rotated point. - */ - public rotatePoint(vector: Vector3D, target?: Vector3D): Vector3D; - /** - * Copies the data from a quaternion into this instance. - * @param q The quaternion to copy from. - */ - public copyFrom(q: Quaternion): void; - } -} -/** -* A Rectangle object is an area defined by its position, as indicated by its -* top-left corner point(x, y) and by its width and its height. -* -* -*

The x, y, width, and -* height properties of the Rectangle class are independent of -* each other; changing the value of one property has no effect on the others. -* However, the right and bottom properties are -* integrally related to those four properties. For example, if you change the -* value of the right property, the value of the -* width property changes; if you change the bottom -* property, the value of the height property changes.

-* -*

The following methods and properties use Rectangle objects:

-* -*
    -*
  • The applyFilter(), colorTransform(), -* copyChannel(), copyPixels(), draw(), -* fillRect(), generateFilterRect(), -* getColorBoundsRect(), getPixels(), -* merge(), paletteMap(), -* pixelDisolve(), setPixels(), and -* threshold() methods, and the rect property of the -* BitmapData class
  • -*
  • The getBounds() and getRect() methods, and -* the scrollRect and scale9Grid properties of the -* DisplayObject class
  • -*
  • The getCharBoundaries() method of the TextField -* class
  • -*
  • The pixelBounds property of the Transform class
  • -*
  • The bounds parameter for the startDrag() -* method of the Sprite class
  • -*
  • The printArea parameter of the addPage() -* method of the PrintJob class
  • -*
-* -*

You can use the new Rectangle() constructor to create a -* Rectangle object.

-* -*

Note: The Rectangle class does not define a rectangular Shape -* display object. To draw a rectangular Shape object onscreen, use the -* drawRect() method of the Graphics class.

-*/ -declare module away.geom { - class Rectangle { - private _size; - private _bottomRight; - private _topLeft; - /** - * The height of the rectangle, in pixels. Changing the height - * value of a Rectangle object has no effect on the x, - * y, and width properties. - */ - public height: number; - /** - * The width of the rectangle, in pixels. Changing the width - * value of a Rectangle object has no effect on the x, - * y, and height properties. - */ - public width: number; - /** - * The x coordinate of the top-left corner of the rectangle. Changing - * the value of the x property of a Rectangle object has no - * effect on the y, width, and height - * properties. - * - *

The value of the x property is equal to the value of the - * left property.

- */ - public x: number; - /** - * The y coordinate of the top-left corner of the rectangle. Changing - * the value of the y property of a Rectangle object has no - * effect on the x, width, and height - * properties. - * - *

The value of the y property is equal to the value of the - * top property.

- */ - public y: number; - /** - * The sum of the y and height properties. - */ - public bottom : number; - /** - * The location of the Rectangle object's bottom-right corner, determined by - * the values of the right and bottom properties. - */ - public bottomRight : Point; - /** - * The x coordinate of the top-left corner of the rectangle. Changing - * the left property of a Rectangle object has no effect on the - * y and height properties. However it does affect - * the width property, whereas changing the x value - * does not affect the width property. - * - *

The value of the left property is equal to the value of - * the x property.

- */ - public left : number; - /** - * The sum of the x and width properties. - */ - public right : number; - /** - * The size of the Rectangle object, expressed as a Point object with the - * values of the width and height properties. - */ - public size : Point; - /** - * The y coordinate of the top-left corner of the rectangle. Changing - * the top property of a Rectangle object has no effect on the - * x and width properties. However it does affect - * the height property, whereas changing the y - * value does not affect the height property. - * - *

The value of the top property is equal to the value of the - * y property.

- */ - public top : number; - /** - * The location of the Rectangle object's top-left corner, determined by the - * x and y coordinates of the point. - */ - public topLeft : Point; - /** - * Creates a new Rectangle object with the top-left corner specified by the - * x and y parameters and with the specified - * width and height parameters. If you call this - * public without parameters, a rectangle with x, - * y, width, and height properties set - * to 0 is created. - * - * @param x The x coordinate of the top-left corner of the - * rectangle. - * @param y The y coordinate of the top-left corner of the - * rectangle. - * @param width The width of the rectangle, in pixels. - * @param height The height of the rectangle, in pixels. - */ - constructor(x?: number, y?: number, width?: number, height?: number); - /** - * Returns a new Rectangle object with the same values for the - * x, y, width, and - * height properties as the original Rectangle object. - * - * @return A new Rectangle object with the same values for the - * x, y, width, and - * height properties as the original Rectangle object. - */ - public clone(): Rectangle; - /** - * Determines whether the specified point is contained within the rectangular - * region defined by this Rectangle object. - * - * @param x The x coordinate(horizontal position) of the point. - * @param y The y coordinate(vertical position) of the point. - * @return A value of true if the Rectangle object contains the - * specified point; otherwise false. - */ - public contains(x: number, y: number): boolean; - /** - * Determines whether the specified point is contained within the rectangular - * region defined by this Rectangle object. This method is similar to the - * Rectangle.contains() method, except that it takes a Point - * object as a parameter. - * - * @param point The point, as represented by its x and y - * coordinates. - * @return A value of true if the Rectangle object contains the - * specified point; otherwise false. - */ - public containsPoint(point: Point): boolean; - /** - * Determines whether the Rectangle object specified by the rect - * parameter is contained within this Rectangle object. A Rectangle object is - * said to contain another if the second Rectangle object falls entirely - * within the boundaries of the first. - * - * @param rect The Rectangle object being checked. - * @return A value of true if the Rectangle object that you - * specify is contained by this Rectangle object; otherwise - * false. - */ - public containsRect(rect: Rectangle): boolean; - /** - * Copies all of rectangle data from the source Rectangle object into the - * calling Rectangle object. - * - * @param sourceRect The Rectangle object from which to copy the data. - */ - public copyFrom(sourceRect: Rectangle): void; - /** - * Determines whether the object specified in the toCompare - * parameter is equal to this Rectangle object. This method compares the - * x, y, width, and - * height properties of an object against the same properties of - * this Rectangle object. - * - * @param toCompare The rectangle to compare to this Rectangle object. - * @return A value of true if the object has exactly the same - * values for the x, y, width, - * and height properties as this Rectangle object; - * otherwise false. - */ - public equals(toCompare: Rectangle): boolean; - /** - * Increases the size of the Rectangle object by the specified amounts, in - * pixels. The center point of the Rectangle object stays the same, and its - * size increases to the left and right by the dx value, and to - * the top and the bottom by the dy value. - * - * @param dx The value to be added to the left and the right of the Rectangle - * object. The following equation is used to calculate the new - * width and position of the rectangle: - * @param dy The value to be added to the top and the bottom of the - * Rectangle. The following equation is used to calculate the new - * height and position of the rectangle: - */ - public inflate(dx: number, dy: number): void; - /** - * Increases the size of the Rectangle object. This method is similar to the - * Rectangle.inflate() method except it takes a Point object as - * a parameter. - * - *

The following two code examples give the same result:

- * - * @param point The x property of this Point object is used to - * increase the horizontal dimension of the Rectangle object. - * The y property is used to increase the vertical - * dimension of the Rectangle object. - */ - public inflatePoint(point: Point): void; - /** - * If the Rectangle object specified in the toIntersect - * parameter intersects with this Rectangle object, returns the area of - * intersection as a Rectangle object. If the rectangles do not intersect, - * this method returns an empty Rectangle object with its properties set to - * 0. - * - * @param toIntersect The Rectangle object to compare against to see if it - * intersects with this Rectangle object. - * @return A Rectangle object that equals the area of intersection. If the - * rectangles do not intersect, this method returns an empty - * Rectangle object; that is, a rectangle with its x, - * y, width, and height - * properties set to 0. - */ - public intersection(toIntersect: Rectangle): Rectangle; - /** - * Determines whether the object specified in the toIntersect - * parameter intersects with this Rectangle object. This method checks the - * x, y, width, and - * height properties of the specified Rectangle object to see if - * it intersects with this Rectangle object. - * - * @param toIntersect The Rectangle object to compare against this Rectangle - * object. - * @return A value of true if the specified object intersects - * with this Rectangle object; otherwise false. - */ - public intersects(toIntersect: Rectangle): boolean; - /** - * Determines whether or not this Rectangle object is empty. - * - * @return A value of true if the Rectangle object's width or - * height is less than or equal to 0; otherwise false. - */ - public isEmpty(): boolean; - /** - * Adjusts the location of the Rectangle object, as determined by its - * top-left corner, by the specified amounts. - * - * @param dx Moves the x value of the Rectangle object by this amount. - * @param dy Moves the y value of the Rectangle object by this amount. - */ - public offset(dx: number, dy: number): void; - /** - * Adjusts the location of the Rectangle object using a Point object as a - * parameter. This method is similar to the Rectangle.offset() - * method, except that it takes a Point object as a parameter. - * - * @param point A Point object to use to offset this Rectangle object. - */ - public offsetPoint(point: Point): void; - /** - * Sets all of the Rectangle object's properties to 0. A Rectangle object is - * empty if its width or height is less than or equal to 0. - * - *

This method sets the values of the x, y, - * width, and height properties to 0.

- * - */ - public setEmpty(): void; - /** - * Sets the members of Rectangle to the specified values - * - * @param xa The x coordinate of the top-left corner of the - * rectangle. - * @param ya The y coordinate of the top-left corner of the - * rectangle. - * @param widtha The width of the rectangle, in pixels. - * @param heighta The height of the rectangle, in pixels. - */ - public setTo(xa: number, ya: number, widtha: number, heighta: number): void; - /** - * Builds and returns a string that lists the horizontal and vertical - * positions and the width and height of the Rectangle object. - * - * @return A string listing the value of each of the following properties of - * the Rectangle object: x, y, - * width, and height. - */ - public toString(): string; - /** - * Adds two rectangles together to create a new Rectangle object, by filling - * in the horizontal and vertical space between the two rectangles. - * - *

Note: The union() method ignores rectangles with - * 0 as the height or width value, such as: var - * rect2:Rectangle = new Rectangle(300,300,50,0);

- * - * @param toUnion A Rectangle object to add to this Rectangle object. - * @return A new Rectangle object that is the union of the two rectangles. - */ - public union(toUnion: Rectangle): Rectangle; - } -} -/** -* The Transform class provides access to color adjustment properties and two- -* or three-dimensional transformation objects that can be applied to a -* display object. During the transformation, the color or the orientation and -* position of a display object is adjusted(offset) from the current values -* or coordinates to new values or coordinates. The Transform class also -* collects data about color and two-dimensional matrix transformations that -* are applied to a display object and all of its parent objects. You can -* access these combined transformations through the -* concatenatedColorTransform and concatenatedMatrix -* properties. -* -*

To apply color transformations: create a ColorTransform object, set the -* color adjustments using the object's methods and properties, and then -* assign the colorTransformation property of the -* transform property of the display object to the new -* ColorTransformation object.

-* -*

To apply two-dimensional transformations: create a Matrix object, set -* the matrix's two-dimensional transformation, and then assign the -* transform.matrix property of the display object to the new -* Matrix object.

-* -*

To apply three-dimensional transformations: start with a -* three-dimensional display object. A three-dimensional display object has a -* z property value other than zero. You do not need to create -* the Matrix3D object. For all three-dimensional objects, a Matrix3D object -* is created automatically when you assign a z value to a -* display object. You can access the display object's Matrix3D object through -* the display object's transform property. Using the methods of -* the Matrix3D class, you can add to or modify the existing transformation -* settings. Also, you can create a custom Matrix3D object, set the custom -* Matrix3D object's transformation elements, and then assign the new Matrix3D -* object to the display object using the transform.matrix -* property.

-* -*

To modify a perspective projection of the stage or root object: use the -* transform.matrix property of the root display object to gain -* access to the PerspectiveProjection object. Or, apply different perspective -* projection properties to a display object by setting the perspective -* projection properties of the display object's parent. The child display -* object inherits the new properties. Specifically, create a -* PerspectiveProjection object and set its properties, then assign the -* PerspectiveProjection object to the perspectiveProjection -* property of the parent display object's transform property. -* The specified projection transformation then applies to all the display -* object's three-dimensional children.

-* -*

Since both PerspectiveProjection and Matrix3D objects perform -* perspective transformations, do not assign both to a display object at the -* same time. Use the PerspectiveProjection object for focal length and -* projection center changes. For more control over the perspective -* transformation, create a perspective projection Matrix3D object.

-*/ -declare module away.geom { - class Transform { - private _displayObject; - private _concatenatedColorTransform; - private _concatenatedMatrix; - private _pixelBounds; - public _position: Vector3D; - /** - * - */ - public backVector : Vector3D; - /** - * A ColorTransform object containing values that universally adjust the - * colors in the display object. - * - * @throws TypeError The colorTransform is null when being set - */ - public colorTransform: ColorTransform; - /** - * A ColorTransform object representing the combined color transformations - * applied to the display object and all of its parent objects, back to the - * root level. If different color transformations have been applied at - * different levels, all of those transformations are concatenated into one - * ColorTransform object for this property. - */ - public concatenatedColorTransform : ColorTransform; - /** - * A Matrix object representing the combined transformation matrixes of the - * display object and all of its parent objects, back to the root level. If - * different transformation matrixes have been applied at different levels, - * all of those matrixes are concatenated into one matrix for this property. - * Also, for resizeable SWF content running in the browser, this property - * factors in the difference between stage coordinates and window coordinates - * due to window resizing. Thus, the property converts local coordinates to - * window coordinates, which may not be the same coordinate space as that of - * the Stage. - */ - public concatenatedMatrix : Matrix; - /** - * - */ - public downVector : Vector3D; - /** - * - */ - public forwardVector : Vector3D; - /** - * - */ - public leftVector : Vector3D; - /** - * A Matrix object containing values that alter the scaling, rotation, and - * translation of the display object. - * - *

If the matrix property is set to a value(not - * null), the matrix3D property is - * null. And if the matrix3D property is set to a - * value(not null), the matrix property is - * null.

- * - * @throws TypeError The matrix is null when being set - */ - public matrix: Matrix; - /** - * Provides access to the Matrix3D object of a three-dimensional display - * object. The Matrix3D object represents a transformation matrix that - * determines the display object's position and orientation. A Matrix3D - * object can also perform perspective projection. - * - *

If the matrix property is set to a value(not - * null), the matrix3D property is - * null. And if the matrix3D property is set to a - * value(not null), the matrix property is - * null.

- */ - public matrix3D : Matrix3D; - /** - * Provides access to the PerspectiveProjection object of a three-dimensional - * display object. The PerspectiveProjection object can be used to modify the - * perspective transformation of the stage or to assign a perspective - * transformation to all the three-dimensional children of a display object. - * - *

Based on the field of view and aspect ratio(dimensions) of the stage, - * a default PerspectiveProjection object is assigned to the root object.

- */ - public perspectiveProjection: PerspectiveProjection; - /** - * A Rectangle object that defines the bounding rectangle of the display - * object on the stage. - */ - public pixelBounds : Rectangle; - /** - * Defines the position of the 3d object, relative to the local coordinates of the parent ObjectContainer3D. - */ - public position : Vector3D; - /** - * - */ - public rightVector : Vector3D; - /** - * Defines the rotation of the 3d object, relative to the local coordinates of the parent ObjectContainer3D. - */ - public rotation : Vector3D; - /** - * Defines the scale of the 3d object, relative to the local coordinates of the parent ObjectContainer3D. - */ - public scale : Vector3D; - /** - * - */ - public upVector : Vector3D; - constructor(displayObject: base.DisplayObject); - /** - * Returns a Matrix3D object, which can transform the space of a specified - * display object in relation to the current display object's space. You can - * use the getRelativeMatrix3D() method to move one - * three-dimensional display object relative to another three-dimensional - * display object. - * - * @param relativeTo The display object relative to which the transformation - * occurs. To get a Matrix3D object relative to the stage, - * set the parameter to the root or - * stage object. To get the world-relative - * matrix of the display object, set the parameter to a - * display object that has a perspective transformation - * applied to it. - * @return A Matrix3D object that can be used to transform the space from the - * relativeTo display object to the current display - * object space. - */ - public getRelativeMatrix3D(relativeTo: base.DisplayObject): Matrix3D; - /** - * Moves the 3d object forwards along it's local z axis - * - * @param distance The length of the movement - */ - public moveForward(distance: number): void; - /** - * Moves the 3d object backwards along it's local z axis - * - * @param distance The length of the movement - */ - public moveBackward(distance: number): void; - /** - * Moves the 3d object backwards along it's local x axis - * - * @param distance The length of the movement - */ - public moveLeft(distance: number): void; - /** - * Moves the 3d object forwards along it's local x axis - * - * @param distance The length of the movement - */ - public moveRight(distance: number): void; - /** - * Moves the 3d object forwards along it's local y axis - * - * @param distance The length of the movement - */ - public moveUp(distance: number): void; - /** - * Moves the 3d object backwards along it's local y axis - * - * @param distance The length of the movement - */ - public moveDown(distance: number): void; - } -} -declare module away.geom { - class UVTransform { - private _uvMatrix; - private _uvMatrixDirty; - private _rotation; - private _scaleU; - private _scaleV; - private _offsetU; - private _offsetV; - /** - * - */ - public offsetU : number; - /** - * - */ - public offsetV : number; - /** - * - */ - public rotation : number; - /** - * - */ - public scaleU : number; - /** - * - */ - public scaleV : number; - /** - * - */ - public matrix : Matrix; - constructor(); - /** - * @private - */ - private updateUVMatrix(); - } -} -/** -* The Vector3D class represents a point or a location in the three-dimensional -* space using the Cartesian coordinates x, y, and z. As in a two-dimensional -* space, the x property represents the horizontal axis and the y property -* represents the vertical axis. In three-dimensional space, the z property -* represents depth. The value of the x property increases as the object moves -* to the right. The value of the y property increases as the object moves -* down. The z property increases as the object moves farther from the point -* of view. Using perspective projection and scaling, the object is seen to be -* bigger when near and smaller when farther away from the screen. As in a -* right-handed three-dimensional coordinate system, the positive z-axis points -* away from the viewer and the value of the z property increases as the object -* moves away from the viewer's eye. The origin point (0,0,0) of the global -* space is the upper-left corner of the stage. -* -*

The Vector3D class can also represent a direction, an arrow pointing from -* the origin of the coordinates, such as (0,0,0), to an endpoint; or a -* floating-point component of an RGB (Red, Green, Blue) color model.

-* -*

Quaternion notation introduces a fourth element, the w property, which -* provides additional orientation information. For example, the w property can -* define an angle of rotation of a Vector3D object. The combination of the -* angle of rotation and the coordinates x, y, and z can determine the display -* object's orientation. Here is a representation of Vector3D elements in -* matrix notation:

-*/ -declare module away.geom { - class Vector3D { - /** - * The x axis defined as a Vector3D object with coordinates (1,0,0). - */ - static X_AXIS: Vector3D; - /** - * The y axis defined as a Vector3D object with coordinates (0,1,0). - */ - static Y_AXIS: Vector3D; - /** - * The z axis defined as a Vector3D object with coordinates (0,0,1). - */ - static Z_AXIS: Vector3D; - /** - * The first element of a Vector3D object, such as the x coordinate of - * a point in the three-dimensional space. The default value is 0. - */ - public x: number; - public y: number; - /** - * The third element of a Vector3D object, such as the y coordinate of - * a point in the three-dimensional space. The default value is 0. - */ - public z: number; - /** - * TThe fourth element of a Vector3D object (in addition to the x, y, - * and z properties) can hold data such as the angle of rotation. The - * default value is 0. - * - *

Quaternion notation employs an angle as the fourth element in - * its calculation of three-dimensional rotation. The w property can - * be used to define the angle of rotation about the Vector3D object. - * The combination of the rotation angle and the coordinates (x,y,z) - * determines the display object's orientation.

- * - *

In addition, the w property can be used as a perspective warp - * factor for a projected three-dimensional position or as a projection - * transform value in representing a three-dimensional coordinate - * projected into the two-dimensional space. For example, you can - * create a projection matrix using the Matrix3D.rawData - * property, that, when applied to a Vector3D object, produces a - * transform value in the Vector3D object's fourth element (the w - * property). Dividing the Vector3D object's other elements by the - * transform value then produces a projected Vector3D object. You can - * use the Vector3D.project() method to divide the first - * three elements of a Vector3D object by its fourth element.

- */ - public w: number; - /** - * The length, magnitude, of the current Vector3D object from the - * origin (0,0,0) to the object's x, y, and z coordinates. The w - * property is ignored. A unit vector has a length or magnitude of - * one. - */ - public length : number; - /** - * The square of the length of the current Vector3D object, calculated - * using the x, y, and z properties. The w property is ignored. Use the - * lengthSquared() method whenever possible instead of the - * slower Math.sqrt() method call of the - * Vector3D.length() method. - */ - public lengthSquared : number; - /** - * Creates an instance of a Vector3D object. If you do not specify a - * parameter for the constructor, a Vector3D object is created with - * the elements (0,0,0,0). - * - * @param x The first element, such as the x coordinate. - * @param y The second element, such as the y coordinate. - * @param z The third element, such as the z coordinate. - * @param w An optional element for additional data such as the angle - * of rotation. - */ - constructor(x?: number, y?: number, z?: number, w?: number); - /** - * Adds the value of the x, y, and z elements of the current Vector3D - * object to the values of the x, y, and z elements of another Vector3D - * object. The add() method does not change the current - * Vector3D object. Instead, it returns a new Vector3D object with - * the new values. - * - *

The result of adding two vectors together is a resultant vector. - * One way to visualize the result is by drawing a vector from the - * origin or tail of the first vector to the end or head of the second - * vector. The resultant vector is the distance between the origin - * point of the first vector and the end point of the second vector. - *

- */ - public add(a: Vector3D): Vector3D; - /** - * Returns the angle in radians between two vectors. The returned angle - * is the smallest radian the first Vector3D object rotates until it - * aligns with the second Vector3D object. - * - *

The angleBetween() method is a static method. You - * can use it directly as a method of the Vector3D class.

- * - *

To convert a degree to a radian, you can use the following - * formula:

- * - *

radian = Math.PI/180 * degree

- * - * @param a The first Vector3D object. - * @param b The second Vector3D object. - * @returns The angle between two Vector3D objects. - */ - static angleBetween(a: Vector3D, b: Vector3D): number; - /** - * Returns a new Vector3D object that is an exact copy of the current - * Vector3D object. - * - * @returns A new Vector3D object that is a copy of the current - * Vector3D object. - */ - public clone(): Vector3D; - /** - * Copies all of vector data from the source Vector3D object into the - * calling Vector3D object. - * - * @param src The Vector3D object from which to copy the data. - */ - public copyFrom(src: Vector3D): void; - /** - * Returns a new Vector3D object that is perpendicular (at a right - * angle) to the current Vector3D and another Vector3D object. If the - * returned Vector3D object's coordinates are (0,0,0), then the two - * Vector3D objects are parallel to each other. - * - *

You can use the normalized cross product of two vertices of a - * polygon surface with the normalized vector of the camera or eye - * viewpoint to get a dot product. The value of the dot product can - * identify whether a surface of a three-dimensional object is hidden - * from the viewpoint.

- * - * @param a A second Vector3D object. - * @returns A new Vector3D object that is perpendicular to the current - * Vector3D object and the Vector3D object specified as the - * parameter. - */ - public crossProduct(a: Vector3D): Vector3D; - /** - * Decrements the value of the x, y, and z elements of the current - * Vector3D object by the values of the x, y, and z elements of - * specified Vector3D object. Unlike the - * Vector3D.subtract() method, the - * decrementBy() method changes the current Vector3D - * object and does not return a new Vector3D object. - * - * @param a The Vector3D object containing the values to subtract from - * the current Vector3D object. - */ - public decrementBy(a: Vector3D): void; - /** - * Returns the distance between two Vector3D objects. The - * distance() method is a static method. You can use it - * directly as a method of the Vector3D class to get the Euclidean - * distance between two three-dimensional points. - * - * @param pt1 A Vector3D object as the first three-dimensional point. - * @param pt2 A Vector3D object as the second three-dimensional point. - * @returns The distance between two Vector3D objects. - */ - static distance(pt1: Vector3D, pt2: Vector3D): number; - /** - * If the current Vector3D object and the one specified as the - * parameter are unit vertices, this method returns the cosine of the - * angle between the two vertices. Unit vertices are vertices that - * point to the same direction but their length is one. They remove the - * length of the vector as a factor in the result. You can use the - * normalize() method to convert a vector to a unit - * vector. - * - *

The dotProduct() method finds the angle between two - * vertices. It is also used in backface culling or lighting - * calculations. Backface culling is a procedure for determining which - * surfaces are hidden from the viewpoint. You can use the normalized - * vertices from the camera, or eye, viewpoint and the cross product of - * the vertices of a polygon surface to get the dot product. If the dot - * product is less than zero, then the surface is facing the camera or - * the viewer. If the two unit vertices are perpendicular to each - * other, they are orthogonal and the dot product is zero. If the two - * vertices are parallel to each other, the dot product is one.

- * - * @param a The second Vector3D object. - * @returns A scalar which is the dot product of the current Vector3D - * object and the specified Vector3D object. - * - * @see away.geom.Vector3D#crossProduct() - * @see away.geom.Vector3D#normalize() - */ - public dotProduct(a: Vector3D): number; - /** - * Determines whether two Vector3D objects are equal by comparing the - * x, y, and z elements of the current Vector3D object with a - * specified Vector3D object. If the values of these elements are the - * same, the two Vector3D objects are equal. If the second optional - * parameter is set to true, all four elements of the Vector3D objects, - * including the w property, are compared. - */ - /** - * - * @param toCompare The Vector3D object to be compared with the current - * Vector3D object. - * @param allFour An optional parameter that specifies whether the w - * property of the Vector3D objects is used in the - * comparison. - * @returns A value of true if the specified Vector3D object is equal - * to the current Vector3D object; false if it is not equal. - */ - public equals(toCompare: Vector3D, allFour?: boolean): boolean; - /** - * Increments the value of the x, y, and z elements of the current - * Vector3D object by the values of the x, y, and z elements of a - * specified Vector3D object. Unlike the Vector3D.add() - * method, the incrementBy() method changes the current - * Vector3D object and does not return a new Vector3D object. - * - * @param a The Vector3D object to be added to the current Vector3D - * object. - */ - public incrementBy(a: Vector3D): void; - /** - * Compares the elements of the current Vector3D object with the - * elements of a specified Vector3D object to determine whether they - * are nearly equal. The two Vector3D objects are nearly equal if the - * value of all the elements of the two vertices are equal, or the - * result of the comparison is within the tolerance range. The - * difference between two elements must be less than the number - * specified as the tolerance parameter. If the third optional - * parameter is set to true, all four elements of the - * Vector3D objects, including the w property, are - * compared. Otherwise, only the x, y, and z elements are included in - * the comparison. - */ - /** - * - * @param toCompare The Vector3D object to be compared with the current - * Vector3D object. - * @param tolerance A number determining the tolerance factor. If the - * difference between the values of the Vector3D - * element specified in the toCompare parameter and - * the current Vector3D element is less than the - * tolerance number, the two values are considered - * nearly equal. - * @param allFour An optional parameter that specifies whether the w - * property of the Vector3D objects is used in the - * comparison. - * @returns A value of true if the specified Vector3D object is nearly - * equal to the current Vector3D object; false if it is not - * equal. - * - * @see away.geom.Vector3D#equals() - */ - public nearEquals(toCompare: Vector3D, tolerance: number, allFour?: boolean): boolean; - /** - * Sets the current Vector3D object to its inverse. The inverse object - * is also considered the opposite of the original object. The value of - * the x, y, and z properties of the current Vector3D object is changed - * to -x, -y, and -z. - */ - public negate(): void; - /** - * Converts a Vector3D object to a unit vector by dividing the first - * three elements (x, y, z) by the length of the vector. Unit vertices - * are vertices that have a direction but their length is one. They - * simplify vector calculations by removing length as a factor. - */ - /** - * Scales the line segment between(0,0) and the current point to a set - * length. - * - * @param thickness The scaling value. For example, if the current - * Vector3D object is (0,3,4), and you normalize it to - * 1, the point returned is at(0,0.6,0.8). - */ - public normalize(thickness?: number): void; - /** - * Divides the value of the x, y, and - * z properties of the current Vector3D object by the - * value of its w property. - * - *

If the current Vector3D object is the result of multiplying a - * Vector3D object by a projection Matrix3D object, the w property can - * hold the transform value. The project() method then can - * complete the projection by dividing the elements by the - * w property. Use the Matrix3D.rawData - * property to create a projection Matrix3D object.

- */ - public project(): void; - /** - * Scales the current Vector3D object by a scalar, a magnitude. The - * Vector3D object's x, y, and z elements are multiplied by the scalar - * number specified in the parameter. For example, if the vector is - * scaled by ten, the result is a vector that is ten times longer. The - * scalar can also change the direction of the vector. Multiplying the - * vector by a negative number reverses its direction. - * - * @param s A multiplier (scalar) used to scale a Vector3D object. - - */ - public scaleBy(s: number): void; - /** - * Sets the members of Vector3D to the specified values - * - * @param xa The first element, such as the x coordinate. - * @param ya The second element, such as the y coordinate. - * @param za The third element, such as the z coordinate. - */ - public setTo(xa: number, ya: number, za: number): void; - /** - * Subtracts the value of the x, y, and z elements of the current - * Vector3D object from the values of the x, y, and z elements of - * another Vector3D object. The subtract() method does not - * change the current Vector3D object. Instead, this method returns a - * new Vector3D object with the new values. - * - * @param a The Vector3D object to be subtracted from the current - * Vector3D object. - * @returns A new Vector3D object that is the difference between the - * current Vector3D and the specified Vector3D object. - * - * @see away.geom.Vector3D#decrementBy() - */ - public subtract(a: Vector3D): Vector3D; - /** - * Returns a string representation of the current Vector3D object. The - * string contains the values of the x, y, and z properties. - */ - public toString(): string; - } -} -declare module away.bounds { - class BoundingVolumeBase { - public _aabb: geom.Box; - public _pAabbPoints: number[]; - public _pAabbPointsDirty: boolean; - public _pBoundingEntity: entities.IEntity; - constructor(); - public aabb : geom.Box; - public aabbPoints : number[]; - public boundingEntity : entities.IEntity; - public nullify(): void; - public disposeRenderable(): void; - public fromVertices(vertices: number[]): void; - /** - * Updates the bounds to fit a Geometry object. - * - * @param geometry The Geometry object to be bounded. - */ - public fromGeometry(geometry: base.Geometry): void; - public fromSphere(center: geom.Vector3D, radius: number): void; - public fromExtremes(minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number): void; - public isInFrustum(planes: geom.Plane3D[], numPlanes: number): boolean; - public overlaps(bounds: BoundingVolumeBase): boolean; - public clone(): BoundingVolumeBase; - public rayIntersection(position: geom.Vector3D, direction: geom.Vector3D, targetNormal: geom.Vector3D): number; - public containsPoint(position: geom.Vector3D): boolean; - public pUpdateAABBPoints(): void; - public pUpdateBoundingEntity(): void; - public pCreateBoundingEntity(): entities.IEntity; - public classifyToPlane(plane: geom.Plane3D): number; - public transformFrom(bounds: BoundingVolumeBase, matrix: geom.Matrix3D): void; - } -} -declare module away.bounds { - class NullBounds extends BoundingVolumeBase { - private _alwaysIn; - constructor(alwaysIn?: boolean); - public clone(): BoundingVolumeBase; - public pCreateBoundingEntity(): entities.IEntity; - public isInFrustum(planes: geom.Plane3D[], numPlanes: number): boolean; - public fromSphere(center: geom.Vector3D, radius: number): void; - public fromExtremes(minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number): void; - public classifyToPlane(plane: geom.Plane3D): number; - public transformFrom(bounds: BoundingVolumeBase, matrix: geom.Matrix3D): void; - } -} -declare module away.bounds { - class BoundingSphere extends BoundingVolumeBase { - private _radius; - private _centerX; - private _centerY; - private _centerZ; - constructor(); - public radius : number; - public nullify(): void; - public isInFrustum(planes: geom.Plane3D[], numPlanes: number): boolean; - public fromSphere(center: geom.Vector3D, radius: number): void; - public fromExtremes(minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number): void; - public clone(): BoundingVolumeBase; - public rayIntersection(position: geom.Vector3D, direction: geom.Vector3D, targetNormal: geom.Vector3D): number; - public containsPoint(position: geom.Vector3D): boolean; - public pUpdateBoundingEntity(): void; - public pCreateBoundingEntity(): entities.IEntity; - public classifyToPlane(plane: geom.Plane3D): number; - public transformFrom(bounds: BoundingVolumeBase, matrix: geom.Matrix3D): void; - } -} -declare module away.bounds { - /** - * AxisAlignedBoundingBox represents a bounding box volume that has its planes aligned to the local coordinate axes of the bounded object. - * This is useful for most meshes. - */ - class AxisAlignedBoundingBox extends BoundingVolumeBase { - private _centerX; - private _centerY; - private _centerZ; - private _halfExtentsX; - private _halfExtentsY; - private _halfExtentsZ; - /** - * Creates a new AxisAlignedBoundingBox object. - */ - constructor(); - /** - * @inheritDoc - */ - public nullify(): void; - /** - * @inheritDoc - */ - public isInFrustum(planes: geom.Plane3D[], numPlanes: number): boolean; - public rayIntersection(position: geom.Vector3D, direction: geom.Vector3D, targetNormal: geom.Vector3D): number; - /** - * @inheritDoc - */ - public containsPoint(position: geom.Vector3D): boolean; - /** - * @inheritDoc - */ - public fromExtremes(minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number): void; - /** - * @inheritDoc - */ - public clone(): BoundingVolumeBase; - public halfExtentsX : number; - public halfExtentsY : number; - public halfExtentsZ : number; - /** - * Finds the closest point on the bounding volume to another given point. This can be used for maximum error calculations for content within a given bound. - * @param point The point for which to find the closest point on the bounding volume - * @param target An optional Vector3D to store the result to prevent creating a new object. - * @return - */ - public closestPointToPoint(point: geom.Vector3D, target?: geom.Vector3D): geom.Vector3D; - public pUpdateBoundingRenderable(): void; - public pCreateBoundingEntity(): entities.IEntity; - public classifyToPlane(plane: geom.Plane3D): number; - public transformFrom(bounds: BoundingVolumeBase, matrix: geom.Matrix3D): void; - } -} -declare module away.net { - /** - * - */ - class URLRequest { - /** - * Object containing data to be transmited with URL Request ( URL Variables / binary / string ) - * - */ - public data: any; - /** - * - * away.net.URLRequestMethod.GET - * away.net.URLRequestMethod.POST - * - * @type {string} - */ - public method: string; - /** - * Use asynchronous XMLHttpRequest - * @type {boolean} - */ - public async: boolean; - /** - * - */ - private _url; - /** - - * @param url - */ - constructor(url?: string); - /** - * - * @returns {string} - */ - /** - * - * @param value - */ - public url : string; - /** - * dispose - */ - public dispose(): void; - } -} -declare module away.net { - class URLLoaderDataFormat { - /** - * TEXT - * @type {string} - */ - static TEXT: string; - /** - * Variables / Value Pairs - * @type {string} - */ - static VARIABLES: string; - /** - * - * @type {string} - */ - static BLOB: string; - /** - * - * @type {string} - */ - static ARRAY_BUFFER: string; - /** - * - * @type {string} - */ - static BINARY: string; - } -} -declare module away.net { - class URLRequestMethod { - /** - * - * @type {string} - */ - static POST: string; - /** - * - * @type {string} - */ - static GET: string; - } -} -declare module away.net { - /** - * The URLLoader is used to load a single file, as part of a resource. - * - * While URLLoader can be used directly, e.g. to create a third-party asset - * management system, it's recommended to use any of the classes Loader3D, AssetLoader - * and AssetLibrary instead in most cases. - * - * @see AssetLoader - * @see away.library.AssetLibrary - */ - class URLLoader extends events.EventDispatcher { - private _XHR; - private _bytesLoaded; - private _bytesTotal; - private _dataFormat; - private _loadError; - private _request; - private _data; - private _loadStartEvent; - private _loadErrorEvent; - private _loadCompleteEvent; - private _progressEvent; - /** - * Creates a new URLLoader object. - */ - constructor(); - /** - * - */ - public url : string; - /** - * - */ - public data : any; - /** - * - * URLLoaderDataFormat.BINARY - * URLLoaderDataFormat.TEXT - * URLLoaderDataFormat.VARIABLES - * - * @param format - */ - public dataFormat : string; - /** - * - * @returns {number} - */ - public bytesLoaded : number; - /** - * - * @returns {number} - */ - public bytesTotal : number; - /** - * Load a resource from a file. - * - * @param request The URLRequest object containing the URL of the object to be loaded. - */ - public load(request: URLRequest): void; - /** - * - */ - public close(): void; - /** - * - */ - public dispose(): void; - /** - * - * @param xhr - * @param responseType - */ - private setResponseType(xhr, responseType); - /** - * - * @param request {URLRequest} - */ - private getRequest(request); - /** - * - * @param request {URLRequest} - */ - private postRequest(request); - /** - * - * @param error {XMLHttpRequestException} - */ - private handleXmlHttpRequestException(error); - /** - * - */ - private initXHR(); - /** - * - */ - private disposeXHR(); - /** - * - * @param source - */ - public decodeURLVariables(source: string): Object; - /** - * When XHR state changes - * @param event - */ - private onReadyStateChange(event); - /** - * When the request has completed, regardless of whether or not it was successful. - * @param event - */ - private onLoadEnd(event); - /** - * When the author specified timeout has passed before the request could complete. - * @param event - */ - private onTimeOut(event); - /** - * When the request has been aborted, either by invoking the abort() method or navigating away from the page. - * @param event - */ - private onAbort(event); - /** - * While loading and sending data. - * @param event - */ - private onProgress(event); - /** - * When the request starts. - * @param event - */ - private onLoadStart(event); - /** - * When the request has successfully completed. - * @param event - */ - private onLoadComplete(event); - /** - * When the request has failed. ( due to network issues ). - * @param event - */ - private onLoadError(event); - } -} -declare module away.net { - class URLVariables { - private _variables; - /** - * - * @param source - */ - constructor(source?: string); - /** - * - * @param source - */ - public decode(source: string): void; - /** - * - * @returns {string} - */ - public toString(): string; - /** - * - * @returns {Object} - */ - /** - * - * @returns {Object} - */ - public variables : Object; - /** - * - * @returns {Object} - */ - public formData : FormData; - } -} -declare module away.library { - interface IAsset extends events.IEventDispatcher { - name: string; - id: number; - assetNamespace: string; - assetType: string; - assetFullPath: string[]; - assetPathEquals(name: string, ns: string): boolean; - resetAssetPath(name: string, ns: string, overrideOriginal?: boolean): void; - dispose(): any; - } -} -declare module away.library { - class NamedAssetBase extends events.EventDispatcher { - static ID_COUNT: number; - private _originalName; - private _namespace; - private _name; - private _id; - private _full_path; - static DEFAULT_NAMESPACE: string; - constructor(name?: string); - /** - * - */ - public assetType : string; - /** - * The original name used for this asset in the resource (e.g. file) in which - * it was found. This may not be the same as name, which may - * have changed due to of a name conflict. - */ - public originalName : string; - /** - * A unique id for the asset, used to identify assets in an associative array - */ - public id : number; - public name : string; - public dispose(): void; - public assetNamespace : string; - public assetFullPath : string[]; - public assetPathEquals(name: string, ns: string): boolean; - public resetAssetPath(name: string, ns?: string, overrideOriginal?: boolean): void; - private updateFullPath(); - } -} -declare module away.library { - class AssetType { - static ANIMATION_NODE: string; - static ANIMATION_SET: string; - static ANIMATION_STATE: string; - static ANIMATOR: string; - static BILLBOARD: string; - static CAMERA: string; - static CONTAINER: string; - static EFFECTS_METHOD: string; - static GEOMETRY: string; - static LINE_SEGMENT: string; - static LIGHT: string; - static LIGHT_PICKER: string; - static MATERIAL: string; - static MESH: string; - static TRIANGLE_SUB_MESH: string; - static LINE_SUB_MESH: string; - static PRIMITIVE_PREFAB: string; - static SHADOW_MAP_METHOD: string; - static SKELETON: string; - static SKELETON_POSE: string; - static SKYBOX: string; - static STATE_TRANSITION: string; - static TEXTURE: string; - static TEXTURE_PROJECTOR: string; - } -} -declare module away.display { - class ContextMode { - static AUTO: string; - static WEBGL: string; - static FLASH: string; - static NATIVE: string; - } -} -/** -* @module away.base -*/ -declare module away.display { - /** - * - * @class away.base.IContext - */ - interface IContext { - container: HTMLElement; - clear(red?: number, green?: number, blue?: number, alpha?: number, depth?: number, stencil?: number, mask?: number): any; - configureBackBuffer(width: number, height: number, antiAlias: number, enableDepthAndStencil?: boolean): any; - dispose(): any; - present(): any; - setScissorRectangle(rect: geom.Rectangle): any; - } -} -/** -* A class that provides constant values for visual blend mode effects. These -* constants are used in the following: -*
    -*
  • The blendMode property of the -* flash.display.DisplayObject class.
  • -*
  • The blendMode parameter of the draw() -* method of the flash.display.BitmapData class
  • -*
-*/ -declare module away.base { - class BlendMode { - /** - * Adds the values of the constituent colors of the display object to the - * colors of its background, applying a ceiling of 0xFF. This setting is - * commonly used for animating a lightening dissolve between two objects. - * - *

For example, if the display object has a pixel with an RGB value of - * 0xAAA633, and the background pixel has an RGB value of 0xDD2200, the - * resulting RGB value for the displayed pixel is 0xFFC833(because 0xAA + - * 0xDD > 0xFF, 0xA6 + 0x22 = 0xC8, and 0x33 + 0x00 = 0x33).

- */ - static ADD: string; - /** - * Applies the alpha value of each pixel of the display object to the - * background. This requires the blendMode property of the - * parent display object be set to - * away.base.BlendMode.LAYER. - * - *

Not supported under GPU rendering.

- */ - static ALPHA: string; - /** - * Selects the darker of the constituent colors of the display object and the - * colors of the background(the colors with the smaller values). This - * setting is commonly used for superimposing type. - * - *

For example, if the display object has a pixel with an RGB value of - * 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the - * resulting RGB value for the displayed pixel is 0xDDCC00(because 0xFF > - * 0xDD, 0xCC < 0xF8, and 0x33 > 0x00 = 33).

- * - *

Not supported under GPU rendering.

- */ - static DARKEN: string; - /** - * Compares the constituent colors of the display object with the colors of - * its background, and subtracts the darker of the values of the two - * constituent colors from the lighter value. This setting is commonly used - * for more vibrant colors. - * - *

For example, if the display object has a pixel with an RGB value of - * 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the - * resulting RGB value for the displayed pixel is 0x222C33(because 0xFF - - * 0xDD = 0x22, 0xF8 - 0xCC = 0x2C, and 0x33 - 0x00 = 0x33).

- */ - static DIFFERENCE: string; - /** - * Erases the background based on the alpha value of the display object. This - * process requires that the blendMode property of the parent - * display object be set to flash.display.BlendMode.LAYER. - * - *

Not supported under GPU rendering.

- */ - static ERASE: string; - /** - * Adjusts the color of each pixel based on the darkness of the display - * object. If the display object is lighter than 50% gray, the display object - * and background colors are screened, which results in a lighter color. If - * the display object is darker than 50% gray, the colors are multiplied, - * which results in a darker color. This setting is commonly used for shading - * effects. - * - *

Not supported under GPU rendering.

- */ - static HARDLIGHT: string; - /** - * Inverts the background. - */ - static INVERT: string; - /** - * Forces the creation of a transparency group for the display object. This - * means that the display object is precomposed in a temporary buffer before - * it is processed further. The precomposition is done automatically if the - * display object is precached by means of bitmap caching or if the display - * object is a display object container that has at least one child object - * with a blendMode setting other than "normal". - * - *

Not supported under GPU rendering.

- */ - static LAYER: string; - /** - * Selects the lighter of the constituent colors of the display object and - * the colors of the background(the colors with the larger values). This - * setting is commonly used for superimposing type. - * - *

For example, if the display object has a pixel with an RGB value of - * 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the - * resulting RGB value for the displayed pixel is 0xFFF833(because 0xFF > - * 0xDD, 0xCC < 0xF8, and 0x33 > 0x00 = 33).

- * - *

Not supported under GPU rendering.

- */ - static LIGHTEN: string; - /** - * Multiplies the values of the display object constituent colors by the - * constituent colors of the background color, and normalizes by dividing by - * 0xFF, resulting in darker colors. This setting is commonly used for - * shadows and depth effects. - * - *

For example, if a constituent color(such as red) of one pixel in the - * display object and the corresponding color of the pixel in the background - * both have the value 0x88, the multiplied result is 0x4840. Dividing by - * 0xFF yields a value of 0x48 for that constituent color, which is a darker - * shade than the color of the display object or the color of the - * background.

- */ - static MULTIPLY: string; - /** - * The display object appears in front of the background. Pixel values of the - * display object override the pixel values of the background. Where the - * display object is transparent, the background is visible. - */ - static NORMAL: string; - /** - * Adjusts the color of each pixel based on the darkness of the background. - * If the background is lighter than 50% gray, the display object and - * background colors are screened, which results in a lighter color. If the - * background is darker than 50% gray, the colors are multiplied, which - * results in a darker color. This setting is commonly used for shading - * effects. - * - *

Not supported under GPU rendering.

- */ - static OVERLAY: string; - /** - * Multiplies the complement(inverse) of the display object color by the - * complement of the background color, resulting in a bleaching effect. This - * setting is commonly used for highlights or to remove black areas of the - * display object. - */ - static SCREEN: string; - /** - * Uses a shader to define the blend between objects. - * - *

Setting the blendShader property to a Shader instance - * automatically sets the display object's blendMode property to - * BlendMode.SHADER. If the blendMode property is - * set to BlendMode.SHADER without first setting the - * blendShader property, the blendMode property is - * set to BlendMode.NORMAL instead. If the - * blendShader property is set(which sets the - * blendMode property to BlendMode.SHADER), then - * later the value of the blendMode property is changed, the - * blend mode can be reset to use the blend shader simply by setting the - * blendMode property to BlendMode.SHADER. The - * blendShader property does not need to be set again except to - * change the shader that's used to define the blend mode.

- * - *

Not supported under GPU rendering.

- */ - static SHADER: string; - /** - * Subtracts the values of the constituent colors in the display object from - * the values of the background color, applying a floor of 0. This setting is - * commonly used for animating a darkening dissolve between two objects. - * - *

For example, if the display object has a pixel with an RGB value of - * 0xAA2233, and the background pixel has an RGB value of 0xDDA600, the - * resulting RGB value for the displayed pixel is 0x338400(because 0xDD - - * 0xAA = 0x33, 0xA6 - 0x22 = 0x84, and 0x00 - 0x33 < 0x00).

- */ - static SUBTRACT: string; - } -} -/** -*/ -declare module away.base { - class AlignmentMode { - /** - * - */ - static REGISTRATION_POINT: string; - /** - * - */ - static PIVOT_POINT: string; - } -} -/** -*/ -declare module away.base { - class OrientationMode { - /** - * - */ - static DEFAULT: string; - /** - * - */ - static CAMERA_PLANE: string; - /** - * - */ - static CAMERA_POSITION: string; - } -} -declare module away.base { - /** - * - */ - class BitmapData { - private _imageCanvas; - private _context; - private _imageData; - private _rect; - private _transparent; - private _alpha; - private _locked; - /** - * - * @param width - * @param height - * @param transparent - * @param fillColor - */ - constructor(width: number, height: number, transparent?: boolean, fillColor?: number); - /** - * - */ - public dispose(): void; - /** - * - */ - public lock(): void; - /** - * - */ - public unlock(): void; - /** - * - * @param x - * @param y - * @param color - */ - public getPixel(x: any, y: any): number; - /** - * - * @param x - * @param y - * @param color - */ - public setPixel(x: any, y: any, color: number): void; - /** - * - * @param rect - * @param inputByteArray - */ - public setPixels(rect: geom.Rectangle, inputByteArray: utils.ByteArray): void; - /** - * - * @param x - * @param y - * @param color - */ - public setPixel32(x: any, y: any, color: number): void; - public setVector(rect: geom.Rectangle, inputVector: number[]): void; - /** - * Copy an HTMLImageElement or BitmapData object - * - * @param img {BitmapData} / {HTMLImageElement} - * @param sourceRect - source rectange to copy from - * @param destRect - destinatoin rectange to copy to - */ - public drawImage(img: BitmapData, sourceRect: geom.Rectangle, destRect: geom.Rectangle): any; - public drawImage(img: HTMLImageElement, sourceRect: geom.Rectangle, destRect: geom.Rectangle): any; - private _drawImage(img, sourceRect, destRect); - /** - * - * @param bmpd - * @param sourceRect - * @param destRect - */ - public copyPixels(bmpd: BitmapData, sourceRect: geom.Rectangle, destRect: geom.Rectangle): any; - public copyPixels(bmpd: HTMLImageElement, sourceRect: geom.Rectangle, destRect: geom.Rectangle): any; - private _copyPixels(bmpd, sourceRect, destRect); - /** - * - * @param rect - * @param color - */ - public fillRect(rect: geom.Rectangle, color: number): void; - /** - * - * @param source - * @param matrix - */ - public draw(source: BitmapData, matrix?: geom.Matrix): any; - public draw(source: HTMLImageElement, matrix?: geom.Matrix): any; - private _draw(source, matrix); - public copyChannel(sourceBitmap: BitmapData, sourceRect: geom.Rectangle, destPoint: geom.Point, sourceChannel: number, destChannel: number): void; - public colorTransform(rect: geom.Rectangle, colorTransform: geom.ColorTransform): void; - /** - * - * @returns {ImageData} - */ - /** - * - * @param {ImageData} - */ - public imageData : ImageData; - /** - * - * @returns {number} - */ - /** - * - * @param {number} - */ - public width : number; - /** - * - * @returns {number} - */ - /** - * - * @param {number} - */ - public height : number; - /** - * - * @param {Rectangle} - */ - public rect : geom.Rectangle; - /** - * - * @returns {HTMLCanvasElement} - */ - public canvas : HTMLCanvasElement; - /** - * - * @returns {HTMLCanvasElement} - */ - public context : CanvasRenderingContext2D; - /** - * convert decimal value to Hex - */ - private hexToRGBACSS(d); - } -} -declare module away.base { - class BitmapDataChannel { - static ALPHA: number; - static BLUE: number; - static GREEN: number; - static RED: number; - } -} -/** -* The CapsStyle class is an enumeration of constant values that specify the -* caps style to use in drawing lines. The constants are provided for use as -* values in the caps parameter of the -* flash.display.Graphics.lineStyle() method. You can specify the -* following three types of caps: -*/ -declare module away.base { - class CapsStyle { - /** - * Used to specify round caps in the caps parameter of the - * flash.display.Graphics.lineStyle() method. - */ - static ROUND: string; - /** - * Used to specify no caps in the caps parameter of the - * flash.display.Graphics.lineStyle() method. - */ - static NONE: string; - /** - * Used to specify square caps in the caps parameter of the - * flash.display.Graphics.lineStyle() method. - */ - static SQUARE: string; - } -} -/** -* The DisplayObject class is the base class for all objects that can be -* placed on the display list. The display list manages all objects displayed -* in flash. Use the DisplayObjectContainer class to arrange the -* display objects in the display list. DisplayObjectContainer objects can -* have child display objects, while other display objects, such as Shape and -* TextField objects, are "leaf" nodes that have only parents and siblings, no -* children. -* -*

The DisplayObject class supports basic functionality like the x -* and y position of an object, as well as more advanced properties of -* the object such as its transformation matrix.

-* -*

DisplayObject is an abstract base class; therefore, you cannot call -* DisplayObject directly. Invoking new DisplayObject() throws an -* ArgumentError exception.

-* -*

All display objects inherit from the DisplayObject class.

-* -*

The DisplayObject class itself does not include any APIs for rendering -* content onscreen. For that reason, if you want create a custom subclass of -* the DisplayObject class, you will want to extend one of its subclasses that -* do have APIs for rendering content onscreen, such as the Shape, Sprite, -* Bitmap, SimpleButton, TextField, or MovieClip class.

-* -*

The DisplayObject class contains several broadcast events. Normally, the -* target of any particular event is a specific DisplayObject instance. For -* example, the target of an added event is the specific -* DisplayObject instance that was added to the display list. Having a single -* target restricts the placement of event listeners to that target and in -* some cases the target's ancestors on the display list. With broadcast -* events, however, the target is not a specific DisplayObject instance, but -* rather all DisplayObject instances, including those that are not on the -* display list. This means that you can add a listener to any DisplayObject -* instance to listen for broadcast events. In addition to the broadcast -* events listed in the DisplayObject class's Events table, the DisplayObject -* class also inherits two broadcast events from the EventDispatcher class: -* activate and deactivate.

-* -*

Some properties previously used in the ActionScript 1.0 and 2.0 -* MovieClip, TextField, and Button classes(such as _alpha, -* _height, _name, _width, -* _x, _y, and others) have equivalents in the -* ActionScript 3.0 DisplayObject class that are renamed so that they no -* longer begin with the underscore(_) character.

-* -*

For more information, see the "Display Programming" chapter of the -* ActionScript 3.0 Developer's Guide.

-* -* @event added Dispatched when a display object is added to the -* display list. The following methods trigger this -* event: -* DisplayObjectContainer.addChild(), -* DisplayObjectContainer.addChildAt(). -* @event addedToStage Dispatched when a display object is added to the on -* stage display list, either directly or through the -* addition of a sub tree in which the display object -* is contained. The following methods trigger this -* event: -* DisplayObjectContainer.addChild(), -* DisplayObjectContainer.addChildAt(). -* @event enterFrame [broadcast event] Dispatched when the playhead is -* entering a new frame. If the playhead is not -* moving, or if there is only one frame, this event -* is dispatched continuously in conjunction with the -* frame rate. This event is a broadcast event, which -* means that it is dispatched by all display objects -* with a listener registered for this event. -* @event exitFrame [broadcast event] Dispatched when the playhead is -* exiting the current frame. All frame scripts have -* been run. If the playhead is not moving, or if -* there is only one frame, this event is dispatched -* continuously in conjunction with the frame rate. -* This event is a broadcast event, which means that -* it is dispatched by all display objects with a -* listener registered for this event. -* @event frameConstructed [broadcast event] Dispatched after the constructors -* of frame display objects have run but before frame -* scripts have run. If the playhead is not moving, or -* if there is only one frame, this event is -* dispatched continuously in conjunction with the -* frame rate. This event is a broadcast event, which -* means that it is dispatched by all display objects -* with a listener registered for this event. -* @event removed Dispatched when a display object is about to be -* removed from the display list. Two methods of the -* DisplayObjectContainer class generate this event: -* removeChild() and -* removeChildAt(). -* -*

The following methods of a -* DisplayObjectContainer object also generate this -* event if an object must be removed to make room for -* the new object: addChild(), -* addChildAt(), and -* setChildIndex().

-* @event removedFromStage Dispatched when a display object is about to be -* removed from the display list, either directly or -* through the removal of a sub tree in which the -* display object is contained. Two methods of the -* DisplayObjectContainer class generate this event: -* removeChild() and -* removeChildAt(). -* -*

The following methods of a -* DisplayObjectContainer object also generate this -* event if an object must be removed to make room for -* the new object: addChild(), -* addChildAt(), and -* setChildIndex().

-* @event render [broadcast event] Dispatched when the display list -* is about to be updated and rendered. This event -* provides the last opportunity for objects listening -* for this event to make changes before the display -* list is rendered. You must call the -* invalidate() method of the Stage -* object each time you want a render -* event to be dispatched. Render events -* are dispatched to an object only if there is mutual -* trust between it and the object that called -* Stage.invalidate(). This event is a -* broadcast event, which means that it is dispatched -* by all display objects with a listener registered -* for this event. -* -*

Note: This event is not dispatched if the -* display is not rendering. This is the case when the -* content is either minimized or obscured.

-*/ -declare module away.base { - class DisplayObject extends library.NamedAssetBase implements IBitmapDrawable { - private _loaderInfo; - private _mouseX; - private _mouseY; - private _root; - private _bounds; - private _boundsVisible; - private _depth; - private _height; - private _width; - public _pScene: containers.Scene; - public _pParent: containers.DisplayObjectContainer; - public _pSceneTransform: geom.Matrix3D; - public _pSceneTransformDirty: boolean; - public _pIsEntity: boolean; - private _explicitPartition; - public _pImplicitPartition: partition.Partition; - private _partitionNode; - private _sceneTransformChanged; - private _scenechanged; - private _transform; - private _matrix3D; - private _matrix3DDirty; - private _inverseSceneTransform; - private _inverseSceneTransformDirty; - private _scenePosition; - private _scenePositionDirty; - private _explicitVisibility; - public _pImplicitVisibility: boolean; - private _explicitMouseEnabled; - public _pImplicitMouseEnabled: boolean; - private _listenToSceneTransformChanged; - private _listenToSceneChanged; - private _positionDirty; - private _rotationDirty; - private _scaleDirty; - private _positionChanged; - private _rotationChanged; - private _scaleChanged; - private _rotationX; - private _rotationY; - private _rotationZ; - private _eulers; - private _flipY; - private _listenToPositionChanged; - private _listenToRotationChanged; - private _listenToScaleChanged; - private _zOffset; - public _pScaleX: number; - public _pScaleY: number; - public _pScaleZ: number; - private _x; - private _y; - private _z; - private _pivot; - private _orientationMatrix; - private _pivotZero; - private _pivotDirty; - private _pos; - private _rot; - private _sca; - private _transformComponents; - public _pIgnoreTransform: boolean; - private _shaderPickingDetails; - public _pPickingCollisionVO: pick.PickingCollisionVO; - public _pBounds: bounds.BoundingVolumeBase; - public _pBoundsInvalid: boolean; - private _worldBounds; - private _worldBoundsInvalid; - public _pPickingCollider: pick.IPickingCollider; - public _pRenderables: pool.IRenderable[]; - public _iSourcePrefab: prefabs.PrefabBase; - /** - * - */ - public alignmentMode: string; - /** - * Indicates the alpha transparency value of the object specified. Valid - * values are 0(fully transparent) to 1(fully opaque). The default value is - * 1. Display objects with alpha set to 0 are active, - * even though they are invisible. - */ - public alpha: number; - /** - * A value from the BlendMode class that specifies which blend mode to use. A - * bitmap can be drawn internally in two ways. If you have a blend mode - * enabled or an external clipping mask, the bitmap is drawn by adding a - * bitmap-filled square shape to the vector render. If you attempt to set - * this property to an invalid value, Flash runtimes set the value to - * BlendMode.NORMAL. - * - *

The blendMode property affects each pixel of the display - * object. Each pixel is composed of three constituent colors(red, green, - * and blue), and each constituent color has a value between 0x00 and 0xFF. - * Flash Player or Adobe AIR compares each constituent color of one pixel in - * the movie clip with the corresponding color of the pixel in the - * background. For example, if blendMode is set to - * BlendMode.LIGHTEN, Flash Player or Adobe AIR compares the red - * value of the display object with the red value of the background, and uses - * the lighter of the two as the value for the red component of the displayed - * color.

- * - *

The following table describes the blendMode settings. The - * BlendMode class defines string values you can use. The illustrations in - * the table show blendMode values applied to a circular display - * object(2) superimposed on another display object(1).

- */ - public blendMode: BlendMode; - /** - * - */ - public bounds : bounds.BoundingVolumeBase; - /** - * If set to true, NME will use the software renderer to cache - * an internal bitmap representation of the display object. For native targets, - * this is often much slower than the default hardware renderer. When you - * are using the Flash target, this caching may increase performance for display - * objects that contain complex vector content. - * - *

All vector data for a display object that has a cached bitmap is drawn - * to the bitmap instead of the main display. If - * cacheAsBitmapMatrix is null or unsupported, the bitmap is - * then copied to the main display as unstretched, unrotated pixels snapped - * to the nearest pixel boundaries. Pixels are mapped 1 to 1 with the parent - * object. If the bounds of the bitmap change, the bitmap is recreated - * instead of being stretched.

- * - *

If cacheAsBitmapMatrix is non-null and supported, the - * object is drawn to the off-screen bitmap using that matrix and the - * stretched and/or rotated results of that rendering are used to draw the - * object to the main display.

- * - *

No internal bitmap is created unless the cacheAsBitmap - * property is set to true.

- * - *

After you set the cacheAsBitmap property to - * true, the rendering does not change, however the display - * object performs pixel snapping automatically. The animation speed can be - * significantly faster depending on the complexity of the vector content. - *

- * - *

The cacheAsBitmap property is automatically set to - * true whenever you apply a filter to a display object(when - * its filter array is not empty), and if a display object has a - * filter applied to it, cacheAsBitmap is reported as - * true for that display object, even if you set the property to - * false. If you clear all filters for a display object, the - * cacheAsBitmap setting changes to what it was last set to.

- * - *

A display object does not use a bitmap even if the - * cacheAsBitmap property is set to true and - * instead renders from vector data in the following cases:

- * - *
    - *
  • The bitmap is too large. In AIR 1.5 and Flash Player 10, the maximum - * size for a bitmap image is 8,191 pixels in width or height, and the total - * number of pixels cannot exceed 16,777,215 pixels.(So, if a bitmap image - * is 8,191 pixels wide, it can only be 2,048 pixels high.) In Flash Player 9 - * and earlier, the limitation is is 2880 pixels in height and 2,880 pixels - * in width.
  • - *
  • The bitmap fails to allocate(out of memory error).
  • - *
- * - *

The cacheAsBitmap property is best used with movie clips - * that have mostly static content and that do not scale and rotate - * frequently. With such movie clips, cacheAsBitmap can lead to - * performance increases when the movie clip is translated(when its x - * and y position is changed).

- */ - public cacheAsBitmap: boolean; - /** - * - */ - public castsShadows: boolean; - /** - * Indicates the depth of the display object, in pixels. The depth is - * calculated based on the bounds of the content of the display object. When - * you set the depth property, the scaleZ property - * is adjusted accordingly, as shown in the following code: - * - *

Except for TextField and Video objects, a display object with no - * content (such as an empty sprite) has a depth of 0, even if you try to - * set depth to a different value.

- */ - public depth : number; - /** - * Defines the rotation of the 3d object as a Vector3D object containing euler angles for rotation around x, y and z axis. - */ - public eulers : geom.Vector3D; - /** - * An object that can contain any extra data. - */ - public extra: Object; - /** - * Indicates the height of the display object, in pixels. The height is - * calculated based on the bounds of the content of the display object. When - * you set the height property, the scaleY property - * is adjusted accordingly, as shown in the following code: - * - *

Except for TextField and Video objects, a display object with no - * content (such as an empty sprite) has a height of 0, even if you try to - * set height to a different value.

- */ - public height : number; - /** - * Indicates the instance container index of the DisplayObject. The object can be - * identified in the child list of its parent display object container by - * calling the getChildByIndex() method of the display object - * container. - * - *

If the DisplayObject has no parent container, index defaults to 0.

- */ - public index : number; - /** - * - */ - public inverseSceneTransform : geom.Matrix3D; - /** - * - */ - public ignoreTransform : boolean; - /** - * - */ - public isEntity : boolean; - /** - * Returns a LoaderInfo object containing information about loading the file - * to which this display object belongs. The loaderInfo property - * is defined only for the root display object of a SWF file or for a loaded - * Bitmap(not for a Bitmap that is drawn with ActionScript). To find the - * loaderInfo object associated with the SWF file that contains - * a display object named myDisplayObject, use - * myDisplayObject.root.loaderInfo. - * - *

A large SWF file can monitor its download by calling - * this.root.loaderInfo.addEventListener(Event.COMPLETE, - * func).

- */ - public loaderInfo : LoaderInfo; - /** - * The calling display object is masked by the specified mask - * object. To ensure that masking works when the Stage is scaled, the - * mask display object must be in an active part of the display - * list. The mask object itself is not drawn. Set - * mask to null to remove the mask. - * - *

To be able to scale a mask object, it must be on the display list. To - * be able to drag a mask Sprite object(by calling its - * startDrag() method), it must be on the display list. To call - * the startDrag() method for a mask sprite based on a - * mouseDown event being dispatched by the sprite, set the - * sprite's buttonMode property to true.

- * - *

When display objects are cached by setting the - * cacheAsBitmap property to true an the - * cacheAsBitmapMatrix property to a Matrix object, both the - * mask and the display object being masked must be part of the same cached - * bitmap. Thus, if the display object is cached, then the mask must be a - * child of the display object. If an ancestor of the display object on the - * display list is cached, then the mask must be a child of that ancestor or - * one of its descendents. If more than one ancestor of the masked object is - * cached, then the mask must be a descendent of the cached container closest - * to the masked object in the display list.

- * - *

Note: A single mask object cannot be used to mask - * more than one calling display object. When the mask is - * assigned to a second display object, it is removed as the mask of the - * first object, and that object's mask property becomes - * null.

- */ - public mask: DisplayObject; - /** - * Specifies whether this object receives mouse, or other user input, - * messages. The default value is true, which means that by - * default any InteractiveObject instance that is on the display list - * receives mouse events or other user input events. If - * mouseEnabled is set to false, the instance does - * not receive any mouse events(or other user input events like keyboard - * events). Any children of this instance on the display list are not - * affected. To change the mouseEnabled behavior for all - * children of an object on the display list, use - * flash.display.DisplayObjectContainer.mouseChildren. - * - *

No event is dispatched by setting this property. You must use the - * addEventListener() method to create interactive - * functionality.

- */ - public mouseEnabled : boolean; - /** - * Indicates the x coordinate of the mouse or user input device position, in - * pixels. - * - *

Note: For a DisplayObject that has been rotated, the returned x - * coordinate will reflect the non-rotated object.

- */ - public mouseX : number; - /** - * Indicates the y coordinate of the mouse or user input device position, in - * pixels. - * - *

Note: For a DisplayObject that has been rotated, the returned y - * coordinate will reflect the non-rotated object.

- */ - public mouseY : number; - /** - * Indicates the instance name of the DisplayObject. The object can be - * identified in the child list of its parent display object container by - * calling the getChildByName() method of the display object - * container. - * - * @throws IllegalOperationError If you are attempting to set this property - * on an object that was placed on the timeline - * in the Flash authoring tool. - */ - public name: string; - /** - * - */ - public orientationMode: string; - /** - * Indicates the DisplayObjectContainer object that contains this display - * object. Use the parent property to specify a relative path to - * display objects that are above the current display object in the display - * list hierarchy. - * - *

You can use parent to move up multiple levels in the - * display list as in the following:

- * - * @throws SecurityError The parent display object belongs to a security - * sandbox to which you do not have access. You can - * avoid this situation by having the parent movie call - * the Security.allowDomain() method. - */ - public parent : containers.DisplayObjectContainer; - /** - * - */ - public partition : partition.Partition; - /** - * - */ - public partitionNode : partition.EntityNode; - /** - * - */ - public pickingCollider : pick.IPickingCollider; - /** - * Defines the local point around which the object rotates. - */ - public pivot : geom.Vector3D; - /** - * For a display object in a loaded SWF file, the root property - * is the top-most display object in the portion of the display list's tree - * structure represented by that SWF file. For a Bitmap object representing a - * loaded image file, the root property is the Bitmap object - * itself. For the instance of the main class of the first SWF file loaded, - * the root property is the display object itself. The - * root property of the Stage object is the Stage object itself. - * The root property is set to null for any display - * object that has not been added to the display list, unless it has been - * added to a display object container that is off the display list but that - * is a child of the top-most display object in a loaded SWF file. - * - *

For example, if you create a new Sprite object by calling the - * Sprite() constructor method, its root property - * is null until you add it to the display list(or to a display - * object container that is off the display list but that is a child of the - * top-most display object in a SWF file).

- * - *

For a loaded SWF file, even though the Loader object used to load the - * file may not be on the display list, the top-most display object in the - * SWF file has its root property set to itself. The Loader - * object does not have its root property set until it is added - * as a child of a display object for which the root property is - * set.

- */ - public root : containers.DisplayObjectContainer; - /** - * Indicates the rotation of the DisplayObject instance, in degrees, from its - * original orientation. Values from 0 to 180 represent clockwise rotation; - * values from 0 to -180 represent counterclockwise rotation. Values outside - * this range are added to or subtracted from 360 to obtain a value within - * the range. For example, the statement my_video.rotation = 450 - * is the same as my_video.rotation = 90. - */ - public rotation: number; - /** - * Indicates the x-axis rotation of the DisplayObject instance, in degrees, - * from its original orientation relative to the 3D parent container. Values - * from 0 to 180 represent clockwise rotation; values from 0 to -180 - * represent counterclockwise rotation. Values outside this range are added - * to or subtracted from 360 to obtain a value within the range. - */ - public rotationX : number; - /** - * Indicates the y-axis rotation of the DisplayObject instance, in degrees, - * from its original orientation relative to the 3D parent container. Values - * from 0 to 180 represent clockwise rotation; values from 0 to -180 - * represent counterclockwise rotation. Values outside this range are added - * to or subtracted from 360 to obtain a value within the range. - */ - public rotationY : number; - /** - * Indicates the z-axis rotation of the DisplayObject instance, in degrees, - * from its original orientation relative to the 3D parent container. Values - * from 0 to 180 represent clockwise rotation; values from 0 to -180 - * represent counterclockwise rotation. Values outside this range are added - * to or subtracted from 360 to obtain a value within the range. - */ - public rotationZ : number; - /** - * The current scaling grid that is in effect. If set to null, - * the entire display object is scaled normally when any scale transformation - * is applied. - * - *

When you define the scale9Grid property, the display - * object is divided into a grid with nine regions based on the - * scale9Grid rectangle, which defines the center region of the - * grid. The eight other regions of the grid are the following areas:

- * - *
    - *
  • The upper-left corner outside of the rectangle
  • - *
  • The area above the rectangle
  • - *
  • The upper-right corner outside of the rectangle
  • - *
  • The area to the left of the rectangle
  • - *
  • The area to the right of the rectangle
  • - *
  • The lower-left corner outside of the rectangle
  • - *
  • The area below the rectangle
  • - *
  • The lower-right corner outside of the rectangle
  • - *
- * - *

You can think of the eight regions outside of the center(defined by - * the rectangle) as being like a picture frame that has special rules - * applied to it when scaled.

- * - *

When the scale9Grid property is set and a display object - * is scaled, all text and gradients are scaled normally; however, for other - * types of objects the following rules apply:

- * - *
    - *
  • Content in the center region is scaled normally.
  • - *
  • Content in the corners is not scaled.
  • - *
  • Content in the top and bottom regions is scaled horizontally only. - * Content in the left and right regions is scaled vertically only.
  • - *
  • All fills(including bitmaps, video, and gradients) are stretched to - * fit their shapes.
  • - *
- * - *

If a display object is rotated, all subsequent scaling is normal(and - * the scale9Grid property is ignored).

- * - *

For example, consider the following display object and a rectangle that - * is applied as the display object's scale9Grid:

- * - *

A common use for setting scale9Grid is to set up a display - * object to be used as a component, in which edge regions retain the same - * width when the component is scaled.

- * - * @throws ArgumentError If you pass an invalid argument to the method. - */ - public scale9Grid: geom.Rectangle; - /** - * Indicates the horizontal scale(percentage) of the object as applied from - * the registration point. The default registration point is(0,0). 1.0 - * equals 100% scale. - * - *

Scaling the local coordinate system changes the x and - * y property values, which are defined in whole pixels.

- */ - public scaleX : number; - /** - * Indicates the vertical scale(percentage) of an object as applied from the - * registration point of the object. The default registration point is(0,0). - * 1.0 is 100% scale. - * - *

Scaling the local coordinate system changes the x and - * y property values, which are defined in whole pixels.

- */ - public scaleY : number; - /** - * Indicates the depth scale(percentage) of an object as applied from the - * registration point of the object. The default registration point is(0,0). - * 1.0 is 100% scale. - * - *

Scaling the local coordinate system changes the x, - * y and z property values, which are defined in - * whole pixels.

- */ - public scaleZ : number; - /** - * - */ - public scene : containers.Scene; - /** - * - */ - public scenePosition : geom.Vector3D; - public sceneTransform : geom.Matrix3D; - /** - * The scroll rectangle bounds of the display object. The display object is - * cropped to the size defined by the rectangle, and it scrolls within the - * rectangle when you change the x and y properties - * of the scrollRect object. - * - *

The properties of the scrollRect Rectangle object use the - * display object's coordinate space and are scaled just like the overall - * display object. The corner bounds of the cropped window on the scrolling - * display object are the origin of the display object(0,0) and the point - * defined by the width and height of the rectangle. They are not centered - * around the origin, but use the origin to define the upper-left corner of - * the area. A scrolled display object always scrolls in whole pixel - * increments.

- * - *

You can scroll an object left and right by setting the x - * property of the scrollRect Rectangle object. You can scroll - * an object up and down by setting the y property of the - * scrollRect Rectangle object. If the display object is rotated - * 90° and you scroll it left and right, the display object actually scrolls - * up and down.

- */ - public scrollRect: geom.Rectangle; - /** - * - */ - public shaderPickingDetails : boolean; - /** - * - */ - public boundsVisible : boolean; - /** - * An object with properties pertaining to a display object's matrix, color - * transform, and pixel bounds. The specific properties - matrix, - * colorTransform, and three read-only properties - * (concatenatedMatrix, concatenatedColorTransform, - * and pixelBounds) - are described in the entry for the - * Transform class. - * - *

Each of the transform object's properties is itself an object. This - * concept is important because the only way to set new values for the matrix - * or colorTransform objects is to create a new object and copy that object - * into the transform.matrix or transform.colorTransform property.

- * - *

For example, to increase the tx value of a display - * object's matrix, you must make a copy of the entire matrix object, then - * copy the new object into the matrix property of the transform object:

- *
 public myMatrix:Matrix =
-        * myDisplayObject.transform.matrix; myMatrix.tx += 10;
-        * myDisplayObject.transform.matrix = myMatrix; 
- * - *

You cannot directly set the tx property. The following - * code has no effect on myDisplayObject:

- *
 myDisplayObject.transform.matrix.tx +=
-        * 10; 
- * - *

You can also copy an entire transform object and assign it to another - * display object's transform property. For example, the following code - * copies the entire transform object from myOldDisplayObj to - * myNewDisplayObj:

- * myNewDisplayObj.transform = myOldDisplayObj.transform; - * - *

The resulting display object, myNewDisplayObj, now has the - * same values for its matrix, color transform, and pixel bounds as the old - * display object, myOldDisplayObj.

- * - *

Note that AIR for TV devices use hardware acceleration, if it is - * available, for color transforms.

- */ - public transform : geom.Transform; - /** - * Whether or not the display object is visible. Display objects that are not - * visible are disabled. For example, if visible=false for an - * InteractiveObject instance, it cannot be clicked. - */ - public visible : boolean; - /** - * Indicates the width of the display object, in pixels. The width is - * calculated based on the bounds of the content of the display object. When - * you set the width property, the scaleX property - * is adjusted accordingly, as shown in the following code: - * - *

Except for TextField and Video objects, a display object with no - * content(such as an empty sprite) has a width of 0, even if you try to set - * width to a different value.

- */ - public width : number; - /** - * - */ - public worldBounds : bounds.BoundingVolumeBase; - /** - * Indicates the x coordinate of the DisplayObject instance relative - * to the local coordinates of the parent DisplayObjectContainer. If the - * object is inside a DisplayObjectContainer that has transformations, it is - * in the local coordinate system of the enclosing DisplayObjectContainer. - * Thus, for a DisplayObjectContainer rotated 90° counterclockwise, the - * DisplayObjectContainer's children inherit a coordinate system that is - * rotated 90° counterclockwise. The object's coordinates refer to the - * registration point position. - */ - public x : number; - /** - * Indicates the y coordinate of the DisplayObject instance relative - * to the local coordinates of the parent DisplayObjectContainer. If the - * object is inside a DisplayObjectContainer that has transformations, it is - * in the local coordinate system of the enclosing DisplayObjectContainer. - * Thus, for a DisplayObjectContainer rotated 90° counterclockwise, the - * DisplayObjectContainer's children inherit a coordinate system that is - * rotated 90° counterclockwise. The object's coordinates refer to the - * registration point position. - */ - public y : number; - /** - * Indicates the z coordinate position along the z-axis of the DisplayObject - * instance relative to the 3D parent container. The z property is used for - * 3D coordinates, not screen or pixel coordinates. - * - *

When you set a z property for a display object to - * something other than the default value of 0, a corresponding - * Matrix3D object is automatically created. for adjusting a display object's - * position and orientation in three dimensions. When working with the - * z-axis, the existing behavior of x and y properties changes from screen or - * pixel coordinates to positions relative to the 3D parent container.

- * - *

For example, a child of the _root at position x = 100, y = - * 100, z = 200 is not drawn at pixel location(100,100). The child is drawn - * wherever the 3D projection calculation puts it. The calculation is:

- * - *

(x~~cameraFocalLength/cameraRelativeZPosition, - * y~~cameraFocalLength/cameraRelativeZPosition)

- */ - public z : number; - /** - * - */ - public zOffset : number; - /** - * Creates a new DisplayObject instance. - */ - constructor(); - /** - * - */ - public addEventListener(type: string, listener: Function): void; - /** - * - */ - public clone(): DisplayObject; - /** - * - */ - public dispose(): void; - /** - * @inheritDoc - */ - public disposeAsset(): void; - /** - * Returns a rectangle that defines the area of the display object relative - * to the coordinate system of the targetCoordinateSpace object. - * Consider the following code, which shows how the rectangle returned can - * vary depending on the targetCoordinateSpace parameter that - * you pass to the method: - * - *

Note: Use the localToGlobal() and - * globalToLocal() methods to convert the display object's local - * coordinates to display coordinates, or display coordinates to local - * coordinates, respectively.

- * - *

The getBounds() method is similar to the - * getRect() method; however, the Rectangle returned by the - * getBounds() method includes any strokes on shapes, whereas - * the Rectangle returned by the getRect() method does not. For - * an example, see the description of the getRect() method.

- * - * @param targetCoordinateSpace The display object that defines the - * coordinate system to use. - * @return The rectangle that defines the area of the display object relative - * to the targetCoordinateSpace object's coordinate - * system. - */ - public getBounds(targetCoordinateSpace: DisplayObject): geom.Rectangle; - /** - * Returns a rectangle that defines the boundary of the display object, based - * on the coordinate system defined by the targetCoordinateSpace - * parameter, excluding any strokes on shapes. The values that the - * getRect() method returns are the same or smaller than those - * returned by the getBounds() method. - * - *

Note: Use localToGlobal() and - * globalToLocal() methods to convert the display object's local - * coordinates to Stage coordinates, or Stage coordinates to local - * coordinates, respectively.

- * - * @param targetCoordinateSpace The display object that defines the - * coordinate system to use. - * @return The rectangle that defines the area of the display object relative - * to the targetCoordinateSpace object's coordinate - * system. - */ - public getRect(targetCoordinateSpace: DisplayObject): geom.Rectangle; - /** - * Converts the point object from the Stage(global) coordinates - * to the display object's(local) coordinates. - * - *

To use this method, first create an instance of the Point class. The - * x and y values that you assign represent global coordinates - * because they relate to the origin(0,0) of the main display area. Then - * pass the Point instance as the parameter to the - * globalToLocal() method. The method returns a new Point object - * with x and y values that relate to the origin of the display - * object instead of the origin of the Stage.

- * - * @param point An object created with the Point class. The Point object - * specifies the x and y coordinates as - * properties. - * @return A Point object with coordinates relative to the display object. - */ - public globalToLocal(point: geom.Point): geom.Point; - /** - * Converts a two-dimensional point from the Stage(global) coordinates to a - * three-dimensional display object's(local) coordinates. - * - *

To use this method, first create an instance of the Point class. The x - * and y values that you assign to the Point object represent global - * coordinates because they are relative to the origin(0,0) of the main - * display area. Then pass the Point object to the - * globalToLocal3D() method as the point parameter. - * The method returns three-dimensional coordinates as a Vector3D object - * containing x, y, and z values that - * are relative to the origin of the three-dimensional display object.

- * - * @param point A two dimensional Point object representing global x and y - * coordinates. - * @return A Vector3D object with coordinates relative to the - * three-dimensional display object. - */ - public globalToLocal3D(point: geom.Point): geom.Vector3D; - /** - * Evaluates the bounding box of the display object to see if it overlaps or - * intersects with the bounding box of the obj display object. - * - * @param obj The display object to test against. - * @return true if the bounding boxes of the display objects - * intersect; false if not. - */ - public hitTestObject(obj: DisplayObject): boolean; - /** - * Evaluates the display object to see if it overlaps or intersects with the - * point specified by the x and y parameters. The - * x and y parameters specify a point in the - * coordinate space of the Stage, not the display object container that - * contains the display object(unless that display object container is the - * Stage). - * - * @param x The x coordinate to test against this object. - * @param y The y coordinate to test against this object. - * @param shapeFlag Whether to check against the actual pixels of the object - * (true) or the bounding box - * (false). - * @return true if the display object overlaps or intersects - * with the specified point; false otherwise. - */ - public hitTestPoint(x: number, y: number, shapeFlag?: boolean): boolean; - /** - * @inheritDoc - */ - public isIntersectingRay(rayPosition: geom.Vector3D, rayDirection: geom.Vector3D): boolean; - /** - * Converts a three-dimensional point of the three-dimensional display - * object's(local) coordinates to a two-dimensional point in the Stage - * (global) coordinates. - * - *

For example, you can only use two-dimensional coordinates(x,y) to draw - * with the display.Graphics methods. To draw a - * three-dimensional object, you need to map the three-dimensional - * coordinates of a display object to two-dimensional coordinates. First, - * create an instance of the Vector3D class that holds the x-, y-, and z- - * coordinates of the three-dimensional display object. Then pass the - * Vector3D object to the local3DToGlobal() method as the - * point3d parameter. The method returns a two-dimensional Point - * object that can be used with the Graphics API to draw the - * three-dimensional object.

- * - * @param point3d A Vector3D object containing either a three-dimensional - * point or the coordinates of the three-dimensional display - * object. - * @return A two-dimensional point representing a three-dimensional point in - * two-dimensional space. - */ - public local3DToGlobal(point3d: geom.Vector3D): geom.Point; - /** - * Rotates the 3d object around to face a point defined relative to the local coordinates of the parent ObjectContainer3D. - * - * @param target The vector defining the point to be looked at - * @param upAxis An optional vector used to define the desired up orientation of the 3d object after rotation has occurred - */ - public lookAt(target: geom.Vector3D, upAxis?: geom.Vector3D): void; - /** - * Converts the point object from the display object's(local) - * coordinates to the Stage(global) coordinates. - * - *

This method allows you to convert any given x and y - * coordinates from values that are relative to the origin(0,0) of a - * specific display object(local coordinates) to values that are relative to - * the origin of the Stage(global coordinates).

- * - *

To use this method, first create an instance of the Point class. The - * x and y values that you assign represent local coordinates - * because they relate to the origin of the display object.

- * - *

You then pass the Point instance that you created as the parameter to - * the localToGlobal() method. The method returns a new Point - * object with x and y values that relate to the origin of the - * Stage instead of the origin of the display object.

- * - * @param point The name or identifier of a point created with the Point - * class, specifying the x and y coordinates as - * properties. - * @return A Point object with coordinates relative to the Stage. - */ - public localToGlobal(point: geom.Point): geom.Point; - /** - * Moves the 3d object directly to a point in space - * - * @param dx The amount of movement along the local x axis. - * @param dy The amount of movement along the local y axis. - * @param dz The amount of movement along the local z axis. - */ - public moveTo(dx: number, dy: number, dz: number): void; - /** - * Moves the local point around which the object rotates. - * - * @param dx The amount of movement along the local x axis. - * @param dy The amount of movement along the local y axis. - * @param dz The amount of movement along the local z axis. - */ - public movePivot(dx: number, dy: number, dz: number): void; - /** - * Rotates the 3d object around it's local x-axis - * - * @param angle The amount of rotation in degrees - */ - public pitch(angle: number): void; - /** - * - */ - public getRenderSceneTransform(camera: entities.Camera): geom.Matrix3D; - /** - * Rotates the 3d object around it's local z-axis - * - * @param angle The amount of rotation in degrees - */ - public roll(angle: number): void; - /** - * Rotates the 3d object around an axis by a defined angle - * - * @param axis The vector defining the axis of rotation - * @param angle The amount of rotation in degrees - */ - public rotate(axis: geom.Vector3D, angle: number): void; - /** - * Rotates the 3d object directly to a euler angle - * - * @param ax The angle in degrees of the rotation around the x axis. - * @param ay The angle in degrees of the rotation around the y axis. - * @param az The angle in degrees of the rotation around the z axis. - */ - public rotateTo(ax: number, ay: number, az: number): void; - /** - * - */ - public removeEventListener(type: string, listener: Function): void; - /** - * Moves the 3d object along a vector by a defined length - * - * @param axis The vector defining the axis of movement - * @param distance The length of the movement - */ - public translate(axis: geom.Vector3D, distance: number): void; - /** - * Moves the 3d object along a vector by a defined length - * - * @param axis The vector defining the axis of movement - * @param distance The length of the movement - */ - public translateLocal(axis: geom.Vector3D, distance: number): void; - /** - * Rotates the 3d object around it's local y-axis - * - * @param angle The amount of rotation in degrees - */ - public yaw(angle: number): void; - /** - * @internal - */ - public _iController: controllers.ControllerBase; - /** - * @internal - */ - public _iAssignedPartition : partition.Partition; - /** - * The transformation of the 3d object, relative to the local coordinates of the parent ObjectContainer3D. - * - * @internal - */ - public _iMatrix3D : geom.Matrix3D; - /** - * @internal - */ - public _iPickingCollisionVO : pick.PickingCollisionVO; - /** - * @internal - */ - public iSetParent(value: containers.DisplayObjectContainer): void; - /** - * @protected - */ - public pCreateDefaultBoundingVolume(): bounds.BoundingVolumeBase; - /** - * @protected - */ - public pCreateEntityPartitionNode(): partition.EntityNode; - /** - * @protected - */ - public pInvalidateBounds(): void; - /** - * @protected - */ - public pInvalidateSceneTransform(): void; - /** - * @protected - */ - public pUpdateBounds(): void; - /** - * @protected - */ - public _pUpdateImplicitMouseEnabled(value: boolean): void; - /** - * @protected - */ - public _pUpdateImplicitPartition(value: partition.Partition): void; - /** - * @protected - */ - public _pUpdateImplicitVisibility(value: boolean): void; - /** - * @protected - */ - public _pUpdateMatrix3D(): void; - /** - * @protected - */ - public pUpdateSceneTransform(): void; - public _iAddRenderable(renderable: pool.IRenderable): pool.IRenderable; - public _iRemoveRenderable(renderable: pool.IRenderable): pool.IRenderable; - /** - * //TODO - * - * @param shortestCollisionDistance - * @param findClosest - * @returns {boolean} - * - * @internal - */ - public _iTestCollision(shortestCollisionDistance: number, findClosest: boolean): boolean; - /** - * - */ - public _iInternalUpdate(): void; - /** - * @internal - */ - public _iIsVisible(): boolean; - /** - * @internal - */ - public _iIsMouseEnabled(): boolean; - /** - * @internal - */ - public _iSetScene(value: containers.Scene): void; - /** - * @protected - */ - public _pUpdateScene(value: containers.Scene): void; - /** - * @private - */ - private notifyPositionChanged(); - /** - * @private - */ - private notifyRotationChanged(); - /** - * @private - */ - private notifyScaleChanged(); - /** - * @private - */ - private notifySceneChange(); - /** - * @private - */ - private notifySceneTransformChange(); - /** - * Invalidates the 3D transformation matrix, causing it to be updated upon the next request - * - * @private - */ - private invalidateMatrix3D(); - /** - * @private - */ - private invalidatePartition(); - /** - * @private - */ - private invalidatePivot(); - /** - * @private - */ - private invalidatePosition(); - /** - * @private - */ - private invalidateRotation(); - /** - * @private - */ - private invalidateScale(); - } -} -/** -* @module away.base -*/ -declare module away.base { - /** - * - * Geometry is a collection of SubGeometries, each of which contain the actual geometrical data such as vertices, - * normals, uvs, etc. It also contains a reference to an animation class, which defines how the geometry moves. - * A Geometry object is assigned to a Mesh, a scene graph occurence of the geometry, which in turn assigns - * the SubGeometries to its respective TriangleSubMesh objects. - * - * - * - * @see away.core.base.SubGeometry - * @see away.entities.Mesh - * - * @class away.base.Geometry - */ - class Geometry extends library.NamedAssetBase implements library.IAsset { - private _subGeometries; - public assetType : string; - /** - * A collection of TriangleSubGeometry objects, each of which contain geometrical data such as vertices, normals, etc. - */ - public subGeometries : SubGeometryBase[]; - public getSubGeometries(): SubGeometryBase[]; - /** - * Creates a new Geometry object. - */ - constructor(); - public applyTransformation(transform: geom.Matrix3D): void; - /** - * Adds a new TriangleSubGeometry object to the list. - * @param subGeometry The TriangleSubGeometry object to be added. - */ - public addSubGeometry(subGeometry: SubGeometryBase): void; - /** - * Removes a new TriangleSubGeometry object from the list. - * @param subGeometry The TriangleSubGeometry object to be removed. - */ - public removeSubGeometry(subGeometry: SubGeometryBase): void; - /** - * Clones the geometry. - * @return An exact duplicate of the current Geometry object. - */ - public clone(): Geometry; - /** - * Scales the geometry. - * @param scale The amount by which to scale. - */ - public scale(scale: number): void; - /** - * Clears all resources used by the Geometry object, including SubGeometries. - */ - public dispose(): void; - /** - * Scales the uv coordinates (tiling) - * @param scaleU The amount by which to scale on the u axis. Default is 1; - * @param scaleV The amount by which to scale on the v axis. Default is 1; - */ - public scaleUV(scaleU?: number, scaleV?: number): void; - public iInvalidateBounds(subGeom: SubGeometryBase): void; - } -} -/** -* The GradientType class provides values for the type parameter -* in the beginGradientFill() and -* lineGradientStyle() methods of the flash.display.Graphics -* class. -*/ -declare module away.base { - class GradientType { - /** - * Value used to specify a linear gradient fill. - */ - static LINEAR: string; - /** - * Value used to specify a radial gradient fill. - */ - static RADIAL: string; - } -} -/** -* The Graphics class contains a set of methods that you can use to create a -* vector shape. Display objects that support drawing include Sprite and Shape -* objects. Each of these classes includes a graphics property -* that is a Graphics object. The following are among those helper functions -* provided for ease of use: drawRect(), -* drawRoundRect(), drawCircle(), and -* drawEllipse(). -* -*

You cannot create a Graphics object directly from ActionScript code. If -* you call new Graphics(), an exception is thrown.

-* -*

The Graphics class is final; it cannot be subclassed.

-*/ -declare module away.base { - class Graphics { - /** - * Fills a drawing area with a bitmap image. The bitmap can be repeated or - * tiled to fill the area. The fill remains in effect until you call the - * beginFill(), beginBitmapFill(), - * beginGradientFill(), or beginShaderFill() - * method. Calling the clear() method clears the fill. - * - *

The application renders the fill whenever three or more points are - * drawn, or when the endFill() method is called.

- * - * @param bitmap A transparent or opaque bitmap image that contains the bits - * to be displayed. - * @param matrix A matrix object(of the flash.geom.Matrix class), which you - * can use to define transformations on the bitmap. For - * example, you can use the following matrix to rotate a bitmap - * by 45 degrees(pi/4 radians): - * @param repeat If true, the bitmap image repeats in a tiled - * pattern. If false, the bitmap image does not - * repeat, and the edges of the bitmap are used for any fill - * area that extends beyond the bitmap. - * - *

For example, consider the following bitmap(a 20 x - * 20-pixel checkerboard pattern):

- * - *

When repeat is set to true(as - * in the following example), the bitmap fill repeats the - * bitmap:

- * - *

When repeat is set to false, - * the bitmap fill uses the edge pixels for the fill area - * outside the bitmap:

- * @param smooth If false, upscaled bitmap images are rendered - * by using a nearest-neighbor algorithm and look pixelated. If - * true, upscaled bitmap images are rendered by - * using a bilinear algorithm. Rendering by using the nearest - * neighbor algorithm is faster. - */ - public beginBitmapFill(bitmap: BitmapData, matrix?: geom.Matrix, repeat?: boolean, smooth?: boolean): void; - /** - * Specifies a simple one-color fill that subsequent calls to other Graphics - * methods(such as lineTo() or drawCircle()) use - * when drawing. The fill remains in effect until you call the - * beginFill(), beginBitmapFill(), - * beginGradientFill(), or beginShaderFill() - * method. Calling the clear() method clears the fill. - * - *

The application renders the fill whenever three or more points are - * drawn, or when the endFill() method is called.

- * - * @param color The color of the fill(0xRRGGBB). - * @param alpha The alpha value of the fill(0.0 to 1.0). - */ - public beginFill(color: number, alpha?: number): void; - /** - * Specifies a gradient fill used by subsequent calls to other Graphics - * methods(such as lineTo() or drawCircle()) for - * the object. The fill remains in effect until you call the - * beginFill(), beginBitmapFill(), - * beginGradientFill(), or beginShaderFill() - * method. Calling the clear() method clears the fill. - * - *

The application renders the fill whenever three or more points are - * drawn, or when the endFill() method is called.

- * - * @param type A value from the GradientType class that - * specifies which gradient type to use: - * GradientType.LINEAR or - * GradientType.RADIAL. - * @param colors An array of RGB hexadecimal color values used - * in the gradient; for example, red is 0xFF0000, - * blue is 0x0000FF, and so on. You can specify - * up to 15 colors. For each color, specify a - * corresponding value in the alphas and ratios - * parameters. - * @param alphas An array of alpha values for the corresponding - * colors in the colors array; valid values are 0 - * to 1. If the value is less than 0, the default - * is 0. If the value is greater than 1, the - * default is 1. - * @param ratios An array of color distribution ratios; valid - * values are 0-255. This value defines the - * percentage of the width where the color is - * sampled at 100%. The value 0 represents the - * left position in the gradient box, and 255 - * represents the right position in the gradient - * box. - * @param matrix A transformation matrix as defined by the - * flash.geom.Matrix class. The flash.geom.Matrix - * class includes a - * createGradientBox() method, which - * lets you conveniently set up the matrix for use - * with the beginGradientFill() - * method. - * @param spreadMethod A value from the SpreadMethod class that - * specifies which spread method to use, either: - * SpreadMethod.PAD, - * SpreadMethod.REFLECT, or - * SpreadMethod.REPEAT. - * - *

For example, consider a simple linear - * gradient between two colors:

- * - *

This example uses - * SpreadMethod.PAD for the spread - * method, and the gradient fill looks like the - * following:

- * - *

If you use SpreadMethod.REFLECT - * for the spread method, the gradient fill looks - * like the following:

- * - *

If you use SpreadMethod.REPEAT - * for the spread method, the gradient fill looks - * like the following:

- * @param interpolationMethod A value from the InterpolationMethod class that - * specifies which value to use: - * InterpolationMethod.LINEAR_RGB or - * InterpolationMethod.RGB - * - *

For example, consider a simple linear - * gradient between two colors(with the - * spreadMethod parameter set to - * SpreadMethod.REFLECT). The - * different interpolation methods affect the - * appearance as follows:

- * @param focalPointRatio A number that controls the location of the - * focal point of the gradient. 0 means that the - * focal point is in the center. 1 means that the - * focal point is at one border of the gradient - * circle. -1 means that the focal point is at the - * other border of the gradient circle. A value - * less than -1 or greater than 1 is rounded to -1 - * or 1. For example, the following example shows - * a focalPointRatio set to 0.75: - * @throws ArgumentError If the type parameter is not valid. - */ - public beginGradientFill(type: GradientType, colors: number[], alphas: number[], ratios: number[], matrix?: geom.Matrix, spreadMethod?: string, interpolationMethod?: string, focalPointRatio?: number): void; - /** - * Clears the graphics that were drawn to this Graphics object, and resets - * fill and line style settings. - * - */ - public clear(): void; - /** - * Copies all of drawing commands from the source Graphics object into the - * calling Graphics object. - * - * @param sourceGraphics The Graphics object from which to copy the drawing - * commands. - */ - public copyFrom(sourceGraphics: Graphics): void; - /** - * Draws a cubic Bezier curve from the current drawing position to the - * specified anchor point. Cubic Bezier curves consist of two anchor points - * and two control points. The curve interpolates the two anchor points and - * curves toward the two control points. - * - * The four points you use to draw a cubic Bezier curve with the - * cubicCurveTo() method are as follows: - * - *
    - *
  • The current drawing position is the first anchor point.
  • - *
  • The anchorX and anchorY parameters specify the second anchor point. - *
  • - *
  • The controlX1 and controlY1 parameters - * specify the first control point.
  • - *
  • The controlX2 and controlY2 parameters - * specify the second control point.
  • - *
- * - * If you call the cubicCurveTo() method before calling the - * moveTo() method, your curve starts at position (0, 0). - * - * If the cubicCurveTo() method succeeds, the Flash runtime sets - * the current drawing position to (anchorX, - * anchorY). If the cubicCurveTo() method fails, - * the current drawing position remains unchanged. - * - * If your movie clip contains content created with the Flash drawing tools, - * the results of calls to the cubicCurveTo() method are drawn - * underneath that content. - * - * @param controlX1 Specifies the horizontal position of the first control - * point relative to the registration point of the parent - * display object. - * @param controlY1 Specifies the vertical position of the first control - * point relative to the registration point of the parent - * display object. - * @param controlX2 Specifies the horizontal position of the second control - * point relative to the registration point of the parent - * display object. - * @param controlY2 Specifies the vertical position of the second control - * point relative to the registration point of the parent - * display object. - * @param anchorX Specifies the horizontal position of the anchor point - * relative to the registration point of the parent display - * object. - * @param anchorY Specifies the vertical position of the anchor point - * relative to the registration point of the parent display - * object. - */ - public cubicCurveTo(controlX1: number, controlY1: number, controlX2: number, controlY2: number, anchorX: number, anchorY: number): void; - /** - * Draws a curve using the current line style from the current drawing - * position to(anchorX, anchorY) and using the control point that - * (controlX, controlY) specifies. The current - * drawing position is then set to(anchorX, - * anchorY). If the movie clip in which you are drawing contains - * content created with the Flash drawing tools, calls to the - * curveTo() method are drawn underneath this content. If you - * call the curveTo() method before any calls to the - * moveTo() method, the default of the current drawing position - * is(0, 0). If any of the parameters are missing, this method fails and the - * current drawing position is not changed. - * - *

The curve drawn is a quadratic Bezier curve. Quadratic Bezier curves - * consist of two anchor points and one control point. The curve interpolates - * the two anchor points and curves toward the control point.

- * - * @param controlX A number that specifies the horizontal position of the - * control point relative to the registration point of the - * parent display object. - * @param controlY A number that specifies the vertical position of the - * control point relative to the registration point of the - * parent display object. - * @param anchorX A number that specifies the horizontal position of the - * next anchor point relative to the registration point of - * the parent display object. - * @param anchorY A number that specifies the vertical position of the next - * anchor point relative to the registration point of the - * parent display object. - */ - public curveTo(controlX: number, controlY: number, anchorX: number, anchorY: number): void; - /** - * Draws a circle. Set the line style, fill, or both before you call the - * drawCircle() method, by calling the linestyle(), - * lineGradientStyle(), beginFill(), - * beginGradientFill(), or beginBitmapFill() - * method. - * - * @param x The x location of the center of the circle relative - * to the registration point of the parent display object(in - * pixels). - * @param y The y location of the center of the circle relative - * to the registration point of the parent display object(in - * pixels). - * @param radius The radius of the circle(in pixels). - */ - public drawCircle(x: number, y: number, radius: number): void; - /** - * Draws an ellipse. Set the line style, fill, or both before you call the - * drawEllipse() method, by calling the - * linestyle(), lineGradientStyle(), - * beginFill(), beginGradientFill(), or - * beginBitmapFill() method. - * - * @param x The x location of the top-left of the bounding-box of - * the ellipse relative to the registration point of the parent - * display object(in pixels). - * @param y The y location of the top left of the bounding-box of - * the ellipse relative to the registration point of the parent - * display object(in pixels). - * @param width The width of the ellipse(in pixels). - * @param height The height of the ellipse(in pixels). - */ - public drawEllipse(x: number, y: number, width: number, height: number): void; - /** - * Submits a series of IGraphicsData instances for drawing. This method - * accepts a Vector containing objects including paths, fills, and strokes - * that implement the IGraphicsData interface. A Vector of IGraphicsData - * instances can refer to a part of a shape, or a complex fully defined set - * of data for rendering a complete shape. - * - *

Graphics paths can contain other graphics paths. If the - * graphicsData Vector includes a path, that path and all its - * sub-paths are rendered during this operation.

- * - */ - public drawGraphicsData(graphicsData: IGraphicsData[]): void; - /** - * Submits a series of commands for drawing. The drawPath() - * method uses vector arrays to consolidate individual moveTo(), - * lineTo(), and curveTo() drawing commands into a - * single call. The drawPath() method parameters combine drawing - * commands with x- and y-coordinate value pairs and a drawing direction. The - * drawing commands are values from the GraphicsPathCommand class. The x- and - * y-coordinate value pairs are Numbers in an array where each pair defines a - * coordinate location. The drawing direction is a value from the - * GraphicsPathWinding class. - * - *

Generally, drawings render faster with drawPath() than - * with a series of individual lineTo() and - * curveTo() methods.

- * - *

The drawPath() method uses a uses a floating computation - * so rotation and scaling of shapes is more accurate and gives better - * results. However, curves submitted using the drawPath() - * method can have small sub-pixel alignment errors when used in conjunction - * with the lineTo() and curveTo() methods.

- * - *

The drawPath() method also uses slightly different rules - * for filling and drawing lines. They are:

- * - *
    - *
  • When a fill is applied to rendering a path: - *
      - *
    • A sub-path of less than 3 points is not rendered.(But note that the - * stroke rendering will still occur, consistent with the rules for strokes - * below.)
    • - *
    • A sub-path that isn't closed(the end point is not equal to the - * begin point) is implicitly closed.
    • - *
    - *
  • - *
  • When a stroke is applied to rendering a path: - *
      - *
    • The sub-paths can be composed of any number of points.
    • - *
    • The sub-path is never implicitly closed.
    • - *
    - *
  • - *
- * - * @param winding Specifies the winding rule using a value defined in the - * GraphicsPathWinding class. - */ - public drawPath(commands: number[], data: number[], winding: GraphicsPathWinding): void; - /** - * Draws a rectangle. Set the line style, fill, or both before you call the - * drawRect() method, by calling the linestyle(), - * lineGradientStyle(), beginFill(), - * beginGradientFill(), or beginBitmapFill() - * method. - * - * @param x A number indicating the horizontal position relative to the - * registration point of the parent display object(in pixels). - * @param y A number indicating the vertical position relative to the - * registration point of the parent display object(in pixels). - * @param width The width of the rectangle(in pixels). - * @param height The height of the rectangle(in pixels). - * @throws ArgumentError If the width or height - * parameters are not a number - * (Number.NaN). - */ - public drawRect(x: number, y: number, width: number, height: number): void; - /** - * Draws a rounded rectangle. Set the line style, fill, or both before you - * call the drawRoundRect() method, by calling the - * linestyle(), lineGradientStyle(), - * beginFill(), beginGradientFill(), or - * beginBitmapFill() method. - * - * @param x A number indicating the horizontal position relative - * to the registration point of the parent display - * object(in pixels). - * @param y A number indicating the vertical position relative to - * the registration point of the parent display object - * (in pixels). - * @param width The width of the round rectangle(in pixels). - * @param height The height of the round rectangle(in pixels). - * @param ellipseWidth The width of the ellipse used to draw the rounded - * corners(in pixels). - * @param ellipseHeight The height of the ellipse used to draw the rounded - * corners(in pixels). Optional; if no value is - * specified, the default value matches that provided - * for the ellipseWidth parameter. - * @throws ArgumentError If the width, height, - * ellipseWidth or - * ellipseHeight parameters are not a - * number(Number.NaN). - */ - public drawRoundRect(x: number, y: number, width: number, height: number, ellipseWidth: number, ellipseHeight?: number): void; - /** - * Renders a set of triangles, typically to distort bitmaps and give them a - * three-dimensional appearance. The drawTriangles() method maps - * either the current fill, or a bitmap fill, to the triangle faces using a - * set of(u,v) coordinates. - * - *

Any type of fill can be used, but if the fill has a transform matrix - * that transform matrix is ignored.

- * - *

A uvtData parameter improves texture mapping when a - * bitmap fill is used.

- * - * @param culling Specifies whether to render triangles that face in a - * specified direction. This parameter prevents the rendering - * of triangles that cannot be seen in the current view. This - * parameter can be set to any value defined by the - * TriangleCulling class. - */ - public drawTriangles(vertices: number[], indices?: number[], uvtData?: number[], culling?: TriangleCulling): void; - /** - * Applies a fill to the lines and curves that were added since the last call - * to the beginFill(), beginGradientFill(), or - * beginBitmapFill() method. Flash uses the fill that was - * specified in the previous call to the beginFill(), - * beginGradientFill(), or beginBitmapFill() - * method. If the current drawing position does not equal the previous - * position specified in a moveTo() method and a fill is - * defined, the path is closed with a line and then filled. - * - */ - public endFill(): void; - /** - * Specifies a bitmap to use for the line stroke when drawing lines. - * - *

The bitmap line style is used for subsequent calls to Graphics methods - * such as the lineTo() method or the drawCircle() - * method. The line style remains in effect until you call the - * lineStyle() or lineGradientStyle() methods, or - * the lineBitmapStyle() method again with different parameters. - *

- * - *

You can call the lineBitmapStyle() method in the middle of - * drawing a path to specify different styles for different line segments - * within a path.

- * - *

Call the lineStyle() method before you call the - * lineBitmapStyle() method to enable a stroke, or else the - * value of the line style is undefined.

- * - *

Calls to the clear() method set the line style back to - * undefined.

- * - * @param bitmap The bitmap to use for the line stroke. - * @param matrix An optional transformation matrix as defined by the - * flash.geom.Matrix class. The matrix can be used to scale or - * otherwise manipulate the bitmap before applying it to the - * line style. - * @param repeat Whether to repeat the bitmap in a tiled fashion. - * @param smooth Whether smoothing should be applied to the bitmap. - */ - public lineBitmapStyle(bitmap: BitmapData, matrix?: geom.Matrix, repeat?: boolean, smooth?: boolean): void; - /** - * Specifies a gradient to use for the stroke when drawing lines. - * - *

The gradient line style is used for subsequent calls to Graphics - * methods such as the lineTo() methods or the - * drawCircle() method. The line style remains in effect until - * you call the lineStyle() or lineBitmapStyle() - * methods, or the lineGradientStyle() method again with - * different parameters.

- * - *

You can call the lineGradientStyle() method in the middle - * of drawing a path to specify different styles for different line segments - * within a path.

- * - *

Call the lineStyle() method before you call the - * lineGradientStyle() method to enable a stroke, or else the - * value of the line style is undefined.

- * - *

Calls to the clear() method set the line style back to - * undefined.

- * - * @param type A value from the GradientType class that - * specifies which gradient type to use, either - * GradientType.LINEAR or GradientType.RADIAL. - * @param colors An array of RGB hexadecimal color values used - * in the gradient; for example, red is 0xFF0000, - * blue is 0x0000FF, and so on. You can specify - * up to 15 colors. For each color, specify a - * corresponding value in the alphas and ratios - * parameters. - * @param alphas An array of alpha values for the corresponding - * colors in the colors array; valid values are 0 - * to 1. If the value is less than 0, the default - * is 0. If the value is greater than 1, the - * default is 1. - * @param ratios An array of color distribution ratios; valid - * values are 0-255. This value defines the - * percentage of the width where the color is - * sampled at 100%. The value 0 represents the - * left position in the gradient box, and 255 - * represents the right position in the gradient - * box. - * @param matrix A transformation matrix as defined by the - * flash.geom.Matrix class. The flash.geom.Matrix - * class includes a - * createGradientBox() method, which - * lets you conveniently set up the matrix for use - * with the lineGradientStyle() - * method. - * @param spreadMethod A value from the SpreadMethod class that - * specifies which spread method to use: - * @param interpolationMethod A value from the InterpolationMethod class that - * specifies which value to use. For example, - * consider a simple linear gradient between two - * colors(with the spreadMethod - * parameter set to - * SpreadMethod.REFLECT). The - * different interpolation methods affect the - * appearance as follows: - * @param focalPointRatio A number that controls the location of the - * focal point of the gradient. The value 0 means - * the focal point is in the center. The value 1 - * means the focal point is at one border of the - * gradient circle. The value -1 means that the - * focal point is at the other border of the - * gradient circle. Values less than -1 or greater - * than 1 are rounded to -1 or 1. The following - * image shows a gradient with a - * focalPointRatio of -0.75: - */ - public lineGradientStyle(type: GradientType, colors: number[], alphas: number[], ratios: number[], matrix?: geom.Matrix, spreadMethod?: SpreadMethod, interpolationMethod?: InterpolationMethod, focalPointRatio?: number): void; - /** - * Specifies a line style used for subsequent calls to Graphics methods such - * as the lineTo() method or the drawCircle() - * method. The line style remains in effect until you call the - * lineGradientStyle() method, the - * lineBitmapStyle() method, or the lineStyle() - * method with different parameters. - * - *

You can call the lineStyle() method in the middle of - * drawing a path to specify different styles for different line segments - * within the path.

- * - *

Note: Calls to the clear() method set the line - * style back to undefined.

- * - *

Note: Flash Lite 4 supports only the first three parameters - * (thickness, color, and alpha).

- * - * @param thickness An integer that indicates the thickness of the line in - * points; valid values are 0-255. If a number is not - * specified, or if the parameter is undefined, a line is - * not drawn. If a value of less than 0 is passed, the - * default is 0. The value 0 indicates hairline - * thickness; the maximum thickness is 255. If a value - * greater than 255 is passed, the default is 255. - * @param color A hexadecimal color value of the line; for example, - * red is 0xFF0000, blue is 0x0000FF, and so on. If a - * value is not indicated, the default is 0x000000 - * (black). Optional. - * @param alpha A number that indicates the alpha value of the color - * of the line; valid values are 0 to 1. If a value is - * not indicated, the default is 1(solid). If the value - * is less than 0, the default is 0. If the value is - * greater than 1, the default is 1. - * @param pixelHinting(Not supported in Flash Lite 4) A Boolean value that - * specifies whether to hint strokes to full pixels. This - * affects both the position of anchors of a curve and - * the line stroke size itself. With - * pixelHinting set to true, - * line widths are adjusted to full pixel widths. With - * pixelHinting set to false, - * disjoints can appear for curves and straight lines. - * For example, the following illustrations show how - * Flash Player or Adobe AIR renders two rounded - * rectangles that are identical, except that the - * pixelHinting parameter used in the - * lineStyle() method is set differently - * (the images are scaled by 200%, to emphasize the - * difference): - * - *

If a value is not supplied, the line does not use - * pixel hinting.

- * @param scaleMode (Not supported in Flash Lite 4) A value from the - * LineScaleMode class that specifies which scale mode to - * use: - *
    - *
  • LineScaleMode.NORMAL - Always - * scale the line thickness when the object is scaled - * (the default).
  • - *
  • LineScaleMode.NONE - Never scale - * the line thickness.
  • - *
  • LineScaleMode.VERTICAL - Do not - * scale the line thickness if the object is scaled - * vertically only. For example, consider the - * following circles, drawn with a one-pixel line, and - * each with the scaleMode parameter set to - * LineScaleMode.VERTICAL. The circle on the - * left is scaled vertically only, and the circle on the - * right is scaled both vertically and horizontally: - *
  • - *
  • LineScaleMode.HORIZONTAL - Do not - * scale the line thickness if the object is scaled - * horizontally only. For example, consider the - * following circles, drawn with a one-pixel line, and - * each with the scaleMode parameter set to - * LineScaleMode.HORIZONTAL. The circle on - * the left is scaled horizontally only, and the circle - * on the right is scaled both vertically and - * horizontally:
  • - *
- * @param caps (Not supported in Flash Lite 4) A value from the - * CapsStyle class that specifies the type of caps at the - * end of lines. Valid values are: - * CapsStyle.NONE, - * CapsStyle.ROUND, and - * CapsStyle.SQUARE. If a value is not - * indicated, Flash uses round caps. - * - *

For example, the following illustrations show the - * different capsStyle settings. For each - * setting, the illustration shows a blue line with a - * thickness of 30(for which the capsStyle - * applies), and a superimposed black line with a - * thickness of 1(for which no capsStyle - * applies):

- * @param joints (Not supported in Flash Lite 4) A value from the - * JointStyle class that specifies the type of joint - * appearance used at angles. Valid values are: - * JointStyle.BEVEL, - * JointStyle.MITER, and - * JointStyle.ROUND. If a value is not - * indicated, Flash uses round joints. - * - *

For example, the following illustrations show the - * different joints settings. For each - * setting, the illustration shows an angled blue line - * with a thickness of 30(for which the - * jointStyle applies), and a superimposed - * angled black line with a thickness of 1(for which no - * jointStyle applies):

- * - *

Note: For joints set to - * JointStyle.MITER, you can use the - * miterLimit parameter to limit the length - * of the miter.

- * @param miterLimit (Not supported in Flash Lite 4) A number that - * indicates the limit at which a miter is cut off. Valid - * values range from 1 to 255(and values outside that - * range are rounded to 1 or 255). This value is only - * used if the jointStyle is set to - * "miter". The miterLimit - * value represents the length that a miter can extend - * beyond the point at which the lines meet to form a - * joint. The value expresses a factor of the line - * thickness. For example, with a - * miterLimit factor of 2.5 and a - * thickness of 10 pixels, the miter is cut - * off at 25 pixels. - * - *

For example, consider the following angled lines, - * each drawn with a thickness of 20, but - * with miterLimit set to 1, 2, and 4. - * Superimposed are black reference lines showing the - * meeting points of the joints:

- * - *

Notice that a given miterLimit value - * has a specific maximum angle for which the miter is - * cut off. The following table lists some examples:

- */ - public lineStyle(thickness?: number, color?: number, alpha?: number, pixelHinting?: boolean, scaleMode?: LineScaleMode, caps?: CapsStyle, joints?: JointStyle, miterLimit?: number): void; - /** - * Draws a line using the current line style from the current drawing - * position to(x, y); the current drawing position - * is then set to(x, y). If the display object in - * which you are drawing contains content that was created with the Flash - * drawing tools, calls to the lineTo() method are drawn - * underneath the content. If you call lineTo() before any calls - * to the moveTo() method, the default position for the current - * drawing is(0, 0). If any of the parameters are missing, this - * method fails and the current drawing position is not changed. - * - * @param x A number that indicates the horizontal position relative to the - * registration point of the parent display object(in pixels). - * @param y A number that indicates the vertical position relative to the - * registration point of the parent display object(in pixels). - */ - public lineTo(x: number, y: number): void; - /** - * Moves the current drawing position to(x, y). If - * any of the parameters are missing, this method fails and the current - * drawing position is not changed. - * - * @param x A number that indicates the horizontal position relative to the - * registration point of the parent display object(in pixels). - * @param y A number that indicates the vertical position relative to the - * registration point of the parent display object(in pixels). - */ - public moveTo(x: number, y: number): void; - } -} -/** -* The GraphicsPathWinding class provides values for the -* flash.display.GraphicsPath.winding property and the -* flash.display.Graphics.drawPath() method to determine the -* direction to draw a path. A clockwise path is positively wound, and a -* counter-clockwise path is negatively wound: -* -*

When paths intersect or overlap, the winding direction determines the -* rules for filling the areas created by the intersection or overlap:

-*/ -declare module away.base { - class GraphicsPathWinding { - static EVEN_ODD: string; - static NON_ZERO: string; - } -} -/** -* The IBitmapDrawable interface is implemented by objects that can be passed as the -* source parameter of the draw() method of the BitmapData class. These -* objects are of type BitmapData or DisplayObject. -* -* @see away.base.BitmapData#draw() -* @see away.base.BitmapData -* @see away.base.DisplayObject -*/ -declare module away.base { - interface IBitmapDrawable { - } -} -/** -* This interface is used to define objects that can be used as parameters in the -* away.base.Graphics methods, including fills, strokes, and paths. Use -* the implementor classes of this interface to create and manage drawing property -* data, and to reuse the same data for different instances. Then, use the methods of -* the Graphics class to render the drawing objects. -* -* @see away.base.Graphics.drawGraphicsData() -* @see away.base.Graphics.readGraphicsData() -*/ -declare module away.base { - interface IGraphicsData { - } -} -/** -* @module away.base -*/ -declare module away.base { - /** - * IMaterialOwner provides an interface for objects that can use materials. - * - * @interface away.base.IMaterialOwner - */ - interface IMaterialOwner extends library.IAsset { - /** - * The animation used by the material owner to assemble the vertex code. - */ - animator: animators.IAnimator; - /** - * The material with which to render the object. - */ - material: materials.MaterialBase; - /** - * - */ - uvTransform: geom.UVTransform; - /** - * - * @param renderable - * @private - */ - _iAddRenderable(renderable: pool.IRenderable): pool.IRenderable; - /** - * - * @param renderable - * @private - */ - _iRemoveRenderable(renderable: pool.IRenderable): pool.IRenderable; - /** - * - * @param renderer - * @private - */ - _iCollectRenderable(renderer: render.IRenderer): any; - } -} -/** -* The InterpolationMethod class provides values for the -* interpolationMethod parameter in the -* Graphics.beginGradientFill() and -* Graphics.lineGradientStyle() methods. This parameter -* determines the RGB space to use when rendering the gradient. -*/ -declare module away.base { - class InterpolationMethod { - /** - * Specifies that the RGB interpolation method should be used. This means - * that the gradient is rendered with exponential sRGB(standard RGB) space. - * The sRGB space is a W3C-endorsed standard that defines a non-linear - * conversion between red, green, and blue component values and the actual - * intensity of the visible component color. - * - *

For example, consider a simple linear gradient between two colors(with - * the spreadMethod parameter set to - * SpreadMethod.REFLECT). The different interpolation methods - * affect the appearance as follows:

- */ - static LINEAR_RGB: string; - /** - * Specifies that the RGB interpolation method should be used. This means - * that the gradient is rendered with exponential sRGB(standard RGB) space. - * The sRGB space is a W3C-endorsed standard that defines a non-linear - * conversion between red, green, and blue component values and the actual - * intensity of the visible component color. - * - *

For example, consider a simple linear gradient between two colors(with - * the spreadMethod parameter set to - * SpreadMethod.REFLECT). The different interpolation methods - * affect the appearance as follows:

- */ - static RGB: string; - } -} -/** -* @module away.base -*/ -declare module away.base { - /** - * ISubMesh is an interface for object SubMesh that is used to - * apply a material to a SubGeometry class - * - * @class away.base.ISubMesh - */ - interface ISubMesh extends IMaterialOwner { - subGeometry: SubGeometryBase; - parentMesh: entities.Mesh; - _iIndex: number; - _iInvalidateRenderableGeometry(): any; - _iGetExplicitMaterial(): materials.MaterialBase; - } -} -/** -* @module away.base -*/ -declare module away.base { - /** - * ISubMeshClass is an interface for the constructable class definition ISubMesh that is used to - * apply a material to a SubGeometry class - * - * @class away.base.ISubMeshClass - */ - interface ISubMeshClass { - /** - * - */ - new(subGeometry: SubGeometryBase, parentMesh: entities.Mesh, material?: materials.MaterialBase): ISubMesh; - } -} -/** -* @module away.base -*/ -declare module away.base { - /** - * @class away.base.TriangleSubGeometry - */ - class SubGeometryBase extends library.NamedAssetBase { - static VERTEX_DATA: string; - public _pStrideOffsetDirty: boolean; - public _pIndices: number[]; - public _pVertices: number[]; - private _numIndices; - private _numTriangles; - public _pNumVertices: number; - public _pConcatenateArrays: boolean; - private _indicesUpdated; - public _pStride: Object; - public _pOffset: Object; - public _pUpdateStrideOffset(): void; - public _pSubMeshClass: ISubMeshClass; - public subMeshClass : ISubMeshClass; - /** - * - */ - public concatenateArrays : boolean; - /** - * The raw index data that define the faces. - */ - public indices : number[]; - /** - * - */ - public vertices : number[]; - /** - * The total amount of triangles in the TriangleSubGeometry. - */ - public numTriangles : number; - public numVertices : number; - /** - * - */ - constructor(concatenatedArrays: boolean); - /** - * - */ - public getStride(dataType: string): any; - /** - * - */ - public getOffset(dataType: string): any; - public updateVertices(): void; - /** - * - */ - public dispose(): void; - /** - * Updates the face indices of the TriangleSubGeometry. - * - * @param indices The face indices to upload. - */ - public updateIndices(indices: number[]): void; - /** - * @protected - */ - public pInvalidateBounds(): void; - /** - * The Geometry object that 'owns' this TriangleSubGeometry object. - * - * @private - */ - public parentGeometry: Geometry; - /** - * Clones the current object - * @return An exact duplicate of the current object. - */ - public clone(): SubGeometryBase; - public applyTransformation(transform: geom.Matrix3D): void; - /** - * Scales the geometry. - * @param scale The amount by which to scale. - */ - public scale(scale: number): void; - public scaleUV(scaleU?: number, scaleV?: number): void; - public getBoundingPositions(): number[]; - private notifyIndicesUpdate(); - public _pNotifyVerticesUpdate(): void; - } -} -/** -* @module away.base -*/ -declare module away.base { - /** - * SubMeshBase wraps a TriangleSubGeometry as a scene graph instantiation. A SubMeshBase is owned by a Mesh object. - * - * - * @see away.base.TriangleSubGeometry - * @see away.entities.Mesh - * - * @class away.base.SubMeshBase - */ - class SubMeshBase extends library.NamedAssetBase { - public _pParentMesh: entities.Mesh; - public _uvTransform: geom.UVTransform; - public _iIndex: number; - public _material: materials.MaterialBase; - private _renderables; - /** - * The animator object that provides the state for the TriangleSubMesh's animation. - */ - public animator : animators.IAnimator; - /** - * The material used to render the current TriangleSubMesh. If set to null, its parent Mesh's material will be used instead. - */ - public material : materials.MaterialBase; - /** - * The scene transform object that transforms from model to world space. - */ - public sceneTransform : geom.Matrix3D; - /** - * The entity that that initially provided the IRenderable to the render pipeline (ie: the owning Mesh object). - */ - public parentMesh : entities.Mesh; - /** - * - */ - public uvTransform : geom.UVTransform; - /** - * Creates a new SubMeshBase object - */ - constructor(); - /** - * - */ - public dispose(): void; - /** - * - * @param camera - * @returns {away.geom.Matrix3D} - */ - public getRenderSceneTransform(camera: entities.Camera): geom.Matrix3D; - public _iAddRenderable(renderable: pool.IRenderable): pool.IRenderable; - public _iRemoveRenderable(renderable: pool.IRenderable): pool.IRenderable; - public _iInvalidateRenderableGeometry(): void; - public _iCollectRenderable(renderer: render.IRenderer): void; - public _iGetExplicitMaterial(): materials.MaterialBase; - } -} -/** -* The JointStyle class is an enumeration of constant values that specify the -* joint style to use in drawing lines. These constants are provided for use -* as values in the joints parameter of the -* flash.display.Graphics.lineStyle() method. The method supports -* three types of joints: miter, round, and bevel, as the following example -* shows: -*/ -declare module away.base { - class JointStyle { - /** - * Specifies beveled joints in the joints parameter of the - * flash.display.Graphics.lineStyle() method. - */ - static BEVEL: string; - /** - * Specifies mitered joints in the joints parameter of the - * flash.display.Graphics.lineStyle() method. - */ - static MITER: string; - /** - * Specifies round joints in the joints parameter of the - * flash.display.Graphics.lineStyle() method. - */ - static ROUND: string; - } -} -/** -* The LineScaleMode class provides values for the scaleMode -* parameter in the Graphics.lineStyle() method. -*/ -declare module away.base { - class LineScaleMode { - /** - * With this setting used as the scaleMode parameter of the - * lineStyle() method, the thickness of the line scales - * only vertically. For example, consider the following circles, drawn - * with a one-pixel line, and each with the scaleMode parameter - * set to LineScaleMode.VERTICAL. The circle on the left is - * scaled only vertically, and the circle on the right is scaled both - * vertically and horizontally. - */ - static HORIZONTAL: string; - /** - * With this setting used as the scaleMode parameter of the - * lineStyle() method, the thickness of the line never scales. - */ - static NONE: string; - /** - * With this setting used as the scaleMode parameter of the - * lineStyle() method, the thickness of the line always scales - * when the object is scaled(the default). - */ - static NORMAL: string; - /** - * With this setting used as the scaleMode parameter of the - * lineStyle() method, the thickness of the line scales - * only horizontally. For example, consider the following circles, - * drawn with a one-pixel line, and each with the scaleMode - * parameter set to LineScaleMode.HORIZONTAL. The circle on the - * left is scaled only horizontally, and the circle on the right is scaled - * both vertically and horizontally. - */ - static VERTICAL: string; - } -} -/** -* @module away.base -*/ -declare module away.base { - /** - * @class away.base.TriangleSubGeometry - */ - class LineSubGeometry extends SubGeometryBase { - static VERTEX_DATA: string; - static START_POSITION_DATA: string; - static END_POSITION_DATA: string; - static THICKNESS_DATA: string; - static COLOR_DATA: string; - static POSITION_FORMAT: string; - static COLOR_FORMAT: string; - static THICKNESS_FORMAT: string; - private _positionsDirty; - private _boundingPositionDirty; - private _thicknessDirty; - private _colorsDirty; - private _startPositions; - private _endPositions; - private _boundingPositions; - private _thickness; - private _startColors; - private _endColors; - private _numSegments; - private _positionsUpdated; - private _thicknessUpdated; - private _colorUpdated; - public _pUpdateStrideOffset(): void; - /** - * - */ - public vertices : number[]; - /** - * - */ - public startPositions : number[]; - /** - * - */ - public endPositions : number[]; - /** - * - */ - public thickness : number[]; - /** - * - */ - public startColors : number[]; - /** - * - */ - public endColors : number[]; - /** - * The total amount of segments in the TriangleSubGeometry. - */ - public numSegments : number; - /** - * - */ - constructor(); - public getBoundingPositions(): number[]; - /** - * - */ - public updatePositions(startValues: number[], endValues: number[]): void; - /** - * Updates the thickness. - */ - public updateThickness(values: number[]): void; - /** - * - */ - public updateColors(startValues: number[], endValues: number[]): void; - /** - * - */ - public dispose(): void; - /** - * @protected - */ - public pInvalidateBounds(): void; - /** - * The Geometry object that 'owns' this TriangleSubGeometry object. - * - * @private - */ - public parentGeometry: Geometry; - /** - * Clones the current object - * @return An exact duplicate of the current object. - */ - public clone(): LineSubGeometry; - public _pNotifyVerticesUpdate(): void; - private notifyPositionsUpdate(); - private notifyThicknessUpdate(); - private notifyColorsUpdate(); - } -} -/** -* @module away.base -*/ -declare module away.base { - /** - * LineSubMesh wraps a LineSubGeometry as a scene graph instantiation. A LineSubMesh is owned by a Mesh object. - * - * - * @see away.base.LineSubGeometry - * @see away.entities.Mesh - * - * @class away.base.LineSubMesh - */ - class LineSubMesh extends SubMeshBase implements ISubMesh { - private _subGeometry; - /** - * - */ - public assetType : string; - /** - * The LineSubGeometry object which provides the geometry data for this LineSubMesh. - */ - public subGeometry : LineSubGeometry; - /** - * Creates a new LineSubMesh object - * @param subGeometry The LineSubGeometry object which provides the geometry data for this LineSubMesh. - * @param parentMesh The Mesh object to which this LineSubMesh belongs. - * @param material An optional material used to render this LineSubMesh. - */ - constructor(subGeometry: LineSubGeometry, parentMesh: entities.Mesh, material?: materials.MaterialBase); - /** - * - */ - public dispose(): void; - public _iCollectRenderable(renderer: render.IRenderer): void; - } -} -/** -* The LoaderInfo class provides information about a loaded SWF file or a -* loaded image file(JPEG, GIF, or PNG). LoaderInfo objects are available for -* any display object. The information provided includes load progress, the -* URLs of the loader and loaded content, the number of bytes total for the -* media, and the nominal height and width of the media. -* -*

You can access LoaderInfo objects in two ways:

-* -*
    -*
  • The contentLoaderInfo property of a flash.display.Loader -* object - The contentLoaderInfo property is always available -* for any Loader object. For a Loader object that has not called the -* load() or loadBytes() method, or that has not -* sufficiently loaded, attempting to access many of the properties of the -* contentLoaderInfo property throws an error.
  • -*
  • The loaderInfo property of a display object.
  • -*
-* -*

The contentLoaderInfo property of a Loader object provides -* information about the content that the Loader object is loading, whereas -* the loaderInfo property of a DisplayObject provides -* information about the root SWF file for that display object.

-* -*

When you use a Loader object to load a display object(such as a SWF -* file or a bitmap), the loaderInfo property of the display -* object is the same as the contentLoaderInfo property of the -* Loader object(DisplayObject.loaderInfo = -* Loader.contentLoaderInfo). Because the instance of the main class of -* the SWF file has no Loader object, the loaderInfo property is -* the only way to access the LoaderInfo for the instance of the main class of -* the SWF file.

-* -*

The following diagram shows the different uses of the LoaderInfo -* object - for the instance of the main class of the SWF file, for the -* contentLoaderInfo property of a Loader object, and for the -* loaderInfo property of a loaded object:

-* -*

When a loading operation is not complete, some properties of the -* contentLoaderInfo property of a Loader object are not -* available. You can obtain some properties, such as -* bytesLoaded, bytesTotal, url, -* loaderURL, and applicationDomain. When the -* loaderInfo object dispatches the init event, you -* can access all properties of the loaderInfo object and the -* loaded image or SWF file.

-* -*

Note: All properties of LoaderInfo objects are read-only.

-* -*

The EventDispatcher.dispatchEvent() method is not -* applicable to LoaderInfo objects. If you call dispatchEvent() -* on a LoaderInfo object, an IllegalOperationError exception is thrown.

-* -* @event complete Dispatched when data has loaded successfully. In other -* words, it is dispatched when all the content has been -* downloaded and the loading has finished. The -* complete event is always dispatched after -* the init event. The init event -* is dispatched when the object is ready to access, though -* the content may still be downloading. -* @event httpStatus Dispatched when a network request is made over HTTP and -* an HTTP status code can be detected. -* @event init Dispatched when the properties and methods of a loaded -* SWF file are accessible and ready for use. The content, -* however, can still be downloading. A LoaderInfo object -* dispatches the init event when the following -* conditions exist: -*
    -*
  • All properties and methods associated with the -* loaded object and those associated with the LoaderInfo -* object are accessible.
  • -*
  • The constructors for all child objects have -* completed.
  • -*
  • All ActionScript code in the first frame of the -* loaded SWF's main timeline has been executed.
  • -*
-* -*

For example, an Event.INIT is dispatched -* when the first frame of a movie or animation is loaded. -* The movie is then accessible and can be added to the -* display list. The complete movie, however, can take -* longer to download. The Event.COMPLETE is -* only dispatched once the full movie is loaded.

-* -*

The init event always precedes the -* complete event.

-* @event ioError Dispatched when an input or output error occurs that -* causes a load operation to fail. -* @event open Dispatched when a load operation starts. -* @event progress Dispatched when data is received as the download -* operation progresses. -* @event unload Dispatched by a LoaderInfo object whenever a loaded -* object is removed by using the unload() -* method of the Loader object, or when a second load is -* performed by the same Loader object and the original -* content is removed prior to the load beginning. -*/ -declare module away.base { - class LoaderInfo extends events.EventDispatcher { - private _bytes; - private _bytesLoaded; - private _bytesTotal; - private _content; - private _contentType; - private _loader; - private _url; - /** - * The bytes associated with a LoaderInfo object. - * - * @throws SecurityError If the object accessing this API is prevented from - * accessing the loaded object due to security - * restrictions. This situation can occur, for - * instance, when a Loader object attempts to access - * the contentLoaderInfo.content property - * and it is not granted security permission to access - * the loaded content. - * - *

For more information related to security, see the - * Flash Player Developer Center Topic: Security.

- */ - public bytes : utils.ByteArray; - /** - * The number of bytes that are loaded for the media. When this number equals - * the value of bytesTotal, all of the bytes are loaded. - */ - public bytesLoaded : number; - /** - * The number of compressed bytes in the entire media file. - * - *

Before the first progress event is dispatched by this - * LoaderInfo object's corresponding Loader object, bytesTotal - * is 0. After the first progress event from the Loader object, - * bytesTotal reflects the actual number of bytes to be - * downloaded.

- */ - public bytesTotal : number; - /** - * The loaded object associated with this LoaderInfo object. - * - * @throws SecurityError If the object accessing this API is prevented from - * accessing the loaded object due to security - * restrictions. This situation can occur, for - * instance, when a Loader object attempts to access - * the contentLoaderInfo.content property - * and it is not granted security permission to access - * the loaded content. - * - *

For more information related to security, see the - * Flash Player Developer Center Topic: Security.

- */ - public content : DisplayObject; - /** - * The MIME type of the loaded file. The value is null if not - * enough of the file has loaded in order to determine the type. The - * following list gives the possible values: - *
    - *
  • "application/x-shockwave-flash"
  • - *
  • "image/jpeg"
  • - *
  • "image/gif"
  • - *
  • "image/png"
  • - *
- */ - public contentType : string; - /** - * The Loader object associated with this LoaderInfo object. If this - * LoaderInfo object is the loaderInfo property of the instance - * of the main class of the SWF file, no Loader object is associated. - * - * @throws SecurityError If the object accessing this API is prevented from - * accessing the Loader object because of security - * restrictions. This can occur, for instance, when a - * loaded SWF file attempts to access its - * loaderInfo.loader property and it is - * not granted security permission to access the - * loading SWF file. - * - *

For more information related to security, see the - * Flash Player Developer Center Topic: Security.

- */ - public loader : containers.Loader; - /** - * The URL of the media being loaded. - * - *

Before the first progress event is dispatched by this - * LoaderInfo object's corresponding Loader object, the value of the - * url property might reflect only the initial URL specified in - * the call to the load() method of the Loader object. After the - * first progress event, the url property reflects - * the media's final URL, after any redirects and relative URLs are - * resolved.

- * - *

In some cases, the value of the url property is truncated; - * see the isURLInaccessible property for details.

- */ - public url : string; - } -} -/** -* The PixelSnapping class is an enumeration of constant values for setting -* the pixel snapping options by using the pixelSnapping property -* of a Bitmap object. -*/ -declare module away.base { - class PixelSnapping { - /** - * A constant value used in the pixelSnapping property of a - * Bitmap object to specify that the bitmap image is always snapped to the - * nearest pixel, independent of any transformation. - */ - static ALWAYS: string; - /** - * A constant value used in the pixelSnapping property of a - * Bitmap object to specify that the bitmap image is snapped to the nearest - * pixel if it is drawn with no rotation or skew and it is drawn at a scale - * factor of 99.9% to 100.1%. If these conditions are satisfied, the image is - * drawn at 100% scale, snapped to the nearest pixel. Internally, this - * setting allows the image to be drawn as fast as possible by using the - * vector renderer. - */ - static AUTO: string; - /** - * A constant value used in the pixelSnapping property of a - * Bitmap object to specify that no pixel snapping occurs. - */ - static NEVER: string; - } -} -/** -* The SpreadMethod class provides values for the spreadMethod -* parameter in the beginGradientFill() and -* lineGradientStyle() methods of the Graphics class. -* -*

The following example shows the same gradient fill using various spread -* methods:

-*/ -declare module away.base { - class SpreadMethod { - /** - * Specifies that the gradient use the pad spread method. - */ - static PAD: string; - /** - * Specifies that the gradient use the reflect spread method. - */ - static REFLECT: string; - /** - * Specifies that the gradient use the repeat spread method. - */ - static REPEAT: string; - } -} -declare module away.base { - /** - * Stage provides a proxy class to handle the creation and attachment of the Context - * (and in turn the back buffer) it uses. Stage should never be created directly, - * but requested through StageManager. - * - * @see away.managers.StageManager - * - */ - class Stage extends events.EventDispatcher { - private _context; - private _container; - private _width; - private _height; - private _x; - private _y; - private _stageIndex; - private _usesSoftwareRendering; - private _profile; - private _stageManager; - private _antiAlias; - private _enableDepthAndStencil; - private _contextRequested; - private _renderTarget; - private _renderSurfaceSelector; - private _scissorRect; - private _color; - private _backBufferDirty; - private _viewPort; - private _enterFrame; - private _exitFrame; - private _viewportUpdated; - private _viewportDirty; - private _bufferClear; - private _initialised; - constructor(container: HTMLCanvasElement, stageIndex: number, stageManager: managers.StageManager, forceSoftware?: boolean, profile?: string); - /** - * Requests a Context object to attach to the managed gl canvas. - */ - public requestContext(forceSoftware?: boolean, profile?: string, mode?: string): void; - /** - * The width of the gl canvas - */ - public width : number; - /** - * The height of the gl canvas - */ - public height : number; - /** - * The x position of the gl canvas - */ - public x : number; - /** - * The y position of the gl canvas - */ - public y : number; - public visible : boolean; - public container : HTMLElement; - /** - * The Context object associated with the given stage object. - */ - public context : display.IContext; - private notifyViewportUpdated(); - private notifyEnterFrame(); - private notifyExitFrame(); - public profile : string; - /** - * Disposes the Stage object, freeing the Context attached to the Stage. - */ - public dispose(): void; - /** - * Configures the back buffer associated with the Stage object. - * @param backBufferWidth The width of the backbuffer. - * @param backBufferHeight The height of the backbuffer. - * @param antiAlias The amount of anti-aliasing to use. - * @param enableDepthAndStencil Indicates whether the back buffer contains a depth and stencil buffer. - */ - public configureBackBuffer(backBufferWidth: number, backBufferHeight: number, antiAlias: number, enableDepthAndStencil: boolean): void; - public enableDepthAndStencil : boolean; - public renderTarget : textures.TextureProxyBase; - public renderSurfaceSelector : number; - public clear(): void; - public addEventListener(type: string, listener: Function): void; - /** - * Removes a listener from the EventDispatcher object. Special case for enterframe and exitframe events - will switch StageProxy out of automatic render mode. - * If there is no matching listener registered with the EventDispatcher object, a call to this method has no effect. - * - * @param type The type of event. - * @param listener The listener object to remove. - * @param useCapture Specifies whether the listener was registered for the capture phase or the target and bubbling phases. If the listener was registered for both the capture phase and the target and bubbling phases, two calls to removeEventListener() are required to remove both, one call with useCapture() set to true, and another call with useCapture() set to false. - */ - public removeEventListener(type: string, listener: Function): void; - public scissorRect : geom.Rectangle; - /** - * The index of the Stage which is managed by this instance of StageProxy. - */ - public stageIndex : number; - /** - * Indicates whether the Stage managed by this proxy is running in software mode. - * Remember to wait for the CONTEXT_CREATED event before checking this property, - * as only then will it be guaranteed to be accurate. - */ - public usesSoftwareRendering : boolean; - /** - * The antiAliasing of the Stage. - */ - public antiAlias : number; - /** - * A viewPort rectangle equivalent of the Stage size and position. - */ - public viewPort : geom.Rectangle; - /** - * The background color of the Stage. - */ - public color : number; - /** - * The freshly cleared state of the backbuffer before any rendering - */ - public bufferClear : boolean; - /** - * Frees the Context associated with this StageProxy. - */ - private freeContext(); - /** - * The Enter_Frame handler for processing the proxy.ENTER_FRAME and proxy.EXIT_FRAME event handlers. - * Typically the proxy.ENTER_FRAME listener would render the layers for this Stage instance. - */ - private onEnterFrame(event); - public recoverFromDisposal(): boolean; - private _callback(context); - } -} -/** -* Defines codes for culling algorithms that determine which triangles not to -* render when drawing triangle paths. -* -*

The terms POSITIVE and NEGATIVE refer to the -* sign of a triangle's normal along the z-axis. The normal is a 3D vector -* that is perpendicular to the surface of the triangle.

-* -*

A triangle whose vertices 0, 1, and 2 are arranged in a clockwise order -* has a positive normal value. That is, its normal points in a positive -* z-axis direction, away from the current view point. When the -* TriangleCulling.POSITIVE algorithm is used, triangles with -* positive normals are not rendered. Another term for this is backface -* culling.

-* -*

A triangle whose vertices are arranged in a counter-clockwise order has -* a negative normal value. That is, its normal points in a negative z-axis -* direction, toward the current view point. When the -* TriangleCulling.NEGATIVE algorithm is used, triangles with -* negative normals will not be rendered.

-*/ -declare module away.base { - class TriangleCulling { - /** - * Specifies culling of all triangles facing toward the current view point. - */ - static NEGATIVE: string; - /** - * Specifies no culling. All triangles in the path are rendered. - */ - static NONE: string; - /** - * Specifies culling of all triangles facing away from the current view - * point. This is also known as backface culling. - */ - static POSITIVE: string; - } -} -/** -* @module away.base -*/ -declare module away.base { - /** - * @class away.base.TriangleSubGeometry - */ - class TriangleSubGeometry extends SubGeometryBase { - static POSITION_DATA: string; - static NORMAL_DATA: string; - static TANGENT_DATA: string; - static UV_DATA: string; - static SECONDARY_UV_DATA: string; - static JOINT_INDEX_DATA: string; - static JOINT_WEIGHT_DATA: string; - static POSITION_FORMAT: string; - static NORMAL_FORMAT: string; - static TANGENT_FORMAT: string; - static UV_FORMAT: string; - static SECONDARY_UV_FORMAT: string; - private _positionsDirty; - private _faceNormalsDirty; - private _faceTangentsDirty; - private _vertexNormalsDirty; - private _vertexTangentsDirty; - private _uvsDirty; - private _secondaryUVsDirty; - private _jointIndicesDirty; - private _jointWeightsDirty; - private _positions; - private _vertexNormals; - private _vertexTangents; - private _uvs; - private _secondaryUVs; - private _jointIndices; - private _jointWeights; - private _useCondensedIndices; - private _condensedJointIndices; - private _condensedIndexLookUp; - private _numCondensedJoints; - private _jointsPerVertex; - private _concatenateArrays; - private _autoDeriveNormals; - private _autoDeriveTangents; - private _autoDeriveUVs; - private _useFaceWeights; - private _faceNormals; - private _faceTangents; - private _faceWeights; - private _scaleU; - private _scaleV; - private _positionsUpdated; - private _normalsUpdated; - private _tangentsUpdated; - private _uvsUpdated; - private _secondaryUVsUpdated; - private _jointIndicesUpdated; - private _jointWeightsUpdated; - /** - * - */ - public scaleU : number; - /** - * - */ - public scaleV : number; - /** - * Offers the option of enabling GPU accelerated animation on skeletons larger than 32 joints - * by condensing the number of joint index values required per mesh. Only applicable to - * skeleton animations that utilise more than one mesh object. Defaults to false. - */ - public useCondensedIndices : boolean; - public _pUpdateStrideOffset(): void; - /** - * - */ - public jointsPerVertex : number; - /** - * Defines whether a UV buffer should be automatically generated to contain dummy UV coordinates. - * Set to true if a geometry lacks UV data but uses a material that requires it, or leave as false - * in cases where UV data is explicitly defined or the material does not require UV data. - */ - public autoDeriveUVs : boolean; - /** - * True if the vertex normals should be derived from the geometry, false if the vertex normals are set - * explicitly. - */ - public autoDeriveNormals : boolean; - /** - * True if the vertex tangents should be derived from the geometry, false if the vertex normals are set - * explicitly. - */ - public autoDeriveTangents : boolean; - /** - * - */ - public vertices : number[]; - /** - * - */ - public positions : number[]; - /** - * - */ - public vertexNormals : number[]; - /** - * - */ - public vertexTangents : number[]; - /** - * The raw data of the face normals, in the same order as the faces are listed in the index list. - */ - public faceNormals : number[]; - /** - * The raw data of the face tangets, in the same order as the faces are listed in the index list. - */ - public faceTangents : number[]; - /** - * - */ - public uvs : number[]; - /** - * - */ - public secondaryUVs : number[]; - /** - * - */ - public jointIndices : number[]; - /** - * - */ - public jointWeights : number[]; - /** - * Indicates whether or not to take the size of faces into account when auto-deriving vertex normals and tangents. - */ - public useFaceWeights : boolean; - public numCondensedJoints : number; - public condensedIndexLookUp : number[]; - /** - * - */ - constructor(concatenatedArrays: boolean); - public getBoundingPositions(): number[]; - /** - * - */ - public updatePositions(values: number[]): void; - /** - * Updates the vertex normals based on the geometry. - */ - public updateVertexNormals(values: number[]): void; - /** - * Updates the vertex tangents based on the geometry. - */ - public updateVertexTangents(values: number[]): void; - /** - * Updates the uvs based on the geometry. - */ - public updateUVs(values: number[]): void; - /** - * Updates the secondary uvs based on the geometry. - */ - public updateSecondaryUVs(values: number[]): void; - /** - * Updates the joint indices - */ - public updateJointIndices(values: number[]): void; - /** - * Updates the joint weights. - */ - public updateJointWeights(values: number[]): void; - /** - * - */ - public dispose(): void; - /** - * Updates the face indices of the TriangleSubGeometry. - * - * @param indices The face indices to upload. - */ - public updateIndices(indices: number[]): void; - /** - * Clones the current object - * @return An exact duplicate of the current object. - */ - public clone(): TriangleSubGeometry; - public scaleUV(scaleU?: number, scaleV?: number): void; - /** - * Scales the geometry. - * @param scale The amount by which to scale. - */ - public scale(scale: number): void; - public applyTransformation(transform: geom.Matrix3D): void; - /** - * Updates the tangents for each face. - */ - private updateFaceTangents(); - /** - * Updates the normals for each face. - */ - private updateFaceNormals(); - public _pNotifyVerticesUpdate(): void; - private notifyPositionsUpdate(); - private notifyNormalsUpdate(); - private notifyTangentsUpdate(); - private notifyUVsUpdate(); - private notifySecondaryUVsUpdate(); - private notifyJointIndicesUpdate(); - private notifyJointWeightsUpdate(); - } -} -/** -* @module away.base -*/ -declare module away.base { - /** - * TriangleSubMesh wraps a TriangleSubGeometry as a scene graph instantiation. A TriangleSubMesh is owned by a Mesh object. - * - * - * @see away.base.TriangleSubGeometry - * @see away.entities.Mesh - * - * @class away.base.TriangleSubMesh - */ - class TriangleSubMesh extends SubMeshBase implements ISubMesh { - private _subGeometry; - /** - * - */ - public assetType : string; - /** - * The TriangleSubGeometry object which provides the geometry data for this TriangleSubMesh. - */ - public subGeometry : TriangleSubGeometry; - /** - * Creates a new TriangleSubMesh object - * @param subGeometry The TriangleSubGeometry object which provides the geometry data for this TriangleSubMesh. - * @param parentMesh The Mesh object to which this TriangleSubMesh belongs. - * @param material An optional material used to render this TriangleSubMesh. - */ - constructor(subGeometry: TriangleSubGeometry, parentMesh: entities.Mesh, material?: materials.MaterialBase); - /** - * - */ - public dispose(): void; - public _iCollectRenderable(renderer: render.IRenderer): void; - } -} -declare module away.textures { - /** - * - */ - class TextureProxyBase extends library.NamedAssetBase implements library.IAsset { - public _pSize: number; - public _pFormat: string; - private _hasMipmaps; - private _generateMipmaps; - private _textureData; - /** - * - */ - constructor(generateMipmaps?: boolean); - public size : number; - public hasMipmaps : boolean; - /** - * - * @returns {string} - */ - public format : string; - /** - * - * @returns {boolean} - */ - public generateMipmaps : boolean; - /** - * - * @returns {string} - */ - public assetType : string; - /** - * - */ - public invalidateContent(): void; - /** - * - * @private - */ - public invalidateSize(): void; - /** - * @inheritDoc - */ - public dispose(): void; - public _iAddTextureData(textureData: pool.ITextureData): pool.ITextureData; - public _iRemoveTextureData(textureData: pool.ITextureData): pool.ITextureData; - } -} -declare module away.textures { - class Texture2DBase extends TextureProxyBase { - private _mipmapData; - private _mipmapDataDirty; - public _pWidth: number; - public _pHeight: number; - /** - * - * @returns {number} - */ - public width : number; - /** - * - * @returns {number} - */ - public height : number; - public size : number; - constructor(generateMipmaps?: boolean); - /** - * @inheritDoc - */ - public dispose(): void; - /** - * - */ - public invalidateContent(): void; - /** - * - * @param width - * @param height - * @private - */ - public _pSetSize(width: number, height: number): void; - public _iGetMipmapData(): base.BitmapData[]; - public _iGetTextureData(): any; - } -} -declare module away.textures { - class CubeTextureBase extends TextureProxyBase { - public _mipmapDataArray: base.BitmapData[][]; - public _mipmapDataDirtyArray: boolean[]; - constructor(generateMipmaps?: boolean); - /** - * - * @param width - * @param height - * @private - */ - public _pSetSize(size: number): void; - /** - * @inheritDoc - */ - public dispose(): void; - /** - * - */ - public invalidateContent(): void; - public _iGetMipmapData(side: number): base.BitmapData[]; - public _iGetTextureData(side: number): any; - } -} -declare module away.textures { - class ImageTexture extends Texture2DBase { - private _htmlImageElement; - /** - * - * @param htmlImageElement - * @param generateMipmaps - */ - constructor(htmlImageElement: HTMLImageElement, generateMipmaps?: boolean); - /** - * - */ - public htmlImageElement : HTMLImageElement; - public _iGetTextureData(): HTMLImageElement; - } -} -declare module away.textures { - class BitmapTexture extends Texture2DBase { - public _bitmapData: base.BitmapData; - /** - * - * @returns {BitmapData} - */ - public bitmapData : base.BitmapData; - constructor(bitmapData: base.BitmapData, generateMipmaps?: boolean); - public dispose(): void; - public _iGetTextureData(): base.BitmapData; - } -} -declare module away.textures { - class RenderTexture extends Texture2DBase { - /** - * - * @returns {number} - */ - public width : number; - /** - * - * @returns {number} - */ - public height : number; - constructor(width: number, height: number); - } -} -declare module away.textures { - class ImageCubeTexture extends CubeTextureBase { - private _htmlImageElements; - /** - * The texture on the cube's right face. - */ - public positiveX : HTMLImageElement; - /** - * The texture on the cube's left face. - */ - public negativeX : HTMLImageElement; - /** - * The texture on the cube's top face. - */ - public positiveY : HTMLImageElement; - /** - * The texture on the cube's bottom face. - */ - public negativeY : HTMLImageElement; - /** - * The texture on the cube's far face. - */ - public positiveZ : HTMLImageElement; - /** - * The texture on the cube's near face. - */ - public negativeZ : HTMLImageElement; - constructor(posX: HTMLImageElement, negX: HTMLImageElement, posY: HTMLImageElement, negY: HTMLImageElement, posZ: HTMLImageElement, negZ: HTMLImageElement, generateMipmaps?: boolean); - private _testSize(value); - public _iGetTextureData(side: number): HTMLImageElement; - } -} -declare module away.textures { - class BitmapCubeTexture extends CubeTextureBase { - private _bitmapDatas; - /** - * The texture on the cube's right face. - */ - public positiveX : base.BitmapData; - /** - * The texture on the cube's left face. - */ - public negativeX : base.BitmapData; - /** - * The texture on the cube's top face. - */ - public positiveY : base.BitmapData; - /** - * The texture on the cube's bottom face. - */ - public negativeY : base.BitmapData; - /** - * The texture on the cube's far face. - */ - public positiveZ : base.BitmapData; - /** - * The texture on the cube's near face. - */ - public negativeZ : base.BitmapData; - constructor(posX: base.BitmapData, negX: base.BitmapData, posY: base.BitmapData, negY: base.BitmapData, posZ: base.BitmapData, negZ: base.BitmapData, generateMipmaps?: boolean); - /** - * - * @param value - * @private - */ - private _testSize(value); - public dispose(): void; - public _iGetTextureData(side: number): base.BitmapData; - } -} -declare module away.textures { - /** - * MipmapGenerator is a helper class that uploads BitmapData to a Texture including mipmap levels. - */ - class MipmapGenerator { - private static _mipMaps; - private static _mipMapUses; - private static _matrix; - private static _rect; - private static _source; - /** - * Uploads a BitmapData with mip maps to a target Texture object. - * @param source The source to upload. - * @param target The target Texture to upload to. - * @param mipmap An optional mip map holder to avoids creating new instances for fe animated materials. - * @param alpha Indicate whether or not the uploaded bitmapData is transparent. - */ - static generateMipMaps(source: HTMLImageElement, output?: base.BitmapData[], alpha?: boolean): any; - static generateMipMaps(source: base.BitmapData, output?: base.BitmapData[], alpha?: boolean): any; - private static _getMipmapHolder(mipMapHolder, newW, newH); - static freeMipMapHolder(mipMapHolder: base.BitmapData): void; - } -} -declare module away.textures { - /** - * A convenience texture that encodes a specular map in the red channel, and the gloss map in the green channel, as expected by BasicSpecularMapMethod - */ - class SpecularBitmapTexture extends BitmapTexture { - private _specularMap; - private _glossMap; - constructor(specularMap?: base.BitmapData, glossMap?: base.BitmapData, generateMipmaps?: boolean); - public specularMap : base.BitmapData; - public glossMap : base.BitmapData; - private _testSize(); - public _iGetTextureData(): base.BitmapData; - } -} -declare module away.parsers { - /** - * ParserBase provides an abstract base class for objects that convert blocks of data to data structures - * supported by away. - * - * If used by AssetLoader to automatically determine the parser type, two public static methods should - * be implemented, with the following signatures: - * - * public static supportsType(extension : string) : boolean - * Indicates whether or not a given file extension is supported by the parser. - * - * public static supportsData(data : *) : boolean - * Tests whether a data block can be parsed by the parser. - * - * Furthermore, for any concrete subtype, the method initHandle should be overridden to immediately - * create the object that will contain the parsed data. This allows ResourceManager to return an object - * handle regardless of whether the object was loaded or not. - * - * @see away.net.AssetLoader - */ - class ParserBase extends events.EventDispatcher { - public _iFileName: string; - private _dataFormat; - private _data; - private _frameLimit; - private _lastFrameTime; - private _pOnIntervalDelegate; - public _pContent: base.DisplayObject; - static supportsType(extension: string): boolean; - private _dependencies; - private _parsingPaused; - private _parsingComplete; - private _parsingFailure; - private _timer; - private _materialMode; - /** - * Returned by proceedParsing to indicate no more parsing is needed. - */ - static PARSING_DONE: boolean; - /** - * Returned by proceedParsing to indicate more parsing is needed, allowing asynchronous parsing. - */ - static MORE_TO_PARSE: boolean; - public content : base.DisplayObject; - /** - * Creates a new ParserBase object - * @param format The data format of the file data to be parsed. Can be either ParserDataFormat.BINARY or ParserDataFormat.PLAIN_TEXT, and should be provided by the concrete subtype. - * - * @see away.loading.parsers.ParserDataFormat - */ - constructor(format: string); - /** - * Validates a bitmapData loaded before assigning to a default BitmapMaterial - */ - public isBitmapDataValid(bitmapData: base.BitmapData): boolean; - public parsingFailure : boolean; - public parsingPaused : boolean; - public parsingComplete : boolean; - public materialMode : number; - public data : any; - /** - * The data format of the file data to be parsed. Options are URLLoaderDataFormat.BINARY, URLLoaderDataFormat.ARRAY_BUFFER, URLLoaderDataFormat.BLOB, URLLoaderDataFormat.VARIABLES or URLLoaderDataFormat.TEXT. - */ - public dataFormat : string; - /** - * Parse data (possibly containing bytearry, plain text or BitmapAsset) asynchronously, meaning that - * the parser will periodically stop parsing so that the AVM may proceed to the - * next frame. - * - * @param data The untyped data object in which the loaded data resides. - * @param frameLimit number of milliseconds of parsing allowed per frame. The - * actual time spent on a frame can exceed this number since time-checks can - * only be performed between logical sections of the parsing procedure. - */ - public parseAsync(data: any, frameLimit?: number): void; - /** - * A list of dependencies that need to be loaded and resolved for the object being parsed. - */ - public dependencies : ResourceDependency[]; - /** - * Resolve a dependency when it's loaded. For example, a dependency containing an ImageResource would be assigned - * to a Mesh instance as a BitmapMaterial, a scene graph object would be added to its intended parent. The - * dependency should be a member of the dependencies property. - * - * @param resourceDependency The dependency to be resolved. - */ - public _iResolveDependency(resourceDependency: ResourceDependency): void; - /** - * Resolve a dependency loading failure. Used by parser to eventually provide a default map - * - * @param resourceDependency The dependency to be resolved. - */ - public _iResolveDependencyFailure(resourceDependency: ResourceDependency): void; - /** - * Resolve a dependency name - * - * @param resourceDependency The dependency to be resolved. - */ - public _iResolveDependencyName(resourceDependency: ResourceDependency, asset: library.IAsset): string; - public _iResumeParsingAfterDependencies(): void; - public _pFinalizeAsset(asset: library.IAsset, name?: string): void; - /** - * Parse the next block of data. - * @return Whether or not more data needs to be parsed. Can be ParserBase.ParserBase.PARSING_DONE or - * ParserBase.ParserBase.MORE_TO_PARSE. - */ - public _pProceedParsing(): boolean; - public _pDieWithError(message?: string): void; - public _pAddDependency(id: string, req: net.URLRequest, retrieveAsRawData?: boolean, data?: any, suppressErrorEvents?: boolean): ResourceDependency; - public _pPauseAndRetrieveDependencies(): void; - /** - * Tests whether or not there is still time left for parsing within the maximum allowed time frame per session. - * @return True if there is still time left, false if the maximum allotted time was exceeded and parsing should be interrupted. - */ - public _pHasTime(): boolean; - /** - * Called when the parsing pause interval has passed and parsing can proceed. - */ - public _pOnInterval(event?: events.TimerEvent): void; - /** - * Initializes the parsing of data. - * @param frameLimit The maximum duration of a parsing session. - */ - public _pStartParsing(frameLimit: number): void; - /** - * Finish parsing the data. - */ - public _pFinishParsing(): void; - /** - * - * @returns {string} - * @private - */ - public _pGetTextData(): string; - /** - * - * @returns {string} - * @private - */ - public _pGetByteData(): utils.ByteArray; - } -} -declare module away.parsers { - /** - * CubeTextureParser provides a "parser" for natively supported image types (jpg, png). While it simply loads bytes into - * a loader object, it wraps it in a BitmapDataResource so resource management can happen consistently without - * exception cases. - */ - class CubeTextureParser extends ParserBase { - private static posX; - private static negX; - private static posY; - private static negY; - private static posZ; - private static negZ; - private _imgDependencyDictionary; - /** - * Creates a new CubeTextureParser object. - * @param uri The url or id of the data or file to be parsed. - * @param extra The holder for extra contextual data that the parser might need. - */ - constructor(); - /** - * Indicates whether or not a given file extension is supported by the parser. - * @param extension The file extension of a potential file to be parsed. - * @return Whether or not the given file type is supported. - */ - static supportsType(extension: string): boolean; - /** - * Tests whether a data block can be parsed by the parser. - * @param data The data block to potentially be parsed. - * @return Whether or not the given data is supported. - */ - static supportsData(data: any): boolean; - /** - * @inheritDoc - */ - public _iResolveDependency(resourceDependency: ResourceDependency): void; - /** - * @inheritDoc - */ - public _iResolveDependencyFailure(resourceDependency: ResourceDependency): void; - /** - * @inheritDoc - */ - public _pProceedParsing(): boolean; - private _validateCubeData(); - private _getHTMLImageElement(name); - } -} -declare module away.parsers { - /** - * Texture2DParser provides a "parser" for natively supported image types (jpg, png). While it simply loads bytes into - * a loader object, it wraps it in a BitmapDataResource so resource management can happen consistently without - * exception cases. - */ - class Texture2DParser extends ParserBase { - private _startedParsing; - private _doneParsing; - private _loadingImage; - private _htmlImageElement; - /** - * Creates a new Texture2DParser object. - * @param uri The url or id of the data or file to be parsed. - * @param extra The holder for extra contextual data that the parser might need. - */ - constructor(); - /** - * Indicates whether or not a given file extension is supported by the parser. - * @param extension The file extension of a potential file to be parsed. - * @return Whether or not the given file type is supported. - */ - static supportsType(extension: string): boolean; - /** - * Tests whether a data block can be parsed by the parser. - * @param data The data block to potentially be parsed. - * @return Whether or not the given data is supported. - */ - static supportsData(data: any): boolean; - /** - * @inheritDoc - */ - public _pProceedParsing(): boolean; - public onLoadComplete(event: any): void; - } -} -declare module away.parsers { - /** - * An enumeration providing values to describe the data format of parsed data. - */ - class ParserDataFormat { - /** - * Describes the format of a binary file. - */ - static BINARY: string; - /** - * Describes the format of a plain text file. - */ - static PLAIN_TEXT: string; - /** - * Describes the format of an image file - */ - static IMAGE: string; - } -} -declare module away.parsers { - class ParserUtils { - /** - * Converts an ArrayBuffer to a base64 string - * - * @param image data as a ByteArray - * - * @return HTMLImageElement - * - */ - static arrayBufferToImage(data: ArrayBuffer): HTMLImageElement; - /** - * Converts an ByteArray to an Image - returns an HTMLImageElement - * - * @param image data as a ByteArray - * - * @return HTMLImageElement - * - */ - static byteArrayToImage(data: utils.ByteArray): HTMLImageElement; - /** - * Converts an Blob to an Image - returns an HTMLImageElement - * - * @param image data as a Blob - * - * @return HTMLImageElement - * - */ - static blobToImage(data: Blob): HTMLImageElement; - /** - * Returns a object as ByteArray, if possible. - * - * @param data The object to return as ByteArray - * - * @return The ByteArray or null - * - */ - static toByteArray(data: any): utils.ByteArray; - /** - * Returns a object as String, if possible. - * - * @param data The object to return as String - * @param length The length of the returned String - * - * @return The String or null - * - */ - static toString(data: any, length?: number): string; - } -} -declare module away.parsers { - /** - * ResourceDependency represents the data required to load, parse and resolve additional files ("dependencies") - * required by a parser, used by ResourceLoadSession. - * - */ - class ResourceDependency { - private _id; - private _request; - private _assets; - private _parser; - private _parentParser; - private _data; - private _retrieveAsRawData; - private _suppressAssetEvents; - private _dependencies; - public _iLoader: net.URLLoader; - public _iSuccess: boolean; - constructor(id: string, request: net.URLRequest, data: any, parser: ParserBase, parentParser: ParserBase, retrieveAsRawData?: boolean, suppressAssetEvents?: boolean); - /** - * - */ - public id : string; - /** - * - */ - public request : net.URLRequest; - /** - * The data containing the dependency to be parsed, if the resource was already loaded. - */ - public data : any; - /** - * - */ - public parser : ParserBase; - /** - * The parser which is dependent on this ResourceDependency object. - */ - public parentParser : ParserBase; - /** - * - */ - public retrieveAsRawData : boolean; - /** - * - */ - public suppresAssetEvents : boolean; - /** - * - */ - public assets : library.IAsset[]; - /** - * - */ - public dependencies : ResourceDependency[]; - /** - * @private - * Method to set data after having already created the dependency object, e.g. after load. - */ - public _iSetData(data: any): void; - /** - * @private - * - */ - public _iSetParser(parser: ParserBase): void; - /** - * Resolve the dependency when it's loaded with the parent parser. For example, a dependency containing an - * ImageResource would be assigned to a Mesh instance as a BitmapMaterial, a scene graph object would be added - * to its intended parent. The dependency should be a member of the dependencies property. - */ - public resolve(): void; - /** - * Resolve a dependency failure. For example, map loading failure from a 3d file - */ - public resolveFailure(): void; - /** - * Resolve the dependencies name - */ - public resolveName(asset: library.IAsset): string; - } -} -declare module away.library { - class AssetLoaderContext { - static UNDEFINED: number; - static SINGLEPASS_MATERIALS: number; - static MULTIPASS_MATERIALS: number; - private _includeDependencies; - private _dependencyBaseUrl; - private _embeddedDataByUrl; - private _remappedUrls; - private _materialMode; - private _overrideAbsPath; - private _overrideFullUrls; - /** - * AssetLoaderContext provides configuration for the AssetLoader load() and parse() operations. - * Use it to configure how (and if) dependencies are loaded, or to map dependency URLs to - * embedded data. - * - * @see away.loading.AssetLoader - */ - constructor(includeDependencies?: boolean, dependencyBaseUrl?: string); - /** - * Defines whether dependencies (all files except the one at the URL given to the load() or - * parseData() operations) should be automatically loaded. Defaults to true. - */ - public includeDependencies : boolean; - /** - * MaterialMode defines, if the Parser should create SinglePass or MultiPass Materials - * Options: - * 0 (Default / undefined) - All Parsers will create SinglePassMaterials, but the AWD2.1parser will create Materials as they are defined in the file - * 1 (Force SinglePass) - All Parsers create SinglePassMaterials - * 2 (Force MultiPass) - All Parsers will create MultiPassMaterials - * - */ - public materialMode : number; - /** - * A base URL that will be prepended to all relative dependency URLs found in a loaded resource. - * Absolute paths will not be affected by the value of this property. - */ - public dependencyBaseUrl : string; - /** - * Defines whether absolute paths (defined as paths that begin with a "/") should be overridden - * with the dependencyBaseUrl defined in this context. If this is true, and the base path is - * "base", /path/to/asset.jpg will be resolved as base/path/to/asset.jpg. - */ - public overrideAbsolutePaths : boolean; - /** - * Defines whether "full" URLs (defined as a URL that includes a scheme, e.g. http://) should be - * overridden with the dependencyBaseUrl defined in this context. If this is true, and the base - * path is "base", http://example.com/path/to/asset.jpg will be resolved as base/path/to/asset.jpg. - */ - public overrideFullURLs : boolean; - /** - * Map a URL to another URL, so that files that are referred to by the original URL will instead - * be loaded from the new URL. Use this when your file structure does not match the one that is - * expected by the loaded file. - * - * @param originalUrl The original URL which is referenced in the loaded resource. - * @param newUrl The URL from which away.should load the resource instead. - * - * @see mapUrlToData() - */ - public mapUrl(originalUrl: string, newUrl: string): void; - /** - * Map a URL to embedded data, so that instead of trying to load a dependency from the URL at - * which it's referenced, the dependency data will be retrieved straight from the memory instead. - * - * @param originalUrl The original URL which is referenced in the loaded resource. - * @param data The embedded data. Can be ByteArray or a class which can be used to create a bytearray. - */ - public mapUrlToData(originalUrl: string, data: any): void; - /** - * @private - * Defines whether embedded data has been mapped to a particular URL. - */ - public _iHasDataForUrl(url: string): boolean; - /** - * @private - * Returns embedded data for a particular URL. - */ - public _iGetDataForUrl(url: string): any; - /** - * @private - * Defines whether a replacement URL has been mapped to a particular URL. - */ - public _iHasMappingForUrl(url: string): boolean; - /** - * @private - * Returns new (replacement) URL for a particular original URL. - */ - public _iGetRemappedUrl(originalUrl: string): string; - } -} -declare module away.library { - /** - * AssetLoader can load any file format that away.supports (or for which a third-party parser - * has been plugged in) and it's dependencies. Events are dispatched when assets are encountered - * and for when the resource (or it's dependencies) have been loaded. - * - * The AssetLoader will not make assets available in any other way than through the dispatched - * events. To store assets and make them available at any point from any module in an application, - * use the AssetLibrary to load and manage assets. - * - * @see away.library.AssetLibrary - */ - class AssetLoader extends events.EventDispatcher { - private _context; - private _token; - private _uri; - private _content; - private _materialMode; - private _errorHandlers; - private _parseErrorHandlers; - private _stack; - private _baseDependency; - private _currentDependency; - private _namespace; - private _onReadyForDependenciesDelegate; - private _onParseCompleteDelegate; - private _onParseErrorDelegate; - private _onLoadCompleteDelegate; - private _onLoadErrorDelegate; - private _onTextureSizeErrorDelegate; - private _onAssetCompleteDelegate; - private static _parsers; - /** - * Enables a specific parser. - * When no specific parser is set for a loading/parsing opperation, - * loader3d can autoselect the correct parser to use. - * A parser must have been enabled, to be considered when autoselecting the parser. - * - * @param parser The parser class to enable. - * - * @see away.parsers.Parsers - */ - static enableParser(parser: any): void; - /** - * Enables a list of parsers. - * When no specific parser is set for a loading/parsing opperation, - * AssetLoader can autoselect the correct parser to use. - * A parser must have been enabled, to be considered when autoselecting the parser. - * - * @param parsers A Vector of parser classes to enable. - * @see away.parsers.Parsers - */ - static enableParsers(parsers: Object[]): void; - /** - * Returns the base dependency of the loader - */ - public baseDependency : parsers.ResourceDependency; - /** - * Create a new ResourceLoadSession object. - */ - constructor(materialMode?: number); - /** - * Loads a file and (optionally) all of its dependencies. - * - * @param req The URLRequest object containing the URL of the file to be loaded. - * @param context An optional context object providing additional parameters for loading - * @param ns An optional namespace string under which the file is to be loaded, allowing the differentiation of two resources with identical assets - * @param parser An optional parser object for translating the loaded data into a usable resource. If not provided, AssetLoader will attempt to auto-detect the file type. - */ - public load(req: net.URLRequest, context?: AssetLoaderContext, ns?: string, parser?: parsers.ParserBase): AssetLoaderToken; - /** - * Loads a resource from already loaded data. - * - * @param data The data object containing all resource information. - * @param context An optional context object providing additional parameters for loading - * @param ns An optional namespace string under which the file is to be loaded, allowing the differentiation of two resources with identical assets - * @param parser An optional parser object for translating the loaded data into a usable resource. If not provided, AssetLoader will attempt to auto-detect the file type. - */ - public loadData(data: any, id: string, context?: AssetLoaderContext, ns?: string, parser?: parsers.ParserBase): AssetLoaderToken; - /** - * Recursively retrieves the next to-be-loaded and parsed dependency on the stack, or pops the list off the - * stack when complete and continues on the top set. - * @param parser The parser that will translate the data into a usable resource. - */ - private retrieveNext(parser?); - /** - * Retrieves a single dependency. - * @param parser The parser that will translate the data into a usable resource. - */ - private retrieveDependency(dependency); - private joinUrl(base, end); - private resolveDependencyUrl(dependency); - private retrieveParserDependencies(); - private resolveParserDependencies(); - /** - * Called when a single dependency loading failed, and pushes further dependencies onto the stack. - * @param event - */ - private onLoadError(event); - /** - * Called when a dependency parsing failed, and dispatches a ParserEvent.PARSE_ERROR - * @param event - */ - private onParseError(event); - private onAssetComplete(event); - private onReadyForDependencies(event); - /** - * Called when a single dependency was parsed, and pushes further dependencies onto the stack. - * @param event - */ - private onLoadComplete(event); - /** - * Called when parsing is complete. - */ - private onParseComplete(event); - /** - * Called when an image is too large or it's dimensions are not a power of 2 - * @param event - */ - private onTextureSizeError(event); - private addEventListeners(loader); - private removeEventListeners(loader); - public stop(): void; - private dispose(); - /** - * @private - * This method is used by other loader classes (e.g. Loader3D and AssetLibraryBundle) to - * add error event listeners to the AssetLoader instance. This system is used instead of - * the regular EventDispatcher system so that the AssetLibrary error handler can be sure - * that if hasEventListener() returns true, it's client code that's listening for the - * event. Secondly, functions added as error handler through this custom method are - * expected to return a boolean value indicating whether the event was handled (i.e. - * whether they in turn had any client code listening for the event.) If no handlers - * return true, the AssetLoader knows that the event wasn't handled and will throw an RTE. - */ - public _iAddParseErrorHandler(handler: any): void; - public _iAddErrorHandler(handler: any): void; - /** - * Guesses the parser to be used based on the file contents. - * @param data The data to be parsed. - * @param uri The url or id of the object to be parsed. - * @return An instance of the guessed parser. - */ - private getParserFromData(data); - /** - * Initiates parsing of the loaded dependency. - * - * @param The dependency to be parsed. - */ - private parseDependency(dependency); - /** - * Guesses the parser to be used based on the file extension. - * @return An instance of the guessed parser. - */ - private getParserFromSuffix(url); - } -} -declare module away.library { - /** - * Instances of this class are returned as tokens by loading operations - * to provide an object on which events can be listened for in cases where - * the actual asset loader is not directly available (e.g. when using the - * AssetLibrary to perform the load.) - * - * By listening for events on this class instead of directly on the - * AssetLibrary, one can distinguish different loads from each other. - * - * The token will dispatch all events that the original AssetLoader dispatches, - * while not providing an interface to obstruct the load and is as such a - * safer return value for loader wrappers than the loader itself. - */ - class AssetLoaderToken extends events.EventDispatcher { - public _iLoader: AssetLoader; - constructor(loader: AssetLoader); - public addEventListener(type: string, listener: Function): void; - public removeEventListener(type: string, listener: Function): void; - public hasEventListener(type: string, listener?: Function): boolean; - } -} -declare module away.library { - class IDUtil { - /** - * @private - * Char codes for 0123456789ABCDEF - */ - private static ALPHA_CHAR_CODES; - /** - * Generates a UID (unique identifier) based on ActionScript's - * pseudo-random number generator and the current time. - * - *

The UID has the form - * "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" - * where X is a hexadecimal digit (0-9, A-F).

- * - *

This UID will not be truly globally unique; but it is the best - * we can do without player support for UID generation.

- * - * @return The newly-generated UID. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - static createUID(): string; - } -} -declare module away.library { - class AssetLibraryIterator { - private _assets; - private _filtered; - private _idx; - constructor(assets: IAsset[], assetTypeFilter: string, namespaceFilter: string, filterFunc: any); - public currentAsset : IAsset; - public numAssets : number; - public next(): IAsset; - public reset(): void; - public setIndex(index: number): void; - private filter(assetTypeFilter, namespaceFilter, filterFunc); - } -} -declare module away.library { - /** - * Abstract base class for naming conflict resolution classes. Extend this to create a - * strategy class which the asset library can use to resolve asset naming conflicts, or - * use one of the bundled concrete strategy classes: - * - *
    - *
  • IgnoreConflictStrategy (ConflictStrategy.IGNORE)
  • - *
  • ErrorConflictStrategy (ConflictStrategy.THROW_ERROR)
  • - *
  • NumSuffixConflictStrategy (ConflictStrategy.APPEND_NUM_SUFFIX)
  • - *
- * - * @see away.library.AssetLibrary.conflictStrategy - * @see away.library.ConflictStrategy - * @see away.library.IgnoreConflictStrategy - * @see away.library.ErrorConflictStrategy - * @see away.library.NumSuffixConflictStrategy - */ - class ConflictStrategyBase { - constructor(); - /** - * Resolve a naming conflict between two assets. Must be implemented by concrete strategy - * classes. - */ - public resolveConflict(changedAsset: IAsset, oldAsset: IAsset, assetsDictionary: Object, precedence: string): void; - /** - * Create instance of this conflict strategy. Used internally by the AssetLibrary to - * make sure the same strategy instance is not used in all AssetLibrary instances, which - * would break any state caching that happens inside the strategy class. - */ - public create(): ConflictStrategyBase; - /** - * Provided as a convenience method for all conflict strategy classes, as a way to finalize - * the conflict resolution by applying the new names and dispatching the correct events. - */ - public _pUpdateNames(ns: string, nonConflictingName: string, oldAsset: IAsset, newAsset: IAsset, assetsDictionary: Object, precedence: string): void; - } -} -declare module away.library { - class NumSuffixConflictStrategy extends ConflictStrategyBase { - private _separator; - private _next_suffix; - constructor(separator?: string); - public resolveConflict(changedAsset: IAsset, oldAsset: IAsset, assetsDictionary: Object, precedence: string): void; - public create(): ConflictStrategyBase; - } -} -declare module away.library { - class IgnoreConflictStrategy extends ConflictStrategyBase { - constructor(); - public resolveConflict(changedAsset: IAsset, oldAsset: IAsset, assetsDictionary: Object, precedence: string): void; - public create(): ConflictStrategyBase; - } -} -declare module away.library { - class ErrorConflictStrategy extends ConflictStrategyBase { - constructor(); - public resolveConflict(changedAsset: IAsset, oldAsset: IAsset, assetsDictionary: Object, precedence: string): void; - public create(): ConflictStrategyBase; - } -} -declare module away.library { - /** - * Enumaration class for precedence when resolving naming conflicts in the library. - * - * @see away.library.AssetLibrary.conflictPrecedence - * @see away.library.AssetLibrary.conflictStrategy - * @see away.library.naming.ConflictStrategy - */ - class ConflictPrecedence { - /** - * Signals that in a conflict, the previous owner of the conflicting name - * should be favored (and keep it's name) and that the newly renamed asset - * is reverted to a non-conflicting name. - */ - static FAVOR_OLD: string; - /** - * Signales that in a conflict, the newly renamed asset is favored (and keeps - * it's newly defined name) and that the previous owner of that name gets - * renamed to a non-conflicting name. - */ - static FAVOR_NEW: string; - } -} -declare module away.library { - /** - * Enumeration class for bundled conflict strategies. Set one of these values (or an - * instance of a self-defined sub-class of ConflictStrategyBase) to the conflictStrategy - * property on an AssetLibrary to define how that library resolves naming conflicts. - * - * The value of the AssetLibrary.conflictPrecedence property defines which - * of the conflicting assets will get to keep it's name, and which is renamed (if any.) - * - * @see away.library.AssetLibrary.conflictStrategy - * @see away.library.naming.ConflictStrategyBase - */ - class ConflictStrategy { - /** - * Specifies that in case of a naming conflict, one of the assets will be renamed and - * a numeric suffix appended to the base name. - */ - static APPEND_NUM_SUFFIX: ConflictStrategyBase; - /** - * Specifies that naming conflicts should be ignored. This is not recommended in most - * cases, unless it can be 100% guaranteed that the application does not cause naming - * conflicts in the library (i.e. when an app-level system is in place to prevent this.) - */ - static IGNORE: ConflictStrategyBase; - /** - * Specifies that an error should be thrown if a naming conflict is discovered. Use this - * to be 100% sure that naming conflicts never occur unnoticed, and when it's undesirable - * to have the library automatically rename assets to avoid such conflicts. - */ - static THROW_ERROR: ConflictStrategyBase; - } -} -declare module away.library { - /** - * AssetLibraryBundle enforces a multiton pattern and is not intended to be instanced directly. - * Its purpose is to create a container for 3D data management, both before and after parsing. - * If you are interested in creating multiple library bundles, please use the getInstance() method. - */ - class AssetLibraryBundle extends events.EventDispatcher { - private _loadingSessions; - private _strategy; - private _strategyPreference; - private _assets; - private _assetDictionary; - private _assetDictDirty; - private _loadingSessionsGarbage; - private _gcTimeoutIID; - private _onAssetRenameDelegate; - private _onAssetConflictResolvedDelegate; - private _onResourceCompleteDelegate; - private _onTextureSizeErrorDelegate; - private _onAssetCompleteDelegate; - private _onLoadErrorDelegate; - private _onParseErrorDelegate; - /** - * Creates a new AssetLibraryBundle object. - * - * @param me A multiton enforcer for the AssetLibraryBundle ensuring it cannnot be instanced. - */ - constructor(me: AssetLibraryBundleSingletonEnforcer); - /** - * Returns an AssetLibraryBundle instance. If no key is given, returns the default bundle instance (which is - * similar to using the AssetLibraryBundle as a singleton.) To keep several separated library bundles, - * pass a string key to this method to define which bundle should be returned. This is - * referred to as using the AssetLibrary as a multiton. - * - * @param key Defines which multiton instance should be returned. - * @return An instance of the asset library - */ - static getInstance(key?: string): AssetLibraryBundle; - /** - * - */ - public enableParser(parserClass: Object): void; - /** - * - */ - public enableParsers(parserClasses: Object[]): void; - /** - * Defines which strategy should be used for resolving naming conflicts, when two library - * assets are given the same name. By default, ConflictStrategy.APPEND_NUM_SUFFIX - * is used which means that a numeric suffix is appended to one of the assets. The - * conflictPrecedence property defines which of the two conflicting assets will - * be renamed. - * - * @see naming.ConflictStrategy - * @see AssetLibrary.conflictPrecedence - */ - public conflictStrategy : ConflictStrategyBase; - /** - * Defines which asset should have precedence when resolving a naming conflict between - * two assets of which one has just been renamed by the user or by a parser. By default - * ConflictPrecedence.FAVOR_NEW is used, meaning that the newly renamed - * asset will keep it's new name while the older asset gets renamed to not conflict. - * - * This property is ignored for conflict strategies that do not actually rename an - * asset automatically, such as ConflictStrategy.IGNORE and ConflictStrategy.THROW_ERROR. - * - * @see away.library.ConflictPrecedence - * @see away.library.ConflictStrategy - */ - public conflictPrecedence : string; - /** - * Create an AssetLibraryIterator instance that can be used to iterate over the assets - * in this asset library instance. The iterator can filter assets on asset type and/or - * namespace. A "null" filter value means no filter of that type is used. - * - * @param assetTypeFilter Asset type to filter on (from the AssetType enum class.) Use - * null to not filter on asset type. - * @param namespaceFilter Namespace to filter on. Use null to not filter on namespace. - * @param filterFunc Callback function to use when deciding whether an asset should be - * included in the iteration or not. This needs to be a function that takes a single - * parameter of type IAsset and returns a boolean where true means it should be included. - * - * @see away.library.AssetType - */ - public createIterator(assetTypeFilter?: string, namespaceFilter?: string, filterFunc?: any): AssetLibraryIterator; - /** - * Loads a file and (optionally) all of its dependencies. - * - * @param req The URLRequest object containing the URL of the file to be loaded. - * @param context An optional context object providing additional parameters for loading - * @param ns An optional namespace string under which the file is to be loaded, allowing the differentiation of two resources with identical assets - * @param parser An optional parser object for translating the loaded data into a usable resource. If not provided, AssetLoader will attempt to auto-detect the file type. - * @return A handle to the retrieved resource. - */ - public load(req: net.URLRequest, context?: AssetLoaderContext, ns?: string, parser?: parsers.ParserBase): AssetLoaderToken; - /** - * Loads a resource from existing data in memory. - * - * @param data The data object containing all resource information. - * @param context An optional context object providing additional parameters for loading - * @param ns An optional namespace string under which the file is to be loaded, allowing the differentiation of two resources with identical assets - * @param parser An optional parser object for translating the loaded data into a usable resource. If not provided, AssetLoader will attempt to auto-detect the file type. - * @return A handle to the retrieved resource. - */ - public loadData(data: any, context?: AssetLoaderContext, ns?: string, parser?: parsers.ParserBase): AssetLoaderToken; - /** - * - */ - public getAsset(name: string, ns?: string): IAsset; - /** - * Adds an asset to the asset library, first making sure that it's name is unique - * using the method defined by the conflictStrategy and - * conflictPrecedence properties. - */ - public addAsset(asset: IAsset): void; - /** - * Removes an asset from the library, and optionally disposes that asset by calling - * it's disposeAsset() method (which for most assets is implemented as a default - * version of that type's dispose() method. - * - * @param asset The asset which should be removed from this library. - * @param dispose Defines whether the assets should also be disposed. - */ - public removeAsset(asset: IAsset, dispose?: boolean): void; - /** - * Removes an asset which is specified using name and namespace. - * - * @param name The name of the asset to be removed. - * @param ns The namespace to which the desired asset belongs. - * @param dispose Defines whether the assets should also be disposed. - * - * @see away.library.AssetLibrary.removeAsset() - */ - public removeAssetByName(name: string, ns?: string, dispose?: boolean): IAsset; - /** - * Removes all assets from the asset library, optionally disposing them as they - * are removed. - * - * @param dispose Defines whether the assets should also be disposed. - */ - public removeAllAssets(dispose?: boolean): void; - /** - * Removes all assets belonging to a particular namespace (null for default) - * from the asset library, and optionall disposes them by calling their - * disposeAsset() method. - * - * @param ns The namespace from which all assets should be removed. - * @param dispose Defines whether the assets should also be disposed. - * - * @see away.library.AssetLibrary.removeAsset() - */ - public removeNamespaceAssets(ns?: string, dispose?: boolean): void; - private removeAssetFromDict(asset, autoRemoveEmptyNamespace?); - public stopAllLoadingSessions(): void; - private rehashAssetDict(); - /** - * Called when a an error occurs during loading. - */ - private onLoadError(event); - /** - * Called when a an error occurs during parsing. - */ - private onParseError(event); - private onAssetComplete(event); - private onTextureSizeError(event); - /** - * Called when the resource and all of its dependencies was retrieved. - */ - private onResourceComplete(event); - private loadingSessionGC(); - private killLoadingSession(loader); - private onAssetRename(ev); - private onAssetConflictResolved(ev); - } -} -declare class AssetLibraryBundleSingletonEnforcer { -} -declare module away.library { - /** - * AssetLibrary enforces a singleton pattern and is not intended to be instanced. - * It's purpose is to allow access to the default library bundle through a set of static shortcut methods. - * If you are interested in creating multiple library bundles, please use the getBundle() method. - */ - class AssetLibrary { - static _iInstances: Object; - constructor(se: AssetLibrarySingletonEnforcer); - /** - * Returns an AssetLibrary bundle instance. If no key is given, returns the default bundle (which is - * similar to using the AssetLibraryBundle as a singleton). To keep several separated library bundles, - * pass a string key to this method to define which bundle should be returned. This is - * referred to as using the AssetLibraryBundle as a multiton. - * - * @param key Defines which multiton instance should be returned. - * @return An instance of the asset library - */ - static getBundle(key?: string): AssetLibraryBundle; - /** - * - */ - static enableParser(parserClass: any): void; - /** - * - */ - static enableParsers(parserClasses: Object[]): void; - /** - * Short-hand for conflictStrategy property on default asset library bundle. - * - * @see AssetLibraryBundle.conflictStrategy - */ - static conflictStrategy : ConflictStrategyBase; - /** - * Short-hand for conflictPrecedence property on default asset library bundle. - * - * @see AssetLibraryBundle.conflictPrecedence - */ - static conflictPrecedence : string; - /** - * Short-hand for createIterator() method on default asset library bundle. - * - * @see AssetLibraryBundle.createIterator() - */ - static createIterator(assetTypeFilter?: string, namespaceFilter?: string, filterFunc?: any): AssetLibraryIterator; - /** - * Short-hand for load() method on default asset library bundle. - * - * @see AssetLibraryBundle.load() - */ - static load(req: net.URLRequest, context?: AssetLoaderContext, ns?: string, parser?: parsers.ParserBase): AssetLoaderToken; - /** - * Short-hand for loadData() method on default asset library bundle. - * - * @see AssetLibraryBundle.loadData() - */ - static loadData(data: any, context?: AssetLoaderContext, ns?: string, parser?: parsers.ParserBase): AssetLoaderToken; - static stopLoad(): void; - /** - * Short-hand for getAsset() method on default asset library bundle. - * - * @see AssetLibraryBundle.getAsset() - */ - static getAsset(name: string, ns?: string): IAsset; - /** - * Short-hand for addEventListener() method on default asset library bundle. - */ - static addEventListener(type: string, listener: Function): void; - /** - * Short-hand for removeEventListener() method on default asset library bundle. - */ - static removeEventListener(type: string, listener: Function): void; - /** - * Short-hand for hasEventListener() method on default asset library bundle. - - public static hasEventListener(type:string):boolean - { - return AssetLibrary.getBundle().hasEventListener(type); - } - - public static willTrigger(type:string):boolean - { - return getBundle().willTrigger(type); - } - */ - /** - * Short-hand for addAsset() method on default asset library bundle. - * - * @see AssetLibraryBundle.addAsset() - */ - static addAsset(asset: IAsset): void; - /** - * Short-hand for removeAsset() method on default asset library bundle. - * - * @param asset The asset which should be removed from the library. - * @param dispose Defines whether the assets should also be disposed. - * - * @see AssetLibraryBundle.removeAsset() - */ - static removeAsset(asset: IAsset, dispose?: boolean): void; - /** - * Short-hand for removeAssetByName() method on default asset library bundle. - * - * @param name The name of the asset to be removed. - * @param ns The namespace to which the desired asset belongs. - * @param dispose Defines whether the assets should also be disposed. - * - * @see AssetLibraryBundle.removeAssetByName() - */ - static removeAssetByName(name: string, ns?: string, dispose?: boolean): IAsset; - /** - * Short-hand for removeAllAssets() method on default asset library bundle. - * - * @param dispose Defines whether the assets should also be disposed. - * - * @see AssetLibraryBundle.removeAllAssets() - */ - static removeAllAssets(dispose?: boolean): void; - /** - * Short-hand for removeNamespaceAssets() method on default asset library bundle. - * - * @see AssetLibraryBundle.removeNamespaceAssets() - */ - static removeNamespaceAssets(ns?: string, dispose?: boolean): void; - } -} -declare class AssetLibrarySingletonEnforcer { -} -/** -* @module away.pool -*/ -declare module away.pool { - /** - * @class away.pool.EntityListItem - */ - class EntityListItem { - /** - * - */ - public entity: entities.IEntity; - /** - * - */ - public next: EntityListItem; - } -} -/** -* @module away.pool -*/ -declare module away.pool { - /** - * @class away.pool.EntityListItemPool - */ - class EntityListItemPool { - private _pool; - private _index; - private _poolSize; - /** - * - */ - constructor(); - /** - * - */ - public getItem(): EntityListItem; - /** - * - */ - public freeAll(): void; - public dispose(): void; - } -} -/** -* @module away.pool -*/ -declare module away.pool { - /** - * IRenderable is an interface for classes that are used in the rendering pipeline to render the - * contents of a partition - * - * @class away.render.IRenderable - */ - interface IRenderable { - /** - * - */ - next: IRenderable; - /** - * - */ - materialId: number; - /** - * - */ - materialOwner: base.IMaterialOwner; - /** - * - */ - sourceEntity: entities.IEntity; - /** - * - */ - renderOrderId: number; - /** - * - */ - zIndex: number; - /** - * - */ - dispose(): any; - /** - * - */ - invalidateGeometry(): any; - /** - * - */ - invalidateIndexData(): any; - /** - * - */ - invalidateVertexData(dataType: string): any; - } -} -/** -* @module away.pool -*/ -declare module away.pool { - /** - * IRenderableClass is an interface for the constructable class definition IRenderable that is used to - * create renderable objects in the rendering pipeline to render the contents of a partition - * - * @class away.render.IRenderableClass - */ - interface IRenderableClass { - /** - * - */ - id: string; - /** - * - */ - new(pool: RenderablePool, materialOwner: base.IMaterialOwner): IRenderable; - } -} -/** -* @module away.pool -*/ -declare module away.pool { - /** - * IMaterialData is an interface for classes that are used in the rendering pipeline to render the - * contents of a texture - * - * @class away.pool.IMaterialData - */ - interface IMaterialData { - /** - * - */ - dispose(): any; - /** - * - */ - invalidateMaterial(): any; - /** - * - */ - invalidateAnimation(): any; - } -} -/** -* @module away.pool -*/ -declare module away.pool { - /** - * IMaterialPassData is an interface for classes that are used in the rendering pipeline to render the - * contents of a material pass - * - * @class away.pool.IMaterialPassData - */ - interface IMaterialPassData { - /** - * - */ - materialPass: materials.IMaterialPass; - /** - * - */ - dispose(): any; - /** - * - */ - invalidate(): any; - } -} -/** -* @module away.pool -*/ -declare module away.pool { - /** - * ITextureData is an interface for classes that are used in the rendering pipeline to render the - * contents of a texture - * - * @class away.pool.ITextureData - */ - interface ITextureData { - /** - * - */ - dispose(): any; - /** - * - */ - invalidate(): any; - } -} -/** -* @module away.pool -*/ -declare module away.pool { - /** - * @class away.pool.RenderablePool - */ - class RenderablePool { - private static _pools; - private _pool; - private _renderableClass; - /** - * //TODO - * - * @param renderableClass - */ - constructor(renderableClass: IRenderableClass); - /** - * //TODO - * - * @param materialOwner - * @returns IRenderable - */ - public getItem(materialOwner: base.IMaterialOwner): IRenderable; - /** - * //TODO - * - * @param materialOwner - */ - public disposeItem(materialOwner: base.IMaterialOwner): void; - /** - * //TODO - * - * @param renderableClass - * @returns RenderablePool - */ - static getPool(renderableClass: IRenderableClass): RenderablePool; - /** - * //TODO - * - * @param renderableClass - */ - static disposePool(renderableClass: any): void; - } -} -/** -* @module away.data -*/ -declare module away.pool { - /** - * @class away.pool.RenderableListItem - */ - class CSSRenderableBase implements IRenderable { - /** - * - */ - private _pool; - /** - * - */ - public next: CSSRenderableBase; - /** - * - */ - public materialId: number; - /** - * - */ - public renderOrderId: number; - /** - * - */ - public zIndex: number; - /** - * - */ - public cascaded: boolean; - /** - * - */ - public renderSceneTransform: geom.Matrix3D; - /** - * - */ - public sourceEntity: entities.IEntity; - /** - * - */ - public materialOwner: base.IMaterialOwner; - /** - * - */ - public htmlElement: HTMLElement; - /** - * - * @param sourceEntity - * @param material - * @param animator - */ - constructor(pool: RenderablePool, sourceEntity: entities.IEntity, materialOwner: base.IMaterialOwner); - /** - * - */ - public dispose(): void; - /** - * - */ - public invalidateGeometry(): void; - /** - * - */ - public invalidateIndexData(): void; - /** - * - */ - public invalidateVertexData(dataType: string): void; - } -} -/** -* @module away.data -*/ -declare module away.pool { - /** - * @class away.pool.RenderableListItem - */ - class CSSBillboardRenderable extends CSSRenderableBase { - static id: string; - constructor(pool: RenderablePool, billboard: entities.Billboard); - } -} -/** -* @module away.data -*/ -declare module away.pool { - /** - * @class away.pool.RenderableListItem - */ - class CSSLineSegmentRenderable extends CSSRenderableBase { - static id: string; - constructor(pool: RenderablePool, lineSegment: entities.LineSegment); - } -} -/** -* @module away.data -*/ -declare module away.pool { - /** - * @class away.pool.CSSSkyboxRenderable - */ - class CSSSkyboxRenderable extends CSSRenderableBase { - static id: string; - constructor(pool: RenderablePool, skyBox: entities.Skybox); - } -} -/** -* @module away.traverse -*/ -declare module away.traverse { - /** - * @class away.traverse.ICollector - */ - interface ICollector { - /** - * - */ - camera: entities.Camera; - /** - * - */ - scene: containers.Scene; - /** - * - */ - numEntities: number; - /** - * - */ - numInteractiveEntities: number; - /** - * - */ - clear(): any; - /** - * - */ - entityHead: any; - /** - * - * @param node - */ - enterNode(node: partition.NodeBase): boolean; - /** - * - * @param entity - */ - applyDirectionalLight(entity: entities.IEntity): any; - /** - * - * @param entity - */ - applyEntity(entity: entities.IEntity): any; - /** - * - * @param entity - */ - applyLightProbe(entity: entities.IEntity): any; - /** - * - * @param entity - */ - applyPointLight(entity: entities.IEntity): any; - /** - * - * @param entity - */ - applySkybox(entity: entities.IEntity): any; - } -} -/** -* @module away.traverse -*/ -declare module away.traverse { - /** - * @class away.traverse.CollectorBase - */ - class CollectorBase implements ICollector { - public scene: containers.Scene; - public _pEntityHead: pool.EntityListItem; - public _pEntityListItemPool: pool.EntityListItemPool; - public _pCamera: entities.Camera; - private _customCullPlanes; - private _cullPlanes; - private _numCullPlanes; - public _pNumEntities: number; - public _pNumInteractiveEntities: number; - constructor(); - /** - * - */ - public camera : entities.Camera; - /** - * - */ - public cullPlanes : geom.Plane3D[]; - /** - * - */ - public entityHead : pool.EntityListItem; - /** - * - */ - public numEntities : number; - /** - * - */ - public numInteractiveEntities : number; - /** - * - */ - public clear(): void; - /** - * - * @param node - * @returns {boolean} - */ - public enterNode(node: partition.NodeBase): boolean; - /** - * - * @param entity - */ - public applyDirectionalLight(entity: entities.IEntity): void; - /** - * - * @param entity - */ - public applyEntity(entity: entities.IEntity): void; - /** - * - * @param entity - */ - public applyLightProbe(entity: entities.IEntity): void; - /** - * - * @param entity - */ - public applyPointLight(entity: entities.IEntity): void; - /** - * - * @param entity - */ - public applySkybox(entity: entities.IEntity): void; - } -} -/** -* @module away.traverse -*/ -declare module away.traverse { - /** - * @class away.traverse.EntityCollector - */ - class EntityCollector extends CollectorBase { - public _pSkybox: entities.Skybox; - public _pLights: base.LightBase[]; - private _directionalLights; - private _pointLights; - private _lightProbes; - public _pNumLights: number; - private _numDirectionalLights; - private _numPointLights; - private _numLightProbes; - /** - * - */ - public directionalLights : entities.DirectionalLight[]; - /** - * - */ - public lightProbes : entities.LightProbe[]; - /** - * - */ - public lights : base.LightBase[]; - /** - * - */ - public pointLights : entities.PointLight[]; - /** - * - */ - public skyBox : entities.Skybox; - constructor(); - /** - * - * @param entity - */ - public applyDirectionalLight(entity: entities.IEntity): void; - /** - * - * @param entity - */ - public applyLightProbe(entity: entities.IEntity): void; - /** - * - * @param entity - */ - public applyPointLight(entity: entities.IEntity): void; - /** - * - * @param entity - */ - public applySkybox(entity: entities.IEntity): void; - /** - * - */ - public clear(): void; - } -} -/** -* @module away.traverse -*/ -declare module away.traverse { - /** - * The RaycastCollector class is a traverser for scene partitions that collects all scene graph entities that are - * considered intersecting with the defined ray. - * - * @see away.partition.Partition - * @see away.entities.IEntity - * - * @class away.traverse.RaycastCollector - */ - class RaycastCollector extends CollectorBase { - private _rayPosition; - private _rayDirection; - public _iCollectionMark: number; - /** - * Provides the starting position of the ray. - */ - public rayPosition : geom.Vector3D; - /** - * Provides the direction vector of the ray. - */ - public rayDirection : geom.Vector3D; - /** - * Creates a new RaycastCollector object. - */ - constructor(); - /** - * Returns true if the current node is at least partly in the frustum. If so, the partition node knows to pass on the traverser to its children. - * - * @param node The Partition3DNode object to frustum-test. - */ - public enterNode(node: partition.NodeBase): boolean; - } -} -/** -* @module away.traverse -*/ -declare module away.traverse { - /** - * @class away.traverse.CSSEntityCollector - */ - class CSSEntityCollector extends CollectorBase implements ICollector { - constructor(); - } -} -/** -* @module away.traverse -*/ -declare module away.traverse { - /** - * @class away.traverse.ShadowCasterCollector - */ - class ShadowCasterCollector extends CollectorBase { - constructor(); - /** - * - */ - public enterNode(node: partition.NodeBase): boolean; - } -} -/** -* @module away.partition -*/ -declare module away.partition { - /** - * @class away.partition.NodeBase - */ - class NodeBase { - private _boundsChildrenVisible; - private _explicitBoundsVisible; - private _implicitBoundsVisible; - public _iParent: NodeBase; - public _pChildNodes: NodeBase[]; - public _pNumChildNodes: number; - public _pBoundsPrimitive: entities.IEntity; - public _iNumEntities: number; - public _iCollectionMark: number; - /** - * - */ - public boundsVisible : boolean; - public boundsChildrenVisible : boolean; - /** - * - */ - public parent : NodeBase; - /** - * - * @protected - */ - public _pNumEntities : number; - /** - * - */ - constructor(); - /** - * - * @param planes - * @param numPlanes - * @returns {boolean} - * @internal - */ - public isInFrustum(planes: geom.Plane3D[], numPlanes: number): boolean; - /** - * - * @param rayPosition - * @param rayDirection - * @returns {boolean} - */ - public isIntersectingRay(rayPosition: geom.Vector3D, rayDirection: geom.Vector3D): boolean; - /** - * - * @returns {boolean} - */ - public isCastingShadow(): boolean; - /** - * - * @param entity - * @returns {away.partition.NodeBase} - */ - public findPartitionForEntity(entity: entities.IEntity): NodeBase; - /** - * - * @param traverser - */ - public acceptTraverser(traverser: traverse.ICollector): void; - /** - * - * @protected - */ - public _pCreateBoundsPrimitive(): entities.IEntity; - /** - * - * @param node - * @internal - */ - public iAddNode(node: NodeBase): void; - /** - * - * @param node - * @internal - */ - public iRemoveNode(node: NodeBase): void; - private _iUpdateImplicitBoundsVisible(value); - /** - * @internal - */ - public _iIsBoundsVisible(): boolean; - public _iUpdateEntityBounds(): void; - } -} -/** -* @module away.partition -*/ -declare module away.partition { - /** - * @class away.partition.NullNode - */ - class NullNode { - constructor(); - } -} -/** -* @module away.partition -*/ -declare module away.partition { - /** - * @class away.partition.Partition - */ - class Partition { - public _rootNode: NodeBase; - private _updatesMade; - private _updateQueue; - constructor(rootNode: NodeBase); - public rootNode : NodeBase; - public traverse(traverser: traverse.ICollector): void; - public iMarkForUpdate(entity: base.DisplayObject): void; - public iRemoveEntity(entity: base.DisplayObject): void; - private updateEntities(); - } -} -/** -* @module away.partition -*/ -declare module away.partition { - /** - * @class away.partition.EntityNode - */ - class EntityNode extends NodeBase { - private _entity; - public _iUpdateQueueNext: EntityNode; - constructor(entity: entities.IEntity); - public entity : entities.IEntity; - public removeFromParent(): void; - /** - * - * @returns {boolean} - */ - public isCastingShadow(): boolean; - /** - * - * @param planes - * @param numPlanes - * @returns {boolean} - */ - public isInFrustum(planes: geom.Plane3D[], numPlanes: number): boolean; - /** - * @inheritDoc - */ - public acceptTraverser(traverser: traverse.ICollector): void; - /** - * @inheritDoc - */ - public isIntersectingRay(rayPosition: geom.Vector3D, rayDirection: geom.Vector3D): boolean; - /** - * - * @protected - */ - public _pCreateBoundsPrimitive(): entities.IEntity; - } -} -/** -* @module away.partition -*/ -declare module away.partition { - /** - * @class away.partition.CameraNode - */ - class CameraNode extends EntityNode { - constructor(camera: entities.IEntity); - /** - * @inheritDoc - */ - public acceptTraverser(traverser: traverse.ICollector): void; - } -} -/** -* @module away.partition -*/ -declare module away.partition { - /** - * @class away.partition.DirectionalLightNode - */ - class DirectionalLightNode extends EntityNode { - private _directionalLight; - /** - * - * @param directionalLight - */ - constructor(directionalLight: entities.IEntity); - /** - * @inheritDoc - */ - public acceptTraverser(traverser: traverse.ICollector): void; - /** - * - * @returns {boolean} - */ - public isCastingShadow(): boolean; - } -} -/** -* @module away.partition -*/ -declare module away.partition { - /** - * @class away.partition.LightProbeNode - */ - class LightProbeNode extends EntityNode { - private _lightProbe; - /** - * - * @param lightProbe - */ - constructor(lightProbe: entities.IEntity); - /** - * @inheritDoc - */ - public acceptTraverser(traverser: traverse.ICollector): void; - /** - * - * @returns {boolean} - */ - public isCastingShadow(): boolean; - } -} -/** -* @module away.partition -*/ -declare module away.partition { - /** - * @class away.partition.PointLightNode - */ - class PointLightNode extends EntityNode { - private _pointLight; - /** - * - * @param pointLight - */ - constructor(pointLight: entities.IEntity); - /** - * @inheritDoc - */ - public acceptTraverser(traverser: traverse.ICollector): void; - /** - * - * @returns {boolean} - */ - public isCastingShadow(): boolean; - } -} -/** -* @module away.partition -*/ -declare module away.partition { - /** - * SkyboxNode is a space partitioning leaf node that contains a Skybox object. - * - * @class away.partition.SkyboxNode - */ - class SkyboxNode extends EntityNode { - private _skyBox; - /** - * Creates a new SkyboxNode object. - * @param skyBox The Skybox to be contained in the node. - */ - constructor(skyBox: entities.IEntity); - /** - * @inheritDoc - */ - public acceptTraverser(traverser: traverse.ICollector): void; - /** - * - * @param planes - * @param numPlanes - * @returns {boolean} - */ - public isInFrustum(planes: geom.Plane3D[], numPlanes: number): boolean; - } -} -/** -* @module away.pick -*/ -declare module away.pick { - /** - * Provides an interface for picking colliders that can be assigned to individual entities in a scene for specific picking behaviour. - * Used with the RaycastPicker picking object. - * - * @see away.entities.Entity#pickingCollider - * @see away.pick.RaycastPicker - * - * @interface away.pick.IPickingCollider - */ - interface IPickingCollider { - /** - * Sets the position and direction of a picking ray in local coordinates to the entity. - * - * @param localDirection The position vector in local coordinates - * @param localPosition The direction vector in local coordinates - */ - setLocalRay(localPosition: geom.Vector3D, localDirection: geom.Vector3D): any; - /** - * Tests a Billboard object for a collision with the picking ray. - * - * @param entity The entity instance to be tested. - * @param pickingCollisionVO The collision object used to store the collision results - * @param shortestCollisionDistance The current value of the shortest distance to a detected collision along the ray. - */ - testBillboardCollision(entity: entities.IEntity, pickingCollisionVO: PickingCollisionVO, shortestCollisionDistance: number): boolean; - /** - * Tests a Mesh object for a collision with the picking ray. - * - * @param entity The entity instance to be tested. - * @param pickingCollisionVO The collision object used to store the collision results - * @param shortestCollisionDistance The current value of the shortest distance to a detected collision along the ray. - * @param findClosest - */ - testMeshCollision(entity: entities.IEntity, pickingCollisionVO: PickingCollisionVO, shortestCollisionDistance: number, findClosest: boolean): boolean; - } -} -/** -* @module away.pick -*/ -declare module away.pick { - /** - * Provides an interface for picking objects that can pick 3d objects from a view or scene. - * - * @interface away.pick.IPicker - */ - interface IPicker { - /** - * Gets the collision object from the screen coordinates of the picking ray. - * - * @param x The x coordinate of the picking ray in screen-space. - * @param y The y coordinate of the picking ray in screen-space. - * @param view The view on which the picking object acts. - */ - getViewCollision(x: number, y: number, view: containers.View): PickingCollisionVO; - /** - * Gets the collision object from the scene position and direction of the picking ray. - * - * @param position The position of the picking ray in scene-space. - * @param direction The direction of the picking ray in scene-space. - * @param scene The scene on which the picking object acts. - */ - getSceneCollision(position: geom.Vector3D, direction: geom.Vector3D, scene: containers.Scene): PickingCollisionVO; - /** - * Determines whether the picker takes account of the mouseEnabled properties of entities. Defaults to true. - */ - onlyMouseEnabled: boolean; - /** - * Disposes memory used by the IPicker object - */ - dispose(): any; - } -} -/** -* @module away.pick -*/ -declare module away.pick { - /** - * Value object for a picking collision returned by a picking collider. Created as unique objects on display objects - * - * @see away.base.DisplayObject#pickingCollisionVO - * @see away.core.pick.IPickingCollider - * - * @class away.pick.PickingCollisionVO - */ - class PickingCollisionVO { - /** - * The display object to which this collision object belongs. - */ - public displayObject: base.DisplayObject; - /** - * The local position of the collision on the entity's surface. - */ - public localPosition: geom.Vector3D; - /** - * The local normal vector at the position of the collision. - */ - public localNormal: geom.Vector3D; - /** - * The uv coordinate at the position of the collision. - */ - public uv: geom.Point; - /** - * The index of the face where the event took pl ace. - */ - public index: number; - /** - * The starting position of the colliding ray in local coordinates. - */ - public localRayPosition: geom.Vector3D; - /** - * The direction of the colliding ray in local coordinates. - */ - public localRayDirection: geom.Vector3D; - /** - * The starting position of the colliding ray in scene coordinates. - */ - public rayPosition: geom.Vector3D; - /** - * The direction of the colliding ray in scene coordinates. - */ - public rayDirection: geom.Vector3D; - /** - * Determines if the ray position is contained within the entity bounds. - * - * @see away3d.entities.Entity#bounds - */ - public rayOriginIsInsideBounds: boolean; - /** - * The distance along the ray from the starting position to the calculated intersection entry point with the entity. - */ - public rayEntryDistance: number; - /** - * The material ownwer associated with a collision. - */ - public materialOwner: base.IMaterialOwner; - /** - * Creates a new PickingCollisionVO object. - * - * @param entity The entity to which this collision object belongs. - */ - constructor(displayObject: base.DisplayObject); - } -} -/** -* @module away.pick -*/ -declare module away.pick { - /** - * Picks a 3d object from a view or scene by 3D raycast calculations. - * Performs an initial coarse boundary calculation to return a subset of entities whose bounding volumes intersect with the specified ray, - * then triggers an optional picking collider on individual entity objects to further determine the precise values of the picking ray collision. - * - * @class away.pick.RaycastPicker - */ - class RaycastPicker implements IPicker { - private _findClosestCollision; - private _raycastCollector; - private _ignoredEntities; - private _onlyMouseEnabled; - private _entities; - private _numEntities; - private _hasCollisions; - /** - * @inheritDoc - */ - public onlyMouseEnabled : boolean; - /** - * Creates a new RaycastPicker object. - * - * @param findClosestCollision Determines whether the picker searches for the closest bounds collision along the ray, - * or simply returns the first collision encountered. Defaults to false. - */ - constructor(findClosestCollision?: boolean); - /** - * @inheritDoc - */ - public getViewCollision(x: number, y: number, view: containers.View): PickingCollisionVO; - /** - * @inheritDoc - */ - public getSceneCollision(rayPosition: geom.Vector3D, rayDirection: geom.Vector3D, scene: containers.Scene): PickingCollisionVO; - public setIgnoreList(entities: any): void; - private isIgnored(entity); - private sortOnNearT(entity1, entity2); - private getPickingCollisionVO(collector); - private updateLocalPosition(pickingCollisionVO); - public dispose(): void; - } -} -/** -* @module away.render -*/ -declare module away.render { - /** - * IRenderer is an interface for classes that are used in the rendering pipeline to render the - * contents of a partition - * - * @class away.render.IRenderer - */ - interface IRenderer extends events.IEventDispatcher { - /** - * - */ - renderableSorter: sort.IEntitySorter; - /** - * - */ - shareContext: boolean; - /** - * - */ - x: number; - /** - * - */ - y: number; - /** - * - */ - width: number; - /** - * - */ - height: number; - /** - * - */ - viewPort: geom.Rectangle; - /** - * - */ - scissorRect: geom.Rectangle; - /** - * - * @param billboard - */ - applyBillboard(billboard: entities.Billboard): any; - /** - * - * @param triangleSubMesh - */ - applyLineSubMesh(triangleSubMesh: base.LineSubMesh): any; - /** - * - * @param triangleSubMesh - */ - applyTriangleSubMesh(triangleSubMesh: base.TriangleSubMesh): any; - /** - * - */ - dispose(): any; - /** - * - * @param entityCollector - */ - render(entityCollector: traverse.ICollector): any; - /** - * @internal - */ - _iBackgroundR: number; - /** - * @internal - */ - _iBackgroundG: number; - /** - * @internal - */ - _iBackgroundB: number; - /** - * @internal - */ - _iBackgroundAlpha: number; - /** - * @internal - */ - _iCreateEntityCollector(): traverse.ICollector; - _iRender(entityCollector: traverse.ICollector, target?: textures.TextureProxyBase, scissorRect?: geom.Rectangle, surfaceSelector?: number): any; - _iRenderCascades(entityCollector: traverse.ICollector, target: textures.TextureProxyBase, numCascades: number, scissorRects: geom.Rectangle[], cameras: entities.Camera[]): any; - } -} -/** -* @module away.render -*/ -declare module away.render { - /** - * RendererBase forms an abstract base class for classes that are used in the rendering pipeline to render the - * contents of a partition - * - * @class away.render.RendererBase - */ - class CSSRendererBase extends events.EventDispatcher { - private _billboardRenderablePool; - private _lineSegmentRenderablePool; - public _pCamera: entities.Camera; - public _iEntryPoint: geom.Vector3D; - public _pCameraForward: geom.Vector3D; - private _backgroundR; - private _backgroundG; - private _backgroundB; - private _backgroundAlpha; - private _shareContext; - public _pBackBufferInvalid: boolean; - public _depthTextureInvalid: boolean; - public _renderableHead: pool.CSSRenderableBase; - public _width: number; - public _height: number; - private _viewPort; - private _viewportDirty; - private _scissorRect; - private _scissorDirty; - private _localPos; - private _globalPos; - private _scissorUpdated; - private _viewPortUpdated; - /** - * A viewPort rectangle equivalent of the StageGL size and position. - */ - public viewPort : geom.Rectangle; - /** - * A scissor rectangle equivalent of the view size and position. - */ - public scissorRect : geom.Rectangle; - /** - * - */ - public x : number; - /** - * - */ - public y : number; - /** - * - */ - public width : number; - /** - * - */ - public height : number; - /** - * - */ - public renderableSorter: sort.IEntitySorter; - /** - * Creates a new RendererBase object. - */ - constructor(renderToTexture?: boolean, forceSoftware?: boolean, profile?: string); - /** - * The background color's red component, used when clearing. - * - * @private - */ - public _iBackgroundR : number; - /** - * The background color's green component, used when clearing. - * - * @private - */ - public _iBackgroundG : number; - /** - * The background color's blue component, used when clearing. - * - * @private - */ - public _iBackgroundB : number; - public shareContext : boolean; - /** - * Disposes the resources used by the RendererBase. - */ - public dispose(): void; - public render(entityCollector: traverse.ICollector): void; - /** - * Renders the potentially visible geometry to the back buffer or texture. - * @param entityCollector The EntityCollector object containing the potentially visible geometry. - * @param scissorRect - */ - public _iRender(entityCollector: traverse.EntityCollector, target?: textures.TextureProxyBase, scissorRect?: geom.Rectangle, surfaceSelector?: number): void; - public _iRenderCascades(entityCollector: traverse.ICollector, target: textures.TextureProxyBase, numCascades: number, scissorRects: geom.Rectangle[], cameras: entities.Camera[]): void; - public pCollectRenderables(entityCollector: traverse.ICollector): void; - /** - * Renders the potentially visible geometry to the back buffer or texture. Only executed if everything is set up. - * @param entityCollector The EntityCollector object containing the potentially visible geometry. - * @param scissorRect - */ - public pExecuteRender(entityCollector: traverse.CSSEntityCollector, scissorRect?: geom.Rectangle): void; - /** - * Performs the actual drawing of dom objects to the target. - * - * @param entityCollector The EntityCollector object containing the potentially visible dom objects. - */ - public pDraw(entityCollector: traverse.CSSEntityCollector): void; - public _iBackgroundAlpha : number; - /** - * - * @param billboard - */ - public applyBillboard(billboard: entities.Billboard): void; - /** - * - * @param lineSubMesh - */ - public applyLineSubMesh(lineSubMesh: base.LineSubMesh): void; - /** - * - * @param skybox - */ - public applySkybox(skybox: entities.Skybox): void; - /** - * - * @param triangleSubMesh - */ - public applyTriangleSubMesh(triangleSubMesh: base.TriangleSubMesh): void; - /** - * - * @param renderable - * @private - */ - private _applyRenderable(renderable); - /** - * @private - */ - private notifyScissorUpdate(); - /** - * @private - */ - private notifyViewportUpdate(); - /** - * - */ - public updateGlobalPos(): void; - public _iCreateEntityCollector(): traverse.ICollector; - } -} -/** -* @module away.render -*/ -declare module away.render { - /** - * The DefaultRenderer class provides the default rendering method. It renders the scene graph objects using the - * materials assigned to them. - * - * @class away.render.DefaultRenderer - */ - class CSSDefaultRenderer extends CSSRendererBase implements IRenderer { - private _container; - private _context; - private _contextStyle; - private _contextMatrix; - private _activeMaterial; - private _skyboxProjection; - private _transform; - /** - * Creates a new CSSDefaultRenderer object. - */ - constructor(); - /** - * - * @param entityCollector - */ - public render(entityCollector: traverse.ICollector): void; - /** - * @inheritDoc - */ - public pDraw(entityCollector: traverse.EntityCollector): void; - /** - * Updates the backbuffer properties. - */ - public pUpdateBackBuffer(): void; - /** - * Draw the skybox if present. - * @param entityCollector The EntityCollector containing all potentially visible information. - */ - private drawSkybox(entityCollector); - /** - * Draw a list of renderables. - * @param renderables The renderables to draw. - * @param entityCollector The EntityCollector containing all potentially visible information. - */ - private drawRenderables(item, entityCollector); - public dispose(): void; - public _iCreateEntityCollector(): traverse.ICollector; - } -} -/** -* @module away.sort -*/ -declare module away.sort { - /** - * @interface away.sort.IEntitySorter - */ - interface IEntitySorter { - sortBlendedRenderables(head: pool.IRenderable): pool.IRenderable; - sortOpaqueRenderables(head: pool.IRenderable): pool.IRenderable; - } -} -/** -* @module away.sort -*/ -declare module away.sort { - /** - * @class away.sort.RenderableMergeSort - */ - class RenderableMergeSort implements IEntitySorter { - public sortBlendedRenderables(head: pool.IRenderable): pool.IRenderable; - public sortOpaqueRenderables(head: pool.IRenderable): pool.IRenderable; - } -} -/** -* The AntiAliasType class provides values for anti-aliasing in the -* away.text.TextField class. -*/ -declare module away.text { - class AntiAliasType { - /** - * Sets anti-aliasing to advanced anti-aliasing. Advanced anti-aliasing - * allows font faces to be rendered at very high quality at small sizes. It - * is best used with applications that have a lot of small text. Advanced - * anti-aliasing is not recommended for very large fonts(larger than 48 - * points). This constant is used for the antiAliasType property - * in the TextField class. Use the syntax - * AntiAliasType.ADVANCED. - */ - static ADVANCED: string; - /** - * Sets anti-aliasing to the anti-aliasing that is used in Flash Player 7 and - * earlier. This setting is recommended for applications that do not have a - * lot of text. This constant is used for the antiAliasType - * property in the TextField class. Use the syntax - * AntiAliasType.NORMAL. - */ - static NORMAL: string; - } -} -/** -* The GridFitType class defines values for grid fitting in the TextField class. -*/ -declare module away.text { - class GridFitType { - /** - * Doesn't set grid fitting. Horizontal and vertical lines in the glyphs are - * not forced to the pixel grid. This constant is used in setting the - * gridFitType property of the TextField class. This is often a - * good setting for animation or for large font sizes. Use the syntax - * GridFitType.NONE. - */ - static NONE: string; - /** - * Fits strong horizontal and vertical lines to the pixel grid. This constant - * is used in setting the gridFitType property of the TextField - * class. This setting only works for left-justified text fields and acts - * like the GridFitType.SUBPIXEL constant in static text. This - * setting generally provides the best readability for left-aligned text. Use - * the syntax GridFitType.PIXEL. - */ - static PIXEL: string; - /** - * Fits strong horizontal and vertical lines to the sub-pixel grid on LCD - * monitors. (Red, green, and blue are actual pixels on an LCD screen.) This - * is often a good setting for right-aligned or center-aligned dynamic text, - * and it is sometimes a useful tradeoff for animation vs. text quality. This - * constant is used in setting the gridFitType property of the - * TextField class. Use the syntax GridFitType.SUBPIXEL. - */ - static SUBPIXEL: string; - } -} -/** -* The TextFieldAutoSize class is an enumeration of constant values used in -* setting the autoSize property of the TextField class. -*/ -declare module away.text { - class TextFieldAutoSize { - /** - * Specifies that the text is to be treated as center-justified text. Any - * resizing of a single line of a text field is equally distributed to both - * the right and left sides. - */ - static CENTER: string; - /** - * Specifies that the text is to be treated as left-justified text, meaning - * that the left side of the text field remains fixed and any resizing of a - * single line is on the right side. - */ - static LEFT: string; - /** - * Specifies that no resizing is to occur. - */ - static NONE: string; - /** - * Specifies that the text is to be treated as right-justified text, meaning - * that the right side of the text field remains fixed and any resizing of a - * single line is on the left side. - */ - static RIGHT: string; - } -} -/** -* The TextFieldType class is an enumeration of constant values used in setting the -* type property of the TextField class. -* -* @see away.entities.TextField#type -*/ -declare module away.text { - class TextFieldType { - /** - * Used to specify a dynamic TextField. - */ - static DYNAMIC: string; - /** - * Used to specify an input TextField. - */ - static INPUT: string; - } -} -/** -* The TextFormat class represents character formatting information. Use the -* TextFormat class to create specific text formatting for text fields. You -* can apply text formatting to both static and dynamic text fields. The -* properties of the TextFormat class apply to device and embedded fonts. -* However, for embedded fonts, bold and italic text actually require specific -* fonts. If you want to display bold or italic text with an embedded font, -* you need to embed the bold and italic variations of that font. -* -*

You must use the constructor new TextFormat() to create a -* TextFormat object before setting its properties. When you apply a -* TextFormat object to a text field using the -* TextField.defaultTextFormat property or the -* TextField.setTextFormat() method, only its defined properties -* are applied. Use the TextField.defaultTextFormat property to -* apply formatting BEFORE you add text to the TextField, and the -* setTextFormat() method to add formatting AFTER you add text to -* the TextField. The TextFormat properties are null -* by default because if you don't provide values for the properties, Flash -* Player uses its own default formatting. The default formatting that Flash -* Player uses for each property(if property's value is null) is -* as follows:

-* -*

The default formatting for each property is also described in each -* property description.

-*/ -declare module away.text { - class TextFormat { - /** - * Indicates the alignment of the paragraph. Valid values are TextFormatAlign - * constants. - * - * @default TextFormatAlign.LEFT - * @throws ArgumentError The align specified is not a member of - * flash.text.TextFormatAlign. - */ - public align: string; - /** - * Indicates the block indentation in pixels. Block indentation is applied to - * an entire block of text; that is, to all lines of the text. In contrast, - * normal indentation(TextFormat.indent) affects only the first - * line of each paragraph. If this property is null, the - * TextFormat object does not specify block indentation(block indentation is - * 0). - */ - public blockIndent: number; - /** - * Specifies whether the text is boldface. The default value is - * null, which means no boldface is used. If the value is - * true, then the text is boldface. - */ - public bold: boolean; - /** - * Indicates that the text is part of a bulleted list. In a bulleted list, - * each paragraph of text is indented. To the left of the first line of each - * paragraph, a bullet symbol is displayed. The default value is - * null, which means no bulleted list is used. - */ - public bullet: boolean; - /** - * Indicates the color of the text. A number containing three 8-bit RGB - * components; for example, 0xFF0000 is red, and 0x00FF00 is green. The - * default value is null, which means that Flash Player uses the - * color black(0x000000). - */ - public color: boolean; - /** - * The name of the font for text in this text format, as a string. The - * default value is null, which means that Flash Player uses - * Times New Roman font for the text. - */ - public font: string; - /** - * Indicates the indentation from the left margin to the first character in - * the paragraph. The default value is null, which indicates - * that no indentation is used. - */ - public indent: number; - /** - * Indicates whether text in this text format is italicized. The default - * value is null, which means no italics are used. - */ - public italic: boolean; - /** - * A Boolean value that indicates whether kerning is enabled - * (true) or disabled(false). Kerning adjusts the - * pixels between certain character pairs to improve readability, and should - * be used only when necessary, such as with headings in large fonts. Kerning - * is supported for embedded fonts only. - * - *

Certain fonts such as Verdana and monospaced fonts, such as Courier - * New, do not support kerning.

- * - *

The default value is null, which means that kerning is not - * enabled.

- */ - public kerning: boolean; - /** - * An integer representing the amount of vertical space(called - * leading) between lines. The default value is null, - * which indicates that the amount of leading used is 0. - */ - public leading: number; - /** - * The left margin of the paragraph, in pixels. The default value is - * null, which indicates that the left margin is 0 pixels. - */ - public leftMargin: number; - /** - * A number representing the amount of space that is uniformly distributed - * between all characters. The value specifies the number of pixels that are - * added to the advance after each character. The default value is - * null, which means that 0 pixels of letter spacing is used. - * You can use decimal values such as 1.75. - */ - public letterSpacing: number; - /** - * The right margin of the paragraph, in pixels. The default value is - * null, which indicates that the right margin is 0 pixels. - */ - public rightMargin: number; - /** - * The size in pixels of text in this text format. The default value is - * null, which means that a size of 12 is used. - */ - public size: number; - /** - * Specifies custom tab stops as an array of non-negative integers. Each tab - * stop is specified in pixels. If custom tab stops are not specified - * (null), the default tab stop is 4(average character width). - */ - public tabStops: number[]; - /** - * Indicates the target window where the hyperlink is displayed. If the - * target window is an empty string, the text is displayed in the default - * target window _self. You can choose a custom name or one of - * the following four names: _self specifies the current frame - * in the current window, _blank specifies a new window, - * _parent specifies the parent of the current frame, and - * _top specifies the top-level frame in the current window. If - * the TextFormat.url property is an empty string or - * null, you can get or set this property, but the property will - * have no effect. - */ - public target: string; - /** - * Indicates whether the text that uses this text format is underlined - * (true) or not(false). This underlining is - * similar to that produced by the tag, but the latter is - * not true underlining, because it does not skip descenders correctly. The - * default value is null, which indicates that underlining is - * not used. - */ - public underline: boolean; - /** - * Indicates the target URL for the text in this text format. If the - * url property is an empty string, the text does not have a - * hyperlink. The default value is null, which indicates that - * the text does not have a hyperlink. - * - *

Note: The text with the assigned text format must be set with - * the htmlText property for the hyperlink to work.

- */ - public url: string; - /** - * Creates a TextFormat object with the specified properties. You can then - * change the properties of the TextFormat object to change the formatting of - * text fields. - * - *

Any parameter may be set to null to indicate that it is - * not defined. All of the parameters are optional; any omitted parameters - * are treated as null.

- * - * @param font The name of a font for text as a string. - * @param size An integer that indicates the size in pixels. - * @param color The color of text using this text format. A number - * containing three 8-bit RGB components; for example, - * 0xFF0000 is red, and 0x00FF00 is green. - * @param bold A Boolean value that indicates whether the text is - * boldface. - * @param italic A Boolean value that indicates whether the text is - * italicized. - * @param underline A Boolean value that indicates whether the text is - * underlined. - * @param url The URL to which the text in this text format - * hyperlinks. If url is an empty string, the - * text does not have a hyperlink. - * @param target The target window where the hyperlink is displayed. If - * the target window is an empty string, the text is - * displayed in the default target window - * _self. If the url parameter - * is set to an empty string or to the value - * null, you can get or set this property, - * but the property will have no effect. - * @param align The alignment of the paragraph, as a TextFormatAlign - * value. - * @param leftMargin Indicates the left margin of the paragraph, in pixels. - * @param rightMargin Indicates the right margin of the paragraph, in pixels. - * @param indent An integer that indicates the indentation from the left - * margin to the first character in the paragraph. - * @param leading A number that indicates the amount of leading vertical - * space between lines. - */ - constructor(font?: string, size?: number, color?: number, bold?: boolean, italic?: boolean, underline?: boolean, url?: string, target?: string, align?: string, leftMargin?: number, rightMargin?: number, indent?: number, leading?: number); - } -} -/** -* The TextFormatAlign class provides values for text alignment in the -* TextFormat class. -*/ -declare module away.text { - class TextFormatAlign { - /** - * Constant; centers the text in the text field. Use the syntax - * TextFormatAlign.CENTER. - */ - public CENTER: string; - /** - * Constant; justifies text within the text field. Use the syntax - * TextFormatAlign.JUSTIFY. - */ - public JUSTIFY: string; - /** - * Constant; aligns text to the left within the text field. Use the syntax - * TextFormatAlign.LEFT. - */ - public LEFT: string; - /** - * Constant; aligns text to the right within the text field. Use the syntax - * TextFormatAlign.RIGHT. - */ - public RIGHT: string; - } -} -/** -* A class that defines the Interactive mode of a text field object. -* -* @see away.entities.TextField#textInteractionMode -*/ -declare module away.text { - class TextInteractionMode { - /** - * The text field's default interaction mode is NORMAL and it varies across - * platform. On Desktop, the normal mode implies that the text field is in - * scrollable + selection mode. On Mobile platforms like Android, normal mode - * implies that the text field can only be scrolled but the text can not be - * selected. - */ - static NORMAL: string; - /** - * On mobile platforms like Android, the text field starts in normal mode - * (which implies scroll and non-selectable mode). The user can switch to - * selection mode through the in-built context menu of the text field object. - */ - static SELECTION: string; - } -} -/** -* The TextLineMetrics class contains information about the text position and -* measurements of a line of text within a text field. All measurements are in -* pixels. Objects of this class are returned by the -* away.entities.TextField.getLineMetrics() method. -*/ -declare module away.text { - class TextLineMetrics { - /** - * The ascent value of the text is the length from the baseline to the top of - * the line height in pixels. - */ - public ascent: number; - /** - * The descent value of the text is the length from the baseline to the - * bottom depth of the line in pixels. - */ - public descent: number; - /** - * The height value of the text of the selected lines (not necessarily the - * complete text) in pixels. The height of the text line does not include the - * gutter height. - */ - public height: number; - /** - * The leading value is the measurement of the vertical distance between the - * lines of text. - */ - public leading: number; - /** - * The width value is the width of the text of the selected lines (not - * necessarily the complete text) in pixels. The width of the text line is - * not the same as the width of the text field. The width of the text line is - * relative to the text field width, minus the gutter width of 4 pixels - * (2 pixels on each side). - */ - public width: number; - /** - * The x value is the left position of the first character in pixels. This - * value includes the margin, indent (if any), and gutter widths. - */ - public x: number; - /** - * Creates a TextLineMetrics object. The TextLineMetrics object contains - * information about the text metrics of a line of text in a text field. - * Objects of this class are returned by the - * away.entities.TextField.getLineMetrics() method. - * - * @param x The left position of the first character in pixels. - * @param width The width of the text of the selected lines (not - * necessarily the complete text) in pixels. - * @param height The height of the text of the selected lines (not - * necessarily the complete text) in pixels. - * @param ascent The length from the baseline to the top of the line - * height in pixels. - * @param descent The length from the baseline to the bottom depth of - * the line in pixels. - * @param leading The measurement of the vertical distance between the - * lines of text. - */ - constructor(x?: number, width?: number, height?: number, ascent?: number, descent?: number, leading?: number); - } -} -declare module away.ui { - class Keyboard { - /** - * Constant associated with the key code value for the A key (65). - */ - static A: number; - /** - * Constant associated with the key code value for the Alternate (Option) key (18). - */ - static ALTERNATE: number; - /** - * Select the audio mode - */ - static AUDIO: number; - /** - * Constant associated with the key code value for the B key (66). - */ - static B: number; - /** - * Return to previous page in application - */ - static BACK: number; - /** - * Constant associated with the key code value for the ` key (192). - */ - static BACKQUOTE: number; - /** - * Constant associated with the key code value for the \ key (220). - */ - static BACKSLASH: number; - /** - * Constant associated with the key code value for the Backspace key (8). - */ - static BACKSPACE: number; - /** - * Blue function key button - */ - static BLUE: number; - /** - * Constant associated with the key code value for the C key (67). - */ - static C: number; - /** - * Constant associated with the key code value for the Caps Lock key (20). - */ - static CAPS_LOCK: number; - /** - * Channel down - */ - static CHANNEL_DOWN: number; - /** - * Channel up - */ - static CHANNEL_UP: number; - /** - * Constant associated with the key code value for the , key (188). - */ - static COMMA: number; - /** - * Constant associated with the Mac command key (15). This constant is - * currently only used for setting menu key equivalents. - */ - static COMMAND: number; - /** - * Constant associated with the key code value for the Control key (17). - */ - static CONTROL: number; - /** - * An array containing all the defined key name constants. - */ - static CharCodeStrings: any[]; - /** - * Constant associated with the key code value for the D key (68). - */ - static D: number; - /** - * Constant associated with the key code value for the Delete key (46). - */ - static DELETE: number; - /** - * Constant associated with the key code value for the Down Arrow key (40). - */ - static DOWN: number; - /** - * Engage DVR application mode - */ - static DVR: number; - /** - * Constant associated with the key code value for the E key (69). - */ - static E: number; - /** - * Constant associated with the key code value for the End key (35). - */ - static END: number; - /** - * Constant associated with the key code value for the Enter key (13). - */ - static ENTER: number; - /** - * Constant associated with the key code value for the = key (187). - */ - static EQUAL: number; - /** - * Constant associated with the key code value for the Escape key (27). - */ - static ESCAPE: number; - /** - * Exits current application mode - */ - static EXIT: number; - /** - * Constant associated with the key code value for the F key (70). - */ - static F: number; - /** - * Constant associated with the key code value for the F1 key (112). - */ - static F1: number; - /** - * Constant associated with the key code value for the F10 key (121). - */ - static F10: number; - /** - * Constant associated with the key code value for the F11 key (122). - */ - static F11: number; - /** - * Constant associated with the key code value for the F12 key (123). - */ - static F12: number; - /** - * Constant associated with the key code value for the F13 key (124). - */ - static F13: number; - /** - * Constant associated with the key code value for the F14 key (125). - */ - static F14: number; - /** - * Constant associated with the key code value for the F15 key (126). - */ - static F15: number; - /** - * Constant associated with the key code value for the F2 key (113). - */ - static F2: number; - /** - * Constant associated with the key code value for the F3 key (114). - */ - static F3: number; - /** - * Constant associated with the key code value for the F4 key (115). - */ - static F4: number; - /** - * Constant associated with the key code value for the F5 key (116). - */ - static F5: number; - /** - * Constant associated with the key code value for the F6 key (117). - */ - static F6: number; - /** - * Constant associated with the key code value for the F7 key (118). - */ - static F7: number; - /** - * Constant associated with the key code value for the F8 key (119). - */ - static F8: number; - /** - * Constant associated with the key code value for the F9 key (120). - */ - static F9: number; - /** - * Engage fast-forward transport mode - */ - static FAST_FORWARD: number; - /** - * Constant associated with the key code value for the G key (71). - */ - static G: number; - /** - * Green function key button - */ - static GREEN: number; - /** - * Engage program guide - */ - static GUIDE: number; - /** - * Constant associated with the key code value for the H key (72). - */ - static H: number; - /** - * Engage help application or context-sensitive help - */ - static HELP: number; - /** - * Constant associated with the key code value for the Home key (36). - */ - static HOME: number; - /** - * Constant associated with the key code value for the I key (73). - */ - static I: number; - /** - * Info button - */ - static INFO: number; - /** - * Cycle input - */ - static INPUT: number; - /** - * Constant associated with the key code value for the Insert key (45). - */ - static INSERT: number; - /** - * Constant associated with the key code value for the J key (74). - */ - static J: number; - /** - * Constant associated with the key code value for the K key (75). - */ - static K: number; - /** - * The Begin key - */ - static KEYNAME_BEGIN: string; - /** - * The Break key - */ - static KEYNAME_BREAK: string; - /** - * The Clear Display key - */ - static KEYNAME_CLEARDISPLAY: string; - /** - * The Clear Line key - */ - static KEYNAME_CLEARLINE: string; - /** - * The Delete key - */ - static KEYNAME_DELETE: string; - /** - * The Delete Character key - */ - static KEYNAME_DELETECHAR: string; - /** - * The Delete Line key - */ - static KEYNAME_DELETELINE: string; - /** - * The down arrow - */ - static KEYNAME_DOWNARROW: string; - /** - * The End key - */ - static KEYNAME_END: string; - /** - * The Execute key - */ - static KEYNAME_EXECUTE: string; - /** - * The F1 key - */ - static KEYNAME_F1: string; - /** - * The F10 key - */ - static KEYNAME_F10: string; - /** - * The F11 key - */ - static KEYNAME_F11: string; - /** - * The F12 key - */ - static KEYNAME_F12: string; - /** - * The F13 key - */ - static KEYNAME_F13: string; - /** - * The F14 key - */ - static KEYNAME_F14: string; - /** - * The F15 key - */ - static KEYNAME_F15: string; - /** - * The F16 key - */ - static KEYNAME_F16: string; - /** - * The F17 key - */ - static KEYNAME_F17: string; - /** - * The F18 key - */ - static KEYNAME_F18: string; - /** - * The F19 key - */ - static KEYNAME_F19: string; - /** - * The F2 key - */ - static KEYNAME_F2: string; - /** - * The F20 key - */ - static KEYNAME_F20: string; - /** - * The F21 key - */ - static KEYNAME_F21: string; - /** - * The F22 key - */ - static KEYNAME_F22: string; - /** - * The F23 key - */ - static KEYNAME_F23: string; - /** - * The F24 key - */ - static KEYNAME_F24: string; - /** - * The F25 key - */ - static KEYNAME_F25: string; - /** - * The F26 key - */ - static KEYNAME_F26: string; - /** - * The F27 key - */ - static KEYNAME_F27: string; - /** - * The F28 key - */ - static KEYNAME_F28: string; - /** - * The F29 key - */ - static KEYNAME_F29: string; - /** - * The F3 key - */ - static KEYNAME_F3: string; - /** - * The F30 key - */ - static KEYNAME_F30: string; - /** - * The F31 key - */ - static KEYNAME_F31: string; - /** - * The F32 key - */ - static KEYNAME_F32: string; - /** - * The F33 key - */ - static KEYNAME_F33: string; - /** - * The F34 key - */ - static KEYNAME_F34: string; - /** - * The F35 key - */ - static KEYNAME_F35: string; - /** - * The F4 key - */ - static KEYNAME_F4: string; - /** - * The F5 key - */ - static KEYNAME_F5: string; - /** - * The F6 key - */ - static KEYNAME_F6: string; - /** - * The F7 key - */ - static KEYNAME_F7: string; - /** - * The F8 key - */ - static KEYNAME_F8: string; - /** - * The F9 key - */ - static KEYNAME_F9: string; - /** - * The Find key - */ - static KEYNAME_FIND: string; - /** - * The Help key - */ - static KEYNAME_HELP: string; - /** - * The Home key - */ - static KEYNAME_HOME: string; - /** - * The Insert key - */ - static KEYNAME_INSERT: string; - /** - * The Insert Character key - */ - static KEYNAME_INSERTCHAR: string; - /** - * The Insert Line key - */ - static KEYNAME_INSERTLINE: string; - /** - * The left arrow - */ - static KEYNAME_LEFTARROW: string; - /** - * The Menu key - */ - static KEYNAME_MENU: string; - /** - * The Mode Switch key - */ - static KEYNAME_MODESWITCH: string; - /** - * The Next key - */ - static KEYNAME_NEXT: string; - /** - * The Page Down key - */ - static KEYNAME_PAGEDOWN: string; - /** - * The Page Up key - */ - static KEYNAME_PAGEUP: string; - /** - * The Pause key - */ - static KEYNAME_PAUSE: string; - /** - * The Previous key - */ - static KEYNAME_PREV: string; - /** - * The PRINT key - */ - static KEYNAME_PRINT: string; - /** - * The PRINT Screen - */ - static KEYNAME_PRINTSCREEN: string; - /** - * The Redo key - */ - static KEYNAME_REDO: string; - /** - * The Reset key - */ - static KEYNAME_RESET: string; - /** - * The right arrow - */ - static KEYNAME_RIGHTARROW: string; - /** - * The Scroll Lock key - */ - static KEYNAME_SCROLLLOCK: string; - /** - * The Select key - */ - static KEYNAME_SELECT: string; - /** - * The Stop key - */ - static KEYNAME_STOP: string; - /** - * The System Request key - */ - static KEYNAME_SYSREQ: string; - /** - * The System key - */ - static KEYNAME_SYSTEM: string; - /** - * The Undo key - */ - static KEYNAME_UNDO: string; - /** - * The up arrow - */ - static KEYNAME_UPARROW: string; - /** - * The User key - */ - static KEYNAME_USER: string; - /** - * Constant associated with the key code value for the L key (76). - */ - static L: number; - /** - * Watch last channel or show watched - */ - static LAST: number; - /** - * Constant associated with the key code value for the Left Arrow key (37). - */ - static LEFT: number; - /** - * Constant associated with the key code value for the [ key (219). - */ - static LEFTBRACKET: number; - /** - * Return to live [position in broadcast] - */ - static LIVE: number; - /** - * Constant associated with the key code value for the M key (77). - */ - static M: number; - /** - * Engage "Master Shell" e.g. TiVo or other vendor button - */ - static MASTER_SHELL: number; - /** - * Engage menu - */ - static MENU: number; - /** - * Constant associated with the key code value for the - key (189). - */ - static MINUS: number; - /** - * Constant associated with the key code value for the N key (78). - */ - static N: number; - /** - * Skip to next track or chapter - */ - static NEXT: number; - /** - * Constant associated with the key code value for the 0 key (48). - */ - static NUMBER_0: number; - /** - * Constant associated with the key code value for the 1 key (49). - */ - static NUMBER_1: number; - /** - * Constant associated with the key code value for the 2 key (50). - */ - static NUMBER_2: number; - /** - * Constant associated with the key code value for the 3 key (51). - */ - static NUMBER_3: number; - /** - * Constant associated with the key code value for the 4 key (52). - */ - static NUMBER_4: number; - /** - * Constant associated with the key code value for the 5 key (53). - */ - static NUMBER_5: number; - /** - * Constant associated with the key code value for the 6 key (54). - */ - static NUMBER_6: number; - /** - * Constant associated with the key code value for the 7 key (55). - */ - static NUMBER_7: number; - /** - * Constant associated with the key code value for the 8 key (56). - */ - static NUMBER_8: number; - /** - * Constant associated with the key code value for the 9 key (57). - */ - static NUMBER_9: number; - /** - * Constant associated with the pseudo-key code for the the number pad (21). Use to set numpad modifier on key equivalents - */ - static NUMPAD: number; - /** - * Constant associated with the key code value for the number 0 key on the number pad (96). - */ - static NUMPAD_0: number; - /** - * Constant associated with the key code value for the number 1 key on the number pad (97). - */ - static NUMPAD_1: number; - /** - * Constant associated with the key code value for the number 2 key on the number pad (98). - */ - static NUMPAD_2: number; - /** - * Constant associated with the key code value for the number 3 key on the number pad (99). - */ - static NUMPAD_3: number; - /** - * Constant associated with the key code value for the number 4 key on the number pad (100). - */ - static NUMPAD_4: number; - /** - * Constant associated with the key code value for the number 5 key on the number pad (101). - */ - static NUMPAD_5: number; - /** - * Constant associated with the key code value for the number 6 key on the number pad (102). - */ - static NUMPAD_6: number; - /** - * Constant associated with the key code value for the number 7 key on the number pad (103). - */ - static NUMPAD_7: number; - /** - * Constant associated with the key code value for the number 8 key on the number pad (104). - */ - static NUMPAD_8: number; - /** - * Constant associated with the key code value for the number 9 key on the number pad (105). - */ - static NUMPAD_9: number; - /** - * Constant associated with the key code value for the addition key on the number pad (107). - */ - static NUMPAD_ADD: number; - /** - * Constant associated with the key code value for the decimal key on the number pad (110). - */ - static NUMPAD_DECIMAL: number; - /** - * Constant associated with the key code value for the division key on the number pad (111). - */ - static NUMPAD_DIVIDE: number; - /** - * Constant associated with the key code value for the Enter key on the number pad (108). - */ - static NUMPAD_ENTER: number; - /** - * Constant associated with the key code value for the multiplication key on the number pad (106). - */ - static NUMPAD_MULTIPLY: number; - /** - * Constant associated with the key code value for the subtraction key on the number pad (109). - */ - static NUMPAD_SUBTRACT: number; - /** - * Constant associated with the key code value for the O key (79). - */ - static O: number; - /** - * Constant associated with the key code value for the P key (80). - */ - static P: number; - /** - * Constant associated with the key code value for the Page Down key (34). - */ - static PAGE_DOWN: number; - /** - * Constant associated with the key code value for the Page Up key (33). - */ - static PAGE_UP: number; - /** - * Engage pause transport mode - */ - static PAUSE: number; - /** - * Constant associated with the key code value for the . key (190). - */ - static PERIOD: number; - /** - * Engage play transport mode - */ - static PLAY: number; - /** - * Skip to previous track or chapter - */ - static PREVIOUS: number; - /** - * Constant associated with the key code value for the Q key (81). - */ - static Q: number; - /** - * Constant associated with the key code value for the ' key (222). - */ - static QUOTE: number; - /** - * Constant associated with the key code value for the R key (82). - */ - static R: number; - /** - * Record item or engage record transport mode - */ - static RECORD: number; - /** - * Red function key button - */ - static RED: number; - /** - * Engage rewind transport mode - */ - static REWIND: number; - /** - * Constant associated with the key code value for the Right Arrow key (39). - */ - static RIGHT: number; - /** - * Constant associated with the key code value for the ] key (221). - */ - static RIGHTBRACKET: number; - /** - * Constant associated with the key code value for the S key (83). - */ - static S: number; - /** - * Search button - */ - static SEARCH: number; - /** - * Constant associated with the key code value for the ; key (186). - */ - static SEMICOLON: number; - /** - * Engage setup application or menu - */ - static SETUP: number; - /** - * Constant associated with the key code value for the Shift key (16). - */ - static SHIFT: number; - /** - * Quick skip backward (usually 7-10 seconds) - */ - static SKIP_BACKWARD: number; - /** - * Quick skip ahead (usually 30 seconds) - */ - static SKIP_FORWARD: number; - /** - * Constant associated with the key code value for the / key (191). - */ - static SLASH: number; - /** - * Constant associated with the key code value for the Spacebar (32). - */ - static SPACE: number; - /** - * Engage stop transport mode - */ - static STOP: number; - /** - * Toggle subtitles - */ - static SUBTITLE: number; - /** - * Constant associated with the key code value for the T key (84). - */ - static T: number; - /** - * Constant associated with the key code value for the Tab key (9). - */ - static TAB: number; - /** - * Constant associated with the key code value for the U key (85). - */ - static U: number; - /** - * Constant associated with the key code value for the Up Arrow key (38). - */ - static UP: number; - /** - * Constant associated with the key code value for the V key (86). - */ - static V: number; - /** - * Engage video-on-demand - */ - static VOD: number; - /** - * Constant associated with the key code value for the W key (87). - */ - static W: number; - /** - * Constant associated with the key code value for the X key (88). - */ - static X: number; - /** - * Constant associated with the key code value for the Y key (89). - */ - static Y: number; - /** - * Yellow function key button - */ - static YELLOW: number; - /** - * Constant associated with the key code value for the Z key (90). - */ - static Z: number; - } -} -/** -* The DisplayObjectContainer class is the base class for all objects that can -* serve as display object containers on the display list. The display list -* manages all objects displayed in the Flash runtimes. Use the -* DisplayObjectContainer class to arrange the display objects in the display -* list. Each DisplayObjectContainer object has its own child list for -* organizing the z-order of the objects. The z-order is the front-to-back -* order that determines which object is drawn in front, which is behind, and -* so on. -* -*

DisplayObject is an abstract base class; therefore, you cannot call -* DisplayObject directly. Invoking new DisplayObject() throws an -* ArgumentError exception.

-* The DisplayObjectContainer class is an abstract base class for all objects -* that can contain child objects. It cannot be instantiated directly; calling -* the new DisplayObjectContainer() constructor throws an -* ArgumentError exception. -* -*

For more information, see the "Display Programming" chapter of the -* ActionScript 3.0 Developer's Guide.

-*/ -declare module away.containers { - class DisplayObjectContainer extends base.DisplayObject implements library.IAsset { - private _mouseChildren; - private _children; - public _iIsRoot: boolean; - /** - * - */ - public assetType : string; - /** - * Determines whether or not the children of the object are mouse, or user - * input device, enabled. If an object is enabled, a user can interact with - * it by using a mouse or user input device. The default is - * true. - * - *

This property is useful when you create a button with an instance of - * the Sprite class(instead of using the SimpleButton class). When you use a - * Sprite instance to create a button, you can choose to decorate the button - * by using the addChild() method to add additional Sprite - * instances. This process can cause unexpected behavior with mouse events - * because the Sprite instances you add as children can become the target - * object of a mouse event when you expect the parent instance to be the - * target object. To ensure that the parent instance serves as the target - * objects for mouse events, you can set the mouseChildren - * property of the parent instance to false.

- * - *

No event is dispatched by setting this property. You must use the - * addEventListener() method to create interactive - * functionality.

- */ - public mouseChildren : boolean; - /** - * Returns the number of children of this object. - */ - public numChildren : number; - /** - * Determines whether the children of the object are tab enabled. Enables or - * disables tabbing for the children of the object. The default is - * true. - * - *

Note: Do not use the tabChildren property with - * Flex. Instead, use the - * mx.core.UIComponent.hasFocusableChildren property.

- * - * @throws IllegalOperationError Calling this property of the Stage object - * throws an exception. The Stage object does - * not implement this property. - */ - public tabChildren: boolean; - /** - * Calling the new DisplayObjectContainer() constructor throws - * an ArgumentError exception. You can, however, call - * constructors for the following subclasses of DisplayObjectContainer: - *
    - *
  • new Loader()
  • - *
  • new Sprite()
  • - *
  • new MovieClip()
  • - *
- */ - constructor(); - /** - * Adds a child DisplayObject instance to this DisplayObjectContainer - * instance. The child is added to the front(top) of all other children in - * this DisplayObjectContainer instance.(To add a child to a specific index - * position, use the addChildAt() method.) - * - *

If you add a child object that already has a different display object - * container as a parent, the object is removed from the child list of the - * other display object container.

- * - *

Note: The command stage.addChild() can cause - * problems with a published SWF file, including security problems and - * conflicts with other loaded SWF files. There is only one Stage within a - * Flash runtime instance, no matter how many SWF files you load into the - * runtime. So, generally, objects should not be added to the Stage, - * directly, at all. The only object the Stage should contain is the root - * object. Create a DisplayObjectContainer to contain all of the items on the - * display list. Then, if necessary, add that DisplayObjectContainer instance - * to the Stage.

- * - * @param child The DisplayObject instance to add as a child of this - * DisplayObjectContainer instance. - * @return The DisplayObject instance that you pass in the child - * parameter. - * @throws ArgumentError Throws if the child is the same as the parent. Also - * throws if the caller is a child(or grandchild etc.) - * of the child being added. - * @event added Dispatched when a display object is added to the display - * list. - */ - public addChild(child: base.DisplayObject): base.DisplayObject; - /** - * Adds a child DisplayObject instance to this DisplayObjectContainer - * instance. The child is added at the index position specified. An index of - * 0 represents the back(bottom) of the display list for this - * DisplayObjectContainer object. - * - *

For example, the following example shows three display objects, labeled - * a, b, and c, at index positions 0, 2, and 1, respectively:

- * - *

If you add a child object that already has a different display object - * container as a parent, the object is removed from the child list of the - * other display object container.

- * - * @param child The DisplayObject instance to add as a child of this - * DisplayObjectContainer instance. - * @param index The index position to which the child is added. If you - * specify a currently occupied index position, the child object - * that exists at that position and all higher positions are - * moved up one position in the child list. - * @return The DisplayObject instance that you pass in the child - * parameter. - * @throws ArgumentError Throws if the child is the same as the parent. Also - * throws if the caller is a child(or grandchild etc.) - * of the child being added. - * @throws RangeError Throws if the index position does not exist in the - * child list. - * @event added Dispatched when a display object is added to the display - * list. - */ - public addChildAt(child: base.DisplayObject, index: number): base.DisplayObject; - public addChildren(...childarray: base.DisplayObject[]): void; - /** - * - */ - public clone(): base.DisplayObject; - /** - * Determines whether the specified display object is a child of the - * DisplayObjectContainer instance or the instance itself. The search - * includes the entire display list including this DisplayObjectContainer - * instance. Grandchildren, great-grandchildren, and so on each return - * true. - * - * @param child The child object to test. - * @return true if the child object is a child of - * the DisplayObjectContainer or the container itself; otherwise - * false. - */ - public contains(child: base.DisplayObject): boolean; - /** - * - */ - public disposeWithChildren(): void; - /** - * Returns the child display object instance that exists at the specified - * index. - * - * @param index The index position of the child object. - * @return The child display object at the specified index position. - * @throws RangeError Throws if the index does not exist in the child - * list. - */ - public getChildAt(index: number): base.DisplayObject; - /** - * Returns the child display object that exists with the specified name. If - * more that one child display object has the specified name, the method - * returns the first object in the child list. - * - *

The getChildAt() method is faster than the - * getChildByName() method. The getChildAt() method - * accesses a child from a cached array, whereas the - * getChildByName() method has to traverse a linked list to - * access a child.

- * - * @param name The name of the child to return. - * @return The child display object with the specified name. - */ - public getChildByName(name: string): base.DisplayObject; - /** - * Returns the index position of a child DisplayObject instance. - * - * @param child The DisplayObject instance to identify. - * @return The index position of the child display object to identify. - * @throws ArgumentError Throws if the child parameter is not a child of this - * object. - */ - public getChildIndex(child: base.DisplayObject): number; - /** - * Returns an array of objects that lie under the specified point and are - * children(or grandchildren, and so on) of this DisplayObjectContainer - * instance. Any child objects that are inaccessible for security reasons are - * omitted from the returned array. To determine whether this security - * restriction affects the returned array, call the - * areInaccessibleObjectsUnderPoint() method. - * - *

The point parameter is in the coordinate space of the - * Stage, which may differ from the coordinate space of the display object - * container(unless the display object container is the Stage). You can use - * the globalToLocal() and the localToGlobal() - * methods to convert points between these coordinate spaces.

- * - * @param point The point under which to look. - * @return An array of objects that lie under the specified point and are - * children(or grandchildren, and so on) of this - * DisplayObjectContainer instance. - */ - public getObjectsUnderPoint(point: geom.Point): base.DisplayObject[]; - /** - * Removes the specified child DisplayObject instance from the - * child list of the DisplayObjectContainer instance. The parent - * property of the removed child is set to null , and the object - * is garbage collected if no other references to the child exist. The index - * positions of any display objects above the child in the - * DisplayObjectContainer are decreased by 1. - * - *

The garbage collector reallocates unused memory space. When a variable - * or object is no longer actively referenced or stored somewhere, the - * garbage collector sweeps through and wipes out the memory space it used to - * occupy if no other references to it exist.

- * - * @param child The DisplayObject instance to remove. - * @return The DisplayObject instance that you pass in the child - * parameter. - * @throws ArgumentError Throws if the child parameter is not a child of this - * object. - */ - public removeChild(child: base.DisplayObject): base.DisplayObject; - /** - * Removes a child DisplayObject from the specified index - * position in the child list of the DisplayObjectContainer. The - * parent property of the removed child is set to - * null, and the object is garbage collected if no other - * references to the child exist. The index positions of any display objects - * above the child in the DisplayObjectContainer are decreased by 1. - * - *

The garbage collector reallocates unused memory space. When a variable - * or object is no longer actively referenced or stored somewhere, the - * garbage collector sweeps through and wipes out the memory space it used to - * occupy if no other references to it exist.

- * - * @param index The child index of the DisplayObject to remove. - * @return The DisplayObject instance that was removed. - * @throws RangeError Throws if the index does not exist in the child - * list. - * @throws SecurityError This child display object belongs to a sandbox to - * which the calling object does not have access. You - * can avoid this situation by having the child movie - * call the Security.allowDomain() method. - */ - public removeChildAt(index: number): base.DisplayObject; - /** - * Removes all child DisplayObject instances from the child list - * of the DisplayObjectContainer instance. The parent property - * of the removed children is set to null, and the objects are - * garbage collected if no other references to the children exist. - * - * The garbage collector reallocates unused memory space. When a variable or - * object is no longer actively referenced or stored somewhere, the garbage - * collector sweeps through and wipes out the memory space it used to occupy - * if no other references to it exist. - * - * @param beginIndex The beginning position. A value smaller than 0 throws a RangeError. - * @param endIndex The ending position. A value smaller than 0 throws a RangeError. - * @throws RangeError Throws if the beginIndex or endIndex positions do - * not exist in the child list. - */ - public removeChildren(beginIndex?: number, endIndex?: number): void; - /** - * Changes the position of an existing child in the display object container. - * This affects the layering of child objects. For example, the following - * example shows three display objects, labeled a, b, and c, at index - * positions 0, 1, and 2, respectively: - * - *

When you use the setChildIndex() method and specify an - * index position that is already occupied, the only positions that change - * are those in between the display object's former and new position. All - * others will stay the same. If a child is moved to an index LOWER than its - * current index, all children in between will INCREASE by 1 for their index - * reference. If a child is moved to an index HIGHER than its current index, - * all children in between will DECREASE by 1 for their index reference. For - * example, if the display object container in the previous example is named - * container, you can swap the position of the display objects - * labeled a and b by calling the following code:

- * - *

This code results in the following arrangement of objects:

- * - * @param child The child DisplayObject instance for which you want to change - * the index number. - * @param index The resulting index number for the child display - * object. - * @throws ArgumentError Throws if the child parameter is not a child of this - * object. - * @throws RangeError Throws if the index does not exist in the child - * list. - */ - public setChildIndex(child: base.DisplayObject, index: number): void; - /** - * Swaps the z-order (front-to-back order) of the two specified child - * objects. All other child objects in the display object container remain in - * the same index positions. - * - * @param child1 The first child object. - * @param child2 The second child object. - * @throws ArgumentError Throws if either child parameter is not a child of - * this object. - */ - public swapChildren(child1: base.DisplayObject, child2: base.DisplayObject): void; - /** - * Swaps the z-order(front-to-back order) of the child objects at the two - * specified index positions in the child list. All other child objects in - * the display object container remain in the same index positions. - * - * @param index1 The index position of the first child object. - * @param index2 The index position of the second child object. - * @throws RangeError If either index does not exist in the child list. - */ - public swapChildrenAt(index1: number, index2: number): void; - /** - * @protected - */ - public pInvalidateSceneTransform(): void; - /** - * @protected - */ - public _pUpdateScene(value: Scene): void; - /** - * @protected - */ - public _pUpdateImplicitMouseEnabled(value: boolean): void; - /** - * @protected - */ - public _pUpdateImplicitVisibility(value: boolean): void; - /** - * @protected - */ - public _pUpdateImplicitPartition(value: partition.Partition): void; - /** - * @private - * - * @param child - */ - private removeChildInternal(child); - } -} -declare module away.base { - class LightBase extends containers.DisplayObjectContainer { - private _color; - private _colorR; - private _colorG; - private _colorB; - private _ambientColor; - private _ambient; - public _iAmbientR: number; - public _iAmbientG: number; - public _iAmbientB: number; - private _specular; - public _iSpecularR: number; - public _iSpecularG: number; - public _iSpecularB: number; - private _diffuse; - public _iDiffuseR: number; - public _iDiffuseG: number; - public _iDiffuseB: number; - private _castsShadows; - private _shadowMapper; - constructor(); - public castsShadows : boolean; - public pCreateShadowMapper(): materials.ShadowMapperBase; - public specular : number; - public diffuse : number; - public color : number; - public ambient : number; - public ambientColor : number; - private updateAmbient(); - public iGetObjectProjectionMatrix(entity: entities.IEntity, camera: entities.Camera, target?: geom.Matrix3D): geom.Matrix3D; - public assetType : string; - private updateSpecular(); - private updateDiffuse(); - public shadowMapper : materials.ShadowMapperBase; - } -} -declare module away.projections { - /** - * Provides constant values for camera lens projection options use the the coordinateSystem property - * - * @see away.projections.PerspectiveLens#coordinateSystem - */ - class CoordinateSystem { - /** - * Default option, projects to a left-handed coordinate system - */ - static LEFT_HANDED: string; - /** - * Projects to a right-handed coordinate system - */ - static RIGHT_HANDED: string; - } -} -/** -* @module away.base -*/ -declare module away.projections { - /** - * IMaterialOwner provides an interface for objects that can use materials. - * - * @interface away.base.IMaterialOwner - */ - interface IProjection extends events.IEventDispatcher { - coordinateSystem: string; - frustumCorners: number[]; - matrix: geom.Matrix3D; - near: number; - originX: number; - originY: number; - far: number; - _iAspectRatio: number; - project(point3d: geom.Vector3D): geom.Vector3D; - unproject(nX: number, nY: number, sZ: number): geom.Vector3D; - _iUpdateScissorRect(x: number, y: number, width: number, height: number): any; - _iUpdateViewport(x: number, y: number, width: number, height: number): any; - } -} -declare module away.projections { - class ProjectionBase extends events.EventDispatcher implements IProjection { - public _pMatrix: geom.Matrix3D; - public _pScissorRect: geom.Rectangle; - public _pViewPort: geom.Rectangle; - public _pNear: number; - public _pFar: number; - public _pAspectRatio: number; - public _pMatrixInvalid: boolean; - public _pFrustumCorners: number[]; - public _pCoordinateSystem: string; - public _pOriginX: number; - public _pOriginY: number; - private _unprojection; - private _unprojectionInvalid; - constructor(coordinateSystem?: string); - /** - * The handedness of the coordinate system projection. The default is LEFT_HANDED. - */ - public coordinateSystem : string; - public frustumCorners : number[]; - public matrix : geom.Matrix3D; - public near : number; - public originX : number; - public originY : number; - public far : number; - public project(point3d: geom.Vector3D): geom.Vector3D; - public unprojectionMatrix : geom.Matrix3D; - public unproject(nX: number, nY: number, sZ: number): geom.Vector3D; - public clone(): ProjectionBase; - public _iAspectRatio : number; - public pInvalidateMatrix(): void; - public pUpdateMatrix(): void; - public _iUpdateScissorRect(x: number, y: number, width: number, height: number): void; - public _iUpdateViewport(x: number, y: number, width: number, height: number): void; - } -} -declare module away.projections { - class PerspectiveProjection extends ProjectionBase { - private _fieldOfView; - private _focalLength; - private _hFieldOfView; - private _hFocalLength; - private _preserveAspectRatio; - private _preserveFocalLength; - constructor(fieldOfView?: number, coordinateSystem?: string); - /** - * - */ - public preserveAspectRatio : boolean; - /** - * - */ - public preserveFocalLength : boolean; - /** - * - */ - public fieldOfView : number; - /** - * - */ - public focalLength : number; - /** - * - */ - public hFieldOfView : number; - /** - * - */ - public hFocalLength : number; - public unproject(nX: number, nY: number, sZ: number): geom.Vector3D; - public clone(): ProjectionBase; - public pUpdateMatrix(): void; - } -} -declare module away.projections { - class FreeMatrixProjection extends ProjectionBase { - constructor(); - public near : number; - public far : number; - public iAspectRatio : number; - public clone(): ProjectionBase; - public pUpdateMatrix(): void; - } -} -declare module away.projections { - class OrthographicProjection extends ProjectionBase { - private _projectionHeight; - private _xMax; - private _yMax; - constructor(projectionHeight?: number); - public projectionHeight : number; - public unproject(nX: number, nY: number, sZ: number): geom.Vector3D; - public clone(): ProjectionBase; - public pUpdateMatrix(): void; - } -} -declare module away.projections { - class OrthographicOffCenterProjection extends ProjectionBase { - private _minX; - private _maxX; - private _minY; - private _maxY; - constructor(minX: number, maxX: number, minY: number, maxY: number); - public minX : number; - public maxX : number; - public minY : number; - public maxY : number; - public unproject(nX: number, nY: number, sZ: number): geom.Vector3D; - public clone(): ProjectionBase; - public pUpdateMatrix(): void; - } -} -declare module away.projections { - class ObliqueNearPlaneProjection extends ProjectionBase { - private _baseProjection; - private _plane; - private _onProjectionMatrixChangedDelegate; - constructor(baseProjection: IProjection, plane: geom.Plane3D); - public frustumCorners : number[]; - public near : number; - public far : number; - public iAspectRatio : number; - public plane : geom.Plane3D; - public baseProjection : IProjection; - private onProjectionMatrixChanged(event); - public pUpdateMatrix(): void; - } -} -declare module away.entities { - class Camera extends containers.DisplayObjectContainer implements IEntity { - private _viewProjection; - private _viewProjectionDirty; - private _projection; - private _frustumPlanes; - private _frustumPlanesDirty; - private _onProjectionMatrixChangedDelegate; - constructor(projection?: projections.IProjection); - public pCreateDefaultBoundingVolume(): bounds.BoundingVolumeBase; - /** - * @protected - */ - public pCreateEntityPartitionNode(): partition.EntityNode; - public assetType : string; - private onProjectionMatrixChanged(event); - public frustumPlanes : geom.Plane3D[]; - private updateFrustum(); - /** - * @protected - */ - public pInvalidateSceneTransform(): void; - /** - * @protected - */ - public pUpdateBounds(): void; - /** - * - */ - public projection : projections.IProjection; - /** - * - */ - public viewProjection : geom.Matrix3D; - /** - * Calculates the ray in scene space from the camera to the given normalized coordinates in screen space. - * - * @param nX The normalised x coordinate in screen space, -1 corresponds to the left edge of the viewport, 1 to the right. - * @param nY The normalised y coordinate in screen space, -1 corresponds to the top edge of the viewport, 1 to the bottom. - * @param sZ The z coordinate in screen space, representing the distance into the screen. - * @return The ray from the camera to the scene space position of the given screen coordinates. - */ - public getRay(nX: number, nY: number, sZ: number): geom.Vector3D; - /** - * Calculates the normalised position in screen space of the given scene position. - * - * @param point3d the position vector of the scene coordinates to be projected. - * @return The normalised screen position of the given scene coordinates. - */ - public project(point3d: geom.Vector3D): geom.Vector3D; - /** - * Calculates the scene position of the given normalized coordinates in screen space. - * - * @param nX The normalised x coordinate in screen space, minus the originX offset of the projection property. - * @param nY The normalised y coordinate in screen space, minus the originY offset of the projection property. - * @param sZ The z coordinate in screen space, representing the distance into the screen. - * @return The scene position of the given screen coordinates. - */ - public unproject(nX: number, nY: number, sZ: number): geom.Vector3D; - public _iCollectRenderables(renderer: render.IRenderer): void; - public _iCollectRenderable(renderer: render.IRenderer): void; - } -} -declare module away.materials { - class ShadowMapperBase { - public _pCasterCollector: traverse.ShadowCasterCollector; - private _depthMap; - public _pDepthMapSize: number; - public _pLight: base.LightBase; - private _explicitDepthMap; - private _autoUpdateShadows; - public _iShadowsInvalid: boolean; - constructor(); - public pCreateCasterCollector(): traverse.ShadowCasterCollector; - public autoUpdateShadows : boolean; - public updateShadows(): void; - public iSetDepthMap(depthMap: textures.TextureProxyBase): void; - public light : base.LightBase; - public depthMap : textures.TextureProxyBase; - public depthMapSize : number; - public dispose(): void; - public pCreateDepthTexture(): textures.TextureProxyBase; - public iRenderDepthMap(stage: base.Stage, entityCollector: traverse.EntityCollector, renderer: render.IRenderer): void; - public pUpdateDepthProjection(viewCamera: entities.Camera): void; - public pDrawDepthMap(target: textures.TextureProxyBase, scene: containers.Scene, renderer: render.IRenderer): void; - public _pSetDepthMapSize(value: any): void; - } -} -declare module away.materials { - class CubeMapShadowMapper extends ShadowMapperBase { - private _depthCameras; - private _projections; - private _needsRender; - constructor(); - private initCameras(); - private addCamera(rotationX, rotationY, rotationZ); - public pCreateDepthTexture(): textures.TextureProxyBase; - public pUpdateDepthProjection(viewCamera: entities.Camera): void; - public pDrawDepthMap(target: textures.RenderTexture, scene: containers.Scene, renderer: render.IRenderer): void; - } -} -declare module away.materials { - class DirectionalShadowMapper extends ShadowMapperBase { - public _pOverallDepthCamera: entities.Camera; - public _pLocalFrustum: number[]; - public _pLightOffset: number; - public _pMatrix: geom.Matrix3D; - public _pOverallDepthProjection: projections.FreeMatrixProjection; - public _pSnap: number; - public _pCullPlanes: geom.Plane3D[]; - public _pMinZ: number; - public _pMaxZ: number; - constructor(); - public snap : number; - public lightOffset : number; - public iDepthProjection : geom.Matrix3D; - public depth : number; - public pDrawDepthMap(target: textures.TextureProxyBase, scene: containers.Scene, renderer: render.IRenderer): void; - public pUpdateCullPlanes(viewCamera: entities.Camera): void; - public pUpdateDepthProjection(viewCamera: entities.Camera): void; - public pUpdateProjectionFromFrustumCorners(viewCamera: entities.Camera, corners: number[], matrix: geom.Matrix3D): void; - } -} -declare module away.materials { - class CascadeShadowMapper extends DirectionalShadowMapper implements events.IEventDispatcher { - public _pScissorRects: geom.Rectangle[]; - private _pScissorRectsInvalid; - private _splitRatios; - private _numCascades; - private _depthCameras; - private _depthLenses; - private _texOffsetsX; - private _texOffsetsY; - private _changeDispatcher; - private _nearPlaneDistances; - constructor(numCascades?: number); - public getSplitRatio(index: number): number; - public setSplitRatio(index: number, value: number): void; - public getDepthProjections(partition: number): geom.Matrix3D; - private init(); - public _pSetDepthMapSize(value: number): void; - private invalidateScissorRects(); - public numCascades : number; - public pDrawDepthMap(target: textures.RenderTexture, scene: containers.Scene, renderer: render.IRenderer): void; - private updateScissorRects(); - public pUpdateDepthProjection(viewCamera: entities.Camera): void; - private updateProjectionPartition(matrix, splitRatio, texOffsetX, texOffsetY); - public addEventListener(type: string, listener: Function): void; - public removeEventListener(type: string, listener: Function): void; - public dispatchEvent(event: events.Event): void; - public hasEventListener(type: string): boolean; - public _iNearPlaneDistances : number[]; - } -} -declare module away.materials { - class NearDirectionalShadowMapper extends DirectionalShadowMapper { - private _coverageRatio; - constructor(coverageRatio?: number); - /** - * A value between 0 and 1 to indicate the ratio of the view frustum that needs to be covered by the shadow map. - */ - public coverageRatio : number; - public pUpdateDepthProjection(viewCamera: entities.Camera): void; - } -} -declare module away.entities { - interface IEntity extends library.IAsset { - x: number; - y: number; - z: number; - rotationX: number; - rotationY: number; - rotationZ: number; - scaleX: number; - scaleY: number; - scaleZ: number; - /** - * - */ - bounds: bounds.BoundingVolumeBase; - /** - * - */ - castsShadows: boolean; - /** - * - */ - inverseSceneTransform: geom.Matrix3D; - /** - * - */ - partitionNode: partition.EntityNode; - /** - * - */ - pickingCollider: pick.IPickingCollider; - /** - * - */ - transform: geom.Transform; - /** - * - */ - scene: containers.Scene; - /** - * - */ - scenePosition: geom.Vector3D; - /** - * - */ - sceneTransform: geom.Matrix3D; - /** - * - */ - worldBounds: bounds.BoundingVolumeBase; - /** - * - */ - zOffset: number; - /** - * - */ - isIntersectingRay(rayPosition: geom.Vector3D, rayDirection: geom.Vector3D): boolean; - /** - * - * - * @param target - * @param upAxis - */ - lookAt(target: geom.Vector3D, upAxis?: geom.Vector3D): any; - /** - * @internal - */ - _iPickingCollisionVO: pick.PickingCollisionVO; - /** - * @internal - */ - _iController: controllers.ControllerBase; - /** - * @internal - */ - _iAssignedPartition: partition.Partition; - /** - * //TODO - * - * @param shortestCollisionDistance - * @param findClosest - * @returns {boolean} - * - * @internal - */ - _iTestCollision(shortestCollisionDistance: number, findClosest: boolean): boolean; - /** - * @internal - */ - _iIsMouseEnabled(): boolean; - /** - * @internal - */ - _iIsVisible(): boolean; - _iInternalUpdate(): any; - /** - * The transformation matrix that transforms from model to world space, adapted with any special operations needed to render. - * For example, assuring certain alignedness which is not inherent in the scene transform. By default, this would - * return the scene transform. - */ - getRenderSceneTransform(camera: Camera): geom.Matrix3D; - /** - * - * @param renderer - * @private - */ - _iCollectRenderables(renderer: render.IRenderer): any; - } -} -/** -* The Billboard class represents display objects that represent bitmap images. -* These can be images that you load with the flash.Assets or -* flash.display.Loader classes, or they can be images that you -* create with the Billboard() constructor. -* -*

The Billboard() constructor allows you to create a Billboard -* object that contains a reference to a BitmapData object. After you create a -* Billboard object, use the addChild() or addChildAt() -* method of the parent DisplayObjectContainer instance to place the bitmap on -* the display list.

-* -*

A Billboard object can share its BitmapData reference among several Billboard -* objects, independent of translation or rotation properties. Because you can -* create multiple Billboard objects that reference the same BitmapData object, -* multiple display objects can use the same complex BitmapData object without -* incurring the memory overhead of a BitmapData object for each display -* object instance.

-* -*

A BitmapData object can be drawn to the screen by a Billboard object in one -* of two ways: by using the default hardware renderer with a single hardware surface, -* or by using the slower software renderer when 3D acceleration is not available.

-* -*

If you would prefer to perform a batch rendering command, rather than using a -* single surface for each Billboard object, you can also draw to the screen using the -* drawTiles() or drawTriangles() methods which are -* available to flash.display.Tilesheet and flash.display.Graphics -* objects.

-* -*

Note: The Billboard class is not a subclass of the InteractiveObject -* class, so it cannot dispatch mouse events. However, you can use the -* addEventListener() method of the display object container that -* contains the Billboard object.

-*/ -declare module away.entities { - class Billboard extends base.DisplayObject implements IEntity, base.IMaterialOwner { - private _animator; - private _billboardWidth; - private _billboardHeight; - private _material; - private _uvTransform; - private onSizeChangedDelegate; - /** - * Defines the animator of the mesh. Act on the mesh's geometry. Defaults to null - */ - public animator : animators.IAnimator; - /** - * - */ - public assetType : string; - /** - * The BitmapData object being referenced. - */ - public bitmapData: base.BitmapData; - /** - * - */ - public billboardHeight : number; - /** - * - */ - public billboardWidth : number; - /** - * - */ - public material : materials.MaterialBase; - /** - * Controls whether or not the Billboard object is snapped to the nearest pixel. - * This value is ignored in the native and HTML5 targets. - * The PixelSnapping class includes possible values: - *
    - *
  • PixelSnapping.NEVER - No pixel snapping occurs.
  • - *
  • PixelSnapping.ALWAYS - The image is always snapped to - * the nearest pixel, independent of transformation.
  • - *
  • PixelSnapping.AUTO - The image is snapped to the - * nearest pixel if it is drawn with no rotation or skew and it is drawn at a - * scale factor of 99.9% to 100.1%. If these conditions are satisfied, the - * bitmap image is drawn at 100% scale, snapped to the nearest pixel. - * When targeting Flash Player, this value allows the image to be drawn as fast - * as possible using the internal vector renderer.
  • - *
- */ - public pixelSnapping: string; - /** - * Controls whether or not the bitmap is smoothed when scaled. If - * true, the bitmap is smoothed when scaled. If - * false, the bitmap is not smoothed when scaled. - */ - public smoothing: boolean; - /** - * - */ - public uvTransform : geom.UVTransform; - constructor(material: materials.MaterialBase, pixelSnapping?: string, smoothing?: boolean); - /** - * @protected - */ - public pCreateEntityPartitionNode(): partition.EntityNode; - /** - * @protected - */ - public pUpdateBounds(): void; - /** - * //TODO - * - * @param shortestCollisionDistance - * @param findClosest - * @returns {boolean} - * - * @internal - */ - public _iTestCollision(shortestCollisionDistance: number, findClosest: boolean): boolean; - /** - * @private - */ - private onSizeChanged(event); - public _iCollectRenderables(renderer: render.IRenderer): void; - public _iCollectRenderable(renderer: render.IRenderer): void; - } -} -declare module away.entities { - class DirectionalLight extends base.LightBase implements IEntity { - private _direction; - private _tmpLookAt; - private _sceneDirection; - private _projAABBPoints; - constructor(xDir?: number, yDir?: number, zDir?: number); - public sceneDirection : geom.Vector3D; - public direction : geom.Vector3D; - /** - * - * @returns {away.bounds.NullBounds} - */ - public pCreateDefaultBoundingVolume(): bounds.BoundingVolumeBase; - /** - * - */ - public pUpdateBounds(): void; - public pUpdateSceneTransform(): void; - public pCreateShadowMapper(): materials.DirectionalShadowMapper; - /** - * @protected - */ - public pCreateEntityPartitionNode(): partition.EntityNode; - public iGetObjectProjectionMatrix(entity: IEntity, camera: Camera, target?: geom.Matrix3D): geom.Matrix3D; - public _iCollectRenderables(renderer: render.IRenderer): void; - } -} -declare module away.entities { - class LightProbe extends base.LightBase implements IEntity { - private _diffuseMap; - private _specularMap; - constructor(diffuseMap: textures.CubeTextureBase, specularMap?: textures.CubeTextureBase); - public diffuseMap : textures.CubeTextureBase; - public specularMap : textures.CubeTextureBase; - /** - * @protected - */ - public pCreateEntityPartitionNode(): partition.EntityNode; - public pUpdateBounds(): void; - public pCreateDefaultBoundingVolume(): bounds.BoundingVolumeBase; - public iGetObjectProjectionMatrix(entity: IEntity, camera: Camera, target?: geom.Matrix3D): geom.Matrix3D; - public _iCollectRenderables(renderer: render.IRenderer): void; - } -} -declare module away.entities { - /** - * A Line Segment primitive. - */ - class LineSegment extends base.DisplayObject implements IEntity, base.IMaterialOwner { - private _animator; - private _material; - private _uvTransform; - private onSizeChangedDelegate; - public _startPosition: geom.Vector3D; - public _endPosition: geom.Vector3D; - public _halfThickness: number; - /** - * Defines the animator of the line segment. Act on the line segment's geometry. Defaults to null - */ - public animator : animators.IAnimator; - /** - * - */ - public assetType : string; - /** - * - */ - public startPostion : geom.Vector3D; - public startPosition : geom.Vector3D; - /** - * - */ - public endPosition : geom.Vector3D; - /** - * - */ - public material : materials.MaterialBase; - /** - * - */ - public thickness : number; - /** - * - */ - public uvTransform : geom.UVTransform; - /** - * Create a line segment - * - * @param startPosition Start position of the line segment - * @param endPosition Ending position of the line segment - * @param thickness Thickness of the line - */ - constructor(material: materials.MaterialBase, startPosition: geom.Vector3D, endPosition: geom.Vector3D, thickness?: number); - public dispose(): void; - /** - * @protected - */ - public pCreateEntityPartitionNode(): partition.EntityNode; - /** - * @protected - */ - public pUpdateBounds(): void; - /** - * @private - */ - private onSizeChanged(event); - /** - * @private - */ - private notifyRenderableUpdate(); - public _iCollectRenderables(renderer: render.IRenderer): void; - public _iCollectRenderable(renderer: render.IRenderer): void; - } -} -declare module away.entities { - /** - * Mesh is an instance of a Geometry, augmenting it with a presence in the scene graph, a material, and an animation - * state. It consists out of SubMeshes, which in turn correspond to SubGeometries. SubMeshes allow different parts - * of the geometry to be assigned different materials. - */ - class Mesh extends containers.DisplayObjectContainer implements IEntity { - private _uvTransform; - private _subMeshes; - private _geometry; - private _material; - private _animator; - private _castsShadows; - private _shareAnimationGeometry; - private _onGeometryBoundsInvalidDelegate; - private _onSubGeometryAddedDelegate; - private _onSubGeometryRemovedDelegate; - /** - * Defines the animator of the mesh. Act on the mesh's geometry. Default value is null. - */ - public animator : animators.IAnimator; - /** - * - */ - public assetType : string; - /** - * Indicates whether or not the Mesh can cast shadows. Default value is true. - */ - public castsShadows : boolean; - /** - * The geometry used by the mesh that provides it with its shape. - */ - public geometry : base.Geometry; - /** - * The material with which to render the Mesh. - */ - public material : materials.MaterialBase; - /** - * Indicates whether or not the mesh share the same animation geometry. - */ - public shareAnimationGeometry : boolean; - /** - * The SubMeshes out of which the Mesh consists. Every SubMesh can be assigned a material to override the Mesh's - * material. - */ - public subMeshes : base.ISubMesh[]; - /** - * - */ - public uvTransform : geom.UVTransform; - /** - * Create a new Mesh object. - * - * @param geometry The geometry used by the mesh that provides it with its shape. - * @param material [optional] The material with which to render the Mesh. - */ - constructor(geometry: base.Geometry, material?: materials.MaterialBase); - /** - * - */ - public bakeTransformations(): void; - /** - * @inheritDoc - */ - public dispose(): void; - /** - * Disposes mesh including the animator and children. This is a merely a convenience method. - * @return - */ - public disposeWithAnimatorAndChildren(): void; - /** - * Clones this Mesh instance along with all it's children, while re-using the same - * material, geometry and animation set. The returned result will be a copy of this mesh, - * containing copies of all of it's children. - * - * Properties that are re-used (i.e. not cloned) by the new copy include name, - * geometry, and material. Properties that are cloned or created anew for the copy - * include subMeshes, children of the mesh, and the animator. - * - * If you want to copy just the mesh, reusing it's geometry and material while not - * cloning it's children, the simplest way is to create a new mesh manually: - * - * - * var clone : Mesh = new Mesh(original.geometry, original.material); - * - */ - public clone(): base.DisplayObject; - /** - * //TODO - * - * @param subGeometry - * @returns {SubMeshBase} - */ - public getSubMeshFromSubGeometry(subGeometry: base.TriangleSubGeometry): base.ISubMesh; - /** - * @protected - */ - public pCreateEntityPartitionNode(): partition.EntityNode; - /** - * //TODO - * - * @protected - */ - public pUpdateBounds(): void; - /** - * //TODO - * - * @private - */ - private onGeometryBoundsInvalid(event); - /** - * Called when a SubGeometry was added to the Geometry. - * - * @private - */ - private onSubGeometryAdded(event); - /** - * Called when a SubGeometry was removed from the Geometry. - * - * @private - */ - private onSubGeometryRemoved(event); - /** - * Adds a SubMeshBase wrapping a SubGeometry. - * - * @param subGeometry - */ - private addSubMesh(subGeometry); - /** - * //TODO - * - * @param shortestCollisionDistance - * @param findClosest - * @returns {boolean} - * - * @internal - */ - public _iTestCollision(shortestCollisionDistance: number, findClosest: boolean): boolean; - /** - * - * @param renderer - * - * @internal - */ - public _iCollectRenderables(renderer: render.IRenderer): void; - public _iInvalidateRenderableGeometries(): void; - } -} -declare module away.entities { - class PointLight extends base.LightBase implements IEntity { - public _pRadius: number; - public _pFallOff: number; - public _pFallOffFactor: number; - constructor(); - public pCreateShadowMapper(): materials.CubeMapShadowMapper; - public radius : number; - public iFallOffFactor(): number; - public fallOff : number; - /** - * @protected - */ - public pCreateEntityPartitionNode(): partition.EntityNode; - public pUpdateBounds(): void; - public pCreateDefaultBoundingVolume(): bounds.BoundingVolumeBase; - public iGetObjectProjectionMatrix(entity: IEntity, camera: Camera, target?: geom.Matrix3D): geom.Matrix3D; - public _iCollectRenderables(renderer: render.IRenderer): void; - } -} -/** -* This class is used to create lightweight shapes using the ActionScript -* drawing application program interface(API). The Shape class includes a -* graphics property, which lets you access methods from the -* Graphics class. -* -*

The Sprite class also includes a graphicsproperty, and it -* includes other features not available to the Shape class. For example, a -* Sprite object is a display object container, whereas a Shape object is not -* (and cannot contain child display objects). For this reason, Shape objects -* consume less memory than Sprite objects that contain the same graphics. -* However, a Sprite object supports user input events, while a Shape object -* does not.

-*/ -declare module away.entities { - class Shape extends base.DisplayObject { - private _graphics; - /** - * Specifies the Graphics object belonging to this Shape object, where vector - * drawing commands can occur. - */ - public graphics : base.Graphics; - /** - * Creates a new Shape object. - */ - constructor(); - } -} -declare module away.entities { - /** - * A Skybox class is used to render a sky in the scene. It's always considered static and 'at infinity', and as - * such it's always centered at the camera's position and sized to exactly fit within the camera's frustum, ensuring - * the sky box is always as large as possible without being clipped. - */ - class Skybox extends base.DisplayObject implements IEntity, base.IMaterialOwner { - private _uvTransform; - private _material; - private _animator; - public animator : animators.IAnimator; - /** - * - */ - public uvTransform : geom.UVTransform; - /** - * Create a new Skybox object. - * - * @param material The material with which to render the Skybox. - */ - constructor(material: materials.MaterialBase); - /** - * The material with which to render the Skybox. - */ - public material : materials.MaterialBase; - public assetType : string; - /** - * @protected - */ - public pInvalidateBounds(): void; - /** - * @protected - */ - public pCreateEntityPartitionNode(): partition.SkyboxNode; - /** - * @protected - */ - public pCreateDefaultBoundingVolume(): bounds.BoundingVolumeBase; - /** - * @protected - */ - public pUpdateBounds(): void; - public castsShadows : boolean; - public _iCollectRenderables(renderer: render.IRenderer): void; - public _iCollectRenderable(renderer: render.IRenderer): void; - } -} -/** -* The TextField class is used to create display objects for text display and -* input. You can use the TextField class to -* perform low-level text rendering. However, in Flex, you typically use the -* Label, Text, TextArea, and TextInput controls to process text. You can give a text field an instance name in the -* Property inspector and use the methods and properties of the TextField -* class to manipulate it with ActionScript. TextField instance names are -* displayed in the Movie Explorer and in the Insert Target Path dialog box in -* the Actions panel. -* -*

To create a text field dynamically, use the TextField() -* constructor.

-* -*

The methods of the TextField class let you set, select, and manipulate -* text in a dynamic or input text field that you create during authoring or -* at runtime.

-* -*

ActionScript provides several ways to format your text at runtime. The -* TextFormat class lets you set character and paragraph formatting for -* TextField objects. You can apply Cascading Style Sheets(CSS) styles to -* text fields by using the TextField.styleSheet property and the -* StyleSheet class. You can use CSS to style built-in HTML tags, define new -* formatting tags, or apply styles. You can assign HTML formatted text, which -* optionally uses CSS styles, directly to a text field. HTML text that you -* assign to a text field can contain embedded media(movie clips, SWF files, -* GIF files, PNG files, and JPEG files). The text wraps around the embedded -* media in the same way that a web browser wraps text around media embedded -* in an HTML document.

-* -*

Flash Player supports a subset of HTML tags that you can use to format -* text. See the list of supported HTML tags in the description of the -* htmlText property.

-* -* @event change Dispatched after a control value is -* modified, unlike the -* textInput event, which is -* dispatched before the value is modified. -* Unlike the W3C DOM Event Model version of -* the change event, which -* dispatches the event only after the -* control loses focus, the ActionScript 3.0 -* version of the change event -* is dispatched any time the control -* changes. For example, if a user types text -* into a text field, a change -* event is dispatched after every keystroke. -* @event link Dispatched when a user clicks a hyperlink -* in an HTML-enabled text field, where the -* URL begins with "event:". The remainder of -* the URL after "event:" is placed in the -* text property of the LINK event. -* -*

Note: The default behavior, -* adding the text to the text field, occurs -* only when Flash Player generates the -* event, which in this case happens when a -* user attempts to input text. You cannot -* put text into a text field by sending it -* textInput events.

-* @event scroll Dispatched by a TextField object -* after the user scrolls. -* @event textInput Flash Player dispatches the -* textInput event when a user -* enters one or more characters of text. -* Various text input methods can generate -* this event, including standard keyboards, -* input method editors(IMEs), voice or -* speech recognition systems, and even the -* act of pasting plain text with no -* formatting or style information. -* @event textInteractionModeChange Flash Player dispatches the -* textInteractionModeChange -* event when a user changes the interaction -* mode of a text field. for example on -* Android, one can toggle from NORMAL mode -* to SELECTION mode using context menu -* options -*/ -declare module away.entities { - class TextField extends base.DisplayObject { - private _bottomScrollV; - private _caretIndex; - private _length; - private _maxScrollH; - private _maxScrollV; - private _numLines; - private _selectionBeginIndex; - private _selectionEndIndex; - private _text; - private _textHeight; - private _textInteractionMode; - private _textWidth; - private _charBoundaries; - private _charIndexAtPoint; - private _firstCharInParagraph; - private _imageReference; - private _lineIndexAtPoint; - private _lineIndexOfChar; - private _lineLength; - private _lineMetrics; - private _lineOffset; - private _lineText; - private _paragraphLength; - private _textFormat; - /** - * When set to true and the text field is not in focus, Flash - * Player highlights the selection in the text field in gray. When set to - * false and the text field is not in focus, Flash Player does - * not highlight the selection in the text field. - * - * @default false - */ - public alwaysShowSelection: boolean; - /** - * The type of anti-aliasing used for this text field. Use - * flash.text.AntiAliasType constants for this property. You can - * control this setting only if the font is embedded(with the - * embedFonts property set to true). The default - * setting is flash.text.AntiAliasType.NORMAL. - * - *

To set values for this property, use the following string values:

- */ - public antiAliasType: text.AntiAliasType; - /** - * Controls automatic sizing and alignment of text fields. Acceptable values - * for the TextFieldAutoSize constants: - * TextFieldAutoSize.NONE(the default), - * TextFieldAutoSize.LEFT, TextFieldAutoSize.RIGHT, - * and TextFieldAutoSize.CENTER. - * - *

If autoSize is set to TextFieldAutoSize.NONE - * (the default) no resizing occurs.

- * - *

If autoSize is set to TextFieldAutoSize.LEFT, - * the text is treated as left-justified text, meaning that the left margin - * of the text field remains fixed and any resizing of a single line of the - * text field is on the right margin. If the text includes a line break(for - * example, "\n" or "\r"), the bottom is also - * resized to fit the next line of text. If wordWrap is also set - * to true, only the bottom of the text field is resized and the - * right side remains fixed.

- * - *

If autoSize is set to - * TextFieldAutoSize.RIGHT, the text is treated as - * right-justified text, meaning that the right margin of the text field - * remains fixed and any resizing of a single line of the text field is on - * the left margin. If the text includes a line break(for example, - * "\n" or "\r"), the bottom is also resized to fit the next - * line of text. If wordWrap is also set to true, - * only the bottom of the text field is resized and the left side remains - * fixed.

- * - *

If autoSize is set to - * TextFieldAutoSize.CENTER, the text is treated as - * center-justified text, meaning that any resizing of a single line of the - * text field is equally distributed to both the right and left margins. If - * the text includes a line break(for example, "\n" or - * "\r"), the bottom is also resized to fit the next line of - * text. If wordWrap is also set to true, only the - * bottom of the text field is resized and the left and right sides remain - * fixed.

- * - * @throws ArgumentError The autoSize specified is not a member - * of flash.text.TextFieldAutoSize. - */ - public autoSize: text.TextFieldAutoSize; - /** - * Specifies whether the text field has a background fill. If - * true, the text field has a background fill. If - * false, the text field has no background fill. Use the - * backgroundColor property to set the background color of a - * text field. - * - * @default false - */ - public background: boolean; - /** - * The color of the text field background. The default value is - * 0xFFFFFF(white). This property can be retrieved or set, even - * if there currently is no background, but the color is visible only if the - * text field has the background property set to - * true. - */ - public backgroundColor: number; - /** - * Specifies whether the text field has a border. If true, the - * text field has a border. If false, the text field has no - * border. Use the borderColor property to set the border color. - * - * @default false - */ - public border: boolean; - /** - * The color of the text field border. The default value is - * 0x000000(black). This property can be retrieved or set, even - * if there currently is no border, but the color is visible only if the text - * field has the border property set to true. - */ - public borderColor: number; - /** - * An integer(1-based index) that indicates the bottommost line that is - * currently visible in the specified text field. Think of the text field as - * a window onto a block of text. The scrollV property is the - * 1-based index of the topmost visible line in the window. - * - *

All the text between the lines indicated by scrollV and - * bottomScrollV is currently visible in the text field.

- */ - public bottomScrollV : number; - /** - * The index of the insertion point(caret) position. If no insertion point - * is displayed, the value is the position the insertion point would be if - * you restored focus to the field(typically where the insertion point last - * was, or 0 if the field has not had focus). - * - *

Selection span indexes are zero-based(for example, the first position - * is 0, the second position is 1, and so on).

- */ - public caretIndex : number; - /** - * A Boolean value that specifies whether extra white space(spaces, line - * breaks, and so on) in a text field with HTML text is removed. The default - * value is false. The condenseWhite property only - * affects text set with the htmlText property, not the - * text property. If you set text with the text - * property, condenseWhite is ignored. - * - *

If condenseWhite is set to true, use standard - * HTML commands such as
and

to place line - * breaks in the text field.

- * - *

Set the condenseWhite property before setting the - * htmlText property.

- */ - public condenseWhite: boolean; - /** - * Specifies the format applied to newly inserted text, such as text entered - * by a user or text inserted with the replaceSelectedText() - * method. - * - *

Note: When selecting characters to be replaced with - * setSelection() and replaceSelectedText(), the - * defaultTextFormat will be applied only if the text has been - * selected up to and including the last character. Here is an example:

- *
 public my_txt:TextField new TextField();
-        * my_txt.text = "Flash Macintosh version"; public my_fmt:TextFormat = new
-        * TextFormat(); my_fmt.color = 0xFF0000; my_txt.defaultTextFormat = my_fmt;
-        * my_txt.setSelection(6,15); // partial text selected - defaultTextFormat
-        * not applied my_txt.setSelection(6,23); // text selected to end -
-        * defaultTextFormat applied my_txt.replaceSelectedText("Windows version");
-        * 
- * - *

When you access the defaultTextFormat property, the - * returned TextFormat object has all of its properties defined. No property - * is null.

- * - *

Note: You can't set this property if a style sheet is applied to - * the text field.

- * - * @throws Error This method cannot be used on a text field with a style - * sheet. - */ - public defaultTextFormat: text.TextFormat; - /** - * Specifies whether the text field is a password text field. If the value of - * this property is true, the text field is treated as a - * password text field and hides the input characters using asterisks instead - * of the actual characters. If false, the text field is not - * treated as a password text field. When password mode is enabled, the Cut - * and Copy commands and their corresponding keyboard shortcuts will not - * function. This security mechanism prevents an unscrupulous user from using - * the shortcuts to discover a password on an unattended computer. - * - * @default false - */ - public displayAsPassword: boolean; - /** - * Specifies whether to render by using embedded font outlines. If - * false, Flash Player renders the text field by using device - * fonts. - * - *

If you set the embedFonts property to true - * for a text field, you must specify a font for that text by using the - * font property of a TextFormat object applied to the text - * field. If the specified font is not embedded in the SWF file, the text is - * not displayed.

- * - * @default false - */ - public embedFonts: boolean; - /** - * The type of grid fitting used for this text field. This property applies - * only if the flash.text.AntiAliasType property of the text - * field is set to flash.text.AntiAliasType.ADVANCED. - * - *

The type of grid fitting used determines whether Flash Player forces - * strong horizontal and vertical lines to fit to a pixel or subpixel grid, - * or not at all.

- * - *

For the flash.text.GridFitType property, you can use the - * following string values:

- * - * @default pixel - */ - public gridFitType: text.GridFitType; - /** - * Contains the HTML representation of the text field contents. - * - *

Flash Player supports the following HTML tags:

- * - *

Flash Player and AIR also support explicit character codes, such as - * &(ASCII ampersand) and €(Unicode € symbol).

- */ - public htmlText: string; - /** - * The number of characters in a text field. A character such as tab - * (\t) counts as one character. - */ - public length : number; - /** - * The maximum number of characters that the text field can contain, as - * entered by a user. A script can insert more text than - * maxChars allows; the maxChars property indicates - * only how much text a user can enter. If the value of this property is - * 0, a user can enter an unlimited amount of text. - * - * @default 0 - */ - public maxChars: number; - /** - * The maximum value of scrollH. - */ - public maxScrollH(): number; - /** - * The maximum value of scrollV. - */ - public maxScrollV(): number; - /** - * A Boolean value that indicates whether Flash Player automatically scrolls - * multiline text fields when the user clicks a text field and rolls the - * mouse wheel. By default, this value is true. This property is - * useful if you want to prevent mouse wheel scrolling of text fields, or - * implement your own text field scrolling. - */ - public mouseWheelEnabled: boolean; - /** - * Indicates whether field is a multiline text field. If the value is - * true, the text field is multiline; if the value is - * false, the text field is a single-line text field. In a field - * of type TextFieldType.INPUT, the multiline value - * determines whether the Enter key creates a new line(a value - * of false, and the Enter key is ignored). If you - * paste text into a TextField with a multiline - * value of false, newlines are stripped out of the text. - * - * @default false - */ - public multiline: boolean; - /** - * Defines the number of text lines in a multiline text field. If - * wordWrap property is set to true, the number of - * lines increases when text wraps. - */ - public numLines : number; - /** - * Indicates the set of characters that a user can enter into the text field. - * If the value of the restrict property is null, - * you can enter any character. If the value of the restrict - * property is an empty string, you cannot enter any character. If the value - * of the restrict property is a string of characters, you can - * enter only characters in the string into the text field. The string is - * scanned from left to right. You can specify a range by using the hyphen - * (-) character. Only user interaction is restricted; a script can put any - * text into the text field. This property does - * not synchronize with the Embed font options in the Property inspector. - * - *

If the string begins with a caret(^) character, all characters are - * initially accepted and succeeding characters in the string are excluded - * from the set of accepted characters. If the string does not begin with a - * caret(^) character, no characters are initially accepted and succeeding - * characters in the string are included in the set of accepted - * characters.

- * - *

The following example allows only uppercase characters, spaces, and - * numbers to be entered into a text field:

- *
 my_txt.restrict = "A-Z 0-9"; 
- * - *

The following example includes all characters, but excludes lowercase - * letters:

- *
 my_txt.restrict = "^a-z"; 
- * - *

You can use a backslash to enter a ^ or - verbatim. The accepted - * backslash sequences are \-, \^ or \\. The backslash must be an actual - * character in the string, so when specified in ActionScript, a double - * backslash must be used. For example, the following code includes only the - * dash(-) and caret(^):

- *
 my_txt.restrict = "\\-\\^"; 
- * - *

The ^ can be used anywhere in the string to toggle between including - * characters and excluding characters. The following code includes only - * uppercase letters, but excludes the uppercase letter Q:

- *
 my_txt.restrict = "A-Z^Q"; 
- * - *

You can use the \u escape sequence to construct - * restrict strings. The following code includes only the - * characters from ASCII 32(space) to ASCII 126(tilde).

- *
 my_txt.restrict = "\u0020-\u007E"; 
- * - * @default null - */ - public restrict: string; - /** - * The current horizontal scrolling position. If the scrollH - * property is 0, the text is not horizontally scrolled. This property value - * is an integer that represents the horizontal position in pixels. - * - *

The units of horizontal scrolling are pixels, whereas the units of - * vertical scrolling are lines. Horizontal scrolling is measured in pixels - * because most fonts you typically use are proportionally spaced; that is, - * the characters can have different widths. Flash Player performs vertical - * scrolling by line because users usually want to see a complete line of - * text rather than a partial line. Even if a line uses multiple fonts, the - * height of the line adjusts to fit the largest font in use.

- * - *

Note: The scrollH property is zero-based, not - * 1-based like the scrollV vertical scrolling property.

- */ - public scrollH: number; - /** - * The vertical position of text in a text field. The scrollV - * property is useful for directing users to a specific paragraph in a long - * passage, or creating scrolling text fields. - * - *

The units of vertical scrolling are lines, whereas the units of - * horizontal scrolling are pixels. If the first line displayed is the first - * line in the text field, scrollV is set to 1(not 0). Horizontal scrolling - * is measured in pixels because most fonts are proportionally spaced; that - * is, the characters can have different widths. Flash performs vertical - * scrolling by line because users usually want to see a complete line of - * text rather than a partial line. Even if there are multiple fonts on a - * line, the height of the line adjusts to fit the largest font in use.

- */ - public scrollV: number; - /** - * A Boolean value that indicates whether the text field is selectable. The - * value true indicates that the text is selectable. The - * selectable property controls whether a text field is - * selectable, not whether a text field is editable. A dynamic text field can - * be selectable even if it is not editable. If a dynamic text field is not - * selectable, the user cannot select its text. - * - *

If selectable is set to false, the text in - * the text field does not respond to selection commands from the mouse or - * keyboard, and the text cannot be copied with the Copy command. If - * selectable is set to true, the text in the text - * field can be selected with the mouse or keyboard, and the text can be - * copied with the Copy command. You can select text this way even if the - * text field is a dynamic text field instead of an input text field.

- * - * @default true - */ - public selectable: boolean; - /** - * The zero-based character index value of the first character in the current - * selection. For example, the first character is 0, the second character is - * 1, and so on. If no text is selected, this property is the value of - * caretIndex. - */ - public selectionBeginIndex : number; - /** - * The zero-based character index value of the last character in the current - * selection. For example, the first character is 0, the second character is - * 1, and so on. If no text is selected, this property is the value of - * caretIndex. - */ - public selectionEndIndex : number; - /** - * The sharpness of the glyph edges in this text field. This property applies - * only if the flash.text.AntiAliasType property of the text - * field is set to flash.text.AntiAliasType.ADVANCED. The range - * for sharpness is a number from -400 to 400. If you attempt to - * set sharpness to a value outside that range, Flash sets the - * property to the nearest value in the range(either -400 or 400). - * - * @default 0 - */ - public sharpness: number; - /** - * Attaches a style sheet to the text field. For information on creating - * style sheets, see the StyleSheet class and the ActionScript 3.0 - * Developer's Guide. - * - *

You can change the style sheet associated with a text field at any - * time. If you change the style sheet in use, the text field is redrawn with - * the new style sheet. You can set the style sheet to null or - * undefined to remove the style sheet. If the style sheet in - * use is removed, the text field is redrawn without a style sheet.

- * - *

Note: If the style sheet is removed, the contents of both - * TextField.text and TextField.htmlText change to - * incorporate the formatting previously applied by the style sheet. To - * preserve the original TextField.htmlText contents without the - * formatting, save the value in a variable before removing the style - * sheet.

- */ - public styleSheet: StyleSheet; - /** - * A string that is the current text in the text field. Lines are separated - * by the carriage return character('\r', ASCII 13). This - * property contains unformatted text in the text field, without HTML tags. - * - *

To get the text in HTML form, use the htmlText - * property.

- */ - public text : string; - /** - * The color of the text in a text field, in hexadecimal format. The - * hexadecimal color system uses six digits to represent color values. Each - * digit has 16 possible values or characters. The characters range from 0-9 - * and then A-F. For example, black is 0x000000; white is - * 0xFFFFFF. - * - * @default 0(0x000000) - */ - public textColor: number; - /** - * The height of the text in pixels. - */ - public textHeight : number; - /** - * The interaction mode property, Default value is - * TextInteractionMode.NORMAL. On mobile platforms, the normal mode implies - * that the text can be scrolled but not selected. One can switch to the - * selectable mode through the in-built context menu on the text field. On - * Desktop, the normal mode implies that the text is in scrollable as well as - * selection mode. - */ - public textInteractionMode : text.TextInteractionMode; - /** - * The width of the text in pixels. - */ - public textWidth : number; - /** - * The thickness of the glyph edges in this text field. This property applies - * only when away.text.AntiAliasType is set to - * away.text.AntiAliasType.ADVANCED. - * - *

The range for thickness is a number from -200 to 200. If - * you attempt to set thickness to a value outside that range, - * the property is set to the nearest value in the range(either -200 or - * 200).

- * - * @default 0 - */ - public thickness: number; - /** - * The type of the text field. Either one of the following TextFieldType - * constants: TextFieldType.DYNAMIC, which specifies a dynamic - * text field, which a user cannot edit, or TextFieldType.INPUT, - * which specifies an input text field, which a user can edit. - * - * @default dynamic - * @throws ArgumentError The type specified is not a member of - * flash.text.TextFieldType. - */ - public type: text.TextFieldType; - /** - * Specifies whether to copy and paste the text formatting along with the - * text. When set to true, Flash Player copies and pastes - * formatting(such as alignment, bold, and italics) when you copy and paste - * between text fields. Both the origin and destination text fields for the - * copy and paste procedure must have useRichTextClipboard set - * to true. The default value is false. - */ - public useRichTextClipboard: boolean; - /** - * A Boolean value that indicates whether the text field has word wrap. If - * the value of wordWrap is true, the text field - * has word wrap; if the value is false, the text field does not - * have word wrap. The default value is false. - */ - public wordWrap: boolean; - /** - * Creates a new TextField instance. After you create the TextField instance, - * call the addChild() or addChildAt() method of - * the parent DisplayObjectContainer object to add the TextField instance to - * the display list. - * - *

The default size for a text field is 100 x 100 pixels.

- */ - constructor(); - /** - * Appends the string specified by the newText parameter to the - * end of the text of the text field. This method is more efficient than an - * addition assignment(+=) on a text property - * (such as someTextField.text += moreText), particularly for a - * text field that contains a significant amount of content. - * - * @param newText The string to append to the existing text. - */ - public appendText(newText: string): void; - /** - * Returns a rectangle that is the bounding box of the character. - * - * @param charIndex The zero-based index value for the character(for - * example, the first position is 0, the second position is - * 1, and so on). - * @return A rectangle with x and y minimum and - * maximum values defining the bounding box of the character. - */ - public getCharBoundaries(charIndex: number): geom.Rectangle; - /** - * Returns the zero-based index value of the character at the point specified - * by the x and y parameters. - * - * @param x The x coordinate of the character. - * @param y The y coordinate of the character. - * @return The zero-based index value of the character(for example, the - * first position is 0, the second position is 1, and so on). Returns - * -1 if the point is not over any character. - */ - public getCharIndexAtPoint(x: number, y: number): number; - /** - * Given a character index, returns the index of the first character in the - * same paragraph. - * - * @param charIndex The zero-based index value of the character(for example, - * the first character is 0, the second character is 1, and - * so on). - * @return The zero-based index value of the first character in the same - * paragraph. - * @throws RangeError The character index specified is out of range. - */ - public getFirstCharInParagraph(charIndex: number): number; - /** - * Returns a DisplayObject reference for the given id, for an - * image or SWF file that has been added to an HTML-formatted text field by - * using an tag. The tag is in the - * following format: - * - *

 

- * - * @param id The id to match(in the id attribute - * of the tag). - * @return The display object corresponding to the image or SWF file with the - * matching id attribute in the tag - * of the text field. For media loaded from an external source, this - * object is a Loader object, and, once loaded, the media object is a - * child of that Loader object. For media embedded in the SWF file, - * it is the loaded object. If no tag with the - * matching id exists, the method returns - * null. - */ - public getImageReference(id: string): base.DisplayObject; - /** - * Returns the zero-based index value of the line at the point specified by - * the x and y parameters. - * - * @param x The x coordinate of the line. - * @param y The y coordinate of the line. - * @return The zero-based index value of the line(for example, the first - * line is 0, the second line is 1, and so on). Returns -1 if the - * point is not over any line. - */ - public getLineIndexAtPoint(x: number, y: number): number; - /** - * Returns the zero-based index value of the line containing the character - * specified by the charIndex parameter. - * - * @param charIndex The zero-based index value of the character(for example, - * the first character is 0, the second character is 1, and - * so on). - * @return The zero-based index value of the line. - * @throws RangeError The character index specified is out of range. - */ - public getLineIndexOfChar(charIndex: number): number; - /** - * Returns the number of characters in a specific text line. - * - * @param lineIndex The line number for which you want the length. - * @return The number of characters in the line. - * @throws RangeError The line number specified is out of range. - */ - public getLineLength(lineIndex: number): number; - /** - * Returns metrics information about a given text line. - * - * @param lineIndex The line number for which you want metrics information. - * @return A TextLineMetrics object. - * @throws RangeError The line number specified is out of range. - */ - public getLineMetrics(lineIndex: number): text.TextLineMetrics; - /** - * Returns the character index of the first character in the line that the - * lineIndex parameter specifies. - * - * @param lineIndex The zero-based index value of the line(for example, the - * first line is 0, the second line is 1, and so on). - * @return The zero-based index value of the first character in the line. - * @throws RangeError The line number specified is out of range. - */ - public getLineOffset(lineIndex: number): number; - /** - * Returns the text of the line specified by the lineIndex - * parameter. - * - * @param lineIndex The zero-based index value of the line(for example, the - * first line is 0, the second line is 1, and so on). - * @return The text string contained in the specified line. - * @throws RangeError The line number specified is out of range. - */ - public getLineText(lineIndex: number): string; - /** - * Given a character index, returns the length of the paragraph containing - * the given character. The length is relative to the first character in the - * paragraph(as returned by getFirstCharInParagraph()), not to - * the character index passed in. - * - * @param charIndex The zero-based index value of the character(for example, - * the first character is 0, the second character is 1, and - * so on). - * @return Returns the number of characters in the paragraph. - * @throws RangeError The character index specified is out of range. - */ - public getParagraphLength(charIndex: number): number; - /** - * Returns a TextFormat object that contains formatting information for the - * range of text that the beginIndex and endIndex - * parameters specify. Only properties that are common to the entire text - * specified are set in the resulting TextFormat object. Any property that is - * mixed, meaning that it has different values at different points in - * the text, has a value of null. - * - *

If you do not specify values for these parameters, this method is - * applied to all the text in the text field.

- * - *

The following table describes three possible usages:

- * - * @return The TextFormat object that represents the formatting properties - * for the specified text. - * @throws RangeError The beginIndex or endIndex - * specified is out of range. - */ - public getTextFormat(beginIndex?: number, endIndex?: number): text.TextFormat; - /** - * Replaces the current selection with the contents of the value - * parameter. The text is inserted at the position of the current selection, - * using the current default character format and default paragraph format. - * The text is not treated as HTML. - * - *

You can use the replaceSelectedText() method to insert and - * delete text without disrupting the character and paragraph formatting of - * the rest of the text.

- * - *

Note: This method does not work if a style sheet is applied to - * the text field.

- * - * @param value The string to replace the currently selected text. - * @throws Error This method cannot be used on a text field with a style - * sheet. - */ - public replaceSelectedText(value: string): void; - /** - * Replaces the range of characters that the beginIndex and - * endIndex parameters specify with the contents of the - * newText parameter. As designed, the text from - * beginIndex to endIndex-1 is replaced. - * - *

Note: This method does not work if a style sheet is applied to - * the text field.

- * - * @param beginIndex The zero-based index value for the start position of the - * replacement range. - * @param endIndex The zero-based index position of the first character - * after the desired text span. - * @param newText The text to use to replace the specified range of - * characters. - * @throws Error This method cannot be used on a text field with a style - * sheet. - */ - public replaceText(beginIndex: number, endIndex: number, newText: string): void; - /** - * Sets as selected the text designated by the index values of the first and - * last characters, which are specified with the beginIndex and - * endIndex parameters. If the two parameter values are the - * same, this method sets the insertion point, as if you set the - * caretIndex property. - * - * @param beginIndex The zero-based index value of the first character in the - * selection(for example, the first character is 0, the - * second character is 1, and so on). - * @param endIndex The zero-based index value of the last character in the - * selection. - */ - public setSelection(beginIndex: number, endIndex: number): void; - /** - * Applies the text formatting that the format parameter - * specifies to the specified text in a text field. The value of - * format must be a TextFormat object that specifies the desired - * text formatting changes. Only the non-null properties of - * format are applied to the text field. Any property of - * format that is set to null is not applied. By - * default, all of the properties of a newly created TextFormat object are - * set to null. - * - *

Note: This method does not work if a style sheet is applied to - * the text field.

- * - *

The setTextFormat() method changes the text formatting - * applied to a range of characters or to the entire body of text in a text - * field. To apply the properties of format to all text in the text field, do - * not specify values for beginIndex and endIndex. - * To apply the properties of the format to a range of text, specify values - * for the beginIndex and the endIndex parameters. - * You can use the length property to determine the index - * values.

- * - *

The two types of formatting information in a TextFormat object are - * character level formatting and paragraph level formatting. Each character - * in a text field can have its own character formatting settings, such as - * font name, font size, bold, and italic.

- * - *

For paragraphs, the first character of the paragraph is examined for - * the paragraph formatting settings for the entire paragraph. Examples of - * paragraph formatting settings are left margin, right margin, and - * indentation.

- * - *

Any text inserted manually by the user, or replaced by the - * replaceSelectedText() method, receives the default text field - * formatting for new text, and not the formatting specified for the text - * insertion point. To set the default formatting for new text, use - * defaultTextFormat.

- * - * @param format A TextFormat object that contains character and paragraph - * formatting information. - * @throws Error This method cannot be used on a text field with a style - * sheet. - * @throws RangeError The beginIndex or endIndex - * specified is out of range. - */ - public setTextFormat(format: text.TextFormat, beginIndex?: number, endIndex?: number): void; - /** - * Returns true if an embedded font is available with the specified - * fontName and fontStyle where - * Font.fontType is flash.text.FontType.EMBEDDED. - * Starting with Flash Player 10, two kinds of embedded fonts can appear in a - * SWF file. Normal embedded fonts are only used with TextField objects. CFF - * embedded fonts are only used with the flash.text.engine classes. The two - * types are distinguished by the fontType property of the - * Font class, as returned by the enumerateFonts() - * function. - * - *

TextField cannot use a font of type EMBEDDED_CFF. If - * embedFonts is set to true and the only font - * available at run time with the specified name and style is of type - * EMBEDDED_CFF, Flash Player fails to render the text, as if no - * embedded font were available with the specified name and style.

- * - *

If both EMBEDDED and EMBEDDED_CFF fonts are - * available with the same name and style, the EMBEDDED font is - * selected and text renders with the EMBEDDED font.

- * - * @param fontName The name of the embedded font to check. - * @param fontStyle Specifies the font style to check. Use - * flash.text.FontStyle - * @return true if a compatible embedded font is available, - * otherwise false. - * @throws ArgumentError The fontStyle specified is not a member - * of flash.text.FontStyle. - */ - static isFontCompatible(fontName: string, fontStyle: string): boolean; - } -} -declare module away.managers { - /** - * MouseManager enforces a singleton pattern and is not intended to be instanced. - * it provides a manager class for detecting mouse hits on scene objects and sending out mouse events. - */ - class MouseManager { - private static _instance; - private _viewLookup; - public _iActiveDiv: HTMLDivElement; - public _iUpdateDirty: boolean; - public _iCollidingObject: pick.PickingCollisionVO; - private _nullVector; - private _previousCollidingObject; - private _queuedEvents; - private _mouseMoveEvent; - private _mouseUp; - private _mouseClick; - private _mouseOut; - private _mouseDown; - private _mouseMove; - private _mouseOver; - private _mouseWheel; - private _mouseDoubleClick; - private onClickDelegate; - private onDoubleClickDelegate; - private onMouseDownDelegate; - private onMouseMoveDelegate; - private onMouseUpDelegate; - private onMouseWheelDelegate; - private onMouseOverDelegate; - private onMouseOutDelegate; - /** - * Creates a new MouseManager object. - */ - constructor(); - static getInstance(): MouseManager; - public fireMouseEvents(forceMouseMove: boolean): void; - public registerView(view: containers.View): void; - public unregisterView(view: containers.View): void; - private queueDispatch(event, sourceEvent, collider?); - private onMouseMove(event); - private onMouseOut(event); - private onMouseOver(event); - private onClick(event); - private onDoubleClick(event); - private onMouseDown(event); - private onMouseUp(event); - private onMouseWheel(event); - private updateColliders(event); - } -} -declare module away.managers { - /** - * The StageManager class provides a multiton object that handles management for Stage objects. - * - * @see away.base.Stage - */ - class StageManager extends events.EventDispatcher { - private static STAGE_MAX_QUANTITY; - private _stages; - private static _instance; - private static _numStages; - private _onContextCreatedDelegate; - /** - * Creates a new StageManager class. - * @param stage The Stage object that contains the Stage objects to be managed. - * @private - */ - constructor(StageManagerSingletonEnforcer: StageManagerSingletonEnforcer); - /** - * Gets a StageManager instance for the given Stage object. - * @param stage The Stage object that contains the Stage objects to be managed. - * @return The StageManager instance for the given Stage object. - */ - static getInstance(): StageManager; - /** - * Requests the Stage for the given index. - * - * @param index The index of the requested Stage. - * @param forceSoftware Whether to force software mode even if hardware acceleration is available. - * @param profile The compatibility profile, an enumeration of ContextProfile - * @return The Stage for the given index. - */ - public getStageAt(index: number, forceSoftware?: boolean, profile?: string, mode?: string): base.Stage; - /** - * Removes a Stage from the manager. - * @param stage - * @private - */ - public iRemoveStage(stage: base.Stage): void; - /** - * Get the next available stage. An error is thrown if there are no StageProxies available - * @param forceSoftware Whether to force software mode even if hardware acceleration is available. - * @param profile The compatibility profile, an enumeration of ContextProfile - * @return The allocated stage - */ - public getFreeStage(forceSoftware?: boolean, profile?: string, mode?: string): base.Stage; - /** - * Checks if a new stage can be created and managed by the class. - * @return true if there is one slot free for a new stage - */ - public hasFreeStage : boolean; - /** - * Returns the amount of stage objects that can be created and managed by the class - * @return the amount of free slots - */ - public numSlotsFree : number; - /** - * Returns the amount of Stage objects currently managed by the class. - * @return the amount of slots used - */ - public numSlotsUsed : number; - /** - * The maximum amount of Stage objects that can be managed by the class - */ - public numSlotsTotal : number; - private onContextCreated(e); - } -} -declare class StageManagerSingletonEnforcer { -} -/** -* The Loader class is used to load SWF files or image(JPG, PNG, or GIF) -* files. Use the load() method to initiate loading. The loaded -* display object is added as a child of the Loader object. -* -*

Use the URLLoader class to load text or binary data.

-* -*

The Loader class overrides the following methods that it inherits, -* because a Loader object can only have one child display object - the -* display object that it loads. Calling the following methods throws an -* exception: addChild(), addChildAt(), -* removeChild(), removeChildAt(), and -* setChildIndex(). To remove a loaded display object, you must -* remove the Loader object from its parent DisplayObjectContainer -* child array.

-* -*

Note: The ActionScript 2.0 MovieClipLoader and LoadVars classes -* are not used in ActionScript 3.0. The Loader and URLLoader classes replace -* them.

-* -*

When you use the Loader class, consider the Flash Player and Adobe AIR -* security model:

-* -*
    -*
  • You can load content from any accessible source.
  • -*
  • Loading is not allowed if the calling SWF file is in a network -* sandbox and the file to be loaded is local.
  • -*
  • If the loaded content is a SWF file written with ActionScript 3.0, it -* cannot be cross-scripted by a SWF file in another security sandbox unless -* that cross-scripting arrangement was approved through a call to the -* System.allowDomain() or the -* System.allowInsecureDomain() method in the loaded content -* file.
  • -*
  • If the loaded content is an AVM1 SWF file(written using ActionScript -* 1.0 or 2.0), it cannot be cross-scripted by an AVM2 SWF file(written using -* ActionScript 3.0). However, you can communicate between the two SWF files -* by using the LocalConnection class.
  • -*
  • If the loaded content is an image, its data cannot be accessed by a -* SWF file outside of the security sandbox, unless the domain of that SWF -* file was included in a URL policy file at the origin domain of the -* image.
  • -*
  • Movie clips in the local-with-file-system sandbox cannot script movie -* clips in the local-with-networking sandbox, and the reverse is also -* prevented.
  • -*
  • You cannot connect to commonly reserved ports. For a complete list of -* blocked ports, see "Restricting Networking APIs" in the ActionScript 3.0 -* Developer's Guide.
  • -*
-* -*

However, in AIR, content in the application security -* sandbox(content installed with the AIR application) are not restricted by -* these security limitations.

-* -*

For more information related to security, see the Flash Player Developer -* Center Topic: Security.

-* -*

When loading a SWF file from an untrusted source(such as a domain other -* than that of the Loader object's root SWF file), you may want to define a -* mask for the Loader object, to prevent the loaded content(which is a child -* of the Loader object) from drawing to portions of the Stage outside of that -* mask, as shown in the following code:

-*/ -declare module away.containers { - class Loader extends DisplayObjectContainer { - private _loadingSessions; - private _useAssetLib; - private _assetLibId; - private _onResourceCompleteDelegate; - private _onAssetCompleteDelegate; - private _content; - private _contentLoaderInfo; - /** - * Contains the root display object of the SWF file or image(JPG, PNG, or - * GIF) file that was loaded by using the load() or - * loadBytes() methods. - * - * @throws SecurityError The loaded SWF file or image file belongs to a - * security sandbox to which you do not have access. - * For a loaded SWF file, you can avoid this situation - * by having the file call the - * Security.allowDomain() method or by - * having the loading file specify a - * loaderContext parameter with its - * securityDomain property set to - * SecurityDomain.currentDomain when you - * call the load() or - * loadBytes() method. - */ - public content : base.DisplayObject; - /** - * Returns a LoaderInfo object corresponding to the object being loaded. - * LoaderInfo objects are shared between the Loader object and the loaded - * content object. The LoaderInfo object supplies loading progress - * information and statistics about the loaded file. - * - *

Events related to the load are dispatched by the LoaderInfo object - * referenced by the contentLoaderInfo property of the Loader - * object. The contentLoaderInfo property is set to a valid - * LoaderInfo object, even before the content is loaded, so that you can add - * event listeners to the object prior to the load.

- * - *

To detect uncaught errors that happen in a loaded SWF, use the - * Loader.uncaughtErrorEvents property, not the - * Loader.contentLoaderInfo.uncaughtErrorEvents property.

- */ - public contentLoaderInfo : base.LoaderInfo; - /** - * Creates a Loader object that you can use to load files, such as SWF, JPEG, - * GIF, or PNG files. Call the load() method to load the asset - * as a child of the Loader instance. You can then add the Loader object to - * the display list(for instance, by using the addChild() - * method of a DisplayObjectContainer instance). The asset appears on the - * Stage as it loads. - * - *

You can also use a Loader instance "offlist," that is without adding it - * to a display object container on the display list. In this mode, the - * Loader instance might be used to load a SWF file that contains additional - * modules of an application.

- * - *

To detect when the SWF file is finished loading, you can use the events - * of the LoaderInfo object associated with the - * contentLoaderInfo property of the Loader object. At that - * point, the code in the module SWF file can be executed to initialize and - * start the module. In the offlist mode, a Loader instance might also be - * used to load a SWF file that contains components or media assets. Again, - * you can use the LoaderInfo object event notifications to detect when the - * components are finished loading. At that point, the application can start - * using the components and media assets in the library of the SWF file by - * instantiating the ActionScript 3.0 classes that represent those components - * and assets.

- * - *

To determine the status of a Loader object, monitor the following - * events that the LoaderInfo object associated with the - * contentLoaderInfo property of the Loader object:

- * - *
    - *
  • The open event is dispatched when loading begins.
  • - *
  • The ioError or securityError event is - * dispatched if the file cannot be loaded or if an error occured during the - * load process.
  • - *
  • The progress event fires continuously while the file is - * being loaded.
  • - *
  • The complete event is dispatched when a file completes - * downloading, but before the loaded movie clip's methods and properties are - * available.
  • - *
  • The init event is dispatched after the properties and - * methods of the loaded SWF file are accessible, so you can begin - * manipulating the loaded SWF file. This event is dispatched before the - * complete handler. In streaming SWF files, the - * init event can occur significantly earlier than the - * complete event. For most purposes, use the init - * handler.
  • - *
- */ - constructor(useAssetLibrary?: boolean, assetLibraryId?: string); - /** - * Cancels a load() method operation that is currently in - * progress for the Loader instance. - * - */ - public close(): void; - /** - * Loads a SWF, JPEG, progressive JPEG, unanimated GIF, or PNG file into an - * object that is a child of this Loader object. If you load an animated GIF - * file, only the first frame is displayed. As the Loader object can contain - * only a single child, issuing a subsequent load() request - * terminates the previous request, if still pending, and commences a new - * load. - * - *

Note: In AIR 1.5 and Flash Player 10, the maximum size for a - * loaded image is 8,191 pixels in width or height, and the total number of - * pixels cannot exceed 16,777,215 pixels.(So, if an loaded image is 8,191 - * pixels wide, it can only be 2,048 pixels high.) In Flash Player 9 and - * earlier and AIR 1.1 and earlier, the limitation is 2,880 pixels in height - * and 2,880 pixels in width.

- * - *

A SWF file or image loaded into a Loader object inherits the position, - * rotation, and scale properties of the parent display objects of the Loader - * object.

- * - *

Use the unload() method to remove movies or images loaded - * with this method, or to cancel a load operation that is in progress.

- * - *

You can prevent a SWF file from using this method by setting the - * allowNetworking parameter of the the object and - * embed tags in the HTML page that contains the SWF - * content.

- * - *

When you use this method, consider the Flash Player security model, - * which is described in the Loader class description.

- * - *

In Flash Player 10 and later, if you use a multipart Content-Type(for - * example "multipart/form-data") that contains an upload(indicated by a - * "filename" parameter in a "content-disposition" header within the POST - * body), the POST operation is subject to the security rules applied to - * uploads:

- * - *
    - *
  • The POST operation must be performed in response to a user-initiated - * action, such as a mouse click or key press.
  • - *
  • If the POST operation is cross-domain(the POST target is not on the - * same server as the SWF file that is sending the POST request), the target - * server must provide a URL policy file that permits cross-domain - * access.
  • - *
- * - *

Also, for any multipart Content-Type, the syntax must be valid - * (according to the RFC2046 standard). If the syntax appears to be invalid, - * the POST operation is subject to the security rules applied to - * uploads.

- * - *

For more information related to security, see the Flash Player - * Developer Center Topic: Security.

- * - * @param request The absolute or relative URL of the SWF, JPEG, GIF, or PNG - * file to be loaded. A relative path must be relative to the - * main SWF file. Absolute URLs must include the protocol - * reference, such as http:// or file:///. Filenames cannot - * include disk drive specifications. - * @param context A LoaderContext object, which has properties that define - * the following: - *
    - *
  • Whether or not to check for the existence of a policy - * file upon loading the object
  • - *
  • The ApplicationDomain for the loaded object
  • - *
  • The SecurityDomain for the loaded object
  • - *
  • The ImageDecodingPolicy for the loaded image - * object
  • - *
- * - *

If the context parameter is not specified - * or refers to a null object, the loaded content remains in - * its own security domain.

- * - *

For complete details, see the description of the - * properties in the LoaderContext - * class.

- * @param ns An optional namespace string under which the file is to be - * loaded, allowing the differentiation of two resources with - * identical assets. - * @param parser An optional parser object for translating the loaded data - * into a usable resource. If not provided, AssetLoader will - * attempt to auto-detect the file type. - * @throws IOError The digest property of the - * request object is not - * null. You should only set the - * digest property of a URLRequest - * object when calling the - * URLLoader.load() method when - * loading a SWZ file(an Adobe platform - * component). - * @throws IllegalOperationError If the requestedContentParent - * property of the context - * parameter is a Loader. - * @throws IllegalOperationError If the LoaderContext.parameters - * parameter is set to non-null and has some - * values which are not Strings. - * @throws SecurityError The value of - * LoaderContext.securityDomain - * must be either null or - * SecurityDomain.currentDomain. - * This reflects the fact that you can only - * place the loaded media in its natural - * security sandbox or your own(the latter - * requires a policy file). - * @throws SecurityError Local SWF files may not set - * LoaderContext.securityDomain to anything - * other than null. It is not - * permitted to import non-local media into a - * local sandbox, or to place other local media - * in anything other than its natural sandbox. - * @throws SecurityError You cannot connect to commonly reserved - * ports. For a complete list of blocked ports, - * see "Restricting Networking APIs" in the - * ActionScript 3.0 Developer's Guide. - * @throws SecurityError If the applicationDomain or - * securityDomain properties of - * the context parameter are from - * a disallowed domain. - * @throws SecurityError If a local SWF file is attempting to use the - * securityDomain property of the - * context parameter. - * @event asyncError Dispatched by the contentLoaderInfo - * object if the - * LoaderContext.requestedContentParent - * property has been specified and it is not possible to - * add the loaded content as a child to the specified - * DisplayObjectContainer. This could happen if the - * loaded content is a - * flash.display.AVM1Movie or if the - * addChild() call to the - * requestedContentParent throws an error. - * @event complete Dispatched by the contentLoaderInfo - * object when the file has completed loading. The - * complete event is always dispatched - * after the init event. - * @event httpStatus Dispatched by the contentLoaderInfo - * object when a network request is made over HTTP and - * Flash Player can detect the HTTP status code. - * @event init Dispatched by the contentLoaderInfo - * object when the properties and methods of the loaded - * SWF file are accessible. The init event - * always precedes the complete event. - * @event ioError Dispatched by the contentLoaderInfo - * object when an input or output error occurs that - * causes a load operation to fail. - * @event open Dispatched by the contentLoaderInfo - * object when the loading operation starts. - * @event progress Dispatched by the contentLoaderInfo - * object as data is received while load operation - * progresses. - * @event securityError Dispatched by the contentLoaderInfo - * object if a SWF file in the local-with-filesystem - * sandbox attempts to load content in the - * local-with-networking sandbox, or vice versa. - * @event securityError Dispatched by the contentLoaderInfo - * object if the - * LoaderContext.requestedContentParent - * property has been specified and the security sandbox - * of the - * LoaderContext.requestedContentParent - * does not have access to the loaded SWF. - * @event unload Dispatched by the contentLoaderInfo - * object when a loaded object is removed. - */ - public load(request: net.URLRequest, context?: library.AssetLoaderContext, ns?: string, parser?: parsers.ParserBase): library.AssetLoaderToken; - /** - * Loads from binary data stored in a ByteArray object. - * - *

The loadBytes() method is asynchronous. You must wait for - * the "init" event before accessing the properties of a loaded object.

- * - *

When you use this method, consider the Flash Player security model, - * which is described in the Loader class description.

- * - * @param bytes A ByteArray object. The contents of the ByteArray can be - * any of the file formats supported by the Loader class: SWF, - * GIF, JPEG, or PNG. - * @param context A LoaderContext object. Only the - * applicationDomain property of the - * LoaderContext object applies; the - * checkPolicyFile and - * securityDomain properties of the LoaderContext - * object do not apply. - * - *

If the context parameter is not specified - * or refers to a null object, the content is loaded into the - * current security domain - a process referred to as "import - * loading" in Flash Player security documentation. - * Specifically, if the loading SWF file trusts the remote SWF - * by incorporating the remote SWF into its code, then the - * loading SWF can import it directly into its own security - * domain.

- * - *

For more information related to security, see the Flash - * Player Developer Center Topic: Security.

- * @throws ArgumentError If the length property of the - * ByteArray object is not greater than 0. - * @throws IllegalOperationError If the checkPolicyFile or - * securityDomain property of the - * context parameter are non-null. - * @throws IllegalOperationError If the requestedContentParent - * property of the context - * parameter is a Loader. - * @throws IllegalOperationError If the LoaderContext.parameters - * parameter is set to non-null and has some - * values which are not Strings. - * @throws SecurityError If the provided - * applicationDomain property of - * the context property is from a - * disallowed domain. - * @throws SecurityError You cannot connect to commonly reserved - * ports. For a complete list of blocked ports, - * see "Restricting Networking APIs" in the - * ActionScript 3.0 Developer's Guide. - * @event asyncError Dispatched by the contentLoaderInfo - * object if the - * LoaderContext.requestedContentParent - * property has been specified and it is not possible to - * add the loaded content as a child to the specified - * DisplayObjectContainer. This could happen if the - * loaded content is a - * flash.display.AVM1Movie or if the - * addChild() call to the - * requestedContentParent throws an error. - * @event complete Dispatched by the contentLoaderInfo - * object when the operation is complete. The - * complete event is always dispatched - * after the init event. - * @event init Dispatched by the contentLoaderInfo - * object when the properties and methods of the loaded - * data are accessible. The init event - * always precedes the complete event. - * @event ioError Dispatched by the contentLoaderInfo - * object when the runtime cannot parse the data in the - * byte array. - * @event open Dispatched by the contentLoaderInfo - * object when the operation starts. - * @event progress Dispatched by the contentLoaderInfo - * object as data is transfered in memory. - * @event securityError Dispatched by the contentLoaderInfo - * object if the - * LoaderContext.requestedContentParent - * property has been specified and the security sandbox - * of the - * LoaderContext.requestedContentParent - * does not have access to the loaded SWF. - * @event unload Dispatched by the contentLoaderInfo - * object when a loaded object is removed. - */ - public loadData(data: any, context?: library.AssetLoaderContext, ns?: string, parser?: parsers.ParserBase): library.AssetLoaderToken; - /** - * Removes a child of this Loader object that was loaded by using the - * load() method. The property of the associated - * LoaderInfo object is reset to null. The child is not - * necessarily destroyed because other objects might have references to it; - * however, it is no longer a child of the Loader object. - * - *

As a best practice, before you unload a child SWF file, you should - * explicitly close any streams in the child SWF file's objects, such as - * LocalConnection, NetConnection, NetStream, and Sound objects. Otherwise, - * audio in the child SWF file might continue to play, even though the child - * SWF file was unloaded. To close streams in the child SWF file, add an - * event listener to the child that listens for the unload - * event. When the parent calls Loader.unload(), the - * unload event is dispatched to the child. The following code - * shows how you might do this:

- *
 public closeAllStreams(evt:Event) {
-        * myNetStream.close(); mySound.close(); myNetConnection.close();
-        * myLocalConnection.close(); }
-        * myMovieClip.loaderInfo.addEventListener(Event.UNLOAD,
-        * closeAllStreams);
- * - */ - public unload(): void; - /** - * Enables a specific parser. - * When no specific parser is set for a loading/parsing opperation, - * loader3d can autoselect the correct parser to use. - * A parser must have been enabled, to be considered when autoselecting the parser. - * - * @param parserClass The parser class to enable. - * @see away.parsers.Parsers - */ - static enableParser(parserClass: Object): void; - /** - * Enables a list of parsers. - * When no specific parser is set for a loading/parsing opperation, - * loader3d can autoselect the correct parser to use. - * A parser must have been enabled, to be considered when autoselecting the parser. - * - * @param parserClasses A Vector of parser classes to enable. - * @see away.parsers.Parsers - */ - static enableParsers(parserClasses: Object[]): void; - private removeListeners(dispatcher); - private onAssetComplete(event); - /** - * Called when an error occurs during loading - */ - private onLoadError(event); - /** - * Called when a an error occurs during parsing - */ - private onParseError(event); - /** - * Called when the resource and all of its dependencies was retrieved. - */ - private onResourceComplete(event); - } -} -declare module away.containers { - class Scene extends events.EventDispatcher { - private _expandedPartitions; - private _partitions; - public _iSceneGraphRoot: DisplayObjectContainer; - public _iCollectionMark: number; - constructor(); - public traversePartitions(traverser: traverse.ICollector): void; - public partition : partition.Partition; - public contains(child: base.DisplayObject): boolean; - public addChild(child: base.DisplayObject): base.DisplayObject; - public removeChild(child: base.DisplayObject): void; - public removeChildAt(index: number): void; - public getChildAt(index: number): base.DisplayObject; - public numChildren : number; - /** - * @internal - */ - public iRegisterEntity(displayObject: base.DisplayObject): void; - /** - * @internal - */ - public iRegisterPartition(partition: partition.Partition): void; - /** - * @internal - */ - public iUnregisterEntity(displayObject: base.DisplayObject): void; - /** - * @internal - */ - public iUnregisterPartition(partition: partition.Partition): void; - } -} -declare module away.containers { - class View { - public _pScene: Scene; - public _pCamera: entities.Camera; - public _pEntityCollector: traverse.ICollector; - public _pRenderer: render.IRenderer; - private _aspectRatio; - private _width; - private _height; - private _time; - private _deltaTime; - private _backgroundColor; - private _backgroundAlpha; - private _viewportDirty; - private _scissorDirty; - private _onScenePartitionChangedDelegate; - private _onProjectionChangedDelegate; - private _onViewportUpdatedDelegate; - private _onScissorUpdatedDelegate; - private _mouseManager; - private _mousePicker; - private _htmlElement; - private _shareContext; - public _pMouseX: number; - public _pMouseY: number; - constructor(renderer: render.IRenderer, scene?: Scene, camera?: entities.Camera); - /** - * - * @param e - */ - private onScenePartitionChanged(e); - public layeredView: boolean; - public mouseX : number; - public mouseY : number; - /** - * - */ - public htmlElement : HTMLDivElement; - /** - * - */ - public renderer : render.IRenderer; - /** - * - */ - public shareContext : boolean; - /** - * - */ - public backgroundColor : number; - /** - * - * @returns {number} - */ - /** - * - * @param value - */ - public backgroundAlpha : number; - /** - * - * @returns {Camera3D} - */ - /** - * Set camera that's used to render the scene for this viewport - */ - public camera : entities.Camera; - /** - * - * @returns {away.containers.Scene3D} - */ - /** - * Set the scene that's used to render for this viewport - */ - public scene : Scene; - /** - * - * @returns {number} - */ - public deltaTime : number; - /** - * - */ - public width : number; - /** - * - */ - public height : number; - /** - * - */ - public mousePicker : pick.IPicker; - /** - * - */ - public x : number; - /** - * - */ - public y : number; - /** - * - */ - public visible : boolean; - /** - * - * @returns {number} - */ - public renderedFacesCount : number; - /** - * Renders the view. - */ - public render(): void; - /** - * - */ - public pUpdateTime(): void; - /** - * - */ - public dispose(): void; - /** - * - */ - public iEntityCollector : traverse.ICollector; - /** - * - */ - private onProjectionChanged(event); - /** - * - */ - private onViewportUpdated(event); - /** - * - */ - private onScissorUpdated(event); - public project(point3d: geom.Vector3D): geom.Vector3D; - public unproject(sX: number, sY: number, sZ: number): geom.Vector3D; - public getRay(sX: number, sY: number, sZ: number): geom.Vector3D; - public forceMouseMove: boolean; - public updateCollider(): void; - } -} -declare module away.controllers { - class ControllerBase { - public _pAutoUpdate: boolean; - public _pTargetObject: base.DisplayObject; - constructor(targetObject?: base.DisplayObject); - public pNotifyUpdate(): void; - public targetObject : base.DisplayObject; - public autoUpdate : boolean; - public update(interpolate?: boolean): void; - } -} -declare module away.controllers { - class LookAtController extends ControllerBase { - public _pLookAtPosition: geom.Vector3D; - public _pLookAtObject: base.DisplayObject; - public _pOrigin: geom.Vector3D; - private _onLookAtObjectChangedDelegate; - constructor(targetObject?: base.DisplayObject, lookAtObject?: base.DisplayObject); - public lookAtPosition : geom.Vector3D; - public lookAtObject : base.DisplayObject; - public update(interpolate?: boolean): void; - private onLookAtObjectChanged(event); - } -} -declare module away.controllers { - /** - * Extended camera used to hover round a specified target object. - * - * @see away.containers.View - */ - class HoverController extends LookAtController { - public _iCurrentPanAngle: number; - public _iCurrentTiltAngle: number; - private _panAngle; - private _tiltAngle; - private _distance; - private _minPanAngle; - private _maxPanAngle; - private _minTiltAngle; - private _maxTiltAngle; - private _steps; - private _yFactor; - private _wrapPanAngle; - private _upAxis; - /** - * Fractional step taken each time the hover() method is called. Defaults to 8. - * - * Affects the speed at which the tiltAngle and panAngle resolve to their targets. - * - * @see #tiltAngle - * @see #panAngle - */ - public steps : number; - /** - * Rotation of the camera in degrees around the y axis. Defaults to 0. - */ - public panAngle : number; - /** - * Elevation angle of the camera in degrees. Defaults to 90. - */ - public tiltAngle : number; - /** - * Distance between the camera and the specified target. Defaults to 1000. - */ - public distance : number; - /** - * Minimum bounds for the panAngle. Defaults to -Infinity. - * - * @see #panAngle - */ - public minPanAngle : number; - /** - * Maximum bounds for the panAngle. Defaults to Infinity. - * - * @see #panAngle - */ - public maxPanAngle : number; - /** - * Minimum bounds for the tiltAngle. Defaults to -90. - * - * @see #tiltAngle - */ - public minTiltAngle : number; - /** - * Maximum bounds for the tiltAngle. Defaults to 90. - * - * @see #tiltAngle - */ - public maxTiltAngle : number; - /** - * Fractional difference in distance between the horizontal camera orientation and vertical camera orientation. Defaults to 2. - * - * @see #distance - */ - public yFactor : number; - /** - * Defines whether the value of the pan angle wraps when over 360 degrees or under 0 degrees. Defaults to false. - */ - public wrapPanAngle : boolean; - /** - * Creates a new HoverController object. - */ - constructor(targetObject?: base.DisplayObject, lookAtObject?: base.DisplayObject, panAngle?: number, tiltAngle?: number, distance?: number, minTiltAngle?: number, maxTiltAngle?: number, minPanAngle?: number, maxPanAngle?: number, steps?: number, yFactor?: number, wrapPanAngle?: boolean); - /** - * Updates the current tilt angle and pan angle values. - * - * Values are calculated using the defined tiltAngle, panAngle and steps variables. - * - * @param interpolate If the update to a target pan- or tiltAngle is interpolated. Default is true. - * - * @see #tiltAngle - * @see #panAngle - * @see #steps - */ - public update(interpolate?: boolean): void; - } -} -declare module away.controllers { - /** - * Extended camera used to hover round a specified target object. - * - * @see away3d.containers.View3D - */ - class FirstPersonController extends ControllerBase { - public _iCurrentPanAngle: number; - public _iCurrentTiltAngle: number; - private _panAngle; - private _tiltAngle; - private _minTiltAngle; - private _maxTiltAngle; - private _steps; - private _walkIncrement; - private _strafeIncrement; - private _wrapPanAngle; - public fly: boolean; - /** - * Fractional step taken each time the hover() method is called. Defaults to 8. - * - * Affects the speed at which the tiltAngle and panAngle resolve to their targets. - * - * @see #tiltAngle - * @see #panAngle - */ - public steps : number; - /** - * Rotation of the camera in degrees around the y axis. Defaults to 0. - */ - public panAngle : number; - /** - * Elevation angle of the camera in degrees. Defaults to 90. - */ - public tiltAngle : number; - /** - * Minimum bounds for the tiltAngle. Defaults to -90. - * - * @see #tiltAngle - */ - public minTiltAngle : number; - /** - * Maximum bounds for the tiltAngle. Defaults to 90. - * - * @see #tiltAngle - */ - public maxTiltAngle : number; - /** - * Defines whether the value of the pan angle wraps when over 360 degrees or under 0 degrees. Defaults to false. - */ - public wrapPanAngle : boolean; - /** - * Creates a new HoverController object. - */ - constructor(targetObject?: base.DisplayObject, panAngle?: number, tiltAngle?: number, minTiltAngle?: number, maxTiltAngle?: number, steps?: number, wrapPanAngle?: boolean); - /** - * Updates the current tilt angle and pan angle values. - * - * Values are calculated using the defined tiltAngle, panAngle and steps variables. - * - * @param interpolate If the update to a target pan- or tiltAngle is interpolated. Default is true. - * - * @see #tiltAngle - * @see #panAngle - * @see #steps - */ - public update(interpolate?: boolean): void; - public incrementWalk(val: number): void; - public incrementStrafe(val: number): void; - } -} -declare module away.controllers { - /** - * Controller used to follow behind an object on the XZ plane, with an optional - * elevation (tiltAngle). - * - * @see away3d.containers.View3D - */ - class FollowController extends HoverController { - constructor(targetObject?: base.DisplayObject, lookAtObject?: base.DisplayObject, tiltAngle?: number, distance?: number); - public update(interpolate?: boolean): void; - } -} -declare module away.controllers { - /** - * Uses spring physics to animate the target object towards a position that is - * defined as the lookAtTarget object's position plus the vector defined by the - * positionOffset property. - */ - class SpringController extends LookAtController { - private _velocity; - private _dv; - private _stretch; - private _force; - private _acceleration; - private _desiredPosition; - /** - * Stiffness of the spring, how hard is it to extend. The higher it is, the more "fixed" the cam will be. - * A number between 1 and 20 is recommended. - */ - public stiffness: number; - /** - * Damping is the spring internal friction, or how much it resists the "boinggggg" effect. Too high and you'll lose it! - * A number between 1 and 20 is recommended. - */ - public damping: number; - /** - * Mass of the camera, if over 120 and it'll be very heavy to move. - */ - public mass: number; - /** - * Offset of spring center from target in target object space, ie: Where the camera should ideally be in the target object space. - */ - public positionOffset: geom.Vector3D; - constructor(targetObject?: base.DisplayObject, lookAtObject?: base.DisplayObject, stiffness?: number, mass?: number, damping?: number); - public update(interpolate?: boolean): void; - } -} -declare module away.materials { - /** - * LightPickerBase provides an abstract base clase for light picker classes. These classes are responsible for - * feeding materials with relevant lights. Usually, StaticLightPicker can be used, but LightPickerBase can be - * extended to provide more application-specific dynamic selection of lights. - * - * @see StaticLightPicker - */ - class LightPickerBase extends library.NamedAssetBase implements library.IAsset { - public _pNumPointLights: number; - public _pNumDirectionalLights: number; - public _pNumCastingPointLights: number; - public _pNumCastingDirectionalLights: number; - public _pNumLightProbes: number; - public _pAllPickedLights: base.LightBase[]; - public _pPointLights: entities.PointLight[]; - public _pCastingPointLights: entities.PointLight[]; - public _pDirectionalLights: entities.DirectionalLight[]; - public _pCastingDirectionalLights: entities.DirectionalLight[]; - public _pLightProbes: entities.LightProbe[]; - public _pLightProbeWeights: number[]; - /** - * Creates a new LightPickerBase object. - */ - constructor(); - /** - * Disposes resources used by the light picker. - */ - public dispose(): void; - /** - * @inheritDoc - */ - public assetType : string; - /** - * The maximum amount of directional lights that will be provided. - */ - public numDirectionalLights : number; - /** - * The maximum amount of point lights that will be provided. - */ - public numPointLights : number; - /** - * The maximum amount of directional lights that cast shadows. - */ - public numCastingDirectionalLights : number; - /** - * The amount of point lights that cast shadows. - */ - public numCastingPointLights : number; - /** - * The maximum amount of light probes that will be provided. - */ - public numLightProbes : number; - /** - * The collected point lights to be used for shading. - */ - public pointLights : entities.PointLight[]; - /** - * The collected directional lights to be used for shading. - */ - public directionalLights : entities.DirectionalLight[]; - /** - * The collected point lights that cast shadows to be used for shading. - */ - public castingPointLights : entities.PointLight[]; - /** - * The collected directional lights that cast shadows to be used for shading. - */ - public castingDirectionalLights : entities.DirectionalLight[]; - /** - * The collected light probes to be used for shading. - */ - public lightProbes : entities.LightProbe[]; - /** - * The weights for each light probe, defining their influence on the object. - */ - public lightProbeWeights : number[]; - /** - * A collection of all the collected lights. - */ - public allPickedLights : base.LightBase[]; - /** - * Updates set of lights for a given renderable and EntityCollector. Always call super.collectLights() after custom overridden code. - */ - public collectLights(renderable: pool.IRenderable): void; - /** - * Updates the weights for the light probes, based on the renderable's position relative to them. - * @param renderable The renderble for which to calculate the light probes' influence. - */ - private updateProbeWeights(renderable); - } -} -declare module away.materials { - /** - * StaticLightPicker is a light picker that provides a static set of lights. The lights can be reassigned, but - * if the configuration changes (number of directional lights, point lights, etc), a material recompilation may - * occur. - */ - class StaticLightPicker extends LightPickerBase { - private _lights; - private _onCastShadowChangeDelegate; - /** - * Creates a new StaticLightPicker object. - * @param lights The lights to be used for shading. - */ - constructor(lights: any); - /** - * The lights used for shading. - */ - public lights : any[]; - /** - * Remove configuration change listeners on the lights. - */ - private clearListeners(); - /** - * Notifies the material of a configuration change. - */ - private onCastShadowChange(event); - /** - * Called when a directional light's shadow casting configuration changes. - */ - private updateDirectionalCasting(light); - /** - * Called when a point light's shadow casting configuration changes. - */ - private updatePointCasting(light); - } -} -declare module away.materials { - /** - * MaterialPassBase provides an abstract base class for material shader passes. A material pass constitutes at least - * a render call per required renderable. - */ - interface IMaterialPass extends events.IEventDispatcher { - /** - * Cleans up any resources used by the current object. - * @param deep Indicates whether other resources should be cleaned up, that could potentially be shared across different instances. - */ - dispose(): any; - /** - * Renders an object to the current render target. - * - * @private - */ - _iRender(pass: pool.IMaterialPassData, renderable: pool.IRenderable, stage: base.Stage, camera: entities.Camera, viewProjection: geom.Matrix3D): any; - /** - * Sets the render state for the pass that is independent of the rendered object. This needs to be called before - * calling renderPass. Before activating a pass, the previously used pass needs to be deactivated. - * @param stage The Stage object which is currently used for rendering. - * @param camera The camera from which the scene is viewed. - * @private - */ - _iActivate(pass: pool.IMaterialPassData, stage: base.Stage, camera: entities.Camera): any; - /** - * Clears the render state for the pass. This needs to be called before activating another pass. - * @param stage The Stage used for rendering - * - * @private - */ - _iDeactivate(pass: pool.IMaterialPassData, stage: base.Stage): any; - /** - * The light picker used by the material to provide lights to the material if it supports lighting. - * - * @see away.materials.LightPickerBase - * @see away.materials.StaticLightPicker - */ - lightPicker: LightPickerBase; - } -} -declare module away.materials { - /** - * Enumeration class for defining which lighting types affect the specific material - * lighting component (diffuse and specular). This can be useful if, for example, you - * want to use light probes for diffuse global lighting, but want specular reflections from - * traditional light sources without those affecting the diffuse light. - * - * @see away.materials.ColorMaterial.diffuseLightSources - * @see away.materials.ColorMaterial.specularLightSources - * @see away.materials.TextureMaterial.diffuseLightSources - * @see away.materials.TextureMaterial.specularLightSources - */ - class LightSources { - /** - * Defines normal lights are to be used as the source for the lighting - * component. - */ - static LIGHTS: number; - /** - * Defines that global lighting probes are to be used as the source for the - * lighting component. - */ - static PROBES: number; - /** - * Defines that both normal and global lighting probes are to be used as the - * source for the lighting component. This is equivalent to LightSources.LIGHTS | LightSources.PROBES. - */ - static ALL: number; - } -} -declare module away.materials { - /** - * MaterialBase forms an abstract base class for any material. - * A material consists of several passes, each of which constitutes at least one render call. Several passes could - * be used for special effects (render lighting for many lights in several passes, render an outline in a separate - * pass) or to provide additional render-to-texture passes (rendering diffuse light to texture for texture-space - * subsurface scattering, or rendering a depth map for specialized self-shadowing). - * - * Away3D provides default materials trough SinglePassMaterialBase and TriangleMaterial, which use modular - * methods to build the shader code. MaterialBase can be extended to build specific and high-performant custom - * shaders, or entire new material frameworks. - */ - class MaterialBase extends library.NamedAssetBase implements library.IAsset { - private _materialPassData; - private _materialData; - public _pAlphaThreshold: number; - public _pAnimateUVs: boolean; - private _enableLightFallOff; - private _specularLightSources; - private _diffuseLightSources; - /** - * An object to contain any extra data. - */ - public extra: Object; - /** - * A value that can be used by materials that only work with a given type of renderer. The renderer can test the - * classification to choose which render path to use. For example, a deferred material could set this value so - * that the deferred renderer knows not to take the forward rendering path. - * - * @private - */ - public _iClassification: string; - /** - * An id for this material used to sort the renderables by shader program, which reduces Program state changes. - * - * @private - */ - public _iMaterialId: number; - public _iBaseScreenPassIndex: number; - private _bothSides; - private _animationSet; - public _pScreenPassesInvalid: boolean; - /** - * A list of material owners, renderables or custom Entities. - */ - private _owners; - private _alphaPremultiplied; - public _pBlendMode: string; - private _numPasses; - private _passes; - private _mipmap; - private _smooth; - private _repeat; - private _color; - public _pTexture: textures.Texture2DBase; - public _pLightPicker: LightPickerBase; - public _pHeight: number; - public _pWidth: number; - public _pRequiresBlending: boolean; - private _onPassChangeDelegate; - private _onLightChangeDelegate; - /** - * Creates a new MaterialBase object. - */ - constructor(); - /** - * @inheritDoc - */ - public assetType : string; - /** - * - */ - public height : number; - /** - * - */ - public animationSet : animators.IAnimationSet; - /** - * The light picker used by the material to provide lights to the material if it supports lighting. - * - * @see LightPickerBase - * @see StaticLightPicker - */ - public lightPicker : LightPickerBase; - /** - * Indicates whether or not any used textures should use mipmapping. Defaults to true. - */ - public mipmap : boolean; - /** - * Indicates whether or not any used textures should use smoothing. - */ - public smooth : boolean; - /** - * Indicates whether or not any used textures should be tiled. If set to false, texture samples are clamped to - * the texture's borders when the uv coordinates are outside the [0, 1] interval. - */ - public repeat : boolean; - /** - * The diffuse reflectivity color of the surface. - */ - public color : number; - /** - * The texture object to use for the albedo colour. - */ - public texture : textures.Texture2DBase; - /** - * Specifies whether or not the UV coordinates should be animated using a transformation matrix. - */ - public animateUVs : boolean; - /** - * Whether or not to use fallOff and radius properties for lights. This can be used to improve performance and - * compatibility for constrained mode. - */ - public enableLightFallOff : boolean; - /** - * Define which light source types to use for diffuse reflections. This allows choosing between regular lights - * and/or light probes for diffuse reflections. - * - * @see away3d.materials.LightSources - */ - public diffuseLightSources : number; - /** - * Define which light source types to use for specular reflections. This allows choosing between regular lights - * and/or light probes for specular reflections. - * - * @see away3d.materials.LightSources - */ - public specularLightSources : number; - /** - * Cleans up resources owned by the material, including passes. Textures are not owned by the material since they - * could be used by other materials and will not be disposed. - */ - public dispose(): void; - /** - * Defines whether or not the material should cull triangles facing away from the camera. - */ - public bothSides : boolean; - /** - * The blend mode to use when drawing this renderable. The following blend modes are supported: - *
    - *
  • BlendMode.NORMAL: No blending, unless the material inherently needs it
  • - *
  • BlendMode.LAYER: Force blending. This will draw the object the same as NORMAL, but without writing depth writes.
  • - *
  • BlendMode.MULTIPLY
  • - *
  • BlendMode.ADD
  • - *
  • BlendMode.ALPHA
  • - *
- */ - public blendMode : string; - /** - * Indicates whether visible textures (or other pixels) used by this material have - * already been premultiplied. Toggle this if you are seeing black halos around your - * blended alpha edges. - */ - public alphaPremultiplied : boolean; - /** - * The minimum alpha value for which pixels should be drawn. This is used for transparency that is either - * invisible or entirely opaque, often used with textures for foliage, etc. - * Recommended values are 0 to disable alpha, or 0.5 to create smooth edges. Default value is 0 (disabled). - */ - public alphaThreshold : number; - /** - * Indicates whether or not the material requires alpha blending during rendering. - */ - public requiresBlending : boolean; - /** - * - */ - public width : number; - /** - * Sets the render state for a pass that is independent of the rendered object. This needs to be called before - * calling renderPass. Before activating a pass, the previously used pass needs to be deactivated. - * @param pass The pass data to activate. - * @param stage The Stage object which is currently used for rendering. - * @param camera The camera from which the scene is viewed. - * @private - */ - public _iActivatePass(pass: pool.IMaterialPassData, stage: base.Stage, camera: entities.Camera): void; - /** - * Clears the render state for a pass. This needs to be called before activating another pass. - * @param pass The pass to deactivate. - * @param stage The Stage used for rendering - * - * @internal - */ - public _iDeactivatePass(pass: pool.IMaterialPassData, stage: base.Stage): void; - /** - * Renders the current pass. Before calling renderPass, activatePass needs to be called with the same index. - * @param pass The pass used to render the renderable. - * @param renderable The IRenderable object to draw. - * @param stage The Stage object used for rendering. - * @param entityCollector The EntityCollector object that contains the visible scene data. - * @param viewProjection The view-projection matrix used to project to the screen. This is not the same as - * camera.viewProjection as it includes the scaling factors when rendering to textures. - * - * @internal - */ - public _iRenderPass(pass: pool.IMaterialPassData, renderable: pool.IRenderable, stage: base.Stage, camera: entities.Camera, viewProjection: geom.Matrix3D): void; - /** - * Mark an IMaterialOwner as owner of this material. - * Assures we're not using the same material across renderables with different animations, since the - * Programs depend on animation. This method needs to be called when a material is assigned. - * - * @param owner The IMaterialOwner that had this material assigned - * - * @internal - */ - public iAddOwner(owner: base.IMaterialOwner): void; - /** - * Removes an IMaterialOwner as owner. - * @param owner - * - * @internal - */ - public iRemoveOwner(owner: base.IMaterialOwner): void; - /** - * A list of the IMaterialOwners that use this material - * - * @private - */ - public iOwners : base.IMaterialOwner[]; - /** - * The amount of passes used by the material. - * - * @private - */ - public _iNumScreenPasses(): number; - /** - * A list of the screen passes used in this material - * - * @private - */ - public _iScreenPasses : IMaterialPass[]; - /** - * Marks the shader programs for all passes as invalid, so they will be recompiled before the next use. - * - * @private - */ - public _pInvalidatePasses(): void; - /** - * Flags that the screen passes have become invalid and need possible re-ordering / adding / deleting - */ - public _pInvalidateScreenPasses(): void; - /** - * Removes a pass from the material. - * @param pass The pass to be removed. - */ - public _pRemoveScreenPass(pass: IMaterialPass): void; - /** - * Removes all passes from the material - */ - public _pClearScreenPasses(): void; - /** - * Adds a pass to the material - * @param pass - */ - public _pAddScreenPass(pass: IMaterialPass): void; - public _iAddMaterialData(materialData: pool.IMaterialData): pool.IMaterialData; - public _iRemoveMaterialData(materialData: pool.IMaterialData): pool.IMaterialData; - /** - * Performs any processing that needs to occur before any of its passes are used. - * - * @private - */ - public _iUpdateMaterial(): void; - /** - * Listener for when a pass's shader code changes. It recalculates the render order id. - */ - private onPassChange(event); - private invalidateAnimation(); - private invalidateMaterial(); - /** - * Called when the light picker's configuration changed. - */ - private onLightsChange(event); - public _iAddMaterialPassData(materialPassData: pool.IMaterialPassData): pool.IMaterialPassData; - public _iRemoveMaterialPassData(materialPassData: pool.IMaterialPassData): pool.IMaterialPassData; - } -} -declare module away.materials { - /** - * MaterialBase forms an abstract base class for any material. - * A material consists of several passes, each of which constitutes at least one render call. Several passes could - * be used for special effects (render lighting for many lights in several passes, render an outline in a separate - * pass) or to provide additional render-to-texture passes (rendering diffuse light to texture for texture-space - * subsurface scattering, or rendering a depth map for specialized self-shadowing). - * - * Away3D provides default materials trough SinglePassMaterialBase and MultiPassMaterialBase, which use modular - * methods to build the shader code. MaterialBase can be extended to build specific and high-performant custom - * shaders, or entire new material frameworks. - */ - class CSSMaterialBase extends MaterialBase { - private _sizeChanged; - private _imageElement; - private _imageStyle; - public imageElement : HTMLImageElement; - public imageStyle : MSStyleCSSProperties; - /** - * The texture object to use for the albedo colour. - */ - public texture : textures.Texture2DBase; - /** - * Creates a new MaterialBase object. - */ - constructor(texture?: textures.Texture2DBase, smooth?: boolean, repeat?: boolean); - private notifySizeChanged(); - } -} -declare module away.prefabs { - /** - * PrefabBase is an abstract base class for prefabs, which are prebuilt display objects that allow easy cloning and updating - */ - class PrefabBase extends library.NamedAssetBase { - public _pObjects: base.DisplayObject[]; - /** - * Creates a new PrefabBase object. - */ - constructor(); - /** - * Returns a display object generated from this prefab - */ - public getNewObject(): base.DisplayObject; - public _pCreateObject(): base.DisplayObject; - public _iValidate(): void; - } -} -declare module away.prefabs { - /** - * PrimitivePrefabBase is an abstract base class for polytope prefabs, which are simple pre-built geometric shapes - */ - class PrimitivePrefabBase extends PrefabBase { - public _geomDirty: boolean; - public _uvDirty: boolean; - private _material; - private _geometry; - private _subGeometry; - private _geometryType; - private _geometryTypeDirty; - /** - * - */ - public assetType : string; - /** - * - */ - public geometryType : string; - public geometry : base.Geometry; - /** - * The material with which to render the primitive. - */ - public material : materials.MaterialBase; - /** - * Creates a new PrimitivePrefabBase object. - * - * @param material The material with which to render the object - */ - constructor(material?: materials.MaterialBase, geometryType?: string); - /** - * Builds the primitive's geometry when invalid. This method should not be called directly. The calling should - * be triggered by the invalidateGeometry method (and in turn by updateGeometry). - */ - public _pBuildGeometry(target: base.SubGeometryBase, geometryType: string): void; - /** - * Builds the primitive's uv coordinates when invalid. This method should not be called directly. The calling - * should be triggered by the invalidateUVs method (and in turn by updateUVs). - */ - public _pBuildUVs(target: base.SubGeometryBase, geometryType: string): void; - /** - * Invalidates the primitive's geometry type, causing it to be updated when requested. - */ - public invalidateGeometryType(): void; - /** - * Invalidates the primitive's geometry, causing it to be updated when requested. - */ - public _pInvalidateGeometry(): void; - /** - * Invalidates the primitive's uv coordinates, causing them to be updated when requested. - */ - public _pInvalidateUVs(): void; - /** - * Updates the subgeometry when invalid. - */ - private updateGeometryType(); - /** - * Updates the geometry when invalid. - */ - private updateGeometry(); - /** - * Updates the uv coordinates when invalid. - */ - private updateUVs(); - public _iValidate(): void; - public _pCreateObject(): base.DisplayObject; - } -} -declare module away.prefabs { - /** - * A UV Cylinder primitive mesh. - */ - class PrimitiveTorusPrefab extends PrimitivePrefabBase implements library.IAsset { - private _radius; - private _tubeRadius; - private _segmentsR; - private _segmentsT; - private _yUp; - private _numVertices; - /** - * The radius of the torus. - */ - public radius : number; - /** - * The radius of the inner tube of the torus. - */ - public tubeRadius : number; - /** - * Defines the number of horizontal segments that make up the torus. Defaults to 16. - */ - public segmentsR : number; - /** - * Defines the number of vertical segments that make up the torus. Defaults to 8. - */ - public segmentsT : number; - /** - * Defines whether the torus poles should lay on the Y-axis (true) or on the Z-axis (false). - */ - public yUp : boolean; - /** - * Creates a new Torus object. - * @param radius The radius of the torus. - * @param tuebRadius The radius of the inner tube of the torus. - * @param segmentsR Defines the number of horizontal segments that make up the torus. - * @param segmentsT Defines the number of vertical segments that make up the torus. - * @param yUp Defines whether the torus poles should lay on the Y-axis (true) or on the Z-axis (false). - */ - constructor(radius?: number, tubeRadius?: number, segmentsR?: number, segmentsT?: number, yUp?: boolean); - /** - * @inheritDoc - */ - public _pBuildGeometry(target: base.SubGeometryBase, geometryType: string): void; - /** - * @inheritDoc - */ - public _pBuildUVs(target: base.SubGeometryBase, geometryType: string): void; - } -} -declare module away.prefabs { - /** - * A Cube primitive prefab. - */ - class PrimitiveCubePrefab extends PrimitivePrefabBase implements library.IAsset { - private _width; - private _height; - private _depth; - private _tile6; - private _segmentsW; - private _segmentsH; - private _segmentsD; - /** - * Creates a new Cube object. - * @param width The size of the cube along its X-axis. - * @param height The size of the cube along its Y-axis. - * @param depth The size of the cube along its Z-axis. - * @param segmentsW The number of segments that make up the cube along the X-axis. - * @param segmentsH The number of segments that make up the cube along the Y-axis. - * @param segmentsD The number of segments that make up the cube along the Z-axis. - * @param tile6 The type of uv mapping to use. When true, a texture will be subdivided in a 2x3 grid, each used for a single face. When false, the entire image is mapped on each face. - */ - constructor(width?: number, height?: number, depth?: number, segmentsW?: number, segmentsH?: number, segmentsD?: number, tile6?: boolean); - /** - * The size of the cube along its X-axis. - */ - public width : number; - /** - * The size of the cube along its Y-axis. - */ - public height : number; - /** - * The size of the cube along its Z-axis. - */ - public depth : number; - /** - * The type of uv mapping to use. When false, the entire image is mapped on each face. - * When true, a texture will be subdivided in a 3x2 grid, each used for a single face. - * Reading the tiles from left to right, top to bottom they represent the faces of the - * cube in the following order: bottom, top, back, left, front, right. This creates - * several shared edges (between the top, front, left and right faces) which simplifies - * texture painting. - */ - public tile6 : boolean; - /** - * The number of segments that make up the cube along the X-axis. Defaults to 1. - */ - public segmentsW : number; - /** - * The number of segments that make up the cube along the Y-axis. Defaults to 1. - */ - public segmentsH : number; - /** - * The number of segments that make up the cube along the Z-axis. Defaults to 1. - */ - public segmentsD : number; - /** - * @inheritDoc - */ - public _pBuildGeometry(target: base.SubGeometryBase, geometryType: string): void; - /** - * @inheritDoc - */ - public _pBuildUVs(target: base.SubGeometryBase, geometryType: string): void; - } -} -declare module away.prefabs { - /** - * A Plane primitive mesh. - */ - class PrimitivePlanePrefab extends PrimitivePrefabBase implements library.IAsset { - private _segmentsW; - private _segmentsH; - private _yUp; - private _width; - private _height; - private _doubleSided; - /** - * Creates a new Plane object. - * @param width The width of the plane. - * @param height The height of the plane. - * @param segmentsW The number of segments that make up the plane along the X-axis. - * @param segmentsH The number of segments that make up the plane along the Y or Z-axis. - * @param yUp Defines whether the normal vector of the plane should point along the Y-axis (true) or Z-axis (false). - * @param doubleSided Defines whether the plane will be visible from both sides, with correct vertex normals. - */ - constructor(width?: number, height?: number, segmentsW?: number, segmentsH?: number, yUp?: boolean, doubleSided?: boolean); - /** - * The number of segments that make up the plane along the X-axis. Defaults to 1. - */ - public segmentsW : number; - /** - * The number of segments that make up the plane along the Y or Z-axis, depending on whether yUp is true or - * false, respectively. Defaults to 1. - */ - public segmentsH : number; - /** - * Defines whether the normal vector of the plane should point along the Y-axis (true) or Z-axis (false). Defaults to true. - */ - public yUp : boolean; - /** - * Defines whether the plane will be visible from both sides, with correct vertex normals (as opposed to bothSides on Material). Defaults to false. - */ - public doubleSided : boolean; - /** - * The width of the plane. - */ - public width : number; - /** - * The height of the plane. - */ - public height : number; - /** - * @inheritDoc - */ - public _pBuildGeometry(target: base.SubGeometryBase, geometryType: string): void; - /** - * @inheritDoc - */ - public _pBuildUVs(target: base.SubGeometryBase, geometryType: string): void; - } -} -declare module away.prefabs { - /** - * A Capsule primitive mesh. - */ - class PrimitiveCapsulePrefab extends PrimitivePrefabBase implements library.IAsset { - private _radius; - private _height; - private _segmentsW; - private _segmentsH; - private _yUp; - private _numVertices; - /** - * The radius of the capsule. - */ - public radius : number; - /** - * The height of the capsule. - */ - public height : number; - /** - * Defines the number of horizontal segments that make up the capsule. Defaults to 16. - */ - public segmentsW : number; - /** - * Defines the number of vertical segments that make up the capsule. Defaults to 15. Must be uneven. - */ - public segmentsH : number; - /** - * Defines whether the capsule poles should lay on the Y-axis (true) or on the Z-axis (false). - */ - public yUp : boolean; - /** - * Creates a new Capsule object. - * @param radius The radius of the capsule. - * @param height The height of the capsule. - * @param segmentsW Defines the number of horizontal segments that make up the capsule. Defaults to 16. - * @param segmentsH Defines the number of vertical segments that make up the capsule. Defaults to 15. Must be uneven value. - * @param yUp Defines whether the capsule poles should lay on the Y-axis (true) or on the Z-axis (false). - */ - constructor(radius?: number, height?: number, segmentsW?: number, segmentsH?: number, yUp?: boolean); - /** - * @inheritDoc - */ - public _pBuildGeometry(target: base.SubGeometryBase, geometryType: string): void; - /** - * @inheritDoc - */ - public _pBuildUVs(target: base.SubGeometryBase, geometryType: string): void; - } -} -declare module away.prefabs { - /** - * A Cylinder primitive mesh. - */ - class PrimitiveCylinderPrefab extends PrimitivePrefabBase implements library.IAsset { - public _pBottomRadius: number; - public _pSegmentsW: number; - public _pSegmentsH: number; - private _topRadius; - private _height; - private _topClosed; - private _bottomClosed; - private _surfaceClosed; - private _yUp; - private _numVertices; - /** - * The radius of the top end of the cylinder. - */ - public topRadius : number; - /** - * The radius of the bottom end of the cylinder. - */ - public bottomRadius : number; - /** - * The radius of the top end of the cylinder. - */ - public height : number; - /** - * Defines the number of horizontal segments that make up the cylinder. Defaults to 16. - */ - public segmentsW : number; - public setSegmentsW(value: number): void; - /** - * Defines the number of vertical segments that make up the cylinder. Defaults to 1. - */ - public segmentsH : number; - public setSegmentsH(value: number): void; - /** - * Defines whether the top end of the cylinder is closed (true) or open. - */ - public topClosed : boolean; - /** - * Defines whether the bottom end of the cylinder is closed (true) or open. - */ - public bottomClosed : boolean; - /** - * Defines whether the cylinder poles should lay on the Y-axis (true) or on the Z-axis (false). - */ - public yUp : boolean; - /** - * Creates a new Cylinder object. - * @param topRadius The radius of the top end of the cylinder. - * @param bottomRadius The radius of the bottom end of the cylinder - * @param height The radius of the bottom end of the cylinder - * @param segmentsW Defines the number of horizontal segments that make up the cylinder. Defaults to 16. - * @param segmentsH Defines the number of vertical segments that make up the cylinder. Defaults to 1. - * @param topClosed Defines whether the top end of the cylinder is closed (true) or open. - * @param bottomClosed Defines whether the bottom end of the cylinder is closed (true) or open. - * @param yUp Defines whether the cone poles should lay on the Y-axis (true) or on the Z-axis (false). - */ - constructor(topRadius?: number, bottomRadius?: number, height?: number, segmentsW?: number, segmentsH?: number, topClosed?: boolean, bottomClosed?: boolean, surfaceClosed?: boolean, yUp?: boolean); - /** - * @inheritDoc - */ - public _pBuildGeometry(target: base.SubGeometryBase, geometryType: string): void; - /** - * @inheritDoc - */ - public _pBuildUVs(target: base.SubGeometryBase, geometryType: string): void; - } -} -declare module away.prefabs { - /** - * A UV Cone primitive mesh. - */ - class PrimitiveConePrefab extends PrimitiveCylinderPrefab implements library.IAsset { - /** - * The radius of the bottom end of the cone. - */ - public radius : number; - /** - * Creates a new Cone object. - * @param radius The radius of the bottom end of the cone - * @param height The height of the cone - * @param segmentsW Defines the number of horizontal segments that make up the cone. Defaults to 16. - * @param segmentsH Defines the number of vertical segments that make up the cone. Defaults to 1. - * @param yUp Defines whether the cone poles should lay on the Y-axis (true) or on the Z-axis (false). - */ - constructor(radius?: number, height?: number, segmentsW?: number, segmentsH?: number, closed?: boolean, yUp?: boolean); - } -} -declare module away.prefabs { - /** - * A UV RegularPolygon primitive mesh. - */ - class PrimitivePolygonPrefab extends PrimitiveCylinderPrefab implements library.IAsset { - /** - * The radius of the regular polygon. - */ - public radius : number; - /** - * The number of sides of the regular polygon. - */ - public sides : number; - /** - * The number of subdivisions from the edge to the center of the regular polygon. - */ - public subdivisions : number; - /** - * Creates a new RegularPolygon disc object. - * @param radius The radius of the regular polygon - * @param sides Defines the number of sides of the regular polygon. - * @param yUp Defines whether the regular polygon should lay on the Y-axis (true) or on the Z-axis (false). - */ - constructor(radius?: number, sides?: number, yUp?: boolean); - } -} -declare module away.prefabs { - /** - * A UV Sphere primitive mesh. - */ - class PrimitiveSpherePrefab extends PrimitivePrefabBase implements library.IAsset { - private _radius; - private _segmentsW; - private _segmentsH; - private _yUp; - /** - * The radius of the sphere. - */ - public radius : number; - /** - * Defines the number of horizontal segments that make up the sphere. Defaults to 16. - */ - public segmentsW : number; - /** - * Defines the number of vertical segments that make up the sphere. Defaults to 12. - */ - public segmentsH : number; - /** - * Defines whether the sphere poles should lay on the Y-axis (true) or on the Z-axis (false). - */ - public yUp : boolean; - /** - * Creates a new Sphere object. - * - * @param radius The radius of the sphere. - * @param segmentsW Defines the number of horizontal segments that make up the sphere. - * @param segmentsH Defines the number of vertical segments that make up the sphere. - * @param yUp Defines whether the sphere poles should lay on the Y-axis (true) or on the Z-axis (false). - */ - constructor(radius?: number, segmentsW?: number, segmentsH?: number, yUp?: boolean); - /** - * @inheritDoc - */ - public _pBuildGeometry(target: base.SubGeometryBase, geometryType: string): void; - /** - * @inheritDoc - */ - public _pBuildUVs(target: base.SubGeometryBase, geometryType: string): void; - } -} -declare module away.animators { - /** - * Provides an abstract base class for nodes in an animation blend tree. - */ - class AnimationNodeBase extends library.NamedAssetBase implements library.IAsset { - public _pStateClass: any; - public stateClass : any; - /** - * Creates a new AnimationNodeBase object. - */ - constructor(); - /** - * @inheritDoc - */ - public dispose(): void; - /** - * @inheritDoc - */ - public assetType : string; - } -} -declare module away.animators { - /** - * Provides an interface for data set classes that hold animation data for use in animator classes. - * - * @see away3d.animators.AnimatorBase - */ - interface IAnimationSet extends library.IAsset { - /** - * Check to determine whether a state is registered in the animation set under the given name. - * - * @param stateName The name of the animation state object to be checked. - */ - hasAnimation(name: string): boolean; - /** - * Retrieves the animation state object registered in the animation data set under the given name. - * - * @param stateName The name of the animation state object to be retrieved. - */ - getAnimation(name: string): AnimationNodeBase; - /** - * Indicates whether the properties of the animation data contained within the set combined with - * the vertex registers aslready in use on shading materials allows the animation data to utilise - * GPU calls. - */ - usesCPU: boolean; - /** - * Called by the material to reset the GPU indicator before testing whether register space in the shader - * is available for running GPU-based animation code. - * - * @private - */ - resetGPUCompatibility(): any; - /** - * Called by the animator to void the GPU indicator when register space in the shader - * is no longer available for running GPU-based animation code. - * - * @private - */ - cancelGPUCompatibility(): any; - } -} -declare module away.animators { - /** - * Provides an interface for animator classes that control animation output from a data set subtype of AnimationSetBase. - * - * @see away.animators.IAnimationSet - */ - interface IAnimator extends library.IAsset { - /** - * - */ - animationSet: IAnimationSet; - /** - * - */ - clone(): IAnimator; - /** - * - */ - dispose(): any; - /** - * Used by the entity object to which the animator is applied, registers the owner for internal use. - * - * @private - */ - addOwner(mesh: entities.IEntity): any; - /** - * Used by the mesh object from which the animator is removed, unregisters the owner for internal use. - * - * @private - */ - removeOwner(mesh: entities.IEntity): any; - /** - * //TODO - * - * @param sourceSubGeometry - */ - getRenderableSubGeometry(renderable: pool.IRenderable, sourceSubGeometry: base.SubGeometryBase): base.SubGeometryBase; - } -} -declare module away { - class AwayJSCore extends events.EventDispatcher { - constructor(); - } -} diff --git a/libs/awayjs-core.next.js b/libs/awayjs-core.next.js deleted file mode 100644 index 8f3114901..000000000 --- a/libs/awayjs-core.next.js +++ /dev/null @@ -1,34946 +0,0 @@ -/// -var away; -(function (away) { - (function (errors) { - var Error = (function () { - function Error(message, id, _name) { - if (typeof message === "undefined") { message = ''; } - if (typeof id === "undefined") { id = 0; } - if (typeof _name === "undefined") { _name = ''; } - this._errorID = 0; - this._messsage = ''; - this._name = ''; - this._messsage = message; - this._name = name; - this._errorID = id; - } - Object.defineProperty(Error.prototype, "message", { - /** - * - * @returns {string} - */ - get: function () { - return this._messsage; - }, - /** - * - * @param value - */ - set: function (value) { - this._messsage = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Error.prototype, "name", { - /** - * - * @returns {string} - */ - get: function () { - return this._name; - }, - /** - * - * @param value - */ - set: function (value) { - this._name = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Error.prototype, "errorID", { - /** - * - * @returns {number} - */ - get: function () { - return this._errorID; - }, - enumerable: true, - configurable: true - }); - return Error; - })(); - errors.Error = Error; - })(away.errors || (away.errors = {})); - var errors = away.errors; -})(away || (away = {})); -/// -var __extends = this.__extends || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); -}; -var away; -(function (away) { - (function (errors) { - /** - * AbstractMethodError is thrown when an abstract method is called. The method in question should be overridden - * by a concrete subclass. - */ - var ArgumentError = (function (_super) { - __extends(ArgumentError, _super); - /** - * Create a new ArgumentError. - * - * @param message An optional message to override the default error message. - * @param id The id of the error. - */ - function ArgumentError(message, id) { - if (typeof message === "undefined") { message = null; } - if (typeof id === "undefined") { id = 0; } - _super.call(this, message || "ArgumentError", id); - } - return ArgumentError; - })(away.errors.Error); - errors.ArgumentError = ArgumentError; - })(away.errors || (away.errors = {})); - var errors = away.errors; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (errors) { - var CastError = (function (_super) { - __extends(CastError, _super); - function CastError(message) { - _super.call(this, message); - } - return CastError; - })(errors.Error); - errors.CastError = CastError; - })(away.errors || (away.errors = {})); - var errors = away.errors; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (errors) { - /** - * AbstractMethodError is thrown when an abstract method is called. The method in question should be overridden - * by a concrete subclass. - */ - var PartialImplementationError = (function (_super) { - __extends(PartialImplementationError, _super); - /** - * Create a new AbstractMethodError. - * @param message An optional message to override the default error message. - * @param id The id of the error. - */ - function PartialImplementationError(dependency, id) { - if (typeof dependency === "undefined") { dependency = ''; } - if (typeof id === "undefined") { id = 0; } - _super.call(this, "PartialImplementationError - this function is in development. Required Dependency: " + dependency, id); - } - return PartialImplementationError; - })(errors.Error); - errors.PartialImplementationError = PartialImplementationError; - })(away.errors || (away.errors = {})); - var errors = away.errors; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (errors) { - /** - * AbstractMethodError is thrown when an abstract method is called. The method in question should be overridden - * by a concrete subclass. - */ - var AbstractMethodError = (function (_super) { - __extends(AbstractMethodError, _super); - /** - * Create a new AbstractMethodError. - * @param message An optional message to override the default error message. - * @param id The id of the error. - */ - function AbstractMethodError(message, id) { - if (typeof message === "undefined") { message = null; } - if (typeof id === "undefined") { id = 0; } - _super.call(this, message || "An abstract method was called! Either an instance of an abstract class was created, or an abstract method was not overridden by the subclass.", id); - } - return AbstractMethodError; - })(away.errors.Error); - errors.AbstractMethodError = AbstractMethodError; - })(away.errors || (away.errors = {})); - var errors = away.errors; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (errors) { - var DocumentError = (function (_super) { - __extends(DocumentError, _super); - function DocumentError(message, id) { - if (typeof message === "undefined") { message = "DocumentError"; } - if (typeof id === "undefined") { id = 0; } - _super.call(this, message, id); - } - DocumentError.DOCUMENT_DOES_NOT_EXIST = "documentDoesNotExist"; - return DocumentError; - })(errors.Error); - errors.DocumentError = DocumentError; - })(away.errors || (away.errors = {})); - var errors = away.errors; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (errors) { - /** - * RangeError is thrown when an index is accessed out of range of the number of - * available indices on an Array. - */ - var RangeError = (function (_super) { - __extends(RangeError, _super); - /** - * Create a new RangeError. - * - * @param message An optional message to override the default error message. - * @param id The id of the error. - */ - function RangeError(message, id) { - if (typeof message === "undefined") { message = null; } - if (typeof id === "undefined") { id = 0; } - _super.call(this, message || "RangeError", id); - } - return RangeError; - })(away.errors.Error); - errors.RangeError = RangeError; - })(away.errors || (away.errors = {})); - var errors = away.errors; -})(away || (away = {})); -var away; -(function (away) { - /** - * Base event class - * @class away.events.Event - */ - (function (events) { - var Event = (function () { - function Event(type) { - /** - * Type of event - * @property type - * @type String - */ - this.type = undefined; - /** - * Reference to target object - * @property target - * @type Object - */ - this.target = undefined; - this.type = type; - } - /** - * Clones the current event. - * @return An exact duplicate of the current event. - */ - Event.prototype.clone = function () { - return new Event(this.type); - }; - Event.COMPLETE = 'complete'; - Event.OPEN = 'open'; - - Event.ENTER_FRAME = 'enterFrame'; - Event.EXIT_FRAME = 'exitFrame'; - - Event.RESIZE = "resize"; - Event.ERROR = "error"; - Event.CHANGE = "change"; - return Event; - })(); - events.Event = Event; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (events) { - /** - * @class away.events.AssetEvent - */ - var AssetEvent = (function (_super) { - __extends(AssetEvent, _super); - /** - * - */ - function AssetEvent(type, asset, prevName) { - if (typeof asset === "undefined") { asset = null; } - if (typeof prevName === "undefined") { prevName = null; } - _super.call(this, type); - - this._asset = asset; - this._prevName = prevName || (this._asset ? this._asset.name : null); - } - Object.defineProperty(AssetEvent.prototype, "asset", { - /** - * - */ - get: function () { - return this._asset; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(AssetEvent.prototype, "assetPrevName", { - /** - * - */ - get: function () { - return this._prevName; - }, - enumerable: true, - configurable: true - }); - - /** - * - */ - AssetEvent.prototype.clone = function () { - return new away.events.AssetEvent(this.type, this.asset, this.assetPrevName); - }; - AssetEvent.ASSET_COMPLETE = "assetComplete"; - - AssetEvent.ASSET_RENAME = 'assetRename'; - - AssetEvent.ASSET_CONFLICT_RESOLVED = 'assetConflictResolved'; - - AssetEvent.TEXTURE_SIZE_ERROR = 'textureSizeError'; - return AssetEvent; - })(away.events.Event); - events.AssetEvent = AssetEvent; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.events - */ - (function (events) { - /** - * @class away.events.CameraEvent - */ - var CameraEvent = (function (_super) { - __extends(CameraEvent, _super); - function CameraEvent(type, camera) { - _super.call(this, type); - - this._camera = camera; - } - Object.defineProperty(CameraEvent.prototype, "camera", { - get: function () { - return this._camera; - }, - enumerable: true, - configurable: true - }); - CameraEvent.PROJECTION_CHANGED = "projectionChanged"; - return CameraEvent; - })(away.events.Event); - events.CameraEvent = CameraEvent; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -var away; -(function (away) { - /// - /** - * @module away.events - */ - (function (events) { - var DisplayObjectEvent = (function (_super) { - __extends(DisplayObjectEvent, _super); - function DisplayObjectEvent(type, object) { - _super.call(this, type); - this.object = object; - } - DisplayObjectEvent.VISIBLITY_UPDATED = "visiblityUpdated"; - DisplayObjectEvent.SCENETRANSFORM_CHANGED = "scenetransformChanged"; - DisplayObjectEvent.SCENE_CHANGED = "sceneChanged"; - DisplayObjectEvent.POSITION_CHANGED = "positionChanged"; - DisplayObjectEvent.ROTATION_CHANGED = "rotationChanged"; - DisplayObjectEvent.SCALE_CHANGED = "scaleChanged"; - return DisplayObjectEvent; - })(events.Event); - events.DisplayObjectEvent = DisplayObjectEvent; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.events - */ - (function (events) { - /** - * Base class for dispatching events - * - * @class away.events.EventDispatcher - * - */ - var EventDispatcher = (function () { - function EventDispatcher(target) { - if (typeof target === "undefined") { target = null; } - this.listeners = new Array(); - this.target = target || this; - } - /** - * Add an event listener - * @method addEventListener - * @param {String} Name of event to add a listener for - * @param {Function} Callback function - */ - EventDispatcher.prototype.addEventListener = function (type, listener) { - if (this.listeners[type] === undefined) - this.listeners[type] = new Array(); - - if (this.getEventListenerIndex(type, listener) === -1) - this.listeners[type].push(listener); - }; - - /** - * Remove an event listener - * @method removeEventListener - * @param {String} Name of event to remove a listener for - * @param {Function} Callback function - */ - EventDispatcher.prototype.removeEventListener = function (type, listener) { - var index = this.getEventListenerIndex(type, listener); - - if (index !== -1) - this.listeners[type].splice(index, 1); - }; - - /** - * Dispatch an event - * @method dispatchEvent - * @param {Event} Event to dispatch - */ - EventDispatcher.prototype.dispatchEvent = function (event) { - var listenerArray = this.listeners[event.type]; - - if (listenerArray !== undefined) { - var l = listenerArray.length; - - event.target = this.target; - - for (var i = 0; i < l; i++) - listenerArray[i](event); - } - }; - - /** - * get Event Listener Index in array. Returns -1 if no listener is added - * @method getEventListenerIndex - * @param {String} Name of event to remove a listener for - * @param {Function} Callback function - */ - EventDispatcher.prototype.getEventListenerIndex = function (type, listener) { - if (this.listeners[type] !== undefined) { - var a = this.listeners[type]; - var l = a.length; - - for (var i = 0; i < l; i++) - if (listener == a[i]) - return i; - } - - return -1; - }; - - /** - * check if an object has an event listener assigned to it - * @method hasListener - * @param {String} Name of event to remove a listener for - * @param {Function} Callback function - */ - EventDispatcher.prototype.hasEventListener = function (type, listener) { - if (listener != null) { - return (this.getEventListenerIndex(type, listener) !== -1); - } else { - if (this.listeners[type] !== undefined) - return (this.listeners[type].length > 0); - - return false; - } - - return false; - }; - return EventDispatcher; - })(); - events.EventDispatcher = EventDispatcher; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (events) { - /** - * Dispatched to notify changes in a geometry object's state. - * - * @class away.events.GeometryEvent - * @see away3d.core.base.Geometry - */ - var GeometryEvent = (function (_super) { - __extends(GeometryEvent, _super); - /** - * Create a new GeometryEvent - * @param type The event type. - * @param subGeometry An optional TriangleSubGeometry object that is the subject of this event. - */ - function GeometryEvent(type, subGeometry) { - if (typeof subGeometry === "undefined") { subGeometry = null; } - _super.call(this, type); - this._subGeometry = subGeometry; - } - Object.defineProperty(GeometryEvent.prototype, "subGeometry", { - /** - * The TriangleSubGeometry object that is the subject of this event, if appropriate. - */ - get: function () { - return this._subGeometry; - }, - enumerable: true, - configurable: true - }); - - /** - * Clones the event. - * @return An exact duplicate of the current object. - */ - GeometryEvent.prototype.clone = function () { - return new GeometryEvent(this.type, this._subGeometry); - }; - GeometryEvent.SUB_GEOMETRY_ADDED = "SubGeometryAdded"; - - GeometryEvent.SUB_GEOMETRY_REMOVED = "SubGeometryRemoved"; - - GeometryEvent.BOUNDS_INVALID = "BoundsInvalid"; - return GeometryEvent; - })(away.events.Event); - events.GeometryEvent = GeometryEvent; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (events) { - /** - * @class away.events.HTTPStatusEvent - */ - var HTTPStatusEvent = (function (_super) { - __extends(HTTPStatusEvent, _super); - function HTTPStatusEvent(type, status) { - if (typeof status === "undefined") { status = null; } - _super.call(this, type); - - this.status = status; - } - HTTPStatusEvent.HTTP_STATUS = "HTTPStatusEvent_HTTP_STATUS"; - return HTTPStatusEvent; - })(away.events.Event); - events.HTTPStatusEvent = HTTPStatusEvent; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -/// -/// -var away; -(function (away) { - /** - * @module away.events - */ - (function (events) { - var IOErrorEvent = (function (_super) { - __extends(IOErrorEvent, _super); - function IOErrorEvent(type) { - _super.call(this, type); - } - IOErrorEvent.IO_ERROR = "ioError"; - return IOErrorEvent; - })(away.events.Event); - events.IOErrorEvent = IOErrorEvent; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.events - */ - (function (events) { - var LightEvent = (function (_super) { - __extends(LightEvent, _super); - function LightEvent(type) { - _super.call(this, type); - } - //@override - LightEvent.prototype.clone = function () { - return new away.events.LightEvent(this.type); - }; - LightEvent.CASTS_SHADOW_CHANGE = "castsShadowChange"; - return LightEvent; - })(away.events.Event); - events.LightEvent = LightEvent; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.events - */ - (function (events) { - var LoaderEvent = (function (_super) { - __extends(LoaderEvent, _super); - /** - * Create a new LoaderEvent object. - * - * @param type The event type. - * @param url The url of the loaded resource. - * @param assets The assets of the loaded resource. - */ - function LoaderEvent(type, url, content, assets) { - if (typeof url === "undefined") { url = null; } - if (typeof content === "undefined") { content = null; } - if (typeof assets === "undefined") { assets = null; } - _super.call(this, type); - - this._url = url; - this._content = content; - this._assets = assets; - } - Object.defineProperty(LoaderEvent.prototype, "content", { - /** - * The content returned if the resource has been loaded inside a Loader object. - */ - get: function () { - return this._content; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LoaderEvent.prototype, "url", { - /** - * The url of the loaded resource. - */ - get: function () { - return this._url; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LoaderEvent.prototype, "assets", { - /** - * The error string on loadError. - */ - get: function () { - return this._assets; - }, - enumerable: true, - configurable: true - }); - - /** - * Clones the current event. - * @return An exact duplicate of the current event. - */ - LoaderEvent.prototype.clone = function () { - return new LoaderEvent(this.type, this._url, this._content, this._assets); - }; - LoaderEvent.RESOURCE_COMPLETE = "resourceComplete"; - return LoaderEvent; - })(away.events.Event); - events.LoaderEvent = LoaderEvent; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.events - */ - (function (events) { - //import flash.events.Event; - var ParserEvent = (function (_super) { - __extends(ParserEvent, _super); - function ParserEvent(type, message) { - if (typeof message === "undefined") { message = ''; } - _super.call(this, type); - - this._message = message; - } - Object.defineProperty(ParserEvent.prototype, "message", { - /** - * Additional human-readable message. Usually supplied for ParserEvent.PARSE_ERROR events. - */ - get: function () { - return this._message; - }, - enumerable: true, - configurable: true - }); - - ParserEvent.prototype.clone = function () { - return new away.events.ParserEvent(this.type, this.message); - }; - ParserEvent.PARSE_COMPLETE = 'parseComplete'; - - ParserEvent.PARSE_ERROR = 'parseError'; - - ParserEvent.READY_FOR_DEPENDENCIES = 'readyForDependencies'; - return ParserEvent; - })(away.events.Event); - events.ParserEvent = ParserEvent; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -var away; -(function (away) { - /// - /** - * @module away.events - */ - (function (events) { - /** - * A MouseEvent is dispatched when a mouse event occurs over a mouseEnabled object in View. - * TODO: we don't have screenZ data, tho this should be easy to implement - */ - var MouseEvent = (function (_super) { - __extends(MouseEvent, _super); - /** - * Create a new MouseEvent object. - * @param type The type of the MouseEvent. - */ - function MouseEvent(type) { - _super.call(this, type); - // Private. - this._iAllowedToPropagate = true; - } - Object.defineProperty(MouseEvent.prototype, "bubbles", { - /** - * @inheritDoc - */ - get: function () { - var doesBubble = this._iAllowedToPropagate; - this._iAllowedToPropagate = true; - - // Don't bubble if propagation has been stopped. - return doesBubble; - }, - enumerable: true, - configurable: true - }); - - /** - * @inheritDoc - */ - MouseEvent.prototype.stopPropagation = function () { - this._iAllowedToPropagate = false; - - if (this._iParentEvent) - this._iParentEvent.stopPropagation(); - }; - - /** - * @inheritDoc - */ - MouseEvent.prototype.stopImmediatePropagation = function () { - this._iAllowedToPropagate = false; - - if (this._iParentEvent) - this._iParentEvent.stopImmediatePropagation(); - }; - - /** - * Creates a copy of the MouseEvent object and sets the value of each property to match that of the original. - */ - MouseEvent.prototype.clone = function () { - var result = new MouseEvent(this.type); - - /* TODO: Debug / test - look into isDefaultPrevented - if (isDefaultPrevented()) - result.preventDefault(); - */ - result.screenX = this.screenX; - result.screenY = this.screenY; - - result.view = this.view; - result.object = this.object; - result.materialOwner = this.materialOwner; - result.material = this.material; - result.uv = this.uv; - result.localPosition = this.localPosition; - result.localNormal = this.localNormal; - result.index = this.index; - result.subGeometryIndex = this.subGeometryIndex; - result.delta = this.delta; - - result.ctrlKey = this.ctrlKey; - result.shiftKey = this.shiftKey; - - result._iParentEvent = this; - result._iAllowedToPropagate = this._iAllowedToPropagate; - - return result; - }; - - Object.defineProperty(MouseEvent.prototype, "scenePosition", { - /** - * The position in scene space where the event took place - */ - get: function () { - return this.object.sceneTransform.transformVector(this.localPosition); - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(MouseEvent.prototype, "sceneNormal", { - /** - * The normal in scene space where the event took place - */ - get: function () { - var sceneNormal = this.object.sceneTransform.deltaTransformVector(this.localNormal); - sceneNormal.normalize(); - - return sceneNormal; - }, - enumerable: true, - configurable: true - }); - MouseEvent.MOUSE_OVER = "mouseOver3d"; - - MouseEvent.MOUSE_OUT = "mouseOut3d"; - - MouseEvent.MOUSE_UP = "mouseUp3d"; - - MouseEvent.MOUSE_DOWN = "mouseDown3d"; - - MouseEvent.MOUSE_MOVE = "mouseMove3d"; - - MouseEvent.CLICK = "click3d"; - - MouseEvent.DOUBLE_CLICK = "doubleClick3d"; - - MouseEvent.MOUSE_WHEEL = "mouseWheel3d"; - return MouseEvent; - })(away.events.Event); - events.MouseEvent = MouseEvent; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -var away; -(function (away) { - /// - /** - * @module away.events - */ - (function (events) { - var MaterialEvent = (function (_super) { - __extends(MaterialEvent, _super); - function MaterialEvent(type) { - _super.call(this, type); - } - MaterialEvent.SIZE_CHANGED = "sizeChanged"; - return MaterialEvent; - })(events.Event); - events.MaterialEvent = MaterialEvent; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.events - */ - (function (events) { - var ProgressEvent = (function (_super) { - __extends(ProgressEvent, _super); - function ProgressEvent(type) { - _super.call(this, type); - } - ProgressEvent.PROGRESS = "progress"; - return ProgressEvent; - })(away.events.Event); - events.ProgressEvent = ProgressEvent; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -var away; -(function (away) { - /// - /** - * @module away.events - */ - (function (events) { - var ProjectionEvent = (function (_super) { - __extends(ProjectionEvent, _super); - function ProjectionEvent(type, projection) { - _super.call(this, type); - this._projection = projection; - } - Object.defineProperty(ProjectionEvent.prototype, "projection", { - get: function () { - return this._projection; - }, - enumerable: true, - configurable: true - }); - ProjectionEvent.MATRIX_CHANGED = "matrixChanged"; - return ProjectionEvent; - })(away.events.Event); - events.ProjectionEvent = ProjectionEvent; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.events - */ - (function (events) { - //import flash.events.Event; - var RendererEvent = (function (_super) { - __extends(RendererEvent, _super); - function RendererEvent(type) { - _super.call(this, type); //, bubbles, cancelable); - } - RendererEvent.VIEWPORT_UPDATED = "viewportUpdated"; - RendererEvent.SCISSOR_UPDATED = "scissorUpdated"; - return RendererEvent; - })(events.Event); - events.RendererEvent = RendererEvent; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.events - */ - (function (events) { - var SceneEvent = (function (_super) { - __extends(SceneEvent, _super); - function SceneEvent(type, displayObject) { - this.displayObject = displayObject; - _super.call(this, type); - } - SceneEvent.ADDED_TO_SCENE = "addedToScene"; - - SceneEvent.REMOVED_FROM_SCENE = "removedFromScene"; - - SceneEvent.PARTITION_CHANGED = "partitionChanged"; - return SceneEvent; - })(away.events.Event); - events.SceneEvent = SceneEvent; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.events - */ - (function (events) { - var StageEvent = (function (_super) { - __extends(StageEvent, _super); - function StageEvent(type) { - _super.call(this, type); - } - StageEvent.CONTEXT_CREATED = "contextCreated"; - StageEvent.CONTEXT_DISPOSED = "contextDisposed"; - StageEvent.CONTEXT_RECREATED = "contextRecreated"; - StageEvent.VIEWPORT_UPDATED = "viewportUpdated"; - return StageEvent; - })(away.events.Event); - events.StageEvent = StageEvent; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (events) { - /** - * Dispatched to notify changes in a sub geometry object's state. - * - * @class away.events.SubGeometryEvent - * @see away3d.core.base.Geometry - */ - var SubGeometryEvent = (function (_super) { - __extends(SubGeometryEvent, _super); - /** - * Create a new GeometryEvent - * @param type The event type. - * @param dataType An optional data type of the vertex data being updated. - */ - function SubGeometryEvent(type, dataType) { - if (typeof dataType === "undefined") { dataType = ""; } - _super.call(this, type); - this._dataType = dataType; - } - Object.defineProperty(SubGeometryEvent.prototype, "dataType", { - /** - * The data type of the vertex data. - */ - get: function () { - return this._dataType; - }, - enumerable: true, - configurable: true - }); - - /** - * Clones the event. - * - * @return An exact duplicate of the current object. - */ - SubGeometryEvent.prototype.clone = function () { - return new SubGeometryEvent(this.type, this._dataType); - }; - SubGeometryEvent.INDICES_UPDATED = "indicesUpdated"; - - SubGeometryEvent.VERTICES_UPDATED = "verticesUpdated"; - return SubGeometryEvent; - })(away.events.Event); - events.SubGeometryEvent = SubGeometryEvent; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.events - */ - (function (events) { - var TimerEvent = (function (_super) { - __extends(TimerEvent, _super); - function TimerEvent(type) { - _super.call(this, type); - } - TimerEvent.TIMER = "timer"; - TimerEvent.TIMER_COMPLETE = "timerComplete"; - return TimerEvent; - })(away.events.Event); - events.TimerEvent = TimerEvent; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (utils) { - var ByteArrayBase = (function () { - function ByteArrayBase() { - this.position = 0; - this.length = 0; - this._mode = ""; - } - ByteArrayBase.prototype.writeByte = function (b) { - throw "Virtual method"; - }; - - ByteArrayBase.prototype.readByte = function () { - throw "Virtual method"; - }; - - ByteArrayBase.prototype.writeUnsignedByte = function (b) { - throw "Virtual method"; - }; - - ByteArrayBase.prototype.readUnsignedByte = function () { - throw "Virtual method"; - }; - - ByteArrayBase.prototype.writeUnsignedShort = function (b) { - throw "Virtual method"; - }; - - ByteArrayBase.prototype.readUnsignedShort = function () { - throw "Virtual method"; - }; - - ByteArrayBase.prototype.writeUnsignedInt = function (b) { - throw "Virtual method"; - }; - - ByteArrayBase.prototype.readUnsignedInt = function () { - throw "Virtual method"; - }; - - ByteArrayBase.prototype.writeFloat = function (b) { - throw "Virtual method"; - }; - - ByteArrayBase.prototype.toFloatBits = function (x) { - throw "Virtual method"; - }; - - ByteArrayBase.prototype.readFloat = function (b) { - throw "Virtual method"; - }; - - ByteArrayBase.prototype.fromFloatBits = function (x) { - throw "Virtual method"; - }; - - ByteArrayBase.prototype.getBytesAvailable = function () { - throw new away.errors.AbstractMethodError('ByteArrayBase, getBytesAvailable() not implemented '); - }; - - ByteArrayBase.prototype.toString = function () { - return "[ByteArray] ( " + this._mode + " ) position=" + this.position + " length=" + this.length; - }; - - ByteArrayBase.prototype.compareEqual = function (other, count) { - if (count == undefined || count > this.length - this.position) - count = this.length - this.position; - if (count > other.length - other.position) - count = other.length - other.position; - var co0 = count; - var r = true; - while (r && count >= 4) { - count -= 4; - if (this.readUnsignedInt() != other.readUnsignedInt()) - r = false; - } - while (r && count >= 1) { - count--; - if (this.readUnsignedByte() != other.readUnsignedByte()) - r = false; - } - var c0; - this.position -= (c0 - count); - other.position -= (c0 - count); - return r; - }; - - ByteArrayBase.prototype.writeBase64String = function (s) { - for (var i = 0; i < s.length; i++) { - var v = s.charAt(i); - } - }; - - ByteArrayBase.prototype.dumpToConsole = function () { - var oldpos = this.position; - this.position = 0; - var nstep = 8; - - function asHexString(x, digits) { - var lut = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; - var sh = ""; - for (var d = 0; d < digits; d++) { - sh = lut[(x >> (d << 2)) & 0xf] + sh; - } - return sh; - } - - for (var i = 0; i < this.length; i += nstep) { - var s = asHexString(i, 4) + ":"; - for (var j = 0; j < nstep && i + j < this.length; j++) { - s += " " + asHexString(this.readUnsignedByte(), 2); - } - console.log(s); - } - this.position = oldpos; - }; - - ByteArrayBase.prototype.readBase64String = function (count) { - if (count == undefined || count > this.length - this.position) - count = this.length - this.position; - if (!(count > 0)) - return ""; - - return ByteArrayBase.internalGetBase64String(count, this.readUnsignedByte, this); - }; - - ByteArrayBase.internalGetBase64String = function (count, getUnsignedByteFunc, self) { - var r = ""; - var b0, b1, b2, enc1, enc2, enc3, enc4; - var base64Key = ByteArrayBase.Base64Key; - while (count >= 3) { - b0 = getUnsignedByteFunc.apply(self); - b1 = getUnsignedByteFunc.apply(self); - b2 = getUnsignedByteFunc.apply(self); - enc1 = b0 >> 2; - enc2 = ((b0 & 3) << 4) | (b1 >> 4); - enc3 = ((b1 & 15) << 2) | (b2 >> 6); - enc4 = b2 & 63; - r += base64Key.charAt(enc1) + base64Key.charAt(enc2) + base64Key.charAt(enc3) + base64Key.charAt(enc4); - count -= 3; - } - - // pad - if (count == 2) { - b0 = getUnsignedByteFunc.apply(self); - b1 = getUnsignedByteFunc.apply(self); - enc1 = b0 >> 2; - enc2 = ((b0 & 3) << 4) | (b1 >> 4); - enc3 = ((b1 & 15) << 2); - r += base64Key.charAt(enc1) + base64Key.charAt(enc2) + base64Key.charAt(enc3) + "="; - } else if (count == 1) { - b0 = getUnsignedByteFunc.apply(self); - enc1 = b0 >> 2; - enc2 = ((b0 & 3) << 4); - r += base64Key.charAt(enc1) + base64Key.charAt(enc2) + "=="; - } - return r; - }; - ByteArrayBase.Base64Key = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - return ByteArrayBase; - })(); - utils.ByteArrayBase = ByteArrayBase; - })(away.utils || (away.utils = {})); - var utils = away.utils; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (utils) { - var ByteArray = (function (_super) { - __extends(ByteArray, _super); - function ByteArray() { - _super.call(this); - this.maxlength = 0; - this._mode = "Typed array"; - this.maxlength = 4; - this.arraybytes = new ArrayBuffer(this.maxlength); - this.unalignedarraybytestemp = new ArrayBuffer(16); - } - ByteArray.prototype.ensureWriteableSpace = function (n) { - this.ensureSpace(n + this.position); - }; - - ByteArray.prototype.setArrayBuffer = function (aBuffer) { - this.ensureSpace(aBuffer.byteLength); - - this.length = aBuffer.byteLength; - - var inInt8AView = new Int8Array(aBuffer); - var localInt8View = new Int8Array(this.arraybytes, 0, this.length); - - localInt8View.set(inInt8AView); - - this.position = 0; - }; - - ByteArray.prototype.getBytesAvailable = function () { - return (this.length) - (this.position); - }; - - ByteArray.prototype.ensureSpace = function (n) { - if (n > this.maxlength) { - var newmaxlength = (n + 255) & (~255); - var newarraybuffer = new ArrayBuffer(newmaxlength); - var view = new Uint8Array(this.arraybytes, 0, this.length); - var newview = new Uint8Array(newarraybuffer, 0, this.length); - newview.set(view); // memcpy - this.arraybytes = newarraybuffer; - this.maxlength = newmaxlength; - } - }; - - ByteArray.prototype.writeByte = function (b) { - this.ensureWriteableSpace(1); - var view = new Int8Array(this.arraybytes); - view[this.position++] = (~~b); // ~~ is cast to int in js... - if (this.position > this.length) { - this.length = this.position; - } - }; - - ByteArray.prototype.readByte = function () { - if (this.position >= this.length) { - throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length; - } - var view = new Int8Array(this.arraybytes); - - return view[this.position++]; - }; - - ByteArray.prototype.readBytes = function (bytes, offset, length) { - if (typeof offset === "undefined") { offset = 0; } - if (typeof length === "undefined") { length = 0; } - if (length == null) { - length = bytes.length; - } - - bytes.ensureWriteableSpace(offset + length); - - var byteView = new Int8Array(bytes.arraybytes); - var localByteView = new Int8Array(this.arraybytes); - - byteView.set(localByteView.subarray(this.position, this.position + length), offset); - - this.position += length; - - if (length + offset > bytes.length) { - bytes.length += (length + offset) - bytes.length; - } - }; - - ByteArray.prototype.writeUnsignedByte = function (b) { - this.ensureWriteableSpace(1); - var view = new Uint8Array(this.arraybytes); - view[this.position++] = (~~b) & 0xff; // ~~ is cast to int in js... - if (this.position > this.length) { - this.length = this.position; - } - }; - - ByteArray.prototype.readUnsignedByte = function () { - if (this.position >= this.length) { - throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length; - } - var view = new Uint8Array(this.arraybytes); - return view[this.position++]; - }; - - ByteArray.prototype.writeUnsignedShort = function (b) { - this.ensureWriteableSpace(2); - if ((this.position & 1) == 0) { - var view = new Uint16Array(this.arraybytes); - view[this.position >> 1] = (~~b) & 0xffff; // ~~ is cast to int in js... - } else { - var view = new Uint16Array(this.unalignedarraybytestemp, 0, 1); - view[0] = (~~b) & 0xffff; - var view2 = new Uint8Array(this.arraybytes, this.position, 2); - var view3 = new Uint8Array(this.unalignedarraybytestemp, 0, 2); - view2.set(view3); - } - this.position += 2; - if (this.position > this.length) { - this.length = this.position; - } - }; - - ByteArray.prototype.readUTFBytes = function (len) { - var value = ""; - var max = this.position + len; - var data = new DataView(this.arraybytes); - - while (this.position < max) { - var c = data.getUint8(this.position++); - - if (c < 0x80) { - if (c == 0) - break; - value += String.fromCharCode(c); - } else if (c < 0xE0) { - value += String.fromCharCode(((c & 0x3F) << 6) | (data.getUint8(this.position++) & 0x7F)); - } else if (c < 0xF0) { - var c2 = data.getUint8(this.position++); - value += String.fromCharCode(((c & 0x1F) << 12) | ((c2 & 0x7F) << 6) | (data.getUint8(this.position++) & 0x7F)); - } else { - var c2 = data.getUint8(this.position++); - var c3 = data.getUint8(this.position++); - - value += String.fromCharCode(((c & 0x0F) << 18) | ((c2 & 0x7F) << 12) | ((c3 << 6) & 0x7F) | (data.getUint8(this.position++) & 0x7F)); - } - } - - return value; - }; - - ByteArray.prototype.readInt = function () { - var data = new DataView(this.arraybytes); - var int = data.getInt32(this.position, true); - - this.position += 4; - - return int; - }; - - ByteArray.prototype.readShort = function () { - var data = new DataView(this.arraybytes); - var short = data.getInt16(this.position, true); - - this.position += 2; - return short; - }; - - ByteArray.prototype.readDouble = function () { - var data = new DataView(this.arraybytes); - var double = data.getFloat64(this.position, true); - - this.position += 8; - return double; - }; - - ByteArray.prototype.readUnsignedShort = function () { - if (this.position > this.length + 2) { - throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length; - } - if ((this.position & 1) == 0) { - var view = new Uint16Array(this.arraybytes); - var pa = this.position >> 1; - this.position += 2; - return view[pa]; - } else { - var view = new Uint16Array(this.unalignedarraybytestemp, 0, 1); - var view2 = new Uint8Array(this.arraybytes, this.position, 2); - var view3 = new Uint8Array(this.unalignedarraybytestemp, 0, 2); - view3.set(view2); - this.position += 2; - return view[0]; - } - }; - - ByteArray.prototype.writeUnsignedInt = function (b) { - this.ensureWriteableSpace(4); - if ((this.position & 3) == 0) { - var view = new Uint32Array(this.arraybytes); - view[this.position >> 2] = (~~b) & 0xffffffff; // ~~ is cast to int in js... - } else { - var view = new Uint32Array(this.unalignedarraybytestemp, 0, 1); - view[0] = (~~b) & 0xffffffff; - var view2 = new Uint8Array(this.arraybytes, this.position, 4); - var view3 = new Uint8Array(this.unalignedarraybytestemp, 0, 4); - view2.set(view3); - } - this.position += 4; - if (this.position > this.length) { - this.length = this.position; - } - }; - - ByteArray.prototype.readUnsignedInt = function () { - if (this.position > this.length + 4) { - throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length; - } - if ((this.position & 3) == 0) { - var view = new Uint32Array(this.arraybytes); - var pa = this.position >> 2; - this.position += 4; - return view[pa]; - } else { - var view = new Uint32Array(this.unalignedarraybytestemp, 0, 1); - var view2 = new Uint8Array(this.arraybytes, this.position, 4); - var view3 = new Uint8Array(this.unalignedarraybytestemp, 0, 4); - view3.set(view2); - this.position += 4; - return view[0]; - } - }; - - ByteArray.prototype.writeFloat = function (b) { - this.ensureWriteableSpace(4); - if ((this.position & 3) == 0) { - var view = new Float32Array(this.arraybytes); - view[this.position >> 2] = b; - } else { - var view = new Float32Array(this.unalignedarraybytestemp, 0, 1); - view[0] = b; - var view2 = new Uint8Array(this.arraybytes, this.position, 4); - var view3 = new Uint8Array(this.unalignedarraybytestemp, 0, 4); - view2.set(view3); - } - this.position += 4; - if (this.position > this.length) { - this.length = this.position; - } - }; - - ByteArray.prototype.readFloat = function () { - if (this.position > this.length + 4) { - throw "ByteArray out of bounds read. Positon=" + this.position + ", Length=" + this.length; - } - if ((this.position & 3) == 0) { - var view = new Float32Array(this.arraybytes); - var pa = this.position >> 2; - this.position += 4; - return view[pa]; - } else { - var view = new Float32Array(this.unalignedarraybytestemp, 0, 1); - var view2 = new Uint8Array(this.arraybytes, this.position, 4); - var view3 = new Uint8Array(this.unalignedarraybytestemp, 0, 4); - view3.set(view2); - this.position += 4; - return view[0]; - } - }; - return ByteArray; - })(utils.ByteArrayBase); - utils.ByteArray = ByteArray; - })(away.utils || (away.utils = {})); - var utils = away.utils; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (utils) { - var ByteArrayBuffer = (function (_super) { - __extends(ByteArrayBuffer, _super); - function ByteArrayBuffer() { - _super.call(this); - this._bytes = []; - this._mode = "Array"; - } - ByteArrayBuffer.prototype.writeByte = function (b) { - var bi = ~~b; - this._bytes[this.position++] = bi; - if (this.position > this.length) { - this.length = this.position; - } - }; - - ByteArrayBuffer.prototype.readByte = function () { - if (this.position >= this.length) { - throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length; - } - return this._bytes[this.position++]; - }; - - ByteArrayBuffer.prototype.writeUnsignedByte = function (b) { - var bi = ~~b; - this._bytes[this.position++] = bi & 0xff; - if (this.position > this.length) { - this.length = this.position; - } - }; - - ByteArrayBuffer.prototype.readUnsignedByte = function () { - if (this.position >= this.length) { - throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length; - } - return this._bytes[this.position++]; - }; - - ByteArrayBuffer.prototype.writeUnsignedShort = function (b) { - var bi = ~~b; - this._bytes[this.position++] = bi & 0xff; - this._bytes[this.position++] = (bi >> 8) & 0xff; - if (this.position > this.length) { - this.length = this.position; - } - }; - - ByteArrayBuffer.prototype.readUnsignedShort = function () { - if (this.position + 2 > this.length) { - throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length; - } - var r = this._bytes[this.position] | (this._bytes[this.position + 1] << 8); - this.position += 2; - return r; - }; - - ByteArrayBuffer.prototype.writeUnsignedInt = function (b) { - var bi = ~~b; - this._bytes[this.position++] = bi & 0xff; - this._bytes[this.position++] = (bi >>> 8) & 0xff; - this._bytes[this.position++] = (bi >>> 16) & 0xff; - this._bytes[this.position++] = (bi >>> 24) & 0xff; - if (this.position > this.length) { - this.length = this.position; - } - }; - - ByteArrayBuffer.prototype.readUnsignedInt = function () { - if (this.position + 4 > this.length) { - throw "ByteArray out of bounds read. Position=" + this.position + ", Length=" + this.length; - } - var r = this._bytes[this.position] | (this._bytes[this.position + 1] << 8) | (this._bytes[this.position + 2] << 16) | (this._bytes[this.position + 3] << 24); - this.position += 4; - return r >>> 0; - }; - - ByteArrayBuffer.prototype.writeFloat = function (b) { - // this is crazy slow and silly, but as a fallback... - this.writeUnsignedInt(this.toFloatBits(Number(b))); - }; - - ByteArrayBuffer.prototype.toFloatBits = function (x) { - // don't handle inf/nan yet - // special case zero - if (x == 0) { - return 0; - } - - // remove the sign, after this we only deal with positive numbers - var sign = 0; - if (x < 0) { - x = -x; - sign = 1; - } else { - sign = 0; - } - - // a float value is now defined as: x = (1+(mantissa*2^-23))*(2^(exponent-127)) - var exponent = Math.log(x) / Math.log(2); - exponent = Math.floor(exponent); - x = x * Math.pow(2, 23 - exponent); // normalize to 24 bits - var mantissa = Math.floor(x) - 0x800000; - exponent = exponent + 127; - return ((sign << 31) >>> 0) | (exponent << 23) | mantissa; - }; - - ByteArrayBuffer.prototype.readFloat = function (b) { - return this.fromFloatBits(this.readUnsignedInt()); - }; - - ByteArrayBuffer.prototype.fromFloatBits = function (x) { - if (x == 0) { - return 0; - } - var exponent = (x >>> 23) & 0xff; - var mantissa = (x & 0x7fffff) | 0x800000; - var y = Math.pow(2, (exponent - 127) - 23) * mantissa; - if (x >>> 31 != 0) { - y = -y; - } - return y; - }; - return ByteArrayBuffer; - })(utils.ByteArrayBase); - utils.ByteArrayBuffer = ByteArrayBuffer; - })(away.utils || (away.utils = {})); - var utils = away.utils; -})(away || (away = {})); -var away; -(function (away) { - (function (utils) { - var ColorUtils = (function () { - function ColorUtils() { - } - ColorUtils.float32ColorToARGB = function (float32Color) { - var a = (float32Color & 0xff000000) >>> 24; - var r = (float32Color & 0xff0000) >>> 16; - var g = (float32Color & 0xff00) >>> 8; - var b = float32Color & 0xff; - var result = [a, r, g, b]; - - return result; - }; - - ColorUtils.componentToHex = function (c) { - var hex = c.toString(16); - return hex.length == 1 ? "0" + hex : hex; - }; - - ColorUtils.RGBToHexString = function (argb) { - return "#" + ColorUtils.componentToHex(argb[1]) + ColorUtils.componentToHex(argb[2]) + ColorUtils.componentToHex(argb[3]); - }; - - ColorUtils.ARGBToHexString = function (argb) { - return "#" + ColorUtils.componentToHex(argb[0]) + ColorUtils.componentToHex(argb[1]) + ColorUtils.componentToHex(argb[2]) + ColorUtils.componentToHex(argb[3]); - }; - return ColorUtils; - })(); - utils.ColorUtils = ColorUtils; - })(away.utils || (away.utils = {})); - var utils = away.utils; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (utils) { - /** - * Helper class for casting assets to usable objects - */ - var Cast = (function () { - function Cast() { - } - Cast.string = function (data) { - if (typeof (data) == 'function') - data = new data; - - if (typeof (data) == 'string') - return data; - - return data; - }; - - Cast.byteArray = function (data) { - if (typeof (data) == 'function') - data = new data; - - if (data instanceof utils.ByteArray) - return data; - - return data; - }; - - // public static xml(data:any):XML - // { - // if (typeof(data) == 'function') - // data = new data; - // - // if (data is XML) - // return data; - // - // return XML(data); - // } - Cast.isHex = function (str) { - var length = str.length; - for (var i = 0; i < length; ++i) { - if (this._hexChars.indexOf(str.charAt(i)) == -1) - return false; - } - - return true; - }; - - Cast.tryColor = function (data) { - if (typeof (data) == 'number') - return Math.floor(data); - - if (typeof (data) == 'string') { - if (data == "random") - return Math.floor(Math.random() * 0x1000000); - - if (this._colorNames == null) { - this._colorNames = new Object(); - this._colorNames["steelblue"] = 0x4682B4; - this._colorNames["royalblue"] = 0x041690; - this._colorNames["cornflowerblue"] = 0x6495ED; - this._colorNames["lightsteelblue"] = 0xB0C4DE; - this._colorNames["mediumslateblue"] = 0x7B68EE; - this._colorNames["slateblue"] = 0x6A5ACD; - this._colorNames["darkslateblue"] = 0x483D8B; - this._colorNames["midnightblue"] = 0x191970; - this._colorNames["navy"] = 0x000080; - this._colorNames["darkblue"] = 0x00008B; - this._colorNames["mediumblue"] = 0x0000CD; - this._colorNames["blue"] = 0x0000FF; - this._colorNames["dodgerblue"] = 0x1E90FF; - this._colorNames["deepskyblue"] = 0x00BFFF; - this._colorNames["lightskyblue"] = 0x87CEFA; - this._colorNames["skyblue"] = 0x87CEEB; - this._colorNames["lightblue"] = 0xADD8E6; - this._colorNames["powderblue"] = 0xB0E0E6; - this._colorNames["azure"] = 0xF0FFFF; - this._colorNames["lightcyan"] = 0xE0FFFF; - this._colorNames["paleturquoise"] = 0xAFEEEE; - this._colorNames["mediumturquoise"] = 0x48D1CC; - this._colorNames["lightseagreen"] = 0x20B2AA; - this._colorNames["darkcyan"] = 0x008B8B; - this._colorNames["teal"] = 0x008080; - this._colorNames["cadetblue"] = 0x5F9EA0; - this._colorNames["darkturquoise"] = 0x00CED1; - this._colorNames["aqua"] = 0x00FFFF; - this._colorNames["cyan"] = 0x00FFFF; - this._colorNames["turquoise"] = 0x40E0D0; - this._colorNames["aquamarine"] = 0x7FFFD4; - this._colorNames["mediumaquamarine"] = 0x66CDAA; - this._colorNames["darkseagreen"] = 0x8FBC8F; - this._colorNames["mediumseagreen"] = 0x3CB371; - this._colorNames["seagreen"] = 0x2E8B57; - this._colorNames["darkgreen"] = 0x006400; - this._colorNames["green"] = 0x008000; - this._colorNames["forestgreen"] = 0x228B22; - this._colorNames["limegreen"] = 0x32CD32; - this._colorNames["lime"] = 0x00FF00; - this._colorNames["chartreuse"] = 0x7FFF00; - this._colorNames["lawngreen"] = 0x7CFC00; - this._colorNames["greenyellow"] = 0xADFF2F; - this._colorNames["yellowgreen"] = 0x9ACD32; - this._colorNames["palegreen"] = 0x98FB98; - this._colorNames["lightgreen"] = 0x90EE90; - this._colorNames["springgreen"] = 0x00FF7F; - this._colorNames["mediumspringgreen"] = 0x00FA9A; - this._colorNames["darkolivegreen"] = 0x556B2F; - this._colorNames["olivedrab"] = 0x6B8E23; - this._colorNames["olive"] = 0x808000; - this._colorNames["darkkhaki"] = 0xBDB76B; - this._colorNames["darkgoldenrod"] = 0xB8860B; - this._colorNames["goldenrod"] = 0xDAA520; - this._colorNames["gold"] = 0xFFD700; - this._colorNames["yellow"] = 0xFFFF00; - this._colorNames["khaki"] = 0xF0E68C; - this._colorNames["palegoldenrod"] = 0xEEE8AA; - this._colorNames["blanchedalmond"] = 0xFFEBCD; - this._colorNames["moccasin"] = 0xFFE4B5; - this._colorNames["wheat"] = 0xF5DEB3; - this._colorNames["navajowhite"] = 0xFFDEAD; - this._colorNames["burlywood"] = 0xDEB887; - this._colorNames["tan"] = 0xD2B48C; - this._colorNames["rosybrown"] = 0xBC8F8F; - this._colorNames["sienna"] = 0xA0522D; - this._colorNames["saddlebrown"] = 0x8B4513; - this._colorNames["chocolate"] = 0xD2691E; - this._colorNames["peru"] = 0xCD853F; - this._colorNames["sandybrown"] = 0xF4A460; - this._colorNames["darkred"] = 0x8B0000; - this._colorNames["maroon"] = 0x800000; - this._colorNames["brown"] = 0xA52A2A; - this._colorNames["firebrick"] = 0xB22222; - this._colorNames["indianred"] = 0xCD5C5C; - this._colorNames["lightcoral"] = 0xF08080; - this._colorNames["salmon"] = 0xFA8072; - this._colorNames["darksalmon"] = 0xE9967A; - this._colorNames["lightsalmon"] = 0xFFA07A; - this._colorNames["coral"] = 0xFF7F50; - this._colorNames["tomato"] = 0xFF6347; - this._colorNames["darkorange"] = 0xFF8C00; - this._colorNames["orange"] = 0xFFA500; - this._colorNames["orangered"] = 0xFF4500; - this._colorNames["crimson"] = 0xDC143C; - this._colorNames["red"] = 0xFF0000; - this._colorNames["deeppink"] = 0xFF1493; - this._colorNames["fuchsia"] = 0xFF00FF; - this._colorNames["magenta"] = 0xFF00FF; - this._colorNames["hotpink"] = 0xFF69B4; - this._colorNames["lightpink"] = 0xFFB6C1; - this._colorNames["pink"] = 0xFFC0CB; - this._colorNames["palevioletred"] = 0xDB7093; - this._colorNames["mediumvioletred"] = 0xC71585; - this._colorNames["purple"] = 0x800080; - this._colorNames["darkmagenta"] = 0x8B008B; - this._colorNames["mediumpurple"] = 0x9370DB; - this._colorNames["blueviolet"] = 0x8A2BE2; - this._colorNames["indigo"] = 0x4B0082; - this._colorNames["darkviolet"] = 0x9400D3; - this._colorNames["darkorchid"] = 0x9932CC; - this._colorNames["mediumorchid"] = 0xBA55D3; - this._colorNames["orchid"] = 0xDA70D6; - this._colorNames["violet"] = 0xEE82EE; - this._colorNames["plum"] = 0xDDA0DD; - this._colorNames["thistle"] = 0xD8BFD8; - this._colorNames["lavender"] = 0xE6E6FA; - this._colorNames["ghostwhite"] = 0xF8F8FF; - this._colorNames["aliceblue"] = 0xF0F8FF; - this._colorNames["mintcream"] = 0xF5FFFA; - this._colorNames["honeydew"] = 0xF0FFF0; - this._colorNames["lightgoldenrodyellow"] = 0xFAFAD2; - this._colorNames["lemonchiffon"] = 0xFFFACD; - this._colorNames["cornsilk"] = 0xFFF8DC; - this._colorNames["lightyellow"] = 0xFFFFE0; - this._colorNames["ivory"] = 0xFFFFF0; - this._colorNames["floralwhite"] = 0xFFFAF0; - this._colorNames["linen"] = 0xFAF0E6; - this._colorNames["oldlace"] = 0xFDF5E6; - this._colorNames["antiquewhite"] = 0xFAEBD7; - this._colorNames["bisque"] = 0xFFE4C4; - this._colorNames["peachpuff"] = 0xFFDAB9; - this._colorNames["papayawhip"] = 0xFFEFD5; - this._colorNames["beige"] = 0xF5F5DC; - this._colorNames["seashell"] = 0xFFF5EE; - this._colorNames["lavenderblush"] = 0xFFF0F5; - this._colorNames["mistyrose"] = 0xFFE4E1; - this._colorNames["snow"] = 0xFFFAFA; - this._colorNames["white"] = 0xFFFFFF; - this._colorNames["whitesmoke"] = 0xF5F5F5; - this._colorNames["gainsboro"] = 0xDCDCDC; - this._colorNames["lightgrey"] = 0xD3D3D3; - this._colorNames["silver"] = 0xC0C0C0; - this._colorNames["darkgrey"] = 0xA9A9A9; - this._colorNames["grey"] = 0x808080; - this._colorNames["lightslategrey"] = 0x778899; - this._colorNames["slategrey"] = 0x708090; - this._colorNames["dimgrey"] = 0x696969; - this._colorNames["darkslategrey"] = 0x2F4F4F; - this._colorNames["black"] = 0x000000; - this._colorNames["transparent"] = 0xFF000000; - } - - if (this._colorNames[data] != null) - return this._colorNames[data]; - - if ((data.length == 6) && this.isHex(data)) - return parseInt("0x" + data); - } - - return null; - }; - - Cast.color = function (data) { - var result = this.tryColor(data); - - if (result == null) - throw new away.errors.CastError("Can't cast to color: " + data); - - return result; - }; - - Cast.tryClass = function (name) { - if (this._notClasses[name]) - return name; - - var result = this._classes[name]; - - if (result != null) - return result; - - try { - result = window[name]; - this._classes[name] = result; - return result; - } catch (e) { - } - - this._notClasses[name] = true; - - return name; - }; - - Cast.bitmapData = function (data) { - if (data == null) - return null; - - if (typeof (data) == 'string') - data = this.tryClass(data); - - if (typeof (data) == 'function') { - try { - data = new data(); - } catch (e) { - data = new data(0, 0); - } - } - - if (data instanceof away.base.BitmapData) - return data; - - if (data instanceof away.textures.ImageTexture) - data = data.htmlImageElement; - - if (data instanceof HTMLImageElement) { - var imageElement = data; - var bitmapData = new away.base.BitmapData(imageElement.width, imageElement.height, true, 0x0); - bitmapData.draw(imageElement); - return bitmapData; - } - - throw new away.errors.CastError("Can't cast to BitmapData: " + data); - }; - - Cast.bitmapTexture = function (data) { - if (data == null) - return null; - - if (typeof (data) == 'string') - data = this.tryClass(data); - - if (typeof (data) == 'function') { - try { - data = new data(); - } catch (e) { - data = new data(0, 0); - } - } - - if (data instanceof away.textures.BitmapTexture) - return data; - - try { - var bmd = Cast.bitmapData(data); - return new away.textures.BitmapTexture(bmd); - } catch (e) { - } - - throw new away.errors.CastError("Can't cast to BitmapTexture: " + data); - }; - Cast._hexChars = "0123456789abcdefABCDEF"; - - Cast._notClasses = new Object(); - Cast._classes = new Object(); - return Cast; - })(); - utils.Cast = Cast; - })(away.utils || (away.utils = {})); - var utils = away.utils; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (utils) { - var CSS = (function () { - function CSS() { - } - CSS.setElementSize = function (element, width, height) { - element.style.width = width + "px"; - element.style.height = height + "px"; - element["width"] = width; - element["height"] = height; - }; - - CSS.setElementWidth = function (element, width) { - element.style.width = width + "px"; - element["width"] = width; - }; - - CSS.setElementHeight = function (element, height) { - element.style.height = height + "px"; - element["height"] = height; - }; - - CSS.setElementX = function (element, x) { - element.style.position = 'absolute'; - element.style.left = x + "px"; - }; - - CSS.setElementY = function (element, y) { - element.style.position = 'absolute'; - element.style.top = y + "px"; - }; - - CSS.getElementVisibility = function (element) { - return element.style.visibility == 'visible'; - }; - - CSS.setElementVisibility = function (element, visible) { - if (visible) { - element.style.visibility = 'visible'; - } else { - element.style.visibility = 'hidden'; - } - }; - - CSS.setElementAlpha = function (element, alpha) { - if (element instanceof HTMLCanvasElement) { - var context = element.getContext("2d"); - context.globalAlpha = alpha; - } - }; - - CSS.setElementPosition = function (element, x, y, absolute) { - if (typeof absolute === "undefined") { absolute = false; } - if (absolute) { - element.style.position = "absolute"; - } else { - element.style.position = "relative"; - } - - element.style.left = x + "px"; - element.style.top = y + "px"; - }; - return CSS; - })(); - utils.CSS = CSS; - })(away.utils || (away.utils = {})); - var utils = away.utils; -})(away || (away = {})); -/// -var away; -(function (away) { - var Debug = (function () { - function Debug() { - } - Debug.breakpoint = function () { - away.Debug['break'](); - }; - - Debug.throwPIROnKeyWordOnly = function (str, enable) { - if (typeof enable === "undefined") { enable = true; } - if (!enable) - away.Debug.keyword = null; - else - away.Debug.keyword = str; - }; - - Debug.throwPIR = function (clss, fnc, msg) { - Debug.logPIR('PartialImplementationError ' + clss, fnc, msg); - - if (Debug.THROW_ERRORS) { - if (away.Debug.keyword) { - var e = clss + fnc + msg; - - if (e.indexOf(away.Debug.keyword) == -1) - return; - } - - throw new away.errors.PartialImplementationError(clss + '.' + fnc + ': ' + msg); - } - }; - - Debug.logPIR = function (clss, fnc, msg) { - if (typeof msg === "undefined") { msg = ''; } - if (Debug.LOG_PI_ERRORS) - console.log(clss + '.' + fnc + ': ' + msg); - }; - - Debug.log = function () { - var args = []; - for (var _i = 0; _i < (arguments.length - 0); _i++) { - args[_i] = arguments[_i + 0]; - } - if (Debug.ENABLE_LOG) - console.log(args); - }; - Debug.THROW_ERRORS = true; - Debug.ENABLE_LOG = true; - Debug.LOG_PI_ERRORS = true; - - Debug.keyword = null; - return Debug; - })(); - away.Debug = Debug; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (utils) { - var Delegate = (function () { - function Delegate(func) { - if (typeof func === "undefined") { func = null; } - this._func = func; - } - /** - Creates a functions wrapper for the original function so that it runs - in the provided context. - @parameter obj Context in which to run the function. - @paramater func Function to run. - */ - Delegate.create = function (obj, func) { - var f = function () { - return func.apply(obj, arguments); - }; - - return f; - }; - - Delegate.prototype.createDelegate = function (obj) { - return Delegate.create(obj, this._func); - }; - return Delegate; - })(); - utils.Delegate = Delegate; - })(away.utils || (away.utils = {})); - var utils = away.utils; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (utils) { - //[native(cls="TimerClass", gc="exact", instance="TimerObject", methods="auto")] - //[Event(name="timerComplete", type="flash.events.TimerEvent")] - //[Event(name="timer", type="flash.events.TimerEvent")] - function getTimer() { - // number milliseconds of 1970/01/01 - // this different to AS3 implementation which gets the number of milliseconds - // since instance of Flash player was initialised - return Date.now(); - } - utils.getTimer = getTimer; - })(away.utils || (away.utils = {})); - var utils = away.utils; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (utils) { - var RequestAnimationFrame = (function () { - function RequestAnimationFrame(callback, callbackContext) { - var _this = this; - this._active = false; - this._argsArray = new Array(); - this._getTimer = away.utils.getTimer; - - this.setCallback(callback, callbackContext); - - this._rafUpdateFunction = function () { - if (_this._active) { - _this._tick(); - } - }; - - this._argsArray.push(this._dt); - } - // Public - /** - * - * @param callback - * @param callbackContext - */ - RequestAnimationFrame.prototype.setCallback = function (callback, callbackContext) { - this._callback = callback; - this._callbackContext = callbackContext; - }; - - /** - * - */ - RequestAnimationFrame.prototype.start = function () { - this._prevTime = this._getTimer(); - this._active = true; - - if (window.requestAnimationFrame) { - window.requestAnimationFrame(this._rafUpdateFunction); - } else { - if (window['mozRequestAnimationFrame']) { - window.requestAnimationFrame = window['mozRequestAnimationFrame']; - } else if (window['webkitRequestAnimationFrame']) { - window.requestAnimationFrame = window['webkitRequestAnimationFrame']; - } else if (window['oRequestAnimationFrame']) { - window.requestAnimationFrame = window['oRequestAnimationFrame']; - } - } - }; - - /** - * - */ - RequestAnimationFrame.prototype.stop = function () { - this._active = false; - }; - - Object.defineProperty(RequestAnimationFrame.prototype, "active", { - // Get / Set - /** - * - * @returns {boolean} - */ - get: function () { - return this._active; - }, - enumerable: true, - configurable: true - }); - - // Private - /** - * - * @private - */ - RequestAnimationFrame.prototype._tick = function () { - this._currentTime = this._getTimer(); - this._dt = this._currentTime - this._prevTime; - this._argsArray[0] = this._dt; - this._callback.apply(this._callbackContext, this._argsArray); - - window.requestAnimationFrame(this._rafUpdateFunction); - - this._prevTime = this._currentTime; - }; - return RequestAnimationFrame; - })(); - utils.RequestAnimationFrame = RequestAnimationFrame; - })(away.utils || (away.utils = {})); - var utils = away.utils; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (utils) { - //import flash.base.BitmapData; - var TextureUtils = (function () { - function TextureUtils() { - } - TextureUtils.isBitmapDataValid = function (bitmapData) { - if (bitmapData == null) { - return true; - } - - return TextureUtils.isDimensionValid(bitmapData.width) && TextureUtils.isDimensionValid(bitmapData.height); - }; - - TextureUtils.isHTMLImageElementValid = function (image) { - if (image == null) { - return true; - } - - return TextureUtils.isDimensionValid(image.width) && TextureUtils.isDimensionValid(image.height); - }; - - TextureUtils.isDimensionValid = function (d) { - return d >= 1 && d <= TextureUtils.MAX_SIZE && TextureUtils.isPowerOfTwo(d); - }; - - TextureUtils.isPowerOfTwo = function (value) { - return value ? ((value & -value) == value) : false; - }; - - TextureUtils.getBestPowerOf2 = function (value) { - var p = 1; - - while (p < value) - p <<= 1; - - if (p > TextureUtils.MAX_SIZE) - p = TextureUtils.MAX_SIZE; - - return p; - }; - TextureUtils.MAX_SIZE = 2048; - return TextureUtils; - })(); - utils.TextureUtils = TextureUtils; - })(away.utils || (away.utils = {})); - var utils = away.utils; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (utils) { - //[native(cls="TimerClass", gc="exact", instance="TimerObject", methods="auto")] - //[Event(name="timerComplete", type="flash.events.TimerEvent")] - //[Event(name="timer", type="flash.events.TimerEvent")] - var Timer = (function (_super) { - __extends(Timer, _super); - function Timer(delay, repeatCount) { - if (typeof repeatCount === "undefined") { repeatCount = 0; } - _super.call(this); - this._repeatCount = 0; - this._currentCount = 0; - this._running = false; - - this._delay = delay; - this._repeatCount = repeatCount; - - if (isNaN(delay) || delay < 0) { - throw new away.errors.Error("Delay is negative or not a number"); - } - } - Object.defineProperty(Timer.prototype, "currentCount", { - get: function () { - return this._currentCount; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Timer.prototype, "delay", { - get: function () { - return this._delay; - }, - set: function (value) { - this._delay = value; - - if (this._running) { - this.stop(); - this.start(); - } - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Timer.prototype, "repeatCount", { - get: function () { - return this._repeatCount; - }, - set: function (value) { - this._repeatCount = value; - }, - enumerable: true, - configurable: true - }); - - - Timer.prototype.reset = function () { - if (this._running) { - this.stop(); - } - - this._currentCount = 0; - }; - - Object.defineProperty(Timer.prototype, "running", { - get: function () { - return this._running; - }, - enumerable: true, - configurable: true - }); - - Timer.prototype.start = function () { - var _this = this; - this._running = true; - clearInterval(this._iid); - this._iid = setInterval(function () { - return _this.tick(); - }, this._delay); - }; - - Timer.prototype.stop = function () { - this._running = false; - clearInterval(this._iid); - }; - - Timer.prototype.tick = function () { - this._currentCount++; - - if ((this._repeatCount > 0) && this._currentCount >= this._repeatCount) { - this.stop(); - this.dispatchEvent(new away.events.TimerEvent(away.events.TimerEvent.TIMER)); - this.dispatchEvent(new away.events.TimerEvent(away.events.TimerEvent.TIMER_COMPLETE)); - } else { - this.dispatchEvent(new away.events.TimerEvent(away.events.TimerEvent.TIMER)); - } - }; - return Timer; - })(away.events.EventDispatcher); - utils.Timer = Timer; - })(away.utils || (away.utils = {})); - var utils = away.utils; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * A Box object is an area defined by its position, as indicated by its - * top-left-front corner point(x, y, z) and by its width, - * height and depth. - * - * - *

The x, y, z, width, - * height depth properties of the Box class are - * independent of each other; changing the value of one property has no effect - * on the others. However, the right, bottom and - * back properties are integrally related to those six - * properties. For example, if you change the value of the right - * property, the value of the width property changes; if you - * change the bottom property, the value of the - * height property changes.

- * - *

The following methods and properties use Box objects:

- * - *
    - *
  • The bounds property of the DisplayObject class
  • - *
- * - *

You can use the new Box() constructor to create a - * Box object.

- * - *

Note: The Box class does not define a cubic Shape - * display object. - */ - (function (geom) { - var Box = (function () { - /** - * Creates a new Box object with the top-left-front corner specified by the - * x, y and z parameters and with the - * specified width, height and depth - * parameters. If you call this public without parameters, a box with - * x, y, z, width, - * height and depth properties set to 0 is created. - * - * @param x The x coordinate of the top-left-front corner of the - * box. - * @param y The y coordinate of the top-left-front corner of the - * box. - * @param z The z coordinate of the top-left-front corner of the - * box. - * @param width The width of the box, in pixels. - * @param height The height of the box, in pixels. - * @param depth The depth of the box, in pixels. - */ - function Box(x, y, z, width, height, depth) { - if (typeof x === "undefined") { x = 0; } - if (typeof y === "undefined") { y = 0; } - if (typeof z === "undefined") { z = 0; } - if (typeof width === "undefined") { width = 0; } - if (typeof height === "undefined") { height = 0; } - if (typeof depth === "undefined") { depth = 0; } - this.x = x; - this.y = y; - this.z = z; - this.width = width; - this.height = height; - this.depth = depth; - } - Object.defineProperty(Box.prototype, "back", { - /** - * The sum of the z and height properties. - */ - get: function () { - return this.z + this.depth; - }, - set: function (val) { - this.depth = val - this.z; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Box.prototype, "bottom", { - /** - * The sum of the y and height properties. - */ - get: function () { - return this.y + this.height; - }, - set: function (val) { - this.height = val - this.y; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Box.prototype, "bottomRightBack", { - /** - * The location of the Box object's bottom-right corner, determined by the - * values of the right and bottom properties. - */ - get: function () { - if (this._bottomRightBack == null) - this._bottomRightBack = new geom.Vector3D(); - - this._bottomRightBack.x = this.x + this.width; - this._bottomRightBack.y = this.y + this.height; - this._bottomRightBack.z = this.z + this.depth; - - return this._bottomRightBack; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Box.prototype, "front", { - /** - * The z coordinate of the top-left-front corner of the box. Changing - * the front property of a Box object has no effect on the - * x, y, width and height - * properties. However it does affect the depth property, - * whereas changing the z value does not affect the - * depth property. - * - *

The value of the left property is equal to the value of - * the x property.

- */ - get: function () { - return this.z; - }, - set: function (val) { - this.depth += this.z - val; - this.z = val; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Box.prototype, "left", { - /** - * The x coordinate of the top-left corner of the box. Changing the - * left property of a Box object has no effect on the - * y and height properties. However it does affect - * the width property, whereas changing the x value - * does not affect the width property. - * - *

The value of the left property is equal to the value of - * the x property.

- */ - get: function () { - return this.x; - }, - set: function (val) { - this.width += this.x - val; - this.x = val; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Box.prototype, "right", { - /** - * The sum of the x and width properties. - */ - get: function () { - return this.x + this.width; - }, - set: function (val) { - this.width = val - this.x; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Box.prototype, "size", { - /** - * The size of the Box object, expressed as a Vector3D object with the - * values of the width, height and - * depth properties. - */ - get: function () { - if (this._size == null) - this._size = new geom.Vector3D(); - - this._size.x = this.width; - this._size.y = this.height; - this._size.z = this.depth; - - return this._size; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Box.prototype, "top", { - /** - * The y coordinate of the top-left-front corner of the box. Changing - * the top property of a Box object has no effect on the - * x and width properties. However it does affect - * the height property, whereas changing the y - * value does not affect the height property. - * - *

The value of the top property is equal to the value of the - * y property.

- */ - get: function () { - return this.y; - }, - set: function (val) { - this.height += (this.y - val); - this.y = val; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Box.prototype, "topLeftFront", { - /** - * The location of the Box object's top-left-front corner, determined by the - * x, y and z coordinates of the point. - */ - get: function () { - if (this._topLeftFront == null) - this._topLeftFront = new away.geom.Vector3D(); - - this._topLeftFront.x = this.x; - this._topLeftFront.y = this.y; - this._topLeftFront.z = this.z; - - return this._topLeftFront; - }, - enumerable: true, - configurable: true - }); - - /** - * Returns a new Box object with the same values for the x, - * y, z, width, height - * and depth properties as the original Box object. - * - * @return A new Box object with the same values for the x, - * y, z, width, - * height and depth properties as the - * original Box object. - */ - Box.prototype.clone = function () { - return new Box(this.x, this.y, this.z, this.width, this.height, this.depth); - }; - - /** - * Determines whether the specified position is contained within the cubic - * region defined by this Box object. - * - * @param x The x coordinate(horizontal component) of the position. - * @param y The y coordinate(vertical component) of the position. - * @param z The z coordinate(longitudinal component) of the position. - * @return A value of true if the Box object contains the - * specified position; otherwise false. - */ - Box.prototype.contains = function (x, y, z) { - return (this.x <= x && this.x + this.width >= x && this.y <= y && this.y + this.height >= y && this.z <= z && this.z + this.depth >= z); - }; - - /** - * Determines whether the specified position is contained within the cubic - * region defined by this Box object. This method is similar to the - * Box.contains() method, except that it takes a Vector3D - * object as a parameter. - * - * @param position The position, as represented by its x, y and - * z coordinates. - * @return A value of true if the Box object contains the - * specified position; otherwise false. - */ - Box.prototype.containsPoint = function (position) { - return (this.x <= position.x && this.x + this.width >= position.x && this.y <= position.y && this.y + this.height >= position.y && this.z <= position.z && this.z + this.depth >= position.z); - }; - - /** - * Determines whether the Box object specified by the box - * parameter is contained within this Box object. A Box object is said to - * contain another if the second Box object falls entirely within the - * boundaries of the first. - * - * @param box The Box object being checked. - * @return A value of true if the Box object that you specify - * is contained by this Box object; otherwise false. - */ - Box.prototype.containsRect = function (box) { - return (this.x <= box.x && this.x + this.width >= box.x + box.width && this.y <= box.y && this.y + this.height >= box.y + box.height && this.z <= box.z && this.z + this.depth >= box.z + box.depth); - }; - - /** - * Copies all of box data from the source Box object into the calling - * Box object. - * - * @param sourceBox The Box object from which to copy the data. - */ - Box.prototype.copyFrom = function (sourceBox) { - //TODO - }; - - /** - * Determines whether the object specified in the toCompare - * parameter is equal to this Box object. This method compares the - * x, y, z, width, - * height and depth properties of an object against - * the same properties of this Box object. - * - * @param toCompare The box to compare to this Box object. - * @return A value of true if the object has exactly the same - * values for the x, y, z, - * width, height and depth - * properties as this Box object; otherwise false. - */ - Box.prototype.equals = function (toCompare) { - return (this.x == toCompare.x && this.y == toCompare.y && this.z == toCompare.z && this.width == toCompare.width && this.height == toCompare.height && this.depth == toCompare.depth); - }; - - /** - * Increases the size of the Box object by the specified amounts, in - * pixels. The center point of the Box object stays the same, and its - * size increases to the left and right by the dx value, to - * the top and the bottom by the dy value, and to - * the front and the back by the dz value. - * - * @param dx The value to be added to the left and the right of the Box - * object. The following equation is used to calculate the new - * width and position of the box: - * @param dy The value to be added to the top and the bottom of the Box - * object. The following equation is used to calculate the new - * height and position of the box: - * @param dz The value to be added to the front and the back of the Box - * object. The following equation is used to calculate the new - * depth and position of the box: - */ - Box.prototype.inflate = function (dx, dy, dz) { - this.x -= dx / 2; - this.y -= dy / 2; - this.z -= dz / 2; - this.width += dx / 2; - this.height += dy / 2; - this.depth += dz / 2; - }; - - /** - * Increases the size of the Box object. This method is similar to the - * Box.inflate() method except it takes a Vector3D object as - * a parameter. - * - *

The following two code examples give the same result:

- * - * @param delta The x property of this Vector3D object is used to - * increase the horizontal dimension of the Box object. - * The y property is used to increase the vertical - * dimension of the Box object. - * The z property is used to increase the - * longitudinal dimension of the Box object. - */ - Box.prototype.inflatePoint = function (delta) { - this.x -= delta.x / 2; - this.y -= delta.y / 2; - this.z -= delta.z / 2; - this.width += delta.x / 2; - this.height += delta.y / 2; - this.depth += delta.z / 2; - }; - - /** - * If the Box object specified in the toIntersect parameter - * intersects with this Box object, returns the area of intersection - * as a Box object. If the boxes do not intersect, this method returns an - * empty Box object with its properties set to 0. - * - * @param toIntersect The Box object to compare against to see if it - * intersects with this Box object. - * @return A Box object that equals the area of intersection. If the - * boxes do not intersect, this method returns an empty Box - * object; that is, a box with its x, y, - * z, width, height, and - * depth properties set to 0. - */ - Box.prototype.intersection = function (toIntersect) { - if (this.intersects(toIntersect)) { - var i = new Box(); - - if (this.x > toIntersect.x) { - i.x = this.x; - i.width = toIntersect.x - this.x + toIntersect.width; - - if (i.width > this.width) - i.width = this.width; - } else { - i.x = toIntersect.x; - i.width = this.x - toIntersect.x + this.width; - - if (i.width > toIntersect.width) - i.width = toIntersect.width; - } - - if (this.y > toIntersect.y) { - i.y = this.y; - i.height = toIntersect.y - this.y + toIntersect.height; - - if (i.height > this.height) - i.height = this.height; - } else { - i.y = toIntersect.y; - i.height = this.y - toIntersect.y + this.height; - - if (i.height > toIntersect.height) - i.height = toIntersect.height; - } - - if (this.z > toIntersect.z) { - i.z = this.z; - i.depth = toIntersect.z - this.z + toIntersect.depth; - - if (i.depth > this.depth) - i.depth = this.depth; - } else { - i.z = toIntersect.z; - i.depth = this.z - toIntersect.z + this.depth; - - if (i.depth > toIntersect.depth) - i.depth = toIntersect.depth; - } - - return i; - } - - return new Box(); - }; - - /** - * Determines whether the object specified in the toIntersect - * parameter intersects with this Box object. This method checks the - * x, y, z, width, - * height, and depth properties of the specified - * Box object to see if it intersects with this Box object. - * - * @param toIntersect The Box object to compare against this Box object. - * @return A value of true if the specified object intersects - * with this Box object; otherwise false. - */ - Box.prototype.intersects = function (toIntersect) { - return (this.x + this.width > toIntersect.x && this.x < toIntersect.x + toIntersect.width && this.y + this.height > toIntersect.y && this.y < toIntersect.y + toIntersect.height && this.z + this.depth > toIntersect.z && this.z < toIntersect.z + toIntersect.depth); - }; - - /** - * Determines whether or not this Box object is empty. - * - * @return A value of true if the Box object's width, height or - * depth is less than or equal to 0; otherwise false. - */ - Box.prototype.isEmpty = function () { - return (this.x == 0 && this.y == 0 && this.z == 0 && this.width == 0 && this.height == 0 && this.depth == 0); - }; - - /** - * Adjusts the location of the Box object, as determined by its - * top-left-front corner, by the specified amounts. - * - * @param dx Moves the x value of the Box object by this amount. - * @param dy Moves the y value of the Box object by this amount. - * @param dz Moves the z value of the Box object by this amount. - */ - Box.prototype.offset = function (dx, dy, dz) { - this.x += dx; - this.y += dy; - this.z += dz; - }; - - /** - * Adjusts the location of the Box object using a Vector3D object as a - * parameter. This method is similar to the Box.offset() - * method, except that it takes a Vector3D object as a parameter. - * - * @param position A Vector3D object to use to offset this Box object. - */ - Box.prototype.offsetPosition = function (position) { - this.x += position.x; - this.y += position.y; - this.z += position.z; - }; - - /** - * Sets all of the Box object's properties to 0. A Box object is empty if its - * width, height or depth is less than or equal to 0. - * - *

This method sets the values of the x, y, - * z, width, height, and - * depth properties to 0.

- * - */ - Box.prototype.setEmpty = function () { - this.x = 0; - this.y = 0; - this.z = 0; - this.width = 0; - this.height = 0; - this.depth = 0; - }; - - /** - * Sets the members of Box to the specified values - * - * @param xa The x coordinate of the top-left-front corner of the - * box. - * @param ya The y coordinate of the top-left-front corner of the - * box. - * @param yz The z coordinate of the top-left-front corner of the - * box. - * @param widtha The width of the box, in pixels. - * @param heighta The height of the box, in pixels. - * @param deptha The depth of the box, in pixels. - */ - Box.prototype.setTo = function (xa, ya, za, widtha, heighta, deptha) { - this.x = xa; - this.y = ya; - this.z = za; - this.width = widtha; - this.height = heighta; - this.depth = deptha; - }; - - /** - * Builds and returns a string that lists the horizontal, vertical and - * longitudinal positions and the width, height and depth of the Box object. - * - * @return A string listing the value of each of the following properties of - * the Box object: x, y, z, - * width, height, and depth. - */ - Box.prototype.toString = function () { - return "[Box] (x=" + this.x + ", y=" + this.y + ", z=" + this.z + ", width=" + this.width + ", height=" + this.height + ", depth=" + this.depth + ")"; - }; - - /** - * Adds two boxes together to create a new Box object, by filling - * in the horizontal, vertical and longitudinal space between the two boxes. - * - *

Note: The union() method ignores boxes with - * 0 as the height, width or depth value, such as: var - * box2:Box = new Box(300,300,300,50,50,0);

- * - * @param toUnion A Box object to add to this Box object. - * @return A new Box object that is the union of the two boxes. - */ - Box.prototype.union = function (toUnion) { - var u = new Box(); - - if (this.x < toUnion.x) { - u.x = this.x; - u.width = toUnion.x - this.x + toUnion.width; - - if (u.width < this.width) - u.width = this.width; - } else { - u.x = toUnion.x; - u.width = this.x - toUnion.x + this.width; - - if (u.width < toUnion.width) - u.width = toUnion.width; - } - - if (this.y < toUnion.y) { - u.y = this.y; - u.height = toUnion.y - this.y + toUnion.height; - - if (u.height < this.height) - u.height = this.height; - } else { - u.y = toUnion.y; - u.height = this.y - toUnion.y + this.height; - - if (u.height < toUnion.height) - u.height = toUnion.height; - } - - if (this.z < toUnion.z) { - u.z = this.z; - u.depth = toUnion.z - this.z + toUnion.depth; - - if (u.depth < this.depth) - u.depth = this.depth; - } else { - u.z = toUnion.z; - u.depth = this.z - toUnion.z + this.depth; - - if (u.depth < toUnion.depth) - u.depth = toUnion.depth; - } - - return u; - }; - return Box; - })(); - geom.Box = Box; - })(away.geom || (away.geom = {})); - var geom = away.geom; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The ColorTransform class lets you adjust the color values in a display - * object. The color adjustment or color transformation can be applied - * to all four channels: red, green, blue, and alpha transparency. - * - *

When a ColorTransform object is applied to a display object, a new value - * for each color channel is calculated like this:

- * - *
    - *
  • New red value = (old red value * redMultiplier) + - * redOffset
  • - *
  • New green value = (old green value * greenMultiplier) + - * greenOffset
  • - *
  • New blue value = (old blue value * blueMultiplier) + - * blueOffset
  • - *
  • New alpha value = (old alpha value * alphaMultiplier) + - * alphaOffset
  • - *
- * - *

If any of the color channel values is greater than 255 after the - * calculation, it is set to 255. If it is less than 0, it is set to 0.

- * - *

You can use ColorTransform objects in the following ways:

- * - *
    - *
  • In the colorTransform parameter of the - * colorTransform() method of the BitmapData class
  • - *
  • As the colorTransform property of a Transform object - * (which can be used as the transform property of a display - * object)
  • - *
- * - *

You must use the new ColorTransform() constructor to create - * a ColorTransform object before you can call the methods of the - * ColorTransform object.

- * - *

Color transformations do not apply to the background color of a movie - * clip(such as a loaded SWF object). They apply only to graphics and symbols - * that are attached to the movie clip.

- */ - (function (geom) { - var ColorTransform = (function () { - /** - * Creates a ColorTransform object for a display object with the specified - * color channel values and alpha values. - * - * @param redMultiplier The value for the red multiplier, in the range from - * 0 to 1. - * @param greenMultiplier The value for the green multiplier, in the range - * from 0 to 1. - * @param blueMultiplier The value for the blue multiplier, in the range - * from 0 to 1. - * @param alphaMultiplier The value for the alpha transparency multiplier, in - * the range from 0 to 1. - * @param redOffset The offset value for the red color channel, in the - * range from -255 to 255. - * @param greenOffset The offset value for the green color channel, in - * the range from -255 to 255. - * @param blueOffset The offset for the blue color channel value, in the - * range from -255 to 255. - * @param alphaOffset The offset for alpha transparency channel value, in - * the range from -255 to 255. - */ - function ColorTransform(redMultiplier, greenMultiplier, blueMultiplier, alphaMultiplier, redOffset, greenOffset, blueOffset, alphaOffset) { - if (typeof redMultiplier === "undefined") { redMultiplier = 1; } - if (typeof greenMultiplier === "undefined") { greenMultiplier = 1; } - if (typeof blueMultiplier === "undefined") { blueMultiplier = 1; } - if (typeof alphaMultiplier === "undefined") { alphaMultiplier = 1; } - if (typeof redOffset === "undefined") { redOffset = 0; } - if (typeof greenOffset === "undefined") { greenOffset = 0; } - if (typeof blueOffset === "undefined") { blueOffset = 0; } - if (typeof alphaOffset === "undefined") { alphaOffset = 0; } - this.redMultiplier = redMultiplier; - this.greenMultiplier = greenMultiplier; - this.blueMultiplier = blueMultiplier; - this.alphaMultiplier = alphaMultiplier; - this.redOffset = redOffset; - this.greenOffset = greenOffset; - this.blueOffset = blueOffset; - this.alphaOffset = alphaOffset; - } - Object.defineProperty(ColorTransform.prototype, "color", { - /** - * The RGB color value for a ColorTransform object. - * - *

When you set this property, it changes the three color offset values - * (redOffset, greenOffset, and - * blueOffset) accordingly, and it sets the three color - * multiplier values(redMultiplier, - * greenMultiplier, and blueMultiplier) to 0. The - * alpha transparency multiplier and offset values do not change.

- * - *

When you pass a value for this property, use the format - * 0xRRGGBB. RR, GG, and BB each consist of two - * hexadecimal digits that specify the offset of each color component. The 0x - * tells the ActionScript compiler that the number is a hexadecimal - * value.

- */ - get: function () { - return ((this.redOffset << 16) | (this.greenOffset << 8) | this.blueOffset); - }, - set: function (value) { - var argb = away.utils.ColorUtils.float32ColorToARGB(value); - - this.redOffset = argb[1]; //(value >> 16) & 0xFF; - this.greenOffset = argb[2]; //(value >> 8) & 0xFF; - this.blueOffset = argb[3]; //value & 0xFF; - - this.redMultiplier = 0; - this.greenMultiplier = 0; - this.blueMultiplier = 0; - }, - enumerable: true, - configurable: true - }); - - - /** - * Concatenates the ColorTranform object specified by the second - * parameter with the current ColorTransform object and sets the current - * object as the result, which is an additive combination of the two color - * transformations. When you apply the concatenated ColorTransform object, - * the effect is the same as applying the second color - * transformation after the original color transformation. - * - * @param second The ColorTransform object to be combined with the current - * ColorTransform object. - */ - ColorTransform.prototype.concat = function (second) { - this.redMultiplier += second.redMultiplier; - this.greenMultiplier += second.greenMultiplier; - this.blueMultiplier += second.blueMultiplier; - this.alphaMultiplier += second.alphaMultiplier; - }; - return ColorTransform; - })(); - geom.ColorTransform = ColorTransform; - })(away.geom || (away.geom = {})); - var geom = away.geom; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (geom) { - /** - * MathConsts provides some commonly used mathematical constants - */ - var MathConsts = (function () { - function MathConsts() { - } - MathConsts.RADIANS_TO_DEGREES = 180 / Math.PI; - - MathConsts.DEGREES_TO_RADIANS = Math.PI / 180; - return MathConsts; - })(); - geom.MathConsts = MathConsts; - })(away.geom || (away.geom = {})); - var geom = away.geom; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The Matrix class represents a transformation matrix that determines how to - * map points from one coordinate space to another. You can perform various - * graphical transformations on a display object by setting the properties of - * a Matrix object, applying that Matrix object to the matrix - * property of a Transform object, and then applying that Transform object as - * the transform property of the display object. These - * transformation functions include translation(x and y - * repositioning), rotation, scaling, and skewing. - * - *

Together these types of transformations are known as affine - * transformations. Affine transformations preserve the straightness of - * lines while transforming, so that parallel lines stay parallel.

- * - *

To apply a transformation matrix to a display object, you create a - * Transform object, set its matrix property to the - * transformation matrix, and then set the transform property of - * the display object to the Transform object. Matrix objects are also used as - * parameters of some methods, such as the following:

- * - *
    - *
  • The draw() method of a BitmapData object
  • - *
  • The beginBitmapFill() method, - * beginGradientFill() method, or - * lineGradientStyle() method of a Graphics object
  • - *
- * - *

A transformation matrix object is a 3 x 3 matrix with the following - * contents:

- * - *

In traditional transformation matrixes, the u, - * v, and w properties provide extra capabilities. - * The Matrix class can only operate in two-dimensional space, so it always - * assumes that the property values u and v are 0.0, - * and that the property value w is 1.0. The effective values of - * the matrix are as follows:

- * - *

You can get and set the values of all six of the other properties in a - * Matrix object: a, b, c, - * d, tx, and ty.

- * - *

The Matrix class supports the four major types of transformations: - * translation, scaling, rotation, and skewing. You can set three of these - * transformations by using specialized methods, as described in the following - * table:

- * - *

Each transformation function alters the current matrix properties so - * that you can effectively combine multiple transformations. To do this, you - * call more than one transformation function before applying the matrix to - * its display object target(by using the transform property of - * that display object).

- * - *

Use the new Matrix() constructor to create a Matrix object - * before you can call the methods of the Matrix object.

- */ - (function (geom) { - var Matrix = (function () { - /** - * Creates a new Matrix object with the specified parameters. In matrix - * notation, the properties are organized like this: - * - *

If you do not provide any parameters to the new Matrix() - * constructor, it creates an identity matrix with the following - * values:

- * - *

In matrix notation, the identity matrix looks like this:

- * - * @param a The value that affects the positioning of pixels along the - * x axis when scaling or rotating an image. - * @param b The value that affects the positioning of pixels along the - * y axis when rotating or skewing an image. - * @param c The value that affects the positioning of pixels along the - * x axis when rotating or skewing an image. - * @param d The value that affects the positioning of pixels along the - * y axis when scaling or rotating an image.. - * @param tx The distance by which to translate each point along the x - * axis. - * @param ty The distance by which to translate each point along the y - * axis. - */ - function Matrix(a, b, c, d, tx, ty) { - if (typeof a === "undefined") { a = 1; } - if (typeof b === "undefined") { b = 0; } - if (typeof c === "undefined") { c = 0; } - if (typeof d === "undefined") { d = 1; } - if (typeof tx === "undefined") { tx = 0; } - if (typeof ty === "undefined") { ty = 0; } - this.a = a; - this.b = b; - this.c = c; - this.d = d; - this.tx = tx; - this.ty = ty; - } - /** - * Returns a new Matrix object that is a clone of this matrix, with an exact - * copy of the contained object. - * - * @return A Matrix object. - */ - Matrix.prototype.clone = function () { - return new Matrix(this.a, this.b, this.c, this.d, this.tx, this.ty); - }; - - /** - * Concatenates a matrix with the current matrix, effectively combining the - * geometric effects of the two. In mathematical terms, concatenating two - * matrixes is the same as combining them using matrix multiplication. - * - *

For example, if matrix m1 scales an object by a factor of - * four, and matrix m2 rotates an object by 1.5707963267949 - * radians(Math.PI/2), then m1.concat(m2) - * transforms m1 into a matrix that scales an object by a factor - * of four and rotates the object by Math.PI/2 radians.

- * - *

This method replaces the source matrix with the concatenated matrix. If - * you want to concatenate two matrixes without altering either of the two - * source matrixes, first copy the source matrix by using the - * clone() method, as shown in the Class Examples section.

- * - * @param matrix The matrix to be concatenated to the source matrix. - */ - Matrix.prototype.concat = function (matrix) { - var a1 = this.a * matrix.a + this.b * matrix.c; - this.b = this.a * matrix.b + this.b * matrix.d; - this.a = a1; - - var c1 = this.c * matrix.a + this.d * matrix.c; - this.d = this.c * matrix.b + this.d * matrix.d; - - this.c = c1; - - var tx1 = this.tx * matrix.a + this.ty * matrix.c + matrix.tx; - this.ty = this.tx * matrix.b + this.ty * matrix.d + matrix.ty; - this.tx = tx1; - }; - - /** - * Copies a Vector3D object into specific column of the calling Matrix3D - * object. - * - * @param column The column from which to copy the data from. - * @param vector3D The Vector3D object from which to copy the data. - */ - Matrix.prototype.copyColumnFrom = function (column, vector3D) { - if (column > 2) { - throw "Column " + column + " out of bounds (2)"; - } else if (column == 0) { - this.a = vector3D.x; - this.c = vector3D.y; - } else if (column == 1) { - this.b = vector3D.x; - this.d = vector3D.y; - } else { - this.tx = vector3D.x; - this.ty = vector3D.y; - } - }; - - /** - * Copies specific column of the calling Matrix object into the Vector3D - * object. The w element of the Vector3D object will not be changed. - * - * @param column The column from which to copy the data from. - * @param vector3D The Vector3D object from which to copy the data. - */ - Matrix.prototype.copyColumnTo = function (column, vector3D) { - if (column > 2) { - throw new away.errors.ArgumentError("ArgumentError, Column " + column + " out of bounds [0, ..., 2]"); - } else if (column == 0) { - vector3D.x = this.a; - vector3D.y = this.c; - vector3D.z = 0; - } else if (column == 1) { - vector3D.x = this.b; - vector3D.y = this.d; - vector3D.z = 0; - } else { - vector3D.x = this.tx; - vector3D.y = this.ty; - vector3D.z = 1; - } - }; - - /** - * Copies all of the matrix data from the source Point object into the - * calling Matrix object. - * - * @param sourceMatrix The Matrix object from which to copy the data. - */ - Matrix.prototype.copyFrom = function (sourceMatrix) { - this.a = sourceMatrix.a; - this.b = sourceMatrix.b; - this.c = sourceMatrix.c; - this.d = sourceMatrix.d; - this.tx = sourceMatrix.tx; - this.ty = sourceMatrix.ty; - }; - - /** - * Copies a Vector3D object into specific row of the calling Matrix object. - * - * @param row The row from which to copy the data from. - * @param vector3D The Vector3D object from which to copy the data. - */ - Matrix.prototype.copyRowFrom = function (row, vector3D) { - if (row > 2) { - throw new away.errors.ArgumentError("ArgumentError, Row " + row + " out of bounds [0, ..., 2]"); - } else if (row == 0) { - this.a = vector3D.x; - this.c = vector3D.y; - } else if (row == 1) { - this.b = vector3D.x; - this.d = vector3D.y; - } else { - this.tx = vector3D.x; - this.ty = vector3D.y; - } - }; - - /** - * Copies specific row of the calling Matrix object into the Vector3D object. - * The w element of the Vector3D object will not be changed. - * - * @param row The row from which to copy the data from. - * @param vector3D The Vector3D object from which to copy the data. - */ - Matrix.prototype.copyRowTo = function (row, vector3D) { - if (row > 2) { - throw new away.errors.ArgumentError("ArgumentError, Row " + row + " out of bounds [0, ..., 2]"); - } else if (row == 0) { - vector3D.x = this.a; - vector3D.y = this.b; - vector3D.z = this.tx; - } else if (row == 1) { - vector3D.x = this.c; - vector3D.y = this.d; - vector3D.z = this.ty; - } else { - vector3D.setTo(0, 0, 1); - } - }; - - /** - * Includes parameters for scaling, rotation, and translation. When applied - * to a matrix it sets the matrix's values based on those parameters. - * - *

Using the createBox() method lets you obtain the same - * matrix as you would if you applied the identity(), - * rotate(), scale(), and translate() - * methods in succession. For example, mat1.createBox(2,2,Math.PI/4, - * 100, 100) has the same effect as the following:

- * - * @param scaleX The factor by which to scale horizontally. - * @param scaleY The factor by which scale vertically. - * @param rotation The amount to rotate, in radians. - * @param tx The number of pixels to translate(move) to the right - * along the x axis. - * @param ty The number of pixels to translate(move) down along the - * y axis. - */ - Matrix.prototype.createBox = function (scaleX, scaleY, rotation, tx, ty) { - if (typeof rotation === "undefined") { rotation = 0; } - if (typeof tx === "undefined") { tx = 0; } - if (typeof ty === "undefined") { ty = 0; } - this.a = scaleX; - this.d = scaleY; - this.b = rotation; - this.tx = tx; - this.ty = ty; - }; - - /** - * Creates the specific style of matrix expected by the - * beginGradientFill() and lineGradientStyle() - * methods of the Graphics class. Width and height are scaled to a - * scaleX/scaleY pair and the - * tx/ty values are offset by half the width and - * height. - * - *

For example, consider a gradient with the following - * characteristics:

- * - *
    - *
  • GradientType.LINEAR
  • - *
  • Two colors, green and blue, with the ratios array set to [0, - * 255]
  • - *
  • SpreadMethod.PAD
  • - *
  • InterpolationMethod.LINEAR_RGB
  • - *
- * - *

The following illustrations show gradients in which the matrix was - * defined using the createGradientBox() method with different - * parameter settings:

- * - * @param width The width of the gradient box. - * @param height The height of the gradient box. - * @param rotation The amount to rotate, in radians. - * @param tx The distance, in pixels, to translate to the right along - * the x axis. This value is offset by half of the - * width parameter. - * @param ty The distance, in pixels, to translate down along the - * y axis. This value is offset by half of the - * height parameter. - */ - Matrix.prototype.createGradientBox = function (width, height, rotation, tx, ty) { - if (typeof rotation === "undefined") { rotation = 0; } - if (typeof tx === "undefined") { tx = 0; } - if (typeof ty === "undefined") { ty = 0; } - this.a = width / 1638.4; - this.d = height / 1638.4; - - if (rotation != 0.0) { - var cos = Math.cos(rotation); - var sin = Math.sin(rotation); - - this.b = sin * this.d; - this.c = -sin * this.a; - this.a *= cos; - this.d *= cos; - } else { - this.b = this.c = 0; - } - - this.tx = tx + width / 2; - this.ty = ty + height / 2; - }; - - /** - * Given a point in the pretransform coordinate space, returns the - * coordinates of that point after the transformation occurs. Unlike the - * standard transformation applied using the transformPoint() - * method, the deltaTransformPoint() method's transformation - * does not consider the translation parameters tx and - * ty. - * - * @param point The point for which you want to get the result of the matrix - * transformation. - * @return The point resulting from applying the matrix transformation. - */ - Matrix.prototype.deltaTransformPoint = function (point) { - return new away.geom.Point(point.x * this.a + point.y * this.c, point.x * this.b + point.y * this.d); - }; - - /** - * Sets each matrix property to a value that causes a null transformation. An - * object transformed by applying an identity matrix will be identical to the - * original. - * - *

After calling the identity() method, the resulting matrix - * has the following properties: a=1, b=0, - * c=0, d=1, tx=0, - * ty=0.

- * - *

In matrix notation, the identity matrix looks like this:

- * - */ - Matrix.prototype.identity = function () { - this.a = 1; - this.b = 0; - this.c = 0; - this.d = 1; - this.tx = 0; - this.ty = 0; - }; - - /** - * Performs the opposite transformation of the original matrix. You can apply - * an inverted matrix to an object to undo the transformation performed when - * applying the original matrix. - */ - Matrix.prototype.invert = function () { - var norm = this.a * this.d - this.b * this.c; - - if (norm == 0) { - this.a = this.b = this.c = this.d = 0; - this.tx = -this.tx; - this.ty = -this.ty; - } else { - norm = 1.0 / norm; - var a1 = this.d * norm; - this.d = this.a * norm; - this.a = a1; - this.b *= -norm; - this.c *= -norm; - - var tx1 = -this.a * this.tx - this.c * this.ty; - this.ty = -this.b * this.tx - this.d * this.ty; - this.tx = tx1; - } - }; - - /** - * Returns a new Matrix object that is a clone of this matrix, with an exact - * copy of the contained object. - * - * @param matrix The matrix for which you want to get the result of the matrix - * transformation. - * @return A Matrix object. - */ - Matrix.prototype.multiply = function (matrix) { - var result = new Matrix(); - - result.a = this.a * matrix.a + this.b * matrix.c; - result.b = this.a * matrix.b + this.b * matrix.d; - result.c = this.c * matrix.a + this.d * matrix.c; - result.d = this.c * matrix.b + this.d * matrix.d; - - result.tx = this.tx * matrix.a + this.ty * matrix.c + matrix.tx; - result.ty = this.tx * matrix.b + this.ty * matrix.d + matrix.ty; - - return result; - }; - - /** - * Applies a rotation transformation to the Matrix object. - * - *

The rotate() method alters the a, - * b, c, and d properties of the - * Matrix object. In matrix notation, this is the same as concatenating the - * current matrix with the following:

- * - * @param angle The rotation angle in radians. - */ - Matrix.prototype.rotate = function (angle) { - var cos = Math.cos(angle); - var sin = Math.sin(angle); - - var a1 = this.a * cos - this.b * sin; - this.b = this.a * sin + this.b * cos; - this.a = a1; - - var c1 = this.c * cos - this.d * sin; - this.d = this.c * sin + this.d * cos; - this.c = c1; - - var tx1 = this.tx * cos - this.ty * sin; - this.ty = this.tx * sin + this.ty * cos; - this.tx = tx1; - }; - - /** - * Applies a scaling transformation to the matrix. The x axis is - * multiplied by sx, and the y axis it is multiplied by - * sy. - * - *

The scale() method alters the a and - * d properties of the Matrix object. In matrix notation, this - * is the same as concatenating the current matrix with the following - * matrix:

- * - * @param sx A multiplier used to scale the object along the x axis. - * @param sy A multiplier used to scale the object along the y axis. - */ - Matrix.prototype.scale = function (sx, sy) { - this.a *= sx; - this.b *= sy; - - this.c *= sx; - this.d *= sy; - - this.tx *= sx; - this.ty *= sy; - }; - - /** - * Sets the members of Matrix to the specified values. - * - * @param a The value that affects the positioning of pixels along the - * x axis when scaling or rotating an image. - * @param b The value that affects the positioning of pixels along the - * y axis when rotating or skewing an image. - * @param c The value that affects the positioning of pixels along the - * x axis when rotating or skewing an image. - * @param d The value that affects the positioning of pixels along the - * y axis when scaling or rotating an image.. - * @param tx The distance by which to translate each point along the x - * axis. - * @param ty The distance by which to translate each point along the y - * axis. - */ - Matrix.prototype.setTo = function (a, b, c, d, tx, ty) { - this.a = a; - this.b = b; - this.c = c; - this.d = d; - this.tx = tx; - this.ty = ty; - }; - - /** - * Returns a text value listing the properties of the Matrix object. - * - * @return A string containing the values of the properties of the Matrix - * object: a, b, c, - * d, tx, and ty. - */ - Matrix.prototype.toString = function () { - return "[Matrix] (a=" + this.a + ", b=" + this.b + ", c=" + this.c + ", d=" + this.d + ", tx=" + this.tx + ", ty=" + this.ty + ")"; - }; - - /** - * Returns the result of applying the geometric transformation represented by - * the Matrix object to the specified point. - * - * @param point The point for which you want to get the result of the Matrix - * transformation. - * @return The point resulting from applying the Matrix transformation. - */ - Matrix.prototype.transformPoint = function (point) { - return new away.geom.Point(point.x * this.a + point.y * this.c + this.tx, point.x * this.b + point.y * this.d + this.ty); - }; - - /** - * Translates the matrix along the x and y axes, as specified - * by the dx and dy parameters. - * - * @param dx The amount of movement along the x axis to the right, in - * pixels. - * @param dy The amount of movement down along the y axis, in pixels. - */ - Matrix.prototype.translate = function (dx, dy) { - this.tx += dx; - this.ty += dy; - }; - return Matrix; - })(); - geom.Matrix = Matrix; - })(away.geom || (away.geom = {})); - var geom = away.geom; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (geom) { - var Matrix3D = (function () { - /** - * Creates a Matrix3D object. - */ - function Matrix3D(v) { - if (typeof v === "undefined") { v = null; } - if (v != null && v.length == 16) - this.rawData = v.concat(); - else - this.rawData = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]; - } - /** - * Appends the matrix by multiplying another Matrix3D object by the current Matrix3D object. - */ - Matrix3D.prototype.append = function (lhs) { - var m111 = this.rawData[0], m121 = this.rawData[4], m131 = this.rawData[8], m141 = this.rawData[12], m112 = this.rawData[1], m122 = this.rawData[5], m132 = this.rawData[9], m142 = this.rawData[13], m113 = this.rawData[2], m123 = this.rawData[6], m133 = this.rawData[10], m143 = this.rawData[14], m114 = this.rawData[3], m124 = this.rawData[7], m134 = this.rawData[11], m144 = this.rawData[15], m211 = lhs.rawData[0], m221 = lhs.rawData[4], m231 = lhs.rawData[8], m241 = lhs.rawData[12], m212 = lhs.rawData[1], m222 = lhs.rawData[5], m232 = lhs.rawData[9], m242 = lhs.rawData[13], m213 = lhs.rawData[2], m223 = lhs.rawData[6], m233 = lhs.rawData[10], m243 = lhs.rawData[14], m214 = lhs.rawData[3], m224 = lhs.rawData[7], m234 = lhs.rawData[11], m244 = lhs.rawData[15]; - - this.rawData[0] = m111 * m211 + m112 * m221 + m113 * m231 + m114 * m241; - this.rawData[1] = m111 * m212 + m112 * m222 + m113 * m232 + m114 * m242; - this.rawData[2] = m111 * m213 + m112 * m223 + m113 * m233 + m114 * m243; - this.rawData[3] = m111 * m214 + m112 * m224 + m113 * m234 + m114 * m244; - - this.rawData[4] = m121 * m211 + m122 * m221 + m123 * m231 + m124 * m241; - this.rawData[5] = m121 * m212 + m122 * m222 + m123 * m232 + m124 * m242; - this.rawData[6] = m121 * m213 + m122 * m223 + m123 * m233 + m124 * m243; - this.rawData[7] = m121 * m214 + m122 * m224 + m123 * m234 + m124 * m244; - - this.rawData[8] = m131 * m211 + m132 * m221 + m133 * m231 + m134 * m241; - this.rawData[9] = m131 * m212 + m132 * m222 + m133 * m232 + m134 * m242; - this.rawData[10] = m131 * m213 + m132 * m223 + m133 * m233 + m134 * m243; - this.rawData[11] = m131 * m214 + m132 * m224 + m133 * m234 + m134 * m244; - - this.rawData[12] = m141 * m211 + m142 * m221 + m143 * m231 + m144 * m241; - this.rawData[13] = m141 * m212 + m142 * m222 + m143 * m232 + m144 * m242; - this.rawData[14] = m141 * m213 + m142 * m223 + m143 * m233 + m144 * m243; - this.rawData[15] = m141 * m214 + m142 * m224 + m143 * m234 + m144 * m244; - }; - - /** - * Appends an incremental rotation to a Matrix3D object. - */ - Matrix3D.prototype.appendRotation = function (degrees, axis) { - var m = Matrix3D.getAxisRotation(axis.x, axis.y, axis.z, degrees); - - this.append(m); - }; - - /** - * Appends an incremental scale change along the x, y, and z axes to a Matrix3D object. - */ - Matrix3D.prototype.appendScale = function (xScale, yScale, zScale) { - this.append(new Matrix3D([xScale, 0.0, 0.0, 0.0, 0.0, yScale, 0.0, 0.0, 0.0, 0.0, zScale, 0.0, 0.0, 0.0, 0.0, 1.0])); - }; - - /** - * Appends an incremental translation, a repositioning along the x, y, and z axes, to a Matrix3D object. - */ - Matrix3D.prototype.appendTranslation = function (x, y, z) { - this.rawData[12] += x; - this.rawData[13] += y; - this.rawData[14] += z; - }; - - /** - * Returns a new Matrix3D object that is an exact copy of the current Matrix3D object. - */ - Matrix3D.prototype.clone = function () { - return new Matrix3D(this.rawData.slice(0)); - }; - - /** - * Copies a Vector3D object into specific column of the calling Matrix3D object. - */ - Matrix3D.prototype.copyColumnFrom = function (column, vector3D) { - switch (column) { - case 0: - this.rawData[0] = vector3D.x; - this.rawData[1] = vector3D.y; - this.rawData[2] = vector3D.z; - this.rawData[3] = vector3D.w; - break; - case 1: - this.rawData[4] = vector3D.x; - this.rawData[5] = vector3D.y; - this.rawData[6] = vector3D.z; - this.rawData[7] = vector3D.w; - break; - case 2: - this.rawData[8] = vector3D.x; - this.rawData[9] = vector3D.y; - this.rawData[10] = vector3D.z; - this.rawData[11] = vector3D.w; - break; - case 3: - this.rawData[12] = vector3D.x; - this.rawData[13] = vector3D.y; - this.rawData[14] = vector3D.z; - this.rawData[15] = vector3D.w; - break; - default: - throw new away.errors.ArgumentError("ArgumentError, Column " + column + " out of bounds [0, ..., 3]"); - } - }; - - /** - * Copies specific column of the calling Matrix3D object into the Vector3D object. - */ - Matrix3D.prototype.copyColumnTo = function (column, vector3D) { - switch (column) { - case 0: - vector3D.x = this.rawData[0]; - vector3D.y = this.rawData[1]; - vector3D.z = this.rawData[2]; - vector3D.w = this.rawData[3]; - break; - case 1: - vector3D.x = this.rawData[4]; - vector3D.y = this.rawData[5]; - vector3D.z = this.rawData[6]; - vector3D.w = this.rawData[7]; - break; - case 2: - vector3D.x = this.rawData[8]; - vector3D.y = this.rawData[9]; - vector3D.z = this.rawData[10]; - vector3D.w = this.rawData[11]; - break; - case 3: - vector3D.x = this.rawData[12]; - vector3D.y = this.rawData[13]; - vector3D.z = this.rawData[14]; - vector3D.w = this.rawData[15]; - break; - default: - throw new away.errors.ArgumentError("ArgumentError, Column " + column + " out of bounds [0, ..., 3]"); - } - }; - - /** - * Copies all of the matrix data from the source Matrix3D object into the calling Matrix3D object. - */ - Matrix3D.prototype.copyFrom = function (sourceMatrix3D) { - var len = sourceMatrix3D.rawData.length; - for (var c = 0; c < len; c++) - this.rawData[c] = sourceMatrix3D.rawData[c]; - }; - - Matrix3D.prototype.copyRawDataFrom = function (vector, index, transpose) { - if (typeof index === "undefined") { index = 0; } - if (typeof transpose === "undefined") { transpose = false; } - if (transpose) - this.transpose(); - - var len = vector.length - index; - for (var c = 0; c < len; c++) - this.rawData[c] = vector[c + index]; - - if (transpose) - this.transpose(); - }; - - Matrix3D.prototype.copyRawDataTo = function (vector, index, transpose) { - if (typeof index === "undefined") { index = 0; } - if (typeof transpose === "undefined") { transpose = false; } - if (transpose) - this.transpose(); - - var len = this.rawData.length; - for (var c = 0; c < len; c++) - vector[c + index] = this.rawData[c]; - - if (transpose) - this.transpose(); - }; - - /** - * Copies a Vector3D object into specific row of the calling Matrix3D object. - */ - Matrix3D.prototype.copyRowFrom = function (row, vector3D) { - switch (row) { - case 0: - this.rawData[0] = vector3D.x; - this.rawData[4] = vector3D.y; - this.rawData[8] = vector3D.z; - this.rawData[12] = vector3D.w; - break; - case 1: - this.rawData[1] = vector3D.x; - this.rawData[5] = vector3D.y; - this.rawData[9] = vector3D.z; - this.rawData[13] = vector3D.w; - break; - case 2: - this.rawData[2] = vector3D.x; - this.rawData[6] = vector3D.y; - this.rawData[10] = vector3D.z; - this.rawData[14] = vector3D.w; - break; - case 3: - this.rawData[3] = vector3D.x; - this.rawData[7] = vector3D.y; - this.rawData[11] = vector3D.z; - this.rawData[15] = vector3D.w; - break; - default: - throw new away.errors.ArgumentError("ArgumentError, Row " + row + " out of bounds [0, ..., 3]"); - } - }; - - /** - * Copies specific row of the calling Matrix3D object into the Vector3D object. - */ - Matrix3D.prototype.copyRowTo = function (row, vector3D) { - switch (row) { - case 0: - vector3D.x = this.rawData[0]; - vector3D.y = this.rawData[4]; - vector3D.z = this.rawData[8]; - vector3D.w = this.rawData[12]; - break; - case 1: - vector3D.x = this.rawData[1]; - vector3D.y = this.rawData[5]; - vector3D.z = this.rawData[9]; - vector3D.w = this.rawData[13]; - break; - case 2: - vector3D.x = this.rawData[2]; - vector3D.y = this.rawData[6]; - vector3D.z = this.rawData[10]; - vector3D.w = this.rawData[14]; - break; - case 3: - vector3D.x = this.rawData[3]; - vector3D.y = this.rawData[7]; - vector3D.z = this.rawData[11]; - vector3D.w = this.rawData[15]; - break; - default: - throw new away.errors.ArgumentError("ArgumentError, Row " + row + " out of bounds [0, ..., 3]"); - } - }; - - /** - * Copies this Matrix3D object into a destination Matrix3D object. - */ - Matrix3D.prototype.copyToMatrix3D = function (dest) { - dest.rawData = this.rawData.slice(0); - }; - - /** - * Returns the transformation matrix's translation, rotation, and scale settings as a Vector of three Vector3D objects. - */ - Matrix3D.prototype.decompose = function (orientationStyle) { - if (typeof orientationStyle === "undefined") { orientationStyle = "eulerAngles"; } - var q; - - // Initial Tests - Not OK - var vec = []; - var m = this.clone(); - var mr = m.rawData; - - var pos = new geom.Vector3D(mr[12], mr[13], mr[14]); - mr[12] = 0; - mr[13] = 0; - mr[14] = 0; - - var scale = new geom.Vector3D(); - - scale.x = Math.sqrt(mr[0] * mr[0] + mr[1] * mr[1] + mr[2] * mr[2]); - scale.y = Math.sqrt(mr[4] * mr[4] + mr[5] * mr[5] + mr[6] * mr[6]); - scale.z = Math.sqrt(mr[8] * mr[8] + mr[9] * mr[9] + mr[10] * mr[10]); - - if (mr[0] * (mr[5] * mr[10] - mr[6] * mr[9]) - mr[1] * (mr[4] * mr[10] - mr[6] * mr[8]) + mr[2] * (mr[4] * mr[9] - mr[5] * mr[8]) < 0) - scale.z = -scale.z; - - mr[0] /= scale.x; - mr[1] /= scale.x; - mr[2] /= scale.x; - mr[4] /= scale.y; - mr[5] /= scale.y; - mr[6] /= scale.y; - mr[8] /= scale.z; - mr[9] /= scale.z; - mr[10] /= scale.z; - - var rot = new geom.Vector3D(); - - switch (orientationStyle) { - case geom.Orientation3D.AXIS_ANGLE: - rot.w = Math.acos((mr[0] + mr[5] + mr[10] - 1) / 2); - - var len = Math.sqrt((mr[6] - mr[9]) * (mr[6] - mr[9]) + (mr[8] - mr[2]) * (mr[8] - mr[2]) + (mr[1] - mr[4]) * (mr[1] - mr[4])); - rot.x = (mr[6] - mr[9]) / len; - rot.y = (mr[8] - mr[2]) / len; - rot.z = (mr[1] - mr[4]) / len; - - break; - case geom.Orientation3D.QUATERNION: - var tr = mr[0] + mr[5] + mr[10]; - - if (tr > 0) { - rot.w = Math.sqrt(1 + tr) / 2; - - rot.x = (mr[6] - mr[9]) / (4 * rot.w); - rot.y = (mr[8] - mr[2]) / (4 * rot.w); - rot.z = (mr[1] - mr[4]) / (4 * rot.w); - } else if ((mr[0] > mr[5]) && (mr[0] > mr[10])) { - rot.x = Math.sqrt(1 + mr[0] - mr[5] - mr[10]) / 2; - - rot.w = (mr[6] - mr[9]) / (4 * rot.x); - rot.y = (mr[1] + mr[4]) / (4 * rot.x); - rot.z = (mr[8] + mr[2]) / (4 * rot.x); - } else if (mr[5] > mr[10]) { - rot.y = Math.sqrt(1 + mr[5] - mr[0] - mr[10]) / 2; - - rot.x = (mr[1] + mr[4]) / (4 * rot.y); - rot.w = (mr[8] - mr[2]) / (4 * rot.y); - rot.z = (mr[6] + mr[9]) / (4 * rot.y); - } else { - rot.z = Math.sqrt(1 + mr[10] - mr[0] - mr[5]) / 2; - - rot.x = (mr[8] + mr[2]) / (4 * rot.z); - rot.y = (mr[6] + mr[9]) / (4 * rot.z); - rot.w = (mr[1] - mr[4]) / (4 * rot.z); - } - - break; - case geom.Orientation3D.EULER_ANGLES: - rot.y = Math.asin(-mr[2]); - - //var cos:number = Math.cos(rot.y); - if (mr[2] != 1 && mr[2] != -1) { - rot.x = Math.atan2(mr[6], mr[10]); - rot.z = Math.atan2(mr[1], mr[0]); - } else { - rot.z = 0; - rot.x = Math.atan2(mr[4], mr[5]); - } - - break; - } - - vec.push(pos); - vec.push(rot); - vec.push(scale); - - return vec; - }; - - /** - * Uses the transformation matrix without its translation elements to transform a Vector3D object from one space - * coordinate to another. - */ - Matrix3D.prototype.deltaTransformVector = function (v) { - var x = v.x; - var y = v.y; - var z = v.z; - - return new away.geom.Vector3D((x * this.rawData[0] + y * this.rawData[4] + z * this.rawData[8]), (x * this.rawData[1] + y * this.rawData[5] + z * this.rawData[9]), (x * this.rawData[2] + y * this.rawData[6] + z * this.rawData[10]), (x * this.rawData[3] + y * this.rawData[7] + z * this.rawData[11])); - }; - - /** - * Converts the current matrix to an identity or unit matrix. - */ - Matrix3D.prototype.identity = function () { - this.rawData = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]; - }; - - /** - * [static] Interpolates the translation, rotation, and scale transformation of one matrix toward those of the target matrix. - */ - Matrix3D.interpolate = function (thisMat, toMat, percent) { - var m = new Matrix3D(); - for (var i = 0; i < 16; ++i) - m.rawData[i] = thisMat.rawData[i] + (toMat.rawData[i] - thisMat.rawData[i]) * percent; - - return m; - }; - - /** - * Interpolates this matrix towards the translation, rotation, and scale transformations of the target matrix. - */ - Matrix3D.prototype.interpolateTo = function (toMat, percent) { - for (var i = 0; i < 16; ++i) - this.rawData[i] = this.rawData[i] + (toMat.rawData[i] - this.rawData[i]) * percent; - }; - - /** - * Inverts the current matrix. - */ - Matrix3D.prototype.invert = function () { - var d = this.determinant; - var invertable = Math.abs(d) > 0.00000000001; - - if (invertable) { - d = 1 / d; - var m11 = this.rawData[0]; - var m21 = this.rawData[4]; - var m31 = this.rawData[8]; - var m41 = this.rawData[12]; - var m12 = this.rawData[1]; - var m22 = this.rawData[5]; - var m32 = this.rawData[9]; - var m42 = this.rawData[13]; - var m13 = this.rawData[2]; - var m23 = this.rawData[6]; - var m33 = this.rawData[10]; - var m43 = this.rawData[14]; - var m14 = this.rawData[3]; - var m24 = this.rawData[7]; - var m34 = this.rawData[11]; - var m44 = this.rawData[15]; - - this.rawData[0] = d * (m22 * (m33 * m44 - m43 * m34) - m32 * (m23 * m44 - m43 * m24) + m42 * (m23 * m34 - m33 * m24)); - this.rawData[1] = -d * (m12 * (m33 * m44 - m43 * m34) - m32 * (m13 * m44 - m43 * m14) + m42 * (m13 * m34 - m33 * m14)); - this.rawData[2] = d * (m12 * (m23 * m44 - m43 * m24) - m22 * (m13 * m44 - m43 * m14) + m42 * (m13 * m24 - m23 * m14)); - this.rawData[3] = -d * (m12 * (m23 * m34 - m33 * m24) - m22 * (m13 * m34 - m33 * m14) + m32 * (m13 * m24 - m23 * m14)); - this.rawData[4] = -d * (m21 * (m33 * m44 - m43 * m34) - m31 * (m23 * m44 - m43 * m24) + m41 * (m23 * m34 - m33 * m24)); - this.rawData[5] = d * (m11 * (m33 * m44 - m43 * m34) - m31 * (m13 * m44 - m43 * m14) + m41 * (m13 * m34 - m33 * m14)); - this.rawData[6] = -d * (m11 * (m23 * m44 - m43 * m24) - m21 * (m13 * m44 - m43 * m14) + m41 * (m13 * m24 - m23 * m14)); - this.rawData[7] = d * (m11 * (m23 * m34 - m33 * m24) - m21 * (m13 * m34 - m33 * m14) + m31 * (m13 * m24 - m23 * m14)); - this.rawData[8] = d * (m21 * (m32 * m44 - m42 * m34) - m31 * (m22 * m44 - m42 * m24) + m41 * (m22 * m34 - m32 * m24)); - this.rawData[9] = -d * (m11 * (m32 * m44 - m42 * m34) - m31 * (m12 * m44 - m42 * m14) + m41 * (m12 * m34 - m32 * m14)); - this.rawData[10] = d * (m11 * (m22 * m44 - m42 * m24) - m21 * (m12 * m44 - m42 * m14) + m41 * (m12 * m24 - m22 * m14)); - this.rawData[11] = -d * (m11 * (m22 * m34 - m32 * m24) - m21 * (m12 * m34 - m32 * m14) + m31 * (m12 * m24 - m22 * m14)); - this.rawData[12] = -d * (m21 * (m32 * m43 - m42 * m33) - m31 * (m22 * m43 - m42 * m23) + m41 * (m22 * m33 - m32 * m23)); - this.rawData[13] = d * (m11 * (m32 * m43 - m42 * m33) - m31 * (m12 * m43 - m42 * m13) + m41 * (m12 * m33 - m32 * m13)); - this.rawData[14] = -d * (m11 * (m22 * m43 - m42 * m23) - m21 * (m12 * m43 - m42 * m13) + m41 * (m12 * m23 - m22 * m13)); - this.rawData[15] = d * (m11 * (m22 * m33 - m32 * m23) - m21 * (m12 * m33 - m32 * m13) + m31 * (m12 * m23 - m22 * m13)); - } - return invertable; - }; - - /* TODO implement pointAt - public pointAt( pos:Vector3D, at:Vector3D = null, up:Vector3D = null ) - { - } - */ - /** - * Prepends a matrix by multiplying the current Matrix3D object by another Matrix3D object. - */ - Matrix3D.prototype.prepend = function (rhs) { - var m111 = rhs.rawData[0], m121 = rhs.rawData[4], m131 = rhs.rawData[8], m141 = rhs.rawData[12], m112 = rhs.rawData[1], m122 = rhs.rawData[5], m132 = rhs.rawData[9], m142 = rhs.rawData[13], m113 = rhs.rawData[2], m123 = rhs.rawData[6], m133 = rhs.rawData[10], m143 = rhs.rawData[14], m114 = rhs.rawData[3], m124 = rhs.rawData[7], m134 = rhs.rawData[11], m144 = rhs.rawData[15], m211 = this.rawData[0], m221 = this.rawData[4], m231 = this.rawData[8], m241 = this.rawData[12], m212 = this.rawData[1], m222 = this.rawData[5], m232 = this.rawData[9], m242 = this.rawData[13], m213 = this.rawData[2], m223 = this.rawData[6], m233 = this.rawData[10], m243 = this.rawData[14], m214 = this.rawData[3], m224 = this.rawData[7], m234 = this.rawData[11], m244 = this.rawData[15]; - - this.rawData[0] = m111 * m211 + m112 * m221 + m113 * m231 + m114 * m241; - this.rawData[1] = m111 * m212 + m112 * m222 + m113 * m232 + m114 * m242; - this.rawData[2] = m111 * m213 + m112 * m223 + m113 * m233 + m114 * m243; - this.rawData[3] = m111 * m214 + m112 * m224 + m113 * m234 + m114 * m244; - - this.rawData[4] = m121 * m211 + m122 * m221 + m123 * m231 + m124 * m241; - this.rawData[5] = m121 * m212 + m122 * m222 + m123 * m232 + m124 * m242; - this.rawData[6] = m121 * m213 + m122 * m223 + m123 * m233 + m124 * m243; - this.rawData[7] = m121 * m214 + m122 * m224 + m123 * m234 + m124 * m244; - - this.rawData[8] = m131 * m211 + m132 * m221 + m133 * m231 + m134 * m241; - this.rawData[9] = m131 * m212 + m132 * m222 + m133 * m232 + m134 * m242; - this.rawData[10] = m131 * m213 + m132 * m223 + m133 * m233 + m134 * m243; - this.rawData[11] = m131 * m214 + m132 * m224 + m133 * m234 + m134 * m244; - - this.rawData[12] = m141 * m211 + m142 * m221 + m143 * m231 + m144 * m241; - this.rawData[13] = m141 * m212 + m142 * m222 + m143 * m232 + m144 * m242; - this.rawData[14] = m141 * m213 + m142 * m223 + m143 * m233 + m144 * m243; - this.rawData[15] = m141 * m214 + m142 * m224 + m143 * m234 + m144 * m244; - }; - - /** - * Prepends an incremental rotation to a Matrix3D object. - */ - Matrix3D.prototype.prependRotation = function (degrees, axis) { - var m = Matrix3D.getAxisRotation(axis.x, axis.y, axis.z, degrees); - - /* - if ( pivot != null ) - { - var p:Vector3D = pivot; - m.appendTranslation( p.x, p.y, p.z ); - } - */ - this.prepend(m); - }; - - /** - * Prepends an incremental scale change along the x, y, and z axes to a Matrix3D object. - */ - Matrix3D.prototype.prependScale = function (xScale, yScale, zScale) { - // Initial Tests - OK - this.prepend(new Matrix3D([xScale, 0, 0, 0, 0, yScale, 0, 0, 0, 0, zScale, 0, 0, 0, 0, 1])); - }; - - /** - * Prepends an incremental translation, a repositioning along the x, y, and z axes, to a Matrix3D object. - */ - Matrix3D.prototype.prependTranslation = function (x, y, z) { - // Initial Tests - OK - var m = new Matrix3D(); - m.position = new geom.Vector3D(x, y, z); - this.prepend(m); - }; - - // TODO orientationStyle - /** - * Sets the transformation matrix's translation, rotation, and scale settings. - */ - Matrix3D.prototype.recompose = function (components) { - // Initial Tests - OK - if (components.length < 3) - return false; - - //components[2].x == 0 || components[2].y == 0 || components[2].z == 0) return false; - this.identity(); - this.appendScale(components[2].x, components[2].y, components[2].z); - - var angle; - angle = -components[1].x; - this.append(new Matrix3D([1, 0, 0, 0, 0, Math.cos(angle), -Math.sin(angle), 0, 0, Math.sin(angle), Math.cos(angle), 0, 0, 0, 0, 0])); - angle = -components[1].y; - this.append(new Matrix3D([Math.cos(angle), 0, Math.sin(angle), 0, 0, 1, 0, 0, -Math.sin(angle), 0, Math.cos(angle), 0, 0, 0, 0, 0])); - angle = -components[1].z; - this.append(new Matrix3D([Math.cos(angle), -Math.sin(angle), 0, 0, Math.sin(angle), Math.cos(angle), 0, 0, 0, 0, 1, 0, 0, 0, 0, 0])); - - this.position = components[0]; - this.rawData[15] = 1; - - return true; - }; - - Matrix3D.prototype.transformVector = function (v) { - var x = v.x; - var y = v.y; - var z = v.z; - - return new away.geom.Vector3D((x * this.rawData[0] + y * this.rawData[4] + z * this.rawData[8] + this.rawData[12]), (x * this.rawData[1] + y * this.rawData[5] + z * this.rawData[9] + this.rawData[13]), (x * this.rawData[2] + y * this.rawData[6] + z * this.rawData[10] + this.rawData[14]), (x * this.rawData[3] + y * this.rawData[7] + z * this.rawData[11] + this.rawData[15])); - }; - - /** - * Uses the transformation matrix to transform a Vector of Numbers from one coordinate space to another. - */ - Matrix3D.prototype.transformVectors = function (vin, vout) { - // Initial Tests - OK - var i = 0; - var x = 0, y = 0, z = 0; - - while (i + 3 <= vin.length) { - x = vin[i]; - y = vin[i + 1]; - z = vin[i + 2]; - vout[i] = x * this.rawData[0] + y * this.rawData[4] + z * this.rawData[8] + this.rawData[12]; - vout[i + 1] = x * this.rawData[1] + y * this.rawData[5] + z * this.rawData[9] + this.rawData[13]; - vout[i + 2] = x * this.rawData[2] + y * this.rawData[6] + z * this.rawData[10] + this.rawData[14]; - i += 3; - } - }; - - /** - * Converts the current Matrix3D object to a matrix where the rows and columns are swapped. - */ - Matrix3D.prototype.transpose = function () { - // Initial Tests - OK - var oRawData = this.rawData.slice(0); - - this.rawData[1] = oRawData[4]; - this.rawData[2] = oRawData[8]; - this.rawData[3] = oRawData[12]; - this.rawData[4] = oRawData[1]; - this.rawData[6] = oRawData[9]; - this.rawData[7] = oRawData[13]; - this.rawData[8] = oRawData[2]; - this.rawData[9] = oRawData[6]; - this.rawData[11] = oRawData[14]; - this.rawData[12] = oRawData[3]; - this.rawData[13] = oRawData[7]; - this.rawData[14] = oRawData[11]; - }; - - Matrix3D.getAxisRotation = function (x, y, z, degrees) { - // internal class use by rotations which have been tested - var m = new Matrix3D(); - - var rad = degrees * (Math.PI / 180); - var c = Math.cos(rad); - var s = Math.sin(rad); - var t = 1 - c; - var tmp1, tmp2; - - m.rawData[0] = c + x * x * t; - m.rawData[5] = c + y * y * t; - m.rawData[10] = c + z * z * t; - - tmp1 = x * y * t; - tmp2 = z * s; - m.rawData[1] = tmp1 + tmp2; - m.rawData[4] = tmp1 - tmp2; - tmp1 = x * z * t; - tmp2 = y * s; - m.rawData[8] = tmp1 + tmp2; - m.rawData[2] = tmp1 - tmp2; - tmp1 = y * z * t; - tmp2 = x * s; - m.rawData[9] = tmp1 - tmp2; - m.rawData[6] = tmp1 + tmp2; - - return m; - }; - - Object.defineProperty(Matrix3D.prototype, "determinant", { - /** - * [read-only] A Number that determines whether a matrix is invertible. - */ - get: function () { - return ((this.rawData[0] * this.rawData[5] - this.rawData[4] * this.rawData[1]) * (this.rawData[10] * this.rawData[15] - this.rawData[14] * this.rawData[11]) - (this.rawData[0] * this.rawData[9] - this.rawData[8] * this.rawData[1]) * (this.rawData[6] * this.rawData[15] - this.rawData[14] * this.rawData[7]) + (this.rawData[0] * this.rawData[13] - this.rawData[12] * this.rawData[1]) * (this.rawData[6] * this.rawData[11] - this.rawData[10] * this.rawData[7]) + (this.rawData[4] * this.rawData[9] - this.rawData[8] * this.rawData[5]) * (this.rawData[2] * this.rawData[15] - this.rawData[14] * this.rawData[3]) - (this.rawData[4] * this.rawData[13] - this.rawData[12] * this.rawData[5]) * (this.rawData[2] * this.rawData[11] - this.rawData[10] * this.rawData[3]) + (this.rawData[8] * this.rawData[13] - this.rawData[12] * this.rawData[9]) * (this.rawData[2] * this.rawData[7] - this.rawData[6] * this.rawData[3])); - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Matrix3D.prototype, "position", { - /** - * A Vector3D object that holds the position, the 3D coordinate (x,y,z) of a display object within the - * transformation's frame of reference. - */ - get: function () { - return new geom.Vector3D(this.rawData[12], this.rawData[13], this.rawData[14]); - }, - set: function (value) { - this.rawData[12] = value.x; - this.rawData[13] = value.y; - this.rawData[14] = value.z; - }, - enumerable: true, - configurable: true - }); - - - Matrix3D.prototype.toFixed = function (decimalPlace) { - var magnitude = Math.pow(10, decimalPlace); - return "matrix3d(" + Math.round(this.rawData[0] * magnitude) / magnitude + "," + Math.round(this.rawData[1] * magnitude) / magnitude + "," + Math.round(this.rawData[2] * magnitude) / magnitude + "," + Math.round(this.rawData[3] * magnitude) / magnitude + "," + Math.round(this.rawData[4] * magnitude) / magnitude + "," + Math.round(this.rawData[5] * magnitude) / magnitude + "," + Math.round(this.rawData[6] * magnitude) / magnitude + "," + Math.round(this.rawData[7] * magnitude) / magnitude + "," + Math.round(this.rawData[8] * magnitude) / magnitude + "," + Math.round(this.rawData[9] * magnitude) / magnitude + "," + Math.round(this.rawData[10] * magnitude) / magnitude + "," + Math.round(this.rawData[11] * magnitude) / magnitude + "," + Math.round(this.rawData[12] * magnitude) / magnitude + "," + Math.round(this.rawData[13] * magnitude) / magnitude + "," + Math.round(this.rawData[14] * magnitude) / magnitude + "," + Math.round(this.rawData[15] * magnitude) / magnitude + ")"; - }; - - Matrix3D.prototype.toString = function () { - return "matrix3d(" + Math.round(this.rawData[0] * 1000) / 1000 + "," + Math.round(this.rawData[1] * 1000) / 1000 + "," + Math.round(this.rawData[2] * 1000) / 1000 + "," + Math.round(this.rawData[3] * 1000) / 1000 + "," + Math.round(this.rawData[4] * 1000) / 1000 + "," + Math.round(this.rawData[5] * 1000) / 1000 + "," + Math.round(this.rawData[6] * 1000) / 1000 + "," + Math.round(this.rawData[7] * 1000) / 1000 + "," + Math.round(this.rawData[8] * 1000) / 1000 + "," + Math.round(this.rawData[9] * 1000) / 1000 + "," + Math.round(this.rawData[10] * 1000) / 1000 + "," + Math.round(this.rawData[11] * 1000) / 1000 + "," + Math.round(this.rawData[12] * 1000) / 1000 + "," + Math.round(this.rawData[13] * 1000) / 1000 + "," + Math.round(this.rawData[14] * 1000) / 1000 + "," + Math.round(this.rawData[15] * 1000) / 1000 + ")"; - }; - return Matrix3D; - })(); - geom.Matrix3D = Matrix3D; - })(away.geom || (away.geom = {})); - var geom = away.geom; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (geom) { - //import flash.geom.*; - /** - * away.geom.Matrix3DUtils provides additional Matrix3D functions. - */ - var Matrix3DUtils = (function () { - function Matrix3DUtils() { - } - /** - * Fills the 3d matrix object with values representing the transformation made by the given quaternion. - * - * @param quarternion The quarterion object to convert. - */ - Matrix3DUtils.quaternion2matrix = function (quarternion, m) { - if (typeof m === "undefined") { m = null; } - var x = quarternion.x; - var y = quarternion.y; - var z = quarternion.z; - var w = quarternion.w; - - var xx = x * x; - var xy = x * y; - var xz = x * z; - var xw = x * w; - - var yy = y * y; - var yz = y * z; - var yw = y * w; - - var zz = z * z; - var zw = z * w; - - var raw = Matrix3DUtils.RAW_DATA_CONTAINER; - raw[0] = 1 - 2 * (yy + zz); - raw[1] = 2 * (xy + zw); - raw[2] = 2 * (xz - yw); - raw[4] = 2 * (xy - zw); - raw[5] = 1 - 2 * (xx + zz); - raw[6] = 2 * (yz + xw); - raw[8] = 2 * (xz + yw); - raw[9] = 2 * (yz - xw); - raw[10] = 1 - 2 * (xx + yy); - raw[3] = raw[7] = raw[11] = raw[12] = raw[13] = raw[14] = 0; - raw[15] = 1; - - if (m) { - m.copyRawDataFrom(raw); - return m; - } else - return new geom.Matrix3D(raw); - }; - - /** - * Returns a normalised Vector3D object representing the forward vector of the given matrix. - * @param m The Matrix3D object to use to get the forward vector - * @param v [optional] A vector holder to prevent make new Vector3D instance if already exists. Default is null. - * @return The forward vector - */ - Matrix3DUtils.getForward = function (m, v) { - if (typeof v === "undefined") { v = null; } - //v ||= new Vector3D(0.0, 0.0, 0.0); - if (v === null) { - v = new geom.Vector3D(0.0, 0.0, 0.0); - } - - m.copyColumnTo(2, v); - v.normalize(); - - return v; - }; - - /** - * Returns a normalised Vector3D object representing the up vector of the given matrix. - * @param m The Matrix3D object to use to get the up vector - * @param v [optional] A vector holder to prevent make new Vector3D instance if already exists. Default is null. - * @return The up vector - */ - Matrix3DUtils.getUp = function (m, v) { - //v ||= new Vector3D(0.0, 0.0, 0.0); - if (typeof v === "undefined") { v = null; } - if (v === null) { - v = new geom.Vector3D(0.0, 0.0, 0.0); - } - - m.copyColumnTo(1, v); - v.normalize(); - - return v; - }; - - /** - * Returns a normalised Vector3D object representing the right vector of the given matrix. - * @param m The Matrix3D object to use to get the right vector - * @param v [optional] A vector holder to prevent make new Vector3D instance if already exists. Default is null. - * @return The right vector - */ - Matrix3DUtils.getRight = function (m, v) { - if (typeof v === "undefined") { v = null; } - //v ||= new Vector3D(0.0, 0.0, 0.0); - if (v === null) { - v = new geom.Vector3D(0.0, 0.0, 0.0); - } - - m.copyColumnTo(0, v); - v.normalize(); - - return v; - }; - - /** - * Returns a boolean value representing whether there is any significant difference between the two given 3d matrices. - */ - Matrix3DUtils.compare = function (m1, m2) { - var r1 = Matrix3DUtils.RAW_DATA_CONTAINER; - var r2 = m2.rawData; - m1.copyRawDataTo(r1); - - for (var i = 0; i < 16; ++i) { - if (r1[i] != r2[i]) - return false; - } - - return true; - }; - - Matrix3DUtils.lookAt = function (matrix, pos, dir, up) { - var dirN; - var upN; - var lftN; - var raw = Matrix3DUtils.RAW_DATA_CONTAINER; - - lftN = dir.crossProduct(up); - lftN.normalize(); - - upN = lftN.crossProduct(dir); - upN.normalize(); - dirN = dir.clone(); - dirN.normalize(); - - raw[0] = lftN.x; - raw[1] = upN.x; - raw[2] = -dirN.x; - raw[3] = 0.0; - - raw[4] = lftN.y; - raw[5] = upN.y; - raw[6] = -dirN.y; - raw[7] = 0.0; - - raw[8] = lftN.z; - raw[9] = upN.z; - raw[10] = -dirN.z; - raw[11] = 0.0; - - raw[12] = -lftN.dotProduct(pos); - raw[13] = -upN.dotProduct(pos); - raw[14] = dirN.dotProduct(pos); - raw[15] = 1.0; - - matrix.copyRawDataFrom(raw); - }; - - Matrix3DUtils.reflection = function (plane, target) { - if (typeof target === "undefined") { target = null; } - if (target === null) - target = new geom.Matrix3D(); - - var a = plane.a, b = plane.b, c = plane.c, d = plane.d; - var rawData = Matrix3DUtils.RAW_DATA_CONTAINER; - var ab2 = -2 * a * b; - var ac2 = -2 * a * c; - var bc2 = -2 * b * c; - - // reflection matrix - rawData[0] = 1 - 2 * a * a; - rawData[4] = ab2; - rawData[8] = ac2; - rawData[12] = -2 * a * d; - rawData[1] = ab2; - rawData[5] = 1 - 2 * b * b; - rawData[9] = bc2; - rawData[13] = -2 * b * d; - rawData[2] = ac2; - rawData[6] = bc2; - rawData[10] = 1 - 2 * c * c; - rawData[14] = -2 * c * d; - rawData[3] = 0; - rawData[7] = 0; - rawData[11] = 0; - rawData[15] = 1; - target.copyRawDataFrom(rawData); - - return target; - }; - - Matrix3DUtils.transformVector = function (matrix, vector, result) { - if (typeof result === "undefined") { result = null; } - if (!result) - result = new geom.Vector3D(); - - var raw = Matrix3DUtils.RAW_DATA_CONTAINER; - matrix.copyRawDataTo(raw); - var a = raw[0]; - var e = raw[1]; - var i = raw[2]; - var m = raw[3]; - var b = raw[4]; - var f = raw[5]; - var j = raw[6]; - var n = raw[7]; - var c = raw[8]; - var g = raw[9]; - var k = raw[10]; - var o = raw[11]; - var d = raw[12]; - var h = raw[13]; - var l = raw[14]; - var p = raw[15]; - - var x = vector.x; - var y = vector.y; - var z = vector.z; - result.x = a * x + b * y + c * z + d; - result.y = e * x + f * y + g * z + h; - result.z = i * x + j * y + k * z + l; - result.w = m * x + n * y + o * z + p; - return result; - }; - - Matrix3DUtils.deltaTransformVector = function (matrix, vector, result) { - if (typeof result === "undefined") { result = null; } - if (!result) - result = new geom.Vector3D(); - - var raw = Matrix3DUtils.RAW_DATA_CONTAINER; - matrix.copyRawDataTo(raw); - var a = raw[0]; - var e = raw[1]; - var i = raw[2]; - var m = raw[3]; - var b = raw[4]; - var f = raw[5]; - var j = raw[6]; - var n = raw[7]; - var c = raw[8]; - var g = raw[9]; - var k = raw[10]; - var o = raw[11]; - var x = vector.x; - var y = vector.y; - var z = vector.z; - result.x = a * x + b * y + c * z; - result.y = e * x + f * y + g * z; - result.z = i * x + j * y + k * z; - result.w = m * x + n * y + o * z; - return result; - }; - - Matrix3DUtils.getTranslation = function (transform, result) { - if (typeof result === "undefined") { result = null; } - if (!result) - result = new geom.Vector3D(); - - transform.copyColumnTo(3, result); - return result; - }; - - Matrix3DUtils.deltaTransformVectors = function (matrix, vin, vout) { - var raw = Matrix3DUtils.RAW_DATA_CONTAINER; - matrix.copyRawDataTo(raw); - var a = raw[0]; - var e = raw[1]; - var i = raw[2]; - var m = raw[3]; - var b = raw[4]; - var f = raw[5]; - var j = raw[6]; - var n = raw[7]; - var c = raw[8]; - var g = raw[9]; - var k = raw[10]; - var o = raw[11]; - var outIndex = 0; - var length = vin.length; - for (var index = 0; index < length; index += 3) { - var x = vin[index]; - var y = vin[index + 1]; - var z = vin[index + 2]; - vout[outIndex++] = a * x + b * y + c * z; - vout[outIndex++] = e * x + f * y + g * z; - vout[outIndex++] = i * x + j * y + k * z; - } - }; - Matrix3DUtils.RAW_DATA_CONTAINER = new Array(16); - - Matrix3DUtils.CALCULATION_MATRIX = new geom.Matrix3D(); - return Matrix3DUtils; - })(); - geom.Matrix3DUtils = Matrix3DUtils; - })(away.geom || (away.geom = {})); - var geom = away.geom; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (geom) { - /** - * A Quaternion object which can be used to represent rotations. - */ - var Orientation3D = (function () { - function Orientation3D() { - } - Orientation3D.AXIS_ANGLE = "axisAngle"; - Orientation3D.EULER_ANGLES = "eulerAngles"; - Orientation3D.QUATERNION = "quaternion"; - return Orientation3D; - })(); - geom.Orientation3D = Orientation3D; - })(away.geom || (away.geom = {})); - var geom = away.geom; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - *

The PerspectiveProjection class provides an easy way to assign or modify - * the perspective transformations of a display object and all of its - * children. For more complex or custom perspective transformations, use the - * Matrix3D class. While the PerspectiveProjection class provides basic - * three-dimensional presentation properties, the Matrix3D class provides more - * detailed control over the three-dimensional presentation of display objects. - *

- * - *

Projection is a way of representing a three-dimensional object in a - * two-dimensional space, like a cube projected onto a computer screen. - * Perspective projection uses a viewing frustum (a rectangular pyramid) to - * model and project a three-dimensional world and its objects on the screen. - * The viewing frustum becomes increasingly wider as it moves further from the - * origin of the viewpoint. The origin of the viewpoint could be a camera or - * the eyes of an observer facing the screen. The projected perspective - * produces the illusion of three dimensions with depth and distance, where - * the objects closer to the screen appear larger than the objects farther - * from the screen.

- * - *

A default PerspectiveProjection object is a framework defined for - * perspective transformation of the root object, based on the field of view - * and aspect ratio (dimensions) of the stage. The projection center, the - * vanishing point, is set to the center of the stage, which means the - * three-dimensional display objects disappear toward the center of the stage - * as they move back in the z axis. The default viewpoint is at point (0,0) - * looking down the positive z axis. The y-axis points down toward the bottom - * of the screen. You can gain access to the root display object's perspective - * projection settings and change the field of view and projection center - * properties of the perspectiveProjection property through the root object's - * DisplayObject.transform property.

- * - *

You can also set a different perspective projection setting for a - * display object through the parent's perspective projection. First, create a - * PerspectiveProjection object and set its fieldOfView and - * projectionCenter properties. Next, assign the - * PerspectiveProjection object to the parent display object using the - * DisplayObject.transform property. The specified projection - * matrix and transformation will then apply to all the display object's - * three-dimensional children.

- * - *

To modify a perspective projection of the stage or root object: use the - * transform.matrix property of the root display object to gain - * access to the PerspectiveProjection object. Or, apply different perspective - * projection properties to a display object by setting the perspective - * projection properties of the display object's parent. The child display - * object inherits the new properties. Specifically, create a - * PerspectiveProjection object and set its properties, then assign the - * PerspectiveProjection object to the perspectiveProjection - * property of the parent display object's transform property. - * The specified projection transformation then applies to all the display - * object's three-dimensional children.

- * - *

Since both PerspectiveProjection and Matrix3D objects perform - * perspective transformations, do not assign both to a display object at the - * same time. Use the PerspectiveProjection object for focal length and - * projection center changes. For more control over the perspective - * transformation, create a perspective projection Matrix3D object.

- */ - (function (geom) { - var PerspectiveProjection = (function () { - /** - * Creates an instance of a PerspectiveProjection object. - */ - function PerspectiveProjection() { - } - /** - * Returns the underlying Matrix3D object of the display object. - * - *

A display object, like the root object, can have a - * PerspectiveProjection object without needing a Matrix3D property - * defined for its transformations. In fact, use either a - * PerspectiveProjection or a Matrix3D object to specify the - * perspective transformation. If when using the PerspectiveProjection - * object, a Matrix3D object was needed, the toMatrix3D() - * method can retrieve the underlying Matrix3D object of the display - * object. For example, the toMatrix3D() method can be - * used with the Utils3D.projectVectors() method.

- * - * @see away.geom.Matrix3D - */ - PerspectiveProjection.prototype.toMatrix3D = function () { - return this._matrix3D; - }; - return PerspectiveProjection; - })(); - geom.PerspectiveProjection = PerspectiveProjection; - })(away.geom || (away.geom = {})); - var geom = away.geom; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (geom) { - var Plane3D = (function () { - /** - * Create a Plane3D with ABCD coefficients - */ - function Plane3D(a, b, c, d) { - if (typeof a === "undefined") { a = 0; } - if (typeof b === "undefined") { b = 0; } - if (typeof c === "undefined") { c = 0; } - if (typeof d === "undefined") { d = 0; } - this.a = a; - this.b = b; - this.c = c; - this.d = d; - - if (a == 0 && b == 0) { - this._iAlignment = Plane3D.ALIGN_XY_AXIS; - } else if (b == 0 && c == 0) { - this._iAlignment = Plane3D.ALIGN_YZ_AXIS; - } else if (a == 0 && c == 0) { - this._iAlignment = Plane3D.ALIGN_XZ_AXIS; - } else { - this._iAlignment = Plane3D.ALIGN_ANY; - } - } - /** - * Fills this Plane3D with the coefficients from 3 points in 3d space. - * @param p0 Vector3D - * @param p1 Vector3D - * @param p2 Vector3D - */ - Plane3D.prototype.fromPoints = function (p0, p1, p2) { - var d1x = p1.x - p0.x; - var d1y = p1.y - p0.y; - var d1z = p1.z - p0.z; - - var d2x = p2.x - p0.x; - var d2y = p2.y - p0.y; - var d2z = p2.z - p0.z; - - this.a = d1y * d2z - d1z * d2y; - this.b = d1z * d2x - d1x * d2z; - this.c = d1x * d2y - d1y * d2x; - this.d = this.a * p0.x + this.b * p0.y + this.c * p0.z; - - // not using epsilon, since a plane is infinite and a small incorrection can grow very large - if (this.a == 0 && this.b == 0) { - this._iAlignment = Plane3D.ALIGN_XY_AXIS; - } else if (this.b == 0 && this.c == 0) { - this._iAlignment = Plane3D.ALIGN_YZ_AXIS; - } else if (this.a == 0 && this.c == 0) { - this._iAlignment = Plane3D.ALIGN_XZ_AXIS; - } else { - this._iAlignment = Plane3D.ALIGN_ANY; - } - }; - - /** - * Fills this Plane3D with the coefficients from the plane's normal and a point in 3d space. - * @param normal Vector3D - * @param point Vector3D - */ - Plane3D.prototype.fromNormalAndPoint = function (normal, point) { - this.a = normal.x; - this.b = normal.y; - this.c = normal.z; - this.d = this.a * point.x + this.b * point.y + this.c * point.z; - if (this.a == 0 && this.b == 0) { - this._iAlignment = Plane3D.ALIGN_XY_AXIS; - } else if (this.b == 0 && this.c == 0) { - this._iAlignment = Plane3D.ALIGN_YZ_AXIS; - } else if (this.a == 0 && this.c == 0) { - this._iAlignment = Plane3D.ALIGN_XZ_AXIS; - } else { - this._iAlignment = Plane3D.ALIGN_ANY; - } - }; - - /** - * Normalize this Plane3D - * @return Plane3D This Plane3D. - */ - Plane3D.prototype.normalize = function () { - var len = 1 / Math.sqrt(this.a * this.a + this.b * this.b + this.c * this.c); - this.a *= len; - this.b *= len; - this.c *= len; - this.d *= len; - return this; - }; - - /** - * Returns the signed distance between this Plane3D and the point p. - * @param p Vector3D - * @returns Number - */ - Plane3D.prototype.distance = function (p) { - if (this._iAlignment == Plane3D.ALIGN_YZ_AXIS) { - return this.a * p.x - this.d; - } else if (this._iAlignment == Plane3D.ALIGN_XZ_AXIS) { - return this.b * p.y - this.d; - } else if (this._iAlignment == Plane3D.ALIGN_XY_AXIS) { - return this.c * p.z - this.d; - } else { - return this.a * p.x + this.b * p.y + this.c * p.z - this.d; - } - }; - - /** - * Classify a point against this Plane3D. (in front, back or intersecting) - * @param p Vector3D - * @return int Plane3.FRONT or Plane3D.BACK or Plane3D.INTERSECT - */ - Plane3D.prototype.classifyPoint = function (p, epsilon) { - if (typeof epsilon === "undefined") { epsilon = 0.01; } - // check NaN - if (this.d != this.d) - return away.geom.PlaneClassification.FRONT; - - var len; - if (this._iAlignment == Plane3D.ALIGN_YZ_AXIS) - len = this.a * p.x - this.d; - else if (this._iAlignment == Plane3D.ALIGN_XZ_AXIS) - len = this.b * p.y - this.d; - else if (this._iAlignment == Plane3D.ALIGN_XY_AXIS) - len = this.c * p.z - this.d; - else - len = this.a * p.x + this.b * p.y + this.c * p.z - this.d; - - if (len < -epsilon) - return away.geom.PlaneClassification.BACK; - else if (len > epsilon) - return away.geom.PlaneClassification.FRONT; - else - return away.geom.PlaneClassification.INTERSECT; - }; - - Plane3D.prototype.toString = function () { - return "Plane3D [a:" + this.a + ", b:" + this.b + ", c:" + this.c + ", d:" + this.d + "]"; - }; - Plane3D.ALIGN_ANY = 0; - Plane3D.ALIGN_XY_AXIS = 1; - Plane3D.ALIGN_YZ_AXIS = 2; - Plane3D.ALIGN_XZ_AXIS = 3; - return Plane3D; - })(); - geom.Plane3D = Plane3D; - })(away.geom || (away.geom = {})); - var geom = away.geom; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (geom) { - var PlaneClassification = (function () { - function PlaneClassification() { - } - PlaneClassification.BACK = 0; - PlaneClassification.FRONT = 1; - - PlaneClassification.IN = 0; - PlaneClassification.OUT = 1; - PlaneClassification.INTERSECT = 2; - return PlaneClassification; - })(); - geom.PlaneClassification = PlaneClassification; - })(away.geom || (away.geom = {})); - var geom = away.geom; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The Point object represents a location in a two-dimensional coordinate - * system, where x represents the horizontal axis and y - * represents the vertical axis. - * - *

The following code creates a point at(0,0):

- * - *

Methods and properties of the following classes use Point objects:

- * - *
    - *
  • BitmapData
  • - *
  • DisplayObject
  • - *
  • DisplayObjectContainer
  • - *
  • DisplacementMapFilter
  • - *
  • NativeWindow
  • - *
  • Matrix
  • - *
  • Rectangle
  • - *
- * - *

You can use the new Point() constructor to create a Point - * object.

- */ - (function (geom) { - var Point = (function () { - /** - * Creates a new point. If you pass no parameters to this method, a point is - * created at(0,0). - * - * @param x The horizontal coordinate. - * @param y The vertical coordinate. - */ - function Point(x, y) { - if (typeof x === "undefined") { x = 0; } - if (typeof y === "undefined") { y = 0; } - this.x = x; - this.y = y; - } - Object.defineProperty(Point.prototype, "length", { - /** - * The length of the line segment from(0,0) to this point. - */ - get: function () { - return Math.sqrt(this.x * this.x + this.y * this.y); - }, - enumerable: true, - configurable: true - }); - - /** - * Adds the coordinates of another point to the coordinates of this point to - * create a new point. - * - * @param v The point to be added. - * @return The new point. - */ - Point.prototype.add = function (v) { - return new Point(this.x + v.x, this.y + v.y); - }; - - /** - * Creates a copy of this Point object. - * - * @return The new Point object. - */ - Point.prototype.clone = function () { - return new Point(this.x, this.y); - }; - - Point.prototype.copyFrom = function (sourcePoint) { - }; - - /** - * Determines whether two points are equal. Two points are equal if they have - * the same x and y values. - * - * @param toCompare The point to be compared. - * @return A value of true if the object is equal to this Point - * object; false if it is not equal. - */ - Point.prototype.equals = function (toCompare) { - return (this.x == toCompare.x && this.y == toCompare.y); - }; - - /** - * Scales the line segment between(0,0) and the current point to a set - * length. - * - * @param thickness The scaling value. For example, if the current point is - * (0,5), and you normalize it to 1, the point returned is - * at(0,1). - */ - Point.prototype.normalize = function (thickness) { - if (typeof thickness === "undefined") { thickness = 1; } - if (this.length != 0) { - var invLength = thickness / this.length; - this.x *= invLength; - this.y *= invLength; - return; - } - throw "Cannot divide by zero length."; - }; - - /** - * Offsets the Point object by the specified amount. The value of - * dx is added to the original value of x to create the - * new x value. The value of dy is added to the original - * value of y to create the new y value. - * - * @param dx The amount by which to offset the horizontal coordinate, - * x. - * @param dy The amount by which to offset the vertical coordinate, y. - */ - Point.prototype.offset = function (dx, dy) { - this.x += dx; - this.y += dy; - }; - - Point.prototype.setTo = function (xa, ya) { - }; - - /** - * Subtracts the coordinates of another point from the coordinates of this - * point to create a new point. - * - * @param v The point to be subtracted. - * @return The new point. - */ - Point.prototype.subtract = function (v) { - return new Point(this.x - v.x, this.y - v.y); - }; - - /** - * Returns a string that contains the values of the x and y - * coordinates. The string has the form "(x=x, - * y=y)", so calling the toString() method for a - * point at 23,17 would return "(x=23, y=17)". - * - * @return The string representation of the coordinates. - */ - Point.prototype.toString = function () { - return "[Point] (x=" + this.x + ", y=" + this.y + ")"; - }; - - /** - * Returns the distance between pt1 and pt2. - * - * @param pt1 The first point. - * @param pt2 The second point. - * @return The distance between the first and second points. - */ - Point.distance = function (pt1, pt2) { - var dx = pt2.x - pt1.x; - var dy = pt2.y - pt1.y; - - return Math.sqrt(dx * dx + dy * dy); - }; - - /** - * Determines a point between two specified points. The parameter - * f determines where the new interpolated point is located - * relative to the two end points specified by parameters pt1 - * and pt2. The closer the value of the parameter f - * is to 1.0, the closer the interpolated point is to the first - * point(parameter pt1). The closer the value of the parameter - * f is to 0, the closer the interpolated point is to the second - * point(parameter pt2). - * - * @param pt1 The first point. - * @param pt2 The second point. - * @param f The level of interpolation between the two points. Indicates - * where the new point will be, along the line between - * pt1 and pt2. If f=1, - * pt1 is returned; if f=0, - * pt2 is returned. - * @return The new, interpolated point. - */ - Point.interpolate = function (pt1, pt2, f) { - return new Point(pt2.x + (pt1.x - pt2.x) * f, pt2.y + (pt1.y - pt2.y) * f); - }; - - /** - * Converts a pair of polar coordinates to a Cartesian point coordinate. - * - * @param len The length coordinate of the polar pair. - * @param angle The angle, in radians, of the polar pair. - * @return The Cartesian point. - */ - Point.polar = function (len, angle) { - return new Point(len * Math.cos(angle), len * Math.sin(angle)); - }; - return Point; - })(); - geom.Point = Point; - })(away.geom || (away.geom = {})); - var geom = away.geom; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (geom) { - var PoissonLookup = (function () { - function PoissonLookup() { - } - PoissonLookup.initDistributions = function () { - // precalculated for best control - this._distributions = new Array(); - this._distributions[0] = new Array(0.3082841, 0.4320919); - this._distributions[1] = new Array(0.3082841, 0.4320919, -0.2274942, -0.6640266); - this._distributions[2] = new Array(0.8742689, 0.0009265686, -0.6864116, -0.5536607, -0.2325206, 0.7678371); - this._distributions[3] = new Array(0.3913446, -0.7084417, -0.7511101, -0.5935929, -0.2323436, 0.5320091, 0.8435315, 0.5035911); - this._distributions[4] = new Array(0.2122471, -0.5771395, -0.8543506, -0.1763534, 0.5189021, 0.8323698, -0.3616908, 0.5865368, 0.9523004, -0.04948437); - this._distributions[5] = new Array(0.5791035, 0.3496495, 0.2959551, -0.6006749, -0.2419119, -0.06879545, -0.7403072, 0.6110353, -0.04555973, 0.8059174, -0.5275017, -0.737129); - this._distributions[6] = new Array(0.06941478, 0.8519508, -0.7441907, 0.2426432, 0.6439992, -0.2405252, -0.1007523, -0.2327587, -0.6427067, -0.7248485, 0.8050759, 0.5492936, 0.3573822, -0.8824506); - this._distributions[7] = new Array(0.8509863, 0.4452587, -0.09507271, 0.2073005, 0.1706571, -0.6434793, 0.8029777, -0.2718274, -0.4401725, 0.8196304, 0.2715359, 0.8598521, -0.8121575, -0.006447683, -0.6486837, -0.7237598); - this._distributions[8] = new Array(0.6951686, -0.2680728, -0.04933243, 0.3710589, 0.6592212, 0.3661054, -0.01579228, -0.6909603, -0.3275101, -0.1756866, 0.3811549, 0.9218544, -0.216032, 0.9755028, -0.7065172, 0.3355389, -0.6579109, -0.6798355); - this._distributions[9] = new Array(0.6181276, -0.09790418, -0.2537868, -0.5570995, -0.1964931, 0.3459414, 0.3474613, -0.8885581, 0.5135743, 0.5753114, -0.9549091, 0.1480672, -0.8711916, -0.4293123, -0.6928071, 0.6190156, -0.13369, 0.8892705, 0.0548224, -0.1246777); - this._distributions[10] = new Array(0.4853027, -0.5080479, -0.1331675, -0.506597, 0.139575, 0.01316885, 0.803486, -0.07568797, 0.5240274, 0.4883182, -0.4334005, 0.1207938, -0.7794577, -0.3985141, 0.1576432, -0.9861221, -0.3712867, 0.6959021, 0.1517378, 0.9847429, -0.9762396, 0.1661073); - this._distributions[11] = new Array(-0.2790166, -0.01252619, 0.3389016, 0.3921154, 0.2408341, -0.313211, -0.8151779, -0.3898362, -0.6347761, 0.3486495, 0.09471484, -0.7722448, -0.1385674, 0.6364574, 0.2456331, 0.9295807, -0.3864306, -0.8247881, 0.6111673, -0.7164014, 0.8287669, 0.05466961, 0.837706, 0.5415626); - this._distributions[12] = new Array(0.056417, 0.3185693, -0.8245888, 0.1882799, 0.8575996, 0.1136829, 0.1070375, 0.875332, 0.4076743, -0.06000621, -0.4311306, 0.7239349, 0.2677574, -0.538472, -0.08486642, -0.2083647, -0.888989, -0.3906443, -0.4768958, -0.6664082, 0.09334993, -0.9861541, 0.808736, -0.455949, 0.5889823, 0.7660807); - this._distributions[13] = new Array(-0.2681346, -0.3955857, -0.1315102, -0.8852947, -0.5143692, 0.09551838, 0.4344836, -0.546945, -0.8620899, -0.3813288, 0.1650431, 0.02034803, -0.1543657, 0.3842218, -0.828457, 0.5376903, -0.6145, -0.7818927, -0.2639062, 0.8784655, 0.1912684, 0.9720125, 0.3135219, 0.5224229, 0.7850655, 0.4592297, 0.7465045, -0.1368916); - this._distributions[14] = new Array(0.4241029, 0.695281, 0.150511, -0.02304107, -0.2482675, 0.9120338, 0.8057325, 0.2622084, -0.2445909, 0.2765962, 0.8588713, -0.1772072, 0.3117845, -0.4385471, -0.3923851, -0.3298936, -0.1751254, -0.7405846, 0.6926506, -0.684163, -0.9304563, -0.3254691, -0.8533293, 0.1523024, 0.2510415, -0.917345, -0.6239773, -0.7105472, -0.6104624, 0.6041355); - this._distributions[15] = new Array(0.5844554, 0.06651045, 0.1343258, 0.6756578, 0.3799674, -0.6301104, 0.5590436, 0.7940555, 0.09574714, 0.02262517, 0.8697868, 0.393301, 0.003945862, -0.421735, 0.9043913, -0.2432393, -0.4844007, 0.7190998, -0.3201078, 0.2972371, -0.3852352, -0.6341155, -0.5413069, -0.09223081, -0.8468984, -0.5126905, 0.004156174, -0.8633173, -0.9681889, -0.03305046, -0.846509, 0.4414353); - this._distributions[16] = new Array(0.4506488, 0.657668, 0.4621297, 0.07441051, -0.2782125, 0.6201044, 0.9750003, 0.09110117, 0.1019436, 0.2986514, 0.03457398, 0.9631706, 0.542098, -0.5505635, 0.8675668, 0.4938077, -0.5414361, 0.2655292, -0.7941836, 0.6003053, -0.09847672, -0.1001604, -0.9316511, -0.08572888, 0.07286467, -0.611899, -0.5232627, -0.4082253, -0.5481608, -0.827938, -0.1551939, -0.9621193, 0.9220031, -0.3315949); - this._distributions[17] = new Array(0.197908, -0.4697656, -0.4474689, -0.3428435, 0.8529873, -0.2228634, 0.6022478, -0.5469642, 0.2545276, -0.931133, -0.1507547, -0.7855865, -0.07606658, 0.1011628, 0.3046715, 0.2785755, 0.4698432, -0.1064076, 0.6831254, 0.4152522, 0.1374381, 0.8363233, -0.2166121, 0.6682042, 0.5511393, 0.7996449, -0.4278994, 0.28836, -0.8875198, 0.2181732, -0.8772842, -0.2818254, -0.7000262, 0.5762185, -0.6062385, -0.7439126); - this._distributions[18] = new Array(0.6645703, -0.05678739, 0.5720971, 0.4533803, -0.07660709, 0.08802763, 0.5163431, -0.4426552, 0.1163455, -0.3404382, -0.4004807, -0.5046007, 0.2932099, -0.8201418, -0.5322125, 0.03834766, -0.1490209, -0.8817304, -0.8000439, -0.3509448, 0.5260983, 0.8421043, 0.1197811, 0.6963812, 0.9498612, 0.3122156, -0.9285746, 0.02120355, -0.6670724, 0.7217396, 0.9155889, -0.3510147, -0.271941, 0.4727852, 0.318879, 0.1634057, -0.2686755, 0.9253026); - this._distributions[19] = new Array(0.5064292, 0.422527, 0.8935515, -0.06610427, 0.1199719, 0.175568, 0.403388, -0.2003276, 0.1657927, 0.8154403, 0.9301245, 0.2929218, -0.1644068, 0.6201534, 0.7113559, -0.6589743, -0.3364046, -0.1799502, 0.02109996, -0.392765, -0.382213, 0.3219992, -0.9201946, 0.1207967, -0.726185, 0.4291916, -0.7443482, -0.2480059, -0.5147594, 0.7418784, 0.1935272, -0.7406143, -0.3643523, -0.5559214, -0.7147766, -0.6326278, -0.2524151, -0.9096627, 0.5161405, 0.7908453); - this._distributions[20] = new Array(0.7921003, -0.3032096, 0.5992879, -0.009052323, 0.2538549, -0.1872749, 0.7053444, 0.3677175, 0.5417761, -0.8170255, 0.9749611, 0.1210478, 0.1969143, -0.6117041, -0.1824499, -0.4634196, -0.1181338, -0.8668742, -0.3050112, -0.1352596, -0.4409327, -0.7082354, -0.03225285, 0.1171548, 0.3113096, 0.3250439, -0.8166144, -0.463995, -0.01014475, 0.4715334, -0.6868284, 0.05091889, -0.4011163, 0.2717285, -0.06756835, 0.8307694, -0.7938535, 0.4352129, -0.4663842, 0.7165329, 0.559729, 0.8093995); - this._distributions[21] = new Array(0.07832243, 0.426151, -0.3856795, 0.5799953, 0.01970797, 0.06706189, 0.4822682, 0.3014512, -0.1532982, 0.87485, -0.4959527, 0.07888043, 0.260601, -0.2304784, 0.4996209, 0.7167382, 0.585986, -0.04265174, -0.7679967, 0.5509416, -0.9041753, 0.1802134, -0.8407655, -0.4442826, -0.2058258, -0.2636995, -0.4984115, -0.5928579, 0.2926032, -0.7886473, -0.06933882, -0.621177, 0.578115, -0.4813387, 0.8981777, -0.3291056, 0.1942733, 0.9255584, 0.8084362, 0.5066984, 0.9920095, 0.03103104, -0.2403206, -0.9389018); - this._distributions[22] = new Array(-0.5691095, 0.1014316, -0.7788262, 0.384012, -0.8253665, -0.1645582, -0.1830993, 0.002997211, -0.2555013, -0.4177977, -0.6640869, -0.4794711, -0.2351242, 0.5850121, 0.02436554, 0.2825883, 0.006061143, -0.8200245, 0.1618791, -0.3063331, -0.3765897, -0.7249815, 0.6092919, -0.6769328, -0.5956934, 0.6957655, 0.5383642, 0.4522677, -0.1489165, 0.9125596, 0.4167473, 0.1335986, 0.1898309, 0.5874342, 0.2288171, 0.9624356, 0.7540846, -0.07672304, 0.8986252, 0.2788797, 0.3555991, -0.9262139, 0.8454325, -0.4027667, 0.4945236, -0.2935512); - this._distributions[23] = new Array(-0.4481403, -0.3758374, -0.8877251, 0.08739938, 0.05015831, -0.1339983, -0.4070427, -0.8534173, 0.1019274, -0.5503222, -0.445998, 0.1997541, -0.8686263, -0.2788867, -0.7695944, -0.6033704, -0.05515742, -0.885711, -0.7714347, 0.5790485, 0.3466263, -0.8799297, 0.4487582, -0.5321087, -0.2461368, 0.6053771, -0.05568117, 0.2457351, -0.4668669, 0.8523816, 0.8103387, -0.4255538, 0.4054182, -0.175663, -0.2802011, -0.08920153, 0.2665959, 0.382935, 0.555679, 0.1621837, 0.105246, 0.8420411, 0.6921161, 0.6902903, 0.880946, 0.2483067, 0.9699264, -0.1021767); - this._distributions[24] = new Array(-0.1703323, -0.3119385, 0.2916039, -0.2988263, -0.008472982, -0.9277695, -0.7730271, -0.3277904, 0.3440474, -0.6815342, -0.2910278, 0.03461745, -0.6764899, -0.657078, -0.3505501, -0.7311988, -0.03478927, 0.3258755, -0.6048835, 0.159423, 0.2035525, 0.02212214, 0.5116573, 0.2226856, 0.6664805, -0.2500189, 0.7147882, -0.6609634, 0.03030632, -0.5763278, -0.2516585, 0.6116219, -0.9434413, -0.0116792, 0.9061816, 0.2491155, 0.182867, 0.6076167, 0.286593, 0.9485695, -0.5992439, 0.6970096, -0.2082874, 0.9416641, 0.9880044, -0.1541709, -0.9122881, 0.331555, 0.7324886, 0.6725098); - this._distributions[25] = new Array(0.3869598, -0.04974834, 0.7168844, -0.0693711, -0.07166742, 0.1725325, 0.4599592, 0.3232779, 0.5872094, -0.4198674, 0.2442266, -0.625667, 0.1254557, 0.4500048, -0.2290154, -0.1803567, 0.890583, 0.3373493, 0.1256081, 0.7853789, -0.2676466, 0.5305805, -0.7063224, 0.252168, -0.3989835, 0.1189921, 0.09617215, -0.2451447, 0.6302541, 0.6085876, 0.9380925, -0.3234899, 0.5086241, -0.8573482, 0.03576187, -0.9876697, -0.0876712, -0.6365195, -0.5276513, 0.823456, -0.6935764, -0.2240411, -0.5212318, -0.5383121, -0.2116208, 0.9639363, -0.9840096, 0.02743555, -0.3991577, -0.8994547, -0.7830126, 0.614068); - this._distributions[26] = new Array(-0.8366601, 0.4464895, -0.5917366, -0.02073906, -0.9845258, 0.1635625, -0.3097973, 0.4379579, -0.5478154, 0.7173221, -0.1685888, 0.9261969, 0.01503595, 0.6046097, 0.4452421, 0.5449086, 0.0315687, 0.1944619, 0.3753404, 0.8688548, 0.4143643, 0.1396648, 0.8711032, 0.4304703, 0.7328773, 0.1461501, 0.6374492, -0.3521495, 0.145613, -0.1341466, 0.9040975, -0.135123, -0.7839059, -0.5450199, -0.516019, -0.3320859, -0.206158, -0.4431106, -0.9703014, -0.2368356, -0.2473119, -0.0864351, 0.2130725, -0.4604077, -0.003726701, -0.7122303, -0.4072131, -0.6833169, 0.1632999, -0.9776646, 0.4686888, -0.680495, -0.2293511, -0.9509777); - this._distributions[27] = new Array(0.107311, -0.1311369, -0.4194764, -0.3148777, 0.6171439, -0.2745973, 0.2796618, 0.1937153, -0.09106886, 0.4180236, 0.6044006, 0.05577846, 0.02927299, -0.6738263, -0.2580845, 0.1179939, -0.09023564, -0.3830024, 0.3570953, -0.5000587, 0.81591, -0.5518309, 0.9300217, -0.1257987, 0.4904627, -0.8381903, -0.3163182, -0.8632009, 0.1137595, -0.9875998, 0.8390043, 0.3538185, 0.2149114, 0.4993694, 0.5191584, 0.3833552, 0.5002763, 0.7061465, -0.2567276, 0.9068756, -0.5197366, 0.3467845, 0.03668867, 0.9734009, -0.5347553, 0.66747, -0.9028882, 0.1023768, -0.8967977, 0.412834, -0.5821944, 0.0426479, -0.8032165, -0.2397038, -0.5597343, -0.6358021); - this._distributions[28] = new Array(-0.6562496, -0.1781036, -0.9301494, 0.1185208, -0.3861143, -0.4153562, -0.1560799, -0.1099607, -0.5587025, 0.395218, -0.5322112, -0.699701, -0.5008639, 0.08726846, -0.970524, -0.1963461, -0.813577, -0.5185111, -0.1644458, 0.298, -0.3216791, 0.639982, 0.3315373, 0.3339162, 0.2383235, -0.00105722, 0.1137828, 0.5450742, -0.01899921, 0.8798413, 0.2849685, 0.8255596, 0.6974412, 0.2123175, 0.7588523, 0.5470437, 0.5102502, -0.1687844, 0.5853448, 0.8033476, 0.2590716, -0.5262504, 0.5607718, -0.6342825, 0.8666443, -0.1491841, 0.8341052, -0.4935003, -0.1568441, -0.6634066, 0.2512113, -0.8769391, -0.2559827, -0.9572457, -0.01928852, -0.3966542, -0.750667, 0.6409678); - this._distributions[29] = new Array(0.3454786, -0.04837726, 0.2649553, 0.2406852, 0.5599093, -0.3839145, -0.1111814, -0.05502108, 0.7586042, -0.05818377, 0.2519488, -0.4665135, -0.1264972, 0.2602723, -0.08766216, -0.3671907, 0.6428129, 0.3999204, -0.6105871, -0.1246869, -0.4589451, -0.7646643, -0.03021116, -0.7899352, -0.6036922, -0.4293956, -0.2481938, 0.6534185, 0.102798, 0.6784465, -0.6392644, 0.4821358, -0.6789002, 0.1779133, -0.9140783, -0.1989647, -0.9262617, 0.3381507, 0.4794891, -0.8093274, 0.3959447, 0.668478, 0.9602883, 0.2272305, -0.123672, 0.9210883, 0.2375148, 0.9523395, -0.52898, 0.7973378, -0.382433, 0.1228794, 0.695015, 0.6948439, 0.7530277, -0.6458191, 0.8777987, -0.3272956, 0.2318525, -0.962768); - this._distributions[30] = new Array(0.4518921, -0.1146195, 0.4720805, -0.4238748, 0.3655423, 0.1806341, 0.1589939, -0.23568, 0.7673324, -0.5149941, 0.01163658, 0.09045836, 0.7010971, 0.1245747, 0.7518286, -0.1855433, 0.4960719, 0.4601022, 0.2566979, -0.6308268, -0.0654714, -0.5126389, -0.1823319, -0.1343282, -0.1464312, 0.4883236, -0.3858738, 0.203523, 0.1484799, 0.4432284, -0.477109, -0.116241, 0.2719092, 0.7208626, 0.9104174, 0.3578536, -0.5956199, 0.7662588, -0.6996251, 0.3678654, -0.2514512, 0.9251933, 0.1275825, -0.9478135, -0.204608, -0.8611552, 0.4264838, -0.877443, 0.9854161, 0.05521112, 0.5912951, 0.7997434, 0.1140349, 0.982093, -0.9324368, -0.2094094, -0.42436, -0.6441524, -0.6722705, -0.3554261, -0.7844236, 0.08587621); - this._distributions[31] = new Array(-0.4206714, -0.5613642, -0.8733016, -0.3373051, -0.1046226, -0.2902999, -0.1318562, -0.8434365, 0.1145093, -0.5962623, -0.4965627, -0.1873259, -0.5011808, -0.8546229, -0.7165636, -0.5743566, 0.1090901, 0.2017643, 0.3404809, -0.220455, -0.1989015, 0.2372122, -0.4538706, 0.0979171, 0.4514146, -0.572846, 0.2314168, -0.8514503, -0.4247236, 0.5650803, -0.943347, 0.04514639, -0.1309718, 0.5221877, -0.7004157, 0.4561877, 0.6306441, 0.04448673, 0.4301621, 0.5766876, 0.1078042, 0.7245752, 0.3875354, 0.2794483, 0.702876, -0.2924213, 0.7360667, -0.6210318, 0.7486517, 0.6531103, 0.4898235, 0.8591025, 0.6549174, 0.3854057, -0.2596106, 0.7916998, 0.9251194, -0.05296265, -0.5620695, 0.820877, -0.01228026, 0.9937211, 0.9612103, 0.2628758); - }; - - PoissonLookup.getDistribution = function (n /*int*/ ) { - if (!this._distributions) - this.initDistributions(); - - if (n < 2 || n > 32) - return null; - - return this._distributions[n - 1]; - }; - return PoissonLookup; - })(); - geom.PoissonLookup = PoissonLookup; - })(away.geom || (away.geom = {})); - var geom = away.geom; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (geom) { - //import flash.geom.Matrix3D; - //import flash.geom.Orientation3D; - //import flash.geom.Vector3D; - /** - * A Quaternion object which can be used to represent rotations. - */ - var Quaternion = (function () { - /** - * Creates a new Quaternion object. - * @param x The x value of the quaternion. - * @param y The y value of the quaternion. - * @param z The z value of the quaternion. - * @param w The w value of the quaternion. - */ - function Quaternion(x, y, z, w) { - if (typeof x === "undefined") { x = 0; } - if (typeof y === "undefined") { y = 0; } - if (typeof z === "undefined") { z = 0; } - if (typeof w === "undefined") { w = 1; } - /** - * The x value of the quaternion. - */ - this.x = 0; - /** - * The y value of the quaternion. - */ - this.y = 0; - /** - * The z value of the quaternion. - */ - this.z = 0; - /** - * The w value of the quaternion. - */ - this.w = 1; - this.x = x; - this.y = y; - this.z = z; - this.w = w; - } - Object.defineProperty(Quaternion.prototype, "magnitude", { - /** - * Returns the magnitude of the quaternion object. - */ - get: function () { - return Math.sqrt(this.w * this.w + this.x * this.x + this.y * this.y + this.z * this.z); - }, - enumerable: true, - configurable: true - }); - - /** - * Fills the quaternion object with the result from a multiplication of two quaternion objects. - * - * @param qa The first quaternion in the multiplication. - * @param qb The second quaternion in the multiplication. - */ - Quaternion.prototype.multiply = function (qa, qb) { - var w1 = qa.w, x1 = qa.x, y1 = qa.y, z1 = qa.z; - var w2 = qb.w, x2 = qb.x, y2 = qb.y, z2 = qb.z; - - this.w = w1 * w2 - x1 * x2 - y1 * y2 - z1 * z2; - this.x = w1 * x2 + x1 * w2 + y1 * z2 - z1 * y2; - this.y = w1 * y2 - x1 * z2 + y1 * w2 + z1 * x2; - this.z = w1 * z2 + x1 * y2 - y1 * x2 + z1 * w2; - }; - - Quaternion.prototype.multiplyVector = function (vector, target) { - if (typeof target === "undefined") { target = null; } - //target ||= new Quaternion(); - if (target === null) { - target = new Quaternion(); - } - - var x2 = vector.x; - var y2 = vector.y; - var z2 = vector.z; - - target.w = -this.x * x2 - this.y * y2 - this.z * z2; - target.x = this.w * x2 + this.y * z2 - this.z * y2; - target.y = this.w * y2 - this.x * z2 + this.z * x2; - target.z = this.w * z2 + this.x * y2 - this.y * x2; - - return target; - }; - - /** - * Fills the quaternion object with values representing the given rotation around a vector. - * - * @param axis The axis around which to rotate - * @param angle The angle in radians of the rotation. - */ - Quaternion.prototype.fromAxisAngle = function (axis, angle) { - var sin_a = Math.sin(angle / 2); - var cos_a = Math.cos(angle / 2); - - this.x = axis.x * sin_a; - this.y = axis.y * sin_a; - this.z = axis.z * sin_a; - this.w = cos_a; - - this.normalize(); - }; - - /** - * Spherically interpolates between two quaternions, providing an interpolation between rotations with constant angle change rate. - * @param qa The first quaternion to interpolate. - * @param qb The second quaternion to interpolate. - * @param t The interpolation weight, a value between 0 and 1. - */ - Quaternion.prototype.slerp = function (qa, qb, t) { - var w1 = qa.w, x1 = qa.x, y1 = qa.y, z1 = qa.z; - var w2 = qb.w, x2 = qb.x, y2 = qb.y, z2 = qb.z; - var dot = w1 * w2 + x1 * x2 + y1 * y2 + z1 * z2; - - // shortest direction - if (dot < 0) { - dot = -dot; - w2 = -w2; - x2 = -x2; - y2 = -y2; - z2 = -z2; - } - - if (dot < 0.95) { - // interpolate angle linearly - var angle = Math.acos(dot); - var s = 1 / Math.sin(angle); - var s1 = Math.sin(angle * (1 - t)) * s; - var s2 = Math.sin(angle * t) * s; - this.w = w1 * s1 + w2 * s2; - this.x = x1 * s1 + x2 * s2; - this.y = y1 * s1 + y2 * s2; - this.z = z1 * s1 + z2 * s2; - } else { - // nearly identical angle, interpolate linearly - this.w = w1 + t * (w2 - w1); - this.x = x1 + t * (x2 - x1); - this.y = y1 + t * (y2 - y1); - this.z = z1 + t * (z2 - z1); - var len = 1.0 / Math.sqrt(this.w * this.w + this.x * this.x + this.y * this.y + this.z * this.z); - this.w *= len; - this.x *= len; - this.y *= len; - this.z *= len; - } - }; - - /** - * Linearly interpolates between two quaternions. - * @param qa The first quaternion to interpolate. - * @param qb The second quaternion to interpolate. - * @param t The interpolation weight, a value between 0 and 1. - */ - Quaternion.prototype.lerp = function (qa, qb, t) { - var w1 = qa.w, x1 = qa.x, y1 = qa.y, z1 = qa.z; - var w2 = qb.w, x2 = qb.x, y2 = qb.y, z2 = qb.z; - var len; - - // shortest direction - if (w1 * w2 + x1 * x2 + y1 * y2 + z1 * z2 < 0) { - w2 = -w2; - x2 = -x2; - y2 = -y2; - z2 = -z2; - } - - this.w = w1 + t * (w2 - w1); - this.x = x1 + t * (x2 - x1); - this.y = y1 + t * (y2 - y1); - this.z = z1 + t * (z2 - z1); - - len = 1.0 / Math.sqrt(this.w * this.w + this.x * this.x + this.y * this.y + this.z * this.z); - this.w *= len; - this.x *= len; - this.y *= len; - this.z *= len; - }; - - /** - * Fills the quaternion object with values representing the given euler rotation. - * - * @param ax The angle in radians of the rotation around the ax axis. - * @param ay The angle in radians of the rotation around the ay axis. - * @param az The angle in radians of the rotation around the az axis. - */ - Quaternion.prototype.fromEulerAngles = function (ax, ay, az) { - var halfX = ax * .5, halfY = ay * .5, halfZ = az * .5; - var cosX = Math.cos(halfX), sinX = Math.sin(halfX); - var cosY = Math.cos(halfY), sinY = Math.sin(halfY); - var cosZ = Math.cos(halfZ), sinZ = Math.sin(halfZ); - - this.w = cosX * cosY * cosZ + sinX * sinY * sinZ; - this.x = sinX * cosY * cosZ - cosX * sinY * sinZ; - this.y = cosX * sinY * cosZ + sinX * cosY * sinZ; - this.z = cosX * cosY * sinZ - sinX * sinY * cosZ; - }; - - /** - * Fills a target Vector3D object with the Euler angles that form the rotation represented by this quaternion. - * @param target An optional Vector3D object to contain the Euler angles. If not provided, a new object is created. - * @return The Vector3D containing the Euler angles. - */ - Quaternion.prototype.toEulerAngles = function (target) { - if (typeof target === "undefined") { target = null; } - //target ||= new away.geom.Vector3D(); - if (target === null) { - target = new away.geom.Vector3D(); - } - - target.x = Math.atan2(2 * (this.w * this.x + this.y * this.z), 1 - 2 * (this.x * this.x + this.y * this.y)); - target.y = Math.asin(2 * (this.w * this.y - this.z * this.x)); - target.z = Math.atan2(2 * (this.w * this.z + this.x * this.y), 1 - 2 * (this.y * this.y + this.z * this.z)); - - return target; - }; - - /** - * Normalises the quaternion object. - */ - Quaternion.prototype.normalize = function (val) { - if (typeof val === "undefined") { val = 1; } - var mag = val / Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w); - - this.x *= mag; - this.y *= mag; - this.z *= mag; - this.w *= mag; - }; - - /** - * Used to trace the values of a quaternion. - * - * @return A string representation of the quaternion object. - */ - Quaternion.prototype.toString = function () { - return "{x:" + this.x + " y:" + this.y + " z:" + this.z + " w:" + this.w + "}"; - }; - - /** - * Converts the quaternion to a Matrix3D object representing an equivalent rotation. - * @param target An optional Matrix3D container to store the transformation in. If not provided, a new object is created. - * @return A Matrix3D object representing an equivalent rotation. - */ - Quaternion.prototype.toMatrix3D = function (target) { - if (typeof target === "undefined") { target = null; } - var rawData = away.geom.Matrix3DUtils.RAW_DATA_CONTAINER; - var xy2 = 2.0 * this.x * this.y, xz2 = 2.0 * this.x * this.z, xw2 = 2.0 * this.x * this.w; - var yz2 = 2.0 * this.y * this.z, yw2 = 2.0 * this.y * this.w, zw2 = 2.0 * this.z * this.w; - var xx = this.x * this.x, yy = this.y * this.y, zz = this.z * this.z, ww = this.w * this.w; - - rawData[0] = xx - yy - zz + ww; - rawData[4] = xy2 - zw2; - rawData[8] = xz2 + yw2; - rawData[12] = 0; - rawData[1] = xy2 + zw2; - rawData[5] = -xx + yy - zz + ww; - rawData[9] = yz2 - xw2; - rawData[13] = 0; - rawData[2] = xz2 - yw2; - rawData[6] = yz2 + xw2; - rawData[10] = -xx - yy + zz + ww; - rawData[14] = 0; - rawData[3] = 0.0; - rawData[7] = 0.0; - rawData[11] = 0; - rawData[15] = 1; - - if (!target) - return new away.geom.Matrix3D(rawData); - - target.copyRawDataFrom(rawData); - - return target; - }; - - /** - * Extracts a quaternion rotation matrix out of a given Matrix3D object. - * @param matrix The Matrix3D out of which the rotation will be extracted. - */ - Quaternion.prototype.fromMatrix = function (matrix) { - var v = matrix.decompose(away.geom.Orientation3D.QUATERNION)[1]; - this.x = v.x; - this.y = v.y; - this.z = v.z; - this.w = v.w; - }; - - /** - * Converts the quaternion to a Vector.<Number> matrix representation of a rotation equivalent to this quaternion. - * @param target The Vector.<Number> to contain the raw matrix data. - * @param exclude4thRow If true, the last row will be omitted, and a 4x3 matrix will be generated instead of a 4x4. - */ - Quaternion.prototype.toRawData = function (target, exclude4thRow) { - if (typeof exclude4thRow === "undefined") { exclude4thRow = false; } - var xy2 = 2.0 * this.x * this.y, xz2 = 2.0 * this.x * this.z, xw2 = 2.0 * this.x * this.w; - var yz2 = 2.0 * this.y * this.z, yw2 = 2.0 * this.y * this.w, zw2 = 2.0 * this.z * this.w; - var xx = this.x * this.x, yy = this.y * this.y, zz = this.z * this.z, ww = this.w * this.w; - - target[0] = xx - yy - zz + ww; - target[1] = xy2 - zw2; - target[2] = xz2 + yw2; - target[4] = xy2 + zw2; - target[5] = -xx + yy - zz + ww; - target[6] = yz2 - xw2; - target[8] = xz2 - yw2; - target[9] = yz2 + xw2; - target[10] = -xx - yy + zz + ww; - target[3] = target[7] = target[11] = 0; - - if (!exclude4thRow) { - target[12] = target[13] = target[14] = 0; - target[15] = 1; - } - }; - - /** - * Clones the quaternion. - * @return An exact duplicate of the current Quaternion. - */ - Quaternion.prototype.clone = function () { - return new Quaternion(this.x, this.y, this.z, this.w); - }; - - /** - * Rotates a point. - * @param vector The Vector3D object to be rotated. - * @param target An optional Vector3D object that will contain the rotated coordinates. If not provided, a new object will be created. - * @return A Vector3D object containing the rotated point. - */ - Quaternion.prototype.rotatePoint = function (vector, target) { - if (typeof target === "undefined") { target = null; } - var x1, y1, z1, w1; - var x2 = vector.x, y2 = vector.y, z2 = vector.z; - - //target ||= new away.geom.Vector3D(); - if (target === null) { - target = new away.geom.Vector3D(); - } - - // p*q' - w1 = -this.x * x2 - this.y * y2 - this.z * z2; - x1 = this.w * x2 + this.y * z2 - this.z * y2; - y1 = this.w * y2 - this.x * z2 + this.z * x2; - z1 = this.w * z2 + this.x * y2 - this.y * x2; - - target.x = -w1 * this.x + x1 * this.w - y1 * this.z + z1 * this.y; - target.y = -w1 * this.y + x1 * this.z + y1 * this.w - z1 * this.x; - target.z = -w1 * this.z - x1 * this.y + y1 * this.x + z1 * this.w; - - return target; - }; - - /** - * Copies the data from a quaternion into this instance. - * @param q The quaternion to copy from. - */ - Quaternion.prototype.copyFrom = function (q) { - this.x = q.x; - this.y = q.y; - this.z = q.z; - this.w = q.w; - }; - return Quaternion; - })(); - geom.Quaternion = Quaternion; - })(away.geom || (away.geom = {})); - var geom = away.geom; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * A Rectangle object is an area defined by its position, as indicated by its - * top-left corner point(x, y) and by its width and its height. - * - * - *

The x, y, width, and - * height properties of the Rectangle class are independent of - * each other; changing the value of one property has no effect on the others. - * However, the right and bottom properties are - * integrally related to those four properties. For example, if you change the - * value of the right property, the value of the - * width property changes; if you change the bottom - * property, the value of the height property changes.

- * - *

The following methods and properties use Rectangle objects:

- * - *
    - *
  • The applyFilter(), colorTransform(), - * copyChannel(), copyPixels(), draw(), - * fillRect(), generateFilterRect(), - * getColorBoundsRect(), getPixels(), - * merge(), paletteMap(), - * pixelDisolve(), setPixels(), and - * threshold() methods, and the rect property of the - * BitmapData class
  • - *
  • The getBounds() and getRect() methods, and - * the scrollRect and scale9Grid properties of the - * DisplayObject class
  • - *
  • The getCharBoundaries() method of the TextField - * class
  • - *
  • The pixelBounds property of the Transform class
  • - *
  • The bounds parameter for the startDrag() - * method of the Sprite class
  • - *
  • The printArea parameter of the addPage() - * method of the PrintJob class
  • - *
- * - *

You can use the new Rectangle() constructor to create a - * Rectangle object.

- * - *

Note: The Rectangle class does not define a rectangular Shape - * display object. To draw a rectangular Shape object onscreen, use the - * drawRect() method of the Graphics class.

- */ - (function (geom) { - var Rectangle = (function () { - /** - * Creates a new Rectangle object with the top-left corner specified by the - * x and y parameters and with the specified - * width and height parameters. If you call this - * public without parameters, a rectangle with x, - * y, width, and height properties set - * to 0 is created. - * - * @param x The x coordinate of the top-left corner of the - * rectangle. - * @param y The y coordinate of the top-left corner of the - * rectangle. - * @param width The width of the rectangle, in pixels. - * @param height The height of the rectangle, in pixels. - */ - function Rectangle(x, y, width, height) { - if (typeof x === "undefined") { x = 0; } - if (typeof y === "undefined") { y = 0; } - if (typeof width === "undefined") { width = 0; } - if (typeof height === "undefined") { height = 0; } - this.x = x; - this.y = y; - this.width = width; - this.height = height; - } - Object.defineProperty(Rectangle.prototype, "bottom", { - /** - * The sum of the y and height properties. - */ - get: function () { - return this.y + this.height; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Rectangle.prototype, "bottomRight", { - /** - * The location of the Rectangle object's bottom-right corner, determined by - * the values of the right and bottom properties. - */ - get: function () { - if (this._bottomRight == null) - this._bottomRight = new geom.Point(); - - this._bottomRight.x = this.x + this.width; - this._bottomRight.y = this.y + this.height; - - return this._bottomRight; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Rectangle.prototype, "left", { - /** - * The x coordinate of the top-left corner of the rectangle. Changing - * the left property of a Rectangle object has no effect on the - * y and height properties. However it does affect - * the width property, whereas changing the x value - * does not affect the width property. - * - *

The value of the left property is equal to the value of - * the x property.

- */ - get: function () { - return this.x; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Rectangle.prototype, "right", { - /** - * The sum of the x and width properties. - */ - get: function () { - return this.x + this.width; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Rectangle.prototype, "size", { - /** - * The size of the Rectangle object, expressed as a Point object with the - * values of the width and height properties. - */ - get: function () { - if (this._size == null) - this._size = new geom.Point(); - - this._size.x = this.width; - this._size.y = this.height; - - return this._size; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Rectangle.prototype, "top", { - /** - * The y coordinate of the top-left corner of the rectangle. Changing - * the top property of a Rectangle object has no effect on the - * x and width properties. However it does affect - * the height property, whereas changing the y - * value does not affect the height property. - * - *

The value of the top property is equal to the value of the - * y property.

- */ - get: function () { - return this.y; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Rectangle.prototype, "topLeft", { - /** - * The location of the Rectangle object's top-left corner, determined by the - * x and y coordinates of the point. - */ - get: function () { - if (this._topLeft == null) - this._topLeft = new geom.Point(); - - this._topLeft.x = this.x; - this._topLeft.y = this.y; - - return this._topLeft; - }, - enumerable: true, - configurable: true - }); - - /** - * Returns a new Rectangle object with the same values for the - * x, y, width, and - * height properties as the original Rectangle object. - * - * @return A new Rectangle object with the same values for the - * x, y, width, and - * height properties as the original Rectangle object. - */ - Rectangle.prototype.clone = function () { - return new Rectangle(this.x, this.y, this.width, this.height); - }; - - /** - * Determines whether the specified point is contained within the rectangular - * region defined by this Rectangle object. - * - * @param x The x coordinate(horizontal position) of the point. - * @param y The y coordinate(vertical position) of the point. - * @return A value of true if the Rectangle object contains the - * specified point; otherwise false. - */ - Rectangle.prototype.contains = function (x, y) { - return (this.x <= x && this.x + this.width >= x && this.y <= y && this.y + this.height >= y); - }; - - /** - * Determines whether the specified point is contained within the rectangular - * region defined by this Rectangle object. This method is similar to the - * Rectangle.contains() method, except that it takes a Point - * object as a parameter. - * - * @param point The point, as represented by its x and y - * coordinates. - * @return A value of true if the Rectangle object contains the - * specified point; otherwise false. - */ - Rectangle.prototype.containsPoint = function (point) { - return (this.x <= point.x && this.x + this.width >= point.x && this.y <= point.y && this.y + this.height >= point.y); - }; - - /** - * Determines whether the Rectangle object specified by the rect - * parameter is contained within this Rectangle object. A Rectangle object is - * said to contain another if the second Rectangle object falls entirely - * within the boundaries of the first. - * - * @param rect The Rectangle object being checked. - * @return A value of true if the Rectangle object that you - * specify is contained by this Rectangle object; otherwise - * false. - */ - Rectangle.prototype.containsRect = function (rect) { - return (this.x <= rect.x && this.x + this.width >= rect.x + rect.width && this.y <= rect.y && this.y + this.height >= rect.y + rect.height); - }; - - /** - * Copies all of rectangle data from the source Rectangle object into the - * calling Rectangle object. - * - * @param sourceRect The Rectangle object from which to copy the data. - */ - Rectangle.prototype.copyFrom = function (sourceRect) { - }; - - /** - * Determines whether the object specified in the toCompare - * parameter is equal to this Rectangle object. This method compares the - * x, y, width, and - * height properties of an object against the same properties of - * this Rectangle object. - * - * @param toCompare The rectangle to compare to this Rectangle object. - * @return A value of true if the object has exactly the same - * values for the x, y, width, - * and height properties as this Rectangle object; - * otherwise false. - */ - Rectangle.prototype.equals = function (toCompare) { - return (this.x == toCompare.x && this.y == toCompare.y && this.width == toCompare.width && this.height == toCompare.height); - }; - - /** - * Increases the size of the Rectangle object by the specified amounts, in - * pixels. The center point of the Rectangle object stays the same, and its - * size increases to the left and right by the dx value, and to - * the top and the bottom by the dy value. - * - * @param dx The value to be added to the left and the right of the Rectangle - * object. The following equation is used to calculate the new - * width and position of the rectangle: - * @param dy The value to be added to the top and the bottom of the - * Rectangle. The following equation is used to calculate the new - * height and position of the rectangle: - */ - Rectangle.prototype.inflate = function (dx, dy) { - this.x -= dx / 2; - this.y -= dy / 2; - this.width += dx / 2; - this.height += dy / 2; - }; - - /** - * Increases the size of the Rectangle object. This method is similar to the - * Rectangle.inflate() method except it takes a Point object as - * a parameter. - * - *

The following two code examples give the same result:

- * - * @param point The x property of this Point object is used to - * increase the horizontal dimension of the Rectangle object. - * The y property is used to increase the vertical - * dimension of the Rectangle object. - */ - Rectangle.prototype.inflatePoint = function (point) { - this.x -= point.x / 2; - this.y -= point.y / 2; - this.width += point.x / 2; - this.height += point.y / 2; - }; - - /** - * If the Rectangle object specified in the toIntersect - * parameter intersects with this Rectangle object, returns the area of - * intersection as a Rectangle object. If the rectangles do not intersect, - * this method returns an empty Rectangle object with its properties set to - * 0. - * - * @param toIntersect The Rectangle object to compare against to see if it - * intersects with this Rectangle object. - * @return A Rectangle object that equals the area of intersection. If the - * rectangles do not intersect, this method returns an empty - * Rectangle object; that is, a rectangle with its x, - * y, width, and height - * properties set to 0. - */ - Rectangle.prototype.intersection = function (toIntersect) { - if (this.intersects(toIntersect)) { - var i = new Rectangle(); - - if (this.x > toIntersect.x) { - i.x = this.x; - i.width = toIntersect.x - this.x + toIntersect.width; - - if (i.width > this.width) - i.width = this.width; - } else { - i.x = toIntersect.x; - i.width = this.x - toIntersect.x + this.width; - - if (i.width > toIntersect.width) - i.width = toIntersect.width; - } - - if (this.y > toIntersect.y) { - i.y = this.y; - i.height = toIntersect.y - this.y + toIntersect.height; - - if (i.height > this.height) - i.height = this.height; - } else { - i.y = toIntersect.y; - i.height = this.y - toIntersect.y + this.height; - - if (i.height > toIntersect.height) - i.height = toIntersect.height; - } - - return i; - } - - return new Rectangle(); - }; - - /** - * Determines whether the object specified in the toIntersect - * parameter intersects with this Rectangle object. This method checks the - * x, y, width, and - * height properties of the specified Rectangle object to see if - * it intersects with this Rectangle object. - * - * @param toIntersect The Rectangle object to compare against this Rectangle - * object. - * @return A value of true if the specified object intersects - * with this Rectangle object; otherwise false. - */ - Rectangle.prototype.intersects = function (toIntersect) { - return (this.x + this.width > toIntersect.x && this.x < toIntersect.x + toIntersect.width && this.y + this.height > toIntersect.y && this.y < toIntersect.y + toIntersect.height); - }; - - /** - * Determines whether or not this Rectangle object is empty. - * - * @return A value of true if the Rectangle object's width or - * height is less than or equal to 0; otherwise false. - */ - Rectangle.prototype.isEmpty = function () { - return (this.x == 0 && this.y == 0 && this.width == 0 && this.height == 0); - }; - - /** - * Adjusts the location of the Rectangle object, as determined by its - * top-left corner, by the specified amounts. - * - * @param dx Moves the x value of the Rectangle object by this amount. - * @param dy Moves the y value of the Rectangle object by this amount. - */ - Rectangle.prototype.offset = function (dx, dy) { - this.x += dx; - this.y += dy; - }; - - /** - * Adjusts the location of the Rectangle object using a Point object as a - * parameter. This method is similar to the Rectangle.offset() - * method, except that it takes a Point object as a parameter. - * - * @param point A Point object to use to offset this Rectangle object. - */ - Rectangle.prototype.offsetPoint = function (point) { - this.x += point.x; - this.y += point.y; - }; - - /** - * Sets all of the Rectangle object's properties to 0. A Rectangle object is - * empty if its width or height is less than or equal to 0. - * - *

This method sets the values of the x, y, - * width, and height properties to 0.

- * - */ - Rectangle.prototype.setEmpty = function () { - this.x = 0; - this.y = 0; - this.width = 0; - this.height = 0; - }; - - /** - * Sets the members of Rectangle to the specified values - * - * @param xa The x coordinate of the top-left corner of the - * rectangle. - * @param ya The y coordinate of the top-left corner of the - * rectangle. - * @param widtha The width of the rectangle, in pixels. - * @param heighta The height of the rectangle, in pixels. - */ - Rectangle.prototype.setTo = function (xa, ya, widtha, heighta) { - this.x = xa; - this.y = ya; - this.width = widtha; - this.height = heighta; - }; - - /** - * Builds and returns a string that lists the horizontal and vertical - * positions and the width and height of the Rectangle object. - * - * @return A string listing the value of each of the following properties of - * the Rectangle object: x, y, - * width, and height. - */ - Rectangle.prototype.toString = function () { - return "[Rectangle] (x=" + this.x + ", y=" + this.y + ", width=" + this.width + ", height=" + this.height + ")"; - }; - - /** - * Adds two rectangles together to create a new Rectangle object, by filling - * in the horizontal and vertical space between the two rectangles. - * - *

Note: The union() method ignores rectangles with - * 0 as the height or width value, such as: var - * rect2:Rectangle = new Rectangle(300,300,50,0);

- * - * @param toUnion A Rectangle object to add to this Rectangle object. - * @return A new Rectangle object that is the union of the two rectangles. - */ - Rectangle.prototype.union = function (toUnion) { - var u = new Rectangle(); - - if (this.x < toUnion.x) { - u.x = this.x; - u.width = toUnion.x - this.x + toUnion.width; - - if (u.width < this.width) - u.width = this.width; - } else { - u.x = toUnion.x; - u.width = this.x - toUnion.x + this.width; - - if (u.width < toUnion.width) - u.width = toUnion.width; - } - - if (this.y < toUnion.y) { - u.y = this.y; - u.height = toUnion.y - this.y + toUnion.height; - - if (u.height < this.height) - u.height = this.height; - } else { - u.y = toUnion.y; - u.height = this.y - toUnion.y + this.height; - - if (u.height < toUnion.height) - u.height = toUnion.height; - } - - return u; - }; - return Rectangle; - })(); - geom.Rectangle = Rectangle; - })(away.geom || (away.geom = {})); - var geom = away.geom; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The Transform class provides access to color adjustment properties and two- - * or three-dimensional transformation objects that can be applied to a - * display object. During the transformation, the color or the orientation and - * position of a display object is adjusted(offset) from the current values - * or coordinates to new values or coordinates. The Transform class also - * collects data about color and two-dimensional matrix transformations that - * are applied to a display object and all of its parent objects. You can - * access these combined transformations through the - * concatenatedColorTransform and concatenatedMatrix - * properties. - * - *

To apply color transformations: create a ColorTransform object, set the - * color adjustments using the object's methods and properties, and then - * assign the colorTransformation property of the - * transform property of the display object to the new - * ColorTransformation object.

- * - *

To apply two-dimensional transformations: create a Matrix object, set - * the matrix's two-dimensional transformation, and then assign the - * transform.matrix property of the display object to the new - * Matrix object.

- * - *

To apply three-dimensional transformations: start with a - * three-dimensional display object. A three-dimensional display object has a - * z property value other than zero. You do not need to create - * the Matrix3D object. For all three-dimensional objects, a Matrix3D object - * is created automatically when you assign a z value to a - * display object. You can access the display object's Matrix3D object through - * the display object's transform property. Using the methods of - * the Matrix3D class, you can add to or modify the existing transformation - * settings. Also, you can create a custom Matrix3D object, set the custom - * Matrix3D object's transformation elements, and then assign the new Matrix3D - * object to the display object using the transform.matrix - * property.

- * - *

To modify a perspective projection of the stage or root object: use the - * transform.matrix property of the root display object to gain - * access to the PerspectiveProjection object. Or, apply different perspective - * projection properties to a display object by setting the perspective - * projection properties of the display object's parent. The child display - * object inherits the new properties. Specifically, create a - * PerspectiveProjection object and set its properties, then assign the - * PerspectiveProjection object to the perspectiveProjection - * property of the parent display object's transform property. - * The specified projection transformation then applies to all the display - * object's three-dimensional children.

- * - *

Since both PerspectiveProjection and Matrix3D objects perform - * perspective transformations, do not assign both to a display object at the - * same time. Use the PerspectiveProjection object for focal length and - * projection center changes. For more control over the perspective - * transformation, create a perspective projection Matrix3D object.

- */ - (function (geom) { - var Transform = (function () { - function Transform(displayObject) { - this._position = new away.geom.Vector3D(); - this._displayObject = displayObject; - } - Object.defineProperty(Transform.prototype, "backVector", { - /** - * - */ - get: function () { - var director = away.geom.Matrix3DUtils.getForward(this._displayObject._iMatrix3D); - director.negate(); - - return director; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Transform.prototype, "concatenatedColorTransform", { - /** - * A ColorTransform object representing the combined color transformations - * applied to the display object and all of its parent objects, back to the - * root level. If different color transformations have been applied at - * different levels, all of those transformations are concatenated into one - * ColorTransform object for this property. - */ - get: function () { - return this._concatenatedColorTransform; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Transform.prototype, "concatenatedMatrix", { - /** - * A Matrix object representing the combined transformation matrixes of the - * display object and all of its parent objects, back to the root level. If - * different transformation matrixes have been applied at different levels, - * all of those matrixes are concatenated into one matrix for this property. - * Also, for resizeable SWF content running in the browser, this property - * factors in the difference between stage coordinates and window coordinates - * due to window resizing. Thus, the property converts local coordinates to - * window coordinates, which may not be the same coordinate space as that of - * the Stage. - */ - get: function () { - return this._concatenatedMatrix; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Transform.prototype, "downVector", { - /** - * - */ - get: function () { - var director = away.geom.Matrix3DUtils.getUp(this._displayObject._iMatrix3D); - director.negate(); - - return director; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Transform.prototype, "forwardVector", { - /** - * - */ - get: function () { - return away.geom.Matrix3DUtils.getForward(this._displayObject._iMatrix3D); - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Transform.prototype, "leftVector", { - /** - * - */ - get: function () { - var director = away.geom.Matrix3DUtils.getRight(this._displayObject._iMatrix3D); - director.negate(); - - return director; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Transform.prototype, "matrix3D", { - /** - * Provides access to the Matrix3D object of a three-dimensional display - * object. The Matrix3D object represents a transformation matrix that - * determines the display object's position and orientation. A Matrix3D - * object can also perform perspective projection. - * - *

If the matrix property is set to a value(not - * null), the matrix3D property is - * null. And if the matrix3D property is set to a - * value(not null), the matrix property is - * null.

- */ - get: function () { - return this._displayObject._iMatrix3D; - }, - set: function (val) { - this._displayObject._iMatrix3D = val; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Transform.prototype, "pixelBounds", { - /** - * A Rectangle object that defines the bounding rectangle of the display - * object on the stage. - */ - get: function () { - return this._pixelBounds; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Transform.prototype, "position", { - /** - * Defines the position of the 3d object, relative to the local coordinates of the parent ObjectContainer3D. - */ - get: function () { - return this._displayObject._iMatrix3D.position; - }, - set: function (value) { - this._displayObject.x = value.x; - this._displayObject.y = value.y; - this._displayObject.z = value.z; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Transform.prototype, "rightVector", { - /** - * - */ - get: function () { - return away.geom.Matrix3DUtils.getRight(this._displayObject._iMatrix3D); - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Transform.prototype, "rotation", { - /** - * Defines the rotation of the 3d object, relative to the local coordinates of the parent ObjectContainer3D. - */ - get: function () { - return new geom.Vector3D(this._displayObject.rotationX, this._displayObject.rotationY, this._displayObject.rotationZ); - }, - set: function (value) { - this._displayObject.rotationX = value.x; - this._displayObject.rotationY = value.y; - this._displayObject.rotationZ = value.z; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Transform.prototype, "scale", { - /** - * Defines the scale of the 3d object, relative to the local coordinates of the parent ObjectContainer3D. - */ - get: function () { - return new geom.Vector3D(this._displayObject.scaleX, this._displayObject.scaleY, this._displayObject.scaleZ); - }, - set: function (value) { - this._displayObject.scaleX = value.x; - this._displayObject.scaleY = value.y; - this._displayObject.scaleZ = value.z; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Transform.prototype, "upVector", { - /** - * - */ - get: function () { - return away.geom.Matrix3DUtils.getUp(this._displayObject._iMatrix3D); - }, - enumerable: true, - configurable: true - }); - - /** - * Returns a Matrix3D object, which can transform the space of a specified - * display object in relation to the current display object's space. You can - * use the getRelativeMatrix3D() method to move one - * three-dimensional display object relative to another three-dimensional - * display object. - * - * @param relativeTo The display object relative to which the transformation - * occurs. To get a Matrix3D object relative to the stage, - * set the parameter to the root or - * stage object. To get the world-relative - * matrix of the display object, set the parameter to a - * display object that has a perspective transformation - * applied to it. - * @return A Matrix3D object that can be used to transform the space from the - * relativeTo display object to the current display - * object space. - */ - Transform.prototype.getRelativeMatrix3D = function (relativeTo) { - return new geom.Matrix3D(); - }; - - /** - * Moves the 3d object forwards along it's local z axis - * - * @param distance The length of the movement - */ - Transform.prototype.moveForward = function (distance) { - this._displayObject.translateLocal(away.geom.Vector3D.Z_AXIS, distance); - }; - - /** - * Moves the 3d object backwards along it's local z axis - * - * @param distance The length of the movement - */ - Transform.prototype.moveBackward = function (distance) { - this._displayObject.translateLocal(away.geom.Vector3D.Z_AXIS, -distance); - }; - - /** - * Moves the 3d object backwards along it's local x axis - * - * @param distance The length of the movement - */ - Transform.prototype.moveLeft = function (distance) { - this._displayObject.translateLocal(away.geom.Vector3D.X_AXIS, -distance); - }; - - /** - * Moves the 3d object forwards along it's local x axis - * - * @param distance The length of the movement - */ - Transform.prototype.moveRight = function (distance) { - this._displayObject.translateLocal(away.geom.Vector3D.X_AXIS, distance); - }; - - /** - * Moves the 3d object forwards along it's local y axis - * - * @param distance The length of the movement - */ - Transform.prototype.moveUp = function (distance) { - this._displayObject.translateLocal(away.geom.Vector3D.Y_AXIS, distance); - }; - - /** - * Moves the 3d object backwards along it's local y axis - * - * @param distance The length of the movement - */ - Transform.prototype.moveDown = function (distance) { - this._displayObject.translateLocal(away.geom.Vector3D.Y_AXIS, -distance); - }; - return Transform; - })(); - geom.Transform = Transform; - })(away.geom || (away.geom = {})); - var geom = away.geom; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (geom) { - var UVTransform = (function () { - function UVTransform() { - this._uvMatrix = new away.geom.Matrix(); - this._rotation = 0; - this._scaleU = 1; - this._scaleV = 1; - this._offsetU = 0; - this._offsetV = 0; - } - Object.defineProperty(UVTransform.prototype, "offsetU", { - /** - * - */ - get: function () { - return this._offsetU; - }, - set: function (value) { - if (value == this._offsetU) - return; - - this._offsetU = value; - this._uvMatrixDirty = true; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(UVTransform.prototype, "offsetV", { - /** - * - */ - get: function () { - return this._offsetV; - }, - set: function (value) { - if (value == this._offsetV) - return; - - this._offsetV = value; - this._uvMatrixDirty = true; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(UVTransform.prototype, "rotation", { - /** - * - */ - get: function () { - return this._rotation; - }, - set: function (value) { - if (value == this._rotation) - return; - - this._rotation = value; - - this._uvMatrixDirty = true; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(UVTransform.prototype, "scaleU", { - /** - * - */ - get: function () { - return this._scaleU; - }, - set: function (value) { - if (value == this._scaleU) - return; - - this._scaleU = value; - - this._uvMatrixDirty = true; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(UVTransform.prototype, "scaleV", { - /** - * - */ - get: function () { - return this._scaleV; - }, - set: function (value) { - if (value == this._scaleV) - return; - - this._scaleV = value; - - this._uvMatrixDirty = true; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(UVTransform.prototype, "matrix", { - /** - * - */ - get: function () { - if (this._uvMatrixDirty) - this.updateUVMatrix(); - - return this._uvMatrix; - }, - enumerable: true, - configurable: true - }); - - /** - * @private - */ - UVTransform.prototype.updateUVMatrix = function () { - this._uvMatrix.identity(); - - if (this._rotation != 0) - this._uvMatrix.rotate(this._rotation); - - if (this._scaleU != 1 || this._scaleV != 1) - this._uvMatrix.scale(this._scaleU, this._scaleV); - - this._uvMatrix.translate(this._offsetU, this._offsetV); - - this._uvMatrixDirty = false; - }; - return UVTransform; - })(); - geom.UVTransform = UVTransform; - })(away.geom || (away.geom = {})); - var geom = away.geom; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The Vector3D class represents a point or a location in the three-dimensional - * space using the Cartesian coordinates x, y, and z. As in a two-dimensional - * space, the x property represents the horizontal axis and the y property - * represents the vertical axis. In three-dimensional space, the z property - * represents depth. The value of the x property increases as the object moves - * to the right. The value of the y property increases as the object moves - * down. The z property increases as the object moves farther from the point - * of view. Using perspective projection and scaling, the object is seen to be - * bigger when near and smaller when farther away from the screen. As in a - * right-handed three-dimensional coordinate system, the positive z-axis points - * away from the viewer and the value of the z property increases as the object - * moves away from the viewer's eye. The origin point (0,0,0) of the global - * space is the upper-left corner of the stage. - * - *

The Vector3D class can also represent a direction, an arrow pointing from - * the origin of the coordinates, such as (0,0,0), to an endpoint; or a - * floating-point component of an RGB (Red, Green, Blue) color model.

- * - *

Quaternion notation introduces a fourth element, the w property, which - * provides additional orientation information. For example, the w property can - * define an angle of rotation of a Vector3D object. The combination of the - * angle of rotation and the coordinates x, y, and z can determine the display - * object's orientation. Here is a representation of Vector3D elements in - * matrix notation:

- */ - (function (geom) { - var Vector3D = (function () { - /** - * Creates an instance of a Vector3D object. If you do not specify a - * parameter for the constructor, a Vector3D object is created with - * the elements (0,0,0,0). - * - * @param x The first element, such as the x coordinate. - * @param y The second element, such as the y coordinate. - * @param z The third element, such as the z coordinate. - * @param w An optional element for additional data such as the angle - * of rotation. - */ - function Vector3D(x, y, z, w) { - if (typeof x === "undefined") { x = 0; } - if (typeof y === "undefined") { y = 0; } - if (typeof z === "undefined") { z = 0; } - if (typeof w === "undefined") { w = 0; } - this.x = x; - this.y = y; - this.z = z; - this.w = w; - } - Object.defineProperty(Vector3D.prototype, "length", { - /** - * The length, magnitude, of the current Vector3D object from the - * origin (0,0,0) to the object's x, y, and z coordinates. The w - * property is ignored. A unit vector has a length or magnitude of - * one. - */ - get: function () { - return Math.sqrt(this.lengthSquared); - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Vector3D.prototype, "lengthSquared", { - /** - * The square of the length of the current Vector3D object, calculated - * using the x, y, and z properties. The w property is ignored. Use the - * lengthSquared() method whenever possible instead of the - * slower Math.sqrt() method call of the - * Vector3D.length() method. - */ - get: function () { - return this.x * this.x + this.y * this.y + this.z * this.z; - }, - enumerable: true, - configurable: true - }); - - /** - * Adds the value of the x, y, and z elements of the current Vector3D - * object to the values of the x, y, and z elements of another Vector3D - * object. The add() method does not change the current - * Vector3D object. Instead, it returns a new Vector3D object with - * the new values. - * - *

The result of adding two vectors together is a resultant vector. - * One way to visualize the result is by drawing a vector from the - * origin or tail of the first vector to the end or head of the second - * vector. The resultant vector is the distance between the origin - * point of the first vector and the end point of the second vector. - *

- */ - Vector3D.prototype.add = function (a) { - return new Vector3D(this.x + a.x, this.y + a.y, this.z + a.z, this.w + a.w); - }; - - /** - * Returns the angle in radians between two vectors. The returned angle - * is the smallest radian the first Vector3D object rotates until it - * aligns with the second Vector3D object. - * - *

The angleBetween() method is a static method. You - * can use it directly as a method of the Vector3D class.

- * - *

To convert a degree to a radian, you can use the following - * formula:

- * - *

radian = Math.PI/180 * degree

- * - * @param a The first Vector3D object. - * @param b The second Vector3D object. - * @returns The angle between two Vector3D objects. - */ - Vector3D.angleBetween = function (a, b) { - return Math.acos(a.dotProduct(b) / (a.length * b.length)); - }; - - /** - * Returns a new Vector3D object that is an exact copy of the current - * Vector3D object. - * - * @returns A new Vector3D object that is a copy of the current - * Vector3D object. - */ - Vector3D.prototype.clone = function () { - return new Vector3D(this.x, this.y, this.z, this.w); - }; - - /** - * Copies all of vector data from the source Vector3D object into the - * calling Vector3D object. - * - * @param src The Vector3D object from which to copy the data. - */ - Vector3D.prototype.copyFrom = function (src) { - this.x = src.x; - this.y = src.y; - this.z = src.z; - this.w = src.w; - }; - - /** - * Returns a new Vector3D object that is perpendicular (at a right - * angle) to the current Vector3D and another Vector3D object. If the - * returned Vector3D object's coordinates are (0,0,0), then the two - * Vector3D objects are parallel to each other. - * - *

You can use the normalized cross product of two vertices of a - * polygon surface with the normalized vector of the camera or eye - * viewpoint to get a dot product. The value of the dot product can - * identify whether a surface of a three-dimensional object is hidden - * from the viewpoint.

- * - * @param a A second Vector3D object. - * @returns A new Vector3D object that is perpendicular to the current - * Vector3D object and the Vector3D object specified as the - * parameter. - */ - Vector3D.prototype.crossProduct = function (a) { - return new Vector3D(this.y * a.z - this.z * a.y, this.z * a.x - this.x * a.z, this.x * a.y - this.y * a.x, 1); - }; - - /** - * Decrements the value of the x, y, and z elements of the current - * Vector3D object by the values of the x, y, and z elements of - * specified Vector3D object. Unlike the - * Vector3D.subtract() method, the - * decrementBy() method changes the current Vector3D - * object and does not return a new Vector3D object. - * - * @param a The Vector3D object containing the values to subtract from - * the current Vector3D object. - */ - Vector3D.prototype.decrementBy = function (a) { - this.x -= a.x; - this.y -= a.y; - this.z -= a.z; - }; - - /** - * Returns the distance between two Vector3D objects. The - * distance() method is a static method. You can use it - * directly as a method of the Vector3D class to get the Euclidean - * distance between two three-dimensional points. - * - * @param pt1 A Vector3D object as the first three-dimensional point. - * @param pt2 A Vector3D object as the second three-dimensional point. - * @returns The distance between two Vector3D objects. - */ - Vector3D.distance = function (pt1, pt2) { - var x = (pt1.x - pt2.x); - var y = (pt1.y - pt2.y); - var z = (pt1.z - pt2.z); - return Math.sqrt(x * x + y * y + z * z); - }; - - /** - * If the current Vector3D object and the one specified as the - * parameter are unit vertices, this method returns the cosine of the - * angle between the two vertices. Unit vertices are vertices that - * point to the same direction but their length is one. They remove the - * length of the vector as a factor in the result. You can use the - * normalize() method to convert a vector to a unit - * vector. - * - *

The dotProduct() method finds the angle between two - * vertices. It is also used in backface culling or lighting - * calculations. Backface culling is a procedure for determining which - * surfaces are hidden from the viewpoint. You can use the normalized - * vertices from the camera, or eye, viewpoint and the cross product of - * the vertices of a polygon surface to get the dot product. If the dot - * product is less than zero, then the surface is facing the camera or - * the viewer. If the two unit vertices are perpendicular to each - * other, they are orthogonal and the dot product is zero. If the two - * vertices are parallel to each other, the dot product is one.

- * - * @param a The second Vector3D object. - * @returns A scalar which is the dot product of the current Vector3D - * object and the specified Vector3D object. - * - * @see away.geom.Vector3D#crossProduct() - * @see away.geom.Vector3D#normalize() - */ - Vector3D.prototype.dotProduct = function (a) { - return this.x * a.x + this.y * a.y + this.z * a.z; - }; - - /** - * Determines whether two Vector3D objects are equal by comparing the - * x, y, and z elements of the current Vector3D object with a - * specified Vector3D object. If the values of these elements are the - * same, the two Vector3D objects are equal. If the second optional - * parameter is set to true, all four elements of the Vector3D objects, - * including the w property, are compared. - */ - /** - * - * @param toCompare The Vector3D object to be compared with the current - * Vector3D object. - * @param allFour An optional parameter that specifies whether the w - * property of the Vector3D objects is used in the - * comparison. - * @returns A value of true if the specified Vector3D object is equal - * to the current Vector3D object; false if it is not equal. - */ - Vector3D.prototype.equals = function (toCompare, allFour) { - if (typeof allFour === "undefined") { allFour = false; } - return (this.x == toCompare.x && this.y == toCompare.y && this.z == toCompare.z && (!allFour || this.w == toCompare.w)); - }; - - /** - * Increments the value of the x, y, and z elements of the current - * Vector3D object by the values of the x, y, and z elements of a - * specified Vector3D object. Unlike the Vector3D.add() - * method, the incrementBy() method changes the current - * Vector3D object and does not return a new Vector3D object. - * - * @param a The Vector3D object to be added to the current Vector3D - * object. - */ - Vector3D.prototype.incrementBy = function (a) { - this.x += a.x; - this.y += a.y; - this.z += a.z; - }; - - /** - * Compares the elements of the current Vector3D object with the - * elements of a specified Vector3D object to determine whether they - * are nearly equal. The two Vector3D objects are nearly equal if the - * value of all the elements of the two vertices are equal, or the - * result of the comparison is within the tolerance range. The - * difference between two elements must be less than the number - * specified as the tolerance parameter. If the third optional - * parameter is set to true, all four elements of the - * Vector3D objects, including the w property, are - * compared. Otherwise, only the x, y, and z elements are included in - * the comparison. - */ - /** - * - * @param toCompare The Vector3D object to be compared with the current - * Vector3D object. - * @param tolerance A number determining the tolerance factor. If the - * difference between the values of the Vector3D - * element specified in the toCompare parameter and - * the current Vector3D element is less than the - * tolerance number, the two values are considered - * nearly equal. - * @param allFour An optional parameter that specifies whether the w - * property of the Vector3D objects is used in the - * comparison. - * @returns A value of true if the specified Vector3D object is nearly - * equal to the current Vector3D object; false if it is not - * equal. - * - * @see away.geom.Vector3D#equals() - */ - Vector3D.prototype.nearEquals = function (toCompare, tolerance, allFour) { - if (typeof allFour === "undefined") { allFour = true; } - return ((Math.abs(this.x - toCompare.x) < tolerance) && (Math.abs(this.y - toCompare.y) < tolerance) && (Math.abs(this.z - toCompare.z) < tolerance) && (!allFour || Math.abs(this.w - toCompare.w) < tolerance)); - }; - - /** - * Sets the current Vector3D object to its inverse. The inverse object - * is also considered the opposite of the original object. The value of - * the x, y, and z properties of the current Vector3D object is changed - * to -x, -y, and -z. - */ - Vector3D.prototype.negate = function () { - this.x = -this.x; - this.y = -this.y; - this.z = -this.z; - }; - - /** - * Converts a Vector3D object to a unit vector by dividing the first - * three elements (x, y, z) by the length of the vector. Unit vertices - * are vertices that have a direction but their length is one. They - * simplify vector calculations by removing length as a factor. - */ - /** - * Scales the line segment between(0,0) and the current point to a set - * length. - * - * @param thickness The scaling value. For example, if the current - * Vector3D object is (0,3,4), and you normalize it to - * 1, the point returned is at(0,0.6,0.8). - */ - Vector3D.prototype.normalize = function (thickness) { - if (typeof thickness === "undefined") { thickness = 1; } - if (this.length != 0) { - var invLength = thickness / this.length; - this.x *= invLength; - this.y *= invLength; - this.z *= invLength; - return; - } - }; - - /** - * Divides the value of the x, y, and - * z properties of the current Vector3D object by the - * value of its w property. - * - *

If the current Vector3D object is the result of multiplying a - * Vector3D object by a projection Matrix3D object, the w property can - * hold the transform value. The project() method then can - * complete the projection by dividing the elements by the - * w property. Use the Matrix3D.rawData - * property to create a projection Matrix3D object.

- */ - Vector3D.prototype.project = function () { - this.x /= this.w; - this.y /= this.w; - this.z /= this.w; - }; - - /** - * Scales the current Vector3D object by a scalar, a magnitude. The - * Vector3D object's x, y, and z elements are multiplied by the scalar - * number specified in the parameter. For example, if the vector is - * scaled by ten, the result is a vector that is ten times longer. The - * scalar can also change the direction of the vector. Multiplying the - * vector by a negative number reverses its direction. - * - * @param s A multiplier (scalar) used to scale a Vector3D object. - - */ - Vector3D.prototype.scaleBy = function (s) { - this.x *= s; - this.y *= s; - this.z *= s; - }; - - /** - * Sets the members of Vector3D to the specified values - * - * @param xa The first element, such as the x coordinate. - * @param ya The second element, such as the y coordinate. - * @param za The third element, such as the z coordinate. - */ - Vector3D.prototype.setTo = function (xa, ya, za) { - this.x = xa; - this.y = ya; - this.z = za; - }; - - /** - * Subtracts the value of the x, y, and z elements of the current - * Vector3D object from the values of the x, y, and z elements of - * another Vector3D object. The subtract() method does not - * change the current Vector3D object. Instead, this method returns a - * new Vector3D object with the new values. - * - * @param a The Vector3D object to be subtracted from the current - * Vector3D object. - * @returns A new Vector3D object that is the difference between the - * current Vector3D and the specified Vector3D object. - * - * @see away.geom.Vector3D#decrementBy() - */ - Vector3D.prototype.subtract = function (a) { - return new Vector3D(this.x - a.x, this.y - a.y, this.z - a.z); - }; - - /** - * Returns a string representation of the current Vector3D object. The - * string contains the values of the x, y, and z properties. - */ - Vector3D.prototype.toString = function () { - return "[Vector3D] (x:" + this.x + " ,y:" + this.y + ", z" + this.z + ", w:" + this.w + ")"; - }; - Vector3D.X_AXIS = new Vector3D(1, 0, 0); - - Vector3D.Y_AXIS = new Vector3D(0, 1, 0); - - Vector3D.Z_AXIS = new Vector3D(0, 0, 1); - return Vector3D; - })(); - geom.Vector3D = Vector3D; - })(away.geom || (away.geom = {})); - var geom = away.geom; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (_bounds) { - var Box = away.geom.Box; - - var BoundingVolumeBase = (function () { - function BoundingVolumeBase() { - this._pAabbPoints = new Array(); - this._pAabbPointsDirty = true; - this._aabb = new Box(); - } - Object.defineProperty(BoundingVolumeBase.prototype, "aabb", { - get: function () { - return this._aabb; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(BoundingVolumeBase.prototype, "aabbPoints", { - get: function () { - if (this._pAabbPointsDirty) - this.pUpdateAABBPoints(); - - return this._pAabbPoints; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(BoundingVolumeBase.prototype, "boundingEntity", { - get: function () { - if (!this._pBoundingEntity) { - this._pBoundingEntity = this.pCreateBoundingEntity(); - this.pUpdateBoundingEntity(); - } - - return this._pBoundingEntity; - }, - enumerable: true, - configurable: true - }); - - BoundingVolumeBase.prototype.nullify = function () { - this._aabb.x = this._aabb.y = this._aabb.z = 0; - this._aabb.width = this._aabb.height = this._aabb.depth = 0; - this._pAabbPointsDirty = true; - - if (this._pBoundingEntity) - this.pUpdateBoundingEntity(); - }; - - BoundingVolumeBase.prototype.disposeRenderable = function () { - if (this._pBoundingEntity) - this._pBoundingEntity.dispose(); - - this._pBoundingEntity = null; - }; - - BoundingVolumeBase.prototype.fromVertices = function (vertices) { - var i; - var len = vertices.length; - var minX, minY, minZ; - var maxX, maxY, maxZ; - - if (len == 0) { - this.nullify(); - return; - } - - var v; - - minX = maxX = vertices[i++]; - minY = maxY = vertices[i++]; - minZ = maxZ = vertices[i++]; - - while (i < len) { - v = vertices[i++]; - if (v < minX) - minX = v; - else if (v > maxX) - maxX = v; - v = vertices[i++]; - if (v < minY) - minY = v; - else if (v > maxY) - maxY = v; - v = vertices[i++]; - if (v < minZ) - minZ = v; - else if (v > maxZ) - maxZ = v; - } - - this.fromExtremes(minX, minY, minZ, maxX, maxY, maxZ); - }; - - /** - * Updates the bounds to fit a Geometry object. - * - * @param geometry The Geometry object to be bounded. - */ - BoundingVolumeBase.prototype.fromGeometry = function (geometry) { - var i, j, p; - var subGeoms = geometry.subGeometries; - var subGeom; - var boundingPositions; - var numSubGeoms = subGeoms.length; - var minX, minY, minZ; - var maxX, maxY, maxZ; - - if (numSubGeoms > 0) { - i = 0; - subGeom = subGeoms[0]; - boundingPositions = subGeom.getBoundingPositions(); - minX = maxX = boundingPositions[i]; - minY = maxY = boundingPositions[i + 1]; - minZ = maxZ = boundingPositions[i + 2]; - - j = numSubGeoms; - while (j--) { - subGeom = subGeoms[j]; - boundingPositions = subGeom.getBoundingPositions(); - i = boundingPositions.length; - while (i--) { - p = boundingPositions[i]; - if (p < minX) - minX = p; - else if (p > maxX) - maxX = p; - - p = boundingPositions[i + 1]; - - if (p < minY) - minY = p; - else if (p > maxY) - maxY = p; - - p = boundingPositions[i + 2]; - - if (p < minZ) - minZ = p; - else if (p > maxZ) - maxZ = p; - } - } - - this.fromExtremes(minX, minY, minZ, maxX, maxY, maxZ); - } else { - this.fromExtremes(0, 0, 0, 0, 0, 0); - } - }; - - BoundingVolumeBase.prototype.fromSphere = function (center, radius) { - this.fromExtremes(center.x - radius, center.y - radius, center.z - radius, center.x + radius, center.y + radius, center.z + radius); - }; - - BoundingVolumeBase.prototype.fromExtremes = function (minX, minY, minZ, maxX, maxY, maxZ) { - this._aabb.x = minX; - this._aabb.y = maxY; - this._aabb.z = minZ; - this._aabb.width = maxX - minX; - this._aabb.height = maxY - minY; - this._aabb.depth = maxZ - minZ; - this._pAabbPointsDirty = true; - - if (this._pBoundingEntity) - this.pUpdateBoundingEntity(); - }; - - BoundingVolumeBase.prototype.isInFrustum = function (planes, numPlanes) { - throw new away.errors.AbstractMethodError(); - }; - - BoundingVolumeBase.prototype.overlaps = function (bounds) { - return this._aabb.intersects(bounds.aabb); - }; - - BoundingVolumeBase.prototype.clone = function () { - throw new away.errors.AbstractMethodError(); - }; - - BoundingVolumeBase.prototype.rayIntersection = function (position, direction, targetNormal) { - return -1; - }; - - BoundingVolumeBase.prototype.containsPoint = function (position) { - return false; - }; - - BoundingVolumeBase.prototype.pUpdateAABBPoints = function () { - var minX = this._aabb.x; - var minY = this._aabb.y - this._aabb.height; - var minZ = this._aabb.z; - var maxX = this._aabb.x + this._aabb.width; - var maxY = this._aabb.y; - var maxZ = this._aabb.z + this._aabb.depth; - - this._pAabbPoints[0] = minX; - this._pAabbPoints[1] = minY; - this._pAabbPoints[2] = minZ; - this._pAabbPoints[3] = maxX; - this._pAabbPoints[4] = minY; - this._pAabbPoints[5] = minZ; - this._pAabbPoints[6] = minX; - this._pAabbPoints[7] = maxY; - this._pAabbPoints[8] = minZ; - this._pAabbPoints[9] = maxX; - this._pAabbPoints[10] = maxY; - this._pAabbPoints[11] = minZ; - this._pAabbPoints[12] = minX; - this._pAabbPoints[13] = minY; - this._pAabbPoints[14] = maxZ; - this._pAabbPoints[15] = maxX; - this._pAabbPoints[16] = minY; - this._pAabbPoints[17] = maxZ; - this._pAabbPoints[18] = minX; - this._pAabbPoints[19] = maxY; - this._pAabbPoints[20] = maxZ; - this._pAabbPoints[21] = maxX; - this._pAabbPoints[22] = maxY; - this._pAabbPoints[23] = maxZ; - this._pAabbPointsDirty = false; - }; - - BoundingVolumeBase.prototype.pUpdateBoundingEntity = function () { - throw new away.errors.AbstractMethodError(); - }; - - BoundingVolumeBase.prototype.pCreateBoundingEntity = function () { - throw new away.errors.AbstractMethodError(); - }; - - BoundingVolumeBase.prototype.classifyToPlane = function (plane) { - throw new away.errors.AbstractMethodError(); - }; - - BoundingVolumeBase.prototype.transformFrom = function (bounds, matrix) { - throw new away.errors.AbstractMethodError(); - }; - return BoundingVolumeBase; - })(); - _bounds.BoundingVolumeBase = BoundingVolumeBase; - })(away.bounds || (away.bounds = {})); - var bounds = away.bounds; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (_bounds) { - var PlaneClassification = away.geom.PlaneClassification; - - var NullBounds = (function (_super) { - __extends(NullBounds, _super); - function NullBounds(alwaysIn) { - if (typeof alwaysIn === "undefined") { alwaysIn = true; } - _super.call(this); - - this._alwaysIn = alwaysIn; - - this._aabb.width = this._aabb.height = this._aabb.depth = Number.POSITIVE_INFINITY; - this._aabb.x = this._aabb.y = this._aabb.z = this._alwaysIn ? Number.NEGATIVE_INFINITY / 2 : Number.POSITIVE_INFINITY; - } - //@override - NullBounds.prototype.clone = function () { - return new NullBounds(this._alwaysIn); - }; - - //@override - NullBounds.prototype.pCreateBoundingEntity = function () { - //return this._renderable || new away.primitives.WireframeSphere( 100, 16, 12, 0xffffff, 0.5 ); - return null; - }; - - //@override - NullBounds.prototype.isInFrustum = function (planes, numPlanes) { - return this._alwaysIn; - }; - - // //@override - // public fromGeometry(geometry:away.base.Geometry) - // { - // } - //@override - NullBounds.prototype.fromSphere = function (center, radius) { - }; - - //@override - NullBounds.prototype.fromExtremes = function (minX, minY, minZ, maxX, maxY, maxZ) { - }; - - NullBounds.prototype.classifyToPlane = function (plane) { - return PlaneClassification.INTERSECT; - }; - - //@override - NullBounds.prototype.transformFrom = function (bounds, matrix) { - this._alwaysIn = bounds._alwaysIn; - }; - return NullBounds; - })(_bounds.BoundingVolumeBase); - _bounds.NullBounds = NullBounds; - })(away.bounds || (away.bounds = {})); - var bounds = away.bounds; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (_bounds) { - var PlaneClassification = away.geom.PlaneClassification; - - var Vector3D = away.geom.Vector3D; - - var BoundingSphere = (function (_super) { - __extends(BoundingSphere, _super); - function BoundingSphere() { - _super.call(this); - this._radius = 0; - this._centerX = 0; - this._centerY = 0; - this._centerZ = 0; - } - Object.defineProperty(BoundingSphere.prototype, "radius", { - get: function () { - return this._radius; - }, - enumerable: true, - configurable: true - }); - - BoundingSphere.prototype.nullify = function () { - _super.prototype.nullify.call(this); - this._centerX = this._centerY = this._centerZ = 0; - this._radius = 0; - }; - - BoundingSphere.prototype.isInFrustum = function (planes, numPlanes) { - for (var i = 0; i < numPlanes; ++i) { - var plane = planes[i]; - var flippedExtentX = plane.a < 0 ? -this._radius : this._radius; - var flippedExtentY = plane.b < 0 ? -this._radius : this._radius; - var flippedExtentZ = plane.c < 0 ? -this._radius : this._radius; - var projDist = plane.a * (this._centerX + flippedExtentX) + plane.b * (this._centerY + flippedExtentY) + plane.c * (this._centerZ + flippedExtentZ) - plane.d; - if (projDist < 0) { - return false; - } - } - return true; - }; - - BoundingSphere.prototype.fromSphere = function (center, radius) { - this._centerX = center.x; - this._centerY = center.y; - this._centerZ = center.z; - this._radius = radius; - this._aabb.width = this._aabb.height = this._aabb.depth = radius * 2; - this._aabb.x = this._centerX - radius; - this._aabb.y = this._centerY + radius; - this._aabb.z = this._centerZ - radius; - this._pAabbPointsDirty = true; - - if (this._pBoundingEntity) - this.pUpdateBoundingEntity(); - }; - - BoundingSphere.prototype.fromExtremes = function (minX, minY, minZ, maxX, maxY, maxZ) { - this._centerX = (maxX + minX) * .5; - this._centerY = (maxY + minY) * .5; - this._centerZ = (maxZ + minZ) * .5; - - var d = maxX - minX; - var y = maxY - minY; - var z = maxZ - minZ; - - if (y > d) - d = y; - - if (z > d) - d = z; - - this._radius = d * Math.sqrt(.5); - _super.prototype.fromExtremes.call(this, minX, minY, minZ, maxX, maxY, maxZ); - }; - - BoundingSphere.prototype.clone = function () { - var clone = new BoundingSphere(); - clone.fromSphere(new Vector3D(this._centerX, this._centerY, this._centerZ), this._radius); - return clone; - }; - - BoundingSphere.prototype.rayIntersection = function (position, direction, targetNormal) { - if (this.containsPoint(position)) { - return 0; - } - - var px = position.x - this._centerX, py = position.y - this._centerY, pz = position.z - this._centerZ; - var vx = direction.x, vy = direction.y, vz = direction.z; - var rayEntryDistance; - - var a = vx * vx + vy * vy + vz * vz; - var b = 2 * (px * vx + py * vy + pz * vz); - var c = px * px + py * py + pz * pz - this._radius * this._radius; - var det = b * b - 4 * a * c; - - if (det >= 0) { - var sqrtDet = Math.sqrt(det); - rayEntryDistance = (-b - sqrtDet) / (2 * a); - if (rayEntryDistance >= 0) { - targetNormal.x = px + rayEntryDistance * vx; - targetNormal.y = py + rayEntryDistance * vy; - targetNormal.z = pz + rayEntryDistance * vz; - targetNormal.normalize(); - - return rayEntryDistance; - } - } - - // ray misses sphere - return -1; - }; - - BoundingSphere.prototype.containsPoint = function (position) { - var px = position.x - this._centerX; - var py = position.y - this._centerY; - var pz = position.z - this._centerZ; - var distance = Math.sqrt(px * px + py * py + pz * pz); - return distance <= this._radius; - }; - - BoundingSphere.prototype.pUpdateBoundingEntity = function () { - var sc = this._radius; - if (sc == 0) - sc = 0.001; - - var transform = this._pBoundingEntity.transform; - transform.scale = new Vector3D(sc, sc, sc); - transform.position = new Vector3D(this._centerX, this._centerY, this._centerZ); - }; - - // TODO pCreateBoundingRenderable():WireframePrimitiveBase - BoundingSphere.prototype.pCreateBoundingEntity = function () { - return null; - }; - - //@override - BoundingSphere.prototype.classifyToPlane = function (plane) { - var a = plane.a; - var b = plane.b; - var c = plane.c; - var dd = a * this._centerX + b * this._centerY + c * this._centerZ - plane.d; - - if (a < 0) - a = -a; - - if (b < 0) - b = -b; - - if (c < 0) - c = -c; - - var rr = (a + b + c) * this._radius; - - return dd > rr ? PlaneClassification.FRONT : dd < -rr ? PlaneClassification.BACK : PlaneClassification.INTERSECT; - }; - - BoundingSphere.prototype.transformFrom = function (bounds, matrix) { - var sphere = bounds; - var cx = sphere._centerX; - var cy = sphere._centerY; - var cz = sphere._centerZ; - var raw = new Array(16); - - matrix.copyRawDataTo(raw); - - var m11 = raw[0], m12 = raw[4], m13 = raw[8], m14 = raw[12]; - var m21 = raw[1], m22 = raw[5], m23 = raw[9], m24 = raw[13]; - var m31 = raw[2], m32 = raw[6], m33 = raw[10], m34 = raw[14]; - - this._centerX = cx * m11 + cy * m12 + cz * m13 + m14; - this._centerY = cx * m21 + cy * m22 + cz * m23 + m24; - this._centerZ = cx * m31 + cy * m32 + cz * m33 + m34; - - if (m11 < 0) - m11 = -m11; - if (m12 < 0) - m12 = -m12; - if (m13 < 0) - m13 = -m13; - if (m21 < 0) - m21 = -m21; - if (m22 < 0) - m22 = -m22; - if (m23 < 0) - m23 = -m23; - if (m31 < 0) - m31 = -m31; - if (m32 < 0) - m32 = -m32; - if (m33 < 0) - m33 = -m33; - - var r = sphere._radius; - var rx = m11 + m12 + m13; - var ry = m21 + m22 + m23; - var rz = m31 + m32 + m33; - this._radius = r * Math.sqrt(rx * rx + ry * ry + rz * rz); - - this._aabb.width = this._aabb.height = this._aabb.depth = this._radius * 2; - this._aabb.x = this._centerX - this._radius; - this._aabb.y = this._centerY + this._radius; - this._aabb.z = this._centerZ - this._radius; - }; - return BoundingSphere; - })(_bounds.BoundingVolumeBase); - _bounds.BoundingSphere = BoundingSphere; - })(away.bounds || (away.bounds = {})); - var bounds = away.bounds; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (_bounds) { - var Matrix3DUtils = away.geom.Matrix3DUtils; - var PlaneClassification = away.geom.PlaneClassification; - - var Vector3D = away.geom.Vector3D; - - /** - * AxisAlignedBoundingBox represents a bounding box volume that has its planes aligned to the local coordinate axes of the bounded object. - * This is useful for most meshes. - */ - var AxisAlignedBoundingBox = (function (_super) { - __extends(AxisAlignedBoundingBox, _super); - /** - * Creates a new AxisAlignedBoundingBox object. - */ - function AxisAlignedBoundingBox() { - _super.call(this); - this._centerX = 0; - this._centerY = 0; - this._centerZ = 0; - this._halfExtentsX = 0; - this._halfExtentsY = 0; - this._halfExtentsZ = 0; - } - /** - * @inheritDoc - */ - AxisAlignedBoundingBox.prototype.nullify = function () { - _super.prototype.nullify.call(this); - - this._centerX = this._centerY = this._centerZ = 0; - this._halfExtentsX = this._halfExtentsY = this._halfExtentsZ = 0; - }; - - /** - * @inheritDoc - */ - AxisAlignedBoundingBox.prototype.isInFrustum = function (planes, numPlanes) { - for (var i = 0; i < numPlanes; ++i) { - var plane = planes[i]; - var a = plane.a; - var b = plane.b; - var c = plane.c; - var flippedExtentX = a < 0 ? -this._halfExtentsX : this._halfExtentsX; - var flippedExtentY = b < 0 ? -this._halfExtentsY : this._halfExtentsY; - var flippedExtentZ = c < 0 ? -this._halfExtentsZ : this._halfExtentsZ; - var projDist = a * (this._centerX + flippedExtentX) + b * (this._centerY + flippedExtentY) + c * (this._centerZ + flippedExtentZ) - plane.d; - - if (projDist < 0) - return false; - } - - return true; - }; - - AxisAlignedBoundingBox.prototype.rayIntersection = function (position, direction, targetNormal) { - if (this.containsPoint(position)) - return 0; - - var px = position.x - this._centerX; - var py = position.y - this._centerY; - var pz = position.z - this._centerZ; - - var vx = direction.x; - var vy = direction.y; - var vz = direction.z; - - var ix; - var iy; - var iz; - var rayEntryDistance; - - // ray-plane tests - var intersects; - if (vx < 0) { - rayEntryDistance = (this._halfExtentsX - px) / vx; - if (rayEntryDistance > 0) { - iy = py + rayEntryDistance * vy; - iz = pz + rayEntryDistance * vz; - if (iy > -this._halfExtentsY && iy < this._halfExtentsY && iz > -this._halfExtentsZ && iz < this._halfExtentsZ) { - targetNormal.x = 1; - targetNormal.y = 0; - targetNormal.z = 0; - - intersects = true; - } - } - } - if (!intersects && vx > 0) { - rayEntryDistance = (-this._halfExtentsX - px) / vx; - if (rayEntryDistance > 0) { - iy = py + rayEntryDistance * vy; - iz = pz + rayEntryDistance * vz; - if (iy > -this._halfExtentsY && iy < this._halfExtentsY && iz > -this._halfExtentsZ && iz < this._halfExtentsZ) { - targetNormal.x = -1; - targetNormal.y = 0; - targetNormal.z = 0; - intersects = true; - } - } - } - if (!intersects && vy < 0) { - rayEntryDistance = (this._halfExtentsY - py) / vy; - if (rayEntryDistance > 0) { - ix = px + rayEntryDistance * vx; - iz = pz + rayEntryDistance * vz; - if (ix > -this._halfExtentsX && ix < this._halfExtentsX && iz > -this._halfExtentsZ && iz < this._halfExtentsZ) { - targetNormal.x = 0; - targetNormal.y = 1; - targetNormal.z = 0; - intersects = true; - } - } - } - if (!intersects && vy > 0) { - rayEntryDistance = (-this._halfExtentsY - py) / vy; - if (rayEntryDistance > 0) { - ix = px + rayEntryDistance * vx; - iz = pz + rayEntryDistance * vz; - if (ix > -this._halfExtentsX && ix < this._halfExtentsX && iz > -this._halfExtentsZ && iz < this._halfExtentsZ) { - targetNormal.x = 0; - targetNormal.y = -1; - targetNormal.z = 0; - intersects = true; - } - } - } - if (!intersects && vz < 0) { - rayEntryDistance = (this._halfExtentsZ - pz) / vz; - if (rayEntryDistance > 0) { - ix = px + rayEntryDistance * vx; - iy = py + rayEntryDistance * vy; - if (iy > -this._halfExtentsY && iy < this._halfExtentsY && ix > -this._halfExtentsX && ix < this._halfExtentsX) { - targetNormal.x = 0; - targetNormal.y = 0; - targetNormal.z = 1; - intersects = true; - } - } - } - if (!intersects && vz > 0) { - rayEntryDistance = (-this._halfExtentsZ - pz) / vz; - if (rayEntryDistance > 0) { - ix = px + rayEntryDistance * vx; - iy = py + rayEntryDistance * vy; - if (iy > -this._halfExtentsY && iy < this._halfExtentsY && ix > -this._halfExtentsX && ix < this._halfExtentsX) { - targetNormal.x = 0; - targetNormal.y = 0; - targetNormal.z = -1; - intersects = true; - } - } - } - - return intersects ? rayEntryDistance : -1; - }; - - /** - * @inheritDoc - */ - AxisAlignedBoundingBox.prototype.containsPoint = function (position) { - var px = position.x - this._centerX, py = position.y - this._centerY, pz = position.z - this._centerZ; - return px <= this._halfExtentsX && px >= -this._halfExtentsX && py <= this._halfExtentsY && py >= -this._halfExtentsY && pz <= this._halfExtentsZ && pz >= -this._halfExtentsZ; - }; - - /** - * @inheritDoc - */ - AxisAlignedBoundingBox.prototype.fromExtremes = function (minX, minY, minZ, maxX, maxY, maxZ) { - this._centerX = (maxX + minX) * .5; - this._centerY = (maxY + minY) * .5; - this._centerZ = (maxZ + minZ) * .5; - this._halfExtentsX = (maxX - minX) * .5; - this._halfExtentsY = (maxY - minY) * .5; - this._halfExtentsZ = (maxZ - minZ) * .5; - - _super.prototype.fromExtremes.call(this, minX, minY, minZ, maxX, maxY, maxZ); - }; - - /** - * @inheritDoc - */ - AxisAlignedBoundingBox.prototype.clone = function () { - var clone = new AxisAlignedBoundingBox(); - clone.fromExtremes(this._aabb.x, this._aabb.y + this._aabb.height, this._aabb.z, this._aabb.x + this._aabb.width, this._aabb.y, this._aabb.z + this._aabb.depth); - return clone; - }; - - Object.defineProperty(AxisAlignedBoundingBox.prototype, "halfExtentsX", { - get: function () { - return this._halfExtentsX; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(AxisAlignedBoundingBox.prototype, "halfExtentsY", { - get: function () { - return this._halfExtentsY; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(AxisAlignedBoundingBox.prototype, "halfExtentsZ", { - get: function () { - return this._halfExtentsZ; - }, - enumerable: true, - configurable: true - }); - - /** - * Finds the closest point on the bounding volume to another given point. This can be used for maximum error calculations for content within a given bound. - * @param point The point for which to find the closest point on the bounding volume - * @param target An optional Vector3D to store the result to prevent creating a new object. - * @return - */ - AxisAlignedBoundingBox.prototype.closestPointToPoint = function (point, target) { - if (typeof target === "undefined") { target = null; } - var p; - - if (target == null) - target = new Vector3D(); - - p = point.x; - if (p < this._aabb.x) - p = this._aabb.x; - if (p > this._aabb.x + this._aabb.width) - p = this._aabb.x + this._aabb.width; - target.x = p; - - p = point.y; - if (p < this._aabb.y + this._aabb.height) - p = this._aabb.y + this._aabb.height; - if (p > this._aabb.y) - p = this._aabb.y; - target.y = p; - - p = point.z; - if (p < this._aabb.z) - p = this._aabb.z; - if (p > this._aabb.z + this._aabb.depth) - p = this._aabb.z + this._aabb.depth; - target.z = p; - - return target; - }; - - AxisAlignedBoundingBox.prototype.pUpdateBoundingRenderable = function () { - this._pBoundingEntity.transform.scale.x = Math.max(this._halfExtentsX * 2, 0.001); - this._pBoundingEntity.transform.scale.y = Math.max(this._halfExtentsY * 2, 0.001); - this._pBoundingEntity.transform.scale.z = Math.max(this._halfExtentsZ * 2, 0.001); - this._pBoundingEntity.transform.position.x = this._centerX; - this._pBoundingEntity.transform.position.y = this._centerY; - this._pBoundingEntity.transform.position.z = this._centerZ; - }; - - AxisAlignedBoundingBox.prototype.pCreateBoundingEntity = function () { - return null; - }; - - AxisAlignedBoundingBox.prototype.classifyToPlane = function (plane) { - var a = plane.a; - var b = plane.b; - var c = plane.c; - var centerDistance = a * this._centerX + b * this._centerY + c * this._centerZ - plane.d; - - if (a < 0) - a = -a; - - if (b < 0) - b = -b; - - if (c < 0) - c = -c; - - var boundOffset = a * this._halfExtentsX + b * this._halfExtentsY + c * this._halfExtentsZ; - - return centerDistance > boundOffset ? PlaneClassification.FRONT : centerDistance < -boundOffset ? PlaneClassification.BACK : PlaneClassification.INTERSECT; - }; - - AxisAlignedBoundingBox.prototype.transformFrom = function (bounds, matrix) { - var aabb = bounds; - var cx = aabb._centerX; - var cy = aabb._centerY; - var cz = aabb._centerZ; - var raw = Matrix3DUtils.RAW_DATA_CONTAINER; - - matrix.copyRawDataTo(raw); - - var m11 = raw[0], m12 = raw[4], m13 = raw[8], m14 = raw[12]; - var m21 = raw[1], m22 = raw[5], m23 = raw[9], m24 = raw[13]; - var m31 = raw[2], m32 = raw[6], m33 = raw[10], m34 = raw[14]; - - this._centerX = cx * m11 + cy * m12 + cz * m13 + m14; - this._centerY = cx * m21 + cy * m22 + cz * m23 + m24; - this._centerZ = cx * m31 + cy * m32 + cz * m33 + m34; - - if (m11 < 0) - m11 = -m11; - if (m12 < 0) - m12 = -m12; - if (m13 < 0) - m13 = -m13; - if (m21 < 0) - m21 = -m21; - if (m22 < 0) - m22 = -m22; - if (m23 < 0) - m23 = -m23; - if (m31 < 0) - m31 = -m31; - if (m32 < 0) - m32 = -m32; - if (m33 < 0) - m33 = -m33; - var hx = aabb._halfExtentsX; - var hy = aabb._halfExtentsY; - var hz = aabb._halfExtentsZ; - this._halfExtentsX = hx * m11 + hy * m12 + hz * m13; - this._halfExtentsY = hx * m21 + hy * m22 + hz * m23; - this._halfExtentsZ = hx * m31 + hy * m32 + hz * m33; - - this._aabb.width = this._aabb.height = this._aabb.depth = this._halfExtentsX * 2; - this._aabb.x = this._centerX - this._halfExtentsX; - this._aabb.y = this._centerY + this._halfExtentsY; - this._aabb.z = this._centerZ - this._halfExtentsZ; - }; - return AxisAlignedBoundingBox; - })(_bounds.BoundingVolumeBase); - _bounds.AxisAlignedBoundingBox = AxisAlignedBoundingBox; - })(away.bounds || (away.bounds = {})); - var bounds = away.bounds; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (net) { - /** - * - */ - var URLRequest = (function () { - /** - - * @param url - */ - function URLRequest(url) { - if (typeof url === "undefined") { url = null; } - /** - * - * away.net.URLRequestMethod.GET - * away.net.URLRequestMethod.POST - * - * @type {string} - */ - this.method = net.URLRequestMethod.GET; - /** - * Use asynchronous XMLHttpRequest - * @type {boolean} - */ - this.async = true; - this._url = url; - } - Object.defineProperty(URLRequest.prototype, "url", { - /** - * - * @returns {string} - */ - get: function () { - return this._url; - }, - /** - * - * @param value - */ - set: function (value) { - this._url = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * dispose - */ - URLRequest.prototype.dispose = function () { - this.data = null; - this._url = null; - }; - return URLRequest; - })(); - net.URLRequest = URLRequest; - })(away.net || (away.net = {})); - var net = away.net; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (net) { - var URLLoaderDataFormat = (function () { - function URLLoaderDataFormat() { - } - URLLoaderDataFormat.TEXT = 'text'; - - URLLoaderDataFormat.VARIABLES = 'variables'; - - URLLoaderDataFormat.BLOB = 'blob'; - - URLLoaderDataFormat.ARRAY_BUFFER = 'arraybuffer'; - - URLLoaderDataFormat.BINARY = 'binary'; - return URLLoaderDataFormat; - })(); - net.URLLoaderDataFormat = URLLoaderDataFormat; - })(away.net || (away.net = {})); - var net = away.net; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (net) { - var URLRequestMethod = (function () { - function URLRequestMethod() { - } - URLRequestMethod.POST = 'POST'; - - URLRequestMethod.GET = 'GET'; - return URLRequestMethod; - })(); - net.URLRequestMethod = URLRequestMethod; - })(away.net || (away.net = {})); - var net = away.net; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (net) { - /** - * The URLLoader is used to load a single file, as part of a resource. - * - * While URLLoader can be used directly, e.g. to create a third-party asset - * management system, it's recommended to use any of the classes Loader3D, AssetLoader - * and AssetLibrary instead in most cases. - * - * @see AssetLoader - * @see away.library.AssetLibrary - */ - var URLLoader = (function (_super) { - __extends(URLLoader, _super); - /** - * Creates a new URLLoader object. - */ - function URLLoader() { - _super.call(this); - this._bytesLoaded = 0; - this._bytesTotal = 0; - this._dataFormat = net.URLLoaderDataFormat.TEXT; - this._loadError = false; - } - Object.defineProperty(URLLoader.prototype, "url", { - /** - * - */ - get: function () { - return this._request ? this._request.url : ''; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(URLLoader.prototype, "data", { - /** - * - */ - get: function () { - return this._data; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(URLLoader.prototype, "dataFormat", { - get: function () { - return this._dataFormat; - }, - /** - * - * URLLoaderDataFormat.BINARY - * URLLoaderDataFormat.TEXT - * URLLoaderDataFormat.VARIABLES - * - * @param format - */ - set: function (format) { - this._dataFormat = format; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(URLLoader.prototype, "bytesLoaded", { - /** - * - * @returns {number} - */ - get: function () { - return this._bytesLoaded; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(URLLoader.prototype, "bytesTotal", { - /** - * - * @returns {number} - */ - get: function () { - return this._bytesTotal; - }, - enumerable: true, - configurable: true - }); - - /** - * Load a resource from a file. - * - * @param request The URLRequest object containing the URL of the object to be loaded. - */ - URLLoader.prototype.load = function (request) { - this._request = request; - - this.initXHR(); - - if (request.method === net.URLRequestMethod.POST) - this.postRequest(request); - else - this.getRequest(request); - }; - - /** - * - */ - URLLoader.prototype.close = function () { - this._XHR.abort(); - this.disposeXHR(); - }; - - /** - * - */ - URLLoader.prototype.dispose = function () { - if (this._XHR) - this._XHR.abort(); - - this.disposeXHR(); - - this._data = null; - this._dataFormat = null; - this._bytesLoaded = null; - this._bytesTotal = null; - }; - - /** - * - * @param xhr - * @param responseType - */ - URLLoader.prototype.setResponseType = function (xhr, responseType) { - switch (responseType) { - case net.URLLoaderDataFormat.ARRAY_BUFFER: - case net.URLLoaderDataFormat.BLOB: - case net.URLLoaderDataFormat.TEXT: - xhr.responseType = responseType; - break; - - case net.URLLoaderDataFormat.VARIABLES: - xhr.responseType = net.URLLoaderDataFormat.TEXT; - break; - - case net.URLLoaderDataFormat.BINARY: - xhr.responseType = ''; - break; - - default: - } - }; - - /** - * - * @param request {URLRequest} - */ - URLLoader.prototype.getRequest = function (request) { - try { - this._XHR.open(request.method, request.url, request.async); - this.setResponseType(this._XHR, this._dataFormat); - this._XHR.send(); // No data to send - } catch (e) { - this.handleXmlHttpRequestException(e); - } - }; - - /** - * - * @param request {URLRequest} - */ - URLLoader.prototype.postRequest = function (request) { - this._loadError = false; - - this._XHR.open(request.method, request.url, request.async); - - if (request.data != null) { - if (request.data instanceof net.URLVariables) { - var urlVars = request.data; - - try { - this._XHR.responseType = 'text'; - this._XHR.send(urlVars.formData); - } catch (e) { - this.handleXmlHttpRequestException(e); - } - } else { - this.setResponseType(this._XHR, this._dataFormat); - - if (request.data) - this._XHR.send(request.data); // TODO: Test - else - this._XHR.send(); // no data to send - } - } else { - this._XHR.send(); // No data to send - } - }; - - /** - * - * @param error {XMLHttpRequestException} - */ - URLLoader.prototype.handleXmlHttpRequestException = function (error /* */ ) { - switch (error.code) { - case 101: - break; - } - }; - - /** - * - */ - URLLoader.prototype.initXHR = function () { - var _this = this; - if (!this._XHR) { - this._XHR = new XMLHttpRequest(); - - this._XHR.onloadstart = function (event) { - return _this.onLoadStart(event); - }; // loadstart - When the request starts. - this._XHR.onprogress = function (event) { - return _this.onProgress(event); - }; // progress - While loading and sending data. - this._XHR.onabort = function (event) { - return _this.onAbort(event); - }; // abort - When the request has been aborted, either by invoking the abort() method or navigating away from the page. - this._XHR.onerror = function (event) { - return _this.onLoadError(event); - }; // error - When the request has failed. - this._XHR.onload = function (event) { - return _this.onLoadComplete(event); - }; // load - When the request has successfully completed. - this._XHR.ontimeout = function (event) { - return _this.onTimeOut(event); - }; // timeout - When the author specified timeout has passed before the request could complete. - this._XHR.onloadend = function (event) { - return _this.onLoadEnd(event); - }; // loadend - When the request has completed, regardless of whether or not it was successful. - this._XHR.onreadystatechange = function (event) { - return _this.onReadyStateChange(event); - }; // onreadystatechange - When XHR state changes - } - }; - - /** - * - */ - URLLoader.prototype.disposeXHR = function () { - if (this._XHR !== null) { - this._XHR.onloadstart = null; - this._XHR.onprogress = null; - this._XHR.onabort = null; - this._XHR.onerror = null; - this._XHR.onload = null; - this._XHR.ontimeout = null; - this._XHR.onloadend = null; - this._XHR = null; - } - }; - - /** - * - * @param source - */ - URLLoader.prototype.decodeURLVariables = function (source) { - var result = new Object(); - - source = source.split("+").join(" "); - - var tokens, re = /[?&]?([^=]+)=([^&]*)/g; - - while (tokens = re.exec(source)) - result[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]); - - return result; - }; - - // XMLHttpRequest - Event Handlers - /** - * When XHR state changes - * @param event - */ - URLLoader.prototype.onReadyStateChange = function (event) { - if (this._XHR.readyState == 4) { - if (this._XHR.status == 404) { - this._loadError = true; - - if (!this._loadErrorEvent) - this._loadErrorEvent = new away.events.IOErrorEvent(away.events.IOErrorEvent.IO_ERROR); - - this.dispatchEvent(this._loadErrorEvent); - } - - this.dispatchEvent(new away.events.HTTPStatusEvent(away.events.HTTPStatusEvent.HTTP_STATUS, this._XHR.status)); - } - }; - - /** - * When the request has completed, regardless of whether or not it was successful. - * @param event - */ - URLLoader.prototype.onLoadEnd = function (event) { - if (this._loadError === true) - return; - }; - - /** - * When the author specified timeout has passed before the request could complete. - * @param event - */ - URLLoader.prototype.onTimeOut = function (event) { - //TODO: Timeout not currently implemented ( also not part of AS3 API ) - }; - - /** - * When the request has been aborted, either by invoking the abort() method or navigating away from the page. - * @param event - */ - URLLoader.prototype.onAbort = function (event) { - // TODO: investigate whether this needs to be an IOError - }; - - /** - * While loading and sending data. - * @param event - */ - URLLoader.prototype.onProgress = function (event) { - if (!this._progressEvent) - this._progressEvent = new away.events.ProgressEvent(away.events.ProgressEvent.PROGRESS); - - this._progressEvent.bytesTotal = event.total; - this._progressEvent.bytesLoaded = event.loaded; - - this.dispatchEvent(this._progressEvent); - }; - - /** - * When the request starts. - * @param event - */ - URLLoader.prototype.onLoadStart = function (event) { - if (!this._loadStartEvent) - this._loadStartEvent = new away.events.Event(away.events.Event.OPEN); - - this.dispatchEvent(this._loadStartEvent); - }; - - /** - * When the request has successfully completed. - * @param event - */ - URLLoader.prototype.onLoadComplete = function (event) { - if (this._loadError === true) - return; - - switch (this._dataFormat) { - case net.URLLoaderDataFormat.TEXT: - this._data = this._XHR.responseText; - break; - - case net.URLLoaderDataFormat.VARIABLES: - this._data = this.decodeURLVariables(this._XHR.responseText); - break; - - case net.URLLoaderDataFormat.BLOB: - case net.URLLoaderDataFormat.ARRAY_BUFFER: - case net.URLLoaderDataFormat.BINARY: - this._data = this._XHR.response; - break; - - default: - this._data = this._XHR.responseText; - break; - } - - if (!this._loadCompleteEvent) - this._loadCompleteEvent = new away.events.Event(away.events.Event.COMPLETE); - - this.dispatchEvent(this._loadCompleteEvent); - }; - - /** - * When the request has failed. ( due to network issues ). - * @param event - */ - URLLoader.prototype.onLoadError = function (event) { - this._loadError = true; - - if (!this._loadErrorEvent) - this._loadErrorEvent = new away.events.IOErrorEvent(away.events.IOErrorEvent.IO_ERROR); - - this.dispatchEvent(this._loadErrorEvent); - }; - return URLLoader; - })(away.events.EventDispatcher); - net.URLLoader = URLLoader; - })(away.net || (away.net = {})); - var net = away.net; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (net) { - var URLVariables = (function () { - /** - * - * @param source - */ - function URLVariables(source) { - if (typeof source === "undefined") { source = null; } - this._variables = new Object(); - if (source !== null) - this.decode(source); - } - /** - * - * @param source - */ - URLVariables.prototype.decode = function (source) { - source = source.split("+").join(" "); - - var tokens, re = /[?&]?([^=]+)=([^&]*)/g; - - while (tokens = re.exec(source)) - this._variables[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]); - }; - - /** - * - * @returns {string} - */ - URLVariables.prototype.toString = function () { - return ''; - }; - - Object.defineProperty(URLVariables.prototype, "variables", { - /** - * - * @returns {Object} - */ - get: function () { - return this._variables; - }, - /** - * - * @returns {Object} - */ - set: function (obj) { - this._variables = obj; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(URLVariables.prototype, "formData", { - /** - * - * @returns {Object} - */ - get: function () { - var fd = new FormData(); - - for (var s in this._variables) - fd.append(s, this._variables[s]); - - return fd; - }, - enumerable: true, - configurable: true - }); - - return URLVariables; - })(); - net.URLVariables = URLVariables; - })(away.net || (away.net = {})); - var net = away.net; -})(away || (away = {})); -/// -/// -var away; -(function (away) { - (function (library) { - var AbstractMethodError = away.errors.AbstractMethodError; - - var NamedAssetBase = (function (_super) { - __extends(NamedAssetBase, _super); - function NamedAssetBase(name) { - if (typeof name === "undefined") { name = null; } - _super.call(this); - - this._id = NamedAssetBase.ID_COUNT++; - - if (name == null) - name = 'null'; - - this._name = name; - this._originalName = name; - - this.updateFullPath(); - } - Object.defineProperty(NamedAssetBase.prototype, "assetType", { - /** - * - */ - get: function () { - throw new AbstractMethodError(); - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(NamedAssetBase.prototype, "originalName", { - /** - * The original name used for this asset in the resource (e.g. file) in which - * it was found. This may not be the same as name, which may - * have changed due to of a name conflict. - */ - get: function () { - return this._originalName; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(NamedAssetBase.prototype, "id", { - /** - * A unique id for the asset, used to identify assets in an associative array - */ - get: function () { - return this._id; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(NamedAssetBase.prototype, "name", { - get: function () { - return this._name; - }, - set: function (val) { - var prev; - - prev = this._name; - this._name = val; - - if (this._name == null) - this._name = 'null'; - - this.updateFullPath(); - - //if (hasEventListener(AssetEvent.ASSET_RENAME)) - this.dispatchEvent(new away.events.AssetEvent(away.events.AssetEvent.ASSET_RENAME, this, prev)); - }, - enumerable: true, - configurable: true - }); - - - NamedAssetBase.prototype.dispose = function () { - throw new AbstractMethodError(); - }; - - Object.defineProperty(NamedAssetBase.prototype, "assetNamespace", { - get: function () { - return this._namespace; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(NamedAssetBase.prototype, "assetFullPath", { - get: function () { - return this._full_path; - }, - enumerable: true, - configurable: true - }); - - NamedAssetBase.prototype.assetPathEquals = function (name, ns) { - return (this._name == name && (!ns || this._namespace == ns)); - }; - - NamedAssetBase.prototype.resetAssetPath = function (name, ns, overrideOriginal) { - if (typeof ns === "undefined") { ns = null; } - if (typeof overrideOriginal === "undefined") { overrideOriginal = true; } - this._name = name ? name : 'null'; - this._namespace = ns ? ns : NamedAssetBase.DEFAULT_NAMESPACE; - - if (overrideOriginal) - this._originalName = this._name; - - this.updateFullPath(); - }; - - NamedAssetBase.prototype.updateFullPath = function () { - this._full_path = [this._namespace, this._name]; - }; - NamedAssetBase.ID_COUNT = 0; - - NamedAssetBase.DEFAULT_NAMESPACE = 'default'; - return NamedAssetBase; - })(away.events.EventDispatcher); - library.NamedAssetBase = NamedAssetBase; - })(away.library || (away.library = {})); - var library = away.library; -})(away || (away = {})); -var away; -(function (away) { - (function (library) { - var AssetType = (function () { - function AssetType() { - } - AssetType.ANIMATION_NODE = 'animationNode'; - AssetType.ANIMATION_SET = 'animationSet'; - AssetType.ANIMATION_STATE = 'animationState'; - AssetType.ANIMATOR = 'animator'; - AssetType.BILLBOARD = 'billboard'; - AssetType.CAMERA = 'camera'; - AssetType.CONTAINER = 'container'; - AssetType.EFFECTS_METHOD = 'effectsMethod'; - AssetType.GEOMETRY = 'geometry'; - AssetType.LINE_SEGMENT = 'lineSegment'; - AssetType.LIGHT = 'light'; - AssetType.LIGHT_PICKER = 'lightPicker'; - AssetType.MATERIAL = 'material'; - AssetType.MESH = 'mesh'; - AssetType.TRIANGLE_SUB_MESH = 'triangleSubMesh'; - AssetType.LINE_SUB_MESH = 'lineSubMesh'; - AssetType.PRIMITIVE_PREFAB = 'primitivePrefab'; - AssetType.SHADOW_MAP_METHOD = 'shadowMapMethod'; - AssetType.SKELETON = 'skeleton'; - AssetType.SKELETON_POSE = 'skeletonPose'; - AssetType.SKYBOX = 'skybox'; - AssetType.STATE_TRANSITION = 'stateTransition'; - AssetType.TEXTURE = 'texture'; - AssetType.TEXTURE_PROJECTOR = 'textureProjector'; - return AssetType; - })(); - library.AssetType = AssetType; - })(away.library || (away.library = {})); - var library = away.library; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (display) { - var ContextMode = (function () { - function ContextMode() { - } - ContextMode.AUTO = "auto"; - ContextMode.WEBGL = "webgl"; - ContextMode.FLASH = "flash"; - ContextMode.NATIVE = "native"; - return ContextMode; - })(); - display.ContextMode = ContextMode; - })(away.display || (away.display = {})); - var display = away.display; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.base - */ - (function (display) { - - })(away.display || (away.display = {})); - var display = away.display; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * A class that provides constant values for visual blend mode effects. These - * constants are used in the following: - *
    - *
  • The blendMode property of the - * flash.display.DisplayObject class.
  • - *
  • The blendMode parameter of the draw() - * method of the flash.display.BitmapData class
  • - *
- */ - (function (base) { - var BlendMode = (function () { - function BlendMode() { - } - BlendMode.ADD = "add"; - - BlendMode.ALPHA = "alpha"; - - BlendMode.DARKEN = "darken"; - - BlendMode.DIFFERENCE = "difference"; - - BlendMode.ERASE = "erase"; - - BlendMode.HARDLIGHT = "hardlight"; - - BlendMode.INVERT = "invert"; - - BlendMode.LAYER = "layer"; - - BlendMode.LIGHTEN = "lighten"; - - BlendMode.MULTIPLY = "multiply"; - - BlendMode.NORMAL = "normal"; - - BlendMode.OVERLAY = "overlay"; - - BlendMode.SCREEN = "screen"; - - BlendMode.SHADER = "shader"; - - BlendMode.SUBTRACT = "subtract"; - return BlendMode; - })(); - base.BlendMode = BlendMode; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - */ - (function (base) { - var AlignmentMode = (function () { - function AlignmentMode() { - } - AlignmentMode.REGISTRATION_POINT = "registrationPoint"; - - AlignmentMode.PIVOT_POINT = "pivot"; - return AlignmentMode; - })(); - base.AlignmentMode = AlignmentMode; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - */ - (function (base) { - var OrientationMode = (function () { - function OrientationMode() { - } - OrientationMode.DEFAULT = "default"; - - OrientationMode.CAMERA_PLANE = "cameraPlane"; - - OrientationMode.CAMERA_POSITION = "cameraPosition"; - return OrientationMode; - })(); - base.OrientationMode = OrientationMode; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (base) { - var Rectangle = away.geom.Rectangle; - - var ColorUtils = away.utils.ColorUtils; - - /** - * - */ - var BitmapData = (function () { - /** - * - * @param width - * @param height - * @param transparent - * @param fillColor - */ - function BitmapData(width, height, transparent, fillColor) { - if (typeof transparent === "undefined") { transparent = true; } - if (typeof fillColor === "undefined") { fillColor = null; } - this._alpha = 1; - this._locked = false; - this._transparent = transparent; - this._imageCanvas = document.createElement("canvas"); - this._imageCanvas.width = width; - this._imageCanvas.height = height; - this._context = this._imageCanvas.getContext("2d"); - this._rect = new Rectangle(0, 0, width, height); - - if (fillColor != null) { - if (this._transparent) { - this._alpha = away.utils.ColorUtils.float32ColorToARGB(fillColor)[0] / 255; - } else { - this._alpha = 1; - } - - this.fillRect(this._rect, fillColor); - } - } - /** - * - */ - BitmapData.prototype.dispose = function () { - this._context = null; - this._imageCanvas = null; - this._imageData = null; - this._rect = null; - this._transparent = null; - this._locked = null; - }; - - /** - * - */ - BitmapData.prototype.lock = function () { - this._locked = true; - this._imageData = this._context.getImageData(0, 0, this._rect.width, this._rect.height); - }; - - /** - * - */ - BitmapData.prototype.unlock = function () { - this._locked = false; - - if (this._imageData) { - this._context.putImageData(this._imageData, 0, 0); // at coords 0,0 - this._imageData = null; - } - }; - - /** - * - * @param x - * @param y - * @param color - */ - BitmapData.prototype.getPixel = function (x, y) { - var r; - var g; - var b; - var a; - - if (!this._locked) { - var pixelData = this._context.getImageData(x, y, 1, 1); - - r = pixelData.data[0]; - g = pixelData.data[1]; - b = pixelData.data[2]; - a = pixelData.data[3]; - } else { - var index = (x + y * this._imageCanvas.width) * 4; - - if (!this._imageData) - this._imageData = this._context.getImageData(0, 0, this._rect.width, this._rect.height); - - r = this._imageData.data[index + 0]; - g = this._imageData.data[index + 1]; - b = this._imageData.data[index + 2]; - a = this._imageData.data[index + 3]; - } - - if (!this._locked) { - this._imageData = null; - } - - return (a << 24) | (r << 16) | (g << 8) | b; - }; - - /** - * - * @param x - * @param y - * @param color - */ - BitmapData.prototype.setPixel = function (x, y, color) { - var argb = away.utils.ColorUtils.float32ColorToARGB(color); - - if (!this._locked) { - this._imageData = this._context.getImageData(0, 0, this._rect.width, this._rect.height); - } - - if (this._imageData) { - var index = (x + y * this._imageCanvas.width) * 4; - - this._imageData.data[index + 0] = argb[1]; - this._imageData.data[index + 1] = argb[2]; - this._imageData.data[index + 2] = argb[3]; - this._imageData.data[index + 3] = 255; - } - - if (!this._locked) { - this._context.putImageData(this._imageData, 0, 0); - this._imageData = null; - } - }; - - /** - * - * @param rect - * @param inputByteArray - */ - BitmapData.prototype.setPixels = function (rect, inputByteArray) { - if (!this._locked) { - this._imageData = this._context.getImageData(0, 0, this._rect.width, this._rect.height); - } - - if (this._imageData) { - inputByteArray.position = 0; - var i, j, index; - for (i = 0; i < rect.width; ++i) { - for (j = 0; j < rect.height; ++j) { - index = (i + rect.x + (j + rect.y) * this._imageCanvas.width) * 4; - - this._imageData.data[index + 0] = inputByteArray.readUnsignedInt(); - this._imageData.data[index + 1] = inputByteArray.readUnsignedInt(); - this._imageData.data[index + 2] = inputByteArray.readUnsignedInt(); - this._imageData.data[index + 3] = inputByteArray.readUnsignedInt(); - } - } - } - - if (!this._locked) { - this._context.putImageData(this._imageData, 0, 0); - this._imageData = null; - } - }; - - /** - * - * @param x - * @param y - * @param color - */ - BitmapData.prototype.setPixel32 = function (x, y, color) { - var argb = away.utils.ColorUtils.float32ColorToARGB(color); - - if (!this._locked) { - this._imageData = this._context.getImageData(0, 0, this._rect.width, this._rect.height); - } - - if (this._imageData) { - var index = (x + y * this._imageCanvas.width) * 4; - - this._imageData.data[index + 0] = argb[1]; - this._imageData.data[index + 1] = argb[2]; - this._imageData.data[index + 2] = argb[3]; - this._imageData.data[index + 3] = argb[0]; - } - - if (!this._locked) { - this._context.putImageData(this._imageData, 0, 0); - this._imageData = null; - } - }; - - BitmapData.prototype.setVector = function (rect, inputVector) { - if (!this._locked) { - this._imageData = this._context.getImageData(0, 0, this._rect.width, this._rect.height); - } - - if (this._imageData) { - var i, j, index, argb; - for (i = 0; i < rect.width; ++i) { - for (j = 0; j < rect.height; ++j) { - argb = away.utils.ColorUtils.float32ColorToARGB(inputVector[i + j * rect.width]); - index = (i + rect.x + (j + rect.y) * this._imageCanvas.width) * 4; - - this._imageData.data[index + 0] = argb[1]; - this._imageData.data[index + 1] = argb[2]; - this._imageData.data[index + 2] = argb[3]; - this._imageData.data[index + 3] = argb[0]; - } - } - } - - if (!this._locked) { - this._context.putImageData(this._imageData, 0, 0); - this._imageData = null; - } - }; - - BitmapData.prototype.drawImage = function (img, sourceRect, destRect) { - if (this._locked) { - // If canvas is locked: - // - // 1) copy image data back to canvas - // 2) draw object - // 3) read _imageData back out - if (this._imageData) { - this._context.putImageData(this._imageData, 0, 0); // at coords 0,0 - } - - this._drawImage(img, sourceRect, destRect); - - if (this._imageData) { - this._imageData = this._context.getImageData(0, 0, this._rect.width, this._rect.height); - } - } else { - this._drawImage(img, sourceRect, destRect); - } - }; - - BitmapData.prototype._drawImage = function (img, sourceRect, destRect) { - if (img instanceof away.base.BitmapData) { - this._context.drawImage(img.canvas, sourceRect.x, sourceRect.y, sourceRect.width, sourceRect.height, destRect.x, destRect.y, destRect.width, destRect.height); - } else if (img instanceof HTMLImageElement) { - this._context.drawImage(img, sourceRect.x, sourceRect.y, sourceRect.width, sourceRect.height, destRect.x, destRect.y, destRect.width, destRect.height); - } - }; - - BitmapData.prototype.copyPixels = function (bmpd, sourceRect, destRect) { - if (this._locked) { - // If canvas is locked: - // - // 1) copy image data back to canvas - // 2) draw object - // 3) read _imageData back out - if (this._imageData) { - this._context.putImageData(this._imageData, 0, 0); // at coords 0,0 - } - - this._copyPixels(bmpd, sourceRect, destRect); - - if (this._imageData) { - this._imageData = this._context.getImageData(0, 0, this._rect.width, this._rect.height); - } - } else { - this._copyPixels(bmpd, sourceRect, destRect); - } - }; - - BitmapData.prototype._copyPixels = function (bmpd, sourceRect, destRect) { - if (bmpd instanceof away.base.BitmapData) { - this._context.drawImage(bmpd.canvas, sourceRect.x, sourceRect.y, sourceRect.width, sourceRect.height, destRect.x, destRect.y, destRect.width, destRect.height); - } else if (bmpd instanceof HTMLImageElement) { - this._context.drawImage(bmpd, sourceRect.x, sourceRect.y, sourceRect.width, sourceRect.height, destRect.x, destRect.y, destRect.width, destRect.height); - } - }; - - /** - * - * @param rect - * @param color - */ - BitmapData.prototype.fillRect = function (rect, color) { - if (this._locked) { - // If canvas is locked: - // - // 1) copy image data back to canvas - // 2) apply fill - // 3) read _imageData back out - if (this._imageData) { - this._context.putImageData(this._imageData, 0, 0); // at coords 0,0 - } - - this._context.fillStyle = this.hexToRGBACSS(color); - this._context.fillRect(rect.x, rect.y, rect.width, rect.height); - - if (this._imageData) { - this._imageData = this._context.getImageData(0, 0, this._rect.width, this._rect.height); - } - } else { - this._context.fillStyle = this.hexToRGBACSS(color); - this._context.fillRect(rect.x, rect.y, rect.width, rect.height); - } - }; - - BitmapData.prototype.draw = function (source, matrix) { - if (this._locked) { - // If canvas is locked: - // - // 1) copy image data back to canvas - // 2) draw object - // 3) read _imageData back out - if (this._imageData) { - this._context.putImageData(this._imageData, 0, 0); // at coords 0,0 - } - - this._draw(source, matrix); - - if (this._imageData) { - this._imageData = this._context.getImageData(0, 0, this._rect.width, this._rect.height); - } - } else { - this._draw(source, matrix); - } - }; - - BitmapData.prototype._draw = function (source, matrix) { - if (source instanceof away.base.BitmapData) { - this._context.save(); - - if (matrix != null) - this._context.setTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.tx, matrix.ty); - - this._context.drawImage(source.canvas, 0, 0); - this._context.restore(); - } else if (source instanceof HTMLImageElement) { - this._context.save(); - - if (matrix != null) - this._context.setTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.tx, matrix.ty); - - this._context.drawImage(source, 0, 0); - this._context.restore(); - } - }; - - BitmapData.prototype.copyChannel = function (sourceBitmap, sourceRect, destPoint, sourceChannel, destChannel) { - var imageData = sourceBitmap.imageData; - - if (!this._locked) { - this._imageData = this._context.getImageData(0, 0, this._rect.width, this._rect.height); - } - - if (this._imageData) { - var sourceData = sourceBitmap.imageData.data; - var destData = this._imageData.data; - - var sourceOffset = Math.round(Math.log(sourceChannel) / Math.log(2)); - var destOffset = Math.round(Math.log(destChannel) / Math.log(2)); - - var i, j, sourceIndex, destIndex; - for (i = 0; i < sourceRect.width; ++i) { - for (j = 0; j < sourceRect.height; ++j) { - sourceIndex = (i + sourceRect.x + (j + sourceRect.y) * sourceBitmap.width) * 4; - destIndex = (i + destPoint.x + (j + destPoint.y) * this.width) * 4; - - destData[destIndex + destOffset] = sourceData[sourceIndex + sourceOffset]; - } - } - } - - if (!this._locked) { - this._context.putImageData(this._imageData, 0, 0); - this._imageData = null; - } - }; - - BitmapData.prototype.colorTransform = function (rect, colorTransform) { - if (!this._locked) { - this._imageData = this._context.getImageData(0, 0, this._rect.width, this._rect.height); - } - - if (this._imageData) { - var data = this._imageData.data; - - var i, j, index; - for (i = 0; i < rect.width; ++i) { - for (j = 0; j < rect.height; ++j) { - index = (i + rect.x + (j + rect.y) * this.width) * 4; - - data[index] = data[index] * colorTransform.redMultiplier + colorTransform.redOffset; - data[index + 1] = data[index + 1] * colorTransform.greenMultiplier + colorTransform.greenOffset; - data[index + 2] = data[index + 2] * colorTransform.blueMultiplier + colorTransform.blueOffset; - data[index + 3] = data[index + 3] * colorTransform.alphaMultiplier + colorTransform.alphaOffset; - } - } - } - - if (!this._locked) { - this._context.putImageData(this._imageData, 0, 0); - this._imageData = null; - } - }; - - - Object.defineProperty(BitmapData.prototype, "imageData", { - /** - * - * @returns {ImageData} - */ - get: function () { - return this._context.getImageData(0, 0, this._rect.width, this._rect.height); - }, - /** - * - * @param {ImageData} - */ - set: function (value) { - this._context.putImageData(value, 0, 0); - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(BitmapData.prototype, "width", { - /** - * - * @returns {number} - */ - get: function () { - return this._imageCanvas.width; - }, - /** - * - * @param {number} - */ - set: function (value) { - this._rect.width = value; - this._imageCanvas.width = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(BitmapData.prototype, "height", { - /** - * - * @returns {number} - */ - get: function () { - return this._imageCanvas.height; - }, - /** - * - * @param {number} - */ - set: function (value) { - this._rect.height = value; - this._imageCanvas.height = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(BitmapData.prototype, "rect", { - /** - * - * @param {Rectangle} - */ - get: function () { - return this._rect; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(BitmapData.prototype, "canvas", { - /** - * - * @returns {HTMLCanvasElement} - */ - get: function () { - return this._imageCanvas; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(BitmapData.prototype, "context", { - /** - * - * @returns {HTMLCanvasElement} - */ - get: function () { - return this._context; - }, - enumerable: true, - configurable: true - }); - - // Private - /** - * convert decimal value to Hex - */ - BitmapData.prototype.hexToRGBACSS = function (d) { - var argb = ColorUtils.float32ColorToARGB(d); - - if (this._transparent == false) { - argb[0] = 1; - - return 'rgba(' + argb[1] + ',' + argb[2] + ',' + argb[3] + ',' + argb[0] + ')'; - } - - return 'rgba(' + argb[1] + ',' + argb[2] + ',' + argb[3] + ',' + argb[0] / 255 + ')'; - }; - return BitmapData; - })(); - base.BitmapData = BitmapData; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (base) { - var BitmapDataChannel = (function () { - function BitmapDataChannel() { - } - BitmapDataChannel.ALPHA = 8; - BitmapDataChannel.BLUE = 4; - BitmapDataChannel.GREEN = 2; - BitmapDataChannel.RED = 1; - return BitmapDataChannel; - })(); - base.BitmapDataChannel = BitmapDataChannel; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The CapsStyle class is an enumeration of constant values that specify the - * caps style to use in drawing lines. The constants are provided for use as - * values in the caps parameter of the - * flash.display.Graphics.lineStyle() method. You can specify the - * following three types of caps: - */ - (function (base) { - var CapsStyle = (function () { - function CapsStyle() { - } - CapsStyle.ROUND = "round"; - - CapsStyle.NONE = "none"; - - CapsStyle.SQUARE = "square"; - return CapsStyle; - })(); - base.CapsStyle = CapsStyle; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The DisplayObject class is the base class for all objects that can be - * placed on the display list. The display list manages all objects displayed - * in flash. Use the DisplayObjectContainer class to arrange the - * display objects in the display list. DisplayObjectContainer objects can - * have child display objects, while other display objects, such as Shape and - * TextField objects, are "leaf" nodes that have only parents and siblings, no - * children. - * - *

The DisplayObject class supports basic functionality like the x - * and y position of an object, as well as more advanced properties of - * the object such as its transformation matrix.

- * - *

DisplayObject is an abstract base class; therefore, you cannot call - * DisplayObject directly. Invoking new DisplayObject() throws an - * ArgumentError exception.

- * - *

All display objects inherit from the DisplayObject class.

- * - *

The DisplayObject class itself does not include any APIs for rendering - * content onscreen. For that reason, if you want create a custom subclass of - * the DisplayObject class, you will want to extend one of its subclasses that - * do have APIs for rendering content onscreen, such as the Shape, Sprite, - * Bitmap, SimpleButton, TextField, or MovieClip class.

- * - *

The DisplayObject class contains several broadcast events. Normally, the - * target of any particular event is a specific DisplayObject instance. For - * example, the target of an added event is the specific - * DisplayObject instance that was added to the display list. Having a single - * target restricts the placement of event listeners to that target and in - * some cases the target's ancestors on the display list. With broadcast - * events, however, the target is not a specific DisplayObject instance, but - * rather all DisplayObject instances, including those that are not on the - * display list. This means that you can add a listener to any DisplayObject - * instance to listen for broadcast events. In addition to the broadcast - * events listed in the DisplayObject class's Events table, the DisplayObject - * class also inherits two broadcast events from the EventDispatcher class: - * activate and deactivate.

- * - *

Some properties previously used in the ActionScript 1.0 and 2.0 - * MovieClip, TextField, and Button classes(such as _alpha, - * _height, _name, _width, - * _x, _y, and others) have equivalents in the - * ActionScript 3.0 DisplayObject class that are renamed so that they no - * longer begin with the underscore(_) character.

- * - *

For more information, see the "Display Programming" chapter of the - * ActionScript 3.0 Developer's Guide.

- * - * @event added Dispatched when a display object is added to the - * display list. The following methods trigger this - * event: - * DisplayObjectContainer.addChild(), - * DisplayObjectContainer.addChildAt(). - * @event addedToStage Dispatched when a display object is added to the on - * stage display list, either directly or through the - * addition of a sub tree in which the display object - * is contained. The following methods trigger this - * event: - * DisplayObjectContainer.addChild(), - * DisplayObjectContainer.addChildAt(). - * @event enterFrame [broadcast event] Dispatched when the playhead is - * entering a new frame. If the playhead is not - * moving, or if there is only one frame, this event - * is dispatched continuously in conjunction with the - * frame rate. This event is a broadcast event, which - * means that it is dispatched by all display objects - * with a listener registered for this event. - * @event exitFrame [broadcast event] Dispatched when the playhead is - * exiting the current frame. All frame scripts have - * been run. If the playhead is not moving, or if - * there is only one frame, this event is dispatched - * continuously in conjunction with the frame rate. - * This event is a broadcast event, which means that - * it is dispatched by all display objects with a - * listener registered for this event. - * @event frameConstructed [broadcast event] Dispatched after the constructors - * of frame display objects have run but before frame - * scripts have run. If the playhead is not moving, or - * if there is only one frame, this event is - * dispatched continuously in conjunction with the - * frame rate. This event is a broadcast event, which - * means that it is dispatched by all display objects - * with a listener registered for this event. - * @event removed Dispatched when a display object is about to be - * removed from the display list. Two methods of the - * DisplayObjectContainer class generate this event: - * removeChild() and - * removeChildAt(). - * - *

The following methods of a - * DisplayObjectContainer object also generate this - * event if an object must be removed to make room for - * the new object: addChild(), - * addChildAt(), and - * setChildIndex().

- * @event removedFromStage Dispatched when a display object is about to be - * removed from the display list, either directly or - * through the removal of a sub tree in which the - * display object is contained. Two methods of the - * DisplayObjectContainer class generate this event: - * removeChild() and - * removeChildAt(). - * - *

The following methods of a - * DisplayObjectContainer object also generate this - * event if an object must be removed to make room for - * the new object: addChild(), - * addChildAt(), and - * setChildIndex().

- * @event render [broadcast event] Dispatched when the display list - * is about to be updated and rendered. This event - * provides the last opportunity for objects listening - * for this event to make changes before the display - * list is rendered. You must call the - * invalidate() method of the Stage - * object each time you want a render - * event to be dispatched. Render events - * are dispatched to an object only if there is mutual - * trust between it and the object that called - * Stage.invalidate(). This event is a - * broadcast event, which means that it is dispatched - * by all display objects with a listener registered - * for this event. - * - *

Note: This event is not dispatched if the - * display is not rendering. This is the case when the - * content is either minimized or obscured.

- */ - (function (base) { - var DisplayObject = (function (_super) { - __extends(DisplayObject, _super); - /** - * Creates a new DisplayObject instance. - */ - function DisplayObject() { - _super.call(this); - this._pSceneTransform = new away.geom.Matrix3D(); - this._pSceneTransformDirty = true; - this._matrix3D = new away.geom.Matrix3D(); - this._matrix3DDirty = true; - this._inverseSceneTransform = new away.geom.Matrix3D(); - this._inverseSceneTransformDirty = true; - this._scenePosition = new away.geom.Vector3D(); - this._scenePositionDirty = true; - this._explicitVisibility = true; - this._pImplicitVisibility = true; - this._explicitMouseEnabled = true; - this._pImplicitMouseEnabled = true; - this._positionDirty = true; - this._rotationDirty = true; - this._scaleDirty = true; - this._rotationX = 0; - this._rotationY = 0; - this._rotationZ = 0; - this._eulers = new away.geom.Vector3D(); - this._flipY = new away.geom.Matrix3D(); - this._zOffset = 0; - this._pScaleX = 1; - this._pScaleY = 1; - this._pScaleZ = 1; - this._x = 0; - this._y = 0; - this._z = 0; - this._pivot = new away.geom.Vector3D(); - this._orientationMatrix = new away.geom.Matrix3D(); - this._pivotZero = true; - this._pivotDirty = true; - this._pos = new away.geom.Vector3D(); - this._rot = new away.geom.Vector3D(); - this._sca = new away.geom.Vector3D(); - this._pIgnoreTransform = false; - this._pBoundsInvalid = true; - this._worldBoundsInvalid = true; - this._pRenderables = new Array(); - /** - * - */ - this.alignmentMode = base.AlignmentMode.REGISTRATION_POINT; - /** - * - */ - this.castsShadows = true; - /** - * - */ - this.orientationMode = base.OrientationMode.DEFAULT; - - // Cached vector of transformation components used when - // recomposing the transform matrix in updateTransform() - this._transformComponents = new Array(3); //_transformComponents = new Vector.(3, true); - - this._transformComponents[0] = this._pos; - this._transformComponents[1] = this._rot; - this._transformComponents[2] = this._sca; - - //creation of associated transform object - this._transform = new away.geom.Transform(this); - - this._matrix3D.identity(); - - this._flipY.appendScale(1, -1, 1); - - this._pBounds = this.pCreateDefaultBoundingVolume(); - - this._worldBounds = this.pCreateDefaultBoundingVolume(); - } - Object.defineProperty(DisplayObject.prototype, "bounds", { - /** - * - */ - get: function () { - if (this._pBoundsInvalid) - this.pUpdateBounds(); - - return this._pBounds; - }, - set: function (value) { - if (this._pBounds == value) - return; - - this._pBounds = value; - - this._worldBounds = value.clone(); - - this.pInvalidateBounds(); - - if (this._boundsVisible) - this._partitionNode._iUpdateEntityBounds(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObject.prototype, "depth", { - /** - * Indicates the depth of the display object, in pixels. The depth is - * calculated based on the bounds of the content of the display object. When - * you set the depth property, the scaleZ property - * is adjusted accordingly, as shown in the following code: - * - *

Except for TextField and Video objects, a display object with no - * content (such as an empty sprite) has a depth of 0, even if you try to - * set depth to a different value.

- */ - get: function () { - if (this._pBoundsInvalid) - this.pUpdateBounds(); - - return this._depth; - }, - set: function (val) { - if (this._depth == val) - return; - - this._depth == val; - - this._pScaleZ = val / this.bounds.aabb.depth; - - this.invalidateScale(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObject.prototype, "eulers", { - /** - * Defines the rotation of the 3d object as a Vector3D object containing euler angles for rotation around x, y and z axis. - */ - get: function () { - this._eulers.x = this._rotationX * away.geom.MathConsts.RADIANS_TO_DEGREES; - this._eulers.y = this._rotationY * away.geom.MathConsts.RADIANS_TO_DEGREES; - this._eulers.z = this._rotationZ * away.geom.MathConsts.RADIANS_TO_DEGREES; - - return this._eulers; - }, - set: function (value) { - this._rotationX = value.x * away.geom.MathConsts.DEGREES_TO_RADIANS; - this._rotationY = value.y * away.geom.MathConsts.DEGREES_TO_RADIANS; - this._rotationZ = value.z * away.geom.MathConsts.DEGREES_TO_RADIANS; - - this.invalidateRotation(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObject.prototype, "height", { - /** - * An indexed array that contains each filter object currently associated - * with the display object. The flash.filters package contains several - * classes that define specific filters you can use. - * - *

Filters can be applied in Flash Professional at design time, or at run - * time by using ActionScript code. To apply a filter by using ActionScript, - * you must make a temporary copy of the entire filters array, - * modify the temporary array, then assign the value of the temporary array - * back to the filters array. You cannot directly add a new - * filter object to the filters array.

- * - *

To add a filter by using ActionScript, perform the following steps - * (assume that the target display object is named - * myDisplayObject):

- * - *
    - *
  1. Create a new filter object by using the constructor method of your - * chosen filter class.
  2. - *
  3. Assign the value of the myDisplayObject.filters array - * to a temporary array, such as one named myFilters.
  4. - *
  5. Add the new filter object to the myFilters temporary - * array.
  6. - *
  7. Assign the value of the temporary array to the - * myDisplayObject.filters array.
  8. - *
- * - *

If the filters array is undefined, you do not need to use - * a temporary array. Instead, you can directly assign an array literal that - * contains one or more filter objects that you create. The first example in - * the Examples section adds a drop shadow filter by using code that handles - * both defined and undefined filters arrays.

- * - *

To modify an existing filter object, you must use the technique of - * modifying a copy of the filters array:

- * - *
    - *
  1. Assign the value of the filters array to a temporary - * array, such as one named myFilters.
  2. - *
  3. Modify the property by using the temporary array, - * myFilters. For example, to set the quality property of the - * first filter in the array, you could use the following code: - * myFilters[0].quality = 1;
  4. - *
  5. Assign the value of the temporary array to the filters - * array.
  6. - *
- * - *

At load time, if a display object has an associated filter, it is - * marked to cache itself as a transparent bitmap. From this point forward, - * as long as the display object has a valid filter list, the player caches - * the display object as a bitmap. This source bitmap is used as a source - * image for the filter effects. Each display object usually has two bitmaps: - * one with the original unfiltered source display object and another for the - * final image after filtering. The final image is used when rendering. As - * long as the display object does not change, the final image does not need - * updating.

- * - *

The flash.filters package includes classes for filters. For example, to - * create a DropShadow filter, you would write:

- * - * @throws ArgumentError When filters includes a ShaderFilter - * and the shader output type is not compatible with - * this operation(the shader must specify a - * pixel4 output). - * @throws ArgumentError When filters includes a ShaderFilter - * and the shader doesn't specify any image input or - * the first input is not an image4 input. - * @throws ArgumentError When filters includes a ShaderFilter - * and the shader specifies an image input that isn't - * provided. - * @throws ArgumentError When filters includes a ShaderFilter, a - * ByteArray or Vector. instance as a shader - * input, and the width and - * height properties aren't specified for - * the ShaderInput object, or the specified values - * don't match the amount of data in the input data. - * See the ShaderInput.input property for - * more information. - */ - // public filters:Array; - /** - * Indicates the height of the display object, in pixels. The height is - * calculated based on the bounds of the content of the display object. When - * you set the height property, the scaleY property - * is adjusted accordingly, as shown in the following code: - * - *

Except for TextField and Video objects, a display object with no - * content (such as an empty sprite) has a height of 0, even if you try to - * set height to a different value.

- */ - get: function () { - if (this._pBoundsInvalid) - this.pUpdateBounds(); - - return this._height; - }, - set: function (val) { - if (this._height == val) - return; - - this._height == val; - - this._pScaleY = val / this.bounds.aabb.height; - - this.invalidateScale(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObject.prototype, "index", { - /** - * Indicates the instance container index of the DisplayObject. The object can be - * identified in the child list of its parent display object container by - * calling the getChildByIndex() method of the display object - * container. - * - *

If the DisplayObject has no parent container, index defaults to 0.

- */ - get: function () { - if (this._pParent) - return this._pParent.getChildIndex(this); - - return 0; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(DisplayObject.prototype, "inverseSceneTransform", { - /** - * - */ - get: function () { - if (this._inverseSceneTransformDirty) { - this._inverseSceneTransform.copyFrom(this.sceneTransform); - this._inverseSceneTransform.invert(); - this._inverseSceneTransformDirty = false; - } - return this._inverseSceneTransform; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(DisplayObject.prototype, "ignoreTransform", { - /** - * - */ - get: function () { - return this._pIgnoreTransform; - }, - set: function (value) { - if (this._pIgnoreTransform == value) - return; - - this._pIgnoreTransform = value; - - if (value) { - this._pSceneTransform.identity(); - this._scenePosition.setTo(0, 0, 0); - } - - this.pInvalidateSceneTransform(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObject.prototype, "isEntity", { - /** - * - */ - get: function () { - return this._pIsEntity; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(DisplayObject.prototype, "loaderInfo", { - /** - * Returns a LoaderInfo object containing information about loading the file - * to which this display object belongs. The loaderInfo property - * is defined only for the root display object of a SWF file or for a loaded - * Bitmap(not for a Bitmap that is drawn with ActionScript). To find the - * loaderInfo object associated with the SWF file that contains - * a display object named myDisplayObject, use - * myDisplayObject.root.loaderInfo. - * - *

A large SWF file can monitor its download by calling - * this.root.loaderInfo.addEventListener(Event.COMPLETE, - * func).

- */ - get: function () { - return this._loaderInfo; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(DisplayObject.prototype, "mouseEnabled", { - /** - * Specifies whether this object receives mouse, or other user input, - * messages. The default value is true, which means that by - * default any InteractiveObject instance that is on the display list - * receives mouse events or other user input events. If - * mouseEnabled is set to false, the instance does - * not receive any mouse events(or other user input events like keyboard - * events). Any children of this instance on the display list are not - * affected. To change the mouseEnabled behavior for all - * children of an object on the display list, use - * flash.display.DisplayObjectContainer.mouseChildren. - * - *

No event is dispatched by setting this property. You must use the - * addEventListener() method to create interactive - * functionality.

- */ - get: function () { - return this._explicitMouseEnabled; - }, - set: function (value) { - if (this._explicitMouseEnabled == value) - return; - - this._explicitMouseEnabled = value; - - this._pUpdateImplicitMouseEnabled(this._pParent ? this._pParent.mouseChildren : true); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObject.prototype, "mouseX", { - /** - * Indicates the x coordinate of the mouse or user input device position, in - * pixels. - * - *

Note: For a DisplayObject that has been rotated, the returned x - * coordinate will reflect the non-rotated object.

- */ - get: function () { - return this._mouseX; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(DisplayObject.prototype, "mouseY", { - /** - * Indicates the y coordinate of the mouse or user input device position, in - * pixels. - * - *

Note: For a DisplayObject that has been rotated, the returned y - * coordinate will reflect the non-rotated object.

- */ - get: function () { - return this._mouseY; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(DisplayObject.prototype, "parent", { - /** - * Indicates the DisplayObjectContainer object that contains this display - * object. Use the parent property to specify a relative path to - * display objects that are above the current display object in the display - * list hierarchy. - * - *

You can use parent to move up multiple levels in the - * display list as in the following:

- * - * @throws SecurityError The parent display object belongs to a security - * sandbox to which you do not have access. You can - * avoid this situation by having the parent movie call - * the Security.allowDomain() method. - */ - get: function () { - return this._pParent; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(DisplayObject.prototype, "partition", { - /** - * - */ - get: function () { - return this._explicitPartition; - }, - set: function (value) { - if (this._explicitPartition == value) - return; - - if (this._pScene && this._explicitPartition) - this._pScene.iUnregisterPartition(this._explicitPartition); - - this._explicitPartition = value; - - if (this._pScene && value) - this._pScene.iRegisterPartition(value); - - this._pUpdateImplicitPartition(this._pParent ? this._pParent._iAssignedPartition : null); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObject.prototype, "partitionNode", { - /** - * - */ - get: function () { - if (!this._partitionNode) - this._partitionNode = this.pCreateEntityPartitionNode(); - - return this._partitionNode; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(DisplayObject.prototype, "pickingCollider", { - /** - * - */ - get: function () { - return this._pPickingCollider; - }, - set: function (value) { - this._pPickingCollider = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObject.prototype, "pivot", { - /** - * Defines the local point around which the object rotates. - */ - get: function () { - return this._pivot; - }, - set: function (pivot) { - this._pivot = pivot.clone(); - - this.invalidatePivot(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObject.prototype, "root", { - /** - * For a display object in a loaded SWF file, the root property - * is the top-most display object in the portion of the display list's tree - * structure represented by that SWF file. For a Bitmap object representing a - * loaded image file, the root property is the Bitmap object - * itself. For the instance of the main class of the first SWF file loaded, - * the root property is the display object itself. The - * root property of the Stage object is the Stage object itself. - * The root property is set to null for any display - * object that has not been added to the display list, unless it has been - * added to a display object container that is off the display list but that - * is a child of the top-most display object in a loaded SWF file. - * - *

For example, if you create a new Sprite object by calling the - * Sprite() constructor method, its root property - * is null until you add it to the display list(or to a display - * object container that is off the display list but that is a child of the - * top-most display object in a SWF file).

- * - *

For a loaded SWF file, even though the Loader object used to load the - * file may not be on the display list, the top-most display object in the - * SWF file has its root property set to itself. The Loader - * object does not have its root property set until it is added - * as a child of a display object for which the root property is - * set.

- */ - get: function () { - return this._root; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(DisplayObject.prototype, "rotationX", { - /** - * Indicates the x-axis rotation of the DisplayObject instance, in degrees, - * from its original orientation relative to the 3D parent container. Values - * from 0 to 180 represent clockwise rotation; values from 0 to -180 - * represent counterclockwise rotation. Values outside this range are added - * to or subtracted from 360 to obtain a value within the range. - */ - get: function () { - return this._rotationX * away.geom.MathConsts.RADIANS_TO_DEGREES; - }, - set: function (val) { - if (this.rotationX == val) - return; - - this._rotationX = val * away.geom.MathConsts.DEGREES_TO_RADIANS; - - this.invalidateRotation(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObject.prototype, "rotationY", { - /** - * Indicates the y-axis rotation of the DisplayObject instance, in degrees, - * from its original orientation relative to the 3D parent container. Values - * from 0 to 180 represent clockwise rotation; values from 0 to -180 - * represent counterclockwise rotation. Values outside this range are added - * to or subtracted from 360 to obtain a value within the range. - */ - get: function () { - return this._rotationY * away.geom.MathConsts.RADIANS_TO_DEGREES; - }, - set: function (val) { - if (this.rotationY == val) - return; - - this._rotationY = val * away.geom.MathConsts.DEGREES_TO_RADIANS; - - this.invalidateRotation(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObject.prototype, "rotationZ", { - /** - * Indicates the z-axis rotation of the DisplayObject instance, in degrees, - * from its original orientation relative to the 3D parent container. Values - * from 0 to 180 represent clockwise rotation; values from 0 to -180 - * represent counterclockwise rotation. Values outside this range are added - * to or subtracted from 360 to obtain a value within the range. - */ - get: function () { - return this._rotationZ * away.geom.MathConsts.RADIANS_TO_DEGREES; - }, - set: function (val) { - if (this.rotationZ == val) - return; - - this._rotationZ = val * away.geom.MathConsts.DEGREES_TO_RADIANS; - - this.invalidateRotation(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObject.prototype, "scaleX", { - /** - * Indicates the horizontal scale(percentage) of the object as applied from - * the registration point. The default registration point is(0,0). 1.0 - * equals 100% scale. - * - *

Scaling the local coordinate system changes the x and - * y property values, which are defined in whole pixels.

- */ - get: function () { - return this._pScaleX; - }, - set: function (val) { - if (this._pScaleX == val) - return; - - this._pScaleX = val; - - this.invalidateScale(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObject.prototype, "scaleY", { - /** - * Indicates the vertical scale(percentage) of an object as applied from the - * registration point of the object. The default registration point is(0,0). - * 1.0 is 100% scale. - * - *

Scaling the local coordinate system changes the x and - * y property values, which are defined in whole pixels.

- */ - get: function () { - return this._pScaleY; - }, - set: function (val) { - if (this._pScaleY == val) - return; - - this._pScaleY = val; - - this.invalidateScale(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObject.prototype, "scaleZ", { - /** - * Indicates the depth scale(percentage) of an object as applied from the - * registration point of the object. The default registration point is(0,0). - * 1.0 is 100% scale. - * - *

Scaling the local coordinate system changes the x, - * y and z property values, which are defined in - * whole pixels.

- */ - get: function () { - return this._pScaleZ; - }, - set: function (val) { - if (this._pScaleZ == val) - return; - - this._pScaleZ = val; - - this.invalidateScale(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObject.prototype, "scene", { - /** - * - */ - get: function () { - return this._pScene; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(DisplayObject.prototype, "scenePosition", { - /** - * - */ - get: function () { - if (this._scenePositionDirty) { - if (!this._pivotZero && this.alignmentMode == base.AlignmentMode.PIVOT_POINT) { - var pivotScale = new away.geom.Vector3D(this._pivot.x / this._pScaleX, this._pivot.y / this._pScaleY, this._pivot.z / this._pScaleZ); - this._scenePosition = this.sceneTransform.transformVector(pivotScale); - //this._scenePosition.decrementBy(new away.geom.Vector3D(this._pivot.x*this._pScaleX, this._pivot.y*this._pScaleY, this._pivot.z*this._pScaleZ)); - } else { - this.sceneTransform.copyColumnTo(3, this._scenePosition); - } - - this._scenePositionDirty = false; - } - return this._scenePosition; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(DisplayObject.prototype, "sceneTransform", { - get: function () { - if (this._pSceneTransformDirty) - this.pUpdateSceneTransform(); - - return this._pSceneTransform; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(DisplayObject.prototype, "shaderPickingDetails", { - /** - * - */ - get: function () { - return this._shaderPickingDetails; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(DisplayObject.prototype, "boundsVisible", { - /** - * - */ - get: function () { - return this._boundsVisible; - }, - set: function (value) { - if (value == this._boundsVisible) - return; - - this._boundsVisible = value; - - this._partitionNode.boundsVisible = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObject.prototype, "transform", { - /** - * An object with properties pertaining to a display object's matrix, color - * transform, and pixel bounds. The specific properties - matrix, - * colorTransform, and three read-only properties - * (concatenatedMatrix, concatenatedColorTransform, - * and pixelBounds) - are described in the entry for the - * Transform class. - * - *

Each of the transform object's properties is itself an object. This - * concept is important because the only way to set new values for the matrix - * or colorTransform objects is to create a new object and copy that object - * into the transform.matrix or transform.colorTransform property.

- * - *

For example, to increase the tx value of a display - * object's matrix, you must make a copy of the entire matrix object, then - * copy the new object into the matrix property of the transform object:

- *
 public myMatrix:Matrix =
-                * myDisplayObject.transform.matrix; myMatrix.tx += 10;
-                * myDisplayObject.transform.matrix = myMatrix; 
- * - *

You cannot directly set the tx property. The following - * code has no effect on myDisplayObject:

- *
 myDisplayObject.transform.matrix.tx +=
-                * 10; 
- * - *

You can also copy an entire transform object and assign it to another - * display object's transform property. For example, the following code - * copies the entire transform object from myOldDisplayObj to - * myNewDisplayObj:

- * myNewDisplayObj.transform = myOldDisplayObj.transform; - * - *

The resulting display object, myNewDisplayObj, now has the - * same values for its matrix, color transform, and pixel bounds as the old - * display object, myOldDisplayObj.

- * - *

Note that AIR for TV devices use hardware acceleration, if it is - * available, for color transforms.

- */ - get: function () { - return this._transform; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(DisplayObject.prototype, "visible", { - /** - * Whether or not the display object is visible. Display objects that are not - * visible are disabled. For example, if visible=false for an - * InteractiveObject instance, it cannot be clicked. - */ - get: function () { - return this._explicitVisibility; - }, - set: function (value) { - if (this._explicitVisibility == value) - return; - - this._explicitVisibility = value; - - this._pUpdateImplicitVisibility(this._pParent ? this._pParent._iIsVisible() : true); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObject.prototype, "width", { - /** - * Indicates the width of the display object, in pixels. The width is - * calculated based on the bounds of the content of the display object. When - * you set the width property, the scaleX property - * is adjusted accordingly, as shown in the following code: - * - *

Except for TextField and Video objects, a display object with no - * content(such as an empty sprite) has a width of 0, even if you try to set - * width to a different value.

- */ - get: function () { - if (this._pBoundsInvalid) - this.pUpdateBounds(); - - return this._width; - }, - set: function (val) { - if (this._width == val) - return; - - this._width == val; - - this._pScaleX = val / this.bounds.aabb.width; - - this.invalidateScale(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObject.prototype, "worldBounds", { - /** - * - */ - get: function () { - // Since this getter is invoked every iteration of the render loop, and - // the prefab construct could affect the bounds of the entity, the prefab is - // validated here to give it a chance to rebuild. - if (this._iSourcePrefab) - this._iSourcePrefab._iValidate(); - - if (this._worldBoundsInvalid) { - this._worldBoundsInvalid = false; - this._worldBounds.transformFrom(this.bounds, this.sceneTransform); - } - - return this._worldBounds; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(DisplayObject.prototype, "x", { - /** - * Indicates the x coordinate of the DisplayObject instance relative - * to the local coordinates of the parent DisplayObjectContainer. If the - * object is inside a DisplayObjectContainer that has transformations, it is - * in the local coordinate system of the enclosing DisplayObjectContainer. - * Thus, for a DisplayObjectContainer rotated 90° counterclockwise, the - * DisplayObjectContainer's children inherit a coordinate system that is - * rotated 90° counterclockwise. The object's coordinates refer to the - * registration point position. - */ - get: function () { - return this._x; - }, - set: function (val) { - if (this._x == val) - return; - - this._x = val; - - this.invalidatePosition(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObject.prototype, "y", { - /** - * Indicates the y coordinate of the DisplayObject instance relative - * to the local coordinates of the parent DisplayObjectContainer. If the - * object is inside a DisplayObjectContainer that has transformations, it is - * in the local coordinate system of the enclosing DisplayObjectContainer. - * Thus, for a DisplayObjectContainer rotated 90° counterclockwise, the - * DisplayObjectContainer's children inherit a coordinate system that is - * rotated 90° counterclockwise. The object's coordinates refer to the - * registration point position. - */ - get: function () { - return this._y; - }, - set: function (val) { - if (this._y == val) - return; - - this._y = val; - - this.invalidatePosition(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObject.prototype, "z", { - /** - * Indicates the z coordinate position along the z-axis of the DisplayObject - * instance relative to the 3D parent container. The z property is used for - * 3D coordinates, not screen or pixel coordinates. - * - *

When you set a z property for a display object to - * something other than the default value of 0, a corresponding - * Matrix3D object is automatically created. for adjusting a display object's - * position and orientation in three dimensions. When working with the - * z-axis, the existing behavior of x and y properties changes from screen or - * pixel coordinates to positions relative to the 3D parent container.

- * - *

For example, a child of the _root at position x = 100, y = - * 100, z = 200 is not drawn at pixel location(100,100). The child is drawn - * wherever the 3D projection calculation puts it. The calculation is:

- * - *

(x~~cameraFocalLength/cameraRelativeZPosition, - * y~~cameraFocalLength/cameraRelativeZPosition)

- */ - get: function () { - return this._z; - }, - set: function (val) { - if (this._z == val) - return; - - this._z = val; - - this.invalidatePosition(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObject.prototype, "zOffset", { - /** - * - */ - get: function () { - return this._zOffset; - }, - set: function (value) { - this._zOffset = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * - */ - DisplayObject.prototype.addEventListener = function (type, listener) { - _super.prototype.addEventListener.call(this, type, listener); //, priority, useWeakReference); - - switch (type) { - case away.events.DisplayObjectEvent.POSITION_CHANGED: - this._listenToPositionChanged = true; - break; - case away.events.DisplayObjectEvent.ROTATION_CHANGED: - this._listenToRotationChanged = true; - break; - case away.events.DisplayObjectEvent.SCALE_CHANGED: - this._listenToScaleChanged = true; - break; - } - }; - - /** - * - */ - DisplayObject.prototype.clone = function () { - var clone = new DisplayObject(); - clone.pivot = this.pivot; - clone._iMatrix3D = this._iMatrix3D; - clone.name = name; - - // todo: implement for all subtypes - return clone; - }; - - /** - * - */ - DisplayObject.prototype.dispose = function () { - if (this.parent) - this.parent.removeChild(this); - - while (this._pRenderables.length) - this._pRenderables[0].dispose(); - }; - - /** - * @inheritDoc - */ - DisplayObject.prototype.disposeAsset = function () { - this.dispose(); - }; - - /** - * Returns a rectangle that defines the area of the display object relative - * to the coordinate system of the targetCoordinateSpace object. - * Consider the following code, which shows how the rectangle returned can - * vary depending on the targetCoordinateSpace parameter that - * you pass to the method: - * - *

Note: Use the localToGlobal() and - * globalToLocal() methods to convert the display object's local - * coordinates to display coordinates, or display coordinates to local - * coordinates, respectively.

- * - *

The getBounds() method is similar to the - * getRect() method; however, the Rectangle returned by the - * getBounds() method includes any strokes on shapes, whereas - * the Rectangle returned by the getRect() method does not. For - * an example, see the description of the getRect() method.

- * - * @param targetCoordinateSpace The display object that defines the - * coordinate system to use. - * @return The rectangle that defines the area of the display object relative - * to the targetCoordinateSpace object's coordinate - * system. - */ - DisplayObject.prototype.getBounds = function (targetCoordinateSpace) { - return this._bounds; - }; - - /** - * Returns a rectangle that defines the boundary of the display object, based - * on the coordinate system defined by the targetCoordinateSpace - * parameter, excluding any strokes on shapes. The values that the - * getRect() method returns are the same or smaller than those - * returned by the getBounds() method. - * - *

Note: Use localToGlobal() and - * globalToLocal() methods to convert the display object's local - * coordinates to Stage coordinates, or Stage coordinates to local - * coordinates, respectively.

- * - * @param targetCoordinateSpace The display object that defines the - * coordinate system to use. - * @return The rectangle that defines the area of the display object relative - * to the targetCoordinateSpace object's coordinate - * system. - */ - DisplayObject.prototype.getRect = function (targetCoordinateSpace) { - return this._bounds; - }; - - /** - * Converts the point object from the Stage(global) coordinates - * to the display object's(local) coordinates. - * - *

To use this method, first create an instance of the Point class. The - * x and y values that you assign represent global coordinates - * because they relate to the origin(0,0) of the main display area. Then - * pass the Point instance as the parameter to the - * globalToLocal() method. The method returns a new Point object - * with x and y values that relate to the origin of the display - * object instead of the origin of the Stage.

- * - * @param point An object created with the Point class. The Point object - * specifies the x and y coordinates as - * properties. - * @return A Point object with coordinates relative to the display object. - */ - DisplayObject.prototype.globalToLocal = function (point) { - return point; - }; - - /** - * Converts a two-dimensional point from the Stage(global) coordinates to a - * three-dimensional display object's(local) coordinates. - * - *

To use this method, first create an instance of the Point class. The x - * and y values that you assign to the Point object represent global - * coordinates because they are relative to the origin(0,0) of the main - * display area. Then pass the Point object to the - * globalToLocal3D() method as the point parameter. - * The method returns three-dimensional coordinates as a Vector3D object - * containing x, y, and z values that - * are relative to the origin of the three-dimensional display object.

- * - * @param point A two dimensional Point object representing global x and y - * coordinates. - * @return A Vector3D object with coordinates relative to the - * three-dimensional display object. - */ - DisplayObject.prototype.globalToLocal3D = function (point) { - return new away.geom.Vector3D(); - }; - - /** - * Evaluates the bounding box of the display object to see if it overlaps or - * intersects with the bounding box of the obj display object. - * - * @param obj The display object to test against. - * @return true if the bounding boxes of the display objects - * intersect; false if not. - */ - DisplayObject.prototype.hitTestObject = function (obj) { - return false; - }; - - /** - * Evaluates the display object to see if it overlaps or intersects with the - * point specified by the x and y parameters. The - * x and y parameters specify a point in the - * coordinate space of the Stage, not the display object container that - * contains the display object(unless that display object container is the - * Stage). - * - * @param x The x coordinate to test against this object. - * @param y The y coordinate to test against this object. - * @param shapeFlag Whether to check against the actual pixels of the object - * (true) or the bounding box - * (false). - * @return true if the display object overlaps or intersects - * with the specified point; false otherwise. - */ - DisplayObject.prototype.hitTestPoint = function (x, y, shapeFlag) { - if (typeof shapeFlag === "undefined") { shapeFlag = false; } - return false; - }; - - /** - * @inheritDoc - */ - DisplayObject.prototype.isIntersectingRay = function (rayPosition, rayDirection) { - var localRayPosition = this.inverseSceneTransform.transformVector(rayPosition); - var localRayDirection = this.inverseSceneTransform.deltaTransformVector(rayDirection); - var pickingCollisionVO = this._iPickingCollisionVO; - - if (!pickingCollisionVO.localNormal) - pickingCollisionVO.localNormal = new away.geom.Vector3D(); - - var rayEntryDistance = this.bounds.rayIntersection(localRayPosition, localRayDirection, pickingCollisionVO.localNormal); - - if (rayEntryDistance < 0) - return false; - - pickingCollisionVO.rayEntryDistance = rayEntryDistance; - pickingCollisionVO.localRayPosition = localRayPosition; - pickingCollisionVO.localRayDirection = localRayDirection; - pickingCollisionVO.rayPosition = rayPosition; - pickingCollisionVO.rayDirection = rayDirection; - pickingCollisionVO.rayOriginIsInsideBounds = rayEntryDistance == 0; - - return true; - }; - - /** - * Converts a three-dimensional point of the three-dimensional display - * object's(local) coordinates to a two-dimensional point in the Stage - * (global) coordinates. - * - *

For example, you can only use two-dimensional coordinates(x,y) to draw - * with the display.Graphics methods. To draw a - * three-dimensional object, you need to map the three-dimensional - * coordinates of a display object to two-dimensional coordinates. First, - * create an instance of the Vector3D class that holds the x-, y-, and z- - * coordinates of the three-dimensional display object. Then pass the - * Vector3D object to the local3DToGlobal() method as the - * point3d parameter. The method returns a two-dimensional Point - * object that can be used with the Graphics API to draw the - * three-dimensional object.

- * - * @param point3d A Vector3D object containing either a three-dimensional - * point or the coordinates of the three-dimensional display - * object. - * @return A two-dimensional point representing a three-dimensional point in - * two-dimensional space. - */ - DisplayObject.prototype.local3DToGlobal = function (point3d) { - return new away.geom.Point(); - }; - - /** - * Rotates the 3d object around to face a point defined relative to the local coordinates of the parent ObjectContainer3D. - * - * @param target The vector defining the point to be looked at - * @param upAxis An optional vector used to define the desired up orientation of the 3d object after rotation has occurred - */ - DisplayObject.prototype.lookAt = function (target, upAxis) { - if (typeof upAxis === "undefined") { upAxis = null; } - var yAxis; - var zAxis; - var xAxis; - var raw; - - if (upAxis == null) - upAxis = away.geom.Vector3D.Y_AXIS; - else - upAxis.normalize(); - - zAxis = target.subtract(this._iMatrix3D.position); - zAxis.normalize(); - - xAxis = upAxis.crossProduct(zAxis); - xAxis.normalize(); - - if (xAxis.length < 0.05) { - xAxis.x = upAxis.y; - xAxis.y = upAxis.x; - xAxis.z = 0; - xAxis.normalize(); - } - - yAxis = zAxis.crossProduct(xAxis); - - raw = away.geom.Matrix3DUtils.RAW_DATA_CONTAINER; - - raw[0] = xAxis.x; - raw[1] = xAxis.y; - raw[2] = xAxis.z; - raw[3] = 0; - - raw[4] = yAxis.x; - raw[5] = yAxis.y; - raw[6] = yAxis.z; - raw[7] = 0; - - raw[8] = zAxis.x; - raw[9] = zAxis.y; - raw[10] = zAxis.z; - raw[11] = 0; - - var m = new away.geom.Matrix3D(); - m.copyRawDataFrom(raw); - - var vec = m.decompose()[1]; - - this._rotationX = vec.x; - this._rotationY = vec.y; - this._rotationZ = vec.z; - - this.invalidateRotation(); - }; - - /** - * Converts the point object from the display object's(local) - * coordinates to the Stage(global) coordinates. - * - *

This method allows you to convert any given x and y - * coordinates from values that are relative to the origin(0,0) of a - * specific display object(local coordinates) to values that are relative to - * the origin of the Stage(global coordinates).

- * - *

To use this method, first create an instance of the Point class. The - * x and y values that you assign represent local coordinates - * because they relate to the origin of the display object.

- * - *

You then pass the Point instance that you created as the parameter to - * the localToGlobal() method. The method returns a new Point - * object with x and y values that relate to the origin of the - * Stage instead of the origin of the display object.

- * - * @param point The name or identifier of a point created with the Point - * class, specifying the x and y coordinates as - * properties. - * @return A Point object with coordinates relative to the Stage. - */ - DisplayObject.prototype.localToGlobal = function (point) { - return new away.geom.Point(); - }; - - /** - * Moves the 3d object directly to a point in space - * - * @param dx The amount of movement along the local x axis. - * @param dy The amount of movement along the local y axis. - * @param dz The amount of movement along the local z axis. - */ - DisplayObject.prototype.moveTo = function (dx, dy, dz) { - if (this._x == dx && this._y == dy && this._z == dz) - return; - - this._x = dx; - this._y = dy; - this._z = dz; - - this.invalidatePosition(); - }; - - /** - * Moves the local point around which the object rotates. - * - * @param dx The amount of movement along the local x axis. - * @param dy The amount of movement along the local y axis. - * @param dz The amount of movement along the local z axis. - */ - DisplayObject.prototype.movePivot = function (dx, dy, dz) { - if (this._pivot == null) - this._pivot = new away.geom.Vector3D(); - - this._pivot.x += dx; - this._pivot.y += dy; - this._pivot.z += dz; - - this.invalidatePivot(); - }; - - /** - * Rotates the 3d object around it's local x-axis - * - * @param angle The amount of rotation in degrees - */ - DisplayObject.prototype.pitch = function (angle) { - this.rotate(away.geom.Vector3D.X_AXIS, angle); - }; - - /** - * - */ - DisplayObject.prototype.getRenderSceneTransform = function (camera) { - if (this.orientationMode == base.OrientationMode.CAMERA_PLANE) { - var comps = camera.sceneTransform.decompose(); - var scale = comps[2]; - comps[0] = this.scenePosition; - scale.x = this._pScaleX; - scale.y = this._pScaleY; - scale.z = this._pScaleZ; - this._orientationMatrix.recompose(comps); - - //add in case of pivot - if (!this._pivotZero && this.alignmentMode == base.AlignmentMode.PIVOT_POINT) - this._orientationMatrix.prependTranslation(-this._pivot.x / this._pScaleX, -this._pivot.y / this._pScaleY, -this._pivot.z / this._pScaleZ); - - return this._orientationMatrix; - } - - return this.sceneTransform; - }; - - /** - * Rotates the 3d object around it's local z-axis - * - * @param angle The amount of rotation in degrees - */ - DisplayObject.prototype.roll = function (angle) { - this.rotate(away.geom.Vector3D.Z_AXIS, angle); - }; - - /** - * Rotates the 3d object around an axis by a defined angle - * - * @param axis The vector defining the axis of rotation - * @param angle The amount of rotation in degrees - */ - DisplayObject.prototype.rotate = function (axis, angle) { - var m = new away.geom.Matrix3D(); - m.prependRotation(angle, axis); - - var vec = m.decompose()[1]; - - this._rotationX += vec.x; - this._rotationY += vec.y; - this._rotationZ += vec.z; - - this.invalidateRotation(); - }; - - /** - * Rotates the 3d object directly to a euler angle - * - * @param ax The angle in degrees of the rotation around the x axis. - * @param ay The angle in degrees of the rotation around the y axis. - * @param az The angle in degrees of the rotation around the z axis. - */ - DisplayObject.prototype.rotateTo = function (ax, ay, az) { - this._rotationX = ax * away.geom.MathConsts.DEGREES_TO_RADIANS; - this._rotationY = ay * away.geom.MathConsts.DEGREES_TO_RADIANS; - this._rotationZ = az * away.geom.MathConsts.DEGREES_TO_RADIANS; - - this.invalidateRotation(); - }; - - /** - * - */ - DisplayObject.prototype.removeEventListener = function (type, listener) { - _super.prototype.removeEventListener.call(this, type, listener); - - if (this.hasEventListener(type, listener)) - return; - - switch (type) { - case away.events.DisplayObjectEvent.POSITION_CHANGED: - this._listenToPositionChanged = false; - break; - - case away.events.DisplayObjectEvent.ROTATION_CHANGED: - this._listenToRotationChanged = false; - break; - - case away.events.DisplayObjectEvent.SCALE_CHANGED: - this._listenToScaleChanged = false; - break; - } - }; - - /** - * Moves the 3d object along a vector by a defined length - * - * @param axis The vector defining the axis of movement - * @param distance The length of the movement - */ - DisplayObject.prototype.translate = function (axis, distance) { - var x = axis.x, y = axis.y, z = axis.z; - var len = distance / Math.sqrt(x * x + y * y + z * z); - - this._x += x * len; - this._y += y * len; - this._z += z * len; - - this.invalidatePosition(); - }; - - /** - * Moves the 3d object along a vector by a defined length - * - * @param axis The vector defining the axis of movement - * @param distance The length of the movement - */ - DisplayObject.prototype.translateLocal = function (axis, distance) { - var x = axis.x, y = axis.y, z = axis.z; - var len = distance / Math.sqrt(x * x + y * y + z * z); - - this._iMatrix3D.prependTranslation(x * len, y * len, z * len); - - this._matrix3D.copyColumnTo(3, this._pos); - - this._x = this._pos.x; - this._y = this._pos.y; - this._z = this._pos.z; - - this.invalidatePosition(); - }; - - /** - * Rotates the 3d object around it's local y-axis - * - * @param angle The amount of rotation in degrees - */ - DisplayObject.prototype.yaw = function (angle) { - this.rotate(away.geom.Vector3D.Y_AXIS, angle); - }; - - Object.defineProperty(DisplayObject.prototype, "_iAssignedPartition", { - /** - * @internal - */ - get: function () { - return this._pImplicitPartition; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(DisplayObject.prototype, "_iMatrix3D", { - /** - * The transformation of the 3d object, relative to the local coordinates of the parent ObjectContainer3D. - * - * @internal - */ - get: function () { - if (this._matrix3DDirty) - this._pUpdateMatrix3D(); - - return this._matrix3D; - }, - set: function (val) { - // TODO: From AS3 - Do we still need this in JS ? - //ridiculous matrix error - /* - if (!val.rawData[0]) { - - var raw:number[] = away.geom.Matrix3DUtils.RAW_DATA_CONTAINER; - val.copyRawDataTo(raw); - raw[0] = this._smallestNumber; - val.copyRawDataFrom(raw); - } - //*/ - var elements = val.decompose(); - var vec; - - vec = elements[0]; - - if (this._x != vec.x || this._y != vec.y || this._z != vec.z) { - this._x = vec.x; - this._y = vec.y; - this._z = vec.z; - - this.invalidatePosition(); - } - - vec = elements[1]; - - if (this._rotationX != vec.x || this._rotationY != vec.y || this._rotationZ != vec.z) { - this._rotationX = vec.x; - this._rotationY = vec.y; - this._rotationZ = vec.z; - - this.invalidateRotation(); - } - - vec = elements[2]; - - if (this._pScaleX != vec.x || this._pScaleY != vec.y || this._pScaleZ != vec.z) { - this._pScaleX = vec.x; - this._pScaleY = vec.y; - this._pScaleZ = vec.z; - - this.invalidateScale(); - } - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObject.prototype, "_iPickingCollisionVO", { - /** - * @internal - */ - get: function () { - if (!this._pPickingCollisionVO) - this._pPickingCollisionVO = new away.pick.PickingCollisionVO(this); - - return this._pPickingCollisionVO; - }, - enumerable: true, - configurable: true - }); - - /** - * @internal - */ - DisplayObject.prototype.iSetParent = function (value) { - this._pParent = value; - - if (value) { - this._pUpdateImplicitMouseEnabled(value.mouseChildren); - this._pUpdateImplicitVisibility(value._iIsVisible()); - this._pUpdateImplicitPartition(value._iAssignedPartition); - this._iSetScene(value._pScene); - } else { - this._pUpdateImplicitMouseEnabled(true); - this._pUpdateImplicitVisibility(true); - this._pUpdateImplicitPartition(null); - - this._iSetScene(null); - } - }; - - /** - * @protected - */ - DisplayObject.prototype.pCreateDefaultBoundingVolume = function () { - // point lights should be using sphere bounds - // directional lights should be using null bounds - return new away.bounds.AxisAlignedBoundingBox(); - }; - - /** - * @protected - */ - DisplayObject.prototype.pCreateEntityPartitionNode = function () { - throw new away.errors.AbstractMethodError(); - }; - - /** - * @protected - */ - DisplayObject.prototype.pInvalidateBounds = function () { - this._pBoundsInvalid = true; - this._worldBoundsInvalid = true; - - if (this.isEntity) - this.invalidatePartition(); - }; - - /** - * @protected - */ - DisplayObject.prototype.pInvalidateSceneTransform = function () { - this._pSceneTransformDirty = !this._pIgnoreTransform; - this._inverseSceneTransformDirty = !this._pIgnoreTransform; - this._scenePositionDirty = !this._pIgnoreTransform; - - this._worldBoundsInvalid = !this._pIgnoreTransform; - - if (this.isEntity) - this.invalidatePartition(); - - if (this._listenToSceneTransformChanged) - this.notifySceneTransformChange(); - }; - - /** - * @protected - */ - DisplayObject.prototype.pUpdateBounds = function () { - this._width = this._pBounds.aabb.width * this._pScaleX; - this._height = this._pBounds.aabb.height * this._pScaleY; - this._depth = this._pBounds.aabb.depth * this._pScaleZ; - - this._pBoundsInvalid = false; - }; - - /** - * @protected - */ - DisplayObject.prototype._pUpdateImplicitMouseEnabled = function (value) { - this._pImplicitMouseEnabled = this._explicitMouseEnabled && value; - - // If there is a parent and this child does not have a picking collider, use its parent's picking collider. - if (this._pImplicitMouseEnabled && this._pParent && !this._pPickingCollider) - this._pPickingCollider = this._pParent._pPickingCollider; - }; - - /** - * @protected - */ - DisplayObject.prototype._pUpdateImplicitPartition = function (value) { - // assign parent implicit partition if no explicit one is given - this._pImplicitPartition = this._explicitPartition || value; - }; - - /** - * @protected - */ - DisplayObject.prototype._pUpdateImplicitVisibility = function (value) { - this._pImplicitVisibility = this._explicitVisibility && value; - }; - - /** - * @protected - */ - DisplayObject.prototype._pUpdateMatrix3D = function () { - this._pos.x = this._x; - this._pos.y = this._y; - this._pos.z = this._z; - - this._rot.x = this._rotationX; - this._rot.y = this._rotationY; - this._rot.z = this._rotationZ; - - this._sca.x = this._pScaleX; - this._sca.y = this._pScaleY; - this._sca.z = this._pScaleZ; - - this._matrix3D.recompose(this._transformComponents); - - if (!this._pivotZero) { - this._matrix3D.prependTranslation(-this._pivot.x / this._pScaleX, -this._pivot.y / this._pScaleY, -this._pivot.z / this._pScaleZ); - if (this.alignmentMode != base.AlignmentMode.PIVOT_POINT) - this._matrix3D.appendTranslation(this._pivot.x, this._pivot.y, this._pivot.z); - } - - this._matrix3DDirty = false; - this._positionDirty = false; - this._rotationDirty = false; - this._scaleDirty = false; - this._pivotDirty = false; - }; - - /** - * @protected - */ - DisplayObject.prototype.pUpdateSceneTransform = function () { - if (this._pParent && !this._pParent._iIsRoot) { - this._pSceneTransform.copyFrom(this._pParent.sceneTransform); - this._pSceneTransform.prepend(this._iMatrix3D); - } else { - this._pSceneTransform.copyFrom(this._iMatrix3D); - } - - this._pSceneTransformDirty = false; - }; - - DisplayObject.prototype._iAddRenderable = function (renderable) { - this._pRenderables.push(renderable); - - return renderable; - }; - - DisplayObject.prototype._iRemoveRenderable = function (renderable) { - var index = this._pRenderables.indexOf(renderable); - - this._pRenderables.splice(index, 1); - - return renderable; - }; - - /** - * //TODO - * - * @param shortestCollisionDistance - * @param findClosest - * @returns {boolean} - * - * @internal - */ - DisplayObject.prototype._iTestCollision = function (shortestCollisionDistance, findClosest) { - return false; - }; - - /** - * - */ - DisplayObject.prototype._iInternalUpdate = function () { - if (this._iController) - this._iController.update(); - }; - - /** - * @internal - */ - DisplayObject.prototype._iIsVisible = function () { - return this._pImplicitVisibility; - }; - - /** - * @internal - */ - DisplayObject.prototype._iIsMouseEnabled = function () { - return this._pImplicitMouseEnabled; - }; - - /** - * @internal - */ - DisplayObject.prototype._iSetScene = function (value) { - // test to see if we're switching roots while we're already using a scene partition - /* - if (value == null) - this._oldScene = this._pScene; - - if (this._explicitPartition && this._oldScene && this._oldScene != this._pScene) - this.partition = null; - - if (value) - this._oldScene = null; - - // end of stupid partition test code - //*/ - if (this._pScene == value) - return; - - this._pUpdateScene(value); - - if (!this._pSceneTransformDirty && !this._pIgnoreTransform) - this.pInvalidateSceneTransform(); - }; - - /** - * @protected - */ - DisplayObject.prototype._pUpdateScene = function (value) { - if (this._pScene) { - this._pScene.dispatchEvent(new away.events.SceneEvent(away.events.SceneEvent.REMOVED_FROM_SCENE, this)); - - //unregister entity from current scene - this._pScene.iUnregisterEntity(this); - } - - this._pScene = value; - - if (value) { - value.dispatchEvent(new away.events.SceneEvent(away.events.SceneEvent.ADDED_TO_SCENE, this)); - - //register entity with new scene - value.iRegisterEntity(this); - } - - this.notifySceneChange(); - }; - - /** - * @private - */ - DisplayObject.prototype.notifyPositionChanged = function () { - if (!this._positionChanged) - this._positionChanged = new away.events.DisplayObjectEvent(away.events.DisplayObjectEvent.POSITION_CHANGED, this); - - this.dispatchEvent(this._positionChanged); - }; - - /** - * @private - */ - DisplayObject.prototype.notifyRotationChanged = function () { - if (!this._rotationChanged) - this._rotationChanged = new away.events.DisplayObjectEvent(away.events.DisplayObjectEvent.ROTATION_CHANGED, this); - - this.dispatchEvent(this._rotationChanged); - }; - - /** - * @private - */ - DisplayObject.prototype.notifyScaleChanged = function () { - if (!this._scaleChanged) - this._scaleChanged = new away.events.DisplayObjectEvent(away.events.DisplayObjectEvent.SCALE_CHANGED, this); - - this.dispatchEvent(this._scaleChanged); - }; - - /** - * @private - */ - DisplayObject.prototype.notifySceneChange = function () { - if (this._listenToSceneChanged) { - if (!this._scenechanged) - this._scenechanged = new away.events.DisplayObjectEvent(away.events.DisplayObjectEvent.SCENE_CHANGED, this); - - this.dispatchEvent(this._scenechanged); - } - }; - - /** - * @private - */ - DisplayObject.prototype.notifySceneTransformChange = function () { - if (!this._sceneTransformChanged) - this._sceneTransformChanged = new away.events.DisplayObjectEvent(away.events.DisplayObjectEvent.SCENETRANSFORM_CHANGED, this); - - this.dispatchEvent(this._sceneTransformChanged); - }; - - /** - * Invalidates the 3D transformation matrix, causing it to be updated upon the next request - * - * @private - */ - DisplayObject.prototype.invalidateMatrix3D = function () { - if (this._matrix3DDirty) - return; - - this._matrix3DDirty = true; - - if (!this._pSceneTransformDirty && !this._pIgnoreTransform) - this.pInvalidateSceneTransform(); - }; - - /** - * @private - */ - DisplayObject.prototype.invalidatePartition = function () { - if (this._iAssignedPartition) - this._iAssignedPartition.iMarkForUpdate(this); - }; - - /** - * @private - */ - DisplayObject.prototype.invalidatePivot = function () { - this._pivotZero = (this._pivot.x == 0) && (this._pivot.y == 0) && (this._pivot.z == 0); - - if (this._pivotDirty) - return; - - this._pivotDirty = true; - - this.invalidateMatrix3D(); - }; - - /** - * @private - */ - DisplayObject.prototype.invalidatePosition = function () { - if (this._positionDirty) - return; - - this._positionDirty = true; - - this.invalidateMatrix3D(); - - if (this._listenToPositionChanged) - this.notifyPositionChanged(); - }; - - /** - * @private - */ - DisplayObject.prototype.invalidateRotation = function () { - if (this._rotationDirty) - return; - - this._rotationDirty = true; - - this.invalidateMatrix3D(); - - if (this._listenToRotationChanged) - this.notifyRotationChanged(); - }; - - /** - * @private - */ - DisplayObject.prototype.invalidateScale = function () { - if (this._scaleDirty) - return; - - this._scaleDirty = true; - - this.invalidateMatrix3D(); - - if (this._listenToScaleChanged) - this.notifyScaleChanged(); - }; - return DisplayObject; - })(away.library.NamedAssetBase); - base.DisplayObject = DisplayObject; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.base - */ - (function (base) { - /** - * - * Geometry is a collection of SubGeometries, each of which contain the actual geometrical data such as vertices, - * normals, uvs, etc. It also contains a reference to an animation class, which defines how the geometry moves. - * A Geometry object is assigned to a Mesh, a scene graph occurence of the geometry, which in turn assigns - * the SubGeometries to its respective TriangleSubMesh objects. - * - * - * - * @see away.core.base.SubGeometry - * @see away.entities.Mesh - * - * @class away.base.Geometry - */ - var Geometry = (function (_super) { - __extends(Geometry, _super); - /** - * Creates a new Geometry object. - */ - function Geometry() { - _super.call(this); - - this._subGeometries = new Array(); - } - Object.defineProperty(Geometry.prototype, "assetType", { - get: function () { - return away.library.AssetType.GEOMETRY; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Geometry.prototype, "subGeometries", { - /** - * A collection of TriangleSubGeometry objects, each of which contain geometrical data such as vertices, normals, etc. - */ - get: function () { - return this._subGeometries; - }, - enumerable: true, - configurable: true - }); - - Geometry.prototype.getSubGeometries = function () { - return this._subGeometries; - }; - - Geometry.prototype.applyTransformation = function (transform) { - var len = this._subGeometries.length; - for (var i = 0; i < len; ++i) - this._subGeometries[i].applyTransformation(transform); - }; - - /** - * Adds a new TriangleSubGeometry object to the list. - * @param subGeometry The TriangleSubGeometry object to be added. - */ - Geometry.prototype.addSubGeometry = function (subGeometry) { - this._subGeometries.push(subGeometry); - - subGeometry.parentGeometry = this; - - if (this.hasEventListener(away.events.GeometryEvent.SUB_GEOMETRY_ADDED)) - this.dispatchEvent(new away.events.GeometryEvent(away.events.GeometryEvent.SUB_GEOMETRY_ADDED, subGeometry)); - - this.iInvalidateBounds(subGeometry); - }; - - /** - * Removes a new TriangleSubGeometry object from the list. - * @param subGeometry The TriangleSubGeometry object to be removed. - */ - Geometry.prototype.removeSubGeometry = function (subGeometry) { - this._subGeometries.splice(this._subGeometries.indexOf(subGeometry), 1); - - subGeometry.parentGeometry = null; - - if (this.hasEventListener(away.events.GeometryEvent.SUB_GEOMETRY_REMOVED)) - this.dispatchEvent(new away.events.GeometryEvent(away.events.GeometryEvent.SUB_GEOMETRY_REMOVED, subGeometry)); - - this.iInvalidateBounds(subGeometry); - }; - - /** - * Clones the geometry. - * @return An exact duplicate of the current Geometry object. - */ - Geometry.prototype.clone = function () { - var clone = new Geometry(); - var len = this._subGeometries.length; - - for (var i = 0; i < len; ++i) - clone.addSubGeometry(this._subGeometries[i].clone()); - - return clone; - }; - - /** - * Scales the geometry. - * @param scale The amount by which to scale. - */ - Geometry.prototype.scale = function (scale) { - var numSubGeoms = this._subGeometries.length; - for (var i = 0; i < numSubGeoms; ++i) - this._subGeometries[i].scale(scale); - }; - - /** - * Clears all resources used by the Geometry object, including SubGeometries. - */ - Geometry.prototype.dispose = function () { - var numSubGeoms = this._subGeometries.length; - - for (var i = 0; i < numSubGeoms; ++i) { - var subGeom = this._subGeometries[0]; - this.removeSubGeometry(subGeom); - subGeom.dispose(); - } - }; - - /** - * Scales the uv coordinates (tiling) - * @param scaleU The amount by which to scale on the u axis. Default is 1; - * @param scaleV The amount by which to scale on the v axis. Default is 1; - */ - Geometry.prototype.scaleUV = function (scaleU, scaleV) { - if (typeof scaleU === "undefined") { scaleU = 1; } - if (typeof scaleV === "undefined") { scaleV = 1; } - var numSubGeoms = this._subGeometries.length; - - for (var i = 0; i < numSubGeoms; ++i) - this._subGeometries[i].scaleUV(scaleU, scaleV); - }; - - Geometry.prototype.iInvalidateBounds = function (subGeom) { - if (this.hasEventListener(away.events.GeometryEvent.BOUNDS_INVALID)) - this.dispatchEvent(new away.events.GeometryEvent(away.events.GeometryEvent.BOUNDS_INVALID, subGeom)); - }; - return Geometry; - })(away.library.NamedAssetBase); - base.Geometry = Geometry; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The GradientType class provides values for the type parameter - * in the beginGradientFill() and - * lineGradientStyle() methods of the flash.display.Graphics - * class. - */ - (function (base) { - var GradientType = (function () { - function GradientType() { - } - GradientType.LINEAR = "linear"; - - GradientType.RADIAL = "radial"; - return GradientType; - })(); - base.GradientType = GradientType; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The Graphics class contains a set of methods that you can use to create a - * vector shape. Display objects that support drawing include Sprite and Shape - * objects. Each of these classes includes a graphics property - * that is a Graphics object. The following are among those helper functions - * provided for ease of use: drawRect(), - * drawRoundRect(), drawCircle(), and - * drawEllipse(). - * - *

You cannot create a Graphics object directly from ActionScript code. If - * you call new Graphics(), an exception is thrown.

- * - *

The Graphics class is final; it cannot be subclassed.

- */ - (function (base) { - var Graphics = (function () { - function Graphics() { - } - /** - * Fills a drawing area with a bitmap image. The bitmap can be repeated or - * tiled to fill the area. The fill remains in effect until you call the - * beginFill(), beginBitmapFill(), - * beginGradientFill(), or beginShaderFill() - * method. Calling the clear() method clears the fill. - * - *

The application renders the fill whenever three or more points are - * drawn, or when the endFill() method is called.

- * - * @param bitmap A transparent or opaque bitmap image that contains the bits - * to be displayed. - * @param matrix A matrix object(of the flash.geom.Matrix class), which you - * can use to define transformations on the bitmap. For - * example, you can use the following matrix to rotate a bitmap - * by 45 degrees(pi/4 radians): - * @param repeat If true, the bitmap image repeats in a tiled - * pattern. If false, the bitmap image does not - * repeat, and the edges of the bitmap are used for any fill - * area that extends beyond the bitmap. - * - *

For example, consider the following bitmap(a 20 x - * 20-pixel checkerboard pattern):

- * - *

When repeat is set to true(as - * in the following example), the bitmap fill repeats the - * bitmap:

- * - *

When repeat is set to false, - * the bitmap fill uses the edge pixels for the fill area - * outside the bitmap:

- * @param smooth If false, upscaled bitmap images are rendered - * by using a nearest-neighbor algorithm and look pixelated. If - * true, upscaled bitmap images are rendered by - * using a bilinear algorithm. Rendering by using the nearest - * neighbor algorithm is faster. - */ - Graphics.prototype.beginBitmapFill = function (bitmap, matrix, repeat, smooth) { - if (typeof matrix === "undefined") { matrix = null; } - if (typeof repeat === "undefined") { repeat = true; } - if (typeof smooth === "undefined") { smooth = false; } - }; - - /** - * Specifies a simple one-color fill that subsequent calls to other Graphics - * methods(such as lineTo() or drawCircle()) use - * when drawing. The fill remains in effect until you call the - * beginFill(), beginBitmapFill(), - * beginGradientFill(), or beginShaderFill() - * method. Calling the clear() method clears the fill. - * - *

The application renders the fill whenever three or more points are - * drawn, or when the endFill() method is called.

- * - * @param color The color of the fill(0xRRGGBB). - * @param alpha The alpha value of the fill(0.0 to 1.0). - */ - Graphics.prototype.beginFill = function (color /*int*/ , alpha) { - if (typeof alpha === "undefined") { alpha = 1; } - }; - - /** - * Specifies a gradient fill used by subsequent calls to other Graphics - * methods(such as lineTo() or drawCircle()) for - * the object. The fill remains in effect until you call the - * beginFill(), beginBitmapFill(), - * beginGradientFill(), or beginShaderFill() - * method. Calling the clear() method clears the fill. - * - *

The application renders the fill whenever three or more points are - * drawn, or when the endFill() method is called.

- * - * @param type A value from the GradientType class that - * specifies which gradient type to use: - * GradientType.LINEAR or - * GradientType.RADIAL. - * @param colors An array of RGB hexadecimal color values used - * in the gradient; for example, red is 0xFF0000, - * blue is 0x0000FF, and so on. You can specify - * up to 15 colors. For each color, specify a - * corresponding value in the alphas and ratios - * parameters. - * @param alphas An array of alpha values for the corresponding - * colors in the colors array; valid values are 0 - * to 1. If the value is less than 0, the default - * is 0. If the value is greater than 1, the - * default is 1. - * @param ratios An array of color distribution ratios; valid - * values are 0-255. This value defines the - * percentage of the width where the color is - * sampled at 100%. The value 0 represents the - * left position in the gradient box, and 255 - * represents the right position in the gradient - * box. - * @param matrix A transformation matrix as defined by the - * flash.geom.Matrix class. The flash.geom.Matrix - * class includes a - * createGradientBox() method, which - * lets you conveniently set up the matrix for use - * with the beginGradientFill() - * method. - * @param spreadMethod A value from the SpreadMethod class that - * specifies which spread method to use, either: - * SpreadMethod.PAD, - * SpreadMethod.REFLECT, or - * SpreadMethod.REPEAT. - * - *

For example, consider a simple linear - * gradient between two colors:

- * - *

This example uses - * SpreadMethod.PAD for the spread - * method, and the gradient fill looks like the - * following:

- * - *

If you use SpreadMethod.REFLECT - * for the spread method, the gradient fill looks - * like the following:

- * - *

If you use SpreadMethod.REPEAT - * for the spread method, the gradient fill looks - * like the following:

- * @param interpolationMethod A value from the InterpolationMethod class that - * specifies which value to use: - * InterpolationMethod.LINEAR_RGB or - * InterpolationMethod.RGB - * - *

For example, consider a simple linear - * gradient between two colors(with the - * spreadMethod parameter set to - * SpreadMethod.REFLECT). The - * different interpolation methods affect the - * appearance as follows:

- * @param focalPointRatio A number that controls the location of the - * focal point of the gradient. 0 means that the - * focal point is in the center. 1 means that the - * focal point is at one border of the gradient - * circle. -1 means that the focal point is at the - * other border of the gradient circle. A value - * less than -1 or greater than 1 is rounded to -1 - * or 1. For example, the following example shows - * a focalPointRatio set to 0.75: - * @throws ArgumentError If the type parameter is not valid. - */ - Graphics.prototype.beginGradientFill = function (type, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio) { - if (typeof matrix === "undefined") { matrix = null; } - if (typeof spreadMethod === "undefined") { spreadMethod = "pad"; } - if (typeof interpolationMethod === "undefined") { interpolationMethod = "rgb"; } - if (typeof focalPointRatio === "undefined") { focalPointRatio = 0; } - }; - - /** - * Specifies a shader fill used by subsequent calls to other Graphics methods - * (such as lineTo() or drawCircle()) for the - * object. The fill remains in effect until you call the - * beginFill(), beginBitmapFill(), - * beginGradientFill(), or beginShaderFill() - * method. Calling the clear() method clears the fill. - * - *

The application renders the fill whenever three or more points are - * drawn, or when the endFill() method is called.

- * - *

Shader fills are not supported under GPU rendering; filled areas will - * be colored cyan.

- * - * @param shader The shader to use for the fill. This Shader instance is not - * required to specify an image input. However, if an image - * input is specified in the shader, the input must be provided - * manually. To specify the input, set the input - * property of the corresponding ShaderInput property of the - * Shader.data property. - * - *

When you pass a Shader instance as an argument the shader - * is copied internally. The drawing fill operation uses that - * internal copy, not a reference to the original shader. Any - * changes made to the shader, such as changing a parameter - * value, input, or bytecode, are not applied to the copied - * shader that's used for the fill.

- * @param matrix A matrix object(of the flash.geom.Matrix class), which you - * can use to define transformations on the shader. For - * example, you can use the following matrix to rotate a shader - * by 45 degrees(pi/4 radians): - * - *

The coordinates received in the shader are based on the - * matrix that is specified for the matrix - * parameter. For a default(null) matrix, the - * coordinates in the shader are local pixel coordinates which - * can be used to sample an input.

- * @throws ArgumentError When the shader output type is not compatible with - * this operation(the shader must specify a - * pixel3 or pixel4 output). - * @throws ArgumentError When the shader specifies an image input that isn't - * provided. - * @throws ArgumentError When a ByteArray or Vector. instance is used - * as an input and the width and - * height properties aren't specified for - * the ShaderInput, or the specified values don't match - * the amount of data in the input object. See the - * ShaderInput.input property for more - * information. - */ - // public beginShaderFill(shader:Shader, matrix:away.geom.Matrix = null) - // { - // - // } - /** - * Clears the graphics that were drawn to this Graphics object, and resets - * fill and line style settings. - * - */ - Graphics.prototype.clear = function () { - }; - - /** - * Copies all of drawing commands from the source Graphics object into the - * calling Graphics object. - * - * @param sourceGraphics The Graphics object from which to copy the drawing - * commands. - */ - Graphics.prototype.copyFrom = function (sourceGraphics) { - }; - - /** - * Draws a cubic Bezier curve from the current drawing position to the - * specified anchor point. Cubic Bezier curves consist of two anchor points - * and two control points. The curve interpolates the two anchor points and - * curves toward the two control points. - * - * The four points you use to draw a cubic Bezier curve with the - * cubicCurveTo() method are as follows: - * - *
    - *
  • The current drawing position is the first anchor point.
  • - *
  • The anchorX and anchorY parameters specify the second anchor point. - *
  • - *
  • The controlX1 and controlY1 parameters - * specify the first control point.
  • - *
  • The controlX2 and controlY2 parameters - * specify the second control point.
  • - *
- * - * If you call the cubicCurveTo() method before calling the - * moveTo() method, your curve starts at position (0, 0). - * - * If the cubicCurveTo() method succeeds, the Flash runtime sets - * the current drawing position to (anchorX, - * anchorY). If the cubicCurveTo() method fails, - * the current drawing position remains unchanged. - * - * If your movie clip contains content created with the Flash drawing tools, - * the results of calls to the cubicCurveTo() method are drawn - * underneath that content. - * - * @param controlX1 Specifies the horizontal position of the first control - * point relative to the registration point of the parent - * display object. - * @param controlY1 Specifies the vertical position of the first control - * point relative to the registration point of the parent - * display object. - * @param controlX2 Specifies the horizontal position of the second control - * point relative to the registration point of the parent - * display object. - * @param controlY2 Specifies the vertical position of the second control - * point relative to the registration point of the parent - * display object. - * @param anchorX Specifies the horizontal position of the anchor point - * relative to the registration point of the parent display - * object. - * @param anchorY Specifies the vertical position of the anchor point - * relative to the registration point of the parent display - * object. - */ - Graphics.prototype.cubicCurveTo = function (controlX1, controlY1, controlX2, controlY2, anchorX, anchorY) { - }; - - /** - * Draws a curve using the current line style from the current drawing - * position to(anchorX, anchorY) and using the control point that - * (controlX, controlY) specifies. The current - * drawing position is then set to(anchorX, - * anchorY). If the movie clip in which you are drawing contains - * content created with the Flash drawing tools, calls to the - * curveTo() method are drawn underneath this content. If you - * call the curveTo() method before any calls to the - * moveTo() method, the default of the current drawing position - * is(0, 0). If any of the parameters are missing, this method fails and the - * current drawing position is not changed. - * - *

The curve drawn is a quadratic Bezier curve. Quadratic Bezier curves - * consist of two anchor points and one control point. The curve interpolates - * the two anchor points and curves toward the control point.

- * - * @param controlX A number that specifies the horizontal position of the - * control point relative to the registration point of the - * parent display object. - * @param controlY A number that specifies the vertical position of the - * control point relative to the registration point of the - * parent display object. - * @param anchorX A number that specifies the horizontal position of the - * next anchor point relative to the registration point of - * the parent display object. - * @param anchorY A number that specifies the vertical position of the next - * anchor point relative to the registration point of the - * parent display object. - */ - Graphics.prototype.curveTo = function (controlX, controlY, anchorX, anchorY) { - }; - - /** - * Draws a circle. Set the line style, fill, or both before you call the - * drawCircle() method, by calling the linestyle(), - * lineGradientStyle(), beginFill(), - * beginGradientFill(), or beginBitmapFill() - * method. - * - * @param x The x location of the center of the circle relative - * to the registration point of the parent display object(in - * pixels). - * @param y The y location of the center of the circle relative - * to the registration point of the parent display object(in - * pixels). - * @param radius The radius of the circle(in pixels). - */ - Graphics.prototype.drawCircle = function (x, y, radius) { - }; - - /** - * Draws an ellipse. Set the line style, fill, or both before you call the - * drawEllipse() method, by calling the - * linestyle(), lineGradientStyle(), - * beginFill(), beginGradientFill(), or - * beginBitmapFill() method. - * - * @param x The x location of the top-left of the bounding-box of - * the ellipse relative to the registration point of the parent - * display object(in pixels). - * @param y The y location of the top left of the bounding-box of - * the ellipse relative to the registration point of the parent - * display object(in pixels). - * @param width The width of the ellipse(in pixels). - * @param height The height of the ellipse(in pixels). - */ - Graphics.prototype.drawEllipse = function (x, y, width, height) { - }; - - /** - * Submits a series of IGraphicsData instances for drawing. This method - * accepts a Vector containing objects including paths, fills, and strokes - * that implement the IGraphicsData interface. A Vector of IGraphicsData - * instances can refer to a part of a shape, or a complex fully defined set - * of data for rendering a complete shape. - * - *

Graphics paths can contain other graphics paths. If the - * graphicsData Vector includes a path, that path and all its - * sub-paths are rendered during this operation.

- * - */ - Graphics.prototype.drawGraphicsData = function (graphicsData) { - }; - - /** - * Submits a series of commands for drawing. The drawPath() - * method uses vector arrays to consolidate individual moveTo(), - * lineTo(), and curveTo() drawing commands into a - * single call. The drawPath() method parameters combine drawing - * commands with x- and y-coordinate value pairs and a drawing direction. The - * drawing commands are values from the GraphicsPathCommand class. The x- and - * y-coordinate value pairs are Numbers in an array where each pair defines a - * coordinate location. The drawing direction is a value from the - * GraphicsPathWinding class. - * - *

Generally, drawings render faster with drawPath() than - * with a series of individual lineTo() and - * curveTo() methods.

- * - *

The drawPath() method uses a uses a floating computation - * so rotation and scaling of shapes is more accurate and gives better - * results. However, curves submitted using the drawPath() - * method can have small sub-pixel alignment errors when used in conjunction - * with the lineTo() and curveTo() methods.

- * - *

The drawPath() method also uses slightly different rules - * for filling and drawing lines. They are:

- * - *
    - *
  • When a fill is applied to rendering a path: - *
      - *
    • A sub-path of less than 3 points is not rendered.(But note that the - * stroke rendering will still occur, consistent with the rules for strokes - * below.)
    • - *
    • A sub-path that isn't closed(the end point is not equal to the - * begin point) is implicitly closed.
    • - *
    - *
  • - *
  • When a stroke is applied to rendering a path: - *
      - *
    • The sub-paths can be composed of any number of points.
    • - *
    • The sub-path is never implicitly closed.
    • - *
    - *
  • - *
- * - * @param winding Specifies the winding rule using a value defined in the - * GraphicsPathWinding class. - */ - Graphics.prototype.drawPath = function (commands, data, winding) { - }; - - /** - * Draws a rectangle. Set the line style, fill, or both before you call the - * drawRect() method, by calling the linestyle(), - * lineGradientStyle(), beginFill(), - * beginGradientFill(), or beginBitmapFill() - * method. - * - * @param x A number indicating the horizontal position relative to the - * registration point of the parent display object(in pixels). - * @param y A number indicating the vertical position relative to the - * registration point of the parent display object(in pixels). - * @param width The width of the rectangle(in pixels). - * @param height The height of the rectangle(in pixels). - * @throws ArgumentError If the width or height - * parameters are not a number - * (Number.NaN). - */ - Graphics.prototype.drawRect = function (x, y, width, height) { - }; - - /** - * Draws a rounded rectangle. Set the line style, fill, or both before you - * call the drawRoundRect() method, by calling the - * linestyle(), lineGradientStyle(), - * beginFill(), beginGradientFill(), or - * beginBitmapFill() method. - * - * @param x A number indicating the horizontal position relative - * to the registration point of the parent display - * object(in pixels). - * @param y A number indicating the vertical position relative to - * the registration point of the parent display object - * (in pixels). - * @param width The width of the round rectangle(in pixels). - * @param height The height of the round rectangle(in pixels). - * @param ellipseWidth The width of the ellipse used to draw the rounded - * corners(in pixels). - * @param ellipseHeight The height of the ellipse used to draw the rounded - * corners(in pixels). Optional; if no value is - * specified, the default value matches that provided - * for the ellipseWidth parameter. - * @throws ArgumentError If the width, height, - * ellipseWidth or - * ellipseHeight parameters are not a - * number(Number.NaN). - */ - Graphics.prototype.drawRoundRect = function (x, y, width, height, ellipseWidth, ellipseHeight) { - if (typeof ellipseHeight === "undefined") { ellipseHeight = NaN; } - }; - - //public drawRoundRectComplex(x:Float, y:Float, width:Float, height:Float, topLeftRadius:Float, topRightRadius:Float, bottomLeftRadius:Float, bottomRightRadius:Float):Void; - /** - * Renders a set of triangles, typically to distort bitmaps and give them a - * three-dimensional appearance. The drawTriangles() method maps - * either the current fill, or a bitmap fill, to the triangle faces using a - * set of(u,v) coordinates. - * - *

Any type of fill can be used, but if the fill has a transform matrix - * that transform matrix is ignored.

- * - *

A uvtData parameter improves texture mapping when a - * bitmap fill is used.

- * - * @param culling Specifies whether to render triangles that face in a - * specified direction. This parameter prevents the rendering - * of triangles that cannot be seen in the current view. This - * parameter can be set to any value defined by the - * TriangleCulling class. - */ - Graphics.prototype.drawTriangles = function (vertices, indices, uvtData, culling) { - if (typeof indices === "undefined") { indices = null; } - if (typeof uvtData === "undefined") { uvtData = null; } - if (typeof culling === "undefined") { culling = null; } - }; - - /** - * Applies a fill to the lines and curves that were added since the last call - * to the beginFill(), beginGradientFill(), or - * beginBitmapFill() method. Flash uses the fill that was - * specified in the previous call to the beginFill(), - * beginGradientFill(), or beginBitmapFill() - * method. If the current drawing position does not equal the previous - * position specified in a moveTo() method and a fill is - * defined, the path is closed with a line and then filled. - * - */ - Graphics.prototype.endFill = function () { - }; - - /** - * Specifies a bitmap to use for the line stroke when drawing lines. - * - *

The bitmap line style is used for subsequent calls to Graphics methods - * such as the lineTo() method or the drawCircle() - * method. The line style remains in effect until you call the - * lineStyle() or lineGradientStyle() methods, or - * the lineBitmapStyle() method again with different parameters. - *

- * - *

You can call the lineBitmapStyle() method in the middle of - * drawing a path to specify different styles for different line segments - * within a path.

- * - *

Call the lineStyle() method before you call the - * lineBitmapStyle() method to enable a stroke, or else the - * value of the line style is undefined.

- * - *

Calls to the clear() method set the line style back to - * undefined.

- * - * @param bitmap The bitmap to use for the line stroke. - * @param matrix An optional transformation matrix as defined by the - * flash.geom.Matrix class. The matrix can be used to scale or - * otherwise manipulate the bitmap before applying it to the - * line style. - * @param repeat Whether to repeat the bitmap in a tiled fashion. - * @param smooth Whether smoothing should be applied to the bitmap. - */ - Graphics.prototype.lineBitmapStyle = function (bitmap, matrix, repeat, smooth) { - if (typeof matrix === "undefined") { matrix = null; } - if (typeof repeat === "undefined") { repeat = true; } - if (typeof smooth === "undefined") { smooth = false; } - }; - - /** - * Specifies a gradient to use for the stroke when drawing lines. - * - *

The gradient line style is used for subsequent calls to Graphics - * methods such as the lineTo() methods or the - * drawCircle() method. The line style remains in effect until - * you call the lineStyle() or lineBitmapStyle() - * methods, or the lineGradientStyle() method again with - * different parameters.

- * - *

You can call the lineGradientStyle() method in the middle - * of drawing a path to specify different styles for different line segments - * within a path.

- * - *

Call the lineStyle() method before you call the - * lineGradientStyle() method to enable a stroke, or else the - * value of the line style is undefined.

- * - *

Calls to the clear() method set the line style back to - * undefined.

- * - * @param type A value from the GradientType class that - * specifies which gradient type to use, either - * GradientType.LINEAR or GradientType.RADIAL. - * @param colors An array of RGB hexadecimal color values used - * in the gradient; for example, red is 0xFF0000, - * blue is 0x0000FF, and so on. You can specify - * up to 15 colors. For each color, specify a - * corresponding value in the alphas and ratios - * parameters. - * @param alphas An array of alpha values for the corresponding - * colors in the colors array; valid values are 0 - * to 1. If the value is less than 0, the default - * is 0. If the value is greater than 1, the - * default is 1. - * @param ratios An array of color distribution ratios; valid - * values are 0-255. This value defines the - * percentage of the width where the color is - * sampled at 100%. The value 0 represents the - * left position in the gradient box, and 255 - * represents the right position in the gradient - * box. - * @param matrix A transformation matrix as defined by the - * flash.geom.Matrix class. The flash.geom.Matrix - * class includes a - * createGradientBox() method, which - * lets you conveniently set up the matrix for use - * with the lineGradientStyle() - * method. - * @param spreadMethod A value from the SpreadMethod class that - * specifies which spread method to use: - * @param interpolationMethod A value from the InterpolationMethod class that - * specifies which value to use. For example, - * consider a simple linear gradient between two - * colors(with the spreadMethod - * parameter set to - * SpreadMethod.REFLECT). The - * different interpolation methods affect the - * appearance as follows: - * @param focalPointRatio A number that controls the location of the - * focal point of the gradient. The value 0 means - * the focal point is in the center. The value 1 - * means the focal point is at one border of the - * gradient circle. The value -1 means that the - * focal point is at the other border of the - * gradient circle. Values less than -1 or greater - * than 1 are rounded to -1 or 1. The following - * image shows a gradient with a - * focalPointRatio of -0.75: - */ - Graphics.prototype.lineGradientStyle = function (type, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio) { - if (typeof matrix === "undefined") { matrix = null; } - if (typeof spreadMethod === "undefined") { spreadMethod = null; } - if (typeof interpolationMethod === "undefined") { interpolationMethod = null; } - if (typeof focalPointRatio === "undefined") { focalPointRatio = 0; } - }; - - /** - * Specifies a shader to use for the line stroke when drawing lines. - * - *

The shader line style is used for subsequent calls to Graphics methods - * such as the lineTo() method or the drawCircle() - * method. The line style remains in effect until you call the - * lineStyle() or lineGradientStyle() methods, or - * the lineBitmapStyle() method again with different parameters. - *

- * - *

You can call the lineShaderStyle() method in the middle of - * drawing a path to specify different styles for different line segments - * within a path.

- * - *

Call the lineStyle() method before you call the - * lineShaderStyle() method to enable a stroke, or else the - * value of the line style is undefined.

- * - *

Calls to the clear() method set the line style back to - * undefined.

- * - * @param shader The shader to use for the line stroke. - * @param matrix An optional transformation matrix as defined by the - * flash.geom.Matrix class. The matrix can be used to scale or - * otherwise manipulate the bitmap before applying it to the - * line style. - */ - // public lineShaderStyle(shader:Shader, matrix:away.geom.Matrix = null) - // { - // - // } - /** - * Specifies a line style used for subsequent calls to Graphics methods such - * as the lineTo() method or the drawCircle() - * method. The line style remains in effect until you call the - * lineGradientStyle() method, the - * lineBitmapStyle() method, or the lineStyle() - * method with different parameters. - * - *

You can call the lineStyle() method in the middle of - * drawing a path to specify different styles for different line segments - * within the path.

- * - *

Note: Calls to the clear() method set the line - * style back to undefined.

- * - *

Note: Flash Lite 4 supports only the first three parameters - * (thickness, color, and alpha).

- * - * @param thickness An integer that indicates the thickness of the line in - * points; valid values are 0-255. If a number is not - * specified, or if the parameter is undefined, a line is - * not drawn. If a value of less than 0 is passed, the - * default is 0. The value 0 indicates hairline - * thickness; the maximum thickness is 255. If a value - * greater than 255 is passed, the default is 255. - * @param color A hexadecimal color value of the line; for example, - * red is 0xFF0000, blue is 0x0000FF, and so on. If a - * value is not indicated, the default is 0x000000 - * (black). Optional. - * @param alpha A number that indicates the alpha value of the color - * of the line; valid values are 0 to 1. If a value is - * not indicated, the default is 1(solid). If the value - * is less than 0, the default is 0. If the value is - * greater than 1, the default is 1. - * @param pixelHinting(Not supported in Flash Lite 4) A Boolean value that - * specifies whether to hint strokes to full pixels. This - * affects both the position of anchors of a curve and - * the line stroke size itself. With - * pixelHinting set to true, - * line widths are adjusted to full pixel widths. With - * pixelHinting set to false, - * disjoints can appear for curves and straight lines. - * For example, the following illustrations show how - * Flash Player or Adobe AIR renders two rounded - * rectangles that are identical, except that the - * pixelHinting parameter used in the - * lineStyle() method is set differently - * (the images are scaled by 200%, to emphasize the - * difference): - * - *

If a value is not supplied, the line does not use - * pixel hinting.

- * @param scaleMode (Not supported in Flash Lite 4) A value from the - * LineScaleMode class that specifies which scale mode to - * use: - *
    - *
  • LineScaleMode.NORMAL - Always - * scale the line thickness when the object is scaled - * (the default).
  • - *
  • LineScaleMode.NONE - Never scale - * the line thickness.
  • - *
  • LineScaleMode.VERTICAL - Do not - * scale the line thickness if the object is scaled - * vertically only. For example, consider the - * following circles, drawn with a one-pixel line, and - * each with the scaleMode parameter set to - * LineScaleMode.VERTICAL. The circle on the - * left is scaled vertically only, and the circle on the - * right is scaled both vertically and horizontally: - *
  • - *
  • LineScaleMode.HORIZONTAL - Do not - * scale the line thickness if the object is scaled - * horizontally only. For example, consider the - * following circles, drawn with a one-pixel line, and - * each with the scaleMode parameter set to - * LineScaleMode.HORIZONTAL. The circle on - * the left is scaled horizontally only, and the circle - * on the right is scaled both vertically and - * horizontally:
  • - *
- * @param caps (Not supported in Flash Lite 4) A value from the - * CapsStyle class that specifies the type of caps at the - * end of lines. Valid values are: - * CapsStyle.NONE, - * CapsStyle.ROUND, and - * CapsStyle.SQUARE. If a value is not - * indicated, Flash uses round caps. - * - *

For example, the following illustrations show the - * different capsStyle settings. For each - * setting, the illustration shows a blue line with a - * thickness of 30(for which the capsStyle - * applies), and a superimposed black line with a - * thickness of 1(for which no capsStyle - * applies):

- * @param joints (Not supported in Flash Lite 4) A value from the - * JointStyle class that specifies the type of joint - * appearance used at angles. Valid values are: - * JointStyle.BEVEL, - * JointStyle.MITER, and - * JointStyle.ROUND. If a value is not - * indicated, Flash uses round joints. - * - *

For example, the following illustrations show the - * different joints settings. For each - * setting, the illustration shows an angled blue line - * with a thickness of 30(for which the - * jointStyle applies), and a superimposed - * angled black line with a thickness of 1(for which no - * jointStyle applies):

- * - *

Note: For joints set to - * JointStyle.MITER, you can use the - * miterLimit parameter to limit the length - * of the miter.

- * @param miterLimit (Not supported in Flash Lite 4) A number that - * indicates the limit at which a miter is cut off. Valid - * values range from 1 to 255(and values outside that - * range are rounded to 1 or 255). This value is only - * used if the jointStyle is set to - * "miter". The miterLimit - * value represents the length that a miter can extend - * beyond the point at which the lines meet to form a - * joint. The value expresses a factor of the line - * thickness. For example, with a - * miterLimit factor of 2.5 and a - * thickness of 10 pixels, the miter is cut - * off at 25 pixels. - * - *

For example, consider the following angled lines, - * each drawn with a thickness of 20, but - * with miterLimit set to 1, 2, and 4. - * Superimposed are black reference lines showing the - * meeting points of the joints:

- * - *

Notice that a given miterLimit value - * has a specific maximum angle for which the miter is - * cut off. The following table lists some examples:

- */ - Graphics.prototype.lineStyle = function (thickness, color, alpha, pixelHinting, scaleMode, caps, joints, miterLimit) { - if (typeof thickness === "undefined") { thickness = 0; } - if (typeof color === "undefined") { color = 0; } - if (typeof alpha === "undefined") { alpha = 1; } - if (typeof pixelHinting === "undefined") { pixelHinting = false; } - if (typeof scaleMode === "undefined") { scaleMode = null; } - if (typeof caps === "undefined") { caps = null; } - if (typeof joints === "undefined") { joints = null; } - if (typeof miterLimit === "undefined") { miterLimit = 3; } - }; - - /** - * Draws a line using the current line style from the current drawing - * position to(x, y); the current drawing position - * is then set to(x, y). If the display object in - * which you are drawing contains content that was created with the Flash - * drawing tools, calls to the lineTo() method are drawn - * underneath the content. If you call lineTo() before any calls - * to the moveTo() method, the default position for the current - * drawing is(0, 0). If any of the parameters are missing, this - * method fails and the current drawing position is not changed. - * - * @param x A number that indicates the horizontal position relative to the - * registration point of the parent display object(in pixels). - * @param y A number that indicates the vertical position relative to the - * registration point of the parent display object(in pixels). - */ - Graphics.prototype.lineTo = function (x, y) { - }; - - /** - * Moves the current drawing position to(x, y). If - * any of the parameters are missing, this method fails and the current - * drawing position is not changed. - * - * @param x A number that indicates the horizontal position relative to the - * registration point of the parent display object(in pixels). - * @param y A number that indicates the vertical position relative to the - * registration point of the parent display object(in pixels). - */ - Graphics.prototype.moveTo = function (x, y) { - }; - return Graphics; - })(); - base.Graphics = Graphics; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The GraphicsPathWinding class provides values for the - * flash.display.GraphicsPath.winding property and the - * flash.display.Graphics.drawPath() method to determine the - * direction to draw a path. A clockwise path is positively wound, and a - * counter-clockwise path is negatively wound: - * - *

When paths intersect or overlap, the winding direction determines the - * rules for filling the areas created by the intersection or overlap:

- */ - (function (base) { - var GraphicsPathWinding = (function () { - function GraphicsPathWinding() { - } - GraphicsPathWinding.EVEN_ODD = "evenOdd"; - GraphicsPathWinding.NON_ZERO = "nonZero"; - return GraphicsPathWinding; - })(); - base.GraphicsPathWinding = GraphicsPathWinding; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -/// -/// -var away; -(function (away) { - /** - * @module away.base - */ - (function (base) { - - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The InterpolationMethod class provides values for the - * interpolationMethod parameter in the - * Graphics.beginGradientFill() and - * Graphics.lineGradientStyle() methods. This parameter - * determines the RGB space to use when rendering the gradient. - */ - (function (base) { - var InterpolationMethod = (function () { - function InterpolationMethod() { - } - InterpolationMethod.LINEAR_RGB = "linearRGB"; - - InterpolationMethod.RGB = "rgb"; - return InterpolationMethod; - })(); - base.InterpolationMethod = InterpolationMethod; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.base - */ - (function (base) { - - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.base - */ - (function (base) { - - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.base - */ - (function (base) { - /** - * @class away.base.TriangleSubGeometry - */ - var SubGeometryBase = (function (_super) { - __extends(SubGeometryBase, _super); - /** - * - */ - function SubGeometryBase(concatenatedArrays) { - _super.call(this); - this._pStrideOffsetDirty = true; - this._pConcatenateArrays = true; - this._pStride = new Object(); - this._pOffset = new Object(); - - this._pConcatenateArrays = concatenatedArrays; - } - SubGeometryBase.prototype._pUpdateStrideOffset = function () { - throw new away.errors.AbstractMethodError(); - }; - - Object.defineProperty(SubGeometryBase.prototype, "subMeshClass", { - get: function () { - return this._pSubMeshClass; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(SubGeometryBase.prototype, "concatenateArrays", { - /** - * - */ - get: function () { - return this._pConcatenateArrays; - }, - set: function (value) { - if (this._pConcatenateArrays == value) - return; - - this._pConcatenateArrays = value; - - this._pStrideOffsetDirty = true; - - if (value) - this._pNotifyVerticesUpdate(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(SubGeometryBase.prototype, "indices", { - /** - * The raw index data that define the faces. - */ - get: function () { - return this._pIndices; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(SubGeometryBase.prototype, "vertices", { - /** - * - */ - get: function () { - this.updateVertices(); - - return this._pVertices; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(SubGeometryBase.prototype, "numTriangles", { - /** - * The total amount of triangles in the TriangleSubGeometry. - */ - get: function () { - return this._numTriangles; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(SubGeometryBase.prototype, "numVertices", { - get: function () { - return this._pNumVertices; - }, - enumerable: true, - configurable: true - }); - - /** - * - */ - SubGeometryBase.prototype.getStride = function (dataType) { - if (this._pStrideOffsetDirty) - this._pUpdateStrideOffset(); - - return this._pStride[dataType]; - }; - - /** - * - */ - SubGeometryBase.prototype.getOffset = function (dataType) { - if (this._pStrideOffsetDirty) - this._pUpdateStrideOffset(); - - return this._pOffset[dataType]; - }; - - SubGeometryBase.prototype.updateVertices = function () { - throw new away.errors.AbstractMethodError(); - }; - - /** - * - */ - SubGeometryBase.prototype.dispose = function () { - this._pIndices = null; - this._pVertices = null; - }; - - /** - * Updates the face indices of the TriangleSubGeometry. - * - * @param indices The face indices to upload. - */ - SubGeometryBase.prototype.updateIndices = function (indices) { - this._pIndices = indices; - this._numIndices = indices.length; - - this._numTriangles = this._numIndices / 3; - - this.notifyIndicesUpdate(); - }; - - /** - * @protected - */ - SubGeometryBase.prototype.pInvalidateBounds = function () { - if (this.parentGeometry) - this.parentGeometry.iInvalidateBounds(this); - }; - - /** - * Clones the current object - * @return An exact duplicate of the current object. - */ - SubGeometryBase.prototype.clone = function () { - throw new away.errors.AbstractMethodError(); - }; - - SubGeometryBase.prototype.applyTransformation = function (transform) { - }; - - /** - * Scales the geometry. - * @param scale The amount by which to scale. - */ - SubGeometryBase.prototype.scale = function (scale) { - }; - - SubGeometryBase.prototype.scaleUV = function (scaleU, scaleV) { - if (typeof scaleU === "undefined") { scaleU = 1; } - if (typeof scaleV === "undefined") { scaleV = 1; } - }; - - SubGeometryBase.prototype.getBoundingPositions = function () { - throw new away.errors.AbstractMethodError(); - }; - - SubGeometryBase.prototype.notifyIndicesUpdate = function () { - if (!this._indicesUpdated) - this._indicesUpdated = new away.events.SubGeometryEvent(away.events.SubGeometryEvent.INDICES_UPDATED); - - this.dispatchEvent(this._indicesUpdated); - }; - - SubGeometryBase.prototype._pNotifyVerticesUpdate = function () { - throw new away.errors.AbstractMethodError(); - }; - SubGeometryBase.VERTEX_DATA = "vertices"; - return SubGeometryBase; - })(away.library.NamedAssetBase); - base.SubGeometryBase = SubGeometryBase; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.base - */ - (function (base) { - /** - * SubMeshBase wraps a TriangleSubGeometry as a scene graph instantiation. A SubMeshBase is owned by a Mesh object. - * - * - * @see away.base.TriangleSubGeometry - * @see away.entities.Mesh - * - * @class away.base.SubMeshBase - */ - var SubMeshBase = (function (_super) { - __extends(SubMeshBase, _super); - /** - * Creates a new SubMeshBase object - */ - function SubMeshBase() { - _super.call(this); - this._iIndex = 0; - this._renderables = new Array(); - } - Object.defineProperty(SubMeshBase.prototype, "animator", { - //TODO test shader picking - // public get shaderPickingDetails():boolean - // { - // - // return this.sourceEntity.shaderPickingDetails; - // } - /** - * The animator object that provides the state for the TriangleSubMesh's animation. - */ - get: function () { - return this._pParentMesh.animator; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(SubMeshBase.prototype, "material", { - /** - * The material used to render the current TriangleSubMesh. If set to null, its parent Mesh's material will be used instead. - */ - get: function () { - return this._material || this._pParentMesh.material; - }, - set: function (value) { - if (this.material) - this.material.iRemoveOwner(this); - - this._material = value; - - if (this.material) - this.material.iAddOwner(this); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(SubMeshBase.prototype, "sceneTransform", { - /** - * The scene transform object that transforms from model to world space. - */ - get: function () { - return this._pParentMesh.sceneTransform; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(SubMeshBase.prototype, "parentMesh", { - /** - * The entity that that initially provided the IRenderable to the render pipeline (ie: the owning Mesh object). - */ - get: function () { - return this._pParentMesh; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(SubMeshBase.prototype, "uvTransform", { - /** - * - */ - get: function () { - return this._uvTransform || this._pParentMesh.uvTransform; - }, - set: function (value) { - this._uvTransform = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * - */ - SubMeshBase.prototype.dispose = function () { - this.material = null; - - var len = this._renderables.length; - for (var i = 0; i < len; i++) - this._renderables[i].dispose(); - }; - - /** - * - * @param camera - * @returns {away.geom.Matrix3D} - */ - SubMeshBase.prototype.getRenderSceneTransform = function (camera) { - return this._pParentMesh.getRenderSceneTransform(camera); - }; - - SubMeshBase.prototype._iAddRenderable = function (renderable) { - this._renderables.push(renderable); - - return renderable; - }; - - SubMeshBase.prototype._iRemoveRenderable = function (renderable) { - var index = this._renderables.indexOf(renderable); - - this._renderables.splice(index, 1); - - return renderable; - }; - - SubMeshBase.prototype._iInvalidateRenderableGeometry = function () { - var len = this._renderables.length; - for (var i = 0; i < len; i++) - this._renderables[i].invalidateGeometry(); - }; - - SubMeshBase.prototype._iCollectRenderable = function (renderer) { - throw new away.errors.AbstractMethodError(); - }; - - SubMeshBase.prototype._iGetExplicitMaterial = function () { - return this._material; - }; - return SubMeshBase; - })(away.library.NamedAssetBase); - base.SubMeshBase = SubMeshBase; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The JointStyle class is an enumeration of constant values that specify the - * joint style to use in drawing lines. These constants are provided for use - * as values in the joints parameter of the - * flash.display.Graphics.lineStyle() method. The method supports - * three types of joints: miter, round, and bevel, as the following example - * shows: - */ - (function (base) { - var JointStyle = (function () { - function JointStyle() { - } - JointStyle.BEVEL = "bevel"; - - JointStyle.MITER = "miter"; - - JointStyle.ROUND = "round"; - return JointStyle; - })(); - base.JointStyle = JointStyle; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The LineScaleMode class provides values for the scaleMode - * parameter in the Graphics.lineStyle() method. - */ - (function (base) { - var LineScaleMode = (function () { - function LineScaleMode() { - } - LineScaleMode.HORIZONTAL = "horizontal"; - - LineScaleMode.NONE = "none"; - - LineScaleMode.NORMAL = "normal"; - - LineScaleMode.VERTICAL = "vertical"; - return LineScaleMode; - })(); - base.LineScaleMode = LineScaleMode; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.base - */ - (function (base) { - /** - * @class away.base.TriangleSubGeometry - */ - var LineSubGeometry = (function (_super) { - __extends(LineSubGeometry, _super); - /** - * - */ - function LineSubGeometry() { - _super.call(this, true); - this._positionsDirty = true; - this._boundingPositionDirty = true; - this._thicknessDirty = true; - this._colorsDirty = true; - - this._pSubMeshClass = base.LineSubMesh; - } - LineSubGeometry.prototype._pUpdateStrideOffset = function () { - this._pOffset[LineSubGeometry.VERTEX_DATA] = 0; - - var stride = 0; - this._pOffset[LineSubGeometry.START_POSITION_DATA] = stride; - stride += 3; - - this._pOffset[LineSubGeometry.END_POSITION_DATA] = stride; - stride += 3; - - this._pOffset[LineSubGeometry.THICKNESS_DATA] = stride; - stride += 1; - - this._pOffset[LineSubGeometry.COLOR_DATA] = stride; - stride += 4; - - this._pStride[LineSubGeometry.VERTEX_DATA] = stride; - this._pStride[LineSubGeometry.START_POSITION_DATA] = stride; - this._pStride[LineSubGeometry.END_POSITION_DATA] = stride; - this._pStride[LineSubGeometry.THICKNESS_DATA] = stride; - this._pStride[LineSubGeometry.COLOR_DATA] = stride; - - var len = this._pNumVertices * stride; - - if (this._pVertices == null) - this._pVertices = new Array(len); - else if (this._pVertices.length != len) - this._pVertices.length = len; - - this._pStrideOffsetDirty = false; - }; - - Object.defineProperty(LineSubGeometry.prototype, "vertices", { - /** - * - */ - get: function () { - if (this._positionsDirty) - this.updatePositions(this._startPositions, this._endPositions); - - if (this._thicknessDirty) - this.updateThickness(this._thickness); - - if (this._colorsDirty) - this.updateColors(this._startColors, this._endColors); - - return this._pVertices; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LineSubGeometry.prototype, "startPositions", { - /** - * - */ - get: function () { - if (this._positionsDirty) - this.updatePositions(this._startPositions, this._endPositions); - - return this._startPositions; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LineSubGeometry.prototype, "endPositions", { - /** - * - */ - get: function () { - if (this._positionsDirty) - this.updatePositions(this._startPositions, this._endPositions); - - return this._endPositions; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LineSubGeometry.prototype, "thickness", { - /** - * - */ - get: function () { - if (this._thicknessDirty) - this.updateThickness(this._thickness); - - return this._thickness; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LineSubGeometry.prototype, "startColors", { - /** - * - */ - get: function () { - if (this._colorsDirty) - this.updateColors(this._startColors, this._endColors); - - return this._startColors; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LineSubGeometry.prototype, "endColors", { - /** - * - */ - get: function () { - if (this._colorsDirty) - this.updateColors(this._startColors, this._endColors); - - return this._endColors; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LineSubGeometry.prototype, "numSegments", { - /** - * The total amount of segments in the TriangleSubGeometry. - */ - get: function () { - return this._numSegments; - }, - enumerable: true, - configurable: true - }); - - LineSubGeometry.prototype.getBoundingPositions = function () { - if (this._boundingPositionDirty) - this._boundingPositions = this.startPositions.concat(this.endPositions); - - return this._boundingPositions; - }; - - /** - * - */ - LineSubGeometry.prototype.updatePositions = function (startValues, endValues) { - var i; - var j; - var values; - var index; - var stride; - var positions; - var indices; - - this._startPositions = startValues; - - if (this._startPositions == null) - this._startPositions = new Array(); - - this._endPositions = endValues; - - if (this._endPositions == null) - this._endPositions = new Array(); - - this._boundingPositionDirty = true; - - this._numSegments = this._startPositions.length / 3; - - this._pNumVertices = this._numSegments * 4; - - var lenV = this._pNumVertices * this.getStride(LineSubGeometry.VERTEX_DATA); - - if (this._pVertices == null) - this._pVertices = new Array(lenV); - else if (this._pVertices.length != lenV) - this._pVertices.length = lenV; - - i = 0; - j = 0; - index = this.getOffset(LineSubGeometry.START_POSITION_DATA); - stride = this.getStride(LineSubGeometry.START_POSITION_DATA); - positions = this._pVertices; - indices = new Array(); - - while (i < startValues.length) { - values = (index / stride & 1) ? endValues : startValues; - positions[index] = values[i]; - positions[index + 1] = values[i + 1]; - positions[index + 2] = values[i + 2]; - - values = (index / stride & 1) ? startValues : endValues; - positions[index + 3] = values[i]; - positions[index + 4] = values[i + 1]; - positions[index + 5] = values[i + 2]; - - if (++j == 4) { - var o = index / stride - 3; - indices.push(o, o + 1, o + 2, o + 3, o + 2, o + 1); - j = 0; - i += 3; - } - - index += stride; - } - - this.updateIndices(indices); - - this.pInvalidateBounds(); - - this.notifyPositionsUpdate(); - - this._positionsDirty = false; - }; - - /** - * Updates the thickness. - */ - LineSubGeometry.prototype.updateThickness = function (values) { - var i; - var j; - var index; - var offset; - var stride; - var thickness; - - this._thickness = values; - - if (values != null) { - i = 0; - j = 0; - offset = this.getOffset(LineSubGeometry.THICKNESS_DATA); - stride = this.getStride(LineSubGeometry.THICKNESS_DATA); - thickness = this._pVertices; - - index = offset; - while (i < values.length) { - thickness[index] = (Math.floor(0.5 * (index - offset) / stride + 0.5) & 1) ? -values[i] : values[i]; - - if (++j == 4) { - j = 0; - i++; - } - index += stride; - } - } - - this.notifyThicknessUpdate(); - - this._thicknessDirty = false; - }; - - /** - * - */ - LineSubGeometry.prototype.updateColors = function (startValues, endValues) { - var i; - var j; - var values; - var index; - var offset; - var stride; - var colors; - - this._startColors = startValues; - - this._endColors = endValues; - - //default to white - if (this._startColors == null) { - this._startColors = new Array(this._numSegments * 4); - - i = 0; - while (i < this._startColors.length) - this._startColors[i++] = 1; - } - - if (this._endColors == null) { - this._endColors = new Array(this._numSegments * 4); - - i = 0; - while (i < this._endColors.length) - this._endColors[i++] = 1; - } - - i = 0; - j = 0; - offset = this.getOffset(LineSubGeometry.COLOR_DATA); - stride = this.getStride(LineSubGeometry.COLOR_DATA); - colors = this._pVertices; - - index = offset; - - while (i < this._startColors.length) { - values = ((index - offset) / stride & 1) ? this._endColors : this._startColors; - colors[index] = values[i]; - colors[index + 1] = values[i + 1]; - colors[index + 2] = values[i + 2]; - colors[index + 3] = values[i + 3]; - - if (++j == 4) { - j = 0; - i += 4; - } - - index += stride; - } - - this.notifyColorsUpdate(); - - this._colorsDirty = false; - }; - - /** - * - */ - LineSubGeometry.prototype.dispose = function () { - _super.prototype.dispose.call(this); - - this._startPositions = null; - this._endPositions = null; - this._thickness = null; - this._startColors = null; - this._endColors = null; - }; - - /** - * @protected - */ - LineSubGeometry.prototype.pInvalidateBounds = function () { - if (this.parentGeometry) - this.parentGeometry.iInvalidateBounds(this); - }; - - /** - * Clones the current object - * @return An exact duplicate of the current object. - */ - LineSubGeometry.prototype.clone = function () { - var clone = new LineSubGeometry(); - clone.updateIndices(this._pIndices.concat()); - clone.updatePositions(this._startPositions.concat(), this._endPositions.concat()); - clone.updateThickness(this._thickness.concat()); - clone.updatePositions(this._startPositions.concat(), this._endPositions.concat()); - - return clone; - }; - - LineSubGeometry.prototype._pNotifyVerticesUpdate = function () { - this._pStrideOffsetDirty = true; - - this.notifyPositionsUpdate(); - this.notifyThicknessUpdate(); - this.notifyColorsUpdate(); - }; - - LineSubGeometry.prototype.notifyPositionsUpdate = function () { - if (this._positionsDirty) - return; - - this._positionsDirty = true; - - if (!this._positionsUpdated) - this._positionsUpdated = new away.events.SubGeometryEvent(away.events.SubGeometryEvent.VERTICES_UPDATED, base.TriangleSubGeometry.POSITION_DATA); - - this.dispatchEvent(this._positionsUpdated); - }; - - LineSubGeometry.prototype.notifyThicknessUpdate = function () { - if (this._thicknessDirty) - return; - - this._thicknessDirty = true; - - if (!this._thicknessUpdated) - this._thicknessUpdated = new away.events.SubGeometryEvent(away.events.SubGeometryEvent.VERTICES_UPDATED, LineSubGeometry.THICKNESS_DATA); - - this.dispatchEvent(this._thicknessUpdated); - }; - - LineSubGeometry.prototype.notifyColorsUpdate = function () { - if (this._colorsDirty) - return; - - this._colorsDirty = true; - - if (!this._colorUpdated) - this._colorUpdated = new away.events.SubGeometryEvent(away.events.SubGeometryEvent.VERTICES_UPDATED, LineSubGeometry.COLOR_DATA); - - this.dispatchEvent(this._colorUpdated); - }; - LineSubGeometry.VERTEX_DATA = "vertices"; - LineSubGeometry.START_POSITION_DATA = "startPositions"; - LineSubGeometry.END_POSITION_DATA = "endPositions"; - LineSubGeometry.THICKNESS_DATA = "thickness"; - LineSubGeometry.COLOR_DATA = "colors"; - - LineSubGeometry.POSITION_FORMAT = "float3"; - LineSubGeometry.COLOR_FORMAT = "float4"; - LineSubGeometry.THICKNESS_FORMAT = "float1"; - return LineSubGeometry; - })(base.SubGeometryBase); - base.LineSubGeometry = LineSubGeometry; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.base - */ - (function (base) { - var AssetType = away.library.AssetType; - - /** - * LineSubMesh wraps a LineSubGeometry as a scene graph instantiation. A LineSubMesh is owned by a Mesh object. - * - * - * @see away.base.LineSubGeometry - * @see away.entities.Mesh - * - * @class away.base.LineSubMesh - */ - var LineSubMesh = (function (_super) { - __extends(LineSubMesh, _super); - /** - * Creates a new LineSubMesh object - * @param subGeometry The LineSubGeometry object which provides the geometry data for this LineSubMesh. - * @param parentMesh The Mesh object to which this LineSubMesh belongs. - * @param material An optional material used to render this LineSubMesh. - */ - function LineSubMesh(subGeometry, parentMesh, material) { - if (typeof material === "undefined") { material = null; } - _super.call(this); - - this._pParentMesh = parentMesh; - this._subGeometry = subGeometry; - this.material = material; - } - Object.defineProperty(LineSubMesh.prototype, "assetType", { - /** - * - */ - get: function () { - return AssetType.LINE_SUB_MESH; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LineSubMesh.prototype, "subGeometry", { - /** - * The LineSubGeometry object which provides the geometry data for this LineSubMesh. - */ - get: function () { - return this._subGeometry; - }, - enumerable: true, - configurable: true - }); - - /** - * - */ - LineSubMesh.prototype.dispose = function () { - this.material = null; - - _super.prototype.dispose.call(this); - }; - - LineSubMesh.prototype._iCollectRenderable = function (renderer) { - renderer.applyLineSubMesh(this); - }; - return LineSubMesh; - })(base.SubMeshBase); - base.LineSubMesh = LineSubMesh; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The LoaderInfo class provides information about a loaded SWF file or a - * loaded image file(JPEG, GIF, or PNG). LoaderInfo objects are available for - * any display object. The information provided includes load progress, the - * URLs of the loader and loaded content, the number of bytes total for the - * media, and the nominal height and width of the media. - * - *

You can access LoaderInfo objects in two ways:

- * - *
    - *
  • The contentLoaderInfo property of a flash.display.Loader - * object - The contentLoaderInfo property is always available - * for any Loader object. For a Loader object that has not called the - * load() or loadBytes() method, or that has not - * sufficiently loaded, attempting to access many of the properties of the - * contentLoaderInfo property throws an error.
  • - *
  • The loaderInfo property of a display object.
  • - *
- * - *

The contentLoaderInfo property of a Loader object provides - * information about the content that the Loader object is loading, whereas - * the loaderInfo property of a DisplayObject provides - * information about the root SWF file for that display object.

- * - *

When you use a Loader object to load a display object(such as a SWF - * file or a bitmap), the loaderInfo property of the display - * object is the same as the contentLoaderInfo property of the - * Loader object(DisplayObject.loaderInfo = - * Loader.contentLoaderInfo). Because the instance of the main class of - * the SWF file has no Loader object, the loaderInfo property is - * the only way to access the LoaderInfo for the instance of the main class of - * the SWF file.

- * - *

The following diagram shows the different uses of the LoaderInfo - * object - for the instance of the main class of the SWF file, for the - * contentLoaderInfo property of a Loader object, and for the - * loaderInfo property of a loaded object:

- * - *

When a loading operation is not complete, some properties of the - * contentLoaderInfo property of a Loader object are not - * available. You can obtain some properties, such as - * bytesLoaded, bytesTotal, url, - * loaderURL, and applicationDomain. When the - * loaderInfo object dispatches the init event, you - * can access all properties of the loaderInfo object and the - * loaded image or SWF file.

- * - *

Note: All properties of LoaderInfo objects are read-only.

- * - *

The EventDispatcher.dispatchEvent() method is not - * applicable to LoaderInfo objects. If you call dispatchEvent() - * on a LoaderInfo object, an IllegalOperationError exception is thrown.

- * - * @event complete Dispatched when data has loaded successfully. In other - * words, it is dispatched when all the content has been - * downloaded and the loading has finished. The - * complete event is always dispatched after - * the init event. The init event - * is dispatched when the object is ready to access, though - * the content may still be downloading. - * @event httpStatus Dispatched when a network request is made over HTTP and - * an HTTP status code can be detected. - * @event init Dispatched when the properties and methods of a loaded - * SWF file are accessible and ready for use. The content, - * however, can still be downloading. A LoaderInfo object - * dispatches the init event when the following - * conditions exist: - *
    - *
  • All properties and methods associated with the - * loaded object and those associated with the LoaderInfo - * object are accessible.
  • - *
  • The constructors for all child objects have - * completed.
  • - *
  • All ActionScript code in the first frame of the - * loaded SWF's main timeline has been executed.
  • - *
- * - *

For example, an Event.INIT is dispatched - * when the first frame of a movie or animation is loaded. - * The movie is then accessible and can be added to the - * display list. The complete movie, however, can take - * longer to download. The Event.COMPLETE is - * only dispatched once the full movie is loaded.

- * - *

The init event always precedes the - * complete event.

- * @event ioError Dispatched when an input or output error occurs that - * causes a load operation to fail. - * @event open Dispatched when a load operation starts. - * @event progress Dispatched when data is received as the download - * operation progresses. - * @event unload Dispatched by a LoaderInfo object whenever a loaded - * object is removed by using the unload() - * method of the Loader object, or when a second load is - * performed by the same Loader object and the original - * content is removed prior to the load beginning. - */ - (function (base) { - var LoaderInfo = (function (_super) { - __extends(LoaderInfo, _super); - function LoaderInfo() { - _super.apply(this, arguments); - } - Object.defineProperty(LoaderInfo.prototype, "bytes", { - /** - * The bytes associated with a LoaderInfo object. - * - * @throws SecurityError If the object accessing this API is prevented from - * accessing the loaded object due to security - * restrictions. This situation can occur, for - * instance, when a Loader object attempts to access - * the contentLoaderInfo.content property - * and it is not granted security permission to access - * the loaded content. - * - *

For more information related to security, see the - * Flash Player Developer Center Topic: Security.

- */ - get: function () { - return this._bytes; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LoaderInfo.prototype, "bytesLoaded", { - /** - * The number of bytes that are loaded for the media. When this number equals - * the value of bytesTotal, all of the bytes are loaded. - */ - get: function () { - return this._bytesLoaded; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LoaderInfo.prototype, "bytesTotal", { - /** - * The number of compressed bytes in the entire media file. - * - *

Before the first progress event is dispatched by this - * LoaderInfo object's corresponding Loader object, bytesTotal - * is 0. After the first progress event from the Loader object, - * bytesTotal reflects the actual number of bytes to be - * downloaded.

- */ - get: function () { - return this._bytesTotal; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LoaderInfo.prototype, "content", { - /** - * The loaded object associated with this LoaderInfo object. - * - * @throws SecurityError If the object accessing this API is prevented from - * accessing the loaded object due to security - * restrictions. This situation can occur, for - * instance, when a Loader object attempts to access - * the contentLoaderInfo.content property - * and it is not granted security permission to access - * the loaded content. - * - *

For more information related to security, see the - * Flash Player Developer Center Topic: Security.

- */ - get: function () { - return this._content; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LoaderInfo.prototype, "contentType", { - /** - * The MIME type of the loaded file. The value is null if not - * enough of the file has loaded in order to determine the type. The - * following list gives the possible values: - *
    - *
  • "application/x-shockwave-flash"
  • - *
  • "image/jpeg"
  • - *
  • "image/gif"
  • - *
  • "image/png"
  • - *
- */ - get: function () { - return this._contentType; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LoaderInfo.prototype, "loader", { - /** - * The Loader object associated with this LoaderInfo object. If this - * LoaderInfo object is the loaderInfo property of the instance - * of the main class of the SWF file, no Loader object is associated. - * - * @throws SecurityError If the object accessing this API is prevented from - * accessing the Loader object because of security - * restrictions. This can occur, for instance, when a - * loaded SWF file attempts to access its - * loaderInfo.loader property and it is - * not granted security permission to access the - * loading SWF file. - * - *

For more information related to security, see the - * Flash Player Developer Center Topic: Security.

- */ - get: function () { - return this._loader; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LoaderInfo.prototype, "url", { - /** - * The URL of the media being loaded. - * - *

Before the first progress event is dispatched by this - * LoaderInfo object's corresponding Loader object, the value of the - * url property might reflect only the initial URL specified in - * the call to the load() method of the Loader object. After the - * first progress event, the url property reflects - * the media's final URL, after any redirects and relative URLs are - * resolved.

- * - *

In some cases, the value of the url property is truncated; - * see the isURLInaccessible property for details.

- */ - get: function () { - return this._url; - }, - enumerable: true, - configurable: true - }); - return LoaderInfo; - })(away.events.EventDispatcher); - base.LoaderInfo = LoaderInfo; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The PixelSnapping class is an enumeration of constant values for setting - * the pixel snapping options by using the pixelSnapping property - * of a Bitmap object. - */ - (function (base) { - var PixelSnapping = (function () { - function PixelSnapping() { - } - PixelSnapping.ALWAYS = "always"; - - PixelSnapping.AUTO = "auto"; - - PixelSnapping.NEVER = "never"; - return PixelSnapping; - })(); - base.PixelSnapping = PixelSnapping; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The SpreadMethod class provides values for the spreadMethod - * parameter in the beginGradientFill() and - * lineGradientStyle() methods of the Graphics class. - * - *

The following example shows the same gradient fill using various spread - * methods:

- */ - (function (base) { - var SpreadMethod = (function () { - function SpreadMethod() { - } - SpreadMethod.PAD = "pad"; - - SpreadMethod.REFLECT = "reflect"; - - SpreadMethod.REPEAT = "repeat"; - return SpreadMethod; - })(); - base.SpreadMethod = SpreadMethod; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (base) { - var ContextMode = away.display.ContextMode; - - var Event = away.events.Event; - var StageEvent = away.events.StageEvent; - var Rectangle = away.geom.Rectangle; - - var CSS = away.utils.CSS; - - /** - * Stage provides a proxy class to handle the creation and attachment of the Context - * (and in turn the back buffer) it uses. Stage should never be created directly, - * but requested through StageManager. - * - * @see away.managers.StageManager - * - */ - var Stage = (function (_super) { - __extends(Stage, _super); - function Stage(container, stageIndex, stageManager, forceSoftware, profile) { - if (typeof forceSoftware === "undefined") { forceSoftware = false; } - if (typeof profile === "undefined") { profile = "baseline"; } - _super.call(this); - this._x = 0; - this._y = 0; - //private static _frameEventDriver:Shape = new Shape(); // TODO: add frame driver / request animation frame - this._stageIndex = -1; - this._antiAlias = 0; - //private var _activeVertexBuffers : Vector. = new Vector.(8, true); - //private var _activeTextures : Vector. = new Vector.(8, true); - this._renderTarget = null; - this._renderSurfaceSelector = 0; - //private _mouse3DManager:away.managers.Mouse3DManager; - //private _touch3DManager:Touch3DManager; //TODO: imeplement dependency Touch3DManager - this._initialised = false; - - this._container = container; - - this._stageIndex = stageIndex; - - this._stageManager = stageManager; - - this._viewPort = new Rectangle(); - - this._enableDepthAndStencil = true; - - CSS.setElementX(this._container, 0); - CSS.setElementY(this._container, 0); - - this.visible = true; - } - /** - * Requests a Context object to attach to the managed gl canvas. - */ - Stage.prototype.requestContext = function (forceSoftware, profile, mode) { - // If forcing software, we can be certain that the - // returned Context will be running software mode. - // If not, we can't be sure and should stick to the - // old value (will likely be same if re-requesting.) - var _this = this; - if (typeof forceSoftware === "undefined") { forceSoftware = false; } - if (typeof profile === "undefined") { profile = "baseline"; } - if (typeof mode === "undefined") { mode = "auto"; } - if (this._usesSoftwareRendering != null) - this._usesSoftwareRendering = forceSoftware; - - this._profile = profile; - - try { - if (mode == ContextMode.FLASH) - new away["stagegl"]["ContextStage3D"](this._container, this._stageIndex, function (context) { - return _this._callback(context); - }); - else - this._context = new away["stagegl"]["ContextWebGL"](this._container, this._stageIndex); - } catch (e) { - try { - if (mode == ContextMode.AUTO) - new away["stagegl"]["ContextStage3D"](this._container, this._stageIndex, function (context) { - return _this._callback(context); - }); - else - this.dispatchEvent(new Event(Event.ERROR)); - } catch (e) { - this.dispatchEvent(new Event(Event.ERROR)); - } - } - - if (this._context) - this._callback(this._context); - }; - - Object.defineProperty(Stage.prototype, "width", { - /** - * The width of the gl canvas - */ - get: function () { - return this._width; - }, - set: function (val) { - if (this._width == val) - return; - - CSS.setElementWidth(this._container, val); - - this._width = this._viewPort.width = val; - - this._backBufferDirty = true; - - this.notifyViewportUpdated(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Stage.prototype, "height", { - /** - * The height of the gl canvas - */ - get: function () { - return this._height; - }, - set: function (val) { - if (this._height == val) - return; - - CSS.setElementHeight(this._container, val); - - this._height = this._viewPort.height = val; - - this._backBufferDirty = true; - - this.notifyViewportUpdated(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Stage.prototype, "x", { - /** - * The x position of the gl canvas - */ - get: function () { - return this._x; - }, - set: function (val) { - if (this._x == val) - return; - - CSS.setElementX(this._container, val); - - this._x = this._viewPort.x = val; - - this.notifyViewportUpdated(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Stage.prototype, "y", { - /** - * The y position of the gl canvas - */ - get: function () { - return this._y; - }, - set: function (val) { - if (this._y == val) - return; - - CSS.setElementY(this._container, val); - - this._y = this._viewPort.y = val; - - this.notifyViewportUpdated(); - }, - enumerable: true, - configurable: true - }); - - - - Object.defineProperty(Stage.prototype, "visible", { - get: function () { - return CSS.getElementVisibility(this._container); - }, - set: function (val) { - CSS.setElementVisibility(this._container, val); - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Stage.prototype, "container", { - get: function () { - return this._container; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Stage.prototype, "context", { - /** - * The Context object associated with the given stage object. - */ - get: function () { - return this._context; - }, - enumerable: true, - configurable: true - }); - - Stage.prototype.notifyViewportUpdated = function () { - if (this._viewportDirty) - return; - - this._viewportDirty = true; - - //if (!this.hasEventListener(StageEvent.VIEWPORT_UPDATED)) - //return; - //if (!_viewportUpdated) - this._viewportUpdated = new StageEvent(StageEvent.VIEWPORT_UPDATED); - - this.dispatchEvent(this._viewportUpdated); - }; - - Stage.prototype.notifyEnterFrame = function () { - //if (!hasEventListener(Event.ENTER_FRAME)) - //return; - if (!this._enterFrame) - this._enterFrame = new Event(Event.ENTER_FRAME); - - this.dispatchEvent(this._enterFrame); - }; - - Stage.prototype.notifyExitFrame = function () { - //if (!hasEventListener(Event.EXIT_FRAME)) - //return; - if (!this._exitFrame) - this._exitFrame = new Event(Event.EXIT_FRAME); - - this.dispatchEvent(this._exitFrame); - }; - - Object.defineProperty(Stage.prototype, "profile", { - get: function () { - return this._profile; - }, - enumerable: true, - configurable: true - }); - - /** - * Disposes the Stage object, freeing the Context attached to the Stage. - */ - Stage.prototype.dispose = function () { - this._stageManager.iRemoveStage(this); - this.freeContext(); - this._stageManager = null; - this._stageIndex = -1; - }; - - /** - * Configures the back buffer associated with the Stage object. - * @param backBufferWidth The width of the backbuffer. - * @param backBufferHeight The height of the backbuffer. - * @param antiAlias The amount of anti-aliasing to use. - * @param enableDepthAndStencil Indicates whether the back buffer contains a depth and stencil buffer. - */ - Stage.prototype.configureBackBuffer = function (backBufferWidth, backBufferHeight, antiAlias, enableDepthAndStencil) { - this.width = backBufferWidth; - this.height = backBufferHeight; - - this._antiAlias = antiAlias; - this._enableDepthAndStencil = enableDepthAndStencil; - - if (this._context) - this._context.configureBackBuffer(backBufferWidth, backBufferHeight, antiAlias, enableDepthAndStencil); - }; - - Object.defineProperty(Stage.prototype, "enableDepthAndStencil", { - /* - * Indicates whether the depth and stencil buffer is used - */ - get: function () { - return this._enableDepthAndStencil; - }, - set: function (enableDepthAndStencil) { - this._enableDepthAndStencil = enableDepthAndStencil; - this._backBufferDirty = true; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Stage.prototype, "renderTarget", { - get: function () { - return this._renderTarget; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Stage.prototype, "renderSurfaceSelector", { - get: function () { - return this._renderSurfaceSelector; - }, - enumerable: true, - configurable: true - }); - - /* - * Clear and reset the back buffer when using a shared context - */ - Stage.prototype.clear = function () { - if (!this._context) - return; - - if (this._backBufferDirty) { - this.configureBackBuffer(this._width, this._height, this._antiAlias, this._enableDepthAndStencil); - this._backBufferDirty = false; - } - - this._context.clear((this._color & 0xff000000) >>> 24, (this._color & 0xff0000) >>> 16, (this._color & 0xff00) >>> 8, this._color & 0xff); - - this._bufferClear = true; - }; - - /** - * Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event. Special case for enterframe and exitframe events - will switch StageProxy into automatic render mode. - * You can register event listeners on all nodes in the display list for a specific type of event, phase, and priority. - * - * @param type The type of event. - * @param listener The listener function that processes the event. - * @param useCapture Determines whether the listener works in the capture phase or the target and bubbling phases. If useCapture is set to true, the listener processes the event only during the capture phase and not in the target or bubbling phase. If useCapture is false, the listener processes the event only during the target or bubbling phase. To listen for the event in all three phases, call addEventListener twice, once with useCapture set to true, then again with useCapture set to false. - * @param priority The priority level of the event listener. The priority is designated by a signed 32-bit integer. The higher the number, the higher the priority. All listeners with priority n are processed before listeners of priority n-1. If two or more listeners share the same priority, they are processed in the order in which they were added. The default priority is 0. - * @param useWeakReference Determines whether the reference to the listener is strong or weak. A strong reference (the default) prevents your listener from being garbage-collected. A weak reference does not. - */ - //public override function addEventListener(type:string, listener, useCapture:boolean = false, priority:number = 0, useWeakReference:boolean = false) - Stage.prototype.addEventListener = function (type, listener) { - _super.prototype.addEventListener.call(this, type, listener); //useCapture, priority, useWeakReference); - //away.Debug.throwPIR( 'StageProxy' , 'addEventListener' , 'EnterFrame, ExitFrame'); - //if ((type == Event.ENTER_FRAME || type == Event.EXIT_FRAME) ){//&& ! this._frameEventDriver.hasEventListener(Event.ENTER_FRAME)){ - //_frameEventDriver.addEventListener(Event.ENTER_FRAME, onEnterFrame, useCapture, priority, useWeakReference); - //} - /* Original code - if ((type == Event.ENTER_FRAME || type == Event.EXIT_FRAME) && ! _frameEventDriver.hasEventListener(Event.ENTER_FRAME)){ - - _frameEventDriver.addEventListener(Event.ENTER_FRAME, onEnterFrame, useCapture, priority, useWeakReference); - - - } - */ - }; - - /** - * Removes a listener from the EventDispatcher object. Special case for enterframe and exitframe events - will switch StageProxy out of automatic render mode. - * If there is no matching listener registered with the EventDispatcher object, a call to this method has no effect. - * - * @param type The type of event. - * @param listener The listener object to remove. - * @param useCapture Specifies whether the listener was registered for the capture phase or the target and bubbling phases. If the listener was registered for both the capture phase and the target and bubbling phases, two calls to removeEventListener() are required to remove both, one call with useCapture() set to true, and another call with useCapture() set to false. - */ - Stage.prototype.removeEventListener = function (type, listener) { - _super.prototype.removeEventListener.call(this, type, listener); - //away.Debug.throwPIR( 'StageProxy' , 'removeEventListener' , 'EnterFrame, ExitFrame'); - /* - // Remove the main rendering listener if no EnterFrame listeners remain - if ( ! this.hasEventListener(Event.ENTER_FRAME , this.onEnterFrame , this ) - && ! this.hasEventListener(Event.EXIT_FRAME , this.onEnterFrame , this) ) //&& _frameEventDriver.hasEventListener(Event.ENTER_FRAME)) - { - - //_frameEventDriver.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame, this ); - - } - */ - }; - - Object.defineProperty(Stage.prototype, "scissorRect", { - get: function () { - return this._scissorRect; - }, - set: function (value) { - this._scissorRect = value; - - this._context.setScissorRectangle(this._scissorRect); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Stage.prototype, "stageIndex", { - /** - * The index of the Stage which is managed by this instance of StageProxy. - */ - get: function () { - return this._stageIndex; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Stage.prototype, "usesSoftwareRendering", { - /** - * Indicates whether the Stage managed by this proxy is running in software mode. - * Remember to wait for the CONTEXT_CREATED event before checking this property, - * as only then will it be guaranteed to be accurate. - */ - get: function () { - return this._usesSoftwareRendering; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Stage.prototype, "antiAlias", { - /** - * The antiAliasing of the Stage. - */ - get: function () { - return this._antiAlias; - }, - set: function (antiAlias) { - this._antiAlias = antiAlias; - this._backBufferDirty = true; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Stage.prototype, "viewPort", { - /** - * A viewPort rectangle equivalent of the Stage size and position. - */ - get: function () { - this._viewportDirty = false; - - return this._viewPort; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Stage.prototype, "color", { - /** - * The background color of the Stage. - */ - get: function () { - return this._color; - }, - set: function (color) { - this._color = color; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Stage.prototype, "bufferClear", { - /** - * The freshly cleared state of the backbuffer before any rendering - */ - get: function () { - return this._bufferClear; - }, - set: function (newBufferClear) { - this._bufferClear = newBufferClear; - }, - enumerable: true, - configurable: true - }); - - - /* - * Access to fire mouseevents across multiple layered view3D instances - */ - // public get mouse3DManager():Mouse3DManager - // { - // return this._mouse3DManager; - // } - // - // public set mouse3DManager(value:Mouse3DManager) - // { - // this._mouse3DManager = value; - // } - /* TODO: implement dependency Touch3DManager - public get touch3DManager():Touch3DManager - { - return _touch3DManager; - } - - public set touch3DManager(value:Touch3DManager) - { - _touch3DManager = value; - } - */ - /** - * Frees the Context associated with this StageProxy. - */ - Stage.prototype.freeContext = function () { - if (this._context) { - this._context.dispose(); - - this.dispatchEvent(new StageEvent(StageEvent.CONTEXT_DISPOSED)); - } - - this._context = null; - - this._initialised = false; - }; - - /** - * The Enter_Frame handler for processing the proxy.ENTER_FRAME and proxy.EXIT_FRAME event handlers. - * Typically the proxy.ENTER_FRAME listener would render the layers for this Stage instance. - */ - Stage.prototype.onEnterFrame = function (event) { - if (!this._context) - return; - - // Clear the stage instance - this.clear(); - - //notify the enterframe listeners - this.notifyEnterFrame(); - - // Call the present() to render the frame - if (!this._context) - this._context.present(); - - //notify the exitframe listeners - this.notifyExitFrame(); - }; - - Stage.prototype.recoverFromDisposal = function () { - if (!this._context) - return false; - - //away.Debug.throwPIR( 'StageProxy' , 'recoverFromDisposal' , '' ); - /* - if (this._iContext.driverInfo == "Disposed") - { - this._iContext = null; - this.dispatchEvent(new StageEvent(StageEvent.CONTEXT_DISPOSED)); - return false; - - } - */ - return true; - }; - - Stage.prototype._callback = function (context) { - this._context = context; - - this._container = this._context.container; - - // Only configure back buffer if width and height have been set, - // which they may not have been if View.render() has yet to be - // invoked for the first time. - if (this._width && this._height) - this._context.configureBackBuffer(this._width, this._height, this._antiAlias, this._enableDepthAndStencil); - - // Dispatch the appropriate event depending on whether context was - // created for the first time or recreated after a device loss. - this.dispatchEvent(new StageEvent(this._initialised ? StageEvent.CONTEXT_RECREATED : StageEvent.CONTEXT_CREATED)); - - this._initialised = true; - }; - return Stage; - })(away.events.EventDispatcher); - base.Stage = Stage; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * Defines codes for culling algorithms that determine which triangles not to - * render when drawing triangle paths. - * - *

The terms POSITIVE and NEGATIVE refer to the - * sign of a triangle's normal along the z-axis. The normal is a 3D vector - * that is perpendicular to the surface of the triangle.

- * - *

A triangle whose vertices 0, 1, and 2 are arranged in a clockwise order - * has a positive normal value. That is, its normal points in a positive - * z-axis direction, away from the current view point. When the - * TriangleCulling.POSITIVE algorithm is used, triangles with - * positive normals are not rendered. Another term for this is backface - * culling.

- * - *

A triangle whose vertices are arranged in a counter-clockwise order has - * a negative normal value. That is, its normal points in a negative z-axis - * direction, toward the current view point. When the - * TriangleCulling.NEGATIVE algorithm is used, triangles with - * negative normals will not be rendered.

- */ - (function (base) { - var TriangleCulling = (function () { - function TriangleCulling() { - } - TriangleCulling.NEGATIVE = "negative"; - - TriangleCulling.NONE = "none"; - - TriangleCulling.POSITIVE = "positive"; - return TriangleCulling; - })(); - base.TriangleCulling = TriangleCulling; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.base - */ - (function (base) { - var SubGeometryEvent = away.events.SubGeometryEvent; - - /** - * @class away.base.TriangleSubGeometry - */ - var TriangleSubGeometry = (function (_super) { - __extends(TriangleSubGeometry, _super); - /** - * - */ - function TriangleSubGeometry(concatenatedArrays) { - _super.call(this, concatenatedArrays); - this._positionsDirty = true; - this._faceNormalsDirty = true; - this._faceTangentsDirty = true; - this._vertexNormalsDirty = true; - this._vertexTangentsDirty = true; - this._uvsDirty = true; - this._secondaryUVsDirty = true; - this._jointIndicesDirty = true; - this._jointWeightsDirty = true; - this._concatenateArrays = true; - this._autoDeriveNormals = true; - this._autoDeriveTangents = true; - this._autoDeriveUVs = false; - this._useFaceWeights = false; - this._scaleU = 1; - this._scaleV = 1; - - this._pSubMeshClass = base.TriangleSubMesh; - } - Object.defineProperty(TriangleSubGeometry.prototype, "scaleU", { - /** - * - */ - get: function () { - return this._scaleU; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TriangleSubGeometry.prototype, "scaleV", { - /** - * - */ - get: function () { - return this._scaleV; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TriangleSubGeometry.prototype, "useCondensedIndices", { - /** - * Offers the option of enabling GPU accelerated animation on skeletons larger than 32 joints - * by condensing the number of joint index values required per mesh. Only applicable to - * skeleton animations that utilise more than one mesh object. Defaults to false. - */ - get: function () { - return this._useCondensedIndices; - }, - set: function (value) { - if (this._useCondensedIndices == value) - return; - - this._useCondensedIndices = value; - - this.notifyJointIndicesUpdate(); - }, - enumerable: true, - configurable: true - }); - - - TriangleSubGeometry.prototype._pUpdateStrideOffset = function () { - if (this._concatenateArrays) { - this._pOffset[TriangleSubGeometry.VERTEX_DATA] = 0; - - //always have positions - this._pOffset[TriangleSubGeometry.POSITION_DATA] = 0; - var stride = 3; - - if (this._vertexNormals != null) { - this._pOffset[TriangleSubGeometry.NORMAL_DATA] = stride; - stride += 3; - } - - if (this._vertexTangents != null) { - this._pOffset[TriangleSubGeometry.TANGENT_DATA] = stride; - stride += 3; - } - - if (this._uvs != null) { - this._pOffset[TriangleSubGeometry.UV_DATA] = stride; - stride += 2; - } - - if (this._secondaryUVs != null) { - this._pOffset[TriangleSubGeometry.SECONDARY_UV_DATA] = stride; - stride += 2; - } - - if (this._jointIndices != null) { - this._pOffset[TriangleSubGeometry.JOINT_INDEX_DATA] = stride; - stride += this._jointsPerVertex; - } - - if (this._jointWeights != null) { - this._pOffset[TriangleSubGeometry.JOINT_WEIGHT_DATA] = stride; - stride += this._jointsPerVertex; - } - - this._pStride[TriangleSubGeometry.VERTEX_DATA] = stride; - this._pStride[TriangleSubGeometry.POSITION_DATA] = stride; - this._pStride[TriangleSubGeometry.NORMAL_DATA] = stride; - this._pStride[TriangleSubGeometry.TANGENT_DATA] = stride; - this._pStride[TriangleSubGeometry.UV_DATA] = stride; - this._pStride[TriangleSubGeometry.SECONDARY_UV_DATA] = stride; - this._pStride[TriangleSubGeometry.JOINT_INDEX_DATA] = stride; - this._pStride[TriangleSubGeometry.JOINT_WEIGHT_DATA] = stride; - - var len = this._pNumVertices * stride; - - if (this._pVertices == null) - this._pVertices = new Array(len); - else if (this._pVertices.length != len) - this._pVertices.length = len; - } else { - this._pOffset[TriangleSubGeometry.POSITION_DATA] = 0; - this._pOffset[TriangleSubGeometry.NORMAL_DATA] = 0; - this._pOffset[TriangleSubGeometry.TANGENT_DATA] = 0; - this._pOffset[TriangleSubGeometry.UV_DATA] = 0; - this._pOffset[TriangleSubGeometry.SECONDARY_UV_DATA] = 0; - this._pOffset[TriangleSubGeometry.JOINT_INDEX_DATA] = 0; - this._pOffset[TriangleSubGeometry.JOINT_WEIGHT_DATA] = 0; - - this._pStride[TriangleSubGeometry.POSITION_DATA] = 3; - this._pStride[TriangleSubGeometry.NORMAL_DATA] = 3; - this._pStride[TriangleSubGeometry.TANGENT_DATA] = 3; - this._pStride[TriangleSubGeometry.UV_DATA] = 2; - this._pStride[TriangleSubGeometry.SECONDARY_UV_DATA] = 2; - this._pStride[TriangleSubGeometry.JOINT_INDEX_DATA] = this._jointsPerVertex; - this._pStride[TriangleSubGeometry.JOINT_WEIGHT_DATA] = this._jointsPerVertex; - } - - this._pStrideOffsetDirty = false; - }; - - Object.defineProperty(TriangleSubGeometry.prototype, "jointsPerVertex", { - /** - * - */ - get: function () { - return this._jointsPerVertex; - }, - set: function (value) { - if (this._jointsPerVertex == value) - return; - - this._jointsPerVertex = value; - - this._pStrideOffsetDirty = true; - - if (this._pConcatenateArrays) - this._pNotifyVerticesUpdate(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleSubGeometry.prototype, "autoDeriveUVs", { - /** - * Defines whether a UV buffer should be automatically generated to contain dummy UV coordinates. - * Set to true if a geometry lacks UV data but uses a material that requires it, or leave as false - * in cases where UV data is explicitly defined or the material does not require UV data. - */ - get: function () { - return this._autoDeriveUVs; - }, - set: function (value) { - if (this._autoDeriveUVs == value) - return; - - this._autoDeriveUVs = value; - - if (value) - this.notifyUVsUpdate(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleSubGeometry.prototype, "autoDeriveNormals", { - /** - * True if the vertex normals should be derived from the geometry, false if the vertex normals are set - * explicitly. - */ - get: function () { - return this._autoDeriveNormals; - }, - set: function (value) { - if (this._autoDeriveNormals == value) - return; - - this._autoDeriveNormals = value; - - if (value) - this.notifyNormalsUpdate(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleSubGeometry.prototype, "autoDeriveTangents", { - /** - * True if the vertex tangents should be derived from the geometry, false if the vertex normals are set - * explicitly. - */ - get: function () { - return this._autoDeriveTangents; - }, - set: function (value) { - if (this._autoDeriveTangents == value) - return; - - this._autoDeriveTangents = value; - - if (value) - this.notifyTangentsUpdate(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleSubGeometry.prototype, "vertices", { - /** - * - */ - get: function () { - if (this._positionsDirty) - this.updatePositions(this._positions); - - if (this._vertexNormalsDirty) - this.updateVertexNormals(this._vertexNormals); - - if (this._vertexTangentsDirty) - this.updateVertexTangents(this._vertexTangents); - - if (this._uvsDirty) - this.updateUVs(this._uvs); - - if (this._secondaryUVsDirty) - this.updateSecondaryUVs(this._secondaryUVs); - - if (this._jointIndicesDirty) - this.updateJointIndices(this._jointIndices); - - if (this._jointWeightsDirty) - this.updateJointWeights(this._jointWeights); - - return this._pVertices; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TriangleSubGeometry.prototype, "positions", { - /** - * - */ - get: function () { - if (this._positionsDirty) - this.updatePositions(this._positions); - - return this._positions; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TriangleSubGeometry.prototype, "vertexNormals", { - /** - * - */ - get: function () { - if (this._vertexNormalsDirty) - this.updateVertexNormals(this._vertexNormals); - - return this._vertexNormals; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TriangleSubGeometry.prototype, "vertexTangents", { - /** - * - */ - get: function () { - if (this._vertexTangentsDirty) - this.updateVertexTangents(this._vertexTangents); - - return this._vertexTangents; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TriangleSubGeometry.prototype, "faceNormals", { - /** - * The raw data of the face normals, in the same order as the faces are listed in the index list. - */ - get: function () { - if (this._faceNormalsDirty) - this.updateFaceNormals(); - - return this._faceNormals; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TriangleSubGeometry.prototype, "faceTangents", { - /** - * The raw data of the face tangets, in the same order as the faces are listed in the index list. - */ - get: function () { - if (this._faceTangentsDirty) - this.updateFaceTangents(); - - return this._faceTangents; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TriangleSubGeometry.prototype, "uvs", { - /** - * - */ - get: function () { - if (this._uvsDirty) - this.updateUVs(this._uvs); - - return this._uvs; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TriangleSubGeometry.prototype, "secondaryUVs", { - /** - * - */ - get: function () { - if (this._secondaryUVsDirty) - this.updateSecondaryUVs(this._secondaryUVs); - - return this._secondaryUVs; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TriangleSubGeometry.prototype, "jointIndices", { - /** - * - */ - get: function () { - if (this._jointIndicesDirty) - this.updateJointIndices(this._jointIndices); - - if (this._useCondensedIndices) - return this._condensedJointIndices; - - return this._jointIndices; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TriangleSubGeometry.prototype, "jointWeights", { - /** - * - */ - get: function () { - if (this._jointWeightsDirty) - this.updateJointWeights(this._jointWeights); - - return this._jointWeights; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TriangleSubGeometry.prototype, "useFaceWeights", { - /** - * Indicates whether or not to take the size of faces into account when auto-deriving vertex normals and tangents. - */ - get: function () { - return this._useFaceWeights; - }, - set: function (value) { - if (this._useFaceWeights == value) - return; - - this._useFaceWeights = value; - - if (this._autoDeriveNormals) - this.notifyNormalsUpdate(); - - if (this._autoDeriveTangents) - this.notifyTangentsUpdate(); - - this._faceNormalsDirty = true; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleSubGeometry.prototype, "numCondensedJoints", { - get: function () { - if (this._jointIndicesDirty) - this.updateJointIndices(this._jointIndices); - - return this._numCondensedJoints; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TriangleSubGeometry.prototype, "condensedIndexLookUp", { - get: function () { - if (this._jointIndicesDirty) - this.updateJointIndices(this._jointIndices); - - return this._condensedIndexLookUp; - }, - enumerable: true, - configurable: true - }); - - TriangleSubGeometry.prototype.getBoundingPositions = function () { - if (this._positionsDirty) - this.updatePositions(this._positions); - - return this._positions; - }; - - /** - * - */ - TriangleSubGeometry.prototype.updatePositions = function (values) { - var i; - var index; - var stride; - var positions; - - this._positions = values; - - if (this._positions == null) - this._positions = new Array(); - - this._pNumVertices = this._positions.length / 3; - - if (this._concatenateArrays) { - var len = this._pNumVertices * this.getStride(TriangleSubGeometry.VERTEX_DATA); - - if (this._pVertices == null) - this._pVertices = new Array(len); - else if (this._pVertices.length != len) - this._pVertices.length = len; - - i = 0; - index = this.getOffset(TriangleSubGeometry.POSITION_DATA); - stride = this.getStride(TriangleSubGeometry.POSITION_DATA); - positions = this._pVertices; - - while (i < values.length) { - positions[index] = values[i++]; - positions[index + 1] = values[i++]; - positions[index + 2] = values[i++]; - index += stride; - } - } - - if (this._autoDeriveNormals) - this.notifyNormalsUpdate(); - - if (this._autoDeriveTangents) - this.notifyTangentsUpdate(); - - if (this._autoDeriveUVs) - this.notifyUVsUpdate(); - - this.pInvalidateBounds(); - - this.notifyPositionsUpdate(); - - this._positionsDirty = false; - }; - - /** - * Updates the vertex normals based on the geometry. - */ - TriangleSubGeometry.prototype.updateVertexNormals = function (values) { - var i; - var index; - var offset; - var stride; - var normals; - - if (!this._autoDeriveNormals) { - if ((this._vertexNormals == null || values == null) && (this._vertexNormals != null || values != null)) { - if (this._concatenateArrays) - this._pNotifyVerticesUpdate(); - else - this._pStrideOffsetDirty = true; - } - - this._vertexNormals = values; - - if (values != null && this._concatenateArrays) { - i = 0; - index = this.getOffset(TriangleSubGeometry.NORMAL_DATA); - stride = this.getStride(TriangleSubGeometry.NORMAL_DATA); - normals = this._pVertices; - - while (i < values.length) { - normals[index] = values[i++]; - normals[index + 1] = values[i++]; - normals[index + 2] = values[i++]; - index += stride; - } - } - } else { - if (this._vertexNormals == null) { - this._vertexNormals = new Array(this._positions.length); - - if (this._concatenateArrays) - this._pNotifyVerticesUpdate(); - else - this._pStrideOffsetDirty = true; - } - - if (this._faceNormalsDirty) - this.updateFaceNormals(); - - offset = this.getOffset(TriangleSubGeometry.NORMAL_DATA); - stride = this.getStride(TriangleSubGeometry.NORMAL_DATA); - - //autoderived normals - normals = this._concatenateArrays ? this._pVertices : this._vertexNormals; - - var f1 = 0; - var f2 = 1; - var f3 = 2; - - index = offset; - - //clear normal values - var lenV = normals.length; - while (index < lenV) { - normals[index] = 0; - normals[index + 1] = 0; - normals[index + 2] = 0; - index += stride; - } - - var k = 0; - var lenI = this._pIndices.length; - var weight; - - i = 0; - - while (i < lenI) { - weight = this._useFaceWeights ? this._faceWeights[k++] : 1; - index = offset + this._pIndices[i++] * stride; - normals[index] += this._faceNormals[f1] * weight; - normals[index + 1] += this._faceNormals[f2] * weight; - normals[index + 2] += this._faceNormals[f3] * weight; - index = offset + this._pIndices[i++] * stride; - normals[index] += this._faceNormals[f1] * weight; - normals[index + 1] += this._faceNormals[f2] * weight; - normals[index + 2] += this._faceNormals[f3] * weight; - index = offset + this._pIndices[i++] * stride; - normals[index] += this._faceNormals[f1] * weight; - normals[index + 1] += this._faceNormals[f2] * weight; - normals[index + 2] += this._faceNormals[f3] * weight; - f1 += 3; - f2 += 3; - f3 += 3; - } - - i = 0; - index = offset; - - while (index < lenV) { - var vx = normals[index]; - var vy = normals[index + 1]; - var vz = normals[index + 2]; - var d = 1.0 / Math.sqrt(vx * vx + vy * vy + vz * vz); - - if (this._concatenateArrays) { - this._vertexNormals[i++] = normals[index] = vx * d; - this._vertexNormals[i++] = normals[index + 1] = vy * d; - this._vertexNormals[i++] = normals[index + 2] = vz * d; - } else { - normals[index] = vx * d; - normals[index + 1] = vy * d; - normals[index + 2] = vz * d; - } - - index += stride; - } - } - - this.notifyNormalsUpdate(); - - this._vertexNormalsDirty = false; - }; - - /** - * Updates the vertex tangents based on the geometry. - */ - TriangleSubGeometry.prototype.updateVertexTangents = function (values) { - var i; - var index; - var offset; - var stride; - var tangents; - - if (!this._autoDeriveTangents) { - if ((this._vertexTangents == null || values == null) && (this._vertexTangents != null || values != null)) { - if (this._concatenateArrays) - this._pNotifyVerticesUpdate(); - else - this._pStrideOffsetDirty = true; - } - - this._vertexTangents = values; - - if (values != null && this._concatenateArrays) { - i = 0; - index = this.getOffset(TriangleSubGeometry.TANGENT_DATA); - stride = this.getStride(TriangleSubGeometry.TANGENT_DATA); - tangents = this._pVertices; - - while (i < values.length) { - tangents[index] = values[i++]; - tangents[index + 1] = values[i++]; - tangents[index + 2] = values[i++]; - index += stride; - } - } - } else { - if (this._vertexTangents == null) { - this._vertexTangents = new Array(this._positions.length); - - if (this._concatenateArrays) - this._pNotifyVerticesUpdate(); - else - this._pStrideOffsetDirty = true; - } - - if (this._faceTangentsDirty) - this.updateFaceTangents(); - - offset = this.getOffset(TriangleSubGeometry.TANGENT_DATA); - stride = this.getStride(TriangleSubGeometry.TANGENT_DATA); - - //autoderived tangents - tangents = this._concatenateArrays ? this._pVertices : this._vertexTangents; - - index = offset; - - //clear tangent values - var lenV = tangents.length; - while (index < lenV) { - tangents[index] = 0; - tangents[index + 1] = 0; - tangents[index + 2] = 0; - - index += stride; - } - - var k = 0; - var weight; - var f1 = 0; - var f2 = 1; - var f3 = 2; - - i = 0; - - //collect face tangents - var lenI = this._pIndices.length; - while (i < lenI) { - weight = this._useFaceWeights ? this._faceWeights[k++] : 1; - index = offset + this._pIndices[i++] * stride; - tangents[index++] += this._faceTangents[f1] * weight; - tangents[index++] += this._faceTangents[f2] * weight; - tangents[index] += this._faceTangents[f3] * weight; - index = offset + this._pIndices[i++] * stride; - tangents[index++] += this._faceTangents[f1] * weight; - tangents[index++] += this._faceTangents[f2] * weight; - tangents[index] += this._faceTangents[f3] * weight; - index = offset + this._pIndices[i++] * stride; - tangents[index++] += this._faceTangents[f1] * weight; - tangents[index++] += this._faceTangents[f2] * weight; - tangents[index] += this._faceTangents[f3] * weight; - f1 += 3; - f2 += 3; - f3 += 3; - } - - i = 0; - index = offset; - - while (index < lenV) { - var vx = tangents[index]; - var vy = tangents[index + 1]; - var vz = tangents[index + 2]; - var d = 1.0 / Math.sqrt(vx * vx + vy * vy + vz * vz); - - if (this._concatenateArrays) { - this._vertexTangents[i++] = tangents[index] = vx * d; - this._vertexTangents[i++] = tangents[index + 1] = vy * d; - this._vertexTangents[i++] = tangents[index + 2] = vz * d; - } else { - tangents[index] = vx * d; - tangents[index + 1] = vy * d; - tangents[index + 2] = vz * d; - } - - index += stride; - } - } - - this.notifyTangentsUpdate(); - - this._vertexTangentsDirty = false; - }; - - /** - * Updates the uvs based on the geometry. - */ - TriangleSubGeometry.prototype.updateUVs = function (values) { - var i; - var index; - var offset; - var stride; - var uvs; - - if (!this._autoDeriveUVs) { - if ((this._uvs == null || values == null) && (this._uvs != null || values != null)) { - if (this._concatenateArrays) - this._pNotifyVerticesUpdate(); - else - this._pStrideOffsetDirty = true; - } - - this._uvs = values; - - if (values != null && this._concatenateArrays) { - i = 0; - index = this.getOffset(TriangleSubGeometry.UV_DATA); - stride = this.getStride(TriangleSubGeometry.UV_DATA); - uvs = this._pVertices; - - while (i < values.length) { - uvs[index] = values[i++]; - uvs[index + 1] = values[i++]; - index += stride; - } - } - } else { - if (this._uvs == null) { - this._uvs = new Array(this._positions.length * 2 / 3); - - if (this._concatenateArrays) - this._pNotifyVerticesUpdate(); - else - this._pStrideOffsetDirty = true; - } - - offset = this.getOffset(TriangleSubGeometry.UV_DATA); - stride = this.getStride(TriangleSubGeometry.UV_DATA); - - //autoderived uvs - uvs = this._concatenateArrays ? this._pVertices : this._uvs; - - i = 0; - index = offset; - var uvIdx = 0; - - //clear uv values - var lenV = uvs.length; - while (index < lenV) { - if (this._concatenateArrays) { - this._uvs[i++] = uvs[index] = uvIdx * .5; - this._uvs[i++] = uvs[index + 1] = 1.0 - (uvIdx & 1); - } else { - uvs[index] = uvIdx * .5; - uvs[index + 1] = 1.0 - (uvIdx & 1); - } - - if (++uvIdx == 3) - uvIdx = 0; - - index += stride; - } - } - - if (this._autoDeriveTangents) - this.notifyTangentsUpdate(); - - this.notifyUVsUpdate(); - - this._uvsDirty = false; - }; - - /** - * Updates the secondary uvs based on the geometry. - */ - TriangleSubGeometry.prototype.updateSecondaryUVs = function (values) { - var i; - var index; - var offset; - var stride; - var uvs; - - if (this._concatenateArrays && (this._secondaryUVs == null || values == null) && (this._secondaryUVs != null || values != null)) - this._pNotifyVerticesUpdate(); - - this._secondaryUVs = values; - - if (values != null && this._concatenateArrays) { - offset = this.getOffset(TriangleSubGeometry.SECONDARY_UV_DATA); - stride = this.getStride(TriangleSubGeometry.SECONDARY_UV_DATA); - - i = 0; - index = offset; - uvs = this._pVertices; - - while (i < values.length) { - uvs[index] = values[i++]; - uvs[index + 1] = values[i++]; - index += stride; - } - } - - this.notifySecondaryUVsUpdate(); - - this._secondaryUVsDirty = false; - }; - - /** - * Updates the joint indices - */ - TriangleSubGeometry.prototype.updateJointIndices = function (values) { - var i; - var j; - var index; - var offset; - var stride; - var jointIndices; - - if (this._concatenateArrays && (this._jointIndices == null || values == null) && (this._jointIndices != null || values != null)) - this._pNotifyVerticesUpdate(); - - this._jointIndices = values; - - if (values != null) { - offset = this.getOffset(TriangleSubGeometry.JOINT_INDEX_DATA); - stride = this.getStride(TriangleSubGeometry.JOINT_INDEX_DATA); - if (this._useCondensedIndices) { - i = 0; - j = 0; - index = offset; - jointIndices = this._concatenateArrays ? this._pVertices : this._condensedJointIndices; - var oldIndex; - var newIndex = 0; - var dic = new Object(); - - if (!this._concatenateArrays) - this._condensedJointIndices = new Array(values.length); - - this._condensedIndexLookUp = new Array(); - - while (i < values.length) { - for (j = 0; j < this._jointsPerVertex; j++) { - oldIndex = values[i++]; - - // if we encounter a new index, assign it a new condensed index - if (dic[oldIndex] == undefined) { - dic[oldIndex] = newIndex * 3; //3 required for the three vectors that store the matrix - this._condensedIndexLookUp[newIndex++] = oldIndex; - } - jointIndices[index + j] = dic[oldIndex]; - } - index += stride; - } - this._numCondensedJoints = newIndex; - } else if (this._concatenateArrays) { - i = 0; - index = offset; - jointIndices = this._pVertices; - - while (i < values.length) { - j = 0; - while (j < this._jointsPerVertex) - jointIndices[index + j++] = values[i++]; - index += stride; - } - } - } - - this.notifyJointIndicesUpdate(); - - this._jointIndicesDirty = false; - }; - - /** - * Updates the joint weights. - */ - TriangleSubGeometry.prototype.updateJointWeights = function (values) { - var i; - var j; - var index; - var offset; - var stride; - var jointWeights; - - if (this._concatenateArrays && (this._jointWeights == null || values == null) && (this._jointWeights != null || values != null)) - this._pNotifyVerticesUpdate(); - - this._jointWeights = values; - - if (values != null && this._concatenateArrays) { - offset = this.getOffset(TriangleSubGeometry.JOINT_WEIGHT_DATA); - stride = this.getStride(TriangleSubGeometry.JOINT_WEIGHT_DATA); - - i = 0; - index = offset; - jointWeights = this._pVertices; - - while (i < values.length) { - j = 0; - while (j < this._jointsPerVertex) - jointWeights[index + j++] = values[i++]; - index += stride; - } - } - - this.notifyJointWeightsUpdate(); - - this._jointWeightsDirty = false; - }; - - /** - * - */ - TriangleSubGeometry.prototype.dispose = function () { - _super.prototype.dispose.call(this); - - this._positions = null; - this._vertexNormals = null; - this._vertexTangents = null; - this._uvs = null; - this._secondaryUVs = null; - this._jointIndices = null; - this._jointWeights = null; - - this._faceNormals = null; - this._faceWeights = null; - this._faceTangents = null; - }; - - /** - * Updates the face indices of the TriangleSubGeometry. - * - * @param indices The face indices to upload. - */ - TriangleSubGeometry.prototype.updateIndices = function (indices) { - _super.prototype.updateIndices.call(this, indices); - - this._faceNormalsDirty = true; - - if (this._autoDeriveNormals) - this._vertexNormalsDirty = true; - - if (this._autoDeriveTangents) - this._vertexTangentsDirty = true; - - if (this._autoDeriveUVs) - this._uvsDirty = true; - }; - - /** - * Clones the current object - * @return An exact duplicate of the current object. - */ - TriangleSubGeometry.prototype.clone = function () { - var clone = new TriangleSubGeometry(this._concatenateArrays); - clone.updateIndices(this._pIndices.concat()); - clone.updatePositions(this._positions.concat()); - - if (this._vertexNormals && !this._autoDeriveNormals) - clone.updateVertexNormals(this._vertexNormals.concat()); - else - clone.updateVertexNormals(null); - - if (this._uvs && !this._autoDeriveUVs) - clone.updateUVs(this._uvs.concat()); - else - clone.updateUVs(null); - - if (this._vertexTangents && !this._autoDeriveTangents) - clone.updateVertexTangents(this._vertexTangents.concat()); - else - clone.updateVertexTangents(null); - - if (this._secondaryUVs) - clone.updateSecondaryUVs(this._secondaryUVs.concat()); - - if (this._jointIndices) { - clone.jointsPerVertex = this._jointsPerVertex; - clone.updateJointIndices(this._jointIndices.concat()); - } - - if (this._jointWeights) - clone.updateJointWeights(this._jointWeights.concat()); - - return clone; - }; - - TriangleSubGeometry.prototype.scaleUV = function (scaleU, scaleV) { - if (typeof scaleU === "undefined") { scaleU = 1; } - if (typeof scaleV === "undefined") { scaleV = 1; } - var index; - var offset; - var stride; - var uvs; - - uvs = this._uvs; - - var ratioU = scaleU / this._scaleU; - var ratioV = scaleV / this._scaleV; - - this._scaleU = scaleU; - this._scaleV = scaleV; - - var len = uvs.length; - - offset = 0; - stride = 2; - - index = offset; - - while (index < len) { - uvs[index] *= ratioU; - uvs[index + 1] *= ratioV; - index += stride; - } - - this.notifyUVsUpdate(); - }; - - /** - * Scales the geometry. - * @param scale The amount by which to scale. - */ - TriangleSubGeometry.prototype.scale = function (scale) { - var i; - var index; - var offset; - var stride; - var positions; - - positions = this._positions; - - var len = positions.length; - - offset = 0; - stride = 3; - - i = 0; - index = offset; - while (i < len) { - positions[index] *= scale; - positions[index + 1] *= scale; - positions[index + 2] *= scale; - - i += 3; - index += stride; - } - - this.notifyPositionsUpdate(); - }; - - TriangleSubGeometry.prototype.applyTransformation = function (transform) { - var positions; - var normals; - var tangents; - - if (this._concatenateArrays) { - positions = this._pVertices; - normals = this._pVertices; - tangents = this._pVertices; - } else { - positions = this._positions; - normals = this._vertexNormals; - tangents = this._vertexTangents; - } - - var len = this._positions.length / 3; - var i; - var i1; - var i2; - var vector = new away.geom.Vector3D(); - - var bakeNormals = this._vertexNormals != null; - var bakeTangents = this._vertexTangents != null; - var invTranspose; - - if (bakeNormals || bakeTangents) { - invTranspose = transform.clone(); - invTranspose.invert(); - invTranspose.transpose(); - } - - var vi0 = this.getOffset(TriangleSubGeometry.POSITION_DATA); - var ni0 = this.getOffset(TriangleSubGeometry.NORMAL_DATA); - var ti0 = this.getOffset(TriangleSubGeometry.TANGENT_DATA); - - var vStride = this.getStride(TriangleSubGeometry.POSITION_DATA); - var nStride = this.getStride(TriangleSubGeometry.NORMAL_DATA); - var tStride = this.getStride(TriangleSubGeometry.TANGENT_DATA); - - for (i = 0; i < len; ++i) { - i1 = vi0 + 1; - i2 = vi0 + 2; - - // bake position - vector.x = positions[vi0]; - vector.y = positions[i1]; - vector.z = positions[i2]; - vector = transform.transformVector(vector); - positions[vi0] = vector.x; - positions[i1] = vector.y; - positions[i2] = vector.z; - vi0 += vStride; - - // bake normal - if (bakeNormals) { - i1 = ni0 + 1; - i2 = ni0 + 2; - vector.x = normals[ni0]; - vector.y = normals[i1]; - vector.z = normals[i2]; - vector = invTranspose.deltaTransformVector(vector); - vector.normalize(); - normals[ni0] = vector.x; - normals[i1] = vector.y; - normals[i2] = vector.z; - ni0 += nStride; - } - - // bake tangent - if (bakeTangents) { - i1 = ti0 + 1; - i2 = ti0 + 2; - vector.x = tangents[ti0]; - vector.y = tangents[i1]; - vector.z = tangents[i2]; - vector = invTranspose.deltaTransformVector(vector); - vector.normalize(); - tangents[ti0] = vector.x; - tangents[i1] = vector.y; - tangents[i2] = vector.z; - ti0 += tStride; - } - } - - this.notifyPositionsUpdate(); - this.notifyNormalsUpdate(); - this.notifyTangentsUpdate(); - }; - - /** - * Updates the tangents for each face. - */ - TriangleSubGeometry.prototype.updateFaceTangents = function () { - var i = 0; - var index1; - var index2; - var index3; - var vi; - var v0; - var dv1; - var dv2; - var denom; - var x0, y0, z0; - var dx1, dy1, dz1; - var dx2, dy2, dz2; - var cx, cy, cz; - - var positions = this._positions; - var uvs = this._uvs; - - var len = this._pIndices.length; - - if (this._faceTangents == null) - this._faceTangents = new Array(len); - - while (i < len) { - index1 = this._pIndices[i]; - index2 = this._pIndices[i + 1]; - index3 = this._pIndices[i + 2]; - - v0 = uvs[index1 * 2 + 1]; - dv1 = uvs[index2 * 2 + 1] - v0; - dv2 = uvs[index3 * 2 + 1] - v0; - - vi = index1 * 3; - x0 = positions[vi]; - y0 = positions[vi + 1]; - z0 = positions[vi + 2]; - vi = index2 * 3; - dx1 = positions[vi] - x0; - dy1 = positions[vi + 1] - y0; - dz1 = positions[vi + 2] - z0; - vi = index3 * 3; - dx2 = positions[vi] - x0; - dy2 = positions[vi + 1] - y0; - dz2 = positions[vi + 2] - z0; - - cx = dv2 * dx1 - dv1 * dx2; - cy = dv2 * dy1 - dv1 * dy2; - cz = dv2 * dz1 - dv1 * dz2; - denom = 1 / Math.sqrt(cx * cx + cy * cy + cz * cz); - - this._faceTangents[i++] = denom * cx; - this._faceTangents[i++] = denom * cy; - this._faceTangents[i++] = denom * cz; - } - - this._faceTangentsDirty = false; - }; - - /** - * Updates the normals for each face. - */ - TriangleSubGeometry.prototype.updateFaceNormals = function () { - var i = 0; - var j = 0; - var k = 0; - var index; - var offset; - var stride; - - var x1, x2, x3; - var y1, y2, y3; - var z1, z2, z3; - var dx1, dy1, dz1; - var dx2, dy2, dz2; - var cx, cy, cz; - var d; - - var positions = this._positions; - - var len = this._pIndices.length; - - if (this._faceNormals == null) - this._faceNormals = new Array(len); - - if (this._useFaceWeights && this._faceWeights == null) - this._faceWeights = new Array(len / 3); - - while (i < len) { - index = this._pIndices[i++] * 3; - x1 = positions[index]; - y1 = positions[index + 1]; - z1 = positions[index + 2]; - index = this._pIndices[i++] * 3; - x2 = positions[index]; - y2 = positions[index + 1]; - z2 = positions[index + 2]; - index = this._pIndices[i++] * 3; - x3 = positions[index]; - y3 = positions[index + 1]; - z3 = positions[index + 2]; - dx1 = x3 - x1; - dy1 = y3 - y1; - dz1 = z3 - z1; - dx2 = x2 - x1; - dy2 = y2 - y1; - dz2 = z2 - z1; - cx = dz1 * dy2 - dy1 * dz2; - cy = dx1 * dz2 - dz1 * dx2; - cz = dy1 * dx2 - dx1 * dy2; - d = Math.sqrt(cx * cx + cy * cy + cz * cz); - - // length of cross product = 2*triangle area - if (this._useFaceWeights) { - var w = d * 10000; - - if (w < 1) - w = 1; - - this._faceWeights[k++] = w; - } - - d = 1 / d; - - this._faceNormals[j++] = cx * d; - this._faceNormals[j++] = cy * d; - this._faceNormals[j++] = cz * d; - } - - this._faceNormalsDirty = false; - }; - - TriangleSubGeometry.prototype._pNotifyVerticesUpdate = function () { - this._pStrideOffsetDirty = true; - - this.notifyPositionsUpdate(); - this.notifyNormalsUpdate(); - this.notifyTangentsUpdate(); - this.notifyUVsUpdate(); - this.notifySecondaryUVsUpdate(); - this.notifyJointIndicesUpdate(); - this.notifyJointWeightsUpdate(); - }; - - TriangleSubGeometry.prototype.notifyPositionsUpdate = function () { - if (this._positionsDirty) - return; - - this._positionsDirty = true; - - if (!this._positionsUpdated) - this._positionsUpdated = new SubGeometryEvent(SubGeometryEvent.VERTICES_UPDATED, TriangleSubGeometry.POSITION_DATA); - - this.dispatchEvent(this._positionsUpdated); - }; - - TriangleSubGeometry.prototype.notifyNormalsUpdate = function () { - if (this._vertexNormalsDirty) - return; - - this._vertexNormalsDirty = true; - - if (!this._normalsUpdated) - this._normalsUpdated = new SubGeometryEvent(SubGeometryEvent.VERTICES_UPDATED, TriangleSubGeometry.NORMAL_DATA); - - this.dispatchEvent(this._normalsUpdated); - }; - - TriangleSubGeometry.prototype.notifyTangentsUpdate = function () { - if (this._vertexTangentsDirty) - return; - - this._vertexTangentsDirty = true; - - if (!this._tangentsUpdated) - this._tangentsUpdated = new SubGeometryEvent(SubGeometryEvent.VERTICES_UPDATED, TriangleSubGeometry.TANGENT_DATA); - - this.dispatchEvent(this._tangentsUpdated); - }; - - TriangleSubGeometry.prototype.notifyUVsUpdate = function () { - if (this._uvsDirty) - return; - - this._uvsDirty = true; - - if (!this._uvsUpdated) - this._uvsUpdated = new SubGeometryEvent(SubGeometryEvent.VERTICES_UPDATED, TriangleSubGeometry.UV_DATA); - - this.dispatchEvent(this._uvsUpdated); - }; - - TriangleSubGeometry.prototype.notifySecondaryUVsUpdate = function () { - if (this._secondaryUVsDirty) - return; - - this._secondaryUVsDirty = true; - - if (!this._secondaryUVsUpdated) - this._secondaryUVsUpdated = new SubGeometryEvent(SubGeometryEvent.VERTICES_UPDATED, TriangleSubGeometry.SECONDARY_UV_DATA); - - this.dispatchEvent(this._secondaryUVsUpdated); - }; - - TriangleSubGeometry.prototype.notifyJointIndicesUpdate = function () { - if (this._jointIndicesDirty) - return; - - this._jointIndicesDirty = true; - - if (!this._jointIndicesUpdated) - this._jointIndicesUpdated = new SubGeometryEvent(SubGeometryEvent.VERTICES_UPDATED, TriangleSubGeometry.JOINT_INDEX_DATA); - - this.dispatchEvent(this._jointIndicesUpdated); - }; - - TriangleSubGeometry.prototype.notifyJointWeightsUpdate = function () { - if (this._jointWeightsDirty) - return; - - this._jointWeightsDirty = true; - - if (!this._jointWeightsUpdated) - this._jointWeightsUpdated = new SubGeometryEvent(SubGeometryEvent.VERTICES_UPDATED, TriangleSubGeometry.JOINT_WEIGHT_DATA); - - this.dispatchEvent(this._jointWeightsUpdated); - }; - TriangleSubGeometry.POSITION_DATA = "positions"; - TriangleSubGeometry.NORMAL_DATA = "vertexNormals"; - TriangleSubGeometry.TANGENT_DATA = "vertexTangents"; - TriangleSubGeometry.UV_DATA = "uvs"; - TriangleSubGeometry.SECONDARY_UV_DATA = "secondaryUVs"; - TriangleSubGeometry.JOINT_INDEX_DATA = "jointIndices"; - TriangleSubGeometry.JOINT_WEIGHT_DATA = "jointWeights"; - - TriangleSubGeometry.POSITION_FORMAT = "float3"; - TriangleSubGeometry.NORMAL_FORMAT = "float3"; - TriangleSubGeometry.TANGENT_FORMAT = "float3"; - TriangleSubGeometry.UV_FORMAT = "float2"; - TriangleSubGeometry.SECONDARY_UV_FORMAT = "float2"; - return TriangleSubGeometry; - })(base.SubGeometryBase); - base.TriangleSubGeometry = TriangleSubGeometry; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.base - */ - (function (base) { - var AssetType = away.library.AssetType; - - /** - * TriangleSubMesh wraps a TriangleSubGeometry as a scene graph instantiation. A TriangleSubMesh is owned by a Mesh object. - * - * - * @see away.base.TriangleSubGeometry - * @see away.entities.Mesh - * - * @class away.base.TriangleSubMesh - */ - var TriangleSubMesh = (function (_super) { - __extends(TriangleSubMesh, _super); - /** - * Creates a new TriangleSubMesh object - * @param subGeometry The TriangleSubGeometry object which provides the geometry data for this TriangleSubMesh. - * @param parentMesh The Mesh object to which this TriangleSubMesh belongs. - * @param material An optional material used to render this TriangleSubMesh. - */ - function TriangleSubMesh(subGeometry, parentMesh, material) { - if (typeof material === "undefined") { material = null; } - _super.call(this); - - this._pParentMesh = parentMesh; - this._subGeometry = subGeometry; - this.material = material; - } - Object.defineProperty(TriangleSubMesh.prototype, "assetType", { - /** - * - */ - get: function () { - return AssetType.TRIANGLE_SUB_MESH; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TriangleSubMesh.prototype, "subGeometry", { - /** - * The TriangleSubGeometry object which provides the geometry data for this TriangleSubMesh. - */ - get: function () { - return this._subGeometry; - }, - enumerable: true, - configurable: true - }); - - /** - * - */ - TriangleSubMesh.prototype.dispose = function () { - _super.prototype.dispose.call(this); - }; - - TriangleSubMesh.prototype._iCollectRenderable = function (renderer) { - renderer.applyTriangleSubMesh(this); - }; - return TriangleSubMesh; - })(base.SubMeshBase); - base.TriangleSubMesh = TriangleSubMesh; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (textures) { - /** - * - */ - var TextureProxyBase = (function (_super) { - __extends(TextureProxyBase, _super); - /** - * - */ - function TextureProxyBase(generateMipmaps) { - if (typeof generateMipmaps === "undefined") { generateMipmaps = false; } - _super.call(this); - this._pFormat = "bgra"; - this._textureData = new Array(); - - this._generateMipmaps = this._hasMipmaps = generateMipmaps; - } - Object.defineProperty(TextureProxyBase.prototype, "size", { - get: function () { - return this._pSize; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TextureProxyBase.prototype, "hasMipmaps", { - get: function () { - return this._hasMipmaps; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TextureProxyBase.prototype, "format", { - /** - * - * @returns {string} - */ - get: function () { - return this._pFormat; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TextureProxyBase.prototype, "generateMipmaps", { - /** - * - * @returns {boolean} - */ - get: function () { - return this._generateMipmaps; - }, - set: function (value) { - if (this._generateMipmaps == value) - return; - - this._generateMipmaps = this._hasMipmaps = value; - - this.invalidateContent(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TextureProxyBase.prototype, "assetType", { - /** - * - * @returns {string} - */ - get: function () { - return away.library.AssetType.TEXTURE; - }, - enumerable: true, - configurable: true - }); - - /** - * - */ - TextureProxyBase.prototype.invalidateContent = function () { - var len = this._textureData.length; - for (var i = 0; i < len; i++) - this._textureData[i].invalidate(); - }; - - /** - * - * @private - */ - TextureProxyBase.prototype.invalidateSize = function () { - while (this._textureData.length) - this._textureData[0].dispose(); - }; - - /** - * @inheritDoc - */ - TextureProxyBase.prototype.dispose = function () { - while (this._textureData.length) - this._textureData[0].dispose(); - }; - - TextureProxyBase.prototype._iAddTextureData = function (textureData) { - this._textureData.push(textureData); - - return textureData; - }; - - TextureProxyBase.prototype._iRemoveTextureData = function (textureData) { - this._textureData.splice(this._textureData.indexOf(textureData), 1); - - return textureData; - }; - return TextureProxyBase; - })(away.library.NamedAssetBase); - textures.TextureProxyBase = TextureProxyBase; - })(away.textures || (away.textures = {})); - var textures = away.textures; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (textures) { - var Texture2DBase = (function (_super) { - __extends(Texture2DBase, _super); - function Texture2DBase(generateMipmaps) { - if (typeof generateMipmaps === "undefined") { generateMipmaps = false; } - _super.call(this, generateMipmaps); - } - Object.defineProperty(Texture2DBase.prototype, "width", { - /** - * - * @returns {number} - */ - get: function () { - return this._pWidth; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Texture2DBase.prototype, "height", { - /** - * - * @returns {number} - */ - get: function () { - return this._pHeight; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Texture2DBase.prototype, "size", { - get: function () { - return this._pWidth; - }, - enumerable: true, - configurable: true - }); - - /** - * @inheritDoc - */ - Texture2DBase.prototype.dispose = function () { - _super.prototype.dispose.call(this); - - if (this._mipmapData) { - var len = this._mipmapData.length; - for (var i = 0; i < len; i++) - textures.MipmapGenerator.freeMipMapHolder(this._mipmapData[i]); - } - }; - - /** - * - */ - Texture2DBase.prototype.invalidateContent = function () { - _super.prototype.invalidateContent.call(this); - - this._mipmapDataDirty = true; - }; - - /** - * - * @param width - * @param height - * @private - */ - Texture2DBase.prototype._pSetSize = function (width, height) { - if (this._pWidth != width || this._pHeight != height) - this.invalidateSize(); - - this._mipmapDataDirty = true; - - this._pWidth = width; - this._pHeight = height; - }; - - Texture2DBase.prototype._iGetMipmapData = function () { - if (this._mipmapDataDirty) { - this._mipmapDataDirty = false; - - if (!this._mipmapData) - this._mipmapData = new Array(); - - away.textures.MipmapGenerator.generateMipMaps(this._iGetTextureData(), this._mipmapData, true); - } - - return this._mipmapData; - }; - - Texture2DBase.prototype._iGetTextureData = function () { - throw new away.errors.AbstractMethodError(); - }; - return Texture2DBase; - })(textures.TextureProxyBase); - textures.Texture2DBase = Texture2DBase; - })(away.textures || (away.textures = {})); - var textures = away.textures; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (textures) { - var AbstractMethodError = away.errors.AbstractMethodError; - - var CubeTextureBase = (function (_super) { - __extends(CubeTextureBase, _super); - function CubeTextureBase(generateMipmaps) { - if (typeof generateMipmaps === "undefined") { generateMipmaps = false; } - _super.call(this, generateMipmaps); - this._mipmapDataArray = new Array(6); - this._mipmapDataDirtyArray = new Array(6); - } - /** - * - * @param width - * @param height - * @private - */ - CubeTextureBase.prototype._pSetSize = function (size) { - if (this._pSize != size) - this.invalidateSize(); - - for (var i = 0; i < 6; i++) - this._mipmapDataDirtyArray[i] = true; - - this._pSize = size; - }; - - /** - * @inheritDoc - */ - CubeTextureBase.prototype.dispose = function () { - _super.prototype.dispose.call(this); - - for (var i = 0; i < 6; i++) { - var mipmapData = this._mipmapDataArray[i]; - var len = mipmapData.length; - for (var j = 0; j < len; j++) - textures.MipmapGenerator.freeMipMapHolder(mipmapData[j]); - } - }; - - /** - * - */ - CubeTextureBase.prototype.invalidateContent = function () { - _super.prototype.invalidateContent.call(this); - - for (var i = 0; i < 6; i++) - this._mipmapDataDirtyArray[i] = true; - }; - - CubeTextureBase.prototype._iGetMipmapData = function (side) { - if (this._mipmapDataDirtyArray[side]) { - this._mipmapDataDirtyArray[side] = false; - - var mipmapData = this._mipmapDataArray[side] || (this._mipmapDataArray[side] = new Array()); - textures.MipmapGenerator.generateMipMaps(this._iGetTextureData(side), mipmapData, true); - } - - return this._mipmapDataArray[side]; - }; - - CubeTextureBase.prototype._iGetTextureData = function (side) { - throw new AbstractMethodError(); - }; - return CubeTextureBase; - })(textures.TextureProxyBase); - textures.CubeTextureBase = CubeTextureBase; - })(away.textures || (away.textures = {})); - var textures = away.textures; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (textures) { - var ImageTexture = (function (_super) { - __extends(ImageTexture, _super); - /** - * - * @param htmlImageElement - * @param generateMipmaps - */ - function ImageTexture(htmlImageElement, generateMipmaps) { - if (typeof generateMipmaps === "undefined") { generateMipmaps = false; } - _super.call(this, generateMipmaps); - - this.htmlImageElement = htmlImageElement; - } - Object.defineProperty(ImageTexture.prototype, "htmlImageElement", { - /** - * - */ - get: function () { - return this._htmlImageElement; - }, - set: function (value) { - if (this._htmlImageElement == value) - return; - - if (!away.utils.TextureUtils.isHTMLImageElementValid(value)) - throw new away.errors.Error("Invalid bitmapData: Width and height must be power of 2 and cannot exceed 2048"); - - this._htmlImageElement = value; - - this.invalidateContent(); - this._pSetSize(value.width, value.height); - }, - enumerable: true, - configurable: true - }); - - - ImageTexture.prototype._iGetTextureData = function () { - return this._htmlImageElement; - }; - return ImageTexture; - })(textures.Texture2DBase); - textures.ImageTexture = ImageTexture; - })(away.textures || (away.textures = {})); - var textures = away.textures; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (textures) { - var BitmapTexture = (function (_super) { - __extends(BitmapTexture, _super); - function BitmapTexture(bitmapData, generateMipmaps) { - if (typeof generateMipmaps === "undefined") { generateMipmaps = false; } - _super.call(this, generateMipmaps); - - this.bitmapData = bitmapData; - } - Object.defineProperty(BitmapTexture.prototype, "bitmapData", { - /** - * - * @returns {BitmapData} - */ - get: function () { - return this._bitmapData; - }, - set: function (value) { - if (this._bitmapData == value) - return; - - if (!away.utils.TextureUtils.isBitmapDataValid(value)) - throw new Error("Invalid bitmapData: Width and height must be power of 2 and cannot exceed 2048"); - - this._bitmapData = value; - - this.invalidateContent(); - - this._pSetSize(value.width, value.height); - }, - enumerable: true, - configurable: true - }); - - - BitmapTexture.prototype.dispose = function () { - _super.prototype.dispose.call(this); - - this._bitmapData.dispose(); - this._bitmapData = null; - }; - - BitmapTexture.prototype._iGetTextureData = function () { - return this._bitmapData; - }; - return BitmapTexture; - })(textures.Texture2DBase); - textures.BitmapTexture = BitmapTexture; - })(away.textures || (away.textures = {})); - var textures = away.textures; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (textures) { - var RenderTexture = (function (_super) { - __extends(RenderTexture, _super); - function RenderTexture(width, height) { - _super.call(this, false); - - this._pSetSize(width, height); - } - Object.defineProperty(RenderTexture.prototype, "width", { - /** - * - * @returns {number} - */ - get: function () { - return this._pWidth; - }, - set: function (value) { - if (value == this._pWidth) - return; - - if (!away.utils.TextureUtils.isDimensionValid(value)) - throw new Error("Invalid size: Width and height must be power of 2 and cannot exceed 2048"); - - this.invalidateContent(); - - this._pSetSize(value, this._pHeight); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(RenderTexture.prototype, "height", { - /** - * - * @returns {number} - */ - get: function () { - return this._pHeight; - }, - set: function (value) { - if (value == this._pHeight) - return; - - if (!away.utils.TextureUtils.isDimensionValid(value)) - throw new Error("Invalid size: Width and height must be power of 2 and cannot exceed 2048"); - - this.invalidateContent(); - this._pSetSize(this._pWidth, value); - }, - enumerable: true, - configurable: true - }); - - return RenderTexture; - })(textures.Texture2DBase); - textures.RenderTexture = RenderTexture; - })(away.textures || (away.textures = {})); - var textures = away.textures; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (textures) { - var ImageCubeTexture = (function (_super) { - __extends(ImageCubeTexture, _super); - function ImageCubeTexture(posX, negX, posY, negY, posZ, negZ, generateMipmaps) { - if (typeof generateMipmaps === "undefined") { generateMipmaps = false; } - _super.call(this, generateMipmaps); - this._htmlImageElements = new Array(6); - - this._testSize(this._htmlImageElements[0] = posX); - this._testSize(this._htmlImageElements[1] = negX); - this._testSize(this._htmlImageElements[2] = posY); - this._testSize(this._htmlImageElements[3] = negY); - this._testSize(this._htmlImageElements[4] = posZ); - this._testSize(this._htmlImageElements[5] = negZ); - - this.invalidateContent(); - - this._pSetSize(posX.width); - } - Object.defineProperty(ImageCubeTexture.prototype, "positiveX", { - /** - * The texture on the cube's right face. - */ - get: function () { - return this._htmlImageElements[0]; - }, - set: function (value) { - this._testSize(value); - this.invalidateContent(); - this._pSetSize(value.width); - this._htmlImageElements[0] = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ImageCubeTexture.prototype, "negativeX", { - /** - * The texture on the cube's left face. - */ - get: function () { - return this._htmlImageElements[1]; - }, - set: function (value) { - this._testSize(value); - this.invalidateContent(); - this._pSetSize(value.width); - this._htmlImageElements[1] = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ImageCubeTexture.prototype, "positiveY", { - /** - * The texture on the cube's top face. - */ - get: function () { - return this._htmlImageElements[2]; - }, - set: function (value) { - this._testSize(value); - this.invalidateContent(); - this._pSetSize(value.width); - this._htmlImageElements[2] = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ImageCubeTexture.prototype, "negativeY", { - /** - * The texture on the cube's bottom face. - */ - get: function () { - return this._htmlImageElements[3]; - }, - set: function (value) { - this._testSize(value); - this.invalidateContent(); - this._pSetSize(value.width); - this._htmlImageElements[3] = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ImageCubeTexture.prototype, "positiveZ", { - /** - * The texture on the cube's far face. - */ - get: function () { - return this._htmlImageElements[4]; - }, - set: function (value) { - this._testSize(value); - this.invalidateContent(); - this._pSetSize(value.width); - this._htmlImageElements[4] = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ImageCubeTexture.prototype, "negativeZ", { - /** - * The texture on the cube's near face. - */ - get: function () { - return this._htmlImageElements[5]; - }, - set: function (value) { - this._testSize(value); - this.invalidateContent(); - this._pSetSize(value.width); - this._htmlImageElements[5] = value; - }, - enumerable: true, - configurable: true - }); - - - ImageCubeTexture.prototype._testSize = function (value) { - if (value.width != value.height) - throw new Error("BitmapData should have equal width and height!"); - if (!away.utils.TextureUtils.isHTMLImageElementValid(value)) - throw new Error("Invalid bitmapData: Width and height must be power of 2 and cannot exceed 2048"); - }; - - ImageCubeTexture.prototype._iGetTextureData = function (side) { - return this._htmlImageElements[side]; - }; - return ImageCubeTexture; - })(textures.CubeTextureBase); - textures.ImageCubeTexture = ImageCubeTexture; - })(away.textures || (away.textures = {})); - var textures = away.textures; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (textures) { - var BitmapCubeTexture = (function (_super) { - __extends(BitmapCubeTexture, _super); - function BitmapCubeTexture(posX, negX, posY, negY, posZ, negZ, generateMipmaps) { - if (typeof generateMipmaps === "undefined") { generateMipmaps = false; } - _super.call(this, generateMipmaps); - this._bitmapDatas = new Array(6); - - this._testSize(this._bitmapDatas[0] = posX); - this._testSize(this._bitmapDatas[1] = negX); - this._testSize(this._bitmapDatas[2] = posY); - this._testSize(this._bitmapDatas[3] = negY); - this._testSize(this._bitmapDatas[4] = posZ); - this._testSize(this._bitmapDatas[5] = negZ); - - this.invalidateContent(); - - this._pSetSize(posX.width); - } - Object.defineProperty(BitmapCubeTexture.prototype, "positiveX", { - /** - * The texture on the cube's right face. - */ - get: function () { - return this._bitmapDatas[0]; - }, - set: function (value) { - this._testSize(value); - this.invalidateContent(); - this._pSetSize(value.width); - this._bitmapDatas[0] = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(BitmapCubeTexture.prototype, "negativeX", { - /** - * The texture on the cube's left face. - */ - get: function () { - return this._bitmapDatas[1]; - }, - set: function (value) { - this._testSize(value); - this.invalidateContent(); - this._pSetSize(value.width); - this._bitmapDatas[1] = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(BitmapCubeTexture.prototype, "positiveY", { - /** - * The texture on the cube's top face. - */ - get: function () { - return this._bitmapDatas[2]; - }, - set: function (value) { - this._testSize(value); - this.invalidateContent(); - this._pSetSize(value.width); - this._bitmapDatas[2] = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(BitmapCubeTexture.prototype, "negativeY", { - /** - * The texture on the cube's bottom face. - */ - get: function () { - return this._bitmapDatas[3]; - }, - set: function (value) { - this._testSize(value); - this.invalidateContent(); - this._pSetSize(value.width); - this._bitmapDatas[3] = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(BitmapCubeTexture.prototype, "positiveZ", { - /** - * The texture on the cube's far face. - */ - get: function () { - return this._bitmapDatas[4]; - }, - set: function (value) { - this._testSize(value); - this.invalidateContent(); - this._pSetSize(value.width); - this._bitmapDatas[4] = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(BitmapCubeTexture.prototype, "negativeZ", { - /** - * The texture on the cube's near face. - */ - get: function () { - return this._bitmapDatas[5]; - }, - set: function (value) { - this._testSize(value); - this.invalidateContent(); - this._pSetSize(value.width); - this._bitmapDatas[5] = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * - * @param value - * @private - */ - BitmapCubeTexture.prototype._testSize = function (value) { - if (value.width != value.height) - throw new Error("BitmapData should have equal width and height!"); - if (!away.utils.TextureUtils.isBitmapDataValid(value)) - throw new Error("Invalid bitmapData: Width and height must be power of 2 and cannot exceed 2048"); - }; - - BitmapCubeTexture.prototype.dispose = function () { - _super.prototype.dispose.call(this); - - var len = this._bitmapDatas.length; - for (var i = 0; i < len; i++) { - this._bitmapDatas[i].dispose(); - this._bitmapDatas[i] = null; - } - - this._bitmapDatas = null; - }; - - BitmapCubeTexture.prototype._iGetTextureData = function (side) { - return this._bitmapDatas[side]; - }; - return BitmapCubeTexture; - })(textures.CubeTextureBase); - textures.BitmapCubeTexture = BitmapCubeTexture; - })(away.textures || (away.textures = {})); - var textures = away.textures; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (textures) { - var BitmapData = away.base.BitmapData; - var Matrix = away.geom.Matrix; - var Rectangle = away.geom.Rectangle; - - /** - * MipmapGenerator is a helper class that uploads BitmapData to a Texture including mipmap levels. - */ - var MipmapGenerator = (function () { - function MipmapGenerator() { - } - MipmapGenerator.generateMipMaps = function (source, output, alpha) { - if (typeof alpha === "undefined") { alpha = false; } - var w = source.width; - var h = source.height; - var i = 0; - - var mipmap; - - MipmapGenerator._rect.width = w; - MipmapGenerator._rect.height = h; - - while (w >= 1 && h >= 1) { - mipmap = output[i] = MipmapGenerator._getMipmapHolder(output[i], w, h); - - if (alpha) - mipmap.fillRect(MipmapGenerator._rect, 0); - - MipmapGenerator._matrix.a = MipmapGenerator._rect.width / source.width; - MipmapGenerator._matrix.d = MipmapGenerator._rect.height / source.height; - - mipmap.draw(source, MipmapGenerator._matrix); //TODO: smoothing? - - w >>= 1; - h >>= 1; - - MipmapGenerator._rect.width = w > 1 ? w : 1; - MipmapGenerator._rect.height = h > 1 ? h : 1; - - i++; - } - }; - - MipmapGenerator._getMipmapHolder = function (mipMapHolder, newW, newH) { - if (mipMapHolder) { - if (mipMapHolder.width == newW && mipMapHolder.height == newH) - return mipMapHolder; - - MipmapGenerator.freeMipMapHolder(mipMapHolder); - } - - if (!MipmapGenerator._mipMaps[newW]) { - MipmapGenerator._mipMaps[newW] = []; - MipmapGenerator._mipMapUses[newW] = []; - } - - if (!MipmapGenerator._mipMaps[newW][newH]) { - mipMapHolder = MipmapGenerator._mipMaps[newW][newH] = new BitmapData(newW, newH, true); - MipmapGenerator._mipMapUses[newW][newH] = 1; - } else { - MipmapGenerator._mipMapUses[newW][newH] = MipmapGenerator._mipMapUses[newW][newH] + 1; - mipMapHolder = MipmapGenerator._mipMaps[newW][newH]; - } - - return mipMapHolder; - }; - - MipmapGenerator.freeMipMapHolder = function (mipMapHolder) { - var holderWidth = mipMapHolder.width; - var holderHeight = mipMapHolder.height; - - if (--MipmapGenerator._mipMapUses[holderWidth][holderHeight] == 0) { - MipmapGenerator._mipMaps[holderWidth][holderHeight].dispose(); - MipmapGenerator._mipMaps[holderWidth][holderHeight] = null; - } - }; - MipmapGenerator._mipMaps = []; - MipmapGenerator._mipMapUses = []; - - MipmapGenerator._matrix = new Matrix(); - MipmapGenerator._rect = new Rectangle(); - return MipmapGenerator; - })(); - textures.MipmapGenerator = MipmapGenerator; - })(away.textures || (away.textures = {})); - var textures = away.textures; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (textures) { - var BitmapData = away.base.BitmapData; - var BitmapDataChannel = away.base.BitmapDataChannel; - var Point = away.geom.Point; - - /** - * A convenience texture that encodes a specular map in the red channel, and the gloss map in the green channel, as expected by BasicSpecularMapMethod - */ - var SpecularBitmapTexture = (function (_super) { - __extends(SpecularBitmapTexture, _super); - function SpecularBitmapTexture(specularMap, glossMap, generateMipmaps) { - if (typeof specularMap === "undefined") { specularMap = null; } - if (typeof glossMap === "undefined") { glossMap = null; } - if (typeof generateMipmaps === "undefined") { generateMipmaps = true; } - var bmd = specularMap ? specularMap : glossMap; - - bmd = bmd ? new BitmapData(bmd.width, bmd.height, false, 0xffffff) : new BitmapData(1, 1, false, 0xffffff); - - _super.call(this, bmd, generateMipmaps); - - this.specularMap = specularMap; - this.glossMap = glossMap; - } - Object.defineProperty(SpecularBitmapTexture.prototype, "specularMap", { - get: function () { - return this._specularMap; - }, - set: function (value) { - this._specularMap = value; - - this.invalidateContent(); - - this._testSize(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(SpecularBitmapTexture.prototype, "glossMap", { - get: function () { - return this._glossMap; - }, - set: function (value) { - this._glossMap = value; - this.invalidateContent(); - - this._testSize(); - }, - enumerable: true, - configurable: true - }); - - - SpecularBitmapTexture.prototype._testSize = function () { - var w, h; - - if (this._specularMap) { - w = this._specularMap.width; - h = this._specularMap.height; - } else if (this._glossMap) { - w = this._glossMap.width; - h = this._glossMap.height; - } else { - w = 1; - h = 1; - } - - if (w != this._bitmapData.width && h != this._bitmapData.height) { - var oldBitmap = this._bitmapData; - this.bitmapData = new BitmapData(this._specularMap.width, this._specularMap.height, false, 0xffffff); - oldBitmap.dispose(); - } - }; - - SpecularBitmapTexture.prototype._iGetTextureData = function () { - var rect = this._specularMap.rect; - var origin = new Point(); - - this._bitmapData.fillRect(rect, 0xffffff); - - if (this._glossMap) - this._bitmapData.copyChannel(this._glossMap, rect, origin, BitmapDataChannel.GREEN, BitmapDataChannel.GREEN); - - if (this._specularMap) - this._bitmapData.copyChannel(this._specularMap, rect, origin, BitmapDataChannel.RED, BitmapDataChannel.RED); - - return this._bitmapData; - }; - return SpecularBitmapTexture; - })(textures.BitmapTexture); - textures.SpecularBitmapTexture = SpecularBitmapTexture; - })(away.textures || (away.textures = {})); - var textures = away.textures; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (parsers) { - var AbstractMethodError = away.errors.AbstractMethodError; - var AssetEvent = away.events.AssetEvent; - var ParserEvent = away.events.ParserEvent; - var TimerEvent = away.events.TimerEvent; - - var TextureUtils = away.utils.TextureUtils; - var Timer = away.utils.Timer; - - /** - * ParserBase provides an abstract base class for objects that convert blocks of data to data structures - * supported by away. - * - * If used by AssetLoader to automatically determine the parser type, two public static methods should - * be implemented, with the following signatures: - * - * public static supportsType(extension : string) : boolean - * Indicates whether or not a given file extension is supported by the parser. - * - * public static supportsData(data : *) : boolean - * Tests whether a data block can be parsed by the parser. - * - * Furthermore, for any concrete subtype, the method initHandle should be overridden to immediately - * create the object that will contain the parsed data. This allows ResourceManager to return an object - * handle regardless of whether the object was loaded or not. - * - * @see away.net.AssetLoader - */ - var ParserBase = (function (_super) { - __extends(ParserBase, _super); - /** - * Creates a new ParserBase object - * @param format The data format of the file data to be parsed. Can be either ParserDataFormat.BINARY or ParserDataFormat.PLAIN_TEXT, and should be provided by the concrete subtype. - * - * @see away.loading.parsers.ParserDataFormat - */ - function ParserBase(format) { - _super.call(this); - - this._materialMode = 0; - this._dataFormat = format; - this._dependencies = new Array(); - - this._pOnIntervalDelegate = away.utils.Delegate.create(this, this._pOnInterval); - } - //---------------------------------------------------------------------------------------------------------------------------------------------------------------- - // TODO: add error checking for the following ( could cause a problem if this function is not implemented ) - //---------------------------------------------------------------------------------------------------------------------------------------------------------------- - // Needs to be implemented in all Parsers ( - //public static supportsType(extension : string) : boolean - //* Indicates whether or not a given file extension is supported by the parser. - //---------------------------------------------------------------------------------------------------------------------------------------------------------------- - ParserBase.supportsType = function (extension) { - throw new AbstractMethodError(); - }; - - Object.defineProperty(ParserBase.prototype, "content", { - /* Protected */ - get: function () { - return this._pContent; - }, - enumerable: true, - configurable: true - }); - - /** - * Validates a bitmapData loaded before assigning to a default BitmapMaterial - */ - ParserBase.prototype.isBitmapDataValid = function (bitmapData) { - var isValid = TextureUtils.isBitmapDataValid(bitmapData); - - if (!isValid) { - console.log(">> Bitmap loaded is not having power of 2 dimensions or is higher than 2048"); - } - - return isValid; - }; - - - Object.defineProperty(ParserBase.prototype, "parsingFailure", { - get: function () { - return this._parsingFailure; - }, - set: function (b) { - this._parsingFailure = b; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ParserBase.prototype, "parsingPaused", { - get: function () { - return this._parsingPaused; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ParserBase.prototype, "parsingComplete", { - get: function () { - return this._parsingComplete; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ParserBase.prototype, "materialMode", { - get: function () { - return this._materialMode; - }, - set: function (newMaterialMode) { - this._materialMode = newMaterialMode; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ParserBase.prototype, "data", { - get: function () { - return this._data; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ParserBase.prototype, "dataFormat", { - /** - * The data format of the file data to be parsed. Options are URLLoaderDataFormat.BINARY, URLLoaderDataFormat.ARRAY_BUFFER, URLLoaderDataFormat.BLOB, URLLoaderDataFormat.VARIABLES or URLLoaderDataFormat.TEXT. - */ - get: function () { - return this._dataFormat; - }, - enumerable: true, - configurable: true - }); - - /** - * Parse data (possibly containing bytearry, plain text or BitmapAsset) asynchronously, meaning that - * the parser will periodically stop parsing so that the AVM may proceed to the - * next frame. - * - * @param data The untyped data object in which the loaded data resides. - * @param frameLimit number of milliseconds of parsing allowed per frame. The - * actual time spent on a frame can exceed this number since time-checks can - * only be performed between logical sections of the parsing procedure. - */ - ParserBase.prototype.parseAsync = function (data, frameLimit) { - if (typeof frameLimit === "undefined") { frameLimit = 30; } - this._data = data; - this._pStartParsing(frameLimit); - }; - - Object.defineProperty(ParserBase.prototype, "dependencies", { - /** - * A list of dependencies that need to be loaded and resolved for the object being parsed. - */ - get: function () { - return this._dependencies; - }, - enumerable: true, - configurable: true - }); - - /** - * Resolve a dependency when it's loaded. For example, a dependency containing an ImageResource would be assigned - * to a Mesh instance as a BitmapMaterial, a scene graph object would be added to its intended parent. The - * dependency should be a member of the dependencies property. - * - * @param resourceDependency The dependency to be resolved. - */ - ParserBase.prototype._iResolveDependency = function (resourceDependency) { - throw new AbstractMethodError(); - }; - - /** - * Resolve a dependency loading failure. Used by parser to eventually provide a default map - * - * @param resourceDependency The dependency to be resolved. - */ - ParserBase.prototype._iResolveDependencyFailure = function (resourceDependency) { - throw new AbstractMethodError(); - }; - - /** - * Resolve a dependency name - * - * @param resourceDependency The dependency to be resolved. - */ - ParserBase.prototype._iResolveDependencyName = function (resourceDependency, asset) { - return asset.name; - }; - - ParserBase.prototype._iResumeParsingAfterDependencies = function () { - this._parsingPaused = false; - - if (this._timer) - this._timer.start(); - }; - - ParserBase.prototype._pFinalizeAsset = function (asset, name) { - if (typeof name === "undefined") { name = null; } - var type_event; - var type_name; - - if (name != null) - asset.name = name; - - // If the asset has no name, give it - // a per-type default name. - if (!asset.name) - asset.name = asset.assetType; - - this.dispatchEvent(new AssetEvent(AssetEvent.ASSET_COMPLETE, asset)); - }; - - /** - * Parse the next block of data. - * @return Whether or not more data needs to be parsed. Can be ParserBase.ParserBase.PARSING_DONE or - * ParserBase.ParserBase.MORE_TO_PARSE. - */ - ParserBase.prototype._pProceedParsing = function () { - throw new AbstractMethodError(); - }; - - ParserBase.prototype._pDieWithError = function (message) { - if (typeof message === "undefined") { message = 'Unknown parsing error'; } - if (this._timer) { - this._timer.removeEventListener(TimerEvent.TIMER, this._pOnIntervalDelegate); - this._timer.stop(); - this._timer = null; - } - - this.dispatchEvent(new ParserEvent(ParserEvent.PARSE_ERROR, message)); - }; - - ParserBase.prototype._pAddDependency = function (id, req, retrieveAsRawData, data, suppressErrorEvents) { - if (typeof retrieveAsRawData === "undefined") { retrieveAsRawData = false; } - if (typeof data === "undefined") { data = null; } - if (typeof suppressErrorEvents === "undefined") { suppressErrorEvents = false; } - var dependency = new parsers.ResourceDependency(id, req, data, null, this, retrieveAsRawData, suppressErrorEvents); - this._dependencies.push(dependency); - - return dependency; - }; - - ParserBase.prototype._pPauseAndRetrieveDependencies = function () { - if (this._timer) - this._timer.stop(); - - this._parsingPaused = true; - this.dispatchEvent(new ParserEvent(ParserEvent.READY_FOR_DEPENDENCIES)); - }; - - /** - * Tests whether or not there is still time left for parsing within the maximum allowed time frame per session. - * @return True if there is still time left, false if the maximum allotted time was exceeded and parsing should be interrupted. - */ - ParserBase.prototype._pHasTime = function () { - return ((away.utils.getTimer() - this._lastFrameTime) < this._frameLimit); - }; - - /** - * Called when the parsing pause interval has passed and parsing can proceed. - */ - ParserBase.prototype._pOnInterval = function (event) { - if (typeof event === "undefined") { event = null; } - this._lastFrameTime = away.utils.getTimer(); - - if (this._pProceedParsing() && !this._parsingFailure) - this._pFinishParsing(); - }; - - /** - * Initializes the parsing of data. - * @param frameLimit The maximum duration of a parsing session. - */ - ParserBase.prototype._pStartParsing = function (frameLimit) { - this._frameLimit = frameLimit; - this._timer = new Timer(this._frameLimit, 0); - this._timer.addEventListener(TimerEvent.TIMER, this._pOnIntervalDelegate); - this._timer.start(); - }; - - /** - * Finish parsing the data. - */ - ParserBase.prototype._pFinishParsing = function () { - if (this._timer) { - this._timer.removeEventListener(TimerEvent.TIMER, this._pOnIntervalDelegate); - this._timer.stop(); - } - - this._timer = null; - this._parsingComplete = true; - - this.dispatchEvent(new ParserEvent(ParserEvent.PARSE_COMPLETE)); - }; - - /** - * - * @returns {string} - * @private - */ - ParserBase.prototype._pGetTextData = function () { - return parsers.ParserUtils.toString(this._data); - }; - - /** - * - * @returns {string} - * @private - */ - ParserBase.prototype._pGetByteData = function () { - return parsers.ParserUtils.toByteArray(this._data); - }; - ParserBase.PARSING_DONE = true; - - ParserBase.MORE_TO_PARSE = false; - return ParserBase; - })(away.events.EventDispatcher); - parsers.ParserBase = ParserBase; - })(away.parsers || (away.parsers = {})); - var parsers = away.parsers; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (parsers) { - var ImageCubeTexture = away.textures.ImageCubeTexture; - - /** - * CubeTextureParser provides a "parser" for natively supported image types (jpg, png). While it simply loads bytes into - * a loader object, it wraps it in a BitmapDataResource so resource management can happen consistently without - * exception cases. - */ - var CubeTextureParser = (function (_super) { - __extends(CubeTextureParser, _super); - /** - * Creates a new CubeTextureParser object. - * @param uri The url or id of the data or file to be parsed. - * @param extra The holder for extra contextual data that the parser might need. - */ - function CubeTextureParser() { - _super.call(this, away.net.URLLoaderDataFormat.TEXT); - } - /** - * Indicates whether or not a given file extension is supported by the parser. - * @param extension The file extension of a potential file to be parsed. - * @return Whether or not the given file type is supported. - */ - CubeTextureParser.supportsType = function (extension) { - extension = extension.toLowerCase(); - return extension == "cube"; - }; - - /** - * Tests whether a data block can be parsed by the parser. - * @param data The data block to potentially be parsed. - * @return Whether or not the given data is supported. - */ - CubeTextureParser.supportsData = function (data) { - try { - var obj = JSON.parse(data); - - if (obj) { - return true; - } - return false; - } catch (e) { - return false; - } - - return false; - }; - - /** - * @inheritDoc - */ - CubeTextureParser.prototype._iResolveDependency = function (resourceDependency) { - }; - - /** - * @inheritDoc - */ - CubeTextureParser.prototype._iResolveDependencyFailure = function (resourceDependency) { - }; - - /** - * @inheritDoc - */ - CubeTextureParser.prototype._pProceedParsing = function () { - if (this._imgDependencyDictionary != null) { - var asset = new ImageCubeTexture(this._getHTMLImageElement(CubeTextureParser.posX), this._getHTMLImageElement(CubeTextureParser.negX), this._getHTMLImageElement(CubeTextureParser.posY), this._getHTMLImageElement(CubeTextureParser.negY), this._getHTMLImageElement(CubeTextureParser.posZ), this._getHTMLImageElement(CubeTextureParser.negZ)); - - //clear dictionary - this._imgDependencyDictionary = null; - - asset.name = this._iFileName; - - this._pFinalizeAsset(asset, this._iFileName); - - return parsers.ParserBase.PARSING_DONE; - } - - try { - var json = JSON.parse(this.data); - var data = json.data; - var rec; - - if (data.length != 6) - this._pDieWithError('CubeTextureParser: Error - cube texture should have exactly 6 images'); - - if (json) { - this._imgDependencyDictionary = new Object(); - - for (var c = 0; c < data.length; c++) { - rec = data[c]; - this._imgDependencyDictionary[rec.id] = this._pAddDependency(rec.id, new away.net.URLRequest(rec.image.toString())); - } - - if (!this._validateCubeData()) { - this._pDieWithError("CubeTextureParser: JSON data error - cubes require id of: \n" + CubeTextureParser.posX + ', ' + CubeTextureParser.negX + ', \n' + CubeTextureParser.posY + ', ' + CubeTextureParser.negY + ', \n' + CubeTextureParser.posZ + ', ' + CubeTextureParser.negZ); - - return parsers.ParserBase.PARSING_DONE; - } - - this._pPauseAndRetrieveDependencies(); - - return parsers.ParserBase.MORE_TO_PARSE; - } - } catch (e) { - this._pDieWithError('CubeTexturePaser Error parsing JSON'); - } - - return parsers.ParserBase.PARSING_DONE; - }; - - CubeTextureParser.prototype._validateCubeData = function () { - return (this._imgDependencyDictionary[CubeTextureParser.posX] != null && this._imgDependencyDictionary[CubeTextureParser.negX] != null && this._imgDependencyDictionary[CubeTextureParser.posY] != null && this._imgDependencyDictionary[CubeTextureParser.negY] != null && this._imgDependencyDictionary[CubeTextureParser.posZ] != null && this._imgDependencyDictionary[CubeTextureParser.negZ] != null); - }; - - CubeTextureParser.prototype._getHTMLImageElement = function (name) { - var dependency = this._imgDependencyDictionary[name]; - - if (dependency) { - return dependency.assets[0].htmlImageElement; - } - - return null; - }; - CubeTextureParser.posX = 'posX'; - CubeTextureParser.negX = 'negX'; - CubeTextureParser.posY = 'posY'; - CubeTextureParser.negY = 'negY'; - CubeTextureParser.posZ = 'posZ'; - CubeTextureParser.negZ = 'negZ'; - return CubeTextureParser; - })(parsers.ParserBase); - parsers.CubeTextureParser = CubeTextureParser; - })(away.parsers || (away.parsers = {})); - var parsers = away.parsers; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (parsers) { - var URLLoaderDataFormat = away.net.URLLoaderDataFormat; - var ImageTexture = away.textures.ImageTexture; - - var ByteArray = away.utils.ByteArray; - var TextureUtils = away.utils.TextureUtils; - - /** - * Texture2DParser provides a "parser" for natively supported image types (jpg, png). While it simply loads bytes into - * a loader object, it wraps it in a BitmapDataResource so resource management can happen consistently without - * exception cases. - */ - var Texture2DParser = (function (_super) { - __extends(Texture2DParser, _super); - /** - * Creates a new Texture2DParser object. - * @param uri The url or id of the data or file to be parsed. - * @param extra The holder for extra contextual data that the parser might need. - */ - function Texture2DParser() { - _super.call(this, URLLoaderDataFormat.ARRAY_BUFFER); - } - /** - * Indicates whether or not a given file extension is supported by the parser. - * @param extension The file extension of a potential file to be parsed. - * @return Whether or not the given file type is supported. - */ - Texture2DParser.supportsType = function (extension) { - extension = extension.toLowerCase(); - return extension == "jpg" || extension == "jpeg" || extension == "png" || extension == "gif"; - }; - - /** - * Tests whether a data block can be parsed by the parser. - * @param data The data block to potentially be parsed. - * @return Whether or not the given data is supported. - */ - Texture2DParser.supportsData = function (data) { - if (data instanceof HTMLImageElement) - return true; - - if (!(data instanceof ByteArray)) - return false; - - var ba = data; - ba.position = 0; - - if (ba.readUnsignedShort() == 0xffd8) - return true; - - ba.position = 0; - if (ba.readShort() == 0x424D) - return true; - - ba.position = 1; - if (ba.readUTFBytes(3) == 'PNG') - return true; - - ba.position = 0; - if (ba.readUTFBytes(3) == 'GIF' && ba.readShort() == 0x3839 && ba.readByte() == 0x61) - return true; - - ba.position = 0; - if (ba.readUTFBytes(3) == 'ATF') - return true; - - return false; - }; - - /** - * @inheritDoc - */ - Texture2DParser.prototype._pProceedParsing = function () { - var _this = this; - var asset; - var sizeError = false; - - if (this._loadingImage) { - return parsers.ParserBase.MORE_TO_PARSE; - } else if (this._htmlImageElement) { - if (TextureUtils.isHTMLImageElementValid(this._htmlImageElement)) { - asset = new ImageTexture(this._htmlImageElement); - this._pFinalizeAsset(asset, this._iFileName); - } - } else if (this.data instanceof HTMLImageElement) { - if (TextureUtils.isHTMLImageElementValid(this.data)) { - asset = new ImageTexture(this.data); - this._pFinalizeAsset(asset, this._iFileName); - } else { - sizeError = true; - } - } else if (this.data instanceof ByteArray) { - var ba = this.data; - ba.position = 0; - var htmlImageElement = parsers.ParserUtils.byteArrayToImage(this.data); - - if (TextureUtils.isHTMLImageElementValid(htmlImageElement)) { - asset = new ImageTexture(htmlImageElement); - this._pFinalizeAsset(asset, this._iFileName); - } else { - sizeError = true; - } - } else if (this.data instanceof ArrayBuffer) { - this._htmlImageElement = parsers.ParserUtils.arrayBufferToImage(this.data); - - asset = new ImageTexture(this._htmlImageElement); - this._pFinalizeAsset(asset, this._iFileName); - } else if (this.data instanceof Blob) { - this._htmlImageElement = parsers.ParserUtils.blobToImage(this.data); - - this._htmlImageElement.onload = function (event) { - return _this.onLoadComplete(event); - }; - this._loadingImage = true; - - return parsers.ParserBase.MORE_TO_PARSE; - } - - if (sizeError == true) { - // asset = new BitmapTexture(away.materials.DefaultMaterialManager.createCheckeredBitmapData(), false); - // this._pFinalizeAsset( asset, this._iFileName); - // this.dispatchEvent(new away.events.AssetEvent(away.events.AssetEvent.TEXTURE_SIZE_ERROR, asset)); - } - - this._pContent = new away.entities.Billboard(new away.materials.CSSMaterialBase(asset)); - - return parsers.ParserBase.PARSING_DONE; - }; - - Texture2DParser.prototype.onLoadComplete = function (event) { - this._loadingImage = false; - }; - return Texture2DParser; - })(parsers.ParserBase); - parsers.Texture2DParser = Texture2DParser; - })(away.parsers || (away.parsers = {})); - var parsers = away.parsers; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (parsers) { - /** - * An enumeration providing values to describe the data format of parsed data. - */ - var ParserDataFormat = (function () { - function ParserDataFormat() { - } - ParserDataFormat.BINARY = "binary"; - - ParserDataFormat.PLAIN_TEXT = "plainText"; - - ParserDataFormat.IMAGE = "image"; - return ParserDataFormat; - })(); - parsers.ParserDataFormat = ParserDataFormat; - })(away.parsers || (away.parsers = {})); - var parsers = away.parsers; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (parsers) { - var ByteArray = away.utils.ByteArray; - - var ParserUtils = (function () { - function ParserUtils() { - } - /** - * Converts an ArrayBuffer to a base64 string - * - * @param image data as a ByteArray - * - * @return HTMLImageElement - * - */ - ParserUtils.arrayBufferToImage = function (data) { - var byteStr = ''; - var bytes = new Uint8Array(data); - var len = bytes.byteLength; - - for (var i = 0; i < len; i++) - byteStr += String.fromCharCode(bytes[i]); - - var base64Image = window.btoa(byteStr); - var str = 'data:image/png;base64,' + base64Image; - var img = new Image(); - img.src = str; - - return img; - }; - - /** - * Converts an ByteArray to an Image - returns an HTMLImageElement - * - * @param image data as a ByteArray - * - * @return HTMLImageElement - * - */ - ParserUtils.byteArrayToImage = function (data) { - var byteStr = ''; - var bytes = new Uint8Array(data.arraybytes); - var len = bytes.byteLength; - - for (var i = 0; i < len; i++) - byteStr += String.fromCharCode(bytes[i]); - - var base64Image = window.btoa(byteStr); - var str = 'data:image/png;base64,' + base64Image; - var img = new Image(); - img.src = str; - - return img; - }; - - /** - * Converts an Blob to an Image - returns an HTMLImageElement - * - * @param image data as a Blob - * - * @return HTMLImageElement - * - */ - ParserUtils.blobToImage = function (data) { - var URLObj = window['URL'] || window['webkitURL']; - var src = URLObj.createObjectURL(data); - var img = new Image(); - img.src = src; - - return img; - }; - - /** - * Returns a object as ByteArray, if possible. - * - * @param data The object to return as ByteArray - * - * @return The ByteArray or null - * - */ - ParserUtils.toByteArray = function (data) { - var b = new ByteArray(); - b.setArrayBuffer(data); - return b; - }; - - /** - * Returns a object as String, if possible. - * - * @param data The object to return as String - * @param length The length of the returned String - * - * @return The String or null - * - */ - ParserUtils.toString = function (data, length) { - if (typeof length === "undefined") { length = 0; } - if (typeof data === 'string') { - var s = data; - - if (s['substr'] != null) - return s.substr(0, s.length); - } - - if (data instanceof ByteArray) { - var ba = data; - ba.position = 0; - return ba.readUTFBytes(Math.min(ba.getBytesAvailable(), length)); - } - - return null; - /* - var ba:ByteArray; - - length ||= uint.MAX_VALUE; - - if (data is String) - return String(data).substr(0, length); - - ba = toByteArray(data); - if (ba) { - ba.position = 0; - return ba.readUTFBytes(Math.min(ba.bytesAvailable, length)); - } - - return null; - - */ - }; - return ParserUtils; - })(); - parsers.ParserUtils = ParserUtils; - })(away.parsers || (away.parsers = {})); - var parsers = away.parsers; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (parsers) { - /** - * ResourceDependency represents the data required to load, parse and resolve additional files ("dependencies") - * required by a parser, used by ResourceLoadSession. - * - */ - var ResourceDependency = (function () { - function ResourceDependency(id, request, data, parser, parentParser, retrieveAsRawData, suppressAssetEvents) { - if (typeof retrieveAsRawData === "undefined") { retrieveAsRawData = false; } - if (typeof suppressAssetEvents === "undefined") { suppressAssetEvents = false; } - this._id = id; - this._request = request; - this._data = data; - this._parser = parser; - this._parentParser = parentParser; - this._retrieveAsRawData = retrieveAsRawData; - this._suppressAssetEvents = suppressAssetEvents; - - this._assets = new Array(); - this._dependencies = new Array(); - } - Object.defineProperty(ResourceDependency.prototype, "id", { - /** - * - */ - get: function () { - return this._id; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ResourceDependency.prototype, "request", { - /** - * - */ - get: function () { - return this._request; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ResourceDependency.prototype, "data", { - /** - * The data containing the dependency to be parsed, if the resource was already loaded. - */ - get: function () { - return this._data; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ResourceDependency.prototype, "parser", { - /** - * - */ - get: function () { - return this._parser; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ResourceDependency.prototype, "parentParser", { - /** - * The parser which is dependent on this ResourceDependency object. - */ - get: function () { - return this._parentParser; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ResourceDependency.prototype, "retrieveAsRawData", { - /** - * - */ - get: function () { - return this._retrieveAsRawData; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ResourceDependency.prototype, "suppresAssetEvents", { - /** - * - */ - get: function () { - return this._suppressAssetEvents; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ResourceDependency.prototype, "assets", { - /** - * - */ - get: function () { - return this._assets; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ResourceDependency.prototype, "dependencies", { - /** - * - */ - get: function () { - return this._dependencies; - }, - enumerable: true, - configurable: true - }); - - /** - * @private - * Method to set data after having already created the dependency object, e.g. after load. - */ - ResourceDependency.prototype._iSetData = function (data) { - this._data = data; - }; - - /** - * @private - * - */ - ResourceDependency.prototype._iSetParser = function (parser) { - this._parser = parser; - }; - - /** - * Resolve the dependency when it's loaded with the parent parser. For example, a dependency containing an - * ImageResource would be assigned to a Mesh instance as a BitmapMaterial, a scene graph object would be added - * to its intended parent. The dependency should be a member of the dependencies property. - */ - ResourceDependency.prototype.resolve = function () { - if (this._parentParser) - this._parentParser._iResolveDependency(this); - }; - - /** - * Resolve a dependency failure. For example, map loading failure from a 3d file - */ - ResourceDependency.prototype.resolveFailure = function () { - if (this._parentParser) - this._parentParser._iResolveDependencyFailure(this); - }; - - /** - * Resolve the dependencies name - */ - ResourceDependency.prototype.resolveName = function (asset) { - if (this._parentParser) - return this._parentParser._iResolveDependencyName(this, asset); - - return asset.name; - }; - return ResourceDependency; - })(); - parsers.ResourceDependency = ResourceDependency; - })(away.parsers || (away.parsers = {})); - var parsers = away.parsers; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (library) { - var AssetLoaderContext = (function () { - /** - * AssetLoaderContext provides configuration for the AssetLoader load() and parse() operations. - * Use it to configure how (and if) dependencies are loaded, or to map dependency URLs to - * embedded data. - * - * @see away.loading.AssetLoader - */ - function AssetLoaderContext(includeDependencies, dependencyBaseUrl) { - if (typeof includeDependencies === "undefined") { includeDependencies = true; } - if (typeof dependencyBaseUrl === "undefined") { dependencyBaseUrl = null; } - this._includeDependencies = includeDependencies; - this._dependencyBaseUrl = dependencyBaseUrl || ''; - this._embeddedDataByUrl = {}; - this._remappedUrls = {}; - this._materialMode = AssetLoaderContext.UNDEFINED; - } - Object.defineProperty(AssetLoaderContext.prototype, "includeDependencies", { - /** - * Defines whether dependencies (all files except the one at the URL given to the load() or - * parseData() operations) should be automatically loaded. Defaults to true. - */ - get: function () { - return this._includeDependencies; - }, - set: function (val) { - this._includeDependencies = val; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(AssetLoaderContext.prototype, "materialMode", { - /** - * MaterialMode defines, if the Parser should create SinglePass or MultiPass Materials - * Options: - * 0 (Default / undefined) - All Parsers will create SinglePassMaterials, but the AWD2.1parser will create Materials as they are defined in the file - * 1 (Force SinglePass) - All Parsers create SinglePassMaterials - * 2 (Force MultiPass) - All Parsers will create MultiPassMaterials - * - */ - get: function () { - return this._materialMode; - }, - set: function (materialMode) { - this._materialMode = materialMode; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(AssetLoaderContext.prototype, "dependencyBaseUrl", { - /** - * A base URL that will be prepended to all relative dependency URLs found in a loaded resource. - * Absolute paths will not be affected by the value of this property. - */ - get: function () { - return this._dependencyBaseUrl; - }, - set: function (val) { - this._dependencyBaseUrl = val; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(AssetLoaderContext.prototype, "overrideAbsolutePaths", { - /** - * Defines whether absolute paths (defined as paths that begin with a "/") should be overridden - * with the dependencyBaseUrl defined in this context. If this is true, and the base path is - * "base", /path/to/asset.jpg will be resolved as base/path/to/asset.jpg. - */ - get: function () { - return this._overrideAbsPath; - }, - set: function (val) { - this._overrideAbsPath = val; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(AssetLoaderContext.prototype, "overrideFullURLs", { - /** - * Defines whether "full" URLs (defined as a URL that includes a scheme, e.g. http://) should be - * overridden with the dependencyBaseUrl defined in this context. If this is true, and the base - * path is "base", http://example.com/path/to/asset.jpg will be resolved as base/path/to/asset.jpg. - */ - get: function () { - return this._overrideFullUrls; - }, - set: function (val) { - this._overrideFullUrls = val; - }, - enumerable: true, - configurable: true - }); - - - /** - * Map a URL to another URL, so that files that are referred to by the original URL will instead - * be loaded from the new URL. Use this when your file structure does not match the one that is - * expected by the loaded file. - * - * @param originalUrl The original URL which is referenced in the loaded resource. - * @param newUrl The URL from which away.should load the resource instead. - * - * @see mapUrlToData() - */ - AssetLoaderContext.prototype.mapUrl = function (originalUrl, newUrl) { - this._remappedUrls[originalUrl] = newUrl; - }; - - /** - * Map a URL to embedded data, so that instead of trying to load a dependency from the URL at - * which it's referenced, the dependency data will be retrieved straight from the memory instead. - * - * @param originalUrl The original URL which is referenced in the loaded resource. - * @param data The embedded data. Can be ByteArray or a class which can be used to create a bytearray. - */ - AssetLoaderContext.prototype.mapUrlToData = function (originalUrl, data) { - this._embeddedDataByUrl[originalUrl] = data; - }; - - /** - * @private - * Defines whether embedded data has been mapped to a particular URL. - */ - AssetLoaderContext.prototype._iHasDataForUrl = function (url) { - return this._embeddedDataByUrl.hasOwnProperty(url); - }; - - /** - * @private - * Returns embedded data for a particular URL. - */ - AssetLoaderContext.prototype._iGetDataForUrl = function (url) { - return this._embeddedDataByUrl[url]; - }; - - /** - * @private - * Defines whether a replacement URL has been mapped to a particular URL. - */ - AssetLoaderContext.prototype._iHasMappingForUrl = function (url) { - return this._remappedUrls.hasOwnProperty(url); - }; - - /** - * @private - * Returns new (replacement) URL for a particular original URL. - */ - AssetLoaderContext.prototype._iGetRemappedUrl = function (originalUrl) { - return this._remappedUrls[originalUrl]; - }; - AssetLoaderContext.UNDEFINED = 0; - AssetLoaderContext.SINGLEPASS_MATERIALS = 1; - AssetLoaderContext.MULTIPASS_MATERIALS = 2; - return AssetLoaderContext; - })(); - library.AssetLoaderContext = AssetLoaderContext; - })(away.library || (away.library = {})); - var library = away.library; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (library) { - var URLLoader = away.net.URLLoader; - var URLLoaderDataFormat = away.net.URLLoaderDataFormat; - - var CubeTextureParser = away.parsers.CubeTextureParser; - - var ResourceDependency = away.parsers.ResourceDependency; - var Texture2DParser = away.parsers.Texture2DParser; - - /** - * Dispatched when any asset finishes parsing. Also see specific events for each - * individual asset type (meshes, materials et c.) - * - * @eventType away.events.AssetEvent - */ - //[Event(name="assetComplete", type="away3d.events.AssetEvent")] - /** - * Dispatched when a full resource (including dependencies) finishes loading. - * - * @eventType away.events.LoaderEvent - */ - //[Event(name="resourceComplete", type="away3d.events.LoaderEvent")] - /** - * Dispatched when a single dependency (which may be the main file of a resource) - * finishes loading. - * - * @eventType away.events.LoaderEvent - */ - //[Event(name="dependencyComplete", type="away3d.events.LoaderEvent")] - /** - * Dispatched when an error occurs during loading. I - * - * @eventType away.events.LoaderEvent - */ - //[Event(name="loadError", type="away3d.events.LoaderEvent")] - /** - * Dispatched when an error occurs during parsing. - * - * @eventType away.events.ParserEvent - */ - //[Event(name="parseError", type="away3d.events.ParserEvent")] - /** - * Dispatched when an image asset dimensions are not a power of 2 - * - * @eventType away.events.AssetEvent - */ - //[Event(name="textureSizeError", type="away3d.events.AssetEvent")] - /** - * AssetLoader can load any file format that away.supports (or for which a third-party parser - * has been plugged in) and it's dependencies. Events are dispatched when assets are encountered - * and for when the resource (or it's dependencies) have been loaded. - * - * The AssetLoader will not make assets available in any other way than through the dispatched - * events. To store assets and make them available at any point from any module in an application, - * use the AssetLibrary to load and manage assets. - * - * @see away.library.AssetLibrary - */ - var AssetLoader = (function (_super) { - __extends(AssetLoader, _super); - /** - * Create a new ResourceLoadSession object. - */ - function AssetLoader(materialMode) { - if (typeof materialMode === "undefined") { materialMode = 0; } - _super.call(this); - - this._materialMode = materialMode; - - this._stack = new Array(); - this._errorHandlers = new Array(); - this._parseErrorHandlers = new Array(); - - this._onReadyForDependenciesDelegate = away.utils.Delegate.create(this, this.onReadyForDependencies); - this._onParseCompleteDelegate = away.utils.Delegate.create(this, this.onParseComplete); - this._onParseErrorDelegate = away.utils.Delegate.create(this, this.onParseError); - this._onLoadCompleteDelegate = away.utils.Delegate.create(this, this.onLoadComplete); - this._onLoadErrorDelegate = away.utils.Delegate.create(this, this.onLoadError); - this._onTextureSizeErrorDelegate = away.utils.Delegate.create(this, this.onTextureSizeError); - this._onAssetCompleteDelegate = away.utils.Delegate.create(this, this.onAssetComplete); - } - /** - * Enables a specific parser. - * When no specific parser is set for a loading/parsing opperation, - * loader3d can autoselect the correct parser to use. - * A parser must have been enabled, to be considered when autoselecting the parser. - * - * @param parser The parser class to enable. - * - * @see away.parsers.Parsers - */ - AssetLoader.enableParser = function (parser) { - if (AssetLoader._parsers.indexOf(parser) < 0) - AssetLoader._parsers.push(parser); - }; - - /** - * Enables a list of parsers. - * When no specific parser is set for a loading/parsing opperation, - * AssetLoader can autoselect the correct parser to use. - * A parser must have been enabled, to be considered when autoselecting the parser. - * - * @param parsers A Vector of parser classes to enable. - * @see away.parsers.Parsers - */ - AssetLoader.enableParsers = function (parsers) { - for (var c = 0; c < parsers.length; c++) - AssetLoader.enableParser(parsers[c]); - }; - - Object.defineProperty(AssetLoader.prototype, "baseDependency", { - /** - * Returns the base dependency of the loader - */ - get: function () { - return this._baseDependency; - }, - enumerable: true, - configurable: true - }); - - /** - * Loads a file and (optionally) all of its dependencies. - * - * @param req The URLRequest object containing the URL of the file to be loaded. - * @param context An optional context object providing additional parameters for loading - * @param ns An optional namespace string under which the file is to be loaded, allowing the differentiation of two resources with identical assets - * @param parser An optional parser object for translating the loaded data into a usable resource. If not provided, AssetLoader will attempt to auto-detect the file type. - */ - AssetLoader.prototype.load = function (req, context, ns, parser) { - if (typeof context === "undefined") { context = null; } - if (typeof ns === "undefined") { ns = null; } - if (typeof parser === "undefined") { parser = null; } - if (!this._token) { - this._token = new library.AssetLoaderToken(this); - - this._uri = req.url = req.url.replace(/\\/g, "/"); - this._context = context; - this._namespace = ns; - - this._baseDependency = new ResourceDependency('', req, null, parser, null); - this.retrieveDependency(this._baseDependency); - - return this._token; - } - - // TODO: Throw error (already loading) - return null; - }; - - /** - * Loads a resource from already loaded data. - * - * @param data The data object containing all resource information. - * @param context An optional context object providing additional parameters for loading - * @param ns An optional namespace string under which the file is to be loaded, allowing the differentiation of two resources with identical assets - * @param parser An optional parser object for translating the loaded data into a usable resource. If not provided, AssetLoader will attempt to auto-detect the file type. - */ - AssetLoader.prototype.loadData = function (data, id, context, ns, parser) { - if (typeof context === "undefined") { context = null; } - if (typeof ns === "undefined") { ns = null; } - if (typeof parser === "undefined") { parser = null; } - if (!this._token) { - this._token = new library.AssetLoaderToken(this); - - this._uri = id; - this._context = context; - this._namespace = ns; - - this._baseDependency = new ResourceDependency(id, null, data, parser, null); - this.retrieveDependency(this._baseDependency); - - return this._token; - } - - // TODO: Throw error (already loading) - return null; - }; - - /** - * Recursively retrieves the next to-be-loaded and parsed dependency on the stack, or pops the list off the - * stack when complete and continues on the top set. - * @param parser The parser that will translate the data into a usable resource. - */ - AssetLoader.prototype.retrieveNext = function (parser) { - if (typeof parser === "undefined") { parser = null; } - if (this._currentDependency.dependencies.length) { - var next = this._currentDependency.dependencies.pop(); - - this._stack.push(this._currentDependency); - this.retrieveDependency(next); - } else if (this._currentDependency.parser && this._currentDependency.parser.parsingPaused) { - this._currentDependency.parser._iResumeParsingAfterDependencies(); - this._stack.pop(); - } else if (this._stack.length) { - var prev = this._currentDependency; - - this._currentDependency = this._stack.pop(); - - if (prev._iSuccess) - prev.resolve(); - - this.retrieveNext(parser); - } else { - this.dispatchEvent(new away.events.LoaderEvent(away.events.LoaderEvent.RESOURCE_COMPLETE, this._uri, this._baseDependency.parser.content, this._baseDependency.assets)); - } - }; - - /** - * Retrieves a single dependency. - * @param parser The parser that will translate the data into a usable resource. - */ - AssetLoader.prototype.retrieveDependency = function (dependency) { - var data; - - if (this._context && this._context.materialMode != 0) - this._materialMode = this._context.materialMode; - - this._currentDependency = dependency; - - dependency._iLoader = new URLLoader(); - - this.addEventListeners(dependency._iLoader); - - // Get already loaded (or mapped) data if available - data = dependency.data; - - if (this._context && dependency.request && this._context._iHasDataForUrl(dependency.request.url)) - data = this._context._iGetDataForUrl(dependency.request.url); - - if (data) { - if (data.constructor === Function) - data = new data(); - - dependency._iSetData(data); - - if (dependency.retrieveAsRawData) { - // No need to parse. The parent parser is expecting this - // to be raw data so it can be passed directly. - dependency.resolve(); - - // Move on to next dependency - this.retrieveNext(); - } else { - this.parseDependency(dependency); - } - } else { - // Resolve URL and start loading - dependency.request.url = this.resolveDependencyUrl(dependency); - - if (dependency.retrieveAsRawData) { - // Always use binary for raw data loading - dependency._iLoader.dataFormat = URLLoaderDataFormat.BINARY; - } else { - if (!dependency.parser) - dependency._iSetParser(this.getParserFromSuffix(dependency.request.url)); - - if (dependency.parser) { - dependency._iLoader.dataFormat = dependency.parser.dataFormat; - } else { - // Always use BINARY for unknown file formats. The thorough - // file type check will determine format after load, and if - // binary, a text load will have broken the file data. - dependency._iLoader.dataFormat = URLLoaderDataFormat.BINARY; - } - } - - dependency._iLoader.load(dependency.request); - } - }; - - AssetLoader.prototype.joinUrl = function (base, end) { - if (end.charAt(0) == '/') - end = end.substr(1); - - if (base.length == 0) - return end; - - if (base.charAt(base.length - 1) == '/') - base = base.substr(0, base.length - 1); - - return base.concat('/', end); - }; - - AssetLoader.prototype.resolveDependencyUrl = function (dependency) { - var scheme_re; - var base; - var url = dependency.request.url; - - // Has the user re-mapped this URL? - if (this._context && this._context._iHasMappingForUrl(url)) - return this._context._iGetRemappedUrl(url); - - // This is the "base" dependency, i.e. the actual requested asset. - // We will not try to resolve this since the user can probably be - // thrusted to know this URL better than our automatic resolver. :) - if (url == this._uri) - return url; - - // Absolute URL? Check if starts with slash or a URL - // scheme definition (e.g. ftp://, http://, file://) - scheme_re = new RegExp('/^[a-zA-Z]{3,4}:\/\//'); - - if (url.charAt(0) == '/') { - if (this._context && this._context.overrideAbsolutePaths) - return this.joinUrl(this._context.dependencyBaseUrl, url); - else - return url; - } else if (scheme_re.test(url)) { - // If overriding full URLs, get rid of scheme (e.g. "http://") - // and replace with the dependencyBaseUrl defined by user. - if (this._context && this._context.overrideFullURLs) { - var noscheme_url = url.replace(scheme_re, ''); - return this.joinUrl(this._context.dependencyBaseUrl, noscheme_url); - } - } - - // Since not absolute, just get rid of base file name to find it's - // folder and then concatenate dynamic URL - if (this._context && this._context.dependencyBaseUrl) { - base = this._context.dependencyBaseUrl; - return this.joinUrl(base, url); - } else { - base = this._uri.substring(0, this._uri.lastIndexOf('/') + 1); - return this.joinUrl(base, url); - } - }; - - AssetLoader.prototype.retrieveParserDependencies = function () { - if (!this._currentDependency) - return; - - var parserDependancies = this._currentDependency.parser.dependencies; - var i, len = parserDependancies.length; - - for (i = 0; i < len; i++) - this._currentDependency.dependencies[i] = parserDependancies[i]; - - // Since more dependencies might be added eventually, empty this - // list so that the same dependency isn't retrieved more than once. - parserDependancies.length = 0; - - this._stack.push(this._currentDependency); - - this.retrieveNext(); - }; - - AssetLoader.prototype.resolveParserDependencies = function () { - this._currentDependency._iSuccess = true; - - // Retrieve any last dependencies remaining on this parser, or - // if none exists, just move on. - if (this._currentDependency.parser && this._currentDependency.parser.dependencies.length && (!this._context || this._context.includeDependencies)) - this.retrieveParserDependencies(); - else - this.retrieveNext(); - }; - - /** - * Called when a single dependency loading failed, and pushes further dependencies onto the stack. - * @param event - */ - AssetLoader.prototype.onLoadError = function (event) { - var handled; - var isDependency = (this._currentDependency != this._baseDependency); - var loader = event.target; - - this.removeEventListeners(loader); - - if (this.hasEventListener(away.events.IOErrorEvent.IO_ERROR)) { - this.dispatchEvent(event); - handled = true; - } else { - // TODO: Consider not doing this even when AssetLoader does have it's own LOAD_ERROR listener - var i, len = this._errorHandlers.length; - for (i = 0; i < len; i++) - if (!handled) - handled = this._errorHandlers[i](event); - } - - if (handled) { - //if (isDependency && ! event.isDefaultPrevented()) { - if (isDependency) { - this._currentDependency.resolveFailure(); - this.retrieveNext(); - } else { - // Either this was the base file (last left in the stack) or - // default behavior was prevented by the handlers, and hence - // there is nothing more to do than clean up and bail. - this.dispose(); - return; - } - } else { - throw new away.errors.Error(); - } - }; - - /** - * Called when a dependency parsing failed, and dispatches a ParserEvent.PARSE_ERROR - * @param event - */ - AssetLoader.prototype.onParseError = function (event) { - var handled; - - var isDependency = (this._currentDependency != this._baseDependency); - - var loader = event.target; - - this.removeEventListeners(loader); - - if (this.hasEventListener(away.events.ParserEvent.PARSE_ERROR)) { - this.dispatchEvent(event); - handled = true; - } else { - // TODO: Consider not doing this even when AssetLoader does - // have it's own LOAD_ERROR listener - var i, len = this._parseErrorHandlers.length; - - for (i = 0; i < len; i++) - if (!handled) - handled = this._parseErrorHandlers[i](event); - } - - if (handled) { - this.dispose(); - return; - } else { - throw new away.errors.Error(event.message); - } - }; - - AssetLoader.prototype.onAssetComplete = function (event) { - // Add loaded asset to list of assets retrieved as part - // of the current dependency. This list will be inspected - // by the parent parser when dependency is resolved - if (this._currentDependency) - this._currentDependency.assets.push(event.asset); - - event.asset.resetAssetPath(event.asset.name, this._namespace); - - if (!this._currentDependency.suppresAssetEvents) - this.dispatchEvent(event); - }; - - AssetLoader.prototype.onReadyForDependencies = function (event) { - var parser = event.target; - - if (this._context && !this._context.includeDependencies) - parser._iResumeParsingAfterDependencies(); - else - this.retrieveParserDependencies(); - }; - - /** - * Called when a single dependency was parsed, and pushes further dependencies onto the stack. - * @param event - */ - AssetLoader.prototype.onLoadComplete = function (event) { - var loader = event.target; - - this.removeEventListeners(loader); - - // Resolve this dependency - this._currentDependency._iSetData(loader.data); - - if (this._currentDependency.retrieveAsRawData) { - // No need to parse this data, which should be returned as is - this.resolveParserDependencies(); - } else { - this.parseDependency(this._currentDependency); - } - }; - - /** - * Called when parsing is complete. - */ - AssetLoader.prototype.onParseComplete = function (event) { - var parser = event.target; - - this.resolveParserDependencies(); //resolve in front of removing listeners to allow any remaining asset events to propagate - - parser.removeEventListener(away.events.ParserEvent.READY_FOR_DEPENDENCIES, this._onReadyForDependenciesDelegate); - parser.removeEventListener(away.events.ParserEvent.PARSE_COMPLETE, this._onParseCompleteDelegate); - parser.removeEventListener(away.events.ParserEvent.PARSE_ERROR, this._onParseErrorDelegate); - parser.removeEventListener(away.events.AssetEvent.TEXTURE_SIZE_ERROR, this._onTextureSizeErrorDelegate); - parser.removeEventListener(away.events.AssetEvent.ASSET_COMPLETE, this._onAssetCompleteDelegate); - }; - - /** - * Called when an image is too large or it's dimensions are not a power of 2 - * @param event - */ - AssetLoader.prototype.onTextureSizeError = function (event) { - event.asset.name = this._currentDependency.resolveName(event.asset); - - this.dispatchEvent(event); - }; - - AssetLoader.prototype.addEventListeners = function (loader) { - loader.addEventListener(away.events.Event.COMPLETE, this._onLoadCompleteDelegate); - loader.addEventListener(away.events.IOErrorEvent.IO_ERROR, this._onLoadErrorDelegate); - }; - - AssetLoader.prototype.removeEventListeners = function (loader) { - loader.removeEventListener(away.events.Event.COMPLETE, this._onLoadCompleteDelegate); - loader.removeEventListener(away.events.IOErrorEvent.IO_ERROR, this._onLoadErrorDelegate); - }; - - AssetLoader.prototype.stop = function () { - this.dispose(); - }; - - AssetLoader.prototype.dispose = function () { - this._errorHandlers = null; - this._parseErrorHandlers = null; - this._context = null; - this._token = null; - this._stack = null; - - if (this._currentDependency && this._currentDependency._iLoader) - this.removeEventListeners(this._currentDependency._iLoader); - - this._currentDependency = null; - }; - - /** - * @private - * This method is used by other loader classes (e.g. Loader3D and AssetLibraryBundle) to - * add error event listeners to the AssetLoader instance. This system is used instead of - * the regular EventDispatcher system so that the AssetLibrary error handler can be sure - * that if hasEventListener() returns true, it's client code that's listening for the - * event. Secondly, functions added as error handler through this custom method are - * expected to return a boolean value indicating whether the event was handled (i.e. - * whether they in turn had any client code listening for the event.) If no handlers - * return true, the AssetLoader knows that the event wasn't handled and will throw an RTE. - */ - AssetLoader.prototype._iAddParseErrorHandler = function (handler) { - if (this._parseErrorHandlers.indexOf(handler) < 0) - this._parseErrorHandlers.push(handler); - }; - - AssetLoader.prototype._iAddErrorHandler = function (handler) { - if (this._errorHandlers.indexOf(handler) < 0) - this._errorHandlers.push(handler); - }; - - /** - * Guesses the parser to be used based on the file contents. - * @param data The data to be parsed. - * @param uri The url or id of the object to be parsed. - * @return An instance of the guessed parser. - */ - AssetLoader.prototype.getParserFromData = function (data) { - var len = AssetLoader._parsers.length; - - for (var i = len - 1; i >= 0; i--) - if (AssetLoader._parsers[i].supportsData(data)) - return new AssetLoader._parsers[i](); - - return null; - }; - - /** - * Initiates parsing of the loaded dependency. - * - * @param The dependency to be parsed. - */ - AssetLoader.prototype.parseDependency = function (dependency) { - var parser = dependency.parser; - - // If no parser has been defined, try to find one by letting - // all plugged in parsers inspect the actual data. - if (!parser) - dependency._iSetParser(parser = this.getParserFromData(dependency.data)); - - if (parser) { - parser.addEventListener(away.events.ParserEvent.READY_FOR_DEPENDENCIES, this._onReadyForDependenciesDelegate); - parser.addEventListener(away.events.ParserEvent.PARSE_COMPLETE, this._onParseCompleteDelegate); - parser.addEventListener(away.events.ParserEvent.PARSE_ERROR, this._onParseErrorDelegate); - parser.addEventListener(away.events.AssetEvent.TEXTURE_SIZE_ERROR, this._onTextureSizeErrorDelegate); - parser.addEventListener(away.events.AssetEvent.ASSET_COMPLETE, this._onAssetCompleteDelegate); - - if (dependency.request && dependency.request.url) - parser._iFileName = dependency.request.url; - - parser.materialMode = this._materialMode; - - parser.parseAsync(dependency.data); - } else { - var message = "No parser defined. To enable all parsers for auto-detection, use Parsers.enableAllBundled()"; - if (this.hasEventListener(away.events.ParserEvent.PARSE_ERROR)) - this.dispatchEvent(new away.events.ParserEvent(away.events.ParserEvent.PARSE_ERROR, message)); - else - throw new Error(message); - } - }; - - /** - * Guesses the parser to be used based on the file extension. - * @return An instance of the guessed parser. - */ - AssetLoader.prototype.getParserFromSuffix = function (url) { - // Get rid of query string if any and extract extension - var base = (url.indexOf('?') > 0) ? url.split('?')[0] : url; - var fileExtension = base.substr(base.lastIndexOf('.') + 1).toLowerCase(); - - var len = AssetLoader._parsers.length; - - for (var i = len - 1; i >= 0; i--) { - var parserClass = AssetLoader._parsers[i]; - if (parserClass.supportsType(fileExtension)) - return new parserClass(); - } - - return null; - }; - AssetLoader._parsers = new Array(Texture2DParser, CubeTextureParser); - return AssetLoader; - })(away.events.EventDispatcher); - library.AssetLoader = AssetLoader; - })(away.library || (away.library = {})); - var library = away.library; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (library) { - /** - * Dispatched when any asset finishes parsing. Also see specific events for each - * individual asset type (meshes, materials et c.) - * - * @eventType away.events.AssetEvent - */ - //[Event(name="assetComplete", type="away3d.events.AssetEvent")] - /** - * Dispatched when a full resource (including dependencies) finishes loading. - * - * @eventType away.events.LoaderEvent - */ - //[Event(name="resourceComplete", type="away3d.events.LoaderEvent")] - /** - * Dispatched when a single dependency (which may be the main file of a resource) - * finishes loading. - * - * @eventType away.events.LoaderEvent - */ - //[Event(name="dependencyComplete", type="away3d.events.LoaderEvent")] - /** - * Dispatched when an error occurs during loading. I - * - * @eventType away.events.LoaderEvent - */ - //[Event(name="loadError", type="away3d.events.LoaderEvent")] - /** - * Dispatched when an error occurs during parsing. - * - * @eventType away.events.ParserEvent - */ - //[Event(name="parseError", type="away3d.events.ParserEvent")] - /** - * Dispatched when a skybox asset has been costructed from a ressource. - * - * @eventType away.events.AssetEvent - */ - //[Event(name="skyboxComplete", type="away3d.events.AssetEvent")] - /** - * Dispatched when a camera3d asset has been costructed from a ressource. - * - * @eventType away.events.AssetEvent - */ - //[Event(name="cameraComplete", type="away3d.events.AssetEvent")] - /** - * Dispatched when a mesh asset has been costructed from a ressource. - * - * @eventType away.events.AssetEvent - */ - //[Event(name="meshComplete", type="away3d.events.AssetEvent")] - /** - * Dispatched when a geometry asset has been constructed from a resource. - * - * @eventType away.events.AssetEvent - */ - //[Event(name="geometryComplete", type="away3d.events.AssetEvent")] - /** - * Dispatched when a skeleton asset has been constructed from a resource. - * - * @eventType away.events.AssetEvent - */ - //[Event(name="skeletonComplete", type="away3d.events.AssetEvent")] - /** - * Dispatched when a skeleton pose asset has been constructed from a resource. - * - * @eventType away.events.AssetEvent - */ - //[Event(name="skeletonPoseComplete", type="away3d.events.AssetEvent")] - /** - * Dispatched when a container asset has been constructed from a resource. - * - * @eventType away.events.AssetEvent - */ - //[Event(name="containerComplete", type="away3d.events.AssetEvent")] - /** - * Dispatched when a texture asset has been constructed from a resource. - * - * @eventType away.events.AssetEvent - */ - //[Event(name="textureComplete", type="away3d.events.AssetEvent")] - /** - * Dispatched when a texture projector asset has been constructed from a resource. - * - * @eventType away.events.AssetEvent - */ - //[Event(name="textureProjectorComplete", type="away3d.events.AssetEvent")] - /** - * Dispatched when a material asset has been constructed from a resource. - * - * @eventType away.events.AssetEvent - */ - //[Event(name="materialComplete", type="away3d.events.AssetEvent")] - /** - * Dispatched when a animator asset has been constructed from a resource. - * - * @eventType away.events.AssetEvent - */ - //[Event(name="animatorComplete", type="away3d.events.AssetEvent")] - /** - * Dispatched when an animation set has been constructed from a group of animation state resources. - * - * @eventType away.events.AssetEvent - */ - //[Event(name="animationSetComplete", type="away3d.events.AssetEvent")] - /** - * Dispatched when an animation state has been constructed from a group of animation node resources. - * - * @eventType away.events.AssetEvent - */ - //[Event(name="animationStateComplete", type="away3d.events.AssetEvent")] - /** - * Dispatched when an animation node has been constructed from a resource. - * - * @eventType away.events.AssetEvent - */ - //[Event(name="animationNodeComplete", type="away3d.events.AssetEvent")] - /** - * Dispatched when an animation state transition has been constructed from a group of animation node resources. - * - * @eventType away.events.AssetEvent - */ - //[Event(name="stateTransitionComplete", type="away3d.events.AssetEvent")] - /** - * Dispatched when an light asset has been constructed from a resources. - * - * @eventType away.events.AssetEvent - */ - //[Event(name="lightComplete", type="away3d.events.AssetEvent")] - /** - * Dispatched when an light picker asset has been constructed from a resources. - * - * @eventType away.events.AssetEvent - */ - //[Event(name="lightPickerComplete", type="away3d.events.AssetEvent")] - /** - * Dispatched when an effect method asset has been constructed from a resources. - * - * @eventType away.events.AssetEvent - */ - //[Event(name="effectMethodComplete", type="away3d.events.AssetEvent")] - /** - * Dispatched when an shadow map method asset has been constructed from a resources. - * - * @eventType away.events.AssetEvent - */ - //[Event(name="shadowMapMethodComplete", type="away3d.events.AssetEvent")] - /** - * Instances of this class are returned as tokens by loading operations - * to provide an object on which events can be listened for in cases where - * the actual asset loader is not directly available (e.g. when using the - * AssetLibrary to perform the load.) - * - * By listening for events on this class instead of directly on the - * AssetLibrary, one can distinguish different loads from each other. - * - * The token will dispatch all events that the original AssetLoader dispatches, - * while not providing an interface to obstruct the load and is as such a - * safer return value for loader wrappers than the loader itself. - */ - var AssetLoaderToken = (function (_super) { - __extends(AssetLoaderToken, _super); - function AssetLoaderToken(loader) { - _super.call(this); - - this._iLoader = loader; - } - AssetLoaderToken.prototype.addEventListener = function (type, listener) { - this._iLoader.addEventListener(type, listener); - }; - - AssetLoaderToken.prototype.removeEventListener = function (type, listener) { - this._iLoader.removeEventListener(type, listener); - }; - - AssetLoaderToken.prototype.hasEventListener = function (type, listener) { - if (typeof listener === "undefined") { listener = null; } - return this._iLoader.hasEventListener(type, listener); - }; - return AssetLoaderToken; - })(away.events.EventDispatcher); - library.AssetLoaderToken = AssetLoaderToken; - })(away.library || (away.library = {})); - var library = away.library; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (library) { - var IDUtil = (function () { - function IDUtil() { - } - /** - * Generates a UID (unique identifier) based on ActionScript's - * pseudo-random number generator and the current time. - * - *

The UID has the form - * "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" - * where X is a hexadecimal digit (0-9, A-F).

- * - *

This UID will not be truly globally unique; but it is the best - * we can do without player support for UID generation.

- * - * @return The newly-generated UID. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - IDUtil.createUID = function () { - var uid = new Array(36); - var index = 0; - - var i; - var j; - - for (i = 0; i < 8; i++) - uid[index++] = IDUtil.ALPHA_CHAR_CODES[Math.floor(Math.random() * 16)]; - - for (i = 0; i < 3; i++) { - uid[index++] = 45; // charCode for "-" - - for (j = 0; j < 4; j++) - uid[index++] = IDUtil.ALPHA_CHAR_CODES[Math.floor(Math.random() * 16)]; - } - - uid[index++] = 45; // charCode for "-" - - var time = new Date().getTime(); - - // Note: time is the number of milliseconds since 1970, - // which is currently more than one trillion. - // We use the low 8 hex digits of this number in the UID. - // Just in case the system clock has been reset to - // Jan 1-4, 1970 (in which case this number could have only - // 1-7 hex digits), we pad on the left with 7 zeros - // before taking the low digits. - var timeString = ("0000000" + time.toString(16).toUpperCase()).substr(-8); - - for (i = 0; i < 8; i++) - uid[index++] = timeString.charCodeAt(i); - - for (i = 0; i < 4; i++) - uid[index++] = IDUtil.ALPHA_CHAR_CODES[Math.floor(Math.random() * 16)]; - - return String.fromCharCode.apply(null, uid); - }; - IDUtil.ALPHA_CHAR_CODES = [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 65, 66, 67, 68, 69, 70]; - return IDUtil; - })(); - library.IDUtil = IDUtil; - })(away.library || (away.library = {})); - var library = away.library; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (library) { - //import away.library.assets.IAsset; - var AssetLibraryIterator = (function () { - function AssetLibraryIterator(assets, assetTypeFilter, namespaceFilter, filterFunc) { - this._assets = assets; - this.filter(assetTypeFilter, namespaceFilter, filterFunc); - } - Object.defineProperty(AssetLibraryIterator.prototype, "currentAsset", { - get: function () { - // Return current, or null if no current - return (this._idx < this._filtered.length) ? this._filtered[this._idx] : null; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(AssetLibraryIterator.prototype, "numAssets", { - get: function () { - return this._filtered.length; - }, - enumerable: true, - configurable: true - }); - - AssetLibraryIterator.prototype.next = function () { - var next = null; - - if (this._idx < this._filtered.length) - next = this._filtered[this._idx]; - - this._idx++; - - return next; - }; - - AssetLibraryIterator.prototype.reset = function () { - this._idx = 0; - }; - - AssetLibraryIterator.prototype.setIndex = function (index) { - this._idx = index; - }; - - AssetLibraryIterator.prototype.filter = function (assetTypeFilter, namespaceFilter, filterFunc) { - if (assetTypeFilter || namespaceFilter) { - var idx; - var asset; - - idx = 0; - this._filtered = new Array(); //new Vector.; - - var l = this._assets.length; - - for (var c = 0; c < l; c++) { - asset = this._assets[c]; - - // Skip this assets if filtering on type and this is wrong type - if (assetTypeFilter && asset.assetType != assetTypeFilter) - continue; - - // Skip this asset if filtering on namespace and this is wrong namespace - if (namespaceFilter && asset.assetNamespace != namespaceFilter) - continue; - - // Skip this asset if a filter func has been provided and it returns false - if (filterFunc != null && !filterFunc(asset)) - continue; - - this._filtered[idx++] = asset; - } - /* - for each (asset in _assets) { - // Skip this assets if filtering on type and this is wrong type - if (assetTypeFilter && asset.assetType != assetTypeFilter) - continue; - - // Skip this asset if filtering on namespace and this is wrong namespace - if (namespaceFilter && asset.assetNamespace != namespaceFilter) - continue; - - // Skip this asset if a filter func has been provided and it returns false - if (filterFunc != null && !filterFunc(asset)) - continue; - - _filtered[idx++] = asset; - } - */ - } else { - this._filtered = this._assets; - } - }; - return AssetLibraryIterator; - })(); - library.AssetLibraryIterator = AssetLibraryIterator; - })(away.library || (away.library = {})); - var library = away.library; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (library) { - var AbstractMethodError = away.errors.AbstractMethodError; - - /** - * Abstract base class for naming conflict resolution classes. Extend this to create a - * strategy class which the asset library can use to resolve asset naming conflicts, or - * use one of the bundled concrete strategy classes: - * - *
    - *
  • IgnoreConflictStrategy (ConflictStrategy.IGNORE)
  • - *
  • ErrorConflictStrategy (ConflictStrategy.THROW_ERROR)
  • - *
  • NumSuffixConflictStrategy (ConflictStrategy.APPEND_NUM_SUFFIX)
  • - *
- * - * @see away.library.AssetLibrary.conflictStrategy - * @see away.library.ConflictStrategy - * @see away.library.IgnoreConflictStrategy - * @see away.library.ErrorConflictStrategy - * @see away.library.NumSuffixConflictStrategy - */ - var ConflictStrategyBase = (function () { - function ConflictStrategyBase() { - } - /** - * Resolve a naming conflict between two assets. Must be implemented by concrete strategy - * classes. - */ - ConflictStrategyBase.prototype.resolveConflict = function (changedAsset, oldAsset, assetsDictionary, precedence) { - throw new AbstractMethodError(); - }; - - /** - * Create instance of this conflict strategy. Used internally by the AssetLibrary to - * make sure the same strategy instance is not used in all AssetLibrary instances, which - * would break any state caching that happens inside the strategy class. - */ - ConflictStrategyBase.prototype.create = function () { - throw new AbstractMethodError(); - }; - - /** - * Provided as a convenience method for all conflict strategy classes, as a way to finalize - * the conflict resolution by applying the new names and dispatching the correct events. - */ - ConflictStrategyBase.prototype._pUpdateNames = function (ns, nonConflictingName, oldAsset, newAsset, assetsDictionary, precedence) { - var loser_prev_name; - var winner; - var loser; - - winner = (precedence === library.ConflictPrecedence.FAVOR_NEW) ? newAsset : oldAsset; - loser = (precedence === library.ConflictPrecedence.FAVOR_NEW) ? oldAsset : newAsset; - - loser_prev_name = loser.name; - - assetsDictionary[winner.name] = winner; - assetsDictionary[nonConflictingName] = loser; - loser.resetAssetPath(nonConflictingName, ns, false); - - loser.dispatchEvent(new away.events.AssetEvent(away.events.AssetEvent.ASSET_CONFLICT_RESOLVED, loser, loser_prev_name)); - }; - return ConflictStrategyBase; - })(); - library.ConflictStrategyBase = ConflictStrategyBase; - })(away.library || (away.library = {})); - var library = away.library; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (library) { - var NumSuffixConflictStrategy = (function (_super) { - __extends(NumSuffixConflictStrategy, _super); - function NumSuffixConflictStrategy(separator) { - if (typeof separator === "undefined") { separator = '.'; } - _super.call(this); - - this._separator = separator; - this._next_suffix = {}; - } - NumSuffixConflictStrategy.prototype.resolveConflict = function (changedAsset, oldAsset, assetsDictionary, precedence) { - var orig; - var new_name; - var base; - var suffix; - - orig = changedAsset.name; - - if (orig.indexOf(this._separator) >= 0) { - // Name has an ocurrence of the separator, so get base name and suffix, - // unless suffix is non-numerical, in which case revert to zero and - // use entire name as base - base = orig.substring(0, orig.lastIndexOf(this._separator)); - suffix = parseInt(orig.substring(base.length - 1)); - - if (isNaN(suffix)) { - base = orig; - suffix = 0; - } - } else { - base = orig; - suffix = 0; - } - - if (suffix == 0 && this._next_suffix.hasOwnProperty(base)) { - suffix = this._next_suffix[base]; - } - - do { - suffix++; - - new_name = base.concat(this._separator, suffix.toString()); - } while(assetsDictionary.hasOwnProperty(new_name)); - - this._next_suffix[base] = suffix; - this._pUpdateNames(oldAsset.assetNamespace, new_name, oldAsset, changedAsset, assetsDictionary, precedence); - }; - - NumSuffixConflictStrategy.prototype.create = function () { - return new NumSuffixConflictStrategy(this._separator); - }; - return NumSuffixConflictStrategy; - })(library.ConflictStrategyBase); - library.NumSuffixConflictStrategy = NumSuffixConflictStrategy; - })(away.library || (away.library = {})); - var library = away.library; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (library) { - var IgnoreConflictStrategy = (function (_super) { - __extends(IgnoreConflictStrategy, _super); - function IgnoreConflictStrategy() { - _super.call(this); - } - IgnoreConflictStrategy.prototype.resolveConflict = function (changedAsset, oldAsset, assetsDictionary, precedence) { - // Do nothing, ignore the fact that there is a conflict. - return; - }; - - IgnoreConflictStrategy.prototype.create = function () { - return new IgnoreConflictStrategy(); - }; - return IgnoreConflictStrategy; - })(library.ConflictStrategyBase); - library.IgnoreConflictStrategy = IgnoreConflictStrategy; - })(away.library || (away.library = {})); - var library = away.library; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (library) { - var ErrorConflictStrategy = (function (_super) { - __extends(ErrorConflictStrategy, _super); - function ErrorConflictStrategy() { - _super.call(this); - } - ErrorConflictStrategy.prototype.resolveConflict = function (changedAsset, oldAsset, assetsDictionary, precedence) { - throw new away.errors.Error('Asset name collision while AssetLibrary.namingStrategy set to AssetLibrary.THROW_ERROR. Asset path: ' + changedAsset.assetFullPath); - }; - - ErrorConflictStrategy.prototype.create = function () { - return new ErrorConflictStrategy(); - }; - return ErrorConflictStrategy; - })(library.ConflictStrategyBase); - library.ErrorConflictStrategy = ErrorConflictStrategy; - })(away.library || (away.library = {})); - var library = away.library; -})(away || (away = {})); -var away; -(function (away) { - (function (library) { - /** - * Enumaration class for precedence when resolving naming conflicts in the library. - * - * @see away.library.AssetLibrary.conflictPrecedence - * @see away.library.AssetLibrary.conflictStrategy - * @see away.library.naming.ConflictStrategy - */ - var ConflictPrecedence = (function () { - function ConflictPrecedence() { - } - ConflictPrecedence.FAVOR_OLD = 'favorOld'; - - ConflictPrecedence.FAVOR_NEW = 'favorNew'; - return ConflictPrecedence; - })(); - library.ConflictPrecedence = ConflictPrecedence; - })(away.library || (away.library = {})); - var library = away.library; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (library) { - /** - * Enumeration class for bundled conflict strategies. Set one of these values (or an - * instance of a self-defined sub-class of ConflictStrategyBase) to the conflictStrategy - * property on an AssetLibrary to define how that library resolves naming conflicts. - * - * The value of the AssetLibrary.conflictPrecedence property defines which - * of the conflicting assets will get to keep it's name, and which is renamed (if any.) - * - * @see away.library.AssetLibrary.conflictStrategy - * @see away.library.naming.ConflictStrategyBase - */ - var ConflictStrategy = (function () { - function ConflictStrategy() { - } - ConflictStrategy.APPEND_NUM_SUFFIX = new library.NumSuffixConflictStrategy(); - - ConflictStrategy.IGNORE = new library.IgnoreConflictStrategy(); - - ConflictStrategy.THROW_ERROR = new library.ErrorConflictStrategy(); - return ConflictStrategy; - })(); - library.ConflictStrategy = ConflictStrategy; - })(away.library || (away.library = {})); - var library = away.library; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (library) { - /** - * AssetLibraryBundle enforces a multiton pattern and is not intended to be instanced directly. - * Its purpose is to create a container for 3D data management, both before and after parsing. - * If you are interested in creating multiple library bundles, please use the getInstance() method. - */ - var AssetLibraryBundle = (function (_super) { - __extends(AssetLibraryBundle, _super); - /** - * Creates a new AssetLibraryBundle object. - * - * @param me A multiton enforcer for the AssetLibraryBundle ensuring it cannnot be instanced. - */ - function AssetLibraryBundle(me) { - _super.call(this); - this._loadingSessionsGarbage = new Array(); - - this._assets = new Array(); //new Vector.; - this._assetDictionary = new Object(); - this._loadingSessions = new Array(); - - this.conflictStrategy = library.ConflictStrategy.IGNORE.create(); - this.conflictPrecedence = library.ConflictPrecedence.FAVOR_NEW; - - this._onAssetRenameDelegate = away.utils.Delegate.create(this, this.onAssetRename); - this._onAssetConflictResolvedDelegate = away.utils.Delegate.create(this, this.onAssetConflictResolved); - this._onResourceCompleteDelegate = away.utils.Delegate.create(this, this.onResourceComplete); - this._onTextureSizeErrorDelegate = away.utils.Delegate.create(this, this.onTextureSizeError); - this._onAssetCompleteDelegate = away.utils.Delegate.create(this, this.onAssetComplete); - this._onLoadErrorDelegate = away.utils.Delegate.create(this, this.onLoadError); - this._onParseErrorDelegate = away.utils.Delegate.create(this, this.onParseError); - } - /** - * Returns an AssetLibraryBundle instance. If no key is given, returns the default bundle instance (which is - * similar to using the AssetLibraryBundle as a singleton.) To keep several separated library bundles, - * pass a string key to this method to define which bundle should be returned. This is - * referred to as using the AssetLibrary as a multiton. - * - * @param key Defines which multiton instance should be returned. - * @return An instance of the asset library - */ - AssetLibraryBundle.getInstance = function (key) { - if (typeof key === "undefined") { key = 'default'; } - if (!key) - key = 'default'; - - if (!library.AssetLibrary._iInstances.hasOwnProperty(key)) - library.AssetLibrary._iInstances[key] = new AssetLibraryBundle(new AssetLibraryBundleSingletonEnforcer()); - - return library.AssetLibrary._iInstances[key]; - }; - - /** - * - */ - AssetLibraryBundle.prototype.enableParser = function (parserClass) { - library.AssetLoader.enableParser(parserClass); - }; - - /** - * - */ - AssetLibraryBundle.prototype.enableParsers = function (parserClasses) { - library.AssetLoader.enableParsers(parserClasses); - }; - - Object.defineProperty(AssetLibraryBundle.prototype, "conflictStrategy", { - /** - * Defines which strategy should be used for resolving naming conflicts, when two library - * assets are given the same name. By default, ConflictStrategy.APPEND_NUM_SUFFIX - * is used which means that a numeric suffix is appended to one of the assets. The - * conflictPrecedence property defines which of the two conflicting assets will - * be renamed. - * - * @see naming.ConflictStrategy - * @see AssetLibrary.conflictPrecedence - */ - get: function () { - return this._strategy; - }, - set: function (val) { - if (!val) - throw new away.errors.Error('namingStrategy must not be null. To ignore naming, use AssetLibrary.IGNORE'); - - this._strategy = val.create(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(AssetLibraryBundle.prototype, "conflictPrecedence", { - /** - * Defines which asset should have precedence when resolving a naming conflict between - * two assets of which one has just been renamed by the user or by a parser. By default - * ConflictPrecedence.FAVOR_NEW is used, meaning that the newly renamed - * asset will keep it's new name while the older asset gets renamed to not conflict. - * - * This property is ignored for conflict strategies that do not actually rename an - * asset automatically, such as ConflictStrategy.IGNORE and ConflictStrategy.THROW_ERROR. - * - * @see away.library.ConflictPrecedence - * @see away.library.ConflictStrategy - */ - get: function () { - return this._strategyPreference; - }, - set: function (val) { - this._strategyPreference = val; - }, - enumerable: true, - configurable: true - }); - - - /** - * Create an AssetLibraryIterator instance that can be used to iterate over the assets - * in this asset library instance. The iterator can filter assets on asset type and/or - * namespace. A "null" filter value means no filter of that type is used. - * - * @param assetTypeFilter Asset type to filter on (from the AssetType enum class.) Use - * null to not filter on asset type. - * @param namespaceFilter Namespace to filter on. Use null to not filter on namespace. - * @param filterFunc Callback function to use when deciding whether an asset should be - * included in the iteration or not. This needs to be a function that takes a single - * parameter of type IAsset and returns a boolean where true means it should be included. - * - * @see away.library.AssetType - */ - AssetLibraryBundle.prototype.createIterator = function (assetTypeFilter, namespaceFilter, filterFunc) { - if (typeof assetTypeFilter === "undefined") { assetTypeFilter = null; } - if (typeof namespaceFilter === "undefined") { namespaceFilter = null; } - if (typeof filterFunc === "undefined") { filterFunc = null; } - return new library.AssetLibraryIterator(this._assets, assetTypeFilter, namespaceFilter, filterFunc); - }; - - /** - * Loads a file and (optionally) all of its dependencies. - * - * @param req The URLRequest object containing the URL of the file to be loaded. - * @param context An optional context object providing additional parameters for loading - * @param ns An optional namespace string under which the file is to be loaded, allowing the differentiation of two resources with identical assets - * @param parser An optional parser object for translating the loaded data into a usable resource. If not provided, AssetLoader will attempt to auto-detect the file type. - * @return A handle to the retrieved resource. - */ - AssetLibraryBundle.prototype.load = function (req, context, ns, parser) { - if (typeof context === "undefined") { context = null; } - if (typeof ns === "undefined") { ns = null; } - if (typeof parser === "undefined") { parser = null; } - var loader = new library.AssetLoader(); - - if (!this._loadingSessions) - this._loadingSessions = new Array(); - - this._loadingSessions.push(loader); - - loader.addEventListener(away.events.LoaderEvent.RESOURCE_COMPLETE, this._onResourceCompleteDelegate); - loader.addEventListener(away.events.AssetEvent.TEXTURE_SIZE_ERROR, this._onTextureSizeErrorDelegate); - loader.addEventListener(away.events.AssetEvent.ASSET_COMPLETE, this._onAssetCompleteDelegate); - - // Error are handled separately (see documentation for addErrorHandler) - loader._iAddErrorHandler(this._onLoadErrorDelegate); - loader._iAddParseErrorHandler(this._onParseErrorDelegate); - - return loader.load(req, context, ns, parser); - }; - - /** - * Loads a resource from existing data in memory. - * - * @param data The data object containing all resource information. - * @param context An optional context object providing additional parameters for loading - * @param ns An optional namespace string under which the file is to be loaded, allowing the differentiation of two resources with identical assets - * @param parser An optional parser object for translating the loaded data into a usable resource. If not provided, AssetLoader will attempt to auto-detect the file type. - * @return A handle to the retrieved resource. - */ - AssetLibraryBundle.prototype.loadData = function (data, context, ns, parser) { - if (typeof context === "undefined") { context = null; } - if (typeof ns === "undefined") { ns = null; } - if (typeof parser === "undefined") { parser = null; } - var loader = new library.AssetLoader(); - - if (!this._loadingSessions) - this._loadingSessions = new Array(); - - this._loadingSessions.push(loader); - - loader.addEventListener(away.events.LoaderEvent.RESOURCE_COMPLETE, this._onResourceCompleteDelegate); - loader.addEventListener(away.events.AssetEvent.TEXTURE_SIZE_ERROR, this._onTextureSizeErrorDelegate); - loader.addEventListener(away.events.AssetEvent.ASSET_COMPLETE, this._onAssetCompleteDelegate); - - // Error are handled separately (see documentation for addErrorHandler) - loader._iAddErrorHandler(this._onLoadErrorDelegate); - loader._iAddParseErrorHandler(this._onParseErrorDelegate); - - return loader.loadData(data, '', context, ns, parser); - }; - - /** - * - */ - AssetLibraryBundle.prototype.getAsset = function (name, ns) { - //var asset : IAsset; - if (typeof ns === "undefined") { ns = null; } - if (this._assetDictDirty) - this.rehashAssetDict(); - - if (ns == null) - ns = library.NamedAssetBase.DEFAULT_NAMESPACE; - - if (!this._assetDictionary.hasOwnProperty(ns)) - return null; - - return this._assetDictionary[ns][name]; - }; - - /** - * Adds an asset to the asset library, first making sure that it's name is unique - * using the method defined by the conflictStrategy and - * conflictPrecedence properties. - */ - AssetLibraryBundle.prototype.addAsset = function (asset) { - var ns; - var old; - - // Bail if asset has already been added. - if (this._assets.indexOf(asset) >= 0) - return; - - old = this.getAsset(asset.name, asset.assetNamespace); - ns = asset.assetNamespace || library.NamedAssetBase.DEFAULT_NAMESPACE; - - if (old != null) - this._strategy.resolveConflict(asset, old, this._assetDictionary[ns], this._strategyPreference); - - //create unique-id (for now this is used in AwayBuilder only - //asset.id = IDUtil.createUID(); - // Add it - this._assets.push(asset); - - if (!this._assetDictionary.hasOwnProperty(ns)) - this._assetDictionary[ns] = new Object(); - - this._assetDictionary[ns][asset.name] = asset; - - asset.addEventListener(away.events.AssetEvent.ASSET_RENAME, this._onAssetRenameDelegate); - asset.addEventListener(away.events.AssetEvent.ASSET_CONFLICT_RESOLVED, this._onAssetConflictResolvedDelegate); - }; - - /** - * Removes an asset from the library, and optionally disposes that asset by calling - * it's disposeAsset() method (which for most assets is implemented as a default - * version of that type's dispose() method. - * - * @param asset The asset which should be removed from this library. - * @param dispose Defines whether the assets should also be disposed. - */ - AssetLibraryBundle.prototype.removeAsset = function (asset, dispose) { - if (typeof dispose === "undefined") { dispose = true; } - var idx; - - this.removeAssetFromDict(asset); - - asset.removeEventListener(away.events.AssetEvent.ASSET_RENAME, this._onAssetRenameDelegate); - asset.removeEventListener(away.events.AssetEvent.ASSET_CONFLICT_RESOLVED, this._onAssetConflictResolvedDelegate); - - idx = this._assets.indexOf(asset); - - if (idx >= 0) - this._assets.splice(idx, 1); - - if (dispose) - asset.dispose(); - }; - - /** - * Removes an asset which is specified using name and namespace. - * - * @param name The name of the asset to be removed. - * @param ns The namespace to which the desired asset belongs. - * @param dispose Defines whether the assets should also be disposed. - * - * @see away.library.AssetLibrary.removeAsset() - */ - AssetLibraryBundle.prototype.removeAssetByName = function (name, ns, dispose) { - if (typeof ns === "undefined") { ns = null; } - if (typeof dispose === "undefined") { dispose = true; } - var asset = this.getAsset(name, ns); - - if (asset) - this.removeAsset(asset, dispose); - - return asset; - }; - - /** - * Removes all assets from the asset library, optionally disposing them as they - * are removed. - * - * @param dispose Defines whether the assets should also be disposed. - */ - AssetLibraryBundle.prototype.removeAllAssets = function (dispose) { - if (typeof dispose === "undefined") { dispose = true; } - if (dispose) { - var asset; - - for (var c = 0; c < this._assets.length; c++) { - asset = this._assets[c]; - asset.dispose(); - } - /* - for each (asset in _assets) - asset.dispose(); - */ - } - - this._assets.length = 0; - this.rehashAssetDict(); - }; - - /** - * Removes all assets belonging to a particular namespace (null for default) - * from the asset library, and optionall disposes them by calling their - * disposeAsset() method. - * - * @param ns The namespace from which all assets should be removed. - * @param dispose Defines whether the assets should also be disposed. - * - * @see away.library.AssetLibrary.removeAsset() - */ - AssetLibraryBundle.prototype.removeNamespaceAssets = function (ns, dispose) { - if (typeof ns === "undefined") { ns = null; } - if (typeof dispose === "undefined") { dispose = true; } - var idx = 0; - var asset; - var old_assets; - - // Empty the assets vector after having stored a copy of it. - // The copy will be filled with all assets which weren't removed. - old_assets = this._assets.concat(); - this._assets.length = 0; - - if (ns == null) - ns = library.NamedAssetBase.DEFAULT_NAMESPACE; - - for (var d = 0; d < old_assets.length; d++) { - asset = old_assets[d]; - - // Remove from dict if in the supplied namespace. If not, - // transfer over to the new vector. - if (asset.assetNamespace == ns) { - if (dispose) - asset.dispose(); - - // Remove asset from dictionary, but don't try to auto-remove - // the namespace, which will trigger an unnecessarily expensive - // test that is not needed since we know that the namespace - // will be empty when loop finishes. - this.removeAssetFromDict(asset, false); - } else { - this._assets[idx++] = asset; - } - } - - /* - for each (asset in old_assets) { - // Remove from dict if in the supplied namespace. If not, - // transfer over to the new vector. - if (asset.assetNamespace == ns) { - if (dispose) - asset.dispose(); - - // Remove asset from dictionary, but don't try to auto-remove - // the namespace, which will trigger an unnecessarily expensive - // test that is not needed since we know that the namespace - // will be empty when loop finishes. - removeAssetFromDict(asset, false); - } else - _assets[idx++] = asset; - - } - */ - // Remove empty namespace - if (this._assetDictionary.hasOwnProperty(ns)) - delete this._assetDictionary[ns]; - }; - - AssetLibraryBundle.prototype.removeAssetFromDict = function (asset, autoRemoveEmptyNamespace) { - if (typeof autoRemoveEmptyNamespace === "undefined") { autoRemoveEmptyNamespace = true; } - if (this._assetDictDirty) - this.rehashAssetDict(); - - if (this._assetDictionary.hasOwnProperty(asset.assetNamespace)) { - if (this._assetDictionary[asset.assetNamespace].hasOwnProperty(asset.name)) - delete this._assetDictionary[asset.assetNamespace][asset.name]; - - if (autoRemoveEmptyNamespace) { - var key; - var empty = true; - - for (key in this._assetDictionary[asset.assetNamespace]) { - empty = false; - break; - } - - if (empty) - delete this._assetDictionary[asset.assetNamespace]; - } - } - }; - - AssetLibraryBundle.prototype.stopAllLoadingSessions = function () { - var i; - - if (!this._loadingSessions) - this._loadingSessions = new Array(); - - var length = this._loadingSessions.length; - - for (i = 0; i < length; i++) - this.killLoadingSession(this._loadingSessions[i]); - - this._loadingSessions = null; - }; - - AssetLibraryBundle.prototype.rehashAssetDict = function () { - var asset; - - this._assetDictionary = {}; - - var l = this._assets.length; - - for (var c = 0; c < l; c++) { - asset = this._assets[c]; - - if (!this._assetDictionary.hasOwnProperty(asset.assetNamespace)) - this._assetDictionary[asset.assetNamespace] = {}; - - this._assetDictionary[asset.assetNamespace][asset.name] = asset; - } - - this._assetDictDirty = false; - }; - - /** - * Called when a an error occurs during loading. - */ - AssetLibraryBundle.prototype.onLoadError = function (event) { - if (this.hasEventListener(away.events.IOErrorEvent.IO_ERROR)) { - this.dispatchEvent(event); - return true; - } else { - return false; - } - }; - - /** - * Called when a an error occurs during parsing. - */ - AssetLibraryBundle.prototype.onParseError = function (event) { - if (this.hasEventListener(away.events.ParserEvent.PARSE_ERROR)) { - this.dispatchEvent(event); - return true; - } else { - return false; - } - }; - - AssetLibraryBundle.prototype.onAssetComplete = function (event) { - // Only add asset to library the first time. - if (event.type == away.events.AssetEvent.ASSET_COMPLETE) - this.addAsset(event.asset); - - this.dispatchEvent(event); - }; - - AssetLibraryBundle.prototype.onTextureSizeError = function (event) { - this.dispatchEvent(event); - }; - - /** - * Called when the resource and all of its dependencies was retrieved. - */ - AssetLibraryBundle.prototype.onResourceComplete = function (event) { - var _this = this; - var loader = event.target; - - this.dispatchEvent(event); - - var index = this._loadingSessions.indexOf(loader); - this._loadingSessions.splice(index, 1); - - // Add loader to a garbage array - for a collection sweep and kill - this._loadingSessionsGarbage.push(loader); - this._gcTimeoutIID = setTimeout(function () { - _this.loadingSessionGC(); - }, 100); - }; - - AssetLibraryBundle.prototype.loadingSessionGC = function () { - var loader; - - while (this._loadingSessionsGarbage.length > 0) { - loader = this._loadingSessionsGarbage.pop(); - this.killLoadingSession(loader); - } - - clearTimeout(this._gcTimeoutIID); - this._gcTimeoutIID = null; - }; - - AssetLibraryBundle.prototype.killLoadingSession = function (loader) { - loader.removeEventListener(away.events.LoaderEvent.RESOURCE_COMPLETE, this._onResourceCompleteDelegate); - loader.removeEventListener(away.events.AssetEvent.TEXTURE_SIZE_ERROR, this._onTextureSizeErrorDelegate); - loader.removeEventListener(away.events.AssetEvent.ASSET_COMPLETE, this._onAssetCompleteDelegate); - loader.stop(); - }; - - /** - * Called when unespected error occurs - */ - /* - private onResourceError() : void - { - var msg:string = "Unexpected parser error"; - if(hasEventListener(LoaderEvent.DEPENDENCY_ERROR)){ - var re:LoaderEvent = new LoaderEvent(LoaderEvent.DEPENDENCY_ERROR, ""); - dispatchEvent(re); - } else{ - throw new Error(msg); - } - } - */ - AssetLibraryBundle.prototype.onAssetRename = function (ev) { - var asset = ev.target; - var old = this.getAsset(asset.assetNamespace, asset.name); - - if (old != null) { - this._strategy.resolveConflict(asset, old, this._assetDictionary[asset.assetNamespace], this._strategyPreference); - } else { - var dict = this._assetDictionary[ev.asset.assetNamespace]; - - if (dict == null) - return; - - dict[ev.assetPrevName] = null; - dict[ev.asset.name] = ev.asset; - } - }; - - AssetLibraryBundle.prototype.onAssetConflictResolved = function (ev) { - this.dispatchEvent(ev.clone()); - }; - return AssetLibraryBundle; - })(away.events.EventDispatcher); - library.AssetLibraryBundle = AssetLibraryBundle; - })(away.library || (away.library = {})); - var library = away.library; -})(away || (away = {})); - -// singleton enforcer -var AssetLibraryBundleSingletonEnforcer = (function () { - function AssetLibraryBundleSingletonEnforcer() { - } - return AssetLibraryBundleSingletonEnforcer; -})(); -/// -var away; -(function (away) { - (function (library) { - /** - * AssetLibrary enforces a singleton pattern and is not intended to be instanced. - * It's purpose is to allow access to the default library bundle through a set of static shortcut methods. - * If you are interested in creating multiple library bundles, please use the getBundle() method. - */ - var AssetLibrary = (function () { - /** - * Creates a new AssetLibrary object. - * - * @param se A singleton enforcer for the AssetLibrary ensuring it cannnot be instanced. - */ - //* - function AssetLibrary(se) { - se = se; - } - //*/ - /** - * Returns an AssetLibrary bundle instance. If no key is given, returns the default bundle (which is - * similar to using the AssetLibraryBundle as a singleton). To keep several separated library bundles, - * pass a string key to this method to define which bundle should be returned. This is - * referred to as using the AssetLibraryBundle as a multiton. - * - * @param key Defines which multiton instance should be returned. - * @return An instance of the asset library - */ - AssetLibrary.getBundle = function (key) { - if (typeof key === "undefined") { key = 'default'; } - return library.AssetLibraryBundle.getInstance(key); - }; - - /** - * - */ - AssetLibrary.enableParser = function (parserClass) { - library.AssetLoader.enableParser(parserClass); - }; - - /** - * - */ - AssetLibrary.enableParsers = function (parserClasses) { - library.AssetLoader.enableParsers(parserClasses); - }; - - Object.defineProperty(AssetLibrary, "conflictStrategy", { - /** - * Short-hand for conflictStrategy property on default asset library bundle. - * - * @see AssetLibraryBundle.conflictStrategy - */ - get: function () { - return AssetLibrary.getBundle().conflictStrategy; - }, - set: function (val) { - AssetLibrary.getBundle().conflictStrategy = val; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(AssetLibrary, "conflictPrecedence", { - /** - * Short-hand for conflictPrecedence property on default asset library bundle. - * - * @see AssetLibraryBundle.conflictPrecedence - */ - get: function () { - return AssetLibrary.getBundle().conflictPrecedence; - }, - set: function (val) { - AssetLibrary.getBundle().conflictPrecedence = val; - }, - enumerable: true, - configurable: true - }); - - - /** - * Short-hand for createIterator() method on default asset library bundle. - * - * @see AssetLibraryBundle.createIterator() - */ - AssetLibrary.createIterator = function (assetTypeFilter, namespaceFilter, filterFunc) { - if (typeof assetTypeFilter === "undefined") { assetTypeFilter = null; } - if (typeof namespaceFilter === "undefined") { namespaceFilter = null; } - if (typeof filterFunc === "undefined") { filterFunc = null; } - return AssetLibrary.getBundle().createIterator(assetTypeFilter, namespaceFilter, filterFunc); - }; - - /** - * Short-hand for load() method on default asset library bundle. - * - * @see AssetLibraryBundle.load() - */ - AssetLibrary.load = function (req, context, ns, parser) { - if (typeof context === "undefined") { context = null; } - if (typeof ns === "undefined") { ns = null; } - if (typeof parser === "undefined") { parser = null; } - return AssetLibrary.getBundle().load(req, context, ns, parser); - }; - - /** - * Short-hand for loadData() method on default asset library bundle. - * - * @see AssetLibraryBundle.loadData() - */ - AssetLibrary.loadData = function (data, context, ns, parser) { - if (typeof context === "undefined") { context = null; } - if (typeof ns === "undefined") { ns = null; } - if (typeof parser === "undefined") { parser = null; } - return AssetLibrary.getBundle().loadData(data, context, ns, parser); - }; - - AssetLibrary.stopLoad = function () { - AssetLibrary.getBundle().stopAllLoadingSessions(); - }; - - /** - * Short-hand for getAsset() method on default asset library bundle. - * - * @see AssetLibraryBundle.getAsset() - */ - AssetLibrary.getAsset = function (name, ns) { - if (typeof ns === "undefined") { ns = null; } - return AssetLibrary.getBundle().getAsset(name, ns); - }; - - /** - * Short-hand for addEventListener() method on default asset library bundle. - */ - AssetLibrary.addEventListener = function (type, listener) { - AssetLibrary.getBundle().addEventListener(type, listener); - }; - - /** - * Short-hand for removeEventListener() method on default asset library bundle. - */ - AssetLibrary.removeEventListener = function (type, listener) { - AssetLibrary.getBundle().removeEventListener(type, listener); - }; - - /** - * Short-hand for hasEventListener() method on default asset library bundle. - - public static hasEventListener(type:string):boolean - { - return AssetLibrary.getBundle().hasEventListener(type); - } - - public static willTrigger(type:string):boolean - { - return getBundle().willTrigger(type); - } - */ - /** - * Short-hand for addAsset() method on default asset library bundle. - * - * @see AssetLibraryBundle.addAsset() - */ - AssetLibrary.addAsset = function (asset) { - AssetLibrary.getBundle().addAsset(asset); - }; - - /** - * Short-hand for removeAsset() method on default asset library bundle. - * - * @param asset The asset which should be removed from the library. - * @param dispose Defines whether the assets should also be disposed. - * - * @see AssetLibraryBundle.removeAsset() - */ - AssetLibrary.removeAsset = function (asset, dispose) { - if (typeof dispose === "undefined") { dispose = true; } - AssetLibrary.getBundle().removeAsset(asset, dispose); - }; - - /** - * Short-hand for removeAssetByName() method on default asset library bundle. - * - * @param name The name of the asset to be removed. - * @param ns The namespace to which the desired asset belongs. - * @param dispose Defines whether the assets should also be disposed. - * - * @see AssetLibraryBundle.removeAssetByName() - */ - AssetLibrary.removeAssetByName = function (name, ns, dispose) { - if (typeof ns === "undefined") { ns = null; } - if (typeof dispose === "undefined") { dispose = true; } - return AssetLibrary.getBundle().removeAssetByName(name, ns, dispose); - }; - - /** - * Short-hand for removeAllAssets() method on default asset library bundle. - * - * @param dispose Defines whether the assets should also be disposed. - * - * @see AssetLibraryBundle.removeAllAssets() - */ - AssetLibrary.removeAllAssets = function (dispose) { - if (typeof dispose === "undefined") { dispose = true; } - AssetLibrary.getBundle().removeAllAssets(dispose); - }; - - /** - * Short-hand for removeNamespaceAssets() method on default asset library bundle. - * - * @see AssetLibraryBundle.removeNamespaceAssets() - */ - AssetLibrary.removeNamespaceAssets = function (ns, dispose) { - if (typeof ns === "undefined") { ns = null; } - if (typeof dispose === "undefined") { dispose = true; } - AssetLibrary.getBundle().removeNamespaceAssets(ns, dispose); - }; - AssetLibrary._iInstances = {}; - return AssetLibrary; - })(); - library.AssetLibrary = AssetLibrary; - })(away.library || (away.library = {})); - var library = away.library; -})(away || (away = {})); - -// singleton enforcer -var AssetLibrarySingletonEnforcer = (function () { - function AssetLibrarySingletonEnforcer() { - } - return AssetLibrarySingletonEnforcer; -})(); -/// -var away; -(function (away) { - /** - * @module away.pool - */ - (function (pool) { - /** - * @class away.pool.EntityListItem - */ - var EntityListItem = (function () { - function EntityListItem() { - } - return EntityListItem; - })(); - pool.EntityListItem = EntityListItem; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.pool - */ - (function (pool) { - /** - * @class away.pool.EntityListItemPool - */ - var EntityListItemPool = (function () { - /** - * - */ - function EntityListItemPool() { - this._index = 0; - this._poolSize = 0; - this._pool = []; - } - /** - * - */ - EntityListItemPool.prototype.getItem = function () { - var item; - if (this._index == this._poolSize) { - item = new pool.EntityListItem(); - this._pool[this._index++] = item; - ++this._poolSize; - } else { - item = this._pool[this._index++]; - } - return item; - }; - - /** - * - */ - EntityListItemPool.prototype.freeAll = function () { - this._index = 0; - }; - - EntityListItemPool.prototype.dispose = function () { - this._pool.length = 0; - }; - return EntityListItemPool; - })(); - pool.EntityListItemPool = EntityListItemPool; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -/// -/// -/// -var away; -(function (away) { - /** - * @module away.pool - */ - (function (pool) { - - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -/// -var away; -(function (away) { - /** - * @module away.pool - */ - (function (_pool) { - /** - * @class away.pool.RenderablePool - */ - var RenderablePool = (function () { - /** - * //TODO - * - * @param renderableClass - */ - function RenderablePool(renderableClass) { - this._pool = new Object(); - this._renderableClass = renderableClass; - } - /** - * //TODO - * - * @param materialOwner - * @returns IRenderable - */ - RenderablePool.prototype.getItem = function (materialOwner) { - return (this._pool[materialOwner.id] || (this._pool[materialOwner.id] = materialOwner._iAddRenderable(new this._renderableClass(this, materialOwner)))); - }; - - /** - * //TODO - * - * @param materialOwner - */ - RenderablePool.prototype.disposeItem = function (materialOwner) { - materialOwner._iRemoveRenderable(this._pool[materialOwner.id]); - - this._pool[materialOwner.id] = null; - }; - - /** - * //TODO - * - * @param renderableClass - * @returns RenderablePool - */ - RenderablePool.getPool = function (renderableClass) { - var pool = RenderablePool._pools[renderableClass.id]; - - if (pool != undefined) - return pool; - - return (RenderablePool._pools[renderableClass.id] = new RenderablePool(renderableClass)); - }; - - /** - * //TODO - * - * @param renderableClass - */ - RenderablePool.disposePool = function (renderableClass) { - if (RenderablePool._pools[renderableClass.id]) - RenderablePool._pools[renderableClass.id] = undefined; - }; - RenderablePool._pools = new Object(); - return RenderablePool; - })(); - _pool.RenderablePool = RenderablePool; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.data - */ - (function (_pool) { - /** - * @class away.pool.RenderableListItem - */ - var CSSRenderableBase = (function () { - /** - * - * @param sourceEntity - * @param material - * @param animator - */ - function CSSRenderableBase(pool, sourceEntity, materialOwner) { - //store a reference to the pool for later disposal - this._pool = pool; - - this.sourceEntity = sourceEntity; - this.materialOwner = materialOwner; - } - /** - * - */ - CSSRenderableBase.prototype.dispose = function () { - this._pool.disposeItem(this.materialOwner); - }; - - /** - * - */ - CSSRenderableBase.prototype.invalidateGeometry = function () { - }; - - /** - * - */ - CSSRenderableBase.prototype.invalidateIndexData = function () { - }; - - /** - * - */ - CSSRenderableBase.prototype.invalidateVertexData = function (dataType) { - }; - return CSSRenderableBase; - })(); - _pool.CSSRenderableBase = CSSRenderableBase; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.data - */ - (function (_pool) { - /** - * @class away.pool.RenderableListItem - */ - var CSSBillboardRenderable = (function (_super) { - __extends(CSSBillboardRenderable, _super); - function CSSBillboardRenderable(pool, billboard) { - _super.call(this, pool, billboard, billboard); - - var div = document.createElement("div"); - div.onmousedown = function (event) { - return false; - }; - - this.htmlElement = div; - - var style = div.style; - - style.position = "absolute"; - style.transformOrigin = style["-webkit-transform-origin"] = style["-moz-transform-origin"] = style["-o-transform-origin"] = style["-ms-transform-origin"] = "0% 0%"; - - var img = document.createElement("div"); - - div.appendChild(img); - - img.className = "material" + billboard.material.id; - } - CSSBillboardRenderable.id = "billboard"; - return CSSBillboardRenderable; - })(_pool.CSSRenderableBase); - _pool.CSSBillboardRenderable = CSSBillboardRenderable; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.data - */ - (function (_pool) { - /** - * @class away.pool.RenderableListItem - */ - var CSSLineSegmentRenderable = (function (_super) { - __extends(CSSLineSegmentRenderable, _super); - function CSSLineSegmentRenderable(pool, lineSegment) { - _super.call(this, pool, lineSegment, lineSegment); - - var div = document.createElement("div"); - div.onmousedown = function (event) { - return false; - }; - - this.htmlElement = div; - - var style = div.style; - - style.position = "absolute"; - style.transformOrigin = style["-webkit-transform-origin"] = style["-moz-transform-origin"] = style["-o-transform-origin"] = style["-ms-transform-origin"] = "0% 0%"; - - var img = document.createElement("div"); - - div.appendChild(img); - - img.className = "material" + lineSegment.material.id; - } - CSSLineSegmentRenderable.id = "lineSegment"; - return CSSLineSegmentRenderable; - })(_pool.CSSRenderableBase); - _pool.CSSLineSegmentRenderable = CSSLineSegmentRenderable; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.data - */ - (function (_pool) { - /** - * @class away.pool.CSSSkyboxRenderable - */ - var CSSSkyboxRenderable = (function (_super) { - __extends(CSSSkyboxRenderable, _super); - function CSSSkyboxRenderable(pool, skyBox) { - _super.call(this, pool, skyBox, skyBox); - - var div = document.createElement("div"); - div.onmousedown = function (event) { - return false; - }; - - this.htmlElement = div; - - var style = div.style; - var img; - - //create the six images that make up the skybox - style.position = "absolute"; - style.transformOrigin = style["-webkit-transform-origin"] = style["-moz-transform-origin"] = style["-o-transform-origin"] = style["-ms-transform-origin"] = "0% 0%"; - - img = document.createElement("div"); - - div.appendChild(img); - - img.className = "material" + skyBox.material.id; - } - CSSSkyboxRenderable.id = "skybox"; - return CSSSkyboxRenderable; - })(_pool.CSSRenderableBase); - _pool.CSSSkyboxRenderable = CSSSkyboxRenderable; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -/// -var away; -(function (away) { - /** - * @module away.traverse - */ - (function (traverse) { - var EntityListItemPool = away.pool.EntityListItemPool; - - /** - * @class away.traverse.CollectorBase - */ - var CollectorBase = (function () { - function CollectorBase() { - this._numCullPlanes = 0; - this._pNumEntities = 0; - this._pNumInteractiveEntities = 0; - this._pEntityListItemPool = new EntityListItemPool(); - } - Object.defineProperty(CollectorBase.prototype, "camera", { - /** - * - */ - get: function () { - return this._pCamera; - }, - set: function (value) { - this._pCamera = value; - this._cullPlanes = this._pCamera.frustumPlanes; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(CollectorBase.prototype, "cullPlanes", { - /** - * - */ - get: function () { - return this._customCullPlanes; - }, - set: function (value) { - this._customCullPlanes = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(CollectorBase.prototype, "entityHead", { - /** - * - */ - get: function () { - return this._pEntityHead; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(CollectorBase.prototype, "numEntities", { - /** - * - */ - get: function () { - return this._pNumEntities; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(CollectorBase.prototype, "numInteractiveEntities", { - /** - * - */ - get: function () { - return this._pNumInteractiveEntities; - }, - enumerable: true, - configurable: true - }); - - /** - * - */ - CollectorBase.prototype.clear = function () { - this._pNumEntities = this._pNumInteractiveEntities = 0; - this._cullPlanes = this._customCullPlanes ? this._customCullPlanes : (this._pCamera ? this._pCamera.frustumPlanes : null); - this._numCullPlanes = this._cullPlanes ? this._cullPlanes.length : 0; - this._pEntityHead = null; - this._pEntityListItemPool.freeAll(); - }; - - /** - * - * @param node - * @returns {boolean} - */ - CollectorBase.prototype.enterNode = function (node) { - var enter = this.scene._iCollectionMark != node._iCollectionMark && node.isInFrustum(this._cullPlanes, this._numCullPlanes); - - node._iCollectionMark = this.scene._iCollectionMark; - - return enter; - }; - - /** - * - * @param entity - */ - CollectorBase.prototype.applyDirectionalLight = function (entity) { - //don't do anything here - }; - - /** - * - * @param entity - */ - CollectorBase.prototype.applyEntity = function (entity) { - this._pNumEntities++; - - if (entity._iIsMouseEnabled()) - this._pNumInteractiveEntities++; - - var item = this._pEntityListItemPool.getItem(); - item.entity = entity; - - item.next = this._pEntityHead; - this._pEntityHead = item; - }; - - /** - * - * @param entity - */ - CollectorBase.prototype.applyLightProbe = function (entity) { - //don't do anything here - }; - - /** - * - * @param entity - */ - CollectorBase.prototype.applyPointLight = function (entity) { - //don't do anything here - }; - - /** - * - * @param entity - */ - CollectorBase.prototype.applySkybox = function (entity) { - //don't do anything here - }; - return CollectorBase; - })(); - traverse.CollectorBase = CollectorBase; - })(away.traverse || (away.traverse = {})); - var traverse = away.traverse; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.traverse - */ - (function (traverse) { - /** - * @class away.traverse.EntityCollector - */ - var EntityCollector = (function (_super) { - __extends(EntityCollector, _super); - function EntityCollector() { - _super.call(this); - this._pNumLights = 0; - this._numDirectionalLights = 0; - this._numPointLights = 0; - this._numLightProbes = 0; - - this._pLights = new Array(); - this._directionalLights = new Array(); - this._pointLights = new Array(); - this._lightProbes = new Array(); - } - Object.defineProperty(EntityCollector.prototype, "directionalLights", { - /** - * - */ - get: function () { - return this._directionalLights; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(EntityCollector.prototype, "lightProbes", { - /** - * - */ - get: function () { - return this._lightProbes; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(EntityCollector.prototype, "lights", { - /** - * - */ - get: function () { - return this._pLights; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(EntityCollector.prototype, "pointLights", { - /** - * - */ - get: function () { - return this._pointLights; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(EntityCollector.prototype, "skyBox", { - /** - * - */ - get: function () { - return this._pSkybox; - }, - enumerable: true, - configurable: true - }); - - /** - * - * @param entity - */ - EntityCollector.prototype.applyDirectionalLight = function (entity) { - this._directionalLights[this._numDirectionalLights++] = entity; - }; - - /** - * - * @param entity - */ - EntityCollector.prototype.applyLightProbe = function (entity) { - this._lightProbes[this._numLightProbes++] = entity; - }; - - /** - * - * @param entity - */ - EntityCollector.prototype.applyPointLight = function (entity) { - this._pointLights[this._numPointLights++] = entity; - }; - - /** - * - * @param entity - */ - EntityCollector.prototype.applySkybox = function (entity) { - this._pSkybox = entity; - }; - - /** - * - */ - EntityCollector.prototype.clear = function () { - _super.prototype.clear.call(this); - - this._pSkybox = null; - - if (this._pNumLights > 0) - this._pLights.length = this._pNumLights = 0; - - if (this._numDirectionalLights > 0) - this._directionalLights.length = this._numDirectionalLights = 0; - - if (this._numPointLights > 0) - this._pointLights.length = this._numPointLights = 0; - - if (this._numLightProbes > 0) - this._lightProbes.length = this._numLightProbes = 0; - }; - return EntityCollector; - })(traverse.CollectorBase); - traverse.EntityCollector = EntityCollector; - })(away.traverse || (away.traverse = {})); - var traverse = away.traverse; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.traverse - */ - (function (traverse) { - var Vector3D = away.geom.Vector3D; - - /** - * The RaycastCollector class is a traverser for scene partitions that collects all scene graph entities that are - * considered intersecting with the defined ray. - * - * @see away.partition.Partition - * @see away.entities.IEntity - * - * @class away.traverse.RaycastCollector - */ - var RaycastCollector = (function (_super) { - __extends(RaycastCollector, _super); - /** - * Creates a new RaycastCollector object. - */ - function RaycastCollector() { - _super.call(this); - this._rayPosition = new Vector3D(); - this._rayDirection = new Vector3D(); - this._iCollectionMark = 0; - } - Object.defineProperty(RaycastCollector.prototype, "rayPosition", { - /** - * Provides the starting position of the ray. - */ - get: function () { - return this._rayPosition; - }, - set: function (value) { - this._rayPosition = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(RaycastCollector.prototype, "rayDirection", { - /** - * Provides the direction vector of the ray. - */ - get: function () { - return this._rayDirection; - }, - set: function (value) { - this._rayDirection = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * Returns true if the current node is at least partly in the frustum. If so, the partition node knows to pass on the traverser to its children. - * - * @param node The Partition3DNode object to frustum-test. - */ - RaycastCollector.prototype.enterNode = function (node) { - return node.isIntersectingRay(this._rayPosition, this._rayDirection); - }; - return RaycastCollector; - })(traverse.CollectorBase); - traverse.RaycastCollector = RaycastCollector; - })(away.traverse || (away.traverse = {})); - var traverse = away.traverse; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.traverse - */ - (function (traverse) { - /** - * @class away.traverse.CSSEntityCollector - */ - var CSSEntityCollector = (function (_super) { - __extends(CSSEntityCollector, _super); - function CSSEntityCollector() { - _super.call(this); - } - return CSSEntityCollector; - })(traverse.CollectorBase); - traverse.CSSEntityCollector = CSSEntityCollector; - })(away.traverse || (away.traverse = {})); - var traverse = away.traverse; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.traverse - */ - (function (traverse) { - /** - * @class away.traverse.ShadowCasterCollector - */ - var ShadowCasterCollector = (function (_super) { - __extends(ShadowCasterCollector, _super); - function ShadowCasterCollector() { - _super.call(this); - } - /** - * - */ - ShadowCasterCollector.prototype.enterNode = function (node) { - var enter = this.scene._iCollectionMark != node._iCollectionMark && node.isCastingShadow(); - - if (!enter) { - node._iCollectionMark = this.scene._iCollectionMark; - - return false; - } - - return _super.prototype.enterNode.call(this, node); - }; - return ShadowCasterCollector; - })(traverse.CollectorBase); - traverse.ShadowCasterCollector = ShadowCasterCollector; - })(away.traverse || (away.traverse = {})); - var traverse = away.traverse; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.partition - */ - (function (partition) { - /** - * @class away.partition.NodeBase - */ - var NodeBase = (function () { - /** - * - */ - function NodeBase() { - this._pNumChildNodes = 0; - this._iNumEntities = 0; - this._pChildNodes = new Array(); - } - Object.defineProperty(NodeBase.prototype, "boundsVisible", { - /** - * - */ - get: function () { - return this._explicitBoundsVisible; - }, - set: function (value) { - if (this._explicitBoundsVisible == value) - return; - - this._explicitBoundsVisible = value; - - this._iUpdateImplicitBoundsVisible(this._iParent ? this._iParent.boundsChildrenVisible : false); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(NodeBase.prototype, "boundsChildrenVisible", { - get: function () { - return this._boundsChildrenVisible; - }, - set: function (value) { - if (this._boundsChildrenVisible == value) - return; - - this._boundsChildrenVisible = value; - - for (var i = 0; i < this._pNumChildNodes; ++i) - this._pChildNodes[i]._iUpdateImplicitBoundsVisible(this._boundsChildrenVisible); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(NodeBase.prototype, "parent", { - /** - * - */ - get: function () { - return this._iParent; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(NodeBase.prototype, "_pNumEntities", { - /** - * - * @protected - */ - get: function () { - return this._iNumEntities; - }, - enumerable: true, - configurable: true - }); - - /** - * - * @param planes - * @param numPlanes - * @returns {boolean} - * @internal - */ - NodeBase.prototype.isInFrustum = function (planes, numPlanes) { - return true; - }; - - /** - * - * @param rayPosition - * @param rayDirection - * @returns {boolean} - */ - NodeBase.prototype.isIntersectingRay = function (rayPosition, rayDirection) { - return true; - }; - - /** - * - * @returns {boolean} - */ - NodeBase.prototype.isCastingShadow = function () { - return true; - }; - - /** - * - * @param entity - * @returns {away.partition.NodeBase} - */ - NodeBase.prototype.findPartitionForEntity = function (entity) { - return this; - }; - - /** - * - * @param traverser - */ - NodeBase.prototype.acceptTraverser = function (traverser) { - if (this._pNumEntities == 0 && !this._implicitBoundsVisible) - return; - - if (traverser.enterNode(this)) { - var i = 0; - - while (i < this._pNumChildNodes) - this._pChildNodes[i++].acceptTraverser(traverser); - - if (this._implicitBoundsVisible) - this._pBoundsPrimitive.partitionNode.acceptTraverser(traverser); - } - }; - - /** - * - * @protected - */ - NodeBase.prototype._pCreateBoundsPrimitive = function () { - return null; - }; - - /** - * - * @param node - * @internal - */ - NodeBase.prototype.iAddNode = function (node) { - node._iParent = this; - this._iNumEntities += node._pNumEntities; - this._pChildNodes[this._pNumChildNodes++] = node; - - node._iUpdateImplicitBoundsVisible(this.boundsChildrenVisible); - - var numEntities = node._pNumEntities; - node = this; - - do { - node._iNumEntities += numEntities; - } while((node = node._iParent) != null); - }; - - /** - * - * @param node - * @internal - */ - NodeBase.prototype.iRemoveNode = function (node) { - var index = this._pChildNodes.indexOf(node); - this._pChildNodes[index] = this._pChildNodes[--this._pNumChildNodes]; - this._pChildNodes.pop(); - - node._iUpdateImplicitBoundsVisible(false); - - var numEntities = node._pNumEntities; - node = this; - - do { - node._pNumEntities -= numEntities; - } while((node = node._iParent) != null); - }; - - NodeBase.prototype._iUpdateImplicitBoundsVisible = function (value) { - if (this._implicitBoundsVisible == this._explicitBoundsVisible || value) - return; - - this._implicitBoundsVisible = this._explicitBoundsVisible || value; - - this._iUpdateEntityBounds(); - - for (var i = 0; i < this._pNumChildNodes; ++i) - this._pChildNodes[i]._iUpdateImplicitBoundsVisible(this._boundsChildrenVisible); - }; - - /** - * @internal - */ - NodeBase.prototype._iIsBoundsVisible = function () { - return this._implicitBoundsVisible; - }; - - // public _pUpdateNumEntities(value:number) - // { - // var diff:number = value - this._pNumEntities; - // var node:NodeBase = this; - // - // do { - // node._pNumEntities += diff; - // } while ((node = node._iParent) != null); - // } - NodeBase.prototype._iUpdateEntityBounds = function () { - if (this._pBoundsPrimitive) { - this._pBoundsPrimitive.dispose(); - this._pBoundsPrimitive = null; - } - - if (this._implicitBoundsVisible) - this._pBoundsPrimitive = this._pCreateBoundsPrimitive(); - }; - return NodeBase; - })(); - partition.NodeBase = NodeBase; - })(away.partition || (away.partition = {})); - var partition = away.partition; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.partition - */ - (function (partition) { - /** - * @class away.partition.NullNode - */ - var NullNode = (function () { - function NullNode() { - } - return NullNode; - })(); - partition.NullNode = NullNode; - })(away.partition || (away.partition = {})); - var partition = away.partition; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.partition - */ - (function (partition) { - /** - * @class away.partition.Partition - */ - var Partition = (function () { - function Partition(rootNode) { - this._updatesMade = false; - this._rootNode = rootNode || new partition.NullNode(); - } - Object.defineProperty(Partition.prototype, "rootNode", { - get: function () { - return this._rootNode; - }, - enumerable: true, - configurable: true - }); - - Partition.prototype.traverse = function (traverser) { - if (this._updatesMade) - this.updateEntities(); - - this._rootNode.acceptTraverser(traverser); - }; - - Partition.prototype.iMarkForUpdate = function (entity) { - var node = entity.partitionNode; - var t = this._updateQueue; - - while (t) { - if (node == t) - return; - - t = t._iUpdateQueueNext; - } - - node._iUpdateQueueNext = this._updateQueue; - - this._updateQueue = node; - this._updatesMade = true; - }; - - Partition.prototype.iRemoveEntity = function (entity) { - var node = entity.partitionNode; - var t; - - node.removeFromParent(); - - if (node == this._updateQueue) { - this._updateQueue = node._iUpdateQueueNext; - } else { - t = this._updateQueue; - while (t && t._iUpdateQueueNext != node) - t = t._iUpdateQueueNext; - - if (t) - t._iUpdateQueueNext = node._iUpdateQueueNext; - } - - node._iUpdateQueueNext = null; - - if (!this._updateQueue) - this._updatesMade = false; - }; - - Partition.prototype.updateEntities = function () { - var node = this._updateQueue; - var targetNode; - var t; - this._updateQueue = null; - this._updatesMade = false; - - do { - targetNode = this._rootNode.findPartitionForEntity(node.entity); - - if (node.parent != targetNode) { - if (node) - node.removeFromParent(); - - targetNode.iAddNode(node); - } - - t = node._iUpdateQueueNext; - node._iUpdateQueueNext = null; - - //required for controllers with autoUpdate set to true - node.entity._iInternalUpdate(); - } while((node = t) != null); - }; - return Partition; - })(); - partition.Partition = Partition; - })(away.partition || (away.partition = {})); - var partition = away.partition; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.partition - */ - (function (partition) { - /** - * @class away.partition.EntityNode - */ - var EntityNode = (function (_super) { - __extends(EntityNode, _super); - function EntityNode(entity) { - _super.call(this); - this._entity = entity; - this._iNumEntities = 1; - } - Object.defineProperty(EntityNode.prototype, "entity", { - get: function () { - return this._entity; - }, - enumerable: true, - configurable: true - }); - - EntityNode.prototype.removeFromParent = function () { - if (this._iParent) - this._iParent.iRemoveNode(this); - - this._iParent = null; - }; - - /** - * - * @returns {boolean} - */ - EntityNode.prototype.isCastingShadow = function () { - return this.entity.castsShadows; - }; - - /** - * - * @param planes - * @param numPlanes - * @returns {boolean} - */ - EntityNode.prototype.isInFrustum = function (planes, numPlanes) { - if (!this._entity._iIsVisible()) - return false; - - return this._entity.worldBounds.isInFrustum(planes, numPlanes); - }; - - /** - * @inheritDoc - */ - EntityNode.prototype.acceptTraverser = function (traverser) { - if (traverser.enterNode(this)) - traverser.applyEntity(this._entity); - }; - - /** - * @inheritDoc - */ - EntityNode.prototype.isIntersectingRay = function (rayPosition, rayDirection) { - if (!this._entity._iIsVisible()) - return false; - - return this._entity.isIntersectingRay(rayPosition, rayDirection); - }; - - /** - * - * @protected - */ - EntityNode.prototype._pCreateBoundsPrimitive = function () { - return this._entity.bounds.boundingEntity; - }; - return EntityNode; - })(partition.NodeBase); - partition.EntityNode = EntityNode; - })(away.partition || (away.partition = {})); - var partition = away.partition; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.partition - */ - (function (partition) { - /** - * @class away.partition.CameraNode - */ - var CameraNode = (function (_super) { - __extends(CameraNode, _super); - function CameraNode(camera) { - _super.call(this, camera); - } - /** - * @inheritDoc - */ - CameraNode.prototype.acceptTraverser = function (traverser) { - // todo: dead end for now, if it has a debug mesh, then sure accept that - }; - return CameraNode; - })(partition.EntityNode); - partition.CameraNode = CameraNode; - })(away.partition || (away.partition = {})); - var partition = away.partition; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.partition - */ - (function (partition) { - /** - * @class away.partition.DirectionalLightNode - */ - var DirectionalLightNode = (function (_super) { - __extends(DirectionalLightNode, _super); - /** - * - * @param directionalLight - */ - function DirectionalLightNode(directionalLight) { - _super.call(this, directionalLight); - - this._directionalLight = directionalLight; - } - /** - * @inheritDoc - */ - DirectionalLightNode.prototype.acceptTraverser = function (traverser) { - if (traverser.enterNode(this)) - traverser.applyDirectionalLight(this._directionalLight); - }; - - /** - * - * @returns {boolean} - */ - DirectionalLightNode.prototype.isCastingShadow = function () { - return false; - }; - return DirectionalLightNode; - })(partition.EntityNode); - partition.DirectionalLightNode = DirectionalLightNode; - })(away.partition || (away.partition = {})); - var partition = away.partition; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.partition - */ - (function (partition) { - /** - * @class away.partition.LightProbeNode - */ - var LightProbeNode = (function (_super) { - __extends(LightProbeNode, _super); - /** - * - * @param lightProbe - */ - function LightProbeNode(lightProbe) { - _super.call(this, lightProbe); - - this._lightProbe = lightProbe; - } - /** - * @inheritDoc - */ - LightProbeNode.prototype.acceptTraverser = function (traverser) { - if (traverser.enterNode(this)) - traverser.applyLightProbe(this._lightProbe); - }; - - /** - * - * @returns {boolean} - */ - LightProbeNode.prototype.isCastingShadow = function () { - return false; - }; - return LightProbeNode; - })(partition.EntityNode); - partition.LightProbeNode = LightProbeNode; - })(away.partition || (away.partition = {})); - var partition = away.partition; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.partition - */ - (function (partition) { - /** - * @class away.partition.PointLightNode - */ - var PointLightNode = (function (_super) { - __extends(PointLightNode, _super); - /** - * - * @param pointLight - */ - function PointLightNode(pointLight) { - _super.call(this, pointLight); - - this._pointLight = pointLight; - } - /** - * @inheritDoc - */ - PointLightNode.prototype.acceptTraverser = function (traverser) { - if (traverser.enterNode(this)) - traverser.applyPointLight(this._pointLight); - }; - - /** - * - * @returns {boolean} - */ - PointLightNode.prototype.isCastingShadow = function () { - return false; - }; - return PointLightNode; - })(partition.EntityNode); - partition.PointLightNode = PointLightNode; - })(away.partition || (away.partition = {})); - var partition = away.partition; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.partition - */ - (function (partition) { - /** - * SkyboxNode is a space partitioning leaf node that contains a Skybox object. - * - * @class away.partition.SkyboxNode - */ - var SkyboxNode = (function (_super) { - __extends(SkyboxNode, _super); - /** - * Creates a new SkyboxNode object. - * @param skyBox The Skybox to be contained in the node. - */ - function SkyboxNode(skyBox) { - _super.call(this, skyBox); - - this._skyBox = skyBox; - } - /** - * @inheritDoc - */ - SkyboxNode.prototype.acceptTraverser = function (traverser) { - if (traverser.enterNode(this)) - traverser.applySkybox(this._skyBox); - }; - - /** - * - * @param planes - * @param numPlanes - * @returns {boolean} - */ - SkyboxNode.prototype.isInFrustum = function (planes, numPlanes) { - if (!this._skyBox._iIsVisible) - return false; - - //a skybox is always in view unless its visibility is set to false - return true; - }; - return SkyboxNode; - })(partition.EntityNode); - partition.SkyboxNode = SkyboxNode; - })(away.partition || (away.partition = {})); - var partition = away.partition; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.pick - */ - (function (pick) { - - })(away.pick || (away.pick = {})); - var pick = away.pick; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.pick - */ - (function (pick) { - - })(away.pick || (away.pick = {})); - var pick = away.pick; -})(away || (away = {})); -var away; -(function (away) { - /// - /** - * @module away.pick - */ - (function (pick) { - /** - * Value object for a picking collision returned by a picking collider. Created as unique objects on display objects - * - * @see away.base.DisplayObject#pickingCollisionVO - * @see away.core.pick.IPickingCollider - * - * @class away.pick.PickingCollisionVO - */ - var PickingCollisionVO = (function () { - /** - * Creates a new PickingCollisionVO object. - * - * @param entity The entity to which this collision object belongs. - */ - function PickingCollisionVO(displayObject) { - this.displayObject = displayObject; - } - return PickingCollisionVO; - })(); - pick.PickingCollisionVO = PickingCollisionVO; - })(away.pick || (away.pick = {})); - var pick = away.pick; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.pick - */ - (function (pick) { - var RaycastCollector = away.traverse.RaycastCollector; - - /** - * Picks a 3d object from a view or scene by 3D raycast calculations. - * Performs an initial coarse boundary calculation to return a subset of entities whose bounding volumes intersect with the specified ray, - * then triggers an optional picking collider on individual entity objects to further determine the precise values of the picking ray collision. - * - * @class away.pick.RaycastPicker - */ - var RaycastPicker = (function () { - /** - * Creates a new RaycastPicker object. - * - * @param findClosestCollision Determines whether the picker searches for the closest bounds collision along the ray, - * or simply returns the first collision encountered. Defaults to false. - */ - function RaycastPicker(findClosestCollision) { - if (typeof findClosestCollision === "undefined") { findClosestCollision = false; } - this._ignoredEntities = []; - this._onlyMouseEnabled = true; - this._numEntities = 0; - this._raycastCollector = new RaycastCollector(); - - this._findClosestCollision = findClosestCollision; - this._entities = new Array(); - } - Object.defineProperty(RaycastPicker.prototype, "onlyMouseEnabled", { - /** - * @inheritDoc - */ - get: function () { - return this._onlyMouseEnabled; - }, - set: function (value) { - this._onlyMouseEnabled = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - RaycastPicker.prototype.getViewCollision = function (x, y, view) { - //update ray - var rayPosition = view.unproject(x, y, 0); - var rayDirection = view.unproject(x, y, 1).subtract(rayPosition); - - return this.getSceneCollision(rayPosition, rayDirection, view.scene); - }; - - /** - * @inheritDoc - */ - RaycastPicker.prototype.getSceneCollision = function (rayPosition, rayDirection, scene) { - //clear collector - this._raycastCollector.clear(); - - //setup ray vectors - this._raycastCollector.rayPosition = rayPosition; - this._raycastCollector.rayDirection = rayDirection; - - // collect entities to test - scene.traversePartitions(this._raycastCollector); - - this._numEntities = 0; - var node = this._raycastCollector.entityHead; - var entity; - - while (node) { - if (!this.isIgnored(entity = node.entity)) - this._entities[this._numEntities++] = entity; - - node = node.next; - } - - //early out if no collisions detected - if (!this._numEntities) - return null; - - return this.getPickingCollisionVO(this._raycastCollector); - }; - - // public getEntityCollision(position:away.geom.Vector3D, direction:away.geom.Vector3D, entities:Array):PickingCollisionVO - // { - // this._numEntities = 0; - // - // var entity:IEntity; - // var l:number = entities.length; - // - // for (var c:number = 0; c < l; c++) { - // entity = entities[c]; - // - // if (entity.isIntersectingRay(position, direction)) - // this._entities[this._numEntities++] = entity; - // } - // - // return this.getPickingCollisionVO(this._raycastCollector); - // } - RaycastPicker.prototype.setIgnoreList = function (entities) { - this._ignoredEntities = entities; - }; - - RaycastPicker.prototype.isIgnored = function (entity) { - if (this._onlyMouseEnabled && !entity._iIsMouseEnabled()) - return true; - - var len = this._ignoredEntities.length; - for (var i = 0; i < len; i++) - if (this._ignoredEntities[i] == entity) - return true; - - return false; - }; - - RaycastPicker.prototype.sortOnNearT = function (entity1, entity2) { - return entity1._iPickingCollisionVO.rayEntryDistance > entity2._iPickingCollisionVO.rayEntryDistance ? 1 : -1; - }; - - RaycastPicker.prototype.getPickingCollisionVO = function (collector) { - // trim before sorting - this._entities.length = this._numEntities; - - // Sort entities from closest to furthest. - this._entities = this._entities.sort(this.sortOnNearT); // TODO - test sort filter in JS - - // --------------------------------------------------------------------- - // Evaluate triangle collisions when needed. - // Replaces collision data provided by bounds collider with more precise data. - // --------------------------------------------------------------------- - var shortestCollisionDistance = Number.MAX_VALUE; - var bestCollisionVO; - var pickingCollisionVO; - var entity; - var i; - - for (i = 0; i < this._numEntities; ++i) { - entity = this._entities[i]; - pickingCollisionVO = entity._iPickingCollisionVO; - if (entity.pickingCollider) { - // If a collision exists, update the collision data and stop all checks. - if ((bestCollisionVO == null || pickingCollisionVO.rayEntryDistance < bestCollisionVO.rayEntryDistance) && entity._iTestCollision(shortestCollisionDistance, this._findClosestCollision)) { - shortestCollisionDistance = pickingCollisionVO.rayEntryDistance; - bestCollisionVO = pickingCollisionVO; - if (!this._findClosestCollision) { - this.updateLocalPosition(pickingCollisionVO); - return pickingCollisionVO; - } - } - } else if (bestCollisionVO == null || pickingCollisionVO.rayEntryDistance < bestCollisionVO.rayEntryDistance) { - // Note: a bounds collision with a ray origin inside its bounds is ONLY ever used - // to enable the detection of a corresponsding triangle collision. - // Therefore, bounds collisions with a ray origin inside its bounds can be ignored - // if it has been established that there is NO triangle collider to test - if (!pickingCollisionVO.rayOriginIsInsideBounds) { - this.updateLocalPosition(pickingCollisionVO); - return pickingCollisionVO; - } - } - } - - return bestCollisionVO; - }; - - RaycastPicker.prototype.updateLocalPosition = function (pickingCollisionVO) { - var collisionPos = (pickingCollisionVO.localPosition == null) ? new away.geom.Vector3D() : pickingCollisionVO.localPosition; - - var rayDir = pickingCollisionVO.localRayDirection; - var rayPos = pickingCollisionVO.localRayPosition; - var t = pickingCollisionVO.rayEntryDistance; - collisionPos.x = rayPos.x + t * rayDir.x; - collisionPos.y = rayPos.y + t * rayDir.y; - collisionPos.z = rayPos.z + t * rayDir.z; - }; - - RaycastPicker.prototype.dispose = function () { - //TODO - }; - return RaycastPicker; - })(); - pick.RaycastPicker = RaycastPicker; - })(away.pick || (away.pick = {})); - var pick = away.pick; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.render - */ - (function (_render) { - - })(away.render || (away.render = {})); - var render = away.render; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.render - */ - (function (render) { - /** - * RendererBase forms an abstract base class for classes that are used in the rendering pipeline to render the - * contents of a partition - * - * @class away.render.RendererBase - */ - var CSSRendererBase = (function (_super) { - __extends(CSSRendererBase, _super); - /** - * Creates a new RendererBase object. - */ - function CSSRendererBase(renderToTexture, forceSoftware, profile) { - if (typeof renderToTexture === "undefined") { renderToTexture = false; } - if (typeof forceSoftware === "undefined") { forceSoftware = false; } - if (typeof profile === "undefined") { profile = "baseline"; } - _super.call(this); - this._backgroundR = 0; - this._backgroundG = 0; - this._backgroundB = 0; - this._backgroundAlpha = 1; - this._shareContext = false; - this._pBackBufferInvalid = true; - this._depthTextureInvalid = true; - this._viewPort = new away.geom.Rectangle(); - this._scissorRect = new away.geom.Rectangle(); - this._localPos = new away.geom.Point(); - this._globalPos = new away.geom.Point(); - - this._billboardRenderablePool = away.pool.RenderablePool.getPool(away.pool.CSSBillboardRenderable); - this._lineSegmentRenderablePool = away.pool.RenderablePool.getPool(away.pool.CSSLineSegmentRenderable); - - this._viewPort = new away.geom.Rectangle(); - - if (this._width == 0) - this.width = window.innerWidth; - - if (this._height == 0) - this.height = window.innerHeight; - } - Object.defineProperty(CSSRendererBase.prototype, "viewPort", { - /** - * A viewPort rectangle equivalent of the StageGL size and position. - */ - get: function () { - return this._viewPort; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(CSSRendererBase.prototype, "scissorRect", { - /** - * A scissor rectangle equivalent of the view size and position. - */ - get: function () { - return this._scissorRect; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(CSSRendererBase.prototype, "x", { - /** - * - */ - get: function () { - return this._localPos.x; - }, - set: function (value) { - if (this.x == value) - return; - - this.updateGlobalPos(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(CSSRendererBase.prototype, "y", { - /** - * - */ - get: function () { - return this._localPos.y; - }, - set: function (value) { - if (this.y == value) - return; - - this._globalPos.y = this._localPos.y = value; - - this.updateGlobalPos(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(CSSRendererBase.prototype, "width", { - /** - * - */ - get: function () { - return this._width; - }, - set: function (value) { - if (this._width == value) - return; - - this._width = value; - this._scissorRect.width = value; - this._viewPort.width = value; - - this._pBackBufferInvalid = true; - this._depthTextureInvalid = true; - - this.notifyViewportUpdate(); - this.notifyScissorUpdate(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(CSSRendererBase.prototype, "height", { - /** - * - */ - get: function () { - return this._height; - }, - set: function (value) { - if (this._height == value) - return; - - this._height = value; - this._scissorRect.height = value; - this._viewPort.height = value; - - this._pBackBufferInvalid = true; - this._depthTextureInvalid = true; - - this.notifyViewportUpdate(); - this.notifyScissorUpdate(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(CSSRendererBase.prototype, "_iBackgroundR", { - /** - * The background color's red component, used when clearing. - * - * @private - */ - get: function () { - return this._backgroundR; - }, - set: function (value) { - if (this._backgroundR == value) - return; - - this._backgroundR = value; - - this._pBackBufferInvalid = true; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(CSSRendererBase.prototype, "_iBackgroundG", { - /** - * The background color's green component, used when clearing. - * - * @private - */ - get: function () { - return this._backgroundG; - }, - set: function (value) { - if (this._backgroundG == value) - return; - - this._backgroundG = value; - - this._pBackBufferInvalid = true; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(CSSRendererBase.prototype, "_iBackgroundB", { - /** - * The background color's blue component, used when clearing. - * - * @private - */ - get: function () { - return this._backgroundB; - }, - set: function (value) { - if (this._backgroundB == value) - return; - - this._backgroundB = value; - - this._pBackBufferInvalid = true; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(CSSRendererBase.prototype, "shareContext", { - get: function () { - return this._shareContext; - }, - set: function (value) { - if (this._shareContext == value) - return; - - this._shareContext = value; - - this.updateGlobalPos(); - }, - enumerable: true, - configurable: true - }); - - - /** - * Disposes the resources used by the RendererBase. - */ - CSSRendererBase.prototype.dispose = function () { - /* - if (_backgroundImageRenderer) { - _backgroundImageRenderer.dispose(); - _backgroundImageRenderer = null; - } - */ - }; - - CSSRendererBase.prototype.render = function (entityCollector) { - this._viewportDirty = false; - this._scissorDirty = false; - }; - - /** - * Renders the potentially visible geometry to the back buffer or texture. - * @param entityCollector The EntityCollector object containing the potentially visible geometry. - * @param scissorRect - */ - CSSRendererBase.prototype._iRender = function (entityCollector, target, scissorRect, surfaceSelector) { - if (typeof target === "undefined") { target = null; } - if (typeof scissorRect === "undefined") { scissorRect = null; } - if (typeof surfaceSelector === "undefined") { surfaceSelector = 0; } - if (!entityCollector.entityHead) - return; - - this.pExecuteRender(entityCollector, scissorRect); - }; - - CSSRendererBase.prototype._iRenderCascades = function (entityCollector, target, numCascades, scissorRects, cameras) { - }; - CSSRendererBase.prototype.pCollectRenderables = function (entityCollector) { - //reset head values - this._renderableHead = null; - - //grab entity head - var item = entityCollector.entityHead; - - //set temp values for entry point and camera forward vector - this._pCamera = entityCollector.camera; - this._iEntryPoint = this._pCamera.scenePosition; - this._pCameraForward = this._pCamera.transform.forwardVector; - - while (item) { - item.entity._iCollectRenderables(this); - item = item.next; - } - }; - - /** - * Renders the potentially visible geometry to the back buffer or texture. Only executed if everything is set up. - * @param entityCollector The EntityCollector object containing the potentially visible geometry. - * @param scissorRect - */ - CSSRendererBase.prototype.pExecuteRender = function (entityCollector, scissorRect) { - if (typeof scissorRect === "undefined") { scissorRect = null; } - this.pCollectRenderables(entityCollector); - - this.pDraw(entityCollector); - }; - - /** - * Performs the actual drawing of dom objects to the target. - * - * @param entityCollector The EntityCollector object containing the potentially visible dom objects. - */ - CSSRendererBase.prototype.pDraw = function (entityCollector) { - throw new away.errors.AbstractMethodError(); - }; - - Object.defineProperty(CSSRendererBase.prototype, "_iBackgroundAlpha", { - get: function () { - return this._backgroundAlpha; - }, - set: function (value) { - if (this._backgroundAlpha == value) - return; - - this._backgroundAlpha = value; - - this._pBackBufferInvalid = true; - }, - enumerable: true, - configurable: true - }); - - - /** - * - * @param billboard - */ - CSSRendererBase.prototype.applyBillboard = function (billboard) { - this._applyRenderable(this._billboardRenderablePool.getItem(billboard)); - }; - - /** - * - * @param lineSubMesh - */ - CSSRendererBase.prototype.applyLineSubMesh = function (lineSubMesh) { - //this._applyRenderable( this._billboardRenderablePool.getItem(lineSegment)); - }; - - /** - * - * @param skybox - */ - CSSRendererBase.prototype.applySkybox = function (skybox) { - }; - - /** - * - * @param triangleSubMesh - */ - CSSRendererBase.prototype.applyTriangleSubMesh = function (triangleSubMesh) { - }; - - /** - * - * @param renderable - * @private - */ - CSSRendererBase.prototype._applyRenderable = function (renderable) { - var material = renderable.materialOwner.material; - var entity = renderable.sourceEntity; - var position = entity.scenePosition; - - if (material) { - //set ids for faster referencing - renderable.materialId = material._iMaterialId; - - // renderable.renderOrderId = material._iRenderOrderId; - renderable.cascaded = false; - - // project onto camera's z-axis - position = this._iEntryPoint.subtract(position); - renderable.zIndex = entity.zOffset - position.dotProduct(this._pCameraForward); - - //store reference to scene transform - renderable.renderSceneTransform = renderable.sourceEntity.getRenderSceneTransform(this._pCamera); - - //store reference to next item in list - renderable.next = this._renderableHead; - this._renderableHead = renderable; - } - }; - - /** - * @private - */ - CSSRendererBase.prototype.notifyScissorUpdate = function () { - if (this._scissorDirty) - return; - - this._scissorDirty = true; - - if (!this._scissorUpdated) - this._scissorUpdated = new away.events.RendererEvent(away.events.RendererEvent.SCISSOR_UPDATED); - - this.dispatchEvent(this._scissorUpdated); - }; - - /** - * @private - */ - CSSRendererBase.prototype.notifyViewportUpdate = function () { - if (this._viewportDirty) - return; - - this._viewportDirty = true; - - if (!this._viewPortUpdated) - this._viewPortUpdated = new away.events.RendererEvent(away.events.RendererEvent.VIEWPORT_UPDATED); - - this.dispatchEvent(this._viewPortUpdated); - }; - - /** - * - */ - CSSRendererBase.prototype.updateGlobalPos = function () { - this._viewPort.x = this._globalPos.x; - this._viewPort.y = this._globalPos.y; - - this.notifyViewportUpdate(); - this.notifyScissorUpdate(); - }; - - CSSRendererBase.prototype._iCreateEntityCollector = function () { - throw new away.errors.AbstractMethodError(); - }; - return CSSRendererBase; - })(away.events.EventDispatcher); - render.CSSRendererBase = CSSRendererBase; - })(away.render || (away.render = {})); - var render = away.render; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.render - */ - (function (render) { - /** - * The DefaultRenderer class provides the default rendering method. It renders the scene graph objects using the - * materials assigned to them. - * - * @class away.render.DefaultRenderer - */ - var CSSDefaultRenderer = (function (_super) { - __extends(CSSDefaultRenderer, _super); - /** - * Creates a new CSSDefaultRenderer object. - */ - function CSSDefaultRenderer() { - _super.call(this); - this._contextMatrix = new away.geom.Matrix3D(); - this._skyboxProjection = new away.geom.Matrix3D(); - this._transform = new away.geom.Matrix3D(); - - //create container for the renderer - this._container = document.createElement("div"); - this._container.style.overflow = "hidden"; - this._container.style.position = "absolute"; - - //add container to body - document.body.appendChild(this._container); - - //create conxtext for the renderer - this._context = document.createElement("div"); - this._contextStyle = this._context.style; - this._contextStyle.position = "absolute"; - this._contextStyle.transformStyle = this._contextStyle["-webkit-transform-style"] = this._contextStyle["-moz-transform-style"] = this._contextStyle["-o-transform-style"] = this._contextStyle["-ms-transform-style"] = "preserve-3d"; - this._contextStyle.transformOrigin = this._contextStyle["-webkit-transform-origin"] = this._contextStyle["-moz-transform-origin"] = this._contextStyle["-o-transform-origin"] = this._contextStyle["-ms-transform-origin"] = "0% 0%"; - - //add context to container - this._container.appendChild(this._context); - } - /** - * - * @param entityCollector - */ - CSSDefaultRenderer.prototype.render = function (entityCollector) { - _super.prototype.render.call(this, entityCollector); - - if (this._pBackBufferInvalid) - this.pUpdateBackBuffer(); - - this._iRender(entityCollector); - - this._pBackBufferInvalid = false; - }; - - /** - * @inheritDoc - */ - CSSDefaultRenderer.prototype.pDraw = function (entityCollector) { - // if (entityCollector.skyBox) { - // if (this._activeMaterial) - // this._activeMaterial.iDeactivate(this._pStageGL); - // - // this._activeMaterial = null; - // - // this._pContext.setDepthTest(false, away.gl.ContextGLCompareMode.ALWAYS); - // this.drawSkybox(entityCollector); - // - // } - // - // var which:number = target? DefaultRenderer.SCREEN_PASSES : DefaultRenderer.ALL_PASSES; - var sheet = document.styleSheets[document.styleSheets.length - 1]; - - for (var i = 0; i < sheet.cssRules.length; i++) { - var style = sheet.cssRules[i].style; - style.transform = style["-webkit-transform"] = style["-moz-transform"] = style["-o-transform"] = style["-ms-transform"] = (entityCollector.camera.projection.coordinateSystem == away.projections.CoordinateSystem.RIGHT_HANDED) ? "" : "scale3d(1, -1, 1) translateY(-" + style.height + ")"; - } - - this.drawRenderables(this._renderableHead, entityCollector); - - // if (this._activeMaterial) - // this._activeMaterial.iDeactivate(this._pStageGL); - this._activeMaterial = null; - }; - - /** - * Updates the backbuffer properties. - */ - CSSDefaultRenderer.prototype.pUpdateBackBuffer = function () { - this._container.style.width = this._width + "px"; - this._container.style.height = this._height + "px"; - this._container.style.clip = "rect(0px, " + this._width + "px, " + this._height + "px, 0px)"; - - //update context matrix - this._contextMatrix.rawData[0] = this._width / 2; - this._contextMatrix.rawData[5] = -this._height / 2; - this._contextMatrix.rawData[10] = -1; //fix for innaccurate z-sort - this._contextMatrix.rawData[12] = this._width / 2; - this._contextMatrix.rawData[13] = this._height / 2; - - //update context tranform - this._contextStyle.transform = this._contextStyle["-webkit-transform"] = this._contextStyle["-moz-transform"] = this._contextStyle["-o-transform"] = this._contextStyle["-ms-transform"] = this._contextMatrix.toString(); - - this._pBackBufferInvalid = false; - }; - - /** - * Draw the skybox if present. - * @param entityCollector The EntityCollector containing all potentially visible information. - */ - CSSDefaultRenderer.prototype.drawSkybox = function (entityCollector) { - //TODO - }; - - /** - * Draw a list of renderables. - * @param renderables The renderables to draw. - * @param entityCollector The EntityCollector containing all potentially visible information. - */ - CSSDefaultRenderer.prototype.drawRenderables = function (item, entityCollector) { - var viewProjection = entityCollector.camera.viewProjection.clone(); - - while (item) { - this._activeMaterial = item.materialOwner.material; - - //serialise transform and apply to html element - this._transform.copyRawDataFrom(item.renderSceneTransform.rawData); - this._transform.append(viewProjection); - - var style = item.htmlElement.style; - - style.transform = style["-webkit-transform"] = style["-moz-transform"] = style["-o-transform"] = style["-ms-transform"] = this._transform.toString(); - - style.transformStyle = style["-webkit-transform-style"] = style["-moz-transform-style"] = style["-o-transform-style"] = style["-ms-transform-style"] = "preserve-3d"; - - //check if child requires adding to the view - if (!this._context.contains(item.htmlElement)) - this._context.appendChild(item.htmlElement); - - item = item.next; - } - // var numPasses:number; - // var j:number; - // var camera:away.entities.Camera = entityCollector.camera; - // var item2:away.render.CSSRenderableBase; - // - // while (item) { - // this._activeMaterial = item.material; - // - // this._activeMaterial.iUpdateMaterial(this._pContext); - // - // numPasses = this._activeMaterial._iNumPasses; - // - // j = 0; - // - // do { - // item2 = item; - // - // var rttMask:number = this._activeMaterial.iPassRendersToTexture(j)? 1 : 2; - // - // if ((rttMask & which) != 0) { - // this._activeMaterial.iActivatePass(j, this._pStageGL, camera); - // - // do { - // this._activeMaterial.iRenderPass(j, item2, this._pStageGL, entityCollector); - // - // item2 = item2.next; - // - // } while (item2 && item2.material == this._activeMaterial); - // - // this._activeMaterial.iDeactivatePass(j, this._pStageGL); - // - // } else { - // do { - // item2 = item2.next; - // - // } while (item2 && item2.renderable.material == this._activeMaterial); - // } - // } while (++j < numPasses); - // - // item = item2; - // } - }; - - CSSDefaultRenderer.prototype.dispose = function () { - _super.prototype.dispose.call(this); - //TODO - }; - - CSSDefaultRenderer.prototype._iCreateEntityCollector = function () { - return new away.traverse.CSSEntityCollector(); - }; - return CSSDefaultRenderer; - })(render.CSSRendererBase); - render.CSSDefaultRenderer = CSSDefaultRenderer; - })(away.render || (away.render = {})); - var render = away.render; -})(away || (away = {})); -/// -/// -var away; -(function (away) { - /** - * @module away.sort - */ - (function (sort) { - /** - * @class away.sort.RenderableMergeSort - */ - var RenderableMergeSort = (function () { - function RenderableMergeSort() { - } - RenderableMergeSort.prototype.sortBlendedRenderables = function (head) { - var headB; - var fast; - var slow; - - if (!head || !head.next) { - return head; - } - - // split in two sublists - slow = head; - fast = head.next; - - while (fast) { - fast = fast.next; - if (fast) { - slow = slow.next; - fast = fast.next; - } - } - - headB = slow.next; - slow.next = null; - - // recurse - head = this.sortBlendedRenderables(head); - headB = this.sortBlendedRenderables(headB); - - // merge sublists while respecting order - var result; - var curr; - var l; - - if (!head) - return headB; - if (!headB) - return head; - - while (head && headB) { - if (head.zIndex < headB.zIndex) { - l = head; - head = head.next; - } else { - l = headB; - headB = headB.next; - } - - if (!result) - result = l; - else - curr.next = l; - - curr = l; - } - - if (head) - curr.next = head; - else if (headB) - curr.next = headB; - - return result; - }; - - RenderableMergeSort.prototype.sortOpaqueRenderables = function (head) { - var headB; - var fast, slow; - - if (!head || !head.next) { - return head; - } - - // split in two sublists - slow = head; - fast = head.next; - - while (fast) { - fast = fast.next; - if (fast) { - slow = slow.next; - fast = fast.next; - } - } - - headB = slow.next; - slow.next = null; - - // recurse - head = this.sortOpaqueRenderables(head); - headB = this.sortOpaqueRenderables(headB); - - // merge sublists while respecting order - var result; - var curr; - var l; - var cmp = 0; - - if (!head) - return headB; - if (!headB) - return head; - - while (head && headB && head != null && headB != null) { - // first sort per render order id (reduces program3D switches), - // then on material id (reduces setting props), - // then on zIndex (reduces overdraw) - var aid = head.renderOrderId; - var bid = headB.renderOrderId; - - if (aid == bid) { - var ma = head.materialId; - var mb = headB.materialId; - - if (ma == mb) { - if (head.zIndex < headB.zIndex) - cmp = 1; - else - cmp = -1; - } else if (ma > mb) { - cmp = 1; - } else { - cmp = -1; - } - } else if (aid > bid) { - cmp = 1; - } else { - cmp = -1; - } - - if (cmp < 0) { - l = head; - head = head.next; - } else { - l = headB; - headB = headB.next; - } - - if (!result) { - result = l; - curr = l; - } else { - curr.next = l; - curr = l; - } - } - - if (head) - curr.next = head; - else if (headB) - curr.next = headB; - - return result; - }; - return RenderableMergeSort; - })(); - sort.RenderableMergeSort = RenderableMergeSort; - })(away.sort || (away.sort = {})); - var sort = away.sort; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The AntiAliasType class provides values for anti-aliasing in the - * away.text.TextField class. - */ - (function (text) { - var AntiAliasType = (function () { - function AntiAliasType() { - } - AntiAliasType.ADVANCED = "advanced"; - - AntiAliasType.NORMAL = "normal"; - return AntiAliasType; - })(); - text.AntiAliasType = AntiAliasType; - })(away.text || (away.text = {})); - var text = away.text; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The GridFitType class defines values for grid fitting in the TextField class. - */ - (function (text) { - var GridFitType = (function () { - function GridFitType() { - } - GridFitType.NONE = "none"; - - GridFitType.PIXEL = "pixel"; - - GridFitType.SUBPIXEL = "subpixel"; - return GridFitType; - })(); - text.GridFitType = GridFitType; - })(away.text || (away.text = {})); - var text = away.text; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The TextFieldAutoSize class is an enumeration of constant values used in - * setting the autoSize property of the TextField class. - */ - (function (text) { - var TextFieldAutoSize = (function () { - function TextFieldAutoSize() { - } - TextFieldAutoSize.CENTER = "center"; - - TextFieldAutoSize.LEFT = "left"; - - TextFieldAutoSize.NONE = "none"; - - TextFieldAutoSize.RIGHT = "right"; - return TextFieldAutoSize; - })(); - text.TextFieldAutoSize = TextFieldAutoSize; - })(away.text || (away.text = {})); - var text = away.text; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The TextFieldType class is an enumeration of constant values used in setting the - * type property of the TextField class. - * - * @see away.entities.TextField#type - */ - (function (text) { - var TextFieldType = (function () { - function TextFieldType() { - } - TextFieldType.DYNAMIC = "dynamic"; - - TextFieldType.INPUT = "input"; - return TextFieldType; - })(); - text.TextFieldType = TextFieldType; - })(away.text || (away.text = {})); - var text = away.text; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The TextFormat class represents character formatting information. Use the - * TextFormat class to create specific text formatting for text fields. You - * can apply text formatting to both static and dynamic text fields. The - * properties of the TextFormat class apply to device and embedded fonts. - * However, for embedded fonts, bold and italic text actually require specific - * fonts. If you want to display bold or italic text with an embedded font, - * you need to embed the bold and italic variations of that font. - * - *

You must use the constructor new TextFormat() to create a - * TextFormat object before setting its properties. When you apply a - * TextFormat object to a text field using the - * TextField.defaultTextFormat property or the - * TextField.setTextFormat() method, only its defined properties - * are applied. Use the TextField.defaultTextFormat property to - * apply formatting BEFORE you add text to the TextField, and the - * setTextFormat() method to add formatting AFTER you add text to - * the TextField. The TextFormat properties are null - * by default because if you don't provide values for the properties, Flash - * Player uses its own default formatting. The default formatting that Flash - * Player uses for each property(if property's value is null) is - * as follows:

- * - *

The default formatting for each property is also described in each - * property description.

- */ - (function (text) { - var TextFormat = (function () { - /** - * Creates a TextFormat object with the specified properties. You can then - * change the properties of the TextFormat object to change the formatting of - * text fields. - * - *

Any parameter may be set to null to indicate that it is - * not defined. All of the parameters are optional; any omitted parameters - * are treated as null.

- * - * @param font The name of a font for text as a string. - * @param size An integer that indicates the size in pixels. - * @param color The color of text using this text format. A number - * containing three 8-bit RGB components; for example, - * 0xFF0000 is red, and 0x00FF00 is green. - * @param bold A Boolean value that indicates whether the text is - * boldface. - * @param italic A Boolean value that indicates whether the text is - * italicized. - * @param underline A Boolean value that indicates whether the text is - * underlined. - * @param url The URL to which the text in this text format - * hyperlinks. If url is an empty string, the - * text does not have a hyperlink. - * @param target The target window where the hyperlink is displayed. If - * the target window is an empty string, the text is - * displayed in the default target window - * _self. If the url parameter - * is set to an empty string or to the value - * null, you can get or set this property, - * but the property will have no effect. - * @param align The alignment of the paragraph, as a TextFormatAlign - * value. - * @param leftMargin Indicates the left margin of the paragraph, in pixels. - * @param rightMargin Indicates the right margin of the paragraph, in pixels. - * @param indent An integer that indicates the indentation from the left - * margin to the first character in the paragraph. - * @param leading A number that indicates the amount of leading vertical - * space between lines. - */ - function TextFormat(font, size, color, bold, italic, underline, url, target, align, leftMargin, rightMargin, indent, leading) { - if (typeof font === "undefined") { font = "Times New Roman"; } - if (typeof size === "undefined") { size = 12; } - if (typeof color === "undefined") { color = 0x000000; } - if (typeof bold === "undefined") { bold = false; } - if (typeof italic === "undefined") { italic = false; } - if (typeof underline === "undefined") { underline = false; } - if (typeof url === "undefined") { url = ""; } - if (typeof target === "undefined") { target = ""; } - if (typeof align === "undefined") { align = "left"; } - if (typeof leftMargin === "undefined") { leftMargin = 0; } - if (typeof rightMargin === "undefined") { rightMargin = 0; } - if (typeof indent === "undefined") { indent = 0; } - if (typeof leading === "undefined") { leading = 0; } - /** - * Specifies custom tab stops as an array of non-negative integers. Each tab - * stop is specified in pixels. If custom tab stops are not specified - * (null), the default tab stop is 4(average character width). - */ - this.tabStops = new Array(); - this.font = font; - this.size = size; - this.bold = bold; - this.italic = italic; - this.underline = underline; - this.url = url; - this.target = target; - this.align = align; - this.leftMargin = leftMargin; - this.rightMargin = rightMargin; - this.indent = indent; - this.leading = leading; - } - return TextFormat; - })(); - text.TextFormat = TextFormat; - })(away.text || (away.text = {})); - var text = away.text; -})(away || (away = {})); -var away; -(function (away) { - /// - /** - * The TextFormatAlign class provides values for text alignment in the - * TextFormat class. - */ - (function (text) { - var TextFormatAlign = (function () { - function TextFormatAlign() { - /** - * Constant; centers the text in the text field. Use the syntax - * TextFormatAlign.CENTER. - */ - this.CENTER = "center"; - /** - * Constant; justifies text within the text field. Use the syntax - * TextFormatAlign.JUSTIFY. - */ - this.JUSTIFY = "justify"; - /** - * Constant; aligns text to the left within the text field. Use the syntax - * TextFormatAlign.LEFT. - */ - this.LEFT = "left"; - /** - * Constant; aligns text to the right within the text field. Use the syntax - * TextFormatAlign.RIGHT. - */ - this.RIGHT = "right"; - } - return TextFormatAlign; - })(); - text.TextFormatAlign = TextFormatAlign; - })(away.text || (away.text = {})); - var text = away.text; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * A class that defines the Interactive mode of a text field object. - * - * @see away.entities.TextField#textInteractionMode - */ - (function (text) { - var TextInteractionMode = (function () { - function TextInteractionMode() { - } - TextInteractionMode.NORMAL = "normal"; - - TextInteractionMode.SELECTION = "selection"; - return TextInteractionMode; - })(); - text.TextInteractionMode = TextInteractionMode; - })(away.text || (away.text = {})); - var text = away.text; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The TextLineMetrics class contains information about the text position and - * measurements of a line of text within a text field. All measurements are in - * pixels. Objects of this class are returned by the - * away.entities.TextField.getLineMetrics() method. - */ - (function (text) { - var TextLineMetrics = (function () { - /** - * Creates a TextLineMetrics object. The TextLineMetrics object contains - * information about the text metrics of a line of text in a text field. - * Objects of this class are returned by the - * away.entities.TextField.getLineMetrics() method. - * - * @param x The left position of the first character in pixels. - * @param width The width of the text of the selected lines (not - * necessarily the complete text) in pixels. - * @param height The height of the text of the selected lines (not - * necessarily the complete text) in pixels. - * @param ascent The length from the baseline to the top of the line - * height in pixels. - * @param descent The length from the baseline to the bottom depth of - * the line in pixels. - * @param leading The measurement of the vertical distance between the - * lines of text. - */ - function TextLineMetrics(x, width, height, ascent, descent, leading) { - if (typeof x === "undefined") { x = NaN; } - if (typeof width === "undefined") { width = NaN; } - if (typeof height === "undefined") { height = NaN; } - if (typeof ascent === "undefined") { ascent = NaN; } - if (typeof descent === "undefined") { descent = NaN; } - if (typeof leading === "undefined") { leading = NaN; } - } - return TextLineMetrics; - })(); - text.TextLineMetrics = TextLineMetrics; - })(away.text || (away.text = {})); - var text = away.text; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (ui) { - var Keyboard = (function () { - function Keyboard() { - } - Keyboard.A = 65; - - Keyboard.ALTERNATE = 18; - - Keyboard.AUDIO = 0x01000017; - - Keyboard.B = 66; - - Keyboard.BACK = 0x01000016; - - Keyboard.BACKQUOTE = 192; - - Keyboard.BACKSLASH = 220; - - Keyboard.BACKSPACE = 8; - - Keyboard.BLUE = 0x01000003; - - Keyboard.C = 67; - - Keyboard.CAPS_LOCK = 20; - - Keyboard.CHANNEL_DOWN = 0x01000005; - - Keyboard.CHANNEL_UP = 0x01000005; - - Keyboard.COMMA = 188; - - Keyboard.COMMAND = 15; - - Keyboard.CONTROL = 17; - - Keyboard.D = 68; - - Keyboard.DELETE = 46; - - Keyboard.DOWN = 40; - - Keyboard.DVR = 0x01000019; - - Keyboard.E = 69; - - Keyboard.END = 35; - - Keyboard.ENTER = 13; - - Keyboard.EQUAL = 187; - - Keyboard.ESCAPE = 27; - - Keyboard.EXIT = 0x01000015; - - Keyboard.F = 70; - - Keyboard.F1 = 112; - - Keyboard.F10 = 121; - - Keyboard.F11 = 122; - - Keyboard.F12 = 123; - - Keyboard.F13 = 124; - - Keyboard.F14 = 125; - - Keyboard.F15 = 126; - - Keyboard.F2 = 113; - - Keyboard.F3 = 114; - - Keyboard.F4 = 115; - - Keyboard.F5 = 116; - - Keyboard.F6 = 117; - - Keyboard.F7 = 118; - - Keyboard.F8 = 119; - - Keyboard.F9 = 120; - - Keyboard.FAST_FORWARD = 0x0100000A; - - Keyboard.G = 71; - - Keyboard.GREEN = 0x01000001; - - Keyboard.GUIDE = 0x01000014; - - Keyboard.H = 72; - - Keyboard.HELP = 0x0100001D; - - Keyboard.HOME = 36; - - Keyboard.I = 73; - - Keyboard.INFO = 0x01000013; - - Keyboard.INPUT = 0x0100001B; - - Keyboard.INSERT = 45; - - Keyboard.J = 74; - - Keyboard.K = 75; - - Keyboard.KEYNAME_BEGIN = "Begin"; - - Keyboard.KEYNAME_BREAK = "Break"; - - Keyboard.KEYNAME_CLEARDISPLAY = "ClrDsp"; - - Keyboard.KEYNAME_CLEARLINE = "ClrLn"; - - Keyboard.KEYNAME_DELETE = "Delete"; - - Keyboard.KEYNAME_DELETECHAR = "DelChr"; - - Keyboard.KEYNAME_DELETELINE = "DelLn"; - - Keyboard.KEYNAME_DOWNARROW = "Down"; - - Keyboard.KEYNAME_END = "End"; - - Keyboard.KEYNAME_EXECUTE = "Exec"; - - Keyboard.KEYNAME_F1 = "F1"; - - Keyboard.KEYNAME_F10 = "F10"; - - Keyboard.KEYNAME_F11 = "F11"; - - Keyboard.KEYNAME_F12 = "F12"; - - Keyboard.KEYNAME_F13 = "F13"; - - Keyboard.KEYNAME_F14 = "F14"; - - Keyboard.KEYNAME_F15 = "F15"; - - Keyboard.KEYNAME_F16 = "F16"; - - Keyboard.KEYNAME_F17 = "F17"; - - Keyboard.KEYNAME_F18 = "F18"; - - Keyboard.KEYNAME_F19 = "F19"; - - Keyboard.KEYNAME_F2 = "F2"; - - Keyboard.KEYNAME_F20 = "F20"; - - Keyboard.KEYNAME_F21 = "F21"; - - Keyboard.KEYNAME_F22 = "F22"; - - Keyboard.KEYNAME_F23 = "F23"; - - Keyboard.KEYNAME_F24 = "F24"; - - Keyboard.KEYNAME_F25 = "F25"; - - Keyboard.KEYNAME_F26 = "F26"; - - Keyboard.KEYNAME_F27 = "F27"; - - Keyboard.KEYNAME_F28 = "F28"; - - Keyboard.KEYNAME_F29 = "F29"; - - Keyboard.KEYNAME_F3 = "F3"; - - Keyboard.KEYNAME_F30 = "F30"; - - Keyboard.KEYNAME_F31 = "F31"; - - Keyboard.KEYNAME_F32 = "F32"; - - Keyboard.KEYNAME_F33 = "F33"; - - Keyboard.KEYNAME_F34 = "F34"; - - Keyboard.KEYNAME_F35 = "F35"; - - Keyboard.KEYNAME_F4 = "F4"; - - Keyboard.KEYNAME_F5 = "F5"; - - Keyboard.KEYNAME_F6 = "F6"; - - Keyboard.KEYNAME_F7 = "F7"; - - Keyboard.KEYNAME_F8 = "F8"; - - Keyboard.KEYNAME_F9 = "F9"; - - Keyboard.KEYNAME_FIND = "Find"; - - Keyboard.KEYNAME_HELP = "Help"; - - Keyboard.KEYNAME_HOME = "Home"; - - Keyboard.KEYNAME_INSERT = "Insert"; - - Keyboard.KEYNAME_INSERTCHAR = "InsChr"; - - Keyboard.KEYNAME_INSERTLINE = "LnsLn"; - - Keyboard.KEYNAME_LEFTARROW = "Left"; - - Keyboard.KEYNAME_MENU = "Menu"; - - Keyboard.KEYNAME_MODESWITCH = "ModeSw"; - - Keyboard.KEYNAME_NEXT = "Next"; - - Keyboard.KEYNAME_PAGEDOWN = "PgDn"; - - Keyboard.KEYNAME_PAGEUP = "PgUp"; - - Keyboard.KEYNAME_PAUSE = "Pause"; - - Keyboard.KEYNAME_PREV = "Prev"; - - Keyboard.KEYNAME_PRINT = "Print"; - - Keyboard.KEYNAME_PRINTSCREEN = "PrntScrn"; - - Keyboard.KEYNAME_REDO = "Redo"; - - Keyboard.KEYNAME_RESET = "Reset"; - - Keyboard.KEYNAME_RIGHTARROW = "Right"; - - Keyboard.KEYNAME_SCROLLLOCK = "ScrlLck"; - - Keyboard.KEYNAME_SELECT = "Select"; - - Keyboard.KEYNAME_STOP = "Stop"; - - Keyboard.KEYNAME_SYSREQ = "SysReq"; - - Keyboard.KEYNAME_SYSTEM = "Sys"; - - Keyboard.KEYNAME_UNDO = "Undo"; - - Keyboard.KEYNAME_UPARROW = "Up"; - - Keyboard.KEYNAME_USER = "User"; - - Keyboard.L = 76; - - Keyboard.LAST = 0x01000011; - - Keyboard.LEFT = 37; - - Keyboard.LEFTBRACKET = 219; - - Keyboard.LIVE = 0x01000010; - - Keyboard.M = 77; - - Keyboard.MASTER_SHELL = 0x0100001E; - - Keyboard.MENU = 0x01000012; - - Keyboard.MINUS = 189; - - Keyboard.N = 78; - - Keyboard.NEXT = 0x0100000E; - - Keyboard.NUMBER_0 = 48; - - Keyboard.NUMBER_1 = 49; - - Keyboard.NUMBER_2 = 50; - - Keyboard.NUMBER_3 = 51; - - Keyboard.NUMBER_4 = 52; - - Keyboard.NUMBER_5 = 53; - - Keyboard.NUMBER_6 = 54; - - Keyboard.NUMBER_7 = 55; - - Keyboard.NUMBER_8 = 56; - - Keyboard.NUMBER_9 = 57; - - Keyboard.NUMPAD = 21; - - Keyboard.NUMPAD_0 = 96; - - Keyboard.NUMPAD_1 = 97; - - Keyboard.NUMPAD_2 = 98; - - Keyboard.NUMPAD_3 = 99; - - Keyboard.NUMPAD_4 = 100; - - Keyboard.NUMPAD_5 = 101; - - Keyboard.NUMPAD_6 = 102; - - Keyboard.NUMPAD_7 = 103; - - Keyboard.NUMPAD_8 = 104; - - Keyboard.NUMPAD_9 = 105; - - Keyboard.NUMPAD_ADD = 107; - - Keyboard.NUMPAD_DECIMAL = 110; - - Keyboard.NUMPAD_DIVIDE = 111; - - Keyboard.NUMPAD_ENTER = 108; - - Keyboard.NUMPAD_MULTIPLY = 106; - - Keyboard.NUMPAD_SUBTRACT = 109; - - Keyboard.O = 79; - - Keyboard.P = 80; - - Keyboard.PAGE_DOWN = 34; - - Keyboard.PAGE_UP = 33; - - Keyboard.PAUSE = 0x01000008; - - Keyboard.PERIOD = 190; - - Keyboard.PLAY = 0x01000007; - - Keyboard.PREVIOUS = 0x0100000F; - - Keyboard.Q = 81; - - Keyboard.QUOTE = 222; - - Keyboard.R = 82; - - Keyboard.RECORD = 0x01000006; - - Keyboard.RED = 0x01000000; - - Keyboard.REWIND = 0x0100000B; - - Keyboard.RIGHT = 39; - - Keyboard.RIGHTBRACKET = 221; - - Keyboard.S = 83; - - Keyboard.SEARCH = 0x0100001F; - - Keyboard.SEMICOLON = 186; - - Keyboard.SETUP = 0x0100001C; - - Keyboard.SHIFT = 16; - - Keyboard.SKIP_BACKWARD = 0x0100000D; - - Keyboard.SKIP_FORWARD = 0x0100000C; - - Keyboard.SLASH = 191; - - Keyboard.SPACE = 32; - - Keyboard.STOP = 0x01000009; - - Keyboard.SUBTITLE = 0x01000018; - - Keyboard.T = 84; - - Keyboard.TAB = 9; - - Keyboard.U = 85; - - Keyboard.UP = 38; - - Keyboard.V = 86; - - Keyboard.VOD = 0x0100001A; - - Keyboard.W = 87; - - Keyboard.X = 88; - - Keyboard.Y = 89; - - Keyboard.YELLOW = 0x01000002; - - Keyboard.Z = 90; - return Keyboard; - })(); - ui.Keyboard = Keyboard; - })(away.ui || (away.ui = {})); - var ui = away.ui; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The DisplayObjectContainer class is the base class for all objects that can - * serve as display object containers on the display list. The display list - * manages all objects displayed in the Flash runtimes. Use the - * DisplayObjectContainer class to arrange the display objects in the display - * list. Each DisplayObjectContainer object has its own child list for - * organizing the z-order of the objects. The z-order is the front-to-back - * order that determines which object is drawn in front, which is behind, and - * so on. - * - *

DisplayObject is an abstract base class; therefore, you cannot call - * DisplayObject directly. Invoking new DisplayObject() throws an - * ArgumentError exception.

- * The DisplayObjectContainer class is an abstract base class for all objects - * that can contain child objects. It cannot be instantiated directly; calling - * the new DisplayObjectContainer() constructor throws an - * ArgumentError exception. - * - *

For more information, see the "Display Programming" chapter of the - * ActionScript 3.0 Developer's Guide.

- */ - (function (containers) { - var ArgumentError = away.errors.ArgumentError; - var Error = away.errors.Error; - var RangeError = away.errors.RangeError; - - var AssetType = away.library.AssetType; - - var DisplayObjectContainer = (function (_super) { - __extends(DisplayObjectContainer, _super); - /** - * Calling the new DisplayObjectContainer() constructor throws - * an ArgumentError exception. You can, however, call - * constructors for the following subclasses of DisplayObjectContainer: - *
    - *
  • new Loader()
  • - *
  • new Sprite()
  • - *
  • new MovieClip()
  • - *
- */ - function DisplayObjectContainer() { - _super.call(this); - this._mouseChildren = true; - this._children = new Array(); - } - Object.defineProperty(DisplayObjectContainer.prototype, "assetType", { - /** - * - */ - get: function () { - return AssetType.CONTAINER; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(DisplayObjectContainer.prototype, "mouseChildren", { - /** - * Determines whether or not the children of the object are mouse, or user - * input device, enabled. If an object is enabled, a user can interact with - * it by using a mouse or user input device. The default is - * true. - * - *

This property is useful when you create a button with an instance of - * the Sprite class(instead of using the SimpleButton class). When you use a - * Sprite instance to create a button, you can choose to decorate the button - * by using the addChild() method to add additional Sprite - * instances. This process can cause unexpected behavior with mouse events - * because the Sprite instances you add as children can become the target - * object of a mouse event when you expect the parent instance to be the - * target object. To ensure that the parent instance serves as the target - * objects for mouse events, you can set the mouseChildren - * property of the parent instance to false.

- * - *

No event is dispatched by setting this property. You must use the - * addEventListener() method to create interactive - * functionality.

- */ - get: function () { - return this._mouseChildren; - }, - set: function (value) { - if (this._mouseChildren == value) - return; - - this._mouseChildren = value; - - this._pUpdateImplicitMouseEnabled(this._pParent ? this._pParent.mouseChildren : true); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DisplayObjectContainer.prototype, "numChildren", { - /** - * Returns the number of children of this object. - */ - get: function () { - return this._children.length; - }, - enumerable: true, - configurable: true - }); - - /** - * Adds a child DisplayObject instance to this DisplayObjectContainer - * instance. The child is added to the front(top) of all other children in - * this DisplayObjectContainer instance.(To add a child to a specific index - * position, use the addChildAt() method.) - * - *

If you add a child object that already has a different display object - * container as a parent, the object is removed from the child list of the - * other display object container.

- * - *

Note: The command stage.addChild() can cause - * problems with a published SWF file, including security problems and - * conflicts with other loaded SWF files. There is only one Stage within a - * Flash runtime instance, no matter how many SWF files you load into the - * runtime. So, generally, objects should not be added to the Stage, - * directly, at all. The only object the Stage should contain is the root - * object. Create a DisplayObjectContainer to contain all of the items on the - * display list. Then, if necessary, add that DisplayObjectContainer instance - * to the Stage.

- * - * @param child The DisplayObject instance to add as a child of this - * DisplayObjectContainer instance. - * @return The DisplayObject instance that you pass in the child - * parameter. - * @throws ArgumentError Throws if the child is the same as the parent. Also - * throws if the caller is a child(or grandchild etc.) - * of the child being added. - * @event added Dispatched when a display object is added to the display - * list. - */ - DisplayObjectContainer.prototype.addChild = function (child) { - if (child == null) - throw new Error("Parameter child cannot be null."); - - //if child already has a parent, remove it. - if (child._pParent) - child._pParent.removeChildInternal(child); - - child.iSetParent(this); - - this._children.push(child); - - return child; - }; - - /** - * Adds a child DisplayObject instance to this DisplayObjectContainer - * instance. The child is added at the index position specified. An index of - * 0 represents the back(bottom) of the display list for this - * DisplayObjectContainer object. - * - *

For example, the following example shows three display objects, labeled - * a, b, and c, at index positions 0, 2, and 1, respectively:

- * - *

If you add a child object that already has a different display object - * container as a parent, the object is removed from the child list of the - * other display object container.

- * - * @param child The DisplayObject instance to add as a child of this - * DisplayObjectContainer instance. - * @param index The index position to which the child is added. If you - * specify a currently occupied index position, the child object - * that exists at that position and all higher positions are - * moved up one position in the child list. - * @return The DisplayObject instance that you pass in the child - * parameter. - * @throws ArgumentError Throws if the child is the same as the parent. Also - * throws if the caller is a child(or grandchild etc.) - * of the child being added. - * @throws RangeError Throws if the index position does not exist in the - * child list. - * @event added Dispatched when a display object is added to the display - * list. - */ - DisplayObjectContainer.prototype.addChildAt = function (child, index /*int*/ ) { - return child; - }; - - DisplayObjectContainer.prototype.addChildren = function () { - var childarray = []; - for (var _i = 0; _i < (arguments.length - 0); _i++) { - childarray[_i] = arguments[_i + 0]; - } - var len = childarray.length; - for (var i = 0; i < len; i++) - this.addChild(childarray[i]); - }; - - /** - * - */ - DisplayObjectContainer.prototype.clone = function () { - var clone = new DisplayObjectContainer(); - clone.pivot = this.pivot; - clone._iMatrix3D = this._iMatrix3D; - clone.partition = this.partition; - clone.name = name; - - var len = this._children.length; - for (var i = 0; i < len; ++i) - clone.addChild(this._children[i].clone()); - - // todo: implement for all subtypes - return clone; - }; - - /** - * Determines whether the specified display object is a child of the - * DisplayObjectContainer instance or the instance itself. The search - * includes the entire display list including this DisplayObjectContainer - * instance. Grandchildren, great-grandchildren, and so on each return - * true. - * - * @param child The child object to test. - * @return true if the child object is a child of - * the DisplayObjectContainer or the container itself; otherwise - * false. - */ - DisplayObjectContainer.prototype.contains = function (child) { - return this._children.indexOf(child) >= 0; - }; - - /** - * - */ - DisplayObjectContainer.prototype.disposeWithChildren = function () { - this.dispose(); - - while (this.numChildren > 0) - this.getChildAt(0).dispose(); - }; - - /** - * Returns the child display object instance that exists at the specified - * index. - * - * @param index The index position of the child object. - * @return The child display object at the specified index position. - * @throws RangeError Throws if the index does not exist in the child - * list. - */ - DisplayObjectContainer.prototype.getChildAt = function (index /*int*/ ) { - var child = this._children[index]; - - if (child == null) - throw new RangeError("Index does not exist in the child list of the caller"); - - return child; - }; - - /** - * Returns the child display object that exists with the specified name. If - * more that one child display object has the specified name, the method - * returns the first object in the child list. - * - *

The getChildAt() method is faster than the - * getChildByName() method. The getChildAt() method - * accesses a child from a cached array, whereas the - * getChildByName() method has to traverse a linked list to - * access a child.

- * - * @param name The name of the child to return. - * @return The child display object with the specified name. - */ - DisplayObjectContainer.prototype.getChildByName = function (name) { - var len = this._children.length; - for (var i = 0; i < len; ++i) - if (this._children[i].name == name) - return this._children[i]; - - return null; - }; - - /** - * Returns the index position of a child DisplayObject instance. - * - * @param child The DisplayObject instance to identify. - * @return The index position of the child display object to identify. - * @throws ArgumentError Throws if the child parameter is not a child of this - * object. - */ - DisplayObjectContainer.prototype.getChildIndex = function (child) { - var childIndex = this._children.indexOf(child); - - if (childIndex == -1) - throw new ArgumentError("Child parameter is not a child of the caller"); - - return childIndex; - }; - - /** - * Returns an array of objects that lie under the specified point and are - * children(or grandchildren, and so on) of this DisplayObjectContainer - * instance. Any child objects that are inaccessible for security reasons are - * omitted from the returned array. To determine whether this security - * restriction affects the returned array, call the - * areInaccessibleObjectsUnderPoint() method. - * - *

The point parameter is in the coordinate space of the - * Stage, which may differ from the coordinate space of the display object - * container(unless the display object container is the Stage). You can use - * the globalToLocal() and the localToGlobal() - * methods to convert points between these coordinate spaces.

- * - * @param point The point under which to look. - * @return An array of objects that lie under the specified point and are - * children(or grandchildren, and so on) of this - * DisplayObjectContainer instance. - */ - DisplayObjectContainer.prototype.getObjectsUnderPoint = function (point) { - return new Array(); - }; - - /** - * Removes the specified child DisplayObject instance from the - * child list of the DisplayObjectContainer instance. The parent - * property of the removed child is set to null , and the object - * is garbage collected if no other references to the child exist. The index - * positions of any display objects above the child in the - * DisplayObjectContainer are decreased by 1. - * - *

The garbage collector reallocates unused memory space. When a variable - * or object is no longer actively referenced or stored somewhere, the - * garbage collector sweeps through and wipes out the memory space it used to - * occupy if no other references to it exist.

- * - * @param child The DisplayObject instance to remove. - * @return The DisplayObject instance that you pass in the child - * parameter. - * @throws ArgumentError Throws if the child parameter is not a child of this - * object. - */ - DisplayObjectContainer.prototype.removeChild = function (child) { - if (child == null) - throw new Error("Parameter child cannot be null"); - - this.removeChildInternal(child); - - child.iSetParent(null); - - return child; - }; - - /** - * Removes a child DisplayObject from the specified index - * position in the child list of the DisplayObjectContainer. The - * parent property of the removed child is set to - * null, and the object is garbage collected if no other - * references to the child exist. The index positions of any display objects - * above the child in the DisplayObjectContainer are decreased by 1. - * - *

The garbage collector reallocates unused memory space. When a variable - * or object is no longer actively referenced or stored somewhere, the - * garbage collector sweeps through and wipes out the memory space it used to - * occupy if no other references to it exist.

- * - * @param index The child index of the DisplayObject to remove. - * @return The DisplayObject instance that was removed. - * @throws RangeError Throws if the index does not exist in the child - * list. - * @throws SecurityError This child display object belongs to a sandbox to - * which the calling object does not have access. You - * can avoid this situation by having the child movie - * call the Security.allowDomain() method. - */ - DisplayObjectContainer.prototype.removeChildAt = function (index /*int*/ ) { - return this.removeChild(this._children[index]); - }; - - /** - * Removes all child DisplayObject instances from the child list - * of the DisplayObjectContainer instance. The parent property - * of the removed children is set to null, and the objects are - * garbage collected if no other references to the children exist. - * - * The garbage collector reallocates unused memory space. When a variable or - * object is no longer actively referenced or stored somewhere, the garbage - * collector sweeps through and wipes out the memory space it used to occupy - * if no other references to it exist. - * - * @param beginIndex The beginning position. A value smaller than 0 throws a RangeError. - * @param endIndex The ending position. A value smaller than 0 throws a RangeError. - * @throws RangeError Throws if the beginIndex or endIndex positions do - * not exist in the child list. - */ - DisplayObjectContainer.prototype.removeChildren = function (beginIndex, endIndex) { - if (typeof beginIndex === "undefined") { beginIndex = 0; } - if (typeof endIndex === "undefined") { endIndex = 2147483647; } - if (beginIndex < 0) - throw new RangeError("beginIndex is out of range of the child list"); - - if (endIndex > this._children.length) - throw new RangeError("endIndex is out of range of the child list"); - - for (var i = beginIndex; i < endIndex; i++) - this.removeChild(this._children[i]); - }; - - /** - * Changes the position of an existing child in the display object container. - * This affects the layering of child objects. For example, the following - * example shows three display objects, labeled a, b, and c, at index - * positions 0, 1, and 2, respectively: - * - *

When you use the setChildIndex() method and specify an - * index position that is already occupied, the only positions that change - * are those in between the display object's former and new position. All - * others will stay the same. If a child is moved to an index LOWER than its - * current index, all children in between will INCREASE by 1 for their index - * reference. If a child is moved to an index HIGHER than its current index, - * all children in between will DECREASE by 1 for their index reference. For - * example, if the display object container in the previous example is named - * container, you can swap the position of the display objects - * labeled a and b by calling the following code:

- * - *

This code results in the following arrangement of objects:

- * - * @param child The child DisplayObject instance for which you want to change - * the index number. - * @param index The resulting index number for the child display - * object. - * @throws ArgumentError Throws if the child parameter is not a child of this - * object. - * @throws RangeError Throws if the index does not exist in the child - * list. - */ - DisplayObjectContainer.prototype.setChildIndex = function (child, index /*int*/ ) { - //TODO - }; - - /** - * Swaps the z-order (front-to-back order) of the two specified child - * objects. All other child objects in the display object container remain in - * the same index positions. - * - * @param child1 The first child object. - * @param child2 The second child object. - * @throws ArgumentError Throws if either child parameter is not a child of - * this object. - */ - DisplayObjectContainer.prototype.swapChildren = function (child1, child2) { - //TODO - }; - - /** - * Swaps the z-order(front-to-back order) of the child objects at the two - * specified index positions in the child list. All other child objects in - * the display object container remain in the same index positions. - * - * @param index1 The index position of the first child object. - * @param index2 The index position of the second child object. - * @throws RangeError If either index does not exist in the child list. - */ - DisplayObjectContainer.prototype.swapChildrenAt = function (index1 /*int*/ , index2 /*int*/ ) { - //TODO - }; - - /** - * @protected - */ - DisplayObjectContainer.prototype.pInvalidateSceneTransform = function () { - _super.prototype.pInvalidateSceneTransform.call(this); - - var len = this._children.length; - for (var i = 0; i < len; ++i) - this._children[i].pInvalidateSceneTransform(); - }; - - /** - * @protected - */ - DisplayObjectContainer.prototype._pUpdateScene = function (value) { - _super.prototype._pUpdateScene.call(this, value); - - var len = this._children.length; - for (var i = 0; i < len; ++i) - this._children[i]._pUpdateScene(value); - }; - - /** - * @protected - */ - DisplayObjectContainer.prototype._pUpdateImplicitMouseEnabled = function (value) { - _super.prototype._pUpdateImplicitMouseEnabled.call(this, value); - - var len = this._children.length; - for (var i = 0; i < len; ++i) - this._children[i]._pUpdateImplicitMouseEnabled(this._mouseChildren); - }; - - /** - * @protected - */ - DisplayObjectContainer.prototype._pUpdateImplicitVisibility = function (value) { - _super.prototype._pUpdateImplicitVisibility.call(this, value); - - var len = this._children.length; - for (var i = 0; i < len; ++i) - this._children[i]._pUpdateImplicitVisibility(this._pImplicitVisibility); - }; - - /** - * @protected - */ - DisplayObjectContainer.prototype._pUpdateImplicitPartition = function (value) { - _super.prototype._pUpdateImplicitPartition.call(this, value); - - var len = this._children.length; - for (var i = 0; i < len; ++i) - this._children[i]._pUpdateImplicitPartition(this._pImplicitPartition); - }; - - /** - * @private - * - * @param child - */ - DisplayObjectContainer.prototype.removeChildInternal = function (child) { - this._children.splice(this.getChildIndex(child), 1); - - return child; - }; - return DisplayObjectContainer; - })(away.base.DisplayObject); - containers.DisplayObjectContainer = DisplayObjectContainer; - })(away.containers || (away.containers = {})); - var containers = away.containers; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (base) { - var AbstractMethodError = away.errors.AbstractMethodError; - var LightEvent = away.events.LightEvent; - - var AssetType = away.library.AssetType; - - var LightBase = (function (_super) { - __extends(LightBase, _super); - function LightBase() { - _super.call(this); - this._color = 0xffffff; - this._colorR = 1; - this._colorG = 1; - this._colorB = 1; - this._ambientColor = 0xffffff; - this._ambient = 0; - this._iAmbientR = 0; - this._iAmbientG = 0; - this._iAmbientB = 0; - this._specular = 1; - this._iSpecularR = 1; - this._iSpecularG = 1; - this._iSpecularB = 1; - this._diffuse = 1; - this._iDiffuseR = 1; - this._iDiffuseG = 1; - this._iDiffuseB = 1; - this._castsShadows = false; - } - Object.defineProperty(LightBase.prototype, "castsShadows", { - get: function () { - return this._castsShadows; - }, - set: function (value) { - if (this._castsShadows == value) - return; - - this._castsShadows = value; - - if (value) { - if (this._shadowMapper == null) - this._shadowMapper = this.pCreateShadowMapper(); - - this._shadowMapper.light = this; - } else { - this._shadowMapper.dispose(); - this._shadowMapper = null; - } - - //*/ - this.dispatchEvent(new LightEvent(LightEvent.CASTS_SHADOW_CHANGE)); - }, - enumerable: true, - configurable: true - }); - - - LightBase.prototype.pCreateShadowMapper = function () { - throw new AbstractMethodError(); - }; - - Object.defineProperty(LightBase.prototype, "specular", { - get: function () { - return this._specular; - }, - set: function (value) { - if (value < 0) - value = 0; - - this._specular = value; - this.updateSpecular(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(LightBase.prototype, "diffuse", { - get: function () { - return this._diffuse; - }, - set: function (value) { - if (value < 0) - value = 0; - - this._diffuse = value; - this.updateDiffuse(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(LightBase.prototype, "color", { - get: function () { - return this._color; - }, - set: function (value) { - this._color = value; - this._colorR = ((this._color >> 16) & 0xff) / 0xff; - this._colorG = ((this._color >> 8) & 0xff) / 0xff; - this._colorB = (this._color & 0xff) / 0xff; - - this.updateDiffuse(); - this.updateSpecular(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(LightBase.prototype, "ambient", { - get: function () { - return this._ambient; - }, - set: function (value) { - if (value < 0) - value = 0; - else if (value > 1) - value = 1; - - this._ambient = value; - this.updateAmbient(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(LightBase.prototype, "ambientColor", { - get: function () { - return this._ambientColor; - }, - set: function (value) { - this._ambientColor = value; - this.updateAmbient(); - }, - enumerable: true, - configurable: true - }); - - - LightBase.prototype.updateAmbient = function () { - this._iAmbientR = ((this._ambientColor >> 16) & 0xff) / 0xff * this._ambient; - this._iAmbientG = ((this._ambientColor >> 8) & 0xff) / 0xff * this._ambient; - this._iAmbientB = (this._ambientColor & 0xff) / 0xff * this._ambient; - }; - - LightBase.prototype.iGetObjectProjectionMatrix = function (entity, camera, target) { - if (typeof target === "undefined") { target = null; } - throw new AbstractMethodError(); - }; - - Object.defineProperty(LightBase.prototype, "assetType", { - //@override - get: function () { - return AssetType.LIGHT; - }, - enumerable: true, - configurable: true - }); - - LightBase.prototype.updateSpecular = function () { - this._iSpecularR = this._colorR * this._specular; - this._iSpecularG = this._colorG * this._specular; - this._iSpecularB = this._colorB * this._specular; - }; - - LightBase.prototype.updateDiffuse = function () { - this._iDiffuseR = this._colorR * this._diffuse; - this._iDiffuseG = this._colorG * this._diffuse; - this._iDiffuseB = this._colorB * this._diffuse; - }; - - Object.defineProperty(LightBase.prototype, "shadowMapper", { - get: function () { - return this._shadowMapper; - }, - set: function (value) { - this._shadowMapper = value; - this._shadowMapper.light = this; - }, - enumerable: true, - configurable: true - }); - - return LightBase; - })(away.containers.DisplayObjectContainer); - base.LightBase = LightBase; - })(away.base || (away.base = {})); - var base = away.base; -})(away || (away = {})); -var away; -(function (away) { - (function (projections) { - /** - * Provides constant values for camera lens projection options use the the coordinateSystem property - * - * @see away.projections.PerspectiveLens#coordinateSystem - */ - var CoordinateSystem = (function () { - function CoordinateSystem() { - } - CoordinateSystem.LEFT_HANDED = "leftHanded"; - - CoordinateSystem.RIGHT_HANDED = "rightHanded"; - return CoordinateSystem; - })(); - projections.CoordinateSystem = CoordinateSystem; - })(away.projections || (away.projections = {})); - var projections = away.projections; -})(away || (away = {})); -/// -/// -var away; -(function (away) { - (function (projections) { - var ProjectionBase = (function (_super) { - __extends(ProjectionBase, _super); - function ProjectionBase(coordinateSystem) { - if (typeof coordinateSystem === "undefined") { coordinateSystem = "leftHanded"; } - _super.call(this); - this._pMatrix = new away.geom.Matrix3D(); - this._pScissorRect = new away.geom.Rectangle(); - this._pViewPort = new away.geom.Rectangle(); - this._pNear = 20; - this._pFar = 3000; - this._pAspectRatio = 1; - this._pMatrixInvalid = true; - this._pFrustumCorners = []; - this._pOriginX = 0.5; - this._pOriginY = 0.5; - this._unprojectionInvalid = true; - - this.coordinateSystem = coordinateSystem; - } - Object.defineProperty(ProjectionBase.prototype, "coordinateSystem", { - /** - * The handedness of the coordinate system projection. The default is LEFT_HANDED. - */ - get: function () { - return this._pCoordinateSystem; - }, - set: function (value) { - if (this._pCoordinateSystem == value) - return; - - this._pCoordinateSystem = value; - - this.pInvalidateMatrix(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ProjectionBase.prototype, "frustumCorners", { - get: function () { - return this._pFrustumCorners; - }, - set: function (frustumCorners) { - this._pFrustumCorners = frustumCorners; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ProjectionBase.prototype, "matrix", { - get: function () { - if (this._pMatrixInvalid) { - this.pUpdateMatrix(); - this._pMatrixInvalid = false; - } - return this._pMatrix; - }, - set: function (value) { - this._pMatrix = value; - this.pInvalidateMatrix(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ProjectionBase.prototype, "near", { - get: function () { - return this._pNear; - }, - set: function (value) { - if (value == this._pNear) { - return; - } - this._pNear = value; - this.pInvalidateMatrix(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ProjectionBase.prototype, "originX", { - get: function () { - return this._pOriginX; - }, - set: function (value) { - if (this._pOriginX == value) - return; - - this._pOriginX = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ProjectionBase.prototype, "originY", { - get: function () { - return this._pOriginY; - }, - set: function (value) { - if (this._pOriginY == value) - return; - - this._pOriginY = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ProjectionBase.prototype, "far", { - get: function () { - return this._pFar; - }, - set: function (value) { - if (value == this._pFar) { - return; - } - this._pFar = value; - this.pInvalidateMatrix(); - }, - enumerable: true, - configurable: true - }); - - - ProjectionBase.prototype.project = function (point3d) { - var v = this.matrix.transformVector(point3d); - v.x = v.x / v.w; - v.y = -v.y / v.w; - - //z is unaffected by transform - v.z = point3d.z; - - return v; - }; - - Object.defineProperty(ProjectionBase.prototype, "unprojectionMatrix", { - get: function () { - if (this._unprojectionInvalid) { - if (!this._unprojection) - this._unprojection = new away.geom.Matrix3D(); - - this._unprojection.copyFrom(this.matrix); - this._unprojection.invert(); - this._unprojectionInvalid = false; - } - return this._unprojection; - }, - enumerable: true, - configurable: true - }); - - ProjectionBase.prototype.unproject = function (nX, nY, sZ) { - throw new away.errors.AbstractMethodError(); - }; - - ProjectionBase.prototype.clone = function () { - throw new away.errors.AbstractMethodError(); - }; - - Object.defineProperty(ProjectionBase.prototype, "_iAspectRatio", { - get: function () { - return this._pAspectRatio; - }, - set: function (value) { - if (this._pAspectRatio == value) - return; - - this._pAspectRatio = value; - - this.pInvalidateMatrix(); - }, - enumerable: true, - configurable: true - }); - - - ProjectionBase.prototype.pInvalidateMatrix = function () { - this._pMatrixInvalid = true; - this._unprojectionInvalid = true; - this.dispatchEvent(new away.events.ProjectionEvent(away.events.ProjectionEvent.MATRIX_CHANGED, this)); - }; - - ProjectionBase.prototype.pUpdateMatrix = function () { - throw new away.errors.AbstractMethodError(); - }; - - ProjectionBase.prototype._iUpdateScissorRect = function (x, y, width, height) { - this._pScissorRect.x = x; - this._pScissorRect.y = y; - this._pScissorRect.width = width; - this._pScissorRect.height = height; - this.pInvalidateMatrix(); - }; - - ProjectionBase.prototype._iUpdateViewport = function (x, y, width, height) { - this._pViewPort.x = x; - this._pViewPort.y = y; - this._pViewPort.width = width; - this._pViewPort.height = height; - this.pInvalidateMatrix(); - }; - return ProjectionBase; - })(away.events.EventDispatcher); - projections.ProjectionBase = ProjectionBase; - })(away.projections || (away.projections = {})); - var projections = away.projections; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (projections) { - var PerspectiveProjection = (function (_super) { - __extends(PerspectiveProjection, _super); - function PerspectiveProjection(fieldOfView, coordinateSystem) { - if (typeof fieldOfView === "undefined") { fieldOfView = 60; } - if (typeof coordinateSystem === "undefined") { coordinateSystem = "leftHanded"; } - _super.call(this, coordinateSystem); - this._fieldOfView = 60; - this._focalLength = 1000; - this._hFieldOfView = 60; - this._hFocalLength = 1000; - this._preserveAspectRatio = true; - this._preserveFocalLength = false; - this.fieldOfView = fieldOfView; - } - Object.defineProperty(PerspectiveProjection.prototype, "preserveAspectRatio", { - /** - * - */ - get: function () { - return this._preserveAspectRatio; - }, - set: function (value) { - if (this._preserveAspectRatio == value) - return; - - this._preserveAspectRatio = value; - - if (this._preserveAspectRatio) - this.pInvalidateMatrix(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PerspectiveProjection.prototype, "preserveFocalLength", { - /** - * - */ - get: function () { - return this._preserveFocalLength; - }, - set: function (value) { - if (this._preserveFocalLength == value) - return; - - this._preserveFocalLength = value; - - this.pInvalidateMatrix(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PerspectiveProjection.prototype, "fieldOfView", { - /** - * - */ - get: function () { - return this._fieldOfView; - }, - set: function (value) { - if (this._fieldOfView == value) - return; - - this._fieldOfView = value; - - this.pInvalidateMatrix(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PerspectiveProjection.prototype, "focalLength", { - /** - * - */ - get: function () { - return this._focalLength; - }, - set: function (value) { - if (this._focalLength == value) - return; - - this._focalLength = value; - - this.pInvalidateMatrix(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PerspectiveProjection.prototype, "hFieldOfView", { - /** - * - */ - get: function () { - return this._hFieldOfView; - }, - set: function (value) { - if (this._hFieldOfView == value) - return; - - this._hFieldOfView = value; - - this._hFocalLength = 1 / Math.tan(this._hFieldOfView * Math.PI / 360); - - this.pInvalidateMatrix(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PerspectiveProjection.prototype, "hFocalLength", { - /** - * - */ - get: function () { - return this._hFocalLength; - }, - set: function (value) { - if (this._hFocalLength == value) - return; - - this._hFocalLength = value; - - this.pInvalidateMatrix(); - }, - enumerable: true, - configurable: true - }); - - - //@override - PerspectiveProjection.prototype.unproject = function (nX, nY, sZ) { - var v = new away.geom.Vector3D(nX, -nY, sZ, 1.0); - - v.x *= sZ; - v.y *= sZ; - - v = this.unprojectionMatrix.transformVector(v); - - //z is unaffected by transform - v.z = sZ; - - return v; - }; - - //@override - PerspectiveProjection.prototype.clone = function () { - var clone = new PerspectiveProjection(this._fieldOfView); - clone._pNear = this._pNear; - clone._pFar = this._pFar; - clone._pAspectRatio = this._pAspectRatio; - clone._pCoordinateSystem = this._pCoordinateSystem; - return clone; - }; - - //@override - PerspectiveProjection.prototype.pUpdateMatrix = function () { - var raw = []; - - if (this._preserveFocalLength) { - if (this._preserveAspectRatio) - this._hFocalLength = this._focalLength; - - this._fieldOfView = Math.atan(0.5 * this._pScissorRect.height / this._focalLength) * 360 / Math.PI; - this._hFieldOfView = Math.atan(0.5 * this._pScissorRect.width / this._hFocalLength) * 360 / Math.PI; - } else { - this._focalLength = 0.5 * this._pScissorRect.height / Math.tan(this._fieldOfView * Math.PI / 360); - - if (this._preserveAspectRatio) - this._hFocalLength = this._focalLength; - else - this._hFocalLength = 0.5 * this._pScissorRect.width / Math.tan(this._hFieldOfView * Math.PI / 360); - } - - var tanMinX = -this._pOriginX / this._hFocalLength; - var tanMaxX = (1 - this._pOriginX) / this._hFocalLength; - var tanMinY = -this._pOriginY / this._focalLength; - var tanMaxY = (1 - this._pOriginY) / this._focalLength; - - var left; - var right; - var top; - var bottom; - - // assume scissored frustum - var center = -((tanMinX - tanMaxX) * this._pScissorRect.x + tanMinX * this._pScissorRect.width); - var middle = ((tanMinY - tanMaxY) * this._pScissorRect.y + tanMinY * this._pScissorRect.height); - - left = center - (tanMaxX - tanMinX) * this._pViewPort.width; - right = center; - top = middle; - bottom = middle + (tanMaxY - tanMinY) * this._pViewPort.height; - - raw[0] = 2 / (right - left); - raw[5] = 2 / (bottom - top); - raw[8] = (right + left) / (right - left); - raw[9] = (bottom + top) / (bottom - top); - raw[10] = (this._pFar + this._pNear) / (this._pFar - this._pNear); - raw[11] = 1; - raw[1] = raw[2] = raw[3] = raw[4] = raw[6] = raw[7] = raw[12] = raw[13] = raw[15] = 0; - raw[14] = -2 * this._pFar * this._pNear / (this._pFar - this._pNear); - - if (this._pCoordinateSystem == projections.CoordinateSystem.RIGHT_HANDED) - raw[5] = -raw[5]; - - this._pMatrix.copyRawDataFrom(raw); - - this._pFrustumCorners[0] = this._pFrustumCorners[9] = this._pNear * left; - this._pFrustumCorners[3] = this._pFrustumCorners[6] = this._pNear * right; - this._pFrustumCorners[1] = this._pFrustumCorners[4] = this._pNear * top; - this._pFrustumCorners[7] = this._pFrustumCorners[10] = this._pNear * bottom; - - this._pFrustumCorners[12] = this._pFrustumCorners[21] = this._pFar * left; - this._pFrustumCorners[15] = this._pFrustumCorners[18] = this._pFar * right; - this._pFrustumCorners[13] = this._pFrustumCorners[16] = this._pFar * top; - this._pFrustumCorners[19] = this._pFrustumCorners[22] = this._pFar * bottom; - - this._pFrustumCorners[2] = this._pFrustumCorners[5] = this._pFrustumCorners[8] = this._pFrustumCorners[11] = this._pNear; - this._pFrustumCorners[14] = this._pFrustumCorners[17] = this._pFrustumCorners[20] = this._pFrustumCorners[23] = this._pFar; - - this._pMatrixInvalid = false; - }; - return PerspectiveProjection; - })(projections.ProjectionBase); - projections.PerspectiveProjection = PerspectiveProjection; - })(away.projections || (away.projections = {})); - var projections = away.projections; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (projections) { - var FreeMatrixProjection = (function (_super) { - __extends(FreeMatrixProjection, _super); - function FreeMatrixProjection() { - _super.call(this); - this._pMatrix.copyFrom(new projections.PerspectiveProjection().matrix); - } - Object.defineProperty(FreeMatrixProjection.prototype, "near", { - //@override - set: function (value) { - this._pNear = value; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(FreeMatrixProjection.prototype, "far", { - //@override - set: function (value) { - this._pFar = value; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(FreeMatrixProjection.prototype, "iAspectRatio", { - //@override - set: function (value) { - this._pAspectRatio = value; - }, - enumerable: true, - configurable: true - }); - - //@override - FreeMatrixProjection.prototype.clone = function () { - var clone = new FreeMatrixProjection(); - clone._pMatrix.copyFrom(this._pMatrix); - clone._pNear = this._pNear; - clone._pFar = this._pFar; - clone._pAspectRatio = this._pAspectRatio; - clone.pInvalidateMatrix(); - return clone; - }; - - //@override - FreeMatrixProjection.prototype.pUpdateMatrix = function () { - this._pMatrixInvalid = false; - }; - return FreeMatrixProjection; - })(projections.ProjectionBase); - projections.FreeMatrixProjection = FreeMatrixProjection; - })(away.projections || (away.projections = {})); - var projections = away.projections; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (projections) { - var OrthographicProjection = (function (_super) { - __extends(OrthographicProjection, _super); - function OrthographicProjection(projectionHeight) { - if (typeof projectionHeight === "undefined") { projectionHeight = 500; } - _super.call(this); - this._projectionHeight = projectionHeight; - } - Object.defineProperty(OrthographicProjection.prototype, "projectionHeight", { - get: function () { - return this._projectionHeight; - }, - set: function (value) { - if (value == this._projectionHeight) { - return; - } - this._projectionHeight = value; - this.pInvalidateMatrix(); - }, - enumerable: true, - configurable: true - }); - - - //@override - OrthographicProjection.prototype.unproject = function (nX, nY, sZ) { - var v = new away.geom.Vector3D(nX + this.matrix.rawData[12], -nY + this.matrix.rawData[13], sZ, 1.0); - v = this.unprojectionMatrix.transformVector(v); - - //z is unaffected by transform - v.z = sZ; - - return v; - }; - - //@override - OrthographicProjection.prototype.clone = function () { - var clone = new OrthographicProjection(); - clone._pNear = this._pNear; - clone._pFar = this._pFar; - clone._pAspectRatio = this._pAspectRatio; - clone.projectionHeight = this._projectionHeight; - return clone; - }; - - //@override - OrthographicProjection.prototype.pUpdateMatrix = function () { - var raw = []; - this._yMax = this._projectionHeight * .5; - this._xMax = this._yMax * this._pAspectRatio; - - var left; - var right; - var top; - var bottom; - - if (this._pScissorRect.x == 0 && this._pScissorRect.y == 0 && this._pScissorRect.width == this._pViewPort.width && this._pScissorRect.height == this._pViewPort.height) { - // assume symmetric frustum - left = -this._xMax; - right = this._xMax; - top = -this._yMax; - bottom = this._yMax; - - raw[0] = 2 / (this._projectionHeight * this._pAspectRatio); - raw[5] = 2 / this._projectionHeight; - raw[10] = 1 / (this._pFar - this._pNear); - raw[14] = this._pNear / (this._pNear - this._pFar); - raw[1] = raw[2] = raw[3] = raw[4] = raw[6] = raw[7] = raw[8] = raw[9] = raw[11] = raw[12] = raw[13] = 0; - raw[15] = 1; - } else { - var xWidth = this._xMax * (this._pViewPort.width / this._pScissorRect.width); - var yHgt = this._yMax * (this._pViewPort.height / this._pScissorRect.height); - var center = this._xMax * (this._pScissorRect.x * 2 - this._pViewPort.width) / this._pScissorRect.width + this._xMax; - var middle = -this._yMax * (this._pScissorRect.y * 2 - this._pViewPort.height) / this._pScissorRect.height - this._yMax; - - left = center - xWidth; - right = center + xWidth; - top = middle - yHgt; - bottom = middle + yHgt; - - raw[0] = 2 * 1 / (right - left); - raw[5] = -2 * 1 / (top - bottom); - raw[10] = 1 / (this._pFar - this._pNear); - - raw[12] = (right + left) / (right - left); - raw[13] = (bottom + top) / (bottom - top); - raw[14] = this._pNear / (this.near - this.far); - - raw[1] = raw[2] = raw[3] = raw[4] = raw[6] = raw[7] = raw[8] = raw[9] = raw[11] = 0; - raw[15] = 1; - } - - this._pFrustumCorners[0] = this._pFrustumCorners[9] = this._pFrustumCorners[12] = this._pFrustumCorners[21] = left; - this._pFrustumCorners[3] = this._pFrustumCorners[6] = this._pFrustumCorners[15] = this._pFrustumCorners[18] = right; - this._pFrustumCorners[1] = this._pFrustumCorners[4] = this._pFrustumCorners[13] = this._pFrustumCorners[16] = top; - this._pFrustumCorners[7] = this._pFrustumCorners[10] = this._pFrustumCorners[19] = this._pFrustumCorners[22] = bottom; - this._pFrustumCorners[2] = this._pFrustumCorners[5] = this._pFrustumCorners[8] = this._pFrustumCorners[11] = this._pNear; - this._pFrustumCorners[14] = this._pFrustumCorners[17] = this._pFrustumCorners[20] = this._pFrustumCorners[23] = this._pFar; - - this._pMatrix.copyRawDataFrom(raw); - - this._pMatrixInvalid = false; - }; - return OrthographicProjection; - })(projections.ProjectionBase); - projections.OrthographicProjection = OrthographicProjection; - })(away.projections || (away.projections = {})); - var projections = away.projections; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (projections) { - var OrthographicOffCenterProjection = (function (_super) { - __extends(OrthographicOffCenterProjection, _super); - function OrthographicOffCenterProjection(minX, maxX, minY, maxY) { - _super.call(this); - this._minX = minX; - this._maxX = maxX; - this._minY = minY; - this._maxY = maxY; - } - Object.defineProperty(OrthographicOffCenterProjection.prototype, "minX", { - get: function () { - return this._minX; - }, - set: function (value) { - this._minX = value; - this.pInvalidateMatrix(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(OrthographicOffCenterProjection.prototype, "maxX", { - get: function () { - return this._maxX; - }, - set: function (value) { - this._maxX = value; - this.pInvalidateMatrix(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(OrthographicOffCenterProjection.prototype, "minY", { - get: function () { - return this._minY; - }, - set: function (value) { - this._minY = value; - this.pInvalidateMatrix(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(OrthographicOffCenterProjection.prototype, "maxY", { - get: function () { - return this._maxY; - }, - set: function (value) { - this._maxY = value; - this.pInvalidateMatrix(); - }, - enumerable: true, - configurable: true - }); - - - //@override - OrthographicOffCenterProjection.prototype.unproject = function (nX, nY, sZ) { - var v = new away.geom.Vector3D(nX, -nY, sZ, 1.0); - v = this.unprojectionMatrix.transformVector(v); - - //z is unaffected by transform - v.z = sZ; - - return v; - }; - - //@override - OrthographicOffCenterProjection.prototype.clone = function () { - var clone = new OrthographicOffCenterProjection(this._minX, this._maxX, this._minY, this._maxY); - clone._pNear = this._pNear; - clone._pFar = this._pFar; - clone._pAspectRatio = this._pAspectRatio; - return clone; - }; - - //@override - OrthographicOffCenterProjection.prototype.pUpdateMatrix = function () { - var raw = []; - var w = 1 / (this._maxX - this._minX); - var h = 1 / (this._maxY - this._minY); - var d = 1 / (this._pFar - this._pNear); - - raw[0] = 2 * w; - raw[5] = 2 * h; - raw[10] = d; - raw[12] = -(this._maxX + this._minX) * w; - raw[13] = -(this._maxY + this._minY) * h; - raw[14] = -this._pNear * d; - raw[15] = 1; - raw[1] = raw[2] = raw[3] = raw[4] = raw[6] = raw[7] = raw[8] = raw[9] = raw[11] = 0; - this._pMatrix.copyRawDataFrom(raw); - - this._pFrustumCorners[0] = this._pFrustumCorners[9] = this._pFrustumCorners[12] = this._pFrustumCorners[21] = this._minX; - this._pFrustumCorners[3] = this._pFrustumCorners[6] = this._pFrustumCorners[15] = this._pFrustumCorners[18] = this._maxX; - this._pFrustumCorners[1] = this._pFrustumCorners[4] = this._pFrustumCorners[13] = this._pFrustumCorners[16] = this._minY; - this._pFrustumCorners[7] = this._pFrustumCorners[10] = this._pFrustumCorners[19] = this._pFrustumCorners[22] = this._maxY; - this._pFrustumCorners[2] = this._pFrustumCorners[5] = this._pFrustumCorners[8] = this._pFrustumCorners[11] = this._pNear; - this._pFrustumCorners[14] = this._pFrustumCorners[17] = this._pFrustumCorners[20] = this._pFrustumCorners[23] = this._pFar; - - this._pMatrixInvalid = false; - }; - return OrthographicOffCenterProjection; - })(projections.ProjectionBase); - projections.OrthographicOffCenterProjection = OrthographicOffCenterProjection; - })(away.projections || (away.projections = {})); - var projections = away.projections; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (projections) { - var ObliqueNearPlaneProjection = (function (_super) { - __extends(ObliqueNearPlaneProjection, _super); - function ObliqueNearPlaneProjection(baseProjection, plane) { - _super.call(this); - this.baseProjection = baseProjection; - this.plane = plane; - - this._onProjectionMatrixChangedDelegate = away.utils.Delegate.create(this, this.onProjectionMatrixChanged); - } - Object.defineProperty(ObliqueNearPlaneProjection.prototype, "frustumCorners", { - //@override - get: function () { - return this._baseProjection.frustumCorners; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ObliqueNearPlaneProjection.prototype, "near", { - //@override - get: function () { - return this._baseProjection.near; - }, - //@override - set: function (value) { - this._baseProjection.near = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ObliqueNearPlaneProjection.prototype, "far", { - //@override - get: function () { - return this._baseProjection.far; - }, - //@override - set: function (value) { - this._baseProjection.far = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ObliqueNearPlaneProjection.prototype, "iAspectRatio", { - //@override - get: function () { - return this._baseProjection._iAspectRatio; - }, - //@override - set: function (value) { - this._baseProjection._iAspectRatio = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ObliqueNearPlaneProjection.prototype, "plane", { - get: function () { - return this._plane; - }, - set: function (value) { - this._plane = value; - this.pInvalidateMatrix(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ObliqueNearPlaneProjection.prototype, "baseProjection", { - set: function (value) { - if (this._baseProjection) { - this._baseProjection.removeEventListener(away.events.ProjectionEvent.MATRIX_CHANGED, this._onProjectionMatrixChangedDelegate); - } - this._baseProjection = value; - - if (this._baseProjection) { - this._baseProjection.addEventListener(away.events.ProjectionEvent.MATRIX_CHANGED, this._onProjectionMatrixChangedDelegate); - } - this.pInvalidateMatrix(); - }, - enumerable: true, - configurable: true - }); - - ObliqueNearPlaneProjection.prototype.onProjectionMatrixChanged = function (event) { - this.pInvalidateMatrix(); - }; - - //@override - ObliqueNearPlaneProjection.prototype.pUpdateMatrix = function () { - this._pMatrix.copyFrom(this._baseProjection.matrix); - - var cx = this._plane.a; - var cy = this._plane.b; - var cz = this._plane.c; - var cw = -this._plane.d + .05; - var signX = cx >= 0 ? 1 : -1; - var signY = cy >= 0 ? 1 : -1; - var p = new away.geom.Vector3D(signX, signY, 1, 1); - var inverse = this._pMatrix.clone(); - inverse.invert(); - var q = inverse.transformVector(p); - this._pMatrix.copyRowTo(3, p); - var a = (q.x * p.x + q.y * p.y + q.z * p.z + q.w * p.w) / (cx * q.x + cy * q.y + cz * q.z + cw * q.w); - this._pMatrix.copyRowFrom(2, new away.geom.Vector3D(cx * a, cy * a, cz * a, cw * a)); - }; - return ObliqueNearPlaneProjection; - })(projections.ProjectionBase); - projections.ObliqueNearPlaneProjection = ObliqueNearPlaneProjection; - })(away.projections || (away.projections = {})); - var projections = away.projections; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (entities) { - var Camera = (function (_super) { - __extends(Camera, _super); - function Camera(projection) { - if (typeof projection === "undefined") { projection = null; } - _super.call(this); - this._viewProjection = new away.geom.Matrix3D(); - this._viewProjectionDirty = true; - this._frustumPlanesDirty = true; - - this._pIsEntity = true; - - this._onProjectionMatrixChangedDelegate = away.utils.Delegate.create(this, this.onProjectionMatrixChanged); - - this._projection = projection || new away.projections.PerspectiveProjection(); - this._projection.addEventListener(away.events.ProjectionEvent.MATRIX_CHANGED, this._onProjectionMatrixChangedDelegate); - - this._frustumPlanes = []; - - for (var i = 0; i < 6; ++i) - this._frustumPlanes[i] = new away.geom.Plane3D(); - - this.z = -1000; - } - Camera.prototype.pCreateDefaultBoundingVolume = function () { - return new away.bounds.NullBounds(); - }; - - /** - * @protected - */ - Camera.prototype.pCreateEntityPartitionNode = function () { - return new away.partition.CameraNode(this); - }; - - Object.defineProperty(Camera.prototype, "assetType", { - //@override - get: function () { - return away.library.AssetType.CAMERA; - }, - enumerable: true, - configurable: true - }); - - Camera.prototype.onProjectionMatrixChanged = function (event) { - this._viewProjectionDirty = true; - this._frustumPlanesDirty = true; - this.dispatchEvent(event); - }; - - Object.defineProperty(Camera.prototype, "frustumPlanes", { - get: function () { - if (this._frustumPlanesDirty) - this.updateFrustum(); - - return this._frustumPlanes; - }, - enumerable: true, - configurable: true - }); - - Camera.prototype.updateFrustum = function () { - var a, b, c; - - //var d : Number; - var c11, c12, c13, c14; - var c21, c22, c23, c24; - var c31, c32, c33, c34; - var c41, c42, c43, c44; - var p; - var raw = new Array(16); - ; - var invLen; - this.viewProjection.copyRawDataTo(raw); - - c11 = raw[0]; - c12 = raw[4]; - c13 = raw[8]; - c14 = raw[12]; - c21 = raw[1]; - c22 = raw[5]; - c23 = raw[9]; - c24 = raw[13]; - c31 = raw[2]; - c32 = raw[6]; - c33 = raw[10]; - c34 = raw[14]; - c41 = raw[3]; - c42 = raw[7]; - c43 = raw[11]; - c44 = raw[15]; - - // left plane - p = this._frustumPlanes[0]; - a = c41 + c11; - b = c42 + c12; - c = c43 + c13; - invLen = 1 / Math.sqrt(a * a + b * b + c * c); - p.a = a * invLen; - p.b = b * invLen; - p.c = c * invLen; - p.d = -(c44 + c14) * invLen; - - // right plane - p = this._frustumPlanes[1]; - a = c41 - c11; - b = c42 - c12; - c = c43 - c13; - invLen = 1 / Math.sqrt(a * a + b * b + c * c); - p.a = a * invLen; - p.b = b * invLen; - p.c = c * invLen; - p.d = (c14 - c44) * invLen; - - // bottom - p = this._frustumPlanes[2]; - a = c41 + c21; - b = c42 + c22; - c = c43 + c23; - invLen = 1 / Math.sqrt(a * a + b * b + c * c); - p.a = a * invLen; - p.b = b * invLen; - p.c = c * invLen; - p.d = -(c44 + c24) * invLen; - - // top - p = this._frustumPlanes[3]; - a = c41 - c21; - b = c42 - c22; - c = c43 - c23; - invLen = 1 / Math.sqrt(a * a + b * b + c * c); - p.a = a * invLen; - p.b = b * invLen; - p.c = c * invLen; - p.d = (c24 - c44) * invLen; - - // near - p = this._frustumPlanes[4]; - a = c31; - b = c32; - c = c33; - invLen = 1 / Math.sqrt(a * a + b * b + c * c); - p.a = a * invLen; - p.b = b * invLen; - p.c = c * invLen; - p.d = -c34 * invLen; - - // far - p = this._frustumPlanes[5]; - a = c41 - c31; - b = c42 - c32; - c = c43 - c33; - invLen = 1 / Math.sqrt(a * a + b * b + c * c); - p.a = a * invLen; - p.b = b * invLen; - p.c = c * invLen; - p.d = (c34 - c44) * invLen; - - this._frustumPlanesDirty = false; - }; - - /** - * @protected - */ - Camera.prototype.pInvalidateSceneTransform = function () { - _super.prototype.pInvalidateSceneTransform.call(this); - - this._viewProjectionDirty = true; - this._frustumPlanesDirty = true; - }; - - /** - * @protected - */ - Camera.prototype.pUpdateBounds = function () { - this._pBoundsInvalid = false; - this._pBounds.nullify(); - }; - - Object.defineProperty(Camera.prototype, "projection", { - /** - * - */ - get: function () { - return this._projection; - }, - set: function (value) { - if (this._projection == value) - return; - - if (!value) - throw new Error("Projection cannot be null!"); - - this._projection.removeEventListener(away.events.ProjectionEvent.MATRIX_CHANGED, this._onProjectionMatrixChangedDelegate); - this._projection = value; - this._projection.addEventListener(away.events.ProjectionEvent.MATRIX_CHANGED, this._onProjectionMatrixChangedDelegate); - this.dispatchEvent(new away.events.CameraEvent(away.events.CameraEvent.PROJECTION_CHANGED, this)); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Camera.prototype, "viewProjection", { - /** - * - */ - get: function () { - if (this._viewProjectionDirty) { - this._viewProjection.copyFrom(this.inverseSceneTransform); - this._viewProjection.append(this._projection.matrix); - this._viewProjectionDirty = false; - } - - return this._viewProjection; - }, - enumerable: true, - configurable: true - }); - - /** - * Calculates the ray in scene space from the camera to the given normalized coordinates in screen space. - * - * @param nX The normalised x coordinate in screen space, -1 corresponds to the left edge of the viewport, 1 to the right. - * @param nY The normalised y coordinate in screen space, -1 corresponds to the top edge of the viewport, 1 to the bottom. - * @param sZ The z coordinate in screen space, representing the distance into the screen. - * @return The ray from the camera to the scene space position of the given screen coordinates. - */ - Camera.prototype.getRay = function (nX, nY, sZ) { - return this.sceneTransform.deltaTransformVector(this._projection.unproject(nX, nY, sZ)); - }; - - /** - * Calculates the normalised position in screen space of the given scene position. - * - * @param point3d the position vector of the scene coordinates to be projected. - * @return The normalised screen position of the given scene coordinates. - */ - Camera.prototype.project = function (point3d) { - return this._projection.project(this.inverseSceneTransform.transformVector(point3d)); - }; - - /** - * Calculates the scene position of the given normalized coordinates in screen space. - * - * @param nX The normalised x coordinate in screen space, minus the originX offset of the projection property. - * @param nY The normalised y coordinate in screen space, minus the originY offset of the projection property. - * @param sZ The z coordinate in screen space, representing the distance into the screen. - * @return The scene position of the given screen coordinates. - */ - Camera.prototype.unproject = function (nX, nY, sZ) { - return this.sceneTransform.transformVector(this._projection.unproject(nX, nY, sZ)); - }; - - Camera.prototype._iCollectRenderables = function (renderer) { - // Since this getter is invoked every iteration of the render loop, and - // the prefab construct could affect the sub-meshes, the prefab is - // validated here to give it a chance to rebuild. - if (this._iSourcePrefab) - this._iSourcePrefab._iValidate(); - - this._iCollectRenderable(renderer); - }; - - Camera.prototype._iCollectRenderable = function (renderer) { - //nothing to do here - }; - return Camera; - })(away.containers.DisplayObjectContainer); - entities.Camera = Camera; - })(away.entities || (away.entities = {})); - var entities = away.entities; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var AbstractMethodError = away.errors.AbstractMethodError; - - var ShadowCasterCollector = away.traverse.ShadowCasterCollector; - var RenderTexture = away.textures.RenderTexture; - - var ShadowMapperBase = (function () { - function ShadowMapperBase() { - this._pDepthMapSize = 2048; - this._autoUpdateShadows = true; - this._pCasterCollector = this.pCreateCasterCollector(); - } - ShadowMapperBase.prototype.pCreateCasterCollector = function () { - return new ShadowCasterCollector(); - }; - - Object.defineProperty(ShadowMapperBase.prototype, "autoUpdateShadows", { - get: function () { - return this._autoUpdateShadows; - }, - set: function (value) { - this._autoUpdateShadows = value; - }, - enumerable: true, - configurable: true - }); - - - ShadowMapperBase.prototype.updateShadows = function () { - this._iShadowsInvalid = true; - }; - - ShadowMapperBase.prototype.iSetDepthMap = function (depthMap) { - if (this._depthMap == depthMap) - return; - - if (this._depthMap && !this._explicitDepthMap) - this._depthMap.dispose(); - - this._depthMap = depthMap; - - if (this._depthMap) { - this._explicitDepthMap = true; - this._pDepthMapSize = this._depthMap.size; - } else { - this._explicitDepthMap = false; - } - }; - - Object.defineProperty(ShadowMapperBase.prototype, "light", { - get: function () { - return this._pLight; - }, - set: function (value) { - this._pLight = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ShadowMapperBase.prototype, "depthMap", { - get: function () { - if (!this._depthMap) - this._depthMap = this.pCreateDepthTexture(); - - return this._depthMap; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ShadowMapperBase.prototype, "depthMapSize", { - get: function () { - return this._pDepthMapSize; - }, - set: function (value) { - if (value == this._pDepthMapSize) - return; - - this._pSetDepthMapSize(value); - }, - enumerable: true, - configurable: true - }); - - - ShadowMapperBase.prototype.dispose = function () { - this._pCasterCollector = null; - - if (this._depthMap && !this._explicitDepthMap) - this._depthMap.dispose(); - - this._depthMap = null; - }; - - ShadowMapperBase.prototype.pCreateDepthTexture = function () { - return new RenderTexture(this._pDepthMapSize, this._pDepthMapSize); - }; - - ShadowMapperBase.prototype.iRenderDepthMap = function (stage, entityCollector, renderer) { - this._iShadowsInvalid = false; - - this.pUpdateDepthProjection(entityCollector.camera); - - if (!this._depthMap) - this._depthMap = this.pCreateDepthTexture(); - - this.pDrawDepthMap(this._depthMap, entityCollector.scene, renderer); - }; - - ShadowMapperBase.prototype.pUpdateDepthProjection = function (viewCamera) { - throw new AbstractMethodError(); - }; - - ShadowMapperBase.prototype.pDrawDepthMap = function (target, scene, renderer) { - throw new AbstractMethodError(); - }; - - ShadowMapperBase.prototype._pSetDepthMapSize = function (value) { - this._pDepthMapSize = value; - - if (this._explicitDepthMap) { - throw Error("Cannot set depth map size for the current renderer."); - } else if (this._depthMap) { - this._depthMap.dispose(); - this._depthMap = null; - } - }; - return ShadowMapperBase; - })(); - materials.ShadowMapperBase = ShadowMapperBase; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var Camera = away.entities.Camera; - - var CubeMapShadowMapper = (function (_super) { - __extends(CubeMapShadowMapper, _super); - function CubeMapShadowMapper() { - _super.call(this); - - this._pDepthMapSize = 512; - this._needsRender = new Array(); - this.initCameras(); - } - CubeMapShadowMapper.prototype.initCameras = function () { - this._depthCameras = new Array(); - this._projections = new Array(); - - // posX, negX, posY, negY, posZ, negZ - this.addCamera(0, 90, 0); - this.addCamera(0, -90, 0); - this.addCamera(-90, 0, 0); - this.addCamera(90, 0, 0); - this.addCamera(0, 0, 0); - this.addCamera(0, 180, 0); - }; - - CubeMapShadowMapper.prototype.addCamera = function (rotationX, rotationY, rotationZ) { - var cam = new Camera(); - cam.rotationX = rotationX; - cam.rotationY = rotationY; - cam.rotationZ = rotationZ; - cam.projection.near = .01; - - var projection = cam.projection; - projection.fieldOfView = 90; - this._projections.push(projection); - cam.projection._iAspectRatio = 1; - this._depthCameras.push(cam); - }; - - //@override - CubeMapShadowMapper.prototype.pCreateDepthTexture = function () { - throw new away.errors.PartialImplementationError(); - /* - return new RenderCubeTexture( this._depthMapSize ); - */ - }; - - //@override - CubeMapShadowMapper.prototype.pUpdateDepthProjection = function (viewCamera) { - var light = (this._pLight); - var maxDistance = light._pFallOff; - var pos = this._pLight.scenePosition; - - for (var i = 0; i < 6; ++i) { - this._projections[i].far = maxDistance; - this._depthCameras[i].transform.position = pos; - this._needsRender[i] = true; - } - }; - - //@override - CubeMapShadowMapper.prototype.pDrawDepthMap = function (target, scene, renderer) { - for (var i = 0; i < 6; ++i) { - if (this._needsRender[i]) { - this._pCasterCollector.camera = this._depthCameras[i]; - this._pCasterCollector.clear(); - scene.traversePartitions(this._pCasterCollector); - renderer._iRender(this._pCasterCollector, target, null, i); - } - } - }; - return CubeMapShadowMapper; - })(materials.ShadowMapperBase); - materials.CubeMapShadowMapper = CubeMapShadowMapper; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var Camera = away.entities.Camera; - - var Matrix3D = away.geom.Matrix3D; - - var FreeMatrixProjection = away.projections.FreeMatrixProjection; - - var DirectionalShadowMapper = (function (_super) { - __extends(DirectionalShadowMapper, _super); - function DirectionalShadowMapper() { - _super.call(this); - this._pLightOffset = 10000; - this._pSnap = 64; - - this._pCullPlanes = []; - this._pOverallDepthProjection = new FreeMatrixProjection(); - this._pOverallDepthCamera = new Camera(this._pOverallDepthProjection); - this._pLocalFrustum = []; - this._pMatrix = new Matrix3D(); - } - Object.defineProperty(DirectionalShadowMapper.prototype, "snap", { - get: function () { - return this._pSnap; - }, - set: function (value) { - this._pSnap = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DirectionalShadowMapper.prototype, "lightOffset", { - get: function () { - return this._pLightOffset; - }, - set: function (value) { - this._pLightOffset = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DirectionalShadowMapper.prototype, "iDepthProjection", { - //@arcane - get: function () { - return this._pOverallDepthCamera.viewProjection; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(DirectionalShadowMapper.prototype, "depth", { - //@arcane - get: function () { - return this._pMaxZ - this._pMinZ; - }, - enumerable: true, - configurable: true - }); - - //@override - DirectionalShadowMapper.prototype.pDrawDepthMap = function (target, scene, renderer) { - this._pCasterCollector.camera = this._pOverallDepthCamera; - this._pCasterCollector.cullPlanes = this._pCullPlanes; - this._pCasterCollector.clear(); - scene.traversePartitions(this._pCasterCollector); - renderer._iRender(this._pCasterCollector, target); - }; - - //@protected - DirectionalShadowMapper.prototype.pUpdateCullPlanes = function (viewCamera) { - var lightFrustumPlanes = this._pOverallDepthCamera.frustumPlanes; - var viewFrustumPlanes = viewCamera.frustumPlanes; - this._pCullPlanes.length = 4; - - this._pCullPlanes[0] = lightFrustumPlanes[0]; - this._pCullPlanes[1] = lightFrustumPlanes[1]; - this._pCullPlanes[2] = lightFrustumPlanes[2]; - this._pCullPlanes[3] = lightFrustumPlanes[3]; - - var light = this._pLight; - var dir = light.sceneDirection; - var dirX = dir.x; - var dirY = dir.y; - var dirZ = dir.z; - var j = 4; - for (var i = 0; i < 6; ++i) { - var plane = viewFrustumPlanes[i]; - if (plane.a * dirX + plane.b * dirY + plane.c * dirZ < 0) - this._pCullPlanes[j++] = plane; - } - }; - - //@override - DirectionalShadowMapper.prototype.pUpdateDepthProjection = function (viewCamera) { - this.pUpdateProjectionFromFrustumCorners(viewCamera, viewCamera.projection.frustumCorners, this._pMatrix); - this._pOverallDepthProjection.matrix = this._pMatrix; - this.pUpdateCullPlanes(viewCamera); - }; - - DirectionalShadowMapper.prototype.pUpdateProjectionFromFrustumCorners = function (viewCamera, corners, matrix) { - var raw = new Array(); - var dir; - var x, y, z; - var minX, minY; - var maxX, maxY; - var i; - - var light = this._pLight; - dir = light.sceneDirection; - this._pOverallDepthCamera.transform.matrix3D = this._pLight.sceneTransform; - x = Math.floor((viewCamera.x - dir.x * this._pLightOffset) / this._pSnap) * this._pSnap; - y = Math.floor((viewCamera.y - dir.y * this._pLightOffset) / this._pSnap) * this._pSnap; - z = Math.floor((viewCamera.z - dir.z * this._pLightOffset) / this._pSnap) * this._pSnap; - this._pOverallDepthCamera.x = x; - this._pOverallDepthCamera.y = y; - this._pOverallDepthCamera.z = z; - - this._pMatrix.copyFrom(this._pOverallDepthCamera.inverseSceneTransform); - this._pMatrix.prepend(viewCamera.sceneTransform); - this._pMatrix.transformVectors(corners, this._pLocalFrustum); - - minX = maxX = this._pLocalFrustum[0]; - minY = maxY = this._pLocalFrustum[1]; - this._pMaxZ = this._pLocalFrustum[2]; - - i = 3; - while (i < 24) { - x = this._pLocalFrustum[i]; - y = this._pLocalFrustum[i + 1]; - z = this._pLocalFrustum[i + 2]; - if (x < minX) - minX = x; - if (x > maxX) - maxX = x; - if (y < minY) - minY = y; - if (y > maxY) - maxY = y; - if (z > this._pMaxZ) - this._pMaxZ = z; - i += 3; - } - - this._pMinZ = 1; - - var w = maxX - minX; - var h = maxY - minY; - var d = 1 / (this._pMaxZ - this._pMinZ); - - if (minX < 0) - minX -= this._pSnap; // because int() rounds up for < 0 - - if (minY < 0) - minY -= this._pSnap; - - minX = Math.floor(minX / this._pSnap) * this._pSnap; - minY = Math.floor(minY / this._pSnap) * this._pSnap; - - var snap2 = 2 * this._pSnap; - w = Math.floor(w / snap2 + 2) * snap2; - h = Math.floor(h / snap2 + 2) * snap2; - - maxX = minX + w; - maxY = minY + h; - - w = 1 / w; - h = 1 / h; - - raw[0] = 2 * w; - raw[5] = 2 * h; - raw[10] = d; - raw[12] = -(maxX + minX) * w; - raw[13] = -(maxY + minY) * h; - raw[14] = -this._pMinZ * d; - raw[15] = 1; - raw[1] = raw[2] = raw[3] = raw[4] = raw[6] = raw[7] = raw[8] = raw[9] = raw[11] = 0; - - matrix.copyRawDataFrom(raw); - }; - return DirectionalShadowMapper; - })(materials.ShadowMapperBase); - materials.DirectionalShadowMapper = DirectionalShadowMapper; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -var away; -(function (away) { - (function (materials) { - var Camera = away.entities.Camera; - var Event = away.events.Event; - var EventDispatcher = away.events.EventDispatcher; - - var Matrix3DUtils = away.geom.Matrix3DUtils; - var Rectangle = away.geom.Rectangle; - var FreeMatrixProjection = away.projections.FreeMatrixProjection; - - var CascadeShadowMapper = (function (_super) { - __extends(CascadeShadowMapper, _super); - function CascadeShadowMapper(numCascades) { - if (typeof numCascades === "undefined") { numCascades = 3; } - _super.call(this); - this._pScissorRectsInvalid = true; - - if (numCascades < 1 || numCascades > 4) - throw new Error("numCascades must be an integer between 1 and 4"); - - this._numCascades = numCascades; - this._changeDispatcher = new EventDispatcher(this); - this.init(); - } - CascadeShadowMapper.prototype.getSplitRatio = function (index /*uint*/ ) { - return this._splitRatios[index]; - }; - - CascadeShadowMapper.prototype.setSplitRatio = function (index /*uint*/ , value) { - if (value < 0) - value = 0; - else if (value > 1) - value = 1; - - if (index >= this._numCascades) - throw new Error("index must be smaller than the number of cascades!"); - - this._splitRatios[index] = value; - }; - - CascadeShadowMapper.prototype.getDepthProjections = function (partition /*uint*/ ) { - return this._depthCameras[partition].viewProjection; - }; - - CascadeShadowMapper.prototype.init = function () { - this._splitRatios = new Array(this._numCascades); - this._nearPlaneDistances = new Array(this._numCascades); - - var s = 1; - for (var i = this._numCascades - 1; i >= 0; --i) { - this._splitRatios[i] = s; - s *= .4; - } - - this._texOffsetsX = Array(-1, 1, -1, 1); - this._texOffsetsY = Array(1, 1, -1, -1); - this._pScissorRects = new Array(4); - this._depthLenses = new Array(); - this._depthCameras = new Array(); - - for (i = 0; i < this._numCascades; ++i) { - this._depthLenses[i] = new FreeMatrixProjection(); - this._depthCameras[i] = new Camera(this._depthLenses[i]); - } - }; - - CascadeShadowMapper.prototype._pSetDepthMapSize = function (value /*uint*/ ) { - _super.prototype._pSetDepthMapSize.call(this, value); - - this.invalidateScissorRects(); - }; - - CascadeShadowMapper.prototype.invalidateScissorRects = function () { - this._pScissorRectsInvalid = true; - }; - - Object.defineProperty(CascadeShadowMapper.prototype, "numCascades", { - get: function () { - return this._numCascades; - }, - set: function (value /*int*/ ) { - if (value == this._numCascades) - return; - - if (value < 1 || value > 4) - throw new Error("numCascades must be an integer between 1 and 4"); - - this._numCascades = value; - this.invalidateScissorRects(); - this.init(); - this.dispatchEvent(new Event(Event.CHANGE)); - }, - enumerable: true, - configurable: true - }); - - - CascadeShadowMapper.prototype.pDrawDepthMap = function (target, scene, renderer) { - if (this._pScissorRectsInvalid) - this.updateScissorRects(); - - this._pCasterCollector.cullPlanes = this._pCullPlanes; - this._pCasterCollector.camera = this._pOverallDepthCamera; - this._pCasterCollector.clear(); - scene.traversePartitions(this._pCasterCollector); - - renderer._iRenderCascades(this._pCasterCollector, target, this._numCascades, this._pScissorRects, this._depthCameras); - }; - - CascadeShadowMapper.prototype.updateScissorRects = function () { - var half = this._pDepthMapSize * .5; - - this._pScissorRects[0] = new Rectangle(0, 0, half, half); - this._pScissorRects[1] = new Rectangle(half, 0, half, half); - this._pScissorRects[2] = new Rectangle(0, half, half, half); - this._pScissorRects[3] = new Rectangle(half, half, half, half); - - this._pScissorRectsInvalid = false; - }; - - CascadeShadowMapper.prototype.pUpdateDepthProjection = function (viewCamera) { - var matrix; - var projection = viewCamera.projection; - var projectionNear = projection.near; - var projectionRange = projection.far - projectionNear; - - this.pUpdateProjectionFromFrustumCorners(viewCamera, viewCamera.projection.frustumCorners, this._pMatrix); - this._pMatrix.appendScale(.96, .96, 1); - this._pOverallDepthProjection.matrix = this._pMatrix; - this.pUpdateCullPlanes(viewCamera); - - for (var i = 0; i < this._numCascades; ++i) { - matrix = this._depthLenses[i].matrix; - - this._nearPlaneDistances[i] = projectionNear + this._splitRatios[i] * projectionRange; - this._depthCameras[i].transform = this._pOverallDepthCamera.transform; - - this.updateProjectionPartition(matrix, this._splitRatios[i], this._texOffsetsX[i], this._texOffsetsY[i]); - - this._depthLenses[i].matrix = matrix; - } - }; - - CascadeShadowMapper.prototype.updateProjectionPartition = function (matrix, splitRatio, texOffsetX, texOffsetY) { - var raw = Matrix3DUtils.RAW_DATA_CONTAINER; - var xN, yN, zN; - var xF, yF, zF; - var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, minZ; - var maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY, maxZ = Number.NEGATIVE_INFINITY; - var i = 0; - - while (i < 12) { - xN = this._pLocalFrustum[i]; - yN = this._pLocalFrustum[i + 1]; - zN = this._pLocalFrustum[i + 2]; - xF = xN + (this._pLocalFrustum[i + 12] - xN) * splitRatio; - yF = yN + (this._pLocalFrustum[i + 13] - yN) * splitRatio; - zF = zN + (this._pLocalFrustum[i + 14] - zN) * splitRatio; - if (xN < minX) - minX = xN; - if (xN > maxX) - maxX = xN; - if (yN < minY) - minY = yN; - if (yN > maxY) - maxY = yN; - if (zN > maxZ) - maxZ = zN; - if (xF < minX) - minX = xF; - if (xF > maxX) - maxX = xF; - if (yF < minY) - minY = yF; - if (yF > maxY) - maxY = yF; - if (zF > maxZ) - maxZ = zF; - i += 3; - } - - minZ = 1; - - var w = (maxX - minX); - var h = (maxY - minY); - var d = 1 / (maxZ - minZ); - - if (minX < 0) - minX -= this._pSnap; // because int() rounds up for < 0 - if (minY < 0) - minY -= this._pSnap; - minX = Math.floor(minX / this._pSnap) * this._pSnap; - minY = Math.floor(minY / this._pSnap) * this._pSnap; - - var snap2 = 2 * this._pSnap; - w = Math.floor(w / snap2 + 1) * snap2; - h = Math.floor(h / snap2 + 1) * snap2; - - maxX = minX + w; - maxY = minY + h; - - w = 1 / w; - h = 1 / h; - - raw[0] = 2 * w; - raw[5] = 2 * h; - raw[10] = d; - raw[12] = -(maxX + minX) * w; - raw[13] = -(maxY + minY) * h; - raw[14] = -minZ * d; - raw[15] = 1; - raw[1] = raw[2] = raw[3] = raw[4] = raw[6] = raw[7] = raw[8] = raw[9] = raw[11] = 0; - - matrix.copyRawDataFrom(raw); - matrix.appendScale(.96, .96, 1); - matrix.appendTranslation(texOffsetX, texOffsetY, 0); - matrix.appendScale(.5, .5, 1); - }; - - CascadeShadowMapper.prototype.addEventListener = function (type, listener) { - this._changeDispatcher.addEventListener(type, listener); - }; - - CascadeShadowMapper.prototype.removeEventListener = function (type, listener) { - this._changeDispatcher.removeEventListener(type, listener); - }; - - CascadeShadowMapper.prototype.dispatchEvent = function (event) { - return this._changeDispatcher.dispatchEvent(event); - }; - - CascadeShadowMapper.prototype.hasEventListener = function (type) { - return this._changeDispatcher.hasEventListener(type); - }; - - Object.defineProperty(CascadeShadowMapper.prototype, "_iNearPlaneDistances", { - get: function () { - return this._nearPlaneDistances; - }, - enumerable: true, - configurable: true - }); - return CascadeShadowMapper; - })(materials.DirectionalShadowMapper); - materials.CascadeShadowMapper = CascadeShadowMapper; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var NearDirectionalShadowMapper = (function (_super) { - __extends(NearDirectionalShadowMapper, _super); - function NearDirectionalShadowMapper(coverageRatio) { - if (typeof coverageRatio === "undefined") { coverageRatio = .5; } - _super.call(this); - - this.coverageRatio = coverageRatio; - } - Object.defineProperty(NearDirectionalShadowMapper.prototype, "coverageRatio", { - /** - * A value between 0 and 1 to indicate the ratio of the view frustum that needs to be covered by the shadow map. - */ - get: function () { - return this._coverageRatio; - }, - set: function (value) { - if (value > 1) - value = 1; - else if (value < 0) - value = 0; - - this._coverageRatio = value; - }, - enumerable: true, - configurable: true - }); - - - NearDirectionalShadowMapper.prototype.pUpdateDepthProjection = function (viewCamera) { - var corners = viewCamera.projection.frustumCorners; - - for (var i = 0; i < 12; ++i) { - var v = corners[i]; - this._pLocalFrustum[i] = v; - this._pLocalFrustum[i + 12] = v + (corners[i + 12] - v) * this._coverageRatio; - } - - this.pUpdateProjectionFromFrustumCorners(viewCamera, this._pLocalFrustum, this._pMatrix); - this._pOverallDepthProjection.matrix = this._pMatrix; - }; - return NearDirectionalShadowMapper; - })(materials.DirectionalShadowMapper); - materials.NearDirectionalShadowMapper = NearDirectionalShadowMapper; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -/// -var away; -(function (away) { - /** - * The Billboard class represents display objects that represent bitmap images. - * These can be images that you load with the flash.Assets or - * flash.display.Loader classes, or they can be images that you - * create with the Billboard() constructor. - * - *

The Billboard() constructor allows you to create a Billboard - * object that contains a reference to a BitmapData object. After you create a - * Billboard object, use the addChild() or addChildAt() - * method of the parent DisplayObjectContainer instance to place the bitmap on - * the display list.

- * - *

A Billboard object can share its BitmapData reference among several Billboard - * objects, independent of translation or rotation properties. Because you can - * create multiple Billboard objects that reference the same BitmapData object, - * multiple display objects can use the same complex BitmapData object without - * incurring the memory overhead of a BitmapData object for each display - * object instance.

- * - *

A BitmapData object can be drawn to the screen by a Billboard object in one - * of two ways: by using the default hardware renderer with a single hardware surface, - * or by using the slower software renderer when 3D acceleration is not available.

- * - *

If you would prefer to perform a batch rendering command, rather than using a - * single surface for each Billboard object, you can also draw to the screen using the - * drawTiles() or drawTriangles() methods which are - * available to flash.display.Tilesheet and flash.display.Graphics - * objects.

- * - *

Note: The Billboard class is not a subclass of the InteractiveObject - * class, so it cannot dispatch mouse events. However, you can use the - * addEventListener() method of the display object container that - * contains the Billboard object.

- */ - (function (entities) { - var MaterialEvent = away.events.MaterialEvent; - - var Billboard = (function (_super) { - __extends(Billboard, _super); - function Billboard(material, pixelSnapping, smoothing) { - if (typeof pixelSnapping === "undefined") { pixelSnapping = "auto"; } - if (typeof smoothing === "undefined") { smoothing = false; } - var _this = this; - _super.call(this); - - this._pIsEntity = true; - - this.onSizeChangedDelegate = function (event) { - return _this.onSizeChanged(event); - }; - - this.material = material; - - this._billboardWidth = material.width; - this._billboardHeight = material.height; - } - Object.defineProperty(Billboard.prototype, "animator", { - /** - * Defines the animator of the mesh. Act on the mesh's geometry. Defaults to null - */ - get: function () { - return this._animator; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Billboard.prototype, "assetType", { - /** - * - */ - get: function () { - return away.library.AssetType.BILLBOARD; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Billboard.prototype, "billboardHeight", { - /** - * - */ - get: function () { - return this._billboardHeight; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Billboard.prototype, "billboardWidth", { - /** - * - */ - get: function () { - return this._billboardWidth; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Billboard.prototype, "material", { - /** - * - */ - get: function () { - return this._material; - }, - set: function (value) { - if (value == this._material) - return; - - if (this._material) { - this._material.iRemoveOwner(this); - this._material.removeEventListener(MaterialEvent.SIZE_CHANGED, this.onSizeChangedDelegate); - } - - this._material = value; - - if (this._material) { - this._material.iAddOwner(this); - this._material.addEventListener(MaterialEvent.SIZE_CHANGED, this.onSizeChangedDelegate); - } - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Billboard.prototype, "uvTransform", { - /** - * - */ - get: function () { - return this._uvTransform; - }, - set: function (value) { - this._uvTransform = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @protected - */ - Billboard.prototype.pCreateEntityPartitionNode = function () { - return new away.partition.EntityNode(this); - }; - - /** - * @protected - */ - Billboard.prototype.pUpdateBounds = function () { - this._pBounds.fromExtremes(0, 0, 0, this._billboardWidth, this._billboardHeight, 0); - - _super.prototype.pUpdateBounds.call(this); - }; - - /** - * //TODO - * - * @param shortestCollisionDistance - * @param findClosest - * @returns {boolean} - * - * @internal - */ - Billboard.prototype._iTestCollision = function (shortestCollisionDistance, findClosest) { - return this._pPickingCollider.testBillboardCollision(this, this._pPickingCollisionVO, shortestCollisionDistance); - }; - - /** - * @private - */ - Billboard.prototype.onSizeChanged = function (event) { - this._billboardWidth = this._material.width; - this._billboardHeight = this._material.height; - - this._pBoundsInvalid = true; - - var len = this._pRenderables.length; - for (var i = 0; i < len; i++) - this._pRenderables[i].invalidateVertexData("vertices"); //TODO - }; - - Billboard.prototype._iCollectRenderables = function (renderer) { - // Since this getter is invoked every iteration of the render loop, and - // the prefab construct could affect the sub-meshes, the prefab is - // validated here to give it a chance to rebuild. - if (this._iSourcePrefab) - this._iSourcePrefab._iValidate(); - - this._iCollectRenderable(renderer); - }; - - Billboard.prototype._iCollectRenderable = function (renderer) { - renderer.applyBillboard(this); - }; - return Billboard; - })(away.base.DisplayObject); - entities.Billboard = Billboard; - })(away.entities || (away.entities = {})); - var entities = away.entities; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (entities) { - var NullBounds = away.bounds.NullBounds; - - var Matrix3D = away.geom.Matrix3D; - var Vector3D = away.geom.Vector3D; - var DirectionalShadowMapper = away.materials.DirectionalShadowMapper; - var DirectionalLightNode = away.partition.DirectionalLightNode; - - var DirectionalLight = (function (_super) { - __extends(DirectionalLight, _super); - function DirectionalLight(xDir, yDir, zDir) { - if (typeof xDir === "undefined") { xDir = 0; } - if (typeof yDir === "undefined") { yDir = -1; } - if (typeof zDir === "undefined") { zDir = 1; } - _super.call(this); - - this._pIsEntity = true; - - this.direction = new Vector3D(xDir, yDir, zDir); - - this._sceneDirection = new Vector3D(); - } - Object.defineProperty(DirectionalLight.prototype, "sceneDirection", { - get: function () { - if (this._pSceneTransformDirty) - this.pUpdateSceneTransform(); - - return this._sceneDirection; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(DirectionalLight.prototype, "direction", { - get: function () { - return this._direction; - }, - set: function (value) { - this._direction = value; - - if (!this._tmpLookAt) - this._tmpLookAt = new Vector3D(); - - this._tmpLookAt.x = this.x + this._direction.x; - this._tmpLookAt.y = this.y + this._direction.y; - this._tmpLookAt.z = this.z + this._direction.z; - - this.lookAt(this._tmpLookAt); - }, - enumerable: true, - configurable: true - }); - - - /** - * - * @returns {away.bounds.NullBounds} - */ - DirectionalLight.prototype.pCreateDefaultBoundingVolume = function () { - //directional lights are to be considered global, hence always in view - return new NullBounds(); - }; - - /** - * - */ - DirectionalLight.prototype.pUpdateBounds = function () { - }; - - //@override - DirectionalLight.prototype.pUpdateSceneTransform = function () { - _super.prototype.pUpdateSceneTransform.call(this); - this.sceneTransform.copyColumnTo(2, this._sceneDirection); - this._sceneDirection.normalize(); - }; - - //@override - DirectionalLight.prototype.pCreateShadowMapper = function () { - return new DirectionalShadowMapper(); - }; - - /** - * @protected - */ - DirectionalLight.prototype.pCreateEntityPartitionNode = function () { - return new DirectionalLightNode(this); - }; - - //override - DirectionalLight.prototype.iGetObjectProjectionMatrix = function (entity, camera, target) { - if (typeof target === "undefined") { target = null; } - var raw = new Array(); - var bounds = entity.bounds; - var m = new Matrix3D(); - - m.copyFrom(entity.getRenderSceneTransform(camera)); - m.append(this.inverseSceneTransform); - - if (!this._projAABBPoints) - this._projAABBPoints = []; - - m.transformVectors(bounds.aabbPoints, this._projAABBPoints); - - var xMin = Infinity, xMax = -Infinity; - var yMin = Infinity, yMax = -Infinity; - var zMin = Infinity, zMax = -Infinity; - var d; - for (var i = 0; i < 24;) { - d = this._projAABBPoints[i++]; - - if (d < xMin) - xMin = d; - - if (d > xMax) - xMax = d; - - d = this._projAABBPoints[i++]; - - if (d < yMin) - yMin = d; - - if (d > yMax) - yMax = d; - - d = this._projAABBPoints[i++]; - - if (d < zMin) - zMin = d; - - if (d > zMax) - zMax = d; - } - - var invXRange = 1 / (xMax - xMin); - var invYRange = 1 / (yMax - yMin); - var invZRange = 1 / (zMax - zMin); - raw[0] = 2 * invXRange; - raw[5] = 2 * invYRange; - raw[10] = invZRange; - raw[12] = -(xMax + xMin) * invXRange; - raw[13] = -(yMax + yMin) * invYRange; - raw[14] = -zMin * invZRange; - raw[1] = raw[2] = raw[3] = raw[4] = raw[6] = raw[7] = raw[8] = raw[9] = raw[11] = 0; - raw[15] = 1; - - if (!target) - target = new Matrix3D(); - - target.copyRawDataFrom(raw); - target.prepend(m); - - return target; - }; - - DirectionalLight.prototype._iCollectRenderables = function (renderer) { - //nothing to do here - }; - return DirectionalLight; - })(away.base.LightBase); - entities.DirectionalLight = DirectionalLight; - })(away.entities || (away.entities = {})); - var entities = away.entities; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (entities) { - var NullBounds = away.bounds.NullBounds; - - var LightProbeNode = away.partition.LightProbeNode; - - var LightProbe = (function (_super) { - __extends(LightProbe, _super); - function LightProbe(diffuseMap, specularMap) { - if (typeof specularMap === "undefined") { specularMap = null; } - _super.call(this); - - this._pIsEntity = true; - - this._diffuseMap = diffuseMap; - this._specularMap = specularMap; - } - Object.defineProperty(LightProbe.prototype, "diffuseMap", { - get: function () { - return this._diffuseMap; - }, - set: function (value) { - this._diffuseMap = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(LightProbe.prototype, "specularMap", { - get: function () { - return this._specularMap; - }, - set: function (value) { - this._specularMap = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @protected - */ - LightProbe.prototype.pCreateEntityPartitionNode = function () { - return new LightProbeNode(this); - }; - - //@override - LightProbe.prototype.pUpdateBounds = function () { - this._pBoundsInvalid = false; - }; - - //@override - LightProbe.prototype.pCreateDefaultBoundingVolume = function () { - return new NullBounds(); - }; - - //@override - LightProbe.prototype.iGetObjectProjectionMatrix = function (entity, camera, target) { - if (typeof target === "undefined") { target = null; } - throw new away.errors.Error("Object projection matrices are not supported for LightProbe objects!"); - }; - - LightProbe.prototype._iCollectRenderables = function (renderer) { - //nothing to do here - }; - return LightProbe; - })(away.base.LightBase); - entities.LightProbe = LightProbe; - })(away.entities || (away.entities = {})); - var entities = away.entities; -})(away || (away = {})); -var away; -(function (away) { - (function (entities) { - var MaterialEvent = away.events.MaterialEvent; - - var EntityNode = away.partition.EntityNode; - - /** - * A Line Segment primitive. - */ - var LineSegment = (function (_super) { - __extends(LineSegment, _super); - /** - * Create a line segment - * - * @param startPosition Start position of the line segment - * @param endPosition Ending position of the line segment - * @param thickness Thickness of the line - */ - function LineSegment(material, startPosition, endPosition, thickness) { - if (typeof thickness === "undefined") { thickness = 1; } - var _this = this; - _super.call(this); - - this._pIsEntity = true; - - this.onSizeChangedDelegate = function (event) { - return _this.onSizeChanged(event); - }; - - this.material = material; - - this._startPosition = startPosition; - this._endPosition = endPosition; - this._halfThickness = thickness * 0.5; - } - Object.defineProperty(LineSegment.prototype, "animator", { - /** - * Defines the animator of the line segment. Act on the line segment's geometry. Defaults to null - */ - get: function () { - return this._animator; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LineSegment.prototype, "assetType", { - /** - * - */ - get: function () { - return away.library.AssetType.LINE_SEGMENT; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LineSegment.prototype, "startPostion", { - /** - * - */ - get: function () { - return this._startPosition; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LineSegment.prototype, "startPosition", { - set: function (value) { - if (this._startPosition == value) - return; - - this._startPosition = value; - - this.notifyRenderableUpdate(); - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LineSegment.prototype, "endPosition", { - /** - * - */ - get: function () { - return this._endPosition; - }, - set: function (value) { - if (this._endPosition == value) - return; - - this._endPosition = value; - - this.notifyRenderableUpdate(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(LineSegment.prototype, "material", { - /** - * - */ - get: function () { - return this._material; - }, - set: function (value) { - if (value == this._material) - return; - - if (this._material) { - this._material.iRemoveOwner(this); - this._material.removeEventListener(MaterialEvent.SIZE_CHANGED, this.onSizeChangedDelegate); - } - - this._material = value; - - if (this._material) { - this._material.iAddOwner(this); - this._material.addEventListener(MaterialEvent.SIZE_CHANGED, this.onSizeChangedDelegate); - } - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(LineSegment.prototype, "thickness", { - /** - * - */ - get: function () { - return this._halfThickness * 2; - }, - set: function (value) { - if (this._halfThickness == value) - return; - - this._halfThickness = value * 0.5; - - this.notifyRenderableUpdate(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(LineSegment.prototype, "uvTransform", { - /** - * - */ - get: function () { - return this._uvTransform; - }, - set: function (value) { - this._uvTransform = value; - }, - enumerable: true, - configurable: true - }); - - - LineSegment.prototype.dispose = function () { - this._startPosition = null; - this._endPosition = null; - }; - - /** - * @protected - */ - LineSegment.prototype.pCreateEntityPartitionNode = function () { - return new EntityNode(this); - }; - - /** - * @protected - */ - LineSegment.prototype.pUpdateBounds = function () { - this._pBounds.fromExtremes(this._startPosition.x, this._startPosition.y, this._startPosition.z, this._endPosition.x, this._endPosition.y, this._endPosition.z); - - _super.prototype.pUpdateBounds.call(this); - }; - - /** - * @private - */ - LineSegment.prototype.onSizeChanged = function (event) { - this.notifyRenderableUpdate(); - }; - - /** - * @private - */ - LineSegment.prototype.notifyRenderableUpdate = function () { - var len = this._pRenderables.length; - for (var i = 0; i < len; i++) - this._pRenderables[i].invalidateVertexData("vertices"); //TODO - }; - - LineSegment.prototype._iCollectRenderables = function (renderer) { - // Since this getter is invoked every iteration of the render loop, and - // the prefab construct could affect the sub-meshes, the prefab is - // validated here to give it a chance to rebuild. - if (this._iSourcePrefab) - this._iSourcePrefab._iValidate(); - - this._iCollectRenderable(renderer); - }; - - LineSegment.prototype._iCollectRenderable = function (renderer) { - //TODO - }; - return LineSegment; - })(away.base.DisplayObject); - entities.LineSegment = LineSegment; - })(away.entities || (away.entities = {})); - var entities = away.entities; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (entities) { - var Geometry = away.base.Geometry; - var GeometryEvent = away.events.GeometryEvent; - - /** - * Mesh is an instance of a Geometry, augmenting it with a presence in the scene graph, a material, and an animation - * state. It consists out of SubMeshes, which in turn correspond to SubGeometries. SubMeshes allow different parts - * of the geometry to be assigned different materials. - */ - var Mesh = (function (_super) { - __extends(Mesh, _super); - /** - * Create a new Mesh object. - * - * @param geometry The geometry used by the mesh that provides it with its shape. - * @param material [optional] The material with which to render the Mesh. - */ - function Mesh(geometry, material) { - if (typeof material === "undefined") { material = null; } - var _this = this; - _super.call(this); - this._castsShadows = true; - this._shareAnimationGeometry = true; - - this._pIsEntity = true; - - this._subMeshes = new Array(); - - this._onGeometryBoundsInvalidDelegate = function (event) { - return _this.onGeometryBoundsInvalid(event); - }; - this._onSubGeometryAddedDelegate = function (event) { - return _this.onSubGeometryAdded(event); - }; - this._onSubGeometryRemovedDelegate = function (event) { - return _this.onSubGeometryRemoved(event); - }; - - //this should never happen, but if people insist on trying to create their meshes before they have geometry to fill it, it becomes necessary - this.geometry = geometry || new Geometry(); - - this.material = material; - } - Object.defineProperty(Mesh.prototype, "animator", { - /** - * Defines the animator of the mesh. Act on the mesh's geometry. Default value is null. - */ - get: function () { - return this._animator; - }, - set: function (value) { - if (this._animator) - this._animator.removeOwner(this); - - this._animator = value; - - var len = this._subMeshes.length; - var subMesh; - - for (var i = 0; i < len; ++i) { - subMesh = this._subMeshes[i]; - - // cause material to be unregistered and registered again to work with the new animation type (if possible) - if (subMesh.material) { - subMesh.material.iRemoveOwner(subMesh); - subMesh.material.iAddOwner(subMesh); - } - - //invalidate any existing renderables in case they need to pull new geometry - subMesh._iInvalidateRenderableGeometry(); - } - - if (this._animator) - this._animator.addOwner(this); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Mesh.prototype, "assetType", { - /** - * - */ - get: function () { - return away.library.AssetType.MESH; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Mesh.prototype, "castsShadows", { - /** - * Indicates whether or not the Mesh can cast shadows. Default value is true. - */ - get: function () { - return this._castsShadows; - }, - set: function (value) { - this._castsShadows = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Mesh.prototype, "geometry", { - /** - * The geometry used by the mesh that provides it with its shape. - */ - get: function () { - if (this._iSourcePrefab) - this._iSourcePrefab._iValidate(); - - return this._geometry; - }, - set: function (value) { - var i; - - if (this._geometry) { - this._geometry.removeEventListener(GeometryEvent.BOUNDS_INVALID, this._onGeometryBoundsInvalidDelegate); - this._geometry.removeEventListener(GeometryEvent.SUB_GEOMETRY_ADDED, this._onSubGeometryAddedDelegate); - this._geometry.removeEventListener(GeometryEvent.SUB_GEOMETRY_REMOVED, this._onSubGeometryRemovedDelegate); - - for (i = 0; i < this._subMeshes.length; ++i) - this._subMeshes[i].dispose(); - - this._subMeshes.length = 0; - } - - this._geometry = value; - - if (this._geometry) { - this._geometry.addEventListener(GeometryEvent.BOUNDS_INVALID, this._onGeometryBoundsInvalidDelegate); - this._geometry.addEventListener(GeometryEvent.SUB_GEOMETRY_ADDED, this._onSubGeometryAddedDelegate); - this._geometry.addEventListener(GeometryEvent.SUB_GEOMETRY_REMOVED, this._onSubGeometryRemovedDelegate); - - var subGeoms = this._geometry.subGeometries; - - for (i = 0; i < subGeoms.length; ++i) - this.addSubMesh(subGeoms[i]); - } - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Mesh.prototype, "material", { - /** - * The material with which to render the Mesh. - */ - get: function () { - return this._material; - }, - set: function (value) { - if (value == this._material) - return; - - var i; - var len = this._subMeshes.length; - var subMesh; - - for (i = 0; i < len; i++) - if (this._material && (subMesh = this._subMeshes[i]).material == this._material) - this._material.iRemoveOwner(subMesh); - - this._material = value; - - for (i = 0; i < len; i++) - if (this._material && (subMesh = this._subMeshes[i]).material == this._material) - this._material.iAddOwner(subMesh); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Mesh.prototype, "shareAnimationGeometry", { - /** - * Indicates whether or not the mesh share the same animation geometry. - */ - get: function () { - return this._shareAnimationGeometry; - }, - set: function (value) { - this._shareAnimationGeometry = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Mesh.prototype, "subMeshes", { - /** - * The SubMeshes out of which the Mesh consists. Every SubMesh can be assigned a material to override the Mesh's - * material. - */ - get: function () { - // Since this getter is invoked every iteration of the render loop, and - // the prefab construct could affect the sub-meshes, the prefab is - // validated here to give it a chance to rebuild. - if (this._iSourcePrefab) - this._iSourcePrefab._iValidate(); - - return this._subMeshes; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Mesh.prototype, "uvTransform", { - /** - * - */ - get: function () { - return this._uvTransform; - }, - set: function (value) { - this._uvTransform = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * - */ - Mesh.prototype.bakeTransformations = function () { - this.geometry.applyTransformation(this._iMatrix3D); - this._iMatrix3D.identity(); - }; - - /** - * @inheritDoc - */ - Mesh.prototype.dispose = function () { - _super.prototype.dispose.call(this); - - this.material = null; - this.geometry = null; - }; - - /** - * Disposes mesh including the animator and children. This is a merely a convenience method. - * @return - */ - Mesh.prototype.disposeWithAnimatorAndChildren = function () { - this.disposeWithChildren(); - - if (this._animator) - this._animator.dispose(); - }; - - /** - * Clones this Mesh instance along with all it's children, while re-using the same - * material, geometry and animation set. The returned result will be a copy of this mesh, - * containing copies of all of it's children. - * - * Properties that are re-used (i.e. not cloned) by the new copy include name, - * geometry, and material. Properties that are cloned or created anew for the copy - * include subMeshes, children of the mesh, and the animator. - * - * If you want to copy just the mesh, reusing it's geometry and material while not - * cloning it's children, the simplest way is to create a new mesh manually: - * - * - * var clone : Mesh = new Mesh(original.geometry, original.material); - * - */ - Mesh.prototype.clone = function () { - var clone = new Mesh(this._geometry, this._material); - - clone._iMatrix3D = this._iMatrix3D; - clone.pivot = this.pivot; - clone.partition = this.partition; - clone.bounds = this.bounds.clone(); - - clone.name = this.name; - clone.castsShadows = this.castsShadows; - clone.shareAnimationGeometry = this.shareAnimationGeometry; - clone.mouseEnabled = this.mouseEnabled; - clone.mouseChildren = this.mouseChildren; - - //this is of course no proper cloning - //maybe use this instead?: http://blog.another-d-mention.ro/programming/how-to-clone-duplicate-an-object-in-actionscript-3/ - clone.extra = this.extra; - - var len = this._subMeshes.length; - for (var i = 0; i < len; ++i) - clone._subMeshes[i].material = this._subMeshes[i]._iGetExplicitMaterial(); - - len = this.numChildren; - var obj; - - for (i = 0; i < len; ++i) { - obj = this.getChildAt(i).clone(); - clone.addChild(obj); - } - - if (this._animator) - clone.animator = this._animator.clone(); - - return clone; - }; - - /** - * //TODO - * - * @param subGeometry - * @returns {SubMeshBase} - */ - Mesh.prototype.getSubMeshFromSubGeometry = function (subGeometry) { - return this._subMeshes[this._geometry.subGeometries.indexOf(subGeometry)]; - }; - - /** - * @protected - */ - Mesh.prototype.pCreateEntityPartitionNode = function () { - return new away.partition.EntityNode(this); - }; - - /** - * //TODO - * - * @protected - */ - Mesh.prototype.pUpdateBounds = function () { - this._pBounds.fromGeometry(this._geometry); - - _super.prototype.pUpdateBounds.call(this); - }; - - /** - * //TODO - * - * @private - */ - Mesh.prototype.onGeometryBoundsInvalid = function (event) { - this.pInvalidateBounds(); - }; - - /** - * Called when a SubGeometry was added to the Geometry. - * - * @private - */ - Mesh.prototype.onSubGeometryAdded = function (event) { - this.addSubMesh(event.subGeometry); - }; - - /** - * Called when a SubGeometry was removed from the Geometry. - * - * @private - */ - Mesh.prototype.onSubGeometryRemoved = function (event) { - var subMesh; - var subGeom = event.subGeometry; - var len = this._subMeshes.length; - var i; - - for (i = 0; i < len; ++i) { - subMesh = this._subMeshes[i]; - - if (subMesh.subGeometry == subGeom) { - subMesh.dispose(); - - this._subMeshes.splice(i, 1); - - break; - } - } - - --len; - for (; i < len; ++i) - this._subMeshes[i]._iIndex = i; - }; - - /** - * Adds a SubMeshBase wrapping a SubGeometry. - * - * @param subGeometry - */ - Mesh.prototype.addSubMesh = function (subGeometry) { - var SubMeshClass = subGeometry.subMeshClass; - - var subMesh = new SubMeshClass(subGeometry, this, null); - var len = this._subMeshes.length; - - subMesh._iIndex = len; - - this._subMeshes[len] = subMesh; - - this.pInvalidateBounds(); - }; - - /** - * //TODO - * - * @param shortestCollisionDistance - * @param findClosest - * @returns {boolean} - * - * @internal - */ - Mesh.prototype._iTestCollision = function (shortestCollisionDistance, findClosest) { - return this._pPickingCollider.testMeshCollision(this, this._pPickingCollisionVO, shortestCollisionDistance, findClosest); - }; - - /** - * - * @param renderer - * - * @internal - */ - Mesh.prototype._iCollectRenderables = function (renderer) { - // Since this getter is invoked every iteration of the render loop, and - // the prefab construct could affect the sub-meshes, the prefab is - // validated here to give it a chance to rebuild. - if (this._iSourcePrefab) - this._iSourcePrefab._iValidate(); - - var len = this._subMeshes.length; - for (var i = 0; i < len; i++) - this._subMeshes[i]._iCollectRenderable(renderer); - }; - - Mesh.prototype._iInvalidateRenderableGeometries = function () { - var len = this._subMeshes.length; - for (var i = 0; i < len; ++i) - this._subMeshes[i]._iInvalidateRenderableGeometry(); - }; - return Mesh; - })(away.containers.DisplayObjectContainer); - entities.Mesh = Mesh; - })(away.entities || (away.entities = {})); - var entities = away.entities; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (entities) { - var BoundingSphere = away.bounds.BoundingSphere; - - var Matrix3D = away.geom.Matrix3D; - var Vector3D = away.geom.Vector3D; - var CubeMapShadowMapper = away.materials.CubeMapShadowMapper; - - var PointLightNode = away.partition.PointLightNode; - - var PointLight = (function (_super) { - __extends(PointLight, _super); - function PointLight() { - _super.call(this); - this._pRadius = 90000; - this._pFallOff = 100000; - - this._pIsEntity = true; - - this._pFallOffFactor = 1 / (this._pFallOff * this._pFallOff - this._pRadius * this._pRadius); - } - PointLight.prototype.pCreateShadowMapper = function () { - return new CubeMapShadowMapper(); - }; - - Object.defineProperty(PointLight.prototype, "radius", { - get: function () { - return this._pRadius; - }, - set: function (value) { - this._pRadius = value; - - if (this._pRadius < 0) { - this._pRadius = 0; - } else if (this._pRadius > this._pFallOff) { - this._pFallOff = this._pRadius; - this.pInvalidateBounds(); - } - this._pFallOffFactor = 1 / (this._pFallOff * this._pFallOff - this._pRadius * this._pRadius); - }, - enumerable: true, - configurable: true - }); - - - PointLight.prototype.iFallOffFactor = function () { - return this._pFallOffFactor; - }; - - Object.defineProperty(PointLight.prototype, "fallOff", { - get: function () { - return this._pFallOff; - }, - set: function (value) { - this._pFallOff = value; - - if (this._pFallOff < 0) - this._pFallOff = 0; - - if (this._pFallOff < this._pRadius) - this._pRadius = this._pFallOff; - - this._pFallOffFactor = 1 / (this._pFallOff * this._pFallOff - this._pRadius * this._pRadius); - this.pInvalidateBounds(); - }, - enumerable: true, - configurable: true - }); - - - /** - * @protected - */ - PointLight.prototype.pCreateEntityPartitionNode = function () { - return new PointLightNode(this); - }; - - PointLight.prototype.pUpdateBounds = function () { - this._pBounds.fromSphere(new Vector3D(), this._pFallOff); - this._pBoundsInvalid = false; - }; - - PointLight.prototype.pCreateDefaultBoundingVolume = function () { - //point lights are culled based on their falloff radius - return new BoundingSphere(); - }; - - PointLight.prototype.iGetObjectProjectionMatrix = function (entity, camera, target) { - if (typeof target === "undefined") { target = null; } - var raw = new Array(16); - var bounds = entity.bounds; - var m = new Matrix3D(); - - // todo: do not use lookAt on Light - m.copyFrom(entity.getRenderSceneTransform(camera)); - m.append(this._pParent.inverseSceneTransform); - this.lookAt(m.position); - - m.copyFrom(entity.getRenderSceneTransform(camera)); - m.append(this.inverseSceneTransform); - - var box = bounds.aabb; - var v1 = m.deltaTransformVector(new Vector3D(box.left, box.bottom, box.front)); - var v2 = m.deltaTransformVector(new Vector3D(box.right, box.top, box.back)); - var d1 = v1.x * v1.x + v1.y * v1.y + v1.z * v1.z; - var d2 = v2.x * v2.x + v2.y * v2.y + v2.z * v2.z; - var d = Math.sqrt(d1 > d2 ? d1 : d2); - var zMin; - var zMax; - - var z = m.rawData[14]; - zMin = z - d; - zMax = z + d; - - raw[5] = raw[0] = zMin / d; - raw[10] = zMax / (zMax - zMin); - raw[11] = 1; - raw[1] = raw[2] = raw[3] = raw[4] = raw[6] = raw[7] = raw[8] = raw[9] = raw[12] = raw[13] = raw[15] = 0; - raw[14] = -zMin * raw[10]; - - if (!target) - target = new Matrix3D(); - - target.copyRawDataFrom(raw); - target.prepend(m); - - return target; - }; - - PointLight.prototype._iCollectRenderables = function (renderer) { - //nothing to do here - }; - return PointLight; - })(away.base.LightBase); - entities.PointLight = PointLight; - })(away.entities || (away.entities = {})); - var entities = away.entities; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * This class is used to create lightweight shapes using the ActionScript - * drawing application program interface(API). The Shape class includes a - * graphics property, which lets you access methods from the - * Graphics class. - * - *

The Sprite class also includes a graphicsproperty, and it - * includes other features not available to the Shape class. For example, a - * Sprite object is a display object container, whereas a Shape object is not - * (and cannot contain child display objects). For this reason, Shape objects - * consume less memory than Sprite objects that contain the same graphics. - * However, a Sprite object supports user input events, while a Shape object - * does not.

- */ - (function (entities) { - var Shape = (function (_super) { - __extends(Shape, _super); - /** - * Creates a new Shape object. - */ - function Shape() { - _super.call(this); - } - Object.defineProperty(Shape.prototype, "graphics", { - /** - * Specifies the Graphics object belonging to this Shape object, where vector - * drawing commands can occur. - */ - get: function () { - return this._graphics; - }, - enumerable: true, - configurable: true - }); - return Shape; - })(away.base.DisplayObject); - entities.Shape = Shape; - })(away.entities || (away.entities = {})); - var entities = away.entities; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (entities) { - var NullBounds = away.bounds.NullBounds; - - var SkyboxNode = away.partition.SkyboxNode; - - /** - * A Skybox class is used to render a sky in the scene. It's always considered static and 'at infinity', and as - * such it's always centered at the camera's position and sized to exactly fit within the camera's frustum, ensuring - * the sky box is always as large as possible without being clipped. - */ - var Skybox = (function (_super) { - __extends(Skybox, _super); - /** - * Create a new Skybox object. - * - * @param material The material with which to render the Skybox. - */ - function Skybox(material) { - _super.call(this); - - this._pIsEntity = true; - - this.material = material; - } - Object.defineProperty(Skybox.prototype, "animator", { - get: function () { - return this._animator; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Skybox.prototype, "uvTransform", { - /** - * - */ - get: function () { - return this._uvTransform; - }, - set: function (value) { - this._uvTransform = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Skybox.prototype, "material", { - /** - * The material with which to render the Skybox. - */ - get: function () { - return this._material; - }, - set: function (value) { - if (value == this._material) - return; - - if (this._material) - this._material.iRemoveOwner(this); - - this._material = value; - - if (this._material) - this._material.iAddOwner(this); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Skybox.prototype, "assetType", { - get: function () { - return away.library.AssetType.SKYBOX; - }, - enumerable: true, - configurable: true - }); - - /** - * @protected - */ - Skybox.prototype.pInvalidateBounds = function () { - // dead end - }; - - /** - * @protected - */ - Skybox.prototype.pCreateEntityPartitionNode = function () { - return new SkyboxNode(this); - }; - - /** - * @protected - */ - Skybox.prototype.pCreateDefaultBoundingVolume = function () { - return new NullBounds(); - }; - - /** - * @protected - */ - Skybox.prototype.pUpdateBounds = function () { - this._pBoundsInvalid = false; - }; - - Object.defineProperty(Skybox.prototype, "castsShadows", { - get: function () { - return false; - }, - enumerable: true, - configurable: true - }); - - Skybox.prototype._iCollectRenderables = function (renderer) { - //skybox do not get collected in the standard entity list - }; - - Skybox.prototype._iCollectRenderable = function (renderer) { - }; - return Skybox; - })(away.base.DisplayObject); - entities.Skybox = Skybox; - })(away.entities || (away.entities = {})); - var entities = away.entities; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * The TextField class is used to create display objects for text display and - * input. You can use the TextField class to - * perform low-level text rendering. However, in Flex, you typically use the - * Label, Text, TextArea, and TextInput controls to process text. You can give a text field an instance name in the - * Property inspector and use the methods and properties of the TextField - * class to manipulate it with ActionScript. TextField instance names are - * displayed in the Movie Explorer and in the Insert Target Path dialog box in - * the Actions panel. - * - *

To create a text field dynamically, use the TextField() - * constructor.

- * - *

The methods of the TextField class let you set, select, and manipulate - * text in a dynamic or input text field that you create during authoring or - * at runtime.

- * - *

ActionScript provides several ways to format your text at runtime. The - * TextFormat class lets you set character and paragraph formatting for - * TextField objects. You can apply Cascading Style Sheets(CSS) styles to - * text fields by using the TextField.styleSheet property and the - * StyleSheet class. You can use CSS to style built-in HTML tags, define new - * formatting tags, or apply styles. You can assign HTML formatted text, which - * optionally uses CSS styles, directly to a text field. HTML text that you - * assign to a text field can contain embedded media(movie clips, SWF files, - * GIF files, PNG files, and JPEG files). The text wraps around the embedded - * media in the same way that a web browser wraps text around media embedded - * in an HTML document.

- * - *

Flash Player supports a subset of HTML tags that you can use to format - * text. See the list of supported HTML tags in the description of the - * htmlText property.

- * - * @event change Dispatched after a control value is - * modified, unlike the - * textInput event, which is - * dispatched before the value is modified. - * Unlike the W3C DOM Event Model version of - * the change event, which - * dispatches the event only after the - * control loses focus, the ActionScript 3.0 - * version of the change event - * is dispatched any time the control - * changes. For example, if a user types text - * into a text field, a change - * event is dispatched after every keystroke. - * @event link Dispatched when a user clicks a hyperlink - * in an HTML-enabled text field, where the - * URL begins with "event:". The remainder of - * the URL after "event:" is placed in the - * text property of the LINK event. - * - *

Note: The default behavior, - * adding the text to the text field, occurs - * only when Flash Player generates the - * event, which in this case happens when a - * user attempts to input text. You cannot - * put text into a text field by sending it - * textInput events.

- * @event scroll Dispatched by a TextField object - * after the user scrolls. - * @event textInput Flash Player dispatches the - * textInput event when a user - * enters one or more characters of text. - * Various text input methods can generate - * this event, including standard keyboards, - * input method editors(IMEs), voice or - * speech recognition systems, and even the - * act of pasting plain text with no - * formatting or style information. - * @event textInteractionModeChange Flash Player dispatches the - * textInteractionModeChange - * event when a user changes the interaction - * mode of a text field. for example on - * Android, one can toggle from NORMAL mode - * to SELECTION mode using context menu - * options - */ - (function (entities) { - var TextField = (function (_super) { - __extends(TextField, _super); - /** - * Creates a new TextField instance. After you create the TextField instance, - * call the addChild() or addChildAt() method of - * the parent DisplayObjectContainer object to add the TextField instance to - * the display list. - * - *

The default size for a text field is 100 x 100 pixels.

- */ - function TextField() { - _super.call(this); - this._text = ""; - } - Object.defineProperty(TextField.prototype, "bottomScrollV", { - /** - * An integer(1-based index) that indicates the bottommost line that is - * currently visible in the specified text field. Think of the text field as - * a window onto a block of text. The scrollV property is the - * 1-based index of the topmost visible line in the window. - * - *

All the text between the lines indicated by scrollV and - * bottomScrollV is currently visible in the text field.

- */ - get: function () { - return this._bottomScrollV; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TextField.prototype, "caretIndex", { - /** - * The index of the insertion point(caret) position. If no insertion point - * is displayed, the value is the position the insertion point would be if - * you restored focus to the field(typically where the insertion point last - * was, or 0 if the field has not had focus). - * - *

Selection span indexes are zero-based(for example, the first position - * is 0, the second position is 1, and so on).

- */ - get: function () { - return this._caretIndex; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TextField.prototype, "length", { - /** - * The number of characters in a text field. A character such as tab - * (\t) counts as one character. - */ - get: function () { - return this._length; - }, - enumerable: true, - configurable: true - }); - - /** - * The maximum value of scrollH. - */ - TextField.prototype.maxScrollH = function () { - return this._maxScrollH; - }; - - /** - * The maximum value of scrollV. - */ - TextField.prototype.maxScrollV = function () { - return this._maxScrollV; - }; - - Object.defineProperty(TextField.prototype, "numLines", { - /** - * Defines the number of text lines in a multiline text field. If - * wordWrap property is set to true, the number of - * lines increases when text wraps. - */ - get: function () { - return this._numLines; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TextField.prototype, "selectionBeginIndex", { - /** - * The zero-based character index value of the first character in the current - * selection. For example, the first character is 0, the second character is - * 1, and so on. If no text is selected, this property is the value of - * caretIndex. - */ - get: function () { - return this._selectionBeginIndex; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TextField.prototype, "selectionEndIndex", { - /** - * The zero-based character index value of the last character in the current - * selection. For example, the first character is 0, the second character is - * 1, and so on. If no text is selected, this property is the value of - * caretIndex. - */ - get: function () { - return this._selectionEndIndex; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TextField.prototype, "text", { - /** - * A string that is the current text in the text field. Lines are separated - * by the carriage return character('\r', ASCII 13). This - * property contains unformatted text in the text field, without HTML tags. - * - *

To get the text in HTML form, use the htmlText - * property.

- */ - get: function () { - return this._text; - }, - set: function (value) { - if (this._text == value) - return; - - this._text = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TextField.prototype, "textHeight", { - /** - * The height of the text in pixels. - */ - get: function () { - return this._textHeight; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TextField.prototype, "textInteractionMode", { - /** - * The interaction mode property, Default value is - * TextInteractionMode.NORMAL. On mobile platforms, the normal mode implies - * that the text can be scrolled but not selected. One can switch to the - * selectable mode through the in-built context menu on the text field. On - * Desktop, the normal mode implies that the text is in scrollable as well as - * selection mode. - */ - get: function () { - return this._textInteractionMode; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TextField.prototype, "textWidth", { - /** - * The width of the text in pixels. - */ - get: function () { - return this._textWidth; - }, - enumerable: true, - configurable: true - }); - - /** - * Appends the string specified by the newText parameter to the - * end of the text of the text field. This method is more efficient than an - * addition assignment(+=) on a text property - * (such as someTextField.text += moreText), particularly for a - * text field that contains a significant amount of content. - * - * @param newText The string to append to the existing text. - */ - TextField.prototype.appendText = function (newText) { - //TODO - }; - - /** - * Returns a rectangle that is the bounding box of the character. - * - * @param charIndex The zero-based index value for the character(for - * example, the first position is 0, the second position is - * 1, and so on). - * @return A rectangle with x and y minimum and - * maximum values defining the bounding box of the character. - */ - TextField.prototype.getCharBoundaries = function (charIndex) { - return this._charBoundaries; - }; - - /** - * Returns the zero-based index value of the character at the point specified - * by the x and y parameters. - * - * @param x The x coordinate of the character. - * @param y The y coordinate of the character. - * @return The zero-based index value of the character(for example, the - * first position is 0, the second position is 1, and so on). Returns - * -1 if the point is not over any character. - */ - TextField.prototype.getCharIndexAtPoint = function (x, y) { - return this._charIndexAtPoint; - }; - - /** - * Given a character index, returns the index of the first character in the - * same paragraph. - * - * @param charIndex The zero-based index value of the character(for example, - * the first character is 0, the second character is 1, and - * so on). - * @return The zero-based index value of the first character in the same - * paragraph. - * @throws RangeError The character index specified is out of range. - */ - TextField.prototype.getFirstCharInParagraph = function (charIndex /*int*/ ) { - return this._firstCharInParagraph; - }; - - /** - * Returns a DisplayObject reference for the given id, for an - * image or SWF file that has been added to an HTML-formatted text field by - * using an tag. The tag is in the - * following format: - * - *

 

- * - * @param id The id to match(in the id attribute - * of the tag). - * @return The display object corresponding to the image or SWF file with the - * matching id attribute in the tag - * of the text field. For media loaded from an external source, this - * object is a Loader object, and, once loaded, the media object is a - * child of that Loader object. For media embedded in the SWF file, - * it is the loaded object. If no tag with the - * matching id exists, the method returns - * null. - */ - TextField.prototype.getImageReference = function (id) { - return this._imageReference; - }; - - /** - * Returns the zero-based index value of the line at the point specified by - * the x and y parameters. - * - * @param x The x coordinate of the line. - * @param y The y coordinate of the line. - * @return The zero-based index value of the line(for example, the first - * line is 0, the second line is 1, and so on). Returns -1 if the - * point is not over any line. - */ - TextField.prototype.getLineIndexAtPoint = function (x, y) { - return this._lineIndexAtPoint; - }; - - /** - * Returns the zero-based index value of the line containing the character - * specified by the charIndex parameter. - * - * @param charIndex The zero-based index value of the character(for example, - * the first character is 0, the second character is 1, and - * so on). - * @return The zero-based index value of the line. - * @throws RangeError The character index specified is out of range. - */ - TextField.prototype.getLineIndexOfChar = function (charIndex /*int*/ ) { - return this._lineIndexOfChar; - }; - - /** - * Returns the number of characters in a specific text line. - * - * @param lineIndex The line number for which you want the length. - * @return The number of characters in the line. - * @throws RangeError The line number specified is out of range. - */ - TextField.prototype.getLineLength = function (lineIndex /*int*/ ) { - return this._lineLength; - }; - - /** - * Returns metrics information about a given text line. - * - * @param lineIndex The line number for which you want metrics information. - * @return A TextLineMetrics object. - * @throws RangeError The line number specified is out of range. - */ - TextField.prototype.getLineMetrics = function (lineIndex /*int*/ ) { - return this._lineMetrics; - }; - - /** - * Returns the character index of the first character in the line that the - * lineIndex parameter specifies. - * - * @param lineIndex The zero-based index value of the line(for example, the - * first line is 0, the second line is 1, and so on). - * @return The zero-based index value of the first character in the line. - * @throws RangeError The line number specified is out of range. - */ - TextField.prototype.getLineOffset = function (lineIndex /*int*/ ) { - return this._lineOffset; - }; - - /** - * Returns the text of the line specified by the lineIndex - * parameter. - * - * @param lineIndex The zero-based index value of the line(for example, the - * first line is 0, the second line is 1, and so on). - * @return The text string contained in the specified line. - * @throws RangeError The line number specified is out of range. - */ - TextField.prototype.getLineText = function (lineIndex /*int*/ ) { - return this._lineText; - }; - - /** - * Given a character index, returns the length of the paragraph containing - * the given character. The length is relative to the first character in the - * paragraph(as returned by getFirstCharInParagraph()), not to - * the character index passed in. - * - * @param charIndex The zero-based index value of the character(for example, - * the first character is 0, the second character is 1, and - * so on). - * @return Returns the number of characters in the paragraph. - * @throws RangeError The character index specified is out of range. - */ - TextField.prototype.getParagraphLength = function (charIndex /*int*/ ) { - return this._paragraphLength; - }; - - /** - * Returns a TextFormat object that contains formatting information for the - * range of text that the beginIndex and endIndex - * parameters specify. Only properties that are common to the entire text - * specified are set in the resulting TextFormat object. Any property that is - * mixed, meaning that it has different values at different points in - * the text, has a value of null. - * - *

If you do not specify values for these parameters, this method is - * applied to all the text in the text field.

- * - *

The following table describes three possible usages:

- * - * @return The TextFormat object that represents the formatting properties - * for the specified text. - * @throws RangeError The beginIndex or endIndex - * specified is out of range. - */ - TextField.prototype.getTextFormat = function (beginIndex, endIndex) { - if (typeof beginIndex === "undefined") { beginIndex = -1; } - if (typeof endIndex === "undefined") { endIndex = -1; } - return this._textFormat; - }; - - /** - * Replaces the current selection with the contents of the value - * parameter. The text is inserted at the position of the current selection, - * using the current default character format and default paragraph format. - * The text is not treated as HTML. - * - *

You can use the replaceSelectedText() method to insert and - * delete text without disrupting the character and paragraph formatting of - * the rest of the text.

- * - *

Note: This method does not work if a style sheet is applied to - * the text field.

- * - * @param value The string to replace the currently selected text. - * @throws Error This method cannot be used on a text field with a style - * sheet. - */ - TextField.prototype.replaceSelectedText = function (value) { - }; - - /** - * Replaces the range of characters that the beginIndex and - * endIndex parameters specify with the contents of the - * newText parameter. As designed, the text from - * beginIndex to endIndex-1 is replaced. - * - *

Note: This method does not work if a style sheet is applied to - * the text field.

- * - * @param beginIndex The zero-based index value for the start position of the - * replacement range. - * @param endIndex The zero-based index position of the first character - * after the desired text span. - * @param newText The text to use to replace the specified range of - * characters. - * @throws Error This method cannot be used on a text field with a style - * sheet. - */ - TextField.prototype.replaceText = function (beginIndex /*int*/ , endIndex /*int*/ , newText) { - }; - - /** - * Sets as selected the text designated by the index values of the first and - * last characters, which are specified with the beginIndex and - * endIndex parameters. If the two parameter values are the - * same, this method sets the insertion point, as if you set the - * caretIndex property. - * - * @param beginIndex The zero-based index value of the first character in the - * selection(for example, the first character is 0, the - * second character is 1, and so on). - * @param endIndex The zero-based index value of the last character in the - * selection. - */ - TextField.prototype.setSelection = function (beginIndex /*int*/ , endIndex /*int*/ ) { - }; - - /** - * Applies the text formatting that the format parameter - * specifies to the specified text in a text field. The value of - * format must be a TextFormat object that specifies the desired - * text formatting changes. Only the non-null properties of - * format are applied to the text field. Any property of - * format that is set to null is not applied. By - * default, all of the properties of a newly created TextFormat object are - * set to null. - * - *

Note: This method does not work if a style sheet is applied to - * the text field.

- * - *

The setTextFormat() method changes the text formatting - * applied to a range of characters or to the entire body of text in a text - * field. To apply the properties of format to all text in the text field, do - * not specify values for beginIndex and endIndex. - * To apply the properties of the format to a range of text, specify values - * for the beginIndex and the endIndex parameters. - * You can use the length property to determine the index - * values.

- * - *

The two types of formatting information in a TextFormat object are - * character level formatting and paragraph level formatting. Each character - * in a text field can have its own character formatting settings, such as - * font name, font size, bold, and italic.

- * - *

For paragraphs, the first character of the paragraph is examined for - * the paragraph formatting settings for the entire paragraph. Examples of - * paragraph formatting settings are left margin, right margin, and - * indentation.

- * - *

Any text inserted manually by the user, or replaced by the - * replaceSelectedText() method, receives the default text field - * formatting for new text, and not the formatting specified for the text - * insertion point. To set the default formatting for new text, use - * defaultTextFormat.

- * - * @param format A TextFormat object that contains character and paragraph - * formatting information. - * @throws Error This method cannot be used on a text field with a style - * sheet. - * @throws RangeError The beginIndex or endIndex - * specified is out of range. - */ - TextField.prototype.setTextFormat = function (format, beginIndex, endIndex) { - if (typeof beginIndex === "undefined") { beginIndex = -1; } - if (typeof endIndex === "undefined") { endIndex = -1; } - }; - - /** - * Returns true if an embedded font is available with the specified - * fontName and fontStyle where - * Font.fontType is flash.text.FontType.EMBEDDED. - * Starting with Flash Player 10, two kinds of embedded fonts can appear in a - * SWF file. Normal embedded fonts are only used with TextField objects. CFF - * embedded fonts are only used with the flash.text.engine classes. The two - * types are distinguished by the fontType property of the - * Font class, as returned by the enumerateFonts() - * function. - * - *

TextField cannot use a font of type EMBEDDED_CFF. If - * embedFonts is set to true and the only font - * available at run time with the specified name and style is of type - * EMBEDDED_CFF, Flash Player fails to render the text, as if no - * embedded font were available with the specified name and style.

- * - *

If both EMBEDDED and EMBEDDED_CFF fonts are - * available with the same name and style, the EMBEDDED font is - * selected and text renders with the EMBEDDED font.

- * - * @param fontName The name of the embedded font to check. - * @param fontStyle Specifies the font style to check. Use - * flash.text.FontStyle - * @return true if a compatible embedded font is available, - * otherwise false. - * @throws ArgumentError The fontStyle specified is not a member - * of flash.text.FontStyle. - */ - TextField.isFontCompatible = function (fontName, fontStyle) { - return false; - }; - return TextField; - })(away.base.DisplayObject); - entities.TextField = TextField; - })(away.entities || (away.entities = {})); - var entities = away.entities; -})(away || (away = {})); -/// -var away; -(function (away) { - // Reference note: http://www.w3schools.com/jsref/dom_obj_event.asp - (function (managers) { - /** - * MouseManager enforces a singleton pattern and is not intended to be instanced. - * it provides a manager class for detecting mouse hits on scene objects and sending out mouse events. - */ - var MouseManager = (function () { - /** - * Creates a new MouseManager object. - */ - function MouseManager() { - var _this = this; - this._viewLookup = new Array(); - this._nullVector = new away.geom.Vector3D(); - this._queuedEvents = new Array(); - this._mouseUp = new away.events.MouseEvent(away.events.MouseEvent.MOUSE_UP); - this._mouseClick = new away.events.MouseEvent(away.events.MouseEvent.CLICK); - this._mouseOut = new away.events.MouseEvent(away.events.MouseEvent.MOUSE_OUT); - this._mouseDown = new away.events.MouseEvent(away.events.MouseEvent.MOUSE_DOWN); - this._mouseMove = new away.events.MouseEvent(away.events.MouseEvent.MOUSE_MOVE); - this._mouseOver = new away.events.MouseEvent(away.events.MouseEvent.MOUSE_OVER); - this._mouseWheel = new away.events.MouseEvent(away.events.MouseEvent.MOUSE_WHEEL); - this._mouseDoubleClick = new away.events.MouseEvent(away.events.MouseEvent.DOUBLE_CLICK); - this.onClickDelegate = function (event) { - return _this.onClick(event); - }; - this.onDoubleClickDelegate = function (event) { - return _this.onDoubleClick(event); - }; - this.onMouseDownDelegate = function (event) { - return _this.onMouseDown(event); - }; - this.onMouseMoveDelegate = function (event) { - return _this.onMouseMove(event); - }; - this.onMouseUpDelegate = function (event) { - return _this.onMouseUp(event); - }; - this.onMouseWheelDelegate = function (event) { - return _this.onMouseWheel(event); - }; - this.onMouseOverDelegate = function (event) { - return _this.onMouseOver(event); - }; - this.onMouseOutDelegate = function (event) { - return _this.onMouseOut(event); - }; - } - MouseManager.getInstance = function () { - if (this._instance) - return this._instance; - - return (this._instance = new MouseManager()); - }; - - MouseManager.prototype.fireMouseEvents = function (forceMouseMove) { - // If colliding object has changed, queue over/out events. - if (this._iCollidingObject != this._previousCollidingObject) { - if (this._previousCollidingObject) - this.queueDispatch(this._mouseOut, this._mouseMoveEvent, this._previousCollidingObject); - - if (this._iCollidingObject) - this.queueDispatch(this._mouseOver, this._mouseMoveEvent); - } - - // Fire mouse move events here if forceMouseMove is on. - if (forceMouseMove && this._iCollidingObject) - this.queueDispatch(this._mouseMove, this._mouseMoveEvent); - - var event; - var dispatcher; - - // Dispatch all queued events. - var len = this._queuedEvents.length; - for (var i = 0; i < len; ++i) { - // Only dispatch from first implicitly enabled object ( one that is not a child of a mouseChildren = false hierarchy ). - event = this._queuedEvents[i]; - dispatcher = event.object; - - while (dispatcher && !dispatcher._iIsMouseEnabled()) - dispatcher = dispatcher.parent; - - if (dispatcher) - dispatcher.dispatchEvent(event); - } - - this._queuedEvents.length = 0; - - this._previousCollidingObject = this._iCollidingObject; - - this._iUpdateDirty = false; - }; - - // public addViewLayer(view:away.containers.View) - // { - // var stg:Stage = view.stage; - // - // // Add instance to mouse3dmanager to fire mouse events for multiple views - // if (!view.stageGL.mouse3DManager) - // view.stageGL.mouse3DManager = this; - // - // if (!hasKey(view)) - // _view3Ds[view] = 0; - // - // _childDepth = 0; - // traverseDisplayObjects(stg); - // _viewCount = _childDepth; - // } - MouseManager.prototype.registerView = function (view) { - view.htmlElement.addEventListener("click", this.onClickDelegate); - view.htmlElement.addEventListener("dblclick", this.onDoubleClickDelegate); - view.htmlElement.addEventListener("mousedown", this.onMouseDownDelegate); - view.htmlElement.addEventListener("mousemove", this.onMouseMoveDelegate); - view.htmlElement.addEventListener("mouseup", this.onMouseUpDelegate); - view.htmlElement.addEventListener("mousewheel", this.onMouseWheelDelegate); - view.htmlElement.addEventListener("mouseover", this.onMouseOverDelegate); - view.htmlElement.addEventListener("mouseout", this.onMouseOutDelegate); - - this._viewLookup.push(view); - }; - - MouseManager.prototype.unregisterView = function (view) { - view.htmlElement.removeEventListener("click", this.onClickDelegate); - view.htmlElement.removeEventListener("dblclick", this.onDoubleClickDelegate); - view.htmlElement.removeEventListener("mousedown", this.onMouseDownDelegate); - view.htmlElement.removeEventListener("mousemove", this.onMouseMoveDelegate); - view.htmlElement.removeEventListener("mouseup", this.onMouseUpDelegate); - view.htmlElement.removeEventListener("mousewheel", this.onMouseWheelDelegate); - view.htmlElement.removeEventListener("mouseover", this.onMouseOverDelegate); - view.htmlElement.removeEventListener("mouseout", this.onMouseOutDelegate); - - this._viewLookup.slice(this._viewLookup.indexOf(view), 1); - }; - - // --------------------------------------------------------------------- - // Private. - // --------------------------------------------------------------------- - MouseManager.prototype.queueDispatch = function (event, sourceEvent, collider) { - if (typeof collider === "undefined") { collider = null; } - // 2D properties. - if (sourceEvent) { - event.ctrlKey = sourceEvent.ctrlKey; - event.altKey = sourceEvent.altKey; - event.shiftKey = sourceEvent.shiftKey; - event.screenX = sourceEvent.clientX; - event.screenY = sourceEvent.clientY; - } - - if (collider == null) - collider = this._iCollidingObject; - - // 3D properties. - if (collider) { - // Object. - event.object = collider.displayObject; - event.materialOwner = collider.materialOwner; - - // UV. - event.uv = collider.uv; - - // Position. - event.localPosition = collider.localPosition ? collider.localPosition.clone() : null; - - // Normal. - event.localNormal = collider.localNormal ? collider.localNormal.clone() : null; - - // Face index. - event.index = collider.index; - } else { - // Set all to null. - event.uv = null; - event.object = null; - event.localPosition = this._nullVector; - event.localNormal = this._nullVector; - event.index = 0; - event.subGeometryIndex = 0; - } - - // Store event to be dispatched later. - this._queuedEvents.push(event); - }; - - // --------------------------------------------------------------------- - // Listeners. - // --------------------------------------------------------------------- - MouseManager.prototype.onMouseMove = function (event) { - this.updateColliders(event); - - if (this._iCollidingObject) - this.queueDispatch(this._mouseMove, this._mouseMoveEvent = event); - }; - - MouseManager.prototype.onMouseOut = function (event) { - this._iActiveDiv = null; - - this.updateColliders(event); - - if (this._iCollidingObject) - this.queueDispatch(this._mouseOut, event); - }; - - MouseManager.prototype.onMouseOver = function (event) { - this._iActiveDiv = event.target; - - this.updateColliders(event); - - if (this._iCollidingObject) - this.queueDispatch(this._mouseOver, event); - }; - - MouseManager.prototype.onClick = function (event) { - this.updateColliders(event); - - if (this._iCollidingObject) - this.queueDispatch(this._mouseClick, event); - }; - - MouseManager.prototype.onDoubleClick = function (event) { - this.updateColliders(event); - - if (this._iCollidingObject) - this.queueDispatch(this._mouseDoubleClick, event); - }; - - MouseManager.prototype.onMouseDown = function (event) { - this._iActiveDiv = event.target; - - this.updateColliders(event); - - if (this._iCollidingObject) - this.queueDispatch(this._mouseDown, event); - }; - - MouseManager.prototype.onMouseUp = function (event) { - this.updateColliders(event); - - if (this._iCollidingObject) - this.queueDispatch(this._mouseUp, event); - }; - - MouseManager.prototype.onMouseWheel = function (event) { - this.updateColliders(event); - - if (this._iCollidingObject) - this.queueDispatch(this._mouseWheel, event); - }; - - MouseManager.prototype.updateColliders = function (event) { - if (this._iUpdateDirty) - return; - - var view; - var bounds; - var mouseX = event.clientX; - var mouseY = event.clientY; - var len = this._viewLookup.length; - for (var i = 0; i < len; i++) { - view = this._viewLookup[i]; - bounds = view.htmlElement.getBoundingClientRect(); - if (mouseX < bounds.left || mouseX > bounds.right || mouseY < bounds.top || mouseY > bounds.bottom) { - view._pMouseX = null; - view._pMouseY = null; - } else { - view._pMouseX = mouseX + bounds.left; - view._pMouseY = mouseY + bounds.top; - view.updateCollider(); - - if (view.layeredView && this._iCollidingObject) - break; - } - } - - this._iUpdateDirty = true; - }; - return MouseManager; - })(); - managers.MouseManager = MouseManager; - })(away.managers || (away.managers = {})); - var managers = away.managers; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (managers) { - var Stage = away.base.Stage; - - var StageEvent = away.events.StageEvent; - - /** - * The StageManager class provides a multiton object that handles management for Stage objects. - * - * @see away.base.Stage - */ - var StageManager = (function (_super) { - __extends(StageManager, _super); - /** - * Creates a new StageManager class. - * @param stage The Stage object that contains the Stage objects to be managed. - * @private - */ - function StageManager(StageManagerSingletonEnforcer) { - var _this = this; - _super.call(this); - - if (!StageManagerSingletonEnforcer) - throw new Error("This class is a multiton and cannot be instantiated manually. Use StageManager.getInstance instead."); - - this._stages = new Array(StageManager.STAGE_MAX_QUANTITY); - - this._onContextCreatedDelegate = function (event) { - return _this.onContextCreated(event); - }; - } - /** - * Gets a StageManager instance for the given Stage object. - * @param stage The Stage object that contains the Stage objects to be managed. - * @return The StageManager instance for the given Stage object. - */ - StageManager.getInstance = function () { - if (this._instance == null) - this._instance = new StageManager(new StageManagerSingletonEnforcer()); - - return this._instance; - }; - - /** - * Requests the Stage for the given index. - * - * @param index The index of the requested Stage. - * @param forceSoftware Whether to force software mode even if hardware acceleration is available. - * @param profile The compatibility profile, an enumeration of ContextProfile - * @return The Stage for the given index. - */ - StageManager.prototype.getStageAt = function (index, forceSoftware, profile, mode) { - if (typeof forceSoftware === "undefined") { forceSoftware = false; } - if (typeof profile === "undefined") { profile = "baseline"; } - if (typeof mode === "undefined") { mode = "auto"; } - if (index < 0 || index >= StageManager.STAGE_MAX_QUANTITY) - throw new away.errors.ArgumentError("Index is out of bounds [0.." + StageManager.STAGE_MAX_QUANTITY + "]"); - - if (!this._stages[index]) { - StageManager._numStages++; - - var canvas = document.createElement("canvas"); - canvas.id = "stage" + index; - document.body.appendChild(canvas); - var stage = this._stages[index] = new Stage(canvas, index, this, forceSoftware, profile); - stage.addEventListener(StageEvent.CONTEXT_CREATED, this._onContextCreatedDelegate); - stage.requestContext(forceSoftware, profile, mode); - } - - return stage; - }; - - /** - * Removes a Stage from the manager. - * @param stage - * @private - */ - StageManager.prototype.iRemoveStage = function (stage) { - StageManager._numStages--; - - stage.removeEventListener(StageEvent.CONTEXT_CREATED, this._onContextCreatedDelegate); - - this._stages[stage.stageIndex] = null; - }; - - /** - * Get the next available stage. An error is thrown if there are no StageProxies available - * @param forceSoftware Whether to force software mode even if hardware acceleration is available. - * @param profile The compatibility profile, an enumeration of ContextProfile - * @return The allocated stage - */ - StageManager.prototype.getFreeStage = function (forceSoftware, profile, mode) { - if (typeof forceSoftware === "undefined") { forceSoftware = false; } - if (typeof profile === "undefined") { profile = "baseline"; } - if (typeof mode === "undefined") { mode = "auto"; } - var i = 0; - var len = this._stages.length; - - while (i < len) { - if (!this._stages[i]) - return this.getStageAt(i, forceSoftware, profile, mode); - - ++i; - } - - return null; - }; - - Object.defineProperty(StageManager.prototype, "hasFreeStage", { - /** - * Checks if a new stage can be created and managed by the class. - * @return true if there is one slot free for a new stage - */ - get: function () { - return StageManager._numStages < StageManager.STAGE_MAX_QUANTITY ? true : false; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(StageManager.prototype, "numSlotsFree", { - /** - * Returns the amount of stage objects that can be created and managed by the class - * @return the amount of free slots - */ - get: function () { - return StageManager.STAGE_MAX_QUANTITY - StageManager._numStages; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(StageManager.prototype, "numSlotsUsed", { - /** - * Returns the amount of Stage objects currently managed by the class. - * @return the amount of slots used - */ - get: function () { - return StageManager._numStages; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(StageManager.prototype, "numSlotsTotal", { - /** - * The maximum amount of Stage objects that can be managed by the class - */ - get: function () { - return this._stages.length; - }, - enumerable: true, - configurable: true - }); - - StageManager.prototype.onContextCreated = function (e) { - //var stage:Stage = e.target; - //document.body.appendChild(stage.canvas) - }; - StageManager.STAGE_MAX_QUANTITY = 8; - - StageManager._numStages = 0; - return StageManager; - })(away.events.EventDispatcher); - managers.StageManager = StageManager; - })(away.managers || (away.managers = {})); - var managers = away.managers; -})(away || (away = {})); - -var StageManagerSingletonEnforcer = (function () { - function StageManagerSingletonEnforcer() { - } - return StageManagerSingletonEnforcer; -})(); -/// -var away; -(function (away) { - /** - * The Loader class is used to load SWF files or image(JPG, PNG, or GIF) - * files. Use the load() method to initiate loading. The loaded - * display object is added as a child of the Loader object. - * - *

Use the URLLoader class to load text or binary data.

- * - *

The Loader class overrides the following methods that it inherits, - * because a Loader object can only have one child display object - the - * display object that it loads. Calling the following methods throws an - * exception: addChild(), addChildAt(), - * removeChild(), removeChildAt(), and - * setChildIndex(). To remove a loaded display object, you must - * remove the Loader object from its parent DisplayObjectContainer - * child array.

- * - *

Note: The ActionScript 2.0 MovieClipLoader and LoadVars classes - * are not used in ActionScript 3.0. The Loader and URLLoader classes replace - * them.

- * - *

When you use the Loader class, consider the Flash Player and Adobe AIR - * security model:

- * - *
    - *
  • You can load content from any accessible source.
  • - *
  • Loading is not allowed if the calling SWF file is in a network - * sandbox and the file to be loaded is local.
  • - *
  • If the loaded content is a SWF file written with ActionScript 3.0, it - * cannot be cross-scripted by a SWF file in another security sandbox unless - * that cross-scripting arrangement was approved through a call to the - * System.allowDomain() or the - * System.allowInsecureDomain() method in the loaded content - * file.
  • - *
  • If the loaded content is an AVM1 SWF file(written using ActionScript - * 1.0 or 2.0), it cannot be cross-scripted by an AVM2 SWF file(written using - * ActionScript 3.0). However, you can communicate between the two SWF files - * by using the LocalConnection class.
  • - *
  • If the loaded content is an image, its data cannot be accessed by a - * SWF file outside of the security sandbox, unless the domain of that SWF - * file was included in a URL policy file at the origin domain of the - * image.
  • - *
  • Movie clips in the local-with-file-system sandbox cannot script movie - * clips in the local-with-networking sandbox, and the reverse is also - * prevented.
  • - *
  • You cannot connect to commonly reserved ports. For a complete list of - * blocked ports, see "Restricting Networking APIs" in the ActionScript 3.0 - * Developer's Guide.
  • - *
- * - *

However, in AIR, content in the application security - * sandbox(content installed with the AIR application) are not restricted by - * these security limitations.

- * - *

For more information related to security, see the Flash Player Developer - * Center Topic: Security.

- * - *

When loading a SWF file from an untrusted source(such as a domain other - * than that of the Loader object's root SWF file), you may want to define a - * mask for the Loader object, to prevent the loaded content(which is a child - * of the Loader object) from drawing to portions of the Stage outside of that - * mask, as shown in the following code:

- */ - (function (containers) { - var AssetEvent = away.events.AssetEvent; - - var IOErrorEvent = away.events.IOErrorEvent; - var LoaderEvent = away.events.LoaderEvent; - var ParserEvent = away.events.ParserEvent; - var AssetLoader = away.library.AssetLoader; - - /** - * Dispatched when any asset finishes parsing. Also see specific events for each - * individual asset type (meshes, materials et c.) - * - * @eventType away3d.events.AssetEvent - */ - //[Event(name="assetComplete", type="away3d.events.AssetEvent")] - /** - * Dispatched when a full resource (including dependencies) finishes loading. - * - * @eventType away3d.events.LoaderEvent - */ - //[Event(name="resourceComplete", type="away3d.events.LoaderEvent")] - var Loader = (function (_super) { - __extends(Loader, _super); - /** - * Creates a Loader object that you can use to load files, such as SWF, JPEG, - * GIF, or PNG files. Call the load() method to load the asset - * as a child of the Loader instance. You can then add the Loader object to - * the display list(for instance, by using the addChild() - * method of a DisplayObjectContainer instance). The asset appears on the - * Stage as it loads. - * - *

You can also use a Loader instance "offlist," that is without adding it - * to a display object container on the display list. In this mode, the - * Loader instance might be used to load a SWF file that contains additional - * modules of an application.

- * - *

To detect when the SWF file is finished loading, you can use the events - * of the LoaderInfo object associated with the - * contentLoaderInfo property of the Loader object. At that - * point, the code in the module SWF file can be executed to initialize and - * start the module. In the offlist mode, a Loader instance might also be - * used to load a SWF file that contains components or media assets. Again, - * you can use the LoaderInfo object event notifications to detect when the - * components are finished loading. At that point, the application can start - * using the components and media assets in the library of the SWF file by - * instantiating the ActionScript 3.0 classes that represent those components - * and assets.

- * - *

To determine the status of a Loader object, monitor the following - * events that the LoaderInfo object associated with the - * contentLoaderInfo property of the Loader object:

- * - *
    - *
  • The open event is dispatched when loading begins.
  • - *
  • The ioError or securityError event is - * dispatched if the file cannot be loaded or if an error occured during the - * load process.
  • - *
  • The progress event fires continuously while the file is - * being loaded.
  • - *
  • The complete event is dispatched when a file completes - * downloading, but before the loaded movie clip's methods and properties are - * available.
  • - *
  • The init event is dispatched after the properties and - * methods of the loaded SWF file are accessible, so you can begin - * manipulating the loaded SWF file. This event is dispatched before the - * complete handler. In streaming SWF files, the - * init event can occur significantly earlier than the - * complete event. For most purposes, use the init - * handler.
  • - *
- */ - function Loader(useAssetLibrary, assetLibraryId) { - if (typeof useAssetLibrary === "undefined") { useAssetLibrary = true; } - if (typeof assetLibraryId === "undefined") { assetLibraryId = null; } - _super.call(this); - - this._loadingSessions = new Array(); - this._useAssetLib = useAssetLibrary; - this._assetLibId = assetLibraryId; - - this._onResourceCompleteDelegate = away.utils.Delegate.create(this, this.onResourceComplete); - this._onAssetCompleteDelegate = away.utils.Delegate.create(this, this.onAssetComplete); - } - Object.defineProperty(Loader.prototype, "content", { - /** - * Contains the root display object of the SWF file or image(JPG, PNG, or - * GIF) file that was loaded by using the load() or - * loadBytes() methods. - * - * @throws SecurityError The loaded SWF file or image file belongs to a - * security sandbox to which you do not have access. - * For a loaded SWF file, you can avoid this situation - * by having the file call the - * Security.allowDomain() method or by - * having the loading file specify a - * loaderContext parameter with its - * securityDomain property set to - * SecurityDomain.currentDomain when you - * call the load() or - * loadBytes() method. - */ - get: function () { - return this._content; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(Loader.prototype, "contentLoaderInfo", { - /** - * Returns a LoaderInfo object corresponding to the object being loaded. - * LoaderInfo objects are shared between the Loader object and the loaded - * content object. The LoaderInfo object supplies loading progress - * information and statistics about the loaded file. - * - *

Events related to the load are dispatched by the LoaderInfo object - * referenced by the contentLoaderInfo property of the Loader - * object. The contentLoaderInfo property is set to a valid - * LoaderInfo object, even before the content is loaded, so that you can add - * event listeners to the object prior to the load.

- * - *

To detect uncaught errors that happen in a loaded SWF, use the - * Loader.uncaughtErrorEvents property, not the - * Loader.contentLoaderInfo.uncaughtErrorEvents property.

- */ - get: function () { - return this._contentLoaderInfo; - }, - enumerable: true, - configurable: true - }); - - /** - * Cancels a load() method operation that is currently in - * progress for the Loader instance. - * - */ - Loader.prototype.close = function () { - if (this._useAssetLib) { - var lib; - lib = away.library.AssetLibraryBundle.getInstance(this._assetLibId); - lib.stopAllLoadingSessions(); - this._loadingSessions = null; - return; - } - var i; - var length = this._loadingSessions.length; - for (i = 0; i < length; i++) { - this.removeListeners(this._loadingSessions[i]); - this._loadingSessions[i].stop(); - this._loadingSessions[i] = null; - } - this._loadingSessions = null; - }; - - /** - * Loads a SWF, JPEG, progressive JPEG, unanimated GIF, or PNG file into an - * object that is a child of this Loader object. If you load an animated GIF - * file, only the first frame is displayed. As the Loader object can contain - * only a single child, issuing a subsequent load() request - * terminates the previous request, if still pending, and commences a new - * load. - * - *

Note: In AIR 1.5 and Flash Player 10, the maximum size for a - * loaded image is 8,191 pixels in width or height, and the total number of - * pixels cannot exceed 16,777,215 pixels.(So, if an loaded image is 8,191 - * pixels wide, it can only be 2,048 pixels high.) In Flash Player 9 and - * earlier and AIR 1.1 and earlier, the limitation is 2,880 pixels in height - * and 2,880 pixels in width.

- * - *

A SWF file or image loaded into a Loader object inherits the position, - * rotation, and scale properties of the parent display objects of the Loader - * object.

- * - *

Use the unload() method to remove movies or images loaded - * with this method, or to cancel a load operation that is in progress.

- * - *

You can prevent a SWF file from using this method by setting the - * allowNetworking parameter of the the object and - * embed tags in the HTML page that contains the SWF - * content.

- * - *

When you use this method, consider the Flash Player security model, - * which is described in the Loader class description.

- * - *

In Flash Player 10 and later, if you use a multipart Content-Type(for - * example "multipart/form-data") that contains an upload(indicated by a - * "filename" parameter in a "content-disposition" header within the POST - * body), the POST operation is subject to the security rules applied to - * uploads:

- * - *
    - *
  • The POST operation must be performed in response to a user-initiated - * action, such as a mouse click or key press.
  • - *
  • If the POST operation is cross-domain(the POST target is not on the - * same server as the SWF file that is sending the POST request), the target - * server must provide a URL policy file that permits cross-domain - * access.
  • - *
- * - *

Also, for any multipart Content-Type, the syntax must be valid - * (according to the RFC2046 standard). If the syntax appears to be invalid, - * the POST operation is subject to the security rules applied to - * uploads.

- * - *

For more information related to security, see the Flash Player - * Developer Center Topic: Security.

- * - * @param request The absolute or relative URL of the SWF, JPEG, GIF, or PNG - * file to be loaded. A relative path must be relative to the - * main SWF file. Absolute URLs must include the protocol - * reference, such as http:// or file:///. Filenames cannot - * include disk drive specifications. - * @param context A LoaderContext object, which has properties that define - * the following: - *
    - *
  • Whether or not to check for the existence of a policy - * file upon loading the object
  • - *
  • The ApplicationDomain for the loaded object
  • - *
  • The SecurityDomain for the loaded object
  • - *
  • The ImageDecodingPolicy for the loaded image - * object
  • - *
- * - *

If the context parameter is not specified - * or refers to a null object, the loaded content remains in - * its own security domain.

- * - *

For complete details, see the description of the - * properties in the LoaderContext - * class.

- * @param ns An optional namespace string under which the file is to be - * loaded, allowing the differentiation of two resources with - * identical assets. - * @param parser An optional parser object for translating the loaded data - * into a usable resource. If not provided, AssetLoader will - * attempt to auto-detect the file type. - * @throws IOError The digest property of the - * request object is not - * null. You should only set the - * digest property of a URLRequest - * object when calling the - * URLLoader.load() method when - * loading a SWZ file(an Adobe platform - * component). - * @throws IllegalOperationError If the requestedContentParent - * property of the context - * parameter is a Loader. - * @throws IllegalOperationError If the LoaderContext.parameters - * parameter is set to non-null and has some - * values which are not Strings. - * @throws SecurityError The value of - * LoaderContext.securityDomain - * must be either null or - * SecurityDomain.currentDomain. - * This reflects the fact that you can only - * place the loaded media in its natural - * security sandbox or your own(the latter - * requires a policy file). - * @throws SecurityError Local SWF files may not set - * LoaderContext.securityDomain to anything - * other than null. It is not - * permitted to import non-local media into a - * local sandbox, or to place other local media - * in anything other than its natural sandbox. - * @throws SecurityError You cannot connect to commonly reserved - * ports. For a complete list of blocked ports, - * see "Restricting Networking APIs" in the - * ActionScript 3.0 Developer's Guide. - * @throws SecurityError If the applicationDomain or - * securityDomain properties of - * the context parameter are from - * a disallowed domain. - * @throws SecurityError If a local SWF file is attempting to use the - * securityDomain property of the - * context parameter. - * @event asyncError Dispatched by the contentLoaderInfo - * object if the - * LoaderContext.requestedContentParent - * property has been specified and it is not possible to - * add the loaded content as a child to the specified - * DisplayObjectContainer. This could happen if the - * loaded content is a - * flash.display.AVM1Movie or if the - * addChild() call to the - * requestedContentParent throws an error. - * @event complete Dispatched by the contentLoaderInfo - * object when the file has completed loading. The - * complete event is always dispatched - * after the init event. - * @event httpStatus Dispatched by the contentLoaderInfo - * object when a network request is made over HTTP and - * Flash Player can detect the HTTP status code. - * @event init Dispatched by the contentLoaderInfo - * object when the properties and methods of the loaded - * SWF file are accessible. The init event - * always precedes the complete event. - * @event ioError Dispatched by the contentLoaderInfo - * object when an input or output error occurs that - * causes a load operation to fail. - * @event open Dispatched by the contentLoaderInfo - * object when the loading operation starts. - * @event progress Dispatched by the contentLoaderInfo - * object as data is received while load operation - * progresses. - * @event securityError Dispatched by the contentLoaderInfo - * object if a SWF file in the local-with-filesystem - * sandbox attempts to load content in the - * local-with-networking sandbox, or vice versa. - * @event securityError Dispatched by the contentLoaderInfo - * object if the - * LoaderContext.requestedContentParent - * property has been specified and the security sandbox - * of the - * LoaderContext.requestedContentParent - * does not have access to the loaded SWF. - * @event unload Dispatched by the contentLoaderInfo - * object when a loaded object is removed. - */ - Loader.prototype.load = function (request, context, ns, parser) { - if (typeof context === "undefined") { context = null; } - if (typeof ns === "undefined") { ns = null; } - if (typeof parser === "undefined") { parser = null; } - var token; - - if (this._useAssetLib) { - var lib; - lib = away.library.AssetLibraryBundle.getInstance(this._assetLibId); - token = lib.load(request, context, ns, parser); - } else { - var loader = new AssetLoader(); - this._loadingSessions.push(loader); - token = loader.load(request, context, ns, parser); - } - - token.addEventListener(away.events.LoaderEvent.RESOURCE_COMPLETE, this._onResourceCompleteDelegate); - token.addEventListener(away.events.AssetEvent.ASSET_COMPLETE, this._onAssetCompleteDelegate); - - // Error are handled separately (see documentation for addErrorHandler) - token._iLoader._iAddErrorHandler(this.onLoadError); - token._iLoader._iAddParseErrorHandler(this.onParseError); - - return token; - }; - - /** - * Loads from binary data stored in a ByteArray object. - * - *

The loadBytes() method is asynchronous. You must wait for - * the "init" event before accessing the properties of a loaded object.

- * - *

When you use this method, consider the Flash Player security model, - * which is described in the Loader class description.

- * - * @param bytes A ByteArray object. The contents of the ByteArray can be - * any of the file formats supported by the Loader class: SWF, - * GIF, JPEG, or PNG. - * @param context A LoaderContext object. Only the - * applicationDomain property of the - * LoaderContext object applies; the - * checkPolicyFile and - * securityDomain properties of the LoaderContext - * object do not apply. - * - *

If the context parameter is not specified - * or refers to a null object, the content is loaded into the - * current security domain - a process referred to as "import - * loading" in Flash Player security documentation. - * Specifically, if the loading SWF file trusts the remote SWF - * by incorporating the remote SWF into its code, then the - * loading SWF can import it directly into its own security - * domain.

- * - *

For more information related to security, see the Flash - * Player Developer Center Topic: Security.

- * @throws ArgumentError If the length property of the - * ByteArray object is not greater than 0. - * @throws IllegalOperationError If the checkPolicyFile or - * securityDomain property of the - * context parameter are non-null. - * @throws IllegalOperationError If the requestedContentParent - * property of the context - * parameter is a Loader. - * @throws IllegalOperationError If the LoaderContext.parameters - * parameter is set to non-null and has some - * values which are not Strings. - * @throws SecurityError If the provided - * applicationDomain property of - * the context property is from a - * disallowed domain. - * @throws SecurityError You cannot connect to commonly reserved - * ports. For a complete list of blocked ports, - * see "Restricting Networking APIs" in the - * ActionScript 3.0 Developer's Guide. - * @event asyncError Dispatched by the contentLoaderInfo - * object if the - * LoaderContext.requestedContentParent - * property has been specified and it is not possible to - * add the loaded content as a child to the specified - * DisplayObjectContainer. This could happen if the - * loaded content is a - * flash.display.AVM1Movie or if the - * addChild() call to the - * requestedContentParent throws an error. - * @event complete Dispatched by the contentLoaderInfo - * object when the operation is complete. The - * complete event is always dispatched - * after the init event. - * @event init Dispatched by the contentLoaderInfo - * object when the properties and methods of the loaded - * data are accessible. The init event - * always precedes the complete event. - * @event ioError Dispatched by the contentLoaderInfo - * object when the runtime cannot parse the data in the - * byte array. - * @event open Dispatched by the contentLoaderInfo - * object when the operation starts. - * @event progress Dispatched by the contentLoaderInfo - * object as data is transfered in memory. - * @event securityError Dispatched by the contentLoaderInfo - * object if the - * LoaderContext.requestedContentParent - * property has been specified and the security sandbox - * of the - * LoaderContext.requestedContentParent - * does not have access to the loaded SWF. - * @event unload Dispatched by the contentLoaderInfo - * object when a loaded object is removed. - */ - Loader.prototype.loadData = function (data, context, ns, parser) { - if (typeof context === "undefined") { context = null; } - if (typeof ns === "undefined") { ns = null; } - if (typeof parser === "undefined") { parser = null; } - var token; - - if (this._useAssetLib) { - var lib; - lib = away.library.AssetLibraryBundle.getInstance(this._assetLibId); - token = lib.loadData(data, context, ns, parser); - } else { - var loader = new AssetLoader(); - this._loadingSessions.push(loader); - token = loader.loadData(data, '', context, ns, parser); - } - - token.addEventListener(away.events.LoaderEvent.RESOURCE_COMPLETE, this._onResourceCompleteDelegate); - token.addEventListener(away.events.AssetEvent.ASSET_COMPLETE, this._onAssetCompleteDelegate); - - // Error are handled separately (see documentation for addErrorHandler) - token._iLoader._iAddErrorHandler(this.onLoadError); - token._iLoader._iAddParseErrorHandler(this.onParseError); - - return token; - }; - - /** - * Removes a child of this Loader object that was loaded by using the - * load() method. The property of the associated - * LoaderInfo object is reset to null. The child is not - * necessarily destroyed because other objects might have references to it; - * however, it is no longer a child of the Loader object. - * - *

As a best practice, before you unload a child SWF file, you should - * explicitly close any streams in the child SWF file's objects, such as - * LocalConnection, NetConnection, NetStream, and Sound objects. Otherwise, - * audio in the child SWF file might continue to play, even though the child - * SWF file was unloaded. To close streams in the child SWF file, add an - * event listener to the child that listens for the unload - * event. When the parent calls Loader.unload(), the - * unload event is dispatched to the child. The following code - * shows how you might do this:

- *
 public closeAllStreams(evt:Event) {
-            * myNetStream.close(); mySound.close(); myNetConnection.close();
-            * myLocalConnection.close(); }
-            * myMovieClip.loaderInfo.addEventListener(Event.UNLOAD,
-            * closeAllStreams);
- * - */ - Loader.prototype.unload = function () { - //TODO - }; - - /** - * Enables a specific parser. - * When no specific parser is set for a loading/parsing opperation, - * loader3d can autoselect the correct parser to use. - * A parser must have been enabled, to be considered when autoselecting the parser. - * - * @param parserClass The parser class to enable. - * @see away.parsers.Parsers - */ - Loader.enableParser = function (parserClass) { - AssetLoader.enableParser(parserClass); - }; - - /** - * Enables a list of parsers. - * When no specific parser is set for a loading/parsing opperation, - * loader3d can autoselect the correct parser to use. - * A parser must have been enabled, to be considered when autoselecting the parser. - * - * @param parserClasses A Vector of parser classes to enable. - * @see away.parsers.Parsers - */ - Loader.enableParsers = function (parserClasses) { - AssetLoader.enableParsers(parserClasses); - }; - - Loader.prototype.removeListeners = function (dispatcher) { - dispatcher.removeEventListener(LoaderEvent.RESOURCE_COMPLETE, this._onResourceCompleteDelegate); - dispatcher.removeEventListener(AssetEvent.ASSET_COMPLETE, this._onAssetCompleteDelegate); - }; - - Loader.prototype.onAssetComplete = function (event) { - this.dispatchEvent(event); - }; - - /** - * Called when an error occurs during loading - */ - Loader.prototype.onLoadError = function (event) { - if (this.hasEventListener(IOErrorEvent.IO_ERROR)) { - this.dispatchEvent(event); - return true; - } else { - return false; - } - }; - - /** - * Called when a an error occurs during parsing - */ - Loader.prototype.onParseError = function (event) { - if (this.hasEventListener(ParserEvent.PARSE_ERROR)) { - this.dispatchEvent(event); - return true; - } else { - return false; - } - }; - - /** - * Called when the resource and all of its dependencies was retrieved. - */ - Loader.prototype.onResourceComplete = function (event) { - var content = event.content; - - this._content = content; - - if (content) - this.addChild(content); - - this.dispatchEvent(event); - }; - return Loader; - })(containers.DisplayObjectContainer); - containers.Loader = Loader; - })(away.containers || (away.containers = {})); - var containers = away.containers; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (containers) { - var DisplayObjectContainer = away.containers.DisplayObjectContainer; - var SceneEvent = away.events.SceneEvent; - var NodeBase = away.partition.NodeBase; - var Partition = away.partition.Partition; - - var Scene = (function (_super) { - __extends(Scene, _super); - function Scene() { - _super.call(this); - this._expandedPartitions = new Array(); - this._partitions = new Array(); - this._iCollectionMark = 0; - - this._iSceneGraphRoot = new DisplayObjectContainer(); - - this._iSceneGraphRoot._iSetScene(this); - this._iSceneGraphRoot._iIsRoot = true; - this._iSceneGraphRoot.partition = new Partition(new NodeBase()); - } - Scene.prototype.traversePartitions = function (traverser) { - var i = 0; - var len = this._partitions.length; - - traverser.scene = this; - - while (i < len) { - this._iCollectionMark++; - this._partitions[i++].traverse(traverser); - } - }; - - Object.defineProperty(Scene.prototype, "partition", { - get: function () { - return this._iSceneGraphRoot.partition; - }, - set: function (value) { - this._iSceneGraphRoot.partition = value; - - this.dispatchEvent(new SceneEvent(SceneEvent.PARTITION_CHANGED, this._iSceneGraphRoot)); - }, - enumerable: true, - configurable: true - }); - - - Scene.prototype.contains = function (child) { - return this._iSceneGraphRoot.contains(child); - }; - - Scene.prototype.addChild = function (child) { - return this._iSceneGraphRoot.addChild(child); - }; - - Scene.prototype.removeChild = function (child) { - this._iSceneGraphRoot.removeChild(child); - }; - - Scene.prototype.removeChildAt = function (index) { - this._iSceneGraphRoot.removeChildAt(index); - }; - - Scene.prototype.getChildAt = function (index) { - return this._iSceneGraphRoot.getChildAt(index); - }; - - Object.defineProperty(Scene.prototype, "numChildren", { - get: function () { - return this._iSceneGraphRoot.numChildren; - }, - enumerable: true, - configurable: true - }); - - /** - * @internal - */ - Scene.prototype.iRegisterEntity = function (displayObject) { - if (displayObject.partition) - this.iRegisterPartition(displayObject.partition); - - if (displayObject.isEntity) - displayObject._iAssignedPartition.iMarkForUpdate(displayObject); - }; - - /** - * @internal - */ - Scene.prototype.iRegisterPartition = function (partition) { - this._expandedPartitions.push(partition); - - //ensure duplicates are not found in partitions array - if (this._partitions.indexOf(partition) == -1) - this._partitions.push(partition); - }; - - /** - * @internal - */ - Scene.prototype.iUnregisterEntity = function (displayObject) { - if (displayObject.partition) - this.iUnregisterPartition(displayObject.partition); - - if (displayObject.isEntity) - displayObject._iAssignedPartition.iRemoveEntity(displayObject); - }; - - /** - * @internal - */ - Scene.prototype.iUnregisterPartition = function (partition) { - this._expandedPartitions.splice(this._expandedPartitions.indexOf(partition), 1); - - //if no more partition references found, remove from partitions array - if (this._expandedPartitions.indexOf(partition) == -1) - this._partitions.splice(this._partitions.indexOf(partition), 1); - }; - return Scene; - })(away.events.EventDispatcher); - containers.Scene = Scene; - })(away.containers || (away.containers = {})); - var containers = away.containers; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (containers) { - var Scene = away.containers.Scene; - var Camera = away.entities.Camera; - var CameraEvent = away.events.CameraEvent; - var SceneEvent = away.events.SceneEvent; - var RendererEvent = away.events.RendererEvent; - - var MouseManager = away.managers.MouseManager; - - var RaycastPicker = away.pick.RaycastPicker; - - var Delegate = away.utils.Delegate; - - var View = (function () { - /* - *********************************************************************** - * Disabled / Not yet implemented - *********************************************************************** - * - * private _background:away.textures.Texture2DBase; - * - * public _pTouch3DManager:away.managers.Touch3DManager; - * - */ - function View(renderer, scene, camera) { - if (typeof scene === "undefined") { scene = null; } - if (typeof camera === "undefined") { camera = null; } - this._width = 0; - this._height = 0; - this._time = 0; - this._deltaTime = 0; - this._backgroundColor = 0x000000; - this._backgroundAlpha = 1; - this._viewportDirty = true; - this._scissorDirty = true; - this._mousePicker = new RaycastPicker(); - this._onScenePartitionChangedDelegate = Delegate.create(this, this.onScenePartitionChanged); - this._onProjectionChangedDelegate = Delegate.create(this, this.onProjectionChanged); - this._onViewportUpdatedDelegate = Delegate.create(this, this.onViewportUpdated); - this._onScissorUpdatedDelegate = Delegate.create(this, this.onScissorUpdated); - - this.scene = scene || new Scene(); - this.camera = camera || new Camera(); - this.renderer = renderer; - - //make sure document border is zero - document.body.style.margin = "0px"; - - this._htmlElement = document.createElement("div"); - this._htmlElement.style.position = "absolute"; - - document.body.appendChild(this._htmlElement); - - this._mouseManager = MouseManager.getInstance(); - this._mouseManager.registerView(this); - // if (this._shareContext) - // this._mouse3DManager.addViewLayer(this); - } - /** - * - * @param e - */ - View.prototype.onScenePartitionChanged = function (e) { - if (this._pCamera) - this._pCamera.partition = this.scene.partition; - }; - - Object.defineProperty(View.prototype, "mouseX", { - get: function () { - return this._pMouseX; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(View.prototype, "mouseY", { - get: function () { - return this._pMouseY; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(View.prototype, "htmlElement", { - /** - * - */ - get: function () { - return this._htmlElement; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(View.prototype, "renderer", { - /** - * - */ - get: function () { - return this._pRenderer; - }, - set: function (value) { - if (this._pRenderer == value) - return; - - if (this._pRenderer) { - this._pRenderer.dispose(); - this._pRenderer.removeEventListener(RendererEvent.VIEWPORT_UPDATED, this._onViewportUpdatedDelegate); - this._pRenderer.removeEventListener(RendererEvent.SCISSOR_UPDATED, this._onScissorUpdatedDelegate); - } - - this._pRenderer = value; - - this._pRenderer.addEventListener(RendererEvent.VIEWPORT_UPDATED, this._onViewportUpdatedDelegate); - this._pRenderer.addEventListener(RendererEvent.SCISSOR_UPDATED, this._onScissorUpdatedDelegate); - - //reset entity collector - this._pEntityCollector = this._pRenderer._iCreateEntityCollector(); - - if (this._pCamera) - this._pEntityCollector.camera = this._pCamera; - - //reset back buffer - this._pRenderer._iBackgroundR = ((this._backgroundColor >> 16) & 0xff) / 0xff; - this._pRenderer._iBackgroundG = ((this._backgroundColor >> 8) & 0xff) / 0xff; - this._pRenderer._iBackgroundB = (this._backgroundColor & 0xff) / 0xff; - this._pRenderer._iBackgroundAlpha = this._backgroundAlpha; - this._pRenderer.width = this._width; - this._pRenderer.height = this._height; - this._pRenderer.shareContext = this._shareContext; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(View.prototype, "shareContext", { - /** - * - */ - get: function () { - return this._shareContext; - }, - set: function (value) { - if (this._shareContext == value) - return; - - this._shareContext = value; - - if (this._pRenderer) - this._pRenderer.shareContext = this._shareContext; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(View.prototype, "backgroundColor", { - /** - * - */ - get: function () { - return this._backgroundColor; - }, - set: function (value) { - if (this._backgroundColor == value) - return; - - this._backgroundColor = value; - - this._pRenderer._iBackgroundR = ((value >> 16) & 0xff) / 0xff; - this._pRenderer._iBackgroundG = ((value >> 8) & 0xff) / 0xff; - this._pRenderer._iBackgroundB = (value & 0xff) / 0xff; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(View.prototype, "backgroundAlpha", { - /** - * - * @returns {number} - */ - get: function () { - return this._backgroundAlpha; - }, - /** - * - * @param value - */ - set: function (value) { - if (value > 1) - value = 1; - else if (value < 0) - value = 0; - - if (this._backgroundAlpha == value) - return; - - this._pRenderer._iBackgroundAlpha = this._backgroundAlpha = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(View.prototype, "camera", { - /** - * - * @returns {Camera3D} - */ - get: function () { - return this._pCamera; - }, - /** - * Set camera that's used to render the scene for this viewport - */ - set: function (value) { - if (this._pCamera == value) - return; - - if (this._pCamera) - this._pCamera.removeEventListener(CameraEvent.PROJECTION_CHANGED, this._onProjectionChangedDelegate); - - this._pCamera = value; - - if (this._pEntityCollector) - this._pEntityCollector.camera = this._pCamera; - - if (this._pScene) - this._pCamera.partition = this._pScene.partition; - - this._pCamera.addEventListener(CameraEvent.PROJECTION_CHANGED, this._onProjectionChangedDelegate); - this._scissorDirty = true; - this._viewportDirty = true; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(View.prototype, "scene", { - /** - * - * @returns {away.containers.Scene3D} - */ - get: function () { - return this._pScene; - }, - /** - * Set the scene that's used to render for this viewport - */ - set: function (value) { - if (this._pScene == value) - return; - - if (this._pScene) - this._pScene.removeEventListener(SceneEvent.PARTITION_CHANGED, this._onScenePartitionChangedDelegate); - - this._pScene = value; - - this._pScene.addEventListener(SceneEvent.PARTITION_CHANGED, this._onScenePartitionChangedDelegate); - - if (this._pCamera) - this._pCamera.partition = this._pScene.partition; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(View.prototype, "deltaTime", { - /** - * - * @returns {number} - */ - get: function () { - return this._deltaTime; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(View.prototype, "width", { - /** - * - */ - get: function () { - return this._width; - }, - set: function (value) { - if (this._width == value) - return; - - this._width = value; - this._aspectRatio = this._width / this._height; - this._pCamera.projection._iAspectRatio = this._aspectRatio; - this._pRenderer.width = value; - this._htmlElement.style.width = value + "px"; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(View.prototype, "height", { - /** - * - */ - get: function () { - return this._height; - }, - set: function (value) { - if (this._height == value) - return; - - this._height = value; - this._aspectRatio = this._width / this._height; - this._pCamera.projection._iAspectRatio = this._aspectRatio; - this._pRenderer.height = value; - this._htmlElement.style.height = value + "px"; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(View.prototype, "mousePicker", { - /** - * - */ - get: function () { - return this._mousePicker; - }, - set: function (value) { - if (this._mousePicker == value) - return; - - if (value == null) - this._mousePicker = new RaycastPicker(); - else - this._mousePicker = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(View.prototype, "x", { - /** - * - */ - get: function () { - return this._pRenderer.x; - }, - set: function (value) { - if (this._pRenderer.x == value) - return; - - this._pRenderer.x == value; - this._htmlElement.style.left = value + "px"; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(View.prototype, "y", { - /** - * - */ - get: function () { - return this._pRenderer.y; - }, - set: function (value) { - if (this._pRenderer.y == value) - return; - - this._pRenderer.y == value; - this._htmlElement.style.top = value + "px"; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(View.prototype, "visible", { - /** - * - */ - get: function () { - return (this._htmlElement.style.visibility == "visible"); - }, - set: function (value) { - this._htmlElement.style.visibility = value ? "visible" : "hidden"; - //TODO transfer visible property to associated context (if one exists) - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(View.prototype, "renderedFacesCount", { - /** - * - * @returns {number} - */ - get: function () { - return 0; - //return this._pEntityCollector._pNumTriangles;//numTriangles; - }, - enumerable: true, - configurable: true - }); - - /** - * Renders the view. - */ - View.prototype.render = function () { - this.pUpdateTime(); - - //update view and size data - this._pCamera.projection._iAspectRatio = this._aspectRatio; - - if (this._scissorDirty) { - this._scissorDirty = false; - this._pCamera.projection._iUpdateScissorRect(this._pRenderer.scissorRect.x, this._pRenderer.scissorRect.y, this._pRenderer.scissorRect.width, this._pRenderer.scissorRect.height); - } - - if (this._viewportDirty) { - this._viewportDirty = false; - this._pCamera.projection._iUpdateViewport(this._pRenderer.viewPort.x, this._pRenderer.viewPort.y, this._pRenderer.viewPort.width, this._pRenderer.viewPort.height); - } - - // update picking - if (!this._shareContext) { - if (this.forceMouseMove && this._htmlElement == this._mouseManager._iActiveDiv && !this._mouseManager._iUpdateDirty) - this._mouseManager._iCollidingObject = this.mousePicker.getViewCollision(this._pMouseX, this._pMouseY, this); - - this._mouseManager.fireMouseEvents(this.forceMouseMove); - //_touch3DManager.fireTouchEvents(); - } - - //_touch3DManager.updateCollider(); - //clear entity collector ready for collection - this._pEntityCollector.clear(); - - // collect stuff to render - this._pScene.traversePartitions(this._pEntityCollector); - - //render the contents of the entity collector - this._pRenderer.render(this._pEntityCollector); - }; - - /** - * - */ - View.prototype.pUpdateTime = function () { - var time = away.utils.getTimer(); - - if (this._time == 0) - this._time = time; - - this._deltaTime = time - this._time; - this._time = time; - }; - - /** - * - */ - View.prototype.dispose = function () { - this._pRenderer.dispose(); - - // TODO: imeplement mouseManager / touch3DManager - this._mouseManager.unregisterView(this); - - //this._touch3DManager.disableTouchListeners(this); - //this._touch3DManager.dispose(); - this._mouseManager = null; - - //this._touch3DManager = null; - this._pRenderer = null; - this._pEntityCollector = null; - }; - - Object.defineProperty(View.prototype, "iEntityCollector", { - /** - * - */ - get: function () { - return this._pEntityCollector; - }, - enumerable: true, - configurable: true - }); - - /** - * - */ - View.prototype.onProjectionChanged = function (event) { - this._scissorDirty = true; - this._viewportDirty = true; - }; - - /** - * - */ - View.prototype.onViewportUpdated = function (event) { - this._viewportDirty = true; - }; - - /** - * - */ - View.prototype.onScissorUpdated = function (event) { - this._scissorDirty = true; - }; - - View.prototype.project = function (point3d) { - var v = this._pCamera.project(point3d); - v.x = v.x * this._pRenderer.viewPort.width / 2 + this._width * this._pCamera.projection.originX; - v.y = v.y * this._pRenderer.viewPort.height / 2 + this._height * this._pCamera.projection.originY; - - return v; - }; - - View.prototype.unproject = function (sX, sY, sZ) { - return this._pCamera.unproject(2 * (sX - this._width * this._pCamera.projection.originX) / this._pRenderer.viewPort.width, 2 * (sY - this._height * this._pCamera.projection.originY) / this._pRenderer.viewPort.height, sZ); - }; - - View.prototype.getRay = function (sX, sY, sZ) { - return this._pCamera.getRay((sX * 2 - this._width) / this._width, (sY * 2 - this._height) / this._height, sZ); - }; - - /*TODO: implement Background - public get background():away.textures.Texture2DBase - { - return this._background; - } - */ - /*TODO: implement Background - public set background( value:away.textures.Texture2DBase ) - { - this._background = value; - this._renderer.background = _background; - } - */ - // TODO: required dependency stageGL - View.prototype.updateCollider = function () { - if (!this._shareContext) { - if (this._htmlElement == this._mouseManager._iActiveDiv) - this._mouseManager._iCollidingObject = this.mousePicker.getViewCollision(this._pMouseX, this._pMouseY, this); - } else { - var collidingObject = this.mousePicker.getViewCollision(this._pMouseX, this._pMouseY, this); - - if (this.layeredView || this._mouseManager._iCollidingObject == null || collidingObject.rayEntryDistance < this._mouseManager._iCollidingObject.rayEntryDistance) - this._mouseManager._iCollidingObject = collidingObject; - } - }; - return View; - })(); - containers.View = View; - })(away.containers || (away.containers = {})); - var containers = away.containers; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (controllers) { - var AbstractMethodError = away.errors.AbstractMethodError; - - var ControllerBase = (function () { - function ControllerBase(targetObject) { - if (typeof targetObject === "undefined") { targetObject = null; } - this._pAutoUpdate = true; - this.targetObject = targetObject; - } - ControllerBase.prototype.pNotifyUpdate = function () { - if (this._pTargetObject && this._pTargetObject._iAssignedPartition && this._pAutoUpdate) { - this._pTargetObject._iAssignedPartition.iMarkForUpdate(this._pTargetObject); - } - }; - - Object.defineProperty(ControllerBase.prototype, "targetObject", { - get: function () { - return this._pTargetObject; - }, - set: function (val) { - if (this._pTargetObject == val) { - return; - } - - if (this._pTargetObject && this._pAutoUpdate) { - this._pTargetObject._iController = null; - } - this._pTargetObject = val; - - if (this._pTargetObject && this._pAutoUpdate) { - this._pTargetObject._iController = this; - } - this.pNotifyUpdate(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ControllerBase.prototype, "autoUpdate", { - get: function () { - return this._pAutoUpdate; - }, - set: function (val) { - if (this._pAutoUpdate == val) { - return; - } - this._pAutoUpdate = val; - - if (this._pTargetObject) { - if (this._pTargetObject) { - this._pTargetObject._iController = this; - } else { - this._pTargetObject._iController = null; - } - } - }, - enumerable: true, - configurable: true - }); - - - ControllerBase.prototype.update = function (interpolate) { - if (typeof interpolate === "undefined") { interpolate = true; } - throw new AbstractMethodError(); - }; - return ControllerBase; - })(); - controllers.ControllerBase = ControllerBase; - })(away.controllers || (away.controllers = {})); - var controllers = away.controllers; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (controllers) { - var DisplayObjectEvent = away.events.DisplayObjectEvent; - var Vector3D = away.geom.Vector3D; - - var LookAtController = (function (_super) { - __extends(LookAtController, _super); - function LookAtController(targetObject, lookAtObject) { - if (typeof targetObject === "undefined") { targetObject = null; } - if (typeof lookAtObject === "undefined") { lookAtObject = null; } - _super.call(this, targetObject); - this._pOrigin = new Vector3D(0.0, 0.0, 0.0); - - this._onLookAtObjectChangedDelegate = away.utils.Delegate.create(this, this.onLookAtObjectChanged); - - if (lookAtObject) { - this.lookAtObject = lookAtObject; - } else { - this.lookAtPosition = new Vector3D(); - } - } - Object.defineProperty(LookAtController.prototype, "lookAtPosition", { - get: function () { - return this._pLookAtPosition; - }, - set: function (val) { - if (this._pLookAtObject) { - this._pLookAtObject.removeEventListener(DisplayObjectEvent.SCENETRANSFORM_CHANGED, this._onLookAtObjectChangedDelegate); - this._pLookAtObject = null; - } - - this._pLookAtPosition = val; - this.pNotifyUpdate(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(LookAtController.prototype, "lookAtObject", { - get: function () { - return this._pLookAtObject; - }, - set: function (val) { - if (this._pLookAtPosition) - this._pLookAtPosition = null; - - if (this._pLookAtObject == val) - return; - - if (this._pLookAtObject) - this._pLookAtObject.removeEventListener(DisplayObjectEvent.SCENETRANSFORM_CHANGED, this._onLookAtObjectChangedDelegate); - - this._pLookAtObject = val; - - if (this._pLookAtObject) - this._pLookAtObject.addEventListener(DisplayObjectEvent.SCENETRANSFORM_CHANGED, this._onLookAtObjectChangedDelegate); - - this.pNotifyUpdate(); - }, - enumerable: true, - configurable: true - }); - - - //@override - LookAtController.prototype.update = function (interpolate) { - if (typeof interpolate === "undefined") { interpolate = true; } - if (this._pTargetObject) { - if (this._pLookAtPosition) - this._pTargetObject.lookAt(this._pLookAtPosition); - else if (this._pLookAtObject) - this._pTargetObject.lookAt(this._pLookAtObject.scene ? this._pLookAtObject.scenePosition : this._pLookAtObject.transform.position); - } - }; - - LookAtController.prototype.onLookAtObjectChanged = function (event) { - this.pNotifyUpdate(); - }; - return LookAtController; - })(controllers.ControllerBase); - controllers.LookAtController = LookAtController; - })(away.controllers || (away.controllers = {})); - var controllers = away.controllers; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (controllers) { - var MathConsts = away.geom.MathConsts; - var Vector3D = away.geom.Vector3D; - - /** - * Extended camera used to hover round a specified target object. - * - * @see away.containers.View - */ - var HoverController = (function (_super) { - __extends(HoverController, _super); - /** - * Creates a new HoverController object. - */ - function HoverController(targetObject, lookAtObject, panAngle, tiltAngle, distance, minTiltAngle, maxTiltAngle, minPanAngle, maxPanAngle, steps, yFactor, wrapPanAngle) { - if (typeof targetObject === "undefined") { targetObject = null; } - if (typeof lookAtObject === "undefined") { lookAtObject = null; } - if (typeof panAngle === "undefined") { panAngle = 0; } - if (typeof tiltAngle === "undefined") { tiltAngle = 90; } - if (typeof distance === "undefined") { distance = 1000; } - if (typeof minTiltAngle === "undefined") { minTiltAngle = -90; } - if (typeof maxTiltAngle === "undefined") { maxTiltAngle = 90; } - if (typeof minPanAngle === "undefined") { minPanAngle = null; } - if (typeof maxPanAngle === "undefined") { maxPanAngle = null; } - if (typeof steps === "undefined") { steps = 8; } - if (typeof yFactor === "undefined") { yFactor = 2; } - if (typeof wrapPanAngle === "undefined") { wrapPanAngle = false; } - _super.call(this, targetObject, lookAtObject); - this._iCurrentPanAngle = 0; - this._iCurrentTiltAngle = 90; - this._panAngle = 0; - this._tiltAngle = 90; - this._distance = 1000; - this._minPanAngle = -Infinity; - this._maxPanAngle = Infinity; - this._minTiltAngle = -90; - this._maxTiltAngle = 90; - this._steps = 8; - this._yFactor = 2; - this._wrapPanAngle = false; - this._upAxis = new Vector3D(); - - this.distance = distance; - this.panAngle = panAngle; - this.tiltAngle = tiltAngle; - this.minPanAngle = (minPanAngle != null) ? minPanAngle : -Infinity; - this.maxPanAngle = (maxPanAngle != null) ? maxPanAngle : Infinity; - this.minTiltAngle = minTiltAngle; - this.maxTiltAngle = maxTiltAngle; - this.steps = steps; - this.yFactor = yFactor; - this.wrapPanAngle = wrapPanAngle; - - //values passed in contrustor are applied immediately - this._iCurrentPanAngle = this._panAngle; - this._iCurrentTiltAngle = this._tiltAngle; - } - Object.defineProperty(HoverController.prototype, "steps", { - /** - * Fractional step taken each time the hover() method is called. Defaults to 8. - * - * Affects the speed at which the tiltAngle and panAngle resolve to their targets. - * - * @see #tiltAngle - * @see #panAngle - */ - get: function () { - return this._steps; - }, - set: function (val) { - val = (val < 1) ? 1 : val; - - if (this._steps == val) - return; - - this._steps = val; - - this.pNotifyUpdate(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(HoverController.prototype, "panAngle", { - /** - * Rotation of the camera in degrees around the y axis. Defaults to 0. - */ - get: function () { - return this._panAngle; - }, - set: function (val) { - val = Math.max(this._minPanAngle, Math.min(this._maxPanAngle, val)); - - if (this._panAngle == val) - return; - - this._panAngle = val; - - this.pNotifyUpdate(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(HoverController.prototype, "tiltAngle", { - /** - * Elevation angle of the camera in degrees. Defaults to 90. - */ - get: function () { - return this._tiltAngle; - }, - set: function (val) { - val = Math.max(this._minTiltAngle, Math.min(this._maxTiltAngle, val)); - - if (this._tiltAngle == val) - return; - - this._tiltAngle = val; - - this.pNotifyUpdate(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(HoverController.prototype, "distance", { - /** - * Distance between the camera and the specified target. Defaults to 1000. - */ - get: function () { - return this._distance; - }, - set: function (val) { - if (this._distance == val) - return; - - this._distance = val; - - this.pNotifyUpdate(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(HoverController.prototype, "minPanAngle", { - /** - * Minimum bounds for the panAngle. Defaults to -Infinity. - * - * @see #panAngle - */ - get: function () { - return this._minPanAngle; - }, - set: function (val) { - if (this._minPanAngle == val) - return; - - this._minPanAngle = val; - - this.panAngle = Math.max(this._minPanAngle, Math.min(this._maxPanAngle, this._panAngle)); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(HoverController.prototype, "maxPanAngle", { - /** - * Maximum bounds for the panAngle. Defaults to Infinity. - * - * @see #panAngle - */ - get: function () { - return this._maxPanAngle; - }, - set: function (val) { - if (this._maxPanAngle == val) - return; - - this._maxPanAngle = val; - - this.panAngle = Math.max(this._minPanAngle, Math.min(this._maxPanAngle, this._panAngle)); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(HoverController.prototype, "minTiltAngle", { - /** - * Minimum bounds for the tiltAngle. Defaults to -90. - * - * @see #tiltAngle - */ - get: function () { - return this._minTiltAngle; - }, - set: function (val) { - if (this._minTiltAngle == val) - return; - - this._minTiltAngle = val; - - this.tiltAngle = Math.max(this._minTiltAngle, Math.min(this._maxTiltAngle, this._tiltAngle)); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(HoverController.prototype, "maxTiltAngle", { - /** - * Maximum bounds for the tiltAngle. Defaults to 90. - * - * @see #tiltAngle - */ - get: function () { - return this._maxTiltAngle; - }, - set: function (val) { - if (this._maxTiltAngle == val) - return; - - this._maxTiltAngle = val; - - this.tiltAngle = Math.max(this._minTiltAngle, Math.min(this._maxTiltAngle, this._tiltAngle)); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(HoverController.prototype, "yFactor", { - /** - * Fractional difference in distance between the horizontal camera orientation and vertical camera orientation. Defaults to 2. - * - * @see #distance - */ - get: function () { - return this._yFactor; - }, - set: function (val) { - if (this._yFactor == val) - return; - - this._yFactor = val; - - this.pNotifyUpdate(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(HoverController.prototype, "wrapPanAngle", { - /** - * Defines whether the value of the pan angle wraps when over 360 degrees or under 0 degrees. Defaults to false. - */ - get: function () { - return this._wrapPanAngle; - }, - set: function (val) { - if (this._wrapPanAngle == val) - return; - - this._wrapPanAngle = val; - - this.pNotifyUpdate(); - }, - enumerable: true, - configurable: true - }); - - - /** - * Updates the current tilt angle and pan angle values. - * - * Values are calculated using the defined tiltAngle, panAngle and steps variables. - * - * @param interpolate If the update to a target pan- or tiltAngle is interpolated. Default is true. - * - * @see #tiltAngle - * @see #panAngle - * @see #steps - */ - HoverController.prototype.update = function (interpolate) { - if (typeof interpolate === "undefined") { interpolate = true; } - if (this._tiltAngle != this._iCurrentTiltAngle || this._panAngle != this._iCurrentPanAngle) { - this.pNotifyUpdate(); - - if (this._wrapPanAngle) { - if (this._panAngle < 0) { - this._iCurrentPanAngle += this._panAngle % 360 + 360 - this._panAngle; - this._panAngle = this._panAngle % 360 + 360; - } else { - this._iCurrentPanAngle += this._panAngle % 360 - this._panAngle; - this._panAngle = this._panAngle % 360; - } - - while (this._panAngle - this._iCurrentPanAngle < -180) - this._iCurrentPanAngle -= 360; - - while (this._panAngle - this._iCurrentPanAngle > 180) - this._iCurrentPanAngle += 360; - } - - if (interpolate) { - this._iCurrentTiltAngle += (this._tiltAngle - this._iCurrentTiltAngle) / (this.steps + 1); - this._iCurrentPanAngle += (this._panAngle - this._iCurrentPanAngle) / (this.steps + 1); - } else { - this._iCurrentPanAngle = this._panAngle; - this._iCurrentTiltAngle = this._tiltAngle; - } - - //snap coords if angle differences are close - if ((Math.abs(this.tiltAngle - this._iCurrentTiltAngle) < 0.01) && (Math.abs(this._panAngle - this._iCurrentPanAngle) < 0.01)) { - this._iCurrentTiltAngle = this._tiltAngle; - this._iCurrentPanAngle = this._panAngle; - } - } - - var pos = (this.lookAtObject) ? this.lookAtObject.transform.position : (this.lookAtPosition) ? this.lookAtPosition : this._pOrigin; - this.targetObject.x = pos.x + this.distance * Math.sin(this._iCurrentPanAngle * MathConsts.DEGREES_TO_RADIANS) * Math.cos(this._iCurrentTiltAngle * MathConsts.DEGREES_TO_RADIANS); - this.targetObject.y = pos.y + this.distance * Math.sin(this._iCurrentTiltAngle * MathConsts.DEGREES_TO_RADIANS) * this.yFactor; - this.targetObject.z = pos.z + this.distance * Math.cos(this._iCurrentPanAngle * MathConsts.DEGREES_TO_RADIANS) * Math.cos(this._iCurrentTiltAngle * MathConsts.DEGREES_TO_RADIANS); - - this._upAxis.x = -Math.sin(this._iCurrentPanAngle * MathConsts.DEGREES_TO_RADIANS) * Math.sin(this._iCurrentTiltAngle * MathConsts.DEGREES_TO_RADIANS); - this._upAxis.y = Math.cos(this._iCurrentTiltAngle * MathConsts.DEGREES_TO_RADIANS); - this._upAxis.z = -Math.cos(this._iCurrentPanAngle * MathConsts.DEGREES_TO_RADIANS) * Math.sin(this._iCurrentTiltAngle * MathConsts.DEGREES_TO_RADIANS); - - if (this._pTargetObject) { - if (this._pLookAtPosition) - this._pTargetObject.lookAt(this._pLookAtPosition, this._upAxis); - else if (this._pLookAtObject) - this._pTargetObject.lookAt(this._pLookAtObject.scene ? this._pLookAtObject.scenePosition : this._pLookAtObject.transform.position, this._upAxis); - } - }; - return HoverController; - })(controllers.LookAtController); - controllers.HoverController = HoverController; - })(away.controllers || (away.controllers = {})); - var controllers = away.controllers; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (controllers) { - /** - * Extended camera used to hover round a specified target object. - * - * @see away3d.containers.View3D - */ - var FirstPersonController = (function (_super) { - __extends(FirstPersonController, _super); - /** - * Creates a new HoverController object. - */ - function FirstPersonController(targetObject, panAngle, tiltAngle, minTiltAngle, maxTiltAngle, steps, wrapPanAngle) { - if (typeof targetObject === "undefined") { targetObject = null; } - if (typeof panAngle === "undefined") { panAngle = 0; } - if (typeof tiltAngle === "undefined") { tiltAngle = 90; } - if (typeof minTiltAngle === "undefined") { minTiltAngle = -90; } - if (typeof maxTiltAngle === "undefined") { maxTiltAngle = 90; } - if (typeof steps === "undefined") { steps = 8; } - if (typeof wrapPanAngle === "undefined") { wrapPanAngle = false; } - _super.call(this, targetObject); - this._iCurrentPanAngle = 0; - this._iCurrentTiltAngle = 90; - this._panAngle = 0; - this._tiltAngle = 90; - this._minTiltAngle = -90; - this._maxTiltAngle = 90; - this._steps = 8; - this._walkIncrement = 0; - this._strafeIncrement = 0; - this._wrapPanAngle = false; - this.fly = false; - - this.panAngle = panAngle; - this.tiltAngle = tiltAngle; - this.minTiltAngle = minTiltAngle; - this.maxTiltAngle = maxTiltAngle; - this.steps = steps; - this.wrapPanAngle = wrapPanAngle; - - //values passed in contrustor are applied immediately - this._iCurrentPanAngle = this._panAngle; - this._iCurrentTiltAngle = this._tiltAngle; - } - Object.defineProperty(FirstPersonController.prototype, "steps", { - /** - * Fractional step taken each time the hover() method is called. Defaults to 8. - * - * Affects the speed at which the tiltAngle and panAngle resolve to their targets. - * - * @see #tiltAngle - * @see #panAngle - */ - get: function () { - return this._steps; - }, - set: function (val) { - val = (val < 1) ? 1 : val; - - if (this._steps == val) - return; - - this._steps = val; - - this.pNotifyUpdate(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(FirstPersonController.prototype, "panAngle", { - /** - * Rotation of the camera in degrees around the y axis. Defaults to 0. - */ - get: function () { - return this._panAngle; - }, - set: function (val) { - if (this._panAngle == val) - return; - - this._panAngle = val; - - this.pNotifyUpdate(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(FirstPersonController.prototype, "tiltAngle", { - /** - * Elevation angle of the camera in degrees. Defaults to 90. - */ - get: function () { - return this._tiltAngle; - }, - set: function (val) { - val = Math.max(this._minTiltAngle, Math.min(this._maxTiltAngle, val)); - - if (this._tiltAngle == val) - return; - - this._tiltAngle = val; - - this.pNotifyUpdate(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(FirstPersonController.prototype, "minTiltAngle", { - /** - * Minimum bounds for the tiltAngle. Defaults to -90. - * - * @see #tiltAngle - */ - get: function () { - return this._minTiltAngle; - }, - set: function (val) { - if (this._minTiltAngle == val) - return; - - this._minTiltAngle = val; - - this.tiltAngle = Math.max(this._minTiltAngle, Math.min(this._maxTiltAngle, this._tiltAngle)); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(FirstPersonController.prototype, "maxTiltAngle", { - /** - * Maximum bounds for the tiltAngle. Defaults to 90. - * - * @see #tiltAngle - */ - get: function () { - return this._maxTiltAngle; - }, - set: function (val) { - if (this._maxTiltAngle == val) - return; - - this._maxTiltAngle = val; - - this.tiltAngle = Math.max(this._minTiltAngle, Math.min(this._maxTiltAngle, this._tiltAngle)); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(FirstPersonController.prototype, "wrapPanAngle", { - /** - * Defines whether the value of the pan angle wraps when over 360 degrees or under 0 degrees. Defaults to false. - */ - get: function () { - return this._wrapPanAngle; - }, - set: function (val) { - if (this._wrapPanAngle == val) - return; - - this._wrapPanAngle = val; - - this.pNotifyUpdate(); - }, - enumerable: true, - configurable: true - }); - - - /** - * Updates the current tilt angle and pan angle values. - * - * Values are calculated using the defined tiltAngle, panAngle and steps variables. - * - * @param interpolate If the update to a target pan- or tiltAngle is interpolated. Default is true. - * - * @see #tiltAngle - * @see #panAngle - * @see #steps - */ - FirstPersonController.prototype.update = function (interpolate) { - if (typeof interpolate === "undefined") { interpolate = true; } - if (this._tiltAngle != this._iCurrentTiltAngle || this._panAngle != this._iCurrentPanAngle) { - this.pNotifyUpdate(); - - if (this._wrapPanAngle) { - if (this._panAngle < 0) { - this._iCurrentPanAngle += this._panAngle % 360 + 360 - this._panAngle; - this._panAngle = this._panAngle % 360 + 360; - } else { - this._iCurrentPanAngle += this._panAngle % 360 - this._panAngle; - this._panAngle = this._panAngle % 360; - } - - while (this._panAngle - this._iCurrentPanAngle < -180) - this._iCurrentPanAngle -= 360; - - while (this._panAngle - this._iCurrentPanAngle > 180) - this._iCurrentPanAngle += 360; - } - - if (interpolate) { - this._iCurrentTiltAngle += (this._tiltAngle - this._iCurrentTiltAngle) / (this.steps + 1); - this._iCurrentPanAngle += (this._panAngle - this._iCurrentPanAngle) / (this.steps + 1); - } else { - this._iCurrentTiltAngle = this._tiltAngle; - this._iCurrentPanAngle = this._panAngle; - } - - //snap coords if angle differences are close - if ((Math.abs(this.tiltAngle - this._iCurrentTiltAngle) < 0.01) && (Math.abs(this._panAngle - this._iCurrentPanAngle) < 0.01)) { - this._iCurrentTiltAngle = this._tiltAngle; - this._iCurrentPanAngle = this._panAngle; - } - } - - this.targetObject.rotationX = this._iCurrentTiltAngle; - this.targetObject.rotationY = this._iCurrentPanAngle; - - if (this._walkIncrement) { - if (this.fly) { - this.targetObject.transform.moveForward(this._walkIncrement); - } else { - this.targetObject.x += this._walkIncrement * Math.sin(this._panAngle * away.geom.MathConsts.DEGREES_TO_RADIANS); - this.targetObject.z += this._walkIncrement * Math.cos(this._panAngle * away.geom.MathConsts.DEGREES_TO_RADIANS); - } - this._walkIncrement = 0; - } - - if (this._strafeIncrement) { - this.targetObject.transform.moveRight(this._strafeIncrement); - this._strafeIncrement = 0; - } - }; - - FirstPersonController.prototype.incrementWalk = function (val) { - if (val == 0) - return; - - this._walkIncrement += val; - - this.pNotifyUpdate(); - }; - - FirstPersonController.prototype.incrementStrafe = function (val) { - if (val == 0) - return; - - this._strafeIncrement += val; - - this.pNotifyUpdate(); - }; - return FirstPersonController; - })(controllers.ControllerBase); - controllers.FirstPersonController = FirstPersonController; - })(away.controllers || (away.controllers = {})); - var controllers = away.controllers; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (controllers) { - /** - * Controller used to follow behind an object on the XZ plane, with an optional - * elevation (tiltAngle). - * - * @see away3d.containers.View3D - */ - var FollowController = (function (_super) { - __extends(FollowController, _super); - function FollowController(targetObject, lookAtObject, tiltAngle, distance) { - if (typeof targetObject === "undefined") { targetObject = null; } - if (typeof lookAtObject === "undefined") { lookAtObject = null; } - if (typeof tiltAngle === "undefined") { tiltAngle = 45; } - if (typeof distance === "undefined") { distance = 700; } - _super.call(this, targetObject, lookAtObject, 0, tiltAngle, distance); - } - FollowController.prototype.update = function (interpolate) { - if (typeof interpolate === "undefined") { interpolate = true; } - interpolate = interpolate; // unused: prevents warning - - if (!this.lookAtObject) - return; - - this.panAngle = this._pLookAtObject.rotationY - 180; - _super.prototype.update.call(this); - }; - return FollowController; - })(controllers.HoverController); - controllers.FollowController = FollowController; - })(away.controllers || (away.controllers = {})); - var controllers = away.controllers; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (controllers) { - var Vector3D = away.geom.Vector3D; - - /** - * Uses spring physics to animate the target object towards a position that is - * defined as the lookAtTarget object's position plus the vector defined by the - * positionOffset property. - */ - var SpringController = (function (_super) { - __extends(SpringController, _super); - function SpringController(targetObject, lookAtObject, stiffness, mass, damping) { - if (typeof targetObject === "undefined") { targetObject = null; } - if (typeof lookAtObject === "undefined") { lookAtObject = null; } - if (typeof stiffness === "undefined") { stiffness = 1; } - if (typeof mass === "undefined") { mass = 40; } - if (typeof damping === "undefined") { damping = 4; } - _super.call(this, targetObject, lookAtObject); - /** - * Offset of spring center from target in target object space, ie: Where the camera should ideally be in the target object space. - */ - this.positionOffset = new Vector3D(0, 500, -1000); - - this.stiffness = stiffness; - this.damping = damping; - this.mass = mass; - - this._velocity = new Vector3D(); - this._dv = new Vector3D(); - this._stretch = new Vector3D(); - this._force = new Vector3D(); - this._acceleration = new Vector3D(); - this._desiredPosition = new Vector3D(); - } - SpringController.prototype.update = function (interpolate) { - if (typeof interpolate === "undefined") { interpolate = true; } - var offs; - - if (!this._pLookAtObject || !this._pTargetObject) - return; - - offs = this._pLookAtObject.transform.matrix3D.deltaTransformVector(this.positionOffset); - this._desiredPosition.x = this._pLookAtObject.x + offs.x; - this._desiredPosition.y = this._pLookAtObject.y + offs.y; - this._desiredPosition.z = this._pLookAtObject.z + offs.z; - - this._stretch = this._pTargetObject.transform.position.add(this._desiredPosition); - this._stretch.scaleBy(-this.stiffness); - - this._dv.copyFrom(this._velocity); - this._dv.scaleBy(this.damping); - - this._force.x = this._stretch.x - this._dv.x; - this._force.y = this._stretch.y - this._dv.y; - this._force.z = this._stretch.z - this._dv.z; - - this._acceleration.copyFrom(this._force); - this._acceleration.scaleBy(1 / this.mass); - - this._velocity.incrementBy(this._acceleration); - - this._pTargetObject.transform.position = this._pTargetObject.transform.position.add(this._velocity); - - _super.prototype.update.call(this); - }; - return SpringController; - })(controllers.LookAtController); - controllers.SpringController = SpringController; - })(away.controllers || (away.controllers = {})); - var controllers = away.controllers; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var AssetType = away.library.AssetType; - - /** - * LightPickerBase provides an abstract base clase for light picker classes. These classes are responsible for - * feeding materials with relevant lights. Usually, StaticLightPicker can be used, but LightPickerBase can be - * extended to provide more application-specific dynamic selection of lights. - * - * @see StaticLightPicker - */ - var LightPickerBase = (function (_super) { - __extends(LightPickerBase, _super); - /** - * Creates a new LightPickerBase object. - */ - function LightPickerBase() { - _super.call(this); - this._pNumPointLights = 0; - this._pNumDirectionalLights = 0; - this._pNumCastingPointLights = 0; - this._pNumCastingDirectionalLights = 0; - this._pNumLightProbes = 0; - } - /** - * Disposes resources used by the light picker. - */ - LightPickerBase.prototype.dispose = function () { - }; - - Object.defineProperty(LightPickerBase.prototype, "assetType", { - /** - * @inheritDoc - */ - get: function () { - return AssetType.LIGHT_PICKER; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LightPickerBase.prototype, "numDirectionalLights", { - /** - * The maximum amount of directional lights that will be provided. - */ - get: function () { - return this._pNumDirectionalLights; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LightPickerBase.prototype, "numPointLights", { - /** - * The maximum amount of point lights that will be provided. - */ - get: function () { - return this._pNumPointLights; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LightPickerBase.prototype, "numCastingDirectionalLights", { - /** - * The maximum amount of directional lights that cast shadows. - */ - get: function () { - return this._pNumCastingDirectionalLights; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LightPickerBase.prototype, "numCastingPointLights", { - /** - * The amount of point lights that cast shadows. - */ - get: function () { - return this._pNumCastingPointLights; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LightPickerBase.prototype, "numLightProbes", { - /** - * The maximum amount of light probes that will be provided. - */ - get: function () { - return this._pNumLightProbes; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LightPickerBase.prototype, "pointLights", { - /** - * The collected point lights to be used for shading. - */ - get: function () { - return this._pPointLights; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LightPickerBase.prototype, "directionalLights", { - /** - * The collected directional lights to be used for shading. - */ - get: function () { - return this._pDirectionalLights; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LightPickerBase.prototype, "castingPointLights", { - /** - * The collected point lights that cast shadows to be used for shading. - */ - get: function () { - return this._pCastingPointLights; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LightPickerBase.prototype, "castingDirectionalLights", { - /** - * The collected directional lights that cast shadows to be used for shading. - */ - get: function () { - return this._pCastingDirectionalLights; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LightPickerBase.prototype, "lightProbes", { - /** - * The collected light probes to be used for shading. - */ - get: function () { - return this._pLightProbes; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LightPickerBase.prototype, "lightProbeWeights", { - /** - * The weights for each light probe, defining their influence on the object. - */ - get: function () { - return this._pLightProbeWeights; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(LightPickerBase.prototype, "allPickedLights", { - /** - * A collection of all the collected lights. - */ - get: function () { - return this._pAllPickedLights; - }, - enumerable: true, - configurable: true - }); - - /** - * Updates set of lights for a given renderable and EntityCollector. Always call super.collectLights() after custom overridden code. - */ - LightPickerBase.prototype.collectLights = function (renderable) { - this.updateProbeWeights(renderable); - }; - - /** - * Updates the weights for the light probes, based on the renderable's position relative to them. - * @param renderable The renderble for which to calculate the light probes' influence. - */ - LightPickerBase.prototype.updateProbeWeights = function (renderable) { - // todo: this will cause the same calculations to occur per TriangleSubMesh. See if this can be improved. - var objectPos = renderable.sourceEntity.scenePosition; - var lightPos; - - var rx = objectPos.x, ry = objectPos.y, rz = objectPos.z; - var dx, dy, dz; - var w, total = 0; - var i; - - for (i = 0; i < this._pNumLightProbes; ++i) { - lightPos = this._pLightProbes[i].scenePosition; - dx = rx - lightPos.x; - dy = ry - lightPos.y; - dz = rz - lightPos.z; - - // weight is inversely proportional to square of distance - w = dx * dx + dy * dy + dz * dz; - - // just... huge if at the same spot - w = w > .00001 ? 1 / w : 50000000; - this._pLightProbeWeights[i] = w; - total += w; - } - - // normalize - total = 1 / total; - - for (i = 0; i < this._pNumLightProbes; ++i) - this._pLightProbeWeights[i] *= total; - }; - return LightPickerBase; - })(away.library.NamedAssetBase); - materials.LightPickerBase = LightPickerBase; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var DirectionalLight = away.entities.DirectionalLight; - var LightProbe = away.entities.LightProbe; - var PointLight = away.entities.PointLight; - var Event = away.events.Event; - var LightEvent = away.events.LightEvent; - - /** - * StaticLightPicker is a light picker that provides a static set of lights. The lights can be reassigned, but - * if the configuration changes (number of directional lights, point lights, etc), a material recompilation may - * occur. - */ - var StaticLightPicker = (function (_super) { - __extends(StaticLightPicker, _super); - /** - * Creates a new StaticLightPicker object. - * @param lights The lights to be used for shading. - */ - function StaticLightPicker(lights) { - var _this = this; - _super.call(this); - - this._onCastShadowChangeDelegate = function (event) { - return _this.onCastShadowChange(event); - }; - - this.lights = lights; - } - Object.defineProperty(StaticLightPicker.prototype, "lights", { - /** - * The lights used for shading. - */ - get: function () { - return this._lights; - }, - set: function (value) { - var numPointLights = 0; - var numDirectionalLights = 0; - var numCastingPointLights = 0; - var numCastingDirectionalLights = 0; - var numLightProbes = 0; - var light; - - if (this._lights) - this.clearListeners(); - - this._lights = value; - this._pAllPickedLights = value; - this._pPointLights = new Array(); - this._pCastingPointLights = new Array(); - this._pDirectionalLights = new Array(); - this._pCastingDirectionalLights = new Array(); - this._pLightProbes = new Array(); - - var len = value.length; - - for (var i = 0; i < len; ++i) { - light = value[i]; - light.addEventListener(LightEvent.CASTS_SHADOW_CHANGE, this._onCastShadowChangeDelegate); - - if (light instanceof PointLight) { - if (light.castsShadows) - this._pCastingPointLights[numCastingPointLights++] = light; - else - this._pPointLights[numPointLights++] = light; - } else if (light instanceof DirectionalLight) { - if (light.castsShadows) - this._pCastingDirectionalLights[numCastingDirectionalLights++] = light; - else - this._pDirectionalLights[numDirectionalLights++] = light; - } else if (light instanceof LightProbe) { - this._pLightProbes[numLightProbes++] = light; - } - } - - if (this._pNumDirectionalLights == numDirectionalLights && this._pNumPointLights == numPointLights && this._pNumLightProbes == numLightProbes && this._pNumCastingPointLights == numCastingPointLights && this._pNumCastingDirectionalLights == numCastingDirectionalLights) - return; - - this._pNumDirectionalLights = numDirectionalLights; - this._pNumCastingDirectionalLights = numCastingDirectionalLights; - this._pNumPointLights = numPointLights; - this._pNumCastingPointLights = numCastingPointLights; - this._pNumLightProbes = numLightProbes; - - // MUST HAVE MULTIPLE OF 4 ELEMENTS! - this._pLightProbeWeights = new Array(Math.ceil(numLightProbes / 4) * 4); - - // notify material lights have changed - this.dispatchEvent(new Event(Event.CHANGE)); - }, - enumerable: true, - configurable: true - }); - - - /** - * Remove configuration change listeners on the lights. - */ - StaticLightPicker.prototype.clearListeners = function () { - var len = this._lights.length; - for (var i = 0; i < len; ++i) - this._lights[i].removeEventListener(LightEvent.CASTS_SHADOW_CHANGE, this._onCastShadowChangeDelegate); - }; - - /** - * Notifies the material of a configuration change. - */ - StaticLightPicker.prototype.onCastShadowChange = function (event) { - // TODO: Assign to special caster collections, just append it to the lights in SinglePass - // But keep seperated in multipass - var light = event.target; - - if (light instanceof PointLight) - this.updatePointCasting(light); - else if (light instanceof DirectionalLight) - this.updateDirectionalCasting(light); - - this.dispatchEvent(new Event(Event.CHANGE)); - }; - - /** - * Called when a directional light's shadow casting configuration changes. - */ - StaticLightPicker.prototype.updateDirectionalCasting = function (light) { - var dl = light; - - if (light.castsShadows) { - --this._pNumDirectionalLights; - ++this._pNumCastingDirectionalLights; - - this._pDirectionalLights.splice(this._pDirectionalLights.indexOf(dl), 1); - this._pCastingDirectionalLights.push(light); - } else { - ++this._pNumDirectionalLights; - --this._pNumCastingDirectionalLights; - - this._pCastingDirectionalLights.splice(this._pCastingDirectionalLights.indexOf(dl), 1); - this._pDirectionalLights.push(light); - } - }; - - /** - * Called when a point light's shadow casting configuration changes. - */ - StaticLightPicker.prototype.updatePointCasting = function (light) { - var pl = light; - - if (light.castsShadows) { - --this._pNumPointLights; - ++this._pNumCastingPointLights; - this._pPointLights.splice(this._pPointLights.indexOf(pl), 1); - this._pCastingPointLights.push(light); - } else { - ++this._pNumPointLights; - --this._pNumCastingPointLights; - - this._pCastingPointLights.splice(this._pCastingPointLights.indexOf(pl), 1); - this._pPointLights.push(light); - } - }; - return StaticLightPicker; - })(materials.LightPickerBase); - materials.StaticLightPicker = StaticLightPicker; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -var away; -(function (away) { - (function (materials) { - /** - * Enumeration class for defining which lighting types affect the specific material - * lighting component (diffuse and specular). This can be useful if, for example, you - * want to use light probes for diffuse global lighting, but want specular reflections from - * traditional light sources without those affecting the diffuse light. - * - * @see away.materials.ColorMaterial.diffuseLightSources - * @see away.materials.ColorMaterial.specularLightSources - * @see away.materials.TextureMaterial.diffuseLightSources - * @see away.materials.TextureMaterial.specularLightSources - */ - var LightSources = (function () { - function LightSources() { - } - LightSources.LIGHTS = 0x01; - - LightSources.PROBES = 0x02; - - LightSources.ALL = 0x03; - return LightSources; - })(); - materials.LightSources = LightSources; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var BlendMode = away.base.BlendMode; - - var Event = away.events.Event; - - var AssetType = away.library.AssetType; - - /** - * MaterialBase forms an abstract base class for any material. - * A material consists of several passes, each of which constitutes at least one render call. Several passes could - * be used for special effects (render lighting for many lights in several passes, render an outline in a separate - * pass) or to provide additional render-to-texture passes (rendering diffuse light to texture for texture-space - * subsurface scattering, or rendering a depth map for specialized self-shadowing). - * - * Away3D provides default materials trough SinglePassMaterialBase and TriangleMaterial, which use modular - * methods to build the shader code. MaterialBase can be extended to build specific and high-performant custom - * shaders, or entire new material frameworks. - */ - var MaterialBase = (function (_super) { - __extends(MaterialBase, _super); - /** - * Creates a new MaterialBase object. - */ - function MaterialBase() { - var _this = this; - _super.call(this); - this._materialPassData = new Array(); - this._materialData = new Array(); - this._pAlphaThreshold = 0; - this._pAnimateUVs = false; - this._enableLightFallOff = true; - this._specularLightSources = 0x01; - this._diffuseLightSources = 0x03; - /** - * An id for this material used to sort the renderables by shader program, which reduces Program state changes. - * - * @private - */ - this._iMaterialId = 0; - this._iBaseScreenPassIndex = 0; - this._bothSides = false; - this._pScreenPassesInvalid = true; - this._pBlendMode = BlendMode.NORMAL; - this._numPasses = 0; - this._mipmap = false; - this._smooth = true; - this._repeat = false; - this._color = 0xFFFFFF; - this._pHeight = 1; - this._pWidth = 1; - this._pRequiresBlending = false; - - this._iMaterialId = Number(this.id); - - this._owners = new Array(); - this._passes = new Array(); - - this._onPassChangeDelegate = function (event) { - return _this.onPassChange(event); - }; - this._onLightChangeDelegate = function (event) { - return _this.onLightsChange(event); - }; - - this.alphaPremultiplied = false; //TODO: work out why this is different for WebGL - } - Object.defineProperty(MaterialBase.prototype, "assetType", { - /** - * @inheritDoc - */ - get: function () { - return AssetType.MATERIAL; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(MaterialBase.prototype, "height", { - /** - * - */ - get: function () { - return this._pHeight; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(MaterialBase.prototype, "animationSet", { - /** - * - */ - get: function () { - return this._animationSet; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(MaterialBase.prototype, "lightPicker", { - /** - * The light picker used by the material to provide lights to the material if it supports lighting. - * - * @see LightPickerBase - * @see StaticLightPicker - */ - get: function () { - return this._pLightPicker; - }, - set: function (value) { - if (this._pLightPicker == value) - return; - - if (this._pLightPicker) - this._pLightPicker.removeEventListener(Event.CHANGE, this._onLightChangeDelegate); - - this._pLightPicker = value; - - if (this._pLightPicker) - this._pLightPicker.addEventListener(Event.CHANGE, this._onLightChangeDelegate); - - this._pInvalidateScreenPasses(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(MaterialBase.prototype, "mipmap", { - /** - * Indicates whether or not any used textures should use mipmapping. Defaults to true. - */ - get: function () { - return this._mipmap; - }, - set: function (value) { - if (this._mipmap == value) - return; - - this._mipmap = value; - - this._pInvalidatePasses(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(MaterialBase.prototype, "smooth", { - /** - * Indicates whether or not any used textures should use smoothing. - */ - get: function () { - return this._smooth; - }, - set: function (value) { - if (this._smooth == value) - return; - - this._smooth = value; - - this._pInvalidatePasses(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(MaterialBase.prototype, "repeat", { - /** - * Indicates whether or not any used textures should be tiled. If set to false, texture samples are clamped to - * the texture's borders when the uv coordinates are outside the [0, 1] interval. - */ - get: function () { - return this._repeat; - }, - set: function (value) { - if (this._repeat == value) - return; - - this._repeat = value; - - this._pInvalidatePasses(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(MaterialBase.prototype, "color", { - /** - * The diffuse reflectivity color of the surface. - */ - get: function () { - return this._color; - }, - set: function (value) { - if (this._color == value) - return; - - this._color = value; - - this._pInvalidatePasses(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(MaterialBase.prototype, "texture", { - /** - * The texture object to use for the albedo colour. - */ - get: function () { - return this._pTexture; - }, - set: function (value) { - if (this._pTexture == value) - return; - - this._pTexture = value; - - this._pInvalidatePasses(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(MaterialBase.prototype, "animateUVs", { - /** - * Specifies whether or not the UV coordinates should be animated using a transformation matrix. - */ - get: function () { - return this._pAnimateUVs; - }, - set: function (value) { - if (this._pAnimateUVs == value) - return; - - this._pAnimateUVs = value; - - this._pInvalidatePasses(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(MaterialBase.prototype, "enableLightFallOff", { - /** - * Whether or not to use fallOff and radius properties for lights. This can be used to improve performance and - * compatibility for constrained mode. - */ - get: function () { - return this._enableLightFallOff; - }, - set: function (value) { - if (this._enableLightFallOff == value) - return; - - this._enableLightFallOff = value; - - this._pInvalidatePasses(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(MaterialBase.prototype, "diffuseLightSources", { - /** - * Define which light source types to use for diffuse reflections. This allows choosing between regular lights - * and/or light probes for diffuse reflections. - * - * @see away3d.materials.LightSources - */ - get: function () { - return this._diffuseLightSources; - }, - set: function (value) { - if (this._diffuseLightSources == value) - return; - - this._diffuseLightSources = value; - - this._pInvalidatePasses(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(MaterialBase.prototype, "specularLightSources", { - /** - * Define which light source types to use for specular reflections. This allows choosing between regular lights - * and/or light probes for specular reflections. - * - * @see away3d.materials.LightSources - */ - get: function () { - return this._specularLightSources; - }, - set: function (value) { - if (this._specularLightSources == value) - return; - - this._specularLightSources = value; - - this._pInvalidatePasses(); - }, - enumerable: true, - configurable: true - }); - - - /** - * Cleans up resources owned by the material, including passes. Textures are not owned by the material since they - * could be used by other materials and will not be disposed. - */ - MaterialBase.prototype.dispose = function () { - var i; - var len; - - this._pClearScreenPasses(); - - len = this._materialData.length; - for (i = 0; i < len; i++) - this._materialData[i].dispose(); - - this._materialData = new Array(); - - len = this._materialPassData.length; - for (i = 0; i < len; i++) - this._materialPassData[i].dispose(); - - this._materialPassData = new Array(); - }; - - Object.defineProperty(MaterialBase.prototype, "bothSides", { - /** - * Defines whether or not the material should cull triangles facing away from the camera. - */ - get: function () { - return this._bothSides; - }, - set: function (value) { - if (this._bothSides = value) - return; - - this._bothSides = value; - - this._pInvalidatePasses(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(MaterialBase.prototype, "blendMode", { - /** - * The blend mode to use when drawing this renderable. The following blend modes are supported: - *
    - *
  • BlendMode.NORMAL: No blending, unless the material inherently needs it
  • - *
  • BlendMode.LAYER: Force blending. This will draw the object the same as NORMAL, but without writing depth writes.
  • - *
  • BlendMode.MULTIPLY
  • - *
  • BlendMode.ADD
  • - *
  • BlendMode.ALPHA
  • - *
- */ - get: function () { - return this._pBlendMode; - }, - set: function (value) { - if (this._pBlendMode == value) - return; - - this._pBlendMode = value; - - this._pInvalidatePasses(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(MaterialBase.prototype, "alphaPremultiplied", { - /** - * Indicates whether visible textures (or other pixels) used by this material have - * already been premultiplied. Toggle this if you are seeing black halos around your - * blended alpha edges. - */ - get: function () { - return this._alphaPremultiplied; - }, - set: function (value) { - if (this._alphaPremultiplied == value) - return; - - this._alphaPremultiplied = value; - - this._pInvalidatePasses(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(MaterialBase.prototype, "alphaThreshold", { - /** - * The minimum alpha value for which pixels should be drawn. This is used for transparency that is either - * invisible or entirely opaque, often used with textures for foliage, etc. - * Recommended values are 0 to disable alpha, or 0.5 to create smooth edges. Default value is 0 (disabled). - */ - get: function () { - return this._pAlphaThreshold; - }, - set: function (value) { - if (value < 0) - value = 0; - else if (value > 1) - value = 1; - - if (this._pAlphaThreshold == value) - return; - - this._pAlphaThreshold = value; - - this._pInvalidatePasses(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(MaterialBase.prototype, "requiresBlending", { - /** - * Indicates whether or not the material requires alpha blending during rendering. - */ - get: function () { - return this._pRequiresBlending; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(MaterialBase.prototype, "width", { - /** - * - */ - get: function () { - return this._pWidth; - }, - enumerable: true, - configurable: true - }); - - /** - * Sets the render state for a pass that is independent of the rendered object. This needs to be called before - * calling renderPass. Before activating a pass, the previously used pass needs to be deactivated. - * @param pass The pass data to activate. - * @param stage The Stage object which is currently used for rendering. - * @param camera The camera from which the scene is viewed. - * @private - */ - MaterialBase.prototype._iActivatePass = function (pass, stage, camera) { - pass.materialPass._iActivate(pass, stage, camera); - }; - - /** - * Clears the render state for a pass. This needs to be called before activating another pass. - * @param pass The pass to deactivate. - * @param stage The Stage used for rendering - * - * @internal - */ - MaterialBase.prototype._iDeactivatePass = function (pass, stage) { - pass.materialPass._iDeactivate(pass, stage); - }; - - /** - * Renders the current pass. Before calling renderPass, activatePass needs to be called with the same index. - * @param pass The pass used to render the renderable. - * @param renderable The IRenderable object to draw. - * @param stage The Stage object used for rendering. - * @param entityCollector The EntityCollector object that contains the visible scene data. - * @param viewProjection The view-projection matrix used to project to the screen. This is not the same as - * camera.viewProjection as it includes the scaling factors when rendering to textures. - * - * @internal - */ - MaterialBase.prototype._iRenderPass = function (pass, renderable, stage, camera, viewProjection) { - if (this._pLightPicker) - this._pLightPicker.collectLights(renderable); - - pass.materialPass._iRender(pass, renderable, stage, camera, viewProjection); - }; - - // - // MATERIAL MANAGEMENT - // - /** - * Mark an IMaterialOwner as owner of this material. - * Assures we're not using the same material across renderables with different animations, since the - * Programs depend on animation. This method needs to be called when a material is assigned. - * - * @param owner The IMaterialOwner that had this material assigned - * - * @internal - */ - MaterialBase.prototype.iAddOwner = function (owner) { - this._owners.push(owner); - - var animationSet; - var animator = owner.animator; - - if (animator) - animationSet = animator.animationSet; - - if (owner.animator) { - if (this._animationSet && animationSet != this._animationSet) { - throw new Error("A Material instance cannot be shared across material owners with different animation sets"); - } else { - if (this._animationSet != animationSet) { - this._animationSet = animationSet; - - this.invalidateAnimation(); - } - } - } - }; - - /** - * Removes an IMaterialOwner as owner. - * @param owner - * - * @internal - */ - MaterialBase.prototype.iRemoveOwner = function (owner) { - this._owners.splice(this._owners.indexOf(owner), 1); - - if (this._owners.length == 0) { - this._animationSet = null; - - this.invalidateAnimation(); - } - }; - - Object.defineProperty(MaterialBase.prototype, "iOwners", { - /** - * A list of the IMaterialOwners that use this material - * - * @private - */ - get: function () { - return this._owners; - }, - enumerable: true, - configurable: true - }); - - /** - * The amount of passes used by the material. - * - * @private - */ - MaterialBase.prototype._iNumScreenPasses = function () { - return this._numPasses; - }; - - Object.defineProperty(MaterialBase.prototype, "_iScreenPasses", { - /** - * A list of the screen passes used in this material - * - * @private - */ - get: function () { - return this._passes; - }, - enumerable: true, - configurable: true - }); - - /** - * Marks the shader programs for all passes as invalid, so they will be recompiled before the next use. - * - * @private - */ - MaterialBase.prototype._pInvalidatePasses = function () { - var len = this._materialPassData.length; - for (var i = 0; i < len; i++) - this._materialPassData[i].invalidate(); - - this.invalidateMaterial(); - }; - - /** - * Flags that the screen passes have become invalid and need possible re-ordering / adding / deleting - */ - MaterialBase.prototype._pInvalidateScreenPasses = function () { - this._pScreenPassesInvalid = true; - }; - - /** - * Removes a pass from the material. - * @param pass The pass to be removed. - */ - MaterialBase.prototype._pRemoveScreenPass = function (pass) { - pass.removeEventListener(Event.CHANGE, this._onPassChangeDelegate); - this._passes.splice(this._passes.indexOf(pass), 1); - - this._numPasses--; - }; - - /** - * Removes all passes from the material - */ - MaterialBase.prototype._pClearScreenPasses = function () { - for (var i = 0; i < this._numPasses; ++i) - this._passes[i].removeEventListener(Event.CHANGE, this._onPassChangeDelegate); - - this._passes.length = this._numPasses = 0; - }; - - /** - * Adds a pass to the material - * @param pass - */ - MaterialBase.prototype._pAddScreenPass = function (pass) { - this._passes[this._numPasses++] = pass; - - pass.lightPicker = this._pLightPicker; - pass.addEventListener(Event.CHANGE, this._onPassChangeDelegate); - - this.invalidateMaterial(); - }; - - MaterialBase.prototype._iAddMaterialData = function (materialData) { - this._materialData.push(materialData); - - return materialData; - }; - - MaterialBase.prototype._iRemoveMaterialData = function (materialData) { - this._materialData.splice(this._materialData.indexOf(materialData), 1); - - return materialData; - }; - - /** - * Performs any processing that needs to occur before any of its passes are used. - * - * @private - */ - MaterialBase.prototype._iUpdateMaterial = function () { - }; - - /** - * Listener for when a pass's shader code changes. It recalculates the render order id. - */ - MaterialBase.prototype.onPassChange = function (event) { - this.invalidateMaterial(); - }; - - MaterialBase.prototype.invalidateAnimation = function () { - var len = this._materialData.length; - for (var i = 0; i < len; i++) - this._materialData[i].invalidateAnimation(); - }; - - MaterialBase.prototype.invalidateMaterial = function () { - var len = this._materialData.length; - for (var i = 0; i < len; i++) - this._materialData[i].invalidateMaterial(); - }; - - /** - * Called when the light picker's configuration changed. - */ - MaterialBase.prototype.onLightsChange = function (event) { - this._pInvalidateScreenPasses(); - }; - - MaterialBase.prototype._iAddMaterialPassData = function (materialPassData) { - this._materialPassData.push(materialPassData); - - return materialPassData; - }; - - MaterialBase.prototype._iRemoveMaterialPassData = function (materialPassData) { - this._materialPassData.splice(this._materialPassData.indexOf(materialPassData), 1); - - return materialPassData; - }; - return MaterialBase; - })(away.library.NamedAssetBase); - materials.MaterialBase = MaterialBase; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var MaterialEvent = away.events.MaterialEvent; - - /** - * MaterialBase forms an abstract base class for any material. - * A material consists of several passes, each of which constitutes at least one render call. Several passes could - * be used for special effects (render lighting for many lights in several passes, render an outline in a separate - * pass) or to provide additional render-to-texture passes (rendering diffuse light to texture for texture-space - * subsurface scattering, or rendering a depth map for specialized self-shadowing). - * - * Away3D provides default materials trough SinglePassMaterialBase and MultiPassMaterialBase, which use modular - * methods to build the shader code. MaterialBase can be extended to build specific and high-performant custom - * shaders, or entire new material frameworks. - */ - var CSSMaterialBase = (function (_super) { - __extends(CSSMaterialBase, _super); - /** - * Creates a new MaterialBase object. - */ - function CSSMaterialBase(texture, smooth, repeat) { - if (typeof texture === "undefined") { texture = null; } - if (typeof smooth === "undefined") { smooth = true; } - if (typeof repeat === "undefined") { repeat = false; } - _super.call(this); - - this._iMaterialId = Number(this.id); - - this.texture = texture; - - this.smooth = smooth; - this.repeat = repeat; - } - Object.defineProperty(CSSMaterialBase.prototype, "imageElement", { - get: function () { - return this._imageElement; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(CSSMaterialBase.prototype, "imageStyle", { - get: function () { - return this._imageStyle; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(CSSMaterialBase.prototype, "texture", { - /** - * The texture object to use for the albedo colour. - */ - get: function () { - return this._pTexture; - }, - set: function (value) { - if (this._pTexture == value) - return; - - this._pTexture = value; - - if (value instanceof away.textures.ImageTexture) { - this._imageElement = value.htmlImageElement; - - var node = document.createElement("style"); - node.type = "text/css"; - document.getElementsByTagName("head")[0].appendChild(node); - - var sheet = document.styleSheets[document.styleSheets.length - 1]; - sheet.insertRule(".material" + this.id + "{ }", 0); - var style = sheet.cssRules[0].style; - - style.backgroundImage = "url(" + this._imageElement.src + ")"; - style.backgroundSize = "100% 100%"; - style.position = "absolute"; - style.width = this._imageElement.width + "px"; - style.height = this._imageElement.height + "px"; - style.transformOrigin = style["-webkit-transform-origin"] = style["-moz-transform-origin"] = style["-o-transform-origin"] = style["-ms-transform-origin"] = "0% 0%"; - - this._pHeight = this._imageElement.height; - this._pWidth = this._imageElement.width; - - this.notifySizeChanged(); - } - }, - enumerable: true, - configurable: true - }); - - - CSSMaterialBase.prototype.notifySizeChanged = function () { - if (!this._sizeChanged) - this._sizeChanged = new MaterialEvent(MaterialEvent.SIZE_CHANGED); - - this.dispatchEvent(this._sizeChanged); - }; - return CSSMaterialBase; - })(materials.MaterialBase); - materials.CSSMaterialBase = CSSMaterialBase; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (prefabs) { - // import BatchObject = away.base.BatchObject; - var AbstractMethodError = away.errors.AbstractMethodError; - - /** - * PrefabBase is an abstract base class for prefabs, which are prebuilt display objects that allow easy cloning and updating - */ - var PrefabBase = (function (_super) { - __extends(PrefabBase, _super); - // public _pBatchObjects:Array = new Array(); - /** - * Creates a new PrefabBase object. - */ - function PrefabBase() { - _super.call(this); - this._pObjects = new Array(); - } - /** - * Returns a display object generated from this prefab - */ - PrefabBase.prototype.getNewObject = function () { - var object = this._pCreateObject(); - - this._pObjects.push(object); - - return object; - }; - - // public getNewBatchObject():BatchObject - // { - // var object:BatchObject = this._pCreateBatchObject(); - // - // this._pBatchObjects.push(object); - // - // return object; - // } - PrefabBase.prototype._pCreateObject = function () { - throw new AbstractMethodError(); - }; - - PrefabBase.prototype._iValidate = function () { - // To be overridden when necessary - }; - return PrefabBase; - })(away.library.NamedAssetBase); - prefabs.PrefabBase = PrefabBase; - })(away.prefabs || (away.prefabs = {})); - var prefabs = away.prefabs; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (prefabs) { - var Geometry = away.base.Geometry; - - var TriangleSubGeometry = away.base.TriangleSubGeometry; - var LineSubGeometry = away.base.LineSubGeometry; - var Mesh = away.entities.Mesh; - - /** - * PrimitivePrefabBase is an abstract base class for polytope prefabs, which are simple pre-built geometric shapes - */ - var PrimitivePrefabBase = (function (_super) { - __extends(PrimitivePrefabBase, _super); - /** - * Creates a new PrimitivePrefabBase object. - * - * @param material The material with which to render the object - */ - function PrimitivePrefabBase(material, geometryType) { - if (typeof material === "undefined") { material = null; } - if (typeof geometryType === "undefined") { geometryType = "triangleSubGeometry"; } - _super.call(this); - this._geomDirty = true; - this._uvDirty = true; - this._geometryTypeDirty = true; - - this._geometry = new Geometry(); - this._material = material; - this._geometryType = geometryType; - } - Object.defineProperty(PrimitivePrefabBase.prototype, "assetType", { - /** - * - */ - get: function () { - return away.library.AssetType.PRIMITIVE_PREFAB; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(PrimitivePrefabBase.prototype, "geometryType", { - /** - * - */ - get: function () { - return this._geometryType; - }, - set: function (value) { - if (this._geometryType == value) - return; - - this._geometryType = value; - - this.invalidateGeometryType(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitivePrefabBase.prototype, "geometry", { - get: function () { - this._iValidate(); - - return this._geometry; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(PrimitivePrefabBase.prototype, "material", { - /** - * The material with which to render the primitive. - */ - get: function () { - return this._material; - }, - set: function (value) { - if (value == this._material) - return; - - this._material = value; - - var len = this._pObjects.length; - for (var i = 0; i < len; i++) - this._pObjects[i].material = this._material; - }, - enumerable: true, - configurable: true - }); - - - /** - * Builds the primitive's geometry when invalid. This method should not be called directly. The calling should - * be triggered by the invalidateGeometry method (and in turn by updateGeometry). - */ - PrimitivePrefabBase.prototype._pBuildGeometry = function (target, geometryType) { - throw new away.errors.AbstractMethodError(); - }; - - /** - * Builds the primitive's uv coordinates when invalid. This method should not be called directly. The calling - * should be triggered by the invalidateUVs method (and in turn by updateUVs). - */ - PrimitivePrefabBase.prototype._pBuildUVs = function (target, geometryType) { - throw new away.errors.AbstractMethodError(); - }; - - /** - * Invalidates the primitive's geometry type, causing it to be updated when requested. - */ - PrimitivePrefabBase.prototype.invalidateGeometryType = function () { - this._geometryTypeDirty = true; - this._geomDirty = true; - this._uvDirty = true; - }; - - /** - * Invalidates the primitive's geometry, causing it to be updated when requested. - */ - PrimitivePrefabBase.prototype._pInvalidateGeometry = function () { - this._geomDirty = true; - }; - - /** - * Invalidates the primitive's uv coordinates, causing them to be updated when requested. - */ - PrimitivePrefabBase.prototype._pInvalidateUVs = function () { - this._uvDirty = true; - }; - - /** - * Updates the subgeometry when invalid. - */ - PrimitivePrefabBase.prototype.updateGeometryType = function () { - //remove any existing sub geometry - if (this._subGeometry) - this._geometry.removeSubGeometry(this._subGeometry); - - if (this._geometryType == "triangleSubGeometry") { - var triangleGeometry = new TriangleSubGeometry(true); - triangleGeometry.autoDeriveNormals = false; - triangleGeometry.autoDeriveTangents = false; - triangleGeometry.autoDeriveUVs = false; - this._geometry.addSubGeometry(triangleGeometry); - this._subGeometry = triangleGeometry; - } else if (this._geometryType == "lineSubGeometry") { - this._geometry.addSubGeometry(this._subGeometry = new LineSubGeometry()); - } - - this._geometryTypeDirty = false; - }; - - /** - * Updates the geometry when invalid. - */ - PrimitivePrefabBase.prototype.updateGeometry = function () { - this._pBuildGeometry(this._subGeometry, this._geometryType); - - this._geomDirty = false; - }; - - /** - * Updates the uv coordinates when invalid. - */ - PrimitivePrefabBase.prototype.updateUVs = function () { - this._pBuildUVs(this._subGeometry, this._geometryType); - - this._uvDirty = false; - }; - - PrimitivePrefabBase.prototype._iValidate = function () { - if (this._geometryTypeDirty) - this.updateGeometryType(); - - if (this._geomDirty) - this.updateGeometry(); - - if (this._uvDirty) - this.updateUVs(); - }; - - PrimitivePrefabBase.prototype._pCreateObject = function () { - var mesh = new Mesh(this._geometry, this._material); - mesh._iSourcePrefab = this; - - return mesh; - }; - return PrimitivePrefabBase; - })(prefabs.PrefabBase); - prefabs.PrimitivePrefabBase = PrimitivePrefabBase; - })(away.prefabs || (away.prefabs = {})); - var prefabs = away.prefabs; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (prefabs) { - /** - * A UV Cylinder primitive mesh. - */ - var PrimitiveTorusPrefab = (function (_super) { - __extends(PrimitiveTorusPrefab, _super); - /** - * Creates a new Torus object. - * @param radius The radius of the torus. - * @param tuebRadius The radius of the inner tube of the torus. - * @param segmentsR Defines the number of horizontal segments that make up the torus. - * @param segmentsT Defines the number of vertical segments that make up the torus. - * @param yUp Defines whether the torus poles should lay on the Y-axis (true) or on the Z-axis (false). - */ - function PrimitiveTorusPrefab(radius, tubeRadius, segmentsR, segmentsT, yUp) { - if (typeof radius === "undefined") { radius = 50; } - if (typeof tubeRadius === "undefined") { tubeRadius = 50; } - if (typeof segmentsR === "undefined") { segmentsR = 16; } - if (typeof segmentsT === "undefined") { segmentsT = 8; } - if (typeof yUp === "undefined") { yUp = true; } - _super.call(this); - this._numVertices = 0; - - this._radius = radius; - this._tubeRadius = tubeRadius; - this._segmentsR = segmentsR; - this._segmentsT = segmentsT; - this._yUp = yUp; - } - Object.defineProperty(PrimitiveTorusPrefab.prototype, "radius", { - /** - * The radius of the torus. - */ - get: function () { - return this._radius; - }, - set: function (value) { - this._radius = value; - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitiveTorusPrefab.prototype, "tubeRadius", { - /** - * The radius of the inner tube of the torus. - */ - get: function () { - return this._tubeRadius; - }, - set: function (value) { - this._tubeRadius = value; - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitiveTorusPrefab.prototype, "segmentsR", { - /** - * Defines the number of horizontal segments that make up the torus. Defaults to 16. - */ - get: function () { - return this._segmentsR; - }, - set: function (value) { - this._segmentsR = value; - this._pInvalidateGeometry(); - this._pInvalidateUVs(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitiveTorusPrefab.prototype, "segmentsT", { - /** - * Defines the number of vertical segments that make up the torus. Defaults to 8. - */ - get: function () { - return this._segmentsT; - }, - set: function (value) { - this._segmentsT = value; - this._pInvalidateGeometry(); - this._pInvalidateUVs(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitiveTorusPrefab.prototype, "yUp", { - /** - * Defines whether the torus poles should lay on the Y-axis (true) or on the Z-axis (false). - */ - get: function () { - return this._yUp; - }, - set: function (value) { - this._yUp = value; - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - PrimitiveTorusPrefab.prototype._pBuildGeometry = function (target, geometryType) { - var indices; - var positions; - var normals; - var tangents; - - var i, j; - var x, y, z, nx, ny, nz, revolutionAngleR, revolutionAngleT; - var vidx; - var fidx; - var numIndices = 0; - - if (geometryType == "triangleSubGeometry") { - var triangleGeometry = target; - - // evaluate target number of vertices, triangles and indices - this._numVertices = (this._segmentsT + 1) * (this._segmentsR + 1); // segmentsT + 1 because of closure, segmentsR + 1 because of closure - numIndices = this._segmentsT * this._segmentsR * 6; // each level has segmentR quads, each of 2 triangles - - // need to initialize raw arrays or can be reused? - if (this._numVertices == triangleGeometry.numVertices) { - indices = triangleGeometry.indices; - positions = triangleGeometry.positions; - normals = triangleGeometry.vertexNormals; - tangents = triangleGeometry.vertexTangents; - } else { - indices = new Array(numIndices); - positions = new Array(this._numVertices * 3); - normals = new Array(this._numVertices * 3); - tangents = new Array(this._numVertices * 3); - - this._pInvalidateUVs(); - } - - vidx = 0; - fidx = 0; - - // evaluate revolution steps - var revolutionAngleDeltaR = 2 * Math.PI / this._segmentsR; - var revolutionAngleDeltaT = 2 * Math.PI / this._segmentsT; - - var comp1, comp2; - var t1, t2, n1, n2; - var startIndex = 0; - var nextVertexIndex = 0; - - // surface - var a, b, c, d, length; - - for (j = 0; j <= this._segmentsT; ++j) { - startIndex = nextVertexIndex * 3; - - for (i = 0; i <= this._segmentsR; ++i) { - // revolution vertex - revolutionAngleR = i * revolutionAngleDeltaR; - revolutionAngleT = j * revolutionAngleDeltaT; - - length = Math.cos(revolutionAngleT); - nx = length * Math.cos(revolutionAngleR); - ny = length * Math.sin(revolutionAngleR); - nz = Math.sin(revolutionAngleT); - - x = this._radius * Math.cos(revolutionAngleR) + this._tubeRadius * nx; - y = this._radius * Math.sin(revolutionAngleR) + this._tubeRadius * ny; - z = (j == this._segmentsT) ? 0 : this._tubeRadius * nz; - - if (this._yUp) { - n1 = -nz; - n2 = ny; - t1 = 0; - t2 = (length ? nx / length : x / this._radius); - comp1 = -z; - comp2 = y; - } else { - n1 = ny; - n2 = nz; - t1 = (length ? nx / length : x / this._radius); - t2 = 0; - comp1 = y; - comp2 = z; - } - - if (i == this._segmentsR) { - positions[vidx] = x; - positions[vidx + 1] = positions[startIndex + 1]; - positions[vidx + 2] = positions[startIndex + 2]; - } else { - positions[vidx] = x; - positions[vidx + 1] = comp1; - positions[vidx + 2] = comp2; - } - - normals[vidx] = nx; - normals[vidx + 1] = n1; - normals[vidx + 2] = n2; - tangents[vidx] = -(length ? ny / length : y / this._radius); - tangents[vidx + 1] = t1; - tangents[vidx + 2] = t2; - - vidx += 3; - - // close triangle - if (i > 0 && j > 0) { - a = nextVertexIndex; // current - b = nextVertexIndex - 1; // previous - c = b - this._segmentsR - 1; // previous of last level - d = a - this._segmentsR - 1; // current of last level - - indices[fidx++] = a; - indices[fidx++] = b; - indices[fidx++] = c; - - indices[fidx++] = a; - indices[fidx++] = c; - indices[fidx++] = d; - } - - nextVertexIndex++; - } - } - - // build real data from raw data - triangleGeometry.updateIndices(indices); - - triangleGeometry.updatePositions(positions); - triangleGeometry.updateVertexNormals(normals); - triangleGeometry.updateVertexTangents(tangents); - } else if (geometryType == "lineSubGeometry") { - //TODO - } - }; - - /** - * @inheritDoc - */ - PrimitiveTorusPrefab.prototype._pBuildUVs = function (target, geometryType) { - var i, j; - var uvs; - - if (geometryType == "triangleSubGeometry") { - var triangleGeometry = target; - - // need to initialize raw array or can be reused? - if (triangleGeometry.uvs && this._numVertices == triangleGeometry.numVertices) { - uvs = triangleGeometry.uvs; - } else { - uvs = new Array(this._numVertices * 2); - } - - // current uv component index - var index = 0; - - for (j = 0; j <= this._segmentsT; ++j) { - for (i = 0; i <= this._segmentsR; ++i) { - // revolution vertex - uvs[index++] = (i / this._segmentsR) * triangleGeometry.scaleU; - uvs[index++] = (j / this._segmentsT) * triangleGeometry.scaleV; - } - } - - // build real data from raw data - triangleGeometry.updateUVs(uvs); - } else if (geometryType == "lineSubGeometry") { - //nothing to do here - } - }; - return PrimitiveTorusPrefab; - })(prefabs.PrimitivePrefabBase); - prefabs.PrimitiveTorusPrefab = PrimitiveTorusPrefab; - })(away.prefabs || (away.prefabs = {})); - var prefabs = away.prefabs; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (prefabs) { - /** - * A Cube primitive prefab. - */ - var PrimitiveCubePrefab = (function (_super) { - __extends(PrimitiveCubePrefab, _super); - /** - * Creates a new Cube object. - * @param width The size of the cube along its X-axis. - * @param height The size of the cube along its Y-axis. - * @param depth The size of the cube along its Z-axis. - * @param segmentsW The number of segments that make up the cube along the X-axis. - * @param segmentsH The number of segments that make up the cube along the Y-axis. - * @param segmentsD The number of segments that make up the cube along the Z-axis. - * @param tile6 The type of uv mapping to use. When true, a texture will be subdivided in a 2x3 grid, each used for a single face. When false, the entire image is mapped on each face. - */ - function PrimitiveCubePrefab(width, height, depth, segmentsW, segmentsH, segmentsD, tile6) { - if (typeof width === "undefined") { width = 100; } - if (typeof height === "undefined") { height = 100; } - if (typeof depth === "undefined") { depth = 100; } - if (typeof segmentsW === "undefined") { segmentsW = 1; } - if (typeof segmentsH === "undefined") { segmentsH = 1; } - if (typeof segmentsD === "undefined") { segmentsD = 1; } - if (typeof tile6 === "undefined") { tile6 = true; } - _super.call(this); - - this._width = width; - this._height = height; - this._depth = depth; - this._segmentsW = segmentsW; - this._segmentsH = segmentsH; - this._segmentsD = segmentsD; - this._tile6 = tile6; - } - Object.defineProperty(PrimitiveCubePrefab.prototype, "width", { - /** - * The size of the cube along its X-axis. - */ - get: function () { - return this._width; - }, - set: function (value) { - this._width = value; - - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitiveCubePrefab.prototype, "height", { - /** - * The size of the cube along its Y-axis. - */ - get: function () { - return this._height; - }, - set: function (value) { - this._height = value; - - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitiveCubePrefab.prototype, "depth", { - /** - * The size of the cube along its Z-axis. - */ - get: function () { - return this._depth; - }, - set: function (value) { - this._depth = value; - - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitiveCubePrefab.prototype, "tile6", { - /** - * The type of uv mapping to use. When false, the entire image is mapped on each face. - * When true, a texture will be subdivided in a 3x2 grid, each used for a single face. - * Reading the tiles from left to right, top to bottom they represent the faces of the - * cube in the following order: bottom, top, back, left, front, right. This creates - * several shared edges (between the top, front, left and right faces) which simplifies - * texture painting. - */ - get: function () { - return this._tile6; - }, - set: function (value) { - this._tile6 = value; - - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitiveCubePrefab.prototype, "segmentsW", { - /** - * The number of segments that make up the cube along the X-axis. Defaults to 1. - */ - get: function () { - return this._segmentsW; - }, - set: function (value) { - this._segmentsW = value; - - this._pInvalidateGeometry(); - this._pInvalidateUVs(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitiveCubePrefab.prototype, "segmentsH", { - /** - * The number of segments that make up the cube along the Y-axis. Defaults to 1. - */ - get: function () { - return this._segmentsH; - }, - set: function (value) { - this._segmentsH = value; - - this._pInvalidateGeometry(); - this._pInvalidateUVs(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitiveCubePrefab.prototype, "segmentsD", { - /** - * The number of segments that make up the cube along the Z-axis. Defaults to 1. - */ - get: function () { - return this._segmentsD; - }, - set: function (value) { - this._segmentsD = value; - - this._pInvalidateGeometry(); - this._pInvalidateUVs(); - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - PrimitiveCubePrefab.prototype._pBuildGeometry = function (target, geometryType) { - var indices; - var positions; - var normals; - var tangents; - - var tl, tr, bl, br; - var i, j, inc = 0; - - var vidx, fidx; - var hw, hh, hd; - var dw, dh, dd; - - var outer_pos; - var numIndices; - var numVertices; - - // half cube dimensions - hw = this._width / 2; - hh = this._height / 2; - hd = this._depth / 2; - - if (geometryType == "triangleSubGeometry") { - var triangleGeometry = target; - - numVertices = ((this._segmentsW + 1) * (this._segmentsH + 1) + (this._segmentsW + 1) * (this._segmentsD + 1) + (this._segmentsH + 1) * (this._segmentsD + 1)) * 2; - - numIndices = ((this._segmentsW * this._segmentsH + this._segmentsW * this._segmentsD + this._segmentsH * this._segmentsD) * 12); - - if (numVertices == triangleGeometry.numVertices && triangleGeometry.indices != null) { - indices = triangleGeometry.indices; - positions = triangleGeometry.positions; - normals = triangleGeometry.vertexNormals; - tangents = triangleGeometry.vertexTangents; - } else { - indices = new Array(numIndices); - positions = new Array(numVertices * 3); - normals = new Array(numVertices * 3); - tangents = new Array(numVertices * 3); - - this._pInvalidateUVs(); - } - - vidx = 0; - fidx = 0; - - // Segment dimensions - dw = this._width / this._segmentsW; - dh = this._height / this._segmentsH; - dd = this._depth / this._segmentsD; - - for (i = 0; i <= this._segmentsW; i++) { - outer_pos = -hw + i * dw; - - for (j = 0; j <= this._segmentsH; j++) { - // front - positions[vidx] = outer_pos; - positions[vidx + 1] = -hh + j * dh; - positions[vidx + 2] = -hd; - normals[vidx] = 0; - normals[vidx + 1] = 0; - normals[vidx + 2] = -1; - tangents[vidx] = 1; - tangents[vidx + 1] = 0; - tangents[vidx + 2] = 0; - vidx += 3; - - // back - positions[vidx] = outer_pos; - positions[vidx + 1] = -hh + j * dh; - positions[vidx + 2] = hd; - normals[vidx] = 0; - normals[vidx + 1] = 0; - normals[vidx + 2] = 1; - tangents[vidx] = -1; - tangents[vidx + 1] = 0; - tangents[vidx + 2] = 0; - vidx += 3; - - if (i && j) { - tl = 2 * ((i - 1) * (this._segmentsH + 1) + (j - 1)); - tr = 2 * (i * (this._segmentsH + 1) + (j - 1)); - bl = tl + 2; - br = tr + 2; - - indices[fidx++] = tl; - indices[fidx++] = bl; - indices[fidx++] = br; - indices[fidx++] = tl; - indices[fidx++] = br; - indices[fidx++] = tr; - indices[fidx++] = tr + 1; - indices[fidx++] = br + 1; - indices[fidx++] = bl + 1; - indices[fidx++] = tr + 1; - indices[fidx++] = bl + 1; - indices[fidx++] = tl + 1; - } - } - } - - inc += 2 * (this._segmentsW + 1) * (this._segmentsH + 1); - - for (i = 0; i <= this._segmentsW; i++) { - outer_pos = -hw + i * dw; - - for (j = 0; j <= this._segmentsD; j++) { - // top - positions[vidx] = outer_pos; - positions[vidx + 1] = hh; - positions[vidx + 2] = -hd + j * dd; - normals[vidx] = 0; - normals[vidx + 1] = 1; - normals[vidx + 2] = 0; - tangents[vidx] = 1; - tangents[vidx + 1] = 0; - tangents[vidx + 2] = 0; - vidx += 3; - - // bottom - positions[vidx] = outer_pos; - positions[vidx + 1] = -hh; - positions[vidx + 2] = -hd + j * dd; - normals[vidx] = 0; - normals[vidx + 1] = -1; - normals[vidx + 2] = 0; - tangents[vidx] = 1; - tangents[vidx + 1] = 0; - tangents[vidx + 2] = 0; - vidx += 3; - - if (i && j) { - tl = inc + 2 * ((i - 1) * (this._segmentsD + 1) + (j - 1)); - tr = inc + 2 * (i * (this._segmentsD + 1) + (j - 1)); - bl = tl + 2; - br = tr + 2; - - indices[fidx++] = tl; - indices[fidx++] = bl; - indices[fidx++] = br; - indices[fidx++] = tl; - indices[fidx++] = br; - indices[fidx++] = tr; - indices[fidx++] = tr + 1; - indices[fidx++] = br + 1; - indices[fidx++] = bl + 1; - indices[fidx++] = tr + 1; - indices[fidx++] = bl + 1; - indices[fidx++] = tl + 1; - } - } - } - - inc += 2 * (this._segmentsW + 1) * (this._segmentsD + 1); - - for (i = 0; i <= this._segmentsD; i++) { - outer_pos = hd - i * dd; - - for (j = 0; j <= this._segmentsH; j++) { - // left - positions[vidx] = -hw; - positions[vidx + 1] = -hh + j * dh; - positions[vidx + 2] = outer_pos; - normals[vidx] = -1; - normals[vidx + 1] = 0; - normals[vidx + 2] = 0; - tangents[vidx] = 0; - tangents[vidx + 1] = 0; - tangents[vidx + 2] = -1; - vidx += 3; - - // right - positions[vidx] = hw; - positions[vidx + 1] = -hh + j * dh; - positions[vidx + 2] = outer_pos; - normals[vidx] = 1; - normals[vidx + 1] = 0; - normals[vidx + 2] = 0; - tangents[vidx] = 0; - tangents[vidx + 1] = 0; - tangents[vidx + 2] = 1; - vidx += 3; - - if (i && j) { - tl = inc + 2 * ((i - 1) * (this._segmentsH + 1) + (j - 1)); - tr = inc + 2 * (i * (this._segmentsH + 1) + (j - 1)); - bl = tl + 2; - br = tr + 2; - - indices[fidx++] = tl; - indices[fidx++] = bl; - indices[fidx++] = br; - indices[fidx++] = tl; - indices[fidx++] = br; - indices[fidx++] = tr; - indices[fidx++] = tr + 1; - indices[fidx++] = br + 1; - indices[fidx++] = bl + 1; - indices[fidx++] = tr + 1; - indices[fidx++] = bl + 1; - indices[fidx++] = tl + 1; - } - } - } - - triangleGeometry.updateIndices(indices); - - triangleGeometry.updatePositions(positions); - triangleGeometry.updateVertexNormals(normals); - triangleGeometry.updateVertexTangents(tangents); - } else if (geometryType == "lineSubGeometry") { - var lineGeometry = target; - - var numSegments = this._segmentsH * 4 + this._segmentsW * 4 + this._segmentsD * 4; - var startPositions; - var endPositions; - var thickness; - - if (lineGeometry.indices != null && numSegments == lineGeometry.numSegments) { - startPositions = lineGeometry.startPositions; - endPositions = lineGeometry.endPositions; - thickness = lineGeometry.thickness; - } else { - startPositions = new Array(numSegments * 3); - endPositions = new Array(numSegments * 3); - thickness = new Array(numSegments); - } - - vidx = 0; - - fidx = 0; - - for (i = 0; i < this._segmentsH; ++i) { - startPositions[vidx] = -hw; - startPositions[vidx + 1] = i * this._height / this._segmentsH - hh; - startPositions[vidx + 2] = -hd; - - endPositions[vidx] = hw; - endPositions[vidx + 1] = i * this._height / this._segmentsH - hh; - endPositions[vidx + 2] = -hd; - - thickness[fidx++] = 1; - - vidx += 3; - - startPositions[vidx] = -hw; - startPositions[vidx + 1] = hh - i * this._height / this._segmentsH; - startPositions[vidx + 2] = hd; - - endPositions[vidx] = hw; - endPositions[vidx + 1] = hh - i * this._height / this._segmentsH; - endPositions[vidx + 2] = hd; - - thickness[fidx++] = 1; - - vidx += 3; - } - - for (i = 0; i < this._segmentsW; ++i) { - startPositions[vidx] = i * this._width / this._segmentsW - hw; - startPositions[vidx + 1] = -hh; - startPositions[vidx + 2] = -hd; - - endPositions[vidx] = i * this._width / this._segmentsW - hw; - endPositions[vidx + 1] = hh; - endPositions[vidx + 2] = -hd; - - thickness[fidx++] = 1; - - vidx += 3; - - startPositions[vidx] = hw - i * this._width / this._segmentsW; - startPositions[vidx + 1] = -hh; - startPositions[vidx + 2] = hd; - - endPositions[vidx] = hw - i * this._width / this._segmentsW; - endPositions[vidx + 1] = hh; - endPositions[vidx + 2] = hd; - - thickness[fidx++] = 1; - - vidx += 3; - } - - for (i = 0; i < this._segmentsH; ++i) { - startPositions[vidx] = -hw; - startPositions[vidx + 1] = i * this._height / this._segmentsH - hh; - startPositions[vidx + 2] = -hd; - - endPositions[vidx] = -hw; - endPositions[vidx + 1] = i * this._height / this._segmentsH - hh; - endPositions[vidx + 2] = hd; - - thickness[fidx++] = 1; - - vidx += 3; - - startPositions[vidx] = hw; - startPositions[vidx + 1] = hh - i * this._height / this._segmentsH; - startPositions[vidx + 2] = -hd; - - endPositions[vidx] = hw; - endPositions[vidx + 1] = hh - i * this._height / this._segmentsH; - endPositions[vidx + 2] = hd; - - thickness[fidx++] = 1; - - vidx += 3; - } - - for (i = 0; i < this._segmentsD; ++i) { - startPositions[vidx] = hw; - startPositions[vidx + 1] = -hh; - startPositions[vidx + 2] = i * this._depth / this._segmentsD - hd; - - endPositions[vidx] = hw; - endPositions[vidx + 1] = hh; - endPositions[vidx + 2] = i * this._depth / this._segmentsD - hd; - - thickness[fidx++] = 1; - - vidx += 3; - - startPositions[vidx] = -hw; - startPositions[vidx + 1] = -hh; - startPositions[vidx + 2] = hd - i * this._depth / this._segmentsD; - - endPositions[vidx] = -hw; - endPositions[vidx + 1] = hh; - endPositions[vidx + 2] = hd - i * this._depth / this._segmentsD; - - thickness[fidx++] = 1; - - vidx += 3; - } - - for (i = 0; i < this._segmentsD; ++i) { - startPositions[vidx] = -hw; - startPositions[vidx + 1] = -hh; - startPositions[vidx + 2] = hd - i * this._depth / this._segmentsD; - - endPositions[vidx] = hw; - endPositions[vidx + 1] = -hh; - endPositions[vidx + 2] = hd - i * this._depth / this._segmentsD; - - thickness[fidx++] = 1; - - vidx += 3; - - startPositions[vidx] = -hw; - startPositions[vidx + 1] = hh; - startPositions[vidx + 2] = i * this._depth / this._segmentsD - hd; - - endPositions[vidx] = hw; - endPositions[vidx + 1] = hh; - endPositions[vidx + 2] = i * this._depth / this._segmentsD - hd; - - thickness[fidx++] = 1; - - vidx += 3; - } - - for (i = 0; i < this._segmentsW; ++i) { - startPositions[vidx] = hw - i * this._width / this._segmentsW; - startPositions[vidx + 1] = -hh; - startPositions[vidx + 2] = -hd; - - endPositions[vidx] = hw - i * this._width / this._segmentsW; - endPositions[vidx + 1] = -hh; - endPositions[vidx + 2] = hd; - - thickness[fidx++] = 1; - - vidx += 3; - - startPositions[vidx] = i * this._width / this._segmentsW - hw; - startPositions[vidx + 1] = hh; - startPositions[vidx + 2] = -hd; - - endPositions[vidx] = i * this._width / this._segmentsW - hw; - endPositions[vidx + 1] = hh; - endPositions[vidx + 2] = hd; - - thickness[fidx++] = 1; - - vidx += 3; - } - - // build real data from raw data - lineGeometry.updatePositions(startPositions, endPositions); - lineGeometry.updateThickness(thickness); - } - }; - - /** - * @inheritDoc - */ - PrimitiveCubePrefab.prototype._pBuildUVs = function (target, geometryType) { - var i, j, index; - var uvs; - - var u_tile_dim, v_tile_dim; - var u_tile_step, v_tile_step; - var tl0u, tl0v; - var tl1u, tl1v; - var du, dv; - var numVertices; - - if (geometryType == "triangleSubGeometry") { - numVertices = ((this._segmentsW + 1) * (this._segmentsH + 1) + (this._segmentsW + 1) * (this._segmentsD + 1) + (this._segmentsH + 1) * (this._segmentsD + 1)) * 2; - - var triangleGeometry = target; - - if (numVertices == triangleGeometry.numVertices && triangleGeometry.uvs != null) { - uvs = triangleGeometry.uvs; - } else { - uvs = new Array(numVertices * 2); - } - - if (this._tile6) { - u_tile_dim = u_tile_step = 1 / 3; - v_tile_dim = v_tile_step = 1 / 2; - } else { - u_tile_dim = v_tile_dim = 1; - u_tile_step = v_tile_step = 0; - } - - // Create planes two and two, the same way that they were - // constructed in the buildGeometry() function. First calculate - // the top-left UV coordinate for both planes, and then loop - // over the points, calculating the UVs from these numbers. - // When tile6 is true, the layout is as follows: - // .-----.-----.-----. (1,1) - // | Bot | T | Bak | - // |-----+-----+-----| - // | L | F | R | - // (0,0)'-----'-----'-----' - index = 0; - - // FRONT / BACK - tl0u = 1 * u_tile_step; - tl0v = 1 * v_tile_step; - tl1u = 2 * u_tile_step; - tl1v = 0 * v_tile_step; - du = u_tile_dim / this._segmentsW; - dv = v_tile_dim / this._segmentsH; - for (i = 0; i <= this._segmentsW; i++) { - for (j = 0; j <= this._segmentsH; j++) { - uvs[index++] = (tl0u + i * du) * triangleGeometry.scaleU; - uvs[index++] = (tl0v + (v_tile_dim - j * dv)) * triangleGeometry.scaleV; - - uvs[index++] = (tl1u + (u_tile_dim - i * du)) * triangleGeometry.scaleU; - uvs[index++] = (tl1v + (v_tile_dim - j * dv)) * triangleGeometry.scaleV; - } - } - - // TOP / BOTTOM - tl0u = 1 * u_tile_step; - tl0v = 0 * v_tile_step; - tl1u = 0 * u_tile_step; - tl1v = 0 * v_tile_step; - du = u_tile_dim / this._segmentsW; - dv = v_tile_dim / this._segmentsD; - for (i = 0; i <= this._segmentsW; i++) { - for (j = 0; j <= this._segmentsD; j++) { - uvs[index++] = (tl0u + i * du) * triangleGeometry.scaleU; - uvs[index++] = (tl0v + (v_tile_dim - j * dv)) * triangleGeometry.scaleV; - - uvs[index++] = (tl1u + i * du) * triangleGeometry.scaleU; - uvs[index++] = (tl1v + j * dv) * triangleGeometry.scaleV; - } - } - - // LEFT / RIGHT - tl0u = 0 * u_tile_step; - tl0v = 1 * v_tile_step; - tl1u = 2 * u_tile_step; - tl1v = 1 * v_tile_step; - du = u_tile_dim / this._segmentsD; - dv = v_tile_dim / this._segmentsH; - for (i = 0; i <= this._segmentsD; i++) { - for (j = 0; j <= this._segmentsH; j++) { - uvs[index++] = (tl0u + i * du) * triangleGeometry.scaleU; - uvs[index++] = (tl0v + (v_tile_dim - j * dv)) * triangleGeometry.scaleV; - - uvs[index++] = (tl1u + (u_tile_dim - i * du)) * triangleGeometry.scaleU; - uvs[index++] = (tl1v + (v_tile_dim - j * dv)) * triangleGeometry.scaleV; - } - } - - triangleGeometry.updateUVs(uvs); - } else if (geometryType == "lineSubGeometry") { - //nothing to do here - } - }; - return PrimitiveCubePrefab; - })(prefabs.PrimitivePrefabBase); - prefabs.PrimitiveCubePrefab = PrimitiveCubePrefab; - })(away.prefabs || (away.prefabs = {})); - var prefabs = away.prefabs; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (prefabs) { - /** - * A Plane primitive mesh. - */ - var PrimitivePlanePrefab = (function (_super) { - __extends(PrimitivePlanePrefab, _super); - /** - * Creates a new Plane object. - * @param width The width of the plane. - * @param height The height of the plane. - * @param segmentsW The number of segments that make up the plane along the X-axis. - * @param segmentsH The number of segments that make up the plane along the Y or Z-axis. - * @param yUp Defines whether the normal vector of the plane should point along the Y-axis (true) or Z-axis (false). - * @param doubleSided Defines whether the plane will be visible from both sides, with correct vertex normals. - */ - function PrimitivePlanePrefab(width, height, segmentsW, segmentsH, yUp, doubleSided) { - if (typeof width === "undefined") { width = 100; } - if (typeof height === "undefined") { height = 100; } - if (typeof segmentsW === "undefined") { segmentsW = 1; } - if (typeof segmentsH === "undefined") { segmentsH = 1; } - if (typeof yUp === "undefined") { yUp = true; } - if (typeof doubleSided === "undefined") { doubleSided = false; } - _super.call(this); - - this._segmentsW = segmentsW; - this._segmentsH = segmentsH; - this._yUp = yUp; - this._width = width; - this._height = height; - this._doubleSided = doubleSided; - } - Object.defineProperty(PrimitivePlanePrefab.prototype, "segmentsW", { - /** - * The number of segments that make up the plane along the X-axis. Defaults to 1. - */ - get: function () { - return this._segmentsW; - }, - set: function (value) { - this._segmentsW = value; - - this._pInvalidateGeometry(); - this._pInvalidateUVs(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitivePlanePrefab.prototype, "segmentsH", { - /** - * The number of segments that make up the plane along the Y or Z-axis, depending on whether yUp is true or - * false, respectively. Defaults to 1. - */ - get: function () { - return this._segmentsH; - }, - set: function (value) { - this._segmentsH = value; - - this._pInvalidateGeometry(); - this._pInvalidateUVs(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitivePlanePrefab.prototype, "yUp", { - /** - * Defines whether the normal vector of the plane should point along the Y-axis (true) or Z-axis (false). Defaults to true. - */ - get: function () { - return this._yUp; - }, - set: function (value) { - this._yUp = value; - - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitivePlanePrefab.prototype, "doubleSided", { - /** - * Defines whether the plane will be visible from both sides, with correct vertex normals (as opposed to bothSides on Material). Defaults to false. - */ - get: function () { - return this._doubleSided; - }, - set: function (value) { - this._doubleSided = value; - - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitivePlanePrefab.prototype, "width", { - /** - * The width of the plane. - */ - get: function () { - return this._width; - }, - set: function (value) { - this._width = value; - - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitivePlanePrefab.prototype, "height", { - /** - * The height of the plane. - */ - get: function () { - return this._height; - }, - set: function (value) { - this._height = value; - - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - PrimitivePlanePrefab.prototype._pBuildGeometry = function (target, geometryType) { - var indices; - var x, y; - var numIndices; - var base; - var tw = this._segmentsW + 1; - var numVertices; - - var vidx, fidx; - - var xi; - var yi; - - if (geometryType == "triangleSubGeometry") { - var triangleGeometry = target; - - var numVertices = (this._segmentsH + 1) * tw; - var positions; - var normals; - var tangents; - - if (this._doubleSided) - numVertices *= 2; - - numIndices = this._segmentsH * this._segmentsW * 6; - - if (this._doubleSided) - numIndices *= 2; - - if (triangleGeometry.indices != null && numIndices == triangleGeometry.indices.length) { - indices = triangleGeometry.indices; - } else { - indices = new Array(numIndices); - - this._pInvalidateUVs(); - } - - if (numVertices == triangleGeometry.numVertices) { - positions = triangleGeometry.positions; - normals = triangleGeometry.vertexNormals; - tangents = triangleGeometry.vertexTangents; - } else { - positions = new Array(numVertices * 3); - normals = new Array(numVertices * 3); - tangents = new Array(numVertices * 3); - - this._pInvalidateUVs(); - } - - fidx = 0; - - vidx = 0; - - for (yi = 0; yi <= this._segmentsH; ++yi) { - for (xi = 0; xi <= this._segmentsW; ++xi) { - x = (xi / this._segmentsW - .5) * this._width; - y = (yi / this._segmentsH - .5) * this._height; - - positions[vidx] = x; - if (this._yUp) { - positions[vidx + 1] = 0; - positions[vidx + 2] = y; - } else { - positions[vidx + 1] = y; - positions[vidx + 2] = 0; - } - - normals[vidx] = 0; - - if (this._yUp) { - normals[vidx + 1] = 1; - normals[vidx + 2] = 0; - } else { - normals[vidx + 1] = 0; - normals[vidx + 2] = -1; - } - - tangents[vidx] = 1; - tangents[vidx + 1] = 0; - tangents[vidx + 2] = 0; - - vidx += 3; - - // add vertex with same position, but with inverted normal & tangent - if (this._doubleSided) { - for (var i = vidx; i < vidx + 3; ++i) { - positions[i] = positions[i - 3]; - normals[i] = -normals[i - 3]; - tangents[i] = -tangents[i - 3]; - } - - vidx += 3; - } - - if (xi != this._segmentsW && yi != this._segmentsH) { - base = xi + yi * tw; - var mult = this._doubleSided ? 2 : 1; - - indices[fidx++] = base * mult; - indices[fidx++] = (base + tw) * mult; - indices[fidx++] = (base + tw + 1) * mult; - indices[fidx++] = base * mult; - indices[fidx++] = (base + tw + 1) * mult; - indices[fidx++] = (base + 1) * mult; - - if (this._doubleSided) { - indices[fidx++] = (base + tw + 1) * mult + 1; - indices[fidx++] = (base + tw) * mult + 1; - indices[fidx++] = base * mult + 1; - indices[fidx++] = (base + 1) * mult + 1; - indices[fidx++] = (base + tw + 1) * mult + 1; - indices[fidx++] = base * mult + 1; - } - } - } - } - - triangleGeometry.updateIndices(indices); - - triangleGeometry.updatePositions(positions); - triangleGeometry.updateVertexNormals(normals); - triangleGeometry.updateVertexTangents(tangents); - } else if (geometryType == "lineSubGeometry") { - var lineGeometry = target; - - var numSegments = (this._segmentsH + 1) + tw; - var startPositions; - var endPositions; - var thickness; - - var hw = this._width / 2; - var hh = this._height / 2; - - if (lineGeometry.indices != null && numSegments == lineGeometry.numSegments) { - startPositions = lineGeometry.startPositions; - endPositions = lineGeometry.endPositions; - thickness = lineGeometry.thickness; - } else { - startPositions = new Array(numSegments * 3); - endPositions = new Array(numSegments * 3); - thickness = new Array(numSegments); - } - - fidx = 0; - - vidx = 0; - - for (yi = 0; yi <= this._segmentsH; ++yi) { - startPositions[vidx] = -hw; - startPositions[vidx + 1] = 0; - startPositions[vidx + 2] = yi * this._height - hh; - - endPositions[vidx] = hw; - endPositions[vidx + 1] = 0; - endPositions[vidx + 2] = yi * this._height - hh; - - thickness[fidx++] = 1; - - vidx += 3; - } - - for (xi = 0; xi <= this._segmentsW; ++xi) { - startPositions[vidx] = xi * this._width - hw; - startPositions[vidx + 1] = 0; - startPositions[vidx + 2] = -hh; - - endPositions[vidx] = xi * this._width - hw; - endPositions[vidx + 1] = 0; - endPositions[vidx + 2] = hh; - - thickness[fidx++] = 1; - - vidx += 3; - } - - // build real data from raw data - lineGeometry.updatePositions(startPositions, endPositions); - lineGeometry.updateThickness(thickness); - } - }; - - /** - * @inheritDoc - */ - PrimitivePlanePrefab.prototype._pBuildUVs = function (target, geometryType) { - var uvs; - var numVertices; - - if (geometryType == "triangleSubGeometry") { - numVertices = (this._segmentsH + 1) * (this._segmentsW + 1); - - if (this._doubleSided) - numVertices *= 2; - - var triangleGeometry = target; - - if (triangleGeometry.uvs && numVertices == triangleGeometry.numVertices) { - uvs = triangleGeometry.uvs; - } else { - uvs = new Array(numVertices * 2); - this._pInvalidateGeometry(); - } - - var index = 0; - - for (var yi = 0; yi <= this._segmentsH; ++yi) { - for (var xi = 0; xi <= this._segmentsW; ++xi) { - uvs[index] = (xi / this._segmentsW) * triangleGeometry.scaleU; - uvs[index + 1] = (1 - yi / this._segmentsH) * triangleGeometry.scaleV; - index += 2; - - if (this._doubleSided) { - uvs[index] = (xi / this._segmentsW) * triangleGeometry.scaleU; - uvs[index + 1] = (1 - yi / this._segmentsH) * triangleGeometry.scaleV; - index += 2; - } - } - } - - triangleGeometry.updateUVs(uvs); - } else if (geometryType == "lineSubGeometry") { - //nothing to do here - } - }; - return PrimitivePlanePrefab; - })(prefabs.PrimitivePrefabBase); - prefabs.PrimitivePlanePrefab = PrimitivePlanePrefab; - })(away.prefabs || (away.prefabs = {})); - var prefabs = away.prefabs; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (prefabs) { - /** - * A Capsule primitive mesh. - */ - var PrimitiveCapsulePrefab = (function (_super) { - __extends(PrimitiveCapsulePrefab, _super); - /** - * Creates a new Capsule object. - * @param radius The radius of the capsule. - * @param height The height of the capsule. - * @param segmentsW Defines the number of horizontal segments that make up the capsule. Defaults to 16. - * @param segmentsH Defines the number of vertical segments that make up the capsule. Defaults to 15. Must be uneven value. - * @param yUp Defines whether the capsule poles should lay on the Y-axis (true) or on the Z-axis (false). - */ - function PrimitiveCapsulePrefab(radius, height, segmentsW, segmentsH, yUp) { - if (typeof radius === "undefined") { radius = 50; } - if (typeof height === "undefined") { height = 100; } - if (typeof segmentsW === "undefined") { segmentsW = 16; } - if (typeof segmentsH === "undefined") { segmentsH = 15; } - if (typeof yUp === "undefined") { yUp = true; } - _super.call(this); - this._numVertices = 0; - - this._radius = radius; - this._height = height; - this._segmentsW = segmentsW; - this._segmentsH = (segmentsH % 2 == 0) ? segmentsH + 1 : segmentsH; - this._yUp = yUp; - } - Object.defineProperty(PrimitiveCapsulePrefab.prototype, "radius", { - /** - * The radius of the capsule. - */ - get: function () { - return this._radius; - }, - set: function (value) { - this._radius = value; - - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitiveCapsulePrefab.prototype, "height", { - /** - * The height of the capsule. - */ - get: function () { - return this._height; - }, - set: function (value) { - this._height = value; - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitiveCapsulePrefab.prototype, "segmentsW", { - /** - * Defines the number of horizontal segments that make up the capsule. Defaults to 16. - */ - get: function () { - return this._segmentsW; - }, - set: function (value) { - this._segmentsW = value; - - this._pInvalidateGeometry(); - this._pInvalidateUVs(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitiveCapsulePrefab.prototype, "segmentsH", { - /** - * Defines the number of vertical segments that make up the capsule. Defaults to 15. Must be uneven. - */ - get: function () { - return this._segmentsH; - }, - set: function (value) { - this._segmentsH = (value % 2 == 0) ? value + 1 : value; - - this._pInvalidateGeometry(); - this._pInvalidateUVs(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitiveCapsulePrefab.prototype, "yUp", { - /** - * Defines whether the capsule poles should lay on the Y-axis (true) or on the Z-axis (false). - */ - get: function () { - return this._yUp; - }, - set: function (value) { - this._yUp = value; - - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - PrimitiveCapsulePrefab.prototype._pBuildGeometry = function (target, geometryType) { - var indices; - var positions; - var normals; - var tangents; - - var i; - var j; - var triIndex = 0; - var index = 0; - var startIndex; - var comp1, comp2, t1, t2; - var numIndices = 0; - - if (geometryType == "triangleSubGeometry") { - var triangleGeometry = target; - - // evaluate target number of vertices, triangles and indices - this._numVertices = (this._segmentsH + 1) * (this._segmentsW + 1); // segmentsH + 1 because of closure, segmentsW + 1 because of closure - numIndices = (this._segmentsH - 1) * this._segmentsW * 6; // each level has segmentH quads, each of 2 triangles - - // need to initialize raw arrays or can be reused? - if (this._numVertices == triangleGeometry.numVertices) { - indices = triangleGeometry.indices; - positions = triangleGeometry.positions; - normals = triangleGeometry.vertexNormals; - tangents = triangleGeometry.vertexTangents; - } else { - indices = new Array(numIndices); - positions = new Array(this._numVertices * 3); - normals = new Array(this._numVertices * 3); - tangents = new Array(this._numVertices * 3); - - this._pInvalidateUVs(); - } - - for (j = 0; j <= this._segmentsH; ++j) { - var horangle = Math.PI * j / this._segmentsH; - var z = -this._radius * Math.cos(horangle); - var ringradius = this._radius * Math.sin(horangle); - - startIndex = index; - - for (i = 0; i <= this._segmentsW; ++i) { - var verangle = 2 * Math.PI * i / this._segmentsW; - var x = ringradius * Math.cos(verangle); - var offset = j > this._segmentsH / 2 ? this._height / 2 : -this._height / 2; - var y = ringradius * Math.sin(verangle); - var normLen = 1 / Math.sqrt(x * x + y * y + z * z); - var tanLen = Math.sqrt(y * y + x * x); - - if (this._yUp) { - t1 = 0; - t2 = tanLen > .007 ? x / tanLen : 0; - comp1 = -z; - comp2 = y; - } else { - t1 = tanLen > .007 ? x / tanLen : 0; - t2 = 0; - comp1 = y; - comp2 = z; - } - - if (i == this._segmentsW) { - positions[index] = positions[startIndex]; - positions[index + 1] = positions[startIndex + 1]; - positions[index + 2] = positions[startIndex + 2]; - normals[index] = (normals[startIndex] + (x * normLen)) * .5; - normals[index + 1] = (normals[startIndex + 1] + (comp1 * normLen)) * .5; - normals[index + 2] = (normals[startIndex + 2] + (comp2 * normLen)) * .5; - tangents[index] = (tangents[startIndex] + (tanLen > .007 ? -y / tanLen : 1)) * .5; - tangents[index + 1] = (tangents[startIndex + 1] + t1) * .5; - tangents[index + 2] = (tangents[startIndex + 2] + t2) * .5; - } else { - // vertex - positions[index] = x; - positions[index + 1] = (this._yUp) ? comp1 - offset : comp1; - positions[index + 2] = (this._yUp) ? comp2 : comp2 + offset; - - // normal - normals[index] = x * normLen; - normals[index + 1] = comp1 * normLen; - normals[index + 2] = comp2 * normLen; - - // tangent - tangents[index] = tanLen > .007 ? -y / tanLen : 1; - tangents[index + 1] = t1; - tangents[index + 2] = t2; - } - - if (i > 0 && j > 0) { - var a = (this._segmentsW + 1) * j + i; - var b = (this._segmentsW + 1) * j + i - 1; - var c = (this._segmentsW + 1) * (j - 1) + i - 1; - var d = (this._segmentsW + 1) * (j - 1) + i; - - if (j == this._segmentsH) { - positions[index] = positions[startIndex]; - positions[index + 1] = positions[startIndex + 1]; - positions[index + 2] = positions[startIndex + 2]; - - indices[triIndex++] = a; - indices[triIndex++] = c; - indices[triIndex++] = d; - } else if (j == 1) { - indices[triIndex++] = a; - indices[triIndex++] = b; - indices[triIndex++] = c; - } else { - indices[triIndex++] = a; - indices[triIndex++] = b; - indices[triIndex++] = c; - indices[triIndex++] = a; - indices[triIndex++] = c; - indices[triIndex++] = d; - } - } - - index += 3; - } - } - - // build real data from raw data - triangleGeometry.updateIndices(indices); - - triangleGeometry.updatePositions(positions); - triangleGeometry.updateVertexNormals(normals); - triangleGeometry.updateVertexTangents(tangents); - } else if (geometryType == "lineSubGeometry") { - //TODO - } - }; - - /** - * @inheritDoc - */ - PrimitiveCapsulePrefab.prototype._pBuildUVs = function (target, geometryType) { - var i, j; - var uvs; - - if (geometryType == "triangleSubGeometry") { - var triangleGeometry = target; - - // need to initialize raw array or can be reused? - if (triangleGeometry.uvs && this._numVertices == triangleGeometry.numVertices) { - uvs = triangleGeometry.uvs; - } else { - uvs = new Array(this._numVertices * 2); - } - - // current uv component index - var index = 0; - - for (j = 0; j <= this._segmentsH; ++j) { - for (i = 0; i <= this._segmentsW; ++i) { - // revolution vertex - uvs[index++] = (i / this._segmentsW) * triangleGeometry.scaleU; - uvs[index++] = (j / this._segmentsH) * triangleGeometry.scaleV; - } - } - - // build real data from raw data - triangleGeometry.updateUVs(uvs); - } else if (geometryType == "lineSubGeometry") { - //nothing to do here - } - }; - return PrimitiveCapsulePrefab; - })(prefabs.PrimitivePrefabBase); - prefabs.PrimitiveCapsulePrefab = PrimitiveCapsulePrefab; - })(away.prefabs || (away.prefabs = {})); - var prefabs = away.prefabs; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (prefabs) { - /** - * A Cylinder primitive mesh. - */ - var PrimitiveCylinderPrefab = (function (_super) { - __extends(PrimitiveCylinderPrefab, _super); - /** - * Creates a new Cylinder object. - * @param topRadius The radius of the top end of the cylinder. - * @param bottomRadius The radius of the bottom end of the cylinder - * @param height The radius of the bottom end of the cylinder - * @param segmentsW Defines the number of horizontal segments that make up the cylinder. Defaults to 16. - * @param segmentsH Defines the number of vertical segments that make up the cylinder. Defaults to 1. - * @param topClosed Defines whether the top end of the cylinder is closed (true) or open. - * @param bottomClosed Defines whether the bottom end of the cylinder is closed (true) or open. - * @param yUp Defines whether the cone poles should lay on the Y-axis (true) or on the Z-axis (false). - */ - function PrimitiveCylinderPrefab(topRadius, bottomRadius, height, segmentsW, segmentsH, topClosed, bottomClosed, surfaceClosed, yUp) { - if (typeof topRadius === "undefined") { topRadius = 50; } - if (typeof bottomRadius === "undefined") { bottomRadius = 50; } - if (typeof height === "undefined") { height = 100; } - if (typeof segmentsW === "undefined") { segmentsW = 16; } - if (typeof segmentsH === "undefined") { segmentsH = 1; } - if (typeof topClosed === "undefined") { topClosed = true; } - if (typeof bottomClosed === "undefined") { bottomClosed = true; } - if (typeof surfaceClosed === "undefined") { surfaceClosed = true; } - if (typeof yUp === "undefined") { yUp = true; } - _super.call(this); - this._numVertices = 0; - - this._topRadius = topRadius; - this._pBottomRadius = bottomRadius; - this._height = height; - this._pSegmentsW = segmentsW; - this._pSegmentsH = segmentsH; - this._topClosed = topClosed; - this._bottomClosed = bottomClosed; - this._surfaceClosed = surfaceClosed; - this._yUp = yUp; - } - Object.defineProperty(PrimitiveCylinderPrefab.prototype, "topRadius", { - /** - * The radius of the top end of the cylinder. - */ - get: function () { - return this._topRadius; - }, - set: function (value) { - this._topRadius = value; - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitiveCylinderPrefab.prototype, "bottomRadius", { - /** - * The radius of the bottom end of the cylinder. - */ - get: function () { - return this._pBottomRadius; - }, - set: function (value) { - this._pBottomRadius = value; - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitiveCylinderPrefab.prototype, "height", { - /** - * The radius of the top end of the cylinder. - */ - get: function () { - return this._height; - }, - set: function (value) { - this._height = value; - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitiveCylinderPrefab.prototype, "segmentsW", { - /** - * Defines the number of horizontal segments that make up the cylinder. Defaults to 16. - */ - get: function () { - return this._pSegmentsW; - }, - set: function (value) { - this.setSegmentsW(value); - }, - enumerable: true, - configurable: true - }); - - - PrimitiveCylinderPrefab.prototype.setSegmentsW = function (value) { - this._pSegmentsW = value; - this._pInvalidateGeometry(); - this._pInvalidateUVs(); - }; - - Object.defineProperty(PrimitiveCylinderPrefab.prototype, "segmentsH", { - /** - * Defines the number of vertical segments that make up the cylinder. Defaults to 1. - */ - get: function () { - return this._pSegmentsH; - }, - set: function (value) { - this.setSegmentsH(value); - }, - enumerable: true, - configurable: true - }); - - - PrimitiveCylinderPrefab.prototype.setSegmentsH = function (value) { - this._pSegmentsH = value; - this._pInvalidateGeometry(); - this._pInvalidateUVs(); - }; - - Object.defineProperty(PrimitiveCylinderPrefab.prototype, "topClosed", { - /** - * Defines whether the top end of the cylinder is closed (true) or open. - */ - get: function () { - return this._topClosed; - }, - set: function (value) { - this._topClosed = value; - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitiveCylinderPrefab.prototype, "bottomClosed", { - /** - * Defines whether the bottom end of the cylinder is closed (true) or open. - */ - get: function () { - return this._bottomClosed; - }, - set: function (value) { - this._bottomClosed = value; - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitiveCylinderPrefab.prototype, "yUp", { - /** - * Defines whether the cylinder poles should lay on the Y-axis (true) or on the Z-axis (false). - */ - get: function () { - return this._yUp; - }, - set: function (value) { - this._yUp = value; - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - PrimitiveCylinderPrefab.prototype._pBuildGeometry = function (target, geometryType) { - var indices; - var positions; - var normals; - var tangents; - - var i; - var j; - var x; - var y; - var z; - var vidx; - var fidx; - - var radius; - var revolutionAngle; - - var dr; - var latNormElev; - var latNormBase; - var numIndices = 0; - - var comp1; - var comp2; - var startIndex = 0; - var nextVertexIndex = 0; - - var t1; - var t2; - - // reset utility variables - this._numVertices = 0; - - // evaluate revolution steps - var revolutionAngleDelta = 2 * Math.PI / this._pSegmentsW; - - if (geometryType == "triangleSubGeometry") { - var triangleGeometry = target; - - // evaluate target number of vertices, triangles and indices - if (this._surfaceClosed) { - this._numVertices += (this._pSegmentsH + 1) * (this._pSegmentsW + 1); // segmentsH + 1 because of closure, segmentsW + 1 because of UV unwrapping - numIndices += this._pSegmentsH * this._pSegmentsW * 6; // each level has segmentW quads, each of 2 triangles - } - if (this._topClosed) { - this._numVertices += 2 * (this._pSegmentsW + 1); // segmentsW + 1 because of unwrapping - numIndices += this._pSegmentsW * 3; // one triangle for each segment - } - if (this._bottomClosed) { - this._numVertices += 2 * (this._pSegmentsW + 1); - numIndices += this._pSegmentsW * 3; - } - - // need to initialize raw arrays or can be reused? - if (this._numVertices == triangleGeometry.numVertices) { - indices = triangleGeometry.indices; - positions = triangleGeometry.positions; - normals = triangleGeometry.vertexNormals; - tangents = triangleGeometry.vertexTangents; - } else { - indices = new Array(numIndices); - positions = new Array(this._numVertices * 3); - normals = new Array(this._numVertices * 3); - tangents = new Array(this._numVertices * 3); - - this._pInvalidateUVs(); - } - - vidx = 0; - fidx = 0; - - // top - if (this._topClosed && this._topRadius > 0) { - z = -0.5 * this._height; - - for (i = 0; i <= this._pSegmentsW; ++i) { - // central vertex - if (this._yUp) { - t1 = 1; - t2 = 0; - comp1 = -z; - comp2 = 0; - } else { - t1 = 0; - t2 = -1; - comp1 = 0; - comp2 = z; - } - - positions[vidx] = 0; - positions[vidx + 1] = comp1; - positions[vidx + 2] = comp2; - normals[vidx] = 0; - normals[vidx + 1] = t1; - normals[vidx + 2] = t2; - tangents[vidx] = 1; - tangents[vidx + 1] = 0; - tangents[vidx + 2] = 0; - vidx += 3; - - // revolution vertex - revolutionAngle = i * revolutionAngleDelta; - x = this._topRadius * Math.cos(revolutionAngle); - y = this._topRadius * Math.sin(revolutionAngle); - - if (this._yUp) { - comp1 = -z; - comp2 = y; - } else { - comp1 = y; - comp2 = z; - } - - if (i == this._pSegmentsW) { - positions[vidx] = positions[startIndex + 3]; - positions[vidx + 1] = positions[startIndex + 4]; - positions[vidx + 2] = positions[startIndex + 5]; - } else { - positions[vidx] = x; - positions[vidx + 1] = comp1; - positions[vidx + 2] = comp2; - } - - normals[vidx] = 0; - normals[vidx + 1] = t1; - normals[vidx + 2] = t2; - tangents[vidx] = 1; - tangents[vidx + 1] = 0; - tangents[vidx + 2] = 0; - vidx += 3; - - if (i > 0) { - // add triangle - indices[fidx++] = nextVertexIndex; - indices[fidx++] = nextVertexIndex + 1; - indices[fidx++] = nextVertexIndex + 2; - - nextVertexIndex += 2; - } - } - - nextVertexIndex += 2; - } - - // bottom - if (this._bottomClosed && this._pBottomRadius > 0) { - z = 0.5 * this._height; - - startIndex = nextVertexIndex * 3; - - for (i = 0; i <= this._pSegmentsW; ++i) { - if (this._yUp) { - t1 = -1; - t2 = 0; - comp1 = -z; - comp2 = 0; - } else { - t1 = 0; - t2 = 1; - comp1 = 0; - comp2 = z; - } - - positions[vidx] = 0; - positions[vidx + 1] = comp1; - positions[vidx + 2] = comp2; - normals[vidx] = 0; - normals[vidx + 1] = t1; - normals[vidx + 2] = t2; - tangents[vidx] = 1; - tangents[vidx + 1] = 0; - tangents[vidx + 2] = 0; - vidx += 3; - - // revolution vertex - revolutionAngle = i * revolutionAngleDelta; - x = this._pBottomRadius * Math.cos(revolutionAngle); - y = this._pBottomRadius * Math.sin(revolutionAngle); - - if (this._yUp) { - comp1 = -z; - comp2 = y; - } else { - comp1 = y; - comp2 = z; - } - - if (i == this._pSegmentsW) { - positions[vidx] = positions[startIndex + 3]; - positions[vidx + 1] = positions[startIndex + 4]; - positions[vidx + 2] = positions[startIndex + 5]; - } else { - positions[vidx] = x; - positions[vidx + 1] = comp1; - positions[vidx + 2] = comp2; - } - - normals[vidx] = 0; - normals[vidx + 1] = t1; - normals[vidx + 2] = t2; - tangents[vidx] = 1; - tangents[vidx + 1] = 0; - tangents[vidx + 2] = 0; - vidx += 3; - - if (i > 0) { - // add triangle - indices[fidx++] = nextVertexIndex; - indices[fidx++] = nextVertexIndex + 2; - indices[fidx++] = nextVertexIndex + 1; - - nextVertexIndex += 2; - } - } - - nextVertexIndex += 2; - } - - // The normals on the lateral surface all have the same incline, i.e. - // the "elevation" component (Y or Z depending on yUp) is constant. - // Same principle goes for the "base" of these vectors, which will be - // calculated such that a vector [base,elev] will be a unit vector. - dr = (this._pBottomRadius - this._topRadius); - latNormElev = dr / this._height; - latNormBase = (latNormElev == 0) ? 1 : this._height / dr; - - // lateral surface - if (this._surfaceClosed) { - var a; - var b; - var c; - var d; - var na0, na1, naComp1, naComp2; - - for (j = 0; j <= this._pSegmentsH; ++j) { - radius = this._topRadius - ((j / this._pSegmentsH) * (this._topRadius - this._pBottomRadius)); - z = -(this._height / 2) + (j / this._pSegmentsH * this._height); - - startIndex = nextVertexIndex * 3; - - for (i = 0; i <= this._pSegmentsW; ++i) { - // revolution vertex - revolutionAngle = i * revolutionAngleDelta; - x = radius * Math.cos(revolutionAngle); - y = radius * Math.sin(revolutionAngle); - na0 = latNormBase * Math.cos(revolutionAngle); - na1 = latNormBase * Math.sin(revolutionAngle); - - if (this._yUp) { - t1 = 0; - t2 = -na0; - comp1 = -z; - comp2 = y; - naComp1 = latNormElev; - naComp2 = na1; - } else { - t1 = -na0; - t2 = 0; - comp1 = y; - comp2 = z; - naComp1 = na1; - naComp2 = latNormElev; - } - - if (i == this._pSegmentsW) { - positions[vidx] = positions[startIndex]; - positions[vidx + 1] = positions[startIndex + 1]; - positions[vidx + 2] = positions[startIndex + 2]; - normals[vidx] = na0; - normals[vidx + 1] = latNormElev; - normals[vidx + 2] = na1; - tangents[vidx] = na1; - tangents[vidx + 1] = t1; - tangents[vidx + 2] = t2; - } else { - positions[vidx] = x; - positions[vidx + 1] = comp1; - positions[vidx + 2] = comp2; - normals[vidx] = na0; - normals[vidx + 1] = naComp1; - normals[vidx + 2] = naComp2; - tangents[vidx] = -na1; - tangents[vidx + 1] = t1; - tangents[vidx + 2] = t2; - } - vidx += 3; - - // close triangle - if (i > 0 && j > 0) { - a = nextVertexIndex; // current - b = nextVertexIndex - 1; // previous - c = b - this._pSegmentsW - 1; // previous of last level - d = a - this._pSegmentsW - 1; // current of last level - - indices[fidx++] = a; - indices[fidx++] = b; - indices[fidx++] = c; - - indices[fidx++] = a; - indices[fidx++] = c; - indices[fidx++] = d; - } - - nextVertexIndex++; - } - } - } - - // build real data from raw data - triangleGeometry.updateIndices(indices); - - triangleGeometry.updatePositions(positions); - triangleGeometry.updateVertexNormals(normals); - triangleGeometry.updateVertexTangents(tangents); - } else if (geometryType == "lineSubGeometry") { - var lineGeometry = target; - - var numSegments = (this._pSegmentsH + 1) * (this._pSegmentsW) + this._pSegmentsW; - var startPositions; - var endPositions; - var thickness; - - if (lineGeometry.indices != null && numSegments == lineGeometry.numSegments) { - startPositions = lineGeometry.startPositions; - endPositions = lineGeometry.endPositions; - thickness = lineGeometry.thickness; - } else { - startPositions = new Array(numSegments * 3); - endPositions = new Array(numSegments * 3); - thickness = new Array(numSegments); - } - - vidx = 0; - - fidx = 0; - - for (j = 0; j <= this._pSegmentsH; ++j) { - radius = this._topRadius - ((j / this._pSegmentsH) * (this._topRadius - this._pBottomRadius)); - z = this._height * (j / this._pSegmentsH - 0.5); - - for (i = 0; i <= this._pSegmentsW; ++i) { - // revolution vertex - revolutionAngle = i * revolutionAngleDelta; - x = radius * Math.cos(revolutionAngle); - y = radius * Math.sin(revolutionAngle); - - if (this._yUp) { - comp1 = -z; - comp2 = y; - } else { - comp1 = y; - comp2 = z; - } - - if (i > 0) { - endPositions[vidx] = x; - endPositions[vidx + 1] = comp1; - endPositions[vidx + 2] = comp2; - - thickness[fidx++] = 1; - - vidx += 3; - - //vertical lines - startPositions[vidx] = endPositions[vidx - this._pSegmentsW * 6]; - startPositions[vidx + 1] = endPositions[vidx + 1 - this._pSegmentsW * 6]; - startPositions[vidx + 2] = endPositions[vidx + 2 - this._pSegmentsW * 6]; - - endPositions[vidx] = x; - endPositions[vidx + 1] = comp1; - endPositions[vidx + 2] = comp2; - - thickness[fidx++] = 1; - - vidx += 3; - } - - if (i < this._pSegmentsW) { - startPositions[vidx] = x; - startPositions[vidx + 1] = comp1; - startPositions[vidx + 2] = comp2; - } - } - } - - // build real data from raw data - lineGeometry.updatePositions(startPositions, endPositions); - lineGeometry.updateThickness(thickness); - } - }; - - /** - * @inheritDoc - */ - PrimitiveCylinderPrefab.prototype._pBuildUVs = function (target, geometryType) { - var i; - var j; - var x; - var y; - var revolutionAngle; - var uvs; - - if (geometryType == "triangleSubGeometry") { - var triangleGeometry = target; - - // need to initialize raw array or can be reused? - if (triangleGeometry.uvs && this._numVertices == triangleGeometry.numVertices) { - uvs = triangleGeometry.uvs; - } else { - uvs = new Array(this._numVertices * 2); - } - - // evaluate revolution steps - var revolutionAngleDelta = 2 * Math.PI / this._pSegmentsW; - - // current uv component index - var index = 0; - - // top - if (this._topClosed) { - for (i = 0; i <= this._pSegmentsW; ++i) { - revolutionAngle = i * revolutionAngleDelta; - x = 0.5 + 0.5 * -Math.cos(revolutionAngle); - y = 0.5 + 0.5 * Math.sin(revolutionAngle); - - uvs[index++] = 0.5 * triangleGeometry.scaleU; // central vertex - uvs[index++] = 0.5 * triangleGeometry.scaleV; - - uvs[index++] = x * triangleGeometry.scaleU; // revolution vertex - uvs[index++] = y * triangleGeometry.scaleV; - } - } - - // bottom - if (this._bottomClosed) { - for (i = 0; i <= this._pSegmentsW; ++i) { - revolutionAngle = i * revolutionAngleDelta; - x = 0.5 + 0.5 * Math.cos(revolutionAngle); - y = 0.5 + 0.5 * Math.sin(revolutionAngle); - - uvs[index++] = 0.5 * triangleGeometry.scaleU; // central vertex - uvs[index++] = 0.5 * triangleGeometry.scaleV; - - uvs[index++] = x * triangleGeometry.scaleU; // revolution vertex - uvs[index++] = y * triangleGeometry.scaleV; - } - } - - // lateral surface - if (this._surfaceClosed) { - for (j = 0; j <= this._pSegmentsH; ++j) { - for (i = 0; i <= this._pSegmentsW; ++i) { - // revolution vertex - uvs[index++] = (i / this._pSegmentsW) * triangleGeometry.scaleU; - uvs[index++] = (j / this._pSegmentsH) * triangleGeometry.scaleV; - } - } - } - - // build real data from raw data - triangleGeometry.updateUVs(uvs); - } else if (geometryType == "lineSubGeometry") { - //nothing to do here - } - }; - return PrimitiveCylinderPrefab; - })(prefabs.PrimitivePrefabBase); - prefabs.PrimitiveCylinderPrefab = PrimitiveCylinderPrefab; - })(away.prefabs || (away.prefabs = {})); - var prefabs = away.prefabs; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (prefabs) { - /** - * A UV Cone primitive mesh. - */ - var PrimitiveConePrefab = (function (_super) { - __extends(PrimitiveConePrefab, _super); - /** - * Creates a new Cone object. - * @param radius The radius of the bottom end of the cone - * @param height The height of the cone - * @param segmentsW Defines the number of horizontal segments that make up the cone. Defaults to 16. - * @param segmentsH Defines the number of vertical segments that make up the cone. Defaults to 1. - * @param yUp Defines whether the cone poles should lay on the Y-axis (true) or on the Z-axis (false). - */ - function PrimitiveConePrefab(radius, height, segmentsW, segmentsH, closed, yUp) { - if (typeof radius === "undefined") { radius = 50; } - if (typeof height === "undefined") { height = 100; } - if (typeof segmentsW === "undefined") { segmentsW = 16; } - if (typeof segmentsH === "undefined") { segmentsH = 1; } - if (typeof closed === "undefined") { closed = true; } - if (typeof yUp === "undefined") { yUp = true; } - _super.call(this, 0, radius, height, segmentsW, segmentsH, false, closed, true, yUp); - } - Object.defineProperty(PrimitiveConePrefab.prototype, "radius", { - /** - * The radius of the bottom end of the cone. - */ - get: function () { - return this._pBottomRadius; - }, - set: function (value) { - this._pBottomRadius = value; - - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - return PrimitiveConePrefab; - })(prefabs.PrimitiveCylinderPrefab); - prefabs.PrimitiveConePrefab = PrimitiveConePrefab; - })(away.prefabs || (away.prefabs = {})); - var prefabs = away.prefabs; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (prefabs) { - /** - * A UV RegularPolygon primitive mesh. - */ - var PrimitivePolygonPrefab = (function (_super) { - __extends(PrimitivePolygonPrefab, _super); - /** - * Creates a new RegularPolygon disc object. - * @param radius The radius of the regular polygon - * @param sides Defines the number of sides of the regular polygon. - * @param yUp Defines whether the regular polygon should lay on the Y-axis (true) or on the Z-axis (false). - */ - function PrimitivePolygonPrefab(radius, sides, yUp) { - if (typeof radius === "undefined") { radius = 100; } - if (typeof sides === "undefined") { sides = 16; } - if (typeof yUp === "undefined") { yUp = true; } - _super.call(this, radius, 0, 0, sides, 1, true, false, false, yUp); - } - Object.defineProperty(PrimitivePolygonPrefab.prototype, "radius", { - /** - * The radius of the regular polygon. - */ - get: function () { - return this._pBottomRadius; - }, - set: function (value) { - this._pBottomRadius = value; - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitivePolygonPrefab.prototype, "sides", { - /** - * The number of sides of the regular polygon. - */ - get: function () { - return this._pSegmentsW; - }, - set: function (value) { - this.setSegmentsW(value); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitivePolygonPrefab.prototype, "subdivisions", { - /** - * The number of subdivisions from the edge to the center of the regular polygon. - */ - get: function () { - return this._pSegmentsH; - }, - set: function (value) { - this.setSegmentsH(value); - }, - enumerable: true, - configurable: true - }); - - return PrimitivePolygonPrefab; - })(prefabs.PrimitiveCylinderPrefab); - prefabs.PrimitivePolygonPrefab = PrimitivePolygonPrefab; - })(away.prefabs || (away.prefabs = {})); - var prefabs = away.prefabs; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (prefabs) { - /** - * A UV Sphere primitive mesh. - */ - var PrimitiveSpherePrefab = (function (_super) { - __extends(PrimitiveSpherePrefab, _super); - /** - * Creates a new Sphere object. - * - * @param radius The radius of the sphere. - * @param segmentsW Defines the number of horizontal segments that make up the sphere. - * @param segmentsH Defines the number of vertical segments that make up the sphere. - * @param yUp Defines whether the sphere poles should lay on the Y-axis (true) or on the Z-axis (false). - */ - function PrimitiveSpherePrefab(radius, segmentsW, segmentsH, yUp) { - if (typeof radius === "undefined") { radius = 50; } - if (typeof segmentsW === "undefined") { segmentsW = 16; } - if (typeof segmentsH === "undefined") { segmentsH = 12; } - if (typeof yUp === "undefined") { yUp = true; } - _super.call(this); - - this._radius = radius; - this._segmentsW = segmentsW; - this._segmentsH = segmentsH; - this._yUp = yUp; - } - Object.defineProperty(PrimitiveSpherePrefab.prototype, "radius", { - /** - * The radius of the sphere. - */ - get: function () { - return this._radius; - }, - set: function (value) { - this._radius = value; - - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitiveSpherePrefab.prototype, "segmentsW", { - /** - * Defines the number of horizontal segments that make up the sphere. Defaults to 16. - */ - get: function () { - return this._segmentsW; - }, - set: function (value) { - this._segmentsW = value; - - this._pInvalidateGeometry(); - this._pInvalidateUVs(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitiveSpherePrefab.prototype, "segmentsH", { - /** - * Defines the number of vertical segments that make up the sphere. Defaults to 12. - */ - get: function () { - return this._segmentsH; - }, - set: function (value) { - this._segmentsH = value; - - this._pInvalidateGeometry(); - this._pInvalidateUVs(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(PrimitiveSpherePrefab.prototype, "yUp", { - /** - * Defines whether the sphere poles should lay on the Y-axis (true) or on the Z-axis (false). - */ - get: function () { - return this._yUp; - }, - set: function (value) { - this._yUp = value; - - this._pInvalidateGeometry(); - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - PrimitiveSpherePrefab.prototype._pBuildGeometry = function (target, geometryType) { - var indices; - var positions; - var normals; - var tangents; - - var i; - var j; - var vidx, fidx; - - var comp1; - var comp2; - var numVertices; - - if (geometryType == "triangleSubGeometry") { - var triangleGeometry = target; - - numVertices = (this._segmentsH + 1) * (this._segmentsW + 1); - - if (numVertices == triangleGeometry.numVertices && triangleGeometry.indices != null) { - indices = triangleGeometry.indices; - positions = triangleGeometry.positions; - normals = triangleGeometry.vertexNormals; - tangents = triangleGeometry.vertexTangents; - } else { - indices = new Array((this._segmentsH - 1) * this._segmentsW * 6); - positions = new Array(numVertices * 3); - normals = new Array(numVertices * 3); - tangents = new Array(numVertices * 3); - - this._pInvalidateUVs(); - } - - vidx = 0; - fidx = 0; - - var startIndex; - var t1; - var t2; - - for (j = 0; j <= this._segmentsH; ++j) { - startIndex = vidx; - - var horangle = Math.PI * j / this._segmentsH; - var z = -this._radius * Math.cos(horangle); - var ringradius = this._radius * Math.sin(horangle); - - for (i = 0; i <= this._segmentsW; ++i) { - var verangle = 2 * Math.PI * i / this._segmentsW; - var x = ringradius * Math.cos(verangle); - var y = ringradius * Math.sin(verangle); - var normLen = 1 / Math.sqrt(x * x + y * y + z * z); - var tanLen = Math.sqrt(y * y + x * x); - - if (this._yUp) { - t1 = 0; - t2 = tanLen > .007 ? x / tanLen : 0; - comp1 = -z; - comp2 = y; - } else { - t1 = tanLen > .007 ? x / tanLen : 0; - t2 = 0; - comp1 = y; - comp2 = z; - } - - if (i == this._segmentsW) { - positions[vidx] = positions[startIndex]; - positions[vidx + 1] = positions[startIndex + 1]; - positions[vidx + 2] = positions[startIndex + 2]; - normals[vidx] = normals[startIndex] + (x * normLen) * .5; - normals[vidx + 1] = normals[startIndex + 1] + (comp1 * normLen) * .5; - normals[vidx + 2] = normals[startIndex + 2] + (comp2 * normLen) * .5; - tangents[vidx] = tanLen > .007 ? -y / tanLen : 1; - tangents[vidx + 1] = t1; - tangents[vidx + 2] = t2; - } else { - positions[vidx] = x; - positions[vidx + 1] = comp1; - positions[vidx + 2] = comp2; - normals[vidx] = x * normLen; - normals[vidx + 1] = comp1 * normLen; - normals[vidx + 2] = comp2 * normLen; - tangents[vidx] = tanLen > .007 ? -y / tanLen : 1; - tangents[vidx + 1] = t1; - tangents[vidx + 2] = t2; - } - - if (i > 0 && j > 0) { - var a = (this._segmentsW + 1) * j + i; - var b = (this._segmentsW + 1) * j + i - 1; - var c = (this._segmentsW + 1) * (j - 1) + i - 1; - var d = (this._segmentsW + 1) * (j - 1) + i; - - if (j == this._segmentsH) { - positions[vidx] = positions[startIndex]; - positions[vidx + 1] = positions[startIndex + 1]; - positions[vidx + 2] = positions[startIndex + 2]; - - indices[fidx++] = a; - indices[fidx++] = c; - indices[fidx++] = d; - } else if (j == 1) { - indices[fidx++] = a; - indices[fidx++] = b; - indices[fidx++] = c; - } else { - indices[fidx++] = a; - indices[fidx++] = b; - indices[fidx++] = c; - indices[fidx++] = a; - indices[fidx++] = c; - indices[fidx++] = d; - } - } - - vidx += 3; - } - } - - triangleGeometry.updateIndices(indices); - - triangleGeometry.updatePositions(positions); - triangleGeometry.updateVertexNormals(normals); - triangleGeometry.updateVertexTangents(tangents); - } else if (geometryType == "lineSubGeometry") { - var lineGeometry = target; - - var numSegments = (this._segmentsH - 1) * this._segmentsW * 2; - var startPositions; - var endPositions; - var thickness; - - if (lineGeometry.indices != null && numSegments == lineGeometry.numSegments) { - startPositions = lineGeometry.startPositions; - endPositions = lineGeometry.endPositions; - thickness = lineGeometry.thickness; - } else { - startPositions = new Array(numSegments * 3); - endPositions = new Array(numSegments * 3); - thickness = new Array(numSegments); - } - - vidx = 0; - - fidx = 0; - - for (j = 0; j <= this._segmentsH; ++j) { - var horangle = Math.PI * j / this._segmentsH; - var z = -this._radius * Math.cos(horangle); - var ringradius = this._radius * Math.sin(horangle); - - for (i = 0; i <= this._segmentsW; ++i) { - var verangle = 2 * Math.PI * i / this._segmentsW; - var x = ringradius * Math.cos(verangle); - var y = ringradius * Math.sin(verangle); - - if (this._yUp) { - comp1 = -z; - comp2 = y; - } else { - comp1 = y; - comp2 = z; - } - - if (i > 0 && j > 0) { - //horizonal lines - if (j < this._segmentsH) { - endPositions[vidx] = x; - endPositions[vidx + 1] = comp1; - endPositions[vidx + 2] = comp2; - - thickness[fidx++] = 1; - - vidx += 3; - } - - //vertical lines - startPositions[vidx] = endPositions[vidx - this._segmentsW * 6]; - startPositions[vidx + 1] = endPositions[vidx + 1 - this._segmentsW * 6]; - startPositions[vidx + 2] = endPositions[vidx + 2 - this._segmentsW * 6]; - - endPositions[vidx] = x; - endPositions[vidx + 1] = comp1; - endPositions[vidx + 2] = comp2; - - thickness[fidx++] = 1; - - vidx += 3; - } - - if (i < this._segmentsW && j > 0 && j < this._segmentsH) { - startPositions[vidx] = x; - startPositions[vidx + 1] = comp1; - startPositions[vidx + 2] = comp2; - } - } - } - - // build real data from raw data - lineGeometry.updatePositions(startPositions, endPositions); - lineGeometry.updateThickness(thickness); - } - }; - - /** - * @inheritDoc - */ - PrimitiveSpherePrefab.prototype._pBuildUVs = function (target, geometryType) { - var i, j; - var numVertices = (this._segmentsH + 1) * (this._segmentsW + 1); - var uvs; - - if (geometryType == "triangleSubGeometry") { - numVertices = (this._segmentsH + 1) * (this._segmentsW + 1); - - var triangleGeometry = target; - - if (numVertices == triangleGeometry.numVertices && triangleGeometry.uvs != null) { - uvs = triangleGeometry.uvs; - } else { - uvs = new Array(numVertices * 2); - } - - var index = 0; - for (j = 0; j <= this._segmentsH; ++j) { - for (i = 0; i <= this._segmentsW; ++i) { - uvs[index++] = (i / this._segmentsW) * triangleGeometry.scaleU; - uvs[index++] = (j / this._segmentsH) * triangleGeometry.scaleV; - } - } - - triangleGeometry.updateUVs(uvs); - } else if (geometryType == "lineSubGeometry") { - //nothing to do here - } - }; - return PrimitiveSpherePrefab; - })(prefabs.PrimitivePrefabBase); - prefabs.PrimitiveSpherePrefab = PrimitiveSpherePrefab; - })(away.prefabs || (away.prefabs = {})); - var prefabs = away.prefabs; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var AssetType = away.library.AssetType; - - var NamedAssetBase = away.library.NamedAssetBase; - - /** - * Provides an abstract base class for nodes in an animation blend tree. - */ - var AnimationNodeBase = (function (_super) { - __extends(AnimationNodeBase, _super); - /** - * Creates a new AnimationNodeBase object. - */ - function AnimationNodeBase() { - _super.call(this); - } - Object.defineProperty(AnimationNodeBase.prototype, "stateClass", { - get: function () { - return this._pStateClass; - }, - enumerable: true, - configurable: true - }); - - /** - * @inheritDoc - */ - AnimationNodeBase.prototype.dispose = function () { - }; - - Object.defineProperty(AnimationNodeBase.prototype, "assetType", { - /** - * @inheritDoc - */ - get: function () { - return AssetType.ANIMATION_NODE; - }, - enumerable: true, - configurable: true - }); - return AnimationNodeBase; - })(NamedAssetBase); - animators.AnimationNodeBase = AnimationNodeBase; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -/// -var away; -(function (away) { - (function (animators) { - - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/********************************************************************************************************************************************************************************************************** -* This file contains a reference to all the classes used in the project. -******************************************************************************************************************************************************************************************************** -* -* The TypeScript compiler exports classes in a non deterministic manner, as the extend functionality copies the prototype chain -* of one object onto another during initialisation and load (to create extensible functionality), the non deterministic nature of the -* compiler can result in an extend operation referencing a class that is undefined and not yet loaded - which throw an JavaScript error. -* -* This file provides the compiler with a strict order in which to export the TypeScript classes to mitigate undefined extend errors -* -* @see https://typescript.codeplex.com/workitem/1356 @see https://typescript.codeplex.com/workitem/913 -* -*********************************************************************************************************************************************************************************************************/ -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -away.Debug.THROW_ERRORS = false; -away.Debug.LOG_PI_ERRORS = false; - -var away; -(function (away) { - var AwayJSCore = (function (_super) { - __extends(AwayJSCore, _super); - function AwayJSCore() { - _super.call(this); - } - return AwayJSCore; - })(away.events.EventDispatcher); - away.AwayJSCore = AwayJSCore; -})(away || (away = {})); -//# sourceMappingURL=awayjs-core.next.js.map diff --git a/libs/awayjs-core.next.min.js b/libs/awayjs-core.next.min.js deleted file mode 100644 index d7cf09c45..000000000 --- a/libs/awayjs-core.next.min.js +++ /dev/null @@ -1,17 +0,0 @@ -var away;!function(away){!function(errors){var Error=function(){function Error(message,id,_name){"undefined"==typeof message&&(message=""),"undefined"==typeof id&&(id=0),"undefined"==typeof _name&&(_name=""),this._errorID=0,this._messsage="",this._name="",this._messsage=message,this._name=name,this._errorID=id}return Object.defineProperty(Error.prototype,"message",{get:function(){return this._messsage},set:function(value){this._messsage=value},enumerable:!0,configurable:!0}),Object.defineProperty(Error.prototype,"name",{get:function(){return this._name},set:function(value){this._name=value},enumerable:!0,configurable:!0}),Object.defineProperty(Error.prototype,"errorID",{get:function(){return this._errorID},enumerable:!0,configurable:!0}),Error}();errors.Error=Error}(away.errors||(away.errors={}));away.errors}(away||(away={}));var __extends=this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);__.prototype=b.prototype,d.prototype=new __},away;!function(away){!function(errors){var ArgumentError=function(_super){function ArgumentError(message,id){"undefined"==typeof message&&(message=null),"undefined"==typeof id&&(id=0),_super.call(this,message||"ArgumentError",id)}return __extends(ArgumentError,_super),ArgumentError}(away.errors.Error);errors.ArgumentError=ArgumentError}(away.errors||(away.errors={}));away.errors}(away||(away={}));var away;!function(away){!function(errors){var CastError=function(_super){function CastError(message){_super.call(this,message)}return __extends(CastError,_super),CastError}(errors.Error);errors.CastError=CastError}(away.errors||(away.errors={}));away.errors}(away||(away={}));var away;!function(away){!function(errors){var PartialImplementationError=function(_super){function PartialImplementationError(dependency,id){"undefined"==typeof dependency&&(dependency=""),"undefined"==typeof id&&(id=0),_super.call(this,"PartialImplementationError - this function is in development. Required Dependency: "+dependency,id)}return __extends(PartialImplementationError,_super),PartialImplementationError}(errors.Error);errors.PartialImplementationError=PartialImplementationError}(away.errors||(away.errors={}));away.errors}(away||(away={}));var away;!function(away){!function(errors){var AbstractMethodError=function(_super){function AbstractMethodError(message,id){"undefined"==typeof message&&(message=null),"undefined"==typeof id&&(id=0),_super.call(this,message||"An abstract method was called! Either an instance of an abstract class was created, or an abstract method was not overridden by the subclass.",id)}return __extends(AbstractMethodError,_super),AbstractMethodError}(away.errors.Error);errors.AbstractMethodError=AbstractMethodError}(away.errors||(away.errors={}));away.errors}(away||(away={}));var away;!function(away){!function(errors){var DocumentError=function(_super){function DocumentError(message,id){"undefined"==typeof message&&(message="DocumentError"),"undefined"==typeof id&&(id=0),_super.call(this,message,id)}return __extends(DocumentError,_super),DocumentError.DOCUMENT_DOES_NOT_EXIST="documentDoesNotExist",DocumentError}(errors.Error);errors.DocumentError=DocumentError}(away.errors||(away.errors={}));away.errors}(away||(away={}));var away;!function(away){!function(errors){var RangeError=function(_super){function RangeError(message,id){"undefined"==typeof message&&(message=null),"undefined"==typeof id&&(id=0),_super.call(this,message||"RangeError",id)}return __extends(RangeError,_super),RangeError}(away.errors.Error);errors.RangeError=RangeError}(away.errors||(away.errors={}));away.errors}(away||(away={}));var away;!function(away){!function(events){var Event=function(){function Event(type){this.type=void 0,this.target=void 0,this.type=type}return Event.prototype.clone=function(){return new Event(this.type)},Event.COMPLETE="complete",Event.OPEN="open",Event.ENTER_FRAME="enterFrame",Event.EXIT_FRAME="exitFrame",Event.RESIZE="resize",Event.ERROR="error",Event.CHANGE="change",Event}();events.Event=Event}(away.events||(away.events={}));away.events}(away||(away={}));var away;!function(away){!function(events){var AssetEvent=function(_super){function AssetEvent(type,asset,prevName){"undefined"==typeof asset&&(asset=null),"undefined"==typeof prevName&&(prevName=null),_super.call(this,type),this._asset=asset,this._prevName=prevName||(this._asset?this._asset.name:null)}return __extends(AssetEvent,_super),Object.defineProperty(AssetEvent.prototype,"asset",{get:function(){return this._asset},enumerable:!0,configurable:!0}),Object.defineProperty(AssetEvent.prototype,"assetPrevName",{get:function(){return this._prevName},enumerable:!0,configurable:!0}),AssetEvent.prototype.clone=function(){return new away.events.AssetEvent(this.type,this.asset,this.assetPrevName)},AssetEvent.ASSET_COMPLETE="assetComplete",AssetEvent.ASSET_RENAME="assetRename",AssetEvent.ASSET_CONFLICT_RESOLVED="assetConflictResolved",AssetEvent.TEXTURE_SIZE_ERROR="textureSizeError",AssetEvent}(away.events.Event);events.AssetEvent=AssetEvent}(away.events||(away.events={}));away.events}(away||(away={}));var away;!function(away){!function(events){var CameraEvent=function(_super){function CameraEvent(type,camera){_super.call(this,type),this._camera=camera}return __extends(CameraEvent,_super),Object.defineProperty(CameraEvent.prototype,"camera",{get:function(){return this._camera},enumerable:!0,configurable:!0}),CameraEvent.PROJECTION_CHANGED="projectionChanged",CameraEvent}(away.events.Event);events.CameraEvent=CameraEvent}(away.events||(away.events={}));away.events}(away||(away={}));var away;!function(away){!function(events){var DisplayObjectEvent=function(_super){function DisplayObjectEvent(type,object){_super.call(this,type),this.object=object}return __extends(DisplayObjectEvent,_super),DisplayObjectEvent.VISIBLITY_UPDATED="visiblityUpdated",DisplayObjectEvent.SCENETRANSFORM_CHANGED="scenetransformChanged",DisplayObjectEvent.SCENE_CHANGED="sceneChanged",DisplayObjectEvent.POSITION_CHANGED="positionChanged",DisplayObjectEvent.ROTATION_CHANGED="rotationChanged",DisplayObjectEvent.SCALE_CHANGED="scaleChanged",DisplayObjectEvent}(events.Event);events.DisplayObjectEvent=DisplayObjectEvent}(away.events||(away.events={}));away.events}(away||(away={}));var away;!function(away){!function(events){var EventDispatcher=function(){function EventDispatcher(target){"undefined"==typeof target&&(target=null),this.listeners=new Array,this.target=target||this}return EventDispatcher.prototype.addEventListener=function(type,listener){void 0===this.listeners[type]&&(this.listeners[type]=new Array),-1===this.getEventListenerIndex(type,listener)&&this.listeners[type].push(listener)},EventDispatcher.prototype.removeEventListener=function(type,listener){var index=this.getEventListenerIndex(type,listener);-1!==index&&this.listeners[type].splice(index,1)},EventDispatcher.prototype.dispatchEvent=function(event){var listenerArray=this.listeners[event.type];if(void 0!==listenerArray){var l=listenerArray.length;event.target=this.target;for(var i=0;l>i;i++)listenerArray[i](event)}},EventDispatcher.prototype.getEventListenerIndex=function(type,listener){if(void 0!==this.listeners[type])for(var a=this.listeners[type],l=a.length,i=0;l>i;i++)if(listener==a[i])return i;return-1},EventDispatcher.prototype.hasEventListener=function(type,listener){return null!=listener?-1!==this.getEventListenerIndex(type,listener):void 0!==this.listeners[type]?this.listeners[type].length>0:!1},EventDispatcher}();events.EventDispatcher=EventDispatcher}(away.events||(away.events={}));away.events}(away||(away={}));var away;!function(away){!function(events){var GeometryEvent=function(_super){function GeometryEvent(type,subGeometry){"undefined"==typeof subGeometry&&(subGeometry=null),_super.call(this,type),this._subGeometry=subGeometry}return __extends(GeometryEvent,_super),Object.defineProperty(GeometryEvent.prototype,"subGeometry",{get:function(){return this._subGeometry},enumerable:!0,configurable:!0}),GeometryEvent.prototype.clone=function(){return new GeometryEvent(this.type,this._subGeometry)},GeometryEvent.SUB_GEOMETRY_ADDED="SubGeometryAdded",GeometryEvent.SUB_GEOMETRY_REMOVED="SubGeometryRemoved",GeometryEvent.BOUNDS_INVALID="BoundsInvalid",GeometryEvent}(away.events.Event);events.GeometryEvent=GeometryEvent}(away.events||(away.events={}));away.events}(away||(away={}));var away;!function(away){!function(events){var HTTPStatusEvent=function(_super){function HTTPStatusEvent(type,status){"undefined"==typeof status&&(status=null),_super.call(this,type),this.status=status}return __extends(HTTPStatusEvent,_super),HTTPStatusEvent.HTTP_STATUS="HTTPStatusEvent_HTTP_STATUS",HTTPStatusEvent}(away.events.Event);events.HTTPStatusEvent=HTTPStatusEvent}(away.events||(away.events={}));away.events}(away||(away={}));var away;!function(away){!function(events){var IOErrorEvent=function(_super){function IOErrorEvent(type){_super.call(this,type)}return __extends(IOErrorEvent,_super),IOErrorEvent.IO_ERROR="ioError",IOErrorEvent}(away.events.Event);events.IOErrorEvent=IOErrorEvent}(away.events||(away.events={}));away.events}(away||(away={}));var away;!function(away){!function(events){var LightEvent=function(_super){function LightEvent(type){_super.call(this,type)}return __extends(LightEvent,_super),LightEvent.prototype.clone=function(){return new away.events.LightEvent(this.type)},LightEvent.CASTS_SHADOW_CHANGE="castsShadowChange",LightEvent}(away.events.Event);events.LightEvent=LightEvent}(away.events||(away.events={}));away.events}(away||(away={}));var away;!function(away){!function(events){var LoaderEvent=function(_super){function LoaderEvent(type,url,content,assets){"undefined"==typeof url&&(url=null),"undefined"==typeof content&&(content=null),"undefined"==typeof assets&&(assets=null),_super.call(this,type),this._url=url,this._content=content,this._assets=assets}return __extends(LoaderEvent,_super),Object.defineProperty(LoaderEvent.prototype,"content",{get:function(){return this._content},enumerable:!0,configurable:!0}),Object.defineProperty(LoaderEvent.prototype,"url",{get:function(){return this._url},enumerable:!0,configurable:!0}),Object.defineProperty(LoaderEvent.prototype,"assets",{get:function(){return this._assets},enumerable:!0,configurable:!0}),LoaderEvent.prototype.clone=function(){return new LoaderEvent(this.type,this._url,this._content,this._assets)},LoaderEvent.RESOURCE_COMPLETE="resourceComplete",LoaderEvent}(away.events.Event);events.LoaderEvent=LoaderEvent}(away.events||(away.events={}));away.events}(away||(away={}));var away;!function(away){!function(events){var ParserEvent=function(_super){function ParserEvent(type,message){"undefined"==typeof message&&(message=""),_super.call(this,type),this._message=message}return __extends(ParserEvent,_super),Object.defineProperty(ParserEvent.prototype,"message",{get:function(){return this._message},enumerable:!0,configurable:!0}),ParserEvent.prototype.clone=function(){return new away.events.ParserEvent(this.type,this.message)},ParserEvent.PARSE_COMPLETE="parseComplete",ParserEvent.PARSE_ERROR="parseError",ParserEvent.READY_FOR_DEPENDENCIES="readyForDependencies",ParserEvent}(away.events.Event);events.ParserEvent=ParserEvent}(away.events||(away.events={}));away.events}(away||(away={}));var away;!function(away){!function(events){var MouseEvent=function(_super){function MouseEvent(type){_super.call(this,type),this._iAllowedToPropagate=!0}return __extends(MouseEvent,_super),Object.defineProperty(MouseEvent.prototype,"bubbles",{get:function(){var doesBubble=this._iAllowedToPropagate;return this._iAllowedToPropagate=!0,doesBubble},enumerable:!0,configurable:!0}),MouseEvent.prototype.stopPropagation=function(){this._iAllowedToPropagate=!1,this._iParentEvent&&this._iParentEvent.stopPropagation()},MouseEvent.prototype.stopImmediatePropagation=function(){this._iAllowedToPropagate=!1,this._iParentEvent&&this._iParentEvent.stopImmediatePropagation()},MouseEvent.prototype.clone=function(){var result=new MouseEvent(this.type);return result.screenX=this.screenX,result.screenY=this.screenY,result.view=this.view,result.object=this.object,result.materialOwner=this.materialOwner,result.material=this.material,result.uv=this.uv,result.localPosition=this.localPosition,result.localNormal=this.localNormal,result.index=this.index,result.subGeometryIndex=this.subGeometryIndex,result.delta=this.delta,result.ctrlKey=this.ctrlKey,result.shiftKey=this.shiftKey,result._iParentEvent=this,result._iAllowedToPropagate=this._iAllowedToPropagate,result},Object.defineProperty(MouseEvent.prototype,"scenePosition",{get:function(){return this.object.sceneTransform.transformVector(this.localPosition)},enumerable:!0,configurable:!0}),Object.defineProperty(MouseEvent.prototype,"sceneNormal",{get:function(){var sceneNormal=this.object.sceneTransform.deltaTransformVector(this.localNormal);return sceneNormal.normalize(),sceneNormal},enumerable:!0,configurable:!0}),MouseEvent.MOUSE_OVER="mouseOver3d",MouseEvent.MOUSE_OUT="mouseOut3d",MouseEvent.MOUSE_UP="mouseUp3d",MouseEvent.MOUSE_DOWN="mouseDown3d",MouseEvent.MOUSE_MOVE="mouseMove3d",MouseEvent.CLICK="click3d",MouseEvent.DOUBLE_CLICK="doubleClick3d",MouseEvent.MOUSE_WHEEL="mouseWheel3d",MouseEvent}(away.events.Event);events.MouseEvent=MouseEvent}(away.events||(away.events={}));away.events}(away||(away={}));var away;!function(away){!function(events){var MaterialEvent=function(_super){function MaterialEvent(type){_super.call(this,type)}return __extends(MaterialEvent,_super),MaterialEvent.SIZE_CHANGED="sizeChanged",MaterialEvent}(events.Event);events.MaterialEvent=MaterialEvent}(away.events||(away.events={}));away.events}(away||(away={}));var away;!function(away){!function(events){var ProgressEvent=function(_super){function ProgressEvent(type){_super.call(this,type)}return __extends(ProgressEvent,_super),ProgressEvent.PROGRESS="progress",ProgressEvent}(away.events.Event);events.ProgressEvent=ProgressEvent}(away.events||(away.events={}));away.events}(away||(away={}));var away;!function(away){!function(events){var ProjectionEvent=function(_super){function ProjectionEvent(type,projection){_super.call(this,type),this._projection=projection}return __extends(ProjectionEvent,_super),Object.defineProperty(ProjectionEvent.prototype,"projection",{get:function(){return this._projection},enumerable:!0,configurable:!0}),ProjectionEvent.MATRIX_CHANGED="matrixChanged",ProjectionEvent}(away.events.Event);events.ProjectionEvent=ProjectionEvent}(away.events||(away.events={}));away.events}(away||(away={}));var away;!function(away){!function(events){var RendererEvent=function(_super){function RendererEvent(type){_super.call(this,type)}return __extends(RendererEvent,_super),RendererEvent.VIEWPORT_UPDATED="viewportUpdated",RendererEvent.SCISSOR_UPDATED="scissorUpdated",RendererEvent}(events.Event);events.RendererEvent=RendererEvent}(away.events||(away.events={}));away.events}(away||(away={}));var away;!function(away){!function(events){var SceneEvent=function(_super){function SceneEvent(type,displayObject){this.displayObject=displayObject,_super.call(this,type)}return __extends(SceneEvent,_super),SceneEvent.ADDED_TO_SCENE="addedToScene",SceneEvent.REMOVED_FROM_SCENE="removedFromScene",SceneEvent.PARTITION_CHANGED="partitionChanged",SceneEvent}(away.events.Event);events.SceneEvent=SceneEvent}(away.events||(away.events={}));away.events}(away||(away={}));var away;!function(away){!function(events){var StageEvent=function(_super){function StageEvent(type){_super.call(this,type)}return __extends(StageEvent,_super),StageEvent.CONTEXT_CREATED="contextCreated",StageEvent.CONTEXT_DISPOSED="contextDisposed",StageEvent.CONTEXT_RECREATED="contextRecreated",StageEvent.VIEWPORT_UPDATED="viewportUpdated",StageEvent}(away.events.Event);events.StageEvent=StageEvent}(away.events||(away.events={}));away.events}(away||(away={}));var away;!function(away){!function(events){var SubGeometryEvent=function(_super){function SubGeometryEvent(type,dataType){"undefined"==typeof dataType&&(dataType=""),_super.call(this,type),this._dataType=dataType}return __extends(SubGeometryEvent,_super),Object.defineProperty(SubGeometryEvent.prototype,"dataType",{get:function(){return this._dataType},enumerable:!0,configurable:!0}),SubGeometryEvent.prototype.clone=function(){return new SubGeometryEvent(this.type,this._dataType)},SubGeometryEvent.INDICES_UPDATED="indicesUpdated",SubGeometryEvent.VERTICES_UPDATED="verticesUpdated",SubGeometryEvent}(away.events.Event);events.SubGeometryEvent=SubGeometryEvent}(away.events||(away.events={}));away.events}(away||(away={}));var away;!function(away){!function(events){var TimerEvent=function(_super){function TimerEvent(type){_super.call(this,type)}return __extends(TimerEvent,_super),TimerEvent.TIMER="timer",TimerEvent.TIMER_COMPLETE="timerComplete",TimerEvent}(away.events.Event);events.TimerEvent=TimerEvent}(away.events||(away.events={}));away.events}(away||(away={}));var away;!function(away){!function(utils){var ByteArrayBase=function(){function ByteArrayBase(){this.position=0,this.length=0,this._mode=""}return ByteArrayBase.prototype.writeByte=function(){throw"Virtual method"},ByteArrayBase.prototype.readByte=function(){throw"Virtual method"},ByteArrayBase.prototype.writeUnsignedByte=function(){throw"Virtual method"},ByteArrayBase.prototype.readUnsignedByte=function(){throw"Virtual method"},ByteArrayBase.prototype.writeUnsignedShort=function(){throw"Virtual method"},ByteArrayBase.prototype.readUnsignedShort=function(){throw"Virtual method"},ByteArrayBase.prototype.writeUnsignedInt=function(){throw"Virtual method"},ByteArrayBase.prototype.readUnsignedInt=function(){throw"Virtual method"},ByteArrayBase.prototype.writeFloat=function(){throw"Virtual method"},ByteArrayBase.prototype.toFloatBits=function(){throw"Virtual method"},ByteArrayBase.prototype.readFloat=function(){throw"Virtual method"},ByteArrayBase.prototype.fromFloatBits=function(){throw"Virtual method"},ByteArrayBase.prototype.getBytesAvailable=function(){throw new away.errors.AbstractMethodError("ByteArrayBase, getBytesAvailable() not implemented ")},ByteArrayBase.prototype.toString=function(){return"[ByteArray] ( "+this._mode+" ) position="+this.position+" length="+this.length},ByteArrayBase.prototype.compareEqual=function(other,count){(void 0==count||count>this.length-this.position)&&(count=this.length-this.position),count>other.length-other.position&&(count=other.length-other.position);for(var r=!0;r&&count>=4;)count-=4,this.readUnsignedInt()!=other.readUnsignedInt()&&(r=!1);for(;r&&count>=1;)count--,this.readUnsignedByte()!=other.readUnsignedByte()&&(r=!1);var c0;return this.position-=c0-count,other.position-=c0-count,r},ByteArrayBase.prototype.writeBase64String=function(s){for(var i=0;id;d++)sh=lut[x>>(d<<2)&15]+sh;return sh}var oldpos=this.position;this.position=0;for(var nstep=8,i=0;ij&&i+jthis.length-this.position)&&(count=this.length-this.position),count>0?ByteArrayBase.internalGetBase64String(count,this.readUnsignedByte,this):""},ByteArrayBase.internalGetBase64String=function(count,getUnsignedByteFunc,self){for(var b0,b1,b2,enc1,enc2,enc3,enc4,r="",base64Key=ByteArrayBase.Base64Key;count>=3;)b0=getUnsignedByteFunc.apply(self),b1=getUnsignedByteFunc.apply(self),b2=getUnsignedByteFunc.apply(self),enc1=b0>>2,enc2=(3&b0)<<4|b1>>4,enc3=(15&b1)<<2|b2>>6,enc4=63&b2,r+=base64Key.charAt(enc1)+base64Key.charAt(enc2)+base64Key.charAt(enc3)+base64Key.charAt(enc4),count-=3;return 2==count?(b0=getUnsignedByteFunc.apply(self),b1=getUnsignedByteFunc.apply(self),enc1=b0>>2,enc2=(3&b0)<<4|b1>>4,enc3=(15&b1)<<2,r+=base64Key.charAt(enc1)+base64Key.charAt(enc2)+base64Key.charAt(enc3)+"="):1==count&&(b0=getUnsignedByteFunc.apply(self),enc1=b0>>2,enc2=(3&b0)<<4,r+=base64Key.charAt(enc1)+base64Key.charAt(enc2)+"=="),r},ByteArrayBase.Base64Key="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ByteArrayBase}();utils.ByteArrayBase=ByteArrayBase}(away.utils||(away.utils={}));away.utils}(away||(away={}));var away;!function(away){!function(utils){var ByteArray=function(_super){function ByteArray(){_super.call(this),this.maxlength=0,this._mode="Typed array",this.maxlength=4,this.arraybytes=new ArrayBuffer(this.maxlength),this.unalignedarraybytestemp=new ArrayBuffer(16)}return __extends(ByteArray,_super),ByteArray.prototype.ensureWriteableSpace=function(n){this.ensureSpace(n+this.position)},ByteArray.prototype.setArrayBuffer=function(aBuffer){this.ensureSpace(aBuffer.byteLength),this.length=aBuffer.byteLength;var inInt8AView=new Int8Array(aBuffer),localInt8View=new Int8Array(this.arraybytes,0,this.length);localInt8View.set(inInt8AView),this.position=0},ByteArray.prototype.getBytesAvailable=function(){return this.length-this.position},ByteArray.prototype.ensureSpace=function(n){if(n>this.maxlength){var newmaxlength=n+255&-256,newarraybuffer=new ArrayBuffer(newmaxlength),view=new Uint8Array(this.arraybytes,0,this.length),newview=new Uint8Array(newarraybuffer,0,this.length);newview.set(view),this.arraybytes=newarraybuffer,this.maxlength=newmaxlength}},ByteArray.prototype.writeByte=function(b){this.ensureWriteableSpace(1);var view=new Int8Array(this.arraybytes);view[this.position++]=~~b,this.position>this.length&&(this.length=this.position)},ByteArray.prototype.readByte=function(){if(this.position>=this.length)throw"ByteArray out of bounds read. Positon="+this.position+", Length="+this.length;var view=new Int8Array(this.arraybytes);return view[this.position++]},ByteArray.prototype.readBytes=function(bytes,offset,length){"undefined"==typeof offset&&(offset=0),"undefined"==typeof length&&(length=0),null==length&&(length=bytes.length),bytes.ensureWriteableSpace(offset+length);var byteView=new Int8Array(bytes.arraybytes),localByteView=new Int8Array(this.arraybytes);byteView.set(localByteView.subarray(this.position,this.position+length),offset),this.position+=length,length+offset>bytes.length&&(bytes.length+=length+offset-bytes.length)},ByteArray.prototype.writeUnsignedByte=function(b){this.ensureWriteableSpace(1);var view=new Uint8Array(this.arraybytes);view[this.position++]=255&~~b,this.position>this.length&&(this.length=this.position)},ByteArray.prototype.readUnsignedByte=function(){if(this.position>=this.length)throw"ByteArray out of bounds read. Positon="+this.position+", Length="+this.length;var view=new Uint8Array(this.arraybytes);return view[this.position++]},ByteArray.prototype.writeUnsignedShort=function(b){if(this.ensureWriteableSpace(2),0==(1&this.position)){var view=new Uint16Array(this.arraybytes);view[this.position>>1]=65535&~~b}else{var view=new Uint16Array(this.unalignedarraybytestemp,0,1);view[0]=65535&~~b;var view2=new Uint8Array(this.arraybytes,this.position,2),view3=new Uint8Array(this.unalignedarraybytestemp,0,2);view2.set(view3)}this.position+=2,this.position>this.length&&(this.length=this.position)},ByteArray.prototype.readUTFBytes=function(len){for(var value="",max=this.position+len,data=new DataView(this.arraybytes);this.positionc){if(0==c)break;value+=String.fromCharCode(c)}else if(224>c)value+=String.fromCharCode((63&c)<<6|127&data.getUint8(this.position++));else if(240>c){var c2=data.getUint8(this.position++);value+=String.fromCharCode((31&c)<<12|(127&c2)<<6|127&data.getUint8(this.position++))}else{var c2=data.getUint8(this.position++),c3=data.getUint8(this.position++);value+=String.fromCharCode((15&c)<<18|(127&c2)<<12|c3<<6&127|127&data.getUint8(this.position++))}}return value},ByteArray.prototype.readInt=function(){var data=new DataView(this.arraybytes),int=data.getInt32(this.position,!0);return this.position+=4,int},ByteArray.prototype.readShort=function(){var data=new DataView(this.arraybytes),short=data.getInt16(this.position,!0);return this.position+=2,short},ByteArray.prototype.readDouble=function(){var data=new DataView(this.arraybytes),double=data.getFloat64(this.position,!0);return this.position+=8,double},ByteArray.prototype.readUnsignedShort=function(){if(this.position>this.length+2)throw"ByteArray out of bounds read. Position="+this.position+", Length="+this.length;if(0==(1&this.position)){var view=new Uint16Array(this.arraybytes),pa=this.position>>1;return this.position+=2,view[pa]}var view=new Uint16Array(this.unalignedarraybytestemp,0,1),view2=new Uint8Array(this.arraybytes,this.position,2),view3=new Uint8Array(this.unalignedarraybytestemp,0,2);return view3.set(view2),this.position+=2,view[0]},ByteArray.prototype.writeUnsignedInt=function(b){if(this.ensureWriteableSpace(4),0==(3&this.position)){var view=new Uint32Array(this.arraybytes);view[this.position>>2]=4294967295&~~b}else{var view=new Uint32Array(this.unalignedarraybytestemp,0,1);view[0]=4294967295&~~b;var view2=new Uint8Array(this.arraybytes,this.position,4),view3=new Uint8Array(this.unalignedarraybytestemp,0,4);view2.set(view3)}this.position+=4,this.position>this.length&&(this.length=this.position)},ByteArray.prototype.readUnsignedInt=function(){if(this.position>this.length+4)throw"ByteArray out of bounds read. Position="+this.position+", Length="+this.length;if(0==(3&this.position)){var view=new Uint32Array(this.arraybytes),pa=this.position>>2;return this.position+=4,view[pa]}var view=new Uint32Array(this.unalignedarraybytestemp,0,1),view2=new Uint8Array(this.arraybytes,this.position,4),view3=new Uint8Array(this.unalignedarraybytestemp,0,4);return view3.set(view2),this.position+=4,view[0]},ByteArray.prototype.writeFloat=function(b){if(this.ensureWriteableSpace(4),0==(3&this.position)){var view=new Float32Array(this.arraybytes);view[this.position>>2]=b}else{var view=new Float32Array(this.unalignedarraybytestemp,0,1);view[0]=b;var view2=new Uint8Array(this.arraybytes,this.position,4),view3=new Uint8Array(this.unalignedarraybytestemp,0,4);view2.set(view3)}this.position+=4,this.position>this.length&&(this.length=this.position)},ByteArray.prototype.readFloat=function(){if(this.position>this.length+4)throw"ByteArray out of bounds read. Positon="+this.position+", Length="+this.length;if(0==(3&this.position)){var view=new Float32Array(this.arraybytes),pa=this.position>>2;return this.position+=4,view[pa]}var view=new Float32Array(this.unalignedarraybytestemp,0,1),view2=new Uint8Array(this.arraybytes,this.position,4),view3=new Uint8Array(this.unalignedarraybytestemp,0,4);return view3.set(view2),this.position+=4,view[0]},ByteArray}(utils.ByteArrayBase);utils.ByteArray=ByteArray}(away.utils||(away.utils={}));away.utils}(away||(away={}));var away;!function(away){!function(utils){var ByteArrayBuffer=function(_super){function ByteArrayBuffer(){_super.call(this),this._bytes=[],this._mode="Array"}return __extends(ByteArrayBuffer,_super),ByteArrayBuffer.prototype.writeByte=function(b){var bi=~~b;this._bytes[this.position++]=bi,this.position>this.length&&(this.length=this.position)},ByteArrayBuffer.prototype.readByte=function(){if(this.position>=this.length)throw"ByteArray out of bounds read. Position="+this.position+", Length="+this.length;return this._bytes[this.position++]},ByteArrayBuffer.prototype.writeUnsignedByte=function(b){var bi=~~b;this._bytes[this.position++]=255&bi,this.position>this.length&&(this.length=this.position)},ByteArrayBuffer.prototype.readUnsignedByte=function(){if(this.position>=this.length)throw"ByteArray out of bounds read. Position="+this.position+", Length="+this.length;return this._bytes[this.position++]},ByteArrayBuffer.prototype.writeUnsignedShort=function(b){var bi=~~b;this._bytes[this.position++]=255&bi,this._bytes[this.position++]=bi>>8&255,this.position>this.length&&(this.length=this.position)},ByteArrayBuffer.prototype.readUnsignedShort=function(){if(this.position+2>this.length)throw"ByteArray out of bounds read. Position="+this.position+", Length="+this.length;var r=this._bytes[this.position]|this._bytes[this.position+1]<<8;return this.position+=2,r},ByteArrayBuffer.prototype.writeUnsignedInt=function(b){var bi=~~b;this._bytes[this.position++]=255&bi,this._bytes[this.position++]=bi>>>8&255,this._bytes[this.position++]=bi>>>16&255,this._bytes[this.position++]=bi>>>24&255,this.position>this.length&&(this.length=this.position)},ByteArrayBuffer.prototype.readUnsignedInt=function(){if(this.position+4>this.length)throw"ByteArray out of bounds read. Position="+this.position+", Length="+this.length;var r=this._bytes[this.position]|this._bytes[this.position+1]<<8|this._bytes[this.position+2]<<16|this._bytes[this.position+3]<<24;return this.position+=4,r>>>0},ByteArrayBuffer.prototype.writeFloat=function(b){this.writeUnsignedInt(this.toFloatBits(Number(b)))},ByteArrayBuffer.prototype.toFloatBits=function(x){if(0==x)return 0;var sign=0;0>x?(x=-x,sign=1):sign=0;var exponent=Math.log(x)/Math.log(2);exponent=Math.floor(exponent),x*=Math.pow(2,23-exponent);var mantissa=Math.floor(x)-8388608;return exponent+=127,sign<<31>>>0|exponent<<23|mantissa},ByteArrayBuffer.prototype.readFloat=function(){return this.fromFloatBits(this.readUnsignedInt())},ByteArrayBuffer.prototype.fromFloatBits=function(x){if(0==x)return 0;var exponent=x>>>23&255,mantissa=8388607&x|8388608,y=Math.pow(2,exponent-127-23)*mantissa;return x>>>31!=0&&(y=-y),y},ByteArrayBuffer}(utils.ByteArrayBase);utils.ByteArrayBuffer=ByteArrayBuffer}(away.utils||(away.utils={}));away.utils}(away||(away={}));var away;!function(away){!function(utils){var ColorUtils=function(){function ColorUtils(){}return ColorUtils.float32ColorToARGB=function(float32Color){var a=(4278190080&float32Color)>>>24,r=(16711680&float32Color)>>>16,g=(65280&float32Color)>>>8,b=255&float32Color,result=[a,r,g,b];return result},ColorUtils.componentToHex=function(c){var hex=c.toString(16);return 1==hex.length?"0"+hex:hex},ColorUtils.RGBToHexString=function(argb){return"#"+ColorUtils.componentToHex(argb[1])+ColorUtils.componentToHex(argb[2])+ColorUtils.componentToHex(argb[3])},ColorUtils.ARGBToHexString=function(argb){return"#"+ColorUtils.componentToHex(argb[0])+ColorUtils.componentToHex(argb[1])+ColorUtils.componentToHex(argb[2])+ColorUtils.componentToHex(argb[3])},ColorUtils}();utils.ColorUtils=ColorUtils}(away.utils||(away.utils={}));away.utils}(away||(away={}));var away;!function(away){!function(utils){var Cast=function(){function Cast(){}return Cast.string=function(data){return"function"==typeof data&&(data=new data),"string"==typeof data?data:data},Cast.byteArray=function(data){return"function"==typeof data&&(data=new data),data instanceof utils.ByteArray?data:data},Cast.isHex=function(str){for(var length=str.length,i=0;length>i;++i)if(-1==this._hexChars.indexOf(str.charAt(i)))return!1;return!0},Cast.tryColor=function(data){if("number"==typeof data)return Math.floor(data);if("string"==typeof data){if("random"==data)return Math.floor(16777216*Math.random());if(null==this._colorNames&&(this._colorNames=new Object,this._colorNames.steelblue=4620980,this._colorNames.royalblue=267920,this._colorNames.cornflowerblue=6591981,this._colorNames.lightsteelblue=11584734,this._colorNames.mediumslateblue=8087790,this._colorNames.slateblue=6970061,this._colorNames.darkslateblue=4734347,this._colorNames.midnightblue=1644912,this._colorNames.navy=128,this._colorNames.darkblue=139,this._colorNames.mediumblue=205,this._colorNames.blue=255,this._colorNames.dodgerblue=2003199,this._colorNames.deepskyblue=49151,this._colorNames.lightskyblue=8900346,this._colorNames.skyblue=8900331,this._colorNames.lightblue=11393254,this._colorNames.powderblue=11591910,this._colorNames.azure=15794175,this._colorNames.lightcyan=14745599,this._colorNames.paleturquoise=11529966,this._colorNames.mediumturquoise=4772300,this._colorNames.lightseagreen=2142890,this._colorNames.darkcyan=35723,this._colorNames.teal=32896,this._colorNames.cadetblue=6266528,this._colorNames.darkturquoise=52945,this._colorNames.aqua=65535,this._colorNames.cyan=65535,this._colorNames.turquoise=4251856,this._colorNames.aquamarine=8388564,this._colorNames.mediumaquamarine=6737322,this._colorNames.darkseagreen=9419919,this._colorNames.mediumseagreen=3978097,this._colorNames.seagreen=3050327,this._colorNames.darkgreen=25600,this._colorNames.green=32768,this._colorNames.forestgreen=2263842,this._colorNames.limegreen=3329330,this._colorNames.lime=65280,this._colorNames.chartreuse=8388352,this._colorNames.lawngreen=8190976,this._colorNames.greenyellow=11403055,this._colorNames.yellowgreen=10145074,this._colorNames.palegreen=10025880,this._colorNames.lightgreen=9498256,this._colorNames.springgreen=65407,this._colorNames.mediumspringgreen=64154,this._colorNames.darkolivegreen=5597999,this._colorNames.olivedrab=7048739,this._colorNames.olive=8421376,this._colorNames.darkkhaki=12433259,this._colorNames.darkgoldenrod=12092939,this._colorNames.goldenrod=14329120,this._colorNames.gold=16766720,this._colorNames.yellow=16776960,this._colorNames.khaki=15787660,this._colorNames.palegoldenrod=15657130,this._colorNames.blanchedalmond=16772045,this._colorNames.moccasin=16770229,this._colorNames.wheat=16113331,this._colorNames.navajowhite=16768685,this._colorNames.burlywood=14596231,this._colorNames.tan=13808780,this._colorNames.rosybrown=12357519,this._colorNames.sienna=10506797,this._colorNames.saddlebrown=9127187,this._colorNames.chocolate=13789470,this._colorNames.peru=13468991,this._colorNames.sandybrown=16032864,this._colorNames.darkred=9109504,this._colorNames.maroon=8388608,this._colorNames.brown=10824234,this._colorNames.firebrick=11674146,this._colorNames.indianred=13458524,this._colorNames.lightcoral=15761536,this._colorNames.salmon=16416882,this._colorNames.darksalmon=15308410,this._colorNames.lightsalmon=16752762,this._colorNames.coral=16744272,this._colorNames.tomato=16737095,this._colorNames.darkorange=16747520,this._colorNames.orange=16753920,this._colorNames.orangered=16729344,this._colorNames.crimson=14423100,this._colorNames.red=16711680,this._colorNames.deeppink=16716947,this._colorNames.fuchsia=16711935,this._colorNames.magenta=16711935,this._colorNames.hotpink=16738740,this._colorNames.lightpink=16758465,this._colorNames.pink=16761035,this._colorNames.palevioletred=14381203,this._colorNames.mediumvioletred=13047173,this._colorNames.purple=8388736,this._colorNames.darkmagenta=9109643,this._colorNames.mediumpurple=9662683,this._colorNames.blueviolet=9055202,this._colorNames.indigo=4915330,this._colorNames.darkviolet=9699539,this._colorNames.darkorchid=10040012,this._colorNames.mediumorchid=12211667,this._colorNames.orchid=14315734,this._colorNames.violet=15631086,this._colorNames.plum=14524637,this._colorNames.thistle=14204888,this._colorNames.lavender=15132410,this._colorNames.ghostwhite=16316671,this._colorNames.aliceblue=15792383,this._colorNames.mintcream=16121850,this._colorNames.honeydew=15794160,this._colorNames.lightgoldenrodyellow=16448210,this._colorNames.lemonchiffon=16775885,this._colorNames.cornsilk=16775388,this._colorNames.lightyellow=16777184,this._colorNames.ivory=16777200,this._colorNames.floralwhite=16775920,this._colorNames.linen=16445670,this._colorNames.oldlace=16643558,this._colorNames.antiquewhite=16444375,this._colorNames.bisque=16770244,this._colorNames.peachpuff=16767673,this._colorNames.papayawhip=16773077,this._colorNames.beige=16119260,this._colorNames.seashell=16774638,this._colorNames.lavenderblush=16773365,this._colorNames.mistyrose=16770273,this._colorNames.snow=16775930,this._colorNames.white=16777215,this._colorNames.whitesmoke=16119285,this._colorNames.gainsboro=14474460,this._colorNames.lightgrey=13882323,this._colorNames.silver=12632256,this._colorNames.darkgrey=11119017,this._colorNames.grey=8421504,this._colorNames.lightslategrey=7833753,this._colorNames.slategrey=7372944,this._colorNames.dimgrey=6908265,this._colorNames.darkslategrey=3100495,this._colorNames.black=0,this._colorNames.transparent=4278190080),null!=this._colorNames[data])return this._colorNames[data]; -if(6==data.length&&this.isHex(data))return parseInt("0x"+data)}return null},Cast.color=function(data){var result=this.tryColor(data);if(null==result)throw new away.errors.CastError("Can't cast to color: "+data);return result},Cast.tryClass=function(name){if(this._notClasses[name])return name;var result=this._classes[name];if(null!=result)return result;try{return result=window[name],this._classes[name]=result,result}catch(e){}return this._notClasses[name]=!0,name},Cast.bitmapData=function(data){if(null==data)return null;if("string"==typeof data&&(data=this.tryClass(data)),"function"==typeof data)try{data=new data}catch(e){data=new data(0,0)}if(data instanceof away.base.BitmapData)return data;if(data instanceof away.textures.ImageTexture&&(data=data.htmlImageElement),data instanceof HTMLImageElement){var imageElement=data,bitmapData=new away.base.BitmapData(imageElement.width,imageElement.height,!0,0);return bitmapData.draw(imageElement),bitmapData}throw new away.errors.CastError("Can't cast to BitmapData: "+data)},Cast.bitmapTexture=function(data){if(null==data)return null;if("string"==typeof data&&(data=this.tryClass(data)),"function"==typeof data)try{data=new data}catch(e){data=new data(0,0)}if(data instanceof away.textures.BitmapTexture)return data;try{var bmd=Cast.bitmapData(data);return new away.textures.BitmapTexture(bmd)}catch(e){}throw new away.errors.CastError("Can't cast to BitmapTexture: "+data)},Cast._hexChars="0123456789abcdefABCDEF",Cast._notClasses=new Object,Cast._classes=new Object,Cast}();utils.Cast=Cast}(away.utils||(away.utils={}));away.utils}(away||(away={}));var away;!function(away){!function(utils){var CSS=function(){function CSS(){}return CSS.setElementSize=function(element,width,height){element.style.width=width+"px",element.style.height=height+"px",element.width=width,element.height=height},CSS.setElementWidth=function(element,width){element.style.width=width+"px",element.width=width},CSS.setElementHeight=function(element,height){element.style.height=height+"px",element.height=height},CSS.setElementX=function(element,x){element.style.position="absolute",element.style.left=x+"px"},CSS.setElementY=function(element,y){element.style.position="absolute",element.style.top=y+"px"},CSS.getElementVisibility=function(element){return"visible"==element.style.visibility},CSS.setElementVisibility=function(element,visible){element.style.visibility=visible?"visible":"hidden"},CSS.setElementAlpha=function(element,alpha){if(element instanceof HTMLCanvasElement){var context=element.getContext("2d");context.globalAlpha=alpha}},CSS.setElementPosition=function(element,x,y,absolute){"undefined"==typeof absolute&&(absolute=!1),element.style.position=absolute?"absolute":"relative",element.style.left=x+"px",element.style.top=y+"px"},CSS}();utils.CSS=CSS}(away.utils||(away.utils={}));away.utils}(away||(away={}));var away;!function(away){var Debug=function(){function Debug(){}return Debug.breakpoint=function(){away.Debug["break"]()},Debug.throwPIROnKeyWordOnly=function(str,enable){"undefined"==typeof enable&&(enable=!0),away.Debug.keyword=enable?str:null},Debug.throwPIR=function(clss,fnc,msg){if(Debug.logPIR("PartialImplementationError "+clss,fnc,msg),Debug.THROW_ERRORS){if(away.Debug.keyword){var e=clss+fnc+msg;if(-1==e.indexOf(away.Debug.keyword))return}throw new away.errors.PartialImplementationError(clss+"."+fnc+": "+msg)}},Debug.logPIR=function(clss,fnc,msg){"undefined"==typeof msg&&(msg=""),Debug.LOG_PI_ERRORS&&console.log(clss+"."+fnc+": "+msg)},Debug.log=function(){for(var args=[],_i=0;_i=1&&d<=TextureUtils.MAX_SIZE&&TextureUtils.isPowerOfTwo(d)},TextureUtils.isPowerOfTwo=function(value){return value?(value&-value)==value:!1},TextureUtils.getBestPowerOf2=function(value){for(var p=1;value>p;)p<<=1;return p>TextureUtils.MAX_SIZE&&(p=TextureUtils.MAX_SIZE),p},TextureUtils.MAX_SIZE=2048,TextureUtils}();utils.TextureUtils=TextureUtils}(away.utils||(away.utils={}));away.utils}(away||(away={}));var away;!function(away){!function(utils){var Timer=function(_super){function Timer(delay,repeatCount){if("undefined"==typeof repeatCount&&(repeatCount=0),_super.call(this),this._repeatCount=0,this._currentCount=0,this._running=!1,this._delay=delay,this._repeatCount=repeatCount,isNaN(delay)||0>delay)throw new away.errors.Error("Delay is negative or not a number")}return __extends(Timer,_super),Object.defineProperty(Timer.prototype,"currentCount",{get:function(){return this._currentCount},enumerable:!0,configurable:!0}),Object.defineProperty(Timer.prototype,"delay",{get:function(){return this._delay},set:function(value){this._delay=value,this._running&&(this.stop(),this.start())},enumerable:!0,configurable:!0}),Object.defineProperty(Timer.prototype,"repeatCount",{get:function(){return this._repeatCount},set:function(value){this._repeatCount=value},enumerable:!0,configurable:!0}),Timer.prototype.reset=function(){this._running&&this.stop(),this._currentCount=0},Object.defineProperty(Timer.prototype,"running",{get:function(){return this._running},enumerable:!0,configurable:!0}),Timer.prototype.start=function(){var _this=this;this._running=!0,clearInterval(this._iid),this._iid=setInterval(function(){return _this.tick()},this._delay)},Timer.prototype.stop=function(){this._running=!1,clearInterval(this._iid)},Timer.prototype.tick=function(){this._currentCount++,this._repeatCount>0&&this._currentCount>=this._repeatCount?(this.stop(),this.dispatchEvent(new away.events.TimerEvent(away.events.TimerEvent.TIMER)),this.dispatchEvent(new away.events.TimerEvent(away.events.TimerEvent.TIMER_COMPLETE))):this.dispatchEvent(new away.events.TimerEvent(away.events.TimerEvent.TIMER))},Timer}(away.events.EventDispatcher);utils.Timer=Timer}(away.utils||(away.utils={}));away.utils}(away||(away={}));var away;!function(away){!function(geom){var Box=function(){function Box(x,y,z,width,height,depth){"undefined"==typeof x&&(x=0),"undefined"==typeof y&&(y=0),"undefined"==typeof z&&(z=0),"undefined"==typeof width&&(width=0),"undefined"==typeof height&&(height=0),"undefined"==typeof depth&&(depth=0),this.x=x,this.y=y,this.z=z,this.width=width,this.height=height,this.depth=depth}return Object.defineProperty(Box.prototype,"back",{get:function(){return this.z+this.depth},set:function(val){this.depth=val-this.z},enumerable:!0,configurable:!0}),Object.defineProperty(Box.prototype,"bottom",{get:function(){return this.y+this.height},set:function(val){this.height=val-this.y},enumerable:!0,configurable:!0}),Object.defineProperty(Box.prototype,"bottomRightBack",{get:function(){return null==this._bottomRightBack&&(this._bottomRightBack=new geom.Vector3D),this._bottomRightBack.x=this.x+this.width,this._bottomRightBack.y=this.y+this.height,this._bottomRightBack.z=this.z+this.depth,this._bottomRightBack},enumerable:!0,configurable:!0}),Object.defineProperty(Box.prototype,"front",{get:function(){return this.z},set:function(val){this.depth+=this.z-val,this.z=val},enumerable:!0,configurable:!0}),Object.defineProperty(Box.prototype,"left",{get:function(){return this.x},set:function(val){this.width+=this.x-val,this.x=val},enumerable:!0,configurable:!0}),Object.defineProperty(Box.prototype,"right",{get:function(){return this.x+this.width},set:function(val){this.width=val-this.x},enumerable:!0,configurable:!0}),Object.defineProperty(Box.prototype,"size",{get:function(){return null==this._size&&(this._size=new geom.Vector3D),this._size.x=this.width,this._size.y=this.height,this._size.z=this.depth,this._size},enumerable:!0,configurable:!0}),Object.defineProperty(Box.prototype,"top",{get:function(){return this.y},set:function(val){this.height+=this.y-val,this.y=val},enumerable:!0,configurable:!0}),Object.defineProperty(Box.prototype,"topLeftFront",{get:function(){return null==this._topLeftFront&&(this._topLeftFront=new away.geom.Vector3D),this._topLeftFront.x=this.x,this._topLeftFront.y=this.y,this._topLeftFront.z=this.z,this._topLeftFront},enumerable:!0,configurable:!0}),Box.prototype.clone=function(){return new Box(this.x,this.y,this.z,this.width,this.height,this.depth)},Box.prototype.contains=function(x,y,z){return this.x<=x&&this.x+this.width>=x&&this.y<=y&&this.y+this.height>=y&&this.z<=z&&this.z+this.depth>=z},Box.prototype.containsPoint=function(position){return this.x<=position.x&&this.x+this.width>=position.x&&this.y<=position.y&&this.y+this.height>=position.y&&this.z<=position.z&&this.z+this.depth>=position.z},Box.prototype.containsRect=function(box){return this.x<=box.x&&this.x+this.width>=box.x+box.width&&this.y<=box.y&&this.y+this.height>=box.y+box.height&&this.z<=box.z&&this.z+this.depth>=box.z+box.depth},Box.prototype.copyFrom=function(){},Box.prototype.equals=function(toCompare){return this.x==toCompare.x&&this.y==toCompare.y&&this.z==toCompare.z&&this.width==toCompare.width&&this.height==toCompare.height&&this.depth==toCompare.depth},Box.prototype.inflate=function(dx,dy,dz){this.x-=dx/2,this.y-=dy/2,this.z-=dz/2,this.width+=dx/2,this.height+=dy/2,this.depth+=dz/2},Box.prototype.inflatePoint=function(delta){this.x-=delta.x/2,this.y-=delta.y/2,this.z-=delta.z/2,this.width+=delta.x/2,this.height+=delta.y/2,this.depth+=delta.z/2},Box.prototype.intersection=function(toIntersect){if(this.intersects(toIntersect)){var i=new Box;return this.x>toIntersect.x?(i.x=this.x,i.width=toIntersect.x-this.x+toIntersect.width,i.width>this.width&&(i.width=this.width)):(i.x=toIntersect.x,i.width=this.x-toIntersect.x+this.width,i.width>toIntersect.width&&(i.width=toIntersect.width)),this.y>toIntersect.y?(i.y=this.y,i.height=toIntersect.y-this.y+toIntersect.height,i.height>this.height&&(i.height=this.height)):(i.y=toIntersect.y,i.height=this.y-toIntersect.y+this.height,i.height>toIntersect.height&&(i.height=toIntersect.height)),this.z>toIntersect.z?(i.z=this.z,i.depth=toIntersect.z-this.z+toIntersect.depth,i.depth>this.depth&&(i.depth=this.depth)):(i.z=toIntersect.z,i.depth=this.z-toIntersect.z+this.depth,i.depth>toIntersect.depth&&(i.depth=toIntersect.depth)),i}return new Box},Box.prototype.intersects=function(toIntersect){return this.x+this.width>toIntersect.x&&this.xtoIntersect.y&&this.ytoIntersect.z&&this.z2)throw"Column "+column+" out of bounds (2)";0==column?(this.a=vector3D.x,this.c=vector3D.y):1==column?(this.b=vector3D.x,this.d=vector3D.y):(this.tx=vector3D.x,this.ty=vector3D.y)},Matrix.prototype.copyColumnTo=function(column,vector3D){if(column>2)throw new away.errors.ArgumentError("ArgumentError, Column "+column+" out of bounds [0, ..., 2]");0==column?(vector3D.x=this.a,vector3D.y=this.c,vector3D.z=0):1==column?(vector3D.x=this.b,vector3D.y=this.d,vector3D.z=0):(vector3D.x=this.tx,vector3D.y=this.ty,vector3D.z=1)},Matrix.prototype.copyFrom=function(sourceMatrix){this.a=sourceMatrix.a,this.b=sourceMatrix.b,this.c=sourceMatrix.c,this.d=sourceMatrix.d,this.tx=sourceMatrix.tx,this.ty=sourceMatrix.ty},Matrix.prototype.copyRowFrom=function(row,vector3D){if(row>2)throw new away.errors.ArgumentError("ArgumentError, Row "+row+" out of bounds [0, ..., 2]");0==row?(this.a=vector3D.x,this.c=vector3D.y):1==row?(this.b=vector3D.x,this.d=vector3D.y):(this.tx=vector3D.x,this.ty=vector3D.y)},Matrix.prototype.copyRowTo=function(row,vector3D){if(row>2)throw new away.errors.ArgumentError("ArgumentError, Row "+row+" out of bounds [0, ..., 2]");0==row?(vector3D.x=this.a,vector3D.y=this.b,vector3D.z=this.tx):1==row?(vector3D.x=this.c,vector3D.y=this.d,vector3D.z=this.ty):vector3D.setTo(0,0,1)},Matrix.prototype.createBox=function(scaleX,scaleY,rotation,tx,ty){"undefined"==typeof rotation&&(rotation=0),"undefined"==typeof tx&&(tx=0),"undefined"==typeof ty&&(ty=0),this.a=scaleX,this.d=scaleY,this.b=rotation,this.tx=tx,this.ty=ty},Matrix.prototype.createGradientBox=function(width,height,rotation,tx,ty){if("undefined"==typeof rotation&&(rotation=0),"undefined"==typeof tx&&(tx=0),"undefined"==typeof ty&&(ty=0),this.a=width/1638.4,this.d=height/1638.4,0!=rotation){var cos=Math.cos(rotation),sin=Math.sin(rotation);this.b=sin*this.d,this.c=-sin*this.a,this.a*=cos,this.d*=cos}else this.b=this.c=0;this.tx=tx+width/2,this.ty=ty+height/2},Matrix.prototype.deltaTransformPoint=function(point){return new away.geom.Point(point.x*this.a+point.y*this.c,point.x*this.b+point.y*this.d)},Matrix.prototype.identity=function(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0},Matrix.prototype.invert=function(){var norm=this.a*this.d-this.b*this.c;if(0==norm)this.a=this.b=this.c=this.d=0,this.tx=-this.tx,this.ty=-this.ty;else{norm=1/norm;var a1=this.d*norm;this.d=this.a*norm,this.a=a1,this.b*=-norm,this.c*=-norm;var tx1=-this.a*this.tx-this.c*this.ty;this.ty=-this.b*this.tx-this.d*this.ty,this.tx=tx1}},Matrix.prototype.multiply=function(matrix){var result=new Matrix;return result.a=this.a*matrix.a+this.b*matrix.c,result.b=this.a*matrix.b+this.b*matrix.d,result.c=this.c*matrix.a+this.d*matrix.c,result.d=this.c*matrix.b+this.d*matrix.d,result.tx=this.tx*matrix.a+this.ty*matrix.c+matrix.tx,result.ty=this.tx*matrix.b+this.ty*matrix.d+matrix.ty,result},Matrix.prototype.rotate=function(angle){var cos=Math.cos(angle),sin=Math.sin(angle),a1=this.a*cos-this.b*sin;this.b=this.a*sin+this.b*cos,this.a=a1;var c1=this.c*cos-this.d*sin;this.d=this.c*sin+this.d*cos,this.c=c1;var tx1=this.tx*cos-this.ty*sin;this.ty=this.tx*sin+this.ty*cos,this.tx=tx1},Matrix.prototype.scale=function(sx,sy){this.a*=sx,this.b*=sy,this.c*=sx,this.d*=sy,this.tx*=sx,this.ty*=sy},Matrix.prototype.setTo=function(a,b,c,d,tx,ty){this.a=a,this.b=b,this.c=c,this.d=d,this.tx=tx,this.ty=ty},Matrix.prototype.toString=function(){return"[Matrix] (a="+this.a+", b="+this.b+", c="+this.c+", d="+this.d+", tx="+this.tx+", ty="+this.ty+")"},Matrix.prototype.transformPoint=function(point){return new away.geom.Point(point.x*this.a+point.y*this.c+this.tx,point.x*this.b+point.y*this.d+this.ty)},Matrix.prototype.translate=function(dx,dy){this.tx+=dx,this.ty+=dy},Matrix}();geom.Matrix=Matrix}(away.geom||(away.geom={}));away.geom}(away||(away={}));var away;!function(away){!function(geom){var Matrix3D=function(){function Matrix3D(v){"undefined"==typeof v&&(v=null),this.rawData=null!=v&&16==v.length?v.concat():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}return Matrix3D.prototype.append=function(lhs){var m111=this.rawData[0],m121=this.rawData[4],m131=this.rawData[8],m141=this.rawData[12],m112=this.rawData[1],m122=this.rawData[5],m132=this.rawData[9],m142=this.rawData[13],m113=this.rawData[2],m123=this.rawData[6],m133=this.rawData[10],m143=this.rawData[14],m114=this.rawData[3],m124=this.rawData[7],m134=this.rawData[11],m144=this.rawData[15],m211=lhs.rawData[0],m221=lhs.rawData[4],m231=lhs.rawData[8],m241=lhs.rawData[12],m212=lhs.rawData[1],m222=lhs.rawData[5],m232=lhs.rawData[9],m242=lhs.rawData[13],m213=lhs.rawData[2],m223=lhs.rawData[6],m233=lhs.rawData[10],m243=lhs.rawData[14],m214=lhs.rawData[3],m224=lhs.rawData[7],m234=lhs.rawData[11],m244=lhs.rawData[15];this.rawData[0]=m111*m211+m112*m221+m113*m231+m114*m241,this.rawData[1]=m111*m212+m112*m222+m113*m232+m114*m242,this.rawData[2]=m111*m213+m112*m223+m113*m233+m114*m243,this.rawData[3]=m111*m214+m112*m224+m113*m234+m114*m244,this.rawData[4]=m121*m211+m122*m221+m123*m231+m124*m241,this.rawData[5]=m121*m212+m122*m222+m123*m232+m124*m242,this.rawData[6]=m121*m213+m122*m223+m123*m233+m124*m243,this.rawData[7]=m121*m214+m122*m224+m123*m234+m124*m244,this.rawData[8]=m131*m211+m132*m221+m133*m231+m134*m241,this.rawData[9]=m131*m212+m132*m222+m133*m232+m134*m242,this.rawData[10]=m131*m213+m132*m223+m133*m233+m134*m243,this.rawData[11]=m131*m214+m132*m224+m133*m234+m134*m244,this.rawData[12]=m141*m211+m142*m221+m143*m231+m144*m241,this.rawData[13]=m141*m212+m142*m222+m143*m232+m144*m242,this.rawData[14]=m141*m213+m142*m223+m143*m233+m144*m243,this.rawData[15]=m141*m214+m142*m224+m143*m234+m144*m244},Matrix3D.prototype.appendRotation=function(degrees,axis){var m=Matrix3D.getAxisRotation(axis.x,axis.y,axis.z,degrees);this.append(m)},Matrix3D.prototype.appendScale=function(xScale,yScale,zScale){this.append(new Matrix3D([xScale,0,0,0,0,yScale,0,0,0,0,zScale,0,0,0,0,1]))},Matrix3D.prototype.appendTranslation=function(x,y,z){this.rawData[12]+=x,this.rawData[13]+=y,this.rawData[14]+=z},Matrix3D.prototype.clone=function(){return new Matrix3D(this.rawData.slice(0))},Matrix3D.prototype.copyColumnFrom=function(column,vector3D){switch(column){case 0:this.rawData[0]=vector3D.x,this.rawData[1]=vector3D.y,this.rawData[2]=vector3D.z,this.rawData[3]=vector3D.w;break;case 1:this.rawData[4]=vector3D.x,this.rawData[5]=vector3D.y,this.rawData[6]=vector3D.z,this.rawData[7]=vector3D.w;break;case 2:this.rawData[8]=vector3D.x,this.rawData[9]=vector3D.y,this.rawData[10]=vector3D.z,this.rawData[11]=vector3D.w;break;case 3:this.rawData[12]=vector3D.x,this.rawData[13]=vector3D.y,this.rawData[14]=vector3D.z,this.rawData[15]=vector3D.w;break;default:throw new away.errors.ArgumentError("ArgumentError, Column "+column+" out of bounds [0, ..., 3]")}},Matrix3D.prototype.copyColumnTo=function(column,vector3D){switch(column){case 0:vector3D.x=this.rawData[0],vector3D.y=this.rawData[1],vector3D.z=this.rawData[2],vector3D.w=this.rawData[3];break;case 1:vector3D.x=this.rawData[4],vector3D.y=this.rawData[5],vector3D.z=this.rawData[6],vector3D.w=this.rawData[7];break;case 2:vector3D.x=this.rawData[8],vector3D.y=this.rawData[9],vector3D.z=this.rawData[10],vector3D.w=this.rawData[11];break;case 3:vector3D.x=this.rawData[12],vector3D.y=this.rawData[13],vector3D.z=this.rawData[14],vector3D.w=this.rawData[15];break;default:throw new away.errors.ArgumentError("ArgumentError, Column "+column+" out of bounds [0, ..., 3]")}},Matrix3D.prototype.copyFrom=function(sourceMatrix3D){for(var len=sourceMatrix3D.rawData.length,c=0;len>c;c++)this.rawData[c]=sourceMatrix3D.rawData[c]},Matrix3D.prototype.copyRawDataFrom=function(vector,index,transpose){"undefined"==typeof index&&(index=0),"undefined"==typeof transpose&&(transpose=!1),transpose&&this.transpose();for(var len=vector.length-index,c=0;len>c;c++)this.rawData[c]=vector[c+index];transpose&&this.transpose()},Matrix3D.prototype.copyRawDataTo=function(vector,index,transpose){"undefined"==typeof index&&(index=0),"undefined"==typeof transpose&&(transpose=!1),transpose&&this.transpose();for(var len=this.rawData.length,c=0;len>c;c++)vector[c+index]=this.rawData[c];transpose&&this.transpose()},Matrix3D.prototype.copyRowFrom=function(row,vector3D){switch(row){case 0:this.rawData[0]=vector3D.x,this.rawData[4]=vector3D.y,this.rawData[8]=vector3D.z,this.rawData[12]=vector3D.w;break;case 1:this.rawData[1]=vector3D.x,this.rawData[5]=vector3D.y,this.rawData[9]=vector3D.z,this.rawData[13]=vector3D.w;break;case 2:this.rawData[2]=vector3D.x,this.rawData[6]=vector3D.y,this.rawData[10]=vector3D.z,this.rawData[14]=vector3D.w;break;case 3:this.rawData[3]=vector3D.x,this.rawData[7]=vector3D.y,this.rawData[11]=vector3D.z,this.rawData[15]=vector3D.w;break;default:throw new away.errors.ArgumentError("ArgumentError, Row "+row+" out of bounds [0, ..., 3]")}},Matrix3D.prototype.copyRowTo=function(row,vector3D){switch(row){case 0:vector3D.x=this.rawData[0],vector3D.y=this.rawData[4],vector3D.z=this.rawData[8],vector3D.w=this.rawData[12];break;case 1:vector3D.x=this.rawData[1],vector3D.y=this.rawData[5],vector3D.z=this.rawData[9],vector3D.w=this.rawData[13];break;case 2:vector3D.x=this.rawData[2],vector3D.y=this.rawData[6],vector3D.z=this.rawData[10],vector3D.w=this.rawData[14];break;case 3:vector3D.x=this.rawData[3],vector3D.y=this.rawData[7],vector3D.z=this.rawData[11],vector3D.w=this.rawData[15];break;default:throw new away.errors.ArgumentError("ArgumentError, Row "+row+" out of bounds [0, ..., 3]")}},Matrix3D.prototype.copyToMatrix3D=function(dest){dest.rawData=this.rawData.slice(0)},Matrix3D.prototype.decompose=function(orientationStyle){"undefined"==typeof orientationStyle&&(orientationStyle="eulerAngles");var vec=[],m=this.clone(),mr=m.rawData,pos=new geom.Vector3D(mr[12],mr[13],mr[14]);mr[12]=0,mr[13]=0,mr[14]=0;var scale=new geom.Vector3D;scale.x=Math.sqrt(mr[0]*mr[0]+mr[1]*mr[1]+mr[2]*mr[2]),scale.y=Math.sqrt(mr[4]*mr[4]+mr[5]*mr[5]+mr[6]*mr[6]),scale.z=Math.sqrt(mr[8]*mr[8]+mr[9]*mr[9]+mr[10]*mr[10]),mr[0]*(mr[5]*mr[10]-mr[6]*mr[9])-mr[1]*(mr[4]*mr[10]-mr[6]*mr[8])+mr[2]*(mr[4]*mr[9]-mr[5]*mr[8])<0&&(scale.z=-scale.z),mr[0]/=scale.x,mr[1]/=scale.x,mr[2]/=scale.x,mr[4]/=scale.y,mr[5]/=scale.y,mr[6]/=scale.y,mr[8]/=scale.z,mr[9]/=scale.z,mr[10]/=scale.z;var rot=new geom.Vector3D;switch(orientationStyle){case geom.Orientation3D.AXIS_ANGLE:rot.w=Math.acos((mr[0]+mr[5]+mr[10]-1)/2);var len=Math.sqrt((mr[6]-mr[9])*(mr[6]-mr[9])+(mr[8]-mr[2])*(mr[8]-mr[2])+(mr[1]-mr[4])*(mr[1]-mr[4]));rot.x=(mr[6]-mr[9])/len,rot.y=(mr[8]-mr[2])/len,rot.z=(mr[1]-mr[4])/len;break;case geom.Orientation3D.QUATERNION:var tr=mr[0]+mr[5]+mr[10];tr>0?(rot.w=Math.sqrt(1+tr)/2,rot.x=(mr[6]-mr[9])/(4*rot.w),rot.y=(mr[8]-mr[2])/(4*rot.w),rot.z=(mr[1]-mr[4])/(4*rot.w)):mr[0]>mr[5]&&mr[0]>mr[10]?(rot.x=Math.sqrt(1+mr[0]-mr[5]-mr[10])/2,rot.w=(mr[6]-mr[9])/(4*rot.x),rot.y=(mr[1]+mr[4])/(4*rot.x),rot.z=(mr[8]+mr[2])/(4*rot.x)):mr[5]>mr[10]?(rot.y=Math.sqrt(1+mr[5]-mr[0]-mr[10])/2,rot.x=(mr[1]+mr[4])/(4*rot.y),rot.w=(mr[8]-mr[2])/(4*rot.y),rot.z=(mr[6]+mr[9])/(4*rot.y)):(rot.z=Math.sqrt(1+mr[10]-mr[0]-mr[5])/2,rot.x=(mr[8]+mr[2])/(4*rot.z),rot.y=(mr[6]+mr[9])/(4*rot.z),rot.w=(mr[1]-mr[4])/(4*rot.z));break;case geom.Orientation3D.EULER_ANGLES:rot.y=Math.asin(-mr[2]),1!=mr[2]&&-1!=mr[2]?(rot.x=Math.atan2(mr[6],mr[10]),rot.z=Math.atan2(mr[1],mr[0])):(rot.z=0,rot.x=Math.atan2(mr[4],mr[5]))}return vec.push(pos),vec.push(rot),vec.push(scale),vec},Matrix3D.prototype.deltaTransformVector=function(v){var x=v.x,y=v.y,z=v.z;return new away.geom.Vector3D(x*this.rawData[0]+y*this.rawData[4]+z*this.rawData[8],x*this.rawData[1]+y*this.rawData[5]+z*this.rawData[9],x*this.rawData[2]+y*this.rawData[6]+z*this.rawData[10],x*this.rawData[3]+y*this.rawData[7]+z*this.rawData[11])},Matrix3D.prototype.identity=function(){this.rawData=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},Matrix3D.interpolate=function(thisMat,toMat,percent){for(var m=new Matrix3D,i=0;16>i;++i)m.rawData[i]=thisMat.rawData[i]+(toMat.rawData[i]-thisMat.rawData[i])*percent;return m},Matrix3D.prototype.interpolateTo=function(toMat,percent){for(var i=0;16>i;++i)this.rawData[i]=this.rawData[i]+(toMat.rawData[i]-this.rawData[i])*percent},Matrix3D.prototype.invert=function(){var d=this.determinant,invertable=Math.abs(d)>1e-11;if(invertable){d=1/d;var m11=this.rawData[0],m21=this.rawData[4],m31=this.rawData[8],m41=this.rawData[12],m12=this.rawData[1],m22=this.rawData[5],m32=this.rawData[9],m42=this.rawData[13],m13=this.rawData[2],m23=this.rawData[6],m33=this.rawData[10],m43=this.rawData[14],m14=this.rawData[3],m24=this.rawData[7],m34=this.rawData[11],m44=this.rawData[15];this.rawData[0]=d*(m22*(m33*m44-m43*m34)-m32*(m23*m44-m43*m24)+m42*(m23*m34-m33*m24)),this.rawData[1]=-d*(m12*(m33*m44-m43*m34)-m32*(m13*m44-m43*m14)+m42*(m13*m34-m33*m14)),this.rawData[2]=d*(m12*(m23*m44-m43*m24)-m22*(m13*m44-m43*m14)+m42*(m13*m24-m23*m14)),this.rawData[3]=-d*(m12*(m23*m34-m33*m24)-m22*(m13*m34-m33*m14)+m32*(m13*m24-m23*m14)),this.rawData[4]=-d*(m21*(m33*m44-m43*m34)-m31*(m23*m44-m43*m24)+m41*(m23*m34-m33*m24)),this.rawData[5]=d*(m11*(m33*m44-m43*m34)-m31*(m13*m44-m43*m14)+m41*(m13*m34-m33*m14)),this.rawData[6]=-d*(m11*(m23*m44-m43*m24)-m21*(m13*m44-m43*m14)+m41*(m13*m24-m23*m14)),this.rawData[7]=d*(m11*(m23*m34-m33*m24)-m21*(m13*m34-m33*m14)+m31*(m13*m24-m23*m14)),this.rawData[8]=d*(m21*(m32*m44-m42*m34)-m31*(m22*m44-m42*m24)+m41*(m22*m34-m32*m24)),this.rawData[9]=-d*(m11*(m32*m44-m42*m34)-m31*(m12*m44-m42*m14)+m41*(m12*m34-m32*m14)),this.rawData[10]=d*(m11*(m22*m44-m42*m24)-m21*(m12*m44-m42*m14)+m41*(m12*m24-m22*m14)),this.rawData[11]=-d*(m11*(m22*m34-m32*m24)-m21*(m12*m34-m32*m14)+m31*(m12*m24-m22*m14)),this.rawData[12]=-d*(m21*(m32*m43-m42*m33)-m31*(m22*m43-m42*m23)+m41*(m22*m33-m32*m23)),this.rawData[13]=d*(m11*(m32*m43-m42*m33)-m31*(m12*m43-m42*m13)+m41*(m12*m33-m32*m13)),this.rawData[14]=-d*(m11*(m22*m43-m42*m23)-m21*(m12*m43-m42*m13)+m41*(m12*m23-m22*m13)),this.rawData[15]=d*(m11*(m22*m33-m32*m23)-m21*(m12*m33-m32*m13)+m31*(m12*m23-m22*m13))}return invertable},Matrix3D.prototype.prepend=function(rhs){var m111=rhs.rawData[0],m121=rhs.rawData[4],m131=rhs.rawData[8],m141=rhs.rawData[12],m112=rhs.rawData[1],m122=rhs.rawData[5],m132=rhs.rawData[9],m142=rhs.rawData[13],m113=rhs.rawData[2],m123=rhs.rawData[6],m133=rhs.rawData[10],m143=rhs.rawData[14],m114=rhs.rawData[3],m124=rhs.rawData[7],m134=rhs.rawData[11],m144=rhs.rawData[15],m211=this.rawData[0],m221=this.rawData[4],m231=this.rawData[8],m241=this.rawData[12],m212=this.rawData[1],m222=this.rawData[5],m232=this.rawData[9],m242=this.rawData[13],m213=this.rawData[2],m223=this.rawData[6],m233=this.rawData[10],m243=this.rawData[14],m214=this.rawData[3],m224=this.rawData[7],m234=this.rawData[11],m244=this.rawData[15]; -this.rawData[0]=m111*m211+m112*m221+m113*m231+m114*m241,this.rawData[1]=m111*m212+m112*m222+m113*m232+m114*m242,this.rawData[2]=m111*m213+m112*m223+m113*m233+m114*m243,this.rawData[3]=m111*m214+m112*m224+m113*m234+m114*m244,this.rawData[4]=m121*m211+m122*m221+m123*m231+m124*m241,this.rawData[5]=m121*m212+m122*m222+m123*m232+m124*m242,this.rawData[6]=m121*m213+m122*m223+m123*m233+m124*m243,this.rawData[7]=m121*m214+m122*m224+m123*m234+m124*m244,this.rawData[8]=m131*m211+m132*m221+m133*m231+m134*m241,this.rawData[9]=m131*m212+m132*m222+m133*m232+m134*m242,this.rawData[10]=m131*m213+m132*m223+m133*m233+m134*m243,this.rawData[11]=m131*m214+m132*m224+m133*m234+m134*m244,this.rawData[12]=m141*m211+m142*m221+m143*m231+m144*m241,this.rawData[13]=m141*m212+m142*m222+m143*m232+m144*m242,this.rawData[14]=m141*m213+m142*m223+m143*m233+m144*m243,this.rawData[15]=m141*m214+m142*m224+m143*m234+m144*m244},Matrix3D.prototype.prependRotation=function(degrees,axis){var m=Matrix3D.getAxisRotation(axis.x,axis.y,axis.z,degrees);this.prepend(m)},Matrix3D.prototype.prependScale=function(xScale,yScale,zScale){this.prepend(new Matrix3D([xScale,0,0,0,0,yScale,0,0,0,0,zScale,0,0,0,0,1]))},Matrix3D.prototype.prependTranslation=function(x,y,z){var m=new Matrix3D;m.position=new geom.Vector3D(x,y,z),this.prepend(m)},Matrix3D.prototype.recompose=function(components){if(components.length<3)return!1;this.identity(),this.appendScale(components[2].x,components[2].y,components[2].z);var angle;return angle=-components[1].x,this.append(new Matrix3D([1,0,0,0,0,Math.cos(angle),-Math.sin(angle),0,0,Math.sin(angle),Math.cos(angle),0,0,0,0,0])),angle=-components[1].y,this.append(new Matrix3D([Math.cos(angle),0,Math.sin(angle),0,0,1,0,0,-Math.sin(angle),0,Math.cos(angle),0,0,0,0,0])),angle=-components[1].z,this.append(new Matrix3D([Math.cos(angle),-Math.sin(angle),0,0,Math.sin(angle),Math.cos(angle),0,0,0,0,1,0,0,0,0,0])),this.position=components[0],this.rawData[15]=1,!0},Matrix3D.prototype.transformVector=function(v){var x=v.x,y=v.y,z=v.z;return new away.geom.Vector3D(x*this.rawData[0]+y*this.rawData[4]+z*this.rawData[8]+this.rawData[12],x*this.rawData[1]+y*this.rawData[5]+z*this.rawData[9]+this.rawData[13],x*this.rawData[2]+y*this.rawData[6]+z*this.rawData[10]+this.rawData[14],x*this.rawData[3]+y*this.rawData[7]+z*this.rawData[11]+this.rawData[15])},Matrix3D.prototype.transformVectors=function(vin,vout){for(var i=0,x=0,y=0,z=0;i+3<=vin.length;)x=vin[i],y=vin[i+1],z=vin[i+2],vout[i]=x*this.rawData[0]+y*this.rawData[4]+z*this.rawData[8]+this.rawData[12],vout[i+1]=x*this.rawData[1]+y*this.rawData[5]+z*this.rawData[9]+this.rawData[13],vout[i+2]=x*this.rawData[2]+y*this.rawData[6]+z*this.rawData[10]+this.rawData[14],i+=3},Matrix3D.prototype.transpose=function(){var oRawData=this.rawData.slice(0);this.rawData[1]=oRawData[4],this.rawData[2]=oRawData[8],this.rawData[3]=oRawData[12],this.rawData[4]=oRawData[1],this.rawData[6]=oRawData[9],this.rawData[7]=oRawData[13],this.rawData[8]=oRawData[2],this.rawData[9]=oRawData[6],this.rawData[11]=oRawData[14],this.rawData[12]=oRawData[3],this.rawData[13]=oRawData[7],this.rawData[14]=oRawData[11]},Matrix3D.getAxisRotation=function(x,y,z,degrees){var tmp1,tmp2,m=new Matrix3D,rad=degrees*(Math.PI/180),c=Math.cos(rad),s=Math.sin(rad),t=1-c;return m.rawData[0]=c+x*x*t,m.rawData[5]=c+y*y*t,m.rawData[10]=c+z*z*t,tmp1=x*y*t,tmp2=z*s,m.rawData[1]=tmp1+tmp2,m.rawData[4]=tmp1-tmp2,tmp1=x*z*t,tmp2=y*s,m.rawData[8]=tmp1+tmp2,m.rawData[2]=tmp1-tmp2,tmp1=y*z*t,tmp2=x*s,m.rawData[9]=tmp1-tmp2,m.rawData[6]=tmp1+tmp2,m},Object.defineProperty(Matrix3D.prototype,"determinant",{get:function(){return(this.rawData[0]*this.rawData[5]-this.rawData[4]*this.rawData[1])*(this.rawData[10]*this.rawData[15]-this.rawData[14]*this.rawData[11])-(this.rawData[0]*this.rawData[9]-this.rawData[8]*this.rawData[1])*(this.rawData[6]*this.rawData[15]-this.rawData[14]*this.rawData[7])+(this.rawData[0]*this.rawData[13]-this.rawData[12]*this.rawData[1])*(this.rawData[6]*this.rawData[11]-this.rawData[10]*this.rawData[7])+(this.rawData[4]*this.rawData[9]-this.rawData[8]*this.rawData[5])*(this.rawData[2]*this.rawData[15]-this.rawData[14]*this.rawData[3])-(this.rawData[4]*this.rawData[13]-this.rawData[12]*this.rawData[5])*(this.rawData[2]*this.rawData[11]-this.rawData[10]*this.rawData[3])+(this.rawData[8]*this.rawData[13]-this.rawData[12]*this.rawData[9])*(this.rawData[2]*this.rawData[7]-this.rawData[6]*this.rawData[3])},enumerable:!0,configurable:!0}),Object.defineProperty(Matrix3D.prototype,"position",{get:function(){return new geom.Vector3D(this.rawData[12],this.rawData[13],this.rawData[14])},set:function(value){this.rawData[12]=value.x,this.rawData[13]=value.y,this.rawData[14]=value.z},enumerable:!0,configurable:!0}),Matrix3D.prototype.toFixed=function(decimalPlace){var magnitude=Math.pow(10,decimalPlace);return"matrix3d("+Math.round(this.rawData[0]*magnitude)/magnitude+","+Math.round(this.rawData[1]*magnitude)/magnitude+","+Math.round(this.rawData[2]*magnitude)/magnitude+","+Math.round(this.rawData[3]*magnitude)/magnitude+","+Math.round(this.rawData[4]*magnitude)/magnitude+","+Math.round(this.rawData[5]*magnitude)/magnitude+","+Math.round(this.rawData[6]*magnitude)/magnitude+","+Math.round(this.rawData[7]*magnitude)/magnitude+","+Math.round(this.rawData[8]*magnitude)/magnitude+","+Math.round(this.rawData[9]*magnitude)/magnitude+","+Math.round(this.rawData[10]*magnitude)/magnitude+","+Math.round(this.rawData[11]*magnitude)/magnitude+","+Math.round(this.rawData[12]*magnitude)/magnitude+","+Math.round(this.rawData[13]*magnitude)/magnitude+","+Math.round(this.rawData[14]*magnitude)/magnitude+","+Math.round(this.rawData[15]*magnitude)/magnitude+")"},Matrix3D.prototype.toString=function(){return"matrix3d("+Math.round(1e3*this.rawData[0])/1e3+","+Math.round(1e3*this.rawData[1])/1e3+","+Math.round(1e3*this.rawData[2])/1e3+","+Math.round(1e3*this.rawData[3])/1e3+","+Math.round(1e3*this.rawData[4])/1e3+","+Math.round(1e3*this.rawData[5])/1e3+","+Math.round(1e3*this.rawData[6])/1e3+","+Math.round(1e3*this.rawData[7])/1e3+","+Math.round(1e3*this.rawData[8])/1e3+","+Math.round(1e3*this.rawData[9])/1e3+","+Math.round(1e3*this.rawData[10])/1e3+","+Math.round(1e3*this.rawData[11])/1e3+","+Math.round(1e3*this.rawData[12])/1e3+","+Math.round(1e3*this.rawData[13])/1e3+","+Math.round(1e3*this.rawData[14])/1e3+","+Math.round(1e3*this.rawData[15])/1e3+")"},Matrix3D}();geom.Matrix3D=Matrix3D}(away.geom||(away.geom={}));away.geom}(away||(away={}));var away;!function(away){!function(geom){var Matrix3DUtils=function(){function Matrix3DUtils(){}return Matrix3DUtils.quaternion2matrix=function(quarternion,m){"undefined"==typeof m&&(m=null);var x=quarternion.x,y=quarternion.y,z=quarternion.z,w=quarternion.w,xx=x*x,xy=x*y,xz=x*z,xw=x*w,yy=y*y,yz=y*z,yw=y*w,zz=z*z,zw=z*w,raw=Matrix3DUtils.RAW_DATA_CONTAINER;return raw[0]=1-2*(yy+zz),raw[1]=2*(xy+zw),raw[2]=2*(xz-yw),raw[4]=2*(xy-zw),raw[5]=1-2*(xx+zz),raw[6]=2*(yz+xw),raw[8]=2*(xz+yw),raw[9]=2*(yz-xw),raw[10]=1-2*(xx+yy),raw[3]=raw[7]=raw[11]=raw[12]=raw[13]=raw[14]=0,raw[15]=1,m?(m.copyRawDataFrom(raw),m):new geom.Matrix3D(raw)},Matrix3DUtils.getForward=function(m,v){return"undefined"==typeof v&&(v=null),null===v&&(v=new geom.Vector3D(0,0,0)),m.copyColumnTo(2,v),v.normalize(),v},Matrix3DUtils.getUp=function(m,v){return"undefined"==typeof v&&(v=null),null===v&&(v=new geom.Vector3D(0,0,0)),m.copyColumnTo(1,v),v.normalize(),v},Matrix3DUtils.getRight=function(m,v){return"undefined"==typeof v&&(v=null),null===v&&(v=new geom.Vector3D(0,0,0)),m.copyColumnTo(0,v),v.normalize(),v},Matrix3DUtils.compare=function(m1,m2){var r1=Matrix3DUtils.RAW_DATA_CONTAINER,r2=m2.rawData;m1.copyRawDataTo(r1);for(var i=0;16>i;++i)if(r1[i]!=r2[i])return!1;return!0},Matrix3DUtils.lookAt=function(matrix,pos,dir,up){var dirN,upN,lftN,raw=Matrix3DUtils.RAW_DATA_CONTAINER;lftN=dir.crossProduct(up),lftN.normalize(),upN=lftN.crossProduct(dir),upN.normalize(),dirN=dir.clone(),dirN.normalize(),raw[0]=lftN.x,raw[1]=upN.x,raw[2]=-dirN.x,raw[3]=0,raw[4]=lftN.y,raw[5]=upN.y,raw[6]=-dirN.y,raw[7]=0,raw[8]=lftN.z,raw[9]=upN.z,raw[10]=-dirN.z,raw[11]=0,raw[12]=-lftN.dotProduct(pos),raw[13]=-upN.dotProduct(pos),raw[14]=dirN.dotProduct(pos),raw[15]=1,matrix.copyRawDataFrom(raw)},Matrix3DUtils.reflection=function(plane,target){"undefined"==typeof target&&(target=null),null===target&&(target=new geom.Matrix3D);var a=plane.a,b=plane.b,c=plane.c,d=plane.d,rawData=Matrix3DUtils.RAW_DATA_CONTAINER,ab2=-2*a*b,ac2=-2*a*c,bc2=-2*b*c;return rawData[0]=1-2*a*a,rawData[4]=ab2,rawData[8]=ac2,rawData[12]=-2*a*d,rawData[1]=ab2,rawData[5]=1-2*b*b,rawData[9]=bc2,rawData[13]=-2*b*d,rawData[2]=ac2,rawData[6]=bc2,rawData[10]=1-2*c*c,rawData[14]=-2*c*d,rawData[3]=0,rawData[7]=0,rawData[11]=0,rawData[15]=1,target.copyRawDataFrom(rawData),target},Matrix3DUtils.transformVector=function(matrix,vector,result){"undefined"==typeof result&&(result=null),result||(result=new geom.Vector3D);var raw=Matrix3DUtils.RAW_DATA_CONTAINER;matrix.copyRawDataTo(raw);var a=raw[0],e=raw[1],i=raw[2],m=raw[3],b=raw[4],f=raw[5],j=raw[6],n=raw[7],c=raw[8],g=raw[9],k=raw[10],o=raw[11],d=raw[12],h=raw[13],l=raw[14],p=raw[15],x=vector.x,y=vector.y,z=vector.z;return result.x=a*x+b*y+c*z+d,result.y=e*x+f*y+g*z+h,result.z=i*x+j*y+k*z+l,result.w=m*x+n*y+o*z+p,result},Matrix3DUtils.deltaTransformVector=function(matrix,vector,result){"undefined"==typeof result&&(result=null),result||(result=new geom.Vector3D);var raw=Matrix3DUtils.RAW_DATA_CONTAINER;matrix.copyRawDataTo(raw);var a=raw[0],e=raw[1],i=raw[2],m=raw[3],b=raw[4],f=raw[5],j=raw[6],n=raw[7],c=raw[8],g=raw[9],k=raw[10],o=raw[11],x=vector.x,y=vector.y,z=vector.z;return result.x=a*x+b*y+c*z,result.y=e*x+f*y+g*z,result.z=i*x+j*y+k*z,result.w=m*x+n*y+o*z,result},Matrix3DUtils.getTranslation=function(transform,result){return"undefined"==typeof result&&(result=null),result||(result=new geom.Vector3D),transform.copyColumnTo(3,result),result},Matrix3DUtils.deltaTransformVectors=function(matrix,vin,vout){var raw=Matrix3DUtils.RAW_DATA_CONTAINER;matrix.copyRawDataTo(raw);for(var a=raw[0],e=raw[1],i=raw[2],b=(raw[3],raw[4]),f=raw[5],j=raw[6],c=(raw[7],raw[8]),g=raw[9],k=raw[10],outIndex=(raw[11],0),length=vin.length,index=0;length>index;index+=3){var x=vin[index],y=vin[index+1],z=vin[index+2];vout[outIndex++]=a*x+b*y+c*z,vout[outIndex++]=e*x+f*y+g*z,vout[outIndex++]=i*x+j*y+k*z}},Matrix3DUtils.RAW_DATA_CONTAINER=new Array(16),Matrix3DUtils.CALCULATION_MATRIX=new geom.Matrix3D,Matrix3DUtils}();geom.Matrix3DUtils=Matrix3DUtils}(away.geom||(away.geom={}));away.geom}(away||(away={}));var away;!function(away){!function(geom){var Orientation3D=function(){function Orientation3D(){}return Orientation3D.AXIS_ANGLE="axisAngle",Orientation3D.EULER_ANGLES="eulerAngles",Orientation3D.QUATERNION="quaternion",Orientation3D}();geom.Orientation3D=Orientation3D}(away.geom||(away.geom={}));away.geom}(away||(away={}));var away;!function(away){!function(geom){var PerspectiveProjection=function(){function PerspectiveProjection(){}return PerspectiveProjection.prototype.toMatrix3D=function(){return this._matrix3D},PerspectiveProjection}();geom.PerspectiveProjection=PerspectiveProjection}(away.geom||(away.geom={}));away.geom}(away||(away={}));var away;!function(away){!function(geom){var Plane3D=function(){function Plane3D(a,b,c,d){"undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),"undefined"==typeof d&&(d=0),this.a=a,this.b=b,this.c=c,this.d=d,this._iAlignment=0==a&&0==b?Plane3D.ALIGN_XY_AXIS:0==b&&0==c?Plane3D.ALIGN_YZ_AXIS:0==a&&0==c?Plane3D.ALIGN_XZ_AXIS:Plane3D.ALIGN_ANY}return Plane3D.prototype.fromPoints=function(p0,p1,p2){var d1x=p1.x-p0.x,d1y=p1.y-p0.y,d1z=p1.z-p0.z,d2x=p2.x-p0.x,d2y=p2.y-p0.y,d2z=p2.z-p0.z;this.a=d1y*d2z-d1z*d2y,this.b=d1z*d2x-d1x*d2z,this.c=d1x*d2y-d1y*d2x,this.d=this.a*p0.x+this.b*p0.y+this.c*p0.z,this._iAlignment=0==this.a&&0==this.b?Plane3D.ALIGN_XY_AXIS:0==this.b&&0==this.c?Plane3D.ALIGN_YZ_AXIS:0==this.a&&0==this.c?Plane3D.ALIGN_XZ_AXIS:Plane3D.ALIGN_ANY},Plane3D.prototype.fromNormalAndPoint=function(normal,point){this.a=normal.x,this.b=normal.y,this.c=normal.z,this.d=this.a*point.x+this.b*point.y+this.c*point.z,this._iAlignment=0==this.a&&0==this.b?Plane3D.ALIGN_XY_AXIS:0==this.b&&0==this.c?Plane3D.ALIGN_YZ_AXIS:0==this.a&&0==this.c?Plane3D.ALIGN_XZ_AXIS:Plane3D.ALIGN_ANY},Plane3D.prototype.normalize=function(){var len=1/Math.sqrt(this.a*this.a+this.b*this.b+this.c*this.c);return this.a*=len,this.b*=len,this.c*=len,this.d*=len,this},Plane3D.prototype.distance=function(p){return this._iAlignment==Plane3D.ALIGN_YZ_AXIS?this.a*p.x-this.d:this._iAlignment==Plane3D.ALIGN_XZ_AXIS?this.b*p.y-this.d:this._iAlignment==Plane3D.ALIGN_XY_AXIS?this.c*p.z-this.d:this.a*p.x+this.b*p.y+this.c*p.z-this.d},Plane3D.prototype.classifyPoint=function(p,epsilon){if("undefined"==typeof epsilon&&(epsilon=.01),this.d!=this.d)return away.geom.PlaneClassification.FRONT;var len;return len=this._iAlignment==Plane3D.ALIGN_YZ_AXIS?this.a*p.x-this.d:this._iAlignment==Plane3D.ALIGN_XZ_AXIS?this.b*p.y-this.d:this._iAlignment==Plane3D.ALIGN_XY_AXIS?this.c*p.z-this.d:this.a*p.x+this.b*p.y+this.c*p.z-this.d,-epsilon>len?away.geom.PlaneClassification.BACK:len>epsilon?away.geom.PlaneClassification.FRONT:away.geom.PlaneClassification.INTERSECT},Plane3D.prototype.toString=function(){return"Plane3D [a:"+this.a+", b:"+this.b+", c:"+this.c+", d:"+this.d+"]"},Plane3D.ALIGN_ANY=0,Plane3D.ALIGN_XY_AXIS=1,Plane3D.ALIGN_YZ_AXIS=2,Plane3D.ALIGN_XZ_AXIS=3,Plane3D}();geom.Plane3D=Plane3D}(away.geom||(away.geom={}));away.geom}(away||(away={}));var away;!function(away){!function(geom){var PlaneClassification=function(){function PlaneClassification(){}return PlaneClassification.BACK=0,PlaneClassification.FRONT=1,PlaneClassification.IN=0,PlaneClassification.OUT=1,PlaneClassification.INTERSECT=2,PlaneClassification}();geom.PlaneClassification=PlaneClassification}(away.geom||(away.geom={}));away.geom}(away||(away={}));var away;!function(away){!function(geom){var Point=function(){function Point(x,y){"undefined"==typeof x&&(x=0),"undefined"==typeof y&&(y=0),this.x=x,this.y=y}return Object.defineProperty(Point.prototype,"length",{get:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},enumerable:!0,configurable:!0}),Point.prototype.add=function(v){return new Point(this.x+v.x,this.y+v.y)},Point.prototype.clone=function(){return new Point(this.x,this.y)},Point.prototype.copyFrom=function(){},Point.prototype.equals=function(toCompare){return this.x==toCompare.x&&this.y==toCompare.y},Point.prototype.normalize=function(thickness){if("undefined"==typeof thickness&&(thickness=1),0!=this.length){var invLength=thickness/this.length;return this.x*=invLength,this.y*=invLength,void 0}throw"Cannot divide by zero length."},Point.prototype.offset=function(dx,dy){this.x+=dx,this.y+=dy},Point.prototype.setTo=function(){},Point.prototype.subtract=function(v){return new Point(this.x-v.x,this.y-v.y)},Point.prototype.toString=function(){return"[Point] (x="+this.x+", y="+this.y+")"},Point.distance=function(pt1,pt2){var dx=pt2.x-pt1.x,dy=pt2.y-pt1.y;return Math.sqrt(dx*dx+dy*dy)},Point.interpolate=function(pt1,pt2,f){return new Point(pt2.x+(pt1.x-pt2.x)*f,pt2.y+(pt1.y-pt2.y)*f)},Point.polar=function(len,angle){return new Point(len*Math.cos(angle),len*Math.sin(angle))},Point}();geom.Point=Point}(away.geom||(away.geom={}));away.geom}(away||(away={}));var away;!function(away){!function(geom){var PoissonLookup=function(){function PoissonLookup(){}return PoissonLookup.initDistributions=function(){this._distributions=new Array,this._distributions[0]=new Array(.3082841,.4320919),this._distributions[1]=new Array(.3082841,.4320919,-.2274942,-.6640266),this._distributions[2]=new Array(.8742689,.0009265686,-.6864116,-.5536607,-.2325206,.7678371),this._distributions[3]=new Array(.3913446,-.7084417,-.7511101,-.5935929,-.2323436,.5320091,.8435315,.5035911),this._distributions[4]=new Array(.2122471,-.5771395,-.8543506,-.1763534,.5189021,.8323698,-.3616908,.5865368,.9523004,-.04948437),this._distributions[5]=new Array(.5791035,.3496495,.2959551,-.6006749,-.2419119,-.06879545,-.7403072,.6110353,-.04555973,.8059174,-.5275017,-.737129),this._distributions[6]=new Array(.06941478,.8519508,-.7441907,.2426432,.6439992,-.2405252,-.1007523,-.2327587,-.6427067,-.7248485,.8050759,.5492936,.3573822,-.8824506),this._distributions[7]=new Array(.8509863,.4452587,-.09507271,.2073005,.1706571,-.6434793,.8029777,-.2718274,-.4401725,.8196304,.2715359,.8598521,-.8121575,-.006447683,-.6486837,-.7237598),this._distributions[8]=new Array(.6951686,-.2680728,-.04933243,.3710589,.6592212,.3661054,-.01579228,-.6909603,-.3275101,-.1756866,.3811549,.9218544,-.216032,.9755028,-.7065172,.3355389,-.6579109,-.6798355),this._distributions[9]=new Array(.6181276,-.09790418,-.2537868,-.5570995,-.1964931,.3459414,.3474613,-.8885581,.5135743,.5753114,-.9549091,.1480672,-.8711916,-.4293123,-.6928071,.6190156,-.13369,.8892705,.0548224,-.1246777),this._distributions[10]=new Array(.4853027,-.5080479,-.1331675,-.506597,.139575,.01316885,.803486,-.07568797,.5240274,.4883182,-.4334005,.1207938,-.7794577,-.3985141,.1576432,-.9861221,-.3712867,.6959021,.1517378,.9847429,-.9762396,.1661073),this._distributions[11]=new Array(-.2790166,-.01252619,.3389016,.3921154,.2408341,-.313211,-.8151779,-.3898362,-.6347761,.3486495,.09471484,-.7722448,-.1385674,.6364574,.2456331,.9295807,-.3864306,-.8247881,.6111673,-.7164014,.8287669,.05466961,.837706,.5415626),this._distributions[12]=new Array(.056417,.3185693,-.8245888,.1882799,.8575996,.1136829,.1070375,.875332,.4076743,-.06000621,-.4311306,.7239349,.2677574,-.538472,-.08486642,-.2083647,-.888989,-.3906443,-.4768958,-.6664082,.09334993,-.9861541,.808736,-.455949,.5889823,.7660807),this._distributions[13]=new Array(-.2681346,-.3955857,-.1315102,-.8852947,-.5143692,.09551838,.4344836,-.546945,-.8620899,-.3813288,.1650431,.02034803,-.1543657,.3842218,-.828457,.5376903,-.6145,-.7818927,-.2639062,.8784655,.1912684,.9720125,.3135219,.5224229,.7850655,.4592297,.7465045,-.1368916),this._distributions[14]=new Array(.4241029,.695281,.150511,-.02304107,-.2482675,.9120338,.8057325,.2622084,-.2445909,.2765962,.8588713,-.1772072,.3117845,-.4385471,-.3923851,-.3298936,-.1751254,-.7405846,.6926506,-.684163,-.9304563,-.3254691,-.8533293,.1523024,.2510415,-.917345,-.6239773,-.7105472,-.6104624,.6041355),this._distributions[15]=new Array(.5844554,.06651045,.1343258,.6756578,.3799674,-.6301104,.5590436,.7940555,.09574714,.02262517,.8697868,.393301,.003945862,-.421735,.9043913,-.2432393,-.4844007,.7190998,-.3201078,.2972371,-.3852352,-.6341155,-.5413069,-.09223081,-.8468984,-.5126905,.004156174,-.8633173,-.9681889,-.03305046,-.846509,.4414353),this._distributions[16]=new Array(.4506488,.657668,.4621297,.07441051,-.2782125,.6201044,.9750003,.09110117,.1019436,.2986514,.03457398,.9631706,.542098,-.5505635,.8675668,.4938077,-.5414361,.2655292,-.7941836,.6003053,-.09847672,-.1001604,-.9316511,-.08572888,.07286467,-.611899,-.5232627,-.4082253,-.5481608,-.827938,-.1551939,-.9621193,.9220031,-.3315949),this._distributions[17]=new Array(.197908,-.4697656,-.4474689,-.3428435,.8529873,-.2228634,.6022478,-.5469642,.2545276,-.931133,-.1507547,-.7855865,-.07606658,.1011628,.3046715,.2785755,.4698432,-.1064076,.6831254,.4152522,.1374381,.8363233,-.2166121,.6682042,.5511393,.7996449,-.4278994,.28836,-.8875198,.2181732,-.8772842,-.2818254,-.7000262,.5762185,-.6062385,-.7439126),this._distributions[18]=new Array(.6645703,-.05678739,.5720971,.4533803,-.07660709,.08802763,.5163431,-.4426552,.1163455,-.3404382,-.4004807,-.5046007,.2932099,-.8201418,-.5322125,.03834766,-.1490209,-.8817304,-.8000439,-.3509448,.5260983,.8421043,.1197811,.6963812,.9498612,.3122156,-.9285746,.02120355,-.6670724,.7217396,.9155889,-.3510147,-.271941,.4727852,.318879,.1634057,-.2686755,.9253026),this._distributions[19]=new Array(.5064292,.422527,.8935515,-.06610427,.1199719,.175568,.403388,-.2003276,.1657927,.8154403,.9301245,.2929218,-.1644068,.6201534,.7113559,-.6589743,-.3364046,-.1799502,.02109996,-.392765,-.382213,.3219992,-.9201946,.1207967,-.726185,.4291916,-.7443482,-.2480059,-.5147594,.7418784,.1935272,-.7406143,-.3643523,-.5559214,-.7147766,-.6326278,-.2524151,-.9096627,.5161405,.7908453),this._distributions[20]=new Array(.7921003,-.3032096,.5992879,-.009052323,.2538549,-.1872749,.7053444,.3677175,.5417761,-.8170255,.9749611,.1210478,.1969143,-.6117041,-.1824499,-.4634196,-.1181338,-.8668742,-.3050112,-.1352596,-.4409327,-.7082354,-.03225285,.1171548,.3113096,.3250439,-.8166144,-.463995,-.01014475,.4715334,-.6868284,.05091889,-.4011163,.2717285,-.06756835,.8307694,-.7938535,.4352129,-.4663842,.7165329,.559729,.8093995),this._distributions[21]=new Array(.07832243,.426151,-.3856795,.5799953,.01970797,.06706189,.4822682,.3014512,-.1532982,.87485,-.4959527,.07888043,.260601,-.2304784,.4996209,.7167382,.585986,-.04265174,-.7679967,.5509416,-.9041753,.1802134,-.8407655,-.4442826,-.2058258,-.2636995,-.4984115,-.5928579,.2926032,-.7886473,-.06933882,-.621177,.578115,-.4813387,.8981777,-.3291056,.1942733,.9255584,.8084362,.5066984,.9920095,.03103104,-.2403206,-.9389018),this._distributions[22]=new Array(-.5691095,.1014316,-.7788262,.384012,-.8253665,-.1645582,-.1830993,.002997211,-.2555013,-.4177977,-.6640869,-.4794711,-.2351242,.5850121,.02436554,.2825883,.006061143,-.8200245,.1618791,-.3063331,-.3765897,-.7249815,.6092919,-.6769328,-.5956934,.6957655,.5383642,.4522677,-.1489165,.9125596,.4167473,.1335986,.1898309,.5874342,.2288171,.9624356,.7540846,-.07672304,.8986252,.2788797,.3555991,-.9262139,.8454325,-.4027667,.4945236,-.2935512),this._distributions[23]=new Array(-.4481403,-.3758374,-.8877251,.08739938,.05015831,-.1339983,-.4070427,-.8534173,.1019274,-.5503222,-.445998,.1997541,-.8686263,-.2788867,-.7695944,-.6033704,-.05515742,-.885711,-.7714347,.5790485,.3466263,-.8799297,.4487582,-.5321087,-.2461368,.6053771,-.05568117,.2457351,-.4668669,.8523816,.8103387,-.4255538,.4054182,-.175663,-.2802011,-.08920153,.2665959,.382935,.555679,.1621837,.105246,.8420411,.6921161,.6902903,.880946,.2483067,.9699264,-.1021767),this._distributions[24]=new Array(-.1703323,-.3119385,.2916039,-.2988263,-.008472982,-.9277695,-.7730271,-.3277904,.3440474,-.6815342,-.2910278,.03461745,-.6764899,-.657078,-.3505501,-.7311988,-.03478927,.3258755,-.6048835,.159423,.2035525,.02212214,.5116573,.2226856,.6664805,-.2500189,.7147882,-.6609634,.03030632,-.5763278,-.2516585,.6116219,-.9434413,-.0116792,.9061816,.2491155,.182867,.6076167,.286593,.9485695,-.5992439,.6970096,-.2082874,.9416641,.9880044,-.1541709,-.9122881,.331555,.7324886,.6725098),this._distributions[25]=new Array(.3869598,-.04974834,.7168844,-.0693711,-.07166742,.1725325,.4599592,.3232779,.5872094,-.4198674,.2442266,-.625667,.1254557,.4500048,-.2290154,-.1803567,.890583,.3373493,.1256081,.7853789,-.2676466,.5305805,-.7063224,.252168,-.3989835,.1189921,.09617215,-.2451447,.6302541,.6085876,.9380925,-.3234899,.5086241,-.8573482,.03576187,-.9876697,-.0876712,-.6365195,-.5276513,.823456,-.6935764,-.2240411,-.5212318,-.5383121,-.2116208,.9639363,-.9840096,.02743555,-.3991577,-.8994547,-.7830126,.614068),this._distributions[26]=new Array(-.8366601,.4464895,-.5917366,-.02073906,-.9845258,.1635625,-.3097973,.4379579,-.5478154,.7173221,-.1685888,.9261969,.01503595,.6046097,.4452421,.5449086,.0315687,.1944619,.3753404,.8688548,.4143643,.1396648,.8711032,.4304703,.7328773,.1461501,.6374492,-.3521495,.145613,-.1341466,.9040975,-.135123,-.7839059,-.5450199,-.516019,-.3320859,-.206158,-.4431106,-.9703014,-.2368356,-.2473119,-.0864351,.2130725,-.4604077,-.003726701,-.7122303,-.4072131,-.6833169,.1632999,-.9776646,.4686888,-.680495,-.2293511,-.9509777),this._distributions[27]=new Array(.107311,-.1311369,-.4194764,-.3148777,.6171439,-.2745973,.2796618,.1937153,-.09106886,.4180236,.6044006,.05577846,.02927299,-.6738263,-.2580845,.1179939,-.09023564,-.3830024,.3570953,-.5000587,.81591,-.5518309,.9300217,-.1257987,.4904627,-.8381903,-.3163182,-.8632009,.1137595,-.9875998,.8390043,.3538185,.2149114,.4993694,.5191584,.3833552,.5002763,.7061465,-.2567276,.9068756,-.5197366,.3467845,.03668867,.9734009,-.5347553,.66747,-.9028882,.1023768,-.8967977,.412834,-.5821944,.0426479,-.8032165,-.2397038,-.5597343,-.6358021),this._distributions[28]=new Array(-.6562496,-.1781036,-.9301494,.1185208,-.3861143,-.4153562,-.1560799,-.1099607,-.5587025,.395218,-.5322112,-.699701,-.5008639,.08726846,-.970524,-.1963461,-.813577,-.5185111,-.1644458,.298,-.3216791,.639982,.3315373,.3339162,.2383235,-.00105722,.1137828,.5450742,-.01899921,.8798413,.2849685,.8255596,.6974412,.2123175,.7588523,.5470437,.5102502,-.1687844,.5853448,.8033476,.2590716,-.5262504,.5607718,-.6342825,.8666443,-.1491841,.8341052,-.4935003,-.1568441,-.6634066,.2512113,-.8769391,-.2559827,-.9572457,-.01928852,-.3966542,-.750667,.6409678),this._distributions[29]=new Array(.3454786,-.04837726,.2649553,.2406852,.5599093,-.3839145,-.1111814,-.05502108,.7586042,-.05818377,.2519488,-.4665135,-.1264972,.2602723,-.08766216,-.3671907,.6428129,.3999204,-.6105871,-.1246869,-.4589451,-.7646643,-.03021116,-.7899352,-.6036922,-.4293956,-.2481938,.6534185,.102798,.6784465,-.6392644,.4821358,-.6789002,.1779133,-.9140783,-.1989647,-.9262617,.3381507,.4794891,-.8093274,.3959447,.668478,.9602883,.2272305,-.123672,.9210883,.2375148,.9523395,-.52898,.7973378,-.382433,.1228794,.695015,.6948439,.7530277,-.6458191,.8777987,-.3272956,.2318525,-.962768),this._distributions[30]=new Array(.4518921,-.1146195,.4720805,-.4238748,.3655423,.1806341,.1589939,-.23568,.7673324,-.5149941,.01163658,.09045836,.7010971,.1245747,.7518286,-.1855433,.4960719,.4601022,.2566979,-.6308268,-.0654714,-.5126389,-.1823319,-.1343282,-.1464312,.4883236,-.3858738,.203523,.1484799,.4432284,-.477109,-.116241,.2719092,.7208626,.9104174,.3578536,-.5956199,.7662588,-.6996251,.3678654,-.2514512,.9251933,.1275825,-.9478135,-.204608,-.8611552,.4264838,-.877443,.9854161,.05521112,.5912951,.7997434,.1140349,.982093,-.9324368,-.2094094,-.42436,-.6441524,-.6722705,-.3554261,-.7844236,.08587621),this._distributions[31]=new Array(-.4206714,-.5613642,-.8733016,-.3373051,-.1046226,-.2902999,-.1318562,-.8434365,.1145093,-.5962623,-.4965627,-.1873259,-.5011808,-.8546229,-.7165636,-.5743566,.1090901,.2017643,.3404809,-.220455,-.1989015,.2372122,-.4538706,.0979171,.4514146,-.572846,.2314168,-.8514503,-.4247236,.5650803,-.943347,.04514639,-.1309718,.5221877,-.7004157,.4561877,.6306441,.04448673,.4301621,.5766876,.1078042,.7245752,.3875354,.2794483,.702876,-.2924213,.7360667,-.6210318,.7486517,.6531103,.4898235,.8591025,.6549174,.3854057,-.2596106,.7916998,.9251194,-.05296265,-.5620695,.820877,-.01228026,.9937211,.9612103,.2628758)},PoissonLookup.getDistribution=function(n){return this._distributions||this.initDistributions(),2>n||n>32?null:this._distributions[n-1]},PoissonLookup}();geom.PoissonLookup=PoissonLookup}(away.geom||(away.geom={}));away.geom}(away||(away={}));var away;!function(away){!function(geom){var Quaternion=function(){function Quaternion(x,y,z,w){"undefined"==typeof x&&(x=0),"undefined"==typeof y&&(y=0),"undefined"==typeof z&&(z=0),"undefined"==typeof w&&(w=1),this.x=0,this.y=0,this.z=0,this.w=1,this.x=x,this.y=y,this.z=z,this.w=w}return Object.defineProperty(Quaternion.prototype,"magnitude",{get:function(){return Math.sqrt(this.w*this.w+this.x*this.x+this.y*this.y+this.z*this.z)},enumerable:!0,configurable:!0}),Quaternion.prototype.multiply=function(qa,qb){var w1=qa.w,x1=qa.x,y1=qa.y,z1=qa.z,w2=qb.w,x2=qb.x,y2=qb.y,z2=qb.z;this.w=w1*w2-x1*x2-y1*y2-z1*z2,this.x=w1*x2+x1*w2+y1*z2-z1*y2,this.y=w1*y2-x1*z2+y1*w2+z1*x2,this.z=w1*z2+x1*y2-y1*x2+z1*w2},Quaternion.prototype.multiplyVector=function(vector,target){"undefined"==typeof target&&(target=null),null===target&&(target=new Quaternion);var x2=vector.x,y2=vector.y,z2=vector.z;return target.w=-this.x*x2-this.y*y2-this.z*z2,target.x=this.w*x2+this.y*z2-this.z*y2,target.y=this.w*y2-this.x*z2+this.z*x2,target.z=this.w*z2+this.x*y2-this.y*x2,target},Quaternion.prototype.fromAxisAngle=function(axis,angle){var sin_a=Math.sin(angle/2),cos_a=Math.cos(angle/2);this.x=axis.x*sin_a,this.y=axis.y*sin_a,this.z=axis.z*sin_a,this.w=cos_a,this.normalize()},Quaternion.prototype.slerp=function(qa,qb,t){var w1=qa.w,x1=qa.x,y1=qa.y,z1=qa.z,w2=qb.w,x2=qb.x,y2=qb.y,z2=qb.z,dot=w1*w2+x1*x2+y1*y2+z1*z2;if(0>dot&&(dot=-dot,w2=-w2,x2=-x2,y2=-y2,z2=-z2),.95>dot){var angle=Math.acos(dot),s=1/Math.sin(angle),s1=Math.sin(angle*(1-t))*s,s2=Math.sin(angle*t)*s;this.w=w1*s1+w2*s2,this.x=x1*s1+x2*s2,this.y=y1*s1+y2*s2,this.z=z1*s1+z2*s2}else{this.w=w1+t*(w2-w1),this.x=x1+t*(x2-x1),this.y=y1+t*(y2-y1),this.z=z1+t*(z2-z1);var len=1/Math.sqrt(this.w*this.w+this.x*this.x+this.y*this.y+this.z*this.z);this.w*=len,this.x*=len,this.y*=len,this.z*=len}},Quaternion.prototype.lerp=function(qa,qb,t){var len,w1=qa.w,x1=qa.x,y1=qa.y,z1=qa.z,w2=qb.w,x2=qb.x,y2=qb.y,z2=qb.z;0>w1*w2+x1*x2+y1*y2+z1*z2&&(w2=-w2,x2=-x2,y2=-y2,z2=-z2),this.w=w1+t*(w2-w1),this.x=x1+t*(x2-x1),this.y=y1+t*(y2-y1),this.z=z1+t*(z2-z1),len=1/Math.sqrt(this.w*this.w+this.x*this.x+this.y*this.y+this.z*this.z),this.w*=len,this.x*=len,this.y*=len,this.z*=len},Quaternion.prototype.fromEulerAngles=function(ax,ay,az){var halfX=.5*ax,halfY=.5*ay,halfZ=.5*az,cosX=Math.cos(halfX),sinX=Math.sin(halfX),cosY=Math.cos(halfY),sinY=Math.sin(halfY),cosZ=Math.cos(halfZ),sinZ=Math.sin(halfZ);this.w=cosX*cosY*cosZ+sinX*sinY*sinZ,this.x=sinX*cosY*cosZ-cosX*sinY*sinZ,this.y=cosX*sinY*cosZ+sinX*cosY*sinZ,this.z=cosX*cosY*sinZ-sinX*sinY*cosZ},Quaternion.prototype.toEulerAngles=function(target){return"undefined"==typeof target&&(target=null),null===target&&(target=new away.geom.Vector3D),target.x=Math.atan2(2*(this.w*this.x+this.y*this.z),1-2*(this.x*this.x+this.y*this.y)),target.y=Math.asin(2*(this.w*this.y-this.z*this.x)),target.z=Math.atan2(2*(this.w*this.z+this.x*this.y),1-2*(this.y*this.y+this.z*this.z)),target},Quaternion.prototype.normalize=function(val){"undefined"==typeof val&&(val=1);var mag=val/Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);this.x*=mag,this.y*=mag,this.z*=mag,this.w*=mag},Quaternion.prototype.toString=function(){return"{x:"+this.x+" y:"+this.y+" z:"+this.z+" w:"+this.w+"}"},Quaternion.prototype.toMatrix3D=function(target){"undefined"==typeof target&&(target=null);var rawData=away.geom.Matrix3DUtils.RAW_DATA_CONTAINER,xy2=2*this.x*this.y,xz2=2*this.x*this.z,xw2=2*this.x*this.w,yz2=2*this.y*this.z,yw2=2*this.y*this.w,zw2=2*this.z*this.w,xx=this.x*this.x,yy=this.y*this.y,zz=this.z*this.z,ww=this.w*this.w;return rawData[0]=xx-yy-zz+ww,rawData[4]=xy2-zw2,rawData[8]=xz2+yw2,rawData[12]=0,rawData[1]=xy2+zw2,rawData[5]=-xx+yy-zz+ww,rawData[9]=yz2-xw2,rawData[13]=0,rawData[2]=xz2-yw2,rawData[6]=yz2+xw2,rawData[10]=-xx-yy+zz+ww,rawData[14]=0,rawData[3]=0,rawData[7]=0,rawData[11]=0,rawData[15]=1,target?(target.copyRawDataFrom(rawData),target):new away.geom.Matrix3D(rawData)},Quaternion.prototype.fromMatrix=function(matrix){var v=matrix.decompose(away.geom.Orientation3D.QUATERNION)[1];this.x=v.x,this.y=v.y,this.z=v.z,this.w=v.w},Quaternion.prototype.toRawData=function(target,exclude4thRow){"undefined"==typeof exclude4thRow&&(exclude4thRow=!1);var xy2=2*this.x*this.y,xz2=2*this.x*this.z,xw2=2*this.x*this.w,yz2=2*this.y*this.z,yw2=2*this.y*this.w,zw2=2*this.z*this.w,xx=this.x*this.x,yy=this.y*this.y,zz=this.z*this.z,ww=this.w*this.w;target[0]=xx-yy-zz+ww,target[1]=xy2-zw2,target[2]=xz2+yw2,target[4]=xy2+zw2,target[5]=-xx+yy-zz+ww,target[6]=yz2-xw2,target[8]=xz2-yw2,target[9]=yz2+xw2,target[10]=-xx-yy+zz+ww,target[3]=target[7]=target[11]=0,exclude4thRow||(target[12]=target[13]=target[14]=0,target[15]=1)},Quaternion.prototype.clone=function(){return new Quaternion(this.x,this.y,this.z,this.w)},Quaternion.prototype.rotatePoint=function(vector,target){"undefined"==typeof target&&(target=null);var x1,y1,z1,w1,x2=vector.x,y2=vector.y,z2=vector.z;return null===target&&(target=new away.geom.Vector3D),w1=-this.x*x2-this.y*y2-this.z*z2,x1=this.w*x2+this.y*z2-this.z*y2,y1=this.w*y2-this.x*z2+this.z*x2,z1=this.w*z2+this.x*y2-this.y*x2,target.x=-w1*this.x+x1*this.w-y1*this.z+z1*this.y,target.y=-w1*this.y+x1*this.z+y1*this.w-z1*this.x,target.z=-w1*this.z-x1*this.y+y1*this.x+z1*this.w,target -},Quaternion.prototype.copyFrom=function(q){this.x=q.x,this.y=q.y,this.z=q.z,this.w=q.w},Quaternion}();geom.Quaternion=Quaternion}(away.geom||(away.geom={}));away.geom}(away||(away={}));var away;!function(away){!function(geom){var Rectangle=function(){function Rectangle(x,y,width,height){"undefined"==typeof x&&(x=0),"undefined"==typeof y&&(y=0),"undefined"==typeof width&&(width=0),"undefined"==typeof height&&(height=0),this.x=x,this.y=y,this.width=width,this.height=height}return Object.defineProperty(Rectangle.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!0,configurable:!0}),Object.defineProperty(Rectangle.prototype,"bottomRight",{get:function(){return null==this._bottomRight&&(this._bottomRight=new geom.Point),this._bottomRight.x=this.x+this.width,this._bottomRight.y=this.y+this.height,this._bottomRight},enumerable:!0,configurable:!0}),Object.defineProperty(Rectangle.prototype,"left",{get:function(){return this.x},enumerable:!0,configurable:!0}),Object.defineProperty(Rectangle.prototype,"right",{get:function(){return this.x+this.width},enumerable:!0,configurable:!0}),Object.defineProperty(Rectangle.prototype,"size",{get:function(){return null==this._size&&(this._size=new geom.Point),this._size.x=this.width,this._size.y=this.height,this._size},enumerable:!0,configurable:!0}),Object.defineProperty(Rectangle.prototype,"top",{get:function(){return this.y},enumerable:!0,configurable:!0}),Object.defineProperty(Rectangle.prototype,"topLeft",{get:function(){return null==this._topLeft&&(this._topLeft=new geom.Point),this._topLeft.x=this.x,this._topLeft.y=this.y,this._topLeft},enumerable:!0,configurable:!0}),Rectangle.prototype.clone=function(){return new Rectangle(this.x,this.y,this.width,this.height)},Rectangle.prototype.contains=function(x,y){return this.x<=x&&this.x+this.width>=x&&this.y<=y&&this.y+this.height>=y},Rectangle.prototype.containsPoint=function(point){return this.x<=point.x&&this.x+this.width>=point.x&&this.y<=point.y&&this.y+this.height>=point.y},Rectangle.prototype.containsRect=function(rect){return this.x<=rect.x&&this.x+this.width>=rect.x+rect.width&&this.y<=rect.y&&this.y+this.height>=rect.y+rect.height},Rectangle.prototype.copyFrom=function(){},Rectangle.prototype.equals=function(toCompare){return this.x==toCompare.x&&this.y==toCompare.y&&this.width==toCompare.width&&this.height==toCompare.height},Rectangle.prototype.inflate=function(dx,dy){this.x-=dx/2,this.y-=dy/2,this.width+=dx/2,this.height+=dy/2},Rectangle.prototype.inflatePoint=function(point){this.x-=point.x/2,this.y-=point.y/2,this.width+=point.x/2,this.height+=point.y/2},Rectangle.prototype.intersection=function(toIntersect){if(this.intersects(toIntersect)){var i=new Rectangle;return this.x>toIntersect.x?(i.x=this.x,i.width=toIntersect.x-this.x+toIntersect.width,i.width>this.width&&(i.width=this.width)):(i.x=toIntersect.x,i.width=this.x-toIntersect.x+this.width,i.width>toIntersect.width&&(i.width=toIntersect.width)),this.y>toIntersect.y?(i.y=this.y,i.height=toIntersect.y-this.y+toIntersect.height,i.height>this.height&&(i.height=this.height)):(i.y=toIntersect.y,i.height=this.y-toIntersect.y+this.height,i.height>toIntersect.height&&(i.height=toIntersect.height)),i}return new Rectangle},Rectangle.prototype.intersects=function(toIntersect){return this.x+this.width>toIntersect.x&&this.xtoIntersect.y&&this.yi;)v=vertices[i++],minX>v?minX=v:v>maxX&&(maxX=v),v=vertices[i++],minY>v?minY=v:v>maxY&&(maxY=v),v=vertices[i++],minZ>v?minZ=v:v>maxZ&&(maxZ=v);this.fromExtremes(minX,minY,minZ,maxX,maxY,maxZ)},BoundingVolumeBase.prototype.fromGeometry=function(geometry){var i,j,p,subGeom,boundingPositions,minX,minY,minZ,maxX,maxY,maxZ,subGeoms=geometry.subGeometries,numSubGeoms=subGeoms.length;if(numSubGeoms>0){for(i=0,subGeom=subGeoms[0],boundingPositions=subGeom.getBoundingPositions(),minX=maxX=boundingPositions[i],minY=maxY=boundingPositions[i+1],minZ=maxZ=boundingPositions[i+2],j=numSubGeoms;j--;)for(subGeom=subGeoms[j],boundingPositions=subGeom.getBoundingPositions(),i=boundingPositions.length;i--;)p=boundingPositions[i],minX>p?minX=p:p>maxX&&(maxX=p),p=boundingPositions[i+1],minY>p?minY=p:p>maxY&&(maxY=p),p=boundingPositions[i+2],minZ>p?minZ=p:p>maxZ&&(maxZ=p);this.fromExtremes(minX,minY,minZ,maxX,maxY,maxZ)}else this.fromExtremes(0,0,0,0,0,0)},BoundingVolumeBase.prototype.fromSphere=function(center,radius){this.fromExtremes(center.x-radius,center.y-radius,center.z-radius,center.x+radius,center.y+radius,center.z+radius)},BoundingVolumeBase.prototype.fromExtremes=function(minX,minY,minZ,maxX,maxY,maxZ){this._aabb.x=minX,this._aabb.y=maxY,this._aabb.z=minZ,this._aabb.width=maxX-minX,this._aabb.height=maxY-minY,this._aabb.depth=maxZ-minZ,this._pAabbPointsDirty=!0,this._pBoundingEntity&&this.pUpdateBoundingEntity()},BoundingVolumeBase.prototype.isInFrustum=function(){throw new away.errors.AbstractMethodError},BoundingVolumeBase.prototype.overlaps=function(bounds){return this._aabb.intersects(bounds.aabb)},BoundingVolumeBase.prototype.clone=function(){throw new away.errors.AbstractMethodError},BoundingVolumeBase.prototype.rayIntersection=function(){return-1},BoundingVolumeBase.prototype.containsPoint=function(){return!1},BoundingVolumeBase.prototype.pUpdateAABBPoints=function(){var minX=this._aabb.x,minY=this._aabb.y-this._aabb.height,minZ=this._aabb.z,maxX=this._aabb.x+this._aabb.width,maxY=this._aabb.y,maxZ=this._aabb.z+this._aabb.depth;this._pAabbPoints[0]=minX,this._pAabbPoints[1]=minY,this._pAabbPoints[2]=minZ,this._pAabbPoints[3]=maxX,this._pAabbPoints[4]=minY,this._pAabbPoints[5]=minZ,this._pAabbPoints[6]=minX,this._pAabbPoints[7]=maxY,this._pAabbPoints[8]=minZ,this._pAabbPoints[9]=maxX,this._pAabbPoints[10]=maxY,this._pAabbPoints[11]=minZ,this._pAabbPoints[12]=minX,this._pAabbPoints[13]=minY,this._pAabbPoints[14]=maxZ,this._pAabbPoints[15]=maxX,this._pAabbPoints[16]=minY,this._pAabbPoints[17]=maxZ,this._pAabbPoints[18]=minX,this._pAabbPoints[19]=maxY,this._pAabbPoints[20]=maxZ,this._pAabbPoints[21]=maxX,this._pAabbPoints[22]=maxY,this._pAabbPoints[23]=maxZ,this._pAabbPointsDirty=!1},BoundingVolumeBase.prototype.pUpdateBoundingEntity=function(){throw new away.errors.AbstractMethodError},BoundingVolumeBase.prototype.pCreateBoundingEntity=function(){throw new away.errors.AbstractMethodError},BoundingVolumeBase.prototype.classifyToPlane=function(){throw new away.errors.AbstractMethodError},BoundingVolumeBase.prototype.transformFrom=function(){throw new away.errors.AbstractMethodError},BoundingVolumeBase}();_bounds.BoundingVolumeBase=BoundingVolumeBase}(away.bounds||(away.bounds={}));away.bounds}(away||(away={}));var away;!function(away){!function(_bounds){var PlaneClassification=away.geom.PlaneClassification,NullBounds=function(_super){function NullBounds(alwaysIn){"undefined"==typeof alwaysIn&&(alwaysIn=!0),_super.call(this),this._alwaysIn=alwaysIn,this._aabb.width=this._aabb.height=this._aabb.depth=Number.POSITIVE_INFINITY,this._aabb.x=this._aabb.y=this._aabb.z=this._alwaysIn?Number.NEGATIVE_INFINITY/2:Number.POSITIVE_INFINITY}return __extends(NullBounds,_super),NullBounds.prototype.clone=function(){return new NullBounds(this._alwaysIn)},NullBounds.prototype.pCreateBoundingEntity=function(){return null},NullBounds.prototype.isInFrustum=function(){return this._alwaysIn},NullBounds.prototype.fromSphere=function(){},NullBounds.prototype.fromExtremes=function(){},NullBounds.prototype.classifyToPlane=function(){return PlaneClassification.INTERSECT},NullBounds.prototype.transformFrom=function(bounds){this._alwaysIn=bounds._alwaysIn},NullBounds}(_bounds.BoundingVolumeBase);_bounds.NullBounds=NullBounds}(away.bounds||(away.bounds={}));away.bounds}(away||(away={}));var away;!function(away){!function(_bounds){var PlaneClassification=away.geom.PlaneClassification,Vector3D=away.geom.Vector3D,BoundingSphere=function(_super){function BoundingSphere(){_super.call(this),this._radius=0,this._centerX=0,this._centerY=0,this._centerZ=0}return __extends(BoundingSphere,_super),Object.defineProperty(BoundingSphere.prototype,"radius",{get:function(){return this._radius},enumerable:!0,configurable:!0}),BoundingSphere.prototype.nullify=function(){_super.prototype.nullify.call(this),this._centerX=this._centerY=this._centerZ=0,this._radius=0},BoundingSphere.prototype.isInFrustum=function(planes,numPlanes){for(var i=0;numPlanes>i;++i){var plane=planes[i],flippedExtentX=plane.a<0?-this._radius:this._radius,flippedExtentY=plane.b<0?-this._radius:this._radius,flippedExtentZ=plane.c<0?-this._radius:this._radius,projDist=plane.a*(this._centerX+flippedExtentX)+plane.b*(this._centerY+flippedExtentY)+plane.c*(this._centerZ+flippedExtentZ)-plane.d;if(0>projDist)return!1}return!0},BoundingSphere.prototype.fromSphere=function(center,radius){this._centerX=center.x,this._centerY=center.y,this._centerZ=center.z,this._radius=radius,this._aabb.width=this._aabb.height=this._aabb.depth=2*radius,this._aabb.x=this._centerX-radius,this._aabb.y=this._centerY+radius,this._aabb.z=this._centerZ-radius,this._pAabbPointsDirty=!0,this._pBoundingEntity&&this.pUpdateBoundingEntity()},BoundingSphere.prototype.fromExtremes=function(minX,minY,minZ,maxX,maxY,maxZ){this._centerX=.5*(maxX+minX),this._centerY=.5*(maxY+minY),this._centerZ=.5*(maxZ+minZ);var d=maxX-minX,y=maxY-minY,z=maxZ-minZ;y>d&&(d=y),z>d&&(d=z),this._radius=d*Math.sqrt(.5),_super.prototype.fromExtremes.call(this,minX,minY,minZ,maxX,maxY,maxZ)},BoundingSphere.prototype.clone=function(){var clone=new BoundingSphere;return clone.fromSphere(new Vector3D(this._centerX,this._centerY,this._centerZ),this._radius),clone},BoundingSphere.prototype.rayIntersection=function(position,direction,targetNormal){if(this.containsPoint(position))return 0;var rayEntryDistance,px=position.x-this._centerX,py=position.y-this._centerY,pz=position.z-this._centerZ,vx=direction.x,vy=direction.y,vz=direction.z,a=vx*vx+vy*vy+vz*vz,b=2*(px*vx+py*vy+pz*vz),c=px*px+py*py+pz*pz-this._radius*this._radius,det=b*b-4*a*c;if(det>=0){var sqrtDet=Math.sqrt(det);if(rayEntryDistance=(-b-sqrtDet)/(2*a),rayEntryDistance>=0)return targetNormal.x=px+rayEntryDistance*vx,targetNormal.y=py+rayEntryDistance*vy,targetNormal.z=pz+rayEntryDistance*vz,targetNormal.normalize(),rayEntryDistance}return-1},BoundingSphere.prototype.containsPoint=function(position){var px=position.x-this._centerX,py=position.y-this._centerY,pz=position.z-this._centerZ,distance=Math.sqrt(px*px+py*py+pz*pz);return distance<=this._radius},BoundingSphere.prototype.pUpdateBoundingEntity=function(){var sc=this._radius;0==sc&&(sc=.001);var transform=this._pBoundingEntity.transform;transform.scale=new Vector3D(sc,sc,sc),transform.position=new Vector3D(this._centerX,this._centerY,this._centerZ)},BoundingSphere.prototype.pCreateBoundingEntity=function(){return null},BoundingSphere.prototype.classifyToPlane=function(plane){var a=plane.a,b=plane.b,c=plane.c,dd=a*this._centerX+b*this._centerY+c*this._centerZ-plane.d;0>a&&(a=-a),0>b&&(b=-b),0>c&&(c=-c);var rr=(a+b+c)*this._radius;return dd>rr?PlaneClassification.FRONT:-rr>dd?PlaneClassification.BACK:PlaneClassification.INTERSECT},BoundingSphere.prototype.transformFrom=function(bounds,matrix){var sphere=bounds,cx=sphere._centerX,cy=sphere._centerY,cz=sphere._centerZ,raw=new Array(16);matrix.copyRawDataTo(raw);var m11=raw[0],m12=raw[4],m13=raw[8],m14=raw[12],m21=raw[1],m22=raw[5],m23=raw[9],m24=raw[13],m31=raw[2],m32=raw[6],m33=raw[10],m34=raw[14];this._centerX=cx*m11+cy*m12+cz*m13+m14,this._centerY=cx*m21+cy*m22+cz*m23+m24,this._centerZ=cx*m31+cy*m32+cz*m33+m34,0>m11&&(m11=-m11),0>m12&&(m12=-m12),0>m13&&(m13=-m13),0>m21&&(m21=-m21),0>m22&&(m22=-m22),0>m23&&(m23=-m23),0>m31&&(m31=-m31),0>m32&&(m32=-m32),0>m33&&(m33=-m33);var r=sphere._radius,rx=m11+m12+m13,ry=m21+m22+m23,rz=m31+m32+m33;this._radius=r*Math.sqrt(rx*rx+ry*ry+rz*rz),this._aabb.width=this._aabb.height=this._aabb.depth=2*this._radius,this._aabb.x=this._centerX-this._radius,this._aabb.y=this._centerY+this._radius,this._aabb.z=this._centerZ-this._radius},BoundingSphere}(_bounds.BoundingVolumeBase);_bounds.BoundingSphere=BoundingSphere}(away.bounds||(away.bounds={}));away.bounds}(away||(away={}));var away;!function(away){!function(_bounds){var Matrix3DUtils=away.geom.Matrix3DUtils,PlaneClassification=away.geom.PlaneClassification,Vector3D=away.geom.Vector3D,AxisAlignedBoundingBox=function(_super){function AxisAlignedBoundingBox(){_super.call(this),this._centerX=0,this._centerY=0,this._centerZ=0,this._halfExtentsX=0,this._halfExtentsY=0,this._halfExtentsZ=0}return __extends(AxisAlignedBoundingBox,_super),AxisAlignedBoundingBox.prototype.nullify=function(){_super.prototype.nullify.call(this),this._centerX=this._centerY=this._centerZ=0,this._halfExtentsX=this._halfExtentsY=this._halfExtentsZ=0},AxisAlignedBoundingBox.prototype.isInFrustum=function(planes,numPlanes){for(var i=0;numPlanes>i;++i){var plane=planes[i],a=plane.a,b=plane.b,c=plane.c,flippedExtentX=0>a?-this._halfExtentsX:this._halfExtentsX,flippedExtentY=0>b?-this._halfExtentsY:this._halfExtentsY,flippedExtentZ=0>c?-this._halfExtentsZ:this._halfExtentsZ,projDist=a*(this._centerX+flippedExtentX)+b*(this._centerY+flippedExtentY)+c*(this._centerZ+flippedExtentZ)-plane.d;if(0>projDist)return!1}return!0},AxisAlignedBoundingBox.prototype.rayIntersection=function(position,direction,targetNormal){if(this.containsPoint(position))return 0;var ix,iy,iz,rayEntryDistance,intersects,px=position.x-this._centerX,py=position.y-this._centerY,pz=position.z-this._centerZ,vx=direction.x,vy=direction.y,vz=direction.z;return 0>vx&&(rayEntryDistance=(this._halfExtentsX-px)/vx,rayEntryDistance>0&&(iy=py+rayEntryDistance*vy,iz=pz+rayEntryDistance*vz,iy>-this._halfExtentsY&&iy-this._halfExtentsZ&&iz0&&(rayEntryDistance=(-this._halfExtentsX-px)/vx,rayEntryDistance>0&&(iy=py+rayEntryDistance*vy,iz=pz+rayEntryDistance*vz,iy>-this._halfExtentsY&&iy-this._halfExtentsZ&&izvy&&(rayEntryDistance=(this._halfExtentsY-py)/vy,rayEntryDistance>0&&(ix=px+rayEntryDistance*vx,iz=pz+rayEntryDistance*vz,ix>-this._halfExtentsX&&ix-this._halfExtentsZ&&iz0&&(rayEntryDistance=(-this._halfExtentsY-py)/vy,rayEntryDistance>0&&(ix=px+rayEntryDistance*vx,iz=pz+rayEntryDistance*vz,ix>-this._halfExtentsX&&ix-this._halfExtentsZ&&izvz&&(rayEntryDistance=(this._halfExtentsZ-pz)/vz,rayEntryDistance>0&&(ix=px+rayEntryDistance*vx,iy=py+rayEntryDistance*vy,iy>-this._halfExtentsY&&iy-this._halfExtentsX&&ix0&&(rayEntryDistance=(-this._halfExtentsZ-pz)/vz,rayEntryDistance>0&&(ix=px+rayEntryDistance*vx,iy=py+rayEntryDistance*vy,iy>-this._halfExtentsY&&iy-this._halfExtentsX&&ix=-this._halfExtentsX&&py<=this._halfExtentsY&&py>=-this._halfExtentsY&&pz<=this._halfExtentsZ&&pz>=-this._halfExtentsZ},AxisAlignedBoundingBox.prototype.fromExtremes=function(minX,minY,minZ,maxX,maxY,maxZ){this._centerX=.5*(maxX+minX),this._centerY=.5*(maxY+minY),this._centerZ=.5*(maxZ+minZ),this._halfExtentsX=.5*(maxX-minX),this._halfExtentsY=.5*(maxY-minY),this._halfExtentsZ=.5*(maxZ-minZ),_super.prototype.fromExtremes.call(this,minX,minY,minZ,maxX,maxY,maxZ)},AxisAlignedBoundingBox.prototype.clone=function(){var clone=new AxisAlignedBoundingBox;return clone.fromExtremes(this._aabb.x,this._aabb.y+this._aabb.height,this._aabb.z,this._aabb.x+this._aabb.width,this._aabb.y,this._aabb.z+this._aabb.depth),clone},Object.defineProperty(AxisAlignedBoundingBox.prototype,"halfExtentsX",{get:function(){return this._halfExtentsX},enumerable:!0,configurable:!0}),Object.defineProperty(AxisAlignedBoundingBox.prototype,"halfExtentsY",{get:function(){return this._halfExtentsY},enumerable:!0,configurable:!0}),Object.defineProperty(AxisAlignedBoundingBox.prototype,"halfExtentsZ",{get:function(){return this._halfExtentsZ},enumerable:!0,configurable:!0}),AxisAlignedBoundingBox.prototype.closestPointToPoint=function(point,target){"undefined"==typeof target&&(target=null);var p;return null==target&&(target=new Vector3D),p=point.x,pthis._aabb.x+this._aabb.width&&(p=this._aabb.x+this._aabb.width),target.x=p,p=point.y,pthis._aabb.y&&(p=this._aabb.y),target.y=p,p=point.z,pthis._aabb.z+this._aabb.depth&&(p=this._aabb.z+this._aabb.depth),target.z=p,target},AxisAlignedBoundingBox.prototype.pUpdateBoundingRenderable=function(){this._pBoundingEntity.transform.scale.x=Math.max(2*this._halfExtentsX,.001),this._pBoundingEntity.transform.scale.y=Math.max(2*this._halfExtentsY,.001),this._pBoundingEntity.transform.scale.z=Math.max(2*this._halfExtentsZ,.001),this._pBoundingEntity.transform.position.x=this._centerX,this._pBoundingEntity.transform.position.y=this._centerY,this._pBoundingEntity.transform.position.z=this._centerZ},AxisAlignedBoundingBox.prototype.pCreateBoundingEntity=function(){return null},AxisAlignedBoundingBox.prototype.classifyToPlane=function(plane){var a=plane.a,b=plane.b,c=plane.c,centerDistance=a*this._centerX+b*this._centerY+c*this._centerZ-plane.d;0>a&&(a=-a),0>b&&(b=-b),0>c&&(c=-c);var boundOffset=a*this._halfExtentsX+b*this._halfExtentsY+c*this._halfExtentsZ;return centerDistance>boundOffset?PlaneClassification.FRONT:-boundOffset>centerDistance?PlaneClassification.BACK:PlaneClassification.INTERSECT},AxisAlignedBoundingBox.prototype.transformFrom=function(bounds,matrix){var aabb=bounds,cx=aabb._centerX,cy=aabb._centerY,cz=aabb._centerZ,raw=Matrix3DUtils.RAW_DATA_CONTAINER;matrix.copyRawDataTo(raw);var m11=raw[0],m12=raw[4],m13=raw[8],m14=raw[12],m21=raw[1],m22=raw[5],m23=raw[9],m24=raw[13],m31=raw[2],m32=raw[6],m33=raw[10],m34=raw[14];this._centerX=cx*m11+cy*m12+cz*m13+m14,this._centerY=cx*m21+cy*m22+cz*m23+m24,this._centerZ=cx*m31+cy*m32+cz*m33+m34,0>m11&&(m11=-m11),0>m12&&(m12=-m12),0>m13&&(m13=-m13),0>m21&&(m21=-m21),0>m22&&(m22=-m22),0>m23&&(m23=-m23),0>m31&&(m31=-m31),0>m32&&(m32=-m32),0>m33&&(m33=-m33);var hx=aabb._halfExtentsX,hy=aabb._halfExtentsY,hz=aabb._halfExtentsZ;this._halfExtentsX=hx*m11+hy*m12+hz*m13,this._halfExtentsY=hx*m21+hy*m22+hz*m23,this._halfExtentsZ=hx*m31+hy*m32+hz*m33,this._aabb.width=this._aabb.height=this._aabb.depth=2*this._halfExtentsX,this._aabb.x=this._centerX-this._halfExtentsX,this._aabb.y=this._centerY+this._halfExtentsY,this._aabb.z=this._centerZ-this._halfExtentsZ},AxisAlignedBoundingBox}(_bounds.BoundingVolumeBase);_bounds.AxisAlignedBoundingBox=AxisAlignedBoundingBox}(away.bounds||(away.bounds={}));away.bounds}(away||(away={}));var away;!function(away){!function(net){var URLRequest=function(){function URLRequest(url){"undefined"==typeof url&&(url=null),this.method=net.URLRequestMethod.GET,this.async=!0,this._url=url}return Object.defineProperty(URLRequest.prototype,"url",{get:function(){return this._url},set:function(value){this._url=value},enumerable:!0,configurable:!0}),URLRequest.prototype.dispose=function(){this.data=null,this._url=null},URLRequest}();net.URLRequest=URLRequest}(away.net||(away.net={}));away.net}(away||(away={}));var away;!function(away){!function(net){var URLLoaderDataFormat=function(){function URLLoaderDataFormat(){}return URLLoaderDataFormat.TEXT="text",URLLoaderDataFormat.VARIABLES="variables",URLLoaderDataFormat.BLOB="blob",URLLoaderDataFormat.ARRAY_BUFFER="arraybuffer",URLLoaderDataFormat.BINARY="binary",URLLoaderDataFormat}();net.URLLoaderDataFormat=URLLoaderDataFormat}(away.net||(away.net={}));away.net}(away||(away={}));var away;!function(away){!function(net){var URLRequestMethod=function(){function URLRequestMethod(){}return URLRequestMethod.POST="POST",URLRequestMethod.GET="GET",URLRequestMethod}();net.URLRequestMethod=URLRequestMethod}(away.net||(away.net={}));away.net}(away||(away={}));var away;!function(away){!function(net){var URLLoader=function(_super){function URLLoader(){_super.call(this),this._bytesLoaded=0,this._bytesTotal=0,this._dataFormat=net.URLLoaderDataFormat.TEXT,this._loadError=!1}return __extends(URLLoader,_super),Object.defineProperty(URLLoader.prototype,"url",{get:function(){return this._request?this._request.url:"" -},enumerable:!0,configurable:!0}),Object.defineProperty(URLLoader.prototype,"data",{get:function(){return this._data},enumerable:!0,configurable:!0}),Object.defineProperty(URLLoader.prototype,"dataFormat",{get:function(){return this._dataFormat},set:function(format){this._dataFormat=format},enumerable:!0,configurable:!0}),Object.defineProperty(URLLoader.prototype,"bytesLoaded",{get:function(){return this._bytesLoaded},enumerable:!0,configurable:!0}),Object.defineProperty(URLLoader.prototype,"bytesTotal",{get:function(){return this._bytesTotal},enumerable:!0,configurable:!0}),URLLoader.prototype.load=function(request){this._request=request,this.initXHR(),request.method===net.URLRequestMethod.POST?this.postRequest(request):this.getRequest(request)},URLLoader.prototype.close=function(){this._XHR.abort(),this.disposeXHR()},URLLoader.prototype.dispose=function(){this._XHR&&this._XHR.abort(),this.disposeXHR(),this._data=null,this._dataFormat=null,this._bytesLoaded=null,this._bytesTotal=null},URLLoader.prototype.setResponseType=function(xhr,responseType){switch(responseType){case net.URLLoaderDataFormat.ARRAY_BUFFER:case net.URLLoaderDataFormat.BLOB:case net.URLLoaderDataFormat.TEXT:xhr.responseType=responseType;break;case net.URLLoaderDataFormat.VARIABLES:xhr.responseType=net.URLLoaderDataFormat.TEXT;break;case net.URLLoaderDataFormat.BINARY:xhr.responseType=""}},URLLoader.prototype.getRequest=function(request){try{this._XHR.open(request.method,request.url,request.async),this.setResponseType(this._XHR,this._dataFormat),this._XHR.send()}catch(e){this.handleXmlHttpRequestException(e)}},URLLoader.prototype.postRequest=function(request){if(this._loadError=!1,this._XHR.open(request.method,request.url,request.async),null!=request.data)if(request.data instanceof net.URLVariables){var urlVars=request.data;try{this._XHR.responseType="text",this._XHR.send(urlVars.formData)}catch(e){this.handleXmlHttpRequestException(e)}}else this.setResponseType(this._XHR,this._dataFormat),request.data?this._XHR.send(request.data):this._XHR.send();else this._XHR.send()},URLLoader.prototype.handleXmlHttpRequestException=function(error){switch(error.code){case 101:}},URLLoader.prototype.initXHR=function(){var _this=this;this._XHR||(this._XHR=new XMLHttpRequest,this._XHR.onloadstart=function(event){return _this.onLoadStart(event)},this._XHR.onprogress=function(event){return _this.onProgress(event)},this._XHR.onabort=function(event){return _this.onAbort(event)},this._XHR.onerror=function(event){return _this.onLoadError(event)},this._XHR.onload=function(event){return _this.onLoadComplete(event)},this._XHR.ontimeout=function(event){return _this.onTimeOut(event)},this._XHR.onloadend=function(event){return _this.onLoadEnd(event)},this._XHR.onreadystatechange=function(event){return _this.onReadyStateChange(event)})},URLLoader.prototype.disposeXHR=function(){null!==this._XHR&&(this._XHR.onloadstart=null,this._XHR.onprogress=null,this._XHR.onabort=null,this._XHR.onerror=null,this._XHR.onload=null,this._XHR.ontimeout=null,this._XHR.onloadend=null,this._XHR=null)},URLLoader.prototype.decodeURLVariables=function(source){var result=new Object;source=source.split("+").join(" ");for(var tokens,re=/[?&]?([^=]+)=([^&]*)/g;tokens=re.exec(source);)result[decodeURIComponent(tokens[1])]=decodeURIComponent(tokens[2]);return result},URLLoader.prototype.onReadyStateChange=function(){4==this._XHR.readyState&&(404==this._XHR.status&&(this._loadError=!0,this._loadErrorEvent||(this._loadErrorEvent=new away.events.IOErrorEvent(away.events.IOErrorEvent.IO_ERROR)),this.dispatchEvent(this._loadErrorEvent)),this.dispatchEvent(new away.events.HTTPStatusEvent(away.events.HTTPStatusEvent.HTTP_STATUS,this._XHR.status)))},URLLoader.prototype.onLoadEnd=function(){this._loadError===!0},URLLoader.prototype.onTimeOut=function(){},URLLoader.prototype.onAbort=function(){},URLLoader.prototype.onProgress=function(event){this._progressEvent||(this._progressEvent=new away.events.ProgressEvent(away.events.ProgressEvent.PROGRESS)),this._progressEvent.bytesTotal=event.total,this._progressEvent.bytesLoaded=event.loaded,this.dispatchEvent(this._progressEvent)},URLLoader.prototype.onLoadStart=function(){this._loadStartEvent||(this._loadStartEvent=new away.events.Event(away.events.Event.OPEN)),this.dispatchEvent(this._loadStartEvent)},URLLoader.prototype.onLoadComplete=function(){if(this._loadError!==!0){switch(this._dataFormat){case net.URLLoaderDataFormat.TEXT:this._data=this._XHR.responseText;break;case net.URLLoaderDataFormat.VARIABLES:this._data=this.decodeURLVariables(this._XHR.responseText);break;case net.URLLoaderDataFormat.BLOB:case net.URLLoaderDataFormat.ARRAY_BUFFER:case net.URLLoaderDataFormat.BINARY:this._data=this._XHR.response;break;default:this._data=this._XHR.responseText}this._loadCompleteEvent||(this._loadCompleteEvent=new away.events.Event(away.events.Event.COMPLETE)),this.dispatchEvent(this._loadCompleteEvent)}},URLLoader.prototype.onLoadError=function(){this._loadError=!0,this._loadErrorEvent||(this._loadErrorEvent=new away.events.IOErrorEvent(away.events.IOErrorEvent.IO_ERROR)),this.dispatchEvent(this._loadErrorEvent)},URLLoader}(away.events.EventDispatcher);net.URLLoader=URLLoader}(away.net||(away.net={}));away.net}(away||(away={}));var away;!function(away){!function(net){var URLVariables=function(){function URLVariables(source){"undefined"==typeof source&&(source=null),this._variables=new Object,null!==source&&this.decode(source)}return URLVariables.prototype.decode=function(source){source=source.split("+").join(" ");for(var tokens,re=/[?&]?([^=]+)=([^&]*)/g;tokens=re.exec(source);)this._variables[decodeURIComponent(tokens[1])]=decodeURIComponent(tokens[2])},URLVariables.prototype.toString=function(){return""},Object.defineProperty(URLVariables.prototype,"variables",{get:function(){return this._variables},set:function(obj){this._variables=obj},enumerable:!0,configurable:!0}),Object.defineProperty(URLVariables.prototype,"formData",{get:function(){var fd=new FormData;for(var s in this._variables)fd.append(s,this._variables[s]);return fd},enumerable:!0,configurable:!0}),URLVariables}();net.URLVariables=URLVariables}(away.net||(away.net={}));away.net}(away||(away={}));var away;!function(away){!function(library){var AbstractMethodError=away.errors.AbstractMethodError,NamedAssetBase=function(_super){function NamedAssetBase(name){"undefined"==typeof name&&(name=null),_super.call(this),this._id=NamedAssetBase.ID_COUNT++,null==name&&(name="null"),this._name=name,this._originalName=name,this.updateFullPath()}return __extends(NamedAssetBase,_super),Object.defineProperty(NamedAssetBase.prototype,"assetType",{get:function(){throw new AbstractMethodError},enumerable:!0,configurable:!0}),Object.defineProperty(NamedAssetBase.prototype,"originalName",{get:function(){return this._originalName},enumerable:!0,configurable:!0}),Object.defineProperty(NamedAssetBase.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(NamedAssetBase.prototype,"name",{get:function(){return this._name},set:function(val){var prev;prev=this._name,this._name=val,null==this._name&&(this._name="null"),this.updateFullPath(),this.dispatchEvent(new away.events.AssetEvent(away.events.AssetEvent.ASSET_RENAME,this,prev))},enumerable:!0,configurable:!0}),NamedAssetBase.prototype.dispose=function(){throw new AbstractMethodError},Object.defineProperty(NamedAssetBase.prototype,"assetNamespace",{get:function(){return this._namespace},enumerable:!0,configurable:!0}),Object.defineProperty(NamedAssetBase.prototype,"assetFullPath",{get:function(){return this._full_path},enumerable:!0,configurable:!0}),NamedAssetBase.prototype.assetPathEquals=function(name,ns){return this._name==name&&(!ns||this._namespace==ns)},NamedAssetBase.prototype.resetAssetPath=function(name,ns,overrideOriginal){"undefined"==typeof ns&&(ns=null),"undefined"==typeof overrideOriginal&&(overrideOriginal=!0),this._name=name?name:"null",this._namespace=ns?ns:NamedAssetBase.DEFAULT_NAMESPACE,overrideOriginal&&(this._originalName=this._name),this.updateFullPath()},NamedAssetBase.prototype.updateFullPath=function(){this._full_path=[this._namespace,this._name]},NamedAssetBase.ID_COUNT=0,NamedAssetBase.DEFAULT_NAMESPACE="default",NamedAssetBase}(away.events.EventDispatcher);library.NamedAssetBase=NamedAssetBase}(away.library||(away.library={}));away.library}(away||(away={}));var away;!function(away){!function(library){var AssetType=function(){function AssetType(){}return AssetType.ANIMATION_NODE="animationNode",AssetType.ANIMATION_SET="animationSet",AssetType.ANIMATION_STATE="animationState",AssetType.ANIMATOR="animator",AssetType.BILLBOARD="billboard",AssetType.CAMERA="camera",AssetType.CONTAINER="container",AssetType.EFFECTS_METHOD="effectsMethod",AssetType.GEOMETRY="geometry",AssetType.LINE_SEGMENT="lineSegment",AssetType.LIGHT="light",AssetType.LIGHT_PICKER="lightPicker",AssetType.MATERIAL="material",AssetType.MESH="mesh",AssetType.TRIANGLE_SUB_MESH="triangleSubMesh",AssetType.LINE_SUB_MESH="lineSubMesh",AssetType.PRIMITIVE_PREFAB="primitivePrefab",AssetType.SHADOW_MAP_METHOD="shadowMapMethod",AssetType.SKELETON="skeleton",AssetType.SKELETON_POSE="skeletonPose",AssetType.SKYBOX="skybox",AssetType.STATE_TRANSITION="stateTransition",AssetType.TEXTURE="texture",AssetType.TEXTURE_PROJECTOR="textureProjector",AssetType}();library.AssetType=AssetType}(away.library||(away.library={}));away.library}(away||(away={}));var away;!function(away){!function(display){var ContextMode=function(){function ContextMode(){}return ContextMode.AUTO="auto",ContextMode.WEBGL="webgl",ContextMode.FLASH="flash",ContextMode.NATIVE="native",ContextMode}();display.ContextMode=ContextMode}(away.display||(away.display={}));away.display}(away||(away={}));var away;!function(away){!function(){}(away.display||(away.display={}));away.display}(away||(away={}));var away;!function(away){!function(base){var BlendMode=function(){function BlendMode(){}return BlendMode.ADD="add",BlendMode.ALPHA="alpha",BlendMode.DARKEN="darken",BlendMode.DIFFERENCE="difference",BlendMode.ERASE="erase",BlendMode.HARDLIGHT="hardlight",BlendMode.INVERT="invert",BlendMode.LAYER="layer",BlendMode.LIGHTEN="lighten",BlendMode.MULTIPLY="multiply",BlendMode.NORMAL="normal",BlendMode.OVERLAY="overlay",BlendMode.SCREEN="screen",BlendMode.SHADER="shader",BlendMode.SUBTRACT="subtract",BlendMode}();base.BlendMode=BlendMode}(away.base||(away.base={}));away.base}(away||(away={}));var away;!function(away){!function(base){var AlignmentMode=function(){function AlignmentMode(){}return AlignmentMode.REGISTRATION_POINT="registrationPoint",AlignmentMode.PIVOT_POINT="pivot",AlignmentMode}();base.AlignmentMode=AlignmentMode}(away.base||(away.base={}));away.base}(away||(away={}));var away;!function(away){!function(base){var OrientationMode=function(){function OrientationMode(){}return OrientationMode.DEFAULT="default",OrientationMode.CAMERA_PLANE="cameraPlane",OrientationMode.CAMERA_POSITION="cameraPosition",OrientationMode}();base.OrientationMode=OrientationMode}(away.base||(away.base={}));away.base}(away||(away={}));var away;!function(away){!function(base){var Rectangle=away.geom.Rectangle,ColorUtils=away.utils.ColorUtils,BitmapData=function(){function BitmapData(width,height,transparent,fillColor){"undefined"==typeof transparent&&(transparent=!0),"undefined"==typeof fillColor&&(fillColor=null),this._alpha=1,this._locked=!1,this._transparent=transparent,this._imageCanvas=document.createElement("canvas"),this._imageCanvas.width=width,this._imageCanvas.height=height,this._context=this._imageCanvas.getContext("2d"),this._rect=new Rectangle(0,0,width,height),null!=fillColor&&(this._alpha=this._transparent?away.utils.ColorUtils.float32ColorToARGB(fillColor)[0]/255:1,this.fillRect(this._rect,fillColor))}return BitmapData.prototype.dispose=function(){this._context=null,this._imageCanvas=null,this._imageData=null,this._rect=null,this._transparent=null,this._locked=null},BitmapData.prototype.lock=function(){this._locked=!0,this._imageData=this._context.getImageData(0,0,this._rect.width,this._rect.height)},BitmapData.prototype.unlock=function(){this._locked=!1,this._imageData&&(this._context.putImageData(this._imageData,0,0),this._imageData=null)},BitmapData.prototype.getPixel=function(x,y){var r,g,b,a;if(this._locked){var index=4*(x+y*this._imageCanvas.width);this._imageData||(this._imageData=this._context.getImageData(0,0,this._rect.width,this._rect.height)),r=this._imageData.data[index+0],g=this._imageData.data[index+1],b=this._imageData.data[index+2],a=this._imageData.data[index+3]}else{var pixelData=this._context.getImageData(x,y,1,1);r=pixelData.data[0],g=pixelData.data[1],b=pixelData.data[2],a=pixelData.data[3]}return this._locked||(this._imageData=null),a<<24|r<<16|g<<8|b},BitmapData.prototype.setPixel=function(x,y,color){var argb=away.utils.ColorUtils.float32ColorToARGB(color);if(this._locked||(this._imageData=this._context.getImageData(0,0,this._rect.width,this._rect.height)),this._imageData){var index=4*(x+y*this._imageCanvas.width);this._imageData.data[index+0]=argb[1],this._imageData.data[index+1]=argb[2],this._imageData.data[index+2]=argb[3],this._imageData.data[index+3]=255}this._locked||(this._context.putImageData(this._imageData,0,0),this._imageData=null)},BitmapData.prototype.setPixels=function(rect,inputByteArray){if(this._locked||(this._imageData=this._context.getImageData(0,0,this._rect.width,this._rect.height)),this._imageData){inputByteArray.position=0;var i,j,index;for(i=0;irayEntryDistance?!1:(pickingCollisionVO.rayEntryDistance=rayEntryDistance,pickingCollisionVO.localRayPosition=localRayPosition,pickingCollisionVO.localRayDirection=localRayDirection,pickingCollisionVO.rayPosition=rayPosition,pickingCollisionVO.rayDirection=rayDirection,pickingCollisionVO.rayOriginIsInsideBounds=0==rayEntryDistance,!0)},DisplayObject.prototype.local3DToGlobal=function(){return new away.geom.Point},DisplayObject.prototype.lookAt=function(target,upAxis){"undefined"==typeof upAxis&&(upAxis=null);var yAxis,zAxis,xAxis,raw;null==upAxis?upAxis=away.geom.Vector3D.Y_AXIS:upAxis.normalize(),zAxis=target.subtract(this._iMatrix3D.position),zAxis.normalize(),xAxis=upAxis.crossProduct(zAxis),xAxis.normalize(),xAxis.length<.05&&(xAxis.x=upAxis.y,xAxis.y=upAxis.x,xAxis.z=0,xAxis.normalize()),yAxis=zAxis.crossProduct(xAxis),raw=away.geom.Matrix3DUtils.RAW_DATA_CONTAINER,raw[0]=xAxis.x,raw[1]=xAxis.y,raw[2]=xAxis.z,raw[3]=0,raw[4]=yAxis.x,raw[5]=yAxis.y,raw[6]=yAxis.z,raw[7]=0,raw[8]=zAxis.x,raw[9]=zAxis.y,raw[10]=zAxis.z,raw[11]=0;var m=new away.geom.Matrix3D;m.copyRawDataFrom(raw);var vec=m.decompose()[1];this._rotationX=vec.x,this._rotationY=vec.y,this._rotationZ=vec.z,this.invalidateRotation()},DisplayObject.prototype.localToGlobal=function(){return new away.geom.Point},DisplayObject.prototype.moveTo=function(dx,dy,dz){(this._x!=dx||this._y!=dy||this._z!=dz)&&(this._x=dx,this._y=dy,this._z=dz,this.invalidatePosition())},DisplayObject.prototype.movePivot=function(dx,dy,dz){null==this._pivot&&(this._pivot=new away.geom.Vector3D),this._pivot.x+=dx,this._pivot.y+=dy,this._pivot.z+=dz,this.invalidatePivot()},DisplayObject.prototype.pitch=function(angle){this.rotate(away.geom.Vector3D.X_AXIS,angle)},DisplayObject.prototype.getRenderSceneTransform=function(camera){if(this.orientationMode==base.OrientationMode.CAMERA_PLANE){var comps=camera.sceneTransform.decompose(),scale=comps[2];return comps[0]=this.scenePosition,scale.x=this._pScaleX,scale.y=this._pScaleY,scale.z=this._pScaleZ,this._orientationMatrix.recompose(comps),this._pivotZero||this.alignmentMode!=base.AlignmentMode.PIVOT_POINT||this._orientationMatrix.prependTranslation(-this._pivot.x/this._pScaleX,-this._pivot.y/this._pScaleY,-this._pivot.z/this._pScaleZ),this._orientationMatrix}return this.sceneTransform},DisplayObject.prototype.roll=function(angle){this.rotate(away.geom.Vector3D.Z_AXIS,angle)},DisplayObject.prototype.rotate=function(axis,angle){var m=new away.geom.Matrix3D;m.prependRotation(angle,axis);var vec=m.decompose()[1];this._rotationX+=vec.x,this._rotationY+=vec.y,this._rotationZ+=vec.z,this.invalidateRotation()},DisplayObject.prototype.rotateTo=function(ax,ay,az){this._rotationX=ax*away.geom.MathConsts.DEGREES_TO_RADIANS,this._rotationY=ay*away.geom.MathConsts.DEGREES_TO_RADIANS,this._rotationZ=az*away.geom.MathConsts.DEGREES_TO_RADIANS,this.invalidateRotation()},DisplayObject.prototype.removeEventListener=function(type,listener){if(_super.prototype.removeEventListener.call(this,type,listener),!this.hasEventListener(type,listener))switch(type){case away.events.DisplayObjectEvent.POSITION_CHANGED:this._listenToPositionChanged=!1;break;case away.events.DisplayObjectEvent.ROTATION_CHANGED:this._listenToRotationChanged=!1;break;case away.events.DisplayObjectEvent.SCALE_CHANGED:this._listenToScaleChanged=!1}},DisplayObject.prototype.translate=function(axis,distance){var x=axis.x,y=axis.y,z=axis.z,len=distance/Math.sqrt(x*x+y*y+z*z);this._x+=x*len,this._y+=y*len,this._z+=z*len,this.invalidatePosition()},DisplayObject.prototype.translateLocal=function(axis,distance){var x=axis.x,y=axis.y,z=axis.z,len=distance/Math.sqrt(x*x+y*y+z*z);this._iMatrix3D.prependTranslation(x*len,y*len,z*len),this._matrix3D.copyColumnTo(3,this._pos),this._x=this._pos.x,this._y=this._pos.y,this._z=this._pos.z,this.invalidatePosition()},DisplayObject.prototype.yaw=function(angle){this.rotate(away.geom.Vector3D.Y_AXIS,angle)},Object.defineProperty(DisplayObject.prototype,"_iAssignedPartition",{get:function(){return this._pImplicitPartition},enumerable:!0,configurable:!0}),Object.defineProperty(DisplayObject.prototype,"_iMatrix3D",{get:function(){return this._matrix3DDirty&&this._pUpdateMatrix3D(),this._matrix3D},set:function(val){var vec,elements=val.decompose();vec=elements[0],(this._x!=vec.x||this._y!=vec.y||this._z!=vec.z)&&(this._x=vec.x,this._y=vec.y,this._z=vec.z,this.invalidatePosition()),vec=elements[1],(this._rotationX!=vec.x||this._rotationY!=vec.y||this._rotationZ!=vec.z)&&(this._rotationX=vec.x,this._rotationY=vec.y,this._rotationZ=vec.z,this.invalidateRotation()),vec=elements[2],(this._pScaleX!=vec.x||this._pScaleY!=vec.y||this._pScaleZ!=vec.z)&&(this._pScaleX=vec.x,this._pScaleY=vec.y,this._pScaleZ=vec.z,this.invalidateScale())},enumerable:!0,configurable:!0}),Object.defineProperty(DisplayObject.prototype,"_iPickingCollisionVO",{get:function(){return this._pPickingCollisionVO||(this._pPickingCollisionVO=new away.pick.PickingCollisionVO(this)),this._pPickingCollisionVO},enumerable:!0,configurable:!0}),DisplayObject.prototype.iSetParent=function(value){this._pParent=value,value?(this._pUpdateImplicitMouseEnabled(value.mouseChildren),this._pUpdateImplicitVisibility(value._iIsVisible()),this._pUpdateImplicitPartition(value._iAssignedPartition),this._iSetScene(value._pScene)):(this._pUpdateImplicitMouseEnabled(!0),this._pUpdateImplicitVisibility(!0),this._pUpdateImplicitPartition(null),this._iSetScene(null))},DisplayObject.prototype.pCreateDefaultBoundingVolume=function(){return new away.bounds.AxisAlignedBoundingBox},DisplayObject.prototype.pCreateEntityPartitionNode=function(){throw new away.errors.AbstractMethodError},DisplayObject.prototype.pInvalidateBounds=function(){this._pBoundsInvalid=!0,this._worldBoundsInvalid=!0,this.isEntity&&this.invalidatePartition()},DisplayObject.prototype.pInvalidateSceneTransform=function(){this._pSceneTransformDirty=!this._pIgnoreTransform,this._inverseSceneTransformDirty=!this._pIgnoreTransform,this._scenePositionDirty=!this._pIgnoreTransform,this._worldBoundsInvalid=!this._pIgnoreTransform,this.isEntity&&this.invalidatePartition(),this._listenToSceneTransformChanged&&this.notifySceneTransformChange()},DisplayObject.prototype.pUpdateBounds=function(){this._width=this._pBounds.aabb.width*this._pScaleX,this._height=this._pBounds.aabb.height*this._pScaleY,this._depth=this._pBounds.aabb.depth*this._pScaleZ,this._pBoundsInvalid=!1},DisplayObject.prototype._pUpdateImplicitMouseEnabled=function(value){this._pImplicitMouseEnabled=this._explicitMouseEnabled&&value,this._pImplicitMouseEnabled&&this._pParent&&!this._pPickingCollider&&(this._pPickingCollider=this._pParent._pPickingCollider)},DisplayObject.prototype._pUpdateImplicitPartition=function(value){this._pImplicitPartition=this._explicitPartition||value},DisplayObject.prototype._pUpdateImplicitVisibility=function(value){this._pImplicitVisibility=this._explicitVisibility&&value},DisplayObject.prototype._pUpdateMatrix3D=function(){this._pos.x=this._x,this._pos.y=this._y,this._pos.z=this._z,this._rot.x=this._rotationX,this._rot.y=this._rotationY,this._rot.z=this._rotationZ,this._sca.x=this._pScaleX,this._sca.y=this._pScaleY,this._sca.z=this._pScaleZ,this._matrix3D.recompose(this._transformComponents),this._pivotZero||(this._matrix3D.prependTranslation(-this._pivot.x/this._pScaleX,-this._pivot.y/this._pScaleY,-this._pivot.z/this._pScaleZ),this.alignmentMode!=base.AlignmentMode.PIVOT_POINT&&this._matrix3D.appendTranslation(this._pivot.x,this._pivot.y,this._pivot.z)),this._matrix3DDirty=!1,this._positionDirty=!1,this._rotationDirty=!1,this._scaleDirty=!1,this._pivotDirty=!1},DisplayObject.prototype.pUpdateSceneTransform=function(){this._pParent&&!this._pParent._iIsRoot?(this._pSceneTransform.copyFrom(this._pParent.sceneTransform),this._pSceneTransform.prepend(this._iMatrix3D)):this._pSceneTransform.copyFrom(this._iMatrix3D),this._pSceneTransformDirty=!1},DisplayObject.prototype._iAddRenderable=function(renderable){return this._pRenderables.push(renderable),renderable},DisplayObject.prototype._iRemoveRenderable=function(renderable){var index=this._pRenderables.indexOf(renderable);return this._pRenderables.splice(index,1),renderable},DisplayObject.prototype._iTestCollision=function(){return!1},DisplayObject.prototype._iInternalUpdate=function(){this._iController&&this._iController.update()},DisplayObject.prototype._iIsVisible=function(){return this._pImplicitVisibility},DisplayObject.prototype._iIsMouseEnabled=function(){return this._pImplicitMouseEnabled},DisplayObject.prototype._iSetScene=function(value){this._pScene!=value&&(this._pUpdateScene(value),this._pSceneTransformDirty||this._pIgnoreTransform||this.pInvalidateSceneTransform())},DisplayObject.prototype._pUpdateScene=function(value){this._pScene&&(this._pScene.dispatchEvent(new away.events.SceneEvent(away.events.SceneEvent.REMOVED_FROM_SCENE,this)),this._pScene.iUnregisterEntity(this)),this._pScene=value,value&&(value.dispatchEvent(new away.events.SceneEvent(away.events.SceneEvent.ADDED_TO_SCENE,this)),value.iRegisterEntity(this)),this.notifySceneChange()},DisplayObject.prototype.notifyPositionChanged=function(){this._positionChanged||(this._positionChanged=new away.events.DisplayObjectEvent(away.events.DisplayObjectEvent.POSITION_CHANGED,this)),this.dispatchEvent(this._positionChanged)},DisplayObject.prototype.notifyRotationChanged=function(){this._rotationChanged||(this._rotationChanged=new away.events.DisplayObjectEvent(away.events.DisplayObjectEvent.ROTATION_CHANGED,this)),this.dispatchEvent(this._rotationChanged)},DisplayObject.prototype.notifyScaleChanged=function(){this._scaleChanged||(this._scaleChanged=new away.events.DisplayObjectEvent(away.events.DisplayObjectEvent.SCALE_CHANGED,this)),this.dispatchEvent(this._scaleChanged)},DisplayObject.prototype.notifySceneChange=function(){this._listenToSceneChanged&&(this._scenechanged||(this._scenechanged=new away.events.DisplayObjectEvent(away.events.DisplayObjectEvent.SCENE_CHANGED,this)),this.dispatchEvent(this._scenechanged))},DisplayObject.prototype.notifySceneTransformChange=function(){this._sceneTransformChanged||(this._sceneTransformChanged=new away.events.DisplayObjectEvent(away.events.DisplayObjectEvent.SCENETRANSFORM_CHANGED,this)),this.dispatchEvent(this._sceneTransformChanged)},DisplayObject.prototype.invalidateMatrix3D=function(){this._matrix3DDirty||(this._matrix3DDirty=!0,this._pSceneTransformDirty||this._pIgnoreTransform||this.pInvalidateSceneTransform())},DisplayObject.prototype.invalidatePartition=function(){this._iAssignedPartition&&this._iAssignedPartition.iMarkForUpdate(this)},DisplayObject.prototype.invalidatePivot=function(){this._pivotZero=0==this._pivot.x&&0==this._pivot.y&&0==this._pivot.z,this._pivotDirty||(this._pivotDirty=!0,this.invalidateMatrix3D())},DisplayObject.prototype.invalidatePosition=function(){this._positionDirty||(this._positionDirty=!0,this.invalidateMatrix3D(),this._listenToPositionChanged&&this.notifyPositionChanged())},DisplayObject.prototype.invalidateRotation=function(){this._rotationDirty||(this._rotationDirty=!0,this.invalidateMatrix3D(),this._listenToRotationChanged&&this.notifyRotationChanged())},DisplayObject.prototype.invalidateScale=function(){this._scaleDirty||(this._scaleDirty=!0,this.invalidateMatrix3D(),this._listenToScaleChanged&&this.notifyScaleChanged())},DisplayObject}(away.library.NamedAssetBase);base.DisplayObject=DisplayObject}(away.base||(away.base={}));away.base}(away||(away={}));var away;!function(away){!function(base){var Geometry=function(_super){function Geometry(){_super.call(this),this._subGeometries=new Array}return __extends(Geometry,_super),Object.defineProperty(Geometry.prototype,"assetType",{get:function(){return away.library.AssetType.GEOMETRY},enumerable:!0,configurable:!0}),Object.defineProperty(Geometry.prototype,"subGeometries",{get:function(){return this._subGeometries},enumerable:!0,configurable:!0}),Geometry.prototype.getSubGeometries=function(){return this._subGeometries},Geometry.prototype.applyTransformation=function(transform){for(var len=this._subGeometries.length,i=0;len>i;++i)this._subGeometries[i].applyTransformation(transform)},Geometry.prototype.addSubGeometry=function(subGeometry){this._subGeometries.push(subGeometry),subGeometry.parentGeometry=this,this.hasEventListener(away.events.GeometryEvent.SUB_GEOMETRY_ADDED)&&this.dispatchEvent(new away.events.GeometryEvent(away.events.GeometryEvent.SUB_GEOMETRY_ADDED,subGeometry)),this.iInvalidateBounds(subGeometry)},Geometry.prototype.removeSubGeometry=function(subGeometry){this._subGeometries.splice(this._subGeometries.indexOf(subGeometry),1),subGeometry.parentGeometry=null,this.hasEventListener(away.events.GeometryEvent.SUB_GEOMETRY_REMOVED)&&this.dispatchEvent(new away.events.GeometryEvent(away.events.GeometryEvent.SUB_GEOMETRY_REMOVED,subGeometry)),this.iInvalidateBounds(subGeometry)},Geometry.prototype.clone=function(){for(var clone=new Geometry,len=this._subGeometries.length,i=0;len>i;++i)clone.addSubGeometry(this._subGeometries[i].clone());return clone},Geometry.prototype.scale=function(scale){for(var numSubGeoms=this._subGeometries.length,i=0;numSubGeoms>i;++i)this._subGeometries[i].scale(scale)},Geometry.prototype.dispose=function(){for(var numSubGeoms=this._subGeometries.length,i=0;numSubGeoms>i;++i){var subGeom=this._subGeometries[0];this.removeSubGeometry(subGeom),subGeom.dispose()}},Geometry.prototype.scaleUV=function(scaleU,scaleV){"undefined"==typeof scaleU&&(scaleU=1),"undefined"==typeof scaleV&&(scaleV=1);for(var numSubGeoms=this._subGeometries.length,i=0;numSubGeoms>i;++i)this._subGeometries[i].scaleUV(scaleU,scaleV)},Geometry.prototype.iInvalidateBounds=function(subGeom){this.hasEventListener(away.events.GeometryEvent.BOUNDS_INVALID)&&this.dispatchEvent(new away.events.GeometryEvent(away.events.GeometryEvent.BOUNDS_INVALID,subGeom))},Geometry}(away.library.NamedAssetBase);base.Geometry=Geometry}(away.base||(away.base={}));away.base}(away||(away={}));var away;!function(away){!function(base){var GradientType=function(){function GradientType(){}return GradientType.LINEAR="linear",GradientType.RADIAL="radial",GradientType}();base.GradientType=GradientType}(away.base||(away.base={}));away.base}(away||(away={}));var away;!function(away){!function(base){var Graphics=function(){function Graphics(){}return Graphics.prototype.beginBitmapFill=function(bitmap,matrix,repeat,smooth){"undefined"==typeof matrix&&(matrix=null),"undefined"==typeof repeat&&(repeat=!0),"undefined"==typeof smooth&&(smooth=!1)},Graphics.prototype.beginFill=function(color,alpha){"undefined"==typeof alpha&&(alpha=1)},Graphics.prototype.beginGradientFill=function(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio){"undefined"==typeof matrix&&(matrix=null),"undefined"==typeof spreadMethod&&(spreadMethod="pad"),"undefined"==typeof interpolationMethod&&(interpolationMethod="rgb"),"undefined"==typeof focalPointRatio&&(focalPointRatio=0)},Graphics.prototype.clear=function(){},Graphics.prototype.copyFrom=function(){},Graphics.prototype.cubicCurveTo=function(){},Graphics.prototype.curveTo=function(){},Graphics.prototype.drawCircle=function(){},Graphics.prototype.drawEllipse=function(){},Graphics.prototype.drawGraphicsData=function(){},Graphics.prototype.drawPath=function(){},Graphics.prototype.drawRect=function(){},Graphics.prototype.drawRoundRect=function(x,y,width,height,ellipseWidth,ellipseHeight){"undefined"==typeof ellipseHeight&&(ellipseHeight=0/0)},Graphics.prototype.drawTriangles=function(vertices,indices,uvtData,culling){"undefined"==typeof indices&&(indices=null),"undefined"==typeof uvtData&&(uvtData=null),"undefined"==typeof culling&&(culling=null)},Graphics.prototype.endFill=function(){},Graphics.prototype.lineBitmapStyle=function(bitmap,matrix,repeat,smooth){"undefined"==typeof matrix&&(matrix=null),"undefined"==typeof repeat&&(repeat=!0),"undefined"==typeof smooth&&(smooth=!1)},Graphics.prototype.lineGradientStyle=function(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio){"undefined"==typeof matrix&&(matrix=null),"undefined"==typeof spreadMethod&&(spreadMethod=null),"undefined"==typeof interpolationMethod&&(interpolationMethod=null),"undefined"==typeof focalPointRatio&&(focalPointRatio=0)},Graphics.prototype.lineStyle=function(thickness,color,alpha,pixelHinting,scaleMode,caps,joints,miterLimit){"undefined"==typeof thickness&&(thickness=0),"undefined"==typeof color&&(color=0),"undefined"==typeof alpha&&(alpha=1),"undefined"==typeof pixelHinting&&(pixelHinting=!1),"undefined"==typeof scaleMode&&(scaleMode=null),"undefined"==typeof caps&&(caps=null),"undefined"==typeof joints&&(joints=null),"undefined"==typeof miterLimit&&(miterLimit=3)},Graphics.prototype.lineTo=function(){},Graphics.prototype.moveTo=function(){},Graphics}();base.Graphics=Graphics}(away.base||(away.base={}));away.base}(away||(away={}));var away;!function(away){!function(base){var GraphicsPathWinding=function(){function GraphicsPathWinding(){}return GraphicsPathWinding.EVEN_ODD="evenOdd",GraphicsPathWinding.NON_ZERO="nonZero",GraphicsPathWinding}();base.GraphicsPathWinding=GraphicsPathWinding}(away.base||(away.base={}));away.base}(away||(away={}));var away;!function(away){!function(){}(away.base||(away.base={}));away.base}(away||(away={}));var away;!function(away){!function(base){var InterpolationMethod=function(){function InterpolationMethod(){}return InterpolationMethod.LINEAR_RGB="linearRGB",InterpolationMethod.RGB="rgb",InterpolationMethod}();base.InterpolationMethod=InterpolationMethod}(away.base||(away.base={}));away.base}(away||(away={}));var away;!function(away){!function(){}(away.base||(away.base={}));away.base}(away||(away={}));var away;!function(away){!function(){}(away.base||(away.base={}));away.base}(away||(away={}));var away;!function(away){!function(base){var SubGeometryBase=function(_super){function SubGeometryBase(concatenatedArrays){_super.call(this),this._pStrideOffsetDirty=!0,this._pConcatenateArrays=!0,this._pStride=new Object,this._pOffset=new Object,this._pConcatenateArrays=concatenatedArrays}return __extends(SubGeometryBase,_super),SubGeometryBase.prototype._pUpdateStrideOffset=function(){throw new away.errors.AbstractMethodError},Object.defineProperty(SubGeometryBase.prototype,"subMeshClass",{get:function(){return this._pSubMeshClass},enumerable:!0,configurable:!0}),Object.defineProperty(SubGeometryBase.prototype,"concatenateArrays",{get:function(){return this._pConcatenateArrays},set:function(value){this._pConcatenateArrays!=value&&(this._pConcatenateArrays=value,this._pStrideOffsetDirty=!0,value&&this._pNotifyVerticesUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(SubGeometryBase.prototype,"indices",{get:function(){return this._pIndices},enumerable:!0,configurable:!0}),Object.defineProperty(SubGeometryBase.prototype,"vertices",{get:function(){return this.updateVertices(),this._pVertices},enumerable:!0,configurable:!0}),Object.defineProperty(SubGeometryBase.prototype,"numTriangles",{get:function(){return this._numTriangles},enumerable:!0,configurable:!0}),Object.defineProperty(SubGeometryBase.prototype,"numVertices",{get:function(){return this._pNumVertices},enumerable:!0,configurable:!0}),SubGeometryBase.prototype.getStride=function(dataType){return this._pStrideOffsetDirty&&this._pUpdateStrideOffset(),this._pStride[dataType]},SubGeometryBase.prototype.getOffset=function(dataType){return this._pStrideOffsetDirty&&this._pUpdateStrideOffset(),this._pOffset[dataType]},SubGeometryBase.prototype.updateVertices=function(){throw new away.errors.AbstractMethodError},SubGeometryBase.prototype.dispose=function(){this._pIndices=null,this._pVertices=null},SubGeometryBase.prototype.updateIndices=function(indices){this._pIndices=indices,this._numIndices=indices.length,this._numTriangles=this._numIndices/3,this.notifyIndicesUpdate()},SubGeometryBase.prototype.pInvalidateBounds=function(){this.parentGeometry&&this.parentGeometry.iInvalidateBounds(this)},SubGeometryBase.prototype.clone=function(){throw new away.errors.AbstractMethodError},SubGeometryBase.prototype.applyTransformation=function(){},SubGeometryBase.prototype.scale=function(){},SubGeometryBase.prototype.scaleUV=function(scaleU,scaleV){"undefined"==typeof scaleU&&(scaleU=1),"undefined"==typeof scaleV&&(scaleV=1)},SubGeometryBase.prototype.getBoundingPositions=function(){throw new away.errors.AbstractMethodError},SubGeometryBase.prototype.notifyIndicesUpdate=function(){this._indicesUpdated||(this._indicesUpdated=new away.events.SubGeometryEvent(away.events.SubGeometryEvent.INDICES_UPDATED)),this.dispatchEvent(this._indicesUpdated)},SubGeometryBase.prototype._pNotifyVerticesUpdate=function(){throw new away.errors.AbstractMethodError},SubGeometryBase.VERTEX_DATA="vertices",SubGeometryBase}(away.library.NamedAssetBase);base.SubGeometryBase=SubGeometryBase}(away.base||(away.base={}));away.base}(away||(away={}));var away;!function(away){!function(base){var SubMeshBase=function(_super){function SubMeshBase(){_super.call(this),this._iIndex=0,this._renderables=new Array}return __extends(SubMeshBase,_super),Object.defineProperty(SubMeshBase.prototype,"animator",{get:function(){return this._pParentMesh.animator},enumerable:!0,configurable:!0}),Object.defineProperty(SubMeshBase.prototype,"material",{get:function(){return this._material||this._pParentMesh.material},set:function(value){this.material&&this.material.iRemoveOwner(this),this._material=value,this.material&&this.material.iAddOwner(this)},enumerable:!0,configurable:!0}),Object.defineProperty(SubMeshBase.prototype,"sceneTransform",{get:function(){return this._pParentMesh.sceneTransform},enumerable:!0,configurable:!0}),Object.defineProperty(SubMeshBase.prototype,"parentMesh",{get:function(){return this._pParentMesh},enumerable:!0,configurable:!0}),Object.defineProperty(SubMeshBase.prototype,"uvTransform",{get:function(){return this._uvTransform||this._pParentMesh.uvTransform},set:function(value){this._uvTransform=value},enumerable:!0,configurable:!0}),SubMeshBase.prototype.dispose=function(){this.material=null;for(var len=this._renderables.length,i=0;len>i;i++)this._renderables[i].dispose()},SubMeshBase.prototype.getRenderSceneTransform=function(camera){return this._pParentMesh.getRenderSceneTransform(camera)},SubMeshBase.prototype._iAddRenderable=function(renderable){return this._renderables.push(renderable),renderable},SubMeshBase.prototype._iRemoveRenderable=function(renderable){var index=this._renderables.indexOf(renderable);return this._renderables.splice(index,1),renderable},SubMeshBase.prototype._iInvalidateRenderableGeometry=function(){for(var len=this._renderables.length,i=0;len>i;i++)this._renderables[i].invalidateGeometry()},SubMeshBase.prototype._iCollectRenderable=function(){throw new away.errors.AbstractMethodError},SubMeshBase.prototype._iGetExplicitMaterial=function(){return this._material},SubMeshBase}(away.library.NamedAssetBase);base.SubMeshBase=SubMeshBase}(away.base||(away.base={}));away.base}(away||(away={}));var away;!function(away){!function(base){var JointStyle=function(){function JointStyle(){}return JointStyle.BEVEL="bevel",JointStyle.MITER="miter",JointStyle.ROUND="round",JointStyle}();base.JointStyle=JointStyle}(away.base||(away.base={}));away.base}(away||(away={}));var away;!function(away){!function(base){var LineScaleMode=function(){function LineScaleMode(){}return LineScaleMode.HORIZONTAL="horizontal",LineScaleMode.NONE="none",LineScaleMode.NORMAL="normal",LineScaleMode.VERTICAL="vertical",LineScaleMode}();base.LineScaleMode=LineScaleMode}(away.base||(away.base={}));away.base}(away||(away={}));var away;!function(away){!function(base){var LineSubGeometry=function(_super){function LineSubGeometry(){_super.call(this,!0),this._positionsDirty=!0,this._boundingPositionDirty=!0,this._thicknessDirty=!0,this._colorsDirty=!0,this._pSubMeshClass=base.LineSubMesh}return __extends(LineSubGeometry,_super),LineSubGeometry.prototype._pUpdateStrideOffset=function(){this._pOffset[LineSubGeometry.VERTEX_DATA]=0;var stride=0;this._pOffset[LineSubGeometry.START_POSITION_DATA]=stride,stride+=3,this._pOffset[LineSubGeometry.END_POSITION_DATA]=stride,stride+=3,this._pOffset[LineSubGeometry.THICKNESS_DATA]=stride,stride+=1,this._pOffset[LineSubGeometry.COLOR_DATA]=stride,stride+=4,this._pStride[LineSubGeometry.VERTEX_DATA]=stride,this._pStride[LineSubGeometry.START_POSITION_DATA]=stride,this._pStride[LineSubGeometry.END_POSITION_DATA]=stride,this._pStride[LineSubGeometry.THICKNESS_DATA]=stride,this._pStride[LineSubGeometry.COLOR_DATA]=stride;var len=this._pNumVertices*stride;null==this._pVertices?this._pVertices=new Array(len):this._pVertices.length!=len&&(this._pVertices.length=len),this._pStrideOffsetDirty=!1},Object.defineProperty(LineSubGeometry.prototype,"vertices",{get:function(){return this._positionsDirty&&this.updatePositions(this._startPositions,this._endPositions),this._thicknessDirty&&this.updateThickness(this._thickness),this._colorsDirty&&this.updateColors(this._startColors,this._endColors),this._pVertices},enumerable:!0,configurable:!0}),Object.defineProperty(LineSubGeometry.prototype,"startPositions",{get:function(){return this._positionsDirty&&this.updatePositions(this._startPositions,this._endPositions),this._startPositions},enumerable:!0,configurable:!0}),Object.defineProperty(LineSubGeometry.prototype,"endPositions",{get:function(){return this._positionsDirty&&this.updatePositions(this._startPositions,this._endPositions),this._endPositions},enumerable:!0,configurable:!0}),Object.defineProperty(LineSubGeometry.prototype,"thickness",{get:function(){return this._thicknessDirty&&this.updateThickness(this._thickness),this._thickness},enumerable:!0,configurable:!0}),Object.defineProperty(LineSubGeometry.prototype,"startColors",{get:function(){return this._colorsDirty&&this.updateColors(this._startColors,this._endColors),this._startColors},enumerable:!0,configurable:!0}),Object.defineProperty(LineSubGeometry.prototype,"endColors",{get:function(){return this._colorsDirty&&this.updateColors(this._startColors,this._endColors),this._endColors},enumerable:!0,configurable:!0}),Object.defineProperty(LineSubGeometry.prototype,"numSegments",{get:function(){return this._numSegments},enumerable:!0,configurable:!0}),LineSubGeometry.prototype.getBoundingPositions=function(){return this._boundingPositionDirty&&(this._boundingPositions=this.startPositions.concat(this.endPositions)),this._boundingPositions},LineSubGeometry.prototype.updatePositions=function(startValues,endValues){var i,j,values,index,stride,positions,indices;this._startPositions=startValues,null==this._startPositions&&(this._startPositions=new Array),this._endPositions=endValues,null==this._endPositions&&(this._endPositions=new Array),this._boundingPositionDirty=!0,this._numSegments=this._startPositions.length/3,this._pNumVertices=4*this._numSegments;var lenV=this._pNumVertices*this.getStride(LineSubGeometry.VERTEX_DATA);for(null==this._pVertices?this._pVertices=new Array(lenV):this._pVertices.length!=lenV&&(this._pVertices.length=lenV),i=0,j=0,index=this.getOffset(LineSubGeometry.START_POSITION_DATA),stride=this.getStride(LineSubGeometry.START_POSITION_DATA),positions=this._pVertices,indices=new Array;i>>24,(16711680&this._color)>>>16,(65280&this._color)>>>8,255&this._color),this._bufferClear=!0)},Stage.prototype.addEventListener=function(type,listener){_super.prototype.addEventListener.call(this,type,listener)},Stage.prototype.removeEventListener=function(type,listener){_super.prototype.removeEventListener.call(this,type,listener)},Object.defineProperty(Stage.prototype,"scissorRect",{get:function(){return this._scissorRect},set:function(value){this._scissorRect=value,this._context.setScissorRectangle(this._scissorRect)},enumerable:!0,configurable:!0}),Object.defineProperty(Stage.prototype,"stageIndex",{get:function(){return this._stageIndex},enumerable:!0,configurable:!0}),Object.defineProperty(Stage.prototype,"usesSoftwareRendering",{get:function(){return this._usesSoftwareRendering},enumerable:!0,configurable:!0}),Object.defineProperty(Stage.prototype,"antiAlias",{get:function(){return this._antiAlias},set:function(antiAlias){this._antiAlias=antiAlias,this._backBufferDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(Stage.prototype,"viewPort",{get:function(){return this._viewportDirty=!1,this._viewPort},enumerable:!0,configurable:!0}),Object.defineProperty(Stage.prototype,"color",{get:function(){return this._color},set:function(color){this._color=color},enumerable:!0,configurable:!0}),Object.defineProperty(Stage.prototype,"bufferClear",{get:function(){return this._bufferClear},set:function(newBufferClear){this._bufferClear=newBufferClear},enumerable:!0,configurable:!0}),Stage.prototype.freeContext=function(){this._context&&(this._context.dispose(),this.dispatchEvent(new StageEvent(StageEvent.CONTEXT_DISPOSED))),this._context=null,this._initialised=!1},Stage.prototype.onEnterFrame=function(){this._context&&(this.clear(),this.notifyEnterFrame(),this._context||this._context.present(),this.notifyExitFrame())},Stage.prototype.recoverFromDisposal=function(){return this._context?!0:!1},Stage.prototype._callback=function(context){this._context=context,this._container=this._context.container,this._width&&this._height&&this._context.configureBackBuffer(this._width,this._height,this._antiAlias,this._enableDepthAndStencil),this.dispatchEvent(new StageEvent(this._initialised?StageEvent.CONTEXT_RECREATED:StageEvent.CONTEXT_CREATED)),this._initialised=!0},Stage}(away.events.EventDispatcher);base.Stage=Stage}(away.base||(away.base={}));away.base}(away||(away={}));var away;!function(away){!function(base){var TriangleCulling=function(){function TriangleCulling(){}return TriangleCulling.NEGATIVE="negative",TriangleCulling.NONE="none",TriangleCulling.POSITIVE="positive",TriangleCulling}();base.TriangleCulling=TriangleCulling}(away.base||(away.base={}));away.base}(away||(away={}));var away;!function(away){!function(base){var SubGeometryEvent=away.events.SubGeometryEvent,TriangleSubGeometry=function(_super){function TriangleSubGeometry(concatenatedArrays){_super.call(this,concatenatedArrays),this._positionsDirty=!0,this._faceNormalsDirty=!0,this._faceTangentsDirty=!0,this._vertexNormalsDirty=!0,this._vertexTangentsDirty=!0,this._uvsDirty=!0,this._secondaryUVsDirty=!0,this._jointIndicesDirty=!0,this._jointWeightsDirty=!0,this._concatenateArrays=!0,this._autoDeriveNormals=!0,this._autoDeriveTangents=!0,this._autoDeriveUVs=!1,this._useFaceWeights=!1,this._scaleU=1,this._scaleV=1,this._pSubMeshClass=base.TriangleSubMesh}return __extends(TriangleSubGeometry,_super),Object.defineProperty(TriangleSubGeometry.prototype,"scaleU",{get:function(){return this._scaleU},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleSubGeometry.prototype,"scaleV",{get:function(){return this._scaleV},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleSubGeometry.prototype,"useCondensedIndices",{get:function(){return this._useCondensedIndices},set:function(value){this._useCondensedIndices!=value&&(this._useCondensedIndices=value,this.notifyJointIndicesUpdate())},enumerable:!0,configurable:!0}),TriangleSubGeometry.prototype._pUpdateStrideOffset=function(){if(this._concatenateArrays){this._pOffset[TriangleSubGeometry.VERTEX_DATA]=0,this._pOffset[TriangleSubGeometry.POSITION_DATA]=0;var stride=3;null!=this._vertexNormals&&(this._pOffset[TriangleSubGeometry.NORMAL_DATA]=stride,stride+=3),null!=this._vertexTangents&&(this._pOffset[TriangleSubGeometry.TANGENT_DATA]=stride,stride+=3),null!=this._uvs&&(this._pOffset[TriangleSubGeometry.UV_DATA]=stride,stride+=2),null!=this._secondaryUVs&&(this._pOffset[TriangleSubGeometry.SECONDARY_UV_DATA]=stride,stride+=2),null!=this._jointIndices&&(this._pOffset[TriangleSubGeometry.JOINT_INDEX_DATA]=stride,stride+=this._jointsPerVertex),null!=this._jointWeights&&(this._pOffset[TriangleSubGeometry.JOINT_WEIGHT_DATA]=stride,stride+=this._jointsPerVertex),this._pStride[TriangleSubGeometry.VERTEX_DATA]=stride,this._pStride[TriangleSubGeometry.POSITION_DATA]=stride,this._pStride[TriangleSubGeometry.NORMAL_DATA]=stride,this._pStride[TriangleSubGeometry.TANGENT_DATA]=stride,this._pStride[TriangleSubGeometry.UV_DATA]=stride,this._pStride[TriangleSubGeometry.SECONDARY_UV_DATA]=stride,this._pStride[TriangleSubGeometry.JOINT_INDEX_DATA]=stride,this._pStride[TriangleSubGeometry.JOINT_WEIGHT_DATA]=stride;var len=this._pNumVertices*stride;null==this._pVertices?this._pVertices=new Array(len):this._pVertices.length!=len&&(this._pVertices.length=len)}else this._pOffset[TriangleSubGeometry.POSITION_DATA]=0,this._pOffset[TriangleSubGeometry.NORMAL_DATA]=0,this._pOffset[TriangleSubGeometry.TANGENT_DATA]=0,this._pOffset[TriangleSubGeometry.UV_DATA]=0,this._pOffset[TriangleSubGeometry.SECONDARY_UV_DATA]=0,this._pOffset[TriangleSubGeometry.JOINT_INDEX_DATA]=0,this._pOffset[TriangleSubGeometry.JOINT_WEIGHT_DATA]=0,this._pStride[TriangleSubGeometry.POSITION_DATA]=3,this._pStride[TriangleSubGeometry.NORMAL_DATA]=3,this._pStride[TriangleSubGeometry.TANGENT_DATA]=3,this._pStride[TriangleSubGeometry.UV_DATA]=2,this._pStride[TriangleSubGeometry.SECONDARY_UV_DATA]=2,this._pStride[TriangleSubGeometry.JOINT_INDEX_DATA]=this._jointsPerVertex,this._pStride[TriangleSubGeometry.JOINT_WEIGHT_DATA]=this._jointsPerVertex;this._pStrideOffsetDirty=!1},Object.defineProperty(TriangleSubGeometry.prototype,"jointsPerVertex",{get:function(){return this._jointsPerVertex},set:function(value){this._jointsPerVertex!=value&&(this._jointsPerVertex=value,this._pStrideOffsetDirty=!0,this._pConcatenateArrays&&this._pNotifyVerticesUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleSubGeometry.prototype,"autoDeriveUVs",{get:function(){return this._autoDeriveUVs},set:function(value){this._autoDeriveUVs!=value&&(this._autoDeriveUVs=value,value&&this.notifyUVsUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleSubGeometry.prototype,"autoDeriveNormals",{get:function(){return this._autoDeriveNormals},set:function(value){this._autoDeriveNormals!=value&&(this._autoDeriveNormals=value,value&&this.notifyNormalsUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleSubGeometry.prototype,"autoDeriveTangents",{get:function(){return this._autoDeriveTangents},set:function(value){this._autoDeriveTangents!=value&&(this._autoDeriveTangents=value,value&&this.notifyTangentsUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleSubGeometry.prototype,"vertices",{get:function(){return this._positionsDirty&&this.updatePositions(this._positions),this._vertexNormalsDirty&&this.updateVertexNormals(this._vertexNormals),this._vertexTangentsDirty&&this.updateVertexTangents(this._vertexTangents),this._uvsDirty&&this.updateUVs(this._uvs),this._secondaryUVsDirty&&this.updateSecondaryUVs(this._secondaryUVs),this._jointIndicesDirty&&this.updateJointIndices(this._jointIndices),this._jointWeightsDirty&&this.updateJointWeights(this._jointWeights),this._pVertices},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleSubGeometry.prototype,"positions",{get:function(){return this._positionsDirty&&this.updatePositions(this._positions),this._positions},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleSubGeometry.prototype,"vertexNormals",{get:function(){return this._vertexNormalsDirty&&this.updateVertexNormals(this._vertexNormals),this._vertexNormals},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleSubGeometry.prototype,"vertexTangents",{get:function(){return this._vertexTangentsDirty&&this.updateVertexTangents(this._vertexTangents),this._vertexTangents},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleSubGeometry.prototype,"faceNormals",{get:function(){return this._faceNormalsDirty&&this.updateFaceNormals(),this._faceNormals},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleSubGeometry.prototype,"faceTangents",{get:function(){return this._faceTangentsDirty&&this.updateFaceTangents(),this._faceTangents},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleSubGeometry.prototype,"uvs",{get:function(){return this._uvsDirty&&this.updateUVs(this._uvs),this._uvs},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleSubGeometry.prototype,"secondaryUVs",{get:function(){return this._secondaryUVsDirty&&this.updateSecondaryUVs(this._secondaryUVs),this._secondaryUVs},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleSubGeometry.prototype,"jointIndices",{get:function(){return this._jointIndicesDirty&&this.updateJointIndices(this._jointIndices),this._useCondensedIndices?this._condensedJointIndices:this._jointIndices},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleSubGeometry.prototype,"jointWeights",{get:function(){return this._jointWeightsDirty&&this.updateJointWeights(this._jointWeights),this._jointWeights},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleSubGeometry.prototype,"useFaceWeights",{get:function(){return this._useFaceWeights},set:function(value){this._useFaceWeights!=value&&(this._useFaceWeights=value,this._autoDeriveNormals&&this.notifyNormalsUpdate(),this._autoDeriveTangents&&this.notifyTangentsUpdate(),this._faceNormalsDirty=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleSubGeometry.prototype,"numCondensedJoints",{get:function(){return this._jointIndicesDirty&&this.updateJointIndices(this._jointIndices),this._numCondensedJoints},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleSubGeometry.prototype,"condensedIndexLookUp",{get:function(){return this._jointIndicesDirty&&this.updateJointIndices(this._jointIndices),this._condensedIndexLookUp},enumerable:!0,configurable:!0}),TriangleSubGeometry.prototype.getBoundingPositions=function(){return this._positionsDirty&&this.updatePositions(this._positions),this._positions},TriangleSubGeometry.prototype.updatePositions=function(values){var i,index,stride,positions;if(this._positions=values,null==this._positions&&(this._positions=new Array),this._pNumVertices=this._positions.length/3,this._concatenateArrays){var len=this._pNumVertices*this.getStride(TriangleSubGeometry.VERTEX_DATA);for(null==this._pVertices?this._pVertices=new Array(len):this._pVertices.length!=len&&(this._pVertices.length=len),i=0,index=this.getOffset(TriangleSubGeometry.POSITION_DATA),stride=this.getStride(TriangleSubGeometry.POSITION_DATA),positions=this._pVertices;iindex;)normals[index]=0,normals[index+1]=0,normals[index+2]=0,index+=stride;var weight,k=0,lenI=this._pIndices.length;for(i=0;lenI>i;)weight=this._useFaceWeights?this._faceWeights[k++]:1,index=offset+this._pIndices[i++]*stride,normals[index]+=this._faceNormals[f1]*weight,normals[index+1]+=this._faceNormals[f2]*weight,normals[index+2]+=this._faceNormals[f3]*weight,index=offset+this._pIndices[i++]*stride,normals[index]+=this._faceNormals[f1]*weight,normals[index+1]+=this._faceNormals[f2]*weight,normals[index+2]+=this._faceNormals[f3]*weight,index=offset+this._pIndices[i++]*stride,normals[index]+=this._faceNormals[f1]*weight,normals[index+1]+=this._faceNormals[f2]*weight,normals[index+2]+=this._faceNormals[f3]*weight,f1+=3,f2+=3,f3+=3;for(i=0,index=offset;lenV>index;){var vx=normals[index],vy=normals[index+1],vz=normals[index+2],d=1/Math.sqrt(vx*vx+vy*vy+vz*vz);this._concatenateArrays?(this._vertexNormals[i++]=normals[index]=vx*d,this._vertexNormals[i++]=normals[index+1]=vy*d,this._vertexNormals[i++]=normals[index+2]=vz*d):(normals[index]=vx*d,normals[index+1]=vy*d,normals[index+2]=vz*d),index+=stride}}else if(null!=this._vertexNormals&&null!=values||null==this._vertexNormals&&null==values||(this._concatenateArrays?this._pNotifyVerticesUpdate():this._pStrideOffsetDirty=!0),this._vertexNormals=values,null!=values&&this._concatenateArrays)for(i=0,index=this.getOffset(TriangleSubGeometry.NORMAL_DATA),stride=this.getStride(TriangleSubGeometry.NORMAL_DATA),normals=this._pVertices;iindex;)tangents[index]=0,tangents[index+1]=0,tangents[index+2]=0,index+=stride;var weight,k=0,f1=0,f2=1,f3=2;i=0;for(var lenI=this._pIndices.length;lenI>i;)weight=this._useFaceWeights?this._faceWeights[k++]:1,index=offset+this._pIndices[i++]*stride,tangents[index++]+=this._faceTangents[f1]*weight,tangents[index++]+=this._faceTangents[f2]*weight,tangents[index]+=this._faceTangents[f3]*weight,index=offset+this._pIndices[i++]*stride,tangents[index++]+=this._faceTangents[f1]*weight,tangents[index++]+=this._faceTangents[f2]*weight,tangents[index]+=this._faceTangents[f3]*weight,index=offset+this._pIndices[i++]*stride,tangents[index++]+=this._faceTangents[f1]*weight,tangents[index++]+=this._faceTangents[f2]*weight,tangents[index]+=this._faceTangents[f3]*weight,f1+=3,f2+=3,f3+=3;for(i=0,index=offset;lenV>index;){var vx=tangents[index],vy=tangents[index+1],vz=tangents[index+2],d=1/Math.sqrt(vx*vx+vy*vy+vz*vz);this._concatenateArrays?(this._vertexTangents[i++]=tangents[index]=vx*d,this._vertexTangents[i++]=tangents[index+1]=vy*d,this._vertexTangents[i++]=tangents[index+2]=vz*d):(tangents[index]=vx*d,tangents[index+1]=vy*d,tangents[index+2]=vz*d),index+=stride}}else if(null!=this._vertexTangents&&null!=values||null==this._vertexTangents&&null==values||(this._concatenateArrays?this._pNotifyVerticesUpdate():this._pStrideOffsetDirty=!0),this._vertexTangents=values,null!=values&&this._concatenateArrays)for(i=0,index=this.getOffset(TriangleSubGeometry.TANGENT_DATA),stride=this.getStride(TriangleSubGeometry.TANGENT_DATA),tangents=this._pVertices;iindex;)this._concatenateArrays?(this._uvs[i++]=uvs[index]=.5*uvIdx,this._uvs[i++]=uvs[index+1]=1-(1&uvIdx)):(uvs[index]=.5*uvIdx,uvs[index+1]=1-(1&uvIdx)),3==++uvIdx&&(uvIdx=0),index+=stride}else if(null!=this._uvs&&null!=values||null==this._uvs&&null==values||(this._concatenateArrays?this._pNotifyVerticesUpdate():this._pStrideOffsetDirty=!0),this._uvs=values,null!=values&&this._concatenateArrays)for(i=0,index=this.getOffset(TriangleSubGeometry.UV_DATA),stride=this.getStride(TriangleSubGeometry.UV_DATA),uvs=this._pVertices;iindex;)uvs[index]*=ratioU,uvs[index+1]*=ratioV,index+=stride;this.notifyUVsUpdate()},TriangleSubGeometry.prototype.scale=function(scale){var i,index,offset,stride,positions;positions=this._positions;var len=positions.length;for(offset=0,stride=3,i=0,index=offset;len>i;)positions[index]*=scale,positions[index+1]*=scale,positions[index+2]*=scale,i+=3,index+=stride;this.notifyPositionsUpdate()},TriangleSubGeometry.prototype.applyTransformation=function(transform){var positions,normals,tangents;this._concatenateArrays?(positions=this._pVertices,normals=this._pVertices,tangents=this._pVertices):(positions=this._positions,normals=this._vertexNormals,tangents=this._vertexTangents);var i,i1,i2,invTranspose,len=this._positions.length/3,vector=new away.geom.Vector3D,bakeNormals=null!=this._vertexNormals,bakeTangents=null!=this._vertexTangents;(bakeNormals||bakeTangents)&&(invTranspose=transform.clone(),invTranspose.invert(),invTranspose.transpose());var vi0=this.getOffset(TriangleSubGeometry.POSITION_DATA),ni0=this.getOffset(TriangleSubGeometry.NORMAL_DATA),ti0=this.getOffset(TriangleSubGeometry.TANGENT_DATA),vStride=this.getStride(TriangleSubGeometry.POSITION_DATA),nStride=this.getStride(TriangleSubGeometry.NORMAL_DATA),tStride=this.getStride(TriangleSubGeometry.TANGENT_DATA);for(i=0;len>i;++i)i1=vi0+1,i2=vi0+2,vector.x=positions[vi0],vector.y=positions[i1],vector.z=positions[i2],vector=transform.transformVector(vector),positions[vi0]=vector.x,positions[i1]=vector.y,positions[i2]=vector.z,vi0+=vStride,bakeNormals&&(i1=ni0+1,i2=ni0+2,vector.x=normals[ni0],vector.y=normals[i1],vector.z=normals[i2],vector=invTranspose.deltaTransformVector(vector),vector.normalize(),normals[ni0]=vector.x,normals[i1]=vector.y,normals[i2]=vector.z,ni0+=nStride),bakeTangents&&(i1=ti0+1,i2=ti0+2,vector.x=tangents[ti0],vector.y=tangents[i1],vector.z=tangents[i2],vector=invTranspose.deltaTransformVector(vector),vector.normalize(),tangents[ti0]=vector.x,tangents[i1]=vector.y,tangents[i2]=vector.z,ti0+=tStride); -this.notifyPositionsUpdate(),this.notifyNormalsUpdate(),this.notifyTangentsUpdate()},TriangleSubGeometry.prototype.updateFaceTangents=function(){var index1,index2,index3,vi,v0,dv1,dv2,denom,x0,y0,z0,dx1,dy1,dz1,dx2,dy2,dz2,cx,cy,cz,i=0,positions=this._positions,uvs=this._uvs,len=this._pIndices.length;for(null==this._faceTangents&&(this._faceTangents=new Array(len));len>i;)index1=this._pIndices[i],index2=this._pIndices[i+1],index3=this._pIndices[i+2],v0=uvs[2*index1+1],dv1=uvs[2*index2+1]-v0,dv2=uvs[2*index3+1]-v0,vi=3*index1,x0=positions[vi],y0=positions[vi+1],z0=positions[vi+2],vi=3*index2,dx1=positions[vi]-x0,dy1=positions[vi+1]-y0,dz1=positions[vi+2]-z0,vi=3*index3,dx2=positions[vi]-x0,dy2=positions[vi+1]-y0,dz2=positions[vi+2]-z0,cx=dv2*dx1-dv1*dx2,cy=dv2*dy1-dv1*dy2,cz=dv2*dz1-dv1*dz2,denom=1/Math.sqrt(cx*cx+cy*cy+cz*cz),this._faceTangents[i++]=denom*cx,this._faceTangents[i++]=denom*cy,this._faceTangents[i++]=denom*cz;this._faceTangentsDirty=!1},TriangleSubGeometry.prototype.updateFaceNormals=function(){var index,x1,x2,x3,y1,y2,y3,z1,z2,z3,dx1,dy1,dz1,dx2,dy2,dz2,cx,cy,cz,d,i=0,j=0,k=0,positions=this._positions,len=this._pIndices.length;for(null==this._faceNormals&&(this._faceNormals=new Array(len)),this._useFaceWeights&&null==this._faceWeights&&(this._faceWeights=new Array(len/3));len>i;){if(index=3*this._pIndices[i++],x1=positions[index],y1=positions[index+1],z1=positions[index+2],index=3*this._pIndices[i++],x2=positions[index],y2=positions[index+1],z2=positions[index+2],index=3*this._pIndices[i++],x3=positions[index],y3=positions[index+1],z3=positions[index+2],dx1=x3-x1,dy1=y3-y1,dz1=z3-z1,dx2=x2-x1,dy2=y2-y1,dz2=z2-z1,cx=dz1*dy2-dy1*dz2,cy=dx1*dz2-dz1*dx2,cz=dy1*dx2-dx1*dy2,d=Math.sqrt(cx*cx+cy*cy+cz*cz),this._useFaceWeights){var w=1e4*d;1>w&&(w=1),this._faceWeights[k++]=w}d=1/d,this._faceNormals[j++]=cx*d,this._faceNormals[j++]=cy*d,this._faceNormals[j++]=cz*d}this._faceNormalsDirty=!1},TriangleSubGeometry.prototype._pNotifyVerticesUpdate=function(){this._pStrideOffsetDirty=!0,this.notifyPositionsUpdate(),this.notifyNormalsUpdate(),this.notifyTangentsUpdate(),this.notifyUVsUpdate(),this.notifySecondaryUVsUpdate(),this.notifyJointIndicesUpdate(),this.notifyJointWeightsUpdate()},TriangleSubGeometry.prototype.notifyPositionsUpdate=function(){this._positionsDirty||(this._positionsDirty=!0,this._positionsUpdated||(this._positionsUpdated=new SubGeometryEvent(SubGeometryEvent.VERTICES_UPDATED,TriangleSubGeometry.POSITION_DATA)),this.dispatchEvent(this._positionsUpdated))},TriangleSubGeometry.prototype.notifyNormalsUpdate=function(){this._vertexNormalsDirty||(this._vertexNormalsDirty=!0,this._normalsUpdated||(this._normalsUpdated=new SubGeometryEvent(SubGeometryEvent.VERTICES_UPDATED,TriangleSubGeometry.NORMAL_DATA)),this.dispatchEvent(this._normalsUpdated))},TriangleSubGeometry.prototype.notifyTangentsUpdate=function(){this._vertexTangentsDirty||(this._vertexTangentsDirty=!0,this._tangentsUpdated||(this._tangentsUpdated=new SubGeometryEvent(SubGeometryEvent.VERTICES_UPDATED,TriangleSubGeometry.TANGENT_DATA)),this.dispatchEvent(this._tangentsUpdated))},TriangleSubGeometry.prototype.notifyUVsUpdate=function(){this._uvsDirty||(this._uvsDirty=!0,this._uvsUpdated||(this._uvsUpdated=new SubGeometryEvent(SubGeometryEvent.VERTICES_UPDATED,TriangleSubGeometry.UV_DATA)),this.dispatchEvent(this._uvsUpdated))},TriangleSubGeometry.prototype.notifySecondaryUVsUpdate=function(){this._secondaryUVsDirty||(this._secondaryUVsDirty=!0,this._secondaryUVsUpdated||(this._secondaryUVsUpdated=new SubGeometryEvent(SubGeometryEvent.VERTICES_UPDATED,TriangleSubGeometry.SECONDARY_UV_DATA)),this.dispatchEvent(this._secondaryUVsUpdated))},TriangleSubGeometry.prototype.notifyJointIndicesUpdate=function(){this._jointIndicesDirty||(this._jointIndicesDirty=!0,this._jointIndicesUpdated||(this._jointIndicesUpdated=new SubGeometryEvent(SubGeometryEvent.VERTICES_UPDATED,TriangleSubGeometry.JOINT_INDEX_DATA)),this.dispatchEvent(this._jointIndicesUpdated))},TriangleSubGeometry.prototype.notifyJointWeightsUpdate=function(){this._jointWeightsDirty||(this._jointWeightsDirty=!0,this._jointWeightsUpdated||(this._jointWeightsUpdated=new SubGeometryEvent(SubGeometryEvent.VERTICES_UPDATED,TriangleSubGeometry.JOINT_WEIGHT_DATA)),this.dispatchEvent(this._jointWeightsUpdated))},TriangleSubGeometry.POSITION_DATA="positions",TriangleSubGeometry.NORMAL_DATA="vertexNormals",TriangleSubGeometry.TANGENT_DATA="vertexTangents",TriangleSubGeometry.UV_DATA="uvs",TriangleSubGeometry.SECONDARY_UV_DATA="secondaryUVs",TriangleSubGeometry.JOINT_INDEX_DATA="jointIndices",TriangleSubGeometry.JOINT_WEIGHT_DATA="jointWeights",TriangleSubGeometry.POSITION_FORMAT="float3",TriangleSubGeometry.NORMAL_FORMAT="float3",TriangleSubGeometry.TANGENT_FORMAT="float3",TriangleSubGeometry.UV_FORMAT="float2",TriangleSubGeometry.SECONDARY_UV_FORMAT="float2",TriangleSubGeometry}(base.SubGeometryBase);base.TriangleSubGeometry=TriangleSubGeometry}(away.base||(away.base={}));away.base}(away||(away={}));var away;!function(away){!function(base){var AssetType=away.library.AssetType,TriangleSubMesh=function(_super){function TriangleSubMesh(subGeometry,parentMesh,material){"undefined"==typeof material&&(material=null),_super.call(this),this._pParentMesh=parentMesh,this._subGeometry=subGeometry,this.material=material}return __extends(TriangleSubMesh,_super),Object.defineProperty(TriangleSubMesh.prototype,"assetType",{get:function(){return AssetType.TRIANGLE_SUB_MESH},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleSubMesh.prototype,"subGeometry",{get:function(){return this._subGeometry},enumerable:!0,configurable:!0}),TriangleSubMesh.prototype.dispose=function(){_super.prototype.dispose.call(this)},TriangleSubMesh.prototype._iCollectRenderable=function(renderer){renderer.applyTriangleSubMesh(this)},TriangleSubMesh}(base.SubMeshBase);base.TriangleSubMesh=TriangleSubMesh}(away.base||(away.base={}));away.base}(away||(away={}));var away;!function(away){!function(textures){var TextureProxyBase=function(_super){function TextureProxyBase(generateMipmaps){"undefined"==typeof generateMipmaps&&(generateMipmaps=!1),_super.call(this),this._pFormat="bgra",this._textureData=new Array,this._generateMipmaps=this._hasMipmaps=generateMipmaps}return __extends(TextureProxyBase,_super),Object.defineProperty(TextureProxyBase.prototype,"size",{get:function(){return this._pSize},enumerable:!0,configurable:!0}),Object.defineProperty(TextureProxyBase.prototype,"hasMipmaps",{get:function(){return this._hasMipmaps},enumerable:!0,configurable:!0}),Object.defineProperty(TextureProxyBase.prototype,"format",{get:function(){return this._pFormat},enumerable:!0,configurable:!0}),Object.defineProperty(TextureProxyBase.prototype,"generateMipmaps",{get:function(){return this._generateMipmaps},set:function(value){this._generateMipmaps!=value&&(this._generateMipmaps=this._hasMipmaps=value,this.invalidateContent())},enumerable:!0,configurable:!0}),Object.defineProperty(TextureProxyBase.prototype,"assetType",{get:function(){return away.library.AssetType.TEXTURE},enumerable:!0,configurable:!0}),TextureProxyBase.prototype.invalidateContent=function(){for(var len=this._textureData.length,i=0;len>i;i++)this._textureData[i].invalidate()},TextureProxyBase.prototype.invalidateSize=function(){for(;this._textureData.length;)this._textureData[0].dispose()},TextureProxyBase.prototype.dispose=function(){for(;this._textureData.length;)this._textureData[0].dispose()},TextureProxyBase.prototype._iAddTextureData=function(textureData){return this._textureData.push(textureData),textureData},TextureProxyBase.prototype._iRemoveTextureData=function(textureData){return this._textureData.splice(this._textureData.indexOf(textureData),1),textureData},TextureProxyBase}(away.library.NamedAssetBase);textures.TextureProxyBase=TextureProxyBase}(away.textures||(away.textures={}));away.textures}(away||(away={}));var away;!function(away){!function(textures){var Texture2DBase=function(_super){function Texture2DBase(generateMipmaps){"undefined"==typeof generateMipmaps&&(generateMipmaps=!1),_super.call(this,generateMipmaps)}return __extends(Texture2DBase,_super),Object.defineProperty(Texture2DBase.prototype,"width",{get:function(){return this._pWidth},enumerable:!0,configurable:!0}),Object.defineProperty(Texture2DBase.prototype,"height",{get:function(){return this._pHeight},enumerable:!0,configurable:!0}),Object.defineProperty(Texture2DBase.prototype,"size",{get:function(){return this._pWidth},enumerable:!0,configurable:!0}),Texture2DBase.prototype.dispose=function(){if(_super.prototype.dispose.call(this),this._mipmapData)for(var len=this._mipmapData.length,i=0;len>i;i++)textures.MipmapGenerator.freeMipMapHolder(this._mipmapData[i])},Texture2DBase.prototype.invalidateContent=function(){_super.prototype.invalidateContent.call(this),this._mipmapDataDirty=!0},Texture2DBase.prototype._pSetSize=function(width,height){(this._pWidth!=width||this._pHeight!=height)&&this.invalidateSize(),this._mipmapDataDirty=!0,this._pWidth=width,this._pHeight=height},Texture2DBase.prototype._iGetMipmapData=function(){return this._mipmapDataDirty&&(this._mipmapDataDirty=!1,this._mipmapData||(this._mipmapData=new Array),away.textures.MipmapGenerator.generateMipMaps(this._iGetTextureData(),this._mipmapData,!0)),this._mipmapData},Texture2DBase.prototype._iGetTextureData=function(){throw new away.errors.AbstractMethodError},Texture2DBase}(textures.TextureProxyBase);textures.Texture2DBase=Texture2DBase}(away.textures||(away.textures={}));away.textures}(away||(away={}));var away;!function(away){!function(textures){var AbstractMethodError=away.errors.AbstractMethodError,CubeTextureBase=function(_super){function CubeTextureBase(generateMipmaps){"undefined"==typeof generateMipmaps&&(generateMipmaps=!1),_super.call(this,generateMipmaps),this._mipmapDataArray=new Array(6),this._mipmapDataDirtyArray=new Array(6)}return __extends(CubeTextureBase,_super),CubeTextureBase.prototype._pSetSize=function(size){this._pSize!=size&&this.invalidateSize();for(var i=0;6>i;i++)this._mipmapDataDirtyArray[i]=!0;this._pSize=size},CubeTextureBase.prototype.dispose=function(){_super.prototype.dispose.call(this);for(var i=0;6>i;i++)for(var mipmapData=this._mipmapDataArray[i],len=mipmapData.length,j=0;len>j;j++)textures.MipmapGenerator.freeMipMapHolder(mipmapData[j])},CubeTextureBase.prototype.invalidateContent=function(){_super.prototype.invalidateContent.call(this);for(var i=0;6>i;i++)this._mipmapDataDirtyArray[i]=!0},CubeTextureBase.prototype._iGetMipmapData=function(side){if(this._mipmapDataDirtyArray[side]){this._mipmapDataDirtyArray[side]=!1;var mipmapData=this._mipmapDataArray[side]||(this._mipmapDataArray[side]=new Array);textures.MipmapGenerator.generateMipMaps(this._iGetTextureData(side),mipmapData,!0)}return this._mipmapDataArray[side]},CubeTextureBase.prototype._iGetTextureData=function(){throw new AbstractMethodError},CubeTextureBase}(textures.TextureProxyBase);textures.CubeTextureBase=CubeTextureBase}(away.textures||(away.textures={}));away.textures}(away||(away={}));var away;!function(away){!function(textures){var ImageTexture=function(_super){function ImageTexture(htmlImageElement,generateMipmaps){"undefined"==typeof generateMipmaps&&(generateMipmaps=!1),_super.call(this,generateMipmaps),this.htmlImageElement=htmlImageElement}return __extends(ImageTexture,_super),Object.defineProperty(ImageTexture.prototype,"htmlImageElement",{get:function(){return this._htmlImageElement},set:function(value){if(this._htmlImageElement!=value){if(!away.utils.TextureUtils.isHTMLImageElementValid(value))throw new away.errors.Error("Invalid bitmapData: Width and height must be power of 2 and cannot exceed 2048");this._htmlImageElement=value,this.invalidateContent(),this._pSetSize(value.width,value.height)}},enumerable:!0,configurable:!0}),ImageTexture.prototype._iGetTextureData=function(){return this._htmlImageElement},ImageTexture}(textures.Texture2DBase);textures.ImageTexture=ImageTexture}(away.textures||(away.textures={}));away.textures}(away||(away={}));var away;!function(away){!function(textures){var BitmapTexture=function(_super){function BitmapTexture(bitmapData,generateMipmaps){"undefined"==typeof generateMipmaps&&(generateMipmaps=!1),_super.call(this,generateMipmaps),this.bitmapData=bitmapData}return __extends(BitmapTexture,_super),Object.defineProperty(BitmapTexture.prototype,"bitmapData",{get:function(){return this._bitmapData},set:function(value){if(this._bitmapData!=value){if(!away.utils.TextureUtils.isBitmapDataValid(value))throw new Error("Invalid bitmapData: Width and height must be power of 2 and cannot exceed 2048");this._bitmapData=value,this.invalidateContent(),this._pSetSize(value.width,value.height)}},enumerable:!0,configurable:!0}),BitmapTexture.prototype.dispose=function(){_super.prototype.dispose.call(this),this._bitmapData.dispose(),this._bitmapData=null},BitmapTexture.prototype._iGetTextureData=function(){return this._bitmapData},BitmapTexture}(textures.Texture2DBase);textures.BitmapTexture=BitmapTexture}(away.textures||(away.textures={}));away.textures}(away||(away={}));var away;!function(away){!function(textures){var RenderTexture=function(_super){function RenderTexture(width,height){_super.call(this,!1),this._pSetSize(width,height)}return __extends(RenderTexture,_super),Object.defineProperty(RenderTexture.prototype,"width",{get:function(){return this._pWidth},set:function(value){if(value!=this._pWidth){if(!away.utils.TextureUtils.isDimensionValid(value))throw new Error("Invalid size: Width and height must be power of 2 and cannot exceed 2048");this.invalidateContent(),this._pSetSize(value,this._pHeight)}},enumerable:!0,configurable:!0}),Object.defineProperty(RenderTexture.prototype,"height",{get:function(){return this._pHeight},set:function(value){if(value!=this._pHeight){if(!away.utils.TextureUtils.isDimensionValid(value))throw new Error("Invalid size: Width and height must be power of 2 and cannot exceed 2048");this.invalidateContent(),this._pSetSize(this._pWidth,value)}},enumerable:!0,configurable:!0}),RenderTexture}(textures.Texture2DBase);textures.RenderTexture=RenderTexture}(away.textures||(away.textures={}));away.textures}(away||(away={}));var away;!function(away){!function(textures){var ImageCubeTexture=function(_super){function ImageCubeTexture(posX,negX,posY,negY,posZ,negZ,generateMipmaps){"undefined"==typeof generateMipmaps&&(generateMipmaps=!1),_super.call(this,generateMipmaps),this._htmlImageElements=new Array(6),this._testSize(this._htmlImageElements[0]=posX),this._testSize(this._htmlImageElements[1]=negX),this._testSize(this._htmlImageElements[2]=posY),this._testSize(this._htmlImageElements[3]=negY),this._testSize(this._htmlImageElements[4]=posZ),this._testSize(this._htmlImageElements[5]=negZ),this.invalidateContent(),this._pSetSize(posX.width)}return __extends(ImageCubeTexture,_super),Object.defineProperty(ImageCubeTexture.prototype,"positiveX",{get:function(){return this._htmlImageElements[0]},set:function(value){this._testSize(value),this.invalidateContent(),this._pSetSize(value.width),this._htmlImageElements[0]=value},enumerable:!0,configurable:!0}),Object.defineProperty(ImageCubeTexture.prototype,"negativeX",{get:function(){return this._htmlImageElements[1]},set:function(value){this._testSize(value),this.invalidateContent(),this._pSetSize(value.width),this._htmlImageElements[1]=value},enumerable:!0,configurable:!0}),Object.defineProperty(ImageCubeTexture.prototype,"positiveY",{get:function(){return this._htmlImageElements[2]},set:function(value){this._testSize(value),this.invalidateContent(),this._pSetSize(value.width),this._htmlImageElements[2]=value},enumerable:!0,configurable:!0}),Object.defineProperty(ImageCubeTexture.prototype,"negativeY",{get:function(){return this._htmlImageElements[3]},set:function(value){this._testSize(value),this.invalidateContent(),this._pSetSize(value.width),this._htmlImageElements[3]=value},enumerable:!0,configurable:!0}),Object.defineProperty(ImageCubeTexture.prototype,"positiveZ",{get:function(){return this._htmlImageElements[4]},set:function(value){this._testSize(value),this.invalidateContent(),this._pSetSize(value.width),this._htmlImageElements[4]=value},enumerable:!0,configurable:!0}),Object.defineProperty(ImageCubeTexture.prototype,"negativeZ",{get:function(){return this._htmlImageElements[5]},set:function(value){this._testSize(value),this.invalidateContent(),this._pSetSize(value.width),this._htmlImageElements[5]=value},enumerable:!0,configurable:!0}),ImageCubeTexture.prototype._testSize=function(value){if(value.width!=value.height)throw new Error("BitmapData should have equal width and height!");if(!away.utils.TextureUtils.isHTMLImageElementValid(value))throw new Error("Invalid bitmapData: Width and height must be power of 2 and cannot exceed 2048")},ImageCubeTexture.prototype._iGetTextureData=function(side){return this._htmlImageElements[side]},ImageCubeTexture}(textures.CubeTextureBase);textures.ImageCubeTexture=ImageCubeTexture}(away.textures||(away.textures={}));away.textures}(away||(away={}));var away;!function(away){!function(textures){var BitmapCubeTexture=function(_super){function BitmapCubeTexture(posX,negX,posY,negY,posZ,negZ,generateMipmaps){"undefined"==typeof generateMipmaps&&(generateMipmaps=!1),_super.call(this,generateMipmaps),this._bitmapDatas=new Array(6),this._testSize(this._bitmapDatas[0]=posX),this._testSize(this._bitmapDatas[1]=negX),this._testSize(this._bitmapDatas[2]=posY),this._testSize(this._bitmapDatas[3]=negY),this._testSize(this._bitmapDatas[4]=posZ),this._testSize(this._bitmapDatas[5]=negZ),this.invalidateContent(),this._pSetSize(posX.width)}return __extends(BitmapCubeTexture,_super),Object.defineProperty(BitmapCubeTexture.prototype,"positiveX",{get:function(){return this._bitmapDatas[0]},set:function(value){this._testSize(value),this.invalidateContent(),this._pSetSize(value.width),this._bitmapDatas[0]=value},enumerable:!0,configurable:!0}),Object.defineProperty(BitmapCubeTexture.prototype,"negativeX",{get:function(){return this._bitmapDatas[1]},set:function(value){this._testSize(value),this.invalidateContent(),this._pSetSize(value.width),this._bitmapDatas[1]=value},enumerable:!0,configurable:!0}),Object.defineProperty(BitmapCubeTexture.prototype,"positiveY",{get:function(){return this._bitmapDatas[2]},set:function(value){this._testSize(value),this.invalidateContent(),this._pSetSize(value.width),this._bitmapDatas[2]=value},enumerable:!0,configurable:!0}),Object.defineProperty(BitmapCubeTexture.prototype,"negativeY",{get:function(){return this._bitmapDatas[3]},set:function(value){this._testSize(value),this.invalidateContent(),this._pSetSize(value.width),this._bitmapDatas[3]=value},enumerable:!0,configurable:!0}),Object.defineProperty(BitmapCubeTexture.prototype,"positiveZ",{get:function(){return this._bitmapDatas[4]},set:function(value){this._testSize(value),this.invalidateContent(),this._pSetSize(value.width),this._bitmapDatas[4]=value},enumerable:!0,configurable:!0}),Object.defineProperty(BitmapCubeTexture.prototype,"negativeZ",{get:function(){return this._bitmapDatas[5]},set:function(value){this._testSize(value),this.invalidateContent(),this._pSetSize(value.width),this._bitmapDatas[5]=value},enumerable:!0,configurable:!0}),BitmapCubeTexture.prototype._testSize=function(value){if(value.width!=value.height)throw new Error("BitmapData should have equal width and height!");if(!away.utils.TextureUtils.isBitmapDataValid(value))throw new Error("Invalid bitmapData: Width and height must be power of 2 and cannot exceed 2048")},BitmapCubeTexture.prototype.dispose=function(){_super.prototype.dispose.call(this);for(var len=this._bitmapDatas.length,i=0;len>i;i++)this._bitmapDatas[i].dispose(),this._bitmapDatas[i]=null;this._bitmapDatas=null},BitmapCubeTexture.prototype._iGetTextureData=function(side){return this._bitmapDatas[side]},BitmapCubeTexture}(textures.CubeTextureBase);textures.BitmapCubeTexture=BitmapCubeTexture}(away.textures||(away.textures={}));away.textures}(away||(away={}));var away;!function(away){!function(textures){var BitmapData=away.base.BitmapData,Matrix=away.geom.Matrix,Rectangle=away.geom.Rectangle,MipmapGenerator=function(){function MipmapGenerator(){}return MipmapGenerator.generateMipMaps=function(source,output,alpha){"undefined"==typeof alpha&&(alpha=!1);var mipmap,w=source.width,h=source.height,i=0;for(MipmapGenerator._rect.width=w,MipmapGenerator._rect.height=h;w>=1&&h>=1;)mipmap=output[i]=MipmapGenerator._getMipmapHolder(output[i],w,h),alpha&&mipmap.fillRect(MipmapGenerator._rect,0),MipmapGenerator._matrix.a=MipmapGenerator._rect.width/source.width,MipmapGenerator._matrix.d=MipmapGenerator._rect.height/source.height,mipmap.draw(source,MipmapGenerator._matrix),w>>=1,h>>=1,MipmapGenerator._rect.width=w>1?w:1,MipmapGenerator._rect.height=h>1?h:1,i++},MipmapGenerator._getMipmapHolder=function(mipMapHolder,newW,newH){if(mipMapHolder){if(mipMapHolder.width==newW&&mipMapHolder.height==newH)return mipMapHolder;MipmapGenerator.freeMipMapHolder(mipMapHolder)}return MipmapGenerator._mipMaps[newW]||(MipmapGenerator._mipMaps[newW]=[],MipmapGenerator._mipMapUses[newW]=[]),MipmapGenerator._mipMaps[newW][newH]?(MipmapGenerator._mipMapUses[newW][newH]=MipmapGenerator._mipMapUses[newW][newH]+1,mipMapHolder=MipmapGenerator._mipMaps[newW][newH]):(mipMapHolder=MipmapGenerator._mipMaps[newW][newH]=new BitmapData(newW,newH,!0),MipmapGenerator._mipMapUses[newW][newH]=1),mipMapHolder},MipmapGenerator.freeMipMapHolder=function(mipMapHolder){var holderWidth=mipMapHolder.width,holderHeight=mipMapHolder.height;0==--MipmapGenerator._mipMapUses[holderWidth][holderHeight]&&(MipmapGenerator._mipMaps[holderWidth][holderHeight].dispose(),MipmapGenerator._mipMaps[holderWidth][holderHeight]=null)},MipmapGenerator._mipMaps=[],MipmapGenerator._mipMapUses=[],MipmapGenerator._matrix=new Matrix,MipmapGenerator._rect=new Rectangle,MipmapGenerator}();textures.MipmapGenerator=MipmapGenerator}(away.textures||(away.textures={}));away.textures}(away||(away={}));var away;!function(away){!function(textures){var BitmapData=away.base.BitmapData,BitmapDataChannel=away.base.BitmapDataChannel,Point=away.geom.Point,SpecularBitmapTexture=function(_super){function SpecularBitmapTexture(specularMap,glossMap,generateMipmaps){"undefined"==typeof specularMap&&(specularMap=null),"undefined"==typeof glossMap&&(glossMap=null),"undefined"==typeof generateMipmaps&&(generateMipmaps=!0);var bmd=specularMap?specularMap:glossMap;bmd=bmd?new BitmapData(bmd.width,bmd.height,!1,16777215):new BitmapData(1,1,!1,16777215),_super.call(this,bmd,generateMipmaps),this.specularMap=specularMap,this.glossMap=glossMap}return __extends(SpecularBitmapTexture,_super),Object.defineProperty(SpecularBitmapTexture.prototype,"specularMap",{get:function(){return this._specularMap},set:function(value){this._specularMap=value,this.invalidateContent(),this._testSize()},enumerable:!0,configurable:!0}),Object.defineProperty(SpecularBitmapTexture.prototype,"glossMap",{get:function(){return this._glossMap},set:function(value){this._glossMap=value,this.invalidateContent(),this._testSize()},enumerable:!0,configurable:!0}),SpecularBitmapTexture.prototype._testSize=function(){var w,h;if(this._specularMap?(w=this._specularMap.width,h=this._specularMap.height):this._glossMap?(w=this._glossMap.width,h=this._glossMap.height):(w=1,h=1),w!=this._bitmapData.width&&h!=this._bitmapData.height){var oldBitmap=this._bitmapData;this.bitmapData=new BitmapData(this._specularMap.width,this._specularMap.height,!1,16777215),oldBitmap.dispose()}},SpecularBitmapTexture.prototype._iGetTextureData=function(){var rect=this._specularMap.rect,origin=new Point;return this._bitmapData.fillRect(rect,16777215),this._glossMap&&this._bitmapData.copyChannel(this._glossMap,rect,origin,BitmapDataChannel.GREEN,BitmapDataChannel.GREEN),this._specularMap&&this._bitmapData.copyChannel(this._specularMap,rect,origin,BitmapDataChannel.RED,BitmapDataChannel.RED),this._bitmapData},SpecularBitmapTexture}(textures.BitmapTexture);textures.SpecularBitmapTexture=SpecularBitmapTexture}(away.textures||(away.textures={}));away.textures}(away||(away={}));var away;!function(away){!function(parsers){var AbstractMethodError=away.errors.AbstractMethodError,AssetEvent=away.events.AssetEvent,ParserEvent=away.events.ParserEvent,TimerEvent=away.events.TimerEvent,TextureUtils=away.utils.TextureUtils,Timer=away.utils.Timer,ParserBase=function(_super){function ParserBase(format){_super.call(this),this._materialMode=0,this._dataFormat=format,this._dependencies=new Array,this._pOnIntervalDelegate=away.utils.Delegate.create(this,this._pOnInterval)}return __extends(ParserBase,_super),ParserBase.supportsType=function(){throw new AbstractMethodError},Object.defineProperty(ParserBase.prototype,"content",{get:function(){return this._pContent},enumerable:!0,configurable:!0}),ParserBase.prototype.isBitmapDataValid=function(bitmapData){var isValid=TextureUtils.isBitmapDataValid(bitmapData);return isValid||console.log(">> Bitmap loaded is not having power of 2 dimensions or is higher than 2048"),isValid},Object.defineProperty(ParserBase.prototype,"parsingFailure",{get:function(){return this._parsingFailure},set:function(b){this._parsingFailure=b},enumerable:!0,configurable:!0}),Object.defineProperty(ParserBase.prototype,"parsingPaused",{get:function(){return this._parsingPaused},enumerable:!0,configurable:!0}),Object.defineProperty(ParserBase.prototype,"parsingComplete",{get:function(){return this._parsingComplete},enumerable:!0,configurable:!0}),Object.defineProperty(ParserBase.prototype,"materialMode",{get:function(){return this._materialMode},set:function(newMaterialMode){this._materialMode=newMaterialMode},enumerable:!0,configurable:!0}),Object.defineProperty(ParserBase.prototype,"data",{get:function(){return this._data},enumerable:!0,configurable:!0}),Object.defineProperty(ParserBase.prototype,"dataFormat",{get:function(){return this._dataFormat},enumerable:!0,configurable:!0}),ParserBase.prototype.parseAsync=function(data,frameLimit){"undefined"==typeof frameLimit&&(frameLimit=30),this._data=data,this._pStartParsing(frameLimit)},Object.defineProperty(ParserBase.prototype,"dependencies",{get:function(){return this._dependencies},enumerable:!0,configurable:!0}),ParserBase.prototype._iResolveDependency=function(){throw new AbstractMethodError},ParserBase.prototype._iResolveDependencyFailure=function(){throw new AbstractMethodError},ParserBase.prototype._iResolveDependencyName=function(resourceDependency,asset){return asset.name},ParserBase.prototype._iResumeParsingAfterDependencies=function(){this._parsingPaused=!1,this._timer&&this._timer.start()},ParserBase.prototype._pFinalizeAsset=function(asset,name){"undefined"==typeof name&&(name=null);null!=name&&(asset.name=name),asset.name||(asset.name=asset.assetType),this.dispatchEvent(new AssetEvent(AssetEvent.ASSET_COMPLETE,asset))},ParserBase.prototype._pProceedParsing=function(){throw new AbstractMethodError},ParserBase.prototype._pDieWithError=function(message){"undefined"==typeof message&&(message="Unknown parsing error"),this._timer&&(this._timer.removeEventListener(TimerEvent.TIMER,this._pOnIntervalDelegate),this._timer.stop(),this._timer=null),this.dispatchEvent(new ParserEvent(ParserEvent.PARSE_ERROR,message))},ParserBase.prototype._pAddDependency=function(id,req,retrieveAsRawData,data,suppressErrorEvents){"undefined"==typeof retrieveAsRawData&&(retrieveAsRawData=!1),"undefined"==typeof data&&(data=null),"undefined"==typeof suppressErrorEvents&&(suppressErrorEvents=!1);var dependency=new parsers.ResourceDependency(id,req,data,null,this,retrieveAsRawData,suppressErrorEvents);return this._dependencies.push(dependency),dependency},ParserBase.prototype._pPauseAndRetrieveDependencies=function(){this._timer&&this._timer.stop(),this._parsingPaused=!0,this.dispatchEvent(new ParserEvent(ParserEvent.READY_FOR_DEPENDENCIES))},ParserBase.prototype._pHasTime=function(){return away.utils.getTimer()-this._lastFrameTimei;i++)byteStr+=String.fromCharCode(bytes[i]);var base64Image=window.btoa(byteStr),str="data:image/png;base64,"+base64Image,img=new Image;return img.src=str,img},ParserUtils.byteArrayToImage=function(data){for(var byteStr="",bytes=new Uint8Array(data.arraybytes),len=bytes.byteLength,i=0;len>i;i++)byteStr+=String.fromCharCode(bytes[i]);var base64Image=window.btoa(byteStr),str="data:image/png;base64,"+base64Image,img=new Image;return img.src=str,img},ParserUtils.blobToImage=function(data){var URLObj=window.URL||window.webkitURL,src=URLObj.createObjectURL(data),img=new Image;return img.src=src,img},ParserUtils.toByteArray=function(data){var b=new ByteArray;return b.setArrayBuffer(data),b},ParserUtils.toString=function(data,length){if("undefined"==typeof length&&(length=0),"string"==typeof data){var s=data;if(null!=s.substr)return s.substr(0,s.length)}if(data instanceof ByteArray){var ba=data;return ba.position=0,ba.readUTFBytes(Math.min(ba.getBytesAvailable(),length))}return null},ParserUtils}();parsers.ParserUtils=ParserUtils}(away.parsers||(away.parsers={}));away.parsers}(away||(away={}));var away;!function(away){!function(parsers){var ResourceDependency=function(){function ResourceDependency(id,request,data,parser,parentParser,retrieveAsRawData,suppressAssetEvents){"undefined"==typeof retrieveAsRawData&&(retrieveAsRawData=!1),"undefined"==typeof suppressAssetEvents&&(suppressAssetEvents=!1),this._id=id,this._request=request,this._data=data,this._parser=parser,this._parentParser=parentParser,this._retrieveAsRawData=retrieveAsRawData,this._suppressAssetEvents=suppressAssetEvents,this._assets=new Array,this._dependencies=new Array}return Object.defineProperty(ResourceDependency.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(ResourceDependency.prototype,"request",{get:function(){return this._request},enumerable:!0,configurable:!0}),Object.defineProperty(ResourceDependency.prototype,"data",{get:function(){return this._data},enumerable:!0,configurable:!0}),Object.defineProperty(ResourceDependency.prototype,"parser",{get:function(){return this._parser},enumerable:!0,configurable:!0}),Object.defineProperty(ResourceDependency.prototype,"parentParser",{get:function(){return this._parentParser},enumerable:!0,configurable:!0}),Object.defineProperty(ResourceDependency.prototype,"retrieveAsRawData",{get:function(){return this._retrieveAsRawData},enumerable:!0,configurable:!0}),Object.defineProperty(ResourceDependency.prototype,"suppresAssetEvents",{get:function(){return this._suppressAssetEvents},enumerable:!0,configurable:!0}),Object.defineProperty(ResourceDependency.prototype,"assets",{get:function(){return this._assets},enumerable:!0,configurable:!0}),Object.defineProperty(ResourceDependency.prototype,"dependencies",{get:function(){return this._dependencies},enumerable:!0,configurable:!0}),ResourceDependency.prototype._iSetData=function(data){this._data=data},ResourceDependency.prototype._iSetParser=function(parser){this._parser=parser},ResourceDependency.prototype.resolve=function(){this._parentParser&&this._parentParser._iResolveDependency(this)},ResourceDependency.prototype.resolveFailure=function(){this._parentParser&&this._parentParser._iResolveDependencyFailure(this)},ResourceDependency.prototype.resolveName=function(asset){return this._parentParser?this._parentParser._iResolveDependencyName(this,asset):asset.name},ResourceDependency}();parsers.ResourceDependency=ResourceDependency}(away.parsers||(away.parsers={}));away.parsers}(away||(away={}));var away;!function(away){!function(library){var AssetLoaderContext=function(){function AssetLoaderContext(includeDependencies,dependencyBaseUrl){"undefined"==typeof includeDependencies&&(includeDependencies=!0),"undefined"==typeof dependencyBaseUrl&&(dependencyBaseUrl=null),this._includeDependencies=includeDependencies,this._dependencyBaseUrl=dependencyBaseUrl||"",this._embeddedDataByUrl={},this._remappedUrls={},this._materialMode=AssetLoaderContext.UNDEFINED}return Object.defineProperty(AssetLoaderContext.prototype,"includeDependencies",{get:function(){return this._includeDependencies},set:function(val){this._includeDependencies=val},enumerable:!0,configurable:!0}),Object.defineProperty(AssetLoaderContext.prototype,"materialMode",{get:function(){return this._materialMode},set:function(materialMode){this._materialMode=materialMode},enumerable:!0,configurable:!0}),Object.defineProperty(AssetLoaderContext.prototype,"dependencyBaseUrl",{get:function(){return this._dependencyBaseUrl},set:function(val){this._dependencyBaseUrl=val},enumerable:!0,configurable:!0}),Object.defineProperty(AssetLoaderContext.prototype,"overrideAbsolutePaths",{get:function(){return this._overrideAbsPath},set:function(val){this._overrideAbsPath=val},enumerable:!0,configurable:!0}),Object.defineProperty(AssetLoaderContext.prototype,"overrideFullURLs",{get:function(){return this._overrideFullUrls},set:function(val){this._overrideFullUrls=val},enumerable:!0,configurable:!0}),AssetLoaderContext.prototype.mapUrl=function(originalUrl,newUrl){this._remappedUrls[originalUrl]=newUrl},AssetLoaderContext.prototype.mapUrlToData=function(originalUrl,data){this._embeddedDataByUrl[originalUrl]=data},AssetLoaderContext.prototype._iHasDataForUrl=function(url){return this._embeddedDataByUrl.hasOwnProperty(url)},AssetLoaderContext.prototype._iGetDataForUrl=function(url){return this._embeddedDataByUrl[url]},AssetLoaderContext.prototype._iHasMappingForUrl=function(url){return this._remappedUrls.hasOwnProperty(url)},AssetLoaderContext.prototype._iGetRemappedUrl=function(originalUrl){return this._remappedUrls[originalUrl]},AssetLoaderContext.UNDEFINED=0,AssetLoaderContext.SINGLEPASS_MATERIALS=1,AssetLoaderContext.MULTIPASS_MATERIALS=2,AssetLoaderContext}();library.AssetLoaderContext=AssetLoaderContext}(away.library||(away.library={}));away.library}(away||(away={}));var away;!function(away){!function(library){var URLLoader=away.net.URLLoader,URLLoaderDataFormat=away.net.URLLoaderDataFormat,CubeTextureParser=away.parsers.CubeTextureParser,ResourceDependency=away.parsers.ResourceDependency,Texture2DParser=away.parsers.Texture2DParser,AssetLoader=function(_super){function AssetLoader(materialMode){"undefined"==typeof materialMode&&(materialMode=0),_super.call(this),this._materialMode=materialMode,this._stack=new Array,this._errorHandlers=new Array,this._parseErrorHandlers=new Array,this._onReadyForDependenciesDelegate=away.utils.Delegate.create(this,this.onReadyForDependencies),this._onParseCompleteDelegate=away.utils.Delegate.create(this,this.onParseComplete),this._onParseErrorDelegate=away.utils.Delegate.create(this,this.onParseError),this._onLoadCompleteDelegate=away.utils.Delegate.create(this,this.onLoadComplete),this._onLoadErrorDelegate=away.utils.Delegate.create(this,this.onLoadError),this._onTextureSizeErrorDelegate=away.utils.Delegate.create(this,this.onTextureSizeError),this._onAssetCompleteDelegate=away.utils.Delegate.create(this,this.onAssetComplete)}return __extends(AssetLoader,_super),AssetLoader.enableParser=function(parser){AssetLoader._parsers.indexOf(parser)<0&&AssetLoader._parsers.push(parser)},AssetLoader.enableParsers=function(parsers){for(var c=0;ci;i++)this._currentDependency.dependencies[i]=parserDependancies[i];parserDependancies.length=0,this._stack.push(this._currentDependency),this.retrieveNext()}},AssetLoader.prototype.resolveParserDependencies=function(){this._currentDependency._iSuccess=!0,this._currentDependency.parser&&this._currentDependency.parser.dependencies.length&&(!this._context||this._context.includeDependencies)?this.retrieveParserDependencies():this.retrieveNext()},AssetLoader.prototype.onLoadError=function(event){var handled,isDependency=this._currentDependency!=this._baseDependency,loader=event.target;if(this.removeEventListeners(loader),this.hasEventListener(away.events.IOErrorEvent.IO_ERROR))this.dispatchEvent(event),handled=!0;else{var i,len=this._errorHandlers.length;for(i=0;len>i;i++)handled||(handled=this._errorHandlers[i](event))}if(!handled)throw new away.errors.Error;return isDependency?(this._currentDependency.resolveFailure(),this.retrieveNext(),void 0):(this.dispose(),void 0)},AssetLoader.prototype.onParseError=function(event){var handled,loader=(this._currentDependency!=this._baseDependency,event.target);if(this.removeEventListeners(loader),this.hasEventListener(away.events.ParserEvent.PARSE_ERROR))this.dispatchEvent(event),handled=!0;else{var i,len=this._parseErrorHandlers.length;for(i=0;len>i;i++)handled||(handled=this._parseErrorHandlers[i](event))}if(handled)return this.dispose(),void 0;throw new away.errors.Error(event.message)},AssetLoader.prototype.onAssetComplete=function(event){this._currentDependency&&this._currentDependency.assets.push(event.asset),event.asset.resetAssetPath(event.asset.name,this._namespace),this._currentDependency.suppresAssetEvents||this.dispatchEvent(event)},AssetLoader.prototype.onReadyForDependencies=function(event){var parser=event.target;this._context&&!this._context.includeDependencies?parser._iResumeParsingAfterDependencies():this.retrieveParserDependencies()},AssetLoader.prototype.onLoadComplete=function(event){var loader=event.target;this.removeEventListeners(loader),this._currentDependency._iSetData(loader.data),this._currentDependency.retrieveAsRawData?this.resolveParserDependencies():this.parseDependency(this._currentDependency)},AssetLoader.prototype.onParseComplete=function(event){var parser=event.target;this.resolveParserDependencies(),parser.removeEventListener(away.events.ParserEvent.READY_FOR_DEPENDENCIES,this._onReadyForDependenciesDelegate),parser.removeEventListener(away.events.ParserEvent.PARSE_COMPLETE,this._onParseCompleteDelegate),parser.removeEventListener(away.events.ParserEvent.PARSE_ERROR,this._onParseErrorDelegate),parser.removeEventListener(away.events.AssetEvent.TEXTURE_SIZE_ERROR,this._onTextureSizeErrorDelegate),parser.removeEventListener(away.events.AssetEvent.ASSET_COMPLETE,this._onAssetCompleteDelegate)},AssetLoader.prototype.onTextureSizeError=function(event){event.asset.name=this._currentDependency.resolveName(event.asset),this.dispatchEvent(event)},AssetLoader.prototype.addEventListeners=function(loader){loader.addEventListener(away.events.Event.COMPLETE,this._onLoadCompleteDelegate),loader.addEventListener(away.events.IOErrorEvent.IO_ERROR,this._onLoadErrorDelegate)},AssetLoader.prototype.removeEventListeners=function(loader){loader.removeEventListener(away.events.Event.COMPLETE,this._onLoadCompleteDelegate),loader.removeEventListener(away.events.IOErrorEvent.IO_ERROR,this._onLoadErrorDelegate)},AssetLoader.prototype.stop=function(){this.dispose()},AssetLoader.prototype.dispose=function(){this._errorHandlers=null,this._parseErrorHandlers=null,this._context=null,this._token=null,this._stack=null,this._currentDependency&&this._currentDependency._iLoader&&this.removeEventListeners(this._currentDependency._iLoader),this._currentDependency=null},AssetLoader.prototype._iAddParseErrorHandler=function(handler){this._parseErrorHandlers.indexOf(handler)<0&&this._parseErrorHandlers.push(handler)},AssetLoader.prototype._iAddErrorHandler=function(handler){this._errorHandlers.indexOf(handler)<0&&this._errorHandlers.push(handler)},AssetLoader.prototype.getParserFromData=function(data){for(var len=AssetLoader._parsers.length,i=len-1;i>=0;i--)if(AssetLoader._parsers[i].supportsData(data))return new AssetLoader._parsers[i];return null},AssetLoader.prototype.parseDependency=function(dependency){var parser=dependency.parser;if(parser||dependency._iSetParser(parser=this.getParserFromData(dependency.data)),parser)parser.addEventListener(away.events.ParserEvent.READY_FOR_DEPENDENCIES,this._onReadyForDependenciesDelegate),parser.addEventListener(away.events.ParserEvent.PARSE_COMPLETE,this._onParseCompleteDelegate),parser.addEventListener(away.events.ParserEvent.PARSE_ERROR,this._onParseErrorDelegate),parser.addEventListener(away.events.AssetEvent.TEXTURE_SIZE_ERROR,this._onTextureSizeErrorDelegate),parser.addEventListener(away.events.AssetEvent.ASSET_COMPLETE,this._onAssetCompleteDelegate),dependency.request&&dependency.request.url&&(parser._iFileName=dependency.request.url),parser.materialMode=this._materialMode,parser.parseAsync(dependency.data);else{var message="No parser defined. To enable all parsers for auto-detection, use Parsers.enableAllBundled()";if(!this.hasEventListener(away.events.ParserEvent.PARSE_ERROR))throw new Error(message);this.dispatchEvent(new away.events.ParserEvent(away.events.ParserEvent.PARSE_ERROR,message))}},AssetLoader.prototype.getParserFromSuffix=function(url){for(var base=url.indexOf("?")>0?url.split("?")[0]:url,fileExtension=base.substr(base.lastIndexOf(".")+1).toLowerCase(),len=AssetLoader._parsers.length,i=len-1;i>=0;i--){var parserClass=AssetLoader._parsers[i];if(parserClass.supportsType(fileExtension))return new parserClass}return null},AssetLoader._parsers=new Array(Texture2DParser,CubeTextureParser),AssetLoader}(away.events.EventDispatcher);library.AssetLoader=AssetLoader}(away.library||(away.library={}));away.library}(away||(away={}));var away;!function(away){!function(library){var AssetLoaderToken=function(_super){function AssetLoaderToken(loader){_super.call(this),this._iLoader=loader}return __extends(AssetLoaderToken,_super),AssetLoaderToken.prototype.addEventListener=function(type,listener){this._iLoader.addEventListener(type,listener)},AssetLoaderToken.prototype.removeEventListener=function(type,listener){this._iLoader.removeEventListener(type,listener)},AssetLoaderToken.prototype.hasEventListener=function(type,listener){return"undefined"==typeof listener&&(listener=null),this._iLoader.hasEventListener(type,listener)},AssetLoaderToken}(away.events.EventDispatcher);library.AssetLoaderToken=AssetLoaderToken}(away.library||(away.library={}));away.library}(away||(away={}));var away;!function(away){!function(library){var IDUtil=function(){function IDUtil(){}return IDUtil.createUID=function(){var i,j,uid=new Array(36),index=0;for(i=0;8>i;i++)uid[index++]=IDUtil.ALPHA_CHAR_CODES[Math.floor(16*Math.random())];for(i=0;3>i;i++)for(uid[index++]=45,j=0;4>j;j++)uid[index++]=IDUtil.ALPHA_CHAR_CODES[Math.floor(16*Math.random())];uid[index++]=45;var time=(new Date).getTime(),timeString=("0000000"+time.toString(16).toUpperCase()).substr(-8);for(i=0;8>i;i++)uid[index++]=timeString.charCodeAt(i);for(i=0;4>i;i++)uid[index++]=IDUtil.ALPHA_CHAR_CODES[Math.floor(16*Math.random())];return String.fromCharCode.apply(null,uid)},IDUtil.ALPHA_CHAR_CODES=[48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70],IDUtil}();library.IDUtil=IDUtil}(away.library||(away.library={}));away.library}(away||(away={}));var away;!function(away){!function(library){var AssetLibraryIterator=function(){function AssetLibraryIterator(assets,assetTypeFilter,namespaceFilter,filterFunc){this._assets=assets,this.filter(assetTypeFilter,namespaceFilter,filterFunc)}return Object.defineProperty(AssetLibraryIterator.prototype,"currentAsset",{get:function(){return this._idxc;c++)asset=this._assets[c],assetTypeFilter&&asset.assetType!=assetTypeFilter||namespaceFilter&&asset.assetNamespace!=namespaceFilter||(null==filterFunc||filterFunc(asset))&&(this._filtered[idx++]=asset)}else this._filtered=this._assets},AssetLibraryIterator}();library.AssetLibraryIterator=AssetLibraryIterator}(away.library||(away.library={}));away.library}(away||(away={}));var away;!function(away){!function(library){var AbstractMethodError=away.errors.AbstractMethodError,ConflictStrategyBase=function(){function ConflictStrategyBase(){}return ConflictStrategyBase.prototype.resolveConflict=function(){throw new AbstractMethodError},ConflictStrategyBase.prototype.create=function(){throw new AbstractMethodError},ConflictStrategyBase.prototype._pUpdateNames=function(ns,nonConflictingName,oldAsset,newAsset,assetsDictionary,precedence){var loser_prev_name,winner,loser;winner=precedence===library.ConflictPrecedence.FAVOR_NEW?newAsset:oldAsset,loser=precedence===library.ConflictPrecedence.FAVOR_NEW?oldAsset:newAsset,loser_prev_name=loser.name,assetsDictionary[winner.name]=winner,assetsDictionary[nonConflictingName]=loser,loser.resetAssetPath(nonConflictingName,ns,!1),loser.dispatchEvent(new away.events.AssetEvent(away.events.AssetEvent.ASSET_CONFLICT_RESOLVED,loser,loser_prev_name))},ConflictStrategyBase}();library.ConflictStrategyBase=ConflictStrategyBase}(away.library||(away.library={}));away.library}(away||(away={}));var away;!function(away){!function(library){var NumSuffixConflictStrategy=function(_super){function NumSuffixConflictStrategy(separator){"undefined"==typeof separator&&(separator="."),_super.call(this),this._separator=separator,this._next_suffix={}}return __extends(NumSuffixConflictStrategy,_super),NumSuffixConflictStrategy.prototype.resolveConflict=function(changedAsset,oldAsset,assetsDictionary,precedence){var orig,new_name,base,suffix;orig=changedAsset.name,orig.indexOf(this._separator)>=0?(base=orig.substring(0,orig.lastIndexOf(this._separator)),suffix=parseInt(orig.substring(base.length-1)),isNaN(suffix)&&(base=orig,suffix=0)):(base=orig,suffix=0),0==suffix&&this._next_suffix.hasOwnProperty(base)&&(suffix=this._next_suffix[base]);do suffix++,new_name=base.concat(this._separator,suffix.toString());while(assetsDictionary.hasOwnProperty(new_name));this._next_suffix[base]=suffix,this._pUpdateNames(oldAsset.assetNamespace,new_name,oldAsset,changedAsset,assetsDictionary,precedence)},NumSuffixConflictStrategy.prototype.create=function(){return new NumSuffixConflictStrategy(this._separator)},NumSuffixConflictStrategy}(library.ConflictStrategyBase);library.NumSuffixConflictStrategy=NumSuffixConflictStrategy}(away.library||(away.library={}));away.library}(away||(away={}));var away;!function(away){!function(library){var IgnoreConflictStrategy=function(_super){function IgnoreConflictStrategy(){_super.call(this)}return __extends(IgnoreConflictStrategy,_super),IgnoreConflictStrategy.prototype.resolveConflict=function(){},IgnoreConflictStrategy.prototype.create=function(){return new IgnoreConflictStrategy},IgnoreConflictStrategy}(library.ConflictStrategyBase);library.IgnoreConflictStrategy=IgnoreConflictStrategy}(away.library||(away.library={}));away.library}(away||(away={}));var away;!function(away){!function(library){var ErrorConflictStrategy=function(_super){function ErrorConflictStrategy(){_super.call(this)}return __extends(ErrorConflictStrategy,_super),ErrorConflictStrategy.prototype.resolveConflict=function(changedAsset){throw new away.errors.Error("Asset name collision while AssetLibrary.namingStrategy set to AssetLibrary.THROW_ERROR. Asset path: "+changedAsset.assetFullPath)},ErrorConflictStrategy.prototype.create=function(){return new ErrorConflictStrategy},ErrorConflictStrategy}(library.ConflictStrategyBase);library.ErrorConflictStrategy=ErrorConflictStrategy}(away.library||(away.library={}));away.library}(away||(away={}));var away;!function(away){!function(library){var ConflictPrecedence=function(){function ConflictPrecedence(){}return ConflictPrecedence.FAVOR_OLD="favorOld",ConflictPrecedence.FAVOR_NEW="favorNew",ConflictPrecedence}();library.ConflictPrecedence=ConflictPrecedence}(away.library||(away.library={}));away.library}(away||(away={}));var away;!function(away){!function(library){var ConflictStrategy=function(){function ConflictStrategy(){}return ConflictStrategy.APPEND_NUM_SUFFIX=new library.NumSuffixConflictStrategy,ConflictStrategy.IGNORE=new library.IgnoreConflictStrategy,ConflictStrategy.THROW_ERROR=new library.ErrorConflictStrategy,ConflictStrategy}();library.ConflictStrategy=ConflictStrategy}(away.library||(away.library={}));away.library}(away||(away={}));var away;!function(away){!function(library){var AssetLibraryBundle=function(_super){function AssetLibraryBundle(){_super.call(this),this._loadingSessionsGarbage=new Array,this._assets=new Array,this._assetDictionary=new Object,this._loadingSessions=new Array,this.conflictStrategy=library.ConflictStrategy.IGNORE.create(),this.conflictPrecedence=library.ConflictPrecedence.FAVOR_NEW,this._onAssetRenameDelegate=away.utils.Delegate.create(this,this.onAssetRename),this._onAssetConflictResolvedDelegate=away.utils.Delegate.create(this,this.onAssetConflictResolved),this._onResourceCompleteDelegate=away.utils.Delegate.create(this,this.onResourceComplete),this._onTextureSizeErrorDelegate=away.utils.Delegate.create(this,this.onTextureSizeError),this._onAssetCompleteDelegate=away.utils.Delegate.create(this,this.onAssetComplete),this._onLoadErrorDelegate=away.utils.Delegate.create(this,this.onLoadError),this._onParseErrorDelegate=away.utils.Delegate.create(this,this.onParseError)}return __extends(AssetLibraryBundle,_super),AssetLibraryBundle.getInstance=function(key){return"undefined"==typeof key&&(key="default"),key||(key="default"),library.AssetLibrary._iInstances.hasOwnProperty(key)||(library.AssetLibrary._iInstances[key]=new AssetLibraryBundle(new AssetLibraryBundleSingletonEnforcer)),library.AssetLibrary._iInstances[key]},AssetLibraryBundle.prototype.enableParser=function(parserClass){library.AssetLoader.enableParser(parserClass)},AssetLibraryBundle.prototype.enableParsers=function(parserClasses){library.AssetLoader.enableParsers(parserClasses)},Object.defineProperty(AssetLibraryBundle.prototype,"conflictStrategy",{get:function(){return this._strategy},set:function(val){if(!val)throw new away.errors.Error("namingStrategy must not be null. To ignore naming, use AssetLibrary.IGNORE");this._strategy=val.create()},enumerable:!0,configurable:!0}),Object.defineProperty(AssetLibraryBundle.prototype,"conflictPrecedence",{get:function(){return this._strategyPreference},set:function(val){this._strategyPreference=val},enumerable:!0,configurable:!0}),AssetLibraryBundle.prototype.createIterator=function(assetTypeFilter,namespaceFilter,filterFunc){return"undefined"==typeof assetTypeFilter&&(assetTypeFilter=null),"undefined"==typeof namespaceFilter&&(namespaceFilter=null),"undefined"==typeof filterFunc&&(filterFunc=null),new library.AssetLibraryIterator(this._assets,assetTypeFilter,namespaceFilter,filterFunc)},AssetLibraryBundle.prototype.load=function(req,context,ns,parser){"undefined"==typeof context&&(context=null),"undefined"==typeof ns&&(ns=null),"undefined"==typeof parser&&(parser=null);var loader=new library.AssetLoader;return this._loadingSessions||(this._loadingSessions=new Array),this._loadingSessions.push(loader),loader.addEventListener(away.events.LoaderEvent.RESOURCE_COMPLETE,this._onResourceCompleteDelegate),loader.addEventListener(away.events.AssetEvent.TEXTURE_SIZE_ERROR,this._onTextureSizeErrorDelegate),loader.addEventListener(away.events.AssetEvent.ASSET_COMPLETE,this._onAssetCompleteDelegate),loader._iAddErrorHandler(this._onLoadErrorDelegate),loader._iAddParseErrorHandler(this._onParseErrorDelegate),loader.load(req,context,ns,parser)},AssetLibraryBundle.prototype.loadData=function(data,context,ns,parser){"undefined"==typeof context&&(context=null),"undefined"==typeof ns&&(ns=null),"undefined"==typeof parser&&(parser=null);var loader=new library.AssetLoader;return this._loadingSessions||(this._loadingSessions=new Array),this._loadingSessions.push(loader),loader.addEventListener(away.events.LoaderEvent.RESOURCE_COMPLETE,this._onResourceCompleteDelegate),loader.addEventListener(away.events.AssetEvent.TEXTURE_SIZE_ERROR,this._onTextureSizeErrorDelegate),loader.addEventListener(away.events.AssetEvent.ASSET_COMPLETE,this._onAssetCompleteDelegate),loader._iAddErrorHandler(this._onLoadErrorDelegate),loader._iAddParseErrorHandler(this._onParseErrorDelegate),loader.loadData(data,"",context,ns,parser)},AssetLibraryBundle.prototype.getAsset=function(name,ns){return"undefined"==typeof ns&&(ns=null),this._assetDictDirty&&this.rehashAssetDict(),null==ns&&(ns=library.NamedAssetBase.DEFAULT_NAMESPACE),this._assetDictionary.hasOwnProperty(ns)?this._assetDictionary[ns][name]:null -},AssetLibraryBundle.prototype.addAsset=function(asset){var ns,old;this._assets.indexOf(asset)>=0||(old=this.getAsset(asset.name,asset.assetNamespace),ns=asset.assetNamespace||library.NamedAssetBase.DEFAULT_NAMESPACE,null!=old&&this._strategy.resolveConflict(asset,old,this._assetDictionary[ns],this._strategyPreference),this._assets.push(asset),this._assetDictionary.hasOwnProperty(ns)||(this._assetDictionary[ns]=new Object),this._assetDictionary[ns][asset.name]=asset,asset.addEventListener(away.events.AssetEvent.ASSET_RENAME,this._onAssetRenameDelegate),asset.addEventListener(away.events.AssetEvent.ASSET_CONFLICT_RESOLVED,this._onAssetConflictResolvedDelegate))},AssetLibraryBundle.prototype.removeAsset=function(asset,dispose){"undefined"==typeof dispose&&(dispose=!0);var idx;this.removeAssetFromDict(asset),asset.removeEventListener(away.events.AssetEvent.ASSET_RENAME,this._onAssetRenameDelegate),asset.removeEventListener(away.events.AssetEvent.ASSET_CONFLICT_RESOLVED,this._onAssetConflictResolvedDelegate),idx=this._assets.indexOf(asset),idx>=0&&this._assets.splice(idx,1),dispose&&asset.dispose()},AssetLibraryBundle.prototype.removeAssetByName=function(name,ns,dispose){"undefined"==typeof ns&&(ns=null),"undefined"==typeof dispose&&(dispose=!0);var asset=this.getAsset(name,ns);return asset&&this.removeAsset(asset,dispose),asset},AssetLibraryBundle.prototype.removeAllAssets=function(dispose){if("undefined"==typeof dispose&&(dispose=!0),dispose)for(var asset,c=0;ci;i++)this.killLoadingSession(this._loadingSessions[i]);this._loadingSessions=null},AssetLibraryBundle.prototype.rehashAssetDict=function(){var asset;this._assetDictionary={};for(var l=this._assets.length,c=0;l>c;c++)asset=this._assets[c],this._assetDictionary.hasOwnProperty(asset.assetNamespace)||(this._assetDictionary[asset.assetNamespace]={}),this._assetDictionary[asset.assetNamespace][asset.name]=asset;this._assetDictDirty=!1},AssetLibraryBundle.prototype.onLoadError=function(event){return this.hasEventListener(away.events.IOErrorEvent.IO_ERROR)?(this.dispatchEvent(event),!0):!1},AssetLibraryBundle.prototype.onParseError=function(event){return this.hasEventListener(away.events.ParserEvent.PARSE_ERROR)?(this.dispatchEvent(event),!0):!1},AssetLibraryBundle.prototype.onAssetComplete=function(event){event.type==away.events.AssetEvent.ASSET_COMPLETE&&this.addAsset(event.asset),this.dispatchEvent(event)},AssetLibraryBundle.prototype.onTextureSizeError=function(event){this.dispatchEvent(event)},AssetLibraryBundle.prototype.onResourceComplete=function(event){var _this=this,loader=event.target;this.dispatchEvent(event);var index=this._loadingSessions.indexOf(loader);this._loadingSessions.splice(index,1),this._loadingSessionsGarbage.push(loader),this._gcTimeoutIID=setTimeout(function(){_this.loadingSessionGC()},100)},AssetLibraryBundle.prototype.loadingSessionGC=function(){for(var loader;this._loadingSessionsGarbage.length>0;)loader=this._loadingSessionsGarbage.pop(),this.killLoadingSession(loader);clearTimeout(this._gcTimeoutIID),this._gcTimeoutIID=null},AssetLibraryBundle.prototype.killLoadingSession=function(loader){loader.removeEventListener(away.events.LoaderEvent.RESOURCE_COMPLETE,this._onResourceCompleteDelegate),loader.removeEventListener(away.events.AssetEvent.TEXTURE_SIZE_ERROR,this._onTextureSizeErrorDelegate),loader.removeEventListener(away.events.AssetEvent.ASSET_COMPLETE,this._onAssetCompleteDelegate),loader.stop()},AssetLibraryBundle.prototype.onAssetRename=function(ev){var asset=ev.target,old=this.getAsset(asset.assetNamespace,asset.name);if(null!=old)this._strategy.resolveConflict(asset,old,this._assetDictionary[asset.assetNamespace],this._strategyPreference);else{var dict=this._assetDictionary[ev.asset.assetNamespace];if(null==dict)return;dict[ev.assetPrevName]=null,dict[ev.asset.name]=ev.asset}},AssetLibraryBundle.prototype.onAssetConflictResolved=function(ev){this.dispatchEvent(ev.clone())},AssetLibraryBundle}(away.events.EventDispatcher);library.AssetLibraryBundle=AssetLibraryBundle}(away.library||(away.library={}));away.library}(away||(away={}));var AssetLibraryBundleSingletonEnforcer=function(){function AssetLibraryBundleSingletonEnforcer(){}return AssetLibraryBundleSingletonEnforcer}(),away;!function(away){!function(library){var AssetLibrary=function(){function AssetLibrary(se){se=se}return AssetLibrary.getBundle=function(key){return"undefined"==typeof key&&(key="default"),library.AssetLibraryBundle.getInstance(key)},AssetLibrary.enableParser=function(parserClass){library.AssetLoader.enableParser(parserClass)},AssetLibrary.enableParsers=function(parserClasses){library.AssetLoader.enableParsers(parserClasses)},Object.defineProperty(AssetLibrary,"conflictStrategy",{get:function(){return AssetLibrary.getBundle().conflictStrategy},set:function(val){AssetLibrary.getBundle().conflictStrategy=val},enumerable:!0,configurable:!0}),Object.defineProperty(AssetLibrary,"conflictPrecedence",{get:function(){return AssetLibrary.getBundle().conflictPrecedence},set:function(val){AssetLibrary.getBundle().conflictPrecedence=val},enumerable:!0,configurable:!0}),AssetLibrary.createIterator=function(assetTypeFilter,namespaceFilter,filterFunc){return"undefined"==typeof assetTypeFilter&&(assetTypeFilter=null),"undefined"==typeof namespaceFilter&&(namespaceFilter=null),"undefined"==typeof filterFunc&&(filterFunc=null),AssetLibrary.getBundle().createIterator(assetTypeFilter,namespaceFilter,filterFunc)},AssetLibrary.load=function(req,context,ns,parser){return"undefined"==typeof context&&(context=null),"undefined"==typeof ns&&(ns=null),"undefined"==typeof parser&&(parser=null),AssetLibrary.getBundle().load(req,context,ns,parser)},AssetLibrary.loadData=function(data,context,ns,parser){return"undefined"==typeof context&&(context=null),"undefined"==typeof ns&&(ns=null),"undefined"==typeof parser&&(parser=null),AssetLibrary.getBundle().loadData(data,context,ns,parser)},AssetLibrary.stopLoad=function(){AssetLibrary.getBundle().stopAllLoadingSessions()},AssetLibrary.getAsset=function(name,ns){return"undefined"==typeof ns&&(ns=null),AssetLibrary.getBundle().getAsset(name,ns)},AssetLibrary.addEventListener=function(type,listener){AssetLibrary.getBundle().addEventListener(type,listener)},AssetLibrary.removeEventListener=function(type,listener){AssetLibrary.getBundle().removeEventListener(type,listener)},AssetLibrary.addAsset=function(asset){AssetLibrary.getBundle().addAsset(asset)},AssetLibrary.removeAsset=function(asset,dispose){"undefined"==typeof dispose&&(dispose=!0),AssetLibrary.getBundle().removeAsset(asset,dispose)},AssetLibrary.removeAssetByName=function(name,ns,dispose){return"undefined"==typeof ns&&(ns=null),"undefined"==typeof dispose&&(dispose=!0),AssetLibrary.getBundle().removeAssetByName(name,ns,dispose)},AssetLibrary.removeAllAssets=function(dispose){"undefined"==typeof dispose&&(dispose=!0),AssetLibrary.getBundle().removeAllAssets(dispose)},AssetLibrary.removeNamespaceAssets=function(ns,dispose){"undefined"==typeof ns&&(ns=null),"undefined"==typeof dispose&&(dispose=!0),AssetLibrary.getBundle().removeNamespaceAssets(ns,dispose)},AssetLibrary._iInstances={},AssetLibrary}();library.AssetLibrary=AssetLibrary}(away.library||(away.library={}));away.library}(away||(away={}));var AssetLibrarySingletonEnforcer=function(){function AssetLibrarySingletonEnforcer(){}return AssetLibrarySingletonEnforcer}(),away;!function(away){!function(pool){var EntityListItem=function(){function EntityListItem(){}return EntityListItem}();pool.EntityListItem=EntityListItem}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(pool){var EntityListItemPool=function(){function EntityListItemPool(){this._index=0,this._poolSize=0,this._pool=[]}return EntityListItemPool.prototype.getItem=function(){var item;return this._index==this._poolSize?(item=new pool.EntityListItem,this._pool[this._index++]=item,++this._poolSize):item=this._pool[this._index++],item},EntityListItemPool.prototype.freeAll=function(){this._index=0},EntityListItemPool.prototype.dispose=function(){this._pool.length=0},EntityListItemPool}();pool.EntityListItemPool=EntityListItemPool}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(){}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(_pool){var RenderablePool=function(){function RenderablePool(renderableClass){this._pool=new Object,this._renderableClass=renderableClass}return RenderablePool.prototype.getItem=function(materialOwner){return this._pool[materialOwner.id]||(this._pool[materialOwner.id]=materialOwner._iAddRenderable(new this._renderableClass(this,materialOwner)))},RenderablePool.prototype.disposeItem=function(materialOwner){materialOwner._iRemoveRenderable(this._pool[materialOwner.id]),this._pool[materialOwner.id]=null},RenderablePool.getPool=function(renderableClass){var pool=RenderablePool._pools[renderableClass.id];return void 0!=pool?pool:RenderablePool._pools[renderableClass.id]=new RenderablePool(renderableClass)},RenderablePool.disposePool=function(renderableClass){RenderablePool._pools[renderableClass.id]&&(RenderablePool._pools[renderableClass.id]=void 0)},RenderablePool._pools=new Object,RenderablePool}();_pool.RenderablePool=RenderablePool}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(_pool){var CSSRenderableBase=function(){function CSSRenderableBase(pool,sourceEntity,materialOwner){this._pool=pool,this.sourceEntity=sourceEntity,this.materialOwner=materialOwner}return CSSRenderableBase.prototype.dispose=function(){this._pool.disposeItem(this.materialOwner)},CSSRenderableBase.prototype.invalidateGeometry=function(){},CSSRenderableBase.prototype.invalidateIndexData=function(){},CSSRenderableBase.prototype.invalidateVertexData=function(){},CSSRenderableBase}();_pool.CSSRenderableBase=CSSRenderableBase}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(_pool){var CSSBillboardRenderable=function(_super){function CSSBillboardRenderable(pool,billboard){_super.call(this,pool,billboard,billboard);var div=document.createElement("div");div.onmousedown=function(){return!1},this.htmlElement=div;var style=div.style;style.position="absolute",style.transformOrigin=style["-webkit-transform-origin"]=style["-moz-transform-origin"]=style["-o-transform-origin"]=style["-ms-transform-origin"]="0% 0%";var img=document.createElement("div");div.appendChild(img),img.className="material"+billboard.material.id}return __extends(CSSBillboardRenderable,_super),CSSBillboardRenderable.id="billboard",CSSBillboardRenderable}(_pool.CSSRenderableBase);_pool.CSSBillboardRenderable=CSSBillboardRenderable}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(_pool){var CSSLineSegmentRenderable=function(_super){function CSSLineSegmentRenderable(pool,lineSegment){_super.call(this,pool,lineSegment,lineSegment);var div=document.createElement("div");div.onmousedown=function(){return!1},this.htmlElement=div;var style=div.style;style.position="absolute",style.transformOrigin=style["-webkit-transform-origin"]=style["-moz-transform-origin"]=style["-o-transform-origin"]=style["-ms-transform-origin"]="0% 0%";var img=document.createElement("div");div.appendChild(img),img.className="material"+lineSegment.material.id}return __extends(CSSLineSegmentRenderable,_super),CSSLineSegmentRenderable.id="lineSegment",CSSLineSegmentRenderable}(_pool.CSSRenderableBase);_pool.CSSLineSegmentRenderable=CSSLineSegmentRenderable}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(_pool){var CSSSkyboxRenderable=function(_super){function CSSSkyboxRenderable(pool,skyBox){_super.call(this,pool,skyBox,skyBox);var div=document.createElement("div");div.onmousedown=function(){return!1},this.htmlElement=div;var img,style=div.style;style.position="absolute",style.transformOrigin=style["-webkit-transform-origin"]=style["-moz-transform-origin"]=style["-o-transform-origin"]=style["-ms-transform-origin"]="0% 0%",img=document.createElement("div"),div.appendChild(img),img.className="material"+skyBox.material.id}return __extends(CSSSkyboxRenderable,_super),CSSSkyboxRenderable.id="skybox",CSSSkyboxRenderable}(_pool.CSSRenderableBase);_pool.CSSSkyboxRenderable=CSSSkyboxRenderable}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(traverse){var EntityListItemPool=away.pool.EntityListItemPool,CollectorBase=function(){function CollectorBase(){this._numCullPlanes=0,this._pNumEntities=0,this._pNumInteractiveEntities=0,this._pEntityListItemPool=new EntityListItemPool}return Object.defineProperty(CollectorBase.prototype,"camera",{get:function(){return this._pCamera},set:function(value){this._pCamera=value,this._cullPlanes=this._pCamera.frustumPlanes},enumerable:!0,configurable:!0}),Object.defineProperty(CollectorBase.prototype,"cullPlanes",{get:function(){return this._customCullPlanes},set:function(value){this._customCullPlanes=value},enumerable:!0,configurable:!0}),Object.defineProperty(CollectorBase.prototype,"entityHead",{get:function(){return this._pEntityHead},enumerable:!0,configurable:!0}),Object.defineProperty(CollectorBase.prototype,"numEntities",{get:function(){return this._pNumEntities},enumerable:!0,configurable:!0}),Object.defineProperty(CollectorBase.prototype,"numInteractiveEntities",{get:function(){return this._pNumInteractiveEntities},enumerable:!0,configurable:!0}),CollectorBase.prototype.clear=function(){this._pNumEntities=this._pNumInteractiveEntities=0,this._cullPlanes=this._customCullPlanes?this._customCullPlanes:this._pCamera?this._pCamera.frustumPlanes:null,this._numCullPlanes=this._cullPlanes?this._cullPlanes.length:0,this._pEntityHead=null,this._pEntityListItemPool.freeAll()},CollectorBase.prototype.enterNode=function(node){var enter=this.scene._iCollectionMark!=node._iCollectionMark&&node.isInFrustum(this._cullPlanes,this._numCullPlanes);return node._iCollectionMark=this.scene._iCollectionMark,enter},CollectorBase.prototype.applyDirectionalLight=function(){},CollectorBase.prototype.applyEntity=function(entity){this._pNumEntities++,entity._iIsMouseEnabled()&&this._pNumInteractiveEntities++;var item=this._pEntityListItemPool.getItem();item.entity=entity,item.next=this._pEntityHead,this._pEntityHead=item},CollectorBase.prototype.applyLightProbe=function(){},CollectorBase.prototype.applyPointLight=function(){},CollectorBase.prototype.applySkybox=function(){},CollectorBase}();traverse.CollectorBase=CollectorBase}(away.traverse||(away.traverse={}));away.traverse}(away||(away={}));var away;!function(away){!function(traverse){var EntityCollector=function(_super){function EntityCollector(){_super.call(this),this._pNumLights=0,this._numDirectionalLights=0,this._numPointLights=0,this._numLightProbes=0,this._pLights=new Array,this._directionalLights=new Array,this._pointLights=new Array,this._lightProbes=new Array}return __extends(EntityCollector,_super),Object.defineProperty(EntityCollector.prototype,"directionalLights",{get:function(){return this._directionalLights},enumerable:!0,configurable:!0}),Object.defineProperty(EntityCollector.prototype,"lightProbes",{get:function(){return this._lightProbes},enumerable:!0,configurable:!0}),Object.defineProperty(EntityCollector.prototype,"lights",{get:function(){return this._pLights},enumerable:!0,configurable:!0}),Object.defineProperty(EntityCollector.prototype,"pointLights",{get:function(){return this._pointLights},enumerable:!0,configurable:!0}),Object.defineProperty(EntityCollector.prototype,"skyBox",{get:function(){return this._pSkybox},enumerable:!0,configurable:!0}),EntityCollector.prototype.applyDirectionalLight=function(entity){this._directionalLights[this._numDirectionalLights++]=entity},EntityCollector.prototype.applyLightProbe=function(entity){this._lightProbes[this._numLightProbes++]=entity},EntityCollector.prototype.applyPointLight=function(entity){this._pointLights[this._numPointLights++]=entity},EntityCollector.prototype.applySkybox=function(entity){this._pSkybox=entity},EntityCollector.prototype.clear=function(){_super.prototype.clear.call(this),this._pSkybox=null,this._pNumLights>0&&(this._pLights.length=this._pNumLights=0),this._numDirectionalLights>0&&(this._directionalLights.length=this._numDirectionalLights=0),this._numPointLights>0&&(this._pointLights.length=this._numPointLights=0),this._numLightProbes>0&&(this._lightProbes.length=this._numLightProbes=0)},EntityCollector}(traverse.CollectorBase);traverse.EntityCollector=EntityCollector}(away.traverse||(away.traverse={}));away.traverse}(away||(away={}));var away;!function(away){!function(traverse){var Vector3D=away.geom.Vector3D,RaycastCollector=function(_super){function RaycastCollector(){_super.call(this),this._rayPosition=new Vector3D,this._rayDirection=new Vector3D,this._iCollectionMark=0}return __extends(RaycastCollector,_super),Object.defineProperty(RaycastCollector.prototype,"rayPosition",{get:function(){return this._rayPosition},set:function(value){this._rayPosition=value},enumerable:!0,configurable:!0}),Object.defineProperty(RaycastCollector.prototype,"rayDirection",{get:function(){return this._rayDirection},set:function(value){this._rayDirection=value},enumerable:!0,configurable:!0}),RaycastCollector.prototype.enterNode=function(node){return node.isIntersectingRay(this._rayPosition,this._rayDirection)},RaycastCollector}(traverse.CollectorBase);traverse.RaycastCollector=RaycastCollector}(away.traverse||(away.traverse={}));away.traverse}(away||(away={}));var away;!function(away){!function(traverse){var CSSEntityCollector=function(_super){function CSSEntityCollector(){_super.call(this)}return __extends(CSSEntityCollector,_super),CSSEntityCollector}(traverse.CollectorBase);traverse.CSSEntityCollector=CSSEntityCollector}(away.traverse||(away.traverse={}));away.traverse}(away||(away={}));var away;!function(away){!function(traverse){var ShadowCasterCollector=function(_super){function ShadowCasterCollector(){_super.call(this)}return __extends(ShadowCasterCollector,_super),ShadowCasterCollector.prototype.enterNode=function(node){var enter=this.scene._iCollectionMark!=node._iCollectionMark&&node.isCastingShadow();return enter?_super.prototype.enterNode.call(this,node):(node._iCollectionMark=this.scene._iCollectionMark,!1)},ShadowCasterCollector}(traverse.CollectorBase);traverse.ShadowCasterCollector=ShadowCasterCollector}(away.traverse||(away.traverse={}));away.traverse}(away||(away={}));var away;!function(away){!function(partition){var NodeBase=function(){function NodeBase(){this._pNumChildNodes=0,this._iNumEntities=0,this._pChildNodes=new Array}return Object.defineProperty(NodeBase.prototype,"boundsVisible",{get:function(){return this._explicitBoundsVisible},set:function(value){this._explicitBoundsVisible!=value&&(this._explicitBoundsVisible=value,this._iUpdateImplicitBoundsVisible(this._iParent?this._iParent.boundsChildrenVisible:!1))},enumerable:!0,configurable:!0}),Object.defineProperty(NodeBase.prototype,"boundsChildrenVisible",{get:function(){return this._boundsChildrenVisible},set:function(value){if(this._boundsChildrenVisible!=value){this._boundsChildrenVisible=value;for(var i=0;ii;i++)if(this._ignoredEntities[i]==entity)return!0;return!1},RaycastPicker.prototype.sortOnNearT=function(entity1,entity2){return entity1._iPickingCollisionVO.rayEntryDistance>entity2._iPickingCollisionVO.rayEntryDistance?1:-1},RaycastPicker.prototype.getPickingCollisionVO=function(){this._entities.length=this._numEntities,this._entities=this._entities.sort(this.sortOnNearT);var bestCollisionVO,pickingCollisionVO,entity,i,shortestCollisionDistance=Number.MAX_VALUE;for(i=0;imb?1:-1}else cmp=aid>bid?1:-1;0>cmp?(l=head,head=head.next):(l=headB,headB=headB.next),result?(curr.next=l,curr=l):(result=l,curr=l)}return head?curr.next=head:headB&&(curr.next=headB),result},RenderableMergeSort}();sort.RenderableMergeSort=RenderableMergeSort}(away.sort||(away.sort={}));away.sort}(away||(away={}));var away;!function(away){!function(text){var AntiAliasType=function(){function AntiAliasType(){}return AntiAliasType.ADVANCED="advanced",AntiAliasType.NORMAL="normal",AntiAliasType}();text.AntiAliasType=AntiAliasType}(away.text||(away.text={}));away.text}(away||(away={}));var away;!function(away){!function(text){var GridFitType=function(){function GridFitType(){}return GridFitType.NONE="none",GridFitType.PIXEL="pixel",GridFitType.SUBPIXEL="subpixel",GridFitType}();text.GridFitType=GridFitType}(away.text||(away.text={}));away.text}(away||(away={}));var away;!function(away){!function(text){var TextFieldAutoSize=function(){function TextFieldAutoSize(){}return TextFieldAutoSize.CENTER="center",TextFieldAutoSize.LEFT="left",TextFieldAutoSize.NONE="none",TextFieldAutoSize.RIGHT="right",TextFieldAutoSize}();text.TextFieldAutoSize=TextFieldAutoSize}(away.text||(away.text={}));away.text}(away||(away={}));var away;!function(away){!function(text){var TextFieldType=function(){function TextFieldType(){}return TextFieldType.DYNAMIC="dynamic",TextFieldType.INPUT="input",TextFieldType}();text.TextFieldType=TextFieldType}(away.text||(away.text={}));away.text}(away||(away={}));var away;!function(away){!function(text){var TextFormat=function(){function TextFormat(font,size,color,bold,italic,underline,url,target,align,leftMargin,rightMargin,indent,leading){"undefined"==typeof font&&(font="Times New Roman"),"undefined"==typeof size&&(size=12),"undefined"==typeof color&&(color=0),"undefined"==typeof bold&&(bold=!1),"undefined"==typeof italic&&(italic=!1),"undefined"==typeof underline&&(underline=!1),"undefined"==typeof url&&(url=""),"undefined"==typeof target&&(target=""),"undefined"==typeof align&&(align="left"),"undefined"==typeof leftMargin&&(leftMargin=0),"undefined"==typeof rightMargin&&(rightMargin=0),"undefined"==typeof indent&&(indent=0),"undefined"==typeof leading&&(leading=0),this.tabStops=new Array,this.font=font,this.size=size,this.bold=bold,this.italic=italic,this.underline=underline,this.url=url,this.target=target,this.align=align,this.leftMargin=leftMargin,this.rightMargin=rightMargin,this.indent=indent,this.leading=leading}return TextFormat}();text.TextFormat=TextFormat}(away.text||(away.text={}));away.text}(away||(away={}));var away;!function(away){!function(text){var TextFormatAlign=function(){function TextFormatAlign(){this.CENTER="center",this.JUSTIFY="justify",this.LEFT="left",this.RIGHT="right"}return TextFormatAlign}();text.TextFormatAlign=TextFormatAlign}(away.text||(away.text={}));away.text}(away||(away={}));var away;!function(away){!function(text){var TextInteractionMode=function(){function TextInteractionMode(){}return TextInteractionMode.NORMAL="normal",TextInteractionMode.SELECTION="selection",TextInteractionMode}();text.TextInteractionMode=TextInteractionMode}(away.text||(away.text={}));away.text}(away||(away={}));var away;!function(away){!function(text){var TextLineMetrics=function(){function TextLineMetrics(x,width,height,ascent,descent,leading){"undefined"==typeof x&&(x=0/0),"undefined"==typeof width&&(width=0/0),"undefined"==typeof height&&(height=0/0),"undefined"==typeof ascent&&(ascent=0/0),"undefined"==typeof descent&&(descent=0/0),"undefined"==typeof leading&&(leading=0/0)}return TextLineMetrics}();text.TextLineMetrics=TextLineMetrics}(away.text||(away.text={}));away.text}(away||(away={}));var away;!function(away){!function(ui){var Keyboard=function(){function Keyboard(){}return Keyboard.A=65,Keyboard.ALTERNATE=18,Keyboard.AUDIO=16777239,Keyboard.B=66,Keyboard.BACK=16777238,Keyboard.BACKQUOTE=192,Keyboard.BACKSLASH=220,Keyboard.BACKSPACE=8,Keyboard.BLUE=16777219,Keyboard.C=67,Keyboard.CAPS_LOCK=20,Keyboard.CHANNEL_DOWN=16777221,Keyboard.CHANNEL_UP=16777221,Keyboard.COMMA=188,Keyboard.COMMAND=15,Keyboard.CONTROL=17,Keyboard.D=68,Keyboard.DELETE=46,Keyboard.DOWN=40,Keyboard.DVR=16777241,Keyboard.E=69,Keyboard.END=35,Keyboard.ENTER=13,Keyboard.EQUAL=187,Keyboard.ESCAPE=27,Keyboard.EXIT=16777237,Keyboard.F=70,Keyboard.F1=112,Keyboard.F10=121,Keyboard.F11=122,Keyboard.F12=123,Keyboard.F13=124,Keyboard.F14=125,Keyboard.F15=126,Keyboard.F2=113,Keyboard.F3=114,Keyboard.F4=115,Keyboard.F5=116,Keyboard.F6=117,Keyboard.F7=118,Keyboard.F8=119,Keyboard.F9=120,Keyboard.FAST_FORWARD=16777226,Keyboard.G=71,Keyboard.GREEN=16777217,Keyboard.GUIDE=16777236,Keyboard.H=72,Keyboard.HELP=16777245,Keyboard.HOME=36,Keyboard.I=73,Keyboard.INFO=16777235,Keyboard.INPUT=16777243,Keyboard.INSERT=45,Keyboard.J=74,Keyboard.K=75,Keyboard.KEYNAME_BEGIN="Begin",Keyboard.KEYNAME_BREAK="Break",Keyboard.KEYNAME_CLEARDISPLAY="ClrDsp",Keyboard.KEYNAME_CLEARLINE="ClrLn",Keyboard.KEYNAME_DELETE="Delete",Keyboard.KEYNAME_DELETECHAR="DelChr",Keyboard.KEYNAME_DELETELINE="DelLn",Keyboard.KEYNAME_DOWNARROW="Down",Keyboard.KEYNAME_END="End",Keyboard.KEYNAME_EXECUTE="Exec",Keyboard.KEYNAME_F1="F1",Keyboard.KEYNAME_F10="F10",Keyboard.KEYNAME_F11="F11",Keyboard.KEYNAME_F12="F12",Keyboard.KEYNAME_F13="F13",Keyboard.KEYNAME_F14="F14",Keyboard.KEYNAME_F15="F15",Keyboard.KEYNAME_F16="F16",Keyboard.KEYNAME_F17="F17",Keyboard.KEYNAME_F18="F18",Keyboard.KEYNAME_F19="F19",Keyboard.KEYNAME_F2="F2",Keyboard.KEYNAME_F20="F20",Keyboard.KEYNAME_F21="F21",Keyboard.KEYNAME_F22="F22",Keyboard.KEYNAME_F23="F23",Keyboard.KEYNAME_F24="F24",Keyboard.KEYNAME_F25="F25",Keyboard.KEYNAME_F26="F26",Keyboard.KEYNAME_F27="F27",Keyboard.KEYNAME_F28="F28",Keyboard.KEYNAME_F29="F29",Keyboard.KEYNAME_F3="F3",Keyboard.KEYNAME_F30="F30",Keyboard.KEYNAME_F31="F31",Keyboard.KEYNAME_F32="F32",Keyboard.KEYNAME_F33="F33",Keyboard.KEYNAME_F34="F34",Keyboard.KEYNAME_F35="F35",Keyboard.KEYNAME_F4="F4",Keyboard.KEYNAME_F5="F5",Keyboard.KEYNAME_F6="F6",Keyboard.KEYNAME_F7="F7",Keyboard.KEYNAME_F8="F8",Keyboard.KEYNAME_F9="F9",Keyboard.KEYNAME_FIND="Find",Keyboard.KEYNAME_HELP="Help",Keyboard.KEYNAME_HOME="Home",Keyboard.KEYNAME_INSERT="Insert",Keyboard.KEYNAME_INSERTCHAR="InsChr",Keyboard.KEYNAME_INSERTLINE="LnsLn",Keyboard.KEYNAME_LEFTARROW="Left",Keyboard.KEYNAME_MENU="Menu",Keyboard.KEYNAME_MODESWITCH="ModeSw",Keyboard.KEYNAME_NEXT="Next",Keyboard.KEYNAME_PAGEDOWN="PgDn",Keyboard.KEYNAME_PAGEUP="PgUp",Keyboard.KEYNAME_PAUSE="Pause",Keyboard.KEYNAME_PREV="Prev",Keyboard.KEYNAME_PRINT="Print",Keyboard.KEYNAME_PRINTSCREEN="PrntScrn",Keyboard.KEYNAME_REDO="Redo",Keyboard.KEYNAME_RESET="Reset",Keyboard.KEYNAME_RIGHTARROW="Right",Keyboard.KEYNAME_SCROLLLOCK="ScrlLck",Keyboard.KEYNAME_SELECT="Select",Keyboard.KEYNAME_STOP="Stop",Keyboard.KEYNAME_SYSREQ="SysReq",Keyboard.KEYNAME_SYSTEM="Sys",Keyboard.KEYNAME_UNDO="Undo",Keyboard.KEYNAME_UPARROW="Up",Keyboard.KEYNAME_USER="User",Keyboard.L=76,Keyboard.LAST=16777233,Keyboard.LEFT=37,Keyboard.LEFTBRACKET=219,Keyboard.LIVE=16777232,Keyboard.M=77,Keyboard.MASTER_SHELL=16777246,Keyboard.MENU=16777234,Keyboard.MINUS=189,Keyboard.N=78,Keyboard.NEXT=16777230,Keyboard.NUMBER_0=48,Keyboard.NUMBER_1=49,Keyboard.NUMBER_2=50,Keyboard.NUMBER_3=51,Keyboard.NUMBER_4=52,Keyboard.NUMBER_5=53,Keyboard.NUMBER_6=54,Keyboard.NUMBER_7=55,Keyboard.NUMBER_8=56,Keyboard.NUMBER_9=57,Keyboard.NUMPAD=21,Keyboard.NUMPAD_0=96,Keyboard.NUMPAD_1=97,Keyboard.NUMPAD_2=98,Keyboard.NUMPAD_3=99,Keyboard.NUMPAD_4=100,Keyboard.NUMPAD_5=101,Keyboard.NUMPAD_6=102,Keyboard.NUMPAD_7=103,Keyboard.NUMPAD_8=104,Keyboard.NUMPAD_9=105,Keyboard.NUMPAD_ADD=107,Keyboard.NUMPAD_DECIMAL=110,Keyboard.NUMPAD_DIVIDE=111,Keyboard.NUMPAD_ENTER=108,Keyboard.NUMPAD_MULTIPLY=106,Keyboard.NUMPAD_SUBTRACT=109,Keyboard.O=79,Keyboard.P=80,Keyboard.PAGE_DOWN=34,Keyboard.PAGE_UP=33,Keyboard.PAUSE=16777224,Keyboard.PERIOD=190,Keyboard.PLAY=16777223,Keyboard.PREVIOUS=16777231,Keyboard.Q=81,Keyboard.QUOTE=222,Keyboard.R=82,Keyboard.RECORD=16777222,Keyboard.RED=16777216,Keyboard.REWIND=16777227,Keyboard.RIGHT=39,Keyboard.RIGHTBRACKET=221,Keyboard.S=83,Keyboard.SEARCH=16777247,Keyboard.SEMICOLON=186,Keyboard.SETUP=16777244,Keyboard.SHIFT=16,Keyboard.SKIP_BACKWARD=16777229,Keyboard.SKIP_FORWARD=16777228,Keyboard.SLASH=191,Keyboard.SPACE=32,Keyboard.STOP=16777225,Keyboard.SUBTITLE=16777240,Keyboard.T=84,Keyboard.TAB=9,Keyboard.U=85,Keyboard.UP=38,Keyboard.V=86,Keyboard.VOD=16777242,Keyboard.W=87,Keyboard.X=88,Keyboard.Y=89,Keyboard.YELLOW=16777218,Keyboard.Z=90,Keyboard}();ui.Keyboard=Keyboard}(away.ui||(away.ui={}));away.ui}(away||(away={}));var away;!function(away){!function(containers){var ArgumentError=away.errors.ArgumentError,Error=away.errors.Error,RangeError=away.errors.RangeError,AssetType=away.library.AssetType,DisplayObjectContainer=function(_super){function DisplayObjectContainer(){_super.call(this),this._mouseChildren=!0,this._children=new Array}return __extends(DisplayObjectContainer,_super),Object.defineProperty(DisplayObjectContainer.prototype,"assetType",{get:function(){return AssetType.CONTAINER},enumerable:!0,configurable:!0}),Object.defineProperty(DisplayObjectContainer.prototype,"mouseChildren",{get:function(){return this._mouseChildren},set:function(value){this._mouseChildren!=value&&(this._mouseChildren=value,this._pUpdateImplicitMouseEnabled(this._pParent?this._pParent.mouseChildren:!0))},enumerable:!0,configurable:!0}),Object.defineProperty(DisplayObjectContainer.prototype,"numChildren",{get:function(){return this._children.length},enumerable:!0,configurable:!0}),DisplayObjectContainer.prototype.addChild=function(child){if(null==child)throw new Error("Parameter child cannot be null.");return child._pParent&&child._pParent.removeChildInternal(child),child.iSetParent(this),this._children.push(child),child},DisplayObjectContainer.prototype.addChildAt=function(child){return child},DisplayObjectContainer.prototype.addChildren=function(){for(var childarray=[],_i=0;_ii;i++)this.addChild(childarray[i])},DisplayObjectContainer.prototype.clone=function(){var clone=new DisplayObjectContainer;clone.pivot=this.pivot,clone._iMatrix3D=this._iMatrix3D,clone.partition=this.partition,clone.name=name;for(var len=this._children.length,i=0;len>i;++i)clone.addChild(this._children[i].clone());return clone},DisplayObjectContainer.prototype.contains=function(child){return this._children.indexOf(child)>=0},DisplayObjectContainer.prototype.disposeWithChildren=function(){for(this.dispose();this.numChildren>0;)this.getChildAt(0).dispose()},DisplayObjectContainer.prototype.getChildAt=function(index){var child=this._children[index];if(null==child)throw new RangeError("Index does not exist in the child list of the caller");return child},DisplayObjectContainer.prototype.getChildByName=function(name){for(var len=this._children.length,i=0;len>i;++i)if(this._children[i].name==name)return this._children[i];return null},DisplayObjectContainer.prototype.getChildIndex=function(child){var childIndex=this._children.indexOf(child);if(-1==childIndex)throw new ArgumentError("Child parameter is not a child of the caller");return childIndex},DisplayObjectContainer.prototype.getObjectsUnderPoint=function(){return new Array},DisplayObjectContainer.prototype.removeChild=function(child){if(null==child)throw new Error("Parameter child cannot be null");return this.removeChildInternal(child),child.iSetParent(null),child},DisplayObjectContainer.prototype.removeChildAt=function(index){return this.removeChild(this._children[index])},DisplayObjectContainer.prototype.removeChildren=function(beginIndex,endIndex){if("undefined"==typeof beginIndex&&(beginIndex=0),"undefined"==typeof endIndex&&(endIndex=2147483647),0>beginIndex)throw new RangeError("beginIndex is out of range of the child list");if(endIndex>this._children.length)throw new RangeError("endIndex is out of range of the child list");for(var i=beginIndex;endIndex>i;i++)this.removeChild(this._children[i])},DisplayObjectContainer.prototype.setChildIndex=function(){},DisplayObjectContainer.prototype.swapChildren=function(){},DisplayObjectContainer.prototype.swapChildrenAt=function(){},DisplayObjectContainer.prototype.pInvalidateSceneTransform=function(){_super.prototype.pInvalidateSceneTransform.call(this);for(var len=this._children.length,i=0;len>i;++i)this._children[i].pInvalidateSceneTransform()},DisplayObjectContainer.prototype._pUpdateScene=function(value){_super.prototype._pUpdateScene.call(this,value);for(var len=this._children.length,i=0;len>i;++i)this._children[i]._pUpdateScene(value)},DisplayObjectContainer.prototype._pUpdateImplicitMouseEnabled=function(value){_super.prototype._pUpdateImplicitMouseEnabled.call(this,value);for(var len=this._children.length,i=0;len>i;++i)this._children[i]._pUpdateImplicitMouseEnabled(this._mouseChildren)},DisplayObjectContainer.prototype._pUpdateImplicitVisibility=function(value){_super.prototype._pUpdateImplicitVisibility.call(this,value);for(var len=this._children.length,i=0;len>i;++i)this._children[i]._pUpdateImplicitVisibility(this._pImplicitVisibility)},DisplayObjectContainer.prototype._pUpdateImplicitPartition=function(value){_super.prototype._pUpdateImplicitPartition.call(this,value);for(var len=this._children.length,i=0;len>i;++i)this._children[i]._pUpdateImplicitPartition(this._pImplicitPartition)},DisplayObjectContainer.prototype.removeChildInternal=function(child){return this._children.splice(this.getChildIndex(child),1),child},DisplayObjectContainer}(away.base.DisplayObject);containers.DisplayObjectContainer=DisplayObjectContainer}(away.containers||(away.containers={}));away.containers}(away||(away={}));var away;!function(away){!function(base){var AbstractMethodError=away.errors.AbstractMethodError,LightEvent=away.events.LightEvent,AssetType=away.library.AssetType,LightBase=function(_super){function LightBase(){_super.call(this),this._color=16777215,this._colorR=1,this._colorG=1,this._colorB=1,this._ambientColor=16777215,this._ambient=0,this._iAmbientR=0,this._iAmbientG=0,this._iAmbientB=0,this._specular=1,this._iSpecularR=1,this._iSpecularG=1,this._iSpecularB=1,this._diffuse=1,this._iDiffuseR=1,this._iDiffuseG=1,this._iDiffuseB=1,this._castsShadows=!1}return __extends(LightBase,_super),Object.defineProperty(LightBase.prototype,"castsShadows",{get:function(){return this._castsShadows},set:function(value){this._castsShadows!=value&&(this._castsShadows=value,value?(null==this._shadowMapper&&(this._shadowMapper=this.pCreateShadowMapper()),this._shadowMapper.light=this):(this._shadowMapper.dispose(),this._shadowMapper=null),this.dispatchEvent(new LightEvent(LightEvent.CASTS_SHADOW_CHANGE)))},enumerable:!0,configurable:!0}),LightBase.prototype.pCreateShadowMapper=function(){throw new AbstractMethodError},Object.defineProperty(LightBase.prototype,"specular",{get:function(){return this._specular},set:function(value){0>value&&(value=0),this._specular=value,this.updateSpecular()},enumerable:!0,configurable:!0}),Object.defineProperty(LightBase.prototype,"diffuse",{get:function(){return this._diffuse},set:function(value){0>value&&(value=0),this._diffuse=value,this.updateDiffuse()},enumerable:!0,configurable:!0}),Object.defineProperty(LightBase.prototype,"color",{get:function(){return this._color},set:function(value){this._color=value,this._colorR=(this._color>>16&255)/255,this._colorG=(this._color>>8&255)/255,this._colorB=(255&this._color)/255,this.updateDiffuse(),this.updateSpecular()},enumerable:!0,configurable:!0}),Object.defineProperty(LightBase.prototype,"ambient",{get:function(){return this._ambient},set:function(value){0>value?value=0:value>1&&(value=1),this._ambient=value,this.updateAmbient()},enumerable:!0,configurable:!0}),Object.defineProperty(LightBase.prototype,"ambientColor",{get:function(){return this._ambientColor},set:function(value){this._ambientColor=value,this.updateAmbient()},enumerable:!0,configurable:!0}),LightBase.prototype.updateAmbient=function(){this._iAmbientR=(this._ambientColor>>16&255)/255*this._ambient,this._iAmbientG=(this._ambientColor>>8&255)/255*this._ambient,this._iAmbientB=(255&this._ambientColor)/255*this._ambient},LightBase.prototype.iGetObjectProjectionMatrix=function(entity,camera,target){throw"undefined"==typeof target&&(target=null),new AbstractMethodError},Object.defineProperty(LightBase.prototype,"assetType",{get:function(){return AssetType.LIGHT},enumerable:!0,configurable:!0}),LightBase.prototype.updateSpecular=function(){this._iSpecularR=this._colorR*this._specular,this._iSpecularG=this._colorG*this._specular,this._iSpecularB=this._colorB*this._specular},LightBase.prototype.updateDiffuse=function(){this._iDiffuseR=this._colorR*this._diffuse,this._iDiffuseG=this._colorG*this._diffuse,this._iDiffuseB=this._colorB*this._diffuse},Object.defineProperty(LightBase.prototype,"shadowMapper",{get:function(){return this._shadowMapper},set:function(value){this._shadowMapper=value,this._shadowMapper.light=this},enumerable:!0,configurable:!0}),LightBase}(away.containers.DisplayObjectContainer);base.LightBase=LightBase}(away.base||(away.base={}));away.base}(away||(away={}));var away;!function(away){!function(projections){var CoordinateSystem=function(){function CoordinateSystem(){}return CoordinateSystem.LEFT_HANDED="leftHanded",CoordinateSystem.RIGHT_HANDED="rightHanded",CoordinateSystem}();projections.CoordinateSystem=CoordinateSystem}(away.projections||(away.projections={}));away.projections}(away||(away={}));var away;!function(away){!function(projections){var ProjectionBase=function(_super){function ProjectionBase(coordinateSystem){"undefined"==typeof coordinateSystem&&(coordinateSystem="leftHanded"),_super.call(this),this._pMatrix=new away.geom.Matrix3D,this._pScissorRect=new away.geom.Rectangle,this._pViewPort=new away.geom.Rectangle,this._pNear=20,this._pFar=3e3,this._pAspectRatio=1,this._pMatrixInvalid=!0,this._pFrustumCorners=[],this._pOriginX=.5,this._pOriginY=.5,this._unprojectionInvalid=!0,this.coordinateSystem=coordinateSystem}return __extends(ProjectionBase,_super),Object.defineProperty(ProjectionBase.prototype,"coordinateSystem",{get:function(){return this._pCoordinateSystem},set:function(value){this._pCoordinateSystem!=value&&(this._pCoordinateSystem=value,this.pInvalidateMatrix())},enumerable:!0,configurable:!0}),Object.defineProperty(ProjectionBase.prototype,"frustumCorners",{get:function(){return this._pFrustumCorners},set:function(frustumCorners){this._pFrustumCorners=frustumCorners},enumerable:!0,configurable:!0}),Object.defineProperty(ProjectionBase.prototype,"matrix",{get:function(){return this._pMatrixInvalid&&(this.pUpdateMatrix(),this._pMatrixInvalid=!1),this._pMatrix},set:function(value){this._pMatrix=value,this.pInvalidateMatrix()},enumerable:!0,configurable:!0}),Object.defineProperty(ProjectionBase.prototype,"near",{get:function(){return this._pNear},set:function(value){value!=this._pNear&&(this._pNear=value,this.pInvalidateMatrix())},enumerable:!0,configurable:!0}),Object.defineProperty(ProjectionBase.prototype,"originX",{get:function(){return this._pOriginX},set:function(value){this._pOriginX!=value&&(this._pOriginX=value)},enumerable:!0,configurable:!0}),Object.defineProperty(ProjectionBase.prototype,"originY",{get:function(){return this._pOriginY},set:function(value){this._pOriginY!=value&&(this._pOriginY=value)},enumerable:!0,configurable:!0}),Object.defineProperty(ProjectionBase.prototype,"far",{get:function(){return this._pFar},set:function(value){value!=this._pFar&&(this._pFar=value,this.pInvalidateMatrix())},enumerable:!0,configurable:!0}),ProjectionBase.prototype.project=function(point3d){var v=this.matrix.transformVector(point3d);return v.x=v.x/v.w,v.y=-v.y/v.w,v.z=point3d.z,v},Object.defineProperty(ProjectionBase.prototype,"unprojectionMatrix",{get:function(){return this._unprojectionInvalid&&(this._unprojection||(this._unprojection=new away.geom.Matrix3D),this._unprojection.copyFrom(this.matrix),this._unprojection.invert(),this._unprojectionInvalid=!1),this._unprojection},enumerable:!0,configurable:!0}),ProjectionBase.prototype.unproject=function(){throw new away.errors.AbstractMethodError -},ProjectionBase.prototype.clone=function(){throw new away.errors.AbstractMethodError},Object.defineProperty(ProjectionBase.prototype,"_iAspectRatio",{get:function(){return this._pAspectRatio},set:function(value){this._pAspectRatio!=value&&(this._pAspectRatio=value,this.pInvalidateMatrix())},enumerable:!0,configurable:!0}),ProjectionBase.prototype.pInvalidateMatrix=function(){this._pMatrixInvalid=!0,this._unprojectionInvalid=!0,this.dispatchEvent(new away.events.ProjectionEvent(away.events.ProjectionEvent.MATRIX_CHANGED,this))},ProjectionBase.prototype.pUpdateMatrix=function(){throw new away.errors.AbstractMethodError},ProjectionBase.prototype._iUpdateScissorRect=function(x,y,width,height){this._pScissorRect.x=x,this._pScissorRect.y=y,this._pScissorRect.width=width,this._pScissorRect.height=height,this.pInvalidateMatrix()},ProjectionBase.prototype._iUpdateViewport=function(x,y,width,height){this._pViewPort.x=x,this._pViewPort.y=y,this._pViewPort.width=width,this._pViewPort.height=height,this.pInvalidateMatrix()},ProjectionBase}(away.events.EventDispatcher);projections.ProjectionBase=ProjectionBase}(away.projections||(away.projections={}));away.projections}(away||(away={}));var away;!function(away){!function(projections){var PerspectiveProjection=function(_super){function PerspectiveProjection(fieldOfView,coordinateSystem){"undefined"==typeof fieldOfView&&(fieldOfView=60),"undefined"==typeof coordinateSystem&&(coordinateSystem="leftHanded"),_super.call(this,coordinateSystem),this._fieldOfView=60,this._focalLength=1e3,this._hFieldOfView=60,this._hFocalLength=1e3,this._preserveAspectRatio=!0,this._preserveFocalLength=!1,this.fieldOfView=fieldOfView}return __extends(PerspectiveProjection,_super),Object.defineProperty(PerspectiveProjection.prototype,"preserveAspectRatio",{get:function(){return this._preserveAspectRatio},set:function(value){this._preserveAspectRatio!=value&&(this._preserveAspectRatio=value,this._preserveAspectRatio&&this.pInvalidateMatrix())},enumerable:!0,configurable:!0}),Object.defineProperty(PerspectiveProjection.prototype,"preserveFocalLength",{get:function(){return this._preserveFocalLength},set:function(value){this._preserveFocalLength!=value&&(this._preserveFocalLength=value,this.pInvalidateMatrix())},enumerable:!0,configurable:!0}),Object.defineProperty(PerspectiveProjection.prototype,"fieldOfView",{get:function(){return this._fieldOfView},set:function(value){this._fieldOfView!=value&&(this._fieldOfView=value,this.pInvalidateMatrix())},enumerable:!0,configurable:!0}),Object.defineProperty(PerspectiveProjection.prototype,"focalLength",{get:function(){return this._focalLength},set:function(value){this._focalLength!=value&&(this._focalLength=value,this.pInvalidateMatrix())},enumerable:!0,configurable:!0}),Object.defineProperty(PerspectiveProjection.prototype,"hFieldOfView",{get:function(){return this._hFieldOfView},set:function(value){this._hFieldOfView!=value&&(this._hFieldOfView=value,this._hFocalLength=1/Math.tan(this._hFieldOfView*Math.PI/360),this.pInvalidateMatrix())},enumerable:!0,configurable:!0}),Object.defineProperty(PerspectiveProjection.prototype,"hFocalLength",{get:function(){return this._hFocalLength},set:function(value){this._hFocalLength!=value&&(this._hFocalLength=value,this.pInvalidateMatrix())},enumerable:!0,configurable:!0}),PerspectiveProjection.prototype.unproject=function(nX,nY,sZ){var v=new away.geom.Vector3D(nX,-nY,sZ,1);return v.x*=sZ,v.y*=sZ,v=this.unprojectionMatrix.transformVector(v),v.z=sZ,v},PerspectiveProjection.prototype.clone=function(){var clone=new PerspectiveProjection(this._fieldOfView);return clone._pNear=this._pNear,clone._pFar=this._pFar,clone._pAspectRatio=this._pAspectRatio,clone._pCoordinateSystem=this._pCoordinateSystem,clone},PerspectiveProjection.prototype.pUpdateMatrix=function(){var raw=[];this._preserveFocalLength?(this._preserveAspectRatio&&(this._hFocalLength=this._focalLength),this._fieldOfView=360*Math.atan(.5*this._pScissorRect.height/this._focalLength)/Math.PI,this._hFieldOfView=360*Math.atan(.5*this._pScissorRect.width/this._hFocalLength)/Math.PI):(this._focalLength=.5*this._pScissorRect.height/Math.tan(this._fieldOfView*Math.PI/360),this._hFocalLength=this._preserveAspectRatio?this._focalLength:.5*this._pScissorRect.width/Math.tan(this._hFieldOfView*Math.PI/360));var left,right,top,bottom,tanMinX=-this._pOriginX/this._hFocalLength,tanMaxX=(1-this._pOriginX)/this._hFocalLength,tanMinY=-this._pOriginY/this._focalLength,tanMaxY=(1-this._pOriginY)/this._focalLength,center=-((tanMinX-tanMaxX)*this._pScissorRect.x+tanMinX*this._pScissorRect.width),middle=(tanMinY-tanMaxY)*this._pScissorRect.y+tanMinY*this._pScissorRect.height;left=center-(tanMaxX-tanMinX)*this._pViewPort.width,right=center,top=middle,bottom=middle+(tanMaxY-tanMinY)*this._pViewPort.height,raw[0]=2/(right-left),raw[5]=2/(bottom-top),raw[8]=(right+left)/(right-left),raw[9]=(bottom+top)/(bottom-top),raw[10]=(this._pFar+this._pNear)/(this._pFar-this._pNear),raw[11]=1,raw[1]=raw[2]=raw[3]=raw[4]=raw[6]=raw[7]=raw[12]=raw[13]=raw[15]=0,raw[14]=-2*this._pFar*this._pNear/(this._pFar-this._pNear),this._pCoordinateSystem==projections.CoordinateSystem.RIGHT_HANDED&&(raw[5]=-raw[5]),this._pMatrix.copyRawDataFrom(raw),this._pFrustumCorners[0]=this._pFrustumCorners[9]=this._pNear*left,this._pFrustumCorners[3]=this._pFrustumCorners[6]=this._pNear*right,this._pFrustumCorners[1]=this._pFrustumCorners[4]=this._pNear*top,this._pFrustumCorners[7]=this._pFrustumCorners[10]=this._pNear*bottom,this._pFrustumCorners[12]=this._pFrustumCorners[21]=this._pFar*left,this._pFrustumCorners[15]=this._pFrustumCorners[18]=this._pFar*right,this._pFrustumCorners[13]=this._pFrustumCorners[16]=this._pFar*top,this._pFrustumCorners[19]=this._pFrustumCorners[22]=this._pFar*bottom,this._pFrustumCorners[2]=this._pFrustumCorners[5]=this._pFrustumCorners[8]=this._pFrustumCorners[11]=this._pNear,this._pFrustumCorners[14]=this._pFrustumCorners[17]=this._pFrustumCorners[20]=this._pFrustumCorners[23]=this._pFar,this._pMatrixInvalid=!1},PerspectiveProjection}(projections.ProjectionBase);projections.PerspectiveProjection=PerspectiveProjection}(away.projections||(away.projections={}));away.projections}(away||(away={}));var away;!function(away){!function(projections){var FreeMatrixProjection=function(_super){function FreeMatrixProjection(){_super.call(this),this._pMatrix.copyFrom((new projections.PerspectiveProjection).matrix)}return __extends(FreeMatrixProjection,_super),Object.defineProperty(FreeMatrixProjection.prototype,"near",{set:function(value){this._pNear=value},enumerable:!0,configurable:!0}),Object.defineProperty(FreeMatrixProjection.prototype,"far",{set:function(value){this._pFar=value},enumerable:!0,configurable:!0}),Object.defineProperty(FreeMatrixProjection.prototype,"iAspectRatio",{set:function(value){this._pAspectRatio=value},enumerable:!0,configurable:!0}),FreeMatrixProjection.prototype.clone=function(){var clone=new FreeMatrixProjection;return clone._pMatrix.copyFrom(this._pMatrix),clone._pNear=this._pNear,clone._pFar=this._pFar,clone._pAspectRatio=this._pAspectRatio,clone.pInvalidateMatrix(),clone},FreeMatrixProjection.prototype.pUpdateMatrix=function(){this._pMatrixInvalid=!1},FreeMatrixProjection}(projections.ProjectionBase);projections.FreeMatrixProjection=FreeMatrixProjection}(away.projections||(away.projections={}));away.projections}(away||(away={}));var away;!function(away){!function(projections){var OrthographicProjection=function(_super){function OrthographicProjection(projectionHeight){"undefined"==typeof projectionHeight&&(projectionHeight=500),_super.call(this),this._projectionHeight=projectionHeight}return __extends(OrthographicProjection,_super),Object.defineProperty(OrthographicProjection.prototype,"projectionHeight",{get:function(){return this._projectionHeight},set:function(value){value!=this._projectionHeight&&(this._projectionHeight=value,this.pInvalidateMatrix())},enumerable:!0,configurable:!0}),OrthographicProjection.prototype.unproject=function(nX,nY,sZ){var v=new away.geom.Vector3D(nX+this.matrix.rawData[12],-nY+this.matrix.rawData[13],sZ,1);return v=this.unprojectionMatrix.transformVector(v),v.z=sZ,v},OrthographicProjection.prototype.clone=function(){var clone=new OrthographicProjection;return clone._pNear=this._pNear,clone._pFar=this._pFar,clone._pAspectRatio=this._pAspectRatio,clone.projectionHeight=this._projectionHeight,clone},OrthographicProjection.prototype.pUpdateMatrix=function(){var raw=[];this._yMax=.5*this._projectionHeight,this._xMax=this._yMax*this._pAspectRatio;var left,right,top,bottom;if(0==this._pScissorRect.x&&0==this._pScissorRect.y&&this._pScissorRect.width==this._pViewPort.width&&this._pScissorRect.height==this._pViewPort.height)left=-this._xMax,right=this._xMax,top=-this._yMax,bottom=this._yMax,raw[0]=2/(this._projectionHeight*this._pAspectRatio),raw[5]=2/this._projectionHeight,raw[10]=1/(this._pFar-this._pNear),raw[14]=this._pNear/(this._pNear-this._pFar),raw[1]=raw[2]=raw[3]=raw[4]=raw[6]=raw[7]=raw[8]=raw[9]=raw[11]=raw[12]=raw[13]=0,raw[15]=1;else{var xWidth=this._xMax*(this._pViewPort.width/this._pScissorRect.width),yHgt=this._yMax*(this._pViewPort.height/this._pScissorRect.height),center=this._xMax*(2*this._pScissorRect.x-this._pViewPort.width)/this._pScissorRect.width+this._xMax,middle=-this._yMax*(2*this._pScissorRect.y-this._pViewPort.height)/this._pScissorRect.height-this._yMax;left=center-xWidth,right=center+xWidth,top=middle-yHgt,bottom=middle+yHgt,raw[0]=2/(right-left),raw[5]=-2/(top-bottom),raw[10]=1/(this._pFar-this._pNear),raw[12]=(right+left)/(right-left),raw[13]=(bottom+top)/(bottom-top),raw[14]=this._pNear/(this.near-this.far),raw[1]=raw[2]=raw[3]=raw[4]=raw[6]=raw[7]=raw[8]=raw[9]=raw[11]=0,raw[15]=1}this._pFrustumCorners[0]=this._pFrustumCorners[9]=this._pFrustumCorners[12]=this._pFrustumCorners[21]=left,this._pFrustumCorners[3]=this._pFrustumCorners[6]=this._pFrustumCorners[15]=this._pFrustumCorners[18]=right,this._pFrustumCorners[1]=this._pFrustumCorners[4]=this._pFrustumCorners[13]=this._pFrustumCorners[16]=top,this._pFrustumCorners[7]=this._pFrustumCorners[10]=this._pFrustumCorners[19]=this._pFrustumCorners[22]=bottom,this._pFrustumCorners[2]=this._pFrustumCorners[5]=this._pFrustumCorners[8]=this._pFrustumCorners[11]=this._pNear,this._pFrustumCorners[14]=this._pFrustumCorners[17]=this._pFrustumCorners[20]=this._pFrustumCorners[23]=this._pFar,this._pMatrix.copyRawDataFrom(raw),this._pMatrixInvalid=!1},OrthographicProjection}(projections.ProjectionBase);projections.OrthographicProjection=OrthographicProjection}(away.projections||(away.projections={}));away.projections}(away||(away={}));var away;!function(away){!function(projections){var OrthographicOffCenterProjection=function(_super){function OrthographicOffCenterProjection(minX,maxX,minY,maxY){_super.call(this),this._minX=minX,this._maxX=maxX,this._minY=minY,this._maxY=maxY}return __extends(OrthographicOffCenterProjection,_super),Object.defineProperty(OrthographicOffCenterProjection.prototype,"minX",{get:function(){return this._minX},set:function(value){this._minX=value,this.pInvalidateMatrix()},enumerable:!0,configurable:!0}),Object.defineProperty(OrthographicOffCenterProjection.prototype,"maxX",{get:function(){return this._maxX},set:function(value){this._maxX=value,this.pInvalidateMatrix()},enumerable:!0,configurable:!0}),Object.defineProperty(OrthographicOffCenterProjection.prototype,"minY",{get:function(){return this._minY},set:function(value){this._minY=value,this.pInvalidateMatrix()},enumerable:!0,configurable:!0}),Object.defineProperty(OrthographicOffCenterProjection.prototype,"maxY",{get:function(){return this._maxY},set:function(value){this._maxY=value,this.pInvalidateMatrix()},enumerable:!0,configurable:!0}),OrthographicOffCenterProjection.prototype.unproject=function(nX,nY,sZ){var v=new away.geom.Vector3D(nX,-nY,sZ,1);return v=this.unprojectionMatrix.transformVector(v),v.z=sZ,v},OrthographicOffCenterProjection.prototype.clone=function(){var clone=new OrthographicOffCenterProjection(this._minX,this._maxX,this._minY,this._maxY);return clone._pNear=this._pNear,clone._pFar=this._pFar,clone._pAspectRatio=this._pAspectRatio,clone},OrthographicOffCenterProjection.prototype.pUpdateMatrix=function(){var raw=[],w=1/(this._maxX-this._minX),h=1/(this._maxY-this._minY),d=1/(this._pFar-this._pNear);raw[0]=2*w,raw[5]=2*h,raw[10]=d,raw[12]=-(this._maxX+this._minX)*w,raw[13]=-(this._maxY+this._minY)*h,raw[14]=-this._pNear*d,raw[15]=1,raw[1]=raw[2]=raw[3]=raw[4]=raw[6]=raw[7]=raw[8]=raw[9]=raw[11]=0,this._pMatrix.copyRawDataFrom(raw),this._pFrustumCorners[0]=this._pFrustumCorners[9]=this._pFrustumCorners[12]=this._pFrustumCorners[21]=this._minX,this._pFrustumCorners[3]=this._pFrustumCorners[6]=this._pFrustumCorners[15]=this._pFrustumCorners[18]=this._maxX,this._pFrustumCorners[1]=this._pFrustumCorners[4]=this._pFrustumCorners[13]=this._pFrustumCorners[16]=this._minY,this._pFrustumCorners[7]=this._pFrustumCorners[10]=this._pFrustumCorners[19]=this._pFrustumCorners[22]=this._maxY,this._pFrustumCorners[2]=this._pFrustumCorners[5]=this._pFrustumCorners[8]=this._pFrustumCorners[11]=this._pNear,this._pFrustumCorners[14]=this._pFrustumCorners[17]=this._pFrustumCorners[20]=this._pFrustumCorners[23]=this._pFar,this._pMatrixInvalid=!1},OrthographicOffCenterProjection}(projections.ProjectionBase);projections.OrthographicOffCenterProjection=OrthographicOffCenterProjection}(away.projections||(away.projections={}));away.projections}(away||(away={}));var away;!function(away){!function(projections){var ObliqueNearPlaneProjection=function(_super){function ObliqueNearPlaneProjection(baseProjection,plane){_super.call(this),this.baseProjection=baseProjection,this.plane=plane,this._onProjectionMatrixChangedDelegate=away.utils.Delegate.create(this,this.onProjectionMatrixChanged)}return __extends(ObliqueNearPlaneProjection,_super),Object.defineProperty(ObliqueNearPlaneProjection.prototype,"frustumCorners",{get:function(){return this._baseProjection.frustumCorners},enumerable:!0,configurable:!0}),Object.defineProperty(ObliqueNearPlaneProjection.prototype,"near",{get:function(){return this._baseProjection.near},set:function(value){this._baseProjection.near=value},enumerable:!0,configurable:!0}),Object.defineProperty(ObliqueNearPlaneProjection.prototype,"far",{get:function(){return this._baseProjection.far},set:function(value){this._baseProjection.far=value},enumerable:!0,configurable:!0}),Object.defineProperty(ObliqueNearPlaneProjection.prototype,"iAspectRatio",{get:function(){return this._baseProjection._iAspectRatio},set:function(value){this._baseProjection._iAspectRatio=value},enumerable:!0,configurable:!0}),Object.defineProperty(ObliqueNearPlaneProjection.prototype,"plane",{get:function(){return this._plane},set:function(value){this._plane=value,this.pInvalidateMatrix()},enumerable:!0,configurable:!0}),Object.defineProperty(ObliqueNearPlaneProjection.prototype,"baseProjection",{set:function(value){this._baseProjection&&this._baseProjection.removeEventListener(away.events.ProjectionEvent.MATRIX_CHANGED,this._onProjectionMatrixChangedDelegate),this._baseProjection=value,this._baseProjection&&this._baseProjection.addEventListener(away.events.ProjectionEvent.MATRIX_CHANGED,this._onProjectionMatrixChangedDelegate),this.pInvalidateMatrix()},enumerable:!0,configurable:!0}),ObliqueNearPlaneProjection.prototype.onProjectionMatrixChanged=function(){this.pInvalidateMatrix()},ObliqueNearPlaneProjection.prototype.pUpdateMatrix=function(){this._pMatrix.copyFrom(this._baseProjection.matrix);var cx=this._plane.a,cy=this._plane.b,cz=this._plane.c,cw=-this._plane.d+.05,signX=cx>=0?1:-1,signY=cy>=0?1:-1,p=new away.geom.Vector3D(signX,signY,1,1),inverse=this._pMatrix.clone();inverse.invert();var q=inverse.transformVector(p);this._pMatrix.copyRowTo(3,p);var a=(q.x*p.x+q.y*p.y+q.z*p.z+q.w*p.w)/(cx*q.x+cy*q.y+cz*q.z+cw*q.w);this._pMatrix.copyRowFrom(2,new away.geom.Vector3D(cx*a,cy*a,cz*a,cw*a))},ObliqueNearPlaneProjection}(projections.ProjectionBase);projections.ObliqueNearPlaneProjection=ObliqueNearPlaneProjection}(away.projections||(away.projections={}));away.projections}(away||(away={}));var away;!function(away){!function(entities){var Camera=function(_super){function Camera(projection){"undefined"==typeof projection&&(projection=null),_super.call(this),this._viewProjection=new away.geom.Matrix3D,this._viewProjectionDirty=!0,this._frustumPlanesDirty=!0,this._pIsEntity=!0,this._onProjectionMatrixChangedDelegate=away.utils.Delegate.create(this,this.onProjectionMatrixChanged),this._projection=projection||new away.projections.PerspectiveProjection,this._projection.addEventListener(away.events.ProjectionEvent.MATRIX_CHANGED,this._onProjectionMatrixChangedDelegate),this._frustumPlanes=[];for(var i=0;6>i;++i)this._frustumPlanes[i]=new away.geom.Plane3D;this.z=-1e3}return __extends(Camera,_super),Camera.prototype.pCreateDefaultBoundingVolume=function(){return new away.bounds.NullBounds},Camera.prototype.pCreateEntityPartitionNode=function(){return new away.partition.CameraNode(this)},Object.defineProperty(Camera.prototype,"assetType",{get:function(){return away.library.AssetType.CAMERA},enumerable:!0,configurable:!0}),Camera.prototype.onProjectionMatrixChanged=function(event){this._viewProjectionDirty=!0,this._frustumPlanesDirty=!0,this.dispatchEvent(event)},Object.defineProperty(Camera.prototype,"frustumPlanes",{get:function(){return this._frustumPlanesDirty&&this.updateFrustum(),this._frustumPlanes},enumerable:!0,configurable:!0}),Camera.prototype.updateFrustum=function(){var a,b,c,c11,c12,c13,c14,c21,c22,c23,c24,c31,c32,c33,c34,c41,c42,c43,c44,p,invLen,raw=new Array(16);this.viewProjection.copyRawDataTo(raw),c11=raw[0],c12=raw[4],c13=raw[8],c14=raw[12],c21=raw[1],c22=raw[5],c23=raw[9],c24=raw[13],c31=raw[2],c32=raw[6],c33=raw[10],c34=raw[14],c41=raw[3],c42=raw[7],c43=raw[11],c44=raw[15],p=this._frustumPlanes[0],a=c41+c11,b=c42+c12,c=c43+c13,invLen=1/Math.sqrt(a*a+b*b+c*c),p.a=a*invLen,p.b=b*invLen,p.c=c*invLen,p.d=-(c44+c14)*invLen,p=this._frustumPlanes[1],a=c41-c11,b=c42-c12,c=c43-c13,invLen=1/Math.sqrt(a*a+b*b+c*c),p.a=a*invLen,p.b=b*invLen,p.c=c*invLen,p.d=(c14-c44)*invLen,p=this._frustumPlanes[2],a=c41+c21,b=c42+c22,c=c43+c23,invLen=1/Math.sqrt(a*a+b*b+c*c),p.a=a*invLen,p.b=b*invLen,p.c=c*invLen,p.d=-(c44+c24)*invLen,p=this._frustumPlanes[3],a=c41-c21,b=c42-c22,c=c43-c23,invLen=1/Math.sqrt(a*a+b*b+c*c),p.a=a*invLen,p.b=b*invLen,p.c=c*invLen,p.d=(c24-c44)*invLen,p=this._frustumPlanes[4],a=c31,b=c32,c=c33,invLen=1/Math.sqrt(a*a+b*b+c*c),p.a=a*invLen,p.b=b*invLen,p.c=c*invLen,p.d=-c34*invLen,p=this._frustumPlanes[5],a=c41-c31,b=c42-c32,c=c43-c33,invLen=1/Math.sqrt(a*a+b*b+c*c),p.a=a*invLen,p.b=b*invLen,p.c=c*invLen,p.d=(c34-c44)*invLen,this._frustumPlanesDirty=!1},Camera.prototype.pInvalidateSceneTransform=function(){_super.prototype.pInvalidateSceneTransform.call(this),this._viewProjectionDirty=!0,this._frustumPlanesDirty=!0},Camera.prototype.pUpdateBounds=function(){this._pBoundsInvalid=!1,this._pBounds.nullify()},Object.defineProperty(Camera.prototype,"projection",{get:function(){return this._projection},set:function(value){if(this._projection!=value){if(!value)throw new Error("Projection cannot be null!");this._projection.removeEventListener(away.events.ProjectionEvent.MATRIX_CHANGED,this._onProjectionMatrixChangedDelegate),this._projection=value,this._projection.addEventListener(away.events.ProjectionEvent.MATRIX_CHANGED,this._onProjectionMatrixChangedDelegate),this.dispatchEvent(new away.events.CameraEvent(away.events.CameraEvent.PROJECTION_CHANGED,this))}},enumerable:!0,configurable:!0}),Object.defineProperty(Camera.prototype,"viewProjection",{get:function(){return this._viewProjectionDirty&&(this._viewProjection.copyFrom(this.inverseSceneTransform),this._viewProjection.append(this._projection.matrix),this._viewProjectionDirty=!1),this._viewProjection},enumerable:!0,configurable:!0}),Camera.prototype.getRay=function(nX,nY,sZ){return this.sceneTransform.deltaTransformVector(this._projection.unproject(nX,nY,sZ))},Camera.prototype.project=function(point3d){return this._projection.project(this.inverseSceneTransform.transformVector(point3d))},Camera.prototype.unproject=function(nX,nY,sZ){return this.sceneTransform.transformVector(this._projection.unproject(nX,nY,sZ))},Camera.prototype._iCollectRenderables=function(renderer){this._iSourcePrefab&&this._iSourcePrefab._iValidate(),this._iCollectRenderable(renderer)},Camera.prototype._iCollectRenderable=function(){},Camera}(away.containers.DisplayObjectContainer);entities.Camera=Camera}(away.entities||(away.entities={}));away.entities}(away||(away={}));var away;!function(away){!function(materials){var AbstractMethodError=away.errors.AbstractMethodError,ShadowCasterCollector=away.traverse.ShadowCasterCollector,RenderTexture=away.textures.RenderTexture,ShadowMapperBase=function(){function ShadowMapperBase(){this._pDepthMapSize=2048,this._autoUpdateShadows=!0,this._pCasterCollector=this.pCreateCasterCollector()}return ShadowMapperBase.prototype.pCreateCasterCollector=function(){return new ShadowCasterCollector},Object.defineProperty(ShadowMapperBase.prototype,"autoUpdateShadows",{get:function(){return this._autoUpdateShadows},set:function(value){this._autoUpdateShadows=value},enumerable:!0,configurable:!0}),ShadowMapperBase.prototype.updateShadows=function(){this._iShadowsInvalid=!0},ShadowMapperBase.prototype.iSetDepthMap=function(depthMap){this._depthMap!=depthMap&&(this._depthMap&&!this._explicitDepthMap&&this._depthMap.dispose(),this._depthMap=depthMap,this._depthMap?(this._explicitDepthMap=!0,this._pDepthMapSize=this._depthMap.size):this._explicitDepthMap=!1)},Object.defineProperty(ShadowMapperBase.prototype,"light",{get:function(){return this._pLight},set:function(value){this._pLight=value},enumerable:!0,configurable:!0}),Object.defineProperty(ShadowMapperBase.prototype,"depthMap",{get:function(){return this._depthMap||(this._depthMap=this.pCreateDepthTexture()),this._depthMap},enumerable:!0,configurable:!0}),Object.defineProperty(ShadowMapperBase.prototype,"depthMapSize",{get:function(){return this._pDepthMapSize},set:function(value){value!=this._pDepthMapSize&&this._pSetDepthMapSize(value)},enumerable:!0,configurable:!0}),ShadowMapperBase.prototype.dispose=function(){this._pCasterCollector=null,this._depthMap&&!this._explicitDepthMap&&this._depthMap.dispose(),this._depthMap=null},ShadowMapperBase.prototype.pCreateDepthTexture=function(){return new RenderTexture(this._pDepthMapSize,this._pDepthMapSize)},ShadowMapperBase.prototype.iRenderDepthMap=function(stage,entityCollector,renderer){this._iShadowsInvalid=!1,this.pUpdateDepthProjection(entityCollector.camera),this._depthMap||(this._depthMap=this.pCreateDepthTexture()),this.pDrawDepthMap(this._depthMap,entityCollector.scene,renderer)},ShadowMapperBase.prototype.pUpdateDepthProjection=function(){throw new AbstractMethodError},ShadowMapperBase.prototype.pDrawDepthMap=function(){throw new AbstractMethodError},ShadowMapperBase.prototype._pSetDepthMapSize=function(value){if(this._pDepthMapSize=value,this._explicitDepthMap)throw Error("Cannot set depth map size for the current renderer.");this._depthMap&&(this._depthMap.dispose(),this._depthMap=null)},ShadowMapperBase}();materials.ShadowMapperBase=ShadowMapperBase}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var Camera=away.entities.Camera,CubeMapShadowMapper=function(_super){function CubeMapShadowMapper(){_super.call(this),this._pDepthMapSize=512,this._needsRender=new Array,this.initCameras()}return __extends(CubeMapShadowMapper,_super),CubeMapShadowMapper.prototype.initCameras=function(){this._depthCameras=new Array,this._projections=new Array,this.addCamera(0,90,0),this.addCamera(0,-90,0),this.addCamera(-90,0,0),this.addCamera(90,0,0),this.addCamera(0,0,0),this.addCamera(0,180,0)},CubeMapShadowMapper.prototype.addCamera=function(rotationX,rotationY,rotationZ){var cam=new Camera;cam.rotationX=rotationX,cam.rotationY=rotationY,cam.rotationZ=rotationZ,cam.projection.near=.01;var projection=cam.projection;projection.fieldOfView=90,this._projections.push(projection),cam.projection._iAspectRatio=1,this._depthCameras.push(cam)},CubeMapShadowMapper.prototype.pCreateDepthTexture=function(){throw new away.errors.PartialImplementationError},CubeMapShadowMapper.prototype.pUpdateDepthProjection=function(){for(var light=this._pLight,maxDistance=light._pFallOff,pos=this._pLight.scenePosition,i=0;6>i;++i)this._projections[i].far=maxDistance,this._depthCameras[i].transform.position=pos,this._needsRender[i]=!0},CubeMapShadowMapper.prototype.pDrawDepthMap=function(target,scene,renderer){for(var i=0;6>i;++i)this._needsRender[i]&&(this._pCasterCollector.camera=this._depthCameras[i],this._pCasterCollector.clear(),scene.traversePartitions(this._pCasterCollector),renderer._iRender(this._pCasterCollector,target,null,i))},CubeMapShadowMapper}(materials.ShadowMapperBase);materials.CubeMapShadowMapper=CubeMapShadowMapper}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var Camera=away.entities.Camera,Matrix3D=away.geom.Matrix3D,FreeMatrixProjection=away.projections.FreeMatrixProjection,DirectionalShadowMapper=function(_super){function DirectionalShadowMapper(){_super.call(this),this._pLightOffset=1e4,this._pSnap=64,this._pCullPlanes=[],this._pOverallDepthProjection=new FreeMatrixProjection,this._pOverallDepthCamera=new Camera(this._pOverallDepthProjection),this._pLocalFrustum=[],this._pMatrix=new Matrix3D}return __extends(DirectionalShadowMapper,_super),Object.defineProperty(DirectionalShadowMapper.prototype,"snap",{get:function(){return this._pSnap},set:function(value){this._pSnap=value},enumerable:!0,configurable:!0}),Object.defineProperty(DirectionalShadowMapper.prototype,"lightOffset",{get:function(){return this._pLightOffset},set:function(value){this._pLightOffset=value},enumerable:!0,configurable:!0}),Object.defineProperty(DirectionalShadowMapper.prototype,"iDepthProjection",{get:function(){return this._pOverallDepthCamera.viewProjection},enumerable:!0,configurable:!0}),Object.defineProperty(DirectionalShadowMapper.prototype,"depth",{get:function(){return this._pMaxZ-this._pMinZ},enumerable:!0,configurable:!0}),DirectionalShadowMapper.prototype.pDrawDepthMap=function(target,scene,renderer){this._pCasterCollector.camera=this._pOverallDepthCamera,this._pCasterCollector.cullPlanes=this._pCullPlanes,this._pCasterCollector.clear(),scene.traversePartitions(this._pCasterCollector),renderer._iRender(this._pCasterCollector,target)},DirectionalShadowMapper.prototype.pUpdateCullPlanes=function(viewCamera){var lightFrustumPlanes=this._pOverallDepthCamera.frustumPlanes,viewFrustumPlanes=viewCamera.frustumPlanes;this._pCullPlanes.length=4,this._pCullPlanes[0]=lightFrustumPlanes[0],this._pCullPlanes[1]=lightFrustumPlanes[1],this._pCullPlanes[2]=lightFrustumPlanes[2],this._pCullPlanes[3]=lightFrustumPlanes[3];for(var light=this._pLight,dir=light.sceneDirection,dirX=dir.x,dirY=dir.y,dirZ=dir.z,j=4,i=0;6>i;++i){var plane=viewFrustumPlanes[i];plane.a*dirX+plane.b*dirY+plane.c*dirZ<0&&(this._pCullPlanes[j++]=plane)}},DirectionalShadowMapper.prototype.pUpdateDepthProjection=function(viewCamera){this.pUpdateProjectionFromFrustumCorners(viewCamera,viewCamera.projection.frustumCorners,this._pMatrix),this._pOverallDepthProjection.matrix=this._pMatrix,this.pUpdateCullPlanes(viewCamera)},DirectionalShadowMapper.prototype.pUpdateProjectionFromFrustumCorners=function(viewCamera,corners,matrix){var dir,x,y,z,minX,minY,maxX,maxY,i,raw=new Array,light=this._pLight;for(dir=light.sceneDirection,this._pOverallDepthCamera.transform.matrix3D=this._pLight.sceneTransform,x=Math.floor((viewCamera.x-dir.x*this._pLightOffset)/this._pSnap)*this._pSnap,y=Math.floor((viewCamera.y-dir.y*this._pLightOffset)/this._pSnap)*this._pSnap,z=Math.floor((viewCamera.z-dir.z*this._pLightOffset)/this._pSnap)*this._pSnap,this._pOverallDepthCamera.x=x,this._pOverallDepthCamera.y=y,this._pOverallDepthCamera.z=z,this._pMatrix.copyFrom(this._pOverallDepthCamera.inverseSceneTransform),this._pMatrix.prepend(viewCamera.sceneTransform),this._pMatrix.transformVectors(corners,this._pLocalFrustum),minX=maxX=this._pLocalFrustum[0],minY=maxY=this._pLocalFrustum[1],this._pMaxZ=this._pLocalFrustum[2],i=3;24>i;)x=this._pLocalFrustum[i],y=this._pLocalFrustum[i+1],z=this._pLocalFrustum[i+2],minX>x&&(minX=x),x>maxX&&(maxX=x),minY>y&&(minY=y),y>maxY&&(maxY=y),z>this._pMaxZ&&(this._pMaxZ=z),i+=3;this._pMinZ=1;var w=maxX-minX,h=maxY-minY,d=1/(this._pMaxZ-this._pMinZ);0>minX&&(minX-=this._pSnap),0>minY&&(minY-=this._pSnap),minX=Math.floor(minX/this._pSnap)*this._pSnap,minY=Math.floor(minY/this._pSnap)*this._pSnap;var snap2=2*this._pSnap;w=Math.floor(w/snap2+2)*snap2,h=Math.floor(h/snap2+2)*snap2,maxX=minX+w,maxY=minY+h,w=1/w,h=1/h,raw[0]=2*w,raw[5]=2*h,raw[10]=d,raw[12]=-(maxX+minX)*w,raw[13]=-(maxY+minY)*h,raw[14]=-this._pMinZ*d,raw[15]=1,raw[1]=raw[2]=raw[3]=raw[4]=raw[6]=raw[7]=raw[8]=raw[9]=raw[11]=0,matrix.copyRawDataFrom(raw)},DirectionalShadowMapper}(materials.ShadowMapperBase);materials.DirectionalShadowMapper=DirectionalShadowMapper}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var Camera=away.entities.Camera,Event=away.events.Event,EventDispatcher=away.events.EventDispatcher,Matrix3DUtils=away.geom.Matrix3DUtils,Rectangle=away.geom.Rectangle,FreeMatrixProjection=away.projections.FreeMatrixProjection,CascadeShadowMapper=function(_super){function CascadeShadowMapper(numCascades){if("undefined"==typeof numCascades&&(numCascades=3),_super.call(this),this._pScissorRectsInvalid=!0,1>numCascades||numCascades>4)throw new Error("numCascades must be an integer between 1 and 4");this._numCascades=numCascades,this._changeDispatcher=new EventDispatcher(this),this.init()}return __extends(CascadeShadowMapper,_super),CascadeShadowMapper.prototype.getSplitRatio=function(index){return this._splitRatios[index]},CascadeShadowMapper.prototype.setSplitRatio=function(index,value){if(0>value?value=0:value>1&&(value=1),index>=this._numCascades)throw new Error("index must be smaller than the number of cascades!");this._splitRatios[index]=value},CascadeShadowMapper.prototype.getDepthProjections=function(partition){return this._depthCameras[partition].viewProjection},CascadeShadowMapper.prototype.init=function(){this._splitRatios=new Array(this._numCascades),this._nearPlaneDistances=new Array(this._numCascades);for(var s=1,i=this._numCascades-1;i>=0;--i)this._splitRatios[i]=s,s*=.4;for(this._texOffsetsX=Array(-1,1,-1,1),this._texOffsetsY=Array(1,1,-1,-1),this._pScissorRects=new Array(4),this._depthLenses=new Array,this._depthCameras=new Array,i=0;ivalue||value>4)throw new Error("numCascades must be an integer between 1 and 4");this._numCascades=value,this.invalidateScissorRects(),this.init(),this.dispatchEvent(new Event(Event.CHANGE))}},enumerable:!0,configurable:!0}),CascadeShadowMapper.prototype.pDrawDepthMap=function(target,scene,renderer){this._pScissorRectsInvalid&&this.updateScissorRects(),this._pCasterCollector.cullPlanes=this._pCullPlanes,this._pCasterCollector.camera=this._pOverallDepthCamera,this._pCasterCollector.clear(),scene.traversePartitions(this._pCasterCollector),renderer._iRenderCascades(this._pCasterCollector,target,this._numCascades,this._pScissorRects,this._depthCameras) -},CascadeShadowMapper.prototype.updateScissorRects=function(){var half=.5*this._pDepthMapSize;this._pScissorRects[0]=new Rectangle(0,0,half,half),this._pScissorRects[1]=new Rectangle(half,0,half,half),this._pScissorRects[2]=new Rectangle(0,half,half,half),this._pScissorRects[3]=new Rectangle(half,half,half,half),this._pScissorRectsInvalid=!1},CascadeShadowMapper.prototype.pUpdateDepthProjection=function(viewCamera){var matrix,projection=viewCamera.projection,projectionNear=projection.near,projectionRange=projection.far-projectionNear;this.pUpdateProjectionFromFrustumCorners(viewCamera,viewCamera.projection.frustumCorners,this._pMatrix),this._pMatrix.appendScale(.96,.96,1),this._pOverallDepthProjection.matrix=this._pMatrix,this.pUpdateCullPlanes(viewCamera);for(var i=0;ii;)xN=this._pLocalFrustum[i],yN=this._pLocalFrustum[i+1],zN=this._pLocalFrustum[i+2],xF=xN+(this._pLocalFrustum[i+12]-xN)*splitRatio,yF=yN+(this._pLocalFrustum[i+13]-yN)*splitRatio,zF=zN+(this._pLocalFrustum[i+14]-zN)*splitRatio,minX>xN&&(minX=xN),xN>maxX&&(maxX=xN),minY>yN&&(minY=yN),yN>maxY&&(maxY=yN),zN>maxZ&&(maxZ=zN),minX>xF&&(minX=xF),xF>maxX&&(maxX=xF),minY>yF&&(minY=yF),yF>maxY&&(maxY=yF),zF>maxZ&&(maxZ=zF),i+=3;minZ=1;var w=maxX-minX,h=maxY-minY,d=1/(maxZ-minZ);0>minX&&(minX-=this._pSnap),0>minY&&(minY-=this._pSnap),minX=Math.floor(minX/this._pSnap)*this._pSnap,minY=Math.floor(minY/this._pSnap)*this._pSnap;var snap2=2*this._pSnap;w=Math.floor(w/snap2+1)*snap2,h=Math.floor(h/snap2+1)*snap2,maxX=minX+w,maxY=minY+h,w=1/w,h=1/h,raw[0]=2*w,raw[5]=2*h,raw[10]=d,raw[12]=-(maxX+minX)*w,raw[13]=-(maxY+minY)*h,raw[14]=-minZ*d,raw[15]=1,raw[1]=raw[2]=raw[3]=raw[4]=raw[6]=raw[7]=raw[8]=raw[9]=raw[11]=0,matrix.copyRawDataFrom(raw),matrix.appendScale(.96,.96,1),matrix.appendTranslation(texOffsetX,texOffsetY,0),matrix.appendScale(.5,.5,1)},CascadeShadowMapper.prototype.addEventListener=function(type,listener){this._changeDispatcher.addEventListener(type,listener)},CascadeShadowMapper.prototype.removeEventListener=function(type,listener){this._changeDispatcher.removeEventListener(type,listener)},CascadeShadowMapper.prototype.dispatchEvent=function(event){return this._changeDispatcher.dispatchEvent(event)},CascadeShadowMapper.prototype.hasEventListener=function(type){return this._changeDispatcher.hasEventListener(type)},Object.defineProperty(CascadeShadowMapper.prototype,"_iNearPlaneDistances",{get:function(){return this._nearPlaneDistances},enumerable:!0,configurable:!0}),CascadeShadowMapper}(materials.DirectionalShadowMapper);materials.CascadeShadowMapper=CascadeShadowMapper}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var NearDirectionalShadowMapper=function(_super){function NearDirectionalShadowMapper(coverageRatio){"undefined"==typeof coverageRatio&&(coverageRatio=.5),_super.call(this),this.coverageRatio=coverageRatio}return __extends(NearDirectionalShadowMapper,_super),Object.defineProperty(NearDirectionalShadowMapper.prototype,"coverageRatio",{get:function(){return this._coverageRatio},set:function(value){value>1?value=1:0>value&&(value=0),this._coverageRatio=value},enumerable:!0,configurable:!0}),NearDirectionalShadowMapper.prototype.pUpdateDepthProjection=function(viewCamera){for(var corners=viewCamera.projection.frustumCorners,i=0;12>i;++i){var v=corners[i];this._pLocalFrustum[i]=v,this._pLocalFrustum[i+12]=v+(corners[i+12]-v)*this._coverageRatio}this.pUpdateProjectionFromFrustumCorners(viewCamera,this._pLocalFrustum,this._pMatrix),this._pOverallDepthProjection.matrix=this._pMatrix},NearDirectionalShadowMapper}(materials.DirectionalShadowMapper);materials.NearDirectionalShadowMapper=NearDirectionalShadowMapper}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(entities){var MaterialEvent=away.events.MaterialEvent,Billboard=function(_super){function Billboard(material,pixelSnapping,smoothing){"undefined"==typeof pixelSnapping&&(pixelSnapping="auto"),"undefined"==typeof smoothing&&(smoothing=!1);var _this=this;_super.call(this),this._pIsEntity=!0,this.onSizeChangedDelegate=function(event){return _this.onSizeChanged(event)},this.material=material,this._billboardWidth=material.width,this._billboardHeight=material.height}return __extends(Billboard,_super),Object.defineProperty(Billboard.prototype,"animator",{get:function(){return this._animator},enumerable:!0,configurable:!0}),Object.defineProperty(Billboard.prototype,"assetType",{get:function(){return away.library.AssetType.BILLBOARD},enumerable:!0,configurable:!0}),Object.defineProperty(Billboard.prototype,"billboardHeight",{get:function(){return this._billboardHeight},enumerable:!0,configurable:!0}),Object.defineProperty(Billboard.prototype,"billboardWidth",{get:function(){return this._billboardWidth},enumerable:!0,configurable:!0}),Object.defineProperty(Billboard.prototype,"material",{get:function(){return this._material},set:function(value){value!=this._material&&(this._material&&(this._material.iRemoveOwner(this),this._material.removeEventListener(MaterialEvent.SIZE_CHANGED,this.onSizeChangedDelegate)),this._material=value,this._material&&(this._material.iAddOwner(this),this._material.addEventListener(MaterialEvent.SIZE_CHANGED,this.onSizeChangedDelegate)))},enumerable:!0,configurable:!0}),Object.defineProperty(Billboard.prototype,"uvTransform",{get:function(){return this._uvTransform},set:function(value){this._uvTransform=value},enumerable:!0,configurable:!0}),Billboard.prototype.pCreateEntityPartitionNode=function(){return new away.partition.EntityNode(this)},Billboard.prototype.pUpdateBounds=function(){this._pBounds.fromExtremes(0,0,0,this._billboardWidth,this._billboardHeight,0),_super.prototype.pUpdateBounds.call(this)},Billboard.prototype._iTestCollision=function(shortestCollisionDistance){return this._pPickingCollider.testBillboardCollision(this,this._pPickingCollisionVO,shortestCollisionDistance)},Billboard.prototype.onSizeChanged=function(){this._billboardWidth=this._material.width,this._billboardHeight=this._material.height,this._pBoundsInvalid=!0;for(var len=this._pRenderables.length,i=0;len>i;i++)this._pRenderables[i].invalidateVertexData("vertices")},Billboard.prototype._iCollectRenderables=function(renderer){this._iSourcePrefab&&this._iSourcePrefab._iValidate(),this._iCollectRenderable(renderer)},Billboard.prototype._iCollectRenderable=function(renderer){renderer.applyBillboard(this)},Billboard}(away.base.DisplayObject);entities.Billboard=Billboard}(away.entities||(away.entities={}));away.entities}(away||(away={}));var away;!function(away){!function(entities){var NullBounds=away.bounds.NullBounds,Matrix3D=away.geom.Matrix3D,Vector3D=away.geom.Vector3D,DirectionalShadowMapper=away.materials.DirectionalShadowMapper,DirectionalLightNode=away.partition.DirectionalLightNode,DirectionalLight=function(_super){function DirectionalLight(xDir,yDir,zDir){"undefined"==typeof xDir&&(xDir=0),"undefined"==typeof yDir&&(yDir=-1),"undefined"==typeof zDir&&(zDir=1),_super.call(this),this._pIsEntity=!0,this.direction=new Vector3D(xDir,yDir,zDir),this._sceneDirection=new Vector3D}return __extends(DirectionalLight,_super),Object.defineProperty(DirectionalLight.prototype,"sceneDirection",{get:function(){return this._pSceneTransformDirty&&this.pUpdateSceneTransform(),this._sceneDirection},enumerable:!0,configurable:!0}),Object.defineProperty(DirectionalLight.prototype,"direction",{get:function(){return this._direction},set:function(value){this._direction=value,this._tmpLookAt||(this._tmpLookAt=new Vector3D),this._tmpLookAt.x=this.x+this._direction.x,this._tmpLookAt.y=this.y+this._direction.y,this._tmpLookAt.z=this.z+this._direction.z,this.lookAt(this._tmpLookAt)},enumerable:!0,configurable:!0}),DirectionalLight.prototype.pCreateDefaultBoundingVolume=function(){return new NullBounds},DirectionalLight.prototype.pUpdateBounds=function(){},DirectionalLight.prototype.pUpdateSceneTransform=function(){_super.prototype.pUpdateSceneTransform.call(this),this.sceneTransform.copyColumnTo(2,this._sceneDirection),this._sceneDirection.normalize()},DirectionalLight.prototype.pCreateShadowMapper=function(){return new DirectionalShadowMapper},DirectionalLight.prototype.pCreateEntityPartitionNode=function(){return new DirectionalLightNode(this)},DirectionalLight.prototype.iGetObjectProjectionMatrix=function(entity,camera,target){"undefined"==typeof target&&(target=null);var raw=new Array,bounds=entity.bounds,m=new Matrix3D;m.copyFrom(entity.getRenderSceneTransform(camera)),m.append(this.inverseSceneTransform),this._projAABBPoints||(this._projAABBPoints=[]),m.transformVectors(bounds.aabbPoints,this._projAABBPoints);for(var d,xMin=1/0,xMax=-1/0,yMin=1/0,yMax=-1/0,zMin=1/0,zMax=-1/0,i=0;24>i;)d=this._projAABBPoints[i++],xMin>d&&(xMin=d),d>xMax&&(xMax=d),d=this._projAABBPoints[i++],yMin>d&&(yMin=d),d>yMax&&(yMax=d),d=this._projAABBPoints[i++],zMin>d&&(zMin=d),d>zMax&&(zMax=d);var invXRange=1/(xMax-xMin),invYRange=1/(yMax-yMin),invZRange=1/(zMax-zMin);return raw[0]=2*invXRange,raw[5]=2*invYRange,raw[10]=invZRange,raw[12]=-(xMax+xMin)*invXRange,raw[13]=-(yMax+yMin)*invYRange,raw[14]=-zMin*invZRange,raw[1]=raw[2]=raw[3]=raw[4]=raw[6]=raw[7]=raw[8]=raw[9]=raw[11]=0,raw[15]=1,target||(target=new Matrix3D),target.copyRawDataFrom(raw),target.prepend(m),target},DirectionalLight.prototype._iCollectRenderables=function(){},DirectionalLight}(away.base.LightBase);entities.DirectionalLight=DirectionalLight}(away.entities||(away.entities={}));away.entities}(away||(away={}));var away;!function(away){!function(entities){var NullBounds=away.bounds.NullBounds,LightProbeNode=away.partition.LightProbeNode,LightProbe=function(_super){function LightProbe(diffuseMap,specularMap){"undefined"==typeof specularMap&&(specularMap=null),_super.call(this),this._pIsEntity=!0,this._diffuseMap=diffuseMap,this._specularMap=specularMap}return __extends(LightProbe,_super),Object.defineProperty(LightProbe.prototype,"diffuseMap",{get:function(){return this._diffuseMap},set:function(value){this._diffuseMap=value},enumerable:!0,configurable:!0}),Object.defineProperty(LightProbe.prototype,"specularMap",{get:function(){return this._specularMap},set:function(value){this._specularMap=value},enumerable:!0,configurable:!0}),LightProbe.prototype.pCreateEntityPartitionNode=function(){return new LightProbeNode(this)},LightProbe.prototype.pUpdateBounds=function(){this._pBoundsInvalid=!1},LightProbe.prototype.pCreateDefaultBoundingVolume=function(){return new NullBounds},LightProbe.prototype.iGetObjectProjectionMatrix=function(entity,camera,target){throw"undefined"==typeof target&&(target=null),new away.errors.Error("Object projection matrices are not supported for LightProbe objects!")},LightProbe.prototype._iCollectRenderables=function(){},LightProbe}(away.base.LightBase);entities.LightProbe=LightProbe}(away.entities||(away.entities={}));away.entities}(away||(away={}));var away;!function(away){!function(entities){var MaterialEvent=away.events.MaterialEvent,EntityNode=away.partition.EntityNode,LineSegment=function(_super){function LineSegment(material,startPosition,endPosition,thickness){"undefined"==typeof thickness&&(thickness=1);var _this=this;_super.call(this),this._pIsEntity=!0,this.onSizeChangedDelegate=function(event){return _this.onSizeChanged(event)},this.material=material,this._startPosition=startPosition,this._endPosition=endPosition,this._halfThickness=.5*thickness}return __extends(LineSegment,_super),Object.defineProperty(LineSegment.prototype,"animator",{get:function(){return this._animator},enumerable:!0,configurable:!0}),Object.defineProperty(LineSegment.prototype,"assetType",{get:function(){return away.library.AssetType.LINE_SEGMENT},enumerable:!0,configurable:!0}),Object.defineProperty(LineSegment.prototype,"startPostion",{get:function(){return this._startPosition},enumerable:!0,configurable:!0}),Object.defineProperty(LineSegment.prototype,"startPosition",{set:function(value){this._startPosition!=value&&(this._startPosition=value,this.notifyRenderableUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(LineSegment.prototype,"endPosition",{get:function(){return this._endPosition},set:function(value){this._endPosition!=value&&(this._endPosition=value,this.notifyRenderableUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(LineSegment.prototype,"material",{get:function(){return this._material},set:function(value){value!=this._material&&(this._material&&(this._material.iRemoveOwner(this),this._material.removeEventListener(MaterialEvent.SIZE_CHANGED,this.onSizeChangedDelegate)),this._material=value,this._material&&(this._material.iAddOwner(this),this._material.addEventListener(MaterialEvent.SIZE_CHANGED,this.onSizeChangedDelegate)))},enumerable:!0,configurable:!0}),Object.defineProperty(LineSegment.prototype,"thickness",{get:function(){return 2*this._halfThickness},set:function(value){this._halfThickness!=value&&(this._halfThickness=.5*value,this.notifyRenderableUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(LineSegment.prototype,"uvTransform",{get:function(){return this._uvTransform},set:function(value){this._uvTransform=value},enumerable:!0,configurable:!0}),LineSegment.prototype.dispose=function(){this._startPosition=null,this._endPosition=null},LineSegment.prototype.pCreateEntityPartitionNode=function(){return new EntityNode(this)},LineSegment.prototype.pUpdateBounds=function(){this._pBounds.fromExtremes(this._startPosition.x,this._startPosition.y,this._startPosition.z,this._endPosition.x,this._endPosition.y,this._endPosition.z),_super.prototype.pUpdateBounds.call(this)},LineSegment.prototype.onSizeChanged=function(){this.notifyRenderableUpdate()},LineSegment.prototype.notifyRenderableUpdate=function(){for(var len=this._pRenderables.length,i=0;len>i;i++)this._pRenderables[i].invalidateVertexData("vertices")},LineSegment.prototype._iCollectRenderables=function(renderer){this._iSourcePrefab&&this._iSourcePrefab._iValidate(),this._iCollectRenderable(renderer)},LineSegment.prototype._iCollectRenderable=function(){},LineSegment}(away.base.DisplayObject);entities.LineSegment=LineSegment}(away.entities||(away.entities={}));away.entities}(away||(away={}));var away;!function(away){!function(entities){var Geometry=away.base.Geometry,GeometryEvent=away.events.GeometryEvent,Mesh=function(_super){function Mesh(geometry,material){"undefined"==typeof material&&(material=null);var _this=this;_super.call(this),this._castsShadows=!0,this._shareAnimationGeometry=!0,this._pIsEntity=!0,this._subMeshes=new Array,this._onGeometryBoundsInvalidDelegate=function(event){return _this.onGeometryBoundsInvalid(event)},this._onSubGeometryAddedDelegate=function(event){return _this.onSubGeometryAdded(event)},this._onSubGeometryRemovedDelegate=function(event){return _this.onSubGeometryRemoved(event)},this.geometry=geometry||new Geometry,this.material=material}return __extends(Mesh,_super),Object.defineProperty(Mesh.prototype,"animator",{get:function(){return this._animator},set:function(value){this._animator&&this._animator.removeOwner(this),this._animator=value;for(var subMesh,len=this._subMeshes.length,i=0;len>i;++i)subMesh=this._subMeshes[i],subMesh.material&&(subMesh.material.iRemoveOwner(subMesh),subMesh.material.iAddOwner(subMesh)),subMesh._iInvalidateRenderableGeometry();this._animator&&this._animator.addOwner(this)},enumerable:!0,configurable:!0}),Object.defineProperty(Mesh.prototype,"assetType",{get:function(){return away.library.AssetType.MESH},enumerable:!0,configurable:!0}),Object.defineProperty(Mesh.prototype,"castsShadows",{get:function(){return this._castsShadows},set:function(value){this._castsShadows=value},enumerable:!0,configurable:!0}),Object.defineProperty(Mesh.prototype,"geometry",{get:function(){return this._iSourcePrefab&&this._iSourcePrefab._iValidate(),this._geometry},set:function(value){var i;if(this._geometry){for(this._geometry.removeEventListener(GeometryEvent.BOUNDS_INVALID,this._onGeometryBoundsInvalidDelegate),this._geometry.removeEventListener(GeometryEvent.SUB_GEOMETRY_ADDED,this._onSubGeometryAddedDelegate),this._geometry.removeEventListener(GeometryEvent.SUB_GEOMETRY_REMOVED,this._onSubGeometryRemovedDelegate),i=0;ii;i++)this._material&&(subMesh=this._subMeshes[i]).material==this._material&&this._material.iRemoveOwner(subMesh);for(this._material=value,i=0;len>i;i++)this._material&&(subMesh=this._subMeshes[i]).material==this._material&&this._material.iAddOwner(subMesh)}},enumerable:!0,configurable:!0}),Object.defineProperty(Mesh.prototype,"shareAnimationGeometry",{get:function(){return this._shareAnimationGeometry},set:function(value){this._shareAnimationGeometry=value},enumerable:!0,configurable:!0}),Object.defineProperty(Mesh.prototype,"subMeshes",{get:function(){return this._iSourcePrefab&&this._iSourcePrefab._iValidate(),this._subMeshes},enumerable:!0,configurable:!0}),Object.defineProperty(Mesh.prototype,"uvTransform",{get:function(){return this._uvTransform},set:function(value){this._uvTransform=value},enumerable:!0,configurable:!0}),Mesh.prototype.bakeTransformations=function(){this.geometry.applyTransformation(this._iMatrix3D),this._iMatrix3D.identity()},Mesh.prototype.dispose=function(){_super.prototype.dispose.call(this),this.material=null,this.geometry=null},Mesh.prototype.disposeWithAnimatorAndChildren=function(){this.disposeWithChildren(),this._animator&&this._animator.dispose()},Mesh.prototype.clone=function(){var clone=new Mesh(this._geometry,this._material);clone._iMatrix3D=this._iMatrix3D,clone.pivot=this.pivot,clone.partition=this.partition,clone.bounds=this.bounds.clone(),clone.name=this.name,clone.castsShadows=this.castsShadows,clone.shareAnimationGeometry=this.shareAnimationGeometry,clone.mouseEnabled=this.mouseEnabled,clone.mouseChildren=this.mouseChildren,clone.extra=this.extra;for(var len=this._subMeshes.length,i=0;len>i;++i)clone._subMeshes[i].material=this._subMeshes[i]._iGetExplicitMaterial();len=this.numChildren;var obj;for(i=0;len>i;++i)obj=this.getChildAt(i).clone(),clone.addChild(obj);return this._animator&&(clone.animator=this._animator.clone()),clone},Mesh.prototype.getSubMeshFromSubGeometry=function(subGeometry){return this._subMeshes[this._geometry.subGeometries.indexOf(subGeometry)]},Mesh.prototype.pCreateEntityPartitionNode=function(){return new away.partition.EntityNode(this)},Mesh.prototype.pUpdateBounds=function(){this._pBounds.fromGeometry(this._geometry),_super.prototype.pUpdateBounds.call(this)},Mesh.prototype.onGeometryBoundsInvalid=function(){this.pInvalidateBounds()},Mesh.prototype.onSubGeometryAdded=function(event){this.addSubMesh(event.subGeometry)},Mesh.prototype.onSubGeometryRemoved=function(event){var subMesh,i,subGeom=event.subGeometry,len=this._subMeshes.length;for(i=0;len>i;++i)if(subMesh=this._subMeshes[i],subMesh.subGeometry==subGeom){subMesh.dispose(),this._subMeshes.splice(i,1);break}for(--len;len>i;++i)this._subMeshes[i]._iIndex=i},Mesh.prototype.addSubMesh=function(subGeometry){var SubMeshClass=subGeometry.subMeshClass,subMesh=new SubMeshClass(subGeometry,this,null),len=this._subMeshes.length;subMesh._iIndex=len,this._subMeshes[len]=subMesh,this.pInvalidateBounds()},Mesh.prototype._iTestCollision=function(shortestCollisionDistance,findClosest){return this._pPickingCollider.testMeshCollision(this,this._pPickingCollisionVO,shortestCollisionDistance,findClosest)},Mesh.prototype._iCollectRenderables=function(renderer){this._iSourcePrefab&&this._iSourcePrefab._iValidate();for(var len=this._subMeshes.length,i=0;len>i;i++)this._subMeshes[i]._iCollectRenderable(renderer)},Mesh.prototype._iInvalidateRenderableGeometries=function(){for(var len=this._subMeshes.length,i=0;len>i;++i)this._subMeshes[i]._iInvalidateRenderableGeometry()},Mesh}(away.containers.DisplayObjectContainer);entities.Mesh=Mesh}(away.entities||(away.entities={}));away.entities}(away||(away={}));var away;!function(away){!function(entities){var BoundingSphere=away.bounds.BoundingSphere,Matrix3D=away.geom.Matrix3D,Vector3D=away.geom.Vector3D,CubeMapShadowMapper=away.materials.CubeMapShadowMapper,PointLightNode=away.partition.PointLightNode,PointLight=function(_super){function PointLight(){_super.call(this),this._pRadius=9e4,this._pFallOff=1e5,this._pIsEntity=!0,this._pFallOffFactor=1/(this._pFallOff*this._pFallOff-this._pRadius*this._pRadius)}return __extends(PointLight,_super),PointLight.prototype.pCreateShadowMapper=function(){return new CubeMapShadowMapper},Object.defineProperty(PointLight.prototype,"radius",{get:function(){return this._pRadius},set:function(value){this._pRadius=value,this._pRadius<0?this._pRadius=0:this._pRadius>this._pFallOff&&(this._pFallOff=this._pRadius,this.pInvalidateBounds()),this._pFallOffFactor=1/(this._pFallOff*this._pFallOff-this._pRadius*this._pRadius)},enumerable:!0,configurable:!0}),PointLight.prototype.iFallOffFactor=function(){return this._pFallOffFactor},Object.defineProperty(PointLight.prototype,"fallOff",{get:function(){return this._pFallOff},set:function(value){this._pFallOff=value,this._pFallOff<0&&(this._pFallOff=0),this._pFallOffd2?d1:d2),z=m.rawData[14];return zMin=z-d,zMax=z+d,raw[5]=raw[0]=zMin/d,raw[10]=zMax/(zMax-zMin),raw[11]=1,raw[1]=raw[2]=raw[3]=raw[4]=raw[6]=raw[7]=raw[8]=raw[9]=raw[12]=raw[13]=raw[15]=0,raw[14]=-zMin*raw[10],target||(target=new Matrix3D),target.copyRawDataFrom(raw),target.prepend(m),target},PointLight.prototype._iCollectRenderables=function(){},PointLight}(away.base.LightBase);entities.PointLight=PointLight}(away.entities||(away.entities={}));away.entities}(away||(away={}));var away;!function(away){!function(entities){var Shape=function(_super){function Shape(){_super.call(this)}return __extends(Shape,_super),Object.defineProperty(Shape.prototype,"graphics",{get:function(){return this._graphics},enumerable:!0,configurable:!0}),Shape}(away.base.DisplayObject);entities.Shape=Shape}(away.entities||(away.entities={}));away.entities}(away||(away={}));var away;!function(away){!function(entities){var NullBounds=away.bounds.NullBounds,SkyboxNode=away.partition.SkyboxNode,Skybox=function(_super){function Skybox(material){_super.call(this),this._pIsEntity=!0,this.material=material}return __extends(Skybox,_super),Object.defineProperty(Skybox.prototype,"animator",{get:function(){return this._animator},enumerable:!0,configurable:!0}),Object.defineProperty(Skybox.prototype,"uvTransform",{get:function(){return this._uvTransform},set:function(value){this._uvTransform=value},enumerable:!0,configurable:!0}),Object.defineProperty(Skybox.prototype,"material",{get:function(){return this._material},set:function(value){value!=this._material&&(this._material&&this._material.iRemoveOwner(this),this._material=value,this._material&&this._material.iAddOwner(this))},enumerable:!0,configurable:!0}),Object.defineProperty(Skybox.prototype,"assetType",{get:function(){return away.library.AssetType.SKYBOX},enumerable:!0,configurable:!0}),Skybox.prototype.pInvalidateBounds=function(){},Skybox.prototype.pCreateEntityPartitionNode=function(){return new SkyboxNode(this)},Skybox.prototype.pCreateDefaultBoundingVolume=function(){return new NullBounds},Skybox.prototype.pUpdateBounds=function(){this._pBoundsInvalid=!1},Object.defineProperty(Skybox.prototype,"castsShadows",{get:function(){return!1},enumerable:!0,configurable:!0}),Skybox.prototype._iCollectRenderables=function(){},Skybox.prototype._iCollectRenderable=function(){},Skybox}(away.base.DisplayObject);entities.Skybox=Skybox}(away.entities||(away.entities={}));away.entities}(away||(away={}));var away;!function(away){!function(entities){var TextField=function(_super){function TextField(){_super.call(this),this._text=""}return __extends(TextField,_super),Object.defineProperty(TextField.prototype,"bottomScrollV",{get:function(){return this._bottomScrollV},enumerable:!0,configurable:!0}),Object.defineProperty(TextField.prototype,"caretIndex",{get:function(){return this._caretIndex},enumerable:!0,configurable:!0}),Object.defineProperty(TextField.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0}),TextField.prototype.maxScrollH=function(){return this._maxScrollH},TextField.prototype.maxScrollV=function(){return this._maxScrollV},Object.defineProperty(TextField.prototype,"numLines",{get:function(){return this._numLines},enumerable:!0,configurable:!0}),Object.defineProperty(TextField.prototype,"selectionBeginIndex",{get:function(){return this._selectionBeginIndex},enumerable:!0,configurable:!0}),Object.defineProperty(TextField.prototype,"selectionEndIndex",{get:function(){return this._selectionEndIndex},enumerable:!0,configurable:!0}),Object.defineProperty(TextField.prototype,"text",{get:function(){return this._text},set:function(value){this._text!=value&&(this._text=value)},enumerable:!0,configurable:!0}),Object.defineProperty(TextField.prototype,"textHeight",{get:function(){return this._textHeight},enumerable:!0,configurable:!0}),Object.defineProperty(TextField.prototype,"textInteractionMode",{get:function(){return this._textInteractionMode},enumerable:!0,configurable:!0}),Object.defineProperty(TextField.prototype,"textWidth",{get:function(){return this._textWidth},enumerable:!0,configurable:!0}),TextField.prototype.appendText=function(){},TextField.prototype.getCharBoundaries=function(){return this._charBoundaries},TextField.prototype.getCharIndexAtPoint=function(){return this._charIndexAtPoint},TextField.prototype.getFirstCharInParagraph=function(){return this._firstCharInParagraph},TextField.prototype.getImageReference=function(){return this._imageReference},TextField.prototype.getLineIndexAtPoint=function(){return this._lineIndexAtPoint},TextField.prototype.getLineIndexOfChar=function(){return this._lineIndexOfChar},TextField.prototype.getLineLength=function(){return this._lineLength},TextField.prototype.getLineMetrics=function(){return this._lineMetrics},TextField.prototype.getLineOffset=function(){return this._lineOffset},TextField.prototype.getLineText=function(){return this._lineText},TextField.prototype.getParagraphLength=function(){return this._paragraphLength},TextField.prototype.getTextFormat=function(beginIndex,endIndex){return"undefined"==typeof beginIndex&&(beginIndex=-1),"undefined"==typeof endIndex&&(endIndex=-1),this._textFormat},TextField.prototype.replaceSelectedText=function(){},TextField.prototype.replaceText=function(){},TextField.prototype.setSelection=function(){},TextField.prototype.setTextFormat=function(format,beginIndex,endIndex){"undefined"==typeof beginIndex&&(beginIndex=-1),"undefined"==typeof endIndex&&(endIndex=-1)},TextField.isFontCompatible=function(){return!1},TextField}(away.base.DisplayObject);entities.TextField=TextField}(away.entities||(away.entities={}));away.entities}(away||(away={}));var away;!function(away){!function(managers){var MouseManager=function(){function MouseManager(){var _this=this;this._viewLookup=new Array,this._nullVector=new away.geom.Vector3D,this._queuedEvents=new Array,this._mouseUp=new away.events.MouseEvent(away.events.MouseEvent.MOUSE_UP),this._mouseClick=new away.events.MouseEvent(away.events.MouseEvent.CLICK),this._mouseOut=new away.events.MouseEvent(away.events.MouseEvent.MOUSE_OUT),this._mouseDown=new away.events.MouseEvent(away.events.MouseEvent.MOUSE_DOWN),this._mouseMove=new away.events.MouseEvent(away.events.MouseEvent.MOUSE_MOVE),this._mouseOver=new away.events.MouseEvent(away.events.MouseEvent.MOUSE_OVER),this._mouseWheel=new away.events.MouseEvent(away.events.MouseEvent.MOUSE_WHEEL),this._mouseDoubleClick=new away.events.MouseEvent(away.events.MouseEvent.DOUBLE_CLICK),this.onClickDelegate=function(event){return _this.onClick(event)},this.onDoubleClickDelegate=function(event){return _this.onDoubleClick(event)},this.onMouseDownDelegate=function(event){return _this.onMouseDown(event)},this.onMouseMoveDelegate=function(event){return _this.onMouseMove(event)},this.onMouseUpDelegate=function(event){return _this.onMouseUp(event)},this.onMouseWheelDelegate=function(event){return _this.onMouseWheel(event)},this.onMouseOverDelegate=function(event){return _this.onMouseOver(event)},this.onMouseOutDelegate=function(event){return _this.onMouseOut(event)}}return MouseManager.getInstance=function(){return this._instance?this._instance:this._instance=new MouseManager},MouseManager.prototype.fireMouseEvents=function(forceMouseMove){this._iCollidingObject!=this._previousCollidingObject&&(this._previousCollidingObject&&this.queueDispatch(this._mouseOut,this._mouseMoveEvent,this._previousCollidingObject),this._iCollidingObject&&this.queueDispatch(this._mouseOver,this._mouseMoveEvent)),forceMouseMove&&this._iCollidingObject&&this.queueDispatch(this._mouseMove,this._mouseMoveEvent);for(var event,dispatcher,len=this._queuedEvents.length,i=0;len>i;++i){for(event=this._queuedEvents[i],dispatcher=event.object;dispatcher&&!dispatcher._iIsMouseEnabled();)dispatcher=dispatcher.parent;dispatcher&&dispatcher.dispatchEvent(event)}this._queuedEvents.length=0,this._previousCollidingObject=this._iCollidingObject,this._iUpdateDirty=!1},MouseManager.prototype.registerView=function(view){view.htmlElement.addEventListener("click",this.onClickDelegate),view.htmlElement.addEventListener("dblclick",this.onDoubleClickDelegate),view.htmlElement.addEventListener("mousedown",this.onMouseDownDelegate),view.htmlElement.addEventListener("mousemove",this.onMouseMoveDelegate),view.htmlElement.addEventListener("mouseup",this.onMouseUpDelegate),view.htmlElement.addEventListener("mousewheel",this.onMouseWheelDelegate),view.htmlElement.addEventListener("mouseover",this.onMouseOverDelegate),view.htmlElement.addEventListener("mouseout",this.onMouseOutDelegate),this._viewLookup.push(view) -},MouseManager.prototype.unregisterView=function(view){view.htmlElement.removeEventListener("click",this.onClickDelegate),view.htmlElement.removeEventListener("dblclick",this.onDoubleClickDelegate),view.htmlElement.removeEventListener("mousedown",this.onMouseDownDelegate),view.htmlElement.removeEventListener("mousemove",this.onMouseMoveDelegate),view.htmlElement.removeEventListener("mouseup",this.onMouseUpDelegate),view.htmlElement.removeEventListener("mousewheel",this.onMouseWheelDelegate),view.htmlElement.removeEventListener("mouseover",this.onMouseOverDelegate),view.htmlElement.removeEventListener("mouseout",this.onMouseOutDelegate),this._viewLookup.slice(this._viewLookup.indexOf(view),1)},MouseManager.prototype.queueDispatch=function(event,sourceEvent,collider){"undefined"==typeof collider&&(collider=null),sourceEvent&&(event.ctrlKey=sourceEvent.ctrlKey,event.altKey=sourceEvent.altKey,event.shiftKey=sourceEvent.shiftKey,event.screenX=sourceEvent.clientX,event.screenY=sourceEvent.clientY),null==collider&&(collider=this._iCollidingObject),collider?(event.object=collider.displayObject,event.materialOwner=collider.materialOwner,event.uv=collider.uv,event.localPosition=collider.localPosition?collider.localPosition.clone():null,event.localNormal=collider.localNormal?collider.localNormal.clone():null,event.index=collider.index):(event.uv=null,event.object=null,event.localPosition=this._nullVector,event.localNormal=this._nullVector,event.index=0,event.subGeometryIndex=0),this._queuedEvents.push(event)},MouseManager.prototype.onMouseMove=function(event){this.updateColliders(event),this._iCollidingObject&&this.queueDispatch(this._mouseMove,this._mouseMoveEvent=event)},MouseManager.prototype.onMouseOut=function(event){this._iActiveDiv=null,this.updateColliders(event),this._iCollidingObject&&this.queueDispatch(this._mouseOut,event)},MouseManager.prototype.onMouseOver=function(event){this._iActiveDiv=event.target,this.updateColliders(event),this._iCollidingObject&&this.queueDispatch(this._mouseOver,event)},MouseManager.prototype.onClick=function(event){this.updateColliders(event),this._iCollidingObject&&this.queueDispatch(this._mouseClick,event)},MouseManager.prototype.onDoubleClick=function(event){this.updateColliders(event),this._iCollidingObject&&this.queueDispatch(this._mouseDoubleClick,event)},MouseManager.prototype.onMouseDown=function(event){this._iActiveDiv=event.target,this.updateColliders(event),this._iCollidingObject&&this.queueDispatch(this._mouseDown,event)},MouseManager.prototype.onMouseUp=function(event){this.updateColliders(event),this._iCollidingObject&&this.queueDispatch(this._mouseUp,event)},MouseManager.prototype.onMouseWheel=function(event){this.updateColliders(event),this._iCollidingObject&&this.queueDispatch(this._mouseWheel,event)},MouseManager.prototype.updateColliders=function(event){if(!this._iUpdateDirty){for(var view,bounds,mouseX=event.clientX,mouseY=event.clientY,len=this._viewLookup.length,i=0;len>i;i++)if(view=this._viewLookup[i],bounds=view.htmlElement.getBoundingClientRect(),mouseXbounds.right||mouseYbounds.bottom)view._pMouseX=null,view._pMouseY=null;else if(view._pMouseX=mouseX+bounds.left,view._pMouseY=mouseY+bounds.top,view.updateCollider(),view.layeredView&&this._iCollidingObject)break;this._iUpdateDirty=!0}},MouseManager}();managers.MouseManager=MouseManager}(away.managers||(away.managers={}));away.managers}(away||(away={}));var away;!function(away){!function(managers){var Stage=away.base.Stage,StageEvent=away.events.StageEvent,StageManager=function(_super){function StageManager(StageManagerSingletonEnforcer){var _this=this;if(_super.call(this),!StageManagerSingletonEnforcer)throw new Error("This class is a multiton and cannot be instantiated manually. Use StageManager.getInstance instead.");this._stages=new Array(StageManager.STAGE_MAX_QUANTITY),this._onContextCreatedDelegate=function(event){return _this.onContextCreated(event)}}return __extends(StageManager,_super),StageManager.getInstance=function(){return null==this._instance&&(this._instance=new StageManager(new StageManagerSingletonEnforcer)),this._instance},StageManager.prototype.getStageAt=function(index,forceSoftware,profile,mode){if("undefined"==typeof forceSoftware&&(forceSoftware=!1),"undefined"==typeof profile&&(profile="baseline"),"undefined"==typeof mode&&(mode="auto"),0>index||index>=StageManager.STAGE_MAX_QUANTITY)throw new away.errors.ArgumentError("Index is out of bounds [0.."+StageManager.STAGE_MAX_QUANTITY+"]");if(!this._stages[index]){StageManager._numStages++;var canvas=document.createElement("canvas");canvas.id="stage"+index,document.body.appendChild(canvas);var stage=this._stages[index]=new Stage(canvas,index,this,forceSoftware,profile);stage.addEventListener(StageEvent.CONTEXT_CREATED,this._onContextCreatedDelegate),stage.requestContext(forceSoftware,profile,mode)}return stage},StageManager.prototype.iRemoveStage=function(stage){StageManager._numStages--,stage.removeEventListener(StageEvent.CONTEXT_CREATED,this._onContextCreatedDelegate),this._stages[stage.stageIndex]=null},StageManager.prototype.getFreeStage=function(forceSoftware,profile,mode){"undefined"==typeof forceSoftware&&(forceSoftware=!1),"undefined"==typeof profile&&(profile="baseline"),"undefined"==typeof mode&&(mode="auto");for(var i=0,len=this._stages.length;len>i;){if(!this._stages[i])return this.getStageAt(i,forceSoftware,profile,mode);++i}return null},Object.defineProperty(StageManager.prototype,"hasFreeStage",{get:function(){return StageManager._numStagesi;i++)this.removeListeners(this._loadingSessions[i]),this._loadingSessions[i].stop(),this._loadingSessions[i]=null;this._loadingSessions=null},Loader.prototype.load=function(request,context,ns,parser){"undefined"==typeof context&&(context=null),"undefined"==typeof ns&&(ns=null),"undefined"==typeof parser&&(parser=null);var token;if(this._useAssetLib){var lib;lib=away.library.AssetLibraryBundle.getInstance(this._assetLibId),token=lib.load(request,context,ns,parser)}else{var loader=new AssetLoader;this._loadingSessions.push(loader),token=loader.load(request,context,ns,parser)}return token.addEventListener(away.events.LoaderEvent.RESOURCE_COMPLETE,this._onResourceCompleteDelegate),token.addEventListener(away.events.AssetEvent.ASSET_COMPLETE,this._onAssetCompleteDelegate),token._iLoader._iAddErrorHandler(this.onLoadError),token._iLoader._iAddParseErrorHandler(this.onParseError),token},Loader.prototype.loadData=function(data,context,ns,parser){"undefined"==typeof context&&(context=null),"undefined"==typeof ns&&(ns=null),"undefined"==typeof parser&&(parser=null);var token;if(this._useAssetLib){var lib;lib=away.library.AssetLibraryBundle.getInstance(this._assetLibId),token=lib.loadData(data,context,ns,parser)}else{var loader=new AssetLoader;this._loadingSessions.push(loader),token=loader.loadData(data,"",context,ns,parser)}return token.addEventListener(away.events.LoaderEvent.RESOURCE_COMPLETE,this._onResourceCompleteDelegate),token.addEventListener(away.events.AssetEvent.ASSET_COMPLETE,this._onAssetCompleteDelegate),token._iLoader._iAddErrorHandler(this.onLoadError),token._iLoader._iAddParseErrorHandler(this.onParseError),token},Loader.prototype.unload=function(){},Loader.enableParser=function(parserClass){AssetLoader.enableParser(parserClass)},Loader.enableParsers=function(parserClasses){AssetLoader.enableParsers(parserClasses)},Loader.prototype.removeListeners=function(dispatcher){dispatcher.removeEventListener(LoaderEvent.RESOURCE_COMPLETE,this._onResourceCompleteDelegate),dispatcher.removeEventListener(AssetEvent.ASSET_COMPLETE,this._onAssetCompleteDelegate)},Loader.prototype.onAssetComplete=function(event){this.dispatchEvent(event)},Loader.prototype.onLoadError=function(event){return this.hasEventListener(IOErrorEvent.IO_ERROR)?(this.dispatchEvent(event),!0):!1},Loader.prototype.onParseError=function(event){return this.hasEventListener(ParserEvent.PARSE_ERROR)?(this.dispatchEvent(event),!0):!1},Loader.prototype.onResourceComplete=function(event){var content=event.content;this._content=content,content&&this.addChild(content),this.dispatchEvent(event)},Loader}(containers.DisplayObjectContainer);containers.Loader=Loader}(away.containers||(away.containers={}));away.containers}(away||(away={}));var away;!function(away){!function(containers){var DisplayObjectContainer=away.containers.DisplayObjectContainer,SceneEvent=away.events.SceneEvent,NodeBase=away.partition.NodeBase,Partition=away.partition.Partition,Scene=function(_super){function Scene(){_super.call(this),this._expandedPartitions=new Array,this._partitions=new Array,this._iCollectionMark=0,this._iSceneGraphRoot=new DisplayObjectContainer,this._iSceneGraphRoot._iSetScene(this),this._iSceneGraphRoot._iIsRoot=!0,this._iSceneGraphRoot.partition=new Partition(new NodeBase)}return __extends(Scene,_super),Scene.prototype.traversePartitions=function(traverser){var i=0,len=this._partitions.length;for(traverser.scene=this;len>i;)this._iCollectionMark++,this._partitions[i++].traverse(traverser)},Object.defineProperty(Scene.prototype,"partition",{get:function(){return this._iSceneGraphRoot.partition},set:function(value){this._iSceneGraphRoot.partition=value,this.dispatchEvent(new SceneEvent(SceneEvent.PARTITION_CHANGED,this._iSceneGraphRoot))},enumerable:!0,configurable:!0}),Scene.prototype.contains=function(child){return this._iSceneGraphRoot.contains(child)},Scene.prototype.addChild=function(child){return this._iSceneGraphRoot.addChild(child)},Scene.prototype.removeChild=function(child){this._iSceneGraphRoot.removeChild(child)},Scene.prototype.removeChildAt=function(index){this._iSceneGraphRoot.removeChildAt(index)},Scene.prototype.getChildAt=function(index){return this._iSceneGraphRoot.getChildAt(index)},Object.defineProperty(Scene.prototype,"numChildren",{get:function(){return this._iSceneGraphRoot.numChildren},enumerable:!0,configurable:!0}),Scene.prototype.iRegisterEntity=function(displayObject){displayObject.partition&&this.iRegisterPartition(displayObject.partition),displayObject.isEntity&&displayObject._iAssignedPartition.iMarkForUpdate(displayObject)},Scene.prototype.iRegisterPartition=function(partition){this._expandedPartitions.push(partition),-1==this._partitions.indexOf(partition)&&this._partitions.push(partition)},Scene.prototype.iUnregisterEntity=function(displayObject){displayObject.partition&&this.iUnregisterPartition(displayObject.partition),displayObject.isEntity&&displayObject._iAssignedPartition.iRemoveEntity(displayObject)},Scene.prototype.iUnregisterPartition=function(partition){this._expandedPartitions.splice(this._expandedPartitions.indexOf(partition),1),-1==this._expandedPartitions.indexOf(partition)&&this._partitions.splice(this._partitions.indexOf(partition),1)},Scene}(away.events.EventDispatcher);containers.Scene=Scene}(away.containers||(away.containers={}));away.containers}(away||(away={}));var away;!function(away){!function(containers){var Scene=away.containers.Scene,Camera=away.entities.Camera,CameraEvent=away.events.CameraEvent,SceneEvent=away.events.SceneEvent,RendererEvent=away.events.RendererEvent,MouseManager=away.managers.MouseManager,RaycastPicker=away.pick.RaycastPicker,Delegate=away.utils.Delegate,View=function(){function View(renderer,scene,camera){"undefined"==typeof scene&&(scene=null),"undefined"==typeof camera&&(camera=null),this._width=0,this._height=0,this._time=0,this._deltaTime=0,this._backgroundColor=0,this._backgroundAlpha=1,this._viewportDirty=!0,this._scissorDirty=!0,this._mousePicker=new RaycastPicker,this._onScenePartitionChangedDelegate=Delegate.create(this,this.onScenePartitionChanged),this._onProjectionChangedDelegate=Delegate.create(this,this.onProjectionChanged),this._onViewportUpdatedDelegate=Delegate.create(this,this.onViewportUpdated),this._onScissorUpdatedDelegate=Delegate.create(this,this.onScissorUpdated),this.scene=scene||new Scene,this.camera=camera||new Camera,this.renderer=renderer,document.body.style.margin="0px",this._htmlElement=document.createElement("div"),this._htmlElement.style.position="absolute",document.body.appendChild(this._htmlElement),this._mouseManager=MouseManager.getInstance(),this._mouseManager.registerView(this)}return View.prototype.onScenePartitionChanged=function(){this._pCamera&&(this._pCamera.partition=this.scene.partition)},Object.defineProperty(View.prototype,"mouseX",{get:function(){return this._pMouseX},enumerable:!0,configurable:!0}),Object.defineProperty(View.prototype,"mouseY",{get:function(){return this._pMouseY},enumerable:!0,configurable:!0}),Object.defineProperty(View.prototype,"htmlElement",{get:function(){return this._htmlElement},enumerable:!0,configurable:!0}),Object.defineProperty(View.prototype,"renderer",{get:function(){return this._pRenderer},set:function(value){this._pRenderer!=value&&(this._pRenderer&&(this._pRenderer.dispose(),this._pRenderer.removeEventListener(RendererEvent.VIEWPORT_UPDATED,this._onViewportUpdatedDelegate),this._pRenderer.removeEventListener(RendererEvent.SCISSOR_UPDATED,this._onScissorUpdatedDelegate)),this._pRenderer=value,this._pRenderer.addEventListener(RendererEvent.VIEWPORT_UPDATED,this._onViewportUpdatedDelegate),this._pRenderer.addEventListener(RendererEvent.SCISSOR_UPDATED,this._onScissorUpdatedDelegate),this._pEntityCollector=this._pRenderer._iCreateEntityCollector(),this._pCamera&&(this._pEntityCollector.camera=this._pCamera),this._pRenderer._iBackgroundR=(this._backgroundColor>>16&255)/255,this._pRenderer._iBackgroundG=(this._backgroundColor>>8&255)/255,this._pRenderer._iBackgroundB=(255&this._backgroundColor)/255,this._pRenderer._iBackgroundAlpha=this._backgroundAlpha,this._pRenderer.width=this._width,this._pRenderer.height=this._height,this._pRenderer.shareContext=this._shareContext)},enumerable:!0,configurable:!0}),Object.defineProperty(View.prototype,"shareContext",{get:function(){return this._shareContext},set:function(value){this._shareContext!=value&&(this._shareContext=value,this._pRenderer&&(this._pRenderer.shareContext=this._shareContext))},enumerable:!0,configurable:!0}),Object.defineProperty(View.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(value){this._backgroundColor!=value&&(this._backgroundColor=value,this._pRenderer._iBackgroundR=(value>>16&255)/255,this._pRenderer._iBackgroundG=(value>>8&255)/255,this._pRenderer._iBackgroundB=(255&value)/255)},enumerable:!0,configurable:!0}),Object.defineProperty(View.prototype,"backgroundAlpha",{get:function(){return this._backgroundAlpha},set:function(value){value>1?value=1:0>value&&(value=0),this._backgroundAlpha!=value&&(this._pRenderer._iBackgroundAlpha=this._backgroundAlpha=value)},enumerable:!0,configurable:!0}),Object.defineProperty(View.prototype,"camera",{get:function(){return this._pCamera},set:function(value){this._pCamera!=value&&(this._pCamera&&this._pCamera.removeEventListener(CameraEvent.PROJECTION_CHANGED,this._onProjectionChangedDelegate),this._pCamera=value,this._pEntityCollector&&(this._pEntityCollector.camera=this._pCamera),this._pScene&&(this._pCamera.partition=this._pScene.partition),this._pCamera.addEventListener(CameraEvent.PROJECTION_CHANGED,this._onProjectionChangedDelegate),this._scissorDirty=!0,this._viewportDirty=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(View.prototype,"scene",{get:function(){return this._pScene},set:function(value){this._pScene!=value&&(this._pScene&&this._pScene.removeEventListener(SceneEvent.PARTITION_CHANGED,this._onScenePartitionChangedDelegate),this._pScene=value,this._pScene.addEventListener(SceneEvent.PARTITION_CHANGED,this._onScenePartitionChangedDelegate),this._pCamera&&(this._pCamera.partition=this._pScene.partition))},enumerable:!0,configurable:!0}),Object.defineProperty(View.prototype,"deltaTime",{get:function(){return this._deltaTime},enumerable:!0,configurable:!0}),Object.defineProperty(View.prototype,"width",{get:function(){return this._width},set:function(value){this._width!=value&&(this._width=value,this._aspectRatio=this._width/this._height,this._pCamera.projection._iAspectRatio=this._aspectRatio,this._pRenderer.width=value,this._htmlElement.style.width=value+"px")},enumerable:!0,configurable:!0}),Object.defineProperty(View.prototype,"height",{get:function(){return this._height},set:function(value){this._height!=value&&(this._height=value,this._aspectRatio=this._width/this._height,this._pCamera.projection._iAspectRatio=this._aspectRatio,this._pRenderer.height=value,this._htmlElement.style.height=value+"px")},enumerable:!0,configurable:!0}),Object.defineProperty(View.prototype,"mousePicker",{get:function(){return this._mousePicker},set:function(value){this._mousePicker!=value&&(this._mousePicker=null==value?new RaycastPicker:value)},enumerable:!0,configurable:!0}),Object.defineProperty(View.prototype,"x",{get:function(){return this._pRenderer.x},set:function(value){this._pRenderer.x!=value&&(this._pRenderer.x==value,this._htmlElement.style.left=value+"px")},enumerable:!0,configurable:!0}),Object.defineProperty(View.prototype,"y",{get:function(){return this._pRenderer.y},set:function(value){this._pRenderer.y!=value&&(this._pRenderer.y==value,this._htmlElement.style.top=value+"px")},enumerable:!0,configurable:!0}),Object.defineProperty(View.prototype,"visible",{get:function(){return"visible"==this._htmlElement.style.visibility},set:function(value){this._htmlElement.style.visibility=value?"visible":"hidden"},enumerable:!0,configurable:!0}),Object.defineProperty(View.prototype,"renderedFacesCount",{get:function(){return 0},enumerable:!0,configurable:!0}),View.prototype.render=function(){this.pUpdateTime(),this._pCamera.projection._iAspectRatio=this._aspectRatio,this._scissorDirty&&(this._scissorDirty=!1,this._pCamera.projection._iUpdateScissorRect(this._pRenderer.scissorRect.x,this._pRenderer.scissorRect.y,this._pRenderer.scissorRect.width,this._pRenderer.scissorRect.height)),this._viewportDirty&&(this._viewportDirty=!1,this._pCamera.projection._iUpdateViewport(this._pRenderer.viewPort.x,this._pRenderer.viewPort.y,this._pRenderer.viewPort.width,this._pRenderer.viewPort.height)),this._shareContext||(this.forceMouseMove&&this._htmlElement==this._mouseManager._iActiveDiv&&!this._mouseManager._iUpdateDirty&&(this._mouseManager._iCollidingObject=this.mousePicker.getViewCollision(this._pMouseX,this._pMouseY,this)),this._mouseManager.fireMouseEvents(this.forceMouseMove)),this._pEntityCollector.clear(),this._pScene.traversePartitions(this._pEntityCollector),this._pRenderer.render(this._pEntityCollector)},View.prototype.pUpdateTime=function(){var time=away.utils.getTimer();0==this._time&&(this._time=time),this._deltaTime=time-this._time,this._time=time},View.prototype.dispose=function(){this._pRenderer.dispose(),this._mouseManager.unregisterView(this),this._mouseManager=null,this._pRenderer=null,this._pEntityCollector=null},Object.defineProperty(View.prototype,"iEntityCollector",{get:function(){return this._pEntityCollector},enumerable:!0,configurable:!0}),View.prototype.onProjectionChanged=function(){this._scissorDirty=!0,this._viewportDirty=!0},View.prototype.onViewportUpdated=function(){this._viewportDirty=!0},View.prototype.onScissorUpdated=function(){this._scissorDirty=!0},View.prototype.project=function(point3d){var v=this._pCamera.project(point3d);return v.x=v.x*this._pRenderer.viewPort.width/2+this._width*this._pCamera.projection.originX,v.y=v.y*this._pRenderer.viewPort.height/2+this._height*this._pCamera.projection.originY,v},View.prototype.unproject=function(sX,sY,sZ){return this._pCamera.unproject(2*(sX-this._width*this._pCamera.projection.originX)/this._pRenderer.viewPort.width,2*(sY-this._height*this._pCamera.projection.originY)/this._pRenderer.viewPort.height,sZ)},View.prototype.getRay=function(sX,sY,sZ){return this._pCamera.getRay((2*sX-this._width)/this._width,(2*sY-this._height)/this._height,sZ)},View.prototype.updateCollider=function(){if(this._shareContext){var collidingObject=this.mousePicker.getViewCollision(this._pMouseX,this._pMouseY,this);(this.layeredView||null==this._mouseManager._iCollidingObject||collidingObject.rayEntryDistanceval?1:val,this._steps!=val&&(this._steps=val,this.pNotifyUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(HoverController.prototype,"panAngle",{get:function(){return this._panAngle},set:function(val){val=Math.max(this._minPanAngle,Math.min(this._maxPanAngle,val)),this._panAngle!=val&&(this._panAngle=val,this.pNotifyUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(HoverController.prototype,"tiltAngle",{get:function(){return this._tiltAngle},set:function(val){val=Math.max(this._minTiltAngle,Math.min(this._maxTiltAngle,val)),this._tiltAngle!=val&&(this._tiltAngle=val,this.pNotifyUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(HoverController.prototype,"distance",{get:function(){return this._distance},set:function(val){this._distance!=val&&(this._distance=val,this.pNotifyUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(HoverController.prototype,"minPanAngle",{get:function(){return this._minPanAngle},set:function(val){this._minPanAngle!=val&&(this._minPanAngle=val,this.panAngle=Math.max(this._minPanAngle,Math.min(this._maxPanAngle,this._panAngle)))},enumerable:!0,configurable:!0}),Object.defineProperty(HoverController.prototype,"maxPanAngle",{get:function(){return this._maxPanAngle},set:function(val){this._maxPanAngle!=val&&(this._maxPanAngle=val,this.panAngle=Math.max(this._minPanAngle,Math.min(this._maxPanAngle,this._panAngle)))},enumerable:!0,configurable:!0}),Object.defineProperty(HoverController.prototype,"minTiltAngle",{get:function(){return this._minTiltAngle},set:function(val){this._minTiltAngle!=val&&(this._minTiltAngle=val,this.tiltAngle=Math.max(this._minTiltAngle,Math.min(this._maxTiltAngle,this._tiltAngle)))},enumerable:!0,configurable:!0}),Object.defineProperty(HoverController.prototype,"maxTiltAngle",{get:function(){return this._maxTiltAngle},set:function(val){this._maxTiltAngle!=val&&(this._maxTiltAngle=val,this.tiltAngle=Math.max(this._minTiltAngle,Math.min(this._maxTiltAngle,this._tiltAngle)))},enumerable:!0,configurable:!0}),Object.defineProperty(HoverController.prototype,"yFactor",{get:function(){return this._yFactor},set:function(val){this._yFactor!=val&&(this._yFactor=val,this.pNotifyUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(HoverController.prototype,"wrapPanAngle",{get:function(){return this._wrapPanAngle},set:function(val){this._wrapPanAngle!=val&&(this._wrapPanAngle=val,this.pNotifyUpdate())},enumerable:!0,configurable:!0}),HoverController.prototype.update=function(interpolate){if("undefined"==typeof interpolate&&(interpolate=!0),this._tiltAngle!=this._iCurrentTiltAngle||this._panAngle!=this._iCurrentPanAngle){if(this.pNotifyUpdate(),this._wrapPanAngle){for(this._panAngle<0?(this._iCurrentPanAngle+=this._panAngle%360+360-this._panAngle,this._panAngle=this._panAngle%360+360):(this._iCurrentPanAngle+=this._panAngle%360-this._panAngle,this._panAngle=this._panAngle%360);this._panAngle-this._iCurrentPanAngle<-180;)this._iCurrentPanAngle-=360;for(;this._panAngle-this._iCurrentPanAngle>180;)this._iCurrentPanAngle+=360}interpolate?(this._iCurrentTiltAngle+=(this._tiltAngle-this._iCurrentTiltAngle)/(this.steps+1),this._iCurrentPanAngle+=(this._panAngle-this._iCurrentPanAngle)/(this.steps+1)):(this._iCurrentPanAngle=this._panAngle,this._iCurrentTiltAngle=this._tiltAngle),Math.abs(this.tiltAngle-this._iCurrentTiltAngle)<.01&&Math.abs(this._panAngle-this._iCurrentPanAngle)<.01&&(this._iCurrentTiltAngle=this._tiltAngle,this._iCurrentPanAngle=this._panAngle)}var pos=this.lookAtObject?this.lookAtObject.transform.position:this.lookAtPosition?this.lookAtPosition:this._pOrigin;this.targetObject.x=pos.x+this.distance*Math.sin(this._iCurrentPanAngle*MathConsts.DEGREES_TO_RADIANS)*Math.cos(this._iCurrentTiltAngle*MathConsts.DEGREES_TO_RADIANS),this.targetObject.y=pos.y+this.distance*Math.sin(this._iCurrentTiltAngle*MathConsts.DEGREES_TO_RADIANS)*this.yFactor,this.targetObject.z=pos.z+this.distance*Math.cos(this._iCurrentPanAngle*MathConsts.DEGREES_TO_RADIANS)*Math.cos(this._iCurrentTiltAngle*MathConsts.DEGREES_TO_RADIANS),this._upAxis.x=-Math.sin(this._iCurrentPanAngle*MathConsts.DEGREES_TO_RADIANS)*Math.sin(this._iCurrentTiltAngle*MathConsts.DEGREES_TO_RADIANS),this._upAxis.y=Math.cos(this._iCurrentTiltAngle*MathConsts.DEGREES_TO_RADIANS),this._upAxis.z=-Math.cos(this._iCurrentPanAngle*MathConsts.DEGREES_TO_RADIANS)*Math.sin(this._iCurrentTiltAngle*MathConsts.DEGREES_TO_RADIANS),this._pTargetObject&&(this._pLookAtPosition?this._pTargetObject.lookAt(this._pLookAtPosition,this._upAxis):this._pLookAtObject&&this._pTargetObject.lookAt(this._pLookAtObject.scene?this._pLookAtObject.scenePosition:this._pLookAtObject.transform.position,this._upAxis)) -},HoverController}(controllers.LookAtController);controllers.HoverController=HoverController}(away.controllers||(away.controllers={}));away.controllers}(away||(away={}));var away;!function(away){!function(controllers){var FirstPersonController=function(_super){function FirstPersonController(targetObject,panAngle,tiltAngle,minTiltAngle,maxTiltAngle,steps,wrapPanAngle){"undefined"==typeof targetObject&&(targetObject=null),"undefined"==typeof panAngle&&(panAngle=0),"undefined"==typeof tiltAngle&&(tiltAngle=90),"undefined"==typeof minTiltAngle&&(minTiltAngle=-90),"undefined"==typeof maxTiltAngle&&(maxTiltAngle=90),"undefined"==typeof steps&&(steps=8),"undefined"==typeof wrapPanAngle&&(wrapPanAngle=!1),_super.call(this,targetObject),this._iCurrentPanAngle=0,this._iCurrentTiltAngle=90,this._panAngle=0,this._tiltAngle=90,this._minTiltAngle=-90,this._maxTiltAngle=90,this._steps=8,this._walkIncrement=0,this._strafeIncrement=0,this._wrapPanAngle=!1,this.fly=!1,this.panAngle=panAngle,this.tiltAngle=tiltAngle,this.minTiltAngle=minTiltAngle,this.maxTiltAngle=maxTiltAngle,this.steps=steps,this.wrapPanAngle=wrapPanAngle,this._iCurrentPanAngle=this._panAngle,this._iCurrentTiltAngle=this._tiltAngle}return __extends(FirstPersonController,_super),Object.defineProperty(FirstPersonController.prototype,"steps",{get:function(){return this._steps},set:function(val){val=1>val?1:val,this._steps!=val&&(this._steps=val,this.pNotifyUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(FirstPersonController.prototype,"panAngle",{get:function(){return this._panAngle},set:function(val){this._panAngle!=val&&(this._panAngle=val,this.pNotifyUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(FirstPersonController.prototype,"tiltAngle",{get:function(){return this._tiltAngle},set:function(val){val=Math.max(this._minTiltAngle,Math.min(this._maxTiltAngle,val)),this._tiltAngle!=val&&(this._tiltAngle=val,this.pNotifyUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(FirstPersonController.prototype,"minTiltAngle",{get:function(){return this._minTiltAngle},set:function(val){this._minTiltAngle!=val&&(this._minTiltAngle=val,this.tiltAngle=Math.max(this._minTiltAngle,Math.min(this._maxTiltAngle,this._tiltAngle)))},enumerable:!0,configurable:!0}),Object.defineProperty(FirstPersonController.prototype,"maxTiltAngle",{get:function(){return this._maxTiltAngle},set:function(val){this._maxTiltAngle!=val&&(this._maxTiltAngle=val,this.tiltAngle=Math.max(this._minTiltAngle,Math.min(this._maxTiltAngle,this._tiltAngle)))},enumerable:!0,configurable:!0}),Object.defineProperty(FirstPersonController.prototype,"wrapPanAngle",{get:function(){return this._wrapPanAngle},set:function(val){this._wrapPanAngle!=val&&(this._wrapPanAngle=val,this.pNotifyUpdate())},enumerable:!0,configurable:!0}),FirstPersonController.prototype.update=function(interpolate){if("undefined"==typeof interpolate&&(interpolate=!0),this._tiltAngle!=this._iCurrentTiltAngle||this._panAngle!=this._iCurrentPanAngle){if(this.pNotifyUpdate(),this._wrapPanAngle){for(this._panAngle<0?(this._iCurrentPanAngle+=this._panAngle%360+360-this._panAngle,this._panAngle=this._panAngle%360+360):(this._iCurrentPanAngle+=this._panAngle%360-this._panAngle,this._panAngle=this._panAngle%360);this._panAngle-this._iCurrentPanAngle<-180;)this._iCurrentPanAngle-=360;for(;this._panAngle-this._iCurrentPanAngle>180;)this._iCurrentPanAngle+=360}interpolate?(this._iCurrentTiltAngle+=(this._tiltAngle-this._iCurrentTiltAngle)/(this.steps+1),this._iCurrentPanAngle+=(this._panAngle-this._iCurrentPanAngle)/(this.steps+1)):(this._iCurrentTiltAngle=this._tiltAngle,this._iCurrentPanAngle=this._panAngle),Math.abs(this.tiltAngle-this._iCurrentTiltAngle)<.01&&Math.abs(this._panAngle-this._iCurrentPanAngle)<.01&&(this._iCurrentTiltAngle=this._tiltAngle,this._iCurrentPanAngle=this._panAngle)}this.targetObject.rotationX=this._iCurrentTiltAngle,this.targetObject.rotationY=this._iCurrentPanAngle,this._walkIncrement&&(this.fly?this.targetObject.transform.moveForward(this._walkIncrement):(this.targetObject.x+=this._walkIncrement*Math.sin(this._panAngle*away.geom.MathConsts.DEGREES_TO_RADIANS),this.targetObject.z+=this._walkIncrement*Math.cos(this._panAngle*away.geom.MathConsts.DEGREES_TO_RADIANS)),this._walkIncrement=0),this._strafeIncrement&&(this.targetObject.transform.moveRight(this._strafeIncrement),this._strafeIncrement=0)},FirstPersonController.prototype.incrementWalk=function(val){0!=val&&(this._walkIncrement+=val,this.pNotifyUpdate())},FirstPersonController.prototype.incrementStrafe=function(val){0!=val&&(this._strafeIncrement+=val,this.pNotifyUpdate())},FirstPersonController}(controllers.ControllerBase);controllers.FirstPersonController=FirstPersonController}(away.controllers||(away.controllers={}));away.controllers}(away||(away={}));var away;!function(away){!function(controllers){var FollowController=function(_super){function FollowController(targetObject,lookAtObject,tiltAngle,distance){"undefined"==typeof targetObject&&(targetObject=null),"undefined"==typeof lookAtObject&&(lookAtObject=null),"undefined"==typeof tiltAngle&&(tiltAngle=45),"undefined"==typeof distance&&(distance=700),_super.call(this,targetObject,lookAtObject,0,tiltAngle,distance)}return __extends(FollowController,_super),FollowController.prototype.update=function(interpolate){"undefined"==typeof interpolate&&(interpolate=!0),interpolate=interpolate,this.lookAtObject&&(this.panAngle=this._pLookAtObject.rotationY-180,_super.prototype.update.call(this))},FollowController}(controllers.HoverController);controllers.FollowController=FollowController}(away.controllers||(away.controllers={}));away.controllers}(away||(away={}));var away;!function(away){!function(controllers){var Vector3D=away.geom.Vector3D,SpringController=function(_super){function SpringController(targetObject,lookAtObject,stiffness,mass,damping){"undefined"==typeof targetObject&&(targetObject=null),"undefined"==typeof lookAtObject&&(lookAtObject=null),"undefined"==typeof stiffness&&(stiffness=1),"undefined"==typeof mass&&(mass=40),"undefined"==typeof damping&&(damping=4),_super.call(this,targetObject,lookAtObject),this.positionOffset=new Vector3D(0,500,-1e3),this.stiffness=stiffness,this.damping=damping,this.mass=mass,this._velocity=new Vector3D,this._dv=new Vector3D,this._stretch=new Vector3D,this._force=new Vector3D,this._acceleration=new Vector3D,this._desiredPosition=new Vector3D}return __extends(SpringController,_super),SpringController.prototype.update=function(interpolate){"undefined"==typeof interpolate&&(interpolate=!0);var offs;this._pLookAtObject&&this._pTargetObject&&(offs=this._pLookAtObject.transform.matrix3D.deltaTransformVector(this.positionOffset),this._desiredPosition.x=this._pLookAtObject.x+offs.x,this._desiredPosition.y=this._pLookAtObject.y+offs.y,this._desiredPosition.z=this._pLookAtObject.z+offs.z,this._stretch=this._pTargetObject.transform.position.add(this._desiredPosition),this._stretch.scaleBy(-this.stiffness),this._dv.copyFrom(this._velocity),this._dv.scaleBy(this.damping),this._force.x=this._stretch.x-this._dv.x,this._force.y=this._stretch.y-this._dv.y,this._force.z=this._stretch.z-this._dv.z,this._acceleration.copyFrom(this._force),this._acceleration.scaleBy(1/this.mass),this._velocity.incrementBy(this._acceleration),this._pTargetObject.transform.position=this._pTargetObject.transform.position.add(this._velocity),_super.prototype.update.call(this))},SpringController}(controllers.LookAtController);controllers.SpringController=SpringController}(away.controllers||(away.controllers={}));away.controllers}(away||(away={}));var away;!function(away){!function(materials){var AssetType=away.library.AssetType,LightPickerBase=function(_super){function LightPickerBase(){_super.call(this),this._pNumPointLights=0,this._pNumDirectionalLights=0,this._pNumCastingPointLights=0,this._pNumCastingDirectionalLights=0,this._pNumLightProbes=0}return __extends(LightPickerBase,_super),LightPickerBase.prototype.dispose=function(){},Object.defineProperty(LightPickerBase.prototype,"assetType",{get:function(){return AssetType.LIGHT_PICKER},enumerable:!0,configurable:!0}),Object.defineProperty(LightPickerBase.prototype,"numDirectionalLights",{get:function(){return this._pNumDirectionalLights},enumerable:!0,configurable:!0}),Object.defineProperty(LightPickerBase.prototype,"numPointLights",{get:function(){return this._pNumPointLights},enumerable:!0,configurable:!0}),Object.defineProperty(LightPickerBase.prototype,"numCastingDirectionalLights",{get:function(){return this._pNumCastingDirectionalLights},enumerable:!0,configurable:!0}),Object.defineProperty(LightPickerBase.prototype,"numCastingPointLights",{get:function(){return this._pNumCastingPointLights},enumerable:!0,configurable:!0}),Object.defineProperty(LightPickerBase.prototype,"numLightProbes",{get:function(){return this._pNumLightProbes},enumerable:!0,configurable:!0}),Object.defineProperty(LightPickerBase.prototype,"pointLights",{get:function(){return this._pPointLights},enumerable:!0,configurable:!0}),Object.defineProperty(LightPickerBase.prototype,"directionalLights",{get:function(){return this._pDirectionalLights},enumerable:!0,configurable:!0}),Object.defineProperty(LightPickerBase.prototype,"castingPointLights",{get:function(){return this._pCastingPointLights},enumerable:!0,configurable:!0}),Object.defineProperty(LightPickerBase.prototype,"castingDirectionalLights",{get:function(){return this._pCastingDirectionalLights},enumerable:!0,configurable:!0}),Object.defineProperty(LightPickerBase.prototype,"lightProbes",{get:function(){return this._pLightProbes},enumerable:!0,configurable:!0}),Object.defineProperty(LightPickerBase.prototype,"lightProbeWeights",{get:function(){return this._pLightProbeWeights},enumerable:!0,configurable:!0}),Object.defineProperty(LightPickerBase.prototype,"allPickedLights",{get:function(){return this._pAllPickedLights},enumerable:!0,configurable:!0}),LightPickerBase.prototype.collectLights=function(renderable){this.updateProbeWeights(renderable)},LightPickerBase.prototype.updateProbeWeights=function(renderable){var lightPos,dx,dy,dz,w,i,objectPos=renderable.sourceEntity.scenePosition,rx=objectPos.x,ry=objectPos.y,rz=objectPos.z,total=0;for(i=0;i1e-5?1/w:5e7,this._pLightProbeWeights[i]=w,total+=w;for(total=1/total,i=0;ii;++i)light=value[i],light.addEventListener(LightEvent.CASTS_SHADOW_CHANGE,this._onCastShadowChangeDelegate),light instanceof PointLight?light.castsShadows?this._pCastingPointLights[numCastingPointLights++]=light:this._pPointLights[numPointLights++]=light:light instanceof DirectionalLight?light.castsShadows?this._pCastingDirectionalLights[numCastingDirectionalLights++]=light:this._pDirectionalLights[numDirectionalLights++]=light:light instanceof LightProbe&&(this._pLightProbes[numLightProbes++]=light);(this._pNumDirectionalLights!=numDirectionalLights||this._pNumPointLights!=numPointLights||this._pNumLightProbes!=numLightProbes||this._pNumCastingPointLights!=numCastingPointLights||this._pNumCastingDirectionalLights!=numCastingDirectionalLights)&&(this._pNumDirectionalLights=numDirectionalLights,this._pNumCastingDirectionalLights=numCastingDirectionalLights,this._pNumPointLights=numPointLights,this._pNumCastingPointLights=numCastingPointLights,this._pNumLightProbes=numLightProbes,this._pLightProbeWeights=new Array(4*Math.ceil(numLightProbes/4)),this.dispatchEvent(new Event(Event.CHANGE)))},enumerable:!0,configurable:!0}),StaticLightPicker.prototype.clearListeners=function(){for(var len=this._lights.length,i=0;len>i;++i)this._lights[i].removeEventListener(LightEvent.CASTS_SHADOW_CHANGE,this._onCastShadowChangeDelegate)},StaticLightPicker.prototype.onCastShadowChange=function(event){var light=event.target;light instanceof PointLight?this.updatePointCasting(light):light instanceof DirectionalLight&&this.updateDirectionalCasting(light),this.dispatchEvent(new Event(Event.CHANGE))},StaticLightPicker.prototype.updateDirectionalCasting=function(light){var dl=light;light.castsShadows?(--this._pNumDirectionalLights,++this._pNumCastingDirectionalLights,this._pDirectionalLights.splice(this._pDirectionalLights.indexOf(dl),1),this._pCastingDirectionalLights.push(light)):(++this._pNumDirectionalLights,--this._pNumCastingDirectionalLights,this._pCastingDirectionalLights.splice(this._pCastingDirectionalLights.indexOf(dl),1),this._pDirectionalLights.push(light))},StaticLightPicker.prototype.updatePointCasting=function(light){var pl=light;light.castsShadows?(--this._pNumPointLights,++this._pNumCastingPointLights,this._pPointLights.splice(this._pPointLights.indexOf(pl),1),this._pCastingPointLights.push(light)):(++this._pNumPointLights,--this._pNumCastingPointLights,this._pCastingPointLights.splice(this._pCastingPointLights.indexOf(pl),1),this._pPointLights.push(light))},StaticLightPicker}(materials.LightPickerBase);materials.StaticLightPicker=StaticLightPicker}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(){}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var LightSources=function(){function LightSources(){}return LightSources.LIGHTS=1,LightSources.PROBES=2,LightSources.ALL=3,LightSources}();materials.LightSources=LightSources}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var BlendMode=away.base.BlendMode,Event=away.events.Event,AssetType=away.library.AssetType,MaterialBase=function(_super){function MaterialBase(){var _this=this;_super.call(this),this._materialPassData=new Array,this._materialData=new Array,this._pAlphaThreshold=0,this._pAnimateUVs=!1,this._enableLightFallOff=!0,this._specularLightSources=1,this._diffuseLightSources=3,this._iMaterialId=0,this._iBaseScreenPassIndex=0,this._bothSides=!1,this._pScreenPassesInvalid=!0,this._pBlendMode=BlendMode.NORMAL,this._numPasses=0,this._mipmap=!1,this._smooth=!0,this._repeat=!1,this._color=16777215,this._pHeight=1,this._pWidth=1,this._pRequiresBlending=!1,this._iMaterialId=Number(this.id),this._owners=new Array,this._passes=new Array,this._onPassChangeDelegate=function(event){return _this.onPassChange(event)},this._onLightChangeDelegate=function(event){return _this.onLightsChange(event)},this.alphaPremultiplied=!1}return __extends(MaterialBase,_super),Object.defineProperty(MaterialBase.prototype,"assetType",{get:function(){return AssetType.MATERIAL},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialBase.prototype,"height",{get:function(){return this._pHeight},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialBase.prototype,"animationSet",{get:function(){return this._animationSet},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialBase.prototype,"lightPicker",{get:function(){return this._pLightPicker},set:function(value){this._pLightPicker!=value&&(this._pLightPicker&&this._pLightPicker.removeEventListener(Event.CHANGE,this._onLightChangeDelegate),this._pLightPicker=value,this._pLightPicker&&this._pLightPicker.addEventListener(Event.CHANGE,this._onLightChangeDelegate),this._pInvalidateScreenPasses())},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialBase.prototype,"mipmap",{get:function(){return this._mipmap},set:function(value){this._mipmap!=value&&(this._mipmap=value,this._pInvalidatePasses())},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialBase.prototype,"smooth",{get:function(){return this._smooth},set:function(value){this._smooth!=value&&(this._smooth=value,this._pInvalidatePasses())},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialBase.prototype,"repeat",{get:function(){return this._repeat},set:function(value){this._repeat!=value&&(this._repeat=value,this._pInvalidatePasses())},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialBase.prototype,"color",{get:function(){return this._color},set:function(value){this._color!=value&&(this._color=value,this._pInvalidatePasses())},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialBase.prototype,"texture",{get:function(){return this._pTexture},set:function(value){this._pTexture!=value&&(this._pTexture=value,this._pInvalidatePasses())},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialBase.prototype,"animateUVs",{get:function(){return this._pAnimateUVs},set:function(value){this._pAnimateUVs!=value&&(this._pAnimateUVs=value,this._pInvalidatePasses())},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialBase.prototype,"enableLightFallOff",{get:function(){return this._enableLightFallOff},set:function(value){this._enableLightFallOff!=value&&(this._enableLightFallOff=value,this._pInvalidatePasses())},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialBase.prototype,"diffuseLightSources",{get:function(){return this._diffuseLightSources},set:function(value){this._diffuseLightSources!=value&&(this._diffuseLightSources=value,this._pInvalidatePasses())},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialBase.prototype,"specularLightSources",{get:function(){return this._specularLightSources},set:function(value){this._specularLightSources!=value&&(this._specularLightSources=value,this._pInvalidatePasses())},enumerable:!0,configurable:!0}),MaterialBase.prototype.dispose=function(){var i,len;for(this._pClearScreenPasses(),len=this._materialData.length,i=0;len>i;i++)this._materialData[i].dispose();for(this._materialData=new Array,len=this._materialPassData.length,i=0;len>i;i++)this._materialPassData[i].dispose();this._materialPassData=new Array},Object.defineProperty(MaterialBase.prototype,"bothSides",{get:function(){return this._bothSides},set:function(value){(this._bothSides=value)||(this._bothSides=value,this._pInvalidatePasses())},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialBase.prototype,"blendMode",{get:function(){return this._pBlendMode},set:function(value){this._pBlendMode!=value&&(this._pBlendMode=value,this._pInvalidatePasses())},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialBase.prototype,"alphaPremultiplied",{get:function(){return this._alphaPremultiplied},set:function(value){this._alphaPremultiplied!=value&&(this._alphaPremultiplied=value,this._pInvalidatePasses())},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialBase.prototype,"alphaThreshold",{get:function(){return this._pAlphaThreshold},set:function(value){0>value?value=0:value>1&&(value=1),this._pAlphaThreshold!=value&&(this._pAlphaThreshold=value,this._pInvalidatePasses())},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialBase.prototype,"requiresBlending",{get:function(){return this._pRequiresBlending},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialBase.prototype,"width",{get:function(){return this._pWidth},enumerable:!0,configurable:!0}),MaterialBase.prototype._iActivatePass=function(pass,stage,camera){pass.materialPass._iActivate(pass,stage,camera)},MaterialBase.prototype._iDeactivatePass=function(pass,stage){pass.materialPass._iDeactivate(pass,stage)},MaterialBase.prototype._iRenderPass=function(pass,renderable,stage,camera,viewProjection){this._pLightPicker&&this._pLightPicker.collectLights(renderable),pass.materialPass._iRender(pass,renderable,stage,camera,viewProjection)},MaterialBase.prototype.iAddOwner=function(owner){this._owners.push(owner);var animationSet,animator=owner.animator;if(animator&&(animationSet=animator.animationSet),owner.animator){if(this._animationSet&&animationSet!=this._animationSet)throw new Error("A Material instance cannot be shared across material owners with different animation sets");this._animationSet!=animationSet&&(this._animationSet=animationSet,this.invalidateAnimation())}},MaterialBase.prototype.iRemoveOwner=function(owner){this._owners.splice(this._owners.indexOf(owner),1),0==this._owners.length&&(this._animationSet=null,this.invalidateAnimation())},Object.defineProperty(MaterialBase.prototype,"iOwners",{get:function(){return this._owners},enumerable:!0,configurable:!0}),MaterialBase.prototype._iNumScreenPasses=function(){return this._numPasses},Object.defineProperty(MaterialBase.prototype,"_iScreenPasses",{get:function(){return this._passes},enumerable:!0,configurable:!0}),MaterialBase.prototype._pInvalidatePasses=function(){for(var len=this._materialPassData.length,i=0;len>i;i++)this._materialPassData[i].invalidate();this.invalidateMaterial()},MaterialBase.prototype._pInvalidateScreenPasses=function(){this._pScreenPassesInvalid=!0},MaterialBase.prototype._pRemoveScreenPass=function(pass){pass.removeEventListener(Event.CHANGE,this._onPassChangeDelegate),this._passes.splice(this._passes.indexOf(pass),1),this._numPasses--},MaterialBase.prototype._pClearScreenPasses=function(){for(var i=0;ii;i++)this._materialData[i].invalidateAnimation()},MaterialBase.prototype.invalidateMaterial=function(){for(var len=this._materialData.length,i=0;len>i;i++)this._materialData[i].invalidateMaterial()},MaterialBase.prototype.onLightsChange=function(){this._pInvalidateScreenPasses()},MaterialBase.prototype._iAddMaterialPassData=function(materialPassData){return this._materialPassData.push(materialPassData),materialPassData},MaterialBase.prototype._iRemoveMaterialPassData=function(materialPassData){return this._materialPassData.splice(this._materialPassData.indexOf(materialPassData),1),materialPassData},MaterialBase}(away.library.NamedAssetBase);materials.MaterialBase=MaterialBase}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var MaterialEvent=away.events.MaterialEvent,CSSMaterialBase=function(_super){function CSSMaterialBase(texture,smooth,repeat){"undefined"==typeof texture&&(texture=null),"undefined"==typeof smooth&&(smooth=!0),"undefined"==typeof repeat&&(repeat=!1),_super.call(this),this._iMaterialId=Number(this.id),this.texture=texture,this.smooth=smooth,this.repeat=repeat}return __extends(CSSMaterialBase,_super),Object.defineProperty(CSSMaterialBase.prototype,"imageElement",{get:function(){return this._imageElement},enumerable:!0,configurable:!0}),Object.defineProperty(CSSMaterialBase.prototype,"imageStyle",{get:function(){return this._imageStyle},enumerable:!0,configurable:!0}),Object.defineProperty(CSSMaterialBase.prototype,"texture",{get:function(){return this._pTexture},set:function(value){if(this._pTexture!=value&&(this._pTexture=value,value instanceof away.textures.ImageTexture)){this._imageElement=value.htmlImageElement;var node=document.createElement("style");node.type="text/css",document.getElementsByTagName("head")[0].appendChild(node);var sheet=document.styleSheets[document.styleSheets.length-1];sheet.insertRule(".material"+this.id+"{ }",0);var style=sheet.cssRules[0].style;style.backgroundImage="url("+this._imageElement.src+")",style.backgroundSize="100% 100%",style.position="absolute",style.width=this._imageElement.width+"px",style.height=this._imageElement.height+"px",style.transformOrigin=style["-webkit-transform-origin"]=style["-moz-transform-origin"]=style["-o-transform-origin"]=style["-ms-transform-origin"]="0% 0%",this._pHeight=this._imageElement.height,this._pWidth=this._imageElement.width,this.notifySizeChanged()}},enumerable:!0,configurable:!0}),CSSMaterialBase.prototype.notifySizeChanged=function(){this._sizeChanged||(this._sizeChanged=new MaterialEvent(MaterialEvent.SIZE_CHANGED)),this.dispatchEvent(this._sizeChanged)},CSSMaterialBase}(materials.MaterialBase);materials.CSSMaterialBase=CSSMaterialBase}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(prefabs){var AbstractMethodError=away.errors.AbstractMethodError,PrefabBase=function(_super){function PrefabBase(){_super.call(this),this._pObjects=new Array}return __extends(PrefabBase,_super),PrefabBase.prototype.getNewObject=function(){var object=this._pCreateObject();return this._pObjects.push(object),object},PrefabBase.prototype._pCreateObject=function(){throw new AbstractMethodError},PrefabBase.prototype._iValidate=function(){},PrefabBase}(away.library.NamedAssetBase);prefabs.PrefabBase=PrefabBase}(away.prefabs||(away.prefabs={}));away.prefabs}(away||(away={}));var away;!function(away){!function(prefabs){var Geometry=away.base.Geometry,TriangleSubGeometry=away.base.TriangleSubGeometry,LineSubGeometry=away.base.LineSubGeometry,Mesh=away.entities.Mesh,PrimitivePrefabBase=function(_super){function PrimitivePrefabBase(material,geometryType){"undefined"==typeof material&&(material=null),"undefined"==typeof geometryType&&(geometryType="triangleSubGeometry"),_super.call(this),this._geomDirty=!0,this._uvDirty=!0,this._geometryTypeDirty=!0,this._geometry=new Geometry,this._material=material,this._geometryType=geometryType}return __extends(PrimitivePrefabBase,_super),Object.defineProperty(PrimitivePrefabBase.prototype,"assetType",{get:function(){return away.library.AssetType.PRIMITIVE_PREFAB},enumerable:!0,configurable:!0}),Object.defineProperty(PrimitivePrefabBase.prototype,"geometryType",{get:function(){return this._geometryType},set:function(value){this._geometryType!=value&&(this._geometryType=value,this.invalidateGeometryType())},enumerable:!0,configurable:!0}),Object.defineProperty(PrimitivePrefabBase.prototype,"geometry",{get:function(){return this._iValidate(),this._geometry},enumerable:!0,configurable:!0}),Object.defineProperty(PrimitivePrefabBase.prototype,"material",{get:function(){return this._material},set:function(value){if(value!=this._material){this._material=value;for(var len=this._pObjects.length,i=0;len>i;i++)this._pObjects[i].material=this._material}},enumerable:!0,configurable:!0}),PrimitivePrefabBase.prototype._pBuildGeometry=function(){throw new away.errors.AbstractMethodError},PrimitivePrefabBase.prototype._pBuildUVs=function(){throw new away.errors.AbstractMethodError},PrimitivePrefabBase.prototype.invalidateGeometryType=function(){this._geometryTypeDirty=!0,this._geomDirty=!0,this._uvDirty=!0},PrimitivePrefabBase.prototype._pInvalidateGeometry=function(){this._geomDirty=!0},PrimitivePrefabBase.prototype._pInvalidateUVs=function(){this._uvDirty=!0},PrimitivePrefabBase.prototype.updateGeometryType=function(){if(this._subGeometry&&this._geometry.removeSubGeometry(this._subGeometry),"triangleSubGeometry"==this._geometryType){var triangleGeometry=new TriangleSubGeometry(!0);triangleGeometry.autoDeriveNormals=!1,triangleGeometry.autoDeriveTangents=!1,triangleGeometry.autoDeriveUVs=!1,this._geometry.addSubGeometry(triangleGeometry),this._subGeometry=triangleGeometry}else"lineSubGeometry"==this._geometryType&&this._geometry.addSubGeometry(this._subGeometry=new LineSubGeometry);this._geometryTypeDirty=!1},PrimitivePrefabBase.prototype.updateGeometry=function(){this._pBuildGeometry(this._subGeometry,this._geometryType),this._geomDirty=!1},PrimitivePrefabBase.prototype.updateUVs=function(){this._pBuildUVs(this._subGeometry,this._geometryType),this._uvDirty=!1},PrimitivePrefabBase.prototype._iValidate=function(){this._geometryTypeDirty&&this.updateGeometryType(),this._geomDirty&&this.updateGeometry(),this._uvDirty&&this.updateUVs()},PrimitivePrefabBase.prototype._pCreateObject=function(){var mesh=new Mesh(this._geometry,this._material);return mesh._iSourcePrefab=this,mesh},PrimitivePrefabBase}(prefabs.PrefabBase);prefabs.PrimitivePrefabBase=PrimitivePrefabBase}(away.prefabs||(away.prefabs={}));away.prefabs}(away||(away={}));var away;!function(away){!function(prefabs){var PrimitiveTorusPrefab=function(_super){function PrimitiveTorusPrefab(radius,tubeRadius,segmentsR,segmentsT,yUp){"undefined"==typeof radius&&(radius=50),"undefined"==typeof tubeRadius&&(tubeRadius=50),"undefined"==typeof segmentsR&&(segmentsR=16),"undefined"==typeof segmentsT&&(segmentsT=8),"undefined"==typeof yUp&&(yUp=!0),_super.call(this),this._numVertices=0,this._radius=radius,this._tubeRadius=tubeRadius,this._segmentsR=segmentsR,this._segmentsT=segmentsT,this._yUp=yUp}return __extends(PrimitiveTorusPrefab,_super),Object.defineProperty(PrimitiveTorusPrefab.prototype,"radius",{get:function(){return this._radius},set:function(value){this._radius=value,this._pInvalidateGeometry()},enumerable:!0,configurable:!0}),Object.defineProperty(PrimitiveTorusPrefab.prototype,"tubeRadius",{get:function(){return this._tubeRadius},set:function(value){this._tubeRadius=value,this._pInvalidateGeometry()},enumerable:!0,configurable:!0}),Object.defineProperty(PrimitiveTorusPrefab.prototype,"segmentsR",{get:function(){return this._segmentsR},set:function(value){this._segmentsR=value,this._pInvalidateGeometry(),this._pInvalidateUVs()},enumerable:!0,configurable:!0}),Object.defineProperty(PrimitiveTorusPrefab.prototype,"segmentsT",{get:function(){return this._segmentsT},set:function(value){this._segmentsT=value,this._pInvalidateGeometry(),this._pInvalidateUVs()},enumerable:!0,configurable:!0}),Object.defineProperty(PrimitiveTorusPrefab.prototype,"yUp",{get:function(){return this._yUp},set:function(value){this._yUp=value,this._pInvalidateGeometry()},enumerable:!0,configurable:!0}),PrimitiveTorusPrefab.prototype._pBuildGeometry=function(target,geometryType){var indices,positions,normals,tangents,i,j,x,y,z,nx,ny,nz,revolutionAngleR,revolutionAngleT,vidx,fidx,numIndices=0;if("triangleSubGeometry"==geometryType){var triangleGeometry=target;this._numVertices=(this._segmentsT+1)*(this._segmentsR+1),numIndices=this._segmentsT*this._segmentsR*6,this._numVertices==triangleGeometry.numVertices?(indices=triangleGeometry.indices,positions=triangleGeometry.positions,normals=triangleGeometry.vertexNormals,tangents=triangleGeometry.vertexTangents):(indices=new Array(numIndices),positions=new Array(3*this._numVertices),normals=new Array(3*this._numVertices),tangents=new Array(3*this._numVertices),this._pInvalidateUVs()),vidx=0,fidx=0; -var comp1,comp2,t1,t2,n1,n2,a,b,c,d,length,revolutionAngleDeltaR=2*Math.PI/this._segmentsR,revolutionAngleDeltaT=2*Math.PI/this._segmentsT,startIndex=0,nextVertexIndex=0;for(j=0;j<=this._segmentsT;++j)for(startIndex=3*nextVertexIndex,i=0;i<=this._segmentsR;++i)revolutionAngleR=i*revolutionAngleDeltaR,revolutionAngleT=j*revolutionAngleDeltaT,length=Math.cos(revolutionAngleT),nx=length*Math.cos(revolutionAngleR),ny=length*Math.sin(revolutionAngleR),nz=Math.sin(revolutionAngleT),x=this._radius*Math.cos(revolutionAngleR)+this._tubeRadius*nx,y=this._radius*Math.sin(revolutionAngleR)+this._tubeRadius*ny,z=j==this._segmentsT?0:this._tubeRadius*nz,this._yUp?(n1=-nz,n2=ny,t1=0,t2=length?nx/length:x/this._radius,comp1=-z,comp2=y):(n1=ny,n2=nz,t1=length?nx/length:x/this._radius,t2=0,comp1=y,comp2=z),i==this._segmentsR?(positions[vidx]=x,positions[vidx+1]=positions[startIndex+1],positions[vidx+2]=positions[startIndex+2]):(positions[vidx]=x,positions[vidx+1]=comp1,positions[vidx+2]=comp2),normals[vidx]=nx,normals[vidx+1]=n1,normals[vidx+2]=n2,tangents[vidx]=-(length?ny/length:y/this._radius),tangents[vidx+1]=t1,tangents[vidx+2]=t2,vidx+=3,i>0&&j>0&&(a=nextVertexIndex,b=nextVertexIndex-1,c=b-this._segmentsR-1,d=a-this._segmentsR-1,indices[fidx++]=a,indices[fidx++]=b,indices[fidx++]=c,indices[fidx++]=a,indices[fidx++]=c,indices[fidx++]=d),nextVertexIndex++;triangleGeometry.updateIndices(indices),triangleGeometry.updatePositions(positions),triangleGeometry.updateVertexNormals(normals),triangleGeometry.updateVertexTangents(tangents)}},PrimitiveTorusPrefab.prototype._pBuildUVs=function(target,geometryType){var i,j,uvs;if("triangleSubGeometry"==geometryType){var triangleGeometry=target;uvs=triangleGeometry.uvs&&this._numVertices==triangleGeometry.numVertices?triangleGeometry.uvs:new Array(2*this._numVertices);var index=0;for(j=0;j<=this._segmentsT;++j)for(i=0;i<=this._segmentsR;++i)uvs[index++]=i/this._segmentsR*triangleGeometry.scaleU,uvs[index++]=j/this._segmentsT*triangleGeometry.scaleV;triangleGeometry.updateUVs(uvs)}},PrimitiveTorusPrefab}(prefabs.PrimitivePrefabBase);prefabs.PrimitiveTorusPrefab=PrimitiveTorusPrefab}(away.prefabs||(away.prefabs={}));away.prefabs}(away||(away={}));var away;!function(away){!function(prefabs){var PrimitiveCubePrefab=function(_super){function PrimitiveCubePrefab(width,height,depth,segmentsW,segmentsH,segmentsD,tile6){"undefined"==typeof width&&(width=100),"undefined"==typeof height&&(height=100),"undefined"==typeof depth&&(depth=100),"undefined"==typeof segmentsW&&(segmentsW=1),"undefined"==typeof segmentsH&&(segmentsH=1),"undefined"==typeof segmentsD&&(segmentsD=1),"undefined"==typeof tile6&&(tile6=!0),_super.call(this),this._width=width,this._height=height,this._depth=depth,this._segmentsW=segmentsW,this._segmentsH=segmentsH,this._segmentsD=segmentsD,this._tile6=tile6}return __extends(PrimitiveCubePrefab,_super),Object.defineProperty(PrimitiveCubePrefab.prototype,"width",{get:function(){return this._width},set:function(value){this._width=value,this._pInvalidateGeometry()},enumerable:!0,configurable:!0}),Object.defineProperty(PrimitiveCubePrefab.prototype,"height",{get:function(){return this._height},set:function(value){this._height=value,this._pInvalidateGeometry()},enumerable:!0,configurable:!0}),Object.defineProperty(PrimitiveCubePrefab.prototype,"depth",{get:function(){return this._depth},set:function(value){this._depth=value,this._pInvalidateGeometry()},enumerable:!0,configurable:!0}),Object.defineProperty(PrimitiveCubePrefab.prototype,"tile6",{get:function(){return this._tile6},set:function(value){this._tile6=value,this._pInvalidateGeometry()},enumerable:!0,configurable:!0}),Object.defineProperty(PrimitiveCubePrefab.prototype,"segmentsW",{get:function(){return this._segmentsW},set:function(value){this._segmentsW=value,this._pInvalidateGeometry(),this._pInvalidateUVs()},enumerable:!0,configurable:!0}),Object.defineProperty(PrimitiveCubePrefab.prototype,"segmentsH",{get:function(){return this._segmentsH},set:function(value){this._segmentsH=value,this._pInvalidateGeometry(),this._pInvalidateUVs()},enumerable:!0,configurable:!0}),Object.defineProperty(PrimitiveCubePrefab.prototype,"segmentsD",{get:function(){return this._segmentsD},set:function(value){this._segmentsD=value,this._pInvalidateGeometry(),this._pInvalidateUVs()},enumerable:!0,configurable:!0}),PrimitiveCubePrefab.prototype._pBuildGeometry=function(target,geometryType){var indices,positions,normals,tangents,tl,tr,bl,br,i,j,vidx,fidx,hw,hh,hd,dw,dh,dd,outer_pos,numIndices,numVertices,inc=0;if(hw=this._width/2,hh=this._height/2,hd=this._depth/2,"triangleSubGeometry"==geometryType){var triangleGeometry=target;for(numVertices=2*((this._segmentsW+1)*(this._segmentsH+1)+(this._segmentsW+1)*(this._segmentsD+1)+(this._segmentsH+1)*(this._segmentsD+1)),numIndices=12*(this._segmentsW*this._segmentsH+this._segmentsW*this._segmentsD+this._segmentsH*this._segmentsD),numVertices==triangleGeometry.numVertices&&null!=triangleGeometry.indices?(indices=triangleGeometry.indices,positions=triangleGeometry.positions,normals=triangleGeometry.vertexNormals,tangents=triangleGeometry.vertexTangents):(indices=new Array(numIndices),positions=new Array(3*numVertices),normals=new Array(3*numVertices),tangents=new Array(3*numVertices),this._pInvalidateUVs()),vidx=0,fidx=0,dw=this._width/this._segmentsW,dh=this._height/this._segmentsH,dd=this._depth/this._segmentsD,i=0;i<=this._segmentsW;i++)for(outer_pos=-hw+i*dw,j=0;j<=this._segmentsH;j++)positions[vidx]=outer_pos,positions[vidx+1]=-hh+j*dh,positions[vidx+2]=-hd,normals[vidx]=0,normals[vidx+1]=0,normals[vidx+2]=-1,tangents[vidx]=1,tangents[vidx+1]=0,tangents[vidx+2]=0,vidx+=3,positions[vidx]=outer_pos,positions[vidx+1]=-hh+j*dh,positions[vidx+2]=hd,normals[vidx]=0,normals[vidx+1]=0,normals[vidx+2]=1,tangents[vidx]=-1,tangents[vidx+1]=0,tangents[vidx+2]=0,vidx+=3,i&&j&&(tl=2*((i-1)*(this._segmentsH+1)+(j-1)),tr=2*(i*(this._segmentsH+1)+(j-1)),bl=tl+2,br=tr+2,indices[fidx++]=tl,indices[fidx++]=bl,indices[fidx++]=br,indices[fidx++]=tl,indices[fidx++]=br,indices[fidx++]=tr,indices[fidx++]=tr+1,indices[fidx++]=br+1,indices[fidx++]=bl+1,indices[fidx++]=tr+1,indices[fidx++]=bl+1,indices[fidx++]=tl+1);for(inc+=2*(this._segmentsW+1)*(this._segmentsH+1),i=0;i<=this._segmentsW;i++)for(outer_pos=-hw+i*dw,j=0;j<=this._segmentsD;j++)positions[vidx]=outer_pos,positions[vidx+1]=hh,positions[vidx+2]=-hd+j*dd,normals[vidx]=0,normals[vidx+1]=1,normals[vidx+2]=0,tangents[vidx]=1,tangents[vidx+1]=0,tangents[vidx+2]=0,vidx+=3,positions[vidx]=outer_pos,positions[vidx+1]=-hh,positions[vidx+2]=-hd+j*dd,normals[vidx]=0,normals[vidx+1]=-1,normals[vidx+2]=0,tangents[vidx]=1,tangents[vidx+1]=0,tangents[vidx+2]=0,vidx+=3,i&&j&&(tl=inc+2*((i-1)*(this._segmentsD+1)+(j-1)),tr=inc+2*(i*(this._segmentsD+1)+(j-1)),bl=tl+2,br=tr+2,indices[fidx++]=tl,indices[fidx++]=bl,indices[fidx++]=br,indices[fidx++]=tl,indices[fidx++]=br,indices[fidx++]=tr,indices[fidx++]=tr+1,indices[fidx++]=br+1,indices[fidx++]=bl+1,indices[fidx++]=tr+1,indices[fidx++]=bl+1,indices[fidx++]=tl+1);for(inc+=2*(this._segmentsW+1)*(this._segmentsD+1),i=0;i<=this._segmentsD;i++)for(outer_pos=hd-i*dd,j=0;j<=this._segmentsH;j++)positions[vidx]=-hw,positions[vidx+1]=-hh+j*dh,positions[vidx+2]=outer_pos,normals[vidx]=-1,normals[vidx+1]=0,normals[vidx+2]=0,tangents[vidx]=0,tangents[vidx+1]=0,tangents[vidx+2]=-1,vidx+=3,positions[vidx]=hw,positions[vidx+1]=-hh+j*dh,positions[vidx+2]=outer_pos,normals[vidx]=1,normals[vidx+1]=0,normals[vidx+2]=0,tangents[vidx]=0,tangents[vidx+1]=0,tangents[vidx+2]=1,vidx+=3,i&&j&&(tl=inc+2*((i-1)*(this._segmentsH+1)+(j-1)),tr=inc+2*(i*(this._segmentsH+1)+(j-1)),bl=tl+2,br=tr+2,indices[fidx++]=tl,indices[fidx++]=bl,indices[fidx++]=br,indices[fidx++]=tl,indices[fidx++]=br,indices[fidx++]=tr,indices[fidx++]=tr+1,indices[fidx++]=br+1,indices[fidx++]=bl+1,indices[fidx++]=tr+1,indices[fidx++]=bl+1,indices[fidx++]=tl+1);triangleGeometry.updateIndices(indices),triangleGeometry.updatePositions(positions),triangleGeometry.updateVertexNormals(normals),triangleGeometry.updateVertexTangents(tangents)}else if("lineSubGeometry"==geometryType){var startPositions,endPositions,thickness,lineGeometry=target,numSegments=4*this._segmentsH+4*this._segmentsW+4*this._segmentsD;for(null!=lineGeometry.indices&&numSegments==lineGeometry.numSegments?(startPositions=lineGeometry.startPositions,endPositions=lineGeometry.endPositions,thickness=lineGeometry.thickness):(startPositions=new Array(3*numSegments),endPositions=new Array(3*numSegments),thickness=new Array(numSegments)),vidx=0,fidx=0,i=0;ii;++i)positions[i]=positions[i-3],normals[i]=-normals[i-3],tangents[i]=-tangents[i-3];vidx+=3}if(xi!=this._segmentsW&&yi!=this._segmentsH){base=xi+yi*tw;var mult=this._doubleSided?2:1;indices[fidx++]=base*mult,indices[fidx++]=(base+tw)*mult,indices[fidx++]=(base+tw+1)*mult,indices[fidx++]=base*mult,indices[fidx++]=(base+tw+1)*mult,indices[fidx++]=(base+1)*mult,this._doubleSided&&(indices[fidx++]=(base+tw+1)*mult+1,indices[fidx++]=(base+tw)*mult+1,indices[fidx++]=base*mult+1,indices[fidx++]=(base+1)*mult+1,indices[fidx++]=(base+tw+1)*mult+1,indices[fidx++]=base*mult+1)}}triangleGeometry.updateIndices(indices),triangleGeometry.updatePositions(positions),triangleGeometry.updateVertexNormals(normals),triangleGeometry.updateVertexTangents(tangents)}else if("lineSubGeometry"==geometryType){var startPositions,endPositions,thickness,lineGeometry=target,numSegments=this._segmentsH+1+tw,hw=this._width/2,hh=this._height/2;for(null!=lineGeometry.indices&&numSegments==lineGeometry.numSegments?(startPositions=lineGeometry.startPositions,endPositions=lineGeometry.endPositions,thickness=lineGeometry.thickness):(startPositions=new Array(3*numSegments),endPositions=new Array(3*numSegments),thickness=new Array(numSegments)),fidx=0,vidx=0,yi=0;yi<=this._segmentsH;++yi)startPositions[vidx]=-hw,startPositions[vidx+1]=0,startPositions[vidx+2]=yi*this._height-hh,endPositions[vidx]=hw,endPositions[vidx+1]=0,endPositions[vidx+2]=yi*this._height-hh,thickness[fidx++]=1,vidx+=3;for(xi=0;xi<=this._segmentsW;++xi)startPositions[vidx]=xi*this._width-hw,startPositions[vidx+1]=0,startPositions[vidx+2]=-hh,endPositions[vidx]=xi*this._width-hw,endPositions[vidx+1]=0,endPositions[vidx+2]=hh,thickness[fidx++]=1,vidx+=3;lineGeometry.updatePositions(startPositions,endPositions),lineGeometry.updateThickness(thickness)}},PrimitivePlanePrefab.prototype._pBuildUVs=function(target,geometryType){var uvs,numVertices;if("triangleSubGeometry"==geometryType){numVertices=(this._segmentsH+1)*(this._segmentsW+1),this._doubleSided&&(numVertices*=2);var triangleGeometry=target;triangleGeometry.uvs&&numVertices==triangleGeometry.numVertices?uvs=triangleGeometry.uvs:(uvs=new Array(2*numVertices),this._pInvalidateGeometry());for(var index=0,yi=0;yi<=this._segmentsH;++yi)for(var xi=0;xi<=this._segmentsW;++xi)uvs[index]=xi/this._segmentsW*triangleGeometry.scaleU,uvs[index+1]=(1-yi/this._segmentsH)*triangleGeometry.scaleV,index+=2,this._doubleSided&&(uvs[index]=xi/this._segmentsW*triangleGeometry.scaleU,uvs[index+1]=(1-yi/this._segmentsH)*triangleGeometry.scaleV,index+=2);triangleGeometry.updateUVs(uvs)}},PrimitivePlanePrefab}(prefabs.PrimitivePrefabBase);prefabs.PrimitivePlanePrefab=PrimitivePlanePrefab}(away.prefabs||(away.prefabs={}));away.prefabs}(away||(away={}));var away;!function(away){!function(prefabs){var PrimitiveCapsulePrefab=function(_super){function PrimitiveCapsulePrefab(radius,height,segmentsW,segmentsH,yUp){"undefined"==typeof radius&&(radius=50),"undefined"==typeof height&&(height=100),"undefined"==typeof segmentsW&&(segmentsW=16),"undefined"==typeof segmentsH&&(segmentsH=15),"undefined"==typeof yUp&&(yUp=!0),_super.call(this),this._numVertices=0,this._radius=radius,this._height=height,this._segmentsW=segmentsW,this._segmentsH=segmentsH%2==0?segmentsH+1:segmentsH,this._yUp=yUp}return __extends(PrimitiveCapsulePrefab,_super),Object.defineProperty(PrimitiveCapsulePrefab.prototype,"radius",{get:function(){return this._radius},set:function(value){this._radius=value,this._pInvalidateGeometry()},enumerable:!0,configurable:!0}),Object.defineProperty(PrimitiveCapsulePrefab.prototype,"height",{get:function(){return this._height},set:function(value){this._height=value,this._pInvalidateGeometry()},enumerable:!0,configurable:!0}),Object.defineProperty(PrimitiveCapsulePrefab.prototype,"segmentsW",{get:function(){return this._segmentsW},set:function(value){this._segmentsW=value,this._pInvalidateGeometry(),this._pInvalidateUVs()},enumerable:!0,configurable:!0}),Object.defineProperty(PrimitiveCapsulePrefab.prototype,"segmentsH",{get:function(){return this._segmentsH},set:function(value){this._segmentsH=value%2==0?value+1:value,this._pInvalidateGeometry(),this._pInvalidateUVs()},enumerable:!0,configurable:!0}),Object.defineProperty(PrimitiveCapsulePrefab.prototype,"yUp",{get:function(){return this._yUp},set:function(value){this._yUp=value,this._pInvalidateGeometry()},enumerable:!0,configurable:!0}),PrimitiveCapsulePrefab.prototype._pBuildGeometry=function(target,geometryType){var indices,positions,normals,tangents,i,j,startIndex,comp1,comp2,t1,t2,triIndex=0,index=0,numIndices=0;if("triangleSubGeometry"==geometryType){var triangleGeometry=target;for(this._numVertices=(this._segmentsH+1)*(this._segmentsW+1),numIndices=(this._segmentsH-1)*this._segmentsW*6,this._numVertices==triangleGeometry.numVertices?(indices=triangleGeometry.indices,positions=triangleGeometry.positions,normals=triangleGeometry.vertexNormals,tangents=triangleGeometry.vertexTangents):(indices=new Array(numIndices),positions=new Array(3*this._numVertices),normals=new Array(3*this._numVertices),tangents=new Array(3*this._numVertices),this._pInvalidateUVs()),j=0;j<=this._segmentsH;++j){var horangle=Math.PI*j/this._segmentsH,z=-this._radius*Math.cos(horangle),ringradius=this._radius*Math.sin(horangle);for(startIndex=index,i=0;i<=this._segmentsW;++i){var verangle=2*Math.PI*i/this._segmentsW,x=ringradius*Math.cos(verangle),offset=j>this._segmentsH/2?this._height/2:-this._height/2,y=ringradius*Math.sin(verangle),normLen=1/Math.sqrt(x*x+y*y+z*z),tanLen=Math.sqrt(y*y+x*x);if(this._yUp?(t1=0,t2=tanLen>.007?x/tanLen:0,comp1=-z,comp2=y):(t1=tanLen>.007?x/tanLen:0,t2=0,comp1=y,comp2=z),i==this._segmentsW?(positions[index]=positions[startIndex],positions[index+1]=positions[startIndex+1],positions[index+2]=positions[startIndex+2],normals[index]=.5*(normals[startIndex]+x*normLen),normals[index+1]=.5*(normals[startIndex+1]+comp1*normLen),normals[index+2]=.5*(normals[startIndex+2]+comp2*normLen),tangents[index]=.5*(tangents[startIndex]+(tanLen>.007?-y/tanLen:1)),tangents[index+1]=.5*(tangents[startIndex+1]+t1),tangents[index+2]=.5*(tangents[startIndex+2]+t2)):(positions[index]=x,positions[index+1]=this._yUp?comp1-offset:comp1,positions[index+2]=this._yUp?comp2:comp2+offset,normals[index]=x*normLen,normals[index+1]=comp1*normLen,normals[index+2]=comp2*normLen,tangents[index]=tanLen>.007?-y/tanLen:1,tangents[index+1]=t1,tangents[index+2]=t2),i>0&&j>0){var a=(this._segmentsW+1)*j+i,b=(this._segmentsW+1)*j+i-1,c=(this._segmentsW+1)*(j-1)+i-1,d=(this._segmentsW+1)*(j-1)+i;j==this._segmentsH?(positions[index]=positions[startIndex],positions[index+1]=positions[startIndex+1],positions[index+2]=positions[startIndex+2],indices[triIndex++]=a,indices[triIndex++]=c,indices[triIndex++]=d):1==j?(indices[triIndex++]=a,indices[triIndex++]=b,indices[triIndex++]=c):(indices[triIndex++]=a,indices[triIndex++]=b,indices[triIndex++]=c,indices[triIndex++]=a,indices[triIndex++]=c,indices[triIndex++]=d)}index+=3}}triangleGeometry.updateIndices(indices),triangleGeometry.updatePositions(positions),triangleGeometry.updateVertexNormals(normals),triangleGeometry.updateVertexTangents(tangents)}},PrimitiveCapsulePrefab.prototype._pBuildUVs=function(target,geometryType){var i,j,uvs;if("triangleSubGeometry"==geometryType){var triangleGeometry=target;uvs=triangleGeometry.uvs&&this._numVertices==triangleGeometry.numVertices?triangleGeometry.uvs:new Array(2*this._numVertices);var index=0;for(j=0;j<=this._segmentsH;++j)for(i=0;i<=this._segmentsW;++i)uvs[index++]=i/this._segmentsW*triangleGeometry.scaleU,uvs[index++]=j/this._segmentsH*triangleGeometry.scaleV;triangleGeometry.updateUVs(uvs)}},PrimitiveCapsulePrefab}(prefabs.PrimitivePrefabBase);prefabs.PrimitiveCapsulePrefab=PrimitiveCapsulePrefab}(away.prefabs||(away.prefabs={}));away.prefabs}(away||(away={}));var away;!function(away){!function(prefabs){var PrimitiveCylinderPrefab=function(_super){function PrimitiveCylinderPrefab(topRadius,bottomRadius,height,segmentsW,segmentsH,topClosed,bottomClosed,surfaceClosed,yUp){"undefined"==typeof topRadius&&(topRadius=50),"undefined"==typeof bottomRadius&&(bottomRadius=50),"undefined"==typeof height&&(height=100),"undefined"==typeof segmentsW&&(segmentsW=16),"undefined"==typeof segmentsH&&(segmentsH=1),"undefined"==typeof topClosed&&(topClosed=!0),"undefined"==typeof bottomClosed&&(bottomClosed=!0),"undefined"==typeof surfaceClosed&&(surfaceClosed=!0),"undefined"==typeof yUp&&(yUp=!0),_super.call(this),this._numVertices=0,this._topRadius=topRadius,this._pBottomRadius=bottomRadius,this._height=height,this._pSegmentsW=segmentsW,this._pSegmentsH=segmentsH,this._topClosed=topClosed,this._bottomClosed=bottomClosed,this._surfaceClosed=surfaceClosed,this._yUp=yUp}return __extends(PrimitiveCylinderPrefab,_super),Object.defineProperty(PrimitiveCylinderPrefab.prototype,"topRadius",{get:function(){return this._topRadius},set:function(value){this._topRadius=value,this._pInvalidateGeometry()},enumerable:!0,configurable:!0}),Object.defineProperty(PrimitiveCylinderPrefab.prototype,"bottomRadius",{get:function(){return this._pBottomRadius},set:function(value){this._pBottomRadius=value,this._pInvalidateGeometry()},enumerable:!0,configurable:!0}),Object.defineProperty(PrimitiveCylinderPrefab.prototype,"height",{get:function(){return this._height},set:function(value){this._height=value,this._pInvalidateGeometry()},enumerable:!0,configurable:!0}),Object.defineProperty(PrimitiveCylinderPrefab.prototype,"segmentsW",{get:function(){return this._pSegmentsW},set:function(value){this.setSegmentsW(value)},enumerable:!0,configurable:!0}),PrimitiveCylinderPrefab.prototype.setSegmentsW=function(value){this._pSegmentsW=value,this._pInvalidateGeometry(),this._pInvalidateUVs()},Object.defineProperty(PrimitiveCylinderPrefab.prototype,"segmentsH",{get:function(){return this._pSegmentsH},set:function(value){this.setSegmentsH(value)},enumerable:!0,configurable:!0}),PrimitiveCylinderPrefab.prototype.setSegmentsH=function(value){this._pSegmentsH=value,this._pInvalidateGeometry(),this._pInvalidateUVs()},Object.defineProperty(PrimitiveCylinderPrefab.prototype,"topClosed",{get:function(){return this._topClosed},set:function(value){this._topClosed=value,this._pInvalidateGeometry()},enumerable:!0,configurable:!0}),Object.defineProperty(PrimitiveCylinderPrefab.prototype,"bottomClosed",{get:function(){return this._bottomClosed},set:function(value){this._bottomClosed=value,this._pInvalidateGeometry()},enumerable:!0,configurable:!0}),Object.defineProperty(PrimitiveCylinderPrefab.prototype,"yUp",{get:function(){return this._yUp},set:function(value){this._yUp=value,this._pInvalidateGeometry()},enumerable:!0,configurable:!0}),PrimitiveCylinderPrefab.prototype._pBuildGeometry=function(target,geometryType){var indices,positions,normals,tangents,i,j,x,y,z,vidx,fidx,radius,revolutionAngle,dr,latNormElev,latNormBase,comp1,comp2,t1,t2,numIndices=0,startIndex=0,nextVertexIndex=0;this._numVertices=0;var revolutionAngleDelta=2*Math.PI/this._pSegmentsW;if("triangleSubGeometry"==geometryType){var triangleGeometry=target;if(this._surfaceClosed&&(this._numVertices+=(this._pSegmentsH+1)*(this._pSegmentsW+1),numIndices+=this._pSegmentsH*this._pSegmentsW*6),this._topClosed&&(this._numVertices+=2*(this._pSegmentsW+1),numIndices+=3*this._pSegmentsW),this._bottomClosed&&(this._numVertices+=2*(this._pSegmentsW+1),numIndices+=3*this._pSegmentsW),this._numVertices==triangleGeometry.numVertices?(indices=triangleGeometry.indices,positions=triangleGeometry.positions,normals=triangleGeometry.vertexNormals,tangents=triangleGeometry.vertexTangents):(indices=new Array(numIndices),positions=new Array(3*this._numVertices),normals=new Array(3*this._numVertices),tangents=new Array(3*this._numVertices),this._pInvalidateUVs()),vidx=0,fidx=0,this._topClosed&&this._topRadius>0){for(z=-.5*this._height,i=0;i<=this._pSegmentsW;++i)this._yUp?(t1=1,t2=0,comp1=-z,comp2=0):(t1=0,t2=-1,comp1=0,comp2=z),positions[vidx]=0,positions[vidx+1]=comp1,positions[vidx+2]=comp2,normals[vidx]=0,normals[vidx+1]=t1,normals[vidx+2]=t2,tangents[vidx]=1,tangents[vidx+1]=0,tangents[vidx+2]=0,vidx+=3,revolutionAngle=i*revolutionAngleDelta,x=this._topRadius*Math.cos(revolutionAngle),y=this._topRadius*Math.sin(revolutionAngle),this._yUp?(comp1=-z,comp2=y):(comp1=y,comp2=z),i==this._pSegmentsW?(positions[vidx]=positions[startIndex+3],positions[vidx+1]=positions[startIndex+4],positions[vidx+2]=positions[startIndex+5]):(positions[vidx]=x,positions[vidx+1]=comp1,positions[vidx+2]=comp2),normals[vidx]=0,normals[vidx+1]=t1,normals[vidx+2]=t2,tangents[vidx]=1,tangents[vidx+1]=0,tangents[vidx+2]=0,vidx+=3,i>0&&(indices[fidx++]=nextVertexIndex,indices[fidx++]=nextVertexIndex+1,indices[fidx++]=nextVertexIndex+2,nextVertexIndex+=2);nextVertexIndex+=2}if(this._bottomClosed&&this._pBottomRadius>0){for(z=.5*this._height,startIndex=3*nextVertexIndex,i=0;i<=this._pSegmentsW;++i)this._yUp?(t1=-1,t2=0,comp1=-z,comp2=0):(t1=0,t2=1,comp1=0,comp2=z),positions[vidx]=0,positions[vidx+1]=comp1,positions[vidx+2]=comp2,normals[vidx]=0,normals[vidx+1]=t1,normals[vidx+2]=t2,tangents[vidx]=1,tangents[vidx+1]=0,tangents[vidx+2]=0,vidx+=3,revolutionAngle=i*revolutionAngleDelta,x=this._pBottomRadius*Math.cos(revolutionAngle),y=this._pBottomRadius*Math.sin(revolutionAngle),this._yUp?(comp1=-z,comp2=y):(comp1=y,comp2=z),i==this._pSegmentsW?(positions[vidx]=positions[startIndex+3],positions[vidx+1]=positions[startIndex+4],positions[vidx+2]=positions[startIndex+5]):(positions[vidx]=x,positions[vidx+1]=comp1,positions[vidx+2]=comp2),normals[vidx]=0,normals[vidx+1]=t1,normals[vidx+2]=t2,tangents[vidx]=1,tangents[vidx+1]=0,tangents[vidx+2]=0,vidx+=3,i>0&&(indices[fidx++]=nextVertexIndex,indices[fidx++]=nextVertexIndex+2,indices[fidx++]=nextVertexIndex+1,nextVertexIndex+=2);nextVertexIndex+=2}if(dr=this._pBottomRadius-this._topRadius,latNormElev=dr/this._height,latNormBase=0==latNormElev?1:this._height/dr,this._surfaceClosed){var a,b,c,d,na0,na1,naComp1,naComp2;for(j=0;j<=this._pSegmentsH;++j)for(radius=this._topRadius-j/this._pSegmentsH*(this._topRadius-this._pBottomRadius),z=-(this._height/2)+j/this._pSegmentsH*this._height,startIndex=3*nextVertexIndex,i=0;i<=this._pSegmentsW;++i)revolutionAngle=i*revolutionAngleDelta,x=radius*Math.cos(revolutionAngle),y=radius*Math.sin(revolutionAngle),na0=latNormBase*Math.cos(revolutionAngle),na1=latNormBase*Math.sin(revolutionAngle),this._yUp?(t1=0,t2=-na0,comp1=-z,comp2=y,naComp1=latNormElev,naComp2=na1):(t1=-na0,t2=0,comp1=y,comp2=z,naComp1=na1,naComp2=latNormElev),i==this._pSegmentsW?(positions[vidx]=positions[startIndex],positions[vidx+1]=positions[startIndex+1],positions[vidx+2]=positions[startIndex+2],normals[vidx]=na0,normals[vidx+1]=latNormElev,normals[vidx+2]=na1,tangents[vidx]=na1,tangents[vidx+1]=t1,tangents[vidx+2]=t2):(positions[vidx]=x,positions[vidx+1]=comp1,positions[vidx+2]=comp2,normals[vidx]=na0,normals[vidx+1]=naComp1,normals[vidx+2]=naComp2,tangents[vidx]=-na1,tangents[vidx+1]=t1,tangents[vidx+2]=t2),vidx+=3,i>0&&j>0&&(a=nextVertexIndex,b=nextVertexIndex-1,c=b-this._pSegmentsW-1,d=a-this._pSegmentsW-1,indices[fidx++]=a,indices[fidx++]=b,indices[fidx++]=c,indices[fidx++]=a,indices[fidx++]=c,indices[fidx++]=d),nextVertexIndex++ -}triangleGeometry.updateIndices(indices),triangleGeometry.updatePositions(positions),triangleGeometry.updateVertexNormals(normals),triangleGeometry.updateVertexTangents(tangents)}else if("lineSubGeometry"==geometryType){var startPositions,endPositions,thickness,lineGeometry=target,numSegments=(this._pSegmentsH+1)*this._pSegmentsW+this._pSegmentsW;for(null!=lineGeometry.indices&&numSegments==lineGeometry.numSegments?(startPositions=lineGeometry.startPositions,endPositions=lineGeometry.endPositions,thickness=lineGeometry.thickness):(startPositions=new Array(3*numSegments),endPositions=new Array(3*numSegments),thickness=new Array(numSegments)),vidx=0,fidx=0,j=0;j<=this._pSegmentsH;++j)for(radius=this._topRadius-j/this._pSegmentsH*(this._topRadius-this._pBottomRadius),z=this._height*(j/this._pSegmentsH-.5),i=0;i<=this._pSegmentsW;++i)revolutionAngle=i*revolutionAngleDelta,x=radius*Math.cos(revolutionAngle),y=radius*Math.sin(revolutionAngle),this._yUp?(comp1=-z,comp2=y):(comp1=y,comp2=z),i>0&&(endPositions[vidx]=x,endPositions[vidx+1]=comp1,endPositions[vidx+2]=comp2,thickness[fidx++]=1,vidx+=3,startPositions[vidx]=endPositions[vidx-6*this._pSegmentsW],startPositions[vidx+1]=endPositions[vidx+1-6*this._pSegmentsW],startPositions[vidx+2]=endPositions[vidx+2-6*this._pSegmentsW],endPositions[vidx]=x,endPositions[vidx+1]=comp1,endPositions[vidx+2]=comp2,thickness[fidx++]=1,vidx+=3),i.007?x/tanLen:0,comp1=-z,comp2=y):(t1=tanLen>.007?x/tanLen:0,t2=0,comp1=y,comp2=z),i==this._segmentsW?(positions[vidx]=positions[startIndex],positions[vidx+1]=positions[startIndex+1],positions[vidx+2]=positions[startIndex+2],normals[vidx]=normals[startIndex]+x*normLen*.5,normals[vidx+1]=normals[startIndex+1]+comp1*normLen*.5,normals[vidx+2]=normals[startIndex+2]+comp2*normLen*.5,tangents[vidx]=tanLen>.007?-y/tanLen:1,tangents[vidx+1]=t1,tangents[vidx+2]=t2):(positions[vidx]=x,positions[vidx+1]=comp1,positions[vidx+2]=comp2,normals[vidx]=x*normLen,normals[vidx+1]=comp1*normLen,normals[vidx+2]=comp2*normLen,tangents[vidx]=tanLen>.007?-y/tanLen:1,tangents[vidx+1]=t1,tangents[vidx+2]=t2),i>0&&j>0){var a=(this._segmentsW+1)*j+i,b=(this._segmentsW+1)*j+i-1,c=(this._segmentsW+1)*(j-1)+i-1,d=(this._segmentsW+1)*(j-1)+i;j==this._segmentsH?(positions[vidx]=positions[startIndex],positions[vidx+1]=positions[startIndex+1],positions[vidx+2]=positions[startIndex+2],indices[fidx++]=a,indices[fidx++]=c,indices[fidx++]=d):1==j?(indices[fidx++]=a,indices[fidx++]=b,indices[fidx++]=c):(indices[fidx++]=a,indices[fidx++]=b,indices[fidx++]=c,indices[fidx++]=a,indices[fidx++]=c,indices[fidx++]=d)}vidx+=3}}triangleGeometry.updateIndices(indices),triangleGeometry.updatePositions(positions),triangleGeometry.updateVertexNormals(normals),triangleGeometry.updateVertexTangents(tangents)}else if("lineSubGeometry"==geometryType){var startPositions,endPositions,thickness,lineGeometry=target,numSegments=(this._segmentsH-1)*this._segmentsW*2;for(null!=lineGeometry.indices&&numSegments==lineGeometry.numSegments?(startPositions=lineGeometry.startPositions,endPositions=lineGeometry.endPositions,thickness=lineGeometry.thickness):(startPositions=new Array(3*numSegments),endPositions=new Array(3*numSegments),thickness=new Array(numSegments)),vidx=0,fidx=0,j=0;j<=this._segmentsH;++j){var horangle=Math.PI*j/this._segmentsH,z=-this._radius*Math.cos(horangle),ringradius=this._radius*Math.sin(horangle);for(i=0;i<=this._segmentsW;++i){var verangle=2*Math.PI*i/this._segmentsW,x=ringradius*Math.cos(verangle),y=ringradius*Math.sin(verangle);this._yUp?(comp1=-z,comp2=y):(comp1=y,comp2=z),i>0&&j>0&&(j0&&jFJTi9%;nP$On)hz~;UWgE?)mxg3rFAsfhs-~bx}OMC>I1d{9$5=a7ZlW-r_ z{&kF6a+dGgmA~r$?^mzhdsX$Sy1K_(6zv^F$$dakN{P~uKVDIkiwcLRqRd;kr7u># z$x0-n@&5T!>uc(!mM>h8IWG~8%w63PC`WC7axU)XPwh>m2Ikh*Zr;4PX0yL0p6IEq zZ)s_%t@G9TeAUpXPHyc_1-Df9C#OwakXepDZl%LYnu+K@3ihS7usLFEU@#Hmrov{e z6|?%R{#3HIzNUVvR1GE_-Tq`vFdPqAHDhxsiCHFPK^o92kg2 z%^>qxyQMnW8#gy@4sNolBe7tzcV4Zd$iqxG4m*)9;7X$fV>DCIRLok?%AzT6HJO`E z-pBG*$1%4c6vwn37!1Xt$zCh5V6cB!vzs zC>U>jcWfIh~TpE=H$Sy8IdM!}e>G1Gyu2)f3tgK$u+Sz&L z%GDjpIhiUF)QzI)e_rhZI)5GB_tkky+c-seGqW!qvwEYk*!m60^?YhWiD{HMh(?dH$l-w)T$2fh9|qEkEVd z(^jlpb-JQFOqX`dJ$E1x-(Z=k~)6^I24|j44?)X4E0wPH*6ip>n*wRu~-+-D(rOG-}$PIrOQ|IWf3MP_PVtN4c zyebjhgd|weIrm!v&P0gemE69fnW-(Qao?htjkv8XZG({rwv;T^YFU5E>ah|(ZeEj!V!6dE z(ZRMj(lFTX#wLm}&xj;~J!~KInDPE(DhR)ml2&R}BHoh-_MuZk7D&YV)}oj3LOA#bc7Vo;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leted file mode 100644 index 27873be9e..000000000 --- a/libs/ref/js.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -interface Uint8ClampedArray extends ArrayBuffer { - BYTES_PER_ELEMENT: number; - length: number; - [index: number]: number; - get(index: number): number; - set(index: number, value: number): void; - set(array: Uint8ClampedArray, offset?: number): void; - set(array: number[], offset?: number): void; - subarray(begin: number, end?: number): Uint8ClampedArray; -} - -declare var Uint8ClampedArray: { - prototype: Uint8ClampedArray; - new (length: number): Uint8ClampedArray; - new (array: Uint8Array): Uint8ClampedArray; - new (array: number[]): Uint8ClampedArray; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray; - BYTES_PER_ELEMENT: number; -} - diff --git a/libs/stagegl-core.next.d.ts b/libs/stagegl-core.next.d.ts deleted file mode 100644 index 9f929593c..000000000 --- a/libs/stagegl-core.next.d.ts +++ /dev/null @@ -1,4515 +0,0 @@ -/// -/// -/// -declare module aglsl { - class Sampler { - public lodbias: number; - public dim: number; - public readmode: number; - public special: number; - public wrap: number; - public mipmap: number; - public filter: number; - constructor(); - } -} -declare module aglsl { - class Token { - public dest: Destination; - public opcode: number; - public a: Destination; - public b: Destination; - constructor(); - } -} -declare module aglsl { - class Header { - public progid: number; - public version: number; - public type: string; - constructor(); - } -} -declare module aglsl { - class OpLUT { - public s: string; - public flags: number; - public dest: boolean; - public a: boolean; - public b: boolean; - public matrixwidth: number; - public matrixheight: number; - public ndwm: boolean; - public scalar: boolean; - public dm: boolean; - public lod: boolean; - constructor(s: string, flags: number, dest: boolean, a: boolean, b: boolean, matrixwidth: number, matrixheight: number, ndwm: boolean, scaler: boolean, dm: boolean, lod: boolean); - } -} -declare module aglsl { - class Description { - public regread: any[]; - public regwrite: any[]; - public hasindirect: boolean; - public writedepth: boolean; - public hasmatrix: boolean; - public samplers: any[]; - public tokens: Token[]; - public header: Header; - constructor(); - } -} -declare module aglsl { - class Destination { - public mask: number; - public regnum: number; - public regtype: number; - public dim: number; - constructor(); - } -} -declare module aglsl { - class Mapping { - static agal2glsllut: OpLUT[]; - } -} -declare module aglsl.assembler { - class Opcode { - public dest: string; - public a: FS; - public b: FS; - public opcode: number; - public flags: Flags; - constructor(dest: string, aformat: string, asize: number, bformat: string, bsize: number, opcode: number, simple: boolean, horizontal: boolean, fragonly: boolean, matrix: boolean); - } - class FS { - public format: string; - public size: number; - } - class Flags { - public simple: boolean; - public horizontal: boolean; - public fragonly: boolean; - public matrix: boolean; - } -} -declare module aglsl.assembler { - class OpcodeMap { - private static _map; - static map : Object[]; - constructor(); - } -} -declare module aglsl.assembler { - class Part { - public name: string; - public version: number; - public data: away.utils.ByteArray; - constructor(name?: string, version?: number); - } -} -declare module aglsl.assembler { - class Reg { - public code: number; - public desc: string; - constructor(code: number, desc: string); - } - class RegMap { - private static _map; - static map : any[]; - constructor(); - } -} -declare module aglsl.assembler { - class Sampler { - public shift: number; - public mask: number; - public value: number; - constructor(shift: number, mask: number, value: number); - } - class SamplerMap { - private static _map; - static map : Object[]; - constructor(); - } -} -declare module aglsl.assembler { - class AGALMiniAssembler { - public r: Object; - public cur: Part; - constructor(); - public assemble(source: string, ext_part?: any, ext_version?: any): Object; - private processLine(line, linenr); - public emitHeader(pr: Part): void; - public emitOpcode(pr: Part, opcode: any): void; - public emitZeroDword(pr: Part): void; - public emitZeroQword(pr: any): void; - public emitDest(pr: any, token: any, opdest: any): boolean; - public stringToMask(s: string): number; - public stringToSwizzle(s: any): number; - public emitSampler(pr: Part, token: any, opsrc: any, opts: any): boolean; - public emitSource(pr: any, token: any, opsrc: any): boolean; - public addHeader(partname: any, version: any): void; - } -} -declare module aglsl { - class AGALTokenizer { - constructor(); - public decribeAGALByteArray(bytes: away.utils.ByteArray): Description; - public readReg(s: any, mh: any, desc: any, bytes: any): void; - } -} -declare module aglsl { - class AGLSLParser { - public parse(desc: Description): string; - public regtostring(regtype: number, regnum: number, desc: Description, tag: any): string; - public sourcetostring(s: any, subline: any, dwm: any, isscalar: any, desc: any, tag: any): string; - } -} -declare module away.events { - /** - * Dispatched to notify changes in an animator's state. - */ - class AnimatorEvent extends Event { - /** - * Defines the value of the type property of a start event object. - */ - static START: string; - /** - * Defines the value of the type property of a stop event object. - */ - static STOP: string; - /** - * Defines the value of the type property of a cycle complete event object. - */ - static CYCLE_COMPLETE: string; - private _animator; - /** - * Create a new AnimatorEvent object. - * - * @param type The event type. - * @param animator The animator object that is the subject of this event. - */ - constructor(type: string, animator: animators.AnimatorBase); - public animator : animators.AnimatorBase; - /** - * Clones the event. - * - * @return An exact duplicate of the current event object. - */ - public clone(): Event; - } -} -/** -* @module away.events -*/ -declare module away.events { - class ShadingMethodEvent extends Event { - static SHADER_INVALIDATED: string; - constructor(type: string); - } -} -declare module away.errors { - class AnimationSetError extends Error { - constructor(message: string); - } -} -/** -* @module away.pool -*/ -declare module away.pool { - /** - * @class away.pool.RenderableListItem - */ - class RenderableBase implements IRenderable { - private _onIndicesUpdatedDelegate; - private _onVerticesUpdatedDelegate; - private _subGeometry; - private _geometryDirty; - private _indexData; - private _indexDataDirty; - private _vertexData; - public _pVertexDataDirty: Object; - private _vertexOffset; - private _level; - private _indexOffset; - private _overflow; - private _numTriangles; - private _concatenateArrays; - public JOINT_INDEX_FORMAT: string; - public JOINT_WEIGHT_FORMAT: string; - /** - * - */ - public _pool: RenderablePool; - /** - * - */ - public overflow : RenderableBase; - /** - * - */ - public numTriangles : number; - /** - * - */ - public next: RenderableBase; - /** - * - */ - public materialId: number; - /** - * - */ - public renderOrderId: number; - /** - * - */ - public zIndex: number; - /** - * - */ - public cascaded: boolean; - /** - * - */ - public renderSceneTransform: geom.Matrix3D; - /** - * - */ - public sourceEntity: entities.IEntity; - /** - * - */ - public materialOwner: base.IMaterialOwner; - /** - * - */ - public material: materials.MaterialBase; - /** - * - */ - public getIndexData(): IndexData; - /** - * - */ - public getVertexData(dataType: string): VertexData; - /** - * - */ - public getVertexOffset(dataType: string): number; - /** - * - * @param sourceEntity - * @param materialOwner - * @param subGeometry - * @param animationSubGeometry - */ - constructor(pool: RenderablePool, sourceEntity: entities.IEntity, materialOwner: base.IMaterialOwner, level?: number, indexOffset?: number); - public dispose(): void; - public invalidateGeometry(): void; - /** - * - */ - public invalidateIndexData(): void; - /** - * //TODO - * - * @param dataType - */ - public invalidateVertexData(dataType: string): void; - public _pGetSubGeometry(): base.SubGeometryBase; - /** - * //TODO - * - * @param subGeometry - * @param offset - * @internal - */ - public _iFillIndexData(indexOffset: number): void; - public _pGetOverflowRenderable(pool: RenderablePool, materialOwner: base.IMaterialOwner, level: number, indexOffset: number): RenderableBase; - /** - * //TODO - * - * @private - */ - private _updateGeometry(); - /** - * //TODO - * - * @private - */ - private _updateIndexData(); - /** - * //TODO - * - * @param dataType - * @private - */ - private _updateVertexData(dataType); - /** - * //TODO - * - * @param event - * @private - */ - private _onIndicesUpdated(event); - /** - * //TODO - * - * @param event - * @private - */ - private _onVerticesUpdated(event); - } -} -/** -* @module away.pool -*/ -declare module away.pool { - /** - * @class away.pool.RenderableListItem - */ - class BillboardRenderable extends RenderableBase { - private static _materialGeometry; - /** - * - */ - static id: string; - /** - * - */ - private _billboard; - /** - * //TODO - * - * @param pool - * @param billboard - */ - constructor(pool: RenderablePool, billboard: entities.Billboard); - /** - * //TODO - * - * @returns {away.base.TriangleSubGeometry} - */ - public _pGetSubGeometry(): base.SubGeometryBase; - } -} -/** -* @module away.base -*/ -declare module away.pool { - /** - * - */ - class IndexData { - private static LIMIT_VERTS; - private static LIMIT_INDICES; - private _dataDirty; - public invalid: boolean[]; - public contexts: stagegl.ContextGLBase[]; - public buffers: stagegl.IIndexBuffer[]; - public data: number[]; - public indexMappings: number[]; - public originalIndices: number[]; - public offset: number; - public level: number; - constructor(level: number); - public updateData(offset: number, indices: number[], numVertices: number): void; - public invalidateData(): void; - public dispose(): void; - /** - * @private - */ - private disposeBuffers(); - /** - * @private - */ - private invalidateBuffers(); - /** - * - * @param data - * @private - */ - private setData(data); - } -} -/** -* @module away.base -*/ -declare module away.pool { - /** - * - */ - class IndexDataPool { - private static _pool; - constructor(); - static getItem(subGeometry: base.SubGeometryBase, level: number, indexOffset: number): IndexData; - static disposeItem(id: number, level: number): void; - public disposeData(id: number): void; - } -} -/** -* @module away.pool -*/ -declare module away.pool { - /** - * @class away.pool.LineSubMeshRenderable - */ - class LineSubMeshRenderable extends RenderableBase { - /** - * - */ - static id: string; - /** - * - */ - public subMesh: base.LineSubMesh; - /** - * //TODO - * - * @param pool - * @param subMesh - * @param level - * @param dataOffset - */ - constructor(pool: RenderablePool, subMesh: base.LineSubMesh, level?: number, indexOffset?: number); - /** - * //TODO - * - * @returns {base.LineSubGeometry} - * @protected - */ - public _pGetSubGeometry(): base.LineSubGeometry; - /** - * //TODO - * - * @param pool - * @param materialOwner - * @param level - * @param indexOffset - * @returns {away.pool.LineSubMeshRenderable} - * @private - */ - public _pGetOverflowRenderable(pool: RenderablePool, materialOwner: base.IMaterialOwner, level: number, indexOffset: number): RenderableBase; - } -} -/** -* @module away.pool -*/ -declare module away.pool { - /** - * - * @class away.pool.ProgramDataBase - */ - class ProgramData { - static PROGRAMDATA_ID_COUNT: number; - private _pool; - private _key; - public context: stagegl.ContextGLBase; - public usages: number; - public program: stagegl.IProgram; - public id: number; - constructor(pool: ProgramDataPool, context: stagegl.ContextGLBase, key: string); - /** - * - */ - public dispose(): void; - } -} -/** -* @module away.pool -*/ -declare module away.pool { - /** - * @class away.pool.ProgramDataPool - */ - class ProgramDataPool { - private _pool; - private _context; - /** - * //TODO - * - * @param textureDataClass - */ - constructor(context: stagegl.ContextGLBase); - /** - * //TODO - * - * @param materialOwner - * @returns ITexture - */ - public getItem(key: string): ProgramData; - /** - * //TODO - * - * @param materialOwner - */ - public disposeItem(key: string): void; - } -} -/** -* @module away.pool -*/ -declare module away.pool { - /** - * @class away.pool.SkyboxRenderable - */ - class SkyboxRenderable extends RenderableBase { - /** - * - */ - static id: string; - /** - * - */ - private static _geometry; - /** - * //TODO - * - * @param pool - * @param skybox - */ - constructor(pool: RenderablePool, skybox: entities.Skybox); - /** - * //TODO - * - * @returns {away.base.TriangleSubGeometry} - * @private - */ - public _pGetSubGeometry(): base.TriangleSubGeometry; - } -} -/** -* @module away.pool -*/ -declare module away.pool { - /** - * - * @class away.pool.MaterialData - */ - class MaterialData implements IMaterialData { - private _pool; - private _materialPassDataPool; - private _passes; - public context: stagegl.ContextGLBase; - public material: materials.StageGLMaterialBase; - public renderOrderId: number; - public invalidAnimation: boolean; - constructor(pool: MaterialDataPool, context: stagegl.ContextGLBase, material: materials.StageGLMaterialBase); - public getMaterialPass(materialPass: materials.MaterialPassBase, profile: string): MaterialPassData; - public getMaterialPasses(profile: string): MaterialPassData[]; - /** - * - */ - public dispose(): void; - /** - * - */ - public invalidateMaterial(): void; - /** - * - */ - public invalidateAnimation(): void; - } -} -/** -* @module away.pool -*/ -declare module away.pool { - /** - * @class away.pool.MaterialDataPool - */ - class MaterialDataPool { - private _pool; - private _context; - /** - * //TODO - * - * @param textureDataClass - */ - constructor(context: stagegl.ContextGLBase); - /** - * //TODO - * - * @param materialOwner - * @returns ITexture - */ - public getItem(material: materials.StageGLMaterialBase): MaterialData; - /** - * //TODO - * - * @param materialOwner - */ - public disposeItem(material: materials.StageGLMaterialBase): void; - } -} -/** -* @module away.pool -*/ -declare module away.pool { - /** - * - * @class away.pool.MaterialPassData - */ - class MaterialPassData implements IMaterialPassData { - private _pool; - public material: materials.StageGLMaterialBase; - public shaderObject: materials.ShaderObjectBase; - public materialPass: materials.MaterialPassBase; - public programData: ProgramData; - public shadedTarget: string; - public vertexCode: string; - public postAnimationFragmentCode: string; - public fragmentCode: string; - public animationVertexCode: string; - public animationFragmentCode: string; - public key: string; - public invalid: boolean; - public usesAnimation: boolean; - constructor(pool: MaterialPassDataPool, material: materials.StageGLMaterialBase, materialPass: materials.MaterialPassBase); - /** - * - */ - public dispose(): void; - /** - * - */ - public invalidate(): void; - } -} -/** -* @module away.pool -*/ -declare module away.pool { - /** - * @class away.pool.MaterialPassDataPool - */ - class MaterialPassDataPool { - private _pool; - private _material; - /** - * //TODO - * - * @param textureDataClass - */ - constructor(material: materials.StageGLMaterialBase); - /** - * //TODO - * - * @param materialOwner - * @returns ITexture - */ - public getItem(materialPass: materials.MaterialPassBase): MaterialPassData; - /** - * //TODO - * - * @param materialOwner - */ - public disposeItem(materialPass: materials.MaterialPassBase): void; - public disposePool(): void; - } -} -/** -* @module away.pool -*/ -declare module away.pool { - /** - * - * @class away.pool.TextureDataBase - */ - class TextureData implements ITextureData { - private _pool; - public context: stagegl.ContextGLBase; - public texture: stagegl.ITextureBase; - public textureProxy: textures.TextureProxyBase; - public invalid: boolean; - constructor(pool: TextureDataPool, context: stagegl.ContextGLBase, textureProxy: textures.TextureProxyBase); - /** - * - */ - public dispose(): void; - /** - * - */ - public invalidate(): void; - } -} -/** -* @module away.pool -*/ -declare module away.pool { - /** - * @class away.pool.TextureDataPool - */ - class TextureDataPool { - private _pool; - private _context; - /** - * //TODO - * - * @param textureDataClass - */ - constructor(context: stagegl.ContextGLBase); - /** - * //TODO - * - * @param materialOwner - * @returns ITexture - */ - public getItem(textureProxy: textures.TextureProxyBase): TextureData; - /** - * //TODO - * - * @param materialOwner - */ - public disposeItem(textureProxy: textures.TextureProxyBase): void; - } -} -/** -* @module away.pool -*/ -declare module away.pool { - /** - * @class away.pool.TriangleSubMeshRenderable - */ - class TriangleSubMeshRenderable extends RenderableBase { - /** - * - */ - static id: string; - /** - * - */ - public subMesh: base.TriangleSubMesh; - /** - * //TODO - * - * @param pool - * @param subMesh - * @param level - * @param indexOffset - */ - constructor(pool: RenderablePool, subMesh: base.TriangleSubMesh, level?: number, indexOffset?: number); - /** - * - * @returns {away.base.SubGeometryBase} - * @protected - */ - public _pGetSubGeometry(): base.TriangleSubGeometry; - /** - * //TODO - * - * @param pool - * @param materialOwner - * @param level - * @param indexOffset - * @returns {away.pool.TriangleSubMeshRenderable} - * @protected - */ - public _pGetOverflowRenderable(pool: RenderablePool, materialOwner: base.IMaterialOwner, level: number, indexOffset: number): RenderableBase; - } -} -/** -* @module away.base -*/ -declare module away.pool { - /** - * - */ - class VertexData { - private _onVerticesUpdatedDelegate; - private _subGeometry; - private _dataType; - private _dataDirty; - public invalid: boolean[]; - public buffers: stagegl.IVertexBuffer[]; - public contexts: stagegl.ContextGLBase[]; - public data: number[]; - public dataPerVertex: number; - constructor(subGeometry: base.SubGeometryBase, dataType: string); - public updateData(originalIndices?: number[], indexMappings?: number[]): void; - public dispose(): void; - /** - * @private - */ - private disposeBuffers(); - /** - * @private - */ - private invalidateBuffers(); - /** - * - * @param data - * @param dataPerVertex - * @private - */ - private setData(data); - /** - * //TODO - * - * @param event - * @private - */ - private _onVerticesUpdated(event); - } -} -/** -* @module away.base -*/ -declare module away.pool { - /** - * - */ - class VertexDataPool { - private static _pool; - constructor(); - static getItem(subGeometry: base.SubGeometryBase, indexData: IndexData, dataType: string): VertexData; - static disposeItem(subGeometry: base.SubGeometryBase, level: number, dataType: string): void; - public disposeData(subGeometry: base.SubGeometryBase): void; - } -} -declare module away.stagegl { - /** - * Stage provides a proxy class to handle the creation and attachment of the Context - * (and in turn the back buffer) it uses. Stage should never be created directly, - * but requested through StageManager. - * - * @see away.managers.StageManager - * - */ - class ContextGLBase implements display.IContext { - private _programData; - private _numUsedStreams; - private _numUsedTextures; - public _pContainer: HTMLElement; - private _texturePool; - private _materialDataPool; - private _programDataPool; - private _width; - private _height; - private _stageIndex; - private _antiAlias; - private _enableDepthAndStencil; - private _renderTarget; - private _renderSurfaceSelector; - public container : HTMLElement; - constructor(stageIndex: number); - public setRenderTarget(target: textures.TextureProxyBase, enableDepthAndStencil?: boolean, surfaceSelector?: number): void; - public getRenderTexture(textureProxy: textures.RenderTexture): ITextureBase; - public getProgram(materialPassData: pool.MaterialPassData): pool.ProgramData; - /** - * - * @param material - */ - public getMaterial(material: materials.StageGLMaterialBase, profile: string): pool.MaterialData; - /** - * Assigns an attribute stream - * - * @param index The attribute stream index for the vertex shader - * @param buffer - * @param offset - * @param stride - * @param format - */ - public activateBuffer(index: number, buffer: pool.VertexData, offset: number, format: string): void; - public disposeVertexData(buffer: pool.VertexData): void; - public activateRenderTexture(index: number, textureProxy: textures.RenderTexture): void; - public activateMaterialPass(materialPassData: pool.MaterialPassData, stage: base.Stage, camera: entities.Camera): void; - public deactivateMaterialPass(materialPassData: pool.MaterialPassData, stage: base.Stage): void; - public activateTexture(index: number, textureProxy: textures.Texture2DBase): void; - public activateCubeTexture(index: number, textureProxy: textures.CubeTextureBase): void; - /** - * Retrieves the VertexBuffer object that contains triangle indices. - * @param context The ContextWeb for which we request the buffer - * @return The VertexBuffer object that contains triangle indices. - */ - public getIndexBuffer(buffer: pool.IndexData): IIndexBuffer; - public disposeIndexData(buffer: pool.IndexData): void; - public clear(red?: number, green?: number, blue?: number, alpha?: number, depth?: number, stencil?: number, mask?: number): void; - public configureBackBuffer(width: number, height: number, antiAlias: number, enableDepthAndStencil?: boolean): void; - public createIndexBuffer(numIndices: number): IIndexBuffer; - public createVertexBuffer(numVertices: number, data32PerVertex: number): IVertexBuffer; - public createTexture(width: number, height: number, format: string, optimizeForRenderToTexture: boolean, streamingLevels?: number): ITexture; - public createCubeTexture(size: number, format: string, optimizeForRenderToTexture: boolean, streamingLevels?: number): ICubeTexture; - public createProgram(): IProgram; - public dispose(): void; - public present(): void; - public setRenderToTexture(target: ITextureBase, enableDepthAndStencil?: boolean, antiAlias?: number, surfaceSelector?: number): void; - public setRenderToBackBuffer(): void; - public setScissorRectangle(rectangle: geom.Rectangle): void; - public setTextureAt(sampler: number, texture: ITextureBase): void; - public setVertexBufferAt(index: number, buffer: IVertexBuffer, bufferOffset?: number, format?: string): void; - public setProgram(program: IProgram): void; - public registerProgram(programData: pool.ProgramData): void; - public unRegisterProgram(programData: pool.ProgramData): void; - /** - * test if animation will be able to run on gpu BEFORE compiling materials - * test if the shader objects supports animating the animation set in the vertex shader - * if any object using this material fails to support accelerated animations for any of the shader objects, - * we should do everything on cpu (otherwise we have the cost of both gpu + cpu animations) - */ - private getEnabledGPUAnimation(material, materialDataPasses); - public calcAnimationCode(material: materials.StageGLMaterialBase, materialPassData: pool.MaterialPassData): void; - } -} -declare module away.stagegl { - class ContextGLClearMask { - static COLOR: number; - static DEPTH: number; - static STENCIL: number; - static ALL: number; - } -} -declare module away.stagegl { - class ContextGLTextureFormat { - static BGRA: string; - static BGRA_PACKED: string; - static BGR_PACKED: string; - static COMPRESSED: string; - static COMPRESSED_ALPHA: string; - } -} -declare module away.stagegl { - class ContextGLTriangleFace { - static BACK: string; - static FRONT: string; - static FRONT_AND_BACK: string; - static NONE: string; - } -} -declare module away.stagegl { - class ContextGLVertexBufferFormat { - static BYTES_4: string; - static FLOAT_1: string; - static FLOAT_2: string; - static FLOAT_3: string; - static FLOAT_4: string; - } -} -declare module away.stagegl { - class ContextGLProgramType { - static FRAGMENT: string; - static VERTEX: string; - } -} -declare module away.stagegl { - class ContextGLBlendFactor { - static DESTINATION_ALPHA: string; - static DESTINATION_COLOR: string; - static ONE: string; - static ONE_MINUS_DESTINATION_ALPHA: string; - static ONE_MINUS_DESTINATION_COLOR: string; - static ONE_MINUS_SOURCE_ALPHA: string; - static ONE_MINUS_SOURCE_COLOR: string; - static SOURCE_ALPHA: string; - static SOURCE_COLOR: string; - static ZERO: string; - } -} -declare module away.stagegl { - class ContextGLCompareMode { - static ALWAYS: string; - static EQUAL: string; - static GREATER: string; - static GREATER_EQUAL: string; - static LESS: string; - static LESS_EQUAL: string; - static NEVER: string; - static NOT_EQUAL: string; - } -} -declare module away.stagegl { - class ContextGLMipFilter { - static MIPLINEAR: string; - static MIPNEAREST: string; - static MIPNONE: string; - } -} -declare module away.stagegl { - class ContextGLProfile { - static BASELINE: string; - static BASELINE_CONSTRAINED: string; - static BASELINE_EXTENDED: string; - } -} -declare module away.stagegl { - class ContextGLStencilAction { - static DECREMENT_SATURATE: string; - static DECREMENT_WRAP: string; - static INCREMENT_SATURATE: string; - static INCREMENT_WRAP: string; - static INVERT: string; - static KEEP: string; - static SET: string; - static ZERO: string; - } -} -declare module away.stagegl { - class ContextGLTextureFilter { - static LINEAR: string; - static NEAREST: string; - } -} -declare module away.stagegl { - class ContextGLWrapMode { - static CLAMP: string; - static REPEAT: string; - } -} -declare module away.stagegl { - class ContextStage3D extends ContextGLBase implements IContextStageGL { - static contexts: Object; - static maxvertexconstants: number; - static maxfragconstants: number; - static maxtemp: number; - static maxstreams: number; - static maxtextures: number; - static defaultsampler: aglsl.Sampler; - public _iDriverInfo: any; - private _cmdStream; - private _errorCheckingEnabled; - private _resources; - private _oldCanvas; - private _oldParent; - static debug: boolean; - static logStream: boolean; - public _iCallback: (context: IContextStageGL) => void; - public container : HTMLElement; - public driverInfo : any; - public errorCheckingEnabled : boolean; - constructor(container: HTMLCanvasElement, stageIndex: number, callback: (context: IContextStageGL) => void); - public _iAddResource(resource: ResourceBaseFlash): void; - public _iRemoveResource(resource: ResourceBaseFlash): void; - public createTexture(width: number, height: number, format: string, optimizeForRenderToTexture: boolean, streamingLevels?: number): TextureFlash; - public createCubeTexture(size: number, format: string, optimizeForRenderToTexture: boolean, streamingLevels?: number): CubeTextureFlash; - public setTextureAt(sampler: number, texture: ResourceBaseFlash): void; - public setSamplerStateAt(sampler: number, wrap: string, filter: string, mipfilter: string): void; - public setStencilActions(triangleFace?: string, compareMode?: string, actionOnBothPass?: string, actionOnDepthFail?: string, actionOnDepthPassStencilFail?: string): void; - public setStencilReferenceValue(referenceValue: number, readMask?: number, writeMask?: number): void; - public setCulling(triangleFaceToCull: string, coordinateSystem?: string): void; - public drawTriangles(indexBuffer: IndexBufferFlash, firstIndex?: number, numTriangles?: number): void; - public setProgramConstantsFromMatrix(programType: string, firstRegister: number, matrix: geom.Matrix3D, transposedMatrix?: boolean): void; - public setProgramConstantsFromArray(programType: string, firstRegister: number, data: number[], numRegisters?: number): void; - public setProgram(program: ProgramFlash): void; - public present(): void; - public clear(red?: number, green?: number, blue?: number, alpha?: number, depth?: number, stencil?: number, mask?: number): void; - public createProgram(): ProgramFlash; - public createVertexBuffer(numVertices: number, data32PerVertex: number): VertexBufferFlash; - public createIndexBuffer(numIndices: number): IndexBufferFlash; - public configureBackBuffer(width: number, height: number, antiAlias: number, enableDepthAndStencil?: boolean): void; - public drawToBitmapData(destination: base.BitmapData): void; - public setVertexBufferAt(index: number, buffer: VertexBufferFlash, bufferOffset?: number, format?: string): void; - public setColorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; - public setBlendFactors(sourceFactor: string, destinationFactor: string): void; - public setRenderToTexture(target: ResourceBaseFlash, enableDepthAndStencil?: boolean, antiAlias?: number, surfaceSelector?: number): void; - public setRenderToBackBuffer(): void; - public setScissorRectangle(rectangle: geom.Rectangle): void; - public setDepthTest(depthMask: boolean, passCompareMode: string): void; - public dispose(): void; - public addStream(stream: string): void; - public execute(): number; - } -} -/** -* global function for flash callback -*/ -declare function mountain_js_context_available(id: any, driverInfo: any): void; -declare module away.stagegl { - class ContextWebGL extends ContextGLBase implements IContextStageGL { - private _blendFactorDictionary; - private _depthTestDictionary; - private _textureIndexDictionary; - private _textureTypeDictionary; - private _wrapDictionary; - private _filterDictionary; - private _mipmapFilterDictionary; - private _uniformLocationNameDictionary; - private _vertexBufferDimensionDictionary; - private _drawing; - private _blendEnabled; - private _blendSourceFactor; - private _blendDestinationFactor; - private _indexBufferList; - private _vertexBufferList; - private _textureList; - private _programList; - private _samplerStates; - static MAX_SAMPLERS: number; - public _gl: WebGLRenderingContext; - public _currentProgram: ProgramWebGL; - private _activeTexture; - public container : HTMLElement; - constructor(canvas: HTMLCanvasElement, stageIndex: number); - public gl(): WebGLRenderingContext; - public clear(red?: number, green?: number, blue?: number, alpha?: number, depth?: number, stencil?: number, mask?: number): void; - public configureBackBuffer(width: number, height: number, antiAlias: number, enableDepthAndStencil?: boolean): void; - public createCubeTexture(size: number, format: string, optimizeForRenderToTexture: boolean, streamingLevels?: number): CubeTextureWebGL; - public createIndexBuffer(numIndices: number): IndexBufferWebGL; - public createProgram(): ProgramWebGL; - public createTexture(width: number, height: number, format: string, optimizeForRenderToTexture: boolean, streamingLevels?: number): TextureWebGL; - public createVertexBuffer(numVertices: number, data32PerVertex: number): VertexBufferWebGL; - public dispose(): void; - public drawToBitmapData(destination: base.BitmapData): void; - public drawTriangles(indexBuffer: IndexBufferWebGL, firstIndex?: number, numTriangles?: number): void; - public present(): void; - public setBlendFactors(sourceFactor: string, destinationFactor: string): void; - public setColorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; - public setCulling(triangleFaceToCull: string, coordinateSystem?: string): void; - public setDepthTest(depthMask: boolean, passCompareMode: string): void; - public setProgram(program: ProgramWebGL): void; - public setProgramConstantsFromMatrix(programType: string, firstRegister: number, matrix: geom.Matrix3D, transposedMatrix?: boolean): void; - static modulo: number; - public setProgramConstantsFromArray(programType: string, firstRegister: number, data: number[], numRegisters?: number): void; - public setScissorRectangle(rectangle: geom.Rectangle): void; - public setTextureAt(sampler: number, texture: TextureBaseWebGL): void; - public setSamplerStateAt(sampler: number, wrap: string, filter: string, mipfilter: string): void; - public setVertexBufferAt(index: number, buffer: VertexBufferWebGL, bufferOffset?: number, format?: string): void; - public setRenderToTexture(target: TextureBaseWebGL, enableDepthAndStencil?: boolean, antiAlias?: number, surfaceSelector?: number): void; - public setRenderToBackBuffer(): void; - private updateBlendStatus(); - } -} -declare module away.stagegl { - class ResourceBaseFlash { - public _pId: number; - public id : number; - public dispose(): void; - } -} -declare module away.stagegl { - class TextureBaseWebGL { - public textureType: string; - public _gl: WebGLRenderingContext; - constructor(gl: WebGLRenderingContext); - public dispose(): void; - public glTexture : WebGLTexture; - } -} -declare module away.stagegl { - class CubeTextureFlash extends ResourceBaseFlash implements ICubeTexture { - private _context; - private _size; - public size : number; - constructor(context: ContextStage3D, size: number, format: string, forRTT: boolean, streaming?: boolean); - public dispose(): void; - public uploadFromData(bitmapData: base.BitmapData, side: number, miplevel?: number): any; - public uploadFromData(image: HTMLImageElement, side: number, miplevel?: number): any; - public uploadCompressedTextureFromByteArray(data: utils.ByteArray, byteArrayOffset: number, async?: boolean): void; - } -} -declare module away.stagegl { - class CubeTextureWebGL extends TextureBaseWebGL implements ICubeTexture { - private _textureSelectorDictionary; - public textureType: string; - private _texture; - private _size; - constructor(gl: WebGLRenderingContext, size: number); - public dispose(): void; - public uploadFromData(bitmapData: base.BitmapData, side: number, miplevel?: number): any; - public uploadFromData(image: HTMLImageElement, side: number, miplevel?: number): any; - public uploadCompressedTextureFromByteArray(data: utils.ByteArray, byteArrayOffset: number, async?: boolean): void; - public size : number; - public glTexture : WebGLTexture; - } -} -declare module away.stagegl { - interface IContextStageGL extends display.IContext { - setRenderTarget(target: textures.TextureProxyBase, enableDepthAndStencil?: boolean, surfaceSelector?: number): any; - getRenderTexture(textureProxy: textures.RenderTexture): ITextureBase; - activateBuffer(index: number, buffer: pool.VertexData, offset: number, format: string): any; - disposeVertexData(buffer: pool.VertexData): any; - activateMaterialPass(materialPassData: pool.MaterialPassData, stage: base.Stage, camera: entities.Camera): any; - activateRenderTexture(index: number, textureProxy: textures.RenderTexture): any; - activateTexture(index: number, textureProxy: textures.Texture2DBase): any; - activateCubeTexture(index: number, textureProxy: textures.CubeTextureBase): any; - getIndexBuffer(buffer: pool.IndexData): IIndexBuffer; - getMaterial(material: materials.MaterialBase, profile: string): pool.MaterialData; - disposeIndexData(buffer: pool.IndexData): any; - clear(red?: number, green?: number, blue?: number, alpha?: number, depth?: number, stencil?: number, mask?: number): any; - configureBackBuffer(width: number, height: number, antiAlias: number, enableDepthAndStencil?: boolean): any; - createCubeTexture(size: number, format: string, optimizeForRenderToTexture: boolean, streamingLevels?: number): ICubeTexture; - createIndexBuffer(numIndices: number): IIndexBuffer; - createProgram(): IProgram; - createTexture(width: number, height: number, format: string, optimizeForRenderToTexture: boolean, streamingLevels?: number): ITexture; - createVertexBuffer(numVertices: number, data32PerVertex: number): IVertexBuffer; - deactivateMaterialPass(materialPassData: pool.MaterialPassData, stage: base.Stage): any; - dispose(): any; - drawToBitmapData(destination: base.BitmapData): any; - drawTriangles(indexBuffer: IIndexBuffer, firstIndex?: number, numTriangles?: number): any; - present(): any; - setBlendFactors(sourceFactor: string, destinationFactor: string): any; - setColorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): any; - setCulling(triangleFaceToCull: string, coordinateSystem?: string): any; - setDepthTest(depthMask: boolean, passCompareMode: string): any; - setProgram(program: IProgram): any; - setProgramConstantsFromMatrix(programType: string, firstRegister: number, matrix: geom.Matrix3D, transposedMatrix?: boolean): any; - setProgramConstantsFromArray(programType: string, firstRegister: number, data: number[], numRegisters?: number): any; - setSamplerStateAt(sampler: number, wrap: string, filter: string, mipfilter: string): any; - setScissorRectangle(rectangle: geom.Rectangle): any; - setTextureAt(sampler: number, texture: ITextureBase): any; - setVertexBufferAt(index: number, buffer: IVertexBuffer, bufferOffset?: number, format?: string): any; - setRenderToTexture(target: ITextureBase, enableDepthAndStencil?: boolean, antiAlias?: number, surfaceSelector?: number): any; - setRenderToBackBuffer(): any; - calcAnimationCode(material: materials.MaterialBase, materialPassData: pool.MaterialPassData): any; - } -} -declare module away.stagegl { - interface ICubeTexture extends ITextureBase { - size: number; - uploadFromData(bitmapData: base.BitmapData, side: number, miplevel?: number): any; - uploadFromData(image: HTMLImageElement, side: number, miplevel?: number): any; - uploadCompressedTextureFromByteArray(data: utils.ByteArray, byteArrayOffset: number, async: boolean): any; - } -} -declare module away.stagegl { - interface IIndexBuffer { - numIndices: number; - uploadFromArray(data: number[], startOffset: number, count: number): any; - dispose(): any; - } -} -declare module away.stagegl { - class IndexBufferFlash extends ResourceBaseFlash implements IIndexBuffer { - private _context; - private _numIndices; - constructor(context: ContextStage3D, numIndices: number); - public uploadFromArray(data: number[], startOffset: number, count: number): void; - public dispose(): void; - public numIndices : number; - } -} -declare module away.stagegl { - class IndexBufferWebGL implements IIndexBuffer { - private _gl; - private _numIndices; - private _buffer; - constructor(gl: WebGLRenderingContext, numIndices: number); - public uploadFromArray(data: number[], startOffset: number, count: number): void; - public dispose(): void; - public numIndices : number; - public glBuffer : WebGLBuffer; - } -} -declare module away.stagegl { - interface IProgram { - upload(vertexProgram: utils.ByteArray, fragmentProgram: utils.ByteArray): any; - dispose(): any; - } -} -declare module away.stagegl { - interface ITexture extends ITextureBase { - width: number; - height: number; - uploadFromData(bitmapData: base.BitmapData, miplevel?: number): any; - uploadFromData(image: HTMLImageElement, miplevel?: number): any; - } -} -declare module away.stagegl { - interface ITextureBase { - dispose(): any; - } -} -declare module away.stagegl { - interface IVertexBuffer { - numVertices: number; - data32PerVertex: number; - uploadFromArray(data: number[], startVertex: number, numVertices: number): any; - dispose(): any; - } -} -declare module away.stagegl { - class OpCodes { - static trueValue: number; - static falseValue: number; - static intMask: number; - static drawTriangles: number; - static setProgramConstant: number; - static setProgram: number; - static present: number; - static clear: number; - static initProgram: number; - static initVertexBuffer: number; - static initIndexBuffer: number; - static configureBackBuffer: number; - static uploadArrayIndexBuffer: number; - static uploadArrayVertexBuffer: number; - static uploadAGALBytesProgram: number; - static setVertexBufferAt: number; - static uploadBytesIndexBuffer: number; - static uploadBytesVertexBuffer: number; - static setColorMask: number; - static setDepthTest: number; - static disposeProgram: number; - static disposeContext: number; - static disposeVertexBuffer: number; - static disposeIndexBuffer: number; - static initTexture: number; - static setTextureAt: number; - static uploadBytesTexture: number; - static disposeTexture: number; - static setCulling: number; - static setScissorRect: number; - static clearScissorRect: number; - static setBlendFactors: number; - static setRenderToTexture: number; - static clearTextureAt: number; - static clearVertexBufferAt: number; - static setStencilActions: number; - static setStencilReferenceValue: number; - static initCubeTexture: number; - static disposeCubeTexture: number; - static uploadBytesCubeTexture: number; - static clearRenderToTexture: number; - static enableErrorChecking: number; - } -} -declare module away.stagegl { - class ProgramFlash extends ResourceBaseFlash implements IProgram { - private _context; - constructor(context: ContextStage3D); - public upload(vertexProgram: utils.ByteArray, fragmentProgram: utils.ByteArray): void; - public dispose(): void; - } -} -declare module away.stagegl { - class ProgramWebGL implements IProgram { - private static _tokenizer; - private static _aglslParser; - private _gl; - private _program; - private _vertexShader; - private _fragmentShader; - constructor(gl: WebGLRenderingContext); - public upload(vertexProgram: utils.ByteArray, fragmentProgram: utils.ByteArray): void; - public dispose(): void; - public focusProgram(): void; - public glProgram : WebGLProgram; - } -} -declare module away.stagegl { - class SamplerState { - public type: number; - public wrap: number; - public filter: number; - public mipfilter: number; - } -} -declare module away.stagegl { - class TextureFlash extends ResourceBaseFlash implements ITexture { - private _context; - private _width; - private _height; - public width : number; - public height : number; - constructor(context: ContextStage3D, width: number, height: number, format: string, forRTT: boolean, streaming?: boolean); - public dispose(): void; - public uploadFromData(bitmapData: base.BitmapData, miplevel?: number): any; - public uploadFromData(image: HTMLImageElement, miplevel?: number): any; - } -} -declare module away.stagegl { - class TextureWebGL extends TextureBaseWebGL implements ITexture { - public textureType: string; - private _width; - private _height; - private _frameBuffer; - private _glTexture; - constructor(gl: WebGLRenderingContext, width: number, height: number); - public dispose(): void; - public width : number; - public height : number; - public frameBuffer : WebGLFramebuffer; - public uploadFromData(bitmapData: base.BitmapData, miplevel?: number): any; - public uploadFromData(image: HTMLImageElement, miplevel?: number): any; - public uploadCompressedTextureFromByteArray(data: utils.ByteArray, byteArrayOffset: number, async?: boolean): void; - public glTexture : WebGLTexture; - public generateMipmaps(): void; - } -} -declare module away.stagegl { - class VertexBufferFlash extends ResourceBaseFlash implements IVertexBuffer { - private _context; - private _numVertices; - private _data32PerVertex; - constructor(context: ContextStage3D, numVertices: number, data32PerVertex: number); - public uploadFromArray(data: number[], startVertex: number, numVertices: number): void; - public numVertices : number; - public data32PerVertex : number; - public dispose(): void; - } -} -declare module away.stagegl { - class VertexBufferWebGL implements IVertexBuffer { - private _gl; - private _numVertices; - private _data32PerVertex; - private _buffer; - constructor(gl: WebGLRenderingContext, numVertices: number, data32PerVertex: number); - public uploadFromArray(vertices: number[], startVertex: number, numVertices: number): void; - public numVertices : number; - public data32PerVertex : number; - public glBuffer : WebGLBuffer; - public dispose(): void; - } -} -declare module away.managers { - class AGALProgramCache { - private static _instances; - private _stage; - private _program3Ds; - private _ids; - private _usages; - private _keys; - private _onContextGLDisposedDelegate; - private static _currentId; - constructor(stage: base.Stage, agalProgramCacheSingletonEnforcer: AGALProgramCacheSingletonEnforcer); - static getInstance(stage: base.Stage): AGALProgramCache; - static getInstanceFromIndex(index: number): AGALProgramCache; - private static onContextGLDisposed(event); - public dispose(): void; - public setProgram(programIds: number[], programs: stagegl.IProgram[], vertexCode: string, fragmentCode: string): void; - public freeProgram(programId: number): void; - private destroyProgram(key); - private getKey(vertexCode, fragmentCode); - } -} -declare class AGALProgramCacheSingletonEnforcer { -} -declare module away.managers { - class RTTBufferManager extends events.EventDispatcher { - private static _instances; - private _renderToTextureVertexBuffer; - private _renderToScreenVertexBuffer; - private _indexBuffer; - private _stage; - private _viewWidth; - private _viewHeight; - private _textureWidth; - private _textureHeight; - private _renderToTextureRect; - private _buffersInvalid; - private _textureRatioX; - private _textureRatioY; - constructor(se: SingletonEnforcer, stage: base.Stage); - static getInstance(stage: base.Stage): RTTBufferManager; - private static getRTTBufferManagerFromStage(stage); - private static deleteRTTBufferManager(stage); - public textureRatioX : number; - public textureRatioY : number; - public viewWidth : number; - public viewHeight : number; - public renderToTextureVertexBuffer : stagegl.IVertexBuffer; - public renderToScreenVertexBuffer : stagegl.IVertexBuffer; - public indexBuffer : stagegl.IIndexBuffer; - public renderToTextureRect : geom.Rectangle; - public textureWidth : number; - public textureHeight : number; - public dispose(): void; - private updateRTTBuffers(); - } -} -declare class SingletonEnforcer { -} -declare module away.materials { - /** - * ShaderObjectBase keeps track of the number of dependencies for "named registers" used across a pass. - * Named registers are that are not necessarily limited to a single method. They are created by the compiler and - * passed on to methods. The compiler uses the results to reserve usages through RegisterPool, which can be removed - * each time a method has been compiled into the shader. - * - * @see RegisterPool.addUsage - */ - class ShaderObjectBase { - private _defaultCulling; - public _pInverseSceneMatrix: number[]; - public animationRegisterCache: animators.AnimationRegisterCache; - public profile: string; - /** - * The amount of used vertex constants in the vertex code. Used by the animation code generation to know from which index on registers are available. - */ - public numUsedVertexConstants: number; - /** - * The amount of used fragment constants in the fragment code. Used by the animation code generation to know from which index on registers are available. - */ - public numUsedFragmentConstants: number; - /** - * The amount of used vertex streams in the vertex code. Used by the animation code generation to know from which index on streams are available. - */ - public numUsedStreams: number; - /** - * - */ - public numUsedTextures: number; - /** - * - */ - public numUsedVaryings: number; - public animatableAttributes: string[]; - public animationTargetRegisters: string[]; - public uvSource: string; - public uvTarget: string; - public useAlphaPremultiplied: boolean; - public useBothSides: boolean; - public useMipmapping: boolean; - public useSmoothTextures: boolean; - public repeatTextures: boolean; - public usesUVTransform: boolean; - public alphaThreshold: number; - public texture: textures.Texture2DBase; - public color: number; - public ambientR: number; - public ambientG: number; - public ambientB: number; - /** - * Indicates whether the pass requires any fragment animation code. - */ - public usesFragmentAnimation: boolean; - /** - * The amount of dependencies on the projected position. - */ - public projectionDependencies: number; - /** - * The amount of dependencies on the normal vector. - */ - public normalDependencies: number; - /** - * The amount of dependencies on the view direction. - */ - public viewDirDependencies: number; - /** - * The amount of dependencies on the primary UV coordinates. - */ - public uvDependencies: number; - /** - * The amount of dependencies on the secondary UV coordinates. - */ - public secondaryUVDependencies: number; - /** - * The amount of dependencies on the local position. This can be 0 while hasGlobalPosDependencies is true when - * the global position is used as a temporary value (fe to calculate the view direction) - */ - public localPosDependencies: number; - /** - * The amount of dependencies on the global position. This can be 0 while hasGlobalPosDependencies is true when - * the global position is used as a temporary value (fe to calculate the view direction) - */ - public globalPosDependencies: number; - /** - * The amount of tangent vector dependencies (fragment shader). - */ - public tangentDependencies: number; - /** - * - */ - public outputsNormals: boolean; - /** - * Indicates whether or not normal calculations are expected in tangent space. This is only the case if no world-space - * dependencies exist. - */ - public usesTangentSpace: boolean; - /** - * Indicates whether or not normal calculations are output in tangent space. - */ - public outputsTangentNormals: boolean; - /** - * Indicates whether there are any dependencies on the world-space position vector. - */ - public usesGlobalPosFragment: boolean; - public vertexConstantData: number[]; - public fragmentConstantData: number[]; - /** - * The index for the common data register. - */ - public commonsDataIndex: number; - /** - * The index for the UV vertex attribute stream. - */ - public uvBufferIndex: number; - /** - * The index for the secondary UV vertex attribute stream. - */ - public secondaryUVBufferIndex: number; - /** - * The index for the vertex normal attribute stream. - */ - public normalBufferIndex: number; - /** - * The index for the vertex tangent attribute stream. - */ - public tangentBufferIndex: number; - /** - * The index of the vertex constant containing the view matrix. - */ - public viewMatrixIndex: number; - /** - * The index of the vertex constant containing the scene matrix. - */ - public sceneMatrixIndex: number; - /** - * The index of the vertex constant containing the uniform scene matrix (the inverse transpose). - */ - public sceneNormalMatrixIndex: number; - /** - * The index of the vertex constant containing the camera position. - */ - public cameraPositionIndex: number; - /** - * The index for the UV transformation matrix vertex constant. - */ - public uvTransformIndex: number; - /** - * Creates a new MethodCompilerVO object. - */ - constructor(profile: any); - /** - * Factory method to create a concrete compiler object for this object - * - * @param materialPassVO - * @returns {away.materials.ShaderCompilerBase} - */ - public createCompiler(material: StageGLMaterialBase, materialPass: IMaterialPassStageGL): ShaderCompilerBase; - /** - * Clears dependency counts for all registers. Called when recompiling a pass. - */ - public reset(): void; - /** - * Adds any external world space dependencies, used to force world space calculations. - */ - public addWorldSpaceDependencies(fragmentLights: boolean): void; - public pInitRegisterIndices(): void; - /** - * Initializes the unchanging constant data for this shader object. - */ - public initConstantData(registerCache: ShaderRegisterCache, animatableAttributes: string[], animationTargetRegisters: string[], uvSource: string, uvTarget: string): void; - /** - * @inheritDoc - */ - public iActivate(stage: base.Stage, camera: entities.Camera): void; - /** - * @inheritDoc - */ - public iDeactivate(stage: base.Stage): void; - /** - * - * - * @param renderable - * @param stage - * @param camera - */ - public setRenderState(renderable: pool.RenderableBase, stage: base.Stage, camera: entities.Camera, viewProjection: geom.Matrix3D): void; - public dispose(): void; - } -} -declare module away.materials { - /** - * ShaderObjectBase keeps track of the number of dependencies for "named registers" used across a pass. - * Named registers are that are not necessarily limited to a single method. They are created by the compiler and - * passed on to methods. The compiler uses the results to reserve usages through RegisterPool, which can be removed - * each time a method has been compiled into the shader. - * - * @see RegisterPool.addUsage - */ - class ShaderLightingObject extends ShaderObjectBase { - /** - * The first index for the fragment constants containing the light data. - */ - public lightFragmentConstantIndex: number; - /** - * The starting index if the vertex constant to which light data needs to be uploaded. - */ - public lightVertexConstantIndex: number; - /** - * Indices for the light probe diffuse textures. - */ - public lightProbeDiffuseIndices: number[]; - /** - * Indices for the light probe specular textures. - */ - public lightProbeSpecularIndices: number[]; - /** - * The index of the fragment constant containing the weights for the light probes. - */ - public probeWeightsIndex: number; - public numLights: number; - public usesLightFallOff: boolean; - public usesShadows: boolean; - public numPointLights: number; - public numDirectionalLights: number; - public numLightProbes: number; - public pointLightsOffset: number; - public directionalLightsOffset: number; - public lightProbesOffset: number; - public lightPicker: LightPickerBase; - /** - * Indicates whether the shader uses any lights. - */ - public usesLights: boolean; - /** - * Indicates whether the shader uses any light probes. - */ - public usesProbes: boolean; - /** - * Indicates whether the lights uses any specular components. - */ - public usesLightsForSpecular: boolean; - /** - * Indicates whether the probes uses any specular components. - */ - public usesProbesForSpecular: boolean; - /** - * Indicates whether the lights uses any diffuse components. - */ - public usesLightsForDiffuse: boolean; - /** - * Indicates whether the probes uses any diffuse components. - */ - public usesProbesForDiffuse: boolean; - /** - * Creates a new MethodCompilerVO object. - */ - constructor(profile: any); - /** - * Factory method to create a concrete compiler object for this object - * - * @param materialPassVO - * @returns {away.materials.ShaderLightingCompiler} - */ - public createCompiler(material: StageGLMaterialBase, materialPass: ILightingPassStageGL): ShaderCompilerBase; - /** - * Clears dependency counts for all registers. Called when recompiling a pass. - */ - public reset(): void; - /** - * Adds any external world space dependencies, used to force world space calculations. - */ - public addWorldSpaceDependencies(fragmentLights: boolean): void; - /** - * - * - * @param renderable - * @param stage - * @param camera - */ - public setRenderState(renderable: pool.RenderableBase, stage: base.Stage, camera: entities.Camera, viewProjection: geom.Matrix3D): void; - /** - * Updates constant data render state used by the lights. This method is optional for subclasses to implement. - */ - private updateLights(); - /** - * Updates constant data render state used by the light probes. This method is optional for subclasses to implement. - */ - private updateProbes(stage); - } -} -declare module away.materials { - /** - * MethodVO contains data for a given shader object for the use within a single material. - * This allows shader methods to be shared across materials while their non-public state differs. - */ - class MethodVO { - public useMethod: boolean; - public method: ShadingMethodBase; - public texturesIndex: number; - public secondaryTexturesIndex: number; - public vertexConstantsIndex: number; - public secondaryVertexConstantsIndex: number; - public fragmentConstantsIndex: number; - public secondaryFragmentConstantsIndex: number; - public needsProjection: boolean; - public needsView: boolean; - public needsNormals: boolean; - public needsTangents: boolean; - public needsUV: boolean; - public needsSecondaryUV: boolean; - public needsGlobalVertexPos: boolean; - public needsGlobalFragmentPos: boolean; - public usesTexture: boolean; - /** - * Creates a new MethodVO object. - */ - constructor(method: ShadingMethodBase); - /** - * Resets the values of the value object to their "unused" state. - */ - public reset(): void; - } -} -declare module away.materials { - /** - * RegisterPool is used by the shader compilation process to keep track of which registers of a certain type are - * currently used and should not be allowed to be written to. Either entire registers can be requested and locked, - * or single components (x, y, z, w) of a single register. - * It is used by ShaderRegisterCache to track usages of individual register types. - * - * @see away.materials.ShaderRegisterCache - */ - class RegisterPool { - private static _regPool; - private static _regCompsPool; - private _vectorRegisters; - private _registerComponents; - private _regName; - private _usedSingleCount; - private _usedVectorCount; - private _regCount; - private _persistent; - /** - * Creates a new RegisterPool object. - * @param regName The base name of the register type ("ft" for fragment temporaries, "vc" for vertex constants, etc) - * @param regCount The amount of available registers of this type. - * @param persistent Whether or not registers, once reserved, can be freed again. For example, temporaries are not persistent, but constants are. - */ - constructor(regName: string, regCount: number, persistent?: boolean); - /** - * Retrieve an entire vector register that's still available. - */ - public requestFreeVectorReg(): ShaderRegisterElement; - /** - * Retrieve a single vector component that's still available. - */ - public requestFreeRegComponent(): ShaderRegisterElement; - /** - * Marks a register as used, so it cannot be retrieved. The register won't be able to be used until removeUsage - * has been called usageCount times again. - * @param register The register to mark as used. - * @param usageCount The amount of usages to add. - */ - public addUsage(register: ShaderRegisterElement, usageCount: number): void; - /** - * Removes a usage from a register. When usages reach 0, the register is freed again. - * @param register The register for which to remove a usage. - */ - public removeUsage(register: ShaderRegisterElement): void; - /** - * Disposes any resources used by the current RegisterPool object. - */ - public dispose(): void; - /** - * Indicates whether or not any registers are in use. - */ - public hasRegisteredRegs(): boolean; - /** - * Initializes all registers. - */ - private initRegisters(regName, regCount); - private static _initPool(regName, regCount); - /** - * Check if the temp register is either used for single or vector use - */ - private isRegisterUsed(index); - private _initArray(a, val); - } -} -declare module away.materials { - /** - * ShaderRegister Cache provides the usage management system for all registers during shading compilation. - */ - class ShaderRegisterCache { - private _fragmentTempCache; - private _vertexTempCache; - private _varyingCache; - private _fragmentConstantsCache; - private _vertexConstantsCache; - private _textureCache; - private _vertexAttributesCache; - private _vertexConstantOffset; - private _vertexAttributesOffset; - private _varyingsOffset; - private _fragmentConstantOffset; - private _fragmentOutputRegister; - private _vertexOutputRegister; - private _numUsedVertexConstants; - private _numUsedFragmentConstants; - private _numUsedStreams; - private _numUsedTextures; - private _numUsedVaryings; - private _profile; - /** - * Create a new ShaderRegisterCache object. - * - * @param profile The compatibility profile used by the renderer. - */ - constructor(profile: string); - /** - * Resets all registers. - */ - public reset(): void; - /** - * Disposes all resources used. - */ - public dispose(): void; - /** - * Marks a fragment temporary register as used, so it cannot be retrieved. The register won't be able to be used until removeUsage - * has been called usageCount times again. - * @param register The register to mark as used. - * @param usageCount The amount of usages to add. - */ - public addFragmentTempUsages(register: ShaderRegisterElement, usageCount: number): void; - /** - * Removes a usage from a fragment temporary register. When usages reach 0, the register is freed again. - * @param register The register for which to remove a usage. - */ - public removeFragmentTempUsage(register: ShaderRegisterElement): void; - /** - * Marks a vertex temporary register as used, so it cannot be retrieved. The register won't be able to be used - * until removeUsage has been called usageCount times again. - * @param register The register to mark as used. - * @param usageCount The amount of usages to add. - */ - public addVertexTempUsages(register: ShaderRegisterElement, usageCount: number): void; - /** - * Removes a usage from a vertex temporary register. When usages reach 0, the register is freed again. - * @param register The register for which to remove a usage. - */ - public removeVertexTempUsage(register: ShaderRegisterElement): void; - /** - * Retrieve an entire fragment temporary register that's still available. The register won't be able to be used until removeUsage - * has been called usageCount times again. - */ - public getFreeFragmentVectorTemp(): ShaderRegisterElement; - /** - * Retrieve a single component from a fragment temporary register that's still available. - */ - public getFreeFragmentSingleTemp(): ShaderRegisterElement; - /** - * Retrieve an available varying register - */ - public getFreeVarying(): ShaderRegisterElement; - /** - * Retrieve an available fragment constant register - */ - public getFreeFragmentConstant(): ShaderRegisterElement; - /** - * Retrieve an available vertex constant register - */ - public getFreeVertexConstant(): ShaderRegisterElement; - /** - * Retrieve an entire vertex temporary register that's still available. - */ - public getFreeVertexVectorTemp(): ShaderRegisterElement; - /** - * Retrieve a single component from a vertex temporary register that's still available. - */ - public getFreeVertexSingleTemp(): ShaderRegisterElement; - /** - * Retrieve an available vertex attribute register - */ - public getFreeVertexAttribute(): ShaderRegisterElement; - /** - * Retrieve an available texture register - */ - public getFreeTextureReg(): ShaderRegisterElement; - /** - * Indicates the start index from which to retrieve vertex constants. - */ - public vertexConstantOffset : number; - /** - * Indicates the start index from which to retrieve vertex attributes. - */ - public vertexAttributesOffset : number; - /** - * Indicates the start index from which to retrieve varying registers. - */ - public varyingsOffset : number; - /** - * Indicates the start index from which to retrieve fragment constants. - */ - public fragmentConstantOffset : number; - /** - * The fragment output register. - */ - public fragmentOutputRegister : ShaderRegisterElement; - /** - * The amount of used vertex constant registers. - */ - public numUsedVertexConstants : number; - /** - * The amount of used fragment constant registers. - */ - public numUsedFragmentConstants : number; - /** - * The amount of used vertex streams. - */ - public numUsedStreams : number; - /** - * The amount of used texture slots. - */ - public numUsedTextures : number; - /** - * The amount of used varying registers. - */ - public numUsedVaryings : number; - } -} -declare module away.materials { - /** - * A single register element (an entire register or a single register's component) used by the RegisterPool. - */ - class ShaderRegisterElement { - private _regName; - private _index; - private _toStr; - private static COMPONENTS; - public _component: number; - /** - * Creates a new ShaderRegisterElement object. - * - * @param regName The name of the register. - * @param index The index of the register. - * @param component The register's component, if not the entire register is represented. - */ - constructor(regName: string, index: number, component?: number); - /** - * Converts the register or the components AGAL string representation. - */ - public toString(): string; - /** - * The register's name. - */ - public regName : string; - /** - * The register's index. - */ - public index : number; - } -} -declare module away.materials { - /** - * ShaderCompilerBase is an abstract base class for shader compilers that use modular shader methods to assemble a - * material. Concrete subclasses are used by the default materials. - * - * @see away.materials.ShadingMethodBase - */ - class ShaderCompilerBase { - public _pShaderObject: ShaderObjectBase; - public _pSharedRegisters: ShaderRegisterData; - public _pRegisterCache: ShaderRegisterCache; - public _pMaterialPass: IMaterialPassStageGL; - public _pMaterial: StageGLMaterialBase; - public _pVertexCode: string; - public _pFragmentCode: string; - public _pPostAnimationFragmentCode: string; - public _pAnimatableAttributes: string[]; - public _pAnimationTargetRegisters: string[]; - private _uvTarget; - private _uvSource; - public _pProfile: string; - /** - * Creates a new ShaderCompilerBase object. - * @param profile The compatibility profile of the renderer. - */ - constructor(material: StageGLMaterialBase, materialPass: IMaterialPassStageGL, shaderObject: ShaderObjectBase); - /** - * Compiles the code after all setup on the compiler has finished. - */ - public compile(): void; - /** - * Compile the code for the methods. - */ - public pCompileDependencies(): void; - private compileGlobalPositionCode(); - /** - * Calculate the (possibly animated) UV coordinates. - */ - private compileUVCode(); - /** - * Provide the secondary UV coordinates. - */ - private compileSecondaryUVCode(); - /** - * Calculate the view direction. - */ - public compileViewDirCode(): void; - /** - * Calculate the normal. - */ - public compileNormalCode(): void; - /** - * Reset all the indices to "unused". - */ - public pInitRegisterIndices(): void; - /** - * Figure out which named registers are required, and how often. - */ - public pCalculateDependencies(): void; - /** - * Disposes all resources used by the compiler. - */ - public dispose(): void; - /** - * The generated vertex code. - */ - public vertexCode : string; - /** - * The generated fragment code. - */ - public fragmentCode : string; - /** - * The generated fragment code. - */ - public postAnimationFragmentCode : string; - /** - * The register name containing the final shaded colour. - */ - public shadedTarget : string; - } -} -declare module away.materials { - /** - * ShaderCompilerBase is an abstract base class for shader compilers that use modular shader methods to assemble a - * material. Concrete subclasses are used by the default materials. - * - * @see away.materials.ShadingMethodBase - */ - class ShaderLightingCompiler extends ShaderCompilerBase { - private _materialLightingPass; - private _shaderLightingObject; - public _pointLightFragmentConstants: ShaderRegisterElement[]; - public _pointLightVertexConstants: ShaderRegisterElement[]; - public _dirLightFragmentConstants: ShaderRegisterElement[]; - public _dirLightVertexConstants: ShaderRegisterElement[]; - public _pNumProbeRegisters: number; - /** - * Creates a new ShaderCompilerBase object. - * @param profile The compatibility profile of the renderer. - */ - constructor(material: StageGLMaterialBase, materialPass: ILightingPassStageGL, shaderObject: ShaderLightingObject); - /** - * Compile the code for the methods. - */ - public pCompileDependencies(): void; - /** - * Provides the code to provide shadow mapping. - */ - public pCompileShadowCode(): void; - /** - * Initializes constant registers to contain light data. - */ - private initLightRegisters(); - /** - * Compiles the shading code for directional and point lights. - */ - private compileLightCode(); - /** - * Compiles shading code for light probes. - */ - private compileLightProbeCode(); - /** - * Reset all the indices to "unused". - */ - public pInitRegisterIndices(): void; - /** - * Figure out which named registers are required, and how often. - */ - public pCalculateDependencies(): void; - } -} -declare module away.materials { - /** - * ShaderRegisterData contains the "named" registers, generated by the compiler and to be passed on to the methods. - */ - class ShaderRegisterData { - public normalVarying: ShaderRegisterElement; - public tangentVarying: ShaderRegisterElement; - public bitangentVarying: ShaderRegisterElement; - public uvVarying: ShaderRegisterElement; - public secondaryUVVarying: ShaderRegisterElement; - public viewDirVarying: ShaderRegisterElement; - public shadowTarget: ShaderRegisterElement; - public shadedTarget: ShaderRegisterElement; - public globalPositionVertex: ShaderRegisterElement; - public globalPositionVarying: ShaderRegisterElement; - public localPosition: ShaderRegisterElement; - public normalInput: ShaderRegisterElement; - public tangentInput: ShaderRegisterElement; - public animatedNormal: ShaderRegisterElement; - public animatedTangent: ShaderRegisterElement; - public commons: ShaderRegisterElement; - public projectionFragment: ShaderRegisterElement; - public normalFragment: ShaderRegisterElement; - public viewDirFragment: ShaderRegisterElement; - public bitangent: ShaderRegisterElement; - constructor(); - } -} -declare module away.materials { - /** - * ShadingMethodBase provides an abstract base method for shading methods, used by compiled passes to compile - * the final shading program. - */ - class ShadingMethodBase extends library.NamedAssetBase { - public _passes: MaterialPassBase[]; - /** - * Create a new ShadingMethodBase object. - */ - constructor(); - public iIsUsed(shaderObject: ShaderObjectBase): boolean; - /** - * Initializes the properties for a MethodVO, including register and texture indices. - * - * @param methodVO The MethodVO object linking this method with the pass currently being compiled. - * - * @internal - */ - public iInitVO(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * Initializes unchanging shader constants using the data from a MethodVO. - * - * @param methodVO The MethodVO object linking this method with the pass currently being compiled. - * - * @internal - */ - public iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * Indicates whether or not this method expects normals in tangent space. Override for object-space normals. - */ - public iUsesTangentSpace(): boolean; - /** - * Any passes required that render to a texture used by this method. - */ - public passes : MaterialPassBase[]; - /** - * Cleans up any resources used by the current object. - */ - public dispose(): void; - /** - * Resets the compilation state of the method. - * - * @internal - */ - public iReset(): void; - /** - * Resets the method's state for compilation. - * - * @internal - */ - public iCleanCompilationData(): void; - /** - * Get the vertex shader code for this method. - * @param vo The MethodVO object linking this method with the pass currently being compiled. - * @param regCache The register cache used during the compilation. - * - * @internal - */ - public iGetVertexCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * Sets the render state for this method. - * - * @param methodVO The MethodVO object linking this method with the pass currently being compiled. - * @param stage The Stage object currently used for rendering. - * - * @internal - */ - public iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - /** - * Sets the render state for a single renderable. - * - * @param vo The MethodVO object linking this method with the pass currently being compiled. - * @param renderable The renderable currently being rendered. - * @param stage The Stage object currently used for rendering. - * @param camera The camera from which the scene is currently rendered. - * - * @internal - */ - public iSetRenderState(shaderObject: ShaderObjectBase, methodVO: MethodVO, renderable: pool.RenderableBase, stage: base.Stage, camera: entities.Camera): void; - /** - * Clears the render state for this method. - * @param vo The MethodVO object linking this method with the pass currently being compiled. - * @param stage The Stage object currently used for rendering. - * - * @internal - */ - public iDeactivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - /** - * Marks the shader program as invalid, so it will be recompiled before the next render. - * - * @internal - */ - public iInvalidateShaderProgram(): void; - /** - * Copies the state from a ShadingMethodBase object into the current object. - */ - public copyFrom(method: ShadingMethodBase): void; - } -} -declare module away.materials { - /** - * LightingMethodBase provides an abstract base method for shading methods that uses lights. - * Used for diffuse and specular shaders only. - */ - class LightingMethodBase extends ShadingMethodBase { - /** - * A method that is exposed to wrappers in case the strength needs to be controlled - */ - public _iModulateMethod: (shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData) => string; - /** - * Creates a new LightingMethodBase. - */ - constructor(); - /** - * Get the fragment shader code that will be needed before any per-light code is added. - * @param methodVO The MethodVO object containing the method data for the currently compiled material pass. - * @param regCache The register cache used during the compilation. - * @private - */ - public iGetFragmentPreLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * Get the fragment shader code that will generate the code relevant to a single light. - * - * @param methodVO The MethodVO object containing the method data for the currently compiled material pass. - * @param lightDirReg The register containing the light direction vector. - * @param lightColReg The register containing the light colour. - * @param regCache The register cache used during the compilation. - */ - public iGetFragmentCodePerLight(shaderObject: ShaderLightingObject, methodVO: MethodVO, lightDirReg: ShaderRegisterElement, lightColReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * Get the fragment shader code that will generate the code relevant to a single light probe object. - * - * @param methodVO The MethodVO object containing the method data for the currently compiled material pass. - * @param cubeMapReg The register containing the cube map for the current probe - * @param weightRegister A string representation of the register + component containing the current weight - * @param regCache The register cache providing any necessary registers to the shader - */ - public iGetFragmentCodePerProbe(shaderObject: ShaderLightingObject, methodVO: MethodVO, cubeMapReg: ShaderRegisterElement, weightRegister: string, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * Get the fragment shader code that should be added after all per-light code. Usually composits everything to the target register. - * - * @param methodVO The MethodVO object containing the method data for the currently compiled material pass. - * @param regCache The register cache used during the compilation. - * @param targetReg The register containing the final shading output. - * @private - */ - public iGetFragmentPostLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - } -} -declare module away.materials { - /** - * AmbientBasicMethod provides the default shading method for uniform ambient lighting. - */ - class AmbientBasicMethod extends ShadingMethodBase { - private _color; - private _alpha; - private _colorR; - private _colorG; - private _colorB; - private _ambient; - /** - * Creates a new AmbientBasicMethod object. - */ - constructor(); - /** - * @inheritDoc - */ - public iInitVO(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * @inheritDoc - */ - public iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * The strength of the ambient reflection of the surface. - */ - public ambient : number; - /** - * The alpha component of the surface. - */ - public alpha : number; - /** - * @inheritDoc - */ - public copyFrom(method: ShadingMethodBase): void; - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - /** - * Updates the ambient color data used by the render state. - */ - private updateColor(); - } -} -declare module away.materials { - /** - * DiffuseBasicMethod provides the default shading method for Lambert (dot3) diffuse lighting. - */ - class DiffuseBasicMethod extends LightingMethodBase { - private _multiply; - public _pUseTexture: boolean; - public _pTotalLightColorReg: ShaderRegisterElement; - public _pDiffuseInputRegister: ShaderRegisterElement; - private _texture; - private _diffuseColor; - private _ambientColor; - private _diffuseR; - private _diffuseG; - private _diffuseB; - private _ambientR; - private _ambientG; - private _ambientB; - public _pIsFirstLight: boolean; - /** - * Creates a new DiffuseBasicMethod object. - */ - constructor(); - public iIsUsed(shaderObject: ShaderLightingObject): boolean; - /** - * Set internally if diffuse color component multiplies or replaces the ambient color - */ - public multiply : boolean; - public iInitVO(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; - /** - * Forces the creation of the texture. - * @param stage The Stage used by the renderer - */ - public generateMip(stage: base.Stage): void; - /** - * The color of the diffuse reflection when not using a texture. - */ - public diffuseColor : number; - /** - * The color of the ambient reflection - */ - public ambientColor : number; - /** - * The bitmapData to use to define the diffuse reflection color per texel. - */ - public texture : textures.Texture2DBase; - /** - * @inheritDoc - */ - public dispose(): void; - /** - * @inheritDoc - */ - public copyFrom(method: ShadingMethodBase): void; - /** - * @inheritDoc - */ - public iCleanCompilationData(): void; - /** - * @inheritDoc - */ - public iGetFragmentPreLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iGetFragmentCodePerLight(shaderObject: ShaderLightingObject, methodVO: MethodVO, lightDirReg: ShaderRegisterElement, lightColReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iGetFragmentCodePerProbe(shaderObject: ShaderLightingObject, methodVO: MethodVO, cubeMapReg: ShaderRegisterElement, weightRegister: string, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iGetFragmentPostLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * Generate the code that applies the calculated shadow to the diffuse light - * @param methodVO The MethodVO object for which the compilation is currently happening. - * @param regCache The register cache the compiler is currently using for the register management. - */ - public pApplyShadow(shaderObject: ShaderLightingObject, methodVO: MethodVO, regCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: base.Stage): void; - /** - * Updates the diffuse color data used by the render state. - */ - private updateDiffuse(); - /** - * Updates the ambient color data used by the render state. - */ - private updateAmbient(); - /** - * @inheritDoc - */ - public iSetRenderState(shaderObject: ShaderLightingObject, methodVO: MethodVO, renderable: pool.RenderableBase, stage: base.Stage, camera: entities.Camera): void; - } -} -declare module away.materials { - /** - * EffectMethodBase forms an abstract base class for shader methods that are not dependent on light sources, - * and are in essence post-process effects on the materials. - */ - class EffectMethodBase extends ShadingMethodBase implements library.IAsset { - constructor(); - /** - * @inheritDoc - */ - public assetType : string; - /** - * Get the fragment shader code that should be added after all per-light code. Usually composits everything to the target register. - * @param methodVO The MethodVO object containing the method data for the currently compiled material pass. - * @param regCache The register cache used during the compilation. - * @param targetReg The register that will be containing the method's output. - * @private - */ - public iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - } -} -declare module away.materials { - /** - * EffectColorTransformMethod provides a shading method that changes the colour of a material analogous to a - * ColorTransform object. - */ - class EffectColorTransformMethod extends EffectMethodBase { - private _colorTransform; - /** - * Creates a new EffectColorTransformMethod. - */ - constructor(); - /** - * The ColorTransform object to transform the colour of the material with. - */ - public colorTransform : geom.ColorTransform; - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - } -} -declare module away.materials { - /** - * NormalBasicMethod is the default method for standard tangent-space normal mapping. - */ - class NormalBasicMethod extends ShadingMethodBase { - private _texture; - private _useTexture; - public _pNormalTextureRegister: ShaderRegisterElement; - /** - * Creates a new NormalBasicMethod object. - */ - constructor(); - public iIsUsed(shaderObject: ShaderObjectBase): boolean; - /** - * @inheritDoc - */ - public iInitVO(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * Indicates whether or not this method outputs normals in tangent space. Override for object-space normals. - */ - public iOutputsTangentNormals(): boolean; - /** - * @inheritDoc - */ - public copyFrom(method: ShadingMethodBase): void; - /** - * The texture containing the normals per pixel. - */ - public normalMap : textures.Texture2DBase; - /** - * @inheritDoc - */ - public iCleanCompilationData(): void; - /** - * @inheritDoc - */ - public dispose(): void; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - } -} -declare module away.materials { - /** - * ShadowMapMethodBase provides an abstract base method for shadow map methods. - */ - class ShadowMapMethodBase extends ShadingMethodBase implements library.IAsset { - public _pCastingLight: base.LightBase; - public _pShadowMapper: ShadowMapperBase; - public _pEpsilon: number; - public _pAlpha: number; - /** - * Creates a new ShadowMapMethodBase object. - * @param castingLight The light used to cast shadows. - */ - constructor(castingLight: base.LightBase); - /** - * @inheritDoc - */ - public assetType : string; - /** - * The "transparency" of the shadows. This allows making shadows less strong. - */ - public alpha : number; - /** - * The light casting the shadows. - */ - public castingLight : base.LightBase; - /** - * A small value to counter floating point precision errors when comparing values in the shadow map with the - * calculated depth value. Increase this if shadow banding occurs, decrease it if the shadow seems to be too detached. - */ - public epsilon : number; - } -} -declare module away.materials { - /** - * ShadowMethodBase provides an abstract method for simple (non-wrapping) shadow map methods. - */ - class ShadowMethodBase extends ShadowMapMethodBase { - public _pDepthMapCoordReg: ShaderRegisterElement; - public _pUsePoint: boolean; - /** - * Creates a new ShadowMethodBase object. - * @param castingLight The light used to cast shadows. - */ - constructor(castingLight: base.LightBase); - /** - * @inheritDoc - */ - public iInitVO(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; - /** - * @inheritDoc - */ - public iInitConstants(shaderObject: ShaderObjectBase, methodVO: MethodVO): void; - /** - * Wrappers that override the vertex shader need to set this explicitly - */ - public _iDepthMapCoordReg : ShaderRegisterElement; - /** - * @inheritDoc - */ - public iCleanCompilationData(): void; - /** - * @inheritDoc - */ - public iGetVertexCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, regCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * Gets the vertex code for shadow mapping with a point light. - * - * @param methodVO The MethodVO object linking this method with the pass currently being compiled. - * @param regCache The register cache used during the compilation. - */ - public _pGetPointVertexCode(methodVO: MethodVO, regCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * Gets the vertex code for shadow mapping with a planar shadow map (fe: directional lights). - * - * @param methodVO The MethodVO object linking this method with the pass currently being compiled. - * @param regCache The register cache used during the compilation. - */ - public pGetPlanarVertexCode(methodVO: MethodVO, regCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * Gets the fragment code for shadow mapping with a planar shadow map. - * @param methodVO The MethodVO object linking this method with the pass currently being compiled. - * @param regCache The register cache used during the compilation. - * @param targetReg The register to contain the shadow coverage - * @return - */ - public _pGetPlanarFragmentCode(methodVO: MethodVO, targetReg: ShaderRegisterElement, regCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * Gets the fragment code for shadow mapping with a point light. - * @param methodVO The MethodVO object linking this method with the pass currently being compiled. - * @param regCache The register cache used during the compilation. - * @param targetReg The register to contain the shadow coverage - * @return - */ - public _pGetPointFragmentCode(methodVO: MethodVO, targetReg: ShaderRegisterElement, regCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iSetRenderState(shaderObject: ShaderObjectBase, methodVO: MethodVO, renderable: pool.RenderableBase, stage: base.Stage, camera: entities.Camera): void; - /** - * Gets the fragment code for combining this method with a cascaded shadow map method. - * @param methodVO The MethodVO object linking this method with the pass currently being compiled. - * @param regCache The register cache used during the compilation. - * @param decodeRegister The register containing the data to decode the shadow map depth value. - * @param depthTexture The texture containing the shadow map. - * @param depthProjection The projection of the fragment relative to the light. - * @param targetRegister The register to contain the shadow coverage - * @return - */ - public _iGetCascadeFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, decodeRegister: ShaderRegisterElement, depthTexture: ShaderRegisterElement, depthProjection: ShaderRegisterElement, targetRegister: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - /** - * Sets the method state for cascade shadow mapping. - */ - public iActivateForCascade(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - } -} -declare module away.materials { - /** - * ShadowHardMethod provides the cheapest shadow map method by using a single tap without any filtering. - */ - class ShadowHardMethod extends ShadowMethodBase { - /** - * Creates a new ShadowHardMethod object. - */ - constructor(castingLight: base.LightBase); - /** - * @inheritDoc - */ - public _pGetPlanarFragmentCode(methodVO: MethodVO, targetReg: ShaderRegisterElement, regCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public _pGetPointFragmentCode(methodVO: MethodVO, targetReg: ShaderRegisterElement, regCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public _iGetCascadeFragmentCode(shaderObject: ShaderObjectBase, methodVO: MethodVO, decodeRegister: ShaderRegisterElement, depthTexture: ShaderRegisterElement, depthProjection: ShaderRegisterElement, targetRegister: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iActivateForCascade(shaderObject: ShaderObjectBase, methodVO: MethodVO, stage: base.Stage): void; - } -} -declare module away.materials { - /** - * SpecularBasicMethod provides the default shading method for Blinn-Phong specular highlights (an optimized but approximated - * version of Phong specularity). - */ - class SpecularBasicMethod extends LightingMethodBase { - public _pUseTexture: boolean; - public _pTotalLightColorReg: ShaderRegisterElement; - public _pSpecularTextureRegister: ShaderRegisterElement; - public _pSpecularTexData: ShaderRegisterElement; - public _pSpecularDataRegister: ShaderRegisterElement; - private _texture; - private _gloss; - private _specular; - private _specularColor; - public _iSpecularR: number; - public _iSpecularG: number; - public _iSpecularB: number; - public _pIsFirstLight: boolean; - /** - * Creates a new SpecularBasicMethod object. - */ - constructor(); - public iIsUsed(shaderObject: ShaderLightingObject): boolean; - /** - * @inheritDoc - */ - public iInitVO(shaderObject: ShaderLightingObject, methodVO: MethodVO): void; - /** - * The sharpness of the specular highlight. - */ - public gloss : number; - /** - * The overall strength of the specular highlights. - */ - public specular : number; - /** - * The colour of the specular reflection of the surface. - */ - public specularColor : number; - /** - * The bitmapData that encodes the specular highlight strength per texel in the red channel, and the sharpness - * in the green channel. You can use SpecularBitmapTexture if you want to easily set specular and gloss maps - * from grayscale images, but prepared images are preferred. - */ - public texture : textures.Texture2DBase; - /** - * @inheritDoc - */ - public copyFrom(method: ShadingMethodBase): void; - /** - * @inheritDoc - */ - public iCleanCompilationData(): void; - /** - * @inheritDoc - */ - public iGetFragmentPreLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iGetFragmentCodePerLight(shaderObject: ShaderLightingObject, methodVO: MethodVO, lightDirReg: ShaderRegisterElement, lightColReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iGetFragmentCodePerProbe(shaderObject: ShaderLightingObject, methodVO: MethodVO, cubeMapReg: ShaderRegisterElement, weightRegister: string, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iGetFragmentPostLightingCode(shaderObject: ShaderLightingObject, methodVO: MethodVO, targetReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public iActivate(shaderObject: ShaderLightingObject, methodVO: MethodVO, stage: base.Stage): void; - /** - * Updates the specular color data used by the render state. - */ - private updateSpecular(); - } -} -declare module away.materials { - /** - * MaterialPassBase provides an abstract base class for material shader passes. A material pass constitutes at least - * a render call per required renderable. - */ - class MaterialPassBase extends library.NamedAssetBase implements IMaterialPass, IMaterialPassStageGL { - private _materialPassData; - private _maxLights; - private _preserveAlpha; - private _includeCasters; - private _forceSeparateMVP; - private _directionalLightsOffset; - private _pointLightsOffset; - private _lightProbesOffset; - public _pNumPointLights: number; - public _pNumDirectionalLights: number; - public _pNumLightProbes: number; - public _pNumLights: number; - private _passMode; - private _depthCompareMode; - private _blendFactorSource; - private _blendFactorDest; - public _pEnableBlending: boolean; - public _pLightPicker: LightPickerBase; - private _writeDepth; - private _onLightsChangeDelegate; - /** - * Indicates whether the output alpha value should remain unchanged compared to the material's original alpha. - */ - public preserveAlpha : boolean; - /** - * Indicates whether or not shadow casting lights need to be included. - */ - public includeCasters : boolean; - /** - * Indicates whether the screen projection should be calculated by forcing a separate scene matrix and - * view-projection matrix. This is used to prevent rounding errors when using multiple passes with different - * projection code. - */ - public forceSeparateMVP : boolean; - /** - * Indicates the offset in the light picker's directional light vector for which to start including lights. - * This needs to be set before the light picker is assigned. - */ - public directionalLightsOffset : number; - /** - * Indicates the offset in the light picker's point light vector for which to start including lights. - * This needs to be set before the light picker is assigned. - */ - public pointLightsOffset : number; - /** - * Indicates the offset in the light picker's light probes vector for which to start including lights. - * This needs to be set before the light picker is assigned. - */ - public lightProbesOffset : number; - /** - * - */ - public passMode : number; - /** - * Creates a new MaterialPassBase object. - */ - constructor(passMode?: number); - /** - * Factory method to create a concrete shader object for this pass. - * - * @param profile The compatibility profile used by the renderer. - */ - public createShaderObject(profile: string): ShaderObjectBase; - /** - * Indicate whether this pass should write to the depth buffer or not. Ignored when blending is enabled. - */ - public writeDepth : boolean; - /** - * The depth compare mode used to render the renderables using this material. - * - * @see away.stagegl.ContextGLCompareMode - */ - public depthCompareMode : string; - /** - * Cleans up any resources used by the current object. - * @param deep Indicates whether other resources should be cleaned up, that could potentially be shared across different instances. - */ - public dispose(): void; - /** - * Renders an object to the current render target. - * - * @private - */ - public _iRender(pass: pool.MaterialPassData, renderable: pool.RenderableBase, stage: base.Stage, camera: entities.Camera, viewProjection: geom.Matrix3D): void; - /** - * - * - * @param renderable - * @param stage - * @param camera - */ - public setRenderState(pass: pool.MaterialPassData, renderable: pool.RenderableBase, stage: base.Stage, camera: entities.Camera, viewProjection: geom.Matrix3D): void; - /** - * The blend mode to use when drawing this renderable. The following blend modes are supported: - *
    - *
  • BlendMode.NORMAL: No blending, unless the material inherently needs it
  • - *
  • BlendMode.LAYER: Force blending. This will draw the object the same as NORMAL, but without writing depth writes.
  • - *
  • BlendMode.MULTIPLY
  • - *
  • BlendMode.ADD
  • - *
  • BlendMode.ALPHA
  • - *
- */ - public setBlendMode(value: string): void; - /** - * Sets the render state for the pass that is independent of the rendered object. This needs to be called before - * calling renderPass. Before activating a pass, the previously used pass needs to be deactivated. - * @param stage The Stage object which is currently used for rendering. - * @param camera The camera from which the scene is viewed. - * @private - */ - public _iActivate(pass: pool.MaterialPassData, stage: base.Stage, camera: entities.Camera): void; - /** - * Clears the render state for the pass. This needs to be called before activating another pass. - * @param stage The Stage used for rendering - * - * @private - */ - public _iDeactivate(pass: pool.MaterialPassData, stage: base.Stage): void; - /** - * Marks the shader program as invalid, so it will be recompiled before the next render. - * - * @param updateMaterial Indicates whether the invalidation should be performed on the entire material. Should always pass "true" unless it's called from the material itself. - */ - public _pInvalidatePass(): void; - /** - * The light picker used by the material to provide lights to the material if it supports lighting. - * - * @see away.materials.LightPickerBase - * @see away.materials.StaticLightPicker - */ - public lightPicker : LightPickerBase; - /** - * Called when the light picker's configuration changes. - */ - private onLightsChange(event); - /** - * Implemented by subclasses if the pass uses lights to update the shader. - */ - public pUpdateLights(): void; - public _iIncludeDependencies(shaderObject: ShaderObjectBase): void; - public _iInitConstantData(shaderObject: ShaderObjectBase): void; - public _iGetPreLightingVertexCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - public _iGetPreLightingFragmentCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - public _iGetVertexCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - public _iGetFragmentCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - public _iGetNormalVertexCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - public _iGetNormalFragmentCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * The amount of point lights that need to be supported. - */ - public iNumPointLights : number; - /** - * The amount of directional lights that need to be supported. - */ - public iNumDirectionalLights : number; - /** - * The amount of light probes that need to be supported. - */ - public iNumLightProbes : number; - /** - * Indicates whether or not normals are calculated at all. - */ - public _pOutputsNormals(shaderObject: ShaderObjectBase): boolean; - /** - * Indicates whether or not normals are calculated in tangent space. - */ - public _pOutputsTangentNormals(shaderObject: ShaderObjectBase): boolean; - /** - * Indicates whether or not normals are allowed in tangent space. This is only the case if no object-space - * dependencies exist. - */ - public _pUsesTangentSpace(shaderObject: ShaderObjectBase): boolean; - /** - * Calculates the amount of directional lights this material will support. - * @param numDirectionalLights The maximum amount of directional lights to support. - * @return The amount of directional lights this material will support, bounded by the amount necessary. - */ - private calculateNumDirectionalLights(numDirectionalLights); - /** - * Calculates the amount of point lights this material will support. - * @param numDirectionalLights The maximum amount of point lights to support. - * @return The amount of point lights this material will support, bounded by the amount necessary. - */ - private calculateNumPointLights(numPointLights); - /** - * Calculates the amount of light probes this material will support. - * @param numDirectionalLights The maximum amount of light probes to support. - * @return The amount of light probes this material will support, bounded by the amount necessary. - */ - private calculateNumProbes(numLightProbes); - public _iAddMaterialPassData(materialPassData: pool.MaterialPassData): pool.MaterialPassData; - public _iRemoveMaterialPassData(materialPassData: pool.MaterialPassData): pool.MaterialPassData; - } -} -declare module away.materials { - interface IMaterialPassStageGL extends IMaterialPass { - _iGetPreLightingVertexCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - _iGetPreLightingFragmentCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - _iGetVertexCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - _iGetFragmentCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - _iGetNormalVertexCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - _iGetNormalFragmentCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - forceSeparateMVP: boolean; - passMode: number; - _iInitConstantData(shaderObject: ShaderObjectBase): any; - _iIncludeDependencies(shaderObject: ShaderObjectBase): any; - /** - * Factory method to create a concrete shader object for this pass. - * - * @param profile The compatibility profile used by the renderer. - */ - createShaderObject(profile: string): ShaderObjectBase; - } -} -declare module away.materials { - interface ILightingPassStageGL extends IMaterialPassStageGL { - /** - * The amount of point lights that need to be supported. - */ - iNumPointLights: number; - /** - * The amount of directional lights that need to be supported. - */ - iNumDirectionalLights: number; - /** - * The amount of light probes that need to be supported. - */ - iNumLightProbes: number; - /** - * Indicates the offset in the light picker's directional light vector for which to start including lights. - * This needs to be set before the light picker is assigned. - */ - directionalLightsOffset: number; - /** - * Indicates the offset in the light picker's point light vector for which to start including lights. - * This needs to be set before the light picker is assigned. - */ - pointLightsOffset: number; - /** - * Indicates the offset in the light picker's light probes vector for which to start including lights. - * This needs to be set before the light picker is assigned. - */ - lightProbesOffset: number; - /** - * The light picker used by the material to provide lights to the material if it supports lighting. - * - * @see away.materials.LightPickerBase - * @see away.materials.StaticLightPicker - */ - lightPicker: LightPickerBase; - _iUsesSpecular(): any; - _iUsesShadows(): any; - _iGetPerLightDiffuseFragmentCode(shaderObject: ShaderLightingObject, lightDirReg: ShaderRegisterElement, diffuseColorReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - _iGetPerLightSpecularFragmentCode(shaderObject: ShaderLightingObject, lightDirReg: ShaderRegisterElement, specularColorReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - _iGetPerProbeDiffuseFragmentCode(shaderObject: ShaderLightingObject, texReg: ShaderRegisterElement, weightReg: string, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - _iGetPerProbeSpecularFragmentCode(shaderObject: ShaderLightingObject, texReg: ShaderRegisterElement, weightReg: string, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - _iGetPostLightingVertexCode(shaderObject: ShaderLightingObject, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - _iGetPostLightingFragmentCode(shaderObject: ShaderLightingObject, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - } -} -declare module away.materials { - /** - * LineBasicPass is a material pass that draws wireframe segments. - */ - class LineBasicPass extends MaterialPassBase { - /** - * Creates a new SegmentPass object. - * - * @param material The material to which this pass belongs. - */ - constructor(); - /** - * @inheritDoc - */ - public _iGetFragmentCode(shaderObject: ShaderObjectBase, regCache: ShaderRegisterCache, sharedReg: ShaderRegisterData): string; - } -} -declare module away.materials { - /** - * SkyboxPass provides a material pass exclusively used to render sky boxes from a cube texture. - */ - class SkyboxPass extends MaterialPassBase { - /** - * Creates a new SkyboxPass object. - * - * @param material The material to which this pass belongs. - */ - constructor(); - public _iIncludeDependencies(shaderObject: ShaderLightingObject): void; - } -} -declare module away.materials { - /** - * CompiledPass forms an abstract base class for the default compiled pass materials provided by Away3D, - * using material methods to define their appearance. - */ - class TriangleBasicPass extends MaterialPassBase { - private _diffuseColor; - private _diffuseR; - private _diffuseG; - private _diffuseB; - private _diffuseA; - private _fragmentConstantsIndex; - private _texturesIndex; - /** - * The alpha component of the diffuse reflection. - */ - public diffuseAlpha : number; - /** - * The color of the diffuse reflection when not using a texture. - */ - public diffuseColor : number; - /** - * Creates a new CompiledPass object. - * - * @param material The material to which this pass belongs. - */ - constructor(); - /** - * @inheritDoc - */ - public _iGetFragmentCode(shaderObject: ShaderObjectBase, regCache: ShaderRegisterCache, sharedReg: ShaderRegisterData): string; - public _iIncludeDependencies(dependencyCounter: ShaderObjectBase): void; - /** - * @inheritDoc - */ - public _iActivate(pass: pool.MaterialPassData, stage: base.Stage, camera: entities.Camera): void; - } -} -declare module away.materials { - /** - * DepthMapPass is a pass that writes depth values to a depth map as a 32-bit value exploded over the 4 texture channels. - * This is used to render shadow maps, depth maps, etc. - */ - class DepthMapPass extends MaterialPassBase { - private _fragmentConstantsIndex; - private _texturesIndex; - /** - * Creates a new DepthMapPass object. - * - * @param material The material to which this pass belongs. - */ - constructor(); - /** - * Initializes the unchanging constant data for this material. - */ - public _iInitConstantData(shaderObject: ShaderObjectBase): void; - public _iIncludeDependencies(shaderObject: ShaderObjectBase): void; - /** - * @inheritDoc - */ - public _iGetFragmentCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - public _iRender(pass: pool.MaterialPassData, renderable: pool.RenderableBase, stage: base.Stage, camera: entities.Camera, viewProjection: geom.Matrix3D): void; - /** - * @inheritDoc - */ - public _iActivate(pass: pool.MaterialPassData, stage: base.Stage, camera: entities.Camera): void; - } -} -declare module away.materials { - /** - * DistanceMapPass is a pass that writes distance values to a depth map as a 32-bit value exploded over the 4 texture channels. - * This is used to render omnidirectional shadow maps. - */ - class DistanceMapPass extends MaterialPassBase { - private _fragmentConstantsIndex; - private _texturesIndex; - /** - * Creates a new DistanceMapPass object. - * - * @param material The material to which this pass belongs. - */ - constructor(); - /** - * Initializes the unchanging constant data for this material. - */ - public _iInitConstantData(shaderObject: ShaderObjectBase): void; - public _iIncludeDependencies(shaderObject: ShaderObjectBase): void; - /** - * @inheritDoc - */ - public _iGetFragmentCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public _iActivate(pass: pool.MaterialPassData, stage: base.Stage, camera: entities.Camera): void; - } -} -/** -* -*/ -declare module away.materials { - class MaterialPassMode { - static EFFECTS: number; - /** - * - */ - static LIGHTING: number; - /** - * - */ - static SUPER_SHADER: number; - } -} -declare module away.materials { - /** - * CompiledPass forms an abstract base class for the default compiled pass materials provided by Away3D, - * using material methods to define their appearance. - */ - class TriangleMethodPass extends MaterialPassBase implements ILightingPassStageGL { - public _iColorTransformMethodVO: MethodVO; - public _iNormalMethodVO: MethodVO; - public _iAmbientMethodVO: MethodVO; - public _iShadowMethodVO: MethodVO; - public _iDiffuseMethodVO: MethodVO; - public _iSpecularMethodVO: MethodVO; - public _iMethodVOs: MethodVO[]; - public _numEffectDependencies: number; - private _onShaderInvalidatedDelegate; - /** - * Creates a new CompiledPass object. - * - * @param material The material to which this pass belongs. - */ - constructor(passMode?: number); - /** - * Factory method to create a concrete shader object for this pass. - * - * @param profile The compatibility profile used by the renderer. - */ - public createShaderObject(profile: string): ShaderObjectBase; - /** - * Initializes the unchanging constant data for this material. - */ - public _iInitConstantData(shaderObject: ShaderObjectBase): void; - /** - * The ColorTransform object to transform the colour of the material with. Defaults to null. - */ - public colorTransform : geom.ColorTransform; - /** - * The EffectColorTransformMethod object to transform the colour of the material with. Defaults to null. - */ - public colorTransformMethod : EffectColorTransformMethod; - private _removeDependency(methodVO, effectsDependency?); - private _addDependency(methodVO, effectsDependency?, index?); - /** - * Appends an "effect" shading method to the shader. Effect methods are those that do not influence the lighting - * but modulate the shaded colour, used for fog, outlines, etc. The method will be applied to the result of the - * methods added prior. - */ - public addEffectMethod(method: EffectMethodBase): void; - /** - * The number of "effect" methods added to the material. - */ - public numEffectMethods : number; - /** - * Queries whether a given effects method was added to the material. - * - * @param method The method to be queried. - * @return true if the method was added to the material, false otherwise. - */ - public hasEffectMethod(method: EffectMethodBase): boolean; - /** - * Returns the method added at the given index. - * @param index The index of the method to retrieve. - * @return The method at the given index. - */ - public getEffectMethodAt(index: number): EffectMethodBase; - /** - * Adds an effect method at the specified index amongst the methods already added to the material. Effect - * methods are those that do not influence the lighting but modulate the shaded colour, used for fog, outlines, - * etc. The method will be applied to the result of the methods with a lower index. - */ - public addEffectMethodAt(method: EffectMethodBase, index: number): void; - /** - * Removes an effect method from the material. - * @param method The method to be removed. - */ - public removeEffectMethod(method: EffectMethodBase): void; - private getDependencyForMethod(method); - /** - * The method used to generate the per-pixel normals. Defaults to NormalBasicMethod. - */ - public normalMethod : NormalBasicMethod; - /** - * The method that provides the ambient lighting contribution. Defaults to AmbientBasicMethod. - */ - public ambientMethod : AmbientBasicMethod; - /** - * The method used to render shadows cast on this surface, or null if no shadows are to be rendered. Defaults to null. - */ - public shadowMethod : ShadowMapMethodBase; - /** - * The method that provides the diffuse lighting contribution. Defaults to DiffuseBasicMethod. - */ - public diffuseMethod : DiffuseBasicMethod; - /** - * The method that provides the specular lighting contribution. Defaults to SpecularBasicMethod. - */ - public specularMethod : SpecularBasicMethod; - /** - * @inheritDoc - */ - public dispose(): void; - /** - * Called when any method's shader code is invalidated. - */ - private onShaderInvalidated(event); - /** - * @inheritDoc - */ - public _iActivate(pass: pool.MaterialPassData, stage: base.Stage, camera: entities.Camera): void; - /** - * - * - * @param renderable - * @param stage - * @param camera - */ - public setRenderState(pass: pool.MaterialPassData, renderable: pool.RenderableBase, stage: base.Stage, camera: entities.Camera, viewProjection: geom.Matrix3D): void; - /** - * @inheritDoc - */ - public _iDeactivate(pass: pool.MaterialPassData, stage: base.Stage): void; - public _iIncludeDependencies(shaderObject: ShaderLightingObject): void; - /** - * Counts the dependencies for a given method. - * @param method The method to count the dependencies for. - * @param methodVO The method's data for this material. - */ - private setupAndCountDependencies(shaderObject, methodVO); - public _iGetPreLightingVertexCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - public _iGetPreLightingFragmentCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - public _iGetPerLightDiffuseFragmentCode(shaderObject: ShaderLightingObject, lightDirReg: ShaderRegisterElement, diffuseColorReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - public _iGetPerLightSpecularFragmentCode(shaderObject: ShaderLightingObject, lightDirReg: ShaderRegisterElement, specularColorReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - public _iGetPerProbeDiffuseFragmentCode(shaderObject: ShaderLightingObject, texReg: ShaderRegisterElement, weightReg: string, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - public _iGetPerProbeSpecularFragmentCode(shaderObject: ShaderLightingObject, texReg: ShaderRegisterElement, weightReg: string, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - public _iGetPostLightingVertexCode(shaderObject: ShaderLightingObject, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - public _iGetPostLightingFragmentCode(shaderObject: ShaderLightingObject, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * Indicates whether or not normals are allowed in tangent space. This is only the case if no object-space - * dependencies exist. - */ - public _pUsesTangentSpace(shaderObject: ShaderLightingObject): boolean; - /** - * Indicates whether or not normals are output in tangent space. - */ - public _pOutputsTangentNormals(shaderObject: ShaderObjectBase): boolean; - /** - * Indicates whether or not normals are output by the pass. - */ - public _pOutputsNormals(shaderObject: ShaderObjectBase): boolean; - public _iGetNormalVertexCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - public _iGetNormalFragmentCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public _iGetVertexCode(shaderObject: ShaderObjectBase, regCache: ShaderRegisterCache, sharedReg: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public _iGetFragmentCode(shaderObject: ShaderObjectBase, regCache: ShaderRegisterCache, sharedReg: ShaderRegisterData): string; - /** - * Indicates whether the shader uses any shadows. - */ - public _iUsesShadows(): boolean; - /** - * Indicates whether the shader uses any specular component. - */ - public _iUsesSpecular(): boolean; - } -} -declare module away.materials { - class StageGLMaterialBase extends MaterialBase { - public _iGetVertexCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - public _iGetFragmentCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - } -} -declare module away.materials { - /** - * LineMaterial is a material exclusively used to render wireframe objects - * - * @see away.entities.Lines - */ - class LineBasicMaterial extends StageGLMaterialBase { - static pONE_VECTOR: number[]; - static pFRONT_VECTOR: number[]; - private _constants; - private _calcMatrix; - private _thickness; - private _screenPass; - /** - * Creates a new LineMaterial object. - * - * @param thickness The thickness of the wireframe lines. - */ - constructor(thickness?: number); - /** - * @inheritDoc - */ - public _iGetVertexCode(shaderObject: ShaderObjectBase, regCache: ShaderRegisterCache, sharedReg: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public _iActivatePass(pass: pool.MaterialPassData, stage: base.Stage, camera: entities.Camera): void; - /** - * @inheritDoc - */ - public _iRenderPass(pass: pool.MaterialPassData, renderable: pool.RenderableBase, stage: base.Stage, camera: entities.Camera, viewProjection: geom.Matrix3D): void; - } -} -declare module away.materials { - /** - * SkyboxMaterial is a material exclusively used to render skyboxes - * - * @see away3d.primitives.Skybox - */ - class SkyboxMaterial extends StageGLMaterialBase { - private _vertexData; - private _cubeMap; - private _skyboxPass; - /** - * Creates a new SkyboxMaterial object. - * @param cubeMap The CubeMap to use as the skybox. - */ - constructor(cubeMap: textures.CubeTextureBase, smooth?: boolean, repeat?: boolean, mipmap?: boolean); - /** - * The cube texture to use as the skybox. - */ - public cubeMap : textures.CubeTextureBase; - /** - * @inheritDoc - */ - public _iGetVertexCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public _iGetFragmentCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public _iActivatePass(pass: pool.MaterialPassData, stage: base.Stage, camera: entities.Camera): void; - /** - * @inheritDoc - */ - public _iRenderPass(pass: pool.MaterialPassData, renderable: pool.RenderableBase, stage: base.Stage, camera: entities.Camera, viewProjection: geom.Matrix3D): void; - } -} -declare module away.materials { - /** - * CompiledPass forms an abstract base class for the default compiled pass materials provided by Away3D, - * using material methods to define their appearance. - */ - class TriangleMaterialBase extends StageGLMaterialBase { - public _iGetVertexCode(shaderObject: ShaderObjectBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; - /** - * @inheritDoc - */ - public _iRenderPass(pass: pool.MaterialPassData, renderable: pool.RenderableBase, stage: base.Stage, camera: entities.Camera, viewProjection: geom.Matrix3D): void; - } -} -declare module away.materials { - /** - * TriangleMaterial forms an abstract base class for the default shaded materials provided by Stage, - * using material methods to define their appearance. - */ - class TriangleBasicMaterial extends TriangleMaterialBase { - private _screenPass; - private _alphaBlending; - private _alpha; - private _depthCompareMode; - /** - * Creates a new TriangleMaterial object. - * - * @param texture The texture used for the material's albedo color. - * @param smooth Indicates whether the texture should be filtered when sampled. Defaults to true. - * @param repeat Indicates whether the texture should be tiled when sampled. Defaults to false. - * @param mipmap Indicates whether or not any used textures should use mipmapping. Defaults to false. - */ - constructor(texture?: textures.Texture2DBase, smooth?: boolean, repeat?: boolean, mipmap?: boolean); - constructor(color?: number, alpha?: number); - /** - * The depth compare mode used to render the renderables using this material. - * - * @see away.stagegl.ContextGLCompareMode - */ - public depthCompareMode : string; - /** - * The alpha of the surface. - */ - public alpha : number; - /** - * Indicates whether or not the material has transparency. If binary transparency is sufficient, for - * example when using textures of foliage, consider using alphaThreshold instead. - */ - public alphaBlending : boolean; - /** - * @inheritDoc - */ - public iUpdateMaterial(): void; - /** - * Updates screen passes when they were found to be invalid. - */ - public pUpdateScreenPasses(): void; - /** - * Initializes all the passes and their dependent passes. - */ - private initPasses(); - /** - * Sets up the various blending modes for all screen passes, based on whether or not there are previous passes. - */ - private setBlendAndCompareModes(); - } -} -/** -* -*/ -declare module away.materials { - class TriangleMaterialMode { - /** - * - */ - static SINGLE_PASS: string; - /** - * - */ - static MULTI_PASS: string; - } -} -declare module away.materials { - /** - * TriangleMethodMaterial forms an abstract base class for the default shaded materials provided by Stage, - * using material methods to define their appearance. - */ - class TriangleMethodMaterial extends TriangleMaterialBase { - private _alphaBlending; - private _alpha; - private _colorTransform; - private _materialMode; - private _casterLightPass; - private _nonCasterLightPasses; - private _screenPass; - private _ambientMethod; - private _shadowMethod; - private _diffuseMethod; - private _normalMethod; - private _specularMethod; - private _depthCompareMode; - /** - * Creates a new TriangleMethodMaterial object. - * - * @param texture The texture used for the material's albedo color. - * @param smooth Indicates whether the texture should be filtered when sampled. Defaults to true. - * @param repeat Indicates whether the texture should be tiled when sampled. Defaults to false. - * @param mipmap Indicates whether or not any used textures should use mipmapping. Defaults to false. - */ - constructor(texture?: textures.Texture2DBase, smooth?: boolean, repeat?: boolean, mipmap?: boolean); - constructor(color?: number, alpha?: number); - public materialMode : string; - /** - * The depth compare mode used to render the renderables using this material. - * - * @see away.stagegl.ContextGLCompareMode - */ - public depthCompareMode : string; - /** - * The alpha of the surface. - */ - public alpha : number; - /** - * The ColorTransform object to transform the colour of the material with. Defaults to null. - */ - public colorTransform : geom.ColorTransform; - /** - * The texture object to use for the ambient colour. - */ - public diffuseTexture : textures.Texture2DBase; - /** - * The method that provides the ambient lighting contribution. Defaults to AmbientBasicMethod. - */ - public ambientMethod : AmbientBasicMethod; - /** - * The method used to render shadows cast on this surface, or null if no shadows are to be rendered. Defaults to null. - */ - public shadowMethod : ShadowMapMethodBase; - /** - * The method that provides the diffuse lighting contribution. Defaults to DiffuseBasicMethod. - */ - public diffuseMethod : DiffuseBasicMethod; - /** - * The method that provides the specular lighting contribution. Defaults to SpecularBasicMethod. - */ - public specularMethod : SpecularBasicMethod; - /** - * The method used to generate the per-pixel normals. Defaults to NormalBasicMethod. - */ - public normalMethod : NormalBasicMethod; - /** - * Appends an "effect" shading method to the shader. Effect methods are those that do not influence the lighting - * but modulate the shaded colour, used for fog, outlines, etc. The method will be applied to the result of the - * methods added prior. - */ - public addEffectMethod(method: EffectMethodBase): void; - /** - * The number of "effect" methods added to the material. - */ - public numEffectMethods : number; - /** - * Queries whether a given effect method was added to the material. - * - * @param method The method to be queried. - * @return true if the method was added to the material, false otherwise. - */ - public hasEffectMethod(method: EffectMethodBase): boolean; - /** - * Returns the method added at the given index. - * @param index The index of the method to retrieve. - * @return The method at the given index. - */ - public getEffectMethodAt(index: number): EffectMethodBase; - /** - * Adds an effect method at the specified index amongst the methods already added to the material. Effect - * methods are those that do not influence the lighting but modulate the shaded colour, used for fog, outlines, - * etc. The method will be applied to the result of the methods with a lower index. - */ - public addEffectMethodAt(method: EffectMethodBase, index: number): void; - /** - * Removes an effect method from the material. - * @param method The method to be removed. - */ - public removeEffectMethod(method: EffectMethodBase): void; - /** - * The normal map to modulate the direction of the surface for each texel. The default normal method expects - * tangent-space normal maps, but others could expect object-space maps. - */ - public normalMap : textures.Texture2DBase; - /** - * A specular map that defines the strength of specular reflections for each texel in the red channel, - * and the gloss factor in the green channel. You can use SpecularBitmapTexture if you want to easily set - * specular and gloss maps from grayscale images, but correctly authored images are preferred. - */ - public specularMap : textures.Texture2DBase; - /** - * The glossiness of the material (sharpness of the specular highlight). - */ - public gloss : number; - /** - * The strength of the ambient reflection. - */ - public ambient : number; - /** - * The overall strength of the specular reflection. - */ - public specular : number; - /** - * The colour of the ambient reflection. - */ - public ambientColor : number; - /** - * The colour of the diffuse reflection. - */ - public diffuseColor : number; - /** - * The colour of the specular reflection. - */ - public specularColor : number; - /** - * Indicates whether or not the material has transparency. If binary transparency is sufficient, for - * example when using textures of foliage, consider using alphaThreshold instead. - */ - public alphaBlending : boolean; - /** - * @inheritDoc - */ - public _iUpdateMaterial(): void; - /** - * Initializes all the passes and their dependent passes. - */ - private initPasses(); - /** - * Sets up the various blending modes for all screen passes, based on whether or not there are previous passes. - */ - private setBlendAndCompareModes(); - private initCasterLightPass(); - private removeCasterLightPass(); - private initNonCasterLightPasses(); - private removeNonCasterLightPasses(); - private removeEffectPass(); - private initEffectPass(); - /** - * The maximum total number of lights provided by the light picker. - */ - private numLights; - /** - * The amount of lights that don't cast shadows. - */ - private numNonCasters; - } -} -declare module away.materials { - class DefaultMaterialManager { - private static _defaultBitmapData; - private static _defaultTriangleMaterial; - private static _defaultLineMaterial; - private static _defaultTexture; - static getDefaultMaterial(materialOwner?: base.IMaterialOwner): MaterialBase; - static getDefaultTexture(materialOwner?: base.IMaterialOwner): textures.BitmapTexture; - private static createDefaultTexture(); - static createCheckeredBitmapData(): base.BitmapData; - private static createDefaultTriangleMaterial(); - private static createDefaultLineMaterial(); - } -} -declare module away.materials { - class ShaderCompilerHelper { - /** - * A helper method that generates standard code for sampling from a texture using the normal uv coordinates. - * @param vo The MethodVO object linking this method with the pass currently being compiled. - * @param sharedReg The shared register object for the shader. - * @param inputReg The texture stream register. - * @param texture The texture which will be assigned to the given slot. - * @param uvReg An optional uv register if coordinates different from the primary uv coordinates are to be used. - * @param forceWrap If true, texture wrapping is enabled regardless of the material setting. - * @return The fragment code that performs the sampling. - * - * @protected - */ - static getTex2DSampleCode(targetReg: ShaderRegisterElement, sharedReg: ShaderRegisterData, inputReg: ShaderRegisterElement, texture: textures.TextureProxyBase, smooth: boolean, repeat: boolean, mipmaps: boolean, uvReg?: ShaderRegisterElement, forceWrap?: string): string; - /** - * A helper method that generates standard code for sampling from a cube texture. - * @param vo The MethodVO object linking this method with the pass currently being compiled. - * @param targetReg The register in which to store the sampled colour. - * @param inputReg The texture stream register. - * @param texture The cube map which will be assigned to the given slot. - * @param uvReg The direction vector with which to sample the cube map. - * - * @protected - */ - static getTexCubeSampleCode(targetReg: ShaderRegisterElement, inputReg: ShaderRegisterElement, texture: textures.TextureProxyBase, smooth: boolean, mipmaps: boolean, uvReg: ShaderRegisterElement): string; - /** - * Generates a texture format string for the sample instruction. - * @param texture The texture for which to get the format string. - * @return - * - * @protected - */ - static getFormatStringForTexture(texture: textures.TextureProxyBase): string; - } -} -/** -* @module away.render -*/ -declare module away.render { - /** - * RendererBase forms an abstract base class for classes that are used in the rendering pipeline to render the - * contents of a partition - * - * @class away.render.RendererBase - */ - class RendererBase extends events.EventDispatcher { - private _billboardRenderablePool; - private _triangleSubMeshRenderablePool; - private _lineSubMeshRenderablePool; - public _pContext: stagegl.IContextStageGL; - public _pStage: base.Stage; - public _pCamera: entities.Camera; - public _iEntryPoint: geom.Vector3D; - public _pCameraForward: geom.Vector3D; - public _pRttBufferManager: managers.RTTBufferManager; - private _viewPort; - private _viewportDirty; - private _scissorDirty; - public _pBackBufferInvalid: boolean; - public _pDepthTextureInvalid: boolean; - public _depthPrepass: boolean; - private _backgroundR; - private _backgroundG; - private _backgroundB; - private _backgroundAlpha; - public _shareContext: boolean; - public _width: number; - public _height: number; - public textureRatioX: number; - public textureRatioY: number; - private _snapshotBitmapData; - private _snapshotRequired; - public _pRttViewProjectionMatrix: geom.Matrix3D; - private _localPos; - private _globalPos; - public _pScissorRect: geom.Rectangle; - private _scissorUpdated; - private _viewPortUpdated; - private _onContextUpdateDelegate; - private _onViewportUpdatedDelegate; - public _pNumTriangles: number; - public _pOpaqueRenderableHead: pool.RenderableBase; - public _pBlendedRenderableHead: pool.RenderableBase; - /** - * - */ - public numTriangles : number; - /** - * - */ - public renderableSorter: sort.IEntitySorter; - /** - * A viewPort rectangle equivalent of the Stage size and position. - */ - public viewPort : geom.Rectangle; - /** - * A scissor rectangle equivalent of the view size and position. - */ - public scissorRect : geom.Rectangle; - /** - * - */ - public x : number; - /** - * - */ - public y : number; - /** - * - */ - public width : number; - /** - * - */ - public height : number; - /** - * Creates a new RendererBase object. - */ - constructor(); - public _iCreateEntityCollector(): traverse.ICollector; - /** - * The background color's red component, used when clearing. - * - * @private - */ - public _iBackgroundR : number; - /** - * The background color's green component, used when clearing. - * - * @private - */ - public _iBackgroundG : number; - /** - * The background color's blue component, used when clearing. - * - * @private - */ - public _iBackgroundB : number; - /** - * The Stage that will provide the ContextGL used for rendering. - */ - public stage : base.Stage; - public iSetStage(value: base.Stage): void; - /** - * Defers control of ContextGL clear() and present() calls to Stage, enabling multiple Stage frameworks - * to share the same ContextGL object. - */ - public shareContext : boolean; - /** - * Disposes the resources used by the RendererBase. - */ - public dispose(): void; - public render(entityCollector: traverse.ICollector): void; - /** - * Renders the potentially visible geometry to the back buffer or texture. - * @param entityCollector The EntityCollector object containing the potentially visible geometry. - * @param target An option target texture to render to. - * @param surfaceSelector The index of a CubeTexture's face to render to. - * @param additionalClearMask Additional clear mask information, in case extra clear channels are to be omitted. - */ - public _iRender(entityCollector: traverse.ICollector, target?: textures.TextureProxyBase, scissorRect?: geom.Rectangle, surfaceSelector?: number): void; - public _iRenderCascades(entityCollector: traverse.ShadowCasterCollector, target: textures.TextureProxyBase, numCascades: number, scissorRects: geom.Rectangle[], cameras: entities.Camera[]): void; - public pCollectRenderables(entityCollector: traverse.ICollector): void; - /** - * Renders the potentially visible geometry to the back buffer or texture. Only executed if everything is set up. - * - * @param entityCollector The EntityCollector object containing the potentially visible geometry. - * @param target An option target texture to render to. - * @param surfaceSelector The index of a CubeTexture's face to render to. - * @param additionalClearMask Additional clear mask information, in case extra clear channels are to be omitted. - */ - public pExecuteRender(entityCollector: traverse.ICollector, target?: textures.TextureProxyBase, scissorRect?: geom.Rectangle, surfaceSelector?: number): void; - public queueSnapshot(bmd: base.BitmapData): void; - /** - * Performs the actual drawing of geometry to the target. - * @param entityCollector The EntityCollector object containing the potentially visible geometry. - */ - public pDraw(entityCollector: traverse.ICollector, target: textures.TextureProxyBase): void; - /** - * Assign the context once retrieved - */ - private onContextUpdate(event); - public _iBackgroundAlpha : number; - /** - * @private - */ - private notifyScissorUpdate(); - /** - * @private - */ - private notifyViewportUpdate(); - /** - * - */ - public onViewportUpdated(event: events.StageEvent): void; - /** - * - */ - public updateGlobalPos(): void; - /** - * - * @param billboard - * @protected - */ - public applyBillboard(billboard: entities.Billboard): void; - /** - * - * @param triangleSubMesh - */ - public applyTriangleSubMesh(triangleSubMesh: base.TriangleSubMesh): void; - /** - * - * @param lineSubMesh - */ - public applyLineSubMesh(lineSubMesh: base.LineSubMesh): void; - /** - * - * @param renderable - * @protected - */ - private _applyRenderable(renderable); - } -} -/** -* @module away.render -*/ -declare module away.render { - /** - * The DefaultRenderer class provides the default rendering method. It renders the scene graph objects using the - * materials assigned to them. - * - * @class away.render.DefaultRenderer - */ - class DefaultRenderer extends RendererBase implements IRenderer { - public _pRequireDepthRender: boolean; - private _skyboxRenderablePool; - private _pDistanceRenderer; - private _pDepthRenderer; - private _skyboxProjection; - public _pFilter3DRenderer: Filter3DRenderer; - public _pDepthRender: textures.TextureProxyBase; - private _antiAlias; - public antiAlias : number; - /** - * - */ - public depthPrepass : boolean; - /** - * - * @returns {*} - */ - public filters3d : filters.Filter3DBase[]; - /** - * Creates a new DefaultRenderer object. - * - * @param antiAlias The amount of anti-aliasing to use. - * @param renderMode The render mode to use. - */ - constructor(forceSoftware?: boolean, profile?: string, mode?: string); - public render(entityCollector: traverse.ICollector): void; - public pExecuteRender(entityCollector: traverse.EntityCollector, target?: textures.TextureProxyBase, scissorRect?: geom.Rectangle, surfaceSelector?: number): void; - private updateLights(entityCollector); - /** - * @inheritDoc - */ - public pDraw(entityCollector: traverse.EntityCollector, target: textures.TextureProxyBase): void; - /** - * Draw the skybox if present. - * - * @param entityCollector The EntityCollector containing all potentially visible information. - */ - private drawSkybox(entityCollector); - private updateSkyboxProjection(camera); - /** - * Draw a list of renderables. - * - * @param renderables The renderables to draw. - * @param entityCollector The EntityCollector containing all potentially visible information. - */ - private drawRenderables(renderable, entityCollector); - public dispose(): void; - /** - * - */ - public pRenderDepthPrepass(entityCollector: traverse.EntityCollector): void; - /** - * - */ - public pRenderSceneDepthToTexture(entityCollector: traverse.EntityCollector): void; - /** - * Updates the backbuffer dimensions. - */ - public pUpdateBackBuffer(): void; - public iSetStage(value: base.Stage): void; - /** - * - */ - private initDepthTexture(context); - } -} -/** -* @module away.render -*/ -declare module away.render { - /** - * The DepthRenderer class renders 32-bit depth information encoded as RGBA - * - * @class away.render.DepthRenderer - */ - class DepthRenderer extends RendererBase { - private _pass; - private _renderBlended; - private _disableColor; - /** - * Creates a new DepthRenderer object. - * @param renderBlended Indicates whether semi-transparent objects should be rendered. - * @param distanceBased Indicates whether the written depth value is distance-based or projected depth-based - */ - constructor(pass: materials.MaterialPassBase, renderBlended?: boolean); - public disableColor : boolean; - public _iRenderCascades(entityCollector: traverse.ShadowCasterCollector, target: textures.TextureProxyBase, numCascades: number, scissorRects: geom.Rectangle[], cameras: entities.Camera[]): void; - private drawCascadeRenderables(renderable, camera, cullPlanes); - /** - * @inheritDoc - */ - public pDraw(entityCollector: traverse.EntityCollector, target: textures.TextureProxyBase): void; - /** - * Draw a list of renderables. - * @param renderables The renderables to draw. - * @param entityCollector The EntityCollector containing all potentially visible information. - */ - private drawRenderables(renderable, entityCollector); - } -} -/** -* @module away.render -*/ -declare module away.render { - /** - * @class away.render.Filter3DRenderer - */ - class Filter3DRenderer { - private _filters; - private _tasks; - private _filterTasksInvalid; - private _mainInputTexture; - private _requireDepthRender; - private _rttManager; - private _stage; - private _filterSizesInvalid; - private _onRTTResizeDelegate; - constructor(stage: base.Stage); - private onRTTResize(event); - public requireDepthRender : boolean; - public getMainInputTexture(stage: base.Stage): stagegl.ITexture; - public filters : filters.Filter3DBase[]; - private updateFilterTasks(stage); - public render(stage: base.Stage, camera: entities.Camera, depthTexture: stagegl.ITexture): void; - private updateFilterSizes(); - public dispose(): void; - } -} -declare module away.animators { - /** - * ... - */ - class AnimationRegisterCache extends materials.ShaderRegisterCache { - public positionAttribute: materials.ShaderRegisterElement; - public uvAttribute: materials.ShaderRegisterElement; - public positionTarget: materials.ShaderRegisterElement; - public scaleAndRotateTarget: materials.ShaderRegisterElement; - public velocityTarget: materials.ShaderRegisterElement; - public vertexTime: materials.ShaderRegisterElement; - public vertexLife: materials.ShaderRegisterElement; - public vertexZeroConst: materials.ShaderRegisterElement; - public vertexOneConst: materials.ShaderRegisterElement; - public vertexTwoConst: materials.ShaderRegisterElement; - public uvTarget: materials.ShaderRegisterElement; - public colorAddTarget: materials.ShaderRegisterElement; - public colorMulTarget: materials.ShaderRegisterElement; - public colorAddVary: materials.ShaderRegisterElement; - public colorMulVary: materials.ShaderRegisterElement; - public uvVar: materials.ShaderRegisterElement; - public rotationRegisters: materials.ShaderRegisterElement[]; - public needFragmentAnimation: boolean; - public needUVAnimation: boolean; - public sourceRegisters: string[]; - public targetRegisters: string[]; - private indexDictionary; - public hasUVNode: boolean; - public needVelocity: boolean; - public hasBillboard: boolean; - public hasColorMulNode: boolean; - public hasColorAddNode: boolean; - constructor(profile: string); - public reset(): void; - public setUVSourceAndTarget(UVAttribute: string, UVVaring: string): void; - public setRegisterIndex(node: AnimationNodeBase, parameterIndex: number, registerIndex: number): void; - public getRegisterIndex(node: AnimationNodeBase, parameterIndex: number): number; - public getInitCode(): string; - public getCombinationCode(): string; - public initColorRegisters(): string; - public getColorPassCode(): string; - public getColorCombinationCode(shadedTarget: string): string; - private getRegisterFromString(code); - public vertexConstantData: number[]; - public fragmentConstantData: number[]; - private _numVertexConstant; - private _numFragmentConstant; - public numVertexConstant : number; - public numFragmentConstant : number; - public setDataLength(): void; - public setVertexConst(index: number, x?: number, y?: number, z?: number, w?: number): void; - public setVertexConstFromArray(index: number, data: number[]): void; - public setVertexConstFromMatrix(index: number, matrix: geom.Matrix3D): void; - public setFragmentConst(index: number, x?: number, y?: number, z?: number, w?: number): void; - } -} -declare module away.animators { - interface IAnimationState { - positionDelta: geom.Vector3D; - offset(startTime: number): any; - update(time: number): any; - /** - * Sets the animation phase of the node. - * - * @param value The phase value to use. 0 represents the beginning of an animation clip, 1 represents the end. - */ - phase(value: number): any; - } -} -declare module away.animators { - /** - * Provides an abstract base class for data set classes that hold animation data for use in animator classes. - * - * @see away.animators.AnimatorBase - */ - class AnimationSetBase extends library.NamedAssetBase implements library.IAsset { - private _usesCPU; - private _animations; - private _animationNames; - private _animationDictionary; - constructor(); - /** - * Retrieves a temporary GPU register that's still free. - * - * @param exclude An array of non-free temporary registers. - * @param excludeAnother An additional register that's not free. - * @return A temporary register that can be used. - */ - public _pFindTempReg(exclude: string[], excludeAnother?: string): string; - /** - * Indicates whether the properties of the animation data contained within the set combined with - * the vertex registers already in use on shading materials allows the animation data to utilise - * GPU calls. - */ - public usesCPU : boolean; - /** - * Called by the material to reset the GPU indicator before testing whether register space in the shader - * is available for running GPU-based animation code. - * - * @private - */ - public resetGPUCompatibility(): void; - public cancelGPUCompatibility(): void; - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject: materials.ShaderObjectBase): string; - /** - * @inheritDoc - */ - public activate(shaderObject: materials.ShaderObjectBase, stage: base.Stage): void; - /** - * @inheritDoc - */ - public deactivate(shaderObject: materials.ShaderObjectBase, stage: base.Stage): void; - /** - * @inheritDoc - */ - public getAGALFragmentCode(shaderObject: materials.ShaderObjectBase, shadedTarget: string): string; - /** - * @inheritDoc - */ - public getAGALUVCode(shaderObject: materials.ShaderObjectBase): string; - /** - * @inheritDoc - */ - public doneAGALCode(shaderObject: materials.ShaderObjectBase): void; - /** - * @inheritDoc - */ - public assetType : string; - /** - * Returns a vector of animation state objects that make up the contents of the animation data set. - */ - public animations : AnimationNodeBase[]; - /** - * Returns a vector of animation state objects that make up the contents of the animation data set. - */ - public animationNames : string[]; - /** - * Check to determine whether a state is registered in the animation set under the given name. - * - * @param stateName The name of the animation state object to be checked. - */ - public hasAnimation(name: string): boolean; - /** - * Retrieves the animation state object registered in the animation data set under the given name. - * - * @param stateName The name of the animation state object to be retrieved. - */ - public getAnimation(name: string): AnimationNodeBase; - /** - * Adds an animation state object to the aniamtion data set under the given name. - * - * @param stateName The name under which the animation state object will be stored. - * @param animationState The animation state object to be staored in the set. - */ - public addAnimation(node: AnimationNodeBase): void; - /** - * Cleans up any resources used by the current object. - */ - public dispose(): void; - } -} -declare module away.animators { - /** - * Provides an abstract base class for animator classes that control animation output from a data set subtype of AnimationSetBase. - * - * @see away.animators.AnimationSetBase - */ - class AnimatorBase extends library.NamedAssetBase implements IAnimator { - private _broadcaster; - private _isPlaying; - private _autoUpdate; - private _startEvent; - private _stopEvent; - private _cycleEvent; - private _time; - private _playbackSpeed; - public _pAnimationSet: IAnimationSet; - public _pOwners: entities.Mesh[]; - public _pActiveNode: AnimationNodeBase; - public _pActiveState: IAnimationState; - public _pActiveAnimationName: string; - public _pAbsoluteTime: number; - private _animationStates; - /** - * Enables translation of the animated mesh from data returned per frame via the positionDelta property of the active animation node. Defaults to true. - * - * @see away.animators.IAnimationState#positionDelta - */ - public updatePosition: boolean; - public getAnimationState(node: AnimationNodeBase): IAnimationState; - public getAnimationStateByName(name: string): IAnimationState; - /** - * Returns the internal absolute time of the animator, calculated by the current time and the playback speed. - * - * @see #time - * @see #playbackSpeed - */ - public absoluteTime : number; - /** - * Returns the animation data set in use by the animator. - */ - public animationSet : IAnimationSet; - /** - * Returns the current active animation state. - */ - public activeState : IAnimationState; - /** - * Returns the current active animation node. - */ - public activeAnimation : AnimationNodeBase; - /** - * Returns the current active animation node. - */ - public activeAnimationName : string; - /** - * Determines whether the animators internal update mechanisms are active. Used in cases - * where manual updates are required either via the time property or update() method. - * Defaults to true. - * - * @see #time - * @see #update() - */ - public autoUpdate : boolean; - /** - * Gets and sets the internal time clock of the animator. - */ - public time : number; - /** - * Sets the animation phase of the current active state's animation clip(s). - * - * @param value The phase value to use. 0 represents the beginning of an animation clip, 1 represents the end. - */ - public phase(value: number): void; - /** - * Creates a new AnimatorBase object. - * - * @param animationSet The animation data set to be used by the animator object. - */ - constructor(animationSet: IAnimationSet); - /** - * The amount by which passed time should be scaled. Used to slow down or speed up animations. Defaults to 1. - */ - public playbackSpeed : number; - public setRenderState(shaderObject: materials.ShaderObjectBase, renderable: pool.RenderableBase, stage: base.Stage, camera: entities.Camera, vertexConstantOffset: number, vertexStreamOffset: number): void; - /** - * Resumes the automatic playback clock controling the active state of the animator. - */ - public start(): void; - /** - * Pauses the automatic playback clock of the animator, in case manual updates are required via the - * time property or update() method. - * - * @see #time - * @see #update() - */ - public stop(): void; - /** - * Provides a way to manually update the active state of the animator when automatic - * updates are disabled. - * - * @see #stop() - * @see #autoUpdate - */ - public update(time: number): void; - public reset(name: string, offset?: number): void; - /** - * Used by the mesh object to which the animator is applied, registers the owner for internal use. - * - * @private - */ - public addOwner(mesh: entities.Mesh): void; - /** - * Used by the mesh object from which the animator is removed, unregisters the owner for internal use. - * - * @private - */ - public removeOwner(mesh: entities.Mesh): void; - /** - * Internal abstract method called when the time delta property of the animator's contents requires updating. - * - * @private - */ - public _pUpdateDeltaTime(dt: number): void; - /** - * Enter frame event handler for automatically updating the active state of the animator. - */ - private onEnterFrame(event?); - private applyPositionDelta(); - /** - * for internal use. - * - * @private - */ - public dispatchCycleEvent(): void; - /** - * @inheritDoc - */ - public clone(): AnimatorBase; - /** - * @inheritDoc - */ - public dispose(): void; - /** - * @inheritDoc - */ - public testGPUCompatibility(shaderObject: materials.ShaderObjectBase): void; - /** - * @inheritDoc - */ - public assetType : string; - public getRenderableSubGeometry(renderable: pool.TriangleSubMeshRenderable, sourceSubGeometry: base.TriangleSubGeometry): base.TriangleSubGeometry; - } -} -declare module away.filters { - class Filter3DTaskBase { - private _mainInputTexture; - private _scaledTextureWidth; - private _scaledTextureHeight; - private _textureWidth; - private _textureHeight; - private _textureDimensionsInvalid; - private _program3DInvalid; - private _program3D; - private _target; - private _requireDepthRender; - private _textureScale; - constructor(requireDepthRender?: boolean); - /** - * The texture scale for the input of this texture. This will define the output of the previous entry in the chain - */ - public textureScale : number; - public target : stagegl.ITexture; - public textureWidth : number; - public textureHeight : number; - public getMainInputTexture(stage: base.Stage): stagegl.ITexture; - public dispose(): void; - public pInvalidateProgram(): void; - public pUpdateProgram(stage: base.Stage): void; - public pGetVertexCode(): string; - public pGetFragmentCode(): string; - public pUpdateTextures(stage: base.Stage): void; - public getProgram(stage: base.Stage): stagegl.IProgram; - public activate(stage: base.Stage, camera: entities.Camera, depthTexture: stagegl.ITexture): void; - public deactivate(stage: base.Stage): void; - public requireDepthRender : boolean; - } -} -declare module away.filters { - class Filter3DBase { - private _tasks; - private _requireDepthRender; - private _textureWidth; - private _textureHeight; - constructor(); - public requireDepthRender : boolean; - public pAddTask(filter: Filter3DTaskBase): void; - public tasks : Filter3DTaskBase[]; - public getMainInputTexture(stage: base.Stage): stagegl.ITexture; - public textureWidth : number; - public textureHeight : number; - public setRenderTargets(mainTarget: stagegl.ITexture, stage: base.Stage): void; - public dispose(): void; - public update(stage: base.Stage, camera: entities.Camera): void; - } -} -declare module away { - class StageGLCore extends events.EventDispatcher { - constructor(); - } -} diff --git a/libs/stagegl-core.next.js b/libs/stagegl-core.next.js deleted file mode 100644 index d36d148a5..000000000 --- a/libs/stagegl-core.next.js +++ /dev/null @@ -1,14250 +0,0 @@ -/// -var aglsl; -(function (aglsl) { - var Sampler = (function () { - function Sampler() { - this.lodbias = 0; - this.dim = 0; - this.readmode = 0; - this.special = 0; - this.wrap = 0; - this.mipmap = 0; - this.filter = 0; - } - return Sampler; - })(); - aglsl.Sampler = Sampler; -})(aglsl || (aglsl = {})); -/// -var aglsl; -(function (aglsl) { - var Token = (function () { - function Token() { - this.dest = new aglsl.Destination(); - this.opcode = 0; - this.a = new aglsl.Destination(); - this.b = new aglsl.Destination(); - } - return Token; - })(); - aglsl.Token = Token; -})(aglsl || (aglsl = {})); -/// -var aglsl; -(function (aglsl) { - var Header = (function () { - function Header() { - this.progid = 0; - this.version = 0; - this.type = ""; - } - return Header; - })(); - aglsl.Header = Header; -})(aglsl || (aglsl = {})); -/// -var aglsl; -(function (aglsl) { - var OpLUT = (function () { - function OpLUT(s, flags, dest, a, b, matrixwidth, matrixheight, ndwm, scaler, dm, lod) { - this.s = s; - this.flags = flags; - this.dest = dest; - this.a = a; - this.b = b; - this.matrixwidth = matrixwidth; - this.matrixheight = matrixheight; - this.ndwm = ndwm; - this.scalar = scaler; - this.dm = dm; - this.lod = lod; - } - return OpLUT; - })(); - aglsl.OpLUT = OpLUT; -})(aglsl || (aglsl = {})); -/// -var aglsl; -(function (aglsl) { - var Description = (function () { - function Description() { - this.regread = [ - [], - [], - [], - [], - [], - [], - [] - ]; - this.regwrite = [ - [], - [], - [], - [], - [], - [], - [] - ]; - this.hasindirect = false; - this.writedepth = false; - this.hasmatrix = false; - this.samplers = []; - // added due to dynamic assignment 3*0xFFFFFFuuuu - this.tokens = []; - this.header = new aglsl.Header(); - } - return Description; - })(); - aglsl.Description = Description; -})(aglsl || (aglsl = {})); -/// -var aglsl; -(function (aglsl) { - var Destination = (function () { - function Destination() { - this.mask = 0; - this.regnum = 0; - this.regtype = 0; - this.dim = 0; - } - return Destination; - })(); - aglsl.Destination = Destination; -})(aglsl || (aglsl = {})); -/// -var aglsl; -(function (aglsl) { - var Mapping = (function () { - function Mapping() { - } - Mapping.agal2glsllut = [ - new aglsl.OpLUT("%dest = %cast(%a);\n", 0, true, true, false, null, null, null, null, null, null), - new aglsl.OpLUT("%dest = %cast(%a + %b);\n", 0, true, true, true, null, null, null, null, null, null), - new aglsl.OpLUT("%dest = %cast(%a - %b);\n", 0, true, true, true, null, null, null, null, null, null), - new aglsl.OpLUT("%dest = %cast(%a * %b);\n", 0, true, true, true, null, null, null, null, null, null), - new aglsl.OpLUT("%dest = %cast(%a / %b);\n", 0, true, true, true, null, null, null, null, null, null), - new aglsl.OpLUT("%dest = %cast(1.0) / %a;\n", 0, true, true, false, null, null, null, null, null, null), - new aglsl.OpLUT("%dest = %cast(min(%a,%b));\n", 0, true, true, true, null, null, null, null, null, null), - new aglsl.OpLUT("%dest = %cast(max(%a,%b));\n", 0, true, true, true, null, null, null, null, null, null), - new aglsl.OpLUT("%dest = %cast(fract(%a));\n", 0, true, true, false, null, null, null, null, null, null), - new aglsl.OpLUT("%dest = %cast(sqrt(abs(%a)));\n", 0, true, true, false, null, null, null, null, null, null), - new aglsl.OpLUT("%dest = %cast(inversesqrt(abs(%a)));\n", 0, true, true, false, null, null, null, null, null, null), - new aglsl.OpLUT("%dest = %cast(pow(abs(%a),%b));\n", 0, true, true, true, null, null, null, null, null, null), - new aglsl.OpLUT("%dest = %cast(log2(abs(%a)));\n", 0, true, true, false, null, null, null, null, null, null), - new aglsl.OpLUT("%dest = %cast(exp2(%a));\n", 0, true, true, false, null, null, null, null, null, null), - new aglsl.OpLUT("%dest = %cast(normalize(vec3( %a ) ));\n", 0, true, true, false, null, null, true, null, null, null), - new aglsl.OpLUT("%dest = %cast(sin(%a));\n", 0, true, true, false, null, null, null, null, null, null), - new aglsl.OpLUT("%dest = %cast(cos(%a));\n", 0, true, true, false, null, null, null, null, null, null), - new aglsl.OpLUT("%dest = %cast(cross(vec3(%a),vec3(%b)));\n", 0, true, true, true, null, null, true, null, null, null), - new aglsl.OpLUT("%dest = %cast(dot(vec3(%a),vec3(%b)));\n", 0, true, true, true, null, null, true, null, null, null), - new aglsl.OpLUT("%dest = %cast(dot(vec4(%a),vec4(%b)));\n", 0, true, true, true, null, null, true, null, null, null), - new aglsl.OpLUT("%dest = %cast(abs(%a));\n", 0, true, true, false, null, null, null, null, null, null), - new aglsl.OpLUT("%dest = %cast(%a * -1.0);\n", 0, true, true, false, null, null, null, null, null, null), - new aglsl.OpLUT("%dest = %cast(clamp(%a,0.0,1.0));\n", 0, true, true, false, null, null, null, null, null, null), - new aglsl.OpLUT("%dest = %cast(dot(vec3(%a),vec3(%b)));\n", null, true, true, true, 3, 3, true, null, null, null), - new aglsl.OpLUT("%dest = %cast(dot(vec4(%a),vec4(%b)));\n", null, true, true, true, 4, 4, true, null, null, null), - new aglsl.OpLUT("%dest = %cast(dot(vec4(%a),vec4(%b)));\n", null, true, true, true, 4, 3, true, null, null, null), - new aglsl.OpLUT("%dest = %cast(dFdx(%a));\n", 0, true, true, false, null, null, null, null, null, null), - new aglsl.OpLUT("%dest = %cast(dFdx(%a));\n", 0, true, true, false, null, null, null, null, null, null), - new aglsl.OpLUT("if (float(%a)==float(%b)) {;\n", 0, false, true, true, null, null, null, true, null, null), new aglsl.OpLUT("if (float(%a)!=float(%b)) {;\n", 0, false, true, true, null, null, null, true, null, null), new aglsl.OpLUT("if (float(%a)>=float(%b)) {;\n", 0, false, true, true, null, null, null, true, null, null), new aglsl.OpLUT("if (float(%a) -var aglsl; -(function (aglsl) { - (function (assembler) { - var Opcode = (function () { - function Opcode(dest, aformat, asize, bformat, bsize, opcode, simple, horizontal, fragonly, matrix) { - this.a = new aglsl.assembler.FS(); - this.b = new aglsl.assembler.FS(); - this.flags = new aglsl.assembler.Flags(); - - this.dest = dest; - this.a.format = aformat; - this.a.size = asize; - this.b.format = bformat; - this.b.size = bsize; - this.opcode = opcode; - this.flags.simple = simple; - this.flags.horizontal = horizontal; - this.flags.fragonly = fragonly; - this.flags.matrix = matrix; - } - return Opcode; - })(); - assembler.Opcode = Opcode; - - var FS = (function () { - function FS() { - } - return FS; - })(); - assembler.FS = FS; - - var Flags = (function () { - function Flags() { - } - return Flags; - })(); - assembler.Flags = Flags; - })(aglsl.assembler || (aglsl.assembler = {})); - var assembler = aglsl.assembler; -})(aglsl || (aglsl = {})); -/// -var aglsl; -(function (aglsl) { - (function (assembler) { - var OpcodeMap = (function () { - function OpcodeMap() { - } - Object.defineProperty(OpcodeMap, "map", { - get: function () { - if (!OpcodeMap._map) { - OpcodeMap._map = new Array(); - OpcodeMap._map['mov'] = new aglsl.assembler.Opcode("vector", "vector", 4, "none", 0, 0x00, true, null, null, null); - OpcodeMap._map['add'] = new aglsl.assembler.Opcode("vector", "vector", 4, "vector", 4, 0x01, true, null, null, null); - OpcodeMap._map['sub'] = new aglsl.assembler.Opcode("vector", "vector", 4, "vector", 4, 0x02, true, null, null, null); - OpcodeMap._map['mul'] = new aglsl.assembler.Opcode("vector", "vector", 4, "vector", 4, 0x03, true, null, null, null); - OpcodeMap._map['div'] = new aglsl.assembler.Opcode("vector", "vector", 4, "vector", 4, 0x04, true, null, null, null); - OpcodeMap._map['rcp'] = new aglsl.assembler.Opcode("vector", "vector", 4, "none", 0, 0x05, true, null, null, null); - OpcodeMap._map['min'] = new aglsl.assembler.Opcode("vector", "vector", 4, "vector", 4, 0x06, true, null, null, null); - OpcodeMap._map['max'] = new aglsl.assembler.Opcode("vector", "vector", 4, "vector", 4, 0x07, true, null, null, null); - OpcodeMap._map['frc'] = new aglsl.assembler.Opcode("vector", "vector", 4, "none", 0, 0x08, true, null, null, null); - OpcodeMap._map['sqt'] = new aglsl.assembler.Opcode("vector", "vector", 4, "none", 0, 0x09, true, null, null, null); - OpcodeMap._map['rsq'] = new aglsl.assembler.Opcode("vector", "vector", 4, "none", 0, 0x0a, true, null, null, null); - OpcodeMap._map['pow'] = new aglsl.assembler.Opcode("vector", "vector", 4, "vector", 4, 0x0b, true, null, null, null); - OpcodeMap._map['log'] = new aglsl.assembler.Opcode("vector", "vector", 4, "none", 0, 0x0c, true, null, null, null); - OpcodeMap._map['exp'] = new aglsl.assembler.Opcode("vector", "vector", 4, "none", 0, 0x0d, true, null, null, null); - OpcodeMap._map['nrm'] = new aglsl.assembler.Opcode("vector", "vector", 4, "none", 0, 0x0e, true, null, null, null); - OpcodeMap._map['sin'] = new aglsl.assembler.Opcode("vector", "vector", 4, "none", 0, 0x0f, true, null, null, null); - OpcodeMap._map['cos'] = new aglsl.assembler.Opcode("vector", "vector", 4, "none", 0, 0x10, true, null, null, null); - OpcodeMap._map['crs'] = new aglsl.assembler.Opcode("vector", "vector", 4, "vector", 4, 0x11, true, true, null, null); - OpcodeMap._map['dp3'] = new aglsl.assembler.Opcode("vector", "vector", 4, "vector", 4, 0x12, true, true, null, null); - OpcodeMap._map['dp4'] = new aglsl.assembler.Opcode("vector", "vector", 4, "vector", 4, 0x13, true, true, null, null); - OpcodeMap._map['abs'] = new aglsl.assembler.Opcode("vector", "vector", 4, "none", 0, 0x14, true, null, null, null); - OpcodeMap._map['neg'] = new aglsl.assembler.Opcode("vector", "vector", 4, "none", 0, 0x15, true, null, null, null); - OpcodeMap._map['sat'] = new aglsl.assembler.Opcode("vector", "vector", 4, "none", 0, 0x16, true, null, null, null); - - OpcodeMap._map['ted'] = new aglsl.assembler.Opcode("vector", "vector", 4, "sampler", 1, 0x26, true, null, true, null); - OpcodeMap._map['kil'] = new aglsl.assembler.Opcode("none", "scalar", 1, "none", 0, 0x27, true, null, true, null); - OpcodeMap._map['tex'] = new aglsl.assembler.Opcode("vector", "vector", 4, "sampler", 1, 0x28, true, null, true, null); - - OpcodeMap._map['m33'] = new aglsl.assembler.Opcode("vector", "matrix", 3, "vector", 3, 0x17, true, null, null, true); - OpcodeMap._map['m44'] = new aglsl.assembler.Opcode("vector", "matrix", 4, "vector", 4, 0x18, true, null, null, true); - OpcodeMap._map['m43'] = new aglsl.assembler.Opcode("vector", "matrix", 3, "vector", 4, 0x19, true, null, null, true); - - OpcodeMap._map['sge'] = new aglsl.assembler.Opcode("vector", "vector", 4, "vector", 4, 0x29, true, null, null, null); - OpcodeMap._map['slt'] = new aglsl.assembler.Opcode("vector", "vector", 4, "vector", 4, 0x2a, true, null, null, null); - OpcodeMap._map['sgn'] = new aglsl.assembler.Opcode("vector", "vector", 4, "vector", 4, 0x2b, true, null, null, null); - OpcodeMap._map['seq'] = new aglsl.assembler.Opcode("vector", "vector", 4, "vector", 4, 0x2c, true, null, null, null); - OpcodeMap._map['sne'] = new aglsl.assembler.Opcode("vector", "vector", 4, "vector", 4, 0x2d, true, null, null, null); - } - - return OpcodeMap._map; - }, - enumerable: true, - configurable: true - }); - return OpcodeMap; - })(); - assembler.OpcodeMap = OpcodeMap; - })(aglsl.assembler || (aglsl.assembler = {})); - var assembler = aglsl.assembler; -})(aglsl || (aglsl = {})); -/// -var aglsl; -(function (aglsl) { - (function (assembler) { - var Part = (function () { - function Part(name, version) { - if (typeof name === "undefined") { name = null; } - if (typeof version === "undefined") { version = null; } - this.name = ""; - this.version = 0; - this.name = name; - this.version = version; - this.data = new away.utils.ByteArray(); - } - return Part; - })(); - assembler.Part = Part; - })(aglsl.assembler || (aglsl.assembler = {})); - var assembler = aglsl.assembler; -})(aglsl || (aglsl = {})); -/// -var aglsl; -(function (aglsl) { - (function (assembler) { - var Reg = (function () { - function Reg(code, desc) { - this.code = code; - this.desc = desc; - } - return Reg; - })(); - assembler.Reg = Reg; - - var RegMap = (function () { - /* - public static va:aglsl.assembler.Reg = new aglsl.assembler.Reg( 0x00, "vertex attribute" ); - public static fc:aglsl.assembler.Reg = new aglsl.assembler.Reg( 0x01, "fragment constant" ); - public static vc:aglsl.assembler.Reg = new aglsl.assembler.Reg( 0x01, "vertex constant" ); - public static ft:aglsl.assembler.Reg = new aglsl.assembler.Reg( 0x02, "fragment temporary" ); - public static vt:aglsl.assembler.Reg = new aglsl.assembler.Reg( 0x02, "vertex temporary" ); - public static vo:aglsl.assembler.Reg = new aglsl.assembler.Reg( 0x03, "vertex output" ); - public static op:aglsl.assembler.Reg = new aglsl.assembler.Reg( 0x03, "vertex output" ); - public static fd:aglsl.assembler.Reg = new aglsl.assembler.Reg( 0x03, "fragment depth output" ); - public static fo:aglsl.assembler.Reg = new aglsl.assembler.Reg( 0x03, "fragment output" ); - public static oc:aglsl.assembler.Reg = new aglsl.assembler.Reg( 0x03, "fragment output" ); - public static v: aglsl.assembler.Reg = new aglsl.assembler.Reg( 0x04, "varying" ); - public static vi:aglsl.assembler.Reg = new aglsl.assembler.Reg( 0x04, "varying output" ); - public static fi:aglsl.assembler.Reg = new aglsl.assembler.Reg( 0x04, "varying input" ); - public static fs:aglsl.assembler.Reg = new aglsl.assembler.Reg( 0x05, "sampler" ); - */ - function RegMap() { - } - Object.defineProperty(RegMap, "map", { - get: function () { - if (!RegMap._map) { - RegMap._map = new Array(); - RegMap._map['va'] = new aglsl.assembler.Reg(0x00, "vertex attribute"); - RegMap._map['fc'] = new aglsl.assembler.Reg(0x01, "fragment constant"); - RegMap._map['vc'] = new aglsl.assembler.Reg(0x01, "vertex constant"); - RegMap._map['ft'] = new aglsl.assembler.Reg(0x02, "fragment temporary"); - RegMap._map['vt'] = new aglsl.assembler.Reg(0x02, "vertex temporary"); - RegMap._map['vo'] = new aglsl.assembler.Reg(0x03, "vertex output"); - RegMap._map['op'] = new aglsl.assembler.Reg(0x03, "vertex output"); - RegMap._map['fd'] = new aglsl.assembler.Reg(0x03, "fragment depth output"); - RegMap._map['fo'] = new aglsl.assembler.Reg(0x03, "fragment output"); - RegMap._map['oc'] = new aglsl.assembler.Reg(0x03, "fragment output"); - RegMap._map['v'] = new aglsl.assembler.Reg(0x04, "varying"); - RegMap._map['vi'] = new aglsl.assembler.Reg(0x04, "varying output"); - RegMap._map['fi'] = new aglsl.assembler.Reg(0x04, "varying input"); - RegMap._map['fs'] = new aglsl.assembler.Reg(0x05, "sampler"); - } - - return RegMap._map; - }, - enumerable: true, - configurable: true - }); - return RegMap; - })(); - assembler.RegMap = RegMap; - })(aglsl.assembler || (aglsl.assembler = {})); - var assembler = aglsl.assembler; -})(aglsl || (aglsl = {})); -/// -var aglsl; -(function (aglsl) { - (function (assembler) { - var Sampler = (function () { - function Sampler(shift, mask, value) { - this.shift = shift; - this.mask = mask; - this.value = value; - } - return Sampler; - })(); - assembler.Sampler = Sampler; - - var SamplerMap = (function () { - /* - public static map = [ new aglsl.assembler.Sampler( 8, 0xf, 0 ), - new aglsl.assembler.Sampler( 8, 0xf, 5 ), - new aglsl.assembler.Sampler( 8, 0xf, 4 ), - new aglsl.assembler.Sampler( 8, 0xf, 1 ), - new aglsl.assembler.Sampler( 8, 0xf, 2 ), - new aglsl.assembler.Sampler( 8, 0xf, 1 ), - new aglsl.assembler.Sampler( 8, 0xf, 2 ), - - // dimension - new aglsl.assembler.Sampler( 12, 0xf, 0 ), - new aglsl.assembler.Sampler( 12, 0xf, 1 ), - new aglsl.assembler.Sampler( 12, 0xf, 2 ), - - // special - new aglsl.assembler.Sampler( 16, 1, 1 ), - new aglsl.assembler.Sampler( 16, 4, 4 ), - - // repeat - new aglsl.assembler.Sampler( 20, 0xf, 0 ), - new aglsl.assembler.Sampler( 20, 0xf, 1 ), - new aglsl.assembler.Sampler( 20, 0xf, 1 ), - - // mip - new aglsl.assembler.Sampler( 24, 0xf, 0 ), - new aglsl.assembler.Sampler( 24, 0xf, 0 ), - new aglsl.assembler.Sampler( 24, 0xf, 1 ), - new aglsl.assembler.Sampler( 24, 0xf, 2 ), - - // filter - new aglsl.assembler.Sampler( 28, 0xf, 0 ), - new aglsl.assembler.Sampler( 28, 0xf, 1 ) ] - */ - /* - public static rgba: aglsl.assembler.Sampler = new aglsl.assembler.Sampler( 8, 0xf, 0 ); - public static rg: aglsl.assembler.Sampler = new aglsl.assembler.Sampler( 8, 0xf, 5 ); - public static r: aglsl.assembler.Sampler = new aglsl.assembler.Sampler( 8, 0xf, 4 ); - public static compressed: aglsl.assembler.Sampler = new aglsl.assembler.Sampler( 8, 0xf, 1 ); - public static compressed_alpha: aglsl.assembler.Sampler = new aglsl.assembler.Sampler( 8, 0xf, 2 ); - public static dxt1: aglsl.assembler.Sampler = new aglsl.assembler.Sampler( 8, 0xf, 1 ); - public static dxt5: aglsl.assembler.Sampler = new aglsl.assembler.Sampler( 8, 0xf, 2 ); - - // dimension - public static sampler2d: aglsl.assembler.Sampler = new aglsl.assembler.Sampler( 12, 0xf, 0 ); - public static cube: aglsl.assembler.Sampler = new aglsl.assembler.Sampler( 12, 0xf, 1 ); - public static sampler3d: aglsl.assembler.Sampler = new aglsl.assembler.Sampler( 12, 0xf, 2 ); - - // special - public static centroid: aglsl.assembler.Sampler = new aglsl.assembler.Sampler( 16, 1, 1 ); - public static ignoresampler: aglsl.assembler.Sampler = new aglsl.assembler.Sampler( 16, 4, 4 ); - - // repeat - public static clamp: aglsl.assembler.Sampler = new aglsl.assembler.Sampler( 20, 0xf, 0 ); - public static repeat: aglsl.assembler.Sampler = new aglsl.assembler.Sampler( 20, 0xf, 1 ); - public static wrap: aglsl.assembler.Sampler = new aglsl.assembler.Sampler( 20, 0xf, 1 ); - - // mip - public static nomip: aglsl.assembler.Sampler = new aglsl.assembler.Sampler( 24, 0xf, 0 ); - public static mipnone: aglsl.assembler.Sampler = new aglsl.assembler.Sampler( 24, 0xf, 0 ); - public static mipnearest: aglsl.assembler.Sampler = new aglsl.assembler.Sampler( 24, 0xf, 1 ); - public static miplinear: aglsl.assembler.Sampler = new aglsl.assembler.Sampler( 24, 0xf, 2 ); - - // filter - public static nearest: aglsl.assembler.Sampler = new aglsl.assembler.Sampler( 28, 0xf, 0 ); - public static linear: aglsl.assembler.Sampler = new aglsl.assembler.Sampler( 28, 0xf, 1 ); - */ - function SamplerMap() { - } - Object.defineProperty(SamplerMap, "map", { - get: function () { - if (!SamplerMap._map) { - SamplerMap._map = new Array(); - SamplerMap._map['rgba'] = new aglsl.assembler.Sampler(8, 0xf, 0); - SamplerMap._map['rg'] = new aglsl.assembler.Sampler(8, 0xf, 5); - SamplerMap._map['r'] = new aglsl.assembler.Sampler(8, 0xf, 4); - SamplerMap._map['compressed'] = new aglsl.assembler.Sampler(8, 0xf, 1); - SamplerMap._map['compressed_alpha'] = new aglsl.assembler.Sampler(8, 0xf, 2); - SamplerMap._map['dxt1'] = new aglsl.assembler.Sampler(8, 0xf, 1); - SamplerMap._map['dxt5'] = new aglsl.assembler.Sampler(8, 0xf, 2); - - // dimension - SamplerMap._map['2d'] = new aglsl.assembler.Sampler(12, 0xf, 0); - SamplerMap._map['cube'] = new aglsl.assembler.Sampler(12, 0xf, 1); - SamplerMap._map['3d'] = new aglsl.assembler.Sampler(12, 0xf, 2); - - // special - SamplerMap._map['centroid'] = new aglsl.assembler.Sampler(16, 1, 1); - SamplerMap._map['ignoresampler'] = new aglsl.assembler.Sampler(16, 4, 4); - - // repeat - SamplerMap._map['clamp'] = new aglsl.assembler.Sampler(20, 0xf, 0); - SamplerMap._map['repeat'] = new aglsl.assembler.Sampler(20, 0xf, 1); - SamplerMap._map['wrap'] = new aglsl.assembler.Sampler(20, 0xf, 1); - - // mip - SamplerMap._map['nomip'] = new aglsl.assembler.Sampler(24, 0xf, 0); - SamplerMap._map['mipnone'] = new aglsl.assembler.Sampler(24, 0xf, 0); - SamplerMap._map['mipnearest'] = new aglsl.assembler.Sampler(24, 0xf, 1); - SamplerMap._map['miplinear'] = new aglsl.assembler.Sampler(24, 0xf, 2); - - // filter - SamplerMap._map['nearest'] = new aglsl.assembler.Sampler(28, 0xf, 0); - SamplerMap._map['linear'] = new aglsl.assembler.Sampler(28, 0xf, 1); - } - - return SamplerMap._map; - }, - enumerable: true, - configurable: true - }); - return SamplerMap; - })(); - assembler.SamplerMap = SamplerMap; - })(aglsl.assembler || (aglsl.assembler = {})); - var assembler = aglsl.assembler; -})(aglsl || (aglsl = {})); -/// -var aglsl; -(function (aglsl) { - (function (assembler) { - var AGALMiniAssembler = (function () { - function AGALMiniAssembler() { - this.r = {}; - this.cur = new aglsl.assembler.Part(); - } - AGALMiniAssembler.prototype.assemble = function (source, ext_part, ext_version) { - if (typeof ext_part === "undefined") { ext_part = null; } - if (typeof ext_version === "undefined") { ext_version = null; } - if (!ext_version) { - ext_version = 1; - } - - if (ext_part) { - this.addHeader(ext_part, ext_version); - } - - var lines = source.replace(/[\f\n\r\v]+/g, "\n").split("\n"); - - for (var i in lines) { - this.processLine(lines[i], i); - } - - return this.r; - }; - - AGALMiniAssembler.prototype.processLine = function (line, linenr) { - var startcomment = line.search("//"); - if (startcomment != -1) { - line = line.slice(0, startcomment); - } - line = line.replace(/^\s+|\s+$/g, ""); // remove outer space - if (!(line.length > 0)) { - return; - } - var optsi = line.search(/<.*>/g); - var opts = null; - if (optsi != -1) { - opts = line.slice(optsi).match(/([\w\.\-\+]+)/gi); - line = line.slice(0, optsi); - } - - // get opcode/command - var tokens = line.match(/([\w\.\+\[\]]+)/gi); - if (!tokens || tokens.length < 1) { - if (line.length >= 3) { - console.log("Warning: bad line " + linenr + ": " + line); - } - return; - } - - switch (tokens[0]) { - case "part": - this.addHeader(tokens[1], Number(tokens[2])); - break; - case "endpart": - if (!this.cur) { - throw "Unexpected endpart"; - } - this.cur.data.position = 0; - this.cur = null; - return; - default: - if (!this.cur) { - console.log("Warning: bad line " + linenr + ": " + line + " (Outside of any part definition)"); - return; - } - if (this.cur.name == "comment") { - return; - } - var op = assembler.OpcodeMap.map[tokens[0]]; - if (!op) { - throw "Bad opcode " + tokens[0] + " " + linenr + ": " + line; - } - - // console.log( 'AGALMiniAssembler' , 'op' , op ); - this.emitOpcode(this.cur, op.opcode); - var ti = 1; - if (op.dest && op.dest != "none") { - if (!this.emitDest(this.cur, tokens[ti++], op.dest)) { - throw "Bad destination register " + tokens[ti - 1] + " " + linenr + ": " + line; - } - } else { - this.emitZeroDword(this.cur); - } - - if (op.a && op.a.format != "none") { - if (!this.emitSource(this.cur, tokens[ti++], op.a)) - throw "Bad source register " + tokens[ti - 1] + " " + linenr + ": " + line; - } else { - this.emitZeroQword(this.cur); - } - - if (op.b && op.b.format != "none") { - if (op.b.format == "sampler") { - if (!this.emitSampler(this.cur, tokens[ti++], op.b, opts)) { - throw "Bad sampler register " + tokens[ti - 1] + " " + linenr + ": " + line; - } - } else { - if (!this.emitSource(this.cur, tokens[ti++], op.b)) { - throw "Bad source register " + tokens[ti - 1] + " " + linenr + ": " + line; - } - } - } else { - this.emitZeroQword(this.cur); - } - break; - } - }; - - AGALMiniAssembler.prototype.emitHeader = function (pr) { - pr.data.writeUnsignedByte(0xa0); // tag version - pr.data.writeUnsignedInt(pr.version); - if (pr.version >= 0x10) { - pr.data.writeUnsignedByte(0); // align, for higher versions - } - pr.data.writeUnsignedByte(0xa1); // tag program id - switch (pr.name) { - case "fragment": - pr.data.writeUnsignedByte(1); - break; - case "vertex": - pr.data.writeUnsignedByte(0); - break; - case "cpu": - pr.data.writeUnsignedByte(2); - break; - default: - pr.data.writeUnsignedByte(0xff); - break; - } - }; - - AGALMiniAssembler.prototype.emitOpcode = function (pr, opcode) { - pr.data.writeUnsignedInt(opcode); - //console.log ( "Emit opcode: ", opcode ); - }; - - AGALMiniAssembler.prototype.emitZeroDword = function (pr) { - pr.data.writeUnsignedInt(0); - }; - - AGALMiniAssembler.prototype.emitZeroQword = function (pr) { - pr.data.writeUnsignedInt(0); - pr.data.writeUnsignedInt(0); - }; - - AGALMiniAssembler.prototype.emitDest = function (pr, token, opdest) { - //console.log( 'aglsl.assembler.AGALMiniAssembler' , 'emitDest' , 'RegMap.map' , RegMap.map); - var reg = token.match(/([fov]?[tpocidavs])(\d*)(\.[xyzw]{1,4})?/i); - - // console.log( 'aglsl.assembler.AGALMiniAssembler' , 'emitDest' , 'reg' , reg , reg[1] , RegMap.map[reg[1]] ); - // console.log( 'aglsl.assembler.AGALMiniAssembler' , 'emitDest' , 'RegMap.map[reg[1]]' , RegMap.map[reg[1]] , 'bool' , !RegMap.map[reg[1]] ) ; - if (!assembler.RegMap.map[reg[1]]) - return false; - var em = { num: reg[2] ? reg[2] : 0, code: assembler.RegMap.map[reg[1]].code, mask: this.stringToMask(reg[3]) }; - pr.data.writeUnsignedShort(em.num); - pr.data.writeUnsignedByte(em.mask); - pr.data.writeUnsignedByte(em.code); - - //console.log ( " Emit dest: ", em ); - return true; - }; - - AGALMiniAssembler.prototype.stringToMask = function (s) { - if (!s) - return 0xf; - var r = 0; - if (s.indexOf("x") != -1) - r |= 1; - if (s.indexOf("y") != -1) - r |= 2; - if (s.indexOf("z") != -1) - r |= 4; - if (s.indexOf("w") != -1) - r |= 8; - return r; - }; - - AGALMiniAssembler.prototype.stringToSwizzle = function (s) { - if (!s) { - return 0xe4; - } - var chartoindex = { x: 0, y: 1, z: 2, w: 3 }; - var sw = 0; - - if (s.charAt(0) != ".") { - throw "Missing . for swizzle"; - } - - if (s.length > 1) { - sw |= chartoindex[s.charAt(1)]; - } - - if (s.length > 2) { - sw |= chartoindex[s.charAt(2)] << 2; - } else { - sw |= (sw & 3) << 2; - } - - if (s.length > 3) { - sw |= chartoindex[s.charAt(3)] << 4; - } else { - sw |= (sw & (3 << 2)) << 2; - } - - if (s.length > 4) { - sw |= chartoindex[s.charAt(4)] << 6; - } else { - sw |= (sw & (3 << 4)) << 2; - } - - return sw; - }; - - AGALMiniAssembler.prototype.emitSampler = function (pr, token, opsrc, opts) { - var reg = token.match(/fs(\d*)/i); - if (!reg || !reg[1]) { - return false; - } - pr.data.writeUnsignedShort(parseInt(reg[1])); - pr.data.writeUnsignedByte(0); // bias - pr.data.writeUnsignedByte(0); - - /* - pr.data.writeUnsignedByte ( 0x5 ); - pr.data.writeUnsignedByte ( 0 ); // readmode, dim - pr.data.writeUnsignedByte ( 0 ); // special, wrap - pr.data.writeUnsignedByte ( 0 ); // mip, filter - */ - var samplerbits = 0x5; - var sampleroptset = 0; - for (var i = 0; i < opts.length; i++) { - var o = assembler.SamplerMap.map[opts[i].toLowerCase()]; - - //console.log( 'AGALMiniAssembler' , 'emitSampler' , 'SampleMap opt:' , o , '<-------- WATCH FOR THIS'); - if (o) { - if (((sampleroptset >> o.shift) & o.mask) != 0) { - console.log("Warning, duplicate sampler option"); - } - sampleroptset |= o.mask << o.shift; - samplerbits &= ~(o.mask << o.shift); - samplerbits |= o.value << o.shift; - } else { - console.log("Warning, unknown sampler option: ", opts[i]); - // todo bias - } - } - pr.data.writeUnsignedInt(samplerbits); - return true; - }; - - AGALMiniAssembler.prototype.emitSource = function (pr, token, opsrc) { - var indexed = token.match(/vc\[(v[tcai])(\d+)\.([xyzw])([\+\-]\d+)?\](\.[xyzw]{1,4})?/i); - var reg; - if (indexed) { - if (!assembler.RegMap.map[indexed[1]]) { - return false; - } - var selindex = { x: 0, y: 1, z: 2, w: 3 }; - var em = { num: indexed[2] | 0, code: assembler.RegMap.map[indexed[1]].code, swizzle: this.stringToSwizzle(indexed[5]), select: selindex[indexed[3]], offset: indexed[4] | 0 }; - pr.data.writeUnsignedShort(em.num); - pr.data.writeByte(em.offset); - pr.data.writeUnsignedByte(em.swizzle); - pr.data.writeUnsignedByte(0x1); // constant reg - pr.data.writeUnsignedByte(em.code); - pr.data.writeUnsignedByte(em.select); - pr.data.writeUnsignedByte(1 << 7); - } else { - reg = token.match(/([fov]?[tpocidavs])(\d*)(\.[xyzw]{1,4})?/i); // g1: regname, g2:regnum, g3:swizzle - if (!assembler.RegMap.map[reg[1]]) { - return false; - } - var em = { num: reg[2] | 0, code: assembler.RegMap.map[reg[1]].code, swizzle: this.stringToSwizzle(reg[3]) }; - pr.data.writeUnsignedShort(em.num); - pr.data.writeUnsignedByte(0); - pr.data.writeUnsignedByte(em.swizzle); - pr.data.writeUnsignedByte(em.code); - pr.data.writeUnsignedByte(0); - pr.data.writeUnsignedByte(0); - pr.data.writeUnsignedByte(0); - //console.log ( " Emit source: ", em, pr.data.length ); - } - return true; - }; - - AGALMiniAssembler.prototype.addHeader = function (partname, version) { - if (!version) { - version = 1; - } - if (this.r[partname] == undefined) { - this.r[partname] = new aglsl.assembler.Part(partname, version); - this.emitHeader(this.r[partname]); - } else if (this.r[partname].version != version) { - throw "Multiple versions for part " + partname; - } - this.cur = this.r[partname]; - }; - return AGALMiniAssembler; - })(); - assembler.AGALMiniAssembler = AGALMiniAssembler; - })(aglsl.assembler || (aglsl.assembler = {})); - var assembler = aglsl.assembler; -})(aglsl || (aglsl = {})); -/// -var aglsl; -(function (aglsl) { - var AGALTokenizer = (function () { - function AGALTokenizer() { - } - AGALTokenizer.prototype.decribeAGALByteArray = function (bytes) { - var header = new aglsl.Header(); - - if (bytes.readUnsignedByte() != 0xa0) { - throw "Bad AGAL: Missing 0xa0 magic byte."; - } - - header.version = bytes.readUnsignedInt(); - if (header.version >= 0x10) { - bytes.readUnsignedByte(); - header.version >>= 1; - } - if (bytes.readUnsignedByte() != 0xa1) { - throw "Bad AGAL: Missing 0xa1 magic byte."; - } - - header.progid = bytes.readUnsignedByte(); - switch (header.progid) { - case 1: - header.type = "fragment"; - break; - case 0: - header.type = "vertex"; - break; - case 2: - header.type = "cpu"; - break; - default: - header.type = ""; - break; - } - - var desc = new aglsl.Description(); - var tokens = []; - while (bytes.position < bytes.length) { - var token = new aglsl.Token(); - - token.opcode = bytes.readUnsignedInt(); - var lutentry = aglsl.Mapping.agal2glsllut[token.opcode]; - if (!lutentry) { - throw "Opcode not valid or not implemented yet: " + token.opcode; - } - if (lutentry.matrixheight) { - desc.hasmatrix = true; - } - if (lutentry.dest) { - token.dest.regnum = bytes.readUnsignedShort(); - token.dest.mask = bytes.readUnsignedByte(); - token.dest.regtype = bytes.readUnsignedByte(); - desc.regwrite[token.dest.regtype][token.dest.regnum] |= token.dest.mask; - } else { - token.dest = null; - bytes.readUnsignedInt(); - } - if (lutentry.a) { - this.readReg(token.a, 1, desc, bytes); - } else { - token.a = null; - bytes.readUnsignedInt(); - bytes.readUnsignedInt(); - } - if (lutentry.b) { - this.readReg(token.b, lutentry.matrixheight | 0, desc, bytes); - } else { - token.b = null; - bytes.readUnsignedInt(); - bytes.readUnsignedInt(); - } - tokens.push(token); - } - desc.header = header; - desc.tokens = tokens; - - return desc; - }; - - AGALTokenizer.prototype.readReg = function (s, mh, desc, bytes) { - s.regnum = bytes.readUnsignedShort(); - s.indexoffset = bytes.readByte(); - s.swizzle = bytes.readUnsignedByte(); - s.regtype = bytes.readUnsignedByte(); - desc.regread[s.regtype][s.regnum] = 0xf; // sould be swizzle to mask? should be |= - if (s.regtype == 0x5) { - // sampler - s.lodbiad = s.indexoffset; - s.indexoffset = undefined; - s.swizzle = undefined; - - // sampler - s.readmode = bytes.readUnsignedByte(); - s.dim = s.readmode >> 4; - s.readmode &= 0xf; - s.special = bytes.readUnsignedByte(); - s.wrap = s.special >> 4; - s.special &= 0xf; - s.mipmap = bytes.readUnsignedByte(); - s.filter = s.mipmap >> 4; - s.mipmap &= 0xf; - desc.samplers[s.regnum] = s; - } else { - s.indexregtype = bytes.readUnsignedByte(); - s.indexselect = bytes.readUnsignedByte(); - s.indirectflag = bytes.readUnsignedByte(); - } - if (s.indirectflag) { - desc.hasindirect = true; - } - if (!s.indirectflag && mh) { - for (var mhi = 0; mhi < mh; mhi++) { - desc.regread[s.regtype][s.regnum + mhi] = desc.regread[s.regtype][s.regnum]; - } - } - }; - return AGALTokenizer; - })(); - aglsl.AGALTokenizer = AGALTokenizer; -})(aglsl || (aglsl = {})); -/// -var aglsl; -(function (aglsl) { - var AGLSLParser = (function () { - function AGLSLParser() { - } - AGLSLParser.prototype.parse = function (desc) { - var header = ""; - var body = ""; - - header += "precision highp float;\n"; - var tag = desc.header.type[0]; - - // declare uniforms - if (desc.header.type == "vertex") { - header += "uniform float yflip;\n"; - } - if (!desc.hasindirect) { - for (var i = 0; i < desc.regread[0x1].length; i++) { - if (desc.regread[0x1][i]) { - header += "uniform vec4 " + tag + "c" + i + ";\n"; - } - } - } else { - header += "uniform vec4 " + tag + "carrr[" + away.stagegl.ContextStage3D.maxvertexconstants + "];\n"; // use max const count instead - } - - for (var i = 0; i < desc.regread[0x2].length || i < desc.regwrite[0x2].length; i++) { - if (desc.regread[0x2][i] || desc.regwrite[0x2][i]) { - header += "vec4 " + tag + "t" + i + ";\n"; - } - } - - for (var i = 0; i < desc.regread[0x0].length; i++) { - if (desc.regread[0x0][i]) { - header += "attribute vec4 va" + i + ";\n"; - } - } - - for (var i = 0; i < desc.regread[0x4].length || i < desc.regwrite[0x4].length; i++) { - if (desc.regread[0x4][i] || desc.regwrite[0x4][i]) { - header += "varying vec4 vi" + i + ";\n"; - } - } - - // declare samplers - var samptype = ["2D", "Cube", "3D", ""]; - for (var i = 0; i < desc.samplers.length; i++) { - if (desc.samplers[i]) { - header += "uniform sampler" + samptype[desc.samplers[i].dim & 3] + " fs" + i + ";\n"; - } - } - - // extra gl fluff: setup position and depth adjust temps - if (desc.header.type == "vertex") { - header += "vec4 outpos;\n"; - } - if (desc.writedepth) { - header += "vec4 tmp_FragDepth;\n"; - } - - //if ( desc.hasmatrix ) - // header += "vec4 tmp_matrix;\n"; - // start body of code - body += "void main() {\n"; - - for (var i = 0; i < desc.tokens.length; i++) { - var lutentry = aglsl.Mapping.agal2glsllut[desc.tokens[i].opcode]; - if (!lutentry) { - throw "Opcode not valid or not implemented yet: "; - /*+token.opcode;*/ - } - var sublines = lutentry.matrixheight || 1; - - for (var sl = 0; sl < sublines; sl++) { - var line = " " + lutentry.s; - if (desc.tokens[i].dest) { - if (lutentry.matrixheight) { - if (((desc.tokens[i].dest.mask >> sl) & 1) != 1) { - continue; - } - var destregstring = this.regtostring(desc.tokens[i].dest.regtype, desc.tokens[i].dest.regnum, desc, tag); - var destcaststring = "float"; - var destmaskstring = ["x", "y", "z", "w"][sl]; - destregstring += "." + destmaskstring; - } else { - var destregstring = this.regtostring(desc.tokens[i].dest.regtype, desc.tokens[i].dest.regnum, desc, tag); - var destcaststring; - var destmaskstring; - if (desc.tokens[i].dest.mask != 0xf) { - var ndest = 0; - destmaskstring = ""; - if (desc.tokens[i].dest.mask & 1) { - ndest++; - destmaskstring += "x"; - } - if (desc.tokens[i].dest.mask & 2) { - ndest++; - destmaskstring += "y"; - } - if (desc.tokens[i].dest.mask & 4) { - ndest++; - destmaskstring += "z"; - } - if (desc.tokens[i].dest.mask & 8) { - ndest++; - destmaskstring += "w"; - } - destregstring += "." + destmaskstring; - switch (ndest) { - case 1: - destcaststring = "float"; - break; - case 2: - destcaststring = "vec2"; - break; - case 3: - destcaststring = "vec3"; - break; - default: - throw "Unexpected destination mask"; - } - } else { - destcaststring = "vec4"; - destmaskstring = "xyzw"; - } - } - line = line.replace("%dest", destregstring); - line = line.replace("%cast", destcaststring); - line = line.replace("%dm", destmaskstring); - } - var dwm = 0xf; - if (!lutentry.ndwm && lutentry.dest && desc.tokens[i].dest) { - dwm = desc.tokens[i].dest.mask; - } - if (desc.tokens[i].a) { - line = line.replace("%a", this.sourcetostring(desc.tokens[i].a, 0, dwm, lutentry.scalar, desc, tag)); - } - if (desc.tokens[i].b) { - line = line.replace("%b", this.sourcetostring(desc.tokens[i].b, sl, dwm, lutentry.scalar, desc, tag)); - if (desc.tokens[i].b.regtype == 0x5) { - // sampler dim - var texdim = ["2D", "Cube", "3D"][desc.tokens[i].b.dim]; - var texsize = ["vec2", "vec3", "vec3"][desc.tokens[i].b.dim]; - line = line.replace("%texdim", texdim); - line = line.replace("%texsize", texsize); - var texlod = ""; - line = line.replace("%lod", texlod); - } - } - body += line; - } - } - - // adjust z from opengl range of -1..1 to 0..1 as in d3d, this also enforces a left handed coordinate system - if (desc.header.type == "vertex") { - body += " gl_Position = vec4(outpos.x, outpos.y, outpos.z*2.0 - outpos.w, outpos.w);\n"; - } - - // clamp fragment depth - if (desc.writedepth) { - body += " gl_FragDepth = clamp(tmp_FragDepth,0.0,1.0);\n"; - } - - // close main - body += "}\n"; - - return header + body; - }; - - AGLSLParser.prototype.regtostring = function (regtype, regnum, desc, tag) { - switch (regtype) { - case 0x0: - return "va" + regnum; - case 0x1: - if (desc.hasindirect && desc.header.type == "vertex") { - return "vcarrr[" + regnum + "]"; - } else { - return tag + "c" + regnum; - } - case 0x2: - return tag + "t" + regnum; - case 0x3: - return desc.header.type == "vertex" ? "outpos" : "gl_FragColor"; - case 0x4: - return "vi" + regnum; - case 0x5: - return "fs" + regnum; - case 0x6: - return "tmp_FragDepth"; - default: - throw "Unknown register type"; - } - }; - - AGLSLParser.prototype.sourcetostring = function (s, subline, dwm, isscalar, desc, tag) { - var swiz = ["x", "y", "z", "w"]; - var r; - - if (s.indirectflag) { - r = "vcarrr[int(" + this.regtostring(s.indexregtype, s.regnum, desc, tag) + "." + swiz[s.indexselect] + ")"; - var realofs = subline + s.indexoffset; - if (realofs < 0) - r += realofs.toString(); - if (realofs > 0) - r += "+" + realofs.toString(); - r += "]"; - } else { - r = this.regtostring(s.regtype, s.regnum + subline, desc, tag); - } - - // samplers never add swizzle - if (s.regtype == 0x5) { - return r; - } - - // scalar, first component only - if (isscalar) { - return r + "." + swiz[(s.swizzle >> 0) & 3]; - } - - // identity - if (s.swizzle == 0xe4 && dwm == 0xf) { - return r; - } - - // with destination write mask folded in - r += "."; - if (dwm & 1) - r += swiz[(s.swizzle >> 0) & 3]; - if (dwm & 2) - r += swiz[(s.swizzle >> 2) & 3]; - if (dwm & 4) - r += swiz[(s.swizzle >> 4) & 3]; - if (dwm & 8) - r += swiz[(s.swizzle >> 6) & 3]; - return r; - }; - return AGLSLParser; - })(); - aglsl.AGLSLParser = AGLSLParser; -})(aglsl || (aglsl = {})); -/// -var __extends = this.__extends || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); -}; -var away; -(function (away) { - (function (events) { - /** - * Dispatched to notify changes in an animator's state. - */ - var AnimatorEvent = (function (_super) { - __extends(AnimatorEvent, _super); - /** - * Create a new AnimatorEvent object. - * - * @param type The event type. - * @param animator The animator object that is the subject of this event. - */ - function AnimatorEvent(type, animator) { - _super.call(this, type); - this._animator = animator; - } - Object.defineProperty(AnimatorEvent.prototype, "animator", { - get: function () { - return this._animator; - }, - enumerable: true, - configurable: true - }); - - /** - * Clones the event. - * - * @return An exact duplicate of the current event object. - */ - AnimatorEvent.prototype.clone = function () { - return new AnimatorEvent(this.type, this._animator); - }; - AnimatorEvent.START = "start"; - - AnimatorEvent.STOP = "stop"; - - AnimatorEvent.CYCLE_COMPLETE = "cycle_complete"; - return AnimatorEvent; - })(events.Event); - events.AnimatorEvent = AnimatorEvent; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -var away; -(function (away) { - /// - /** - * @module away.events - */ - (function (events) { - //import flash.events.Event; - var ShadingMethodEvent = (function (_super) { - __extends(ShadingMethodEvent, _super); - function ShadingMethodEvent(type) { - _super.call(this, type); - } - ShadingMethodEvent.SHADER_INVALIDATED = "ShaderInvalidated"; - return ShadingMethodEvent; - })(away.events.Event); - events.ShadingMethodEvent = ShadingMethodEvent; - })(away.events || (away.events = {})); - var events = away.events; -})(away || (away = {})); -var away; -(function (away) { - (function (errors) { - var AnimationSetError = (function (_super) { - __extends(AnimationSetError, _super); - function AnimationSetError(message) { - _super.call(this, message); - } - return AnimationSetError; - })(errors.Error); - errors.AnimationSetError = AnimationSetError; - })(away.errors || (away.errors = {})); - var errors = away.errors; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.pool - */ - (function (_pool) { - var SubGeometryEvent = away.events.SubGeometryEvent; - - /** - * @class away.pool.RenderableListItem - */ - var RenderableBase = (function () { - /** - * - * @param sourceEntity - * @param materialOwner - * @param subGeometry - * @param animationSubGeometry - */ - function RenderableBase(pool, sourceEntity, materialOwner, level, indexOffset) { - if (typeof level === "undefined") { level = 0; } - if (typeof indexOffset === "undefined") { indexOffset = 0; } - var _this = this; - this._geometryDirty = true; - this._indexDataDirty = true; - this._vertexData = new Object(); - this._pVertexDataDirty = new Object(); - this._vertexOffset = new Object(); - this._onIndicesUpdatedDelegate = function (event) { - return _this._onIndicesUpdated(event); - }; - this._onVerticesUpdatedDelegate = function (event) { - return _this._onVerticesUpdated(event); - }; - - //store a reference to the pool for later disposal - this._pool = pool; - - //reference to level of overflow - this._level = level; - - //reference to the offset on indices (if this is an overflow renderable) - this._indexOffset = indexOffset; - - this.sourceEntity = sourceEntity; - this.materialOwner = materialOwner; - } - Object.defineProperty(RenderableBase.prototype, "overflow", { - /** - * - */ - get: function () { - if (this._indexDataDirty) - this._updateIndexData(); - - return this._overflow; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(RenderableBase.prototype, "numTriangles", { - /** - * - */ - get: function () { - return this._numTriangles; - }, - enumerable: true, - configurable: true - }); - - /** - * - */ - RenderableBase.prototype.getIndexData = function () { - if (this._indexDataDirty) - this._updateIndexData(); - - return this._indexData; - }; - - /** - * - */ - RenderableBase.prototype.getVertexData = function (dataType) { - if (this._indexDataDirty) - this._updateIndexData(); - - if (this._pVertexDataDirty[dataType]) - this._updateVertexData(dataType); - - return this._vertexData[this._concatenateArrays ? away.base.TriangleSubGeometry.VERTEX_DATA : dataType]; - }; - - /** - * - */ - RenderableBase.prototype.getVertexOffset = function (dataType) { - if (this._indexDataDirty) - this._updateIndexData(); - - if (this._pVertexDataDirty[dataType]) - this._updateVertexData(dataType); - - return this._vertexOffset[dataType]; - }; - - RenderableBase.prototype.dispose = function () { - this._pool.disposeItem(this.materialOwner); - - this._indexData.dispose(); - this._indexData = null; - - for (var dataType in this._vertexData) { - this._vertexData[dataType].dispose(); - this._vertexData[dataType] = null; - } - - if (this._overflow) { - this._overflow.dispose(); - this._overflow = null; - } - }; - - RenderableBase.prototype.invalidateGeometry = function () { - this._geometryDirty = true; - - //invalidate indices - if (this._level == 0) - this._indexDataDirty = true; - - if (this._overflow) - this._overflow.invalidateGeometry(); - }; - - /** - * - */ - RenderableBase.prototype.invalidateIndexData = function () { - this._indexDataDirty = true; - }; - - /** - * //TODO - * - * @param dataType - */ - RenderableBase.prototype.invalidateVertexData = function (dataType) { - this._pVertexDataDirty[dataType] = true; - }; - - RenderableBase.prototype._pGetSubGeometry = function () { - throw new away.errors.AbstractMethodError(); - }; - - /** - * //TODO - * - * @param subGeometry - * @param offset - * @internal - */ - RenderableBase.prototype._iFillIndexData = function (indexOffset) { - if (this._geometryDirty) - this._updateGeometry(); - - this._indexData = away.pool.IndexDataPool.getItem(this._subGeometry, this._level, indexOffset); - - this._numTriangles = this._indexData.data.length / 3; - - indexOffset = this._indexData.offset; - - //check if there is more to split - if (indexOffset < this._subGeometry.indices.length) { - if (!this._overflow) - this._overflow = this._pGetOverflowRenderable(this._pool, this.materialOwner, indexOffset, this._level + 1); - - this._overflow._iFillIndexData(indexOffset); - } else if (this._overflow) { - this._overflow.dispose(); - this._overflow = null; - } - }; - - RenderableBase.prototype._pGetOverflowRenderable = function (pool, materialOwner, level, indexOffset) { - throw new away.errors.AbstractMethodError(); - }; - - /** - * //TODO - * - * @private - */ - RenderableBase.prototype._updateGeometry = function () { - if (this._subGeometry) { - if (this._level == 0) - this._subGeometry.removeEventListener(SubGeometryEvent.INDICES_UPDATED, this._onIndicesUpdatedDelegate); - this._subGeometry.removeEventListener(SubGeometryEvent.VERTICES_UPDATED, this._onVerticesUpdatedDelegate); - } - - this._subGeometry = this._pGetSubGeometry(); - - this._concatenateArrays = this._subGeometry.concatenateArrays; - - if (this._subGeometry) { - if (this._level == 0) - this._subGeometry.addEventListener(SubGeometryEvent.INDICES_UPDATED, this._onIndicesUpdatedDelegate); - this._subGeometry.addEventListener(SubGeometryEvent.VERTICES_UPDATED, this._onVerticesUpdatedDelegate); - } - - //dispose - // if (this._indexData) { - // this._indexData.dispose(); //TODO where is a good place to dispose? - // this._indexData = null; - // } - // for (var dataType in this._vertexData) { - // ( this._vertexData[dataType]).dispose(); //TODO where is a good place to dispose? - // this._vertexData[dataType] = null; - // } - this._geometryDirty = false; - //specific vertex data types have to be invalidated in the specific renderable - }; - - /** - * //TODO - * - * @private - */ - RenderableBase.prototype._updateIndexData = function () { - this._iFillIndexData(this._indexOffset); - - this._indexDataDirty = false; - }; - - /** - * //TODO - * - * @param dataType - * @private - */ - RenderableBase.prototype._updateVertexData = function (dataType) { - this._vertexOffset[dataType] = this._subGeometry.getOffset(dataType); - - if (this._subGeometry.concatenateArrays) - dataType = away.base.SubGeometryBase.VERTEX_DATA; - - this._vertexData[dataType] = away.pool.VertexDataPool.getItem(this._subGeometry, this.getIndexData(), dataType); - - this._pVertexDataDirty[dataType] = false; - }; - - /** - * //TODO - * - * @param event - * @private - */ - RenderableBase.prototype._onIndicesUpdated = function (event) { - this.invalidateIndexData(); - }; - - /** - * //TODO - * - * @param event - * @private - */ - RenderableBase.prototype._onVerticesUpdated = function (event) { - this._concatenateArrays = event.target.concatenateArrays; - - this.invalidateVertexData(event.dataType); - }; - return RenderableBase; - })(); - _pool.RenderableBase = RenderableBase; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.pool - */ - (function (_pool) { - var TriangleSubGeometry = away.base.TriangleSubGeometry; - - /** - * @class away.pool.RenderableListItem - */ - var BillboardRenderable = (function (_super) { - __extends(BillboardRenderable, _super); - /** - * //TODO - * - * @param pool - * @param billboard - */ - function BillboardRenderable(pool, billboard) { - _super.call(this, pool, billboard, billboard); - - this._billboard = billboard; - } - /** - * //TODO - * - * @returns {away.base.TriangleSubGeometry} - */ - BillboardRenderable.prototype._pGetSubGeometry = function () { - var material = this._billboard.material; - - var geometry = BillboardRenderable._materialGeometry[material.id]; - - if (!geometry) { - geometry = BillboardRenderable._materialGeometry[material.id] = new TriangleSubGeometry(true); - geometry.autoDeriveNormals = false; - geometry.autoDeriveTangents = false; - geometry.updateIndices(Array(0, 1, 2, 0, 2, 3)); - geometry.updatePositions(Array(0, material.height, 0, material.width, material.height, 0, material.width, 0, 0, 0, 0, 0)); - geometry.updateVertexNormals(Array(1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0)); - geometry.updateVertexTangents(Array(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1)); - geometry.updateUVs(Array(0, 0, 1, 0, 1, 1, 0, 1)); - } else { - geometry.updatePositions(Array(0, material.height, 0, material.width, material.height, 0, material.width, 0, 0, 0, 0, 0)); - } - - this._pVertexDataDirty[TriangleSubGeometry.POSITION_DATA] = true; - this._pVertexDataDirty[TriangleSubGeometry.NORMAL_DATA] = true; - this._pVertexDataDirty[TriangleSubGeometry.TANGENT_DATA] = true; - this._pVertexDataDirty[TriangleSubGeometry.UV_DATA] = true; - - return geometry; - }; - BillboardRenderable._materialGeometry = new Object(); - - BillboardRenderable.id = "billboard"; - return BillboardRenderable; - })(_pool.RenderableBase); - _pool.BillboardRenderable = BillboardRenderable; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.base - */ - (function (pool) { - /** - * - */ - var IndexData = (function () { - function IndexData(level) { - this._dataDirty = true; - this.invalid = new Array(8); - this.contexts = new Array(8); - this.buffers = new Array(8); - this.level = level; - } - IndexData.prototype.updateData = function (offset, indices, numVertices) { - if (this._dataDirty) { - this._dataDirty = false; - - if (indices.length < IndexData.LIMIT_INDICES && numVertices < IndexData.LIMIT_VERTS) { - //shortcut for those buffers that fit into the maximum buffer sizes - this.indexMappings = null; - this.originalIndices = null; - this.setData(indices); - this.offset = indices.length; - } else { - var i; - var len; - var outIndex; - var j; - var k; - var splitIndices = new Array(); - - this.indexMappings = new Array(indices.length); - this.originalIndices = new Array(); - - i = this.indexMappings.length; - - while (i--) - this.indexMappings[i] = -1; - - var originalIndex; - var splitIndex; - - // Loop over all triangles - outIndex = 0; - len = indices.length; - i = offset; - k = 0; - while (i < len && outIndex + 3 < IndexData.LIMIT_INDICES && k + 3 < IndexData.LIMIT_VERTS) { - for (j = 0; j < 3; j++) { - originalIndex = indices[i + j]; - - if (this.indexMappings[originalIndex] >= 0) { - splitIndex = this.indexMappings[originalIndex]; - } else { - // This vertex does not yet exist in the split list and - // needs to be copied from the long list. - splitIndex = k++; - this.indexMappings[originalIndex] = splitIndex; - this.originalIndices.push(originalIndex); - } - - // Store new index, which may have come from the mapping look-up, - // or from copying a new set of vertex data from the original vector - splitIndices[outIndex + j] = splitIndex; - } - - outIndex += 3; - i += 3; - } - - this.setData(splitIndices); - this.offset = i; - } - } - }; - - IndexData.prototype.invalidateData = function () { - this._dataDirty = true; - }; - - IndexData.prototype.dispose = function () { - for (var i = 0; i < 8; ++i) { - if (this.contexts[i]) { - this.contexts[i].disposeIndexData(this); - this.contexts[i] = null; - } - } - }; - - /** - * @private - */ - IndexData.prototype.disposeBuffers = function () { - for (var i = 0; i < 8; ++i) { - if (this.buffers[i]) { - this.buffers[i].dispose(); - this.buffers[i] = null; - } - } - }; - - /** - * @private - */ - IndexData.prototype.invalidateBuffers = function () { - for (var i = 0; i < 8; ++i) - this.invalid[i] = true; - }; - - /** - * - * @param data - * @private - */ - IndexData.prototype.setData = function (data) { - if (this.data && this.data.length != data.length) - this.disposeBuffers(); - else - this.invalidateBuffers(); - - this.data = data; - }; - IndexData.LIMIT_VERTS = 0xffff; - - IndexData.LIMIT_INDICES = 0xffffff; - return IndexData; - })(); - pool.IndexData = IndexData; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.base - */ - (function (pool) { - /** - * - */ - var IndexDataPool = (function () { - function IndexDataPool() { - } - IndexDataPool.getItem = function (subGeometry, level, indexOffset) { - var subGeometryData = (IndexDataPool._pool[subGeometry.id] || (IndexDataPool._pool[subGeometry.id] = new Array())); - - var indexData = subGeometryData[level] || (subGeometryData[level] = new pool.IndexData(level)); - indexData.updateData(indexOffset, subGeometry.indices, subGeometry.numVertices); - - return indexData; - }; - - IndexDataPool.disposeItem = function (id, level) { - var subGeometryData = this._pool[id]; - - subGeometryData[level].dispose(); - subGeometryData[level] = null; - }; - - IndexDataPool.prototype.disposeData = function (id) { - var subGeometryData = IndexDataPool._pool[id]; - - var len = subGeometryData.length; - for (var i = 0; i < len; i++) { - subGeometryData[i].dispose(); - subGeometryData[i] = null; - } - - IndexDataPool._pool[id] = null; - }; - IndexDataPool._pool = new Object(); - return IndexDataPool; - })(); - pool.IndexDataPool = IndexDataPool; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.pool - */ - (function (_pool) { - var LineSubGeometry = away.base.LineSubGeometry; - - /** - * @class away.pool.LineSubMeshRenderable - */ - var LineSubMeshRenderable = (function (_super) { - __extends(LineSubMeshRenderable, _super); - /** - * //TODO - * - * @param pool - * @param subMesh - * @param level - * @param dataOffset - */ - function LineSubMeshRenderable(pool, subMesh, level, indexOffset) { - if (typeof level === "undefined") { level = 0; } - if (typeof indexOffset === "undefined") { indexOffset = 0; } - _super.call(this, pool, subMesh.parentMesh, subMesh, level, indexOffset); - - this.subMesh = subMesh; - } - /** - * //TODO - * - * @returns {base.LineSubGeometry} - * @protected - */ - LineSubMeshRenderable.prototype._pGetSubGeometry = function () { - var subGeometry = this.subMesh.subGeometry; - - this._pVertexDataDirty[LineSubGeometry.START_POSITION_DATA] = true; - this._pVertexDataDirty[LineSubGeometry.END_POSITION_DATA] = true; - - if (subGeometry.thickness) - this._pVertexDataDirty[LineSubGeometry.THICKNESS_DATA] = true; - - if (subGeometry.startColors) - this._pVertexDataDirty[LineSubGeometry.COLOR_DATA] = true; - - return subGeometry; - }; - - /** - * //TODO - * - * @param pool - * @param materialOwner - * @param level - * @param indexOffset - * @returns {away.pool.LineSubMeshRenderable} - * @private - */ - LineSubMeshRenderable.prototype._pGetOverflowRenderable = function (pool, materialOwner, level, indexOffset) { - return new LineSubMeshRenderable(pool, materialOwner, level, indexOffset); - }; - LineSubMeshRenderable.id = "linesubmesh"; - return LineSubMeshRenderable; - })(_pool.RenderableBase); - _pool.LineSubMeshRenderable = LineSubMeshRenderable; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.pool - */ - (function (_pool) { - /** - * - * @class away.pool.ProgramDataBase - */ - var ProgramData = (function () { - function ProgramData(pool, context, key) { - this.usages = 0; - this._pool = pool; - this.context = context; - this._key = key; - this.context.registerProgram(this); - } - /** - * - */ - ProgramData.prototype.dispose = function () { - this.usages--; - - if (!this.usages) { - this._pool.disposeItem(this._key); - - this.context.unRegisterProgram(this); - - if (this.program) - this.program.dispose(); - } - - this.program = null; - }; - ProgramData.PROGRAMDATA_ID_COUNT = 0; - return ProgramData; - })(); - _pool.ProgramData = ProgramData; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.pool - */ - (function (pool) { - /** - * @class away.pool.ProgramDataPool - */ - var ProgramDataPool = (function () { - /** - * //TODO - * - * @param textureDataClass - */ - function ProgramDataPool(context) { - this._pool = new Object(); - this._context = context; - } - /** - * //TODO - * - * @param materialOwner - * @returns ITexture - */ - ProgramDataPool.prototype.getItem = function (key) { - return this._pool[key] || (this._pool[key] = new pool.ProgramData(this, this._context, key)); - }; - - /** - * //TODO - * - * @param materialOwner - */ - ProgramDataPool.prototype.disposeItem = function (key) { - this._pool[key] = null; - }; - return ProgramDataPool; - })(); - pool.ProgramDataPool = ProgramDataPool; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.pool - */ - (function (_pool) { - var TriangleSubGeometry = away.base.TriangleSubGeometry; - - /** - * @class away.pool.SkyboxRenderable - */ - var SkyboxRenderable = (function (_super) { - __extends(SkyboxRenderable, _super); - /** - * //TODO - * - * @param pool - * @param skybox - */ - function SkyboxRenderable(pool, skybox) { - _super.call(this, pool, skybox, skybox); - } - /** - * //TODO - * - * @returns {away.base.TriangleSubGeometry} - * @private - */ - SkyboxRenderable.prototype._pGetSubGeometry = function () { - var geometry = SkyboxRenderable._geometry; - - if (!geometry) { - geometry = SkyboxRenderable._geometry = new TriangleSubGeometry(true); - geometry.autoDeriveNormals = false; - geometry.autoDeriveTangents = false; - geometry.updateIndices(Array(0, 1, 2, 2, 3, 0, 6, 5, 4, 4, 7, 6, 2, 6, 7, 7, 3, 2, 4, 5, 1, 1, 0, 4, 4, 0, 3, 3, 7, 4, 2, 1, 5, 5, 6, 2)); - geometry.updatePositions(Array(-1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1)); - } - - this._pVertexDataDirty[TriangleSubGeometry.POSITION_DATA] = true; - - return geometry; - }; - SkyboxRenderable.id = "skybox"; - return SkyboxRenderable; - })(_pool.RenderableBase); - _pool.SkyboxRenderable = SkyboxRenderable; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.pool - */ - (function (_pool) { - /** - * - * @class away.pool.MaterialData - */ - var MaterialData = (function () { - function MaterialData(pool, context, material) { - this.invalidAnimation = true; - this._pool = pool; - this.context = context; - this.material = material; - - this._materialPassDataPool = new _pool.MaterialPassDataPool(material); - } - MaterialData.prototype.getMaterialPass = function (materialPass, profile) { - var materialPassData = this._materialPassDataPool.getItem(materialPass); - - if (!materialPassData.shaderObject) { - materialPassData.shaderObject = materialPass.createShaderObject(profile); - materialPassData.invalid = true; - } - - if (materialPassData.invalid) { - materialPassData.invalid = false; - var compiler = materialPassData.shaderObject.createCompiler(this.material, materialPass); - compiler.compile(); - - materialPassData.shadedTarget = compiler.shadedTarget; - materialPassData.vertexCode = compiler.vertexCode; - materialPassData.fragmentCode = compiler.fragmentCode; - materialPassData.postAnimationFragmentCode = compiler.postAnimationFragmentCode; - materialPassData.key = ""; - } - - return materialPassData; - }; - - MaterialData.prototype.getMaterialPasses = function (profile) { - if (this._passes == null) { - var passes = this.material._iScreenPasses; - var numPasses = passes.length; - - //reset the material passes in MaterialData - this._passes = new Array(numPasses); - - for (var i = 0; i < numPasses; i++) - this._passes[i] = this.getMaterialPass(passes[i], profile); - } - - return this._passes; - }; - - /** - * - */ - MaterialData.prototype.dispose = function () { - this._materialPassDataPool.disposePool(); - - this._materialPassDataPool = null; - - this._pool.disposeItem(this.material); - - this._passes = null; - }; - - /** - * - */ - MaterialData.prototype.invalidateMaterial = function () { - this._passes = null; - - this.invalidateAnimation(); - }; - - /** - * - */ - MaterialData.prototype.invalidateAnimation = function () { - this.invalidAnimation = true; - }; - return MaterialData; - })(); - _pool.MaterialData = MaterialData; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.pool - */ - (function (pool) { - /** - * @class away.pool.MaterialDataPool - */ - var MaterialDataPool = (function () { - /** - * //TODO - * - * @param textureDataClass - */ - function MaterialDataPool(context) { - this._pool = new Object(); - this._context = context; - } - /** - * //TODO - * - * @param materialOwner - * @returns ITexture - */ - MaterialDataPool.prototype.getItem = function (material) { - return (this._pool[material.id] || (this._pool[material.id] = material._iAddMaterialData(new pool.MaterialData(this, this._context, material)))); - }; - - /** - * //TODO - * - * @param materialOwner - */ - MaterialDataPool.prototype.disposeItem = function (material) { - material._iRemoveMaterialData(this._pool[material.id]); - - this._pool[material.id] = null; - }; - return MaterialDataPool; - })(); - pool.MaterialDataPool = MaterialDataPool; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.pool - */ - (function (_pool) { - /** - * - * @class away.pool.MaterialPassData - */ - var MaterialPassData = (function () { - function MaterialPassData(pool, material, materialPass) { - this.animationVertexCode = ""; - this.animationFragmentCode = ""; - this._pool = pool; - this.material = material; - this.materialPass = materialPass; - } - /** - * - */ - MaterialPassData.prototype.dispose = function () { - this._pool.disposeItem(this.materialPass); - - this.shaderObject.dispose(); - this.shaderObject = null; - - this.programData.dispose(); - this.programData = null; - }; - - /** - * - */ - MaterialPassData.prototype.invalidate = function () { - this.invalid = true; - }; - return MaterialPassData; - })(); - _pool.MaterialPassData = MaterialPassData; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.pool - */ - (function (pool) { - /** - * @class away.pool.MaterialPassDataPool - */ - var MaterialPassDataPool = (function () { - /** - * //TODO - * - * @param textureDataClass - */ - function MaterialPassDataPool(material) { - this._pool = new Object(); - this._material = material; - } - /** - * //TODO - * - * @param materialOwner - * @returns ITexture - */ - MaterialPassDataPool.prototype.getItem = function (materialPass) { - return (this._pool[materialPass.id] || (this._pool[materialPass.id] = this._material._iAddMaterialPassData(materialPass._iAddMaterialPassData(new pool.MaterialPassData(this, this._material, materialPass))))); - }; - - /** - * //TODO - * - * @param materialOwner - */ - MaterialPassDataPool.prototype.disposeItem = function (materialPass) { - materialPass._iRemoveMaterialPassData(this._pool[materialPass.id]); - - delete this._pool[materialPass.id]; - }; - - MaterialPassDataPool.prototype.disposePool = function () { - for (var id in this._pool) - this._pool[id].materialPass._iRemoveMaterialPassData(this._pool[id]); - - delete this._pool; - }; - return MaterialPassDataPool; - })(); - pool.MaterialPassDataPool = MaterialPassDataPool; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.pool - */ - (function (_pool) { - /** - * - * @class away.pool.TextureDataBase - */ - var TextureData = (function () { - function TextureData(pool, context, textureProxy) { - this._pool = pool; - this.context = context; - this.textureProxy = textureProxy; - } - /** - * - */ - TextureData.prototype.dispose = function () { - this._pool.disposeItem(this.textureProxy); - - this.texture.dispose(); - this.texture = null; - }; - - /** - * - */ - TextureData.prototype.invalidate = function () { - this.invalid = true; - }; - return TextureData; - })(); - _pool.TextureData = TextureData; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.pool - */ - (function (pool) { - /** - * @class away.pool.TextureDataPool - */ - var TextureDataPool = (function () { - /** - * //TODO - * - * @param textureDataClass - */ - function TextureDataPool(context) { - this._pool = new Object(); - this._context = context; - } - /** - * //TODO - * - * @param materialOwner - * @returns ITexture - */ - TextureDataPool.prototype.getItem = function (textureProxy) { - return (this._pool[textureProxy.id] || (this._pool[textureProxy.id] = textureProxy._iAddTextureData(new pool.TextureData(this, this._context, textureProxy)))); - }; - - /** - * //TODO - * - * @param materialOwner - */ - TextureDataPool.prototype.disposeItem = function (textureProxy) { - textureProxy._iRemoveTextureData(this._pool[textureProxy.id]); - - this._pool[textureProxy.id] = null; - }; - return TextureDataPool; - })(); - pool.TextureDataPool = TextureDataPool; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.pool - */ - (function (_pool) { - var TriangleSubGeometry = away.base.TriangleSubGeometry; - - /** - * @class away.pool.TriangleSubMeshRenderable - */ - var TriangleSubMeshRenderable = (function (_super) { - __extends(TriangleSubMeshRenderable, _super); - /** - * //TODO - * - * @param pool - * @param subMesh - * @param level - * @param indexOffset - */ - function TriangleSubMeshRenderable(pool, subMesh, level, indexOffset) { - if (typeof level === "undefined") { level = 0; } - if (typeof indexOffset === "undefined") { indexOffset = 0; } - _super.call(this, pool, subMesh.parentMesh, subMesh, level, indexOffset); - - this.subMesh = subMesh; - } - /** - * - * @returns {away.base.SubGeometryBase} - * @protected - */ - TriangleSubMeshRenderable.prototype._pGetSubGeometry = function () { - var subGeometry; - - if (this.subMesh.animator) - subGeometry = this.subMesh.animator.getRenderableSubGeometry(this, this.subMesh.subGeometry); - else - subGeometry = this.subMesh.subGeometry; - - this._pVertexDataDirty[TriangleSubGeometry.POSITION_DATA] = true; - - if (subGeometry.vertexNormals) - this._pVertexDataDirty[TriangleSubGeometry.NORMAL_DATA] = true; - - if (subGeometry.vertexTangents) - this._pVertexDataDirty[TriangleSubGeometry.TANGENT_DATA] = true; - - if (subGeometry.uvs) - this._pVertexDataDirty[TriangleSubGeometry.UV_DATA] = true; - - if (subGeometry.secondaryUVs) - this._pVertexDataDirty[TriangleSubGeometry.SECONDARY_UV_DATA] = true; - - if (subGeometry.jointIndices) - this._pVertexDataDirty[TriangleSubGeometry.JOINT_INDEX_DATA] = true; - - if (subGeometry.jointWeights) - this._pVertexDataDirty[TriangleSubGeometry.JOINT_WEIGHT_DATA] = true; - - switch (subGeometry.jointsPerVertex) { - case 1: - this.JOINT_INDEX_FORMAT = this.JOINT_WEIGHT_FORMAT = away.stagegl.ContextGLVertexBufferFormat.FLOAT_1; - break; - case 2: - this.JOINT_INDEX_FORMAT = this.JOINT_WEIGHT_FORMAT = away.stagegl.ContextGLVertexBufferFormat.FLOAT_2; - break; - case 3: - this.JOINT_INDEX_FORMAT = this.JOINT_WEIGHT_FORMAT = away.stagegl.ContextGLVertexBufferFormat.FLOAT_3; - break; - case 4: - this.JOINT_INDEX_FORMAT = this.JOINT_WEIGHT_FORMAT = away.stagegl.ContextGLVertexBufferFormat.FLOAT_4; - break; - default: - } - - return subGeometry; - }; - - /** - * //TODO - * - * @param pool - * @param materialOwner - * @param level - * @param indexOffset - * @returns {away.pool.TriangleSubMeshRenderable} - * @protected - */ - TriangleSubMeshRenderable.prototype._pGetOverflowRenderable = function (pool, materialOwner, level, indexOffset) { - return new TriangleSubMeshRenderable(pool, materialOwner, level, indexOffset); - }; - TriangleSubMeshRenderable.id = "trianglesubmesh"; - return TriangleSubMeshRenderable; - })(_pool.RenderableBase); - _pool.TriangleSubMeshRenderable = TriangleSubMeshRenderable; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.base - */ - (function (pool) { - var SubGeometryBase = away.base.SubGeometryBase; - var SubGeometryEvent = away.events.SubGeometryEvent; - - /** - * - */ - var VertexData = (function () { - function VertexData(subGeometry, dataType) { - var _this = this; - this._dataDirty = true; - this.invalid = new Array(8); - this.buffers = new Array(8); - this.contexts = new Array(8); - this._subGeometry = subGeometry; - this._dataType = dataType; - - this._onVerticesUpdatedDelegate = function (event) { - return _this._onVerticesUpdated(event); - }; - this._subGeometry.addEventListener(SubGeometryEvent.VERTICES_UPDATED, this._onVerticesUpdatedDelegate); - } - VertexData.prototype.updateData = function (originalIndices, indexMappings) { - if (typeof originalIndices === "undefined") { originalIndices = null; } - if (typeof indexMappings === "undefined") { indexMappings = null; } - if (this._dataDirty) { - this._dataDirty = false; - - this.dataPerVertex = this._subGeometry.getStride(this._dataType); - - var vertices = this._subGeometry[this._dataType]; - - if (indexMappings == null) { - this.setData(vertices); - } else { - var splitVerts = new Array(originalIndices.length * this.dataPerVertex); - var originalIndex; - var splitIndex; - var i = 0; - var j = 0; - while (i < originalIndices.length) { - originalIndex = originalIndices[i]; - - splitIndex = indexMappings[originalIndex] * this.dataPerVertex; - originalIndex *= this.dataPerVertex; - - for (j = 0; j < this.dataPerVertex; j++) - splitVerts[splitIndex + j] = vertices[originalIndex + j]; - - i++; - } - - this.setData(splitVerts); - } - } - }; - - VertexData.prototype.dispose = function () { - for (var i = 0; i < 8; ++i) { - if (this.contexts[i]) { - this.contexts[i].disposeVertexData(this); - this.contexts[i] = null; - } - } - }; - - /** - * @private - */ - VertexData.prototype.disposeBuffers = function () { - for (var i = 0; i < 8; ++i) { - if (this.buffers[i]) { - this.buffers[i].dispose(); - this.buffers[i] = null; - } - } - }; - - /** - * @private - */ - VertexData.prototype.invalidateBuffers = function () { - for (var i = 0; i < 8; ++i) - this.invalid[i] = true; - }; - - /** - * - * @param data - * @param dataPerVertex - * @private - */ - VertexData.prototype.setData = function (data) { - if (this.data && this.data.length != data.length) - this.disposeBuffers(); - else - this.invalidateBuffers(); - - this.data = data; - }; - - /** - * //TODO - * - * @param event - * @private - */ - VertexData.prototype._onVerticesUpdated = function (event) { - var dataType = this._subGeometry.concatenateArrays ? SubGeometryBase.VERTEX_DATA : event.dataType; - - if (dataType == this._dataType) - this._dataDirty = true; - }; - return VertexData; - })(); - pool.VertexData = VertexData; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.base - */ - (function (pool) { - var SubGeometryBase = away.base.SubGeometryBase; - - /** - * - */ - var VertexDataPool = (function () { - function VertexDataPool() { - } - VertexDataPool.getItem = function (subGeometry, indexData, dataType) { - if (subGeometry.concatenateArrays) - dataType = SubGeometryBase.VERTEX_DATA; - - var subGeometryDictionary = (VertexDataPool._pool[subGeometry.id] || (VertexDataPool._pool[subGeometry.id] = new Object())); - var subGeometryData = (subGeometryDictionary[dataType] || (subGeometryDictionary[dataType] = new Array())); - - var vertexData = subGeometryData[indexData.level] || (subGeometryData[indexData.level] = new pool.VertexData(subGeometry, dataType)); - vertexData.updateData(indexData.originalIndices, indexData.indexMappings); - - return vertexData; - }; - - VertexDataPool.disposeItem = function (subGeometry, level, dataType) { - var subGeometryDictionary = VertexDataPool._pool[subGeometry.id]; - var subGeometryData = subGeometryDictionary[dataType]; - - subGeometryData[level].dispose(); - subGeometryData[level] = null; - }; - - VertexDataPool.prototype.disposeData = function (subGeometry) { - var subGeometryDictionary = VertexDataPool._pool[subGeometry.id]; - - for (var key in subGeometryDictionary) { - var subGeometryData = subGeometryDictionary[key]; - - var len = subGeometryData.length; - for (var i = 0; i < len; i++) { - subGeometryData[i].dispose(); - subGeometryData[i] = null; - } - } - - VertexDataPool._pool[subGeometry.id] = null; - }; - VertexDataPool._pool = new Object(); - return VertexDataPool; - })(); - pool.VertexDataPool = VertexDataPool; - })(away.pool || (away.pool = {})); - var pool = away.pool; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (stagegl) { - var AbstractMethodError = away.errors.AbstractMethodError; - - var TextureDataPool = away.pool.TextureDataPool; - - var ProgramDataPool = away.pool.ProgramDataPool; - - var MaterialDataPool = away.pool.MaterialDataPool; - - var RenderTexture = away.textures.RenderTexture; - - /** - * Stage provides a proxy class to handle the creation and attachment of the Context - * (and in turn the back buffer) it uses. Stage should never be created directly, - * but requested through StageManager. - * - * @see away.managers.StageManager - * - */ - var ContextGLBase = (function () { - function ContextGLBase(stageIndex) { - this._programData = new Array(); - this._numUsedStreams = 0; - this._numUsedTextures = 0; - //private static _frameEventDriver:Shape = new Shape(); // TODO: add frame driver / request animation frame - this._stageIndex = -1; - this._antiAlias = 0; - this._renderTarget = null; - this._renderSurfaceSelector = 0; - this._stageIndex = stageIndex; - this._texturePool = new TextureDataPool(this); - this._materialDataPool = new MaterialDataPool(this); - this._programDataPool = new ProgramDataPool(this); - } - Object.defineProperty(ContextGLBase.prototype, "container", { - get: function () { - return this._pContainer; - }, - enumerable: true, - configurable: true - }); - - ContextGLBase.prototype.setRenderTarget = function (target, enableDepthAndStencil, surfaceSelector) { - if (typeof enableDepthAndStencil === "undefined") { enableDepthAndStencil = false; } - if (typeof surfaceSelector === "undefined") { surfaceSelector = 0; } - if (this._renderTarget === target && surfaceSelector == this._renderSurfaceSelector && this._enableDepthAndStencil == enableDepthAndStencil) - return; - - this._renderTarget = target; - this._renderSurfaceSelector = surfaceSelector; - this._enableDepthAndStencil = enableDepthAndStencil; - if (target instanceof RenderTexture) { - this.setRenderToTexture(this.getRenderTexture(target), enableDepthAndStencil, this._antiAlias, surfaceSelector); - } else { - this.setRenderToBackBuffer(); - this.configureBackBuffer(this._width, this._height, this._antiAlias, this._enableDepthAndStencil); - } - }; - - ContextGLBase.prototype.getRenderTexture = function (textureProxy) { - var textureData = this._texturePool.getItem(textureProxy); - - if (!textureData.texture) - textureData.texture = this.createTexture(textureProxy.width, textureProxy.height, stagegl.ContextGLTextureFormat.BGRA, true); - - return textureData.texture; - }; - - ContextGLBase.prototype.getProgram = function (materialPassData) { - //check key doesn't need re-concatenating - if (!materialPassData.key.length) { - materialPassData.key = materialPassData.animationVertexCode + materialPassData.vertexCode + "---" + materialPassData.fragmentCode + materialPassData.animationFragmentCode + materialPassData.postAnimationFragmentCode; - } else { - return materialPassData.programData; - } - - var programData = this._programDataPool.getItem(materialPassData.key); - - //check program data hasn't changed, keep count of program usages - if (materialPassData.programData != programData) { - if (materialPassData.programData) - materialPassData.programData.dispose(); - - materialPassData.programData = programData; - - programData.usages++; - } - - return programData; - }; - - /** - * - * @param material - */ - ContextGLBase.prototype.getMaterial = function (material, profile) { - var materialData = this._materialDataPool.getItem(material); - - if (materialData.invalidAnimation) { - materialData.invalidAnimation = false; - - var materialDataPasses = materialData.getMaterialPasses(profile); - - var enabledGPUAnimation = this.getEnabledGPUAnimation(material, materialDataPasses); - - var renderOrderId = 0; - var mult = 1; - var materialPassData; - var len = materialDataPasses.length; - for (var i = 0; i < len; i++) { - materialPassData = materialDataPasses[i]; - - if (materialPassData.usesAnimation != enabledGPUAnimation) { - materialPassData.usesAnimation = enabledGPUAnimation; - materialPassData.key == ""; - } - - if (materialPassData.key == "") - this.calcAnimationCode(material, materialPassData); - - renderOrderId += this.getProgram(materialPassData).id * mult; - mult *= 1000; - } - - materialData.renderOrderId = renderOrderId; - } - - return materialData; - }; - - /** - * Assigns an attribute stream - * - * @param index The attribute stream index for the vertex shader - * @param buffer - * @param offset - * @param stride - * @param format - */ - ContextGLBase.prototype.activateBuffer = function (index, buffer, offset, format) { - if (!buffer.contexts[this._stageIndex]) - buffer.contexts[this._stageIndex] = this; - - if (!buffer.buffers[this._stageIndex]) { - buffer.buffers[this._stageIndex] = this.createVertexBuffer(buffer.data.length / buffer.dataPerVertex, buffer.dataPerVertex); - buffer.invalid[this._stageIndex] = true; - } - - if (buffer.invalid[this._stageIndex]) { - buffer.buffers[this._stageIndex].uploadFromArray(buffer.data, 0, buffer.data.length / buffer.dataPerVertex); - buffer.invalid[this._stageIndex] = false; - } - - this.setVertexBufferAt(index, buffer.buffers[this._stageIndex], offset, format); - }; - - ContextGLBase.prototype.disposeVertexData = function (buffer) { - buffer.buffers[this._stageIndex].dispose(); - buffer.buffers[this._stageIndex] = null; - }; - - ContextGLBase.prototype.activateRenderTexture = function (index, textureProxy) { - this.setTextureAt(index, this.getRenderTexture(textureProxy)); - }; - - ContextGLBase.prototype.activateMaterialPass = function (materialPassData, stage, camera) { - var shaderObject = materialPassData.shaderObject; - - for (var i = shaderObject.numUsedStreams; i < this._numUsedStreams; i++) - this.setVertexBufferAt(i, null); - - for (var i = shaderObject.numUsedTextures; i < this._numUsedTextures; i++) - this.setTextureAt(i, null); - - if (materialPassData.usesAnimation) - materialPassData.material.animationSet.activate(shaderObject, stage); - - //activate shader object - shaderObject.iActivate(stage, camera); - - //check program data is uploaded - var programData = this.getProgram(materialPassData); - - if (!programData.program) { - programData.program = this.createProgram(); - var vertexByteCode = (new aglsl.assembler.AGALMiniAssembler().assemble("part vertex 1\n" + materialPassData.animationVertexCode + materialPassData.vertexCode + "endpart"))['vertex'].data; - var fragmentByteCode = (new aglsl.assembler.AGALMiniAssembler().assemble("part fragment 1\n" + materialPassData.fragmentCode + materialPassData.animationFragmentCode + materialPassData.postAnimationFragmentCode + "endpart"))['fragment'].data; - programData.program.upload(vertexByteCode, fragmentByteCode); - } - - //set program data - this.setProgram(programData.program); - }; - - ContextGLBase.prototype.deactivateMaterialPass = function (materialPassData, stage) { - var shaderObject = materialPassData.shaderObject; - - if (materialPassData.usesAnimation) - materialPassData.material.animationSet.deactivate(shaderObject, stage); - - materialPassData.shaderObject.iDeactivate(stage); - - this._numUsedStreams = shaderObject.numUsedStreams; - this._numUsedTextures = shaderObject.numUsedTextures; - }; - - ContextGLBase.prototype.activateTexture = function (index, textureProxy) { - var textureData = this._texturePool.getItem(textureProxy); - - if (!textureData.texture) { - textureData.texture = this.createTexture(textureProxy.width, textureProxy.height, stagegl.ContextGLTextureFormat.BGRA, true); - textureData.invalid = true; - } - - if (textureData.invalid) { - textureData.invalid = false; - if (textureProxy.generateMipmaps) { - var mipmapData = textureProxy._iGetMipmapData(); - var len = mipmapData.length; - for (var i = 0; i < len; i++) - textureData.texture.uploadFromData(mipmapData[i], i); - } else { - textureData.texture.uploadFromData(textureProxy._iGetTextureData(), 0); - } - } - - this.setTextureAt(index, textureData.texture); - }; - - ContextGLBase.prototype.activateCubeTexture = function (index, textureProxy) { - var textureData = this._texturePool.getItem(textureProxy); - - if (!textureData.texture) { - textureData.texture = this.createCubeTexture(textureProxy.size, stagegl.ContextGLTextureFormat.BGRA, false); - textureData.invalid = true; - } - - if (textureData.invalid) { - textureData.invalid = false; - for (var i = 0; i < 6; ++i) { - if (textureProxy.generateMipmaps) { - var mipmapData = textureProxy._iGetMipmapData(i); - var len = mipmapData.length; - for (var j = 0; j < len; j++) - textureData.texture.uploadFromData(mipmapData[j], i, j); - } else { - textureData.texture.uploadFromData(textureProxy._iGetTextureData(i), i, 0); - } - } - } - - this.setTextureAt(index, textureData.texture); - }; - - /** - * Retrieves the VertexBuffer object that contains triangle indices. - * @param context The ContextWeb for which we request the buffer - * @return The VertexBuffer object that contains triangle indices. - */ - ContextGLBase.prototype.getIndexBuffer = function (buffer) { - if (!buffer.contexts[this._stageIndex]) - buffer.contexts[this._stageIndex] = this; - - if (!buffer.buffers[this._stageIndex]) { - buffer.buffers[this._stageIndex] = this.createIndexBuffer(buffer.data.length); - buffer.invalid[this._stageIndex] = true; - } - - if (buffer.invalid[this._stageIndex]) { - buffer.buffers[this._stageIndex].uploadFromArray(buffer.data, 0, buffer.data.length); - buffer.invalid[this._stageIndex] = false; - } - - return buffer.buffers[this._stageIndex]; - }; - - ContextGLBase.prototype.disposeIndexData = function (buffer) { - buffer.buffers[this._stageIndex].dispose(); - buffer.buffers[this._stageIndex] = null; - }; - - ContextGLBase.prototype.clear = function (red, green, blue, alpha, depth, stencil, mask) { - if (typeof red === "undefined") { red = 0; } - if (typeof green === "undefined") { green = 0; } - if (typeof blue === "undefined") { blue = 0; } - if (typeof alpha === "undefined") { alpha = 1; } - if (typeof depth === "undefined") { depth = 1; } - if (typeof stencil === "undefined") { stencil = 0; } - if (typeof mask === "undefined") { mask = stagegl.ContextGLClearMask.ALL; } - }; - - ContextGLBase.prototype.configureBackBuffer = function (width, height, antiAlias, enableDepthAndStencil) { - if (typeof enableDepthAndStencil === "undefined") { enableDepthAndStencil = true; } - this._width = width; - this._height = height; - }; - - ContextGLBase.prototype.createIndexBuffer = function (numIndices) { - throw new AbstractMethodError(); - }; - - ContextGLBase.prototype.createVertexBuffer = function (numVertices, data32PerVertex) { - throw new AbstractMethodError(); - }; - - ContextGLBase.prototype.createTexture = function (width, height, format, optimizeForRenderToTexture, streamingLevels) { - if (typeof streamingLevels === "undefined") { streamingLevels = 0; } - throw new AbstractMethodError(); - }; - - ContextGLBase.prototype.createCubeTexture = function (size, format, optimizeForRenderToTexture, streamingLevels) { - if (typeof streamingLevels === "undefined") { streamingLevels = 0; } - throw new AbstractMethodError(); - }; - - ContextGLBase.prototype.createProgram = function () { - throw new AbstractMethodError(); - }; - - ContextGLBase.prototype.dispose = function () { - }; - - ContextGLBase.prototype.present = function () { - }; - - ContextGLBase.prototype.setRenderToTexture = function (target, enableDepthAndStencil, antiAlias, surfaceSelector) { - if (typeof enableDepthAndStencil === "undefined") { enableDepthAndStencil = false; } - if (typeof antiAlias === "undefined") { antiAlias = 0; } - if (typeof surfaceSelector === "undefined") { surfaceSelector = 0; } - }; - - ContextGLBase.prototype.setRenderToBackBuffer = function () { - }; - - ContextGLBase.prototype.setScissorRectangle = function (rectangle) { - }; - - ContextGLBase.prototype.setTextureAt = function (sampler, texture) { - }; - - ContextGLBase.prototype.setVertexBufferAt = function (index, buffer, bufferOffset, format) { - if (typeof bufferOffset === "undefined") { bufferOffset = 0; } - if (typeof format === "undefined") { format = null; } - }; - - ContextGLBase.prototype.setProgram = function (program) { - }; - - ContextGLBase.prototype.registerProgram = function (programData) { - var i = 0; - while (this._programData[i] != null) - i++; - - this._programData[i] = programData; - programData.id = i; - }; - - ContextGLBase.prototype.unRegisterProgram = function (programData) { - this._programData[programData.id] = null; - programData.id = -1; - }; - - /** - * test if animation will be able to run on gpu BEFORE compiling materials - * test if the shader objects supports animating the animation set in the vertex shader - * if any object using this material fails to support accelerated animations for any of the shader objects, - * we should do everything on cpu (otherwise we have the cost of both gpu + cpu animations) - */ - ContextGLBase.prototype.getEnabledGPUAnimation = function (material, materialDataPasses) { - if (material.animationSet) { - material.animationSet.resetGPUCompatibility(); - - var owners = material.iOwners; - var numOwners = owners.length; - - var len = materialDataPasses.length; - for (var i = 0; i < len; i++) - for (var j = 0; j < numOwners; j++) - if (owners[j].animator) - owners[j].animator.testGPUCompatibility(materialDataPasses[i].shaderObject); - - return !material.animationSet.usesCPU; - } - - return false; - }; - - ContextGLBase.prototype.calcAnimationCode = function (material, materialPassData) { - //reset key so that the program is re-calculated - materialPassData.key = ""; - materialPassData.animationVertexCode = ""; - materialPassData.animationFragmentCode = ""; - - var shaderObject = materialPassData.shaderObject; - - //check to see if GPU animation is used - if (materialPassData.usesAnimation) { - var animationSet = material.animationSet; - - materialPassData.animationVertexCode += animationSet.getAGALVertexCode(shaderObject); - - if (shaderObject.uvDependencies > 0 && !shaderObject.usesUVTransform) - materialPassData.animationVertexCode += animationSet.getAGALUVCode(shaderObject); - - if (shaderObject.usesFragmentAnimation) - materialPassData.animationFragmentCode += animationSet.getAGALFragmentCode(shaderObject, materialPassData.shadedTarget); - - animationSet.doneAGALCode(shaderObject); - } else { - // simply write attributes to targets, do not animate them - // projection will pick up on targets[0] to do the projection - var len = shaderObject.animatableAttributes.length; - for (var i = 0; i < len; ++i) - materialPassData.animationVertexCode += "mov " + shaderObject.animationTargetRegisters[i] + ", " + shaderObject.animatableAttributes[i] + "\n"; - - if (shaderObject.uvDependencies > 0 && !shaderObject.usesUVTransform) - materialPassData.animationVertexCode += "mov " + shaderObject.uvTarget + "," + shaderObject.uvSource + "\n"; - } - }; - return ContextGLBase; - })(); - stagegl.ContextGLBase = ContextGLBase; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (stagegl) { - var ContextGLClearMask = (function () { - function ContextGLClearMask() { - } - ContextGLClearMask.COLOR = 1; - ContextGLClearMask.DEPTH = 2; - ContextGLClearMask.STENCIL = 4; - ContextGLClearMask.ALL = ContextGLClearMask.COLOR | ContextGLClearMask.DEPTH | ContextGLClearMask.STENCIL; - return ContextGLClearMask; - })(); - stagegl.ContextGLClearMask = ContextGLClearMask; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (stagegl) { - var ContextGLTextureFormat = (function () { - function ContextGLTextureFormat() { - } - ContextGLTextureFormat.BGRA = "bgra"; - ContextGLTextureFormat.BGRA_PACKED = "bgraPacked4444"; - ContextGLTextureFormat.BGR_PACKED = "bgrPacked565"; - ContextGLTextureFormat.COMPRESSED = "compressed"; - ContextGLTextureFormat.COMPRESSED_ALPHA = "compressedAlpha"; - return ContextGLTextureFormat; - })(); - stagegl.ContextGLTextureFormat = ContextGLTextureFormat; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (stagegl) { - var ContextGLTriangleFace = (function () { - function ContextGLTriangleFace() { - } - ContextGLTriangleFace.BACK = "back"; - ContextGLTriangleFace.FRONT = "front"; - ContextGLTriangleFace.FRONT_AND_BACK = "frontAndBack"; - ContextGLTriangleFace.NONE = "none"; - return ContextGLTriangleFace; - })(); - stagegl.ContextGLTriangleFace = ContextGLTriangleFace; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (stagegl) { - var ContextGLVertexBufferFormat = (function () { - function ContextGLVertexBufferFormat() { - } - ContextGLVertexBufferFormat.BYTES_4 = "bytes4"; - ContextGLVertexBufferFormat.FLOAT_1 = "float1"; - ContextGLVertexBufferFormat.FLOAT_2 = "float2"; - ContextGLVertexBufferFormat.FLOAT_3 = "float3"; - ContextGLVertexBufferFormat.FLOAT_4 = "float4"; - return ContextGLVertexBufferFormat; - })(); - stagegl.ContextGLVertexBufferFormat = ContextGLVertexBufferFormat; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (stagegl) { - var ContextGLProgramType = (function () { - function ContextGLProgramType() { - } - ContextGLProgramType.FRAGMENT = "fragment"; - ContextGLProgramType.VERTEX = "vertex"; - return ContextGLProgramType; - })(); - stagegl.ContextGLProgramType = ContextGLProgramType; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (stagegl) { - var ContextGLBlendFactor = (function () { - function ContextGLBlendFactor() { - } - ContextGLBlendFactor.DESTINATION_ALPHA = "destinationAlpha"; - ContextGLBlendFactor.DESTINATION_COLOR = "destinationColor"; - ContextGLBlendFactor.ONE = "one"; - ContextGLBlendFactor.ONE_MINUS_DESTINATION_ALPHA = "oneMinusDestinationAlpha"; - ContextGLBlendFactor.ONE_MINUS_DESTINATION_COLOR = "oneMinusDestinationColor"; - ContextGLBlendFactor.ONE_MINUS_SOURCE_ALPHA = "oneMinusSourceAlpha"; - ContextGLBlendFactor.ONE_MINUS_SOURCE_COLOR = "oneMinusSourceColor"; - ContextGLBlendFactor.SOURCE_ALPHA = "sourceAlpha"; - ContextGLBlendFactor.SOURCE_COLOR = "sourceColor"; - ContextGLBlendFactor.ZERO = "zero"; - return ContextGLBlendFactor; - })(); - stagegl.ContextGLBlendFactor = ContextGLBlendFactor; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (stagegl) { - var ContextGLCompareMode = (function () { - function ContextGLCompareMode() { - } - ContextGLCompareMode.ALWAYS = "always"; - ContextGLCompareMode.EQUAL = "equal"; - ContextGLCompareMode.GREATER = "greater"; - ContextGLCompareMode.GREATER_EQUAL = "greaterEqual"; - ContextGLCompareMode.LESS = "less"; - ContextGLCompareMode.LESS_EQUAL = "lessEqual"; - ContextGLCompareMode.NEVER = "never"; - ContextGLCompareMode.NOT_EQUAL = "notEqual"; - return ContextGLCompareMode; - })(); - stagegl.ContextGLCompareMode = ContextGLCompareMode; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (stagegl) { - var ContextGLMipFilter = (function () { - function ContextGLMipFilter() { - } - ContextGLMipFilter.MIPLINEAR = "miplinear"; - ContextGLMipFilter.MIPNEAREST = "mipnearest"; - ContextGLMipFilter.MIPNONE = "mipnone"; - return ContextGLMipFilter; - })(); - stagegl.ContextGLMipFilter = ContextGLMipFilter; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (stagegl) { - var ContextGLProfile = (function () { - function ContextGLProfile() { - } - ContextGLProfile.BASELINE = "baseline"; - ContextGLProfile.BASELINE_CONSTRAINED = "baselineConstrained"; - ContextGLProfile.BASELINE_EXTENDED = "baselineExtended"; - return ContextGLProfile; - })(); - stagegl.ContextGLProfile = ContextGLProfile; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (stagegl) { - var ContextGLStencilAction = (function () { - function ContextGLStencilAction() { - } - ContextGLStencilAction.DECREMENT_SATURATE = "decrementSaturate"; - ContextGLStencilAction.DECREMENT_WRAP = "decrementWrap"; - ContextGLStencilAction.INCREMENT_SATURATE = "incrementSaturate"; - ContextGLStencilAction.INCREMENT_WRAP = "incrementWrap"; - ContextGLStencilAction.INVERT = "invert"; - ContextGLStencilAction.KEEP = "keep"; - ContextGLStencilAction.SET = "set"; - ContextGLStencilAction.ZERO = "zero"; - return ContextGLStencilAction; - })(); - stagegl.ContextGLStencilAction = ContextGLStencilAction; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (stagegl) { - var ContextGLTextureFilter = (function () { - function ContextGLTextureFilter() { - } - ContextGLTextureFilter.LINEAR = "linear"; - ContextGLTextureFilter.NEAREST = "nearest"; - return ContextGLTextureFilter; - })(); - stagegl.ContextGLTextureFilter = ContextGLTextureFilter; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (stagegl) { - var ContextGLWrapMode = (function () { - function ContextGLWrapMode() { - } - ContextGLWrapMode.CLAMP = "clamp"; - ContextGLWrapMode.REPEAT = "repeat"; - return ContextGLWrapMode; - })(); - stagegl.ContextGLWrapMode = ContextGLWrapMode; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (stagegl) { - var ContextStage3D = (function (_super) { - __extends(ContextStage3D, _super); - function ContextStage3D(container, stageIndex, callback) { - _super.call(this, stageIndex); - this._cmdStream = ""; - - this._resources = new Array(); - - var swfVersionStr = "11.0.0"; - - // To use express install, set to playerProductInstall.swf, otherwise the empty string. - var flashvars = { - id: container.id - }; - - var params = { - quality: "high", - bgcolor: "#ffffff", - allowscriptaccess: "sameDomain", - allowfullscreen: "true", - wmode: "direct" - }; - - this._errorCheckingEnabled = false; - this._iDriverInfo = "Unknown"; - - var attributes = { - salign: "tl", - id: container.id, - name: container["name"] - }; - - this._oldCanvas = container.cloneNode(); // keep the old one to restore on dispose - this._oldParent = container.parentNode; - - var context3dObj = this; - ContextStage3D.contexts[container.id] = this; - - function callbackSWFObject(callbackInfo) { - if (!callbackInfo.success) - return; - - context3dObj._pContainer = callbackInfo.ref; - context3dObj._iCallback = callback; - } - - swfobject.embedSWF("../libs/molehill_js_flashbridge.swf", container.id, String(container.width), String(container.height), swfVersionStr, "", flashvars, params, attributes, callbackSWFObject); - } - Object.defineProperty(ContextStage3D.prototype, "container", { - get: function () { - return this._pContainer; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ContextStage3D.prototype, "driverInfo", { - get: function () { - return this._iDriverInfo; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ContextStage3D.prototype, "errorCheckingEnabled", { - get: function () { - return this._errorCheckingEnabled; - }, - set: function (value) { - if (this._errorCheckingEnabled == value) - return; - - this._errorCheckingEnabled = value; - - this.addStream(String.fromCharCode(away.stagegl.OpCodes.enableErrorChecking, value ? away.stagegl.OpCodes.trueValue : away.stagegl.OpCodes.falseValue)); - this.execute(); - }, - enumerable: true, - configurable: true - }); - - - ContextStage3D.prototype._iAddResource = function (resource) { - this._resources.push(resource); - }; - - ContextStage3D.prototype._iRemoveResource = function (resource) { - this._resources.splice(this._resources.indexOf(resource)); - }; - - ContextStage3D.prototype.createTexture = function (width, height, format, optimizeForRenderToTexture, streamingLevels) { - if (typeof streamingLevels === "undefined") { streamingLevels = 0; } - //TODO:streaming - return new stagegl.TextureFlash(this, width, height, format, optimizeForRenderToTexture); - }; - - ContextStage3D.prototype.createCubeTexture = function (size, format, optimizeForRenderToTexture, streamingLevels) { - if (typeof streamingLevels === "undefined") { streamingLevels = 0; } - //TODO:streaming - return new stagegl.CubeTextureFlash(this, size, format, optimizeForRenderToTexture); - }; - - ContextStage3D.prototype.setTextureAt = function (sampler, texture) { - if (texture) { - this.addStream(String.fromCharCode(away.stagegl.OpCodes.setTextureAt) + sampler + "," + texture.id + ","); - } else { - this.addStream(String.fromCharCode(away.stagegl.OpCodes.clearTextureAt) + sampler.toString() + ","); - } - - if (ContextStage3D.debug) - this.execute(); - }; - - ContextStage3D.prototype.setSamplerStateAt = function (sampler, wrap, filter, mipfilter) { - //nothing to do here - }; - - ContextStage3D.prototype.setStencilActions = function (triangleFace, compareMode, actionOnBothPass, actionOnDepthFail, actionOnDepthPassStencilFail) { - if (typeof triangleFace === "undefined") { triangleFace = "frontAndBack"; } - if (typeof compareMode === "undefined") { compareMode = "always"; } - if (typeof actionOnBothPass === "undefined") { actionOnBothPass = "keep"; } - if (typeof actionOnDepthFail === "undefined") { actionOnDepthFail = "keep"; } - if (typeof actionOnDepthPassStencilFail === "undefined") { actionOnDepthPassStencilFail = "keep"; } - this.addStream(String.fromCharCode(away.stagegl.OpCodes.setStencilActions) + triangleFace + "$" + compareMode + "$" + actionOnBothPass + "$" + actionOnDepthFail + "$" + actionOnDepthPassStencilFail + "$"); - - if (ContextStage3D.debug) - this.execute(); - }; - - ContextStage3D.prototype.setStencilReferenceValue = function (referenceValue, readMask, writeMask) { - if (typeof readMask === "undefined") { readMask = 255; } - if (typeof writeMask === "undefined") { writeMask = 255; } - this.addStream(String.fromCharCode(away.stagegl.OpCodes.setStencilReferenceValue, referenceValue + away.stagegl.OpCodes.intMask, readMask + away.stagegl.OpCodes.intMask, writeMask + away.stagegl.OpCodes.intMask)); - - if (ContextStage3D.debug) - this.execute(); - }; - - ContextStage3D.prototype.setCulling = function (triangleFaceToCull, coordinateSystem) { - if (typeof coordinateSystem === "undefined") { coordinateSystem = "leftHanded"; } - //TODO implement coordinateSystem option - this.addStream(String.fromCharCode(away.stagegl.OpCodes.setCulling) + triangleFaceToCull + "$"); - - if (ContextStage3D.debug) - this.execute(); - }; - - ContextStage3D.prototype.drawTriangles = function (indexBuffer, firstIndex, numTriangles) { - if (typeof firstIndex === "undefined") { firstIndex = 0; } - if (typeof numTriangles === "undefined") { numTriangles = -1; } - firstIndex = firstIndex || 0; - if (!numTriangles || numTriangles < 0) - numTriangles = indexBuffer.numIndices / 3; - - this.addStream(String.fromCharCode(away.stagegl.OpCodes.drawTriangles, indexBuffer.id + away.stagegl.OpCodes.intMask) + firstIndex + "," + numTriangles + ","); - - if (ContextStage3D.debug) - this.execute(); - }; - - ContextStage3D.prototype.setProgramConstantsFromMatrix = function (programType, firstRegister, matrix, transposedMatrix) { - //this._gl.uniformMatrix4fv(this._gl.getUniformLocation(this._currentProgram.glProgram, this._uniformLocationNameDictionary[programType]), !transposedMatrix, new Float32Array(matrix.rawData)); - if (typeof transposedMatrix === "undefined") { transposedMatrix = false; } - //TODO remove special case for WebGL matrix calls? - var d = matrix.rawData; - if (transposedMatrix) { - this.setProgramConstantsFromArray(programType, firstRegister, [d[0], d[4], d[8], d[12]], 1); - this.setProgramConstantsFromArray(programType, firstRegister + 1, [d[1], d[5], d[9], d[13]], 1); - this.setProgramConstantsFromArray(programType, firstRegister + 2, [d[2], d[6], d[10], d[14]], 1); - this.setProgramConstantsFromArray(programType, firstRegister + 3, [d[3], d[7], d[11], d[15]], 1); - } else { - this.setProgramConstantsFromArray(programType, firstRegister, [d[0], d[1], d[2], d[3]], 1); - this.setProgramConstantsFromArray(programType, firstRegister + 1, [d[4], d[5], d[6], d[7]], 1); - this.setProgramConstantsFromArray(programType, firstRegister + 2, [d[8], d[9], d[10], d[11]], 1); - this.setProgramConstantsFromArray(programType, firstRegister + 3, [d[12], d[13], d[14], d[15]], 1); - } - }; - - ContextStage3D.prototype.setProgramConstantsFromArray = function (programType, firstRegister, data, numRegisters) { - if (typeof numRegisters === "undefined") { numRegisters = -1; } - var startIndex; - var target = (programType == stagegl.ContextGLProgramType.VERTEX) ? away.stagegl.OpCodes.trueValue : away.stagegl.OpCodes.falseValue; - for (var i = 0; i < numRegisters; i++) { - startIndex = i * 4; - this.addStream(String.fromCharCode(away.stagegl.OpCodes.setProgramConstant, target, (firstRegister + i) + away.stagegl.OpCodes.intMask) + data[startIndex] + "," + data[startIndex + 1] + "," + data[startIndex + 2] + "," + data[startIndex + 3] + ","); - - if (ContextStage3D.debug) - this.execute(); - } - }; - - ContextStage3D.prototype.setProgram = function (program) { - this.addStream(String.fromCharCode(away.stagegl.OpCodes.setProgram, program.id + away.stagegl.OpCodes.intMask)); - - if (ContextStage3D.debug) - this.execute(); - }; - - ContextStage3D.prototype.present = function () { - this.addStream(String.fromCharCode(away.stagegl.OpCodes.present)); - this.execute(); - }; - - ContextStage3D.prototype.clear = function (red, green, blue, alpha, depth, stencil, mask) { - if (typeof red === "undefined") { red = 0; } - if (typeof green === "undefined") { green = 0; } - if (typeof blue === "undefined") { blue = 0; } - if (typeof alpha === "undefined") { alpha = 1; } - if (typeof depth === "undefined") { depth = 1; } - if (typeof stencil === "undefined") { stencil = 0; } - if (typeof mask === "undefined") { mask = stagegl.ContextGLClearMask.ALL; } - this.addStream(String.fromCharCode(away.stagegl.OpCodes.clear) + red + "," + green + "," + blue + "," + alpha + "," + depth + "," + stencil + "," + mask + ","); - - if (ContextStage3D.debug) - this.execute(); - }; - - ContextStage3D.prototype.createProgram = function () { - return new stagegl.ProgramFlash(this); - }; - - ContextStage3D.prototype.createVertexBuffer = function (numVertices, data32PerVertex) { - return new stagegl.VertexBufferFlash(this, numVertices, data32PerVertex); - }; - - ContextStage3D.prototype.createIndexBuffer = function (numIndices) { - return new stagegl.IndexBufferFlash(this, numIndices); - }; - - ContextStage3D.prototype.configureBackBuffer = function (width, height, antiAlias, enableDepthAndStencil) { - if (typeof enableDepthAndStencil === "undefined") { enableDepthAndStencil = true; } - _super.prototype.configureBackBuffer.call(this, width, height, antiAlias, enableDepthAndStencil); - - //TODO: add Anitalias setting - this.addStream(String.fromCharCode(away.stagegl.OpCodes.configureBackBuffer) + width + "," + height + ","); - }; - - ContextStage3D.prototype.drawToBitmapData = function (destination) { - //TODO - }; - - ContextStage3D.prototype.setVertexBufferAt = function (index, buffer, bufferOffset, format) { - if (typeof bufferOffset === "undefined") { bufferOffset = 0; } - if (typeof format === "undefined") { format = null; } - if (buffer) { - this.addStream(String.fromCharCode(away.stagegl.OpCodes.setVertexBufferAt, index + away.stagegl.OpCodes.intMask) + buffer.id + "," + bufferOffset + "," + format + "$"); - } else { - this.addStream(String.fromCharCode(away.stagegl.OpCodes.clearVertexBufferAt, index + away.stagegl.OpCodes.intMask)); - } - - if (ContextStage3D.debug) - this.execute(); - }; - - ContextStage3D.prototype.setColorMask = function (red, green, blue, alpha) { - this.addStream(String.fromCharCode(away.stagegl.OpCodes.setColorMask, red ? away.stagegl.OpCodes.trueValue : away.stagegl.OpCodes.falseValue, green ? away.stagegl.OpCodes.trueValue : away.stagegl.OpCodes.falseValue, blue ? away.stagegl.OpCodes.trueValue : away.stagegl.OpCodes.falseValue, alpha ? away.stagegl.OpCodes.trueValue : away.stagegl.OpCodes.falseValue)); - - if (ContextStage3D.debug) - this.execute(); - }; - - ContextStage3D.prototype.setBlendFactors = function (sourceFactor, destinationFactor) { - this.addStream(String.fromCharCode(away.stagegl.OpCodes.setBlendFactors) + sourceFactor + "$" + destinationFactor + "$"); - - if (ContextStage3D.debug) - this.execute(); - }; - - ContextStage3D.prototype.setRenderToTexture = function (target, enableDepthAndStencil, antiAlias, surfaceSelector) { - if (typeof enableDepthAndStencil === "undefined") { enableDepthAndStencil = false; } - if (typeof antiAlias === "undefined") { antiAlias = 0; } - if (typeof surfaceSelector === "undefined") { surfaceSelector = 0; } - if (target === null || target === undefined) { - this.addStream(String.fromCharCode(away.stagegl.OpCodes.clearRenderToTexture)); - } else { - this.addStream(String.fromCharCode(away.stagegl.OpCodes.setRenderToTexture, enableDepthAndStencil ? away.stagegl.OpCodes.trueValue : away.stagegl.OpCodes.falseValue) + target.id + "," + (antiAlias || 0) + ","); - } - - if (ContextStage3D.debug) - this.execute(); - }; - - ContextStage3D.prototype.setRenderToBackBuffer = function () { - this.addStream(String.fromCharCode(away.stagegl.OpCodes.clearRenderToTexture)); - - if (ContextStage3D.debug) - this.execute(); - }; - - ContextStage3D.prototype.setScissorRectangle = function (rectangle) { - if (rectangle) { - this.addStream(String.fromCharCode(away.stagegl.OpCodes.setScissorRect) + rectangle.x + "," + rectangle.y + "," + rectangle.width + "," + rectangle.height + ","); - } else { - this.addStream(String.fromCharCode(away.stagegl.OpCodes.clearScissorRect)); - } - - if (ContextStage3D.debug) - this.execute(); - }; - - ContextStage3D.prototype.setDepthTest = function (depthMask, passCompareMode) { - this.addStream(String.fromCharCode(away.stagegl.OpCodes.setDepthTest, depthMask ? away.stagegl.OpCodes.trueValue : away.stagegl.OpCodes.falseValue) + passCompareMode + "$"); - - if (ContextStage3D.debug) - this.execute(); - }; - - ContextStage3D.prototype.dispose = function () { - if (this._pContainer == null) - return; - - console.log("Context3D dispose, releasing " + this._resources.length + " resources."); - - while (this._resources.length) - this._resources[0].dispose(); - - if (this._pContainer) { - // encode command - this.addStream(String.fromCharCode(away.stagegl.OpCodes.disposeContext)); - this.execute(); - swfobject.removeSWF(this._oldCanvas.id); - if (this._oldCanvas && this._oldParent) { - this._oldParent.appendChild(this._oldCanvas); - this._oldParent = null; - } - this._pContainer = null; - } - - this._oldCanvas = null; - }; - - ContextStage3D.prototype.addStream = function (stream) { - this._cmdStream += stream; - }; - - ContextStage3D.prototype.execute = function () { - if (ContextStage3D.logStream) - console.log(this._cmdStream); - - var result = this._pContainer["CallFunction"]("" + this._cmdStream + ""); - - if (Number(result) <= -3) - throw "Exec stream failed"; - - this._cmdStream = ""; - - return Number(result); - }; - ContextStage3D.contexts = new Object(); - ContextStage3D.maxvertexconstants = 128; - ContextStage3D.maxfragconstants = 28; - ContextStage3D.maxtemp = 8; - ContextStage3D.maxstreams = 8; - ContextStage3D.maxtextures = 8; - ContextStage3D.defaultsampler = new aglsl.Sampler(); - - ContextStage3D.debug = false; - ContextStage3D.logStream = false; - return ContextStage3D; - })(stagegl.ContextGLBase); - stagegl.ContextStage3D = ContextStage3D; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); - -/** -* global function for flash callback -*/ -function mountain_js_context_available(id, driverInfo) { - var ctx = away.stagegl.ContextStage3D.contexts[id]; - if (ctx._iCallback) { - ctx._iDriverInfo = driverInfo; - - // get out of the current JS stack frame and call back from flash player - var timeOutId = window.setTimeout(function () { - window.clearTimeout(timeOutId); - try { - ctx._iCallback(ctx); - } catch (e) { - console.log("Callback failed during flash initialization with '" + e.toString() + "'"); - } - }, 1); - } -} -/// -var away; -(function (away) { - (function (stagegl) { - var ContextWebGL = (function (_super) { - __extends(ContextWebGL, _super); - function ContextWebGL(canvas, stageIndex) { - _super.call(this, stageIndex); - this._blendFactorDictionary = new Object(); - this._depthTestDictionary = new Object(); - this._textureIndexDictionary = new Array(8); - this._textureTypeDictionary = new Object(); - this._wrapDictionary = new Object(); - this._filterDictionary = new Object(); - this._mipmapFilterDictionary = new Object(); - this._uniformLocationNameDictionary = new Object(); - this._vertexBufferDimensionDictionary = new Object(); - this._indexBufferList = new Array(); - this._vertexBufferList = new Array(); - this._textureList = new Array(); - this._programList = new Array(); - this._samplerStates = new Array(8); - - this._pContainer = canvas; - - try { - this._gl = canvas.getContext("experimental-webgl", { premultipliedAlpha: false, alpha: false }); - - if (!this._gl) - this._gl = canvas.getContext("webgl", { premultipliedAlpha: false, alpha: false }); - } catch (e) { - //this.dispatchEvent( new away.events.AwayEvent( away.events.AwayEvent.INITIALIZE_FAILED, e ) ); - } - - if (this._gl) { - //this.dispatchEvent( new away.events.AwayEvent( away.events.AwayEvent.INITIALIZE_SUCCESS ) ); - //setup shortcut dictionaries - this._blendFactorDictionary[stagegl.ContextGLBlendFactor.ONE] = this._gl.ONE; - this._blendFactorDictionary[stagegl.ContextGLBlendFactor.DESTINATION_ALPHA] = this._gl.DST_ALPHA; - this._blendFactorDictionary[stagegl.ContextGLBlendFactor.DESTINATION_COLOR] = this._gl.DST_COLOR; - this._blendFactorDictionary[stagegl.ContextGLBlendFactor.ONE] = this._gl.ONE; - this._blendFactorDictionary[stagegl.ContextGLBlendFactor.ONE_MINUS_DESTINATION_ALPHA] = this._gl.ONE_MINUS_DST_ALPHA; - this._blendFactorDictionary[stagegl.ContextGLBlendFactor.ONE_MINUS_DESTINATION_COLOR] = this._gl.ONE_MINUS_DST_COLOR; - this._blendFactorDictionary[stagegl.ContextGLBlendFactor.ONE_MINUS_SOURCE_ALPHA] = this._gl.ONE_MINUS_SRC_ALPHA; - this._blendFactorDictionary[stagegl.ContextGLBlendFactor.ONE_MINUS_SOURCE_COLOR] = this._gl.ONE_MINUS_SRC_COLOR; - this._blendFactorDictionary[stagegl.ContextGLBlendFactor.SOURCE_ALPHA] = this._gl.SRC_ALPHA; - this._blendFactorDictionary[stagegl.ContextGLBlendFactor.SOURCE_COLOR] = this._gl.SRC_COLOR; - this._blendFactorDictionary[stagegl.ContextGLBlendFactor.ZERO] = this._gl.ZERO; - - this._depthTestDictionary[stagegl.ContextGLCompareMode.ALWAYS] = this._gl.ALWAYS; - this._depthTestDictionary[stagegl.ContextGLCompareMode.EQUAL] = this._gl.EQUAL; - this._depthTestDictionary[stagegl.ContextGLCompareMode.GREATER] = this._gl.GREATER; - this._depthTestDictionary[stagegl.ContextGLCompareMode.GREATER_EQUAL] = this._gl.GEQUAL; - this._depthTestDictionary[stagegl.ContextGLCompareMode.LESS] = this._gl.LESS; - this._depthTestDictionary[stagegl.ContextGLCompareMode.LESS_EQUAL] = this._gl.LEQUAL; - this._depthTestDictionary[stagegl.ContextGLCompareMode.NEVER] = this._gl.NEVER; - this._depthTestDictionary[stagegl.ContextGLCompareMode.NOT_EQUAL] = this._gl.NOTEQUAL; - - this._textureIndexDictionary[0] = this._gl.TEXTURE0; - this._textureIndexDictionary[1] = this._gl.TEXTURE1; - this._textureIndexDictionary[2] = this._gl.TEXTURE2; - this._textureIndexDictionary[3] = this._gl.TEXTURE3; - this._textureIndexDictionary[4] = this._gl.TEXTURE4; - this._textureIndexDictionary[5] = this._gl.TEXTURE5; - this._textureIndexDictionary[6] = this._gl.TEXTURE6; - this._textureIndexDictionary[7] = this._gl.TEXTURE7; - - this._textureTypeDictionary["texture2d"] = this._gl.TEXTURE_2D; - this._textureTypeDictionary["textureCube"] = this._gl.TEXTURE_CUBE_MAP; - - this._wrapDictionary[stagegl.ContextGLWrapMode.REPEAT] = this._gl.REPEAT; - this._wrapDictionary[stagegl.ContextGLWrapMode.CLAMP] = this._gl.CLAMP_TO_EDGE; - - this._filterDictionary[stagegl.ContextGLTextureFilter.LINEAR] = this._gl.LINEAR; - this._filterDictionary[stagegl.ContextGLTextureFilter.NEAREST] = this._gl.NEAREST; - - this._mipmapFilterDictionary[stagegl.ContextGLTextureFilter.LINEAR] = new Object(); - this._mipmapFilterDictionary[stagegl.ContextGLTextureFilter.LINEAR][stagegl.ContextGLMipFilter.MIPNEAREST] = this._gl.LINEAR_MIPMAP_NEAREST; - this._mipmapFilterDictionary[stagegl.ContextGLTextureFilter.LINEAR][stagegl.ContextGLMipFilter.MIPLINEAR] = this._gl.LINEAR_MIPMAP_LINEAR; - this._mipmapFilterDictionary[stagegl.ContextGLTextureFilter.LINEAR][stagegl.ContextGLMipFilter.MIPNONE] = this._gl.LINEAR; - this._mipmapFilterDictionary[stagegl.ContextGLTextureFilter.NEAREST] = new Object(); - this._mipmapFilterDictionary[stagegl.ContextGLTextureFilter.NEAREST][stagegl.ContextGLMipFilter.MIPNEAREST] = this._gl.NEAREST_MIPMAP_NEAREST; - this._mipmapFilterDictionary[stagegl.ContextGLTextureFilter.NEAREST][stagegl.ContextGLMipFilter.MIPLINEAR] = this._gl.NEAREST_MIPMAP_LINEAR; - this._mipmapFilterDictionary[stagegl.ContextGLTextureFilter.NEAREST][stagegl.ContextGLMipFilter.MIPNONE] = this._gl.NEAREST; - - this._uniformLocationNameDictionary[stagegl.ContextGLProgramType.VERTEX] = "vc"; - this._uniformLocationNameDictionary[stagegl.ContextGLProgramType.FRAGMENT] = "fc"; - - this._vertexBufferDimensionDictionary[stagegl.ContextGLVertexBufferFormat.FLOAT_1] = 1; - this._vertexBufferDimensionDictionary[stagegl.ContextGLVertexBufferFormat.FLOAT_2] = 2; - this._vertexBufferDimensionDictionary[stagegl.ContextGLVertexBufferFormat.FLOAT_3] = 3; - this._vertexBufferDimensionDictionary[stagegl.ContextGLVertexBufferFormat.FLOAT_4] = 4; - this._vertexBufferDimensionDictionary[stagegl.ContextGLVertexBufferFormat.BYTES_4] = 4; - } else { - //this.dispatchEvent( new away.events.AwayEvent( away.events.AwayEvent.INITIALIZE_FAILED, e ) ); - alert("WebGL is not available."); - } - - for (var i = 0; i < ContextWebGL.MAX_SAMPLERS; ++i) { - this._samplerStates[i] = new stagegl.SamplerState(); - this._samplerStates[i].wrap = this._gl.REPEAT; - this._samplerStates[i].filter = this._gl.LINEAR; - this._samplerStates[i].mipfilter = this._gl.LINEAR; - } - } - Object.defineProperty(ContextWebGL.prototype, "container", { - get: function () { - return this._pContainer; - }, - enumerable: true, - configurable: true - }); - - ContextWebGL.prototype.gl = function () { - return this._gl; - }; - - ContextWebGL.prototype.clear = function (red, green, blue, alpha, depth, stencil, mask) { - if (typeof red === "undefined") { red = 0; } - if (typeof green === "undefined") { green = 0; } - if (typeof blue === "undefined") { blue = 0; } - if (typeof alpha === "undefined") { alpha = 1; } - if (typeof depth === "undefined") { depth = 1; } - if (typeof stencil === "undefined") { stencil = 0; } - if (typeof mask === "undefined") { mask = stagegl.ContextGLClearMask.ALL; } - if (!this._drawing) { - this.updateBlendStatus(); - this._drawing = true; - } - - var glmask = 0; - if (mask & stagegl.ContextGLClearMask.COLOR) - glmask |= this._gl.COLOR_BUFFER_BIT; - if (mask & stagegl.ContextGLClearMask.STENCIL) - glmask |= this._gl.STENCIL_BUFFER_BIT; - if (mask & stagegl.ContextGLClearMask.DEPTH) - glmask |= this._gl.DEPTH_BUFFER_BIT; - - this._gl.clearColor(red, green, blue, alpha); - this._gl.clearDepth(depth); - this._gl.clearStencil(stencil); - this._gl.clear(glmask); - }; - - ContextWebGL.prototype.configureBackBuffer = function (width, height, antiAlias, enableDepthAndStencil) { - if (typeof enableDepthAndStencil === "undefined") { enableDepthAndStencil = true; } - _super.prototype.configureBackBuffer.call(this, width, height, antiAlias, enableDepthAndStencil); - - if (enableDepthAndStencil) { - this._gl.enable(this._gl.STENCIL_TEST); - this._gl.enable(this._gl.DEPTH_TEST); - } - - this._gl.viewport['width'] = width; - this._gl.viewport['height'] = height; - - this._gl.viewport(0, 0, width, height); - }; - - ContextWebGL.prototype.createCubeTexture = function (size, format, optimizeForRenderToTexture, streamingLevels) { - if (typeof streamingLevels === "undefined") { streamingLevels = 0; } - var texture = new stagegl.CubeTextureWebGL(this._gl, size); - this._textureList.push(texture); - return texture; - }; - - ContextWebGL.prototype.createIndexBuffer = function (numIndices) { - var indexBuffer = new stagegl.IndexBufferWebGL(this._gl, numIndices); - this._indexBufferList.push(indexBuffer); - return indexBuffer; - }; - - ContextWebGL.prototype.createProgram = function () { - var program = new stagegl.ProgramWebGL(this._gl); - this._programList.push(program); - return program; - }; - - ContextWebGL.prototype.createTexture = function (width, height, format, optimizeForRenderToTexture, streamingLevels) { - if (typeof streamingLevels === "undefined") { streamingLevels = 0; } - //TODO streaming - var texture = new stagegl.TextureWebGL(this._gl, width, height); - this._textureList.push(texture); - return texture; - }; - - ContextWebGL.prototype.createVertexBuffer = function (numVertices, data32PerVertex) { - var vertexBuffer = new stagegl.VertexBufferWebGL(this._gl, numVertices, data32PerVertex); - this._vertexBufferList.push(vertexBuffer); - return vertexBuffer; - }; - - ContextWebGL.prototype.dispose = function () { - var i; - for (i = 0; i < this._indexBufferList.length; ++i) - this._indexBufferList[i].dispose(); - - this._indexBufferList = null; - - for (i = 0; i < this._vertexBufferList.length; ++i) - this._vertexBufferList[i].dispose(); - - this._vertexBufferList = null; - - for (i = 0; i < this._textureList.length; ++i) - this._textureList[i].dispose(); - - this._textureList = null; - - for (i = 0; i < this._programList.length; ++i) - this._programList[i].dispose(); - - for (i = 0; i < this._samplerStates.length; ++i) - this._samplerStates[i] = null; - - this._programList = null; - }; - - ContextWebGL.prototype.drawToBitmapData = function (destination) { - var arrayBuffer = new ArrayBuffer(destination.width * destination.height * 4); - - this._gl.readPixels(0, 0, destination.width, destination.height, this._gl.RGBA, this._gl.UNSIGNED_BYTE, new Uint8Array(arrayBuffer)); - - var byteArray = new away.utils.ByteArray(); - byteArray.setArrayBuffer(arrayBuffer); - - destination.setPixels(new away.geom.Rectangle(0, 0, destination.width, destination.height), byteArray); - }; - - ContextWebGL.prototype.drawTriangles = function (indexBuffer, firstIndex, numTriangles) { - if (typeof firstIndex === "undefined") { firstIndex = 0; } - if (typeof numTriangles === "undefined") { numTriangles = -1; } - if (!this._drawing) - throw "Need to clear before drawing if the buffer has not been cleared since the last present() call."; - - this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, indexBuffer.glBuffer); - this._gl.drawElements(this._gl.TRIANGLES, (numTriangles == -1) ? indexBuffer.numIndices : numTriangles * 3, this._gl.UNSIGNED_SHORT, firstIndex); - }; - - ContextWebGL.prototype.present = function () { - this._drawing = false; - }; - - ContextWebGL.prototype.setBlendFactors = function (sourceFactor, destinationFactor) { - this._blendEnabled = true; - - this._blendSourceFactor = this._blendFactorDictionary[sourceFactor]; - - this._blendDestinationFactor = this._blendFactorDictionary[destinationFactor]; - - this.updateBlendStatus(); - }; - - ContextWebGL.prototype.setColorMask = function (red, green, blue, alpha) { - this._gl.colorMask(red, green, blue, alpha); - }; - - ContextWebGL.prototype.setCulling = function (triangleFaceToCull, coordinateSystem) { - if (typeof coordinateSystem === "undefined") { coordinateSystem = "leftHanded"; } - if (triangleFaceToCull == stagegl.ContextGLTriangleFace.NONE) { - this._gl.disable(this._gl.CULL_FACE); - } else { - this._gl.enable(this._gl.CULL_FACE); - switch (triangleFaceToCull) { - case stagegl.ContextGLTriangleFace.BACK: - this._gl.cullFace((coordinateSystem == "leftHanded") ? this._gl.FRONT : this._gl.BACK); - break; - case stagegl.ContextGLTriangleFace.FRONT: - this._gl.cullFace((coordinateSystem == "leftHanded") ? this._gl.BACK : this._gl.FRONT); - break; - case stagegl.ContextGLTriangleFace.FRONT_AND_BACK: - this._gl.cullFace(this._gl.FRONT_AND_BACK); - break; - default: - throw "Unknown ContextGLTriangleFace type."; - } - } - }; - - // TODO ContextGLCompareMode - ContextWebGL.prototype.setDepthTest = function (depthMask, passCompareMode) { - this._gl.depthFunc(this._depthTestDictionary[passCompareMode]); - - this._gl.depthMask(depthMask); - }; - - ContextWebGL.prototype.setProgram = function (program) { - //TODO decide on construction/reference resposibilities - this._currentProgram = program; - program.focusProgram(); - }; - - ContextWebGL.prototype.setProgramConstantsFromMatrix = function (programType, firstRegister, matrix, transposedMatrix) { - //this._gl.uniformMatrix4fv(this._gl.getUniformLocation(this._currentProgram.glProgram, this._uniformLocationNameDictionary[programType]), !transposedMatrix, new Float32Array(matrix.rawData)); - if (typeof transposedMatrix === "undefined") { transposedMatrix = false; } - //TODO remove special case for WebGL matrix calls? - var d = matrix.rawData; - if (transposedMatrix) { - this.setProgramConstantsFromArray(programType, firstRegister, [d[0], d[4], d[8], d[12]], 1); - this.setProgramConstantsFromArray(programType, firstRegister + 1, [d[1], d[5], d[9], d[13]], 1); - this.setProgramConstantsFromArray(programType, firstRegister + 2, [d[2], d[6], d[10], d[14]], 1); - this.setProgramConstantsFromArray(programType, firstRegister + 3, [d[3], d[7], d[11], d[15]], 1); - } else { - this.setProgramConstantsFromArray(programType, firstRegister, [d[0], d[1], d[2], d[3]], 1); - this.setProgramConstantsFromArray(programType, firstRegister + 1, [d[4], d[5], d[6], d[7]], 1); - this.setProgramConstantsFromArray(programType, firstRegister + 2, [d[8], d[9], d[10], d[11]], 1); - this.setProgramConstantsFromArray(programType, firstRegister + 3, [d[12], d[13], d[14], d[15]], 1); - } - }; - - ContextWebGL.prototype.setProgramConstantsFromArray = function (programType, firstRegister, data, numRegisters) { - if (typeof numRegisters === "undefined") { numRegisters = -1; } - var locationName = this._uniformLocationNameDictionary[programType]; - var startIndex; - for (var i = 0; i < numRegisters; i++) { - startIndex = i * 4; - this._gl.uniform4f(this._gl.getUniformLocation(this._currentProgram.glProgram, locationName + (firstRegister + i)), data[startIndex], data[startIndex + 1], data[startIndex + 2], data[startIndex + 3]); - } - }; - - ContextWebGL.prototype.setScissorRectangle = function (rectangle) { - if (!rectangle) { - this._gl.disable(this._gl.SCISSOR_TEST); - return; - } - - this._gl.enable(this._gl.SCISSOR_TEST); - this._gl.scissor(rectangle.x, rectangle.y, rectangle.width, rectangle.height); - }; - - ContextWebGL.prototype.setTextureAt = function (sampler, texture) { - var samplerState = this._samplerStates[sampler]; - - if (this._activeTexture != sampler && (texture || samplerState.type)) { - this._activeTexture = sampler; - this._gl.activeTexture(this._textureIndexDictionary[sampler]); - } - - if (!texture) { - if (samplerState.type) { - this._gl.bindTexture(samplerState.type, null); - samplerState.type = null; - } - - return; - } - - var textureType = this._textureTypeDictionary[texture.textureType]; - samplerState.type = textureType; - - this._gl.bindTexture(textureType, texture.glTexture); - - this._gl.uniform1i(this._gl.getUniformLocation(this._currentProgram.glProgram, "fs" + sampler), sampler); - - this._gl.texParameteri(textureType, this._gl.TEXTURE_WRAP_S, samplerState.wrap); - this._gl.texParameteri(textureType, this._gl.TEXTURE_WRAP_T, samplerState.wrap); - - this._gl.texParameteri(textureType, this._gl.TEXTURE_MAG_FILTER, samplerState.filter); - this._gl.texParameteri(textureType, this._gl.TEXTURE_MIN_FILTER, samplerState.mipfilter); - }; - - ContextWebGL.prototype.setSamplerStateAt = function (sampler, wrap, filter, mipfilter) { - if (0 <= sampler && sampler < ContextWebGL.MAX_SAMPLERS) { - this._samplerStates[sampler].wrap = this._wrapDictionary[wrap]; - this._samplerStates[sampler].filter = this._filterDictionary[filter]; - this._samplerStates[sampler].mipfilter = this._mipmapFilterDictionary[filter][mipfilter]; - } else { - throw "Sampler is out of bounds."; - } - }; - - ContextWebGL.prototype.setVertexBufferAt = function (index, buffer, bufferOffset, format) { - if (typeof bufferOffset === "undefined") { bufferOffset = 0; } - if (typeof format === "undefined") { format = null; } - var location = this._currentProgram ? this._gl.getAttribLocation(this._currentProgram.glProgram, "va" + index) : -1; - - if (!buffer) { - if (location > -1) - this._gl.disableVertexAttribArray(location); - - return; - } - - this._gl.bindBuffer(this._gl.ARRAY_BUFFER, buffer.glBuffer); - this._gl.enableVertexAttribArray(location); - this._gl.vertexAttribPointer(location, this._vertexBufferDimensionDictionary[format], this._gl.FLOAT, false, buffer.data32PerVertex * 4, bufferOffset * 4); - }; - - ContextWebGL.prototype.setRenderToTexture = function (target, enableDepthAndStencil, antiAlias, surfaceSelector) { - if (typeof enableDepthAndStencil === "undefined") { enableDepthAndStencil = false; } - if (typeof antiAlias === "undefined") { antiAlias = 0; } - if (typeof surfaceSelector === "undefined") { surfaceSelector = 0; } - var texture = target; - var frameBuffer = texture.frameBuffer; - this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, frameBuffer); - - if (enableDepthAndStencil) { - this._gl.enable(this._gl.STENCIL_TEST); - this._gl.enable(this._gl.DEPTH_TEST); - } - - this._gl.viewport(0, 0, texture.width, texture.height); - }; - - ContextWebGL.prototype.setRenderToBackBuffer = function () { - this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, null); - }; - - ContextWebGL.prototype.updateBlendStatus = function () { - if (this._blendEnabled) { - this._gl.enable(this._gl.BLEND); - this._gl.blendEquation(this._gl.FUNC_ADD); - this._gl.blendFunc(this._blendSourceFactor, this._blendDestinationFactor); - } else { - this._gl.disable(this._gl.BLEND); - } - }; - ContextWebGL.MAX_SAMPLERS = 8; - - ContextWebGL.modulo = 0; - return ContextWebGL; - })(stagegl.ContextGLBase); - stagegl.ContextWebGL = ContextWebGL; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (stagegl) { - var ResourceBaseFlash = (function () { - function ResourceBaseFlash() { - } - Object.defineProperty(ResourceBaseFlash.prototype, "id", { - get: function () { - return this._pId; - }, - enumerable: true, - configurable: true - }); - - ResourceBaseFlash.prototype.dispose = function () { - }; - return ResourceBaseFlash; - })(); - stagegl.ResourceBaseFlash = ResourceBaseFlash; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (stagegl) { - var TextureBaseWebGL = (function () { - function TextureBaseWebGL(gl) { - this.textureType = ""; - this._gl = gl; - } - TextureBaseWebGL.prototype.dispose = function () { - throw "Abstract method must be overridden."; - }; - - Object.defineProperty(TextureBaseWebGL.prototype, "glTexture", { - get: function () { - throw new away.errors.AbstractMethodError(); - }, - enumerable: true, - configurable: true - }); - return TextureBaseWebGL; - })(); - stagegl.TextureBaseWebGL = TextureBaseWebGL; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (stagegl) { - var ByteArrayBase = away.utils.ByteArrayBase; - - var CubeTextureFlash = (function (_super) { - __extends(CubeTextureFlash, _super); - function CubeTextureFlash(context, size, format, forRTT, streaming) { - if (typeof streaming === "undefined") { streaming = false; } - _super.call(this); - - this._context = context; - this._size = size; - - this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.initCubeTexture, (forRTT ? away.stagegl.OpCodes.trueValue : away.stagegl.OpCodes.falseValue)) + size + "," + streaming + "," + format + "$"); - this._pId = this._context.execute(); - this._context._iAddResource(this); - } - Object.defineProperty(CubeTextureFlash.prototype, "size", { - get: function () { - return this._size; - }, - enumerable: true, - configurable: true - }); - - CubeTextureFlash.prototype.dispose = function () { - this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.disposeCubeTexture) + this._pId.toString() + ","); - this._context.execute(); - this._context._iRemoveResource(this); - - this._context = null; - }; - - CubeTextureFlash.prototype.uploadFromData = function (data, side, miplevel) { - if (typeof miplevel === "undefined") { miplevel = 0; } - if (data instanceof away.base.BitmapData) { - data = data.imageData.data; - } else if (data instanceof HTMLImageElement) { - var can = document.createElement("canvas"); - var w = data.width; - var h = data.height; - can.width = w; - can.height = h; - var ctx = can.getContext("2d"); - ctx.drawImage(data, 0, 0); - data = ctx.getImageData(0, 0, w, h).data; - } - - var pos = 0; - var bytes = ByteArrayBase.internalGetBase64String(data.length, function () { - return data[pos++]; - }, null); - - this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.uploadBytesCubeTexture) + this._pId + "," + miplevel + "," + side + "," + (this.size >> miplevel) + "," + bytes + "%"); - this._context.execute(); - }; - - CubeTextureFlash.prototype.uploadCompressedTextureFromByteArray = function (data, byteArrayOffset /*uint*/ , async) { - if (typeof async === "undefined") { async = false; } - }; - return CubeTextureFlash; - })(stagegl.ResourceBaseFlash); - stagegl.CubeTextureFlash = CubeTextureFlash; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (stagegl) { - var CubeTextureWebGL = (function (_super) { - __extends(CubeTextureWebGL, _super); - function CubeTextureWebGL(gl, size) { - _super.call(this, gl); - this._textureSelectorDictionary = new Array(6); - this.textureType = "textureCube"; - this._size = size; - this._texture = this._gl.createTexture(); - - this._textureSelectorDictionary[0] = gl.TEXTURE_CUBE_MAP_POSITIVE_X; - this._textureSelectorDictionary[1] = gl.TEXTURE_CUBE_MAP_NEGATIVE_X; - this._textureSelectorDictionary[2] = gl.TEXTURE_CUBE_MAP_POSITIVE_Y; - this._textureSelectorDictionary[3] = gl.TEXTURE_CUBE_MAP_NEGATIVE_Y; - this._textureSelectorDictionary[4] = gl.TEXTURE_CUBE_MAP_POSITIVE_Z; - this._textureSelectorDictionary[5] = gl.TEXTURE_CUBE_MAP_NEGATIVE_Z; - } - CubeTextureWebGL.prototype.dispose = function () { - this._gl.deleteTexture(this._texture); - }; - - CubeTextureWebGL.prototype.uploadFromData = function (data, side, miplevel) { - if (typeof miplevel === "undefined") { miplevel = 0; } - if (data instanceof away.base.BitmapData) - data = data.imageData; - - this._gl.bindTexture(this._gl.TEXTURE_CUBE_MAP, this._texture); - this._gl.texImage2D(this._textureSelectorDictionary[side], miplevel, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, data); - this._gl.bindTexture(this._gl.TEXTURE_CUBE_MAP, null); - }; - - CubeTextureWebGL.prototype.uploadCompressedTextureFromByteArray = function (data, byteArrayOffset /*uint*/ , async) { - if (typeof async === "undefined") { async = false; } - }; - - Object.defineProperty(CubeTextureWebGL.prototype, "size", { - get: function () { - return this._size; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(CubeTextureWebGL.prototype, "glTexture", { - get: function () { - return this._texture; - }, - enumerable: true, - configurable: true - }); - return CubeTextureWebGL; - })(stagegl.TextureBaseWebGL); - stagegl.CubeTextureWebGL = CubeTextureWebGL; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (stagegl) { - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -/// -/// -/// -var away; -(function (away) { - (function (stagegl) { - var IndexBufferFlash = (function (_super) { - __extends(IndexBufferFlash, _super); - function IndexBufferFlash(context, numIndices) { - _super.call(this); - - this._context = context; - this._numIndices = numIndices; - this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.initIndexBuffer, numIndices + away.stagegl.OpCodes.intMask)); - this._pId = this._context.execute(); - this._context._iAddResource(this); - } - IndexBufferFlash.prototype.uploadFromArray = function (data, startOffset, count) { - this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.uploadArrayIndexBuffer, this._pId + away.stagegl.OpCodes.intMask) + data.join() + "#" + startOffset + "," + count + ","); - this._context.execute(); - }; - - IndexBufferFlash.prototype.dispose = function () { - this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.disposeIndexBuffer, this._pId + away.stagegl.OpCodes.intMask)); - this._context.execute(); - this._context._iRemoveResource(this); - - this._context = null; - }; - - Object.defineProperty(IndexBufferFlash.prototype, "numIndices", { - get: function () { - return this._numIndices; - }, - enumerable: true, - configurable: true - }); - return IndexBufferFlash; - })(stagegl.ResourceBaseFlash); - stagegl.IndexBufferFlash = IndexBufferFlash; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (stagegl) { - var IndexBufferWebGL = (function () { - function IndexBufferWebGL(gl, numIndices) { - this._gl = gl; - this._buffer = this._gl.createBuffer(); - this._numIndices = numIndices; - } - IndexBufferWebGL.prototype.uploadFromArray = function (data, startOffset, count) { - this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, this._buffer); - - // TODO add index offsets - this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(data), this._gl.STATIC_DRAW); - }; - - IndexBufferWebGL.prototype.dispose = function () { - this._gl.deleteBuffer(this._buffer); - }; - - Object.defineProperty(IndexBufferWebGL.prototype, "numIndices", { - get: function () { - return this._numIndices; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(IndexBufferWebGL.prototype, "glBuffer", { - get: function () { - return this._buffer; - }, - enumerable: true, - configurable: true - }); - return IndexBufferWebGL; - })(); - stagegl.IndexBufferWebGL = IndexBufferWebGL; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (stagegl) { - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -/// -/// -/// -/// -var away; -(function (away) { - (function (stagegl) { - var OpCodes = (function () { - function OpCodes() { - } - OpCodes.trueValue = 32; - OpCodes.falseValue = 33; - OpCodes.intMask = 63; - OpCodes.drawTriangles = 41; - OpCodes.setProgramConstant = 42; - OpCodes.setProgram = 43; - OpCodes.present = 44; - OpCodes.clear = 45; - OpCodes.initProgram = 46; - OpCodes.initVertexBuffer = 47; - OpCodes.initIndexBuffer = 48; - OpCodes.configureBackBuffer = 49; - OpCodes.uploadArrayIndexBuffer = 50; - OpCodes.uploadArrayVertexBuffer = 51; - OpCodes.uploadAGALBytesProgram = 52; - OpCodes.setVertexBufferAt = 53; - OpCodes.uploadBytesIndexBuffer = 54; - OpCodes.uploadBytesVertexBuffer = 55; - OpCodes.setColorMask = 56; - OpCodes.setDepthTest = 57; - OpCodes.disposeProgram = 58; - OpCodes.disposeContext = 59; - - OpCodes.disposeVertexBuffer = 61; - - OpCodes.disposeIndexBuffer = 63; - OpCodes.initTexture = 64; - OpCodes.setTextureAt = 65; - OpCodes.uploadBytesTexture = 66; - OpCodes.disposeTexture = 67; - OpCodes.setCulling = 68; - OpCodes.setScissorRect = 69; - OpCodes.clearScissorRect = 70; - OpCodes.setBlendFactors = 71; - OpCodes.setRenderToTexture = 72; - OpCodes.clearTextureAt = 73; - OpCodes.clearVertexBufferAt = 74; - OpCodes.setStencilActions = 75; - OpCodes.setStencilReferenceValue = 76; - OpCodes.initCubeTexture = 77; - OpCodes.disposeCubeTexture = 78; - OpCodes.uploadBytesCubeTexture = 79; - OpCodes.clearRenderToTexture = 80; - OpCodes.enableErrorChecking = 81; - return OpCodes; - })(); - stagegl.OpCodes = OpCodes; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (stagegl) { - var ProgramFlash = (function (_super) { - __extends(ProgramFlash, _super); - function ProgramFlash(context) { - _super.call(this); - - this._context = context; - this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.initProgram)); - this._pId = this._context.execute(); - this._context._iAddResource(this); - } - ProgramFlash.prototype.upload = function (vertexProgram, fragmentProgram) { - this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.uploadAGALBytesProgram, this._pId + away.stagegl.OpCodes.intMask) + vertexProgram.readBase64String(vertexProgram.length) + "%" + fragmentProgram.readBase64String(fragmentProgram.length) + "%"); - - if (stagegl.ContextStage3D.debug) - this._context.execute(); - }; - - ProgramFlash.prototype.dispose = function () { - this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.disposeProgram, this._pId + away.stagegl.OpCodes.intMask)); - this._context.execute(); - this._context._iRemoveResource(this); - - this._context = null; - }; - return ProgramFlash; - })(stagegl.ResourceBaseFlash); - stagegl.ProgramFlash = ProgramFlash; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (stagegl) { - var ProgramWebGL = (function () { - function ProgramWebGL(gl) { - this._gl = gl; - this._program = this._gl.createProgram(); - } - ProgramWebGL.prototype.upload = function (vertexProgram, fragmentProgram) { - var vertexString = ProgramWebGL._aglslParser.parse(ProgramWebGL._tokenizer.decribeAGALByteArray(vertexProgram)); - var fragmentString = ProgramWebGL._aglslParser.parse(ProgramWebGL._tokenizer.decribeAGALByteArray(fragmentProgram)); - - this._vertexShader = this._gl.createShader(this._gl.VERTEX_SHADER); - this._fragmentShader = this._gl.createShader(this._gl.FRAGMENT_SHADER); - - this._gl.shaderSource(this._vertexShader, vertexString); - this._gl.compileShader(this._vertexShader); - - if (!this._gl.getShaderParameter(this._vertexShader, this._gl.COMPILE_STATUS)) { - throw new Error(this._gl.getShaderInfoLog(this._vertexShader)); - return; - } - - this._gl.shaderSource(this._fragmentShader, fragmentString); - this._gl.compileShader(this._fragmentShader); - - if (!this._gl.getShaderParameter(this._fragmentShader, this._gl.COMPILE_STATUS)) { - throw new Error(this._gl.getShaderInfoLog(this._fragmentShader)); - return; - } - - this._gl.attachShader(this._program, this._vertexShader); - this._gl.attachShader(this._program, this._fragmentShader); - this._gl.linkProgram(this._program); - - if (!this._gl.getProgramParameter(this._program, this._gl.LINK_STATUS)) { - throw new Error(this._gl.getProgramInfoLog(this._program)); - } - }; - - ProgramWebGL.prototype.dispose = function () { - this._gl.deleteProgram(this._program); - }; - - ProgramWebGL.prototype.focusProgram = function () { - this._gl.useProgram(this._program); - }; - - Object.defineProperty(ProgramWebGL.prototype, "glProgram", { - get: function () { - return this._program; - }, - enumerable: true, - configurable: true - }); - ProgramWebGL._tokenizer = new aglsl.AGALTokenizer(); - ProgramWebGL._aglslParser = new aglsl.AGLSLParser(); - return ProgramWebGL; - })(); - stagegl.ProgramWebGL = ProgramWebGL; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (stagegl) { - var SamplerState = (function () { - function SamplerState() { - } - return SamplerState; - })(); - stagegl.SamplerState = SamplerState; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (stagegl) { - var ByteArrayBase = away.utils.ByteArrayBase; - - var TextureFlash = (function (_super) { - __extends(TextureFlash, _super); - function TextureFlash(context, width, height, format, forRTT, streaming) { - if (typeof streaming === "undefined") { streaming = false; } - _super.call(this); - - this._context = context; - this._width = width; - this._height = height; - - this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.initTexture, (forRTT ? away.stagegl.OpCodes.trueValue : away.stagegl.OpCodes.falseValue)) + width + "," + height + "," + streaming + "," + format + "$"); - this._pId = this._context.execute(); - this._context._iAddResource(this); - } - Object.defineProperty(TextureFlash.prototype, "width", { - get: function () { - return this._width; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TextureFlash.prototype, "height", { - get: function () { - return this._height; - }, - enumerable: true, - configurable: true - }); - - TextureFlash.prototype.dispose = function () { - this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.disposeTexture) + this._pId.toString() + ","); - this._context.execute(); - this._context._iRemoveResource(this); - - this._context = null; - }; - - TextureFlash.prototype.uploadFromData = function (data, miplevel) { - if (typeof miplevel === "undefined") { miplevel = 0; } - if (data instanceof away.base.BitmapData) { - data = data.imageData.data; - } else if (data instanceof HTMLImageElement) { - var can = document.createElement("canvas"); - var w = data.width; - var h = data.height; - can.width = w; - can.height = h; - var ctx = can.getContext("2d"); - ctx.drawImage(data, 0, 0); - data = ctx.getImageData(0, 0, w, h).data; - } - - var pos = 0; - var bytes = ByteArrayBase.internalGetBase64String(data.length, function () { - return data[pos++]; - }, null); - - this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.uploadBytesTexture) + this._pId + "," + miplevel + "," + (this._width >> miplevel) + "," + (this._height >> miplevel) + "," + bytes + "%"); - this._context.execute(); - }; - return TextureFlash; - })(stagegl.ResourceBaseFlash); - stagegl.TextureFlash = TextureFlash; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (stagegl) { - var TextureWebGL = (function (_super) { - __extends(TextureWebGL, _super); - function TextureWebGL(gl, width, height) { - _super.call(this, gl); - this.textureType = "texture2d"; - this._width = width; - this._height = height; - - this._glTexture = this._gl.createTexture(); - } - TextureWebGL.prototype.dispose = function () { - this._gl.deleteTexture(this._glTexture); - }; - - Object.defineProperty(TextureWebGL.prototype, "width", { - get: function () { - return this._width; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TextureWebGL.prototype, "height", { - get: function () { - return this._height; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TextureWebGL.prototype, "frameBuffer", { - get: function () { - if (!this._frameBuffer) { - this._frameBuffer = this._gl.createFramebuffer(); - this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, this._frameBuffer); - this._gl.bindTexture(this._gl.TEXTURE_2D, this._glTexture); - this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, this._width, this._height, 0, this._gl.RGBA, this._gl.UNSIGNED_BYTE, null); - - var renderBuffer = this._gl.createRenderbuffer(); - this._gl.bindRenderbuffer(this._gl.RENDERBUFFER, renderBuffer); - this._gl.renderbufferStorage(this._gl.RENDERBUFFER, this._gl.DEPTH_COMPONENT16, this._width, this._height); - - this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.COLOR_ATTACHMENT0, this._gl.TEXTURE_2D, this._glTexture, 0); - this._gl.framebufferRenderbuffer(this._gl.FRAMEBUFFER, this._gl.DEPTH_ATTACHMENT, this._gl.RENDERBUFFER, renderBuffer); - - this._gl.bindTexture(this._gl.TEXTURE_2D, null); - this._gl.bindRenderbuffer(this._gl.RENDERBUFFER, null); - this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, null); - } - - return this._frameBuffer; - }, - enumerable: true, - configurable: true - }); - - TextureWebGL.prototype.uploadFromData = function (data, miplevel) { - if (typeof miplevel === "undefined") { miplevel = 0; } - if (data instanceof away.base.BitmapData) - data = data.imageData; - - this._gl.bindTexture(this._gl.TEXTURE_2D, this._glTexture); - this._gl.texImage2D(this._gl.TEXTURE_2D, miplevel, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, data); - this._gl.bindTexture(this._gl.TEXTURE_2D, null); - }; - - TextureWebGL.prototype.uploadCompressedTextureFromByteArray = function (data, byteArrayOffset /*uint*/ , async) { - if (typeof async === "undefined") { async = false; } - var ext = this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"); - //this._gl.compressedTexImage2D(this._gl.TEXTURE_2D, 0, this) - }; - - Object.defineProperty(TextureWebGL.prototype, "glTexture", { - get: function () { - return this._glTexture; - }, - enumerable: true, - configurable: true - }); - - TextureWebGL.prototype.generateMipmaps = function () { - //TODO: implement generating mipmaps - //this._gl.bindTexture( this._gl.TEXTURE_2D, this._glTexture ); - //this._gl.generateMipmap(this._gl.TEXTURE_2D); - //this._gl.bindTexture( this._gl.TEXTURE_2D, null ); - }; - return TextureWebGL; - })(stagegl.TextureBaseWebGL); - stagegl.TextureWebGL = TextureWebGL; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (stagegl) { - var VertexBufferFlash = (function (_super) { - __extends(VertexBufferFlash, _super); - function VertexBufferFlash(context, numVertices, data32PerVertex) { - _super.call(this); - - this._context = context; - this._numVertices = numVertices; - this._data32PerVertex = data32PerVertex; - this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.initVertexBuffer, data32PerVertex + away.stagegl.OpCodes.intMask) + numVertices.toString() + ","); - this._pId = this._context.execute(); - this._context._iAddResource(this); - } - VertexBufferFlash.prototype.uploadFromArray = function (data, startVertex, numVertices) { - this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.uploadArrayVertexBuffer, this._pId + away.stagegl.OpCodes.intMask) + data.join() + "#" + [startVertex, numVertices].join() + ","); - this._context.execute(); - }; - - Object.defineProperty(VertexBufferFlash.prototype, "numVertices", { - get: function () { - return this._numVertices; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(VertexBufferFlash.prototype, "data32PerVertex", { - get: function () { - return this._data32PerVertex; - }, - enumerable: true, - configurable: true - }); - - VertexBufferFlash.prototype.dispose = function () { - this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.disposeVertexBuffer, this._pId + away.stagegl.OpCodes.intMask)); - this._context.execute(); - this._context._iRemoveResource(this); - - this._context = null; - }; - return VertexBufferFlash; - })(stagegl.ResourceBaseFlash); - stagegl.VertexBufferFlash = VertexBufferFlash; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (stagegl) { - var VertexBufferWebGL = (function () { - function VertexBufferWebGL(gl, numVertices, data32PerVertex) { - this._gl = gl; - this._buffer = this._gl.createBuffer(); - this._numVertices = numVertices; - this._data32PerVertex = data32PerVertex; - } - VertexBufferWebGL.prototype.uploadFromArray = function (vertices, startVertex, numVertices) { - this._gl.bindBuffer(this._gl.ARRAY_BUFFER, this._buffer); - - //console.log( "** WARNING upload not fully implemented, startVertex & numVertices not considered." ); - // TODO add offsets , startVertex, numVertices * this._data32PerVertex - this._gl.bufferData(this._gl.ARRAY_BUFFER, new Float32Array(vertices), this._gl.STATIC_DRAW); - }; - - Object.defineProperty(VertexBufferWebGL.prototype, "numVertices", { - get: function () { - return this._numVertices; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(VertexBufferWebGL.prototype, "data32PerVertex", { - get: function () { - return this._data32PerVertex; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(VertexBufferWebGL.prototype, "glBuffer", { - get: function () { - return this._buffer; - }, - enumerable: true, - configurable: true - }); - - VertexBufferWebGL.prototype.dispose = function () { - this._gl.deleteBuffer(this._buffer); - }; - return VertexBufferWebGL; - })(); - stagegl.VertexBufferWebGL = VertexBufferWebGL; - })(away.stagegl || (away.stagegl = {})); - var stagegl = away.stagegl; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (managers) { - var StageEvent = away.events.StageEvent; - - var AGALProgramCache = (function () { - function AGALProgramCache(stage, agalProgramCacheSingletonEnforcer) { - if (!agalProgramCacheSingletonEnforcer) - throw new Error("This class is a multiton and cannot be instantiated manually. Use StageManager.getInstance instead."); - - this._stage = stage; - - this._program3Ds = new Object(); - this._ids = new Object(); - this._usages = new Object(); - this._keys = new Object(); - } - AGALProgramCache.getInstance = function (stage) { - var index = stage.stageIndex; - - if (AGALProgramCache._instances == null) - AGALProgramCache._instances = new Array(8); - - if (!AGALProgramCache._instances[index]) { - AGALProgramCache._instances[index] = new AGALProgramCache(stage, new AGALProgramCacheSingletonEnforcer()); - - stage.addEventListener(StageEvent.CONTEXT_DISPOSED, AGALProgramCache.onContextGLDisposed); - stage.addEventListener(StageEvent.CONTEXT_CREATED, AGALProgramCache.onContextGLDisposed); - stage.addEventListener(StageEvent.CONTEXT_RECREATED, AGALProgramCache.onContextGLDisposed); - } - - return AGALProgramCache._instances[index]; - }; - - AGALProgramCache.getInstanceFromIndex = function (index) { - if (!AGALProgramCache._instances[index]) - throw new Error("Instance not created yet!"); - - return AGALProgramCache._instances[index]; - }; - - AGALProgramCache.onContextGLDisposed = function (event) { - var stage = event.target; - - var index = stage.stageIndex; - - AGALProgramCache._instances[index].dispose(); - AGALProgramCache._instances[index] = null; - - stage.removeEventListener(StageEvent.CONTEXT_DISPOSED, AGALProgramCache.onContextGLDisposed); - stage.removeEventListener(StageEvent.CONTEXT_CREATED, AGALProgramCache.onContextGLDisposed); - stage.removeEventListener(StageEvent.CONTEXT_RECREATED, AGALProgramCache.onContextGLDisposed); - }; - - AGALProgramCache.prototype.dispose = function () { - for (var key in this._program3Ds) - this.destroyProgram(key); - - this._keys = null; - this._program3Ds = null; - this._usages = null; - }; - - AGALProgramCache.prototype.setProgram = function (programIds, programs, vertexCode, fragmentCode) { - //TODO move program id arrays into stagegl - var stageIndex = this._stage.stageIndex; - var program; - var key = this.getKey(vertexCode, fragmentCode); - - if (this._program3Ds[key] == null) { - this._keys[AGALProgramCache._currentId] = key; - this._usages[AGALProgramCache._currentId] = 0; - this._ids[key] = AGALProgramCache._currentId; - ++AGALProgramCache._currentId; - - program = this._stage.context.createProgram(); - - var vertexByteCode = (new aglsl.assembler.AGALMiniAssembler().assemble("part vertex 1\n" + vertexCode + "endpart"))['vertex'].data; - var fragmentByteCode = (new aglsl.assembler.AGALMiniAssembler().assemble("part fragment 1\n" + fragmentCode + "endpart"))['fragment'].data; - program.upload(vertexByteCode, fragmentByteCode); - - this._program3Ds[key] = program; - } - - var oldId = programIds[stageIndex]; - var newId = this._ids[key]; - - if (oldId != newId) { - if (oldId >= 0) - this.freeProgram(oldId); - - this._usages[newId]++; - } - - programIds[stageIndex] = newId; - programs[stageIndex] = this._program3Ds[key]; - }; - - AGALProgramCache.prototype.freeProgram = function (programId) { - this._usages[programId]--; - - if (this._usages[programId] == 0) - this.destroyProgram(this._keys[programId]); - }; - - AGALProgramCache.prototype.destroyProgram = function (key) { - this._program3Ds[key].dispose(); - this._program3Ds[key] = null; - - delete this._program3Ds[key]; - - this._ids[key] = -1; - }; - - AGALProgramCache.prototype.getKey = function (vertexCode, fragmentCode) { - return vertexCode + "---" + fragmentCode; - }; - AGALProgramCache._currentId = 0; - return AGALProgramCache; - })(); - managers.AGALProgramCache = AGALProgramCache; - })(away.managers || (away.managers = {})); - var managers = away.managers; -})(away || (away = {})); - -var AGALProgramCacheSingletonEnforcer = (function () { - function AGALProgramCacheSingletonEnforcer() { - } - return AGALProgramCacheSingletonEnforcer; -})(); -/// -var away; -(function (away) { - (function (managers) { - var RTTBufferManager = (function (_super) { - __extends(RTTBufferManager, _super); - function RTTBufferManager(se, stage) { - _super.call(this); - this._viewWidth = -1; - this._viewHeight = -1; - this._textureWidth = -1; - this._textureHeight = -1; - this._buffersInvalid = true; - - if (!se) - throw new Error("No cheating the multiton!"); - - this._renderToTextureRect = new away.geom.Rectangle(); - - this._stage = stage; - } - RTTBufferManager.getInstance = function (stage) { - if (!stage) - throw new Error("stage key cannot be null!"); - - if (RTTBufferManager._instances == null) - RTTBufferManager._instances = new Array(); - - var rttBufferManager = RTTBufferManager.getRTTBufferManagerFromStage(stage); - - if (rttBufferManager == null) { - rttBufferManager = new RTTBufferManager(new SingletonEnforcer(), stage); - - var vo = new RTTBufferManagerVO(); - - vo.stage3d = stage; - vo.rttbfm = rttBufferManager; - - RTTBufferManager._instances.push(vo); - } - - return rttBufferManager; - }; - - RTTBufferManager.getRTTBufferManagerFromStage = function (stage) { - var l = RTTBufferManager._instances.length; - var r; - - for (var c = 0; c < l; c++) { - r = RTTBufferManager._instances[c]; - - if (r.stage3d === stage) - return r.rttbfm; - } - - return null; - }; - - RTTBufferManager.deleteRTTBufferManager = function (stage) { - var l = RTTBufferManager._instances.length; - var r; - - for (var c = 0; c < l; c++) { - r = RTTBufferManager._instances[c]; - - if (r.stage3d === stage) { - RTTBufferManager._instances.splice(c, 1); - return; - } - } - }; - - Object.defineProperty(RTTBufferManager.prototype, "textureRatioX", { - get: function () { - if (this._buffersInvalid) - this.updateRTTBuffers(); - - return this._textureRatioX; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(RTTBufferManager.prototype, "textureRatioY", { - get: function () { - if (this._buffersInvalid) - this.updateRTTBuffers(); - - return this._textureRatioY; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(RTTBufferManager.prototype, "viewWidth", { - get: function () { - return this._viewWidth; - }, - set: function (value) { - if (value == this._viewWidth) - return; - - this._viewWidth = value; - - this._buffersInvalid = true; - - this._textureWidth = away.utils.TextureUtils.getBestPowerOf2(this._viewWidth); - - if (this._textureWidth > this._viewWidth) { - this._renderToTextureRect.x = Math.floor((this._textureWidth - this._viewWidth) * .5); - this._renderToTextureRect.width = this._viewWidth; - } else { - this._renderToTextureRect.x = 0; - this._renderToTextureRect.width = this._textureWidth; - } - - this.dispatchEvent(new away.events.Event(away.events.Event.RESIZE)); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(RTTBufferManager.prototype, "viewHeight", { - get: function () { - return this._viewHeight; - }, - set: function (value) { - if (value == this._viewHeight) - return; - - this._viewHeight = value; - - this._buffersInvalid = true; - - this._textureHeight = away.utils.TextureUtils.getBestPowerOf2(this._viewHeight); - - if (this._textureHeight > this._viewHeight) { - this._renderToTextureRect.y = Math.floor((this._textureHeight - this._viewHeight) * .5); - this._renderToTextureRect.height = this._viewHeight; - } else { - this._renderToTextureRect.y = 0; - this._renderToTextureRect.height = this._textureHeight; - } - - this.dispatchEvent(new away.events.Event(away.events.Event.RESIZE)); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(RTTBufferManager.prototype, "renderToTextureVertexBuffer", { - get: function () { - if (this._buffersInvalid) - this.updateRTTBuffers(); - - return this._renderToTextureVertexBuffer; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(RTTBufferManager.prototype, "renderToScreenVertexBuffer", { - get: function () { - if (this._buffersInvalid) - this.updateRTTBuffers(); - - return this._renderToScreenVertexBuffer; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(RTTBufferManager.prototype, "indexBuffer", { - get: function () { - return this._indexBuffer; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(RTTBufferManager.prototype, "renderToTextureRect", { - get: function () { - if (this._buffersInvalid) - this.updateRTTBuffers(); - - return this._renderToTextureRect; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(RTTBufferManager.prototype, "textureWidth", { - get: function () { - return this._textureWidth; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(RTTBufferManager.prototype, "textureHeight", { - get: function () { - return this._textureHeight; - }, - enumerable: true, - configurable: true - }); - - RTTBufferManager.prototype.dispose = function () { - RTTBufferManager.deleteRTTBufferManager(this._stage); - - if (this._indexBuffer) { - this._indexBuffer.dispose(); - this._renderToScreenVertexBuffer.dispose(); - this._renderToTextureVertexBuffer.dispose(); - this._renderToScreenVertexBuffer = null; - this._renderToTextureVertexBuffer = null; - this._indexBuffer = null; - } - }; - - // todo: place all this in a separate model, since it's used all over the place - // maybe it even has a place in the core (together with screenRect etc)? - // needs to be stored per view of course - RTTBufferManager.prototype.updateRTTBuffers = function () { - var context = this._stage.context; - var textureVerts; - var screenVerts; - - var x; - var y; - - if (this._renderToTextureVertexBuffer == null) - this._renderToTextureVertexBuffer = context.createVertexBuffer(4, 5); - - if (this._renderToScreenVertexBuffer == null) - this._renderToScreenVertexBuffer = context.createVertexBuffer(4, 5); - - if (!this._indexBuffer) { - this._indexBuffer = context.createIndexBuffer(6); - - this._indexBuffer.uploadFromArray([2, 1, 0, 3, 2, 0], 0, 6); - } - - this._textureRatioX = x = Math.min(this._viewWidth / this._textureWidth, 1); - this._textureRatioY = y = Math.min(this._viewHeight / this._textureHeight, 1); - - var u1 = (1 - x) * .5; - var u2 = (x + 1) * .5; - var v1 = (y + 1) * .5; - var v2 = (1 - y) * .5; - - // last element contains indices for data per vertex that can be passed to the vertex shader if necessary (ie: frustum corners for deferred rendering) - textureVerts = [-x, -y, u1, v1, 0, x, -y, u2, v1, 1, x, y, u2, v2, 2, -x, y, u1, v2, 3]; - - screenVerts = [-1, -1, u1, v1, 0, 1, -1, u2, v1, 1, 1, 1, u2, v2, 2, -1, 1, u1, v2, 3]; - - this._renderToTextureVertexBuffer.uploadFromArray(textureVerts, 0, 4); - this._renderToScreenVertexBuffer.uploadFromArray(screenVerts, 0, 4); - - this._buffersInvalid = false; - }; - return RTTBufferManager; - })(away.events.EventDispatcher); - managers.RTTBufferManager = RTTBufferManager; - - var RTTBufferManagerVO = (function () { - function RTTBufferManagerVO() { - } - return RTTBufferManagerVO; - })(); - })(away.managers || (away.managers = {})); - var managers = away.managers; -})(away || (away = {})); - -var SingletonEnforcer = (function () { - function SingletonEnforcer() { - } - return SingletonEnforcer; -})(); -/// -var away; -(function (away) { - (function (materials) { - var TriangleSubGeometry = away.base.TriangleSubGeometry; - - var ContextGLTriangleFace = away.stagegl.ContextGLTriangleFace; - - /** - * ShaderObjectBase keeps track of the number of dependencies for "named registers" used across a pass. - * Named registers are that are not necessarily limited to a single method. They are created by the compiler and - * passed on to methods. The compiler uses the results to reserve usages through RegisterPool, which can be removed - * each time a method has been compiled into the shader. - * - * @see RegisterPool.addUsage - */ - var ShaderObjectBase = (function () { - /** - * Creates a new MethodCompilerVO object. - */ - function ShaderObjectBase(profile) { - this._defaultCulling = ContextGLTriangleFace.BACK; - this._pInverseSceneMatrix = new Array(); - //set ambient values to default - this.ambientR = 0xFF; - this.ambientG = 0xFF; - this.ambientB = 0xFF; - /** - * Indicates whether there are any dependencies on the world-space position vector. - */ - this.usesGlobalPosFragment = false; - this.vertexConstantData = new Array(); - this.fragmentConstantData = new Array(); - this.profile = profile; - } - /** - * Factory method to create a concrete compiler object for this object - * - * @param materialPassVO - * @returns {away.materials.ShaderCompilerBase} - */ - ShaderObjectBase.prototype.createCompiler = function (material, materialPass) { - return new materials.ShaderCompilerBase(material, materialPass, this); - }; - - /** - * Clears dependency counts for all registers. Called when recompiling a pass. - */ - ShaderObjectBase.prototype.reset = function () { - this.projectionDependencies = 0; - this.normalDependencies = 0; - this.viewDirDependencies = 0; - this.uvDependencies = 0; - this.secondaryUVDependencies = 0; - this.globalPosDependencies = 0; - this.tangentDependencies = 0; - this.usesGlobalPosFragment = false; - this.usesFragmentAnimation = false; - this.usesTangentSpace = false; - this.outputsNormals = false; - this.outputsTangentNormals = false; - }; - - /** - * Adds any external world space dependencies, used to force world space calculations. - */ - ShaderObjectBase.prototype.addWorldSpaceDependencies = function (fragmentLights) { - if (this.viewDirDependencies > 0) - ++this.globalPosDependencies; - }; - - ShaderObjectBase.prototype.pInitRegisterIndices = function () { - this.commonsDataIndex = -1; - this.cameraPositionIndex = -1; - this.uvBufferIndex = -1; - this.uvTransformIndex = -1; - this.secondaryUVBufferIndex = -1; - this.normalBufferIndex = -1; - this.tangentBufferIndex = -1; - this.sceneMatrixIndex = -1; - this.sceneNormalMatrixIndex = -1; - }; - - /** - * Initializes the unchanging constant data for this shader object. - */ - ShaderObjectBase.prototype.initConstantData = function (registerCache, animatableAttributes, animationTargetRegisters, uvSource, uvTarget) { - //Updates the amount of used register indices. - this.numUsedVertexConstants = registerCache.numUsedVertexConstants; - this.numUsedFragmentConstants = registerCache.numUsedFragmentConstants; - this.numUsedStreams = registerCache.numUsedStreams; - this.numUsedTextures = registerCache.numUsedTextures; - this.numUsedVaryings = registerCache.numUsedVaryings; - this.numUsedFragmentConstants = registerCache.numUsedFragmentConstants; - - this.animatableAttributes = animatableAttributes; - this.animationTargetRegisters = animationTargetRegisters; - this.uvSource = uvSource; - this.uvTarget = uvTarget; - - this.vertexConstantData.length = this.numUsedVertexConstants * 4; - this.fragmentConstantData.length = this.numUsedFragmentConstants * 4; - - //Initializes commonly required constant values. - this.fragmentConstantData[this.commonsDataIndex] = .5; - this.fragmentConstantData[this.commonsDataIndex + 1] = 0; - this.fragmentConstantData[this.commonsDataIndex + 2] = 1 / 255; - this.fragmentConstantData[this.commonsDataIndex + 3] = 1; - - //Initializes the default UV transformation matrix. - if (this.uvTransformIndex >= 0) { - this.vertexConstantData[this.uvTransformIndex] = 1; - this.vertexConstantData[this.uvTransformIndex + 1] = 0; - this.vertexConstantData[this.uvTransformIndex + 2] = 0; - this.vertexConstantData[this.uvTransformIndex + 3] = 0; - this.vertexConstantData[this.uvTransformIndex + 4] = 0; - this.vertexConstantData[this.uvTransformIndex + 5] = 1; - this.vertexConstantData[this.uvTransformIndex + 6] = 0; - this.vertexConstantData[this.uvTransformIndex + 7] = 0; - } - - if (this.cameraPositionIndex >= 0) - this.vertexConstantData[this.cameraPositionIndex + 3] = 1; - }; - - /** - * @inheritDoc - */ - ShaderObjectBase.prototype.iActivate = function (stage, camera) { - stage.context.setCulling(this.useBothSides ? ContextGLTriangleFace.NONE : this._defaultCulling, camera.projection.coordinateSystem); - - if (!this.usesTangentSpace && this.cameraPositionIndex >= 0) { - var pos = camera.scenePosition; - - this.vertexConstantData[this.cameraPositionIndex] = pos.x; - this.vertexConstantData[this.cameraPositionIndex + 1] = pos.y; - this.vertexConstantData[this.cameraPositionIndex + 2] = pos.z; - } - }; - - /** - * @inheritDoc - */ - ShaderObjectBase.prototype.iDeactivate = function (stage) { - }; - - /** - * - * - * @param renderable - * @param stage - * @param camera - */ - ShaderObjectBase.prototype.setRenderState = function (renderable, stage, camera, viewProjection) { - var context = stage.context; - - if (renderable.materialOwner.animator) - renderable.materialOwner.animator.setRenderState(this, renderable, stage, camera, this.numUsedVertexConstants, this.numUsedStreams); - - if (this.uvBufferIndex >= 0) - context.activateBuffer(this.uvBufferIndex, renderable.getVertexData(TriangleSubGeometry.UV_DATA), renderable.getVertexOffset(TriangleSubGeometry.UV_DATA), TriangleSubGeometry.UV_FORMAT); - - if (this.secondaryUVBufferIndex >= 0) - context.activateBuffer(this.secondaryUVBufferIndex, renderable.getVertexData(TriangleSubGeometry.SECONDARY_UV_DATA), renderable.getVertexOffset(TriangleSubGeometry.SECONDARY_UV_DATA), TriangleSubGeometry.SECONDARY_UV_FORMAT); - - if (this.normalBufferIndex >= 0) - context.activateBuffer(this.normalBufferIndex, renderable.getVertexData(TriangleSubGeometry.NORMAL_DATA), renderable.getVertexOffset(TriangleSubGeometry.NORMAL_DATA), TriangleSubGeometry.NORMAL_FORMAT); - - if (this.tangentBufferIndex >= 0) - context.activateBuffer(this.tangentBufferIndex, renderable.getVertexData(TriangleSubGeometry.TANGENT_DATA), renderable.getVertexOffset(TriangleSubGeometry.TANGENT_DATA), TriangleSubGeometry.TANGENT_FORMAT); - - if (this.usesUVTransform) { - var uvTransform = renderable.materialOwner.uvTransform.matrix; - - if (uvTransform) { - this.vertexConstantData[this.uvTransformIndex] = uvTransform.a; - this.vertexConstantData[this.uvTransformIndex + 1] = uvTransform.b; - this.vertexConstantData[this.uvTransformIndex + 3] = uvTransform.tx; - this.vertexConstantData[this.uvTransformIndex + 4] = uvTransform.c; - this.vertexConstantData[this.uvTransformIndex + 5] = uvTransform.d; - this.vertexConstantData[this.uvTransformIndex + 7] = uvTransform.ty; - } else { - this.vertexConstantData[this.uvTransformIndex] = 1; - this.vertexConstantData[this.uvTransformIndex + 1] = 0; - this.vertexConstantData[this.uvTransformIndex + 3] = 0; - this.vertexConstantData[this.uvTransformIndex + 4] = 0; - this.vertexConstantData[this.uvTransformIndex + 5] = 1; - this.vertexConstantData[this.uvTransformIndex + 7] = 0; - } - } - - if (this.sceneNormalMatrixIndex >= 0) - renderable.sourceEntity.inverseSceneTransform.copyRawDataTo(this.vertexConstantData, this.sceneNormalMatrixIndex, false); - - if (this.usesTangentSpace && this.cameraPositionIndex >= 0) { - renderable.sourceEntity.inverseSceneTransform.copyRawDataTo(this._pInverseSceneMatrix); - var pos = camera.scenePosition; - var x = pos.x; - var y = pos.y; - var z = pos.z; - - this.vertexConstantData[this.cameraPositionIndex] = this._pInverseSceneMatrix[0] * x + this._pInverseSceneMatrix[4] * y + this._pInverseSceneMatrix[8] * z + this._pInverseSceneMatrix[12]; - this.vertexConstantData[this.cameraPositionIndex + 1] = this._pInverseSceneMatrix[1] * x + this._pInverseSceneMatrix[5] * y + this._pInverseSceneMatrix[9] * z + this._pInverseSceneMatrix[13]; - this.vertexConstantData[this.cameraPositionIndex + 2] = this._pInverseSceneMatrix[2] * x + this._pInverseSceneMatrix[6] * y + this._pInverseSceneMatrix[10] * z + this._pInverseSceneMatrix[14]; - } - }; - - ShaderObjectBase.prototype.dispose = function () { - //TODO uncount associated program data - }; - return ShaderObjectBase; - })(); - materials.ShaderObjectBase = ShaderObjectBase; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * ShaderObjectBase keeps track of the number of dependencies for "named registers" used across a pass. - * Named registers are that are not necessarily limited to a single method. They are created by the compiler and - * passed on to methods. The compiler uses the results to reserve usages through RegisterPool, which can be removed - * each time a method has been compiled into the shader. - * - * @see RegisterPool.addUsage - */ - var ShaderLightingObject = (function (_super) { - __extends(ShaderLightingObject, _super); - /** - * Creates a new MethodCompilerVO object. - */ - function ShaderLightingObject(profile) { - _super.call(this, profile); - } - /** - * Factory method to create a concrete compiler object for this object - * - * @param materialPassVO - * @returns {away.materials.ShaderLightingCompiler} - */ - ShaderLightingObject.prototype.createCompiler = function (material, materialPass) { - return new materials.ShaderLightingCompiler(material, materialPass, this); - }; - - /** - * Clears dependency counts for all registers. Called when recompiling a pass. - */ - ShaderLightingObject.prototype.reset = function () { - _super.prototype.reset.call(this); - - this.numLights = 0; - this.usesLightFallOff = true; - }; - - /** - * Adds any external world space dependencies, used to force world space calculations. - */ - ShaderLightingObject.prototype.addWorldSpaceDependencies = function (fragmentLights) { - _super.prototype.addWorldSpaceDependencies.call(this, fragmentLights); - - if (this.numPointLights > 0 && this.usesLights) { - ++this.globalPosDependencies; - - if (fragmentLights) - this.usesGlobalPosFragment = true; - } - }; - - /** - * - * - * @param renderable - * @param stage - * @param camera - */ - ShaderLightingObject.prototype.setRenderState = function (renderable, stage, camera, viewProjection) { - _super.prototype.setRenderState.call(this, renderable, stage, camera, viewProjection); - - if (this.usesLights) - this.updateLights(); - - if (this.usesProbes) - this.updateProbes(stage); - }; - - /** - * Updates constant data render state used by the lights. This method is optional for subclasses to implement. - */ - ShaderLightingObject.prototype.updateLights = function () { - var dirLight; - var pointLight; - var i = 0; - var k = 0; - var len; - var dirPos; - var total = 0; - var numLightTypes = this.usesShadows ? 2 : 1; - var l; - var offset; - - this.ambientR = this.ambientG = this.ambientB = 0; - - l = this.lightVertexConstantIndex; - k = this.lightFragmentConstantIndex; - - var cast = 0; - var dirLights = this.lightPicker.directionalLights; - offset = this.directionalLightsOffset; - len = this.lightPicker.directionalLights.length; - - if (offset > len) { - cast = 1; - offset -= len; - } - - for (; cast < numLightTypes; ++cast) { - if (cast) - dirLights = this.lightPicker.castingDirectionalLights; - - len = dirLights.length; - - if (len > this.numDirectionalLights) - len = this.numDirectionalLights; - - for (i = 0; i < len; ++i) { - dirLight = dirLights[offset + i]; - dirPos = dirLight.sceneDirection; - - this.ambientR += dirLight._iAmbientR; - this.ambientG += dirLight._iAmbientG; - this.ambientB += dirLight._iAmbientB; - - if (this.usesTangentSpace) { - var x = -dirPos.x; - var y = -dirPos.y; - var z = -dirPos.z; - - this.vertexConstantData[l++] = this._pInverseSceneMatrix[0] * x + this._pInverseSceneMatrix[4] * y + this._pInverseSceneMatrix[8] * z; - this.vertexConstantData[l++] = this._pInverseSceneMatrix[1] * x + this._pInverseSceneMatrix[5] * y + this._pInverseSceneMatrix[9] * z; - this.vertexConstantData[l++] = this._pInverseSceneMatrix[2] * x + this._pInverseSceneMatrix[6] * y + this._pInverseSceneMatrix[10] * z; - this.vertexConstantData[l++] = 1; - } else { - this.fragmentConstantData[k++] = -dirPos.x; - this.fragmentConstantData[k++] = -dirPos.y; - this.fragmentConstantData[k++] = -dirPos.z; - this.fragmentConstantData[k++] = 1; - } - - this.fragmentConstantData[k++] = dirLight._iDiffuseR; - this.fragmentConstantData[k++] = dirLight._iDiffuseG; - this.fragmentConstantData[k++] = dirLight._iDiffuseB; - this.fragmentConstantData[k++] = 1; - - this.fragmentConstantData[k++] = dirLight._iSpecularR; - this.fragmentConstantData[k++] = dirLight._iSpecularG; - this.fragmentConstantData[k++] = dirLight._iSpecularB; - this.fragmentConstantData[k++] = 1; - - if (++total == this.numDirectionalLights) { - // break loop - i = len; - cast = numLightTypes; - } - } - } - - // more directional supported than currently picked, need to clamp all to 0 - if (this.numDirectionalLights > total) { - i = k + (this.numDirectionalLights - total) * 12; - - while (k < i) - this.fragmentConstantData[k++] = 0; - } - - total = 0; - - var pointLights = this.lightPicker.pointLights; - offset = this.pointLightsOffset; - len = this.lightPicker.pointLights.length; - - if (offset > len) { - cast = 1; - offset -= len; - } else { - cast = 0; - } - - for (; cast < numLightTypes; ++cast) { - if (cast) - pointLights = this.lightPicker.castingPointLights; - - len = pointLights.length; - - for (i = 0; i < len; ++i) { - pointLight = pointLights[offset + i]; - dirPos = pointLight.scenePosition; - - this.ambientR += pointLight._iAmbientR; - this.ambientG += pointLight._iAmbientG; - this.ambientB += pointLight._iAmbientB; - - if (this.usesTangentSpace) { - x = dirPos.x; - y = dirPos.y; - z = dirPos.z; - - this.vertexConstantData[l++] = this._pInverseSceneMatrix[0] * x + this._pInverseSceneMatrix[4] * y + this._pInverseSceneMatrix[8] * z + this._pInverseSceneMatrix[12]; - this.vertexConstantData[l++] = this._pInverseSceneMatrix[1] * x + this._pInverseSceneMatrix[5] * y + this._pInverseSceneMatrix[9] * z + this._pInverseSceneMatrix[13]; - this.vertexConstantData[l++] = this._pInverseSceneMatrix[2] * x + this._pInverseSceneMatrix[6] * y + this._pInverseSceneMatrix[10] * z + this._pInverseSceneMatrix[14]; - this.vertexConstantData[l++] = 1; - } else if (!this.usesGlobalPosFragment) { - this.vertexConstantData[l++] = dirPos.x; - this.vertexConstantData[l++] = dirPos.y; - this.vertexConstantData[l++] = dirPos.z; - this.vertexConstantData[l++] = 1; - } else { - this.fragmentConstantData[k++] = dirPos.x; - this.fragmentConstantData[k++] = dirPos.y; - this.fragmentConstantData[k++] = dirPos.z; - this.fragmentConstantData[k++] = 1; - } - - this.fragmentConstantData[k++] = pointLight._iDiffuseR; - this.fragmentConstantData[k++] = pointLight._iDiffuseG; - this.fragmentConstantData[k++] = pointLight._iDiffuseB; - - var radius = pointLight._pRadius; - this.fragmentConstantData[k++] = radius * radius; - - this.fragmentConstantData[k++] = pointLight._iSpecularR; - this.fragmentConstantData[k++] = pointLight._iSpecularG; - this.fragmentConstantData[k++] = pointLight._iSpecularB; - this.fragmentConstantData[k++] = pointLight._pFallOffFactor; - - if (++total == this.numPointLights) { - // break loop - i = len; - cast = numLightTypes; - } - } - } - - // more directional supported than currently picked, need to clamp all to 0 - if (this.numPointLights > total) { - i = k + (total - this.numPointLights) * 12; - - for (; k < i; ++k) - this.fragmentConstantData[k] = 0; - } - }; - - /** - * Updates constant data render state used by the light probes. This method is optional for subclasses to implement. - */ - ShaderLightingObject.prototype.updateProbes = function (stage) { - var probe; - var lightProbes = this.lightPicker.lightProbes; - var weights = this.lightPicker.lightProbeWeights; - var len = lightProbes.length - this.lightProbesOffset; - var addDiff = this.usesProbesForDiffuse; - var addSpec = this.usesProbesForSpecular; - - if (!(addDiff || addSpec)) - return; - - if (len > this.numLightProbes) - len = this.numLightProbes; - - for (var i = 0; i < len; ++i) { - probe = lightProbes[this.lightProbesOffset + i]; - - if (addDiff) - stage.context.activateCubeTexture(this.lightProbeDiffuseIndices[i], probe.diffuseMap); - - if (addSpec) - stage.context.activateCubeTexture(this.lightProbeSpecularIndices[i], probe.specularMap); - } - - for (i = 0; i < len; ++i) - this.fragmentConstantData[this.probeWeightsIndex + i] = weights[this.lightProbesOffset + i]; - }; - return ShaderLightingObject; - })(materials.ShaderObjectBase); - materials.ShaderLightingObject = ShaderLightingObject; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * MethodVO contains data for a given shader object for the use within a single material. - * This allows shader methods to be shared across materials while their non-public state differs. - */ - var MethodVO = (function () { - /** - * Creates a new MethodVO object. - */ - function MethodVO(method) { - this.useMethod = true; - this.method = method; - } - /** - * Resets the values of the value object to their "unused" state. - */ - MethodVO.prototype.reset = function () { - this.method.iReset(); - - this.texturesIndex = -1; - this.vertexConstantsIndex = -1; - this.fragmentConstantsIndex = -1; - - this.needsProjection = false; - this.needsView = false; - this.needsNormals = false; - this.needsTangents = false; - this.needsUV = false; - this.needsSecondaryUV = false; - this.needsGlobalVertexPos = false; - this.needsGlobalFragmentPos = false; - }; - return MethodVO; - })(); - materials.MethodVO = MethodVO; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * RegisterPool is used by the shader compilation process to keep track of which registers of a certain type are - * currently used and should not be allowed to be written to. Either entire registers can be requested and locked, - * or single components (x, y, z, w) of a single register. - * It is used by ShaderRegisterCache to track usages of individual register types. - * - * @see away.materials.ShaderRegisterCache - */ - var RegisterPool = (function () { - /** - * Creates a new RegisterPool object. - * @param regName The base name of the register type ("ft" for fragment temporaries, "vc" for vertex constants, etc) - * @param regCount The amount of available registers of this type. - * @param persistent Whether or not registers, once reserved, can be freed again. For example, temporaries are not persistent, but constants are. - */ - function RegisterPool(regName, regCount, persistent) { - if (typeof persistent === "undefined") { persistent = true; } - this._regName = regName; - this._regCount = regCount; - this._persistent = persistent; - this.initRegisters(regName, regCount); - } - /** - * Retrieve an entire vector register that's still available. - */ - RegisterPool.prototype.requestFreeVectorReg = function () { - for (var i = 0; i < this._regCount; ++i) { - if (!this.isRegisterUsed(i)) { - if (this._persistent) - this._usedVectorCount[i]++; - - return this._vectorRegisters[i]; - } - } - - throw new Error("Register overflow!"); - }; - - /** - * Retrieve a single vector component that's still available. - */ - RegisterPool.prototype.requestFreeRegComponent = function () { - for (var i = 0; i < this._regCount; ++i) { - if (this._usedVectorCount[i] > 0) - continue; - - for (var j = 0; j < 4; ++j) { - if (this._usedSingleCount[j][i] == 0) { - if (this._persistent) - this._usedSingleCount[j][i]++; - - return this._registerComponents[j][i]; - } - } - } - - throw new Error("Register overflow!"); - }; - - /** - * Marks a register as used, so it cannot be retrieved. The register won't be able to be used until removeUsage - * has been called usageCount times again. - * @param register The register to mark as used. - * @param usageCount The amount of usages to add. - */ - RegisterPool.prototype.addUsage = function (register, usageCount) { - if (register._component > -1) - this._usedSingleCount[register._component][register.index] += usageCount; - else - this._usedVectorCount[register.index] += usageCount; - }; - - /** - * Removes a usage from a register. When usages reach 0, the register is freed again. - * @param register The register for which to remove a usage. - */ - RegisterPool.prototype.removeUsage = function (register) { - if (register._component > -1) { - if (--this._usedSingleCount[register._component][register.index] < 0) - throw new Error("More usages removed than exist!"); - } else { - if (--this._usedVectorCount[register.index] < 0) - throw new Error("More usages removed than exist!"); - } - }; - - /** - * Disposes any resources used by the current RegisterPool object. - */ - RegisterPool.prototype.dispose = function () { - this._vectorRegisters = null; - this._registerComponents = null; - this._usedSingleCount = null; - this._usedVectorCount = null; - }; - - /** - * Indicates whether or not any registers are in use. - */ - RegisterPool.prototype.hasRegisteredRegs = function () { - for (var i = 0; i < this._regCount; ++i) - if (this.isRegisterUsed(i)) - return true; - - return false; - }; - - /** - * Initializes all registers. - */ - RegisterPool.prototype.initRegisters = function (regName, regCount) { - var hash = RegisterPool._initPool(regName, regCount); - - this._vectorRegisters = RegisterPool._regPool[hash]; - this._registerComponents = RegisterPool._regCompsPool[hash]; - - this._usedVectorCount = this._initArray(Array(regCount), 0); - - this._usedSingleCount = new Array(4); - this._usedSingleCount[0] = this._initArray(new Array(regCount), 0); - this._usedSingleCount[1] = this._initArray(new Array(regCount), 0); - this._usedSingleCount[2] = this._initArray(new Array(regCount), 0); - this._usedSingleCount[3] = this._initArray(new Array(regCount), 0); - }; - - RegisterPool._initPool = function (regName, regCount) { - var hash = regName + regCount; - - if (RegisterPool._regPool[hash] != undefined) - return hash; - - var vectorRegisters = new Array(regCount); - RegisterPool._regPool[hash] = vectorRegisters; - - var registerComponents = [ - [], - [], - [], - [] - ]; - RegisterPool._regCompsPool[hash] = registerComponents; - - for (var i = 0; i < regCount; ++i) { - vectorRegisters[i] = new materials.ShaderRegisterElement(regName, i); - - for (var j = 0; j < 4; ++j) - registerComponents[j][i] = new materials.ShaderRegisterElement(regName, i, j); - } - - return hash; - }; - - /** - * Check if the temp register is either used for single or vector use - */ - RegisterPool.prototype.isRegisterUsed = function (index) { - if (this._usedVectorCount[index] > 0) - return true; - - for (var i = 0; i < 4; ++i) - if (this._usedSingleCount[i][index] > 0) - return true; - - return false; - }; - - RegisterPool.prototype._initArray = function (a, val) { - var l = a.length; - - for (var c = 0; c < l; c++) - a[c] = val; - - return a; - }; - RegisterPool._regPool = new Object(); - RegisterPool._regCompsPool = new Object(); - return RegisterPool; - })(); - materials.RegisterPool = RegisterPool; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * ShaderRegister Cache provides the usage management system for all registers during shading compilation. - */ - var ShaderRegisterCache = (function () { - /** - * Create a new ShaderRegisterCache object. - * - * @param profile The compatibility profile used by the renderer. - */ - function ShaderRegisterCache(profile) { - this._numUsedVertexConstants = 0; - this._numUsedFragmentConstants = 0; - this._numUsedStreams = 0; - this._numUsedTextures = 0; - this._numUsedVaryings = 0; - this._profile = profile; - } - /** - * Resets all registers. - */ - ShaderRegisterCache.prototype.reset = function () { - this._fragmentTempCache = new materials.RegisterPool("ft", 8, false); - this._vertexTempCache = new materials.RegisterPool("vt", 8, false); - this._varyingCache = new materials.RegisterPool("v", 8); - this._textureCache = new materials.RegisterPool("fs", 8); - this._vertexAttributesCache = new materials.RegisterPool("va", 8); - this._fragmentConstantsCache = new materials.RegisterPool("fc", 28); - this._vertexConstantsCache = new materials.RegisterPool("vc", 128); - this._fragmentOutputRegister = new materials.ShaderRegisterElement("oc", -1); - this._vertexOutputRegister = new materials.ShaderRegisterElement("op", -1); - this._numUsedVertexConstants = 0; - this._numUsedStreams = 0; - this._numUsedTextures = 0; - this._numUsedVaryings = 0; - this._numUsedFragmentConstants = 0; - - var i; - - for (i = 0; i < this._vertexAttributesOffset; ++i) - this.getFreeVertexAttribute(); - - for (i = 0; i < this._vertexConstantOffset; ++i) - this.getFreeVertexConstant(); - - for (i = 0; i < this._varyingsOffset; ++i) - this.getFreeVarying(); - - for (i = 0; i < this._fragmentConstantOffset; ++i) - this.getFreeFragmentConstant(); - }; - - /** - * Disposes all resources used. - */ - ShaderRegisterCache.prototype.dispose = function () { - this._fragmentTempCache.dispose(); - this._vertexTempCache.dispose(); - this._varyingCache.dispose(); - this._fragmentConstantsCache.dispose(); - this._vertexAttributesCache.dispose(); - - this._fragmentTempCache = null; - this._vertexTempCache = null; - this._varyingCache = null; - this._fragmentConstantsCache = null; - this._vertexAttributesCache = null; - this._fragmentOutputRegister = null; - this._vertexOutputRegister = null; - }; - - /** - * Marks a fragment temporary register as used, so it cannot be retrieved. The register won't be able to be used until removeUsage - * has been called usageCount times again. - * @param register The register to mark as used. - * @param usageCount The amount of usages to add. - */ - ShaderRegisterCache.prototype.addFragmentTempUsages = function (register, usageCount) { - this._fragmentTempCache.addUsage(register, usageCount); - }; - - /** - * Removes a usage from a fragment temporary register. When usages reach 0, the register is freed again. - * @param register The register for which to remove a usage. - */ - ShaderRegisterCache.prototype.removeFragmentTempUsage = function (register) { - this._fragmentTempCache.removeUsage(register); - }; - - /** - * Marks a vertex temporary register as used, so it cannot be retrieved. The register won't be able to be used - * until removeUsage has been called usageCount times again. - * @param register The register to mark as used. - * @param usageCount The amount of usages to add. - */ - ShaderRegisterCache.prototype.addVertexTempUsages = function (register, usageCount) { - this._vertexTempCache.addUsage(register, usageCount); - }; - - /** - * Removes a usage from a vertex temporary register. When usages reach 0, the register is freed again. - * @param register The register for which to remove a usage. - */ - ShaderRegisterCache.prototype.removeVertexTempUsage = function (register) { - this._vertexTempCache.removeUsage(register); - }; - - /** - * Retrieve an entire fragment temporary register that's still available. The register won't be able to be used until removeUsage - * has been called usageCount times again. - */ - ShaderRegisterCache.prototype.getFreeFragmentVectorTemp = function () { - return this._fragmentTempCache.requestFreeVectorReg(); - }; - - /** - * Retrieve a single component from a fragment temporary register that's still available. - */ - ShaderRegisterCache.prototype.getFreeFragmentSingleTemp = function () { - return this._fragmentTempCache.requestFreeRegComponent(); - }; - - /** - * Retrieve an available varying register - */ - ShaderRegisterCache.prototype.getFreeVarying = function () { - ++this._numUsedVaryings; - return this._varyingCache.requestFreeVectorReg(); - }; - - /** - * Retrieve an available fragment constant register - */ - ShaderRegisterCache.prototype.getFreeFragmentConstant = function () { - ++this._numUsedFragmentConstants; - return this._fragmentConstantsCache.requestFreeVectorReg(); - }; - - /** - * Retrieve an available vertex constant register - */ - ShaderRegisterCache.prototype.getFreeVertexConstant = function () { - ++this._numUsedVertexConstants; - return this._vertexConstantsCache.requestFreeVectorReg(); - }; - - /** - * Retrieve an entire vertex temporary register that's still available. - */ - ShaderRegisterCache.prototype.getFreeVertexVectorTemp = function () { - return this._vertexTempCache.requestFreeVectorReg(); - }; - - /** - * Retrieve a single component from a vertex temporary register that's still available. - */ - ShaderRegisterCache.prototype.getFreeVertexSingleTemp = function () { - return this._vertexTempCache.requestFreeRegComponent(); - }; - - /** - * Retrieve an available vertex attribute register - */ - ShaderRegisterCache.prototype.getFreeVertexAttribute = function () { - ++this._numUsedStreams; - return this._vertexAttributesCache.requestFreeVectorReg(); - }; - - /** - * Retrieve an available texture register - */ - ShaderRegisterCache.prototype.getFreeTextureReg = function () { - ++this._numUsedTextures; - return this._textureCache.requestFreeVectorReg(); - }; - - Object.defineProperty(ShaderRegisterCache.prototype, "vertexConstantOffset", { - /** - * Indicates the start index from which to retrieve vertex constants. - */ - get: function () { - return this._vertexConstantOffset; - }, - set: function (vertexConstantOffset) { - this._vertexConstantOffset = vertexConstantOffset; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ShaderRegisterCache.prototype, "vertexAttributesOffset", { - /** - * Indicates the start index from which to retrieve vertex attributes. - */ - get: function () { - return this._vertexAttributesOffset; - }, - set: function (value) { - this._vertexAttributesOffset = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ShaderRegisterCache.prototype, "varyingsOffset", { - /** - * Indicates the start index from which to retrieve varying registers. - */ - get: function () { - return this._varyingsOffset; - }, - set: function (value) { - this._varyingsOffset = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ShaderRegisterCache.prototype, "fragmentConstantOffset", { - /** - * Indicates the start index from which to retrieve fragment constants. - */ - get: function () { - return this._fragmentConstantOffset; - }, - set: function (value) { - this._fragmentConstantOffset = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ShaderRegisterCache.prototype, "fragmentOutputRegister", { - /** - * The fragment output register. - */ - get: function () { - return this._fragmentOutputRegister; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ShaderRegisterCache.prototype, "numUsedVertexConstants", { - /** - * The amount of used vertex constant registers. - */ - get: function () { - return this._numUsedVertexConstants; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ShaderRegisterCache.prototype, "numUsedFragmentConstants", { - /** - * The amount of used fragment constant registers. - */ - get: function () { - return this._numUsedFragmentConstants; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ShaderRegisterCache.prototype, "numUsedStreams", { - /** - * The amount of used vertex streams. - */ - get: function () { - return this._numUsedStreams; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ShaderRegisterCache.prototype, "numUsedTextures", { - /** - * The amount of used texture slots. - */ - get: function () { - return this._numUsedTextures; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ShaderRegisterCache.prototype, "numUsedVaryings", { - /** - * The amount of used varying registers. - */ - get: function () { - return this._numUsedVaryings; - }, - enumerable: true, - configurable: true - }); - return ShaderRegisterCache; - })(); - materials.ShaderRegisterCache = ShaderRegisterCache; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * A single register element (an entire register or a single register's component) used by the RegisterPool. - */ - var ShaderRegisterElement = (function () { - /** - * Creates a new ShaderRegisterElement object. - * - * @param regName The name of the register. - * @param index The index of the register. - * @param component The register's component, if not the entire register is represented. - */ - function ShaderRegisterElement(regName, index, component) { - if (typeof component === "undefined") { component = -1; } - this._component = component; - this._regName = regName; - this._index = index; - - this._toStr = this._regName; - - if (this._index >= 0) - this._toStr += this._index; - - if (component > -1) - this._toStr += "." + ShaderRegisterElement.COMPONENTS[component]; - } - /** - * Converts the register or the components AGAL string representation. - */ - ShaderRegisterElement.prototype.toString = function () { - return this._toStr; - }; - - Object.defineProperty(ShaderRegisterElement.prototype, "regName", { - /** - * The register's name. - */ - get: function () { - return this._regName; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ShaderRegisterElement.prototype, "index", { - /** - * The register's index. - */ - get: function () { - return this._index; - }, - enumerable: true, - configurable: true - }); - ShaderRegisterElement.COMPONENTS = ["x", "y", "z", "w"]; - return ShaderRegisterElement; - })(); - materials.ShaderRegisterElement = ShaderRegisterElement; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * ShaderCompilerBase is an abstract base class for shader compilers that use modular shader methods to assemble a - * material. Concrete subclasses are used by the default materials. - * - * @see away.materials.ShadingMethodBase - */ - var ShaderCompilerBase = (function () { - /** - * Creates a new ShaderCompilerBase object. - * @param profile The compatibility profile of the renderer. - */ - function ShaderCompilerBase(material, materialPass, shaderObject) { - this._pVertexCode = ''; - this._pFragmentCode = ''; - this._pPostAnimationFragmentCode = ''; - this._pMaterial = material; - this._pMaterialPass = materialPass; - - this._pShaderObject = shaderObject; - this._pProfile = shaderObject.profile; - - this._pSharedRegisters = new materials.ShaderRegisterData(); - - this._pRegisterCache = new materials.ShaderRegisterCache(this._pProfile); - this._pRegisterCache.vertexAttributesOffset = 1; - this._pRegisterCache.reset(); - } - /** - * Compiles the code after all setup on the compiler has finished. - */ - ShaderCompilerBase.prototype.compile = function () { - this._pShaderObject.reset(); - - this.pCalculateDependencies(); - - this.pInitRegisterIndices(); - - this.pCompileDependencies(); - - //compile custom vertex & fragment codes - this._pVertexCode += this._pMaterialPass._iGetVertexCode(this._pShaderObject, this._pRegisterCache, this._pSharedRegisters); - this._pPostAnimationFragmentCode += this._pMaterialPass._iGetFragmentCode(this._pShaderObject, this._pRegisterCache, this._pSharedRegisters); - - //assign the final output color to the output register - this._pPostAnimationFragmentCode += "mov " + this._pRegisterCache.fragmentOutputRegister + ", " + this._pSharedRegisters.shadedTarget + "\n"; - this._pRegisterCache.removeFragmentTempUsage(this._pSharedRegisters.shadedTarget); - - //initialise the required shader constants - this._pShaderObject.initConstantData(this._pRegisterCache, this._pAnimatableAttributes, this._pAnimationTargetRegisters, this._uvSource, this._uvTarget); - this._pMaterialPass._iInitConstantData(this._pShaderObject); - }; - - /** - * Compile the code for the methods. - */ - ShaderCompilerBase.prototype.pCompileDependencies = function () { - this._pSharedRegisters.shadedTarget = this._pRegisterCache.getFreeFragmentVectorTemp(); - this._pRegisterCache.addFragmentTempUsages(this._pSharedRegisters.shadedTarget, 1); - - //compile the world-space position if required - if (this._pShaderObject.globalPosDependencies > 0) - this.compileGlobalPositionCode(); - - //Calculate the (possibly animated) UV coordinates. - if (this._pShaderObject.uvDependencies > 0) - this.compileUVCode(); - - if (this._pShaderObject.secondaryUVDependencies > 0) - this.compileSecondaryUVCode(); - - if (this._pShaderObject.normalDependencies > 0) - this.compileNormalCode(); - - if (this._pShaderObject.viewDirDependencies > 0) - this.compileViewDirCode(); - - //collect code from material - this._pVertexCode += this._pMaterial._iGetVertexCode(this._pShaderObject, this._pRegisterCache, this._pSharedRegisters); - this._pFragmentCode += this._pMaterial._iGetFragmentCode(this._pShaderObject, this._pRegisterCache, this._pSharedRegisters); - - //collect code from pass - this._pVertexCode += this._pMaterialPass._iGetPreLightingVertexCode(this._pShaderObject, this._pRegisterCache, this._pSharedRegisters); - this._pFragmentCode += this._pMaterialPass._iGetPreLightingFragmentCode(this._pShaderObject, this._pRegisterCache, this._pSharedRegisters); - }; - - ShaderCompilerBase.prototype.compileGlobalPositionCode = function () { - this._pRegisterCache.addVertexTempUsages(this._pSharedRegisters.globalPositionVertex = this._pRegisterCache.getFreeVertexVectorTemp(), this._pShaderObject.globalPosDependencies); - - var sceneMatrixReg = this._pRegisterCache.getFreeVertexConstant(); - this._pRegisterCache.getFreeVertexConstant(); - this._pRegisterCache.getFreeVertexConstant(); - this._pRegisterCache.getFreeVertexConstant(); - - this._pShaderObject.sceneMatrixIndex = sceneMatrixReg.index * 4; - - this._pVertexCode += "m44 " + this._pSharedRegisters.globalPositionVertex + ", " + this._pSharedRegisters.localPosition + ", " + sceneMatrixReg + "\n"; - - if (this._pShaderObject.usesGlobalPosFragment) { - this._pSharedRegisters.globalPositionVarying = this._pRegisterCache.getFreeVarying(); - this._pVertexCode += "mov " + this._pSharedRegisters.globalPositionVarying + ", " + this._pSharedRegisters.globalPositionVertex + "\n"; - } - }; - - /** - * Calculate the (possibly animated) UV coordinates. - */ - ShaderCompilerBase.prototype.compileUVCode = function () { - var uvAttributeReg = this._pRegisterCache.getFreeVertexAttribute(); - this._pShaderObject.uvBufferIndex = uvAttributeReg.index; - - var varying = this._pRegisterCache.getFreeVarying(); - - this._pSharedRegisters.uvVarying = varying; - - if (this._pShaderObject.usesUVTransform) { - // a, b, 0, tx - // c, d, 0, ty - var uvTransform1 = this._pRegisterCache.getFreeVertexConstant(); - var uvTransform2 = this._pRegisterCache.getFreeVertexConstant(); - this._pShaderObject.uvTransformIndex = uvTransform1.index * 4; - - this._pVertexCode += "dp4 " + varying + ".x, " + uvAttributeReg + ", " + uvTransform1 + "\n" + "dp4 " + varying + ".y, " + uvAttributeReg + ", " + uvTransform2 + "\n" + "mov " + varying + ".zw, " + uvAttributeReg + ".zw \n"; - } else { - this._pShaderObject.uvTransformIndex = -1; - this._uvTarget = varying.toString(); - this._uvSource = uvAttributeReg.toString(); - } - }; - - /** - * Provide the secondary UV coordinates. - */ - ShaderCompilerBase.prototype.compileSecondaryUVCode = function () { - var uvAttributeReg = this._pRegisterCache.getFreeVertexAttribute(); - this._pShaderObject.secondaryUVBufferIndex = uvAttributeReg.index; - this._pSharedRegisters.secondaryUVVarying = this._pRegisterCache.getFreeVarying(); - this._pVertexCode += "mov " + this._pSharedRegisters.secondaryUVVarying + ", " + uvAttributeReg + "\n"; - }; - - /** - * Calculate the view direction. - */ - ShaderCompilerBase.prototype.compileViewDirCode = function () { - var cameraPositionReg = this._pRegisterCache.getFreeVertexConstant(); - this._pSharedRegisters.viewDirVarying = this._pRegisterCache.getFreeVarying(); - this._pSharedRegisters.viewDirFragment = this._pRegisterCache.getFreeFragmentVectorTemp(); - this._pRegisterCache.addFragmentTempUsages(this._pSharedRegisters.viewDirFragment, this._pShaderObject.viewDirDependencies); - - this._pShaderObject.cameraPositionIndex = cameraPositionReg.index * 4; - - if (this._pShaderObject.usesTangentSpace) { - var temp = this._pRegisterCache.getFreeVertexVectorTemp(); - this._pVertexCode += "sub " + temp + ", " + cameraPositionReg + ", " + this._pSharedRegisters.localPosition + "\n" + "m33 " + this._pSharedRegisters.viewDirVarying + ".xyz, " + temp + ", " + this._pSharedRegisters.animatedTangent + "\n" + "mov " + this._pSharedRegisters.viewDirVarying + ".w, " + this._pSharedRegisters.localPosition + ".w\n"; - } else { - this._pVertexCode += "sub " + this._pSharedRegisters.viewDirVarying + ", " + cameraPositionReg + ", " + this._pSharedRegisters.globalPositionVertex + "\n"; - this._pRegisterCache.removeVertexTempUsage(this._pSharedRegisters.globalPositionVertex); - } - - //TODO is this required in all cases? (re: distancemappass) - this._pFragmentCode += "nrm " + this._pSharedRegisters.viewDirFragment + ".xyz, " + this._pSharedRegisters.viewDirVarying + "\n" + "mov " + this._pSharedRegisters.viewDirFragment + ".w, " + this._pSharedRegisters.viewDirVarying + ".w\n"; - }; - - /** - * Calculate the normal. - */ - ShaderCompilerBase.prototype.compileNormalCode = function () { - this._pSharedRegisters.normalFragment = this._pRegisterCache.getFreeFragmentVectorTemp(); - this._pRegisterCache.addFragmentTempUsages(this._pSharedRegisters.normalFragment, this._pShaderObject.normalDependencies); - - //simple normal aquisition if no tangent space is being used - if (this._pShaderObject.outputsNormals && !this._pShaderObject.outputsTangentNormals) { - this._pVertexCode += this._pMaterialPass._iGetNormalVertexCode(this._pShaderObject, this._pRegisterCache, this._pSharedRegisters); - this._pFragmentCode += this._pMaterialPass._iGetNormalFragmentCode(this._pShaderObject, this._pRegisterCache, this._pSharedRegisters); - - return; - } - - var normalMatrix; - - if (!this._pShaderObject.outputsNormals || !this._pShaderObject.usesTangentSpace) { - normalMatrix = new Array(3); - normalMatrix[0] = this._pRegisterCache.getFreeVertexConstant(); - normalMatrix[1] = this._pRegisterCache.getFreeVertexConstant(); - normalMatrix[2] = this._pRegisterCache.getFreeVertexConstant(); - - this._pRegisterCache.getFreeVertexConstant(); - - this._pShaderObject.sceneNormalMatrixIndex = normalMatrix[0].index * 4; - - this._pSharedRegisters.normalVarying = this._pRegisterCache.getFreeVarying(); - } - - if (this._pShaderObject.outputsNormals) { - if (this._pShaderObject.usesTangentSpace) { - // normalize normal + tangent vector and generate (approximated) bitangent used in m33 operation for view - this._pVertexCode += "nrm " + this._pSharedRegisters.animatedNormal + ".xyz, " + this._pSharedRegisters.animatedNormal + "\n" + "nrm " + this._pSharedRegisters.animatedTangent + ".xyz, " + this._pSharedRegisters.animatedTangent + "\n" + "crs " + this._pSharedRegisters.bitangent + ".xyz, " + this._pSharedRegisters.animatedNormal + ", " + this._pSharedRegisters.animatedTangent + "\n"; - - this._pFragmentCode += this._pMaterialPass._iGetNormalFragmentCode(this._pShaderObject, this._pRegisterCache, this._pSharedRegisters); - } else { - //Compiles the vertex shader code for tangent-space normal maps. - this._pSharedRegisters.tangentVarying = this._pRegisterCache.getFreeVarying(); - this._pSharedRegisters.bitangentVarying = this._pRegisterCache.getFreeVarying(); - var temp = this._pRegisterCache.getFreeVertexVectorTemp(); - - this._pVertexCode += "m33 " + temp + ".xyz, " + this._pSharedRegisters.animatedNormal + ", " + normalMatrix[0] + "\n" + "nrm " + this._pSharedRegisters.animatedNormal + ".xyz, " + temp + "\n" + "m33 " + temp + ".xyz, " + this._pSharedRegisters.animatedTangent + ", " + normalMatrix[0] + "\n" + "nrm " + this._pSharedRegisters.animatedTangent + ".xyz, " + temp + "\n" + "mov " + this._pSharedRegisters.tangentVarying + ".x, " + this._pSharedRegisters.animatedTangent + ".x \n" + "mov " + this._pSharedRegisters.tangentVarying + ".z, " + this._pSharedRegisters.animatedNormal + ".x \n" + "mov " + this._pSharedRegisters.tangentVarying + ".w, " + this._pSharedRegisters.normalInput + ".w \n" + "mov " + this._pSharedRegisters.bitangentVarying + ".x, " + this._pSharedRegisters.animatedTangent + ".y \n" + "mov " + this._pSharedRegisters.bitangentVarying + ".z, " + this._pSharedRegisters.animatedNormal + ".y \n" + "mov " + this._pSharedRegisters.bitangentVarying + ".w, " + this._pSharedRegisters.normalInput + ".w \n" + "mov " + this._pSharedRegisters.normalVarying + ".x, " + this._pSharedRegisters.animatedTangent + ".z \n" + "mov " + this._pSharedRegisters.normalVarying + ".z, " + this._pSharedRegisters.animatedNormal + ".z \n" + "mov " + this._pSharedRegisters.normalVarying + ".w, " + this._pSharedRegisters.normalInput + ".w \n" + "crs " + temp + ".xyz, " + this._pSharedRegisters.animatedNormal + ", " + this._pSharedRegisters.animatedTangent + "\n" + "mov " + this._pSharedRegisters.tangentVarying + ".y, " + temp + ".x \n" + "mov " + this._pSharedRegisters.bitangentVarying + ".y, " + temp + ".y \n" + "mov " + this._pSharedRegisters.normalVarying + ".y, " + temp + ".z \n"; - - this._pRegisterCache.removeVertexTempUsage(this._pSharedRegisters.animatedTangent); - - //Compiles the fragment shader code for tangent-space normal maps. - var t; - var b; - var n; - - t = this._pRegisterCache.getFreeFragmentVectorTemp(); - this._pRegisterCache.addFragmentTempUsages(t, 1); - b = this._pRegisterCache.getFreeFragmentVectorTemp(); - this._pRegisterCache.addFragmentTempUsages(b, 1); - n = this._pRegisterCache.getFreeFragmentVectorTemp(); - this._pRegisterCache.addFragmentTempUsages(n, 1); - - this._pFragmentCode += "nrm " + t + ".xyz, " + this._pSharedRegisters.tangentVarying + "\n" + "mov " + t + ".w, " + this._pSharedRegisters.tangentVarying + ".w \n" + "nrm " + b + ".xyz, " + this._pSharedRegisters.bitangentVarying + "\n" + "nrm " + n + ".xyz, " + this._pSharedRegisters.normalVarying + "\n"; - - //compile custom fragment code for normal calcs - this._pFragmentCode += this._pMaterialPass._iGetNormalFragmentCode(this._pShaderObject, this._pRegisterCache, this._pSharedRegisters) + "m33 " + this._pSharedRegisters.normalFragment + ".xyz, " + this._pSharedRegisters.normalFragment + ", " + t + "\n" + "mov " + this._pSharedRegisters.normalFragment + ".w, " + this._pSharedRegisters.normalVarying + ".w\n"; - - this._pRegisterCache.removeFragmentTempUsage(b); - this._pRegisterCache.removeFragmentTempUsage(t); - this._pRegisterCache.removeFragmentTempUsage(n); - } - } else { - // no output, world space is enough - this._pVertexCode += "m33 " + this._pSharedRegisters.normalVarying + ".xyz, " + this._pSharedRegisters.animatedNormal + ", " + normalMatrix[0] + "\n" + "mov " + this._pSharedRegisters.normalVarying + ".w, " + this._pSharedRegisters.animatedNormal + ".w\n"; - - this._pFragmentCode += "nrm " + this._pSharedRegisters.normalFragment + ".xyz, " + this._pSharedRegisters.normalVarying + "\n" + "mov " + this._pSharedRegisters.normalFragment + ".w, " + this._pSharedRegisters.normalVarying + ".w\n"; - - if (this._pShaderObject.tangentDependencies > 0) { - this._pSharedRegisters.tangentVarying = this._pRegisterCache.getFreeVarying(); - - this._pVertexCode += "m33 " + this._pSharedRegisters.tangentVarying + ".xyz, " + this._pSharedRegisters.animatedTangent + ", " + normalMatrix[0] + "\n" + "mov " + this._pSharedRegisters.tangentVarying + ".w, " + this._pSharedRegisters.animatedTangent + ".w\n"; - } - } - - if (!this._pShaderObject.usesTangentSpace) - this._pRegisterCache.removeVertexTempUsage(this._pSharedRegisters.animatedNormal); - }; - - /** - * Reset all the indices to "unused". - */ - ShaderCompilerBase.prototype.pInitRegisterIndices = function () { - this._pShaderObject.pInitRegisterIndices(); - - this._pAnimatableAttributes = new Array("va0"); - this._pAnimationTargetRegisters = new Array("vt0"); - this._pVertexCode = ""; - this._pFragmentCode = ""; - this._pPostAnimationFragmentCode = ""; - - this._pRegisterCache.addVertexTempUsages(this._pSharedRegisters.localPosition = this._pRegisterCache.getFreeVertexVectorTemp(), 1); - - //create commonly shared constant registers - this._pSharedRegisters.commons = this._pRegisterCache.getFreeFragmentConstant(); - this._pShaderObject.commonsDataIndex = this._pSharedRegisters.commons.index * 4; - - //Creates the registers to contain the tangent data. - // need to be created FIRST and in this order (for when using tangent space) - if (this._pShaderObject.tangentDependencies > 0 || this._pShaderObject.outputsNormals) { - this._pSharedRegisters.tangentInput = this._pRegisterCache.getFreeVertexAttribute(); - this._pShaderObject.tangentBufferIndex = this._pSharedRegisters.tangentInput.index; - - this._pSharedRegisters.animatedTangent = this._pRegisterCache.getFreeVertexVectorTemp(); - this._pRegisterCache.addVertexTempUsages(this._pSharedRegisters.animatedTangent, 1); - - if (this._pShaderObject.usesTangentSpace) { - this._pSharedRegisters.bitangent = this._pRegisterCache.getFreeVertexVectorTemp(); - this._pRegisterCache.addVertexTempUsages(this._pSharedRegisters.bitangent, 1); - } - - this._pAnimatableAttributes.push(this._pSharedRegisters.tangentInput.toString()); - this._pAnimationTargetRegisters.push(this._pSharedRegisters.animatedTangent.toString()); - } - - if (this._pShaderObject.normalDependencies > 0) { - this._pSharedRegisters.normalInput = this._pRegisterCache.getFreeVertexAttribute(); - this._pShaderObject.normalBufferIndex = this._pSharedRegisters.normalInput.index; - - this._pSharedRegisters.animatedNormal = this._pRegisterCache.getFreeVertexVectorTemp(); - this._pRegisterCache.addVertexTempUsages(this._pSharedRegisters.animatedNormal, 1); - - this._pAnimatableAttributes.push(this._pSharedRegisters.normalInput.toString()); - this._pAnimationTargetRegisters.push(this._pSharedRegisters.animatedNormal.toString()); - } - }; - - /** - * Figure out which named registers are required, and how often. - */ - ShaderCompilerBase.prototype.pCalculateDependencies = function () { - this._pShaderObject.useAlphaPremultiplied = this._pMaterial.alphaPremultiplied; - this._pShaderObject.useBothSides = this._pMaterial.bothSides; - this._pShaderObject.useMipmapping = this._pMaterial.mipmap; - this._pShaderObject.useSmoothTextures = this._pMaterial.smooth; - this._pShaderObject.repeatTextures = this._pMaterial.repeat; - this._pShaderObject.usesUVTransform = this._pMaterial.animateUVs; - this._pShaderObject.alphaThreshold = this._pMaterial.alphaThreshold; - this._pShaderObject.texture = this._pMaterial.texture; - this._pShaderObject.color = this._pMaterial.color; - - //TODO: fragment animtion should be compatible with lighting pass - this._pShaderObject.usesFragmentAnimation = Boolean(this._pMaterialPass.passMode == materials.MaterialPassMode.SUPER_SHADER); - - this._pMaterialPass._iIncludeDependencies(this._pShaderObject); - }; - - /** - * Disposes all resources used by the compiler. - */ - ShaderCompilerBase.prototype.dispose = function () { - this._pRegisterCache.dispose(); - this._pRegisterCache = null; - this._pSharedRegisters = null; - }; - - Object.defineProperty(ShaderCompilerBase.prototype, "vertexCode", { - /** - * The generated vertex code. - */ - get: function () { - return this._pVertexCode; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ShaderCompilerBase.prototype, "fragmentCode", { - /** - * The generated fragment code. - */ - get: function () { - return this._pFragmentCode; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ShaderCompilerBase.prototype, "postAnimationFragmentCode", { - /** - * The generated fragment code. - */ - get: function () { - return this._pPostAnimationFragmentCode; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ShaderCompilerBase.prototype, "shadedTarget", { - /** - * The register name containing the final shaded colour. - */ - get: function () { - return this._pSharedRegisters.shadedTarget.toString(); - }, - enumerable: true, - configurable: true - }); - return ShaderCompilerBase; - })(); - materials.ShaderCompilerBase = ShaderCompilerBase; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var ContextGLProfile = away.stagegl.ContextGLProfile; - - /** - * ShaderCompilerBase is an abstract base class for shader compilers that use modular shader methods to assemble a - * material. Concrete subclasses are used by the default materials. - * - * @see away.materials.ShadingMethodBase - */ - var ShaderLightingCompiler = (function (_super) { - __extends(ShaderLightingCompiler, _super); - /** - * Creates a new ShaderCompilerBase object. - * @param profile The compatibility profile of the renderer. - */ - function ShaderLightingCompiler(material, materialPass, shaderObject) { - _super.call(this, material, materialPass, shaderObject); - - this._materialLightingPass = materialPass; - this._shaderLightingObject = shaderObject; - } - /** - * Compile the code for the methods. - */ - ShaderLightingCompiler.prototype.pCompileDependencies = function () { - _super.prototype.pCompileDependencies.call(this); - - //compile the lighting code - if (this._shaderLightingObject.usesShadows) - this.pCompileShadowCode(); - - if (this._shaderLightingObject.usesLights) { - this.initLightRegisters(); - this.compileLightCode(); - } - - if (this._shaderLightingObject.usesProbes) - this.compileLightProbeCode(); - - this._pVertexCode += this._materialLightingPass._iGetPostLightingVertexCode(this._shaderLightingObject, this._pRegisterCache, this._pSharedRegisters); - this._pFragmentCode += this._materialLightingPass._iGetPostLightingFragmentCode(this._shaderLightingObject, this._pRegisterCache, this._pSharedRegisters); - }; - - /** - * Provides the code to provide shadow mapping. - */ - ShaderLightingCompiler.prototype.pCompileShadowCode = function () { - if (this._shaderLightingObject.normalDependencies > 0) { - this._pSharedRegisters.shadowTarget = this._pSharedRegisters.normalFragment; - } else { - this._pSharedRegisters.shadowTarget = this._pRegisterCache.getFreeFragmentVectorTemp(); - this._pRegisterCache.addFragmentTempUsages(this._pSharedRegisters.shadowTarget, 1); - } - }; - - /** - * Initializes constant registers to contain light data. - */ - ShaderLightingCompiler.prototype.initLightRegisters = function () { - // init these first so we're sure they're in sequence - var i, len; - - if (this._dirLightVertexConstants) { - len = this._dirLightVertexConstants.length; - for (i = 0; i < len; ++i) { - this._dirLightVertexConstants[i] = this._pRegisterCache.getFreeVertexConstant(); - - if (this._shaderLightingObject.lightVertexConstantIndex == -1) - this._shaderLightingObject.lightVertexConstantIndex = this._dirLightVertexConstants[i].index * 4; - } - } - - if (this._pointLightVertexConstants) { - len = this._pointLightVertexConstants.length; - for (i = 0; i < len; ++i) { - this._pointLightVertexConstants[i] = this._pRegisterCache.getFreeVertexConstant(); - - if (this._shaderLightingObject.lightVertexConstantIndex == -1) - this._shaderLightingObject.lightVertexConstantIndex = this._pointLightVertexConstants[i].index * 4; - } - } - - len = this._dirLightFragmentConstants.length; - for (i = 0; i < len; ++i) { - this._dirLightFragmentConstants[i] = this._pRegisterCache.getFreeFragmentConstant(); - - if (this._shaderLightingObject.lightFragmentConstantIndex == -1) - this._shaderLightingObject.lightFragmentConstantIndex = this._dirLightFragmentConstants[i].index * 4; - } - - len = this._pointLightFragmentConstants.length; - for (i = 0; i < len; ++i) { - this._pointLightFragmentConstants[i] = this._pRegisterCache.getFreeFragmentConstant(); - - if (this._shaderLightingObject.lightFragmentConstantIndex == -1) - this._shaderLightingObject.lightFragmentConstantIndex = this._pointLightFragmentConstants[i].index * 4; - } - }; - - /** - * Compiles the shading code for directional and point lights. - */ - ShaderLightingCompiler.prototype.compileLightCode = function () { - var diffuseColorReg; - var specularColorReg; - var lightPosReg; - var lightDirReg; - var vertexRegIndex = 0; - var fragmentRegIndex = 0; - var addSpec = this._shaderLightingObject.usesLightsForSpecular; - var addDiff = this._shaderLightingObject.usesLightsForDiffuse; - - for (var i = 0; i < this._materialLightingPass.iNumDirectionalLights; ++i) { - if (this._shaderLightingObject.usesTangentSpace) { - lightDirReg = this._dirLightVertexConstants[vertexRegIndex++]; - - var lightVarying = this._pRegisterCache.getFreeVarying(); - - this._pVertexCode += "m33 " + lightVarying + ".xyz, " + lightDirReg + ", " + this._pSharedRegisters.animatedTangent + "\n" + "mov " + lightVarying + ".w, " + lightDirReg + ".w\n"; - - lightDirReg = this._pRegisterCache.getFreeFragmentVectorTemp(); - this._pRegisterCache.addVertexTempUsages(lightDirReg, 1); - - this._pFragmentCode += "nrm " + lightDirReg + ".xyz, " + lightVarying + "\n" + "mov " + lightDirReg + ".w, " + lightVarying + ".w\n"; - } else { - lightDirReg = this._dirLightFragmentConstants[fragmentRegIndex++]; - } - - diffuseColorReg = this._dirLightFragmentConstants[fragmentRegIndex++]; - specularColorReg = this._dirLightFragmentConstants[fragmentRegIndex++]; - - if (addDiff) - this._pFragmentCode += this._materialLightingPass._iGetPerLightDiffuseFragmentCode(this._shaderLightingObject, lightDirReg, diffuseColorReg, this._pRegisterCache, this._pSharedRegisters); - - if (addSpec) - this._pFragmentCode += this._materialLightingPass._iGetPerLightSpecularFragmentCode(this._shaderLightingObject, lightDirReg, specularColorReg, this._pRegisterCache, this._pSharedRegisters); - - if (this._shaderLightingObject.usesTangentSpace) - this._pRegisterCache.removeVertexTempUsage(lightDirReg); - } - - vertexRegIndex = 0; - fragmentRegIndex = 0; - - for (var i = 0; i < this._materialLightingPass.iNumPointLights; ++i) { - if (this._shaderLightingObject.usesTangentSpace || !this._shaderLightingObject.usesGlobalPosFragment) - lightPosReg = this._pointLightVertexConstants[vertexRegIndex++]; - else - lightPosReg = this._pointLightFragmentConstants[fragmentRegIndex++]; - - diffuseColorReg = this._pointLightFragmentConstants[fragmentRegIndex++]; - specularColorReg = this._pointLightFragmentConstants[fragmentRegIndex++]; - - lightDirReg = this._pRegisterCache.getFreeFragmentVectorTemp(); - this._pRegisterCache.addFragmentTempUsages(lightDirReg, 1); - - var lightVarying; - - if (this._shaderLightingObject.usesTangentSpace) { - lightVarying = this._pRegisterCache.getFreeVarying(); - var temp = this._pRegisterCache.getFreeVertexVectorTemp(); - this._pVertexCode += "sub " + temp + ", " + lightPosReg + ", " + this._pSharedRegisters.localPosition + "\n" + "m33 " + lightVarying + ".xyz, " + temp + ", " + this._pSharedRegisters.animatedTangent + "\n" + "mov " + lightVarying + ".w, " + this._pSharedRegisters.localPosition + ".w\n"; - } else if (!this._shaderLightingObject.usesGlobalPosFragment) { - lightVarying = this._pRegisterCache.getFreeVarying(); - this._pVertexCode += "sub " + lightVarying + ", " + lightPosReg + ", " + this._pSharedRegisters.globalPositionVertex + "\n"; - } else { - lightVarying = lightDirReg; - this._pFragmentCode += "sub " + lightDirReg + ", " + lightPosReg + ", " + this._pSharedRegisters.globalPositionVarying + "\n"; - } - - if (this._shaderLightingObject.usesLightFallOff) { - // calculate attenuation - this._pFragmentCode += "dp3 " + lightDirReg + ".w, " + lightVarying + ", " + lightVarying + "\n" + "sub " + lightDirReg + ".w, " + lightDirReg + ".w, " + diffuseColorReg + ".w\n" + "mul " + lightDirReg + ".w, " + lightDirReg + ".w, " + specularColorReg + ".w\n" + "sat " + lightDirReg + ".w, " + lightDirReg + ".w\n" + "sub " + lightDirReg + ".w, " + this._pSharedRegisters.commons + ".w, " + lightDirReg + ".w\n" + "nrm " + lightDirReg + ".xyz, " + lightVarying + "\n"; - } else { - this._pFragmentCode += "nrm " + lightDirReg + ".xyz, " + lightVarying + "\n" + "mov " + lightDirReg + ".w, " + lightVarying + ".w\n"; - } - - if (this._shaderLightingObject.lightFragmentConstantIndex == -1) - this._shaderLightingObject.lightFragmentConstantIndex = lightPosReg.index * 4; - - if (addDiff) - this._pFragmentCode += this._materialLightingPass._iGetPerLightDiffuseFragmentCode(this._shaderLightingObject, lightDirReg, diffuseColorReg, this._pRegisterCache, this._pSharedRegisters); - - if (addSpec) - this._pFragmentCode += this._materialLightingPass._iGetPerLightSpecularFragmentCode(this._shaderLightingObject, lightDirReg, specularColorReg, this._pRegisterCache, this._pSharedRegisters); - - this._pRegisterCache.removeFragmentTempUsage(lightDirReg); - } - }; - - /** - * Compiles shading code for light probes. - */ - ShaderLightingCompiler.prototype.compileLightProbeCode = function () { - var weightReg; - var weightComponents = [".x", ".y", ".z", ".w"]; - var weightRegisters = new Array(); - var i; - var texReg; - var addSpec = this._shaderLightingObject.usesProbesForSpecular; - var addDiff = this._shaderLightingObject.usesProbesForDiffuse; - - if (addDiff) - this._shaderLightingObject.lightProbeDiffuseIndices = new Array(); - - if (addSpec) - this._shaderLightingObject.lightProbeSpecularIndices = new Array(); - - for (i = 0; i < this._pNumProbeRegisters; ++i) { - weightRegisters[i] = this._pRegisterCache.getFreeFragmentConstant(); - - if (i == 0) - this._shaderLightingObject.probeWeightsIndex = weightRegisters[i].index * 4; - } - - for (i = 0; i < this._materialLightingPass.iNumLightProbes; ++i) { - weightReg = weightRegisters[Math.floor(i / 4)].toString() + weightComponents[i % 4]; - - if (addDiff) { - texReg = this._pRegisterCache.getFreeTextureReg(); - this._shaderLightingObject.lightProbeDiffuseIndices[i] = texReg.index; - this._pFragmentCode += this._materialLightingPass._iGetPerProbeDiffuseFragmentCode(this._shaderLightingObject, texReg, weightReg, this._pRegisterCache, this._pSharedRegisters); - } - - if (addSpec) { - texReg = this._pRegisterCache.getFreeTextureReg(); - this._shaderLightingObject.lightProbeSpecularIndices[i] = texReg.index; - this._pFragmentCode += this._materialLightingPass._iGetPerProbeSpecularFragmentCode(this._shaderLightingObject, texReg, weightReg, this._pRegisterCache, this._pSharedRegisters); - } - } - }; - - /** - * Reset all the indices to "unused". - */ - ShaderLightingCompiler.prototype.pInitRegisterIndices = function () { - _super.prototype.pInitRegisterIndices.call(this); - - this._shaderLightingObject.lightVertexConstantIndex = -1; - this._shaderLightingObject.lightFragmentConstantIndex = -1; - this._shaderLightingObject.probeWeightsIndex = -1; - - this._pNumProbeRegisters = Math.ceil(this._materialLightingPass.iNumLightProbes / 4); - - //init light data - if (this._shaderLightingObject.usesTangentSpace || !this._shaderLightingObject.usesGlobalPosFragment) { - this._pointLightVertexConstants = new Array(this._materialLightingPass.iNumPointLights); - this._pointLightFragmentConstants = new Array(this._materialLightingPass.iNumPointLights * 2); - } else { - this._pointLightFragmentConstants = new Array(this._materialLightingPass.iNumPointLights * 3); - } - - if (this._shaderLightingObject.usesTangentSpace) { - this._dirLightVertexConstants = new Array(this._materialLightingPass.iNumDirectionalLights); - this._dirLightFragmentConstants = new Array(this._materialLightingPass.iNumDirectionalLights * 2); - } else { - this._dirLightFragmentConstants = new Array(this._materialLightingPass.iNumDirectionalLights * 3); - } - }; - - /** - * Figure out which named registers are required, and how often. - */ - ShaderLightingCompiler.prototype.pCalculateDependencies = function () { - var numAllLights = this._materialLightingPass.iNumPointLights + this._materialLightingPass.iNumDirectionalLights; - var numLightProbes = this._materialLightingPass.iNumLightProbes; - var diffuseLightSources = this._pMaterial.diffuseLightSources; - var specularLightSources = this._materialLightingPass._iUsesSpecular() ? this._pMaterial.specularLightSources : 0x00; - var combinedLightSources = diffuseLightSources | specularLightSources; - - this._shaderLightingObject.usesLightFallOff = this._pMaterial.enableLightFallOff && this._shaderLightingObject.profile != ContextGLProfile.BASELINE_CONSTRAINED; - this._shaderLightingObject.numLights = numAllLights + numLightProbes; - this._shaderLightingObject.numPointLights = this._materialLightingPass.iNumPointLights; - this._shaderLightingObject.numDirectionalLights = this._materialLightingPass.iNumDirectionalLights; - this._shaderLightingObject.numLightProbes = numLightProbes; - this._shaderLightingObject.pointLightsOffset = this._materialLightingPass.pointLightsOffset; - this._shaderLightingObject.directionalLightsOffset = this._materialLightingPass.directionalLightsOffset; - this._shaderLightingObject.lightProbesOffset = this._materialLightingPass.lightProbesOffset; - this._shaderLightingObject.lightPicker = this._materialLightingPass.lightPicker; - this._shaderLightingObject.usesLights = numAllLights > 0 && (combinedLightSources & materials.LightSources.LIGHTS) != 0; - this._shaderLightingObject.usesProbes = numLightProbes > 0 && (combinedLightSources & materials.LightSources.PROBES) != 0; - this._shaderLightingObject.usesLightsForSpecular = numAllLights > 0 && (specularLightSources & materials.LightSources.LIGHTS) != 0; - this._shaderLightingObject.usesProbesForSpecular = numLightProbes > 0 && (specularLightSources & materials.LightSources.PROBES) != 0; - this._shaderLightingObject.usesLightsForDiffuse = numAllLights > 0 && (diffuseLightSources & materials.LightSources.LIGHTS) != 0; - this._shaderLightingObject.usesProbesForDiffuse = numLightProbes > 0 && (diffuseLightSources & materials.LightSources.PROBES) != 0; - this._shaderLightingObject.usesShadows = this._materialLightingPass._iUsesShadows(); - - _super.prototype.pCalculateDependencies.call(this); - }; - return ShaderLightingCompiler; - })(materials.ShaderCompilerBase); - materials.ShaderLightingCompiler = ShaderLightingCompiler; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * ShaderRegisterData contains the "named" registers, generated by the compiler and to be passed on to the methods. - */ - var ShaderRegisterData = (function () { - function ShaderRegisterData() { - } - return ShaderRegisterData; - })(); - materials.ShaderRegisterData = ShaderRegisterData; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * ShadingMethodBase provides an abstract base method for shading methods, used by compiled passes to compile - * the final shading program. - */ - var ShadingMethodBase = (function (_super) { - __extends(ShadingMethodBase, _super); - /** - * Create a new ShadingMethodBase object. - */ - function ShadingMethodBase() { - _super.call(this); - } - ShadingMethodBase.prototype.iIsUsed = function (shaderObject) { - return true; - }; - - /** - * Initializes the properties for a MethodVO, including register and texture indices. - * - * @param methodVO The MethodVO object linking this method with the pass currently being compiled. - * - * @internal - */ - ShadingMethodBase.prototype.iInitVO = function (shaderObject, methodVO) { - }; - - /** - * Initializes unchanging shader constants using the data from a MethodVO. - * - * @param methodVO The MethodVO object linking this method with the pass currently being compiled. - * - * @internal - */ - ShadingMethodBase.prototype.iInitConstants = function (shaderObject, methodVO) { - }; - - /** - * Indicates whether or not this method expects normals in tangent space. Override for object-space normals. - */ - ShadingMethodBase.prototype.iUsesTangentSpace = function () { - return true; - }; - - Object.defineProperty(ShadingMethodBase.prototype, "passes", { - /** - * Any passes required that render to a texture used by this method. - */ - get: function () { - return this._passes; - }, - enumerable: true, - configurable: true - }); - - /** - * Cleans up any resources used by the current object. - */ - ShadingMethodBase.prototype.dispose = function () { - }; - - /** - * Resets the compilation state of the method. - * - * @internal - */ - ShadingMethodBase.prototype.iReset = function () { - this.iCleanCompilationData(); - }; - - /** - * Resets the method's state for compilation. - * - * @internal - */ - ShadingMethodBase.prototype.iCleanCompilationData = function () { - }; - - /** - * Get the vertex shader code for this method. - * @param vo The MethodVO object linking this method with the pass currently being compiled. - * @param regCache The register cache used during the compilation. - * - * @internal - */ - ShadingMethodBase.prototype.iGetVertexCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { - return ""; - }; - - /** - * @inheritDoc - */ - ShadingMethodBase.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - return null; - }; - - /** - * Sets the render state for this method. - * - * @param methodVO The MethodVO object linking this method with the pass currently being compiled. - * @param stage The Stage object currently used for rendering. - * - * @internal - */ - ShadingMethodBase.prototype.iActivate = function (shaderObject, methodVO, stage) { - }; - - /** - * Sets the render state for a single renderable. - * - * @param vo The MethodVO object linking this method with the pass currently being compiled. - * @param renderable The renderable currently being rendered. - * @param stage The Stage object currently used for rendering. - * @param camera The camera from which the scene is currently rendered. - * - * @internal - */ - ShadingMethodBase.prototype.iSetRenderState = function (shaderObject, methodVO, renderable, stage, camera) { - }; - - /** - * Clears the render state for this method. - * @param vo The MethodVO object linking this method with the pass currently being compiled. - * @param stage The Stage object currently used for rendering. - * - * @internal - */ - ShadingMethodBase.prototype.iDeactivate = function (shaderObject, methodVO, stage) { - }; - - /** - * Marks the shader program as invalid, so it will be recompiled before the next render. - * - * @internal - */ - ShadingMethodBase.prototype.iInvalidateShaderProgram = function () { - this.dispatchEvent(new away.events.ShadingMethodEvent(away.events.ShadingMethodEvent.SHADER_INVALIDATED)); - }; - - /** - * Copies the state from a ShadingMethodBase object into the current object. - */ - ShadingMethodBase.prototype.copyFrom = function (method) { - }; - return ShadingMethodBase; - })(away.library.NamedAssetBase); - materials.ShadingMethodBase = ShadingMethodBase; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * LightingMethodBase provides an abstract base method for shading methods that uses lights. - * Used for diffuse and specular shaders only. - */ - var LightingMethodBase = (function (_super) { - __extends(LightingMethodBase, _super); - /** - * Creates a new LightingMethodBase. - */ - function LightingMethodBase() { - _super.call(this); - } - /** - * Get the fragment shader code that will be needed before any per-light code is added. - * @param methodVO The MethodVO object containing the method data for the currently compiled material pass. - * @param regCache The register cache used during the compilation. - * @private - */ - LightingMethodBase.prototype.iGetFragmentPreLightingCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { - return ""; - }; - - /** - * Get the fragment shader code that will generate the code relevant to a single light. - * - * @param methodVO The MethodVO object containing the method data for the currently compiled material pass. - * @param lightDirReg The register containing the light direction vector. - * @param lightColReg The register containing the light colour. - * @param regCache The register cache used during the compilation. - */ - LightingMethodBase.prototype.iGetFragmentCodePerLight = function (shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters) { - return ""; - }; - - /** - * Get the fragment shader code that will generate the code relevant to a single light probe object. - * - * @param methodVO The MethodVO object containing the method data for the currently compiled material pass. - * @param cubeMapReg The register containing the cube map for the current probe - * @param weightRegister A string representation of the register + component containing the current weight - * @param regCache The register cache providing any necessary registers to the shader - */ - LightingMethodBase.prototype.iGetFragmentCodePerProbe = function (shaderObject, methodVO, cubeMapReg, weightRegister, registerCache, sharedRegisters) { - return ""; - }; - - /** - * Get the fragment shader code that should be added after all per-light code. Usually composits everything to the target register. - * - * @param methodVO The MethodVO object containing the method data for the currently compiled material pass. - * @param regCache The register cache used during the compilation. - * @param targetReg The register containing the final shading output. - * @private - */ - LightingMethodBase.prototype.iGetFragmentPostLightingCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - return ""; - }; - return LightingMethodBase; - })(materials.ShadingMethodBase); - materials.LightingMethodBase = LightingMethodBase; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var ContextGLMipFilter = away.stagegl.ContextGLMipFilter; - var ContextGLTextureFilter = away.stagegl.ContextGLTextureFilter; - var ContextGLWrapMode = away.stagegl.ContextGLWrapMode; - - /** - * AmbientBasicMethod provides the default shading method for uniform ambient lighting. - */ - var AmbientBasicMethod = (function (_super) { - __extends(AmbientBasicMethod, _super); - /** - * Creates a new AmbientBasicMethod object. - */ - function AmbientBasicMethod() { - _super.call(this); - this._color = 0xffffff; - this._alpha = 1; - this._colorR = 1; - this._colorG = 1; - this._colorB = 1; - this._ambient = 1; - } - /** - * @inheritDoc - */ - AmbientBasicMethod.prototype.iInitVO = function (shaderObject, methodVO) { - methodVO.needsUV = Boolean(shaderObject.texture != null); - }; - - /** - * @inheritDoc - */ - AmbientBasicMethod.prototype.iInitConstants = function (shaderObject, methodVO) { - if (!methodVO.needsUV) { - this._color = shaderObject.color; - this.updateColor(); - } - }; - - Object.defineProperty(AmbientBasicMethod.prototype, "ambient", { - /** - * The strength of the ambient reflection of the surface. - */ - get: function () { - return this._ambient; - }, - set: function (value) { - if (this._ambient == value) - return; - - this._ambient = value; - - this.updateColor(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(AmbientBasicMethod.prototype, "alpha", { - /** - * The alpha component of the surface. - */ - get: function () { - return this._alpha; - }, - set: function (value) { - if (this._alpha == value) - return; - - this._alpha = value; - - this.updateColor(); - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - AmbientBasicMethod.prototype.copyFrom = function (method) { - var m = method; - var b = m; - }; - - /** - * @inheritDoc - */ - AmbientBasicMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - var code = ""; - var ambientInputRegister; - - if (methodVO.needsUV) { - ambientInputRegister = registerCache.getFreeTextureReg(); - - methodVO.texturesIndex = ambientInputRegister.index; - - code += materials.ShaderCompilerHelper.getTex2DSampleCode(targetReg, sharedRegisters, ambientInputRegister, shaderObject.texture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping); - - if (shaderObject.alphaThreshold > 0) { - var cutOffReg = registerCache.getFreeFragmentConstant(); - methodVO.fragmentConstantsIndex = cutOffReg.index * 4; - - code += "sub " + targetReg + ".w, " + targetReg + ".w, " + cutOffReg + ".x\n" + "kil " + targetReg + ".w\n" + "add " + targetReg + ".w, " + targetReg + ".w, " + cutOffReg + ".x\n"; - } - } else { - ambientInputRegister = registerCache.getFreeFragmentConstant(); - methodVO.fragmentConstantsIndex = ambientInputRegister.index * 4; - - code += "mov " + targetReg + ", " + ambientInputRegister + "\n"; - } - - return code; - }; - - /** - * @inheritDoc - */ - AmbientBasicMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - if (methodVO.needsUV) { - stage.context.setSamplerStateAt(methodVO.texturesIndex, shaderObject.repeatTextures ? ContextGLWrapMode.REPEAT : ContextGLWrapMode.CLAMP, shaderObject.useSmoothTextures ? ContextGLTextureFilter.LINEAR : ContextGLTextureFilter.NEAREST, shaderObject.useMipmapping ? ContextGLMipFilter.MIPLINEAR : ContextGLMipFilter.MIPNONE); - stage.context.activateTexture(methodVO.texturesIndex, shaderObject.texture); - - if (shaderObject.alphaThreshold > 0) - shaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex] = shaderObject.alphaThreshold; - } else { - var index = methodVO.fragmentConstantsIndex; - var data = shaderObject.fragmentConstantData; - data[index] = this._colorR; - data[index + 1] = this._colorG; - data[index + 2] = this._colorB; - data[index + 3] = this._alpha; - } - }; - - /** - * Updates the ambient color data used by the render state. - */ - AmbientBasicMethod.prototype.updateColor = function () { - this._colorR = ((this._color >> 16) & 0xff) / 0xff * this._ambient; - this._colorG = ((this._color >> 8) & 0xff) / 0xff * this._ambient; - this._colorB = (this._color & 0xff) / 0xff * this._ambient; - }; - return AmbientBasicMethod; - })(materials.ShadingMethodBase); - materials.AmbientBasicMethod = AmbientBasicMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var ContextGLMipFilter = away.stagegl.ContextGLMipFilter; - var ContextGLTextureFilter = away.stagegl.ContextGLTextureFilter; - var ContextGLWrapMode = away.stagegl.ContextGLWrapMode; - - /** - * DiffuseBasicMethod provides the default shading method for Lambert (dot3) diffuse lighting. - */ - var DiffuseBasicMethod = (function (_super) { - __extends(DiffuseBasicMethod, _super); - /** - * Creates a new DiffuseBasicMethod object. - */ - function DiffuseBasicMethod() { - _super.call(this); - this._multiply = true; - this._diffuseColor = 0xffffff; - this._ambientColor = 0xffffff; - this._diffuseR = 1; - this._diffuseG = 1; - this._diffuseB = 1; - this._ambientR = 1; - this._ambientG = 1; - this._ambientB = 1; - } - DiffuseBasicMethod.prototype.iIsUsed = function (shaderObject) { - if (!shaderObject.numLights) - return false; - - return true; - }; - - Object.defineProperty(DiffuseBasicMethod.prototype, "multiply", { - /** - * Set internally if diffuse color component multiplies or replaces the ambient color - */ - get: function () { - return this._multiply; - }, - set: function (value) { - if (this._multiply == value) - return; - - this._multiply = value; - - this.iInvalidateShaderProgram(); - }, - enumerable: true, - configurable: true - }); - - - DiffuseBasicMethod.prototype.iInitVO = function (shaderObject, methodVO) { - methodVO.needsUV = this._pUseTexture; - methodVO.needsNormals = shaderObject.numLights > 0; - }; - - /** - * Forces the creation of the texture. - * @param stage The Stage used by the renderer - */ - DiffuseBasicMethod.prototype.generateMip = function (stage) { - if (this._pUseTexture) - stage.context.activateTexture(0, this._texture); - }; - - Object.defineProperty(DiffuseBasicMethod.prototype, "diffuseColor", { - /** - * The color of the diffuse reflection when not using a texture. - */ - get: function () { - return this._diffuseColor; - }, - set: function (value) { - if (this._diffuseColor == value) - return; - - this._diffuseColor = value; - - this.updateDiffuse(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DiffuseBasicMethod.prototype, "ambientColor", { - /** - * The color of the ambient reflection - */ - get: function () { - return this._ambientColor; - }, - set: function (value) { - if (this._ambientColor == value) - return; - - this._ambientColor = value; - - this.updateAmbient(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DiffuseBasicMethod.prototype, "texture", { - /** - * The bitmapData to use to define the diffuse reflection color per texel. - */ - get: function () { - return this._texture; - }, - set: function (value) { - var b = (value != null); - - if (b != this._pUseTexture || (value && this._texture && (value.hasMipmaps != this._texture.hasMipmaps || value.format != this._texture.format))) - this.iInvalidateShaderProgram(); - - this._pUseTexture = b; - this._texture = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - DiffuseBasicMethod.prototype.dispose = function () { - this._texture = null; - }; - - /** - * @inheritDoc - */ - DiffuseBasicMethod.prototype.copyFrom = function (method) { - var diff = method; - - this.texture = diff.texture; - this.multiply = diff.multiply; - this.diffuseColor = diff.diffuseColor; - this.ambientColor = diff.ambientColor; - }; - - /** - * @inheritDoc - */ - DiffuseBasicMethod.prototype.iCleanCompilationData = function () { - _super.prototype.iCleanCompilationData.call(this); - - this._pTotalLightColorReg = null; - this._pDiffuseInputRegister = null; - }; - - /** - * @inheritDoc - */ - DiffuseBasicMethod.prototype.iGetFragmentPreLightingCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { - var code = ""; - - this._pIsFirstLight = true; - - this._pTotalLightColorReg = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(this._pTotalLightColorReg, 1); - - return code; - }; - - /** - * @inheritDoc - */ - DiffuseBasicMethod.prototype.iGetFragmentCodePerLight = function (shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters) { - var code = ""; - var t; - - // write in temporary if not first light, so we can add to total diffuse colour - if (this._pIsFirstLight) { - t = this._pTotalLightColorReg; - } else { - t = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(t, 1); - } - - code += "dp3 " + t + ".x, " + lightDirReg + ", " + sharedRegisters.normalFragment + "\n" + "max " + t + ".w, " + t + ".x, " + sharedRegisters.commons + ".y\n"; - - if (shaderObject.usesLightFallOff) - code += "mul " + t + ".w, " + t + ".w, " + lightDirReg + ".w\n"; - - if (this._iModulateMethod != null) - code += this._iModulateMethod(shaderObject, methodVO, t, registerCache, sharedRegisters); - - code += "mul " + t + ", " + t + ".w, " + lightColReg + "\n"; - - if (!this._pIsFirstLight) { - code += "add " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ", " + t + "\n"; - registerCache.removeFragmentTempUsage(t); - } - - this._pIsFirstLight = false; - - return code; - }; - - /** - * @inheritDoc - */ - DiffuseBasicMethod.prototype.iGetFragmentCodePerProbe = function (shaderObject, methodVO, cubeMapReg, weightRegister, registerCache, sharedRegisters) { - var code = ""; - var t; - - // write in temporary if not first light, so we can add to total diffuse colour - if (this._pIsFirstLight) { - t = this._pTotalLightColorReg; - } else { - t = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(t, 1); - } - - code += "tex " + t + ", " + sharedRegisters.normalFragment + ", " + cubeMapReg + " \n" + "mul " + t + ".xyz, " + t + ".xyz, " + weightRegister + "\n"; - - if (this._iModulateMethod != null) - code += this._iModulateMethod(shaderObject, methodVO, t, registerCache, sharedRegisters); - - if (!this._pIsFirstLight) { - code += "add " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ", " + t + "\n"; - registerCache.removeFragmentTempUsage(t); - } - - this._pIsFirstLight = false; - - return code; - }; - - /** - * @inheritDoc - */ - DiffuseBasicMethod.prototype.iGetFragmentPostLightingCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - var code = ""; - - var albedo; - var cutOffReg; - - // incorporate input from ambient - if (sharedRegisters.shadowTarget) - code += this.pApplyShadow(shaderObject, methodVO, registerCache, sharedRegisters); - - albedo = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(albedo, 1); - - var ambientColorRegister = registerCache.getFreeFragmentConstant(); - methodVO.fragmentConstantsIndex = ambientColorRegister.index * 4; - - if (this._pUseTexture) { - this._pDiffuseInputRegister = registerCache.getFreeTextureReg(); - - methodVO.texturesIndex = this._pDiffuseInputRegister.index; - - code += materials.ShaderCompilerHelper.getTex2DSampleCode(albedo, sharedRegisters, this._pDiffuseInputRegister, this._texture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping); - } else { - this._pDiffuseInputRegister = registerCache.getFreeFragmentConstant(); - - code += "mov " + albedo + ", " + this._pDiffuseInputRegister + "\n"; - } - - code += "sat " + this._pTotalLightColorReg + ", " + this._pTotalLightColorReg + "\n" + "mul " + albedo + ".xyz, " + albedo + ", " + this._pTotalLightColorReg + "\n"; - - if (this._multiply) { - code += "add " + albedo + ".xyz, " + albedo + ", " + ambientColorRegister + "\n" + "mul " + targetReg + ".xyz, " + targetReg + ", " + albedo + "\n"; - } else { - code += "mul " + targetReg + ".xyz, " + targetReg + ", " + ambientColorRegister + "\n" + "mul " + this._pTotalLightColorReg + ".xyz, " + targetReg + ", " + this._pTotalLightColorReg + "\n" + "sub " + targetReg + ".xyz, " + targetReg + ", " + this._pTotalLightColorReg + "\n" + "add " + targetReg + ".xyz, " + targetReg + ", " + albedo + "\n"; - } - - registerCache.removeFragmentTempUsage(this._pTotalLightColorReg); - registerCache.removeFragmentTempUsage(albedo); - - return code; - }; - - /** - * Generate the code that applies the calculated shadow to the diffuse light - * @param methodVO The MethodVO object for which the compilation is currently happening. - * @param regCache The register cache the compiler is currently using for the register management. - */ - DiffuseBasicMethod.prototype.pApplyShadow = function (shaderObject, methodVO, regCache, sharedRegisters) { - return "mul " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ", " + sharedRegisters.shadowTarget + ".w\n"; - }; - - /** - * @inheritDoc - */ - DiffuseBasicMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - if (this._pUseTexture) { - stage.context.setSamplerStateAt(methodVO.texturesIndex, shaderObject.repeatTextures ? ContextGLWrapMode.REPEAT : ContextGLWrapMode.CLAMP, shaderObject.useSmoothTextures ? ContextGLTextureFilter.LINEAR : ContextGLTextureFilter.NEAREST, shaderObject.useMipmapping ? ContextGLMipFilter.MIPLINEAR : ContextGLMipFilter.MIPNONE); - stage.context.activateTexture(methodVO.texturesIndex, this._texture); - } else { - var index = methodVO.fragmentConstantsIndex; - var data = shaderObject.fragmentConstantData; - data[index + 4] = this._diffuseR; - data[index + 5] = this._diffuseG; - data[index + 6] = this._diffuseB; - data[index + 7] = 1; - } - }; - - /** - * Updates the diffuse color data used by the render state. - */ - DiffuseBasicMethod.prototype.updateDiffuse = function () { - this._diffuseR = ((this._diffuseColor >> 16) & 0xff) / 0xff; - this._diffuseG = ((this._diffuseColor >> 8) & 0xff) / 0xff; - this._diffuseB = (this._diffuseColor & 0xff) / 0xff; - }; - - /** - * Updates the ambient color data used by the render state. - */ - DiffuseBasicMethod.prototype.updateAmbient = function () { - this._ambientR = ((this._ambientColor >> 16) & 0xff) / 0xff; - this._ambientG = ((this._ambientColor >> 8) & 0xff) / 0xff; - this._ambientB = (this._ambientColor & 0xff) / 0xff; - }; - - /** - * @inheritDoc - */ - DiffuseBasicMethod.prototype.iSetRenderState = function (shaderObject, methodVO, renderable, stage, camera) { - //TODO move this to Activate (ambientR/G/B currently calc'd in render state) - if (shaderObject.numLights > 0) { - var index = methodVO.fragmentConstantsIndex; - var data = shaderObject.fragmentConstantData; - data[index] = shaderObject.ambientR * this._ambientR; - data[index + 1] = shaderObject.ambientG * this._ambientG; - data[index + 2] = shaderObject.ambientB * this._ambientB; - data[index + 3] = 1; - } - }; - return DiffuseBasicMethod; - })(materials.LightingMethodBase); - materials.DiffuseBasicMethod = DiffuseBasicMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * EffectMethodBase forms an abstract base class for shader methods that are not dependent on light sources, - * and are in essence post-process effects on the materials. - */ - var EffectMethodBase = (function (_super) { - __extends(EffectMethodBase, _super); - function EffectMethodBase() { - _super.call(this); - } - Object.defineProperty(EffectMethodBase.prototype, "assetType", { - /** - * @inheritDoc - */ - get: function () { - return away.library.AssetType.EFFECTS_METHOD; - }, - enumerable: true, - configurable: true - }); - - /** - * Get the fragment shader code that should be added after all per-light code. Usually composits everything to the target register. - * @param methodVO The MethodVO object containing the method data for the currently compiled material pass. - * @param regCache The register cache used during the compilation. - * @param targetReg The register that will be containing the method's output. - * @private - */ - EffectMethodBase.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - throw new away.errors.AbstractMethodError(); - return ""; - }; - return EffectMethodBase; - })(materials.ShadingMethodBase); - materials.EffectMethodBase = EffectMethodBase; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (materials) { - /** - * EffectColorTransformMethod provides a shading method that changes the colour of a material analogous to a - * ColorTransform object. - */ - var EffectColorTransformMethod = (function (_super) { - __extends(EffectColorTransformMethod, _super); - /** - * Creates a new EffectColorTransformMethod. - */ - function EffectColorTransformMethod() { - _super.call(this); - } - Object.defineProperty(EffectColorTransformMethod.prototype, "colorTransform", { - /** - * The ColorTransform object to transform the colour of the material with. - */ - get: function () { - return this._colorTransform; - }, - set: function (value) { - this._colorTransform = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - EffectColorTransformMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - var code = ""; - var colorMultReg = registerCache.getFreeFragmentConstant(); - var colorOffsReg = registerCache.getFreeFragmentConstant(); - - methodVO.fragmentConstantsIndex = colorMultReg.index * 4; - - //TODO: AGAL <> GLSL - code += "mul " + targetReg + ", " + targetReg + ", " + colorMultReg + "\n" + "add " + targetReg + ", " + targetReg + ", " + colorOffsReg + "\n"; - - return code; - }; - - /** - * @inheritDoc - */ - EffectColorTransformMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - var inv = 1 / 0xff; - var index = methodVO.fragmentConstantsIndex; - var data = shaderObject.fragmentConstantData; - - data[index] = this._colorTransform.redMultiplier; - data[index + 1] = this._colorTransform.greenMultiplier; - data[index + 2] = this._colorTransform.blueMultiplier; - data[index + 3] = this._colorTransform.alphaMultiplier; - data[index + 4] = this._colorTransform.redOffset * inv; - data[index + 5] = this._colorTransform.greenOffset * inv; - data[index + 6] = this._colorTransform.blueOffset * inv; - data[index + 7] = this._colorTransform.alphaOffset * inv; - }; - return EffectColorTransformMethod; - })(materials.EffectMethodBase); - materials.EffectColorTransformMethod = EffectColorTransformMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var ContextGLMipFilter = away.stagegl.ContextGLMipFilter; - var ContextGLTextureFilter = away.stagegl.ContextGLTextureFilter; - var ContextGLWrapMode = away.stagegl.ContextGLWrapMode; - - /** - * NormalBasicMethod is the default method for standard tangent-space normal mapping. - */ - var NormalBasicMethod = (function (_super) { - __extends(NormalBasicMethod, _super); - /** - * Creates a new NormalBasicMethod object. - */ - function NormalBasicMethod() { - _super.call(this); - } - NormalBasicMethod.prototype.iIsUsed = function (shaderObject) { - if (!this._useTexture || !shaderObject.normalDependencies) - return false; - - return true; - }; - - /** - * @inheritDoc - */ - NormalBasicMethod.prototype.iInitVO = function (shaderObject, methodVO) { - methodVO.needsUV = this._useTexture; - }; - - /** - * Indicates whether or not this method outputs normals in tangent space. Override for object-space normals. - */ - NormalBasicMethod.prototype.iOutputsTangentNormals = function () { - return true; - }; - - /** - * @inheritDoc - */ - NormalBasicMethod.prototype.copyFrom = function (method) { - var s = method; - var bnm = method; - - if (bnm.normalMap != null) - this.normalMap = bnm.normalMap; - }; - - Object.defineProperty(NormalBasicMethod.prototype, "normalMap", { - /** - * The texture containing the normals per pixel. - */ - get: function () { - return this._texture; - }, - set: function (value) { - var b = (value != null); - - if (b != this._useTexture || (value && this._texture && (value.hasMipmaps != this._texture.hasMipmaps || value.format != this._texture.format))) - this.iInvalidateShaderProgram(); - - this._useTexture = b; - this._texture = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - NormalBasicMethod.prototype.iCleanCompilationData = function () { - _super.prototype.iCleanCompilationData.call(this); - this._pNormalTextureRegister = null; - }; - - /** - * @inheritDoc - */ - NormalBasicMethod.prototype.dispose = function () { - if (this._texture) - this._texture = null; - }; - - /** - * @inheritDoc - */ - NormalBasicMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - if (methodVO.texturesIndex >= 0) { - stage.context.setSamplerStateAt(methodVO.texturesIndex, shaderObject.repeatTextures ? ContextGLWrapMode.REPEAT : ContextGLWrapMode.CLAMP, shaderObject.useSmoothTextures ? ContextGLTextureFilter.LINEAR : ContextGLTextureFilter.NEAREST, shaderObject.useMipmapping ? ContextGLMipFilter.MIPLINEAR : ContextGLMipFilter.MIPNONE); - stage.context.activateTexture(methodVO.texturesIndex, this._texture); - } - }; - - /** - * @inheritDoc - */ - NormalBasicMethod.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - this._pNormalTextureRegister = registerCache.getFreeTextureReg(); - - methodVO.texturesIndex = this._pNormalTextureRegister.index; - - return materials.ShaderCompilerHelper.getTex2DSampleCode(targetReg, sharedRegisters, this._pNormalTextureRegister, this._texture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping) + "sub " + targetReg + ".xyz, " + targetReg + ".xyz, " + sharedRegisters.commons + ".xxx\n" + "nrm " + targetReg + ".xyz, " + targetReg + "\n"; - }; - return NormalBasicMethod; - })(materials.ShadingMethodBase); - materials.NormalBasicMethod = NormalBasicMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * ShadowMapMethodBase provides an abstract base method for shadow map methods. - */ - var ShadowMapMethodBase = (function (_super) { - __extends(ShadowMapMethodBase, _super); - /** - * Creates a new ShadowMapMethodBase object. - * @param castingLight The light used to cast shadows. - */ - function ShadowMapMethodBase(castingLight) { - _super.call(this); - this._pEpsilon = .02; - this._pAlpha = 1; - this._pCastingLight = castingLight; - castingLight.castsShadows = true; - this._pShadowMapper = castingLight.shadowMapper; - } - Object.defineProperty(ShadowMapMethodBase.prototype, "assetType", { - /** - * @inheritDoc - */ - get: function () { - return away.library.AssetType.SHADOW_MAP_METHOD; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ShadowMapMethodBase.prototype, "alpha", { - /** - * The "transparency" of the shadows. This allows making shadows less strong. - */ - get: function () { - return this._pAlpha; - }, - set: function (value) { - this._pAlpha = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(ShadowMapMethodBase.prototype, "castingLight", { - /** - * The light casting the shadows. - */ - get: function () { - return this._pCastingLight; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(ShadowMapMethodBase.prototype, "epsilon", { - /** - * A small value to counter floating point precision errors when comparing values in the shadow map with the - * calculated depth value. Increase this if shadow banding occurs, decrease it if the shadow seems to be too detached. - */ - get: function () { - return this._pEpsilon; - }, - set: function (value) { - this._pEpsilon = value; - }, - enumerable: true, - configurable: true - }); - - return ShadowMapMethodBase; - })(materials.ShadingMethodBase); - materials.ShadowMapMethodBase = ShadowMapMethodBase; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var PointLight = away.entities.PointLight; - var AbstractMethodError = away.errors.AbstractMethodError; - - /** - * ShadowMethodBase provides an abstract method for simple (non-wrapping) shadow map methods. - */ - var ShadowMethodBase = (function (_super) { - __extends(ShadowMethodBase, _super); - /** - * Creates a new ShadowMethodBase object. - * @param castingLight The light used to cast shadows. - */ - function ShadowMethodBase(castingLight) { - this._pUsePoint = (castingLight instanceof PointLight); - - _super.call(this, castingLight); - } - /** - * @inheritDoc - */ - ShadowMethodBase.prototype.iInitVO = function (shaderObject, methodVO) { - methodVO.needsView = true; - methodVO.needsGlobalVertexPos = true; - methodVO.needsGlobalFragmentPos = this._pUsePoint; - methodVO.needsNormals = shaderObject.numLights > 0; - }; - - /** - * @inheritDoc - */ - ShadowMethodBase.prototype.iInitConstants = function (shaderObject, methodVO) { - var fragmentData = shaderObject.fragmentConstantData; - var vertexData = shaderObject.vertexConstantData; - var index = methodVO.fragmentConstantsIndex; - fragmentData[index] = 1.0; - fragmentData[index + 1] = 1 / 255.0; - fragmentData[index + 2] = 1 / 65025.0; - fragmentData[index + 3] = 1 / 16581375.0; - - fragmentData[index + 6] = 0; - fragmentData[index + 7] = 1; - - if (this._pUsePoint) { - fragmentData[index + 8] = 0; - fragmentData[index + 9] = 0; - fragmentData[index + 10] = 0; - fragmentData[index + 11] = 1; - } - - index = methodVO.vertexConstantsIndex; - if (index != -1) { - vertexData[index] = .5; - vertexData[index + 1] = .5; - vertexData[index + 2] = 0.0; - vertexData[index + 3] = 1.0; - } - }; - - Object.defineProperty(ShadowMethodBase.prototype, "_iDepthMapCoordReg", { - /** - * Wrappers that override the vertex shader need to set this explicitly - */ - get: function () { - return this._pDepthMapCoordReg; - }, - set: function (value) { - this._pDepthMapCoordReg = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - ShadowMethodBase.prototype.iCleanCompilationData = function () { - _super.prototype.iCleanCompilationData.call(this); - - this._pDepthMapCoordReg = null; - }; - - /** - * @inheritDoc - */ - ShadowMethodBase.prototype.iGetVertexCode = function (shaderObject, methodVO, regCache, sharedRegisters) { - return this._pUsePoint ? this._pGetPointVertexCode(methodVO, regCache, sharedRegisters) : this.pGetPlanarVertexCode(methodVO, regCache, sharedRegisters); - }; - - /** - * Gets the vertex code for shadow mapping with a point light. - * - * @param methodVO The MethodVO object linking this method with the pass currently being compiled. - * @param regCache The register cache used during the compilation. - */ - ShadowMethodBase.prototype._pGetPointVertexCode = function (methodVO, regCache, sharedRegisters) { - methodVO.vertexConstantsIndex = -1; - return ""; - }; - - /** - * Gets the vertex code for shadow mapping with a planar shadow map (fe: directional lights). - * - * @param methodVO The MethodVO object linking this method with the pass currently being compiled. - * @param regCache The register cache used during the compilation. - */ - ShadowMethodBase.prototype.pGetPlanarVertexCode = function (methodVO, regCache, sharedRegisters) { - var code = ""; - var temp = regCache.getFreeVertexVectorTemp(); - var dataReg = regCache.getFreeVertexConstant(); - var depthMapProj = regCache.getFreeVertexConstant(); - regCache.getFreeVertexConstant(); - regCache.getFreeVertexConstant(); - regCache.getFreeVertexConstant(); - this._pDepthMapCoordReg = regCache.getFreeVarying(); - methodVO.vertexConstantsIndex = dataReg.index * 4; - - // todo: can epsilon be applied here instead of fragment shader? - code += "m44 " + temp + ", " + sharedRegisters.globalPositionVertex + ", " + depthMapProj + "\n" + "div " + temp + ", " + temp + ", " + temp + ".w\n" + "mul " + temp + ".xy, " + temp + ".xy, " + dataReg + ".xy\n" + "add " + this._pDepthMapCoordReg + ", " + temp + ", " + dataReg + ".xxwz\n"; - - //"sub " + this._pDepthMapCoordReg + ".z, " + this._pDepthMapCoordReg + ".z, " + this._pDepthMapCoordReg + ".w\n"; - return code; - }; - - /** - * @inheritDoc - */ - ShadowMethodBase.prototype.iGetFragmentCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - var code = this._pUsePoint ? this._pGetPointFragmentCode(methodVO, targetReg, registerCache, sharedRegisters) : this._pGetPlanarFragmentCode(methodVO, targetReg, registerCache, sharedRegisters); - code += "add " + targetReg + ".w, " + targetReg + ".w, fc" + (methodVO.fragmentConstantsIndex / 4 + 1) + ".y\n" + "sat " + targetReg + ".w, " + targetReg + ".w\n"; - return code; - }; - - /** - * Gets the fragment code for shadow mapping with a planar shadow map. - * @param methodVO The MethodVO object linking this method with the pass currently being compiled. - * @param regCache The register cache used during the compilation. - * @param targetReg The register to contain the shadow coverage - * @return - */ - ShadowMethodBase.prototype._pGetPlanarFragmentCode = function (methodVO, targetReg, regCache, sharedRegisters) { - throw new AbstractMethodError(); - return ""; - }; - - /** - * Gets the fragment code for shadow mapping with a point light. - * @param methodVO The MethodVO object linking this method with the pass currently being compiled. - * @param regCache The register cache used during the compilation. - * @param targetReg The register to contain the shadow coverage - * @return - */ - ShadowMethodBase.prototype._pGetPointFragmentCode = function (methodVO, targetReg, regCache, sharedRegisters) { - throw new AbstractMethodError(); - return ""; - }; - - /** - * @inheritDoc - */ - ShadowMethodBase.prototype.iSetRenderState = function (shaderObject, methodVO, renderable, stage, camera) { - if (!this._pUsePoint) - this._pShadowMapper.iDepthProjection.copyRawDataTo(shaderObject.vertexConstantData, methodVO.vertexConstantsIndex + 4, true); - }; - - /** - * Gets the fragment code for combining this method with a cascaded shadow map method. - * @param methodVO The MethodVO object linking this method with the pass currently being compiled. - * @param regCache The register cache used during the compilation. - * @param decodeRegister The register containing the data to decode the shadow map depth value. - * @param depthTexture The texture containing the shadow map. - * @param depthProjection The projection of the fragment relative to the light. - * @param targetRegister The register to contain the shadow coverage - * @return - */ - ShadowMethodBase.prototype._iGetCascadeFragmentCode = function (shaderObject, methodVO, decodeRegister, depthTexture, depthProjection, targetRegister, registerCache, sharedRegisters) { - throw new Error("This shadow method is incompatible with cascade shadows"); - }; - - /** - * @inheritDoc - */ - ShadowMethodBase.prototype.iActivate = function (shaderObject, methodVO, stage) { - var fragmentData = shaderObject.fragmentConstantData; - var index = methodVO.fragmentConstantsIndex; - - if (this._pUsePoint) - fragmentData[index + 4] = -Math.pow(1 / (this._pCastingLight.fallOff * this._pEpsilon), 2); - else - shaderObject.vertexConstantData[methodVO.vertexConstantsIndex + 3] = -1 / (this._pShadowMapper.depth * this._pEpsilon); - - fragmentData[index + 5] = 1 - this._pAlpha; - - if (this._pUsePoint) { - var pos = this._pCastingLight.scenePosition; - fragmentData[index + 8] = pos.x; - fragmentData[index + 9] = pos.y; - fragmentData[index + 10] = pos.z; - - // used to decompress distance - var f = this._pCastingLight.fallOff; - fragmentData[index + 11] = 1 / (2 * f * f); - } - - if (!this._pUsePoint) - stage.context.activateRenderTexture(methodVO.texturesIndex, this._pCastingLight.shadowMapper.depthMap); - //else - // ( stage.context).activateCubeRenderTexture(methodVO.texturesIndex, this._pCastingLight.shadowMapper.depthMap); - }; - - /** - * Sets the method state for cascade shadow mapping. - */ - ShadowMethodBase.prototype.iActivateForCascade = function (shaderObject, methodVO, stage) { - throw new Error("This shadow method is incompatible with cascade shadows"); - }; - return ShadowMethodBase; - })(materials.ShadowMapMethodBase); - materials.ShadowMethodBase = ShadowMethodBase; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * ShadowHardMethod provides the cheapest shadow map method by using a single tap without any filtering. - */ - var ShadowHardMethod = (function (_super) { - __extends(ShadowHardMethod, _super); - /** - * Creates a new ShadowHardMethod object. - */ - function ShadowHardMethod(castingLight) { - _super.call(this, castingLight); - } - /** - * @inheritDoc - */ - ShadowHardMethod.prototype._pGetPlanarFragmentCode = function (methodVO, targetReg, regCache, sharedRegisters) { - var depthMapRegister = regCache.getFreeTextureReg(); - var decReg = regCache.getFreeFragmentConstant(); - - // needs to be reserved anyway. DO NOT REMOVE - var dataReg = regCache.getFreeFragmentConstant(); - - var depthCol = regCache.getFreeFragmentVectorTemp(); - var code = ""; - - methodVO.fragmentConstantsIndex = decReg.index * 4; - methodVO.texturesIndex = depthMapRegister.index; - - code += "tex " + depthCol + ", " + this._pDepthMapCoordReg + ", " + depthMapRegister + " <2d, nearest, clamp>\n" + "dp4 " + depthCol + ".z, " + depthCol + ", " + decReg + "\n" + "slt " + targetReg + ".w, " + this._pDepthMapCoordReg + ".z, " + depthCol + ".z\n"; // 0 if in shadow - - return code; - }; - - /** - * @inheritDoc - */ - ShadowHardMethod.prototype._pGetPointFragmentCode = function (methodVO, targetReg, regCache, sharedRegisters) { - var depthMapRegister = regCache.getFreeTextureReg(); - var decReg = regCache.getFreeFragmentConstant(); - var epsReg = regCache.getFreeFragmentConstant(); - var posReg = regCache.getFreeFragmentConstant(); - var depthSampleCol = regCache.getFreeFragmentVectorTemp(); - regCache.addFragmentTempUsages(depthSampleCol, 1); - var lightDir = regCache.getFreeFragmentVectorTemp(); - var code = ""; - - methodVO.fragmentConstantsIndex = decReg.index * 4; - methodVO.texturesIndex = depthMapRegister.index; - - code += "sub " + lightDir + ", " + sharedRegisters.globalPositionVarying + ", " + posReg + "\n" + "dp3 " + lightDir + ".w, " + lightDir + ".xyz, " + lightDir + ".xyz\n" + "mul " + lightDir + ".w, " + lightDir + ".w, " + posReg + ".w\n" + "nrm " + lightDir + ".xyz, " + lightDir + ".xyz\n" + "tex " + depthSampleCol + ", " + lightDir + ", " + depthMapRegister + " \n" + "dp4 " + depthSampleCol + ".z, " + depthSampleCol + ", " + decReg + "\n" + "add " + targetReg + ".w, " + lightDir + ".w, " + epsReg + ".x\n" + "slt " + targetReg + ".w, " + targetReg + ".w, " + depthSampleCol + ".z\n"; // 0 if in shadow - - regCache.removeFragmentTempUsage(depthSampleCol); - - return code; - }; - - /** - * @inheritDoc - */ - ShadowHardMethod.prototype._iGetCascadeFragmentCode = function (shaderObject, methodVO, decodeRegister, depthTexture, depthProjection, targetRegister, registerCache, sharedRegisters) { - var temp = registerCache.getFreeFragmentVectorTemp(); - return "tex " + temp + ", " + depthProjection + ", " + depthTexture + " <2d, nearest, clamp>\n" + "dp4 " + temp + ".z, " + temp + ", " + decodeRegister + "\n" + "slt " + targetRegister + ".w, " + depthProjection + ".z, " + temp + ".z\n"; - }; - - /** - * @inheritDoc - */ - ShadowHardMethod.prototype.iActivateForCascade = function (shaderObject, methodVO, stage) { - }; - return ShadowHardMethod; - })(materials.ShadowMethodBase); - materials.ShadowHardMethod = ShadowHardMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var ContextGLWrapMode = away.stagegl.ContextGLWrapMode; - var ContextGLTextureFilter = away.stagegl.ContextGLTextureFilter; - var ContextGLMipFilter = away.stagegl.ContextGLMipFilter; - - /** - * SpecularBasicMethod provides the default shading method for Blinn-Phong specular highlights (an optimized but approximated - * version of Phong specularity). - */ - var SpecularBasicMethod = (function (_super) { - __extends(SpecularBasicMethod, _super); - /** - * Creates a new SpecularBasicMethod object. - */ - function SpecularBasicMethod() { - _super.call(this); - this._gloss = 50; - this._specular = 1; - this._specularColor = 0xffffff; - this._iSpecularR = 1; - this._iSpecularG = 1; - this._iSpecularB = 1; - } - SpecularBasicMethod.prototype.iIsUsed = function (shaderObject) { - if (!shaderObject.numLights) - return false; - - return true; - }; - - /** - * @inheritDoc - */ - SpecularBasicMethod.prototype.iInitVO = function (shaderObject, methodVO) { - methodVO.needsUV = this._pUseTexture; - methodVO.needsNormals = shaderObject.numLights > 0; - methodVO.needsView = shaderObject.numLights > 0; - }; - - Object.defineProperty(SpecularBasicMethod.prototype, "gloss", { - /** - * The sharpness of the specular highlight. - */ - get: function () { - return this._gloss; - }, - set: function (value) { - this._gloss = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(SpecularBasicMethod.prototype, "specular", { - /** - * The overall strength of the specular highlights. - */ - get: function () { - return this._specular; - }, - set: function (value) { - if (value == this._specular) - return; - - this._specular = value; - this.updateSpecular(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(SpecularBasicMethod.prototype, "specularColor", { - /** - * The colour of the specular reflection of the surface. - */ - get: function () { - return this._specularColor; - }, - set: function (value) { - if (this._specularColor == value) - return; - - // specular is now either enabled or disabled - if (this._specularColor == 0 || value == 0) - this.iInvalidateShaderProgram(); - - this._specularColor = value; - this.updateSpecular(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(SpecularBasicMethod.prototype, "texture", { - /** - * The bitmapData that encodes the specular highlight strength per texel in the red channel, and the sharpness - * in the green channel. You can use SpecularBitmapTexture if you want to easily set specular and gloss maps - * from grayscale images, but prepared images are preferred. - */ - get: function () { - return this._texture; - }, - set: function (value) { - var b = (value != null); - - if (b != this._pUseTexture || (value && this._texture && (value.hasMipmaps != this._texture.hasMipmaps || value.format != this._texture.format))) - this.iInvalidateShaderProgram(); - - this._pUseTexture = b; - this._texture = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - SpecularBasicMethod.prototype.copyFrom = function (method) { - var m = method; - var bsm = method; - - var spec = bsm; - this.texture = spec.texture; - this.specular = spec.specular; - this.specularColor = spec.specularColor; - this.gloss = spec.gloss; - }; - - /** - * @inheritDoc - */ - SpecularBasicMethod.prototype.iCleanCompilationData = function () { - _super.prototype.iCleanCompilationData.call(this); - this._pTotalLightColorReg = null; - this._pSpecularTextureRegister = null; - this._pSpecularTexData = null; - this._pSpecularDataRegister = null; - }; - - /** - * @inheritDoc - */ - SpecularBasicMethod.prototype.iGetFragmentPreLightingCode = function (shaderObject, methodVO, registerCache, sharedRegisters) { - var code = ""; - - this._pIsFirstLight = true; - - this._pSpecularDataRegister = registerCache.getFreeFragmentConstant(); - methodVO.fragmentConstantsIndex = this._pSpecularDataRegister.index * 4; - - if (this._pUseTexture) { - this._pSpecularTexData = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(this._pSpecularTexData, 1); - this._pSpecularTextureRegister = registerCache.getFreeTextureReg(); - methodVO.texturesIndex = this._pSpecularTextureRegister.index; - code = materials.ShaderCompilerHelper.getTex2DSampleCode(this._pSpecularTexData, sharedRegisters, this._pSpecularTextureRegister, this._texture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping); - } else { - this._pSpecularTextureRegister = null; - } - - this._pTotalLightColorReg = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(this._pTotalLightColorReg, 1); - - return code; - }; - - /** - * @inheritDoc - */ - SpecularBasicMethod.prototype.iGetFragmentCodePerLight = function (shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters) { - var code = ""; - var t; - - if (this._pIsFirstLight) { - t = this._pTotalLightColorReg; - } else { - t = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(t, 1); - } - - var viewDirReg = sharedRegisters.viewDirFragment; - var normalReg = sharedRegisters.normalFragment; - - // blinn-phong half vector model - code += "add " + t + ", " + lightDirReg + ", " + viewDirReg + "\n" + "nrm " + t + ".xyz, " + t + "\n" + "dp3 " + t + ".w, " + normalReg + ", " + t + "\n" + "sat " + t + ".w, " + t + ".w\n"; - - if (this._pUseTexture) { - // apply gloss modulation from texture - code += "mul " + this._pSpecularTexData + ".w, " + this._pSpecularTexData + ".y, " + this._pSpecularDataRegister + ".w\n" + "pow " + t + ".w, " + t + ".w, " + this._pSpecularTexData + ".w\n"; - } else { - code += "pow " + t + ".w, " + t + ".w, " + this._pSpecularDataRegister + ".w\n"; - } - - // attenuate - if (shaderObject.usesLightFallOff) - code += "mul " + t + ".w, " + t + ".w, " + lightDirReg + ".w\n"; - - if (this._iModulateMethod != null) - code += this._iModulateMethod(shaderObject, methodVO, t, registerCache, sharedRegisters); - - code += "mul " + t + ".xyz, " + lightColReg + ", " + t + ".w\n"; - - if (!this._pIsFirstLight) { - code += "add " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ", " + t + "\n"; - registerCache.removeFragmentTempUsage(t); - } - - this._pIsFirstLight = false; - - return code; - }; - - /** - * @inheritDoc - */ - SpecularBasicMethod.prototype.iGetFragmentCodePerProbe = function (shaderObject, methodVO, cubeMapReg, weightRegister, registerCache, sharedRegisters) { - var code = ""; - var t; - - // write in temporary if not first light, so we can add to total diffuse colour - if (this._pIsFirstLight) { - t = this._pTotalLightColorReg; - } else { - t = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(t, 1); - } - - var normalReg = sharedRegisters.normalFragment; - var viewDirReg = sharedRegisters.viewDirFragment; - - code += "dp3 " + t + ".w, " + normalReg + ", " + viewDirReg + "\n" + "add " + t + ".w, " + t + ".w, " + t + ".w\n" + "mul " + t + ", " + t + ".w, " + normalReg + "\n" + "sub " + t + ", " + t + ", " + viewDirReg + "\n" + "tex " + t + ", " + t + ", " + cubeMapReg + " \n" + "mul " + t + ".xyz, " + t + ", " + weightRegister + "\n"; - - if (this._iModulateMethod != null) - code += this._iModulateMethod(shaderObject, methodVO, t, registerCache, sharedRegisters); - - if (!this._pIsFirstLight) { - code += "add " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ", " + t + "\n"; - registerCache.removeFragmentTempUsage(t); - } - - this._pIsFirstLight = false; - - return code; - }; - - /** - * @inheritDoc - */ - SpecularBasicMethod.prototype.iGetFragmentPostLightingCode = function (shaderObject, methodVO, targetReg, registerCache, sharedRegisters) { - var code = ""; - - if (sharedRegisters.shadowTarget) - code += "mul " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ", " + sharedRegisters.shadowTarget + ".w\n"; - - if (this._pUseTexture) { - // apply strength modulation from texture - code += "mul " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ", " + this._pSpecularTexData + ".x\n"; - registerCache.removeFragmentTempUsage(this._pSpecularTexData); - } - - // apply material's specular reflection - code += "mul " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ", " + this._pSpecularDataRegister + "\n" + "add " + targetReg + ".xyz, " + targetReg + ", " + this._pTotalLightColorReg + "\n"; - registerCache.removeFragmentTempUsage(this._pTotalLightColorReg); - - return code; - }; - - /** - * @inheritDoc - */ - SpecularBasicMethod.prototype.iActivate = function (shaderObject, methodVO, stage) { - if (this._pUseTexture) { - stage.context.setSamplerStateAt(methodVO.texturesIndex, shaderObject.repeatTextures ? ContextGLWrapMode.REPEAT : ContextGLWrapMode.CLAMP, shaderObject.useSmoothTextures ? ContextGLTextureFilter.LINEAR : ContextGLTextureFilter.NEAREST, shaderObject.useMipmapping ? ContextGLMipFilter.MIPLINEAR : ContextGLMipFilter.MIPNONE); - stage.context.activateTexture(methodVO.texturesIndex, this._texture); - } - - var index = methodVO.fragmentConstantsIndex; - var data = shaderObject.fragmentConstantData; - data[index] = this._iSpecularR; - data[index + 1] = this._iSpecularG; - data[index + 2] = this._iSpecularB; - data[index + 3] = this._gloss; - }; - - /** - * Updates the specular color data used by the render state. - */ - SpecularBasicMethod.prototype.updateSpecular = function () { - this._iSpecularR = ((this._specularColor >> 16) & 0xff) / 0xff * this._specular; - this._iSpecularG = ((this._specularColor >> 8) & 0xff) / 0xff * this._specular; - this._iSpecularB = (this._specularColor & 0xff) / 0xff * this._specular; - }; - return SpecularBasicMethod; - })(materials.LightingMethodBase); - materials.SpecularBasicMethod = SpecularBasicMethod; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var BlendMode = away.base.BlendMode; - - var ArgumentError = away.errors.ArgumentError; - var Event = away.events.Event; - - var ContextGLBlendFactor = away.stagegl.ContextGLBlendFactor; - var ContextGLCompareMode = away.stagegl.ContextGLCompareMode; - - /** - * MaterialPassBase provides an abstract base class for material shader passes. A material pass constitutes at least - * a render call per required renderable. - */ - var MaterialPassBase = (function (_super) { - __extends(MaterialPassBase, _super); - /** - * Creates a new MaterialPassBase object. - */ - function MaterialPassBase(passMode) { - if (typeof passMode === "undefined") { passMode = 0x03; } - var _this = this; - _super.call(this); - this._materialPassData = new Array(); - this._maxLights = 3; - this._preserveAlpha = true; - this._includeCasters = true; - this._forceSeparateMVP = false; - this._directionalLightsOffset = 0; - this._pointLightsOffset = 0; - this._lightProbesOffset = 0; - this._pNumPointLights = 0; - this._pNumDirectionalLights = 0; - this._pNumLightProbes = 0; - this._pNumLights = 0; - this._depthCompareMode = ContextGLCompareMode.LESS_EQUAL; - this._blendFactorSource = ContextGLBlendFactor.ONE; - this._blendFactorDest = ContextGLBlendFactor.ZERO; - this._pEnableBlending = false; - this._writeDepth = true; - - this._passMode = passMode; - - this._onLightsChangeDelegate = function (event) { - return _this.onLightsChange(event); - }; - } - Object.defineProperty(MaterialPassBase.prototype, "preserveAlpha", { - /** - * Indicates whether the output alpha value should remain unchanged compared to the material's original alpha. - */ - get: function () { - return this._preserveAlpha; - }, - set: function (value) { - if (this._preserveAlpha == value) - return; - - this._preserveAlpha = value; - - this._pInvalidatePass(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(MaterialPassBase.prototype, "includeCasters", { - /** - * Indicates whether or not shadow casting lights need to be included. - */ - get: function () { - return this._includeCasters; - }, - set: function (value) { - if (this._includeCasters == value) - return; - - this._includeCasters = value; - - this._pInvalidatePass(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(MaterialPassBase.prototype, "forceSeparateMVP", { - /** - * Indicates whether the screen projection should be calculated by forcing a separate scene matrix and - * view-projection matrix. This is used to prevent rounding errors when using multiple passes with different - * projection code. - */ - get: function () { - return this._forceSeparateMVP; - }, - set: function (value) { - if (this._forceSeparateMVP == value) - return; - - this._forceSeparateMVP = value; - - this._pInvalidatePass(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(MaterialPassBase.prototype, "directionalLightsOffset", { - /** - * Indicates the offset in the light picker's directional light vector for which to start including lights. - * This needs to be set before the light picker is assigned. - */ - get: function () { - return this._directionalLightsOffset; - }, - set: function (value) { - this._directionalLightsOffset = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(MaterialPassBase.prototype, "pointLightsOffset", { - /** - * Indicates the offset in the light picker's point light vector for which to start including lights. - * This needs to be set before the light picker is assigned. - */ - get: function () { - return this._pointLightsOffset; - }, - set: function (value) { - this._pointLightsOffset = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(MaterialPassBase.prototype, "lightProbesOffset", { - /** - * Indicates the offset in the light picker's light probes vector for which to start including lights. - * This needs to be set before the light picker is assigned. - */ - get: function () { - return this._lightProbesOffset; - }, - set: function (value) { - this._lightProbesOffset = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(MaterialPassBase.prototype, "passMode", { - /** - * - */ - get: function () { - return this._passMode; - }, - set: function (value) { - this._passMode = value; - - this._pInvalidatePass(); - }, - enumerable: true, - configurable: true - }); - - - /** - * Factory method to create a concrete shader object for this pass. - * - * @param profile The compatibility profile used by the renderer. - */ - MaterialPassBase.prototype.createShaderObject = function (profile) { - return new materials.ShaderObjectBase(profile); - }; - - Object.defineProperty(MaterialPassBase.prototype, "writeDepth", { - /** - * Indicate whether this pass should write to the depth buffer or not. Ignored when blending is enabled. - */ - get: function () { - return this._writeDepth; - }, - set: function (value) { - this._writeDepth = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(MaterialPassBase.prototype, "depthCompareMode", { - /** - * The depth compare mode used to render the renderables using this material. - * - * @see away.stagegl.ContextGLCompareMode - */ - get: function () { - return this._depthCompareMode; - }, - set: function (value) { - this._depthCompareMode = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * Cleans up any resources used by the current object. - * @param deep Indicates whether other resources should be cleaned up, that could potentially be shared across different instances. - */ - MaterialPassBase.prototype.dispose = function () { - if (this._pLightPicker) - this._pLightPicker.removeEventListener(Event.CHANGE, this._onLightsChangeDelegate); - - while (this._materialPassData.length) - this._materialPassData[0].dispose(); - - this._materialPassData = null; - }; - - /** - * Renders an object to the current render target. - * - * @private - */ - MaterialPassBase.prototype._iRender = function (pass, renderable, stage, camera, viewProjection) { - this.setRenderState(pass, renderable, stage, camera, viewProjection); - }; - - /** - * - * - * @param renderable - * @param stage - * @param camera - */ - MaterialPassBase.prototype.setRenderState = function (pass, renderable, stage, camera, viewProjection) { - pass.shaderObject.setRenderState(renderable, stage, camera, viewProjection); - }; - - /** - * The blend mode to use when drawing this renderable. The following blend modes are supported: - *
    - *
  • BlendMode.NORMAL: No blending, unless the material inherently needs it
  • - *
  • BlendMode.LAYER: Force blending. This will draw the object the same as NORMAL, but without writing depth writes.
  • - *
  • BlendMode.MULTIPLY
  • - *
  • BlendMode.ADD
  • - *
  • BlendMode.ALPHA
  • - *
- */ - MaterialPassBase.prototype.setBlendMode = function (value) { - switch (value) { - case BlendMode.NORMAL: - this._blendFactorSource = ContextGLBlendFactor.ONE; - this._blendFactorDest = ContextGLBlendFactor.ZERO; - this._pEnableBlending = false; - - break; - - case BlendMode.LAYER: - this._blendFactorSource = ContextGLBlendFactor.SOURCE_ALPHA; - this._blendFactorDest = ContextGLBlendFactor.ONE_MINUS_SOURCE_ALPHA; - this._pEnableBlending = true; - - break; - - case BlendMode.MULTIPLY: - this._blendFactorSource = ContextGLBlendFactor.ZERO; - this._blendFactorDest = ContextGLBlendFactor.SOURCE_COLOR; - this._pEnableBlending = true; - - break; - - case BlendMode.ADD: - this._blendFactorSource = ContextGLBlendFactor.SOURCE_ALPHA; - this._blendFactorDest = ContextGLBlendFactor.ONE; - this._pEnableBlending = true; - - break; - - case BlendMode.ALPHA: - this._blendFactorSource = ContextGLBlendFactor.ZERO; - this._blendFactorDest = ContextGLBlendFactor.SOURCE_ALPHA; - this._pEnableBlending = true; - - break; - - default: - throw new ArgumentError("Unsupported blend mode!"); - } - }; - - /** - * Sets the render state for the pass that is independent of the rendered object. This needs to be called before - * calling renderPass. Before activating a pass, the previously used pass needs to be deactivated. - * @param stage The Stage object which is currently used for rendering. - * @param camera The camera from which the scene is viewed. - * @private - */ - MaterialPassBase.prototype._iActivate = function (pass, stage, camera) { - var context = stage.context; - - context.setDepthTest((this._writeDepth && !this._pEnableBlending), this._depthCompareMode); - - if (this._pEnableBlending) - context.setBlendFactors(this._blendFactorSource, this._blendFactorDest); - - context.activateMaterialPass(pass, stage, camera); - }; - - /** - * Clears the render state for the pass. This needs to be called before activating another pass. - * @param stage The Stage used for rendering - * - * @private - */ - MaterialPassBase.prototype._iDeactivate = function (pass, stage) { - stage.context.deactivateMaterialPass(pass, stage); - - stage.context.setDepthTest(true, ContextGLCompareMode.LESS_EQUAL); // TODO : imeplement - }; - - /** - * Marks the shader program as invalid, so it will be recompiled before the next render. - * - * @param updateMaterial Indicates whether the invalidation should be performed on the entire material. Should always pass "true" unless it's called from the material itself. - */ - MaterialPassBase.prototype._pInvalidatePass = function () { - var len = this._materialPassData.length; - for (var i = 0; i < len; i++) - this._materialPassData[i].invalidate(); - - this.dispatchEvent(new Event(Event.CHANGE)); - }; - - Object.defineProperty(MaterialPassBase.prototype, "lightPicker", { - /** - * The light picker used by the material to provide lights to the material if it supports lighting. - * - * @see away.materials.LightPickerBase - * @see away.materials.StaticLightPicker - */ - get: function () { - return this._pLightPicker; - }, - set: function (value) { - if (this._pLightPicker) - this._pLightPicker.removeEventListener(Event.CHANGE, this._onLightsChangeDelegate); - - this._pLightPicker = value; - - if (this._pLightPicker) - this._pLightPicker.addEventListener(Event.CHANGE, this._onLightsChangeDelegate); - - this.pUpdateLights(); - }, - enumerable: true, - configurable: true - }); - - - /** - * Called when the light picker's configuration changes. - */ - MaterialPassBase.prototype.onLightsChange = function (event) { - this.pUpdateLights(); - }; - - /** - * Implemented by subclasses if the pass uses lights to update the shader. - */ - MaterialPassBase.prototype.pUpdateLights = function () { - var numDirectionalLightsOld = this._pNumDirectionalLights; - var numPointLightsOld = this._pNumPointLights; - var numLightProbesOld = this._pNumLightProbes; - - if (this._pLightPicker && (this._passMode & materials.MaterialPassMode.LIGHTING)) { - this._pNumDirectionalLights = this.calculateNumDirectionalLights(this._pLightPicker.numDirectionalLights); - this._pNumPointLights = this.calculateNumPointLights(this._pLightPicker.numPointLights); - this._pNumLightProbes = this.calculateNumProbes(this._pLightPicker.numLightProbes); - - if (this._includeCasters) { - this._pNumDirectionalLights += this._pLightPicker.numCastingDirectionalLights; - this._pNumPointLights += this._pLightPicker.numCastingPointLights; - } - } else { - this._pNumDirectionalLights = 0; - this._pNumPointLights = 0; - this._pNumLightProbes = 0; - } - - this._pNumLights = this._pNumDirectionalLights + this._pNumPointLights; - - if (numDirectionalLightsOld != this._pNumDirectionalLights || numPointLightsOld != this._pNumPointLights || numLightProbesOld != this._pNumLightProbes) - this._pInvalidatePass(); - }; - - MaterialPassBase.prototype._iIncludeDependencies = function (shaderObject) { - if (this._forceSeparateMVP) - shaderObject.globalPosDependencies++; - - shaderObject.outputsNormals = this._pOutputsNormals(shaderObject); - shaderObject.outputsTangentNormals = shaderObject.outputsNormals && this._pOutputsTangentNormals(shaderObject); - shaderObject.usesTangentSpace = shaderObject.outputsTangentNormals && this._pUsesTangentSpace(shaderObject); - - if (!shaderObject.usesTangentSpace) - shaderObject.addWorldSpaceDependencies(Boolean(this._passMode & materials.MaterialPassMode.EFFECTS)); - }; - - MaterialPassBase.prototype._iInitConstantData = function (shaderObject) { - }; - - MaterialPassBase.prototype._iGetPreLightingVertexCode = function (shaderObject, registerCache, sharedRegisters) { - return ""; - }; - - MaterialPassBase.prototype._iGetPreLightingFragmentCode = function (shaderObject, registerCache, sharedRegisters) { - return ""; - }; - - MaterialPassBase.prototype._iGetVertexCode = function (shaderObject, registerCache, sharedRegisters) { - return ""; - }; - - MaterialPassBase.prototype._iGetFragmentCode = function (shaderObject, registerCache, sharedRegisters) { - return ""; - }; - - MaterialPassBase.prototype._iGetNormalVertexCode = function (shaderObject, registerCache, sharedRegisters) { - return ""; - }; - - MaterialPassBase.prototype._iGetNormalFragmentCode = function (shaderObject, registerCache, sharedRegisters) { - return ""; - }; - - Object.defineProperty(MaterialPassBase.prototype, "iNumPointLights", { - /** - * The amount of point lights that need to be supported. - */ - get: function () { - return this._pNumPointLights; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(MaterialPassBase.prototype, "iNumDirectionalLights", { - /** - * The amount of directional lights that need to be supported. - */ - get: function () { - return this._pNumDirectionalLights; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(MaterialPassBase.prototype, "iNumLightProbes", { - /** - * The amount of light probes that need to be supported. - */ - get: function () { - return this._pNumLightProbes; - }, - enumerable: true, - configurable: true - }); - - /** - * Indicates whether or not normals are calculated at all. - */ - MaterialPassBase.prototype._pOutputsNormals = function (shaderObject) { - return false; - }; - - /** - * Indicates whether or not normals are calculated in tangent space. - */ - MaterialPassBase.prototype._pOutputsTangentNormals = function (shaderObject) { - return false; - }; - - /** - * Indicates whether or not normals are allowed in tangent space. This is only the case if no object-space - * dependencies exist. - */ - MaterialPassBase.prototype._pUsesTangentSpace = function (shaderObject) { - return false; - }; - - /** - * Calculates the amount of directional lights this material will support. - * @param numDirectionalLights The maximum amount of directional lights to support. - * @return The amount of directional lights this material will support, bounded by the amount necessary. - */ - MaterialPassBase.prototype.calculateNumDirectionalLights = function (numDirectionalLights) { - return Math.min(numDirectionalLights - this._directionalLightsOffset, this._maxLights); - }; - - /** - * Calculates the amount of point lights this material will support. - * @param numDirectionalLights The maximum amount of point lights to support. - * @return The amount of point lights this material will support, bounded by the amount necessary. - */ - MaterialPassBase.prototype.calculateNumPointLights = function (numPointLights) { - var numFree = this._maxLights - this._pNumDirectionalLights; - return Math.min(numPointLights - this._pointLightsOffset, numFree); - }; - - /** - * Calculates the amount of light probes this material will support. - * @param numDirectionalLights The maximum amount of light probes to support. - * @return The amount of light probes this material will support, bounded by the amount necessary. - */ - MaterialPassBase.prototype.calculateNumProbes = function (numLightProbes) { - var numChannels = 0; - - // if ((this._pSpecularLightSources & LightSources.PROBES) != 0) - // ++numChannels; - // - // if ((this._pDiffuseLightSources & LightSources.PROBES) != 0) - // ++numChannels; - // 4 channels available - return Math.min(numLightProbes - this._lightProbesOffset, (4 / numChannels) | 0); - }; - - MaterialPassBase.prototype._iAddMaterialPassData = function (materialPassData) { - this._materialPassData.push(materialPassData); - - return materialPassData; - }; - - MaterialPassBase.prototype._iRemoveMaterialPassData = function (materialPassData) { - this._materialPassData.splice(this._materialPassData.indexOf(materialPassData), 1); - - return materialPassData; - }; - return MaterialPassBase; - })(away.library.NamedAssetBase); - materials.MaterialPassBase = MaterialPassBase; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -/// -/// -var away; -(function (away) { - (function (materials) { - /** - * LineBasicPass is a material pass that draws wireframe segments. - */ - var LineBasicPass = (function (_super) { - __extends(LineBasicPass, _super); - /** - * Creates a new SegmentPass object. - * - * @param material The material to which this pass belongs. - */ - function LineBasicPass() { - _super.call(this); - } - /** - * @inheritDoc - */ - LineBasicPass.prototype._iGetFragmentCode = function (shaderObject, regCache, sharedReg) { - var targetReg = sharedReg.shadedTarget; - - return "mov " + targetReg + ", v0\n"; - }; - return LineBasicPass; - })(materials.MaterialPassBase); - materials.LineBasicPass = LineBasicPass; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - /** - * SkyboxPass provides a material pass exclusively used to render sky boxes from a cube texture. - */ - var SkyboxPass = (function (_super) { - __extends(SkyboxPass, _super); - /** - * Creates a new SkyboxPass object. - * - * @param material The material to which this pass belongs. - */ - function SkyboxPass() { - _super.call(this); - } - SkyboxPass.prototype._iIncludeDependencies = function (shaderObject) { - shaderObject.useMipmapping = false; - }; - return SkyboxPass; - })(materials.MaterialPassBase); - materials.SkyboxPass = SkyboxPass; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var ContextGLMipFilter = away.stagegl.ContextGLMipFilter; - var ContextGLTextureFilter = away.stagegl.ContextGLTextureFilter; - var ContextGLWrapMode = away.stagegl.ContextGLWrapMode; - - /** - * CompiledPass forms an abstract base class for the default compiled pass materials provided by Away3D, - * using material methods to define their appearance. - */ - var TriangleBasicPass = (function (_super) { - __extends(TriangleBasicPass, _super); - /** - * Creates a new CompiledPass object. - * - * @param material The material to which this pass belongs. - */ - function TriangleBasicPass() { - _super.call(this); - this._diffuseColor = 0xffffff; - this._diffuseR = 1; - this._diffuseG = 1; - this._diffuseB = 1; - this._diffuseA = 1; - } - Object.defineProperty(TriangleBasicPass.prototype, "diffuseAlpha", { - /** - * The alpha component of the diffuse reflection. - */ - get: function () { - return this._diffuseA; - }, - set: function (value) { - this._diffuseA = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleBasicPass.prototype, "diffuseColor", { - /** - * The color of the diffuse reflection when not using a texture. - */ - get: function () { - return this._diffuseColor; - }, - set: function (diffuseColor) { - this._diffuseColor = diffuseColor; - - this._diffuseR = ((this._diffuseColor >> 16) & 0xff) / 0xff; - this._diffuseG = ((this._diffuseColor >> 8) & 0xff) / 0xff; - this._diffuseB = (this._diffuseColor & 0xff) / 0xff; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - TriangleBasicPass.prototype._iGetFragmentCode = function (shaderObject, regCache, sharedReg) { - var code = ""; - var targetReg = sharedReg.shadedTarget; - var diffuseInputReg; - - if (shaderObject.texture != null) { - diffuseInputReg = regCache.getFreeTextureReg(); - - this._texturesIndex = diffuseInputReg.index; - - code += materials.ShaderCompilerHelper.getTex2DSampleCode(targetReg, sharedReg, diffuseInputReg, shaderObject.texture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping); - - if (shaderObject.alphaThreshold > 0) { - var cutOffReg = regCache.getFreeFragmentConstant(); - this._fragmentConstantsIndex = cutOffReg.index * 4; - - code += "sub " + targetReg + ".w, " + targetReg + ".w, " + cutOffReg + ".x\n" + "kil " + targetReg + ".w\n" + "add " + targetReg + ".w, " + targetReg + ".w, " + cutOffReg + ".x\n"; - } - } else { - diffuseInputReg = regCache.getFreeFragmentConstant(); - - this._fragmentConstantsIndex = diffuseInputReg.index * 4; - - code += "mov " + targetReg + ", " + diffuseInputReg + "\n"; - } - - return code; - }; - - TriangleBasicPass.prototype._iIncludeDependencies = function (dependencyCounter) { - if (dependencyCounter.texture != null) - dependencyCounter.uvDependencies++; - }; - - /** - * @inheritDoc - */ - TriangleBasicPass.prototype._iActivate = function (pass, stage, camera) { - _super.prototype._iActivate.call(this, pass, stage, camera); - - var shaderObject = pass.shaderObject; - - if (shaderObject.texture != null) { - stage.context.setSamplerStateAt(this._texturesIndex, shaderObject.repeatTextures ? ContextGLWrapMode.REPEAT : ContextGLWrapMode.CLAMP, shaderObject.useSmoothTextures ? ContextGLTextureFilter.LINEAR : ContextGLTextureFilter.NEAREST, shaderObject.useMipmapping ? ContextGLMipFilter.MIPLINEAR : ContextGLMipFilter.MIPNONE); - stage.context.activateTexture(this._texturesIndex, shaderObject.texture); - - if (shaderObject.alphaThreshold > 0) - shaderObject.fragmentConstantData[this._fragmentConstantsIndex] = shaderObject.alphaThreshold; - } else { - var index = this._fragmentConstantsIndex; - var data = shaderObject.fragmentConstantData; - data[index] = this._diffuseR; - data[index + 1] = this._diffuseG; - data[index + 2] = this._diffuseB; - data[index + 3] = this._diffuseA; - } - }; - return TriangleBasicPass; - })(materials.MaterialPassBase); - materials.TriangleBasicPass = TriangleBasicPass; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var ContextGLMipFilter = away.stagegl.ContextGLMipFilter; - var ContextGLTextureFilter = away.stagegl.ContextGLTextureFilter; - var ContextGLWrapMode = away.stagegl.ContextGLWrapMode; - - /** - * DepthMapPass is a pass that writes depth values to a depth map as a 32-bit value exploded over the 4 texture channels. - * This is used to render shadow maps, depth maps, etc. - */ - var DepthMapPass = (function (_super) { - __extends(DepthMapPass, _super); - /** - * Creates a new DepthMapPass object. - * - * @param material The material to which this pass belongs. - */ - function DepthMapPass() { - _super.call(this); - } - /** - * Initializes the unchanging constant data for this material. - */ - DepthMapPass.prototype._iInitConstantData = function (shaderObject) { - _super.prototype._iInitConstantData.call(this, shaderObject); - - var index = this._fragmentConstantsIndex; - var data = shaderObject.fragmentConstantData; - data[index] = 1.0; - data[index + 1] = 255.0; - data[index + 2] = 65025.0; - data[index + 3] = 16581375.0; - data[index + 4] = 1.0 / 255.0; - data[index + 5] = 1.0 / 255.0; - data[index + 6] = 1.0 / 255.0; - data[index + 7] = 0.0; - }; - - DepthMapPass.prototype._iIncludeDependencies = function (shaderObject) { - shaderObject.projectionDependencies++; - - if (shaderObject.alphaThreshold > 0) - shaderObject.uvDependencies++; - }; - - /** - * @inheritDoc - */ - DepthMapPass.prototype._iGetFragmentCode = function (shaderObject, registerCache, sharedRegisters) { - var code = ""; - var targetReg = sharedRegisters.shadedTarget; - var diffuseInputReg = registerCache.getFreeTextureReg(); - var dataReg1 = registerCache.getFreeFragmentConstant(); - var dataReg2 = registerCache.getFreeFragmentConstant(); - - this._fragmentConstantsIndex = dataReg1.index * 4; - - var temp1 = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(temp1, 1); - var temp2 = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(temp2, 1); - - code += "div " + temp1 + ", " + sharedRegisters.projectionFragment + ", " + sharedRegisters.projectionFragment + ".w\n" + "mul " + temp1 + ", " + dataReg1 + ", " + temp1 + ".z\n" + "frc " + temp1 + ", " + temp1 + "\n" + "mul " + temp2 + ", " + temp1 + ".yzww, " + dataReg2 + "\n"; - - //codeF += "mov ft1.w, fc1.w \n" + - // "mov ft0.w, fc0.x \n"; - if (shaderObject.alphaThreshold > 0) { - diffuseInputReg = registerCache.getFreeTextureReg(); - - this._texturesIndex = diffuseInputReg.index; - - var albedo = registerCache.getFreeFragmentVectorTemp(); - code += materials.ShaderCompilerHelper.getTex2DSampleCode(albedo, sharedRegisters, diffuseInputReg, shaderObject.texture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping); - - var cutOffReg = registerCache.getFreeFragmentConstant(); - - code += "sub " + albedo + ".w, " + albedo + ".w, " + cutOffReg + ".x\n" + "kil " + albedo + ".w\n"; - } - - code += "sub " + targetReg + ", " + temp1 + ", " + temp2 + "\n"; - - registerCache.removeFragmentTempUsage(temp1); - registerCache.removeFragmentTempUsage(temp2); - - return code; - }; - - DepthMapPass.prototype._iRender = function (pass, renderable, stage, camera, viewProjection) { - //this.setRenderState(pass, renderable, stage, camera, viewProjection); - }; - - /** - * @inheritDoc - */ - DepthMapPass.prototype._iActivate = function (pass, stage, camera) { - _super.prototype._iActivate.call(this, pass, stage, camera); - - var context = stage.context; - var shaderObject = pass.shaderObject; - - if (shaderObject.alphaThreshold > 0) { - context.setSamplerStateAt(this._texturesIndex, shaderObject.repeatTextures ? ContextGLWrapMode.REPEAT : ContextGLWrapMode.CLAMP, shaderObject.useSmoothTextures ? ContextGLTextureFilter.LINEAR : ContextGLTextureFilter.NEAREST, shaderObject.useMipmapping ? ContextGLMipFilter.MIPLINEAR : ContextGLMipFilter.MIPNONE); - context.activateTexture(this._texturesIndex, shaderObject.texture); - - shaderObject.fragmentConstantData[this._fragmentConstantsIndex + 8] = pass.shaderObject.alphaThreshold; - } - }; - return DepthMapPass; - })(materials.MaterialPassBase); - materials.DepthMapPass = DepthMapPass; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -var away; -(function (away) { - /// - (function (materials) { - var ContextGLMipFilter = away.stagegl.ContextGLMipFilter; - var ContextGLTextureFilter = away.stagegl.ContextGLTextureFilter; - var ContextGLWrapMode = away.stagegl.ContextGLWrapMode; - - /** - * DistanceMapPass is a pass that writes distance values to a depth map as a 32-bit value exploded over the 4 texture channels. - * This is used to render omnidirectional shadow maps. - */ - var DistanceMapPass = (function (_super) { - __extends(DistanceMapPass, _super); - /** - * Creates a new DistanceMapPass object. - * - * @param material The material to which this pass belongs. - */ - function DistanceMapPass() { - _super.call(this); - } - /** - * Initializes the unchanging constant data for this material. - */ - DistanceMapPass.prototype._iInitConstantData = function (shaderObject) { - _super.prototype._iInitConstantData.call(this, shaderObject); - - var index = this._fragmentConstantsIndex; - var data = shaderObject.fragmentConstantData; - data[index + 4] = 1.0 / 255.0; - data[index + 5] = 1.0 / 255.0; - data[index + 6] = 1.0 / 255.0; - data[index + 7] = 0.0; - }; - - DistanceMapPass.prototype._iIncludeDependencies = function (shaderObject) { - shaderObject.projectionDependencies++; - shaderObject.viewDirDependencies++; - - if (shaderObject.alphaThreshold > 0) - shaderObject.uvDependencies++; - - shaderObject.addWorldSpaceDependencies(false); - }; - - /** - * @inheritDoc - */ - DistanceMapPass.prototype._iGetFragmentCode = function (shaderObject, registerCache, sharedRegisters) { - var code; - var targetReg = sharedRegisters.shadedTarget; - var diffuseInputReg = registerCache.getFreeTextureReg(); - var dataReg1 = registerCache.getFreeFragmentConstant(); - var dataReg2 = registerCache.getFreeFragmentConstant(); - - this._fragmentConstantsIndex = dataReg1.index * 4; - - var temp1 = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(temp1, 1); - var temp2 = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(temp2, 1); - - // squared distance to view - code = "dp3 " + temp1 + ".z, " + sharedRegisters.viewDirVarying + ".xyz, " + sharedRegisters.viewDirVarying + ".xyz\n" + "mul " + temp1 + ", " + dataReg1 + ", " + temp1 + ".z\n" + "frc " + temp1 + ", " + temp1 + "\n" + "mul " + temp2 + ", " + temp1 + ".yzww, " + dataReg2 + "\n"; - - if (shaderObject.alphaThreshold > 0) { - diffuseInputReg = registerCache.getFreeTextureReg(); - - this._texturesIndex = diffuseInputReg.index; - - var albedo = registerCache.getFreeFragmentVectorTemp(); - code += materials.ShaderCompilerHelper.getTex2DSampleCode(albedo, sharedRegisters, diffuseInputReg, shaderObject.texture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping); - - var cutOffReg = registerCache.getFreeFragmentConstant(); - - code += "sub " + albedo + ".w, " + albedo + ".w, " + cutOffReg + ".x\n" + "kil " + albedo + ".w\n"; - } - - code += "sub " + targetReg + ", " + temp1 + ", " + temp2 + "\n"; - - return code; - }; - - /** - * @inheritDoc - */ - DistanceMapPass.prototype._iActivate = function (pass, stage, camera) { - _super.prototype._iActivate.call(this, pass, stage, camera); - - var context = stage.context; - var shaderObject = pass.shaderObject; - - var f = camera.projection.far; - - f = 1 / (2 * f * f); - - // sqrt(f*f+f*f) is largest possible distance for any frustum, so we need to divide by it. Rarely a tight fit, but with 32 bits precision, it's enough. - var index = this._fragmentConstantsIndex; - var data = shaderObject.fragmentConstantData; - data[index] = 1.0 * f; - data[index + 1] = 255.0 * f; - data[index + 2] = 65025.0 * f; - data[index + 3] = 16581375.0 * f; - - if (shaderObject.alphaThreshold > 0) { - context.setSamplerStateAt(this._texturesIndex, shaderObject.repeatTextures ? ContextGLWrapMode.REPEAT : ContextGLWrapMode.CLAMP, shaderObject.useSmoothTextures ? ContextGLTextureFilter.LINEAR : ContextGLTextureFilter.NEAREST, shaderObject.useMipmapping ? ContextGLMipFilter.MIPLINEAR : ContextGLMipFilter.MIPNONE); - context.activateTexture(this._texturesIndex, shaderObject.texture); - - data[index + 8] = pass.shaderObject.alphaThreshold; - } - }; - return DistanceMapPass; - })(materials.MaterialPassBase); - materials.DistanceMapPass = DistanceMapPass; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * - */ - (function (materials) { - var MaterialPassMode = (function () { - function MaterialPassMode() { - } - MaterialPassMode.EFFECTS = 0x01; - - MaterialPassMode.LIGHTING = 0x02; - - MaterialPassMode.SUPER_SHADER = 0x03; - return MaterialPassMode; - })(); - materials.MaterialPassMode = MaterialPassMode; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var ShadingMethodEvent = away.events.ShadingMethodEvent; - - /** - * CompiledPass forms an abstract base class for the default compiled pass materials provided by Away3D, - * using material methods to define their appearance. - */ - var TriangleMethodPass = (function (_super) { - __extends(TriangleMethodPass, _super); - /** - * Creates a new CompiledPass object. - * - * @param material The material to which this pass belongs. - */ - function TriangleMethodPass(passMode) { - if (typeof passMode === "undefined") { passMode = 0x03; } - var _this = this; - _super.call(this, passMode); - this._iMethodVOs = new Array(); - this._numEffectDependencies = 0; - - this._onShaderInvalidatedDelegate = function (event) { - return _this.onShaderInvalidated(event); - }; - } - /** - * Factory method to create a concrete shader object for this pass. - * - * @param profile The compatibility profile used by the renderer. - */ - TriangleMethodPass.prototype.createShaderObject = function (profile) { - if (this._pLightPicker && (this.passMode & materials.MaterialPassMode.LIGHTING)) - return new materials.ShaderLightingObject(profile); - - return new materials.ShaderObjectBase(profile); - }; - - /** - * Initializes the unchanging constant data for this material. - */ - TriangleMethodPass.prototype._iInitConstantData = function (shaderObject) { - _super.prototype._iInitConstantData.call(this, shaderObject); - - //Updates method constants if they have changed. - var len = this._iMethodVOs.length; - for (var i = 0; i < len; ++i) - this._iMethodVOs[i].method.iInitConstants(shaderObject, this._iMethodVOs[i]); - }; - - Object.defineProperty(TriangleMethodPass.prototype, "colorTransform", { - /** - * The ColorTransform object to transform the colour of the material with. Defaults to null. - */ - get: function () { - return this.colorTransformMethod ? this.colorTransformMethod.colorTransform : null; - }, - set: function (value) { - if (value) { - if (this.colorTransformMethod == null) - this.colorTransformMethod = new materials.EffectColorTransformMethod(); - - this.colorTransformMethod.colorTransform = value; - } else if (!value) { - if (this.colorTransformMethod) - this.colorTransformMethod = null; - } - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleMethodPass.prototype, "colorTransformMethod", { - /** - * The EffectColorTransformMethod object to transform the colour of the material with. Defaults to null. - */ - get: function () { - return this._iColorTransformMethodVO ? this._iColorTransformMethodVO.method : null; - }, - set: function (value) { - if (this._iColorTransformMethodVO && this._iColorTransformMethodVO.method == value) - return; - - if (this._iColorTransformMethodVO) { - this._removeDependency(this._iColorTransformMethodVO); - this._iColorTransformMethodVO = null; - } - - if (value) { - this._iColorTransformMethodVO = new materials.MethodVO(value); - this._addDependency(this._iColorTransformMethodVO); - } - }, - enumerable: true, - configurable: true - }); - - - TriangleMethodPass.prototype._removeDependency = function (methodVO, effectsDependency) { - if (typeof effectsDependency === "undefined") { effectsDependency = false; } - var index = this._iMethodVOs.indexOf(methodVO); - - if (!effectsDependency) - this._numEffectDependencies--; - - methodVO.method.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - this._iMethodVOs.splice(index, 1); - - this._pInvalidatePass(); - }; - - TriangleMethodPass.prototype._addDependency = function (methodVO, effectsDependency, index) { - if (typeof effectsDependency === "undefined") { effectsDependency = false; } - if (typeof index === "undefined") { index = -1; } - methodVO.method.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - - if (effectsDependency) { - if (index != -1) - this._iMethodVOs.splice(index + this._iMethodVOs.length - this._numEffectDependencies, 0, methodVO); - else - this._iMethodVOs.push(methodVO); - this._numEffectDependencies++; - } else { - this._iMethodVOs.splice(this._iMethodVOs.length - this._numEffectDependencies, 0, methodVO); - } - - this._pInvalidatePass(); - }; - - /** - * Appends an "effect" shading method to the shader. Effect methods are those that do not influence the lighting - * but modulate the shaded colour, used for fog, outlines, etc. The method will be applied to the result of the - * methods added prior. - */ - TriangleMethodPass.prototype.addEffectMethod = function (method) { - this._addDependency(new materials.MethodVO(method), true); - }; - - Object.defineProperty(TriangleMethodPass.prototype, "numEffectMethods", { - /** - * The number of "effect" methods added to the material. - */ - get: function () { - return this._numEffectDependencies; - }, - enumerable: true, - configurable: true - }); - - /** - * Queries whether a given effects method was added to the material. - * - * @param method The method to be queried. - * @return true if the method was added to the material, false otherwise. - */ - TriangleMethodPass.prototype.hasEffectMethod = function (method) { - return this.getDependencyForMethod(method) != null; - }; - - /** - * Returns the method added at the given index. - * @param index The index of the method to retrieve. - * @return The method at the given index. - */ - TriangleMethodPass.prototype.getEffectMethodAt = function (index) { - if (index < 0 || index > this._numEffectDependencies - 1) - return null; - - return this._iMethodVOs[index + this._iMethodVOs.length - this._numEffectDependencies].method; - }; - - /** - * Adds an effect method at the specified index amongst the methods already added to the material. Effect - * methods are those that do not influence the lighting but modulate the shaded colour, used for fog, outlines, - * etc. The method will be applied to the result of the methods with a lower index. - */ - TriangleMethodPass.prototype.addEffectMethodAt = function (method, index) { - this._addDependency(new materials.MethodVO(method), true, index); - }; - - /** - * Removes an effect method from the material. - * @param method The method to be removed. - */ - TriangleMethodPass.prototype.removeEffectMethod = function (method) { - var methodVO = this.getDependencyForMethod(method); - - if (methodVO != null) - this._removeDependency(methodVO, true); - }; - - TriangleMethodPass.prototype.getDependencyForMethod = function (method) { - var len = this._iMethodVOs.length; - for (var i = 0; i < len; ++i) - if (this._iMethodVOs[i].method == method) - return this._iMethodVOs[i]; - - return null; - }; - - Object.defineProperty(TriangleMethodPass.prototype, "normalMethod", { - /** - * The method used to generate the per-pixel normals. Defaults to NormalBasicMethod. - */ - get: function () { - return this._iNormalMethodVO ? this._iNormalMethodVO.method : null; - }, - set: function (value) { - if (this._iNormalMethodVO && this._iNormalMethodVO.method == value) - return; - - if (this._iNormalMethodVO) { - this._removeDependency(this._iNormalMethodVO); - this._iNormalMethodVO = null; - } - - if (value) { - this._iNormalMethodVO = new materials.MethodVO(value); - this._addDependency(this._iNormalMethodVO); - } - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleMethodPass.prototype, "ambientMethod", { - /** - * The method that provides the ambient lighting contribution. Defaults to AmbientBasicMethod. - */ - get: function () { - return this._iAmbientMethodVO ? this._iAmbientMethodVO.method : null; - }, - set: function (value) { - if (this._iAmbientMethodVO && this._iAmbientMethodVO.method == value) - return; - - if (this._iAmbientMethodVO) { - this._removeDependency(this._iAmbientMethodVO); - this._iAmbientMethodVO = null; - } - - if (value) { - this._iAmbientMethodVO = new materials.MethodVO(value); - this._addDependency(this._iAmbientMethodVO); - } - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleMethodPass.prototype, "shadowMethod", { - /** - * The method used to render shadows cast on this surface, or null if no shadows are to be rendered. Defaults to null. - */ - get: function () { - return this._iShadowMethodVO ? this._iShadowMethodVO.method : null; - }, - set: function (value) { - if (this._iShadowMethodVO && this._iShadowMethodVO.method == value) - return; - - if (this._iShadowMethodVO) { - this._removeDependency(this._iShadowMethodVO); - this._iShadowMethodVO = null; - } - - if (value) { - this._iShadowMethodVO = new materials.MethodVO(value); - this._addDependency(this._iShadowMethodVO); - } - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleMethodPass.prototype, "diffuseMethod", { - /** - * The method that provides the diffuse lighting contribution. Defaults to DiffuseBasicMethod. - */ - get: function () { - return this._iDiffuseMethodVO ? this._iDiffuseMethodVO.method : null; - }, - set: function (value) { - if (this._iDiffuseMethodVO && this._iDiffuseMethodVO.method == value) - return; - - if (this._iDiffuseMethodVO) { - this._removeDependency(this._iDiffuseMethodVO); - this._iDiffuseMethodVO = null; - } - - if (value) { - this._iDiffuseMethodVO = new materials.MethodVO(value); - this._addDependency(this._iDiffuseMethodVO); - } - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleMethodPass.prototype, "specularMethod", { - /** - * The method that provides the specular lighting contribution. Defaults to SpecularBasicMethod. - */ - get: function () { - return this._iSpecularMethodVO ? this._iSpecularMethodVO.method : null; - }, - set: function (value) { - if (this._iSpecularMethodVO && this._iSpecularMethodVO.method == value) - return; - - if (this._iSpecularMethodVO) { - this._removeDependency(this._iSpecularMethodVO); - this._iSpecularMethodVO = null; - } - - if (value) { - this._iSpecularMethodVO = new materials.MethodVO(value); - this._addDependency(this._iSpecularMethodVO); - } - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - TriangleMethodPass.prototype.dispose = function () { - _super.prototype.dispose.call(this); - - while (this._iMethodVOs.length) - this._removeDependency(this._iMethodVOs[0]); - - this._iMethodVOs = null; - }; - - /** - * Called when any method's shader code is invalidated. - */ - TriangleMethodPass.prototype.onShaderInvalidated = function (event) { - this._pInvalidatePass(); - }; - - // RENDER LOOP - /** - * @inheritDoc - */ - TriangleMethodPass.prototype._iActivate = function (pass, stage, camera) { - _super.prototype._iActivate.call(this, pass, stage, camera); - - var methodVO; - var len = this._iMethodVOs.length; - for (var i = 0; i < len; ++i) { - methodVO = this._iMethodVOs[i]; - if (methodVO.useMethod) - methodVO.method.iActivate(pass.shaderObject, methodVO, stage); - } - }; - - /** - * - * - * @param renderable - * @param stage - * @param camera - */ - TriangleMethodPass.prototype.setRenderState = function (pass, renderable, stage, camera, viewProjection) { - _super.prototype.setRenderState.call(this, pass, renderable, stage, camera, viewProjection); - - var methodVO; - var len = this._iMethodVOs.length; - for (var i = 0; i < len; ++i) { - methodVO = this._iMethodVOs[i]; - if (methodVO.useMethod) - methodVO.method.iSetRenderState(pass.shaderObject, methodVO, renderable, stage, camera); - } - }; - - /** - * @inheritDoc - */ - TriangleMethodPass.prototype._iDeactivate = function (pass, stage) { - _super.prototype._iDeactivate.call(this, pass, stage); - - var methodVO; - var len = this._iMethodVOs.length; - for (var i = 0; i < len; ++i) { - methodVO = this._iMethodVOs[i]; - if (methodVO.useMethod) - methodVO.method.iDeactivate(pass.shaderObject, methodVO, stage); - } - }; - - TriangleMethodPass.prototype._iIncludeDependencies = function (shaderObject) { - var i; - var len = this._iMethodVOs.length; - for (i = 0; i < len; ++i) - this.setupAndCountDependencies(shaderObject, this._iMethodVOs[i]); - - for (i = 0; i < len; ++i) - this._iMethodVOs[i].useMethod = this._iMethodVOs[i].method.iIsUsed(shaderObject); - - _super.prototype._iIncludeDependencies.call(this, shaderObject); - }; - - /** - * Counts the dependencies for a given method. - * @param method The method to count the dependencies for. - * @param methodVO The method's data for this material. - */ - TriangleMethodPass.prototype.setupAndCountDependencies = function (shaderObject, methodVO) { - methodVO.reset(); - - methodVO.method.iInitVO(shaderObject, methodVO); - - if (methodVO.needsProjection) - shaderObject.projectionDependencies++; - - if (methodVO.needsGlobalVertexPos) { - shaderObject.globalPosDependencies++; - - if (methodVO.needsGlobalFragmentPos) - shaderObject.usesGlobalPosFragment = true; - } else if (methodVO.needsGlobalFragmentPos) { - shaderObject.globalPosDependencies++; - shaderObject.usesGlobalPosFragment = true; - } - - if (methodVO.needsNormals) - shaderObject.normalDependencies++; - - if (methodVO.needsTangents) - shaderObject.tangentDependencies++; - - if (methodVO.needsView) - shaderObject.viewDirDependencies++; - - if (methodVO.needsUV) - shaderObject.uvDependencies++; - - if (methodVO.needsSecondaryUV) - shaderObject.secondaryUVDependencies++; - }; - - TriangleMethodPass.prototype._iGetPreLightingVertexCode = function (shaderObject, registerCache, sharedRegisters) { - var code = ""; - - if (this._iAmbientMethodVO && this._iAmbientMethodVO.useMethod) - code += this._iAmbientMethodVO.method.iGetVertexCode(shaderObject, this._iAmbientMethodVO, registerCache, sharedRegisters); - - if (this._iDiffuseMethodVO && this._iDiffuseMethodVO.useMethod) - code += this._iDiffuseMethodVO.method.iGetVertexCode(shaderObject, this._iDiffuseMethodVO, registerCache, sharedRegisters); - - if (this._iSpecularMethodVO && this._iSpecularMethodVO.useMethod) - code += this._iSpecularMethodVO.method.iGetVertexCode(shaderObject, this._iSpecularMethodVO, registerCache, sharedRegisters); - - return code; - }; - - TriangleMethodPass.prototype._iGetPreLightingFragmentCode = function (shaderObject, registerCache, sharedRegisters) { - var code = ""; - - if (this._iAmbientMethodVO && this._iAmbientMethodVO.useMethod) { - code += this._iAmbientMethodVO.method.iGetFragmentCode(shaderObject, this._iAmbientMethodVO, sharedRegisters.shadedTarget, registerCache, sharedRegisters); - - if (this._iAmbientMethodVO.needsNormals) - registerCache.removeFragmentTempUsage(sharedRegisters.normalFragment); - - if (this._iAmbientMethodVO.needsView) - registerCache.removeFragmentTempUsage(sharedRegisters.viewDirFragment); - } - - if (this._iDiffuseMethodVO && this._iDiffuseMethodVO.useMethod) - code += this._iDiffuseMethodVO.method.iGetFragmentPreLightingCode(shaderObject, this._iDiffuseMethodVO, registerCache, sharedRegisters); - - if (this._iSpecularMethodVO && this._iSpecularMethodVO.useMethod) - code += this._iSpecularMethodVO.method.iGetFragmentPreLightingCode(shaderObject, this._iSpecularMethodVO, registerCache, sharedRegisters); - - return code; - }; - - TriangleMethodPass.prototype._iGetPerLightDiffuseFragmentCode = function (shaderObject, lightDirReg, diffuseColorReg, registerCache, sharedRegisters) { - return this._iDiffuseMethodVO.method.iGetFragmentCodePerLight(shaderObject, this._iDiffuseMethodVO, lightDirReg, diffuseColorReg, registerCache, sharedRegisters); - }; - - TriangleMethodPass.prototype._iGetPerLightSpecularFragmentCode = function (shaderObject, lightDirReg, specularColorReg, registerCache, sharedRegisters) { - return this._iSpecularMethodVO.method.iGetFragmentCodePerLight(shaderObject, this._iSpecularMethodVO, lightDirReg, specularColorReg, registerCache, sharedRegisters); - }; - - TriangleMethodPass.prototype._iGetPerProbeDiffuseFragmentCode = function (shaderObject, texReg, weightReg, registerCache, sharedRegisters) { - return this._iDiffuseMethodVO.method.iGetFragmentCodePerProbe(shaderObject, this._iDiffuseMethodVO, texReg, weightReg, registerCache, sharedRegisters); - }; - - TriangleMethodPass.prototype._iGetPerProbeSpecularFragmentCode = function (shaderObject, texReg, weightReg, registerCache, sharedRegisters) { - return this._iSpecularMethodVO.method.iGetFragmentCodePerProbe(shaderObject, this._iSpecularMethodVO, texReg, weightReg, registerCache, sharedRegisters); - }; - - TriangleMethodPass.prototype._iGetPostLightingVertexCode = function (shaderObject, registerCache, sharedRegisters) { - var code = ""; - - if (this._iShadowMethodVO) - code += this._iShadowMethodVO.method.iGetVertexCode(shaderObject, this._iShadowMethodVO, registerCache, sharedRegisters); - - return code; - }; - - TriangleMethodPass.prototype._iGetPostLightingFragmentCode = function (shaderObject, registerCache, sharedRegisters) { - var code = ""; - - if (shaderObject.useAlphaPremultiplied && this._pEnableBlending) { - code += "add " + sharedRegisters.shadedTarget + ".w, " + sharedRegisters.shadedTarget + ".w, " + sharedRegisters.commons + ".z\n" + "div " + sharedRegisters.shadedTarget + ".xyz, " + sharedRegisters.shadedTarget + ", " + sharedRegisters.shadedTarget + ".w\n" + "sub " + sharedRegisters.shadedTarget + ".w, " + sharedRegisters.shadedTarget + ".w, " + sharedRegisters.commons + ".z\n" + "sat " + sharedRegisters.shadedTarget + ".xyz, " + sharedRegisters.shadedTarget + "\n"; - } - - if (this._iShadowMethodVO) - code += this._iShadowMethodVO.method.iGetFragmentCode(shaderObject, this._iShadowMethodVO, sharedRegisters.shadowTarget, registerCache, sharedRegisters); - - if (this._iDiffuseMethodVO && this._iDiffuseMethodVO.useMethod) { - code += this._iDiffuseMethodVO.method.iGetFragmentPostLightingCode(shaderObject, this._iDiffuseMethodVO, sharedRegisters.shadedTarget, registerCache, sharedRegisters); - - // resolve other dependencies as well? - if (this._iDiffuseMethodVO.needsNormals) - registerCache.removeFragmentTempUsage(sharedRegisters.normalFragment); - - if (this._iDiffuseMethodVO.needsView) - registerCache.removeFragmentTempUsage(sharedRegisters.viewDirFragment); - } - - if (this._iSpecularMethodVO && this._iSpecularMethodVO.useMethod) { - code += this._iSpecularMethodVO.method.iGetFragmentPostLightingCode(shaderObject, this._iSpecularMethodVO, sharedRegisters.shadedTarget, registerCache, sharedRegisters); - if (this._iSpecularMethodVO.needsNormals) - registerCache.removeFragmentTempUsage(sharedRegisters.normalFragment); - if (this._iSpecularMethodVO.needsView) - registerCache.removeFragmentTempUsage(sharedRegisters.viewDirFragment); - } - - if (this._iShadowMethodVO) - registerCache.removeFragmentTempUsage(sharedRegisters.shadowTarget); - - return code; - }; - - /** - * Indicates whether or not normals are allowed in tangent space. This is only the case if no object-space - * dependencies exist. - */ - TriangleMethodPass.prototype._pUsesTangentSpace = function (shaderObject) { - if (shaderObject.usesProbes) - return false; - - var methodVO; - var len = this._iMethodVOs.length; - for (var i = 0; i < len; ++i) { - methodVO = this._iMethodVOs[i]; - if (methodVO.useMethod && !methodVO.method.iUsesTangentSpace()) - return false; - } - - return true; - }; - - /** - * Indicates whether or not normals are output in tangent space. - */ - TriangleMethodPass.prototype._pOutputsTangentNormals = function (shaderObject) { - return this._iNormalMethodVO.method.iOutputsTangentNormals(); - }; - - /** - * Indicates whether or not normals are output by the pass. - */ - TriangleMethodPass.prototype._pOutputsNormals = function (shaderObject) { - return this._iNormalMethodVO && this._iNormalMethodVO.useMethod; - }; - - TriangleMethodPass.prototype._iGetNormalVertexCode = function (shaderObject, registerCache, sharedRegisters) { - return this._iNormalMethodVO.method.iGetVertexCode(shaderObject, this._iNormalMethodVO, registerCache, sharedRegisters); - }; - - TriangleMethodPass.prototype._iGetNormalFragmentCode = function (shaderObject, registerCache, sharedRegisters) { - var code = this._iNormalMethodVO.method.iGetFragmentCode(shaderObject, this._iNormalMethodVO, sharedRegisters.normalFragment, registerCache, sharedRegisters); - - if (this._iNormalMethodVO.needsView) - registerCache.removeFragmentTempUsage(sharedRegisters.viewDirFragment); - - if (this._iNormalMethodVO.needsGlobalFragmentPos || this._iNormalMethodVO.needsGlobalVertexPos) - registerCache.removeVertexTempUsage(sharedRegisters.globalPositionVertex); - - return code; - }; - - /** - * @inheritDoc - */ - TriangleMethodPass.prototype._iGetVertexCode = function (shaderObject, regCache, sharedReg) { - var code = ""; - var methodVO; - var len = this._iMethodVOs.length; - for (var i = len - this._numEffectDependencies; i < len; i++) { - methodVO = this._iMethodVOs[i]; - if (methodVO.useMethod) { - code += methodVO.method.iGetVertexCode(shaderObject, methodVO, regCache, sharedReg); - - if (methodVO.needsGlobalVertexPos || methodVO.needsGlobalFragmentPos) - regCache.removeVertexTempUsage(sharedReg.globalPositionVertex); - } - } - - if (this._iColorTransformMethodVO && this._iColorTransformMethodVO.useMethod) - code += this._iColorTransformMethodVO.method.iGetVertexCode(shaderObject, this._iColorTransformMethodVO, regCache, sharedReg); - - return code; - }; - - /** - * @inheritDoc - */ - TriangleMethodPass.prototype._iGetFragmentCode = function (shaderObject, regCache, sharedReg) { - var code = ""; - var alphaReg; - - if (this.preserveAlpha && this._numEffectDependencies > 0) { - alphaReg = regCache.getFreeFragmentSingleTemp(); - regCache.addFragmentTempUsages(alphaReg, 1); - code += "mov " + alphaReg + ", " + sharedReg.shadedTarget + ".w\n"; - } - - var methodVO; - var len = this._iMethodVOs.length; - for (var i = len - this._numEffectDependencies; i < len; i++) { - methodVO = this._iMethodVOs[i]; - if (methodVO.useMethod) { - code += methodVO.method.iGetFragmentCode(shaderObject, methodVO, sharedReg.shadedTarget, regCache, sharedReg); - - if (methodVO.needsNormals) - regCache.removeFragmentTempUsage(sharedReg.normalFragment); - - if (methodVO.needsView) - regCache.removeFragmentTempUsage(sharedReg.viewDirFragment); - } - } - - if (this.preserveAlpha && this._numEffectDependencies > 0) { - code += "mov " + sharedReg.shadedTarget + ".w, " + alphaReg + "\n"; - regCache.removeFragmentTempUsage(alphaReg); - } - - if (this._iColorTransformMethodVO && this._iColorTransformMethodVO.useMethod) - code += this._iColorTransformMethodVO.method.iGetFragmentCode(shaderObject, this._iColorTransformMethodVO, sharedReg.shadedTarget, regCache, sharedReg); - - return code; - }; - - /** - * Indicates whether the shader uses any shadows. - */ - TriangleMethodPass.prototype._iUsesShadows = function () { - return Boolean(this._iShadowMethodVO || this.lightPicker.castingDirectionalLights.length > 0 || this.lightPicker.castingPointLights.length > 0); - }; - - /** - * Indicates whether the shader uses any specular component. - */ - TriangleMethodPass.prototype._iUsesSpecular = function () { - return Boolean(this._iSpecularMethodVO); - }; - return TriangleMethodPass; - })(materials.MaterialPassBase); - materials.TriangleMethodPass = TriangleMethodPass; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var StageGLMaterialBase = (function (_super) { - __extends(StageGLMaterialBase, _super); - function StageGLMaterialBase() { - _super.apply(this, arguments); - } - StageGLMaterialBase.prototype._iGetVertexCode = function (shaderObject, registerCache, sharedRegisters) { - return ""; - }; - - StageGLMaterialBase.prototype._iGetFragmentCode = function (shaderObject, registerCache, sharedRegisters) { - return ""; - }; - return StageGLMaterialBase; - })(materials.MaterialBase); - materials.StageGLMaterialBase = StageGLMaterialBase; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var LineSubGeometry = away.base.LineSubGeometry; - - var Matrix3D = away.geom.Matrix3D; - - var ContextGLProgramType = away.stagegl.ContextGLProgramType; - - /** - * LineMaterial is a material exclusively used to render wireframe objects - * - * @see away.entities.Lines - */ - var LineBasicMaterial = (function (_super) { - __extends(LineBasicMaterial, _super); - /** - * Creates a new LineMaterial object. - * - * @param thickness The thickness of the wireframe lines. - */ - function LineBasicMaterial(thickness) { - if (typeof thickness === "undefined") { thickness = 1.25; } - _super.call(this); - this._constants = new Array(0, 0, 0, 0); - - this._thickness = thickness; - - this.bothSides = true; - - this._pAddScreenPass(this._screenPass = new materials.LineBasicPass()); - - this._calcMatrix = new Matrix3D(); - - this._constants[1] = 1 / 255; - } - /** - * @inheritDoc - */ - LineBasicMaterial.prototype._iGetVertexCode = function (shaderObject, regCache, sharedReg) { - return "m44 vt0, va0, vc8 \n" + "m44 vt1, va1, vc8 \n" + "sub vt2, vt1, vt0 \n" + "slt vt5.x, vt0.z, vc7.z \n" + "sub vt5.y, vc5.x, vt5.x \n" + "add vt4.x, vt0.z, vc7.z \n" + "sub vt4.y, vt0.z, vt1.z \n" + "seq vt4.z, vt4.y vc6.x \n" + "add vt4.y, vt4.y, vt4.z \n" + "div vt4.z, vt4.x, vt4.y \n" + "mul vt4.xyz, vt4.zzz, vt2.xyz \n" + "add vt3.xyz, vt0.xyz, vt4.xyz \n" + "mov vt3.w, vc5.x \n" + "mul vt0, vt0, vt5.yyyy \n" + "mul vt3, vt3, vt5.xxxx \n" + "add vt0, vt0, vt3 \n" + "sub vt2, vt1, vt0 \n" + "nrm vt2.xyz, vt2.xyz \n" + "nrm vt5.xyz, vt0.xyz \n" + "mov vt5.w, vc5.x \n" + "crs vt3.xyz, vt2, vt5 \n" + "nrm vt3.xyz, vt3.xyz \n" + "mul vt3.xyz, vt3.xyz, va2.xxx \n" + "mov vt3.w, vc5.x \n" + "dp3 vt4.x, vt0, vc6 \n" + "mul vt4.x, vt4.x, vc7.x \n" + "mul vt3.xyz, vt3.xyz, vt4.xxx \n" + "add vt0.xyz, vt0.xyz, vt3.xyz \n" + "m44 op, vt0, vc0 \n" + "mov v0, va3 \n"; - }; - - /** - * @inheritDoc - */ - LineBasicMaterial.prototype._iActivatePass = function (pass, stage, camera) { - _super.prototype._iActivatePass.call(this, pass, stage, camera); - - var context = stage.context; - - this._constants[0] = this._thickness / ((stage.scissorRect) ? Math.min(stage.scissorRect.width, stage.scissorRect.height) : Math.min(stage.width, stage.height)); - - // value to convert distance from camera to model length per pixel width - this._constants[2] = camera.projection.near; - - context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX, 5, LineBasicMaterial.pONE_VECTOR, 1); - context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX, 6, LineBasicMaterial.pFRONT_VECTOR, 1); - context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX, 7, this._constants, 1); - - // projection matrix - context.setProgramConstantsFromMatrix(ContextGLProgramType.VERTEX, 0, camera.projection.matrix, true); - }; - - /** - * @inheritDoc - */ - LineBasicMaterial.prototype._iRenderPass = function (pass, renderable, stage, camera, viewProjection) { - _super.prototype._iRenderPass.call(this, pass, renderable, stage, camera, viewProjection); - - var context = stage.context; - this._calcMatrix.copyFrom(renderable.sourceEntity.sceneTransform); - this._calcMatrix.append(camera.inverseSceneTransform); - - context.setProgramConstantsFromMatrix(ContextGLProgramType.VERTEX, 8, this._calcMatrix, true); - - context.activateBuffer(0, renderable.getVertexData(LineSubGeometry.START_POSITION_DATA), renderable.getVertexOffset(LineSubGeometry.START_POSITION_DATA), LineSubGeometry.POSITION_FORMAT); - context.activateBuffer(1, renderable.getVertexData(LineSubGeometry.END_POSITION_DATA), renderable.getVertexOffset(LineSubGeometry.END_POSITION_DATA), LineSubGeometry.POSITION_FORMAT); - context.activateBuffer(2, renderable.getVertexData(LineSubGeometry.THICKNESS_DATA), renderable.getVertexOffset(LineSubGeometry.THICKNESS_DATA), LineSubGeometry.THICKNESS_FORMAT); - context.activateBuffer(3, renderable.getVertexData(LineSubGeometry.COLOR_DATA), renderable.getVertexOffset(LineSubGeometry.COLOR_DATA), LineSubGeometry.COLOR_FORMAT); - - context.drawTriangles(context.getIndexBuffer(renderable.getIndexData()), 0, renderable.numTriangles); - }; - LineBasicMaterial.pONE_VECTOR = Array(1, 1, 1, 1); - LineBasicMaterial.pFRONT_VECTOR = Array(0, 0, -1, 0); - return LineBasicMaterial; - })(materials.StageGLMaterialBase); - materials.LineBasicMaterial = LineBasicMaterial; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var TriangleSubGeometry = away.base.TriangleSubGeometry; - - var ContextGLCompareMode = away.stagegl.ContextGLCompareMode; - var ContextGLMipFilter = away.stagegl.ContextGLMipFilter; - var ContextGLProgramType = away.stagegl.ContextGLProgramType; - var ContextGLTextureFilter = away.stagegl.ContextGLTextureFilter; - - var ContextGLWrapMode = away.stagegl.ContextGLWrapMode; - - /** - * SkyboxMaterial is a material exclusively used to render skyboxes - * - * @see away3d.primitives.Skybox - */ - var SkyboxMaterial = (function (_super) { - __extends(SkyboxMaterial, _super); - /** - * Creates a new SkyboxMaterial object. - * @param cubeMap The CubeMap to use as the skybox. - */ - function SkyboxMaterial(cubeMap, smooth, repeat, mipmap) { - if (typeof smooth === "undefined") { smooth = true; } - if (typeof repeat === "undefined") { repeat = false; } - if (typeof mipmap === "undefined") { mipmap = false; } - _super.call(this); - - this._cubeMap = cubeMap; - this._pAddScreenPass(this._skyboxPass = new materials.SkyboxPass()); - - this._vertexData = new Array(0, 0, 0, 0, 1, 1, 1, 1); - } - Object.defineProperty(SkyboxMaterial.prototype, "cubeMap", { - /** - * The cube texture to use as the skybox. - */ - get: function () { - return this._cubeMap; - }, - set: function (value) { - if (value && this._cubeMap && (value.hasMipmaps != this._cubeMap.hasMipmaps || value.format != this._cubeMap.format)) - this._pInvalidatePasses(); - - this._cubeMap = value; - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - SkyboxMaterial.prototype._iGetVertexCode = function (shaderObject, registerCache, sharedRegisters) { - return "mul vt0, va0, vc5\n" + "add vt0, vt0, vc4\n" + "m44 op, vt0, vc0\n" + "mov v0, va0\n"; - }; - - /** - * @inheritDoc - */ - SkyboxMaterial.prototype._iGetFragmentCode = function (shaderObject, registerCache, sharedRegisters) { - //var cubeMapReg:ShaderRegisterElement = registerCache.getFreeTextureReg(); - //this._texturesIndex = cubeMapReg.index; - //ShaderCompilerHelper.getTexCubeSampleCode(sharedRegisters.shadedTarget, cubeMapReg, this._cubeTexture, shaderObject.useSmoothTextures, shaderObject.useMipmapping); - var mip = ",mipnone"; - - if (this._cubeMap.hasMipmaps) - mip = ",miplinear"; - - return "tex ft0, v0, fs0 \n"; - }; - - /** - * @inheritDoc - */ - SkyboxMaterial.prototype._iActivatePass = function (pass, stage, camera) { - _super.prototype._iActivatePass.call(this, pass, stage, camera); - - var context = stage.context; - context.setSamplerStateAt(0, ContextGLWrapMode.CLAMP, ContextGLTextureFilter.LINEAR, this._cubeMap.hasMipmaps ? ContextGLMipFilter.MIPLINEAR : ContextGLMipFilter.MIPNONE); - context.setDepthTest(false, ContextGLCompareMode.LESS); - context.activateCubeTexture(0, this._cubeMap); - }; - - /** - * @inheritDoc - */ - SkyboxMaterial.prototype._iRenderPass = function (pass, renderable, stage, camera, viewProjection) { - _super.prototype._iRenderPass.call(this, pass, renderable, stage, camera, viewProjection); - - var context = stage.context; - var pos = camera.scenePosition; - this._vertexData[0] = pos.x; - this._vertexData[1] = pos.y; - this._vertexData[2] = pos.z; - this._vertexData[4] = this._vertexData[5] = this._vertexData[6] = camera.projection.far / Math.sqrt(3); - context.setProgramConstantsFromMatrix(ContextGLProgramType.VERTEX, 0, viewProjection, true); - context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX, 4, this._vertexData, 2); - - context.activateBuffer(0, renderable.getVertexData(TriangleSubGeometry.POSITION_DATA), renderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA), TriangleSubGeometry.POSITION_FORMAT); - context.drawTriangles(context.getIndexBuffer(renderable.getIndexData()), 0, renderable.numTriangles); - }; - return SkyboxMaterial; - })(materials.StageGLMaterialBase); - materials.SkyboxMaterial = SkyboxMaterial; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var TriangleSubGeometry = away.base.TriangleSubGeometry; - - var Matrix3DUtils = away.geom.Matrix3DUtils; - - var ContextGLProgramType = away.stagegl.ContextGLProgramType; - - /** - * CompiledPass forms an abstract base class for the default compiled pass materials provided by Away3D, - * using material methods to define their appearance. - */ - var TriangleMaterialBase = (function (_super) { - __extends(TriangleMaterialBase, _super); - function TriangleMaterialBase() { - _super.apply(this, arguments); - } - TriangleMaterialBase.prototype._iGetVertexCode = function (shaderObject, registerCache, sharedRegisters) { - var code = ""; - - //get the projection coordinates - var position = (shaderObject.globalPosDependencies > 0) ? sharedRegisters.globalPositionVertex : sharedRegisters.localPosition; - - //reserving vertex constants for projection matrix - var viewMatrixReg = registerCache.getFreeVertexConstant(); - registerCache.getFreeVertexConstant(); - registerCache.getFreeVertexConstant(); - registerCache.getFreeVertexConstant(); - shaderObject.viewMatrixIndex = viewMatrixReg.index * 4; - - if (shaderObject.projectionDependencies > 0) { - sharedRegisters.projectionFragment = registerCache.getFreeVarying(); - var temp = registerCache.getFreeVertexVectorTemp(); - code += "m44 " + temp + ", " + position + ", " + viewMatrixReg + "\n" + "mov " + sharedRegisters.projectionFragment + ", " + temp + "\n" + "mov op, " + temp + "\n"; - } else { - code += "m44 op, " + position + ", " + viewMatrixReg + "\n"; - } - - return code; - }; - - /** - * @inheritDoc - */ - TriangleMaterialBase.prototype._iRenderPass = function (pass, renderable, stage, camera, viewProjection) { - _super.prototype._iRenderPass.call(this, pass, renderable, stage, camera, viewProjection); - - var shaderObject = pass.shaderObject; - - if (shaderObject.sceneMatrixIndex >= 0) { - renderable.sourceEntity.getRenderSceneTransform(camera).copyRawDataTo(shaderObject.vertexConstantData, shaderObject.sceneMatrixIndex, true); - viewProjection.copyRawDataTo(shaderObject.vertexConstantData, shaderObject.viewMatrixIndex, true); - } else { - var matrix3D = Matrix3DUtils.CALCULATION_MATRIX; - - matrix3D.copyFrom(renderable.sourceEntity.getRenderSceneTransform(camera)); - matrix3D.append(viewProjection); - - matrix3D.copyRawDataTo(shaderObject.vertexConstantData, shaderObject.viewMatrixIndex, true); - } - - var context = stage.context; - - context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX, 0, shaderObject.vertexConstantData, shaderObject.numUsedVertexConstants); - context.setProgramConstantsFromArray(ContextGLProgramType.FRAGMENT, 0, shaderObject.fragmentConstantData, shaderObject.numUsedFragmentConstants); - - context.activateBuffer(0, renderable.getVertexData(TriangleSubGeometry.POSITION_DATA), renderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA), TriangleSubGeometry.POSITION_FORMAT); - context.drawTriangles(context.getIndexBuffer(renderable.getIndexData()), 0, renderable.numTriangles); - }; - return TriangleMaterialBase; - })(materials.StageGLMaterialBase); - materials.TriangleMaterialBase = TriangleMaterialBase; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var ContextGLCompareMode = away.stagegl.ContextGLCompareMode; - - var Texture2DBase = away.textures.Texture2DBase; - - /** - * TriangleMaterial forms an abstract base class for the default shaded materials provided by Stage, - * using material methods to define their appearance. - */ - var TriangleBasicMaterial = (function (_super) { - __extends(TriangleBasicMaterial, _super); - function TriangleBasicMaterial(textureColor, smoothAlpha, repeat, mipmap) { - if (typeof textureColor === "undefined") { textureColor = null; } - if (typeof smoothAlpha === "undefined") { smoothAlpha = null; } - if (typeof repeat === "undefined") { repeat = false; } - if (typeof mipmap === "undefined") { mipmap = false; } - _super.call(this); - this._alphaBlending = false; - this._alpha = 1; - this._depthCompareMode = ContextGLCompareMode.LESS_EQUAL; - - this._screenPass = new materials.TriangleBasicPass(); - - if (textureColor instanceof Texture2DBase) { - this.texture = textureColor; - - this.smooth = (smoothAlpha == null) ? true : false; - this.repeat = repeat; - this.mipmap = mipmap; - } else { - this.color = textureColor ? Number(textureColor) : 0xCCCCCC; - this.alpha = (smoothAlpha == null) ? 1 : Number(smoothAlpha); - } - } - Object.defineProperty(TriangleBasicMaterial.prototype, "depthCompareMode", { - /** - * The depth compare mode used to render the renderables using this material. - * - * @see away.stagegl.ContextGLCompareMode - */ - get: function () { - return this._depthCompareMode; - }, - set: function (value) { - if (this._depthCompareMode == value) - return; - - this._depthCompareMode = value; - - this._pInvalidatePasses(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleBasicMaterial.prototype, "alpha", { - /** - * The alpha of the surface. - */ - get: function () { - return this._alpha; - }, - set: function (value) { - if (value > 1) - value = 1; - else if (value < 0) - value = 0; - - if (this._alpha == value) - return; - - this._alpha = value; - - this._pInvalidatePasses(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleBasicMaterial.prototype, "alphaBlending", { - /** - * Indicates whether or not the material has transparency. If binary transparency is sufficient, for - * example when using textures of foliage, consider using alphaThreshold instead. - */ - get: function () { - return this._alphaBlending; - }, - set: function (value) { - if (this._alphaBlending == value) - return; - - this._alphaBlending = value; - - this._pInvalidatePasses(); - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - TriangleBasicMaterial.prototype.iUpdateMaterial = function () { - var passesInvalid; - - if (this._pScreenPassesInvalid) { - this.pUpdateScreenPasses(); - passesInvalid = true; - } - - if (passesInvalid) { - this._pClearScreenPasses(); - - this._pAddScreenPass(this._screenPass); - } - }; - - /** - * Updates screen passes when they were found to be invalid. - */ - TriangleBasicMaterial.prototype.pUpdateScreenPasses = function () { - this.initPasses(); - - this.setBlendAndCompareModes(); - - this._pScreenPassesInvalid = false; - }; - - /** - * Initializes all the passes and their dependent passes. - */ - TriangleBasicMaterial.prototype.initPasses = function () { - // - }; - - /** - * Sets up the various blending modes for all screen passes, based on whether or not there are previous passes. - */ - TriangleBasicMaterial.prototype.setBlendAndCompareModes = function () { - this._pRequiresBlending = (this._pBlendMode != away.base.BlendMode.NORMAL || this._alphaBlending || this._alpha < 1); - this._screenPass.depthCompareMode = this._depthCompareMode; - this._screenPass.preserveAlpha = this._pRequiresBlending; - this._screenPass.setBlendMode((this._pBlendMode == away.base.BlendMode.NORMAL && this._pRequiresBlending) ? away.base.BlendMode.LAYER : this._pBlendMode); - this._screenPass.forceSeparateMVP = false; - }; - return TriangleBasicMaterial; - })(materials.TriangleMaterialBase); - materials.TriangleBasicMaterial = TriangleBasicMaterial; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * - */ - (function (materials) { - var TriangleMaterialMode = (function () { - function TriangleMaterialMode() { - } - TriangleMaterialMode.SINGLE_PASS = "singlePass"; - - TriangleMaterialMode.MULTI_PASS = "multiPass"; - return TriangleMaterialMode; - })(); - materials.TriangleMaterialMode = TriangleMaterialMode; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var BlendMode = away.base.BlendMode; - - var ColorTransform = away.geom.ColorTransform; - - var ContextGLCompareMode = away.stagegl.ContextGLCompareMode; - - var Texture2DBase = away.textures.Texture2DBase; - - /** - * TriangleMethodMaterial forms an abstract base class for the default shaded materials provided by Stage, - * using material methods to define their appearance. - */ - var TriangleMethodMaterial = (function (_super) { - __extends(TriangleMethodMaterial, _super); - function TriangleMethodMaterial(textureColor, smoothAlpha, repeat, mipmap) { - if (typeof textureColor === "undefined") { textureColor = null; } - if (typeof smoothAlpha === "undefined") { smoothAlpha = null; } - if (typeof repeat === "undefined") { repeat = false; } - if (typeof mipmap === "undefined") { mipmap = false; } - _super.call(this); - this._alphaBlending = false; - this._alpha = 1; - this._ambientMethod = new materials.AmbientBasicMethod(); - this._diffuseMethod = new materials.DiffuseBasicMethod(); - this._normalMethod = new materials.NormalBasicMethod(); - this._specularMethod = new materials.SpecularBasicMethod(); - this._depthCompareMode = ContextGLCompareMode.LESS_EQUAL; - - this._materialMode = materials.TriangleMaterialMode.SINGLE_PASS; - - if (textureColor instanceof Texture2DBase) { - this.texture = textureColor; - - this.smooth = (smoothAlpha == null) ? true : false; - this.repeat = repeat; - this.mipmap = mipmap; - } else { - this.color = (textureColor == null) ? 0xFFFFFF : Number(textureColor); - this.alpha = (smoothAlpha == null) ? 1 : Number(smoothAlpha); - } - } - Object.defineProperty(TriangleMethodMaterial.prototype, "materialMode", { - get: function () { - return this._materialMode; - }, - set: function (value) { - if (this._materialMode == value) - return; - - this._materialMode = value; - - this._pInvalidateScreenPasses(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleMethodMaterial.prototype, "depthCompareMode", { - /** - * The depth compare mode used to render the renderables using this material. - * - * @see away.stagegl.ContextGLCompareMode - */ - get: function () { - return this._depthCompareMode; - }, - set: function (value) { - if (this._depthCompareMode == value) - return; - - this._depthCompareMode = value; - - this._pInvalidateScreenPasses(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleMethodMaterial.prototype, "alpha", { - /** - * The alpha of the surface. - */ - get: function () { - return this._alpha; - }, - set: function (value) { - if (value > 1) - value = 1; - else if (value < 0) - value = 0; - - if (this._alpha == value) - return; - - this._alpha = value; - - if (this._colorTransform == null) - this._colorTransform = new ColorTransform(); - - this._colorTransform.alphaMultiplier = value; - - this._pInvalidatePasses(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleMethodMaterial.prototype, "colorTransform", { - /** - * The ColorTransform object to transform the colour of the material with. Defaults to null. - */ - get: function () { - return this._screenPass.colorTransform; - }, - set: function (value) { - this._screenPass.colorTransform = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleMethodMaterial.prototype, "diffuseTexture", { - /** - * The texture object to use for the ambient colour. - */ - get: function () { - return this._diffuseMethod.texture; - }, - set: function (value) { - this._diffuseMethod.texture = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleMethodMaterial.prototype, "ambientMethod", { - /** - * The method that provides the ambient lighting contribution. Defaults to AmbientBasicMethod. - */ - get: function () { - return this._ambientMethod; - }, - set: function (value) { - if (this._ambientMethod == value) - return; - - if (value && this._ambientMethod) - value.copyFrom(this._ambientMethod); - - this._ambientMethod = value; - - this._pInvalidateScreenPasses(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleMethodMaterial.prototype, "shadowMethod", { - /** - * The method used to render shadows cast on this surface, or null if no shadows are to be rendered. Defaults to null. - */ - get: function () { - return this._shadowMethod; - }, - set: function (value) { - if (this._shadowMethod == value) - return; - - if (value && this._shadowMethod) - value.copyFrom(this._shadowMethod); - - this._shadowMethod = value; - - this._pInvalidateScreenPasses(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleMethodMaterial.prototype, "diffuseMethod", { - /** - * The method that provides the diffuse lighting contribution. Defaults to DiffuseBasicMethod. - */ - get: function () { - return this._diffuseMethod; - }, - set: function (value) { - if (this._diffuseMethod == value) - return; - - if (value && this._diffuseMethod) - value.copyFrom(this._diffuseMethod); - - this._diffuseMethod = value; - - this._pInvalidateScreenPasses(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleMethodMaterial.prototype, "specularMethod", { - /** - * The method that provides the specular lighting contribution. Defaults to SpecularBasicMethod. - */ - get: function () { - return this._specularMethod; - }, - set: function (value) { - if (this._specularMethod == value) - return; - - if (value && this._specularMethod) - value.copyFrom(this._specularMethod); - - this._specularMethod = value; - - this._pInvalidateScreenPasses(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleMethodMaterial.prototype, "normalMethod", { - /** - * The method used to generate the per-pixel normals. Defaults to NormalBasicMethod. - */ - get: function () { - return this._normalMethod; - }, - set: function (value) { - if (this._normalMethod == value) - return; - - if (value && this._normalMethod) - value.copyFrom(this._normalMethod); - - this._normalMethod = value; - - this._pInvalidateScreenPasses(); - }, - enumerable: true, - configurable: true - }); - - - /** - * Appends an "effect" shading method to the shader. Effect methods are those that do not influence the lighting - * but modulate the shaded colour, used for fog, outlines, etc. The method will be applied to the result of the - * methods added prior. - */ - TriangleMethodMaterial.prototype.addEffectMethod = function (method) { - if (this._screenPass == null) - this._screenPass = new materials.TriangleMethodPass(); - - this._screenPass.addEffectMethod(method); - - this._pInvalidateScreenPasses(); - }; - - Object.defineProperty(TriangleMethodMaterial.prototype, "numEffectMethods", { - /** - * The number of "effect" methods added to the material. - */ - get: function () { - return this._screenPass ? this._screenPass.numEffectMethods : 0; - }, - enumerable: true, - configurable: true - }); - - /** - * Queries whether a given effect method was added to the material. - * - * @param method The method to be queried. - * @return true if the method was added to the material, false otherwise. - */ - TriangleMethodMaterial.prototype.hasEffectMethod = function (method) { - return this._screenPass ? this._screenPass.hasEffectMethod(method) : false; - }; - - /** - * Returns the method added at the given index. - * @param index The index of the method to retrieve. - * @return The method at the given index. - */ - TriangleMethodMaterial.prototype.getEffectMethodAt = function (index) { - if (this._screenPass == null) - return null; - - return this._screenPass.getEffectMethodAt(index); - }; - - /** - * Adds an effect method at the specified index amongst the methods already added to the material. Effect - * methods are those that do not influence the lighting but modulate the shaded colour, used for fog, outlines, - * etc. The method will be applied to the result of the methods with a lower index. - */ - TriangleMethodMaterial.prototype.addEffectMethodAt = function (method, index) { - if (this._screenPass == null) - this._screenPass = new materials.TriangleMethodPass(); - - this._screenPass.addEffectMethodAt(method, index); - - this._pInvalidatePasses(); - }; - - /** - * Removes an effect method from the material. - * @param method The method to be removed. - */ - TriangleMethodMaterial.prototype.removeEffectMethod = function (method) { - if (this._screenPass == null) - return; - - this._screenPass.removeEffectMethod(method); - - // reconsider - if (this._screenPass.numEffectMethods == 0) - this._pInvalidatePasses(); - }; - - Object.defineProperty(TriangleMethodMaterial.prototype, "normalMap", { - /** - * The normal map to modulate the direction of the surface for each texel. The default normal method expects - * tangent-space normal maps, but others could expect object-space maps. - */ - get: function () { - return this._normalMethod.normalMap; - }, - set: function (value) { - this._normalMethod.normalMap = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleMethodMaterial.prototype, "specularMap", { - /** - * A specular map that defines the strength of specular reflections for each texel in the red channel, - * and the gloss factor in the green channel. You can use SpecularBitmapTexture if you want to easily set - * specular and gloss maps from grayscale images, but correctly authored images are preferred. - */ - get: function () { - return this._specularMethod.texture; - }, - set: function (value) { - this._specularMethod.texture = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleMethodMaterial.prototype, "gloss", { - /** - * The glossiness of the material (sharpness of the specular highlight). - */ - get: function () { - return this._specularMethod.gloss; - }, - set: function (value) { - this._specularMethod.gloss = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleMethodMaterial.prototype, "ambient", { - /** - * The strength of the ambient reflection. - */ - get: function () { - return this._ambientMethod.ambient; - }, - set: function (value) { - this._ambientMethod.ambient = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleMethodMaterial.prototype, "specular", { - /** - * The overall strength of the specular reflection. - */ - get: function () { - return this._specularMethod.specular; - }, - set: function (value) { - this._specularMethod.specular = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleMethodMaterial.prototype, "ambientColor", { - /** - * The colour of the ambient reflection. - */ - get: function () { - return this._diffuseMethod.ambientColor; - }, - set: function (value) { - this._diffuseMethod.ambientColor = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleMethodMaterial.prototype, "diffuseColor", { - /** - * The colour of the diffuse reflection. - */ - get: function () { - return this._diffuseMethod.diffuseColor; - }, - set: function (value) { - this._diffuseMethod.diffuseColor = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleMethodMaterial.prototype, "specularColor", { - /** - * The colour of the specular reflection. - */ - get: function () { - return this._specularMethod.specularColor; - }, - set: function (value) { - this._specularMethod.specularColor = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(TriangleMethodMaterial.prototype, "alphaBlending", { - /** - * Indicates whether or not the material has transparency. If binary transparency is sufficient, for - * example when using textures of foliage, consider using alphaThreshold instead. - */ - get: function () { - return this._alphaBlending; - }, - set: function (value) { - if (this._alphaBlending == value) - return; - - this._alphaBlending = value; - - this._pInvalidatePasses(); - }, - enumerable: true, - configurable: true - }); - - - /** - * @inheritDoc - */ - TriangleMethodMaterial.prototype._iUpdateMaterial = function () { - if (this._pScreenPassesInvalid) { - //Updates screen passes when they were found to be invalid. - this._pScreenPassesInvalid = false; - - this.initPasses(); - - this.setBlendAndCompareModes(); - - this._pClearScreenPasses(); - - if (this._materialMode == materials.TriangleMaterialMode.MULTI_PASS) { - if (this._casterLightPass) - this._pAddScreenPass(this._casterLightPass); - - if (this._nonCasterLightPasses) - for (var i = 0; i < this._nonCasterLightPasses.length; ++i) - this._pAddScreenPass(this._nonCasterLightPasses[i]); - } - - if (this._screenPass) - this._pAddScreenPass(this._screenPass); - } - }; - - /** - * Initializes all the passes and their dependent passes. - */ - TriangleMethodMaterial.prototype.initPasses = function () { - // let the effects pass handle everything if there are no lights, when there are effect methods applied - // after shading, or when the material mode is single pass. - if (this.numLights == 0 || this.numEffectMethods > 0 || this._materialMode == materials.TriangleMaterialMode.SINGLE_PASS) - this.initEffectPass(); - else if (this._screenPass) - this.removeEffectPass(); - - // only use a caster light pass if shadows need to be rendered - if (this._shadowMethod && this._materialMode == materials.TriangleMaterialMode.MULTI_PASS) - this.initCasterLightPass(); - else if (this._casterLightPass) - this.removeCasterLightPass(); - - // only use non caster light passes if there are lights that don't cast - if (this.numNonCasters > 0 && this._materialMode == materials.TriangleMaterialMode.MULTI_PASS) - this.initNonCasterLightPasses(); - else if (this._nonCasterLightPasses) - this.removeNonCasterLightPasses(); - }; - - /** - * Sets up the various blending modes for all screen passes, based on whether or not there are previous passes. - */ - TriangleMethodMaterial.prototype.setBlendAndCompareModes = function () { - var forceSeparateMVP = Boolean(this._casterLightPass || this._screenPass); - - // caster light pass is always first if it exists, hence it uses normal blending - if (this._casterLightPass) { - this._casterLightPass.forceSeparateMVP = forceSeparateMVP; - this._casterLightPass.setBlendMode(BlendMode.NORMAL); - this._casterLightPass.depthCompareMode = this._depthCompareMode; - } - - if (this._nonCasterLightPasses) { - var firstAdditiveIndex = 0; - - // if there's no caster light pass, the first non caster light pass will be the first - // and should use normal blending - if (!this._casterLightPass) { - this._nonCasterLightPasses[0].forceSeparateMVP = forceSeparateMVP; - this._nonCasterLightPasses[0].setBlendMode(BlendMode.NORMAL); - this._nonCasterLightPasses[0].depthCompareMode = this._depthCompareMode; - firstAdditiveIndex = 1; - } - - for (var i = firstAdditiveIndex; i < this._nonCasterLightPasses.length; ++i) { - this._nonCasterLightPasses[i].forceSeparateMVP = forceSeparateMVP; - this._nonCasterLightPasses[i].setBlendMode(BlendMode.ADD); - this._nonCasterLightPasses[i].depthCompareMode = ContextGLCompareMode.LESS_EQUAL; - } - } - - if (this._casterLightPass || this._nonCasterLightPasses) { - //cannot be blended by blendmode property if multipass enabled - this._pRequiresBlending = false; - - // there are light passes, so this should be blended in - if (this._screenPass) { - this._screenPass.passMode = materials.MaterialPassMode.EFFECTS; - this._screenPass.depthCompareMode = ContextGLCompareMode.LESS_EQUAL; - this._screenPass.setBlendMode(BlendMode.LAYER); - this._screenPass.forceSeparateMVP = forceSeparateMVP; - } - } else if (this._screenPass) { - this._pRequiresBlending = (this._pBlendMode != BlendMode.NORMAL || this._alphaBlending || (this._colorTransform && this._colorTransform.alphaMultiplier < 1)); - - // effects pass is the only pass, so it should just blend normally - this._screenPass.passMode = materials.MaterialPassMode.SUPER_SHADER; - this._screenPass.depthCompareMode = this._depthCompareMode; - this._screenPass.preserveAlpha = this._pRequiresBlending; - this._screenPass.colorTransform = this._colorTransform; - this._screenPass.setBlendMode((this._pBlendMode == BlendMode.NORMAL && this._pRequiresBlending) ? BlendMode.LAYER : this._pBlendMode); - this._screenPass.forceSeparateMVP = false; - } - }; - - TriangleMethodMaterial.prototype.initCasterLightPass = function () { - if (this._casterLightPass == null) - this._casterLightPass = new materials.TriangleMethodPass(materials.MaterialPassMode.LIGHTING); - - this._casterLightPass.lightPicker = new materials.StaticLightPicker([this._shadowMethod.castingLight]); - this._casterLightPass.shadowMethod = this._shadowMethod; - this._casterLightPass.diffuseMethod = this._diffuseMethod; - this._casterLightPass.ambientMethod = this._ambientMethod; - this._casterLightPass.normalMethod = this._normalMethod; - this._casterLightPass.specularMethod = this._specularMethod; - }; - - TriangleMethodMaterial.prototype.removeCasterLightPass = function () { - this._casterLightPass.dispose(); - this._pRemoveScreenPass(this._casterLightPass); - this._casterLightPass = null; - }; - - TriangleMethodMaterial.prototype.initNonCasterLightPasses = function () { - this.removeNonCasterLightPasses(); - var pass; - var numDirLights = this._pLightPicker.numDirectionalLights; - var numPointLights = this._pLightPicker.numPointLights; - var numLightProbes = this._pLightPicker.numLightProbes; - var dirLightOffset = 0; - var pointLightOffset = 0; - var probeOffset = 0; - - if (!this._casterLightPass) { - numDirLights += this._pLightPicker.numCastingDirectionalLights; - numPointLights += this._pLightPicker.numCastingPointLights; - } - - this._nonCasterLightPasses = new Array(); - - while (dirLightOffset < numDirLights || pointLightOffset < numPointLights || probeOffset < numLightProbes) { - pass = new materials.TriangleMethodPass(materials.MaterialPassMode.LIGHTING); - pass.includeCasters = this._shadowMethod == null; - pass.directionalLightsOffset = dirLightOffset; - pass.pointLightsOffset = pointLightOffset; - pass.lightProbesOffset = probeOffset; - pass.lightPicker = this._pLightPicker; - pass.diffuseMethod = this._diffuseMethod; - pass.ambientMethod = this._ambientMethod; - pass.normalMethod = this._normalMethod; - pass.specularMethod = this._specularMethod; - this._nonCasterLightPasses.push(pass); - - dirLightOffset += pass.iNumDirectionalLights; - pointLightOffset += pass.iNumPointLights; - probeOffset += pass.iNumLightProbes; - } - }; - - TriangleMethodMaterial.prototype.removeNonCasterLightPasses = function () { - if (!this._nonCasterLightPasses) - return; - - for (var i = 0; i < this._nonCasterLightPasses.length; ++i) - this._pRemoveScreenPass(this._nonCasterLightPasses[i]); - - this._nonCasterLightPasses = null; - }; - - TriangleMethodMaterial.prototype.removeEffectPass = function () { - if (this._screenPass.ambientMethod != this._ambientMethod) - this._screenPass.ambientMethod.dispose(); - - if (this._screenPass.diffuseMethod != this._diffuseMethod) - this._screenPass.diffuseMethod.dispose(); - - if (this._screenPass.specularMethod != this._specularMethod) - this._screenPass.specularMethod.dispose(); - - if (this._screenPass.normalMethod != this._normalMethod) - this._screenPass.normalMethod.dispose(); - - this._pRemoveScreenPass(this._screenPass); - this._screenPass = null; - }; - - TriangleMethodMaterial.prototype.initEffectPass = function () { - if (this._screenPass == null) - this._screenPass = new materials.TriangleMethodPass(); - - if (this._materialMode == materials.TriangleMaterialMode.SINGLE_PASS) { - this._screenPass.ambientMethod = this._ambientMethod; - this._screenPass.diffuseMethod = this._diffuseMethod; - this._screenPass.specularMethod = this._specularMethod; - this._screenPass.normalMethod = this._normalMethod; - this._screenPass.shadowMethod = this._shadowMethod; - } else if (this._materialMode == materials.TriangleMaterialMode.MULTI_PASS) { - if (this.numLights == 0) { - this._screenPass.ambientMethod = this._ambientMethod; - } else { - this._screenPass.ambientMethod = null; - } - - this._screenPass.preserveAlpha = false; - this._screenPass.normalMethod = this._normalMethod; - } - }; - - Object.defineProperty(TriangleMethodMaterial.prototype, "numLights", { - /** - * The maximum total number of lights provided by the light picker. - */ - get: function () { - return this._pLightPicker ? this._pLightPicker.numLightProbes + this._pLightPicker.numDirectionalLights + this._pLightPicker.numPointLights + this._pLightPicker.numCastingDirectionalLights + this._pLightPicker.numCastingPointLights : 0; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(TriangleMethodMaterial.prototype, "numNonCasters", { - /** - * The amount of lights that don't cast shadows. - */ - get: function () { - return this._pLightPicker ? this._pLightPicker.numLightProbes + this._pLightPicker.numDirectionalLights + this._pLightPicker.numPointLights : 0; - }, - enumerable: true, - configurable: true - }); - return TriangleMethodMaterial; - })(materials.TriangleMaterialBase); - materials.TriangleMethodMaterial = TriangleMethodMaterial; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var DefaultMaterialManager = (function () { - function DefaultMaterialManager() { - } - DefaultMaterialManager.getDefaultMaterial = function (materialOwner) { - if (typeof materialOwner === "undefined") { materialOwner = null; } - if (materialOwner != null && materialOwner.assetType == away.library.AssetType.LINE_SUB_MESH) { - if (!DefaultMaterialManager._defaultLineMaterial) - DefaultMaterialManager.createDefaultLineMaterial(); - - return DefaultMaterialManager._defaultLineMaterial; - } else { - if (!DefaultMaterialManager._defaultTriangleMaterial) - DefaultMaterialManager.createDefaultTriangleMaterial(); - - return DefaultMaterialManager._defaultTriangleMaterial; - } - }; - - DefaultMaterialManager.getDefaultTexture = function (materialOwner) { - if (typeof materialOwner === "undefined") { materialOwner = null; } - if (!DefaultMaterialManager._defaultTexture) - DefaultMaterialManager.createDefaultTexture(); - - return DefaultMaterialManager._defaultTexture; - }; - - DefaultMaterialManager.createDefaultTexture = function () { - DefaultMaterialManager._defaultBitmapData = DefaultMaterialManager.createCheckeredBitmapData(); - DefaultMaterialManager._defaultTexture = new away.textures.BitmapTexture(DefaultMaterialManager._defaultBitmapData, true); - DefaultMaterialManager._defaultTexture.name = "defaultTexture"; - }; - - DefaultMaterialManager.createCheckeredBitmapData = function () { - var b = new away.base.BitmapData(8, 8, false, 0x000000); - - //create chekerboard - var i, j; - for (i = 0; i < 8; i++) { - for (j = 0; j < 8; j++) { - if ((j & 1) ^ (i & 1)) { - b.setPixel(i, j, 0XFFFFFF); - } - } - } - - return b; - }; - - DefaultMaterialManager.createDefaultTriangleMaterial = function () { - if (!DefaultMaterialManager._defaultTexture) - DefaultMaterialManager.createDefaultTexture(); - - DefaultMaterialManager._defaultTriangleMaterial = new materials.TriangleBasicMaterial(DefaultMaterialManager._defaultTexture); - DefaultMaterialManager._defaultTriangleMaterial.mipmap = false; - DefaultMaterialManager._defaultTriangleMaterial.smooth = false; - DefaultMaterialManager._defaultTriangleMaterial.name = "defaultTriangleMaterial"; - }; - - DefaultMaterialManager.createDefaultLineMaterial = function () { - DefaultMaterialManager._defaultLineMaterial = new materials.LineBasicMaterial(); - DefaultMaterialManager._defaultLineMaterial.name = "defaultSegmentMaterial"; - }; - return DefaultMaterialManager; - })(); - materials.DefaultMaterialManager = DefaultMaterialManager; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (materials) { - var ContextGLTextureFormat = away.stagegl.ContextGLTextureFormat; - - var ShaderCompilerHelper = (function () { - function ShaderCompilerHelper() { - } - /** - * A helper method that generates standard code for sampling from a texture using the normal uv coordinates. - * @param vo The MethodVO object linking this method with the pass currently being compiled. - * @param sharedReg The shared register object for the shader. - * @param inputReg The texture stream register. - * @param texture The texture which will be assigned to the given slot. - * @param uvReg An optional uv register if coordinates different from the primary uv coordinates are to be used. - * @param forceWrap If true, texture wrapping is enabled regardless of the material setting. - * @return The fragment code that performs the sampling. - * - * @protected - */ - ShaderCompilerHelper.getTex2DSampleCode = function (targetReg, sharedReg, inputReg, texture, smooth, repeat, mipmaps, uvReg, forceWrap) { - if (typeof uvReg === "undefined") { uvReg = null; } - if (typeof forceWrap === "undefined") { forceWrap = null; } - var wrap = forceWrap || (repeat ? "wrap" : "clamp"); - var format = ShaderCompilerHelper.getFormatStringForTexture(texture); - var enableMipMaps = mipmaps && texture.hasMipmaps; - var filter = (smooth) ? (enableMipMaps ? "linear,miplinear" : "linear") : (enableMipMaps ? "nearest,mipnearest" : "nearest"); - - if (uvReg == null) - uvReg = sharedReg.uvVarying; - - return "tex " + targetReg + ", " + uvReg + ", " + inputReg + " <2d," + filter + "," + format + wrap + ">\n"; - }; - - /** - * A helper method that generates standard code for sampling from a cube texture. - * @param vo The MethodVO object linking this method with the pass currently being compiled. - * @param targetReg The register in which to store the sampled colour. - * @param inputReg The texture stream register. - * @param texture The cube map which will be assigned to the given slot. - * @param uvReg The direction vector with which to sample the cube map. - * - * @protected - */ - ShaderCompilerHelper.getTexCubeSampleCode = function (targetReg, inputReg, texture, smooth, mipmaps, uvReg) { - var filter; - var format = ShaderCompilerHelper.getFormatStringForTexture(texture); - var enableMipMaps = mipmaps && texture.hasMipmaps; - var filter = (smooth) ? (enableMipMaps ? "linear,miplinear" : "linear") : (enableMipMaps ? "nearest,mipnearest" : "nearest"); - - return "tex " + targetReg + ", " + uvReg + ", " + inputReg + " \n"; - }; - - /** - * Generates a texture format string for the sample instruction. - * @param texture The texture for which to get the format string. - * @return - * - * @protected - */ - ShaderCompilerHelper.getFormatStringForTexture = function (texture) { - switch (texture.format) { - case ContextGLTextureFormat.COMPRESSED: - return "dxt1,"; - break; - case ContextGLTextureFormat.COMPRESSED_ALPHA: - return "dxt5,"; - break; - default: - return ""; - } - }; - return ShaderCompilerHelper; - })(); - materials.ShaderCompilerHelper = ShaderCompilerHelper; - })(away.materials || (away.materials = {})); - var materials = away.materials; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.render - */ - (function (render) { - var RendererEvent = away.events.RendererEvent; - var StageEvent = away.events.StageEvent; - var Matrix3D = away.geom.Matrix3D; - var Point = away.geom.Point; - var Rectangle = away.geom.Rectangle; - - var DefaultMaterialManager = away.materials.DefaultMaterialManager; - - var BillboardRenderable = away.pool.BillboardRenderable; - - var LineSubMeshRenderable = away.pool.LineSubMeshRenderable; - var RenderablePool = away.pool.RenderablePool; - - var TriangleSubMeshRenderable = away.pool.TriangleSubMeshRenderable; - - var RenderableMergeSort = away.sort.RenderableMergeSort; - var ContextGLCompareMode = away.stagegl.ContextGLCompareMode; - - var EntityCollector = away.traverse.EntityCollector; - - /** - * RendererBase forms an abstract base class for classes that are used in the rendering pipeline to render the - * contents of a partition - * - * @class away.render.RendererBase - */ - var RendererBase = (function (_super) { - __extends(RendererBase, _super); - /** - * Creates a new RendererBase object. - */ - function RendererBase() { - var _this = this; - _super.call(this); - this._viewPort = new Rectangle(); - this._pBackBufferInvalid = true; - this._pDepthTextureInvalid = true; - this._depthPrepass = false; - this._backgroundR = 0; - this._backgroundG = 0; - this._backgroundB = 0; - this._backgroundAlpha = 1; - this._shareContext = false; - this.textureRatioX = 1; - this.textureRatioY = 1; - this._pRttViewProjectionMatrix = new Matrix3D(); - this._localPos = new Point(); - this._globalPos = new Point(); - this._pScissorRect = new Rectangle(); - this._pNumTriangles = 0; - - this._onViewportUpdatedDelegate = function (event) { - return _this.onViewportUpdated(event); - }; - - this._billboardRenderablePool = RenderablePool.getPool(BillboardRenderable); - this._triangleSubMeshRenderablePool = RenderablePool.getPool(TriangleSubMeshRenderable); - this._lineSubMeshRenderablePool = RenderablePool.getPool(LineSubMeshRenderable); - - this._onContextUpdateDelegate = function (event) { - return _this.onContextUpdate(event); - }; - - //default sorting algorithm - this.renderableSorter = new RenderableMergeSort(); - } - Object.defineProperty(RendererBase.prototype, "numTriangles", { - /** - * - */ - get: function () { - return this._pNumTriangles; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(RendererBase.prototype, "viewPort", { - /** - * A viewPort rectangle equivalent of the Stage size and position. - */ - get: function () { - return this._viewPort; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(RendererBase.prototype, "scissorRect", { - /** - * A scissor rectangle equivalent of the view size and position. - */ - get: function () { - return this._pScissorRect; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(RendererBase.prototype, "x", { - /** - * - */ - get: function () { - return this._localPos.x; - }, - set: function (value) { - if (this.x == value) - return; - - this._globalPos.x = this._localPos.x = value; - - this.updateGlobalPos(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(RendererBase.prototype, "y", { - /** - * - */ - get: function () { - return this._localPos.y; - }, - set: function (value) { - if (this.y == value) - return; - - this._globalPos.y = this._localPos.y = value; - - this.updateGlobalPos(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(RendererBase.prototype, "width", { - /** - * - */ - get: function () { - return this._width; - }, - set: function (value) { - if (this._width == value) - return; - - this._width = value; - this._pScissorRect.width = value; - - if (this._pRttBufferManager) - this._pRttBufferManager.viewWidth = value; - - this._pBackBufferInvalid = true; - this._pDepthTextureInvalid = true; - - this.notifyScissorUpdate(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(RendererBase.prototype, "height", { - /** - * - */ - get: function () { - return this._height; - }, - set: function (value) { - if (this._height == value) - return; - - this._height = value; - this._pScissorRect.height = value; - - if (this._pRttBufferManager) - this._pRttBufferManager.viewHeight = value; - - this._pBackBufferInvalid = true; - this._pDepthTextureInvalid = true; - - this.notifyScissorUpdate(); - }, - enumerable: true, - configurable: true - }); - - - RendererBase.prototype._iCreateEntityCollector = function () { - return new EntityCollector(); - }; - - Object.defineProperty(RendererBase.prototype, "_iBackgroundR", { - /** - * The background color's red component, used when clearing. - * - * @private - */ - get: function () { - return this._backgroundR; - }, - set: function (value) { - if (this._backgroundR == value) - return; - - this._backgroundR = value; - - this._pBackBufferInvalid = true; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(RendererBase.prototype, "_iBackgroundG", { - /** - * The background color's green component, used when clearing. - * - * @private - */ - get: function () { - return this._backgroundG; - }, - set: function (value) { - if (this._backgroundG == value) - return; - - this._backgroundG = value; - - this._pBackBufferInvalid = true; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(RendererBase.prototype, "_iBackgroundB", { - /** - * The background color's blue component, used when clearing. - * - * @private - */ - get: function () { - return this._backgroundB; - }, - set: function (value) { - if (this._backgroundB == value) - return; - - this._backgroundB = value; - - this._pBackBufferInvalid = true; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(RendererBase.prototype, "stage", { - /** - * The Stage that will provide the ContextGL used for rendering. - */ - get: function () { - return this._pStage; - }, - set: function (value) { - if (value == this._pStage) - return; - - this.iSetStage(value); - }, - enumerable: true, - configurable: true - }); - - - RendererBase.prototype.iSetStage = function (value) { - if (this._pStage) { - this._pStage.removeEventListener(StageEvent.CONTEXT_CREATED, this._onContextUpdateDelegate); - this._pStage.removeEventListener(StageEvent.CONTEXT_RECREATED, this._onContextUpdateDelegate); - this._pStage.removeEventListener(StageEvent.VIEWPORT_UPDATED, this._onViewportUpdatedDelegate); - } - - if (!value) { - this._pStage = null; - this._pContext = null; - } else { - this._pStage = value; - this._pStage.addEventListener(StageEvent.CONTEXT_CREATED, this._onContextUpdateDelegate); - this._pStage.addEventListener(StageEvent.CONTEXT_RECREATED, this._onContextUpdateDelegate); - this._pStage.addEventListener(StageEvent.VIEWPORT_UPDATED, this._onViewportUpdatedDelegate); - - /* - if (_backgroundImageRenderer) - _backgroundImageRenderer.stage = value; - */ - if (this._pStage.context) - this._pContext = this._pStage.context; - } - - this._pBackBufferInvalid = true; - - this.updateGlobalPos(); - }; - - Object.defineProperty(RendererBase.prototype, "shareContext", { - /** - * Defers control of ContextGL clear() and present() calls to Stage, enabling multiple Stage frameworks - * to share the same ContextGL object. - */ - get: function () { - return this._shareContext; - }, - set: function (value) { - if (this._shareContext == value) - return; - - this._shareContext = value; - - this.updateGlobalPos(); - }, - enumerable: true, - configurable: true - }); - - - /** - * Disposes the resources used by the RendererBase. - */ - RendererBase.prototype.dispose = function () { - if (this._pRttBufferManager) - this._pRttBufferManager.dispose(); - - this._pRttBufferManager = null; - - this._pStage.removeEventListener(StageEvent.CONTEXT_CREATED, this._onContextUpdateDelegate); - this._pStage.removeEventListener(StageEvent.CONTEXT_RECREATED, this._onContextUpdateDelegate); - this._pStage.removeEventListener(StageEvent.VIEWPORT_UPDATED, this._onViewportUpdatedDelegate); - - this._pStage = null; - /* - if (_backgroundImageRenderer) { - _backgroundImageRenderer.dispose(); - _backgroundImageRenderer = null; - } - */ - }; - - RendererBase.prototype.render = function (entityCollector) { - this._viewportDirty = false; - this._scissorDirty = false; - }; - - /** - * Renders the potentially visible geometry to the back buffer or texture. - * @param entityCollector The EntityCollector object containing the potentially visible geometry. - * @param target An option target texture to render to. - * @param surfaceSelector The index of a CubeTexture's face to render to. - * @param additionalClearMask Additional clear mask information, in case extra clear channels are to be omitted. - */ - RendererBase.prototype._iRender = function (entityCollector, target, scissorRect, surfaceSelector) { - if (typeof target === "undefined") { target = null; } - if (typeof scissorRect === "undefined") { scissorRect = null; } - if (typeof surfaceSelector === "undefined") { surfaceSelector = 0; } - //TODO refactor setTarget so that rendertextures are created before this check - if (!this._pStage || !this._pContext) - return; - - this._pRttViewProjectionMatrix.copyFrom(entityCollector.camera.viewProjection); - this._pRttViewProjectionMatrix.appendScale(this.textureRatioX, this.textureRatioY, 1); - - this.pExecuteRender(entityCollector, target, scissorRect, surfaceSelector); - - for (var i = 0; i < 8; ++i) { - this._pContext.setVertexBufferAt(i, null); - this._pContext.setTextureAt(i, null); - } - }; - - RendererBase.prototype._iRenderCascades = function (entityCollector, target, numCascades, scissorRects, cameras) { - }; - - RendererBase.prototype.pCollectRenderables = function (entityCollector) { - //reset head values - this._pBlendedRenderableHead = null; - this._pOpaqueRenderableHead = null; - this._pNumTriangles = 0; - - //grab entity head - var item = entityCollector.entityHead; - - //set temp values for entry point and camera forward vector - this._pCamera = entityCollector.camera; - this._iEntryPoint = this._pCamera.scenePosition; - this._pCameraForward = this._pCamera.transform.forwardVector; - - while (item) { - item.entity._iCollectRenderables(this); - item = item.next; - } - - //sort the resulting renderables - this._pOpaqueRenderableHead = this.renderableSorter.sortOpaqueRenderables(this._pOpaqueRenderableHead); - this._pBlendedRenderableHead = this.renderableSorter.sortBlendedRenderables(this._pBlendedRenderableHead); - }; - - /** - * Renders the potentially visible geometry to the back buffer or texture. Only executed if everything is set up. - * - * @param entityCollector The EntityCollector object containing the potentially visible geometry. - * @param target An option target texture to render to. - * @param surfaceSelector The index of a CubeTexture's face to render to. - * @param additionalClearMask Additional clear mask information, in case extra clear channels are to be omitted. - */ - RendererBase.prototype.pExecuteRender = function (entityCollector, target, scissorRect, surfaceSelector) { - if (typeof target === "undefined") { target = null; } - if (typeof scissorRect === "undefined") { scissorRect = null; } - if (typeof surfaceSelector === "undefined") { surfaceSelector = 0; } - this._pContext.setRenderTarget(target, true, surfaceSelector); - - if ((target || !this._shareContext) && !this._depthPrepass) - this._pContext.clear(this._backgroundR, this._backgroundG, this._backgroundB, this._backgroundAlpha, 1, 0); - - this._pContext.setDepthTest(false, ContextGLCompareMode.ALWAYS); - - this._pStage.scissorRect = scissorRect; - - /* - if (_backgroundImageRenderer) - _backgroundImageRenderer.render(); - */ - this.pDraw(entityCollector, target); - - //line required for correct rendering when using away3d with starling. DO NOT REMOVE UNLESS STARLING INTEGRATION IS RETESTED! - //this._pContext.setDepthTest(false, ContextGLCompareMode.LESS_EQUAL); //oopsie - if (!this._shareContext) { - if (this._snapshotRequired && this._snapshotBitmapData) { - this._pContext.drawToBitmapData(this._snapshotBitmapData); - this._snapshotRequired = false; - } - } - - this._pStage.scissorRect = null; - }; - - /* - * Will draw the renderer's output on next render to the provided bitmap data. - * */ - RendererBase.prototype.queueSnapshot = function (bmd) { - this._snapshotRequired = true; - this._snapshotBitmapData = bmd; - }; - - /** - * Performs the actual drawing of geometry to the target. - * @param entityCollector The EntityCollector object containing the potentially visible geometry. - */ - RendererBase.prototype.pDraw = function (entityCollector, target) { - throw new away.errors.AbstractMethodError(); - }; - - /** - * Assign the context once retrieved - */ - RendererBase.prototype.onContextUpdate = function (event) { - this._pContext = this._pStage.context; - }; - - Object.defineProperty(RendererBase.prototype, "_iBackgroundAlpha", { - get: function () { - return this._backgroundAlpha; - }, - set: function (value) { - if (this._backgroundAlpha == value) - return; - - this._backgroundAlpha = value; - - this._pBackBufferInvalid = true; - }, - enumerable: true, - configurable: true - }); - - - /* - public get iBackground():Texture2DBase - { - return this._background; - } - */ - /* - public set iBackground(value:Texture2DBase) - { - if (this._backgroundImageRenderer && !value) { - this._backgroundImageRenderer.dispose(); - this._backgroundImageRenderer = null; - } - - if (!this._backgroundImageRenderer && value) - { - - this._backgroundImageRenderer = new BackgroundImageRenderer(this._pStage); - - } - - - this._background = value; - - if (this._backgroundImageRenderer) - this._backgroundImageRenderer.texture = value; - } - */ - /* - public get backgroundImageRenderer():BackgroundImageRenderer - { - return _backgroundImageRenderer; - } - */ - /** - * @private - */ - RendererBase.prototype.notifyScissorUpdate = function () { - if (this._scissorDirty) - return; - - this._scissorDirty = true; - - if (!this._scissorUpdated) - this._scissorUpdated = new RendererEvent(RendererEvent.SCISSOR_UPDATED); - - this.dispatchEvent(this._scissorUpdated); - }; - - /** - * @private - */ - RendererBase.prototype.notifyViewportUpdate = function () { - if (this._viewportDirty) - return; - - this._viewportDirty = true; - - if (!this._viewPortUpdated) - this._viewPortUpdated = new RendererEvent(RendererEvent.VIEWPORT_UPDATED); - - this.dispatchEvent(this._viewPortUpdated); - }; - - /** - * - */ - RendererBase.prototype.onViewportUpdated = function (event) { - this._viewPort = this._pStage.viewPort; - - //TODO stop firing viewport updated for every stagegl viewport change - if (this._shareContext) { - this._pScissorRect.x = this._globalPos.x - this._pStage.x; - this._pScissorRect.y = this._globalPos.y - this._pStage.y; - this.notifyScissorUpdate(); - } - - this.notifyViewportUpdate(); - }; - - /** - * - */ - RendererBase.prototype.updateGlobalPos = function () { - if (this._shareContext) { - this._pScissorRect.x = this._globalPos.x - this._viewPort.x; - this._pScissorRect.y = this._globalPos.y - this._viewPort.y; - } else { - this._pScissorRect.x = 0; - this._pScissorRect.y = 0; - this._viewPort.x = this._globalPos.x; - this._viewPort.y = this._globalPos.y; - } - - this.notifyScissorUpdate(); - }; - - /** - * - * @param billboard - * @protected - */ - RendererBase.prototype.applyBillboard = function (billboard) { - this._applyRenderable(this._billboardRenderablePool.getItem(billboard)); - }; - - /** - * - * @param triangleSubMesh - */ - RendererBase.prototype.applyTriangleSubMesh = function (triangleSubMesh) { - this._applyRenderable(this._triangleSubMeshRenderablePool.getItem(triangleSubMesh)); - }; - - /** - * - * @param lineSubMesh - */ - RendererBase.prototype.applyLineSubMesh = function (lineSubMesh) { - this._applyRenderable(this._lineSubMeshRenderablePool.getItem(lineSubMesh)); - }; - - /** - * - * @param renderable - * @protected - */ - RendererBase.prototype._applyRenderable = function (renderable) { - var material = renderable.materialOwner.material; - var entity = renderable.sourceEntity; - var position = entity.scenePosition; - - if (!material) - material = DefaultMaterialManager.getDefaultMaterial(renderable.materialOwner); - - //update material if invalidated - material._iUpdateMaterial(); - - //set ids for faster referencing - renderable.material = material; - renderable.materialId = material._iMaterialId; - renderable.renderOrderId = this._pContext.getMaterial(material, this._pStage.profile).renderOrderId; - renderable.cascaded = false; - - // project onto camera's z-axis - position = this._iEntryPoint.subtract(position); - renderable.zIndex = entity.zOffset + position.dotProduct(this._pCameraForward); - - //store reference to scene transform - renderable.renderSceneTransform = renderable.sourceEntity.getRenderSceneTransform(this._pCamera); - - if (material.requiresBlending) { - renderable.next = this._pBlendedRenderableHead; - this._pBlendedRenderableHead = renderable; - } else { - renderable.next = this._pOpaqueRenderableHead; - this._pOpaqueRenderableHead = renderable; - } - - this._pNumTriangles += renderable.numTriangles; - - //handle any overflow for renderables with data that exceeds GPU limitations - if (renderable.overflow) - this._applyRenderable(renderable.overflow); - }; - return RendererBase; - })(away.events.EventDispatcher); - render.RendererBase = RendererBase; - })(away.render || (away.render = {})); - var render = away.render; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.render - */ - (function (render) { - var Matrix3D = away.geom.Matrix3D; - - var Vector3D = away.geom.Vector3D; - var RTTBufferManager = away.managers.RTTBufferManager; - var StageManager = away.managers.StageManager; - var DepthMapPass = away.materials.DepthMapPass; - var DistanceMapPass = away.materials.DistanceMapPass; - - var RenderablePool = away.pool.RenderablePool; - var SkyboxRenderable = away.pool.SkyboxRenderable; - var ContextGLBlendFactor = away.stagegl.ContextGLBlendFactor; - var ContextGLCompareMode = away.stagegl.ContextGLCompareMode; - var ContextGLClearMask = away.stagegl.ContextGLClearMask; - - var RenderTexture = away.textures.RenderTexture; - - /** - * The DefaultRenderer class provides the default rendering method. It renders the scene graph objects using the - * materials assigned to them. - * - * @class away.render.DefaultRenderer - */ - var DefaultRenderer = (function (_super) { - __extends(DefaultRenderer, _super); - /** - * Creates a new DefaultRenderer object. - * - * @param antiAlias The amount of anti-aliasing to use. - * @param renderMode The render mode to use. - */ - function DefaultRenderer(forceSoftware, profile, mode) { - if (typeof forceSoftware === "undefined") { forceSoftware = false; } - if (typeof profile === "undefined") { profile = "baseline"; } - if (typeof mode === "undefined") { mode = "auto"; } - _super.call(this); - this._skyboxProjection = new Matrix3D(); - - this._skyboxRenderablePool = RenderablePool.getPool(SkyboxRenderable); - - this._pDepthRenderer = new render.DepthRenderer(new DepthMapPass()); - this._pDistanceRenderer = new render.DepthRenderer(new DistanceMapPass()); - - if (this._pStage == null) - this.stage = StageManager.getInstance().getFreeStage(forceSoftware, profile, mode); - - this._pRttBufferManager = RTTBufferManager.getInstance(this._pStage); - - if (this._width == 0) - this.width = window.innerWidth; - else - this._pRttBufferManager.viewWidth = this._width; - - if (this._height == 0) - this.height = window.innerHeight; - else - this._pRttBufferManager.viewHeight = this._height; - } - Object.defineProperty(DefaultRenderer.prototype, "antiAlias", { - get: function () { - return this._antiAlias; - }, - set: function (value) { - if (this._antiAlias == value) - return; - - this._antiAlias = value; - - this._pBackBufferInvalid = true; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DefaultRenderer.prototype, "depthPrepass", { - /** - * - */ - get: function () { - return this._depthPrepass; - }, - set: function (value) { - this._depthPrepass = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(DefaultRenderer.prototype, "filters3d", { - /** - * - * @returns {*} - */ - get: function () { - return this._pFilter3DRenderer ? this._pFilter3DRenderer.filters : null; - }, - set: function (value) { - if (value && value.length == 0) - value = null; - - if (this._pFilter3DRenderer && !value) { - this._pFilter3DRenderer.dispose(); - this._pFilter3DRenderer = null; - } else if (!this._pFilter3DRenderer && value) { - this._pFilter3DRenderer = new render.Filter3DRenderer(this._pStage); - this._pFilter3DRenderer.filters = value; - } - - if (this._pFilter3DRenderer) { - this._pFilter3DRenderer.filters = value; - this._pRequireDepthRender = this._pFilter3DRenderer.requireDepthRender; - } else { - this._pRequireDepthRender = false; - - if (this._pDepthRender) { - this._pDepthRender.dispose(); - this._pDepthRender = null; - } - } - }, - enumerable: true, - configurable: true - }); - - DefaultRenderer.prototype.render = function (entityCollector) { - _super.prototype.render.call(this, entityCollector); - - if (!this._pStage.recoverFromDisposal()) { - this._pBackBufferInvalid = true; - return; - } - - if (this._pBackBufferInvalid) - this.pUpdateBackBuffer(); - - if (this._shareContext && this._pContext) - this._pContext.clear(0, 0, 0, 1, 1, 0, ContextGLClearMask.DEPTH); - - if (this._pFilter3DRenderer) { - this.textureRatioX = this._pRttBufferManager.textureRatioX; - this.textureRatioY = this._pRttBufferManager.textureRatioY; - } else { - this.textureRatioX = 1; - this.textureRatioY = 1; - } - - if (this._pRequireDepthRender) - this.pRenderSceneDepthToTexture(entityCollector); - - if (this._depthPrepass) - this.pRenderDepthPrepass(entityCollector); - - if (this._pFilter3DRenderer && this._pContext) { - //this._iRender(entityCollector, this._pFilter3DRenderer.getMainInputTexture(this._pStage), this._pRttBufferManager.renderToTextureRect); - //this._pFilter3DRenderer.render(this._pStage, entityCollector.camera, this._pDepthRender); - } else { - if (this._shareContext) - this._iRender(entityCollector, null, this._pScissorRect); - else - this._iRender(entityCollector); - } - - _super.prototype.render.call(this, entityCollector); - - if (!this._shareContext && this._pContext) - this._pContext.present(); - - // register that a view has been rendered - this._pStage.bufferClear = false; - }; - - DefaultRenderer.prototype.pExecuteRender = function (entityCollector, target, scissorRect, surfaceSelector) { - if (typeof target === "undefined") { target = null; } - if (typeof scissorRect === "undefined") { scissorRect = null; } - if (typeof surfaceSelector === "undefined") { surfaceSelector = 0; } - this.updateLights(entityCollector); - - // otherwise RTT will interfere with other RTTs - if (target) { - this.pCollectRenderables(entityCollector); - - this.drawRenderables(this._pOpaqueRenderableHead, entityCollector); - this.drawRenderables(this._pBlendedRenderableHead, entityCollector); - } - - _super.prototype.pExecuteRender.call(this, entityCollector, target, scissorRect, surfaceSelector); - }; - - DefaultRenderer.prototype.updateLights = function (entityCollector) { - var dirLights = entityCollector.directionalLights; - var pointLights = entityCollector.pointLights; - var len, i; - var light; - var shadowMapper; - - len = dirLights.length; - for (i = 0; i < len; ++i) { - light = dirLights[i]; - - shadowMapper = light.shadowMapper; - - if (light.castsShadows && (shadowMapper.autoUpdateShadows || shadowMapper._iShadowsInvalid)) - shadowMapper.iRenderDepthMap(this._pStage, entityCollector, this._pDepthRenderer); - } - - len = pointLights.length; - for (i = 0; i < len; ++i) { - light = pointLights[i]; - - shadowMapper = light.shadowMapper; - - if (light.castsShadows && (shadowMapper.autoUpdateShadows || shadowMapper._iShadowsInvalid)) - shadowMapper.iRenderDepthMap(this._pStage, entityCollector, this._pDistanceRenderer); - } - }; - - /** - * @inheritDoc - */ - DefaultRenderer.prototype.pDraw = function (entityCollector, target) { - if (!target) - this.pCollectRenderables(entityCollector); - - this._pContext.setBlendFactors(ContextGLBlendFactor.ONE, ContextGLBlendFactor.ZERO); - - if (entityCollector.skyBox) { - this._pContext.setDepthTest(false, ContextGLCompareMode.ALWAYS); - - this.drawSkybox(entityCollector); - } - - this._pContext.setDepthTest(true, ContextGLCompareMode.LESS_EQUAL); - - this.drawRenderables(this._pOpaqueRenderableHead, entityCollector); - this.drawRenderables(this._pBlendedRenderableHead, entityCollector); - }; - - /** - * Draw the skybox if present. - * - * @param entityCollector The EntityCollector containing all potentially visible information. - */ - DefaultRenderer.prototype.drawSkybox = function (entityCollector) { - var skyBox = this._skyboxRenderablePool.getItem(entityCollector.skyBox); - - var material = entityCollector.skyBox.material; - - var camera = entityCollector.camera; - - this.updateSkyboxProjection(camera); - - var activePass = this._pStage.context.getMaterial(material, this._pStage.profile).getMaterialPass(material._iScreenPasses[0], this._pStage.profile); - - material._iActivatePass(activePass, this._pStage, camera); - material._iRenderPass(activePass, skyBox, this._pStage, camera, this._skyboxProjection); - material._iDeactivatePass(activePass, this._pStage); - }; - - DefaultRenderer.prototype.updateSkyboxProjection = function (camera) { - var near = new Vector3D(); - - this._skyboxProjection.copyFrom(this._pRttViewProjectionMatrix); - this._skyboxProjection.copyRowTo(2, near); - - var camPos = camera.scenePosition; - - var cx = near.x; - var cy = near.y; - var cz = near.z; - var cw = -(near.x * camPos.x + near.y * camPos.y + near.z * camPos.z + Math.sqrt(cx * cx + cy * cy + cz * cz)); - - var signX = cx >= 0 ? 1 : -1; - var signY = cy >= 0 ? 1 : -1; - - var p = new Vector3D(signX, signY, 1, 1); - - var inverse = this._skyboxProjection.clone(); - inverse.invert(); - - var q = inverse.transformVector(p); - - this._skyboxProjection.copyRowTo(3, p); - - var a = (q.x * p.x + q.y * p.y + q.z * p.z + q.w * p.w) / (cx * q.x + cy * q.y + cz * q.z + cw * q.w); - - this._skyboxProjection.copyRowFrom(2, new Vector3D(cx * a, cy * a, cz * a, cw * a)); - }; - - /** - * Draw a list of renderables. - * - * @param renderables The renderables to draw. - * @param entityCollector The EntityCollector containing all potentially visible information. - */ - DefaultRenderer.prototype.drawRenderables = function (renderable, entityCollector) { - var i; - var len; - var passes; - var activePass; - var activeMaterial; - var context = this._pStage.context; - var camera = entityCollector.camera; - var renderable2; - - while (renderable) { - activeMaterial = context.getMaterial(renderable.material, this._pStage.profile); - - //iterate through each screen pass - passes = renderable.material._iScreenPasses; - len = renderable.material._iNumScreenPasses(); - for (i = 0; i < len; i++) { - renderable2 = renderable; - - activePass = activeMaterial.getMaterialPass(passes[i], this._pStage.profile); - - renderable.material._iActivatePass(activePass, this._pStage, camera); - - do { - renderable.material._iRenderPass(activePass, renderable2, this._pStage, camera, this._pRttViewProjectionMatrix); - - renderable2 = renderable2.next; - } while(renderable2 && renderable2.material == renderable.material); - - activeMaterial.material._iDeactivatePass(activePass, this._pStage); - } - - renderable = renderable2; - } - }; - - DefaultRenderer.prototype.dispose = function () { - if (!this._shareContext) - this._pStage.dispose(); - - this._pDepthRenderer.dispose(); - this._pDistanceRenderer.dispose(); - this._pDepthRenderer = null; - this._pDistanceRenderer = null; - - this._pDepthRender = null; - - _super.prototype.dispose.call(this); - }; - - /** - * - */ - DefaultRenderer.prototype.pRenderDepthPrepass = function (entityCollector) { - this._pDepthRenderer.disableColor = true; - - if (this._pFilter3DRenderer) { - // this._pDepthRenderer.textureRatioX = this._pRttBufferManager.textureRatioX; - // this._pDepthRenderer.textureRatioY = this._pRttBufferManager.textureRatioY; - // this._pDepthRenderer._iRender(entityCollector, this._pFilter3DRenderer.getMainInputTexture(this._pStage), this._pRttBufferManager.renderToTextureRect); - } else { - this._pDepthRenderer.textureRatioX = 1; - this._pDepthRenderer.textureRatioY = 1; - this._pDepthRenderer._iRender(entityCollector); - } - - this._pDepthRenderer.disableColor = false; - }; - - /** - * - */ - DefaultRenderer.prototype.pRenderSceneDepthToTexture = function (entityCollector) { - if (this._pDepthTextureInvalid || !this._pDepthRender) - this.initDepthTexture(this._pStage.context); - - this._pDepthRenderer.textureRatioX = this._pRttBufferManager.textureRatioX; - this._pDepthRenderer.textureRatioY = this._pRttBufferManager.textureRatioY; - this._pDepthRenderer._iRender(entityCollector, this._pDepthRender); - }; - - /** - * Updates the backbuffer dimensions. - */ - DefaultRenderer.prototype.pUpdateBackBuffer = function () { - // No reason trying to configure back buffer if there is no context available. - // Doing this anyway (and relying on _stage to cache width/height for - // context does get available) means usesSoftwareRendering won't be reliable. - if (this._pStage.context && !this._shareContext) { - if (this._width && this._height) { - this._pStage.configureBackBuffer(this._width, this._height, this._antiAlias, true); - this._pBackBufferInvalid = false; - } - } - }; - - DefaultRenderer.prototype.iSetStage = function (value) { - _super.prototype.iSetStage.call(this, value); - - this._pDistanceRenderer.iSetStage(value); - this._pDepthRenderer.iSetStage(value); - }; - - /** - * - */ - DefaultRenderer.prototype.initDepthTexture = function (context) { - this._pDepthTextureInvalid = false; - - if (this._pDepthRender) - this._pDepthRender.dispose(); - - this._pDepthRender = new RenderTexture(this._pRttBufferManager.textureWidth, this._pRttBufferManager.textureHeight); - }; - return DefaultRenderer; - })(render.RendererBase); - render.DefaultRenderer = DefaultRenderer; - })(away.render || (away.render = {})); - var render = away.render; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.render - */ - (function (render) { - var ContextGLBlendFactor = away.stagegl.ContextGLBlendFactor; - var ContextGLCompareMode = away.stagegl.ContextGLCompareMode; - - /** - * The DepthRenderer class renders 32-bit depth information encoded as RGBA - * - * @class away.render.DepthRenderer - */ - var DepthRenderer = (function (_super) { - __extends(DepthRenderer, _super); - /** - * Creates a new DepthRenderer object. - * @param renderBlended Indicates whether semi-transparent objects should be rendered. - * @param distanceBased Indicates whether the written depth value is distance-based or projected depth-based - */ - function DepthRenderer(pass, renderBlended) { - if (typeof renderBlended === "undefined") { renderBlended = false; } - _super.call(this); - - this._pass = pass; - - this._renderBlended = renderBlended; - this._iBackgroundR = 1; - this._iBackgroundG = 1; - this._iBackgroundB = 1; - } - Object.defineProperty(DepthRenderer.prototype, "disableColor", { - get: function () { - return this._disableColor; - }, - set: function (value) { - this._disableColor = value; - }, - enumerable: true, - configurable: true - }); - - - DepthRenderer.prototype._iRenderCascades = function (entityCollector, target, numCascades, scissorRects, cameras) { - this.pCollectRenderables(entityCollector); - - this._pContext.setRenderTarget(target, true, 0); - this._pContext.clear(1, 1, 1, 1, 1, 0); - - this._pContext.setBlendFactors(ContextGLBlendFactor.ONE, ContextGLBlendFactor.ZERO); - this._pContext.setDepthTest(true, ContextGLCompareMode.LESS); - - var head = this._pOpaqueRenderableHead; - - var first = true; - - for (var i = numCascades - 1; i >= 0; --i) { - this._pStage.scissorRect = scissorRects[i]; - this.drawCascadeRenderables(head, cameras[i], first ? null : cameras[i].frustumPlanes); - first = false; - } - - //line required for correct rendering when using away3d with starling. DO NOT REMOVE UNLESS STARLING INTEGRATION IS RETESTED! - this._pContext.setDepthTest(false, ContextGLCompareMode.LESS_EQUAL); - - this._pStage.scissorRect = null; - }; - - DepthRenderer.prototype.drawCascadeRenderables = function (renderable, camera, cullPlanes) { - var activePass; - var activeMaterial; - var context = this._pStage.context; - var renderable2; - - while (renderable) { - activeMaterial = context.getMaterial(renderable.material, this._pStage.profile); - - renderable2 = renderable; - - activePass = activeMaterial.getMaterialPass(this._pass, this._pStage.profile); - - //TODO: generalise this test - if (activePass.key == "") - this._pContext.calcAnimationCode(renderable.material, activePass); - - renderable.material._iActivatePass(activePass, this._pStage, camera); - - do { - // if completely in front, it will fall in a different cascade - // do not use near and far planes - if (!cullPlanes || renderable2.sourceEntity.worldBounds.isInFrustum(cullPlanes, 4)) { - renderable2.material._iRenderPass(activePass, renderable2, this._pStage, camera, this._pRttViewProjectionMatrix); - } else { - renderable2.cascaded = true; - } - - renderable2 = renderable2.next; - } while(renderable2 && renderable2.material == renderable.material && !renderable2.cascaded); - - renderable.material._iDeactivatePass(activePass, this._pStage); - - renderable = renderable2; - } - }; - - /** - * @inheritDoc - */ - DepthRenderer.prototype.pDraw = function (entityCollector, target) { - this.pCollectRenderables(entityCollector); - - this._pContext.setBlendFactors(ContextGLBlendFactor.ONE, ContextGLBlendFactor.ZERO); - - this._pContext.setDepthTest(true, ContextGLCompareMode.LESS); - - this.drawRenderables(this._pOpaqueRenderableHead, entityCollector); - - if (this._disableColor) - this._pContext.setColorMask(false, false, false, false); - - if (this._renderBlended) - this.drawRenderables(this._pBlendedRenderableHead, entityCollector); - - if (this._disableColor) - this._pContext.setColorMask(true, true, true, true); - }; - - /** - * Draw a list of renderables. - * @param renderables The renderables to draw. - * @param entityCollector The EntityCollector containing all potentially visible information. - */ - DepthRenderer.prototype.drawRenderables = function (renderable, entityCollector) { - var activePass; - var activeMaterial; - var context = this._pStage.context; - var camera = entityCollector.camera; - var renderable2; - - while (renderable) { - activeMaterial = context.getMaterial(renderable.material, this._pStage.profile); - - // otherwise this would result in depth rendered anyway because fragment shader kil is ignored - if (this._disableColor && renderable.material.alphaThreshold != 0) { - renderable2 = renderable; - - do { - renderable2 = renderable2.next; - } while(renderable2 && renderable2.material == renderable.material); - } else { - renderable2 = renderable; - - activePass = activeMaterial.getMaterialPass(this._pass, this._pStage.profile); - - //TODO: generalise this test - if (activePass.key == "") - this._pContext.calcAnimationCode(renderable.material, activePass); - - renderable.material._iActivatePass(activePass, this._pStage, camera); - - do { - renderable2.material._iRenderPass(activePass, renderable2, this._pStage, camera, this._pRttViewProjectionMatrix); - - renderable2 = renderable2.next; - } while(renderable2 && renderable2.material == renderable.material); - - renderable.material._iDeactivatePass(activePass, this._pStage); - } - - renderable = renderable2; - } - }; - return DepthRenderer; - })(render.RendererBase); - render.DepthRenderer = DepthRenderer; - })(away.render || (away.render = {})); - var render = away.render; -})(away || (away = {})); -/// -var away; -(function (away) { - /** - * @module away.render - */ - (function (render) { - /** - * @class away.render.Filter3DRenderer - */ - var Filter3DRenderer = (function () { - function Filter3DRenderer(stage) { - this._filterSizesInvalid = true; - this._onRTTResizeDelegate = away.utils.Delegate.create(this, this.onRTTResize); - - this._stage = stage; - this._rttManager = away.managers.RTTBufferManager.getInstance(stage); - this._rttManager.addEventListener(away.events.Event.RESIZE, this._onRTTResizeDelegate); - } - Filter3DRenderer.prototype.onRTTResize = function (event) { - this._filterSizesInvalid = true; - }; - - Object.defineProperty(Filter3DRenderer.prototype, "requireDepthRender", { - get: function () { - return this._requireDepthRender; - }, - enumerable: true, - configurable: true - }); - - Filter3DRenderer.prototype.getMainInputTexture = function (stage) { - if (this._filterTasksInvalid) { - this.updateFilterTasks(stage); - } - - return this._mainInputTexture; - }; - - Object.defineProperty(Filter3DRenderer.prototype, "filters", { - get: function () { - return this._filters; - }, - set: function (value) { - this._filters = value; - - this._filterTasksInvalid = true; - - this._requireDepthRender = false; - - if (!this._filters) { - return; - } - - for (var i = 0; i < this._filters.length; ++i) { - // TODO: check logic: - // this._requireDepthRender ||= Boolean ( this._filters[i].requireDepthRender ) - var s = this._filters[i]; - var b = (s.requireDepthRender == null) ? false : s.requireDepthRender; - - this._requireDepthRender = this._requireDepthRender || b; - } - - this._filterSizesInvalid = true; - }, - enumerable: true, - configurable: true - }); - - - Filter3DRenderer.prototype.updateFilterTasks = function (stage) { - var len; - - if (this._filterSizesInvalid) { - this.updateFilterSizes(); - } - - if (!this._filters) { - this._tasks = null; - return; - } - - this._tasks = new Array(); - - len = this._filters.length - 1; - - var filter; - - for (var i = 0; i <= len; ++i) { - // make sure all internal tasks are linked together - filter = this._filters[i]; - - // TODO: check logic - // filter.setRenderTargets(i == len? null : Filter3DBase(_filters[i + 1]).getMainInputTexture(stage), stage); - filter.setRenderTargets(i == len ? null : this._filters[i + 1].getMainInputTexture(stage), stage); - - this._tasks = this._tasks.concat(filter.tasks); - } - - this._mainInputTexture = this._filters[0].getMainInputTexture(stage); - }; - - Filter3DRenderer.prototype.render = function (stage, camera, depthTexture) { - var len; - var i; - var task; - var context = stage.context; - - var indexBuffer = this._rttManager.indexBuffer; - - var vertexBuffer = this._rttManager.renderToTextureVertexBuffer; - - if (!this._filters) { - return; - } - - if (this._filterSizesInvalid) { - this.updateFilterSizes(); - } - - if (this._filterTasksInvalid) { - this.updateFilterTasks(stage); - } - - len = this._filters.length; - - for (i = 0; i < len; ++i) { - this._filters[i].update(stage, camera); - } - - len = this._tasks.length; - - if (len > 1) { - context.setVertexBufferAt(0, vertexBuffer, 0, away.stagegl.ContextGLVertexBufferFormat.FLOAT_2); - context.setVertexBufferAt(1, vertexBuffer, 2, away.stagegl.ContextGLVertexBufferFormat.FLOAT_2); - } - - for (i = 0; i < len; ++i) { - task = this._tasks[i]; - - //stage.setRenderTarget(task.target); //TODO - if (!task.target) { - stage.scissorRect = null; - vertexBuffer = this._rttManager.renderToScreenVertexBuffer; - context.setVertexBufferAt(0, vertexBuffer, 0, away.stagegl.ContextGLVertexBufferFormat.FLOAT_2); - context.setVertexBufferAt(1, vertexBuffer, 2, away.stagegl.ContextGLVertexBufferFormat.FLOAT_2); - } - - context.setTextureAt(0, task.getMainInputTexture(stage)); - context.setProgram(task.getProgram(stage)); - context.clear(0.0, 0.0, 0.0, 0.0); - - task.activate(stage, camera, depthTexture); - - context.setBlendFactors(away.stagegl.ContextGLBlendFactor.ONE, away.stagegl.ContextGLBlendFactor.ZERO); - context.drawTriangles(indexBuffer, 0, 2); - - task.deactivate(stage); - } - - context.setTextureAt(0, null); - context.setVertexBufferAt(0, null); - context.setVertexBufferAt(1, null); - }; - - Filter3DRenderer.prototype.updateFilterSizes = function () { - for (var i = 0; i < this._filters.length; ++i) { - this._filters[i].textureWidth = this._rttManager.textureWidth; - this._filters[i].textureHeight = this._rttManager.textureHeight; - } - - this._filterSizesInvalid = true; - }; - - Filter3DRenderer.prototype.dispose = function () { - this._rttManager.removeEventListener(away.events.Event.RESIZE, this._onRTTResizeDelegate); - this._rttManager = null; - this._stage = null; - }; - return Filter3DRenderer; - })(); - render.Filter3DRenderer = Filter3DRenderer; - })(away.render || (away.render = {})); - var render = away.render; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * ... - */ - var AnimationRegisterCache = (function (_super) { - __extends(AnimationRegisterCache, _super); - function AnimationRegisterCache(profile) { - _super.call(this, profile); - this.indexDictionary = new Object(); - this.vertexConstantData = new Array(); - this.fragmentConstantData = new Array(); - } - AnimationRegisterCache.prototype.reset = function () { - _super.prototype.reset.call(this); - - this.rotationRegisters = new Array(); - this.positionAttribute = this.getRegisterFromString(this.sourceRegisters[0]); - this.scaleAndRotateTarget = this.getRegisterFromString(this.targetRegisters[0]); - this.addVertexTempUsages(this.scaleAndRotateTarget, 1); - - for (var i = 1; i < this.targetRegisters.length; i++) { - this.rotationRegisters.push(this.getRegisterFromString(this.targetRegisters[i])); - this.addVertexTempUsages(this.rotationRegisters[i - 1], 1); - } - - this.scaleAndRotateTarget = new ShaderRegisterElement(this.scaleAndRotateTarget.regName, this.scaleAndRotateTarget.index); //only use xyz, w is used as vertexLife - - //allot const register - this.vertexZeroConst = this.getFreeVertexConstant(); - this.vertexZeroConst = new ShaderRegisterElement(this.vertexZeroConst.regName, this.vertexZeroConst.index, 0); - this.vertexOneConst = new ShaderRegisterElement(this.vertexZeroConst.regName, this.vertexZeroConst.index, 1); - this.vertexTwoConst = new ShaderRegisterElement(this.vertexZeroConst.regName, this.vertexZeroConst.index, 2); - - //allot temp register - this.positionTarget = this.getFreeVertexVectorTemp(); - this.addVertexTempUsages(this.positionTarget, 1); - this.positionTarget = new ShaderRegisterElement(this.positionTarget.regName, this.positionTarget.index); - - if (this.needVelocity) { - this.velocityTarget = this.getFreeVertexVectorTemp(); - this.addVertexTempUsages(this.velocityTarget, 1); - this.velocityTarget = new ShaderRegisterElement(this.velocityTarget.regName, this.velocityTarget.index); - this.vertexTime = new ShaderRegisterElement(this.velocityTarget.regName, this.velocityTarget.index, 3); - this.vertexLife = new ShaderRegisterElement(this.positionTarget.regName, this.positionTarget.index, 3); - } else { - var tempTime = this.getFreeVertexVectorTemp(); - this.addVertexTempUsages(tempTime, 1); - this.vertexTime = new ShaderRegisterElement(tempTime.regName, tempTime.index, 0); - this.vertexLife = new ShaderRegisterElement(tempTime.regName, tempTime.index, 1); - } - }; - - AnimationRegisterCache.prototype.setUVSourceAndTarget = function (UVAttribute, UVVaring) { - this.uvVar = this.getRegisterFromString(UVVaring); - this.uvAttribute = this.getRegisterFromString(UVAttribute); - - //uv action is processed after normal actions,so use offsetTarget as uvTarget - this.uvTarget = new ShaderRegisterElement(this.positionTarget.regName, this.positionTarget.index); - }; - - AnimationRegisterCache.prototype.setRegisterIndex = function (node, parameterIndex /*int*/ , registerIndex /*int*/ ) { - //8 should be enough for any node. - var t = this.indexDictionary[node.id]; - - if (t == null) - t = this.indexDictionary[node.id] = new Array(8); - - t[parameterIndex] = registerIndex; - }; - - AnimationRegisterCache.prototype.getRegisterIndex = function (node, parameterIndex /*int*/ ) { - return this.indexDictionary[node.id][parameterIndex]; - }; - - AnimationRegisterCache.prototype.getInitCode = function () { - var len = this.sourceRegisters.length; - var code = ""; - for (var i = 0; i < len; i++) - code += "mov " + this.targetRegisters[i] + "," + this.sourceRegisters[i] + "\n"; - - code += "mov " + this.positionTarget + ".xyz," + this.vertexZeroConst.toString() + "\n"; - - if (this.needVelocity) - code += "mov " + this.velocityTarget + ".xyz," + this.vertexZeroConst.toString() + "\n"; - - return code; - }; - - AnimationRegisterCache.prototype.getCombinationCode = function () { - return "add " + this.scaleAndRotateTarget + ".xyz," + this.scaleAndRotateTarget + ".xyz," + this.positionTarget + ".xyz\n"; - }; - - AnimationRegisterCache.prototype.initColorRegisters = function () { - var code = ""; - if (this.hasColorMulNode) { - this.colorMulTarget = this.getFreeVertexVectorTemp(); - this.addVertexTempUsages(this.colorMulTarget, 1); - this.colorMulVary = this.getFreeVarying(); - code += "mov " + this.colorMulTarget + "," + this.vertexOneConst + "\n"; - } - if (this.hasColorAddNode) { - this.colorAddTarget = this.getFreeVertexVectorTemp(); - this.addVertexTempUsages(this.colorAddTarget, 1); - this.colorAddVary = this.getFreeVarying(); - code += "mov " + this.colorAddTarget + "," + this.vertexZeroConst + "\n"; - } - return code; - }; - - AnimationRegisterCache.prototype.getColorPassCode = function () { - var code = ""; - if (this.needFragmentAnimation && (this.hasColorAddNode || this.hasColorMulNode)) { - if (this.hasColorMulNode) - code += "mov " + this.colorMulVary + "," + this.colorMulTarget + "\n"; - if (this.hasColorAddNode) - code += "mov " + this.colorAddVary + "," + this.colorAddTarget + "\n"; - } - return code; - }; - - AnimationRegisterCache.prototype.getColorCombinationCode = function (shadedTarget) { - var code = ""; - if (this.needFragmentAnimation && (this.hasColorAddNode || this.hasColorMulNode)) { - var colorTarget = this.getRegisterFromString(shadedTarget); - this.addFragmentTempUsages(colorTarget, 1); - if (this.hasColorMulNode) - code += "mul " + colorTarget + "," + colorTarget + "," + this.colorMulVary + "\n"; - if (this.hasColorAddNode) - code += "add " + colorTarget + "," + colorTarget + "," + this.colorAddVary + "\n"; - } - return code; - }; - - AnimationRegisterCache.prototype.getRegisterFromString = function (code) { - var temp = code.split(/(\d+)/); - return new ShaderRegisterElement(temp[0], parseInt(temp[1])); - }; - - Object.defineProperty(AnimationRegisterCache.prototype, "numVertexConstant", { - get: function () { - return this._numVertexConstant; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(AnimationRegisterCache.prototype, "numFragmentConstant", { - get: function () { - return this._numFragmentConstant; - }, - enumerable: true, - configurable: true - }); - - AnimationRegisterCache.prototype.setDataLength = function () { - this._numVertexConstant = this.numUsedVertexConstants - this.vertexConstantOffset; - this._numFragmentConstant = this.numUsedFragmentConstants - this.fragmentConstantOffset; - this.vertexConstantData.length = this._numVertexConstant * 4; - this.fragmentConstantData.length = this._numFragmentConstant * 4; - }; - - AnimationRegisterCache.prototype.setVertexConst = function (index /*int*/ , x, y, z, w) { - if (typeof x === "undefined") { x = 0; } - if (typeof y === "undefined") { y = 0; } - if (typeof z === "undefined") { z = 0; } - if (typeof w === "undefined") { w = 0; } - var _index = (index - this.vertexConstantOffset) * 4; - this.vertexConstantData[_index++] = x; - this.vertexConstantData[_index++] = y; - this.vertexConstantData[_index++] = z; - this.vertexConstantData[_index] = w; - }; - - AnimationRegisterCache.prototype.setVertexConstFromArray = function (index /*int*/ , data) { - var _index = (index - this.vertexConstantOffset) * 4; - for (var i = 0; i < data.length; i++) - this.vertexConstantData[_index++] = data[i]; - }; - - AnimationRegisterCache.prototype.setVertexConstFromMatrix = function (index /*int*/ , matrix) { - var rawData = matrix.rawData; - var _index = (index - this.vertexConstantOffset) * 4; - this.vertexConstantData[_index++] = rawData[0]; - this.vertexConstantData[_index++] = rawData[4]; - this.vertexConstantData[_index++] = rawData[8]; - this.vertexConstantData[_index++] = rawData[12]; - this.vertexConstantData[_index++] = rawData[1]; - this.vertexConstantData[_index++] = rawData[5]; - this.vertexConstantData[_index++] = rawData[9]; - this.vertexConstantData[_index++] = rawData[13]; - this.vertexConstantData[_index++] = rawData[2]; - this.vertexConstantData[_index++] = rawData[6]; - this.vertexConstantData[_index++] = rawData[10]; - this.vertexConstantData[_index++] = rawData[14]; - this.vertexConstantData[_index++] = rawData[3]; - this.vertexConstantData[_index++] = rawData[7]; - this.vertexConstantData[_index++] = rawData[11]; - this.vertexConstantData[_index] = rawData[15]; - }; - - AnimationRegisterCache.prototype.setFragmentConst = function (index /*int*/ , x, y, z, w) { - if (typeof x === "undefined") { x = 0; } - if (typeof y === "undefined") { y = 0; } - if (typeof z === "undefined") { z = 0; } - if (typeof w === "undefined") { w = 0; } - var _index = (index - this.fragmentConstantOffset) * 4; - this.fragmentConstantData[_index++] = x; - this.fragmentConstantData[_index++] = y; - this.fragmentConstantData[_index++] = z; - this.fragmentConstantData[_index] = w; - }; - return AnimationRegisterCache; - })(away.materials.ShaderRegisterCache); - animators.AnimationRegisterCache = AnimationRegisterCache; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var AbstractMethodError = away.errors.AbstractMethodError; - - /** - * Provides an abstract base class for data set classes that hold animation data for use in animator classes. - * - * @see away.animators.AnimatorBase - */ - var AnimationSetBase = (function (_super) { - __extends(AnimationSetBase, _super); - function AnimationSetBase() { - _super.call(this); - this._animations = new Array(); - this._animationNames = new Array(); - this._animationDictionary = new Object(); - } - /** - * Retrieves a temporary GPU register that's still free. - * - * @param exclude An array of non-free temporary registers. - * @param excludeAnother An additional register that's not free. - * @return A temporary register that can be used. - */ - AnimationSetBase.prototype._pFindTempReg = function (exclude, excludeAnother) { - if (typeof excludeAnother === "undefined") { excludeAnother = null; } - var i = 0; - var reg; - - while (true) { - reg = "vt" + i; - if (exclude.indexOf(reg) == -1 && excludeAnother != reg) - return reg; - ++i; - } - - // can't be reached - return null; - }; - - Object.defineProperty(AnimationSetBase.prototype, "usesCPU", { - /** - * Indicates whether the properties of the animation data contained within the set combined with - * the vertex registers already in use on shading materials allows the animation data to utilise - * GPU calls. - */ - get: function () { - return this._usesCPU; - }, - enumerable: true, - configurable: true - }); - - /** - * Called by the material to reset the GPU indicator before testing whether register space in the shader - * is available for running GPU-based animation code. - * - * @private - */ - AnimationSetBase.prototype.resetGPUCompatibility = function () { - this._usesCPU = false; - }; - - AnimationSetBase.prototype.cancelGPUCompatibility = function () { - this._usesCPU = true; - }; - - /** - * @inheritDoc - */ - AnimationSetBase.prototype.getAGALVertexCode = function (shaderObject) { - throw new AbstractMethodError(); - }; - - /** - * @inheritDoc - */ - AnimationSetBase.prototype.activate = function (shaderObject, stage) { - throw new AbstractMethodError(); - }; - - /** - * @inheritDoc - */ - AnimationSetBase.prototype.deactivate = function (shaderObject, stage) { - throw new AbstractMethodError(); - }; - - /** - * @inheritDoc - */ - AnimationSetBase.prototype.getAGALFragmentCode = function (shaderObject, shadedTarget) { - throw new AbstractMethodError(); - }; - - /** - * @inheritDoc - */ - AnimationSetBase.prototype.getAGALUVCode = function (shaderObject) { - throw new AbstractMethodError(); - }; - - /** - * @inheritDoc - */ - AnimationSetBase.prototype.doneAGALCode = function (shaderObject) { - throw new AbstractMethodError(); - }; - - Object.defineProperty(AnimationSetBase.prototype, "assetType", { - /** - * @inheritDoc - */ - get: function () { - return away.library.AssetType.ANIMATION_SET; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(AnimationSetBase.prototype, "animations", { - /** - * Returns a vector of animation state objects that make up the contents of the animation data set. - */ - get: function () { - return this._animations; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(AnimationSetBase.prototype, "animationNames", { - /** - * Returns a vector of animation state objects that make up the contents of the animation data set. - */ - get: function () { - return this._animationNames; - }, - enumerable: true, - configurable: true - }); - - /** - * Check to determine whether a state is registered in the animation set under the given name. - * - * @param stateName The name of the animation state object to be checked. - */ - AnimationSetBase.prototype.hasAnimation = function (name) { - return this._animationDictionary[name] != null; - }; - - /** - * Retrieves the animation state object registered in the animation data set under the given name. - * - * @param stateName The name of the animation state object to be retrieved. - */ - AnimationSetBase.prototype.getAnimation = function (name) { - return this._animationDictionary[name]; - }; - - /** - * Adds an animation state object to the aniamtion data set under the given name. - * - * @param stateName The name under which the animation state object will be stored. - * @param animationState The animation state object to be staored in the set. - */ - AnimationSetBase.prototype.addAnimation = function (node) { - if (this._animationDictionary[node.name]) - throw new away.errors.AnimationSetError("root node name '" + node.name + "' already exists in the set"); - - this._animationDictionary[node.name] = node; - - this._animations.push(node); - - this._animationNames.push(node.name); - }; - - /** - * Cleans up any resources used by the current object. - */ - AnimationSetBase.prototype.dispose = function () { - }; - return AnimationSetBase; - })(away.library.NamedAssetBase); - animators.AnimationSetBase = AnimationSetBase; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (animators) { - var AbstractMethodError = away.errors.AbstractMethodError; - var AnimatorEvent = away.events.AnimatorEvent; - var AssetType = away.library.AssetType; - - /** - * Dispatched when playback of an animation inside the animator object starts. - * - * @eventType away3d.events.AnimatorEvent - */ - //[Event(name="start", type="away3d.events.AnimatorEvent")] - /** - * Dispatched when playback of an animation inside the animator object stops. - * - * @eventType away3d.events.AnimatorEvent - */ - //[Event(name="stop", type="away3d.events.AnimatorEvent")] - /** - * Dispatched when playback of an animation reaches the end of an animation. - * - * @eventType away3d.events.AnimatorEvent - */ - //[Event(name="cycle_complete", type="away3d.events.AnimatorEvent")] - /** - * Provides an abstract base class for animator classes that control animation output from a data set subtype of AnimationSetBase. - * - * @see away.animators.AnimationSetBase - */ - var AnimatorBase = (function (_super) { - __extends(AnimatorBase, _super); - /** - * Creates a new AnimatorBase object. - * - * @param animationSet The animation data set to be used by the animator object. - */ - function AnimatorBase(animationSet) { - _super.call(this); - this._autoUpdate = true; - this._time = 0; - this._playbackSpeed = 1; - this._pOwners = new Array(); - this._pAbsoluteTime = 0; - this._animationStates = new Object(); - /** - * Enables translation of the animated mesh from data returned per frame via the positionDelta property of the active animation node. Defaults to true. - * - * @see away.animators.IAnimationState#positionDelta - */ - this.updatePosition = true; - - this._pAnimationSet = animationSet; - - this._broadcaster = new away.utils.RequestAnimationFrame(this.onEnterFrame, this); - } - AnimatorBase.prototype.getAnimationState = function (node) { - var className = node.stateClass; - var uID = node.id; - - if (this._animationStates[uID] == null) - this._animationStates[uID] = new className(this, node); - - return this._animationStates[uID]; - }; - - AnimatorBase.prototype.getAnimationStateByName = function (name) { - return this.getAnimationState(this._pAnimationSet.getAnimation(name)); - }; - - Object.defineProperty(AnimatorBase.prototype, "absoluteTime", { - /** - * Returns the internal absolute time of the animator, calculated by the current time and the playback speed. - * - * @see #time - * @see #playbackSpeed - */ - get: function () { - return this._pAbsoluteTime; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(AnimatorBase.prototype, "animationSet", { - /** - * Returns the animation data set in use by the animator. - */ - get: function () { - return this._pAnimationSet; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(AnimatorBase.prototype, "activeState", { - /** - * Returns the current active animation state. - */ - get: function () { - return this._pActiveState; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(AnimatorBase.prototype, "activeAnimation", { - /** - * Returns the current active animation node. - */ - get: function () { - return this._pAnimationSet.getAnimation(this._pActiveAnimationName); - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(AnimatorBase.prototype, "activeAnimationName", { - /** - * Returns the current active animation node. - */ - get: function () { - return this._pActiveAnimationName; - }, - enumerable: true, - configurable: true - }); - - Object.defineProperty(AnimatorBase.prototype, "autoUpdate", { - /** - * Determines whether the animators internal update mechanisms are active. Used in cases - * where manual updates are required either via the time property or update() method. - * Defaults to true. - * - * @see #time - * @see #update() - */ - get: function () { - return this._autoUpdate; - }, - set: function (value) { - if (this._autoUpdate == value) - return; - - this._autoUpdate = value; - - if (this._autoUpdate) - this.start(); - else - this.stop(); - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(AnimatorBase.prototype, "time", { - /** - * Gets and sets the internal time clock of the animator. - */ - get: function () { - return this._time; - }, - set: function (value /*int*/ ) { - if (this._time == value) - return; - - this.update(value); - }, - enumerable: true, - configurable: true - }); - - - /** - * Sets the animation phase of the current active state's animation clip(s). - * - * @param value The phase value to use. 0 represents the beginning of an animation clip, 1 represents the end. - */ - AnimatorBase.prototype.phase = function (value) { - this._pActiveState.phase(value); - }; - - Object.defineProperty(AnimatorBase.prototype, "playbackSpeed", { - /** - * The amount by which passed time should be scaled. Used to slow down or speed up animations. Defaults to 1. - */ - get: function () { - return this._playbackSpeed; - }, - set: function (value) { - this._playbackSpeed = value; - }, - enumerable: true, - configurable: true - }); - - - AnimatorBase.prototype.setRenderState = function (shaderObject, renderable, stage, camera, vertexConstantOffset /*int*/ , vertexStreamOffset /*int*/ ) { - throw new away.errors.AbstractMethodError(); - }; - - /** - * Resumes the automatic playback clock controling the active state of the animator. - */ - AnimatorBase.prototype.start = function () { - if (this._isPlaying || !this._autoUpdate) - return; - - this._time = this._pAbsoluteTime = away.utils.getTimer(); - - this._isPlaying = true; - - this._broadcaster.start(); - - if (!this.hasEventListener(AnimatorEvent.START)) - return; - - if (this._startEvent == null) - this._startEvent = new AnimatorEvent(AnimatorEvent.START, this); - - this.dispatchEvent(this._startEvent); - }; - - /** - * Pauses the automatic playback clock of the animator, in case manual updates are required via the - * time property or update() method. - * - * @see #time - * @see #update() - */ - AnimatorBase.prototype.stop = function () { - if (!this._isPlaying) - return; - - this._isPlaying = false; - - this._broadcaster.stop(); - - if (!this.hasEventListener(AnimatorEvent.STOP)) - return; - - if (this._stopEvent == null) - this._stopEvent = new AnimatorEvent(AnimatorEvent.STOP, this); - - this.dispatchEvent(this._stopEvent); - }; - - /** - * Provides a way to manually update the active state of the animator when automatic - * updates are disabled. - * - * @see #stop() - * @see #autoUpdate - */ - AnimatorBase.prototype.update = function (time /*int*/ ) { - var dt = (time - this._time) * this.playbackSpeed; - - this._pUpdateDeltaTime(dt); - - this._time = time; - }; - - AnimatorBase.prototype.reset = function (name, offset) { - if (typeof offset === "undefined") { offset = 0; } - this.getAnimationState(this._pAnimationSet.getAnimation(name)).offset(offset + this._pAbsoluteTime); - }; - - /** - * Used by the mesh object to which the animator is applied, registers the owner for internal use. - * - * @private - */ - AnimatorBase.prototype.addOwner = function (mesh) { - this._pOwners.push(mesh); - }; - - /** - * Used by the mesh object from which the animator is removed, unregisters the owner for internal use. - * - * @private - */ - AnimatorBase.prototype.removeOwner = function (mesh) { - this._pOwners.splice(this._pOwners.indexOf(mesh), 1); - }; - - /** - * Internal abstract method called when the time delta property of the animator's contents requires updating. - * - * @private - */ - AnimatorBase.prototype._pUpdateDeltaTime = function (dt) { - this._pAbsoluteTime += dt; - - this._pActiveState.update(this._pAbsoluteTime); - - if (this.updatePosition) - this.applyPositionDelta(); - }; - - /** - * Enter frame event handler for automatically updating the active state of the animator. - */ - AnimatorBase.prototype.onEnterFrame = function (event) { - if (typeof event === "undefined") { event = null; } - this.update(away.utils.getTimer()); - }; - - AnimatorBase.prototype.applyPositionDelta = function () { - var delta = this._pActiveState.positionDelta; - var dist = delta.length; - var len; - if (dist > 0) { - len = this._pOwners.length; - for (var i = 0; i < len; ++i) - this._pOwners[i].translateLocal(delta, dist); - } - }; - - /** - * for internal use. - * - * @private - */ - AnimatorBase.prototype.dispatchCycleEvent = function () { - if (this.hasEventListener(AnimatorEvent.CYCLE_COMPLETE)) { - if (this._cycleEvent == null) - this._cycleEvent = new AnimatorEvent(AnimatorEvent.CYCLE_COMPLETE, this); - - this.dispatchEvent(this._cycleEvent); - } - }; - - /** - * @inheritDoc - */ - AnimatorBase.prototype.clone = function () { - throw new AbstractMethodError(); - }; - - /** - * @inheritDoc - */ - AnimatorBase.prototype.dispose = function () { - }; - - /** - * @inheritDoc - */ - AnimatorBase.prototype.testGPUCompatibility = function (shaderObject) { - throw new AbstractMethodError(); - }; - - Object.defineProperty(AnimatorBase.prototype, "assetType", { - /** - * @inheritDoc - */ - get: function () { - return AssetType.ANIMATOR; - }, - enumerable: true, - configurable: true - }); - - AnimatorBase.prototype.getRenderableSubGeometry = function (renderable, sourceSubGeometry) { - //nothing to do here - return sourceSubGeometry; - }; - return AnimatorBase; - })(away.library.NamedAssetBase); - animators.AnimatorBase = AnimatorBase; - })(away.animators || (away.animators = {})); - var animators = away.animators; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (filters) { - var Filter3DTaskBase = (function () { - function Filter3DTaskBase(requireDepthRender) { - if (typeof requireDepthRender === "undefined") { requireDepthRender = false; } - this._scaledTextureWidth = -1; - this._scaledTextureHeight = -1; - this._textureWidth = -1; - this._textureHeight = -1; - this._textureDimensionsInvalid = true; - this._program3DInvalid = true; - this._textureScale = 0; - this._requireDepthRender = requireDepthRender; - } - Object.defineProperty(Filter3DTaskBase.prototype, "textureScale", { - /** - * The texture scale for the input of this texture. This will define the output of the previous entry in the chain - */ - get: function () { - return this._textureScale; - }, - set: function (value) { - if (this._textureScale == value) { - return; - } - - this._textureScale = value; - this._scaledTextureWidth = this._textureWidth >> this._textureScale; - this._scaledTextureHeight = this._textureHeight >> this._textureScale; - this._textureDimensionsInvalid = true; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Filter3DTaskBase.prototype, "target", { - get: function () { - return this._target; - }, - set: function (value) { - this._target = value; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Filter3DTaskBase.prototype, "textureWidth", { - get: function () { - return this._textureWidth; - }, - set: function (value) { - if (this._textureWidth == value) { - return; - } - - this._textureWidth = value; - this._scaledTextureWidth = this._textureWidth >> this._textureScale; - this._textureDimensionsInvalid = true; - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Filter3DTaskBase.prototype, "textureHeight", { - get: function () { - return this._textureHeight; - }, - set: function (value) { - if (this._textureHeight == value) { - return; - } - - this._textureHeight = value; - this._scaledTextureHeight = this._textureHeight >> this._textureScale; - this._textureDimensionsInvalid = true; - }, - enumerable: true, - configurable: true - }); - - - Filter3DTaskBase.prototype.getMainInputTexture = function (stage) { - if (this._textureDimensionsInvalid) { - this.pUpdateTextures(stage); - } - - return this._mainInputTexture; - }; - - Filter3DTaskBase.prototype.dispose = function () { - if (this._mainInputTexture) { - this._mainInputTexture.dispose(); - } - - if (this._program3D) { - this._program3D.dispose(); - } - }; - - Filter3DTaskBase.prototype.pInvalidateProgram = function () { - this._program3DInvalid = true; - }; - - Filter3DTaskBase.prototype.pUpdateProgram = function (stage) { - if (this._program3D) { - this._program3D.dispose(); - } - - this._program3D = stage.context.createProgram(); - - var vertexByteCode = (new aglsl.assembler.AGALMiniAssembler().assemble("part vertex 1\n" + this.pGetVertexCode() + "endpart"))['vertex'].data; - var fragmentByteCode = (new aglsl.assembler.AGALMiniAssembler().assemble("part fragment 1\n" + this.pGetFragmentCode() + "endpart"))['fragment'].data; - this._program3D.upload(vertexByteCode, fragmentByteCode); - this._program3DInvalid = false; - }; - - Filter3DTaskBase.prototype.pGetVertexCode = function () { - // TODO: imeplement AGAL <> GLSL - return "mov op, va0\n" + "mov v0, va1\n"; - }; - - Filter3DTaskBase.prototype.pGetFragmentCode = function () { - throw new away.errors.AbstractMethodError(); - - return null; - }; - - Filter3DTaskBase.prototype.pUpdateTextures = function (stage) { - if (this._mainInputTexture) { - this._mainInputTexture.dispose(); - } - - this._mainInputTexture = stage.context.createTexture(this._scaledTextureWidth, this._scaledTextureHeight, away.stagegl.ContextGLTextureFormat.BGRA, true); - - this._textureDimensionsInvalid = false; - }; - - Filter3DTaskBase.prototype.getProgram = function (stage) { - if (this._program3DInvalid) { - this.pUpdateProgram(stage); - } - - return this._program3D; - }; - - Filter3DTaskBase.prototype.activate = function (stage, camera, depthTexture) { - }; - - Filter3DTaskBase.prototype.deactivate = function (stage) { - }; - - Object.defineProperty(Filter3DTaskBase.prototype, "requireDepthRender", { - get: function () { - return this._requireDepthRender; - }, - enumerable: true, - configurable: true - }); - return Filter3DTaskBase; - })(); - filters.Filter3DTaskBase = Filter3DTaskBase; - })(away.filters || (away.filters = {})); - var filters = away.filters; -})(away || (away = {})); -/// -var away; -(function (away) { - (function (filters) { - var Filter3DBase = (function () { - function Filter3DBase() { - this._tasks = new Array(); - } - Object.defineProperty(Filter3DBase.prototype, "requireDepthRender", { - get: function () { - return this._requireDepthRender; - }, - enumerable: true, - configurable: true - }); - - Filter3DBase.prototype.pAddTask = function (filter) { - this._tasks.push(filter); - - if (this._requireDepthRender == null) { - this._requireDepthRender = filter.requireDepthRender; - } - }; - - Object.defineProperty(Filter3DBase.prototype, "tasks", { - get: function () { - return this._tasks; - }, - enumerable: true, - configurable: true - }); - - Filter3DBase.prototype.getMainInputTexture = function (stage) { - return this._tasks[0].getMainInputTexture(stage); - }; - - Object.defineProperty(Filter3DBase.prototype, "textureWidth", { - get: function () { - return this._textureWidth; - }, - set: function (value) { - this._textureWidth = value; - - for (var i = 0; i < this._tasks.length; ++i) { - this._tasks[i].textureWidth = value; - } - }, - enumerable: true, - configurable: true - }); - - - Object.defineProperty(Filter3DBase.prototype, "textureHeight", { - get: function () { - return this._textureHeight; - }, - set: function (value) { - this._textureHeight = value; - - for (var i = 0; i < this._tasks.length; ++i) { - this._tasks[i].textureHeight = value; - } - }, - enumerable: true, - configurable: true - }); - - - // link up the filters correctly with the next filter - Filter3DBase.prototype.setRenderTargets = function (mainTarget, stage) { - this._tasks[this._tasks.length - 1].target = mainTarget; - }; - - Filter3DBase.prototype.dispose = function () { - for (var i = 0; i < this._tasks.length; ++i) { - this._tasks[i].dispose(); - } - }; - - Filter3DBase.prototype.update = function (stage, camera) { - }; - return Filter3DBase; - })(); - filters.Filter3DBase = Filter3DBase; - })(away.filters || (away.filters = {})); - var filters = away.filters; -})(away || (away = {})); -/********************************************************************************************************************************************************************************************************** -* This file contains a reference to all the classes used in the project. -******************************************************************************************************************************************************************************************************** -* -* The TypeScript compiler exports classes in a non deterministic manner, as the extend functionality copies the prototype chain -* of one object onto another during initialisation and load (to create extensible functionality), the non deterministic nature of the -* compiler can result in an extend operation referencing a class that is undefined and not yet loaded - which throw an JavaScript error. -* -* This file provides the compiler with a strict order in which to export the TypeScript classes to mitigate undefined extend errors -* -* @see https://typescript.codeplex.com/workitem/1356 @see https://typescript.codeplex.com/workitem/913 -* -*********************************************************************************************************************************************************************************************************/ -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -away.Debug.THROW_ERRORS = false; -away.Debug.LOG_PI_ERRORS = false; - -var away; -(function (away) { - var StageGLCore = (function (_super) { - __extends(StageGLCore, _super); - function StageGLCore() { - _super.call(this); - } - return StageGLCore; - })(away.events.EventDispatcher); - away.StageGLCore = StageGLCore; -})(away || (away = {})); -//# sourceMappingURL=stagegl-core.next.js.map diff --git a/libs/stagegl-core.next.min.js b/libs/stagegl-core.next.min.js deleted file mode 100644 index da2229f02..000000000 --- a/libs/stagegl-core.next.min.js +++ /dev/null @@ -1,10 +0,0 @@ -function mountain_js_context_available(id,driverInfo){var ctx=away.stagegl.ContextStage3D.contexts[id];if(ctx._iCallback){ctx._iDriverInfo=driverInfo;var timeOutId=window.setTimeout(function(){window.clearTimeout(timeOutId);try{ctx._iCallback(ctx)}catch(e){console.log("Callback failed during flash initialization with '"+e.toString()+"'")}},1)}}var aglsl;!function(aglsl){var Sampler=function(){function Sampler(){this.lodbias=0,this.dim=0,this.readmode=0,this.special=0,this.wrap=0,this.mipmap=0,this.filter=0}return Sampler}();aglsl.Sampler=Sampler}(aglsl||(aglsl={}));var aglsl;!function(aglsl){var Token=function(){function Token(){this.dest=new aglsl.Destination,this.opcode=0,this.a=new aglsl.Destination,this.b=new aglsl.Destination}return Token}();aglsl.Token=Token}(aglsl||(aglsl={}));var aglsl;!function(aglsl){var Header=function(){function Header(){this.progid=0,this.version=0,this.type=""}return Header}();aglsl.Header=Header}(aglsl||(aglsl={}));var aglsl;!function(aglsl){var OpLUT=function(){function OpLUT(s,flags,dest,a,b,matrixwidth,matrixheight,ndwm,scaler,dm,lod){this.s=s,this.flags=flags,this.dest=dest,this.a=a,this.b=b,this.matrixwidth=matrixwidth,this.matrixheight=matrixheight,this.ndwm=ndwm,this.scalar=scaler,this.dm=dm,this.lod=lod}return OpLUT}();aglsl.OpLUT=OpLUT}(aglsl||(aglsl={}));var aglsl;!function(aglsl){var Description=function(){function Description(){this.regread=[[],[],[],[],[],[],[]],this.regwrite=[[],[],[],[],[],[],[]],this.hasindirect=!1,this.writedepth=!1,this.hasmatrix=!1,this.samplers=[],this.tokens=[],this.header=new aglsl.Header}return Description}();aglsl.Description=Description}(aglsl||(aglsl={}));var aglsl;!function(aglsl){var Destination=function(){function Destination(){this.mask=0,this.regnum=0,this.regtype=0,this.dim=0}return Destination}();aglsl.Destination=Destination}(aglsl||(aglsl={}));var aglsl;!function(aglsl){var Mapping=function(){function Mapping(){}return Mapping.agal2glsllut=[new aglsl.OpLUT("%dest = %cast(%a);\n",0,!0,!0,!1,null,null,null,null,null,null),new aglsl.OpLUT("%dest = %cast(%a + %b);\n",0,!0,!0,!0,null,null,null,null,null,null),new aglsl.OpLUT("%dest = %cast(%a - %b);\n",0,!0,!0,!0,null,null,null,null,null,null),new aglsl.OpLUT("%dest = %cast(%a * %b);\n",0,!0,!0,!0,null,null,null,null,null,null),new aglsl.OpLUT("%dest = %cast(%a / %b);\n",0,!0,!0,!0,null,null,null,null,null,null),new aglsl.OpLUT("%dest = %cast(1.0) / %a;\n",0,!0,!0,!1,null,null,null,null,null,null),new aglsl.OpLUT("%dest = %cast(min(%a,%b));\n",0,!0,!0,!0,null,null,null,null,null,null),new aglsl.OpLUT("%dest = %cast(max(%a,%b));\n",0,!0,!0,!0,null,null,null,null,null,null),new aglsl.OpLUT("%dest = %cast(fract(%a));\n",0,!0,!0,!1,null,null,null,null,null,null),new aglsl.OpLUT("%dest = %cast(sqrt(abs(%a)));\n",0,!0,!0,!1,null,null,null,null,null,null),new aglsl.OpLUT("%dest = %cast(inversesqrt(abs(%a)));\n",0,!0,!0,!1,null,null,null,null,null,null),new aglsl.OpLUT("%dest = %cast(pow(abs(%a),%b));\n",0,!0,!0,!0,null,null,null,null,null,null),new aglsl.OpLUT("%dest = %cast(log2(abs(%a)));\n",0,!0,!0,!1,null,null,null,null,null,null),new aglsl.OpLUT("%dest = %cast(exp2(%a));\n",0,!0,!0,!1,null,null,null,null,null,null),new aglsl.OpLUT("%dest = %cast(normalize(vec3( %a ) ));\n",0,!0,!0,!1,null,null,!0,null,null,null),new aglsl.OpLUT("%dest = %cast(sin(%a));\n",0,!0,!0,!1,null,null,null,null,null,null),new aglsl.OpLUT("%dest = %cast(cos(%a));\n",0,!0,!0,!1,null,null,null,null,null,null),new aglsl.OpLUT("%dest = %cast(cross(vec3(%a),vec3(%b)));\n",0,!0,!0,!0,null,null,!0,null,null,null),new aglsl.OpLUT("%dest = %cast(dot(vec3(%a),vec3(%b)));\n",0,!0,!0,!0,null,null,!0,null,null,null),new aglsl.OpLUT("%dest = %cast(dot(vec4(%a),vec4(%b)));\n",0,!0,!0,!0,null,null,!0,null,null,null),new aglsl.OpLUT("%dest = %cast(abs(%a));\n",0,!0,!0,!1,null,null,null,null,null,null),new aglsl.OpLUT("%dest = %cast(%a * -1.0);\n",0,!0,!0,!1,null,null,null,null,null,null),new aglsl.OpLUT("%dest = %cast(clamp(%a,0.0,1.0));\n",0,!0,!0,!1,null,null,null,null,null,null),new aglsl.OpLUT("%dest = %cast(dot(vec3(%a),vec3(%b)));\n",null,!0,!0,!0,3,3,!0,null,null,null),new aglsl.OpLUT("%dest = %cast(dot(vec4(%a),vec4(%b)));\n",null,!0,!0,!0,4,4,!0,null,null,null),new aglsl.OpLUT("%dest = %cast(dot(vec4(%a),vec4(%b)));\n",null,!0,!0,!0,4,3,!0,null,null,null),new aglsl.OpLUT("%dest = %cast(dFdx(%a));\n",0,!0,!0,!1,null,null,null,null,null,null),new aglsl.OpLUT("%dest = %cast(dFdx(%a));\n",0,!0,!0,!1,null,null,null,null,null,null),new aglsl.OpLUT("if (float(%a)==float(%b)) {;\n",0,!1,!0,!0,null,null,null,!0,null,null),new aglsl.OpLUT("if (float(%a)!=float(%b)) {;\n",0,!1,!0,!0,null,null,null,!0,null,null),new aglsl.OpLUT("if (float(%a)>=float(%b)) {;\n",0,!1,!0,!0,null,null,null,!0,null,null),new aglsl.OpLUT("if (float(%a)0){var optsi=line.search(/<.*>/g),opts=null;-1!=optsi&&(opts=line.slice(optsi).match(/([\w\.\-\+]+)/gi),line=line.slice(0,optsi));var tokens=line.match(/([\w\.\+\[\]]+)/gi);if(!tokens||tokens.length<1)return line.length>=3&&console.log("Warning: bad line "+linenr+": "+line),void 0;switch(tokens[0]){case"part":this.addHeader(tokens[1],Number(tokens[2]));break;case"endpart":if(!this.cur)throw"Unexpected endpart";return this.cur.data.position=0,this.cur=null,void 0;default:if(!this.cur)return console.log("Warning: bad line "+linenr+": "+line+" (Outside of any part definition)"),void 0;if("comment"==this.cur.name)return;var op=assembler.OpcodeMap.map[tokens[0]];if(!op)throw"Bad opcode "+tokens[0]+" "+linenr+": "+line;this.emitOpcode(this.cur,op.opcode);var ti=1;if(op.dest&&"none"!=op.dest){if(!this.emitDest(this.cur,tokens[ti++],op.dest))throw"Bad destination register "+tokens[ti-1]+" "+linenr+": "+line}else this.emitZeroDword(this.cur);if(op.a&&"none"!=op.a.format){if(!this.emitSource(this.cur,tokens[ti++],op.a))throw"Bad source register "+tokens[ti-1]+" "+linenr+": "+line}else this.emitZeroQword(this.cur);if(op.b&&"none"!=op.b.format){if("sampler"==op.b.format){if(!this.emitSampler(this.cur,tokens[ti++],op.b,opts))throw"Bad sampler register "+tokens[ti-1]+" "+linenr+": "+line}else if(!this.emitSource(this.cur,tokens[ti++],op.b))throw"Bad source register "+tokens[ti-1]+" "+linenr+": "+line}else this.emitZeroQword(this.cur)}}},AGALMiniAssembler.prototype.emitHeader=function(pr){switch(pr.data.writeUnsignedByte(160),pr.data.writeUnsignedInt(pr.version),pr.version>=16&&pr.data.writeUnsignedByte(0),pr.data.writeUnsignedByte(161),pr.name){case"fragment":pr.data.writeUnsignedByte(1);break;case"vertex":pr.data.writeUnsignedByte(0);break;case"cpu":pr.data.writeUnsignedByte(2);break;default:pr.data.writeUnsignedByte(255)}},AGALMiniAssembler.prototype.emitOpcode=function(pr,opcode){pr.data.writeUnsignedInt(opcode)},AGALMiniAssembler.prototype.emitZeroDword=function(pr){pr.data.writeUnsignedInt(0)},AGALMiniAssembler.prototype.emitZeroQword=function(pr){pr.data.writeUnsignedInt(0),pr.data.writeUnsignedInt(0)},AGALMiniAssembler.prototype.emitDest=function(pr,token){var reg=token.match(/([fov]?[tpocidavs])(\d*)(\.[xyzw]{1,4})?/i);if(!assembler.RegMap.map[reg[1]])return!1;var em={num:reg[2]?reg[2]:0,code:assembler.RegMap.map[reg[1]].code,mask:this.stringToMask(reg[3])};return pr.data.writeUnsignedShort(em.num),pr.data.writeUnsignedByte(em.mask),pr.data.writeUnsignedByte(em.code),!0},AGALMiniAssembler.prototype.stringToMask=function(s){if(!s)return 15;var r=0;return-1!=s.indexOf("x")&&(r|=1),-1!=s.indexOf("y")&&(r|=2),-1!=s.indexOf("z")&&(r|=4),-1!=s.indexOf("w")&&(r|=8),r},AGALMiniAssembler.prototype.stringToSwizzle=function(s){if(!s)return 228;var chartoindex={x:0,y:1,z:2,w:3},sw=0;if("."!=s.charAt(0))throw"Missing . for swizzle";return s.length>1&&(sw|=chartoindex[s.charAt(1)]),sw|=s.length>2?chartoindex[s.charAt(2)]<<2:(3&sw)<<2,sw|=s.length>3?chartoindex[s.charAt(3)]<<4:(12&sw)<<2,sw|=s.length>4?chartoindex[s.charAt(4)]<<6:(48&sw)<<2},AGALMiniAssembler.prototype.emitSampler=function(pr,token,opsrc,opts){var reg=token.match(/fs(\d*)/i);if(!reg||!reg[1])return!1;pr.data.writeUnsignedShort(parseInt(reg[1])),pr.data.writeUnsignedByte(0),pr.data.writeUnsignedByte(0);for(var samplerbits=5,sampleroptset=0,i=0;i>o.shift&o.mask)&&console.log("Warning, duplicate sampler option"),sampleroptset|=o.mask<=16&&(bytes.readUnsignedByte(),header.version>>=1),161!=bytes.readUnsignedByte())throw"Bad AGAL: Missing 0xa1 magic byte.";switch(header.progid=bytes.readUnsignedByte(),header.progid){case 1:header.type="fragment";break;case 0:header.type="vertex";break;case 2:header.type="cpu";break;default:header.type=""}for(var desc=new aglsl.Description,tokens=[];bytes.position>4,s.readmode&=15,s.special=bytes.readUnsignedByte(),s.wrap=s.special>>4,s.special&=15,s.mipmap=bytes.readUnsignedByte(),s.filter=s.mipmap>>4,s.mipmap&=15,desc.samplers[s.regnum]=s):(s.indexregtype=bytes.readUnsignedByte(),s.indexselect=bytes.readUnsignedByte(),s.indirectflag=bytes.readUnsignedByte()),s.indirectflag&&(desc.hasindirect=!0),!s.indirectflag&&mh)for(var mhi=0;mh>mhi;mhi++)desc.regread[s.regtype][s.regnum+mhi]=desc.regread[s.regtype][s.regnum]},AGALTokenizer}();aglsl.AGALTokenizer=AGALTokenizer}(aglsl||(aglsl={}));var aglsl;!function(aglsl){var AGLSLParser=function(){function AGLSLParser(){}return AGLSLParser.prototype.parse=function(desc){var header="",body="";header+="precision highp float;\n";var tag=desc.header.type[0];if("vertex"==desc.header.type&&(header+="uniform float yflip;\n"),desc.hasindirect)header+="uniform vec4 "+tag+"carrr["+away.stagegl.ContextStage3D.maxvertexconstants+"];\n";else for(var i=0;isl;sl++){var line=" "+lutentry.s;if(desc.tokens[i].dest){if(lutentry.matrixheight){if(1!=(desc.tokens[i].dest.mask>>sl&1))continue;var destregstring=this.regtostring(desc.tokens[i].dest.regtype,desc.tokens[i].dest.regnum,desc,tag),destcaststring="float",destmaskstring=["x","y","z","w"][sl];destregstring+="."+destmaskstring}else{var destcaststring,destmaskstring,destregstring=this.regtostring(desc.tokens[i].dest.regtype,desc.tokens[i].dest.regnum,desc,tag);if(15!=desc.tokens[i].dest.mask){var ndest=0;switch(destmaskstring="",1&desc.tokens[i].dest.mask&&(ndest++,destmaskstring+="x"),2&desc.tokens[i].dest.mask&&(ndest++,destmaskstring+="y"),4&desc.tokens[i].dest.mask&&(ndest++,destmaskstring+="z"),8&desc.tokens[i].dest.mask&&(ndest++,destmaskstring+="w"),destregstring+="."+destmaskstring,ndest){case 1:destcaststring="float";break;case 2:destcaststring="vec2";break;case 3:destcaststring="vec3";break;default:throw"Unexpected destination mask"}}else destcaststring="vec4",destmaskstring="xyzw"}line=line.replace("%dest",destregstring),line=line.replace("%cast",destcaststring),line=line.replace("%dm",destmaskstring)}var dwm=15;if(!lutentry.ndwm&&lutentry.dest&&desc.tokens[i].dest&&(dwm=desc.tokens[i].dest.mask),desc.tokens[i].a&&(line=line.replace("%a",this.sourcetostring(desc.tokens[i].a,0,dwm,lutentry.scalar,desc,tag))),desc.tokens[i].b&&(line=line.replace("%b",this.sourcetostring(desc.tokens[i].b,sl,dwm,lutentry.scalar,desc,tag)),5==desc.tokens[i].b.regtype)){var texdim=["2D","Cube","3D"][desc.tokens[i].b.dim],texsize=["vec2","vec3","vec3"][desc.tokens[i].b.dim];line=line.replace("%texdim",texdim),line=line.replace("%texsize",texsize);var texlod="";line=line.replace("%lod",texlod)}body+=line}}return"vertex"==desc.header.type&&(body+=" gl_Position = vec4(outpos.x, outpos.y, outpos.z*2.0 - outpos.w, outpos.w);\n"),desc.writedepth&&(body+=" gl_FragDepth = clamp(tmp_FragDepth,0.0,1.0);\n"),body+="}\n",header+body},AGLSLParser.prototype.regtostring=function(regtype,regnum,desc,tag){switch(regtype){case 0:return"va"+regnum;case 1:return desc.hasindirect&&"vertex"==desc.header.type?"vcarrr["+regnum+"]":tag+"c"+regnum;case 2:return tag+"t"+regnum;case 3:return"vertex"==desc.header.type?"outpos":"gl_FragColor";case 4:return"vi"+regnum;case 5:return"fs"+regnum;case 6:return"tmp_FragDepth";default:throw"Unknown register type"}},AGLSLParser.prototype.sourcetostring=function(s,subline,dwm,isscalar,desc,tag){var r,swiz=["x","y","z","w"];if(s.indirectflag){r="vcarrr[int("+this.regtostring(s.indexregtype,s.regnum,desc,tag)+"."+swiz[s.indexselect]+")";var realofs=subline+s.indexoffset;0>realofs&&(r+=realofs.toString()),realofs>0&&(r+="+"+realofs.toString()),r+="]"}else r=this.regtostring(s.regtype,s.regnum+subline,desc,tag);return 5==s.regtype?r:isscalar?r+"."+swiz[s.swizzle>>0&3]:228==s.swizzle&&15==dwm?r:(r+=".",1&dwm&&(r+=swiz[s.swizzle>>0&3]),2&dwm&&(r+=swiz[s.swizzle>>2&3]),4&dwm&&(r+=swiz[s.swizzle>>4&3]),8&dwm&&(r+=swiz[s.swizzle>>6&3]),r)},AGLSLParser}();aglsl.AGLSLParser=AGLSLParser}(aglsl||(aglsl={}));var __extends=this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);__.prototype=b.prototype,d.prototype=new __},away;!function(away){!function(events){var AnimatorEvent=function(_super){function AnimatorEvent(type,animator){_super.call(this,type),this._animator=animator}return __extends(AnimatorEvent,_super),Object.defineProperty(AnimatorEvent.prototype,"animator",{get:function(){return this._animator},enumerable:!0,configurable:!0}),AnimatorEvent.prototype.clone=function(){return new AnimatorEvent(this.type,this._animator)},AnimatorEvent.START="start",AnimatorEvent.STOP="stop",AnimatorEvent.CYCLE_COMPLETE="cycle_complete",AnimatorEvent}(events.Event);events.AnimatorEvent=AnimatorEvent}(away.events||(away.events={}));away.events}(away||(away={}));var away;!function(away){!function(events){var ShadingMethodEvent=function(_super){function ShadingMethodEvent(type){_super.call(this,type)}return __extends(ShadingMethodEvent,_super),ShadingMethodEvent.SHADER_INVALIDATED="ShaderInvalidated",ShadingMethodEvent}(away.events.Event);events.ShadingMethodEvent=ShadingMethodEvent}(away.events||(away.events={}));away.events}(away||(away={}));var away;!function(away){!function(errors){var AnimationSetError=function(_super){function AnimationSetError(message){_super.call(this,message)}return __extends(AnimationSetError,_super),AnimationSetError}(errors.Error);errors.AnimationSetError=AnimationSetError}(away.errors||(away.errors={}));away.errors}(away||(away={}));var away;!function(away){!function(_pool){var SubGeometryEvent=away.events.SubGeometryEvent,RenderableBase=function(){function RenderableBase(pool,sourceEntity,materialOwner,level,indexOffset){"undefined"==typeof level&&(level=0),"undefined"==typeof indexOffset&&(indexOffset=0);var _this=this;this._geometryDirty=!0,this._indexDataDirty=!0,this._vertexData=new Object,this._pVertexDataDirty=new Object,this._vertexOffset=new Object,this._onIndicesUpdatedDelegate=function(event){return _this._onIndicesUpdated(event)},this._onVerticesUpdatedDelegate=function(event){return _this._onVerticesUpdated(event)},this._pool=pool,this._level=level,this._indexOffset=indexOffset,this.sourceEntity=sourceEntity,this.materialOwner=materialOwner}return Object.defineProperty(RenderableBase.prototype,"overflow",{get:function(){return this._indexDataDirty&&this._updateIndexData(),this._overflow},enumerable:!0,configurable:!0}),Object.defineProperty(RenderableBase.prototype,"numTriangles",{get:function(){return this._numTriangles},enumerable:!0,configurable:!0}),RenderableBase.prototype.getIndexData=function(){return this._indexDataDirty&&this._updateIndexData(),this._indexData},RenderableBase.prototype.getVertexData=function(dataType){return this._indexDataDirty&&this._updateIndexData(),this._pVertexDataDirty[dataType]&&this._updateVertexData(dataType),this._vertexData[this._concatenateArrays?away.base.TriangleSubGeometry.VERTEX_DATA:dataType]},RenderableBase.prototype.getVertexOffset=function(dataType){return this._indexDataDirty&&this._updateIndexData(),this._pVertexDataDirty[dataType]&&this._updateVertexData(dataType),this._vertexOffset[dataType]},RenderableBase.prototype.dispose=function(){this._pool.disposeItem(this.materialOwner),this._indexData.dispose(),this._indexData=null;for(var dataType in this._vertexData)this._vertexData[dataType].dispose(),this._vertexData[dataType]=null;this._overflow&&(this._overflow.dispose(),this._overflow=null)},RenderableBase.prototype.invalidateGeometry=function(){this._geometryDirty=!0,0==this._level&&(this._indexDataDirty=!0),this._overflow&&this._overflow.invalidateGeometry()},RenderableBase.prototype.invalidateIndexData=function(){this._indexDataDirty=!0},RenderableBase.prototype.invalidateVertexData=function(dataType){this._pVertexDataDirty[dataType]=!0},RenderableBase.prototype._pGetSubGeometry=function(){throw new away.errors.AbstractMethodError},RenderableBase.prototype._iFillIndexData=function(indexOffset){this._geometryDirty&&this._updateGeometry(),this._indexData=away.pool.IndexDataPool.getItem(this._subGeometry,this._level,indexOffset),this._numTriangles=this._indexData.data.length/3,indexOffset=this._indexData.offset,indexOffseti&&outIndex+3j;j++)originalIndex=indices[i+j],this.indexMappings[originalIndex]>=0?splitIndex=this.indexMappings[originalIndex]:(splitIndex=k++,this.indexMappings[originalIndex]=splitIndex,this.originalIndices.push(originalIndex)),splitIndices[outIndex+j]=splitIndex;outIndex+=3,i+=3}this.setData(splitIndices),this.offset=i}},IndexData.prototype.invalidateData=function(){this._dataDirty=!0},IndexData.prototype.dispose=function(){for(var i=0;8>i;++i)this.contexts[i]&&(this.contexts[i].disposeIndexData(this),this.contexts[i]=null)},IndexData.prototype.disposeBuffers=function(){for(var i=0;8>i;++i)this.buffers[i]&&(this.buffers[i].dispose(),this.buffers[i]=null)},IndexData.prototype.invalidateBuffers=function(){for(var i=0;8>i;++i)this.invalid[i]=!0},IndexData.prototype.setData=function(data){this.data&&this.data.length!=data.length?this.disposeBuffers():this.invalidateBuffers(),this.data=data},IndexData.LIMIT_VERTS=65535,IndexData.LIMIT_INDICES=16777215,IndexData}();pool.IndexData=IndexData}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(pool){var IndexDataPool=function(){function IndexDataPool(){}return IndexDataPool.getItem=function(subGeometry,level,indexOffset){var subGeometryData=IndexDataPool._pool[subGeometry.id]||(IndexDataPool._pool[subGeometry.id]=new Array),indexData=subGeometryData[level]||(subGeometryData[level]=new pool.IndexData(level));return indexData.updateData(indexOffset,subGeometry.indices,subGeometry.numVertices),indexData},IndexDataPool.disposeItem=function(id,level){var subGeometryData=this._pool[id];subGeometryData[level].dispose(),subGeometryData[level]=null},IndexDataPool.prototype.disposeData=function(id){for(var subGeometryData=IndexDataPool._pool[id],len=subGeometryData.length,i=0;len>i;i++)subGeometryData[i].dispose(),subGeometryData[i]=null;IndexDataPool._pool[id]=null},IndexDataPool._pool=new Object,IndexDataPool}();pool.IndexDataPool=IndexDataPool}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(_pool){var LineSubGeometry=away.base.LineSubGeometry,LineSubMeshRenderable=function(_super){function LineSubMeshRenderable(pool,subMesh,level,indexOffset){"undefined"==typeof level&&(level=0),"undefined"==typeof indexOffset&&(indexOffset=0),_super.call(this,pool,subMesh.parentMesh,subMesh,level,indexOffset),this.subMesh=subMesh}return __extends(LineSubMeshRenderable,_super),LineSubMeshRenderable.prototype._pGetSubGeometry=function(){var subGeometry=this.subMesh.subGeometry;return this._pVertexDataDirty[LineSubGeometry.START_POSITION_DATA]=!0,this._pVertexDataDirty[LineSubGeometry.END_POSITION_DATA]=!0,subGeometry.thickness&&(this._pVertexDataDirty[LineSubGeometry.THICKNESS_DATA]=!0),subGeometry.startColors&&(this._pVertexDataDirty[LineSubGeometry.COLOR_DATA]=!0),subGeometry},LineSubMeshRenderable.prototype._pGetOverflowRenderable=function(pool,materialOwner,level,indexOffset){return new LineSubMeshRenderable(pool,materialOwner,level,indexOffset)},LineSubMeshRenderable.id="linesubmesh",LineSubMeshRenderable}(_pool.RenderableBase);_pool.LineSubMeshRenderable=LineSubMeshRenderable}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(_pool){var ProgramData=function(){function ProgramData(pool,context,key){this.usages=0,this._pool=pool,this.context=context,this._key=key,this.context.registerProgram(this)}return ProgramData.prototype.dispose=function(){this.usages--,this.usages||(this._pool.disposeItem(this._key),this.context.unRegisterProgram(this),this.program&&this.program.dispose()),this.program=null},ProgramData.PROGRAMDATA_ID_COUNT=0,ProgramData}();_pool.ProgramData=ProgramData}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(pool){var ProgramDataPool=function(){function ProgramDataPool(context){this._pool=new Object,this._context=context}return ProgramDataPool.prototype.getItem=function(key){return this._pool[key]||(this._pool[key]=new pool.ProgramData(this,this._context,key))},ProgramDataPool.prototype.disposeItem=function(key){this._pool[key]=null},ProgramDataPool}();pool.ProgramDataPool=ProgramDataPool}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(_pool){var TriangleSubGeometry=away.base.TriangleSubGeometry,SkyboxRenderable=function(_super){function SkyboxRenderable(pool,skybox){_super.call(this,pool,skybox,skybox)}return __extends(SkyboxRenderable,_super),SkyboxRenderable.prototype._pGetSubGeometry=function(){var geometry=SkyboxRenderable._geometry;return geometry||(geometry=SkyboxRenderable._geometry=new TriangleSubGeometry(!0),geometry.autoDeriveNormals=!1,geometry.autoDeriveTangents=!1,geometry.updateIndices(Array(0,1,2,2,3,0,6,5,4,4,7,6,2,6,7,7,3,2,4,5,1,1,0,4,4,0,3,3,7,4,2,1,5,5,6,2)),geometry.updatePositions(Array(-1,1,-1,1,1,-1,1,1,1,-1,1,1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1))),this._pVertexDataDirty[TriangleSubGeometry.POSITION_DATA]=!0,geometry},SkyboxRenderable.id="skybox",SkyboxRenderable}(_pool.RenderableBase);_pool.SkyboxRenderable=SkyboxRenderable}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(_pool){var MaterialData=function(){function MaterialData(pool,context,material){this.invalidAnimation=!0,this._pool=pool,this.context=context,this.material=material,this._materialPassDataPool=new _pool.MaterialPassDataPool(material)}return MaterialData.prototype.getMaterialPass=function(materialPass,profile){var materialPassData=this._materialPassDataPool.getItem(materialPass);if(materialPassData.shaderObject||(materialPassData.shaderObject=materialPass.createShaderObject(profile),materialPassData.invalid=!0),materialPassData.invalid){materialPassData.invalid=!1;var compiler=materialPassData.shaderObject.createCompiler(this.material,materialPass);compiler.compile(),materialPassData.shadedTarget=compiler.shadedTarget,materialPassData.vertexCode=compiler.vertexCode,materialPassData.fragmentCode=compiler.fragmentCode,materialPassData.postAnimationFragmentCode=compiler.postAnimationFragmentCode,materialPassData.key=""}return materialPassData},MaterialData.prototype.getMaterialPasses=function(profile){if(null==this._passes){var passes=this.material._iScreenPasses,numPasses=passes.length;this._passes=new Array(numPasses);for(var i=0;numPasses>i;i++)this._passes[i]=this.getMaterialPass(passes[i],profile)}return this._passes},MaterialData.prototype.dispose=function(){this._materialPassDataPool.disposePool(),this._materialPassDataPool=null,this._pool.disposeItem(this.material),this._passes=null},MaterialData.prototype.invalidateMaterial=function(){this._passes=null,this.invalidateAnimation()},MaterialData.prototype.invalidateAnimation=function(){this.invalidAnimation=!0},MaterialData}();_pool.MaterialData=MaterialData}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(pool){var MaterialDataPool=function(){function MaterialDataPool(context){this._pool=new Object,this._context=context}return MaterialDataPool.prototype.getItem=function(material){return this._pool[material.id]||(this._pool[material.id]=material._iAddMaterialData(new pool.MaterialData(this,this._context,material)))},MaterialDataPool.prototype.disposeItem=function(material){material._iRemoveMaterialData(this._pool[material.id]),this._pool[material.id]=null},MaterialDataPool}();pool.MaterialDataPool=MaterialDataPool}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(_pool){var MaterialPassData=function(){function MaterialPassData(pool,material,materialPass){this.animationVertexCode="",this.animationFragmentCode="",this._pool=pool,this.material=material,this.materialPass=materialPass}return MaterialPassData.prototype.dispose=function(){this._pool.disposeItem(this.materialPass),this.shaderObject.dispose(),this.shaderObject=null,this.programData.dispose(),this.programData=null},MaterialPassData.prototype.invalidate=function(){this.invalid=!0},MaterialPassData}();_pool.MaterialPassData=MaterialPassData}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(pool){var MaterialPassDataPool=function(){function MaterialPassDataPool(material){this._pool=new Object,this._material=material}return MaterialPassDataPool.prototype.getItem=function(materialPass){return this._pool[materialPass.id]||(this._pool[materialPass.id]=this._material._iAddMaterialPassData(materialPass._iAddMaterialPassData(new pool.MaterialPassData(this,this._material,materialPass))))},MaterialPassDataPool.prototype.disposeItem=function(materialPass){materialPass._iRemoveMaterialPassData(this._pool[materialPass.id]),delete this._pool[materialPass.id]},MaterialPassDataPool.prototype.disposePool=function(){for(var id in this._pool)this._pool[id].materialPass._iRemoveMaterialPassData(this._pool[id]);delete this._pool},MaterialPassDataPool}();pool.MaterialPassDataPool=MaterialPassDataPool}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(_pool){var TextureData=function(){function TextureData(pool,context,textureProxy){this._pool=pool,this.context=context,this.textureProxy=textureProxy}return TextureData.prototype.dispose=function(){this._pool.disposeItem(this.textureProxy),this.texture.dispose(),this.texture=null},TextureData.prototype.invalidate=function(){this.invalid=!0},TextureData}();_pool.TextureData=TextureData}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(pool){var TextureDataPool=function(){function TextureDataPool(context){this._pool=new Object,this._context=context}return TextureDataPool.prototype.getItem=function(textureProxy){return this._pool[textureProxy.id]||(this._pool[textureProxy.id]=textureProxy._iAddTextureData(new pool.TextureData(this,this._context,textureProxy)))},TextureDataPool.prototype.disposeItem=function(textureProxy){textureProxy._iRemoveTextureData(this._pool[textureProxy.id]),this._pool[textureProxy.id]=null},TextureDataPool}();pool.TextureDataPool=TextureDataPool}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(_pool){var TriangleSubGeometry=away.base.TriangleSubGeometry,TriangleSubMeshRenderable=function(_super){function TriangleSubMeshRenderable(pool,subMesh,level,indexOffset){"undefined"==typeof level&&(level=0),"undefined"==typeof indexOffset&&(indexOffset=0),_super.call(this,pool,subMesh.parentMesh,subMesh,level,indexOffset),this.subMesh=subMesh}return __extends(TriangleSubMeshRenderable,_super),TriangleSubMeshRenderable.prototype._pGetSubGeometry=function(){var subGeometry;switch(subGeometry=this.subMesh.animator?this.subMesh.animator.getRenderableSubGeometry(this,this.subMesh.subGeometry):this.subMesh.subGeometry,this._pVertexDataDirty[TriangleSubGeometry.POSITION_DATA]=!0,subGeometry.vertexNormals&&(this._pVertexDataDirty[TriangleSubGeometry.NORMAL_DATA]=!0),subGeometry.vertexTangents&&(this._pVertexDataDirty[TriangleSubGeometry.TANGENT_DATA]=!0),subGeometry.uvs&&(this._pVertexDataDirty[TriangleSubGeometry.UV_DATA]=!0),subGeometry.secondaryUVs&&(this._pVertexDataDirty[TriangleSubGeometry.SECONDARY_UV_DATA]=!0),subGeometry.jointIndices&&(this._pVertexDataDirty[TriangleSubGeometry.JOINT_INDEX_DATA]=!0),subGeometry.jointWeights&&(this._pVertexDataDirty[TriangleSubGeometry.JOINT_WEIGHT_DATA]=!0),subGeometry.jointsPerVertex){case 1:this.JOINT_INDEX_FORMAT=this.JOINT_WEIGHT_FORMAT=away.stagegl.ContextGLVertexBufferFormat.FLOAT_1;break;case 2:this.JOINT_INDEX_FORMAT=this.JOINT_WEIGHT_FORMAT=away.stagegl.ContextGLVertexBufferFormat.FLOAT_2;break;case 3:this.JOINT_INDEX_FORMAT=this.JOINT_WEIGHT_FORMAT=away.stagegl.ContextGLVertexBufferFormat.FLOAT_3;break;case 4:this.JOINT_INDEX_FORMAT=this.JOINT_WEIGHT_FORMAT=away.stagegl.ContextGLVertexBufferFormat.FLOAT_4}return subGeometry},TriangleSubMeshRenderable.prototype._pGetOverflowRenderable=function(pool,materialOwner,level,indexOffset){return new TriangleSubMeshRenderable(pool,materialOwner,level,indexOffset)},TriangleSubMeshRenderable.id="trianglesubmesh",TriangleSubMeshRenderable}(_pool.RenderableBase);_pool.TriangleSubMeshRenderable=TriangleSubMeshRenderable}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(pool){var SubGeometryBase=away.base.SubGeometryBase,SubGeometryEvent=away.events.SubGeometryEvent,VertexData=function(){function VertexData(subGeometry,dataType){var _this=this;this._dataDirty=!0,this.invalid=new Array(8),this.buffers=new Array(8),this.contexts=new Array(8),this._subGeometry=subGeometry,this._dataType=dataType,this._onVerticesUpdatedDelegate=function(event){return _this._onVerticesUpdated(event)},this._subGeometry.addEventListener(SubGeometryEvent.VERTICES_UPDATED,this._onVerticesUpdatedDelegate)}return VertexData.prototype.updateData=function(originalIndices,indexMappings){if("undefined"==typeof originalIndices&&(originalIndices=null),"undefined"==typeof indexMappings&&(indexMappings=null),this._dataDirty){this._dataDirty=!1,this.dataPerVertex=this._subGeometry.getStride(this._dataType);var vertices=this._subGeometry[this._dataType];if(null==indexMappings)this.setData(vertices);else{for(var originalIndex,splitIndex,splitVerts=new Array(originalIndices.length*this.dataPerVertex),i=0,j=0;ii;++i)this.contexts[i]&&(this.contexts[i].disposeVertexData(this),this.contexts[i]=null)},VertexData.prototype.disposeBuffers=function(){for(var i=0;8>i;++i)this.buffers[i]&&(this.buffers[i].dispose(),this.buffers[i]=null)},VertexData.prototype.invalidateBuffers=function(){for(var i=0;8>i;++i)this.invalid[i]=!0},VertexData.prototype.setData=function(data){this.data&&this.data.length!=data.length?this.disposeBuffers():this.invalidateBuffers(),this.data=data},VertexData.prototype._onVerticesUpdated=function(event){var dataType=this._subGeometry.concatenateArrays?SubGeometryBase.VERTEX_DATA:event.dataType;dataType==this._dataType&&(this._dataDirty=!0)},VertexData}();pool.VertexData=VertexData}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(pool){var SubGeometryBase=away.base.SubGeometryBase,VertexDataPool=function(){function VertexDataPool(){}return VertexDataPool.getItem=function(subGeometry,indexData,dataType){subGeometry.concatenateArrays&&(dataType=SubGeometryBase.VERTEX_DATA);var subGeometryDictionary=VertexDataPool._pool[subGeometry.id]||(VertexDataPool._pool[subGeometry.id]=new Object),subGeometryData=subGeometryDictionary[dataType]||(subGeometryDictionary[dataType]=new Array),vertexData=subGeometryData[indexData.level]||(subGeometryData[indexData.level]=new pool.VertexData(subGeometry,dataType));return vertexData.updateData(indexData.originalIndices,indexData.indexMappings),vertexData},VertexDataPool.disposeItem=function(subGeometry,level,dataType){var subGeometryDictionary=VertexDataPool._pool[subGeometry.id],subGeometryData=subGeometryDictionary[dataType];subGeometryData[level].dispose(),subGeometryData[level]=null},VertexDataPool.prototype.disposeData=function(subGeometry){var subGeometryDictionary=VertexDataPool._pool[subGeometry.id];for(var key in subGeometryDictionary)for(var subGeometryData=subGeometryDictionary[key],len=subGeometryData.length,i=0;len>i;i++)subGeometryData[i].dispose(),subGeometryData[i]=null;VertexDataPool._pool[subGeometry.id]=null},VertexDataPool._pool=new Object,VertexDataPool}();pool.VertexDataPool=VertexDataPool}(away.pool||(away.pool={}));away.pool}(away||(away={}));var away;!function(away){!function(stagegl){var AbstractMethodError=away.errors.AbstractMethodError,TextureDataPool=away.pool.TextureDataPool,ProgramDataPool=away.pool.ProgramDataPool,MaterialDataPool=away.pool.MaterialDataPool,RenderTexture=away.textures.RenderTexture,ContextGLBase=function(){function ContextGLBase(stageIndex){this._programData=new Array,this._numUsedStreams=0,this._numUsedTextures=0,this._stageIndex=-1,this._antiAlias=0,this._renderTarget=null,this._renderSurfaceSelector=0,this._stageIndex=stageIndex,this._texturePool=new TextureDataPool(this),this._materialDataPool=new MaterialDataPool(this),this._programDataPool=new ProgramDataPool(this)}return Object.defineProperty(ContextGLBase.prototype,"container",{get:function(){return this._pContainer},enumerable:!0,configurable:!0}),ContextGLBase.prototype.setRenderTarget=function(target,enableDepthAndStencil,surfaceSelector){"undefined"==typeof enableDepthAndStencil&&(enableDepthAndStencil=!1),"undefined"==typeof surfaceSelector&&(surfaceSelector=0),(this._renderTarget!==target||surfaceSelector!=this._renderSurfaceSelector||this._enableDepthAndStencil!=enableDepthAndStencil)&&(this._renderTarget=target,this._renderSurfaceSelector=surfaceSelector,this._enableDepthAndStencil=enableDepthAndStencil,target instanceof RenderTexture?this.setRenderToTexture(this.getRenderTexture(target),enableDepthAndStencil,this._antiAlias,surfaceSelector):(this.setRenderToBackBuffer(),this.configureBackBuffer(this._width,this._height,this._antiAlias,this._enableDepthAndStencil)))},ContextGLBase.prototype.getRenderTexture=function(textureProxy){var textureData=this._texturePool.getItem(textureProxy);return textureData.texture||(textureData.texture=this.createTexture(textureProxy.width,textureProxy.height,stagegl.ContextGLTextureFormat.BGRA,!0)),textureData.texture},ContextGLBase.prototype.getProgram=function(materialPassData){if(materialPassData.key.length)return materialPassData.programData;materialPassData.key=materialPassData.animationVertexCode+materialPassData.vertexCode+"---"+materialPassData.fragmentCode+materialPassData.animationFragmentCode+materialPassData.postAnimationFragmentCode;var programData=this._programDataPool.getItem(materialPassData.key);return materialPassData.programData!=programData&&(materialPassData.programData&&materialPassData.programData.dispose(),materialPassData.programData=programData,programData.usages++),programData},ContextGLBase.prototype.getMaterial=function(material,profile){var materialData=this._materialDataPool.getItem(material);if(materialData.invalidAnimation){materialData.invalidAnimation=!1;for(var materialPassData,materialDataPasses=materialData.getMaterialPasses(profile),enabledGPUAnimation=this.getEnabledGPUAnimation(material,materialDataPasses),renderOrderId=0,mult=1,len=materialDataPasses.length,i=0;len>i;i++)materialPassData=materialDataPasses[i],materialPassData.usesAnimation!=enabledGPUAnimation&&(materialPassData.usesAnimation=enabledGPUAnimation,""==materialPassData.key),""==materialPassData.key&&this.calcAnimationCode(material,materialPassData),renderOrderId+=this.getProgram(materialPassData).id*mult,mult*=1e3;materialData.renderOrderId=renderOrderId}return materialData},ContextGLBase.prototype.activateBuffer=function(index,buffer,offset,format){buffer.contexts[this._stageIndex]||(buffer.contexts[this._stageIndex]=this),buffer.buffers[this._stageIndex]||(buffer.buffers[this._stageIndex]=this.createVertexBuffer(buffer.data.length/buffer.dataPerVertex,buffer.dataPerVertex),buffer.invalid[this._stageIndex]=!0),buffer.invalid[this._stageIndex]&&(buffer.buffers[this._stageIndex].uploadFromArray(buffer.data,0,buffer.data.length/buffer.dataPerVertex),buffer.invalid[this._stageIndex]=!1),this.setVertexBufferAt(index,buffer.buffers[this._stageIndex],offset,format)},ContextGLBase.prototype.disposeVertexData=function(buffer){buffer.buffers[this._stageIndex].dispose(),buffer.buffers[this._stageIndex]=null},ContextGLBase.prototype.activateRenderTexture=function(index,textureProxy){this.setTextureAt(index,this.getRenderTexture(textureProxy))},ContextGLBase.prototype.activateMaterialPass=function(materialPassData,stage,camera){for(var shaderObject=materialPassData.shaderObject,i=shaderObject.numUsedStreams;ii;i++)textureData.texture.uploadFromData(mipmapData[i],i);else textureData.texture.uploadFromData(textureProxy._iGetTextureData(),0);this.setTextureAt(index,textureData.texture)},ContextGLBase.prototype.activateCubeTexture=function(index,textureProxy){var textureData=this._texturePool.getItem(textureProxy);if(textureData.texture||(textureData.texture=this.createCubeTexture(textureProxy.size,stagegl.ContextGLTextureFormat.BGRA,!1),textureData.invalid=!0),textureData.invalid){textureData.invalid=!1;for(var i=0;6>i;++i)if(textureProxy.generateMipmaps)for(var mipmapData=textureProxy._iGetMipmapData(i),len=mipmapData.length,j=0;len>j;j++)textureData.texture.uploadFromData(mipmapData[j],i,j);else textureData.texture.uploadFromData(textureProxy._iGetTextureData(i),i,0)}this.setTextureAt(index,textureData.texture)},ContextGLBase.prototype.getIndexBuffer=function(buffer){return buffer.contexts[this._stageIndex]||(buffer.contexts[this._stageIndex]=this),buffer.buffers[this._stageIndex]||(buffer.buffers[this._stageIndex]=this.createIndexBuffer(buffer.data.length),buffer.invalid[this._stageIndex]=!0),buffer.invalid[this._stageIndex]&&(buffer.buffers[this._stageIndex].uploadFromArray(buffer.data,0,buffer.data.length),buffer.invalid[this._stageIndex]=!1),buffer.buffers[this._stageIndex]},ContextGLBase.prototype.disposeIndexData=function(buffer){buffer.buffers[this._stageIndex].dispose(),buffer.buffers[this._stageIndex]=null},ContextGLBase.prototype.clear=function(red,green,blue,alpha,depth,stencil,mask){"undefined"==typeof red&&(red=0),"undefined"==typeof green&&(green=0),"undefined"==typeof blue&&(blue=0),"undefined"==typeof alpha&&(alpha=1),"undefined"==typeof depth&&(depth=1),"undefined"==typeof stencil&&(stencil=0),"undefined"==typeof mask&&(mask=stagegl.ContextGLClearMask.ALL)},ContextGLBase.prototype.configureBackBuffer=function(width,height,antiAlias,enableDepthAndStencil){"undefined"==typeof enableDepthAndStencil&&(enableDepthAndStencil=!0),this._width=width,this._height=height},ContextGLBase.prototype.createIndexBuffer=function(){throw new AbstractMethodError},ContextGLBase.prototype.createVertexBuffer=function(){throw new AbstractMethodError},ContextGLBase.prototype.createTexture=function(width,height,format,optimizeForRenderToTexture,streamingLevels){throw"undefined"==typeof streamingLevels&&(streamingLevels=0),new AbstractMethodError},ContextGLBase.prototype.createCubeTexture=function(size,format,optimizeForRenderToTexture,streamingLevels){throw"undefined"==typeof streamingLevels&&(streamingLevels=0),new AbstractMethodError},ContextGLBase.prototype.createProgram=function(){throw new AbstractMethodError},ContextGLBase.prototype.dispose=function(){},ContextGLBase.prototype.present=function(){},ContextGLBase.prototype.setRenderToTexture=function(target,enableDepthAndStencil,antiAlias,surfaceSelector){"undefined"==typeof enableDepthAndStencil&&(enableDepthAndStencil=!1),"undefined"==typeof antiAlias&&(antiAlias=0),"undefined"==typeof surfaceSelector&&(surfaceSelector=0)},ContextGLBase.prototype.setRenderToBackBuffer=function(){},ContextGLBase.prototype.setScissorRectangle=function(){},ContextGLBase.prototype.setTextureAt=function(){},ContextGLBase.prototype.setVertexBufferAt=function(index,buffer,bufferOffset,format){"undefined"==typeof bufferOffset&&(bufferOffset=0),"undefined"==typeof format&&(format=null)},ContextGLBase.prototype.setProgram=function(){},ContextGLBase.prototype.registerProgram=function(programData){for(var i=0;null!=this._programData[i];)i++;this._programData[i]=programData,programData.id=i},ContextGLBase.prototype.unRegisterProgram=function(programData){this._programData[programData.id]=null,programData.id=-1},ContextGLBase.prototype.getEnabledGPUAnimation=function(material,materialDataPasses){if(material.animationSet){material.animationSet.resetGPUCompatibility();for(var owners=material.iOwners,numOwners=owners.length,len=materialDataPasses.length,i=0;len>i;i++)for(var j=0;numOwners>j;j++)owners[j].animator&&owners[j].animator.testGPUCompatibility(materialDataPasses[i].shaderObject);return!material.animationSet.usesCPU}return!1},ContextGLBase.prototype.calcAnimationCode=function(material,materialPassData){materialPassData.key="",materialPassData.animationVertexCode="",materialPassData.animationFragmentCode="";var shaderObject=materialPassData.shaderObject;if(materialPassData.usesAnimation){var animationSet=material.animationSet;materialPassData.animationVertexCode+=animationSet.getAGALVertexCode(shaderObject),shaderObject.uvDependencies>0&&!shaderObject.usesUVTransform&&(materialPassData.animationVertexCode+=animationSet.getAGALUVCode(shaderObject)),shaderObject.usesFragmentAnimation&&(materialPassData.animationFragmentCode+=animationSet.getAGALFragmentCode(shaderObject,materialPassData.shadedTarget)),animationSet.doneAGALCode(shaderObject)}else{for(var len=shaderObject.animatableAttributes.length,i=0;len>i;++i)materialPassData.animationVertexCode+="mov "+shaderObject.animationTargetRegisters[i]+", "+shaderObject.animatableAttributes[i]+"\n";shaderObject.uvDependencies>0&&!shaderObject.usesUVTransform&&(materialPassData.animationVertexCode+="mov "+shaderObject.uvTarget+","+shaderObject.uvSource+"\n")}},ContextGLBase}();stagegl.ContextGLBase=ContextGLBase}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var ContextGLClearMask=function(){function ContextGLClearMask(){}return ContextGLClearMask.COLOR=1,ContextGLClearMask.DEPTH=2,ContextGLClearMask.STENCIL=4,ContextGLClearMask.ALL=ContextGLClearMask.COLOR|ContextGLClearMask.DEPTH|ContextGLClearMask.STENCIL,ContextGLClearMask}();stagegl.ContextGLClearMask=ContextGLClearMask}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var ContextGLTextureFormat=function(){function ContextGLTextureFormat(){}return ContextGLTextureFormat.BGRA="bgra",ContextGLTextureFormat.BGRA_PACKED="bgraPacked4444",ContextGLTextureFormat.BGR_PACKED="bgrPacked565",ContextGLTextureFormat.COMPRESSED="compressed",ContextGLTextureFormat.COMPRESSED_ALPHA="compressedAlpha",ContextGLTextureFormat}();stagegl.ContextGLTextureFormat=ContextGLTextureFormat}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var ContextGLTriangleFace=function(){function ContextGLTriangleFace(){}return ContextGLTriangleFace.BACK="back",ContextGLTriangleFace.FRONT="front",ContextGLTriangleFace.FRONT_AND_BACK="frontAndBack",ContextGLTriangleFace.NONE="none",ContextGLTriangleFace}();stagegl.ContextGLTriangleFace=ContextGLTriangleFace}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var ContextGLVertexBufferFormat=function(){function ContextGLVertexBufferFormat(){}return ContextGLVertexBufferFormat.BYTES_4="bytes4",ContextGLVertexBufferFormat.FLOAT_1="float1",ContextGLVertexBufferFormat.FLOAT_2="float2",ContextGLVertexBufferFormat.FLOAT_3="float3",ContextGLVertexBufferFormat.FLOAT_4="float4",ContextGLVertexBufferFormat -}();stagegl.ContextGLVertexBufferFormat=ContextGLVertexBufferFormat}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var ContextGLProgramType=function(){function ContextGLProgramType(){}return ContextGLProgramType.FRAGMENT="fragment",ContextGLProgramType.VERTEX="vertex",ContextGLProgramType}();stagegl.ContextGLProgramType=ContextGLProgramType}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var ContextGLBlendFactor=function(){function ContextGLBlendFactor(){}return ContextGLBlendFactor.DESTINATION_ALPHA="destinationAlpha",ContextGLBlendFactor.DESTINATION_COLOR="destinationColor",ContextGLBlendFactor.ONE="one",ContextGLBlendFactor.ONE_MINUS_DESTINATION_ALPHA="oneMinusDestinationAlpha",ContextGLBlendFactor.ONE_MINUS_DESTINATION_COLOR="oneMinusDestinationColor",ContextGLBlendFactor.ONE_MINUS_SOURCE_ALPHA="oneMinusSourceAlpha",ContextGLBlendFactor.ONE_MINUS_SOURCE_COLOR="oneMinusSourceColor",ContextGLBlendFactor.SOURCE_ALPHA="sourceAlpha",ContextGLBlendFactor.SOURCE_COLOR="sourceColor",ContextGLBlendFactor.ZERO="zero",ContextGLBlendFactor}();stagegl.ContextGLBlendFactor=ContextGLBlendFactor}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var ContextGLCompareMode=function(){function ContextGLCompareMode(){}return ContextGLCompareMode.ALWAYS="always",ContextGLCompareMode.EQUAL="equal",ContextGLCompareMode.GREATER="greater",ContextGLCompareMode.GREATER_EQUAL="greaterEqual",ContextGLCompareMode.LESS="less",ContextGLCompareMode.LESS_EQUAL="lessEqual",ContextGLCompareMode.NEVER="never",ContextGLCompareMode.NOT_EQUAL="notEqual",ContextGLCompareMode}();stagegl.ContextGLCompareMode=ContextGLCompareMode}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var ContextGLMipFilter=function(){function ContextGLMipFilter(){}return ContextGLMipFilter.MIPLINEAR="miplinear",ContextGLMipFilter.MIPNEAREST="mipnearest",ContextGLMipFilter.MIPNONE="mipnone",ContextGLMipFilter}();stagegl.ContextGLMipFilter=ContextGLMipFilter}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var ContextGLProfile=function(){function ContextGLProfile(){}return ContextGLProfile.BASELINE="baseline",ContextGLProfile.BASELINE_CONSTRAINED="baselineConstrained",ContextGLProfile.BASELINE_EXTENDED="baselineExtended",ContextGLProfile}();stagegl.ContextGLProfile=ContextGLProfile}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var ContextGLStencilAction=function(){function ContextGLStencilAction(){}return ContextGLStencilAction.DECREMENT_SATURATE="decrementSaturate",ContextGLStencilAction.DECREMENT_WRAP="decrementWrap",ContextGLStencilAction.INCREMENT_SATURATE="incrementSaturate",ContextGLStencilAction.INCREMENT_WRAP="incrementWrap",ContextGLStencilAction.INVERT="invert",ContextGLStencilAction.KEEP="keep",ContextGLStencilAction.SET="set",ContextGLStencilAction.ZERO="zero",ContextGLStencilAction}();stagegl.ContextGLStencilAction=ContextGLStencilAction}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var ContextGLTextureFilter=function(){function ContextGLTextureFilter(){}return ContextGLTextureFilter.LINEAR="linear",ContextGLTextureFilter.NEAREST="nearest",ContextGLTextureFilter}();stagegl.ContextGLTextureFilter=ContextGLTextureFilter}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var ContextGLWrapMode=function(){function ContextGLWrapMode(){}return ContextGLWrapMode.CLAMP="clamp",ContextGLWrapMode.REPEAT="repeat",ContextGLWrapMode}();stagegl.ContextGLWrapMode=ContextGLWrapMode}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var ContextStage3D=function(_super){function ContextStage3D(container,stageIndex,callback){function callbackSWFObject(callbackInfo){callbackInfo.success&&(context3dObj._pContainer=callbackInfo.ref,context3dObj._iCallback=callback)}_super.call(this,stageIndex),this._cmdStream="",this._resources=new Array;var swfVersionStr="11.0.0",flashvars={id:container.id},params={quality:"high",bgcolor:"#ffffff",allowscriptaccess:"sameDomain",allowfullscreen:"true",wmode:"direct"};this._errorCheckingEnabled=!1,this._iDriverInfo="Unknown";var attributes={salign:"tl",id:container.id,name:container.name};this._oldCanvas=container.cloneNode(),this._oldParent=container.parentNode;var context3dObj=this;ContextStage3D.contexts[container.id]=this,swfobject.embedSWF("../libs/molehill_js_flashbridge.swf",container.id,String(container.width),String(container.height),swfVersionStr,"",flashvars,params,attributes,callbackSWFObject)}return __extends(ContextStage3D,_super),Object.defineProperty(ContextStage3D.prototype,"container",{get:function(){return this._pContainer},enumerable:!0,configurable:!0}),Object.defineProperty(ContextStage3D.prototype,"driverInfo",{get:function(){return this._iDriverInfo},enumerable:!0,configurable:!0}),Object.defineProperty(ContextStage3D.prototype,"errorCheckingEnabled",{get:function(){return this._errorCheckingEnabled},set:function(value){this._errorCheckingEnabled!=value&&(this._errorCheckingEnabled=value,this.addStream(String.fromCharCode(away.stagegl.OpCodes.enableErrorChecking,value?away.stagegl.OpCodes.trueValue:away.stagegl.OpCodes.falseValue)),this.execute())},enumerable:!0,configurable:!0}),ContextStage3D.prototype._iAddResource=function(resource){this._resources.push(resource)},ContextStage3D.prototype._iRemoveResource=function(resource){this._resources.splice(this._resources.indexOf(resource))},ContextStage3D.prototype.createTexture=function(width,height,format,optimizeForRenderToTexture,streamingLevels){return"undefined"==typeof streamingLevels&&(streamingLevels=0),new stagegl.TextureFlash(this,width,height,format,optimizeForRenderToTexture)},ContextStage3D.prototype.createCubeTexture=function(size,format,optimizeForRenderToTexture,streamingLevels){return"undefined"==typeof streamingLevels&&(streamingLevels=0),new stagegl.CubeTextureFlash(this,size,format,optimizeForRenderToTexture)},ContextStage3D.prototype.setTextureAt=function(sampler,texture){texture?this.addStream(String.fromCharCode(away.stagegl.OpCodes.setTextureAt)+sampler+","+texture.id+","):this.addStream(String.fromCharCode(away.stagegl.OpCodes.clearTextureAt)+sampler.toString()+","),ContextStage3D.debug&&this.execute()},ContextStage3D.prototype.setSamplerStateAt=function(){},ContextStage3D.prototype.setStencilActions=function(triangleFace,compareMode,actionOnBothPass,actionOnDepthFail,actionOnDepthPassStencilFail){"undefined"==typeof triangleFace&&(triangleFace="frontAndBack"),"undefined"==typeof compareMode&&(compareMode="always"),"undefined"==typeof actionOnBothPass&&(actionOnBothPass="keep"),"undefined"==typeof actionOnDepthFail&&(actionOnDepthFail="keep"),"undefined"==typeof actionOnDepthPassStencilFail&&(actionOnDepthPassStencilFail="keep"),this.addStream(String.fromCharCode(away.stagegl.OpCodes.setStencilActions)+triangleFace+"$"+compareMode+"$"+actionOnBothPass+"$"+actionOnDepthFail+"$"+actionOnDepthPassStencilFail+"$"),ContextStage3D.debug&&this.execute()},ContextStage3D.prototype.setStencilReferenceValue=function(referenceValue,readMask,writeMask){"undefined"==typeof readMask&&(readMask=255),"undefined"==typeof writeMask&&(writeMask=255),this.addStream(String.fromCharCode(away.stagegl.OpCodes.setStencilReferenceValue,referenceValue+away.stagegl.OpCodes.intMask,readMask+away.stagegl.OpCodes.intMask,writeMask+away.stagegl.OpCodes.intMask)),ContextStage3D.debug&&this.execute()},ContextStage3D.prototype.setCulling=function(triangleFaceToCull,coordinateSystem){"undefined"==typeof coordinateSystem&&(coordinateSystem="leftHanded"),this.addStream(String.fromCharCode(away.stagegl.OpCodes.setCulling)+triangleFaceToCull+"$"),ContextStage3D.debug&&this.execute()},ContextStage3D.prototype.drawTriangles=function(indexBuffer,firstIndex,numTriangles){"undefined"==typeof firstIndex&&(firstIndex=0),"undefined"==typeof numTriangles&&(numTriangles=-1),firstIndex=firstIndex||0,(!numTriangles||0>numTriangles)&&(numTriangles=indexBuffer.numIndices/3),this.addStream(String.fromCharCode(away.stagegl.OpCodes.drawTriangles,indexBuffer.id+away.stagegl.OpCodes.intMask)+firstIndex+","+numTriangles+","),ContextStage3D.debug&&this.execute()},ContextStage3D.prototype.setProgramConstantsFromMatrix=function(programType,firstRegister,matrix,transposedMatrix){"undefined"==typeof transposedMatrix&&(transposedMatrix=!1);var d=matrix.rawData;transposedMatrix?(this.setProgramConstantsFromArray(programType,firstRegister,[d[0],d[4],d[8],d[12]],1),this.setProgramConstantsFromArray(programType,firstRegister+1,[d[1],d[5],d[9],d[13]],1),this.setProgramConstantsFromArray(programType,firstRegister+2,[d[2],d[6],d[10],d[14]],1),this.setProgramConstantsFromArray(programType,firstRegister+3,[d[3],d[7],d[11],d[15]],1)):(this.setProgramConstantsFromArray(programType,firstRegister,[d[0],d[1],d[2],d[3]],1),this.setProgramConstantsFromArray(programType,firstRegister+1,[d[4],d[5],d[6],d[7]],1),this.setProgramConstantsFromArray(programType,firstRegister+2,[d[8],d[9],d[10],d[11]],1),this.setProgramConstantsFromArray(programType,firstRegister+3,[d[12],d[13],d[14],d[15]],1))},ContextStage3D.prototype.setProgramConstantsFromArray=function(programType,firstRegister,data,numRegisters){"undefined"==typeof numRegisters&&(numRegisters=-1);for(var startIndex,target=programType==stagegl.ContextGLProgramType.VERTEX?away.stagegl.OpCodes.trueValue:away.stagegl.OpCodes.falseValue,i=0;numRegisters>i;i++)startIndex=4*i,this.addStream(String.fromCharCode(away.stagegl.OpCodes.setProgramConstant,target,firstRegister+i+away.stagegl.OpCodes.intMask)+data[startIndex]+","+data[startIndex+1]+","+data[startIndex+2]+","+data[startIndex+3]+","),ContextStage3D.debug&&this.execute()},ContextStage3D.prototype.setProgram=function(program){this.addStream(String.fromCharCode(away.stagegl.OpCodes.setProgram,program.id+away.stagegl.OpCodes.intMask)),ContextStage3D.debug&&this.execute()},ContextStage3D.prototype.present=function(){this.addStream(String.fromCharCode(away.stagegl.OpCodes.present)),this.execute()},ContextStage3D.prototype.clear=function(red,green,blue,alpha,depth,stencil,mask){"undefined"==typeof red&&(red=0),"undefined"==typeof green&&(green=0),"undefined"==typeof blue&&(blue=0),"undefined"==typeof alpha&&(alpha=1),"undefined"==typeof depth&&(depth=1),"undefined"==typeof stencil&&(stencil=0),"undefined"==typeof mask&&(mask=stagegl.ContextGLClearMask.ALL),this.addStream(String.fromCharCode(away.stagegl.OpCodes.clear)+red+","+green+","+blue+","+alpha+","+depth+","+stencil+","+mask+","),ContextStage3D.debug&&this.execute()},ContextStage3D.prototype.createProgram=function(){return new stagegl.ProgramFlash(this)},ContextStage3D.prototype.createVertexBuffer=function(numVertices,data32PerVertex){return new stagegl.VertexBufferFlash(this,numVertices,data32PerVertex)},ContextStage3D.prototype.createIndexBuffer=function(numIndices){return new stagegl.IndexBufferFlash(this,numIndices)},ContextStage3D.prototype.configureBackBuffer=function(width,height,antiAlias,enableDepthAndStencil){"undefined"==typeof enableDepthAndStencil&&(enableDepthAndStencil=!0),_super.prototype.configureBackBuffer.call(this,width,height,antiAlias,enableDepthAndStencil),this.addStream(String.fromCharCode(away.stagegl.OpCodes.configureBackBuffer)+width+","+height+",")},ContextStage3D.prototype.drawToBitmapData=function(){},ContextStage3D.prototype.setVertexBufferAt=function(index,buffer,bufferOffset,format){"undefined"==typeof bufferOffset&&(bufferOffset=0),"undefined"==typeof format&&(format=null),buffer?this.addStream(String.fromCharCode(away.stagegl.OpCodes.setVertexBufferAt,index+away.stagegl.OpCodes.intMask)+buffer.id+","+bufferOffset+","+format+"$"):this.addStream(String.fromCharCode(away.stagegl.OpCodes.clearVertexBufferAt,index+away.stagegl.OpCodes.intMask)),ContextStage3D.debug&&this.execute()},ContextStage3D.prototype.setColorMask=function(red,green,blue,alpha){this.addStream(String.fromCharCode(away.stagegl.OpCodes.setColorMask,red?away.stagegl.OpCodes.trueValue:away.stagegl.OpCodes.falseValue,green?away.stagegl.OpCodes.trueValue:away.stagegl.OpCodes.falseValue,blue?away.stagegl.OpCodes.trueValue:away.stagegl.OpCodes.falseValue,alpha?away.stagegl.OpCodes.trueValue:away.stagegl.OpCodes.falseValue)),ContextStage3D.debug&&this.execute()},ContextStage3D.prototype.setBlendFactors=function(sourceFactor,destinationFactor){this.addStream(String.fromCharCode(away.stagegl.OpCodes.setBlendFactors)+sourceFactor+"$"+destinationFactor+"$"),ContextStage3D.debug&&this.execute()},ContextStage3D.prototype.setRenderToTexture=function(target,enableDepthAndStencil,antiAlias,surfaceSelector){"undefined"==typeof enableDepthAndStencil&&(enableDepthAndStencil=!1),"undefined"==typeof antiAlias&&(antiAlias=0),"undefined"==typeof surfaceSelector&&(surfaceSelector=0),null===target||void 0===target?this.addStream(String.fromCharCode(away.stagegl.OpCodes.clearRenderToTexture)):this.addStream(String.fromCharCode(away.stagegl.OpCodes.setRenderToTexture,enableDepthAndStencil?away.stagegl.OpCodes.trueValue:away.stagegl.OpCodes.falseValue)+target.id+","+(antiAlias||0)+","),ContextStage3D.debug&&this.execute()},ContextStage3D.prototype.setRenderToBackBuffer=function(){this.addStream(String.fromCharCode(away.stagegl.OpCodes.clearRenderToTexture)),ContextStage3D.debug&&this.execute()},ContextStage3D.prototype.setScissorRectangle=function(rectangle){rectangle?this.addStream(String.fromCharCode(away.stagegl.OpCodes.setScissorRect)+rectangle.x+","+rectangle.y+","+rectangle.width+","+rectangle.height+","):this.addStream(String.fromCharCode(away.stagegl.OpCodes.clearScissorRect)),ContextStage3D.debug&&this.execute()},ContextStage3D.prototype.setDepthTest=function(depthMask,passCompareMode){this.addStream(String.fromCharCode(away.stagegl.OpCodes.setDepthTest,depthMask?away.stagegl.OpCodes.trueValue:away.stagegl.OpCodes.falseValue)+passCompareMode+"$"),ContextStage3D.debug&&this.execute()},ContextStage3D.prototype.dispose=function(){if(null!=this._pContainer){for(console.log("Context3D dispose, releasing "+this._resources.length+" resources.");this._resources.length;)this._resources[0].dispose();this._pContainer&&(this.addStream(String.fromCharCode(away.stagegl.OpCodes.disposeContext)),this.execute(),swfobject.removeSWF(this._oldCanvas.id),this._oldCanvas&&this._oldParent&&(this._oldParent.appendChild(this._oldCanvas),this._oldParent=null),this._pContainer=null),this._oldCanvas=null}},ContextStage3D.prototype.addStream=function(stream){this._cmdStream+=stream},ContextStage3D.prototype.execute=function(){ContextStage3D.logStream&&console.log(this._cmdStream);var result=this._pContainer.CallFunction(''+this._cmdStream+"");if(Number(result)<=-3)throw"Exec stream failed";return this._cmdStream="",Number(result)},ContextStage3D.contexts=new Object,ContextStage3D.maxvertexconstants=128,ContextStage3D.maxfragconstants=28,ContextStage3D.maxtemp=8,ContextStage3D.maxstreams=8,ContextStage3D.maxtextures=8,ContextStage3D.defaultsampler=new aglsl.Sampler,ContextStage3D.debug=!1,ContextStage3D.logStream=!1,ContextStage3D}(stagegl.ContextGLBase);stagegl.ContextStage3D=ContextStage3D}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var ContextWebGL=function(_super){function ContextWebGL(canvas,stageIndex){_super.call(this,stageIndex),this._blendFactorDictionary=new Object,this._depthTestDictionary=new Object,this._textureIndexDictionary=new Array(8),this._textureTypeDictionary=new Object,this._wrapDictionary=new Object,this._filterDictionary=new Object,this._mipmapFilterDictionary=new Object,this._uniformLocationNameDictionary=new Object,this._vertexBufferDimensionDictionary=new Object,this._indexBufferList=new Array,this._vertexBufferList=new Array,this._textureList=new Array,this._programList=new Array,this._samplerStates=new Array(8),this._pContainer=canvas;try{this._gl=canvas.getContext("experimental-webgl",{premultipliedAlpha:!1,alpha:!1}),this._gl||(this._gl=canvas.getContext("webgl",{premultipliedAlpha:!1,alpha:!1}))}catch(e){}this._gl?(this._blendFactorDictionary[stagegl.ContextGLBlendFactor.ONE]=this._gl.ONE,this._blendFactorDictionary[stagegl.ContextGLBlendFactor.DESTINATION_ALPHA]=this._gl.DST_ALPHA,this._blendFactorDictionary[stagegl.ContextGLBlendFactor.DESTINATION_COLOR]=this._gl.DST_COLOR,this._blendFactorDictionary[stagegl.ContextGLBlendFactor.ONE]=this._gl.ONE,this._blendFactorDictionary[stagegl.ContextGLBlendFactor.ONE_MINUS_DESTINATION_ALPHA]=this._gl.ONE_MINUS_DST_ALPHA,this._blendFactorDictionary[stagegl.ContextGLBlendFactor.ONE_MINUS_DESTINATION_COLOR]=this._gl.ONE_MINUS_DST_COLOR,this._blendFactorDictionary[stagegl.ContextGLBlendFactor.ONE_MINUS_SOURCE_ALPHA]=this._gl.ONE_MINUS_SRC_ALPHA,this._blendFactorDictionary[stagegl.ContextGLBlendFactor.ONE_MINUS_SOURCE_COLOR]=this._gl.ONE_MINUS_SRC_COLOR,this._blendFactorDictionary[stagegl.ContextGLBlendFactor.SOURCE_ALPHA]=this._gl.SRC_ALPHA,this._blendFactorDictionary[stagegl.ContextGLBlendFactor.SOURCE_COLOR]=this._gl.SRC_COLOR,this._blendFactorDictionary[stagegl.ContextGLBlendFactor.ZERO]=this._gl.ZERO,this._depthTestDictionary[stagegl.ContextGLCompareMode.ALWAYS]=this._gl.ALWAYS,this._depthTestDictionary[stagegl.ContextGLCompareMode.EQUAL]=this._gl.EQUAL,this._depthTestDictionary[stagegl.ContextGLCompareMode.GREATER]=this._gl.GREATER,this._depthTestDictionary[stagegl.ContextGLCompareMode.GREATER_EQUAL]=this._gl.GEQUAL,this._depthTestDictionary[stagegl.ContextGLCompareMode.LESS]=this._gl.LESS,this._depthTestDictionary[stagegl.ContextGLCompareMode.LESS_EQUAL]=this._gl.LEQUAL,this._depthTestDictionary[stagegl.ContextGLCompareMode.NEVER]=this._gl.NEVER,this._depthTestDictionary[stagegl.ContextGLCompareMode.NOT_EQUAL]=this._gl.NOTEQUAL,this._textureIndexDictionary[0]=this._gl.TEXTURE0,this._textureIndexDictionary[1]=this._gl.TEXTURE1,this._textureIndexDictionary[2]=this._gl.TEXTURE2,this._textureIndexDictionary[3]=this._gl.TEXTURE3,this._textureIndexDictionary[4]=this._gl.TEXTURE4,this._textureIndexDictionary[5]=this._gl.TEXTURE5,this._textureIndexDictionary[6]=this._gl.TEXTURE6,this._textureIndexDictionary[7]=this._gl.TEXTURE7,this._textureTypeDictionary.texture2d=this._gl.TEXTURE_2D,this._textureTypeDictionary.textureCube=this._gl.TEXTURE_CUBE_MAP,this._wrapDictionary[stagegl.ContextGLWrapMode.REPEAT]=this._gl.REPEAT,this._wrapDictionary[stagegl.ContextGLWrapMode.CLAMP]=this._gl.CLAMP_TO_EDGE,this._filterDictionary[stagegl.ContextGLTextureFilter.LINEAR]=this._gl.LINEAR,this._filterDictionary[stagegl.ContextGLTextureFilter.NEAREST]=this._gl.NEAREST,this._mipmapFilterDictionary[stagegl.ContextGLTextureFilter.LINEAR]=new Object,this._mipmapFilterDictionary[stagegl.ContextGLTextureFilter.LINEAR][stagegl.ContextGLMipFilter.MIPNEAREST]=this._gl.LINEAR_MIPMAP_NEAREST,this._mipmapFilterDictionary[stagegl.ContextGLTextureFilter.LINEAR][stagegl.ContextGLMipFilter.MIPLINEAR]=this._gl.LINEAR_MIPMAP_LINEAR,this._mipmapFilterDictionary[stagegl.ContextGLTextureFilter.LINEAR][stagegl.ContextGLMipFilter.MIPNONE]=this._gl.LINEAR,this._mipmapFilterDictionary[stagegl.ContextGLTextureFilter.NEAREST]=new Object,this._mipmapFilterDictionary[stagegl.ContextGLTextureFilter.NEAREST][stagegl.ContextGLMipFilter.MIPNEAREST]=this._gl.NEAREST_MIPMAP_NEAREST,this._mipmapFilterDictionary[stagegl.ContextGLTextureFilter.NEAREST][stagegl.ContextGLMipFilter.MIPLINEAR]=this._gl.NEAREST_MIPMAP_LINEAR,this._mipmapFilterDictionary[stagegl.ContextGLTextureFilter.NEAREST][stagegl.ContextGLMipFilter.MIPNONE]=this._gl.NEAREST,this._uniformLocationNameDictionary[stagegl.ContextGLProgramType.VERTEX]="vc",this._uniformLocationNameDictionary[stagegl.ContextGLProgramType.FRAGMENT]="fc",this._vertexBufferDimensionDictionary[stagegl.ContextGLVertexBufferFormat.FLOAT_1]=1,this._vertexBufferDimensionDictionary[stagegl.ContextGLVertexBufferFormat.FLOAT_2]=2,this._vertexBufferDimensionDictionary[stagegl.ContextGLVertexBufferFormat.FLOAT_3]=3,this._vertexBufferDimensionDictionary[stagegl.ContextGLVertexBufferFormat.FLOAT_4]=4,this._vertexBufferDimensionDictionary[stagegl.ContextGLVertexBufferFormat.BYTES_4]=4):alert("WebGL is not available.");for(var i=0;ii;i++)startIndex=4*i,this._gl.uniform4f(this._gl.getUniformLocation(this._currentProgram.glProgram,locationName+(firstRegister+i)),data[startIndex],data[startIndex+1],data[startIndex+2],data[startIndex+3])},ContextWebGL.prototype.setScissorRectangle=function(rectangle){return rectangle?(this._gl.enable(this._gl.SCISSOR_TEST),this._gl.scissor(rectangle.x,rectangle.y,rectangle.width,rectangle.height),void 0):(this._gl.disable(this._gl.SCISSOR_TEST),void 0)},ContextWebGL.prototype.setTextureAt=function(sampler,texture){var samplerState=this._samplerStates[sampler];if(this._activeTexture!=sampler&&(texture||samplerState.type)&&(this._activeTexture=sampler,this._gl.activeTexture(this._textureIndexDictionary[sampler])),!texture)return samplerState.type&&(this._gl.bindTexture(samplerState.type,null),samplerState.type=null),void 0;var textureType=this._textureTypeDictionary[texture.textureType];samplerState.type=textureType,this._gl.bindTexture(textureType,texture.glTexture),this._gl.uniform1i(this._gl.getUniformLocation(this._currentProgram.glProgram,"fs"+sampler),sampler),this._gl.texParameteri(textureType,this._gl.TEXTURE_WRAP_S,samplerState.wrap),this._gl.texParameteri(textureType,this._gl.TEXTURE_WRAP_T,samplerState.wrap),this._gl.texParameteri(textureType,this._gl.TEXTURE_MAG_FILTER,samplerState.filter),this._gl.texParameteri(textureType,this._gl.TEXTURE_MIN_FILTER,samplerState.mipfilter)},ContextWebGL.prototype.setSamplerStateAt=function(sampler,wrap,filter,mipfilter){if(!(sampler>=0&&sampler-1&&this._gl.disableVertexAttribArray(location),void 0)},ContextWebGL.prototype.setRenderToTexture=function(target,enableDepthAndStencil,antiAlias,surfaceSelector){"undefined"==typeof enableDepthAndStencil&&(enableDepthAndStencil=!1),"undefined"==typeof antiAlias&&(antiAlias=0),"undefined"==typeof surfaceSelector&&(surfaceSelector=0);var texture=target,frameBuffer=texture.frameBuffer;this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,frameBuffer),enableDepthAndStencil&&(this._gl.enable(this._gl.STENCIL_TEST),this._gl.enable(this._gl.DEPTH_TEST)),this._gl.viewport(0,0,texture.width,texture.height)},ContextWebGL.prototype.setRenderToBackBuffer=function(){this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,null)},ContextWebGL.prototype.updateBlendStatus=function(){this._blendEnabled?(this._gl.enable(this._gl.BLEND),this._gl.blendEquation(this._gl.FUNC_ADD),this._gl.blendFunc(this._blendSourceFactor,this._blendDestinationFactor)):this._gl.disable(this._gl.BLEND)},ContextWebGL.MAX_SAMPLERS=8,ContextWebGL.modulo=0,ContextWebGL}(stagegl.ContextGLBase);stagegl.ContextWebGL=ContextWebGL}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var ResourceBaseFlash=function(){function ResourceBaseFlash(){}return Object.defineProperty(ResourceBaseFlash.prototype,"id",{get:function(){return this._pId},enumerable:!0,configurable:!0}),ResourceBaseFlash.prototype.dispose=function(){},ResourceBaseFlash}();stagegl.ResourceBaseFlash=ResourceBaseFlash}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var TextureBaseWebGL=function(){function TextureBaseWebGL(gl){this.textureType="",this._gl=gl}return TextureBaseWebGL.prototype.dispose=function(){throw"Abstract method must be overridden."},Object.defineProperty(TextureBaseWebGL.prototype,"glTexture",{get:function(){throw new away.errors.AbstractMethodError},enumerable:!0,configurable:!0}),TextureBaseWebGL}();stagegl.TextureBaseWebGL=TextureBaseWebGL}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var ByteArrayBase=away.utils.ByteArrayBase,CubeTextureFlash=function(_super){function CubeTextureFlash(context,size,format,forRTT,streaming){"undefined"==typeof streaming&&(streaming=!1),_super.call(this),this._context=context,this._size=size,this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.initCubeTexture,forRTT?away.stagegl.OpCodes.trueValue:away.stagegl.OpCodes.falseValue)+size+","+streaming+","+format+"$"),this._pId=this._context.execute(),this._context._iAddResource(this) -}return __extends(CubeTextureFlash,_super),Object.defineProperty(CubeTextureFlash.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),CubeTextureFlash.prototype.dispose=function(){this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.disposeCubeTexture)+this._pId.toString()+","),this._context.execute(),this._context._iRemoveResource(this),this._context=null},CubeTextureFlash.prototype.uploadFromData=function(data,side,miplevel){if("undefined"==typeof miplevel&&(miplevel=0),data instanceof away.base.BitmapData)data=data.imageData.data;else if(data instanceof HTMLImageElement){var can=document.createElement("canvas"),w=data.width,h=data.height;can.width=w,can.height=h;var ctx=can.getContext("2d");ctx.drawImage(data,0,0),data=ctx.getImageData(0,0,w,h).data}var pos=0,bytes=ByteArrayBase.internalGetBase64String(data.length,function(){return data[pos++]},null);this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.uploadBytesCubeTexture)+this._pId+","+miplevel+","+side+","+(this.size>>miplevel)+","+bytes+"%"),this._context.execute()},CubeTextureFlash.prototype.uploadCompressedTextureFromByteArray=function(data,byteArrayOffset,async){"undefined"==typeof async&&(async=!1)},CubeTextureFlash}(stagegl.ResourceBaseFlash);stagegl.CubeTextureFlash=CubeTextureFlash}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var CubeTextureWebGL=function(_super){function CubeTextureWebGL(gl,size){_super.call(this,gl),this._textureSelectorDictionary=new Array(6),this.textureType="textureCube",this._size=size,this._texture=this._gl.createTexture(),this._textureSelectorDictionary[0]=gl.TEXTURE_CUBE_MAP_POSITIVE_X,this._textureSelectorDictionary[1]=gl.TEXTURE_CUBE_MAP_NEGATIVE_X,this._textureSelectorDictionary[2]=gl.TEXTURE_CUBE_MAP_POSITIVE_Y,this._textureSelectorDictionary[3]=gl.TEXTURE_CUBE_MAP_NEGATIVE_Y,this._textureSelectorDictionary[4]=gl.TEXTURE_CUBE_MAP_POSITIVE_Z,this._textureSelectorDictionary[5]=gl.TEXTURE_CUBE_MAP_NEGATIVE_Z}return __extends(CubeTextureWebGL,_super),CubeTextureWebGL.prototype.dispose=function(){this._gl.deleteTexture(this._texture)},CubeTextureWebGL.prototype.uploadFromData=function(data,side,miplevel){"undefined"==typeof miplevel&&(miplevel=0),data instanceof away.base.BitmapData&&(data=data.imageData),this._gl.bindTexture(this._gl.TEXTURE_CUBE_MAP,this._texture),this._gl.texImage2D(this._textureSelectorDictionary[side],miplevel,this._gl.RGBA,this._gl.RGBA,this._gl.UNSIGNED_BYTE,data),this._gl.bindTexture(this._gl.TEXTURE_CUBE_MAP,null)},CubeTextureWebGL.prototype.uploadCompressedTextureFromByteArray=function(data,byteArrayOffset,async){"undefined"==typeof async&&(async=!1)},Object.defineProperty(CubeTextureWebGL.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(CubeTextureWebGL.prototype,"glTexture",{get:function(){return this._texture},enumerable:!0,configurable:!0}),CubeTextureWebGL}(stagegl.TextureBaseWebGL);stagegl.CubeTextureWebGL=CubeTextureWebGL}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(){}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var IndexBufferFlash=function(_super){function IndexBufferFlash(context,numIndices){_super.call(this),this._context=context,this._numIndices=numIndices,this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.initIndexBuffer,numIndices+away.stagegl.OpCodes.intMask)),this._pId=this._context.execute(),this._context._iAddResource(this)}return __extends(IndexBufferFlash,_super),IndexBufferFlash.prototype.uploadFromArray=function(data,startOffset,count){this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.uploadArrayIndexBuffer,this._pId+away.stagegl.OpCodes.intMask)+data.join()+"#"+startOffset+","+count+","),this._context.execute()},IndexBufferFlash.prototype.dispose=function(){this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.disposeIndexBuffer,this._pId+away.stagegl.OpCodes.intMask)),this._context.execute(),this._context._iRemoveResource(this),this._context=null},Object.defineProperty(IndexBufferFlash.prototype,"numIndices",{get:function(){return this._numIndices},enumerable:!0,configurable:!0}),IndexBufferFlash}(stagegl.ResourceBaseFlash);stagegl.IndexBufferFlash=IndexBufferFlash}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var IndexBufferWebGL=function(){function IndexBufferWebGL(gl,numIndices){this._gl=gl,this._buffer=this._gl.createBuffer(),this._numIndices=numIndices}return IndexBufferWebGL.prototype.uploadFromArray=function(data){this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER,this._buffer),this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,new Uint16Array(data),this._gl.STATIC_DRAW)},IndexBufferWebGL.prototype.dispose=function(){this._gl.deleteBuffer(this._buffer)},Object.defineProperty(IndexBufferWebGL.prototype,"numIndices",{get:function(){return this._numIndices},enumerable:!0,configurable:!0}),Object.defineProperty(IndexBufferWebGL.prototype,"glBuffer",{get:function(){return this._buffer},enumerable:!0,configurable:!0}),IndexBufferWebGL}();stagegl.IndexBufferWebGL=IndexBufferWebGL}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(){}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var OpCodes=function(){function OpCodes(){}return OpCodes.trueValue=32,OpCodes.falseValue=33,OpCodes.intMask=63,OpCodes.drawTriangles=41,OpCodes.setProgramConstant=42,OpCodes.setProgram=43,OpCodes.present=44,OpCodes.clear=45,OpCodes.initProgram=46,OpCodes.initVertexBuffer=47,OpCodes.initIndexBuffer=48,OpCodes.configureBackBuffer=49,OpCodes.uploadArrayIndexBuffer=50,OpCodes.uploadArrayVertexBuffer=51,OpCodes.uploadAGALBytesProgram=52,OpCodes.setVertexBufferAt=53,OpCodes.uploadBytesIndexBuffer=54,OpCodes.uploadBytesVertexBuffer=55,OpCodes.setColorMask=56,OpCodes.setDepthTest=57,OpCodes.disposeProgram=58,OpCodes.disposeContext=59,OpCodes.disposeVertexBuffer=61,OpCodes.disposeIndexBuffer=63,OpCodes.initTexture=64,OpCodes.setTextureAt=65,OpCodes.uploadBytesTexture=66,OpCodes.disposeTexture=67,OpCodes.setCulling=68,OpCodes.setScissorRect=69,OpCodes.clearScissorRect=70,OpCodes.setBlendFactors=71,OpCodes.setRenderToTexture=72,OpCodes.clearTextureAt=73,OpCodes.clearVertexBufferAt=74,OpCodes.setStencilActions=75,OpCodes.setStencilReferenceValue=76,OpCodes.initCubeTexture=77,OpCodes.disposeCubeTexture=78,OpCodes.uploadBytesCubeTexture=79,OpCodes.clearRenderToTexture=80,OpCodes.enableErrorChecking=81,OpCodes}();stagegl.OpCodes=OpCodes}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var ProgramFlash=function(_super){function ProgramFlash(context){_super.call(this),this._context=context,this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.initProgram)),this._pId=this._context.execute(),this._context._iAddResource(this)}return __extends(ProgramFlash,_super),ProgramFlash.prototype.upload=function(vertexProgram,fragmentProgram){this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.uploadAGALBytesProgram,this._pId+away.stagegl.OpCodes.intMask)+vertexProgram.readBase64String(vertexProgram.length)+"%"+fragmentProgram.readBase64String(fragmentProgram.length)+"%"),stagegl.ContextStage3D.debug&&this._context.execute()},ProgramFlash.prototype.dispose=function(){this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.disposeProgram,this._pId+away.stagegl.OpCodes.intMask)),this._context.execute(),this._context._iRemoveResource(this),this._context=null},ProgramFlash}(stagegl.ResourceBaseFlash);stagegl.ProgramFlash=ProgramFlash}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var ProgramWebGL=function(){function ProgramWebGL(gl){this._gl=gl,this._program=this._gl.createProgram()}return ProgramWebGL.prototype.upload=function(vertexProgram,fragmentProgram){var vertexString=ProgramWebGL._aglslParser.parse(ProgramWebGL._tokenizer.decribeAGALByteArray(vertexProgram)),fragmentString=ProgramWebGL._aglslParser.parse(ProgramWebGL._tokenizer.decribeAGALByteArray(fragmentProgram));if(this._vertexShader=this._gl.createShader(this._gl.VERTEX_SHADER),this._fragmentShader=this._gl.createShader(this._gl.FRAGMENT_SHADER),this._gl.shaderSource(this._vertexShader,vertexString),this._gl.compileShader(this._vertexShader),!this._gl.getShaderParameter(this._vertexShader,this._gl.COMPILE_STATUS))throw new Error(this._gl.getShaderInfoLog(this._vertexShader));if(this._gl.shaderSource(this._fragmentShader,fragmentString),this._gl.compileShader(this._fragmentShader),!this._gl.getShaderParameter(this._fragmentShader,this._gl.COMPILE_STATUS))throw new Error(this._gl.getShaderInfoLog(this._fragmentShader));if(this._gl.attachShader(this._program,this._vertexShader),this._gl.attachShader(this._program,this._fragmentShader),this._gl.linkProgram(this._program),!this._gl.getProgramParameter(this._program,this._gl.LINK_STATUS))throw new Error(this._gl.getProgramInfoLog(this._program))},ProgramWebGL.prototype.dispose=function(){this._gl.deleteProgram(this._program)},ProgramWebGL.prototype.focusProgram=function(){this._gl.useProgram(this._program)},Object.defineProperty(ProgramWebGL.prototype,"glProgram",{get:function(){return this._program},enumerable:!0,configurable:!0}),ProgramWebGL._tokenizer=new aglsl.AGALTokenizer,ProgramWebGL._aglslParser=new aglsl.AGLSLParser,ProgramWebGL}();stagegl.ProgramWebGL=ProgramWebGL}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var SamplerState=function(){function SamplerState(){}return SamplerState}();stagegl.SamplerState=SamplerState}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var ByteArrayBase=away.utils.ByteArrayBase,TextureFlash=function(_super){function TextureFlash(context,width,height,format,forRTT,streaming){"undefined"==typeof streaming&&(streaming=!1),_super.call(this),this._context=context,this._width=width,this._height=height,this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.initTexture,forRTT?away.stagegl.OpCodes.trueValue:away.stagegl.OpCodes.falseValue)+width+","+height+","+streaming+","+format+"$"),this._pId=this._context.execute(),this._context._iAddResource(this)}return __extends(TextureFlash,_super),Object.defineProperty(TextureFlash.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(TextureFlash.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),TextureFlash.prototype.dispose=function(){this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.disposeTexture)+this._pId.toString()+","),this._context.execute(),this._context._iRemoveResource(this),this._context=null},TextureFlash.prototype.uploadFromData=function(data,miplevel){if("undefined"==typeof miplevel&&(miplevel=0),data instanceof away.base.BitmapData)data=data.imageData.data;else if(data instanceof HTMLImageElement){var can=document.createElement("canvas"),w=data.width,h=data.height;can.width=w,can.height=h;var ctx=can.getContext("2d");ctx.drawImage(data,0,0),data=ctx.getImageData(0,0,w,h).data}var pos=0,bytes=ByteArrayBase.internalGetBase64String(data.length,function(){return data[pos++]},null);this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.uploadBytesTexture)+this._pId+","+miplevel+","+(this._width>>miplevel)+","+(this._height>>miplevel)+","+bytes+"%"),this._context.execute()},TextureFlash}(stagegl.ResourceBaseFlash);stagegl.TextureFlash=TextureFlash}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var TextureWebGL=function(_super){function TextureWebGL(gl,width,height){_super.call(this,gl),this.textureType="texture2d",this._width=width,this._height=height,this._glTexture=this._gl.createTexture()}return __extends(TextureWebGL,_super),TextureWebGL.prototype.dispose=function(){this._gl.deleteTexture(this._glTexture)},Object.defineProperty(TextureWebGL.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(TextureWebGL.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),Object.defineProperty(TextureWebGL.prototype,"frameBuffer",{get:function(){if(!this._frameBuffer){this._frameBuffer=this._gl.createFramebuffer(),this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,this._frameBuffer),this._gl.bindTexture(this._gl.TEXTURE_2D,this._glTexture),this._gl.texImage2D(this._gl.TEXTURE_2D,0,this._gl.RGBA,this._width,this._height,0,this._gl.RGBA,this._gl.UNSIGNED_BYTE,null);var renderBuffer=this._gl.createRenderbuffer();this._gl.bindRenderbuffer(this._gl.RENDERBUFFER,renderBuffer),this._gl.renderbufferStorage(this._gl.RENDERBUFFER,this._gl.DEPTH_COMPONENT16,this._width,this._height),this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER,this._gl.COLOR_ATTACHMENT0,this._gl.TEXTURE_2D,this._glTexture,0),this._gl.framebufferRenderbuffer(this._gl.FRAMEBUFFER,this._gl.DEPTH_ATTACHMENT,this._gl.RENDERBUFFER,renderBuffer),this._gl.bindTexture(this._gl.TEXTURE_2D,null),this._gl.bindRenderbuffer(this._gl.RENDERBUFFER,null),this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,null)}return this._frameBuffer},enumerable:!0,configurable:!0}),TextureWebGL.prototype.uploadFromData=function(data,miplevel){"undefined"==typeof miplevel&&(miplevel=0),data instanceof away.base.BitmapData&&(data=data.imageData),this._gl.bindTexture(this._gl.TEXTURE_2D,this._glTexture),this._gl.texImage2D(this._gl.TEXTURE_2D,miplevel,this._gl.RGBA,this._gl.RGBA,this._gl.UNSIGNED_BYTE,data),this._gl.bindTexture(this._gl.TEXTURE_2D,null)},TextureWebGL.prototype.uploadCompressedTextureFromByteArray=function(data,byteArrayOffset,async){"undefined"==typeof async&&(async=!1);this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc")},Object.defineProperty(TextureWebGL.prototype,"glTexture",{get:function(){return this._glTexture},enumerable:!0,configurable:!0}),TextureWebGL.prototype.generateMipmaps=function(){},TextureWebGL}(stagegl.TextureBaseWebGL);stagegl.TextureWebGL=TextureWebGL}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var VertexBufferFlash=function(_super){function VertexBufferFlash(context,numVertices,data32PerVertex){_super.call(this),this._context=context,this._numVertices=numVertices,this._data32PerVertex=data32PerVertex,this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.initVertexBuffer,data32PerVertex+away.stagegl.OpCodes.intMask)+numVertices.toString()+","),this._pId=this._context.execute(),this._context._iAddResource(this)}return __extends(VertexBufferFlash,_super),VertexBufferFlash.prototype.uploadFromArray=function(data,startVertex,numVertices){this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.uploadArrayVertexBuffer,this._pId+away.stagegl.OpCodes.intMask)+data.join()+"#"+[startVertex,numVertices].join()+","),this._context.execute()},Object.defineProperty(VertexBufferFlash.prototype,"numVertices",{get:function(){return this._numVertices},enumerable:!0,configurable:!0}),Object.defineProperty(VertexBufferFlash.prototype,"data32PerVertex",{get:function(){return this._data32PerVertex},enumerable:!0,configurable:!0}),VertexBufferFlash.prototype.dispose=function(){this._context.addStream(String.fromCharCode(away.stagegl.OpCodes.disposeVertexBuffer,this._pId+away.stagegl.OpCodes.intMask)),this._context.execute(),this._context._iRemoveResource(this),this._context=null},VertexBufferFlash}(stagegl.ResourceBaseFlash);stagegl.VertexBufferFlash=VertexBufferFlash}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(stagegl){var VertexBufferWebGL=function(){function VertexBufferWebGL(gl,numVertices,data32PerVertex){this._gl=gl,this._buffer=this._gl.createBuffer(),this._numVertices=numVertices,this._data32PerVertex=data32PerVertex}return VertexBufferWebGL.prototype.uploadFromArray=function(vertices){this._gl.bindBuffer(this._gl.ARRAY_BUFFER,this._buffer),this._gl.bufferData(this._gl.ARRAY_BUFFER,new Float32Array(vertices),this._gl.STATIC_DRAW)},Object.defineProperty(VertexBufferWebGL.prototype,"numVertices",{get:function(){return this._numVertices},enumerable:!0,configurable:!0}),Object.defineProperty(VertexBufferWebGL.prototype,"data32PerVertex",{get:function(){return this._data32PerVertex},enumerable:!0,configurable:!0}),Object.defineProperty(VertexBufferWebGL.prototype,"glBuffer",{get:function(){return this._buffer},enumerable:!0,configurable:!0}),VertexBufferWebGL.prototype.dispose=function(){this._gl.deleteBuffer(this._buffer)},VertexBufferWebGL}();stagegl.VertexBufferWebGL=VertexBufferWebGL}(away.stagegl||(away.stagegl={}));away.stagegl}(away||(away={}));var away;!function(away){!function(managers){var StageEvent=away.events.StageEvent,AGALProgramCache=function(){function AGALProgramCache(stage,agalProgramCacheSingletonEnforcer){if(!agalProgramCacheSingletonEnforcer)throw new Error("This class is a multiton and cannot be instantiated manually. Use StageManager.getInstance instead.");this._stage=stage,this._program3Ds=new Object,this._ids=new Object,this._usages=new Object,this._keys=new Object}return AGALProgramCache.getInstance=function(stage){var index=stage.stageIndex;return null==AGALProgramCache._instances&&(AGALProgramCache._instances=new Array(8)),AGALProgramCache._instances[index]||(AGALProgramCache._instances[index]=new AGALProgramCache(stage,new AGALProgramCacheSingletonEnforcer),stage.addEventListener(StageEvent.CONTEXT_DISPOSED,AGALProgramCache.onContextGLDisposed),stage.addEventListener(StageEvent.CONTEXT_CREATED,AGALProgramCache.onContextGLDisposed),stage.addEventListener(StageEvent.CONTEXT_RECREATED,AGALProgramCache.onContextGLDisposed)),AGALProgramCache._instances[index]},AGALProgramCache.getInstanceFromIndex=function(index){if(!AGALProgramCache._instances[index])throw new Error("Instance not created yet!");return AGALProgramCache._instances[index]},AGALProgramCache.onContextGLDisposed=function(event){var stage=event.target,index=stage.stageIndex;AGALProgramCache._instances[index].dispose(),AGALProgramCache._instances[index]=null,stage.removeEventListener(StageEvent.CONTEXT_DISPOSED,AGALProgramCache.onContextGLDisposed),stage.removeEventListener(StageEvent.CONTEXT_CREATED,AGALProgramCache.onContextGLDisposed),stage.removeEventListener(StageEvent.CONTEXT_RECREATED,AGALProgramCache.onContextGLDisposed)},AGALProgramCache.prototype.dispose=function(){for(var key in this._program3Ds)this.destroyProgram(key);this._keys=null,this._program3Ds=null,this._usages=null},AGALProgramCache.prototype.setProgram=function(programIds,programs,vertexCode,fragmentCode){var program,stageIndex=this._stage.stageIndex,key=this.getKey(vertexCode,fragmentCode);if(null==this._program3Ds[key]){this._keys[AGALProgramCache._currentId]=key,this._usages[AGALProgramCache._currentId]=0,this._ids[key]=AGALProgramCache._currentId,++AGALProgramCache._currentId,program=this._stage.context.createProgram();var vertexByteCode=(new aglsl.assembler.AGALMiniAssembler).assemble("part vertex 1\n"+vertexCode+"endpart").vertex.data,fragmentByteCode=(new aglsl.assembler.AGALMiniAssembler).assemble("part fragment 1\n"+fragmentCode+"endpart").fragment.data;program.upload(vertexByteCode,fragmentByteCode),this._program3Ds[key]=program}var oldId=programIds[stageIndex],newId=this._ids[key];oldId!=newId&&(oldId>=0&&this.freeProgram(oldId),this._usages[newId]++),programIds[stageIndex]=newId,programs[stageIndex]=this._program3Ds[key]},AGALProgramCache.prototype.freeProgram=function(programId){this._usages[programId]--,0==this._usages[programId]&&this.destroyProgram(this._keys[programId])},AGALProgramCache.prototype.destroyProgram=function(key){this._program3Ds[key].dispose(),this._program3Ds[key]=null,delete this._program3Ds[key],this._ids[key]=-1},AGALProgramCache.prototype.getKey=function(vertexCode,fragmentCode){return vertexCode+"---"+fragmentCode},AGALProgramCache._currentId=0,AGALProgramCache}();managers.AGALProgramCache=AGALProgramCache}(away.managers||(away.managers={}));away.managers}(away||(away={}));var AGALProgramCacheSingletonEnforcer=function(){function AGALProgramCacheSingletonEnforcer(){}return AGALProgramCacheSingletonEnforcer}(),away;!function(away){!function(managers){var RTTBufferManager=function(_super){function RTTBufferManager(se,stage){if(_super.call(this),this._viewWidth=-1,this._viewHeight=-1,this._textureWidth=-1,this._textureHeight=-1,this._buffersInvalid=!0,!se)throw new Error("No cheating the multiton!");this._renderToTextureRect=new away.geom.Rectangle,this._stage=stage}return __extends(RTTBufferManager,_super),RTTBufferManager.getInstance=function(stage){if(!stage)throw new Error("stage key cannot be null!");null==RTTBufferManager._instances&&(RTTBufferManager._instances=new Array);var rttBufferManager=RTTBufferManager.getRTTBufferManagerFromStage(stage);if(null==rttBufferManager){rttBufferManager=new RTTBufferManager(new SingletonEnforcer,stage);var vo=new RTTBufferManagerVO;vo.stage3d=stage,vo.rttbfm=rttBufferManager,RTTBufferManager._instances.push(vo)}return rttBufferManager},RTTBufferManager.getRTTBufferManagerFromStage=function(stage){for(var r,l=RTTBufferManager._instances.length,c=0;l>c;c++)if(r=RTTBufferManager._instances[c],r.stage3d===stage)return r.rttbfm;return null},RTTBufferManager.deleteRTTBufferManager=function(stage){for(var r,l=RTTBufferManager._instances.length,c=0;l>c;c++)if(r=RTTBufferManager._instances[c],r.stage3d===stage)return RTTBufferManager._instances.splice(c,1),void 0},Object.defineProperty(RTTBufferManager.prototype,"textureRatioX",{get:function(){return this._buffersInvalid&&this.updateRTTBuffers(),this._textureRatioX},enumerable:!0,configurable:!0}),Object.defineProperty(RTTBufferManager.prototype,"textureRatioY",{get:function(){return this._buffersInvalid&&this.updateRTTBuffers(),this._textureRatioY},enumerable:!0,configurable:!0}),Object.defineProperty(RTTBufferManager.prototype,"viewWidth",{get:function(){return this._viewWidth},set:function(value){value!=this._viewWidth&&(this._viewWidth=value,this._buffersInvalid=!0,this._textureWidth=away.utils.TextureUtils.getBestPowerOf2(this._viewWidth),this._textureWidth>this._viewWidth?(this._renderToTextureRect.x=Math.floor(.5*(this._textureWidth-this._viewWidth)),this._renderToTextureRect.width=this._viewWidth):(this._renderToTextureRect.x=0,this._renderToTextureRect.width=this._textureWidth),this.dispatchEvent(new away.events.Event(away.events.Event.RESIZE)))},enumerable:!0,configurable:!0}),Object.defineProperty(RTTBufferManager.prototype,"viewHeight",{get:function(){return this._viewHeight},set:function(value){value!=this._viewHeight&&(this._viewHeight=value,this._buffersInvalid=!0,this._textureHeight=away.utils.TextureUtils.getBestPowerOf2(this._viewHeight),this._textureHeight>this._viewHeight?(this._renderToTextureRect.y=Math.floor(.5*(this._textureHeight-this._viewHeight)),this._renderToTextureRect.height=this._viewHeight):(this._renderToTextureRect.y=0,this._renderToTextureRect.height=this._textureHeight),this.dispatchEvent(new away.events.Event(away.events.Event.RESIZE)))},enumerable:!0,configurable:!0}),Object.defineProperty(RTTBufferManager.prototype,"renderToTextureVertexBuffer",{get:function(){return this._buffersInvalid&&this.updateRTTBuffers(),this._renderToTextureVertexBuffer},enumerable:!0,configurable:!0}),Object.defineProperty(RTTBufferManager.prototype,"renderToScreenVertexBuffer",{get:function(){return this._buffersInvalid&&this.updateRTTBuffers(),this._renderToScreenVertexBuffer},enumerable:!0,configurable:!0}),Object.defineProperty(RTTBufferManager.prototype,"indexBuffer",{get:function(){return this._indexBuffer},enumerable:!0,configurable:!0}),Object.defineProperty(RTTBufferManager.prototype,"renderToTextureRect",{get:function(){return this._buffersInvalid&&this.updateRTTBuffers(),this._renderToTextureRect},enumerable:!0,configurable:!0}),Object.defineProperty(RTTBufferManager.prototype,"textureWidth",{get:function(){return this._textureWidth},enumerable:!0,configurable:!0}),Object.defineProperty(RTTBufferManager.prototype,"textureHeight",{get:function(){return this._textureHeight},enumerable:!0,configurable:!0}),RTTBufferManager.prototype.dispose=function(){RTTBufferManager.deleteRTTBufferManager(this._stage),this._indexBuffer&&(this._indexBuffer.dispose(),this._renderToScreenVertexBuffer.dispose(),this._renderToTextureVertexBuffer.dispose(),this._renderToScreenVertexBuffer=null,this._renderToTextureVertexBuffer=null,this._indexBuffer=null)},RTTBufferManager.prototype.updateRTTBuffers=function(){var textureVerts,screenVerts,x,y,context=this._stage.context;null==this._renderToTextureVertexBuffer&&(this._renderToTextureVertexBuffer=context.createVertexBuffer(4,5)),null==this._renderToScreenVertexBuffer&&(this._renderToScreenVertexBuffer=context.createVertexBuffer(4,5)),this._indexBuffer||(this._indexBuffer=context.createIndexBuffer(6),this._indexBuffer.uploadFromArray([2,1,0,3,2,0],0,6)),this._textureRatioX=x=Math.min(this._viewWidth/this._textureWidth,1),this._textureRatioY=y=Math.min(this._viewHeight/this._textureHeight,1);var u1=.5*(1-x),u2=.5*(x+1),v1=.5*(y+1),v2=.5*(1-y);textureVerts=[-x,-y,u1,v1,0,x,-y,u2,v1,1,x,y,u2,v2,2,-x,y,u1,v2,3],screenVerts=[-1,-1,u1,v1,0,1,-1,u2,v1,1,1,1,u2,v2,2,-1,1,u1,v2,3],this._renderToTextureVertexBuffer.uploadFromArray(textureVerts,0,4),this._renderToScreenVertexBuffer.uploadFromArray(screenVerts,0,4),this._buffersInvalid=!1},RTTBufferManager}(away.events.EventDispatcher);managers.RTTBufferManager=RTTBufferManager;var RTTBufferManagerVO=function(){function RTTBufferManagerVO(){}return RTTBufferManagerVO}()}(away.managers||(away.managers={}));away.managers}(away||(away={}));var SingletonEnforcer=function(){function SingletonEnforcer(){}return SingletonEnforcer}(),away;!function(away){!function(materials){var TriangleSubGeometry=away.base.TriangleSubGeometry,ContextGLTriangleFace=away.stagegl.ContextGLTriangleFace,ShaderObjectBase=function(){function ShaderObjectBase(profile){this._defaultCulling=ContextGLTriangleFace.BACK,this._pInverseSceneMatrix=new Array,this.ambientR=255,this.ambientG=255,this.ambientB=255,this.usesGlobalPosFragment=!1,this.vertexConstantData=new Array,this.fragmentConstantData=new Array,this.profile=profile}return ShaderObjectBase.prototype.createCompiler=function(material,materialPass){return new materials.ShaderCompilerBase(material,materialPass,this)},ShaderObjectBase.prototype.reset=function(){this.projectionDependencies=0,this.normalDependencies=0,this.viewDirDependencies=0,this.uvDependencies=0,this.secondaryUVDependencies=0,this.globalPosDependencies=0,this.tangentDependencies=0,this.usesGlobalPosFragment=!1,this.usesFragmentAnimation=!1,this.usesTangentSpace=!1,this.outputsNormals=!1,this.outputsTangentNormals=!1},ShaderObjectBase.prototype.addWorldSpaceDependencies=function(){this.viewDirDependencies>0&&++this.globalPosDependencies},ShaderObjectBase.prototype.pInitRegisterIndices=function(){this.commonsDataIndex=-1,this.cameraPositionIndex=-1,this.uvBufferIndex=-1,this.uvTransformIndex=-1,this.secondaryUVBufferIndex=-1,this.normalBufferIndex=-1,this.tangentBufferIndex=-1,this.sceneMatrixIndex=-1,this.sceneNormalMatrixIndex=-1},ShaderObjectBase.prototype.initConstantData=function(registerCache,animatableAttributes,animationTargetRegisters,uvSource,uvTarget){this.numUsedVertexConstants=registerCache.numUsedVertexConstants,this.numUsedFragmentConstants=registerCache.numUsedFragmentConstants,this.numUsedStreams=registerCache.numUsedStreams,this.numUsedTextures=registerCache.numUsedTextures,this.numUsedVaryings=registerCache.numUsedVaryings,this.numUsedFragmentConstants=registerCache.numUsedFragmentConstants,this.animatableAttributes=animatableAttributes,this.animationTargetRegisters=animationTargetRegisters,this.uvSource=uvSource,this.uvTarget=uvTarget,this.vertexConstantData.length=4*this.numUsedVertexConstants,this.fragmentConstantData.length=4*this.numUsedFragmentConstants,this.fragmentConstantData[this.commonsDataIndex]=.5,this.fragmentConstantData[this.commonsDataIndex+1]=0,this.fragmentConstantData[this.commonsDataIndex+2]=1/255,this.fragmentConstantData[this.commonsDataIndex+3]=1,this.uvTransformIndex>=0&&(this.vertexConstantData[this.uvTransformIndex]=1,this.vertexConstantData[this.uvTransformIndex+1]=0,this.vertexConstantData[this.uvTransformIndex+2]=0,this.vertexConstantData[this.uvTransformIndex+3]=0,this.vertexConstantData[this.uvTransformIndex+4]=0,this.vertexConstantData[this.uvTransformIndex+5]=1,this.vertexConstantData[this.uvTransformIndex+6]=0,this.vertexConstantData[this.uvTransformIndex+7]=0),this.cameraPositionIndex>=0&&(this.vertexConstantData[this.cameraPositionIndex+3]=1)},ShaderObjectBase.prototype.iActivate=function(stage,camera){if(stage.context.setCulling(this.useBothSides?ContextGLTriangleFace.NONE:this._defaultCulling,camera.projection.coordinateSystem),!this.usesTangentSpace&&this.cameraPositionIndex>=0){var pos=camera.scenePosition;this.vertexConstantData[this.cameraPositionIndex]=pos.x,this.vertexConstantData[this.cameraPositionIndex+1]=pos.y,this.vertexConstantData[this.cameraPositionIndex+2]=pos.z}},ShaderObjectBase.prototype.iDeactivate=function(){},ShaderObjectBase.prototype.setRenderState=function(renderable,stage,camera){var context=stage.context;if(renderable.materialOwner.animator&&renderable.materialOwner.animator.setRenderState(this,renderable,stage,camera,this.numUsedVertexConstants,this.numUsedStreams),this.uvBufferIndex>=0&&context.activateBuffer(this.uvBufferIndex,renderable.getVertexData(TriangleSubGeometry.UV_DATA),renderable.getVertexOffset(TriangleSubGeometry.UV_DATA),TriangleSubGeometry.UV_FORMAT),this.secondaryUVBufferIndex>=0&&context.activateBuffer(this.secondaryUVBufferIndex,renderable.getVertexData(TriangleSubGeometry.SECONDARY_UV_DATA),renderable.getVertexOffset(TriangleSubGeometry.SECONDARY_UV_DATA),TriangleSubGeometry.SECONDARY_UV_FORMAT),this.normalBufferIndex>=0&&context.activateBuffer(this.normalBufferIndex,renderable.getVertexData(TriangleSubGeometry.NORMAL_DATA),renderable.getVertexOffset(TriangleSubGeometry.NORMAL_DATA),TriangleSubGeometry.NORMAL_FORMAT),this.tangentBufferIndex>=0&&context.activateBuffer(this.tangentBufferIndex,renderable.getVertexData(TriangleSubGeometry.TANGENT_DATA),renderable.getVertexOffset(TriangleSubGeometry.TANGENT_DATA),TriangleSubGeometry.TANGENT_FORMAT),this.usesUVTransform){var uvTransform=renderable.materialOwner.uvTransform.matrix;uvTransform?(this.vertexConstantData[this.uvTransformIndex]=uvTransform.a,this.vertexConstantData[this.uvTransformIndex+1]=uvTransform.b,this.vertexConstantData[this.uvTransformIndex+3]=uvTransform.tx,this.vertexConstantData[this.uvTransformIndex+4]=uvTransform.c,this.vertexConstantData[this.uvTransformIndex+5]=uvTransform.d,this.vertexConstantData[this.uvTransformIndex+7]=uvTransform.ty):(this.vertexConstantData[this.uvTransformIndex]=1,this.vertexConstantData[this.uvTransformIndex+1]=0,this.vertexConstantData[this.uvTransformIndex+3]=0,this.vertexConstantData[this.uvTransformIndex+4]=0,this.vertexConstantData[this.uvTransformIndex+5]=1,this.vertexConstantData[this.uvTransformIndex+7]=0)}if(this.sceneNormalMatrixIndex>=0&&renderable.sourceEntity.inverseSceneTransform.copyRawDataTo(this.vertexConstantData,this.sceneNormalMatrixIndex,!1),this.usesTangentSpace&&this.cameraPositionIndex>=0){renderable.sourceEntity.inverseSceneTransform.copyRawDataTo(this._pInverseSceneMatrix);var pos=camera.scenePosition,x=pos.x,y=pos.y,z=pos.z;this.vertexConstantData[this.cameraPositionIndex]=this._pInverseSceneMatrix[0]*x+this._pInverseSceneMatrix[4]*y+this._pInverseSceneMatrix[8]*z+this._pInverseSceneMatrix[12],this.vertexConstantData[this.cameraPositionIndex+1]=this._pInverseSceneMatrix[1]*x+this._pInverseSceneMatrix[5]*y+this._pInverseSceneMatrix[9]*z+this._pInverseSceneMatrix[13],this.vertexConstantData[this.cameraPositionIndex+2]=this._pInverseSceneMatrix[2]*x+this._pInverseSceneMatrix[6]*y+this._pInverseSceneMatrix[10]*z+this._pInverseSceneMatrix[14] -}},ShaderObjectBase.prototype.dispose=function(){},ShaderObjectBase}();materials.ShaderObjectBase=ShaderObjectBase}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var ShaderLightingObject=function(_super){function ShaderLightingObject(profile){_super.call(this,profile)}return __extends(ShaderLightingObject,_super),ShaderLightingObject.prototype.createCompiler=function(material,materialPass){return new materials.ShaderLightingCompiler(material,materialPass,this)},ShaderLightingObject.prototype.reset=function(){_super.prototype.reset.call(this),this.numLights=0,this.usesLightFallOff=!0},ShaderLightingObject.prototype.addWorldSpaceDependencies=function(fragmentLights){_super.prototype.addWorldSpaceDependencies.call(this,fragmentLights),this.numPointLights>0&&this.usesLights&&(++this.globalPosDependencies,fragmentLights&&(this.usesGlobalPosFragment=!0))},ShaderLightingObject.prototype.setRenderState=function(renderable,stage,camera,viewProjection){_super.prototype.setRenderState.call(this,renderable,stage,camera,viewProjection),this.usesLights&&this.updateLights(),this.usesProbes&&this.updateProbes(stage)},ShaderLightingObject.prototype.updateLights=function(){var dirLight,pointLight,len,dirPos,l,offset,i=0,k=0,total=0,numLightTypes=this.usesShadows?2:1;this.ambientR=this.ambientG=this.ambientB=0,l=this.lightVertexConstantIndex,k=this.lightFragmentConstantIndex;var cast=0,dirLights=this.lightPicker.directionalLights;for(offset=this.directionalLightsOffset,len=this.lightPicker.directionalLights.length,offset>len&&(cast=1,offset-=len);numLightTypes>cast;++cast)for(cast&&(dirLights=this.lightPicker.castingDirectionalLights),len=dirLights.length,len>this.numDirectionalLights&&(len=this.numDirectionalLights),i=0;len>i;++i){if(dirLight=dirLights[offset+i],dirPos=dirLight.sceneDirection,this.ambientR+=dirLight._iAmbientR,this.ambientG+=dirLight._iAmbientG,this.ambientB+=dirLight._iAmbientB,this.usesTangentSpace){var x=-dirPos.x,y=-dirPos.y,z=-dirPos.z;this.vertexConstantData[l++]=this._pInverseSceneMatrix[0]*x+this._pInverseSceneMatrix[4]*y+this._pInverseSceneMatrix[8]*z,this.vertexConstantData[l++]=this._pInverseSceneMatrix[1]*x+this._pInverseSceneMatrix[5]*y+this._pInverseSceneMatrix[9]*z,this.vertexConstantData[l++]=this._pInverseSceneMatrix[2]*x+this._pInverseSceneMatrix[6]*y+this._pInverseSceneMatrix[10]*z,this.vertexConstantData[l++]=1}else this.fragmentConstantData[k++]=-dirPos.x,this.fragmentConstantData[k++]=-dirPos.y,this.fragmentConstantData[k++]=-dirPos.z,this.fragmentConstantData[k++]=1;this.fragmentConstantData[k++]=dirLight._iDiffuseR,this.fragmentConstantData[k++]=dirLight._iDiffuseG,this.fragmentConstantData[k++]=dirLight._iDiffuseB,this.fragmentConstantData[k++]=1,this.fragmentConstantData[k++]=dirLight._iSpecularR,this.fragmentConstantData[k++]=dirLight._iSpecularG,this.fragmentConstantData[k++]=dirLight._iSpecularB,this.fragmentConstantData[k++]=1,++total==this.numDirectionalLights&&(i=len,cast=numLightTypes)}if(this.numDirectionalLights>total)for(i=k+12*(this.numDirectionalLights-total);i>k;)this.fragmentConstantData[k++]=0;total=0;var pointLights=this.lightPicker.pointLights;for(offset=this.pointLightsOffset,len=this.lightPicker.pointLights.length,offset>len?(cast=1,offset-=len):cast=0;numLightTypes>cast;++cast)for(cast&&(pointLights=this.lightPicker.castingPointLights),len=pointLights.length,i=0;len>i;++i){pointLight=pointLights[offset+i],dirPos=pointLight.scenePosition,this.ambientR+=pointLight._iAmbientR,this.ambientG+=pointLight._iAmbientG,this.ambientB+=pointLight._iAmbientB,this.usesTangentSpace?(x=dirPos.x,y=dirPos.y,z=dirPos.z,this.vertexConstantData[l++]=this._pInverseSceneMatrix[0]*x+this._pInverseSceneMatrix[4]*y+this._pInverseSceneMatrix[8]*z+this._pInverseSceneMatrix[12],this.vertexConstantData[l++]=this._pInverseSceneMatrix[1]*x+this._pInverseSceneMatrix[5]*y+this._pInverseSceneMatrix[9]*z+this._pInverseSceneMatrix[13],this.vertexConstantData[l++]=this._pInverseSceneMatrix[2]*x+this._pInverseSceneMatrix[6]*y+this._pInverseSceneMatrix[10]*z+this._pInverseSceneMatrix[14],this.vertexConstantData[l++]=1):this.usesGlobalPosFragment?(this.fragmentConstantData[k++]=dirPos.x,this.fragmentConstantData[k++]=dirPos.y,this.fragmentConstantData[k++]=dirPos.z,this.fragmentConstantData[k++]=1):(this.vertexConstantData[l++]=dirPos.x,this.vertexConstantData[l++]=dirPos.y,this.vertexConstantData[l++]=dirPos.z,this.vertexConstantData[l++]=1),this.fragmentConstantData[k++]=pointLight._iDiffuseR,this.fragmentConstantData[k++]=pointLight._iDiffuseG,this.fragmentConstantData[k++]=pointLight._iDiffuseB;var radius=pointLight._pRadius;this.fragmentConstantData[k++]=radius*radius,this.fragmentConstantData[k++]=pointLight._iSpecularR,this.fragmentConstantData[k++]=pointLight._iSpecularG,this.fragmentConstantData[k++]=pointLight._iSpecularB,this.fragmentConstantData[k++]=pointLight._pFallOffFactor,++total==this.numPointLights&&(i=len,cast=numLightTypes)}if(this.numPointLights>total)for(i=k+12*(total-this.numPointLights);i>k;++k)this.fragmentConstantData[k]=0},ShaderLightingObject.prototype.updateProbes=function(stage){var probe,lightProbes=this.lightPicker.lightProbes,weights=this.lightPicker.lightProbeWeights,len=lightProbes.length-this.lightProbesOffset,addDiff=this.usesProbesForDiffuse,addSpec=this.usesProbesForSpecular;if(addDiff||addSpec){len>this.numLightProbes&&(len=this.numLightProbes);for(var i=0;len>i;++i)probe=lightProbes[this.lightProbesOffset+i],addDiff&&stage.context.activateCubeTexture(this.lightProbeDiffuseIndices[i],probe.diffuseMap),addSpec&&stage.context.activateCubeTexture(this.lightProbeSpecularIndices[i],probe.specularMap);for(i=0;len>i;++i)this.fragmentConstantData[this.probeWeightsIndex+i]=weights[this.lightProbesOffset+i]}},ShaderLightingObject}(materials.ShaderObjectBase);materials.ShaderLightingObject=ShaderLightingObject}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var MethodVO=function(){function MethodVO(method){this.useMethod=!0,this.method=method}return MethodVO.prototype.reset=function(){this.method.iReset(),this.texturesIndex=-1,this.vertexConstantsIndex=-1,this.fragmentConstantsIndex=-1,this.needsProjection=!1,this.needsView=!1,this.needsNormals=!1,this.needsTangents=!1,this.needsUV=!1,this.needsSecondaryUV=!1,this.needsGlobalVertexPos=!1,this.needsGlobalFragmentPos=!1},MethodVO}();materials.MethodVO=MethodVO}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var RegisterPool=function(){function RegisterPool(regName,regCount,persistent){"undefined"==typeof persistent&&(persistent=!0),this._regName=regName,this._regCount=regCount,this._persistent=persistent,this.initRegisters(regName,regCount)}return RegisterPool.prototype.requestFreeVectorReg=function(){for(var i=0;i0))for(var j=0;4>j;++j)if(0==this._usedSingleCount[j][i])return this._persistent&&this._usedSingleCount[j][i]++,this._registerComponents[j][i];throw new Error("Register overflow!")},RegisterPool.prototype.addUsage=function(register,usageCount){register._component>-1?this._usedSingleCount[register._component][register.index]+=usageCount:this._usedVectorCount[register.index]+=usageCount},RegisterPool.prototype.removeUsage=function(register){if(register._component>-1){if(--this._usedSingleCount[register._component][register.index]<0)throw new Error("More usages removed than exist!")}else if(--this._usedVectorCount[register.index]<0)throw new Error("More usages removed than exist!")},RegisterPool.prototype.dispose=function(){this._vectorRegisters=null,this._registerComponents=null,this._usedSingleCount=null,this._usedVectorCount=null},RegisterPool.prototype.hasRegisteredRegs=function(){for(var i=0;ii;++i){vectorRegisters[i]=new materials.ShaderRegisterElement(regName,i);for(var j=0;4>j;++j)registerComponents[j][i]=new materials.ShaderRegisterElement(regName,i,j)}return hash},RegisterPool.prototype.isRegisterUsed=function(index){if(this._usedVectorCount[index]>0)return!0;for(var i=0;4>i;++i)if(this._usedSingleCount[i][index]>0)return!0;return!1},RegisterPool.prototype._initArray=function(a,val){for(var l=a.length,c=0;l>c;c++)a[c]=val;return a},RegisterPool._regPool=new Object,RegisterPool._regCompsPool=new Object,RegisterPool}();materials.RegisterPool=RegisterPool}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var ShaderRegisterCache=function(){function ShaderRegisterCache(profile){this._numUsedVertexConstants=0,this._numUsedFragmentConstants=0,this._numUsedStreams=0,this._numUsedTextures=0,this._numUsedVaryings=0,this._profile=profile}return ShaderRegisterCache.prototype.reset=function(){this._fragmentTempCache=new materials.RegisterPool("ft",8,!1),this._vertexTempCache=new materials.RegisterPool("vt",8,!1),this._varyingCache=new materials.RegisterPool("v",8),this._textureCache=new materials.RegisterPool("fs",8),this._vertexAttributesCache=new materials.RegisterPool("va",8),this._fragmentConstantsCache=new materials.RegisterPool("fc",28),this._vertexConstantsCache=new materials.RegisterPool("vc",128),this._fragmentOutputRegister=new materials.ShaderRegisterElement("oc",-1),this._vertexOutputRegister=new materials.ShaderRegisterElement("op",-1),this._numUsedVertexConstants=0,this._numUsedStreams=0,this._numUsedTextures=0,this._numUsedVaryings=0,this._numUsedFragmentConstants=0;var i;for(i=0;i=0&&(this._toStr+=this._index),component>-1&&(this._toStr+="."+ShaderRegisterElement.COMPONENTS[component])}return ShaderRegisterElement.prototype.toString=function(){return this._toStr},Object.defineProperty(ShaderRegisterElement.prototype,"regName",{get:function(){return this._regName},enumerable:!0,configurable:!0}),Object.defineProperty(ShaderRegisterElement.prototype,"index",{get:function(){return this._index},enumerable:!0,configurable:!0}),ShaderRegisterElement.COMPONENTS=["x","y","z","w"],ShaderRegisterElement}();materials.ShaderRegisterElement=ShaderRegisterElement}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var ShaderCompilerBase=function(){function ShaderCompilerBase(material,materialPass,shaderObject){this._pVertexCode="",this._pFragmentCode="",this._pPostAnimationFragmentCode="",this._pMaterial=material,this._pMaterialPass=materialPass,this._pShaderObject=shaderObject,this._pProfile=shaderObject.profile,this._pSharedRegisters=new materials.ShaderRegisterData,this._pRegisterCache=new materials.ShaderRegisterCache(this._pProfile),this._pRegisterCache.vertexAttributesOffset=1,this._pRegisterCache.reset()}return ShaderCompilerBase.prototype.compile=function(){this._pShaderObject.reset(),this.pCalculateDependencies(),this.pInitRegisterIndices(),this.pCompileDependencies(),this._pVertexCode+=this._pMaterialPass._iGetVertexCode(this._pShaderObject,this._pRegisterCache,this._pSharedRegisters),this._pPostAnimationFragmentCode+=this._pMaterialPass._iGetFragmentCode(this._pShaderObject,this._pRegisterCache,this._pSharedRegisters),this._pPostAnimationFragmentCode+="mov "+this._pRegisterCache.fragmentOutputRegister+", "+this._pSharedRegisters.shadedTarget+"\n",this._pRegisterCache.removeFragmentTempUsage(this._pSharedRegisters.shadedTarget),this._pShaderObject.initConstantData(this._pRegisterCache,this._pAnimatableAttributes,this._pAnimationTargetRegisters,this._uvSource,this._uvTarget),this._pMaterialPass._iInitConstantData(this._pShaderObject)},ShaderCompilerBase.prototype.pCompileDependencies=function(){this._pSharedRegisters.shadedTarget=this._pRegisterCache.getFreeFragmentVectorTemp(),this._pRegisterCache.addFragmentTempUsages(this._pSharedRegisters.shadedTarget,1),this._pShaderObject.globalPosDependencies>0&&this.compileGlobalPositionCode(),this._pShaderObject.uvDependencies>0&&this.compileUVCode(),this._pShaderObject.secondaryUVDependencies>0&&this.compileSecondaryUVCode(),this._pShaderObject.normalDependencies>0&&this.compileNormalCode(),this._pShaderObject.viewDirDependencies>0&&this.compileViewDirCode(),this._pVertexCode+=this._pMaterial._iGetVertexCode(this._pShaderObject,this._pRegisterCache,this._pSharedRegisters),this._pFragmentCode+=this._pMaterial._iGetFragmentCode(this._pShaderObject,this._pRegisterCache,this._pSharedRegisters),this._pVertexCode+=this._pMaterialPass._iGetPreLightingVertexCode(this._pShaderObject,this._pRegisterCache,this._pSharedRegisters),this._pFragmentCode+=this._pMaterialPass._iGetPreLightingFragmentCode(this._pShaderObject,this._pRegisterCache,this._pSharedRegisters)},ShaderCompilerBase.prototype.compileGlobalPositionCode=function(){this._pRegisterCache.addVertexTempUsages(this._pSharedRegisters.globalPositionVertex=this._pRegisterCache.getFreeVertexVectorTemp(),this._pShaderObject.globalPosDependencies);var sceneMatrixReg=this._pRegisterCache.getFreeVertexConstant();this._pRegisterCache.getFreeVertexConstant(),this._pRegisterCache.getFreeVertexConstant(),this._pRegisterCache.getFreeVertexConstant(),this._pShaderObject.sceneMatrixIndex=4*sceneMatrixReg.index,this._pVertexCode+="m44 "+this._pSharedRegisters.globalPositionVertex+", "+this._pSharedRegisters.localPosition+", "+sceneMatrixReg+"\n",this._pShaderObject.usesGlobalPosFragment&&(this._pSharedRegisters.globalPositionVarying=this._pRegisterCache.getFreeVarying(),this._pVertexCode+="mov "+this._pSharedRegisters.globalPositionVarying+", "+this._pSharedRegisters.globalPositionVertex+"\n")},ShaderCompilerBase.prototype.compileUVCode=function(){var uvAttributeReg=this._pRegisterCache.getFreeVertexAttribute();this._pShaderObject.uvBufferIndex=uvAttributeReg.index;var varying=this._pRegisterCache.getFreeVarying();if(this._pSharedRegisters.uvVarying=varying,this._pShaderObject.usesUVTransform){var uvTransform1=this._pRegisterCache.getFreeVertexConstant(),uvTransform2=this._pRegisterCache.getFreeVertexConstant();this._pShaderObject.uvTransformIndex=4*uvTransform1.index,this._pVertexCode+="dp4 "+varying+".x, "+uvAttributeReg+", "+uvTransform1+"\ndp4 "+varying+".y, "+uvAttributeReg+", "+uvTransform2+"\nmov "+varying+".zw, "+uvAttributeReg+".zw \n"}else this._pShaderObject.uvTransformIndex=-1,this._uvTarget=varying.toString(),this._uvSource=uvAttributeReg.toString()},ShaderCompilerBase.prototype.compileSecondaryUVCode=function(){var uvAttributeReg=this._pRegisterCache.getFreeVertexAttribute();this._pShaderObject.secondaryUVBufferIndex=uvAttributeReg.index,this._pSharedRegisters.secondaryUVVarying=this._pRegisterCache.getFreeVarying(),this._pVertexCode+="mov "+this._pSharedRegisters.secondaryUVVarying+", "+uvAttributeReg+"\n"},ShaderCompilerBase.prototype.compileViewDirCode=function(){var cameraPositionReg=this._pRegisterCache.getFreeVertexConstant();if(this._pSharedRegisters.viewDirVarying=this._pRegisterCache.getFreeVarying(),this._pSharedRegisters.viewDirFragment=this._pRegisterCache.getFreeFragmentVectorTemp(),this._pRegisterCache.addFragmentTempUsages(this._pSharedRegisters.viewDirFragment,this._pShaderObject.viewDirDependencies),this._pShaderObject.cameraPositionIndex=4*cameraPositionReg.index,this._pShaderObject.usesTangentSpace){var temp=this._pRegisterCache.getFreeVertexVectorTemp();this._pVertexCode+="sub "+temp+", "+cameraPositionReg+", "+this._pSharedRegisters.localPosition+"\nm33 "+this._pSharedRegisters.viewDirVarying+".xyz, "+temp+", "+this._pSharedRegisters.animatedTangent+"\nmov "+this._pSharedRegisters.viewDirVarying+".w, "+this._pSharedRegisters.localPosition+".w\n"}else this._pVertexCode+="sub "+this._pSharedRegisters.viewDirVarying+", "+cameraPositionReg+", "+this._pSharedRegisters.globalPositionVertex+"\n",this._pRegisterCache.removeVertexTempUsage(this._pSharedRegisters.globalPositionVertex);this._pFragmentCode+="nrm "+this._pSharedRegisters.viewDirFragment+".xyz, "+this._pSharedRegisters.viewDirVarying+"\nmov "+this._pSharedRegisters.viewDirFragment+".w, "+this._pSharedRegisters.viewDirVarying+".w\n"},ShaderCompilerBase.prototype.compileNormalCode=function(){if(this._pSharedRegisters.normalFragment=this._pRegisterCache.getFreeFragmentVectorTemp(),this._pRegisterCache.addFragmentTempUsages(this._pSharedRegisters.normalFragment,this._pShaderObject.normalDependencies),this._pShaderObject.outputsNormals&&!this._pShaderObject.outputsTangentNormals)return this._pVertexCode+=this._pMaterialPass._iGetNormalVertexCode(this._pShaderObject,this._pRegisterCache,this._pSharedRegisters),this._pFragmentCode+=this._pMaterialPass._iGetNormalFragmentCode(this._pShaderObject,this._pRegisterCache,this._pSharedRegisters),void 0;var normalMatrix;if(this._pShaderObject.outputsNormals&&this._pShaderObject.usesTangentSpace||(normalMatrix=new Array(3),normalMatrix[0]=this._pRegisterCache.getFreeVertexConstant(),normalMatrix[1]=this._pRegisterCache.getFreeVertexConstant(),normalMatrix[2]=this._pRegisterCache.getFreeVertexConstant(),this._pRegisterCache.getFreeVertexConstant(),this._pShaderObject.sceneNormalMatrixIndex=4*normalMatrix[0].index,this._pSharedRegisters.normalVarying=this._pRegisterCache.getFreeVarying()),this._pShaderObject.outputsNormals)if(this._pShaderObject.usesTangentSpace)this._pVertexCode+="nrm "+this._pSharedRegisters.animatedNormal+".xyz, "+this._pSharedRegisters.animatedNormal+"\nnrm "+this._pSharedRegisters.animatedTangent+".xyz, "+this._pSharedRegisters.animatedTangent+"\ncrs "+this._pSharedRegisters.bitangent+".xyz, "+this._pSharedRegisters.animatedNormal+", "+this._pSharedRegisters.animatedTangent+"\n",this._pFragmentCode+=this._pMaterialPass._iGetNormalFragmentCode(this._pShaderObject,this._pRegisterCache,this._pSharedRegisters);else{this._pSharedRegisters.tangentVarying=this._pRegisterCache.getFreeVarying(),this._pSharedRegisters.bitangentVarying=this._pRegisterCache.getFreeVarying();var temp=this._pRegisterCache.getFreeVertexVectorTemp();this._pVertexCode+="m33 "+temp+".xyz, "+this._pSharedRegisters.animatedNormal+", "+normalMatrix[0]+"\nnrm "+this._pSharedRegisters.animatedNormal+".xyz, "+temp+"\nm33 "+temp+".xyz, "+this._pSharedRegisters.animatedTangent+", "+normalMatrix[0]+"\nnrm "+this._pSharedRegisters.animatedTangent+".xyz, "+temp+"\nmov "+this._pSharedRegisters.tangentVarying+".x, "+this._pSharedRegisters.animatedTangent+".x \nmov "+this._pSharedRegisters.tangentVarying+".z, "+this._pSharedRegisters.animatedNormal+".x \nmov "+this._pSharedRegisters.tangentVarying+".w, "+this._pSharedRegisters.normalInput+".w \nmov "+this._pSharedRegisters.bitangentVarying+".x, "+this._pSharedRegisters.animatedTangent+".y \nmov "+this._pSharedRegisters.bitangentVarying+".z, "+this._pSharedRegisters.animatedNormal+".y \nmov "+this._pSharedRegisters.bitangentVarying+".w, "+this._pSharedRegisters.normalInput+".w \nmov "+this._pSharedRegisters.normalVarying+".x, "+this._pSharedRegisters.animatedTangent+".z \nmov "+this._pSharedRegisters.normalVarying+".z, "+this._pSharedRegisters.animatedNormal+".z \nmov "+this._pSharedRegisters.normalVarying+".w, "+this._pSharedRegisters.normalInput+".w \ncrs "+temp+".xyz, "+this._pSharedRegisters.animatedNormal+", "+this._pSharedRegisters.animatedTangent+"\nmov "+this._pSharedRegisters.tangentVarying+".y, "+temp+".x \nmov "+this._pSharedRegisters.bitangentVarying+".y, "+temp+".y \nmov "+this._pSharedRegisters.normalVarying+".y, "+temp+".z \n",this._pRegisterCache.removeVertexTempUsage(this._pSharedRegisters.animatedTangent);var t,b,n;t=this._pRegisterCache.getFreeFragmentVectorTemp(),this._pRegisterCache.addFragmentTempUsages(t,1),b=this._pRegisterCache.getFreeFragmentVectorTemp(),this._pRegisterCache.addFragmentTempUsages(b,1),n=this._pRegisterCache.getFreeFragmentVectorTemp(),this._pRegisterCache.addFragmentTempUsages(n,1),this._pFragmentCode+="nrm "+t+".xyz, "+this._pSharedRegisters.tangentVarying+"\nmov "+t+".w, "+this._pSharedRegisters.tangentVarying+".w \nnrm "+b+".xyz, "+this._pSharedRegisters.bitangentVarying+"\nnrm "+n+".xyz, "+this._pSharedRegisters.normalVarying+"\n",this._pFragmentCode+=this._pMaterialPass._iGetNormalFragmentCode(this._pShaderObject,this._pRegisterCache,this._pSharedRegisters)+"m33 "+this._pSharedRegisters.normalFragment+".xyz, "+this._pSharedRegisters.normalFragment+", "+t+"\nmov "+this._pSharedRegisters.normalFragment+".w, "+this._pSharedRegisters.normalVarying+".w\n",this._pRegisterCache.removeFragmentTempUsage(b),this._pRegisterCache.removeFragmentTempUsage(t),this._pRegisterCache.removeFragmentTempUsage(n)}else this._pVertexCode+="m33 "+this._pSharedRegisters.normalVarying+".xyz, "+this._pSharedRegisters.animatedNormal+", "+normalMatrix[0]+"\nmov "+this._pSharedRegisters.normalVarying+".w, "+this._pSharedRegisters.animatedNormal+".w\n",this._pFragmentCode+="nrm "+this._pSharedRegisters.normalFragment+".xyz, "+this._pSharedRegisters.normalVarying+"\nmov "+this._pSharedRegisters.normalFragment+".w, "+this._pSharedRegisters.normalVarying+".w\n",this._pShaderObject.tangentDependencies>0&&(this._pSharedRegisters.tangentVarying=this._pRegisterCache.getFreeVarying(),this._pVertexCode+="m33 "+this._pSharedRegisters.tangentVarying+".xyz, "+this._pSharedRegisters.animatedTangent+", "+normalMatrix[0]+"\nmov "+this._pSharedRegisters.tangentVarying+".w, "+this._pSharedRegisters.animatedTangent+".w\n");this._pShaderObject.usesTangentSpace||this._pRegisterCache.removeVertexTempUsage(this._pSharedRegisters.animatedNormal)},ShaderCompilerBase.prototype.pInitRegisterIndices=function(){this._pShaderObject.pInitRegisterIndices(),this._pAnimatableAttributes=new Array("va0"),this._pAnimationTargetRegisters=new Array("vt0"),this._pVertexCode="",this._pFragmentCode="",this._pPostAnimationFragmentCode="",this._pRegisterCache.addVertexTempUsages(this._pSharedRegisters.localPosition=this._pRegisterCache.getFreeVertexVectorTemp(),1),this._pSharedRegisters.commons=this._pRegisterCache.getFreeFragmentConstant(),this._pShaderObject.commonsDataIndex=4*this._pSharedRegisters.commons.index,(this._pShaderObject.tangentDependencies>0||this._pShaderObject.outputsNormals)&&(this._pSharedRegisters.tangentInput=this._pRegisterCache.getFreeVertexAttribute(),this._pShaderObject.tangentBufferIndex=this._pSharedRegisters.tangentInput.index,this._pSharedRegisters.animatedTangent=this._pRegisterCache.getFreeVertexVectorTemp(),this._pRegisterCache.addVertexTempUsages(this._pSharedRegisters.animatedTangent,1),this._pShaderObject.usesTangentSpace&&(this._pSharedRegisters.bitangent=this._pRegisterCache.getFreeVertexVectorTemp(),this._pRegisterCache.addVertexTempUsages(this._pSharedRegisters.bitangent,1)),this._pAnimatableAttributes.push(this._pSharedRegisters.tangentInput.toString()),this._pAnimationTargetRegisters.push(this._pSharedRegisters.animatedTangent.toString())),this._pShaderObject.normalDependencies>0&&(this._pSharedRegisters.normalInput=this._pRegisterCache.getFreeVertexAttribute(),this._pShaderObject.normalBufferIndex=this._pSharedRegisters.normalInput.index,this._pSharedRegisters.animatedNormal=this._pRegisterCache.getFreeVertexVectorTemp(),this._pRegisterCache.addVertexTempUsages(this._pSharedRegisters.animatedNormal,1),this._pAnimatableAttributes.push(this._pSharedRegisters.normalInput.toString()),this._pAnimationTargetRegisters.push(this._pSharedRegisters.animatedNormal.toString()))},ShaderCompilerBase.prototype.pCalculateDependencies=function(){this._pShaderObject.useAlphaPremultiplied=this._pMaterial.alphaPremultiplied,this._pShaderObject.useBothSides=this._pMaterial.bothSides,this._pShaderObject.useMipmapping=this._pMaterial.mipmap,this._pShaderObject.useSmoothTextures=this._pMaterial.smooth,this._pShaderObject.repeatTextures=this._pMaterial.repeat,this._pShaderObject.usesUVTransform=this._pMaterial.animateUVs,this._pShaderObject.alphaThreshold=this._pMaterial.alphaThreshold,this._pShaderObject.texture=this._pMaterial.texture,this._pShaderObject.color=this._pMaterial.color,this._pShaderObject.usesFragmentAnimation=Boolean(this._pMaterialPass.passMode==materials.MaterialPassMode.SUPER_SHADER),this._pMaterialPass._iIncludeDependencies(this._pShaderObject)},ShaderCompilerBase.prototype.dispose=function(){this._pRegisterCache.dispose(),this._pRegisterCache=null,this._pSharedRegisters=null},Object.defineProperty(ShaderCompilerBase.prototype,"vertexCode",{get:function(){return this._pVertexCode},enumerable:!0,configurable:!0}),Object.defineProperty(ShaderCompilerBase.prototype,"fragmentCode",{get:function(){return this._pFragmentCode},enumerable:!0,configurable:!0}),Object.defineProperty(ShaderCompilerBase.prototype,"postAnimationFragmentCode",{get:function(){return this._pPostAnimationFragmentCode},enumerable:!0,configurable:!0}),Object.defineProperty(ShaderCompilerBase.prototype,"shadedTarget",{get:function(){return this._pSharedRegisters.shadedTarget.toString()},enumerable:!0,configurable:!0}),ShaderCompilerBase}();materials.ShaderCompilerBase=ShaderCompilerBase}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var ContextGLProfile=away.stagegl.ContextGLProfile,ShaderLightingCompiler=function(_super){function ShaderLightingCompiler(material,materialPass,shaderObject){_super.call(this,material,materialPass,shaderObject),this._materialLightingPass=materialPass,this._shaderLightingObject=shaderObject}return __extends(ShaderLightingCompiler,_super),ShaderLightingCompiler.prototype.pCompileDependencies=function(){_super.prototype.pCompileDependencies.call(this),this._shaderLightingObject.usesShadows&&this.pCompileShadowCode(),this._shaderLightingObject.usesLights&&(this.initLightRegisters(),this.compileLightCode()),this._shaderLightingObject.usesProbes&&this.compileLightProbeCode(),this._pVertexCode+=this._materialLightingPass._iGetPostLightingVertexCode(this._shaderLightingObject,this._pRegisterCache,this._pSharedRegisters),this._pFragmentCode+=this._materialLightingPass._iGetPostLightingFragmentCode(this._shaderLightingObject,this._pRegisterCache,this._pSharedRegisters)},ShaderLightingCompiler.prototype.pCompileShadowCode=function(){this._shaderLightingObject.normalDependencies>0?this._pSharedRegisters.shadowTarget=this._pSharedRegisters.normalFragment:(this._pSharedRegisters.shadowTarget=this._pRegisterCache.getFreeFragmentVectorTemp(),this._pRegisterCache.addFragmentTempUsages(this._pSharedRegisters.shadowTarget,1)) -},ShaderLightingCompiler.prototype.initLightRegisters=function(){var i,len;if(this._dirLightVertexConstants)for(len=this._dirLightVertexConstants.length,i=0;len>i;++i)this._dirLightVertexConstants[i]=this._pRegisterCache.getFreeVertexConstant(),-1==this._shaderLightingObject.lightVertexConstantIndex&&(this._shaderLightingObject.lightVertexConstantIndex=4*this._dirLightVertexConstants[i].index);if(this._pointLightVertexConstants)for(len=this._pointLightVertexConstants.length,i=0;len>i;++i)this._pointLightVertexConstants[i]=this._pRegisterCache.getFreeVertexConstant(),-1==this._shaderLightingObject.lightVertexConstantIndex&&(this._shaderLightingObject.lightVertexConstantIndex=4*this._pointLightVertexConstants[i].index);for(len=this._dirLightFragmentConstants.length,i=0;len>i;++i)this._dirLightFragmentConstants[i]=this._pRegisterCache.getFreeFragmentConstant(),-1==this._shaderLightingObject.lightFragmentConstantIndex&&(this._shaderLightingObject.lightFragmentConstantIndex=4*this._dirLightFragmentConstants[i].index);for(len=this._pointLightFragmentConstants.length,i=0;len>i;++i)this._pointLightFragmentConstants[i]=this._pRegisterCache.getFreeFragmentConstant(),-1==this._shaderLightingObject.lightFragmentConstantIndex&&(this._shaderLightingObject.lightFragmentConstantIndex=4*this._pointLightFragmentConstants[i].index)},ShaderLightingCompiler.prototype.compileLightCode=function(){for(var diffuseColorReg,specularColorReg,lightPosReg,lightDirReg,vertexRegIndex=0,fragmentRegIndex=0,addSpec=this._shaderLightingObject.usesLightsForSpecular,addDiff=this._shaderLightingObject.usesLightsForDiffuse,i=0;i0&&0!=(combinedLightSources&materials.LightSources.LIGHTS),this._shaderLightingObject.usesProbes=numLightProbes>0&&0!=(combinedLightSources&materials.LightSources.PROBES),this._shaderLightingObject.usesLightsForSpecular=numAllLights>0&&0!=(specularLightSources&materials.LightSources.LIGHTS),this._shaderLightingObject.usesProbesForSpecular=numLightProbes>0&&0!=(specularLightSources&materials.LightSources.PROBES),this._shaderLightingObject.usesLightsForDiffuse=numAllLights>0&&0!=(diffuseLightSources&materials.LightSources.LIGHTS),this._shaderLightingObject.usesProbesForDiffuse=numLightProbes>0&&0!=(diffuseLightSources&materials.LightSources.PROBES),this._shaderLightingObject.usesShadows=this._materialLightingPass._iUsesShadows(),_super.prototype.pCalculateDependencies.call(this)},ShaderLightingCompiler}(materials.ShaderCompilerBase);materials.ShaderLightingCompiler=ShaderLightingCompiler}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var ShaderRegisterData=function(){function ShaderRegisterData(){}return ShaderRegisterData}();materials.ShaderRegisterData=ShaderRegisterData}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var ShadingMethodBase=function(_super){function ShadingMethodBase(){_super.call(this)}return __extends(ShadingMethodBase,_super),ShadingMethodBase.prototype.iIsUsed=function(){return!0},ShadingMethodBase.prototype.iInitVO=function(){},ShadingMethodBase.prototype.iInitConstants=function(){},ShadingMethodBase.prototype.iUsesTangentSpace=function(){return!0},Object.defineProperty(ShadingMethodBase.prototype,"passes",{get:function(){return this._passes},enumerable:!0,configurable:!0}),ShadingMethodBase.prototype.dispose=function(){},ShadingMethodBase.prototype.iReset=function(){this.iCleanCompilationData()},ShadingMethodBase.prototype.iCleanCompilationData=function(){},ShadingMethodBase.prototype.iGetVertexCode=function(){return""},ShadingMethodBase.prototype.iGetFragmentCode=function(){return null},ShadingMethodBase.prototype.iActivate=function(){},ShadingMethodBase.prototype.iSetRenderState=function(){},ShadingMethodBase.prototype.iDeactivate=function(){},ShadingMethodBase.prototype.iInvalidateShaderProgram=function(){this.dispatchEvent(new away.events.ShadingMethodEvent(away.events.ShadingMethodEvent.SHADER_INVALIDATED))},ShadingMethodBase.prototype.copyFrom=function(){},ShadingMethodBase}(away.library.NamedAssetBase);materials.ShadingMethodBase=ShadingMethodBase}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var LightingMethodBase=function(_super){function LightingMethodBase(){_super.call(this)}return __extends(LightingMethodBase,_super),LightingMethodBase.prototype.iGetFragmentPreLightingCode=function(){return""},LightingMethodBase.prototype.iGetFragmentCodePerLight=function(){return""},LightingMethodBase.prototype.iGetFragmentCodePerProbe=function(){return""},LightingMethodBase.prototype.iGetFragmentPostLightingCode=function(){return""},LightingMethodBase}(materials.ShadingMethodBase);materials.LightingMethodBase=LightingMethodBase}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var ContextGLMipFilter=away.stagegl.ContextGLMipFilter,ContextGLTextureFilter=away.stagegl.ContextGLTextureFilter,ContextGLWrapMode=away.stagegl.ContextGLWrapMode,AmbientBasicMethod=function(_super){function AmbientBasicMethod(){_super.call(this),this._color=16777215,this._alpha=1,this._colorR=1,this._colorG=1,this._colorB=1,this._ambient=1}return __extends(AmbientBasicMethod,_super),AmbientBasicMethod.prototype.iInitVO=function(shaderObject,methodVO){methodVO.needsUV=Boolean(null!=shaderObject.texture)},AmbientBasicMethod.prototype.iInitConstants=function(shaderObject,methodVO){methodVO.needsUV||(this._color=shaderObject.color,this.updateColor())},Object.defineProperty(AmbientBasicMethod.prototype,"ambient",{get:function(){return this._ambient},set:function(value){this._ambient!=value&&(this._ambient=value,this.updateColor())},enumerable:!0,configurable:!0}),Object.defineProperty(AmbientBasicMethod.prototype,"alpha",{get:function(){return this._alpha},set:function(value){this._alpha!=value&&(this._alpha=value,this.updateColor())},enumerable:!0,configurable:!0}),AmbientBasicMethod.prototype.copyFrom=function(method){},AmbientBasicMethod.prototype.iGetFragmentCode=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){var ambientInputRegister,code="";if(methodVO.needsUV){if(ambientInputRegister=registerCache.getFreeTextureReg(),methodVO.texturesIndex=ambientInputRegister.index,code+=materials.ShaderCompilerHelper.getTex2DSampleCode(targetReg,sharedRegisters,ambientInputRegister,shaderObject.texture,shaderObject.useSmoothTextures,shaderObject.repeatTextures,shaderObject.useMipmapping),shaderObject.alphaThreshold>0){var cutOffReg=registerCache.getFreeFragmentConstant();methodVO.fragmentConstantsIndex=4*cutOffReg.index,code+="sub "+targetReg+".w, "+targetReg+".w, "+cutOffReg+".x\nkil "+targetReg+".w\nadd "+targetReg+".w, "+targetReg+".w, "+cutOffReg+".x\n"}}else ambientInputRegister=registerCache.getFreeFragmentConstant(),methodVO.fragmentConstantsIndex=4*ambientInputRegister.index,code+="mov "+targetReg+", "+ambientInputRegister+"\n";return code},AmbientBasicMethod.prototype.iActivate=function(shaderObject,methodVO,stage){if(methodVO.needsUV)stage.context.setSamplerStateAt(methodVO.texturesIndex,shaderObject.repeatTextures?ContextGLWrapMode.REPEAT:ContextGLWrapMode.CLAMP,shaderObject.useSmoothTextures?ContextGLTextureFilter.LINEAR:ContextGLTextureFilter.NEAREST,shaderObject.useMipmapping?ContextGLMipFilter.MIPLINEAR:ContextGLMipFilter.MIPNONE),stage.context.activateTexture(methodVO.texturesIndex,shaderObject.texture),shaderObject.alphaThreshold>0&&(shaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex]=shaderObject.alphaThreshold);else{var index=methodVO.fragmentConstantsIndex,data=shaderObject.fragmentConstantData;data[index]=this._colorR,data[index+1]=this._colorG,data[index+2]=this._colorB,data[index+3]=this._alpha}},AmbientBasicMethod.prototype.updateColor=function(){this._colorR=(this._color>>16&255)/255*this._ambient,this._colorG=(this._color>>8&255)/255*this._ambient,this._colorB=(255&this._color)/255*this._ambient},AmbientBasicMethod}(materials.ShadingMethodBase);materials.AmbientBasicMethod=AmbientBasicMethod}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var ContextGLMipFilter=away.stagegl.ContextGLMipFilter,ContextGLTextureFilter=away.stagegl.ContextGLTextureFilter,ContextGLWrapMode=away.stagegl.ContextGLWrapMode,DiffuseBasicMethod=function(_super){function DiffuseBasicMethod(){_super.call(this),this._multiply=!0,this._diffuseColor=16777215,this._ambientColor=16777215,this._diffuseR=1,this._diffuseG=1,this._diffuseB=1,this._ambientR=1,this._ambientG=1,this._ambientB=1}return __extends(DiffuseBasicMethod,_super),DiffuseBasicMethod.prototype.iIsUsed=function(shaderObject){return shaderObject.numLights?!0:!1},Object.defineProperty(DiffuseBasicMethod.prototype,"multiply",{get:function(){return this._multiply},set:function(value){this._multiply!=value&&(this._multiply=value,this.iInvalidateShaderProgram())},enumerable:!0,configurable:!0}),DiffuseBasicMethod.prototype.iInitVO=function(shaderObject,methodVO){methodVO.needsUV=this._pUseTexture,methodVO.needsNormals=shaderObject.numLights>0},DiffuseBasicMethod.prototype.generateMip=function(stage){this._pUseTexture&&stage.context.activateTexture(0,this._texture)},Object.defineProperty(DiffuseBasicMethod.prototype,"diffuseColor",{get:function(){return this._diffuseColor},set:function(value){this._diffuseColor!=value&&(this._diffuseColor=value,this.updateDiffuse())},enumerable:!0,configurable:!0}),Object.defineProperty(DiffuseBasicMethod.prototype,"ambientColor",{get:function(){return this._ambientColor},set:function(value){this._ambientColor!=value&&(this._ambientColor=value,this.updateAmbient())},enumerable:!0,configurable:!0}),Object.defineProperty(DiffuseBasicMethod.prototype,"texture",{get:function(){return this._texture},set:function(value){var b=null!=value;(b!=this._pUseTexture||value&&this._texture&&(value.hasMipmaps!=this._texture.hasMipmaps||value.format!=this._texture.format))&&this.iInvalidateShaderProgram(),this._pUseTexture=b,this._texture=value},enumerable:!0,configurable:!0}),DiffuseBasicMethod.prototype.dispose=function(){this._texture=null},DiffuseBasicMethod.prototype.copyFrom=function(method){var diff=method;this.texture=diff.texture,this.multiply=diff.multiply,this.diffuseColor=diff.diffuseColor,this.ambientColor=diff.ambientColor},DiffuseBasicMethod.prototype.iCleanCompilationData=function(){_super.prototype.iCleanCompilationData.call(this),this._pTotalLightColorReg=null,this._pDiffuseInputRegister=null},DiffuseBasicMethod.prototype.iGetFragmentPreLightingCode=function(shaderObject,methodVO,registerCache){var code="";return this._pIsFirstLight=!0,this._pTotalLightColorReg=registerCache.getFreeFragmentVectorTemp(),registerCache.addFragmentTempUsages(this._pTotalLightColorReg,1),code},DiffuseBasicMethod.prototype.iGetFragmentCodePerLight=function(shaderObject,methodVO,lightDirReg,lightColReg,registerCache,sharedRegisters){var t,code="";return this._pIsFirstLight?t=this._pTotalLightColorReg:(t=registerCache.getFreeFragmentVectorTemp(),registerCache.addFragmentTempUsages(t,1)),code+="dp3 "+t+".x, "+lightDirReg+", "+sharedRegisters.normalFragment+"\nmax "+t+".w, "+t+".x, "+sharedRegisters.commons+".y\n",shaderObject.usesLightFallOff&&(code+="mul "+t+".w, "+t+".w, "+lightDirReg+".w\n"),null!=this._iModulateMethod&&(code+=this._iModulateMethod(shaderObject,methodVO,t,registerCache,sharedRegisters)),code+="mul "+t+", "+t+".w, "+lightColReg+"\n",this._pIsFirstLight||(code+="add "+this._pTotalLightColorReg+".xyz, "+this._pTotalLightColorReg+", "+t+"\n",registerCache.removeFragmentTempUsage(t)),this._pIsFirstLight=!1,code},DiffuseBasicMethod.prototype.iGetFragmentCodePerProbe=function(shaderObject,methodVO,cubeMapReg,weightRegister,registerCache,sharedRegisters){var t,code="";return this._pIsFirstLight?t=this._pTotalLightColorReg:(t=registerCache.getFreeFragmentVectorTemp(),registerCache.addFragmentTempUsages(t,1)),code+="tex "+t+", "+sharedRegisters.normalFragment+", "+cubeMapReg+" \nmul "+t+".xyz, "+t+".xyz, "+weightRegister+"\n",null!=this._iModulateMethod&&(code+=this._iModulateMethod(shaderObject,methodVO,t,registerCache,sharedRegisters)),this._pIsFirstLight||(code+="add "+this._pTotalLightColorReg+".xyz, "+this._pTotalLightColorReg+", "+t+"\n",registerCache.removeFragmentTempUsage(t)),this._pIsFirstLight=!1,code},DiffuseBasicMethod.prototype.iGetFragmentPostLightingCode=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){var albedo,code="";sharedRegisters.shadowTarget&&(code+=this.pApplyShadow(shaderObject,methodVO,registerCache,sharedRegisters)),albedo=registerCache.getFreeFragmentVectorTemp(),registerCache.addFragmentTempUsages(albedo,1);var ambientColorRegister=registerCache.getFreeFragmentConstant();return methodVO.fragmentConstantsIndex=4*ambientColorRegister.index,this._pUseTexture?(this._pDiffuseInputRegister=registerCache.getFreeTextureReg(),methodVO.texturesIndex=this._pDiffuseInputRegister.index,code+=materials.ShaderCompilerHelper.getTex2DSampleCode(albedo,sharedRegisters,this._pDiffuseInputRegister,this._texture,shaderObject.useSmoothTextures,shaderObject.repeatTextures,shaderObject.useMipmapping)):(this._pDiffuseInputRegister=registerCache.getFreeFragmentConstant(),code+="mov "+albedo+", "+this._pDiffuseInputRegister+"\n"),code+="sat "+this._pTotalLightColorReg+", "+this._pTotalLightColorReg+"\nmul "+albedo+".xyz, "+albedo+", "+this._pTotalLightColorReg+"\n",code+=this._multiply?"add "+albedo+".xyz, "+albedo+", "+ambientColorRegister+"\nmul "+targetReg+".xyz, "+targetReg+", "+albedo+"\n":"mul "+targetReg+".xyz, "+targetReg+", "+ambientColorRegister+"\nmul "+this._pTotalLightColorReg+".xyz, "+targetReg+", "+this._pTotalLightColorReg+"\nsub "+targetReg+".xyz, "+targetReg+", "+this._pTotalLightColorReg+"\nadd "+targetReg+".xyz, "+targetReg+", "+albedo+"\n",registerCache.removeFragmentTempUsage(this._pTotalLightColorReg),registerCache.removeFragmentTempUsage(albedo),code},DiffuseBasicMethod.prototype.pApplyShadow=function(shaderObject,methodVO,regCache,sharedRegisters){return"mul "+this._pTotalLightColorReg+".xyz, "+this._pTotalLightColorReg+", "+sharedRegisters.shadowTarget+".w\n"},DiffuseBasicMethod.prototype.iActivate=function(shaderObject,methodVO,stage){if(this._pUseTexture)stage.context.setSamplerStateAt(methodVO.texturesIndex,shaderObject.repeatTextures?ContextGLWrapMode.REPEAT:ContextGLWrapMode.CLAMP,shaderObject.useSmoothTextures?ContextGLTextureFilter.LINEAR:ContextGLTextureFilter.NEAREST,shaderObject.useMipmapping?ContextGLMipFilter.MIPLINEAR:ContextGLMipFilter.MIPNONE),stage.context.activateTexture(methodVO.texturesIndex,this._texture);else{var index=methodVO.fragmentConstantsIndex,data=shaderObject.fragmentConstantData;data[index+4]=this._diffuseR,data[index+5]=this._diffuseG,data[index+6]=this._diffuseB,data[index+7]=1}},DiffuseBasicMethod.prototype.updateDiffuse=function(){this._diffuseR=(this._diffuseColor>>16&255)/255,this._diffuseG=(this._diffuseColor>>8&255)/255,this._diffuseB=(255&this._diffuseColor)/255},DiffuseBasicMethod.prototype.updateAmbient=function(){this._ambientR=(this._ambientColor>>16&255)/255,this._ambientG=(this._ambientColor>>8&255)/255,this._ambientB=(255&this._ambientColor)/255},DiffuseBasicMethod.prototype.iSetRenderState=function(shaderObject,methodVO){if(shaderObject.numLights>0){var index=methodVO.fragmentConstantsIndex,data=shaderObject.fragmentConstantData;data[index]=shaderObject.ambientR*this._ambientR,data[index+1]=shaderObject.ambientG*this._ambientG,data[index+2]=shaderObject.ambientB*this._ambientB,data[index+3]=1}},DiffuseBasicMethod}(materials.LightingMethodBase);materials.DiffuseBasicMethod=DiffuseBasicMethod}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var EffectMethodBase=function(_super){function EffectMethodBase(){_super.call(this)}return __extends(EffectMethodBase,_super),Object.defineProperty(EffectMethodBase.prototype,"assetType",{get:function(){return away.library.AssetType.EFFECTS_METHOD},enumerable:!0,configurable:!0}),EffectMethodBase.prototype.iGetFragmentCode=function(){throw new away.errors.AbstractMethodError},EffectMethodBase}(materials.ShadingMethodBase);materials.EffectMethodBase=EffectMethodBase}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var EffectColorTransformMethod=function(_super){function EffectColorTransformMethod(){_super.call(this)}return __extends(EffectColorTransformMethod,_super),Object.defineProperty(EffectColorTransformMethod.prototype,"colorTransform",{get:function(){return this._colorTransform},set:function(value){this._colorTransform=value},enumerable:!0,configurable:!0}),EffectColorTransformMethod.prototype.iGetFragmentCode=function(shaderObject,methodVO,targetReg,registerCache){var code="",colorMultReg=registerCache.getFreeFragmentConstant(),colorOffsReg=registerCache.getFreeFragmentConstant();return methodVO.fragmentConstantsIndex=4*colorMultReg.index,code+="mul "+targetReg+", "+targetReg+", "+colorMultReg+"\nadd "+targetReg+", "+targetReg+", "+colorOffsReg+"\n"},EffectColorTransformMethod.prototype.iActivate=function(shaderObject,methodVO){var inv=1/255,index=methodVO.fragmentConstantsIndex,data=shaderObject.fragmentConstantData;data[index]=this._colorTransform.redMultiplier,data[index+1]=this._colorTransform.greenMultiplier,data[index+2]=this._colorTransform.blueMultiplier,data[index+3]=this._colorTransform.alphaMultiplier,data[index+4]=this._colorTransform.redOffset*inv,data[index+5]=this._colorTransform.greenOffset*inv,data[index+6]=this._colorTransform.blueOffset*inv,data[index+7]=this._colorTransform.alphaOffset*inv},EffectColorTransformMethod}(materials.EffectMethodBase);materials.EffectColorTransformMethod=EffectColorTransformMethod}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var ContextGLMipFilter=away.stagegl.ContextGLMipFilter,ContextGLTextureFilter=away.stagegl.ContextGLTextureFilter,ContextGLWrapMode=away.stagegl.ContextGLWrapMode,NormalBasicMethod=function(_super){function NormalBasicMethod(){_super.call(this)}return __extends(NormalBasicMethod,_super),NormalBasicMethod.prototype.iIsUsed=function(shaderObject){return this._useTexture&&shaderObject.normalDependencies?!0:!1},NormalBasicMethod.prototype.iInitVO=function(shaderObject,methodVO){methodVO.needsUV=this._useTexture},NormalBasicMethod.prototype.iOutputsTangentNormals=function(){return!0},NormalBasicMethod.prototype.copyFrom=function(method){var bnm=method;null!=bnm.normalMap&&(this.normalMap=bnm.normalMap)},Object.defineProperty(NormalBasicMethod.prototype,"normalMap",{get:function(){return this._texture},set:function(value){var b=null!=value;(b!=this._useTexture||value&&this._texture&&(value.hasMipmaps!=this._texture.hasMipmaps||value.format!=this._texture.format))&&this.iInvalidateShaderProgram(),this._useTexture=b,this._texture=value},enumerable:!0,configurable:!0}),NormalBasicMethod.prototype.iCleanCompilationData=function(){_super.prototype.iCleanCompilationData.call(this),this._pNormalTextureRegister=null},NormalBasicMethod.prototype.dispose=function(){this._texture&&(this._texture=null)},NormalBasicMethod.prototype.iActivate=function(shaderObject,methodVO,stage){methodVO.texturesIndex>=0&&(stage.context.setSamplerStateAt(methodVO.texturesIndex,shaderObject.repeatTextures?ContextGLWrapMode.REPEAT:ContextGLWrapMode.CLAMP,shaderObject.useSmoothTextures?ContextGLTextureFilter.LINEAR:ContextGLTextureFilter.NEAREST,shaderObject.useMipmapping?ContextGLMipFilter.MIPLINEAR:ContextGLMipFilter.MIPNONE),stage.context.activateTexture(methodVO.texturesIndex,this._texture))},NormalBasicMethod.prototype.iGetFragmentCode=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){return this._pNormalTextureRegister=registerCache.getFreeTextureReg(),methodVO.texturesIndex=this._pNormalTextureRegister.index,materials.ShaderCompilerHelper.getTex2DSampleCode(targetReg,sharedRegisters,this._pNormalTextureRegister,this._texture,shaderObject.useSmoothTextures,shaderObject.repeatTextures,shaderObject.useMipmapping)+"sub "+targetReg+".xyz, "+targetReg+".xyz, "+sharedRegisters.commons+".xxx\nnrm "+targetReg+".xyz, "+targetReg+"\n"},NormalBasicMethod}(materials.ShadingMethodBase);materials.NormalBasicMethod=NormalBasicMethod}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var ShadowMapMethodBase=function(_super){function ShadowMapMethodBase(castingLight){_super.call(this),this._pEpsilon=.02,this._pAlpha=1,this._pCastingLight=castingLight,castingLight.castsShadows=!0,this._pShadowMapper=castingLight.shadowMapper}return __extends(ShadowMapMethodBase,_super),Object.defineProperty(ShadowMapMethodBase.prototype,"assetType",{get:function(){return away.library.AssetType.SHADOW_MAP_METHOD},enumerable:!0,configurable:!0}),Object.defineProperty(ShadowMapMethodBase.prototype,"alpha",{get:function(){return this._pAlpha},set:function(value){this._pAlpha=value},enumerable:!0,configurable:!0}),Object.defineProperty(ShadowMapMethodBase.prototype,"castingLight",{get:function(){return this._pCastingLight},enumerable:!0,configurable:!0}),Object.defineProperty(ShadowMapMethodBase.prototype,"epsilon",{get:function(){return this._pEpsilon},set:function(value){this._pEpsilon=value},enumerable:!0,configurable:!0}),ShadowMapMethodBase}(materials.ShadingMethodBase);materials.ShadowMapMethodBase=ShadowMapMethodBase}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var PointLight=away.entities.PointLight,AbstractMethodError=away.errors.AbstractMethodError,ShadowMethodBase=function(_super){function ShadowMethodBase(castingLight){this._pUsePoint=castingLight instanceof PointLight,_super.call(this,castingLight)}return __extends(ShadowMethodBase,_super),ShadowMethodBase.prototype.iInitVO=function(shaderObject,methodVO){methodVO.needsView=!0,methodVO.needsGlobalVertexPos=!0,methodVO.needsGlobalFragmentPos=this._pUsePoint,methodVO.needsNormals=shaderObject.numLights>0},ShadowMethodBase.prototype.iInitConstants=function(shaderObject,methodVO){var fragmentData=shaderObject.fragmentConstantData,vertexData=shaderObject.vertexConstantData,index=methodVO.fragmentConstantsIndex;fragmentData[index]=1,fragmentData[index+1]=1/255,fragmentData[index+2]=1/65025,fragmentData[index+3]=1/16581375,fragmentData[index+6]=0,fragmentData[index+7]=1,this._pUsePoint&&(fragmentData[index+8]=0,fragmentData[index+9]=0,fragmentData[index+10]=0,fragmentData[index+11]=1),index=methodVO.vertexConstantsIndex,-1!=index&&(vertexData[index]=.5,vertexData[index+1]=.5,vertexData[index+2]=0,vertexData[index+3]=1)},Object.defineProperty(ShadowMethodBase.prototype,"_iDepthMapCoordReg",{get:function(){return this._pDepthMapCoordReg},set:function(value){this._pDepthMapCoordReg=value},enumerable:!0,configurable:!0}),ShadowMethodBase.prototype.iCleanCompilationData=function(){_super.prototype.iCleanCompilationData.call(this),this._pDepthMapCoordReg=null},ShadowMethodBase.prototype.iGetVertexCode=function(shaderObject,methodVO,regCache,sharedRegisters){return this._pUsePoint?this._pGetPointVertexCode(methodVO,regCache,sharedRegisters):this.pGetPlanarVertexCode(methodVO,regCache,sharedRegisters)},ShadowMethodBase.prototype._pGetPointVertexCode=function(methodVO){return methodVO.vertexConstantsIndex=-1,""},ShadowMethodBase.prototype.pGetPlanarVertexCode=function(methodVO,regCache,sharedRegisters){var code="",temp=regCache.getFreeVertexVectorTemp(),dataReg=regCache.getFreeVertexConstant(),depthMapProj=regCache.getFreeVertexConstant();return regCache.getFreeVertexConstant(),regCache.getFreeVertexConstant(),regCache.getFreeVertexConstant(),this._pDepthMapCoordReg=regCache.getFreeVarying(),methodVO.vertexConstantsIndex=4*dataReg.index,code+="m44 "+temp+", "+sharedRegisters.globalPositionVertex+", "+depthMapProj+"\ndiv "+temp+", "+temp+", "+temp+".w\nmul "+temp+".xy, "+temp+".xy, "+dataReg+".xy\nadd "+this._pDepthMapCoordReg+", "+temp+", "+dataReg+".xxwz\n"},ShadowMethodBase.prototype.iGetFragmentCode=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){var code=this._pUsePoint?this._pGetPointFragmentCode(methodVO,targetReg,registerCache,sharedRegisters):this._pGetPlanarFragmentCode(methodVO,targetReg,registerCache,sharedRegisters); -return code+="add "+targetReg+".w, "+targetReg+".w, fc"+(methodVO.fragmentConstantsIndex/4+1)+".y\nsat "+targetReg+".w, "+targetReg+".w\n"},ShadowMethodBase.prototype._pGetPlanarFragmentCode=function(){throw new AbstractMethodError},ShadowMethodBase.prototype._pGetPointFragmentCode=function(){throw new AbstractMethodError},ShadowMethodBase.prototype.iSetRenderState=function(shaderObject,methodVO){this._pUsePoint||this._pShadowMapper.iDepthProjection.copyRawDataTo(shaderObject.vertexConstantData,methodVO.vertexConstantsIndex+4,!0)},ShadowMethodBase.prototype._iGetCascadeFragmentCode=function(){throw new Error("This shadow method is incompatible with cascade shadows")},ShadowMethodBase.prototype.iActivate=function(shaderObject,methodVO,stage){var fragmentData=shaderObject.fragmentConstantData,index=methodVO.fragmentConstantsIndex;if(this._pUsePoint?fragmentData[index+4]=-Math.pow(1/(this._pCastingLight.fallOff*this._pEpsilon),2):shaderObject.vertexConstantData[methodVO.vertexConstantsIndex+3]=-1/(this._pShadowMapper.depth*this._pEpsilon),fragmentData[index+5]=1-this._pAlpha,this._pUsePoint){var pos=this._pCastingLight.scenePosition;fragmentData[index+8]=pos.x,fragmentData[index+9]=pos.y,fragmentData[index+10]=pos.z;var f=this._pCastingLight.fallOff;fragmentData[index+11]=1/(2*f*f)}this._pUsePoint||stage.context.activateRenderTexture(methodVO.texturesIndex,this._pCastingLight.shadowMapper.depthMap)},ShadowMethodBase.prototype.iActivateForCascade=function(){throw new Error("This shadow method is incompatible with cascade shadows")},ShadowMethodBase}(materials.ShadowMapMethodBase);materials.ShadowMethodBase=ShadowMethodBase}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var ShadowHardMethod=function(_super){function ShadowHardMethod(castingLight){_super.call(this,castingLight)}return __extends(ShadowHardMethod,_super),ShadowHardMethod.prototype._pGetPlanarFragmentCode=function(methodVO,targetReg,regCache){var depthMapRegister=regCache.getFreeTextureReg(),decReg=regCache.getFreeFragmentConstant(),depthCol=(regCache.getFreeFragmentConstant(),regCache.getFreeFragmentVectorTemp()),code="";return methodVO.fragmentConstantsIndex=4*decReg.index,methodVO.texturesIndex=depthMapRegister.index,code+="tex "+depthCol+", "+this._pDepthMapCoordReg+", "+depthMapRegister+" <2d, nearest, clamp>\ndp4 "+depthCol+".z, "+depthCol+", "+decReg+"\nslt "+targetReg+".w, "+this._pDepthMapCoordReg+".z, "+depthCol+".z\n"},ShadowHardMethod.prototype._pGetPointFragmentCode=function(methodVO,targetReg,regCache,sharedRegisters){var depthMapRegister=regCache.getFreeTextureReg(),decReg=regCache.getFreeFragmentConstant(),epsReg=regCache.getFreeFragmentConstant(),posReg=regCache.getFreeFragmentConstant(),depthSampleCol=regCache.getFreeFragmentVectorTemp();regCache.addFragmentTempUsages(depthSampleCol,1);var lightDir=regCache.getFreeFragmentVectorTemp(),code="";return methodVO.fragmentConstantsIndex=4*decReg.index,methodVO.texturesIndex=depthMapRegister.index,code+="sub "+lightDir+", "+sharedRegisters.globalPositionVarying+", "+posReg+"\ndp3 "+lightDir+".w, "+lightDir+".xyz, "+lightDir+".xyz\nmul "+lightDir+".w, "+lightDir+".w, "+posReg+".w\nnrm "+lightDir+".xyz, "+lightDir+".xyz\ntex "+depthSampleCol+", "+lightDir+", "+depthMapRegister+" \ndp4 "+depthSampleCol+".z, "+depthSampleCol+", "+decReg+"\nadd "+targetReg+".w, "+lightDir+".w, "+epsReg+".x\nslt "+targetReg+".w, "+targetReg+".w, "+depthSampleCol+".z\n",regCache.removeFragmentTempUsage(depthSampleCol),code},ShadowHardMethod.prototype._iGetCascadeFragmentCode=function(shaderObject,methodVO,decodeRegister,depthTexture,depthProjection,targetRegister,registerCache){var temp=registerCache.getFreeFragmentVectorTemp();return"tex "+temp+", "+depthProjection+", "+depthTexture+" <2d, nearest, clamp>\ndp4 "+temp+".z, "+temp+", "+decodeRegister+"\nslt "+targetRegister+".w, "+depthProjection+".z, "+temp+".z\n"},ShadowHardMethod.prototype.iActivateForCascade=function(){},ShadowHardMethod}(materials.ShadowMethodBase);materials.ShadowHardMethod=ShadowHardMethod}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var ContextGLWrapMode=away.stagegl.ContextGLWrapMode,ContextGLTextureFilter=away.stagegl.ContextGLTextureFilter,ContextGLMipFilter=away.stagegl.ContextGLMipFilter,SpecularBasicMethod=function(_super){function SpecularBasicMethod(){_super.call(this),this._gloss=50,this._specular=1,this._specularColor=16777215,this._iSpecularR=1,this._iSpecularG=1,this._iSpecularB=1}return __extends(SpecularBasicMethod,_super),SpecularBasicMethod.prototype.iIsUsed=function(shaderObject){return shaderObject.numLights?!0:!1},SpecularBasicMethod.prototype.iInitVO=function(shaderObject,methodVO){methodVO.needsUV=this._pUseTexture,methodVO.needsNormals=shaderObject.numLights>0,methodVO.needsView=shaderObject.numLights>0},Object.defineProperty(SpecularBasicMethod.prototype,"gloss",{get:function(){return this._gloss},set:function(value){this._gloss=value},enumerable:!0,configurable:!0}),Object.defineProperty(SpecularBasicMethod.prototype,"specular",{get:function(){return this._specular},set:function(value){value!=this._specular&&(this._specular=value,this.updateSpecular())},enumerable:!0,configurable:!0}),Object.defineProperty(SpecularBasicMethod.prototype,"specularColor",{get:function(){return this._specularColor},set:function(value){this._specularColor!=value&&((0==this._specularColor||0==value)&&this.iInvalidateShaderProgram(),this._specularColor=value,this.updateSpecular())},enumerable:!0,configurable:!0}),Object.defineProperty(SpecularBasicMethod.prototype,"texture",{get:function(){return this._texture},set:function(value){var b=null!=value;(b!=this._pUseTexture||value&&this._texture&&(value.hasMipmaps!=this._texture.hasMipmaps||value.format!=this._texture.format))&&this.iInvalidateShaderProgram(),this._pUseTexture=b,this._texture=value},enumerable:!0,configurable:!0}),SpecularBasicMethod.prototype.copyFrom=function(method){var bsm=method,spec=bsm;this.texture=spec.texture,this.specular=spec.specular,this.specularColor=spec.specularColor,this.gloss=spec.gloss},SpecularBasicMethod.prototype.iCleanCompilationData=function(){_super.prototype.iCleanCompilationData.call(this),this._pTotalLightColorReg=null,this._pSpecularTextureRegister=null,this._pSpecularTexData=null,this._pSpecularDataRegister=null},SpecularBasicMethod.prototype.iGetFragmentPreLightingCode=function(shaderObject,methodVO,registerCache,sharedRegisters){var code="";return this._pIsFirstLight=!0,this._pSpecularDataRegister=registerCache.getFreeFragmentConstant(),methodVO.fragmentConstantsIndex=4*this._pSpecularDataRegister.index,this._pUseTexture?(this._pSpecularTexData=registerCache.getFreeFragmentVectorTemp(),registerCache.addFragmentTempUsages(this._pSpecularTexData,1),this._pSpecularTextureRegister=registerCache.getFreeTextureReg(),methodVO.texturesIndex=this._pSpecularTextureRegister.index,code=materials.ShaderCompilerHelper.getTex2DSampleCode(this._pSpecularTexData,sharedRegisters,this._pSpecularTextureRegister,this._texture,shaderObject.useSmoothTextures,shaderObject.repeatTextures,shaderObject.useMipmapping)):this._pSpecularTextureRegister=null,this._pTotalLightColorReg=registerCache.getFreeFragmentVectorTemp(),registerCache.addFragmentTempUsages(this._pTotalLightColorReg,1),code},SpecularBasicMethod.prototype.iGetFragmentCodePerLight=function(shaderObject,methodVO,lightDirReg,lightColReg,registerCache,sharedRegisters){var t,code="";this._pIsFirstLight?t=this._pTotalLightColorReg:(t=registerCache.getFreeFragmentVectorTemp(),registerCache.addFragmentTempUsages(t,1));var viewDirReg=sharedRegisters.viewDirFragment,normalReg=sharedRegisters.normalFragment;return code+="add "+t+", "+lightDirReg+", "+viewDirReg+"\nnrm "+t+".xyz, "+t+"\ndp3 "+t+".w, "+normalReg+", "+t+"\nsat "+t+".w, "+t+".w\n",code+=this._pUseTexture?"mul "+this._pSpecularTexData+".w, "+this._pSpecularTexData+".y, "+this._pSpecularDataRegister+".w\npow "+t+".w, "+t+".w, "+this._pSpecularTexData+".w\n":"pow "+t+".w, "+t+".w, "+this._pSpecularDataRegister+".w\n",shaderObject.usesLightFallOff&&(code+="mul "+t+".w, "+t+".w, "+lightDirReg+".w\n"),null!=this._iModulateMethod&&(code+=this._iModulateMethod(shaderObject,methodVO,t,registerCache,sharedRegisters)),code+="mul "+t+".xyz, "+lightColReg+", "+t+".w\n",this._pIsFirstLight||(code+="add "+this._pTotalLightColorReg+".xyz, "+this._pTotalLightColorReg+", "+t+"\n",registerCache.removeFragmentTempUsage(t)),this._pIsFirstLight=!1,code},SpecularBasicMethod.prototype.iGetFragmentCodePerProbe=function(shaderObject,methodVO,cubeMapReg,weightRegister,registerCache,sharedRegisters){var t,code="";this._pIsFirstLight?t=this._pTotalLightColorReg:(t=registerCache.getFreeFragmentVectorTemp(),registerCache.addFragmentTempUsages(t,1));var normalReg=sharedRegisters.normalFragment,viewDirReg=sharedRegisters.viewDirFragment;return code+="dp3 "+t+".w, "+normalReg+", "+viewDirReg+"\nadd "+t+".w, "+t+".w, "+t+".w\nmul "+t+", "+t+".w, "+normalReg+"\nsub "+t+", "+t+", "+viewDirReg+"\ntex "+t+", "+t+", "+cubeMapReg+" \nmul "+t+".xyz, "+t+", "+weightRegister+"\n",null!=this._iModulateMethod&&(code+=this._iModulateMethod(shaderObject,methodVO,t,registerCache,sharedRegisters)),this._pIsFirstLight||(code+="add "+this._pTotalLightColorReg+".xyz, "+this._pTotalLightColorReg+", "+t+"\n",registerCache.removeFragmentTempUsage(t)),this._pIsFirstLight=!1,code},SpecularBasicMethod.prototype.iGetFragmentPostLightingCode=function(shaderObject,methodVO,targetReg,registerCache,sharedRegisters){var code="";return sharedRegisters.shadowTarget&&(code+="mul "+this._pTotalLightColorReg+".xyz, "+this._pTotalLightColorReg+", "+sharedRegisters.shadowTarget+".w\n"),this._pUseTexture&&(code+="mul "+this._pTotalLightColorReg+".xyz, "+this._pTotalLightColorReg+", "+this._pSpecularTexData+".x\n",registerCache.removeFragmentTempUsage(this._pSpecularTexData)),code+="mul "+this._pTotalLightColorReg+".xyz, "+this._pTotalLightColorReg+", "+this._pSpecularDataRegister+"\nadd "+targetReg+".xyz, "+targetReg+", "+this._pTotalLightColorReg+"\n",registerCache.removeFragmentTempUsage(this._pTotalLightColorReg),code},SpecularBasicMethod.prototype.iActivate=function(shaderObject,methodVO,stage){this._pUseTexture&&(stage.context.setSamplerStateAt(methodVO.texturesIndex,shaderObject.repeatTextures?ContextGLWrapMode.REPEAT:ContextGLWrapMode.CLAMP,shaderObject.useSmoothTextures?ContextGLTextureFilter.LINEAR:ContextGLTextureFilter.NEAREST,shaderObject.useMipmapping?ContextGLMipFilter.MIPLINEAR:ContextGLMipFilter.MIPNONE),stage.context.activateTexture(methodVO.texturesIndex,this._texture));var index=methodVO.fragmentConstantsIndex,data=shaderObject.fragmentConstantData;data[index]=this._iSpecularR,data[index+1]=this._iSpecularG,data[index+2]=this._iSpecularB,data[index+3]=this._gloss},SpecularBasicMethod.prototype.updateSpecular=function(){this._iSpecularR=(this._specularColor>>16&255)/255*this._specular,this._iSpecularG=(this._specularColor>>8&255)/255*this._specular,this._iSpecularB=(255&this._specularColor)/255*this._specular},SpecularBasicMethod}(materials.LightingMethodBase);materials.SpecularBasicMethod=SpecularBasicMethod}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var BlendMode=away.base.BlendMode,ArgumentError=away.errors.ArgumentError,Event=away.events.Event,ContextGLBlendFactor=away.stagegl.ContextGLBlendFactor,ContextGLCompareMode=away.stagegl.ContextGLCompareMode,MaterialPassBase=function(_super){function MaterialPassBase(passMode){"undefined"==typeof passMode&&(passMode=3);var _this=this;_super.call(this),this._materialPassData=new Array,this._maxLights=3,this._preserveAlpha=!0,this._includeCasters=!0,this._forceSeparateMVP=!1,this._directionalLightsOffset=0,this._pointLightsOffset=0,this._lightProbesOffset=0,this._pNumPointLights=0,this._pNumDirectionalLights=0,this._pNumLightProbes=0,this._pNumLights=0,this._depthCompareMode=ContextGLCompareMode.LESS_EQUAL,this._blendFactorSource=ContextGLBlendFactor.ONE,this._blendFactorDest=ContextGLBlendFactor.ZERO,this._pEnableBlending=!1,this._writeDepth=!0,this._passMode=passMode,this._onLightsChangeDelegate=function(event){return _this.onLightsChange(event)}}return __extends(MaterialPassBase,_super),Object.defineProperty(MaterialPassBase.prototype,"preserveAlpha",{get:function(){return this._preserveAlpha},set:function(value){this._preserveAlpha!=value&&(this._preserveAlpha=value,this._pInvalidatePass())},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialPassBase.prototype,"includeCasters",{get:function(){return this._includeCasters},set:function(value){this._includeCasters!=value&&(this._includeCasters=value,this._pInvalidatePass())},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialPassBase.prototype,"forceSeparateMVP",{get:function(){return this._forceSeparateMVP},set:function(value){this._forceSeparateMVP!=value&&(this._forceSeparateMVP=value,this._pInvalidatePass())},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialPassBase.prototype,"directionalLightsOffset",{get:function(){return this._directionalLightsOffset},set:function(value){this._directionalLightsOffset=value},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialPassBase.prototype,"pointLightsOffset",{get:function(){return this._pointLightsOffset},set:function(value){this._pointLightsOffset=value},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialPassBase.prototype,"lightProbesOffset",{get:function(){return this._lightProbesOffset},set:function(value){this._lightProbesOffset=value},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialPassBase.prototype,"passMode",{get:function(){return this._passMode},set:function(value){this._passMode=value,this._pInvalidatePass()},enumerable:!0,configurable:!0}),MaterialPassBase.prototype.createShaderObject=function(profile){return new materials.ShaderObjectBase(profile)},Object.defineProperty(MaterialPassBase.prototype,"writeDepth",{get:function(){return this._writeDepth},set:function(value){this._writeDepth=value},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialPassBase.prototype,"depthCompareMode",{get:function(){return this._depthCompareMode},set:function(value){this._depthCompareMode=value},enumerable:!0,configurable:!0}),MaterialPassBase.prototype.dispose=function(){for(this._pLightPicker&&this._pLightPicker.removeEventListener(Event.CHANGE,this._onLightsChangeDelegate);this._materialPassData.length;)this._materialPassData[0].dispose();this._materialPassData=null},MaterialPassBase.prototype._iRender=function(pass,renderable,stage,camera,viewProjection){this.setRenderState(pass,renderable,stage,camera,viewProjection)},MaterialPassBase.prototype.setRenderState=function(pass,renderable,stage,camera,viewProjection){pass.shaderObject.setRenderState(renderable,stage,camera,viewProjection)},MaterialPassBase.prototype.setBlendMode=function(value){switch(value){case BlendMode.NORMAL:this._blendFactorSource=ContextGLBlendFactor.ONE,this._blendFactorDest=ContextGLBlendFactor.ZERO,this._pEnableBlending=!1;break;case BlendMode.LAYER:this._blendFactorSource=ContextGLBlendFactor.SOURCE_ALPHA,this._blendFactorDest=ContextGLBlendFactor.ONE_MINUS_SOURCE_ALPHA,this._pEnableBlending=!0;break;case BlendMode.MULTIPLY:this._blendFactorSource=ContextGLBlendFactor.ZERO,this._blendFactorDest=ContextGLBlendFactor.SOURCE_COLOR,this._pEnableBlending=!0;break;case BlendMode.ADD:this._blendFactorSource=ContextGLBlendFactor.SOURCE_ALPHA,this._blendFactorDest=ContextGLBlendFactor.ONE,this._pEnableBlending=!0;break;case BlendMode.ALPHA:this._blendFactorSource=ContextGLBlendFactor.ZERO,this._blendFactorDest=ContextGLBlendFactor.SOURCE_ALPHA,this._pEnableBlending=!0;break;default:throw new ArgumentError("Unsupported blend mode!")}},MaterialPassBase.prototype._iActivate=function(pass,stage,camera){var context=stage.context;context.setDepthTest(this._writeDepth&&!this._pEnableBlending,this._depthCompareMode),this._pEnableBlending&&context.setBlendFactors(this._blendFactorSource,this._blendFactorDest),context.activateMaterialPass(pass,stage,camera)},MaterialPassBase.prototype._iDeactivate=function(pass,stage){stage.context.deactivateMaterialPass(pass,stage),stage.context.setDepthTest(!0,ContextGLCompareMode.LESS_EQUAL)},MaterialPassBase.prototype._pInvalidatePass=function(){for(var len=this._materialPassData.length,i=0;len>i;i++)this._materialPassData[i].invalidate();this.dispatchEvent(new Event(Event.CHANGE))},Object.defineProperty(MaterialPassBase.prototype,"lightPicker",{get:function(){return this._pLightPicker},set:function(value){this._pLightPicker&&this._pLightPicker.removeEventListener(Event.CHANGE,this._onLightsChangeDelegate),this._pLightPicker=value,this._pLightPicker&&this._pLightPicker.addEventListener(Event.CHANGE,this._onLightsChangeDelegate),this.pUpdateLights()},enumerable:!0,configurable:!0}),MaterialPassBase.prototype.onLightsChange=function(){this.pUpdateLights()},MaterialPassBase.prototype.pUpdateLights=function(){var numDirectionalLightsOld=this._pNumDirectionalLights,numPointLightsOld=this._pNumPointLights,numLightProbesOld=this._pNumLightProbes;this._pLightPicker&&this._passMode&materials.MaterialPassMode.LIGHTING?(this._pNumDirectionalLights=this.calculateNumDirectionalLights(this._pLightPicker.numDirectionalLights),this._pNumPointLights=this.calculateNumPointLights(this._pLightPicker.numPointLights),this._pNumLightProbes=this.calculateNumProbes(this._pLightPicker.numLightProbes),this._includeCasters&&(this._pNumDirectionalLights+=this._pLightPicker.numCastingDirectionalLights,this._pNumPointLights+=this._pLightPicker.numCastingPointLights)):(this._pNumDirectionalLights=0,this._pNumPointLights=0,this._pNumLightProbes=0),this._pNumLights=this._pNumDirectionalLights+this._pNumPointLights,(numDirectionalLightsOld!=this._pNumDirectionalLights||numPointLightsOld!=this._pNumPointLights||numLightProbesOld!=this._pNumLightProbes)&&this._pInvalidatePass()},MaterialPassBase.prototype._iIncludeDependencies=function(shaderObject){this._forceSeparateMVP&&shaderObject.globalPosDependencies++,shaderObject.outputsNormals=this._pOutputsNormals(shaderObject),shaderObject.outputsTangentNormals=shaderObject.outputsNormals&&this._pOutputsTangentNormals(shaderObject),shaderObject.usesTangentSpace=shaderObject.outputsTangentNormals&&this._pUsesTangentSpace(shaderObject),shaderObject.usesTangentSpace||shaderObject.addWorldSpaceDependencies(Boolean(this._passMode&materials.MaterialPassMode.EFFECTS))},MaterialPassBase.prototype._iInitConstantData=function(){},MaterialPassBase.prototype._iGetPreLightingVertexCode=function(){return""},MaterialPassBase.prototype._iGetPreLightingFragmentCode=function(){return""},MaterialPassBase.prototype._iGetVertexCode=function(){return""},MaterialPassBase.prototype._iGetFragmentCode=function(){return""},MaterialPassBase.prototype._iGetNormalVertexCode=function(){return""},MaterialPassBase.prototype._iGetNormalFragmentCode=function(){return""},Object.defineProperty(MaterialPassBase.prototype,"iNumPointLights",{get:function(){return this._pNumPointLights},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialPassBase.prototype,"iNumDirectionalLights",{get:function(){return this._pNumDirectionalLights},enumerable:!0,configurable:!0}),Object.defineProperty(MaterialPassBase.prototype,"iNumLightProbes",{get:function(){return this._pNumLightProbes},enumerable:!0,configurable:!0}),MaterialPassBase.prototype._pOutputsNormals=function(){return!1},MaterialPassBase.prototype._pOutputsTangentNormals=function(){return!1},MaterialPassBase.prototype._pUsesTangentSpace=function(){return!1},MaterialPassBase.prototype.calculateNumDirectionalLights=function(numDirectionalLights){return Math.min(numDirectionalLights-this._directionalLightsOffset,this._maxLights)},MaterialPassBase.prototype.calculateNumPointLights=function(numPointLights){var numFree=this._maxLights-this._pNumDirectionalLights;return Math.min(numPointLights-this._pointLightsOffset,numFree)},MaterialPassBase.prototype.calculateNumProbes=function(numLightProbes){var numChannels=0;return Math.min(numLightProbes-this._lightProbesOffset,4/numChannels|0)},MaterialPassBase.prototype._iAddMaterialPassData=function(materialPassData){return this._materialPassData.push(materialPassData),materialPassData},MaterialPassBase.prototype._iRemoveMaterialPassData=function(materialPassData){return this._materialPassData.splice(this._materialPassData.indexOf(materialPassData),1),materialPassData},MaterialPassBase}(away.library.NamedAssetBase);materials.MaterialPassBase=MaterialPassBase}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var LineBasicPass=function(_super){function LineBasicPass(){_super.call(this)}return __extends(LineBasicPass,_super),LineBasicPass.prototype._iGetFragmentCode=function(shaderObject,regCache,sharedReg){var targetReg=sharedReg.shadedTarget;return"mov "+targetReg+", v0\n"},LineBasicPass}(materials.MaterialPassBase);materials.LineBasicPass=LineBasicPass}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var SkyboxPass=function(_super){function SkyboxPass(){_super.call(this)}return __extends(SkyboxPass,_super),SkyboxPass.prototype._iIncludeDependencies=function(shaderObject){shaderObject.useMipmapping=!1},SkyboxPass}(materials.MaterialPassBase);materials.SkyboxPass=SkyboxPass}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var ContextGLMipFilter=away.stagegl.ContextGLMipFilter,ContextGLTextureFilter=away.stagegl.ContextGLTextureFilter,ContextGLWrapMode=away.stagegl.ContextGLWrapMode,TriangleBasicPass=function(_super){function TriangleBasicPass(){_super.call(this),this._diffuseColor=16777215,this._diffuseR=1,this._diffuseG=1,this._diffuseB=1,this._diffuseA=1}return __extends(TriangleBasicPass,_super),Object.defineProperty(TriangleBasicPass.prototype,"diffuseAlpha",{get:function(){return this._diffuseA},set:function(value){this._diffuseA=value},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleBasicPass.prototype,"diffuseColor",{get:function(){return this._diffuseColor},set:function(diffuseColor){this._diffuseColor=diffuseColor,this._diffuseR=(this._diffuseColor>>16&255)/255,this._diffuseG=(this._diffuseColor>>8&255)/255,this._diffuseB=(255&this._diffuseColor)/255},enumerable:!0,configurable:!0}),TriangleBasicPass.prototype._iGetFragmentCode=function(shaderObject,regCache,sharedReg){var diffuseInputReg,code="",targetReg=sharedReg.shadedTarget;if(null!=shaderObject.texture){if(diffuseInputReg=regCache.getFreeTextureReg(),this._texturesIndex=diffuseInputReg.index,code+=materials.ShaderCompilerHelper.getTex2DSampleCode(targetReg,sharedReg,diffuseInputReg,shaderObject.texture,shaderObject.useSmoothTextures,shaderObject.repeatTextures,shaderObject.useMipmapping),shaderObject.alphaThreshold>0){var cutOffReg=regCache.getFreeFragmentConstant();this._fragmentConstantsIndex=4*cutOffReg.index,code+="sub "+targetReg+".w, "+targetReg+".w, "+cutOffReg+".x\nkil "+targetReg+".w\nadd "+targetReg+".w, "+targetReg+".w, "+cutOffReg+".x\n"}}else diffuseInputReg=regCache.getFreeFragmentConstant(),this._fragmentConstantsIndex=4*diffuseInputReg.index,code+="mov "+targetReg+", "+diffuseInputReg+"\n";return code},TriangleBasicPass.prototype._iIncludeDependencies=function(dependencyCounter){null!=dependencyCounter.texture&&dependencyCounter.uvDependencies++},TriangleBasicPass.prototype._iActivate=function(pass,stage,camera){_super.prototype._iActivate.call(this,pass,stage,camera);var shaderObject=pass.shaderObject;if(null!=shaderObject.texture)stage.context.setSamplerStateAt(this._texturesIndex,shaderObject.repeatTextures?ContextGLWrapMode.REPEAT:ContextGLWrapMode.CLAMP,shaderObject.useSmoothTextures?ContextGLTextureFilter.LINEAR:ContextGLTextureFilter.NEAREST,shaderObject.useMipmapping?ContextGLMipFilter.MIPLINEAR:ContextGLMipFilter.MIPNONE),stage.context.activateTexture(this._texturesIndex,shaderObject.texture),shaderObject.alphaThreshold>0&&(shaderObject.fragmentConstantData[this._fragmentConstantsIndex]=shaderObject.alphaThreshold);else{var index=this._fragmentConstantsIndex,data=shaderObject.fragmentConstantData;data[index]=this._diffuseR,data[index+1]=this._diffuseG,data[index+2]=this._diffuseB,data[index+3]=this._diffuseA}},TriangleBasicPass}(materials.MaterialPassBase);materials.TriangleBasicPass=TriangleBasicPass}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var ContextGLMipFilter=away.stagegl.ContextGLMipFilter,ContextGLTextureFilter=away.stagegl.ContextGLTextureFilter,ContextGLWrapMode=away.stagegl.ContextGLWrapMode,DepthMapPass=function(_super){function DepthMapPass(){_super.call(this)}return __extends(DepthMapPass,_super),DepthMapPass.prototype._iInitConstantData=function(shaderObject){_super.prototype._iInitConstantData.call(this,shaderObject);var index=this._fragmentConstantsIndex,data=shaderObject.fragmentConstantData;data[index]=1,data[index+1]=255,data[index+2]=65025,data[index+3]=16581375,data[index+4]=1/255,data[index+5]=1/255,data[index+6]=1/255,data[index+7]=0},DepthMapPass.prototype._iIncludeDependencies=function(shaderObject){shaderObject.projectionDependencies++,shaderObject.alphaThreshold>0&&shaderObject.uvDependencies++},DepthMapPass.prototype._iGetFragmentCode=function(shaderObject,registerCache,sharedRegisters){var code="",targetReg=sharedRegisters.shadedTarget,diffuseInputReg=registerCache.getFreeTextureReg(),dataReg1=registerCache.getFreeFragmentConstant(),dataReg2=registerCache.getFreeFragmentConstant();this._fragmentConstantsIndex=4*dataReg1.index;var temp1=registerCache.getFreeFragmentVectorTemp();registerCache.addFragmentTempUsages(temp1,1);var temp2=registerCache.getFreeFragmentVectorTemp();if(registerCache.addFragmentTempUsages(temp2,1),code+="div "+temp1+", "+sharedRegisters.projectionFragment+", "+sharedRegisters.projectionFragment+".w\nmul "+temp1+", "+dataReg1+", "+temp1+".z\nfrc "+temp1+", "+temp1+"\nmul "+temp2+", "+temp1+".yzww, "+dataReg2+"\n",shaderObject.alphaThreshold>0){diffuseInputReg=registerCache.getFreeTextureReg(),this._texturesIndex=diffuseInputReg.index;var albedo=registerCache.getFreeFragmentVectorTemp();code+=materials.ShaderCompilerHelper.getTex2DSampleCode(albedo,sharedRegisters,diffuseInputReg,shaderObject.texture,shaderObject.useSmoothTextures,shaderObject.repeatTextures,shaderObject.useMipmapping);var cutOffReg=registerCache.getFreeFragmentConstant();code+="sub "+albedo+".w, "+albedo+".w, "+cutOffReg+".x\nkil "+albedo+".w\n"}return code+="sub "+targetReg+", "+temp1+", "+temp2+"\n",registerCache.removeFragmentTempUsage(temp1),registerCache.removeFragmentTempUsage(temp2),code},DepthMapPass.prototype._iRender=function(){},DepthMapPass.prototype._iActivate=function(pass,stage,camera){_super.prototype._iActivate.call(this,pass,stage,camera);var context=stage.context,shaderObject=pass.shaderObject;shaderObject.alphaThreshold>0&&(context.setSamplerStateAt(this._texturesIndex,shaderObject.repeatTextures?ContextGLWrapMode.REPEAT:ContextGLWrapMode.CLAMP,shaderObject.useSmoothTextures?ContextGLTextureFilter.LINEAR:ContextGLTextureFilter.NEAREST,shaderObject.useMipmapping?ContextGLMipFilter.MIPLINEAR:ContextGLMipFilter.MIPNONE),context.activateTexture(this._texturesIndex,shaderObject.texture),shaderObject.fragmentConstantData[this._fragmentConstantsIndex+8]=pass.shaderObject.alphaThreshold)},DepthMapPass}(materials.MaterialPassBase);materials.DepthMapPass=DepthMapPass}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var ContextGLMipFilter=away.stagegl.ContextGLMipFilter,ContextGLTextureFilter=away.stagegl.ContextGLTextureFilter,ContextGLWrapMode=away.stagegl.ContextGLWrapMode,DistanceMapPass=function(_super){function DistanceMapPass(){_super.call(this)}return __extends(DistanceMapPass,_super),DistanceMapPass.prototype._iInitConstantData=function(shaderObject){_super.prototype._iInitConstantData.call(this,shaderObject);var index=this._fragmentConstantsIndex,data=shaderObject.fragmentConstantData;data[index+4]=1/255,data[index+5]=1/255,data[index+6]=1/255,data[index+7]=0},DistanceMapPass.prototype._iIncludeDependencies=function(shaderObject){shaderObject.projectionDependencies++,shaderObject.viewDirDependencies++,shaderObject.alphaThreshold>0&&shaderObject.uvDependencies++,shaderObject.addWorldSpaceDependencies(!1)},DistanceMapPass.prototype._iGetFragmentCode=function(shaderObject,registerCache,sharedRegisters){var code,targetReg=sharedRegisters.shadedTarget,diffuseInputReg=registerCache.getFreeTextureReg(),dataReg1=registerCache.getFreeFragmentConstant(),dataReg2=registerCache.getFreeFragmentConstant();this._fragmentConstantsIndex=4*dataReg1.index;var temp1=registerCache.getFreeFragmentVectorTemp();registerCache.addFragmentTempUsages(temp1,1);var temp2=registerCache.getFreeFragmentVectorTemp();if(registerCache.addFragmentTempUsages(temp2,1),code="dp3 "+temp1+".z, "+sharedRegisters.viewDirVarying+".xyz, "+sharedRegisters.viewDirVarying+".xyz\nmul "+temp1+", "+dataReg1+", "+temp1+".z\nfrc "+temp1+", "+temp1+"\nmul "+temp2+", "+temp1+".yzww, "+dataReg2+"\n",shaderObject.alphaThreshold>0){diffuseInputReg=registerCache.getFreeTextureReg(),this._texturesIndex=diffuseInputReg.index;var albedo=registerCache.getFreeFragmentVectorTemp();code+=materials.ShaderCompilerHelper.getTex2DSampleCode(albedo,sharedRegisters,diffuseInputReg,shaderObject.texture,shaderObject.useSmoothTextures,shaderObject.repeatTextures,shaderObject.useMipmapping);var cutOffReg=registerCache.getFreeFragmentConstant();code+="sub "+albedo+".w, "+albedo+".w, "+cutOffReg+".x\nkil "+albedo+".w\n"}return code+="sub "+targetReg+", "+temp1+", "+temp2+"\n"},DistanceMapPass.prototype._iActivate=function(pass,stage,camera){_super.prototype._iActivate.call(this,pass,stage,camera);var context=stage.context,shaderObject=pass.shaderObject,f=camera.projection.far;f=1/(2*f*f);var index=this._fragmentConstantsIndex,data=shaderObject.fragmentConstantData;data[index]=1*f,data[index+1]=255*f,data[index+2]=65025*f,data[index+3]=16581375*f,shaderObject.alphaThreshold>0&&(context.setSamplerStateAt(this._texturesIndex,shaderObject.repeatTextures?ContextGLWrapMode.REPEAT:ContextGLWrapMode.CLAMP,shaderObject.useSmoothTextures?ContextGLTextureFilter.LINEAR:ContextGLTextureFilter.NEAREST,shaderObject.useMipmapping?ContextGLMipFilter.MIPLINEAR:ContextGLMipFilter.MIPNONE),context.activateTexture(this._texturesIndex,shaderObject.texture),data[index+8]=pass.shaderObject.alphaThreshold)},DistanceMapPass}(materials.MaterialPassBase);materials.DistanceMapPass=DistanceMapPass}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var MaterialPassMode=function(){function MaterialPassMode(){}return MaterialPassMode.EFFECTS=1,MaterialPassMode.LIGHTING=2,MaterialPassMode.SUPER_SHADER=3,MaterialPassMode}();materials.MaterialPassMode=MaterialPassMode}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var ShadingMethodEvent=away.events.ShadingMethodEvent,TriangleMethodPass=function(_super){function TriangleMethodPass(passMode){"undefined"==typeof passMode&&(passMode=3);var _this=this;_super.call(this,passMode),this._iMethodVOs=new Array,this._numEffectDependencies=0,this._onShaderInvalidatedDelegate=function(event){return _this.onShaderInvalidated(event)}}return __extends(TriangleMethodPass,_super),TriangleMethodPass.prototype.createShaderObject=function(profile){return this._pLightPicker&&this.passMode&materials.MaterialPassMode.LIGHTING?new materials.ShaderLightingObject(profile):new materials.ShaderObjectBase(profile) -},TriangleMethodPass.prototype._iInitConstantData=function(shaderObject){_super.prototype._iInitConstantData.call(this,shaderObject);for(var len=this._iMethodVOs.length,i=0;len>i;++i)this._iMethodVOs[i].method.iInitConstants(shaderObject,this._iMethodVOs[i])},Object.defineProperty(TriangleMethodPass.prototype,"colorTransform",{get:function(){return this.colorTransformMethod?this.colorTransformMethod.colorTransform:null},set:function(value){value?(null==this.colorTransformMethod&&(this.colorTransformMethod=new materials.EffectColorTransformMethod),this.colorTransformMethod.colorTransform=value):value||this.colorTransformMethod&&(this.colorTransformMethod=null)},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleMethodPass.prototype,"colorTransformMethod",{get:function(){return this._iColorTransformMethodVO?this._iColorTransformMethodVO.method:null},set:function(value){this._iColorTransformMethodVO&&this._iColorTransformMethodVO.method==value||(this._iColorTransformMethodVO&&(this._removeDependency(this._iColorTransformMethodVO),this._iColorTransformMethodVO=null),value&&(this._iColorTransformMethodVO=new materials.MethodVO(value),this._addDependency(this._iColorTransformMethodVO)))},enumerable:!0,configurable:!0}),TriangleMethodPass.prototype._removeDependency=function(methodVO,effectsDependency){"undefined"==typeof effectsDependency&&(effectsDependency=!1);var index=this._iMethodVOs.indexOf(methodVO);effectsDependency||this._numEffectDependencies--,methodVO.method.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED,this._onShaderInvalidatedDelegate),this._iMethodVOs.splice(index,1),this._pInvalidatePass()},TriangleMethodPass.prototype._addDependency=function(methodVO,effectsDependency,index){"undefined"==typeof effectsDependency&&(effectsDependency=!1),"undefined"==typeof index&&(index=-1),methodVO.method.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED,this._onShaderInvalidatedDelegate),effectsDependency?(-1!=index?this._iMethodVOs.splice(index+this._iMethodVOs.length-this._numEffectDependencies,0,methodVO):this._iMethodVOs.push(methodVO),this._numEffectDependencies++):this._iMethodVOs.splice(this._iMethodVOs.length-this._numEffectDependencies,0,methodVO),this._pInvalidatePass()},TriangleMethodPass.prototype.addEffectMethod=function(method){this._addDependency(new materials.MethodVO(method),!0)},Object.defineProperty(TriangleMethodPass.prototype,"numEffectMethods",{get:function(){return this._numEffectDependencies},enumerable:!0,configurable:!0}),TriangleMethodPass.prototype.hasEffectMethod=function(method){return null!=this.getDependencyForMethod(method)},TriangleMethodPass.prototype.getEffectMethodAt=function(index){return 0>index||index>this._numEffectDependencies-1?null:this._iMethodVOs[index+this._iMethodVOs.length-this._numEffectDependencies].method},TriangleMethodPass.prototype.addEffectMethodAt=function(method,index){this._addDependency(new materials.MethodVO(method),!0,index)},TriangleMethodPass.prototype.removeEffectMethod=function(method){var methodVO=this.getDependencyForMethod(method);null!=methodVO&&this._removeDependency(methodVO,!0)},TriangleMethodPass.prototype.getDependencyForMethod=function(method){for(var len=this._iMethodVOs.length,i=0;len>i;++i)if(this._iMethodVOs[i].method==method)return this._iMethodVOs[i];return null},Object.defineProperty(TriangleMethodPass.prototype,"normalMethod",{get:function(){return this._iNormalMethodVO?this._iNormalMethodVO.method:null},set:function(value){this._iNormalMethodVO&&this._iNormalMethodVO.method==value||(this._iNormalMethodVO&&(this._removeDependency(this._iNormalMethodVO),this._iNormalMethodVO=null),value&&(this._iNormalMethodVO=new materials.MethodVO(value),this._addDependency(this._iNormalMethodVO)))},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleMethodPass.prototype,"ambientMethod",{get:function(){return this._iAmbientMethodVO?this._iAmbientMethodVO.method:null},set:function(value){this._iAmbientMethodVO&&this._iAmbientMethodVO.method==value||(this._iAmbientMethodVO&&(this._removeDependency(this._iAmbientMethodVO),this._iAmbientMethodVO=null),value&&(this._iAmbientMethodVO=new materials.MethodVO(value),this._addDependency(this._iAmbientMethodVO)))},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleMethodPass.prototype,"shadowMethod",{get:function(){return this._iShadowMethodVO?this._iShadowMethodVO.method:null},set:function(value){this._iShadowMethodVO&&this._iShadowMethodVO.method==value||(this._iShadowMethodVO&&(this._removeDependency(this._iShadowMethodVO),this._iShadowMethodVO=null),value&&(this._iShadowMethodVO=new materials.MethodVO(value),this._addDependency(this._iShadowMethodVO)))},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleMethodPass.prototype,"diffuseMethod",{get:function(){return this._iDiffuseMethodVO?this._iDiffuseMethodVO.method:null},set:function(value){this._iDiffuseMethodVO&&this._iDiffuseMethodVO.method==value||(this._iDiffuseMethodVO&&(this._removeDependency(this._iDiffuseMethodVO),this._iDiffuseMethodVO=null),value&&(this._iDiffuseMethodVO=new materials.MethodVO(value),this._addDependency(this._iDiffuseMethodVO)))},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleMethodPass.prototype,"specularMethod",{get:function(){return this._iSpecularMethodVO?this._iSpecularMethodVO.method:null},set:function(value){this._iSpecularMethodVO&&this._iSpecularMethodVO.method==value||(this._iSpecularMethodVO&&(this._removeDependency(this._iSpecularMethodVO),this._iSpecularMethodVO=null),value&&(this._iSpecularMethodVO=new materials.MethodVO(value),this._addDependency(this._iSpecularMethodVO)))},enumerable:!0,configurable:!0}),TriangleMethodPass.prototype.dispose=function(){for(_super.prototype.dispose.call(this);this._iMethodVOs.length;)this._removeDependency(this._iMethodVOs[0]);this._iMethodVOs=null},TriangleMethodPass.prototype.onShaderInvalidated=function(){this._pInvalidatePass()},TriangleMethodPass.prototype._iActivate=function(pass,stage,camera){_super.prototype._iActivate.call(this,pass,stage,camera);for(var methodVO,len=this._iMethodVOs.length,i=0;len>i;++i)methodVO=this._iMethodVOs[i],methodVO.useMethod&&methodVO.method.iActivate(pass.shaderObject,methodVO,stage)},TriangleMethodPass.prototype.setRenderState=function(pass,renderable,stage,camera,viewProjection){_super.prototype.setRenderState.call(this,pass,renderable,stage,camera,viewProjection);for(var methodVO,len=this._iMethodVOs.length,i=0;len>i;++i)methodVO=this._iMethodVOs[i],methodVO.useMethod&&methodVO.method.iSetRenderState(pass.shaderObject,methodVO,renderable,stage,camera)},TriangleMethodPass.prototype._iDeactivate=function(pass,stage){_super.prototype._iDeactivate.call(this,pass,stage);for(var methodVO,len=this._iMethodVOs.length,i=0;len>i;++i)methodVO=this._iMethodVOs[i],methodVO.useMethod&&methodVO.method.iDeactivate(pass.shaderObject,methodVO,stage)},TriangleMethodPass.prototype._iIncludeDependencies=function(shaderObject){var i,len=this._iMethodVOs.length;for(i=0;len>i;++i)this.setupAndCountDependencies(shaderObject,this._iMethodVOs[i]);for(i=0;len>i;++i)this._iMethodVOs[i].useMethod=this._iMethodVOs[i].method.iIsUsed(shaderObject);_super.prototype._iIncludeDependencies.call(this,shaderObject)},TriangleMethodPass.prototype.setupAndCountDependencies=function(shaderObject,methodVO){methodVO.reset(),methodVO.method.iInitVO(shaderObject,methodVO),methodVO.needsProjection&&shaderObject.projectionDependencies++,methodVO.needsGlobalVertexPos?(shaderObject.globalPosDependencies++,methodVO.needsGlobalFragmentPos&&(shaderObject.usesGlobalPosFragment=!0)):methodVO.needsGlobalFragmentPos&&(shaderObject.globalPosDependencies++,shaderObject.usesGlobalPosFragment=!0),methodVO.needsNormals&&shaderObject.normalDependencies++,methodVO.needsTangents&&shaderObject.tangentDependencies++,methodVO.needsView&&shaderObject.viewDirDependencies++,methodVO.needsUV&&shaderObject.uvDependencies++,methodVO.needsSecondaryUV&&shaderObject.secondaryUVDependencies++},TriangleMethodPass.prototype._iGetPreLightingVertexCode=function(shaderObject,registerCache,sharedRegisters){var code="";return this._iAmbientMethodVO&&this._iAmbientMethodVO.useMethod&&(code+=this._iAmbientMethodVO.method.iGetVertexCode(shaderObject,this._iAmbientMethodVO,registerCache,sharedRegisters)),this._iDiffuseMethodVO&&this._iDiffuseMethodVO.useMethod&&(code+=this._iDiffuseMethodVO.method.iGetVertexCode(shaderObject,this._iDiffuseMethodVO,registerCache,sharedRegisters)),this._iSpecularMethodVO&&this._iSpecularMethodVO.useMethod&&(code+=this._iSpecularMethodVO.method.iGetVertexCode(shaderObject,this._iSpecularMethodVO,registerCache,sharedRegisters)),code},TriangleMethodPass.prototype._iGetPreLightingFragmentCode=function(shaderObject,registerCache,sharedRegisters){var code="";return this._iAmbientMethodVO&&this._iAmbientMethodVO.useMethod&&(code+=this._iAmbientMethodVO.method.iGetFragmentCode(shaderObject,this._iAmbientMethodVO,sharedRegisters.shadedTarget,registerCache,sharedRegisters),this._iAmbientMethodVO.needsNormals&®isterCache.removeFragmentTempUsage(sharedRegisters.normalFragment),this._iAmbientMethodVO.needsView&®isterCache.removeFragmentTempUsage(sharedRegisters.viewDirFragment)),this._iDiffuseMethodVO&&this._iDiffuseMethodVO.useMethod&&(code+=this._iDiffuseMethodVO.method.iGetFragmentPreLightingCode(shaderObject,this._iDiffuseMethodVO,registerCache,sharedRegisters)),this._iSpecularMethodVO&&this._iSpecularMethodVO.useMethod&&(code+=this._iSpecularMethodVO.method.iGetFragmentPreLightingCode(shaderObject,this._iSpecularMethodVO,registerCache,sharedRegisters)),code},TriangleMethodPass.prototype._iGetPerLightDiffuseFragmentCode=function(shaderObject,lightDirReg,diffuseColorReg,registerCache,sharedRegisters){return this._iDiffuseMethodVO.method.iGetFragmentCodePerLight(shaderObject,this._iDiffuseMethodVO,lightDirReg,diffuseColorReg,registerCache,sharedRegisters)},TriangleMethodPass.prototype._iGetPerLightSpecularFragmentCode=function(shaderObject,lightDirReg,specularColorReg,registerCache,sharedRegisters){return this._iSpecularMethodVO.method.iGetFragmentCodePerLight(shaderObject,this._iSpecularMethodVO,lightDirReg,specularColorReg,registerCache,sharedRegisters)},TriangleMethodPass.prototype._iGetPerProbeDiffuseFragmentCode=function(shaderObject,texReg,weightReg,registerCache,sharedRegisters){return this._iDiffuseMethodVO.method.iGetFragmentCodePerProbe(shaderObject,this._iDiffuseMethodVO,texReg,weightReg,registerCache,sharedRegisters)},TriangleMethodPass.prototype._iGetPerProbeSpecularFragmentCode=function(shaderObject,texReg,weightReg,registerCache,sharedRegisters){return this._iSpecularMethodVO.method.iGetFragmentCodePerProbe(shaderObject,this._iSpecularMethodVO,texReg,weightReg,registerCache,sharedRegisters)},TriangleMethodPass.prototype._iGetPostLightingVertexCode=function(shaderObject,registerCache,sharedRegisters){var code="";return this._iShadowMethodVO&&(code+=this._iShadowMethodVO.method.iGetVertexCode(shaderObject,this._iShadowMethodVO,registerCache,sharedRegisters)),code},TriangleMethodPass.prototype._iGetPostLightingFragmentCode=function(shaderObject,registerCache,sharedRegisters){var code="";return shaderObject.useAlphaPremultiplied&&this._pEnableBlending&&(code+="add "+sharedRegisters.shadedTarget+".w, "+sharedRegisters.shadedTarget+".w, "+sharedRegisters.commons+".z\ndiv "+sharedRegisters.shadedTarget+".xyz, "+sharedRegisters.shadedTarget+", "+sharedRegisters.shadedTarget+".w\nsub "+sharedRegisters.shadedTarget+".w, "+sharedRegisters.shadedTarget+".w, "+sharedRegisters.commons+".z\nsat "+sharedRegisters.shadedTarget+".xyz, "+sharedRegisters.shadedTarget+"\n"),this._iShadowMethodVO&&(code+=this._iShadowMethodVO.method.iGetFragmentCode(shaderObject,this._iShadowMethodVO,sharedRegisters.shadowTarget,registerCache,sharedRegisters)),this._iDiffuseMethodVO&&this._iDiffuseMethodVO.useMethod&&(code+=this._iDiffuseMethodVO.method.iGetFragmentPostLightingCode(shaderObject,this._iDiffuseMethodVO,sharedRegisters.shadedTarget,registerCache,sharedRegisters),this._iDiffuseMethodVO.needsNormals&®isterCache.removeFragmentTempUsage(sharedRegisters.normalFragment),this._iDiffuseMethodVO.needsView&®isterCache.removeFragmentTempUsage(sharedRegisters.viewDirFragment)),this._iSpecularMethodVO&&this._iSpecularMethodVO.useMethod&&(code+=this._iSpecularMethodVO.method.iGetFragmentPostLightingCode(shaderObject,this._iSpecularMethodVO,sharedRegisters.shadedTarget,registerCache,sharedRegisters),this._iSpecularMethodVO.needsNormals&®isterCache.removeFragmentTempUsage(sharedRegisters.normalFragment),this._iSpecularMethodVO.needsView&®isterCache.removeFragmentTempUsage(sharedRegisters.viewDirFragment)),this._iShadowMethodVO&®isterCache.removeFragmentTempUsage(sharedRegisters.shadowTarget),code},TriangleMethodPass.prototype._pUsesTangentSpace=function(shaderObject){if(shaderObject.usesProbes)return!1;for(var methodVO,len=this._iMethodVOs.length,i=0;len>i;++i)if(methodVO=this._iMethodVOs[i],methodVO.useMethod&&!methodVO.method.iUsesTangentSpace())return!1;return!0},TriangleMethodPass.prototype._pOutputsTangentNormals=function(){return this._iNormalMethodVO.method.iOutputsTangentNormals()},TriangleMethodPass.prototype._pOutputsNormals=function(){return this._iNormalMethodVO&&this._iNormalMethodVO.useMethod},TriangleMethodPass.prototype._iGetNormalVertexCode=function(shaderObject,registerCache,sharedRegisters){return this._iNormalMethodVO.method.iGetVertexCode(shaderObject,this._iNormalMethodVO,registerCache,sharedRegisters)},TriangleMethodPass.prototype._iGetNormalFragmentCode=function(shaderObject,registerCache,sharedRegisters){var code=this._iNormalMethodVO.method.iGetFragmentCode(shaderObject,this._iNormalMethodVO,sharedRegisters.normalFragment,registerCache,sharedRegisters);return this._iNormalMethodVO.needsView&®isterCache.removeFragmentTempUsage(sharedRegisters.viewDirFragment),(this._iNormalMethodVO.needsGlobalFragmentPos||this._iNormalMethodVO.needsGlobalVertexPos)&®isterCache.removeVertexTempUsage(sharedRegisters.globalPositionVertex),code},TriangleMethodPass.prototype._iGetVertexCode=function(shaderObject,regCache,sharedReg){for(var methodVO,code="",len=this._iMethodVOs.length,i=len-this._numEffectDependencies;len>i;i++)methodVO=this._iMethodVOs[i],methodVO.useMethod&&(code+=methodVO.method.iGetVertexCode(shaderObject,methodVO,regCache,sharedReg),(methodVO.needsGlobalVertexPos||methodVO.needsGlobalFragmentPos)&®Cache.removeVertexTempUsage(sharedReg.globalPositionVertex));return this._iColorTransformMethodVO&&this._iColorTransformMethodVO.useMethod&&(code+=this._iColorTransformMethodVO.method.iGetVertexCode(shaderObject,this._iColorTransformMethodVO,regCache,sharedReg)),code},TriangleMethodPass.prototype._iGetFragmentCode=function(shaderObject,regCache,sharedReg){var alphaReg,code="";this.preserveAlpha&&this._numEffectDependencies>0&&(alphaReg=regCache.getFreeFragmentSingleTemp(),regCache.addFragmentTempUsages(alphaReg,1),code+="mov "+alphaReg+", "+sharedReg.shadedTarget+".w\n");for(var methodVO,len=this._iMethodVOs.length,i=len-this._numEffectDependencies;len>i;i++)methodVO=this._iMethodVOs[i],methodVO.useMethod&&(code+=methodVO.method.iGetFragmentCode(shaderObject,methodVO,sharedReg.shadedTarget,regCache,sharedReg),methodVO.needsNormals&®Cache.removeFragmentTempUsage(sharedReg.normalFragment),methodVO.needsView&®Cache.removeFragmentTempUsage(sharedReg.viewDirFragment));return this.preserveAlpha&&this._numEffectDependencies>0&&(code+="mov "+sharedReg.shadedTarget+".w, "+alphaReg+"\n",regCache.removeFragmentTempUsage(alphaReg)),this._iColorTransformMethodVO&&this._iColorTransformMethodVO.useMethod&&(code+=this._iColorTransformMethodVO.method.iGetFragmentCode(shaderObject,this._iColorTransformMethodVO,sharedReg.shadedTarget,regCache,sharedReg)),code},TriangleMethodPass.prototype._iUsesShadows=function(){return Boolean(this._iShadowMethodVO||this.lightPicker.castingDirectionalLights.length>0||this.lightPicker.castingPointLights.length>0)},TriangleMethodPass.prototype._iUsesSpecular=function(){return Boolean(this._iSpecularMethodVO)},TriangleMethodPass}(materials.MaterialPassBase);materials.TriangleMethodPass=TriangleMethodPass}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var StageGLMaterialBase=function(_super){function StageGLMaterialBase(){_super.apply(this,arguments)}return __extends(StageGLMaterialBase,_super),StageGLMaterialBase.prototype._iGetVertexCode=function(){return""},StageGLMaterialBase.prototype._iGetFragmentCode=function(){return""},StageGLMaterialBase}(materials.MaterialBase);materials.StageGLMaterialBase=StageGLMaterialBase}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var LineSubGeometry=away.base.LineSubGeometry,Matrix3D=away.geom.Matrix3D,ContextGLProgramType=away.stagegl.ContextGLProgramType,LineBasicMaterial=function(_super){function LineBasicMaterial(thickness){"undefined"==typeof thickness&&(thickness=1.25),_super.call(this),this._constants=new Array(0,0,0,0),this._thickness=thickness,this.bothSides=!0,this._pAddScreenPass(this._screenPass=new materials.LineBasicPass),this._calcMatrix=new Matrix3D,this._constants[1]=1/255}return __extends(LineBasicMaterial,_super),LineBasicMaterial.prototype._iGetVertexCode=function(){return"m44 vt0, va0, vc8 \nm44 vt1, va1, vc8 \nsub vt2, vt1, vt0 \nslt vt5.x, vt0.z, vc7.z \nsub vt5.y, vc5.x, vt5.x \nadd vt4.x, vt0.z, vc7.z \nsub vt4.y, vt0.z, vt1.z \nseq vt4.z, vt4.y vc6.x \nadd vt4.y, vt4.y, vt4.z \ndiv vt4.z, vt4.x, vt4.y \nmul vt4.xyz, vt4.zzz, vt2.xyz \nadd vt3.xyz, vt0.xyz, vt4.xyz \nmov vt3.w, vc5.x \nmul vt0, vt0, vt5.yyyy \nmul vt3, vt3, vt5.xxxx \nadd vt0, vt0, vt3 \nsub vt2, vt1, vt0 \nnrm vt2.xyz, vt2.xyz \nnrm vt5.xyz, vt0.xyz \nmov vt5.w, vc5.x \ncrs vt3.xyz, vt2, vt5 \nnrm vt3.xyz, vt3.xyz \nmul vt3.xyz, vt3.xyz, va2.xxx \nmov vt3.w, vc5.x \ndp3 vt4.x, vt0, vc6 \nmul vt4.x, vt4.x, vc7.x \nmul vt3.xyz, vt3.xyz, vt4.xxx \nadd vt0.xyz, vt0.xyz, vt3.xyz \nm44 op, vt0, vc0 \nmov v0, va3 \n"},LineBasicMaterial.prototype._iActivatePass=function(pass,stage,camera){_super.prototype._iActivatePass.call(this,pass,stage,camera);var context=stage.context;this._constants[0]=this._thickness/(stage.scissorRect?Math.min(stage.scissorRect.width,stage.scissorRect.height):Math.min(stage.width,stage.height)),this._constants[2]=camera.projection.near,context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX,5,LineBasicMaterial.pONE_VECTOR,1),context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX,6,LineBasicMaterial.pFRONT_VECTOR,1),context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX,7,this._constants,1),context.setProgramConstantsFromMatrix(ContextGLProgramType.VERTEX,0,camera.projection.matrix,!0)},LineBasicMaterial.prototype._iRenderPass=function(pass,renderable,stage,camera,viewProjection){_super.prototype._iRenderPass.call(this,pass,renderable,stage,camera,viewProjection);var context=stage.context;this._calcMatrix.copyFrom(renderable.sourceEntity.sceneTransform),this._calcMatrix.append(camera.inverseSceneTransform),context.setProgramConstantsFromMatrix(ContextGLProgramType.VERTEX,8,this._calcMatrix,!0),context.activateBuffer(0,renderable.getVertexData(LineSubGeometry.START_POSITION_DATA),renderable.getVertexOffset(LineSubGeometry.START_POSITION_DATA),LineSubGeometry.POSITION_FORMAT),context.activateBuffer(1,renderable.getVertexData(LineSubGeometry.END_POSITION_DATA),renderable.getVertexOffset(LineSubGeometry.END_POSITION_DATA),LineSubGeometry.POSITION_FORMAT),context.activateBuffer(2,renderable.getVertexData(LineSubGeometry.THICKNESS_DATA),renderable.getVertexOffset(LineSubGeometry.THICKNESS_DATA),LineSubGeometry.THICKNESS_FORMAT),context.activateBuffer(3,renderable.getVertexData(LineSubGeometry.COLOR_DATA),renderable.getVertexOffset(LineSubGeometry.COLOR_DATA),LineSubGeometry.COLOR_FORMAT),context.drawTriangles(context.getIndexBuffer(renderable.getIndexData()),0,renderable.numTriangles)},LineBasicMaterial.pONE_VECTOR=Array(1,1,1,1),LineBasicMaterial.pFRONT_VECTOR=Array(0,0,-1,0),LineBasicMaterial}(materials.StageGLMaterialBase);materials.LineBasicMaterial=LineBasicMaterial}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var TriangleSubGeometry=away.base.TriangleSubGeometry,ContextGLCompareMode=away.stagegl.ContextGLCompareMode,ContextGLMipFilter=away.stagegl.ContextGLMipFilter,ContextGLProgramType=away.stagegl.ContextGLProgramType,ContextGLTextureFilter=away.stagegl.ContextGLTextureFilter,ContextGLWrapMode=away.stagegl.ContextGLWrapMode,SkyboxMaterial=function(_super){function SkyboxMaterial(cubeMap,smooth,repeat,mipmap){"undefined"==typeof smooth&&(smooth=!0),"undefined"==typeof repeat&&(repeat=!1),"undefined"==typeof mipmap&&(mipmap=!1),_super.call(this),this._cubeMap=cubeMap,this._pAddScreenPass(this._skyboxPass=new materials.SkyboxPass),this._vertexData=new Array(0,0,0,0,1,1,1,1)}return __extends(SkyboxMaterial,_super),Object.defineProperty(SkyboxMaterial.prototype,"cubeMap",{get:function(){return this._cubeMap},set:function(value){value&&this._cubeMap&&(value.hasMipmaps!=this._cubeMap.hasMipmaps||value.format!=this._cubeMap.format)&&this._pInvalidatePasses(),this._cubeMap=value},enumerable:!0,configurable:!0}),SkyboxMaterial.prototype._iGetVertexCode=function(){return"mul vt0, va0, vc5\nadd vt0, vt0, vc4\nm44 op, vt0, vc0\nmov v0, va0\n"},SkyboxMaterial.prototype._iGetFragmentCode=function(){var mip=",mipnone";return this._cubeMap.hasMipmaps&&(mip=",miplinear"),"tex ft0, v0, fs0 \n"},SkyboxMaterial.prototype._iActivatePass=function(pass,stage,camera){_super.prototype._iActivatePass.call(this,pass,stage,camera);var context=stage.context;context.setSamplerStateAt(0,ContextGLWrapMode.CLAMP,ContextGLTextureFilter.LINEAR,this._cubeMap.hasMipmaps?ContextGLMipFilter.MIPLINEAR:ContextGLMipFilter.MIPNONE),context.setDepthTest(!1,ContextGLCompareMode.LESS),context.activateCubeTexture(0,this._cubeMap)},SkyboxMaterial.prototype._iRenderPass=function(pass,renderable,stage,camera,viewProjection){_super.prototype._iRenderPass.call(this,pass,renderable,stage,camera,viewProjection);var context=stage.context,pos=camera.scenePosition;this._vertexData[0]=pos.x,this._vertexData[1]=pos.y,this._vertexData[2]=pos.z,this._vertexData[4]=this._vertexData[5]=this._vertexData[6]=camera.projection.far/Math.sqrt(3),context.setProgramConstantsFromMatrix(ContextGLProgramType.VERTEX,0,viewProjection,!0),context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX,4,this._vertexData,2),context.activateBuffer(0,renderable.getVertexData(TriangleSubGeometry.POSITION_DATA),renderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA),TriangleSubGeometry.POSITION_FORMAT),context.drawTriangles(context.getIndexBuffer(renderable.getIndexData()),0,renderable.numTriangles)},SkyboxMaterial}(materials.StageGLMaterialBase);materials.SkyboxMaterial=SkyboxMaterial}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var TriangleSubGeometry=away.base.TriangleSubGeometry,Matrix3DUtils=away.geom.Matrix3DUtils,ContextGLProgramType=away.stagegl.ContextGLProgramType,TriangleMaterialBase=function(_super){function TriangleMaterialBase(){_super.apply(this,arguments)}return __extends(TriangleMaterialBase,_super),TriangleMaterialBase.prototype._iGetVertexCode=function(shaderObject,registerCache,sharedRegisters){var code="",position=shaderObject.globalPosDependencies>0?sharedRegisters.globalPositionVertex:sharedRegisters.localPosition,viewMatrixReg=registerCache.getFreeVertexConstant();if(registerCache.getFreeVertexConstant(),registerCache.getFreeVertexConstant(),registerCache.getFreeVertexConstant(),shaderObject.viewMatrixIndex=4*viewMatrixReg.index,shaderObject.projectionDependencies>0){sharedRegisters.projectionFragment=registerCache.getFreeVarying();var temp=registerCache.getFreeVertexVectorTemp();code+="m44 "+temp+", "+position+", "+viewMatrixReg+"\nmov "+sharedRegisters.projectionFragment+", "+temp+"\nmov op, "+temp+"\n"}else code+="m44 op, "+position+", "+viewMatrixReg+"\n";return code},TriangleMaterialBase.prototype._iRenderPass=function(pass,renderable,stage,camera,viewProjection){_super.prototype._iRenderPass.call(this,pass,renderable,stage,camera,viewProjection);var shaderObject=pass.shaderObject;if(shaderObject.sceneMatrixIndex>=0)renderable.sourceEntity.getRenderSceneTransform(camera).copyRawDataTo(shaderObject.vertexConstantData,shaderObject.sceneMatrixIndex,!0),viewProjection.copyRawDataTo(shaderObject.vertexConstantData,shaderObject.viewMatrixIndex,!0);else{var matrix3D=Matrix3DUtils.CALCULATION_MATRIX;matrix3D.copyFrom(renderable.sourceEntity.getRenderSceneTransform(camera)),matrix3D.append(viewProjection),matrix3D.copyRawDataTo(shaderObject.vertexConstantData,shaderObject.viewMatrixIndex,!0)}var context=stage.context;context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX,0,shaderObject.vertexConstantData,shaderObject.numUsedVertexConstants),context.setProgramConstantsFromArray(ContextGLProgramType.FRAGMENT,0,shaderObject.fragmentConstantData,shaderObject.numUsedFragmentConstants),context.activateBuffer(0,renderable.getVertexData(TriangleSubGeometry.POSITION_DATA),renderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA),TriangleSubGeometry.POSITION_FORMAT),context.drawTriangles(context.getIndexBuffer(renderable.getIndexData()),0,renderable.numTriangles)},TriangleMaterialBase}(materials.StageGLMaterialBase);materials.TriangleMaterialBase=TriangleMaterialBase}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var ContextGLCompareMode=away.stagegl.ContextGLCompareMode,Texture2DBase=away.textures.Texture2DBase,TriangleBasicMaterial=function(_super){function TriangleBasicMaterial(textureColor,smoothAlpha,repeat,mipmap){"undefined"==typeof textureColor&&(textureColor=null),"undefined"==typeof smoothAlpha&&(smoothAlpha=null),"undefined"==typeof repeat&&(repeat=!1),"undefined"==typeof mipmap&&(mipmap=!1),_super.call(this),this._alphaBlending=!1,this._alpha=1,this._depthCompareMode=ContextGLCompareMode.LESS_EQUAL,this._screenPass=new materials.TriangleBasicPass,textureColor instanceof Texture2DBase?(this.texture=textureColor,this.smooth=null==smoothAlpha?!0:!1,this.repeat=repeat,this.mipmap=mipmap):(this.color=textureColor?Number(textureColor):13421772,this.alpha=null==smoothAlpha?1:Number(smoothAlpha))}return __extends(TriangleBasicMaterial,_super),Object.defineProperty(TriangleBasicMaterial.prototype,"depthCompareMode",{get:function(){return this._depthCompareMode},set:function(value){this._depthCompareMode!=value&&(this._depthCompareMode=value,this._pInvalidatePasses())},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleBasicMaterial.prototype,"alpha",{get:function(){return this._alpha},set:function(value){value>1?value=1:0>value&&(value=0),this._alpha!=value&&(this._alpha=value,this._pInvalidatePasses())},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleBasicMaterial.prototype,"alphaBlending",{get:function(){return this._alphaBlending},set:function(value){this._alphaBlending!=value&&(this._alphaBlending=value,this._pInvalidatePasses())},enumerable:!0,configurable:!0}),TriangleBasicMaterial.prototype.iUpdateMaterial=function(){var passesInvalid;this._pScreenPassesInvalid&&(this.pUpdateScreenPasses(),passesInvalid=!0),passesInvalid&&(this._pClearScreenPasses(),this._pAddScreenPass(this._screenPass))},TriangleBasicMaterial.prototype.pUpdateScreenPasses=function(){this.initPasses(),this.setBlendAndCompareModes(),this._pScreenPassesInvalid=!1},TriangleBasicMaterial.prototype.initPasses=function(){},TriangleBasicMaterial.prototype.setBlendAndCompareModes=function(){this._pRequiresBlending=this._pBlendMode!=away.base.BlendMode.NORMAL||this._alphaBlending||this._alpha<1,this._screenPass.depthCompareMode=this._depthCompareMode,this._screenPass.preserveAlpha=this._pRequiresBlending,this._screenPass.setBlendMode(this._pBlendMode==away.base.BlendMode.NORMAL&&this._pRequiresBlending?away.base.BlendMode.LAYER:this._pBlendMode),this._screenPass.forceSeparateMVP=!1},TriangleBasicMaterial}(materials.TriangleMaterialBase);materials.TriangleBasicMaterial=TriangleBasicMaterial}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var TriangleMaterialMode=function(){function TriangleMaterialMode(){}return TriangleMaterialMode.SINGLE_PASS="singlePass",TriangleMaterialMode.MULTI_PASS="multiPass",TriangleMaterialMode}();materials.TriangleMaterialMode=TriangleMaterialMode}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var BlendMode=away.base.BlendMode,ColorTransform=away.geom.ColorTransform,ContextGLCompareMode=away.stagegl.ContextGLCompareMode,Texture2DBase=away.textures.Texture2DBase,TriangleMethodMaterial=function(_super){function TriangleMethodMaterial(textureColor,smoothAlpha,repeat,mipmap){"undefined"==typeof textureColor&&(textureColor=null),"undefined"==typeof smoothAlpha&&(smoothAlpha=null),"undefined"==typeof repeat&&(repeat=!1),"undefined"==typeof mipmap&&(mipmap=!1),_super.call(this),this._alphaBlending=!1,this._alpha=1,this._ambientMethod=new materials.AmbientBasicMethod,this._diffuseMethod=new materials.DiffuseBasicMethod,this._normalMethod=new materials.NormalBasicMethod,this._specularMethod=new materials.SpecularBasicMethod,this._depthCompareMode=ContextGLCompareMode.LESS_EQUAL,this._materialMode=materials.TriangleMaterialMode.SINGLE_PASS,textureColor instanceof Texture2DBase?(this.texture=textureColor,this.smooth=null==smoothAlpha?!0:!1,this.repeat=repeat,this.mipmap=mipmap):(this.color=null==textureColor?16777215:Number(textureColor),this.alpha=null==smoothAlpha?1:Number(smoothAlpha))}return __extends(TriangleMethodMaterial,_super),Object.defineProperty(TriangleMethodMaterial.prototype,"materialMode",{get:function(){return this._materialMode},set:function(value){this._materialMode!=value&&(this._materialMode=value,this._pInvalidateScreenPasses())},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleMethodMaterial.prototype,"depthCompareMode",{get:function(){return this._depthCompareMode},set:function(value){this._depthCompareMode!=value&&(this._depthCompareMode=value,this._pInvalidateScreenPasses())},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleMethodMaterial.prototype,"alpha",{get:function(){return this._alpha},set:function(value){value>1?value=1:0>value&&(value=0),this._alpha!=value&&(this._alpha=value,null==this._colorTransform&&(this._colorTransform=new ColorTransform),this._colorTransform.alphaMultiplier=value,this._pInvalidatePasses())},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleMethodMaterial.prototype,"colorTransform",{get:function(){return this._screenPass.colorTransform},set:function(value){this._screenPass.colorTransform=value},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleMethodMaterial.prototype,"diffuseTexture",{get:function(){return this._diffuseMethod.texture},set:function(value){this._diffuseMethod.texture=value},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleMethodMaterial.prototype,"ambientMethod",{get:function(){return this._ambientMethod},set:function(value){this._ambientMethod!=value&&(value&&this._ambientMethod&&value.copyFrom(this._ambientMethod),this._ambientMethod=value,this._pInvalidateScreenPasses())},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleMethodMaterial.prototype,"shadowMethod",{get:function(){return this._shadowMethod},set:function(value){this._shadowMethod!=value&&(value&&this._shadowMethod&&value.copyFrom(this._shadowMethod),this._shadowMethod=value,this._pInvalidateScreenPasses()) -},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleMethodMaterial.prototype,"diffuseMethod",{get:function(){return this._diffuseMethod},set:function(value){this._diffuseMethod!=value&&(value&&this._diffuseMethod&&value.copyFrom(this._diffuseMethod),this._diffuseMethod=value,this._pInvalidateScreenPasses())},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleMethodMaterial.prototype,"specularMethod",{get:function(){return this._specularMethod},set:function(value){this._specularMethod!=value&&(value&&this._specularMethod&&value.copyFrom(this._specularMethod),this._specularMethod=value,this._pInvalidateScreenPasses())},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleMethodMaterial.prototype,"normalMethod",{get:function(){return this._normalMethod},set:function(value){this._normalMethod!=value&&(value&&this._normalMethod&&value.copyFrom(this._normalMethod),this._normalMethod=value,this._pInvalidateScreenPasses())},enumerable:!0,configurable:!0}),TriangleMethodMaterial.prototype.addEffectMethod=function(method){null==this._screenPass&&(this._screenPass=new materials.TriangleMethodPass),this._screenPass.addEffectMethod(method),this._pInvalidateScreenPasses()},Object.defineProperty(TriangleMethodMaterial.prototype,"numEffectMethods",{get:function(){return this._screenPass?this._screenPass.numEffectMethods:0},enumerable:!0,configurable:!0}),TriangleMethodMaterial.prototype.hasEffectMethod=function(method){return this._screenPass?this._screenPass.hasEffectMethod(method):!1},TriangleMethodMaterial.prototype.getEffectMethodAt=function(index){return null==this._screenPass?null:this._screenPass.getEffectMethodAt(index)},TriangleMethodMaterial.prototype.addEffectMethodAt=function(method,index){null==this._screenPass&&(this._screenPass=new materials.TriangleMethodPass),this._screenPass.addEffectMethodAt(method,index),this._pInvalidatePasses()},TriangleMethodMaterial.prototype.removeEffectMethod=function(method){null!=this._screenPass&&(this._screenPass.removeEffectMethod(method),0==this._screenPass.numEffectMethods&&this._pInvalidatePasses())},Object.defineProperty(TriangleMethodMaterial.prototype,"normalMap",{get:function(){return this._normalMethod.normalMap},set:function(value){this._normalMethod.normalMap=value},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleMethodMaterial.prototype,"specularMap",{get:function(){return this._specularMethod.texture},set:function(value){this._specularMethod.texture=value},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleMethodMaterial.prototype,"gloss",{get:function(){return this._specularMethod.gloss},set:function(value){this._specularMethod.gloss=value},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleMethodMaterial.prototype,"ambient",{get:function(){return this._ambientMethod.ambient},set:function(value){this._ambientMethod.ambient=value},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleMethodMaterial.prototype,"specular",{get:function(){return this._specularMethod.specular},set:function(value){this._specularMethod.specular=value},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleMethodMaterial.prototype,"ambientColor",{get:function(){return this._diffuseMethod.ambientColor},set:function(value){this._diffuseMethod.ambientColor=value},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleMethodMaterial.prototype,"diffuseColor",{get:function(){return this._diffuseMethod.diffuseColor},set:function(value){this._diffuseMethod.diffuseColor=value},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleMethodMaterial.prototype,"specularColor",{get:function(){return this._specularMethod.specularColor},set:function(value){this._specularMethod.specularColor=value},enumerable:!0,configurable:!0}),Object.defineProperty(TriangleMethodMaterial.prototype,"alphaBlending",{get:function(){return this._alphaBlending},set:function(value){this._alphaBlending!=value&&(this._alphaBlending=value,this._pInvalidatePasses())},enumerable:!0,configurable:!0}),TriangleMethodMaterial.prototype._iUpdateMaterial=function(){if(this._pScreenPassesInvalid){if(this._pScreenPassesInvalid=!1,this.initPasses(),this.setBlendAndCompareModes(),this._pClearScreenPasses(),this._materialMode==materials.TriangleMaterialMode.MULTI_PASS&&(this._casterLightPass&&this._pAddScreenPass(this._casterLightPass),this._nonCasterLightPasses))for(var i=0;i0||this._materialMode==materials.TriangleMaterialMode.SINGLE_PASS?this.initEffectPass():this._screenPass&&this.removeEffectPass(),this._shadowMethod&&this._materialMode==materials.TriangleMaterialMode.MULTI_PASS?this.initCasterLightPass():this._casterLightPass&&this.removeCasterLightPass(),this.numNonCasters>0&&this._materialMode==materials.TriangleMaterialMode.MULTI_PASS?this.initNonCasterLightPasses():this._nonCasterLightPasses&&this.removeNonCasterLightPasses()},TriangleMethodMaterial.prototype.setBlendAndCompareModes=function(){var forceSeparateMVP=Boolean(this._casterLightPass||this._screenPass);if(this._casterLightPass&&(this._casterLightPass.forceSeparateMVP=forceSeparateMVP,this._casterLightPass.setBlendMode(BlendMode.NORMAL),this._casterLightPass.depthCompareMode=this._depthCompareMode),this._nonCasterLightPasses){var firstAdditiveIndex=0;this._casterLightPass||(this._nonCasterLightPasses[0].forceSeparateMVP=forceSeparateMVP,this._nonCasterLightPasses[0].setBlendMode(BlendMode.NORMAL),this._nonCasterLightPasses[0].depthCompareMode=this._depthCompareMode,firstAdditiveIndex=1);for(var i=firstAdditiveIndex;idirLightOffset||numPointLights>pointLightOffset||numLightProbes>probeOffset;)pass=new materials.TriangleMethodPass(materials.MaterialPassMode.LIGHTING),pass.includeCasters=null==this._shadowMethod,pass.directionalLightsOffset=dirLightOffset,pass.pointLightsOffset=pointLightOffset,pass.lightProbesOffset=probeOffset,pass.lightPicker=this._pLightPicker,pass.diffuseMethod=this._diffuseMethod,pass.ambientMethod=this._ambientMethod,pass.normalMethod=this._normalMethod,pass.specularMethod=this._specularMethod,this._nonCasterLightPasses.push(pass),dirLightOffset+=pass.iNumDirectionalLights,pointLightOffset+=pass.iNumPointLights,probeOffset+=pass.iNumLightProbes},TriangleMethodMaterial.prototype.removeNonCasterLightPasses=function(){if(this._nonCasterLightPasses){for(var i=0;ii;i++)for(j=0;8>j;j++)1&j^1&i&&b.setPixel(i,j,16777215);return b},DefaultMaterialManager.createDefaultTriangleMaterial=function(){DefaultMaterialManager._defaultTexture||DefaultMaterialManager.createDefaultTexture(),DefaultMaterialManager._defaultTriangleMaterial=new materials.TriangleBasicMaterial(DefaultMaterialManager._defaultTexture),DefaultMaterialManager._defaultTriangleMaterial.mipmap=!1,DefaultMaterialManager._defaultTriangleMaterial.smooth=!1,DefaultMaterialManager._defaultTriangleMaterial.name="defaultTriangleMaterial"},DefaultMaterialManager.createDefaultLineMaterial=function(){DefaultMaterialManager._defaultLineMaterial=new materials.LineBasicMaterial,DefaultMaterialManager._defaultLineMaterial.name="defaultSegmentMaterial"},DefaultMaterialManager}();materials.DefaultMaterialManager=DefaultMaterialManager}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(materials){var ContextGLTextureFormat=away.stagegl.ContextGLTextureFormat,ShaderCompilerHelper=function(){function ShaderCompilerHelper(){}return ShaderCompilerHelper.getTex2DSampleCode=function(targetReg,sharedReg,inputReg,texture,smooth,repeat,mipmaps,uvReg,forceWrap){"undefined"==typeof uvReg&&(uvReg=null),"undefined"==typeof forceWrap&&(forceWrap=null);var wrap=forceWrap||(repeat?"wrap":"clamp"),format=ShaderCompilerHelper.getFormatStringForTexture(texture),enableMipMaps=mipmaps&&texture.hasMipmaps,filter=smooth?enableMipMaps?"linear,miplinear":"linear":enableMipMaps?"nearest,mipnearest":"nearest";return null==uvReg&&(uvReg=sharedReg.uvVarying),"tex "+targetReg+", "+uvReg+", "+inputReg+" <2d,"+filter+","+format+wrap+">\n"},ShaderCompilerHelper.getTexCubeSampleCode=function(targetReg,inputReg,texture,smooth,mipmaps,uvReg){var filter,format=ShaderCompilerHelper.getFormatStringForTexture(texture),enableMipMaps=mipmaps&&texture.hasMipmaps,filter=smooth?enableMipMaps?"linear,miplinear":"linear":enableMipMaps?"nearest,mipnearest":"nearest";return"tex "+targetReg+", "+uvReg+", "+inputReg+" \n"},ShaderCompilerHelper.getFormatStringForTexture=function(texture){switch(texture.format){case ContextGLTextureFormat.COMPRESSED:return"dxt1,";case ContextGLTextureFormat.COMPRESSED_ALPHA:return"dxt5,";default:return""}},ShaderCompilerHelper}();materials.ShaderCompilerHelper=ShaderCompilerHelper}(away.materials||(away.materials={}));away.materials}(away||(away={}));var away;!function(away){!function(render){var RendererEvent=away.events.RendererEvent,StageEvent=away.events.StageEvent,Matrix3D=away.geom.Matrix3D,Point=away.geom.Point,Rectangle=away.geom.Rectangle,DefaultMaterialManager=away.materials.DefaultMaterialManager,BillboardRenderable=away.pool.BillboardRenderable,LineSubMeshRenderable=away.pool.LineSubMeshRenderable,RenderablePool=away.pool.RenderablePool,TriangleSubMeshRenderable=away.pool.TriangleSubMeshRenderable,RenderableMergeSort=away.sort.RenderableMergeSort,ContextGLCompareMode=away.stagegl.ContextGLCompareMode,EntityCollector=away.traverse.EntityCollector,RendererBase=function(_super){function RendererBase(){var _this=this;_super.call(this),this._viewPort=new Rectangle,this._pBackBufferInvalid=!0,this._pDepthTextureInvalid=!0,this._depthPrepass=!1,this._backgroundR=0,this._backgroundG=0,this._backgroundB=0,this._backgroundAlpha=1,this._shareContext=!1,this.textureRatioX=1,this.textureRatioY=1,this._pRttViewProjectionMatrix=new Matrix3D,this._localPos=new Point,this._globalPos=new Point,this._pScissorRect=new Rectangle,this._pNumTriangles=0,this._onViewportUpdatedDelegate=function(event){return _this.onViewportUpdated(event)},this._billboardRenderablePool=RenderablePool.getPool(BillboardRenderable),this._triangleSubMeshRenderablePool=RenderablePool.getPool(TriangleSubMeshRenderable),this._lineSubMeshRenderablePool=RenderablePool.getPool(LineSubMeshRenderable),this._onContextUpdateDelegate=function(event){return _this.onContextUpdate(event)},this.renderableSorter=new RenderableMergeSort}return __extends(RendererBase,_super),Object.defineProperty(RendererBase.prototype,"numTriangles",{get:function(){return this._pNumTriangles},enumerable:!0,configurable:!0}),Object.defineProperty(RendererBase.prototype,"viewPort",{get:function(){return this._viewPort},enumerable:!0,configurable:!0}),Object.defineProperty(RendererBase.prototype,"scissorRect",{get:function(){return this._pScissorRect},enumerable:!0,configurable:!0}),Object.defineProperty(RendererBase.prototype,"x",{get:function(){return this._localPos.x},set:function(value){this.x!=value&&(this._globalPos.x=this._localPos.x=value,this.updateGlobalPos())},enumerable:!0,configurable:!0}),Object.defineProperty(RendererBase.prototype,"y",{get:function(){return this._localPos.y},set:function(value){this.y!=value&&(this._globalPos.y=this._localPos.y=value,this.updateGlobalPos())},enumerable:!0,configurable:!0}),Object.defineProperty(RendererBase.prototype,"width",{get:function(){return this._width},set:function(value){this._width!=value&&(this._width=value,this._pScissorRect.width=value,this._pRttBufferManager&&(this._pRttBufferManager.viewWidth=value),this._pBackBufferInvalid=!0,this._pDepthTextureInvalid=!0,this.notifyScissorUpdate())},enumerable:!0,configurable:!0}),Object.defineProperty(RendererBase.prototype,"height",{get:function(){return this._height},set:function(value){this._height!=value&&(this._height=value,this._pScissorRect.height=value,this._pRttBufferManager&&(this._pRttBufferManager.viewHeight=value),this._pBackBufferInvalid=!0,this._pDepthTextureInvalid=!0,this.notifyScissorUpdate())},enumerable:!0,configurable:!0}),RendererBase.prototype._iCreateEntityCollector=function(){return new EntityCollector},Object.defineProperty(RendererBase.prototype,"_iBackgroundR",{get:function(){return this._backgroundR},set:function(value){this._backgroundR!=value&&(this._backgroundR=value,this._pBackBufferInvalid=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(RendererBase.prototype,"_iBackgroundG",{get:function(){return this._backgroundG},set:function(value){this._backgroundG!=value&&(this._backgroundG=value,this._pBackBufferInvalid=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(RendererBase.prototype,"_iBackgroundB",{get:function(){return this._backgroundB},set:function(value){this._backgroundB!=value&&(this._backgroundB=value,this._pBackBufferInvalid=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(RendererBase.prototype,"stage",{get:function(){return this._pStage},set:function(value){value!=this._pStage&&this.iSetStage(value)},enumerable:!0,configurable:!0}),RendererBase.prototype.iSetStage=function(value){this._pStage&&(this._pStage.removeEventListener(StageEvent.CONTEXT_CREATED,this._onContextUpdateDelegate),this._pStage.removeEventListener(StageEvent.CONTEXT_RECREATED,this._onContextUpdateDelegate),this._pStage.removeEventListener(StageEvent.VIEWPORT_UPDATED,this._onViewportUpdatedDelegate)),value?(this._pStage=value,this._pStage.addEventListener(StageEvent.CONTEXT_CREATED,this._onContextUpdateDelegate),this._pStage.addEventListener(StageEvent.CONTEXT_RECREATED,this._onContextUpdateDelegate),this._pStage.addEventListener(StageEvent.VIEWPORT_UPDATED,this._onViewportUpdatedDelegate),this._pStage.context&&(this._pContext=this._pStage.context)):(this._pStage=null,this._pContext=null),this._pBackBufferInvalid=!0,this.updateGlobalPos()},Object.defineProperty(RendererBase.prototype,"shareContext",{get:function(){return this._shareContext},set:function(value){this._shareContext!=value&&(this._shareContext=value,this.updateGlobalPos())},enumerable:!0,configurable:!0}),RendererBase.prototype.dispose=function(){this._pRttBufferManager&&this._pRttBufferManager.dispose(),this._pRttBufferManager=null,this._pStage.removeEventListener(StageEvent.CONTEXT_CREATED,this._onContextUpdateDelegate),this._pStage.removeEventListener(StageEvent.CONTEXT_RECREATED,this._onContextUpdateDelegate),this._pStage.removeEventListener(StageEvent.VIEWPORT_UPDATED,this._onViewportUpdatedDelegate),this._pStage=null},RendererBase.prototype.render=function(){this._viewportDirty=!1,this._scissorDirty=!1},RendererBase.prototype._iRender=function(entityCollector,target,scissorRect,surfaceSelector){if("undefined"==typeof target&&(target=null),"undefined"==typeof scissorRect&&(scissorRect=null),"undefined"==typeof surfaceSelector&&(surfaceSelector=0),this._pStage&&this._pContext){this._pRttViewProjectionMatrix.copyFrom(entityCollector.camera.viewProjection),this._pRttViewProjectionMatrix.appendScale(this.textureRatioX,this.textureRatioY,1),this.pExecuteRender(entityCollector,target,scissorRect,surfaceSelector);for(var i=0;8>i;++i)this._pContext.setVertexBufferAt(i,null),this._pContext.setTextureAt(i,null)}},RendererBase.prototype._iRenderCascades=function(){},RendererBase.prototype.pCollectRenderables=function(entityCollector){this._pBlendedRenderableHead=null,this._pOpaqueRenderableHead=null,this._pNumTriangles=0;var item=entityCollector.entityHead;for(this._pCamera=entityCollector.camera,this._iEntryPoint=this._pCamera.scenePosition,this._pCameraForward=this._pCamera.transform.forwardVector;item;)item.entity._iCollectRenderables(this),item=item.next;this._pOpaqueRenderableHead=this.renderableSorter.sortOpaqueRenderables(this._pOpaqueRenderableHead),this._pBlendedRenderableHead=this.renderableSorter.sortBlendedRenderables(this._pBlendedRenderableHead)},RendererBase.prototype.pExecuteRender=function(entityCollector,target,scissorRect,surfaceSelector){"undefined"==typeof target&&(target=null),"undefined"==typeof scissorRect&&(scissorRect=null),"undefined"==typeof surfaceSelector&&(surfaceSelector=0),this._pContext.setRenderTarget(target,!0,surfaceSelector),!target&&this._shareContext||this._depthPrepass||this._pContext.clear(this._backgroundR,this._backgroundG,this._backgroundB,this._backgroundAlpha,1,0),this._pContext.setDepthTest(!1,ContextGLCompareMode.ALWAYS),this._pStage.scissorRect=scissorRect,this.pDraw(entityCollector,target),this._shareContext||this._snapshotRequired&&this._snapshotBitmapData&&(this._pContext.drawToBitmapData(this._snapshotBitmapData),this._snapshotRequired=!1),this._pStage.scissorRect=null},RendererBase.prototype.queueSnapshot=function(bmd){this._snapshotRequired=!0,this._snapshotBitmapData=bmd},RendererBase.prototype.pDraw=function(){throw new away.errors.AbstractMethodError},RendererBase.prototype.onContextUpdate=function(){this._pContext=this._pStage.context},Object.defineProperty(RendererBase.prototype,"_iBackgroundAlpha",{get:function(){return this._backgroundAlpha},set:function(value){this._backgroundAlpha!=value&&(this._backgroundAlpha=value,this._pBackBufferInvalid=!0)},enumerable:!0,configurable:!0}),RendererBase.prototype.notifyScissorUpdate=function(){this._scissorDirty||(this._scissorDirty=!0,this._scissorUpdated||(this._scissorUpdated=new RendererEvent(RendererEvent.SCISSOR_UPDATED)),this.dispatchEvent(this._scissorUpdated))},RendererBase.prototype.notifyViewportUpdate=function(){this._viewportDirty||(this._viewportDirty=!0,this._viewPortUpdated||(this._viewPortUpdated=new RendererEvent(RendererEvent.VIEWPORT_UPDATED)),this.dispatchEvent(this._viewPortUpdated))},RendererBase.prototype.onViewportUpdated=function(){this._viewPort=this._pStage.viewPort,this._shareContext&&(this._pScissorRect.x=this._globalPos.x-this._pStage.x,this._pScissorRect.y=this._globalPos.y-this._pStage.y,this.notifyScissorUpdate()),this.notifyViewportUpdate()},RendererBase.prototype.updateGlobalPos=function(){this._shareContext?(this._pScissorRect.x=this._globalPos.x-this._viewPort.x,this._pScissorRect.y=this._globalPos.y-this._viewPort.y):(this._pScissorRect.x=0,this._pScissorRect.y=0,this._viewPort.x=this._globalPos.x,this._viewPort.y=this._globalPos.y),this.notifyScissorUpdate()},RendererBase.prototype.applyBillboard=function(billboard){this._applyRenderable(this._billboardRenderablePool.getItem(billboard))},RendererBase.prototype.applyTriangleSubMesh=function(triangleSubMesh){this._applyRenderable(this._triangleSubMeshRenderablePool.getItem(triangleSubMesh))},RendererBase.prototype.applyLineSubMesh=function(lineSubMesh){this._applyRenderable(this._lineSubMeshRenderablePool.getItem(lineSubMesh))},RendererBase.prototype._applyRenderable=function(renderable){var material=renderable.materialOwner.material,entity=renderable.sourceEntity,position=entity.scenePosition;material||(material=DefaultMaterialManager.getDefaultMaterial(renderable.materialOwner)),material._iUpdateMaterial(),renderable.material=material,renderable.materialId=material._iMaterialId,renderable.renderOrderId=this._pContext.getMaterial(material,this._pStage.profile).renderOrderId,renderable.cascaded=!1,position=this._iEntryPoint.subtract(position),renderable.zIndex=entity.zOffset+position.dotProduct(this._pCameraForward),renderable.renderSceneTransform=renderable.sourceEntity.getRenderSceneTransform(this._pCamera),material.requiresBlending?(renderable.next=this._pBlendedRenderableHead,this._pBlendedRenderableHead=renderable):(renderable.next=this._pOpaqueRenderableHead,this._pOpaqueRenderableHead=renderable),this._pNumTriangles+=renderable.numTriangles,renderable.overflow&&this._applyRenderable(renderable.overflow)},RendererBase}(away.events.EventDispatcher);render.RendererBase=RendererBase}(away.render||(away.render={}));away.render}(away||(away={}));var away;!function(away){!function(render){var Matrix3D=away.geom.Matrix3D,Vector3D=away.geom.Vector3D,RTTBufferManager=away.managers.RTTBufferManager,StageManager=away.managers.StageManager,DepthMapPass=away.materials.DepthMapPass,DistanceMapPass=away.materials.DistanceMapPass,RenderablePool=away.pool.RenderablePool,SkyboxRenderable=away.pool.SkyboxRenderable,ContextGLBlendFactor=away.stagegl.ContextGLBlendFactor,ContextGLCompareMode=away.stagegl.ContextGLCompareMode,ContextGLClearMask=away.stagegl.ContextGLClearMask,RenderTexture=away.textures.RenderTexture,DefaultRenderer=function(_super){function DefaultRenderer(forceSoftware,profile,mode){"undefined"==typeof forceSoftware&&(forceSoftware=!1),"undefined"==typeof profile&&(profile="baseline"),"undefined"==typeof mode&&(mode="auto"),_super.call(this),this._skyboxProjection=new Matrix3D,this._skyboxRenderablePool=RenderablePool.getPool(SkyboxRenderable),this._pDepthRenderer=new render.DepthRenderer(new DepthMapPass),this._pDistanceRenderer=new render.DepthRenderer(new DistanceMapPass),null==this._pStage&&(this.stage=StageManager.getInstance().getFreeStage(forceSoftware,profile,mode)),this._pRttBufferManager=RTTBufferManager.getInstance(this._pStage),0==this._width?this.width=window.innerWidth:this._pRttBufferManager.viewWidth=this._width,0==this._height?this.height=window.innerHeight:this._pRttBufferManager.viewHeight=this._height}return __extends(DefaultRenderer,_super),Object.defineProperty(DefaultRenderer.prototype,"antiAlias",{get:function(){return this._antiAlias},set:function(value){this._antiAlias!=value&&(this._antiAlias=value,this._pBackBufferInvalid=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(DefaultRenderer.prototype,"depthPrepass",{get:function(){return this._depthPrepass},set:function(value){this._depthPrepass=value},enumerable:!0,configurable:!0}),Object.defineProperty(DefaultRenderer.prototype,"filters3d",{get:function(){return this._pFilter3DRenderer?this._pFilter3DRenderer.filters:null},set:function(value){value&&0==value.length&&(value=null),this._pFilter3DRenderer&&!value?(this._pFilter3DRenderer.dispose(),this._pFilter3DRenderer=null):!this._pFilter3DRenderer&&value&&(this._pFilter3DRenderer=new render.Filter3DRenderer(this._pStage),this._pFilter3DRenderer.filters=value),this._pFilter3DRenderer?(this._pFilter3DRenderer.filters=value,this._pRequireDepthRender=this._pFilter3DRenderer.requireDepthRender):(this._pRequireDepthRender=!1,this._pDepthRender&&(this._pDepthRender.dispose(),this._pDepthRender=null))},enumerable:!0,configurable:!0}),DefaultRenderer.prototype.render=function(entityCollector){return _super.prototype.render.call(this,entityCollector),this._pStage.recoverFromDisposal()?(this._pBackBufferInvalid&&this.pUpdateBackBuffer(),this._shareContext&&this._pContext&&this._pContext.clear(0,0,0,1,1,0,ContextGLClearMask.DEPTH),this._pFilter3DRenderer?(this.textureRatioX=this._pRttBufferManager.textureRatioX,this.textureRatioY=this._pRttBufferManager.textureRatioY):(this.textureRatioX=1,this.textureRatioY=1),this._pRequireDepthRender&&this.pRenderSceneDepthToTexture(entityCollector),this._depthPrepass&&this.pRenderDepthPrepass(entityCollector),this._pFilter3DRenderer&&this._pContext||(this._shareContext?this._iRender(entityCollector,null,this._pScissorRect):this._iRender(entityCollector)),_super.prototype.render.call(this,entityCollector),!this._shareContext&&this._pContext&&this._pContext.present(),this._pStage.bufferClear=!1,void 0):(this._pBackBufferInvalid=!0,void 0)},DefaultRenderer.prototype.pExecuteRender=function(entityCollector,target,scissorRect,surfaceSelector){"undefined"==typeof target&&(target=null),"undefined"==typeof scissorRect&&(scissorRect=null),"undefined"==typeof surfaceSelector&&(surfaceSelector=0),this.updateLights(entityCollector),target&&(this.pCollectRenderables(entityCollector),this.drawRenderables(this._pOpaqueRenderableHead,entityCollector),this.drawRenderables(this._pBlendedRenderableHead,entityCollector)),_super.prototype.pExecuteRender.call(this,entityCollector,target,scissorRect,surfaceSelector)},DefaultRenderer.prototype.updateLights=function(entityCollector){var len,i,light,shadowMapper,dirLights=entityCollector.directionalLights,pointLights=entityCollector.pointLights;for(len=dirLights.length,i=0;len>i;++i)light=dirLights[i],shadowMapper=light.shadowMapper,light.castsShadows&&(shadowMapper.autoUpdateShadows||shadowMapper._iShadowsInvalid)&&shadowMapper.iRenderDepthMap(this._pStage,entityCollector,this._pDepthRenderer);for(len=pointLights.length,i=0;len>i;++i)light=pointLights[i],shadowMapper=light.shadowMapper,light.castsShadows&&(shadowMapper.autoUpdateShadows||shadowMapper._iShadowsInvalid)&&shadowMapper.iRenderDepthMap(this._pStage,entityCollector,this._pDistanceRenderer)},DefaultRenderer.prototype.pDraw=function(entityCollector,target){target||this.pCollectRenderables(entityCollector),this._pContext.setBlendFactors(ContextGLBlendFactor.ONE,ContextGLBlendFactor.ZERO),entityCollector.skyBox&&(this._pContext.setDepthTest(!1,ContextGLCompareMode.ALWAYS),this.drawSkybox(entityCollector)),this._pContext.setDepthTest(!0,ContextGLCompareMode.LESS_EQUAL),this.drawRenderables(this._pOpaqueRenderableHead,entityCollector),this.drawRenderables(this._pBlendedRenderableHead,entityCollector)},DefaultRenderer.prototype.drawSkybox=function(entityCollector){var skyBox=this._skyboxRenderablePool.getItem(entityCollector.skyBox),material=entityCollector.skyBox.material,camera=entityCollector.camera;this.updateSkyboxProjection(camera);var activePass=this._pStage.context.getMaterial(material,this._pStage.profile).getMaterialPass(material._iScreenPasses[0],this._pStage.profile);material._iActivatePass(activePass,this._pStage,camera),material._iRenderPass(activePass,skyBox,this._pStage,camera,this._skyboxProjection),material._iDeactivatePass(activePass,this._pStage)},DefaultRenderer.prototype.updateSkyboxProjection=function(camera){var near=new Vector3D;this._skyboxProjection.copyFrom(this._pRttViewProjectionMatrix),this._skyboxProjection.copyRowTo(2,near);var camPos=camera.scenePosition,cx=near.x,cy=near.y,cz=near.z,cw=-(near.x*camPos.x+near.y*camPos.y+near.z*camPos.z+Math.sqrt(cx*cx+cy*cy+cz*cz)),signX=cx>=0?1:-1,signY=cy>=0?1:-1,p=new Vector3D(signX,signY,1,1),inverse=this._skyboxProjection.clone(); -inverse.invert();var q=inverse.transformVector(p);this._skyboxProjection.copyRowTo(3,p);var a=(q.x*p.x+q.y*p.y+q.z*p.z+q.w*p.w)/(cx*q.x+cy*q.y+cz*q.z+cw*q.w);this._skyboxProjection.copyRowFrom(2,new Vector3D(cx*a,cy*a,cz*a,cw*a))},DefaultRenderer.prototype.drawRenderables=function(renderable,entityCollector){for(var i,len,passes,activePass,activeMaterial,renderable2,context=this._pStage.context,camera=entityCollector.camera;renderable;){for(activeMaterial=context.getMaterial(renderable.material,this._pStage.profile),passes=renderable.material._iScreenPasses,len=renderable.material._iNumScreenPasses(),i=0;len>i;i++){renderable2=renderable,activePass=activeMaterial.getMaterialPass(passes[i],this._pStage.profile),renderable.material._iActivatePass(activePass,this._pStage,camera);do renderable.material._iRenderPass(activePass,renderable2,this._pStage,camera,this._pRttViewProjectionMatrix),renderable2=renderable2.next;while(renderable2&&renderable2.material==renderable.material);activeMaterial.material._iDeactivatePass(activePass,this._pStage)}renderable=renderable2}},DefaultRenderer.prototype.dispose=function(){this._shareContext||this._pStage.dispose(),this._pDepthRenderer.dispose(),this._pDistanceRenderer.dispose(),this._pDepthRenderer=null,this._pDistanceRenderer=null,this._pDepthRender=null,_super.prototype.dispose.call(this)},DefaultRenderer.prototype.pRenderDepthPrepass=function(entityCollector){this._pDepthRenderer.disableColor=!0,this._pFilter3DRenderer||(this._pDepthRenderer.textureRatioX=1,this._pDepthRenderer.textureRatioY=1,this._pDepthRenderer._iRender(entityCollector)),this._pDepthRenderer.disableColor=!1},DefaultRenderer.prototype.pRenderSceneDepthToTexture=function(entityCollector){(this._pDepthTextureInvalid||!this._pDepthRender)&&this.initDepthTexture(this._pStage.context),this._pDepthRenderer.textureRatioX=this._pRttBufferManager.textureRatioX,this._pDepthRenderer.textureRatioY=this._pRttBufferManager.textureRatioY,this._pDepthRenderer._iRender(entityCollector,this._pDepthRender)},DefaultRenderer.prototype.pUpdateBackBuffer=function(){this._pStage.context&&!this._shareContext&&this._width&&this._height&&(this._pStage.configureBackBuffer(this._width,this._height,this._antiAlias,!0),this._pBackBufferInvalid=!1)},DefaultRenderer.prototype.iSetStage=function(value){_super.prototype.iSetStage.call(this,value),this._pDistanceRenderer.iSetStage(value),this._pDepthRenderer.iSetStage(value)},DefaultRenderer.prototype.initDepthTexture=function(){this._pDepthTextureInvalid=!1,this._pDepthRender&&this._pDepthRender.dispose(),this._pDepthRender=new RenderTexture(this._pRttBufferManager.textureWidth,this._pRttBufferManager.textureHeight)},DefaultRenderer}(render.RendererBase);render.DefaultRenderer=DefaultRenderer}(away.render||(away.render={}));away.render}(away||(away={}));var away;!function(away){!function(render){var ContextGLBlendFactor=away.stagegl.ContextGLBlendFactor,ContextGLCompareMode=away.stagegl.ContextGLCompareMode,DepthRenderer=function(_super){function DepthRenderer(pass,renderBlended){"undefined"==typeof renderBlended&&(renderBlended=!1),_super.call(this),this._pass=pass,this._renderBlended=renderBlended,this._iBackgroundR=1,this._iBackgroundG=1,this._iBackgroundB=1}return __extends(DepthRenderer,_super),Object.defineProperty(DepthRenderer.prototype,"disableColor",{get:function(){return this._disableColor},set:function(value){this._disableColor=value},enumerable:!0,configurable:!0}),DepthRenderer.prototype._iRenderCascades=function(entityCollector,target,numCascades,scissorRects,cameras){this.pCollectRenderables(entityCollector),this._pContext.setRenderTarget(target,!0,0),this._pContext.clear(1,1,1,1,1,0),this._pContext.setBlendFactors(ContextGLBlendFactor.ONE,ContextGLBlendFactor.ZERO),this._pContext.setDepthTest(!0,ContextGLCompareMode.LESS);for(var head=this._pOpaqueRenderableHead,first=!0,i=numCascades-1;i>=0;--i)this._pStage.scissorRect=scissorRects[i],this.drawCascadeRenderables(head,cameras[i],first?null:cameras[i].frustumPlanes),first=!1;this._pContext.setDepthTest(!1,ContextGLCompareMode.LESS_EQUAL),this._pStage.scissorRect=null},DepthRenderer.prototype.drawCascadeRenderables=function(renderable,camera,cullPlanes){for(var activePass,activeMaterial,renderable2,context=this._pStage.context;renderable;){activeMaterial=context.getMaterial(renderable.material,this._pStage.profile),renderable2=renderable,activePass=activeMaterial.getMaterialPass(this._pass,this._pStage.profile),""==activePass.key&&this._pContext.calcAnimationCode(renderable.material,activePass),renderable.material._iActivatePass(activePass,this._pStage,camera);do!cullPlanes||renderable2.sourceEntity.worldBounds.isInFrustum(cullPlanes,4)?renderable2.material._iRenderPass(activePass,renderable2,this._pStage,camera,this._pRttViewProjectionMatrix):renderable2.cascaded=!0,renderable2=renderable2.next;while(renderable2&&renderable2.material==renderable.material&&!renderable2.cascaded);renderable.material._iDeactivatePass(activePass,this._pStage),renderable=renderable2}},DepthRenderer.prototype.pDraw=function(entityCollector){this.pCollectRenderables(entityCollector),this._pContext.setBlendFactors(ContextGLBlendFactor.ONE,ContextGLBlendFactor.ZERO),this._pContext.setDepthTest(!0,ContextGLCompareMode.LESS),this.drawRenderables(this._pOpaqueRenderableHead,entityCollector),this._disableColor&&this._pContext.setColorMask(!1,!1,!1,!1),this._renderBlended&&this.drawRenderables(this._pBlendedRenderableHead,entityCollector),this._disableColor&&this._pContext.setColorMask(!0,!0,!0,!0)},DepthRenderer.prototype.drawRenderables=function(renderable,entityCollector){for(var activePass,activeMaterial,renderable2,context=this._pStage.context,camera=entityCollector.camera;renderable;){if(activeMaterial=context.getMaterial(renderable.material,this._pStage.profile),this._disableColor&&0!=renderable.material.alphaThreshold){renderable2=renderable;do renderable2=renderable2.next;while(renderable2&&renderable2.material==renderable.material)}else{renderable2=renderable,activePass=activeMaterial.getMaterialPass(this._pass,this._pStage.profile),""==activePass.key&&this._pContext.calcAnimationCode(renderable.material,activePass),renderable.material._iActivatePass(activePass,this._pStage,camera);do renderable2.material._iRenderPass(activePass,renderable2,this._pStage,camera,this._pRttViewProjectionMatrix),renderable2=renderable2.next;while(renderable2&&renderable2.material==renderable.material);renderable.material._iDeactivatePass(activePass,this._pStage)}renderable=renderable2}},DepthRenderer}(render.RendererBase);render.DepthRenderer=DepthRenderer}(away.render||(away.render={}));away.render}(away||(away={}));var away;!function(away){!function(render){var Filter3DRenderer=function(){function Filter3DRenderer(stage){this._filterSizesInvalid=!0,this._onRTTResizeDelegate=away.utils.Delegate.create(this,this.onRTTResize),this._stage=stage,this._rttManager=away.managers.RTTBufferManager.getInstance(stage),this._rttManager.addEventListener(away.events.Event.RESIZE,this._onRTTResizeDelegate)}return Filter3DRenderer.prototype.onRTTResize=function(){this._filterSizesInvalid=!0},Object.defineProperty(Filter3DRenderer.prototype,"requireDepthRender",{get:function(){return this._requireDepthRender},enumerable:!0,configurable:!0}),Filter3DRenderer.prototype.getMainInputTexture=function(stage){return this._filterTasksInvalid&&this.updateFilterTasks(stage),this._mainInputTexture},Object.defineProperty(Filter3DRenderer.prototype,"filters",{get:function(){return this._filters},set:function(value){if(this._filters=value,this._filterTasksInvalid=!0,this._requireDepthRender=!1,this._filters){for(var i=0;i=i;++i)filter=this._filters[i],filter.setRenderTargets(i==len?null:this._filters[i+1].getMainInputTexture(stage),stage),this._tasks=this._tasks.concat(filter.tasks);this._mainInputTexture=this._filters[0].getMainInputTexture(stage)},Filter3DRenderer.prototype.render=function(stage,camera,depthTexture){var len,i,task,context=stage.context,indexBuffer=this._rttManager.indexBuffer,vertexBuffer=this._rttManager.renderToTextureVertexBuffer;if(this._filters){for(this._filterSizesInvalid&&this.updateFilterSizes(),this._filterTasksInvalid&&this.updateFilterTasks(stage),len=this._filters.length,i=0;len>i;++i)this._filters[i].update(stage,camera);for(len=this._tasks.length,len>1&&(context.setVertexBufferAt(0,vertexBuffer,0,away.stagegl.ContextGLVertexBufferFormat.FLOAT_2),context.setVertexBufferAt(1,vertexBuffer,2,away.stagegl.ContextGLVertexBufferFormat.FLOAT_2)),i=0;len>i;++i)task=this._tasks[i],task.target||(stage.scissorRect=null,vertexBuffer=this._rttManager.renderToScreenVertexBuffer,context.setVertexBufferAt(0,vertexBuffer,0,away.stagegl.ContextGLVertexBufferFormat.FLOAT_2),context.setVertexBufferAt(1,vertexBuffer,2,away.stagegl.ContextGLVertexBufferFormat.FLOAT_2)),context.setTextureAt(0,task.getMainInputTexture(stage)),context.setProgram(task.getProgram(stage)),context.clear(0,0,0,0),task.activate(stage,camera,depthTexture),context.setBlendFactors(away.stagegl.ContextGLBlendFactor.ONE,away.stagegl.ContextGLBlendFactor.ZERO),context.drawTriangles(indexBuffer,0,2),task.deactivate(stage);context.setTextureAt(0,null),context.setVertexBufferAt(0,null),context.setVertexBufferAt(1,null)}},Filter3DRenderer.prototype.updateFilterSizes=function(){for(var i=0;ii;i++)code+="mov "+this.targetRegisters[i]+","+this.sourceRegisters[i]+"\n";return code+="mov "+this.positionTarget+".xyz,"+this.vertexZeroConst.toString()+"\n",this.needVelocity&&(code+="mov "+this.velocityTarget+".xyz,"+this.vertexZeroConst.toString()+"\n"),code},AnimationRegisterCache.prototype.getCombinationCode=function(){return"add "+this.scaleAndRotateTarget+".xyz,"+this.scaleAndRotateTarget+".xyz,"+this.positionTarget+".xyz\n"},AnimationRegisterCache.prototype.initColorRegisters=function(){var code="";return this.hasColorMulNode&&(this.colorMulTarget=this.getFreeVertexVectorTemp(),this.addVertexTempUsages(this.colorMulTarget,1),this.colorMulVary=this.getFreeVarying(),code+="mov "+this.colorMulTarget+","+this.vertexOneConst+"\n"),this.hasColorAddNode&&(this.colorAddTarget=this.getFreeVertexVectorTemp(),this.addVertexTempUsages(this.colorAddTarget,1),this.colorAddVary=this.getFreeVarying(),code+="mov "+this.colorAddTarget+","+this.vertexZeroConst+"\n"),code},AnimationRegisterCache.prototype.getColorPassCode=function(){var code="";return this.needFragmentAnimation&&(this.hasColorAddNode||this.hasColorMulNode)&&(this.hasColorMulNode&&(code+="mov "+this.colorMulVary+","+this.colorMulTarget+"\n"),this.hasColorAddNode&&(code+="mov "+this.colorAddVary+","+this.colorAddTarget+"\n")),code},AnimationRegisterCache.prototype.getColorCombinationCode=function(shadedTarget){var code="";if(this.needFragmentAnimation&&(this.hasColorAddNode||this.hasColorMulNode)){var colorTarget=this.getRegisterFromString(shadedTarget);this.addFragmentTempUsages(colorTarget,1),this.hasColorMulNode&&(code+="mul "+colorTarget+","+colorTarget+","+this.colorMulVary+"\n"),this.hasColorAddNode&&(code+="add "+colorTarget+","+colorTarget+","+this.colorAddVary+"\n")}return code},AnimationRegisterCache.prototype.getRegisterFromString=function(code){var temp=code.split(/(\d+)/);return new ShaderRegisterElement(temp[0],parseInt(temp[1]))},Object.defineProperty(AnimationRegisterCache.prototype,"numVertexConstant",{get:function(){return this._numVertexConstant},enumerable:!0,configurable:!0}),Object.defineProperty(AnimationRegisterCache.prototype,"numFragmentConstant",{get:function(){return this._numFragmentConstant},enumerable:!0,configurable:!0}),AnimationRegisterCache.prototype.setDataLength=function(){this._numVertexConstant=this.numUsedVertexConstants-this.vertexConstantOffset,this._numFragmentConstant=this.numUsedFragmentConstants-this.fragmentConstantOffset,this.vertexConstantData.length=4*this._numVertexConstant,this.fragmentConstantData.length=4*this._numFragmentConstant},AnimationRegisterCache.prototype.setVertexConst=function(index,x,y,z,w){"undefined"==typeof x&&(x=0),"undefined"==typeof y&&(y=0),"undefined"==typeof z&&(z=0),"undefined"==typeof w&&(w=0);var _index=4*(index-this.vertexConstantOffset);this.vertexConstantData[_index++]=x,this.vertexConstantData[_index++]=y,this.vertexConstantData[_index++]=z,this.vertexConstantData[_index]=w},AnimationRegisterCache.prototype.setVertexConstFromArray=function(index,data){for(var _index=4*(index-this.vertexConstantOffset),i=0;i0){len=this._pOwners.length;for(var i=0;len>i;++i)this._pOwners[i].translateLocal(delta,dist)}},AnimatorBase.prototype.dispatchCycleEvent=function(){this.hasEventListener(AnimatorEvent.CYCLE_COMPLETE)&&(null==this._cycleEvent&&(this._cycleEvent=new AnimatorEvent(AnimatorEvent.CYCLE_COMPLETE,this)),this.dispatchEvent(this._cycleEvent))},AnimatorBase.prototype.clone=function(){throw new AbstractMethodError},AnimatorBase.prototype.dispose=function(){},AnimatorBase.prototype.testGPUCompatibility=function(){throw new AbstractMethodError},Object.defineProperty(AnimatorBase.prototype,"assetType",{get:function(){return AssetType.ANIMATOR},enumerable:!0,configurable:!0}),AnimatorBase.prototype.getRenderableSubGeometry=function(renderable,sourceSubGeometry){return sourceSubGeometry},AnimatorBase}(away.library.NamedAssetBase);animators.AnimatorBase=AnimatorBase}(away.animators||(away.animators={}));away.animators}(away||(away={}));var away;!function(away){!function(filters){var Filter3DTaskBase=function(){function Filter3DTaskBase(requireDepthRender){"undefined"==typeof requireDepthRender&&(requireDepthRender=!1),this._scaledTextureWidth=-1,this._scaledTextureHeight=-1,this._textureWidth=-1,this._textureHeight=-1,this._textureDimensionsInvalid=!0,this._program3DInvalid=!0,this._textureScale=0,this._requireDepthRender=requireDepthRender}return Object.defineProperty(Filter3DTaskBase.prototype,"textureScale",{get:function(){return this._textureScale},set:function(value){this._textureScale!=value&&(this._textureScale=value,this._scaledTextureWidth=this._textureWidth>>this._textureScale,this._scaledTextureHeight=this._textureHeight>>this._textureScale,this._textureDimensionsInvalid=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(Filter3DTaskBase.prototype,"target",{get:function(){return this._target},set:function(value){this._target=value},enumerable:!0,configurable:!0}),Object.defineProperty(Filter3DTaskBase.prototype,"textureWidth",{get:function(){return this._textureWidth},set:function(value){this._textureWidth!=value&&(this._textureWidth=value,this._scaledTextureWidth=this._textureWidth>>this._textureScale,this._textureDimensionsInvalid=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(Filter3DTaskBase.prototype,"textureHeight",{get:function(){return this._textureHeight},set:function(value){this._textureHeight!=value&&(this._textureHeight=value,this._scaledTextureHeight=this._textureHeight>>this._textureScale,this._textureDimensionsInvalid=!0)},enumerable:!0,configurable:!0}),Filter3DTaskBase.prototype.getMainInputTexture=function(stage){return this._textureDimensionsInvalid&&this.pUpdateTextures(stage),this._mainInputTexture},Filter3DTaskBase.prototype.dispose=function(){this._mainInputTexture&&this._mainInputTexture.dispose(),this._program3D&&this._program3D.dispose()},Filter3DTaskBase.prototype.pInvalidateProgram=function(){this._program3DInvalid=!0},Filter3DTaskBase.prototype.pUpdateProgram=function(stage){this._program3D&&this._program3D.dispose(),this._program3D=stage.context.createProgram();var vertexByteCode=(new aglsl.assembler.AGALMiniAssembler).assemble("part vertex 1\n"+this.pGetVertexCode()+"endpart").vertex.data,fragmentByteCode=(new aglsl.assembler.AGALMiniAssembler).assemble("part fragment 1\n"+this.pGetFragmentCode()+"endpart").fragment.data;this._program3D.upload(vertexByteCode,fragmentByteCode),this._program3DInvalid=!1},Filter3DTaskBase.prototype.pGetVertexCode=function(){return"mov op, va0\nmov v0, va1\n"},Filter3DTaskBase.prototype.pGetFragmentCode=function(){throw new away.errors.AbstractMethodError},Filter3DTaskBase.prototype.pUpdateTextures=function(stage){this._mainInputTexture&&this._mainInputTexture.dispose(),this._mainInputTexture=stage.context.createTexture(this._scaledTextureWidth,this._scaledTextureHeight,away.stagegl.ContextGLTextureFormat.BGRA,!0),this._textureDimensionsInvalid=!1},Filter3DTaskBase.prototype.getProgram=function(stage){return this._program3DInvalid&&this.pUpdateProgram(stage),this._program3D},Filter3DTaskBase.prototype.activate=function(){},Filter3DTaskBase.prototype.deactivate=function(){},Object.defineProperty(Filter3DTaskBase.prototype,"requireDepthRender",{get:function(){return this._requireDepthRender},enumerable:!0,configurable:!0}),Filter3DTaskBase}();filters.Filter3DTaskBase=Filter3DTaskBase}(away.filters||(away.filters={}));away.filters}(away||(away={}));var away;!function(away){!function(filters){var Filter3DBase=function(){function Filter3DBase(){this._tasks=new Array}return Object.defineProperty(Filter3DBase.prototype,"requireDepthRender",{get:function(){return this._requireDepthRender},enumerable:!0,configurable:!0}),Filter3DBase.prototype.pAddTask=function(filter){this._tasks.push(filter),null==this._requireDepthRender&&(this._requireDepthRender=filter.requireDepthRender)},Object.defineProperty(Filter3DBase.prototype,"tasks",{get:function(){return this._tasks},enumerable:!0,configurable:!0}),Filter3DBase.prototype.getMainInputTexture=function(stage){return this._tasks[0].getMainInputTexture(stage)},Object.defineProperty(Filter3DBase.prototype,"textureWidth",{get:function(){return this._textureWidth},set:function(value){this._textureWidth=value;for(var i=0;i - is released under the MIT License -*/ - -var swfobject = function() { - - var UNDEF = "undefined", - OBJECT = "object", - SHOCKWAVE_FLASH = "Shockwave Flash", - SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash", - FLASH_MIME_TYPE = "application/x-shockwave-flash", - EXPRESS_INSTALL_ID = "SWFObjectExprInst", - ON_READY_STATE_CHANGE = "onreadystatechange", - - win = window, - doc = document, - nav = navigator, - - plugin = false, - domLoadFnArr = [main], - regObjArr = [], - objIdArr = [], - listenersArr = [], - storedAltContent, - storedAltContentId, - storedCallbackFn, - storedCallbackObj, - isDomLoaded = false, - isExpressInstallActive = false, - dynamicStylesheet, - dynamicStylesheetMedia, - autoHideShow = true, - - /* Centralized function for browser feature detection - - User agent string detection is only used when no good alternative is possible - - Is executed directly for optimal performance - */ - ua = function() { - var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF, - u = nav.userAgent.toLowerCase(), - p = nav.platform.toLowerCase(), - windows = p ? /win/.test(p) : /win/.test(u), - mac = p ? /mac/.test(p) : /mac/.test(u), - webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit - ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html - playerVersion = [0,0,0], - d = null; - if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) { - d = nav.plugins[SHOCKWAVE_FLASH].description; - if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+ - plugin = true; - ie = false; // cascaded feature detection for Internet Explorer - d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1"); - playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10); - playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10); - playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0; - } - } - else if (typeof win.ActiveXObject != UNDEF) { - try { - var a = new ActiveXObject(SHOCKWAVE_FLASH_AX); - if (a) { // a will return null when ActiveX is disabled - d = a.GetVariable("$version"); - if (d) { - ie = true; // cascaded feature detection for Internet Explorer - d = d.split(" ")[1].split(","); - playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; - } - } - } - catch(e) {} - } - return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac }; - }(), - - /* Cross-browser onDomLoad - - Will fire an event as soon as the DOM of a web page is loaded - - Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/ - - Regular onload serves as fallback - */ - onDomLoad = function() { - if (!ua.w3) { return; } - if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically - callDomLoadFunctions(); - } - if (!isDomLoaded) { - if (typeof doc.addEventListener != UNDEF) { - doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false); - } - if (ua.ie && ua.win) { - doc.attachEvent(ON_READY_STATE_CHANGE, function() { - if (doc.readyState == "complete") { - doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee); - callDomLoadFunctions(); - } - }); - if (win == top) { // if not inside an iframe - (function(){ - if (isDomLoaded) { return; } - try { - doc.documentElement.doScroll("left"); - } - catch(e) { - setTimeout(arguments.callee, 0); - return; - } - callDomLoadFunctions(); - })(); - } - } - if (ua.wk) { - (function(){ - if (isDomLoaded) { return; } - if (!/loaded|complete/.test(doc.readyState)) { - setTimeout(arguments.callee, 0); - return; - } - callDomLoadFunctions(); - })(); - } - addLoadEvent(callDomLoadFunctions); - } - }(); - - function callDomLoadFunctions() { - if (isDomLoaded) { return; } - try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early - var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span")); - t.parentNode.removeChild(t); - } - catch (e) { return; } - isDomLoaded = true; - var dl = domLoadFnArr.length; - for (var i = 0; i < dl; i++) { - domLoadFnArr[i](); - } - } - - function addDomLoadEvent(fn) { - if (isDomLoaded) { - fn(); - } - else { - domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+ - } - } - - /* Cross-browser onload - - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/ - - Will fire an event as soon as a web page including all of its assets are loaded - */ - function addLoadEvent(fn) { - if (typeof win.addEventListener != UNDEF) { - win.addEventListener("load", fn, false); - } - else if (typeof doc.addEventListener != UNDEF) { - doc.addEventListener("load", fn, false); - } - else if (typeof win.attachEvent != UNDEF) { - addListener(win, "onload", fn); - } - else if (typeof win.onload == "function") { - var fnOld = win.onload; - win.onload = function() { - fnOld(); - fn(); - }; - } - else { - win.onload = fn; - } - } - - /* Main function - - Will preferably execute onDomLoad, otherwise onload (as a fallback) - */ - function main() { - if (plugin) { - testPlayerVersion(); - } - else { - matchVersions(); - } - } - - /* Detect the Flash Player version for non-Internet Explorer browsers - - Detecting the plug-in version via the object element is more precise than using the plugins collection item's description: - a. Both release and build numbers can be detected - b. Avoid wrong descriptions by corrupt installers provided by Adobe - c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports - - Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available - */ - function testPlayerVersion() { - var b = doc.getElementsByTagName("body")[0]; - var o = createElement(OBJECT); - o.setAttribute("type", FLASH_MIME_TYPE); - var t = b.appendChild(o); - if (t) { - var counter = 0; - (function(){ - if (typeof t.GetVariable != UNDEF) { - var d = t.GetVariable("$version"); - if (d) { - d = d.split(" ")[1].split(","); - ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; - } - } - else if (counter < 10) { - counter++; - setTimeout(arguments.callee, 10); - return; - } - b.removeChild(o); - t = null; - matchVersions(); - })(); - } - else { - matchVersions(); - } - } - - /* Perform Flash Player and SWF version matching; static publishing only - */ - function matchVersions() { - var rl = regObjArr.length; - if (rl > 0) { - for (var i = 0; i < rl; i++) { // for each registered object element - var id = regObjArr[i].id; - var cb = regObjArr[i].callbackFn; - var cbObj = {success:false, id:id}; - if (ua.pv[0] > 0) { - var obj = getElementById(id); - if (obj) { - if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match! - setVisibility(id, true); - if (cb) { - cbObj.success = true; - cbObj.ref = getObjectById(id); - cb(cbObj); - } - } - else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported - var att = {}; - att.data = regObjArr[i].expressInstall; - att.width = obj.getAttribute("width") || "0"; - att.height = obj.getAttribute("height") || "0"; - if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); } - if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); } - // parse HTML object param element's name-value pairs - var par = {}; - var p = obj.getElementsByTagName("param"); - var pl = p.length; - for (var j = 0; j < pl; j++) { - if (p[j].getAttribute("name").toLowerCase() != "movie") { - par[p[j].getAttribute("name")] = p[j].getAttribute("value"); - } - } - showExpressInstall(att, par, id, cb); - } - else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF - displayAltContent(obj); - if (cb) { cb(cbObj); } - } - } - } - else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content) - setVisibility(id, true); - if (cb) { - var o = getObjectById(id); // test whether there is an HTML object element or not - if (o && typeof o.SetVariable != UNDEF) { - cbObj.success = true; - cbObj.ref = o; - } - cb(cbObj); - } - } - } - } - } - - function getObjectById(objectIdStr) { - var r = null; - var o = getElementById(objectIdStr); - if (o && o.nodeName == "OBJECT") { - if (typeof o.SetVariable != UNDEF) { - r = o; - } - else { - var n = o.getElementsByTagName(OBJECT)[0]; - if (n) { - r = n; - } - } - } - return r; - } - - /* Requirements for Adobe Express Install - - only one instance can be active at a time - - fp 6.0.65 or higher - - Win/Mac OS only - - no Webkit engines older than version 312 - */ - function canExpressInstall() { - return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312); - } - - /* Show the Adobe Express Install dialog - - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75 - */ - function showExpressInstall(att, par, replaceElemIdStr, callbackFn) { - isExpressInstallActive = true; - storedCallbackFn = callbackFn || null; - storedCallbackObj = {success:false, id:replaceElemIdStr}; - var obj = getElementById(replaceElemIdStr); - if (obj) { - if (obj.nodeName == "OBJECT") { // static publishing - storedAltContent = abstractAltContent(obj); - storedAltContentId = null; - } - else { // dynamic publishing - storedAltContent = obj; - storedAltContentId = replaceElemIdStr; - } - att.id = EXPRESS_INSTALL_ID; - if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; } - if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; } - doc.title = doc.title.slice(0, 47) + " - Flash Player Installation"; - var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn", - fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title; - if (typeof par.flashvars != UNDEF) { - par.flashvars += "&" + fv; - } - else { - par.flashvars = fv; - } - // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, - // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work - if (ua.ie && ua.win && obj.readyState != 4) { - var newObj = createElement("div"); - replaceElemIdStr += "SWFObjectNew"; - newObj.setAttribute("id", replaceElemIdStr); - obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf - obj.style.display = "none"; - (function(){ - if (obj.readyState == 4) { - obj.parentNode.removeChild(obj); - } - else { - setTimeout(arguments.callee, 10); - } - })(); - } - createSWF(att, par, replaceElemIdStr); - } - } - - /* Functions to abstract and display alternative content - */ - function displayAltContent(obj) { - if (ua.ie && ua.win && obj.readyState != 4) { - // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, - // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work - var el = createElement("div"); - obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content - el.parentNode.replaceChild(abstractAltContent(obj), el); - obj.style.display = "none"; - (function(){ - if (obj.readyState == 4) { - obj.parentNode.removeChild(obj); - } - else { - setTimeout(arguments.callee, 10); - } - })(); - } - else { - obj.parentNode.replaceChild(abstractAltContent(obj), obj); - } - } - - function abstractAltContent(obj) { - var ac = createElement("div"); - if (ua.win && ua.ie) { - ac.innerHTML = obj.innerHTML; - } - else { - var nestedObj = obj.getElementsByTagName(OBJECT)[0]; - if (nestedObj) { - var c = nestedObj.childNodes; - if (c) { - var cl = c.length; - for (var i = 0; i < cl; i++) { - if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) { - ac.appendChild(c[i].cloneNode(true)); - } - } - } - } - } - return ac; - } - - /* Cross-browser dynamic SWF creation - */ - function createSWF(attObj, parObj, id) { - var r, el = getElementById(id); - if (ua.wk && ua.wk < 312) { return r; } - if (el) { - if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content - attObj.id = id; - } - if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML - var att = ""; - for (var i in attObj) { - if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries - if (i.toLowerCase() == "data") { - parObj.movie = attObj[i]; - } - else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword - att += ' class="' + attObj[i] + '"'; - } - else if (i.toLowerCase() != "classid") { - att += ' ' + i + '="' + attObj[i] + '"'; - } - } - } - var par = ""; - for (var j in parObj) { - if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries - par += ''; - } - } - el.outerHTML = '' + par + ''; - objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only) - r = getElementById(attObj.id); - } - else { // well-behaving browsers - var o = createElement(OBJECT); - o.setAttribute("type", FLASH_MIME_TYPE); - for (var m in attObj) { - if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries - if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword - o.setAttribute("class", attObj[m]); - } - else if (m.toLowerCase() != "classid") { // filter out IE specific attribute - o.setAttribute(m, attObj[m]); - } - } - } - for (var n in parObj) { - if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element - createObjParam(o, n, parObj[n]); - } - } - el.parentNode.replaceChild(o, el); - r = o; - } - } - return r; - } - - function createObjParam(el, pName, pValue) { - var p = createElement("param"); - p.setAttribute("name", pName); - p.setAttribute("value", pValue); - el.appendChild(p); - } - - /* Cross-browser SWF removal - - Especially needed to safely and completely remove a SWF in Internet Explorer - */ - function removeSWF(id) { - var obj = getElementById(id); - if (obj && obj.nodeName == "OBJECT") { - if (ua.ie && ua.win) { - obj.style.display = "none"; - (function(){ - if (obj.readyState == 4) { - removeObjectInIE(id); - } - else { - setTimeout(arguments.callee, 10); - } - })(); - } - else { - obj.parentNode.removeChild(obj); - } - } - } - - function removeObjectInIE(id) { - var obj = getElementById(id); - if (obj) { - for (var i in obj) { - if (typeof obj[i] == "function") { - obj[i] = null; - } - } - obj.parentNode.removeChild(obj); - } - } - - /* Functions to optimize JavaScript compression - */ - function getElementById(id) { - var el = null; - try { - el = doc.getElementById(id); - } - catch (e) {} - return el; - } - - function createElement(el) { - return doc.createElement(el); - } - - /* Updated attachEvent function for Internet Explorer - - Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks - */ - function addListener(target, eventType, fn) { - target.attachEvent(eventType, fn); - listenersArr[listenersArr.length] = [target, eventType, fn]; - } - - /* Flash Player and SWF content version matching - */ - function hasPlayerVersion(rv) { - var pv = ua.pv, v = rv.split("."); - v[0] = parseInt(v[0], 10); - v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0" - v[2] = parseInt(v[2], 10) || 0; - return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false; - } - - /* Cross-browser dynamic CSS creation - - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php - */ - function createCSS(sel, decl, media, newStyle) { - if (ua.ie && ua.mac) { return; } - var h = doc.getElementsByTagName("head")[0]; - if (!h) { return; } // to also support badly authored HTML pages that lack a head element - var m = (media && typeof media == "string") ? media : "screen"; - if (newStyle) { - dynamicStylesheet = null; - dynamicStylesheetMedia = null; - } - if (!dynamicStylesheet || dynamicStylesheetMedia != m) { - // create dynamic stylesheet + get a global reference to it - var s = createElement("style"); - s.setAttribute("type", "text/css"); - s.setAttribute("media", m); - dynamicStylesheet = h.appendChild(s); - if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) { - dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1]; - } - dynamicStylesheetMedia = m; - } - // add style rule - if (ua.ie && ua.win) { - if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) { - dynamicStylesheet.addRule(sel, decl); - } - } - else { - if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) { - dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}")); - } - } - } - - function setVisibility(id, isVisible) { - if (!autoHideShow) { return; } - var v = isVisible ? "visible" : "hidden"; - if (isDomLoaded && getElementById(id)) { - getElementById(id).style.visibility = v; - } - else { - createCSS("#" + id, "visibility:" + v); - } - } - - /* Filter to avoid XSS attacks - */ - function urlEncodeIfNecessary(s) { - var regex = /[\\\"<>\.;]/; - var hasBadChars = regex.exec(s) != null; - return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s; - } - - /* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only) - */ - var cleanup = function() { - if (ua.ie && ua.win) { - window.attachEvent("onunload", function() { - // remove listeners to avoid memory leaks - var ll = listenersArr.length; - for (var i = 0; i < ll; i++) { - listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]); - } - // cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect - var il = objIdArr.length; - for (var j = 0; j < il; j++) { - removeSWF(objIdArr[j]); - } - // cleanup library's main closures to avoid memory leaks - for (var k in ua) { - ua[k] = null; - } - ua = null; - for (var l in swfobject) { - swfobject[l] = null; - } - swfobject = null; - }); - } - }(); - - return { - /* Public API - - Reference: http://code.google.com/p/swfobject/wiki/documentation - */ - registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) { - if (ua.w3 && objectIdStr && swfVersionStr) { - var regObj = {}; - regObj.id = objectIdStr; - regObj.swfVersion = swfVersionStr; - regObj.expressInstall = xiSwfUrlStr; - regObj.callbackFn = callbackFn; - regObjArr[regObjArr.length] = regObj; - setVisibility(objectIdStr, false); - } - else if (callbackFn) { - callbackFn({success:false, id:objectIdStr}); - } - }, - - getObjectById: function(objectIdStr) { - if (ua.w3) { - return getObjectById(objectIdStr); - } - }, - - embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) { - var callbackObj = {success:false, id:replaceElemIdStr}; - if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) { - setVisibility(replaceElemIdStr, false); - addDomLoadEvent(function() { - widthStr += ""; // auto-convert to string - heightStr += ""; - var att = {}; - if (attObj && typeof attObj === OBJECT) { - for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs - att[i] = attObj[i]; - } - } - att.data = swfUrlStr; - att.width = widthStr; - att.height = heightStr; - var par = {}; - if (parObj && typeof parObj === OBJECT) { - for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs - par[j] = parObj[j]; - } - } - if (flashvarsObj && typeof flashvarsObj === OBJECT) { - for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs - if (typeof par.flashvars != UNDEF) { - par.flashvars += "&" + k + "=" + flashvarsObj[k]; - } - else { - par.flashvars = k + "=" + flashvarsObj[k]; - } - } - } - if (hasPlayerVersion(swfVersionStr)) { // create SWF - var obj = createSWF(att, par, replaceElemIdStr); - if (att.id == replaceElemIdStr) { - setVisibility(replaceElemIdStr, true); - } - callbackObj.success = true; - callbackObj.ref = obj; - } - else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install - att.data = xiSwfUrlStr; - showExpressInstall(att, par, replaceElemIdStr, callbackFn); - return; - } - else { // show alternative content - setVisibility(replaceElemIdStr, true); - } - if (callbackFn) { callbackFn(callbackObj); } - }); - } - else if (callbackFn) { callbackFn(callbackObj); } - }, - - switchOffAutoHideShow: function() { - autoHideShow = false; - }, - - ua: ua, - - getFlashPlayerVersion: function() { - return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] }; - }, - - hasFlashPlayerVersion: hasPlayerVersion, - - createSWF: function(attObj, parObj, replaceElemIdStr) { - if (ua.w3) { - return createSWF(attObj, parObj, replaceElemIdStr); - } - else { - return undefined; - } - }, - - showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) { - if (ua.w3 && canExpressInstall()) { - showExpressInstall(att, par, replaceElemIdStr, callbackFn); - } - }, - - removeSWF: function(objElemIdStr) { - if (ua.w3) { - removeSWF(objElemIdStr); - } - }, - - createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) { - if (ua.w3) { - createCSS(selStr, declStr, mediaStr, newStyleBoolean); - } - }, - - addDomLoadEvent: addDomLoadEvent, - - addLoadEvent: addLoadEvent, - - getQueryParamValue: function(param) { - var q = doc.location.search || doc.location.hash; - if (q) { - if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark - if (param == null) { - return urlEncodeIfNecessary(q); - } - var pairs = q.split("&"); - for (var i = 0; i < pairs.length; i++) { - if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) { - return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1))); - } - } - } - return ""; - }, - - // For internal usage only - expressInstallCallback: function() { - if (isExpressInstallActive) { - var obj = getElementById(EXPRESS_INSTALL_ID); - if (obj && storedAltContent) { - obj.parentNode.replaceChild(storedAltContent, obj); - if (storedAltContentId) { - setVisibility(storedAltContentId, true); - if (ua.ie && ua.win) { storedAltContent.style.display = "block"; } - } - if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); } - } - isExpressInstallActive = false; - } - } - }; -}(); diff --git a/package.json b/package.json index b1f22c3d6..782c980e5 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,25 @@ { - "name": "", + "name": "awayjs-renderergl", "version": "0.1.0", - "description": "Away3D.ts build scripts", + "description": "GL Renderer for AwayJS", "url": "http://www.away3d.com", + "dependencies": { + "awayjs-core": "^0.1.0", + "awayjs-stagegl": "^0.1.0" + }, "devDependencies": { - "grunt" : "0.4.1", - "grunt-contrib-yuidoc": "*", - "uglify-js": "~2.3.5", - "grunt-lib-contrib": "~0.6.0", - "grunt-contrib-uglify":"*", - "grunt-contrib-concat":"*", - "grunt-shell":"*", - "grunt-ts" : "latest" + "browserify": "^5.12.0", + "exorcist": "^0.1.6", + "glob": "^4.0.6", + "gulp": "^3.8.8", + "gulp-changed": "^1.0.0", + "gulp-concat": "^2.4.1", + "gulp-sourcemaps": "^1.2.2", + "gulp-typescript": "^2.0.0", + "path": "^0.4.9", + "uglify-js": "~2.3.5", + "vinyl-map": "^1.0.1", + "vinyl-source-stream": "^1.0.0", + "watchify": "^1.0.6" } } \ No newline at end of file diff --git a/src/StageGLExtensions.ts b/src/StageGLExtensions.ts deleted file mode 100644 index 8b7d53400..000000000 --- a/src/StageGLExtensions.ts +++ /dev/null @@ -1,15 +0,0 @@ -/// - -away.Debug.THROW_ERRORS = false; -away.Debug.LOG_PI_ERRORS = false; - -module away -{ - export class StageGLRenderer extends away.events.EventDispatcher - { - constructor() - { - super(); - } - } -} diff --git a/src/away/_definitions.ts b/src/away/_definitions.ts deleted file mode 100644 index ce9da3a16..000000000 --- a/src/away/_definitions.ts +++ /dev/null @@ -1,157 +0,0 @@ -/********************************************************************************************************************************************************************************************************** - * This file contains a reference to all the classes used in the project. - ******************************************************************************************************************************************************************************************************** - * - * The TypeScript compiler exports classes in a non deterministic manner, as the extend functionality copies the prototype chain - * of one object onto another during initialisation and load (to create extensible functionality), the non deterministic nature of the - * compiler can result in an extend operation referencing a class that is undefined and not yet loaded - which throw an JavaScript error. - * - * This file provides the compiler with a strict order in which to export the TypeScript classes to mitigate undefined extend errors - * - * @see https://typescript.codeplex.com/workitem/1356 @see https://typescript.codeplex.com/workitem/913 - * - *********************************************************************************************************************************************************************************************************/ - -/// -/// -/// - -/// - -/// - -/// -/// -/// - -// - -/// - -/// -/// -/// -/// -/// -// -/// - -/// -/// -/// -/// -/// -/// -/// -/// - -/// -/// - -/// -/// -/// -/// -/// - -/// -/// -/// -/// -/// - -/// - -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// - -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// - -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// - -/// -/// -/// -/// - -/// -/// -/// -/// -/// -/// - -/// -/// -/// -/// -/// -/// -/// - -/// -/// -/// diff --git a/src/away/animators/ParticleAnimationSet.ts b/src/away/animators/ParticleAnimationSet.ts deleted file mode 100644 index 5df66af79..000000000 --- a/src/away/animators/ParticleAnimationSet.ts +++ /dev/null @@ -1,406 +0,0 @@ -/// - -module away.animators -{ - import SubGeometryBase = away.base.SubGeometryBase; - import ParticleGeometry = away.base.ParticleGeometry; - import ISubMesh = away.base.ISubMesh; - import IContextStageGL = away.stagegl.IContextStageGL; - import Mesh = away.entities.Mesh; - import Stage = away.base.Stage; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * The animation data set used by particle-based animators, containing particle animation data. - * - * @see away.animators.ParticleAnimator - */ - export class ParticleAnimationSet extends AnimationSetBase implements IAnimationSet - { - /** @private */ - public _iAnimationRegisterCache:AnimationRegisterCache; - - //all other nodes dependent on it - private _timeNode:ParticleTimeNode; - - /** - * Property used by particle nodes that require compilation at the end of the shader - */ - public static POST_PRIORITY:number /*int*/ = 9; - - /** - * Property used by particle nodes that require color compilation - */ - public static COLOR_PRIORITY:number /*int*/ = 18; - - private _animationSubGeometries:Object = new Object(); - private _particleNodes:Array = new Array(); - private _localDynamicNodes:Array = new Array(); - private _localStaticNodes:Array = new Array(); - private _totalLenOfOneVertex:number /*int*/ = 0; - - //set true if has an node which will change UV - public hasUVNode:boolean; - //set if the other nodes need to access the velocity - public needVelocity:boolean; - //set if has a billboard node. - public hasBillboard:boolean; - //set if has an node which will apply color multiple operation - public hasColorMulNode:boolean; - //set if has an node which will apply color add operation - public hasColorAddNode:boolean; - - /** - * Initialiser function for static particle properties. Needs to reference a with the following format - * - * - * initParticleFunc(prop:ParticleProperties) - * { - * //code for settings local properties - * } - * - * - * Aside from setting any properties required in particle animation nodes using local static properties, the initParticleFunc function - * is required to time node requirements as they may be needed. These properties on the ParticleProperties object can include - * startTime, duration and delay. The use of these properties is determined by the setting - * arguments passed in the constructor of the particle animation set. By default, only the startTime property is required. - */ - public initParticleFunc:Function; - - /** - * Initialiser function scope for static particle properties - */ - public initParticleScope:Object; - - /** - * Creates a new ParticleAnimationSet - * - * @param [optional] usesDuration Defines whether the animation set uses the duration data in its static properties to determine how long a particle is visible for. Defaults to false. - * @param [optional] usesLooping Defines whether the animation set uses a looping timeframe for each particle determined by the startTime, duration and delay data in its static properties function. Defaults to false. Requires usesDuration to be true. - * @param [optional] usesDelay Defines whether the animation set uses the delay data in its static properties to determine how long a particle is hidden for. Defaults to false. Requires usesLooping to be true. - */ - constructor(usesDuration:boolean = false, usesLooping:boolean = false, usesDelay:boolean = false) - { - super(); - - //automatically add a particle time node to the set - this.addAnimation(this._timeNode = new ParticleTimeNode(usesDuration, usesLooping, usesDelay)); - } - - /** - * Returns a vector of the particle animation nodes contained within the set. - */ - public get particleNodes():Array - { - return this._particleNodes; - } - - /** - * @inheritDoc - */ - public addAnimation(node:AnimationNodeBase) - { - var i:number /*int*/; - var n:ParticleNodeBase = node; - n._iProcessAnimationSetting(this); - if (n.mode == ParticlePropertiesMode.LOCAL_STATIC) { - n._iDataOffset = this._totalLenOfOneVertex; - this._totalLenOfOneVertex += n.dataLength; - this._localStaticNodes.push(n); - } else if (n.mode == ParticlePropertiesMode.LOCAL_DYNAMIC) - this._localDynamicNodes.push(n); - - for (i = this._particleNodes.length - 1; i >= 0; i--) { - if (this._particleNodes[i].priority <= n.priority) - break; - } - - this._particleNodes.splice(i + 1, 0, n); - - super.addAnimation(node); - } - - /** - * @inheritDoc - */ - public activate(shaderObject:ShaderObjectBase, stage:Stage) - { -// this._iAnimationRegisterCache = pass.animationRegisterCache; - } - - /** - * @inheritDoc - */ - public deactivate(shaderObject:ShaderObjectBase, stage:Stage) - { -// var context:IContextStageGL = stage.context; -// var offset:number /*int*/ = this._iAnimationRegisterCache.vertexAttributesOffset; -// var used:number /*int*/ = this._iAnimationRegisterCache.numUsedStreams; -// for (var i:number /*int*/ = offset; i < used; i++) -// context.setVertexBufferAt(i, null); - } - - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject:ShaderObjectBase):string - { - //grab animationRegisterCache from the materialpassbase or create a new one if the first time - this._iAnimationRegisterCache = shaderObject.animationRegisterCache; - - if (this._iAnimationRegisterCache == null) - this._iAnimationRegisterCache = shaderObject.animationRegisterCache = new AnimationRegisterCache(shaderObject.profile); - - //reset animationRegisterCache - this._iAnimationRegisterCache.vertexConstantOffset = shaderObject.numUsedVertexConstants; - this._iAnimationRegisterCache.vertexAttributesOffset = shaderObject.numUsedStreams; - this._iAnimationRegisterCache.varyingsOffset = shaderObject.numUsedVaryings; - this._iAnimationRegisterCache.fragmentConstantOffset = shaderObject.numUsedFragmentConstants; - this._iAnimationRegisterCache.hasUVNode = this.hasUVNode; - this._iAnimationRegisterCache.needVelocity = this.needVelocity; - this._iAnimationRegisterCache.hasBillboard = this.hasBillboard; - this._iAnimationRegisterCache.sourceRegisters = shaderObject.animatableAttributes; - this._iAnimationRegisterCache.targetRegisters = shaderObject.animationTargetRegisters; - this._iAnimationRegisterCache.needFragmentAnimation = shaderObject.usesFragmentAnimation; - this._iAnimationRegisterCache.needUVAnimation = !shaderObject.usesUVTransform; - this._iAnimationRegisterCache.hasColorAddNode = this.hasColorAddNode; - this._iAnimationRegisterCache.hasColorMulNode = this.hasColorMulNode; - this._iAnimationRegisterCache.reset(); - - var code:string = ""; - - code += this._iAnimationRegisterCache.getInitCode(); - - var node:ParticleNodeBase; - var i:number /*int*/; - - for (i = 0; i < this._particleNodes.length; i++) { - node = this._particleNodes[i]; - if (node.priority < ParticleAnimationSet.POST_PRIORITY) - code += node.getAGALVertexCode(shaderObject, this._iAnimationRegisterCache); - } - - code += this._iAnimationRegisterCache.getCombinationCode(); - - for (i = 0; i < this._particleNodes.length; i++) { - node = this._particleNodes[i]; - if (node.priority >= ParticleAnimationSet.POST_PRIORITY && node.priority < ParticleAnimationSet.COLOR_PRIORITY) - code += node.getAGALVertexCode(shaderObject, this._iAnimationRegisterCache); - } - - code += this._iAnimationRegisterCache.initColorRegisters(); - - for (i = 0; i < this._particleNodes.length; i++) { - node = this._particleNodes[i]; - if (node.priority >= ParticleAnimationSet.COLOR_PRIORITY) - code += node.getAGALVertexCode(shaderObject, this._iAnimationRegisterCache); - } - code += this._iAnimationRegisterCache.getColorPassCode(); - return code; - } - - /** - * @inheritDoc - */ - public getAGALUVCode(shaderObject:ShaderObjectBase):string - { - var code:string = ""; - if (this.hasUVNode) { - this._iAnimationRegisterCache.setUVSourceAndTarget(shaderObject.uvSource, shaderObject.uvTarget); - code += "mov " + this._iAnimationRegisterCache.uvTarget + ".xy," + this._iAnimationRegisterCache.uvAttribute.toString() + "\n"; - var node:ParticleNodeBase; - for (var i:number /*uint*/ = 0; i < this._particleNodes.length; i++) - node = this._particleNodes[i]; - code += node.getAGALUVCode(shaderObject, this._iAnimationRegisterCache); - code += "mov " + this._iAnimationRegisterCache.uvVar.toString() + "," + this._iAnimationRegisterCache.uvTarget + ".xy\n"; - } else - code += "mov " + shaderObject.uvTarget + "," + shaderObject.uvSource + "\n"; - return code; - } - - /** - * @inheritDoc - */ - public getAGALFragmentCode(shaderObject:ShaderObjectBase, shadedTarget:string):string - { - return this._iAnimationRegisterCache.getColorCombinationCode(shadedTarget); - } - - /** - * @inheritDoc - */ - public doneAGALCode(shaderObject:ShaderObjectBase) - { - this._iAnimationRegisterCache.setDataLength(); - - //set vertexZeroConst,vertexOneConst,vertexTwoConst - this._iAnimationRegisterCache.setVertexConst(this._iAnimationRegisterCache.vertexZeroConst.index, 0, 1, 2, 0); - } - - /** - * @inheritDoc - */ - public get usesCPU():boolean - { - return false; - } - - /** - * @inheritDoc - */ - public cancelGPUCompatibility() - { - - } - - public dispose() - { - for (var key in this._animationSubGeometries) - ( this._animationSubGeometries[key]).dispose(); - - super.dispose(); - } - - public getAnimationSubGeometry(subMesh:ISubMesh) - { - var mesh:Mesh = subMesh.parentMesh; - var animationSubGeometry:AnimationSubGeometry = (mesh.shareAnimationGeometry)? this._animationSubGeometries[subMesh.subGeometry.id] : this._animationSubGeometries[subMesh.id]; - - if (animationSubGeometry) - return animationSubGeometry; - - this._iGenerateAnimationSubGeometries(mesh); - - return (mesh.shareAnimationGeometry)? this._animationSubGeometries[subMesh.subGeometry.id] : this._animationSubGeometries[subMesh.id]; - } - - - /** @private */ - public _iGenerateAnimationSubGeometries(mesh:Mesh) - { - if (this.initParticleFunc == null) - throw(new Error("no initParticleFunc set")); - - var geometry:ParticleGeometry = mesh.geometry; - - if (!geometry) - throw(new Error("Particle animation can only be performed on a ParticleGeometry object")); - - var i:number /*int*/, j:number /*int*/, k:number /*int*/; - var animationSubGeometry:AnimationSubGeometry; - var newAnimationSubGeometry:boolean = false; - var subGeometry:SubGeometryBase; - var subMesh:ISubMesh; - var localNode:ParticleNodeBase; - - for (i = 0; i < mesh.subMeshes.length; i++) { - subMesh = mesh.subMeshes[i]; - subGeometry = subMesh.subGeometry; - if (mesh.shareAnimationGeometry) { - animationSubGeometry = this._animationSubGeometries[subGeometry.id]; - - if (animationSubGeometry) - continue; - } - - animationSubGeometry = new AnimationSubGeometry(); - - if (mesh.shareAnimationGeometry) - this._animationSubGeometries[subGeometry.id] = animationSubGeometry; - else - this._animationSubGeometries[subMesh.id] = animationSubGeometry; - - newAnimationSubGeometry = true; - - //create the vertexData vector that will be used for local node data - animationSubGeometry.createVertexData(subGeometry.numVertices, this._totalLenOfOneVertex); - } - - if (!newAnimationSubGeometry) - return; - - var particles:Array = geometry.particles; - var particlesLength:number /*uint*/ = particles.length; - var numParticles:number /*uint*/ = geometry.numParticles; - var particleProperties:ParticleProperties = new ParticleProperties(); - var particle:ParticleData; - - var oneDataLen:number /*int*/; - var oneDataOffset:number /*int*/; - var counterForVertex:number /*int*/; - var counterForOneData:number /*int*/; - var oneData:Array; - var numVertices:number /*uint*/; - var vertexData:Array; - var vertexLength:number /*uint*/; - var startingOffset:number /*uint*/; - var vertexOffset:number /*uint*/; - - //default values for particle param - particleProperties.total = numParticles; - particleProperties.startTime = 0; - particleProperties.duration = 1000; - particleProperties.delay = 0.1; - - i = 0; - j = 0; - while (i < numParticles) { - particleProperties.index = i; - - //call the init on the particle parameters - this.initParticleFunc.call(this.initParticleScope, particleProperties); - - //create the next set of node properties for the particle - for (k = 0; k < this._localStaticNodes.length; k++) - this._localStaticNodes[k]._iGeneratePropertyOfOneParticle(particleProperties); - - //loop through all particle data for the curent particle - while (j < particlesLength && (particle = particles[j]).particleIndex == i) { - //find the target animationSubGeometry - for (k = 0; k < mesh.subMeshes.length; k++) { - subMesh = mesh.subMeshes[k]; - if (subMesh.subGeometry == particle.subGeometry) { - animationSubGeometry = (mesh.shareAnimationGeometry)? this._animationSubGeometries[subMesh.subGeometry.id] : this._animationSubGeometries[subMesh.id]; - break; - } - } - numVertices = particle.numVertices; - vertexData = animationSubGeometry.vertexData; - vertexLength = numVertices*this._totalLenOfOneVertex; - startingOffset = animationSubGeometry.numProcessedVertices*this._totalLenOfOneVertex; - - //loop through each static local node in the animation set - for (k = 0; k < this._localStaticNodes.length; k++) { - localNode = this._localStaticNodes[k]; - oneData = localNode.oneData; - oneDataLen = localNode.dataLength; - oneDataOffset = startingOffset + localNode._iDataOffset; - - //loop through each vertex set in the vertex data - for (counterForVertex = 0; counterForVertex < vertexLength; counterForVertex += this._totalLenOfOneVertex) { - vertexOffset = oneDataOffset + counterForVertex; - - //add the data for the local node to the vertex data - for (counterForOneData = 0; counterForOneData < oneDataLen; counterForOneData++) - vertexData[vertexOffset + counterForOneData] = oneData[counterForOneData]; - } - - } - - //store particle properties if they need to be retreived for dynamic local nodes - if (this._localDynamicNodes.length) - animationSubGeometry.animationParticles.push(new ParticleAnimationData(i, particleProperties.startTime, particleProperties.duration, particleProperties.delay, particle)); - - animationSubGeometry.numProcessedVertices += numVertices; - - //next index - j++; - } - - //next particle - i++; - } - } - } -} diff --git a/src/away/animators/ParticleAnimator.ts b/src/away/animators/ParticleAnimator.ts deleted file mode 100644 index 429ac90a7..000000000 --- a/src/away/animators/ParticleAnimator.ts +++ /dev/null @@ -1,164 +0,0 @@ -/// - -module away.animators -{ - import SubGeometryBase = away.base.SubGeometryBase; - import ISubMesh = away.base.ISubMesh; - import Stage = away.base.Stage; - import Camera = away.entities.Camera; - import Vector3D = away.geom.Vector3D; - import ContextGLProgramType = away.stagegl.ContextGLProgramType; - import ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import RenderableBase = away.pool.RenderableBase; - import IContextStageGL = away.stagegl.IContextStageGL; - - /** - * Provides an interface for assigning paricle-based animation data sets to mesh-based entity objects - * and controlling the various available states of animation through an interative playhead that can be - * automatically updated or manually triggered. - * - * Requires that the containing geometry of the parent mesh is particle geometry - * - * @see away.base.ParticleGeometry - */ - export class ParticleAnimator extends AnimatorBase - { - - private _particleAnimationSet:ParticleAnimationSet; - private _animationParticleStates:Array = new Array(); - private _animatorParticleStates:Array = new Array(); - private _timeParticleStates:Array = new Array(); - private _totalLenOfOneVertex:number /*uint*/ = 0; - private _animatorSubGeometries:Object = new Object(); - - /** - * Creates a new ParticleAnimator object. - * - * @param particleAnimationSet The animation data set containing the particle animations used by the animator. - */ - constructor(particleAnimationSet:ParticleAnimationSet) - { - super(particleAnimationSet); - this._particleAnimationSet = particleAnimationSet; - - var state:ParticleStateBase; - var node:ParticleNodeBase; - - for (var i:number = 0; i < this._particleAnimationSet.particleNodes.length; i++) { - node = this._particleAnimationSet.particleNodes[i]; - state = this.getAnimationState(node); - if (node.mode == ParticlePropertiesMode.LOCAL_DYNAMIC) { - this._animatorParticleStates.push(state); - node._iDataOffset = this._totalLenOfOneVertex; - this._totalLenOfOneVertex += node.dataLength; - } else { - this._animationParticleStates.push(state); - } - if (state.needUpdateTime) - this._timeParticleStates.push(state); - } - } - - /** - * @inheritDoc - */ - public clone():AnimatorBase - { - return new ParticleAnimator(this._particleAnimationSet); - } - - /** - * @inheritDoc - */ - public setRenderState(shaderObject:ShaderObjectBase, renderable:RenderableBase, stage:Stage, camera:Camera, vertexConstantOffset:number /*int*/, vertexStreamOffset:number /*int*/) - { - var animationRegisterCache:AnimationRegisterCache = this._particleAnimationSet._iAnimationRegisterCache; - - var subMesh:ISubMesh = ( renderable).subMesh; - var state:ParticleStateBase; - var i:number; - - if (!subMesh) - throw(new Error("Must be subMesh")); - - //process animation sub geometries - var animationSubGeometry:AnimationSubGeometry = this._particleAnimationSet.getAnimationSubGeometry(subMesh); - - for (i = 0; i < this._animationParticleStates.length; i++) - this._animationParticleStates[i].setRenderState(stage, renderable, animationSubGeometry, animationRegisterCache, camera); - - //process animator subgeometries - var animatorSubGeometry:AnimationSubGeometry = this.getAnimatorSubGeometry(subMesh); - - for (i = 0; i < this._animatorParticleStates.length; i++) - this._animatorParticleStates[i].setRenderState(stage, renderable, animatorSubGeometry, animationRegisterCache, camera); - - ( stage.context).setProgramConstantsFromArray(ContextGLProgramType.VERTEX, animationRegisterCache.vertexConstantOffset, animationRegisterCache.vertexConstantData, animationRegisterCache.numVertexConstant); - - if (animationRegisterCache.numFragmentConstant > 0) - ( stage.context).setProgramConstantsFromArray(ContextGLProgramType.FRAGMENT, animationRegisterCache.fragmentConstantOffset, animationRegisterCache.fragmentConstantData, animationRegisterCache.numFragmentConstant); - } - - /** - * @inheritDoc - */ - public testGPUCompatibility(shaderObject:ShaderObjectBase) - { - - } - - /** - * @inheritDoc - */ - public start() - { - super.start(); - - for (var i:number = 0; i < this._timeParticleStates.length; i++) - this._timeParticleStates[i].offset(this._pAbsoluteTime); - } - - /** - * @inheritDoc - */ - public _pUpdateDeltaTime(dt:number) - { - this._pAbsoluteTime += dt; - - for (var i:number = 0; i < this._timeParticleStates.length; i++) - this._timeParticleStates[i].update(this._pAbsoluteTime); - } - - /** - * @inheritDoc - */ - public resetTime(offset:number /*int*/ = 0) - { - for (var i:number = 0; i < this._timeParticleStates.length; i++) - this._timeParticleStates[i].offset(this._pAbsoluteTime + offset); - this.update(this.time); - } - - public dispose() - { - for (var key in this._animatorSubGeometries) - ( this._animatorSubGeometries[key]).dispose(); - } - - private getAnimatorSubGeometry(subMesh:ISubMesh):AnimationSubGeometry - { - if (!this._animatorParticleStates.length) - return; - - var subGeometry:SubGeometryBase = subMesh.subGeometry; - var animatorSubGeometry:AnimationSubGeometry = this._animatorSubGeometries[subGeometry.id] = new AnimationSubGeometry(); - - //create the vertexData vector that will be used for local state data - animatorSubGeometry.createVertexData(subGeometry.numVertices, this._totalLenOfOneVertex); - - //pass the particles data to the animator subGeometry - animatorSubGeometry.animationParticles = this._particleAnimationSet.getAnimationSubGeometry(subMesh).animationParticles; - } - } -} diff --git a/src/away/animators/SkeletonAnimationSet.ts b/src/away/animators/SkeletonAnimationSet.ts deleted file mode 100644 index e16df2e9d..000000000 --- a/src/away/animators/SkeletonAnimationSet.ts +++ /dev/null @@ -1,125 +0,0 @@ -/// - -module away.animators -{ - import Stage = away.base.Stage; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import ShaderRegisterElement = away.materials.ShaderRegisterElement; - import IContextStageGL = away.stagegl.IContextStageGL; - - /** - * The animation data set used by skeleton-based animators, containing skeleton animation data. - * - * @see away.animators.SkeletonAnimator - */ - export class SkeletonAnimationSet extends AnimationSetBase implements IAnimationSet - { - private _jointsPerVertex:number /*uint*/; - - /** - * Returns the amount of skeleton joints that can be linked to a single vertex via skinned weight values. For GPU-base animation, the - * maximum allowed value is 4. - */ - public get jointsPerVertex():number /*uint*/ - { - return this._jointsPerVertex; - } - - /** - * Creates a new SkeletonAnimationSet object. - * - * @param jointsPerVertex Sets the amount of skeleton joints that can be linked to a single vertex via skinned weight values. For GPU-base animation, the maximum allowed value is 4. Defaults to 4. - */ - constructor(jointsPerVertex:number /*uint*/ = 4) - { - super(); - - this._jointsPerVertex = jointsPerVertex; - } - - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject:ShaderObjectBase):string - { - var len:number /*uint*/ = shaderObject.animatableAttributes.length; - - var indexOffset0:number /*uint*/ = shaderObject.numUsedVertexConstants; - var indexOffset1:number /*uint*/ = indexOffset0 + 1; - var indexOffset2:number /*uint*/ = indexOffset0 + 2; - var indexStream:string = "va" + shaderObject.numUsedStreams; - var weightStream:string = "va" + (shaderObject.numUsedStreams + 1); - var indices:Array = [ indexStream + ".x", indexStream + ".y", indexStream + ".z", indexStream + ".w" ]; - var weights:Array = [ weightStream + ".x", weightStream + ".y", weightStream + ".z", weightStream + ".w" ]; - var temp1:string = this._pFindTempReg(shaderObject.animationTargetRegisters); - var temp2:string = this._pFindTempReg(shaderObject.animationTargetRegisters, temp1); - var dot:string = "dp4"; - var code:string = ""; - - for (var i:number /*uint*/ = 0; i < len; ++i) { - - var src:string = shaderObject.animatableAttributes[i]; - - for (var j:number /*uint*/ = 0; j < this._jointsPerVertex; ++j) { - code += dot + " " + temp1 + ".x, " + src + ", vc[" + indices[j] + "+" + indexOffset0 + "]\n" + - dot + " " + temp1 + ".y, " + src + ", vc[" + indices[j] + "+" + indexOffset1 + "]\n" + - dot + " " + temp1 + ".z, " + src + ", vc[" + indices[j] + "+" + indexOffset2 + "]\n" + - "mov " + temp1 + ".w, " + src + ".w\n" + - "mul " + temp1 + ", " + temp1 + ", " + weights[j] + "\n"; // apply weight - - // add or mov to target. Need to write to a temp reg first, because an output can be a target - if (j == 0) - code += "mov " + temp2 + ", " + temp1 + "\n"; else - code += "add " + temp2 + ", " + temp2 + ", " + temp1 + "\n"; - } - // switch to dp3 once positions have been transformed, from now on, it should only be vectors instead of points - dot = "dp3"; - code += "mov " + shaderObject.animationTargetRegisters[i] + ", " + temp2 + "\n"; - } - - return code; - } - - /** - * @inheritDoc - */ - public activate(shaderObject:ShaderObjectBase, stage:Stage) - { - } - - /** - * @inheritDoc - */ - public deactivate(shaderObject:ShaderObjectBase, stage:Stage) - { -// var streamOffset:number /*uint*/ = pass.numUsedStreams; -// var context:IContextStageGL = stage.context; -// context.setVertexBufferAt(streamOffset, null); -// context.setVertexBufferAt(streamOffset + 1, null); - } - - /** - * @inheritDoc - */ - public getAGALFragmentCode(shaderObject:ShaderObjectBase, shadedTarget:string):string - { - return ""; - } - - /** - * @inheritDoc - */ - public getAGALUVCode(shaderObject:ShaderObjectBase):string - { - return "mov " + shaderObject.uvTarget + "," + shaderObject.uvSource + "\n"; - } - - /** - * @inheritDoc - */ - public doneAGALCode(shaderObject:ShaderObjectBase) - { - - } - } -} diff --git a/src/away/animators/SkeletonAnimator.ts b/src/away/animators/SkeletonAnimator.ts deleted file mode 100644 index b2b9afbbd..000000000 --- a/src/away/animators/SkeletonAnimator.ts +++ /dev/null @@ -1,622 +0,0 @@ -/// - -module away.animators -{ - import TriangleSubGeometry = away.base.TriangleSubGeometry; - import SubMesh = away.base.TriangleSubMesh; - import Stage = away.base.Stage; - import Camera = away.entities.Camera; - import AnimationStateEvent = away.events.AnimationStateEvent; - import SubGeometryEvent = away.events.SubGeometryEvent; - import ContextGLProgramType = away.stagegl.ContextGLProgramType; - import Quaternion = away.geom.Quaternion; - import Vector3D = away.geom.Vector3D; - import RenderableBase = away.pool.RenderableBase; - import TriangleSubMeshRenderable = away.pool.TriangleSubMeshRenderable; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import IContextStageGL = away.stagegl.IContextStageGL; - - /** - * Provides an interface for assigning skeleton-based animation data sets to mesh-based entity objects - * and controlling the various available states of animation through an interative playhead that can be - * automatically updated or manually triggered. - */ - export class SkeletonAnimator extends AnimatorBase - { - private _globalMatrices:Array; - private _globalPose:SkeletonPose = new SkeletonPose(); - private _globalPropertiesDirty:boolean; - private _numJoints:number /*uint*/; - private _morphedSubGeometry:Object = new Object(); - private _morphedSubGeometryDirty:Object = new Object(); - private _condensedMatrices:Array; - - private _skeleton:Skeleton; - private _forceCPU:boolean; - private _useCondensedIndices:boolean; - private _jointsPerVertex:number /*uint*/; - private _activeSkeletonState:ISkeletonAnimationState; - private _onTransitionCompleteDelegate:(event:AnimationStateEvent) => void; - - private _onIndicesUpdateDelegate:(event:SubGeometryEvent) => void; - private _onVerticesUpdateDelegate:(event:SubGeometryEvent) => void; - - /** - * returns the calculated global matrices of the current skeleton pose. - * - * @see #globalPose - */ - public get globalMatrices():Array - { - if (this._globalPropertiesDirty) - this.updateGlobalProperties(); - - return this._globalMatrices; - } - - /** - * returns the current skeleton pose output from the animator. - * - * @see away.animators.data.SkeletonPose - */ - public get globalPose():SkeletonPose - { - if (this._globalPropertiesDirty) - this.updateGlobalProperties(); - - return this._globalPose; - } - - /** - * Returns the skeleton object in use by the animator - this defines the number and heirarchy of joints used by the - * skinned geoemtry to which skeleon animator is applied. - */ - public get skeleton():Skeleton - { - return this._skeleton; - } - - /** - * Indicates whether the skeleton animator is disabled by default for GPU rendering, something that allows the animator to perform calculation on the GPU. - * Defaults to false. - */ - public get forceCPU():boolean - { - return this._forceCPU; - } - - /** - * Offers the option of enabling GPU accelerated animation on skeletons larger than 32 joints - * by condensing the number of joint index values required per mesh. Only applicable to - * skeleton animations that utilise more than one mesh object. Defaults to false. - */ - public get useCondensedIndices():boolean - { - return this._useCondensedIndices; - } - - public set useCondensedIndices(value:boolean) - { - this._useCondensedIndices = value; - } - - /** - * Creates a new SkeletonAnimator object. - * - * @param skeletonAnimationSet The animation data set containing the skeleton animations used by the animator. - * @param skeleton The skeleton object used for calculating the resulting global matrices for transforming skinned mesh data. - * @param forceCPU Optional value that only allows the animator to perform calculation on the CPU. Defaults to false. - */ - constructor(animationSet:SkeletonAnimationSet, skeleton:Skeleton, forceCPU:boolean = false) - { - super(animationSet); - - this._skeleton = skeleton; - this._forceCPU = forceCPU; - this._jointsPerVertex = animationSet.jointsPerVertex; - - this._numJoints = this._skeleton.numJoints; - this._globalMatrices = new Array(this._numJoints*12); - - var j:number /*int*/ = 0; - for (var i:number /*uint*/ = 0; i < this._numJoints; ++i) { - this._globalMatrices[j++] = 1; - this._globalMatrices[j++] = 0; - this._globalMatrices[j++] = 0; - this._globalMatrices[j++] = 0; - this._globalMatrices[j++] = 0; - this._globalMatrices[j++] = 1; - this._globalMatrices[j++] = 0; - this._globalMatrices[j++] = 0; - this._globalMatrices[j++] = 0; - this._globalMatrices[j++] = 0; - this._globalMatrices[j++] = 1; - this._globalMatrices[j++] = 0; - } - - this._onTransitionCompleteDelegate = (event:AnimationStateEvent) => this.onTransitionComplete(event); - this._onIndicesUpdateDelegate = (event:SubGeometryEvent) => this.onIndicesUpdate(event); - this._onVerticesUpdateDelegate = (event:SubGeometryEvent) => this.onVerticesUpdate(event); - } - - /** - * @inheritDoc - */ - public clone():AnimatorBase - { - /* The cast to SkeletonAnimationSet should never fail, as _animationSet can only be set - through the constructor, which will only accept a SkeletonAnimationSet. */ - return new SkeletonAnimator( this._pAnimationSet, this._skeleton, this._forceCPU); - } - - /** - * Plays an animation state registered with the given name in the animation data set. - * - * @param name The data set name of the animation state to be played. - * @param transition An optional transition object that determines how the animator will transition from the currently active animation state. - * @param offset An option offset time (in milliseconds) that resets the state's internal clock to the absolute time of the animator plus the offset value. Required for non-looping animation states. - */ - public play(name:string, transition:IAnimationTransition = null, offset:number = NaN) - { - if (this._pActiveAnimationName == name) - return; - - this._pActiveAnimationName = name; - - if (!this._pAnimationSet.hasAnimation(name)) - throw new Error("Animation root node " + name + " not found!"); - - if (transition && this._pActiveNode) { - //setup the transition - this._pActiveNode = transition.getAnimationNode(this, this._pActiveNode, this._pAnimationSet.getAnimation(name), this._pAbsoluteTime); - this._pActiveNode.addEventListener(AnimationStateEvent.TRANSITION_COMPLETE, this._onTransitionCompleteDelegate); - } else - this._pActiveNode = this._pAnimationSet.getAnimation(name); - - this._pActiveState = this.getAnimationState(this._pActiveNode); - - if (this.updatePosition) { - //update straight away to reset position deltas - this._pActiveState.update(this._pAbsoluteTime); - this._pActiveState.positionDelta; - } - - this._activeSkeletonState = this._pActiveState; - - this.start(); - - //apply a time offset if specified - if (!isNaN(offset)) - this.reset(name, offset); - } - - /** - * @inheritDoc - */ - public setRenderState(shaderObject:ShaderObjectBase, renderable:RenderableBase, stage:Stage, camera:Camera, vertexConstantOffset:number /*int*/, vertexStreamOffset:number /*int*/) - { - // do on request of globalProperties - if (this._globalPropertiesDirty) - this.updateGlobalProperties(); - - var subGeometry:TriangleSubGeometry = ( ( renderable).subMesh).subGeometry; - - subGeometry.useCondensedIndices = this._useCondensedIndices; - - if (this._useCondensedIndices) { - // using a condensed data set - this.updateCondensedMatrices(subGeometry.condensedIndexLookUp, subGeometry.numCondensedJoints); - ( stage.context).setProgramConstantsFromArray(ContextGLProgramType.VERTEX, vertexConstantOffset, this._condensedMatrices, subGeometry.numCondensedJoints*3); - } else { - if (this._pAnimationSet.usesCPU) { - if (this._morphedSubGeometryDirty[subGeometry.id]) - this.morphSubGeometry( renderable, subGeometry); - - return - } - ( stage.context).setProgramConstantsFromArray(ContextGLProgramType.VERTEX, vertexConstantOffset, this._globalMatrices, this._numJoints*3); - } - - ( stage.context).activateBuffer(vertexStreamOffset, renderable.getVertexData(TriangleSubGeometry.JOINT_INDEX_DATA), renderable.getVertexOffset(TriangleSubGeometry.JOINT_INDEX_DATA), renderable.JOINT_INDEX_FORMAT); - ( stage.context).activateBuffer(vertexStreamOffset + 1, renderable.getVertexData(TriangleSubGeometry.JOINT_WEIGHT_DATA), renderable.getVertexOffset(TriangleSubGeometry.JOINT_WEIGHT_DATA), renderable.JOINT_WEIGHT_FORMAT); - } - - /** - * @inheritDoc - */ - public testGPUCompatibility(shaderObject:ShaderObjectBase) - { - if (!this._useCondensedIndices && (this._forceCPU || this._jointsPerVertex > 4 || shaderObject.numUsedVertexConstants + this._numJoints*3 > 128)) - this._pAnimationSet.cancelGPUCompatibility(); - } - - /** - * Applies the calculated time delta to the active animation state node or state transition object. - */ - public _pUpdateDeltaTime(dt:number) - { - super._pUpdateDeltaTime(dt); - - //invalidate pose matrices - this._globalPropertiesDirty = true; - - //trigger geometry invalidation if using CPU animation - if (this._pAnimationSet.usesCPU) - for (var key in this._morphedSubGeometryDirty) - this._morphedSubGeometryDirty[key] = true; - } - - private updateCondensedMatrices(condensedIndexLookUp:Array /*uint*/, numJoints:number /*uint*/) - { - var i:number /*uint*/ = 0, j:number /*uint*/ = 0; - var len:number /*uint*/; - var srcIndex:number /*uint*/; - - this._condensedMatrices = new Array(); - - do { - srcIndex = condensedIndexLookUp[i]*4; - len = srcIndex + 12; - // copy into condensed - while (srcIndex < len) - this._condensedMatrices[j++] = this._globalMatrices[srcIndex++]; - } while (++i < numJoints); - } - - private updateGlobalProperties() - { - this._globalPropertiesDirty = false; - - //get global pose - this.localToGlobalPose(this._activeSkeletonState.getSkeletonPose(this._skeleton), this._globalPose, this._skeleton); - - // convert pose to matrix - var mtxOffset:number /*uint*/ = 0; - var globalPoses:Array = this._globalPose.jointPoses; - var raw:Array; - var ox:number, oy:number, oz:number, ow:number; - var xy2:number, xz2:number, xw2:number; - var yz2:number, yw2:number, zw2:number; - var n11:number, n12:number, n13:number; - var n21:number, n22:number, n23:number; - var n31:number, n32:number, n33:number; - var m11:number, m12:number, m13:number, m14:number; - var m21:number, m22:number, m23:number, m24:number; - var m31:number, m32:number, m33:number, m34:number; - var joints:Array = this._skeleton.joints; - var pose:JointPose; - var quat:Quaternion; - var vec:Vector3D; - var t:number; - - for (var i:number /*uint*/ = 0; i < this._numJoints; ++i) { - pose = globalPoses[i]; - quat = pose.orientation; - vec = pose.translation; - ox = quat.x; - oy = quat.y; - oz = quat.z; - ow = quat.w; - - xy2 = (t = 2.0*ox)*oy; - xz2 = t*oz; - xw2 = t*ow; - yz2 = (t = 2.0*oy)*oz; - yw2 = t*ow; - zw2 = 2.0*oz*ow; - - yz2 = 2.0*oy*oz; - yw2 = 2.0*oy*ow; - zw2 = 2.0*oz*ow; - ox *= ox; - oy *= oy; - oz *= oz; - ow *= ow; - - n11 = (t = ox - oy) - oz + ow; - n12 = xy2 - zw2; - n13 = xz2 + yw2; - n21 = xy2 + zw2; - n22 = -t - oz + ow; - n23 = yz2 - xw2; - n31 = xz2 - yw2; - n32 = yz2 + xw2; - n33 = -ox - oy + oz + ow; - - // prepend inverse bind pose - raw = joints[i].inverseBindPose; - m11 = raw[0]; - m12 = raw[4]; - m13 = raw[8]; - m14 = raw[12]; - m21 = raw[1]; - m22 = raw[5]; - m23 = raw[9]; - m24 = raw[13]; - m31 = raw[2]; - m32 = raw[6]; - m33 = raw[10]; - m34 = raw[14]; - - this._globalMatrices[mtxOffset] = n11*m11 + n12*m21 + n13*m31; - this._globalMatrices[mtxOffset + 1] = n11*m12 + n12*m22 + n13*m32; - this._globalMatrices[mtxOffset + 2] = n11*m13 + n12*m23 + n13*m33; - this._globalMatrices[mtxOffset + 3] = n11*m14 + n12*m24 + n13*m34 + vec.x; - this._globalMatrices[mtxOffset + 4] = n21*m11 + n22*m21 + n23*m31; - this._globalMatrices[mtxOffset + 5] = n21*m12 + n22*m22 + n23*m32; - this._globalMatrices[mtxOffset + 6] = n21*m13 + n22*m23 + n23*m33; - this._globalMatrices[mtxOffset + 7] = n21*m14 + n22*m24 + n23*m34 + vec.y; - this._globalMatrices[mtxOffset + 8] = n31*m11 + n32*m21 + n33*m31; - this._globalMatrices[mtxOffset + 9] = n31*m12 + n32*m22 + n33*m32; - this._globalMatrices[mtxOffset + 10] = n31*m13 + n32*m23 + n33*m33; - this._globalMatrices[mtxOffset + 11] = n31*m14 + n32*m24 + n33*m34 + vec.z; - - mtxOffset = mtxOffset + 12; - } - } - - - public getRenderableSubGeometry(renderable:TriangleSubMeshRenderable, sourceSubGeometry:TriangleSubGeometry):TriangleSubGeometry - { - this._morphedSubGeometryDirty[sourceSubGeometry.id] = true; - - //early out for GPU animations - if (!this._pAnimationSet.usesCPU) - return sourceSubGeometry; - - var targetSubGeometry:TriangleSubGeometry; - - if (!(targetSubGeometry = this._morphedSubGeometry[sourceSubGeometry.id])) { - //not yet stored - targetSubGeometry = this._morphedSubGeometry[sourceSubGeometry.id] = sourceSubGeometry.clone(); - //turn off auto calculations on the morphed geometry - targetSubGeometry.autoDeriveNormals = false; - targetSubGeometry.autoDeriveTangents = false; - targetSubGeometry.autoDeriveUVs = false; - //add event listeners for any changes in UV values on the source geometry - sourceSubGeometry.addEventListener(away.events.SubGeometryEvent.INDICES_UPDATED, this._onIndicesUpdateDelegate); - sourceSubGeometry.addEventListener(away.events.SubGeometryEvent.VERTICES_UPDATED, this._onVerticesUpdateDelegate); - } - - return targetSubGeometry; - } - - /** - * If the animation can't be performed on GPU, transform vertices manually - * @param subGeom The subgeometry containing the weights and joint index data per vertex. - * @param pass The material pass for which we need to transform the vertices - */ - public morphSubGeometry(renderable:TriangleSubMeshRenderable, sourceSubGeometry:TriangleSubGeometry) - { - this._morphedSubGeometryDirty[sourceSubGeometry.id] = false; - - var sourcePositions:Array = sourceSubGeometry.positions; - var sourceNormals:Array = sourceSubGeometry.vertexNormals; - var sourceTangents:Array = sourceSubGeometry.vertexTangents; - - var jointIndices:Array = sourceSubGeometry.jointIndices; - var jointWeights:Array = sourceSubGeometry.jointWeights; - - var targetSubGeometry = this._morphedSubGeometry[sourceSubGeometry.id]; - - var targetPositions:Array = targetSubGeometry.positions; - var targetNormals:Array = targetSubGeometry.vertexNormals; - var targetTangents:Array = targetSubGeometry.vertexTangents; - - var index:number /*uint*/ = 0; - var j:number /*uint*/ = 0; - var k:number /*uint*/; - var vx:number, vy:number, vz:number; - var nx:number, ny:number, nz:number; - var tx:number, ty:number, tz:number; - var len:number /*int*/ = sourcePositions.length; - var weight:number; - var vertX:number, vertY:number, vertZ:number; - var normX:number, normY:number, normZ:number; - var tangX:number, tangY:number, tangZ:number; - var m11:number, m12:number, m13:number, m14:number; - var m21:number, m22:number, m23:number, m24:number; - var m31:number, m32:number, m33:number, m34:number; - - while (index < len) { - vertX = sourcePositions[index]; - vertY = sourcePositions[index + 1]; - vertZ = sourcePositions[index + 2]; - normX = sourceNormals[index]; - normY = sourceNormals[index + 1]; - normZ = sourceNormals[index + 2]; - tangX = sourceTangents[index]; - tangY = sourceTangents[index + 1]; - tangZ = sourceTangents[index + 2]; - vx = 0; - vy = 0; - vz = 0; - nx = 0; - ny = 0; - nz = 0; - tx = 0; - ty = 0; - tz = 0; - k = 0; - while (k < this._jointsPerVertex) { - weight = jointWeights[j]; - if (weight > 0) { - // implicit /3*12 (/3 because indices are multiplied by 3 for gpu matrix access, *12 because it's the matrix size) - var mtxOffset:number /*uint*/ = jointIndices[j++] << 2; - m11 = this._globalMatrices[mtxOffset]; - m12 = this._globalMatrices[mtxOffset + 1]; - m13 = this._globalMatrices[mtxOffset + 2]; - m14 = this._globalMatrices[mtxOffset + 3]; - m21 = this._globalMatrices[mtxOffset + 4]; - m22 = this._globalMatrices[mtxOffset + 5]; - m23 = this._globalMatrices[mtxOffset + 6]; - m24 = this._globalMatrices[mtxOffset + 7]; - m31 = this._globalMatrices[mtxOffset + 8]; - m32 = this._globalMatrices[mtxOffset + 9]; - m33 = this._globalMatrices[mtxOffset + 10]; - m34 = this._globalMatrices[mtxOffset + 11]; - vx += weight*(m11*vertX + m12*vertY + m13*vertZ + m14); - vy += weight*(m21*vertX + m22*vertY + m23*vertZ + m24); - vz += weight*(m31*vertX + m32*vertY + m33*vertZ + m34); - nx += weight*(m11*normX + m12*normY + m13*normZ); - ny += weight*(m21*normX + m22*normY + m23*normZ); - nz += weight*(m31*normX + m32*normY + m33*normZ); - tx += weight*(m11*tangX + m12*tangY + m13*tangZ); - ty += weight*(m21*tangX + m22*tangY + m23*tangZ); - tz += weight*(m31*tangX + m32*tangY + m33*tangZ); - ++k; - } else { - j += (this._jointsPerVertex - k); - k = this._jointsPerVertex; - } - } - - targetPositions[index] = vx; - targetPositions[index + 1] = vy; - targetPositions[index + 2] = vz; - targetNormals[index] = nx; - targetNormals[index + 1] = ny; - targetNormals[index + 2] = nz; - targetTangents[index] = tx; - targetTangents[index + 1] = ty; - targetTangents[index + 2] = tz; - - index += 3; - } - - targetSubGeometry.updatePositions(targetPositions); - targetSubGeometry.updateVertexNormals(targetNormals); - targetSubGeometry.updateVertexTangents(targetTangents); - } - - /** - * Converts a local hierarchical skeleton pose to a global pose - * @param targetPose The SkeletonPose object that will contain the global pose. - * @param skeleton The skeleton containing the joints, and as such, the hierarchical data to transform to global poses. - */ - private localToGlobalPose(sourcePose:SkeletonPose, targetPose:SkeletonPose, skeleton:Skeleton) - { - var globalPoses:Array = targetPose.jointPoses; - var globalJointPose:JointPose; - var joints:Array = skeleton.joints; - var len:number /*uint*/ = sourcePose.numJointPoses; - var jointPoses:Array = sourcePose.jointPoses; - var parentIndex:number /*int*/; - var joint:SkeletonJoint; - var parentPose:JointPose; - var pose:JointPose; - var or:Quaternion; - var tr:Vector3D; - var t:Vector3D; - var q:Quaternion; - - var x1:number, y1:number, z1:number, w1:number; - var x2:number, y2:number, z2:number, w2:number; - var x3:number, y3:number, z3:number; - - // :s - if (globalPoses.length != len) - globalPoses.length = len; - - for (var i:number /*uint*/ = 0; i < len; ++i) { - globalJointPose = globalPoses[i]; - - if (globalJointPose == null) - globalJointPose = globalPoses[i] = new JointPose(); - - joint = joints[i]; - parentIndex = joint.parentIndex; - pose = jointPoses[i]; - - q = globalJointPose.orientation; - t = globalJointPose.translation; - - if (parentIndex < 0) { - tr = pose.translation; - or = pose.orientation; - q.x = or.x; - q.y = or.y; - q.z = or.z; - q.w = or.w; - t.x = tr.x; - t.y = tr.y; - t.z = tr.z; - } else { - // append parent pose - parentPose = globalPoses[parentIndex]; - - // rotate point - or = parentPose.orientation; - tr = pose.translation; - x2 = or.x; - y2 = or.y; - z2 = or.z; - w2 = or.w; - x3 = tr.x; - y3 = tr.y; - z3 = tr.z; - - w1 = -x2*x3 - y2*y3 - z2*z3; - x1 = w2*x3 + y2*z3 - z2*y3; - y1 = w2*y3 - x2*z3 + z2*x3; - z1 = w2*z3 + x2*y3 - y2*x3; - - // append parent translation - tr = parentPose.translation; - t.x = -w1*x2 + x1*w2 - y1*z2 + z1*y2 + tr.x; - t.y = -w1*y2 + x1*z2 + y1*w2 - z1*x2 + tr.y; - t.z = -w1*z2 - x1*y2 + y1*x2 + z1*w2 + tr.z; - - // append parent orientation - x1 = or.x; - y1 = or.y; - z1 = or.z; - w1 = or.w; - or = pose.orientation; - x2 = or.x; - y2 = or.y; - z2 = or.z; - w2 = or.w; - - q.w = w1*w2 - x1*x2 - y1*y2 - z1*z2; - q.x = w1*x2 + x1*w2 + y1*z2 - z1*y2; - q.y = w1*y2 - x1*z2 + y1*w2 + z1*x2; - q.z = w1*z2 + x1*y2 - y1*x2 + z1*w2; - } - } - } - - private onTransitionComplete(event:AnimationStateEvent) - { - if (event.type == AnimationStateEvent.TRANSITION_COMPLETE) { - event.animationNode.removeEventListener(AnimationStateEvent.TRANSITION_COMPLETE, this._onTransitionCompleteDelegate); - //if this is the current active state transition, revert control to the active node - if (this._pActiveState == event.animationState) { - this._pActiveNode = this._pAnimationSet.getAnimation(this._pActiveAnimationName); - this._pActiveState = this.getAnimationState(this._pActiveNode); - this._activeSkeletonState = this._pActiveState; - } - } - } - - private onIndicesUpdate(event:SubGeometryEvent) - { - var subGeometry:TriangleSubGeometry = event.target; - - ( this._morphedSubGeometry[subGeometry.id]).updateIndices(subGeometry.indices); - } - - private onVerticesUpdate(event:SubGeometryEvent) - { - var subGeometry:TriangleSubGeometry = event.target; - var morphGeometry:TriangleSubGeometry = this._morphedSubGeometry[subGeometry.id]; - - switch(event.dataType) { - case TriangleSubGeometry.UV_DATA: - morphGeometry.updateUVs(subGeometry.uvs); - case TriangleSubGeometry.SECONDARY_UV_DATA: - morphGeometry.updateUVs(subGeometry.secondaryUVs); - } - } - } -} diff --git a/src/away/animators/VertexAnimationSet.ts b/src/away/animators/VertexAnimationSet.ts deleted file mode 100644 index eae7f1af8..000000000 --- a/src/away/animators/VertexAnimationSet.ts +++ /dev/null @@ -1,197 +0,0 @@ -/// - -module away.animators -{ - import Stage = away.base.Stage; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import ShaderRegisterElement = away.materials.ShaderRegisterElement; - import IContextStageGL = away.stagegl.IContextStageGL; - - /** - * The animation data set used by vertex-based animators, containing vertex animation state data. - * - * @see away.animators.VertexAnimator - */ - export class VertexAnimationSet extends AnimationSetBase implements IAnimationSet - { - private _numPoses:number /*uint*/; - private _blendMode:string; - - /** - * Returns the number of poses made available at once to the GPU animation code. - */ - public get numPoses():number /*uint*/ - { - return this._numPoses; - } - - /** - * Returns the active blend mode of the vertex animator object. - */ - public get blendMode():string - { - return this._blendMode; - } - - /** - * Returns whether or not normal data is used in last set GPU pass of the vertex shader. - */ -// public get useNormals():boolean -// { -// return this._uploadNormals; -// } - - /** - * Creates a new VertexAnimationSet object. - * - * @param numPoses The number of poses made available at once to the GPU animation code. - * @param blendMode Optional value for setting the animation mode of the vertex animator object. - * - * @see away3d.animators.data.VertexAnimationMode - */ - constructor(numPoses:number /*uint*/ = 2, blendMode:string = "absolute") - { - super(); - this._numPoses = numPoses; - this._blendMode = blendMode; - - } - - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject:ShaderObjectBase):string - { - if (this._blendMode == away.animators.VertexAnimationMode.ABSOLUTE) - return this.getAbsoluteAGALCode(shaderObject); - else - return this.getAdditiveAGALCode(shaderObject); - } - - /** - * @inheritDoc - */ - public activate(shaderObject:ShaderObjectBase, stage:Stage) - { -// var uID:number = pass._iUniqueId; -// this._uploadNormals = this._useNormals[uID]; -// this._uploadTangents = this._useTangents[uID]; - } - - /** - * @inheritDoc - */ - public deactivate(shaderObject:ShaderObjectBase, stage:Stage) - { -// var uID:number = pass._iUniqueId; -// var index:number /*uint*/ = this._streamIndices[uID]; -// var context:IContextStageGL = stage.context; -// context.setVertexBufferAt(index, null); -// if (this._uploadNormals) -// context.setVertexBufferAt(index + 1, null); -// if (this._uploadTangents) -// context.setVertexBufferAt(index + 2, null); - } - - /** - * @inheritDoc - */ - public getAGALFragmentCode(shaderObject:ShaderObjectBase, shadedTarget:string):string - { - return ""; - } - - /** - * @inheritDoc - */ - public getAGALUVCode(shaderObject:ShaderObjectBase):string - { - return "mov " + shaderObject.uvTarget + "," + shaderObject.uvSource + "\n"; - } - - /** - * @inheritDoc - */ - public doneAGALCode(shaderObject:ShaderObjectBase) - { - - } - - /** - * Generates the vertex AGAL code for absolute blending. - */ - private getAbsoluteAGALCode(shaderObject:ShaderObjectBase):string - { - var code:string = ""; - var temp1:string = this._pFindTempReg(shaderObject.animationTargetRegisters); - var temp2:string = this._pFindTempReg(shaderObject.animationTargetRegisters, temp1); - var regs:Array = new Array("x", "y", "z", "w"); - var len:number /*uint*/ = shaderObject.animatableAttributes.length; - var constantReg:string = "vc" + shaderObject.numUsedVertexConstants; - - if (len > 2) - len = 2; - var streamIndex:number /*uint*/ = shaderObject.numUsedStreams; - - for (var i:number /*uint*/ = 0; i < len; ++i) { - code += "mul " + temp1 + ", " + shaderObject.animatableAttributes[i] + ", " + constantReg + "." + regs[0] + "\n"; - - for (var j:number /*uint*/ = 1; j < this._numPoses; ++j) { - code += "mul " + temp2 + ", va" + streamIndex + ", " + constantReg + "." + regs[j] + "\n"; - - if (j < this._numPoses - 1) - code += "add " + temp1 + ", " + temp1 + ", " + temp2 + "\n"; - - ++streamIndex; - } - - code += "add " + shaderObject.animationTargetRegisters[i] + ", " + temp1 + ", " + temp2 + "\n"; - } - - // add code for bitangents if tangents are used - if (shaderObject.tangentDependencies > 0 || shaderObject.outputsNormals) { - code += "dp3 " + temp1 + ".x, " + shaderObject.animatableAttributes[2] + ", " + shaderObject.animationTargetRegisters[1] + "\n" + - "mul " + temp1 + ", " + shaderObject.animationTargetRegisters[1] + ", " + temp1 + ".x\n" + - "sub " + shaderObject.animationTargetRegisters[2] + ", " + shaderObject.animationTargetRegisters[2] + ", " + temp1 + "\n"; - } - return code; - } - - /** - * Generates the vertex AGAL code for additive blending. - */ - private getAdditiveAGALCode(shaderObject:ShaderObjectBase):string - { - var code:string = ""; - var len:number /*uint*/ = shaderObject.animatableAttributes.length; - var regs:Array = ["x", "y", "z", "w"]; - var temp1:string = this._pFindTempReg(shaderObject.animationTargetRegisters); - var k:number /*uint*/; - - var streamIndex:number /*uint*/ = shaderObject.numUsedStreams; - - if (len > 2) - len = 2; - - code += "mov " + shaderObject.animationTargetRegisters[0] + ", " + shaderObject.animatableAttributes[0] + "\n"; - if (shaderObject.normalDependencies > 0) - code += "mov " + shaderObject.animationTargetRegisters[1] + ", " + shaderObject.animatableAttributes[1] + "\n"; - - for (var i:number /*uint*/ = 0; i < len; ++i) { - for (var j:number /*uint*/ = 0; j < this._numPoses; ++j) { - code += "mul " + temp1 + ", va" + (streamIndex + k) + ", vc" + shaderObject.numUsedVertexConstants + "." + regs[j] + "\n" + - "add " + shaderObject.animationTargetRegisters[i] + ", " + shaderObject.animationTargetRegisters[i] + ", " + temp1 + "\n"; - k++; - } - } - - if (shaderObject.tangentDependencies > 0 || shaderObject.outputsNormals) { - code += "dp3 " + temp1 + ".x, " + shaderObject.animatableAttributes[2] + ", " + shaderObject.animationTargetRegisters[1] + "\n" + - "mul " + temp1 + ", " + shaderObject.animationTargetRegisters[1] + ", " + temp1 + ".x\n" + - "sub " + shaderObject.animationTargetRegisters[2] + ", " + shaderObject.animatableAttributes[2] + ", " + temp1 + "\n"; - } - - return code; - } - } -} diff --git a/src/away/animators/VertexAnimator.ts b/src/away/animators/VertexAnimator.ts deleted file mode 100644 index b3be4fdf2..000000000 --- a/src/away/animators/VertexAnimator.ts +++ /dev/null @@ -1,190 +0,0 @@ -/// - -module away.animators -{ - import SubGeometryBase = away.base.SubGeometryBase; - import TriangleSubGeometry = away.base.TriangleSubGeometry; - import SubMesh = away.base.TriangleSubMesh; - import Geometry = away.base.Geometry; - import Stage = away.base.Stage; - import Mesh = away.entities.Mesh; - import Camera = away.entities.Camera; - import VertexDataPool = away.pool.VertexDataPool; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import RenderableBase = away.pool.RenderableBase; - import TriangleSubMeshRenderable = away.pool.TriangleSubMeshRenderable; - import IContextStageGL = away.stagegl.IContextStageGL; - - /** - * Provides an interface for assigning vertex-based animation data sets to mesh-based entity objects - * and controlling the various available states of animation through an interative playhead that can be - * automatically updated or manually triggered. - */ - export class VertexAnimator extends AnimatorBase - { - private _vertexAnimationSet:VertexAnimationSet; - private _poses:Array = new Array(); - private _weights:Array = Array(1, 0, 0, 0); - private _numPoses:number /*uint*/; - private _blendMode:string; - private _activeVertexState:IVertexAnimationState; - - /** - * Creates a new VertexAnimator object. - * - * @param vertexAnimationSet The animation data set containing the vertex animations used by the animator. - */ - constructor(vertexAnimationSet:VertexAnimationSet) - { - super(vertexAnimationSet); - - this._vertexAnimationSet = vertexAnimationSet; - this._numPoses = vertexAnimationSet.numPoses; - this._blendMode = vertexAnimationSet.blendMode; - } - - /** - * @inheritDoc - */ - public clone():AnimatorBase - { - return new VertexAnimator(this._vertexAnimationSet); - } - - /** - * Plays a sequence with a given name. If the sequence is not found, it may not be loaded yet, and it will retry every frame. - * @param sequenceName The name of the clip to be played. - */ - public play(name:string, transition:IAnimationTransition = null, offset:number = NaN) - { - if (this._pActiveAnimationName == name) - return; - - this._pActiveAnimationName = name; - - //TODO: implement transitions in vertex animator - - if (!this._pAnimationSet.hasAnimation(name)) - throw new Error("Animation root node " + name + " not found!"); - - this._pActiveNode = this._pAnimationSet.getAnimation(name); - - this._pActiveState = this.getAnimationState(this._pActiveNode); - - if (this.updatePosition) { - //update straight away to reset position deltas - this._pActiveState.update(this._pAbsoluteTime); - this._pActiveState.positionDelta; - } - - this._activeVertexState = this._pActiveState; - - this.start(); - - //apply a time offset if specified - if (!isNaN(offset)) - this.reset(name, offset); - } - - /** - * @inheritDoc - */ - public _pUpdateDeltaTime(dt:number) - { - super._pUpdateDeltaTime(dt); - - var geometryFlag:boolean = false; - - if (this._poses[0] != this._activeVertexState.currentGeometry) { - this._poses[0] = this._activeVertexState.currentGeometry; - geometryFlag = true; - } - - if (this._poses[1] != this._activeVertexState.nextGeometry) { - this._poses[1] = this._activeVertexState.nextGeometry; - geometryFlag = true; - } - - this._weights[0] = 1 - (this._weights[1] = this._activeVertexState.blendWeight); - - if (geometryFlag) { - //invalidate meshes - var mesh:Mesh; - var len:number = this._pOwners.length; - for (var i:number = 0; i < len; i++) { - mesh = this._pOwners[i]; - mesh._iInvalidateRenderableGeometries(); - } - } - } - - /** - * @inheritDoc - */ - public setRenderState(shaderObject:ShaderObjectBase, renderable:RenderableBase, stage:Stage, camera:Camera, vertexConstantOffset:number /*int*/, vertexStreamOffset:number /*int*/) - { - // todo: add code for when running on cpu - - // if no poses defined, set temp data - if (!this._poses.length) { - this.setNullPose(shaderObject, renderable, stage, vertexConstantOffset, vertexStreamOffset); - return; - } - - // this type of animation can only be SubMesh - var subMesh:SubMesh = ( renderable).subMesh; - var subGeom:SubGeometryBase; - var i:number /*uint*/; - var len:number /*uint*/ = this._numPoses; - - ( stage.context).setProgramConstantsFromArray(away.stagegl.ContextGLProgramType.VERTEX, vertexConstantOffset, this._weights, 1); - - if (this._blendMode == VertexAnimationMode.ABSOLUTE) - i = 1; - else - i = 0; - - for (; i < len; ++i) { - subGeom = this._poses[i].subGeometries[subMesh._iIndex] || subMesh.subGeometry; - - ( stage.context).activateBuffer(vertexStreamOffset++, VertexDataPool.getItem(subGeom, renderable.getIndexData(), TriangleSubGeometry.POSITION_DATA), subGeom.getOffset(TriangleSubGeometry.POSITION_DATA), TriangleSubGeometry.POSITION_FORMAT); - - if (shaderObject.normalDependencies > 0) - ( stage.context).activateBuffer(vertexStreamOffset++, VertexDataPool.getItem(subGeom, renderable.getIndexData(), TriangleSubGeometry.NORMAL_DATA), subGeom.getOffset(TriangleSubGeometry.NORMAL_DATA), TriangleSubGeometry.NORMAL_FORMAT); - } - } - - private setNullPose(shaderObject:ShaderObjectBase, renderable:RenderableBase, stage:Stage, vertexConstantOffset:number /*int*/, vertexStreamOffset:number /*int*/) - { - ( stage.context).setProgramConstantsFromArray(away.stagegl.ContextGLProgramType.VERTEX, vertexConstantOffset, this._weights, 1); - - if (this._blendMode == VertexAnimationMode.ABSOLUTE) { - var len:number /*uint*/ = this._numPoses; - for (var i:number /*uint*/ = 1; i < len; ++i) { - ( stage.context).activateBuffer(vertexStreamOffset++, renderable.getVertexData(TriangleSubGeometry.POSITION_DATA), renderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA), TriangleSubGeometry.POSITION_FORMAT); - - if (shaderObject.normalDependencies > 0) - ( stage.context).activateBuffer(vertexStreamOffset++, renderable.getVertexData(TriangleSubGeometry.NORMAL_DATA), renderable.getVertexOffset(TriangleSubGeometry.NORMAL_DATA), TriangleSubGeometry.NORMAL_FORMAT); - } - } - // todo: set temp data for additive? - } - - /** - * Verifies if the animation will be used on cpu. Needs to be true for all passes for a material to be able to use it on gpu. - * Needs to be called if gpu code is potentially required. - */ - public testGPUCompatibility(shaderObject:ShaderObjectBase) - { - } - - public getRenderableSubGeometry(renderable:TriangleSubMeshRenderable, sourceSubGeometry:TriangleSubGeometry):TriangleSubGeometry - { - if (this._blendMode == VertexAnimationMode.ABSOLUTE && this._poses.length) - return this._poses[0].subGeometries[renderable.subMesh._iIndex] || sourceSubGeometry; - - //nothing to do here - return sourceSubGeometry; - } - } -} diff --git a/src/away/animators/data/AnimationSubGeometry.ts b/src/away/animators/data/AnimationSubGeometry.ts deleted file mode 100644 index 08712777b..000000000 --- a/src/away/animators/data/AnimationSubGeometry.ts +++ /dev/null @@ -1,103 +0,0 @@ -/// - -module away.animators -{ - import Stage = away.base.Stage; - import IContextStageGL = away.stagegl.IContextStageGL; - import IVertexBuffer = away.stagegl.IVertexBuffer; - - /** - * ... - */ - export class AnimationSubGeometry - { - public static SUBGEOM_ID_COUNT:number = 0; - - public _pVertexData:Array; - - public _pVertexBuffer:Array = new Array(8); - public _pBufferContext:Array = new Array(8); - public _pBufferDirty:Array = new Array(8); - - private _numVertices:number /*uint*/; - - private _totalLenOfOneVertex:number /*uint*/; - - public numProcessedVertices:number /*int*/ = 0; - - public previousTime:number = Number.NEGATIVE_INFINITY; - - public animationParticles:Array = new Array(); - - /** - * An id for this animation subgeometry, used to identify animation subgeometries when using animation sets. - * - * @private - */ - public _iUniqueId:number;//Arcane - - constructor() - { - for (var i:number /*int*/ = 0; i < 8; i++) - this._pBufferDirty[i] = true; - - this._iUniqueId = AnimationSubGeometry.SUBGEOM_ID_COUNT++; - } - - public createVertexData(numVertices:number /*uint*/, totalLenOfOneVertex:number /*uint*/) - { - this._numVertices = numVertices; - this._totalLenOfOneVertex = totalLenOfOneVertex; - this._pVertexData = new Array(numVertices*totalLenOfOneVertex); - } - - public activateVertexBuffer(index:number /*int*/, bufferOffset:number /*int*/, stage:Stage, format:string) - { - var contextIndex:number /*int*/ = stage.stageIndex; - var context:IContextStageGL = stage.context; - - var buffer:IVertexBuffer = this._pVertexBuffer[contextIndex]; - if (!buffer || this._pBufferContext[contextIndex] != context) { - buffer = this._pVertexBuffer[contextIndex] = context.createVertexBuffer(this._numVertices, this._totalLenOfOneVertex); - this._pBufferContext[contextIndex] = context; - this._pBufferDirty[contextIndex] = true; - } - if (this._pBufferDirty[contextIndex]) { - buffer.uploadFromArray(this._pVertexData, 0, this._numVertices); - this._pBufferDirty[contextIndex] = false; - } - context.setVertexBufferAt(index, buffer, bufferOffset, format); - } - - public dispose() - { - while (this._pVertexBuffer.length) { - var vertexBuffer:IVertexBuffer = this._pVertexBuffer.pop() - - if (vertexBuffer) - vertexBuffer.dispose(); - } - } - - public invalidateBuffer() - { - for (var i:number /*int*/ = 0; i < 8; i++) - this._pBufferDirty[i] = true; - } - - public get vertexData():Array - { - return this._pVertexData; - } - - public get numVertices():number /*uint*/ - { - return this._numVertices; - } - - public get totalLenOfOneVertex():number /*uint*/ - { - return this._totalLenOfOneVertex; - } - } -} diff --git a/src/away/animators/data/ColorSegmentPoint.ts b/src/away/animators/data/ColorSegmentPoint.ts deleted file mode 100644 index 45ac71017..000000000 --- a/src/away/animators/data/ColorSegmentPoint.ts +++ /dev/null @@ -1,33 +0,0 @@ -/// - -module away.animators -{ - import ColorTransform = away.geom.ColorTransform; - - export class ColorSegmentPoint - { - private _color:ColorTransform; - private _life:number; - - constructor(life:number, color:ColorTransform) - { - //0= 1) - throw(new Error("life exceeds range (0,1)")); - this._life = life; - this._color = color; - } - - public get color():ColorTransform - { - return this._color; - } - - public get life():number - { - return this._life; - } - - } - -} diff --git a/src/away/animators/data/JointPose.ts b/src/away/animators/data/JointPose.ts deleted file mode 100644 index 697e6f39b..000000000 --- a/src/away/animators/data/JointPose.ts +++ /dev/null @@ -1,74 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - import Matrix3D = away.geom.Matrix3D; - import Quaternion = away.geom.Quaternion; - - - /** - * Contains transformation data for a skeleton joint, used for skeleton animation. - * - * @see away.animation.Skeleton - * @see away.animation.SkeletonJoint - * - * todo: support (uniform) scale - */ - export class JointPose - { - /** - * The name of the joint to which the pose is associated - */ - public name:string; // intention is that this should be used only at load time, not in the main loop - - /** - * The rotation of the pose stored as a quaternion - */ - public orientation:Quaternion = new Quaternion(); - - /** - * The translation of the pose - */ - public translation:Vector3D = new Vector3D(); - - constructor() - { - - } - - /** - * Converts the transformation to a Matrix3D representation. - * - * @param target An optional target matrix to store the transformation. If not provided, it will create a new instance. - * @return The transformation matrix of the pose. - */ - public toMatrix3D(target:Matrix3D = null):Matrix3D - { - if (target == null) - target = new Matrix3D(); - - this.orientation.toMatrix3D(target); - target.appendTranslation(this.translation.x, this.translation.y, this.translation.z); - return target; - } - - /** - * Copies the transformation data from a source pose object into the existing pose object. - * - * @param pose The source pose to copy from. - */ - public copyFrom(pose:JointPose) - { - var or:Quaternion = pose.orientation; - var tr:Vector3D = pose.translation; - this.orientation.x = or.x; - this.orientation.y = or.y; - this.orientation.z = or.z; - this.orientation.w = or.w; - this.translation.x = tr.x; - this.translation.y = tr.y; - this.translation.z = tr.z; - } - } -} diff --git a/src/away/animators/data/ParticleAnimationData.ts b/src/away/animators/data/ParticleAnimationData.ts deleted file mode 100644 index 1959c7f9b..000000000 --- a/src/away/animators/data/ParticleAnimationData.ts +++ /dev/null @@ -1,30 +0,0 @@ -/// - -module away.animators -{ - /** - * ... - */ - export class ParticleAnimationData - { - public index:number /*uint*/; - public startTime:number; - public totalTime:number; - public duration:number; - public delay:number; - public startVertexIndex:number /*uint*/; - public numVertices:number /*uint*/; - - constructor(index:number /*uint*/, startTime:number, duration:number, delay:number, particle:ParticleData) - { - this.index = index; - this.startTime = startTime; - this.totalTime = duration + delay; - this.duration = duration; - this.delay = delay; - this.startVertexIndex = particle.startVertexIndex; - this.numVertices = particle.numVertices; - } - } - -} diff --git a/src/away/animators/data/ParticleData.ts b/src/away/animators/data/ParticleData.ts deleted file mode 100644 index 71b683c29..000000000 --- a/src/away/animators/data/ParticleData.ts +++ /dev/null @@ -1,15 +0,0 @@ -/// - -module away.animators -{ - import TriangleSubGeometry = away.base.TriangleSubGeometry; - - export class ParticleData - { - public particleIndex:number /*uint*/; - public numVertices:number /*uint*/; - public startVertexIndex:number /*uint*/; - public subGeometry:TriangleSubGeometry; - } - -} \ No newline at end of file diff --git a/src/away/animators/data/ParticleProperties.ts b/src/away/animators/data/ParticleProperties.ts deleted file mode 100644 index 46c145f68..000000000 --- a/src/away/animators/data/ParticleProperties.ts +++ /dev/null @@ -1,42 +0,0 @@ -/// - -module away.animators -{ - - /** - * Dynamic class for holding the local properties of a particle, used for processing the static properties - * of particles in the particle animation set before beginning upload to the GPU. - */ - export class ParticleProperties - { - /** - * The index of the current particle being set. - */ - public index:number /*uint*/; - - /** - * The total number of particles being processed by the particle animation set. - */ - public total:number /*uint*/; - - /** - * The start time of the particle. - */ - public startTime:number; - - /** - * The duration of the particle, an optional value used when the particle aniamtion set settings for useDuration are enabled in the constructor. - * - * @see away.animators.ParticleAnimationSet - */ - public duration:number; - - /** - * The delay between cycles of the particle, an optional value used when the particle aniamtion set settings for useLooping and useDelay are enabled in the constructor. - * - * @see away.animators.ParticleAnimationSet - */ - public delay:number; - } - -} diff --git a/src/away/animators/data/ParticlePropertiesMode.ts b/src/away/animators/data/ParticlePropertiesMode.ts deleted file mode 100644 index a1d646022..000000000 --- a/src/away/animators/data/ParticlePropertiesMode.ts +++ /dev/null @@ -1,26 +0,0 @@ -/// - -module away.animators -{ - - /** - * Options for setting the properties mode of a particle animation node. - */ - export class ParticlePropertiesMode - { - /** - * Mode that defines the particle node as acting on global properties (ie. the properties set in the node constructor or the corresponding animation state). - */ - public static GLOBAL:number /*uint*/ = 0; - - /** - * Mode that defines the particle node as acting on local static properties (ie. the properties of particles set in the initialising on the animation set). - */ - public static LOCAL_STATIC:number /*uint*/ = 1; - - /** - * Mode that defines the particle node as acting on local dynamic properties (ie. the properties of the particles set in the corresponding animation state). - */ - public static LOCAL_DYNAMIC:number /*uint*/ = 2; - } -} diff --git a/src/away/animators/data/Skeleton.ts b/src/away/animators/data/Skeleton.ts deleted file mode 100644 index 63e86a34c..000000000 --- a/src/away/animators/data/Skeleton.ts +++ /dev/null @@ -1,100 +0,0 @@ -/// - -module away.animators -{ - import AssetType = away.library.AssetType; - - /** - * A Skeleton object is a hierarchical grouping of joint objects that can be used for skeletal animation. - * - * @see away.animators.SkeletonJoint - */ - export class Skeleton extends away.library.NamedAssetBase implements away.library.IAsset - { - /** - * A flat list of joint objects that comprise the skeleton. Every joint except for the root has a parentIndex - * property that is an index into this list. - * A child joint should always have a higher index than its parent. - */ - public joints:Array; - - /** - * The total number of joints in the skeleton. - */ - public get numJoints():number /*uint*/ - { - return this.joints.length; - } - - /** - * Creates a new Skeleton object - */ - constructor() - { - super(); - - // in the long run, it might be a better idea to not store Joint objects, but keep all data in Vectors, that we can upload easily? - this.joints = new Array(); - } - - /** - * Returns the joint object in the skeleton with the given name, otherwise returns a null object. - * - * @param jointName The name of the joint object to be found. - * @return The joint object with the given name. - * - * @see #joints - */ - public jointFromName(jointName:string):SkeletonJoint - { - var jointIndex:number /*int*/ = this.jointIndexFromName(jointName); - if (jointIndex != -1) - return this.joints[jointIndex]; else - return null; - } - - /** - * Returns the joint index, given the joint name. -1 is returned if the joint name is not found. - * - * @param jointName The name of the joint object to be found. - * @return The index of the joint object in the joints Array - * - * @see #joints - */ - public jointIndexFromName(jointName:string):number /*int*/ - { - // this is implemented as a linear search, rather than a possibly - // more optimal method (Dictionary lookup, for example) because: - // a) it is assumed that it will be called once for each joint - // b) it is assumed that it will be called only during load, and not during main loop - // c) maintaining a dictionary (for safety) would dictate an interface to access SkeletonJoints, - // rather than direct array access. this would be sub-optimal. - var jointIndex:number /*int*/; - var joint:SkeletonJoint; - for (var i:number /*int*/; i < this.joints.length; i++) { - joint = this.joints[i]; - if (joint.name == jointName) - return jointIndex; - jointIndex++; - } - - return -1; - } - - /** - * @inheritDoc - */ - public dispose() - { - this.joints.length = 0; - } - - /** - * @inheritDoc - */ - public get assetType():string - { - return AssetType.SKELETON; - } - } -} diff --git a/src/away/animators/data/SkeletonJoint.ts b/src/away/animators/data/SkeletonJoint.ts deleted file mode 100644 index 96871ae96..000000000 --- a/src/away/animators/data/SkeletonJoint.ts +++ /dev/null @@ -1,37 +0,0 @@ -/// - -module away.animators -{ - - /** - * A value obect representing a single joint in a skeleton object. - * - * @see away.animators.Skeleton - */ - export class SkeletonJoint - { - /** - * The index of the parent joint in the skeleton's joints vector. - * - * @see away.animators.Skeleton#joints - */ - public parentIndex:number /*int*/ = -1; - - /** - * The name of the joint - */ - public name:string; // intention is that this should be used only at load time, not in the main loop - - /** - * The inverse bind pose matrix, as raw data, used to transform vertices to bind joint space in preparation for transformation using the joint matrix. - */ - public inverseBindPose:Array; - - /** - * Creates a new SkeletonJoint object - */ - constructor() - { - } - } -} diff --git a/src/away/animators/data/SkeletonPose.ts b/src/away/animators/data/SkeletonPose.ts deleted file mode 100644 index 4e191bde8..000000000 --- a/src/away/animators/data/SkeletonPose.ts +++ /dev/null @@ -1,120 +0,0 @@ -/// - -module away.animators -{ - import AssetType = away.library.AssetType; - - /** - * A collection of pose objects, determining the pose for an entire skeleton. - * The jointPoses vector object corresponds to a skeleton's joints vector object, however, there is no - * reference to a skeleton's instance, since several skeletons can be influenced by the same pose (eg: animation - * clips are added to any animator with a valid skeleton) - * - * @see away.animators.Skeleton - * @see away.animators.JointPose - */ - export class SkeletonPose extends away.library.NamedAssetBase implements away.library.IAsset - { - /** - * A flat list of pose objects that comprise the skeleton pose. The pose indices correspond to the target skeleton's joint indices. - * - * @see away.animators.Skeleton#joints - */ - public jointPoses:Array; - - /** - * The total number of joint poses in the skeleton pose. - */ - public get numJointPoses():number /*uint*/ - { - return this.jointPoses.length; - } - - /** - * Creates a new SkeletonPose object. - */ - constructor() - { - super(); - - this.jointPoses = new Array(); - } - - /** - * @inheritDoc - */ - public get assetType():string - { - return AssetType.SKELETON_POSE; - } - - /** - * Returns the joint pose object with the given joint name, otherwise returns a null object. - * - * @param jointName The name of the joint object whose pose is to be found. - * @return The pose object with the given joint name. - */ - public jointPoseFromName(jointName:string):JointPose - { - var jointPoseIndex:number /*int*/ = this.jointPoseIndexFromName(jointName); - if (jointPoseIndex != -1) - return this.jointPoses[jointPoseIndex]; else - return null; - } - - /** - * Returns the pose index, given the joint name. -1 is returned if the joint name is not found in the pose. - * - * @param The name of the joint object whose pose is to be found. - * @return The index of the pose object in the jointPoses Array - * - * @see #jointPoses - */ - public jointPoseIndexFromName(jointName:string):number /*int*/ - { - // this is implemented as a linear search, rather than a possibly - // more optimal method (Dictionary lookup, for example) because: - // a) it is assumed that it will be called once for each joint - // b) it is assumed that it will be called only during load, and not during main loop - // c) maintaining a dictionary (for safety) would dictate an interface to access JointPoses, - // rather than direct array access. this would be sub-optimal. - var jointPoseIndex:number /*int*/; - var jointPose:JointPose; - for (var i:number /*uint*/; i < this.jointPoses.length; i++) { - jointPose = this.jointPoses[i]; - if (jointPose.name == jointName) - return jointPoseIndex; - jointPoseIndex++; - } - - return -1; - } - - /** - * Creates a copy of the SkeletonPose object, with a dulpicate of its component joint poses. - * - * @return SkeletonPose - */ - public clone():SkeletonPose - { - var clone:SkeletonPose = new SkeletonPose(); - var numJointPoses:number /*uint*/ = this.jointPoses.length; - for (var i:number /*uint*/ = 0; i < numJointPoses; i++) { - var cloneJointPose:JointPose = new JointPose(); - var thisJointPose:JointPose = this.jointPoses[i]; - cloneJointPose.name = thisJointPose.name; - cloneJointPose.copyFrom(thisJointPose); - clone.jointPoses[i] = cloneJointPose; - } - return clone; - } - - /** - * @inheritDoc - */ - public dispose() - { - this.jointPoses.length = 0; - } - } -} diff --git a/src/away/animators/data/VertexAnimationMode.ts b/src/away/animators/data/VertexAnimationMode.ts deleted file mode 100644 index 008c0caff..000000000 --- a/src/away/animators/data/VertexAnimationMode.ts +++ /dev/null @@ -1,23 +0,0 @@ -/// - -module away.animators -{ - - /** - * Options for setting the animation mode of a vertex animator object. - * - * @see away.animators.VertexAnimator - */ - export class VertexAnimationMode - { - /** - * Animation mode that adds all outputs from active vertex animation state to form the current vertex animation pose. - */ - public static ADDITIVE:string = "additive"; - - /** - * Animation mode that picks the output from a single vertex animation state to form the current vertex animation pose. - */ - public static ABSOLUTE:string = "absolute"; - } -} diff --git a/src/away/animators/nodes/AnimationClipNodeBase.ts b/src/away/animators/nodes/AnimationClipNodeBase.ts deleted file mode 100644 index a99eaf08a..000000000 --- a/src/away/animators/nodes/AnimationClipNodeBase.ts +++ /dev/null @@ -1,118 +0,0 @@ -/// - -module away.animators -{ - /** - * Provides an abstract base class for nodes with time-based animation data in an animation blend tree. - */ - export class AnimationClipNodeBase extends AnimationNodeBase - { - public _pLooping:boolean = true; - public _pTotalDuration:number /*uint*/ = 0; - public _pLastFrame:number /*uint*/; - - public _pStitchDirty:boolean = true; - public _pStitchFinalFrame:boolean = false; - public _pNumFrames:number /*uint*/ = 0; - - public _pDurations:Array = new Array(); - /*uint*/ - public _pTotalDelta:away.geom.Vector3D = new away.geom.Vector3D(); - - public fixedFrameRate:boolean = true; - - /** - * Determines whether the contents of the animation node have looping characteristics enabled. - */ - public get looping():boolean - { - return this._pLooping; - } - - public set looping(value:boolean) - { - if (this._pLooping == value) - return; - - this._pLooping = value; - - this._pStitchDirty = true; - } - - /** - * Defines if looping content blends the final frame of animation data with the first (true) or works on the - * assumption that both first and last frames are identical (false). Defaults to false. - */ - public get stitchFinalFrame():boolean - { - return this._pStitchFinalFrame; - } - - public set stitchFinalFrame(value:boolean) - { - if (this._pStitchFinalFrame == value) - return; - - this._pStitchFinalFrame = value; - - this._pStitchDirty = true; - } - - public get totalDuration():number /*uint*/ - { - if (this._pStitchDirty) - this._pUpdateStitch(); - - return this._pTotalDuration; - } - - public get totalDelta():away.geom.Vector3D - { - if (this._pStitchDirty) - this._pUpdateStitch(); - - return this._pTotalDelta; - } - - public get lastFrame():number /*uint*/ - { - if (this._pStitchDirty) - this._pUpdateStitch(); - - return this._pLastFrame; - } - - /** - * Returns a vector of time values representing the duration (in milliseconds) of each animation frame in the clip. - */ - public get durations():Array /*uint*/ - { - return this._pDurations; - } - - /** - * Creates a new AnimationClipNodeBase object. - */ - constructor() - { - super(); - } - - /** - * Updates the node's final frame stitch state. - * - * @see #stitchFinalFrame - */ - public _pUpdateStitch() - { - this._pStitchDirty = false; - - this._pLastFrame = (this._pStitchFinalFrame)? this._pNumFrames : this._pNumFrames - 1; - - this._pTotalDuration = 0; - this._pTotalDelta.x = 0; - this._pTotalDelta.y = 0; - this._pTotalDelta.z = 0; - } - } -} diff --git a/src/away/animators/nodes/ParticleAccelerationNode.ts b/src/away/animators/nodes/ParticleAccelerationNode.ts deleted file mode 100644 index 7c8178cf2..000000000 --- a/src/away/animators/nodes/ParticleAccelerationNode.ts +++ /dev/null @@ -1,88 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used to apply a constant acceleration vector to the motion of a particle. - */ - export class ParticleAccelerationNode extends ParticleNodeBase - { - /** @private */ - public static ACCELERATION_INDEX:number /*int*/ = 0; - - /** @private */ - public _acceleration:Vector3D; - - /** - * Reference for acceleration node properties on a single particle (when in local property mode). - * Expects a Vector3D object representing the direction of acceleration on the particle. - */ - public static ACCELERATION_VECTOR3D:string = "AccelerationVector3D"; - - /** - * Creates a new ParticleAccelerationNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] acceleration Defines the default acceleration vector of the node, used when in global mode. - */ - constructor(mode:number /*uint*/, acceleration:Vector3D = null) - { - super("ParticleAcceleration", mode, 3); - - this._pStateClass = ParticleAccelerationState; - - this._acceleration = acceleration || new Vector3D(); - } - - /** - * @inheritDoc - */ - public pGetAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string - { - var accelerationValue:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleAccelerationNode.ACCELERATION_INDEX, accelerationValue.index); - - var temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(temp, 1); - - var code:string = "mul " + temp + "," + animationRegisterCache.vertexTime + "," + accelerationValue + "\n"; - - if (animationRegisterCache.needVelocity) { - var temp2:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - code += "mul " + temp2 + "," + temp + "," + animationRegisterCache.vertexTwoConst + "\n"; - code += "add " + animationRegisterCache.velocityTarget + ".xyz," + temp2 + ".xyz," + animationRegisterCache.velocityTarget + ".xyz\n"; - } - animationRegisterCache.removeVertexTempUsage(temp); - - code += "mul " + temp + "," + temp + "," + animationRegisterCache.vertexTime + "\n"; - code += "add " + animationRegisterCache.positionTarget + ".xyz," + temp + "," + animationRegisterCache.positionTarget + ".xyz\n"; - return code; - } - - /** - * @inheritDoc - */ - public getAnimationState(animator:AnimatorBase):ParticleAccelerationState - { - return animator.getAnimationState(this); - } - - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param:ParticleProperties) - { - var tempAcceleration:Vector3D = param[ParticleAccelerationNode.ACCELERATION_VECTOR3D]; - if (!tempAcceleration) - throw new Error("there is no " + ParticleAccelerationNode.ACCELERATION_VECTOR3D + " in param!"); - - this._pOneData[0] = tempAcceleration.x/2; - this._pOneData[1] = tempAcceleration.y/2; - this._pOneData[2] = tempAcceleration.z/2; - } - } -} diff --git a/src/away/animators/nodes/ParticleBezierCurveNode.ts b/src/away/animators/nodes/ParticleBezierCurveNode.ts deleted file mode 100644 index 74d2eb12b..000000000 --- a/src/away/animators/nodes/ParticleBezierCurveNode.ts +++ /dev/null @@ -1,128 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used to control the position of a particle over time along a bezier curve. - */ - export class ParticleBezierCurveNode extends ParticleNodeBase - { - /** @private */ - public static BEZIER_CONTROL_INDEX:number /*int*/ = 0; - - /** @private */ - public static BEZIER_END_INDEX:number /*int*/ = 1; - - /** @private */ - public _iControlPoint:Vector3D; - /** @private */ - public _iEndPoint:Vector3D; - - /** - * Reference for bezier curve node properties on a single particle (when in local property mode). - * Expects a Vector3D object representing the control point position (0, 1, 2) of the curve. - */ - public static BEZIER_CONTROL_VECTOR3D:string = "BezierControlVector3D"; - - /** - * Reference for bezier curve node properties on a single particle (when in local property mode). - * Expects a Vector3D object representing the end point position (0, 1, 2) of the curve. - */ - public static BEZIER_END_VECTOR3D:string = "BezierEndVector3D"; - - /** - * Creates a new ParticleBezierCurveNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] controlPoint Defines the default control point of the node, used when in global mode. - * @param [optional] endPoint Defines the default end point of the node, used when in global mode. - */ - constructor(mode:number /*uint*/, controlPoint:Vector3D = null, endPoint:Vector3D = null) - { - super("ParticleBezierCurve", mode, 6); - - this._pStateClass = ParticleBezierCurveState; - - this._iControlPoint = controlPoint || new Vector3D(); - this._iEndPoint = endPoint || new Vector3D(); - } - - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string - { - var controlValue:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleBezierCurveNode.BEZIER_CONTROL_INDEX, controlValue.index); - - var endValue:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleBezierCurveNode.BEZIER_END_INDEX, endValue.index); - - var temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - var rev_time:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 0); - var time_2:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 1); - var time_temp:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 2); - animationRegisterCache.addVertexTempUsages(temp, 1); - var temp2:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - var distance:ShaderRegisterElement = new ShaderRegisterElement(temp2.regName, temp2.index); - animationRegisterCache.removeVertexTempUsage(temp); - - var code:string = ""; - code += "sub " + rev_time + "," + animationRegisterCache.vertexOneConst + "," + animationRegisterCache.vertexLife + "\n"; - code += "mul " + time_2 + "," + animationRegisterCache.vertexLife + "," + animationRegisterCache.vertexLife + "\n"; - - code += "mul " + time_temp + "," + animationRegisterCache.vertexLife + "," + rev_time + "\n"; - code += "mul " + time_temp + "," + time_temp + "," + animationRegisterCache.vertexTwoConst + "\n"; - code += "mul " + distance + ".xyz," + time_temp + "," + controlValue + "\n"; - code += "add " + animationRegisterCache.positionTarget + ".xyz," + distance + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; - code += "mul " + distance + ".xyz," + time_2 + "," + endValue + "\n"; - code += "add " + animationRegisterCache.positionTarget + ".xyz," + distance + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; - - if (animationRegisterCache.needVelocity) { - code += "mul " + time_2 + "," + animationRegisterCache.vertexLife + "," + animationRegisterCache.vertexTwoConst + "\n"; - code += "sub " + time_temp + "," + animationRegisterCache.vertexOneConst + "," + time_2 + "\n"; - code += "mul " + time_temp + "," + animationRegisterCache.vertexTwoConst + "," + time_temp + "\n"; - code += "mul " + distance + ".xyz," + controlValue + "," + time_temp + "\n"; - code += "add " + animationRegisterCache.velocityTarget + ".xyz," + distance + ".xyz," + animationRegisterCache.velocityTarget + ".xyz\n"; - code += "mul " + distance + ".xyz," + endValue + "," + time_2 + "\n"; - code += "add " + animationRegisterCache.velocityTarget + ".xyz," + distance + ".xyz," + animationRegisterCache.velocityTarget + ".xyz\n"; - } - - return code; - } - - /** - * @inheritDoc - */ - public getAnimationState(animator:AnimatorBase):ParticleBezierCurveState - { - return animator.getAnimationState(this); - } - - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param:ParticleProperties) - { - var bezierControl:Vector3D = param[ParticleBezierCurveNode.BEZIER_CONTROL_VECTOR3D]; - if (!bezierControl) - throw new Error("there is no " + ParticleBezierCurveNode.BEZIER_CONTROL_VECTOR3D + " in param!"); - - var bezierEnd:Vector3D = param[ParticleBezierCurveNode.BEZIER_END_VECTOR3D]; - if (!bezierEnd) - throw new Error("there is no " + ParticleBezierCurveNode.BEZIER_END_VECTOR3D + " in param!"); - - this._pOneData[0] = bezierControl.x; - this._pOneData[1] = bezierControl.y; - this._pOneData[2] = bezierControl.z; - this._pOneData[3] = bezierEnd.x; - this._pOneData[4] = bezierEnd.y; - this._pOneData[5] = bezierEnd.z; - } - } - -} diff --git a/src/away/animators/nodes/ParticleBillboardNode.ts b/src/away/animators/nodes/ParticleBillboardNode.ts deleted file mode 100644 index 074cba364..000000000 --- a/src/away/animators/nodes/ParticleBillboardNode.ts +++ /dev/null @@ -1,74 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node that controls the rotation of a particle to always face the camera. - */ - export class ParticleBillboardNode extends ParticleNodeBase - { - /** @private */ - public static MATRIX_INDEX:number /*int*/ = 0; - - /** @private */ - public _iBillboardAxis:Vector3D; - - /** - * Creates a new ParticleBillboardNode - */ - constructor(billboardAxis:Vector3D = null) - { - super("ParticleBillboard", ParticlePropertiesMode.GLOBAL, 0, 4); - - this._pStateClass = ParticleBillboardState; - - this._iBillboardAxis = billboardAxis; - } - - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string - { - var rotationMatrixRegister:ShaderRegisterElement = animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.setRegisterIndex(this, ParticleBillboardNode.MATRIX_INDEX, rotationMatrixRegister.index); - animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.getFreeVertexConstant(); - - var temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - - var code:string = "m33 " + temp + ".xyz," + animationRegisterCache.scaleAndRotateTarget + "," + rotationMatrixRegister + "\n" + - "mov " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp + "\n"; - - var shaderRegisterElement:ShaderRegisterElement; - for (var i:number /*uint*/ = 0; i < animationRegisterCache.rotationRegisters.length; i++) { - shaderRegisterElement = animationRegisterCache.rotationRegisters[i]; - code += "m33 " + temp + ".xyz," + shaderRegisterElement + "," + rotationMatrixRegister + "\n" + - "mov " + shaderRegisterElement + ".xyz," + shaderRegisterElement + "\n"; - } - - return code; - } - - /** - * @inheritDoc - */ - public getAnimationState(animator:AnimatorBase):ParticleBillboardState - { - return animator.getAnimationState(this); - } - - /** - * @inheritDoc - */ - public _iProcessAnimationSetting(particleAnimationSet:ParticleAnimationSet) - { - particleAnimationSet.hasBillboard = true; - } - } -} diff --git a/src/away/animators/nodes/ParticleColorNode.ts b/src/away/animators/nodes/ParticleColorNode.ts deleted file mode 100644 index 2aedd74a0..000000000 --- a/src/away/animators/nodes/ParticleColorNode.ts +++ /dev/null @@ -1,229 +0,0 @@ -/// - -module away.animators -{ - import ColorTransform = away.geom.ColorTransform; - import Vector3D = away.geom.Vector3D; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used to control the color variation of a particle over time. - */ - export class ParticleColorNode extends ParticleNodeBase - { - /** @private */ - public static START_MULTIPLIER_INDEX:number /*uint*/ = 0; - - /** @private */ - public static DELTA_MULTIPLIER_INDEX:number /*uint*/ = 1; - - /** @private */ - public static START_OFFSET_INDEX:number /*uint*/ = 2; - - /** @private */ - public static DELTA_OFFSET_INDEX:number /*uint*/ = 3; - - /** @private */ - public static CYCLE_INDEX:number /*uint*/ = 4; - - //default values used when creating states - /** @private */ - public _iUsesMultiplier:boolean; - /** @private */ - public _iUsesOffset:boolean; - /** @private */ - public _iUsesCycle:boolean; - /** @private */ - public _iUsesPhase:boolean; - /** @private */ - public _iStartColor:ColorTransform; - /** @private */ - public _iEndColor:ColorTransform; - /** @private */ - public _iCycleDuration:number; - /** @private */ - public _iCyclePhase:number; - - /** - * Reference for color node properties on a single particle (when in local property mode). - * Expects a ColorTransform object representing the start color transform applied to the particle. - */ - public static COLOR_START_COLORTRANSFORM:string = "ColorStartColorTransform"; - - /** - * Reference for color node properties on a single particle (when in local property mode). - * Expects a ColorTransform object representing the end color transform applied to the particle. - */ - public static COLOR_END_COLORTRANSFORM:string = "ColorEndColorTransform"; - - /** - * Creates a new ParticleColorNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] usesMultiplier Defines whether the node uses multiplier data in the shader for its color transformations. Defaults to true. - * @param [optional] usesOffset Defines whether the node uses offset data in the shader for its color transformations. Defaults to true. - * @param [optional] usesCycle Defines whether the node uses the cycleDuration property in the shader to calculate the period of the animation independent of particle duration. Defaults to false. - * @param [optional] usesPhase Defines whether the node uses the cyclePhase property in the shader to calculate a starting offset to the cycle rotation of the particle. Defaults to false. - * @param [optional] startColor Defines the default start color transform of the node, when in global mode. - * @param [optional] endColor Defines the default end color transform of the node, when in global mode. - * @param [optional] cycleDuration Defines the duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. - * @param [optional] cyclePhase Defines the phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. - */ - constructor(mode:number /*uint*/, usesMultiplier:boolean = true, usesOffset:boolean = true, usesCycle:boolean = false, usesPhase:boolean = false, startColor:ColorTransform = null, endColor:ColorTransform = null, cycleDuration:number = 1, cyclePhase:number = 0) - { - super("ParticleColor", mode, (usesMultiplier && usesOffset)? 16 : 8, ParticleAnimationSet.COLOR_PRIORITY); - - this._pStateClass = ParticleColorState; - - this._iUsesMultiplier = usesMultiplier; - this._iUsesOffset = usesOffset; - this._iUsesCycle = usesCycle; - this._iUsesPhase = usesPhase; - - this._iStartColor = startColor || new ColorTransform(); - this._iEndColor = endColor || new ColorTransform(); - this._iCycleDuration = cycleDuration; - this._iCyclePhase = cyclePhase; - } - - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string - { - var code:string = ""; - if (animationRegisterCache.needFragmentAnimation) { - var temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - - if (this._iUsesCycle) { - var cycleConst:ShaderRegisterElement = animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.setRegisterIndex(this, ParticleColorNode.CYCLE_INDEX, cycleConst.index); - - animationRegisterCache.addVertexTempUsages(temp, 1); - var sin:ShaderRegisterElement = animationRegisterCache.getFreeVertexSingleTemp(); - animationRegisterCache.removeVertexTempUsage(temp); - - code += "mul " + sin + "," + animationRegisterCache.vertexTime + "," + cycleConst + ".x\n"; - - if (this._iUsesPhase) - code += "add " + sin + "," + sin + "," + cycleConst + ".y\n"; - - code += "sin " + sin + "," + sin + "\n"; - } - - if (this._iUsesMultiplier) { - var startMultiplierValue:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - var deltaMultiplierValue:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - - animationRegisterCache.setRegisterIndex(this, ParticleColorNode.START_MULTIPLIER_INDEX, startMultiplierValue.index); - animationRegisterCache.setRegisterIndex(this, ParticleColorNode.DELTA_MULTIPLIER_INDEX, deltaMultiplierValue.index); - - code += "mul " + temp + "," + deltaMultiplierValue + "," + (this._iUsesCycle? sin : animationRegisterCache.vertexLife) + "\n"; - code += "add " + temp + "," + temp + "," + startMultiplierValue + "\n"; - code += "mul " + animationRegisterCache.colorMulTarget + "," + temp + "," + animationRegisterCache.colorMulTarget + "\n"; - } - - if (this._iUsesOffset) { - var startOffsetValue:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.LOCAL_STATIC)? animationRegisterCache.getFreeVertexAttribute() : animationRegisterCache.getFreeVertexConstant(); - var deltaOffsetValue:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.LOCAL_STATIC)? animationRegisterCache.getFreeVertexAttribute() : animationRegisterCache.getFreeVertexConstant(); - - animationRegisterCache.setRegisterIndex(this, ParticleColorNode.START_OFFSET_INDEX, startOffsetValue.index); - animationRegisterCache.setRegisterIndex(this, ParticleColorNode.DELTA_OFFSET_INDEX, deltaOffsetValue.index); - - code += "mul " + temp + "," + deltaOffsetValue + "," + (this._iUsesCycle? sin : animationRegisterCache.vertexLife) + "\n"; - code += "add " + temp + "," + temp + "," + startOffsetValue + "\n"; - code += "add " + animationRegisterCache.colorAddTarget + "," + temp + "," + animationRegisterCache.colorAddTarget + "\n"; - } - } - - return code; - } - - /** - * @inheritDoc - */ - public getAnimationState(animator:AnimatorBase):ParticleColorState - { - return animator.getAnimationState(this); - } - - /** - * @inheritDoc - */ - public _iProcessAnimationSetting(particleAnimationSet:ParticleAnimationSet) - { - if (this._iUsesMultiplier) - particleAnimationSet.hasColorMulNode = true; - if (this._iUsesOffset) - particleAnimationSet.hasColorAddNode = true; - } - - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param:ParticleProperties) - { - var startColor:ColorTransform = param[ParticleColorNode.COLOR_START_COLORTRANSFORM]; - if (!startColor) - throw(new Error("there is no " + ParticleColorNode.COLOR_START_COLORTRANSFORM + " in param!")); - - var endColor:ColorTransform = param[ParticleColorNode.COLOR_END_COLORTRANSFORM]; - if (!endColor) - throw(new Error("there is no " + ParticleColorNode.COLOR_END_COLORTRANSFORM + " in param!")); - - var i:number /*uint*/ = 0; - - if (!this._iUsesCycle) { - //multiplier - if (this._iUsesMultiplier) { - this._pOneData[i++] = startColor.redMultiplier; - this._pOneData[i++] = startColor.greenMultiplier; - this._pOneData[i++] = startColor.blueMultiplier; - this._pOneData[i++] = startColor.alphaMultiplier; - this._pOneData[i++] = endColor.redMultiplier - startColor.redMultiplier; - this._pOneData[i++] = endColor.greenMultiplier - startColor.greenMultiplier; - this._pOneData[i++] = endColor.blueMultiplier - startColor.blueMultiplier; - this._pOneData[i++] = endColor.alphaMultiplier - startColor.alphaMultiplier; - } - - //offset - if (this._iUsesOffset) { - this._pOneData[i++] = startColor.redOffset/255; - this._pOneData[i++] = startColor.greenOffset/255; - this._pOneData[i++] = startColor.blueOffset/255; - this._pOneData[i++] = startColor.alphaOffset/255; - this._pOneData[i++] = (endColor.redOffset - startColor.redOffset)/255; - this._pOneData[i++] = (endColor.greenOffset - startColor.greenOffset)/255; - this._pOneData[i++] = (endColor.blueOffset - startColor.blueOffset)/255; - this._pOneData[i++] = (endColor.alphaOffset - startColor.alphaOffset)/255; - } - } else { - //multiplier - if (this._iUsesMultiplier) { - this._pOneData[i++] = (startColor.redMultiplier + endColor.redMultiplier)/2; - this._pOneData[i++] = (startColor.greenMultiplier + endColor.greenMultiplier)/2; - this._pOneData[i++] = (startColor.blueMultiplier + endColor.blueMultiplier)/2; - this._pOneData[i++] = (startColor.alphaMultiplier + endColor.alphaMultiplier)/2; - this._pOneData[i++] = (startColor.redMultiplier - endColor.redMultiplier)/2; - this._pOneData[i++] = (startColor.greenMultiplier - endColor.greenMultiplier)/2; - this._pOneData[i++] = (startColor.blueMultiplier - endColor.blueMultiplier)/2; - this._pOneData[i++] = (startColor.alphaMultiplier - endColor.alphaMultiplier)/2; - } - - //offset - if (this._iUsesOffset) { - this._pOneData[i++] = (startColor.redOffset + endColor.redOffset)/(255*2); - this._pOneData[i++] = (startColor.greenOffset + endColor.greenOffset)/(255*2); - this._pOneData[i++] = (startColor.blueOffset + endColor.blueOffset)/(255*2); - this._pOneData[i++] = (startColor.alphaOffset + endColor.alphaOffset)/(255*2); - this._pOneData[i++] = (startColor.redOffset - endColor.redOffset)/(255*2); - this._pOneData[i++] = (startColor.greenOffset - endColor.greenOffset)/(255*2); - this._pOneData[i++] = (startColor.blueOffset - endColor.blueOffset)/(255*2); - this._pOneData[i++] = (startColor.alphaOffset - endColor.alphaOffset)/(255*2); - } - } - - } - } -} diff --git a/src/away/animators/nodes/ParticleFollowNode.ts b/src/away/animators/nodes/ParticleFollowNode.ts deleted file mode 100644 index 4b397a9a4..000000000 --- a/src/away/animators/nodes/ParticleFollowNode.ts +++ /dev/null @@ -1,155 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used to create a follow behaviour on a particle system. - */ - export class ParticleFollowNode extends ParticleNodeBase - { - /** @private */ - public static FOLLOW_POSITION_INDEX:number /*uint*/ = 0; - - /** @private */ - public static FOLLOW_ROTATION_INDEX:number /*uint*/ = 1; - - /** @private */ - public _iUsesPosition:boolean; - - /** @private */ - public _iUsesRotation:boolean; - - /** @private */ - public _iSmooth:boolean; - - /** - * Creates a new ParticleFollowNode - * - * @param [optional] usesPosition Defines wehether the individual particle reacts to the position of the target. - * @param [optional] usesRotation Defines wehether the individual particle reacts to the rotation of the target. - * @param [optional] smooth Defines wehether the state calculate the interpolated value. - */ - constructor(usesPosition:boolean = true, usesRotation:boolean = true, smooth:boolean = false) - { - super("ParticleFollow", ParticlePropertiesMode.LOCAL_DYNAMIC, (usesPosition && usesRotation)? 6 : 3, ParticleAnimationSet.POST_PRIORITY); - - this._pStateClass = ParticleFollowState; - - this._iUsesPosition = usesPosition; - this._iUsesRotation = usesRotation; - this._iSmooth = smooth; - - } - - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string - { - //TODO: use Quaternion to implement this function - var code:string = ""; - if (this._iUsesRotation) { - var rotationAttribute:ShaderRegisterElement = animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleFollowNode.FOLLOW_ROTATION_INDEX, rotationAttribute.index); - - var temp1:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(temp1, 1); - var temp2:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(temp2, 1); - var temp3:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - - var temp4:ShaderRegisterElement; - if (animationRegisterCache.hasBillboard) { - animationRegisterCache.addVertexTempUsages(temp3, 1); - temp4 = animationRegisterCache.getFreeVertexVectorTemp(); - } - - animationRegisterCache.removeVertexTempUsage(temp1); - animationRegisterCache.removeVertexTempUsage(temp2); - if (animationRegisterCache.hasBillboard) - animationRegisterCache.removeVertexTempUsage(temp3); - - var len:number /*int*/ = animationRegisterCache.rotationRegisters.length; - var i:number /*int*/; - - //x axis - code += "mov " + temp1 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp1 + ".x," + animationRegisterCache.vertexOneConst + "\n"; - code += "mov " + temp3 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "sin " + temp3 + ".y," + rotationAttribute + ".x\n"; - code += "cos " + temp3 + ".z," + rotationAttribute + ".x\n"; - code += "mov " + temp2 + ".x," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp2 + ".y," + temp3 + ".z\n"; - code += "neg " + temp2 + ".z," + temp3 + ".y\n"; - - if (animationRegisterCache.hasBillboard) - code += "m33 " + temp4 + ".xyz," + animationRegisterCache.positionTarget + ".xyz," + temp1 + "\n"; - else { - code += "m33 " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp1 + "\n"; - for (i = 0; i < len; i++) - code += "m33 " + animationRegisterCache.rotationRegisters[i] + ".xyz," + animationRegisterCache.rotationRegisters[i] + "," + temp1 + "\n"; - } - - //y axis - code += "mov " + temp1 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "cos " + temp1 + ".x," + rotationAttribute + ".y\n"; - code += "sin " + temp1 + ".z," + rotationAttribute + ".y\n"; - code += "mov " + temp2 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp2 + ".y," + animationRegisterCache.vertexOneConst + "\n"; - code += "mov " + temp3 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "neg " + temp3 + ".x," + temp1 + ".z\n"; - code += "mov " + temp3 + ".z," + temp1 + ".x\n"; - - if (animationRegisterCache.hasBillboard) - code += "m33 " + temp4 + ".xyz," + temp4 + ".xyz," + temp1 + "\n"; - else { - code += "m33 " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp1 + "\n"; - for (i = 0; i < len; i++) - code += "m33 " + animationRegisterCache.rotationRegisters[i] + ".xyz," + animationRegisterCache.rotationRegisters[i] + "," + temp1 + "\n"; - } - - //z axis - code += "mov " + temp2 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "sin " + temp2 + ".x," + rotationAttribute + ".z\n"; - code += "cos " + temp2 + ".y," + rotationAttribute + ".z\n"; - code += "mov " + temp1 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp1 + ".x," + temp2 + ".y\n"; - code += "neg " + temp1 + ".y," + temp2 + ".x\n"; - code += "mov " + temp3 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp3 + ".z," + animationRegisterCache.vertexOneConst + "\n"; - - if (animationRegisterCache.hasBillboard) { - code += "m33 " + temp4 + ".xyz," + temp4 + ".xyz," + temp1 + "\n"; - code += "sub " + temp4 + ".xyz," + temp4 + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; - code += "add " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp4 + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; - } else { - code += "m33 " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp1 + "\n"; - for (i = 0; i < len; i++) - code += "m33 " + animationRegisterCache.rotationRegisters[i] + ".xyz," + animationRegisterCache.rotationRegisters[i] + "," + temp1 + "\n"; - } - - } - - if (this._iUsesPosition) { - var positionAttribute:ShaderRegisterElement = animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleFollowNode.FOLLOW_POSITION_INDEX, positionAttribute.index); - code += "add " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + positionAttribute + "," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; - } - - return code; - } - - /** - * @inheritDoc - */ - public getAnimationState(animator:AnimatorBase):ParticleFollowState - { - return animator.getAnimationState(this); - } - } - -} diff --git a/src/away/animators/nodes/ParticleInitialColorNode.ts b/src/away/animators/nodes/ParticleInitialColorNode.ts deleted file mode 100644 index 052dffda9..000000000 --- a/src/away/animators/nodes/ParticleInitialColorNode.ts +++ /dev/null @@ -1,109 +0,0 @@ -/// - -module away.animators -{ - import ColorTransform = away.geom.ColorTransform; - import Vector3D = away.geom.Vector3D; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import ShaderRegisterElement = away.materials.ShaderRegisterElement; - - export class ParticleInitialColorNode extends ParticleNodeBase - { - /** @private */ - public static MULTIPLIER_INDEX:number /*uint*/ = 0; - /** @private */ - public static OFFSET_INDEX:number /*uint*/ = 1; - - //default values used when creating states - /** @private */ - public _iUsesMultiplier:boolean; - /** @private */ - public _iUsesOffset:boolean; - /** @private */ - public _iInitialColor:ColorTransform; - - /** - * Reference for color node properties on a single particle (when in local property mode). - * Expects a ColorTransform object representing the color transform applied to the particle. - */ - public static COLOR_INITIAL_COLORTRANSFORM:string = "ColorInitialColorTransform"; - - constructor(mode:number /*uint*/, usesMultiplier:boolean = true, usesOffset:boolean = false, initialColor:ColorTransform = null) - { - super("ParticleInitialColor", mode, (usesMultiplier && usesOffset)? 8 : 4, ParticleAnimationSet.COLOR_PRIORITY); - - this._pStateClass = ParticleInitialColorState; - - this._iUsesMultiplier = usesMultiplier; - this._iUsesOffset = usesOffset; - this._iInitialColor = initialColor || new ColorTransform(); - } - - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string - { - var code:string = ""; - if (animationRegisterCache.needFragmentAnimation) { - - if (this._iUsesMultiplier) { - var multiplierValue:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleInitialColorNode.MULTIPLIER_INDEX, multiplierValue.index); - - code += "mul " + animationRegisterCache.colorMulTarget + "," + multiplierValue + "," + animationRegisterCache.colorMulTarget + "\n"; - } - - if (this._iUsesOffset) { - var offsetValue:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.LOCAL_STATIC)? animationRegisterCache.getFreeVertexAttribute() : animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.setRegisterIndex(this, ParticleInitialColorNode.OFFSET_INDEX, offsetValue.index); - - code += "add " + animationRegisterCache.colorAddTarget + "," + offsetValue + "," + animationRegisterCache.colorAddTarget + "\n"; - } - } - - return code; - } - - /** - * @inheritDoc - */ - public _iProcessAnimationSetting(particleAnimationSet:ParticleAnimationSet) - { - if (this._iUsesMultiplier) - particleAnimationSet.hasColorMulNode = true; - if (this._iUsesOffset) - particleAnimationSet.hasColorAddNode = true; - } - - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param:ParticleProperties) - { - var initialColor:ColorTransform = param[ParticleInitialColorNode.COLOR_INITIAL_COLORTRANSFORM]; - if (!initialColor) - throw(new Error("there is no " + ParticleInitialColorNode.COLOR_INITIAL_COLORTRANSFORM + " in param!")); - - var i:number /*uint*/ = 0; - - //multiplier - if (this._iUsesMultiplier) { - this._pOneData[i++] = initialColor.redMultiplier; - this._pOneData[i++] = initialColor.greenMultiplier; - this._pOneData[i++] = initialColor.blueMultiplier; - this._pOneData[i++] = initialColor.alphaMultiplier; - } - //offset - if (this._iUsesOffset) { - this._pOneData[i++] = initialColor.redOffset/255; - this._pOneData[i++] = initialColor.greenOffset/255; - this._pOneData[i++] = initialColor.blueOffset/255; - this._pOneData[i++] = initialColor.alphaOffset/255; - } - - } - - } - -} diff --git a/src/away/animators/nodes/ParticleNodeBase.ts b/src/away/animators/nodes/ParticleNodeBase.ts deleted file mode 100644 index 788a6668a..000000000 --- a/src/away/animators/nodes/ParticleNodeBase.ts +++ /dev/null @@ -1,142 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * Provides an abstract base class for particle animation nodes. - */ - export class ParticleNodeBase extends AnimationNodeBase - { - private _priority:number /*int*/; - - public _pMode:number /*uint*/; - public _pDataLength:number /*uint*/ = 3; - public _pOneData:Array; - - public _iDataOffset:number /*uint*/; - - //modes alias - private static GLOBAL:string = 'Global'; - private static LOCAL_STATIC:string = 'LocalStatic'; - private static LOCAL_DYNAMIC:string = 'LocalDynamic'; - - //modes list - private static MODES:Object = - { - 0:ParticleNodeBase.GLOBAL, - 1:ParticleNodeBase.LOCAL_STATIC, - 2:ParticleNodeBase.LOCAL_DYNAMIC - }; - - /** - * Returns the property mode of the particle animation node. Typically set in the node constructor - * - * @see away.animators.ParticlePropertiesMode - */ - public get mode():number /*uint*/ - { - return this._pMode; - } - - /** - * Returns the priority of the particle animation node, used to order the agal generated in a particle animation set. Set automatically on instantiation. - * - * @see away.animators.ParticleAnimationSet - * @see #getAGALVertexCode - */ - public get priority():number /*int*/ - { - return this._priority; - } - - /** - * Returns the length of the data used by the node when in LOCAL_STATIC mode. Used to generate the local static data of the particle animation set. - * - * @see away.animators.ParticleAnimationSet - * @see #getAGALVertexCode - */ - public get dataLength():number /*int*/ - { - return this._pDataLength; - } - - /** - * Returns the generated data vector of the node after one particle pass during the generation of all local static data of the particle animation set. - * - * @see away.animators.ParticleAnimationSet - * @see #generatePropertyOfOneParticle - */ - public get oneData():Array - { - return this._pOneData; - } - - /** - * Creates a new ParticleNodeBase object. - * - * @param name Defines the generic name of the particle animation node. - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param dataLength Defines the length of the data used by the node when in LOCAL_STATIC mode. - * @param [optional] priority the priority of the particle animation node, used to order the agal generated in a particle animation set. Defaults to 1. - */ - constructor(name:string, mode:number /*uint*/, dataLength:number /*uint*/, priority:number /*int*/ = 1) - { - super(); - - name = name + ParticleNodeBase.MODES[mode]; - - this.name = name; - this._pMode = mode; - this._priority = priority; - this._pDataLength = dataLength; - - this._pOneData = new Array(this._pDataLength); - } - - /** - * Returns the AGAL code of the particle animation node for use in the vertex shader. - */ - public getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string - { - return ""; - } - - /** - * Returns the AGAL code of the particle animation node for use in the fragment shader. - */ - public getAGALFragmentCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string - { - return ""; - } - - /** - * Returns the AGAL code of the particle animation node for use in the fragment shader when UV coordinates are required. - */ - public getAGALUVCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string - { - return ""; - } - - /** - * Called internally by the particle animation set when assigning the set of static properties originally defined by the initParticleFunc of the set. - * - * @see away.animators.ParticleAnimationSet#initParticleFunc - */ - public _iGeneratePropertyOfOneParticle(param:ParticleProperties) - { - - } - - /** - * Called internally by the particle animation set when determining the requirements of the particle animation node AGAL. - */ - public _iProcessAnimationSetting(particleAnimationSet:ParticleAnimationSet) - { - - } - } -} diff --git a/src/away/animators/nodes/ParticleOrbitNode.ts b/src/away/animators/nodes/ParticleOrbitNode.ts deleted file mode 100644 index f24ba94e2..000000000 --- a/src/away/animators/nodes/ParticleOrbitNode.ts +++ /dev/null @@ -1,160 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used to control the position of a particle over time around a circular orbit. - */ - export class ParticleOrbitNode extends ParticleNodeBase - { - /** @private */ - public static ORBIT_INDEX:number /*uint*/ = 0; - - /** @private */ - public static EULERS_INDEX:number /*uint*/ = 1; - - /** @private */ - public _iUsesEulers:boolean; - - /** @private */ - public _iUsesCycle:boolean; - - /** @private */ - public _iUsesPhase:boolean; - - /** @private */ - public _iRadius:number; - /** @private */ - public _iCycleDuration:number; - /** @private */ - public _iCyclePhase:number; - /** @private */ - public _iEulers:Vector3D; - - /** - * Reference for orbit node properties on a single particle (when in local property mode). - * Expects a Vector3D object representing the radius (x), cycle speed (y) and cycle phase (z) of the motion on the particle. - */ - public static ORBIT_VECTOR3D:string = "OrbitVector3D"; - - /** - * Creates a new ParticleOrbitNode object. - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] usesEulers Defines whether the node uses the eulers property in the shader to calculate a rotation on the orbit. Defaults to true. - * @param [optional] usesCycle Defines whether the node uses the cycleDuration property in the shader to calculate the period of the orbit independent of particle duration. Defaults to false. - * @param [optional] usesPhase Defines whether the node uses the cyclePhase property in the shader to calculate a starting offset to the cycle rotation of the particle. Defaults to false. - * @param [optional] radius Defines the radius of the orbit when in global mode. Defaults to 100. - * @param [optional] cycleDuration Defines the duration of the orbit in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. - * @param [optional] cyclePhase Defines the phase of the orbit in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. - * @param [optional] eulers Defines the euler rotation in degrees, applied to the orientation of the orbit when in global mode. - */ - constructor(mode:number /*uint*/, usesEulers:boolean = true, usesCycle:boolean = false, usesPhase:boolean = false, radius:number = 100, cycleDuration:number = 1, cyclePhase:number = 0, eulers:Vector3D = null) - { - var len:number /*int*/ = 3; - if (usesPhase) - len++; - super("ParticleOrbit", mode, len); - - this._pStateClass = ParticleOrbitState; - - this._iUsesEulers = usesEulers; - this._iUsesCycle = usesCycle; - this._iUsesPhase = usesPhase; - - this._iRadius = radius; - this._iCycleDuration = cycleDuration; - this._iCyclePhase = cyclePhase; - this._iEulers = eulers || new Vector3D(); - } - - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string - { - var orbitRegister:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleOrbitNode.ORBIT_INDEX, orbitRegister.index); - - var eulersMatrixRegister:ShaderRegisterElement = animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.setRegisterIndex(this, ParticleOrbitNode.EULERS_INDEX, eulersMatrixRegister.index); - animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.getFreeVertexConstant(); - - var temp1:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(temp1, 1); - var distance:ShaderRegisterElement = new ShaderRegisterElement(temp1.regName, temp1.index); - - var temp2:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - var cos:ShaderRegisterElement = new ShaderRegisterElement(temp2.regName, temp2.index, 0); - var sin:ShaderRegisterElement = new ShaderRegisterElement(temp2.regName, temp2.index, 1); - var degree:ShaderRegisterElement = new ShaderRegisterElement(temp2.regName, temp2.index, 2); - animationRegisterCache.removeVertexTempUsage(temp1); - - var code:string = ""; - - if (this._iUsesCycle) { - code += "mul " + degree + "," + animationRegisterCache.vertexTime + "," + orbitRegister + ".y\n"; - - if (this._iUsesPhase) - code += "add " + degree + "," + degree + "," + orbitRegister + ".w\n"; - } else - code += "mul " + degree + "," + animationRegisterCache.vertexLife + "," + orbitRegister + ".y\n"; - - code += "cos " + cos + "," + degree + "\n"; - code += "sin " + sin + "," + degree + "\n"; - code += "mul " + distance + ".x," + cos + "," + orbitRegister + ".x\n"; - code += "mul " + distance + ".y," + sin + "," + orbitRegister + ".x\n"; - code += "mov " + distance + ".wz" + animationRegisterCache.vertexZeroConst + "\n"; - if (this._iUsesEulers) - code += "m44 " + distance + "," + distance + "," + eulersMatrixRegister + "\n"; - code += "add " + animationRegisterCache.positionTarget + ".xyz," + distance + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; - - if (animationRegisterCache.needVelocity) { - code += "neg " + distance + ".x," + sin + "\n"; - code += "mov " + distance + ".y," + cos + "\n"; - code += "mov " + distance + ".zw," + animationRegisterCache.vertexZeroConst + "\n"; - if (this._iUsesEulers) - code += "m44 " + distance + "," + distance + "," + eulersMatrixRegister + "\n"; - code += "mul " + distance + "," + distance + "," + orbitRegister + ".z\n"; - code += "div " + distance + "," + distance + "," + orbitRegister + ".y\n"; - if (!this._iUsesCycle) - code += "div " + distance + "," + distance + "," + animationRegisterCache.vertexLife + "\n"; - code += "add " + animationRegisterCache.velocityTarget + ".xyz," + animationRegisterCache.velocityTarget + ".xyz," + distance + ".xyz\n"; - } - return code; - } - - /** - * @inheritDoc - */ - public getAnimationState(animator:AnimatorBase):ParticleOrbitState - { - return animator.getAnimationState(this); - } - - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param:ParticleProperties) - { - //Vector3D.x is radius, Vector3D.y is cycle duration, Vector3D.z is phase - var orbit:Vector3D = param[ParticleOrbitNode.ORBIT_VECTOR3D]; - if (!orbit) - throw new Error("there is no " + ParticleOrbitNode.ORBIT_VECTOR3D + " in param!"); - - this._pOneData[0] = orbit.x; - if (this._iUsesCycle && orbit.y <= 0) - throw(new Error("the cycle duration must be greater than zero")); - this._pOneData[1] = Math.PI*2/(!this._iUsesCycle? 1 : orbit.y); - this._pOneData[2] = orbit.x*Math.PI*2; - if (this._iUsesPhase) - this._pOneData[3] = orbit.z*Math.PI/180; - } - } -} diff --git a/src/away/animators/nodes/ParticleOscillatorNode.ts b/src/away/animators/nodes/ParticleOscillatorNode.ts deleted file mode 100644 index 20ec9950a..000000000 --- a/src/away/animators/nodes/ParticleOscillatorNode.ts +++ /dev/null @@ -1,98 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used to control the position of a particle over time using simple harmonic motion. - */ - export class ParticleOscillatorNode extends ParticleNodeBase - { - /** @private */ - public static OSCILLATOR_INDEX:number /*uint*/ = 0; - - /** @private */ - public _iOscillator:Vector3D; - - /** - * Reference for ocsillator node properties on a single particle (when in local property mode). - * Expects a Vector3D object representing the axis (x,y,z) and cycle speed (w) of the motion on the particle. - */ - public static OSCILLATOR_VECTOR3D:string = "OscillatorVector3D"; - - /** - * Creates a new ParticleOscillatorNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] oscillator Defines the default oscillator axis (x, y, z) and cycleDuration (w) of the node, used when in global mode. - */ - constructor(mode:number /*uint*/, oscillator:Vector3D = null) - { - super("ParticleOscillator", mode, 4); - - this._pStateClass = ParticleOscillatorState; - - this._iOscillator = oscillator || new Vector3D(); - } - - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string - { - var oscillatorRegister:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleOscillatorNode.OSCILLATOR_INDEX, oscillatorRegister.index); - var temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - var dgree:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 0); - var sin:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 1); - var cos:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 2); - animationRegisterCache.addVertexTempUsages(temp, 1); - var temp2:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - var distance:ShaderRegisterElement = new ShaderRegisterElement(temp2.regName, temp2.index); - animationRegisterCache.removeVertexTempUsage(temp); - - var code:string = ""; - code += "mul " + dgree + "," + animationRegisterCache.vertexTime + "," + oscillatorRegister + ".w\n"; - code += "sin " + sin + "," + dgree + "\n"; - code += "mul " + distance + ".xyz," + sin + "," + oscillatorRegister + ".xyz\n"; - code += "add " + animationRegisterCache.positionTarget + ".xyz," + distance + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; - - if (animationRegisterCache.needVelocity) { - code += "cos " + cos + "," + dgree + "\n"; - code += "mul " + distance + ".xyz," + cos + "," + oscillatorRegister + ".xyz\n"; - code += "add " + animationRegisterCache.velocityTarget + ".xyz," + distance + ".xyz," + animationRegisterCache.velocityTarget + ".xyz\n"; - } - - return code; - } - - /** - * @inheritDoc - */ - public getAnimationState(animator:AnimatorBase):ParticleOscillatorState - { - return animator.getAnimationState(this); - } - - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param:ParticleProperties) - { - //(Vector3D.x,Vector3D.y,Vector3D.z) is oscillator axis, Vector3D.w is oscillator cycle duration - var drift:Vector3D = param[ParticleOscillatorNode.OSCILLATOR_VECTOR3D]; - if (!drift) - throw(new Error("there is no " + ParticleOscillatorNode.OSCILLATOR_VECTOR3D + " in param!")); - - this._pOneData[0] = drift.x; - this._pOneData[1] = drift.y; - this._pOneData[2] = drift.z; - if (drift.w <= 0) - throw(new Error("the cycle duration must greater than zero")); - this._pOneData[3] = Math.PI*2/drift.w; - } - } -} diff --git a/src/away/animators/nodes/ParticlePositionNode.ts b/src/away/animators/nodes/ParticlePositionNode.ts deleted file mode 100644 index bf342464c..000000000 --- a/src/away/animators/nodes/ParticlePositionNode.ts +++ /dev/null @@ -1,74 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used to set the starting position of a particle. - */ - export class ParticlePositionNode extends ParticleNodeBase - { - /** @private */ - public static POSITION_INDEX:number /*uint*/ = 0; - - /** @private */ - public _iPosition:Vector3D; - - /** - * Reference for position node properties on a single particle (when in local property mode). - * Expects a Vector3D object representing position of the particle. - */ - public static POSITION_VECTOR3D:string = "PositionVector3D"; - - /** - * Creates a new ParticlePositionNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] position Defines the default position of the particle when in global mode. Defaults to 0,0,0. - */ - constructor(mode:number /*uint*/, position:Vector3D = null) - { - super("ParticlePosition", mode, 3); - - this._pStateClass = ParticlePositionState; - - this._iPosition = position || new Vector3D(); - } - - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string - { - var positionAttribute:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticlePositionNode.POSITION_INDEX, positionAttribute.index); - - return "add " + animationRegisterCache.positionTarget + ".xyz," + positionAttribute + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; - } - - /** - * @inheritDoc - */ - public getAnimationState(animator:AnimatorBase):ParticlePositionState - { - return animator.getAnimationState(this); - } - - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param:ParticleProperties) - { - var offset:Vector3D = param[ParticlePositionNode.POSITION_VECTOR3D]; - if (!offset) - throw(new Error("there is no " + ParticlePositionNode.POSITION_VECTOR3D + " in param!")); - - this._pOneData[0] = offset.x; - this._pOneData[1] = offset.y; - this._pOneData[2] = offset.z; - } - } -} diff --git a/src/away/animators/nodes/ParticleRotateToHeadingNode.ts b/src/away/animators/nodes/ParticleRotateToHeadingNode.ts deleted file mode 100644 index 379fcaeb3..000000000 --- a/src/away/animators/nodes/ParticleRotateToHeadingNode.ts +++ /dev/null @@ -1,190 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used to control the rotation of a particle to match its heading vector. - */ - export class ParticleRotateToHeadingNode extends ParticleNodeBase - { - /** @private */ - public static MATRIX_INDEX:number /*int*/ = 0; - - /** - * Creates a new ParticleBillboardNode - */ - constructor() - { - super("ParticleRotateToHeading", ParticlePropertiesMode.GLOBAL, 0, 3); - - this._pStateClass = ParticleRotateToHeadingState; - } - - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string - { - var code:string = ""; - var len:number /*int*/ = animationRegisterCache.rotationRegisters.length; - var i:number /*int*/; - if (animationRegisterCache.hasBillboard) { - var temp1:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(temp1, 1); - var temp2:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(temp2, 1); - var temp3:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - - var rotationMatrixRegister:ShaderRegisterElement = animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.setRegisterIndex(this, ParticleRotateToHeadingNode.MATRIX_INDEX, rotationMatrixRegister.index); - animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.getFreeVertexConstant(); - - animationRegisterCache.removeVertexTempUsage(temp1); - animationRegisterCache.removeVertexTempUsage(temp2); - - //process the velocity - code += "m33 " + temp1 + ".xyz," + animationRegisterCache.velocityTarget + ".xyz," + rotationMatrixRegister + "\n"; - - code += "mov " + temp3 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp3 + ".xy," + temp1 + ".xy\n"; - code += "nrm " + temp3 + ".xyz," + temp3 + ".xyz\n"; - - //temp3.x=cos,temp3.y=sin - //only process z axis - code += "mov " + temp2 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp2 + ".x," + temp3 + ".y\n"; - code += "mov " + temp2 + ".y," + temp3 + ".x\n"; - code += "mov " + temp1 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp1 + ".x," + temp3 + ".x\n"; - code += "neg " + temp1 + ".y," + temp3 + ".y\n"; - code += "mov " + temp3 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp3 + ".z," + animationRegisterCache.vertexOneConst + "\n"; - code += "m33 " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp1 + "\n"; - for (i = 0; i < len; i++) - code += "m33 " + animationRegisterCache.rotationRegisters[i] + ".xyz," + animationRegisterCache.rotationRegisters[i] + "," + temp1 + "\n"; - } else { - var nrmVel:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(nrmVel, 1); - - var xAxis:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(xAxis, 1); - - var R:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(R, 1); - var R_rev:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - var cos:ShaderRegisterElement = new ShaderRegisterElement(R.regName, R.index, 3); - var sin:ShaderRegisterElement = new ShaderRegisterElement(R_rev.regName, R_rev.index, 3); - var cos2:ShaderRegisterElement = new ShaderRegisterElement(nrmVel.regName, nrmVel.index, 3); - var tempSingle:ShaderRegisterElement = sin; - - animationRegisterCache.removeVertexTempUsage(nrmVel); - animationRegisterCache.removeVertexTempUsage(xAxis); - animationRegisterCache.removeVertexTempUsage(R); - - code += "mov " + xAxis + ".x," + animationRegisterCache.vertexOneConst + "\n"; - code += "mov " + xAxis + ".yz," + animationRegisterCache.vertexZeroConst + "\n"; - - code += "nrm " + nrmVel + ".xyz," + animationRegisterCache.velocityTarget + ".xyz\n"; - code += "dp3 " + cos2 + "," + nrmVel + ".xyz," + xAxis + ".xyz\n"; - code += "crs " + nrmVel + ".xyz," + xAxis + ".xyz," + nrmVel + ".xyz\n"; - code += "nrm " + nrmVel + ".xyz," + nrmVel + ".xyz\n"; - //use R as temp to judge if nrm is (0,0,0). - //if nrm is (0,0,0) ,change it to (0,0,1). - code += "dp3 " + R + ".x," + nrmVel + ".xyz," + nrmVel + ".xyz\n"; - code += "sge " + R + ".x," + animationRegisterCache.vertexZeroConst + "," + R + ".x\n"; - code += "add " + nrmVel + ".z," + R + ".x," + nrmVel + ".z\n"; - - code += "add " + tempSingle + "," + cos2 + "," + animationRegisterCache.vertexOneConst + "\n"; - code += "div " + tempSingle + "," + tempSingle + "," + animationRegisterCache.vertexTwoConst + "\n"; - code += "sqt " + cos + "," + tempSingle + "\n"; - - code += "sub " + tempSingle + "," + animationRegisterCache.vertexOneConst + "," + cos2 + "\n"; - code += "div " + tempSingle + "," + tempSingle + "," + animationRegisterCache.vertexTwoConst + "\n"; - code += "sqt " + sin + "," + tempSingle + "\n"; - - code += "mul " + R + ".xyz," + sin + "," + nrmVel + ".xyz\n"; - - //use cos as R.w - - code += "mul " + R_rev + ".xyz," + sin + "," + nrmVel + ".xyz\n"; - code += "neg " + R_rev + ".xyz," + R_rev + ".xyz\n"; - - //use cos as R_rev.w - - //nrmVel and xAxis are used as temp register - code += "crs " + nrmVel + ".xyz," + R + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; - - //use cos as R.w - code += "mul " + xAxis + ".xyz," + cos + "," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; - code += "add " + nrmVel + ".xyz," + nrmVel + ".xyz," + xAxis + ".xyz\n"; - code += "dp3 " + xAxis + ".w," + R + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; - code += "neg " + nrmVel + ".w," + xAxis + ".w\n"; - - code += "crs " + R + ".xyz," + nrmVel + ".xyz," + R_rev + ".xyz\n"; - //code += "mul " + xAxis + ".xyzw," + nrmVel + ".xyzw," +R_rev + ".w\n"; - code += "mul " + xAxis + ".xyzw," + nrmVel + ".xyzw," + cos + "\n"; - code += "add " + R + ".xyz," + R + ".xyz," + xAxis + ".xyz\n"; - code += "mul " + xAxis + ".xyz," + nrmVel + ".w," + R_rev + ".xyz\n"; - - code += "add " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + R + ".xyz," + xAxis + ".xyz\n"; - - for (i = 0; i < len; i++) { - //just repeat the calculate above - //because of the limited registers, no need to optimise - code += "mov " + xAxis + ".x," + animationRegisterCache.vertexOneConst + "\n"; - code += "mov " + xAxis + ".yz," + animationRegisterCache.vertexZeroConst + "\n"; - code += "nrm " + nrmVel + ".xyz," + animationRegisterCache.velocityTarget + ".xyz\n"; - code += "dp3 " + cos2 + "," + nrmVel + ".xyz," + xAxis + ".xyz\n"; - code += "crs " + nrmVel + ".xyz," + xAxis + ".xyz," + nrmVel + ".xyz\n"; - code += "nrm " + nrmVel + ".xyz," + nrmVel + ".xyz\n"; - code += "dp3 " + R + ".x," + nrmVel + ".xyz," + nrmVel + ".xyz\n"; - code += "sge " + R + ".x," + animationRegisterCache.vertexZeroConst + "," + R + ".x\n"; - code += "add " + nrmVel + ".z," + R + ".x," + nrmVel + ".z\n"; - code += "add " + tempSingle + "," + cos2 + "," + animationRegisterCache.vertexOneConst + "\n"; - code += "div " + tempSingle + "," + tempSingle + "," + animationRegisterCache.vertexTwoConst + "\n"; - code += "sqt " + cos + "," + tempSingle + "\n"; - code += "sub " + tempSingle + "," + animationRegisterCache.vertexOneConst + "," + cos2 + "\n"; - code += "div " + tempSingle + "," + tempSingle + "," + animationRegisterCache.vertexTwoConst + "\n"; - code += "sqt " + sin + "," + tempSingle + "\n"; - code += "mul " + R + ".xyz," + sin + "," + nrmVel + ".xyz\n"; - code += "mul " + R_rev + ".xyz," + sin + "," + nrmVel + ".xyz\n"; - code += "neg " + R_rev + ".xyz," + R_rev + ".xyz\n"; - code += "crs " + nrmVel + ".xyz," + R + ".xyz," + animationRegisterCache.rotationRegisters[i] + ".xyz\n"; - code += "mul " + xAxis + ".xyz," + cos + "," + animationRegisterCache.rotationRegisters[i] + ".xyz\n"; - code += "add " + nrmVel + ".xyz," + nrmVel + ".xyz," + xAxis + ".xyz\n"; - code += "dp3 " + xAxis + ".w," + R + ".xyz," + animationRegisterCache.rotationRegisters[i] + ".xyz\n"; - code += "neg " + nrmVel + ".w," + xAxis + ".w\n"; - code += "crs " + R + ".xyz," + nrmVel + ".xyz," + R_rev + ".xyz\n"; - code += "mul " + xAxis + ".xyzw," + nrmVel + ".xyzw," + cos + "\n"; - code += "add " + R + ".xyz," + R + ".xyz," + xAxis + ".xyz\n"; - code += "mul " + xAxis + ".xyz," + nrmVel + ".w," + R_rev + ".xyz\n"; - code += "add " + animationRegisterCache.rotationRegisters[i] + ".xyz," + R + ".xyz," + xAxis + ".xyz\n"; - } - - } - return code; - } - - /** - * @inheritDoc - */ - public getAnimationState(animator:AnimatorBase):ParticleRotateToHeadingState - { - return animator.getAnimationState(this); - } - - /** - * @inheritDoc - */ - public _iProcessAnimationSetting(particleAnimationSet:ParticleAnimationSet) - { - particleAnimationSet.needVelocity = true; - } - } -} diff --git a/src/away/animators/nodes/ParticleRotateToPositionNode.ts b/src/away/animators/nodes/ParticleRotateToPositionNode.ts deleted file mode 100644 index 645448289..000000000 --- a/src/away/animators/nodes/ParticleRotateToPositionNode.ts +++ /dev/null @@ -1,214 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used to control the rotation of a particle to face to a position - */ - export class ParticleRotateToPositionNode extends ParticleNodeBase - { - /** @private */ - public static MATRIX_INDEX:number /*int*/ = 0; - /** @private */ - public static POSITION_INDEX:number /*int*/ = 1; - - /** @private */ - public _iPosition:Vector3D; - - /** - * Reference for the position the particle will rotate to face for a single particle (when in local property mode). - * Expects a Vector3D object representing the position that the particle must face. - */ - public static POSITION_VECTOR3D:string = "RotateToPositionVector3D"; - - /** - * Creates a new ParticleRotateToPositionNode - */ - constructor(mode:number /*uint*/, position:Vector3D = null) - { - super("ParticleRotateToPosition", mode, 3, 3); - - this._pStateClass = ParticleRotateToPositionState; - - this._iPosition = position || new Vector3D(); - } - - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string - { - var positionAttribute:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleRotateToPositionNode.POSITION_INDEX, positionAttribute.index); - - var code:string = ""; - var len:number /*int*/ = animationRegisterCache.rotationRegisters.length; - var i:number /*int*/; - if (animationRegisterCache.hasBillboard) { - var temp1:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(temp1, 1); - var temp2:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(temp2, 1); - var temp3:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - - var rotationMatrixRegister:ShaderRegisterElement = animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.setRegisterIndex(this, ParticleRotateToPositionNode.MATRIX_INDEX, rotationMatrixRegister.index); - animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.getFreeVertexConstant(); - - animationRegisterCache.removeVertexTempUsage(temp1); - animationRegisterCache.removeVertexTempUsage(temp2); - - //process the position - code += "sub " + temp1 + ".xyz," + positionAttribute + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; - code += "m33 " + temp1 + ".xyz," + temp1 + ".xyz," + rotationMatrixRegister + "\n"; - - code += "mov " + temp3 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp3 + ".xy," + temp1 + ".xy\n"; - code += "nrm " + temp3 + ".xyz," + temp3 + ".xyz\n"; - - //temp3.x=cos,temp3.y=sin - //only process z axis - code += "mov " + temp2 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp2 + ".x," + temp3 + ".y\n"; - code += "mov " + temp2 + ".y," + temp3 + ".x\n"; - code += "mov " + temp1 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp1 + ".x," + temp3 + ".x\n"; - code += "neg " + temp1 + ".y," + temp3 + ".y\n"; - code += "mov " + temp3 + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mov " + temp3 + ".z," + animationRegisterCache.vertexOneConst + "\n"; - code += "m33 " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp1 + "\n"; - for (i = 0; i < len; i++) - code += "m33 " + animationRegisterCache.rotationRegisters[i] + ".xyz," + animationRegisterCache.rotationRegisters[i] + "," + temp1 + "\n"; - } else { - var nrmDirection:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(nrmDirection, 1); - - var temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(temp, 1); - var cos:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 0); - var sin:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 1); - var o_temp:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 2); - var tempSingle:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 3); - - var R:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(R, 1); - - animationRegisterCache.removeVertexTempUsage(nrmDirection); - animationRegisterCache.removeVertexTempUsage(temp); - animationRegisterCache.removeVertexTempUsage(R); - - code += "sub " + nrmDirection + ".xyz," + positionAttribute + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; - code += "nrm " + nrmDirection + ".xyz," + nrmDirection + ".xyz\n"; - - code += "mov " + sin + "," + nrmDirection + ".y\n"; - code += "mul " + cos + "," + sin + "," + sin + "\n"; - code += "sub " + cos + "," + animationRegisterCache.vertexOneConst + "," + cos + "\n"; - code += "sqt " + cos + "," + cos + "\n"; - - code += "mul " + R + ".x," + cos + "," + animationRegisterCache.scaleAndRotateTarget + ".y\n"; - code += "mul " + R + ".y," + sin + "," + animationRegisterCache.scaleAndRotateTarget + ".z\n"; - code += "mul " + R + ".z," + sin + "," + animationRegisterCache.scaleAndRotateTarget + ".y\n"; - code += "mul " + R + ".w," + cos + "," + animationRegisterCache.scaleAndRotateTarget + ".z\n"; - - code += "sub " + animationRegisterCache.scaleAndRotateTarget + ".y," + R + ".x," + R + ".y\n"; - code += "add " + animationRegisterCache.scaleAndRotateTarget + ".z," + R + ".z," + R + ".w\n"; - - code += "abs " + R + ".y," + nrmDirection + ".y\n"; - code += "sge " + R + ".z," + R + ".y," + animationRegisterCache.vertexOneConst + "\n"; - code += "mul " + R + ".x," + R + ".y," + nrmDirection + ".y\n"; - - //judgu if nrmDirection=(0,1,0); - code += "mov " + nrmDirection + ".y," + animationRegisterCache.vertexZeroConst + "\n"; - code += "dp3 " + sin + "," + nrmDirection + ".xyz," + nrmDirection + ".xyz\n"; - code += "sge " + tempSingle + "," + animationRegisterCache.vertexZeroConst + "," + sin + "\n"; - - code += "mov " + nrmDirection + ".y," + animationRegisterCache.vertexZeroConst + "\n"; - code += "nrm " + nrmDirection + ".xyz," + nrmDirection + ".xyz\n"; - - code += "sub " + sin + "," + animationRegisterCache.vertexOneConst + "," + tempSingle + "\n"; - code += "mul " + sin + "," + sin + "," + nrmDirection + ".x\n"; - - code += "mov " + cos + "," + nrmDirection + ".z\n"; - code += "neg " + cos + "," + cos + "\n"; - code += "sub " + o_temp + "," + animationRegisterCache.vertexOneConst + "," + cos + "\n"; - code += "mul " + o_temp + "," + R + ".x," + tempSingle + "\n"; - code += "add " + cos + "," + cos + "," + o_temp + "\n"; - - code += "mul " + R + ".x," + cos + "," + animationRegisterCache.scaleAndRotateTarget + ".x\n"; - code += "mul " + R + ".y," + sin + "," + animationRegisterCache.scaleAndRotateTarget + ".z\n"; - code += "mul " + R + ".z," + sin + "," + animationRegisterCache.scaleAndRotateTarget + ".x\n"; - code += "mul " + R + ".w," + cos + "," + animationRegisterCache.scaleAndRotateTarget + ".z\n"; - - code += "sub " + animationRegisterCache.scaleAndRotateTarget + ".x," + R + ".x," + R + ".y\n"; - code += "add " + animationRegisterCache.scaleAndRotateTarget + ".z," + R + ".z," + R + ".w\n"; - - for (i = 0; i < len; i++) { - //just repeat the calculate above - //because of the limited registers, no need to optimise - code += "sub " + nrmDirection + ".xyz," + positionAttribute + ".xyz," + animationRegisterCache.positionTarget + ".xyz\n"; - code += "nrm " + nrmDirection + ".xyz," + nrmDirection + ".xyz\n"; - code += "mov " + sin + "," + nrmDirection + ".y\n"; - code += "mul " + cos + "," + sin + "," + sin + "\n"; - code += "sub " + cos + "," + animationRegisterCache.vertexOneConst + "," + cos + "\n"; - code += "sqt " + cos + "," + cos + "\n"; - code += "mul " + R + ".x," + cos + "," + animationRegisterCache.rotationRegisters[i] + ".y\n"; - code += "mul " + R + ".y," + sin + "," + animationRegisterCache.rotationRegisters[i] + ".z\n"; - code += "mul " + R + ".z," + sin + "," + animationRegisterCache.rotationRegisters[i] + ".y\n"; - code += "mul " + R + ".w," + cos + "," + animationRegisterCache.rotationRegisters[i] + ".z\n"; - code += "sub " + animationRegisterCache.rotationRegisters[i] + ".y," + R + ".x," + R + ".y\n"; - code += "add " + animationRegisterCache.rotationRegisters[i] + ".z," + R + ".z," + R + ".w\n"; - code += "abs " + R + ".y," + nrmDirection + ".y\n"; - code += "sge " + R + ".z," + R + ".y," + animationRegisterCache.vertexOneConst + "\n"; - code += "mul " + R + ".x," + R + ".y," + nrmDirection + ".y\n"; - code += "mov " + nrmDirection + ".y," + animationRegisterCache.vertexZeroConst + "\n"; - code += "dp3 " + sin + "," + nrmDirection + ".xyz," + nrmDirection + ".xyz\n"; - code += "sge " + tempSingle + "," + animationRegisterCache.vertexZeroConst + "," + sin + "\n"; - code += "mov " + nrmDirection + ".y," + animationRegisterCache.vertexZeroConst + "\n"; - code += "nrm " + nrmDirection + ".xyz," + nrmDirection + ".xyz\n"; - code += "sub " + sin + "," + animationRegisterCache.vertexOneConst + "," + tempSingle + "\n"; - code += "mul " + sin + "," + sin + "," + nrmDirection + ".x\n"; - code += "mov " + cos + "," + nrmDirection + ".z\n"; - code += "neg " + cos + "," + cos + "\n"; - code += "sub " + o_temp + "," + animationRegisterCache.vertexOneConst + "," + cos + "\n"; - code += "mul " + o_temp + "," + R + ".x," + tempSingle + "\n"; - code += "add " + cos + "," + cos + "," + o_temp + "\n"; - code += "mul " + R + ".x," + cos + "," + animationRegisterCache.rotationRegisters[i] + ".x\n"; - code += "mul " + R + ".y," + sin + "," + animationRegisterCache.rotationRegisters[i] + ".z\n"; - code += "mul " + R + ".z," + sin + "," + animationRegisterCache.rotationRegisters[i] + ".x\n"; - code += "mul " + R + ".w," + cos + "," + animationRegisterCache.rotationRegisters[i] + ".z\n"; - code += "sub " + animationRegisterCache.rotationRegisters[i] + ".x," + R + ".x," + R + ".y\n"; - code += "add " + animationRegisterCache.rotationRegisters[i] + ".z," + R + ".z," + R + ".w\n"; - } - } - return code; - } - - /** - * @inheritDoc - */ - public getAnimationState(animator:AnimatorBase):ParticleRotateToPositionState - { - return animator.getAnimationState(this); - } - - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param:ParticleProperties) - { - var offset:Vector3D = param[ParticleRotateToPositionNode.POSITION_VECTOR3D]; - if (!offset) - throw(new Error("there is no " + ParticleRotateToPositionNode.POSITION_VECTOR3D + " in param!")); - - this._pOneData[0] = offset.x; - this._pOneData[1] = offset.y; - this._pOneData[2] = offset.z; - } - } -} diff --git a/src/away/animators/nodes/ParticleRotationalVelocityNode.ts b/src/away/animators/nodes/ParticleRotationalVelocityNode.ts deleted file mode 100644 index 7411fcb1b..000000000 --- a/src/away/animators/nodes/ParticleRotationalVelocityNode.ts +++ /dev/null @@ -1,154 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used to set the starting rotational velocity of a particle. - */ - export class ParticleRotationalVelocityNode extends ParticleNodeBase - { - /** @private */ - public static ROTATIONALVELOCITY_INDEX:number /*uint*/ = 0; - - /** @private */ - public _iRotationalVelocity:Vector3D; - - /** - * Reference for rotational velocity node properties on a single particle (when in local property mode). - * Expects a Vector3D object representing the rotational velocity around an axis of the particle. - */ - public static ROTATIONALVELOCITY_VECTOR3D:string = "RotationalVelocityVector3D"; - - /** - * Creates a new ParticleRotationalVelocityNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - */ - constructor(mode:number /*uint*/, rotationalVelocity:Vector3D = null) - { - super("ParticleRotationalVelocity", mode, 4); - - this._pStateClass = ParticleRotationalVelocityState; - - this._iRotationalVelocity = rotationalVelocity || new Vector3D(); - } - - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string - { - var rotationRegister:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleRotationalVelocityNode.ROTATIONALVELOCITY_INDEX, rotationRegister.index); - - var nrmVel:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(nrmVel, 1); - - var xAxis:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(xAxis, 1); - - var temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(temp, 1); - var Rtemp:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index); - var R_rev:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - R_rev = new ShaderRegisterElement(R_rev.regName, R_rev.index); - - var cos:ShaderRegisterElement = new ShaderRegisterElement(Rtemp.regName, Rtemp.index, 3); - var sin:ShaderRegisterElement = new ShaderRegisterElement(R_rev.regName, R_rev.index, 3); - - animationRegisterCache.removeVertexTempUsage(nrmVel); - animationRegisterCache.removeVertexTempUsage(xAxis); - animationRegisterCache.removeVertexTempUsage(temp); - - var code:string = ""; - code += "mov " + nrmVel + ".xyz," + rotationRegister + ".xyz\n"; - code += "mov " + nrmVel + ".w," + animationRegisterCache.vertexZeroConst + "\n"; - - code += "mul " + cos + "," + animationRegisterCache.vertexTime + "," + rotationRegister + ".w\n"; - - code += "sin " + sin + "," + cos + "\n"; - code += "cos " + cos + "," + cos + "\n"; - - code += "mul " + Rtemp + ".xyz," + sin + "," + nrmVel + ".xyz\n"; - - code += "mul " + R_rev + ".xyz," + sin + "," + nrmVel + ".xyz\n"; - code += "neg " + R_rev + ".xyz," + R_rev + ".xyz\n"; - - //nrmVel and xAxis are used as temp register - code += "crs " + nrmVel + ".xyz," + Rtemp + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; - - code += "mul " + xAxis + ".xyz," + cos + "," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; - code += "add " + nrmVel + ".xyz," + nrmVel + ".xyz," + xAxis + ".xyz\n"; - code += "dp3 " + xAxis + ".w," + Rtemp + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz\n"; - code += "neg " + nrmVel + ".w," + xAxis + ".w\n"; - - code += "crs " + Rtemp + ".xyz," + nrmVel + ".xyz," + R_rev + ".xyz\n"; - - //use cos as R_rev.w - code += "mul " + xAxis + ".xyzw," + nrmVel + ".xyzw," + cos + "\n"; - code += "add " + Rtemp + ".xyz," + Rtemp + ".xyz," + xAxis + ".xyz\n"; - code += "mul " + xAxis + ".xyz," + nrmVel + ".w," + R_rev + ".xyz\n"; - - code += "add " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + Rtemp + ".xyz," + xAxis + ".xyz\n"; - - var len:number /*int*/ = animationRegisterCache.rotationRegisters.length; - for (var i:number /*int*/ = 0; i < len; i++) { - code += "mov " + nrmVel + ".xyz," + rotationRegister + ".xyz\n"; - code += "mov " + nrmVel + ".w," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mul " + cos + "," + animationRegisterCache.vertexTime + "," + rotationRegister + ".w\n"; - code += "sin " + sin + "," + cos + "\n"; - code += "cos " + cos + "," + cos + "\n"; - code += "mul " + Rtemp + ".xyz," + sin + "," + nrmVel + ".xyz\n"; - code += "mul " + R_rev + ".xyz," + sin + "," + nrmVel + ".xyz\n"; - code += "neg " + R_rev + ".xyz," + R_rev + ".xyz\n"; - code += "crs " + nrmVel + ".xyz," + Rtemp + ".xyz," + animationRegisterCache.rotationRegisters[i] + ".xyz\n"; - code += "mul " + xAxis + ".xyz," + cos + "," + animationRegisterCache.rotationRegisters[i] + "\n"; - code += "add " + nrmVel + ".xyz," + nrmVel + ".xyz," + xAxis + ".xyz\n"; - code += "dp3 " + xAxis + ".w," + Rtemp + ".xyz," + animationRegisterCache.rotationRegisters[i] + "\n"; - code += "neg " + nrmVel + ".w," + xAxis + ".w\n"; - code += "crs " + Rtemp + ".xyz," + nrmVel + ".xyz," + R_rev + ".xyz\n"; - code += "mul " + xAxis + ".xyzw," + nrmVel + ".xyzw," + cos + "\n"; - code += "add " + Rtemp + ".xyz," + Rtemp + ".xyz," + xAxis + ".xyz\n"; - code += "mul " + xAxis + ".xyz," + nrmVel + ".w," + R_rev + ".xyz\n"; - code += "add " + animationRegisterCache.rotationRegisters[i] + "," + Rtemp + ".xyz," + xAxis + ".xyz\n"; - } - return code; - } - - /** - * @inheritDoc - */ - public getAnimationState(animator:AnimatorBase):ParticleRotationalVelocityState - { - return animator.getAnimationState(this); - } - - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param:ParticleProperties) - { - //(Vector3d.x,Vector3d.y,Vector3d.z) is rotation axis,Vector3d.w is cycle duration - var rotate:Vector3D = param[ParticleRotationalVelocityNode.ROTATIONALVELOCITY_VECTOR3D]; - if (!rotate) - throw(new Error("there is no " + ParticleRotationalVelocityNode.ROTATIONALVELOCITY_VECTOR3D + " in param!")); - - if (rotate.length <= 0) - rotate.z = 1; //set the default direction - else - rotate.normalize(); - - this._pOneData[0] = rotate.x; - this._pOneData[1] = rotate.y; - this._pOneData[2] = rotate.z; - if (rotate.w <= 0) - throw(new Error("the cycle duration must greater than zero")); - // it's used as angle/2 in agal - this._pOneData[3] = Math.PI/rotate.w; - } - } -} diff --git a/src/away/animators/nodes/ParticleScaleNode.ts b/src/away/animators/nodes/ParticleScaleNode.ts deleted file mode 100644 index e5ba8c5b7..000000000 --- a/src/away/animators/nodes/ParticleScaleNode.ts +++ /dev/null @@ -1,122 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used to control the scale variation of a particle over time. - */ - export class ParticleScaleNode extends ParticleNodeBase - { - /** @private */ - public static SCALE_INDEX:number /*uint*/ = 0; - - /** @private */ - public _iUsesCycle:boolean; - - /** @private */ - public _iUsesPhase:boolean; - - /** @private */ - public _iMinScale:number; - /** @private */ - public _iMaxScale:number; - /** @private */ - public _iCycleDuration:number; - /** @private */ - public _iCyclePhase:number; - - /** - * Reference for scale node properties on a single particle (when in local property mode). - * Expects a Vector3D representing the min scale (x), max scale(y), optional cycle speed (z) and phase offset (w) applied to the particle. - */ - public static SCALE_VECTOR3D:string = "ScaleVector3D"; - - /** - * Creates a new ParticleScaleNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] usesCycle Defines whether the node uses the cycleDuration property in the shader to calculate the period of animation independent of particle duration. Defaults to false. - * @param [optional] usesPhase Defines whether the node uses the cyclePhase property in the shader to calculate a starting offset to the animation cycle. Defaults to false. - * @param [optional] minScale Defines the default min scale transform of the node, when in global mode. Defaults to 1. - * @param [optional] maxScale Defines the default max color transform of the node, when in global mode. Defaults to 1. - * @param [optional] cycleDuration Defines the default duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. - * @param [optional] cyclePhase Defines the default phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. - */ - constructor(mode:number /*uint*/, usesCycle:boolean, usesPhase:boolean, minScale:number = 1, maxScale:number = 1, cycleDuration:number = 1, cyclePhase:number = 0) - { - super("ParticleScale", mode, (usesCycle && usesPhase)? 4 : ((usesCycle || usesPhase)? 3 : 2), 3); - - this._pStateClass = ParticleScaleState; - - this._iUsesCycle = usesCycle; - this._iUsesPhase = usesPhase; - - this._iMinScale = minScale; - this._iMaxScale = maxScale; - this._iCycleDuration = cycleDuration; - this._iCyclePhase = cyclePhase; - } - - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string - { - var code:string = ""; - var temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexSingleTemp(); - - var scaleRegister:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleScaleNode.SCALE_INDEX, scaleRegister.index); - - if (this._iUsesCycle) { - code += "mul " + temp + "," + animationRegisterCache.vertexTime + "," + scaleRegister + ".z\n"; - - if (this._iUsesPhase) - code += "add " + temp + "," + temp + "," + scaleRegister + ".w\n"; - - code += "sin " + temp + "," + temp + "\n"; - } - - code += "mul " + temp + "," + scaleRegister + ".y," + ((this._iUsesCycle)? temp : animationRegisterCache.vertexLife) + "\n"; - code += "add " + temp + "," + scaleRegister + ".x," + temp + "\n"; - code += "mul " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp + "\n"; - - return code; - } - - /** - * @inheritDoc - */ - public getAnimationState(animator:AnimatorBase):ParticleScaleState - { - return animator.getAnimationState(this); - } - - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param:ParticleProperties) - { - var scale:Vector3D = param[ParticleScaleNode.SCALE_VECTOR3D]; - if (!scale) - throw(new Error("there is no " + ParticleScaleNode.SCALE_VECTOR3D + " in param!")); - - if (this._iUsesCycle) { - this._pOneData[0] = (scale.x + scale.y)/2; - this._pOneData[1] = Math.abs(scale.x - scale.y)/2; - if (scale.z <= 0) - throw(new Error("the cycle duration must be greater than zero")); - this._pOneData[2] = Math.PI*2/scale.z; - if (this._iUsesPhase) - this._pOneData[3] = scale.w*Math.PI/180; - } else { - this._pOneData[0] = scale.x; - this._pOneData[1] = scale.y - scale.x; - } - } - } -} diff --git a/src/away/animators/nodes/ParticleSegmentedColorNode.ts b/src/away/animators/nodes/ParticleSegmentedColorNode.ts deleted file mode 100644 index 27a7cb753..000000000 --- a/src/away/animators/nodes/ParticleSegmentedColorNode.ts +++ /dev/null @@ -1,186 +0,0 @@ -/// - -module away.animators -{ - import ColorTransform = away.geom.ColorTransform; - import Vector3D = away.geom.Vector3D; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import ShaderRegisterElement = away.materials.ShaderRegisterElement; - - export class ParticleSegmentedColorNode extends ParticleNodeBase - { - /** @private */ - public static START_MULTIPLIER_INDEX:number /*uint*/ = 0; - - /** @private */ - public static START_OFFSET_INDEX:number /*uint*/ = 1; - - /** @private */ - public static TIME_DATA_INDEX:number /*uint*/ = 2; - - /** @private */ - public _iUsesMultiplier:boolean; - /** @private */ - public _iUsesOffset:boolean; - /** @private */ - public _iStartColor:ColorTransform; - /** @private */ - public _iEndColor:ColorTransform; - /** @private */ - public _iNumSegmentPoint:number /*int*/; - /** @private */ - public _iSegmentPoints:Array; - - constructor(usesMultiplier:boolean, usesOffset:boolean, numSegmentPoint:number /*int*/, startColor:ColorTransform, endColor:ColorTransform, segmentPoints:Array) - { - //because of the stage3d register limitation, it only support the global mode - super("ParticleSegmentedColor", ParticlePropertiesMode.GLOBAL, 0, ParticleAnimationSet.COLOR_PRIORITY); - - this._pStateClass = ParticleSegmentedColorState; - - if (numSegmentPoint > 4) - throw(new Error("the numSegmentPoint must be less or equal 4")); - this._iUsesMultiplier = usesMultiplier; - this._iUsesOffset = usesOffset; - this._iNumSegmentPoint = numSegmentPoint; - this._iStartColor = startColor; - this._iEndColor = endColor; - this._iSegmentPoints = segmentPoints; - } - - /** - * @inheritDoc - */ - public _iProcessAnimationSetting(particleAnimationSet:ParticleAnimationSet) - { - if (this._iUsesMultiplier) - particleAnimationSet.hasColorMulNode = true; - if (this._iUsesOffset) - particleAnimationSet.hasColorAddNode = true; - } - - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string - { - var code:string = ""; - if (animationRegisterCache.needFragmentAnimation) { - var accMultiplierColor:ShaderRegisterElement; - //var accOffsetColor:ShaderRegisterElement; - if (this._iUsesMultiplier) { - accMultiplierColor = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(accMultiplierColor, 1); - } - - var tempColor:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - animationRegisterCache.addVertexTempUsages(tempColor, 1); - - var temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - var accTime:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 0); - var tempTime:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 1); - - if (this._iUsesMultiplier) - animationRegisterCache.removeVertexTempUsage(accMultiplierColor); - - animationRegisterCache.removeVertexTempUsage(tempColor); - - //for saving all the life values (at most 4) - var lifeTimeRegister:ShaderRegisterElement = animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.setRegisterIndex(this, ParticleSegmentedColorNode.TIME_DATA_INDEX, lifeTimeRegister.index); - - var i:number /*int*/; - - var startMulValue:ShaderRegisterElement; - var deltaMulValues:Array; - if (this._iUsesMultiplier) { - startMulValue = animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.setRegisterIndex(this, ParticleSegmentedColorNode.START_MULTIPLIER_INDEX, startMulValue.index); - deltaMulValues = new Array(); - for (i = 0; i < this._iNumSegmentPoint + 1; i++) - deltaMulValues.push(animationRegisterCache.getFreeVertexConstant()); - } - - var startOffsetValue:ShaderRegisterElement; - var deltaOffsetValues:Array; - if (this._iUsesOffset) { - startOffsetValue = animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.setRegisterIndex(this, ParticleSegmentedColorNode.START_OFFSET_INDEX, startOffsetValue.index); - deltaOffsetValues = new Array(); - for (i = 0; i < this._iNumSegmentPoint + 1; i++) - deltaOffsetValues.push(animationRegisterCache.getFreeVertexConstant()); - } - - if (this._iUsesMultiplier) - code += "mov " + accMultiplierColor + "," + startMulValue + "\n"; - if (this._iUsesOffset) - code += "add " + animationRegisterCache.colorAddTarget + "," + animationRegisterCache.colorAddTarget + "," + startOffsetValue + "\n"; - - for (i = 0; i < this._iNumSegmentPoint; i++) { - switch (i) { - case 0: - code += "min " + tempTime + "," + animationRegisterCache.vertexLife + "," + lifeTimeRegister + ".x\n"; - break; - case 1: - code += "sub " + accTime + "," + animationRegisterCache.vertexLife + "," + lifeTimeRegister + ".x\n"; - code += "max " + tempTime + "," + accTime + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "min " + tempTime + "," + tempTime + "," + lifeTimeRegister + ".y\n"; - break; - case 2: - code += "sub " + accTime + "," + accTime + "," + lifeTimeRegister + ".y\n"; - code += "max " + tempTime + "," + accTime + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "min " + tempTime + "," + tempTime + "," + lifeTimeRegister + ".z\n"; - break; - case 3: - code += "sub " + accTime + "," + accTime + "," + lifeTimeRegister + ".z\n"; - code += "max " + tempTime + "," + accTime + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "min " + tempTime + "," + tempTime + "," + lifeTimeRegister + ".w\n"; - break; - } - if (this._iUsesMultiplier) { - code += "mul " + tempColor + "," + tempTime + "," + deltaMulValues[i] + "\n"; - code += "add " + accMultiplierColor + "," + accMultiplierColor + "," + tempColor + "\n"; - } - if (this._iUsesOffset) { - code += "mul " + tempColor + "," + tempTime + "," + deltaOffsetValues[i] + "\n"; - code += "add " + animationRegisterCache.colorAddTarget + "," + animationRegisterCache.colorAddTarget + "," + tempColor + "\n"; - } - } - - //for the last segment: - if (this._iNumSegmentPoint == 0) - tempTime = animationRegisterCache.vertexLife; - else { - switch (this._iNumSegmentPoint) { - case 1: - code += "sub " + accTime + "," + animationRegisterCache.vertexLife + "," + lifeTimeRegister + ".x\n"; - break; - case 2: - code += "sub " + accTime + "," + accTime + "," + lifeTimeRegister + ".y\n"; - break; - case 3: - code += "sub " + accTime + "," + accTime + "," + lifeTimeRegister + ".z\n"; - break; - case 4: - code += "sub " + accTime + "," + accTime + "," + lifeTimeRegister + ".w\n"; - break; - } - code += "max " + tempTime + "," + accTime + "," + animationRegisterCache.vertexZeroConst + "\n"; - } - if (this._iUsesMultiplier) { - code += "mul " + tempColor + "," + tempTime + "," + deltaMulValues[this._iNumSegmentPoint] + "\n"; - code += "add " + accMultiplierColor + "," + accMultiplierColor + "," + tempColor + "\n"; - code += "mul " + animationRegisterCache.colorMulTarget + "," + animationRegisterCache.colorMulTarget + "," + accMultiplierColor + "\n"; - } - if (this._iUsesOffset) { - code += "mul " + tempColor + "," + tempTime + "," + deltaOffsetValues[this._iNumSegmentPoint] + "\n"; - code += "add " + animationRegisterCache.colorAddTarget + "," + animationRegisterCache.colorAddTarget + "," + tempColor + "\n"; - } - - } - return code; - } - - } - -} diff --git a/src/away/animators/nodes/ParticleSpriteSheetNode.ts b/src/away/animators/nodes/ParticleSpriteSheetNode.ts deleted file mode 100644 index 2988c1b1c..000000000 --- a/src/away/animators/nodes/ParticleSpriteSheetNode.ts +++ /dev/null @@ -1,195 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used when a spritesheet texture is required to animate the particle. - * NB: to enable use of this node, the repeat property on the material has to be set to true. - */ - export class ParticleSpriteSheetNode extends ParticleNodeBase - { - /** @private */ - public static UV_INDEX_0:number /*uint*/ = 0; - - /** @private */ - public static UV_INDEX_1:number /*uint*/ = 1; - - /** @private */ - public _iUsesCycle:boolean; - - /** @private */ - public _iUsesPhase:boolean; - - /** @private */ - public _iTotalFrames:number /*int*/; - /** @private */ - public _iNumColumns:number /*int*/; - /** @private */ - public _iNumRows:number /*int*/; - /** @private */ - public _iCycleDuration:number; - /** @private */ - public _iCyclePhase:number; - - /** - * Reference for spritesheet node properties on a single particle (when in local property mode). - * Expects a Vector3D representing the cycleDuration (x), optional phaseTime (y). - */ - public static UV_VECTOR3D:string = "UVVector3D"; - - /** - * Defines the number of columns in the spritesheet, when in global mode. Defaults to 1. Read only. - */ - public get numColumns():number - { - return this._iNumColumns; - } - - /** - * Defines the number of rows in the spritesheet, when in global mode. Defaults to 1. Read only. - */ - public get numRows():number - { - return this._iNumRows; - } - - /** - * Defines the total number of frames used by the spritesheet, when in global mode. Defaults to the number defined by numColumns and numRows. Read only. - */ - public get totalFrames():number - { - return this._iTotalFrames; - } - - /** - * Creates a new ParticleSpriteSheetNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] numColumns Defines the number of columns in the spritesheet, when in global mode. Defaults to 1. - * @param [optional] numRows Defines the number of rows in the spritesheet, when in global mode. Defaults to 1. - * @param [optional] cycleDuration Defines the default cycle duration in seconds, when in global mode. Defaults to 1. - * @param [optional] cyclePhase Defines the default cycle phase, when in global mode. Defaults to 0. - * @param [optional] totalFrames Defines the total number of frames used by the spritesheet, when in global mode. Defaults to the number defined by numColumns and numRows. - * @param [optional] looping Defines whether the spritesheet animation is set to loop indefinitely. Defaults to true. - */ - constructor(mode:number /*uint*/, usesCycle:boolean, usesPhase:boolean, numColumns:number /*int*/ = 1, numRows:number /*uint*/ = 1, cycleDuration:number = 1, cyclePhase:number = 0, totalFrames:number /*uint*/ = Number.MAX_VALUE) - { - super("ParticleSpriteSheet", mode, usesCycle? (usesPhase? 3 : 2) : 1, ParticleAnimationSet.POST_PRIORITY + 1); - - this._pStateClass = ParticleSpriteSheetState; - - this._iUsesCycle = usesCycle; - this._iUsesPhase = usesPhase; - - this._iNumColumns = numColumns; - this._iNumRows = numRows; - this._iCyclePhase = cyclePhase; - this._iCycleDuration = cycleDuration; - this._iTotalFrames = Math.min(totalFrames, numColumns*numRows); - } - - /** - * @inheritDoc - */ - public getAGALUVCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string - { - //get 2 vc - var uvParamConst1:ShaderRegisterElement = animationRegisterCache.getFreeVertexConstant(); - var uvParamConst2:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleSpriteSheetNode.UV_INDEX_0, uvParamConst1.index); - animationRegisterCache.setRegisterIndex(this, ParticleSpriteSheetNode.UV_INDEX_1, uvParamConst2.index); - - var uTotal:ShaderRegisterElement = new ShaderRegisterElement(uvParamConst1.regName, uvParamConst1.index, 0); - var uStep:ShaderRegisterElement = new ShaderRegisterElement(uvParamConst1.regName, uvParamConst1.index, 1); - var vStep:ShaderRegisterElement = new ShaderRegisterElement(uvParamConst1.regName, uvParamConst1.index, 2); - - var uSpeed:ShaderRegisterElement = new ShaderRegisterElement(uvParamConst2.regName, uvParamConst2.index, 0); - var cycle:ShaderRegisterElement = new ShaderRegisterElement(uvParamConst2.regName, uvParamConst2.index, 1); - var phaseTime:ShaderRegisterElement = new ShaderRegisterElement(uvParamConst2.regName, uvParamConst2.index, 2); - - var temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - var time:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 0); - var vOffset:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 1); - temp = new ShaderRegisterElement(temp.regName, temp.index, 2); - var temp2:ShaderRegisterElement = new ShaderRegisterElement(temp.regName, temp.index, 3); - - var u:ShaderRegisterElement = new ShaderRegisterElement(animationRegisterCache.uvTarget.regName, animationRegisterCache.uvTarget.index, 0); - var v:ShaderRegisterElement = new ShaderRegisterElement(animationRegisterCache.uvTarget.regName, animationRegisterCache.uvTarget.index, 1); - - var code:string = ""; - //scale uv - code += "mul " + u + "," + u + "," + uStep + "\n"; - if (this._iNumRows > 1) - code += "mul " + v + "," + v + "," + vStep + "\n"; - - if (this._iUsesCycle) { - if (this._iUsesPhase) - code += "add " + time + "," + animationRegisterCache.vertexTime + "," + phaseTime + "\n"; - else - code += "mov " + time + "," + animationRegisterCache.vertexTime + "\n"; - code += "div " + time + "," + time + "," + cycle + "\n"; - code += "frc " + time + "," + time + "\n"; - code += "mul " + time + "," + time + "," + cycle + "\n"; - code += "mul " + temp + "," + time + "," + uSpeed + "\n"; - } else - code += "mul " + temp.toString() + "," + animationRegisterCache.vertexLife + "," + uTotal + "\n"; - - if (this._iNumRows > 1) { - code += "frc " + temp2 + "," + temp + "\n"; - code += "sub " + vOffset + "," + temp + "," + temp2 + "\n"; - code += "mul " + vOffset + "," + vOffset + "," + vStep + "\n"; - code += "add " + v + "," + v + "," + vOffset + "\n"; - } - - code += "div " + temp2 + "," + temp + "," + uStep + "\n"; - code += "frc " + temp + "," + temp2 + "\n"; - code += "sub " + temp2 + "," + temp2 + "," + temp + "\n"; - code += "mul " + temp + "," + temp2 + "," + uStep + "\n"; - - if (this._iNumRows > 1) - code += "frc " + temp + "," + temp + "\n"; - code += "add " + u + "," + u + "," + temp + "\n"; - - return code; - } - - /** - * @inheritDoc - */ - public getAnimationState(animator:AnimatorBase):ParticleSpriteSheetState - { - return animator.getAnimationState(this); - } - - /** - * @inheritDoc - */ - public _iProcessAnimationSetting(particleAnimationSet:ParticleAnimationSet) - { - particleAnimationSet.hasUVNode = true; - } - - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param:ParticleProperties) - { - if (this._iUsesCycle) { - var uvCycle:Vector3D = param[ParticleSpriteSheetNode.UV_VECTOR3D]; - if (!uvCycle) - throw(new Error("there is no " + ParticleSpriteSheetNode.UV_VECTOR3D + " in param!")); - if (uvCycle.x <= 0) - throw(new Error("the cycle duration must be greater than zero")); - var uTotal:number = this._iTotalFrames/this._iNumColumns; - this._pOneData[0] = uTotal/uvCycle.x; - this._pOneData[1] = uvCycle.x; - if (this._iUsesPhase) - this._pOneData[2] = uvCycle.y; - } - } - } -} diff --git a/src/away/animators/nodes/ParticleTimeNode.ts b/src/away/animators/nodes/ParticleTimeNode.ts deleted file mode 100644 index a7aeb9267..000000000 --- a/src/away/animators/nodes/ParticleTimeNode.ts +++ /dev/null @@ -1,105 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used as the base node for timekeeping inside a particle. Automatically added to a particle animation set on instatiation. - */ - export class ParticleTimeNode extends ParticleNodeBase - { - /** @private */ - public static TIME_STREAM_INDEX:number /*uint*/ = 0; - - /** @private */ - public static TIME_CONSTANT_INDEX:number /*uint*/ = 1; - - /** @private */ - public _iUsesDuration:boolean; - /** @private */ - public _iUsesDelay:boolean; - /** @private */ - public _iUsesLooping:boolean; - - /** - * Creates a new ParticleTimeNode - * - * @param [optional] usesDuration Defines whether the node uses the duration data in the static properties to determine how long a particle is visible for. Defaults to false. - * @param [optional] usesDelay Defines whether the node uses the delay data in the static properties to determine how long a particle is hidden for. Defaults to false. Requires usesDuration to be true. - * @param [optional] usesLooping Defines whether the node creates a looping timeframe for each particle determined by the startTime, duration and delay data in the static properties function. Defaults to false. Requires usesLooping to be true. - */ - constructor(usesDuration:boolean = false, usesLooping:boolean = false, usesDelay:boolean = false) - { - this._pStateClass = ParticleTimeState; - - this._iUsesDuration = usesDuration; - this._iUsesLooping = usesLooping; - this._iUsesDelay = usesDelay; - - super("ParticleTime", ParticlePropertiesMode.LOCAL_STATIC, 4, 0); - } - - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string - { - var timeStreamRegister:ShaderRegisterElement = animationRegisterCache.getFreeVertexAttribute(); //timeStreamRegister.x is start,timeStreamRegister.y is during time - animationRegisterCache.setRegisterIndex(this, ParticleTimeNode.TIME_STREAM_INDEX, timeStreamRegister.index); - var timeConst:ShaderRegisterElement = animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.setRegisterIndex(this, ParticleTimeNode.TIME_CONSTANT_INDEX, timeConst.index); - - var code:string = ""; - code += "sub " + animationRegisterCache.vertexTime + "," + timeConst + "," + timeStreamRegister + ".x\n"; - //if time=0,set the position to zero. - var temp:ShaderRegisterElement = animationRegisterCache.getFreeVertexSingleTemp(); - code += "sge " + temp + "," + animationRegisterCache.vertexTime + "," + animationRegisterCache.vertexZeroConst + "\n"; - code += "mul " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + temp + "\n"; - if (this._iUsesDuration) { - if (this._iUsesLooping) { - var div:ShaderRegisterElement = animationRegisterCache.getFreeVertexSingleTemp(); - if (this._iUsesDelay) { - code += "div " + div + "," + animationRegisterCache.vertexTime + "," + timeStreamRegister + ".z\n"; - code += "frc " + div + "," + div + "\n"; - code += "mul " + animationRegisterCache.vertexTime + "," + div + "," + timeStreamRegister + ".z\n"; - code += "slt " + div + "," + animationRegisterCache.vertexTime + "," + timeStreamRegister + ".y\n"; - code += "mul " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + div + "\n"; - } else { - code += "mul " + div + "," + animationRegisterCache.vertexTime + "," + timeStreamRegister + ".w\n"; - code += "frc " + div + "," + div + "\n"; - code += "mul " + animationRegisterCache.vertexTime + "," + div + "," + timeStreamRegister + ".y\n"; - } - } else { - var sge:ShaderRegisterElement = animationRegisterCache.getFreeVertexSingleTemp(); - code += "sge " + sge + "," + timeStreamRegister + ".y," + animationRegisterCache.vertexTime + "\n"; - code += "mul " + animationRegisterCache.scaleAndRotateTarget + ".xyz," + animationRegisterCache.scaleAndRotateTarget + ".xyz," + sge + "\n"; - } - } - code += "mul " + animationRegisterCache.vertexLife + "," + animationRegisterCache.vertexTime + "," + timeStreamRegister + ".w\n"; - return code; - } - - /** - * @inheritDoc - */ - public getAnimationState(animator:AnimatorBase):ParticleTimeState - { - return animator.getAnimationState(this); - } - - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param:ParticleProperties) - { - this._pOneData[0] = param.startTime; - this._pOneData[1] = param.duration; - this._pOneData[2] = param.delay + param.duration; - this._pOneData[3] = 1/param.duration; - - } - } -} diff --git a/src/away/animators/nodes/ParticleUVNode.ts b/src/away/animators/nodes/ParticleUVNode.ts deleted file mode 100644 index 63cb8307c..000000000 --- a/src/away/animators/nodes/ParticleUVNode.ts +++ /dev/null @@ -1,146 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used to control the UV offset and scale of a particle over time. - */ - export class ParticleUVNode extends ParticleNodeBase - { - /** @private */ - public static UV_INDEX:number /*uint*/ = 0; - - /** @private */ - public _iUvData:Vector3D; - - /** - * - */ - public static U_AXIS:string = "x"; - - /** - * - */ - public static V_AXIS:string = "y"; - - private _cycle:number; - private _scale:number; - private _axis:string; - - /** - * Creates a new ParticleTimeNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] cycle Defines whether the time track is in loop mode. Defaults to false. - * @param [optional] scale Defines whether the time track is in loop mode. Defaults to false. - * @param [optional] axis Defines whether the time track is in loop mode. Defaults to false. - */ - constructor(mode:number /*uint*/, cycle:number = 1, scale:number = 1, axis:string = "x") - { - //because of the stage3d register limitation, it only support the global mode - super("ParticleUV", ParticlePropertiesMode.GLOBAL, 4, ParticleAnimationSet.POST_PRIORITY + 1); - - this._pStateClass = ParticleUVState; - - this._cycle = cycle; - this._scale = scale; - this._axis = axis; - - this.updateUVData(); - } - - /** - * - */ - public get cycle():number - { - return this._cycle; - } - - public set cycle(value:number) - { - this._cycle = value; - - this.updateUVData(); - } - - /** - * - */ - public get scale():number - { - return this._scale; - } - - public set scale(value:number) - { - this._scale = value; - - this.updateUVData(); - } - - /** - * - */ - public get axis():string - { - return this._axis; - } - - public set axis(value:string) - { - this._axis = value; - } - - /** - * @inheritDoc - */ - public getAGALUVCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string - { - var code:string = ""; - - var uvConst:ShaderRegisterElement = animationRegisterCache.getFreeVertexConstant(); - animationRegisterCache.setRegisterIndex(this, ParticleUVNode.UV_INDEX, uvConst.index); - - var axisIndex:number = this._axis == "x"? 0 : (this._axis == "y"? 1 : 2); - - var target:ShaderRegisterElement = new ShaderRegisterElement(animationRegisterCache.uvTarget.regName, animationRegisterCache.uvTarget.index, axisIndex); - - var sin:ShaderRegisterElement = animationRegisterCache.getFreeVertexSingleTemp(); - - if (this._scale != 1) - code += "mul " + target + "," + target + "," + uvConst + ".y\n"; - - code += "mul " + sin + "," + animationRegisterCache.vertexTime + "," + uvConst + ".x\n"; - code += "sin " + sin + "," + sin + "\n"; - code += "add " + target + "," + target + "," + sin + "\n"; - - return code; - } - - /** - * @inheritDoc - */ - public getAnimationState(animator:AnimatorBase):ParticleUVState - { - return animator.getAnimationState(this); - } - - private updateUVData() - { - this._iUvData = new Vector3D(Math.PI*2/this._cycle, this._scale, 0, 0); - } - - /** - * @inheritDoc - */ - public _iProcessAnimationSetting(particleAnimationSet:ParticleAnimationSet) - { - particleAnimationSet.hasUVNode = true; - } - } -} diff --git a/src/away/animators/nodes/ParticleVelocityNode.ts b/src/away/animators/nodes/ParticleVelocityNode.ts deleted file mode 100644 index 93095db1c..000000000 --- a/src/away/animators/nodes/ParticleVelocityNode.ts +++ /dev/null @@ -1,82 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - import ShaderObjectBase = away.materials.ShaderObjectBase; - import ShaderRegisterElement = away.materials.ShaderRegisterElement; - - /** - * A particle animation node used to set the starting velocity of a particle. - */ - export class ParticleVelocityNode extends ParticleNodeBase - { - /** @private */ - public static VELOCITY_INDEX:number /*int*/ = 0; - - /** @private */ - public _iVelocity:Vector3D; - - /** - * Reference for velocity node properties on a single particle (when in local property mode). - * Expects a Vector3D object representing the direction of movement on the particle. - */ - public static VELOCITY_VECTOR3D:string = "VelocityVector3D"; - - /** - * Creates a new ParticleVelocityNode - * - * @param mode Defines whether the mode of operation acts on local properties of a particle or global properties of the node. - * @param [optional] velocity Defines the default velocity vector of the node, used when in global mode. - */ - constructor(mode:number /*uint*/, velocity:Vector3D = null) - { - super("ParticleVelocity", mode, 3); - - this._pStateClass = ParticleVelocityState; - - this._iVelocity = velocity || new Vector3D(); - } - - /** - * @inheritDoc - */ - public getAGALVertexCode(shaderObject:ShaderObjectBase, animationRegisterCache:AnimationRegisterCache):string - { - var velocityValue:ShaderRegisterElement = (this._pMode == ParticlePropertiesMode.GLOBAL)? animationRegisterCache.getFreeVertexConstant() : animationRegisterCache.getFreeVertexAttribute(); - animationRegisterCache.setRegisterIndex(this, ParticleVelocityNode.VELOCITY_INDEX, velocityValue.index); - - var distance:ShaderRegisterElement = animationRegisterCache.getFreeVertexVectorTemp(); - var code:string = ""; - code += "mul " + distance + "," + animationRegisterCache.vertexTime + "," + velocityValue + "\n"; - code += "add " + animationRegisterCache.positionTarget + ".xyz," + distance + "," + animationRegisterCache.positionTarget + ".xyz\n"; - - if (animationRegisterCache.needVelocity) - code += "add " + animationRegisterCache.velocityTarget + ".xyz," + velocityValue + ".xyz," + animationRegisterCache.velocityTarget + ".xyz\n"; - - return code; - } - - /** - * @inheritDoc - */ - public getAnimationState(animator:AnimatorBase):ParticleVelocityState - { - return animator.getAnimationState(this); - } - - /** - * @inheritDoc - */ - public _iGeneratePropertyOfOneParticle(param:ParticleProperties) - { - var _tempVelocity:Vector3D = param[ParticleVelocityNode.VELOCITY_VECTOR3D]; - if (!_tempVelocity) - throw new Error("there is no " + ParticleVelocityNode.VELOCITY_VECTOR3D + " in param!"); - - this._pOneData[0] = _tempVelocity.x; - this._pOneData[1] = _tempVelocity.y; - this._pOneData[2] = _tempVelocity.z; - } - } -} diff --git a/src/away/animators/nodes/SkeletonBinaryLERPNode.ts b/src/away/animators/nodes/SkeletonBinaryLERPNode.ts deleted file mode 100644 index 2f6ee0823..000000000 --- a/src/away/animators/nodes/SkeletonBinaryLERPNode.ts +++ /dev/null @@ -1,38 +0,0 @@ -/// - -module away.animators -{ - /** - * A skeleton animation node that uses two animation node inputs to blend a lineraly interpolated output of a skeleton pose. - */ - export class SkeletonBinaryLERPNode extends AnimationNodeBase - { - /** - * Defines input node A to use for the blended output. - */ - public inputA:AnimationNodeBase; - - /** - * Defines input node B to use for the blended output. - */ - public inputB:AnimationNodeBase; - - /** - * Creates a new SkeletonBinaryLERPNode object. - */ - constructor() - { - super(); - - this._pStateClass = SkeletonBinaryLERPState; - } - - /** - * @inheritDoc - */ - public getAnimationState(animator:AnimatorBase):SkeletonBinaryLERPState - { - return animator.getAnimationState(this); - } - } -} diff --git a/src/away/animators/nodes/SkeletonClipNode.ts b/src/away/animators/nodes/SkeletonClipNode.ts deleted file mode 100644 index 259fb3191..000000000 --- a/src/away/animators/nodes/SkeletonClipNode.ts +++ /dev/null @@ -1,92 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - - /** - * A skeleton animation node containing time-based animation data as individual skeleton poses. - */ - export class SkeletonClipNode extends AnimationClipNodeBase - { - private _frames:Array = new Array(); - - /** - * Determines whether to use SLERP equations (true) or LERP equations (false) in the calculation - * of the output skeleton pose. Defaults to false. - */ - public highQuality:boolean = false; - - /** - * Returns a vector of skeleton poses representing the pose of each animation frame in the clip. - */ - public get frames():Array - { - return this._frames; - } - - /** - * Creates a new SkeletonClipNode object. - */ - constructor() - { - super(); - - this._pStateClass = SkeletonClipState; - } - - /** - * Adds a skeleton pose frame to the internal timeline of the animation node. - * - * @param skeletonPose The skeleton pose object to add to the timeline of the node. - * @param duration The specified duration of the frame in milliseconds. - */ - public addFrame(skeletonPose:SkeletonPose, duration:number /*number /*uint*/) - { - this._frames.push(skeletonPose); - this._pDurations.push(duration); - - this._pNumFrames = this._pDurations.length; - - this._pStitchDirty = true; - } - - /** - * @inheritDoc - */ - public getAnimationState(animator:AnimatorBase):SkeletonClipState - { - return animator.getAnimationState(this); - } - - /** - * @inheritDoc - */ - public _pUpdateStitch() - { - super._pUpdateStitch(); - - var i:number /*uint*/ = this._pNumFrames - 1; - var p1:Vector3D, p2:Vector3D, delta:Vector3D; - while (i--) { - this._pTotalDuration += this._pDurations[i]; - p1 = this._frames[i].jointPoses[0].translation; - p2 = this._frames[i + 1].jointPoses[0].translation; - delta = p2.subtract(p1); - this._pTotalDelta.x += delta.x; - this._pTotalDelta.y += delta.y; - this._pTotalDelta.z += delta.z; - } - - if (this._pStitchFinalFrame || !this._pLooping) { - this._pTotalDuration += this._pDurations[this._pNumFrames - 1]; - p1 = this._frames[0].jointPoses[0].translation; - p2 = this._frames[1].jointPoses[0].translation; - delta = p2.subtract(p1); - this._pTotalDelta.x += delta.x; - this._pTotalDelta.y += delta.y; - this._pTotalDelta.z += delta.z; - } - } - } -} diff --git a/src/away/animators/nodes/SkeletonDifferenceNode.ts b/src/away/animators/nodes/SkeletonDifferenceNode.ts deleted file mode 100644 index f8ddad1a9..000000000 --- a/src/away/animators/nodes/SkeletonDifferenceNode.ts +++ /dev/null @@ -1,38 +0,0 @@ -/// - -module away.animators -{ - /** - * A skeleton animation node that uses a difference input pose with a base input pose to blend a linearly interpolated output of a skeleton pose. - */ - export class SkeletonDifferenceNode extends AnimationNodeBase - { - /** - * Defines a base input node to use for the blended output. - */ - public baseInput:AnimationNodeBase; - - /** - * Defines a difference input node to use for the blended output. - */ - public differenceInput:AnimationNodeBase; - - /** - * Creates a new SkeletonAdditiveNode object. - */ - constructor() - { - super(); - - this._pStateClass = SkeletonDifferenceState; - } - - /** - * @inheritDoc - */ - public getAnimationState(animator:AnimatorBase):SkeletonDifferenceState - { - return animator.getAnimationState(this); - } - } -} diff --git a/src/away/animators/nodes/SkeletonDirectionalNode.ts b/src/away/animators/nodes/SkeletonDirectionalNode.ts deleted file mode 100644 index 544601ded..000000000 --- a/src/away/animators/nodes/SkeletonDirectionalNode.ts +++ /dev/null @@ -1,47 +0,0 @@ -/// - -module away.animators -{ - - /** - * A skeleton animation node that uses four directional input poses with an input direction to blend a linearly interpolated output of a skeleton pose. - */ - export class SkeletonDirectionalNode extends AnimationNodeBase - { - /** - * Defines the forward configured input node to use for the blended output. - */ - public forward:AnimationNodeBase; - - /** - * Defines the backwards configured input node to use for the blended output. - */ - public backward:AnimationNodeBase; - - /** - * Defines the left configured input node to use for the blended output. - */ - public left:AnimationNodeBase; - - /** - * Defines the right configured input node to use for the blended output. - */ - public right:AnimationNodeBase; - - constructor() - { - super(); - - this._pStateClass = SkeletonDirectionalState; - } - - /** - * @inheritDoc - */ - public getAnimationState(animator:AnimatorBase):SkeletonDirectionalState - { - return animator.getAnimationState(this); - } - - } -} diff --git a/src/away/animators/nodes/SkeletonNaryLERPNode.ts b/src/away/animators/nodes/SkeletonNaryLERPNode.ts deleted file mode 100644 index 91281808a..000000000 --- a/src/away/animators/nodes/SkeletonNaryLERPNode.ts +++ /dev/null @@ -1,66 +0,0 @@ -/// - -module away.animators -{ - - /** - * A skeleton animation node that uses an n-dimensional array of animation node inputs to blend a lineraly interpolated output of a skeleton pose. - */ - export class SkeletonNaryLERPNode extends AnimationNodeBase - { - public _iInputs:Array = new Array(); - - private _numInputs:number /*uint*/; - - public get numInputs():number /*uint*/ - { - return this._numInputs; - } - - /** - * Creates a new SkeletonNaryLERPNode object. - */ - constructor() - { - super(); - - this._pStateClass = SkeletonNaryLERPState; - } - - /** - * Returns an integer representing the input index of the given skeleton animation node. - * - * @param input The skeleton animation node for with the input index is requested. - */ - public getInputIndex(input:AnimationNodeBase):number /*int*/ - { - return this._iInputs.indexOf(input); - } - - /** - * Returns the skeleton animation node object that resides at the given input index. - * - * @param index The input index for which the skeleton animation node is requested. - */ - public getInputAt(index:number /*uint*/):AnimationNodeBase - { - return this._iInputs[index]; - } - - /** - * Adds a new skeleton animation node input to the animation node. - */ - public addInput(input:AnimationNodeBase) - { - this._iInputs[this._numInputs++] = input; - } - - /** - * @inheritDoc - */ - public getAnimationState(animator:AnimatorBase):SkeletonNaryLERPState - { - return animator.getAnimationState(this); - } - } -} diff --git a/src/away/animators/nodes/VertexClipNode.ts b/src/away/animators/nodes/VertexClipNode.ts deleted file mode 100644 index 09ced3a0f..000000000 --- a/src/away/animators/nodes/VertexClipNode.ts +++ /dev/null @@ -1,79 +0,0 @@ -/// - -module away.animators -{ - /** - * A vertex animation node containing time-based animation data as individual geometry obejcts. - */ - export class VertexClipNode extends AnimationClipNodeBase - { - private _frames:Array = new Array(); - private _translations:Array = new Array(); - - /** - * Returns a vector of geometry frames representing the vertex values of each animation frame in the clip. - */ - public get frames():Array - { - return this._frames; - } - - /** - * Creates a new VertexClipNode object. - */ - constructor() - { - super(); - - this._pStateClass = away.animators.VertexClipState; - } - - /** - * Adds a geometry object to the internal timeline of the animation node. - * - * @param geometry The geometry object to add to the timeline of the node. - * @param duration The specified duration of the frame in milliseconds. - * @param translation The absolute translation of the frame, used in root delta calculations for mesh movement. - */ - public addFrame(geometry:away.base.Geometry, duration:number /*uint*/, translation:away.geom.Vector3D = null) - { - this._frames.push(geometry); - this._pDurations.push(duration); - this._translations.push(translation || new away.geom.Vector3D()); - - this._pNumFrames = this._pDurations.length; - - this._pStitchDirty = true; - } - - /** - * @inheritDoc - */ - public _pUpdateStitch() - { - super._pUpdateStitch(); - - var i:number /*uint*/ = this._pNumFrames - 1; - var p1:away.geom.Vector3D, p2:away.geom.Vector3D, delta:away.geom.Vector3D; - while (i--) { - this._pTotalDuration += this._pDurations[i]; - p1 = this._translations[i]; - p2 = this._translations[i + 1]; - delta = p2.subtract(p1); - this._pTotalDelta.x += delta.x; - this._pTotalDelta.y += delta.y; - this._pTotalDelta.z += delta.z; - } - - if (this._pNumFrames > 1 && (this._pStitchFinalFrame || !this._pLooping)) { - this._pTotalDuration += this._pDurations[this._pNumFrames - 1]; - p1 = this._translations[0]; - p2 = this._translations[1]; - delta = p2.subtract(p1); - this._pTotalDelta.x += delta.x; - this._pTotalDelta.y += delta.y; - this._pTotalDelta.z += delta.z; - } - } - } -} diff --git a/src/away/animators/states/AnimationClipState.ts b/src/away/animators/states/AnimationClipState.ts deleted file mode 100644 index ae7f8a4d2..000000000 --- a/src/away/animators/states/AnimationClipState.ts +++ /dev/null @@ -1,172 +0,0 @@ -/// -module away.animators -{ - /** - * - */ - export class AnimationClipState extends AnimationStateBase - { - private _animationClipNode:AnimationClipNodeBase; - private _animationStatePlaybackComplete:away.events.AnimationStateEvent; - public _pBlendWeight:number; - public _pCurrentFrame:number /*uint*/; - public _pNextFrame:number /*uint*/; - - public _pOldFrame:number /*uint*/; - public _pTimeDir:number /*int*/; - public _pFramesDirty:boolean = true; - - /** - * Returns a fractional value between 0 and 1 representing the blending ratio of the current playhead position - * between the current frame (0) and next frame (1) of the animation. - * - * @see #currentFrame - * @see #nextFrame - */ - public get blendWeight():number - { - if (this._pFramesDirty) - this._pUpdateFrames(); - - return this._pBlendWeight; - } - - /** - * Returns the current frame of animation in the clip based on the internal playhead position. - */ - public get currentFrame():number /*uint*/ - { - if (this._pFramesDirty) - this._pUpdateFrames(); - - return this._pCurrentFrame; - } - - /** - * Returns the next frame of animation in the clip based on the internal playhead position. - */ - public get nextFrame():number /*uint*/ - { - if (this._pFramesDirty) - this._pUpdateFrames(); - - return this._pNextFrame; - } - - constructor(animator:AnimatorBase, animationClipNode:AnimationClipNodeBase) - { - super(animator, animationClipNode); - - this._animationClipNode = animationClipNode; - } - - /** - * @inheritDoc - */ - public update(time:number /*int*/) - { - if (!this._animationClipNode.looping) { - if (time > this._pStartTime + this._animationClipNode.totalDuration) - time = this._pStartTime + this._animationClipNode.totalDuration; else if (time < this._pStartTime) - time = this._pStartTime; - } - - if (this._pTime == time - this._pStartTime) - return; - - this._pUpdateTime(time); - } - - /** - * @inheritDoc - */ - public phase(value:number) - { - var time:number /*int*/ = value*this._animationClipNode.totalDuration + this._pStartTime; - - if (this._pTime == time - this._pStartTime) - return; - - this._pUpdateTime(time); - } - - /** - * @inheritDoc - */ - public _pUpdateTime(time:number /*int*/) - { - this._pFramesDirty = true; - - this._pTimeDir = (time - this._pStartTime > this._pTime)? 1 : -1; - - super._pUpdateTime(time); - } - - /** - * Updates the nodes internal playhead to determine the current and next animation frame, and the blendWeight between the two. - * - * @see #currentFrame - * @see #nextFrame - * @see #blendWeight - */ - public _pUpdateFrames() - { - this._pFramesDirty = false; - - var looping:boolean = this._animationClipNode.looping; - var totalDuration:number /*uint*/ = this._animationClipNode.totalDuration; - var lastFrame:number /*uint*/ = this._animationClipNode.lastFrame; - var time:number /*int*/ = this._pTime; - - //trace("time", time, totalDuration) - if (looping && (time >= totalDuration || time < 0)) { - time %= totalDuration; - if (time < 0) - time += totalDuration; - } - - if (!looping && time >= totalDuration) { - this.notifyPlaybackComplete(); - this._pCurrentFrame = lastFrame; - this._pNextFrame = lastFrame; - this._pBlendWeight = 0; - } else if (!looping && time <= 0) { - this._pCurrentFrame = 0; - this._pNextFrame = 0; - this._pBlendWeight = 0; - } else if (this._animationClipNode.fixedFrameRate) { - var t:number = time/totalDuration*lastFrame; - this._pCurrentFrame = Math.floor(t); - this._pBlendWeight = t - this._pCurrentFrame; - this._pNextFrame = this._pCurrentFrame + 1; - } else { - this._pCurrentFrame = 0; - this._pNextFrame = 0; - - var dur:number /*uint*/ = 0, frameTime:number /*uint*/; - var durations:Array /*uint*/ = this._animationClipNode.durations; - - do { - frameTime = dur; - dur += durations[this._pNextFrame]; - this._pCurrentFrame = this._pNextFrame++; - } while (time > dur); - - if (this._pCurrentFrame == lastFrame) { - this._pCurrentFrame = 0; - this._pNextFrame = 1; - } - - this._pBlendWeight = (time - frameTime)/durations[this._pCurrentFrame]; - } - } - - private notifyPlaybackComplete() - { - if (this._animationStatePlaybackComplete == null) - this._animationStatePlaybackComplete = new away.events.AnimationStateEvent(away.events.AnimationStateEvent.PLAYBACK_COMPLETE, this._pAnimator, this, this._animationClipNode); - - this._animationClipNode.dispatchEvent(this._animationStatePlaybackComplete); - } - } -} diff --git a/src/away/animators/states/AnimationStateBase.ts b/src/away/animators/states/AnimationStateBase.ts deleted file mode 100644 index 6753660ed..000000000 --- a/src/away/animators/states/AnimationStateBase.ts +++ /dev/null @@ -1,98 +0,0 @@ -/// -module away.animators -{ - - /** - * - */ - export class AnimationStateBase implements IAnimationState - { - public _pAnimationNode:away.animators.AnimationNodeBase; - public _pRootDelta:away.geom.Vector3D = new away.geom.Vector3D(); - public _pPositionDeltaDirty:boolean = true; - - public _pTime:number; - public _pStartTime:number = 0; - public _pAnimator:away.animators.AnimatorBase; - - /** - * Returns a 3d vector representing the translation delta of the animating entity for the current timestep of animation - */ - public get positionDelta():away.geom.Vector3D - { - if (this._pPositionDeltaDirty) { - - this._pUpdatePositionDelta(); - } - - return this._pRootDelta; - - } - - constructor(animator:away.animators.AnimatorBase, animationNode:away.animators.AnimationNodeBase) - { - this._pAnimator = animator; - this._pAnimationNode = animationNode; - } - - /** - * Resets the start time of the node to a new value. - * - * @param startTime The absolute start time (in milliseconds) of the node's starting time. - */ - public offset(startTime:number) - { - this._pStartTime = startTime; - - this._pPositionDeltaDirty = true; - } - - /** - * Updates the configuration of the node to its current state. - * - * @param time The absolute time (in milliseconds) of the animator's play head position. - * - * @see away.animators.AnimatorBase#update() - */ - public update(time:number) - { - if (this._pTime == time - this._pStartTime) { - - return; - - } - - this._pUpdateTime(time); - - } - - /** - * Sets the animation phase of the node. - * - * @param value The phase value to use. 0 represents the beginning of an animation clip, 1 represents the end. - */ - public phase(value:number) - { - - } - - /** - * Updates the node's internal playhead position. - * - * @param time The local time (in milliseconds) of the node's playhead position. - */ - public _pUpdateTime(time:number) - { - this._pTime = time - this._pStartTime; - - this._pPositionDeltaDirty = true; - } - - /** - * Updates the node's root delta position - */ - public _pUpdatePositionDelta() - { - } - } -} diff --git a/src/away/animators/states/ISkeletonAnimationState.ts b/src/away/animators/states/ISkeletonAnimationState.ts deleted file mode 100644 index d8ea54aaf..000000000 --- a/src/away/animators/states/ISkeletonAnimationState.ts +++ /dev/null @@ -1,12 +0,0 @@ -/// - -module away.animators -{ - export interface ISkeletonAnimationState extends IAnimationState - { - /** - * Returns the output skeleton pose of the animation node. - */ - getSkeletonPose(skeleton:Skeleton):SkeletonPose; - } -} diff --git a/src/away/animators/states/IVertexAnimationState.ts b/src/away/animators/states/IVertexAnimationState.ts deleted file mode 100644 index d1eb53887..000000000 --- a/src/away/animators/states/IVertexAnimationState.ts +++ /dev/null @@ -1,28 +0,0 @@ -/// - -module away.animators -{ - /** - * Provides an interface for animation node classes that hold animation data for use in the Vertex animator class. - * - * @see away.animators.VertexAnimator - */ - export interface IVertexAnimationState extends IAnimationState - { - /** - * Returns the current geometry frame of animation in the clip based on the internal playhead position. - */ - currentGeometry:away.base.Geometry; //GET - - /** - * Returns the current geometry frame of animation in the clip based on the internal playhead position. - */ - nextGeometry:away.base.Geometry; //GET - - /** - * Returns a fractional value between 0 and 1 representing the blending ratio of the current playhead position - * between the current geometry frame (0) and next geometry frame (1) of the animation. - */ - blendWeight:number; //GET - } -} diff --git a/src/away/animators/states/ParticleAccelerationState.ts b/src/away/animators/states/ParticleAccelerationState.ts deleted file mode 100644 index 1ce6c43a6..000000000 --- a/src/away/animators/states/ParticleAccelerationState.ts +++ /dev/null @@ -1,67 +0,0 @@ -/// - -module away.animators -{ - import RenderableBase = away.pool.RenderableBase; - import Camera = away.entities.Camera; - import ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat - import Vector3D = away.geom.Vector3D; - import Stage = away.base.Stage; - - /** - * ... - */ - export class ParticleAccelerationState extends ParticleStateBase - { - private _particleAccelerationNode:ParticleAccelerationNode; - private _acceleration:Vector3D; - private _halfAcceleration:Vector3D; - - /** - * Defines the acceleration vector of the state, used when in global mode. - */ - public get acceleration():Vector3D - { - return this._acceleration; - } - - public set acceleration(value:Vector3D) - { - this._acceleration.x = value.x; - this._acceleration.y = value.y; - this._acceleration.z = value.z; - - this.updateAccelerationData(); - } - - constructor(animator:ParticleAnimator, particleAccelerationNode:ParticleAccelerationNode) - { - super(animator, particleAccelerationNode); - - this._particleAccelerationNode = particleAccelerationNode; - this._acceleration = this._particleAccelerationNode._acceleration; - - this.updateAccelerationData(); - } - - /** - * @inheritDoc - */ - public setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera) - { - var index:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleAccelerationNode.ACCELERATION_INDEX); - - if (this._particleAccelerationNode.mode == ParticlePropertiesMode.LOCAL_STATIC) - animationSubGeometry.activateVertexBuffer(index, this._particleAccelerationNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); - else - animationRegisterCache.setVertexConst(index, this._halfAcceleration.x, this._halfAcceleration.y, this._halfAcceleration.z); - } - - private updateAccelerationData() - { - if (this._particleAccelerationNode.mode == ParticlePropertiesMode.GLOBAL) - this._halfAcceleration = new Vector3D(this._acceleration.x/2, this._acceleration.y/2, this._acceleration.z/2); - } - } - -} diff --git a/src/away/animators/states/ParticleBezierCurveState.ts b/src/away/animators/states/ParticleBezierCurveState.ts deleted file mode 100644 index 48ab5675a..000000000 --- a/src/away/animators/states/ParticleBezierCurveState.ts +++ /dev/null @@ -1,69 +0,0 @@ -/// - -module away.animators -{ - import RenderableBase = away.pool.RenderableBase; - import Camera = away.entities.Camera; - import ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat - import Vector3D = away.geom.Vector3D; - import Stage = away.base.Stage; - - /** - * ... - */ - export class ParticleBezierCurveState extends ParticleStateBase - { - private _particleBezierCurveNode:ParticleBezierCurveNode; - private _controlPoint:Vector3D; - private _endPoint:Vector3D; - - /** - * Defines the default control point of the node, used when in global mode. - */ - public get controlPoint():Vector3D - { - return this._controlPoint; - } - - public set controlPoint(value:Vector3D) - { - this._controlPoint = value; - } - - /** - * Defines the default end point of the node, used when in global mode. - */ - public get endPoint():Vector3D - { - return this._endPoint; - } - - public set endPoint(value:Vector3D) - { - this._endPoint = value; - } - - constructor(animator:ParticleAnimator, particleBezierCurveNode:ParticleBezierCurveNode) - { - super(animator, particleBezierCurveNode); - - this._particleBezierCurveNode = particleBezierCurveNode; - this._controlPoint = this._particleBezierCurveNode._iControlPoint; - this._endPoint = this._particleBezierCurveNode._iEndPoint; - } - - public setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera) - { - var controlIndex:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleBezierCurveNode.BEZIER_CONTROL_INDEX); - var endIndex:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleBezierCurveNode.BEZIER_END_INDEX); - - if (this._particleBezierCurveNode.mode == ParticlePropertiesMode.LOCAL_STATIC) { - animationSubGeometry.activateVertexBuffer(controlIndex, this._particleBezierCurveNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); - animationSubGeometry.activateVertexBuffer(endIndex, this._particleBezierCurveNode._iDataOffset + 3, stage, ContextGLVertexBufferFormat.FLOAT_3); - } else { - animationRegisterCache.setVertexConst(controlIndex, this._controlPoint.x, this._controlPoint.y, this._controlPoint.z); - animationRegisterCache.setVertexConst(endIndex, this._endPoint.x, this._endPoint.y, this._endPoint.z); - } - } - } -} diff --git a/src/away/animators/states/ParticleBillboardState.ts b/src/away/animators/states/ParticleBillboardState.ts deleted file mode 100644 index 7d96f994a..000000000 --- a/src/away/animators/states/ParticleBillboardState.ts +++ /dev/null @@ -1,86 +0,0 @@ -/// - -module away.animators -{ - import RenderableBase = away.pool.RenderableBase; - import Camera = away.entities.Camera; - import ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat; - import Matrix3D = away.geom.Matrix3D; - import Orientation3D = away.geom.Orientation3D; - import Vector3D = away.geom.Vector3D; - import Stage = away.base.Stage; - import MathConsts = away.geom.MathConsts; - - /** - * ... - */ - export class ParticleBillboardState extends ParticleStateBase - { - private _matrix:Matrix3D = new Matrix3D; - - private _billboardAxis:Vector3D; - - /** - * - */ - constructor(animator:ParticleAnimator, particleNode:ParticleBillboardNode) - { - super(animator, particleNode); - - this._billboardAxis = particleNode._iBillboardAxis; - } - - public setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera) - { - var comps:Array; - if (this._billboardAxis) { - var pos:Vector3D = renderable.sourceEntity.sceneTransform.position; - var look:Vector3D = camera.sceneTransform.position.subtract(pos); - var right:Vector3D = look.crossProduct(this._billboardAxis); - right.normalize(); - look = this.billboardAxis.crossProduct(right); - look.normalize(); - - //create a quick inverse projection matrix - this._matrix.copyFrom(renderable.sourceEntity.sceneTransform); - comps = this._matrix.decompose(Orientation3D.AXIS_ANGLE); - this._matrix.copyColumnFrom(0, right); - this._matrix.copyColumnFrom(1, this.billboardAxis); - this._matrix.copyColumnFrom(2, look); - this._matrix.copyColumnFrom(3, pos); - this._matrix.appendRotation(-comps[1].w*MathConsts.RADIANS_TO_DEGREES, comps[1]); - } else { - //create a quick inverse projection matrix - this._matrix.copyFrom(renderable.sourceEntity.sceneTransform); - this._matrix.append(camera.inverseSceneTransform); - - //decompose using axis angle rotations - comps = this._matrix.decompose(Orientation3D.AXIS_ANGLE); - - //recreate the matrix with just the rotation data - this._matrix.identity(); - this._matrix.appendRotation(-comps[1].w*MathConsts.RADIANS_TO_DEGREES, comps[1]); - } - - //set a new matrix transform constant - animationRegisterCache.setVertexConstFromMatrix(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleBillboardNode.MATRIX_INDEX), this._matrix); - } - - /** - * Defines the billboard axis. - */ - public get billboardAxis():Vector3D - { - return this.billboardAxis; - } - - public set billboardAxis(value:Vector3D) - { - this.billboardAxis = value? value.clone() : null; - if (this.billboardAxis) - this.billboardAxis.normalize(); - } - - } - -} diff --git a/src/away/animators/states/ParticleColorState.ts b/src/away/animators/states/ParticleColorState.ts deleted file mode 100644 index e65f78039..000000000 --- a/src/away/animators/states/ParticleColorState.ts +++ /dev/null @@ -1,174 +0,0 @@ -/// - -module away.animators -{ - import RenderableBase = away.pool.RenderableBase; - import Camera = away.entities.Camera; - import ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat - import ColorTransform = away.geom.ColorTransform; - import Vector3D = away.geom.Vector3D; - import Stage = away.base.Stage; - - /** - * ... - * @author ... - */ - export class ParticleColorState extends ParticleStateBase - { - private _particleColorNode:ParticleColorNode; - private _usesMultiplier:boolean; - private _usesOffset:boolean; - private _usesCycle:boolean; - private _usesPhase:boolean; - private _startColor:ColorTransform; - private _endColor:ColorTransform; - private _cycleDuration:number; - private _cyclePhase:number; - private _cycleData:Vector3D; - private _startMultiplierData:Vector3D; - private _deltaMultiplierData:Vector3D; - private _startOffsetData:Vector3D; - private _deltaOffsetData:Vector3D; - - /** - * Defines the start color transform of the state, when in global mode. - */ - public get startColor():ColorTransform - { - return this._startColor; - } - - public set startColor(value:ColorTransform) - { - this._startColor = value; - - this.updateColorData(); - } - - /** - * Defines the end color transform of the state, when in global mode. - */ - public get endColor():ColorTransform - { - return this._endColor; - } - - public set endColor(value:ColorTransform) - { - this._endColor = value; - - this.updateColorData(); - } - - /** - * Defines the duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. - */ - public get cycleDuration():number - { - return this._cycleDuration; - } - - public set cycleDuration(value:number) - { - this._cycleDuration = value; - - this.updateColorData(); - } - - /** - * Defines the phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. - */ - public get cyclePhase():number - { - return this._cyclePhase; - } - - public set cyclePhase(value:number) - { - this._cyclePhase = value; - - this.updateColorData(); - } - - constructor(animator:ParticleAnimator, particleColorNode:ParticleColorNode) - { - super(animator, particleColorNode); - - this._particleColorNode = particleColorNode; - this._usesMultiplier = this._particleColorNode._iUsesMultiplier; - this._usesOffset = this._particleColorNode._iUsesOffset; - this._usesCycle = this._particleColorNode._iUsesCycle; - this._usesPhase = this._particleColorNode._iUsesPhase; - this._startColor = this._particleColorNode._iStartColor; - this._endColor = this._particleColorNode._iEndColor; - this._cycleDuration = this._particleColorNode._iCycleDuration; - this._cyclePhase = this._particleColorNode._iCyclePhase; - - this.updateColorData(); - } - - public setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera) - { - if (animationRegisterCache.needFragmentAnimation) { - var dataOffset:number /*uint*/ = this._particleColorNode._iDataOffset; - if (this._usesCycle) - animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorNode.CYCLE_INDEX), this._cycleData.x, this._cycleData.y, this._cycleData.z, this._cycleData.w); - - if (this._usesMultiplier) { - if (this._particleColorNode.mode == ParticlePropertiesMode.LOCAL_STATIC) { - animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorNode.START_MULTIPLIER_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); - dataOffset += 4; - animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorNode.DELTA_MULTIPLIER_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); - dataOffset += 4; - } else { - animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorNode.START_MULTIPLIER_INDEX), this._startMultiplierData.x, this._startMultiplierData.y, this._startMultiplierData.z, this._startMultiplierData.w); - animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorNode.DELTA_MULTIPLIER_INDEX), this._deltaMultiplierData.x, this._deltaMultiplierData.y, this._deltaMultiplierData.z, this._deltaMultiplierData.w); - } - } - if (this._usesOffset) { - if (this._particleColorNode.mode == ParticlePropertiesMode.LOCAL_STATIC) { - animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorNode.START_OFFSET_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); - dataOffset += 4; - animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorNode.DELTA_OFFSET_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); - dataOffset += 4; - } else { - animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorNode.START_OFFSET_INDEX), this._startOffsetData.x, this._startOffsetData.y, this._startOffsetData.z, this._startOffsetData.w); - animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleColorNode.DELTA_OFFSET_INDEX), this._deltaOffsetData.x, this._deltaOffsetData.y, this._deltaOffsetData.z, this._deltaOffsetData.w); - } - } - } - } - - private updateColorData() - { - if (this._usesCycle) { - if (this._cycleDuration <= 0) - throw(new Error("the cycle duration must be greater than zero")); - this._cycleData = new Vector3D(Math.PI*2/this._cycleDuration, this._cyclePhase*Math.PI/180, 0, 0); - } - if (this._particleColorNode.mode == ParticlePropertiesMode.GLOBAL) { - if (this._usesCycle) { - if (this._usesMultiplier) { - this._startMultiplierData = new Vector3D((this._startColor.redMultiplier + this._endColor.redMultiplier)/2, (this._startColor.greenMultiplier + this._endColor.greenMultiplier)/2, (this._startColor.blueMultiplier + this._endColor.blueMultiplier)/2, (this._startColor.alphaMultiplier + this._endColor.alphaMultiplier)/2); - this._deltaMultiplierData = new Vector3D((this._endColor.redMultiplier - this._startColor.redMultiplier)/2, (this._endColor.greenMultiplier - this._startColor.greenMultiplier)/2, (this._endColor.blueMultiplier - this._startColor.blueMultiplier)/2, (this._endColor.alphaMultiplier - this._startColor.alphaMultiplier)/2); - } - - if (this._usesOffset) { - this._startOffsetData = new Vector3D((this._startColor.redOffset + this._endColor.redOffset)/(255*2), (this._startColor.greenOffset + this._endColor.greenOffset)/(255*2), (this._startColor.blueOffset + this._endColor.blueOffset)/(255*2), (this._startColor.alphaOffset + this._endColor.alphaOffset)/(255*2)); - this._deltaOffsetData = new Vector3D((this._endColor.redOffset - this._startColor.redOffset)/(255*2), (this._endColor.greenOffset - this._startColor.greenOffset)/(255*2), (this._endColor.blueOffset - this._startColor.blueOffset)/(255*2), (this._endColor.alphaOffset - this._startColor.alphaOffset)/(255*2)); - } - } else { - if (this._usesMultiplier) { - this._startMultiplierData = new Vector3D(this._startColor.redMultiplier, this._startColor.greenMultiplier, this._startColor.blueMultiplier, this._startColor.alphaMultiplier); - this._deltaMultiplierData = new Vector3D((this._endColor.redMultiplier - this._startColor.redMultiplier), (this._endColor.greenMultiplier - this._startColor.greenMultiplier), (this._endColor.blueMultiplier - this._startColor.blueMultiplier), (this._endColor.alphaMultiplier - this._startColor.alphaMultiplier)); - } - - if (this._usesOffset) { - this._startOffsetData = new Vector3D(this._startColor.redOffset/255, this._startColor.greenOffset/255, this._startColor.blueOffset/255, this._startColor.alphaOffset/255); - this._deltaOffsetData = new Vector3D((this._endColor.redOffset - this._startColor.redOffset)/255, (this._endColor.greenOffset - this._startColor.greenOffset)/255, (this._endColor.blueOffset - this._startColor.blueOffset )/255, (this._endColor.alphaOffset - this._startColor.alphaOffset)/255); - } - } - } - } - } -} diff --git a/src/away/animators/states/ParticleFollowState.ts b/src/away/animators/states/ParticleFollowState.ts deleted file mode 100644 index ec83e09f7..000000000 --- a/src/away/animators/states/ParticleFollowState.ts +++ /dev/null @@ -1,253 +0,0 @@ -/// - -module away.animators -{ - import RenderableBase = away.pool.RenderableBase; - import DisplayObject = away.base.DisplayObject; - import Camera = away.entities.Camera; - import ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat - import Vector3D = away.geom.Vector3D; - import Stage = away.base.Stage; - import MathConsts = away.geom.MathConsts; - - /** - * ... - */ - export class ParticleFollowState extends ParticleStateBase - { - private _particleFollowNode:ParticleFollowNode; - private _followTarget:DisplayObject; - - private _targetPos:Vector3D = new Vector3D(); - private _targetEuler:Vector3D = new Vector3D(); - private _prePos:Vector3D; - private _preEuler:Vector3D; - private _smooth:boolean; - - //temporary vector3D for calculation - private _temp:Vector3D = new Vector3D(); - - constructor(animator:ParticleAnimator, particleFollowNode:ParticleFollowNode) - { - super(animator, particleFollowNode, true); - - this._particleFollowNode = particleFollowNode; - this._smooth = particleFollowNode._iSmooth; - } - - public get followTarget():DisplayObject - { - return this._followTarget; - } - - public set followTarget(value:DisplayObject) - { - this._followTarget = value; - } - - public get smooth():boolean - { - return this._smooth; - } - - public set smooth(value:boolean) - { - this._smooth = value; - } - - /** - * @inheritDoc - */ - public setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera) - { - if (this._followTarget) { - if (this._particleFollowNode._iUsesPosition) { - this._targetPos.x = this._followTarget.transform.position.x/renderable.sourceEntity.scaleX; - this._targetPos.y = this._followTarget.transform.position.y/renderable.sourceEntity.scaleY; - this._targetPos.z = this._followTarget.transform.position.z/renderable.sourceEntity.scaleZ; - } - if (this._particleFollowNode._iUsesRotation) { - this._targetEuler.x = this._followTarget.rotationX; - this._targetEuler.y = this._followTarget.rotationY; - this._targetEuler.z = this._followTarget.rotationZ; - this._targetEuler.scaleBy(MathConsts.DEGREES_TO_RADIANS); - } - } - //initialization - if (!this._prePos) - this._prePos = this._targetPos.clone(); - if (!this._preEuler) - this._preEuler = this._targetEuler.clone(); - - var currentTime:number = this._pTime/1000; - var previousTime:number = animationSubGeometry.previousTime; - var deltaTime:number = currentTime - previousTime; - - var needProcess:boolean = previousTime != currentTime; - - if (this._particleFollowNode._iUsesPosition && this._particleFollowNode._iUsesRotation) { - if (needProcess) - this.processPositionAndRotation(currentTime, deltaTime, animationSubGeometry); - - animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleFollowNode.FOLLOW_POSITION_INDEX), this._particleFollowNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); - animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleFollowNode.FOLLOW_ROTATION_INDEX), this._particleFollowNode._iDataOffset + 3, stage, ContextGLVertexBufferFormat.FLOAT_3); - } else if (this._particleFollowNode._iUsesPosition) { - if (needProcess) - this.processPosition(currentTime, deltaTime, animationSubGeometry); - - animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleFollowNode.FOLLOW_POSITION_INDEX), this._particleFollowNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); - } else if (this._particleFollowNode._iUsesRotation) { - if (needProcess) - this.precessRotation(currentTime, deltaTime, animationSubGeometry); - - animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleFollowNode.FOLLOW_ROTATION_INDEX), this._particleFollowNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); - } - - this._prePos.copyFrom(this._targetPos); - this._targetEuler.copyFrom(this._targetEuler); - animationSubGeometry.previousTime = currentTime; - } - - private processPosition(currentTime:number, deltaTime:number, animationSubGeometry:AnimationSubGeometry) - { - var data:Array = animationSubGeometry.animationParticles; - var vertexData:Array = animationSubGeometry.vertexData; - - var changed:boolean = false; - var len:number /*uint*/ = data.length; - var interpolatedPos:Vector3D; - var posVelocity:Vector3D; - if (this._smooth) { - posVelocity = this._prePos.subtract(this._targetPos); - posVelocity.scaleBy(1/deltaTime); - } else - interpolatedPos = this._targetPos; - for (var i:number /*uint*/ = 0; i < len; i++) { - var k:number = (currentTime - data[i].startTime)/data[i].totalTime; - var t:number = (k - Math.floor(k))*data[i].totalTime; - if (t - deltaTime <= 0) { - var inc:number /*int*/ = data[i].startVertexIndex*animationSubGeometry.totalLenOfOneVertex + this._particleFollowNode._iDataOffset; - - if (this._smooth) { - this._temp.copyFrom(posVelocity); - this._temp.scaleBy(t); - interpolatedPos = this._targetPos.add(this._temp); - } - - if (vertexData[inc] != interpolatedPos.x || vertexData[inc + 1] != interpolatedPos.y || vertexData[inc + 2] != interpolatedPos.z) { - changed = true; - for (var j:number /*uint*/ = 0; j < data[i].numVertices; j++) { - vertexData[inc++] = interpolatedPos.x; - vertexData[inc++] = interpolatedPos.y; - vertexData[inc++] = interpolatedPos.z; - } - } - } - } - if (changed) - animationSubGeometry.invalidateBuffer(); - - } - - private precessRotation(currentTime:number, deltaTime:number, animationSubGeometry:AnimationSubGeometry) - { - var data:Array = animationSubGeometry.animationParticles; - var vertexData:Array = animationSubGeometry.vertexData; - - var changed:boolean = false; - var len:number /*uint*/ = data.length; - - var interpolatedRotation:Vector3D; - var rotationVelocity:Vector3D; - - if (this._smooth) { - rotationVelocity = this._preEuler.subtract(this._targetEuler); - rotationVelocity.scaleBy(1/deltaTime); - } else - interpolatedRotation = this._targetEuler; - - for (var i:number /*uint*/ = 0; i < len; i++) { - var k:number = (currentTime - data[i].startTime)/data[i].totalTime; - var t:number = (k - Math.floor(k))*data[i].totalTime; - if (t - deltaTime <= 0) { - var inc:number /*int*/ = data[i].startVertexIndex*animationSubGeometry.totalLenOfOneVertex + this._particleFollowNode._iDataOffset; - - if (this._smooth) { - this._temp.copyFrom(rotationVelocity); - this._temp.scaleBy(t); - interpolatedRotation = this._targetEuler.add(this._temp); - } - - if (vertexData[inc] != interpolatedRotation.x || vertexData[inc + 1] != interpolatedRotation.y || vertexData[inc + 2] != interpolatedRotation.z) { - changed = true; - for (var j:number /*uint*/ = 0; j < data[i].numVertices; j++) { - vertexData[inc++] = interpolatedRotation.x; - vertexData[inc++] = interpolatedRotation.y; - vertexData[inc++] = interpolatedRotation.z; - } - } - } - } - if (changed) - animationSubGeometry.invalidateBuffer(); - - } - - private processPositionAndRotation(currentTime:number, deltaTime:number, animationSubGeometry:AnimationSubGeometry) - { - var data:Array = animationSubGeometry.animationParticles; - var vertexData:Array = animationSubGeometry.vertexData; - - var changed:boolean = false; - var len:number /*uint*/ = data.length; - - var interpolatedPos:Vector3D; - var interpolatedRotation:Vector3D; - - var posVelocity:Vector3D; - var rotationVelocity:Vector3D; - if (this._smooth) { - posVelocity = this._prePos.subtract(this._targetPos); - posVelocity.scaleBy(1/deltaTime); - rotationVelocity = this._preEuler.subtract(this._targetEuler); - rotationVelocity.scaleBy(1/deltaTime); - } else { - interpolatedPos = this._targetPos; - interpolatedRotation = this._targetEuler; - } - - for (var i:number /*uint*/ = 0; i < len; i++) { - var k:number = (currentTime - data[i].startTime)/data[i].totalTime; - var t:number = (k - Math.floor(k))*data[i].totalTime; - if (t - deltaTime <= 0) { - var inc:number /*int*/ = data[i].startVertexIndex*animationSubGeometry.totalLenOfOneVertex + this._particleFollowNode._iDataOffset; - if (this._smooth) { - this._temp.copyFrom(posVelocity); - this._temp.scaleBy(t); - interpolatedPos = this._targetPos.add(this._temp); - - this._temp.copyFrom(rotationVelocity); - this._temp.scaleBy(t); - interpolatedRotation = this._targetEuler.add(this._temp); - } - - if (vertexData[inc] != interpolatedPos.x || vertexData[inc + 1] != interpolatedPos.y || vertexData[inc + 2] != interpolatedPos.z || vertexData[inc + 3] != interpolatedRotation.x || vertexData[inc + 4] != interpolatedRotation.y || vertexData[inc + 5] != interpolatedRotation.z) { - changed = true; - for (var j:number /*uint*/ = 0; j < data[i].numVertices; j++) { - vertexData[inc++] = interpolatedPos.x; - vertexData[inc++] = interpolatedPos.y; - vertexData[inc++] = interpolatedPos.z; - vertexData[inc++] = interpolatedRotation.x; - vertexData[inc++] = interpolatedRotation.y; - vertexData[inc++] = interpolatedRotation.z; - } - } - } - } - if (changed) - animationSubGeometry.invalidateBuffer(); - } - - } - -} diff --git a/src/away/animators/states/ParticleInitialColorState.ts b/src/away/animators/states/ParticleInitialColorState.ts deleted file mode 100644 index 7cc8bcacc..000000000 --- a/src/away/animators/states/ParticleInitialColorState.ts +++ /dev/null @@ -1,85 +0,0 @@ -/// - -module away.animators -{ - import RenderableBase = away.pool.RenderableBase; - import Camera = away.entities.Camera; - import ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat - import ColorTransform = away.geom.ColorTransform; - import Vector3D = away.geom.Vector3D; - import Stage = away.base.Stage; - - export class ParticleInitialColorState extends ParticleStateBase - { - private _particleInitialColorNode:ParticleInitialColorNode; - private _usesMultiplier:boolean; - private _usesOffset:boolean; - private _initialColor:ColorTransform; - private _multiplierData:Vector3D; - private _offsetData:Vector3D; - - constructor(animator:ParticleAnimator, particleInitialColorNode:ParticleInitialColorNode) - { - super(animator, particleInitialColorNode); - - this._particleInitialColorNode = particleInitialColorNode; - this._usesMultiplier = particleInitialColorNode._iUsesMultiplier; - this._usesOffset = particleInitialColorNode._iUsesOffset; - this._initialColor = particleInitialColorNode._iInitialColor; - - this.updateColorData(); - } - - /** - * Defines the initial color transform of the state, when in global mode. - */ - public get initialColor():ColorTransform - { - return this._initialColor; - } - - public set initialColor(value:ColorTransform) - { - this._initialColor = value; - } - - /** - * @inheritDoc - */ - public setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera) - { - // TODO: not used - renderable = renderable; - camera = camera; - - if (animationRegisterCache.needFragmentAnimation) { - if (this._particleInitialColorNode.mode == ParticlePropertiesMode.LOCAL_STATIC) { - var dataOffset:number /*uint*/ = this._particleInitialColorNode._iDataOffset; - if (this._usesMultiplier) { - animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleInitialColorNode.MULTIPLIER_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); - dataOffset += 4; - } - if (this._usesOffset) - animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleInitialColorNode.OFFSET_INDEX), dataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); - } else { - if (this._usesMultiplier) - animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleInitialColorNode.MULTIPLIER_INDEX), this._multiplierData.x, this._multiplierData.y, this._multiplierData.z, this._multiplierData.w); - if (this._usesOffset) - animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleInitialColorNode.OFFSET_INDEX), this._offsetData.x, this._offsetData.y, this._offsetData.z, this._offsetData.w); - } - } - } - - private updateColorData() - { - if (this._particleInitialColorNode.mode == ParticlePropertiesMode.GLOBAL) { - if (this._usesMultiplier) - this._multiplierData = new Vector3D(this._initialColor.redMultiplier, this._initialColor.greenMultiplier, this._initialColor.blueMultiplier, this._initialColor.alphaMultiplier); - if (this._usesOffset) - this._offsetData = new Vector3D(this._initialColor.redOffset/255, this._initialColor.greenOffset/255, this._initialColor.blueOffset/255, this._initialColor.alphaOffset/255); - } - } - - } - -} diff --git a/src/away/animators/states/ParticleOrbitState.ts b/src/away/animators/states/ParticleOrbitState.ts deleted file mode 100644 index 9c6e8b7f8..000000000 --- a/src/away/animators/states/ParticleOrbitState.ts +++ /dev/null @@ -1,139 +0,0 @@ -/// - -module away.animators -{ - import RenderableBase = away.pool.RenderableBase; - import Camera = away.entities.Camera; - import ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat - import Matrix3D = away.geom.Matrix3D; - import Vector3D = away.geom.Vector3D; - import Stage = away.base.Stage; - - /** - * ... - */ - export class ParticleOrbitState extends ParticleStateBase - { - private _particleOrbitNode:ParticleOrbitNode; - private _usesEulers:boolean; - private _usesCycle:boolean; - private _usesPhase:boolean; - private _radius:number; - private _cycleDuration:number; - private _cyclePhase:number; - private _eulers:Vector3D; - private _orbitData:Vector3D; - private _eulersMatrix:Matrix3D; - - /** - * Defines the radius of the orbit when in global mode. Defaults to 100. - */ - public get radius():number - { - return this._radius; - } - - public set radius(value:number) - { - this._radius = value; - - this.updateOrbitData(); - } - - /** - * Defines the duration of the orbit in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. - */ - public get cycleDuration():number - { - return this._cycleDuration; - } - - public set cycleDuration(value:number) - { - this._cycleDuration = value; - - this.updateOrbitData(); - } - - /** - * Defines the phase of the orbit in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. - */ - public get cyclePhase():number - { - return this._cyclePhase; - } - - public set cyclePhase(value:number) - { - this._cyclePhase = value; - - this.updateOrbitData(); - } - - /** - * Defines the euler rotation in degrees, applied to the orientation of the orbit when in global mode. - */ - public get eulers():Vector3D - { - return this._eulers; - } - - public set eulers(value:Vector3D) - { - this._eulers = value; - - this.updateOrbitData(); - - } - - constructor(animator:ParticleAnimator, particleOrbitNode:ParticleOrbitNode) - { - super(animator, particleOrbitNode); - - this._particleOrbitNode = particleOrbitNode; - this._usesEulers = this._particleOrbitNode._iUsesEulers; - this._usesCycle = this._particleOrbitNode._iUsesCycle; - this._usesPhase = this._particleOrbitNode._iUsesPhase; - this._eulers = this._particleOrbitNode._iEulers; - this._radius = this._particleOrbitNode._iRadius; - this._cycleDuration = this._particleOrbitNode._iCycleDuration; - this._cyclePhase = this._particleOrbitNode._iCyclePhase; - this.updateOrbitData(); - } - - public setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera) - { - var index:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleOrbitNode.ORBIT_INDEX); - - if (this._particleOrbitNode.mode == ParticlePropertiesMode.LOCAL_STATIC) { - if (this._usesPhase) - animationSubGeometry.activateVertexBuffer(index, this._particleOrbitNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); - else - animationSubGeometry.activateVertexBuffer(index, this._particleOrbitNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); - } else - animationRegisterCache.setVertexConst(index, this._orbitData.x, this._orbitData.y, this._orbitData.z, this._orbitData.w); - - if (this._usesEulers) - animationRegisterCache.setVertexConstFromMatrix(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleOrbitNode.EULERS_INDEX), this._eulersMatrix); - } - - private updateOrbitData() - { - if (this._usesEulers) { - this._eulersMatrix = new Matrix3D(); - this._eulersMatrix.appendRotation(this._eulers.x, Vector3D.X_AXIS); - this._eulersMatrix.appendRotation(this._eulers.y, Vector3D.Y_AXIS); - this._eulersMatrix.appendRotation(this._eulers.z, Vector3D.Z_AXIS); - } - if (this._particleOrbitNode.mode == ParticlePropertiesMode.GLOBAL) { - this._orbitData = new Vector3D(this._radius, 0, this._radius*Math.PI*2, this._cyclePhase*Math.PI/180); - if (this._usesCycle) { - if (this._cycleDuration <= 0) - throw(new Error("the cycle duration must be greater than zero")); - this._orbitData.y = Math.PI*2/this._cycleDuration; - } else - this._orbitData.y = Math.PI*2; - } - } - } -} diff --git a/src/away/animators/states/ParticleOscillatorState.ts b/src/away/animators/states/ParticleOscillatorState.ts deleted file mode 100644 index 16032c227..000000000 --- a/src/away/animators/states/ParticleOscillatorState.ts +++ /dev/null @@ -1,74 +0,0 @@ -/// - -module away.animators -{ - import RenderableBase = away.pool.RenderableBase; - import Camera = away.entities.Camera; - import ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat - import Vector3D = away.geom.Vector3D; - import Stage = away.base.Stage; - - /** - * ... - */ - export class ParticleOscillatorState extends ParticleStateBase - { - private _particleOscillatorNode:ParticleOscillatorNode; - private _oscillator:Vector3D; - private _oscillatorData:Vector3D; - - /** - * Defines the default oscillator axis (x, y, z) and cycleDuration (w) of the state, used when in global mode. - */ - public get oscillator():Vector3D - { - return this._oscillator; - } - - public set oscillator(value:Vector3D) - { - this._oscillator = value; - - this.updateOscillatorData(); - } - - constructor(animator:ParticleAnimator, particleOscillatorNode:ParticleOscillatorNode) - { - super(animator, particleOscillatorNode); - - this._particleOscillatorNode = particleOscillatorNode; - this._oscillator = this._particleOscillatorNode._iOscillator; - - this.updateOscillatorData(); - } - - /** - * @inheritDoc - */ - public setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera) - { - var index:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleOscillatorNode.OSCILLATOR_INDEX); - - if (this._particleOscillatorNode.mode == ParticlePropertiesMode.LOCAL_STATIC) - animationSubGeometry.activateVertexBuffer(index, this._particleOscillatorNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); - else - animationRegisterCache.setVertexConst(index, this._oscillatorData.x, this._oscillatorData.y, this._oscillatorData.z, this._oscillatorData.w); - } - - private updateOscillatorData() - { - if (this._particleOscillatorNode.mode == ParticlePropertiesMode.GLOBAL) { - if (this._oscillator.w <= 0) - throw(new Error("the cycle duration must greater than zero")); - - if (this._oscillatorData == null) - this._oscillatorData = new Vector3D(); - - this._oscillatorData.x = this._oscillator.x; - this._oscillatorData.y = this._oscillator.y; - this._oscillatorData.z = this._oscillator.z; - this._oscillatorData.w = Math.PI*2/this._oscillator.w; - } - } - } -} diff --git a/src/away/animators/states/ParticlePositionState.ts b/src/away/animators/states/ParticlePositionState.ts deleted file mode 100644 index cf55b8f8b..000000000 --- a/src/away/animators/states/ParticlePositionState.ts +++ /dev/null @@ -1,72 +0,0 @@ -/// - -module away.animators -{ - import RenderableBase = away.pool.RenderableBase; - import Camera = away.entities.Camera; - import ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat - import Vector3D = away.geom.Vector3D; - import Stage = away.base.Stage; - - /** - * ... - * @author ... - */ - export class ParticlePositionState extends ParticleStateBase - { - private _particlePositionNode:ParticlePositionNode; - private _position:Vector3D; - - /** - * Defines the position of the particle when in global mode. Defaults to 0,0,0. - */ - public get position():Vector3D - { - return this._position; - } - - public set position(value:Vector3D) - { - this._position = value; - } - - /** - * - */ - public getPositions():Array - { - return this._pDynamicProperties; - } - - public setPositions(value:Array) - { - this._pDynamicProperties = value; - - this._pDynamicPropertiesDirty = new Object(); - } - - constructor(animator:ParticleAnimator, particlePositionNode:ParticlePositionNode) - { - super(animator, particlePositionNode); - - this._particlePositionNode = particlePositionNode; - this._position = this._particlePositionNode._iPosition; - } - - /** - * @inheritDoc - */ - public setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera) - { - if (this._particlePositionNode.mode == ParticlePropertiesMode.LOCAL_DYNAMIC && !this._pDynamicPropertiesDirty[animationSubGeometry._iUniqueId]) - this._pUpdateDynamicProperties(animationSubGeometry); - - var index:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticlePositionNode.POSITION_INDEX); - - if (this._particlePositionNode.mode == ParticlePropertiesMode.GLOBAL) - animationRegisterCache.setVertexConst(index, this._position.x, this._position.y, this._position.z); - else - animationSubGeometry.activateVertexBuffer(index, this._particlePositionNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); - } - } -} diff --git a/src/away/animators/states/ParticleRotateToHeadingState.ts b/src/away/animators/states/ParticleRotateToHeadingState.ts deleted file mode 100644 index 31a8cb853..000000000 --- a/src/away/animators/states/ParticleRotateToHeadingState.ts +++ /dev/null @@ -1,34 +0,0 @@ -/// - -module away.animators -{ - import RenderableBase = away.pool.RenderableBase; - import Camera = away.entities.Camera; - import Matrix3D = away.geom.Matrix3D; - import Stage = away.base.Stage; - - /** - * ... - */ - export class ParticleRotateToHeadingState extends ParticleStateBase - { - - private _matrix:Matrix3D = new Matrix3D(); - - constructor(animator:ParticleAnimator, particleNode:ParticleNodeBase) - { - super(animator, particleNode); - } - - public setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera) - { - if (animationRegisterCache.hasBillboard) { - this._matrix.copyFrom(renderable.sourceEntity.sceneTransform); - this._matrix.append(camera.inverseSceneTransform); - animationRegisterCache.setVertexConstFromMatrix(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleRotateToHeadingNode.MATRIX_INDEX), this._matrix); - } - } - - } - -} diff --git a/src/away/animators/states/ParticleRotateToPositionState.ts b/src/away/animators/states/ParticleRotateToPositionState.ts deleted file mode 100644 index b9f309bb8..000000000 --- a/src/away/animators/states/ParticleRotateToPositionState.ts +++ /dev/null @@ -1,63 +0,0 @@ -/// - -module away.animators -{ - import RenderableBase = away.pool.RenderableBase; - import Camera = away.entities.Camera; - import ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat - import Vector3D = away.geom.Vector3D; - import Matrix3D = away.geom.Matrix3D; - import Stage = away.base.Stage; - - /** - * ... - */ - export class ParticleRotateToPositionState extends ParticleStateBase - { - private _particleRotateToPositionNode:ParticleRotateToPositionNode; - private _position:Vector3D; - private _matrix:Matrix3D = new Matrix3D(); - private _offset:Vector3D; - - /** - * Defines the position of the point the particle will rotate to face when in global mode. Defaults to 0,0,0. - */ - public get position():Vector3D - { - return this._position; - } - - public set position(value:Vector3D) - { - this._position = value; - } - - constructor(animator:ParticleAnimator, particleRotateToPositionNode:ParticleRotateToPositionNode) - { - super(animator, particleRotateToPositionNode); - - this._particleRotateToPositionNode = particleRotateToPositionNode; - this._position = this._particleRotateToPositionNode._iPosition; - } - - public setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera) - { - var index:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleRotateToPositionNode.POSITION_INDEX); - - if (animationRegisterCache.hasBillboard) { - this._matrix.copyFrom(renderable.sourceEntity.sceneTransform); - this._matrix.append(camera.inverseSceneTransform); - animationRegisterCache.setVertexConstFromMatrix(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleRotateToPositionNode.MATRIX_INDEX), this._matrix); - } - - if (this._particleRotateToPositionNode.mode == ParticlePropertiesMode.GLOBAL) { - this._offset = renderable.sourceEntity.inverseSceneTransform.transformVector(this._position); - animationRegisterCache.setVertexConst(index, this._offset.x, this._offset.y, this._offset.z); - } else - animationSubGeometry.activateVertexBuffer(index, this._particleRotateToPositionNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); - - } - - } - -} diff --git a/src/away/animators/states/ParticleRotationalVelocityState.ts b/src/away/animators/states/ParticleRotationalVelocityState.ts deleted file mode 100644 index c9519e73c..000000000 --- a/src/away/animators/states/ParticleRotationalVelocityState.ts +++ /dev/null @@ -1,92 +0,0 @@ -/// - -module away.animators -{ - import RenderableBase = away.pool.RenderableBase; - import Camera = away.entities.Camera; - import ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat - import Vector3D = away.geom.Vector3D; - import Stage = away.base.Stage; - - /** - * ... - */ - export class ParticleRotationalVelocityState extends ParticleStateBase - { - private _particleRotationalVelocityNode:ParticleRotationalVelocityNode; - private _rotationalVelocityData:Vector3D; - private _rotationalVelocity:Vector3D; - - /** - * Defines the default rotationalVelocity of the state, used when in global mode. - */ - public get rotationalVelocity():Vector3D - { - return this._rotationalVelocity; - } - - public set rotationalVelocity(value:Vector3D) - { - this._rotationalVelocity = value; - - this.updateRotationalVelocityData(); - } - - /** - * - */ - public getRotationalVelocities():Array - { - return this._pDynamicProperties; - } - - public setRotationalVelocities(value:Array) - { - this._pDynamicProperties = value; - - this._pDynamicPropertiesDirty = new Object(); - } - - constructor(animator:ParticleAnimator, particleRotationNode:ParticleRotationalVelocityNode) - { - super(animator, particleRotationNode); - - this._particleRotationalVelocityNode = particleRotationNode; - this._rotationalVelocity = this._particleRotationalVelocityNode._iRotationalVelocity; - - this.updateRotationalVelocityData(); - } - - /** - * @inheritDoc - */ - public setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera) - { - if (this._particleRotationalVelocityNode.mode == ParticlePropertiesMode.LOCAL_DYNAMIC && !this._pDynamicPropertiesDirty[animationSubGeometry._iUniqueId]) - this._pUpdateDynamicProperties(animationSubGeometry); - - var index:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleRotationalVelocityNode.ROTATIONALVELOCITY_INDEX); - - if (this._particleRotationalVelocityNode.mode == ParticlePropertiesMode.GLOBAL) - animationRegisterCache.setVertexConst(index, this._rotationalVelocityData.x, this._rotationalVelocityData.y, this._rotationalVelocityData.z, this._rotationalVelocityData.w); - else - animationSubGeometry.activateVertexBuffer(index, this._particleRotationalVelocityNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); - } - - private updateRotationalVelocityData() - { - if (this._particleRotationalVelocityNode.mode == ParticlePropertiesMode.GLOBAL) { - if (this._rotationalVelocity.w <= 0) - throw(new Error("the cycle duration must greater than zero")); - var rotation:Vector3D = this._rotationalVelocity.clone(); - - if (rotation.length <= 0) - rotation.z = 1; //set the default direction - else - rotation.normalize(); - // w is used as angle/2 in agal - this._rotationalVelocityData = new Vector3D(rotation.x, rotation.y, rotation.z, Math.PI/rotation.w); - } - } - } -} diff --git a/src/away/animators/states/ParticleScaleState.ts b/src/away/animators/states/ParticleScaleState.ts deleted file mode 100644 index 85c2531e8..000000000 --- a/src/away/animators/states/ParticleScaleState.ts +++ /dev/null @@ -1,128 +0,0 @@ -/// - -module away.animators -{ - import RenderableBase = away.pool.RenderableBase; - import Camera = away.entities.Camera; - import ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat - import Vector3D = away.geom.Vector3D; - import Stage = away.base.Stage; - - /** - * ... - */ - export class ParticleScaleState extends ParticleStateBase - { - private _particleScaleNode:ParticleScaleNode; - private _usesCycle:boolean; - private _usesPhase:boolean; - private _minScale:number; - private _maxScale:number; - private _cycleDuration:number; - private _cyclePhase:number; - private _scaleData:Vector3D; - - /** - * Defines the end scale of the state, when in global mode. Defaults to 1. - */ - public get minScale():number - { - return this._minScale; - } - - public set minScale(value:number) - { - this._minScale = value; - - this.updateScaleData(); - } - - /** - * Defines the end scale of the state, when in global mode. Defaults to 1. - */ - public get maxScale():number - { - return this._maxScale; - } - - public set maxScale(value:number) - { - this._maxScale = value; - - this.updateScaleData(); - } - - /** - * Defines the duration of the animation in seconds, used as a period independent of particle duration when in global mode. Defaults to 1. - */ - public get cycleDuration():number - { - return this._cycleDuration; - } - - public set cycleDuration(value:number) - { - this._cycleDuration = value; - - this.updateScaleData(); - } - - /** - * Defines the phase of the cycle in degrees, used as the starting offset of the cycle when in global mode. Defaults to 0. - */ - public get cyclePhase():number - { - return this._cyclePhase; - } - - public set cyclePhase(value:number) - { - this._cyclePhase = value; - - this.updateScaleData(); - } - - constructor(animator:ParticleAnimator, particleScaleNode:ParticleScaleNode) - { - super(animator, particleScaleNode); - - this._particleScaleNode = particleScaleNode; - this._usesCycle = this._particleScaleNode._iUsesCycle; - this._usesPhase = this._particleScaleNode._iUsesPhase; - this._minScale = this._particleScaleNode._iMinScale; - this._maxScale = this._particleScaleNode._iMaxScale; - this._cycleDuration = this._particleScaleNode._iCycleDuration; - this._cyclePhase = this._particleScaleNode._iCyclePhase; - - this.updateScaleData(); - } - - public setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera) - { - var index:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleScaleNode.SCALE_INDEX); - - if (this._particleScaleNode.mode == ParticlePropertiesMode.LOCAL_STATIC) { - if (this._usesCycle) { - if (this._usesPhase) - animationSubGeometry.activateVertexBuffer(index, this._particleScaleNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); - else - animationSubGeometry.activateVertexBuffer(index, this._particleScaleNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); - } else - animationSubGeometry.activateVertexBuffer(index, this._particleScaleNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_2); - } else - animationRegisterCache.setVertexConst(index, this._scaleData.x, this._scaleData.y, this._scaleData.z, this._scaleData.w); - } - - private updateScaleData() - { - if (this._particleScaleNode.mode == ParticlePropertiesMode.GLOBAL) { - if (this._usesCycle) { - if (this._cycleDuration <= 0) - throw(new Error("the cycle duration must be greater than zero")); - this._scaleData = new Vector3D((this._minScale + this._maxScale)/2, Math.abs(this._minScale - this._maxScale)/2, Math.PI*2/this._cycleDuration, this._cyclePhase*Math.PI/180); - } else - this._scaleData = new Vector3D(this._minScale, this._maxScale - this._minScale, 0, 0); - } - } - } -} diff --git a/src/away/animators/states/ParticleSegmentedColorState.ts b/src/away/animators/states/ParticleSegmentedColorState.ts deleted file mode 100644 index 070d76d9b..000000000 --- a/src/away/animators/states/ParticleSegmentedColorState.ts +++ /dev/null @@ -1,159 +0,0 @@ -/// - -module away.animators -{ - import RenderableBase = away.pool.RenderableBase; - import Camera = away.entities.Camera; - import ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat - import ColorTransform = away.geom.ColorTransform; - import Vector3D = away.geom.Vector3D; - import Stage = away.base.Stage; - - export class ParticleSegmentedColorState extends ParticleStateBase - { - private _usesMultiplier:boolean; - private _usesOffset:boolean; - private _startColor:ColorTransform; - private _endColor:ColorTransform; - private _segmentPoints:Array; - private _numSegmentPoint:number /*int*/; - - private _timeLifeData:Array; - private _multiplierData:Array; - private _offsetData:Array; - - /** - * Defines the start color transform of the state, when in global mode. - */ - public get startColor():ColorTransform - { - return this._startColor; - } - - public set startColor(value:ColorTransform) - { - this._startColor = value; - - this.updateColorData(); - } - - /** - * Defines the end color transform of the state, when in global mode. - */ - public get endColor():ColorTransform - { - return this._endColor; - } - - public set endColor(value:ColorTransform) - { - this._endColor = value; - this.updateColorData(); - } - - /** - * Defines the number of segments. - */ - public get numSegmentPoint():number /*int*/ - { - return this._numSegmentPoint; - } - - /** - * Defines the key points of color - */ - public get segmentPoints():Array - { - return this._segmentPoints; - } - - public set segmentPoints(value:Array) - { - this._segmentPoints = value; - this.updateColorData(); - } - - public get usesMultiplier():boolean - { - return this._usesMultiplier; - } - - public get usesOffset():boolean - { - return this._usesOffset; - } - - constructor(animator:ParticleAnimator, particleSegmentedColorNode:ParticleSegmentedColorNode) - { - super(animator, particleSegmentedColorNode); - - this._usesMultiplier = particleSegmentedColorNode._iUsesMultiplier; - this._usesOffset = particleSegmentedColorNode._iUsesOffset; - this._startColor = particleSegmentedColorNode._iStartColor; - this._endColor = particleSegmentedColorNode._iEndColor; - this._segmentPoints = particleSegmentedColorNode._iSegmentPoints; - this._numSegmentPoint = particleSegmentedColorNode._iNumSegmentPoint; - this.updateColorData(); - } - - public setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera) - { - if (animationRegisterCache.needFragmentAnimation) { - if (this._numSegmentPoint > 0) - animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleSegmentedColorNode.TIME_DATA_INDEX), this._timeLifeData[0], this._timeLifeData[1], this._timeLifeData[2], this._timeLifeData[3]); - if (this._usesMultiplier) - animationRegisterCache.setVertexConstFromArray(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleSegmentedColorNode.START_MULTIPLIER_INDEX), this._multiplierData); - if (this._usesOffset) - animationRegisterCache.setVertexConstFromArray(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleSegmentedColorNode.START_OFFSET_INDEX), this._offsetData); - } - } - - private updateColorData() - { - this._timeLifeData = new Array(); - this._multiplierData = new Array(); - this._offsetData = new Array(); - var i:number /*int*/; - for (i = 0; i < this._numSegmentPoint; i++) { - if (i == 0) - this._timeLifeData.push(this._segmentPoints[i].life); - else - this._timeLifeData.push(this._segmentPoints[i].life - this._segmentPoints[i - 1].life); - } - if (this._numSegmentPoint == 0) - this._timeLifeData.push(1); - else - this._timeLifeData.push(1 - this._segmentPoints[i - 1].life); - - if (this._usesMultiplier) { - this._multiplierData.push(this._startColor.redMultiplier, this._startColor.greenMultiplier, this._startColor.blueMultiplier, this._startColor.alphaMultiplier); - for (i = 0; i < this._numSegmentPoint; i++) { - if (i == 0) - this._multiplierData.push((this._segmentPoints[i].color.redMultiplier - this._startColor.redMultiplier)/this._timeLifeData[i], (this._segmentPoints[i].color.greenMultiplier - this._startColor.greenMultiplier)/this._timeLifeData[i], (this._segmentPoints[i].color.blueMultiplier - this._startColor.blueMultiplier)/this._timeLifeData[i], (this._segmentPoints[i].color.alphaMultiplier - this._startColor.alphaMultiplier)/this._timeLifeData[i]); - else - this._multiplierData.push((this._segmentPoints[i].color.redMultiplier - this._segmentPoints[i - 1].color.redMultiplier)/this._timeLifeData[i], (this._segmentPoints[i].color.greenMultiplier - this._segmentPoints[i - 1].color.greenMultiplier)/this._timeLifeData[i], (this._segmentPoints[i].color.blueMultiplier - this._segmentPoints[i - 1].color.blueMultiplier)/this._timeLifeData[i], (this._segmentPoints[i].color.alphaMultiplier - this._segmentPoints[i - 1].color.alphaMultiplier)/this._timeLifeData[i]); - } - if (this._numSegmentPoint == 0) - this._multiplierData.push(this._endColor.redMultiplier - this._startColor.redMultiplier, this._endColor.greenMultiplier - this._startColor.greenMultiplier, this._endColor.blueMultiplier - this._startColor.blueMultiplier, this._endColor.alphaMultiplier - this._startColor.alphaMultiplier); - else - this._multiplierData.push((this._endColor.redMultiplier - this._segmentPoints[i - 1].color.redMultiplier)/this._timeLifeData[i], (this._endColor.greenMultiplier - this._segmentPoints[i - 1].color.greenMultiplier)/this._timeLifeData[i], (this._endColor.blueMultiplier - this._segmentPoints[i - 1].color.blueMultiplier)/this._timeLifeData[i], (this._endColor.alphaMultiplier - this._segmentPoints[i - 1].color.alphaMultiplier)/this._timeLifeData[i]); - } - - if (this._usesOffset) { - this._offsetData.push(this._startColor.redOffset/255, this._startColor.greenOffset/255, this._startColor.blueOffset/255, this._startColor.alphaOffset/255); - for (i = 0; i < this._numSegmentPoint; i++) { - if (i == 0) - this._offsetData.push((this._segmentPoints[i].color.redOffset - this._startColor.redOffset)/this._timeLifeData[i]/255, (this._segmentPoints[i].color.greenOffset - this._startColor.greenOffset)/this._timeLifeData[i]/255, (this._segmentPoints[i].color.blueOffset - this._startColor.blueOffset)/this._timeLifeData[i]/255, (this._segmentPoints[i].color.alphaOffset - this._startColor.alphaOffset)/this._timeLifeData[i]/255); - else - this._offsetData.push((this._segmentPoints[i].color.redOffset - this._segmentPoints[i - 1].color.redOffset)/this._timeLifeData[i]/255, (this._segmentPoints[i].color.greenOffset - this._segmentPoints[i - 1].color.greenOffset)/this._timeLifeData[i]/255, (this._segmentPoints[i].color.blueOffset - this._segmentPoints[i - 1].color.blueOffset)/this._timeLifeData[i]/255, (this._segmentPoints[i].color.alphaOffset - this._segmentPoints[i - 1].color.alphaOffset)/this._timeLifeData[i]/255); - } - if (this._numSegmentPoint == 0) - this._offsetData.push((this._endColor.redOffset - this._startColor.redOffset)/255, (this._endColor.greenOffset - this._startColor.greenOffset)/255, (this._endColor.blueOffset - this._startColor.blueOffset)/255, (this._endColor.alphaOffset - this._startColor.alphaOffset)/255); - else - this._offsetData.push((this._endColor.redOffset - this._segmentPoints[i - 1].color.redOffset)/this._timeLifeData[i]/255, (this._endColor.greenOffset - this._segmentPoints[i - 1].color.greenOffset)/this._timeLifeData[i]/255, (this._endColor.blueOffset - this._segmentPoints[i - 1].color.blueOffset)/this._timeLifeData[i]/255, (this._endColor.alphaOffset - this._segmentPoints[i - 1].color.alphaOffset)/this._timeLifeData[i]/255); - } - //cut off the data - this._timeLifeData.length = 4; - } - } -} diff --git a/src/away/animators/states/ParticleSpriteSheetState.ts b/src/away/animators/states/ParticleSpriteSheetState.ts deleted file mode 100644 index 6a918426f..000000000 --- a/src/away/animators/states/ParticleSpriteSheetState.ts +++ /dev/null @@ -1,110 +0,0 @@ -/// - -module away.animators -{ - import RenderableBase = away.pool.RenderableBase; - import Camera = away.entities.Camera; - import ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat - import Vector3D = away.geom.Vector3D; - import Stage = away.base.Stage; - - /** - * ... - */ - export class ParticleSpriteSheetState extends ParticleStateBase - { - private _particleSpriteSheetNode:ParticleSpriteSheetNode; - private _usesCycle:boolean; - private _usesPhase:boolean; - private _totalFrames:number /*int*/; - private _numColumns:number /*int*/; - private _numRows:number /*int*/; - private _cycleDuration:number; - private _cyclePhase:number; - private _spriteSheetData:Array; - - /** - * Defines the cycle phase, when in global mode. Defaults to zero. - */ - public get cyclePhase():number - { - return this._cyclePhase; - } - - public set cyclePhase(value:number) - { - this._cyclePhase = value; - - this.updateSpriteSheetData(); - } - - /** - * Defines the cycle duration in seconds, when in global mode. Defaults to 1. - */ - public get cycleDuration():number - { - return this._cycleDuration; - } - - public set cycleDuration(value:number) - { - this._cycleDuration = value; - - this.updateSpriteSheetData(); - } - - constructor(animator:ParticleAnimator, particleSpriteSheetNode:ParticleSpriteSheetNode) - { - super(animator, particleSpriteSheetNode); - - this._particleSpriteSheetNode = particleSpriteSheetNode; - - this._usesCycle = this._particleSpriteSheetNode._iUsesCycle; - this._usesPhase = this._particleSpriteSheetNode._iUsesCycle; - this._totalFrames = this._particleSpriteSheetNode._iTotalFrames; - this._numColumns = this._particleSpriteSheetNode._iNumColumns; - this._numRows = this._particleSpriteSheetNode._iNumRows; - this._cycleDuration = this._particleSpriteSheetNode._iCycleDuration; - this._cyclePhase = this._particleSpriteSheetNode._iCyclePhase; - - this.updateSpriteSheetData(); - } - - public setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera) - { - if (animationRegisterCache.needUVAnimation) { - animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleSpriteSheetNode.UV_INDEX_0), this._spriteSheetData[0], this._spriteSheetData[1], this._spriteSheetData[2], this._spriteSheetData[3]); - if (this._usesCycle) { - var index:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleSpriteSheetNode.UV_INDEX_1); - if (this._particleSpriteSheetNode.mode == ParticlePropertiesMode.LOCAL_STATIC) { - if (this._usesPhase) - animationSubGeometry.activateVertexBuffer(index, this._particleSpriteSheetNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); - else - animationSubGeometry.activateVertexBuffer(index, this._particleSpriteSheetNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_2); - } else - animationRegisterCache.setVertexConst(index, this._spriteSheetData[4], this._spriteSheetData[5]); - } - } - } - - private updateSpriteSheetData() - { - this._spriteSheetData = new Array(8); - - var uTotal:number = this._totalFrames/this._numColumns; - - this._spriteSheetData[0] = uTotal; - this._spriteSheetData[1] = 1/this._numColumns; - this._spriteSheetData[2] = 1/this._numRows; - - if (this._usesCycle) { - if (this._cycleDuration <= 0) - throw(new Error("the cycle duration must be greater than zero")); - this._spriteSheetData[4] = uTotal/this._cycleDuration; - this._spriteSheetData[5] = this._cycleDuration; - if (this._usesPhase) - this._spriteSheetData[6] = this._cyclePhase; - } - } - } -} diff --git a/src/away/animators/states/ParticleStateBase.ts b/src/away/animators/states/ParticleStateBase.ts deleted file mode 100644 index e3fe7e94f..000000000 --- a/src/away/animators/states/ParticleStateBase.ts +++ /dev/null @@ -1,106 +0,0 @@ -/// - -module away.animators -{ - import Stage = away.base.Stage; - import Camera = away.entities.Camera; - import ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat - import Vector3D = away.geom.Vector3D; - import RenderableBase = away.pool.RenderableBase; - - /** - * ... - */ - export class ParticleStateBase extends AnimationStateBase - { - private _particleNode:ParticleNodeBase; - - public _pDynamicProperties:Array = new Array(); - public _pDynamicPropertiesDirty:Object = new Object(); - - public _pNeedUpdateTime:boolean; - - constructor(animator:ParticleAnimator, particleNode:ParticleNodeBase, needUpdateTime:boolean = false) - { - super(animator, particleNode); - - this._particleNode = particleNode; - this._pNeedUpdateTime = needUpdateTime; - } - - public get needUpdateTime():boolean - { - return this._pNeedUpdateTime; - } - - public setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera) - { - - } - - public _pUpdateDynamicProperties(animationSubGeometry:AnimationSubGeometry) - { - this._pDynamicPropertiesDirty[animationSubGeometry._iUniqueId] = true; - - var animationParticles:Array = animationSubGeometry.animationParticles; - var vertexData:Array = animationSubGeometry.vertexData; - var totalLenOfOneVertex:number /*uint*/ = animationSubGeometry.totalLenOfOneVertex; - var dataLength:number /*uint*/ = this._particleNode.dataLength; - var dataOffset:number /*uint*/ = this._particleNode._iDataOffset; - var vertexLength:number /*uint*/; - // var particleOffset:number /*uint*/; - var startingOffset:number /*uint*/; - var vertexOffset:number /*uint*/; - var data:Vector3D; - var animationParticle:ParticleAnimationData; - - // var numParticles:number /*uint*/ = _positions.length/dataLength; - var numParticles:number /*uint*/ = this._pDynamicProperties.length; - var i:number /*uint*/ = 0; - var j:number /*uint*/ = 0; - var k:number /*uint*/ = 0; - - //loop through all particles - while (i < numParticles) { - //loop through each particle data for the current particle - while (j < numParticles && (animationParticle = animationParticles[j]).index == i) { - data = this._pDynamicProperties[i]; - vertexLength = animationParticle.numVertices*totalLenOfOneVertex; - startingOffset = animationParticle.startVertexIndex*totalLenOfOneVertex + dataOffset; - //loop through each vertex in the particle data - for (k = 0; k < vertexLength; k += totalLenOfOneVertex) { - vertexOffset = startingOffset + k; - // particleOffset = i * dataLength; - //loop through all vertex data for the current particle data - for (k = 0; k < vertexLength; k += totalLenOfOneVertex) { - vertexOffset = startingOffset + k; - vertexData[vertexOffset++] = data.x; - vertexData[vertexOffset++] = data.y; - vertexData[vertexOffset++] = data.z; - - if (dataLength == 4) - vertexData[vertexOffset++] = data.w; - } - //loop through each value in the particle vertex - // switch(dataLength) { - // case 4: - // vertexData[vertexOffset++] = _positions[particleOffset++]; - // case 3: - // vertexData[vertexOffset++] = _positions[particleOffset++]; - // case 2: - // vertexData[vertexOffset++] = _positions[particleOffset++]; - // case 1: - // vertexData[vertexOffset++] = _positions[particleOffset++]; - // } - } - j++; - } - i++; - } - - animationSubGeometry.invalidateBuffer(); - } - - } - -} diff --git a/src/away/animators/states/ParticleTimeState.ts b/src/away/animators/states/ParticleTimeState.ts deleted file mode 100644 index ea4e81f3a..000000000 --- a/src/away/animators/states/ParticleTimeState.ts +++ /dev/null @@ -1,35 +0,0 @@ -/// - -module away.animators -{ - import RenderableBase = away.pool.RenderableBase; - import Camera = away.entities.Camera; - import ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat - import Vector3D = away.geom.Vector3D; - import Stage = away.base.Stage; - - /** - * ... - */ - export class ParticleTimeState extends ParticleStateBase - { - private _particleTimeNode:ParticleTimeNode; - - constructor(animator:ParticleAnimator, particleTimeNode:ParticleTimeNode) - { - super(animator, particleTimeNode, true); - - this._particleTimeNode = particleTimeNode; - } - - public setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera) - { - animationSubGeometry.activateVertexBuffer(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleTimeNode.TIME_STREAM_INDEX), this._particleTimeNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_4); - - var particleTime:number = this._pTime/1000; - animationRegisterCache.setVertexConst(animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleTimeNode.TIME_CONSTANT_INDEX), particleTime, particleTime, particleTime, particleTime); - } - - } - -} diff --git a/src/away/animators/states/ParticleUVState.ts b/src/away/animators/states/ParticleUVState.ts deleted file mode 100644 index 27bcf46ae..000000000 --- a/src/away/animators/states/ParticleUVState.ts +++ /dev/null @@ -1,37 +0,0 @@ -/// - -module away.animators -{ - import RenderableBase = away.pool.RenderableBase; - import Camera = away.entities.Camera; - import ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat - import Vector3D = away.geom.Vector3D; - import Stage = away.base.Stage; - - /** - * ... - */ - export class ParticleUVState extends ParticleStateBase - { - - private _particleUVNode:ParticleUVNode; - - constructor(animator:ParticleAnimator, particleUVNode:ParticleUVNode) - { - super(animator, particleUVNode); - - this._particleUVNode = particleUVNode; - } - - public setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera) - { - if (animationRegisterCache.needUVAnimation) { - var index:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleUVNode.UV_INDEX); - var data:Vector3D = this._particleUVNode._iUvData; - animationRegisterCache.setVertexConst(index, data.x, data.y); - } - } - - } - -} diff --git a/src/away/animators/states/ParticleVelocityState.ts b/src/away/animators/states/ParticleVelocityState.ts deleted file mode 100644 index 42ff7da97..000000000 --- a/src/away/animators/states/ParticleVelocityState.ts +++ /dev/null @@ -1,68 +0,0 @@ -/// - -module away.animators -{ - import RenderableBase = away.pool.RenderableBase; - import Camera = away.entities.Camera; - import ContextGLVertexBufferFormat = away.stagegl.ContextGLVertexBufferFormat - import Vector3D = away.geom.Vector3D; - import Stage = away.base.Stage; - - /** - * ... - */ - export class ParticleVelocityState extends ParticleStateBase - { - private _particleVelocityNode:ParticleVelocityNode; - private _velocity:Vector3D; - - /** - * Defines the default velocity vector of the state, used when in global mode. - */ - public get velocity():Vector3D - { - return this._velocity; - } - - public set velocity(value:Vector3D) - { - this._velocity = value; - } - - /** - * - */ - public getVelocities():Array - { - return this._pDynamicProperties; - } - - public setVelocities(value:Array) - { - this._pDynamicProperties = value; - - this._pDynamicPropertiesDirty = new Object(); - } - - constructor(animator:ParticleAnimator, particleVelocityNode:ParticleVelocityNode) - { - super(animator, particleVelocityNode); - - this._particleVelocityNode = particleVelocityNode; - this._velocity = this._particleVelocityNode._iVelocity; - } - - public setRenderState(stage:Stage, renderable:RenderableBase, animationSubGeometry:AnimationSubGeometry, animationRegisterCache:AnimationRegisterCache, camera:Camera) - { - if (this._particleVelocityNode.mode == ParticlePropertiesMode.LOCAL_DYNAMIC && !this._pDynamicPropertiesDirty[animationSubGeometry._iUniqueId]) - this._pUpdateDynamicProperties(animationSubGeometry); - - var index:number /*int*/ = animationRegisterCache.getRegisterIndex(this._pAnimationNode, ParticleVelocityNode.VELOCITY_INDEX); - - if (this._particleVelocityNode.mode == ParticlePropertiesMode.GLOBAL) - animationRegisterCache.setVertexConst(index, this._velocity.x, this._velocity.y, this._velocity.z); - else - animationSubGeometry.activateVertexBuffer(index, this._particleVelocityNode._iDataOffset, stage, ContextGLVertexBufferFormat.FLOAT_3); - } - } -} diff --git a/src/away/animators/states/SkeletonBinaryLERPState.ts b/src/away/animators/states/SkeletonBinaryLERPState.ts deleted file mode 100644 index e61017e12..000000000 --- a/src/away/animators/states/SkeletonBinaryLERPState.ts +++ /dev/null @@ -1,143 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - - /** - * - */ - export class SkeletonBinaryLERPState extends AnimationStateBase implements ISkeletonAnimationState - { - private _blendWeight:number = 0; - private _skeletonAnimationNode:SkeletonBinaryLERPNode; - private _skeletonPose:SkeletonPose = new SkeletonPose(); - private _skeletonPoseDirty:boolean = true; - private _inputA:ISkeletonAnimationState; - private _inputB:ISkeletonAnimationState; - - /** - * Defines a fractional value between 0 and 1 representing the blending ratio between inputA (0) and inputB (1), - * used to produce the skeleton pose output. - * - * @see inputA - * @see inputB - */ - public get blendWeight():number - { - return this._blendWeight; - } - - public set blendWeight(value:number) - { - this._blendWeight = value; - - this._pPositionDeltaDirty = true; - this._skeletonPoseDirty = true; - } - - constructor(animator:AnimatorBase, skeletonAnimationNode:SkeletonBinaryLERPNode) - { - super(animator, skeletonAnimationNode); - - this._skeletonAnimationNode = skeletonAnimationNode; - - this._inputA = animator.getAnimationState(this._skeletonAnimationNode.inputA); - this._inputB = animator.getAnimationState(this._skeletonAnimationNode.inputB); - } - - /** - * @inheritDoc - */ - public phase(value:number) - { - this._skeletonPoseDirty = true; - - this._pPositionDeltaDirty = true; - - this._inputA.phase(value); - this._inputB.phase(value); - } - - /** - * @inheritDoc - */ - public _pUpdateTime(time:number /*int*/) - { - this._skeletonPoseDirty = true; - - this._inputA.update(time); - this._inputB.update(time); - - super._pUpdateTime(time); - } - - /** - * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. - */ - public getSkeletonPose(skeleton:Skeleton):SkeletonPose - { - if (this._skeletonPoseDirty) - this.updateSkeletonPose(skeleton); - - return this._skeletonPose; - } - - /** - * @inheritDoc - */ - public _pUpdatePositionDelta() - { - this._pPositionDeltaDirty = false; - - var deltA:Vector3D = this._inputA.positionDelta; - var deltB:Vector3D = this._inputB.positionDelta; - - this._pRootDelta.x = deltA.x + this._blendWeight*(deltB.x - deltA.x); - this._pRootDelta.y = deltA.y + this._blendWeight*(deltB.y - deltA.y); - this._pRootDelta.z = deltA.z + this._blendWeight*(deltB.z - deltA.z); - } - - /** - * Updates the output skeleton pose of the node based on the blendWeight value between input nodes. - * - * @param skeleton The skeleton used by the animator requesting the ouput pose. - */ - private updateSkeletonPose(skeleton:Skeleton) - { - this._skeletonPoseDirty = false; - - var endPose:JointPose; - var endPoses:Array = this._skeletonPose.jointPoses; - var poses1:Array = this._inputA.getSkeletonPose(skeleton).jointPoses; - var poses2:Array = this._inputB.getSkeletonPose(skeleton).jointPoses; - var pose1:JointPose, pose2:JointPose; - var p1:Vector3D, p2:Vector3D; - var tr:Vector3D; - var numJoints:number /*uint*/ = skeleton.numJoints; - - // :s - if (endPoses.length != numJoints) - endPoses.length = numJoints; - - for (var i:number /*uint*/ = 0; i < numJoints; ++i) { - endPose = endPoses[i]; - - if (endPose == null) - endPose = endPoses[i] = new JointPose(); - - pose1 = poses1[i]; - pose2 = poses2[i]; - p1 = pose1.translation; - p2 = pose2.translation; - - endPose.orientation.lerp(pose1.orientation, pose2.orientation, this._blendWeight); - - tr = endPose.translation; - tr.x = p1.x + this._blendWeight*(p2.x - p1.x); - tr.y = p1.y + this._blendWeight*(p2.y - p1.y); - tr.z = p1.z + this._blendWeight*(p2.z - p1.z); - } - } - } -} diff --git a/src/away/animators/states/SkeletonClipState.ts b/src/away/animators/states/SkeletonClipState.ts deleted file mode 100644 index 28b4bca51..000000000 --- a/src/away/animators/states/SkeletonClipState.ts +++ /dev/null @@ -1,189 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - - /** - * - */ - export class SkeletonClipState extends AnimationClipState implements ISkeletonAnimationState - { - private _rootPos:Vector3D = new Vector3D(); - private _frames:Array; - private _skeletonClipNode:SkeletonClipNode; - private _skeletonPose:SkeletonPose = new SkeletonPose(); - private _skeletonPoseDirty:boolean = true; - private _currentPose:SkeletonPose; - private _nextPose:SkeletonPose; - - /** - * Returns the current skeleton pose frame of animation in the clip based on the internal playhead position. - */ - public get currentPose():SkeletonPose - { - if (this._pFramesDirty) - this._pUpdateFrames(); - - return this._currentPose; - } - - /** - * Returns the next skeleton pose frame of animation in the clip based on the internal playhead position. - */ - public get nextPose():SkeletonPose - { - if (this._pFramesDirty) - this._pUpdateFrames(); - - return this._nextPose; - } - - constructor(animator:AnimatorBase, skeletonClipNode:SkeletonClipNode) - { - super(animator, skeletonClipNode); - - this._skeletonClipNode = skeletonClipNode; - this._frames = this._skeletonClipNode.frames; - } - - /** - * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. - */ - public getSkeletonPose(skeleton:Skeleton):SkeletonPose - { - if (this._skeletonPoseDirty) - this.updateSkeletonPose(skeleton); - - return this._skeletonPose; - } - - /** - * @inheritDoc - */ - public _pUpdateTime(time:number /*int*/) - { - this._skeletonPoseDirty = true; - - super._pUpdateTime(time); - } - - /** - * @inheritDoc - */ - public _pUpdateFrames() - { - super._pUpdateFrames(); - - this._currentPose = this._frames[this._pCurrentFrame]; - - if (this._skeletonClipNode.looping && this._pNextFrame >= this._skeletonClipNode.lastFrame) { - this._nextPose = this._frames[0]; - ( this._pAnimator).dispatchCycleEvent(); - } else - this._nextPose = this._frames[this._pNextFrame]; - } - - /** - * Updates the output skeleton pose of the node based on the internal playhead position. - * - * @param skeleton The skeleton used by the animator requesting the ouput pose. - */ - private updateSkeletonPose(skeleton:Skeleton) - { - this._skeletonPoseDirty = false; - - if (!this._skeletonClipNode.totalDuration) - return; - - if (this._pFramesDirty) - this._pUpdateFrames(); - - var currentPose:Array = this._currentPose.jointPoses; - var nextPose:Array = this._nextPose.jointPoses; - var numJoints:number /*uint*/ = skeleton.numJoints; - var p1:Vector3D, p2:Vector3D; - var pose1:JointPose, pose2:JointPose; - var endPoses:Array = this._skeletonPose.jointPoses; - var endPose:JointPose; - var tr:Vector3D; - - // :s - if (endPoses.length != numJoints) - endPoses.length = numJoints; - - if ((numJoints != currentPose.length) || (numJoints != nextPose.length)) - throw new Error("joint counts don't match!"); - - for (var i:number /*uint*/ = 0; i < numJoints; ++i) { - endPose = endPoses[i]; - - if (endPose == null) - endPose = endPoses[i] = new JointPose(); - - pose1 = currentPose[i]; - pose2 = nextPose[i]; - p1 = pose1.translation; - p2 = pose2.translation; - - if (this._skeletonClipNode.highQuality) - endPose.orientation.slerp(pose1.orientation, pose2.orientation, this._pBlendWeight); else - endPose.orientation.lerp(pose1.orientation, pose2.orientation, this._pBlendWeight); - - if (i > 0) { - tr = endPose.translation; - tr.x = p1.x + this._pBlendWeight*(p2.x - p1.x); - tr.y = p1.y + this._pBlendWeight*(p2.y - p1.y); - tr.z = p1.z + this._pBlendWeight*(p2.z - p1.z); - } - } - } - - /** - * @inheritDoc - */ - public _pUpdatePositionDelta() - { - this._pPositionDeltaDirty = false; - - if (this._pFramesDirty) - this._pUpdateFrames(); - - var p1:Vector3D, p2:Vector3D, p3:Vector3D; - var totalDelta:Vector3D = this._skeletonClipNode.totalDelta; - - // jumping back, need to reset position - if ((this._pTimeDir > 0 && this._pNextFrame < this._pOldFrame) || (this._pTimeDir < 0 && this._pNextFrame > this._pOldFrame)) { - this._rootPos.x -= totalDelta.x*this._pTimeDir; - this._rootPos.y -= totalDelta.y*this._pTimeDir; - this._rootPos.z -= totalDelta.z*this._pTimeDir; - } - - var dx:number = this._rootPos.x; - var dy:number = this._rootPos.y; - var dz:number = this._rootPos.z; - - if (this._skeletonClipNode.stitchFinalFrame && this._pNextFrame == this._skeletonClipNode.lastFrame) { - p1 = this._frames[0].jointPoses[0].translation; - p2 = this._frames[1].jointPoses[0].translation; - p3 = this._currentPose.jointPoses[0].translation; - - this._rootPos.x = p3.x + p1.x + this._pBlendWeight*(p2.x - p1.x); - this._rootPos.y = p3.y + p1.y + this._pBlendWeight*(p2.y - p1.y); - this._rootPos.z = p3.z + p1.z + this._pBlendWeight*(p2.z - p1.z); - } else { - p1 = this._currentPose.jointPoses[0].translation; - p2 = this._frames[this._pNextFrame].jointPoses[0].translation; //cover the instances where we wrap the pose but still want the final frame translation values - this._rootPos.x = p1.x + this._pBlendWeight*(p2.x - p1.x); - this._rootPos.y = p1.y + this._pBlendWeight*(p2.y - p1.y); - this._rootPos.z = p1.z + this._pBlendWeight*(p2.z - p1.z); - } - - this._pRootDelta.x = this._rootPos.x - dx; - this._pRootDelta.y = this._rootPos.y - dy; - this._pRootDelta.z = this._rootPos.z - dz; - - this._pOldFrame = this._pNextFrame; - } - } -} diff --git a/src/away/animators/states/SkeletonDifferenceState.ts b/src/away/animators/states/SkeletonDifferenceState.ts deleted file mode 100644 index beea067d6..000000000 --- a/src/away/animators/states/SkeletonDifferenceState.ts +++ /dev/null @@ -1,146 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - import Quaternion = away.geom.Quaternion; - - /** - * - */ - export class SkeletonDifferenceState extends AnimationStateBase implements ISkeletonAnimationState - { - private _blendWeight:number = 0; - private static _tempQuat:Quaternion = new Quaternion(); - private _skeletonAnimationNode:SkeletonDifferenceNode; - private _skeletonPose:SkeletonPose = new SkeletonPose(); - private _skeletonPoseDirty:boolean = true; - private _baseInput:ISkeletonAnimationState; - private _differenceInput:ISkeletonAnimationState; - - /** - * Defines a fractional value between 0 and 1 representing the blending ratio between the base input (0) and difference input (1), - * used to produce the skeleton pose output. - * - * @see #baseInput - * @see #differenceInput - */ - public get blendWeight():number - { - return this._blendWeight; - } - - public set blendWeight(value:number) - { - this._blendWeight = value; - - this._pPositionDeltaDirty = true; - this._skeletonPoseDirty = true; - } - - constructor(animator:AnimatorBase, skeletonAnimationNode:SkeletonDifferenceNode) - { - super(animator, skeletonAnimationNode); - - this._skeletonAnimationNode = skeletonAnimationNode; - - this._baseInput = animator.getAnimationState(this._skeletonAnimationNode.baseInput); - this._differenceInput = animator.getAnimationState(this._skeletonAnimationNode.differenceInput); - } - - /** - * @inheritDoc - */ - public phase(value:number) - { - this._skeletonPoseDirty = true; - - this._pPositionDeltaDirty = true; - - this._baseInput.phase(value); - this._baseInput.phase(value); - } - - /** - * @inheritDoc - */ - public _pUpdateTime(time:number /*int*/) - { - this._skeletonPoseDirty = true; - - this._baseInput.update(time); - this._differenceInput.update(time); - - super._pUpdateTime(time); - } - - /** - * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. - */ - public getSkeletonPose(skeleton:Skeleton):SkeletonPose - { - if (this._skeletonPoseDirty) - this.updateSkeletonPose(skeleton); - - return this._skeletonPose; - } - - /** - * @inheritDoc - */ - public _pUpdatePositionDelta() - { - this._pPositionDeltaDirty = false; - - var deltA:Vector3D = this._baseInput.positionDelta; - var deltB:Vector3D = this._differenceInput.positionDelta; - - this.positionDelta.x = deltA.x + this._blendWeight*deltB.x; - this.positionDelta.y = deltA.y + this._blendWeight*deltB.y; - this.positionDelta.z = deltA.z + this._blendWeight*deltB.z; - } - - /** - * Updates the output skeleton pose of the node based on the blendWeight value between base input and difference input nodes. - * - * @param skeleton The skeleton used by the animator requesting the ouput pose. - */ - private updateSkeletonPose(skeleton:Skeleton) - { - this._skeletonPoseDirty = false; - - var endPose:JointPose; - var endPoses:Array = this._skeletonPose.jointPoses; - var basePoses:Array = this._baseInput.getSkeletonPose(skeleton).jointPoses; - var diffPoses:Array = this._differenceInput.getSkeletonPose(skeleton).jointPoses; - var base:JointPose, diff:JointPose; - var basePos:Vector3D, diffPos:Vector3D; - var tr:Vector3D; - var numJoints:number /*uint*/ = skeleton.numJoints; - - // :s - if (endPoses.length != numJoints) - endPoses.length = numJoints; - - for (var i:number /*uint*/ = 0; i < numJoints; ++i) { - endPose = endPoses[i]; - - if (endPose == null) - endPose = endPoses[i] = new JointPose(); - - base = basePoses[i]; - diff = diffPoses[i]; - basePos = base.translation; - diffPos = diff.translation; - - SkeletonDifferenceState._tempQuat.multiply(diff.orientation, base.orientation); - endPose.orientation.lerp(base.orientation, SkeletonDifferenceState._tempQuat, this._blendWeight); - - tr = endPose.translation; - tr.x = basePos.x + this._blendWeight*diffPos.x; - tr.y = basePos.y + this._blendWeight*diffPos.y; - tr.z = basePos.z + this._blendWeight*diffPos.z; - } - } - } -} diff --git a/src/away/animators/states/SkeletonDirectionalState.ts b/src/away/animators/states/SkeletonDirectionalState.ts deleted file mode 100644 index 3f711847f..000000000 --- a/src/away/animators/states/SkeletonDirectionalState.ts +++ /dev/null @@ -1,199 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - - /** - * - */ - export class SkeletonDirectionalState extends AnimationStateBase implements ISkeletonAnimationState - { - private _skeletonAnimationNode:SkeletonDirectionalNode; - private _skeletonPose:SkeletonPose = new SkeletonPose(); - private _skeletonPoseDirty:boolean = true; - private _inputA:ISkeletonAnimationState; - private _inputB:ISkeletonAnimationState; - private _blendWeight:number = 0; - private _direction:number = 0; - private _blendDirty:boolean = true; - private _forward:ISkeletonAnimationState; - private _backward:ISkeletonAnimationState; - private _left:ISkeletonAnimationState; - private _right:ISkeletonAnimationState; - - /** - * Defines the direction in degrees of the aniamtion between the forwards (0), right(90) backwards (180) and left(270) input nodes, - * used to produce the skeleton pose output. - */ - public set direction(value:number) - { - if (this._direction == value) - return; - - this._direction = value; - - this._blendDirty = true; - - this._skeletonPoseDirty = true; - this._pPositionDeltaDirty = true; - } - - public get direction():number - { - return this._direction; - } - - constructor(animator:AnimatorBase, skeletonAnimationNode:SkeletonDirectionalNode) - { - super(animator, skeletonAnimationNode); - - this._skeletonAnimationNode = skeletonAnimationNode; - - this._forward = animator.getAnimationState(this._skeletonAnimationNode.forward); - this._backward = animator.getAnimationState(this._skeletonAnimationNode.backward); - this._left = animator.getAnimationState(this._skeletonAnimationNode.left); - this._right = animator.getAnimationState(this._skeletonAnimationNode.right); - } - - /** - * @inheritDoc - */ - public phase(value:number) - { - if (this._blendDirty) - this.updateBlend(); - - this._skeletonPoseDirty = true; - - this._pPositionDeltaDirty = true; - - this._inputA.phase(value); - this._inputB.phase(value); - } - - /** - * @inheritDoc - */ - public _pUdateTime(time:number /*int*/) - { - if (this._blendDirty) - this.updateBlend(); - - this._skeletonPoseDirty = true; - - this._inputA.update(time); - this._inputB.update(time); - - super._pUpdateTime(time); - } - - /** - * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. - */ - public getSkeletonPose(skeleton:Skeleton):SkeletonPose - { - if (this._skeletonPoseDirty) - this.updateSkeletonPose(skeleton); - - return this._skeletonPose; - } - - /** - * @inheritDoc - */ - public _pUpdatePositionDelta() - { - this._pPositionDeltaDirty = false; - - if (this._blendDirty) - this.updateBlend(); - - var deltA:Vector3D = this._inputA.positionDelta; - var deltB:Vector3D = this._inputB.positionDelta; - - this.positionDelta.x = deltA.x + this._blendWeight*(deltB.x - deltA.x); - this.positionDelta.y = deltA.y + this._blendWeight*(deltB.y - deltA.y); - this.positionDelta.z = deltA.z + this._blendWeight*(deltB.z - deltA.z); - } - - /** - * Updates the output skeleton pose of the node based on the direction value between forward, backwards, left and right input nodes. - * - * @param skeleton The skeleton used by the animator requesting the ouput pose. - */ - private updateSkeletonPose(skeleton:Skeleton) - { - this._skeletonPoseDirty = false; - - if (this._blendDirty) - this.updateBlend(); - - var endPose:JointPose; - var endPoses:Array = this._skeletonPose.jointPoses; - var poses1:Array = this._inputA.getSkeletonPose(skeleton).jointPoses; - var poses2:Array = this._inputB.getSkeletonPose(skeleton).jointPoses; - var pose1:JointPose, pose2:JointPose; - var p1:Vector3D, p2:Vector3D; - var tr:Vector3D; - var numJoints:number /*uint*/ = skeleton.numJoints; - - // :s - if (endPoses.length != numJoints) - endPoses.length = numJoints; - - for (var i:number /*uint*/ = 0; i < numJoints; ++i) { - endPose = endPoses[i]; - - if (endPose == null) - endPose = endPoses[i] = new JointPose(); - - pose1 = poses1[i]; - pose2 = poses2[i]; - p1 = pose1.translation; - p2 = pose2.translation; - - endPose.orientation.lerp(pose1.orientation, pose2.orientation, this._blendWeight); - - tr = endPose.translation; - tr.x = p1.x + this._blendWeight*(p2.x - p1.x); - tr.y = p1.y + this._blendWeight*(p2.y - p1.y); - tr.z = p1.z + this._blendWeight*(p2.z - p1.z); - } - } - - /** - * Updates the blend value for the animation output based on the direction value between forward, backwards, left and right input nodes. - * - * @private - */ - private updateBlend() - { - this._blendDirty = false; - - if (this._direction < 0 || this._direction > 360) { - this._direction %= 360; - if (this._direction < 0) - this._direction += 360; - } - - if (this._direction < 90) { - this._inputA = this._forward; - this._inputB = this._right; - this._blendWeight = this._direction/90; - } else if (this._direction < 180) { - this._inputA = this._right; - this._inputB = this._backward; - this._blendWeight = (this._direction - 90)/90; - } else if (this._direction < 270) { - this._inputA = this._backward; - this._inputB = this._left; - this._blendWeight = (this._direction - 180)/90; - } else { - this._inputA = this._left; - this._inputB = this._forward; - this._blendWeight = (this._direction - 270)/90; - } - } - } -} diff --git a/src/away/animators/states/SkeletonNaryLERPState.ts b/src/away/animators/states/SkeletonNaryLERPState.ts deleted file mode 100644 index de8eb1373..000000000 --- a/src/away/animators/states/SkeletonNaryLERPState.ts +++ /dev/null @@ -1,220 +0,0 @@ -/// - -module away.animators -{ - import Vector3D = away.geom.Vector3D; - import Quaternion = away.geom.Quaternion; - - /** - * - */ - export class SkeletonNaryLERPState extends AnimationStateBase implements ISkeletonAnimationState - { - private _skeletonAnimationNode:SkeletonNaryLERPNode; - private _skeletonPose:SkeletonPose = new SkeletonPose(); - private _skeletonPoseDirty:boolean = true; - private _blendWeights:Array = new Array(); - private _inputs:Array = new Array(); - - constructor(animator:AnimatorBase, skeletonAnimationNode:SkeletonNaryLERPNode) - { - super(animator, skeletonAnimationNode); - - this._skeletonAnimationNode = skeletonAnimationNode; - - var i:number /*uint*/ = this._skeletonAnimationNode.numInputs; - - while (i--) - this._inputs[i] = animator.getAnimationState(this._skeletonAnimationNode._iInputs[i]); - } - - /** - * @inheritDoc - */ - public phase(value:number) - { - this._skeletonPoseDirty = true; - - this._pPositionDeltaDirty = true; - - for (var j:number /*uint*/ = 0; j < this._skeletonAnimationNode.numInputs; ++j) { - if (this._blendWeights[j]) - this._inputs[j].update(value); - } - } - - /** - * @inheritDoc - */ - public _pUdateTime(time:number /*int*/) - { - for (var j:number /*uint*/ = 0; j < this._skeletonAnimationNode.numInputs; ++j) { - if (this._blendWeights[j]) - this._inputs[j].update(time); - } - - super._pUpdateTime(time); - } - - /** - * Returns the current skeleton pose of the animation in the clip based on the internal playhead position. - */ - public getSkeletonPose(skeleton:Skeleton):SkeletonPose - { - if (this._skeletonPoseDirty) - this.updateSkeletonPose(skeleton); - - return this._skeletonPose; - } - - /** - * Returns the blend weight of the skeleton aniamtion node that resides at the given input index. - * - * @param index The input index for which the skeleton animation node blend weight is requested. - */ - public getBlendWeightAt(index:number /*uint*/):number - { - return this._blendWeights[index]; - } - - /** - * Sets the blend weight of the skeleton aniamtion node that resides at the given input index. - * - * @param index The input index on which the skeleton animation node blend weight is to be set. - * @param blendWeight The blend weight value to use for the given skeleton animation node index. - */ - public setBlendWeightAt(index:number /*uint*/, blendWeight:number) - { - this._blendWeights[index] = blendWeight; - - this._pPositionDeltaDirty = true; - this._skeletonPoseDirty = true; - } - - /** - * @inheritDoc - */ - public _pUpdatePositionDelta() - { - this._pPositionDeltaDirty = false; - - var delta:Vector3D; - var weight:number; - - this.positionDelta.x = 0; - this.positionDelta.y = 0; - this.positionDelta.z = 0; - - for (var j:number /*uint*/ = 0; j < this._skeletonAnimationNode.numInputs; ++j) { - weight = this._blendWeights[j]; - - if (weight) { - delta = this._inputs[j].positionDelta; - this.positionDelta.x += weight*delta.x; - this.positionDelta.y += weight*delta.y; - this.positionDelta.z += weight*delta.z; - } - } - } - - /** - * Updates the output skeleton pose of the node based on the blend weight values given to the input nodes. - * - * @param skeleton The skeleton used by the animator requesting the ouput pose. - */ - private updateSkeletonPose(skeleton:Skeleton) - { - this._skeletonPoseDirty = false; - - var weight:number; - var endPoses:Array = this._skeletonPose.jointPoses; - var poses:Array; - var endPose:JointPose, pose:JointPose; - var endTr:Vector3D, tr:Vector3D; - var endQuat:Quaternion, q:Quaternion; - var firstPose:Array; - var i:number /*uint*/; - var w0:number, x0:number, y0:number, z0:number; - var w1:number, x1:number, y1:number, z1:number; - var numJoints:number /*uint*/ = skeleton.numJoints; - - // :s - if (endPoses.length != numJoints) - endPoses.length = numJoints; - - for (var j:number /*uint*/ = 0; j < this._skeletonAnimationNode.numInputs; ++j) { - weight = this._blendWeights[j]; - - if (!weight) - continue; - - poses = this._inputs[j].getSkeletonPose(skeleton).jointPoses; - - if (!firstPose) { - firstPose = poses; - for (i = 0; i < numJoints; ++i) { - endPose = endPoses[i]; - - if (endPose == null) - endPose = endPoses[i] = new JointPose(); - - pose = poses[i]; - q = pose.orientation; - tr = pose.translation; - - endQuat = endPose.orientation; - - endQuat.x = weight*q.x; - endQuat.y = weight*q.y; - endQuat.z = weight*q.z; - endQuat.w = weight*q.w; - - endTr = endPose.translation; - endTr.x = weight*tr.x; - endTr.y = weight*tr.y; - endTr.z = weight*tr.z; - } - } else { - for (i = 0; i < skeleton.numJoints; ++i) { - endPose = endPoses[i]; - pose = poses[i]; - - q = firstPose[i].orientation; - x0 = q.x; - y0 = q.y; - z0 = q.z; - w0 = q.w; - - q = pose.orientation; - tr = pose.translation; - - x1 = q.x; - y1 = q.y; - z1 = q.z; - w1 = q.w; - // find shortest direction - if (x0*x1 + y0*y1 + z0*z1 + w0*w1 < 0) { - x1 = -x1; - y1 = -y1; - z1 = -z1; - w1 = -w1; - } - endQuat = endPose.orientation; - endQuat.x += weight*x1; - endQuat.y += weight*y1; - endQuat.z += weight*z1; - endQuat.w += weight*w1; - - endTr = endPose.translation; - endTr.x += weight*tr.x; - endTr.y += weight*tr.y; - endTr.z += weight*tr.z; - } - } - } - - for (i = 0; i < skeleton.numJoints; ++i) - endPoses[i].orientation.normalize(); - } - } -} diff --git a/src/away/animators/states/VertexClipState.ts b/src/away/animators/states/VertexClipState.ts deleted file mode 100644 index 40ce3f8b9..000000000 --- a/src/away/animators/states/VertexClipState.ts +++ /dev/null @@ -1,69 +0,0 @@ -/// - -module away.animators -{ - /** - * - */ - export class VertexClipState extends AnimationClipState implements IVertexAnimationState - { - private _frames:Array; - private _vertexClipNode:VertexClipNode; - private _currentGeometry:away.base.Geometry; - private _nextGeometry:away.base.Geometry; - - /** - * @inheritDoc - */ - public get currentGeometry():away.base.Geometry - { - if (this._pFramesDirty) - this._pUpdateFrames(); - - return this._currentGeometry; - } - - /** - * @inheritDoc - */ - public get nextGeometry():away.base.Geometry - { - if (this._pFramesDirty) - this._pUpdateFrames(); - - return this._nextGeometry; - } - - constructor(animator:AnimatorBase, vertexClipNode:VertexClipNode) - { - super(animator, vertexClipNode); - - this._vertexClipNode = vertexClipNode; - this._frames = this._vertexClipNode.frames; - } - - /** - * @inheritDoc - */ - public _pUpdateFrames() - { - super._pUpdateFrames(); - - this._currentGeometry = this._frames[this._pCurrentFrame]; - - if (this._vertexClipNode.looping && this._pNextFrame >= this._vertexClipNode.lastFrame) { - this._nextGeometry = this._frames[0]; - ( this._pAnimator).dispatchCycleEvent(); - } else - this._nextGeometry = this._frames[this._pNextFrame]; - } - - /** - * @inheritDoc - */ - public _pUpdatePositionDelta() - { - //TODO:implement positiondelta functionality for vertex animations - } - } -} diff --git a/src/away/animators/transitions/CrossfadeTransition.ts b/src/away/animators/transitions/CrossfadeTransition.ts deleted file mode 100644 index 8819e8883..000000000 --- a/src/away/animators/transitions/CrossfadeTransition.ts +++ /dev/null @@ -1,26 +0,0 @@ -/// - -module away.animators -{ - - export class CrossfadeTransition implements IAnimationTransition - { - public blendSpeed:number = 0.5; - - constructor(blendSpeed:number) - { - this.blendSpeed = blendSpeed; - } - - public getAnimationNode(animator:AnimatorBase, startNode:AnimationNodeBase, endNode:AnimationNodeBase, startBlend:number /*int*/):AnimationNodeBase - { - var crossFadeTransitionNode:CrossfadeTransitionNode = new CrossfadeTransitionNode(); - crossFadeTransitionNode.inputA = startNode; - crossFadeTransitionNode.inputB = endNode; - crossFadeTransitionNode.blendSpeed = this.blendSpeed; - crossFadeTransitionNode.startBlend = startBlend; - - return crossFadeTransitionNode; - } - } -} diff --git a/src/away/animators/transitions/CrossfadeTransitionNode.ts b/src/away/animators/transitions/CrossfadeTransitionNode.ts deleted file mode 100644 index 9fa412133..000000000 --- a/src/away/animators/transitions/CrossfadeTransitionNode.ts +++ /dev/null @@ -1,25 +0,0 @@ -/// - -module away.animators -{ - - /** - * A skeleton animation node that uses two animation node inputs to blend a lineraly interpolated output of a skeleton pose. - */ - export class CrossfadeTransitionNode extends SkeletonBinaryLERPNode - { - public blendSpeed:number; - - public startBlend:number /*int*/; - - /** - * Creates a new CrossfadeTransitionNode object. - */ - constructor() - { - super(); - - this._pStateClass = CrossfadeTransitionState; - } - } -} diff --git a/src/away/animators/transitions/CrossfadeTransitionState.ts b/src/away/animators/transitions/CrossfadeTransitionState.ts deleted file mode 100644 index 79a8a229a..000000000 --- a/src/away/animators/transitions/CrossfadeTransitionState.ts +++ /dev/null @@ -1,41 +0,0 @@ -/// - -module away.animators -{ - import AnimationStateEvent = away.events.AnimationStateEvent; - - /** - * - */ - export class CrossfadeTransitionState extends SkeletonBinaryLERPState - { - private _crossfadeTransitionNode:CrossfadeTransitionNode; - private _animationStateTransitionComplete:AnimationStateEvent; - - constructor(animator:AnimatorBase, skeletonAnimationNode:CrossfadeTransitionNode) - { - super(animator, skeletonAnimationNode); - - this._crossfadeTransitionNode = skeletonAnimationNode; - } - - /** - * @inheritDoc - */ - public _pUpdateTime(time:number /*int*/) - { - this.blendWeight = Math.abs(time - this._crossfadeTransitionNode.startBlend)/(1000*this._crossfadeTransitionNode.blendSpeed); - - if (this.blendWeight >= 1) { - this.blendWeight = 1; - - if (this._animationStateTransitionComplete == null) - this._animationStateTransitionComplete = new AnimationStateEvent(AnimationStateEvent.TRANSITION_COMPLETE, this._pAnimator, this, this._crossfadeTransitionNode); - - this._crossfadeTransitionNode.dispatchEvent(this._animationStateTransitionComplete); - } - - super._pUpdateTime(time); - } - } -} diff --git a/src/away/animators/transitions/IAnimationTransition.ts b/src/away/animators/transitions/IAnimationTransition.ts deleted file mode 100644 index 6e96aa5ad..000000000 --- a/src/away/animators/transitions/IAnimationTransition.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// - -module away.animators -{ - export interface IAnimationTransition - { - getAnimationNode(animator:AnimatorBase, startNode:AnimationNodeBase, endNode:AnimationNodeBase, startTime:number /*int*/):AnimationNodeBase - } -} diff --git a/src/away/core/base/ParticleGeometry.ts b/src/away/core/base/ParticleGeometry.ts deleted file mode 100644 index e943dc3d2..000000000 --- a/src/away/core/base/ParticleGeometry.ts +++ /dev/null @@ -1,19 +0,0 @@ -/// - -/** - * @module away.base - */ -module away.base -{ - /** - * @class away.base.ParticleGeometry - */ - export class ParticleGeometry extends Geometry - { - public particles:Array; - - public numParticles:number /*uint*/; - - } - -} diff --git a/src/away/core/pick/JSPickingCollider.ts b/src/away/core/pick/JSPickingCollider.ts deleted file mode 100644 index a27132644..000000000 --- a/src/away/core/pick/JSPickingCollider.ts +++ /dev/null @@ -1,148 +0,0 @@ -/// - -/** - * @module away.pick - */ -module away.pick -{ - import SubGeometry = away.base.TriangleSubGeometry; - - /** - * Pure JS picking collider for display objects. Used with the RaycastPicker picking object. - * - * @see away.base.DisplayObject#pickingCollider - * @see away.pick.RaycastPicker - * - * @class away.pick.JSPickingCollider - */ - export class JSPickingCollider extends PickingColliderBase implements IPickingCollider - { - private _findClosestCollision:boolean; - - /** - * Creates a new JSPickingCollider object. - * - * @param findClosestCollision Determines whether the picking collider searches for the closest collision along the ray. Defaults to false. - */ - constructor(findClosestCollision:boolean = false) - { - super(); - - this._findClosestCollision = findClosestCollision; - } - - /** - * @inheritDoc - */ - public _pTestRenderableCollision(renderable:away.pool.RenderableBase, pickingCollisionVO:PickingCollisionVO, shortestCollisionDistance:number):boolean - { - var t:number; - var i0:number, i1:number, i2:number; - var rx:number, ry:number, rz:number; - var nx:number, ny:number, nz:number; - var cx:number, cy:number, cz:number; - var coeff:number, u:number, v:number, w:number; - var p0x:number, p0y:number, p0z:number; - var p1x:number, p1y:number, p1z:number; - var p2x:number, p2y:number, p2z:number; - var s0x:number, s0y:number, s0z:number; - var s1x:number, s1y:number, s1z:number; - var nl:number, nDotV:number, D:number, disToPlane:number; - var Q1Q2:number, Q1Q1:number, Q2Q2:number, RQ1:number, RQ2:number; - var indexData:Array = renderable.getIndexData().data; - var collisionTriangleIndex:number = -1; - var bothSides:boolean = ( renderable.materialOwner.material).bothSides; - - var positionData:Array = renderable.getVertexData(SubGeometry.POSITION_DATA).data; - var positionStride:number = renderable.getVertexData(SubGeometry.POSITION_DATA).dataPerVertex; - var positionOffset:number = renderable.getVertexOffset(SubGeometry.POSITION_DATA); - var uvData:Array = renderable.getVertexData(SubGeometry.UV_DATA).data; - var uvStride:number = renderable.getVertexData(SubGeometry.UV_DATA).dataPerVertex; - var uvOffset:number = renderable.getVertexOffset(SubGeometry.UV_DATA); - var numIndices:number = indexData.length; - - for (var index:number = 0; index < numIndices; index += 3) { // sweep all triangles - // evaluate triangle indices - i0 = positionOffset + indexData[ index ]*positionStride; - i1 = positionOffset + indexData[ (index + 1) ]*positionStride; - i2 = positionOffset + indexData[ (index + 2) ]*positionStride; - - // evaluate triangle positions - p0x = positionData[ i0 ]; - p0y = positionData[ (i0 + 1) ]; - p0z = positionData[ (i0 + 2) ]; - p1x = positionData[ i1 ]; - p1y = positionData[ (i1 + 1) ]; - p1z = positionData[ (i1 + 2) ]; - p2x = positionData[ i2 ]; - p2y = positionData[ (i2 + 1) ]; - p2z = positionData[ (i2 + 2) ]; - - // evaluate sides and triangle normal - s0x = p1x - p0x; // s0 = p1 - p0 - s0y = p1y - p0y; - s0z = p1z - p0z; - s1x = p2x - p0x; // s1 = p2 - p0 - s1y = p2y - p0y; - s1z = p2z - p0z; - nx = s0y*s1z - s0z*s1y; // n = s0 x s1 - ny = s0z*s1x - s0x*s1z; - nz = s0x*s1y - s0y*s1x; - nl = 1/Math.sqrt(nx*nx + ny*ny + nz*nz); // normalize n - nx *= nl; - ny *= nl; - nz *= nl; - - // -- plane intersection test -- - nDotV = nx*this.rayDirection.x + ny* +this.rayDirection.y + nz*this.rayDirection.z; // rayDirection . normal - if (( !bothSides && nDotV < 0.0 ) || ( bothSides && nDotV != 0.0 )) { // an intersection must exist - // find collision t - D = -( nx*p0x + ny*p0y + nz*p0z ); - disToPlane = -( nx*this.rayPosition.x + ny*this.rayPosition.y + nz*this.rayPosition.z + D ); - t = disToPlane/nDotV; - // find collision point - cx = this.rayPosition.x + t*this.rayDirection.x; - cy = this.rayPosition.y + t*this.rayDirection.y; - cz = this.rayPosition.z + t*this.rayDirection.z; - // collision point inside triangle? ( using barycentric coordinates ) - Q1Q2 = s0x*s1x + s0y*s1y + s0z*s1z; - Q1Q1 = s0x*s0x + s0y*s0y + s0z*s0z; - Q2Q2 = s1x*s1x + s1y*s1y + s1z*s1z; - rx = cx - p0x; - ry = cy - p0y; - rz = cz - p0z; - RQ1 = rx*s0x + ry*s0y + rz*s0z; - RQ2 = rx*s1x + ry*s1y + rz*s1z; - coeff = 1/( Q1Q1*Q2Q2 - Q1Q2*Q1Q2 ); - v = coeff*( Q2Q2*RQ1 - Q1Q2*RQ2 ); - w = coeff*( -Q1Q2*RQ1 + Q1Q1*RQ2 ); - if (v < 0) - continue; - if (w < 0) - continue; - u = 1 - v - w; - if (!( u < 0 ) && t > 0 && t < shortestCollisionDistance) { // all tests passed - shortestCollisionDistance = t; - collisionTriangleIndex = index/3; - pickingCollisionVO.rayEntryDistance = t; - pickingCollisionVO.localPosition = new away.geom.Vector3D(cx, cy, cz); - pickingCollisionVO.localNormal = new away.geom.Vector3D(nx, ny, nz); - pickingCollisionVO.uv = this._pGetCollisionUV(indexData, uvData, index, v, w, u, uvOffset, uvStride); - pickingCollisionVO.index = index; -// pickingCollisionVO.subGeometryIndex = this.pGetMeshSubMeshIndex(renderable); - - // if not looking for best hit, first found will do... - if (!this._findClosestCollision) - return true; - } - } - } - - - if (collisionTriangleIndex >= 0) - return true; - - return false; - } - } -} diff --git a/src/away/core/pick/PickingColliderBase.ts b/src/away/core/pick/PickingColliderBase.ts deleted file mode 100644 index 41b66cf09..000000000 --- a/src/away/core/pick/PickingColliderBase.ts +++ /dev/null @@ -1,130 +0,0 @@ -/// - -/** - * @module away.pick - */ -module away.pick -{ - /** - * An abstract base class for all picking collider classes. It should not be instantiated directly. - * - * @class away.pick.PickingColliderBase - */ - export class PickingColliderBase - { - private _billboardRenderablePool:away.pool.RenderablePool; - private _subMeshRenderablePool:away.pool.RenderablePool; - - public rayPosition:away.geom.Vector3D; - public rayDirection:away.geom.Vector3D; - - constructor() - { - this._billboardRenderablePool = away.pool.RenderablePool.getPool(away.pool.BillboardRenderable); - this._subMeshRenderablePool = away.pool.RenderablePool.getPool(away.pool.TriangleSubMeshRenderable); - } - - public _pPetCollisionNormal(indexData:Array /*uint*/, vertexData:Array, triangleIndex:number):away.geom.Vector3D // PROTECTED - { - var normal:away.geom.Vector3D = new away.geom.Vector3D(); - var i0:number = indexData[ triangleIndex ]*3; - var i1:number = indexData[ triangleIndex + 1 ]*3; - var i2:number = indexData[ triangleIndex + 2 ]*3; - var p0:away.geom.Vector3D = new away.geom.Vector3D(vertexData[ i0 ], vertexData[ i0 + 1 ], vertexData[ i0 + 2 ]); - var p1:away.geom.Vector3D = new away.geom.Vector3D(vertexData[ i1 ], vertexData[ i1 + 1 ], vertexData[ i1 + 2 ]); - var p2:away.geom.Vector3D = new away.geom.Vector3D(vertexData[ i2 ], vertexData[ i2 + 1 ], vertexData[ i2 + 2 ]); - var side0:away.geom.Vector3D = p1.subtract(p0); - var side1:away.geom.Vector3D = p2.subtract(p0); - normal = side0.crossProduct(side1); - normal.normalize(); - return normal; - } - - public _pGetCollisionUV(indexData:Array /*uint*/, uvData:Array, triangleIndex:number, v:number, w:number, u:number, uvOffset:number, uvStride:number):away.geom.Point // PROTECTED - { - var uv:away.geom.Point = new away.geom.Point(); - var uIndex:number = indexData[ triangleIndex ]*uvStride + uvOffset; - var uv0:away.geom.Vector3D = new away.geom.Vector3D(uvData[ uIndex ], uvData[ uIndex + 1 ]); - uIndex = indexData[ triangleIndex + 1 ]*uvStride + uvOffset; - var uv1:away.geom.Vector3D = new away.geom.Vector3D(uvData[ uIndex ], uvData[ uIndex + 1 ]); - uIndex = indexData[ triangleIndex + 2 ]*uvStride + uvOffset; - var uv2:away.geom.Vector3D = new away.geom.Vector3D(uvData[ uIndex ], uvData[ uIndex + 1 ]); - uv.x = u*uv0.x + v*uv1.x + w*uv2.x; - uv.y = u*uv0.y + v*uv1.y + w*uv2.y; - return uv; - } - - /** - * @inheritDoc - */ - public _pTestRenderableCollision(renderable:away.pool.RenderableBase, pickingCollisionVO:PickingCollisionVO, shortestCollisionDistance:number):boolean - { - throw new away.errors.AbstractMethodError(); - } - - /** - * @inheritDoc - */ - public setLocalRay(localPosition:away.geom.Vector3D, localDirection:away.geom.Vector3D) - { - this.rayPosition = localPosition; - this.rayDirection = localDirection; - } - - /** - * Tests a Billboard object for a collision with the picking ray. - * - * @param billboard The billboard instance to be tested. - * @param pickingCollisionVO The collision object used to store the collision results - * @param shortestCollisionDistance The current value of the shortest distance to a detected collision along the ray. - * @param findClosest - */ - public testBillboardCollision(billboard:away.entities.Billboard, pickingCollisionVO:PickingCollisionVO, shortestCollisionDistance:number) - { - this.setLocalRay(pickingCollisionVO.localRayPosition, pickingCollisionVO.localRayDirection); - pickingCollisionVO.materialOwner = null; - - if (this._pTestRenderableCollision( this._billboardRenderablePool.getItem(billboard), pickingCollisionVO, shortestCollisionDistance)) { - shortestCollisionDistance = pickingCollisionVO.rayEntryDistance; - - pickingCollisionVO.materialOwner = billboard; - - return true; - } - - return false; - } - - /** - * Tests a Mesh object for a collision with the picking ray. - * - * @param mesh The mesh instance to be tested. - * @param pickingCollisionVO The collision object used to store the collision results - * @param shortestCollisionDistance The current value of the shortest distance to a detected collision along the ray. - * @param findClosest - */ - public testMeshCollision(mesh:away.entities.Mesh, pickingCollisionVO:PickingCollisionVO, shortestCollisionDistance:number, findClosest:boolean):boolean - { - this.setLocalRay(pickingCollisionVO.localRayPosition, pickingCollisionVO.localRayDirection); - pickingCollisionVO.materialOwner = null; - - var subMesh:away.base.ISubMesh; - - var len:number = mesh.subMeshes.length; - for (var i:number = 0; i < len; ++i) { - subMesh = mesh.subMeshes[i]; - - if (this._pTestRenderableCollision( this._subMeshRenderablePool.getItem(subMesh), pickingCollisionVO, shortestCollisionDistance)) { - shortestCollisionDistance = pickingCollisionVO.rayEntryDistance; - - pickingCollisionVO.materialOwner = subMesh; - - if (!findClosest) - return true; - } - } - - return pickingCollisionVO.materialOwner != null; - } - } -} diff --git a/src/away/core/pick/ShaderPicker.ts b/src/away/core/pick/ShaderPicker.ts deleted file mode 100644 index fce07af88..000000000 --- a/src/away/core/pick/ShaderPicker.ts +++ /dev/null @@ -1,560 +0,0 @@ -/// - -/** - * @module away.pick - */ -module away.pick -{ - import BitmapData = away.base.BitmapData; - import Stage = away.base.Stage; - import TriangleSubGeometry = away.base.TriangleSubGeometry; - import Scene = away.containers.Scene; - import View = away.containers.View; - import Camera = away.entities.Camera; - import IEntity = away.entities.IEntity; - import Box = away.geom.Box; - import Matrix3D = away.geom.Matrix3D; - import Matrix3DUtils = away.geom.Matrix3DUtils; - import Point = away.geom.Point; - import Rectangle = away.geom.Rectangle; - import Vector3D = away.geom.Vector3D; - import RenderableBase = away.pool.RenderableBase; - import DefaultRenderer = away.render.DefaultRenderer; - import ContextGLBlendFactor = away.stagegl.ContextGLBlendFactor; - import ContextGLClearMask = away.stagegl.ContextGLClearMask; - import ContextGLCompareMode = away.stagegl.ContextGLCompareMode; - import ContextGLProgramType = away.stagegl.ContextGLProgramType; - import ContextGLTriangleFace = away.stagegl.ContextGLTriangleFace; - import IContextStageGL = away.stagegl.IContextStageGL; - import IProgram = away.stagegl.IProgram; - import ITextureBase = away.stagegl.ITextureBase; - import EntityCollector = away.traverse.EntityCollector; - import ByteArray = away.utils.ByteArray; - - /** - * Picks a 3d object from a view or scene by performing a separate render pass on the scene around the area being picked using key color values, - * then reading back the color value of the pixel in the render representing the picking ray. Requires multiple passes and readbacks for retriving details - * on an entity that has its shaderPickingDetails property set to true. - * - * A read-back operation from any GPU is not a very efficient process, and the amount of processing used can vary significantly between different hardware. - * - * @see away.entities.Entity#shaderPickingDetails - * - * @class away.pick.ShaderPicker - */ - export class ShaderPicker implements IPicker - { - private _opaqueRenderableHead:RenderableBase; - private _blendedRenderableHead:RenderableBase; - - private _stage:Stage; - private _context:IContextStageGL; - private _onlyMouseEnabled:boolean = true; - - private _objectProgram:IProgram; - private _triangleProgram:IProgram; - private _bitmapData:BitmapData; - private _viewportData:number[]; - private _boundOffsetScale:number[]; - private _id:number[]; - - private _interactives:Array = new Array(); - private _interactiveId:number; - private _hitColor:number; - private _projX:number; - private _projY:number; - - private _hitRenderable:RenderableBase; - private _hitEntity:IEntity; - private _localHitPosition:Vector3D = new Vector3D(); - private _hitUV:Point = new Point(); - private _faceIndex:number; - private _subGeometryIndex:number; - - private _localHitNormal:Vector3D = new Vector3D(); - - private _rayPos:Vector3D = new Vector3D(); - private _rayDir:Vector3D = new Vector3D(); - private _potentialFound:boolean; - private static MOUSE_SCISSOR_RECT:Rectangle = new Rectangle(0, 0, 1, 1); - - private _shaderPickingDetails:boolean; - - /** - * @inheritDoc - */ - public get onlyMouseEnabled():boolean - { - return this._onlyMouseEnabled; - } - - public set onlyMouseEnabled(value:boolean) - { - this._onlyMouseEnabled = value; - } - - /** - * Creates a new ShaderPicker object. - * - * @param shaderPickingDetails Determines whether the picker includes a second pass to calculate extra - * properties such as uv and normal coordinates. - */ - constructor(shaderPickingDetails:boolean = false) - { - this._shaderPickingDetails = shaderPickingDetails; - - this._id = new Array(4); - this._viewportData = new Array(4); // first 2 contain scale, last 2 translation - this._boundOffsetScale = new Array(8); // first 2 contain scale, last 2 translation - this._boundOffsetScale[3] = 0; - this._boundOffsetScale[7] = 1; - } - - /** - * @inheritDoc - */ - public getViewCollision(x:number, y:number, view:View):PickingCollisionVO - { - var collector:EntityCollector = view.iEntityCollector; - - this._stage = ( view.renderer).stage; - - if (!this._stage) - return null; - - this._context = this._stage.context; - - this._viewportData[0] = view.width; - this._viewportData[1] = view.height; - this._viewportData[2] = -(this._projX = 2*x/view.width - 1); - this._viewportData[3] = this._projY = 2*y/view.height - 1; - - // _potentialFound will be set to true if any object is actually rendered - this._potentialFound = false; - - //reset head values - this._blendedRenderableHead = null; - this._opaqueRenderableHead = null; - - this.pDraw(collector, null); - - // clear buffers - this._context.setVertexBufferAt(0, null); - - if (!this._context || !this._potentialFound) - return null; - - if (!this._bitmapData) - this._bitmapData = new BitmapData(1, 1, false, 0); - - this._context.drawToBitmapData(this._bitmapData); - this._hitColor = this._bitmapData.getPixel(0, 0); - - if (!this._hitColor) { - this._context.present(); - return null; - } - - this._hitRenderable = this._interactives[this._hitColor - 1]; - this._hitEntity = this._hitRenderable.sourceEntity; - - if (this._onlyMouseEnabled && !this._hitEntity._iIsMouseEnabled()) - return null; - - var _collisionVO:PickingCollisionVO = this._hitEntity._iPickingCollisionVO; - if (this._shaderPickingDetails) { - this.getHitDetails(view.camera); - _collisionVO.localPosition = this._localHitPosition; - _collisionVO.localNormal = this._localHitNormal; - _collisionVO.uv = this._hitUV; - _collisionVO.index = this._faceIndex; - //_collisionVO.subGeometryIndex = this._subGeometryIndex; - - } else { - _collisionVO.localPosition = null; - _collisionVO.localNormal = null; - _collisionVO.uv = null; - _collisionVO.index = 0; - //_collisionVO.subGeometryIndex = 0; - } - - return _collisionVO; - } - - //*/ - /** - * @inheritDoc - */ - public getSceneCollision(position:Vector3D, direction:Vector3D, scene:Scene):PickingCollisionVO - { - return null; - } - - /** - * @inheritDoc - */ - public pDraw(entityCollector:EntityCollector, target:ITextureBase) - { - - var camera:Camera = entityCollector.camera; - - this._context.clear(0, 0, 0, 1); - this._stage.scissorRect = ShaderPicker.MOUSE_SCISSOR_RECT; - - this._interactives.length = this._interactiveId = 0; - - if (!this._objectProgram) - this.initObjectProgram(); - - this._context.setBlendFactors(ContextGLBlendFactor.ONE, ContextGLBlendFactor.ZERO); - this._context.setDepthTest(true, ContextGLCompareMode.LESS); - this._context.setProgram(this._objectProgram); - this._context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX, 4, this._viewportData, 1); - //this.drawRenderables(entityCollector.opaqueRenderableHead, camera); - //this.drawRenderables(entityCollector.blendedRenderableHead, camera); - //TODO: reimplement ShaderPicker inheriting from RendererBase - } - - /** - * Draw a list of renderables. - * @param renderables The renderables to draw. - * @param camera The camera for which to render. - */ - private drawRenderables(renderable:RenderableBase, camera:Camera) - { - var matrix:Matrix3D = Matrix3DUtils.CALCULATION_MATRIX; - var viewProjection:Matrix3D = camera.viewProjection; - - while (renderable) { - // it's possible that the renderable was already removed from the scene - if (!renderable.sourceEntity.scene || !renderable.sourceEntity._iIsMouseEnabled()) { - renderable = renderable.next; - continue; - } - - this._potentialFound = true; - - this._context.setCulling(( renderable.materialOwner.material).bothSides? ContextGLTriangleFace.NONE : ContextGLTriangleFace.BACK, camera.projection.coordinateSystem); - - this._interactives[this._interactiveId++] = renderable; - // color code so that reading from bitmapdata will contain the correct value - this._id[1] = (this._interactiveId >> 8)/255; // on green channel - this._id[2] = (this._interactiveId & 0xff)/255; // on blue channel - - matrix.copyFrom(renderable.sourceEntity.getRenderSceneTransform(camera)); - matrix.append(viewProjection); - this._context.setProgramConstantsFromMatrix(ContextGLProgramType.VERTEX, 0, matrix, true); - this._context.setProgramConstantsFromArray(ContextGLProgramType.FRAGMENT, 0, this._id, 1); - this._context.activateBuffer(0, renderable.getVertexData(TriangleSubGeometry.POSITION_DATA), renderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA), TriangleSubGeometry.POSITION_FORMAT); - this._context.drawTriangles(this._context.getIndexBuffer(renderable.getIndexData()), 0, renderable.numTriangles); - - renderable = renderable.next; - } - - } - - private updateRay(camera:Camera) - { - this._rayPos = camera.scenePosition; - - this._rayDir = camera.getRay(this._projX, this._projY, 1); - this._rayDir.normalize(); - } - - /** - * Creates the Program that color-codes objects. - */ - private initObjectProgram() - { - var vertexCode:string; - var fragmentCode:string; - - this._objectProgram = this._context.createProgram(); - - vertexCode = "m44 vt0, va0, vc0 \n" + "mul vt1.xy, vt0.w, vc4.zw \n" + "add vt0.xy, vt0.xy, vt1.xy \n" + "mul vt0.xy, vt0.xy, vc4.xy \n" + "mov op, vt0 \n"; - fragmentCode = "mov oc, fc0"; // write identifier - - away.Debug.throwPIR('ShaderPicker', 'initTriangleProgram', 'Dependency: initObjectProgram') - //_objectProgram.upload(new AGALMiniAssembler().assemble(ContextGLProgramType.VERTEX, vertexCode),new AGALMiniAssembler().assemble(ContextGLProgramType.FRAGMENT, fragmentCode)); - } - - /** - * Creates the Program that renders positions. - */ - - private initTriangleProgram() - { - var vertexCode:string; - var fragmentCode:string; - - this._triangleProgram = this._context.createProgram(); - - // todo: add animation code - vertexCode = "add vt0, va0, vc5 \n" + "mul vt0, vt0, vc6 \n" + "mov v0, vt0 \n" + "m44 vt0, va0, vc0 \n" + "mul vt1.xy, vt0.w, vc4.zw \n" + "add vt0.xy, vt0.xy, vt1.xy \n" + "mul vt0.xy, vt0.xy, vc4.xy \n" + "mov op, vt0 \n"; - fragmentCode = "mov oc, v0"; // write identifier - - var vertexByteCode:ByteArray = (new aglsl.assembler.AGALMiniAssembler().assemble("part vertex 1\n" + vertexCode + "endpart"))['vertex'].data; - var fragmentByteCode:ByteArray = (new aglsl.assembler.AGALMiniAssembler().assemble("part fragment 1\n" + fragmentCode + "endpart"))['fragment'].data; - this._triangleProgram.upload(vertexByteCode, fragmentByteCode); - } - - /** - * Gets more detailed information about the hir position, if required. - * @param camera The camera used to view the hit object. - */ - private getHitDetails(camera:Camera) - { - this.getApproximatePosition(camera); - this.getPreciseDetails(camera); - } - - /** - * Finds a first-guess approximate position about the hit position. - * - * @param camera The camera used to view the hit object. - */ - private getApproximatePosition(camera:Camera) - { - var bounds:Box = this._hitRenderable.sourceEntity.bounds.aabb; - var col:number; - var scX:number, scY:number, scZ:number; - var offsX:number, offsY:number, offsZ:number; - var localViewProjection:Matrix3D = Matrix3DUtils.CALCULATION_MATRIX; - - localViewProjection.copyFrom(this._hitRenderable.sourceEntity.getRenderSceneTransform(camera)); - localViewProjection.append(camera.viewProjection); - if (!this._triangleProgram) { - this.initTriangleProgram(); - } - - this._boundOffsetScale[4] = 1/(scX = bounds.width); - this._boundOffsetScale[5] = 1/(scY = bounds.height); - this._boundOffsetScale[6] = 1/(scZ = bounds.depth); - this._boundOffsetScale[0] = offsX = -bounds.x; - this._boundOffsetScale[1] = offsY = -bounds.y; - this._boundOffsetScale[2] = offsZ = -bounds.z; - - this._context.setProgram(this._triangleProgram); - this._context.clear(0, 0, 0, 0, 1, 0, ContextGLClearMask.DEPTH); - this._context.setScissorRectangle(ShaderPicker.MOUSE_SCISSOR_RECT); - this._context.setProgramConstantsFromMatrix(ContextGLProgramType.VERTEX, 0, localViewProjection, true); - this._context.setProgramConstantsFromArray(ContextGLProgramType.VERTEX, 5, this._boundOffsetScale, 2); - - this._context.activateBuffer(0, this._hitRenderable.getVertexData(TriangleSubGeometry.POSITION_DATA), this._hitRenderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA), TriangleSubGeometry.POSITION_FORMAT); - this._context.drawTriangles(this._context.getIndexBuffer(this._hitRenderable.getIndexData()), 0, this._hitRenderable.numTriangles); - - this._context.drawToBitmapData(this._bitmapData); - - col = this._bitmapData.getPixel(0, 0); - - this._localHitPosition.x = ((col >> 16) & 0xff)*scX/255 - offsX; - this._localHitPosition.y = ((col >> 8) & 0xff)*scY/255 - offsY; - this._localHitPosition.z = (col & 0xff)*scZ/255 - offsZ; - } - - /** - * Use the approximate position info to find the face under the mouse position from which we can derive the precise - * ray-face intersection point, then use barycentric coordinates to figure out the uv coordinates, etc. - * @param camera The camera used to view the hit object. - */ - private getPreciseDetails(camera:Camera) - { - var len:number = indices.length; - var x1:number, y1:number, z1:number; - var x2:number, y2:number, z2:number; - var x3:number, y3:number, z3:number; - var i:number = 0, j:number = 1, k:number = 2; - var t1:number, t2:number, t3:number; - var v0x:number, v0y:number, v0z:number; - var v1x:number, v1y:number, v1z:number; - var v2x:number, v2y:number, v2z:number; - var ni1:number, ni2:number, ni3:number; - var n1:number, n2:number, n3:number, nLength:number; - var dot00:number, dot01:number, dot02:number, dot11:number, dot12:number; - var s:number, t:number, invDenom:number; - var x:number = this._localHitPosition.x, y:number = this._localHitPosition.y, z:number = this._localHitPosition.z; - var u:number, v:number; - var ui1:number, ui2:number, ui3:number; - var s0x:number, s0y:number, s0z:number; - var s1x:number, s1y:number, s1z:number; - var nl:number; - var indices:Array = this._hitRenderable.getIndexData().data; - - var positions:Array = this._hitRenderable.getVertexData(TriangleSubGeometry.POSITION_DATA).data; - var positionStride:number = this._hitRenderable.getVertexData(TriangleSubGeometry.POSITION_DATA).dataPerVertex; - var positionOffset:number = this._hitRenderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA); - - var uvs:Array = this._hitRenderable.getVertexData(TriangleSubGeometry.UV_DATA).data; - var uvStride:number = this._hitRenderable.getVertexData(TriangleSubGeometry.UV_DATA).dataPerVertex; - var uvOffset:number = this._hitRenderable.getVertexOffset(TriangleSubGeometry.UV_DATA); - - var normals:Array = this._hitRenderable.getVertexData(TriangleSubGeometry.NORMAL_DATA).data; - var normalStride:number = this._hitRenderable.getVertexData(TriangleSubGeometry.NORMAL_DATA).dataPerVertex; - var normalOffset:number = this._hitRenderable.getVertexOffset(TriangleSubGeometry.NORMAL_DATA); - - this.updateRay(camera); - - while (i < len) { - t1 = positionOffset + indices[i]*positionStride; - t2 = positionOffset + indices[j]*positionStride; - t3 = positionOffset + indices[k]*positionStride; - x1 = positions[t1]; - y1 = positions[t1 + 1]; - z1 = positions[t1 + 2]; - x2 = positions[t2]; - y2 = positions[t2 + 1]; - z2 = positions[t2 + 2]; - x3 = positions[t3]; - y3 = positions[t3 + 1]; - z3 = positions[t3 + 2]; - - // if within bounds - if (!( (x < x1 && x < x2 && x < x3) || (y < y1 && y < y2 && y < y3) || (z < z1 && z < z2 && z < z3) || (x > x1 && x > x2 && x > x3) || (y > y1 && y > y2 && y > y3) || (z > z1 && z > z2 && z > z3))) { - - // calculate barycentric coords for approximated position - v0x = x3 - x1; - v0y = y3 - y1; - v0z = z3 - z1; - v1x = x2 - x1; - v1y = y2 - y1; - v1z = z2 - z1; - v2x = x - x1; - v2y = y - y1; - v2z = z - z1; - dot00 = v0x*v0x + v0y*v0y + v0z*v0z; - dot01 = v0x*v1x + v0y*v1y + v0z*v1z; - dot02 = v0x*v2x + v0y*v2y + v0z*v2z; - dot11 = v1x*v1x + v1y*v1y + v1z*v1z; - dot12 = v1x*v2x + v1y*v2y + v1z*v2z; - invDenom = 1/(dot00*dot11 - dot01*dot01); - s = (dot11*dot02 - dot01*dot12)*invDenom; - t = (dot00*dot12 - dot01*dot02)*invDenom; - - // if inside the current triangle, fetch details hit information - if (s >= 0 && t >= 0 && (s + t) <= 1) { - - ni1 = normalOffset + indices[i]*normalStride; - ni2 = normalOffset + indices[j]*normalStride; - ni3 = normalOffset + indices[k]*normalStride; - - n1 = indices[ni1] + indices[ni2] + indices[ni3]; - n2 = indices[ni1 + 1] + indices[ni2 + 1] + indices[ni3 + 1]; - n3 = indices[ni1 + 2] + indices[ni2 + 2] + indices[ni3 + 2]; - - nLength = Math.sqrt(n1*n1 + n2*n2 + n3*n3); - - n1 /= nLength; - n2 /= nLength; - n3 /= nLength; - - // this is def the triangle, now calculate precise coords - this.getPrecisePosition(this._hitRenderable.sourceEntity.inverseSceneTransform, n1, n2, n3, x1, y1, z1); - - v2x = this._localHitPosition.x - x1; - v2y = this._localHitPosition.y - y1; - v2z = this._localHitPosition.z - z1; - - s0x = x2 - x1; // s0 = p1 - p0 - s0y = y2 - y1; - s0z = z2 - z1; - s1x = x3 - x1; // s1 = p2 - p0 - s1y = y3 - y1; - s1z = z3 - z1; - this._localHitNormal.x = s0y*s1z - s0z*s1y; // n = s0 x s1 - this._localHitNormal.y = s0z*s1x - s0x*s1z; - this._localHitNormal.z = s0x*s1y - s0y*s1x; - nl = 1/Math.sqrt(this._localHitNormal.x*this._localHitNormal.x + this._localHitNormal.y*this._localHitNormal.y + this._localHitNormal.z*this._localHitNormal.z); // normalize n - this._localHitNormal.x *= nl; - this._localHitNormal.y *= nl; - this._localHitNormal.z *= nl; - - dot02 = v0x*v2x + v0y*v2y + v0z*v2z; - dot12 = v1x*v2x + v1y*v2y + v1z*v2z; - s = (dot11*dot02 - dot01*dot12)*invDenom; - t = (dot00*dot12 - dot01*dot02)*invDenom; - - ui1 = uvOffset + indices[i]*uvStride - ui2 = uvOffset + indices[j]*uvStride - ui3 = uvOffset + indices[k]*uvStride - - u = uvs[ui1]; - v = uvs[ui1 + 1]; - this._hitUV.x = u + t*(uvs[ui2] - u) + s*(uvs[ui3] - u); - this._hitUV.y = v + t*(uvs[ui2 + 1] - v) + s*(uvs[ui3 + 1] - v); - - this._faceIndex = i; - //TODO add back subGeometryIndex value - //this._subGeometryIndex = away.utils.GeometryUtils.getMeshSubGeometryIndex(subGeom); - - return; - } - } - - i += 3; - j += 3; - k += 3; - } - } - - /** - * Finds the precise hit position by unprojecting the screen coordinate back unto the hit face's plane and - * calculating the intersection point. - * @param camera The camera used to render the object. - * @param invSceneTransform The inverse scene transformation of the hit object. - * @param nx The x-coordinate of the face's plane normal. - * @param ny The y-coordinate of the face plane normal. - * @param nz The z-coordinate of the face plane normal. - * @param px The x-coordinate of a point on the face's plane (ie a face vertex) - * @param py The y-coordinate of a point on the face's plane (ie a face vertex) - * @param pz The z-coordinate of a point on the face's plane (ie a face vertex) - */ - - private getPrecisePosition(invSceneTransform:Matrix3D, nx:number, ny:number, nz:number, px:number, py:number, pz:number) - { - // calculate screen ray and find exact intersection position with triangle - var rx:number, ry:number, rz:number; - var ox:number, oy:number, oz:number; - var t:number; - var raw:Array = Matrix3DUtils.RAW_DATA_CONTAINER; - var cx:number = this._rayPos.x, cy:number = this._rayPos.y, cz:number = this._rayPos.z; - - // unprojected projection point, gives ray dir in cam space - ox = this._rayDir.x; - oy = this._rayDir.y; - oz = this._rayDir.z; - - // transform ray dir and origin (cam pos) to object space - //invSceneTransform.copyRawDataTo( raw ); - invSceneTransform.copyRawDataTo(raw); - rx = raw[0]*ox + raw[4]*oy + raw[8]*oz; - ry = raw[1]*ox + raw[5]*oy + raw[9]*oz; - rz = raw[2]*ox + raw[6]*oy + raw[10]*oz; - - ox = raw[0]*cx + raw[4]*cy + raw[8]*cz + raw[12]; - oy = raw[1]*cx + raw[5]*cy + raw[9]*cz + raw[13]; - oz = raw[2]*cx + raw[6]*cy + raw[10]*cz + raw[14]; - - t = ((px - ox)*nx + (py - oy)*ny + (pz - oz)*nz)/(rx*nx + ry*ny + rz*nz); - - this._localHitPosition.x = ox + rx*t; - this._localHitPosition.y = oy + ry*t; - this._localHitPosition.z = oz + rz*t; - } - - public dispose() - { - this._bitmapData.dispose(); - if (this._triangleProgram) - this._triangleProgram.dispose(); - - if (this._objectProgram) - this._objectProgram.dispose(); - - this._triangleProgram = null; - this._objectProgram = null; - this._bitmapData = null; - this._hitRenderable = null; - this._hitEntity = null; - } - } -} diff --git a/src/away/debug/.gitignore b/src/away/debug/.gitignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/away/events/AnimationStateEvent.ts b/src/away/events/AnimationStateEvent.ts deleted file mode 100644 index 8300fc6e4..000000000 --- a/src/away/events/AnimationStateEvent.ts +++ /dev/null @@ -1,71 +0,0 @@ -/// - -module away.events -{ - /** - * Dispatched to notify changes in an animation state's state. - */ - export class AnimationStateEvent extends Event - { - /** - * Dispatched when a non-looping clip node inside an animation state reaches the end of its timeline. - */ - public static PLAYBACK_COMPLETE:string = "playbackComplete"; - - public static TRANSITION_COMPLETE:string = "transitionComplete"; - - private _animator:away.animators.AnimatorBase; - private _animationState:away.animators.IAnimationState; - private _animationNode:away.animators.AnimationNodeBase; - - /** - * Create a new AnimatonStateEvent - * - * @param type The event type. - * @param animator The animation state object that is the subject of this event. - * @param animationNode The animation node inside the animation state from which the event originated. - */ - constructor(type:string, animator:away.animators.AnimatorBase, animationState:away.animators.IAnimationState, animationNode:away.animators.AnimationNodeBase) - { - super(type); - - this._animator = animator; - this._animationState = animationState; - this._animationNode = animationNode; - } - - /** - * The animator object that is the subject of this event. - */ - public get animator():away.animators.AnimatorBase - { - return this._animator; - } - - /** - * The animation state object that is the subject of this event. - */ - public get animationState():away.animators.IAnimationState - { - return this._animationState; - } - - /** - * The animation node inside the animation state from which the event originated. - */ - public get animationNode():away.animators.AnimationNodeBase - { - return this._animationNode; - } - - /** - * Clones the event. - * - * @return An exact duplicate of the current object. - */ - public clone():Event - { - return new AnimationStateEvent(this.type, this._animator, this._animationState, this._animationNode); - } - } -} diff --git a/src/away/materials/methods/AmbientEnvMapMethod.ts b/src/away/materials/methods/AmbientEnvMapMethod.ts deleted file mode 100644 index 444fe8652..000000000 --- a/src/away/materials/methods/AmbientEnvMapMethod.ts +++ /dev/null @@ -1,80 +0,0 @@ -/// - -module away.materials -{ - import IContextStageGL = away.stagegl.IContextStageGL; - import CubeTextureBase = away.textures.CubeTextureBase; - - /** - * AmbientEnvMapMethod provides a diffuse shading method that uses a diffuse irradiance environment map to - * approximate global lighting rather than lights. - */ - export class AmbientEnvMapMethod extends AmbientBasicMethod - { - private _cubeTexture:CubeTextureBase; - - /** - * Creates a new AmbientEnvMapMethod object. - * - * @param envMap The cube environment map to use for the ambient lighting. - */ - constructor(envMap:CubeTextureBase) - { - super(); - this._cubeTexture = envMap; - } - - /** - * @inheritDoc - */ - public iInitVO(shaderObject:ShaderObjectBase, methodVO:MethodVO) - { - super.iInitVO(shaderObject, methodVO); - - methodVO.needsNormals = true; - } - - /** - * The cube environment map to use for the diffuse lighting. - */ - public get envMap():CubeTextureBase - { - return this._cubeTexture; - } - - public set envMap(value:CubeTextureBase) - { - this._cubeTexture = value; - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:away.base.Stage) - { - super.iActivate(shaderObject, methodVO, stage); - - ( stage.context).activateCubeTexture(methodVO.texturesIndex, this._cubeTexture); - } - - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, regCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var code:string = ""; - var ambientInputRegister:ShaderRegisterElement; - var cubeMapReg:ShaderRegisterElement = regCache.getFreeTextureReg(); - methodVO.texturesIndex = cubeMapReg.index; - - code += ShaderCompilerHelper.getTexCubeSampleCode(targetReg, cubeMapReg, this._cubeTexture, shaderObject.useSmoothTextures, shaderObject.useMipmapping, sharedRegisters.normalFragment); - - ambientInputRegister = regCache.getFreeFragmentConstant(); - methodVO.fragmentConstantsIndex = ambientInputRegister.index; - - code += "add " + targetReg + ".xyz, " + targetReg + ".xyz, " + ambientInputRegister + ".xyz\n"; - - return code; - } - } -} diff --git a/src/away/materials/methods/DiffuseCelMethod.ts b/src/away/materials/methods/DiffuseCelMethod.ts deleted file mode 100644 index 22fbe708b..000000000 --- a/src/away/materials/methods/DiffuseCelMethod.ts +++ /dev/null @@ -1,133 +0,0 @@ -/// - -module away.materials -{ - import Stage = away.base.Stage; - - /** - * DiffuseCelMethod provides a shading method to add diffuse cel (cartoon) shading. - */ - export class DiffuseCelMethod extends DiffuseCompositeMethod - { - private _levels:number /*uint*/; - private _dataReg:ShaderRegisterElement; - private _smoothness:number = .1; - - /** - * Creates a new DiffuseCelMethod object. - * @param levels The amount of shadow gradations. - * @param baseMethod An optional diffuse method on which the cartoon shading is based. If omitted, DiffuseBasicMethod is used. - */ - constructor(levels:number /*uint*/ = 3, baseMethod:DiffuseBasicMethod = null) - { - super(null, baseMethod); - - this.baseMethod._iModulateMethod = (shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData) => this.clampDiffuse(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); - - this._levels = levels; - } - - /** - * @inheritDoc - */ - public iInitConstants(shaderObject:ShaderLightingObject, methodVO:MethodVO) - { - var data:Array = shaderObject.fragmentConstantData; - var index:number /*int*/ = methodVO.secondaryFragmentConstantsIndex; - super.iInitConstants(shaderObject, methodVO); - data[index + 1] = 1; - data[index + 2] = 0; - } - - /** - * The amount of shadow gradations. - */ - public get levels():number /*uint*/ - { - return this._levels; - } - - public set levels(value:number /*uint*/) - { - this._levels = value; - } - - /** - * The smoothness of the edge between 2 shading levels. - */ - public get smoothness():number - { - return this._smoothness; - } - - public set smoothness(value:number) - { - this._smoothness = value; - } - - /** - * @inheritDoc - */ - public iCleanCompilationData() - { - super.iCleanCompilationData(); - this._dataReg = null; - } - - /** - * @inheritDoc - */ - public iGetFragmentPreLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - this._dataReg = registerCache.getFreeFragmentConstant(); - methodVO.secondaryFragmentConstantsIndex = this._dataReg.index*4; - - return super.iGetFragmentPreLightingCode(shaderObject, methodVO, registerCache, sharedRegisters); - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderLightingObject, methodVO:MethodVO, stage:Stage) - { - super.iActivate(shaderObject, methodVO, stage); - var data:Array = shaderObject.fragmentConstantData; - var index:number /*int*/ = methodVO.secondaryFragmentConstantsIndex; - data[index] = this._levels; - data[index + 3] = this._smoothness; - } - - /** - * Snaps the diffuse shading of the wrapped method to one of the levels. - * @param vo The MethodVO used to compile the current shader. - * @param t The register containing the diffuse strength in the "w" component. - * @param regCache The register cache used for the shader compilation. - * @param sharedRegisters The shared register data for this shader. - * @return The AGAL fragment code for the method. - */ - private clampDiffuse(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - return "mul " + targetReg + ".w, " + targetReg + ".w, " + this._dataReg + ".x\n" + - "frc " + targetReg + ".z, " + targetReg + ".w\n" + - "sub " + targetReg + ".y, " + targetReg + ".w, " + targetReg + ".z\n" + - "mov " + targetReg + ".x, " + this._dataReg + ".x\n" + - "sub " + targetReg + ".x, " + targetReg + ".x, " + this._dataReg + ".y\n" + - "rcp " + targetReg + ".x," + targetReg + ".x\n" + - "mul " + targetReg + ".w, " + targetReg + ".y, " + targetReg + ".x\n" + - - // previous clamped strength - "sub " + targetReg + ".y, " + targetReg + ".w, " + targetReg + ".x\n" + - - // fract/epsilon (so 0 - epsilon will become 0 - 1) - "div " + targetReg + ".z, " + targetReg + ".z, " + this._dataReg + ".w\n" + - "sat " + targetReg + ".z, " + targetReg + ".z\n" + - - "mul " + targetReg + ".w, " + targetReg + ".w, " + targetReg + ".z\n" + - // 1-z - "sub " + targetReg + ".z, " + this._dataReg + ".y, " + targetReg + ".z\n" + - "mul " + targetReg + ".y, " + targetReg + ".y, " + targetReg + ".z\n" + - "add " + targetReg + ".w, " + targetReg + ".w, " + targetReg + ".y\n" + - "sat " + targetReg + ".w, " + targetReg + ".w\n"; - } - } -} diff --git a/src/away/materials/methods/DiffuseCompositeMethod.ts b/src/away/materials/methods/DiffuseCompositeMethod.ts deleted file mode 100755 index e835dbac5..000000000 --- a/src/away/materials/methods/DiffuseCompositeMethod.ts +++ /dev/null @@ -1,225 +0,0 @@ -/// -module away.materials -{ - import Stage = away.base.Stage; - import Camera = away.entities.Camera; - import RenderableBase = away.pool.RenderableBase; - import Texture2DBase = away.textures.Texture2DBase; - import Delegate = away.utils.Delegate; - - import ShadingMethodEvent = away.events.ShadingMethodEvent; - - /** - * DiffuseCompositeMethod provides a base class for diffuse methods that wrap a diffuse method to alter the - * calculated diffuse reflection strength. - */ - export class DiffuseCompositeMethod extends DiffuseBasicMethod - { - public pBaseMethod:DiffuseBasicMethod; - - private _onShaderInvalidatedDelegate:Function; - - /** - * Creates a new DiffuseCompositeMethod object. - * - * @param modulateMethod The method which will add the code to alter the base method's strength. It needs to have the signature clampDiffuse(t:ShaderRegisterElement, regCache:ShaderRegisterCache):string, in which t.w will contain the diffuse strength. - * @param baseMethod The base diffuse method on which this method's shading is based. - */ - constructor(modulateMethod:(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData) => string, baseMethod:DiffuseBasicMethod = null) - { - super(); - - this._onShaderInvalidatedDelegate = (event:ShadingMethodEvent) => this.onShaderInvalidated(event); - - this.pBaseMethod = baseMethod || new DiffuseBasicMethod(); - this.pBaseMethod._iModulateMethod = modulateMethod; - this.pBaseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - } - - /** - * The base diffuse method on which this method's shading is based. - */ - public get baseMethod():DiffuseBasicMethod - { - return this.pBaseMethod; - } - - public set baseMethod(value:DiffuseBasicMethod) - { - if (this.pBaseMethod == value) - return; - - this.pBaseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - this.pBaseMethod = value; - this.pBaseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - this.iInvalidateShaderProgram(); - } - - /** - * @inheritDoc - */ - public iInitVO(shaderObject:ShaderLightingObject, methodVO:MethodVO) - { - this.pBaseMethod.iInitVO(shaderObject, methodVO); - } - - /** - * @inheritDoc - */ - public iInitConstants(shaderObject:ShaderLightingObject, methodVO:MethodVO) - { - this.pBaseMethod.iInitConstants(shaderObject, methodVO); - } - - /** - * @inheritDoc - */ - public dispose() - { - this.pBaseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - this.pBaseMethod.dispose(); - } - - /** - * @inheritDoc - */ - public get texture():Texture2DBase - { - return this.pBaseMethod.texture; - } - - /** - * @inheritDoc - */ - public set texture(value:Texture2DBase) - { - this.pBaseMethod.texture = value; - } - - /** - * @inheritDoc - */ - public get diffuseColor():number - { - return this.pBaseMethod.diffuseColor; - } - - /** - * @inheritDoc - */ - public set diffuseColor(value:number) - { - this.pBaseMethod.diffuseColor = value; - } - - - /** - * @inheritDoc - */ - public get ambientColor():number - { - return this.pBaseMethod.ambientColor; - } - - /** - * @inheritDoc - */ - public set ambientColor(value:number) - { - this.pBaseMethod.ambientColor = value; - } - - /** - * @inheritDoc - */ - public iGetFragmentPreLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - return this.pBaseMethod.iGetFragmentPreLightingCode(shaderObject, methodVO, registerCache, sharedRegisters); - } - - /** - * @inheritDoc - */ - public iGetFragmentCodePerLight(shaderObject:ShaderLightingObject, methodVO:MethodVO, lightDirReg:ShaderRegisterElement, lightColReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var code:string = this.pBaseMethod.iGetFragmentCodePerLight(shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters); - this._pTotalLightColorReg = this.pBaseMethod._pTotalLightColorReg; - return code; - } - - /** - * @inheritDoc - */ - public iGetFragmentCodePerProbe(shaderObject:ShaderLightingObject, methodVO:MethodVO, cubeMapReg:ShaderRegisterElement, weightRegister:string, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var code:string = this.pBaseMethod.iGetFragmentCodePerProbe(shaderObject, methodVO, cubeMapReg, weightRegister, registerCache, sharedRegisters); - this._pTotalLightColorReg = this.pBaseMethod._pTotalLightColorReg; - return code; - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderLightingObject, methodVO:MethodVO, stage:Stage) - { - this.pBaseMethod.iActivate(shaderObject, methodVO, stage); - } - - /** - * @inheritDoc - */ - public iSetRenderState(shaderObject:ShaderLightingObject, methodVO:MethodVO, renderable:RenderableBase, stage:Stage, camera:Camera) - { - this.pBaseMethod.iSetRenderState(shaderObject, methodVO, renderable, stage, camera); - } - - /** - * @inheritDoc - */ - public iDeactivate(shaderObject:ShaderLightingObject, methodVO:MethodVO, stage:Stage) - { - this.pBaseMethod.iDeactivate(shaderObject, methodVO, stage); - } - - /** - * @inheritDoc - */ - public iGetVertexCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - return this.pBaseMethod.iGetVertexCode(shaderObject, methodVO, registerCache, sharedRegisters); - } - - /** - * @inheritDoc - */ - public iGetFragmentPostLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - return this.pBaseMethod.iGetFragmentPostLightingCode(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); - } - - /** - * @inheritDoc - */ - public iReset() - { - this.pBaseMethod.iReset(); - } - - /** - * @inheritDoc - */ - public iCleanCompilationData() - { - super.iCleanCompilationData(); - this.pBaseMethod.iCleanCompilationData(); - } - - /** - * Called when the base method's shader code is invalidated. - */ - private onShaderInvalidated(event:ShadingMethodEvent) - { - this.iInvalidateShaderProgram(); - } - } -} diff --git a/src/away/materials/methods/DiffuseDepthMethod.ts b/src/away/materials/methods/DiffuseDepthMethod.ts deleted file mode 100644 index 25e8a7033..000000000 --- a/src/away/materials/methods/DiffuseDepthMethod.ts +++ /dev/null @@ -1,73 +0,0 @@ -/// - -module away.materials -{ - /** - * DiffuseDepthMethod provides a debug method to visualise depth maps - */ - export class DiffuseDepthMethod extends DiffuseBasicMethod - { - /** - * Creates a new DiffuseBasicMethod object. - */ - constructor() - { - super(); - } - - /** - * @inheritDoc - */ - public iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO) - { - var data:Array = shaderObject.fragmentConstantData; - var index:number /*int*/ = methodVO.fragmentConstantsIndex; - data[index] = 1.0; - data[index + 1] = 1/255.0; - data[index + 2] = 1/65025.0; - data[index + 3] = 1/16581375.0; - } - - /** - * @inheritDoc - */ - public iGetFragmentPostLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var code:string = ""; - var temp:ShaderRegisterElement; - var decReg:ShaderRegisterElement; - - if (!this._pUseTexture) - throw new Error("DiffuseDepthMethod requires texture!"); - - // incorporate input from ambient - if (shaderObject.numLights > 0) { - if (sharedRegisters.shadowTarget) - code += "mul " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ".xyz, " + sharedRegisters.shadowTarget + ".w\n"; - code += "add " + targetReg + ".xyz, " + this._pTotalLightColorReg + ".xyz, " + targetReg + ".xyz\n" + - "sat " + targetReg + ".xyz, " + targetReg + ".xyz\n"; - registerCache.removeFragmentTempUsage(this._pTotalLightColorReg); - } - - temp = shaderObject.numLights > 0? registerCache.getFreeFragmentVectorTemp():targetReg; - - this._pDiffuseInputRegister = registerCache.getFreeTextureReg(); - methodVO.texturesIndex = this._pDiffuseInputRegister.index; - decReg = registerCache.getFreeFragmentConstant(); - methodVO.fragmentConstantsIndex = decReg.index*4; - code += ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, this._pDiffuseInputRegister, this.texture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping) + - "dp4 " + temp + ".x, " + temp + ", " + decReg + "\n" + - "mov " + temp + ".yz, " + temp + ".xx \n" + - "mov " + temp + ".w, " + decReg + ".x\n" + - "sub " + temp + ".xyz, " + decReg + ".xxx, " + temp + ".xyz\n"; - - if (shaderObject.numLights == 0) - return code; - - code += "mul " + targetReg + ".xyz, " + temp + ".xyz, " + targetReg + ".xyz\n" + - "mov " + targetReg + ".w, " + temp + ".w\n"; - - return code; - } - } -} diff --git a/src/away/materials/methods/DiffuseGradientMethod.ts b/src/away/materials/methods/DiffuseGradientMethod.ts deleted file mode 100644 index d0aaece59..000000000 --- a/src/away/materials/methods/DiffuseGradientMethod.ts +++ /dev/null @@ -1,132 +0,0 @@ -/// - -module away.materials -{ - import Stage = away.base.Stage; - import IContextStageGL = away.stagegl.IContextStageGL; - import Texture2DBase = away.textures.Texture2DBase; - - /** - * DiffuseGradientMethod is an alternative to DiffuseBasicMethod in which the shading can be modulated with a gradient - * to introduce color-tinted shading as opposed to the single-channel diffuse strength. This can be used as a crude - * approximation to subsurface scattering (for instance, the mid-range shading for skin can be tinted red to similate - * scattered light within the skin attributing to the final colour) - */ - export class DiffuseGradientMethod extends DiffuseBasicMethod - { - private _gradientTextureRegister:ShaderRegisterElement; - private _gradient:Texture2DBase; - - /** - * Creates a new DiffuseGradientMethod object. - * @param gradient A texture that contains the light colour based on the angle. This can be used to change - * the light colour due to subsurface scattering when the surface faces away from the light. - */ - constructor(gradient:Texture2DBase) - { - super(); - - this._gradient = gradient; - } - - /** - * A texture that contains the light colour based on the angle. This can be used to change the light colour - * due to subsurface scattering when the surface faces away from the light. - */ - public get gradient():Texture2DBase - { - return this._gradient; - } - - public set gradient(value:Texture2DBase) - { - if (value.hasMipmaps != this._gradient.hasMipmaps || value.format != this._gradient.format) - this.iInvalidateShaderProgram(); - this._gradient = value; - } - - /** - * @inheritDoc - */ - public iCleanCompilationData() - { - super.iCleanCompilationData(); - this._gradientTextureRegister = null; - } - - /** - * @inheritDoc - */ - public iGetFragmentPreLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var code:string = super.iGetFragmentPreLightingCode(shaderObject, methodVO, registerCache, sharedRegisters); - this._pIsFirstLight = true; - - if (shaderObject.numLights > 0) { - this._gradientTextureRegister = registerCache.getFreeTextureReg(); - methodVO.secondaryTexturesIndex = this._gradientTextureRegister.index; - } - return code; - } - - /** - * @inheritDoc - */ - public iGetFragmentCodePerLight(shaderObject:ShaderLightingObject, methodVO:MethodVO, lightDirReg:ShaderRegisterElement, lightColReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var code:string = ""; - var t:ShaderRegisterElement; - - // write in temporary if not first light, so we can add to total diffuse colour - if (this._pIsFirstLight) - t = this._pTotalLightColorReg; - else { - t = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(t, 1); - } - - code += "dp3 " + t + ".w, " + lightDirReg + ".xyz, " + sharedRegisters.normalFragment + ".xyz\n" + - "mul " + t + ".w, " + t + ".w, " + sharedRegisters.commons + ".x\n" + - "add " + t + ".w, " + t + ".w, " + sharedRegisters.commons + ".x\n" + - "mul " + t + ".xyz, " + t + ".w, " + lightDirReg + ".w\n"; - - if (this._iModulateMethod != null) - code += this._iModulateMethod(shaderObject, methodVO, t, registerCache, sharedRegisters); - - code += ShaderCompilerHelper.getTex2DSampleCode(t, sharedRegisters, this._gradientTextureRegister, this._gradient, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, t, "clamp") + - // "mul " + t + ".xyz, " + t + ".xyz, " + t + ".w\n" + - "mul " + t + ".xyz, " + t + ".xyz, " + lightColReg + ".xyz\n"; - - if (!this._pIsFirstLight) { - code += "add " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ".xyz, " + t + ".xyz\n"; - registerCache.removeFragmentTempUsage(t); - } - - this._pIsFirstLight = false; - - return code; - } - - /** - * @inheritDoc - */ - public pApplyShadow(shaderObject:ShaderLightingObject, methodVO:MethodVO, regCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var t:ShaderRegisterElement = regCache.getFreeFragmentVectorTemp(); - - return "mov " + t + ", " + sharedRegisters.shadowTarget + ".wwww\n" + - ShaderCompilerHelper.getTex2DSampleCode(t, sharedRegisters, this._gradientTextureRegister, this._gradient, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, t, "clamp") + - "mul " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ", " + t + "\n"; - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderLightingObject, methodVO:MethodVO, stage:Stage) - { - super.iActivate(shaderObject, methodVO, stage); - - ( stage.context).activateTexture(methodVO.secondaryTexturesIndex, this._gradient); - } - } -} diff --git a/src/away/materials/methods/DiffuseLightMapMethod.ts b/src/away/materials/methods/DiffuseLightMapMethod.ts deleted file mode 100644 index bb66ace3e..000000000 --- a/src/away/materials/methods/DiffuseLightMapMethod.ts +++ /dev/null @@ -1,131 +0,0 @@ -/// - -module away.materials -{ - import Stage = away.base.Stage; - import IContextStageGL = away.stagegl.IContextStageGL; - import Texture2DBase = away.textures.Texture2DBase; - - /** - * DiffuseLightMapMethod provides a diffuse shading method that uses a light map to modulate the calculated diffuse - * lighting. It is different from EffectLightMapMethod in that the latter modulates the entire calculated pixel color, rather - * than only the diffuse lighting value. - */ - export class DiffuseLightMapMethod extends DiffuseCompositeMethod - { - /** - * Indicates the light map should be multiplied with the calculated shading result. - * This can be used to add pre-calculated shadows or occlusion. - */ - public static MULTIPLY:string = "multiply"; - - /** - * Indicates the light map should be added into the calculated shading result. - * This can be used to add pre-calculated lighting or global illumination. - */ - public static ADD:string = "add"; - - private _lightMapTexture:Texture2DBase; - private _blendMode:string; - private _useSecondaryUV:boolean; - - /** - * Creates a new DiffuseLightMapMethod method. - * - * @param lightMap The texture containing the light map. - * @param blendMode The blend mode with which the light map should be applied to the lighting result. - * @param useSecondaryUV Indicates whether the secondary UV set should be used to map the light map. - * @param baseMethod The diffuse method used to calculate the regular diffuse-based lighting. - */ - constructor(lightMap:Texture2DBase, blendMode:string = "multiply", useSecondaryUV:boolean = false, baseMethod:DiffuseBasicMethod = null) - { - super(null, baseMethod); - - this._useSecondaryUV = useSecondaryUV; - this._lightMapTexture = lightMap; - this.blendMode = blendMode; - } - - /** - * @inheritDoc - */ - public iInitVO(shaderObject:ShaderLightingObject, methodVO:MethodVO) - { - methodVO.needsSecondaryUV = this._useSecondaryUV; - methodVO.needsUV = !this._useSecondaryUV; - } - - /** - * The blend mode with which the light map should be applied to the lighting result. - * - * @see DiffuseLightMapMethod.ADD - * @see DiffuseLightMapMethod.MULTIPLY - */ - public get blendMode():string - { - return this._blendMode; - } - - public set blendMode(value:string) - { - if (value != DiffuseLightMapMethod.ADD && value != DiffuseLightMapMethod.MULTIPLY) - throw new Error("Unknown blendmode!"); - - if (this._blendMode == value) - return; - - this._blendMode = value; - - this.iInvalidateShaderProgram(); - } - - /** - * The texture containing the light map data. - */ - public get lightMapTexture():Texture2DBase - { - return this._lightMapTexture; - } - - public set lightMapTexture(value:Texture2DBase) - { - this._lightMapTexture = value; - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderLightingObject, methodVO:MethodVO, stage:Stage) - { - ( stage.context).activateTexture(methodVO.secondaryTexturesIndex, this._lightMapTexture); - - super.iActivate(shaderObject, methodVO, stage); - } - - /** - * @inheritDoc - */ - public iGetFragmentPostLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var code:string; - var lightMapReg:ShaderRegisterElement = registerCache.getFreeTextureReg(); - var temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp(); - methodVO.secondaryTexturesIndex = lightMapReg.index; - - code = ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, lightMapReg, this._lightMapTexture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, sharedRegisters.secondaryUVVarying); - - switch (this._blendMode) { - case DiffuseLightMapMethod.MULTIPLY: - code += "mul " + this._pTotalLightColorReg + ", " + this._pTotalLightColorReg + ", " + temp + "\n"; - break; - case DiffuseLightMapMethod.ADD: - code += "add " + this._pTotalLightColorReg + ", " + this._pTotalLightColorReg + ", " + temp + "\n"; - break; - } - - code += super.iGetFragmentPostLightingCode(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); - - return code; - } - } -} diff --git a/src/away/materials/methods/DiffuseSubSurfaceMethod.ts b/src/away/materials/methods/DiffuseSubSurfaceMethod.ts deleted file mode 100644 index 731a7784c..000000000 --- a/src/away/materials/methods/DiffuseSubSurfaceMethod.ts +++ /dev/null @@ -1,278 +0,0 @@ -/// - -module away.materials -{ - import Stage = away.base.Stage; - import Matrix3D = away.geom.Matrix3D; - import RenderableBase = away.pool.RenderableBase; - import IContextStageGL = away.stagegl.IContextStageGL; - import RenderTexture = away.textures.RenderTexture; - - /** - * DiffuseSubSurfaceMethod provides a depth map-based diffuse shading method that mimics the scattering of - * light inside translucent surfaces. It allows light to shine through an object and to soften the diffuse shading. - * It can be used for candle wax, ice, skin, ... - */ - export class DiffuseSubSurfaceMethod extends DiffuseCompositeMethod - { - private _depthPass:SingleObjectDepthPass; - private _lightProjVarying:ShaderRegisterElement; - private _propReg:ShaderRegisterElement; - private _scattering:number; - private _translucency:number = 1; - private _lightColorReg:ShaderRegisterElement; - private _scatterColor:number /*uint*/ = 0xffffff; - private _colorReg:ShaderRegisterElement; - private _decReg:ShaderRegisterElement; - private _scatterR:number = 1.0; - private _scatterG:number = 1.0; - private _scatterB:number = 1.0; - private _targetReg:ShaderRegisterElement; - - /** - * Creates a new DiffuseSubSurfaceMethod object. - * - * @param depthMapSize The size of the depth map used. - * @param depthMapOffset The amount by which the rendered object will be inflated, to prevent depth map rounding errors. - * @param baseMethod The diffuse method used to calculate the regular diffuse-based lighting. - */ - constructor(depthMapSize:number /*int*/ = 512, depthMapOffset:number = 15, baseMethod:DiffuseBasicMethod = null) - { - super(null, baseMethod); - - this.pBaseMethod._iModulateMethod = (shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData) => this.scatterLight(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); - - this._passes = new Array(); - this._depthPass = new SingleObjectDepthPass(); - this._depthPass.textureSize = depthMapSize; - this._depthPass.polyOffset = depthMapOffset; - this._passes.push(this._depthPass); - this._scattering = 0.2; - this._translucency = 1; - } - - /** - * @inheritDoc - */ - public iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO) - { - super.iInitConstants(shaderObject, methodVO); - - var data:Array = shaderObject.vertexConstantData; - var index:number /*int*/ = methodVO.secondaryVertexConstantsIndex; - data[index] = .5; - data[index + 1] = -.5; - data[index + 2] = 0; - data[index + 3] = 1; - - data = shaderObject.fragmentConstantData; - index = methodVO.secondaryFragmentConstantsIndex; - data[index + 3] = 1.0; - data[index + 4] = 1.0; - data[index + 5] = 1/255; - data[index + 6] = 1/65025; - data[index + 7] = 1/16581375; - data[index + 10] = .5; - data[index + 11] = -.1; - } - - public iCleanCompilationData() - { - super.iCleanCompilationData(); - - this._lightProjVarying = null; - this._propReg = null; - this._lightColorReg = null; - this._colorReg = null; - this._decReg = null; - this._targetReg = null; - } - - /** - * The amount by which the light scatters. It can be used to set the translucent surface's thickness. Use low - * values for skin. - */ - public get scattering():number - { - return this._scattering; - } - - public set scattering(value:number) - { - this._scattering = value; - } - - /** - * The translucency of the object. - */ - public get translucency():number - { - return this._translucency; - } - - public set translucency(value:number) - { - this._translucency = value; - } - - /** - * The colour of the "insides" of the object, ie: the colour the light becomes after leaving the object. - */ - public get scatterColor():number /*uint*/ - { - return this._scatterColor; - } - - public set scatterColor(scatterColor:number /*uint*/) - { - this._scatterColor = scatterColor; - this._scatterR = ((scatterColor >> 16) & 0xff)/0xff; - this._scatterG = ((scatterColor >> 8) & 0xff)/0xff; - this._scatterB = (scatterColor & 0xff)/0xff; - } - - /** - * @inheritDoc - */ - public iGetVertexCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var code:string = super.iGetVertexCode(shaderObject, methodVO, registerCache, sharedRegisters); - var lightProjection:ShaderRegisterElement; - var toTexRegister:ShaderRegisterElement; - var temp:ShaderRegisterElement = registerCache.getFreeVertexVectorTemp(); - - toTexRegister = registerCache.getFreeVertexConstant(); - vo.secondaryVertexConstantsIndex = toTexRegister.index*4; - - this._lightProjVarying = registerCache.getFreeVarying(); - lightProjection = registerCache.getFreeVertexConstant(); - registerCache.getFreeVertexConstant(); - registerCache.getFreeVertexConstant(); - registerCache.getFreeVertexConstant(); - - code += "m44 " + temp + ", vt0, " + lightProjection + "\n" + - "div " + temp + ".xyz, " + temp + ".xyz, " + temp + ".w\n" + - "mul " + temp + ".xy, " + temp + ".xy, " + toTexRegister + ".xy\n" + - "add " + temp + ".xy, " + temp + ".xy, " + toTexRegister + ".xx\n" + - "mov " + this._lightProjVarying + ".xyz, " + temp + ".xyz\n" + - "mov " + this._lightProjVarying + ".w, va0.w\n"; - - return code; - } - - /** - * @inheritDoc - */ - public iGetFragmentPreLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - this._colorReg = registerCache.getFreeFragmentConstant(); - this._decReg = registerCache.getFreeFragmentConstant(); - this._propReg = registerCache.getFreeFragmentConstant(); - methodVO.secondaryFragmentConstantsIndex = this._colorReg.index*4; - - return super.iGetFragmentPreLightingCode(shaderObject, methodVO, registerCache, sharedRegisters); - } - - /** - * @inheritDoc - */ - public iGetFragmentCodePerLight(shaderObject:ShaderLightingObject, methodVO:MethodVO, lightDirReg:ShaderRegisterElement, lightColReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - this._pIsFirstLight = true; - this._lightColorReg = lightColReg; - return super.iGetFragmentCodePerLight(shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters); - } - - /** - * @inheritDoc - */ - public iGetFragmentPostLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var code:string = super.iGetFragmentPostLightingCode(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); - var temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp(); - - code += "mul " + temp + ".xyz, " + this._lightColorReg + ".xyz, " + this._targetReg + ".w\n" + - "mul " + temp + ".xyz, " + temp + ".xyz, " + this._colorReg + ".xyz\n" + - "add " + targetReg + ".xyz, " + targetReg + ".xyz, " + temp + ".xyz\n"; - - if (this._targetReg != sharedRegisters.viewDirFragment) - registerCache.removeFragmentTempUsage(targetReg); - - return code; - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderLightingObject, methodVO:MethodVO, stage:Stage) - { - super.iActivate(shaderObject, methodVO, stage); - - var index:number /*int*/ = methodVO.secondaryFragmentConstantsIndex; - var data:Array = shaderObject.fragmentConstantData; - data[index] = this._scatterR; - data[index + 1] = this._scatterG; - data[index + 2] = this._scatterB; - data[index + 8] = this._scattering; - data[index + 9] = this._translucency; - } - - /** - * @inheritDoc - */ - public iSetRenderState(shaderObject:ShaderObjectBase, methodVO:MethodVO, renderable:away.pool.RenderableBase, stage:away.base.Stage, camera:away.entities.Camera) - { - ( stage.context).activateTexture(methodVO.secondaryTexturesIndex, this._depthPass._iGetDepthMap(renderable)); - - this._depthPass._iGetProjection(renderable).copyRawDataTo(methodVO.vertexData, methodVO.secondaryVertexConstantsIndex + 4, true); - } - - /** - * Generates the code for this method - */ - private scatterLight(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - // only scatter first light - if (!this._pIsFirstLight) - return ""; - - this._pIsFirstLight = false; - - var code:string = ""; - var depthReg:ShaderRegisterElement = registerCache.getFreeTextureReg(); - - if (sharedRegisters.viewDirFragment) { - this._targetReg = sharedRegisters.viewDirFragment; - } else { - this._targetReg = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(this._targetReg, 1); - } - - methodVO.secondaryTexturesIndex = depthReg.index; - - var temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp(); - code += "tex " + temp + ", " + this._lightProjVarying + ", " + depthReg + " <2d,nearest,clamp>\n" + - // reencode RGBA - "dp4 " + targetReg + ".z, " + temp + ", " + this._decReg + "\n"; - // currentDistanceToLight - closestDistanceToLight - code += "sub " + targetReg + ".z, " + this._lightProjVarying + ".z, " + targetReg + ".z\n" + - - "sub " + targetReg + ".z, " + this._propReg + ".x, " + targetReg + ".z\n" + - "mul " + targetReg + ".z, " + this._propReg + ".y, " + targetReg + ".z\n" + - "sat " + targetReg + ".z, " + targetReg + ".z\n" + - - // targetReg.x contains dot(lightDir, normal) - // modulate according to incident light angle (scatter = scatter*(-.5*dot(light, normal) + .5) - "neg " + targetReg + ".y, " + targetReg + ".x\n" + - "mul " + targetReg + ".y, " + targetReg + ".y, " + this._propReg + ".z\n" + - "add " + targetReg + ".y, " + targetReg + ".y, " + this._propReg + ".z\n" + - "mul " + this._targetReg + ".w, " + targetReg + ".z, " + targetReg + ".y\n" + - - // blend diffuse: d' = (1-s)*d + s*1 - "sub " + targetReg + ".y, " + this._colorReg + ".w, " + this._targetReg + ".w\n" + - "mul " + targetReg + ".w, " + targetReg + ".w, " + targetReg + ".y\n"; - - return code; - } - } -} diff --git a/src/away/materials/methods/DiffuseWrapMethod.ts b/src/away/materials/methods/DiffuseWrapMethod.ts deleted file mode 100644 index 4c9f742b1..000000000 --- a/src/away/materials/methods/DiffuseWrapMethod.ts +++ /dev/null @@ -1,114 +0,0 @@ -/// - -module away.materials -{ - import Stage = away.base.Stage; - - /** - * DiffuseWrapMethod is an alternative to DiffuseBasicMethod in which the light is allowed to be "wrapped around" the normally dark area, to some extent. - * It can be used as a crude approximation to Oren-Nayar or simple subsurface scattering. - */ - export class DiffuseWrapMethod extends DiffuseBasicMethod - { - private _wrapDataRegister:ShaderRegisterElement; - private _wrapFactor:number; - - /** - * Creates a new DiffuseWrapMethod object. - * @param wrapFactor A factor to indicate the amount by which the light is allowed to wrap - */ - constructor(wrapFactor:number = .5) - { - super(); - - this.wrapFactor = wrapFactor; - } - - /** - * @inheritDoc - */ - public iCleanCompilationData() - { - super.iCleanCompilationData(); - - this._wrapDataRegister = null; - } - - /** - * A factor to indicate the amount by which the light is allowed to wrap. - */ - public get wrapFactor():number - { - return this._wrapFactor; - } - - public set wrapFactor(value:number) - { - this._wrapFactor = value; - this._wrapFactor = 1/(value + 1); - } - - /** - * @inheritDoc - */ - public iGetFragmentPreLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var code:string = super.iGetFragmentPreLightingCode(shaderObject, methodVO, registerCache, sharedRegisters); - this._pIsFirstLight = true; - this._wrapDataRegister = registerCache.getFreeFragmentConstant(); - methodVO.secondaryFragmentConstantsIndex = this._wrapDataRegister.index*4; - - return code; - } - - /** - * @inheritDoc - */ - public iGetFragmentCodePerLight(shaderObject:ShaderLightingObject, methodVO:MethodVO, lightDirReg:ShaderRegisterElement, lightColReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var code:string = ""; - var t:ShaderRegisterElement; - - // write in temporary if not first light, so we can add to total diffuse colour - if (this._pIsFirstLight) { - t = this._pTotalLightColorReg; - } else { - t = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(t, 1); - } - - code += "dp3 " + t + ".x, " + lightDirReg + ".xyz, " + sharedRegisters.normalFragment + ".xyz\n" + - "add " + t + ".y, " + t + ".x, " + this._wrapDataRegister + ".x\n" + - "mul " + t + ".y, " + t + ".y, " + this._wrapDataRegister + ".y\n" + - "sat " + t + ".w, " + t + ".y\n" + - "mul " + t + ".xz, " + t + ".w, " + lightDirReg + ".wz\n"; - - if (this._iModulateMethod != null) - code += this._iModulateMethod(shaderObject, methodVO, lightDirReg, registerCache, sharedRegisters); - - code += "mul " + t + ", " + t + ".x, " + lightColReg + "\n"; - - if (!this._pIsFirstLight) { - code += "add " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ".xyz, " + t + ".xyz\n"; - registerCache.removeFragmentTempUsage(t); - } - - this._pIsFirstLight = false; - - return code; - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderLightingObject, methodVO:MethodVO, stage:Stage) - { - super.iActivate(shaderObject, methodVO, stage); - - var index:number /*int*/ = methodVO.secondaryFragmentConstantsIndex; - var data:Array = shaderObject.fragmentConstantData; - data[index] = this._wrapFactor; - data[index + 1] = 1/(this._wrapFactor + 1); - } - } -} diff --git a/src/away/materials/methods/EffectAlphaMaskMethod.ts b/src/away/materials/methods/EffectAlphaMaskMethod.ts deleted file mode 100644 index 5c1fee7ce..000000000 --- a/src/away/materials/methods/EffectAlphaMaskMethod.ts +++ /dev/null @@ -1,95 +0,0 @@ -/// - -module away.materials -{ - import Stage = away.base.Stage; - import IContextStageGL = away.stagegl.IContextStageGL; - import Texture2DBase = away.textures.Texture2DBase; - - /** - * EffectAlphaMaskMethod allows the use of an additional texture to specify the alpha value of the material. When used - * with the secondary uv set, it allows for a tiled main texture with independently varying alpha (useful for water - * etc). - */ - export class EffectAlphaMaskMethod extends EffectMethodBase - { - private _texture:Texture2DBase; - private _useSecondaryUV:boolean; - - /** - * Creates a new EffectAlphaMaskMethod object. - * - * @param texture The texture to use as the alpha mask. - * @param useSecondaryUV Indicated whether or not the secondary uv set for the mask. This allows mapping alpha independently. - */ - constructor(texture:Texture2DBase, useSecondaryUV:boolean = false) - { - super(); - - this._texture = texture; - this._useSecondaryUV = useSecondaryUV; - } - - /** - * @inheritDoc - */ - public iInitVO(shaderObject:ShaderObjectBase, methodVO:MethodVO) - { - methodVO.needsSecondaryUV = this._useSecondaryUV; - methodVO.needsUV = !this._useSecondaryUV; - } - - /** - * Indicated whether or not the secondary uv set for the mask. This allows mapping alpha independently, for - * instance to tile the main texture and normal map while providing untiled alpha, for example to define the - * transparency over a tiled water surface. - */ - public get useSecondaryUV():boolean - { - return this._useSecondaryUV; - } - - public set useSecondaryUV(value:boolean) - { - if (this._useSecondaryUV == value) - return; - this._useSecondaryUV = value; - this.iInvalidateShaderProgram(); - } - - /** - * The texture to use as the alpha mask. - */ - public get texture():Texture2DBase - { - return this._texture; - } - - public set texture(value:Texture2DBase) - { - this._texture = value; - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderLightingObject, methodVO:MethodVO, stage:Stage) - { - ( stage.context).activateTexture(methodVO.texturesIndex, this._texture); - } - - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var textureReg:ShaderRegisterElement = registerCache.getFreeTextureReg(); - var temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp(); - var uvReg:ShaderRegisterElement = this._useSecondaryUV? sharedRegisters.secondaryUVVarying : sharedRegisters.uvVarying; - methodVO.texturesIndex = textureReg.index; - - return ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, textureReg, this._texture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, uvReg) + - "mul " + targetReg + ", " + targetReg + ", " + temp + ".x\n"; - } - } -} diff --git a/src/away/materials/methods/EffectColorMatrixMethod.ts b/src/away/materials/methods/EffectColorMatrixMethod.ts deleted file mode 100644 index dcf207a32..000000000 --- a/src/away/materials/methods/EffectColorMatrixMethod.ts +++ /dev/null @@ -1,105 +0,0 @@ -/// - -module away.materials -{ - import Stage = away.base.Stage; - - /** - * EffectColorMatrixMethod provides a shading method that changes the colour of a material analogous to a ColorMatrixFilter. - */ - export class EffectColorMatrixMethod extends EffectMethodBase - { - private _matrix:Array; - - /** - * Creates a new EffectColorTransformMethod. - * - * @param matrix An array of 20 items for 4 x 5 color transform. - */ - constructor(matrix:Array) - { - super(); - - if (matrix.length != 20) - throw new Error("Matrix length must be 20!"); - - this._matrix = matrix; - } - - /** - * The 4 x 5 matrix to transform the color of the material. - */ - public get colorMatrix():Array - { - return this._matrix; - } - - public set colorMatrix(value:Array) - { - this._matrix = value; - } - - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var code:string = ""; - var colorMultReg:ShaderRegisterElement = registerCache.getFreeFragmentConstant(); - registerCache.getFreeFragmentConstant(); - registerCache.getFreeFragmentConstant(); - registerCache.getFreeFragmentConstant(); - - var colorOffsetReg:ShaderRegisterElement = registerCache.getFreeFragmentConstant(); - - methodVO.fragmentConstantsIndex = colorMultReg.index*4; - - var temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp(); - - code += "m44 " + temp + ", " + targetReg + ", " + colorMultReg + "\n" + - "add " + targetReg + ", " + temp + ", " + colorOffsetReg + "\n"; - - return code; - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage) - { - var matrix:Array = this._matrix; - var index:number /*int*/ = methodVO.fragmentConstantsIndex; - var data:Array = shaderObject.fragmentConstantData; - - // r - data[index] = matrix[0]; - data[index + 1] = matrix[1]; - data[index + 2] = matrix[2]; - data[index + 3] = matrix[3]; - - // g - data[index + 4] = matrix[5]; - data[index + 5] = matrix[6]; - data[index + 6] = matrix[7]; - data[index + 7] = matrix[8]; - - // b - data[index + 8] = matrix[10]; - data[index + 9] = matrix[11]; - data[index + 10] = matrix[12]; - data[index + 11] = matrix[13]; - - // a - data[index + 12] = matrix[15]; - data[index + 13] = matrix[16]; - data[index + 14] = matrix[17]; - data[index + 15] = matrix[18]; - - // rgba offset - data[index + 16] = matrix[4]; - data[index + 17] = matrix[9]; - data[index + 18] = matrix[14]; - data[index + 19] = matrix[19]; - } - } -} diff --git a/src/away/materials/methods/EffectEnvMapMethod.ts b/src/away/materials/methods/EffectEnvMapMethod.ts deleted file mode 100755 index 46712cbfa..000000000 --- a/src/away/materials/methods/EffectEnvMapMethod.ts +++ /dev/null @@ -1,141 +0,0 @@ -/// - -module away.materials -{ - import Stage = away.base.Stage; - import IContextStageGL = away.stagegl.IContextStageGL; - import CubeTextureBase = away.textures.CubeTextureBase; - import Texture2DBase = away.textures.Texture2DBase; - - /** - * EffectEnvMapMethod provides a material method to perform reflection mapping using cube maps. - */ - export class EffectEnvMapMethod extends EffectMethodBase - { - private _cubeTexture:CubeTextureBase; - private _alpha:number; - private _mask:Texture2DBase; - - /** - * Creates an EffectEnvMapMethod object. - * @param envMap The environment map containing the reflected scene. - * @param alpha The reflectivity of the surface. - */ - constructor(envMap:CubeTextureBase, alpha:number = 1) - { - super(); - this._cubeTexture = envMap; - this._alpha = alpha; - - } - - /** - * An optional texture to modulate the reflectivity of the surface. - */ - public get mask():Texture2DBase - { - return this._mask; - } - - public set mask(value:Texture2DBase) - { - if (value != this._mask || (value && this._mask && (value.hasMipmaps != this._mask.hasMipmaps || value.format != this._mask.format))) - this.iInvalidateShaderProgram(); - - this._mask = value; - } - - /** - * @inheritDoc - */ - public iInitVO(shaderObject:ShaderObjectBase, methodVO:MethodVO) - { - methodVO.needsNormals = true; - methodVO.needsView = true; - methodVO.needsUV = this._mask != null; - } - - /** - * The cubic environment map containing the reflected scene. - */ - public get envMap():CubeTextureBase - { - return this._cubeTexture; - } - - public set envMap(value:CubeTextureBase) - { - this._cubeTexture = value; - } - - /** - * @inheritDoc - */ - public dispose() - { - } - - /** - * The reflectivity of the surface. - */ - public get alpha():number - { - return this._alpha; - } - - public set alpha(value:number) - { - this._alpha = value; - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage) - { - shaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex] = this._alpha; - - ( stage.context).activateCubeTexture(methodVO.texturesIndex, this._cubeTexture); - if (this._mask) - ( stage.context).activateTexture(methodVO.texturesIndex + 1, this._mask); - } - - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var dataRegister:ShaderRegisterElement = registerCache.getFreeFragmentConstant(); - var temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp(); - var code:string = ""; - var cubeMapReg:ShaderRegisterElement = registerCache.getFreeTextureReg(); - - methodVO.texturesIndex = cubeMapReg.index; - methodVO.fragmentConstantsIndex = dataRegister.index*4; - - registerCache.addFragmentTempUsages(temp, 1); - var temp2:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp(); - - // r = I - 2(I.N)*N - code += "dp3 " + temp + ".w, " + sharedRegisters.viewDirFragment + ".xyz, " + sharedRegisters.normalFragment + ".xyz\n" + - "add " + temp + ".w, " + temp + ".w, " + temp + ".w\n" + - "mul " + temp + ".xyz, " + sharedRegisters.normalFragment + ".xyz, " + temp + ".w\n" + - "sub " + temp + ".xyz, " + temp + ".xyz, " + sharedRegisters.viewDirFragment + ".xyz\n" + - ShaderCompilerHelper.getTexCubeSampleCode(temp, cubeMapReg, this._cubeTexture, shaderObject.useSmoothTextures, shaderObject.useMipmapping, temp) + - "sub " + temp2 + ".w, " + temp + ".w, fc0.x\n" + // -.5 - "kil " + temp2 + ".w\n" + // used for real time reflection mapping - if alpha is not 1 (mock texture) kil output - "sub " + temp + ", " + temp + ", " + targetReg + "\n"; - - if (this._mask) - code += ShaderCompilerHelper.getTex2DSampleCode(temp2, sharedRegisters, registerCache.getFreeTextureReg(), this._mask, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping) + - "mul " + temp + ", " + temp2 + ", " + temp + "\n"; - - code += "mul " + temp + ", " + temp + ", " + dataRegister + ".x\n" + - "add " + targetReg + ", " + targetReg + ", " + temp + "\n"; - - registerCache.removeFragmentTempUsage(temp); - - return code; - } - } -} diff --git a/src/away/materials/methods/EffectFogMethod.ts b/src/away/materials/methods/EffectFogMethod.ts deleted file mode 100644 index 143048a3d..000000000 --- a/src/away/materials/methods/EffectFogMethod.ts +++ /dev/null @@ -1,133 +0,0 @@ -/// - -module away.materials -{ - import Stage = away.base.Stage; - /** - * EffectFogMethod provides a method to add distance-based fog to a material. - */ - export class EffectFogMethod extends EffectMethodBase - { - private _minDistance:number = 0; - private _maxDistance:number = 1000; - private _fogColor:number /*uint*/; - private _fogR:number; - private _fogG:number; - private _fogB:number; - - /** - * Creates a new EffectFogMethod object. - * @param minDistance The distance from which the fog starts appearing. - * @param maxDistance The distance at which the fog is densest. - * @param fogColor The colour of the fog. - */ - constructor(minDistance:number, maxDistance:number, fogColor:number /*uint*/ = 0x808080) - { - super(); - this.minDistance = minDistance; - this.maxDistance = maxDistance; - this.fogColor = fogColor; - } - - /** - * @inheritDoc - */ - public iInitVO(shaderObject:ShaderLightingObject, methodVO:MethodVO) - { - methodVO.needsProjection = true; - } - - /** - * @inheritDoc - */ - public iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO) - { - var data:Array = shaderObject.fragmentConstantData; - var index:number /*int*/ = methodVO.fragmentConstantsIndex; - data[index + 3] = 1; - data[index + 6] = 0; - data[index + 7] = 0; - } - - /** - * The distance from which the fog starts appearing. - */ - public get minDistance():number - { - return this._minDistance; - } - - public set minDistance(value:number) - { - this._minDistance = value; - } - - /** - * The distance at which the fog is densest. - */ - public get maxDistance():number - { - return this._maxDistance; - } - - public set maxDistance(value:number) - { - this._maxDistance = value; - } - - /** - * The colour of the fog. - */ - public get fogColor():number /*uint*/ - { - return this._fogColor; - } - - public set fogColor(value:number/*uint*/) - { - this._fogColor = value; - this._fogR = ((value >> 16) & 0xff)/0xff; - this._fogG = ((value >> 8) & 0xff)/0xff; - this._fogB = (value & 0xff)/0xff; - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage) - { - var data:Array = shaderObject.fragmentConstantData; - var index:number /*int*/ = methodVO.fragmentConstantsIndex; - data[index] = this._fogR; - data[index + 1] = this._fogG; - data[index + 2] = this._fogB; - data[index + 4] = this._minDistance; - data[index + 5] = 1/(this._maxDistance - this._minDistance); - } - - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var fogColor:ShaderRegisterElement = registerCache.getFreeFragmentConstant(); - var fogData:ShaderRegisterElement = registerCache.getFreeFragmentConstant(); - var temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(temp, 1); - var temp2:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp(); - var code:string = ""; - methodVO.fragmentConstantsIndex = fogColor.index*4; - - code += "sub " + temp2 + ".w, " + sharedRegisters.projectionFragment + ".z, " + fogData + ".x\n" + - "mul " + temp2 + ".w, " + temp2 + ".w, " + fogData + ".y\n" + - "sat " + temp2 + ".w, " + temp2 + ".w\n" + - "sub " + temp + ", " + fogColor + ", " + targetReg + "\n" + // (fogColor- col) - "mul " + temp + ", " + temp + ", " + temp2 + ".w\n" + // (fogColor- col)*fogRatio - "add " + targetReg + ", " + targetReg + ", " + temp + "\n"; // fogRatio*(fogColor- col) + col - - registerCache.removeFragmentTempUsage(temp); - - return code; - } - } -} diff --git a/src/away/materials/methods/EffectFresnelEnvMapMethod.ts b/src/away/materials/methods/EffectFresnelEnvMapMethod.ts deleted file mode 100644 index 8e64bd943..000000000 --- a/src/away/materials/methods/EffectFresnelEnvMapMethod.ts +++ /dev/null @@ -1,194 +0,0 @@ -/// - -module away.materials -{ - import Stage = away.base.Stage; - import IContextStageGL = away.stagegl.IContextStageGL; - import CubeTextureBase = away.textures.CubeTextureBase; - import Texture2DBase = away.textures.Texture2DBase; - - /** - * EffectFresnelEnvMapMethod provides a method to add fresnel-based reflectivity to an object using cube maps, which gets - * stronger as the viewing angle becomes more grazing. - */ - export class EffectFresnelEnvMapMethod extends EffectMethodBase - { - private _cubeTexture:CubeTextureBase; - private _fresnelPower:number = 5; - private _normalReflectance:number = 0; - private _alpha:number; - private _mask:Texture2DBase; - - /** - * Creates a new EffectFresnelEnvMapMethod object. - * - * @param envMap The environment map containing the reflected scene. - * @param alpha The reflectivity of the material. - */ - constructor(envMap:CubeTextureBase, alpha:number = 1) - { - super(); - - this._cubeTexture = envMap; - this._alpha = alpha; - } - - /** - * @inheritDoc - */ - public iInitVO(shaderObject:ShaderObjectBase, methodVO:MethodVO) - { - methodVO.needsNormals = true; - methodVO.needsView = true; - methodVO.needsUV = this._mask != null; - } - - /** - * @inheritDoc - */ - public iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO) - { - shaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex + 3] = 1; - } - - /** - * An optional texture to modulate the reflectivity of the surface. - */ - public get mask():Texture2DBase - { - return this._mask; - } - - public set mask(value:Texture2DBase) - { - if (Boolean(value) != Boolean(this._mask) || - (value && this._mask && (value.hasMipmaps != this._mask.hasMipmaps || value.format != this._mask.format))) { - this.iInvalidateShaderProgram(); - } - this._mask = value; - } - - /** - * The power used in the Fresnel equation. Higher values make the fresnel effect more pronounced. Defaults to 5. - */ - public get fresnelPower():number - { - return this._fresnelPower; - } - - public set fresnelPower(value:number) - { - this._fresnelPower = value; - } - - /** - * The cubic environment map containing the reflected scene. - */ - public get envMap():CubeTextureBase - { - return this._cubeTexture; - } - - public set envMap(value:CubeTextureBase) - { - this._cubeTexture = value; - } - - /** - * The reflectivity of the surface. - */ - public get alpha():number - { - return this._alpha; - } - - public set alpha(value:number) - { - this._alpha = value; - } - - /** - * The minimum amount of reflectance, ie the reflectance when the view direction is normal to the surface or light direction. - */ - public get normalReflectance():number - { - return this._normalReflectance; - } - - public set normalReflectance(value:number) - { - this._normalReflectance = value; - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage) - { - var data:Array = shaderObject.fragmentConstantData; - var index:number /*int*/ = methodVO.fragmentConstantsIndex; - data[index] = this._alpha; - data[index + 1] = this._normalReflectance; - data[index + 2] = this._fresnelPower; - - ( stage.context).activateCubeTexture(methodVO.texturesIndex, this._cubeTexture); - - if (this._mask) - ( stage.context).activateTexture(methodVO.texturesIndex + 1, this._mask); - } - - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var dataRegister:ShaderRegisterElement = registerCache.getFreeFragmentConstant(); - var temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp(); - var code:string = ""; - var cubeMapReg:ShaderRegisterElement = registerCache.getFreeTextureReg(); - var viewDirReg:ShaderRegisterElement = sharedRegisters.viewDirFragment; - var normalReg:ShaderRegisterElement = sharedRegisters.normalFragment; - - methodVO.texturesIndex = cubeMapReg.index; - methodVO.fragmentConstantsIndex = dataRegister.index*4; - - registerCache.addFragmentTempUsages(temp, 1); - var temp2:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp(); - - // r = V - 2(V.N)*N - code += "dp3 " + temp + ".w, " + viewDirReg + ".xyz, " + normalReg + ".xyz\n" + - "add " + temp + ".w, " + temp + ".w, " + temp + ".w\n" + - "mul " + temp + ".xyz, " + normalReg + ".xyz, " + temp + ".w\n" + - "sub " + temp + ".xyz, " + temp + ".xyz, " + viewDirReg + ".xyz\n" + - ShaderCompilerHelper.getTexCubeSampleCode(temp, cubeMapReg, this._cubeTexture, shaderObject.useSmoothTextures, shaderObject.useMipmapping, temp) + - "sub " + temp2 + ".w, " + temp + ".w, fc0.x\n" + // -.5 - "kil " + temp2 + ".w\n" + // used for real time reflection mapping - if alpha is not 1 (mock texture) kil output - "sub " + temp + ", " + temp + ", " + targetReg + "\n"; - - // calculate fresnel term - code += "dp3 " + viewDirReg + ".w, " + viewDirReg + ".xyz, " + normalReg + ".xyz\n" + // dot(V, H) - "sub " + viewDirReg + ".w, " + dataRegister + ".w, " + viewDirReg + ".w\n" + // base = 1-dot(V, H) - "pow " + viewDirReg + ".w, " + viewDirReg + ".w, " + dataRegister + ".z\n" + // exp = pow(base, 5) - "sub " + normalReg + ".w, " + dataRegister + ".w, " + viewDirReg + ".w\n" + // 1 - exp - "mul " + normalReg + ".w, " + dataRegister + ".y, " + normalReg + ".w\n" + // f0*(1 - exp) - "add " + viewDirReg + ".w, " + viewDirReg + ".w, " + normalReg + ".w\n" + // exp + f0*(1 - exp) - - // total alpha - "mul " + viewDirReg + ".w, " + dataRegister + ".x, " + viewDirReg + ".w\n"; - - if (this._mask) { - var maskReg:ShaderRegisterElement = registerCache.getFreeTextureReg(); - code += ShaderCompilerHelper.getTex2DSampleCode(temp2, sharedRegisters, maskReg, this._mask, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping) + - "mul " + viewDirReg + ".w, " + temp2 + ".x, " + viewDirReg + ".w\n"; - } - - // blend - code += "mul " + temp + ", " + temp + ", " + viewDirReg + ".w\n" + - "add " + targetReg + ", " + targetReg + ", " + temp + "\n"; - - registerCache.removeFragmentTempUsage(temp); - - return code; - } - } -} \ No newline at end of file diff --git a/src/away/materials/methods/EffectLightMapMethod.ts b/src/away/materials/methods/EffectLightMapMethod.ts deleted file mode 100644 index fd5374275..000000000 --- a/src/away/materials/methods/EffectLightMapMethod.ts +++ /dev/null @@ -1,125 +0,0 @@ -/// - -module away.materials -{ - import Stage = away.base.Stage; - import IContextStageGL = away.stagegl.IContextStageGL; - import Texture2DBase = away.textures.Texture2DBase; - - /** - * EffectLightMapMethod provides a method that allows applying a light map texture to the calculated pixel colour. - * It is different from DiffuseLightMapMethod in that the latter only modulates the diffuse shading value rather - * than the whole pixel colour. - */ - export class EffectLightMapMethod extends EffectMethodBase - { - /** - * Indicates the light map should be multiplied with the calculated shading result. - */ - public static MULTIPLY:string = "multiply"; - - /** - * Indicates the light map should be added into the calculated shading result. - */ - public static ADD:string = "add"; - - private _texture:Texture2DBase; - - private _blendMode:string; - private _useSecondaryUV:boolean; - - /** - * Creates a new EffectLightMapMethod object. - * - * @param texture The texture containing the light map. - * @param blendMode The blend mode with which the light map should be applied to the lighting result. - * @param useSecondaryUV Indicates whether the secondary UV set should be used to map the light map. - */ - constructor(texture:Texture2DBase, blendMode:string = "multiply", useSecondaryUV:boolean = false) - { - super(); - this._useSecondaryUV = useSecondaryUV; - this._texture = texture; - this.blendMode = blendMode; - } - - /** - * @inheritDoc - */ - public iInitVO(shaderObject:ShaderObjectBase, methodVO:MethodVO) - { - methodVO.needsUV = !this._useSecondaryUV; - methodVO.needsSecondaryUV = this._useSecondaryUV; - } - - /** - * The blend mode with which the light map should be applied to the lighting result. - * - * @see EffectLightMapMethod.ADD - * @see EffectLightMapMethod.MULTIPLY - */ - public get blendMode():string - { - return this._blendMode; - } - - public set blendMode(value:string) - { - if (value != EffectLightMapMethod.ADD && value != EffectLightMapMethod.MULTIPLY) - throw new Error("Unknown blendmode!"); - if (this._blendMode == value) - return; - this._blendMode = value; - this.iInvalidateShaderProgram(); - } - - /** - * The texture containing the light map. - */ - public get texture():Texture2DBase - { - return this._texture; - } - - public set texture(value:Texture2DBase) - { - if (value.hasMipmaps != this._texture.hasMipmaps || value.format != this._texture.format) - this.iInvalidateShaderProgram(); - this._texture = value; - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage) - { - ( stage.context).activateTexture(methodVO.texturesIndex, this._texture); - - super.iActivate(shaderObject, methodVO, stage); - } - - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var code:string; - var lightMapReg:ShaderRegisterElement = registerCache.getFreeTextureReg(); - var temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp(); - methodVO.texturesIndex = lightMapReg.index; - - code = ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, lightMapReg, this._texture, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, this._useSecondaryUV? sharedRegisters.secondaryUVVarying : sharedRegisters.uvVarying); - - switch (this._blendMode) { - case EffectLightMapMethod.MULTIPLY: - code += "mul " + targetReg + ", " + targetReg + ", " + temp + "\n"; - break; - case EffectLightMapMethod.ADD: - code += "add " + targetReg + ", " + targetReg + ", " + temp + "\n"; - break; - } - - return code; - } - } -} diff --git a/src/away/materials/methods/EffectRefractionEnvMapMethod.ts b/src/away/materials/methods/EffectRefractionEnvMapMethod.ts deleted file mode 100644 index 95b5bd72d..000000000 --- a/src/away/materials/methods/EffectRefractionEnvMapMethod.ts +++ /dev/null @@ -1,282 +0,0 @@ -/// - -module away.materials -{ - import Stage = away.base.Stage; - import IContextStageGL = away.stagegl.IContextStageGL; - import CubeTextureBase = away.textures.CubeTextureBase; - - /** - * EffectRefractionEnvMapMethod provides a method to add refracted transparency based on cube maps. - */ - export class EffectRefractionEnvMapMethod extends EffectMethodBase - { - private _envMap:CubeTextureBase; - - private _dispersionR:number = 0; - private _dispersionG:number = 0; - private _dispersionB:number = 0; - private _useDispersion:boolean; - private _refractionIndex:number; - private _alpha:number = 1; - - /** - * Creates a new EffectRefractionEnvMapMethod object. Example values for dispersion are: dispersionR: -0.03, dispersionG: -0.01, dispersionB: = .0015 - * - * @param envMap The environment map containing the refracted scene. - * @param refractionIndex The refractive index of the material. - * @param dispersionR The amount of chromatic dispersion of the red channel. Defaults to 0 (none). - * @param dispersionG The amount of chromatic dispersion of the green channel. Defaults to 0 (none). - * @param dispersionB The amount of chromatic dispersion of the blue channel. Defaults to 0 (none). - */ - constructor(envMap:CubeTextureBase, refractionIndex:number = .1, dispersionR:number = 0, dispersionG:number = 0, dispersionB:number = 0) - { - super(); - this._envMap = envMap; - this._dispersionR = dispersionR; - this._dispersionG = dispersionG; - this._dispersionB = dispersionB; - this._useDispersion = !(this._dispersionR == this._dispersionB && this._dispersionR == this._dispersionG); - this._refractionIndex = refractionIndex; - } - - /** - * @inheritDoc - */ - public iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO) - { - var index:number /*int*/ = methodVO.fragmentConstantsIndex; - var data:Array = shaderObject.fragmentConstantData; - data[index + 4] = 1; - data[index + 5] = 0; - data[index + 7] = 1; - } - - /** - * @inheritDoc - */ - public iInitVO(shaderObject:ShaderObjectBase, methodVO:MethodVO) - { - methodVO.needsNormals = true; - methodVO.needsView = true; - } - - /** - * The cube environment map to use for the refraction. - */ - public get envMap():CubeTextureBase - { - return this._envMap; - } - - public set envMap(value:CubeTextureBase) - { - this._envMap = value; - } - - /** - * The refractive index of the material. - */ - public get refractionIndex():number - { - return this._refractionIndex; - } - - public set refractionIndex(value:number) - { - this._refractionIndex = value; - } - - /** - * The amount of chromatic dispersion of the red channel. Defaults to 0 (none). - */ - public get dispersionR():number - { - return this._dispersionR; - } - - public set dispersionR(value:number) - { - this._dispersionR = value; - - var useDispersion:boolean = !(this._dispersionR == this._dispersionB && this._dispersionR == this._dispersionG); - if (this._useDispersion != useDispersion) { - this.iInvalidateShaderProgram(); - this._useDispersion = useDispersion; - } - } - - /** - * The amount of chromatic dispersion of the green channel. Defaults to 0 (none). - */ - public get dispersionG():number - { - return this._dispersionG; - } - - public set dispersionG(value:number) - { - this._dispersionG = value; - - var useDispersion:boolean = !(this._dispersionR == this._dispersionB && this._dispersionR == this._dispersionG); - if (this._useDispersion != useDispersion) { - this.iInvalidateShaderProgram(); - this._useDispersion = useDispersion; - } - } - - /** - * The amount of chromatic dispersion of the blue channel. Defaults to 0 (none). - */ - public get dispersionB():number - { - return this._dispersionB; - } - - public set dispersionB(value:number) - { - this._dispersionB = value; - - var useDispersion:boolean = !(this._dispersionR == this._dispersionB && this._dispersionR == this._dispersionG); - if (this._useDispersion != useDispersion) { - this.iInvalidateShaderProgram(); - this._useDispersion = useDispersion; - } - } - - /** - * The amount of transparency of the object. Warning: the alpha applies to the refracted color, not the actual - * material. A value of 1 will make it appear fully transparent. - */ - public get alpha():number - { - return this._alpha; - } - - public set alpha(value:number) - { - this._alpha = value; - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage) - { - var index:number /*int*/ = methodVO.fragmentConstantsIndex; - var data:Array = shaderObject.fragmentConstantData; - - data[index] = this._dispersionR + this._refractionIndex; - - if (this._useDispersion) { - data[index + 1] = this._dispersionG + this._refractionIndex; - data[index + 2] = this._dispersionB + this._refractionIndex; - } - data[index + 3] = this._alpha; - - ( stage.context).activateCubeTexture(methodVO.texturesIndex, this._envMap); - } - - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - // todo: data2.x could use common reg, so only 1 reg is used - var data:ShaderRegisterElement = registerCache.getFreeFragmentConstant(); - var data2:ShaderRegisterElement = registerCache.getFreeFragmentConstant(); - var code:string = ""; - var cubeMapReg:ShaderRegisterElement = registerCache.getFreeTextureReg(); - var refractionDir:ShaderRegisterElement; - var refractionColor:ShaderRegisterElement; - var temp:ShaderRegisterElement; - - methodVO.texturesIndex = cubeMapReg.index; - methodVO.fragmentConstantsIndex = data.index*4; - - refractionDir = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(refractionDir, 1); - refractionColor = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(refractionColor, 1); - - temp = registerCache.getFreeFragmentVectorTemp(); - - var viewDirReg:ShaderRegisterElement = sharedRegisters.viewDirFragment; - var normalReg:ShaderRegisterElement = sharedRegisters.normalFragment; - - code += "neg " + viewDirReg + ".xyz, " + viewDirReg + ".xyz\n"; - - code += "dp3 " + temp + ".x, " + viewDirReg + ".xyz, " + normalReg + ".xyz\n" + - "mul " + temp + ".w, " + temp + ".x, " + temp + ".x\n" + - "sub " + temp + ".w, " + data2 + ".x, " + temp + ".w\n" + - "mul " + temp + ".w, " + data + ".x, " + temp + ".w\n" + - "mul " + temp + ".w, " + data + ".x, " + temp + ".w\n" + - "sub " + temp + ".w, " + data2 + ".x, " + temp + ".w\n" + - "sqt " + temp + ".y, " + temp + ".w\n" + - - "mul " + temp + ".x, " + data + ".x, " + temp + ".x\n" + - "add " + temp + ".x, " + temp + ".x, " + temp + ".y\n" + - "mul " + temp + ".xyz, " + temp + ".x, " + normalReg + ".xyz\n" + - - "mul " + refractionDir + ", " + data + ".x, " + viewDirReg + "\n" + - "sub " + refractionDir + ".xyz, " + refractionDir + ".xyz, " + temp + ".xyz\n" + - "nrm " + refractionDir + ".xyz, " + refractionDir + ".xyz\n"; - code += ShaderCompilerHelper.getTexCubeSampleCode(refractionColor, cubeMapReg, this._envMap, shaderObject.useSmoothTextures, shaderObject.useMipmapping, refractionDir) + - "sub " + refractionColor + ".w, " + refractionColor + ".w, fc0.x \n" + - "kil " + refractionColor + ".w\n"; - - if (this._useDispersion) { - // GREEN - code += "dp3 " + temp + ".x, " + viewDirReg + ".xyz, " + normalReg + ".xyz\n" + - "mul " + temp + ".w, " + temp + ".x, " + temp + ".x\n" + - "sub " + temp + ".w, " + data2 + ".x, " + temp + ".w\n" + - "mul " + temp + ".w, " + data + ".y, " + temp + ".w\n" + - "mul " + temp + ".w, " + data + ".y, " + temp + ".w\n" + - "sub " + temp + ".w, " + data2 + ".x, " + temp + ".w\n" + - "sqt " + temp + ".y, " + temp + ".w\n" + - - "mul " + temp + ".x, " + data + ".y, " + temp + ".x\n" + - "add " + temp + ".x, " + temp + ".x, " + temp + ".y\n" + - "mul " + temp + ".xyz, " + temp + ".x, " + normalReg + ".xyz\n" + - - "mul " + refractionDir + ", " + data + ".y, " + viewDirReg + "\n" + - "sub " + refractionDir + ".xyz, " + refractionDir + ".xyz, " + temp + ".xyz\n" + - "nrm " + refractionDir + ".xyz, " + refractionDir + ".xyz\n"; - code += ShaderCompilerHelper.getTexCubeSampleCode(temp, cubeMapReg, this._envMap, shaderObject.useSmoothTextures, shaderObject.useMipmapping, refractionDir) + - "mov " + refractionColor + ".y, " + temp + ".y\n"; - - // BLUE - code += "dp3 " + temp + ".x, " + viewDirReg + ".xyz, " + normalReg + ".xyz\n" + - "mul " + temp + ".w, " + temp + ".x, " + temp + ".x\n" + - "sub " + temp + ".w, " + data2 + ".x, " + temp + ".w\n" + - "mul " + temp + ".w, " + data + ".z, " + temp + ".w\n" + - "mul " + temp + ".w, " + data + ".z, " + temp + ".w\n" + - "sub " + temp + ".w, " + data2 + ".x, " + temp + ".w\n" + - "sqt " + temp + ".y, " + temp + ".w\n" + - - "mul " + temp + ".x, " + data + ".z, " + temp + ".x\n" + - "add " + temp + ".x, " + temp + ".x, " + temp + ".y\n" + - "mul " + temp + ".xyz, " + temp + ".x, " + normalReg + ".xyz\n" + - - "mul " + refractionDir + ", " + data + ".z, " + viewDirReg + "\n" + - "sub " + refractionDir + ".xyz, " + refractionDir + ".xyz, " + temp + ".xyz\n" + - "nrm " + refractionDir + ".xyz, " + refractionDir + ".xyz\n"; - code += ShaderCompilerHelper.getTexCubeSampleCode(temp, cubeMapReg, this._envMap, shaderObject.useSmoothTextures, shaderObject.useMipmapping, refractionDir) + - "mov " + refractionColor + ".z, " + temp + ".z\n"; - } - - registerCache.removeFragmentTempUsage(refractionDir); - - code += "sub " + refractionColor + ".xyz, " + refractionColor + ".xyz, " + targetReg + ".xyz\n" + - "mul " + refractionColor + ".xyz, " + refractionColor + ".xyz, " + data + ".w\n" + - "add " + targetReg + ".xyz, " + targetReg + ".xyz, " + refractionColor + ".xyz\n"; - - registerCache.removeFragmentTempUsage(refractionColor); - - // restore - code += "neg " + viewDirReg + ".xyz, " + viewDirReg + ".xyz\n"; - - return code; - } - } -} \ No newline at end of file diff --git a/src/away/materials/methods/EffectRimLightMethod.ts b/src/away/materials/methods/EffectRimLightMethod.ts deleted file mode 100644 index 8713e91c6..000000000 --- a/src/away/materials/methods/EffectRimLightMethod.ts +++ /dev/null @@ -1,172 +0,0 @@ -/// - -module away.materials -{ - import Stage = away.base.Stage; - - /** - * EffectRimLightMethod provides a method to add rim lighting to a material. This adds a glow-like effect to edges of objects. - */ - export class EffectRimLightMethod extends EffectMethodBase - { - public static ADD:string = "add"; - public static MULTIPLY:string = "multiply"; - public static MIX:string = "mix"; - - private _color:number /*uint*/; - private _blendMode:string; - private _colorR:number; - private _colorG:number; - private _colorB:number; - private _strength:number; - private _power:number; - - /** - * Creates a new EffectRimLightMethod object. - * - * @param color The colour of the rim light. - * @param strength The strength of the rim light. - * @param power The power of the rim light. Higher values will result in a higher edge fall-off. - * @param blend The blend mode with which to add the light to the object. - */ - constructor(color:number /*uint*/ = 0xffffff, strength:number = .4, power:number = 2, blend:string = "mix") - { - super(); - - this._blendMode = blend; - this._strength = strength; - this._power = power; - - this.color = color; - } - - /** - * @inheritDoc - */ - public iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO) - { - shaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex + 3] = 1; - } - - /** - * @inheritDoc - */ - public iInitVO(shaderObject:ShaderObjectBase, methodVO:MethodVO) - { - methodVO.needsNormals = true; - methodVO.needsView = true; - } - - - /** - * The blend mode with which to add the light to the object. - * - * EffectRimLightMethod.MULTIPLY multiplies the rim light with the material's colour. - * EffectRimLightMethod.ADD adds the rim light with the material's colour. - * EffectRimLightMethod.MIX provides normal alpha blending. - */ - public get blendMode():string - { - return this._blendMode; - } - - public set blendMode(value:string) - { - if (this._blendMode == value) return; - this._blendMode = value; - this.iInvalidateShaderProgram(); - } - - /** - * The color of the rim light. - */ - public get color():number /*uint*/ - { - return this._color; - } - - public set color(value:number /*uint*/) - { - this._color = value; - this._colorR = ((value >> 16) & 0xff)/0xff; - this._colorG = ((value >> 8) & 0xff)/0xff; - this._colorB = (value & 0xff)/0xff; - } - - /** - * The strength of the rim light. - */ - public get strength():number - { - return this._strength; - } - - public set strength(value:number) - { - this._strength = value; - } - - /** - * The power of the rim light. Higher values will result in a higher edge fall-off. - */ - public get power():number - { - return this._power; - } - - public set power(value:number) - { - this._power = value; - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage) - { - var index:number /*int*/ = methodVO.fragmentConstantsIndex; - var data:Array = shaderObject.fragmentConstantData; - data[index] = this._colorR; - data[index + 1] = this._colorG; - data[index + 2] = this._colorB; - data[index + 4] = this._strength; - data[index + 5] = this._power; - } - - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var dataRegister:ShaderRegisterElement = registerCache.getFreeFragmentConstant(); - var dataRegister2:ShaderRegisterElement = registerCache.getFreeFragmentConstant(); - var temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp(); - var code:string = ""; - - methodVO.fragmentConstantsIndex = dataRegister.index*4; - - code += "dp3 " + temp + ".x, " + sharedRegisters.viewDirFragment + ".xyz, " + sharedRegisters.normalFragment + ".xyz\n" + - "sat " + temp + ".x, " + temp + ".x\n" + - "sub " + temp + ".x, " + dataRegister + ".w, " + temp + ".x\n" + - "pow " + temp + ".x, " + temp + ".x, " + dataRegister2 + ".y\n" + - "mul " + temp + ".x, " + temp + ".x, " + dataRegister2 + ".x\n" + - "sub " + temp + ".x, " + dataRegister + ".w, " + temp + ".x\n" + - "mul " + targetReg + ".xyz, " + targetReg + ".xyz, " + temp + ".x\n" + - "sub " + temp + ".w, " + dataRegister + ".w, " + temp + ".x\n"; - - if (this._blendMode == EffectRimLightMethod.ADD) { - code += "mul " + temp + ".xyz, " + temp + ".w, " + dataRegister + ".xyz\n" + - "add " + targetReg + ".xyz, " + targetReg + ".xyz, " + temp + ".xyz\n"; - } else if (this._blendMode == EffectRimLightMethod.MULTIPLY) { - code += "mul " + temp + ".xyz, " + temp + ".w, " + dataRegister + ".xyz\n" + - "mul " + targetReg + ".xyz, " + targetReg + ".xyz, " + temp + ".xyz\n"; - } else { - code += "sub " + temp + ".xyz, " + dataRegister + ".xyz, " + targetReg + ".xyz\n" + - "mul " + temp + ".xyz, " + temp + ".xyz, " + temp + ".w\n" + - "add " + targetReg + ".xyz, " + targetReg + ".xyz, " + temp + ".xyz\n"; - } - - return code; - } - } -} \ No newline at end of file diff --git a/src/away/materials/methods/NormalHeightMapMethod.ts b/src/away/materials/methods/NormalHeightMapMethod.ts deleted file mode 100644 index 682b54434..000000000 --- a/src/away/materials/methods/NormalHeightMapMethod.ts +++ /dev/null @@ -1,95 +0,0 @@ -/// - -module away.materials -{ - import Texture2DBase = away.textures.Texture2DBase; - - /** - * NormalHeightMapMethod provides a normal map method that uses a height map to calculate the normals. - */ - export class NormalHeightMapMethod extends NormalBasicMethod - { - private _worldXYRatio:number; - private _worldXZRatio:number; - - /** - * Creates a new NormalHeightMapMethod method. - * - * @param heightMap The texture containing the height data. 0 means low, 1 means high. - * @param worldWidth The width of the 'world'. This is used to map uv coordinates' u component to scene dimensions. - * @param worldHeight The height of the 'world'. This is used to map the height map values to scene dimensions. - * @param worldDepth The depth of the 'world'. This is used to map uv coordinates' v component to scene dimensions. - */ - constructor(heightMap:Texture2DBase, worldWidth:number, worldHeight:number, worldDepth:number) - { - super(); - - this.normalMap = heightMap; - this._worldXYRatio = worldWidth/worldHeight; - this._worldXZRatio = worldDepth/worldHeight; - } - - /** - * @inheritDoc - */ - public iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO) - { - var index:number /*int*/ = methodVO.fragmentConstantsIndex; - var data:Array = shaderObject.fragmentConstantData; - data[index] = 1/this.normalMap.width; - data[index + 1] = 1/this.normalMap.height; - data[index + 2] = 0; - data[index + 3] = 1; - data[index + 4] = this._worldXYRatio; - data[index + 5] = this._worldXZRatio; - } - - /** - * @inheritDoc - */ - public get tangentSpace():boolean - { - return false; - } - - /** - * @inheritDoc - */ - public copyFrom(method:ShadingMethodBase) - { - super.copyFrom(method); - - this._worldXYRatio = ( method)._worldXYRatio; - this._worldXZRatio = ( method)._worldXZRatio; - } - - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp(); - var dataReg:ShaderRegisterElement = registerCache.getFreeFragmentConstant(); - var dataReg2:ShaderRegisterElement = registerCache.getFreeFragmentConstant(); - this._pNormalTextureRegister = registerCache.getFreeTextureReg(); - methodVO.texturesIndex = this._pNormalTextureRegister.index; - methodVO.fragmentConstantsIndex = dataReg.index*4; - - return ShaderCompilerHelper.getTex2DSampleCode(targetReg, sharedRegisters, this._pNormalTextureRegister, this.normalMap, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, sharedRegisters.uvVarying, "clamp") + - - "add " + temp + ", " + sharedRegisters.uvVarying + ", " + dataReg + ".xzzz\n" + - - ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, this._pNormalTextureRegister, this.normalMap, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, temp, "clamp") + - - "sub " + targetReg + ".x, " + targetReg + ".x, " + temp + ".x\n" + - "add " + temp + ", " + sharedRegisters.uvVarying + ", " + dataReg + ".zyzz\n" + - - ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, this._pNormalTextureRegister, this.normalMap, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, temp, "clamp") + - - "sub " + targetReg + ".z, " + targetReg + ".z, " + temp + ".x\n" + - "mov " + targetReg + ".y, " + dataReg + ".w\n" + - "mul " + targetReg + ".xz, " + targetReg + ".xz, " + dataReg2 + ".xy\n" + - "nrm " + targetReg + ".xyz, " + targetReg + ".xyz\n"; - } - } -} \ No newline at end of file diff --git a/src/away/materials/methods/NormalSimpleWaterMethod.ts b/src/away/materials/methods/NormalSimpleWaterMethod.ts deleted file mode 100755 index eb2afe1bd..000000000 --- a/src/away/materials/methods/NormalSimpleWaterMethod.ts +++ /dev/null @@ -1,184 +0,0 @@ -/// - -module away.materials -{ - import Stage = away.base.Stage; - import IContextStageGL = away.stagegl.IContextStageGL; - import Texture2DBase = away.textures.Texture2DBase; - - /** - * NormalSimpleWaterMethod provides a basic normal map method to create water ripples by translating two wave normal maps. - */ - export class NormalSimpleWaterMethod extends NormalBasicMethod - { - private _texture2:Texture2DBase; - private _normalTextureRegister2:ShaderRegisterElement; - private _useSecondNormalMap:boolean = false; - private _water1OffsetX:number = 0; - private _water1OffsetY:number = 0; - private _water2OffsetX:number = 0; - private _water2OffsetY:number = 0; - - /** - * Creates a new NormalSimpleWaterMethod object. - * @param waveMap1 A normal map containing one layer of a wave structure. - * @param waveMap2 A normal map containing a second layer of a wave structure. - */ - constructor(waveMap1:Texture2DBase, waveMap2:Texture2DBase) - { - super(); - this.normalMap = waveMap1; - this.secondaryNormalMap = waveMap2; - } - - /** - * @inheritDoc - */ - public iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO) - { - var index:number = methodVO.fragmentConstantsIndex; - var data:Array = shaderObject.fragmentConstantData; - data[index] = .5; - data[index + 1] = 0; - data[index + 2] = 0; - data[index + 3] = 1; - } - - /** - * @inheritDoc - */ - public iInitVO(shaderObject:ShaderObjectBase, methodVO:MethodVO) - { - super.iInitVO(shaderObject, methodVO); - - this._useSecondNormalMap = this.normalMap != this.secondaryNormalMap; - } - - /** - * The translation of the first wave layer along the X-axis. - */ - public get water1OffsetX():number - { - return this._water1OffsetX; - } - - public set water1OffsetX(value:number) - { - this._water1OffsetX = value; - } - - /** - * The translation of the first wave layer along the Y-axis. - */ - public get water1OffsetY():number - { - return this._water1OffsetY; - } - - public set water1OffsetY(value:number) - { - this._water1OffsetY = value; - } - - /** - * The translation of the second wave layer along the X-axis. - */ - public get water2OffsetX():number - { - return this._water2OffsetX; - } - - public set water2OffsetX(value:number) - { - this._water2OffsetX = value; - } - - /** - * The translation of the second wave layer along the Y-axis. - */ - public get water2OffsetY():number - { - return this._water2OffsetY; - } - - public set water2OffsetY(value:number) - { - this._water2OffsetY = value; - } - - /** - * A second normal map that will be combined with the first to create a wave-like animation pattern. - */ - public get secondaryNormalMap():Texture2DBase - { - return this._texture2; - } - - public set secondaryNormalMap(value:Texture2DBase) - { - this._texture2 = value; - } - - /** - * @inheritDoc - */ - public iCleanCompilationData() - { - super.iCleanCompilationData(); - this._normalTextureRegister2 = null; - } - - /** - * @inheritDoc - */ - public dispose() - { - super.dispose(); - this._texture2 = null; - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage) - { - super.iActivate(shaderObject, methodVO, stage); - - var data:Array = shaderObject.fragmentConstantData; - var index:number = methodVO.fragmentConstantsIndex; - - data[index + 4] = this._water1OffsetX; - data[index + 5] = this._water1OffsetY; - data[index + 6] = this._water2OffsetX; - data[index + 7] = this._water2OffsetY; - - //if (this._useSecondNormalMap >= 0) - if (this._useSecondNormalMap) - ( stage.context).activateTexture(methodVO.texturesIndex + 1, this._texture2); - } - - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp(); - var dataReg:ShaderRegisterElement = registerCache.getFreeFragmentConstant(); - var dataReg2:ShaderRegisterElement = registerCache.getFreeFragmentConstant(); - this._pNormalTextureRegister = registerCache.getFreeTextureReg(); - this._normalTextureRegister2 = this._useSecondNormalMap? registerCache.getFreeTextureReg():this._pNormalTextureRegister; - methodVO.texturesIndex = this._pNormalTextureRegister.index; - - methodVO.fragmentConstantsIndex = dataReg.index*4; - - return "add " + temp + ", " + sharedRegisters.uvVarying + ", " + dataReg2 + ".xyxy\n" + - ShaderCompilerHelper.getTex2DSampleCode(targetReg, sharedRegisters, this._pNormalTextureRegister, this.normalMap, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, temp) + - "add " + temp + ", " + sharedRegisters.uvVarying + ", " + dataReg2 + ".zwzw\n" + - ShaderCompilerHelper.getTex2DSampleCode(temp, sharedRegisters, this._normalTextureRegister2, this._texture2, shaderObject.useSmoothTextures, shaderObject.repeatTextures, shaderObject.useMipmapping, temp) + - "add " + targetReg + ", " + targetReg + ", " + temp + " \n" + - "mul " + targetReg + ", " + targetReg + ", " + dataReg + ".x \n" + - "sub " + targetReg + ".xyz, " + targetReg + ".xyz, " + sharedRegisters.commons + ".xxx \n" + - "nrm " + targetReg + ".xyz, " + targetReg + ".xyz \n"; - } - } -} diff --git a/src/away/materials/methods/ShadowCascadeMethod.ts b/src/away/materials/methods/ShadowCascadeMethod.ts deleted file mode 100644 index 77e37cf08..000000000 --- a/src/away/materials/methods/ShadowCascadeMethod.ts +++ /dev/null @@ -1,262 +0,0 @@ -/// - -module away.materials -{ - import Stage = away.base.Stage; - import Camera = away.entities.Camera; - import DirectionalLight = away.entities.DirectionalLight; - import Event = away.events.Event; - import ShadingMethodEvent = away.events.ShadingMethodEvent; - import CascadeShadowMapper = away.materials.CascadeShadowMapper; - import RenderableBase = away.pool.RenderableBase; - import IContextStageGL = away.stagegl.IContextStageGL; - import Texture2DBase = away.textures.Texture2DBase; - - /** - * ShadowCascadeMethod is a shadow map method to apply cascade shadow mapping on materials. - * Must be used with a DirectionalLight with a CascadeShadowMapper assigned to its shadowMapper property. - * - * @see away.lights.CascadeShadowMapper - */ - export class ShadowCascadeMethod extends ShadowMapMethodBase - { - private _baseMethod:ShadowMethodBase; - private _cascadeShadowMapper:CascadeShadowMapper; - private _depthMapCoordVaryings:ShaderRegisterElement[]; - private _cascadeProjections:ShaderRegisterElement[]; - - /** - * Creates a new ShadowCascadeMethod object. - * - * @param shadowMethodBase The shadow map sampling method used to sample individual cascades (fe: ShadowHardMethod, ShadowSoftMethod) - */ - constructor(shadowMethodBase:ShadowMethodBase) - { - super(shadowMethodBase.castingLight); - - this._baseMethod = shadowMethodBase; - if (!(this._pCastingLight instanceof DirectionalLight)) - throw new Error("ShadowCascadeMethod is only compatible with DirectionalLight"); - - this._cascadeShadowMapper = this._pCastingLight.shadowMapper; - - if (!this._cascadeShadowMapper) - throw new Error("ShadowCascadeMethod requires a light that has a CascadeShadowMapper instance assigned to shadowMapper."); - - this._cascadeShadowMapper.addEventListener(Event.CHANGE, (event:Event) => this.onCascadeChange(event)); - this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, (event:ShadingMethodEvent) => this.onShaderInvalidated(event)); - } - - /** - * The shadow map sampling method used to sample individual cascades. These are typically those used in conjunction - * with a DirectionalShadowMapper. - * - * @see ShadowHardMethod - * @see ShadowSoftMethod - */ - public get baseMethod():ShadowMethodBase - { - return this._baseMethod; - } - - public set baseMethod(value:ShadowMethodBase) - { - if (this._baseMethod == value) - return; - - this._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, (event:ShadingMethodEvent) => this.onShaderInvalidated(event)); - this._baseMethod = value; - this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, (event:ShadingMethodEvent) => this.onShaderInvalidated(event)); - this.iInvalidateShaderProgram(); - } - - /** - * @inheritDoc - */ - public iInitVO(shaderObject:ShaderLightingObject, methodVO:MethodVO) - { - var tempVO:MethodVO = new MethodVO(this._baseMethod); - this._baseMethod.iInitVO(shaderObject, tempVO); - - methodVO.needsGlobalVertexPos = true; - methodVO.needsProjection = true; - } - - /** - * @inheritDoc - */ - public iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO) - { - var fragmentData:Array = shaderObject.fragmentConstantData; - var vertexData:Array = shaderObject.vertexConstantData; - var index:number = methodVO.fragmentConstantsIndex; - fragmentData[index] = 1.0; - fragmentData[index + 1] = 1/255.0; - fragmentData[index + 2] = 1/65025.0; - fragmentData[index + 3] = 1/16581375.0; - - fragmentData[index + 6] = .5; - fragmentData[index + 7] = -.5; - - index = methodVO.vertexConstantsIndex; - vertexData[index] = .5; - vertexData[index + 1] = -.5; - vertexData[index + 2] = 0; - } - - /** - * @inheritDoc - */ - public iCleanCompilationData() - { - super.iCleanCompilationData(); - this._cascadeProjections = null; - this._depthMapCoordVaryings = null; - } - - /** - * @inheritDoc - */ - public iGetVertexCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var code:string = ""; - var dataReg:ShaderRegisterElement = registerCache.getFreeVertexConstant(); - - this.initProjectionsRegs(registerCache); - methodVO.vertexConstantsIndex = dataReg.index*4; - - var temp:ShaderRegisterElement = registerCache.getFreeVertexVectorTemp(); - - for (var i:number = 0; i < this._cascadeShadowMapper.numCascades; ++i) { - code += "m44 " + temp + ", " + sharedRegisters.globalPositionVertex + ", " + this._cascadeProjections[i] + "\n" + - "add " + this._depthMapCoordVaryings[i] + ", " + temp + ", " + dataReg + ".zzwz\n"; - } - - return code; - } - - /** - * Creates the registers for the cascades' projection coordinates. - */ - private initProjectionsRegs(registerCache:ShaderRegisterCache) - { - this._cascadeProjections = new Array(this._cascadeShadowMapper.numCascades); - this._depthMapCoordVaryings = new Array(this._cascadeShadowMapper.numCascades); - - for (var i:number = 0; i < this._cascadeShadowMapper.numCascades; ++i) { - this._depthMapCoordVaryings[i] = registerCache.getFreeVarying(); - this._cascadeProjections[i] = registerCache.getFreeVertexConstant(); - registerCache.getFreeVertexConstant(); - registerCache.getFreeVertexConstant(); - registerCache.getFreeVertexConstant(); - } - } - - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var numCascades:number = this._cascadeShadowMapper.numCascades; - var depthMapRegister:ShaderRegisterElement = registerCache.getFreeTextureReg(); - var decReg:ShaderRegisterElement = registerCache.getFreeFragmentConstant(); - var dataReg:ShaderRegisterElement = registerCache.getFreeFragmentConstant(); - var planeDistanceReg:ShaderRegisterElement = registerCache.getFreeFragmentConstant(); - var planeDistances:Array = Array( planeDistanceReg + ".x", planeDistanceReg + ".y", planeDistanceReg + ".z", planeDistanceReg + ".w" ); - var code:string; - - methodVO.fragmentConstantsIndex = decReg.index*4; - methodVO.texturesIndex = depthMapRegister.index; - - var inQuad:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(inQuad, 1); - var uvCoord:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(uvCoord, 1); - - // assume lowest partition is selected, will be overwritten later otherwise - code = "mov " + uvCoord + ", " + this._depthMapCoordVaryings[numCascades - 1] + "\n"; - - for (var i:number = numCascades - 2; i >= 0; --i) { - var uvProjection:ShaderRegisterElement = this._depthMapCoordVaryings[i]; - - // calculate if in texturemap (result == 0 or 1, only 1 for a single partition) - code += "slt " + inQuad + ".z, " + sharedRegisters.projectionFragment + ".z, " + planeDistances[i] + "\n"; // z = x > minX, w = y > minY - - var temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp(); - - // linearly interpolate between old and new uv coords using predicate value == conditional toggle to new value if predicate == 1 (true) - code += "sub " + temp + ", " + uvProjection + ", " + uvCoord + "\n" + - "mul " + temp + ", " + temp + ", " + inQuad + ".z\n" + - "add " + uvCoord + ", " + uvCoord + ", " + temp + "\n"; - } - - registerCache.removeFragmentTempUsage(inQuad); - - code += "div " + uvCoord + ", " + uvCoord + ", " + uvCoord + ".w\n" + - "mul " + uvCoord + ".xy, " + uvCoord + ".xy, " + dataReg + ".zw\n" + - "add " + uvCoord + ".xy, " + uvCoord + ".xy, " + dataReg + ".zz\n"; - - code += this._baseMethod._iGetCascadeFragmentCode(shaderObject, methodVO, decReg, depthMapRegister, uvCoord, targetReg, registerCache, sharedRegisters) + - "add " + targetReg + ".w, " + targetReg + ".w, " + dataReg + ".y\n"; - - registerCache.removeFragmentTempUsage(uvCoord); - - return code; - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage) - { - ( stage.context).activateTexture(methodVO.texturesIndex, this._pCastingLight.shadowMapper.depthMap); - - var vertexData:Array = shaderObject.vertexConstantData; - var vertexIndex:number = methodVO.vertexConstantsIndex; - - shaderObject.vertexConstantData[methodVO.vertexConstantsIndex + 3] = -1/(this._cascadeShadowMapper.depth*this._pEpsilon); - - var numCascades:number = this._cascadeShadowMapper.numCascades; - vertexIndex += 4; - for (var k:number = 0; k < numCascades; ++k) { - this._cascadeShadowMapper.getDepthProjections(k).copyRawDataTo(vertexData, vertexIndex, true); - vertexIndex += 16; - } - - var fragmentData:Array = shaderObject.fragmentConstantData; - var fragmentIndex:number = methodVO.fragmentConstantsIndex; - fragmentData[fragmentIndex + 5] = 1 - this._pAlpha; - - var nearPlaneDistances:Array = this._cascadeShadowMapper._iNearPlaneDistances; - - fragmentIndex += 8; - for (var i:number = 0; i < numCascades; ++i) - fragmentData[fragmentIndex + i] = nearPlaneDistances[i]; - - this._baseMethod.iActivateForCascade(shaderObject, methodVO, stage); - } - - /** - * @inheritDoc - */ - public iSetRenderState(shaderObject:ShaderObjectBase, methodVO:MethodVO, renderable:RenderableBase, stage:Stage, camera:Camera) - { - } - - /** - * Called when the shadow mappers cascade configuration changes. - */ - private onCascadeChange(event:Event) - { - this.iInvalidateShaderProgram(); - } - - /** - * Called when the base method's shader code is invalidated. - */ - private onShaderInvalidated(event:ShadingMethodEvent) - { - this.iInvalidateShaderProgram(); - } - } -} diff --git a/src/away/materials/methods/ShadowDitheredMethod.ts b/src/away/materials/methods/ShadowDitheredMethod.ts deleted file mode 100644 index 48162f30a..000000000 --- a/src/away/materials/methods/ShadowDitheredMethod.ts +++ /dev/null @@ -1,291 +0,0 @@ -/// - -module away.materials -{ - import BitmapData = away.base.BitmapData; - import Stage = away.base.Stage; - import DirectionalLight = away.entities.DirectionalLight; - import IContextStageGL = away.stagegl.IContextStageGL; - import BitmapTexture = away.textures.BitmapTexture; - - /** - * ShadowDitheredMethod provides a soft shadowing technique by randomly distributing sample points differently for each fragment. - */ - export class ShadowDitheredMethod extends ShadowMethodBase - { - private static _grainTexture:BitmapTexture; - private static _grainUsages:number /*int*/; - private static _grainBitmapData:BitmapData; - private _depthMapSize:number /*int*/; - private _range:number; - private _numSamples:number /*int*/; - - /** - * Creates a new ShadowDitheredMethod object. - * @param castingLight The light casting the shadows - * @param numSamples The amount of samples to take for dithering. Minimum 1, maximum 24. - */ - constructor(castingLight:DirectionalLight, numSamples:number /*int*/ = 4, range:number = 1) - { - super(castingLight); - - this._depthMapSize = this._pCastingLight.shadowMapper.depthMapSize; - - this.numSamples = numSamples; - this.range = range; - - ++ShadowDitheredMethod._grainUsages; - - if (!ShadowDitheredMethod._grainTexture) - this.initGrainTexture(); - } - - /** - * The amount of samples to take for dithering. Minimum 1, maximum 24. The actual maximum may depend on the - * complexity of the shader. - */ - public get numSamples():number /*int*/ - { - return this._numSamples; - } - - public set numSamples(value:number /*int*/) - { - this._numSamples = value; - if (this._numSamples < 1) - this._numSamples = 1; else if (this._numSamples > 24) - this._numSamples = 24; - this.iInvalidateShaderProgram(); - } - - /** - * @inheritDoc - */ - public iInitVO(shaderObject:ShaderLightingObject, methodVO:MethodVO) - { - super.iInitVO(shaderObject, methodVO); - - methodVO.needsProjection = true; - } - - /** - * @inheritDoc - */ - public iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO) - { - super.iInitConstants(shaderObject, methodVO); - - var fragmentData:Array = shaderObject.fragmentConstantData; - var index:number /*int*/ = methodVO.fragmentConstantsIndex; - fragmentData[index + 8] = 1/this._numSamples; - } - - /** - * The range in the shadow map in which to distribute the samples. - */ - public get range():number - { - return this._range*2; - } - - public set range(value:number) - { - this._range = value/2; - } - - /** - * Creates a texture containing the dithering noise texture. - */ - private initGrainTexture() - { - ShadowDitheredMethod._grainBitmapData = new BitmapData(64, 64, false); - var vec:Array /*uint*/ = new Array(); - var len:number /*uint*/ = 4096; - var step:number = 1/(this._depthMapSize*this._range); - var r:number, g:number; - - for (var i:number /*uint*/ = 0; i < len; ++i) { - r = 2*(Math.random() - .5); - g = 2*(Math.random() - .5); - if (r < 0) - r -= step; else - r += step; - if (g < 0) - g -= step; else - g += step; - if (r > 1) - r = 1; else if (r < -1) - r = -1; - if (g > 1) - g = 1; else if (g < -1) - g = -1; - vec[i] = (Math.floor((r*.5 + .5)*0xff) << 16) | (Math.floor((g*.5 + .5)*0xff) << 8); - } - - ShadowDitheredMethod._grainBitmapData.setVector(ShadowDitheredMethod._grainBitmapData.rect, vec); - ShadowDitheredMethod._grainTexture = new BitmapTexture(ShadowDitheredMethod._grainBitmapData); - } - - /** - * @inheritDoc - */ - public dispose() - { - if (--ShadowDitheredMethod._grainUsages == 0) { - ShadowDitheredMethod._grainTexture.dispose(); - ShadowDitheredMethod._grainBitmapData.dispose(); - ShadowDitheredMethod._grainTexture = null; - } - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage) - { - super.iActivate(shaderObject, methodVO, stage); - - var data:Array = shaderObject.fragmentConstantData; - var index:number /*uint*/ = methodVO.fragmentConstantsIndex; - data[index + 9] = (stage.width - 1)/63; - data[index + 10] = (stage.height - 1)/63; - data[index + 11] = 2*this._range/this._depthMapSize; - ( stage.context).activateTexture(methodVO.texturesIndex + 1, ShadowDitheredMethod._grainTexture); - } - - /** - * @inheritDoc - */ - public _pGetPlanarFragmentCode(methodVO:MethodVO, targetReg:ShaderRegisterElement, regCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var depthMapRegister:ShaderRegisterElement = regCache.getFreeTextureReg(); - var decReg:ShaderRegisterElement = regCache.getFreeFragmentConstant(); - var dataReg:ShaderRegisterElement = regCache.getFreeFragmentConstant(); - var customDataReg:ShaderRegisterElement = regCache.getFreeFragmentConstant(); - - methodVO.fragmentConstantsIndex = decReg.index*4; - methodVO.texturesIndex = depthMapRegister.index; - - return this.getSampleCode(customDataReg, depthMapRegister, decReg, targetReg, regCache, sharedRegisters); - } - - /** - * Get the actual shader code for shadow mapping - * @param regCache The register cache managing the registers. - * @param depthMapRegister The texture register containing the depth map. - * @param decReg The register containing the depth map decoding data. - * @param targetReg The target register to add the shadow coverage. - */ - private getSampleCode(customDataReg:ShaderRegisterElement, depthMapRegister:ShaderRegisterElement, decReg:ShaderRegisterElement, targetReg:ShaderRegisterElement, regCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var code:string = ""; - var grainRegister:ShaderRegisterElement = regCache.getFreeTextureReg(); - var uvReg:ShaderRegisterElement = regCache.getFreeFragmentVectorTemp(); - var numSamples:number /*int*/ = this._numSamples; - regCache.addFragmentTempUsages(uvReg, 1); - - var temp:ShaderRegisterElement = regCache.getFreeFragmentVectorTemp(); - - var projectionReg:ShaderRegisterElement = sharedRegisters.projectionFragment; - - code += "div " + uvReg + ", " + projectionReg + ", " + projectionReg + ".w\n" + "mul " + uvReg + ".xy, " + uvReg + ".xy, " + customDataReg + ".yz\n"; - - while (numSamples > 0) { - if (numSamples == this._numSamples) - code += "tex " + uvReg + ", " + uvReg + ", " + grainRegister + " <2d,nearest,repeat,mipnone>\n"; - else - code += "tex " + uvReg + ", " + uvReg + ".zwxy, " + grainRegister + " <2d,nearest,repeat,mipnone>\n"; - - // keep grain in uvReg.zw - code += "sub " + uvReg + ".zw, " + uvReg + ".xy, fc0.xx\n" + // uv-.5 - "mul " + uvReg + ".zw, " + uvReg + ".zw, " + customDataReg + ".w\n"; // (tex unpack scale and tex scale in one) - - if (numSamples == this._numSamples) { - // first sample - code += "add " + uvReg + ".xy, " + uvReg + ".zw, " + this._pDepthMapCoordReg + ".xy\n" + - "tex " + temp + ", " + uvReg + ", " + depthMapRegister + " <2d,nearest,clamp,mipnone>\n" + - "dp4 " + temp + ".z, " + temp + ", " + decReg + "\n" + - "slt " + targetReg + ".w, " + this._pDepthMapCoordReg + ".z, " + temp + ".z\n"; // 0 if in shadow - } else { - code += this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); - } - - if (numSamples > 4) - code += "add " + uvReg + ".xy, " + uvReg + ".xy, " + uvReg + ".zw\n" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); - - if (numSamples > 1) - code += "sub " + uvReg + ".xy, " + this._pDepthMapCoordReg + ".xy, " + uvReg + ".zw\n" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); - - if (numSamples > 5) - code += "sub " + uvReg + ".xy, " + uvReg + ".xy, " + uvReg + ".zw\n" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); - - if (numSamples > 2) { - code += "neg " + uvReg + ".w, " + uvReg + ".w\n"; // will be rotated 90 degrees when being accessed as wz - code += "add " + uvReg + ".xy, " + uvReg + ".wz, " + this._pDepthMapCoordReg + ".xy\n" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); - } - - if (numSamples > 6) - code += "add " + uvReg + ".xy, " + uvReg + ".xy, " + uvReg + ".wz\n" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); - - if (numSamples > 3) - code += "sub " + uvReg + ".xy, " + this._pDepthMapCoordReg + ".xy, " + uvReg + ".wz\n" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); - - if (numSamples > 7) - code += "sub " + uvReg + ".xy, " + uvReg + ".xy, " + uvReg + ".wz\n" + this.addSample(uvReg, depthMapRegister, decReg, targetReg, regCache); - - numSamples -= 8; - } - - regCache.removeFragmentTempUsage(uvReg); - code += "mul " + targetReg + ".w, " + targetReg + ".w, " + customDataReg + ".x\n"; // average - return code; - } - - /** - * Adds the code for another tap to the shader code. - * @param uvReg The uv register for the tap. - * @param depthMapRegister The texture register containing the depth map. - * @param decReg The register containing the depth map decoding data. - * @param targetReg The target register to add the tap comparison result. - * @param regCache The register cache managing the registers. - * @return - */ - private addSample(uvReg:ShaderRegisterElement, depthMapRegister:ShaderRegisterElement, decReg:ShaderRegisterElement, targetReg:ShaderRegisterElement, regCache:ShaderRegisterCache):string - { - var temp:ShaderRegisterElement = regCache.getFreeFragmentVectorTemp(); - - return "tex " + temp + ", " + uvReg + ", " + depthMapRegister + " <2d,nearest,clamp,mipnone>\n" + - "dp4 " + temp + ".z, " + temp + ", " + decReg + "\n" + - "slt " + temp + ".z, " + this._pDepthMapCoordReg + ".z, " + temp + ".z\n" + // 0 if in shadow - "add " + targetReg + ".w, " + targetReg + ".w, " + temp + ".z\n"; - } - - /** - * @inheritDoc - */ - public iActivateForCascade(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage) - { - var data:Array = shaderObject.fragmentConstantData; - var index:number /*uint*/ = methodVO.secondaryFragmentConstantsIndex; - data[index] = 1/this._numSamples; - data[index + 1] = (stage.width - 1)/63; - data[index + 2] = (stage.height - 1)/63; - data[index + 3] = 2*this._range/this._depthMapSize; - - ( stage.context).activateTexture(methodVO.texturesIndex + 1, ShadowDitheredMethod._grainTexture); - } - - /** - * @inheritDoc - */ - public _iGetCascadeFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, decodeRegister:ShaderRegisterElement, depthTexture:ShaderRegisterElement, depthProjection:ShaderRegisterElement, targetRegister:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - this._pDepthMapCoordReg = depthProjection; - - var dataReg:ShaderRegisterElement = registerCache.getFreeFragmentConstant(); - methodVO.secondaryFragmentConstantsIndex = dataReg.index*4; - - return this.getSampleCode(dataReg, depthTexture, decodeRegister, targetRegister, registerCache, sharedRegisters); - } - } -} diff --git a/src/away/materials/methods/ShadowFilteredMethod.ts b/src/away/materials/methods/ShadowFilteredMethod.ts deleted file mode 100644 index f0a354e1e..000000000 --- a/src/away/materials/methods/ShadowFilteredMethod.ts +++ /dev/null @@ -1,135 +0,0 @@ -/// - -module away.materials -{ - import Stage = away.base.Stage; - import DirectionalLight = away.entities.DirectionalLight; - - /** - * ShadowFilteredMethod provides a softened shadowing technique by bilinearly interpolating shadow comparison - * results of neighbouring pixels. - */ - export class ShadowFilteredMethod extends ShadowMethodBase - { - /** - * Creates a new DiffuseBasicMethod object. - * - * @param castingLight The light casting the shadow - */ - constructor(castingLight:DirectionalLight) - { - super(castingLight); - } - - /** - * @inheritDoc - */ - public iInitConstants(shaderObject:ShaderLightingObject, methodVO:MethodVO) - { - super.iInitConstants(shaderObject, methodVO); - - var fragmentData:Array = shaderObject.fragmentConstantData; - var index:number /*int*/ = methodVO.fragmentConstantsIndex; - fragmentData[index + 8] = .5; - var size:number /*int*/ = this.castingLight.shadowMapper.depthMapSize; - fragmentData[index + 9] = size; - fragmentData[index + 10] = 1/size; - } - - /** - * @inheritDoc - */ - public _pGetPlanarFragmentCode(methodVO:MethodVO, targetReg:ShaderRegisterElement, regCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var depthMapRegister:ShaderRegisterElement = regCache.getFreeTextureReg(); - var decReg:ShaderRegisterElement = regCache.getFreeFragmentConstant(); - var dataReg:ShaderRegisterElement = regCache.getFreeFragmentConstant(); - // TODO: not used - dataReg = dataReg; - var customDataReg:ShaderRegisterElement = regCache.getFreeFragmentConstant(); - var depthCol:ShaderRegisterElement = regCache.getFreeFragmentVectorTemp(); - var uvReg:ShaderRegisterElement; - var code:string = ""; - methodVO.fragmentConstantsIndex = decReg.index*4; - - regCache.addFragmentTempUsages(depthCol, 1); - - uvReg = regCache.getFreeFragmentVectorTemp(); - regCache.addFragmentTempUsages(uvReg, 1); - - code += "mov " + uvReg + ", " + this._pDepthMapCoordReg + "\n" + - - "tex " + depthCol + ", " + this._pDepthMapCoordReg + ", " + depthMapRegister + " <2d, nearest, clamp>\n" + "dp4 " + depthCol + ".z, " + depthCol + ", " + decReg + "\n" + "slt " + uvReg + ".z, " + this._pDepthMapCoordReg + ".z, " + depthCol + ".z\n" + // 0 if in shadow - - "add " + uvReg + ".x, " + this._pDepthMapCoordReg + ".x, " + customDataReg + ".z\n" + // (1, 0) - "tex " + depthCol + ", " + uvReg + ", " + depthMapRegister + " <2d, nearest, clamp>\n" + "dp4 " + depthCol + ".z, " + depthCol + ", " + decReg + "\n" + "slt " + uvReg + ".w, " + this._pDepthMapCoordReg + ".z, " + depthCol + ".z\n" + // 0 if in shadow - - "mul " + depthCol + ".x, " + this._pDepthMapCoordReg + ".x, " + customDataReg + ".y\n" + "frc " + depthCol + ".x, " + depthCol + ".x\n" + "sub " + uvReg + ".w, " + uvReg + ".w, " + uvReg + ".z\n" + "mul " + uvReg + ".w, " + uvReg + ".w, " + depthCol + ".x\n" + "add " + targetReg + ".w, " + uvReg + ".z, " + uvReg + ".w\n" + - - "mov " + uvReg + ".x, " + this._pDepthMapCoordReg + ".x\n" + "add " + uvReg + ".y, " + this._pDepthMapCoordReg + ".y, " + customDataReg + ".z\n" + // (0, 1) - "tex " + depthCol + ", " + uvReg + ", " + depthMapRegister + " <2d, nearest, clamp>\n" + "dp4 " + depthCol + ".z, " + depthCol + ", " + decReg + "\n" + "slt " + uvReg + ".z, " + this._pDepthMapCoordReg + ".z, " + depthCol + ".z\n" + // 0 if in shadow - - "add " + uvReg + ".x, " + this._pDepthMapCoordReg + ".x, " + customDataReg + ".z\n" + // (1, 1) - "tex " + depthCol + ", " + uvReg + ", " + depthMapRegister + " <2d, nearest, clamp>\n" + "dp4 " + depthCol + ".z, " + depthCol + ", " + decReg + "\n" + "slt " + uvReg + ".w, " + this._pDepthMapCoordReg + ".z, " + depthCol + ".z\n" + // 0 if in shadow - - // recalculate fraction, since we ran out of registers :( - "mul " + depthCol + ".x, " + this._pDepthMapCoordReg + ".x, " + customDataReg + ".y\n" + "frc " + depthCol + ".x, " + depthCol + ".x\n" + "sub " + uvReg + ".w, " + uvReg + ".w, " + uvReg + ".z\n" + "mul " + uvReg + ".w, " + uvReg + ".w, " + depthCol + ".x\n" + "add " + uvReg + ".w, " + uvReg + ".z, " + uvReg + ".w\n" + - - "mul " + depthCol + ".x, " + this._pDepthMapCoordReg + ".y, " + customDataReg + ".y\n" + "frc " + depthCol + ".x, " + depthCol + ".x\n" + "sub " + uvReg + ".w, " + uvReg + ".w, " + targetReg + ".w\n" + "mul " + uvReg + ".w, " + uvReg + ".w, " + depthCol + ".x\n" + "add " + targetReg + ".w, " + targetReg + ".w, " + uvReg + ".w\n"; - - regCache.removeFragmentTempUsage(depthCol); - regCache.removeFragmentTempUsage(uvReg); - - methodVO.texturesIndex = depthMapRegister.index; - - return code; - } - - /** - * @inheritDoc - */ - public iActivateForCascade(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage) - { - var size:number /*int*/ = this.castingLight.shadowMapper.depthMapSize; - var index:number /*int*/ = methodVO.secondaryFragmentConstantsIndex; - var data:Array = shaderObject.fragmentConstantData; - data[index] = size; - data[index + 1] = 1/size; - } - - /** - * @inheritDoc - */ - public _iGetCascadeFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, decodeRegister:ShaderRegisterElement, depthTexture:ShaderRegisterElement, depthProjection:ShaderRegisterElement, targetRegister:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var code:string; - var dataReg:ShaderRegisterElement = registerCache.getFreeFragmentConstant(); - methodVO.secondaryFragmentConstantsIndex = dataReg.index*4; - var temp:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(temp, 1); - var predicate:ShaderRegisterElement = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(predicate, 1); - - code = "tex " + temp + ", " + depthProjection + ", " + depthTexture + " <2d, nearest, clamp>\n" + "dp4 " + temp + ".z, " + temp + ", " + decodeRegister + "\n" + "slt " + predicate + ".x, " + depthProjection + ".z, " + temp + ".z\n" + - - "add " + depthProjection + ".x, " + depthProjection + ".x, " + dataReg + ".y\n" + "tex " + temp + ", " + depthProjection + ", " + depthTexture + " <2d, nearest, clamp>\n" + "dp4 " + temp + ".z, " + temp + ", " + decodeRegister + "\n" + "slt " + predicate + ".z, " + depthProjection + ".z, " + temp + ".z\n" + - - "add " + depthProjection + ".y, " + depthProjection + ".y, " + dataReg + ".y\n" + "tex " + temp + ", " + depthProjection + ", " + depthTexture + " <2d, nearest, clamp>\n" + "dp4 " + temp + ".z, " + temp + ", " + decodeRegister + "\n" + "slt " + predicate + ".w, " + depthProjection + ".z, " + temp + ".z\n" + - - "sub " + depthProjection + ".x, " + depthProjection + ".x, " + dataReg + ".y\n" + "tex " + temp + ", " + depthProjection + ", " + depthTexture + " <2d, nearest, clamp>\n" + "dp4 " + temp + ".z, " + temp + ", " + decodeRegister + "\n" + "slt " + predicate + ".y, " + depthProjection + ".z, " + temp + ".z\n" + - - "mul " + temp + ".xy, " + depthProjection + ".xy, " + dataReg + ".x\n" + "frc " + temp + ".xy, " + temp + ".xy\n" + - - // some strange register juggling to prevent agal bugging out - "sub " + depthProjection + ", " + predicate + ".xyzw, " + predicate + ".zwxy\n" + "mul " + depthProjection + ", " + depthProjection + ", " + temp + ".x\n" + - - "add " + predicate + ".xy, " + predicate + ".xy, " + depthProjection + ".zw\n" + - - "sub " + predicate + ".y, " + predicate + ".y, " + predicate + ".x\n" + "mul " + predicate + ".y, " + predicate + ".y, " + temp + ".y\n" + "add " + targetRegister + ".w, " + predicate + ".x, " + predicate + ".y\n"; - - registerCache.removeFragmentTempUsage(temp); - registerCache.removeFragmentTempUsage(predicate); - return code; - } - } -} diff --git a/src/away/materials/methods/ShadowNearMethod.ts b/src/away/materials/methods/ShadowNearMethod.ts deleted file mode 100644 index 3b7216d20..000000000 --- a/src/away/materials/methods/ShadowNearMethod.ts +++ /dev/null @@ -1,229 +0,0 @@ -/// - -module away.materials -{ - import Stage = away.base.Stage; - import Camera = away.entities.Camera; - import RenderableBase = away.pool.RenderableBase; - import ShadingMethodEvent = away.events.ShadingMethodEvent; - import NearDirectionalShadowMapper = away.materials.NearDirectionalShadowMapper; - - // TODO: shadow mappers references in materials should be an interface so that this class should NOT extend ShadowMapMethodBase just for some delegation work - /** - * ShadowNearMethod provides a shadow map method that restricts the shadowed area near the camera to optimize - * shadow map usage. This method needs to be used in conjunction with a NearDirectionalShadowMapper. - * - * @see away.lights.NearDirectionalShadowMapper - */ - export class ShadowNearMethod extends ShadowMethodBase - { - private _baseMethod:ShadowMethodBase; - - private _fadeRatio:number; - private _nearShadowMapper:NearDirectionalShadowMapper; - - private _onShaderInvalidatedDelegate:Function; - - /** - * Creates a new ShadowNearMethod object. - * @param baseMethod The shadow map sampling method used to sample individual cascades (fe: ShadowHardMethod, ShadowSoftMethod) - * @param fadeRatio The amount of shadow fading to the outer shadow area. A value of 1 would mean the shadows start fading from the camera's near plane. - */ - constructor(baseMethod:ShadowMethodBase, fadeRatio:number = .1) - { - super(baseMethod.castingLight); - - this._onShaderInvalidatedDelegate = (event:ShadingMethodEvent) => this.onShaderInvalidated(event); - - this._baseMethod = baseMethod; - this._fadeRatio = fadeRatio; - this._nearShadowMapper = this._pCastingLight.shadowMapper; - if (!this._nearShadowMapper) - throw new Error("ShadowNearMethod requires a light that has a NearDirectionalShadowMapper instance assigned to shadowMapper."); - this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - } - - /** - * The base shadow map method on which this method's shading is based. - */ - public get baseMethod():ShadowMethodBase - { - return this._baseMethod; - } - - public set baseMethod(value:ShadowMethodBase) - { - if (this._baseMethod == value) - return; - this._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - this._baseMethod = value; - this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - this.iInvalidateShaderProgram(); - } - - /** - * @inheritDoc - */ - public iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO) - { - super.iInitConstants(shaderObject, methodVO); - this._baseMethod.iInitConstants(shaderObject, methodVO); - - var fragmentData:Array = shaderObject.fragmentConstantData; - var index:number /*int*/ = methodVO.secondaryFragmentConstantsIndex; - fragmentData[index + 2] = 0; - fragmentData[index + 3] = 1; - } - - /** - * @inheritDoc - */ - public iInitVO(shaderObject:ShaderLightingObject, methodVO:MethodVO) - { - this._baseMethod.iInitVO(shaderObject, methodVO); - - methodVO.needsProjection = true; - } - - /** - * @inheritDoc - */ - public dispose() - { - this._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - } - - /** - * @inheritDoc - */ - public get alpha():number - { - return this._baseMethod.alpha; - } - - public set alpha(value:number) - { - this._baseMethod.alpha = value; - } - - /** - * @inheritDoc - */ - public get epsilon():number - { - return this._baseMethod.epsilon; - } - - public set epsilon(value:number) - { - this._baseMethod.epsilon = value; - } - - /** - * The amount of shadow fading to the outer shadow area. A value of 1 would mean the shadows start fading from the camera's near plane. - */ - public get fadeRatio():number - { - return this._fadeRatio; - } - - public set fadeRatio(value:number) - { - this._fadeRatio = value; - } - - /** - * @inheritDoc - */ - public iGetFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var code:string = this._baseMethod.iGetFragmentCode(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); - - var dataReg:ShaderRegisterElement = registerCache.getFreeFragmentConstant(); - var temp:ShaderRegisterElement = registerCache.getFreeFragmentSingleTemp(); - methodVO.secondaryFragmentConstantsIndex = dataReg.index*4; - - code += "abs " + temp + ", " + sharedRegisters.projectionFragment + ".w\n" + - "sub " + temp + ", " + temp + ", " + dataReg + ".x\n" + - "mul " + temp + ", " + temp + ", " + dataReg + ".y\n" + - "sat " + temp + ", " + temp + "\n" + - "sub " + temp + ", " + dataReg + ".w," + temp + "\n" + - "sub " + targetReg + ".w, " + dataReg + ".w," + targetReg + ".w\n" + - "mul " + targetReg + ".w, " + targetReg + ".w, " + temp + "\n" + - "sub " + targetReg + ".w, " + dataReg + ".w," + targetReg + ".w\n"; - - return code; - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage) - { - this._baseMethod.iActivate(shaderObject, methodVO, stage); - } - - /** - * @inheritDoc - */ - public iDeactivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage) - { - this._baseMethod.iDeactivate(shaderObject, methodVO, stage); - } - - /** - * @inheritDoc - */ - public iSetRenderState(shaderObject:ShaderObjectBase, methodVO:MethodVO, renderable:RenderableBase, stage:Stage, camera:Camera) - { - // todo: move this to activate (needs camera) - var near:number = camera.projection.near; - var d:number = camera.projection.far - near; - var maxDistance:number = this._nearShadowMapper.coverageRatio; - var minDistance:number = maxDistance*(1 - this._fadeRatio); - - maxDistance = near + maxDistance*d; - minDistance = near + minDistance*d; - - var fragmentData:Array = shaderObject.fragmentConstantData; - var index:number /*int*/ = methodVO.secondaryFragmentConstantsIndex; - fragmentData[index] = minDistance; - fragmentData[index + 1] = 1/(maxDistance - minDistance); - - this._baseMethod.iSetRenderState(shaderObject, methodVO, renderable, stage, camera); - } - - /** - * @inheritDoc - */ - public iGetVertexCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - return this._baseMethod.iGetVertexCode(shaderObject, methodVO, registerCache, sharedRegisters); - } - - /** - * @inheritDoc - */ - public iReset() - { - this._baseMethod.iReset(); - } - - /** - * @inheritDoc - */ - public iCleanCompilationData() - { - super.iCleanCompilationData(); - this._baseMethod.iCleanCompilationData(); - } - - /** - * Called when the base method's shader code is invalidated. - */ - private onShaderInvalidated(event:ShadingMethodEvent) - { - this.iInvalidateShaderProgram(); - } - } -} diff --git a/src/away/materials/methods/ShadowSoftMethod.ts b/src/away/materials/methods/ShadowSoftMethod.ts deleted file mode 100644 index 36dd37819..000000000 --- a/src/away/materials/methods/ShadowSoftMethod.ts +++ /dev/null @@ -1,207 +0,0 @@ -/// - -module away.materials -{ - import Stage = away.base.Stage; - import DirectionalLight = away.entities.DirectionalLight; - - /** - * ShadowSoftMethod provides a soft shadowing technique by randomly distributing sample points. - */ - export class ShadowSoftMethod extends ShadowMethodBase - { - private _range:number = 1; - private _numSamples:number /*int*/; - private _offsets:Array; - - /** - * Creates a new DiffuseBasicMethod object. - * - * @param castingLight The light casting the shadows - * @param numSamples The amount of samples to take for dithering. Minimum 1, maximum 32. - */ - constructor(castingLight:DirectionalLight, numSamples:number /*int*/ = 5, range:number = 1) - { - super(castingLight); - - this.numSamples = numSamples; - this.range = range; - } - - /** - * The amount of samples to take for dithering. Minimum 1, maximum 32. The actual maximum may depend on the - * complexity of the shader. - */ - public get numSamples():number /*int*/ - { - return this._numSamples; - } - - public set numSamples(value:number /*int*/) - { - this._numSamples = value; - if (this._numSamples < 1) - this._numSamples = 1; else if (this._numSamples > 32) - this._numSamples = 32; - - this._offsets = away.geom.PoissonLookup.getDistribution(this._numSamples); - this.iInvalidateShaderProgram(); - } - - /** - * The range in the shadow map in which to distribute the samples. - */ - public get range():number - { - return this._range; - } - - public set range(value:number) - { - this._range = value; - } - - /** - * @inheritDoc - */ - public iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO) - { - super.iInitConstants(shaderObject, methodVO); - - shaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex + 8] = 1/this._numSamples; - shaderObject.fragmentConstantData[methodVO.fragmentConstantsIndex + 9] = 0; - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage) - { - super.iActivate(shaderObject, methodVO, stage); - - var texRange:number = .5*this._range/this._pCastingLight.shadowMapper.depthMapSize; - var data:Array = shaderObject.fragmentConstantData; - var index:number /*uint*/ = methodVO.fragmentConstantsIndex + 10; - var len:number /*uint*/ = this._numSamples << 1; - - for (var i:number /*int*/ = 0; i < len; ++i) - data[index + i] = this._offsets[i]*texRange; - } - - /** - * @inheritDoc - */ - public _pGetPlanarFragmentCode(methodVO:MethodVO, targetReg:ShaderRegisterElement, regCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - // todo: move some things to super - var depthMapRegister:ShaderRegisterElement = regCache.getFreeTextureReg(); - var decReg:ShaderRegisterElement = regCache.getFreeFragmentConstant(); - var dataReg:ShaderRegisterElement = regCache.getFreeFragmentConstant(); - var customDataReg:ShaderRegisterElement = regCache.getFreeFragmentConstant(); - - methodVO.fragmentConstantsIndex = decReg.index*4; - methodVO.texturesIndex = depthMapRegister.index; - - return this.getSampleCode(regCache, depthMapRegister, decReg, targetReg, customDataReg); - } - - /** - * Adds the code for another tap to the shader code. - * @param uv The uv register for the tap. - * @param texture The texture register containing the depth map. - * @param decode The register containing the depth map decoding data. - * @param target The target register to add the tap comparison result. - * @param regCache The register cache managing the registers. - * @return - */ - private addSample(uv:ShaderRegisterElement, texture:ShaderRegisterElement, decode:ShaderRegisterElement, target:ShaderRegisterElement, regCache:ShaderRegisterCache):string - { - var temp:ShaderRegisterElement = regCache.getFreeFragmentVectorTemp(); - return "tex " + temp + ", " + uv + ", " + texture + " <2d,nearest,clamp>\n" + - "dp4 " + temp + ".z, " + temp + ", " + decode + "\n" + - "slt " + uv + ".w, " + this._pDepthMapCoordReg + ".z, " + temp + ".z\n" + // 0 if in shadow - "add " + target + ".w, " + target + ".w, " + uv + ".w\n"; - } - - /** - * @inheritDoc - */ - public iActivateForCascade(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage) - { - super.iActivate(shaderObject, methodVO, stage); - - var texRange:number = this._range/this._pCastingLight.shadowMapper.depthMapSize; - var data:Array = shaderObject.fragmentConstantData; - var index:number /*uint*/ = methodVO.secondaryFragmentConstantsIndex; - var len:number /*uint*/ = this._numSamples << 1; - data[index] = 1/this._numSamples; - data[index + 1] = 0; - index += 2; - - for (var i:number /*int*/ = 0; i < len; ++i) - data[index + i] = this._offsets[i]*texRange; - - if (len%4 == 0) { - data[index + len] = 0; - data[index + len + 1] = 0; - } - } - - /** - * @inheritDoc - */ - public _iGetCascadeFragmentCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, decodeRegister:ShaderRegisterElement, depthTexture:ShaderRegisterElement, depthProjection:ShaderRegisterElement, targetRegister:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - this._pDepthMapCoordReg = depthProjection; - - var dataReg:ShaderRegisterElement = registerCache.getFreeFragmentConstant(); - methodVO.secondaryFragmentConstantsIndex = dataReg.index*4; - - return this.getSampleCode(registerCache, depthTexture, decodeRegister, targetRegister, dataReg); - } - - /** - * Get the actual shader code for shadow mapping - * @param regCache The register cache managing the registers. - * @param depthTexture The texture register containing the depth map. - * @param decodeRegister The register containing the depth map decoding data. - * @param targetReg The target register to add the shadow coverage. - * @param dataReg The register containing additional data. - */ - private getSampleCode(regCache:ShaderRegisterCache, depthTexture:ShaderRegisterElement, decodeRegister:ShaderRegisterElement, targetRegister:ShaderRegisterElement, dataReg:ShaderRegisterElement):string - { - var uvReg:ShaderRegisterElement; - var code:string; - var offsets:Array = new Array(dataReg + ".zw"); - uvReg = regCache.getFreeFragmentVectorTemp(); - regCache.addFragmentTempUsages(uvReg, 1); - - var temp:ShaderRegisterElement = regCache.getFreeFragmentVectorTemp(); - - var numRegs:number /*int*/ = this._numSamples >> 1; - for (var i:number /*int*/ = 0; i < numRegs; ++i) { - var reg:ShaderRegisterElement = regCache.getFreeFragmentConstant(); - offsets.push(reg + ".xy"); - offsets.push(reg + ".zw"); - } - - for (i = 0; i < this._numSamples; ++i) { - if (i == 0) { - code = "add " + uvReg + ", " + this._pDepthMapCoordReg + ", " + dataReg + ".zwyy\n" + - "tex " + temp + ", " + uvReg + ", " + depthTexture + " <2d,nearest,clamp>\n" + - "dp4 " + temp + ".z, " + temp + ", " + decodeRegister + "\n" + - "slt " + targetRegister + ".w, " + this._pDepthMapCoordReg + ".z, " + temp + ".z\n"; // 0 if in shadow; - } else { - code += "add " + uvReg + ".xy, " + this._pDepthMapCoordReg + ".xy, " + offsets[i] + "\n" + - this.addSample(uvReg, depthTexture, decodeRegister, targetRegister, regCache); - } - } - - regCache.removeFragmentTempUsage(uvReg); - - code += "mul " + targetRegister + ".w, " + targetRegister + ".w, " + dataReg + ".x\n"; // average - - return code; - } - } -} diff --git a/src/away/materials/methods/SpecularAnisotropicMethod.ts b/src/away/materials/methods/SpecularAnisotropicMethod.ts deleted file mode 100644 index 5caf5db70..000000000 --- a/src/away/materials/methods/SpecularAnisotropicMethod.ts +++ /dev/null @@ -1,91 +0,0 @@ -/// - -/** - * - */ -module away.materials -{ - /** - * SpecularAnisotropicMethod provides a specular method resulting in anisotropic highlights. These are typical for - * surfaces with microfacet details such as tiny grooves. In particular, this uses the Heidrich-Seidel distrubution. - * The tangent vectors are used as the surface groove directions. - */ - export class SpecularAnisotropicMethod extends SpecularBasicMethod - { - /** - * Creates a new SpecularAnisotropicMethod object. - */ - constructor() - { - super(); - } - - /** - * @inheritDoc - */ - public iInitVO(shaderObject:ShaderLightingObject, methodVO:MethodVO) - { - methodVO.needsTangents = true; - methodVO.needsView = true; - } - - /** - * @inheritDoc - */ - public iGetFragmentCodePerLight(shaderObject:ShaderLightingObject, methodVO:MethodVO, lightDirReg:ShaderRegisterElement, lightColReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var code:string = ""; - var t:ShaderRegisterElement; - - if (this._pIsFirstLight) - t = this._pTotalLightColorReg; - else { - t = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(t, 1); - } - - // (sin(l,t) * sin(v,t) - cos(l,t)*cos(v,t)) ^ k - - code += "nrm " + t + ".xyz, " + sharedRegisters.tangentVarying + ".xyz\n" + - "dp3 " + t + ".w, " + t + ".xyz, " + lightDirReg + ".xyz\n" + - "dp3 " + t + ".z, " + t + ".xyz, " + sharedRegisters.viewDirFragment + ".xyz\n"; - - // (sin(t.w) * sin(t.z) - cos(t.w)*cos(t.z)) ^ k - code += "sin " + t + ".x, " + t + ".w\n" + - "sin " + t + ".y, " + t + ".z\n" + - // (t.x * t.y - cos(t.w)*cos(t.z)) ^ k - "mul " + t + ".x, " + t + ".x, " + t + ".y\n" + - // (t.x - cos(t.w)*cos(t.z)) ^ k - "cos " + t + ".z, " + t + ".z\n" + - "cos " + t + ".w, " + t + ".w\n" + - // (t.x - t.w*t.z) ^ k - "mul " + t + ".w, " + t + ".w, " + t + ".z\n" + - // (t.x - t.w) ^ k - "sub " + t + ".w, " + t + ".x, " + t + ".w\n"; - - if (this._pUseTexture) { - // apply gloss modulation from texture - code += "mul " + this._pSpecularTexData + ".w, " + this._pSpecularTexData + ".y, " + this._pSpecularDataRegister + ".w\n" + - "pow " + t + ".w, " + t + ".w, " + this._pSpecularTexData + ".w\n"; - } else - code += "pow " + t + ".w, " + t + ".w, " + this._pSpecularDataRegister + ".w\n"; - - // attenuate - code += "mul " + t + ".w, " + t + ".w, " + lightDirReg + ".w\n"; - - if (this._iModulateMethod != null) - code += this._iModulateMethod(shaderObject, methodVO, t, registerCache, sharedRegisters); - - code += "mul " + t + ".xyz, " + lightColReg + ".xyz, " + t + ".w\n"; - - if (!this._pIsFirstLight) { - code += "add " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ".xyz, " + t + ".xyz\n"; - registerCache.removeFragmentTempUsage(t); - } - - this._pIsFirstLight = false; - - return code; - } - } -} diff --git a/src/away/materials/methods/SpecularCelMethod.ts b/src/away/materials/methods/SpecularCelMethod.ts deleted file mode 100644 index 272ff1748..000000000 --- a/src/away/materials/methods/SpecularCelMethod.ts +++ /dev/null @@ -1,106 +0,0 @@ -/// - -module away.materials -{ - import Stage = away.base.Stage; - - /** - * SpecularCelMethod provides a shading method to add specular cel (cartoon) shading. - */ - export class SpecularCelMethod extends SpecularCompositeMethod - { - private _dataReg:ShaderRegisterElement; - private _smoothness:number = .1; - private _specularCutOff:number = .1; - - /** - * Creates a new SpecularCelMethod object. - * @param specularCutOff The threshold at which the specular highlight should be shown. - * @param baseMethod An optional specular method on which the cartoon shading is based. If ommitted, SpecularBasicMethod is used. - */ - constructor(specularCutOff:number = .5, baseMethod:SpecularBasicMethod = null) - { - super(null, baseMethod); - - this.baseMethod._iModulateMethod = (shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData) => this.clampSpecular(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); - - this._specularCutOff = specularCutOff; - } - - /** - * The smoothness of the highlight edge. - */ - public get smoothness():number - { - return this._smoothness; - } - - public set smoothness(value:number) - { - this._smoothness = value; - } - - /** - * The threshold at which the specular highlight should be shown. - */ - public get specularCutOff():number - { - return this._specularCutOff; - } - - public set specularCutOff(value:number) - { - this._specularCutOff = value; - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderLightingObject, methodVO:MethodVO, stage:Stage) - { - super.iActivate(shaderObject, methodVO, stage); - - var index:number /*int*/ = methodVO.secondaryFragmentConstantsIndex; - var data:Array = shaderObject.fragmentConstantData; - data[index] = this._smoothness; - data[index + 1] = this._specularCutOff; - } - - /** - * @inheritDoc - */ - public iCleanCompilationData() - { - super.iCleanCompilationData(); - this._dataReg = null; - } - - /** - * Snaps the specular shading strength of the wrapped method to zero or one, depending on whether or not it exceeds the specularCutOff - * @param vo The MethodVO used to compile the current shader. - * @param t The register containing the specular strength in the "w" component, and either the half-vector or the reflection vector in "xyz". - * @param regCache The register cache used for the shader compilation. - * @param sharedRegisters The shared register data for this shader. - * @return The AGAL fragment code for the method. - */ - private clampSpecular(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - return "sub " + targetReg + ".y, " + targetReg + ".w, " + this._dataReg + ".y\n" + // x - cutoff - "div " + targetReg + ".y, " + targetReg + ".y, " + this._dataReg + ".x\n" + // (x - cutoff)/epsilon - "sat " + targetReg + ".y, " + targetReg + ".y\n" + - "sge " + targetReg + ".w, " + targetReg + ".w, " + this._dataReg + ".y\n" + - "mul " + targetReg + ".w, " + targetReg + ".w, " + targetReg + ".y\n"; - } - - /** - * @inheritDoc - */ - public iGetFragmentPreLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - this._dataReg = registerCache.getFreeFragmentConstant(); - methodVO.secondaryFragmentConstantsIndex = this._dataReg.index*4; - - return super.iGetFragmentPreLightingCode(shaderObject, methodVO, registerCache, sharedRegisters); - } - } -} diff --git a/src/away/materials/methods/SpecularCompositeMethod.ts b/src/away/materials/methods/SpecularCompositeMethod.ts deleted file mode 100755 index c7352c196..000000000 --- a/src/away/materials/methods/SpecularCompositeMethod.ts +++ /dev/null @@ -1,221 +0,0 @@ -/// - -module away.materials -{ - import Stage = away.base.Stage; - import Camera = away.entities.Camera; - import RenderableBase = away.pool.RenderableBase; - import Texture2DBase = away.textures.Texture2DBase; - import Delegate = away.utils.Delegate; - - import ShadingMethodEvent = away.events.ShadingMethodEvent; - - /** - * SpecularCompositeMethod provides a base class for specular methods that wrap a specular method to alter the - * calculated specular reflection strength. - */ - export class SpecularCompositeMethod extends SpecularBasicMethod - { - private _baseMethod:SpecularBasicMethod; - - private _onShaderInvalidatedDelegate:Function; - - /** - * Creates a new SpecularCompositeMethod object. - * - * @param modulateMethod The method which will add the code to alter the base method's strength. It needs to have the signature modSpecular(t:ShaderRegisterElement, regCache:ShaderRegisterCache):string, in which t.w will contain the specular strength and t.xyz will contain the half-vector or the reflection vector. - * @param baseMethod The base specular method on which this method's shading is based. - */ - constructor(modulateMethod:(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData) => string, baseMethod:SpecularBasicMethod = null) - { - super(); - - this._onShaderInvalidatedDelegate = Delegate.create(this, this.onShaderInvalidated); - - this._baseMethod = baseMethod || new SpecularBasicMethod(); - this._baseMethod._iModulateMethod = modulateMethod; - this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - } - - /** - * @inheritDoc - */ - public iInitVO(shaderObject:ShaderLightingObject, methodVO:MethodVO) - { - this._baseMethod.iInitVO(shaderObject, methodVO); - } - - /** - * @inheritDoc - */ - public iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO) - { - this._baseMethod.iInitConstants(shaderObject, methodVO); - } - - /** - * The base specular method on which this method's shading is based. - */ - public get baseMethod():SpecularBasicMethod - { - return this._baseMethod; - } - - public set baseMethod(value:SpecularBasicMethod) - { - if (this._baseMethod == value) - return; - - this._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - this._baseMethod = value; - this._baseMethod.addEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - this.iInvalidateShaderProgram(); - } - - /** - * @inheritDoc - */ - public get gloss():number - { - return this._baseMethod.gloss; - } - - public set gloss(value:number) - { - this._baseMethod.gloss = value; - } - - /** - * @inheritDoc - */ - public get specular():number - { - return this._baseMethod.specular; - } - - public set specular(value:number) - { - this._baseMethod.specular = value; - } - - /** - * @inheritDoc - */ - public get passes():Array - { - return this._baseMethod.passes; - } - - /** - * @inheritDoc - */ - public dispose() - { - this._baseMethod.removeEventListener(ShadingMethodEvent.SHADER_INVALIDATED, this._onShaderInvalidatedDelegate); - this._baseMethod.dispose(); - } - - /** - * @inheritDoc - */ - public get texture():Texture2DBase - { - return this._baseMethod.texture; - } - - public set texture(value:Texture2DBase) - { - this._baseMethod.texture = value; - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderLightingObject, methodVO:MethodVO, stage:Stage) - { - this._baseMethod.iActivate(shaderObject, methodVO, stage); - } - - /** - * @inheritDoc - */ - public iSetRenderState(shaderObject:ShaderLightingObject, methodVO:MethodVO, renderable:RenderableBase, stage:Stage, camera:Camera) - { - this._baseMethod.iSetRenderState(shaderObject, methodVO, renderable, stage, camera); - } - - /** - * @inheritDoc - */ - public iDeactivate(shaderObject:ShaderObjectBase, methodVO:MethodVO, stage:Stage) - { - this._baseMethod.iDeactivate(shaderObject, methodVO, stage); - } - - /** - * @inheritDoc - */ - public iGetVertexCode(shaderObject:ShaderObjectBase, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - return this._baseMethod.iGetVertexCode(shaderObject, methodVO, registerCache, sharedRegisters); - } - - /** - * @inheritDoc - */ - public iGetFragmentPreLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - return this._baseMethod.iGetFragmentPreLightingCode(shaderObject, methodVO, registerCache, sharedRegisters); - } - - /** - * @inheritDoc - */ - public iGetFragmentCodePerLight(shaderObject:ShaderLightingObject, methodVO:MethodVO, lightDirReg:ShaderRegisterElement, lightColReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - return this._baseMethod.iGetFragmentCodePerLight(shaderObject, methodVO, lightDirReg, lightColReg, registerCache, sharedRegisters); - } - - /** - * @inheritDoc - * @return - */ - public iGetFragmentCodePerProbe(shaderObject:ShaderLightingObject, methodVO:MethodVO, cubeMapReg:ShaderRegisterElement, weightRegister:string, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - return this._baseMethod.iGetFragmentCodePerProbe(shaderObject, methodVO, cubeMapReg, weightRegister, registerCache, sharedRegisters); - } - - /** - * @inheritDoc - */ - public iGetFragmentPostLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - return this._baseMethod.iGetFragmentPostLightingCode(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); - } - - /** - * @inheritDoc - */ - public iReset() - { - this._baseMethod.iReset(); - } - - /** - * @inheritDoc - */ - public iCleanCompilationData() - { - super.iCleanCompilationData(); - this._baseMethod.iCleanCompilationData(); - } - - /** - * Called when the base method's shader code is invalidated. - */ - private onShaderInvalidated(event:ShadingMethodEvent) - { - this.iInvalidateShaderProgram(); - } - } -} diff --git a/src/away/materials/methods/SpecularFresnelMethod.ts b/src/away/materials/methods/SpecularFresnelMethod.ts deleted file mode 100755 index 6dfd2a75c..000000000 --- a/src/away/materials/methods/SpecularFresnelMethod.ts +++ /dev/null @@ -1,152 +0,0 @@ -/// - -module away.materials -{ - import Stage = away.base.Stage; - - /** - * SpecularFresnelMethod provides a specular shading method that causes stronger highlights on grazing view angles. - */ - export class SpecularFresnelMethod extends SpecularCompositeMethod - { - private _dataReg:ShaderRegisterElement; - private _incidentLight:boolean; - private _fresnelPower:number = 5; - private _normalReflectance:number = .028; // default value for skin - - /** - * Creates a new SpecularFresnelMethod object. - * @param basedOnSurface Defines whether the fresnel effect should be based on the view angle on the surface (if true), or on the angle between the light and the view. - * @param baseMethod The specular method to which the fresnel equation. Defaults to SpecularBasicMethod. - */ - constructor(basedOnSurface:boolean = true, baseMethod:SpecularBasicMethod = null) - { - // may want to offer diff speculars - super(null, baseMethod); - - this.baseMethod._iModulateMethod = (shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData) => this.modulateSpecular(shaderObject, methodVO, targetReg, registerCache, sharedRegisters); - - this._incidentLight = !basedOnSurface; - } - - /** - * @inheritDoc - */ - public iInitConstants(shaderObject:ShaderObjectBase, methodVO:MethodVO) - { - - var index:number = methodVO.secondaryFragmentConstantsIndex; - shaderObject.fragmentConstantData[index + 2] = 1; - shaderObject.fragmentConstantData[index + 3] = 0; - } - - /** - * Defines whether the fresnel effect should be based on the view angle on the surface (if true), or on the angle between the light and the view. - */ - public get basedOnSurface():boolean - { - return !this._incidentLight; - } - - public set basedOnSurface(value:boolean) - { - if (this._incidentLight != value) - return; - - this._incidentLight = !value; - - this.iInvalidateShaderProgram(); - } - - /** - * The power used in the Fresnel equation. Higher values make the fresnel effect more pronounced. Defaults to 5. - */ - public get fresnelPower():number - { - return this._fresnelPower; - } - - public set fresnelPower(value:number) - { - this._fresnelPower = value; - } - - /** - * @inheritDoc - */ - public iCleanCompilationData() - { - super.iCleanCompilationData(); - this._dataReg = null; - } - - /** - * The minimum amount of reflectance, ie the reflectance when the view direction is normal to the surface or light direction. - */ - public get normalReflectance():number - { - return this._normalReflectance; - } - - public set normalReflectance(value:number) - { - this._normalReflectance = value; - } - - /** - * @inheritDoc - */ - public iActivate(shaderObject:ShaderLightingObject, methodVO:MethodVO, stage:Stage) - { - super.iActivate(shaderObject, methodVO, stage); - - var fragmentData:Array = shaderObject.fragmentConstantData; - - var index:number = methodVO.secondaryFragmentConstantsIndex; - fragmentData[index] = this._normalReflectance; - fragmentData[index + 1] = this._fresnelPower; - } - - /** - * @inheritDoc - */ - public iGetFragmentPreLightingCode(shaderObject:ShaderLightingObject, methodVO:MethodVO, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - this._dataReg = registerCache.getFreeFragmentConstant(); - - console.log('SpecularFresnelMethod', 'iGetFragmentPreLightingCode', this._dataReg); - - methodVO.secondaryFragmentConstantsIndex = this._dataReg.index*4; - - return super.iGetFragmentPreLightingCode(shaderObject, methodVO, registerCache, sharedRegisters); - } - - /** - * Applies the fresnel effect to the specular strength. - * - * @param vo The MethodVO object containing the method data for the currently compiled material pass. - * @param target The register containing the specular strength in the "w" component, and the half-vector/reflection vector in "xyz". - * @param regCache The register cache used for the shader compilation. - * @param sharedRegisters The shared registers created by the compiler. - * @return The AGAL fragment code for the method. - */ - private modulateSpecular(shaderObject:ShaderObjectBase, methodVO:MethodVO, targetReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var code:string; - - code = "dp3 " + targetReg + ".y, " + sharedRegisters.viewDirFragment + ".xyz, " + (this._incidentLight? targetReg : sharedRegisters.normalFragment) + ".xyz\n" + // dot(V, H) - "sub " + targetReg + ".y, " + this._dataReg + ".z, " + targetReg + ".y\n" + // base = 1-dot(V, H) - "pow " + targetReg + ".x, " + targetReg + ".y, " + this._dataReg + ".y\n" + // exp = pow(base, 5) - "sub " + targetReg + ".y, " + this._dataReg + ".z, " + targetReg + ".y\n" + // 1 - exp - "mul " + targetReg + ".y, " + this._dataReg + ".x, " + targetReg + ".y\n" + // f0*(1 - exp) - "add " + targetReg + ".y, " + targetReg + ".x, " + targetReg + ".y\n" + // exp + f0*(1 - exp) - "mul " + targetReg + ".w, " + targetReg + ".w, " + targetReg + ".y\n"; - - - console.log('SpecularFresnelMethod', 'modulateSpecular', code); - - return code; - } - - } -} diff --git a/src/away/materials/methods/SpecularPhongMethod.ts b/src/away/materials/methods/SpecularPhongMethod.ts deleted file mode 100644 index ae1501d81..000000000 --- a/src/away/materials/methods/SpecularPhongMethod.ts +++ /dev/null @@ -1,79 +0,0 @@ -/// - -module away.materials -{ - /** - * SpecularPhongMethod provides a specular method that provides Phong highlights. - */ - export class SpecularPhongMethod extends SpecularBasicMethod - { - /** - * Creates a new SpecularPhongMethod object. - */ - constructor() - { - super(); - } - - /** - * @inheritDoc - */ - public iGetFragmentCodePerLight(shaderObject:ShaderLightingObject, methodVO:MethodVO, lightDirReg:ShaderRegisterElement, lightColReg:ShaderRegisterElement, registerCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):string - { - var code:string = ""; - var t:ShaderRegisterElement; - - if (this._pIsFirstLight) { - t = this._pTotalLightColorReg; - } else { - t = registerCache.getFreeFragmentVectorTemp(); - registerCache.addFragmentTempUsages(t, 1); - } - - var viewDirReg:ShaderRegisterElement =sharedRegisters.viewDirFragment; - var normalReg:ShaderRegisterElement =sharedRegisters.normalFragment; - - // phong model - code += "dp3 " + t + ".w, " + lightDirReg + ", " + normalReg + "\n" + // sca1 = light.normal - - //find the reflected light vector R - "add " + t + ".w, " + t + ".w, " + t + ".w\n" + // sca1 = sca1*2 - "mul " + t + ".xyz, " + normalReg + ", " + t + ".w\n" + // vec1 = normal*sca1 - "sub " + t + ".xyz, " + t + ", " + lightDirReg + "\n" + // vec1 = vec1 - light (light vector is negative) - - //smooth the edge as incidence angle approaches 90 - "add " + t + ".w, " + t + ".w, " +sharedRegisters.commons + ".w\n" + // sca1 = sca1 + smoothtep; - "sat " + t + ".w, " + t + ".w\n" + // sca1 range 0 - 1 - "mul " + t + ".xyz, " + t + ", " + t + ".w\n" + // vec1 = vec1*sca1 - - //find the dot product between R and V - "dp3 " + t + ".w, " + t + ", " + viewDirReg + "\n" + // sca1 = vec1.view - "sat " + t + ".w, " + t + ".w\n"; - - if (this._pUseTexture) { - // apply gloss modulation from texture - code += "mul " + this._pSpecularTexData + ".w, " + this._pSpecularTexData + ".y, " + this._pSpecularDataRegister + ".w\n" + "pow " + t + ".w, " + t + ".w, " + this._pSpecularTexData + ".w\n"; - } else - code += "pow " + t + ".w, " + t + ".w, " + this._pSpecularDataRegister + ".w\n"; - - // attenuate - if (shaderObject.usesLightFallOff) - code += "mul " + t + ".w, " + t + ".w, " + lightDirReg + ".w\n"; - - if (this._iModulateMethod != null) - code += this._iModulateMethod(shaderObject, methodVO, t, registerCache, sharedRegisters); - - code += "mul " + t + ".xyz, " + lightColReg + ".xyz, " + t + ".w\n"; - - if (!this._pIsFirstLight) { - code += "add " + this._pTotalLightColorReg + ".xyz, " + this._pTotalLightColorReg + ".xyz, " + t + ".xyz\n"; - registerCache.removeFragmentTempUsage(t); - } - - this._pIsFirstLight = false; - - return code; - } - } -} - diff --git a/src/away/materials/passes/SingleObjectDepthPass.ts b/src/away/materials/passes/SingleObjectDepthPass.ts deleted file mode 100644 index c1ad52db6..000000000 --- a/src/away/materials/passes/SingleObjectDepthPass.ts +++ /dev/null @@ -1,207 +0,0 @@ -/// - -module away.materials -{ - import LightBase = away.base.LightBase; - import TriangleSubGeometry = away.base.TriangleSubGeometry; - import Stage = away.base.Stage; - import Camera = away.entities.Camera; - import Matrix3D = away.geom.Matrix3D; - import RenderableBase = away.pool.RenderableBase; - import ContextGLProgramType = away.stagegl.ContextGLProgramType; - import IContextStageGL = away.stagegl.IContextStageGL; - import RenderTexture = away.textures.RenderTexture; - - /** - * The SingleObjectDepthPass provides a material pass that renders a single object to a depth map from the point - * of view from a light. - */ - export class SingleObjectDepthPass extends MaterialPassBase - { - private _textures:Object; - private _projections:Object; - private _textureSize:number /*uint*/ = 512; - private _polyOffset:Array = Array(15, 0, 0, 0); - private _enc:Array; - private _projectionTexturesInvalid:Boolean = true; - - /** - * The size of the depth map texture to render to. - */ - public get textureSize():number - { - return this._textureSize; - } - - public set textureSize(value:number) - { - this._textureSize = value; - } - - /** - * The amount by which the rendered object will be inflated, to prevent depth map rounding errors. - */ - public get polyOffset():number - { - return this._polyOffset[0]; - } - - public set polyOffset(value:number) - { - this._polyOffset[0] = value; - } - - /** - * Creates a new SingleObjectDepthPass object. - */ - constructor() - { - super(); - - this._pNumUsedStreams = 2; - this._pNumUsedVertexConstants = 7; - this._enc = Array(1.0, 255.0, 65025.0, 16581375.0, 1.0/255.0, 1.0/255.0, 1.0/255.0, 0.0); - - this._pAnimatableAttributes = Array("va0", "va1"); - this._pAnimationTargetRegisters = Array("vt0", "vt1"); - } - - /** - * @inheritDoc - */ - public dispose() - { - if (this._textures) { - for (var key in this._textures) { - var texture:RenderTexture = this._textures[key]; - texture.dispose(); - } - this._textures = null; - } - } - - /** - * Updates the projection textures used to contain the depth renders. - */ - private updateProjectionTextures() - { - if (this._textures) { - for (var key in this._textures) { - var texture:RenderTexture = this._textures[key]; - texture.dispose(); - } - } - - this._textures = new Object(); - this._projections = new Object(); - this._projectionTexturesInvalid = false; - } - - /** - * @inheritDoc - */ - public iGetVertexCode():string - { - var code:string; - // offset - code = "mul vt7, vt1, vc4.x \n" + - "add vt7, vt7, vt0\n" + - "mov vt7.w, vt0.w\n"; - // project - code += "m44 vt2, vt7, vc0\n" + - "mov op, vt2\n"; - - // perspective divide - code += "div v0, vt2, vt2.w\n"; - - return code; - } - - /** - * @inheritDoc - */ - public iGetFragmentCode(animationCode:string):string - { - var code:string = ""; - - // encode float -> rgba - code += "mul ft0, fc0, v0.z\n" + - "frc ft0, ft0\n" + - "mul ft1, ft0.yzww, fc1\n" + - "sub ft0, ft0, ft1\n" + - "mov oc, ft0\n"; - - return code; - } - - /** - * Gets the depth maps rendered for this object from all lights. - * @param renderable The renderable for which to retrieve the depth maps. - * @param stage3DProxy The Stage3DProxy object currently used for rendering. - * @return A list of depth map textures for all supported lights. - */ - public _iGetDepthMap(renderable:RenderableBase):RenderTexture - { - return this._textures[renderable.materialOwner.id]; - } - - /** - * Retrieves the depth map projection maps for all lights. - * @param renderable The renderable for which to retrieve the projection maps. - * @return A list of projection maps for all supported lights. - */ - public _iGetProjection(renderable:RenderableBase):Matrix3D - { - return this._projections[renderable.materialOwner.id]; - } - - /** - * @inheritDoc - */ - public iRender(renderable:RenderableBase, stage:Stage, camera:Camera, viewProjection:Matrix3D) - { - var matrix:Matrix3D; - var context:IContextStageGL = stage.context; - var len:number /*uint*/; - var light:LightBase; - var lights:Array = this._pLightPicker.allPickedLights; - var rId:number = renderable.materialOwner.id; - - if (!this._textures[rId]) - this._textures[rId] = new RenderTexture(this._textureSize, this._textureSize); - - if (!this._projections[rId]) - this._projections[rId] = new Matrix3D(); - - len = lights.length; - - // local position = enough - light = lights[0]; - - matrix = light.iGetObjectProjectionMatrix(renderable.sourceEntity, camera, this._projections[rId]); - - context.setRenderTarget(this._textures[rId], true); - context.clear(1.0, 1.0, 1.0); - context.setProgramConstantsFromMatrix(ContextGLProgramType.VERTEX, 0, matrix, true); - context.setProgramConstantsFromArray(ContextGLProgramType.FRAGMENT, 0, this._enc, 2); - - context.activateBuffer(0, renderable.getVertexData(TriangleSubGeometry.POSITION_DATA), renderable.getVertexOffset(TriangleSubGeometry.POSITION_DATA), TriangleSubGeometry.POSITION_FORMAT); - context.activateBuffer(1, renderable.getVertexData(TriangleSubGeometry.NORMAL_DATA), renderable.getVertexOffset(TriangleSubGeometry.NORMAL_DATA), TriangleSubGeometry.NORMAL_FORMAT); - context.drawTriangles(context.getIndexBuffer(renderable.getIndexData()), 0, renderable.numTriangles); - } - - /** - * @inheritDoc - */ - public iActivate(material:MaterialBase, stage:Stage, camera:Camera) - { - if (this._projectionTexturesInvalid) - this.updateProjectionTextures(); - - // never scale - super.iActivate(material, stage, camera); - - ( stage.context).setProgramConstantsFromArray(ContextGLProgramType.VERTEX, 4, this._polyOffset, 1); - } - } -} \ No newline at end of file diff --git a/src/away/parsers/AWDParser.ts b/src/away/parsers/AWDParser.ts deleted file mode 100644 index 5b91db158..000000000 --- a/src/away/parsers/AWDParser.ts +++ /dev/null @@ -1,2876 +0,0 @@ -/// - -module away.parsers -{ - import AnimationSetBase = away.animators.AnimationSetBase; - import AnimatorBase = away.animators.AnimatorBase; - import JointPose = away.animators.JointPose; - import Skeleton = away.animators.Skeleton; - import SkeletonAnimationSet = away.animators.SkeletonAnimationSet; - import SkeletonAnimator = away.animators.SkeletonAnimator; - import SkeletonClipNode = away.animators.SkeletonClipNode; - import SkeletonPose = away.animators.SkeletonPose; - import SkeletonJoint = away.animators.SkeletonJoint; - import VertexAnimationSet = away.animators.VertexAnimationSet; - import VertexAnimator = away.animators.VertexAnimator; - import VertexClipNode = away.animators.VertexClipNode; - import BlendMode = away.base.BlendMode; - import Geometry = away.base.Geometry; - import LightBase = away.base.LightBase; - import TriangleSubGeometry = away.base.TriangleSubGeometry; - import Mesh = away.entities.Mesh; - import DirectionalLight = away.entities.DirectionalLight; - import PointLight = away.entities.PointLight; - import ColorTransform = away.geom.ColorTransform; - import Matrix3D = away.geom.Matrix3D; - import AssetType = away.library.AssetType; - import AmbientEnvMapMethod = away.materials.AmbientEnvMapMethod; - import DefaultMaterialManager = away.materials.DefaultMaterialManager; - import DiffuseDepthMethod = away.materials.DiffuseDepthMethod; - import DiffuseCelMethod = away.materials.DiffuseCelMethod; -// import DiffuseSubSurfaceMethod = away.materials.DiffuseSubSurfaceMethod; - import DiffuseGradientMethod = away.materials.DiffuseGradientMethod; - import DiffuseLightMapMethod = away.materials.DiffuseLightMapMethod; - import DiffuseWrapMethod = away.materials.DiffuseWrapMethod; - import EffectAlphaMaskMethod = away.materials.EffectAlphaMaskMethod; - import EffectColorMatrixMethod = away.materials.EffectColorMatrixMethod; - import EffectColorTransformMethod = away.materials.EffectColorTransformMethod; - import EffectEnvMapMethod = away.materials.EffectEnvMapMethod; - import EffectFogMethod = away.materials.EffectFogMethod; - import EffectFresnelEnvMapMethod = away.materials.EffectFresnelEnvMapMethod; - import EffectLightMapMethod = away.materials.EffectLightMapMethod; - import EffectMethodBase = away.materials.EffectMethodBase; - import EffectRimLightMethod = away.materials.EffectRimLightMethod; - import LightPickerBase = away.materials.LightPickerBase; - import MaterialBase = away.materials.MaterialBase; - import NormalSimpleWaterMethod = away.materials.NormalSimpleWaterMethod; - import TriangleMethodMaterial = away.materials.TriangleMethodMaterial; - import TriangleMaterialMode = away.materials.TriangleMaterialMode; - import ShadowDitheredMethod = away.materials.ShadowDitheredMethod; - import ShadowFilteredMethod = away.materials.ShadowFilteredMethod; - import SkyboxMaterial = away.materials.SkyboxMaterial; - import SpecularFresnelMethod = away.materials.SpecularFresnelMethod; - import ShadowHardMethod = away.materials.ShadowHardMethod; - import SpecularAnisotropicMethod = away.materials.SpecularAnisotropicMethod; - import SpecularCelMethod = away.materials.SpecularCelMethod; - import SpecularPhongMethod = away.materials.SpecularPhongMethod; - import ShadowNearMethod = away.materials.ShadowNearMethod; - import CubeMapShadowMapper = away.materials.CubeMapShadowMapper; - import DirectionalShadowMapper = away.materials.DirectionalShadowMapper; - import ShadowMapperBase = away.materials.ShadowMapperBase; - import ShadowMethodBase = away.materials.ShadowMethodBase; - import ShadowSoftMethod = away.materials.ShadowSoftMethod; - import StaticLightPicker = away.materials.StaticLightPicker; - import URLLoaderDataFormat = away.net.URLLoaderDataFormat; - import ParserBase = away.parsers.ParserBase; - import ParserUtils = away.parsers.ParserUtils; - import ResourceDependency = away.parsers.ResourceDependency; - import BitmapCubeTexture = away.textures.BitmapCubeTexture; - import BitmapTexture = away.textures.BitmapTexture; - import CubeTextureBase = away.textures.CubeTextureBase; - import ImageCubeTexture = away.textures.ImageCubeTexture; - import ImageTexture = away.textures.ImageTexture; - import Texture2DBase = away.textures.Texture2DBase; - import TextureProxyBase = away.textures.TextureProxyBase; - import ByteArray = away.utils.ByteArray; - - /** - * AWDParser provides a parser for the AWD data type. - */ - export class AWDParser extends away.parsers.ParserBase - { - //set to "true" to have some console.logs in the Console - private _debug:boolean = false; - private _byteData:ByteArray; - private _startedParsing:boolean = false; - private _cur_block_id:number; - private _blocks:Array; - private _newBlockBytes:ByteArray; - private _version:Array; - private _compression:number; - private _accuracyOnBlocks:boolean; - private _accuracyMatrix:boolean; - private _accuracyGeo:boolean; - private _accuracyProps:boolean; - private _matrixNrType:number; - private _geoNrType:number; - private _propsNrType:number; - private _streaming:boolean; - private _texture_users:Object = {}; - private _parsed_header:boolean = false; - private _body:ByteArray; - private _defaultTexture:BitmapTexture; // HTML IMAGE TEXTURE >? ! - private _cubeTextures:Array; - private _defaultBitmapMaterial:TriangleMethodMaterial; - private _defaultCubeTexture:BitmapCubeTexture; - - public static COMPRESSIONMODE_LZMA:string = "lzma"; - public static UNCOMPRESSED:number = 0; - public static DEFLATE:number = 1; - public static LZMA:number = 2; - public static INT8:number = 1; - public static INT16:number = 2; - public static INT32:number = 3; - public static UINT8:number = 4; - public static UINT16:number = 5; - public static UINT32:number = 6; - public static FLOAT32:number = 7; - public static FLOAT64:number = 8; - public static BOOL:number = 21; - public static COLOR:number = 22; - public static BADDR:number = 23; - public static AWDSTRING:number = 31; - public static AWDBYTEARRAY:number = 32; - public static VECTOR2x1:number = 41; - public static VECTOR3x1:number = 42; - public static VECTOR4x1:number = 43; - public static MTX3x2:number = 44; - public static MTX3x3:number = 45; - public static MTX4x3:number = 46; - public static MTX4x4:number = 47; - - private blendModeDic:Array; - private _depthSizeDic:Array; - - /** - * Creates a new AWDParser object. - * @param uri The url or id of the data or file to be parsed. - * @param extra The holder for extra contextual data that the parser might need. - */ - constructor() - { - super(URLLoaderDataFormat.ARRAY_BUFFER); - - this._blocks = new Array(); - this._blocks[0] = new AWDBlock(); - this._blocks[0].data = null; // Zero address means null in AWD - - this.blendModeDic = new Array(); // used to translate ints to blendMode-strings - this.blendModeDic.push(BlendMode.NORMAL); - this.blendModeDic.push(BlendMode.ADD); - this.blendModeDic.push(BlendMode.ALPHA); - this.blendModeDic.push(BlendMode.DARKEN); - this.blendModeDic.push(BlendMode.DIFFERENCE); - this.blendModeDic.push(BlendMode.ERASE); - this.blendModeDic.push(BlendMode.HARDLIGHT); - this.blendModeDic.push(BlendMode.INVERT); - this.blendModeDic.push(BlendMode.LAYER); - this.blendModeDic.push(BlendMode.LIGHTEN); - this.blendModeDic.push(BlendMode.MULTIPLY); - this.blendModeDic.push(BlendMode.NORMAL); - this.blendModeDic.push(BlendMode.OVERLAY); - this.blendModeDic.push(BlendMode.SCREEN); - this.blendModeDic.push(BlendMode.SHADER); - this.blendModeDic.push(BlendMode.OVERLAY); - - this._depthSizeDic = new Array(); // used to translate ints to depthSize-values - this._depthSizeDic.push(256); - this._depthSizeDic.push(512); - this._depthSizeDic.push(2048); - this._depthSizeDic.push(1024); - this._version = Array(); // will contain 2 int (major-version, minor-version) for awd-version-check - } - - /** - * Indicates whether or not a given file extension is supported by the parser. - * @param extension The file extension of a potential file to be parsed. - * @return Whether or not the given file type is supported. - */ - public static supportsType(extension:string):boolean - { - extension = extension.toLowerCase(); - return extension == "awd"; - } - - /** - * Tests whether a data block can be parsed by the parser. - * @param data The data block to potentially be parsed. - * @return Whether or not the given data is supported. - */ - public static supportsData(data:any):boolean - { - return (away.parsers.ParserUtils.toString(data, 3) == 'AWD'); - } - - /** - * @inheritDoc - */ - public _iResolveDependency(resourceDependency:ResourceDependency):void - { - // this will be called when Dependency has finished loading. - // the Assets waiting for this Bitmap, can be Texture or CubeTexture. - // if the Bitmap is awaited by a CubeTexture, we need to check if its the last Bitmap of the CubeTexture, - // so we know if we have to finalize the Asset (CubeTexture) or not. - if (resourceDependency.assets.length == 1) { - var isCubeTextureArray:Array = resourceDependency.id.split("#"); - var ressourceID:string = isCubeTextureArray[0]; - var asset:TextureProxyBase; - var thisBitmapTexture:Texture2DBase; - var block:AWDBlock; - - if (isCubeTextureArray.length == 1) // Not a cube texture - { - asset = resourceDependency.assets[0]; - if (asset) { - var mat:TriangleMethodMaterial; - var users:Array; - - block = this._blocks[ resourceDependency.id ]; - block.data = asset; // Store finished asset - - // Reset name of texture to the one defined in the AWD file, - // as opposed to whatever the image parser came up with. - asset.resetAssetPath(block.name, null, true); - block.name = asset.name; - // Finalize texture asset to dispatch texture event, which was - // previously suppressed while the dependency was loaded. - this._pFinalizeAsset( asset); - - if (this._debug) { - console.log("Successfully loaded Bitmap for texture"); - console.log("Parsed texture: Name = " + block.name); - } - } - } - - if (isCubeTextureArray.length > 1) // Cube Texture - { - thisBitmapTexture = resourceDependency.assets[0]; - - var tx:ImageTexture = thisBitmapTexture; - - this._cubeTextures[ isCubeTextureArray[1] ] = tx.htmlImageElement; // ? - this._texture_users[ressourceID].push(1); - - if (this._debug) { - console.log("Successfully loaded Bitmap " + this._texture_users[ressourceID].length + " / 6 for Cubetexture"); - } - if (this._texture_users[ressourceID].length == this._cubeTextures.length) { - - var posX:any = this._cubeTextures[0]; - var negX:any = this._cubeTextures[1]; - var posY:any = this._cubeTextures[2]; - var negY:any = this._cubeTextures[3]; - var posZ:any = this._cubeTextures[4]; - var negZ:any = this._cubeTextures[5]; - - asset = new ImageCubeTexture(posX, negX, posY, negY, posZ, negZ); - block = this._blocks[ressourceID]; - block.data = asset; // Store finished asset - - // Reset name of texture to the one defined in the AWD file, - // as opposed to whatever the image parser came up with. - asset.resetAssetPath(block.name, null, true); - block.name = asset.name; - // Finalize texture asset to dispatch texture event, which was - // previously suppressed while the dependency was loaded. - this._pFinalizeAsset( asset); - if (this._debug) { - console.log("Parsed CubeTexture: Name = " + block.name); - } - } - } - - } - } - - /** - * @inheritDoc - */ - public _iResolveDependencyFailure(resourceDependency:ResourceDependency):void - { - //not used - if a dependcy fails, the awaiting Texture or CubeTexture will never be finalized, and the default-bitmaps will be used. - // this means, that if one Bitmap of a CubeTexture fails, the CubeTexture will have the DefaultTexture applied for all six Bitmaps. - } - - /** - * Resolve a dependency name - * - * @param resourceDependency The dependency to be resolved. - */ - public _iResolveDependencyName(resourceDependency:ResourceDependency, asset:away.library.IAsset):string - { - var oldName:string = asset.name; - - if (asset) { - var block:AWDBlock = this._blocks[parseInt(resourceDependency.id)]; - // Reset name of texture to the one defined in the AWD file, - // as opposed to whatever the image parser came up with. - asset.resetAssetPath(block.name, null, true); - } - - var newName:string = asset.name; - - asset.name = oldName; - - return newName; - - } - - /** - * @inheritDoc - */ - public _pProceedParsing():boolean - { - - if (!this._startedParsing) { - this._byteData = this._pGetByteData();//getByteData(); - this._startedParsing = true; - } - - if (!this._parsed_header) { - - //---------------------------------------------------------------------------- - // LITTLE_ENDIAN - Default for ArrayBuffer / Not implemented in ByteArray - //---------------------------------------------------------------------------- - //this._byteData.endian = Endian.LITTLE_ENDIAN; - //---------------------------------------------------------------------------- - - //---------------------------------------------------------------------------- - // Parse header and decompress body if needed - this.parseHeader(); - - switch (this._compression) { - - case AWDParser.DEFLATE: - case AWDParser.LZMA: - this._pDieWithError('Compressed AWD formats not yet supported'); - break; - - case AWDParser.UNCOMPRESSED: - this._body = this._byteData; - break; - - //---------------------------------------------------------------------------- - // Compressed AWD Formats not yet supported - //---------------------------------------------------------------------------- - - /* - case AWDParser.DEFLATE: - - this._body = new ByteArray(); - this._byteData.readBytes(this._body, 0, this._byteData.getBytesAvailable()); - this._body.uncompress(); - - break; - case AWDParser.LZMA: - - this._body = new ByteArray(); - this._byteData.readBytes(this._body, 0, this._byteData.getBytesAvailable()); - this._body.uncompress(COMPRESSIONMODE_LZMA); - - break; - //*/ - - } - - this._parsed_header = true; - - //---------------------------------------------------------------------------- - // LITTLE_ENDIAN - Default for ArrayBuffer / Not implemented in ByteArray - //---------------------------------------------------------------------------- - //this._body.endian = Endian.LITTLE_ENDIAN;// Should be default - //---------------------------------------------------------------------------- - - } - - if (this._body) { - - while (this._body.getBytesAvailable() > 0 && !this.parsingPaused) //&& this._pHasTime() ) - { - this.parseNextBlock(); - - } - - //---------------------------------------------------------------------------- - // Return complete status - if (this._body.getBytesAvailable() == 0) { - this.dispose(); - return ParserBase.PARSING_DONE; - } else { - return ParserBase.MORE_TO_PARSE; - } - } else { - - switch (this._compression) { - - case AWDParser.DEFLATE: - case AWDParser.LZMA: - - if (this._debug) { - console.log("(!) AWDParser Error: Compressed AWD formats not yet supported (!)"); - } - - break; - - } - // Error - most likely _body not set because we do not support compression. - return ParserBase.PARSING_DONE; - - } - - } - - public _pStartParsing(frameLimit:number) - { - super._pStartParsing(frameLimit); - - //create a content object for Loaders - this._pContent = new away.containers.DisplayObjectContainer(); - } - - private dispose():void - { - - for (var c in this._blocks) { - - var b:AWDBlock = this._blocks[ c ]; - b.dispose(); - - } - - } - - private parseNextBlock():void - { - var block:AWDBlock; - var assetData:away.library.IAsset; - var isParsed:boolean = false; - var ns:number; - var type:number; - var flags:number; - var len:number; - - this._cur_block_id = this._body.readUnsignedInt(); - - ns = this._body.readUnsignedByte(); - type = this._body.readUnsignedByte(); - flags = this._body.readUnsignedByte(); - len = this._body.readUnsignedInt(); - - var blockCompression:boolean = bitFlags.test(flags, bitFlags.FLAG4); - var blockCompressionLZMA:boolean = bitFlags.test(flags, bitFlags.FLAG5); - - if (this._accuracyOnBlocks) { - this._accuracyMatrix = bitFlags.test(flags, bitFlags.FLAG1); - this._accuracyGeo = bitFlags.test(flags, bitFlags.FLAG2); - this._accuracyProps = bitFlags.test(flags, bitFlags.FLAG3); - this._geoNrType = AWDParser.FLOAT32; - - if (this._accuracyGeo) { - this._geoNrType = AWDParser.FLOAT64; - } - - this._matrixNrType = AWDParser.FLOAT32; - - if (this._accuracyMatrix) { - this._matrixNrType = AWDParser.FLOAT64; - } - - this._propsNrType = AWDParser.FLOAT32; - - if (this._accuracyProps) { - this._propsNrType = AWDParser.FLOAT64; - } - } - - var blockEndAll:number = this._body.position + len; - - if (len > this._body.getBytesAvailable()) { - this._pDieWithError('AWD2 block length is bigger than the bytes that are available!'); - this._body.position += this._body.getBytesAvailable(); - return; - } - this._newBlockBytes = new ByteArray(); - - - this._body.readBytes(this._newBlockBytes, 0, len); - - //---------------------------------------------------------------------------- - // Compressed AWD Formats not yet supported - - if (blockCompression) { - this._pDieWithError('Compressed AWD formats not yet supported'); - - /* - if (blockCompressionLZMA) - { - this._newBlockBytes.uncompress(AWDParser.COMPRESSIONMODE_LZMA); - } - else - { - this._newBlockBytes.uncompress(); - } - */ - - } - - //---------------------------------------------------------------------------- - // LITTLE_ENDIAN - Default for ArrayBuffer / Not implemented in ByteArray - //---------------------------------------------------------------------------- - //this._newBlockBytes.endian = Endian.LITTLE_ENDIAN; - //---------------------------------------------------------------------------- - - this._newBlockBytes.position = 0; - block = new AWDBlock(); - block.len = this._newBlockBytes.position + len; - block.id = this._cur_block_id; - - var blockEndBlock:number = this._newBlockBytes.position + len; - - if (blockCompression) { - this._pDieWithError('Compressed AWD formats not yet supported'); - //blockEndBlock = this._newBlockBytes.position + this._newBlockBytes.length; - //block.len = blockEndBlock; - } - - if (this._debug) { - console.log("AWDBlock: ID = " + this._cur_block_id + " | TypeID = " + type + " | Compression = " + blockCompression + " | Matrix-Precision = " + this._accuracyMatrix + " | Geometry-Precision = " + this._accuracyGeo + " | Properties-Precision = " + this._accuracyProps); - } - - this._blocks[this._cur_block_id] = block; - - if ((this._version[0] == 2) && (this._version[1] == 1)) { - - switch (type) { - case 11: - this.parsePrimitves(this._cur_block_id); - isParsed = true; - break; - case 31: - this.parseSkyboxInstance(this._cur_block_id); - isParsed = true; - break; - case 41: - this.parseLight(this._cur_block_id); - isParsed = true; - break; - case 42: - this.parseCamera(this._cur_block_id); - isParsed = true; - break; - - // case 43: - // parseTextureProjector(_cur_block_id); - // isParsed = true; - // break; - - case 51: - this.parseLightPicker(this._cur_block_id); - isParsed = true; - break; - case 81: - this.parseMaterial_v1(this._cur_block_id); - isParsed = true; - break; - case 83: - this.parseCubeTexture(this._cur_block_id); - isParsed = true; - break; - case 91: - this.parseSharedMethodBlock(this._cur_block_id); - isParsed = true; - break; - case 92: - this.parseShadowMethodBlock(this._cur_block_id); - isParsed = true; - break; - case 111: - this.parseMeshPoseAnimation(this._cur_block_id, true); - isParsed = true; - break; - case 112: - this.parseMeshPoseAnimation(this._cur_block_id); - isParsed = true; - break; - case 113: - this.parseVertexAnimationSet(this._cur_block_id); - isParsed = true; - break; - case 122: - this.parseAnimatorSet(this._cur_block_id); - isParsed = true; - break; - case 253: - this.parseCommand(this._cur_block_id); - isParsed = true; - break; - } - //*/ - } - //* - if (isParsed == false) { - switch (type) { - - case 1: - this.parseTriangleGeometrieBlock(this._cur_block_id); - break; - case 22: - this.parseContainer(this._cur_block_id); - break; - case 23: - this.parseMeshInstance(this._cur_block_id); - break; - case 81: - this.parseMaterial(this._cur_block_id); - break; - case 82: - this.parseTexture(this._cur_block_id); - break; - case 101: - this.parseSkeleton(this._cur_block_id); - break; - case 102: - this.parseSkeletonPose(this._cur_block_id); - break; - case 103: - this.parseSkeletonAnimation(this._cur_block_id); - break; - case 121: - //this.parseUVAnimation(this._cur_block_id); - //break; - case 254: - this.parseNameSpace(this._cur_block_id); - break; - case 255: - this.parseMetaData(this._cur_block_id); - break; - default: - if (this._debug) { - console.log("AWDBlock: Unknown BlockType (BlockID = " + this._cur_block_id + ") - Skip " + len + " bytes"); - } - this._newBlockBytes.position += len; - break; - } - } - //*/ - - var msgCnt:number = 0; - if (this._newBlockBytes.position == blockEndBlock) { - if (this._debug) { - if (block.errorMessages) { - while (msgCnt < block.errorMessages.length) { - console.log(" (!) Error: " + block.errorMessages[msgCnt] + " (!)"); - msgCnt++; - } - } - } - if (this._debug) { - console.log("\n"); - } - } else { - if (this._debug) { - - console.log(" (!)(!)(!) Error while reading AWDBlock ID " + this._cur_block_id + " = skip to next block"); - - if (block.errorMessages) { - while (msgCnt < block.errorMessages.length) { - console.log(" (!) Error: " + block.errorMessages[msgCnt] + " (!)"); - msgCnt++; - } - } - } - } - - this._body.position = blockEndAll; - this._newBlockBytes = null; - - } - - - //--Parser Blocks--------------------------------------------------------------------------- - - //Block ID = 1 - private parseTriangleGeometrieBlock(blockID:number):void - { - - var geom:away.base.Geometry = new away.base.Geometry(); - - // Read name and sub count - var name:string = this.parseVarStr(); - var num_subs:number = this._newBlockBytes.readUnsignedShort(); - - // Read optional properties - var props:AWDProperties = this.parseProperties({1:this._geoNrType, 2:this._geoNrType}); - var geoScaleU:number = props.get(1, 1); - var geoScaleV:number = props.get(2, 1); - - // Loop through sub meshes - var subs_parsed:number = 0; - while (subs_parsed < num_subs) { - var i:number; - var sm_len:number, sm_end:number; - var sub_geom:TriangleSubGeometry; - var w_indices:Array; - var weights:Array; - - sm_len = this._newBlockBytes.readUnsignedInt(); - sm_end = this._newBlockBytes.position + sm_len; - - // Ignore for now - var subProps:AWDProperties = this.parseProperties({1:this._geoNrType, 2:this._geoNrType}); - // Loop through data streams - while (this._newBlockBytes.position < sm_end) { - var idx:number = 0; - var str_ftype:number, str_type:number, str_len:number, str_end:number; - - // Type, field type, length - str_type = this._newBlockBytes.readUnsignedByte(); - str_ftype = this._newBlockBytes.readUnsignedByte(); - str_len = this._newBlockBytes.readUnsignedInt(); - str_end = this._newBlockBytes.position + str_len; - - var x:number, y:number, z:number; - - if (str_type == 1) { - var verts:Array = new Array(); - - while (this._newBlockBytes.position < str_end) { - // TODO: Respect stream field type - x = this.readNumber(this._accuracyGeo); - y = this.readNumber(this._accuracyGeo); - z = this.readNumber(this._accuracyGeo); - - verts[idx++] = x; - verts[idx++] = y; - verts[idx++] = z; - } - } else if (str_type == 2) { - var indices:Array = new Array(); - - while (this._newBlockBytes.position < str_end) { - // TODO: Respect stream field type - indices[idx++] = this._newBlockBytes.readUnsignedShort(); - } - - } else if (str_type == 3) { - var uvs:Array = new Array(); - while (this._newBlockBytes.position < str_end) { - uvs[idx++] = this.readNumber(this._accuracyGeo); - - } - } else if (str_type == 4) { - - var normals:Array = new Array(); - - while (this._newBlockBytes.position < str_end) { - normals[idx++] = this.readNumber(this._accuracyGeo); - } - - } else if (str_type == 6) { - w_indices = Array(); - - while (this._newBlockBytes.position < str_end) { - w_indices[idx++] = this._newBlockBytes.readUnsignedShort()*3; // TODO: Respect stream field type - } - - } else if (str_type == 7) { - - weights = new Array(); - - while (this._newBlockBytes.position < str_end) { - weights[idx++] = this.readNumber(this._accuracyGeo); - } - } else { - this._newBlockBytes.position = str_end; - } - - } - - this.parseUserAttributes(); // Ignore sub-mesh attributes for now - - sub_geom = new TriangleSubGeometry(true); - if (weights) - sub_geom.jointsPerVertex = weights.length/(verts.length/3); - if (normals) - sub_geom.autoDeriveNormals = false; - if (uvs) - sub_geom.autoDeriveUVs = false; - sub_geom.updateIndices(indices); - sub_geom.updatePositions(verts); - sub_geom.updateVertexNormals(normals); - sub_geom.updateUVs(uvs); - sub_geom.updateVertexTangents(null); - sub_geom.updateJointWeights(weights); - sub_geom.updateJointIndices(w_indices); - - var scaleU:number = subProps.get(1, 1); - var scaleV:number = subProps.get(2, 1); - var setSubUVs:boolean = false; //this should remain false atm, because in AwayBuilder the uv is only scaled by the geometry - - if ((geoScaleU != scaleU) || (geoScaleV != scaleV)) { - setSubUVs = true; - scaleU = geoScaleU/scaleU; - scaleV = geoScaleV/scaleV; - } - - if (setSubUVs) - sub_geom.scaleUV(scaleU, scaleV); - - geom.addSubGeometry(sub_geom); - - // TODO: Somehow map in-sub to out-sub indices to enable look-up - // when creating meshes (and their material assignments.) - - subs_parsed++; - } - if ((geoScaleU != 1) || (geoScaleV != 1)) - geom.scaleUV(geoScaleU, geoScaleV); - this.parseUserAttributes(); - this._pFinalizeAsset( geom, name); - this._blocks[blockID].data = geom; - - if (this._debug) { - console.log("Parsed a TriangleGeometry: Name = " + name + "| Id = " + sub_geom.id); - } - - } - - //Block ID = 11 - private parsePrimitves(blockID:number):void - { - var name:string; - var prefab:away.prefabs.PrefabBase; - var primType:number; - var subs_parsed:number; - var props:AWDProperties; - var bsm:Matrix3D; - - // Read name and sub count - name = this.parseVarStr(); - primType = this._newBlockBytes.readUnsignedByte(); - props = this.parseProperties({101:this._geoNrType, 102:this._geoNrType, 103:this._geoNrType, 110:this._geoNrType, 111:this._geoNrType, 301:AWDParser.UINT16, 302:AWDParser.UINT16, 303:AWDParser.UINT16, 701:AWDParser.BOOL, 702:AWDParser.BOOL, 703:AWDParser.BOOL, 704:AWDParser.BOOL}); - - var primitiveTypes:Array = ["Unsupported Type-ID", "PrimitivePlanePrefab", "PrimitiveCubePrefab", "PrimitiveSpherePrefab", "PrimitiveCylinderPrefab", "PrimitivesConePrefab", "PrimitivesCapsulePrefab", "PrimitivesTorusPrefab"] - - switch (primType) { - // to do, not all properties are set on all primitives - - case 1: - prefab = new away.prefabs.PrimitivePlanePrefab(props.get(101, 100), props.get(102, 100), props.get(301, 1), props.get(302, 1), props.get(701, true), props.get(702, false)); - break; - - case 2: - prefab = new away.prefabs.PrimitiveCubePrefab(props.get(101, 100), props.get(102, 100), props.get(103, 100), props.get(301, 1), props.get(302, 1), props.get(303, 1), props.get(701, true)); - break; - - case 3: - prefab = new away.prefabs.PrimitiveSpherePrefab(props.get(101, 50), props.get(301, 16), props.get(302, 12), props.get(701, true)); - break; - - case 4: - prefab = new away.prefabs.PrimitiveCylinderPrefab(props.get(101, 50), props.get(102, 50), props.get(103, 100), props.get(301, 16), props.get(302, 1), true, true, true); // bool701, bool702, bool703, bool704); - if (!props.get(701, true)) - (prefab).topClosed = false; - if (!props.get(702, true)) - (prefab).bottomClosed = false; - if (!props.get(703, true)) - (prefab).yUp = false; - - break; - - case 5: - prefab = new away.prefabs.PrimitiveConePrefab(props.get(101, 50), props.get(102, 100), props.get(301, 16), props.get(302, 1), props.get(701, true), props.get(702, true)); - break; - - case 6: - prefab = new away.prefabs.PrimitiveCapsulePrefab(props.get(101, 50), props.get(102, 100), props.get(301, 16), props.get(302, 15), props.get(701, true)); - break; - - case 7: - prefab = new away.prefabs.PrimitiveTorusPrefab(props.get(101, 50), props.get(102, 50), props.get(301, 16), props.get(302, 8), props.get(701, true)); - break; - - default: - prefab = new away.prefabs.PrefabBase(); - console.log("ERROR: UNSUPPORTED PREFAB_TYPE"); - break; - } - - if ((props.get(110, 1) != 1) || (props.get(111, 1) != 1)) { - //geom.subGeometries; - //geom.scaleUV(props.get(110, 1), props.get(111, 1)); //TODO add back scaling to prefabs - } - - this.parseUserAttributes(); - prefab.name = name; - this._pFinalizeAsset(prefab, name); - this._blocks[blockID].data = prefab; - - if (this._debug) { - if ((primType < 0) || (primType > 7)) { - primType = 0; - } - console.log("Parsed a Primivite: Name = " + name + "| type = " + primitiveTypes[primType]); - } - } - - // Block ID = 22 - private parseContainer(blockID:number):void - { - var name:string; - var par_id:number; - var mtx:Matrix3D; - var ctr:away.containers.DisplayObjectContainer; - var parent:away.containers.DisplayObjectContainer; - - par_id = this._newBlockBytes.readUnsignedInt(); - mtx = this.parseMatrix3D(); - name = this.parseVarStr(); - - var parentName:string = "Root (TopLevel)"; - ctr = new away.containers.DisplayObjectContainer(); - ctr.transform.matrix3D = mtx; - - var returnedArray:Array = this.getAssetByID(par_id, [AssetType.CONTAINER, AssetType.LIGHT, AssetType.MESH]); - - if (returnedArray[0]) { - var obj:away.base.DisplayObject = ( returnedArray[1]).addChild(ctr); - parentName = ( returnedArray[1]).name; - } else if (par_id > 0) { - this._blocks[ blockID ].addError("Could not find a parent for this ObjectContainer3D"); - } else { - //add to the content property - ( this._pContent).addChild(ctr); - } - - // in AWD version 2.1 we read the Container properties - if ((this._version[0] == 2) && (this._version[1] == 1)) { - var props:AWDProperties = this.parseProperties({1:this._matrixNrType, 2:this._matrixNrType, 3:this._matrixNrType, 4:AWDParser.UINT8}); - ctr.pivot = new away.geom.Vector3D(props.get(1, 0), props.get(2, 0), props.get(3, 0)); - } - // in other versions we do not read the Container properties - else { - this.parseProperties(null); - } - - // the extraProperties should only be set for AWD2.1-Files, but is read for both versions - ctr.extra = this.parseUserAttributes(); - - this._pFinalizeAsset( ctr, name); - this._blocks[blockID].data = ctr; - - if (this._debug) { - console.log("Parsed a Container: Name = '" + name + "' | Parent-Name = " + parentName); - } - } - - // Block ID = 23 - private parseMeshInstance(blockID:number):void - { - var num_materials:number; - var materials_parsed:number; - var parent:away.containers.DisplayObjectContainer; - var par_id:number = this._newBlockBytes.readUnsignedInt(); - var mtx:Matrix3D = this.parseMatrix3D(); - var name:string = this.parseVarStr(); - var parentName:string = "Root (TopLevel)"; - var data_id:number = this._newBlockBytes.readUnsignedInt(); - var geom:away.base.Geometry; - var returnedArrayGeometry:Array = this.getAssetByID(data_id, [AssetType.GEOMETRY]) - - if (returnedArrayGeometry[0]) { - geom = returnedArrayGeometry[1]; - } else { - this._blocks[blockID].addError("Could not find a Geometry for this Mesh. A empty Geometry is created!"); - geom = new away.base.Geometry(); - } - - this._blocks[blockID].geoID = data_id; - var materials:Array = new Array(); - num_materials = this._newBlockBytes.readUnsignedShort(); - - var materialNames:Array = new Array(); - materials_parsed = 0; - - var returnedArrayMaterial:Array; - - while (materials_parsed < num_materials) { - var mat_id:number; - mat_id = this._newBlockBytes.readUnsignedInt(); - returnedArrayMaterial = this.getAssetByID(mat_id, [AssetType.MATERIAL]) - if ((!returnedArrayMaterial[0]) && (mat_id > 0)) { - this._blocks[blockID].addError("Could not find Material Nr " + materials_parsed + " (ID = " + mat_id + " ) for this Mesh"); - } - - var m:MaterialBase = returnedArrayMaterial[1]; - - materials.push(m); - materialNames.push(m.name); - - materials_parsed++; - } - - var mesh:Mesh = new Mesh(geom, null); - mesh.transform.matrix3D = mtx; - - var returnedArrayParent:Array = this.getAssetByID(par_id, [AssetType.CONTAINER, AssetType.LIGHT, AssetType.MESH]) - - if (returnedArrayParent[0]) { - var objC:away.containers.DisplayObjectContainer = returnedArrayParent[1]; - objC.addChild(mesh); - parentName = objC.name; - } else if (par_id > 0) { - this._blocks[blockID].addError("Could not find a parent for this Mesh"); - } else { - //add to the content property - ( this._pContent).addChild(mesh); - } - - if (materials.length >= 1 && mesh.subMeshes.length == 1) { - mesh.material = materials[0]; - } else if (materials.length > 1) { - var i:number; - - // Assign each sub-mesh in the mesh a material from the list. If more sub-meshes - // than materials, repeat the last material for all remaining sub-meshes. - for (i = 0; i < mesh.subMeshes.length; i++) { - mesh.subMeshes[i].material = materials[Math.min(materials.length - 1, i)]; - } - } - if ((this._version[0] == 2) && (this._version[1] == 1)) { - var props:AWDProperties = this.parseProperties({1:this._matrixNrType, 2:this._matrixNrType, 3:this._matrixNrType, 4:AWDParser.UINT8, 5:AWDParser.BOOL}); - mesh.pivot = new away.geom.Vector3D(props.get(1, 0), props.get(2, 0), props.get(3, 0)); - mesh.castsShadows = props.get(5, true); - } else { - this.parseProperties(null); - } - - mesh.extra = this.parseUserAttributes(); - - this._pFinalizeAsset( mesh, name); - this._blocks[blockID].data = mesh; - - if (this._debug) { - console.log("Parsed a Mesh: Name = '" + name + "' | Parent-Name = " + parentName + "| Geometry-Name = " + geom.name + " | SubMeshes = " + mesh.subMeshes.length + " | Mat-Names = " + materialNames.toString()); - } - } - - - //Block ID 31 - private parseSkyboxInstance(blockID:number):void - { - var name:string = this.parseVarStr(); - var cubeTexAddr:number = this._newBlockBytes.readUnsignedInt(); - - var returnedArrayCubeTex:Array = this.getAssetByID(cubeTexAddr, [AssetType.TEXTURE], "CubeTexture"); - if ((!returnedArrayCubeTex[0]) && (cubeTexAddr != 0)) - this._blocks[blockID].addError("Could not find the Cubetexture (ID = " + cubeTexAddr + " ) for this Skybox"); - var asset:away.entities.Skybox = new away.entities.Skybox(new SkyboxMaterial( returnedArrayCubeTex[1])); - - this.parseProperties(null) - asset.extra = this.parseUserAttributes(); - this._pFinalizeAsset(asset, name); - this._blocks[blockID].data = asset; - if (this._debug) - console.log("Parsed a Skybox: Name = '" + name + "' | CubeTexture-Name = " + ( returnedArrayCubeTex[1]).name); - - } - - //Block ID = 41 - private parseLight(blockID:number):void - { - var light:LightBase; - var newShadowMapper:ShadowMapperBase; - - var par_id:number = this._newBlockBytes.readUnsignedInt(); - var mtx:Matrix3D = this.parseMatrix3D(); - var name:string = this.parseVarStr(); - var lightType:number = this._newBlockBytes.readUnsignedByte(); - var props:AWDProperties = this.parseProperties({1:this._propsNrType, 2:this._propsNrType, 3:AWDParser.COLOR, 4:this._propsNrType, 5:this._propsNrType, 6:AWDParser.BOOL, 7:AWDParser.COLOR, 8:this._propsNrType, 9:AWDParser.UINT8, 10:AWDParser.UINT8, 11:this._propsNrType, 12:AWDParser.UINT16, 21:this._matrixNrType, 22:this._matrixNrType, 23:this._matrixNrType}); - var shadowMapperType:number = props.get(9, 0); - var parentName:string = "Root (TopLevel)"; - var lightTypes:Array = ["Unsupported LightType", "PointLight", "DirectionalLight"]; - var shadowMapperTypes:Array = ["No ShadowMapper", "DirectionalShadowMapper", "NearDirectionalShadowMapper", "CascadeShadowMapper", "CubeMapShadowMapper"]; - - if (lightType == 1) { - light = new PointLight(); - - ( light).radius = props.get(1, 90000); - ( light).fallOff = props.get(2, 100000); - - if (shadowMapperType > 0) { - if (shadowMapperType == 4) { - newShadowMapper = new CubeMapShadowMapper(); - } - } - - light.transform.matrix3D = mtx; - - } - - if (lightType == 2) { - - light = new DirectionalLight(props.get(21, 0), props.get(22, -1), props.get(23, 1)); - - if (shadowMapperType > 0) { - if (shadowMapperType == 1) { - newShadowMapper = new DirectionalShadowMapper(); - } - - //if (shadowMapperType == 2) - // newShadowMapper = new NearDirectionalShadowMapper(props.get(11, 0.5)); - //if (shadowMapperType == 3) - // newShadowMapper = new CascadeShadowMapper(props.get(12, 3)); - - } - - } - light.color = props.get(3, 0xffffff); - light.specular = props.get(4, 1.0); - light.diffuse = props.get(5, 1.0); - light.ambientColor = props.get(7, 0xffffff); - light.ambient = props.get(8, 0.0); - - // if a shadowMapper has been created, adjust the depthMapSize if needed, assign to light and set castShadows to true - if (newShadowMapper) { - if (newShadowMapper instanceof CubeMapShadowMapper) { - if (props.get(10, 1) != 1) { - newShadowMapper.depthMapSize = this._depthSizeDic[props.get(10, 1)]; - } - } else { - if (props.get(10, 2) != 2) { - newShadowMapper.depthMapSize = this._depthSizeDic[props.get(10, 2)]; - } - } - - light.shadowMapper = newShadowMapper; - light.castsShadows = true; - } - - if (par_id != 0) { - - var returnedArrayParent:Array = this.getAssetByID(par_id, [AssetType.CONTAINER, AssetType.LIGHT, AssetType.MESH]) - - if (returnedArrayParent[0]) { - ( returnedArrayParent[1]).addChild(light); - parentName = ( returnedArrayParent[1]).name; - } else { - this._blocks[blockID].addError("Could not find a parent for this Light"); - } - } else { - //add to the content property - ( this._pContent).addChild(light); - } - - this.parseUserAttributes(); - - this._pFinalizeAsset(< away.library.IAsset> light, name); - - this._blocks[blockID].data = light; - - if (this._debug) - console.log("Parsed a Light: Name = '" + name + "' | Type = " + lightTypes[lightType] + " | Parent-Name = " + parentName + " | ShadowMapper-Type = " + shadowMapperTypes[shadowMapperType]); - - } - - //Block ID = 43 - private parseCamera(blockID:number):void - { - - var par_id:number = this._newBlockBytes.readUnsignedInt(); - var mtx:Matrix3D = this.parseMatrix3D(); - var name:string = this.parseVarStr(); - var parentName:string = "Root (TopLevel)"; - var projection:away.projections.ProjectionBase; - - this._newBlockBytes.readUnsignedByte(); //set as active camera - this._newBlockBytes.readShort(); //lengthof lenses - not used yet - - var projectiontype:number = this._newBlockBytes.readShort(); - var props:AWDProperties = this.parseProperties({101:this._propsNrType, 102:this._propsNrType, 103:this._propsNrType, 104:this._propsNrType}); - - switch (projectiontype) { - case 5001: - projection = new away.projections.PerspectiveProjection(props.get(101, 60)); - break; - case 5002: - projection = new away.projections.OrthographicProjection(props.get(101, 500)); - break; - case 5003: - projection = new away.projections.OrthographicOffCenterProjection(props.get(101, -400), props.get(102, 400), props.get(103, -300), props.get(104, 300)); - break; - default: - console.log("unsupportedLenstype"); - return; - } - - var camera:away.entities.Camera = new away.entities.Camera(projection); - camera.transform.matrix3D = mtx; - - var returnedArrayParent:Array = this.getAssetByID(par_id, [AssetType.CONTAINER, AssetType.LIGHT, AssetType.MESH]) - - if (returnedArrayParent[0]) { - - var objC:away.containers.DisplayObjectContainer = returnedArrayParent[1]; - objC.addChild(camera); - - parentName = objC.name; - - } else if (par_id > 0) { - this._blocks[blockID].addError("Could not find a parent for this Camera"); - } else { - //add to the content property - ( this._pContent).addChild(camera); - } - - camera.name = name; - props = this.parseProperties({1:this._matrixNrType, 2:this._matrixNrType, 3:this._matrixNrType, 4:AWDParser.UINT8}); - camera.pivot = new away.geom.Vector3D(props.get(1, 0), props.get(2, 0), props.get(3, 0)); - camera.extra = this.parseUserAttributes(); - - this._pFinalizeAsset(camera, name); - - this._blocks[blockID].data = camera - - if (this._debug) { - console.log("Parsed a Camera: Name = '" + name + "' | Projectiontype = " + projection + " | Parent-Name = " + parentName); - } - - } - - //Block ID = 51 - private parseLightPicker(blockID:number):void - { - var name:string = this.parseVarStr(); - var numLights:number = this._newBlockBytes.readUnsignedShort(); - var lightsArray:Array = new Array(); - var k:number = 0; - var lightID:number = 0; - - var returnedArrayLight:Array; - var lightsArrayNames:Array = new Array(); - - for (k = 0; k < numLights; k++) { - lightID = this._newBlockBytes.readUnsignedInt(); - returnedArrayLight = this.getAssetByID(lightID, [AssetType.LIGHT]) - - if (returnedArrayLight[0]) { - lightsArray.push( returnedArrayLight[1]); - lightsArrayNames.push(( returnedArrayLight[1]).name); - - } else { - this._blocks[blockID].addError("Could not find a Light Nr " + k + " (ID = " + lightID + " ) for this LightPicker"); - } - } - - if (lightsArray.length == 0) { - this._blocks[blockID].addError("Could not create this LightPicker, cause no Light was found."); - this.parseUserAttributes(); - return; //return without any more parsing for this block - } - - var lightPick:LightPickerBase = new StaticLightPicker(lightsArray); - lightPick.name = name; - - this.parseUserAttributes(); - this._pFinalizeAsset( lightPick, name); - - this._blocks[blockID].data = lightPick - if (this._debug) { - console.log("Parsed a StaticLightPicker: Name = '" + name + "' | Texture-Name = " + lightsArrayNames.toString()); - } - } - - //Block ID = 81 - private parseMaterial(blockID:number):void - { - // TODO: not used - ////blockLength = block.len; - var name:string; - var type:number; - var props:AWDProperties; - var mat:TriangleMethodMaterial; - var attributes:Object; - var finalize:boolean; - var num_methods:number; - var methods_parsed:number; - var returnedArray:Array; - - name = this.parseVarStr(); - type = this._newBlockBytes.readUnsignedByte(); - num_methods = this._newBlockBytes.readUnsignedByte(); - - // Read material numerical properties - // (1=color, 2=bitmap url, 10=alpha, 11=alpha_blending, 12=alpha_threshold, 13=repeat) - props = this.parseProperties({ 1:AWDParser.INT32, 2:AWDParser.BADDR, 10:this._propsNrType, 11:AWDParser.BOOL, 12:this._propsNrType, 13:AWDParser.BOOL}); - - methods_parsed = 0; - while (methods_parsed < num_methods) { - var method_type:number; - - method_type = this._newBlockBytes.readUnsignedShort(); - this.parseProperties(null); - this.parseUserAttributes(); - methods_parsed += 1; - } - var debugString:string = ""; - attributes = this.parseUserAttributes(); - if (type === 1) { // Color material - debugString += "Parsed a ColorMaterial(SinglePass): Name = '" + name + "' | "; - var color:number; - color = props.get(1, 0xffffff); - if (this.materialMode < 2) { - mat = new TriangleMethodMaterial(color, props.get(10, 1.0)); - } else { - mat = new TriangleMethodMaterial(color); - mat.materialMode = TriangleMaterialMode.MULTI_PASS; - } - } else if (type === 2) { - var tex_addr:number = props.get(2, 0); - - returnedArray = this.getAssetByID(tex_addr, [AssetType.TEXTURE]); - - if ((!returnedArray[0]) && (tex_addr > 0)) - this._blocks[blockID].addError("Could not find the DiffsueTexture (ID = " + tex_addr + " ) for this Material"); - - mat = new TriangleMethodMaterial( returnedArray[1]); - - if (this.materialMode < 2) { - mat.alphaBlending = props.get(11, false); - mat.alpha = props.get(10, 1.0); - debugString += "Parsed a TriangleMethodMaterial(SinglePass): Name = '" + name + "' | Texture-Name = " + mat.name; - } else { - mat.materialMode = TriangleMaterialMode.MULTI_PASS; - debugString += "Parsed a TriangleMethodMaterial(MultiPass): Name = '" + name + "' | Texture-Name = " + mat.name; - } - } - - mat.extra = attributes; - mat.alphaThreshold = props.get(12, 0.0); - mat.repeat = props.get(13, false); - this._pFinalizeAsset( mat, name); - this._blocks[blockID].data = mat; - - if (this._debug) { - console.log(debugString); - - } - } - - // Block ID = 81 AWD2.1 - private parseMaterial_v1(blockID:number):void - { - var mat:TriangleMethodMaterial; - var normalTexture:Texture2DBase; - var specTexture:Texture2DBase; - var returnedArray:Array; - - var name:string = this.parseVarStr(); - var type:number = this._newBlockBytes.readUnsignedByte(); - var num_methods:number = this._newBlockBytes.readUnsignedByte(); - var props:AWDProperties = this.parseProperties({1:AWDParser.UINT32, 2:AWDParser.BADDR, 3:AWDParser.BADDR, 4:AWDParser.UINT8, 5:AWDParser.BOOL, 6:AWDParser.BOOL, 7:AWDParser.BOOL, 8:AWDParser.BOOL, 9:AWDParser.UINT8, 10:this._propsNrType, 11:AWDParser.BOOL, 12:this._propsNrType, 13:AWDParser.BOOL, 15:this._propsNrType, 16:AWDParser.UINT32, 17:AWDParser.BADDR, 18:this._propsNrType, 19:this._propsNrType, 20:AWDParser.UINT32, 21:AWDParser.BADDR, 22:AWDParser.BADDR}); - var spezialType:number = props.get(4, 0); - var debugString:string = ""; - - if (spezialType >= 2) {//this is no supported material - this._blocks[blockID].addError("Material-spezialType '" + spezialType + "' is not supported, can only be 0:singlePass, 1:MultiPass !"); - return; - } - - if (this.materialMode == 1) - spezialType = 0; - else if (this.materialMode == 2) - spezialType = 1; - - if (spezialType < 2) {//this is SinglePass or MultiPass - - if (type == 1) {// Color material - var color:number = props.get(1, 0xcccccc);//TODO temporarily swapped so that diffuse color goes to ambient - - if (spezialType == 1) {// MultiPassMaterial - mat = new TriangleMethodMaterial(color); - mat.materialMode = TriangleMaterialMode.MULTI_PASS; - debugString += "Parsed a ColorMaterial(MultiPass): Name = '" + name + "' | "; - - } else { // SinglePassMaterial - mat = new TriangleMethodMaterial(color, props.get(10, 1.0)); - mat.alphaBlending = props.get(11, false); - debugString += "Parsed a ColorMaterial(SinglePass): Name = '" + name + "' | "; - } - - } else if (type == 2) {// texture material - var tex_addr:number = props.get(2, 0);//TODO temporarily swapped so that diffuse texture goes to ambient - returnedArray = this.getAssetByID(tex_addr, [AssetType.TEXTURE]); - - if ((!returnedArray[0]) && (tex_addr > 0)) - this._blocks[blockID].addError("Could not find the AmbientTexture (ID = " + tex_addr + " ) for this TriangleMethodMaterial"); - - var texture:Texture2DBase = returnedArray[1]; - - mat = new TriangleMethodMaterial(texture); - - if (spezialType == 1) {// MultiPassMaterial - mat.materialMode = TriangleMaterialMode.MULTI_PASS; - - debugString += "Parsed a TriangleMethodMaterial(MultiPass): Name = '" + name + "' | Texture-Name = " + texture.name; - } else {// SinglePassMaterial - mat.alpha = props.get(10, 1.0); - mat.alphaBlending = props.get(11, false); - - debugString += "Parsed a TriangleMethodMaterial(SinglePass): Name = '" + name + "' | Texture-Name = " + texture.name; - } - } - - var diffuseTexture:Texture2DBase; - var diffuseTex_addr:number = props.get(17, 0); - - returnedArray = this.getAssetByID(diffuseTex_addr, [AssetType.TEXTURE]); - - if ((!returnedArray[0]) && (diffuseTex_addr != 0)) { - this._blocks[blockID].addError("Could not find the DiffuseTexture (ID = " + diffuseTex_addr + " ) for this TriangleMethodMaterial"); - } - - if (returnedArray[0]) - diffuseTexture = returnedArray[1]; - - if (diffuseTexture) { - mat.diffuseTexture = diffuseTexture; - debugString += " | DiffuseTexture-Name = " + diffuseTexture.name; - } - - var normalTex_addr:number = props.get(3, 0); - - returnedArray = this.getAssetByID(normalTex_addr, [AssetType.TEXTURE]); - - if ((!returnedArray[0]) && (normalTex_addr != 0)) { - this._blocks[blockID].addError("Could not find the NormalTexture (ID = " + normalTex_addr + " ) for this TriangleMethodMaterial"); - } - - if (returnedArray[0]) { - normalTexture = returnedArray[1]; - debugString += " | NormalTexture-Name = " + normalTexture.name; - } - - var specTex_addr:number = props.get(21, 0); - returnedArray = this.getAssetByID(specTex_addr, [AssetType.TEXTURE]); - - if ((!returnedArray[0]) && (specTex_addr != 0)) { - this._blocks[blockID].addError("Could not find the SpecularTexture (ID = " + specTex_addr + " ) for this TriangleMethodMaterial"); - } - if (returnedArray[0]) { - specTexture = returnedArray[1]; - debugString += " | SpecularTexture-Name = " + specTexture.name; - } - - var lightPickerAddr:number = props.get(22, 0); - returnedArray = this.getAssetByID(lightPickerAddr, [AssetType.LIGHT_PICKER]) - - if ((!returnedArray[0]) && (lightPickerAddr)) { - this._blocks[blockID].addError("Could not find the LightPicker (ID = " + lightPickerAddr + " ) for this TriangleMethodMaterial"); - } else { - mat.lightPicker = returnedArray[1]; - //debugString+=" | Lightpicker-Name = "+LightPickerBase(returnedArray[1]).name; - } - - mat.smooth = props.get(5, true); - mat.mipmap = props.get(6, true); - mat.bothSides = props.get(7, false); - mat.alphaPremultiplied = props.get(8, false); - mat.blendMode = this.blendModeDic[props.get(9, 0)]; - mat.repeat = props.get(13, false); - - if (normalTexture) - mat.normalMap = normalTexture; - - if (specTexture) - mat.specularMap = specTexture; - - mat.alphaThreshold = props.get(12, 0.0); - mat.ambient = props.get(15, 1.0); - mat.diffuseColor = props.get(16, 0xffffff); - mat.specular = props.get(18, 1.0); - mat.gloss = props.get(19, 50); - mat.specularColor = props.get(20, 0xffffff); - - var methods_parsed:number = 0; - var targetID:number; - - while (methods_parsed < num_methods) { - var method_type:number; - method_type = this._newBlockBytes.readUnsignedShort(); - - props = this.parseProperties({1:AWDParser.BADDR, 2:AWDParser.BADDR, 3:AWDParser.BADDR, 101:this._propsNrType, 102:this._propsNrType, 103:this._propsNrType, 201:AWDParser.UINT32, 202:AWDParser.UINT32, 301:AWDParser.UINT16, 302:AWDParser.UINT16, 401:AWDParser.UINT8, 402:AWDParser.UINT8, 601:AWDParser.COLOR, 602:AWDParser.COLOR, 701:AWDParser.BOOL, 702:AWDParser.BOOL, 801:AWDParser.MTX4x4}); - - switch (method_type) { - case 999: //wrapper-Methods that will load a previous parsed EffektMethod returned - - targetID = props.get(1, 0); - returnedArray = this.getAssetByID(targetID, [AssetType.EFFECTS_METHOD]); - - if (!returnedArray[0]) { - this._blocks[blockID].addError("Could not find the EffectMethod (ID = " + targetID + " ) for this Material"); - } else { - mat.addEffectMethod(returnedArray[1]); - - debugString += " | EffectMethod-Name = " + ( returnedArray[1]).name; - } - - break; - - case 998: //wrapper-Methods that will load a previous parsed ShadowMapMethod - - targetID = props.get(1, 0); - returnedArray = this.getAssetByID(targetID, [AssetType.SHADOW_MAP_METHOD]); - - if (!returnedArray[0]) { - this._blocks[blockID].addError("Could not find the ShadowMethod (ID = " + targetID + " ) for this Material"); - } else { - mat.shadowMethod = returnedArray[1]; - debugString += " | ShadowMethod-Name = " + ( returnedArray[1]).name; - } - - break; - - case 1: //EnvMapAmbientMethod - targetID = props.get(1, 0); - returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE], "CubeTexture"); - if (!returnedArray[0]) - this._blocks[blockID].addError("Could not find the EnvMap (ID = " + targetID + " ) for this EnvMapAmbientMethodMaterial"); - mat.ambientMethod = new AmbientEnvMapMethod(returnedArray[1]); - debugString += " | AmbientEnvMapMethod | EnvMap-Name =" + ( returnedArray[1]).name; - break; - - case 51: //DepthDiffuseMethod - mat.diffuseMethod = new DiffuseDepthMethod(); - debugString += " | DiffuseDepthMethod"; - break; - case 52: //GradientDiffuseMethod - targetID = props.get(1, 0); - returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]); - if (!returnedArray[0]) - this._blocks[blockID].addError("Could not find the GradientDiffuseTexture (ID = " + targetID + " ) for this GradientDiffuseMethod"); - mat.diffuseMethod = new DiffuseGradientMethod(returnedArray[1]); - debugString += " | DiffuseGradientMethod | GradientDiffuseTexture-Name =" + ( returnedArray[1]).name; - break; - case 53: //WrapDiffuseMethod - mat.diffuseMethod = new DiffuseWrapMethod(props.get(101, 5)); - debugString += " | DiffuseWrapMethod"; - break; - case 54: //LightMapDiffuseMethod - targetID = props.get(1, 0); - returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]); - if (!returnedArray[0]) - this._blocks[blockID].addError("Could not find the LightMap (ID = " + targetID + " ) for this LightMapDiffuseMethod"); - mat.diffuseMethod = new DiffuseLightMapMethod(returnedArray[1], this.blendModeDic[props.get(401, 10)], false, mat.diffuseMethod); - debugString += " | DiffuseLightMapMethod | LightMapTexture-Name =" + ( returnedArray[1]).name; - break; - case 55: //CelDiffuseMethod - mat.diffuseMethod = new DiffuseCelMethod(props.get(401, 3), mat.diffuseMethod); - ( mat.diffuseMethod).smoothness = props.get(101, 0.1); - debugString += " | DiffuseCelMethod"; - break; - case 56: //SubSurfaceScatteringMethod -// mat.diffuseMethod = new DiffuseSubSurfaceMethod(); //depthMapSize and depthMapOffset ? -// ( mat.diffuseMethod).scattering = props.get(101, 0.2); -// ( mat.diffuseMethod).translucency = props.get(102, 1); -// ( mat.diffuseMethod).scatterColor = props.get(601, 0xffffff); -// debugString += " | DiffuseSubSurfaceMethod"; - break; - - case 101: //AnisotropicSpecularMethod - mat.specularMethod = new SpecularAnisotropicMethod(); - debugString += " | SpecularAnisotropicMethod"; - break; - case 102: //SpecularPhongMethod - mat.specularMethod = new SpecularPhongMethod(); - debugString += " | SpecularPhongMethod"; - break; - case 103: //CellSpecularMethod - mat.specularMethod = new SpecularCelMethod(props.get(101, 0.5), mat.specularMethod); - ( mat.specularMethod).smoothness = props.get(102, 0.1); - debugString += " | SpecularCelMethod"; - break; - case 104: //SpecularFresnelMethod - mat.specularMethod = new SpecularFresnelMethod(props.get(701, true), mat.specularMethod); - ( mat.specularMethod).fresnelPower = props.get(101, 5); - ( mat.specularMethod).normalReflectance = props.get(102, 0.1); - debugString += " | SpecularFresnelMethod"; - break; - case 151://HeightMapNormalMethod - thios is not implemented for now, but might appear later - break; - case 152: //SimpleWaterNormalMethod - targetID = props.get(1, 0); - returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]); - if (!returnedArray[0]) - this._blocks[blockID].addError("Could not find the SecoundNormalMap (ID = " + targetID + " ) for this SimpleWaterNormalMethod"); - if (!mat.normalMap) - this._blocks[blockID].addError("Could not find a normal Map on this Material to use with this SimpleWaterNormalMethod"); - - mat.normalMap = returnedArray[1]; - mat.normalMethod = new NormalSimpleWaterMethod(mat.normalMap, returnedArray[1]); - debugString += " | NormalSimpleWaterMethod | Second-NormalTexture-Name = " + ( returnedArray[1]).name; - break; - } - this.parseUserAttributes(); - methods_parsed += 1; - } - } - mat.extra = this.parseUserAttributes(); - this._pFinalizeAsset( mat, name); - - this._blocks[blockID].data = mat; - if (this._debug) { - console.log(debugString); - } - } - - //Block ID = 82 - private parseTexture(blockID:number):void - { - - var asset:Texture2DBase; - - this._blocks[blockID].name = this.parseVarStr(); - - var type:number = this._newBlockBytes.readUnsignedByte(); - var data_len:number; - - this._texture_users[this._cur_block_id.toString()] = []; - - // External - if (type == 0) { - data_len = this._newBlockBytes.readUnsignedInt(); - var url:string; - url = this._newBlockBytes.readUTFBytes(data_len); - this._pAddDependency(this._cur_block_id.toString(), new away.net.URLRequest(url), false, null, true); - - } else { - data_len = this._newBlockBytes.readUnsignedInt(); - - var data:ByteArray; - data = new ByteArray(); - this._newBlockBytes.readBytes(data, 0, data_len); - - // - // AWDParser - Fix for FireFox Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=715075 . - // - // Converting data to image here instead of parser - fix FireFox bug where image width / height is 0 when created from data - // This gives the browser time to initialise image width / height. - - this._pAddDependency(this._cur_block_id.toString(), null, false, ParserUtils.byteArrayToImage(data), true); - //this._pAddDependency(this._cur_block_id.toString(), null, false, data, true); - - } - - // Ignore for now - this.parseProperties(null); - this._blocks[blockID].extras = this.parseUserAttributes(); - this._pPauseAndRetrieveDependencies(); - this._blocks[blockID].data = asset; - - if (this._debug) { - var textureStylesNames:Array = ["external", "embed"] - console.log("Start parsing a " + textureStylesNames[type] + " Bitmap for Texture"); - } - - } - - //Block ID = 83 - private parseCubeTexture(blockID:number):void - { - //blockLength = block.len; - var data_len:number; - var asset:CubeTextureBase; - var i:number; - - this._cubeTextures = new Array(); - this._texture_users[ this._cur_block_id.toString() ] = []; - - var type:number = this._newBlockBytes.readUnsignedByte(); - - this._blocks[blockID].name = this.parseVarStr(); - - for (i = 0; i < 6; i++) { - this._texture_users[this._cur_block_id.toString()] = []; - this._cubeTextures.push(null); - - // External - if (type == 0) { - data_len = this._newBlockBytes.readUnsignedInt(); - var url:string; - url = this._newBlockBytes.readUTFBytes(data_len); - - this._pAddDependency(this._cur_block_id.toString() + "#" + i, new away.net.URLRequest(url), false, null, true); - } else { - - data_len = this._newBlockBytes.readUnsignedInt(); - var data:ByteArray; - data = new ByteArray(); - - this._newBlockBytes.readBytes(data, 0, data_len); - - this._pAddDependency(this._cur_block_id.toString() + "#" + i, null, false, ParserUtils.byteArrayToImage(data), true); - } - } - - // Ignore for now - this.parseProperties(null); - this._blocks[blockID].extras = this.parseUserAttributes(); - this._pPauseAndRetrieveDependencies(); - this._blocks[blockID].data = asset; - - if (this._debug) { - var textureStylesNames:Array = ["external", "embed"] - console.log("Start parsing 6 " + textureStylesNames[type] + " Bitmaps for CubeTexture"); - } - } - - //Block ID = 91 - private parseSharedMethodBlock(blockID:number):void - { - var asset:EffectMethodBase; - - this._blocks[blockID].name = this.parseVarStr(); - asset = this.parseSharedMethodList(blockID); - this.parseUserAttributes(); - this._blocks[blockID].data = asset; - this._pFinalizeAsset( asset, this._blocks[blockID].name); - this._blocks[blockID].data = asset; - - if (this._debug) { - console.log("Parsed a EffectMethod: Name = " + asset.name + " Type = " + asset); - } - } - - //Block ID = 92 - private parseShadowMethodBlock(blockID:number):void - { - var type:number; - var data_len:number; - var asset:ShadowMethodBase; - var shadowLightID:number; - this._blocks[blockID].name = this.parseVarStr(); - - shadowLightID = this._newBlockBytes.readUnsignedInt(); - var returnedArray:Array = this.getAssetByID(shadowLightID, [AssetType.LIGHT]); - - if (!returnedArray[0]) { - this._blocks[blockID].addError("Could not find the TargetLight (ID = " + shadowLightID + " ) for this ShadowMethod - ShadowMethod not created"); - return; - } - - asset = this.parseShadowMethodList( returnedArray[1], blockID); - - if (!asset) - return; - - this.parseUserAttributes(); // Ignore for now - this._pFinalizeAsset( asset, this._blocks[blockID].name); - this._blocks[blockID].data = asset; - - if (this._debug) { - console.log("Parsed a ShadowMapMethodMethod: Name = " + asset.name + " | Type = " + asset + " | Light-Name = ", ( returnedArray[1] ).name); - } - } - - - //Block ID = 253 - private parseCommand(blockID:number):void - { - var hasBlocks:boolean = ( this._newBlockBytes.readUnsignedByte() == 1 ); - var par_id:number = this._newBlockBytes.readUnsignedInt(); - var mtx:Matrix3D = this.parseMatrix3D(); - var name:string = this.parseVarStr(); - - var parentObject:away.containers.DisplayObjectContainer; - var targetObject:away.containers.DisplayObjectContainer; - - var returnedArray:Array = this.getAssetByID(par_id, [AssetType.CONTAINER, AssetType.LIGHT, AssetType.MESH]); - - if (returnedArray[0]) { - parentObject = returnedArray[1]; - } - - var numCommands:number = this._newBlockBytes.readShort(); - var typeCommand:number = this._newBlockBytes.readShort(); - - var props:AWDProperties = this.parseProperties({1:AWDParser.BADDR}); - - switch (typeCommand) { - case 1: - - var targetID:number = props.get(1, 0); - var returnedArrayTarget:Array = this.getAssetByID(targetID, [AssetType.LIGHT, AssetType.TEXTURE_PROJECTOR]); //for no only light is requested!!!! - - if ((!returnedArrayTarget[0]) && (targetID != 0)) { - this._blocks[blockID].addError("Could not find the light (ID = " + targetID + " ( for this CommandBock!"); - return; - } - - targetObject = returnedArrayTarget[1]; - - if (parentObject) { - parentObject.addChild(targetObject); - } - - targetObject.transform.matrix3D = mtx; - - break; - } - - if (targetObject) { - props = this.parseProperties({1:this._matrixNrType, 2:this._matrixNrType, 3:this._matrixNrType, 4:AWDParser.UINT8}); - - targetObject.pivot = new away.geom.Vector3D(props.get(1, 0), props.get(2, 0), props.get(3, 0)); - targetObject.extra = this.parseUserAttributes(); - - } - this._blocks[blockID].data = targetObject - - if (this._debug) { - console.log("Parsed a CommandBlock: Name = '" + name); - } - - } - - //blockID 255 - private parseMetaData(blockID:number):void - { - var props:AWDProperties = this.parseProperties({1:AWDParser.UINT32, 2:AWDParser.AWDSTRING, 3:AWDParser.AWDSTRING, 4:AWDParser.AWDSTRING, 5:AWDParser.AWDSTRING}); - - if (this._debug) { - console.log("Parsed a MetaDataBlock: TimeStamp = " + props.get(1, 0)); - console.log(" EncoderName = " + props.get(2, "unknown")); - console.log(" EncoderVersion = " + props.get(3, "unknown")); - console.log(" GeneratorName = " + props.get(4, "unknown")); - console.log(" GeneratorVersion = " + props.get(5, "unknown")); - } - } - - //blockID 254 - private parseNameSpace(blockID:number):void - { - var id:number = this._newBlockBytes.readUnsignedByte(); - var nameSpaceString:string = this.parseVarStr(); - if (this._debug) - console.log("Parsed a NameSpaceBlock: ID = " + id + " | String = " + nameSpaceString); - } - - //--Parser UTILS--------------------------------------------------------------------------- - - // this functions reads and creates a ShadowMethodMethod - private parseShadowMethodList(light:LightBase, blockID:number):ShadowMethodBase - { - - var methodType:number = this._newBlockBytes.readUnsignedShort(); - var shadowMethod:ShadowMethodBase; - var props:AWDProperties = this.parseProperties({1:AWDParser.BADDR, 2:AWDParser.BADDR, 3:AWDParser.BADDR, 101:this._propsNrType, 102:this._propsNrType, 103:this._propsNrType, 201:AWDParser.UINT32, 202:AWDParser.UINT32, 301:AWDParser.UINT16, 302:AWDParser.UINT16, 401:AWDParser.UINT8, 402:AWDParser.UINT8, 601:AWDParser.COLOR, 602:AWDParser.COLOR, 701:AWDParser.BOOL, 702:AWDParser.BOOL, 801:AWDParser.MTX4x4}); - - var targetID:number; - var returnedArray:Array - switch (methodType) { - // case 1001: //CascadeShadowMapMethod - // targetID = props.get(1, 0); - // returnedArray = getAssetByID(targetID, [AssetType.SHADOW_MAP_METHOD]); - // if (!returnedArray[0]) { - // _blocks[blockID].addError("Could not find the ShadowBaseMethod (ID = " + targetID + " ) for this CascadeShadowMapMethod - ShadowMethod not created"); - // return shadowMethod; - // } - // shadowMethod = new CascadeShadowMapMethod(returnedArray[1]); - // break; - case 1002: //ShadowNearMethod - targetID = props.get(1, 0); - returnedArray = this.getAssetByID(targetID, [AssetType.SHADOW_MAP_METHOD]); - if (!returnedArray[0]) { - this._blocks[blockID].addError("Could not find the ShadowBaseMethod (ID = " + targetID + " ) for this ShadowNearMethod - ShadowMethod not created"); - return shadowMethod; - } - shadowMethod = new ShadowNearMethod( returnedArray[1]); - break; - case 1101: //ShadowFilteredMethod - - shadowMethod = new ShadowFilteredMethod( light); - ( shadowMethod).alpha = props.get(101, 1); - ( shadowMethod).epsilon = props.get(102, 0.002); - break; - - case 1102: //ShadowDitheredMethod - - - shadowMethod = new ShadowDitheredMethod( light, props.get(201, 5)); - ( shadowMethod).alpha = props.get(101, 1); - ( shadowMethod).epsilon = props.get(102, 0.002); - ( shadowMethod).range = props.get(103, 1); - - break; - case 1103: //ShadowSoftMethod - - shadowMethod = new ShadowSoftMethod( light, props.get(201, 5)); - ( shadowMethod).alpha = props.get(101, 1); - ( shadowMethod).epsilon = props.get(102, 0.002); - ( shadowMethod).range = props.get(103, 1); - - break; - case 1104: //ShadowHardMethod - shadowMethod = new ShadowHardMethod(light); - ( shadowMethod).alpha = props.get(101, 1); - ( shadowMethod).epsilon = props.get(102, 0.002); - break; - - } - this.parseUserAttributes(); - return shadowMethod; - } - - //Block ID 101 - private parseSkeleton(blockID:number /*uint*/):void - { - var name:string = this.parseVarStr(); - var num_joints:number /*uint*/ = this._newBlockBytes.readUnsignedShort(); - var skeleton:Skeleton = new Skeleton(); - this.parseProperties(null); // Discard properties for now - - var joints_parsed:number /*uint*/ = 0; - while (joints_parsed < num_joints) { - var joint:SkeletonJoint; - var ibp:Matrix3D; - // Ignore joint id - this._newBlockBytes.readUnsignedShort(); - joint = new SkeletonJoint(); - joint.parentIndex = this._newBlockBytes.readUnsignedShort() - 1; // 0=null in AWD - joint.name = this.parseVarStr(); - - ibp = this.parseMatrix3D(); - joint.inverseBindPose = ibp.rawData; - // Ignore joint props/attributes for now - this.parseProperties(null); - this.parseUserAttributes(); - skeleton.joints.push(joint); - joints_parsed++; - } - - // Discard attributes for now - this.parseUserAttributes(); - this._pFinalizeAsset(skeleton, name); - this._blocks[blockID].data = skeleton; - if (this._debug) - console.log("Parsed a Skeleton: Name = " + skeleton.name + " | Number of Joints = " + joints_parsed); - } - - //Block ID = 102 - private parseSkeletonPose(blockID:number /*uint*/):void - { - var name:string = this.parseVarStr(); - var num_joints:number /*uint*/ = this._newBlockBytes.readUnsignedShort(); - this.parseProperties(null); // Ignore properties for now - - var pose:SkeletonPose = new SkeletonPose(); - - var joints_parsed:number /*uint*/ = 0; - while (joints_parsed < num_joints) { - var joint_pose:JointPose; - var has_transform:number /*uint*/; - joint_pose = new JointPose(); - has_transform = this._newBlockBytes.readUnsignedByte(); - if (has_transform == 1) { - var mtx_data:Array = this.parseMatrix43RawData(); - - var mtx:Matrix3D = new Matrix3D(mtx_data); - joint_pose.orientation.fromMatrix(mtx); - joint_pose.translation.copyFrom(mtx.position); - - pose.jointPoses[joints_parsed] = joint_pose; - } - joints_parsed++; - } - // Skip attributes for now - this.parseUserAttributes(); - this._pFinalizeAsset(pose, name); - this._blocks[blockID].data = pose; - if (this._debug) - console.log("Parsed a SkeletonPose: Name = " + pose.name + " | Number of Joints = " + joints_parsed); - } - - //blockID 103 - private parseSkeletonAnimation(blockID:number /*uint*/):void - { - var frame_dur:number; - var pose_addr:number /*uint*/; - var name:string = this.parseVarStr(); - var clip:SkeletonClipNode = new SkeletonClipNode(); - var num_frames:number /*uint*/ = this._newBlockBytes.readUnsignedShort(); - this.parseProperties(null); // Ignore properties for now - - var frames_parsed:number /*uint*/ = 0; - var returnedArray:Array; - while (frames_parsed < num_frames) { - pose_addr = this._newBlockBytes.readUnsignedInt(); - frame_dur = this._newBlockBytes.readUnsignedShort(); - returnedArray = this.getAssetByID(pose_addr, [AssetType.SKELETON_POSE]); - if (!returnedArray[0]) - this._blocks[blockID].addError("Could not find the SkeletonPose Frame # " + frames_parsed + " (ID = " + pose_addr + " ) for this SkeletonClipNode"); - else - clip.addFrame( this._blocks[pose_addr].data, frame_dur); - frames_parsed++; - } - if (clip.frames.length == 0) { - this._blocks[blockID].addError("Could not this SkeletonClipNode, because no Frames where set."); - return; - } - // Ignore attributes for now - this.parseUserAttributes(); - this._pFinalizeAsset(clip, name); - this._blocks[blockID].data = clip; - if (this._debug) - console.log("Parsed a SkeletonClipNode: Name = " + clip.name + " | Number of Frames = " + clip.frames.length); - } - - //Block ID = 111 / Block ID = 112 - private parseMeshPoseAnimation(blockID:number /*uint*/, poseOnly:boolean = false):void - { - var num_frames:number /*uint*/ = 1; - var num_submeshes:number /*uint*/; - var frames_parsed:number /*uint*/; - var subMeshParsed:number /*uint*/; - var frame_dur:number; - var x:number; - var y:number; - var z:number; - var str_len:number; - var str_end:number; - var geometry:Geometry; - var subGeom:TriangleSubGeometry; - var idx:number /*int*/ = 0; - var clip:VertexClipNode = new VertexClipNode(); - var indices:Array /*uint*/; - var verts:Array; - var num_Streams:number /*int*/ = 0; - var streamsParsed:number /*int*/ = 0; - var streamtypes:Array /*int*/ = new Array() /*int*/; - var props:AWDProperties; - var thisGeo:Geometry; - var name:string = this.parseVarStr(); - var geoAdress:number /*int*/ = this._newBlockBytes.readUnsignedInt(); - var returnedArray:Array = this.getAssetByID(geoAdress, [AssetType.GEOMETRY]); - if (!returnedArray[0]) { - this._blocks[blockID].addError("Could not find the target-Geometry-Object " + geoAdress + " ) for this VertexClipNode"); - return; - } - var uvs:Array> = this.getUVForVertexAnimation(geoAdress); - if (!poseOnly) - num_frames = this._newBlockBytes.readUnsignedShort(); - - num_submeshes = this._newBlockBytes.readUnsignedShort(); - num_Streams = this._newBlockBytes.readUnsignedShort(); - streamsParsed = 0; - while (streamsParsed < num_Streams) { - streamtypes.push(this._newBlockBytes.readUnsignedShort()); - streamsParsed++; - } - props = this.parseProperties({1:AWDParser.BOOL, 2:AWDParser.BOOL}); - - clip.looping = props.get(1, true); - clip.stitchFinalFrame = props.get(2, false); - - frames_parsed = 0; - while (frames_parsed < num_frames) { - frame_dur = this._newBlockBytes.readUnsignedShort(); - geometry = new Geometry(); - subMeshParsed = 0; - while (subMeshParsed < num_submeshes) { - streamsParsed = 0; - str_len = this._newBlockBytes.readUnsignedInt(); - str_end = this._newBlockBytes.position + str_len; - while (streamsParsed < num_Streams) { - if (streamtypes[streamsParsed] == 1) { - indices = ( returnedArray[1]).subGeometries[subMeshParsed].indices; - verts = new Array(); - idx = 0; - while (this._newBlockBytes.position < str_end) { - x = this.readNumber(this._accuracyGeo) - y = this.readNumber(this._accuracyGeo) - z = this.readNumber(this._accuracyGeo) - verts[idx++] = x; - verts[idx++] = y; - verts[idx++] = z; - } - subGeom = new TriangleSubGeometry(true); - subGeom.updateIndices(indices); - subGeom.updatePositions(verts); - subGeom.updateUVs(uvs[subMeshParsed]); - subGeom.updateVertexNormals(null); - subGeom.updateVertexTangents(null); - subGeom.autoDeriveNormals = false; - subGeom.autoDeriveTangents = false; - subMeshParsed++; - geometry.addSubGeometry(subGeom) - } else - this._newBlockBytes.position = str_end; - streamsParsed++; - } - } - clip.addFrame(geometry, frame_dur); - frames_parsed++; - } - this.parseUserAttributes(); - this._pFinalizeAsset(clip, name); - - this._blocks[blockID].data = clip; - if (this._debug) - console.log("Parsed a VertexClipNode: Name = " + clip.name + " | Target-Geometry-Name = " + ( returnedArray[1]).name + " | Number of Frames = " + clip.frames.length); - } - - //BlockID 113 - private parseVertexAnimationSet(blockID:number /*uint*/):void - { - var poseBlockAdress:number /*int*/ - var outputString:string = ""; - var name:string = this.parseVarStr(); - var num_frames:number /*uint*/ = this._newBlockBytes.readUnsignedShort(); - var props:AWDProperties = this.parseProperties({1:AWDParser.UINT16}); - var frames_parsed:number /*uint*/ = 0; - var skeletonFrames:Array = new Array(); - var vertexFrames:Array = new Array(); - while (frames_parsed < num_frames) { - poseBlockAdress = this._newBlockBytes.readUnsignedInt(); - var returnedArray:Array = this.getAssetByID(poseBlockAdress, [AssetType.ANIMATION_NODE]); - if (!returnedArray[0]) - this._blocks[blockID].addError("Could not find the AnimationClipNode Nr " + frames_parsed + " ( " + poseBlockAdress + " ) for this AnimationSet"); - else { - if (returnedArray[1] instanceof VertexClipNode) - vertexFrames.push(returnedArray[1]) - if (returnedArray[1] instanceof SkeletonClipNode) - skeletonFrames.push(returnedArray[1]) - } - frames_parsed++; - } - if ((vertexFrames.length == 0) && (skeletonFrames.length == 0)) { - this._blocks[blockID].addError("Could not create this AnimationSet, because it contains no animations"); - return; - } - this.parseUserAttributes(); - if (vertexFrames.length > 0) { - var newVertexAnimationSet:VertexAnimationSet = new VertexAnimationSet(); - for (var i:number /*int*/ = 0; i < vertexFrames.length; i++) - newVertexAnimationSet.addAnimation(vertexFrames[i]); - this._pFinalizeAsset(newVertexAnimationSet, name); - this._blocks[blockID].data = newVertexAnimationSet; - if (this._debug) - console.log("Parsed a VertexAnimationSet: Name = " + name + " | Animations = " + newVertexAnimationSet.animations.length + " | Animation-Names = " + newVertexAnimationSet.animationNames.toString()); - - } else if (skeletonFrames.length > 0) { - returnedArray = this.getAssetByID(poseBlockAdress, [AssetType.ANIMATION_NODE]); - var newSkeletonAnimationSet:SkeletonAnimationSet = new SkeletonAnimationSet(props.get(1, 4)); //props.get(1,4)); - for (var i:number /*int*/ = 0; i < skeletonFrames.length; i++) - newSkeletonAnimationSet.addAnimation(skeletonFrames[i]); - this._pFinalizeAsset(newSkeletonAnimationSet, name); - this._blocks[blockID].data = newSkeletonAnimationSet; - if (this._debug) - console.log("Parsed a SkeletonAnimationSet: Name = " + name + " | Animations = " + newSkeletonAnimationSet.animations.length + " | Animation-Names = " + newSkeletonAnimationSet.animationNames.toString()); - - } - } - - //BlockID 122 - private parseAnimatorSet(blockID:number /*uint*/):void - { - var targetMesh:Mesh; - var animSetBlockAdress:number /*int*/ - var targetAnimationSet:AnimationSetBase; - var outputString:string = ""; - var name:string = this.parseVarStr(); - var type:number /*uint*/ = this._newBlockBytes.readUnsignedShort(); - - var props:AWDProperties = this.parseProperties({1:AWDParser.BADDR}); - - animSetBlockAdress = this._newBlockBytes.readUnsignedInt(); - var targetMeshLength:number /*uint*/ = this._newBlockBytes.readUnsignedShort(); - var meshAdresses:Array /*uint*/ = new Array() /*uint*/; - for (var i:number /*int*/ = 0; i < targetMeshLength; i++) - meshAdresses.push(this._newBlockBytes.readUnsignedInt()); - - var activeState:number /*uint*/ = this._newBlockBytes.readUnsignedShort(); - var autoplay:boolean = ( this._newBlockBytes.readUnsignedByte() == 1 ); - this.parseUserAttributes(); - this.parseUserAttributes(); - - var returnedArray:Array; - var targetMeshes:Array = new Array(); - - for (i = 0; i < meshAdresses.length; i++) { - returnedArray = this.getAssetByID(meshAdresses[i], [AssetType.MESH]); - if (returnedArray[0]) - targetMeshes.push( returnedArray[1]); - } - returnedArray = this.getAssetByID(animSetBlockAdress, [AssetType.ANIMATION_SET]); - if (!returnedArray[0]) { - this._blocks[blockID].addError("Could not find the AnimationSet ( " + animSetBlockAdress + " ) for this Animator");; - return - } - targetAnimationSet = returnedArray[1]; - var thisAnimator:AnimatorBase; - if (type == 1) { - - returnedArray = this.getAssetByID(props.get(1, 0), [AssetType.SKELETON]); - if (!returnedArray[0]) { - this._blocks[blockID].addError("Could not find the Skeleton ( " + props.get(1, 0) + " ) for this Animator"); - return - } - thisAnimator = new SkeletonAnimator( targetAnimationSet, returnedArray[1]); - - } else if (type == 2) - thisAnimator = new VertexAnimator( targetAnimationSet); - - this._pFinalizeAsset(thisAnimator, name); - this._blocks[blockID].data = thisAnimator; - for (i = 0; i < targetMeshes.length; i++) { - if (type == 1) - targetMeshes[i].animator = ( thisAnimator); - if (type == 2) - targetMeshes[i].animator = ( thisAnimator); - - } - if (this._debug) - console.log("Parsed a Animator: Name = " + name); - } - - // this functions reads and creates a EffectMethod - private parseSharedMethodList(blockID:number):EffectMethodBase - { - - var methodType:number = this._newBlockBytes.readUnsignedShort(); - var effectMethodReturn:EffectMethodBase; - - var props:AWDProperties = this.parseProperties({1:AWDParser.BADDR, 2:AWDParser.BADDR, 3:AWDParser.BADDR, 101:this._propsNrType, 102:this._propsNrType, 103:this._propsNrType, 104:this._propsNrType, 105:this._propsNrType, 106:this._propsNrType, 107:this._propsNrType, 201:AWDParser.UINT32, 202:AWDParser.UINT32, 301:AWDParser.UINT16, 302:AWDParser.UINT16, 401:AWDParser.UINT8, 402:AWDParser.UINT8, 601:AWDParser.COLOR, 602:AWDParser.COLOR, 701:AWDParser.BOOL, 702:AWDParser.BOOL}); - var targetID:number; - var returnedArray:Array; - - switch (methodType) { - // Effect Methods - case 401: //ColorMatrix - effectMethodReturn = new EffectColorMatrixMethod(props.get(101, new Array(0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1))); - break; - case 402: //ColorTransform - effectMethodReturn = new EffectColorTransformMethod(); - var offCol:number /*uint*/ = props.get(601, 0x00000000); - ( effectMethodReturn).colorTransform = new ColorTransform(props.get(102, 1), props.get(103, 1), props.get(104, 1), props.get(101, 1), ((offCol >> 16) & 0xFF), ((offCol >> 8) & 0xFF), (offCol & 0xFF), ((offCol >> 24) & 0xFF)); - break; - case 403: //EnvMap - - targetID = props.get(1, 0); - console.log('ENV MAP', targetID); - - - returnedArray = this.getAssetByID(targetID, [ AssetType.TEXTURE ], "CubeTexture"); - if (!returnedArray[0]) - this._blocks[blockID].addError("Could not find the EnvMap (ID = " + targetID + " ) for this EnvMapMethod"); - effectMethodReturn = new EffectEnvMapMethod( returnedArray[1], props.get(101, 1)); - targetID = props.get(2, 0); - if (targetID > 0) { - returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]); - if (!returnedArray[0]) - this._blocks[blockID].addError("Could not find the Mask-texture (ID = " + targetID + " ) for this EnvMapMethod"); - - // Todo: test mask with EnvMapMethod - //( effectMethodReturn).mask = returnedArray[1]; - } - break; - case 404: //LightMapMethod - targetID = props.get(1, 0); - returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]); - if (!returnedArray[0]) - this._blocks[blockID].addError("Could not find the LightMap (ID = " + targetID + " ) for this LightMapMethod"); - effectMethodReturn = new EffectLightMapMethod(returnedArray[1], this.blendModeDic[props.get(401, 10)]); //usesecondaryUV not set - break; - // case 405: //ProjectiveTextureMethod - // targetID = props.get(1, 0); - // returnedArray = getAssetByID(targetID, [AssetType.TEXTURE_PROJECTOR]); - // if (!returnedArray[0]) - // _blocks[blockID].addError("Could not find the TextureProjector (ID = " + targetID + " ) for this ProjectiveTextureMethod"); - // effectMethodReturn = new ProjectiveTextureMethod(returnedArray[1], blendModeDic[props.get(401, 10)]); - // break; - case 406: //RimLightMethod - effectMethodReturn = new EffectRimLightMethod(props.get(601, 0xffffff), props.get(101, 0.4), props.get(101, 2)); //blendMode - break; - case 407: //AlphaMaskMethod - targetID = props.get(1, 0); - returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE]); - if (!returnedArray[0]) - this._blocks[blockID].addError("Could not find the Alpha-texture (ID = " + targetID + " ) for this AlphaMaskMethod"); - effectMethodReturn = new EffectAlphaMaskMethod(returnedArray[1], props.get(701, false)); - break; - // case 408: //RefractionEnvMapMethod - // targetID = props.get(1, 0); - // returnedArray = getAssetByID(targetID, [AssetType.TEXTURE], "CubeTexture"); - // if (!returnedArray[0]) - // _blocks[blockID].addError("Could not find the EnvMap (ID = " + targetID + " ) for this RefractionEnvMapMethod"); - // effectMethodReturn = new RefractionEnvMapMethod(returnedArray[1], props.get(101, 0.1), props.get(102, 0.01), props.get(103, 0.01), props.get(104, 0.01)); - // RefractionEnvMapMethod(effectMethodReturn).alpha = props.get(104, 1); - // break; - // case 409: //OutlineMethod - // effectMethodReturn = new OutlineMethod(props.get(601, 0x00000000), props.get(101, 1), props.get(701, true), props.get(702, false)); - // break; - case 410: //FresnelEnvMapMethod - targetID = props.get(1, 0); - returnedArray = this.getAssetByID(targetID, [AssetType.TEXTURE], "CubeTexture"); - if (!returnedArray[0]) - this._blocks[blockID].addError("Could not find the EnvMap (ID = " + targetID + " ) for this FresnelEnvMapMethod"); - effectMethodReturn = new EffectFresnelEnvMapMethod(returnedArray[1], props.get(101, 1)); - break; - case 411: //FogMethod - effectMethodReturn = new EffectFogMethod(props.get(101, 0), props.get(102, 1000), props.get(601, 0x808080)); - break; - - } - this.parseUserAttributes(); - return effectMethodReturn; - - } - - private parseUserAttributes():Object - { - var attributes:Object; - var list_len:number; - var attibuteCnt:number; - - list_len = this._newBlockBytes.readUnsignedInt(); - - if (list_len > 0) { - - var list_end:number; - - attributes = {}; - - list_end = this._newBlockBytes.position + list_len; - - while (this._newBlockBytes.position < list_end) { - var ns_id:number; - var attr_key:string; - var attr_type:number; - var attr_len:number; - var attr_val:any; - - // TODO: Properly tend to namespaces in attributes - ns_id = this._newBlockBytes.readUnsignedByte(); - attr_key = this.parseVarStr(); - attr_type = this._newBlockBytes.readUnsignedByte(); - attr_len = this._newBlockBytes.readUnsignedInt(); - - if ((this._newBlockBytes.position + attr_len) > list_end) { - console.log(" Error in reading attribute # " + attibuteCnt + " = skipped to end of attribute-list"); - this._newBlockBytes.position = list_end; - return attributes; - } - - switch (attr_type) { - case AWDParser.AWDSTRING: - attr_val = this._newBlockBytes.readUTFBytes(attr_len); - break; - case AWDParser.INT8: - attr_val = this._newBlockBytes.readByte(); - break; - case AWDParser.INT16: - attr_val = this._newBlockBytes.readShort(); - break; - case AWDParser.INT32: - attr_val = this._newBlockBytes.readInt(); - break; - case AWDParser.BOOL: - case AWDParser.UINT8: - attr_val = this._newBlockBytes.readUnsignedByte(); - break; - case AWDParser.UINT16: - attr_val = this._newBlockBytes.readUnsignedShort(); - break; - case AWDParser.UINT32: - case AWDParser.BADDR: - attr_val = this._newBlockBytes.readUnsignedInt(); - break; - case AWDParser.FLOAT32: - attr_val = this._newBlockBytes.readFloat(); - break; - case AWDParser.FLOAT64: - attr_val = this._newBlockBytes.readDouble(); - break; - default: - attr_val = 'unimplemented attribute type ' + attr_type; - this._newBlockBytes.position += attr_len; - break; - } - - if (this._debug) { - console.log("attribute = name: " + attr_key + " / value = " + attr_val); - } - - attributes[attr_key] = attr_val; - attibuteCnt += 1; - } - } - - return attributes; - } - - private parseProperties(expected:Object):AWDProperties - { - var list_end:number; - var list_len:number; - var propertyCnt:number = 0; - var props:AWDProperties = new AWDProperties(); - - list_len = this._newBlockBytes.readUnsignedInt(); - list_end = this._newBlockBytes.position + list_len; - - if (expected) { - - while (this._newBlockBytes.position < list_end) { - var len:number; - var key:number; - var type:number; - - key = this._newBlockBytes.readUnsignedShort(); - len = this._newBlockBytes.readUnsignedInt(); - - if ((this._newBlockBytes.position + len) > list_end) { - console.log(" Error in reading property # " + propertyCnt + " = skipped to end of propertie-list"); - this._newBlockBytes.position = list_end; - return props; - } - - if (expected.hasOwnProperty(key.toString())) { - type = expected[key]; - props.set(key, this.parseAttrValue(type, len)); - } else { - this._newBlockBytes.position += len; - } - - propertyCnt += 1; - - } - } else { - this._newBlockBytes.position = list_end; - } - - return props; - - } - - private parseAttrValue(type:number, len:number):any - { - var elem_len:number; - var read_func:Function; - - switch (type) { - - case AWDParser.BOOL: - case AWDParser.INT8: - elem_len = 1; - read_func = this._newBlockBytes.readByte; - break; - - case AWDParser.INT16: - elem_len = 2; - read_func = this._newBlockBytes.readShort; - break; - - case AWDParser.INT32: - elem_len = 4; - read_func = this._newBlockBytes.readInt; - break; - - case AWDParser.UINT8: - elem_len = 1; - read_func = this._newBlockBytes.readUnsignedByte; - break; - - case AWDParser.UINT16: - elem_len = 2; - read_func = this._newBlockBytes.readUnsignedShort; - break; - - case AWDParser.UINT32: - case AWDParser.COLOR: - case AWDParser.BADDR: - elem_len = 4; - read_func = this._newBlockBytes.readUnsignedInt; - break; - - case AWDParser.FLOAT32: - elem_len = 4; - read_func = this._newBlockBytes.readFloat; - break; - - case AWDParser.FLOAT64: - elem_len = 8; - read_func = this._newBlockBytes.readDouble; - break; - - case AWDParser.AWDSTRING: - return this._newBlockBytes.readUTFBytes(len); - - case AWDParser.VECTOR2x1: - case AWDParser.VECTOR3x1: - case AWDParser.VECTOR4x1: - case AWDParser.MTX3x2: - case AWDParser.MTX3x3: - case AWDParser.MTX4x3: - case AWDParser.MTX4x4: - elem_len = 8; - read_func = this._newBlockBytes.readDouble; - break; - - } - - if (elem_len < len) { - var list:Array = []; - var num_read:number = 0; - var num_elems:number = len/elem_len; - - while (num_read < num_elems) { - list.push(read_func.apply(this._newBlockBytes)); // list.push(read_func()); - num_read++; - } - - return list; - } else { - - var val:any = read_func.apply(this._newBlockBytes);//read_func(); - return val; - } - } - - private parseHeader():void - { - var flags:number; - var body_len:number; - - this._byteData.position = 3; // Skip magic string and parse version - - this._version[0] = this._byteData.readUnsignedByte(); - this._version[1] = this._byteData.readUnsignedByte(); - - flags = this._byteData.readUnsignedShort(); // Parse bit flags - - this._streaming = bitFlags.test(flags, bitFlags.FLAG1); - - if ((this._version[0] == 2) && (this._version[1] == 1)) { - this._accuracyMatrix = bitFlags.test(flags, bitFlags.FLAG2); - this._accuracyGeo = bitFlags.test(flags, bitFlags.FLAG3); - this._accuracyProps = bitFlags.test(flags, bitFlags.FLAG4); - } - - // if we set _accuracyOnBlocks, the precision-values are read from each block-header. - - // set storagePrecision types - this._geoNrType = AWDParser.FLOAT32; - - if (this._accuracyGeo) { - this._geoNrType = AWDParser.FLOAT64; - } - - this._matrixNrType = AWDParser.FLOAT32; - - if (this._accuracyMatrix) { - this._matrixNrType = AWDParser.FLOAT64; - } - - this._propsNrType = AWDParser.FLOAT32; - - if (this._accuracyProps) { - this._propsNrType = AWDParser.FLOAT64; - } - - this._compression = this._byteData.readUnsignedByte(); // compression - - if (this._debug) { - console.log("Import AWDFile of version = " + this._version[0] + " - " + this._version[1]); - console.log("Global Settings = Compression = " + this._compression + " | Streaming = " + this._streaming + " | Matrix-Precision = " + this._accuracyMatrix + " | Geometry-Precision = " + this._accuracyGeo + " | Properties-Precision = " + this._accuracyProps); - } - - // Check file integrity - body_len = this._byteData.readUnsignedInt(); - if (!this._streaming && body_len != this._byteData.getBytesAvailable()) { - this._pDieWithError('AWD2 body length does not match header integrity field'); - } - - } - // Helper - functions - private getUVForVertexAnimation(meshID:number /*uint*/):Array> - { - if (this._blocks[meshID].data instanceof Mesh) - meshID = this._blocks[meshID].geoID; - if (this._blocks[meshID].uvsForVertexAnimation) - return this._blocks[meshID].uvsForVertexAnimation; - var geometry:Geometry = ( this._blocks[meshID].data); - var geoCnt:number /*int*/ = 0; - var ud:Array; - var uStride:number /*uint*/; - var uOffs:number /*uint*/; - var numPoints:number /*uint*/; - var i:number /*int*/; - var newUvs:Array; - var sub_geom:TriangleSubGeometry; - this._blocks[meshID].uvsForVertexAnimation = new Array>(); - while (geoCnt < geometry.subGeometries.length) { - newUvs = new Array(); - sub_geom = geometry.subGeometries[geoCnt]; - numPoints = sub_geom.numVertices; - ud = sub_geom.uvs; - uStride = sub_geom.getStride(TriangleSubGeometry.UV_DATA); - uOffs = sub_geom.getOffset(TriangleSubGeometry.UV_DATA); - for (i = 0; i < numPoints; i++) { - newUvs.push(ud[uOffs + i*uStride + 0]); - newUvs.push(ud[uOffs + i*uStride + 1]); - } - this._blocks[meshID].uvsForVertexAnimation.push(newUvs); - geoCnt++; - } - return this._blocks[meshID].uvsForVertexAnimation; - } - - private parseVarStr():string - { - - var len:number = this._newBlockBytes.readUnsignedShort(); - return this._newBlockBytes.readUTFBytes(len); - } - - private getAssetByID(assetID:number, assetTypesToGet:Array, extraTypeInfo:string = "SingleTexture"):Array - { - var returnArray:Array = new Array(); - var typeCnt:number = 0; - if (assetID > 0) { - if (this._blocks[assetID]) { - if (this._blocks[assetID].data) { - while (typeCnt < assetTypesToGet.length) { - - var iasset:away.library.IAsset = this._blocks[assetID].data; - - if (iasset.assetType == assetTypesToGet[typeCnt]) { - //if the right assetType was found - if ((assetTypesToGet[typeCnt] == AssetType.TEXTURE) && (extraTypeInfo == "CubeTexture")) { - if (this._blocks[assetID].data instanceof ImageCubeTexture) { - returnArray.push(true); - returnArray.push(this._blocks[assetID].data); - return returnArray; - } - } - if ((assetTypesToGet[typeCnt] == AssetType.TEXTURE) && (extraTypeInfo == "SingleTexture")) { - if (this._blocks[assetID].data instanceof ImageTexture) { - returnArray.push(true); - returnArray.push(this._blocks[assetID].data); - return returnArray; - } - } else { - returnArray.push(true); - returnArray.push(this._blocks[assetID].data); - return returnArray; - - } - } - //if ((assetTypesToGet[typeCnt] == AssetType.GEOMETRY) && (IAsset(_blocks[assetID].data).assetType == AssetType.MESH)) { - if ((assetTypesToGet[typeCnt] == AssetType.GEOMETRY) && (iasset.assetType == AssetType.MESH)) { - - var mesh:Mesh = this._blocks[assetID].data - - returnArray.push(true); - returnArray.push(mesh.geometry); - return returnArray; - - } - - typeCnt++; - } - } - } - } - // if the has not returned anything yet, the asset is not found, or the found asset is not the right type. - returnArray.push(false); - returnArray.push(this.getDefaultAsset(assetTypesToGet[0], extraTypeInfo)); - return returnArray; - } - - private getDefaultAsset(assetType:string, extraTypeInfo:string):away.library.IAsset - { - switch (true) { - case (assetType == AssetType.TEXTURE): - if (extraTypeInfo == "CubeTexture") - return this.getDefaultCubeTexture(); - if (extraTypeInfo == "SingleTexture") - return this.getDefaultTexture(); - break; - case (assetType == AssetType.MATERIAL): - return this.getDefaultMaterial() - break; - default: - break; - } - - return null; - } - - private getDefaultMaterial():away.library.IAsset - { - if (!this._defaultBitmapMaterial) - this._defaultBitmapMaterial = DefaultMaterialManager.getDefaultMaterial(); - - return this._defaultBitmapMaterial; - } - - private getDefaultTexture():away.library.IAsset - { - if (!this._defaultTexture) - this._defaultTexture = DefaultMaterialManager.getDefaultTexture(); - - return this._defaultTexture; - - } - - private getDefaultCubeTexture():away.library.IAsset - { - if (!this._defaultCubeTexture) { - var defaultBitmap:away.base.BitmapData = DefaultMaterialManager.createCheckeredBitmapData(); - - this._defaultCubeTexture = new BitmapCubeTexture(defaultBitmap, defaultBitmap, defaultBitmap, defaultBitmap, defaultBitmap, defaultBitmap); - this._defaultCubeTexture.name = "defaultCubeTexture"; - } - - return this._defaultCubeTexture; - } - - private readNumber(precision:boolean = false):number - { - if (precision) - return this._newBlockBytes.readDouble(); - return this._newBlockBytes.readFloat(); - - } - - private parseMatrix3D():Matrix3D - { - return new Matrix3D(this.parseMatrix43RawData()); - } - - private parseMatrix32RawData():Array - { - var i:number; - var mtx_raw:Array = new Array(6); - for (i = 0; i < 6; i++) { - mtx_raw[i] = this._newBlockBytes.readFloat(); - } - - return mtx_raw; - } - - private parseMatrix43RawData():Array - { - var mtx_raw:Array = new Array(16); - - mtx_raw[0] = this.readNumber(this._accuracyMatrix); - mtx_raw[1] = this.readNumber(this._accuracyMatrix); - mtx_raw[2] = this.readNumber(this._accuracyMatrix); - mtx_raw[3] = 0.0; - mtx_raw[4] = this.readNumber(this._accuracyMatrix); - mtx_raw[5] = this.readNumber(this._accuracyMatrix); - mtx_raw[6] = this.readNumber(this._accuracyMatrix); - mtx_raw[7] = 0.0; - mtx_raw[8] = this.readNumber(this._accuracyMatrix); - mtx_raw[9] = this.readNumber(this._accuracyMatrix); - mtx_raw[10] = this.readNumber(this._accuracyMatrix); - mtx_raw[11] = 0.0; - mtx_raw[12] = this.readNumber(this._accuracyMatrix); - mtx_raw[13] = this.readNumber(this._accuracyMatrix); - mtx_raw[14] = this.readNumber(this._accuracyMatrix); - mtx_raw[15] = 1.0; - - //TODO: fix max exporter to remove NaN values in joint 0 inverse bind pose - - if (isNaN(mtx_raw[0])) { - mtx_raw[0] = 1; - mtx_raw[1] = 0; - mtx_raw[2] = 0; - mtx_raw[4] = 0; - mtx_raw[5] = 1; - mtx_raw[6] = 0; - mtx_raw[8] = 0; - mtx_raw[9] = 0; - mtx_raw[10] = 1; - mtx_raw[12] = 0; - mtx_raw[13] = 0; - mtx_raw[14] = 0; - - } - - return mtx_raw; - } - - } - -} - -class AWDBlock -{ - public id:number; - public name:string; - public data:any; - public len:any; - public geoID:number; - public extras:Object; - public bytes:away.utils.ByteArray; - public errorMessages:Array; - public uvsForVertexAnimation:Array>; - - constructor() - { - } - - public dispose() - { - - this.id = null; - this.bytes = null; - this.errorMessages = null; - this.uvsForVertexAnimation = null; - - } - - public addError(errorMsg:string):void - { - if (!this.errorMessages) - this.errorMessages = new Array(); - this.errorMessages.push(errorMsg); - } -} - -class bitFlags -{ - public static FLAG1:number = 1; - public static FLAG2:number = 2; - public static FLAG3:number = 4; - public static FLAG4:number = 8; - public static FLAG5:number = 16; - public static FLAG6:number = 32; - public static FLAG7:number = 64; - public static FLAG8:number = 128; - public static FLAG9:number = 256; - public static FLAG10:number = 512; - public static FLAG11:number = 1024; - public static FLAG12:number = 2048; - public static FLAG13:number = 4096; - public static FLAG14:number = 8192; - public static FLAG15:number = 16384; - public static FLAG16:number = 32768; - - public static test(flags:number, testFlag:number):boolean - { - return (flags & testFlag) == testFlag; - } -} - -class AWDProperties -{ - public set(key:number, value:any):void - { - this[ key.toString() ] = value; - } - - public get(key:number, fallback:any):any - { - if (this.hasOwnProperty(key.toString())) { - return this[key.toString()]; - } else { - return fallback; - } - } -} - diff --git a/src/away/parsers/MD2Parser.ts b/src/away/parsers/MD2Parser.ts deleted file mode 100644 index 53399e4ab..000000000 --- a/src/away/parsers/MD2Parser.ts +++ /dev/null @@ -1,502 +0,0 @@ -/// - -module away.parsers -{ - import Geometry = away.base.Geometry; - import TriangleSubGeometry = away.base.TriangleSubGeometry; - import VertexAnimationSet = away.animators.VertexAnimationSet; - import VertexClipNode = away.animators.VertexClipNode; - import DefaultMaterialManager = away.materials.DefaultMaterialManager; - import TriangleMethodMaterial = away.materials.TriangleMethodMaterial; - import TriangleMaterialMode = away.materials.TriangleMaterialMode; - import URLLoaderDataFormat = away.net.URLLoaderDataFormat; - import Texture2DBase = away.textures.Texture2DBase - import ByteArray = away.utils.ByteArray; - - - /** - * MD2Parser provides a parser for the MD2 data type. - */ - export class MD2Parser extends ParserBase - { - public static FPS:number /*int*/ = 6; - - private _clipNodes:Object = new Object(); - private _byteData:ByteArray; - private _startedParsing:boolean; - private _parsedHeader:boolean; - private _parsedUV:boolean; - private _parsedFaces:boolean; - private _parsedFrames:boolean; - - private _ident:number /*uint*/; - private _version:number /*uint*/; - private _skinWidth:number /*uint*/; - private _skinHeight:number /*uint*/; - //private _frameSize : number /*uint*/; - private _numSkins:number /*uint*/; - private _numVertices:number /*uint*/; - private _numST:number /*uint*/; - private _numTris:number /*uint*/; - //private _numGlCmds : number /*uint*/; - private _numFrames:number /*uint*/; - private _offsetSkins:number /*uint*/; - private _offsetST:number /*uint*/; - private _offsetTris:number /*uint*/; - private _offsetFrames:number /*uint*/; - //private _offsetGlCmds : number /*uint*/; - private _offsetEnd:number /*uint*/; - - private _uvIndices:Array; - private _indices:Array /*uint*/; - private _vertIndices:Array; - - // the current subgeom being built - private _animationSet:VertexAnimationSet = new VertexAnimationSet(); - private _firstSubGeom:TriangleSubGeometry; - private _uvs:Array; - private _finalUV:Array; - - private _materialNames:Array; - private _textureType:string; - private _ignoreTexturePath:boolean; - private _mesh:away.entities.Mesh; - private _geometry:Geometry; - - private materialFinal:boolean = false; - private geoCreated:boolean = false; - - /** - * Creates a new MD2Parser object. - * @param textureType The extension of the texture (e.g. jpg/png/...) - * @param ignoreTexturePath If true, the path of the texture is ignored - */ - constructor(textureType:string = "jpg", ignoreTexturePath:boolean = true) - { - super(URLLoaderDataFormat.ARRAY_BUFFER); - this._textureType = textureType; - this._ignoreTexturePath = ignoreTexturePath; - } - - /** - * Indicates whether or not a given file extension is supported by the parser. - * @param extension The file extension of a potential file to be parsed. - * @return Whether or not the given file type is supported. - */ - public static supportsType(extension:string):boolean - { - extension = extension.toLowerCase(); - return extension == "md2"; - } - - /** - * Tests whether a data block can be parsed by the parser. - * @param data The data block to potentially be parsed. - * @return Whether or not the given data is supported. - */ - public static supportsData(data:any):boolean - { - return (ParserUtils.toString(data, 4) == 'IDP2'); - } - - /** - * @inheritDoc - */ - public _iResolveDependency(resourceDependency:away.parsers.ResourceDependency):void - { - if (resourceDependency.assets.length != 1) - return; - - var asset:Texture2DBase = resourceDependency.assets[0]; - - if (asset) { - var material:TriangleMethodMaterial = new TriangleMethodMaterial(asset); - - if (this.materialMode >= 2) - material.materialMode = TriangleMaterialMode.MULTI_PASS; - - //add to the content property - ( this._pContent).addChild(this._mesh); - - material.name = this._mesh.material.name; - this._mesh.material = material; - this._pFinalizeAsset(material); - this._pFinalizeAsset(this._mesh.geometry); - this._pFinalizeAsset(this._mesh); - } - this.materialFinal = true; - } - - /** - * @inheritDoc - */ - public _iResolveDependencyFailure(resourceDependency:ResourceDependency):void - { - // apply system default - if (this.materialMode < 2) { - this._mesh.material = DefaultMaterialManager.getDefaultMaterial(); - } else { - this._mesh.material = new TriangleMethodMaterial(away.materials.DefaultMaterialManager.getDefaultTexture()); - ( this._mesh.material).materialMode = TriangleMaterialMode.MULTI_PASS; - } - - //add to the content property - ( this._pContent).addChild(this._mesh); - - this._pFinalizeAsset(this._mesh.geometry); - this._pFinalizeAsset(this._mesh); - this.materialFinal = true; - - } - - /** - * @inheritDoc - */ - public _pProceedParsing():boolean - { - if (!this._startedParsing) { - this._byteData = this._pGetByteData(); - this._startedParsing = true; - - // Reset bytearray read position (which may have been - // moved forward by the supportsData() function.) - this._byteData.position = 0; - } - - while (this._pHasTime()) { - if (!this._parsedHeader) { - //---------------------------------------------------------------------------- - // LITTLE_ENDIAN - Default for ArrayBuffer / Not implemented in ByteArray - //---------------------------------------------------------------------------- - //this._byteData.endian = Endian.LITTLE_ENDIAN; - - // TODO: Create a mesh only when encountered (if it makes sense - // for this file format) and return it using this._pFinalizeAsset() - this._geometry = new Geometry(); - this._mesh = new away.entities.Mesh(this._geometry, null); - if (this.materialMode < 2) { - this._mesh.material = DefaultMaterialManager.getDefaultMaterial(); - } else { - this._mesh.material = new TriangleMethodMaterial(DefaultMaterialManager.getDefaultTexture()); - ( this._mesh.material).materialMode = TriangleMaterialMode.MULTI_PASS; - } - - //_geometry.animation = new VertexAnimation(2, VertexAnimationMode.ABSOLUTE); - //_animator = new VertexAnimator(VertexAnimationState(_mesh.animationState)); - - // Parse header and decompress body - this.parseHeader(); - this.parseMaterialNames(); - } else if (!this._parsedUV) { - this.parseUV(); - } else if (!this._parsedFaces) { - this.parseFaces(); - } else if (!this._parsedFrames) { - this.parseFrames(); - } else if ((this.geoCreated) && (this.materialFinal)) { - return away.parsers.ParserBase.PARSING_DONE; - } else if (!this.geoCreated) { - this.geoCreated = true; - //create default subgeometry - this._geometry.addSubGeometry(this._firstSubGeom.clone()); - // Force name to be chosen by this._pFinalizeAsset() - this._mesh.name = ""; - if (this.materialFinal) { - //add to the content property - ( this._pContent).addChild(this._mesh); - - this._pFinalizeAsset(this._mesh.geometry); - this._pFinalizeAsset(this._mesh); - } - - this._pPauseAndRetrieveDependencies(); - } - } - - return away.parsers.ParserBase.MORE_TO_PARSE; - } - - public _pStartParsing(frameLimit:number) - { - super._pStartParsing(frameLimit); - - //create a content object for Loaders - this._pContent = new away.containers.DisplayObjectContainer(); - } - - /** - * Reads in all that MD2 Header data that is declared as private variables. - * I know its a lot, and it looks ugly, but only way to do it in Flash - */ - private parseHeader():void - { - this._ident = this._byteData.readInt(); - this._version = this._byteData.readInt(); - this._skinWidth = this._byteData.readInt(); - this._skinHeight = this._byteData.readInt(); - //skip this._frameSize - this._byteData.readInt(); - this._numSkins = this._byteData.readInt(); - this._numVertices = this._byteData.readInt(); - this._numST = this._byteData.readInt(); - this._numTris = this._byteData.readInt(); - //skip this._numGlCmds - this._byteData.readInt(); - this._numFrames = this._byteData.readInt(); - this._offsetSkins = this._byteData.readInt(); - this._offsetST = this._byteData.readInt(); - this._offsetTris = this._byteData.readInt(); - this._offsetFrames = this._byteData.readInt(); - //skip this._offsetGlCmds - this._byteData.readInt(); - this._offsetEnd = this._byteData.readInt(); - - this._parsedHeader = true; - } - - /** - * Parses the file names for the materials. - */ - private parseMaterialNames():void - { - var url:string; - var name:string; - var extIndex:number /*int*/; - var slashIndex:number /*int*/; - this._materialNames = new Array(); - this._byteData.position = this._offsetSkins; - - var regExp:RegExp = new RegExp("[^a-zA-Z0-9\\_\/.]", "g"); - for (var i:number /*uint*/ = 0; i < this._numSkins; ++i) { - name = this._byteData.readUTFBytes(64); - name = name.replace(regExp, ""); - extIndex = name.lastIndexOf("."); - if (this._ignoreTexturePath) - slashIndex = name.lastIndexOf("/"); - if (name.toLowerCase().indexOf(".jpg") == -1 && name.toLowerCase().indexOf(".png") == -1) { - name = name.substring(slashIndex + 1, extIndex); - url = name + "." + this._textureType; - } else { - url = name; - } - - this._materialNames[i] = name; - - // only support 1 skin TODO: really? - if (this.dependencies.length == 0) - this._pAddDependency(name, new away.net.URLRequest(url)); - } - - if (this._materialNames.length > 0) - this._mesh.material.name = this._materialNames[0]; else - this.materialFinal = true; - } - - /** - * Parses the uv data for the mesh. - */ - private parseUV():void - { - var j:number /*uint*/ = 0; - - this._uvs = new Array(this._numST*2); - this._byteData.position = this._offsetST; - for (var i:number /*uint*/ = 0; i < this._numST; i++) { - this._uvs[j++] = this._byteData.readShort()/this._skinWidth; - this._uvs[j++] = this._byteData.readShort()/this._skinHeight; - } - - this._parsedUV = true; - } - - /** - * Parses unique indices for the faces. - */ - private parseFaces():void - { - var a:number /*uint*/, b:number /*uint*/, c:number /*uint*/, ta:number /*uint*/, tb:number /*uint*/, tc:number /*uint*/; - var i:number /*uint*/; - - this._vertIndices = new Array(); - this._uvIndices = new Array(); - this._indices = new Array() /*uint*/; - - this._byteData.position = this._offsetTris; - - for (i = 0; i < this._numTris; i++) { - //collect vertex indices - a = this._byteData.readUnsignedShort(); - b = this._byteData.readUnsignedShort(); - c = this._byteData.readUnsignedShort(); - - //collect uv indices - ta = this._byteData.readUnsignedShort(); - tb = this._byteData.readUnsignedShort(); - tc = this._byteData.readUnsignedShort(); - - this.addIndex(a, ta); - this.addIndex(b, tb); - this.addIndex(c, tc); - } - - var len:number /*uint*/ = this._uvIndices.length; - this._finalUV = new Array(len*2); - - for (i = 0; i < len; ++i) { - this._finalUV[i << 1] = this._uvs[this._uvIndices[i] << 1]; - this._finalUV[(i << 1) + 1] = this._uvs[(this._uvIndices[i] << 1) + 1]; - } - - this._parsedFaces = true; - } - - /** - * Adds a face index to the list if it doesn't exist yet, based on vertexIndex and uvIndex, and adds the - * corresponding vertex and uv data in the correct location. - * @param vertexIndex The original index in the vertex list. - * @param uvIndex The original index in the uv list. - */ - private addIndex(vertexIndex:number /*uint*/, uvIndex:number /*uint*/):void - { - var index:number /*int*/ = this.findIndex(vertexIndex, uvIndex); - - if (index == -1) { - this._indices.push(this._vertIndices.length); - this._vertIndices.push(vertexIndex); - this._uvIndices.push(uvIndex); - } else - this._indices.push(index); - } - - /** - * Finds the final index corresponding to the original MD2's vertex and uv indices. Returns -1 if it wasn't added yet. - * @param vertexIndex The original index in the vertex list. - * @param uvIndex The original index in the uv list. - * @return The index of the final mesh corresponding to the original vertex and uv index. -1 if it doesn't exist yet. - */ - private findIndex(vertexIndex:number /*uint*/, uvIndex:number /*uint*/):number /*int*/ - { - var len:number /*uint*/ = this._vertIndices.length; - - for (var i:number /*uint*/ = 0; i < len; ++i) { - if (this._vertIndices[i] == vertexIndex && this._uvIndices[i] == uvIndex) - return i; - } - - return -1; - } - - /** - * Parses all the frame geometries. - */ - private parseFrames():void - { - var sx:number, sy:number, sz:number; - var tx:number, ty:number, tz:number; - var geometry:Geometry; - var subGeom:TriangleSubGeometry; - var vertLen:number /*uint*/ = this._vertIndices.length; - var fvertices:Array; - var tvertices:Array; - var i:number /*uint*/, j:number /*int*/, k:number /*uint*/; - //var ch : number /*uint*/; - var name:string = ""; - var prevClip:VertexClipNode = null; - - this._byteData.position = this._offsetFrames; - - for (i = 0; i < this._numFrames; i++) { - - tvertices = new Array(); - fvertices = new Array(vertLen*3); - - sx = this._byteData.readFloat(); - sy = this._byteData.readFloat(); - sz = this._byteData.readFloat(); - - tx = this._byteData.readFloat(); - ty = this._byteData.readFloat(); - tz = this._byteData.readFloat(); - - name = this.readFrameName(); - - // Note, the extra data.position++ in the for loop is there - // to skip over a byte that holds the "vertex normal index" - for (j = 0; j < this._numVertices; j++, this._byteData.position++) - tvertices.push(sx*this._byteData.readUnsignedByte() + tx, sy*this._byteData.readUnsignedByte() + ty, sz*this._byteData.readUnsignedByte() + tz); - - k = 0; - for (j = 0; j < vertLen; j++) { - fvertices[k++] = tvertices[this._vertIndices[j]*3]; - fvertices[k++] = tvertices[this._vertIndices[j]*3 + 2]; - fvertices[k++] = tvertices[this._vertIndices[j]*3 + 1]; - } - - subGeom = new TriangleSubGeometry(true); - - if (this._firstSubGeom == null) - this._firstSubGeom = subGeom; - - geometry = new Geometry(); - geometry.addSubGeometry(subGeom); - - subGeom.updateIndices(this._indices); - subGeom.updatePositions(fvertices); - subGeom.updateUVs(this._finalUV); - subGeom.vertexNormals; - subGeom.vertexTangents; - subGeom.autoDeriveNormals = false; - subGeom.autoDeriveTangents = false; - - var clip:VertexClipNode = this._clipNodes[name]; - - if (!clip) { - // If another sequence was parsed before this one, starting - // a new state means the previous one is complete and can - // hence be finalized. - if (prevClip) { - this._pFinalizeAsset(prevClip); - this._animationSet.addAnimation(prevClip); - } - - clip = new VertexClipNode(); - clip.name = name; - clip.stitchFinalFrame = true; - - this._clipNodes[name] = clip; - - prevClip = clip; - } - clip.addFrame(geometry, 1000/away.parsers.MD2Parser.FPS); - } - - // Finalize the last state - if (prevClip) { - this._pFinalizeAsset(prevClip); - this._animationSet.addAnimation(prevClip); - } - - // Force this._pFinalizeAsset() to decide name - this._pFinalizeAsset(this._animationSet); - - this._parsedFrames = true; - } - - private readFrameName():string - { - var name:string = ""; - var k:number /*uint*/ = 0; - for (var j:number /*uint*/ = 0; j < 16; j++) { - var ch:number /*uint*/ = this._byteData.readUnsignedByte(); - - if (Math.floor(ch) > 0x39 && Math.floor(ch) <= 0x7A && k == 0) - name += String.fromCharCode(ch); - - if (Math.floor(ch) >= 0x30 && Math.floor(ch) <= 0x39) - k++; - } - return name; - } - } -} - diff --git a/src/away/parsers/MD5AnimParser.ts b/src/away/parsers/MD5AnimParser.ts deleted file mode 100644 index ca731c040..000000000 --- a/src/away/parsers/MD5AnimParser.ts +++ /dev/null @@ -1,647 +0,0 @@ -/// - -module away.parsers -{ - import JointPose = away.animators.JointPose; - import SkeletonPose = away.animators.SkeletonPose; - import SkeletonClipNode = away.animators.SkeletonClipNode; - import Quaternion = away.geom.Quaternion; - import Vector3D = away.geom.Vector3D; - import URLLoaderDataFormat = away.net.URLLoaderDataFormat; - /** - * MD5AnimParser provides a parser for the md5anim data type, providing an animation sequence for the md5 format. - * - * todo: optimize - */ - export class MD5AnimParser extends ParserBase - { - private _textData:string; - private _startedParsing:boolean; - public static VERSION_TOKEN:string = "MD5Version"; - public static COMMAND_LINE_TOKEN:string = "commandline"; - public static NUM_FRAMES_TOKEN:string = "numFrames"; - public static NUM_JOINTS_TOKEN:string = "numJoints"; - public static FRAME_RATE_TOKEN:string = "frameRate"; - public static NUM_ANIMATED_COMPONENTS_TOKEN:string = "numAnimatedComponents"; - - public static HIERARCHY_TOKEN:string = "hierarchy"; - public static BOUNDS_TOKEN:string = "bounds"; - public static BASE_FRAME_TOKEN:string = "baseframe"; - public static FRAME_TOKEN:string = "frame"; - - public static COMMENT_TOKEN:string = "//"; - - private _parseIndex:number /*int*/ = 0; - private _reachedEOF:boolean; - private _line:number /*int*/ = 0; - private _charLineIndex:number /*int*/ = 0; - private _version:number /*int*/; - private _frameRate:number /*int*/; - private _numFrames:number /*int*/; - private _numJoints:number /*int*/; - private _numAnimatedComponents:number /*int*/; - - private _hierarchy:Array; - private _bounds:Array; - private _frameData:Array; - private _baseFrameData:Array; - - private _rotationQuat:Quaternion; - private _clip:SkeletonClipNode; - - /** - * Creates a new MD5AnimParser object. - * @param uri The url or id of the data or file to be parsed. - * @param extra The holder for extra contextual data that the parser might need. - */ - constructor(additionalRotationAxis:Vector3D = null, additionalRotationRadians:number = 0) - { - super(URLLoaderDataFormat.TEXT); - this._rotationQuat = new Quaternion(); - var t1:Quaternion = new Quaternion(); - var t2:Quaternion = new Quaternion(); - - t1.fromAxisAngle(Vector3D.X_AXIS, -Math.PI*.5); - t2.fromAxisAngle(Vector3D.Y_AXIS, -Math.PI*.5); - - this._rotationQuat.multiply(t2, t1); - - if (additionalRotationAxis) { - this._rotationQuat.multiply(t2, t1); - t1.fromAxisAngle(additionalRotationAxis, additionalRotationRadians); - this._rotationQuat.multiply(t1, this._rotationQuat); - } - } - - /** - * Indicates whether or not a given file extension is supported by the parser. - * @param extension The file extension of a potential file to be parsed. - * @return Whether or not the given file type is supported. - */ - public static supportsType(extension:string):boolean - { - extension = extension.toLowerCase(); - return extension == "md5anim"; - } - - /** - * Tests whether a data block can be parsed by the parser. - * @param data The data block to potentially be parsed. - * @return Whether or not the given data is supported. - */ - public static supportsData(data:any):boolean - { - return false; - } - - /** - * @inheritDoc - */ - public _pProceedParsing():boolean - { - var token:string; - - if (!this._startedParsing) { - this._textData = this._pGetTextData(); - this._startedParsing = true; - } - - while (this._pHasTime()) { - token = this.getNextToken(); - switch (token) { - case MD5AnimParser.COMMENT_TOKEN: - this.ignoreLine(); - break; - case "": - // can occur at the end of a file - break; - case MD5AnimParser.VERSION_TOKEN: - this._version = this.getNextInt(); - if (this._version != 10) - throw new Error("Unknown version number encountered!"); - break; - case MD5AnimParser.COMMAND_LINE_TOKEN: - this.parseCMD(); - break; - case MD5AnimParser.NUM_FRAMES_TOKEN: - this._numFrames = this.getNextInt(); - this._bounds = new Array(); - this._frameData = new Array(); - break; - case MD5AnimParser.NUM_JOINTS_TOKEN: - this._numJoints = this.getNextInt(); - this._hierarchy = new Array(this._numJoints); - this._baseFrameData = new Array(this._numJoints); - break; - case MD5AnimParser.FRAME_RATE_TOKEN: - this._frameRate = this.getNextInt(); - break; - case MD5AnimParser.NUM_ANIMATED_COMPONENTS_TOKEN: - this._numAnimatedComponents = this.getNextInt(); - break; - case MD5AnimParser.HIERARCHY_TOKEN: - this.parseHierarchy(); - break; - case MD5AnimParser.BOUNDS_TOKEN: - this.parseBounds(); - break; - case MD5AnimParser.BASE_FRAME_TOKEN: - this.parseBaseFrame(); - break; - case MD5AnimParser.FRAME_TOKEN: - this.parseFrame(); - break; - default: - if (!this._reachedEOF) - this.sendUnknownKeywordError(); - } - - if (this._reachedEOF) { - this._clip = new SkeletonClipNode(); - this.translateClip(); - this._pFinalizeAsset(this._clip); - return ParserBase.PARSING_DONE; - } - } - return ParserBase.MORE_TO_PARSE; - } - - /** - * Converts all key frame data to an SkinnedAnimationSequence. - */ - private translateClip():void - { - for (var i:number /*int*/ = 0; i < this._numFrames; ++i) - this._clip.addFrame(this.translatePose(this._frameData[i]), 1000/this._frameRate); - } - - /** - * Converts a single key frame data to a SkeletonPose. - * @param frameData The actual frame data. - * @return A SkeletonPose containing the frame data's pose. - */ - private translatePose(frameData:FrameData):SkeletonPose - { - var hierarchy:HierarchyData; - var pose:JointPose; - var base:BaseFrameData; - var flags:number /*int*/; - var j:number /*int*/; - var translate:Vector3D = new Vector3D(); - var orientation:Quaternion = new Quaternion(); - var components:Array = frameData.components; - var skelPose:SkeletonPose = new SkeletonPose(); - var jointPoses:Array = skelPose.jointPoses; - - for (var i:number /*int*/ = 0; i < this._numJoints; ++i) { - j = 0; - pose = new JointPose(); - hierarchy = this._hierarchy[i]; - base = this._baseFrameData[i]; - flags = hierarchy.flags; - translate.x = base.position.x; - translate.y = base.position.y; - translate.z = base.position.z; - orientation.x = base.orientation.x; - orientation.y = base.orientation.y; - orientation.z = base.orientation.z; - - if (flags & 1) - translate.x = components[hierarchy.startIndex + (j++)]; - if (flags & 2) - translate.y = components[hierarchy.startIndex + (j++)]; - if (flags & 4) - translate.z = components[hierarchy.startIndex + (j++)]; - if (flags & 8) - orientation.x = components[hierarchy.startIndex + (j++)]; - if (flags & 16) - orientation.y = components[hierarchy.startIndex + (j++)]; - if (flags & 32) - orientation.z = components[hierarchy.startIndex + (j++)]; - - var w:number = 1 - orientation.x*orientation.x - orientation.y*orientation.y - orientation.z*orientation.z; - orientation.w = w < 0? 0 : -Math.sqrt(w); - - if (hierarchy.parentIndex < 0) { - pose.orientation.multiply(this._rotationQuat, orientation); - pose.translation = this._rotationQuat.rotatePoint(translate); - } else { - pose.orientation.copyFrom(orientation); - pose.translation.x = translate.x; - pose.translation.y = translate.y; - pose.translation.z = translate.z; - } - pose.orientation.y = -pose.orientation.y; - pose.orientation.z = -pose.orientation.z; - pose.translation.x = -pose.translation.x; - - jointPoses[i] = pose; - } - - return skelPose; - } - - /** - * Parses the skeleton's hierarchy data. - */ - private parseHierarchy():void - { - var ch:string; - var data:HierarchyData; - var token:string = this.getNextToken(); - var i:number /*int*/ = 0; - - if (token != "{") - this.sendUnknownKeywordError(); - - do { - if (this._reachedEOF) - this.sendEOFError(); - data = new HierarchyData(); - data.name = this.parseLiteralstring(); - data.parentIndex = this.getNextInt(); - data.flags = this.getNextInt(); - data.startIndex = this.getNextInt(); - this._hierarchy[i++] = data; - - ch = this.getNextChar(); - - if (ch == "/") { - this.putBack(); - ch = this.getNextToken(); - if (ch == MD5AnimParser.COMMENT_TOKEN) - this.ignoreLine(); - ch = this.getNextChar(); - } - - if (ch != "}") - this.putBack(); - - } while (ch != "}"); - } - - /** - * Parses frame bounds. - */ - private parseBounds():void - { - var ch:string; - var data:BoundsData; - var token:string = this.getNextToken(); - var i:number /*int*/ = 0; - - if (token != "{") - this.sendUnknownKeywordError(); - - do { - if (this._reachedEOF) - this.sendEOFError(); - data = new BoundsData(); - data.min = this.parseVector3D(); - data.max = this.parseVector3D(); - this._bounds[i++] = data; - - ch = this.getNextChar(); - - if (ch == "/") { - this.putBack(); - ch = this.getNextToken(); - if (ch == MD5AnimParser.COMMENT_TOKEN) - this.ignoreLine(); - ch = this.getNextChar(); - } - - if (ch != "}") - this.putBack(); - - } while (ch != "}"); - } - - /** - * Parses the base frame. - */ - private parseBaseFrame():void - { - var ch:string; - var data:BaseFrameData; - var token:string = this.getNextToken(); - var i:number /*int*/ = 0; - - if (token != "{") - this.sendUnknownKeywordError(); - - do { - if (this._reachedEOF) - this.sendEOFError(); - data = new BaseFrameData(); - data.position = this.parseVector3D(); - data.orientation = this.parseQuaternion(); - this._baseFrameData[i++] = data; - - ch = this.getNextChar(); - - if (ch == "/") { - this.putBack(); - ch = this.getNextToken(); - if (ch == MD5AnimParser.COMMENT_TOKEN) - this.ignoreLine(); - ch = this.getNextChar(); - } - - if (ch != "}") - this.putBack(); - - } while (ch != "}"); - } - - /** - * Parses a single frame. - */ - private parseFrame():void - { - var ch:string; - var data:FrameData; - var token:string; - var frameIndex:number /*int*/; - - frameIndex = this.getNextInt(); - - token = this.getNextToken(); - if (token != "{") - this.sendUnknownKeywordError(); - - do { - if (this._reachedEOF) - this.sendEOFError(); - data = new FrameData(); - data.components = new Array(this._numAnimatedComponents); - - for (var i:number /*int*/ = 0; i < this._numAnimatedComponents; ++i) - data.components[i] = this.getNextNumber(); - - this._frameData[frameIndex] = data; - - ch = this.getNextChar(); - - if (ch == "/") { - this.putBack(); - ch = this.getNextToken(); - if (ch == MD5AnimParser.COMMENT_TOKEN) - this.ignoreLine(); - ch = this.getNextChar(); - } - - if (ch != "}") - this.putBack(); - - } while (ch != "}"); - } - - /** - * Puts back the last read character into the data stream. - */ - private putBack():void - { - this._parseIndex--; - this._charLineIndex--; - this._reachedEOF = this._parseIndex >= this._textData.length; - } - - /** - * Gets the next token in the data stream. - */ - private getNextToken():string - { - var ch:string; - var token:string = ""; - - while (!this._reachedEOF) { - ch = this.getNextChar(); - if (ch == " " || ch == "\r" || ch == "\n" || ch == "\t") { - if (token != MD5AnimParser.COMMENT_TOKEN) - this.skipWhiteSpace(); - if (token != "") - return token; - } else - token += ch; - - if (token == MD5AnimParser.COMMENT_TOKEN) - return token; - } - - return token; - } - - /** - * Skips all whitespace in the data stream. - */ - private skipWhiteSpace():void - { - var ch:string; - - do - ch = this.getNextChar(); while (ch == "\n" || ch == " " || ch == "\r" || ch == "\t"); - - this.putBack(); - } - - /** - * Skips to the next line. - */ - private ignoreLine():void - { - var ch:string; - while (!this._reachedEOF && ch != "\n") - ch = this.getNextChar(); - } - - /** - * Retrieves the next single character in the data stream. - */ - private getNextChar():string - { - var ch:string = this._textData.charAt(this._parseIndex++); - - if (ch == "\n") { - ++this._line; - this._charLineIndex = 0; - } else if (ch != "\r") - ++this._charLineIndex; - - if (this._parseIndex == this._textData.length) - this._reachedEOF = true; - - return ch; - } - - /** - * Retrieves the next integer in the data stream. - */ - private getNextInt():number /*int*/ - { - var i:number = parseInt(this.getNextToken()); - if (isNaN(i)) - this.sendParseError("int type"); - return i; - } - - /** - * Retrieves the next floating point number in the data stream. - */ - private getNextNumber():number - { - var f:number = parseFloat(this.getNextToken()); - if (isNaN(f)) - this.sendParseError("float type"); - return f; - } - - /** - * Retrieves the next 3d vector in the data stream. - */ - private parseVector3D():Vector3D - { - var vec:Vector3D = new Vector3D(); - var ch:string = this.getNextToken(); - - if (ch != "(") - this.sendParseError("("); - vec.x = this.getNextNumber(); - vec.y = this.getNextNumber(); - vec.z = this.getNextNumber(); - - if (this.getNextToken() != ")") - this.sendParseError(")"); - - return vec; - } - - /** - * Retrieves the next quaternion in the data stream. - */ - private parseQuaternion():Quaternion - { - var quat:Quaternion = new Quaternion(); - var ch:string = this.getNextToken(); - - if (ch != "(") - this.sendParseError("("); - quat.x = this.getNextNumber(); - quat.y = this.getNextNumber(); - quat.z = this.getNextNumber(); - - // quat supposed to be unit length - var t:number = 1 - (quat.x*quat.x) - (quat.y*quat.y) - (quat.z*quat.z); - quat.w = t < 0? 0 : -Math.sqrt(t); - - if (this.getNextToken() != ")") - this.sendParseError(")"); - - return quat; - } - - /** - * Parses the command line data. - */ - private parseCMD():void - { - // just ignore the command line property - this.parseLiteralstring(); - } - - /** - * Retrieves the next literal string in the data stream. A literal string is a sequence of characters bounded - * by double quotes. - */ - private parseLiteralstring():string - { - this.skipWhiteSpace(); - - var ch:string = this.getNextChar(); - var str:string = ""; - - if (ch != "\"") - this.sendParseError("\""); - - do { - if (this._reachedEOF) - this.sendEOFError(); - ch = this.getNextChar(); - if (ch != "\"") - str += ch; - } while (ch != "\""); - - return str; - } - - /** - * Throws an end-of-file error when a premature end of file was encountered. - */ - private sendEOFError():void - { - throw new Error("Unexpected end of file"); - } - - /** - * Throws an error when an unexpected token was encountered. - * @param expected The token type that was actually expected. - */ - private sendParseError(expected:string):void - { - throw new Error("Unexpected token at line " + (this._line + 1) + ", character " + this._charLineIndex + ". " + expected + " expected, but " + this._textData.charAt(this._parseIndex - 1) + " encountered"); - } - - /** - * Throws an error when an unknown keyword was encountered. - */ - private sendUnknownKeywordError():void - { - throw new Error("Unknown keyword at line " + (this._line + 1) + ", character " + this._charLineIndex + ". "); - } - } -} - -// value objects - -class HierarchyData -{ - public name:string; - public parentIndex:number /*int*/; - public flags:number /*int*/; - public startIndex:number /*int*/; - - public HierarchyData() - { - } -} - -class BoundsData -{ - public min:away.geom.Vector3D; - public max:away.geom.Vector3D; - - public BoundsData() - { - } -} - -class BaseFrameData -{ - public position:away.geom.Vector3D; - public orientation:away.geom.Quaternion; - - public BaseFrameData() - { - } -} - -class FrameData -{ - public index:number /*int*/; - public components:Array; - - public FrameData() - { - } -} - diff --git a/src/away/parsers/MD5MeshParser.ts b/src/away/parsers/MD5MeshParser.ts deleted file mode 100644 index ef2fb42ea..000000000 --- a/src/away/parsers/MD5MeshParser.ts +++ /dev/null @@ -1,682 +0,0 @@ -/// - -module away.parsers -{ - import SkeletonAnimationSet = away.animators.SkeletonAnimationSet; - import Skeleton = away.animators.Skeleton; - import SkeletonJoint = away.animators.SkeletonJoint; - import Geometry = away.base.Geometry; - import TriangleSubGeometry = away.base.TriangleSubGeometry; - import Matrix3D = away.geom.Matrix3D; - import Quaternion = away.geom.Quaternion; - import Vector3D = away.geom.Vector3D; - import Mesh = away.entities.Mesh; - import URLLoaderDataFormat = away.net.URLLoaderDataFormat; - // todo: create animation system, parse skeleton - - /** - * MD5MeshParser provides a parser for the md5mesh data type, providing the geometry of the md5 format. - * - * todo: optimize - */ - export class MD5MeshParser extends ParserBase - { - private _textData:string; - private _startedParsing:boolean; - public static VERSION_TOKEN:string = "MD5Version"; - public static COMMAND_LINE_TOKEN:string = "commandline"; - public static NUM_JOINTS_TOKEN:string = "numJoints"; - public static NUM_MESHES_TOKEN:string = "numMeshes"; - public static COMMENT_TOKEN:string = "//"; - public static JOINTS_TOKEN:string = "joints"; - public static MESH_TOKEN:string = "mesh"; - - public static MESH_SHADER_TOKEN:string = "shader"; - public static MESH_NUM_VERTS_TOKEN:string = "numverts"; - public static MESH_VERT_TOKEN:string = "vert"; - public static MESH_NUM_TRIS_TOKEN:string = "numtris"; - public static MESH_TRI_TOKEN:string = "tri"; - public static MESH_NUM_WEIGHTS_TOKEN:string = "numweights"; - public static MESH_WEIGHT_TOKEN:string = "weight"; - - private _parseIndex:number /*int*/ = 0; - private _reachedEOF:boolean; - private _line:number /*int*/ = 0; - private _charLineIndex:number /*int*/ = 0; - private _version:number /*int*/; - private _numJoints:number /*int*/; - private _numMeshes:number /*int*/; - - private _mesh:Mesh; - private _shaders:Array; - - private _maxJointCount:number /*int*/; - private _meshData:Array; - private _bindPoses:Array; - private _geometry:Geometry; - - private _skeleton:Skeleton; - private _animationSet:SkeletonAnimationSet; - - private _rotationQuat:Quaternion; - - /** - * Creates a new MD5MeshParser object. - */ - constructor(additionalRotationAxis:Vector3D = null, additionalRotationRadians:number = 0) - { - super(URLLoaderDataFormat.TEXT); - this._rotationQuat = new Quaternion(); - - this._rotationQuat.fromAxisAngle(Vector3D.X_AXIS, -Math.PI*.5); - - if (additionalRotationAxis) { - var quat:Quaternion = new Quaternion(); - quat.fromAxisAngle(additionalRotationAxis, additionalRotationRadians); - this._rotationQuat.multiply(this._rotationQuat, quat); - } - } - - /** - * Indicates whether or not a given file extension is supported by the parser. - * @param extension The file extension of a potential file to be parsed. - * @return Whether or not the given file type is supported. - */ - public static supportsType(extension:string):boolean - { - extension = extension.toLowerCase(); - return extension == "md5mesh"; - } - - /** - * Tests whether a data block can be parsed by the parser. - * @param data The data block to potentially be parsed. - * @return Whether or not the given data is supported. - */ - public static supportsData(data:any):boolean - { - return false; - } - - /** - * @inheritDoc - */ - public _pProceedParsing():boolean - { - var token:string; - - if (!this._startedParsing) { - this._textData = this._pGetTextData(); - this._startedParsing = true; - } - - while (this._pHasTime()) { - token = this.getNextToken(); - switch (token) { - case MD5MeshParser.COMMENT_TOKEN: - this.ignoreLine(); - break; - case MD5MeshParser.VERSION_TOKEN: - this._version = this.getNextInt(); - if (this._version != 10) - throw new Error("Unknown version number encountered!"); - break; - case MD5MeshParser.COMMAND_LINE_TOKEN: - this.parseCMD(); - break; - case MD5MeshParser.NUM_JOINTS_TOKEN: - this._numJoints = this.getNextInt(); - this._bindPoses = new Array(this._numJoints); - break; - case MD5MeshParser.NUM_MESHES_TOKEN: - this._numMeshes = this.getNextInt(); - break; - case MD5MeshParser.JOINTS_TOKEN: - this.parseJoints(); - break; - case MD5MeshParser.MESH_TOKEN: - this.parseMesh(); - break; - default: - if (!this._reachedEOF) - this.sendUnknownKeywordError(); - } - - if (this._reachedEOF) { - this.calculateMaxJointCount(); - this._animationSet = new SkeletonAnimationSet(this._maxJointCount); - - this._mesh = new Mesh(new Geometry(), null); - this._geometry = this._mesh.geometry; - - for (var i:number /*int*/ = 0; i < this._meshData.length; ++i) - this._geometry.addSubGeometry(this.translateGeom(this._meshData[i].vertexData, this._meshData[i].weightData, this._meshData[i].indices)); - - //_geometry.animation = _animation; - // _mesh.animationController = _animationController; - - //add to the content property - ( this._pContent).addChild(this._mesh); - - this._pFinalizeAsset(this._geometry); - this._pFinalizeAsset(this._mesh); - this._pFinalizeAsset(this._skeleton); - this._pFinalizeAsset(this._animationSet); - return ParserBase.PARSING_DONE; - } - } - return ParserBase.MORE_TO_PARSE; - } - - public _pStartParsing(frameLimit:number) - { - super._pStartParsing(frameLimit); - - //create a content object for Loaders - this._pContent = new away.containers.DisplayObjectContainer(); - } - - private calculateMaxJointCount():void - { - this._maxJointCount = 0; - - var numMeshData:number /*int*/ = this._meshData.length; - for (var i:number /*int*/ = 0; i < numMeshData; ++i) { - var meshData:MeshData = this._meshData[i]; - var vertexData:Array = meshData.vertexData; - var numVerts:number /*int*/ = vertexData.length; - - for (var j:number /*int*/ = 0; j < numVerts; ++j) { - var zeroWeights:number /*int*/ = this.countZeroWeightJoints(vertexData[j], meshData.weightData); - var totalJoints:number /*int*/ = vertexData[j].countWeight - zeroWeights; - if (totalJoints > this._maxJointCount) - this._maxJointCount = totalJoints; - } - } - } - - private countZeroWeightJoints(vertex:VertexData, weights:Array):number /*int*/ - { - var start:number /*int*/ = vertex.startWeight; - var end:number /*int*/ = vertex.startWeight + vertex.countWeight; - var count:number /*int*/ = 0; - var weight:number; - - for (var i:number /*int*/ = start; i < end; ++i) { - weight = weights[i].bias; - if (weight == 0) - ++count; - } - - return count; - } - - /** - * Parses the skeleton's joints. - */ - private parseJoints():void - { - var ch:string; - var joint:SkeletonJoint; - var pos:Vector3D; - var quat:Quaternion; - var i:number /*int*/ = 0; - var token:string = this.getNextToken(); - - if (token != "{") - this.sendUnknownKeywordError(); - - this._skeleton = new Skeleton(); - - do { - if (this._reachedEOF) - this.sendEOFError(); - joint = new SkeletonJoint(); - joint.name = this.parseLiteralstring(); - joint.parentIndex = this.getNextInt(); - pos = this.parseVector3D(); - pos = this._rotationQuat.rotatePoint(pos); - quat = this.parseQuaternion(); - - // todo: check if this is correct, or maybe we want to actually store it as quats? - this._bindPoses[i] = quat.toMatrix3D(); - this._bindPoses[i].appendTranslation(pos.x, pos.y, pos.z); - var inv:Matrix3D = this._bindPoses[i].clone(); - inv.invert(); - joint.inverseBindPose = inv.rawData; - - this._skeleton.joints[i++] = joint; - - ch = this.getNextChar(); - - if (ch == "/") { - this.putBack(); - ch = this.getNextToken(); - if (ch == MD5MeshParser.COMMENT_TOKEN) - this.ignoreLine(); - ch = this.getNextChar(); - - } - - if (ch != "}") - this.putBack(); - } while (ch != "}"); - } - - /** - * Puts back the last read character into the data stream. - */ - private putBack():void - { - this._parseIndex--; - this._charLineIndex--; - this._reachedEOF = this._parseIndex >= this._textData.length; - } - - /** - * Parses the mesh geometry. - */ - private parseMesh():void - { - var token:string = this.getNextToken(); - var ch:string; - var vertexData:Array; - var weights:Array; - var indices:Array /*uint*/; - - if (token != "{") - this.sendUnknownKeywordError(); - - if (this._shaders == null) - this._shaders = new Array(); - - while (ch != "}") { - ch = this.getNextToken(); - switch (ch) { - case MD5MeshParser.COMMENT_TOKEN: - this.ignoreLine(); - break; - case MD5MeshParser.MESH_SHADER_TOKEN: - this._shaders.push(this.parseLiteralstring()); - break; - case MD5MeshParser.MESH_NUM_VERTS_TOKEN: - vertexData = new Array(this.getNextInt()); - break; - case MD5MeshParser.MESH_NUM_TRIS_TOKEN: - indices = new Array(this.getNextInt()*3) /*uint*/; - break; - case MD5MeshParser.MESH_NUM_WEIGHTS_TOKEN: - weights = new Array(this.getNextInt()); - break; - case MD5MeshParser.MESH_VERT_TOKEN: - this.parseVertex(vertexData); - break; - case MD5MeshParser.MESH_TRI_TOKEN: - this.parseTri(indices); - break; - case MD5MeshParser.MESH_WEIGHT_TOKEN: - this.parseJoint(weights); - break; - } - } - - if (this._meshData == null) - this._meshData = new Array(); - - var i:number /*uint*/ = this._meshData.length; - this._meshData[i] = new MeshData(); - this._meshData[i].vertexData = vertexData; - this._meshData[i].weightData = weights; - this._meshData[i].indices = indices; - } - - /** - * Converts the mesh data to a SkinnedSub instance. - * @param vertexData The mesh's vertices. - * @param weights The joint weights per vertex. - * @param indices The indices for the faces. - * @return A SubGeometry instance containing all geometrical data for the current mesh. - */ - private translateGeom(vertexData:Array, weights:Array, indices:Array /*uint*/):TriangleSubGeometry - { - var len:number /*int*/ = vertexData.length; - var v1:number /*int*/, v2:number /*int*/, v3:number /*int*/; - var vertex:VertexData; - var weight:JointData; - var bindPose:Matrix3D; - var pos:Vector3D; - var subGeom:TriangleSubGeometry = new TriangleSubGeometry(true); - var uvs:Array = new Array(len*2); - var vertices:Array = new Array(len*3); - var jointIndices:Array = new Array(len*this._maxJointCount); - var jointWeights:Array = new Array(len*this._maxJointCount); - var l:number /*int*/ = 0; - var nonZeroWeights:number /*int*/; - - for (var i:number /*int*/ = 0; i < len; ++i) { - vertex = vertexData[i]; - v1 = vertex.index*3; - v2 = v1 + 1; - v3 = v1 + 2; - vertices[v1] = vertices[v2] = vertices[v3] = 0; - - nonZeroWeights = 0; - for (var j:number /*int*/ = 0; j < vertex.countWeight; ++j) { - weight = weights[vertex.startWeight + j]; - if (weight.bias > 0) { - bindPose = this._bindPoses[weight.joint]; - pos = bindPose.transformVector(weight.pos); - vertices[v1] += pos.x*weight.bias; - vertices[v2] += pos.y*weight.bias; - vertices[v3] += pos.z*weight.bias; - - // indices need to be multiplied by 3 (amount of matrix registers) - jointIndices[l] = weight.joint*3; - jointWeights[l++] = weight.bias; - ++nonZeroWeights; - } - } - - for (j = nonZeroWeights; j < this._maxJointCount; ++j) { - jointIndices[l] = 0; - jointWeights[l++] = 0; - } - - v1 = vertex.index << 1; - uvs[v1++] = vertex.s; - uvs[v1] = vertex.t; - } - - subGeom.jointsPerVertex = this._maxJointCount; - subGeom.updateIndices(indices); - subGeom.updatePositions(vertices); - subGeom.updateUVs(uvs); - subGeom.updateJointIndices(jointIndices); - subGeom.updateJointWeights(jointWeights); - // cause explicit updates - subGeom.vertexNormals; - subGeom.vertexTangents; - // turn auto updates off because they may be animated and set explicitly - subGeom.autoDeriveTangents = false; - subGeom.autoDeriveNormals = false; - - return subGeom; - } - - /** - * Retrieve the next triplet of vertex indices that form a face. - * @param indices The index list in which to store the read data. - */ - private parseTri(indices:Array /*uint*/):void - { - var index:number /*int*/ = this.getNextInt()*3; - indices[index] = this.getNextInt(); - indices[index + 1] = this.getNextInt(); - indices[index + 2] = this.getNextInt(); - } - - /** - * Reads a new joint data set for a single joint. - * @param weights the target list to contain the weight data. - */ - private parseJoint(weights:Array):void - { - var weight:JointData = new JointData(); - weight.index = this.getNextInt(); - weight.joint = this.getNextInt(); - weight.bias = this.getNextNumber(); - weight.pos = this.parseVector3D(); - weights[weight.index] = weight; - } - - /** - * Reads the data for a single vertex. - * @param vertexData The list to contain the vertex data. - */ - private parseVertex(vertexData:Array):void - { - var vertex:VertexData = new VertexData(); - vertex.index = this.getNextInt(); - this.parseUV(vertex); - vertex.startWeight = this.getNextInt(); - vertex.countWeight = this.getNextInt(); - // if (vertex.countWeight > _maxJointCount) _maxJointCount = vertex.countWeight; - vertexData[vertex.index] = vertex; - } - - /** - * Reads the next uv coordinate. - * @param vertexData The vertexData to contain the UV coordinates. - */ - private parseUV(vertexData:VertexData):void - { - var ch:string = this.getNextToken(); - if (ch != "(") - this.sendParseError("("); - vertexData.s = this.getNextNumber(); - vertexData.t = this.getNextNumber(); - - if (this.getNextToken() != ")") - this.sendParseError(")"); - } - - /** - * Gets the next token in the data stream. - */ - private getNextToken():string - { - var ch:string; - var token:string = ""; - - while (!this._reachedEOF) { - ch = this.getNextChar(); - if (ch == " " || ch == "\r" || ch == "\n" || ch == "\t") { - if (token != MD5MeshParser.COMMENT_TOKEN) - this.skipWhiteSpace(); - if (token != "") - return token; - } else - token += ch; - - if (token == MD5MeshParser.COMMENT_TOKEN) - return token; - } - - return token; - } - - /** - * Skips all whitespace in the data stream. - */ - private skipWhiteSpace():void - { - var ch:string; - - do - ch = this.getNextChar(); while (ch == "\n" || ch == " " || ch == "\r" || ch == "\t"); - - this.putBack(); - } - - /** - * Skips to the next line. - */ - private ignoreLine():void - { - var ch:string; - while (!this._reachedEOF && ch != "\n") - ch = this.getNextChar(); - } - - /** - * Retrieves the next single character in the data stream. - */ - private getNextChar():string - { - var ch:string = this._textData.charAt(this._parseIndex++); - - if (ch == "\n") { - ++this._line; - this._charLineIndex = 0; - } else if (ch != "\r") - ++this._charLineIndex; - - if (this._parseIndex >= this._textData.length) - this._reachedEOF = true; - - return ch; - } - - /** - * Retrieves the next integer in the data stream. - */ - private getNextInt():number /*int*/ - { - var i:number = parseInt(this.getNextToken()); - if (isNaN(i)) - this.sendParseError("int type"); - return i; - } - - /** - * Retrieves the next floating point number in the data stream. - */ - private getNextNumber():number - { - var f:number = parseFloat(this.getNextToken()); - if (isNaN(f)) - this.sendParseError("float type"); - return f; - } - - /** - * Retrieves the next 3d vector in the data stream. - */ - private parseVector3D():Vector3D - { - var vec:Vector3D = new Vector3D(); - var ch:string = this.getNextToken(); - - if (ch != "(") - this.sendParseError("("); - vec.x = -this.getNextNumber(); - vec.y = this.getNextNumber(); - vec.z = this.getNextNumber(); - - if (this.getNextToken() != ")") - this.sendParseError(")"); - - return vec; - } - - /** - * Retrieves the next quaternion in the data stream. - */ - private parseQuaternion():Quaternion - { - var quat:Quaternion = new Quaternion(); - var ch:string = this.getNextToken(); - - if (ch != "(") - this.sendParseError("("); - quat.x = this.getNextNumber(); - quat.y = -this.getNextNumber(); - quat.z = -this.getNextNumber(); - - // quat supposed to be unit length - var t:number = 1 - quat.x*quat.x - quat.y*quat.y - quat.z*quat.z; - quat.w = t < 0? 0 : -Math.sqrt(t); - - if (this.getNextToken() != ")") - this.sendParseError(")"); - - var rotQuat:Quaternion = new Quaternion(); - rotQuat.multiply(this._rotationQuat, quat); - return rotQuat; - } - - /** - * Parses the command line data. - */ - private parseCMD():void - { - // just ignore the command line property - this.parseLiteralstring(); - } - - /** - * Retrieves the next literal string in the data stream. A literal string is a sequence of characters bounded - * by double quotes. - */ - private parseLiteralstring():string - { - this.skipWhiteSpace(); - - var ch:string = this.getNextChar(); - var str:string = ""; - - if (ch != "\"") - this.sendParseError("\""); - - do { - if (this._reachedEOF) - this.sendEOFError(); - ch = this.getNextChar(); - if (ch != "\"") - str += ch; - } while (ch != "\""); - - return str; - } - - /** - * Throws an end-of-file error when a premature end of file was encountered. - */ - private sendEOFError():void - { - throw new Error("Unexpected end of file"); - } - - /** - * Throws an error when an unexpected token was encountered. - * @param expected The token type that was actually expected. - */ - private sendParseError(expected:string):void - { - throw new Error("Unexpected token at line " + (this._line + 1) + ", character " + this._charLineIndex + ". " + expected + " expected, but " + this._textData.charAt(this._parseIndex - 1) + " encountered"); - } - - /** - * Throws an error when an unknown keyword was encountered. - */ - private sendUnknownKeywordError():void - { - throw new Error("Unknown keyword at line " + (this._line + 1) + ", character " + this._charLineIndex + ". "); - } - } -} - - -class VertexData -{ - public index:number /*int*/; - public s:number; - public t:number; - public startWeight:number /*int*/; - public countWeight:number /*int*/; -} - -class JointData -{ - public index:number /*int*/; - public joint:number /*int*/; - public bias:number; - public pos:away.geom.Vector3D; -} - -class MeshData -{ - public vertexData:Array; - public weightData:Array; - public indices:Array /*uint*/; -} diff --git a/src/away/parsers/Max3DSParser.ts b/src/away/parsers/Max3DSParser.ts deleted file mode 100644 index ce97cdc44..000000000 --- a/src/away/parsers/Max3DSParser.ts +++ /dev/null @@ -1,866 +0,0 @@ -/// - -module away.parsers -{ - import SubGeometry = away.base.TriangleSubGeometry; - import DefaultMaterialManager = away.materials.DefaultMaterialManager; - import TriangleMethodMaterial = away.materials.TriangleMethodMaterial; - import TriangleMaterialMode = away.materials.TriangleMaterialMode; - import URLLoaderDataFormat = away.net.URLLoaderDataFormat; - import Texture2DBase = away.textures.Texture2DBase; - import ByteArray = away.utils.ByteArray; - - /** - * Max3DSParser provides a parser for the 3ds data type. - */ - export class Max3DSParser extends ParserBase - { - private _byteData:ByteArray; - - private _textures:Object; - private _materials:Object; - private _unfinalized_objects:Object; - - private _cur_obj_end:number /*uint*/; - private _cur_obj:ObjectVO; - - private _cur_mat_end:number /*uint*/; - private _cur_mat:MaterialVO; - private _useSmoothingGroups:boolean; - - /** - * Creates a new Max3DSParser object. - * - * @param useSmoothingGroups Determines whether the parser looks for smoothing groups in the 3ds file or assumes uniform smoothing. Defaults to true. - */ - constructor(useSmoothingGroups:boolean = true) - { - super(URLLoaderDataFormat.ARRAY_BUFFER); - - this._useSmoothingGroups = useSmoothingGroups; - } - - /** - * Indicates whether or not a given file extension is supported by the parser. - * @param extension The file extension of a potential file to be parsed. - * @return Whether or not the given file type is supported. - */ - public static supportsType(extension:string):boolean - { - extension = extension.toLowerCase(); - return extension == "3ds"; - } - - /** - * Tests whether a data block can be parsed by the parser. - * @param data The data block to potentially be parsed. - * @return Whether or not the given data is supported. - */ - public static supportsData(data:any):boolean - { - var ba:ByteArray; - - ba = ParserUtils.toByteArray(data); - if (ba) { - ba.position = 0; - if (ba.readShort() == 0x4d4d) - return true; - } - - return false; - } - - /** - * @inheritDoc - */ - public _iResolveDependency(resourceDependency:ResourceDependency):void - { - if (resourceDependency.assets.length == 1) { - var asset:away.library.IAsset; - - asset = resourceDependency.assets[0]; - if (asset.assetType == away.library.AssetType.TEXTURE) { - var tex:TextureVO; - - tex = this._textures[resourceDependency.id]; - tex.texture = asset; - } - } - } - - /** - * @inheritDoc - */ - public _iResolveDependencyFailure(resourceDependency:ResourceDependency):void - { - // TODO: Implement - } - - /** - * @inheritDoc - */ - public _pProceedParsing():boolean - { - if (!this._byteData) { - this._byteData = this._pGetByteData(); - this._byteData.position = 0; - - //---------------------------------------------------------------------------- - // LITTLE_ENDIAN - Default for ArrayBuffer / Not implemented in ByteArray - //---------------------------------------------------------------------------- - //this._byteData.endian = Endian.LITTLE_ENDIAN;// Should be default - //---------------------------------------------------------------------------- - - this._textures = {}; - this._materials = {}; - this._unfinalized_objects = {}; - } - - // TODO: With this construct, the loop will run no-op for as long - // as there is time once file has finished reading. Consider a nice - // way to stop loop when byte array is empty, without putting it in - // the while-conditional, which will prevent finalizations from - // happening after the last chunk. - while (this._pHasTime()) { - - // If we are currently working on an object, and the most recent chunk was - // the last one in that object, finalize the current object. - if (this._cur_mat && this._byteData.position >= this._cur_mat_end) - this.finalizeCurrentMaterial(); - else if (this._cur_obj && this._byteData.position >= this._cur_obj_end) { - // Can't finalize at this point, because we have to wait until the full - // animation section has been parsed for any potential pivot definitions - this._unfinalized_objects[this._cur_obj.name] = this._cur_obj; - this._cur_obj_end = Number.MAX_VALUE /*uint*/; - this._cur_obj = null; - } - - if (this._byteData.getBytesAvailable() > 0) { - var cid:number /*uint*/; - var len:number /*uint*/; - var end:number /*uint*/; - - cid = this._byteData.readUnsignedShort(); - len = this._byteData.readUnsignedInt(); - end = this._byteData.position + (len - 6); - - switch (cid) { - case 0x4D4D: // MAIN3DS - case 0x3D3D: // EDIT3DS - case 0xB000: // KEYF3DS - // This types are "container chunks" and contain only - // sub-chunks (no data on their own.) This means that - // there is nothing more to parse at this point, and - // instead we should progress to the next chunk, which - // will be the first sub-chunk of this one. - continue; - break; - - case 0xAFFF: // MATERIAL - this._cur_mat_end = end; - this._cur_mat = this.parseMaterial(); - break; - - case 0x4000: // EDIT_OBJECT - this._cur_obj_end = end; - this._cur_obj = new ObjectVO(); - this._cur_obj.name = this.readNulTermstring(); - this._cur_obj.materials = new Array(); - this._cur_obj.materialFaces = {}; - break; - - case 0x4100: // OBJ_TRIMESH - this._cur_obj.type = away.library.AssetType.MESH; - break; - - case 0x4110: // TRI_VERTEXL - this.parseVertexList(); - break; - - case 0x4120: // TRI_FACELIST - this.parseFaceList(); - break; - - case 0x4140: // TRI_MAPPINGCOORDS - this.parseUVList(); - break; - - case 0x4130: // Face materials - this.parseFaceMaterialList(); - break; - - case 0x4160: // Transform - this._cur_obj.transform = this.readTransform(); - break; - - case 0xB002: // Object animation (including pivot) - this.parseObjectAnimation(end); - break; - - case 0x4150: // Smoothing groups - this.parseSmoothingGroups(); - break; - - default: - // Skip this (unknown) chunk - this._byteData.position += (len - 6); - break; - } - - // Pause parsing if there were any dependencies found during this - // iteration (i.e. if there are any dependencies that need to be - // retrieved at this time.) - if (this.dependencies.length) { - this._pPauseAndRetrieveDependencies(); - break; - } - } - } - - // More parsing is required if the entire byte array has not yet - // been read, or if there is a currently non-finalized object in - // the pipeline. - if (this._byteData.getBytesAvailable() || this._cur_obj || this._cur_mat) { - return ParserBase.MORE_TO_PARSE; - } else { - var name:string; - - // Finalize any remaining objects before ending. - for (name in this._unfinalized_objects) { - var obj:away.containers.DisplayObjectContainer; - obj = this.constructObject(this._unfinalized_objects[name]); - if (obj) { - //add to the content property - ( this._pContent).addChild(obj); - - this._pFinalizeAsset(obj, name); - } - } - - return ParserBase.PARSING_DONE; - } - } - - public _pStartParsing(frameLimit:number) - { - super._pStartParsing(frameLimit); - - //create a content object for Loaders - this._pContent = new away.containers.DisplayObjectContainer(); - } - - private parseMaterial():MaterialVO - { - var mat:MaterialVO; - - mat = new MaterialVO(); - - while (this._byteData.position < this._cur_mat_end) { - var cid:number /*uint*/; - var len:number /*uint*/; - var end:number /*uint*/; - - cid = this._byteData.readUnsignedShort(); - len = this._byteData.readUnsignedInt(); - end = this._byteData.position + (len - 6); - - switch (cid) { - case 0xA000: // Material name - mat.name = this.readNulTermstring(); - break; - - case 0xA010: // Ambient color - mat.ambientColor = this.readColor(); - break; - - case 0xA020: // Diffuse color - mat.diffuseColor = this.readColor(); - break; - - case 0xA030: // Specular color - mat.specularColor = this.readColor(); - break; - - case 0xA081: // Two-sided, existence indicates "true" - mat.twoSided = true; - break; - - case 0xA200: // Main (color) texture - mat.colorMap = this.parseTexture(end); - break; - - case 0xA204: // Specular map - mat.specularMap = this.parseTexture(end); - break; - - default: - this._byteData.position = end; - break; - } - } - - return mat; - } - - private parseTexture(end:number /*uint*/):TextureVO - { - var tex:TextureVO; - - tex = new TextureVO(); - - while (this._byteData.position < end) { - var cid:number /*uint*/; - var len:number /*uint*/; - - cid = this._byteData.readUnsignedShort(); - len = this._byteData.readUnsignedInt(); - - switch (cid) { - case 0xA300: - tex.url = this.readNulTermstring(); - break; - - default: - // Skip this unknown texture sub-chunk - this._byteData.position += (len - 6); - break; - } - } - - this._textures[tex.url] = tex; - this._pAddDependency(tex.url, new away.net.URLRequest(tex.url)); - - return tex; - } - - private parseVertexList():void - { - var i:number /*uint*/; - var len:number /*uint*/; - var count:number /*uint*/; - - count = this._byteData.readUnsignedShort(); - this._cur_obj.verts = new Array(count*3); - - i = 0; - len = this._cur_obj.verts.length; - while (i < len) { - var x:number, y:number, z:number; - - x = this._byteData.readFloat(); - y = this._byteData.readFloat(); - z = this._byteData.readFloat(); - - this._cur_obj.verts[i++] = x; - this._cur_obj.verts[i++] = z; - this._cur_obj.verts[i++] = y; - } - } - - private parseFaceList():void - { - var i:number /*uint*/; - var len:number /*uint*/; - var count:number /*uint*/; - - count = this._byteData.readUnsignedShort(); - this._cur_obj.indices = new Array(count*3) /*uint*/; - - i = 0; - len = this._cur_obj.indices.length; - while (i < len) { - var i0:number /*uint*/, i1:number /*uint*/, i2:number /*uint*/; - - i0 = this._byteData.readUnsignedShort(); - i1 = this._byteData.readUnsignedShort(); - i2 = this._byteData.readUnsignedShort(); - - this._cur_obj.indices[i++] = i0; - this._cur_obj.indices[i++] = i2; - this._cur_obj.indices[i++] = i1; - - // Skip "face info", irrelevant in Away3D - this._byteData.position += 2; - } - - this._cur_obj.smoothingGroups = new Array(count) /*uint*/; - } - - private parseSmoothingGroups():void - { - var len:number /*uint*/ = this._cur_obj.indices.length/3; - var i:number /*uint*/ = 0; - while (i < len) { - this._cur_obj.smoothingGroups[i] = this._byteData.readUnsignedInt(); - i++; - } - } - - private parseUVList():void - { - var i:number /*uint*/; - var len:number /*uint*/; - var count:number /*uint*/; - - count = this._byteData.readUnsignedShort(); - this._cur_obj.uvs = new Array(count*2); - - i = 0; - len = this._cur_obj.uvs.length; - while (i < len) { - this._cur_obj.uvs[i++] = this._byteData.readFloat(); - this._cur_obj.uvs[i++] = 1.0 - this._byteData.readFloat(); - } - } - - private parseFaceMaterialList():void - { - var mat:string; - var count:number /*uint*/; - var i:number /*uint*/; - var faces:Array /*uint*/; - - mat = this.readNulTermstring(); - count = this._byteData.readUnsignedShort(); - - faces = new Array(count) /*uint*/; - i = 0; - while (i < faces.length) - faces[i++] = this._byteData.readUnsignedShort(); - - this._cur_obj.materials.push(mat); - this._cur_obj.materialFaces[mat] = faces; - } - - private parseObjectAnimation(end:number):void - { - var vo:ObjectVO; - var obj:away.containers.DisplayObjectContainer; - var pivot:away.geom.Vector3D; - var name:string; - var hier:number /*uint*/; - - // Pivot defaults to origin - pivot = new away.geom.Vector3D; - - while (this._byteData.position < end) { - var cid:number /*uint*/; - var len:number /*uint*/; - - cid = this._byteData.readUnsignedShort(); - len = this._byteData.readUnsignedInt(); - - switch (cid) { - case 0xb010: // Name/hierarchy - name = this.readNulTermstring(); - this._byteData.position += 4; - hier = this._byteData.readShort(); - break; - - case 0xb013: // Pivot - pivot.x = this._byteData.readFloat(); - pivot.z = this._byteData.readFloat(); - pivot.y = this._byteData.readFloat(); - break; - - default: - this._byteData.position += (len - 6); - break; - } - } - - // If name is "$$$DUMMY" this is an empty object (e.g. a container) - // and will be ignored in this version of the parser - // TODO: Implement containers in 3DS parser. - if (name != '$$$DUMMY' && this._unfinalized_objects.hasOwnProperty(name)) { - vo = this._unfinalized_objects[name]; - obj = this.constructObject(vo, pivot); - - if (obj) { - //add to the content property - ( this._pContent).addChild(obj); - - this._pFinalizeAsset(obj, vo.name); - } - - - delete this._unfinalized_objects[name]; - } - } - - private constructObject(obj:ObjectVO, pivot:away.geom.Vector3D = null):away.containers.DisplayObjectContainer - { - if (obj.type == away.library.AssetType.MESH) { - var i:number /*uint*/; - var sub:away.base.TriangleSubGeometry; - var geom:away.base.Geometry; - var mat:MaterialBase; - var mesh:away.entities.Mesh; - var mtx:away.geom.Matrix3D; - var vertices:Array; - var faces:Array; - - if (obj.materials.length > 1) - console.log("The Away3D 3DS parser does not support multiple materials per mesh at this point."); - - // Ignore empty objects - if (!obj.indices || obj.indices.length == 0) - return null; - - vertices = new Array(obj.verts.length/3); - faces = new Array(obj.indices.length/3); - - this.prepareData(vertices, faces, obj); - - if (this._useSmoothingGroups) - this.applySmoothGroups(vertices, faces); - - obj.verts = new Array(vertices.length*3); - for (i = 0; i < vertices.length; i++) { - obj.verts[i*3] = vertices[i].x; - obj.verts[i*3 + 1] = vertices[i].y; - obj.verts[i*3 + 2] = vertices[i].z; - } - obj.indices = new Array(faces.length*3) /*uint*/; - - for (i = 0; i < faces.length; i++) { - obj.indices[i*3] = faces[i].a; - obj.indices[i*3 + 1] = faces[i].b; - obj.indices[i*3 + 2] = faces[i].c; - } - - if (obj.uvs) { - // If the object had UVs to start with, use UVs generated by - // smoothing group splitting algorithm. Otherwise those UVs - // will be nonsense and should be skipped. - obj.uvs = new Array(vertices.length*2); - for (i = 0; i < vertices.length; i++) { - obj.uvs[i*2] = vertices[i].u; - obj.uvs[i*2 + 1] = vertices[i].v; - } - } - - geom = new away.base.Geometry(); - - // Construct sub-geometries (potentially splitting buffers) - // and add them to geometry. - sub = new SubGeometry(true); - sub.updateIndices(obj.indices); - sub.updatePositions(obj.verts); - sub.updateUVs(obj.uvs); - - geom.addSubGeometry(sub); - - if (obj.materials.length > 0) { - var mname:string; - mname = obj.materials[0]; - mat = this._materials[mname].material; - } - - // Apply pivot translation to geometry if a pivot was - // found while parsing the keyframe chunk earlier. - if (pivot) { - if (obj.transform) { - // If a transform was found while parsing the - // object chunk, use it to find the local pivot vector - var dat:Array = obj.transform.concat(); - dat[12] = 0; - dat[13] = 0; - dat[14] = 0; - mtx = new away.geom.Matrix3D(dat); - pivot = mtx.transformVector(pivot); - } - - pivot.scaleBy(-1); - - mtx = new away.geom.Matrix3D(); - mtx.appendTranslation(pivot.x, pivot.y, pivot.z); - geom.applyTransformation(mtx); - } - - // Apply transformation to geometry if a transformation - // was found while parsing the object chunk earlier. - if (obj.transform) { - mtx = new away.geom.Matrix3D(obj.transform); - mtx.invert(); - geom.applyTransformation(mtx); - } - - // Final transform applied to geometry. Finalize the geometry, - // which will no longer be modified after this point. - this._pFinalizeAsset(geom, obj.name.concat('_geom')); - - // Build mesh and return it - mesh = new away.entities.Mesh(geom, mat); - mesh.transform.matrix3D = new away.geom.Matrix3D(obj.transform); - return mesh; - } - - // If reached, unknown - return null; - } - - private prepareData(vertices:Array, faces:Array, obj:ObjectVO):void - { - // convert raw ObjectVO's data to structured VertexVO and FaceVO - var i:number /*int*/; - var j:number /*int*/; - var k:number /*int*/; - var len:number /*int*/ = obj.verts.length; - for (i = 0, j = 0, k = 0; i < len;) { - var v:VertexVO = new VertexVO; - v.x = obj.verts[i++]; - v.y = obj.verts[i++]; - v.z = obj.verts[i++]; - if (obj.uvs) { - v.u = obj.uvs[j++]; - v.v = obj.uvs[j++]; - } - vertices[k++] = v; - } - len = obj.indices.length; - for (i = 0, k = 0; i < len;) { - var f:FaceVO = new FaceVO(); - f.a = obj.indices[i++]; - f.b = obj.indices[i++]; - f.c = obj.indices[i++]; - f.smoothGroup = obj.smoothingGroups[k] || 0; - faces[k++] = f; - } - } - - private applySmoothGroups(vertices:Array, faces:Array):void - { - // clone vertices according to following rule: - // clone if vertex's in faces from groups 1+2 and 3 - // don't clone if vertex's in faces from groups 1+2, 3 and 1+3 - - var i:number /*int*/; - var j:number /*int*/; - var k:number /*int*/; - var l:number /*int*/; - var len:number /*int*/; - var numVerts:number /*uint*/ = vertices.length; - var numFaces:number /*uint*/ = faces.length; - - // extract groups data for vertices - var vGroups:Array> /*uint*/ = new Array>(numVerts) /*uint*/; - for (i = 0; i < numVerts; i++) - vGroups[i] = new Array() /*uint*/; - for (i = 0; i < numFaces; i++) { - var face:FaceVO = faces[i]; - for (j = 0; j < 3; j++) { - var groups:Array /*uint*/ = vGroups[(j == 0)? face.a : ((j == 1)? face.b : face.c)]; - var group:number /*uint*/ = face.smoothGroup; - for (k = groups.length - 1; k >= 0; k--) { - if ((group & groups[k]) > 0) { - group |= groups[k]; - groups.splice(k, 1); - k = groups.length - 1; - } - } - groups.push(group); - } - } - // clone vertices - var vClones:Array> /*uint*/ = new Array>(numVerts) /*uint*/; - for (i = 0; i < numVerts; i++) { - if ((len = vGroups[i].length) < 1) - continue; - var clones:Array /*uint*/ = new Array(len) /*uint*/; - vClones[i] = clones; - clones[0] = i; - var v0:VertexVO = vertices[i]; - for (j = 1; j < len; j++) { - var v1:VertexVO = new VertexVO; - v1.x = v0.x; - v1.y = v0.y; - v1.z = v0.z; - v1.u = v0.u; - v1.v = v0.v; - clones[j] = vertices.length; - vertices.push(v1); - } - } - numVerts = vertices.length; - - for (i = 0; i < numFaces; i++) { - face = faces[i]; - group = face.smoothGroup; - for (j = 0; j < 3; j++) { - k = (j == 0)? face.a : ((j == 1)? face.b : face.c); - groups = vGroups[k]; - len = groups.length; - clones = vClones[k]; - for (l = 0; l < len; l++) { - if (((group == 0) && (groups[l] == 0)) || ((group & groups[l]) > 0)) { - var index:number /*uint*/ = clones[l]; - if (group == 0) { - // vertex is unique if no smoothGroup found - groups.splice(l, 1); - clones.splice(l, 1); - } - if (j == 0) - face.a = index; else if (j == 1) - face.b = index; else - face.c = index; - l = len; - } - } - } - } - } - - private finalizeCurrentMaterial():void - { - var mat:TriangleMethodMaterial; - - if (this._cur_mat.colorMap) - mat = new TriangleMethodMaterial(this._cur_mat.colorMap.texture || DefaultMaterialManager.getDefaultTexture()); - else - mat = new TriangleMethodMaterial(this._cur_mat.ambientColor); - - mat.diffuseColor = this._cur_mat.diffuseColor; - mat.specularColor = this._cur_mat.specularColor; - - if (this.materialMode >= 2) - mat.materialMode = TriangleMaterialMode.MULTI_PASS - - mat.bothSides = this._cur_mat.twoSided; - - this._pFinalizeAsset(mat, this._cur_mat.name); - - this._materials[this._cur_mat.name] = this._cur_mat; - this._cur_mat.material = mat; - - this._cur_mat = null; - } - - private readNulTermstring():string - { - var chr:number /*int*/; - var str:string = ""; - - while ((chr = this._byteData.readUnsignedByte()) > 0) - str += String.fromCharCode(chr); - - return str; - } - - private readTransform():Array - { - var data:Array; - - data = new Array(16); - - // X axis - data[0] = this._byteData.readFloat(); // X - data[2] = this._byteData.readFloat(); // Z - data[1] = this._byteData.readFloat(); // Y - data[3] = 0; - - // Z axis - data[8] = this._byteData.readFloat(); // X - data[10] = this._byteData.readFloat(); // Z - data[9] = this._byteData.readFloat(); // Y - data[11] = 0; - - // Y Axis - data[4] = this._byteData.readFloat(); // X - data[6] = this._byteData.readFloat(); // Z - data[5] = this._byteData.readFloat(); // Y - data[7] = 0; - - // Translation - data[12] = this._byteData.readFloat(); // X - data[14] = this._byteData.readFloat(); // Z - data[13] = this._byteData.readFloat(); // Y - data[15] = 1; - - return data; - } - - private readColor():number /*int*/ - { - var cid:number /*int*/; - var len:number /*int*/; - var r:number /*int*/, g:number /*int*/, b:number /*int*/; - - cid = this._byteData.readUnsignedShort(); - len = this._byteData.readUnsignedInt(); - - switch (cid) { - case 0x0010: // Floats - r = this._byteData.readFloat()*255; - g = this._byteData.readFloat()*255; - b = this._byteData.readFloat()*255; - break; - case 0x0011: // 24-bit color - r = this._byteData.readUnsignedByte(); - g = this._byteData.readUnsignedByte(); - b = this._byteData.readUnsignedByte(); - break; - default: - this._byteData.position += (len - 6); - break; - } - - return (r << 16) | (g << 8) | b; - } - } -} - -import Vector3D = away.geom.Vector3D; - -class TextureVO -{ - public url:string; - public texture:away.textures.Texture2DBase; -} - -class MaterialVO -{ - public name:string; - public ambientColor:number /*int*/; - public diffuseColor:number /*int*/; - public specularColor:number /*int*/; - public twoSided:boolean; - public colorMap:TextureVO; - public specularMap:TextureVO; - public material:away.materials.MaterialBase; -} - -class ObjectVO -{ - public name:string; - public type:string; - public pivotX:number; - public pivotY:number; - public pivotZ:number; - public transform:Array; - public verts:Array; - public indices:Array /*int*/; - public uvs:Array; - public materialFaces:Object; - public materials:Array; - public smoothingGroups:Array /*int*/; -} - -class VertexVO -{ - public x:number; - public y:number; - public z:number; - public u:number; - public v:number; - public normal:Vector3D; - public tangent:Vector3D; -} - -class FaceVO -{ - public a:number /*int*/; - public b:number /*int*/; - public c:number /*int*/; - public smoothGroup:number /*int*/; -} \ No newline at end of file diff --git a/src/away/parsers/OBJParser.ts b/src/away/parsers/OBJParser.ts deleted file mode 100644 index 581b21831..000000000 --- a/src/away/parsers/OBJParser.ts +++ /dev/null @@ -1,1145 +0,0 @@ -/// - -module away.parsers -{ - import TriangleSubGeometry = away.base.TriangleSubGeometry; - import Mesh = away.entities.Mesh; - import DefaultMaterialManager = away.materials.DefaultMaterialManager; - import BasicSpecularMethod = away.materials.SpecularBasicMethod; - import TriangleMethodMaterial = away.materials.TriangleMethodMaterial; - import TriangleMaterialMode = away.materials.TriangleMaterialMode; - import URLLoaderDataFormat = away.net.URLLoaderDataFormat; - - /** - * OBJParser provides a parser for the OBJ data type. - */ - export class OBJParser extends ParserBase - { - private _textData:string; - private _startedParsing:boolean; - private _charIndex:number; - private _oldIndex:number; - private _stringLength:number; - private _currentObject:ObjectGroup; - private _currentGroup:Group; - private _currentMaterialGroup:MaterialGroup; - private _objects:Array; - private _materialIDs:string[]; - private _materialLoaded:Array; - private _materialSpecularData:Array; - private _meshes:Array; - private _lastMtlID:string; - private _objectIndex:number; - private _realIndices; - private _vertexIndex:number; - private _vertices:Array; - private _vertexNormals:Array; - private _uvs:Array; - private _scale:number; - private _mtlLib:boolean; - private _mtlLibLoaded:boolean = true; - private _activeMaterialID:string = ""; - - /** - * Creates a new OBJParser object. - * @param uri The url or id of the data or file to be parsed. - * @param extra The holder for extra contextual data that the parser might need. - */ - constructor(scale:number = 1) - { - super(URLLoaderDataFormat.TEXT); - this._scale = scale; - } - - /** - * Scaling factor applied directly to vertices data - * @param value The scaling factor. - */ - public set scale(value:number) - { - this._scale = value; - } - - /** - * Indicates whether or not a given file extension is supported by the parser. - * @param extension The file extension of a potential file to be parsed. - * @return Whether or not the given file type is supported. - */ - public static supportsType(extension:string):boolean - { - extension = extension.toLowerCase(); - return extension == "obj"; - } - - /** - * Tests whether a data block can be parsed by the parser. - * @param data The data block to potentially be parsed. - * @return Whether or not the given data is supported. - */ - public static supportsData(data:any):boolean - { - var content:string = ParserUtils.toString(data); - var hasV:boolean = false; - var hasF:boolean = false; - - if (content) { - hasV = content.indexOf("\nv ") != -1; - hasF = content.indexOf("\nf ") != -1; - } - - return hasV && hasF; - } - - /** - * @inheritDoc - */ - public _iResolveDependency(resourceDependency:ResourceDependency) - { - if (resourceDependency.id == 'mtl') { - var str:string = ParserUtils.toString(resourceDependency.data); - this.parseMtl(str); - - } else { - var asset:away.library.IAsset; - - if (resourceDependency.assets.length != 1) { - return; - } - - asset = resourceDependency.assets[0]; - - if (asset.assetType == away.library.AssetType.TEXTURE) { - - var lm:LoadedMaterial = new LoadedMaterial(); - lm.materialID = resourceDependency.id; - lm.texture = asset; - - this._materialLoaded.push(lm); - - if (this._meshes.length > 0) { - this.applyMaterial(lm); - } - } - } - } - - /** - * @inheritDoc - */ - public _iResolveDependencyFailure(resourceDependency:ResourceDependency) - { - if (resourceDependency.id == "mtl") { - this._mtlLib = false; - this._mtlLibLoaded = false; - } else { - var lm:LoadedMaterial = new LoadedMaterial(); - lm.materialID = resourceDependency.id; - this._materialLoaded.push(lm); - } - - if (this._meshes.length > 0) - this.applyMaterial(lm); - } - - /** - * @inheritDoc - */ - public _pProceedParsing():boolean - { - var line:string; - var creturn:string = String.fromCharCode(10); - var trunk; - - if (!this._startedParsing) { - this._textData = this._pGetTextData(); - // Merge linebreaks that are immediately preceeded by - // the "escape" backward slash into single lines. - this._textData = this._textData.replace(/\\[\r\n]+\s*/gm, ' '); - } - - if (this._textData.indexOf(creturn) == -1) - creturn = String.fromCharCode(13); - - if (!this._startedParsing) { - this._startedParsing = true; - this._vertices = new Array(); - this._vertexNormals = new Array(); - this._materialIDs = new Array(); - this._materialLoaded = new Array(); - this._meshes = new Array(); - this._uvs = new Array(); - this._stringLength = this._textData.length; - this._charIndex = this._textData.indexOf(creturn, 0); - this._oldIndex = 0; - this._objects = new Array(); - this._objectIndex = 0; - } - - while (this._charIndex < this._stringLength && this._pHasTime()) { - this._charIndex = this._textData.indexOf(creturn, this._oldIndex); - - if (this._charIndex == -1) - this._charIndex = this._stringLength; - - line = this._textData.substring(this._oldIndex, this._charIndex); - line = line.split('\r').join(""); - line = line.replace(" ", " "); - trunk = line.split(" "); - this._oldIndex = this._charIndex + 1; - this.parseLine(trunk); - - // If whatever was parsed on this line resulted in the - // parsing being paused to retrieve dependencies, break - // here and do not continue parsing until un-paused. - if (this.parsingPaused) { - return ParserBase.MORE_TO_PARSE; - } - - } - - if (this._charIndex >= this._stringLength) { - - if (this._mtlLib && !this._mtlLibLoaded) { - return ParserBase.MORE_TO_PARSE; - } - - this.translate(); - this.applyMaterials(); - - return ParserBase.PARSING_DONE; - } - - return ParserBase.MORE_TO_PARSE; - } - - public _pStartParsing(frameLimit:number) - { - super._pStartParsing(frameLimit); - - //create a content object for Loaders - this._pContent = new away.containers.DisplayObjectContainer(); - } - - /** - * Parses a single line in the OBJ file. - */ - private parseLine(trunk) - { - switch (trunk[0]) { - - case "mtllib": - - this._mtlLib = true; - this._mtlLibLoaded = false; - this.loadMtl(trunk[1]); - - break; - - case "g": - - this.createGroup(trunk); - - break; - - case "o": - - this.createObject(trunk); - - break; - - case "usemtl": - - if (this._mtlLib) { - - if (!trunk[1]) - trunk[1] = "def000"; - - this._materialIDs.push(trunk[1]); - this._activeMaterialID = trunk[1]; - - if (this._currentGroup) - this._currentGroup.materialID = this._activeMaterialID; - } - - break; - - case "v": - - this.parseVertex(trunk); - - break; - - case "vt": - - this.parseUV(trunk); - - break; - - case "vn": - - this.parseVertexNormal(trunk); - - break; - - case "f": - - this.parseFace(trunk); - - } - } - - /** - * Converts the parsed data into an Away3D scenegraph structure - */ - private translate() - { - for (var objIndex:number = 0; objIndex < this._objects.length; ++objIndex) { - var groups:Array = this._objects[objIndex].groups; - var numGroups:number = groups.length; - var materialGroups:Array; - var numMaterialGroups:number; - var geometry:away.base.Geometry; - var mesh:Mesh; - - var m:number; - var sm:number; - var bmMaterial:TriangleMethodMaterial; - - for (var g:number = 0; g < numGroups; ++g) { - geometry = new away.base.Geometry(); - materialGroups = groups[g].materialGroups; - numMaterialGroups = materialGroups.length; - - for (m = 0; m < numMaterialGroups; ++m) - this.translateMaterialGroup(materialGroups[m], geometry); - - if (geometry.subGeometries.length == 0) - continue; - - // Finalize and force type-based name - this._pFinalizeAsset( geometry);//, ""); - - bmMaterial = new TriangleMethodMaterial(DefaultMaterialManager.getDefaultTexture()); - - //check for multipass - if (this.materialMode >= 2) - bmMaterial.materialMode = TriangleMaterialMode.MULTI_PASS; - - mesh = new Mesh(geometry, bmMaterial); - - if (this._objects[objIndex].name) { - // this is a full independent object ('o' tag in OBJ file) - mesh.name = this._objects[objIndex].name; - - } else if (groups[g].name) { - - // this is a group so the sub groups contain the actual mesh object names ('g' tag in OBJ file) - mesh.name = groups[g].name; - - } else { - // No name stored. Use empty string which will force it - // to be overridden by finalizeAsset() to type default. - mesh.name = ""; - } - - this._meshes.push(mesh); - - if (groups[g].materialID != "") - bmMaterial.name = groups[g].materialID + "~" + mesh.name; else - bmMaterial.name = this._lastMtlID + "~" + mesh.name; - - if (mesh.subMeshes.length > 1) { - for (sm = 1; sm < mesh.subMeshes.length; ++sm) - mesh.subMeshes[sm].material = bmMaterial; - } - - //add to the content property - ( this._pContent).addChild(mesh); - - this._pFinalizeAsset( mesh); - } - } - } - - /** - * Translates an obj's material group to a subgeometry. - * @param materialGroup The material group data to convert. - * @param geometry The Geometry to contain the converted SubGeometry. - */ - private translateMaterialGroup(materialGroup:MaterialGroup, geometry:away.base.Geometry) - { - var faces:Array = materialGroup.faces; - var face:FaceData; - var numFaces:number = faces.length; - var numVerts:number; - var sub:away.base.TriangleSubGeometry; - - var vertices:Array = new Array(); - var uvs:Array = new Array(); - var normals:Array = new Array(); - var indices:Array /*uint*/ = new Array(); - - this._realIndices = []; - this._vertexIndex = 0; - - var j:number; - for (var i:number = 0; i < numFaces; ++i) { - - face = faces[i]; - numVerts = face.indexIds.length - 1; - - for (j = 1; j < numVerts; ++j) { - - this.translateVertexData(face, j, vertices, uvs, indices, normals); - this.translateVertexData(face, 0, vertices, uvs, indices, normals); - this.translateVertexData(face, j + 1, vertices, uvs, indices, normals); - } - } - if (vertices.length > 0) { - sub = new TriangleSubGeometry(true); - sub.autoDeriveNormals = normals.length? false : true; - sub.updateIndices(indices); - sub.updatePositions(vertices); - sub.updateVertexNormals(normals); - sub.updateUVs(uvs); - - geometry.addSubGeometry(sub); - } - } - - private translateVertexData(face:FaceData, vertexIndex:number, vertices:Array, uvs:Array, indices:Array /*uint*/, normals:Array) - { - var index:number; - var vertex:Vertex; - var vertexNormal:Vertex; - var uv:UV; - - if (!this._realIndices[face.indexIds[vertexIndex]]) { - - index = this._vertexIndex; - this._realIndices[face.indexIds[vertexIndex]] = ++this._vertexIndex; - vertex = this._vertices[face.vertexIndices[vertexIndex] - 1]; - vertices.push(vertex.x*this._scale, vertex.y*this._scale, vertex.z*this._scale); - - if (face.normalIndices.length > 0) { - vertexNormal = this._vertexNormals[face.normalIndices[vertexIndex] - 1]; - normals.push(vertexNormal.x, vertexNormal.y, vertexNormal.z); - } - - if (face.uvIndices.length > 0) { - - try { - uv = this._uvs[face.uvIndices[vertexIndex] - 1]; - uvs.push(uv.u, uv.v); - - } catch (e) { - - switch (vertexIndex) { - case 0: - uvs.push(0, 1); - break; - case 1: - uvs.push(.5, 0); - break; - case 2: - uvs.push(1, 1); - } - } - - } - - } else { - index = this._realIndices[face.indexIds[vertexIndex]] - 1; - } - - indices.push(index); - } - - /** - * Creates a new object group. - * @param trunk The data block containing the object tag and its parameters - */ - private createObject(trunk) - { - this._currentGroup = null; - this._currentMaterialGroup = null; - this._objects.push(this._currentObject = new ObjectGroup()); - - if (trunk) - this._currentObject.name = trunk[1]; - } - - /** - * Creates a new group. - * @param trunk The data block containing the group tag and its parameters - */ - private createGroup(trunk) - { - if (!this._currentObject) - this.createObject(null); - this._currentGroup = new Group(); - - this._currentGroup.materialID = this._activeMaterialID; - - if (trunk) - this._currentGroup.name = trunk[1]; - this._currentObject.groups.push(this._currentGroup); - - this.createMaterialGroup(null); - } - - /** - * Creates a new material group. - * @param trunk The data block containing the material tag and its parameters - */ - private createMaterialGroup(trunk) - { - this._currentMaterialGroup = new MaterialGroup(); - if (trunk) - this._currentMaterialGroup.url = trunk[1]; - this._currentGroup.materialGroups.push(this._currentMaterialGroup); - } - - /** - * Reads the next vertex coordinates. - * @param trunk The data block containing the vertex tag and its parameters - */ - private parseVertex(trunk) - { - //for the very rare cases of other delimiters/charcodes seen in some obj files - - var v1:number, v2:number , v3:number; - if (trunk.length > 4) { - var nTrunk = []; - var val:number; - - for (var i:number = 1; i < trunk.length; ++i) { - val = parseFloat(trunk[i]); - if (!isNaN(val)) - nTrunk.push(val); - } - - v1 = nTrunk[0]; - v2 = nTrunk[1]; - v3 = -nTrunk[2]; - this._vertices.push(new Vertex(v1, v2, v3)); - - } else { - v1 = parseFloat(trunk[1]); - v2 = parseFloat(trunk[2]); - v3 = -parseFloat(trunk[3]); - - this._vertices.push(new Vertex(v1, v2, v3)); - } - - } - - /** - * Reads the next uv coordinates. - * @param trunk The data block containing the uv tag and its parameters - */ - private parseUV(trunk) - { - if (trunk.length > 3) { - var nTrunk = []; - var val:number; - for (var i:number = 1; i < trunk.length; ++i) { - val = parseFloat(trunk[i]); - if (!isNaN(val)) - nTrunk.push(val); - } - this._uvs.push(new UV(nTrunk[0], 1 - nTrunk[1])); - - } else { - this._uvs.push(new UV(parseFloat(trunk[1]), 1 - parseFloat(trunk[2]))); - } - - } - - /** - * Reads the next vertex normal coordinates. - * @param trunk The data block containing the vertex normal tag and its parameters - */ - private parseVertexNormal(trunk) - { - if (trunk.length > 4) { - var nTrunk = []; - var val:number; - for (var i:number = 1; i < trunk.length; ++i) { - val = parseFloat(trunk[i]); - if (!isNaN(val)) - nTrunk.push(val); - } - this._vertexNormals.push(new Vertex(nTrunk[0], nTrunk[1], -nTrunk[2])); - - } else { - this._vertexNormals.push(new Vertex(parseFloat(trunk[1]), parseFloat(trunk[2]), -parseFloat(trunk[3]))); - } - } - - /** - * Reads the next face's indices. - * @param trunk The data block containing the face tag and its parameters - */ - private parseFace(trunk) - { - var len:number = trunk.length; - var face:FaceData = new FaceData(); - - if (!this._currentGroup) { - this.createGroup(null); - } - - var indices; - for (var i:number = 1; i < len; ++i) { - - if (trunk[i] == "") { - continue; - } - - indices = trunk[i].split("/"); - face.vertexIndices.push(this.parseIndex(parseInt(indices[0]), this._vertices.length)); - - if (indices[1] && String(indices[1]).length > 0) - face.uvIndices.push(this.parseIndex(parseInt(indices[1]), this._uvs.length)); - - if (indices[2] && String(indices[2]).length > 0) - face.normalIndices.push(this.parseIndex(parseInt(indices[2]), this._vertexNormals.length)); - - face.indexIds.push(trunk[i]); - } - - this._currentMaterialGroup.faces.push(face); - } - - /** - * This is a hack around negative face coords - */ - private parseIndex(index:number, length:number):number - { - if (index < 0) - return index + length + 1; else - return index; - } - - private parseMtl(data:string) - { - var materialDefinitions = data.split('newmtl'); - var lines; - var trunk; - var j:number; - - var basicSpecularMethod:BasicSpecularMethod; - var useSpecular:boolean; - var useColor:boolean; - var diffuseColor:number; - var color:number; - var specularColor:number; - var specular:number; - var alpha:number; - var mapkd:string; - - for (var i:number = 0; i < materialDefinitions.length; ++i) { - - - lines = (materialDefinitions[i].split('\r')).join("").split('\n'); - //lines = (materialDefinitions[i].split('\r') as Array).join("").split('\n'); - - if (lines.length == 1) - lines = materialDefinitions[i].split(String.fromCharCode(13)); - - diffuseColor = color = specularColor = 0xFFFFFF; - specular = 0; - useSpecular = false; - useColor = false; - alpha = 1; - mapkd = ""; - - for (j = 0; j < lines.length; ++j) { - - lines[j] = lines[j].replace(/\s+$/, ""); - - if (lines[j].substring(0, 1) != "#" && (j == 0 || lines[j] != "")) { - trunk = lines[j].split(" "); - - if (String(trunk[0]).charCodeAt(0) == 9 || String(trunk[0]).charCodeAt(0) == 32) - trunk[0] = trunk[0].substring(1, trunk[0].length); - - if (j == 0) { - this._lastMtlID = trunk.join(""); - this._lastMtlID = (this._lastMtlID == "")? "def000" : this._lastMtlID; - - } else { - - switch (trunk[0]) { - - case "Ka": - if (trunk[1] && !isNaN(Number(trunk[1])) && trunk[2] && !isNaN(Number(trunk[2])) && trunk[3] && !isNaN(Number(trunk[3]))) - color = trunk[1]*255 << 16 | trunk[2]*255 << 8 | trunk[3]*255; - break; - - case "Ks": - if (trunk[1] && !isNaN(Number(trunk[1])) && trunk[2] && !isNaN(Number(trunk[2])) && trunk[3] && !isNaN(Number(trunk[3]))) { - specularColor = trunk[1]*255 << 16 | trunk[2]*255 << 8 | trunk[3]*255; - useSpecular = true; - } - break; - - case "Ns": - if (trunk[1] && !isNaN(Number(trunk[1]))) - specular = Number(trunk[1])*0.001; - if (specular == 0) - useSpecular = false; - break; - - case "Kd": - if (trunk[1] && !isNaN(Number(trunk[1])) && trunk[2] && !isNaN(Number(trunk[2])) && trunk[3] && !isNaN(Number(trunk[3]))) { - diffuseColor = trunk[1]*255 << 16 | trunk[2]*255 << 8 | trunk[3]*255; - useColor = true; - } - break; - - case "tr": - case "d": - if (trunk[1] && !isNaN(Number(trunk[1]))) - alpha = Number(trunk[1]); - break; - - case "map_Kd": - mapkd = this.parseMapKdString(trunk); - mapkd = mapkd.replace(/\\/g, "/"); - } - } - } - } - - if (mapkd != "") { - - if (useSpecular) { - - basicSpecularMethod = new BasicSpecularMethod(); - basicSpecularMethod.specularColor = specularColor; - basicSpecularMethod.specular = specular; - - var specularData:SpecularData = new SpecularData(); - specularData.alpha = alpha; - specularData.basicSpecularMethod = basicSpecularMethod; - specularData.materialID = this._lastMtlID; - - if (!this._materialSpecularData) - this._materialSpecularData = new Array(); - - this._materialSpecularData.push(specularData); - - } - - this._pAddDependency(this._lastMtlID, new away.net.URLRequest(mapkd)); - - } else if (useColor && !isNaN(color)) { - - var lm:LoadedMaterial = new LoadedMaterial(); - lm.materialID = this._lastMtlID; - - if (alpha == 0) - console.log("Warning: an alpha value of 0 was found in mtl color tag (Tr or d) ref:" + this._lastMtlID + ", mesh(es) using it will be invisible!"); - - var cm:TriangleMethodMaterial; - - if (this.materialMode < 2) { - cm = new TriangleMethodMaterial(color); - - var colorMat:TriangleMethodMaterial = cm; - - colorMat.alpha = alpha; - colorMat.diffuseColor = diffuseColor; - colorMat.repeat = true; - - if (useSpecular) { - colorMat.specularColor = specularColor; - colorMat.specular = specular; - } - - } else { - cm = new TriangleMethodMaterial(color); - cm.materialMode = TriangleMaterialMode.MULTI_PASS; - - var colorMultiMat:TriangleMethodMaterial = cm; - - - colorMultiMat.diffuseColor = diffuseColor; - colorMultiMat.repeat = true; - - if (useSpecular) { - colorMultiMat.specularColor = specularColor; - colorMultiMat.specular = specular; - } - } - - lm.cm = cm; - - this._materialLoaded.push(lm); - - if (this._meshes.length > 0) - this.applyMaterial(lm); - - } - } - - this._mtlLibLoaded = true; - } - - private parseMapKdString(trunk):string - { - var url:string = ""; - var i:number; - var breakflag:boolean; - - for (i = 1; i < trunk.length;) { - switch (trunk[i]) { - case "-blendu": - case "-blendv": - case "-cc": - case "-clamp": - case "-texres": - i += 2; //Skip ahead 1 attribute - break; - case "-mm": - i += 3; //Skip ahead 2 attributes - break; - case "-o": - case "-s": - case "-t": - i += 4; //Skip ahead 3 attributes - continue; - default: - breakflag = true; - break; - } - - if (breakflag) - break; - } - - //Reconstruct URL/filename - for (i; i < trunk.length; i++) { - url += trunk[i]; - url += " "; - } - - //Remove the extraneous space and/or newline from the right side - url = url.replace(/\s+$/, ""); - - return url; - } - - private loadMtl(mtlurl:string) - { - // Add raw-data dependency to queue and load dependencies now, - // which will pause the parsing in the meantime. - this._pAddDependency('mtl', new away.net.URLRequest(mtlurl), true); - this._pPauseAndRetrieveDependencies();// - } - - private applyMaterial(lm:LoadedMaterial) - { - var decomposeID; - var mesh:Mesh; - var tm:TriangleMethodMaterial; - var j:number; - var specularData:SpecularData; - - for (var i:number = 0; i < this._meshes.length; ++i) { - mesh = this._meshes[i]; - decomposeID = mesh.material.name.split("~"); - - if (decomposeID[0] == lm.materialID) { - - if (lm.cm) { - if (mesh.material) - mesh.material = null; - mesh.material = lm.cm; - - } else if (lm.texture) { - if (this.materialMode < 2) { // if materialMode is 0 or 1, we create a SinglePass - tm = mesh.material; - - tm.texture = lm.texture; - tm.color = lm.color; - tm.alpha = lm.alpha; - tm.repeat = true; - - if (lm.specularMethod) { - - // By setting the specularMethod property to null before assigning - // the actual method instance, we avoid having the properties of - // the new method being overridden with the settings from the old - // one, which is default behavior of the setter. - tm.specularMethod = null; - tm.specularMethod = lm.specularMethod; - - } else if (this._materialSpecularData) { - - for (j = 0; j < this._materialSpecularData.length; ++j) { - specularData = this._materialSpecularData[j]; - - if (specularData.materialID == lm.materialID) { - tm.specularMethod = null; // Prevent property overwrite (see above) - tm.specularMethod = specularData.basicSpecularMethod; - tm.color = specularData.color; - tm.alpha = specularData.alpha; - break; - } - } - } - } else { //if materialMode==2 this is a MultiPassTexture - tm = mesh.material; - tm.materialMode = TriangleMaterialMode.MULTI_PASS; - - tm.texture = lm.texture; - tm.color = lm.color; - tm.repeat = true; - - if (lm.specularMethod) { - // By setting the specularMethod property to null before assigning - // the actual method instance, we avoid having the properties of - // the new method being overridden with the settings from the old - // one, which is default behavior of the setter. - tm.specularMethod = null; - tm.specularMethod = lm.specularMethod; - } else if (this._materialSpecularData) { - for (j = 0; j < this._materialSpecularData.length; ++j) { - specularData = this._materialSpecularData[j]; - - if (specularData.materialID == lm.materialID) { - tm.specularMethod = null; // Prevent property overwrite (see above) - tm.specularMethod = specularData.basicSpecularMethod; - tm.color = specularData.color; - - break; - - } - } - } - } - } - - mesh.material.name = decomposeID[1]? decomposeID[1] : decomposeID[0]; - this._meshes.splice(i, 1); - --i; - } - } - - if (lm.cm || tm) - this._pFinalizeAsset(lm.cm || tm); - } - - private applyMaterials() - { - if (this._materialLoaded.length == 0) - return; - - for (var i:number = 0; i < this._materialLoaded.length; ++i) - this.applyMaterial(this._materialLoaded[i]); - } - } -} - -import BasicSpecularMethod = away.materials.SpecularBasicMethod; -import MaterialBase = away.materials.MaterialBase; -import Texture2DBase = away.textures.Texture2DBase; - -class ObjectGroup -{ - public name:string; - public groups:Group[] = new Array(); -} - -class Group -{ - public name:string; - public materialID:string; - public materialGroups:MaterialGroup[] = new Array(); -} - -class MaterialGroup -{ - public url:string; - public faces:FaceData[] = new Array(); -} - -class SpecularData -{ - public materialID:string; - public basicSpecularMethod:BasicSpecularMethod; - public color:number = 0xFFFFFF; - public alpha:number = 1; -} - -class LoadedMaterial -{ - public materialID:string; - public texture:Texture2DBase; - public cm:MaterialBase; - public specularMethod:BasicSpecularMethod; - public color:number = 0xFFFFFF; - public alpha:number = 1; -} - -class FaceData -{ - public vertexIndices:Array /*uint*/ = new Array(); - public uvIndices:Array /*uint*/ = new Array(); - public normalIndices:Array /*uint*/ = new Array(); - public indexIds:string[] = new Array(); // used for real index lookups -} - -/** - * Texture coordinates value object. - */ -class UV -{ - private _u:number; - private _v:number; - - /** - * Creates a new UV object. - * - * @param u [optional] The horizontal coordinate of the texture value. Defaults to 0. - * @param v [optional] The vertical coordinate of the texture value. Defaults to 0. - */ - constructor(u:number = 0, v:number = 0) - { - this._u = u; - this._v = v; - } - - /** - * Defines the vertical coordinate of the texture value. - */ - public get v():number - { - return this._v; - } - - public set v(value:number) - { - this._v = value; - } - - /** - * Defines the horizontal coordinate of the texture value. - */ - public get u():number - { - return this._u; - } - - public set u(value:number) - { - this._u = value; - } - - /** - * returns a new UV value Object - */ - public clone():UV - { - return new UV(this._u, this._v); - } - - /** - * returns the value object as a string for trace/debug purpose - */ - public toString():string - { - return this._u + "," + this._v; - } -} - -class Vertex -{ - private _x:number; - private _y:number; - private _z:number; - private _index:number; - - /** - * Creates a new Vertex value object. - * - * @param x [optional] The x value. Defaults to 0. - * @param y [optional] The y value. Defaults to 0. - * @param z [optional] The z value. Defaults to 0. - * @param index [optional] The index value. Defaults is NaN. - */ - constructor(x:number = 0, y:number = 0, z:number = 0, index:number = 0) - { - this._x = x; - this._y = y; - this._z = z; - this._index = index; - } - - /** - * To define/store the index of value object - * @param ind The index - */ - public set index(ind:number) - { - this._index = ind; - } - - public get index():number - { - return this._index; - } - - /** - * To define/store the x value of the value object - * @param value The x value - */ - public get x():number - { - return this._x; - } - - public set x(value:number) - { - this._x = value; - } - - /** - * To define/store the y value of the value object - * @param value The y value - */ - public get y():number - { - return this._y; - } - - public set y(value:number) - { - this._y = value; - } - - /** - * To define/store the z value of the value object - * @param value The z value - */ - public get z():number - { - return this._z; - } - - public set z(value:number) - { - this._z = value; - } - - /** - * returns a new Vertex value Object - */ - public clone():Vertex - { - return new Vertex(this._x, this._y, this._z); - } -} diff --git a/src/away/parsers/Parsers.ts b/src/away/parsers/Parsers.ts deleted file mode 100644 index b7b874f1f..000000000 --- a/src/away/parsers/Parsers.ts +++ /dev/null @@ -1,59 +0,0 @@ -/// - -module away.parsers -{ - import AssetLoader = away.library.AssetLoader; - - export class Parsers - { - /** - * A list of all parsers that come bundled with Away3D. Use this to quickly - * enable support for all bundled parsers to the file format auto-detection - * feature, using any of the enableParsers() methods on loaders, e.g.: - * - * AssetLibrary.enableParsers(Parsers.ALL_BUNDLED); - * - * Beware however that this requires all parser classes to be included in the - * SWF file, which will add 50-100 kb to the file. When only a limited set of - * file formats are used, SWF file size can be saved by adding the parsers - * individually using AssetLibrary.enableParser() - * - * A third way is to specify a parser for each loaded file, thereby bypassing - * the auto-detection mechanisms altogether, while at the same time allowing - * any properties that are unique to that parser to be set for that load. - * - * The bundled parsers are: - * - *
    - *
  • AC3D (.ac)
  • - *
  • Away Data version 1 ASCII and version 2 binary (.awd). AWD1 BSP unsupported
  • - *
  • 3DMax (.3ds)
  • - *
  • DXF (.dxf)
  • - *
  • Quake 2 MD2 models (.md2)
  • - *
  • Doom 3 MD5 animation clips (.md5anim)
  • - *
  • Doom 3 MD5 meshes (.md5mesh)
  • - *
  • Wavefront OBJ (.obj)
  • - *
  • Collada (.dae)
  • - *
  • Images (.jpg, .png)
  • - *
- * - * @see away.library.AssetLibrary.enableParser - */ - public static ALL_BUNDLED:Array = Array(AWDParser, Max3DSParser, MD2Parser, OBJParser); - - /** - * Short-hand function to enable all bundled parsers for auto-detection. In practice, - * this is the same as invoking enableParsers(Parsers.ALL_BUNDLED) on any of the - * loader classes SingleFileLoader, AssetLoader, AssetLibrary or Loader3D. - * - * See notes about file size in the documentation for the ALL_BUNDLED constant. - * - * @see away.parsers.Parsers.ALL_BUNDLED - */ - public static enableAllBundled():void - { - AssetLoader.enableParsers(Parsers.ALL_BUNDLED); - } - } -} - diff --git a/src/away/tools/commands/Merge.ts b/src/away/tools/commands/Merge.ts deleted file mode 100644 index 0c27c8319..000000000 --- a/src/away/tools/commands/Merge.ts +++ /dev/null @@ -1,364 +0,0 @@ -/// - -module away.commands -{ - import DisplayObjectContainer = away.containers.DisplayObjectContainer; - import Geometry = away.base.Geometry; - import TriangleSubGeometry = away.base.TriangleSubGeometry - import Matrix3DUtils = away.geom.Matrix3DUtils; - import Mesh = away.entities.Mesh; - import MaterialBase = away.materials.MaterialBase; - - /** - * Class Merge merges two or more static meshes into one.Merge - */ - export class Merge - { - - //private const LIMIT:uint = 196605; - private _objectSpace:boolean; - private _keepMaterial:boolean; - private _disposeSources:boolean; - private _geomVOs:Array; - private _toDispose:Array; - - /** - * @param keepMaterial [optional] Determines if the merged object uses the recevier mesh material information or keeps its source material(s). Defaults to false. - * If false and receiver object has multiple materials, the last material found in receiver submeshes is applied to the merged submesh(es). - * @param disposeSources [optional] Determines if the mesh and geometry source(s) used for the merging are disposed. Defaults to false. - * If true, only receiver geometry and resulting mesh are kept in memory. - * @param objectSpace [optional] Determines if source mesh(es) is/are merged using objectSpace or worldspace. Defaults to false. - */ - constructor(keepMaterial:boolean = false, disposeSources:boolean = false, objectSpace:boolean = false) - { - this._keepMaterial = keepMaterial; - this._disposeSources = disposeSources; - this._objectSpace = objectSpace; - } - - /** - * Determines if the mesh and geometry source(s) used for the merging are disposed. Defaults to false. - */ - public set disposeSources(b:boolean) - { - this._disposeSources = b; - } - - public get disposeSources():boolean - { - return this._disposeSources; - } - - /** - * Determines if the material source(s) used for the merging are disposed. Defaults to false. - */ - public set keepMaterial(b:boolean) - { - this._keepMaterial = b; - } - - public get keepMaterial():boolean - { - return this._keepMaterial; - } - - /** - * Determines if source mesh(es) is/are merged using objectSpace or worldspace. Defaults to false. - */ - public set objectSpace(b:boolean) - { - this._objectSpace = b; - } - - public get objectSpace():boolean - { - return this._objectSpace; - } - - /** - * Merges all the children of a container into a single Mesh. If no Mesh object is found, method returns the receiver without modification. - * - * @param receiver The Mesh to receive the merged contents of the container. - * @param objectContainer The DisplayObjectContainer holding the meshes to be mergd. - * - * @return The merged Mesh instance. - */ - public applyToContainer(receiver:Mesh, objectContainer:DisplayObjectContainer) - { - this.reset(); - - //collect container meshes - this.parseContainer(receiver, objectContainer); - - //collect receiver - this.collect(receiver, false); - - //merge to receiver - this.merge(receiver, this._disposeSources); - } - - /** - * Merges all the meshes found in the Array<Mesh> into a single Mesh. - * - * @param receiver The Mesh to receive the merged contents of the meshes. - * @param meshes A series of Meshes to be merged with the reciever mesh. - */ - public applyToMeshes(receiver:Mesh, meshes:Array) - { - this.reset(); - - if (!meshes.length) - return; - - //collect meshes in vector - for (var i:number /*uint*/ = 0; i < meshes.length; i++) - if (meshes[i] != receiver) - this.collect(meshes[i], this._disposeSources); - - //collect receiver - this.collect(receiver, false); - - //merge to receiver - this.merge(receiver, this._disposeSources); - } - - /** - * Merges 2 meshes into one. It is recommand to use apply when 2 meshes are to be merged. If more need to be merged, use either applyToMeshes or applyToContainer methods. - * - * @param receiver The Mesh to receive the merged contents of both meshes. - * @param mesh The Mesh to be merged with the receiver mesh - */ - public apply(receiver:Mesh, mesh:Mesh) - { - this.reset(); - - //collect mesh - this.collect(mesh, this._disposeSources); - - //collect receiver - this.collect(receiver, false); - - //merge to receiver - this.merge(receiver, this._disposeSources); - } - - private reset() - { - this._toDispose = new Array(); - this._geomVOs = new Array(); - } - - private merge(destMesh:Mesh, dispose:boolean) - { - var i:number /*uint*/; - var subIdx:number /*uint*/; - var oldGeom:Geometry - var destGeom:Geometry; - var useSubMaterials:boolean; - - oldGeom = destMesh.geometry; - destGeom = destMesh.geometry = new Geometry(); - subIdx = destMesh.subMeshes.length; - - // Only apply materials directly to sub-meshes if necessary, - // i.e. if there is more than one material available. - useSubMaterials = (this._geomVOs.length > 1); - - for (i = 0; i < this._geomVOs.length; i++) { - var s:number /*uint*/; - var data:GeometryVO; - var sub:TriangleSubGeometry = new TriangleSubGeometry(true); - sub.autoDeriveNormals = false; - sub.autoDeriveTangents = false; - - data = this._geomVOs[i]; - sub.updateIndices(data.indices); - sub.updatePositions(data.vertices); - sub.updateVertexNormals(data.normals); - sub.updateVertexTangents(data.tangents); - sub.updateUVs(data.uvs); - - destGeom.addSubGeometry(sub); - - if (this._keepMaterial && useSubMaterials) - destMesh.subMeshes[subIdx].material = data.material; - } - - if (this._keepMaterial && !useSubMaterials && this._geomVOs.length) - destMesh.material = this._geomVOs[0].material; - - if (dispose) { - var m:Mesh; - var len:number = this._toDispose.length; - for (var i:number; i < len; i++) { - m = this._toDispose[i]; - m.geometry.dispose(); - m.dispose(); - } - - //dispose of the original receiver geometry - oldGeom.dispose(); - } - - this._toDispose = null; - } - - private collect(mesh:Mesh, dispose:boolean) - { - if (mesh.geometry) { - var subIdx:number /*uint*/; - var subGeometries:Array = > mesh.geometry.subGeometries; - var calc:number /*uint*/; - for (subIdx = 0; subIdx < subGeometries.length; subIdx++) { - var i:number /*uint*/; - var len:number /*uint*/; - var iIdx:number /*uint*/, vIdx:number /*uint*/, nIdx:number /*uint*/, tIdx:number /*uint*/, uIdx:number /*uint*/; - var indexOffset:number /*uint*/; - var subGeom:TriangleSubGeometry; - var vo:GeometryVO; - var vertices:Array; - var normals:Array; - var tangents:Array; - var pd:Array, nd:Array, td:Array, ud:Array; - - subGeom = subGeometries[subIdx]; - pd = subGeom.positions; - nd = subGeom.vertexNormals; - td = subGeom.vertexTangents; - ud = subGeom.uvs; - - // Get (or create) a VO for this material - vo = this.getSubGeomData(mesh.subMeshes[subIdx].material || mesh.material); - - // Vertices and normals are copied to temporary vectors, to be transformed - // before concatenated onto those of the data. This is unnecessary if no - // transformation will be performed, i.e. for object space merging. - vertices = (this._objectSpace)? vo.vertices : new Array(); - normals = (this._objectSpace)? vo.normals : new Array(); - tangents = (this._objectSpace)? vo.tangents : new Array(); - - // Copy over vertex attributes - vIdx = vertices.length; - nIdx = normals.length; - tIdx = tangents.length; - uIdx = vo.uvs.length; - len = subGeom.numVertices; - for (i = 0; i < len; i++) { - calc = i*3; - - // Position - vertices[vIdx++] = pd[calc]; - vertices[vIdx++] = pd[calc + 1]; - vertices[vIdx++] = pd[calc + 2]; - - // Normal - normals[nIdx++] = nd[calc]; - normals[nIdx++] = nd[calc + 1]; - normals[nIdx++] = nd[calc + 2]; - - // Tangent - tangents[tIdx++] = td[calc]; - tangents[tIdx++] = td[calc + 1]; - tangents[tIdx++] = td[calc + 2]; - - // UV - vo.uvs[uIdx++] = ud[i*2]; - vo.uvs[uIdx++] = ud[i*2 + 1]; - } - - // Copy over triangle indices - indexOffset = (!this._objectSpace)? vo.vertices.length/3 :0; - iIdx = vo.indices.length; - len = subGeom.numTriangles; - for (i = 0; i < len; i++) { - calc = i*3; - vo.indices[iIdx++] = subGeom.indices[calc] + indexOffset; - vo.indices[iIdx++] = subGeom.indices[calc + 1] + indexOffset; - vo.indices[iIdx++] = subGeom.indices[calc + 2] + indexOffset; - } - - if (!this._objectSpace) { - mesh.sceneTransform.transformVectors(vertices, vertices); - Matrix3DUtils.deltaTransformVectors(mesh.sceneTransform, normals, normals); - Matrix3DUtils.deltaTransformVectors(mesh.sceneTransform, tangents, tangents); - - // Copy vertex data from temporary (transformed) vectors - vIdx = vo.vertices.length; - nIdx = vo.normals.length; - tIdx = vo.tangents.length; - len = vertices.length; - for (i = 0; i < len; i++) { - vo.vertices[vIdx++] = vertices[i]; - vo.normals[nIdx++] = normals[i]; - vo.tangents[tIdx++] = tangents[i]; - } - } - } - - if (dispose) - this._toDispose.push(mesh); - } - } - - private getSubGeomData(material:MaterialBase):GeometryVO - { - var data:GeometryVO; - - if (this._keepMaterial) { - var i:number /*uint*/; - var len:number /*uint*/; - - len = this._geomVOs.length; - for (i = 0; i < len; i++) { - if (this._geomVOs[i].material == material) { - data = this._geomVOs[i]; - break; - } - } - } else if (this._geomVOs.length) { - // If materials are not to be kept, all data can be - // put into a single VO, so return that one. - data = this._geomVOs[0]; - } - - // No data (for this material) found, create new. - if (!data) { - data = new GeometryVO(); - data.vertices = new Array(); - data.normals = new Array(); - data.tangents = new Array(); - data.uvs = new Array(); - data.indices = new Array(); - data.material = material; - - this._geomVOs.push(data); - } - - return data; - } - - private parseContainer(receiver:Mesh, object:DisplayObjectContainer) - { - var child:DisplayObjectContainer; - var i:number /*uint*/; - - if (object instanceof Mesh && object != ( receiver)) - this.collect( object, this._disposeSources); - - for (i = 0; i < object.numChildren; ++i) { - child = object.getChildAt(i); - this.parseContainer(receiver, child); - } - } - } -} - -class GeometryVO -{ - public uvs:Array; - public vertices:Array; - public normals:Array; - public tangents:Array; - public indices:Array; - public material:away.materials.MaterialBase; -} diff --git a/src/away/tools/data/ParticleGeometryTransform.ts b/src/away/tools/data/ParticleGeometryTransform.ts deleted file mode 100644 index 374ade5e3..000000000 --- a/src/away/tools/data/ParticleGeometryTransform.ts +++ /dev/null @@ -1,46 +0,0 @@ -/// - -module away.tools -{ - import Matrix = away.geom.Matrix; - import Matrix3D = away.geom.Matrix3D; - - /** - * ... - */ - export class ParticleGeometryTransform - { - private _defaultVertexTransform:Matrix3D; - private _defaultInvVertexTransform:Matrix3D; - private _defaultUVTransform:Matrix; - - public set vertexTransform(value:Matrix3D) - { - this._defaultVertexTransform = value; - this._defaultInvVertexTransform = value.clone(); - this._defaultInvVertexTransform.invert(); - this._defaultInvVertexTransform.transpose(); - } - - public set UVTransform(value:Matrix) - { - this._defaultUVTransform = value; - } - - public get UVTransform():Matrix - { - return this._defaultUVTransform; - } - - public get vertexTransform():Matrix3D - { - return this._defaultVertexTransform; - } - - public get invVertexTransform():Matrix3D - { - return this._defaultInvVertexTransform; - } - } - -} diff --git a/src/away/tools/helpers/ParticleGeometryHelper.ts b/src/away/tools/helpers/ParticleGeometryHelper.ts deleted file mode 100644 index ce0eb395c..000000000 --- a/src/away/tools/helpers/ParticleGeometryHelper.ts +++ /dev/null @@ -1,202 +0,0 @@ -/// - -module away.tools -{ - import ParticleData = away.animators.ParticleData; - import ParticleGeometry = away.base.ParticleGeometry; - import Geometry = away.base.Geometry; - import TriangleSubGeometry = away.base.TriangleSubGeometry; - import Matrix = away.geom.Matrix; - import Matrix3D = away.geom.Matrix3D; - import Point = away.geom.Point; - import Vector3D = away.geom.Vector3D; - - /** - * ... - */ - export class ParticleGeometryHelper - { - public static MAX_VERTEX:number /*int*/ = 65535; - - public static generateGeometry(geometries:Array, transforms:Array = null):ParticleGeometry - { - var indicesVector:Array> /*uint*/ = new Array>() /*uint*/; - var positionsVector:Array> = new Array>(); - var normalsVector:Array> = new Array>(); - var tangentsVector:Array> = new Array>(); - var uvsVector:Array> = new Array>(); - var vertexCounters:Array /*uint*/ = new Array() /*uint*/; - var particles:Array = new Array(); - var subGeometries:Array = new Array(); - var numParticles:number /*uint*/ = geometries.length; - - var sourceSubGeometries:Array; - var sourceSubGeometry:TriangleSubGeometry; - var numSubGeometries:number /*uint*/; - var indices:Array /*uint*/; - var positions:Array; - var normals:Array; - var tangents:Array; - var uvs:Array; - var vertexCounter:number /*uint*/; - var subGeometry:TriangleSubGeometry; - var i:number /*int*/; - var j:number /*int*/; - var sub2SubMap:Array /*int*/ = new Array() /*int*/; - - var tempVertex:Vector3D = new Vector3D; - var tempNormal:Vector3D = new Vector3D; - var tempTangents:Vector3D = new Vector3D; - var tempUV:Point = new Point; - - for (i = 0; i < numParticles; i++) { - sourceSubGeometries = > geometries[i].subGeometries; - numSubGeometries = sourceSubGeometries.length; - for (var srcIndex:number /*int*/ = 0; srcIndex < numSubGeometries; srcIndex++) { - //create a different particle subgeometry group for each source subgeometry in a particle. - if (sub2SubMap.length <= srcIndex) { - sub2SubMap.push(subGeometries.length); - indicesVector.push(new Array() /*uint*/); - positionsVector.push(new Array()); - normalsVector.push(new Array()); - tangentsVector.push(new Array()); - uvsVector.push(new Array()); - subGeometries.push(new TriangleSubGeometry(true)); - vertexCounters.push(0); - } - - sourceSubGeometry = sourceSubGeometries[srcIndex]; - - //add a new particle subgeometry if this source subgeometry will take us over the maxvertex limit - if (sourceSubGeometry.numVertices + vertexCounters[sub2SubMap[srcIndex]] > ParticleGeometryHelper.MAX_VERTEX) { - //update submap and add new subgeom vectors - sub2SubMap[srcIndex] = subGeometries.length; - indicesVector.push(new Array() /*uint*/); - positionsVector.push(new Array()); - normalsVector.push(new Array()); - tangentsVector.push(new Array()); - uvsVector.push(new Array()); - subGeometries.push(new TriangleSubGeometry(true)); - vertexCounters.push(0); - } - - j = sub2SubMap[srcIndex]; - - //select the correct vector - indices = indicesVector[j]; - positions = positionsVector[j]; - normals = normalsVector[j]; - tangents = tangentsVector[j]; - uvs = uvsVector[j]; - vertexCounter = vertexCounters[j]; - subGeometry = subGeometries[j]; - - var particleData:ParticleData = new ParticleData(); - particleData.numVertices = sourceSubGeometry.numVertices; - particleData.startVertexIndex = vertexCounter; - particleData.particleIndex = i; - particleData.subGeometry = subGeometry; - particles.push(particleData); - - vertexCounters[j] += sourceSubGeometry.numVertices; - - var k:number /*int*/; - var tempLen:number /*int*/; - var compact:TriangleSubGeometry = sourceSubGeometry; - var product:number /*uint*/; - var sourcePositions:Array; - var sourceNormals:Array; - var sourceTangents:Array; - var sourceUVs:Array; - - if (compact) { - tempLen = compact.numVertices; - compact.numTriangles; - sourcePositions = compact.positions; - sourceNormals = compact.vertexNormals; - sourceTangents = compact.vertexTangents; - sourceUVs = compact.uvs; - - if (transforms) { - var particleGeometryTransform:ParticleGeometryTransform = transforms[i]; - var vertexTransform:Matrix3D = particleGeometryTransform.vertexTransform; - var invVertexTransform:Matrix3D = particleGeometryTransform.invVertexTransform; - var UVTransform:Matrix = particleGeometryTransform.UVTransform; - - for (k = 0; k < tempLen; k++) { - /* - * 0 - 2: vertex position X, Y, Z - * 3 - 5: normal X, Y, Z - * 6 - 8: tangent X, Y, Z - * 9 - 10: U V - * 11 - 12: Secondary U V*/ - product = k*3; - tempVertex.x = sourcePositions[product]; - tempVertex.y = sourcePositions[product + 1]; - tempVertex.z = sourcePositions[product + 2]; - tempNormal.x = sourceNormals[product]; - tempNormal.y = sourceNormals[product + 1]; - tempNormal.z = sourceNormals[product + 2]; - tempTangents.x = sourceTangents[product]; - tempTangents.y = sourceTangents[product + 1]; - tempTangents.z = sourceTangents[product + 2]; - tempUV.x = sourceUVs[k*2]; - tempUV.y = sourceUVs[k*2 + 1]; - if (vertexTransform) { - tempVertex = vertexTransform.transformVector(tempVertex); - tempNormal = invVertexTransform.deltaTransformVector(tempNormal); - tempTangents = invVertexTransform.deltaTransformVector(tempNormal); - } - if (UVTransform) - tempUV = UVTransform.transformPoint(tempUV); - //this is faster than that only push one data - sourcePositions.push(tempVertex.x, tempVertex.y, tempVertex.z); - sourceNormals.push(tempNormal.x, tempNormal.y, tempNormal.z); - sourceTangents.push(tempTangents.x, tempTangents.y, tempTangents.z); - sourceUVs.push(tempUV.x, tempUV.y); - } - } else { - for (k = 0; k < tempLen; k++) { - product = k*3; - //this is faster than that only push one data - positions.push(sourcePositions[product], sourcePositions[product + 1], sourcePositions[product + 2]); - normals.push(sourceNormals[product], sourceNormals[product + 1], sourceNormals[product + 2]); - tangents.push(sourceTangents[product], sourceTangents[product + 1], sourceTangents[product + 2]); - uvs.push(sourceUVs[k*2], sourceUVs[k*2 + 1]); - } - } - } else { - //Todo - } - - var sourceIndices:Array /*uint*/ = sourceSubGeometry.indices; - tempLen = sourceSubGeometry.numTriangles; - for (k = 0; k < tempLen; k++) { - product = k*3; - indices.push(sourceIndices[product] + vertexCounter, sourceIndices[product + 1] + vertexCounter, sourceIndices[product + 2] + vertexCounter); - } - } - } - - var particleGeometry:ParticleGeometry = new ParticleGeometry(); - particleGeometry.particles = particles; - particleGeometry.numParticles = numParticles; - - numParticles = subGeometries.length; - for (i = 0; i < numParticles; i++) { - subGeometry = subGeometries[i]; - subGeometry.autoDeriveNormals = false; - subGeometry.autoDeriveTangents = false; - subGeometry.updateIndices(indicesVector[i]); - subGeometry.updatePositions(positionsVector[i]); - subGeometry.updateVertexNormals(normalsVector[i]); - subGeometry.updateVertexTangents(tangentsVector[i]); - subGeometry.updateUVs(uvsVector[i]); - particleGeometry.addSubGeometry(subGeometry); - } - - return particleGeometry; - } - } - -} diff --git a/src/away/utils/PerspectiveMatrix3D.ts b/src/away/utils/PerspectiveMatrix3D.ts deleted file mode 100644 index a82511eaf..000000000 --- a/src/away/utils/PerspectiveMatrix3D.ts +++ /dev/null @@ -1,19 +0,0 @@ -/// - -module away.utils -{ - export class PerspectiveMatrix3D extends away.geom.Matrix3D - { - constructor(v:Array = null) - { - super(v); - } - - public perspectiveFieldOfViewLH(fieldOfViewY:number, aspectRatio:number, zNear:number, zFar:number) - { - var yScale:number = 1/Math.tan(fieldOfViewY/2); - var xScale:number = yScale/aspectRatio; - this.copyRawDataFrom([xScale, 0.0, 0.0, 0.0, 0.0, yScale, 0.0, 0.0, 0.0, 0.0, zFar/(zFar - zNear), 1.0, 0.0, 0.0, (zNear*zFar)/(zNear - zFar), 0.0]); - } - } -} \ No newline at end of file diff --git a/tests/frame.html b/tests/frame.html index b82046a8b..81ecfbb02 100755 --- a/tests/frame.html +++ b/tests/frame.html @@ -12,11 +12,10 @@ } - - - - - + + + + + '; - html += ''; - html += ''; - html += ''; - html += ''; - - return html; - }; - - //------------------------------------------------------------------------------ - // Utils - /** - * - * Util function - get Element by ID - * - * @param id - * @returns {HTMLElement} - */ - AppHarness.prototype.getId = function (id) { - return document.getElementById(id); - }; - - //------------------------------------------------------------------------------ - // Events - /** - * - * Dropbox event handler - * - * @param e - */ - AppHarness.prototype.dropDownChange = function (e) { - this.dropDown.options[this.dropDown.selectedIndex].value; - this.counter = this.dropDown.selectedIndex; - var dataIndex = parseInt(this.dropDown.options[this.dropDown.selectedIndex].value); - - if (!isNaN(dataIndex)) { - this.navigateToSection(this.tests[dataIndex]); - } - }; - return AppHarness; - })(); - away.AppHarness = AppHarness; - - //--------------------------------------------------- - // Application Frame - var AppFrame = (function () { - function AppFrame() { - this.classPath = ''; - this.jsPath = ''; - var queryParams = Utils.getQueryParams(document.location.search); - - if (queryParams.js != undefined && queryParams.name != undefined) { - this.jsPath = queryParams.js; - this.classPath = queryParams.name; - this.loadJS(this.jsPath); - } - } - /** - * - * Load a JavaScript file - * - * @param url - URL of JavaScript file - */ - AppFrame.prototype.loadJS = function (url) { - var _this = this; - var head = document.getElementsByTagName("head")[0]; - var script = document.createElement("script"); - script.type = "text/javascript"; - script.src = url; - script.onload = function () { - return _this.jsLoaded(); - }; - - head.appendChild(script); - }; - - /** - * - * Event Handler for loaded JavaScript files - * - */ - AppFrame.prototype.jsLoaded = function () { - var createPath = this.classPath.split('.'); - var obj; - - for (var c = 0; c < createPath.length; c++) { - if (obj == null) { - obj = window[createPath[c]]; // reference base module ( will be a child of the window ) - } else { - obj = obj[createPath[c]]; // reference sub module / Class - } - } - - if (obj != null) { - new obj(); // if Class has been found - start the test - } - }; - return AppFrame; - })(); - away.AppFrame = AppFrame; - - //--------------------------------------------------- - // Common Utilities - var Utils = (function () { - function Utils() { - } - /** - * - * Utility function - Parse a Query formatted string - * - * @param qs - * @returns {{}} - */ - Utils.getQueryParams = function (qs) { - qs = qs.split("+").join(" "); - - var params = {}, tokens, re = /[?&]?([^=]+)=([^&]*)/g; - - while (tokens = re.exec(qs)) { - params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]); - } - - return params; - }; - return Utils; - })(); - away.Utils = Utils; - - //--------------------------------------------------- - // Data - var TestData = (function () { - function TestData(name, classpath, js, src) { - this.js = js; - this.classpath = classpath; - this.src = src; - this.name = name; - } - return TestData; - })(); -})(away || (away = {})); -//# sourceMappingURL=AppHarness.js.map diff --git a/tests/js/AppHarness.js.map b/tests/js/AppHarness.js.map deleted file mode 100644 index 01253be4e..000000000 --- a/tests/js/AppHarness.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"AppHarness.js","sourceRoot":"","sources":["../AppHarness.ts"],"names":["away","away.AppHarness","away.AppHarness.constructor","away.AppHarness.load","away.AppHarness.addTest","away.AppHarness.addSeperator","away.AppHarness.start","away.AppHarness.loadFromURL","away.AppHarness.initInterface","away.AppHarness.initFrameSet","away.AppHarness.nagigateBy","away.AppHarness.navigateToSection","away.AppHarness.toggleSource","away.AppHarness.createSourceViewHTML","away.AppHarness.getId","away.AppHarness.dropDownChange","away.AppFrame","away.AppFrame.constructor","away.AppFrame.loadJS","away.AppFrame.jsLoaded","away.Utils","away.Utils.constructor","away.Utils.getQueryParams","away.TestData","away.TestData.constructor"],"mappings":"AAAA,IAAO,IAAI;AAodV,CApdD,UAAO,IAAI;IAGPA,qDAAqDA;IACrDA,sBAAsBA;IAEtBA;QAkBIC,gFAFgFA;QAEhFA;YAAAC,iBAYCA;YA3BDA,gFAAgFA;YAEhFA,KAAQA,KAAKA,GAA+BA,IAAIA,KAAKA,CAAWA,CAACA,CAACA;YAOlEA,KAAQA,OAAOA,GAAoBA,CAACA,CAACA;YACrCA,KAAQA,aAAaA,GAAeA,KAAKA,CAACA;YAC7CA,KAAQA,WAAWA,GAAiBA,IAAIA,CAACA;YAOlCA,IAAIA,CAACA,YAAYA,CAACA,CAACA;YACnBA,IAAIA,CAACA,aAAaA,CAACA,CAACA;;YAGpBA,IAAIA,CAACA,WAAWA,CAACA,OAAOA,GAAKA;uBAAMA,KAAIA,CAACA,UAAUA,CAAEA,CAACA,CAACA,CAAEA;YAArBA,CAAqBA;YACxDA,IAAIA,CAACA,OAAOA,CAACA,OAAOA,GAASA;uBAAMA,KAAIA,CAACA,UAAUA,CAAEA,CAACA,CAAEA;YAApBA,CAAoBA;YACvDA,IAAIA,CAACA,SAASA,CAACA,OAAOA,GAAOA;uBAAMA,KAAIA,CAACA,YAAYA,CAACA,CAACA;YAAnBA,CAAmBA;YACtDA,IAAIA,CAACA,QAAQA,CAACA,QAAQA,GAAQA,UAAEA,CAACA;uBAAMA,KAAIA,CAACA,cAAcA,CAAEA,CAACA,CAAEA;YAAxBA,CAAwBA;QAEnEA,CAACA;QAYDD,gFAVgFA;Q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,CAACA,CAACA,CAACA;aACrEA;;YAEDA,OAAOA,MAAMA;QACdA,CAACA;QACFF,aAACA;IAADA,CAACA,IAAApB;IAtBDA,mBAsBCA;;IAEEA,qDAAqDA;IACrDA,OAAOA;IAEPA;QAOIuB,kBAAaA,IAAaA,EAAGA,SAAkBA,EAAGA,EAAWA,EAAGA,GAAYA;YAExEC,IAAIA,CAACA,EAAEA,GAAWA,EAAEA;YACpBA,IAAIA,CAACA,SAASA,GAAIA,SAASA;YAC3BA,IAAIA,CAACA,GAAGA,GAAUA,GAAGA;YACrBA,IAAIA,CAACA,IAAIA,GAASA,IAAIA;QAC1BA,CAACA;QACLD,gBAACA;IAADA,CAACA,IAAAvB;AACLA,CAACA,uBAAA"} \ No newline at end of file diff --git a/tests/js/LightsShadowTest.js b/tests/js/LightsShadowTest.js deleted file mode 100644 index f181872ce..000000000 --- a/tests/js/LightsShadowTest.js +++ /dev/null @@ -1,160 +0,0 @@ -/// -var tests; -(function (tests) { - (function (lights) { - var View = away.containers.View; - var HoverController = away.controllers.HoverController; - - var AssetEvent = away.events.AssetEvent; - var LoaderEvent = away.events.LoaderEvent; - var Vector3D = away.geom.Vector3D; - var AssetLibrary = away.library.AssetLibrary; - - var AssetType = away.library.AssetType; - - var URLRequest = away.net.URLRequest; - var AWDParser = away.parsers.AWDParser; - var DefaultRenderer = away.render.DefaultRenderer; - var RequestAnimationFrame = away.utils.RequestAnimationFrame; - - var LightsShadowTest = (function () { - function LightsShadowTest() { - var _this = this; - this.lookAtPosition = new Vector3D(); - this._move = false; - away.Debug.LOG_PI_ERRORS = true; - away.Debug.THROW_ERRORS = false; - - AssetLibrary.enableParser(AWDParser); - - this._token = AssetLibrary.load(new URLRequest('assets/ShadowTest.awd')); - - this._token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, function (event) { - return _this.onResourceComplete(event); - }); - this._token.addEventListener(AssetEvent.ASSET_COMPLETE, function (event) { - return _this.onAssetComplete(event); - }); - - this._view = new View(new DefaultRenderer()); - this._view.camera.projection.far = 5000; - this._view.camera.y = 100; - - this._timer = new RequestAnimationFrame(this.render, this); - - this._cameraController = new HoverController(this._view.camera, null, 45, 20, 2000, 5); - - document.onmousedown = function (event) { - return _this.onMouseDown(event); - }; - document.onmouseup = function (event) { - return _this.onMouseUp(event); - }; - document.onmousemove = function (event) { - return _this.onMouseMove(event); - }; - document.onmousewheel = function (event) { - return _this.onMouseWheel(event); - }; - - window.onresize = function (event) { - return _this.resize(event); - }; - } - LightsShadowTest.prototype.resize = function (event) { - if (typeof event === "undefined") { event = null; } - this._view.y = 0; - this._view.x = 0; - this._view.width = window.innerWidth; - this._view.height = window.innerHeight; - }; - - LightsShadowTest.prototype.render = function (dt) { - if (this._view.camera) - this._view.camera.lookAt(this.lookAtPosition); - - if (this._awdMesh) - this._awdMesh.rotationY += 0.2; - - this._view.render(); - }; - - LightsShadowTest.prototype.onAssetComplete = function (event) { - console.log('------------------------------------------------------------------------------'); - console.log('AssetEvent.ASSET_COMPLETE', AssetLibrary.getAsset(event.asset.name)); - console.log('------------------------------------------------------------------------------'); - }; - - LightsShadowTest.prototype.onResourceComplete = function (event) { - console.log('------------------------------------------------------------------------------'); - console.log('LoaderEvent.RESOURCE_COMPLETE', event); - console.log('------------------------------------------------------------------------------'); - - var loader = event.target; - var numAssets = loader.baseDependency.assets.length; - - for (var i = 0; i < numAssets; ++i) { - var asset = loader.baseDependency.assets[i]; - - switch (asset.assetType) { - case AssetType.MESH: - this._awdMesh = asset; - this._view.scene.addChild(this._awdMesh); - this.resize(); - break; - - case AssetType.LIGHT: - this._view.scene.addChild(asset); - break; - - case AssetType.MATERIAL: - break; - } - } - - this._timer.start(); - }; - - /** - * Mouse down listener for navigation - */ - LightsShadowTest.prototype.onMouseDown = function (event) { - this._lastPanAngle = this._cameraController.panAngle; - this._lastTiltAngle = this._cameraController.tiltAngle; - this._lastMouseX = event.clientX; - this._lastMouseY = event.clientY; - this._move = true; - }; - - /** - * Mouse up listener for navigation - */ - LightsShadowTest.prototype.onMouseUp = function (event) { - this._move = false; - }; - - LightsShadowTest.prototype.onMouseMove = function (event) { - if (this._move) { - this._cameraController.panAngle = 0.3 * (event.clientX - this._lastMouseX) + this._lastPanAngle; - this._cameraController.tiltAngle = 0.3 * (event.clientY - this._lastMouseY) + this._lastTiltAngle; - } - }; - - /** - * Mouse wheel listener for navigation - */ - LightsShadowTest.prototype.onMouseWheel = function (event) { - this._cameraController.distance -= event.wheelDelta * 2; - - if (this._cameraController.distance < 100) - this._cameraController.distance = 100; - else if (this._cameraController.distance > 2000) - this._cameraController.distance = 2000; - }; - return LightsShadowTest; - })(); - lights.LightsShadowTest = LightsShadowTest; - })(tests.lights || (tests.lights = {})); - var lights = tests.lights; -})(tests || (tests = {})); -//# sourceMappingURL=LightsShadowTest.js.map diff --git a/tests/js/LightsShadowTest.js.map b/tests/js/LightsShadowTest.js.map deleted file mode 100644 index 22b0d7502..000000000 --- a/tests/js/LightsShadowTest.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"LightsShadowTest.js","sourceRoot":"","sources":["../lights/LightsShadowTest.ts"],"names":["tests","tests.lights","tests.lights.LightsShadowTest","tests.lights.LightsShadowTest.constructor","tests.lights.LightsShadowTest.resize","tests.lights.LightsShadowTest.render","tests.lights.LightsShadowTest.onAssetComplete","tests.lights.LightsShadowTest.onResourceComplete","tests.lights.LightsShadowTest.onMouseDown","tests.lights.LightsShadowTest.onMouseUp","tests.lights.LightsShadowTest.onMouseMove","tests.lights.LightsShadowTest.onMouseWheel"],"mappings":"AAAA,gEAAgE;AAEhE,IAAO,KAAK;AAkKX,CAlKD,UAAO,KAAK;KAAZA,UAAaA,MAAMA;QAGlBC,WAAoBA,IAAIA,CAACA,UAAUA,CAACA,IAAIA;QACxCA,sBAA4BA,IAAIA,CAACA,WAAWA,CAACA,eAAeA;;QAE5DA,iBAAwBA,IAAIA,CAACA,MAAMA,CAACA,UAAUA;QAC9CA,kBAAyBA,IAAIA,CAACA,MAAMA,CAACA,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AAaA;oBAC7FA,IAAIA,CAACA,iBAAiBA,CAACA,SAASA,GAAGA,GAAGA,GAACA,CAACA,KAAKA,CAACA,OAAOA,GAAGA,IAAIA,CAACA,WAAWA,CAACA,GAAGA,IAAIA,CAACA,cAAcA;iBAClGA;YACLA,CAACA;;YAKDR;;cADGA;sDACHA,UAAqBA,KAAqBA;gBAEtCS,IAAIA,CAACA,iBAAiBA,CAACA,QAAQA,IAAIA,KAAKA,CAACA,UAAUA,GAAGA,CAACA;;gBAEvDA,IAAIA,IAAIA,CAACA,iBAAiBA,CAACA,QAAQA,GAAGA,GAAGA;oBACrCA,IAAIA,CAACA,iBAAiBA,CAACA,QAAQA,GAAGA,GAAGA;qBACpCA,IAAIA,IAAIA,CAACA,iBAAiBA,CAACA,QAAQA,GAAGA,IAAIA;oBAC3CA,IAAIA,CAACA,iBAAiBA,CAACA,QAAQA,GAAGA,IAAIA,CAACA;YAC/CA,CAACA;YACLT,wBAACA;QAADA,CAACA,IAAAD;QA9IDA,2CA8ICA;IACLA,CAACA,uCAAAD;8BAAAA;AAADA,CAACA,yBAAA"} \ No newline at end of file diff --git a/tests/js/MaterialAlphaTest.js b/tests/js/MaterialAlphaTest.js deleted file mode 100644 index c7d1aa166..000000000 --- a/tests/js/MaterialAlphaTest.js +++ /dev/null @@ -1,214 +0,0 @@ -/// -var tests; -(function (tests) { - (function (materials) { - var View = away.containers.View; - - var LoaderEvent = away.events.LoaderEvent; - var Vector3D = away.geom.Vector3D; - var AssetLibrary = away.library.AssetLibrary; - - var AssetType = away.library.AssetType; - var DirectionalLight = away.entities.DirectionalLight; - var StaticLightPicker = away.materials.StaticLightPicker; - var TriangleMethodMaterial = away.materials.TriangleMethodMaterial; - - var URLRequest = away.net.URLRequest; - var OBJParser = away.parsers.OBJParser; - var PrimitiveTorusPrefab = away.prefabs.PrimitiveTorusPrefab; - var PrimitiveCubePrefab = away.prefabs.PrimitiveCubePrefab; - var PrimitiveCapsulePrefab = away.prefabs.PrimitiveCapsulePrefab; - - var DefaultRenderer = away.render.DefaultRenderer; - - var RequestAnimationFrame = away.utils.RequestAnimationFrame; - - var MaterialAlphaTest = (function () { - function MaterialAlphaTest() { - var _this = this; - this.height = 0; - this.meshes = new Array(); - this.aValues = Array(0, .1, .5, .8, .9, .99, 1); - this.aValuesP = 0; - away.Debug.LOG_PI_ERRORS = false; - away.Debug.THROW_ERRORS = false; - - this.view = new View(new DefaultRenderer()); - this.raf = new RequestAnimationFrame(this.render, this); - this.onResize(); - - this.light = new DirectionalLight(); - this.light.color = 0xFFFFFF; - this.light.direction = new Vector3D(1, 1, 0); - this.light.ambient = 0; - this.light.ambientColor = 0xFFFFFF; - this.light.diffuse = 1; - this.light.specular = 1; - - this.lightB = new DirectionalLight(); - this.lightB.color = 0xFF0000; - this.lightB.direction = new Vector3D(-1, 0, 1); - this.lightB.ambient = 0; - this.lightB.ambientColor = 0xFFFFFF; - this.lightB.diffuse = 1; - this.lightB.specular = 1; - - this.view.scene.addChild(this.light); - this.view.scene.addChild(this.lightB); - - this.view.backgroundColor = 0x222222; - - AssetLibrary.enableParser(OBJParser); - - this.token = AssetLibrary.load(new URLRequest('assets/platonic.obj')); - this.token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, function (event) { - return _this.onResourceComplete(event); - }); - - this.token = AssetLibrary.load(new URLRequest('assets/dots.png')); - this.token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, function (event) { - return _this.onResourceComplete(event); - }); - - window.onresize = function (event) { - return _this.onResize(event); - }; - document.onmousedown = function (event) { - return _this.onMouseDown(event); - }; - } - MaterialAlphaTest.prototype.onMouseDown = function (event) { - this.cubeColorMaterial.alpha = this.torusTextureMaterial.alpha = this.loadedMeshMaterial.alpha = this.aValues[this.aValuesP]; - - alert('Alpha: ' + this.aValues[this.aValuesP]); - - this.aValuesP++; - - if (this.aValuesP > this.aValues.length - 1) - this.aValuesP = 0; - }; - - MaterialAlphaTest.prototype.render = function (dt) { - if (this.meshes) - for (var c = 0; c < this.meshes.length; c++) - this.meshes[c].rotationY += .35; - - this.view.render(); - }; - - MaterialAlphaTest.prototype.onResourceComplete = function (event) { - var loader = event.target; - var l = loader.baseDependency.assets.length; - - for (var c = 0; c < l; c++) { - var d = loader.baseDependency.assets[c]; - - console.log(d.name); - - switch (d.assetType) { - case AssetType.MESH: - var mesh = d; - - this.loadedMesh = mesh; - - if (d.name == 'Mesh_g0') { - this.loadedMesh = mesh; - mesh.y = -400; - mesh.transform.scale = new away.geom.Vector3D(5, 5, 5); - } else { - mesh.transform.scale = new away.geom.Vector3D(3.5, 3.5, 3.5); - } - - if (this.loadedMeshMaterial) - mesh.material = this.loadedMeshMaterial; - - this.view.scene.addChild(mesh); - this.meshes.push(mesh); - - this.raf.start(); - break; - case AssetType.TEXTURE: - // Loaded Texture - var tx = d; - - // Light Picker - this.staticLightPicker = new StaticLightPicker([this.light, this.lightB]); - - // Material for loaded mesh - this.loadedMeshMaterial = new TriangleMethodMaterial(tx, true, true, false); - this.loadedMeshMaterial.lightPicker = this.staticLightPicker; - this.loadedMeshMaterial.alpha = 1; - this.loadedMeshMaterial.bothSides = true; - - if (this.loadedMesh) - this.loadedMesh.material = this.loadedMeshMaterial; - - // Torus - var torus = new PrimitiveTorusPrefab(150, 50, 64, 64); - - // Torus Texture Material - this.torusTextureMaterial = new TriangleMethodMaterial(tx, true, true, false); - this.torusTextureMaterial.lightPicker = this.staticLightPicker; - this.torusTextureMaterial.bothSides = true; - this.torusTextureMaterial.alpha = .8; - - torus.material = this.torusTextureMaterial; - - // Torus Mesh ( left ) - var torusMesh = torus.getNewObject(); - torusMesh.rotationX = 90; - torusMesh.x = 600; - this.meshes.push(torusMesh); - this.view.scene.addChild(torusMesh); - - var cube = new PrimitiveCubePrefab(300, 300, 300, 20, 20, 20); - - // Torus Color Material - this.cubeColorMaterial = new TriangleMethodMaterial(0x0090ff); - this.cubeColorMaterial.lightPicker = this.staticLightPicker; - this.cubeColorMaterial.alpha = .8; - this.cubeColorMaterial.bothSides = true; - - cube.material = this.cubeColorMaterial; - - // Torus Mesh ( right ) - var cubeMesh = cube.getNewObject(); - cubeMesh.rotationX = 90; - cubeMesh.x = -600; - this.meshes.push(cubeMesh); - this.view.scene.addChild(cubeMesh); - - this.capsuleColorMaterial = new TriangleMethodMaterial(0x00ffff); - this.capsuleColorMaterial.lightPicker = this.staticLightPicker; - - var capsule = new PrimitiveCapsulePrefab(100, 200); - - capsule.material = this.capsuleColorMaterial; - - // Torus Mesh ( right ) - var capsuleMesh = capsule.getNewObject(); - this.meshes.push(capsuleMesh); - this.view.scene.addChild(capsuleMesh); - - this.cubeColorMaterial.alpha = this.torusTextureMaterial.alpha = this.loadedMeshMaterial.alpha = 1; - - break; - } - } - }; - - MaterialAlphaTest.prototype.onResize = function (event) { - if (typeof event === "undefined") { event = null; } - this.view.y = 0; - this.view.x = 0; - - this.view.width = window.innerWidth; - this.view.height = window.innerHeight; - }; - return MaterialAlphaTest; - })(); - materials.MaterialAlphaTest = MaterialAlphaTest; - })(tests.materials || (tests.materials = {})); - var materials = tests.materials; -})(tests || (tests = {})); -//# sourceMappingURL=MaterialAlphaTest.js.map diff --git a/tests/js/MaterialAlphaTest.js.map b/tests/js/MaterialAlphaTest.js.map deleted file mode 100644 index 8fb879019..000000000 --- a/tests/js/MaterialAlphaTest.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MaterialAlphaTest.js","sourceRoot":"","sources":["../materials/MaterialAlphaTest.ts"],"names":["tests","tests.materials","tests.materials.MaterialAlphaTest","tests.materials.MaterialAlphaTest.constructor","tests.materials.MaterialAlphaTest.onMouseDown","tests.materials.MaterialAlphaTest.render","tests.materials.MaterialAlphaTest.onResourceComplete","tests.materials.MaterialAlphaTest.onResize"],"mappings":"AAAA,gEAAgE;AAEhE,IAAO,KAAK;AAgOX,CAhOD,UAAO,KAAK;KAAZA,UAAaA,SAASA;QAIrBC,WAAoBA,IAAIA,CAACA,UAAUA,CAACA,IAAIA;;QAExCA,kBAAyBA,IAA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A;gBAApBK,oCAAAA,KAAKA,GAAWA,IAAIA;AAAAA,gBAEhCA,IAAIA,CAACA,IAAIA,CAACA,CAACA,GAAGA,CAACA;gBACfA,IAAIA,CAACA,IAAIA,CAACA,CAACA,GAAGA,CAACA;;gBAEfA,IAAIA,CAACA,IAAIA,CAACA,KAAKA,GAAGA,MAAMA,CAACA,UAAUA;gBACnCA,IAAIA,CAACA,IAAIA,CAACA,MAAMA,GAAGA,MAAMA,CAACA,WAAWA;YACzCA,CAACA;YACLL,yBAACA;QAADA,CAACA,IAAAD;QApMDA,gDAoMCA;IACLA,CAACA,6CAAAD;oCAAAA;AAADA,CAACA,yBAAA"} \ No newline at end of file diff --git a/tests/js/MaterialEnvMapTest.js b/tests/js/MaterialEnvMapTest.js deleted file mode 100644 index aa38178c1..000000000 --- a/tests/js/MaterialEnvMapTest.js +++ /dev/null @@ -1,106 +0,0 @@ -/// -var tests; -(function (tests) { - (function (materials) { - var View = away.containers.View; - - var AssetEvent = away.events.AssetEvent; - var LoaderEvent = away.events.LoaderEvent; - - var AssetLibrary = away.library.AssetLibrary; - - var AssetType = away.library.AssetType; - - var URLRequest = away.net.URLRequest; - var AWDParser = away.parsers.AWDParser; - var DefaultRenderer = away.render.DefaultRenderer; - var RequestAnimationFrame = away.utils.RequestAnimationFrame; - - var MaterialEnvMapTest = (function () { - function MaterialEnvMapTest() { - var _this = this; - away.Debug.LOG_PI_ERRORS = true; - away.Debug.THROW_ERRORS = false; - - AssetLibrary.enableParser(AWDParser); - - this._token = AssetLibrary.load(new URLRequest('assets/EnvMapTest.awd')); - this._token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, function (event) { - return _this.onResourceComplete(event); - }); - this._token.addEventListener(AssetEvent.ASSET_COMPLETE, function (event) { - return _this.onAssetComplete(event); - }); - - this._view = new View(new DefaultRenderer()); - this._timer = new RequestAnimationFrame(this.render, this); - - window.onresize = function () { - return _this.resize(); - }; - - this._timer.start(); - this.resize(); - } - MaterialEnvMapTest.prototype.resize = function (event) { - if (typeof event === "undefined") { event = null; } - this._view.y = 0; - this._view.x = 0; - this._view.width = window.innerWidth; - this._view.height = window.innerHeight; - }; - - MaterialEnvMapTest.prototype.render = function (dt) { - if (this._torus) - this._torus.rotationY += 1; - - this._view.render(); - this._view.camera.z = -2000; - }; - - MaterialEnvMapTest.prototype.onAssetComplete = function (event) { - console.log('------------------------------------------------------------------------------'); - console.log('away.events.AssetEvent.ASSET_COMPLETE', AssetLibrary.getAsset(event.asset.name)); - console.log('------------------------------------------------------------------------------'); - }; - - MaterialEnvMapTest.prototype.onResourceComplete = function (event) { - console.log('------------------------------------------------------------------------------'); - console.log('away.events.LoaderEvent.RESOURCE_COMPLETE', event); - console.log('------------------------------------------------------------------------------'); - - var loader = event.target; - var numAssets = loader.baseDependency.assets.length; - - for (var i = 0; i < numAssets; ++i) { - var asset = loader.baseDependency.assets[i]; - - console.log(asset.assetType); - - switch (asset.assetType) { - case AssetType.SKYBOX: - var skybox = asset; - this._view.scene.addChild(skybox); - break; - - case AssetType.MESH: - this._torus = asset; - this._view.scene.addChild(this._torus); - - break; - - case AssetType.GEOMETRY: - break; - - case AssetType.MATERIAL: - break; - } - } - }; - return MaterialEnvMapTest; - })(); - materials.MaterialEnvMapTest = MaterialEnvMapTest; - })(tests.materials || (tests.materials = {})); - var materials = tests.materials; -})(tests || (tests = {})); -//# sourceMappingURL=MaterialEnvMapTest.js.map diff --git a/tests/js/MaterialEnvMapTest.js.map b/tests/js/MaterialEnvMapTest.js.map deleted file mode 100644 index 761869a1f..000000000 --- a/tests/js/MaterialEnvMapTest.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MaterialEnvMapTest.js","sourceRoot":"","sources":["../materials/MaterialEnvMapTest.ts"],"names":["tests","tests.materials","tests.materials.MaterialEnvMapTest","tests.materials.MaterialEnvMapTest.constructor","tests.materials.MaterialEnvMapTest.resize","tests.materials.MaterialEnvMapTest.render","tests.materials.MaterialEnvMapTest.onAssetComplete","tests.materials.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AAAD;oCAAAA;AAADA,CAACA,yBAAA"} \ No newline at end of file diff --git a/tests/js/ObjChiefTestDay.js b/tests/js/ObjChiefTestDay.js deleted file mode 100644 index c0ca9fe5f..000000000 --- a/tests/js/ObjChiefTestDay.js +++ /dev/null @@ -1,163 +0,0 @@ -/// -var tests; -(function (tests) { - (function (parsers) { - var DisplayObjectContainer = away.containers.DisplayObjectContainer; - - var View = away.containers.View; - - var LoaderEvent = away.events.LoaderEvent; - var Vector3D = away.geom.Vector3D; - var AssetLibrary = away.library.AssetLibrary; - - var AssetType = away.library.AssetType; - - var DirectionalLight = away.entities.DirectionalLight; - var TriangleMethodMaterial = away.materials.TriangleMethodMaterial; - var StaticLightPicker = away.materials.StaticLightPicker; - var URLRequest = away.net.URLRequest; - var OBJParser = away.parsers.OBJParser; - var DefaultRenderer = away.render.DefaultRenderer; - - var RequestAnimationFrame = away.utils.RequestAnimationFrame; - - var ObjChiefTestDay = (function () { - function ObjChiefTestDay() { - var _this = this; - this.meshes = new Array(); - this.spartan = new DisplayObjectContainer(); - this.spartanFlag = false; - this.terrainObjFlag = false; - away.Debug.LOG_PI_ERRORS = false; - away.Debug.THROW_ERRORS = false; - - this.view = new View(new DefaultRenderer()); - this.view.camera.z = -50; - this.view.camera.y = 20; - this.view.camera.projection.near = 0.1; - this.view.backgroundColor = 0xCEC8C6; - - this.raf = new RequestAnimationFrame(this.render, this); - - this.light = new DirectionalLight(); - this.light.color = 0xc1582d; - this.light.direction = new Vector3D(1, 0, 0); - this.light.ambient = 0.4; - this.light.ambientColor = 0x85b2cd; - this.light.diffuse = 2.8; - this.light.specular = 1.8; - - this.spartan.transform.scale = new Vector3D(.25, .25, .25); - this.spartan.y = 0; - - this.view.scene.addChild(this.light); - - AssetLibrary.enableParser(OBJParser); - - this.token = AssetLibrary.load(new away.net.URLRequest('assets/Halo_3_SPARTAN4.obj')); - this.token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, function (event) { - return _this.onResourceComplete(event); - }); - - this.token = AssetLibrary.load(new URLRequest('assets/terrain.obj')); - this.token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, function (event) { - return _this.onResourceComplete(event); - }); - - this.token = AssetLibrary.load(new URLRequest('assets/masterchief_base.png')); - this.token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, function (event) { - return _this.onResourceComplete(event); - }); - - this.token = AssetLibrary.load(new away.net.URLRequest('assets/stone_tx.jpg')); - this.token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, function (event) { - return _this.onResourceComplete(event); - }); - - window.onresize = function (event) { - return _this.onResize(); - }; - - this.raf.start(); - } - ObjChiefTestDay.prototype.render = function () { - if (this.terrain) - this.terrain.rotationY += 0.4; - - this.spartan.rotationY += 0.4; - this.view.render(); - }; - - ObjChiefTestDay.prototype.onResourceComplete = function (event) { - var loader = event.target; - var l = loader.baseDependency.assets.length; - - console.log('------------------------------------------------------------------------------'); - console.log('away.events.LoaderEvent.RESOURCE_COMPLETE', event, l, loader); - console.log('------------------------------------------------------------------------------'); - - var loader = event.target; - var l = loader.baseDependency.assets.length; - - for (var c = 0; c < l; c++) { - var d = loader.baseDependency.assets[c]; - - console.log(d.name, event.url); - - switch (d.assetType) { - case AssetType.MESH: - if (event.url == 'assets/Halo_3_SPARTAN4.obj') { - var mesh = d; - - this.spartan.addChild(mesh); - this.spartanFlag = true; - this.meshes.push(mesh); - } else if (event.url == 'assets/terrain.obj') { - this.terrainObjFlag = true; - this.terrain = d; - this.terrain.y = 98; - this.view.scene.addChild(this.terrain); - } - - break; - case AssetType.TEXTURE: - if (event.url == 'assets/masterchief_base.png') { - this.mat = new TriangleMethodMaterial(d, true, true, false); - this.mat.lightPicker = new StaticLightPicker([this.light]); - } else if (event.url == 'assets/stone_tx.jpg') { - this.terrainMaterial = new TriangleMethodMaterial(d, true, true, false); - this.terrainMaterial.lightPicker = new StaticLightPicker([this.light]); - } - - break; - } - } - - if (this.terrainObjFlag && this.terrainMaterial) { - this.terrain.material = this.terrainMaterial; - this.terrain.geometry.scaleUV(20, 20); - } - - if (this.mat && this.spartanFlag) - for (var c = 0; c < this.meshes.length; c++) - this.meshes[c].material = this.mat; - - this.view.scene.addChild(this.spartan); - this.onResize(); - }; - - ObjChiefTestDay.prototype.onResize = function (event) { - if (typeof event === "undefined") { event = null; } - this.view.y = 0; - this.view.x = 0; - - this.view.width = window.innerWidth; - this.view.height = window.innerHeight; - }; - return ObjChiefTestDay; - })(); - parsers.ObjChiefTestDay = ObjChiefTestDay; - })(tests.parsers || (tests.parsers = {})); - var parsers = tests.parsers; -})(tests || (tests = {})); -//# sourceMappingURL=ObjChiefTestDay.js.map diff --git a/tests/js/ObjChiefTestDay.js.map b/tests/js/ObjChiefTestDay.js.map deleted file mode 100644 index e437721e5..000000000 --- a/tests/js/ObjChiefTestDay.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ObjChiefTestDay.js","sourceRoot":"","sources":["../parsers/ObjChiefTestDay.ts"],"names":["tests","tests.parsers","tests.parsers.ObjChiefTestDay","tests.parsers.ObjChiefTestDay.constructor","tests.parsers.ObjChiefTestDay.render","tests.parsers.ObjChiefTestDay.onResourceComplete","tests.parsers.ObjChiefTestDay.onResize"],"mappings":"AAAA,gEAAgE;AAEhE,IAAO,KAAK;AAmKX,CAnKD,UAAO,KAAK;KAAZA,UAAaA,OAAOA;QAEnBC,6BAAiCA,IAAIA,CAACA,UAAUA,CAACA,sBAAsBA;;QAEvEA,WAAoBA,IAAIA,CAACA,UAAUA,CAACA,IAAIA;;QAExCA,kBAAyBA,IAAIA,CAACA,MAAMA,CAACA,WAAWA;QAChDA,eAAuBA,IAAIA,CAACA,IAAIA,CAACA,QAAQA;QACzCA,mBAA0BA,IAAIA,CAACA,OAAOA,CAACA,YAAYA;;QAGnDA,gBAAuBA,IAAIA,CAACA,OAAOA,CAACA,SAASA;;QAE7CA,uBAA6BA,IAAIA,CAACA,QAAQA,CAACA,gBAAgBA;QAC3DA,6BAAiCA,IAAIA,CAACA,SAASA,CAAC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IAAIA,CAACA,OAAOA,CAACA;gBACtCA,IAAIA,CAACA,QAAQA,CAACA,CAACA;YACnBA,CAACA;;YAEDH,qCAAAA,UAAgBA,KAAoBA;gBAApBI,oCAAAA,KAAKA,GAAWA,IAAIA;AAAAA,gBAEhCA,IAAIA,CAACA,IAAIA,CAACA,CAACA,GAAGA,CAACA;gBACfA,IAAIA,CAACA,IAAIA,CAACA,CAACA,GAAGA,CAACA;;gBAEfA,IAAIA,CAACA,IAAIA,CAACA,KAAKA,GAAGA,MAAMA,CAACA,UAAUA;gBACnCA,IAAIA,CAACA,IAAIA,CAACA,MAAMA,GAAGA,MAAMA,CAACA,WAAWA;YACzCA,CAACA;YACLJ,uBAACA;QAADA,CAACA,IAAAD;QA5IDA,0CA4ICA;IACLA,CAACA,yCAAAD;gCAAAA;AAADA,CAACA,yBAAA"} \ No newline at end of file diff --git a/tests/js/ObjParserTest.js b/tests/js/ObjParserTest.js deleted file mode 100644 index 81a8a1557..000000000 --- a/tests/js/ObjParserTest.js +++ /dev/null @@ -1,83 +0,0 @@ -/// -var tests; -(function (tests) { - (function (parsers) { - var View = away.containers.View; - - var AssetEvent = away.events.AssetEvent; - var LoaderEvent = away.events.LoaderEvent; - var Vector3D = away.geom.Vector3D; - var AssetLibrary = away.library.AssetLibrary; - - var URLRequest = away.net.URLRequest; - var OBJParser = away.parsers.OBJParser; - var DefaultRenderer = away.render.DefaultRenderer; - var RequestAnimationFrame = away.utils.RequestAnimationFrame; - - var ObjParserTest = (function () { - function ObjParserTest() { - var _this = this; - away.Debug.LOG_PI_ERRORS = true; - away.Debug.THROW_ERRORS = false; - - AssetLibrary.enableParser(OBJParser); - - this._token = AssetLibrary.load(new URLRequest('assets/t800.obj')); - this._token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, function (event) { - return _this.onResourceComplete(event); - }); - this._token.addEventListener(AssetEvent.ASSET_COMPLETE, function (event) { - return _this.onAssetComplete(event); - }); - - this._view = new View(new DefaultRenderer()); - this._timer = new RequestAnimationFrame(this.render, this); - - window.onresize = function (event) { - return _this.resize(event); - }; - - this._timer.start(); - this.resize(); - } - ObjParserTest.prototype.resize = function (event) { - if (typeof event === "undefined") { event = null; } - this._view.y = 0; - this._view.x = 0; - this._view.width = window.innerWidth; - this._view.height = window.innerHeight; - }; - - ObjParserTest.prototype.render = function (dt) { - if (this._t800) - this._t800.rotationY += 1; - - this._view.render(); - }; - - ObjParserTest.prototype.onAssetComplete = function (event) { - console.log('------------------------------------------------------------------------------'); - console.log('away.events.AssetEvent.ASSET_COMPLETE', AssetLibrary.getAsset(event.asset.name)); - console.log('------------------------------------------------------------------------------'); - }; - - ObjParserTest.prototype.onResourceComplete = function (event) { - console.log('------------------------------------------------------------------------------'); - console.log('away.events.LoaderEvent.RESOURCE_COMPLETE', event); - console.log('------------------------------------------------------------------------------'); - - console.log(AssetLibrary.getAsset('Mesh_g0')); - - this._t800 = AssetLibrary.getAsset('Mesh_g0'); - this._t800.y = -200; - this._t800.transform.scale = new Vector3D(4, 4, 4); - - this._view.scene.addChild(this._t800); - }; - return ObjParserTest; - })(); - parsers.ObjParserTest = ObjParserTest; - })(tests.parsers || (tests.parsers = {})); - var parsers = tests.parsers; -})(tests || (tests = {})); -//# sourceMappingURL=ObjParserTest.js.map diff --git a/tests/js/ObjParserTest.js.map b/tests/js/ObjParserTest.js.map deleted file mode 100644 index 723202faf..000000000 --- a/tests/js/ObjParserTest.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ObjParserTest.js","sourceRoot":"","sources":["../parsers/ObjParserTest.ts"],"names":["tests","tests.parsers","tests.parsers.ObjParserTest","tests.parsers.ObjParserTest.constructor","tests.parsers.ObjParserTest.resize","tests.parsers.ObjParserTest.render","tests.parsers.ObjParserTest.onAssetComplete","tests.parsers.ObjParserTest.onResourceComplete"],"mappings":"AAAA,gEAAgE;AAEhE,IAAO,KAAK;AAkFX,CAlFD,UAAO,KAAK;KAAZA,UAAaA,OAAOA;QAEnBC,WAAoBA,IAA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A;gBAC/DA,OAAOA,CAACA,GAAGA,CAACA,gFAAgFA,CAACA;;gBAE7FA,OAAOA,CAACA,GAAGA,CAACA,YAAYA,CAACA,QAAQA,CAACA,SAASA,CAACA,CAACA;;gBAE7CA,IAAIA,CAACA,KAAKA,GAAUA,YAAYA,CAACA,QAAQA,CAACA,SAASA,CAACA;gBACpDA,IAAIA,CAACA,KAAKA,CAACA,CAACA,GAAGA,CAACA,GAAGA;gBACnBA,IAAIA,CAACA,KAAKA,CAACA,SAASA,CAACA,KAAKA,GAAGA,IAAIA,QAAQA,CAACA,CAACA,EAAEA,CAACA,EAAEA,CAACA,CAACA;;gBAE3DA,IAAIA,CAACA,KAAKA,CAACA,KAAKA,CAACA,QAAQA,CAACA,IAAIA,CAACA,KAAKA,CAACA;YAChCA,CAACA;YACLL,qBAACA;QAADA,CAACA,IAAAD;QAhEDA,sCAgECA;IACLA,CAACA,yCAAAD;gCAAAA;AAADA,CAACA,yBAAA"} \ No newline at end of file diff --git a/tests/lights/LightsShadowTest.ts b/tests/lights/LightsShadowTest.ts index 8a1229a4b..b3c6a4c71 100644 --- a/tests/lights/LightsShadowTest.ts +++ b/tests/lights/LightsShadowTest.ts @@ -1,165 +1,163 @@ -/// - -module tests.lights +import View = require("awayjs-core/lib/containers/View"); +import HoverController = require("awayjs-core/lib/controllers/HoverController"); +import LightBase = require("awayjs-core/lib/core/base/LightBase"); +import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +import AssetLibrary = require("awayjs-core/lib/core/library/AssetLibrary"); +import AssetLoader = require("awayjs-core/lib/core/library/AssetLoader"); +import AssetLoaderToken = require("awayjs-core/lib/core/library/AssetLoaderToken"); +import AssetType = require("awayjs-core/lib/core/library/AssetType"); +import IAsset = require("awayjs-core/lib/core/library/IAsset"); +import URLRequest = require("awayjs-core/lib/core/net/URLRequest"); +import Mesh = require("awayjs-core/lib/entities/Mesh"); +import AssetEvent = require("awayjs-core/lib/events/AssetEvent"); +import LoaderEvent = require("awayjs-core/lib/events/LoaderEvent"); +import Debug = require("awayjs-core/lib/utils/Debug"); +import RequestAnimationFrame = require("awayjs-core/lib/utils/RequestAnimationFrame"); + +import DefaultRenderer = require("awayjs-stagegl/lib/core/render/DefaultRenderer"); + +import AWDParser = require("awayjs-renderergl/lib/parsers/AWDParser"); + +class LightsShadowTest { - import LightBase = away.base.LightBase; - import View = away.containers.View; - import HoverController = away.controllers.HoverController; - import Mesh = away.entities.Mesh; - import AssetEvent = away.events.AssetEvent; - import LoaderEvent = away.events.LoaderEvent; - import Vector3D = away.geom.Vector3D; - import AssetLibrary = away.library.AssetLibrary; - import AssetLoader = away.library.AssetLoader; - import AssetLoaderToken = away.library.AssetLoaderToken; - import AssetType = away.library.AssetType; - import IAsset = away.library.IAsset; - import URLRequest = away.net.URLRequest; - import AWDParser = away.parsers.AWDParser; - import DefaultRenderer = away.render.DefaultRenderer; - import RequestAnimationFrame = away.utils.RequestAnimationFrame; - - export class LightsShadowTest - { - - private _view:View; - private _token:AssetLoaderToken; - private _timer:RequestAnimationFrame; - private lookAtPosition:Vector3D = new Vector3D(); - private _awdMesh:Mesh; - private _cameraController:HoverController; - private _move:boolean = false; - private _lastPanAngle:number; - private _lastTiltAngle:number; - private _lastMouseX:number; - private _lastMouseY:number; - - constructor() - { - away.Debug.LOG_PI_ERRORS = true; - away.Debug.THROW_ERRORS = false; - - AssetLibrary.enableParser(AWDParser); - - this._token = AssetLibrary.load(new URLRequest('assets/ShadowTest.awd')); - - this._token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (event:LoaderEvent) => this.onResourceComplete(event)); - this._token.addEventListener(AssetEvent.ASSET_COMPLETE, (event:AssetEvent) => this.onAssetComplete(event)); - - this._view = new View(new DefaultRenderer()); - this._view.camera.projection.far = 5000; - this._view.camera.y = 100; - - this._timer = new RequestAnimationFrame(this.render, this); - - this._cameraController = new HoverController(this._view.camera, null, 45, 20, 2000, 5); - - document.onmousedown = (event:MouseEvent) => this.onMouseDown(event); - document.onmouseup = (event:MouseEvent) => this.onMouseUp(event); - document.onmousemove = (event:MouseEvent) => this.onMouseMove(event); - document.onmousewheel = (event:MouseWheelEvent) => this.onMouseWheel(event); - - window.onresize = (event:UIEvent) => this.resize(event); - } - - private resize(event:UIEvent = null) - { - this._view.y = 0; - this._view.x = 0; - this._view.width = window.innerWidth; - this._view.height = window.innerHeight; - } - - private render(dt:number) //animate based on dt for firefox - { - if (this._view.camera) - this._view.camera.lookAt(this.lookAtPosition); - - if (this._awdMesh) - this._awdMesh.rotationY += 0.2; - - this._view.render(); - } - - public onAssetComplete(event:AssetEvent) - { - console.log('------------------------------------------------------------------------------'); - console.log('AssetEvent.ASSET_COMPLETE' , AssetLibrary.getAsset(event.asset.name)); - console.log('------------------------------------------------------------------------------'); - } - - public onResourceComplete(event:LoaderEvent) - { - - console.log('------------------------------------------------------------------------------'); - console.log('LoaderEvent.RESOURCE_COMPLETE' , event); - console.log('------------------------------------------------------------------------------'); - - var loader:AssetLoader = event.target; - var numAssets:number = loader.baseDependency.assets.length; - - for (var i:number = 0; i < numAssets; ++i) { - var asset:IAsset = loader.baseDependency.assets[ i ]; - - switch (asset.assetType) { - case AssetType.MESH: - this._awdMesh = asset; - this._view.scene.addChild(this._awdMesh); - this.resize(); - break; - - case AssetType.LIGHT: - this._view.scene.addChild( asset); - break; - - case AssetType.MATERIAL: - break; - - } - } - - this._timer.start(); - } - - /** - * Mouse down listener for navigation - */ - private onMouseDown(event):void - { - this._lastPanAngle = this._cameraController.panAngle; - this._lastTiltAngle = this._cameraController.tiltAngle; - this._lastMouseX = event.clientX; - this._lastMouseY = event.clientY; - this._move = true; - } - - /** - * Mouse up listener for navigation - */ - private onMouseUp(event):void - { - this._move = false; - } - - private onMouseMove(event) - { - if (this._move) { - this._cameraController.panAngle = 0.3*(event.clientX - this._lastMouseX) + this._lastPanAngle; - this._cameraController.tiltAngle = 0.3*(event.clientY - this._lastMouseY) + this._lastTiltAngle; - } - } - - /** - * Mouse wheel listener for navigation - */ - private onMouseWheel(event:MouseWheelEvent):void - { - this._cameraController.distance -= event.wheelDelta * 2; - - if (this._cameraController.distance < 100) - this._cameraController.distance = 100; - else if (this._cameraController.distance > 2000) - this._cameraController.distance = 2000; - } - } + + private _view:View; + private _token:AssetLoaderToken; + private _timer:RequestAnimationFrame; + private lookAtPosition:Vector3D = new Vector3D(); + private _awdMesh:Mesh; + private _cameraController:HoverController; + private _move:boolean = false; + private _lastPanAngle:number; + private _lastTiltAngle:number; + private _lastMouseX:number; + private _lastMouseY:number; + + constructor() + { + Debug.LOG_PI_ERRORS = true; + Debug.THROW_ERRORS = false; + + AssetLibrary.enableParser(AWDParser); + + this._token = AssetLibrary.load(new URLRequest('assets/ShadowTest.awd')); + + this._token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (event:LoaderEvent) => this.onResourceComplete(event)); + this._token.addEventListener(AssetEvent.ASSET_COMPLETE, (event:AssetEvent) => this.onAssetComplete(event)); + + this._view = new View(new DefaultRenderer()); + this._view.camera.projection.far = 5000; + this._view.camera.y = 100; + + this._timer = new RequestAnimationFrame(this.render, this); + + this._cameraController = new HoverController(this._view.camera, null, 45, 20, 2000, 5); + + document.onmousedown = (event:MouseEvent) => this.onMouseDown(event); + document.onmouseup = (event:MouseEvent) => this.onMouseUp(event); + document.onmousemove = (event:MouseEvent) => this.onMouseMove(event); + document.onmousewheel = (event:MouseWheelEvent) => this.onMouseWheel(event); + + window.onresize = (event:UIEvent) => this.resize(event); + } + + private resize(event:UIEvent = null) + { + this._view.y = 0; + this._view.x = 0; + this._view.width = window.innerWidth; + this._view.height = window.innerHeight; + } + + private render(dt:number) //animate based on dt for firefox + { + if (this._view.camera) + this._view.camera.lookAt(this.lookAtPosition); + + if (this._awdMesh) + this._awdMesh.rotationY += 0.2; + + this._view.render(); + } + + public onAssetComplete(event:AssetEvent) + { + console.log('------------------------------------------------------------------------------'); + console.log('AssetEvent.ASSET_COMPLETE' , AssetLibrary.getAsset(event.asset.name)); + console.log('------------------------------------------------------------------------------'); + } + + public onResourceComplete(event:LoaderEvent) + { + + console.log('------------------------------------------------------------------------------'); + console.log('LoaderEvent.RESOURCE_COMPLETE' , event); + console.log('------------------------------------------------------------------------------'); + + var loader:AssetLoader = event.target; + var numAssets:number = loader.baseDependency.assets.length; + + for (var i:number = 0; i < numAssets; ++i) { + var asset:IAsset = loader.baseDependency.assets[ i ]; + + switch (asset.assetType) { + case AssetType.MESH: + this._awdMesh = asset; + this._view.scene.addChild(this._awdMesh); + this.resize(); + break; + + case AssetType.LIGHT: + this._view.scene.addChild( asset); + break; + + case AssetType.MATERIAL: + break; + + } + } + + this._timer.start(); + } + + /** + * Mouse down listener for navigation + */ + private onMouseDown(event):void + { + this._lastPanAngle = this._cameraController.panAngle; + this._lastTiltAngle = this._cameraController.tiltAngle; + this._lastMouseX = event.clientX; + this._lastMouseY = event.clientY; + this._move = true; + } + + /** + * Mouse up listener for navigation + */ + private onMouseUp(event):void + { + this._move = false; + } + + private onMouseMove(event) + { + if (this._move) { + this._cameraController.panAngle = 0.3*(event.clientX - this._lastMouseX) + this._lastPanAngle; + this._cameraController.tiltAngle = 0.3*(event.clientY - this._lastMouseY) + this._lastTiltAngle; + } + } + + /** + * Mouse wheel listener for navigation + */ + private onMouseWheel(event:MouseWheelEvent):void + { + this._cameraController.distance -= event.wheelDelta * 2; + + if (this._cameraController.distance < 100) + this._cameraController.distance = 100; + else if (this._cameraController.distance > 2000) + this._cameraController.distance = 2000; + } } \ No newline at end of file diff --git a/tests/materials/MaterialAlphaTest.ts b/tests/materials/MaterialAlphaTest.ts index 27ddc2c29..554ddd007 100644 --- a/tests/materials/MaterialAlphaTest.ts +++ b/tests/materials/MaterialAlphaTest.ts @@ -1,227 +1,226 @@ -/// - -module tests.materials +import Scene = require("awayjs-core/lib/containers/Scene"); +import View = require("awayjs-core/lib/containers/View"); +import BlendMode = require("awayjs-core/lib/core/base/BlendMode"); +import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +import AssetLibrary = require("awayjs-core/lib/core/library/AssetLibrary"); +import AssetLoader = require("awayjs-core/lib/core/library/AssetLoader"); +import AssetLoaderToken = require("awayjs-core/lib/core/library/AssetLoaderToken"); +import AssetType = require("awayjs-core/lib/core/library/AssetType"); +import IAsset = require("awayjs-core/lib/core/library/IAsset"); +import URLLoader = require("awayjs-core/lib/core/net/URLLoader"); +import URLLoaderDataFormat = require("awayjs-core/lib/core/net/URLLoaderDataFormat"); +import URLRequest = require("awayjs-core/lib/core/net/URLRequest"); +import DirectionalLight = require("awayjs-core/lib/entities/DirectionalLight"); +import Mesh = require("awayjs-core/lib/entities/Mesh"); +import LoaderEvent = require("awayjs-core/lib/events/LoaderEvent"); +import StaticLightPicker = require("awayjs-core/lib/materials/lightpickers/StaticLightPicker"); +import PrimitiveTorusPrefab = require("awayjs-core/lib/prefabs/PrimitiveTorusPrefab"); +import PrimitiveCubePrefab = require("awayjs-core/lib/prefabs/PrimitiveCubePrefab"); +import PrimitiveCapsulePrefab = require("awayjs-core/lib/prefabs/PrimitiveCapsulePrefab"); +import PerspectiveProjection = require("awayjs-core/lib/projections/PerspectiveProjection"); +import ImageTexture = require("awayjs-core/lib/textures/ImageTexture"); +import Debug = require("awayjs-core/lib/utils/Debug"); +import RequestAnimationFrame = require("awayjs-core/lib/utils/RequestAnimationFrame"); + +import DefaultRenderer = require("awayjs-stagegl/lib/core/render/DefaultRenderer"); +import TriangleMethodMaterial = require("awayjs-stagegl/lib/materials/TriangleMethodMaterial"); + +import OBJParser = require("awayjs-renderergl/lib/parsers/OBJParser"); + +class MaterialAlphaTest { - import BlendMode = away.base.BlendMode; - import Scene = away.containers.Scene; - import View = away.containers.View; - import Mesh = away.entities.Mesh; - import LoaderEvent = away.events.LoaderEvent; - import Vector3D = away.geom.Vector3D; - import AssetLibrary = away.library.AssetLibrary; - import AssetLoader = away.library.AssetLoader; - import AssetLoaderToken = away.library.AssetLoaderToken; - import AssetType = away.library.AssetType; - import DirectionalLight = away.entities.DirectionalLight; - import StaticLightPicker = away.materials.StaticLightPicker; - import TriangleMethodMaterial = away.materials.TriangleMethodMaterial; - import URLLoader = away.net.URLLoader; - import URLLoaderDataFormat = away.net.URLLoaderDataFormat; - import URLRequest = away.net.URLRequest; - import OBJParser = away.parsers.OBJParser; - import PrimitiveTorusPrefab = away.prefabs.PrimitiveTorusPrefab; - import PrimitiveCubePrefab = away.prefabs.PrimitiveCubePrefab; - import PrimitiveCapsulePrefab = away.prefabs.PrimitiveCapsulePrefab; - import PerspectiveProjection = away.projections.PerspectiveProjection; - import DefaultRenderer = away.render.DefaultRenderer; - import ImageTexture = away.textures.ImageTexture; - import RequestAnimationFrame = away.utils.RequestAnimationFrame; - - export class MaterialAlphaTest - { - - private height : number = 0; - - private token:AssetLoaderToken; - private view:View; - private raf:RequestAnimationFrame; - private meshes : Array = new Array(); - private loadedMeshMaterial:TriangleMethodMaterial; - private light:DirectionalLight; - private lightB:DirectionalLight; - private loadedMesh:Mesh; - - private aValues:Array = Array(0, .1, .5, .8, .9, .99, 1); - private aValuesP:number = 0; - - private torusTextureMaterial:TriangleMethodMaterial; - private cubeColorMaterial:TriangleMethodMaterial; - private capsuleColorMaterial:TriangleMethodMaterial; - private staticLightPicker:StaticLightPicker; - - constructor() - { - away.Debug.LOG_PI_ERRORS = false; - away.Debug.THROW_ERRORS = false; - - this.view = new View(new DefaultRenderer()); - this.raf = new RequestAnimationFrame(this.render, this); - this.onResize(); - - this.light = new DirectionalLight(); - this.light.color = 0xFFFFFF; - this.light.direction = new Vector3D(1, 1, 0); - this.light.ambient = 0; - this.light.ambientColor = 0xFFFFFF; - this.light.diffuse = 1; - this.light.specular = 1; - - this.lightB = new DirectionalLight(); - this.lightB.color= 0xFF0000; - this.lightB.direction = new Vector3D(-1, 0, 1); - this.lightB.ambient = 0; - this.lightB.ambientColor = 0xFFFFFF; - this.lightB.diffuse = 1; - this.lightB.specular = 1; - - this.view.scene.addChild(this.light); - this.view.scene.addChild(this.lightB); - - this.view.backgroundColor = 0x222222; - - AssetLibrary.enableParser(OBJParser); - - this.token = AssetLibrary.load(new URLRequest('assets/platonic.obj')); - this.token.addEventListener(LoaderEvent.RESOURCE_COMPLETE , (event:LoaderEvent) => this.onResourceComplete(event)); - - this.token = AssetLibrary.load(new URLRequest('assets/dots.png') ); - this.token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (event:LoaderEvent) => this.onResourceComplete(event)); - - window.onresize = (event:UIEvent) => this.onResize(event); - document.onmousedown = (event:MouseEvent) => this.onMouseDown(event); - } - - private onMouseDown(event:MouseEvent) - { - this.cubeColorMaterial.alpha = this.torusTextureMaterial.alpha = this.loadedMeshMaterial.alpha = this.aValues[this.aValuesP]; - - alert( 'Alpha: ' + this.aValues[this.aValuesP]); - - this.aValuesP++; - - if (this.aValuesP > this.aValues.length -1) - this.aValuesP = 0; - } - - private render(dt:number) - { - if (this.meshes) - for (var c:number = 0; c < this.meshes.length; c++) - this.meshes[c].rotationY += .35; - - this.view.render(); - } - - public onResourceComplete(event:LoaderEvent) - { - var loader:AssetLoader = event.target; - var l:number = loader.baseDependency.assets.length - - for (var c:number = 0; c < l; c ++) { - - var d : away.library.IAsset = loader.baseDependency.assets[c]; - - console.log( d.name); - - switch (d.assetType) { - case AssetType.MESH: - var mesh:Mesh = d; - - this.loadedMesh = mesh; - - if (d.name == 'Mesh_g0') { - this.loadedMesh = mesh; - mesh.y = -400; - mesh.transform.scale = new away.geom.Vector3D(5, 5, 5); - } else { - mesh.transform.scale = new away.geom.Vector3D(3.5, 3.5, 3.5); - } - - if (this.loadedMeshMaterial) - mesh.material = this.loadedMeshMaterial; - - this.view.scene.addChild(mesh); - this.meshes.push(mesh); - - this.raf.start(); - break; - case AssetType.TEXTURE: - // Loaded Texture - var tx:ImageTexture = d; - - // Light Picker - this.staticLightPicker = new StaticLightPicker( [this.light , this.lightB ] ); - - // Material for loaded mesh - this.loadedMeshMaterial = new TriangleMethodMaterial( tx, true, true, false ); - this.loadedMeshMaterial.lightPicker = this.staticLightPicker; - this.loadedMeshMaterial.alpha = 1; - this.loadedMeshMaterial.bothSides = true; - - if (this.loadedMesh) - this.loadedMesh.material = this.loadedMeshMaterial; - - // Torus - var torus:PrimitiveTorusPrefab = new PrimitiveTorusPrefab(150 , 50 , 64 , 64); - - // Torus Texture Material - this.torusTextureMaterial = new TriangleMethodMaterial(tx, true, true, false); - this.torusTextureMaterial.lightPicker = this.staticLightPicker ; - this.torusTextureMaterial.bothSides = true; - this.torusTextureMaterial.alpha = .8; - torus.material = this.torusTextureMaterial; - - // Torus Mesh ( left ) - var torusMesh:Mesh = torus.getNewObject(); - torusMesh.rotationX = 90; - torusMesh.x = 600; - this.meshes.push(torusMesh); - this.view.scene.addChild(torusMesh); + private height : number = 0; + + private token:AssetLoaderToken; + private view:View; + private raf:RequestAnimationFrame; + private meshes : Array = new Array(); + private loadedMeshMaterial:TriangleMethodMaterial; + private light:DirectionalLight; + private lightB:DirectionalLight; + private loadedMesh:Mesh; + + private aValues:Array = Array(0, .1, .5, .8, .9, .99, 1); + private aValuesP:number = 0; + + private torusTextureMaterial:TriangleMethodMaterial; + private cubeColorMaterial:TriangleMethodMaterial; + private capsuleColorMaterial:TriangleMethodMaterial; + private staticLightPicker:StaticLightPicker; + + constructor() + { + Debug.LOG_PI_ERRORS = false; + Debug.THROW_ERRORS = false; + + this.view = new View(new DefaultRenderer()); + this.raf = new RequestAnimationFrame(this.render, this); + this.onResize(); + + this.light = new DirectionalLight(); + this.light.color = 0xFFFFFF; + this.light.direction = new Vector3D(1, 1, 0); + this.light.ambient = 0; + this.light.ambientColor = 0xFFFFFF; + this.light.diffuse = 1; + this.light.specular = 1; + + this.lightB = new DirectionalLight(); + this.lightB.color= 0xFF0000; + this.lightB.direction = new Vector3D(-1, 0, 1); + this.lightB.ambient = 0; + this.lightB.ambientColor = 0xFFFFFF; + this.lightB.diffuse = 1; + this.lightB.specular = 1; + + this.view.scene.addChild(this.light); + this.view.scene.addChild(this.lightB); + + this.view.backgroundColor = 0x222222; + + AssetLibrary.enableParser(OBJParser); + + this.token = AssetLibrary.load(new URLRequest('assets/platonic.obj')); + this.token.addEventListener(LoaderEvent.RESOURCE_COMPLETE , (event:LoaderEvent) => this.onResourceComplete(event)); + + this.token = AssetLibrary.load(new URLRequest('assets/dots.png') ); + this.token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (event:LoaderEvent) => this.onResourceComplete(event)); + + window.onresize = (event:UIEvent) => this.onResize(event); + document.onmousedown = (event:MouseEvent) => this.onMouseDown(event); + } + + private onMouseDown(event:MouseEvent) + { + this.cubeColorMaterial.alpha = this.torusTextureMaterial.alpha = this.loadedMeshMaterial.alpha = this.aValues[this.aValuesP]; + + alert( 'Alpha: ' + this.aValues[this.aValuesP]); + + this.aValuesP++; + + if (this.aValuesP > this.aValues.length -1) + this.aValuesP = 0; + } + + private render(dt:number) + { + if (this.meshes) + for (var c:number = 0; c < this.meshes.length; c++) + this.meshes[c].rotationY += .35; + + this.view.render(); + } + + public onResourceComplete(event:LoaderEvent) + { + var loader:AssetLoader = event.target; + var l:number = loader.baseDependency.assets.length + + for (var c:number = 0; c < l; c ++) { + + var d:IAsset = loader.baseDependency.assets[c]; + + console.log( d.name); + + switch (d.assetType) { + case AssetType.MESH: + var mesh:Mesh = d; + + this.loadedMesh = mesh; + + if (d.name == 'Mesh_g0') { + this.loadedMesh = mesh; + mesh.y = -400; + mesh.transform.scale = new Vector3D(5, 5, 5); + } else { + mesh.transform.scale = new Vector3D(3.5, 3.5, 3.5); + } + + if (this.loadedMeshMaterial) + mesh.material = this.loadedMeshMaterial; + + this.view.scene.addChild(mesh); + this.meshes.push(mesh); + + this.raf.start(); + break; + case AssetType.TEXTURE: + // Loaded Texture + var tx:ImageTexture = d; + + // Light Picker + this.staticLightPicker = new StaticLightPicker( [this.light , this.lightB ] ); + + // Material for loaded mesh + this.loadedMeshMaterial = new TriangleMethodMaterial( tx, true, true, false ); + this.loadedMeshMaterial.lightPicker = this.staticLightPicker; + this.loadedMeshMaterial.alpha = 1; + this.loadedMeshMaterial.bothSides = true; + + if (this.loadedMesh) + this.loadedMesh.material = this.loadedMeshMaterial; + + // Torus + var torus:PrimitiveTorusPrefab = new PrimitiveTorusPrefab(150 , 50 , 64 , 64); + + // Torus Texture Material + this.torusTextureMaterial = new TriangleMethodMaterial(tx, true, true, false); + this.torusTextureMaterial.lightPicker = this.staticLightPicker ; + this.torusTextureMaterial.bothSides = true; + this.torusTextureMaterial.alpha = .8; + + torus.material = this.torusTextureMaterial; + + // Torus Mesh ( left ) + var torusMesh:Mesh = torus.getNewObject(); + torusMesh.rotationX = 90; + torusMesh.x = 600; + this.meshes.push(torusMesh); + this.view.scene.addChild(torusMesh); + + var cube:PrimitiveCubePrefab = new PrimitiveCubePrefab(300, 300, 300, 20, 20, 20); + + // Torus Color Material + this.cubeColorMaterial = new TriangleMethodMaterial(0x0090ff); + this.cubeColorMaterial.lightPicker = this.staticLightPicker ; + this.cubeColorMaterial.alpha = .8; + this.cubeColorMaterial.bothSides = true; + + cube.material = this.cubeColorMaterial; + + // Torus Mesh ( right ) + var cubeMesh:Mesh = cube.getNewObject(); + cubeMesh.rotationX = 90; + cubeMesh.x = -600; + this.meshes.push(cubeMesh); + this.view.scene.addChild(cubeMesh); + + this.capsuleColorMaterial = new TriangleMethodMaterial(0x00ffff); + this.capsuleColorMaterial.lightPicker = this.staticLightPicker; + + var capsule:PrimitiveCapsulePrefab = new PrimitiveCapsulePrefab(100, 200); + + capsule.material = this.capsuleColorMaterial; + + // Torus Mesh ( right ) + var capsuleMesh:Mesh = capsule.getNewObject(); + this.meshes.push(capsuleMesh); + this.view.scene.addChild(capsuleMesh); + + this.cubeColorMaterial.alpha = this.torusTextureMaterial.alpha = this.loadedMeshMaterial.alpha = 1; + + break; + } + } + } + + public onResize(event:UIEvent = null) + { + this.view.y = 0; + this.view.x = 0; - var cube:PrimitiveCubePrefab = new PrimitiveCubePrefab(300, 300, 300, 20, 20, 20); - - // Torus Color Material - this.cubeColorMaterial = new TriangleMethodMaterial(0x0090ff); - this.cubeColorMaterial.lightPicker = this.staticLightPicker ; - this.cubeColorMaterial.alpha = .8; - this.cubeColorMaterial.bothSides = true; - - cube.material = this.cubeColorMaterial; - - // Torus Mesh ( right ) - var cubeMesh:Mesh = cube.getNewObject(); - cubeMesh.rotationX = 90; - cubeMesh.x = -600; - this.meshes.push(cubeMesh); - this.view.scene.addChild(cubeMesh); - - this.capsuleColorMaterial = new TriangleMethodMaterial(0x00ffff); - this.capsuleColorMaterial.lightPicker = this.staticLightPicker; - - var capsule:PrimitiveCapsulePrefab = new PrimitiveCapsulePrefab(100, 200); - - capsule.material = this.capsuleColorMaterial; - - // Torus Mesh ( right ) - var capsuleMesh:Mesh = capsule.getNewObject(); - this.meshes.push(capsuleMesh); - this.view.scene.addChild(capsuleMesh); - - this.cubeColorMaterial.alpha = this.torusTextureMaterial.alpha = this.loadedMeshMaterial.alpha = 1; - - break; - } - } - } - - public onResize(event:UIEvent = null) - { - this.view.y = 0; - this.view.x = 0; - - this.view.width = window.innerWidth; - this.view.height = window.innerHeight; - } - } + this.view.width = window.innerWidth; + this.view.height = window.innerHeight; + } } \ No newline at end of file diff --git a/tests/materials/MaterialEnvMapTest.ts b/tests/materials/MaterialEnvMapTest.ts index 712c0daa3..8d17f4b1e 100644 --- a/tests/materials/MaterialEnvMapTest.ts +++ b/tests/materials/MaterialEnvMapTest.ts @@ -1,110 +1,111 @@ -/// - -module tests.materials +import View = require("awayjs-core/lib/containers/View"); +import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +import AssetLibrary = require("awayjs-core/lib/core/library/AssetLibrary"); +import AssetLoader = require("awayjs-core/lib/core/library/AssetLoader"); +import AssetLoaderToken = require("awayjs-core/lib/core/library/AssetLoaderToken"); +import AssetType = require("awayjs-core/lib/core/library/AssetType"); +import IAsset = require("awayjs-core/lib/core/library/IAsset"); +import URLRequest = require("awayjs-core/lib/core/net/URLRequest"); +import Mesh = require("awayjs-core/lib/entities/Mesh"); +import Skybox = require("awayjs-core/lib/entities/Skybox"); +import AssetEvent = require("awayjs-core/lib/events/AssetEvent"); +import LoaderEvent = require("awayjs-core/lib/events/LoaderEvent"); +import Debug = require("awayjs-core/lib/utils/Debug"); +import RequestAnimationFrame = require("awayjs-core/lib/utils/RequestAnimationFrame"); + +import DefaultRenderer = require("awayjs-stagegl/lib/core/render/DefaultRenderer"); + +import AWDParser = require("awayjs-renderergl/lib/parsers/AWDParser"); + +/** + * + */ +class MaterialEnvMapTest { - import View = away.containers.View; - import Mesh = away.entities.Mesh; - import Skybox = away.entities.Skybox; - import AssetEvent = away.events.AssetEvent; - import LoaderEvent = away.events.LoaderEvent; - import Vector3D = away.geom.Vector3D; - import AssetLibrary = away.library.AssetLibrary; - import AssetLoader = away.library.AssetLoader; - import AssetLoaderToken = away.library.AssetLoaderToken; - import AssetType = away.library.AssetType; - import IAsset = away.library.IAsset; - import URLRequest = away.net.URLRequest; - import AWDParser = away.parsers.AWDParser; - import DefaultRenderer = away.render.DefaultRenderer; - import RequestAnimationFrame = away.utils.RequestAnimationFrame; - - export class MaterialEnvMapTest - { - private _view:View; - private _token:AssetLoaderToken; - private _timer:RequestAnimationFrame; - private _torus:Mesh; - - constructor() - { - away.Debug.LOG_PI_ERRORS = true; - away.Debug.THROW_ERRORS = false; - - AssetLibrary.enableParser(AWDParser) ; - - this._token = AssetLibrary.load(new URLRequest('assets/EnvMapTest.awd')); - this._token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (event:LoaderEvent) => this.onResourceComplete(event)); - this._token.addEventListener(AssetEvent.ASSET_COMPLETE, (event:AssetEvent) => this.onAssetComplete(event)); - - this._view = new View(new DefaultRenderer()); - this._timer = new RequestAnimationFrame(this.render, this); - - window.onresize = () => this.resize(); - - this._timer.start(); - this.resize(); - } - - private resize(event:UIEvent = null) - { - this._view.y = 0; - this._view.x = 0; - this._view.width = window.innerWidth; - this._view.height = window.innerHeight; - } + private _view:View; + private _token:AssetLoaderToken; + private _timer:RequestAnimationFrame; + private _torus:Mesh; - private render(dt:number) //animate based on dt for firefox - { - if (this._torus) - this._torus.rotationY += 1; + constructor() + { + Debug.LOG_PI_ERRORS = true; + Debug.THROW_ERRORS = false; - this._view.render(); - this._view.camera.z = -2000; - } + AssetLibrary.enableParser(AWDParser) ; - public onAssetComplete(event:AssetEvent) - { - console.log('------------------------------------------------------------------------------'); - console.log('away.events.AssetEvent.ASSET_COMPLETE', AssetLibrary.getAsset(event.asset.name)); - console.log('------------------------------------------------------------------------------'); - } + this._token = AssetLibrary.load(new URLRequest('assets/EnvMapTest.awd')); + this._token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (event:LoaderEvent) => this.onResourceComplete(event)); + this._token.addEventListener(AssetEvent.ASSET_COMPLETE, (event:AssetEvent) => this.onAssetComplete(event)); + + this._view = new View(new DefaultRenderer()); + this._timer = new RequestAnimationFrame(this.render, this); + + window.onresize = () => this.resize(); + + this._timer.start(); + this.resize(); + } - public onResourceComplete(event:LoaderEvent) - { + private resize(event:UIEvent = null) + { + this._view.y = 0; + this._view.x = 0; + this._view.width = window.innerWidth; + this._view.height = window.innerHeight; + } - console.log('------------------------------------------------------------------------------'); - console.log('away.events.LoaderEvent.RESOURCE_COMPLETE', event); - console.log('------------------------------------------------------------------------------'); + private render(dt:number) //animate based on dt for firefox + { + if (this._torus) + this._torus.rotationY += 1; - var loader:AssetLoader = event.target; - var numAssets:number = loader.baseDependency.assets.length; + this._view.render(); + this._view.camera.z = -2000; + } - for (var i:number = 0; i < numAssets; ++i) { - var asset:IAsset = loader.baseDependency.assets[i]; + public onAssetComplete(event:AssetEvent) + { + console.log('------------------------------------------------------------------------------'); + console.log('away.events.AssetEvent.ASSET_COMPLETE', AssetLibrary.getAsset(event.asset.name)); + console.log('------------------------------------------------------------------------------'); + } - console.log(asset.assetType); + public onResourceComplete(event:LoaderEvent) + { - switch (asset.assetType) { - case AssetType.SKYBOX: + console.log('------------------------------------------------------------------------------'); + console.log('away.events.LoaderEvent.RESOURCE_COMPLETE', event); + console.log('------------------------------------------------------------------------------'); - var skybox:Skybox = asset; - this._view.scene.addChild(skybox); - break; + var loader:AssetLoader = event.target; + var numAssets:number = loader.baseDependency.assets.length; - case AssetType.MESH: + for (var i:number = 0; i < numAssets; ++i) { + var asset:IAsset = loader.baseDependency.assets[i]; - this._torus = asset; - this._view.scene.addChild(this._torus); + console.log(asset.assetType); - break; + switch (asset.assetType) { + case AssetType.SKYBOX: - case AssetType.GEOMETRY: - break; + var skybox:Skybox = asset; + this._view.scene.addChild(skybox); + break; - case AssetType.MATERIAL: - break; - } - } - } - } + case AssetType.MESH: + + this._torus = asset; + this._view.scene.addChild(this._torus); + + break; + + case AssetType.GEOMETRY: + break; + + case AssetType.MATERIAL: + break; + } + } + } } \ No newline at end of file diff --git a/tests/parsers/AWDParserTest.ts b/tests/parsers/AWDParserTest.ts index 30578b9e5..ce8709728 100644 --- a/tests/parsers/AWDParserTest.ts +++ b/tests/parsers/AWDParserTest.ts @@ -1,103 +1,102 @@ -/// - -module tests.parsers +import View = require("awayjs-core/lib/containers/View"); +import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +import AssetLibrary = require("awayjs-core/lib/core/library/AssetLibrary"); +import AssetLoader = require("awayjs-core/lib/core/library/AssetLoader"); +import AssetLoaderToken = require("awayjs-core/lib/core/library/AssetLoaderToken"); +import AssetType = require("awayjs-core/lib/core/library/AssetType"); +import IAsset = require("awayjs-core/lib/core/library/IAsset"); +import URLRequest = require("awayjs-core/lib/core/net/URLRequest"); +import Mesh = require("awayjs-core/lib/entities/Mesh"); +import AssetEvent = require("awayjs-core/lib/events/AssetEvent"); +import LoaderEvent = require("awayjs-core/lib/events/LoaderEvent"); +import Debug = require("awayjs-core/lib/utils/Debug"); +import RequestAnimationFrame = require("awayjs-core/lib/utils/RequestAnimationFrame"); + +import DefaultRenderer = require("awayjs-stagegl/lib/core/render/DefaultRenderer"); +import TriangleMethodMaterial = require("awayjs-stagegl/lib/materials/TriangleMethodMaterial"); + +import AWDParser = require("awayjs-renderergl/lib/parsers/AWDParser"); + +class AWDParserTest { - import View = away.containers.View; - import Mesh = away.entities.Mesh; - import AssetEvent = away.events.AssetEvent; - import LoaderEvent = away.events.LoaderEvent; - import Vector3D = away.geom.Vector3D; - import AssetLibrary = away.library.AssetLibrary; - import AssetLoader = away.library.AssetLoader; - import AssetLoaderToken = away.library.AssetLoaderToken; - import AssetType = away.library.AssetType; - import IAsset = away.library.IAsset; - import URLRequest = away.net.URLRequest; - import AWDParser = away.parsers.AWDParser; - import DefaultRenderer = away.render.DefaultRenderer; - import RequestAnimationFrame = away.utils.RequestAnimationFrame; - - export class AWDParserTest - { - - private _view:View; - private _token:AssetLoaderToken; - private _timer:RequestAnimationFrame; - private _suzanne:Mesh; - - constructor() - { - away.Debug.LOG_PI_ERRORS = true; - away.Debug.THROW_ERRORS = false; - - AssetLibrary.enableParser(AWDParser) ; - - this._token = AssetLibrary.load(new URLRequest('assets/suzanne.awd')); - this._token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (event:LoaderEvent) => this.onResourceComplete(event)); - this._token.addEventListener(AssetEvent.ASSET_COMPLETE, (event:AssetEvent) => this.onAssetComplete(event)); - - this._view = new View(new DefaultRenderer()); - this._timer = new RequestAnimationFrame(this.render, this); - - window.onresize = (event:UIEvent) => this.resize(event); - - this._timer.start(); - this.resize(); - } - - private resize(event:UIEvent = null) - { - this._view.y = 0; - this._view.x = 0; - this._view.width = window.innerWidth; - this._view.height = window.innerHeight; - } - - private render(dt:number) //animate based on dt for firefox - { - if (this._suzanne) - this._suzanne.rotationY += 1; - - this._view.render(); - this._view.camera.z = -2000; - } - - public onAssetComplete(event:AssetEvent) - { - console.log('------------------------------------------------------------------------------'); - console.log('away.events.AssetEvent.ASSET_COMPLETE', AssetLibrary.getAsset(event.asset.name)); - console.log('------------------------------------------------------------------------------'); - } - - public onResourceComplete(event:LoaderEvent) - { - console.log('------------------------------------------------------------------------------'); - console.log('away.events.LoaderEvent.RESOURCE_COMPLETE' , event); - console.log('------------------------------------------------------------------------------'); - - var loader:AssetLoader = event.target; - var numAssets:number = loader.baseDependency.assets.length; - - for(var i:number = 0; i < numAssets; ++i) { - var asset:IAsset = loader.baseDependency.assets[i]; - - switch (asset.assetType) { - case AssetType.MESH: - - this._suzanne = asset; - this._suzanne.transform.scale = new Vector3D(600, 600, 600); - - this._view.scene.addChild(this._suzanne); - - break; - - case AssetType.GEOMETRY: - break; - - case AssetType.MATERIAL: - break; - } - } - } - } + + private _view:View; + private _token:AssetLoaderToken; + private _timer:RequestAnimationFrame; + private _suzanne:Mesh; + + constructor() + { + Debug.LOG_PI_ERRORS = true; + Debug.THROW_ERRORS = false; + + AssetLibrary.enableParser(AWDParser) ; + + this._token = AssetLibrary.load(new URLRequest('assets/suzanne.awd')); + this._token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (event:LoaderEvent) => this.onResourceComplete(event)); + this._token.addEventListener(AssetEvent.ASSET_COMPLETE, (event:AssetEvent) => this.onAssetComplete(event)); + + this._view = new View(new DefaultRenderer()); + this._timer = new RequestAnimationFrame(this.render, this); + + window.onresize = (event:UIEvent) => this.resize(event); + + this._timer.start(); + this.resize(); + } + + private resize(event:UIEvent = null) + { + this._view.y = 0; + this._view.x = 0; + this._view.width = window.innerWidth; + this._view.height = window.innerHeight; + } + + private render(dt:number) //animate based on dt for firefox + { + if (this._suzanne) + this._suzanne.rotationY += 1; + + this._view.render(); + this._view.camera.z = -2000; + } + + public onAssetComplete(event:AssetEvent) + { + console.log('------------------------------------------------------------------------------'); + console.log('events.AssetEvent.ASSET_COMPLETE', AssetLibrary.getAsset(event.asset.name)); + console.log('------------------------------------------------------------------------------'); + } + + public onResourceComplete(event:LoaderEvent) + { + console.log('------------------------------------------------------------------------------'); + console.log('events.LoaderEvent.RESOURCE_COMPLETE' , event); + console.log('------------------------------------------------------------------------------'); + + var loader:AssetLoader = event.target; + var numAssets:number = loader.baseDependency.assets.length; + + for(var i:number = 0; i < numAssets; ++i) { + var asset:IAsset = loader.baseDependency.assets[i]; + + switch (asset.assetType) { + case AssetType.MESH: + + this._suzanne = asset; + this._suzanne.transform.scale = new Vector3D(600, 600, 600); + + this._view.scene.addChild(this._suzanne); + + break; + + case AssetType.GEOMETRY: + break; + + case AssetType.MATERIAL: + break; + } + } + } } \ No newline at end of file diff --git a/tests/parsers/AWDSuzanne.ts b/tests/parsers/AWDSuzanne.ts index f1447ac49..838aa3a8c 100644 --- a/tests/parsers/AWDSuzanne.ts +++ b/tests/parsers/AWDSuzanne.ts @@ -1,151 +1,149 @@ -/// - -module tests.parsers +import View = require("awayjs-core/lib/containers/View"); +import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +import AssetLibrary = require("awayjs-core/lib/core/library/AssetLibrary"); +import AssetLoader = require("awayjs-core/lib/core/library/AssetLoader"); +import AssetLoaderToken = require("awayjs-core/lib/core/library/AssetLoaderToken"); +import AssetType = require("awayjs-core/lib/core/library/AssetType"); +import IAsset = require("awayjs-core/lib/core/library/IAsset"); +import URLRequest = require("awayjs-core/lib/core/net/URLRequest"); +import DirectionalLight = require("awayjs-core/lib/entities/DirectionalLight"); +import Mesh = require("awayjs-core/lib/entities/Mesh"); +import AssetEvent = require("awayjs-core/lib/events/AssetEvent"); +import LoaderEvent = require("awayjs-core/lib/events/LoaderEvent"); +import StaticLightPicker = require("awayjs-core/lib/materials/lightpickers/StaticLightPicker"); +import Debug = require("awayjs-core/lib/utils/Debug"); +import RequestAnimationFrame = require("awayjs-core/lib/utils/RequestAnimationFrame"); + +import DefaultRenderer = require("awayjs-stagegl/lib/core/render/DefaultRenderer"); +import TriangleMethodMaterial = require("awayjs-stagegl/lib/materials/TriangleMethodMaterial"); + +import AWDParser = require("awayjs-renderergl/lib/parsers/AWDParser"); + +class AWDSuzanne { - import View = away.containers.View; - import Mesh = away.entities.Mesh; - import AssetEvent = away.events.AssetEvent; - import LoaderEvent = away.events.LoaderEvent; - import Vector3D = away.geom.Vector3D; - import AssetLibrary = away.library.AssetLibrary; - import AssetLoader = away.library.AssetLoader; - import AssetLoaderToken = away.library.AssetLoaderToken; - import AssetType = away.library.AssetType; - import IAsset = away.library.IAsset; - import DirectionalLight = away.entities.DirectionalLight; - import TriangleMethodMaterial = away.materials.TriangleMethodMaterial; - import StaticLightPicker = away.materials.StaticLightPicker; - import URLRequest = away.net.URLRequest; - import AWDParser = away.parsers.AWDParser; - import DefaultRenderer = away.render.DefaultRenderer; - import RequestAnimationFrame = away.utils.RequestAnimationFrame; - - export class AWDSuzanne - { - private _view:View; - private _token:AssetLoaderToken; - private _timer:RequestAnimationFrame; - private _suzanne:Mesh; - private _light:DirectionalLight; - private _lightPicker:StaticLightPicker; - private lookAtPosition:Vector3D = new Vector3D(); - private _cameraIncrement:number = 0; - - constructor() - { - away.Debug.LOG_PI_ERRORS = true; - away.Debug.THROW_ERRORS = false; - - AssetLibrary.enableParser(AWDParser) ; - - this._token = AssetLibrary.load(new URLRequest('assets/suzanne.awd')); - this._token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (event:LoaderEvent) => this.onResourceComplete(event)); - this._token.addEventListener(AssetEvent.ASSET_COMPLETE, (event:AssetEvent) => this.onAssetComplete(event)); - - this._view = new View(new DefaultRenderer()); - this._view.camera.projection.far = 6000; - this._timer = new RequestAnimationFrame(this.render, this); - - this._light = new DirectionalLight(); - this._light.color = 0x683019;//683019; - this._light.direction = new Vector3D( 1 , 0 ,0 ); - this._light.ambient = 0.1;//0.05;//.4; - this._light.ambientColor = 0x85b2cd;//4F6877;//313D51; - this._light.diffuse = 2.8; - this._light.specular = 1.8; - this._view.scene.addChild(this._light); - - this._lightPicker = new StaticLightPicker([this._light]); - - window.onresize = (event:UIEvent) => this.resize(event); - - this._timer.start(); - this.resize(); - } - - private resize(event:UIEvent = null) - { - this._view.y = 0; - this._view.x = 0; - this._view.width = window.innerWidth; - this._view.height = window.innerHeight; + private _view:View; + private _token:AssetLoaderToken; + private _timer:RequestAnimationFrame; + private _suzanne:Mesh; + private _light:DirectionalLight; + private _lightPicker:StaticLightPicker; + private lookAtPosition:Vector3D = new Vector3D(); + private _cameraIncrement:number = 0; + + constructor() + { + Debug.LOG_PI_ERRORS = true; + Debug.THROW_ERRORS = false; + + AssetLibrary.enableParser(AWDParser) ; + + this._token = AssetLibrary.load(new URLRequest('assets/suzanne.awd')); + this._token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (event:LoaderEvent) => this.onResourceComplete(event)); + this._token.addEventListener(AssetEvent.ASSET_COMPLETE, (event:AssetEvent) => this.onAssetComplete(event)); + + this._view = new View(new DefaultRenderer()); + this._view.camera.projection.far = 6000; + this._timer = new RequestAnimationFrame(this.render, this); + + this._light = new DirectionalLight(); + this._light.color = 0x683019;//683019; + this._light.direction = new Vector3D( 1 , 0 ,0 ); + this._light.ambient = 0.1;//0.05;//.4; + this._light.ambientColor = 0x85b2cd;//4F6877;//313D51; + this._light.diffuse = 2.8; + this._light.specular = 1.8; + this._view.scene.addChild(this._light); + + this._lightPicker = new StaticLightPicker([this._light]); + + window.onresize = (event:UIEvent) => this.resize(event); + + this._timer.start(); + this.resize(); + } + + private resize(event:UIEvent = null) + { + this._view.y = 0; + this._view.x = 0; + this._view.width = window.innerWidth; + this._view.height = window.innerHeight; + } + + private render(dt:number) //animate based on dt for firefox + { + if (this._view.camera) { + this._view.camera.lookAt(this.lookAtPosition) ; + this._cameraIncrement += 0.01; + this._view.camera.x = Math.cos(this._cameraIncrement)*1400; + this._view.camera.z = Math.sin(this._cameraIncrement)*1400; + + this._light.x = Math.cos(this._cameraIncrement)*1400; + this._light.y = Math.sin(this._cameraIncrement)*1400; } - private render(dt:number) //animate based on dt for firefox - { - if (this._view.camera) { - this._view.camera.lookAt(this.lookAtPosition) ; - this._cameraIncrement += 0.01; - this._view.camera.x = Math.cos(this._cameraIncrement)*1400; - this._view.camera.z = Math.sin(this._cameraIncrement)*1400; - - this._light.x = Math.cos(this._cameraIncrement)*1400; - this._light.y = Math.sin(this._cameraIncrement)*1400; - } - - this._view.render(); - } - - public onAssetComplete(event:AssetEvent) - { - console.log('------------------------------------------------------------------------------'); - console.log('away.events.AssetEvent.ASSET_COMPLETE', AssetLibrary.getAsset(event.asset.name)); - console.log('------------------------------------------------------------------------------'); - } + this._view.render(); + } - public onResourceComplete(event:LoaderEvent) - { - console.log('------------------------------------------------------------------------------'); - console.log('away.events.LoaderEvent.RESOURCE_COMPLETE' , event); - console.log('------------------------------------------------------------------------------'); + public onAssetComplete(event:AssetEvent) + { + console.log('------------------------------------------------------------------------------'); + console.log('away.events.AssetEvent.ASSET_COMPLETE', AssetLibrary.getAsset(event.asset.name)); + console.log('------------------------------------------------------------------------------'); + } - var loader:AssetLoader = event.target; - var numAssets:number = loader.baseDependency.assets.length; + public onResourceComplete(event:LoaderEvent) + { + console.log('------------------------------------------------------------------------------'); + console.log('away.events.LoaderEvent.RESOURCE_COMPLETE' , event); + console.log('------------------------------------------------------------------------------'); - for(var i:number = 0; i < numAssets; ++i) { - var asset:IAsset = loader.baseDependency.assets[i]; + var loader:AssetLoader = event.target; + var numAssets:number = loader.baseDependency.assets.length; - switch (asset.assetType) { - case AssetType.MESH: + for(var i:number = 0; i < numAssets; ++i) { + var asset:IAsset = loader.baseDependency.assets[i]; - this._suzanne = asset; + switch (asset.assetType) { + case AssetType.MESH: - ( this._suzanne.material).lightPicker = this._lightPicker; - this._suzanne.y = -100; + this._suzanne = asset; + ( this._suzanne.material).lightPicker = this._lightPicker; + this._suzanne.y = -100; - for ( var c : number = 0 ; c < 80 ; c ++ ) - { - var scale:number = this.getRandom( 50 , 200 ); - var clone:Mesh = this._suzanne.clone(); - clone.x = this.getRandom(-2000 , 2000); - clone.y = this.getRandom(-2000 , 2000); - clone.z = this.getRandom(-2000 , 2000); - clone.transform.scale = new Vector3D(scale, scale, scale); - clone.rotationY = this.getRandom(0 , 360); - this._view.scene.addChild( clone ); - } + for ( var c : number = 0 ; c < 80 ; c ++ ) + { + var scale:number = this.getRandom( 50 , 200 ); + var clone:Mesh = this._suzanne.clone(); + clone.x = this.getRandom(-2000 , 2000); + clone.y = this.getRandom(-2000 , 2000); + clone.z = this.getRandom(-2000 , 2000); + clone.transform.scale = new Vector3D(scale, scale, scale); + clone.rotationY = this.getRandom(0 , 360); + this._view.scene.addChild( clone ); - this._suzanne.transform.scale = new Vector3D(500, 500, 500); + } - this._view.scene.addChild(this._suzanne); + this._suzanne.transform.scale = new Vector3D(500, 500, 500); - break; + this._view.scene.addChild(this._suzanne); - case AssetType.GEOMETRY: - break; + break; - case AssetType.MATERIAL: + case AssetType.GEOMETRY: + break; - break; - } - } - } + case AssetType.MATERIAL: + + break; + } + } + } - private getRandom(min:number, max:number):number - { - return Math.random()*(max - min) + min; - } - } + private getRandom(min:number, max:number):number + { + return Math.random()*(max - min) + min; + } } \ No newline at end of file diff --git a/tests/parsers/ObjChiefTestDay.ts b/tests/parsers/ObjChiefTestDay.ts index 44a009d4f..10b34b898 100644 --- a/tests/parsers/ObjChiefTestDay.ts +++ b/tests/parsers/ObjChiefTestDay.ts @@ -1,166 +1,166 @@ -/// - -module tests.parsers +import DisplayObjectContainer = require("awayjs-core/lib/containers/DisplayObjectContainer"); +import View = require("awayjs-core/lib/containers/View"); +import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +import AssetLibrary = require("awayjs-core/lib/core/library/AssetLibrary"); +import AssetLoader = require("awayjs-core/lib/core/library/AssetLoader"); +import AssetLoaderToken = require("awayjs-core/lib/core/library/AssetLoaderToken"); +import AssetType = require("awayjs-core/lib/core/library/AssetType"); +import IAsset = require("awayjs-core/lib/core/library/IAsset"); +import URLRequest = require("awayjs-core/lib/core/net/URLRequest"); +import DirectionalLight = require("awayjs-core/lib/entities/DirectionalLight"); +import Mesh = require("awayjs-core/lib/entities/Mesh"); +import LoaderEvent = require("awayjs-core/lib/events/LoaderEvent"); +import StaticLightPicker = require("awayjs-core/lib/materials/lightpickers/StaticLightPicker"); +import ImageTexture = require("awayjs-core/lib/textures/ImageTexture"); +import Debug = require("awayjs-core/lib/utils/Debug"); +import RequestAnimationFrame = require("awayjs-core/lib/utils/RequestAnimationFrame"); + +import DefaultRenderer = require("awayjs-stagegl/lib/core/render/DefaultRenderer"); +import TriangleMethodMaterial = require("awayjs-stagegl/lib/materials/TriangleMethodMaterial"); + +import OBJParser = require("awayjs-renderergl/lib/parsers/OBJParser"); + +/** + * + */ +class ObjChiefTestDay { - import DisplayObjectContainer = away.containers.DisplayObjectContainer; - import Scene = away.containers.Scene; - import View = away.containers.View; - import Mesh = away.entities.Mesh; - import LoaderEvent = away.events.LoaderEvent; - import Vector3D = away.geom.Vector3D; - import AssetLibrary = away.library.AssetLibrary; - import AssetLoader = away.library.AssetLoader; - import AssetLoaderToken = away.library.AssetLoaderToken; - import AssetType = away.library.AssetType; - import IAsset = away.library.IAsset; - import DirectionalLight = away.entities.DirectionalLight; - import TriangleMethodMaterial = away.materials.TriangleMethodMaterial; - import StaticLightPicker = away.materials.StaticLightPicker; - import URLRequest = away.net.URLRequest; - import OBJParser = away.parsers.OBJParser; - import DefaultRenderer = away.render.DefaultRenderer; - import ImageTexture = away.textures.ImageTexture; - import RequestAnimationFrame = away.utils.RequestAnimationFrame; - - export class ObjChiefTestDay - { - private token:AssetLoaderToken; - private view:View; - private raf:RequestAnimationFrame; - private meshes:Array = new Array(); - private mat:TriangleMethodMaterial; - - private terrainMaterial:TriangleMethodMaterial; - - private light:DirectionalLight; - - private spartan:DisplayObjectContainer = new DisplayObjectContainer(); - private terrain:Mesh; - - private spartanFlag:boolean = false; - private terrainObjFlag:boolean = false; - - constructor() - { - away.Debug.LOG_PI_ERRORS = false; - away.Debug.THROW_ERRORS = false; - - this.view = new View(new DefaultRenderer()); - this.view.camera.z = -50; - this.view.camera.y = 20; - this.view.camera.projection.near = 0.1; - this.view.backgroundColor = 0xCEC8C6; - - this.raf = new RequestAnimationFrame(this.render, this); - - this.light = new DirectionalLight(); - this.light.color = 0xc1582d; - this.light.direction = new Vector3D(1, 0, 0); - this.light.ambient = 0.4; - this.light.ambientColor = 0x85b2cd; - this.light.diffuse = 2.8; - this.light.specular = 1.8; - - this.spartan.transform.scale = new Vector3D(.25, .25, .25); - this.spartan.y = 0; - - this.view.scene.addChild(this.light); - - AssetLibrary.enableParser(OBJParser); - - this.token = AssetLibrary.load(new away.net.URLRequest('assets/Halo_3_SPARTAN4.obj')); - this.token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (event:LoaderEvent) => this.onResourceComplete(event)); - - this.token = AssetLibrary.load(new URLRequest('assets/terrain.obj')); - this.token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (event:LoaderEvent) => this.onResourceComplete(event)); - - this.token = AssetLibrary.load(new URLRequest('assets/masterchief_base.png')); - this.token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (event:LoaderEvent) => this.onResourceComplete(event)); - - this.token = AssetLibrary.load(new away.net.URLRequest('assets/stone_tx.jpg')); - this.token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (event:LoaderEvent) => this.onResourceComplete(event)); - - window.onresize = (event:UIEvent) => this.onResize(); - - this.raf.start(); + private token:AssetLoaderToken; + private view:View; + private raf:RequestAnimationFrame; + private meshes:Array = new Array(); + private mat:TriangleMethodMaterial; + + private terrainMaterial:TriangleMethodMaterial; + + private light:DirectionalLight; + + private spartan:DisplayObjectContainer = new DisplayObjectContainer(); + private terrain:Mesh; + + private spartanFlag:boolean = false; + private terrainObjFlag:boolean = false; + + constructor() + { + Debug.LOG_PI_ERRORS = false; + Debug.THROW_ERRORS = false; + + this.view = new View(new DefaultRenderer()); + this.view.camera.z = -50; + this.view.camera.y = 20; + this.view.camera.projection.near = 0.1; + this.view.backgroundColor = 0xCEC8C6; + + this.raf = new RequestAnimationFrame(this.render, this); + + this.light = new DirectionalLight(); + this.light.color = 0xc1582d; + this.light.direction = new Vector3D(1, 0, 0); + this.light.ambient = 0.4; + this.light.ambientColor = 0x85b2cd; + this.light.diffuse = 2.8; + this.light.specular = 1.8; + + this.spartan.transform.scale = new Vector3D(.25, .25, .25); + this.spartan.y = 0; + + this.view.scene.addChild(this.light); + + AssetLibrary.enableParser(OBJParser); + + this.token = AssetLibrary.load(new URLRequest('assets/Halo_3_SPARTAN4.obj')); + this.token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (event:LoaderEvent) => this.onResourceComplete(event)); + + this.token = AssetLibrary.load(new URLRequest('assets/terrain.obj')); + this.token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (event:LoaderEvent) => this.onResourceComplete(event)); + + this.token = AssetLibrary.load(new URLRequest('assets/masterchief_base.png')); + this.token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (event:LoaderEvent) => this.onResourceComplete(event)); + + this.token = AssetLibrary.load(new URLRequest('assets/stone_tx.jpg')); + this.token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (event:LoaderEvent) => this.onResourceComplete(event)); + + window.onresize = (event:UIEvent) => this.onResize(); + + this.raf.start(); + } + + private render() + { + if ( this.terrain) + this.terrain.rotationY += 0.4; + + this.spartan.rotationY += 0.4; + this.view.render(); + } + + public onResourceComplete (event:LoaderEvent) + { + var loader:AssetLoader = event.target; + var l:number = loader.baseDependency.assets.length; + + console.log('------------------------------------------------------------------------------'); + console.log('events.LoaderEvent.RESOURCE_COMPLETE', event, l, loader); + console.log('------------------------------------------------------------------------------'); + + var loader:AssetLoader = event.target; + var l:number = loader.baseDependency.assets.length; + + for (var c:number = 0; c < l; c++) { + + var d:IAsset = loader.baseDependency.assets[c]; + + console.log( d.name , event.url); + + switch (d.assetType) { + case AssetType.MESH: + if (event.url =='assets/Halo_3_SPARTAN4.obj') { + var mesh:Mesh = d; + + this.spartan.addChild(mesh); + this.spartanFlag = true; + this.meshes.push(mesh); + } else if (event.url =='assets/terrain.obj') { + this.terrainObjFlag = true; + this.terrain = d; + this.terrain.y = 98; + this.view.scene.addChild(this.terrain); + } + + break; + case AssetType.TEXTURE : + if (event.url == 'assets/masterchief_base.png' ) { + this.mat = new TriangleMethodMaterial( d, true, true, false ); + this.mat.lightPicker = new StaticLightPicker([this.light]); + } else if (event.url == 'assets/stone_tx.jpg') { + this.terrainMaterial = new TriangleMethodMaterial( d, true, true, false); + this.terrainMaterial.lightPicker = new StaticLightPicker([this.light]); + } + + break; + } + } + + if (this.terrainObjFlag && this.terrainMaterial) { + this.terrain.material = this.terrainMaterial; + this.terrain.geometry.scaleUV(20, 20); } - private render() - { - if ( this.terrain) - this.terrain.rotationY += 0.4; - - this.spartan.rotationY += 0.4; - this.view.render(); - } - - public onResourceComplete (event:LoaderEvent) - { - var loader:AssetLoader = event.target; - var l:number = loader.baseDependency.assets.length; - - console.log('------------------------------------------------------------------------------'); - console.log('away.events.LoaderEvent.RESOURCE_COMPLETE', event, l, loader); - console.log('------------------------------------------------------------------------------'); - - var loader:AssetLoader = event.target; - var l:number = loader.baseDependency.assets.length; - - for (var c:number = 0; c < l; c++) { - - var d:IAsset = loader.baseDependency.assets[c]; - - console.log( d.name , event.url); - - switch (d.assetType) { - case AssetType.MESH: - if (event.url =='assets/Halo_3_SPARTAN4.obj') { - var mesh:Mesh = d; - - this.spartan.addChild(mesh); - this.spartanFlag = true; - this.meshes.push(mesh); - } else if (event.url =='assets/terrain.obj') { - this.terrainObjFlag = true; - this.terrain = d; - this.terrain.y = 98; - this.view.scene.addChild(this.terrain); - } - - break; - case AssetType.TEXTURE : - if (event.url == 'assets/masterchief_base.png' ) { - this.mat = new TriangleMethodMaterial( d, true, true, false ); - this.mat.lightPicker = new StaticLightPicker([this.light]); - } else if (event.url == 'assets/stone_tx.jpg') { - this.terrainMaterial = new TriangleMethodMaterial( d, true, true, false); - this.terrainMaterial.lightPicker = new StaticLightPicker([this.light]); - } - - break; - } - } - - if (this.terrainObjFlag && this.terrainMaterial) { - this.terrain.material = this.terrainMaterial; - this.terrain.geometry.scaleUV(20, 20); - } - - if (this.mat && this.spartanFlag) - for (var c:number = 0; c < this.meshes.length; c++) - this.meshes[c].material = this.mat; - - this.view.scene.addChild(this.spartan); - this.onResize(); - } - - public onResize(event:UIEvent = null) - { - this.view.y = 0; - this.view.x = 0; - - this.view.width = window.innerWidth; - this.view.height = window.innerHeight; - } - } -} + if (this.mat && this.spartanFlag) + for (var c:number = 0; c < this.meshes.length; c++) + this.meshes[c].material = this.mat; + + this.view.scene.addChild(this.spartan); + this.onResize(); + } + + public onResize(event:UIEvent = null) + { + this.view.y = 0; + this.view.x = 0; + + this.view.width = window.innerWidth; + this.view.height = window.innerHeight; + } +} \ No newline at end of file diff --git a/tests/parsers/ObjParserTest.ts b/tests/parsers/ObjParserTest.ts index bf57dac0b..f906e525b 100644 --- a/tests/parsers/ObjParserTest.ts +++ b/tests/parsers/ObjParserTest.ts @@ -1,85 +1,84 @@ -/// - -module tests.parsers +import View = require("awayjs-core/lib/containers/View"); +import Vector3D = require("awayjs-core/lib/core/geom/Vector3D"); +import AssetLibrary = require("awayjs-core/lib/core/library/AssetLibrary"); +import AssetLoader = require("awayjs-core/lib/core/library/AssetLoader"); +import AssetLoaderToken = require("awayjs-core/lib/core/library/AssetLoaderToken"); +import URLRequest = require("awayjs-core/lib/core/net/URLRequest"); +import Mesh = require("awayjs-core/lib/entities/Mesh"); +import AssetEvent = require("awayjs-core/lib/events/AssetEvent"); +import LoaderEvent = require("awayjs-core/lib/events/LoaderEvent"); +import Debug = require("awayjs-core/lib/utils/Debug"); +import RequestAnimationFrame = require("awayjs-core/lib/utils/RequestAnimationFrame"); + +import DefaultRenderer = require("awayjs-stagegl/lib/core/render/DefaultRenderer"); + +import OBJParser = require("awayjs-renderergl/lib/parsers/OBJParser"); + +/** + * + */ +class ObjParserTest { - import View = away.containers.View; - import Mesh = away.entities.Mesh; - import AssetEvent = away.events.AssetEvent; - import LoaderEvent = away.events.LoaderEvent; - import Vector3D = away.geom.Vector3D; - import AssetLibrary = away.library.AssetLibrary; - import AssetLoader = away.library.AssetLoader; - import AssetLoaderToken = away.library.AssetLoaderToken; - import AssetType = away.library.AssetType; - import IAsset = away.library.IAsset; - import URLRequest = away.net.URLRequest; - import OBJParser = away.parsers.OBJParser; - import DefaultRenderer = away.render.DefaultRenderer; - import RequestAnimationFrame = away.utils.RequestAnimationFrame; - - export class ObjParserTest - { - private _view:View; - private _token:AssetLoaderToken; - private _timer:RequestAnimationFrame; - private _t800:Mesh; - - constructor() - { - away.Debug.LOG_PI_ERRORS = true; - away.Debug.THROW_ERRORS = false; - - AssetLibrary.enableParser(OBJParser) ; - - this._token = AssetLibrary.load(new URLRequest('assets/t800.obj')); - this._token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (event:LoaderEvent) => this.onResourceComplete(event)); - this._token.addEventListener(AssetEvent.ASSET_COMPLETE, (event:AssetEvent) => this.onAssetComplete(event)); - - this._view = new View(new DefaultRenderer()); - this._timer = new RequestAnimationFrame(this.render, this); - - window.onresize = (event:UIEvent) => this.resize(event); - - this._timer.start(); - this.resize(); - } - - private resize(event:UIEvent = null) - { - this._view.y = 0; - this._view.x = 0; - this._view.width = window.innerWidth; - this._view.height = window.innerHeight; - } - - private render(dt:number) //animate based on dt for firefox - { - if (this._t800) - this._t800.rotationY += 1; - - this._view.render(); - } - - public onAssetComplete(event:AssetEvent) - { - console.log('------------------------------------------------------------------------------'); - console.log('away.events.AssetEvent.ASSET_COMPLETE', AssetLibrary.getAsset(event.asset.name)); - console.log('------------------------------------------------------------------------------'); - } - - public onResourceComplete(event:LoaderEvent) - { - console.log('------------------------------------------------------------------------------'); - console.log('away.events.LoaderEvent.RESOURCE_COMPLETE', event); - console.log('------------------------------------------------------------------------------'); - - console.log(AssetLibrary.getAsset('Mesh_g0')); - - this._t800 = AssetLibrary.getAsset('Mesh_g0'); - this._t800.y = -200; - this._t800.transform.scale = new Vector3D(4, 4, 4); - - this._view.scene.addChild(this._t800); - } - } -} + private _view:View; + private _token:AssetLoaderToken; + private _timer:RequestAnimationFrame; + private _t800:Mesh; + + constructor() + { + Debug.LOG_PI_ERRORS = true; + Debug.THROW_ERRORS = false; + + AssetLibrary.enableParser(OBJParser) ; + + this._token = AssetLibrary.load(new URLRequest('assets/t800.obj')); + this._token.addEventListener(LoaderEvent.RESOURCE_COMPLETE, (event:LoaderEvent) => this.onResourceComplete(event)); + this._token.addEventListener(AssetEvent.ASSET_COMPLETE, (event:AssetEvent) => this.onAssetComplete(event)); + + this._view = new View(new DefaultRenderer()); + this._timer = new RequestAnimationFrame(this.render, this); + + window.onresize = (event:UIEvent) => this.resize(event); + + this._timer.start(); + this.resize(); + } + + private resize(event:UIEvent = null) + { + this._view.y = 0; + this._view.x = 0; + this._view.width = window.innerWidth; + this._view.height = window.innerHeight; + } + + private render(dt:number) //animate based on dt for firefox + { + if (this._t800) + this._t800.rotationY += 1; + + this._view.render(); + } + + public onAssetComplete(event:AssetEvent) + { + console.log('------------------------------------------------------------------------------'); + console.log('events.AssetEvent.ASSET_COMPLETE', AssetLibrary.getAsset(event.asset.name)); + console.log('------------------------------------------------------------------------------'); + } + + public onResourceComplete(event:LoaderEvent) + { + console.log('------------------------------------------------------------------------------'); + console.log('events.LoaderEvent.RESOURCE_COMPLETE', event); + console.log('------------------------------------------------------------------------------'); + + console.log(AssetLibrary.getAsset('Mesh_g0')); + + this._t800 = AssetLibrary.getAsset('Mesh_g0'); + this._t800.y = -200; + this._t800.transform.scale = new Vector3D(4, 4, 4); + + this._view.scene.addChild(this._t800); + } +} \ No newline at end of file