Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
HARP-11466: Fix animation example.
Browse files Browse the repository at this point in the history
It got broken due to changes in inflate.min.js dependency in latest
THREE.js release. Fixed by importing module version of FBXLoader.
inflate is imported directly in that module.
  • Loading branch information
atomicsulfate committed Aug 10, 2020
1 parent 43c428b commit 064624d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions @here/harp-examples/src/threejs_animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@
import { GeoCoordinates } from "@here/harp-geoutils";
import { MapAnchor, MapViewEventNames, RenderEvent } from "@here/harp-mapview";
import * as THREE from "three";
import { FBXLoader } from "three/examples/jsm/loaders/FBXLoader.js";
import { HelloWorldExample } from "./getting-started_hello-world_npm";

// tslint:disable-next-line:no-var-requires
(window as any).Zlib = require("three/examples/js/libs/inflate.min.js").Zlib;

import "three/examples/js/loaders/FBXLoader";

/**
* This example builds on top of the [[ThreejsAddSimpleObject]].
* Additionaly this example shows how to animate a [THREE.js](https://threejs.org/) object that
Expand Down Expand Up @@ -82,7 +78,7 @@ export namespace ThreejsAddAnimatedObject {
};

// snippet:harp_gl_threejs_add_animated-object_load.ts
const loader = new (THREE as any).FBXLoader();
const loader = new FBXLoader();
loader.load("resources/dancing.fbx", onLoad);
// end:harp_gl_threejs_add_animated-object_load.ts

Expand Down

0 comments on commit 064624d

Please sign in to comment.