ProxyFace3.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. THREE.ProxyFace3.prototype.constructor = THREE.ProxyFace3;
  16. Object.defineProperties( THREE.ProxyFace3.prototype, {
  17. 'a': {
  18. enumerable: true,
  19. get: function () { return this.array[ this.offset ]; },
  20. set: function ( v ) { this.array[ this.offset ] = v; }
  21. },
  22. 'b': {
  23. enumerable: true,
  24. get: function () { return this.array[ this.offset + 1 ]; },
  25. set: function ( v ) { this.array[ this.offset + 1 ] = v; }
  26. },
  27. 'c': {
  28. enumerable: true,
  29. get: function () { return this.array[ this.offset + 2 ]; },
  30. set: function ( v ) { this.array[ this.offset + 2 ] = v; }
  31. },
  32. } );