فهرست منبع

New Geometry2 and IndexedGeometry2 approach.

Mr.doob 11 سال پیش
والد
کامیت
590bc8fd6b
3فایلهای تغییر یافته به همراه33 افزوده شده و 0 حذف شده
  1. 15 0
      src/core/Geometry2.js
  2. 16 0
      src/core/IndexedGeometry2.js
  3. 2 0
      utils/build/includes/common.json

+ 15 - 0
src/core/Geometry2.js

@@ -0,0 +1,15 @@
+/**
+ * @author mrdoob / http://mrdoob.com/
+ */
+
+THREE.Geometry2 = function ( vertices, normals, uvs ) {
+
+	THREE.BufferGeometry.call( this );
+
+	this.attributes[ 'position' ] = { array: vertices, itemSize: 3 };
+	this.attributes[ 'normal' ] = { array: normals, itemSize: 3 };
+	this.attributes[ 'uv' ] = { array: uvs, itemSize: 2 };	
+
+};
+
+THREE.Geometry2.prototype = Object.create( THREE.BufferGeometry.prototype );

+ 16 - 0
src/core/IndexedGeometry2.js

@@ -0,0 +1,16 @@
+/**
+ * @author mrdoob / http://mrdoob.com/
+ */
+
+THREE.IndexedGeometry2 = function ( indices, vertices, normals, uvs ) {
+
+	THREE.BufferGeometry.call( this );
+
+	this.attributes[ 'index' ] = { array: indices, itemSize: 1 };
+	this.attributes[ 'position' ] = { array: vertices, itemSize: 3 };
+	this.attributes[ 'normal' ] = { array: normals, itemSize: 3 };
+	this.attributes[ 'uv' ] = { array: uvs, itemSize: 2 };	
+
+};
+
+THREE.IndexedGeometry2.prototype = Object.create( THREE.BufferGeometry.prototype );

+ 2 - 0
utils/build/includes/common.json

@@ -33,6 +33,8 @@
 	"src/core/BufferGeometry.js",
 	"src/core/BufferGeometryManipulator.js",
 	"src/core/Geometry.js",
+	"src/core/Geometry2.js",
+	"src/core/IndexedGeometry2.js",
 	"src/cameras/Camera.js",
 	"src/cameras/OrthographicCamera.js",
 	"src/cameras/PerspectiveCamera.js",