最近学习three.js,想用typescript编写代码,去http://definitelytyped.org/找了一圈没有发现three.js的definitely typed文件.

好吧,花了2天时间自己简单写了一份:

  1. declare module THREE {
  2. export class BoxHelper extends Line {
  3. constructor(object: Object3D);
  4. public update(object: Object3D);
  5. }
  6. export class DrawTextResult {
  7. public paths: any[];
  8. public offset: number;
  9. }
  10. export class FontUtils {
  11. public static divisions: number;
  12. public static style: string;
  13. public static weight: string;
  14. public static face: string;
  15. public static faces: any;
  16. public static size: number;
  17. public static drawText(text: string): DrawTextResult;
  18. public static Triangulate(contour: Vector2[], indices: boolean): any[];
  19. public static extractGlyphPoints(c: string, face: string, scale: number, offset: number, path: Path);
  20. }
  21. export class Curve {
  22. constructor();
  23. public getPoint(t: number): any;
  24. public getPointAt(u: number): any;
  25. public getPoints(divisions: number[]): any[];
  26. public getSpacedPoints(divisions: number): any[];
  27. public getLength(): number;
  28. public getLengths(divisions: number): number[];
  29. public updateArcLengths(): void;
  30. public getTangent(t: number): any;
  31. public getTangentAt(u: number): any;
  32. }
  33. export class CurvePath extends Curve {
  34. constructor();
  35. public curves: Curve[];
  36. public bends: Curve[];
  37. public autoClose: boolean;
  38. public getWrapPoints(vertices: Vector2[], curve: Curve[]):Vector2[];
  39. public addWrapPath(curve: Curve): void;
  40. public createGeometry(points: Vector3[]): Geometry;
  41. public createPointsGeometry(divisions: number): Geometry;
  42. public createSpacedPointsGeometry(divisions: number): Geometry;
  43. public add(curve: Curve): void;
  44. public closePath(): void;
  45. public getBoundingBox(): any;
  46. public getCurveLengths(): number;
  47. public getTransformedPoints(segments: number, bends?: Curve[]): Vector2[];
  48.  
  49. }
  50. export class GeometryUtils {
  51. public static merge(geometry1: Geometry, geometry2: Geometry, materialIndexOffset: number);
  52. public static randomPointInTriangle(vectorA: Vector3, vectorB: Vector3, vectorC: Vector3): Vector3;
  53. }
  54. export class ImageUtils {
  55. public static crossOrigin: string;
  56. public static generateDataTexture(width: number, height: number, color: number): DataTexture;
  57. public static parseDDS(buffer: string, loadMipmpas: boolean): CompressedTexture;
  58. public static loadTexture(url: string, mapping?: number, onLoad?: (any) => any, onError?: (any) => any): Texture;
  59. public static getNormalMap(image: HTMLImageElement, depth: number): HTMLCanvasElement;
  60. public static loadTextureCube(array: any[], mapping: number, onLoad: (any) => any, onError: (any) => any): CubeTexture;
  61.  
  62. }
  63. export class SceneUtils {
  64. public static createMultiMaterialObject(geometry: Geometry, materials: Material[]): Object3D;
  65. public static attach(child: Object3D, scene: Scene, parent: Object3D): void;
  66. public static detach(child: Object3D, scene: Scene,parent:Object3D): void;
  67.  
  68. }
  69. export class Gyroscope extends Object3D {
  70. constructor();
  71. }
  72. export class Path extends CurvePath {
  73. constructor(points?: Vector2[]);
  74. public actions: any[];
  75. public fromPoints(vector2s: Vector2[]): void;
  76. public moveTo(x: number, y: number): void;
  77. public lineTo(x: number, y: number): void;
  78. public quadratiCurveTo(cpX: number, cpY: number, x: number, y: number): void;
  79. public bezierCurveTo(cp1X: number, cp1Y: number, cp2X: number, cp2Y: number, x: number,y: number): void;
  80. public splineThru(points: Vector2[]): void;
  81. public arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, clockwise: boolean): void;
  82. public absarc(x: number, y: number, radius: number, startAngle: number, endAngle: number, clockwise: boolean): void;
  83. public ellipse(x: number, y: number, xRadius: number, yRadius: number, startAngle: number, endAngle: number, clockwise: boolean, rotation: number): void;
  84. public absellipse(x: number, y: number, xRadius: number, yRadius: number, startAngle: number, endAngle: number, clockwise: boolean, rotation: number): void;
  85. public toShapes(isCCW: boolean, noHoles: boolean): Shape[];
  86. }
  87. export class Shape extends Path {
  88. constructor();
  89. public holes: Path[];
  90. public makeGeometry(options: any): ShapeGeometry;
  91. public extractAllPoints(divisions: number): Vector3[];
  92. public extrude(options: any): ExtrudeGeometry;
  93. public extractPoints(divisions: number): any;
  94. public getPointsHoles(divisions: number): Vector2[] | Vector3[];
  95. public getSpacedPointsHoles(divisions: number): Vector2[] | Vector3[];
  96. }
  97. export class ShapeGeometry extends Geometry {
  98. constructor(shapes: Shape[], options?: any);
  99. public addShapeList(shapes: Shape[], options?: any): this;
  100. public addShape(shape: Shape, options?: any): void;
  101. }
  102. export class ExtrudeGeometry extends Geometry {
  103. constructor(shapes: Shape[]|Shape, options?: any);
  104. public addShapList(shapes: Shape[], options?: any): void;
  105. public addShape(shape: Shape, options?: any): void;
  106. }
  107. export class TextGeometry extends ExtrudeGeometry {
  108. constructor(text: string, parameters: any);
  109. }
  110. export class TorusGeometry extends Geometry {
  111. constructor(radius: number, tube: number, radialSegments: number, tubularSegments: number, arc: number);
  112. }
  113. export class TorusKnotGeometry extends Geometry {
  114. constructor(
  115. radius: number,
  116. tube: number,
  117. radialSegments: number,
  118. tubularSegments: number,
  119. p: number,
  120. q: number,
  121. heightScale: number
  122. );
  123. }
  124. export class TubeGeometry extends Geometry {
  125. constructor(path: Curve, segments: number, radius: number, radiusSegments: number, closed: boolean);
  126. public parameters: any;
  127. public tangents: Vector3[];
  128. public normals: Vector3[];
  129. public binormals: Vector3[];
  130. public static FrenetFrames(path: Curve, segments: number, closed: boolean): void;
  131. }
  132. export class Vector2 {
  133. constructor(x: number, y: number);
  134. public x: number;
  135. public y: number;
  136. public set(x: number, y: number): this;
  137. public copy(v: this): this;
  138. public add(v: this): this;
  139. public addVectors(a: this, b: this): this;
  140. public addScaledVector(v: this, s: number): this;
  141. public sub(v: this): this;
  142. public subVectors(a: this, b: this): this;
  143. public multiplyScalar(s: number): this;
  144. public divideScalar(s: number): this;
  145. public negate(): this;
  146. public dot(v: this): number;
  147. public lengthSq(): number;
  148. public length(): number;
  149. public lengthManhattan(): number;
  150. public normalize(): this;
  151. public distanceTo(v: this): number;
  152. public distanceToSquared(v: this): number;
  153. public setLength(l: number): this;
  154. public eqauls(v: this): boolean;
  155. public clone(): this;
  156. public clamp(min: this, max: this): this;
  157. public clampScalar(min: number, max: number): this;
  158. public floor(): this;
  159. public ceil(): this;
  160. public round(): this;
  161. public roundToZero(): this;
  162. public lerp(v: this, alpha: number): this;
  163. public lerpVectors(v1: this, v2: this, alpha: number): this;
  164. public setComponent(index: number, value: number);
  165. public addScalar(s: number): this;
  166. public getComponent(index: number): number;
  167. public fromArray(array: number[]): this;
  168. public toArray(array: number[]): number[];
  169. public min(v: this): this;
  170. public max(v: this): this;
  171. public setX(x: number): this;
  172. public setY(y: number): this;
  173. }
  174. export class Vector3 {
  175. constructor(x: number, y: number,z:number)
  176. public x: number
  177. public y: number
  178. public z:number
  179. public set(x: number, y: number,z:number): this
  180. public copy(v: this): this
  181. public add(v: this): this
  182. public addVectors(a: this, b: this): this
  183. public addScaledVector(v: this, s: number): this
  184. public sub(v: this): this
  185. public subVectors(a: this, b: this): this
  186. public multiplyScalar(s: number): this;
  187. public divideScalar(s: number): this;
  188. public negate(): this;
  189. public dot(v: this): number;
  190. public lengthSq(): number;
  191. public length(): number;
  192. public lengthManhattan(): number;
  193. public normalize(): this;
  194. public distanceTo(v: this): number;
  195. public distanceToSquared(v: this): number;
  196. public setLength(l: number): this;
  197. public cross(v: this): this;
  198. public crossVectors(a: Vector3, b: Vector3): this;
  199. public setFromMatrixPosition(m: Matrix4): this;
  200. public setFromMatrixScale(m: Matrix4): this;
  201. public equals(v: this): boolean;
  202. public clone(): this;
  203. public clamp(min: Vector3, max: Vector3): this;
  204. public clampScalar(min: number, max: number): this;
  205. public floor(): this;
  206. public ceil(): this;
  207. public round(): this;
  208. public roundToZero(): this;
  209. public applyMatrix3(m: Matrix3): this;
  210. public applyMatrix4(m: Matrix4): this;
  211. public projectOnPlane(planeNormal: this): this;
  212. public projectOnVector(vector: this): this;
  213. public addScalar(s: number): this;
  214. public divide(v: this): this;
  215. public min(v: this): this;
  216. public max(v: this): this;
  217. public setComponent(index: number, value: number): this;
  218. public transformDirection(m: Matrix4): this;
  219. public multiplyVectors(a: this, b: this): this;
  220. public getComponent(index: number): number;
  221. public applyAxisAngle(axis: this, angle: number): this;
  222. public lerp(v: Vector3, alpha: number): this;
  223. public lerpVectors(v1: this, v2: this, alpha: number): this;
  224. public angleTo(v: Vector3): number;
  225. public setFromMatrixColumn(index: number, matrix: Matrix4): this;
  226. public reflect(normal: this): this;
  227. public fromArray(array: number[]): this;
  228. public multiply(v: this): this;
  229. public applyProjection(m: Matrix4): this;
  230. public toArray(array?: number[]): number[];
  231. public applyEuler(euler: Euler): this;
  232. public applyQuaternion(quaterion: Quaternion): this;
  233. public project(camera: Camera): this;
  234. public unproject(camear: Camera): this;
  235. }
  236.  
  237. export class Camera extends Object3D {
  238. constructor();
  239. public matrixWorldInverse: Matrix4;
  240. public projectionMatrix: Matrix4;
  241. public getWorldDirection(vector?: Vector3): Vector3;
  242. public lookAt(vector: Vector3);
  243. public clone(camera: this): this;
  244. }
  245.  
  246. export class Color {
  247. constructor(r: number | string, g?: number, b?: number)
  248. public r: number
  249. public g: number
  250. public b: number
  251.  
  252. public copy(color: this): this;
  253. public copyGammaToLinear(color: this): this;
  254. public copyLinearToGamma(color: this): this;
  255. public convertGammaToLinear(): this;
  256. public convertLinearToGamma(): this;
  257. public setRGB(r: number, g: number, b: number): this;
  258. public getHex(): number;
  259. public getHexString(): string;
  260. public setHex(hex: number): this;
  261. public setStyle(style: string): this;
  262. public getStyle(): string;
  263. public setHSL(h: number, s: number, l: number): this;
  264. public offsetHSL(h: number, s: number, l: number): this;
  265. public add(color: this): this;
  266. public addColors(color1: this, color2: this): this;
  267. public addScalar(s: number): this;
  268. public multiply(color: this): this;
  269. public lerp(color: this, alpha: number): this;
  270. public toArray(array: number[]): number[];
  271. public equals(c: this): boolean;
  272. public clone(): this;
  273. public set(value: number|this|string): this;
  274. }
  275.  
  276. export class Frustum {
  277. constructor(p0: Plane, p1: Plane, p2: Plane, p3: Plane, p4: Plane, p5: Plane);
  278. public planes: Plane[];
  279. public setFromaMatrix(matrix: Matrix4);
  280. public intersectsObject(object: Object3D): boolean;
  281. public clone(): this;
  282. public set(p0: Plane, p1: Plane, p2: Plane, p3: Plane, p4: Plane, p5: Plane):this;
  283. public copy(frustum: this): this;
  284. public containsPoint(point: Vector3): boolean;
  285. public intersectsSphere(sphere: Sphere): boolean;
  286. }
  287.  
  288. export class Face3 {
  289. constructor(a: number, b: number, c: number, normal: Vector3, color: Color, materialIndex: number)
  290. public a: number
  291. public b: number
  292. public c: number
  293. public normal: Vector3
  294. public color: Color
  295. public vertexNormals: Vector3[];
  296. public materialIndex: number;
  297. public vertexColors: Color[];
  298. public clone(): Face3;
  299. }
  300.  
  301. export class Quaternion {
  302. constructor(x?: number, y?: number, z?: number, w?: number);
  303. public x: number;
  304. public y: number;
  305. public z: number;
  306. public w: number;
  307. public set(x: number, y: number, z: number, w: number);
  308. public copy(q: this);
  309. public setFromEuler(euler: Euler);
  310. public setFromAxisAngle(axis: Vector3, angle: number);
  311. public setFromRotationMatrix(m: Matrix4);
  312. public setFromUnitVectors(vFrom: Vector3, vTo: Vector3);
  313. public inverse();
  314. public length();
  315. public normalize();
  316. public multiply(b: any);
  317. public multiplyQuaternions(a: any, b: any);
  318. public multiplyVector3(vector: Vector3, dest?: Vector3);
  319. public clone(): this;
  320. public toArray(array: number[]);
  321. public equals(v: this): boolean;
  322. public lengthSq(): number;
  323. public fromArray(array: number[]);
  324. public conjugate(): this;
  325. public slerp(quaternionB: this, t: number);
  326. public static slerp(qStart: Quaternion, qEnd: Quaternion, qTarget: Quaternion, t: number);
  327. }
  328.  
  329. export class Euler {
  330. constructor(x: number, y: number, z: number, order?: string);
  331. public x: number;
  332. public y: number;
  333. public z: number;
  334. public order: string;
  335. public set(x: number, y: number, z: number, order?: string): this;
  336. public copy(euler: this): this;
  337. public setFromRotationMatrix(m: Matrix4, order?: string): this;
  338. public setFromQuaternion(q: Quaternion, order?: string): this;
  339. public reorder(newOrder: string): this;
  340. public setFromVector3(vector: Vector3, order?: string): this;
  341. public toVector3(): Vector3;
  342. public fromArray(array: any[]): this;
  343. public toArray(array: any[]): any[];
  344. public equals(euler: this): boolean;
  345. public clone(): this;
  346. }
  347.  
  348. export class Matrix4 {
  349. public elements: number[];
  350. constructor();
  351. public set(n11: number, n12: number, n13: number, n14: number,
  352. n21: number, n22: number, n23: number, n24: number,
  353. n31: number, n32: number, n33: number, n34: number,
  354. n41: number, n42: number, n43: number, n44: number): this;
  355. public identity(): this;
  356. public copy(m: this): this;
  357. public copyPosition(m: this): this;
  358. public makeBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): this;
  359. public extractBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): this;
  360. public extractRotation(m: this): this;
  361. public lookAt(eye: Vector3, center: Vector3, up: Vector3): this;
  362. public multiply(m: this): this;
  363. public multiplyMatrices(a: this, b: this): this;
  364. public multiplyToArray(a: this, b: this, r: number[]): this;
  365. public multiplyScalar(s: number): this;
  366. public determinant();
  367. public transpose(): this;
  368. public flatternToArrayOffset(flat: number[], offset: Vector3);
  369. public setPosition(v: Vector3): this;
  370. public getInverse(m: this): this;
  371. public makeRotationFromEuler(euler: Euler): this;
  372. public makeRotationFromQuaternion(q: Quaternion): this;
  373. public scale(v: Vector3): this;
  374. public compose(translation: Matrix4, quaternion: Quaternion, scale: Vector3): this;
  375. public decompose(translation: Matrix4, quaternion: Quaternion, scale: Vector3);
  376. public makeTranslation(x: number, y: number, z: number): this;
  377. public makeRotationX(theta: number): this;
  378. public makeRotationY(theta: number): this;
  379. public makeRotationZ(theta: number): this;
  380. public makeRotationAxis(axis: Vector3, theta: number): this;
  381. public makeScale(x: number, y: number, z: number): this;
  382. public makeFrustum(left: number, right: number, bottom: number, top: number, near: number, far: number): this;
  383. public makePerspective(fov: number, aspect: number, near: number, far: number): this;
  384. public makeOrthographic(left: number, right: number, top: number, bottom: number, near: number, far: number): this;
  385. public clone(): this;
  386. public applyToVector3Array(a: Vector3);
  387. public getMaxScaleOnAxis(): number;
  388. }
  389.  
  390. export class Object3D {
  391. public id: number;
  392. public uuid: number;
  393. public name: string;
  394. public parent: Object3D;
  395. public children: Object3D[];
  396. public position: Vector3;
  397. public rotation: Vector3;
  398. public scale: number;
  399. public up: Vector3;
  400. public matrix: Matrix4;
  401. public quaternion: Quaternion;
  402. public visible: boolean;
  403. public castShadow: boolean;
  404. public receiveShadow: boolean;
  405. public frustumCulled: boolean;
  406. public matrixAutoUpdate: boolean;
  407. public matrixWorldNeedsUpdate: boolean;
  408. public rotationAutoUpdate: boolean;
  409. public userData: any;
  410. public matrixWorld: Matrix4;
  411.  
  412. public applyMatrix(matrix: Matrix4);
  413. public translateX(distance: number);
  414. public translateY(distance: number);
  415. public translateZ(distance: number);
  416. public localToWorld(vector: Vector3):Vector3;
  417. public worldToLocal(vector: Vector3): Vector3;
  418. public lookAt(vector: Vector3);
  419. public add(object?: any,p1?:any,p2?:any,p3?:any,p4?:any);
  420. public remove(object: Object3D);
  421. public traverse(callback: (Object3D) => void);
  422. public traverseVisible(callback: (Object3D) => void);
  423. public traverseAncestors(callback: (Object3D) => void);
  424. public updateMatrix();
  425. public updateMatrixWorld(force: boolean);
  426. public clone(object?:any): this;
  427. public getObjectByName(name: string): this;
  428. public getObjectById(id: number): this;
  429. public translateOnAxis(axis: Vector3, distance: number);
  430. public rotateOnAxis(axis: Vector3, angle: number);
  431. public raycast(raycaster, intersects);
  432. }
  433.  
  434. export class raycasterIntersectObjectResult {
  435. public distance: number;
  436. public point: Vector3;
  437. public face: Face3;
  438. public faceIndex: number;
  439. public indice: Vector3[];
  440. public object: Object3D;
  441. }
  442. export class Raycaster {
  443. constructor(origin: Vector3, direction: Vector3, near: number, far: number);
  444. public ray: Ray;
  445. public near: number;
  446. public far: number;
  447. public linePrecision: number;
  448. public set(origin: Vector3, direction: Vector3);
  449. public setFromCamera(coords: Vector2, camera: Camera);
  450. public intersectObject(object: Object3D, recursive: boolean): raycasterIntersectObjectResult[];
  451. public intersectObjects(objects: Object3D[], recursive: boolean): raycasterIntersectObjectResult[];
  452. }
  453. export class Ray {
  454. constructor(origin: Vector3, direction: Vector3);
  455. public origin: Vector3;
  456. public direction: Vector3;
  457. public applyMatrix4(matrix4: Matrix4);
  458. public at(t: number, optionalTarget?: Vector3): Vector3;
  459. public clone(): this;
  460. public copy(ray: this): this;
  461. public distanceSqToSegment(v0: Vector3, v1: Vector3, optionalPointOnRay?: Vector3, optionalPointOnSegment?: Vector3): number;
  462. public distanceToPlane(plane:Plane): number;
  463. public distanceToPoint(point: Vector3): number;
  464. public distanceSqToPoint(point: Vector3): number;
  465. public equals(ray: this): boolean;
  466. public intersectBox(box: Box3, optionalTarget?: Vector3): Vector3;
  467. public intersectPlane(plane: Plane, optionalTarget?: Vector3): Vector3;
  468. public intersectTriangle(a: Vector3, b: Vector3, c: Vector3, backfaceCulling: boolean, optionalTarget?: Vector3): Vector3;
  469. public isIntersectionBox(box: Box3): boolean;
  470. public isIntersectionPlane(plane: Plane): boolean;
  471. public isIntersectionSphere(sphere: Sphere): boolean;
  472. public recast(t: number): this;
  473. public set(origin: Vector3, direction: Vector3): this;
  474.  
  475. }
  476. export class Plane {
  477. constructor(normal: Vector3, constant: number);
  478. public normal: Vector3;
  479. public constant: number;
  480. public normalize(): this;
  481. public set(normal: Vector3, constant: number): this;
  482. public copy(plane: this): this;
  483. public applyMatrix4(matrix: Matrix4, optionalNormalMatrix?: Matrix3): this;
  484. public orthoPoint(point: Vector3, optionalTarget?: Vector3): Vector3;
  485. public isIntersectionLine(line: Line3): boolean;
  486. public intersectLine(line: Line3, optionalTarget?: Vector3): Vector3;
  487. public setFromNormalAndCoplanarPoint(normal: Vector3, point: Vector3): this;
  488. public clone(): this;
  489. public distanceToPoint(point: Vector3): number;
  490. public equals(plane: this): boolean;
  491. public setComponents(x: number, y: number, z: number, w: number): this;
  492. public distanceToSphere(sphere: Sphere): number;
  493. public setFromCoplanarPoints(a: Vector3, b: Vector3, c: Vector3): this;
  494. public projectPoint(point: Vector3, optionalTarget?: Vector3): Vector3;
  495. public negate(): this;
  496. public translate(offset: Vector3): this;
  497. public coplanarPoint(optionalTarget?: Vector3): Vector3;
  498.  
  499. }
  500.  
  501. export class Sphere extends Object3D {
  502. constructor(center: Vector3, radius: number);
  503. public center: Vector3;
  504. public radius: number;
  505. public set(center: Vector3, radius: number);
  506. public applyMatrix4(matrix: Matrix4): this;
  507. public clampPoint(point: Vector3, optionalTarget?: Vector3): Vector3;
  508. public translate(offset: Vector3): this;
  509. public clone(): this;
  510. public equals(sphere: this): boolean;
  511. public setFromPoints(points: Vector3[], optionalCenter?: Vector3): this;
  512. public distanceToPoint(point: Vector3): number;
  513. public getBoundingBox(optionalTarget: Box3): Box3;
  514. public containsPoint(point: Vector3): boolean;
  515. public copy(sphere: this): this;
  516. public intersectsSphere(sphere: this): boolean;
  517. public empty(): boolean;
  518.  
  519. }
  520. export class Box2 {
  521. constructor(min: Vector2, max: Vector3);
  522. public min: Vector2;
  523. public max: Vector2;
  524. public set(min: Vector3, max: Vector2): this;
  525. public expandByPoint(point: Vector2): this;
  526. public clampPoint(point: Vector2, optionalTarget?: Vector2): Vector2;
  527. public isIntersectionBox(box: this): boolean;
  528. public setFromPoints(points: Vector2[]): this;
  529. public size(optionalTarget?: Vector2): Vector2;
  530. public union(box: this): this;
  531. public getParameter(point: Vector2, optionalTarget?: Vector2): Vector2;
  532. public expandByScalar(scalar: number): this;
  533. public intersect(box: this): this;
  534. public containsBox(box: this): boolean;
  535. public translate(offset: Vector2): this;
  536. public empty(): boolean;
  537. public clone(): this;
  538. public equals(box: this): boolean;
  539. public expandByVector(vector: Vector2): this;
  540. public copy(box: this): this;
  541. public makeEmpty(): this;
  542. public center(optionalTarget?: Vector2): Vector2;
  543. public distanceToPoint(point: Vector2): number;
  544. public containsPoint(point: Vector2): boolean;
  545. public setFromCenterAndSize(center: Vector2, size: Vector2): this;
  546. }
  547. export class Box3 {
  548. constructor(min: Vector3, max: Vector3);
  549. public min: Vector3;
  550. public max: Vector3;
  551. public set(min: Vector3, max: Vector3): this;
  552. public applyMatrix4(matrix: Matrix4): this;
  553. public clampPoint(point: Vector3, optionalTarget?: Vector3): Vector3;
  554. public isIntersectionBox(box: this): boolean;
  555. public setFromPoints(points: Vector3[]): this;
  556. public setFromObject(object: Object3D): this;
  557. public size(optionalTarget?:Vector3): Vector3;
  558. public union(box: this): this;
  559. public getParameter(point: Vector3, optionalTarget?: Vector3): Vector3;
  560. public intersect(box: this): this;
  561. public containsBox(box: this): boolean;
  562. public containsPoint(point: Vector3): boolean;
  563. public translate(offset: Vector3): this;
  564. public empty(): boolean;
  565. public clone(): this;
  566. public equals(box: this): boolean;
  567. public expandByPoint(point: Vector3): this;
  568. public expandByScalar(scalar: number): this;
  569. public expandByVector(vector: Vector3): this;
  570. public copy(box: this): this;
  571. public makeEmpty(): this;
  572. public center(optionalTarget?: Vector3): Vector3;
  573. public getBoundingSphere(optionalTarget?: Vector3): Sphere;
  574. public distanceToPoint(point: Vector3): number;
  575. public setFromCenterAndSize(center: Vector3, size: Vector3): this;
  576.  
  577. }
  578.  
  579. export class Math {
  580. public static clamp(value: number, min: number, max: number): number;
  581. public static mapLinear(x: number, a1: number, a2: number, b1: number, b2: number);
  582. public static random16(): number;
  583. public static randInt(low: number, high: number): number;
  584. public static raindFloat(low: number, high: number): number;
  585. public static randFloatSpread(range: number): number;
  586. public static sign(x: number): number;
  587. public static degToRad(degress: number): number;
  588. public static radToDeg(radians: number): number;
  589. public static smoothstep(x: number, min: number, max: number): number;
  590. public static smoothersttep(x: number, min: number, max: number): number;
  591. }
  592. export class Spline {
  593. constructor(points: Vector3[]);
  594. public points: Vector3[];
  595. public initFromArray(a: number[][]): void;
  596. public getPoint(k: number): Vector3;
  597. public getControlPointsArray(): number[];
  598. public getLength(nSubDivisions: number): any;
  599. public reparametrizeByArcLength(samplingCoef: number): void;
  600. }
  601. export class Triangle {
  602. constructor(a: Vector3, b: Vector3, c: Vector3);
  603. public a: Vector3;
  604. public b: Vector3;
  605. public c: Vector3;
  606. public setFromPointsAndIndices(points: Vector3[], i0: number, i1: number, i2: number): this;
  607. public set(a: Vector3, b: Vector3, c: Vector3): this;
  608. public normal(optionalTarget?: Vector3): Vector3;
  609. public barycoordFromPoint(point: Vector3, optionalTarget?: Vector3): Vector3;
  610. public clone(): this;
  611. public area(): number;
  612. public midpoint(optionalTarget?: Vector3): Vector3;
  613. public equals(triangle: this): boolean;
  614. public plane(optionalTarget?: Vector3): Plane;
  615. public containsPoint(point: Vector3): boolean;
  616. public copy(triangle: this): this;
  617. }
  618.  
  619. export class Bone extends Object3D {
  620. constructor(skin?: SkinnedMesh);
  621. public skin: SkinnedMesh;
  622. public clone(object: this): this;
  623. }
  624. export class LensFlare extends Object3D {
  625. constructor(texture: Texture, size: number, distance: number, blending: number, color: Color);
  626. public lensFlare: any[];
  627. public positionScreen: Vector3;
  628. public customUpdateCallback: (any) => any;
  629. public add(texture: Texture, size: number, distance: number, blending: number, color: Color);
  630. public updateLensFlares(): void;
  631. public clone(object: this): this;
  632. }
  633.  
  634. export class Line3 {
  635. constructor(start: Vector3, end: Vector3);
  636. public start: Vector3;
  637. public end: Vector3;
  638. public set(start: Vector3, end: Vector3);
  639. public copy(line: this);
  640. public clone(): this;
  641. public eqauls(line: this): boolean;
  642. public distance(): number;
  643. public distanceSq(): number;
  644. public applyMatrix4(matrix: Matrix4): this;
  645. public at(t: number, optionalTarget?: Vector3): Vector3;
  646. public center(optionalTarget?: Vector3): Vector3;
  647. public delta(optionalTarget?: Vector3): Vector3;
  648. public closestPointToPoint(point: Vector3, clmapToLine: boolean, optionalTarget?: Vector3): Vector3;
  649. public closestPointToPointParameter(point: Vector3, clampToLine: boolean): Vector3;
  650. }
  651. export class Line extends Object3D {
  652. constructor(geometry: Geometry, material: Material);
  653. public geometry: Geometry;
  654. public material: Material;
  655. public raycast(raycaster: Raycaster, intersects: Object3D[]): raycasterIntersectObjectResult[];
  656. public clone(object: this): this;
  657. }
  658. export class LOD extends Object3D {
  659. constructor();
  660. public objects: Object3D[];
  661. public addLevel(mesh: Mesh, distance: number): void;
  662. public getObjectForDistance(distance: number): Object3D;
  663. public update(camera: Camera): void;
  664. public clone(object?: Object3D): this;
  665. }
  666. export class LineSegments extends Line {
  667. constructor(geometry: Geometry, material: Material);
  668. public geometry: Geometry;
  669. public material: Material;
  670. public raycast(raycaster: Raycaster, intersects: Object3D[]): raycasterIntersectObjectResult[];
  671. public clone(object: this): this;
  672.  
  673. }
  674. export class Matrix3 {
  675. constructor();
  676. public elements: number[];
  677. public transpose();
  678. public transposeIntoArray(array: number[]): this;
  679. public determinant(): number;
  680. public set(n11: number, n12: number, n13: number,
  681. n21: number, n22: number, n23: number,
  682. n31: number, n32: number, n33: number): this;
  683. public multiplyScalar(s: number): this;
  684. public applyToVector3Array(array: number[]);
  685. public getNormalMatrix(m: Matrix4): this;
  686. public getInverse(m: Matrix4, throwOnInertible: boolean): this;
  687. public copy(m: Matrix4): this;
  688. public clone(): this;
  689. public identity(): this;
  690.  
  691. }
  692.  
  693. export class MorphTarget {
  694. public name: string;
  695. public vertices: Vector3[];
  696. }
  697. export class BoundingBox {
  698. public min: Vector3;
  699. public max: Vector3;
  700. }
  701. export class BoundingSphere {
  702. public radius: number;
  703. }
  704. export class Geometry {
  705. public id: number
  706. public name: string
  707. public vertices: Vector3[]
  708. public colors: Color[]
  709. public faces: Face3[];
  710. public faceVertexUvs: any[];
  711. public morphTargets: MorphTarget[];
  712. public morphNormals: MorphTarget[];
  713. public skinWeights: Vector4[];
  714. public skinIndices: Vector4[];
  715. public boundingBox: BoundingBox;
  716. public boundingSphere: BoundingSphere;
  717. public dynamic: boolean;
  718. public verticesNeedUpdate: boolean;
  719. public elementsNeedUpdate: boolean;
  720. public uvsNeedUpdate: boolean;
  721. public normalsNeedUpdate: boolean;
  722. public colorsNeedUpdate: boolean;
  723. public lineDistancesNeedUpdate: boolean;
  724. public lineDistances: number[];
  725. public applyMatrix(matrix: Matrix4):void;
  726. public center():void;
  727. public rotateX(radians: number): this;
  728. public rotateY(radians: number): this;
  729. public rotateZ(radians: number): this;
  730. public translate(x: number, y: number, z: number): this;
  731. public scale(x: number, y: number, z: number): this;
  732. public lookAt(vector: Vector3): this;
  733. public computeFaceNormals(): void;
  734. public computeVertexNormals(): void;
  735. public computeBoundingBox(): void;
  736. public computeBoundingSphere(): void;
  737. public merge(geometry: this, matrix: Matrix4, materialINdexOffset: number): void;
  738. public mergeVertices(): void;
  739. public normalize();
  740. public clone(): this;
  741. public dispose(): void;
  742. public computeLineDistances(): void;
  743. }
  744. export class BoxGeometry extends Geometry {
  745. constructor(width: number, height: number, depth: number,
  746. widthSegments?: number, heightSegments?: number, depthSegments?: number);
  747. public parameters: any;
  748. }
  749. export class CircleGeometry extends Geometry {
  750. constructor(radius: number, segments: number, thetaStart: number, thetaLength: number);
  751. }
  752. export class AxisHelper extends Line {
  753. constructor(size: number);
  754. }
  755. export class CylinderGeometry extends Geometry {
  756. constructor(
  757. radiusTop: number,
  758. radiusBottom: number,
  759. height: number,
  760. radiusSegments?: number,
  761. heightSegments?: number,
  762. openEnded?: boolean,
  763. thetaStart?: number,
  764. thetaLength?: number);
  765. public radiusTop: number;
  766. public radiusBottom: number;
  767. public height: number;
  768. public radiusSegments: number;
  769. public heightSegments: number;
  770. public openEnded: boolean;
  771. public thetaStart: number;
  772. public thetaLength: number;
  773. }
  774.  
  775. export class PolyhedronGeometry extends Geometry{
  776. constructor(vertices: number[], faces: number[], radius: number, detail: number);
  777. public parameters: any;
  778. }
  779. export class DodecahedronGeometry extends PolyhedronGeometry {
  780. constructor(radius: number, detail: number);
  781. }
  782. export class IcosahedronGeometry extends PolyhedronGeometry {
  783. constructor(radius: number, detail: number);
  784. }
  785. export class OctahedronGeometry extends PolyhedronGeometry {
  786. constructor(radius: number, detail: number);
  787. }
  788. export class LatheGeometry extends Geometry {
  789. constructor(points: Vector3[], segments: number, phiStart: number, phiLength: number);
  790. }
  791. export class ParametricGeometry extends Geometry {
  792. constructor(func: (u: number, v: number) => Vector3, slices: number, stacks: number);
  793. }
  794. export class PlaneGeometry extends Geometry {
  795. constructor(width: number, height: number, widthSegments: number, heightSegments: number);
  796. public width: number;
  797. public height: number;
  798. public widthSegments: number;
  799. public heightSegments: number;
  800. }
  801. export class RingGeometry extends Geometry {
  802. constructor(innerRaidus: number, outerRadius: number,
  803. thetaSegments: number, phiSegments: number, thetaStart: number, thetaLength: number);
  804. }
  805. export class TetrahedronGeometry extends PolyhedronGeometry {
  806. constructor(radius: number, detail: number);
  807. }
  808.  
  809. export class SphereGeometry extends Geometry {
  810. constructor(
  811. radius?: number,
  812. widthSegments?: number,
  813. heightSegments?: number,
  814. phiStart?: number,
  815. phiLength?: number,
  816. thetaStart?: number,
  817. thetaLength?: number);
  818. public radius: number;
  819. public widthSegments: number;
  820. public heightSegments: number;
  821. public phiStart: number;
  822. public phiLength: number;
  823. public thetaStart: number;
  824. public thetaLength: number;
  825. }
  826.  
  827. export class Vector4 {
  828. constructor(x: number, y: number, z: number, w: number);
  829. public x: number;
  830. public y: number;
  831. public z: number;
  832. public w: number;
  833. public copy(v: this): this;
  834. public add(v: this): this;
  835. public addVectors(a: this, b: this): this;
  836. public addScaledVector(v: this, s: number): this;
  837. public sub(v: this): this;
  838. public subVectors(a: this, b: this): this;
  839. public multiplyScalar(s: number): this;
  840. public divideScalar(s: number): this;
  841. public negate(): this;
  842. public lengthSq(): number;
  843. public length(): number;
  844. public normalize(): this;
  845. public setLength(l: number): this;
  846. public lerp(v: this, alpha: number): this;
  847. public lerpVectors(v1: this, v2: this, alpha): this;
  848. public clone(): this;
  849. public clamp(min: this, max: this): this;
  850. public clampScalar(min: number, max: number): this;
  851. public floor(): this;
  852. public ceil(): this;
  853. public round(): this;
  854. public roundToZero(): this;
  855. public applyMatrix4(m: Matrix4): this;
  856. public min(v: this): this;
  857. public max(v: this): this;
  858. public addScalar(s: number): this;
  859. public equals(v: this): boolean;
  860. public setAxisAngleFromRotationMatrix(m: Matrix4): this;
  861. public setAxisAngleFromQuaterion(q: Quaternion): this;
  862. public getComponent(index: number): number;
  863. public setComponent(index: number, value: number);
  864. public fromArray(array: number[]): this;
  865. public toArray(array: number[]): number[];
  866. public lengthManhattan(): number;
  867. public setX(x: number): this;
  868. public setY(y: number): this;
  869. public setZ(z: number): this;
  870. public setW(w: number): this;
  871.  
  872. }
  873.  
  874. export enum Side {
  875. FrontSide = 0,
  876. BackSide = 1,
  877. DoubleSide = 2
  878. }
  879. export enum Blending {
  880. NoBlending = 0,
  881. NormalBlending = 1,
  882. AdditiveBlending = 2,
  883. SubtractiveBlending = 3,
  884. MultiplyBlending = 4,
  885. CustomBlending = 5
  886. }
  887. export class Material {
  888. constructor();
  889. public id: number;
  890. public name: string;
  891. public opacity: number;
  892. public transparent: boolean;
  893. public blending: Blending;
  894. public blendSrc: number;
  895. public blendDst: number;
  896. public blendEquation: number;
  897. public depthTest: boolean;
  898. public depthWrite: boolean;
  899. public polygonOffset: boolean;
  900. public polygonOffsetFactor: number;
  901. public polygonOffsetUnits: number;
  902. public alphaTest: number;
  903. public overdraw: number;
  904. public visible: boolean;
  905. public side: Side;
  906. public needUpdate: boolean;
  907.  
  908. public clone(material: this): this;
  909. public dispose();
  910. public setValues(values: any);
  911.  
  912. }
  913.  
  914. export class MeshPhongMaterialParameters {
  915. public color: number;
  916. public map: Texture;
  917. public lightMap: Texture;
  918. public aoMap: Texture;
  919. public emissiveMap: Texture;
  920. public specularMap: Texture;
  921. public alphaMap: Texture;
  922. public envMap: Texture;
  923. public fog: boolean;
  924. public shading: any;
  925. public wireframe: boolean;
  926. public wireframeLinewidth: number;
  927. public wireframeLinecap: string;
  928. public wireframeLinejoin: string;
  929. public vertexColors: any;
  930. public skining: boolean;
  931. public morphTargets: boolean;
  932. }
  933. export class LineBasicMaterial extends Material {
  934. constructor(parameters: any);
  935. public color: number;
  936. public linewidth: number;
  937. public linecap: string;
  938. public linejoin: string;
  939. public vertexColors: VertexColor;
  940. public fog: boolean;
  941. }
  942. export class LineDashedMaterial extends Material {
  943. constructor(parameters: any);
  944. public color: number;
  945. public linewidth: number;
  946. public scale: number;
  947. public dashSize: number;
  948. public gapSize: number;
  949. public vertexColors: VertexColor;
  950. public fog: boolean;
  951. }
  952. export class MeshBasicMaterial extends Material {
  953. constructor(parameters: any);
  954. public color: number;
  955. public map: Texture;
  956. public aoMap: Texture;
  957. public specularMap: Texture;
  958. public alphaMap: Texture;
  959. public envMap: Texture;
  960. public fog: boolean;
  961. public shading: Shading;
  962. public wireframe: boolean;
  963. public wireframeLinewidth: number;
  964. public wireframeLinecap: string;
  965. public wireframeLinejoin: string;
  966. public vertexColors: VertexColor;
  967. public skinning: boolean;
  968. public morphTargets: boolean;
  969. public combine: number;
  970. public reflectivity: number;
  971. public refractionRatio: number;
  972. }
  973. export class MeshDepthMaterial extends Material {
  974. constructor(parameters: any);
  975. public morthTargets: boolean;
  976. public wireframe: boolean;
  977. public wireframeLinewidth: number;
  978. }
  979. export class MeshFaceMaterial {
  980. constructor(materials: Material[]);
  981. public materials: Material[];
  982. }
  983. export class MeshLambertMaterial extends Material {
  984. constructor(parameters: any);
  985. }
  986. export class MeshNormalMaterial extends Material {
  987. constructor(parameters: any);
  988. }
  989. export class PointsMaterial extends Material {
  990. constructor(parameters: any);
  991. }
  992. export class SpriteCanvasMaterial extends Material {
  993. constructor(parameters: any);
  994. }
  995. export class SpriteMaterial extends Material {
  996. constructor(parameters: any);
  997. }
  998. export class MeshPhongMaterial extends Material {
  999. constructor(parameters?: any);
  1000. public color: Color;
  1001. public emissive: Color;
  1002. public specular: Color;
  1003. public skininess: number;
  1004. public metal: boolean;
  1005. public map: Texture;
  1006. public lightMap: Texture;
  1007. public aoMap: Texture;
  1008. public emissiveMap: Texture;
  1009. public bumpMap: Texture;
  1010. public bumpScale: number;
  1011. public normalMap: Texture;
  1012. public normalScale: number;
  1013. public specularMap: Texture;
  1014. public alphaMap: Texture;
  1015. public envMap: Texture;
  1016. public combine: Operation;
  1017. public reflectivity: number;
  1018. public refractionRatio: number;
  1019. public fog: boolean;
  1020. public shading: Shading;
  1021. public wireframe: boolean;
  1022. public wireframeLineWidth: number;
  1023. public wireframeLinecap: string;
  1024. public wireframeLinejoin: string;
  1025. public vertexColors: VertexColor;
  1026. public skining: boolean;
  1027. public morphTargets: boolean;
  1028. public morphNormals: boolean;
  1029.  
  1030. }
  1031.  
  1032. export class DataTexture extends Texture {
  1033. constructor(
  1034. data: number[],
  1035. width: number,
  1036. height: number,
  1037. format: Format,
  1038. type: Type,
  1039. mapping: Mapping,
  1040. wrapS: Wrapping,
  1041. wrapT: Wrapping,
  1042. magFilter: Filter,
  1043. minFilter: Filter,
  1044. anisotropy: number);
  1045. public image: HTMLImageElement;
  1046.  
  1047. }
  1048. export class CompressedTexture extends Texture {
  1049. constructor(
  1050. mipmaps: any[],
  1051. width: number,
  1052. height: number,
  1053. format: Format,
  1054. type: Type,
  1055. mapping: Mapping,
  1056. wrapS: Wrapping,
  1057. wrapT: Wrapping,
  1058. magFilter: Filter,
  1059. minFilter: Filter,
  1060. anisotropy: number);
  1061. public flipY: boolean;
  1062. public generateMipmaps: boolean;
  1063. }
  1064. export class CubeTexture extends Texture {
  1065. constructor(
  1066. image: HTMLImageElement[] | HTMLVideoElement[] | HTMLCanvasElement[],
  1067. mapping: Mapping,
  1068. wrapS: Wrapping,
  1069. wrapT: Wrapping,
  1070. magFilter: Filter,
  1071. minFilter: Filter,
  1072. formate: Format,
  1073. type: Type,
  1074. anisotropy: number);
  1075. }
  1076. export class Texture {
  1077. constructor(
  1078. image: HTMLImageElement | HTMLVideoElement|HTMLCanvasElement,
  1079. mapping: Mapping,
  1080. wrapS: Wrapping,
  1081. wrapT: Wrapping,
  1082. magFilter: Filter,
  1083. minFilter: Filter,
  1084. formate: Format,
  1085. type: Type,
  1086. anisotropy: number);
  1087. public id: number;
  1088. public image: HTMLImageElement | HTMLVideoElement|HTMLCanvasElement;
  1089. public mapping: Mapping;
  1090. public wrapS: number;
  1091. public wrapT: number;
  1092. public magFilter: Filter;
  1093. public format: Format;
  1094. public type: Type;
  1095. public anisotropy: number;
  1096. public needsUpdate: boolean;
  1097. public repeat: number;
  1098. public offset: number;
  1099. public name: string;
  1100. public generateMipmaps: boolean;
  1101. public flipY: boolean;
  1102. public mipmaps: any[];
  1103. public unpackAlignment: number;
  1104. public premultiplyAlpha: boolean;
  1105. public onUpdate: (any) => any;
  1106. public clone(texture: this): this;
  1107. public dispose(): void;
  1108. }
  1109.  
  1110. export class Intersection {
  1111. public distance: number;
  1112. public point: Vector3;
  1113. public object: Object3D;
  1114. }
  1115. export class Mesh extends Object3D {
  1116. constructor(geometry: Geometry, material: Material);
  1117. public geometry: Geometry;
  1118. public material: Material;
  1119. public morphTargetInfluences: number[];
  1120. public morphTargetDictionary: any[];
  1121. public morphTargetBase: number;
  1122. public getMorphTargetIndexByName(name: string): number;
  1123. public updateMorphTargets();
  1124. public raycast(raycaster: Raycaster, intersects: Intersection[]): raycasterIntersectObjectResult[];
  1125. public clone(object?: any): this;
  1126. }
  1127. export enum Direction {
  1128. Forward = 1,
  1129. Backwards = -1
  1130. }
  1131. export class MorphAnimMesh extends Object3D {
  1132. constructor(geometry: Geometry, material: Material);
  1133. public directionBackwards: boolean;
  1134. public direction: Direction;
  1135. public startKeyframe: number;
  1136. public endKeyframe: number;
  1137. public mirroredLoop: boolean;
  1138. public lastKeyframe: number;
  1139. public currentKeyframe: number;
  1140. public length: number;
  1141. public time: number;
  1142. public duration: number;
  1143. public setDirectionForward();
  1144. public setDirectionBackward();
  1145. public playAnimation(label: string, fps: number);
  1146. public setFrameRange(start: number, end: number);
  1147. public parseAnimations();
  1148. public updateAnimation(delta: number);
  1149. public setAnimationLabel(label: string, start: number, end: number);
  1150. public clone(object?: Object3D);
  1151. }
  1152. export class Points extends Object3D {
  1153. constructor(geometry: Geometry, material: Material);
  1154. public geometry: Geometry;
  1155. public material: Material;
  1156. public clone(): this;
  1157. public raycast(raycaster:Raycaster, intersects:Object3D[]):raycasterIntersectObjectResult[];
  1158. public clone(object?: any): this;
  1159. }
  1160. export class Skeleton {
  1161. constructor(bones: Bone[], boneInverses?: Matrix4[], useVertexTexture?: boolean);
  1162. public bones: Bone[];
  1163. public useVertexTexture: boolean;
  1164. public boneInverses: Matrix4[];
  1165. public boneTextureWidth: number;
  1166. public boneTextureHeight: number;
  1167. public boneTexture: DataTexture;
  1168. public calculateInverse(): void;
  1169. public pose(): void;
  1170. public update(): void;
  1171. public clone(): this;
  1172. }
  1173. export class Sprite extends Object3D {
  1174. constructor(material?: Material);
  1175. public material: Material;
  1176. public clone(): this;
  1177. public clone(object?: Object3D): this;
  1178.  
  1179. }
  1180.  
  1181. export class SkinnedMesh extends Object3D {
  1182. constructor(geometry: Geometry, material: Material, useVertexTexture?: boolean);
  1183. public bones: any[];
  1184.  
  1185. }
  1186.  
  1187. export class Scene extends Object3D {
  1188. constructor();
  1189. public fog: Fog;
  1190. //全局材质,如果不为空,所有的物体将强制使用此材质
  1191. public overrideMaterial: Material;
  1192. public autoUpdate: boolean;
  1193. }
  1194. export class TrackballControls {
  1195. constructor(camera: Camera);
  1196. public update(): void;
  1197. }
  1198. export class PerspectiveCamera extends Camera {
  1199. constructor(fov: number, aspect: number, near: number, far: number);
  1200. public zoom: number;
  1201. public fov: number;
  1202. public aspect: number;
  1203. public near: number;
  1204. public far: number;
  1205. public setLens(focalLength: number, frameSize: number);
  1206. public setViewOffset(fullWidth: number, fullHeight: number, x: number, y: number, width: number, height: number);
  1207. public updateProjectionMatrix();
  1208. public clone(): this;
  1209. public toJSON(): any;
  1210. }
  1211. export class Fog {
  1212. constructor(color: number, near: number, far: number);
  1213. public name: string;
  1214. public color: number;
  1215. public near: number;
  1216. public far: number;
  1217. public clone(): this;
  1218.  
  1219. }
  1220. export class FogExp2 {
  1221. constructor(hex: Color | string, density: number);
  1222. public name: string;
  1223. public color: Color;
  1224. //Default is 0.00025
  1225. public density: number;
  1226. public clone(): this;
  1227. }
  1228.  
  1229. export class WebGLRenderer {
  1230. constructor(parameters: any);
  1231.  
  1232. }
  1233. export class Group extends Object3D {
  1234. constructor();
  1235. }
  1236. export class Light extends Object3D {
  1237. constructor(hex: number);
  1238. public color: Color;
  1239. public clone(): this;
  1240. }
  1241.  
  1242. export class AmbientLight extends Light {
  1243. constructor(hex: number)
  1244. public clone(): this
  1245. toJSON(): any
  1246. }
  1247.  
  1248. export class DirectionalLight extends Light {
  1249. public intensity: number
  1250. public onlyShadow: boolean;
  1251. public castShadow: boolean;
  1252. public shadowCameraNear: number;
  1253. public shadowCameraFar: number;
  1254. public shadowCameraLeft: number;
  1255. public shadowCamearRight: number;
  1256. public shadowCameraTop: number;
  1257. public shadowCameraBottom: number;
  1258. public shadowCameraVisible: boolean;
  1259. public shadowBias: number;
  1260. public shadowMapWidth: number;
  1261. public shadowMapHeight: number;
  1262. public shadowMapSize: number;
  1263. public shadowCamera: number;
  1264. public position: Vector3;
  1265. constructor(color: number, intensity?: number)
  1266. }
  1267. export class PointLight extends Light {
  1268. constructor(hex: number, intensity: number, distance: number, decay: number);
  1269. public intensity: number;
  1270. public distance: number;
  1271. public decay: number;
  1272. public clone(): this;
  1273. public toJSON():any;
  1274.  
  1275. }
  1276. export class SpotLight extends Light {
  1277. constructor(hex: number, intensity: number, distance: number, angle: number, exponent: number, decay: number);
  1278. public target: Object3D;
  1279. public intensity: number;
  1280. public distance: number;
  1281. public angle: number;
  1282. public exponent: number;
  1283. public decay: number;
  1284. public onlyShadow: number;
  1285. public shadowCameraNear: number;
  1286. public shadowCameraFar: number;
  1287. public shadowCameraFov: number;
  1288. public shadowCameraVisible: number;
  1289. public shadowBias: number;
  1290. public shadowMapWidth: number;
  1291. public shadowMapSize: Vector2;
  1292. public shadowCamera: PerspectiveCamera;
  1293. public shadowMatrix: Matrix4;
  1294. public shadowMap: any;
  1295. public clone(): this;
  1296. }
  1297. export class HemisphereLight extends Light {
  1298. constructor(skyColorHex: number, groundColorHex: number, intensity: number);
  1299. public groundColor: number;
  1300. public intensity: number;
  1301. public clone(): this;
  1302. public toJSON(): any;
  1303. }
  1304. }

  一些three.js中的常量,本来想用enum表达的,代码编译成js,不会自动替换成对应的数值,这个算不算ts的bug?

看了遍ts手册,也没有发现好的办法,留待以后再说吧

Three.js typescript definitely typed 文件的更多相关文章

  1. TypeScript 的声明文件的使用与编写

    https://fenying.net/2016/09/19/typings-for-typescript/ TypeScript 是 JavaScript 的超集,相比 JavaScript,其最关 ...

  2. 创建Node.js TypeScript后端项目

    1.安装Node.js扩展,支持TypeScript语法 npm install -g typescript   npm install -g typings 2.创建项目目录project_fold ...

  3. 利用ajaxfileupload.js异步上传文件

    1.引入ajaxfileupload.js 2.html代码 <input type="file" id="enclosure" name="e ...

  4. 网站加载css/js/img等静态文件失败

    网站加载css/js/img等静态文件失败,报网站http服务器内部500错误.而服务器中静态文件存在且权限正常. 从浏览器中直接访问文件,出来乱码.这种问题原因在于iis中该网站mime配置报错,不 ...

  5. JS 模拟手机页面文件的下拉刷新

    js 模拟手机页面文件的下拉刷新初探 老总说需要这个功能,好吧那就看看相关的东西呗 最后弄出了一个简单的下拉刷新页面的形式,还不算太复杂 查看 demo 要在仿真器下才能看到效果,比如chrome的里 ...

  6. eclipse加速之禁用JS、jsp等文件的语法验证,eclipsejs

    eclipse加速之禁用JS.jsp等文件的语法验证 去除eclipse的JS验证:将windows->preference->Java Script->Validator-> ...

  7. js获取上传文件内容(未完待续)

    js 获取上传文件的字节数及内容 <div> 上传文件 : <input type="file" name = "file" id = &qu ...

  8. 压缩网站的css和js,合并多个文件到一个文件

    压缩网站的css和js,合并多个文件到一个文件uglifyjs index.js html5shiv.min.js -o all.min.jsuglifycss index.min.css web.c ...

  9. jq和js插件的各个文件夹里放置的内容

    1. demo文件夹,存放各种实例. 2. dist文件夹,全称是distribution.在某些框架中,因为开发和发布的内容或者代码形式是不一样的(比如利用Grunt压缩等等),这时候就需要一个存放 ...

随机推荐

  1. python——进程基础

    我们现在都知道python的多线程是个坑了,那么多进程在这个时候就变得很必要了.多进程实现了多CPU的利用,效率简直棒棒哒~~~ 拥有一个多进程程序: #!/usr/bin/env python #- ...

  2. 用C++画心(转)

    原地址https://www.zhihu.com/topic/19613730/top-answers 首先上一个动态的心 代码如下: #include <stdio.h> #includ ...

  3. 删除Kafka的topic

    刚接触Kafka,开始认为删除一个topic只是运行一下Kafka-topic.sh的delete命令就行了,但是,事实却不是这样,会出现两种情况:(1) 如果topic没有使用过即没有传输过消息,可 ...

  4. 即时反应的input和propertychange方法

    在web开发中,我们有时会需要动态监听输入框值的变化,当使用onkeydown.onkeypress.onkeyup作为监听事件时,会发现一些复制粘贴等操作用不了,同时,在处理组合快键键的时候也很麻烦 ...

  5. (49) odoo context操作

    * context  这是一个上下文,运用很灵活 * 得到整个context  V7  context=dict(context or {})  这个版本是明传  V8   self.context_ ...

  6. 基于jstree的 对混乱的 命名系统进行归类的 计算机软件

    本人现在就职于一家加拿大东部餐饮连锁公司的IT部门,公司旗下有4个品牌,280多家餐厅. 所有的餐厅都使用maitred 的pos软件来处理收银结账. 公司总部使用business object 对m ...

  7. 239. Sliding Window Maximum *HARD* -- 滑动窗口的最大值

    Given an array nums, there is a sliding window of size k which is moving from the very left of the a ...

  8. CA02检验计划批量导入 模板在文件

    *&---------------------------------------------------------------------* *& PROGRAM NAME(EN) ...

  9. 神奇的margin之豆瓣豆瓣么么哒

    在经过周末的豆瓣主页和这周的豆瓣电影,表示网页什么的已经被我玩坏了. 老师在周末布置豆瓣主页,对于只学了四天的css和html的我,表示鸭梨山大. 最开始的两个小时只能做出一个连自己都看不下去的导航栏 ...

  10. web前端页面项目经验总结

    项目时间:2016年4月5日--4月9日项目名称:阿七果子园web前端页面项目内容:    1.HTML5+CSS+JavaScript(banner+timer)+JQuery(small_bann ...