ProxyFace3.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * @author jbaicoianu / http://baicoianu.com/
  3. */
  4. THREE.ProxyFace3 = function ( array, offset, vertexNormals, vertexColors, vertexTangents ) {
  5. this.array = array;
  6. this.offset = offset;
  7. this.vertexNormals = vertexNormals || [];
  8. this.vertexColors = vertexColors || [];
  9. this.vertexTangents = vertexTangents || [];
  10. this.normal = new THREE.MultiVector3( this.vertexNormals );
  11. this.color = new THREE.MultiColor( this.vertexColors );
  12. //THREE.Face3.call( this, array[offset], array[offset+1], array[offset+2] /*, normal, color, materialIndex */);
  13. }
  14. THREE.ProxyFace3.prototype = Object.create( THREE.Face3.prototype );
  15. Object.defineProperties( THREE.ProxyFace3.prototype, {
  16. 'a': {
  17. enumerable: true,
  18. get: function () { return this.array[ this.offset ]; },
  19. set: function ( v ) { this.array[ this.offset ] = v; }
  20. },
  21. 'b': {
  22. enumerable: true,
  23. get: function () { return this.array[ this.offset + 1 ]; },
  24. set: function ( v ) { this.array[ this.offset + 1 ] = v; }
  25. },
  26. 'c': {
  27. enumerable: true,
  28. get: function () { return this.array[ this.offset + 2 ]; },
  29. set: function ( v ) { this.array[ this.offset + 2 ] = v; }
  30. },
  31. } );