Selaa lähdekoodia

Merge pull request #12781 from OndrejSpanel/fixGeometryTests

Trying to fix geometry tests
Mr.doob 7 vuotta sitten
vanhempi
commit
44a1a250e2

+ 16 - 4
test/unit/src/geometries/PolyhedronGeometry.tests.js

@@ -15,10 +15,16 @@ export default QUnit.module( 'Geometries', () => {
 		var geometries = undefined;
 		hooks.beforeEach( function () {
 
-			const parameters = {};
+			var vertices = [
+				1, 1, 1, 	- 1, - 1, 1, 	- 1, 1, - 1, 	1, - 1, - 1
+			];
+
+			var indices = [
+				2, 1, 0, 	0, 3, 2,	1, 3, 0,	2, 3, 1
+			];
 
 			geometries = [
-				new PolyhedronGeometry()
+				new PolyhedronGeometry( vertices, indices )
 			];
 
 		} );
@@ -51,10 +57,16 @@ export default QUnit.module( 'Geometries', () => {
 		var geometries = undefined;
 		hooks.beforeEach( function () {
 
-			const parameters = {};
+			var vertices = [
+				1, 1, 1, 	- 1, - 1, 1, 	- 1, 1, - 1, 	1, - 1, - 1
+			];
+
+			var indices = [
+				2, 1, 0, 	0, 3, 2,	1, 3, 0,	2, 3, 1
+			];
 
 			geometries = [
-				new PolyhedronBufferGeometry()
+				new PolyhedronBufferGeometry( vertices, indices )
 			];
 
 		} );

+ 12 - 4
test/unit/src/geometries/ShapeGeometry.tests.js

@@ -8,6 +8,8 @@ import {
 	ShapeBufferGeometry
 } from '../../../../src/geometries/ShapeGeometry';
 
+import { Shape } from '../../../../src/extras/core/Shape';
+
 export default QUnit.module( 'Geometries', () => {
 
 	QUnit.module( 'ShapeGeometry', ( hooks ) => {
@@ -15,10 +17,13 @@ export default QUnit.module( 'Geometries', () => {
 		var geometries = undefined;
 		hooks.beforeEach( function () {
 
-			const parameters = {};
+			var triangleShape = new Shape();
+			triangleShape.moveTo( 0, - 1 );
+			triangleShape.lineTo( 1, 1 );
+			triangleShape.lineTo( - 1, 1 );
 
 			geometries = [
-				new ShapeGeometry()
+				new ShapeGeometry( triangleShape )
 			];
 
 		} );
@@ -51,10 +56,13 @@ export default QUnit.module( 'Geometries', () => {
 		var geometries = undefined;
 		hooks.beforeEach( function () {
 
-			const parameters = {};
+			var triangleShape = new Shape();
+			triangleShape.moveTo( 0, - 1 );
+			triangleShape.lineTo( 1, 1 );
+			triangleShape.lineTo( - 1, 1 );
 
 			geometries = [
-				new ShapeBufferGeometry()
+				new ShapeBufferGeometry( triangleShape )
 			];
 
 		} );

+ 7 - 4
test/unit/src/geometries/TubeGeometry.tests.js

@@ -8,6 +8,9 @@ import {
 	TubeBufferGeometry
 } from '../../../../src/geometries/TubeGeometry';
 
+import { LineCurve3 } from '../../../../src/extras/curves/LineCurve3'
+import { Vector3 } from '../../../../src/math/Vector3'
+
 export default QUnit.module( 'Geometries', () => {
 
 	QUnit.module( 'TubeGeometry', ( hooks ) => {
@@ -15,10 +18,10 @@ export default QUnit.module( 'Geometries', () => {
 		var geometries = undefined;
 		hooks.beforeEach( function () {
 
-			const parameters = {};
+			var path = new LineCurve3( new Vector3( 0, 0, 0 ), new Vector3( 0, 1, 0 ) );
 
 			geometries = [
-				new TubeGeometry()
+				new TubeGeometry( path )
 			];
 
 		} );
@@ -51,10 +54,10 @@ export default QUnit.module( 'Geometries', () => {
 		var geometries = undefined;
 		hooks.beforeEach( function () {
 
-			const parameters = {};
+			var path = new LineCurve3( new Vector3( 0, 0, 0 ), new Vector3( 0, 1, 0 ) );
 
 			geometries = [
-				new TubeBufferGeometry()
+				new TubeBufferGeometry( path )
 			];
 
 		} );