【发布时间】:2013-10-26 23:57:07
【问题描述】:
我无法获得 this 在 TypeScript 中使用上述组合的示例。
我的 html <head> 中有 <script src="lib/three.min.js"></script> 和 <script src="lib/OrbitControls.js"></script>,<body> 中有打字稿文件:
/// <reference path="lib\three.d.ts" />
...
this.controls = new THREE.OrbitControls(this.camera); //there's the error
this.controls.addEventListener('change', this.render);
...
和
this.controls.update();
在定期调用render() 函数。据我所知,设置与示例相同,但在编译 OrbitControls 构造函数行时给了我一个巨大的错误(缩写):
The property 'OrbitControls' does not exist on value of type '{REVISION:string;
CullFace: {[x: number ...
我猜这个错误中有整个 Threejs,因为 Visual Studio 在我点击它的那一刻就崩溃了 :)。感谢您的帮助。
【问题讨论】:
标签: javascript html three.js typescript