提交 941f171d 编写于 作者: D Don McCurdy

DRACOLoader: Fix remaining calls to removed static methods.

上级 b0430815
......@@ -182,10 +182,11 @@ var Loader = function ( editor ) {
var contents = event.target.result;
THREE.DRACOLoader.setDecoderPath( '../examples/js/libs/draco/gltf/' );
var dracoLoader = new THREE.DRACOLoader();
dracoLoader.setDecoderPath( '../examples/js/libs/draco/gltf/' );
var loader = new THREE.GLTFLoader();
loader.setDRACOLoader( new THREE.DRACOLoader() );
loader.setDRACOLoader( dracoLoader );
loader.parse( contents, '', function ( result ) {
var scene = result.scene;
......
......@@ -20,9 +20,9 @@ Each file is provided in two variations:
Either variation may be used with `THREE.DRACOLoader`:
```js
THREE.DRACOLoader.setDecoderPath('path/to/decoders/');
THREE.DRACOLoader.setDecoderConfig({type: 'js'}); // (Optional) Override detection of WASM support.
var dracoLoader = new THREE.DRACOLoader();
dracoLoader.setDecoderPath('path/to/decoders/');
dracoLoader.setDecoderConfig({type: 'js'}); // (Optional) Override detection of WASM support.
```
Further [documentation on GitHub](https://github.com/google/draco/tree/master/javascript/example#static-loading-javascript-decoder).
......
......@@ -140,10 +140,11 @@
function initCar() {
DRACOLoader.setDecoderPath( 'js/libs/draco/gltf/' );
var dracoLoader = new DRACOLoader();
dracoLoader.setDecoderPath( 'js/libs/draco/gltf/' );
var loader = new GLTFLoader();
loader.setDRACOLoader( new DRACOLoader() );
loader.setDRACOLoader( dracoLoader );
loader.load( 'models/gltf/ferrari.glb', function ( gltf ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册