From 40b53adb4816a806a66a4c156c38547ad5475431 Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Tue, 12 Mar 2013 22:19:33 +0100 Subject: [PATCH] Removed AsteriskGeometry. --- .../extras/geometries/AsteriskGeometry.html | 37 ----------------- docs/list.js | 1 - src/extras/geometries/AsteriskGeometry.js | 40 ------------------- src/extras/helpers/DirectionalLightHelper.js | 9 +---- src/extras/helpers/SpotLightHelper.js | 8 +--- utils/build/includes/extras.json | 1 - 6 files changed, 2 insertions(+), 94 deletions(-) delete mode 100644 docs/api/extras/geometries/AsteriskGeometry.html delete mode 100644 src/extras/geometries/AsteriskGeometry.js diff --git a/docs/api/extras/geometries/AsteriskGeometry.html b/docs/api/extras/geometries/AsteriskGeometry.html deleted file mode 100644 index 44ebee8223..0000000000 --- a/docs/api/extras/geometries/AsteriskGeometry.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - -

[name]

- -
todo
- - -

Constructor

- -

[name]( radius, detail )

- - -

Properties

- -

.[page:Vector3 todo]

- - -

Methods

- -

.todo( [page:Vector3 todo] )

-
- todo — todo
-
- - -

Source

- - [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] - - diff --git a/docs/list.js b/docs/list.js index f772d6f094..df083e0d5b 100644 --- a/docs/list.js +++ b/docs/list.js @@ -155,7 +155,6 @@ var list = { ], "Extras / Geometries": [ - [ "AsteriskGeometry", "api/extras/geometries/AsteriskGeometry" ], [ "CircleGeometry", "api/extras/geometries/CircleGeometry" ], [ "ConvexGeometry", "api/extras/geometries/ConvexGeometry" ], [ "CubeGeometry", "api/extras/geometries/CubeGeometry" ], diff --git a/src/extras/geometries/AsteriskGeometry.js b/src/extras/geometries/AsteriskGeometry.js deleted file mode 100644 index 9f39ac7d0f..0000000000 --- a/src/extras/geometries/AsteriskGeometry.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @author alteredq / http://alteredqualia.com/ - * - * - 3d asterisk shape (for line pieces THREE.Line) - */ - -THREE.AsteriskGeometry = function ( innerRadius, outerRadius ) { - - THREE.Geometry.call( this ); - - var sd = innerRadius; - var ed = outerRadius; - - var sd2 = 0.707 * sd; - var ed2 = 0.707 * ed; - - var rays = [ [ sd, 0, 0 ], [ ed, 0, 0 ], [ -sd, 0, 0 ], [ -ed, 0, 0 ], - [ 0, sd, 0 ], [ 0, ed, 0 ], [ 0, -sd, 0 ], [ 0, -ed, 0 ], - [ 0, 0, sd ], [ 0, 0, ed ], [ 0, 0, -sd ], [ 0, 0, -ed ], - [ sd2, sd2, 0 ], [ ed2, ed2, 0 ], [ -sd2, -sd2, 0 ], [ -ed2, -ed2, 0 ], - [ sd2, -sd2, 0 ], [ ed2, -ed2, 0 ], [ -sd2, sd2, 0 ], [ -ed2, ed2, 0 ], - [ sd2, 0, sd2 ], [ ed2, 0, ed2 ], [ -sd2, 0, -sd2 ], [ -ed2, 0, -ed2 ], - [ sd2, 0, -sd2 ], [ ed2, 0, -ed2 ], [ -sd2, 0, sd2 ], [ -ed2, 0, ed2 ], - [ 0, sd2, sd2 ], [ 0, ed2, ed2 ], [ 0, -sd2, -sd2 ], [ 0, -ed2, -ed2 ], - [ 0, sd2, -sd2 ], [ 0, ed2, -ed2 ], [ 0, -sd2, sd2 ], [ 0, -ed2, ed2 ] - ]; - - for ( var i = 0, il = rays.length; i < il; i ++ ) { - - var x = rays[ i ][ 0 ]; - var y = rays[ i ][ 1 ]; - var z = rays[ i ][ 2 ]; - - this.vertices.push( new THREE.Vector3( x, y, z ) ); - - } - -}; - -THREE.AsteriskGeometry.prototype = Object.create( THREE.Geometry.prototype ); \ No newline at end of file diff --git a/src/extras/helpers/DirectionalLightHelper.js b/src/extras/helpers/DirectionalLightHelper.js index 2db140648b..135c52a9ad 100644 --- a/src/extras/helpers/DirectionalLightHelper.js +++ b/src/extras/helpers/DirectionalLightHelper.js @@ -31,17 +31,11 @@ THREE.DirectionalLightHelper = function ( light, sphereSize ) { // light helper var bulbGeometry = new THREE.SphereGeometry( sphereSize, 16, 8 ); - var raysGeometry = new THREE.AsteriskGeometry( sphereSize * 1.25, sphereSize * 2.25 ); - var bulbMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false } ); - var raysMaterial = new THREE.LineBasicMaterial( { color: hexColor, fog: false } ); this.lightSphere = new THREE.Mesh( bulbGeometry, bulbMaterial ); - this.lightRays = new THREE.Line( raysGeometry, raysMaterial, THREE.LinePieces ); - this.add( this.lightSphere ); - this.add( this.lightRays ); this.lightSphere.userData.isGizmo = true; this.lightSphere.userData.gizmoSubject = light; @@ -89,7 +83,7 @@ THREE.DirectionalLightHelper.prototype.update = function () { this.direction.subVectors( this.light.target.position, this.light.position ); - // update arrow, spheres, rays and line colors to light color * light intensity + // update arrow, spheres and line colors to light color * light intensity var intensity = THREE.Math.clamp( this.light.intensity, 0, 1 ); @@ -97,7 +91,6 @@ THREE.DirectionalLightHelper.prototype.update = function () { this.color.multiplyScalar( intensity ); this.lightSphere.material.color.copy( this.color ); - this.lightRays.material.color.copy( this.color ); // Only update targetSphere and targetLine if available if ( this.targetSphere !== null ) { diff --git a/src/extras/helpers/SpotLightHelper.js b/src/extras/helpers/SpotLightHelper.js index 9071ac8b12..56146af534 100644 --- a/src/extras/helpers/SpotLightHelper.js +++ b/src/extras/helpers/SpotLightHelper.js @@ -31,7 +31,6 @@ THREE.SpotLightHelper = function ( light, sphereSize ) { // light helper var bulbGeometry = new THREE.SphereGeometry( sphereSize, 16, 8 ); - var raysGeometry = new THREE.AsteriskGeometry( sphereSize * 1.25, sphereSize * 2.25 ); var coneGeometry = new THREE.CylinderGeometry( 0.0001, 1, 1, 8, 1, true ); var coneMatrix = new THREE.Matrix4(); @@ -40,7 +39,6 @@ THREE.SpotLightHelper = function ( light, sphereSize ) { coneGeometry.applyMatrix( coneMatrix ); var bulbMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false } ); - var raysMaterial = new THREE.LineBasicMaterial( { color: hexColor, fog: false } ); var coneMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false, wireframe: true, opacity: 0.3, transparent: true } ); this.lightSphere = new THREE.Mesh( bulbGeometry, bulbMaterial ); @@ -50,12 +48,9 @@ THREE.SpotLightHelper = function ( light, sphereSize ) { var coneWidth = coneLength * Math.tan( light.angle * 0.5 ) * 2; this.lightCone.scale.set( coneWidth, coneWidth, coneLength ); - this.lightRays = new THREE.Line( raysGeometry, raysMaterial, THREE.LinePieces ); - this.gyroscope = new THREE.Gyroscope(); this.gyroscope.add( this.lightSphere ); - this.gyroscope.add( this.lightRays ); this.add( this.gyroscope ); this.add( this.lightCone ); @@ -116,7 +111,7 @@ THREE.SpotLightHelper.prototype.update = function () { var coneWidth = coneLength * Math.tan( this.light.angle * 0.5 ) * 2; this.lightCone.scale.set( coneWidth, coneWidth, coneLength ); - // update arrow, spheres, rays and line colors to light color * light intensity + // update arrow, spheres and line colors to light color * light intensity var intensity = THREE.Math.clamp( this.light.intensity, 0, 1 ); @@ -124,7 +119,6 @@ THREE.SpotLightHelper.prototype.update = function () { this.color.multiplyScalar( intensity ); this.lightSphere.material.color.copy( this.color ); - this.lightRays.material.color.copy( this.color ); this.lightCone.material.color.copy( this.color ); // Only update targetSphere and targetLine if available diff --git a/utils/build/includes/extras.json b/utils/build/includes/extras.json index 564c85acaa..31c8e44438 100644 --- a/utils/build/includes/extras.json +++ b/utils/build/includes/extras.json @@ -13,7 +13,6 @@ "src/extras/animation/KeyFrameAnimation.js", "src/extras/cameras/CubeCamera.js", "src/extras/cameras/CombinedCamera.js", - "src/extras/geometries/AsteriskGeometry.js", "src/extras/geometries/CircleGeometry.js", "src/extras/geometries/CubeGeometry.js", "src/extras/geometries/CylinderGeometry.js", -- GitLab