Skip to content

Commit

Permalink
Pass through camera to AvatarRenderer
Browse files Browse the repository at this point in the history
  • Loading branch information
Avaer Kazmer committed Aug 15, 2022
1 parent 5b4db36 commit 906f91f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion type_templates/vrm.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as THREE from 'three';
import metaversefile from 'metaversefile';
const { useApp, usePhysics, useAvatarRenderer, useCleanup, useActivate, useLocalPlayer } = metaversefile;
const {useApp, usePhysics, useAvatarRenderer, useCamera, useCleanup, useActivate, useLocalPlayer} = metaversefile;

const localVector = new THREE.Vector3();
const localVector2 = new THREE.Vector3();
Expand All @@ -20,6 +20,7 @@ const _fetchArrayBuffer = async srcUrl => {

export default e => {
const app = useApp();
const camera = useCamera();
const physics = usePhysics();

const srcUrl = ${this.srcUrl};
Expand All @@ -33,6 +34,7 @@ export default e => {
app.renderer = new AvatarRenderer({
arrayBuffer,
srcUrl,
camera,
});
await app.renderer.waitForLoad();
app.add(app.renderer.scene);
Expand Down

0 comments on commit 906f91f

Please sign in to comment.