language
stringclasses
1 value
owner
stringlengths
2
15
repo
stringlengths
2
21
sha
stringlengths
45
45
message
stringlengths
7
36.3k
path
stringlengths
1
199
patch
stringlengths
15
102k
is_multipart
bool
2 classes
Other
mrdoob
three.js
56f15221ffe9b24f7ecd4cf458bd1432e79b883e.json
Render shadows double-sided A clipped mesh is typically not a closed mesh.
examples/webgl_clipping.html
@@ -106,6 +106,7 @@ renderer = new THREE.WebGLRenderer(); renderer.shadowMap.enabled = true; + renderer.shadowMap.renderSingleSided = false; renderer.setPixelRatio( window.devicePixelRatio ); renderer.setSize( window.innerWidth, window.innerHeight ); window.addEventListener( 'resize', onWindowResize, false );
false
Other
mrdoob
three.js
90e6001a0be1154ac0b76b33c4b3898b6096c2cf.json
Add map/alphaMap support to distanceRGBA shader
examples/webgl_shadowmap_pointlight.html
@@ -51,23 +51,22 @@ scene = new THREE.Scene(); scene.add( new THREE.AmbientLight( 0x222233 ) ); - // Lights + // lights function createLight( color ) { var pointLight = new THREE.PointLight( color, 1, 30 ); pointLight.castShadow = true; pointLight.shadow.camera.near = 1; pointLight.shadow.camera.far = 30; - // pointLight.shadowCameraVisible = true; pointLight.shadow.bias = 0.01; var geometry = new THREE.SphereGeometry( 0.3, 12, 6 ); var material = new THREE.MeshBasicMaterial( { color: color } ); var sphere = new THREE.Mesh( geometry, material ); pointLight.add( sphere ); - return pointLight + return pointLight; } @@ -77,25 +76,62 @@ pointLight2 = createLight( 0xff0000 ); scene.add( pointLight2 ); + // + var geometry = new THREE.TorusKnotGeometry( 14, 1, 150, 20 ); + + var texture = new THREE.CanvasTexture( generateTexture() ); + texture.wrapS = texture.wrapT = THREE.RepeatWrapping; + texture.repeat.set( 32, 1 ); + var material = new THREE.MeshPhongMaterial( { color: 0xff0000, shininess: 100, - specular: 0x222222 + specular: 0x222222, + alphaMap: texture, // alphaMap uses the g channel + alphaTest: 0.5, + transparent: true, + side: THREE.DoubleSide } ); + torusKnot = new THREE.Mesh( geometry, material ); torusKnot.position.set( 0, 5, 0 ); torusKnot.castShadow = true; - torusKnot.receiveShadow = true; scene.add( torusKnot ); + // custom distance material + + var shader = THREE.ShaderLib[ "distanceRGBA" ]; + + var uniforms = THREE.UniformsUtils.clone( shader.uniforms ); + uniforms.alphaMap.value = material.alphaMap; + uniforms.offsetRepeat.value.set( texture.offset.x, texture.offset.y, texture.repeat.x, texture.repeat.y ); + + var distanceMaterial = new THREE.ShaderMaterial( { + defines: { + 'USE_SHADOWMAP': '', + 'USE_ALPHAMAP': '', + 'ALPHATEST': material.alphaTest + }, + uniforms: uniforms, + vertexShader: shader.vertexShader, + fragmentShader: shader.fragmentShader, + side: THREE.DoubleSide + } ); + + torusKnot.customDistanceMaterial = distanceMaterial; + + // + var geometry = new THREE.BoxGeometry( 30, 30, 30 ); + var material = new THREE.MeshPhongMaterial( { color: 0xa0adaf, shininess: 10, specular: 0x111111, side: THREE.BackSide } ); + var mesh = new THREE.Mesh( geometry, material ); mesh.position.y = 10; mesh.receiveShadow = true; @@ -108,6 +144,7 @@ renderer.setSize( window.innerWidth, window.innerHeight ); renderer.shadowMap.enabled = true; renderer.shadowMap.type = THREE.BasicShadowMap; + renderer.shadowMap.renderSingleSided = false; // must be set to false to honor double-sided materials document.body.appendChild( renderer.domElement ); var controls = new THREE.OrbitControls( camera, renderer.domElement ); @@ -132,6 +169,38 @@ } + function generateTexture() { + + var canvas = document.createElement( 'canvas' ); + canvas.width = 256; + canvas.height = 256; + + var context = canvas.getContext( '2d' ); + var image = context.getImageData( 0, 0, 256, 256 ); + + var x = 0, y = 0, cvalue; + + for ( var i = 0, j = 0, l = image.data.length; i < l; i += 4, j ++ ) { + + x = j % 256; // pixel col + y = ( x == 0 ) ? y + 1 : y; // pixel row + + // diagonal stripes + cvalue = Math.floor( ( x + y ) / 32 ) % 2; + + image.data[ i + 0 ] = 255 * cvalue; + image.data[ i + 1 ] = 255 * cvalue; + image.data[ i + 2 ] = 255 * cvalue; + image.data[ i + 3 ] = 255; + + } + + context.putImageData( image, 0, 0 ); + + return canvas; + + } + function animate() { requestAnimationFrame( animate );
true
Other
mrdoob
three.js
90e6001a0be1154ac0b76b33c4b3898b6096c2cf.json
Add map/alphaMap support to distanceRGBA shader
src/renderers/shaders/ShaderLib.js
@@ -190,9 +190,12 @@ var ShaderLib = { distanceRGBA: { - uniforms: { - lightPos: { value: new Vector3() } - }, + uniforms: UniformsUtils.merge( [ + UniformsLib.common, + { + lightPos: { value: new Vector3() } + } + ] ), vertexShader: ShaderChunk.distanceRGBA_vert, fragmentShader: ShaderChunk.distanceRGBA_frag
true
Other
mrdoob
three.js
90e6001a0be1154ac0b76b33c4b3898b6096c2cf.json
Add map/alphaMap support to distanceRGBA shader
src/renderers/shaders/ShaderLib/distanceRGBA_frag.glsl
@@ -3,12 +3,21 @@ varying vec4 vWorldPosition; #include <common> #include <packing> +#include <uv_pars_fragment> +#include <map_pars_fragment> +#include <alphamap_pars_fragment> #include <clipping_planes_pars_fragment> void main () { #include <clipping_planes_fragment> + vec4 diffuseColor = vec4( 1.0 ); + + #include <map_fragment> + #include <alphamap_fragment> + #include <alphatest_fragment> + gl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 ); }
true
Other
mrdoob
three.js
90e6001a0be1154ac0b76b33c4b3898b6096c2cf.json
Add map/alphaMap support to distanceRGBA shader
src/renderers/shaders/ShaderLib/distanceRGBA_vert.glsl
@@ -1,12 +1,15 @@ varying vec4 vWorldPosition; #include <common> +#include <uv_pars_vertex> #include <morphtarget_pars_vertex> #include <skinning_pars_vertex> #include <clipping_planes_pars_vertex> void main() { + #include <uv_vertex> + #include <skinbase_vertex> #include <begin_vertex> #include <morphtarget_vertex>
true
Other
mrdoob
three.js
09d75ad29ad2461f0bbc3d99993a93ed7733ab8f.json
Add comment for AnimationCurve-less node
examples/js/loaders/FBXLoader.js
@@ -2154,6 +2154,41 @@ if ( curveNode.attr === 'R' ) { var curves = curveNode.curves; + + // Seems like some FBX files have AnimationCurveNode + // which doesn't have any connected AnimationCurve. + // Setting animation parameter for them here. + + if ( curves.x === null ) { + + curves.x = { + version: null, + times: [ 0.0 ], + values: [ 0.0 ] + }; + + } + + if ( curves.y === null ) { + + curves.y = { + version: null, + times: [ 0.0 ], + values: [ 0.0 ] + }; + + } + + if ( curves.z === null ) { + + curves.z = { + version: null, + times: [ 0.0 ], + values: [ 0.0 ] + }; + + } + curves.x.values = curves.x.values.map( degreeToRadian ); curves.y.values = curves.y.values.map( degreeToRadian ); curves.z.values = curves.z.values.map( degreeToRadian );
false
Other
mrdoob
three.js
9f2d1aea97ece8143e8d576ca72854a0c51a3057.json
Add SkinnedMesh check for .bones animation path
examples/js/exporters/GLTFExporter.js
@@ -904,9 +904,17 @@ THREE.GLTFExporter.prototype = { var trackNode = THREE.PropertyBinding.findNode( root, trackBinding.nodeName ); var trackProperty = PATH_PROPERTIES[ trackBinding.propertyName ]; - if ( trackBinding.objectName === 'bones' && trackNode.isSkinnedMesh === true ) { + if ( trackBinding.objectName === 'bones' ) { - trackNode = trackNode.skeleton.getBoneByName( trackBinding.objectIndex ); + if ( trackNode.isSkinnedMesh === true ) { + + trackNode = trackNode.skeleton.getBoneByName( trackBinding.objectIndex ); + + } else { + + trackNode = undefined; + + } }
false
Other
mrdoob
three.js
7f648bbcd4096090aaff65d8b46b9678ac310b73.json
Remove unnessecary assignement https://lgtm.com/projects/g/mrdoob/three.js/snapshot/88225c1a6d4bcdcf2ab408a972a8319ff38f4f53/files/examples/js/loaders/FBXLoader.js#V1099
examples/js/loaders/FBXLoader.js
@@ -1098,8 +1098,6 @@ } polygonIndex ++; - - endOfFace = false; faceLength = 0; // reset arrays for the next face
false
Other
mrdoob
three.js
027e853b4c989718c2ab48fe233a4bf5399b24d9.json
Add findBoneByName() to Skeleton
src/animation/PropertyBinding.js
@@ -219,25 +219,7 @@ Object.assign( PropertyBinding, { // search into skeleton bones. if ( root.skeleton ) { - var searchSkeleton = function ( skeleton ) { - - for ( var i = 0; i < skeleton.bones.length; i ++ ) { - - var bone = skeleton.bones[ i ]; - - if ( bone.name === nodeName ) { - - return bone; - - } - - } - - return null; - - }; - - var bone = searchSkeleton( root.skeleton ); + var bone = root.skeleton.findBoneByName( nodeName ); if ( bone ) {
true
Other
mrdoob
three.js
027e853b4c989718c2ab48fe233a4bf5399b24d9.json
Add findBoneByName() to Skeleton
src/objects/Skeleton.js
@@ -152,6 +152,24 @@ Object.assign( Skeleton.prototype, { return new Skeleton( this.bones, this.boneInverses ); + }, + + findBoneByName: function ( name ) { + + for ( var i = 0, il = this.bones.length; i < il; i ++ ) { + + var bone = this.bones[ i ]; + + if ( bone.name === name ) { + + return bone; + + } + + } + + return null; + } } );
true
Other
mrdoob
three.js
aaaf5454c773b6849117455ef72deee0ac254375.json
fix world position
examples/js/nodes/NodeMaterial.js
@@ -189,12 +189,10 @@ THREE.NodeMaterial.prototype.build = function() { if ( this.requestAttribs.worldPosition ) { - // for future update replace from the native "varying vec3 vWorldPosition" for optimization - this.addVertexPars( 'varying vec3 vWPosition;' ); this.addFragmentPars( 'varying vec3 vWPosition;' ); - this.addVertexCode( 'vWPosition = worldPosition.xyz;' ); + this.addVertexCode( 'vWPosition = ( modelMatrix * vec4( position, 1.0 ) ).xyz;' ); }
false
Other
mrdoob
three.js
386dd4efbfd773a9d335df4cf1a391bd8fd63083.json
Name inner function of IIFE
src/animation/PropertyBinding.js
@@ -143,7 +143,7 @@ Object.assign( PropertyBinding, { var supportedObjectNames = [ 'material', 'materials', 'bones' ]; - return function ( trackName ) { + return function parseTrackName( trackName ) { var matches = trackRe.exec( trackName );
true
Other
mrdoob
three.js
386dd4efbfd773a9d335df4cf1a391bd8fd63083.json
Name inner function of IIFE
src/loaders/JSONLoader.js
@@ -525,7 +525,7 @@ Object.assign( JSONLoader.prototype, { } - return function ( json, texturePath ) { + return function parse( json, texturePath ) { if ( json.data !== undefined ) {
true
Other
mrdoob
three.js
386dd4efbfd773a9d335df4cf1a391bd8fd63083.json
Name inner function of IIFE
src/math/Math.js
@@ -20,7 +20,7 @@ var _Math = { } - return function () { + return function generateUUID() { var d0 = Math.random() * 0xffffffff | 0; var d1 = Math.random() * 0xffffffff | 0;
true
Other
mrdoob
three.js
28f5d746b861edf65e1878e4ac881367c1f56967.json
Apply the review comment to GLTFExporter
examples/js/exporters/GLTFExporter.js
@@ -798,34 +798,40 @@ THREE.GLTFExporter.prototype = { var target = {}; + var warned = false; + for ( var attributeName in geometry.morphAttributes ) { // glTF 2.0 morph supports only POSITION/NORMAL/TANGENT. - // - // @TODO TANGENT support + // Three.js doesn't support TANGENT yet. if ( attributeName !== 'position' && attributeName !== 'normal' ) { + if ( ! warned ) { + + console.warn( 'GLTFExporter: Only POSITION and NORMAL morph are supported.' ); + warned = true; + + } + continue; } var attribute = geometry.morphAttributes[ attributeName ][ i ]; - // Three.js morph attribute has absolute values - // while the one of glTF has relative values. - // So we convert here. + // Three.js morph attribute has absolute values while the one of glTF has relative values. // // glTF 2.0 Specification: // https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#morph-targets var baseAttribute = geometry.attributes[ attributeName ]; // Clones attribute not to override - var attribute2 = attribute.clone(); + var relativeAttribute = attribute.clone(); for ( var j = 0, jl = attribute.count; j < jl; j ++ ) { - attribute2.setXYZ( + relativeAttribute.setXYZ( j, attribute.getX( j ) - baseAttribute.getX( j ), attribute.getY( j ) - baseAttribute.getY( j ), @@ -834,7 +840,7 @@ THREE.GLTFExporter.prototype = { } - target[ attributeName.toUpperCase() ] = processAccessor( attribute2, geometry ); + target[ attributeName.toUpperCase() ] = processAccessor( relativeAttribute, geometry ); }
false
Other
mrdoob
three.js
592014b705d6a7803601cee4d72e917817807431.json
Change colour => color
examples/js/ShaderGodRays.js
@@ -109,7 +109,7 @@ THREE.ShaderGodRays = { // Accumulate samples, making sure we dont walk past the light source. // The check for uv.y < 1 would not be necessary with "border" UV wrap - // mode, with a black border colour. I don't think this is currently + // mode, with a black border color. I don't think this is currently // exposed by three.js. As a result there might be artifacts when the // sun is to the left, right or bottom of screen as these cases are // not specifically handled.
false
Other
mrdoob
three.js
d2d34183249121d64c00a4bd2a646576789e37bf.json
Change colour => color
editor/js/libs/tern-threejs/threejs.js
@@ -4424,7 +4424,7 @@ }, "material": { "!type": "+THREE.Material", - "!doc": "An instance of [page:Material], defining the object's appearance. Default is a [page:MeshBasicMaterial] with wireframe mode enabled and randomised colour." + "!doc": "An instance of [page:Material], defining the object's appearance. Default is a [page:MeshBasicMaterial] with wireframe mode enabled and randomised color." }, "getMorphTargetIndexByName": { "!type": "fn(name: string) -> number", @@ -4528,7 +4528,7 @@ }, "material": { "!type": "+THREE.Material", - "!doc": "An instance of [page:Material], defining the object's appearance. Default is a [page:PointCloudMaterial] with randomised colour." + "!doc": "An instance of [page:Material], defining the object's appearance. Default is a [page:PointCloudMaterial] with randomised color." }, "clone": { "!type": "fn() -> +THREE.PointCloud",
false
Other
mrdoob
three.js
0af653dc9fa62fa9056fa9fbb16c5df7f0403bf9.json
Change colour => color.
examples/webgl_shaders_tonemapping.html
@@ -185,8 +185,8 @@ "float viewDot = abs(dot( normal, viewPosition ));", "viewDot = clamp( pow( viewDot + 0.6, 10.0 ), 0.0, 1.0);", - "vec3 colour = vec3( 0.05, 0.09, 0.13 ) * dirDiffuse;", - "gl_FragColor = vec4( colour, viewDot );", + "vec3 color = vec3( 0.05, 0.09, 0.13 ) * dirDiffuse;", + "gl_FragColor = vec4( color, viewDot );", "}" @@ -272,9 +272,9 @@ "void main() {", "vec2 sampleUV = vUv;", - "vec4 colour = texture2D( map, sampleUV, 0.0 );", + "vec4 color = texture2D( map, sampleUV, 0.0 );", - "gl_FragColor = vec4( colour.xyz, 1.0 );", + "gl_FragColor = vec4( color.xyz, 1.0 );", "}"
false
Other
mrdoob
three.js
696c849f33abe5cea97f8a5ca9dba320a9fe6bf2.json
Fix secondary missing variable declaration
examples/js/nodes/accessors/CameraNode.js
@@ -140,6 +140,7 @@ THREE.CameraNode.prototype.updateFrame = function( delta ) { case THREE.CameraNode.DEPTH: + var camera = this.camera this.near.number = camera.near; this.far.number = camera.far;
false
Other
mrdoob
three.js
b5dcd1fb299c0297e9d16374fc326072ae49e509.json
Move missplaced variable declaration
examples/js/nodes/accessors/CameraNode.js
@@ -52,11 +52,10 @@ THREE.CameraNode.prototype.setScope = function( scope ) { this.scope = scope; switch ( scope ) { - - var camera = this.camera case THREE.CameraNode.DEPTH: + var camera = this.camera this.near = new THREE.FloatNode( camera ? camera.near : 1 ); this.far = new THREE.FloatNode( camera ? camera.far : 1200 );
false
Other
mrdoob
three.js
a205beec8b01cdd7e3cbad29f4e18a0d52aeb302.json
Improve lighting and clean up
examples/webgl_loader_3mf.html
@@ -62,30 +62,34 @@ function init() { + renderer = new THREE.WebGLRenderer( { antialias: true } ); + renderer.setClearColor( 0x333333 ); + renderer.setPixelRatio( window.devicePixelRatio ); + renderer.setSize( window.innerWidth, window.innerHeight ); + document.body.appendChild( renderer.domElement ); + scene = new THREE.Scene(); - scene.add( new THREE.AmbientLight( 0x999999 ) ); - var pointLight = new THREE.PointLight( 0xffffff, 0.6 ); - pointLight.position.set( 80, 90, 150 ); - scene.add( pointLight ); + scene.add( new THREE.AmbientLight( 0xffffff, 0.2 ) ); camera = new THREE.PerspectiveCamera( 35, window.innerWidth / window.innerHeight, 1, 500 ); // Z is up for objects intended to be 3D printed. camera.up.set( 0, 0, 1 ); - camera.position.set( -80, -90, 150 ); - - //camera.add( new THREE.PointLight( 0xffffff, 0.8 ) ); - + camera.position.set( - 80, - 90, 150 ); scene.add( camera ); - renderer = new THREE.WebGLRenderer( { antialias: true } ); - renderer.setClearColor( 0x333333 ); - renderer.setPixelRatio( window.devicePixelRatio ); - renderer.setSize( window.innerWidth, window.innerHeight ); - document.body.appendChild( renderer.domElement ); + var controls = new THREE.OrbitControls( camera, renderer.domElement ); + controls.addEventListener( 'change', render ); + controls.minDistance = 50; + controls.maxDistance = 300; + controls.enablePan = false; + controls.target.set( 80, 65, 20 ); + controls.update(); + var pointLight = new THREE.PointLight( 0xffffff, 0.8 ); + camera.add( pointLight ); var loader = new THREE.ThreeMFLoader(); loader.load( './models/3mf/cube_gears.3mf', function ( object ) { @@ -94,11 +98,6 @@ } ); - var controls = new THREE.OrbitControls( camera, renderer.domElement ); - controls.addEventListener( 'change', render ); - controls.target.set( 80, 65, 35 ); - controls.update(); - window.addEventListener( 'resize', onWindowResize, false ); }
false
Other
mrdoob
three.js
a1b201556d6d3763112a0495ea19f0916ceb3321.json
Add onBeforeRender(), onAfterRender()
src/renderers/webgl/plugins/SpritePlugin.js
@@ -182,6 +182,8 @@ function SpritePlugin( renderer, sprites ) { if ( material.visible === false ) continue; + sprite.onBeforeRender( renderer, scene, camera, undefined, material, undefined ); + gl.uniform1f( uniforms.alphaTest, material.alphaTest ); gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, sprite.modelViewMatrix.elements ); @@ -239,6 +241,8 @@ function SpritePlugin( renderer, sprites ) { gl.drawElements( gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 ); + sprite.onAfterRender( renderer, scene, camera, undefined, material, undefined ); + } // restore gl
false
Other
mrdoob
three.js
9d9fbee78e1fb22e0a128f68e00052a6020e3aaf.json
Define shader name
src/renderers/webgl/plugins/SpritePlugin.js
@@ -260,6 +260,8 @@ function SpritePlugin( renderer, sprites ) { 'precision ' + renderer.getPrecision() + ' float;', + '#define SHADER_NAME ' + 'SpriteMaterial', + 'uniform mat4 modelViewMatrix;', 'uniform mat4 projectionMatrix;', 'uniform float rotation;', @@ -298,6 +300,8 @@ function SpritePlugin( renderer, sprites ) { 'precision ' + renderer.getPrecision() + ' float;', + '#define SHADER_NAME ' + 'SpriteMaterial', + 'uniform vec3 color;', 'uniform sampler2D map;', 'uniform float opacity;',
false
Other
mrdoob
three.js
04468e1e9fbf8fe143d07697f979d6a3b87f75b7.json
add required imports
src/renderers/webvr/WebVRManager.js
@@ -1,6 +1,10 @@ /** * @author mrdoob / http://mrdoob.com/ */ +import { Matrix4 } from '../../math/Matrix4'; +import { Vector4 } from '../../math/Vector4'; +import { ArrayCamera } from '../../cameras/ArrayCamera'; +import { PerspectiveCamera } from '../../cameras/PerspectiveCamera'; function WebVRManager( renderer ) {
false
Other
mrdoob
three.js
c6ec6d3f9d65401bf623eac8ce124da4fbed7094.json
remove references to THREE
src/renderers/webvr/WebVRManager.js
@@ -15,20 +15,20 @@ function WebVRManager( renderer ) { } - var matrixWorldInverse = new THREE.Matrix4(); + var matrixWorldInverse = new Matrix4(); - var standingMatrix = new THREE.Matrix4(); - var standingMatrixInverse = new THREE.Matrix4(); + var standingMatrix = new Matrix4(); + var standingMatrixInverse = new Matrix4(); - var cameraL = new THREE.PerspectiveCamera(); - cameraL.bounds = new THREE.Vector4( 0.0, 0.0, 0.5, 1.0 ); + var cameraL = new PerspectiveCamera(); + cameraL.bounds = new Vector4( 0.0, 0.0, 0.5, 1.0 ); cameraL.layers.enable( 1 ); - var cameraR = new THREE.PerspectiveCamera(); - cameraR.bounds = new THREE.Vector4( 0.5, 0.0, 0.5, 1.0 ); + var cameraR = new PerspectiveCamera(); + cameraR.bounds = new Vector4( 0.5, 0.0, 0.5, 1.0 ); cameraR.layers.enable( 2 ); - var cameraVR = new THREE.ArrayCamera( [ cameraL, cameraR ] ); + var cameraVR = new ArrayCamera( [ cameraL, cameraR ] ); //
false
Other
mrdoob
three.js
a40b7d287bca89bef9f8cb331e041471765bde2e.json
Reset updateRange.count to -1 after updateBuffer
src/renderers/webgl/WebGLAttributes.js
@@ -89,7 +89,7 @@ function WebGLAttributes( gl ) { gl.bufferSubData( bufferType, updateRange.offset * array.BYTES_PER_ELEMENT, array.subarray( updateRange.offset, updateRange.offset + updateRange.count ) ); - updateRange.count = 0; // reset range + updateRange.count = -1; // reset range }
false
Other
mrdoob
three.js
df0fdfd37557b91c923203f229f2fd7eac681e64.json
Add comment for GPUParticleSystem.geometryUpdate
examples/js/GPUParticleSystem.js
@@ -461,6 +461,7 @@ THREE.GPUParticleContainer = function( maxParticles, particleSystem ) { sizeAttribute.updateRange.offset = 0; lifeTimeAttribute.updateRange.offset = 0; + // Use -1 to update the entire buffer, see https://github.com/mrdoob/three.js/pull/11476 positionStartAttribute.updateRange.count = -1; startTimeAttribute.updateRange.count = -1; velocityAttribute.updateRange.count = -1;
false
Other
mrdoob
three.js
3a619a826ce2427b824e062acd5da461e44eef7e.json
fix pixel ratio
examples/js/nodes/utils/ResolutionNode.js
@@ -17,9 +17,10 @@ THREE.ResolutionNode.prototype.constructor = THREE.ResolutionNode; THREE.ResolutionNode.prototype.updateFrame = function( delta ) { - var size = this.renderer.getSize(); + var size = this.renderer.getSize(), + pixelRatio = this.renderer.getPixelRatio(); - this.x = size.width; - this.y = size.height; + this.x = size.width * pixelRatio; + this.y = size.height * pixelRatio; };
false
Other
mrdoob
three.js
883603a32018b7ebaa7413ba0b3626d02322349a.json
Fix unused BoneDics, rootBone and keys
examples/js/loaders/XLoader.js
@@ -1205,8 +1205,6 @@ THREE.XLoader.prototype = { scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Geometry.groupsNeedUpdate = true; var putBones = []; var BoneInverse = []; - var BoneDics = []; - var rootBone = new THREE.Bone(); if ( scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].BoneInfs != null && scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].BoneInfs.length ) { var keys = Object.keys( scope.loadingXdata.FrameInfo_Raw ); @@ -1344,7 +1342,6 @@ THREE.XLoader.prototype = { var scope = this; var i = scope.nowReaded; - var keys = Object.keys( scope.loadingXdata.FrameInfo_Raw ); var tgtModel = null; for ( var m = 0; m < scope.loadingXdata.FrameInfo.length; m ++ ) {
false
Other
mrdoob
three.js
02253acb2206b14a2df58882bf92bf52e03db548.json
Fix undefined XBoneInf
examples/js/loaders/XLoader.js
@@ -1004,7 +1004,7 @@ THREE.XLoader.prototype = { var scope = this; scope.nowReadMode = THREE.XLoader.XfileLoadMode.Weit_init; - scope.BoneInf = new XboneInf(); + scope.BoneInf = new THREE.XLoader.XboneInf(); },
false
Other
mrdoob
three.js
be58df1b0f6f47c7d49a6e2d75fe07ade4326f41.json
Fix unused param line
examples/js/loaders/XLoader.js
@@ -601,7 +601,7 @@ THREE.XLoader.prototype = { }, - endElement: function ( line ) { + endElement: function () { var scope = this; if ( scope.nowReadMode == THREE.XLoader.XfileLoadMode.Mesh ) { @@ -753,7 +753,7 @@ THREE.XLoader.prototype = { }, - beginMeshNormal: function ( line ) { + beginMeshNormal: function () { var scope = this; scope.nowReadMode = THREE.XLoader.XfileLoadMode.Normal_V_init; @@ -1000,7 +1000,7 @@ THREE.XLoader.prototype = { }, - readBoneInit: function ( line ) { + readBoneInit: function () { var scope = this; scope.nowReadMode = THREE.XLoader.XfileLoadMode.Weit_init;
false
Other
mrdoob
three.js
2ec3df1ff60793728c314b709dcd22469ed40f80.json
Fix unused scope
examples/js/loaders/XLoader.js
@@ -373,7 +373,6 @@ THREE.XLoader.prototype = { getPlaneStr: function ( _str ) { - var scope = this; var firstDbl = _str.indexOf( '"' ) + 1; var dbl2 = _str.indexOf( '"', firstDbl ); return _str.substr( firstDbl, dbl2 - firstDbl );
false
Other
mrdoob
three.js
faea56c549647019911134368d841d9a8da87d91.json
Fix unused find
examples/js/loaders/XLoader.js
@@ -231,14 +231,12 @@ THREE.XLoader.prototype = { getNextSection: function ( _offset, _start, _end ) { var scope = this; - var find = scope.data.indexOf( "{", _offset ); return [ scope.data.substr( _offset, _start - _offset ).trim(), scope.data.substr( _start + 1, _end - _start - 1 ) ]; }, getNextSection2: function ( _obj, _offset, _start, _end ) { - var find = _obj.indexOf( "{", _offset ); return [ _obj.substr( _offset, _start - _offset ).trim(), _obj.substr( _start + 1, _end - _start - 1 ) ]; },
false
Other
mrdoob
three.js
cf35b7121ffc72fbf6cd4a347aca6cdfec467248.json
Fix unused baseDir
examples/js/loaders/XLoader.js
@@ -175,7 +175,6 @@ THREE.XLoader.prototype = { parseASCII: function () { var scope = this; - var baseDir = ""; if ( scope.url.lastIndexOf( "/" ) > 0 ) { scope.baseDir = scope.url.substr( 0, scope.url.lastIndexOf( "/" ) + 1 );
false
Other
mrdoob
three.js
f28233f50f476e21d78a6606aa3f768e3bc09f78.json
Fix undefined parseASCII
examples/js/loaders/XLoader.js
@@ -167,7 +167,8 @@ THREE.XLoader.prototype = { parseBinary: function ( data ) { - return parseASCII( String.fromCharCode.apply( null, data ) ); + var scope = this; + return scope.parseASCII( String.fromCharCode.apply( null, data ) ); },
false
Other
mrdoob
three.js
e407213680594f2eda38d81e56239cf63b8211da.json
Fix style issus
examples/js/loaders/XLoader.js
@@ -1,4 +1,3 @@ - /** * @author Jey-en https://github.com/adrs2002 * @@ -21,7 +20,7 @@ * - scene */ -THREE.XLoader = function (manager, Texloader, _zflg) { +THREE.XLoader = function ( manager, Texloader, _zflg ) { this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager; this.Texloader = ( Texloader !== undefined ) ? Texloader : new THREE.TextureLoader(); @@ -60,49 +59,51 @@ THREE.XLoader.prototype = { constructor: THREE.XLoader, - load: function (_arg, onLoad, onProgress, onError) { + load: function ( _arg, onLoad, onProgress, onError ) { var scope = this; scope.IsUvYReverse = true; - var loader = new THREE.FileLoader(scope.manager); - loader.setResponseType('arraybuffer'); + var loader = new THREE.FileLoader( scope.manager ); + loader.setResponseType( 'arraybuffer' ); - for (var i = 0; i < _arg.length; i++) { + for ( var i = 0; i < _arg.length; i ++ ) { - switch (i) { + switch ( i ) { case 0: - scope.url = _arg[i]; break; + scope.url = _arg[ i ]; + break; case 1: - scope.zflg = _arg[i]; break; + scope.zflg = _arg[ i ]; + break; } } - loader.load(scope.url, function (response) { + loader.load( scope.url, function ( response ) { - scope.parse(response, onLoad); + scope.parse( response, onLoad ); - }, onProgress, onError); + }, onProgress, onError ); }, - isBinary: function (binData) { + isBinary: function ( binData ) { - var reader = new DataView(binData); + var reader = new DataView( binData ); var face_size = 32 / 8 * 3 + 32 / 8 * 3 * 3 + 16 / 8; - var n_faces = reader.getUint32(80, true); + var n_faces = reader.getUint32( 80, true ); var expect = 80 + 32 / 8 + n_faces * face_size; - if (expect === reader.byteLength) { + if ( expect === reader.byteLength ) { return true; } var fileLength = reader.byteLength; - for (var index = 0; index < fileLength; index++) { + for ( var index = 0; index < fileLength; index ++ ) { - if (reader.getUint8(index, false) > 127) { + if ( reader.getUint8( index, false ) > 127 ) { return true; @@ -113,14 +114,14 @@ THREE.XLoader.prototype = { }, - ensureBinary: function (buf) { + ensureBinary: function ( buf ) { - if (typeof buf === "string") { + if ( typeof buf === "string" ) { - var array_buffer = new Uint8Array(buf.length); - for (var i = 0; i < buf.length; i++) { + var array_buffer = new Uint8Array( buf.length ); + for ( var i = 0; i < buf.length; i ++ ) { - array_buffer[i] = buf.charCodeAt(i) & 0xff; + array_buffer[ i ] = buf.charCodeAt( i ) & 0xff; } return array_buffer.buffer || array_buffer; @@ -129,20 +130,19 @@ THREE.XLoader.prototype = { return buf; - } }, - ensureString: function (buf) { + ensureString: function ( buf ) { - if (typeof buf !== "string") { + if ( typeof buf !== "string" ) { - var array_buffer = new Uint8Array(buf); + var array_buffer = new Uint8Array( buf ); var str = ''; - for (var i = 0; i < buf.byteLength; i++) { + for ( var i = 0; i < buf.byteLength; i ++ ) { - str += String.fromCharCode(array_buffer[i]); + str += String.fromCharCode( array_buffer[ i ] ); } return str; @@ -155,29 +155,29 @@ THREE.XLoader.prototype = { }, - parse: function (data, onLoad) { + parse: function ( data, onLoad ) { var scope = this; - var binData = scope.ensureBinary(data); - scope.data = scope.ensureString(data); + var binData = scope.ensureBinary( data ); + scope.data = scope.ensureString( data ); scope.onLoad = onLoad; - return scope.isBinary(binData) ? scope.parseBinary(binData) : scope.parseASCII(); + return scope.isBinary( binData ) ? scope.parseBinary( binData ) : scope.parseASCII(); }, - parseBinary: function (data) { + parseBinary: function ( data ) { - return parseASCII(String.fromCharCode.apply(null, data)); + return parseASCII( String.fromCharCode.apply( null, data ) ); }, parseASCII: function () { var scope = this; var baseDir = ""; - if (scope.url.lastIndexOf("/") > 0) { + if ( scope.url.lastIndexOf( "/" ) > 0 ) { - scope.baseDir = scope.url.substr(0, scope.url.lastIndexOf("/") + 1); + scope.baseDir = scope.url.substr( 0, scope.url.lastIndexOf( "/" ) + 1 ); } scope.loadingXdata = new THREE.XLoader.Xdata(); @@ -193,117 +193,117 @@ THREE.XLoader.prototype = { var scope = this; var EndFlg = false; - for (var i = 0; i < 10; i++) { + for ( var i = 0; i < 10; i ++ ) { var forceBreak = scope.SectionRead(); - scope.endLineCount++; - if (scope.readedLength >= scope.data.length) { + scope.endLineCount ++; + if ( scope.readedLength >= scope.data.length ) { EndFlg = true; scope.readFinalize(); - setTimeout(function () { + setTimeout( function () { scope.animationFinalize(); - }, 1); + }, 1 ); break; } - if (forceBreak) { + if ( forceBreak ) { break; } } - if (!EndFlg) { + if ( ! EndFlg ) { - setTimeout(function () { + setTimeout( function () { scope.mainloop(); - }, 1); + }, 1 ); } }, - getNextSection: function (_offset, _start, _end) { + getNextSection: function ( _offset, _start, _end ) { var scope = this; - var find = scope.data.indexOf("{", _offset); - return [scope.data.substr(_offset, _start - _offset).trim(), scope.data.substr(_start + 1, _end - _start - 1)]; + var find = scope.data.indexOf( "{", _offset ); + return [ scope.data.substr( _offset, _start - _offset ).trim(), scope.data.substr( _start + 1, _end - _start - 1 ) ]; }, - getNextSection2: function (_obj, _offset, _start, _end) { + getNextSection2: function ( _obj, _offset, _start, _end ) { - var find = _obj.indexOf("{", _offset); - return [_obj.substr(_offset, _start - _offset).trim(), _obj.substr(_start + 1, _end - _start - 1)]; + var find = _obj.indexOf( "{", _offset ); + return [ _obj.substr( _offset, _start - _offset ).trim(), _obj.substr( _start + 1, _end - _start - 1 ) ]; }, - readMeshSection: function (_baseOffset) { + readMeshSection: function ( _baseOffset ) { var scope = this; - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Geometry = new THREE.Geometry(); - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Materials = []; - var find_2semi = scope.data.indexOf(";;", _baseOffset); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Geometry = new THREE.Geometry(); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Materials = []; + var find_2semi = scope.data.indexOf( ";;", _baseOffset ); var offset = 0; - var v_data = scope.getVertextDataSection(scope.data.substr(_baseOffset, find_2semi - _baseOffset), 0); - for (var i = 0; i < v_data[0].length; i++) { + var v_data = scope.getVertextDataSection( scope.data.substr( _baseOffset, find_2semi - _baseOffset ), 0 ); + for ( var i = 0; i < v_data[ 0 ].length; i ++ ) { - scope.readVertex(v_data[0][i]); + scope.readVertex( v_data[ 0 ][ i ] ); } offset = find_2semi + 2; - find_2semi = scope.data.indexOf(";;", offset); - var v_data2 = scope.getVertextDataSection(scope.data.substr(offset + 1, find_2semi - offset + 1), 0); - for (var _i = 0; _i < v_data2[0].length; _i++) { + find_2semi = scope.data.indexOf( ";;", offset ); + var v_data2 = scope.getVertextDataSection( scope.data.substr( offset + 1, find_2semi - offset + 1 ), 0 ); + for ( var _i = 0; _i < v_data2[ 0 ].length; _i ++ ) { - scope.readVertexIndex(v_data2[0][_i]); + scope.readVertexIndex( v_data2[ 0 ][ _i ] ); } - scope.readedLength = offset + v_data2[1] + 1; + scope.readedLength = offset + v_data2[ 1 ] + 1; }, - getVertextDataSection: function (_data, _offset) { + getVertextDataSection: function ( _data, _offset ) { - var find = _data.indexOf(";", _offset); - var find_2semi = _data.indexOf(";;", _offset); - if (find_2semi === - 1) { + var find = _data.indexOf( ";", _offset ); + var find_2semi = _data.indexOf( ";;", _offset ); + if ( find_2semi === - 1 ) { find_2semi = _data.length - 1; } - var v_data_base = _data.substr(find + 1, find_2semi - find + 2); - return [v_data_base.split(";,"), find_2semi + 2]; + var v_data_base = _data.substr( find + 1, find_2semi - find + 2 ); + return [ v_data_base.split( ";," ), find_2semi + 2 ]; }, - readMeshMaterialSet: function (_baseOffset) { + readMeshMaterialSet: function ( _baseOffset ) { var scope = this; - var find = scope.data.indexOf(";", _baseOffset); - find = scope.data.indexOf(";", find + 2); - var find2 = scope.data.indexOf(";", find + 2); - var _data = scope.data.substr(find + 1, find2 - find + 1); - var v_data = _data.split(","); - for (var i = 0; i < v_data.length; i++) { + var find = scope.data.indexOf( ";", _baseOffset ); + find = scope.data.indexOf( ";", find + 2 ); + var find2 = scope.data.indexOf( ";", find + 2 ); + var _data = scope.data.substr( find + 1, find2 - find + 1 ); + var v_data = _data.split( "," ); + for ( var i = 0; i < v_data.length; i ++ ) { - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Geometry.faces[i].materialIndex = parseInt(v_data[i], 10); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Geometry.faces[ i ].materialIndex = parseInt( v_data[ i ], 10 ); } scope.readedLength = find2 + 1; }, - readMaterial: function (_dataLine) { + readMaterial: function ( _dataLine ) { var scope = this; - scope.nowMat = new THREE.MeshPhongMaterial({ color: Math.random() * 0xffffff }); - if (scope.zflg) { + scope.nowMat = new THREE.MeshPhongMaterial( { color: Math.random() * 0xffffff } ); + if ( scope.zflg ) { scope.nowMat.side = THREE.BackSide; @@ -312,86 +312,86 @@ THREE.XLoader.prototype = { scope.nowMat.side = THREE.FrontSide; } - var find = _dataLine.indexOf(";;"); - var _diff = _dataLine.substr(0, find).split(";"); - scope.nowMat.color.r = parseFloat(_diff[0]); - scope.nowMat.color.g = parseFloat(_diff[1]); - scope.nowMat.color.b = parseFloat(_diff[2]); - var find2 = _dataLine.indexOf(";", find + 3); - scope.nowMat.shininess = parseFloat(_dataLine.substr(find + 2, find2 - find - 2)); - find = _dataLine.indexOf(";;", find2 + 1); - var _specular = _dataLine.substr(find2 + 1, find - find2).split(";"); - scope.nowMat.specular.r = parseFloat(_specular[0]); - scope.nowMat.specular.g = parseFloat(_specular[1]); - scope.nowMat.specular.b = parseFloat(_specular[2]); - find2 = _dataLine.indexOf(";;", find + 2); - var _emissive = _dataLine.substr(find + 2, find2 - find - 2).split(";"); - scope.nowMat.emissive.r = parseFloat(_emissive[0]); - scope.nowMat.emissive.g = parseFloat(_emissive[1]); - scope.nowMat.emissive.b = parseFloat(_emissive[2]); + var find = _dataLine.indexOf( ";;" ); + var _diff = _dataLine.substr( 0, find ).split( ";" ); + scope.nowMat.color.r = parseFloat( _diff[ 0 ] ); + scope.nowMat.color.g = parseFloat( _diff[ 1 ] ); + scope.nowMat.color.b = parseFloat( _diff[ 2 ] ); + var find2 = _dataLine.indexOf( ";", find + 3 ); + scope.nowMat.shininess = parseFloat( _dataLine.substr( find + 2, find2 - find - 2 ) ); + find = _dataLine.indexOf( ";;", find2 + 1 ); + var _specular = _dataLine.substr( find2 + 1, find - find2 ).split( ";" ); + scope.nowMat.specular.r = parseFloat( _specular[ 0 ] ); + scope.nowMat.specular.g = parseFloat( _specular[ 1 ] ); + scope.nowMat.specular.b = parseFloat( _specular[ 2 ] ); + find2 = _dataLine.indexOf( ";;", find + 2 ); + var _emissive = _dataLine.substr( find + 2, find2 - find - 2 ).split( ";" ); + scope.nowMat.emissive.r = parseFloat( _emissive[ 0 ] ); + scope.nowMat.emissive.g = parseFloat( _emissive[ 1 ] ); + scope.nowMat.emissive.b = parseFloat( _emissive[ 2 ] ); }, - readSkinWeights: function (_data) { + readSkinWeights: function ( _data ) { var scope = this; scope.BoneInf = new THREE.XLoader.XboneInf(); - var find = _data.indexOf(";"); - scope.readBoneName(_data.substr(0, find - 1).replace('"', '')); - var find_1 = _data.indexOf(";", find + 1) + 1; + var find = _data.indexOf( ";" ); + scope.readBoneName( _data.substr( 0, find - 1 ).replace( '"', '' ) ); + var find_1 = _data.indexOf( ";", find + 1 ) + 1; var matrixStart = 0; - if (parseInt(_data.substr(find, find_1 - find), 10) === 0) { + if ( parseInt( _data.substr( find, find_1 - find ), 10 ) === 0 ) { matrixStart = find_1 + 1; } else { - var _find = _data.indexOf(";", find_1 + 1); - var i_data = _data.substr(find_1, _find - find_1).split(","); - for (var i = 0; i < i_data.length; i++) { + var _find = _data.indexOf( ";", find_1 + 1 ); + var i_data = _data.substr( find_1, _find - find_1 ).split( "," ); + for ( var i = 0; i < i_data.length; i ++ ) { - scope.BoneInf.Indeces.push(parseInt(i_data[i], 10)); + scope.BoneInf.Indeces.push( parseInt( i_data[ i ], 10 ) ); } - var find3 = _data.indexOf(";", _find + 1); - var w_data = _data.substr(_find + 1, find3 - _find).split(","); - for (var _i2 = 0; _i2 < w_data.length; _i2++) { + var find3 = _data.indexOf( ";", _find + 1 ); + var w_data = _data.substr( _find + 1, find3 - _find ).split( "," ); + for ( var _i2 = 0; _i2 < w_data.length; _i2 ++ ) { - scope.BoneInf.Weights.push(parseFloat(w_data[_i2])); + scope.BoneInf.Weights.push( parseFloat( w_data[ _i2 ] ) ); } matrixStart = find3 + 1; } - var find4 = _data.indexOf(";;", matrixStart + 1); - var m_data = _data.substr(matrixStart, find4 - matrixStart).split(","); + var find4 = _data.indexOf( ";;", matrixStart + 1 ); + var m_data = _data.substr( matrixStart, find4 - matrixStart ).split( "," ); scope.BoneInf.initMatrix = new THREE.Matrix4(); - scope.ParseMatrixData(scope.BoneInf.initMatrix, m_data); + scope.ParseMatrixData( scope.BoneInf.initMatrix, m_data ); scope.BoneInf.OffsetMatrix = new THREE.Matrix4(); - scope.BoneInf.OffsetMatrix.getInverse(scope.BoneInf.initMatrix); - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].BoneInfs.push(scope.BoneInf); + scope.BoneInf.OffsetMatrix.getInverse( scope.BoneInf.initMatrix ); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].BoneInfs.push( scope.BoneInf ); }, - getPlaneStr: function (_str) { + getPlaneStr: function ( _str ) { var scope = this; - var firstDbl = _str.indexOf('"') + 1; - var dbl2 = _str.indexOf('"', firstDbl); - return _str.substr(firstDbl, dbl2 - firstDbl); + var firstDbl = _str.indexOf( '"' ) + 1; + var dbl2 = _str.indexOf( '"', firstDbl ); + return _str.substr( firstDbl, dbl2 - firstDbl ); }, - readAnimationKeyFrame: function (_data) { + readAnimationKeyFrame: function ( _data ) { var scope = this; - var find1 = _data.indexOf(';'); - scope.nowAnimationKeyType = parseInt(_data.substr(0, find1), 10); - var find2 = _data.indexOf(';', find1 + 1); - var lines = _data.substr(find2 + 1).split(';;,'); - for (var i = 0; i < lines.length; i++) { + var find1 = _data.indexOf( ';' ); + scope.nowAnimationKeyType = parseInt( _data.substr( 0, find1 ), 10 ); + var find2 = _data.indexOf( ';', find1 + 1 ); + var lines = _data.substr( find2 + 1 ).split( ';;,' ); + for ( var i = 0; i < lines.length; i ++ ) { - scope.readAnimationKeyFrameValue(lines[i]); + scope.readAnimationKeyFrameValue( lines[ i ] ); } @@ -400,30 +400,31 @@ THREE.XLoader.prototype = { SectionRead: function () { var scope = this; - var find = scope.data.indexOf("{", scope.readedLength); - if (find === - 1) { + var find = scope.data.indexOf( "{", scope.readedLength ); + if ( find === - 1 ) { - scope.readedLength = scope.data.length; return; + scope.readedLength = scope.data.length; + return; } - var lines = scope.data.substr(scope.readedLength, find - scope.readedLength).split(/\r\n|\r|\n/); - var line = lines[0]; - for (var i = lines.length - 1; i >= 0; i--) { + var lines = scope.data.substr( scope.readedLength, find - scope.readedLength ).split( /\r\n|\r|\n/ ); + var line = lines[ 0 ]; + for ( var i = lines.length - 1; i >= 0; i -- ) { - if (lines[i].trim().length > 0 && lines[i].indexOf('//') < 0) { + if ( lines[ i ].trim().length > 0 && lines[ i ].indexOf( '//' ) < 0 ) { - line = lines[i]; + line = lines[ i ]; break; } } - var find2 = scope.data.indexOf("{", find + 1); - var find3 = scope.data.indexOf("}", find + 1); - var find4 = scope.data.indexOf("}", scope.readedLength); - if (find4 < find) { + var find2 = scope.data.indexOf( "{", find + 1 ); + var find3 = scope.data.indexOf( "}", find + 1 ); + var find4 = scope.data.indexOf( "}", scope.readedLength ); + if ( find4 < find ) { - if (scope.elementLv < 1 || scope.nowFrameName === "") { + if ( scope.elementLv < 1 || scope.nowFrameName === "" ) { scope.elementLv = 0; @@ -436,48 +437,48 @@ THREE.XLoader.prototype = { return false; } - if (find3 > find2) { + if ( find3 > find2 ) { - scope.elementLv++; - if (line.indexOf("Frame ") > - 1) { + scope.elementLv ++; + if ( line.indexOf( "Frame " ) > - 1 ) { - scope.beginFrame(line); + scope.beginFrame( line ); - } else if (line.indexOf("Mesh ") > - 1) { + } else if ( line.indexOf( "Mesh " ) > - 1 ) { - scope.readMeshSection(find + 1); + scope.readMeshSection( find + 1 ); scope.nowReadMode = THREE.XLoader.XfileLoadMode.Mesh; return true; - } else if (line.indexOf("MeshMaterialList ") > - 1) { + } else if ( line.indexOf( "MeshMaterialList " ) > - 1 ) { - scope.readMeshMaterialSet(find + 1); + scope.readMeshMaterialSet( find + 1 ); scope.nowReadMode = THREE.XLoader.XfileLoadMode.Mat_Set; return true; - } else if (line.indexOf("Material ") > - 1) { + } else if ( line.indexOf( "Material " ) > - 1 ) { - var nextSemic = scope.data.indexOf(";;", find + 1); - nextSemic = scope.data.indexOf(";;", nextSemic + 1); - nextSemic = scope.data.indexOf(";;", nextSemic + 1); - scope.readMaterial(scope.data.substr(find + 1, nextSemic - find + 1)); + var nextSemic = scope.data.indexOf( ";;", find + 1 ); + nextSemic = scope.data.indexOf( ";;", nextSemic + 1 ); + nextSemic = scope.data.indexOf( ";;", nextSemic + 1 ); + scope.readMaterial( scope.data.substr( find + 1, nextSemic - find + 1 ) ); scope.readedLength = nextSemic + 2; scope.nowReadMode = THREE.XLoader.XfileLoadMode.Mat_detail; return true; - } else if (line.indexOf("AnimationSet ") > - 1) { + } else if ( line.indexOf( "AnimationSet " ) > - 1 ) { - scope.readandCreateAnimationSet(line); + scope.readandCreateAnimationSet( line ); scope.nowReadMode = THREE.XLoader.XfileLoadMode.Anim_init; scope.readedLength = find + 1; return false; - } else if (line.indexOf("Animation ") > - 1) { + } else if ( line.indexOf( "Animation " ) > - 1 ) { - scope.readAndCreateAnimation(line); + scope.readAndCreateAnimation( line ); scope.nowReadMode = THREE.XLoader.XfileLoadMode.Anim_Reading; - var tgtBoneName = scope.data.substr(find2 + 1, find3 - find2 - 1).trim(); - scope.loadingXdata.AnimationSetInfo[scope.nowAnimationSetName][scope.nowFrameName].boneName = tgtBoneName; + var tgtBoneName = scope.data.substr( find2 + 1, find3 - find2 - 1 ).trim(); + scope.loadingXdata.AnimationSetInfo[ scope.nowAnimationSetName ][ scope.nowFrameName ].boneName = tgtBoneName; scope.readedLength = find3 + 1; return false; @@ -487,113 +488,113 @@ THREE.XLoader.prototype = { } else { - var section = scope.getNextSection(scope.readedLength, find, find3); + var section = scope.getNextSection( scope.readedLength, find, find3 ); scope.readedLength = find3 + 1; - if (line.indexOf("template ") > - 1) { + if ( line.indexOf( "template " ) > - 1 ) { scope.elementLv = 0; return false; - } else if (line.indexOf("AnimTicksPerSecond") > - 1) { + } else if ( line.indexOf( "AnimTicksPerSecond" ) > - 1 ) { - scope.loadingXdata.AnimTicksPerSecond = parseInt(section[1].substr(0, section[1].indexOf(";")), 10); + scope.loadingXdata.AnimTicksPerSecond = parseInt( section[ 1 ].substr( 0, section[ 1 ].indexOf( ";" ) ), 10 ); scope.elementLv = 0; return false; - } else if (line.indexOf("FrameTransformMatrix") > - 1) { + } else if ( line.indexOf( "FrameTransformMatrix" ) > - 1 ) { - var data = section[1].split(","); - data[15] = data[15].substr(0, data[15].indexOf(';;')); - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].FrameTransformMatrix = new THREE.Matrix4(); - scope.ParseMatrixData(scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].FrameTransformMatrix, data); + var data = section[ 1 ].split( "," ); + data[ 15 ] = data[ 15 ].substr( 0, data[ 15 ].indexOf( ';;' ) ); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].FrameTransformMatrix = new THREE.Matrix4(); + scope.ParseMatrixData( scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].FrameTransformMatrix, data ); scope.nowReadMode = THREE.XLoader.XfileLoadMode.Element; return false; - } else if (line.indexOf("MeshTextureCoords") > - 1) { + } else if ( line.indexOf( "MeshTextureCoords" ) > - 1 ) { - var v_data = scope.getVertextDataSection(section[1], 0); - for (var _i3 = 0; _i3 < v_data[0].length; _i3++) { + var v_data = scope.getVertextDataSection( section[ 1 ], 0 ); + for ( var _i3 = 0; _i3 < v_data[ 0 ].length; _i3 ++ ) { - scope.readUv(v_data[0][_i3]); + scope.readUv( v_data[ 0 ][ _i3 ] ); } - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Geometry.faceVertexUvs[0] = []; - for (var m = 0; m < scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Geometry.faces.length; m++) { + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Geometry.faceVertexUvs[ 0 ] = []; + for ( var m = 0; m < scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Geometry.faces.length; m ++ ) { - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Geometry.faceVertexUvs[0][m] = []; - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Geometry.faceVertexUvs[0][m].push(scope.tmpUvArray[scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Geometry.faces[m].a]); - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Geometry.faceVertexUvs[0][m].push(scope.tmpUvArray[scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Geometry.faces[m].b]); - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Geometry.faceVertexUvs[0][m].push(scope.tmpUvArray[scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Geometry.faces[m].c]); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Geometry.faceVertexUvs[ 0 ][ m ] = []; + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Geometry.faceVertexUvs[ 0 ][ m ].push( scope.tmpUvArray[ scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Geometry.faces[ m ].a ] ); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Geometry.faceVertexUvs[ 0 ][ m ].push( scope.tmpUvArray[ scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Geometry.faces[ m ].b ] ); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Geometry.faceVertexUvs[ 0 ][ m ].push( scope.tmpUvArray[ scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Geometry.faces[ m ].c ] ); } - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Geometry.uvsNeedUpdate = true; + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Geometry.uvsNeedUpdate = true; return true; - } else if (line.indexOf("Material ") > - 1) { + } else if ( line.indexOf( "Material " ) > - 1 ) { - scope.readMaterial(section[1]); - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Materials.push(scope.nowMat); + scope.readMaterial( section[ 1 ] ); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Materials.push( scope.nowMat ); return false; - } else if (line.indexOf("TextureFilename") > - 1) { + } else if ( line.indexOf( "TextureFilename" ) > - 1 ) { - if (section[1].length > 0) { + if ( section[ 1 ].length > 0 ) { - scope.nowMat.map = scope.Texloader.load(scope.baseDir + scope.getPlaneStr(section[1])); + scope.nowMat.map = scope.Texloader.load( scope.baseDir + scope.getPlaneStr( section[ 1 ] ) ); } return false; - } else if (line.indexOf("BumpMapFilename") > - 1) { + } else if ( line.indexOf( "BumpMapFilename" ) > - 1 ) { - if (section[1].length > 0) { + if ( section[ 1 ].length > 0 ) { - scope.nowMat.bumpMap = scope.Texloader.load(scope.baseDir + scope.getPlaneStr(section[1])); + scope.nowMat.bumpMap = scope.Texloader.load( scope.baseDir + scope.getPlaneStr( section[ 1 ] ) ); scope.nowMat.bumpScale = 0.05; } return false; - } else if (line.indexOf("NormalMapFilename") > - 1) { + } else if ( line.indexOf( "NormalMapFilename" ) > - 1 ) { - if (section[1].length > 0) { + if ( section[ 1 ].length > 0 ) { - scope.nowMat.normalMap = scope.Texloader.load(scope.baseDir + scope.getPlaneStr(section[1])); - scope.nowMat.normalScale = new THREE.Vector2(2, 2); + scope.nowMat.normalMap = scope.Texloader.load( scope.baseDir + scope.getPlaneStr( section[ 1 ] ) ); + scope.nowMat.normalScale = new THREE.Vector2( 2, 2 ); } return false; - } else if (line.indexOf("EmissiveMapFilename") > - 1) { + } else if ( line.indexOf( "EmissiveMapFilename" ) > - 1 ) { - if (section[1].length > 0) { + if ( section[ 1 ].length > 0 ) { - scope.nowMat.emissiveMap = scope.Texloader.load(scope.baseDir + scope.getPlaneStr(section[1])); + scope.nowMat.emissiveMap = scope.Texloader.load( scope.baseDir + scope.getPlaneStr( section[ 1 ] ) ); } return false; - } else if (line.indexOf("LightMapFilename") > - 1) { + } else if ( line.indexOf( "LightMapFilename" ) > - 1 ) { - if (section[1].length > 0) { + if ( section[ 1 ].length > 0 ) { - scope.nowMat.lightMap = scope.Texloader.load(scope.baseDir + scope.getPlaneStr(section[1])); + scope.nowMat.lightMap = scope.Texloader.load( scope.baseDir + scope.getPlaneStr( section[ 1 ] ) ); } return false; - } else if (line.indexOf("XSkinMeshHeader") > - 1) { + } else if ( line.indexOf( "XSkinMeshHeader" ) > - 1 ) { return false; - } else if (line.indexOf("SkinWeights") > - 1) { + } else if ( line.indexOf( "SkinWeights" ) > - 1 ) { - scope.readSkinWeights(section[1]); + scope.readSkinWeights( section[ 1 ] ); return true; - } else if (line.indexOf("AnimationKey") > - 1) { + } else if ( line.indexOf( "AnimationKey" ) > - 1 ) { - scope.readAnimationKeyFrame(section[1]); + scope.readAnimationKeyFrame( section[ 1 ] ); return true; } @@ -603,159 +604,159 @@ THREE.XLoader.prototype = { }, - endElement: function (line) { + endElement: function ( line ) { var scope = this; - if (scope.nowReadMode == THREE.XLoader.XfileLoadMode.Mesh) { + if ( scope.nowReadMode == THREE.XLoader.XfileLoadMode.Mesh ) { scope.nowReadMode = THREE.XLoader.XfileLoadMode.Element; - } else if (scope.nowReadMode == THREE.XLoader.XfileLoadMode.Mat_Set) { + } else if ( scope.nowReadMode == THREE.XLoader.XfileLoadMode.Mat_Set ) { scope.nowReadMode = THREE.XLoader.XfileLoadMode.Mesh; - } else if (scope.nowReadMode == THREE.XLoader.XfileLoadMode.Mat_detail) { + } else if ( scope.nowReadMode == THREE.XLoader.XfileLoadMode.Mat_detail ) { - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Materials.push(scope.nowMat); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Materials.push( scope.nowMat ); scope.nowReadMode = THREE.XLoader.XfileLoadMode.Mat_Set; - } else if (scope.nowReadMode == THREE.XLoader.XfileLoadMode.Anim_Reading) { + } else if ( scope.nowReadMode == THREE.XLoader.XfileLoadMode.Anim_Reading ) { scope.nowReadMode = THREE.XLoader.XfileLoadMode.Anim_init; - } else if (scope.nowReadMode < THREE.XLoader.XfileLoadMode.Anim_init && scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].FrameStartLv === scope.elementLv && scope.nowReadMode > THREE.XLoader.XfileLoadMode.none) { + } else if ( scope.nowReadMode < THREE.XLoader.XfileLoadMode.Anim_init && scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].FrameStartLv === scope.elementLv && scope.nowReadMode > THREE.XLoader.XfileLoadMode.none ) { - if (scope.frameHierarchie.length > 0) { + if ( scope.frameHierarchie.length > 0 ) { - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].children = []; - var keys = Object.keys(scope.loadingXdata.FrameInfo_Raw); - for (var m = 0; m < keys.length; m++) { + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].children = []; + var keys = Object.keys( scope.loadingXdata.FrameInfo_Raw ); + for ( var m = 0; m < keys.length; m ++ ) { - if (scope.loadingXdata.FrameInfo_Raw[keys[m]].ParentName === scope.nowFrameName) { + if ( scope.loadingXdata.FrameInfo_Raw[ keys[ m ] ].ParentName === scope.nowFrameName ) { - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].children.push(keys[m]); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].children.push( keys[ m ] ); } } scope.frameHierarchie.pop(); } - scope.MakeOutputGeometry(scope.nowFrameName, scope.zflg); - scope.frameStartLv = scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].FrameStartLv; - if (scope.frameHierarchie.length > 0) { + scope.MakeOutputGeometry( scope.nowFrameName, scope.zflg ); + scope.frameStartLv = scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].FrameStartLv; + if ( scope.frameHierarchie.length > 0 ) { - scope.nowFrameName = scope.frameHierarchie[scope.frameHierarchie.length - 1]; - scope.frameStartLv = scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].FrameStartLv; + scope.nowFrameName = scope.frameHierarchie[ scope.frameHierarchie.length - 1 ]; + scope.frameStartLv = scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].FrameStartLv; } else { scope.nowFrameName = ""; } - } else if (scope.nowReadMode == THREE.XLoader.XfileLoadMode.Anim_init) { + } else if ( scope.nowReadMode == THREE.XLoader.XfileLoadMode.Anim_init ) { scope.nowReadMode = THREE.XLoader.XfileLoadMode.Element; } - scope.elementLv--; + scope.elementLv --; }, - beginFrame: function (line) { + beginFrame: function ( line ) { var scope = this; scope.frameStartLv = scope.elementLv; scope.nowReadMode = THREE.XLoader.XfileLoadMode.Element; - var findindex = line.indexOf("Frame "); - scope.nowFrameName = line.substr(findindex + 6, line.length - findindex + 1).trim(); - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName] = new THREE.XLoader.XFrameInfo(); - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].FrameName = scope.nowFrameName; - if (scope.frameHierarchie.length > 0) { + var findindex = line.indexOf( "Frame " ); + scope.nowFrameName = line.substr( findindex + 6, line.length - findindex + 1 ).trim(); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ] = new THREE.XLoader.XFrameInfo(); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].FrameName = scope.nowFrameName; + if ( scope.frameHierarchie.length > 0 ) { - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].ParentName = scope.frameHierarchie[scope.frameHierarchie.length - 1]; + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].ParentName = scope.frameHierarchie[ scope.frameHierarchie.length - 1 ]; } - scope.frameHierarchie.push(scope.nowFrameName); - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].FrameStartLv = scope.frameStartLv; + scope.frameHierarchie.push( scope.nowFrameName ); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].FrameStartLv = scope.frameStartLv; }, - beginReadMesh: function (line) { + beginReadMesh: function ( line ) { var scope = this; - if (scope.nowFrameName === "") { + if ( scope.nowFrameName === "" ) { scope.frameStartLv = scope.elementLv; - scope.nowFrameName = line.substr(5, line.length - 6); - if (scope.nowFrameName === "") { + scope.nowFrameName = line.substr( 5, line.length - 6 ); + if ( scope.nowFrameName === "" ) { scope.nowFrameName = "mesh_" + scope.loadingXdata.FrameInfo_Raw.length; } - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName] = new THREE.XLoader.XFrameInfo(); - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].FrameName = scope.nowFrameName; - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].FrameStartLv = scope.frameStartLv; + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ] = new THREE.XLoader.XFrameInfo(); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].FrameName = scope.nowFrameName; + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].FrameStartLv = scope.frameStartLv; } - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Geometry = new THREE.Geometry(); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Geometry = new THREE.Geometry(); scope.geoStartLv = scope.elementLv; scope.nowReadMode = THREE.XLoader.XfileLoadMode.Vartex_init; - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Materials = []; + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Materials = []; }, - readVertexCount: function (line) { + readVertexCount: function ( line ) { var scope = this; scope.nowReadMode = THREE.XLoader.XfileLoadMode.Vartex_Read; - scope.tgtLength = parseInt(line.substr(0, line.length - 1), 10); + scope.tgtLength = parseInt( line.substr( 0, line.length - 1 ), 10 ); scope.nowReaded = 0; }, - readVertex: function (line) { + readVertex: function ( line ) { var scope = this; - var data = line.substr(0, line.length - 2).split(";"); - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Geometry.vertices.push(new THREE.Vector3(parseFloat(data[0]), parseFloat(data[1]), parseFloat(data[2]))); - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Geometry.skinIndices.push(new THREE.Vector4(0, 0, 0, 0)); - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Geometry.skinWeights.push(new THREE.Vector4(1, 0, 0, 0)); - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].VertexSetedBoneCount.push(0); - scope.nowReaded++; + var data = line.substr( 0, line.length - 2 ).split( ";" ); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Geometry.vertices.push( new THREE.Vector3( parseFloat( data[ 0 ] ), parseFloat( data[ 1 ] ), parseFloat( data[ 2 ] ) ) ); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Geometry.skinIndices.push( new THREE.Vector4( 0, 0, 0, 0 ) ); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Geometry.skinWeights.push( new THREE.Vector4( 1, 0, 0, 0 ) ); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].VertexSetedBoneCount.push( 0 ); + scope.nowReaded ++; return false; }, - readIndexLength: function (line) { + readIndexLength: function ( line ) { var scope = this; scope.nowReadMode = THREE.XLoader.XfileLoadMode.index_Read; - scope.tgtLength = parseInt(line.substr(0, line.length - 1), 10); + scope.tgtLength = parseInt( line.substr( 0, line.length - 1 ), 10 ); scope.nowReaded = 0; }, - readVertexIndex: function (line) { + readVertexIndex: function ( line ) { var scope = this; - var firstFind = line.indexOf(';') + 1; - var data = line.substr(firstFind).split(","); - if (scope.zflg) { + var firstFind = line.indexOf( ';' ) + 1; + var data = line.substr( firstFind ).split( "," ); + if ( scope.zflg ) { - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Geometry.faces.push(new THREE.Face3(parseInt(data[2], 10), parseInt(data[1], 10), parseInt(data[0], 10), new THREE.Vector3(1, 1, 1).normalize())); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Geometry.faces.push( new THREE.Face3( parseInt( data[ 2 ], 10 ), parseInt( data[ 1 ], 10 ), parseInt( data[ 0 ], 10 ), new THREE.Vector3( 1, 1, 1 ).normalize() ) ); } else { - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Geometry.faces.push(new THREE.Face3(parseInt(data[0], 10), parseInt(data[1], 10), parseInt(data[2], 10), new THREE.Vector3(1, 1, 1).normalize())); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Geometry.faces.push( new THREE.Face3( parseInt( data[ 0 ], 10 ), parseInt( data[ 1 ], 10 ), parseInt( data[ 2 ], 10 ), new THREE.Vector3( 1, 1, 1 ).normalize() ) ); } return false; }, - beginMeshNormal: function (line) { + beginMeshNormal: function ( line ) { var scope = this; scope.nowReadMode = THREE.XLoader.XfileLoadMode.Normal_V_init; @@ -764,22 +765,22 @@ THREE.XLoader.prototype = { }, - readMeshNormalCount: function (line) { + readMeshNormalCount: function ( line ) { var scope = this; scope.nowReadMode = THREE.XLoader.XfileLoadMode.Normal_V_Read; - scope.tgtLength = parseInt(line.substr(0, line.length - 1), 10); + scope.tgtLength = parseInt( line.substr( 0, line.length - 1 ), 10 ); scope.nowReaded = 0; }, - readMeshNormalVertex: function (line) { + readMeshNormalVertex: function ( line ) { var scope = this; - var data = line.split(";"); - scope.normalVectors.push([parseFloat(data[0]), parseFloat(data[1]), parseFloat(data[2])]); - scope.nowReaded++; - if (scope.nowReaded >= scope.tgtLength) { + var data = line.split( ";" ); + scope.normalVectors.push( [ parseFloat( data[ 0 ] ), parseFloat( data[ 1 ] ), parseFloat( data[ 2 ] ) ] ); + scope.nowReaded ++; + if ( scope.nowReaded >= scope.tgtLength ) { scope.nowReadMode = THREE.XLoader.XfileLoadMode.Normal_I_init; return true; @@ -789,37 +790,37 @@ THREE.XLoader.prototype = { }, - readMeshNormalIndexCount: function (line) { + readMeshNormalIndexCount: function ( line ) { var scope = this; scope.nowReadMode = THREE.XLoader.XfileLoadMode.Normal_I_Read; - scope.tgtLength = parseInt(line.substr(0, line.length - 1), 10); + scope.tgtLength = parseInt( line.substr( 0, line.length - 1 ), 10 ); scope.nowReaded = 0; }, - readMeshNormalIndex: function (line) { + readMeshNormalIndex: function ( line ) { var scope = this; - var data = line.substr(2, line.length - 4).split(","); - var nowID = parseInt(data[0], 10); - var v1 = new THREE.Vector3(scope.normalVectors[nowID][0], scope.normalVectors[nowID][1], scope.normalVectors[nowID][2]); - nowID = parseInt(data[1], 10); - var v2 = new THREE.Vector3(scope.normalVectors[nowID][0], scope.normalVectors[nowID][1], scope.normalVectors[nowID][2]); - nowID = parseInt(data[2], 10); - var v3 = new THREE.Vector3(scope.normalVectors[nowID][0], scope.normalVectors[nowID][1], scope.normalVectors[nowID][2]); - if (scope.zflg) { + var data = line.substr( 2, line.length - 4 ).split( "," ); + var nowID = parseInt( data[ 0 ], 10 ); + var v1 = new THREE.Vector3( scope.normalVectors[ nowID ][ 0 ], scope.normalVectors[ nowID ][ 1 ], scope.normalVectors[ nowID ][ 2 ] ); + nowID = parseInt( data[ 1 ], 10 ); + var v2 = new THREE.Vector3( scope.normalVectors[ nowID ][ 0 ], scope.normalVectors[ nowID ][ 1 ], scope.normalVectors[ nowID ][ 2 ] ); + nowID = parseInt( data[ 2 ], 10 ); + var v3 = new THREE.Vector3( scope.normalVectors[ nowID ][ 0 ], scope.normalVectors[ nowID ][ 1 ], scope.normalVectors[ nowID ][ 2 ] ); + if ( scope.zflg ) { - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Geometry.faces[scope.nowReaded].vertexNormals = [v3, v2, v1]; + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Geometry.faces[ scope.nowReaded ].vertexNormals = [ v3, v2, v1 ]; } else { - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Geometry.faces[scope.nowReaded].vertexNormals = [v1, v2, v3]; + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Geometry.faces[ scope.nowReaded ].vertexNormals = [ v1, v2, v3 ]; } - scope.facesNormal.push(v1.normalize()); - scope.nowReaded++; - if (scope.nowReaded >= scope.tgtLength) { + scope.facesNormal.push( v1.normalize() ); + scope.nowReaded ++; + if ( scope.nowReaded >= scope.tgtLength ) { scope.nowReadMode = THREE.XLoader.XfileLoadMode.Element; return true; @@ -829,32 +830,32 @@ THREE.XLoader.prototype = { }, - readUvInit: function (line) { + readUvInit: function ( line ) { var scope = this; scope.nowReadMode = THREE.XLoader.XfileLoadMode.Uv_Read; - scope.tgtLength = parseInt(line.substr(0, line.length - 1), 10); + scope.tgtLength = parseInt( line.substr( 0, line.length - 1 ), 10 ); scope.nowReaded = 0; scope.tmpUvArray = []; - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Geometry.faceVertexUvs[0] = []; + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Geometry.faceVertexUvs[ 0 ] = []; }, - readUv: function (line) { + readUv: function ( line ) { var scope = this; - var data = line.split(";"); - if (scope.IsUvYReverse) { + var data = line.split( ";" ); + if ( scope.IsUvYReverse ) { - scope.tmpUvArray.push(new THREE.Vector2(parseFloat(data[0]), 1 - parseFloat(data[1]))); + scope.tmpUvArray.push( new THREE.Vector2( parseFloat( data[ 0 ] ), 1 - parseFloat( data[ 1 ] ) ) ); } else { - scope.tmpUvArray.push(new THREE.Vector2(parseFloat(data[0]), parseFloat(data[1]))); + scope.tmpUvArray.push( new THREE.Vector2( parseFloat( data[ 0 ] ), parseFloat( data[ 1 ] ) ) ); } - scope.nowReaded++; - if (scope.nowReaded >= scope.tgtLength) { + scope.nowReaded ++; + if ( scope.nowReaded >= scope.tgtLength ) { return true; @@ -863,22 +864,22 @@ THREE.XLoader.prototype = { }, - readMatrixSetLength: function (line) { + readMatrixSetLength: function ( line ) { var scope = this; scope.nowReadMode = THREE.XLoader.XfileLoadMode.Mat_Face_Set; - scope.tgtLength = parseInt(line.substr(0, line.length - 1), 10); + scope.tgtLength = parseInt( line.substr( 0, line.length - 1 ), 10 ); scope.nowReaded = 0; }, - readMaterialBind: function (line) { + readMaterialBind: function ( line ) { var scope = this; - var data = line.split(","); - scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].Geometry.faces[scope.nowReaded].materialIndex = parseInt(data[0]); - scope.nowReaded++; - if (scope.nowReaded >= scope.tgtLength) { + var data = line.split( "," ); + scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].Geometry.faces[ scope.nowReaded ].materialIndex = parseInt( data[ 0 ] ); + scope.nowReaded ++; + if ( scope.nowReaded >= scope.tgtLength ) { scope.nowReadMode = THREE.XLoader.XfileLoadMode.Element; return true; @@ -888,19 +889,19 @@ THREE.XLoader.prototype = { }, - readMaterialInit: function (line) { + readMaterialInit: function ( line ) { var scope = this; scope.nowReadMode = THREE.XLoader.XfileLoadMode.Mat_Set; scope.matReadLine = 0; - scope.nowMat = new THREE.MeshPhongMaterial({ color: Math.random() * 0xffffff }); - var matName = line.substr(9, line.length - 10); - if (matName !== "") { + scope.nowMat = new THREE.MeshPhongMaterial( { color: Math.random() * 0xffffff } ); + var matName = line.substr( 9, line.length - 10 ); + if ( matName !== "" ) { scope.nowMat.name = matName; } - if (scope.zflg) { + if ( scope.zflg ) { scope.nowMat.side = THREE.BackSide; @@ -913,127 +914,127 @@ THREE.XLoader.prototype = { }, - readandSetMaterial: function (line) { + readandSetMaterial: function ( line ) { var scope = this; - var data = line.split(";"); - scope.matReadLine++; - switch (scope.matReadLine) { + var data = line.split( ";" ); + scope.matReadLine ++; + switch ( scope.matReadLine ) { case 1: - scope.nowMat.color.r = data[0]; - scope.nowMat.color.g = data[1]; - scope.nowMat.color.b = data[2]; + scope.nowMat.color.r = data[ 0 ]; + scope.nowMat.color.g = data[ 1 ]; + scope.nowMat.color.b = data[ 2 ]; break; case 2: - scope.nowMat.shininess = data[0]; + scope.nowMat.shininess = data[ 0 ]; break; case 3: - scope.nowMat.specular.r = data[0]; - scope.nowMat.specular.g = data[1]; - scope.nowMat.specular.b = data[2]; + scope.nowMat.specular.r = data[ 0 ]; + scope.nowMat.specular.g = data[ 1 ]; + scope.nowMat.specular.b = data[ 2 ]; break; case 4: - scope.nowMat.emissive.r = data[0]; - scope.nowMat.emissive.g = data[1]; - scope.nowMat.emissive.b = data[2]; + scope.nowMat.emissive.r = data[ 0 ]; + scope.nowMat.emissive.g = data[ 1 ]; + scope.nowMat.emissive.b = data[ 2 ]; break; } - if (line.indexOf("TextureFilename") > - 1) { + if ( line.indexOf( "TextureFilename" ) > - 1 ) { scope.nowReadMode = THREE.XLoader.XfileLoadMode.Mat_Set_Texture; - } else if (line.indexOf("BumpMapFilename") > - 1) { + } else if ( line.indexOf( "BumpMapFilename" ) > - 1 ) { scope.nowReadMode = THREE.XLoader.XfileLoadMode.Mat_Set_BumpTex; scope.nowMat.bumpScale = 0.05; - } else if (line.indexOf("NormalMapFilename") > - 1) { + } else if ( line.indexOf( "NormalMapFilename" ) > - 1 ) { scope.nowReadMode = THREE.XLoader.XfileLoadMode.Mat_Set_NormalTex; - scope.nowMat.normalScale = new THREE.Vector2(2, 2); + scope.nowMat.normalScale = new THREE.Vector2( 2, 2 ); - } else if (line.indexOf("EmissiveMapFilename") > - 1) { + } else if ( line.indexOf( "EmissiveMapFilename" ) > - 1 ) { scope.nowReadMode = THREE.XLoader.XfileLoadMode.Mat_Set_EmissiveTex; - } else if (line.indexOf("LightMapFilename") > - 1) { + } else if ( line.indexOf( "LightMapFilename" ) > - 1 ) { scope.nowReadMode = THREE.XLoader.XfileLoadMode.Mat_Set_LightTex; } }, - readandSetMaterialTexture: function (line) { + readandSetMaterialTexture: function ( line ) { var scope = this; - var data = line.substr(1, line.length - 3); - if (data != undefined && data.length > 0) { + var data = line.substr( 1, line.length - 3 ); + if ( data != undefined && data.length > 0 ) { - switch (scope.nowReadMode) { + switch ( scope.nowReadMode ) { case THREE.XLoader.XfileLoadMode.Mat_Set_Texture: - scope.nowMat.map = scope.Texloader.load(scope.baseDir + data); + scope.nowMat.map = scope.Texloader.load( scope.baseDir + data ); break; case THREE.XLoader.XfileLoadMode.Mat_Set_BumpTex: - scope.nowMat.bumpMap = scope.Texloader.load(scope.baseDir + data); + scope.nowMat.bumpMap = scope.Texloader.load( scope.baseDir + data ); break; case THREE.XLoader.XfileLoadMode.Mat_Set_NormalTex: - scope.nowMat.normalMap = scope.Texloader.load(scope.baseDir + data); + scope.nowMat.normalMap = scope.Texloader.load( scope.baseDir + data ); break; case THREE.XLoader.XfileLoadMode.Mat_Set_EmissiveTex: - scope.nowMat.emissiveMap = scope.Texloader.load(scope.baseDir + data); + scope.nowMat.emissiveMap = scope.Texloader.load( scope.baseDir + data ); break; case THREE.XLoader.XfileLoadMode.Mat_Set_LightTex: - scope.nowMat.lightMap = scope.Texloader.load(scope.baseDir + data); + scope.nowMat.lightMap = scope.Texloader.load( scope.baseDir + data ); break; case THREE.XLoader.XfileLoadMode.Mat_Set_EnvTex: - scope.nowMat.envMap = scope.Texloader.load(scope.baseDir + data); + scope.nowMat.envMap = scope.Texloader.load( scope.baseDir + data ); break; } } scope.nowReadMode = THREE.XLoader.XfileLoadMode.Mat_Set; - scope.endLineCount++; - scope.elementLv--; + scope.endLineCount ++; + scope.elementLv --; }, - readBoneInit: function (line) { + readBoneInit: function ( line ) { var scope = this; scope.nowReadMode = THREE.XLoader.XfileLoadMode.Weit_init; scope.BoneInf = new XboneInf(); }, - readBoneName: function (line) { + readBoneName: function ( line ) { var scope = this; scope.BoneInf.boneName = line.trim(); - scope.BoneInf.BoneIndex = scope.loadingXdata.FrameInfo_Raw[scope.nowFrameName].BoneInfs.length; + scope.BoneInf.BoneIndex = scope.loadingXdata.FrameInfo_Raw[ scope.nowFrameName ].BoneInfs.length; scope.nowReaded = 0; }, - readBoneVertexLength: function (line) { + readBoneVertexLength: function ( line ) { var scope = this; scope.nowReadMode = THREE.XLoader.XfileLoadMode.Weit_Read_Index; - scope.tgtLength = parseInt(line.substr(0, line.length - 1), 10); + scope.tgtLength = parseInt( line.substr( 0, line.length - 1 ), 10 ); scope.nowReaded = 0; }, - readandSetBoneVertex: function (line) { + readandSetBoneVertex: function ( line ) { var scope = this; - scope.BoneInf.Indeces.push(parseInt(line.substr(0, line.length - 1), 10)); - scope.nowReaded++; - if (scope.nowReaded >= scope.tgtLength || line.indexOf(";") > - 1) { + scope.BoneInf.Indeces.push( parseInt( line.substr( 0, line.length - 1 ), 10 ) ); + scope.nowReaded ++; + if ( scope.nowReaded >= scope.tgtLength || line.indexOf( ";" ) > - 1 ) { scope.nowReadMode = THREE.XLoader.XfileLoadMode.Weit_Read_Value; scope.nowReaded = 0; @@ -1042,61 +1043,60 @@ THREE.XLoader.prototype = { }, - readandSetBoneWeightValue: function (line) { + readandSetBoneWeightValue: function ( line ) { var scope = this; - var nowVal = parseFloat(line.substr(0, line.length - 1)); - scope.BoneInf.Weights.push(nowVal); - scope.nowReaded++; - if (scope.nowReaded >= scope.tgtLength || line.indexOf(";") > - 1) { + var nowVal = parseFloat( line.substr( 0, line.length - 1 ) ); + scope.BoneInf.Weights.push( nowVal ); + scope.nowReaded ++; + if ( scope.nowReaded >= scope.tgtLength || line.indexOf( ";" ) > - 1 ) { scope.nowReadMode = THREE.XLoader.XfileLoadMode.Weit_Read_Matrx; - } }, - readandCreateAnimationSet: function (line) { + readandCreateAnimationSet: function ( line ) { var scope = this; scope.frameStartLv = scope.elementLv; scope.nowReadMode = THREE.XLoader.XfileLoadMode.Anim_init; - scope.nowAnimationSetName = line.substr(13, line.length - 14).trim(); - scope.loadingXdata.AnimationSetInfo[scope.nowAnimationSetName] = []; + scope.nowAnimationSetName = line.substr( 13, line.length - 14 ).trim(); + scope.loadingXdata.AnimationSetInfo[ scope.nowAnimationSetName ] = []; }, - readAndCreateAnimation: function (line) { + readAndCreateAnimation: function ( line ) { var scope = this; - scope.nowFrameName = line.substr(10, line.length - 11).trim(); - scope.loadingXdata.AnimationSetInfo[scope.nowAnimationSetName][scope.nowFrameName] = new THREE.XLoader.XAnimationInfo(); - scope.loadingXdata.AnimationSetInfo[scope.nowAnimationSetName][scope.nowFrameName].animeName = scope.nowFrameName; - scope.loadingXdata.AnimationSetInfo[scope.nowAnimationSetName][scope.nowFrameName].FrameStartLv = scope.frameStartLv; + scope.nowFrameName = line.substr( 10, line.length - 11 ).trim(); + scope.loadingXdata.AnimationSetInfo[ scope.nowAnimationSetName ][ scope.nowFrameName ] = new THREE.XLoader.XAnimationInfo(); + scope.loadingXdata.AnimationSetInfo[ scope.nowAnimationSetName ][ scope.nowFrameName ].animeName = scope.nowFrameName; + scope.loadingXdata.AnimationSetInfo[ scope.nowAnimationSetName ][ scope.nowFrameName ].FrameStartLv = scope.frameStartLv; }, - readAnimationKeyFrameValue: function (line) { + readAnimationKeyFrameValue: function ( line ) { var scope = this; scope.keyInfo = null; - var data = line.split(";"); - if (data == null || data.length < 3) { + var data = line.split( ";" ); + if ( data == null || data.length < 3 ) { return; } - var nowKeyframe = parseInt(data[0], 10); + var nowKeyframe = parseInt( data[ 0 ], 10 ); var frameFound = false; var tmpM = new THREE.Matrix4(); - if (scope.nowAnimationKeyType != 4) { + if ( scope.nowAnimationKeyType != 4 ) { - for (var mm = 0; mm < scope.loadingXdata.AnimationSetInfo[scope.nowAnimationSetName][scope.nowFrameName].keyFrames.length; mm++) { + for ( var mm = 0; mm < scope.loadingXdata.AnimationSetInfo[ scope.nowAnimationSetName ][ scope.nowFrameName ].keyFrames.length; mm ++ ) { - if (scope.loadingXdata.AnimationSetInfo[scope.nowAnimationSetName][scope.nowFrameName].keyFrames[mm].Frame === nowKeyframe) { + if ( scope.loadingXdata.AnimationSetInfo[ scope.nowAnimationSetName ][ scope.nowFrameName ].keyFrames[ mm ].Frame === nowKeyframe ) { - scope.keyInfo = scope.loadingXdata.AnimationSetInfo[scope.nowAnimationSetName][scope.nowFrameName].keyFrames[mm]; + scope.keyInfo = scope.loadingXdata.AnimationSetInfo[ scope.nowAnimationSetName ][ scope.nowFrameName ].keyFrames[ mm ]; frameFound = true; break; @@ -1105,39 +1105,39 @@ THREE.XLoader.prototype = { } } - if (!frameFound) { + if ( ! frameFound ) { scope.keyInfo = new THREE.XLoader.XKeyFrameInfo(); scope.keyInfo.matrix = new THREE.Matrix4(); scope.keyInfo.Frame = nowKeyframe; } - var data2 = data[2].split(","); - switch (scope.nowAnimationKeyType) { + var data2 = data[ 2 ].split( "," ); + switch ( scope.nowAnimationKeyType ) { case 0: - tmpM.makeRotationFromQuaternion(new THREE.Quaternion(parseFloat(data2[0]), parseFloat(data2[1]), parseFloat(data2[2]), parseFloat(data2[3]))); - scope.keyInfo.matrix.multiply(tmpM); + tmpM.makeRotationFromQuaternion( new THREE.Quaternion( parseFloat( data2[ 0 ] ), parseFloat( data2[ 1 ] ), parseFloat( data2[ 2 ] ), parseFloat( data2[ 3 ] ) ) ); + scope.keyInfo.matrix.multiply( tmpM ); break; case 1: - tmpM.makeScale(parseFloat(data2[0]), parseFloat(data2[1]), parseFloat(data2[2])); - scope.keyInfo.matrix.multiply(tmpM); + tmpM.makeScale( parseFloat( data2[ 0 ] ), parseFloat( data2[ 1 ] ), parseFloat( data2[ 2 ] ) ); + scope.keyInfo.matrix.multiply( tmpM ); break; case 2: - tmpM.makeTranslation(parseFloat(data2[0]), parseFloat(data2[1]), parseFloat(data2[2])); - scope.keyInfo.matrix.multiply(tmpM); + tmpM.makeTranslation( parseFloat( data2[ 0 ] ), parseFloat( data2[ 1 ] ), parseFloat( data2[ 2 ] ) ); + scope.keyInfo.matrix.multiply( tmpM ); break; case 3: case 4: - scope.ParseMatrixData(scope.keyInfo.matrix, data2); + scope.ParseMatrixData( scope.keyInfo.matrix, data2 ); break; } - if (!frameFound) { + if ( ! frameFound ) { - scope.keyInfo.index = scope.loadingXdata.AnimationSetInfo[scope.nowAnimationSetName][scope.nowFrameName].keyFrames.length; + scope.keyInfo.index = scope.loadingXdata.AnimationSetInfo[ scope.nowAnimationSetName ][ scope.nowFrameName ].keyFrames.length; scope.keyInfo.time = /*1.0 / scope.loadingXdata.AnimTicksPerSecond * */scope.keyInfo.Frame; - scope.loadingXdata.AnimationSetInfo[scope.nowAnimationSetName][scope.nowFrameName].keyFrames.push(scope.keyInfo); + scope.loadingXdata.AnimationSetInfo[ scope.nowAnimationSetName ][ scope.nowFrameName ].keyFrames.push( scope.keyInfo ); } @@ -1147,26 +1147,26 @@ THREE.XLoader.prototype = { var scope = this; scope.loadingXdata.FrameInfo = []; - var keys = Object.keys(scope.loadingXdata.FrameInfo_Raw); - for (var i = 0; i < keys.length; i++) { + var keys = Object.keys( scope.loadingXdata.FrameInfo_Raw ); + for ( var i = 0; i < keys.length; i ++ ) { - if (scope.loadingXdata.FrameInfo_Raw[keys[i]].Mesh != null) { + if ( scope.loadingXdata.FrameInfo_Raw[ keys[ i ] ].Mesh != null ) { - scope.loadingXdata.FrameInfo.push(scope.loadingXdata.FrameInfo_Raw[keys[i]].Mesh); + scope.loadingXdata.FrameInfo.push( scope.loadingXdata.FrameInfo_Raw[ keys[ i ] ].Mesh ); } } - if (scope.loadingXdata.FrameInfo != null & scope.loadingXdata.FrameInfo.length > 0) { + if ( scope.loadingXdata.FrameInfo != null & scope.loadingXdata.FrameInfo.length > 0 ) { - for (var _i4 = 0; _i4 < scope.loadingXdata.FrameInfo.length; _i4++) { + for ( var _i4 = 0; _i4 < scope.loadingXdata.FrameInfo.length; _i4 ++ ) { - if (scope.loadingXdata.FrameInfo[_i4].parent == null) { + if ( scope.loadingXdata.FrameInfo[ _i4 ].parent == null ) { - scope.loadingXdata.FrameInfo[_i4].zflag = scope.zflg; - if (scope.zflg) { + scope.loadingXdata.FrameInfo[ _i4 ].zflag = scope.zflg; + if ( scope.zflg ) { - scope.loadingXdata.FrameInfo[_i4].scale.set(- 1, 1, 1); + scope.loadingXdata.FrameInfo[ _i4 ].scale.set( - 1, 1, 1 ); } @@ -1178,67 +1178,67 @@ THREE.XLoader.prototype = { }, - ParseMatrixData: function (targetMatrix, data) { + ParseMatrixData: function ( targetMatrix, data ) { - targetMatrix.set(parseFloat(data[0]), parseFloat(data[4]), parseFloat(data[8]), parseFloat(data[12]), parseFloat(data[1]), parseFloat(data[5]), parseFloat(data[9]), parseFloat(data[13]), parseFloat(data[2]), parseFloat(data[6]), parseFloat(data[10]), parseFloat(data[14]), parseFloat(data[3]), parseFloat(data[7]), parseFloat(data[11]), parseFloat(data[15])); + targetMatrix.set( parseFloat( data[ 0 ] ), parseFloat( data[ 4 ] ), parseFloat( data[ 8 ] ), parseFloat( data[ 12 ] ), parseFloat( data[ 1 ] ), parseFloat( data[ 5 ] ), parseFloat( data[ 9 ] ), parseFloat( data[ 13 ] ), parseFloat( data[ 2 ] ), parseFloat( data[ 6 ] ), parseFloat( data[ 10 ] ), parseFloat( data[ 14 ] ), parseFloat( data[ 3 ] ), parseFloat( data[ 7 ] ), parseFloat( data[ 11 ] ), parseFloat( data[ 15 ] ) ); }, - MakeOutputGeometry: function (nowFrameName, _zflg) { + MakeOutputGeometry: function ( nowFrameName, _zflg ) { var scope = this; - if (scope.loadingXdata.FrameInfo_Raw[nowFrameName].Geometry != null) { + if ( scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Geometry != null ) { - scope.loadingXdata.FrameInfo_Raw[nowFrameName].Geometry.computeBoundingBox(); - scope.loadingXdata.FrameInfo_Raw[nowFrameName].Geometry.computeBoundingSphere(); - if (!scope.loadingXdata.faceNormalFromFile) { + scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Geometry.computeBoundingBox(); + scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Geometry.computeBoundingSphere(); + if ( ! scope.loadingXdata.faceNormalFromFile ) { - scope.loadingXdata.FrameInfo_Raw[nowFrameName].Geometry.computeFaceNormals(); + scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Geometry.computeFaceNormals(); } - if (!scope.loadingXdata.vertexNormalFromFile) { + if ( ! scope.loadingXdata.vertexNormalFromFile ) { - scope.loadingXdata.FrameInfo_Raw[nowFrameName].Geometry.computeVertexNormals(); + scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Geometry.computeVertexNormals(); } - scope.loadingXdata.FrameInfo_Raw[nowFrameName].Geometry.verticesNeedUpdate = true; - scope.loadingXdata.FrameInfo_Raw[nowFrameName].Geometry.normalsNeedUpdate = true; - scope.loadingXdata.FrameInfo_Raw[nowFrameName].Geometry.colorsNeedUpdate = true; - scope.loadingXdata.FrameInfo_Raw[nowFrameName].Geometry.uvsNeedUpdate = true; - scope.loadingXdata.FrameInfo_Raw[nowFrameName].Geometry.groupsNeedUpdate = true; + scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Geometry.verticesNeedUpdate = true; + scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Geometry.normalsNeedUpdate = true; + scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Geometry.colorsNeedUpdate = true; + scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Geometry.uvsNeedUpdate = true; + scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Geometry.groupsNeedUpdate = true; var putBones = []; var BoneInverse = []; var BoneDics = []; var rootBone = new THREE.Bone(); - if (scope.loadingXdata.FrameInfo_Raw[nowFrameName].BoneInfs != null && scope.loadingXdata.FrameInfo_Raw[nowFrameName].BoneInfs.length) { + if ( scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].BoneInfs != null && scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].BoneInfs.length ) { - var keys = Object.keys(scope.loadingXdata.FrameInfo_Raw); + var keys = Object.keys( scope.loadingXdata.FrameInfo_Raw ); var BoneDics_Name = []; - for (var m = 0; m < keys.length; m++) { + for ( var m = 0; m < keys.length; m ++ ) { - if (scope.loadingXdata.FrameInfo_Raw[keys[m]].FrameStartLv <= scope.loadingXdata.FrameInfo_Raw[nowFrameName].FrameStartLv && nowFrameName != keys[m]) { + if ( scope.loadingXdata.FrameInfo_Raw[ keys[ m ] ].FrameStartLv <= scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].FrameStartLv && nowFrameName != keys[ m ] ) { continue; } var b = new THREE.Bone(); - b.name = keys[m]; - b.applyMatrix(scope.loadingXdata.FrameInfo_Raw[keys[m]].FrameTransformMatrix); - BoneDics_Name[b.name] = putBones.length; - putBones.push(b); + b.name = keys[ m ]; + b.applyMatrix( scope.loadingXdata.FrameInfo_Raw[ keys[ m ] ].FrameTransformMatrix ); + BoneDics_Name[ b.name ] = putBones.length; + putBones.push( b ); var ivm = new THREE.Matrix4(); - ivm.getInverse(scope.loadingXdata.FrameInfo_Raw[keys[m]].FrameTransformMatrix); - BoneInverse.push(ivm); + ivm.getInverse( scope.loadingXdata.FrameInfo_Raw[ keys[ m ] ].FrameTransformMatrix ); + BoneInverse.push( ivm ); } - for (var _m = 0; _m < putBones.length; _m++) { + for ( var _m = 0; _m < putBones.length; _m ++ ) { - for (var dx = 0; dx < scope.loadingXdata.FrameInfo_Raw[putBones[_m].name].children.length; dx++) { + for ( var dx = 0; dx < scope.loadingXdata.FrameInfo_Raw[ putBones[ _m ].name ].children.length; dx ++ ) { - var nowBoneIndex = BoneDics_Name[scope.loadingXdata.FrameInfo_Raw[putBones[_m].name].children[dx]]; - if (putBones[nowBoneIndex] != null) { + var nowBoneIndex = BoneDics_Name[ scope.loadingXdata.FrameInfo_Raw[ putBones[ _m ].name ].children[ dx ] ]; + if ( putBones[ nowBoneIndex ] != null ) { - putBones[_m].add(putBones[nowBoneIndex]); + putBones[ _m ].add( putBones[ nowBoneIndex ] ); } @@ -1249,50 +1249,50 @@ THREE.XLoader.prototype = { } var mesh = null; var bufferGeometry = new THREE.BufferGeometry(); - if (putBones.length > 0) { + if ( putBones.length > 0 ) { - if (scope.loadingXdata.FrameInfo_Raw[putBones[0].name].children.length === 0 && nowFrameName != putBones[0].name) { + if ( scope.loadingXdata.FrameInfo_Raw[ putBones[ 0 ].name ].children.length === 0 && nowFrameName != putBones[ 0 ].name ) { - putBones[0].add(putBones[1]); - putBones[0].zflag = _zflg; + putBones[ 0 ].add( putBones[ 1 ] ); + putBones[ 0 ].zflag = _zflg; } - for (var _m2 = 0; _m2 < putBones.length; _m2++) { + for ( var _m2 = 0; _m2 < putBones.length; _m2 ++ ) { - if (putBones[_m2].parent === null) { + if ( putBones[ _m2 ].parent === null ) { - putBones[_m2].zflag = _zflg; + putBones[ _m2 ].zflag = _zflg; } - for (var bi = 0; bi < scope.loadingXdata.FrameInfo_Raw[nowFrameName].BoneInfs.length; bi++) { + for ( var bi = 0; bi < scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].BoneInfs.length; bi ++ ) { - if (putBones[_m2].name === scope.loadingXdata.FrameInfo_Raw[nowFrameName].BoneInfs[bi].boneName) { + if ( putBones[ _m2 ].name === scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].BoneInfs[ bi ].boneName ) { - for (var vi = 0; vi < scope.loadingXdata.FrameInfo_Raw[nowFrameName].BoneInfs[bi].Indeces.length; vi++) { + for ( var vi = 0; vi < scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].BoneInfs[ bi ].Indeces.length; vi ++ ) { - var nowVertexID = scope.loadingXdata.FrameInfo_Raw[nowFrameName].BoneInfs[bi].Indeces[vi]; - var nowVal = scope.loadingXdata.FrameInfo_Raw[nowFrameName].BoneInfs[bi].Weights[vi]; - switch (scope.loadingXdata.FrameInfo_Raw[nowFrameName].VertexSetedBoneCount[nowVertexID]) { + var nowVertexID = scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].BoneInfs[ bi ].Indeces[ vi ]; + var nowVal = scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].BoneInfs[ bi ].Weights[ vi ]; + switch ( scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].VertexSetedBoneCount[ nowVertexID ] ) { case 0: - scope.loadingXdata.FrameInfo_Raw[nowFrameName].Geometry.skinIndices[nowVertexID].x = _m2; - scope.loadingXdata.FrameInfo_Raw[nowFrameName].Geometry.skinWeights[nowVertexID].x = nowVal; + scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Geometry.skinIndices[ nowVertexID ].x = _m2; + scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Geometry.skinWeights[ nowVertexID ].x = nowVal; break; case 1: - scope.loadingXdata.FrameInfo_Raw[nowFrameName].Geometry.skinIndices[nowVertexID].y = _m2; - scope.loadingXdata.FrameInfo_Raw[nowFrameName].Geometry.skinWeights[nowVertexID].y = nowVal; + scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Geometry.skinIndices[ nowVertexID ].y = _m2; + scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Geometry.skinWeights[ nowVertexID ].y = nowVal; break; case 2: - scope.loadingXdata.FrameInfo_Raw[nowFrameName].Geometry.skinIndices[nowVertexID].z = _m2; - scope.loadingXdata.FrameInfo_Raw[nowFrameName].Geometry.skinWeights[nowVertexID].z = nowVal; + scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Geometry.skinIndices[ nowVertexID ].z = _m2; + scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Geometry.skinWeights[ nowVertexID ].z = nowVal; break; case 3: - scope.loadingXdata.FrameInfo_Raw[nowFrameName].Geometry.skinIndices[nowVertexID].w = _m2; - scope.loadingXdata.FrameInfo_Raw[nowFrameName].Geometry.skinWeights[nowVertexID].w = nowVal; + scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Geometry.skinIndices[ nowVertexID ].w = _m2; + scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Geometry.skinWeights[ nowVertexID ].w = nowVal; break; } - scope.loadingXdata.FrameInfo_Raw[nowFrameName].VertexSetedBoneCount[nowVertexID]++; + scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].VertexSetedBoneCount[ nowVertexID ] ++; } break; @@ -1302,24 +1302,24 @@ THREE.XLoader.prototype = { } } - for (var sk = 0; sk < scope.loadingXdata.FrameInfo_Raw[nowFrameName].Materials.length; sk++) { + for ( var sk = 0; sk < scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Materials.length; sk ++ ) { - scope.loadingXdata.FrameInfo_Raw[nowFrameName].Materials[sk].skinning = true; + scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Materials[ sk ].skinning = true; } - mesh = new THREE.SkinnedMesh(bufferGeometry.fromGeometry(scope.loadingXdata.FrameInfo_Raw[nowFrameName].Geometry), scope.loadingXdata.FrameInfo_Raw[nowFrameName].Materials); - var skeleton = new THREE.Skeleton(putBones /*, BoneInverse*/); - mesh.add(putBones[0]); - mesh.bind(skeleton); + mesh = new THREE.SkinnedMesh( bufferGeometry.fromGeometry( scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Geometry ), scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Materials ); + var skeleton = new THREE.Skeleton( putBones /*, BoneInverse*/ ); + mesh.add( putBones[ 0 ] ); + mesh.bind( skeleton ); } else { - mesh = new THREE.Mesh(bufferGeometry.fromGeometry(scope.loadingXdata.FrameInfo_Raw[nowFrameName].Geometry), scope.loadingXdata.FrameInfo_Raw[nowFrameName].Materials); + mesh = new THREE.Mesh( bufferGeometry.fromGeometry( scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Geometry ), scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Materials ); } mesh.name = nowFrameName; - scope.loadingXdata.FrameInfo_Raw[nowFrameName].Mesh = mesh; - scope.loadingXdata.FrameInfo_Raw[nowFrameName].Geometry = null; + scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Mesh = mesh; + scope.loadingXdata.FrameInfo_Raw[ nowFrameName ].Geometry = null; } @@ -1328,8 +1328,8 @@ THREE.XLoader.prototype = { animationFinalize: function () { var scope = this; - scope.animeKeyNames = Object.keys(scope.loadingXdata.AnimationSetInfo); - if (scope.animeKeyNames != null && scope.animeKeyNames.length > 0) { + scope.animeKeyNames = Object.keys( scope.loadingXdata.AnimationSetInfo ); + if ( scope.animeKeyNames != null && scope.animeKeyNames.length > 0 ) { scope.nowReaded = 0; scope.loadingXdata.XAnimationObj = []; @@ -1339,7 +1339,6 @@ THREE.XLoader.prototype = { scope.finalproc(); - } }, @@ -1348,29 +1347,29 @@ THREE.XLoader.prototype = { var scope = this; var i = scope.nowReaded; - var keys = Object.keys(scope.loadingXdata.FrameInfo_Raw); + var keys = Object.keys( scope.loadingXdata.FrameInfo_Raw ); var tgtModel = null; - for (var m = 0; m < scope.loadingXdata.FrameInfo.length; m++) { + for ( var m = 0; m < scope.loadingXdata.FrameInfo.length; m ++ ) { - var keys2 = Object.keys(scope.loadingXdata.AnimationSetInfo[scope.animeKeyNames[i]]); - if (scope.loadingXdata.AnimationSetInfo[scope.animeKeyNames[i]][keys2[0]].boneName == scope.loadingXdata.FrameInfo[m].name) { + var keys2 = Object.keys( scope.loadingXdata.AnimationSetInfo[ scope.animeKeyNames[ i ] ] ); + if ( scope.loadingXdata.AnimationSetInfo[ scope.animeKeyNames[ i ] ][ keys2[ 0 ] ].boneName == scope.loadingXdata.FrameInfo[ m ].name ) { - tgtModel = scope.loadingXdata.FrameInfo[m]; + tgtModel = scope.loadingXdata.FrameInfo[ m ]; break; } } - if (tgtModel != null) { + if ( tgtModel != null ) { - scope.loadingXdata.XAnimationObj[i] = new THREE.XLoader.XAnimationObj(); - scope.loadingXdata.XAnimationObj[i].fps = scope.loadingXdata.AnimTicksPerSecond; - scope.loadingXdata.XAnimationObj[i].name = scope.animeKeyNames[i]; - scope.loadingXdata.XAnimationObj[i].make(scope.loadingXdata.AnimationSetInfo[scope.animeKeyNames[i]], tgtModel); + scope.loadingXdata.XAnimationObj[ i ] = new THREE.XLoader.XAnimationObj(); + scope.loadingXdata.XAnimationObj[ i ].fps = scope.loadingXdata.AnimTicksPerSecond; + scope.loadingXdata.XAnimationObj[ i ].name = scope.animeKeyNames[ i ]; + scope.loadingXdata.XAnimationObj[ i ].make( scope.loadingXdata.AnimationSetInfo[ scope.animeKeyNames[ i ] ], tgtModel ); } - scope.nowReaded++; - if (scope.nowReaded >= scope.animeKeyNames.length) { + scope.nowReaded ++; + if ( scope.nowReaded >= scope.animeKeyNames.length ) { scope.loadingXdata.AnimationSetInfo = null; scope.finalproc(); @@ -1386,11 +1385,11 @@ THREE.XLoader.prototype = { finalproc: function () { var scope = this; - setTimeout(function () { + setTimeout( function () { - scope.onLoad(scope.loadingXdata); + scope.onLoad( scope.loadingXdata ); - }, 1); + }, 1 ); } }; @@ -1433,7 +1432,6 @@ THREE.XLoader.XfileLoadMode = { Anime_ReadKeyFrame: 1005 }; - THREE.XLoader.XAnimationObj = function () { this.fps = 30; @@ -1447,67 +1445,67 @@ THREE.XLoader.XAnimationObj.prototype = { constructor: THREE.XLoader.XAnimationObj, - make: function (XAnimationInfoArray, mesh) { + make: function ( XAnimationInfoArray, mesh ) { var scope = this; - var keys = Object.keys(XAnimationInfoArray); + var keys = Object.keys( XAnimationInfoArray ); var hierarchy_tmp = []; - for (var i = 0; i < keys.length; i++) { + for ( var i = 0; i < keys.length; i ++ ) { var bone = null; var parent = - 1; var baseIndex = - 1; - for (var m = 0; m < mesh.skeleton.bones.length; m++) { + for ( var m = 0; m < mesh.skeleton.bones.length; m ++ ) { - if (mesh.skeleton.bones[m].name == XAnimationInfoArray[keys[i]].boneName) { + if ( mesh.skeleton.bones[ m ].name == XAnimationInfoArray[ keys[ i ] ].boneName ) { - bone = XAnimationInfoArray[keys[i]]; - parent = mesh.skeleton.bones[m].parent.name; + bone = XAnimationInfoArray[ keys[ i ] ]; + parent = mesh.skeleton.bones[ m ].parent.name; baseIndex = m; break; } } - hierarchy_tmp[baseIndex] = scope.makeBonekeys(XAnimationInfoArray[keys[i]], bone, parent); + hierarchy_tmp[ baseIndex ] = scope.makeBonekeys( XAnimationInfoArray[ keys[ i ] ], bone, parent ); } - var keys2 = Object.keys(hierarchy_tmp); - for (var _i = 0; _i < keys2.length; _i++) { + var keys2 = Object.keys( hierarchy_tmp ); + for ( var _i = 0; _i < keys2.length; _i ++ ) { - scope.hierarchy.push(hierarchy_tmp[_i]); + scope.hierarchy.push( hierarchy_tmp[ _i ] ); var parentId = - 1; - for (var _m = 0; _m < scope.hierarchy.length; _m++) { + for ( var _m = 0; _m < scope.hierarchy.length; _m ++ ) { - if (_i != _m && scope.hierarchy[_i].parent === scope.hierarchy[_m].name) { + if ( _i != _m && scope.hierarchy[ _i ].parent === scope.hierarchy[ _m ].name ) { parentId = _m; break; } } - scope.hierarchy[_i].parent = parentId; + scope.hierarchy[ _i ].parent = parentId; } }, - makeBonekeys: function (XAnimationInfo, bone, parent) { + makeBonekeys: function ( XAnimationInfo, bone, parent ) { var refObj = {}; refObj.name = bone.boneName; refObj.parent = parent; refObj.keys = []; - for (var i = 0; i < XAnimationInfo.keyFrames.length; i++) { + for ( var i = 0; i < XAnimationInfo.keyFrames.length; i ++ ) { var keyframe = {}; - keyframe.time = XAnimationInfo.keyFrames[i].time * this.fps; - keyframe.matrix = XAnimationInfo.keyFrames[i].matrix; - keyframe.pos = new THREE.Vector3().setFromMatrixPosition(keyframe.matrix); - keyframe.rot = new THREE.Quaternion().setFromRotationMatrix(keyframe.matrix); - keyframe.scl = new THREE.Vector3().setFromMatrixScale(keyframe.matrix); - refObj.keys.push(keyframe); + keyframe.time = XAnimationInfo.keyFrames[ i ].time * this.fps; + keyframe.matrix = XAnimationInfo.keyFrames[ i ].matrix; + keyframe.pos = new THREE.Vector3().setFromMatrixPosition( keyframe.matrix ); + keyframe.rot = new THREE.Quaternion().setFromRotationMatrix( keyframe.matrix ); + keyframe.scl = new THREE.Vector3().setFromMatrixScale( keyframe.matrix ); + refObj.keys.push( keyframe ); } return refObj;
false
Other
mrdoob
three.js
002893a99361a4cfe3e266bf188982e49cc01c78.json
Update GLTFLoader documentation
docs/examples/loaders/GLTFLoader.html
@@ -99,9 +99,9 @@ <h2>Methods</h2> <h3>[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3> <div> [page:String url] — A string containing the path/URL of the <em>.gltf</em> or <em>.glb</em> file.<br /> - [page:Function onLoad] — (optional) A function to be called after the loading is successfully completed. The function receives the loaded JSON response returned from [page:Function parse].<br /> + [page:Function onLoad] — A function to be called after the loading is successfully completed. The function receives the loaded JSON response returned from [page:Function parse].<br /> [page:Function onProgress] — (optional) A function to be called while the loading is in progress. The argument will be the XMLHttpRequest instance, that contains .[page:Integer total] and .[page:Integer loaded] bytes.<br /> - [page:Function onError] — (optional) A function to be called if an error occurs during loading. The function receives error as an argument.<br /> + [page:Function onError] — A function to be called if an error occurs during loading. The function receives error as an argument.<br /> </div> <div> Begin loading from url and call the callback function with the parsed response content. @@ -125,7 +125,7 @@ <h3>[method:null parse]( [page:ArrayBuffer data], [page:String path], [page:Func [page:ArrayBuffer data] — glTF asset to parse, as an ArrayBuffer or <em>JSON</em> string.<br /> [page:String path] — The base path from which to find subsequent glTF resources such as textures and .bin data files.<br /> [page:Function onLoad] — A function to be called when parse completes.<br /> - [page:Function onError] — (optional) A function to be called if an error occurs during parsing. The function receives error as an argument.<br /> + [page:Function onError] — A function to be called if an error occurs during parsing. The function receives error as an argument.<br /> </div> <div> Parse a glTF-based ArrayBuffer or <em>JSON</em> String and fire [page:Function onLoad] callback when complete. The argument to [page:Function onLoad] will be an [page:object] that contains loaded parts: .[page:Scene scene], .[page:Array scenes], .[page:Array cameras], and .[page:Array animations].
false
Other
mrdoob
three.js
2138f8154660b5dc760d598cd01bdf37786f88e5.json
Add try-catch for GLTFBinaryExtension
examples/js/loaders/GLTFLoader.js
@@ -78,7 +78,17 @@ THREE.GLTFLoader = ( function () { if ( magic === BINARY_EXTENSION_HEADER_MAGIC ) { - extensions[ EXTENSIONS.KHR_BINARY_GLTF ] = new GLTFBinaryExtension( data ); + try { + + extensions[ EXTENSIONS.KHR_BINARY_GLTF ] = new GLTFBinaryExtension( data ); + + } catch ( error ) { + + onError( error ); + return; + + } + content = extensions[ EXTENSIONS.KHR_BINARY_GLTF ].content; } else {
false
Other
mrdoob
three.js
5f997d3169f1b0d270eea10da9d1cf98ddfc1bcc.json
Apply the review comment to error message
examples/js/loaders/GLTFLoader.js
@@ -1438,7 +1438,7 @@ THREE.GLTFLoader = ( function () { loader.load( resolveURL( bufferDef.uri, options.path ), resolve, undefined, function () { - reject( new Error( 'THREE.GLTFLoader: Failed to load Buffer "' + bufferDef.uri + '".' ) ); + reject( new Error( 'THREE.GLTFLoader: Failed to load buffer "' + bufferDef.uri + '".' ) ); } );
false
Other
mrdoob
three.js
d58163a5fa8faa477e5c43fc73a40cb48d8866a0.json
Add missings async assert timeout
test/unit/editor/old_to_convert/Serialization.tests.js
@@ -7,6 +7,8 @@ QUnit.module( "Serialization" ); QUnit.test( "Test Serialization", function( assert ) { + assert.timeout( 1000 ); + // setup var editor = new Editor(); var done = assert.async();
true
Other
mrdoob
three.js
d58163a5fa8faa477e5c43fc73a40cb48d8866a0.json
Add missings async assert timeout
test/unit/src/core/BufferGeometry.tests.js
@@ -547,6 +547,8 @@ export default QUnit.module( 'Core', () => { QUnit.test( "fromGeometry/fromDirectGeometry", ( assert ) => { + assert.timeout( 1000 ); + var a = new BufferGeometry(); // BoxGeometry is a bit too simple but works fine in a pinch // var b = new BoxGeometry( 1, 1, 1 );
true
Other
mrdoob
three.js
d58163a5fa8faa477e5c43fc73a40cb48d8866a0.json
Add missings async assert timeout
test/unit/src/core/DirectGeometry.tests.js
@@ -48,6 +48,8 @@ export default QUnit.module( 'Core', () => { QUnit.test( "fromGeometry", ( assert ) => { + assert.timeout( 1000 ); + var a = new DirectGeometry(); var asyncDone = assert.async(); // tell QUnit when we're done with async stuff @@ -237,7 +239,16 @@ export default QUnit.module( 'Core', () => { asyncDone(); - } ); + }, onProgress, onError ); + + function onProgress() {} + + function onError( error ) { + + console.error( error ); + asyncDone(); + + } } );
true
Other
mrdoob
three.js
59111f17c3244900fdc407e0d3053b4dee76eab0.json
Build unit tests
test/unit/three.editor.unit.js
@@ -1167,7 +1167,7 @@ option.setTextContent( 'Plane' ); option.onClick( function () { - var geometry = new THREE.PlaneBufferGeometry( 2, 2 ); + var geometry = new THREE.PlaneBufferGeometry( 1, 1, 1, 1 ); var material = new THREE.MeshStandardMaterial(); var mesh = new THREE.Mesh( geometry, material ); mesh.name = 'Plane ' + ( ++ meshCount ); @@ -1184,7 +1184,7 @@ option.setTextContent( 'Box' ); option.onClick( function () { - var geometry = new THREE.BoxBufferGeometry( 1, 1, 1 ); + var geometry = new THREE.BoxBufferGeometry( 1, 1, 1, 1, 1, 1 ); var mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial() ); mesh.name = 'Box ' + ( ++ meshCount ); @@ -1200,10 +1200,7 @@ option.setTextContent( 'Circle' ); option.onClick( function () { - var radius = 1; - var segments = 32; - - var geometry = new THREE.CircleBufferGeometry( radius, segments ); + var geometry = new THREE.CircleBufferGeometry( 1, 8, 0, Math.PI * 2 ); var mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial() ); mesh.name = 'Circle ' + ( ++ meshCount ); @@ -1219,14 +1216,7 @@ option.setTextContent( 'Cylinder' ); option.onClick( function () { - var radiusTop = 1; - var radiusBottom = 1; - var height = 2; - var radiusSegments = 32; - var heightSegments = 1; - var openEnded = false; - - var geometry = new THREE.CylinderBufferGeometry( radiusTop, radiusBottom, height, radiusSegments, heightSegments, openEnded ); + var geometry = new THREE.CylinderBufferGeometry( 1, 1, 1, 8, 1, false, 0, Math.PI * 2 ); var mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial() ); mesh.name = 'Cylinder ' + ( ++ meshCount ); @@ -1242,15 +1232,7 @@ option.setTextContent( 'Sphere' ); option.onClick( function () { - var radius = 1; - var widthSegments = 32; - var heightSegments = 16; - var phiStart = 0; - var phiLength = Math.PI * 2; - var thetaStart = 0; - var thetaLength = Math.PI; - - var geometry = new THREE.SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ); + var geometry = new THREE.SphereBufferGeometry( 1, 8, 6, 0, Math.PI * 2, 0, Math.PI ); var mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial() ); mesh.name = 'Sphere ' + ( ++ meshCount ); @@ -1266,10 +1248,7 @@ option.setTextContent( 'Icosahedron' ); option.onClick( function () { - var radius = 1; - var detail = 2; - - var geometry = new THREE.IcosahedronGeometry( radius, detail ); + var geometry = new THREE.IcosahedronGeometry( 1, 0 ); var mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial() ); mesh.name = 'Icosahedron ' + ( ++ meshCount ); @@ -1285,13 +1264,7 @@ option.setTextContent( 'Torus' ); option.onClick( function () { - var radius = 2; - var tube = 1; - var radialSegments = 32; - var tubularSegments = 12; - var arc = Math.PI * 2; - - var geometry = new THREE.TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc ); + var geometry = new THREE.TorusBufferGeometry( 1, 0.4, 8, 6, Math.PI * 2 ); var mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial() ); mesh.name = 'Torus ' + ( ++ meshCount ); @@ -1307,14 +1280,7 @@ option.setTextContent( 'TorusKnot' ); option.onClick( function () { - var radius = 2; - var tube = 0.8; - var tubularSegments = 64; - var radialSegments = 12; - var p = 2; - var q = 3; - - var geometry = new THREE.TorusKnotBufferGeometry( radius, tube, tubularSegments, radialSegments, p, q ); + var geometry = new THREE.TorusKnotBufferGeometry( 1, 0.4, 64, 8, 2, 3 ); var mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial() ); mesh.name = 'TorusKnot ' + ( ++ meshCount ); @@ -1361,22 +1327,19 @@ var points = [ new THREE.Vector2( 0, 0 ), - new THREE.Vector2( 4, 0 ), - new THREE.Vector2( 3.5, 0.5 ), - new THREE.Vector2( 1, 0.75 ), - new THREE.Vector2( 0.8, 1 ), - new THREE.Vector2( 0.8, 4 ), - new THREE.Vector2( 1, 4.2 ), - new THREE.Vector2( 1.4, 4.8 ), - new THREE.Vector2( 2, 5 ), - new THREE.Vector2( 2.5, 5.4 ), - new THREE.Vector2( 3, 12 ) + new THREE.Vector2( 0.4, 0 ), + new THREE.Vector2( 0.35, 0.05 ), + new THREE.Vector2( 0.1, 0.075 ), + new THREE.Vector2( 0.08, 0.1 ), + new THREE.Vector2( 0.08, 0.4 ), + new THREE.Vector2( 0.1, 0.42 ), + new THREE.Vector2( 0.14, 0.48 ), + new THREE.Vector2( 0.2, 0.5 ), + new THREE.Vector2( 0.25, 0.54 ), + new THREE.Vector2( 0.3, 1.2 ) ]; - var segments = 20; - var phiStart = 0; - var phiLength = 2 * Math.PI; - var geometry = new THREE.LatheBufferGeometry( points, segments, phiStart, phiLength ); + var geometry = new THREE.LatheBufferGeometry( points, 12, 0, Math.PI * 2 ); var mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial( { side: THREE.DoubleSide } ) ); mesh.name = 'Lathe ' + ( ++ meshCount ); @@ -2142,6 +2105,23 @@ content = content.replace( '<!-- includes -->', includes.join( '\n\t\t' ) ); + var editButton = ''; + + if ( editor.config.getKey( 'project/editable' ) ) { + + editButton = ` + var button = document.createElement( 'a' ); + button.href = 'https://threejs.org/editor/#file=' + location.href.split( '/' ).slice( 0, - 1 ).join( '/' ) + '/app.json'; + button.style.cssText = 'position: absolute; bottom: 20px; right: 20px; padding: 7px 10px 6px 10px; color: #fff; border: 1px solid #fff; text-decoration: none;'; + button.target = '_blank'; + button.textContent = 'EDIT'; + document.body.appendChild( button ); + `; + + } + + content = content.replace( '/* edit button */', editButton ); + zip.file( 'index.html', content ); } ); @@ -6381,13 +6361,26 @@ container.add( rendererPropertiesRow ); + // Editable + + var editableRow = new UI.Row(); + var editable = new UI.Checkbox( config.getKey( 'project/editable' ) ).setLeft( '100px' ).onChange( function () { + + config.setKey( 'project/editable', this.getValue() ); + + } ); + + editableRow.add( new UI.Text( 'Editable' ).setWidth( '90px' ) ); + editableRow.add( editable ); + + container.add( editableRow ); + // VR var vrRow = new UI.Row(); var vr = new UI.Checkbox( config.getKey( 'project/vr' ) ).setLeft( '100px' ).onChange( function () { config.setKey( 'project/vr', this.getValue() ); - // updateRenderer(); } );
true
Other
mrdoob
three.js
59111f17c3244900fdc407e0d3053b4dee76eab0.json
Build unit tests
test/unit/three.source.unit.js
@@ -4,8 +4,6 @@ (factory()); }(this, (function () { 'use strict'; - console.log("TADA"); - QUnit.module( "Source", () => { var REVISION = '88dev'; @@ -384,35 +382,37 @@ generateUUID: function () { // http://www.broofa.com/Tools/Math.uuid.htm + // Replaced .join with string concatenation (@takahirox) var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split( '' ); - var uuid = new Array( 36 ); var rnd = 0, r; return function generateUUID() { + var uuid = ''; + for ( var i = 0; i < 36; i ++ ) { if ( i === 8 || i === 13 || i === 18 || i === 23 ) { - uuid[ i ] = '-'; + uuid += '-'; } else if ( i === 14 ) { - uuid[ i ] = '4'; + uuid += '4'; } else { if ( rnd <= 0x02 ) rnd = 0x2000000 + ( Math.random() * 0x1000000 ) | 0; r = rnd & 0xf; rnd = rnd >> 4; - uuid[ i ] = chars[ ( i === 19 ) ? ( r & 0x3 ) | 0x8 : r ]; + uuid += chars[ ( i === 19 ) ? ( r & 0x3 ) | 0x8 : r ]; } } - return uuid.join( '' ); + return uuid; }; @@ -2594,13 +2594,7 @@ } - var x = this.x, y = this.y, z = this.z; - - this.x = y * v.z - z * v.y; - this.y = z * v.x - x * v.z; - this.z = x * v.y - y * v.x; - - return this; + return this.crossVectors( this, v ); }, @@ -8883,23 +8877,23 @@ }(), rotateOnWorldAxis: function () { - + // rotate object on axis in world space // axis is assumed to be normalized // method assumes no rotated parent var q1 = new Quaternion(); - + return function rotateOnWorldAxis( axis, angle ) { - + q1.setFromAxisAngle( axis, angle ); - + this.quaternion.premultiply( q1 ); - + return this; - + }; - + }(), rotateX: function () { @@ -12469,6 +12463,21 @@ }, + setFromPoints: function ( points ) { + + this.vertices = []; + + for ( var i = 0, l = points.length; i < l; i ++ ) { + + var point = points[ i ]; + this.vertices.push( new Vector3( point.x, point.y, point.z || 0 ) ); + + } + + return this; + + }, + sortFacesByMaterialIndex: function () { var faces = this.faces; @@ -14556,6 +14565,23 @@ }, + setFromPoints: function ( points ) { + + var position = []; + + for ( var i = 0, l = points.length; i < l; i ++ ) { + + var point = points[ i ]; + position.push( point.x, point.y, point.z || 0 ); + + } + + this.addAttribute( 'position', new Float32BufferAttribute( position, 3 ) ); + + return this; + + }, + updateFromObject: function ( object ) { var geometry = object.geometry; @@ -20902,7 +20928,10 @@ var scope = this; - var isLoading = false, itemsLoaded = 0, itemsTotal = 0; + var isLoading = false; + var itemsLoaded = 0; + var itemsTotal = 0; + var urlModifier = undefined; this.onStart = undefined; this.onLoad = onLoad; @@ -20961,6 +20990,24 @@ }; + this.resolveURL = function ( url ) { + + if ( urlModifier ) { + + return urlModifier( url ); + + } + + return url; + + }; + + this.setURLModifier = function ( transform ) { + + urlModifier = transform; + + }; + } var DefaultLoadingManager = new LoadingManager(); @@ -20969,6 +21016,8 @@ * @author mrdoob / http://mrdoob.com/ */ + var loading = {}; + function FileLoader( manager ) { this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; @@ -20983,6 +21032,8 @@ if ( this.path !== undefined ) url = this.path + url; + url = this.manager.resolveURL( url ); + var scope = this; var cached = Cache.get( url ); @@ -21003,6 +21054,22 @@ } + // Check if request is duplicate + + if ( loading[ url ] !== undefined ) { + + loading[ url ].push( { + + onLoad: onLoad, + onProgress: onProgress, + onError: onError + + } ); + + return; + + } + // Check for data: URI var dataUriRegex = /^data:(.*?)(;base64)?,(.*)$/; var dataUriRegexResult = url.match( dataUriRegex ); @@ -21094,7 +21161,20 @@ } else { + // Initialise array for duplicate requests + + loading[ url ] = []; + + loading[ url ].push( { + + onLoad: onLoad, + onProgress: onProgress, + onError: onError + + } ); + var request = new XMLHttpRequest(); + request.open( 'GET', url, true ); request.addEventListener( 'load', function ( event ) { @@ -21103,9 +21183,18 @@ Cache.add( url, response ); + var callbacks = loading[ url ]; + + delete loading[ url ]; + if ( this.status === 200 ) { - if ( onLoad ) onLoad( response ); + for ( var i = 0, il = callbacks.length; i < il; i ++ ) { + + var callback = callbacks[ i ]; + if ( callback.onLoad ) callback.onLoad( response ); + + } scope.manager.itemEnd( url ); @@ -21116,13 +21205,23 @@ console.warn( 'THREE.FileLoader: HTTP Status 0 received.' ); - if ( onLoad ) onLoad( response ); + for ( var i = 0, il = callbacks.length; i < il; i ++ ) { + + var callback = callbacks[ i ]; + if ( callback.onLoad ) callback.onLoad( response ); + + } scope.manager.itemEnd( url ); } else { - if ( onError ) onError( event ); + for ( var i = 0, il = callbacks.length; i < il; i ++ ) { + + var callback = callbacks[ i ]; + if ( callback.onError ) callback.onError( event ); + + } scope.manager.itemEnd( url ); scope.manager.itemError( url ); @@ -21131,19 +21230,31 @@ }, false ); - if ( onProgress !== undefined ) { + request.addEventListener( 'progress', function ( event ) { - request.addEventListener( 'progress', function ( event ) { + var callbacks = loading[ url ]; - onProgress( event ); + for ( var i = 0, il = callbacks.length; i < il; i ++ ) { - }, false ); + var callback = callbacks[ i ]; + if ( callback.onProgress ) callback.onProgress( event ); - } + } + + }, false ); request.addEventListener( 'error', function ( event ) { - if ( onError ) onError( event ); + var callbacks = loading[ url ]; + + delete loading[ url ]; + + for ( var i = 0, il = callbacks.length; i < il; i ++ ) { + + var callback = callbacks[ i ]; + if ( callback.onError ) callback.onError( event ); + + } scope.manager.itemEnd( url ); scope.manager.itemError( url ); @@ -22629,6 +22740,8 @@ if ( this.path !== undefined ) url = this.path + url; + url = this.manager.resolveURL( url ); + var scope = this; var cached = Cache.get( url ); @@ -28010,7 +28123,7 @@ thetaLength: thetaLength }; - radius = radius || 50; + radius = radius || 1; widthSegments = Math.max( 3, Math.floor( widthSegments ) || 8 ); heightSegments = Math.max( 2, Math.floor( heightSegments ) || 6 ); @@ -29182,6 +29295,8 @@ function Curve() { + this.type = 'Curve'; + this.arcLengthDivisions = 200; } @@ -29519,6 +29634,20 @@ binormals: binormals }; + }, + + clone: function () { + + return new this.constructor().copy( this ); + + }, + + copy: function ( source ) { + + this.arcLengthDivisions = source.arcLengthDivisions; + + return this; + } } ); @@ -29618,8 +29747,10 @@ Curve.call( this ); - this.v1 = v1; - this.v2 = v2; + this.type = 'LineCurve'; + + this.v1 = v1 || new Vector2(); + this.v2 = v2 || new Vector2(); } @@ -29663,6 +29794,17 @@ }; + LineCurve.prototype.copy = function ( source ) { + + Curve.prototype.copy.call( this, source ); + + this.v1.copy( source.v1 ); + this.v2.copy( source.v2 ); + + return this; + + }; + /** * @author zz85 / http://www.lab4games.net/zz85/blog * @@ -29677,8 +29819,9 @@ Curve.call( this ); - this.curves = []; + this.type = 'CurvePath'; + this.curves = []; this.autoClose = false; // Automatically closes the path } @@ -29858,43 +30001,6 @@ return points; - }, - - /************************************************************** - * Create Geometries Helpers - **************************************************************/ - - /// Generate geometry from path points (for Line or Points objects) - - createPointsGeometry: function ( divisions ) { - - var pts = this.getPoints( divisions ); - return this.createGeometry( pts ); - - }, - - // Generate geometry from equidistant sampling along the path - - createSpacedPointsGeometry: function ( divisions ) { - - var pts = this.getSpacedPoints( divisions ); - return this.createGeometry( pts ); - - }, - - createGeometry: function ( points ) { - - var geometry = new Geometry(); - - for ( var i = 0, l = points.length; i < l; i ++ ) { - - var point = points[ i ]; - geometry.vertices.push( new Vector3( point.x, point.y, point.z || 0 ) ); - - } - - return geometry; - } } ); @@ -30081,16 +30187,18 @@ Curve.call( this ); - this.aX = aX; - this.aY = aY; + this.type = 'EllipseCurve'; + + this.aX = aX || 0; + this.aY = aY || 0; - this.xRadius = xRadius; - this.yRadius = yRadius; + this.xRadius = xRadius || 1; + this.yRadius = yRadius || 1; - this.aStartAngle = aStartAngle; - this.aEndAngle = aEndAngle; + this.aStartAngle = aStartAngle || 0; + this.aEndAngle = aEndAngle || 2 * Math.PI; - this.aClockwise = aClockwise; + this.aClockwise = aClockwise || false; this.aRotation = aRotation || 0; @@ -30163,11 +30271,34 @@ }; + EllipseCurve.prototype.copy = function ( source ) { + + Curve.prototype.copy.call( this, source ); + + this.aX = source.aX; + this.aY = source.aY; + + this.xRadius = source.xRadius; + this.yRadius = source.yRadius; + + this.aStartAngle = source.aStartAngle; + this.aEndAngle = source.aEndAngle; + + this.aClockwise = source.aClockwise; + + this.aRotation = source.aRotation; + + return this; + + }; + function SplineCurve( points /* array of Vector2 */ ) { Curve.call( this ); - this.points = ( points === undefined ) ? [] : points; + this.type = 'SplineCurve'; + + this.points = points || []; } @@ -30200,14 +30331,34 @@ }; + SplineCurve.prototype.copy = function ( source ) { + + Curve.prototype.copy.call( this, source ); + + this.points = []; + + for ( var i = 0, l = source.points.length; i < l; i ++ ) { + + var point = source.points[ i ]; + + this.points.push( point.clone() ); + + } + + return this; + + }; + function CubicBezierCurve( v0, v1, v2, v3 ) { Curve.call( this ); - this.v0 = v0; - this.v1 = v1; - this.v2 = v2; - this.v3 = v3; + this.type = 'CubicBezierCurve'; + + this.v0 = v0 || new Vector2(); + this.v1 = v1 || new Vector2(); + this.v2 = v2 || new Vector2(); + this.v3 = v3 || new Vector2(); } @@ -30231,13 +30382,28 @@ }; + CubicBezierCurve.prototype.copy = function ( source ) { + + Curve.prototype.copy.call( this, source ); + + this.v0.copy( source.v0 ); + this.v1.copy( source.v1 ); + this.v2.copy( source.v2 ); + this.v3.copy( source.v3 ); + + return this; + + }; + function QuadraticBezierCurve( v0, v1, v2 ) { Curve.call( this ); - this.v0 = v0; - this.v1 = v1; - this.v2 = v2; + this.type = 'QuadraticBezierCurve'; + + this.v0 = v0 || new Vector2(); + this.v1 = v1 || new Vector2(); + this.v2 = v2 || new Vector2(); } @@ -30261,6 +30427,18 @@ }; + QuadraticBezierCurve.prototype.copy = function ( source ) { + + Curve.prototype.copy.call( this, source ); + + this.v0.copy( source.v0 ); + this.v1.copy( source.v1 ); + this.v2.copy( source.v2 ); + + return this; + + }; + var PathPrototype = Object.assign( Object.create( CurvePath.prototype ), { fromPoints: function ( vectors ) { @@ -30389,6 +30567,9 @@ function Path( points ) { CurvePath.call( this ); + + this.type = 'Path'; + this.currentPoint = new Vector2(); if ( points ) { @@ -30417,6 +30598,8 @@ Path.apply( this, arguments ); + this.type = 'Shape'; + this.holes = []; } @@ -30467,6 +30650,8 @@ function ShapePath() { + this.type = 'ShapePath'; + this.subPaths = []; this.currentPath = null; @@ -30742,6 +30927,8 @@ function Font( data ) { + this.type = 'Font'; + this.data = data; } @@ -31329,14 +31516,16 @@ var py = new CubicPoly(); var pz = new CubicPoly(); - function CatmullRomCurve3( points ) { + function CatmullRomCurve3( points, closed, curveType, tension ) { Curve.call( this ); - if ( points.length < 2 ) console.warn( 'THREE.CatmullRomCurve3: Points array needs at least two entries.' ); + this.type = 'CatmullRomCurve3'; this.points = points || []; - this.closed = false; + this.closed = closed || false; + this.curveType = curveType || 'centripetal'; + this.tension = tension || 0.5; } @@ -31396,10 +31585,10 @@ } - if ( this.type === undefined || this.type === 'centripetal' || this.type === 'chordal' ) { + if ( this.curveType === 'centripetal' || this.curveType === 'chordal' ) { // init Centripetal / Chordal Catmull-Rom - var pow = this.type === 'chordal' ? 0.5 : 0.25; + var pow = this.curveType === 'chordal' ? 0.5 : 0.25; var dt0 = Math.pow( p0.distanceToSquared( p1 ), pow ); var dt1 = Math.pow( p1.distanceToSquared( p2 ), pow ); var dt2 = Math.pow( p2.distanceToSquared( p3 ), pow ); @@ -31413,12 +31602,11 @@ py.initNonuniformCatmullRom( p0.y, p1.y, p2.y, p3.y, dt0, dt1, dt2 ); pz.initNonuniformCatmullRom( p0.z, p1.z, p2.z, p3.z, dt0, dt1, dt2 ); - } else if ( this.type === 'catmullrom' ) { + } else if ( this.curveType === 'catmullrom' ) { - var tension = this.tension !== undefined ? this.tension : 0.5; - px.initCatmullRom( p0.x, p1.x, p2.x, p3.x, tension ); - py.initCatmullRom( p0.y, p1.y, p2.y, p3.y, tension ); - pz.initCatmullRom( p0.z, p1.z, p2.z, p3.z, tension ); + px.initCatmullRom( p0.x, p1.x, p2.x, p3.x, this.tension ); + py.initCatmullRom( p0.y, p1.y, p2.y, p3.y, this.tension ); + pz.initCatmullRom( p0.z, p1.z, p2.z, p3.z, this.tension ); } @@ -31432,6 +31620,28 @@ }; + CatmullRomCurve3.prototype.copy = function ( source ) { + + Curve.prototype.copy.call( this, source ); + + this.points = []; + + for ( var i = 0, l = source.points.length; i < l; i ++ ) { + + var point = source.points[ i ]; + + this.points.push( point.clone() ); + + } + + this.closed = source.closed; + this.curveType = source.curveType; + this.tension = source.tension; + + return this; + + }; + /** * @author zz85 / http://joshuakoo.com * @author TristanVALCKE / https://github.com/Itee @@ -32038,10 +32248,12 @@ Curve.call( this ); - this.v0 = v0; - this.v1 = v1; - this.v2 = v2; - this.v3 = v3; + this.type = 'CubicBezierCurve3'; + + this.v0 = v0 || new Vector3(); + this.v1 = v1 || new Vector3(); + this.v2 = v2 || new Vector3(); + this.v3 = v3 || new Vector3(); } @@ -32066,6 +32278,19 @@ }; + CubicBezierCurve3.prototype.copy = function ( source ) { + + Curve.prototype.copy.call( this, source ); + + this.v0.copy( source.v0 ); + this.v1.copy( source.v1 ); + this.v2.copy( source.v2 ); + this.v3.copy( source.v3 ); + + return this; + + }; + /** * @author TristanVALCKE / https://github.com/Itee * @author moraxy / https://github.com/moraxy @@ -32716,8 +32941,10 @@ Curve.call( this ); - this.v1 = v1; - this.v2 = v2; + this.type = 'LineCurve3'; + + this.v1 = v1 || new Vector3(); + this.v2 = v2 || new Vector3(); } @@ -32753,6 +32980,17 @@ }; + LineCurve3.prototype.copy = function ( source ) { + + Curve.prototype.copy.call( this, source ); + + this.v1.copy( source.v1 ); + this.v2.copy( source.v2 ); + + return this; + + }; + /** * @author TristanVALCKE / https://github.com/Itee */ @@ -33207,9 +33445,11 @@ Curve.call( this ); - this.v0 = v0; - this.v1 = v1; - this.v2 = v2; + this.type = 'QuadraticBezierCurve3'; + + this.v0 = v0 || new Vector3(); + this.v1 = v1 || new Vector3(); + this.v2 = v2 || new Vector3(); } @@ -33234,6 +33474,18 @@ }; + QuadraticBezierCurve3.prototype.copy = function ( source ) { + + Curve.prototype.copy.call( this, source ); + + this.v0.copy( source.v0 ); + this.v1.copy( source.v1 ); + this.v2.copy( source.v2 ); + + return this; + + }; + /** * @author TristanVALCKE / https://github.com/Itee */ @@ -33873,7 +34125,7 @@ thetaLength: thetaLength }; - radius = radius || 50; + radius = radius || 1; segments = segments !== undefined ? Math.max( 3, segments ) : 8; thetaStart = thetaStart !== undefined ? thetaStart : 0; @@ -34095,16 +34347,16 @@ var scope = this; - radiusTop = radiusTop !== undefined ? radiusTop : 20; - radiusBottom = radiusBottom !== undefined ? radiusBottom : 20; - height = height !== undefined ? height : 100; + radiusTop = radiusTop !== undefined ? radiusTop : 1; + radiusBottom = radiusBottom !== undefined ? radiusBottom : 1; + height = height || 1; radialSegments = Math.floor( radialSegments ) || 8; heightSegments = Math.floor( heightSegments ) || 1; openEnded = openEnded !== undefined ? openEnded : false; thetaStart = thetaStart !== undefined ? thetaStart : 0.0; - thetaLength = thetaLength !== undefined ? thetaLength : 2.0 * Math.PI; + thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2; // buffers @@ -35847,7 +36099,7 @@ var tonemapping_fragment = "#if defined( TONE_MAPPING )\r\n\r\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\r\n\r\n#endif\r\n"; - var tonemapping_pars_fragment = "#define saturate(a) clamp( a, 0.0, 1.0 )\r\n\r\nuniform float toneMappingExposure;\r\nuniform float toneMappingWhitePoint;\r\n\r\n// exposure only\r\nvec3 LinearToneMapping( vec3 color ) {\r\n\r\n\treturn toneMappingExposure * color;\r\n\r\n}\r\n\r\n// source: https://www.cs.utah.edu/~reinhard/cdrom/\r\nvec3 ReinhardToneMapping( vec3 color ) {\r\n\r\n\tcolor *= toneMappingExposure;\r\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\r\n\r\n}\r\n\r\n// source: http://filmicgames.com/archives/75\r\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\r\nvec3 Uncharted2ToneMapping( vec3 color ) {\r\n\r\n\t// John Hable's filmic operator from Uncharted 2 video game\r\n\tcolor *= toneMappingExposure;\r\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\r\n\r\n}\r\n\r\n// source: http://filmicgames.com/archives/75\r\nvec3 OptimizedCineonToneMapping( vec3 color ) {\r\n\r\n\t// optimized filmic operator by Jim Hejl and Richard Burgess-Dawson\r\n\tcolor *= toneMappingExposure;\r\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\r\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\r\n\r\n}\r\n"; + var tonemapping_pars_fragment = "#ifndef saturate\r\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\r\n#endif\r\n\r\nuniform float toneMappingExposure;\r\nuniform float toneMappingWhitePoint;\r\n\r\n// exposure only\r\nvec3 LinearToneMapping( vec3 color ) {\r\n\r\n\treturn toneMappingExposure * color;\r\n\r\n}\r\n\r\n// source: https://www.cs.utah.edu/~reinhard/cdrom/\r\nvec3 ReinhardToneMapping( vec3 color ) {\r\n\r\n\tcolor *= toneMappingExposure;\r\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\r\n\r\n}\r\n\r\n// source: http://filmicgames.com/archives/75\r\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\r\nvec3 Uncharted2ToneMapping( vec3 color ) {\r\n\r\n\t// John Hable's filmic operator from Uncharted 2 video game\r\n\tcolor *= toneMappingExposure;\r\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\r\n\r\n}\r\n\r\n// source: http://filmicgames.com/archives/75\r\nvec3 OptimizedCineonToneMapping( vec3 color ) {\r\n\r\n\t// optimized filmic operator by Jim Hejl and Richard Burgess-Dawson\r\n\tcolor *= toneMappingExposure;\r\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\r\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\r\n\r\n}\r\n"; var uv_pars_fragment = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\r\n\r\n\tvarying vec2 vUv;\r\n\r\n#endif"; @@ -43129,7 +43381,7 @@ // Clearing - this.getClearColor = function() { + this.getClearColor = function () { return background.getClearColor(); @@ -43141,13 +43393,13 @@ }; - this.getClearAlpha = function() { + this.getClearAlpha = function () { return background.getClearAlpha(); }; - this.setClearAlpha = function() { + this.setClearAlpha = function () { background.setClearAlpha.apply( background, arguments ); @@ -43716,15 +43968,38 @@ function start() { if ( isAnimating ) return; - ( vr.getDevice() || window ).requestAnimationFrame( loop ); + + var device = vr.getDevice(); + + if ( device && device.isPresenting ) { + + device.requestAnimationFrame( loop ); + + } else { + + window.requestAnimationFrame( loop ); + + } + isAnimating = true; } function loop( time ) { if ( onAnimationFrame !== null ) onAnimationFrame( time ); - ( vr.getDevice() || window ).requestAnimationFrame( loop ); + + var device = vr.getDevice(); + + if ( device && device.isPresenting ) { + + device.requestAnimationFrame( loop ); + + } else { + + window.requestAnimationFrame( loop ); + + } } @@ -47425,8 +47700,8 @@ thetaLength: thetaLength }; - innerRadius = innerRadius || 20; - outerRadius = outerRadius || 50; + innerRadius = innerRadius || 0.5; + outerRadius = outerRadius || 1; thetaStart = thetaStart !== undefined ? thetaStart : 0; thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2; @@ -48352,8 +48627,8 @@ arc: arc }; - radius = radius || 100; - tube = tube || 40; + radius = radius || 1; + tube = tube || 0.4; radialSegments = Math.floor( radialSegments ) || 8; tubularSegments = Math.floor( tubularSegments ) || 6; arc = arc || Math.PI * 2; @@ -48596,8 +48871,8 @@ q: q }; - radius = radius || 100; - tube = tube || 40; + radius = radius || 1; + tube = tube || 0.4; tubularSegments = Math.floor( tubularSegments ) || 64; radialSegments = Math.floor( radialSegments ) || 8; p = p || 2;
true
Other
mrdoob
three.js
bb6a1aaafaf366a300178e93bd274f38252dbaa2.json
Add unit tests utils
test/unit/SmartComparer.js
@@ -0,0 +1,210 @@ +// Smart comparison of three.js objects. +// Identifies significant differences between two objects. +// Performs deep comparison. +// Comparison stops after the first difference is found. +// Provides an explanation for the failure. +function SmartComparer() { + 'use strict'; + + // Diagnostic message, when comparison fails. + var message; + + return { + + areEqual: areEqual, + + getDiagnostic: function() { + + return message; + + } + + }; + + + // val1 - first value to compare (typically the actual value) + // val2 - other value to compare (typically the expected value) + function areEqual( val1, val2 ) { + + // Values are strictly equal. + if ( val1 === val2 ) return true; + + // Null or undefined values. + /* jshint eqnull:true */ + if ( val1 == null || val2 == null ) { + + if ( val1 != val2 ) { + + return makeFail( 'One value is undefined or null', val1, val2 ); + + } + + // Both null / undefined. + return true; + } + + // Don't compare functions. + if ( isFunction( val1 ) && isFunction( val2 ) ) return true; + + // Array comparison. + var arrCmp = compareArrays( val1, val2 ); + if ( arrCmp !== undefined ) return arrCmp; + + // Has custom equality comparer. + if ( val1.equals ) { + + if ( val1.equals( val2 ) ) return true; + + return makeFail( 'Comparison with .equals method returned false' ); + + } + + // Object comparison. + var objCmp = compareObjects( val1, val2 ); + if ( objCmp !== undefined ) return objCmp; + + // if (JSON.stringify( val1 ) == JSON.stringify( val2 ) ) return true; + + // Object differs (unknown reason). + return makeFail( 'Values differ', val1, val2 ); + } + + function isFunction(value) { + + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array constructors, and + // PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? Object.prototype.toString.call(value) : ''; + + return tag == '[object Function]' || tag == '[object GeneratorFunction]'; + + } + + function isObject(value) { + + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + + return !!value && (type == 'object' || type == 'function'); + + } + + function compareArrays( val1, val2 ) { + + var isArr1 = Array.isArray( val1 ); + var isArr2 = Array.isArray( val2 ); + + // Compare type. + if ( isArr1 !== isArr2 ) return makeFail( 'Values are not both arrays' ); + + // Not arrays. Continue. + if ( !isArr1 ) return undefined; + + // Compare length. + var N1 = val1.length; + var N2 = val2.length; + if ( N1 !== val2.length ) return makeFail( 'Array length differs', N1, N2 ); + + // Compare content at each index. + for ( var i = 0; i < N1; i ++ ) { + + var cmp = areEqual( val1[ i ], val2[ i ] ); + if ( !cmp ) return addContext( 'array index "' + i + '"' ); + + } + + // Arrays are equal. + return true; + } + + + function compareObjects( val1, val2 ) { + + var isObj1 = isObject( val1 ); + var isObj2 = isObject( val2 ); + + // Compare type. + if ( isObj1 !== isObj2 ) return makeFail( 'Values are not both objects' ); + + // Not objects. Continue. + if ( !isObj1 ) return undefined; + + // Compare keys. + var keys1 = Object.keys( val1 ); + var keys2 = Object.keys( val2 ); + + for ( var i = 0, l = keys1.length; i < l; i++ ) { + + if (keys2.indexOf(keys1[ i ]) < 0) { + + return makeFail( 'Property "' + keys1[ i ] + '" is unexpected.' ); + + } + + } + + for ( var i = 0, l = keys2.length; i < l; i++ ) { + + if (keys1.indexOf(keys2[ i ]) < 0) { + + return makeFail( 'Property "' + keys2[ i ] + '" is missing.' ); + + } + + } + + // Keys are the same. For each key, compare content until a difference is found. + var hadDifference = false; + + for ( var i = 0, l = keys1.length; i < l; i++ ) { + + var key = keys1[ i ]; + + if (key === "uuid" || key === "id") { + + continue; + + } + + var prop1 = val1[ key ]; + var prop2 = val2[ key ]; + + // Compare property content. + var eq = areEqual( prop1, prop2 ); + + // In case of failure, an message should already be set. + // Add context to low level message. + if ( !eq ) { + + addContext( 'property "' + key + '"' ); + hadDifference = true; + + } + } + + return ! hadDifference; + + } + + + function makeFail( msg, val1, val2 ) { + + message = msg; + if ( arguments.length > 1) message += " (" + val1 + " vs " + val2 + ")"; + + return false; + + } + + function addContext( msg ) { + + // There should already be a validation message. Add more context to it. + message = message || "Error"; + message += ", at " + msg; + + return false; + + } + +}
true
Other
mrdoob
three.js
bb6a1aaafaf366a300178e93bd274f38252dbaa2.json
Add unit tests utils
test/unit/qunit-utils.js
@@ -0,0 +1,331 @@ +// +// Custom QUnit assertions. +// + +QUnit.assert.success = function ( message ) { + + // Equivalent to assert( true, message ); + this.pushResult( { + result: true, + actual: undefined, + expected: undefined, + message: message + } ); + +}; + +QUnit.assert.fail = function ( message ) { + + // Equivalent to assert( false, message ); + this.pushResult( { + result: false, + actual: undefined, + expected: undefined, + message: message + } ); + +}; + +QUnit.assert.numEqual = function ( actual, expected, message ) { + + var diff = Math.abs( actual - expected ); + message = message || ( actual + " should be equal to " + expected ); + this.pushResult( { + result: diff < 0.1, + actual: actual, + expected: expected, + message: message + } ); + +}; + +QUnit.assert.equalKey = function ( obj, ref, key ) { + + var actual = obj[ key ]; + var expected = ref[ key ]; + var message = actual + ' should be equal to ' + expected + ' for key "' + key + '"'; + this.pushResult( { + result: actual == expected, + actual: actual, + expected: expected, + message: message + } ); + +}; + +QUnit.assert.smartEqual = function ( actual, expected, message ) { + + var cmp = new SmartComparer(); + + var same = cmp.areEqual( actual, expected ); + var msg = cmp.getDiagnostic() || message; + + this.pushResult( { + result: same, + actual: actual, + expected: expected, + message: msg + } ); + +}; + +// +// GEOMETRY TEST HELPERS +// + +function checkGeometryClone( geom ) { + + // Clone + var copy = geom.clone(); + QUnit.assert.notEqual( copy.uuid, geom.uuid, "clone uuid should differ from original" ); + QUnit.assert.notEqual( copy.id, geom.id, "clone id should differ from original" ); + + var excludedProperties = [ 'parameters', 'widthSegments', 'heightSegments', 'depthSegments' ]; + + var differingProp = getDifferingProp( geom, copy, excludedProperties ); + QUnit.assert.ok( differingProp === undefined, 'properties are equal' ); + + differingProp = getDifferingProp( copy, geom, excludedProperties ); + QUnit.assert.ok( differingProp === undefined, 'properties are equal' ); + + // json round trip with clone + checkGeometryJsonRoundtrip( copy ); + +} + +function getDifferingProp( geometryA, geometryB, excludedProperties ) { + + excludedProperties = excludedProperties || []; + + var geometryKeys = Object.keys( geometryA ); + var cloneKeys = Object.keys( geometryB ); + + var differingProp = undefined; + + for ( var i = 0, l = geometryKeys.length; i < l; i ++ ) { + + var key = geometryKeys[ i ]; + + if ( excludedProperties.indexOf( key ) >= 0 ) continue; + + if ( cloneKeys.indexOf( key ) < 0 ) { + + differingProp = key; + break; + + } + + } + + return differingProp; + +} + +// Compare json file with its source geometry. +function checkGeometryJsonWriting( geom, json ) { + + QUnit.assert.equal( json.metadata.version, "4.5", "check metadata version" ); + QUnit.assert.equalKey( geom, json, 'type' ); + QUnit.assert.equalKey( geom, json, 'uuid' ); + QUnit.assert.equal( json.id, undefined, "should not persist id" ); + + var params = geom.parameters; + if ( ! params ) { + + return; + + } + + // All parameters from geometry should be persisted. + var keys = Object.keys( params ); + for ( var i = 0, l = keys.length; i < l; i ++ ) { + + QUnit.assert.equalKey( params, json, keys[ i ] ); + + } + + // All parameters from json should be transfered to the geometry. + // json is flat. Ignore first level json properties that are not parameters. + var notParameters = [ "metadata", "uuid", "type" ]; + var keys = Object.keys( json ); + for ( var i = 0, l = keys.length; i < l; i ++ ) { + + var key = keys[ i ]; + if ( notParameters.indexOf( key ) === - 1 ) QUnit.assert.equalKey( params, json, key ); + + } + +} + +// Check parsing and reconstruction of json geometry +function checkGeometryJsonReading( json, geom ) { + + var wrap = [ json ]; + + var loader = new THREE.ObjectLoader(); + var output = loader.parseGeometries( wrap ); + + QUnit.assert.ok( output[ geom.uuid ], 'geometry matching source uuid not in output' ); + // QUnit.assert.smartEqual( output[ geom.uuid ], geom, 'Reconstruct geometry from ObjectLoader' ); + + var differing = getDifferingProp( output[ geom.uuid ], geom, [ 'bones' ] ); + if ( differing ) console.log( differing ); + + var excludedProperties = [ 'bones' ]; + + var differingProp = getDifferingProp( output[ geom.uuid ], geom, excludedProperties ); + QUnit.assert.ok( differingProp === undefined, 'properties are equal' ); + + differingProp = getDifferingProp( geom, output[ geom.uuid ], excludedProperties ); + QUnit.assert.ok( differingProp === undefined, 'properties are equal' ); + +} + +// Verify geom -> json -> geom +function checkGeometryJsonRoundtrip( geom ) { + + var json = geom.toJSON(); + checkGeometryJsonWriting( geom, json ); + checkGeometryJsonReading( json, geom ); + +} + +// Look for undefined and NaN values in numerical fieds. +function checkFinite( geom ) { + + var allVerticesAreFinite = true; + + var vertices = geom.vertices || []; + + for ( var i = 0, l = vertices.length; i < l; i ++ ) { + + var v = geom.vertices[ i ]; + + if ( ! ( isFinite( v.x ) || isFinite( v.y ) || isFinite( v.z ) ) ) { + + allVerticesAreFinite = false; + break; + + } + + } + + // TODO Buffers, normal, etc. + + QUnit.assert.ok( allVerticesAreFinite, "contains only finite coordinates" ); + +} + +// Run common geometry tests. +function runStdGeometryTests( assert, geometries ) { + + for ( var i = 0, l = geometries.length; i < l; i ++ ) { + + var geom = geometries[ i ]; + + checkFinite( geom ); + + // Clone + checkGeometryClone( geom ); + + // json round trip + checkGeometryJsonRoundtrip( geom ); + + } + +} + +// +// LIGHT TEST HELPERS +// + +// Run common light tests. +function runStdLightTests( lights ) { + + for ( var i = 0, l = lights.length; i < l; i ++ ) { + + var light = lights[ i ]; + + // copy and clone + checkLightCopyClone( light ); + + // THREE.Light doesn't get parsed by ObjectLoader as it's only + // used as an abstract base class - so we skip the JSON tests + if ( light.type !== "Light" ) { + + // json round trip + checkLightJsonRoundtrip( light ); + + } + + } + +} + +function checkLightCopyClone( light ) { + + // copy + var newLight = new light.constructor( 0xc0ffee ); + newLight.copy( light ); + + QUnit.assert.notEqual( newLight.uuid, light.uuid, "Copied light's UUID differs from original" ); + QUnit.assert.notEqual( newLight.id, light.id, "Copied light's id differs from original" ); + QUnit.assert.smartEqual( newLight, light, "Copied light is equal to original" ); + + // real copy? + newLight.color.setHex( 0xc0ffee ); + QUnit.assert.notStrictEqual( + newLight.color.getHex(), light.color.getHex(), "Copied light is independent from original" + ); + + // Clone + var clone = light.clone(); // better get a new var + QUnit.assert.notEqual( clone.uuid, light.uuid, "Cloned light's UUID differs from original" ); + QUnit.assert.notEqual( clone.id, light.id, "Clone light's id differs from original" ); + QUnit.assert.smartEqual( clone, light, "Clone light is equal to original" ); + + // real clone? + clone.color.setHex( 0xc0ffee ); + QUnit.assert.notStrictEqual( + clone.color.getHex(), light.color.getHex(), "Clone light is independent from original" + ); + + if ( light.type !== "Light" ) { + + // json round trip with clone + checkLightJsonRoundtrip( clone ); + + } + +} + +// Compare json file with its source Light. +function checkLightJsonWriting( light, json ) { + + QUnit.assert.equal( json.metadata.version, "4.5", "check metadata version" ); + + var object = json.object; + QUnit.assert.equalKey( light, object, 'type' ); + QUnit.assert.equalKey( light, object, 'uuid' ); + QUnit.assert.equal( object.id, undefined, "should not persist id" ); + +} + +// Check parsing and reconstruction of json Light +function checkLightJsonReading( json, light ) { + + var loader = new THREE.ObjectLoader(); + var outputLight = loader.parse( json ); + + QUnit.assert.smartEqual( outputLight, light, 'Reconstruct Light from ObjectLoader' ); + +} + +// Verify light -> json -> light +function checkLightJsonRoundtrip( light ) { + + var json = light.toJSON(); + checkLightJsonWriting( light, json ); + checkLightJsonReading( json, light ); + +}
true
Other
mrdoob
three.js
7011e96ad34f7dad830d2a1e3a4be3e3799425d9.json
Add textures es6 unit tests
test/unit/src/textures/CanvasTexture.tests.js
@@ -0,0 +1,35 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { CanvasTexture } from '../../../../src/textures/CanvasTexture'; + +export default QUnit.module( 'Textures', () => { + + QUnit.module.todo( 'CanvasTexture', () => { + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "isCanvasTexture", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
7011e96ad34f7dad830d2a1e3a4be3e3799425d9.json
Add textures es6 unit tests
test/unit/src/textures/CompressedTexture.tests.js
@@ -0,0 +1,35 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { CompressedTexture } from '../../../../src/textures/CompressedTexture'; + +export default QUnit.module( 'Textures', () => { + + QUnit.module.todo( 'CompressedTexture', () => { + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "isCompressedTexture", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
7011e96ad34f7dad830d2a1e3a4be3e3799425d9.json
Add textures es6 unit tests
test/unit/src/textures/CubeTexture.tests.js
@@ -0,0 +1,42 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { CubeTexture } from '../../../../src/textures/CubeTexture'; + +export default QUnit.module( 'Textures', () => { + + QUnit.module.todo( 'CubeTexture', () => { + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PROPERTIES + QUnit.test( "images", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "isCubeTexture", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
7011e96ad34f7dad830d2a1e3a4be3e3799425d9.json
Add textures es6 unit tests
test/unit/src/textures/DataTexture.tests.js
@@ -0,0 +1,35 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { DataTexture } from '../../../../src/textures/DataTexture'; + +export default QUnit.module( 'Textures', () => { + + QUnit.module.todo( 'DataTexture', () => { + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "isDataTexture", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
7011e96ad34f7dad830d2a1e3a4be3e3799425d9.json
Add textures es6 unit tests
test/unit/src/textures/DepthTexture.tests.js
@@ -0,0 +1,35 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { DepthTexture } from '../../../../src/textures/DepthTexture'; + +export default QUnit.module( 'Textures', () => { + + QUnit.module.todo( 'DepthTexture', () => { + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "isDepthTexture", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
7011e96ad34f7dad830d2a1e3a4be3e3799425d9.json
Add textures es6 unit tests
test/unit/src/textures/Texture.tests.js
@@ -0,0 +1,65 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { Texture } from '../../../../src/textures/Texture'; + +export default QUnit.module( 'Textures', () => { + + QUnit.module.todo( 'Texture', () => { + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PROPERTIES + QUnit.test( "needsUpdate", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "isTexture", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "clone", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "copy", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "toJSON", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "dispose", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "transformUv", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
7011e96ad34f7dad830d2a1e3a4be3e3799425d9.json
Add textures es6 unit tests
test/unit/src/textures/VideoTexture.tests.js
@@ -0,0 +1,35 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { VideoTexture } from '../../../../src/textures/VideoTexture'; + +export default QUnit.module( 'Textures', () => { + + QUnit.module.todo( 'VideoTexture', () => { + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "isVideoTexture", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
cf98f0a3c461c7109ba0ae722563f7ff71af9ba4.json
Add objects es6 unit tests
test/unit/src/objects/Bone.tests.js
@@ -0,0 +1,36 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { Bone } from '../../../../src/objects/Bone'; + +export default QUnit.module( 'Objects', () => { + + QUnit.module.todo( 'Bone', () => { + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "isBone", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + + } ); + +} );
true
Other
mrdoob
three.js
cf98f0a3c461c7109ba0ae722563f7ff71af9ba4.json
Add objects es6 unit tests
test/unit/src/objects/Group.tests.js
@@ -0,0 +1,28 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { Group } from '../../../../src/objects/Group'; + +export default QUnit.module( 'Objects', () => { + + QUnit.module.todo( 'Group', () => { + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
cf98f0a3c461c7109ba0ae722563f7ff71af9ba4.json
Add objects es6 unit tests
test/unit/src/objects/LOD.tests.js
@@ -0,0 +1,72 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { LOD } from '../../../../src/objects/LOD'; + +export default QUnit.module( 'Objects', () => { + + QUnit.module.todo( 'LOD', () => { + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PROPERTIES + QUnit.test( "levels", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "isLOD", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + QUnit.test( "copy", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + QUnit.test( "addLevel", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + QUnit.test( "getObjectForDistance", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + QUnit.test( "raycast", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + QUnit.test( "update", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + QUnit.test( "toJSON", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
cf98f0a3c461c7109ba0ae722563f7ff71af9ba4.json
Add objects es6 unit tests
test/unit/src/objects/LensFlare.tests.js
@@ -0,0 +1,53 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { LensFlare } from '../../../../src/objects/LensFlare'; + +export default QUnit.module( 'Objects', () => { + + QUnit.module.todo( 'LensFlare', () => { + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "isLensFlare", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "copy", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "add", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "updateLensFlares", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
cf98f0a3c461c7109ba0ae722563f7ff71af9ba4.json
Add objects es6 unit tests
test/unit/src/objects/Line.tests.js
@@ -0,0 +1,48 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { Line } from '../../../../src/objects/Line'; + +export default QUnit.module( 'Objects', () => { + + QUnit.module.todo( 'Line', () => { + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "isLine", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "raycast", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "clone", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + + } ); + +} );
true
Other
mrdoob
three.js
cf98f0a3c461c7109ba0ae722563f7ff71af9ba4.json
Add objects es6 unit tests
test/unit/src/objects/LineLoop.tests.js
@@ -0,0 +1,36 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { LineLoop } from '../../../../src/objects/LineLoop'; + +export default QUnit.module( 'Objects', () => { + + QUnit.module.todo( 'LineLoop', () => { + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "isLineLoop", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + + } ); + +} );
true
Other
mrdoob
three.js
cf98f0a3c461c7109ba0ae722563f7ff71af9ba4.json
Add objects es6 unit tests
test/unit/src/objects/LineSegments.tests.js
@@ -0,0 +1,36 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { LineSegments } from '../../../../src/objects/LineSegments'; + +export default QUnit.module( 'Objects', () => { + + QUnit.module.todo( 'LineSegments', () => { + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "isLineSegments", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + + } ); + +} );
true
Other
mrdoob
three.js
cf98f0a3c461c7109ba0ae722563f7ff71af9ba4.json
Add objects es6 unit tests
test/unit/src/objects/Mesh.tests.js
@@ -0,0 +1,61 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { Mesh } from '../../../../src/objects/Mesh'; + +export default QUnit.module( 'Objects', () => { + + QUnit.module.todo( 'Mesh', () => { + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "isMesh", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + QUnit.test( "setDrawMode", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + QUnit.test( "copy", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + QUnit.test( "updateMorphTargets", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + QUnit.test( "raycast", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + QUnit.test( "clone", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + + } ); + +} );
true
Other
mrdoob
three.js
cf98f0a3c461c7109ba0ae722563f7ff71af9ba4.json
Add objects es6 unit tests
test/unit/src/objects/Points.tests.js
@@ -0,0 +1,35 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { Points } from '../../../../src/objects/Points'; + +export default QUnit.module( 'Objects', () => { + + QUnit.module.todo( 'Points', () => { + + // INHERITANCE + QUnit.test( "isPoints", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "raycast", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "clone", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
cf98f0a3c461c7109ba0ae722563f7ff71af9ba4.json
Add objects es6 unit tests
test/unit/src/objects/Skeleton.tests.js
@@ -0,0 +1,46 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { Skeleton } from '../../../../src/objects/Skeleton'; + +export default QUnit.module( 'Objects', () => { + + QUnit.module.todo( 'Skeleton', () => { + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "calculateInverses", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "pose", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "update", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "clone", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
cf98f0a3c461c7109ba0ae722563f7ff71af9ba4.json
Add objects es6 unit tests
test/unit/src/objects/SkinnedMesh.tests.js
@@ -0,0 +1,65 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { SkinnedMesh } from '../../../../src/objects/SkinnedMesh'; + +export default QUnit.module( 'Objects', () => { + + QUnit.module.todo( 'SkinnedMesh', () => { + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "isSkinnedMesh", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + QUnit.test( "initBones", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + QUnit.test( "bind", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + QUnit.test( "pose", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + QUnit.test( "normalizeSkinWeights", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + QUnit.test( "updateMatrixWorld", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + QUnit.test( "clone", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
cf98f0a3c461c7109ba0ae722563f7ff71af9ba4.json
Add objects es6 unit tests
test/unit/src/objects/Sprite.tests.js
@@ -0,0 +1,47 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { Sprite } from '../../../../src/objects/Sprite'; + +export default QUnit.module( 'Objects', () => { + + QUnit.module.todo( 'Sprite', () => { + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "isSprite", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "raycast", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "clone", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
f74b17963d5e16c0195771b1aaa2e9b0727fbf48.json
Add loaders es6 unit tests
test/unit/src/loaders/AnimationLoader.tests.js
@@ -0,0 +1,34 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { AnimationLoader } from '../../../../src/loaders/AnimationLoader'; + +export default QUnit.module( 'Loaders', () => { + + QUnit.module.todo( 'AnimationLoader', () => { + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "load", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "parse", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
f74b17963d5e16c0195771b1aaa2e9b0727fbf48.json
Add loaders es6 unit tests
test/unit/src/loaders/AudioLoader.tests.js
@@ -0,0 +1,28 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { AudioLoader } from '../../../../src/loaders/AudioLoader'; + +export default QUnit.module( 'Loaders', () => { + + QUnit.module.todo( 'AudioLoader', () => { + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "load", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
f74b17963d5e16c0195771b1aaa2e9b0727fbf48.json
Add loaders es6 unit tests
test/unit/src/loaders/BufferGeometryLoader.tests.js
@@ -0,0 +1,34 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { BufferGeometryLoader } from '../../../../src/loaders/BufferGeometryLoader'; + +export default QUnit.module( 'Loaders', () => { + + QUnit.module.todo( 'BufferGeometryLoader', () => { + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "load", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "parse", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
f74b17963d5e16c0195771b1aaa2e9b0727fbf48.json
Add loaders es6 unit tests
test/unit/src/loaders/Cache.tests.js
@@ -0,0 +1,39 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { Cache } from '../../../../src/loaders/Cache'; + +export default QUnit.module( 'Loaders', () => { + + QUnit.module.todo( 'Cache', () => { + + // PUBLIC STUFF + QUnit.test( "add", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "get", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "remove", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "clear", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
f74b17963d5e16c0195771b1aaa2e9b0727fbf48.json
Add loaders es6 unit tests
test/unit/src/loaders/CompressedTextureLoader.tests.js
@@ -0,0 +1,34 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { CompressedTextureLoader } from '../../../../src/loaders/CompressedTextureLoader'; + +export default QUnit.module( 'Loaders', () => { + + QUnit.module.todo( 'CompressedTextureLoader', () => { + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "load", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "setPath", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
f74b17963d5e16c0195771b1aaa2e9b0727fbf48.json
Add loaders es6 unit tests
test/unit/src/loaders/CubeTextureLoader.tests.js
@@ -0,0 +1,40 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { CubeTextureLoader } from '../../../../src/loaders/CubeTextureLoader'; + +export default QUnit.module( 'Loaders', () => { + + QUnit.module.todo( 'CubeTextureLoader', () => { + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "load", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "setCrossOrigin", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "setPath", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
f74b17963d5e16c0195771b1aaa2e9b0727fbf48.json
Add loaders es6 unit tests
test/unit/src/loaders/DataTextureLoader.tests.js
@@ -0,0 +1,28 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { DataTextureLoader } from '../../../../src/loaders/DataTextureLoader'; + +export default QUnit.module( 'Loaders', () => { + + QUnit.module.todo( 'DataTextureLoader', () => { + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "load", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
f74b17963d5e16c0195771b1aaa2e9b0727fbf48.json
Add loaders es6 unit tests
test/unit/src/loaders/FileLoader.tests.js
@@ -0,0 +1,58 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { FileLoader } from '../../../../src/loaders/FileLoader'; + +export default QUnit.module( 'Loaders', () => { + + QUnit.module.todo( 'FileLoader', () => { + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "load", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "setPath", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "setResponseType", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "setWithCredentials", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "setMimeType", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "setRequestHeader", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
f74b17963d5e16c0195771b1aaa2e9b0727fbf48.json
Add loaders es6 unit tests
test/unit/src/loaders/FontLoader.tests.js
@@ -0,0 +1,40 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { FontLoader } from '../../../../src/loaders/FontLoader'; + +export default QUnit.module( 'Loaders', () => { + + QUnit.module.todo( 'FontLoader', () => { + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "load", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "parse", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "setPath", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
f74b17963d5e16c0195771b1aaa2e9b0727fbf48.json
Add loaders es6 unit tests
test/unit/src/loaders/ImageLoader.tests.js
@@ -0,0 +1,40 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { ImageLoader } from '../../../../src/loaders/ImageLoader'; + +export default QUnit.module( 'Loaders', () => { + + QUnit.module.todo( 'ImageLoader', () => { + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "load", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "setCrossOrigin", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "setPath", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
f74b17963d5e16c0195771b1aaa2e9b0727fbf48.json
Add loaders es6 unit tests
test/unit/src/loaders/JSONLoader.tests.js
@@ -0,0 +1,40 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { JSONLoader } from '../../../../src/loaders/JSONLoader'; + +export default QUnit.module( 'Loaders', () => { + + QUnit.module.todo( 'JSONLoader', () => { + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "load", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "setTexturePath", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "parse", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
f74b17963d5e16c0195771b1aaa2e9b0727fbf48.json
Add loaders es6 unit tests
test/unit/src/loaders/Loader.tests.js
@@ -0,0 +1,53 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { Loader } from '../../../../src/loaders/Loader'; + +export default QUnit.module( 'Loaders', () => { + + QUnit.module.todo( 'Loader', () => { + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // STATIC STUFF + QUnit.test( "Handlers.add", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "Handlers.get", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "extractUrlBase", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "initMaterials", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "createMaterial", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
f74b17963d5e16c0195771b1aaa2e9b0727fbf48.json
Add loaders es6 unit tests
test/unit/src/loaders/LoadingManager.tests.js
@@ -0,0 +1,64 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { LoadingManager } from '../../../../src/loaders/LoadingManager'; + +export default QUnit.module( 'Loaders', () => { + + QUnit.module.todo( 'LoadingManager', () => { + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "onStart", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "onLoad", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "onProgress", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "onError", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "itemStart", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "itemEnd", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "itemError", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
f74b17963d5e16c0195771b1aaa2e9b0727fbf48.json
Add loaders es6 unit tests
test/unit/src/loaders/MaterialLoader.tests.js
@@ -0,0 +1,40 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { MaterialLoader } from '../../../../src/loaders/MaterialLoader'; + +export default QUnit.module( 'Loaders', () => { + + QUnit.module.todo( 'MaterialLoader', () => { + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "load", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "setTextures", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "parse", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
f74b17963d5e16c0195771b1aaa2e9b0727fbf48.json
Add loaders es6 unit tests
test/unit/src/loaders/ObjectLoader.tests.js
@@ -0,0 +1,82 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { ObjectLoader } from '../../../../src/loaders/ObjectLoader'; + +export default QUnit.module( 'Loaders', () => { + + QUnit.module.todo( 'ObjectLoader', () => { + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "load", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "setTexturePath", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "setCrossOrigin", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "parse", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "parseGeometries", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "parseMaterials", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "parseAnimations", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "parseImages", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "parseTextures", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "parseObject", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
f74b17963d5e16c0195771b1aaa2e9b0727fbf48.json
Add loaders es6 unit tests
test/unit/src/loaders/TextureLoader.tests.js
@@ -0,0 +1,40 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { TextureLoader } from '../../../../src/loaders/TextureLoader'; + +export default QUnit.module( 'Loaders', () => { + + QUnit.module.todo( 'TextureLoader', () => { + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // PUBLIC STUFF + QUnit.test( "load", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "setCrossOrigin", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + QUnit.test( "setPath", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
1061e2e0cd220d84c1a6a14814ae8514cd04ef78.json
Add geometries es6 unit tests
test/unit/src/geometries/BoxGeometry.tests.js
@@ -0,0 +1,104 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + * @author Anonymous + */ +/* global QUnit */ + +import { + BoxGeometry, + BoxBufferGeometry +} from '../../../../src/geometries/BoxGeometry'; + +export default QUnit.module( 'Geometries', () => { + + QUnit.module.todo( 'BoxGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + width: 10, + height: 20, + depth: 30, + widthSegments: 2, + heightSegments: 3, + depthSegments: 4 + }; + + geometries = [ + new BoxGeometry(), + new BoxGeometry( parameters.width, parameters.height, parameters.depth ), + new BoxGeometry( parameters.width, parameters.height, parameters.depth, parameters.widthSegments, parameters.heightSegments, parameters.depthSegments ) + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + + QUnit.module.todo( 'BoxBufferGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + width: 10, + height: 20, + depth: 30, + widthSegments: 2, + heightSegments: 3, + depthSegments: 4 + }; + + geometries = [ + new BoxBufferGeometry(), + new BoxBufferGeometry( parameters.width, parameters.height, parameters.depth ), + new BoxBufferGeometry( parameters.width, parameters.height, parameters.depth, parameters.widthSegments, parameters.heightSegments, parameters.depthSegments ) + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
1061e2e0cd220d84c1a6a14814ae8514cd04ef78.json
Add geometries es6 unit tests
test/unit/src/geometries/CircleGeometry.tests.js
@@ -0,0 +1,104 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + * @author Anonymous + */ +/* global QUnit */ + +import { + CircleGeometry, + CircleBufferGeometry +} from '../../../../src/geometries/CircleGeometry'; + +export default QUnit.module( 'Geometries', () => { + + QUnit.module.todo( 'CircleGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + radius: 10, + segments: 20, + thetaStart: 0.1, + thetaLength: 0.2 + }; + + geometries = [ + new CircleGeometry(), + new CircleGeometry( parameters.radius ), + new CircleGeometry( parameters.radius, parameters.segments ), + new CircleGeometry( parameters.radius, parameters.segments, parameters.thetaStart ), + new CircleGeometry( parameters.radius, parameters.segments, parameters.thetaStart, parameters.thetaLength ), + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + + QUnit.module.todo( 'CircleBufferGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + radius: 10, + segments: 20, + thetaStart: 0.1, + thetaLength: 0.2 + }; + + geometries = [ + new CircleBufferGeometry(), + new CircleBufferGeometry( parameters.radius ), + new CircleBufferGeometry( parameters.radius, parameters.segments ), + new CircleBufferGeometry( parameters.radius, parameters.segments, parameters.thetaStart ), + new CircleBufferGeometry( parameters.radius, parameters.segments, parameters.thetaStart, parameters.thetaLength ), + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
1061e2e0cd220d84c1a6a14814ae8514cd04ef78.json
Add geometries es6 unit tests
test/unit/src/geometries/ConeGeometry.tests.js
@@ -0,0 +1,85 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { + ConeGeometry, + ConeBufferGeometry +} from '../../../../src/geometries/ConeGeometry'; + +export default QUnit.module( 'Geometries', () => { + + QUnit.module.todo( 'ConeGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = {}; + + geometries = [ + new ConeGeometry() + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + + QUnit.module.todo( 'ConeBufferGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = {}; + + geometries = [ + new ConeBufferGeometry() + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
1061e2e0cd220d84c1a6a14814ae8514cd04ef78.json
Add geometries es6 unit tests
test/unit/src/geometries/CylinderGeometry.tests.js
@@ -0,0 +1,120 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + * @author Anonymous + */ +/* global QUnit */ + +import { + CylinderGeometry, + CylinderBufferGeometry +} from '../../../../src/geometries/CylinderGeometry'; + +export default QUnit.module( 'Geometries', () => { + + QUnit.module.todo( 'CylinderGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + radiusTop: 10, + radiusBottom: 20, + height: 30, + radialSegments: 20, + heightSegments: 30, + openEnded: true, + thetaStart: 0.1, + thetaLength: 2.0, + }; + + geometries = [ + new CylinderGeometry(), + new CylinderGeometry( parameters.radiusTop ), + new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom ), + new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height ), + new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments ), + new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments ), + new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded ), + new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded, parameters.thetaStart ), + new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded, parameters.thetaStart, parameters.thetaLength ), + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + + QUnit.module.todo( 'CylinderBufferGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + radiusTop: 10, + radiusBottom: 20, + height: 30, + radialSegments: 20, + heightSegments: 30, + openEnded: true, + thetaStart: 0.1, + thetaLength: 2.0, + }; + + geometries = [ + new CylinderBufferGeometry(), + new CylinderBufferGeometry( parameters.radiusTop ), + new CylinderBufferGeometry( parameters.radiusTop, parameters.radiusBottom ), + new CylinderBufferGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height ), + new CylinderBufferGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments ), + new CylinderBufferGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments ), + new CylinderBufferGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded ), + new CylinderBufferGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded, parameters.thetaStart ), + new CylinderBufferGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded, parameters.thetaStart, parameters.thetaLength ), + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
1061e2e0cd220d84c1a6a14814ae8514cd04ef78.json
Add geometries es6 unit tests
test/unit/src/geometries/DodecahedronGeometry.tests.js
@@ -0,0 +1,96 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + * @author Anonymous + */ +/* global QUnit */ + +import { + DodecahedronGeometry, + DodecahedronBufferGeometry +} from '../../../../src/geometries/DodecahedronGeometry'; + +export default QUnit.module( 'Geometries', () => { + + QUnit.module.todo( 'CircleGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + radius: 10, + detail: undefined + }; + + geometries = [ + new DodecahedronGeometry(), + new DodecahedronGeometry( parameters.radius ), + new DodecahedronGeometry( parameters.radius, parameters.detail ), + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + + QUnit.module.todo( 'CircleBufferGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + radius: 10, + detail: undefined + }; + + geometries = [ + new DodecahedronBufferGeometry(), + new DodecahedronBufferGeometry( parameters.radius ), + new DodecahedronBufferGeometry( parameters.radius, parameters.detail ), + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
1061e2e0cd220d84c1a6a14814ae8514cd04ef78.json
Add geometries es6 unit tests
test/unit/src/geometries/EdgesGeometry.tests.js
@@ -0,0 +1,310 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + * @author Anonymous + */ +/* global QUnit */ + +import { EdgesGeometry } from '../../../../src/geometries/EdgesGeometry'; +import { Geometry } from '../../../../src/core/Geometry'; +import { BufferGeometry } from '../../../../src/core/BufferGeometry'; +import { BufferAttribute } from '../../../../src/core/BufferAttribute'; +import { Vector3 } from '../../../../src/math/Vector3'; + +// DEBUGGING +import { Scene } from '../../../../src/scenes/Scene'; +import { Mesh } from '../../../../src/objects/Mesh'; +import { LineSegments } from '../../../../src/objects/LineSegments'; +import { LineBasicMaterial } from '../../../../src/materials/LineBasicMaterial'; +import { WebGLRenderer } from '../../../../src/renderers/WebGLRenderer'; +import { PerspectiveCamera } from '../../../../src/cameras/PerspectiveCamera'; + +// +// HELPERS +// + +function testEdges( vertList, idxList, numAfter, assert ) { + + var geoms = createGeometries( vertList, idxList ); + + for ( var i = 0; i < geoms.length; i ++ ) { + + var geom = geoms[ i ]; + + var numBefore = idxList.length; + assert.equal( countEdges( geom ), numBefore, "Edges before!" ); + + var egeom = new EdgesGeometry( geom ); + + assert.equal( countEdges( egeom ), numAfter, "Edges after!" ); + output( geom, egeom ); + + } + +} + +function createGeometries( vertList, idxList ) { + + var geomIB = createIndexedBufferGeometry( vertList, idxList ); + var geom = new Geometry().fromBufferGeometry( geomIB ); + var geomB = new BufferGeometry().fromGeometry( geom ); + var geomDC = addDrawCalls( geomIB.clone() ); + return [ geom, geomB, geomIB, geomDC ]; + +} + +function createIndexedBufferGeometry( vertList, idxList ) { + + var geom = new BufferGeometry(); + + var indexTable = []; + var numTris = idxList.length / 3; + var numVerts = 0; + + var indices = new Uint32Array( numTris * 3 ); + var vertices = new Float32Array( vertList.length * 3 ); + + for ( var i = 0; i < numTris; i ++ ) { + + for ( var j = 0; j < 3; j ++ ) { + + var idx = idxList[ 3 * i + j ]; + if ( indexTable[ idx ] === undefined ) { + + var v = vertList[ idx ]; + vertices[ 3 * numVerts ] = v.x; + vertices[ 3 * numVerts + 1 ] = v.y; + vertices[ 3 * numVerts + 2 ] = v.z; + + indexTable[ idx ] = numVerts; + + numVerts ++; + + } + + indices[ 3 * i + j ] = indexTable[ idx ]; + + } + + } + + vertices = vertices.subarray( 0, 3 * numVerts ); + + geom.setIndex( new BufferAttribute( indices, 1 ) ); + geom.addAttribute( 'position', new BufferAttribute( vertices, 3 ) ); + + geom.computeFaceNormals(); + + return geom; + +} + +function addDrawCalls( geometry ) { + + var numTris = geometry.index.count / 3; + + for ( var i = 0; i < numTris; i ++ ) { + + var start = i * 3; + var count = 3; + + geometry.addGroup( start, count ); + + } + + return geometry; + +} + +function countEdges( geom ) { + + if ( geom instanceof EdgesGeometry ) { + + return geom.getAttribute( 'position' ).count / 2; + + } + + if ( geom.faces !== undefined ) { + + return geom.faces.length * 3; + + } + + var indices = geom.index; + if ( indices ) { + + return indices.count; + + } + + return geom.getAttribute( 'position' ).count; + +} + +// +// DEBUGGING +// +var DEBUG = false; +var renderer; +var camera; +var scene = new Scene(); +var xoffset = 0; + +function output( geom, egeom ) { + + if ( DEBUG !== true ) return; + + if ( ! renderer ) initDebug(); + + var mesh = new Mesh( geom, undefined ); + var edges = new LineSegments( egeom, new LineBasicMaterial( { color: 'black' } ) ); + + mesh.position.setX( xoffset ); + edges.position.setX( xoffset ++ ); + scene.add( mesh ); + scene.add( edges ); + + if ( scene.children.length % 8 === 0 ) { + + xoffset += 2; + + } + +} + +function initDebug() { + + renderer = new WebGLRenderer( { + + antialias: true + + } ); + + var width = 600; + var height = 480; + + renderer.setSize( width, height ); + renderer.setClearColor( 0xCCCCCC ); + + camera = new PerspectiveCamera( 45, width / height, 1, 100 ); + camera.position.x = 30; + camera.position.z = 40; + camera.lookAt( new Vector3( 30, 0, 0 ) ); + + document.body.appendChild( renderer.domElement ); + + var controls = new THREE.OrbitControls( camera, renderer.domElement ); // TODO: please do somethings for that -_-' + controls.target = new Vector3( 30, 0, 0 ); + + animate(); + + function animate() { + + requestAnimationFrame( animate ); + + controls.update(); + + renderer.render( scene, camera ); + + } + +} + +export default QUnit.module( 'Geometries', () => { + + QUnit.module.todo( 'EdgesGeometry', () => { + + var vertList = [ + new Vector3( 0, 0, 0 ), + new Vector3( 1, 0, 0 ), + new Vector3( 1, 1, 0 ), + new Vector3( 0, 1, 0 ), + new Vector3( 1, 1, 1 ), + ]; + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( "singularity", ( assert ) => { + + testEdges( vertList, [ 1, 1, 1 ], 0, assert ); + + } ); + + QUnit.test( "needle", ( assert ) => { + + testEdges( vertList, [ 0, 0, 1 ], 0, assert ); + + } ); + + QUnit.test( "single triangle", ( assert ) => { + + testEdges( vertList, [ 0, 1, 2 ], 3, assert ); + + } ); + + QUnit.test( "two isolated triangles", ( assert ) => { + + var vertList = [ + new Vector3( 0, 0, 0 ), + new Vector3( 1, 0, 0 ), + new Vector3( 1, 1, 0 ), + new Vector3( 0, 0, 1 ), + new Vector3( 1, 0, 1 ), + new Vector3( 1, 1, 1 ), + ]; + + testEdges( vertList, [ 0, 1, 2, 3, 4, 5 ], 6, assert ); + + } ); + + QUnit.test( "two flat triangles", ( assert ) => { + + testEdges( vertList, [ 0, 1, 2, 0, 2, 3 ], 4, assert ); + + } ); + + QUnit.test( "two flat triangles, inverted", ( assert ) => { + + testEdges( vertList, [ 0, 1, 2, 0, 3, 2 ], 5, assert ); + + } ); + + QUnit.test( "two non-coplanar triangles", ( assert ) => { + + testEdges( vertList, [ 0, 1, 2, 0, 4, 2 ], 5, assert ); + + } ); + + QUnit.test( "three triangles, coplanar first", ( assert ) => { + + testEdges( vertList, [ 0, 1, 2, 0, 2, 3, 0, 4, 2 ], 7, assert ); + + } ); + + QUnit.test( "three triangles, coplanar last", ( assert ) => { + + testEdges( vertList, [ 0, 1, 2, 0, 4, 2, 0, 2, 3 ], 6, assert ); // Should be 7 + + } ); + + QUnit.test( "tetrahedron", ( assert ) => { + + testEdges( vertList, [ 0, 1, 2, 0, 1, 4, 0, 4, 2, 1, 2, 4 ], 6, assert ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
1061e2e0cd220d84c1a6a14814ae8514cd04ef78.json
Add geometries es6 unit tests
test/unit/src/geometries/ExtrudeGeometry.tests.js
@@ -0,0 +1,76 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { ExtrudeGeometry, ExtrudeBufferGeometry } from '../../../../src/geometries/ExtrudeGeometry'; + +export default QUnit.module( 'Geometries', () => { + + QUnit.module.todo( 'ExtrudeGeometry', () => { + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + } ); + + QUnit.module.todo( 'ExtrudeBufferGeometry', () => { + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // STATIC STUFF + QUnit.test( "WorldUVGenerator.generateTopUV", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + QUnit.test( "WorldUVGenerator.generateSideWallUV", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( "getArrays", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + QUnit.test( "addShapeList", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + QUnit.test( "addShape", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + + } ); + +} );
true
Other
mrdoob
three.js
1061e2e0cd220d84c1a6a14814ae8514cd04ef78.json
Add geometries es6 unit tests
test/unit/src/geometries/IcosahedronGeometry.tests.js
@@ -0,0 +1,96 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + * @author Anonymous + */ +/* global QUnit */ + +import { + IcosahedronGeometry, + IcosahedronBufferGeometry +} from '../../../../src/geometries/IcosahedronGeometry'; + +export default QUnit.module( 'Geometries', () => { + + QUnit.module.todo( 'IcosahedronGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + radius: 10, + detail: undefined + }; + + geometries = [ + new IcosahedronGeometry(), + new IcosahedronGeometry( parameters.radius ), + new IcosahedronGeometry( parameters.radius, parameters.detail ), + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + + QUnit.module.todo( 'IcosahedronBufferGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + radius: 10, + detail: undefined + }; + + geometries = [ + new IcosahedronBufferGeometry(), + new IcosahedronBufferGeometry( parameters.radius ), + new IcosahedronBufferGeometry( parameters.radius, parameters.detail ), + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
1061e2e0cd220d84c1a6a14814ae8514cd04ef78.json
Add geometries es6 unit tests
test/unit/src/geometries/LatheGeometry.tests.js
@@ -0,0 +1,97 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { + LatheGeometry, + LatheBufferGeometry +} from '../../../../src/geometries/LatheGeometry'; + +export default QUnit.module( 'Geometries', () => { + + QUnit.module.todo( 'LatheGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + points: [], + segments: 0, + phiStart: 0, + phiLength: 0 + }; + + geometries = [ + // new LatheGeometry(), // Todo: error for undefined point + new LatheGeometry( parameters.points ) + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + + QUnit.module.todo( 'LatheBufferGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + points: [], + segments: 0, + phiStart: 0, + phiLength: 0 + }; + + geometries = [ + // new LatheBufferGeometry(), // Todo: error for undefined point + new LatheBufferGeometry( parameters.points ) + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
1061e2e0cd220d84c1a6a14814ae8514cd04ef78.json
Add geometries es6 unit tests
test/unit/src/geometries/OctahedronGeometry.tests.js
@@ -0,0 +1,96 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + * @author Anonymous + */ +/* global QUnit */ + +import { + OctahedronGeometry, + OctahedronBufferGeometry +} from '../../../../src/geometries/OctahedronGeometry'; + +export default QUnit.module( 'Geometries', () => { + + QUnit.module.todo( 'OctahedronGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + radius: 10, + detail: undefined + }; + + geometries = [ + new OctahedronGeometry(), + new OctahedronGeometry( parameters.radius ), + new OctahedronGeometry( parameters.radius, parameters.detail ), + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + + QUnit.module.todo( 'OctahedronBufferGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + radius: 10, + detail: undefined + }; + + geometries = [ + new OctahedronBufferGeometry(), + new OctahedronBufferGeometry( parameters.radius ), + new OctahedronBufferGeometry( parameters.radius, parameters.detail ), + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
1061e2e0cd220d84c1a6a14814ae8514cd04ef78.json
Add geometries es6 unit tests
test/unit/src/geometries/ParametricGeometry.tests.js
@@ -0,0 +1,85 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { + ParametricGeometry, + ParametricBufferGeometry +} from '../../../../src/geometries/ParametricGeometry'; + +export default QUnit.module( 'Geometries', () => { + + QUnit.module.todo( 'ParametricGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = {}; + + geometries = [ + new ParametricGeometry() + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + + QUnit.module.todo( 'ParametricBufferGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = {}; + + geometries = [ + new ParametricBufferGeometry() + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
1061e2e0cd220d84c1a6a14814ae8514cd04ef78.json
Add geometries es6 unit tests
test/unit/src/geometries/PlaneGeometry.tests.js
@@ -0,0 +1,104 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + * @author Anonymous + */ +/* global QUnit */ + +import { + PlaneGeometry, + PlaneBufferGeometry +} from '../../../../src/geometries/PlaneGeometry'; + +export default QUnit.module( 'Geometries', () => { + + QUnit.module.todo( 'PlaneGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + width: 10, + height: 30, + widthSegments: 3, + heightSegments: 5 + }; + + geometries = [ + new PlaneGeometry(), + new PlaneGeometry( parameters.width ), + new PlaneGeometry( parameters.width, parameters.height ), + new PlaneGeometry( parameters.width, parameters.height, parameters.widthSegments ), + new PlaneGeometry( parameters.width, parameters.height, parameters.widthSegments, parameters.heightSegments ), + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + + QUnit.module.todo( 'PlaneBufferGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + width: 10, + height: 30, + widthSegments: 3, + heightSegments: 5 + }; + + geometries = [ + new PlaneBufferGeometry(), + new PlaneBufferGeometry( parameters.width ), + new PlaneBufferGeometry( parameters.width, parameters.height ), + new PlaneBufferGeometry( parameters.width, parameters.height, parameters.widthSegments ), + new PlaneBufferGeometry( parameters.width, parameters.height, parameters.widthSegments, parameters.heightSegments ), + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
1061e2e0cd220d84c1a6a14814ae8514cd04ef78.json
Add geometries es6 unit tests
test/unit/src/geometries/PolyhedronGeometry.tests.js
@@ -0,0 +1,85 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { + PolyhedronGeometry, + PolyhedronBufferGeometry +} from '../../../../src/geometries/PolyhedronGeometry'; + +export default QUnit.module( 'Geometries', () => { + + QUnit.module.todo( 'PolyhedronGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = {}; + + geometries = [ + new PolyhedronGeometry() + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + + QUnit.module.todo( 'PolyhedronBufferGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = {}; + + geometries = [ + new PolyhedronBufferGeometry() + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
1061e2e0cd220d84c1a6a14814ae8514cd04ef78.json
Add geometries es6 unit tests
test/unit/src/geometries/RingGeometry.tests.js
@@ -0,0 +1,112 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + * @author Anonymous + */ +/* global QUnit */ + +import { + RingGeometry, + RingBufferGeometry +} from '../../../../src/geometries/RingGeometry'; + +export default QUnit.module( 'Geometries', () => { + + QUnit.module.todo( 'RingGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + innerRadius: 10, + outerRadius: 60, + thetaSegments: 12, + phiSegments: 14, + thetaStart: 0.1, + thetaLength: 2.0 + }; + + geometries = [ + new RingGeometry(), + new RingGeometry( parameters.innerRadius ), + new RingGeometry( parameters.innerRadius, parameters.outerRadius ), + new RingGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments ), + new RingGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments ), + new RingGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments, parameters.thetaStart ), + new RingGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments, parameters.thetaStart, parameters.thetaLength ), + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + + QUnit.module.todo( 'RingBufferGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + innerRadius: 10, + outerRadius: 60, + thetaSegments: 12, + phiSegments: 14, + thetaStart: 0.1, + thetaLength: 2.0 + }; + + geometries = [ + new RingBufferGeometry(), + new RingBufferGeometry( parameters.innerRadius ), + new RingBufferGeometry( parameters.innerRadius, parameters.outerRadius ), + new RingBufferGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments ), + new RingBufferGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments ), + new RingBufferGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments, parameters.thetaStart ), + new RingBufferGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments, parameters.thetaStart, parameters.thetaLength ), + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
1061e2e0cd220d84c1a6a14814ae8514cd04ef78.json
Add geometries es6 unit tests
test/unit/src/geometries/ShapeGeometry.tests.js
@@ -0,0 +1,85 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { + ShapeGeometry, + ShapeBufferGeometry +} from '../../../../src/geometries/ShapeGeometry'; + +export default QUnit.module( 'Geometries', () => { + + QUnit.module.todo( 'ShapeGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = {}; + + geometries = [ + new ShapeGeometry() + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + + QUnit.module.todo( 'ShapeBufferGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = {}; + + geometries = [ + new ShapeBufferGeometry() + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
1061e2e0cd220d84c1a6a14814ae8514cd04ef78.json
Add geometries es6 unit tests
test/unit/src/geometries/SphereGeometry.tests.js
@@ -0,0 +1,116 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + * @author Anonymous + */ +/* global QUnit */ + +import { + SphereGeometry, + SphereBufferGeometry +} from '../../../../src/geometries/SphereGeometry'; + +export default QUnit.module( 'Geometries', () => { + + QUnit.module.todo( 'SphereGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + radius: 10, + widthSegments: 20, + heightSegments: 30, + phiStart: 0.5, + phiLength: 1.0, + thetaStart: 0.4, + thetaLength: 2.0, + }; + + geometries = [ + new SphereGeometry(), + new SphereGeometry( parameters.radius ), + new SphereGeometry( parameters.radius, parameters.widthSegments ), + new SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments ), + new SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart ), + new SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength ), + new SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart ), + new SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart, parameters.thetaLength ), + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + + QUnit.module.todo( 'SphereBufferGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + radius: 10, + widthSegments: 20, + heightSegments: 30, + phiStart: 0.5, + phiLength: 1.0, + thetaStart: 0.4, + thetaLength: 2.0, + }; + + geometries = [ + new SphereBufferGeometry(), + new SphereBufferGeometry( parameters.radius ), + new SphereBufferGeometry( parameters.radius, parameters.widthSegments ), + new SphereBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments ), + new SphereBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart ), + new SphereBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength ), + new SphereBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart ), + new SphereBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart, parameters.thetaLength ), + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
1061e2e0cd220d84c1a6a14814ae8514cd04ef78.json
Add geometries es6 unit tests
test/unit/src/geometries/TetrahedronGeometry.tests.js
@@ -0,0 +1,106 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + * @author Anonymous + */ +/* global QUnit */ + +import { + TetrahedronGeometry, + TetrahedronBufferGeometry +} from '../../../../src/geometries/TetrahedronGeometry'; + +export default QUnit.module( 'Geometries', () => { + + QUnit.module.todo( 'TetrahedronGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + radius: 10, + detail: undefined + }; + + geometries = [ + new TetrahedronGeometry(), + new TetrahedronGeometry( parameters.radius ), + new TetrahedronGeometry( parameters.radius, parameters.widthSegments ), + new TetrahedronGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments ), + new TetrahedronGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart ), + new TetrahedronGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength ), + new TetrahedronGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart ), + new TetrahedronGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart, parameters.thetaLength ), + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + + QUnit.module.todo( 'SphereBufferGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + radius: 10, + detail: undefined + }; + + geometries = [ + new TetrahedronBufferGeometry(), + new TetrahedronBufferGeometry( parameters.radius ), + new TetrahedronBufferGeometry( parameters.radius, parameters.widthSegments ), + new TetrahedronBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments ), + new TetrahedronBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart ), + new TetrahedronBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength ), + new TetrahedronBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart ), + new TetrahedronBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart, parameters.thetaLength ), + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
1061e2e0cd220d84c1a6a14814ae8514cd04ef78.json
Add geometries es6 unit tests
test/unit/src/geometries/TextGeometry.tests.js
@@ -0,0 +1,88 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + */ +/* global QUnit */ + +import { + TextGeometry, + TextBufferGeometry +} from '../../../../src/geometries/TextGeometry'; + +export default QUnit.module( 'Geometries', () => { + + QUnit.module.todo( 'TextGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + // TODO: we cannot load any font from Threejs package :S + const parameters = { + font: undefined + }; + + geometries = [ + new TextGeometry() + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + + QUnit.module.todo( 'TextBufferGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = {}; + + geometries = [ + new TextBufferGeometry() + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + +} );
true
Other
mrdoob
three.js
1061e2e0cd220d84c1a6a14814ae8514cd04ef78.json
Add geometries es6 unit tests
test/unit/src/geometries/TorusGeometry.tests.js
@@ -0,0 +1,108 @@ +/** + * @author TristanVALCKE / https://github.com/Itee + * @author Anonymous + */ +/* global QUnit */ + +import { + TorusGeometry, + TorusBufferGeometry +} from '../../../../src/geometries/TorusGeometry'; + +export default QUnit.module( 'Geometries', () => { + + QUnit.module.todo( 'TorusGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + radius: 10, + tube: 20, + radialSegments: 30, + tubularSegments: 10, + arc: 2.0, + }; + + geometries = [ + new TorusGeometry(), + new TorusGeometry( parameters.radius ), + new TorusGeometry( parameters.radius, parameters.tube ), + new TorusGeometry( parameters.radius, parameters.tube, parameters.radialSegments ), + new TorusGeometry( parameters.radius, parameters.tube, parameters.radialSegments, parameters.tubularSegments ), + new TorusGeometry( parameters.radius, parameters.tube, parameters.radialSegments, parameters.tubularSegments, parameters.arc ), + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + + QUnit.module.todo( 'TorusBufferGeometry', ( hooks ) => { + + var geometries = undefined; + hooks.beforeEach( function () { + + const parameters = { + radius: 10, + tube: 20, + radialSegments: 30, + tubularSegments: 10, + arc: 2.0, + }; + + geometries = [ + new TorusBufferGeometry(), + new TorusBufferGeometry( parameters.radius ), + new TorusBufferGeometry( parameters.radius, parameters.tube ), + new TorusBufferGeometry( parameters.radius, parameters.tube, parameters.radialSegments ), + new TorusBufferGeometry( parameters.radius, parameters.tube, parameters.radialSegments, parameters.tubularSegments ), + new TorusBufferGeometry( parameters.radius, parameters.tube, parameters.radialSegments, parameters.tubularSegments, parameters.arc ), + ]; + + } ); + + // INHERITANCE + QUnit.test( "Extending", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // INSTANCING + QUnit.test( "Instancing", ( assert ) => { + + assert.ok( false, "everything's gonna be alright" ); + + } ); + + // OTHERS + QUnit.test( 'Standard geometry tests', ( assert ) => { + + runStdGeometryTests( assert, geometries ); + + } ); + + } ); + +} );
true