Przeglądaj źródła

Editor: Geometries code simplified.

Mr.doob 11 lat temu
rodzic
commit
b1555bae18

+ 5 - 1
editor/js/Menubar.Add.js

@@ -140,8 +140,12 @@ Menubar.Add = function ( editor ) {
 		var radius = 75;
 		var radius = 75;
 		var widthSegments = 32;
 		var widthSegments = 32;
 		var heightSegments = 16;
 		var heightSegments = 16;
+		var phiStart = 0;
+		var phiLength = Math.PI * 2;
+		var thetaStart = 0;
+		var thetaLength = Math.PI;
 
 
-		var geometry = new THREE.SphereGeometry( radius, widthSegments, heightSegments );
+		var geometry = new THREE.SphereGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength );
 		var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial() );
 		var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial() );
 		mesh.name = 'Sphere ' + ( ++ meshCount );
 		mesh.name = 'Sphere ' + ( ++ meshCount );
 
 

+ 7 - 7
editor/js/Sidebar.Geometry.BoxGeometry.js

@@ -2,12 +2,12 @@ Sidebar.Geometry.BoxGeometry = function ( signals, object ) {
 
 
 	var container = new UI.Panel();
 	var container = new UI.Panel();
 
 
-	var geometry = object.geometry;
+	var parameters = object.geometry.parameters;
 
 
 	// width
 	// width
 
 
 	var widthRow = new UI.Panel();
 	var widthRow = new UI.Panel();
-	var width = new UI.Number( geometry.parameters.width ).onChange( update );
+	var width = new UI.Number( parameters.width ).onChange( update );
 
 
 	widthRow.add( new UI.Text( 'Width' ).setWidth( '90px' ) );
 	widthRow.add( new UI.Text( 'Width' ).setWidth( '90px' ) );
 	widthRow.add( width );
 	widthRow.add( width );
@@ -17,7 +17,7 @@ Sidebar.Geometry.BoxGeometry = function ( signals, object ) {
 	// height
 	// height
 
 
 	var heightRow = new UI.Panel();
 	var heightRow = new UI.Panel();
-	var height = new UI.Number( geometry.parameters.height ).onChange( update );
+	var height = new UI.Number( parameters.height ).onChange( update );
 
 
 	heightRow.add( new UI.Text( 'Height' ).setWidth( '90px' ) );
 	heightRow.add( new UI.Text( 'Height' ).setWidth( '90px' ) );
 	heightRow.add( height );
 	heightRow.add( height );
@@ -27,7 +27,7 @@ Sidebar.Geometry.BoxGeometry = function ( signals, object ) {
 	// depth
 	// depth
 
 
 	var depthRow = new UI.Panel();
 	var depthRow = new UI.Panel();
-	var depth = new UI.Number( geometry.parameters.depth ).onChange( update );
+	var depth = new UI.Number( parameters.depth ).onChange( update );
 
 
 	depthRow.add( new UI.Text( 'Depth' ).setWidth( '90px' ) );
 	depthRow.add( new UI.Text( 'Depth' ).setWidth( '90px' ) );
 	depthRow.add( depth );
 	depthRow.add( depth );
@@ -37,7 +37,7 @@ Sidebar.Geometry.BoxGeometry = function ( signals, object ) {
 	// widthSegments
 	// widthSegments
 
 
 	var widthSegmentsRow = new UI.Panel();
 	var widthSegmentsRow = new UI.Panel();
-	var widthSegments = new UI.Integer( geometry.parameters.widthSegments ).setRange( 1, Infinity ).onChange( update );
+	var widthSegments = new UI.Integer( parameters.widthSegments ).setRange( 1, Infinity ).onChange( update );
 
 
 	widthSegmentsRow.add( new UI.Text( 'Width segments' ).setWidth( '90px' ) );
 	widthSegmentsRow.add( new UI.Text( 'Width segments' ).setWidth( '90px' ) );
 	widthSegmentsRow.add( widthSegments );
 	widthSegmentsRow.add( widthSegments );
@@ -47,7 +47,7 @@ Sidebar.Geometry.BoxGeometry = function ( signals, object ) {
 	// heightSegments
 	// heightSegments
 
 
 	var heightSegmentsRow = new UI.Panel();
 	var heightSegmentsRow = new UI.Panel();
-	var heightSegments = new UI.Integer( geometry.parameters.heightSegments ).setRange( 1, Infinity ).onChange( update );
+	var heightSegments = new UI.Integer( parameters.heightSegments ).setRange( 1, Infinity ).onChange( update );
 
 
 	heightSegmentsRow.add( new UI.Text( 'Height segments' ).setWidth( '90px' ) );
 	heightSegmentsRow.add( new UI.Text( 'Height segments' ).setWidth( '90px' ) );
 	heightSegmentsRow.add( heightSegments );
 	heightSegmentsRow.add( heightSegments );
@@ -57,7 +57,7 @@ Sidebar.Geometry.BoxGeometry = function ( signals, object ) {
 	// depthSegments
 	// depthSegments
 
 
 	var depthSegmentsRow = new UI.Panel();
 	var depthSegmentsRow = new UI.Panel();
-	var depthSegments = new UI.Integer( geometry.parameters.depthSegments ).setRange( 1, Infinity ).onChange( update );
+	var depthSegments = new UI.Integer( parameters.depthSegments ).setRange( 1, Infinity ).onChange( update );
 
 
 	depthSegmentsRow.add( new UI.Text( 'Height segments' ).setWidth( '90px' ) );
 	depthSegmentsRow.add( new UI.Text( 'Height segments' ).setWidth( '90px' ) );
 	depthSegmentsRow.add( depthSegments );
 	depthSegmentsRow.add( depthSegments );

+ 3 - 3
editor/js/Sidebar.Geometry.CircleGeometry.js

@@ -2,12 +2,12 @@ Sidebar.Geometry.CircleGeometry = function ( signals, object ) {
 
 
 	var container = new UI.Panel();
 	var container = new UI.Panel();
 
 
-	var geometry = object.geometry;
+	var parameters = object.geometry.parameters;
 
 
 	// radius
 	// radius
 
 
 	var radiusRow = new UI.Panel();
 	var radiusRow = new UI.Panel();
-	var radius = new UI.Number( geometry.parameters.radius ).onChange( update );
+	var radius = new UI.Number( parameters.radius ).onChange( update );
 
 
 	radiusRow.add( new UI.Text( 'Radius' ).setWidth( '90px' ) );
 	radiusRow.add( new UI.Text( 'Radius' ).setWidth( '90px' ) );
 	radiusRow.add( radius );
 	radiusRow.add( radius );
@@ -17,7 +17,7 @@ Sidebar.Geometry.CircleGeometry = function ( signals, object ) {
 	// segments
 	// segments
 
 
 	var segmentsRow = new UI.Panel();
 	var segmentsRow = new UI.Panel();
-	var segments = new UI.Integer( geometry.parameters.segments ).setRange( 3, Infinity ).onChange( update );
+	var segments = new UI.Integer( parameters.segments ).setRange( 3, Infinity ).onChange( update );
 
 
 	segmentsRow.add( new UI.Text( 'Segments' ).setWidth( '90px' ) );
 	segmentsRow.add( new UI.Text( 'Segments' ).setWidth( '90px' ) );
 	segmentsRow.add( segments );
 	segmentsRow.add( segments );

+ 7 - 7
editor/js/Sidebar.Geometry.CylinderGeometry.js

@@ -2,12 +2,12 @@ Sidebar.Geometry.CylinderGeometry = function ( signals, object ) {
 
 
 	var container = new UI.Panel();
 	var container = new UI.Panel();
 
 
-	var geometry = object.geometry;
+	var parameters = object.geometry.parameters;
 
 
 	// radiusTop
 	// radiusTop
 
 
 	var radiusTopRow = new UI.Panel();
 	var radiusTopRow = new UI.Panel();
-	var radiusTop = new UI.Number( geometry.parameters.radiusTop ).onChange( update );
+	var radiusTop = new UI.Number( parameters.radiusTop ).onChange( update );
 
 
 	radiusTopRow.add( new UI.Text( 'Radius top' ).setWidth( '90px' ) );
 	radiusTopRow.add( new UI.Text( 'Radius top' ).setWidth( '90px' ) );
 	radiusTopRow.add( radiusTop );
 	radiusTopRow.add( radiusTop );
@@ -17,7 +17,7 @@ Sidebar.Geometry.CylinderGeometry = function ( signals, object ) {
 	// radiusBottom
 	// radiusBottom
 
 
 	var radiusBottomRow = new UI.Panel();
 	var radiusBottomRow = new UI.Panel();
-	var radiusBottom = new UI.Number( geometry.parameters.radiusBottom ).onChange( update );
+	var radiusBottom = new UI.Number( parameters.radiusBottom ).onChange( update );
 
 
 	radiusBottomRow.add( new UI.Text( 'Radius bottom' ).setWidth( '90px' ) );
 	radiusBottomRow.add( new UI.Text( 'Radius bottom' ).setWidth( '90px' ) );
 	radiusBottomRow.add( radiusBottom );
 	radiusBottomRow.add( radiusBottom );
@@ -27,7 +27,7 @@ Sidebar.Geometry.CylinderGeometry = function ( signals, object ) {
 	// height
 	// height
 
 
 	var heightRow = new UI.Panel();
 	var heightRow = new UI.Panel();
-	var height = new UI.Number( geometry.parameters.height ).onChange( update );
+	var height = new UI.Number( parameters.height ).onChange( update );
 
 
 	heightRow.add( new UI.Text( 'Height' ).setWidth( '90px' ) );
 	heightRow.add( new UI.Text( 'Height' ).setWidth( '90px' ) );
 	heightRow.add( height );
 	heightRow.add( height );
@@ -37,7 +37,7 @@ Sidebar.Geometry.CylinderGeometry = function ( signals, object ) {
 	// radialSegments
 	// radialSegments
 
 
 	var radialSegmentsRow = new UI.Panel();
 	var radialSegmentsRow = new UI.Panel();
-	var radialSegments = new UI.Integer( geometry.parameters.radialSegments ).setRange( 1, Infinity ).onChange( update );
+	var radialSegments = new UI.Integer( parameters.radialSegments ).setRange( 1, Infinity ).onChange( update );
 
 
 	radialSegmentsRow.add( new UI.Text( 'Radial segments' ).setWidth( '90px' ) );
 	radialSegmentsRow.add( new UI.Text( 'Radial segments' ).setWidth( '90px' ) );
 	radialSegmentsRow.add( radialSegments );
 	radialSegmentsRow.add( radialSegments );
@@ -47,7 +47,7 @@ Sidebar.Geometry.CylinderGeometry = function ( signals, object ) {
 	// heightSegments
 	// heightSegments
 
 
 	var heightSegmentsRow = new UI.Panel();
 	var heightSegmentsRow = new UI.Panel();
-	var heightSegments = new UI.Integer( geometry.parameters.heightSegments ).setRange( 1, Infinity ).onChange( update );
+	var heightSegments = new UI.Integer( parameters.heightSegments ).setRange( 1, Infinity ).onChange( update );
 
 
 	heightSegmentsRow.add( new UI.Text( 'Height segments' ).setWidth( '90px' ) );
 	heightSegmentsRow.add( new UI.Text( 'Height segments' ).setWidth( '90px' ) );
 	heightSegmentsRow.add( heightSegments );
 	heightSegmentsRow.add( heightSegments );
@@ -57,7 +57,7 @@ Sidebar.Geometry.CylinderGeometry = function ( signals, object ) {
 	// openEnded
 	// openEnded
 
 
 	var openEndedRow = new UI.Panel();
 	var openEndedRow = new UI.Panel();
-	var openEnded = new UI.Checkbox( geometry.parameters.openEnded ).onChange( update );
+	var openEnded = new UI.Checkbox( parameters.openEnded ).onChange( update );
 
 
 	openEndedRow.add( new UI.Text( 'Open ended' ).setWidth( '90px' ) );
 	openEndedRow.add( new UI.Text( 'Open ended' ).setWidth( '90px' ) );
 	openEndedRow.add( openEnded );
 	openEndedRow.add( openEnded );

+ 3 - 3
editor/js/Sidebar.Geometry.IcosahedronGeometry.js

@@ -2,12 +2,12 @@ Sidebar.Geometry.IcosahedronGeometry = function ( signals, object ) {
 
 
 	var container = new UI.Panel();
 	var container = new UI.Panel();
 
 
-	var geometry = object.geometry;
+	var parameters = object.geometry.parameters;
 
 
 	// radius
 	// radius
 
 
 	var radiusRow = new UI.Panel();
 	var radiusRow = new UI.Panel();
-	var radius = new UI.Number( geometry.parameters.radius ).onChange( update );
+	var radius = new UI.Number( parameters.radius ).onChange( update );
 
 
 	radiusRow.add( new UI.Text( 'Radius' ).setWidth( '90px' ) );
 	radiusRow.add( new UI.Text( 'Radius' ).setWidth( '90px' ) );
 	radiusRow.add( radius );
 	radiusRow.add( radius );
@@ -17,7 +17,7 @@ Sidebar.Geometry.IcosahedronGeometry = function ( signals, object ) {
 	// detail
 	// detail
 
 
 	var detailRow = new UI.Panel();
 	var detailRow = new UI.Panel();
-	var detail = new UI.Integer( geometry.parameters.detail ).setRange( 0, Infinity ).onChange( update );
+	var detail = new UI.Integer( parameters.detail ).setRange( 0, Infinity ).onChange( update );
 
 
 	detailRow.add( new UI.Text( 'Detail' ).setWidth( '90px' ) );
 	detailRow.add( new UI.Text( 'Detail' ).setWidth( '90px' ) );
 	detailRow.add( detail );
 	detailRow.add( detail );

+ 5 - 5
editor/js/Sidebar.Geometry.PlaneGeometry.js

@@ -2,12 +2,12 @@ Sidebar.Geometry.PlaneGeometry = function ( signals, object ) {
 
 
 	var container = new UI.Panel();
 	var container = new UI.Panel();
 
 
-	var geometry = object.geometry;
+	var parameters = object.geometry.parameters;
 
 
 	// width
 	// width
 
 
 	var widthRow = new UI.Panel();
 	var widthRow = new UI.Panel();
-	var width = new UI.Number( geometry.parameters.width ).onChange( update );
+	var width = new UI.Number( parameters.width ).onChange( update );
 
 
 	widthRow.add( new UI.Text( 'Width' ).setWidth( '90px' ) );
 	widthRow.add( new UI.Text( 'Width' ).setWidth( '90px' ) );
 	widthRow.add( width );
 	widthRow.add( width );
@@ -17,7 +17,7 @@ Sidebar.Geometry.PlaneGeometry = function ( signals, object ) {
 	// height
 	// height
 
 
 	var heightRow = new UI.Panel();
 	var heightRow = new UI.Panel();
-	var height = new UI.Number( geometry.parameters.height ).onChange( update );
+	var height = new UI.Number( parameters.height ).onChange( update );
 
 
 	heightRow.add( new UI.Text( 'Height' ).setWidth( '90px' ) );
 	heightRow.add( new UI.Text( 'Height' ).setWidth( '90px' ) );
 	heightRow.add( height );
 	heightRow.add( height );
@@ -27,7 +27,7 @@ Sidebar.Geometry.PlaneGeometry = function ( signals, object ) {
 	// widthSegments
 	// widthSegments
 
 
 	var widthSegmentsRow = new UI.Panel();
 	var widthSegmentsRow = new UI.Panel();
-	var widthSegments = new UI.Integer( geometry.parameters.widthSegments ).setRange( 1, Infinity ).onChange( update );
+	var widthSegments = new UI.Integer( parameters.widthSegments ).setRange( 1, Infinity ).onChange( update );
 
 
 	widthSegmentsRow.add( new UI.Text( 'Width segments' ).setWidth( '90px' ) );
 	widthSegmentsRow.add( new UI.Text( 'Width segments' ).setWidth( '90px' ) );
 	widthSegmentsRow.add( widthSegments );
 	widthSegmentsRow.add( widthSegments );
@@ -37,7 +37,7 @@ Sidebar.Geometry.PlaneGeometry = function ( signals, object ) {
 	// heightSegments
 	// heightSegments
 
 
 	var heightSegmentsRow = new UI.Panel();
 	var heightSegmentsRow = new UI.Panel();
-	var heightSegments = new UI.Integer( geometry.parameters.heightSegments ).setRange( 1, Infinity ).onChange( update );
+	var heightSegments = new UI.Integer( parameters.heightSegments ).setRange( 1, Infinity ).onChange( update );
 
 
 	heightSegmentsRow.add( new UI.Text( 'Height segments' ).setWidth( '90px' ) );
 	heightSegmentsRow.add( new UI.Text( 'Height segments' ).setWidth( '90px' ) );
 	heightSegmentsRow.add( heightSegments );
 	heightSegmentsRow.add( heightSegments );

+ 8 - 8
editor/js/Sidebar.Geometry.SphereGeometry.js

@@ -2,12 +2,12 @@ Sidebar.Geometry.SphereGeometry = function ( signals, object ) {
 
 
 	var container = new UI.Panel();
 	var container = new UI.Panel();
 
 
-	var geometry = object.geometry;
+	var parameters = object.geometry.parameters;
 
 
 	// radius
 	// radius
 
 
 	var radiusRow = new UI.Panel();
 	var radiusRow = new UI.Panel();
-	var radius = new UI.Number( geometry.parameters.radius ).onChange( update );
+	var radius = new UI.Number( parameters.radius ).onChange( update );
 
 
 	radiusRow.add( new UI.Text( 'Radius' ).setWidth( '90px' ) );
 	radiusRow.add( new UI.Text( 'Radius' ).setWidth( '90px' ) );
 	radiusRow.add( radius );
 	radiusRow.add( radius );
@@ -17,7 +17,7 @@ Sidebar.Geometry.SphereGeometry = function ( signals, object ) {
 	// widthSegments
 	// widthSegments
 
 
 	var widthSegmentsRow = new UI.Panel();
 	var widthSegmentsRow = new UI.Panel();
-	var widthSegments = new UI.Integer( geometry.parameters.widthSegments ).setRange( 1, Infinity ).onChange( update );
+	var widthSegments = new UI.Integer( parameters.widthSegments ).setRange( 1, Infinity ).onChange( update );
 
 
 	widthSegmentsRow.add( new UI.Text( 'Width segments' ).setWidth( '90px' ) );
 	widthSegmentsRow.add( new UI.Text( 'Width segments' ).setWidth( '90px' ) );
 	widthSegmentsRow.add( widthSegments );
 	widthSegmentsRow.add( widthSegments );
@@ -27,7 +27,7 @@ Sidebar.Geometry.SphereGeometry = function ( signals, object ) {
 	// heightSegments
 	// heightSegments
 
 
 	var heightSegmentsRow = new UI.Panel();
 	var heightSegmentsRow = new UI.Panel();
-	var heightSegments = new UI.Integer( geometry.parameters.heightSegments ).setRange( 1, Infinity ).onChange( update );
+	var heightSegments = new UI.Integer( parameters.heightSegments ).setRange( 1, Infinity ).onChange( update );
 
 
 	heightSegmentsRow.add( new UI.Text( 'Height segments' ).setWidth( '90px' ) );
 	heightSegmentsRow.add( new UI.Text( 'Height segments' ).setWidth( '90px' ) );
 	heightSegmentsRow.add( heightSegments );
 	heightSegmentsRow.add( heightSegments );
@@ -37,7 +37,7 @@ Sidebar.Geometry.SphereGeometry = function ( signals, object ) {
 	// phiStart
 	// phiStart
 
 
 	var phiStartRow = new UI.Panel();
 	var phiStartRow = new UI.Panel();
-	var phiStart = new UI.Number( geometry.parameters.phiStart ).onChange( update );
+	var phiStart = new UI.Number( parameters.phiStart ).onChange( update );
 
 
 	phiStartRow.add( new UI.Text( 'Phi start' ).setWidth( '90px' ) );
 	phiStartRow.add( new UI.Text( 'Phi start' ).setWidth( '90px' ) );
 	phiStartRow.add( phiStart );
 	phiStartRow.add( phiStart );
@@ -47,7 +47,7 @@ Sidebar.Geometry.SphereGeometry = function ( signals, object ) {
 	// phiLength
 	// phiLength
 
 
 	var phiLengthRow = new UI.Panel();
 	var phiLengthRow = new UI.Panel();
-	var phiLength = new UI.Number( geometry.parameters.phiLength ).onChange( update );
+	var phiLength = new UI.Number( parameters.phiLength ).onChange( update );
 
 
 	phiLengthRow.add( new UI.Text( 'Phi length' ).setWidth( '90px' ) );
 	phiLengthRow.add( new UI.Text( 'Phi length' ).setWidth( '90px' ) );
 	phiLengthRow.add( phiLength );
 	phiLengthRow.add( phiLength );
@@ -57,7 +57,7 @@ Sidebar.Geometry.SphereGeometry = function ( signals, object ) {
 	// thetaStart
 	// thetaStart
 
 
 	var thetaStartRow = new UI.Panel();
 	var thetaStartRow = new UI.Panel();
-	var thetaStart = new UI.Number( geometry.parameters.thetaStart ).onChange( update );
+	var thetaStart = new UI.Number( parameters.thetaStart ).onChange( update );
 
 
 	thetaStartRow.add( new UI.Text( 'Theta start' ).setWidth( '90px' ) );
 	thetaStartRow.add( new UI.Text( 'Theta start' ).setWidth( '90px' ) );
 	thetaStartRow.add( thetaStart );
 	thetaStartRow.add( thetaStart );
@@ -67,7 +67,7 @@ Sidebar.Geometry.SphereGeometry = function ( signals, object ) {
 	// thetaLength
 	// thetaLength
 
 
 	var thetaLengthRow = new UI.Panel();
 	var thetaLengthRow = new UI.Panel();
-	var thetaLength = new UI.Number( geometry.parameters.thetaLength ).onChange( update );
+	var thetaLength = new UI.Number( parameters.thetaLength ).onChange( update );
 
 
 	thetaLengthRow.add( new UI.Text( 'Theta length' ).setWidth( '90px' ) );
 	thetaLengthRow.add( new UI.Text( 'Theta length' ).setWidth( '90px' ) );
 	thetaLengthRow.add( thetaLength );
 	thetaLengthRow.add( thetaLength );

+ 6 - 6
editor/js/Sidebar.Geometry.TorusGeometry.js

@@ -2,12 +2,12 @@ Sidebar.Geometry.TorusGeometry = function ( signals, object ) {
 
 
 	var container = new UI.Panel();
 	var container = new UI.Panel();
 
 
-	var geometry = object.geometry;
+	var parameters = object.geometry.parameters;
 
 
 	// radius
 	// radius
 
 
 	var radiusRow = new UI.Panel();
 	var radiusRow = new UI.Panel();
-	var radius = new UI.Number( geometry.parameters.radius ).onChange( update );
+	var radius = new UI.Number( parameters.radius ).onChange( update );
 
 
 	radiusRow.add( new UI.Text( 'Radius' ).setWidth( '90px' ) );
 	radiusRow.add( new UI.Text( 'Radius' ).setWidth( '90px' ) );
 	radiusRow.add( radius );
 	radiusRow.add( radius );
@@ -17,7 +17,7 @@ Sidebar.Geometry.TorusGeometry = function ( signals, object ) {
 	// tube
 	// tube
 
 
 	var tubeRow = new UI.Panel();
 	var tubeRow = new UI.Panel();
-	var tube = new UI.Number( geometry.parameters.tube ).onChange( update );
+	var tube = new UI.Number( parameters.tube ).onChange( update );
 
 
 	tubeRow.add( new UI.Text( 'Tube' ).setWidth( '90px' ) );
 	tubeRow.add( new UI.Text( 'Tube' ).setWidth( '90px' ) );
 	tubeRow.add( tube );
 	tubeRow.add( tube );
@@ -27,7 +27,7 @@ Sidebar.Geometry.TorusGeometry = function ( signals, object ) {
 	// radialSegments
 	// radialSegments
 
 
 	var radialSegmentsRow = new UI.Panel();
 	var radialSegmentsRow = new UI.Panel();
-	var radialSegments = new UI.Integer( geometry.parameters.radialSegments ).setRange( 1, Infinity ).onChange( update );
+	var radialSegments = new UI.Integer( parameters.radialSegments ).setRange( 1, Infinity ).onChange( update );
 
 
 	radialSegmentsRow.add( new UI.Text( 'Radial segments' ).setWidth( '90px' ) );
 	radialSegmentsRow.add( new UI.Text( 'Radial segments' ).setWidth( '90px' ) );
 	radialSegmentsRow.add( radialSegments );
 	radialSegmentsRow.add( radialSegments );
@@ -37,7 +37,7 @@ Sidebar.Geometry.TorusGeometry = function ( signals, object ) {
 	// tubularSegments
 	// tubularSegments
 
 
 	var tubularSegmentsRow = new UI.Panel();
 	var tubularSegmentsRow = new UI.Panel();
-	var tubularSegments = new UI.Integer( geometry.parameters.tubularSegments ).setRange( 1, Infinity ).onChange( update );
+	var tubularSegments = new UI.Integer( parameters.tubularSegments ).setRange( 1, Infinity ).onChange( update );
 
 
 	tubularSegmentsRow.add( new UI.Text( 'Tubular segments' ).setWidth( '90px' ) );
 	tubularSegmentsRow.add( new UI.Text( 'Tubular segments' ).setWidth( '90px' ) );
 	tubularSegmentsRow.add( tubularSegments );
 	tubularSegmentsRow.add( tubularSegments );
@@ -47,7 +47,7 @@ Sidebar.Geometry.TorusGeometry = function ( signals, object ) {
 	// arc
 	// arc
 
 
 	var arcRow = new UI.Panel();
 	var arcRow = new UI.Panel();
-	var arc = new UI.Number( geometry.parameters.arc ).onChange( update );
+	var arc = new UI.Number( parameters.arc ).onChange( update );
 
 
 	arcRow.add( new UI.Text( 'Arc' ).setWidth( '90px' ) );
 	arcRow.add( new UI.Text( 'Arc' ).setWidth( '90px' ) );
 	arcRow.add( arc );
 	arcRow.add( arc );

+ 8 - 8
editor/js/Sidebar.Geometry.TorusKnotGeometry.js

@@ -2,12 +2,12 @@ Sidebar.Geometry.TorusKnotGeometry = function ( signals, object ) {
 
 
 	var container = new UI.Panel();
 	var container = new UI.Panel();
 
 
-	var geometry = object.geometry;
+	var parameters = object.geometry.parameters;
 
 
 	// radius
 	// radius
 
 
 	var radiusRow = new UI.Panel();
 	var radiusRow = new UI.Panel();
-	var radius = new UI.Number( geometry.parameters.radius ).onChange( update );
+	var radius = new UI.Number( parameters.radius ).onChange( update );
 
 
 	radiusRow.add( new UI.Text( 'Radius' ).setWidth( '90px' ) );
 	radiusRow.add( new UI.Text( 'Radius' ).setWidth( '90px' ) );
 	radiusRow.add( radius );
 	radiusRow.add( radius );
@@ -17,7 +17,7 @@ Sidebar.Geometry.TorusKnotGeometry = function ( signals, object ) {
 	// tube
 	// tube
 
 
 	var tubeRow = new UI.Panel();
 	var tubeRow = new UI.Panel();
-	var tube = new UI.Number( geometry.parameters.tube ).onChange( update );
+	var tube = new UI.Number( parameters.tube ).onChange( update );
 
 
 	tubeRow.add( new UI.Text( 'Tube' ).setWidth( '90px' ) );
 	tubeRow.add( new UI.Text( 'Tube' ).setWidth( '90px' ) );
 	tubeRow.add( tube );
 	tubeRow.add( tube );
@@ -27,7 +27,7 @@ Sidebar.Geometry.TorusKnotGeometry = function ( signals, object ) {
 	// radialSegments
 	// radialSegments
 
 
 	var radialSegmentsRow = new UI.Panel();
 	var radialSegmentsRow = new UI.Panel();
-	var radialSegments = new UI.Integer( geometry.parameters.radialSegments ).setRange( 1, Infinity ).onChange( update );
+	var radialSegments = new UI.Integer( parameters.radialSegments ).setRange( 1, Infinity ).onChange( update );
 
 
 	radialSegmentsRow.add( new UI.Text( 'Radial segments' ).setWidth( '90px' ) );
 	radialSegmentsRow.add( new UI.Text( 'Radial segments' ).setWidth( '90px' ) );
 	radialSegmentsRow.add( radialSegments );
 	radialSegmentsRow.add( radialSegments );
@@ -37,7 +37,7 @@ Sidebar.Geometry.TorusKnotGeometry = function ( signals, object ) {
 	// tubularSegments
 	// tubularSegments
 
 
 	var tubularSegmentsRow = new UI.Panel();
 	var tubularSegmentsRow = new UI.Panel();
-	var tubularSegments = new UI.Integer( geometry.parameters.tubularSegments ).setRange( 1, Infinity ).onChange( update );
+	var tubularSegments = new UI.Integer( parameters.tubularSegments ).setRange( 1, Infinity ).onChange( update );
 
 
 	tubularSegmentsRow.add( new UI.Text( 'Tubular segments' ).setWidth( '90px' ) );
 	tubularSegmentsRow.add( new UI.Text( 'Tubular segments' ).setWidth( '90px' ) );
 	tubularSegmentsRow.add( tubularSegments );
 	tubularSegmentsRow.add( tubularSegments );
@@ -47,7 +47,7 @@ Sidebar.Geometry.TorusKnotGeometry = function ( signals, object ) {
 	// p
 	// p
 
 
 	var pRow = new UI.Panel();
 	var pRow = new UI.Panel();
-	var p = new UI.Number( geometry.parameters.p ).onChange( update );
+	var p = new UI.Number( parameters.p ).onChange( update );
 
 
 	pRow.add( new UI.Text( 'P' ).setWidth( '90px' ) );
 	pRow.add( new UI.Text( 'P' ).setWidth( '90px' ) );
 	pRow.add( p );
 	pRow.add( p );
@@ -57,7 +57,7 @@ Sidebar.Geometry.TorusKnotGeometry = function ( signals, object ) {
 	// q
 	// q
 
 
 	var qRow = new UI.Panel();
 	var qRow = new UI.Panel();
-	var q = new UI.Number( geometry.parameters.q ).onChange( update );
+	var q = new UI.Number( parameters.q ).onChange( update );
 
 
 	pRow.add( new UI.Text( 'Q' ).setWidth( '90px' ) );
 	pRow.add( new UI.Text( 'Q' ).setWidth( '90px' ) );
 	pRow.add( q );
 	pRow.add( q );
@@ -67,7 +67,7 @@ Sidebar.Geometry.TorusKnotGeometry = function ( signals, object ) {
 	// heightScale
 	// heightScale
 
 
 	var heightScaleRow = new UI.Panel();
 	var heightScaleRow = new UI.Panel();
-	var heightScale = new UI.Number( geometry.parameters.heightScale ).onChange( update );
+	var heightScale = new UI.Number( parameters.heightScale ).onChange( update );
 
 
 	pRow.add( new UI.Text( 'Height scale' ).setWidth( '90px' ) );
 	pRow.add( new UI.Text( 'Height scale' ).setWidth( '90px' ) );
 	pRow.add( heightScale );
 	pRow.add( heightScale );