IndexedTypedGeometry.js 683 B

123456789101112131415161718192021222324252627
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. */
  4. THREE.IndexedTypedGeometry = function () {
  5. THREE.BufferGeometry.call( this );
  6. };
  7. THREE.IndexedTypedGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );
  8. THREE.IndexedTypedGeometry.prototype.setArrays = function ( indices, vertices, normals, uvs ) {
  9. this.indices = indices;
  10. this.vertices = vertices;
  11. this.normals = normals;
  12. this.uvs = uvs;
  13. this.attributes[ 'index' ] = { array: indices, itemSize: 1 };
  14. this.attributes[ 'position' ] = { array: vertices, itemSize: 3 };
  15. this.attributes[ 'normal' ] = { array: normals, itemSize: 3 };
  16. this.attributes[ 'uv' ] = { array: uvs, itemSize: 2 };
  17. return this;
  18. };