Face3.d.ts 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. import { Vector3 } from './../math/Vector3';
  2. import { Color } from './../math/Color';
  3. export interface Event {
  4. type: string;
  5. target?: any;
  6. [attachment: string]: any;
  7. }
  8. /**
  9. * Triangle face.
  10. *
  11. * # Example
  12. * var normal = new THREE.Vector3( 0, 1, 0 );
  13. * var color = new THREE.Color( 0xffaa00 );
  14. * var face = new THREE.Face3( 0, 1, 2, normal, color, 0 );
  15. *
  16. * @source https://github.com/mrdoob/three.js/blob/master/src/core/Face3.js
  17. */
  18. export class Face3 {
  19. /**
  20. * @param a Vertex A index.
  21. * @param b Vertex B index.
  22. * @param c Vertex C index.
  23. * @param normal Face normal or array of vertex normals.
  24. * @param color Face color or array of vertex colors.
  25. * @param materialIndex Material index.
  26. */
  27. constructor(
  28. a: number,
  29. b: number,
  30. c: number,
  31. normal?: Vector3,
  32. color?: Color,
  33. materialIndex?: number
  34. );
  35. constructor(
  36. a: number,
  37. b: number,
  38. c: number,
  39. normal?: Vector3,
  40. vertexColors?: Color[],
  41. materialIndex?: number
  42. );
  43. constructor(
  44. a: number,
  45. b: number,
  46. c: number,
  47. vertexNormals?: Vector3[],
  48. color?: Color,
  49. materialIndex?: number
  50. );
  51. constructor(
  52. a: number,
  53. b: number,
  54. c: number,
  55. vertexNormals?: Vector3[],
  56. vertexColors?: Color[],
  57. materialIndex?: number
  58. );
  59. /**
  60. * Vertex A index.
  61. */
  62. a: number;
  63. /**
  64. * Vertex B index.
  65. */
  66. b: number;
  67. /**
  68. * Vertex C index.
  69. */
  70. c: number;
  71. /**
  72. * Face normal.
  73. */
  74. normal: Vector3;
  75. /**
  76. * Array of 4 vertex normals.
  77. */
  78. vertexNormals: Vector3[];
  79. /**
  80. * Face color.
  81. */
  82. color: Color;
  83. /**
  84. * Array of 4 vertex normals.
  85. */
  86. vertexColors: Color[];
  87. /**
  88. * Material index (points to {@link Geometry.materials}).
  89. */
  90. materialIndex: number;
  91. clone(): this;
  92. copy( source: Face3 ): this;
  93. }
粤ICP备19079148号