Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pulling in upstream #16

Merged
merged 11 commits into from
Sep 11, 2020
12 changes: 4 additions & 8 deletions examples/camera/app.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import React, {useState, useRef} from 'react';
import DeckGL from '@deck.gl/react';
import {DeckAdapter} from '@hubble.gl/core';
import {DeckAdapter, CameraKeyframes} from '@hubble.gl/core';
import {useNextFrame, BasicControls, ResolutionGuide} from '@hubble.gl/react';
import {sceneBuilder} from './scene';
import {layers} from './layers';
import {vignette, fxaa} from '@luma.gl/shadertools';
import {PostProcessEffect} from '@deck.gl/core';

import {CameraKeyframes} from '@hubble.gl/core';
import {easing} from 'popmotion';

const INITIAL_VIEW_STATE = {
Expand Down Expand Up @@ -41,9 +39,7 @@ export default function App() {
const deckgl = useRef(null);
const [ready, setReady] = useState(false);
const [busy, setBusy] = useState(false);

const [viewState, setViewState] = useState(INITIAL_VIEW_STATE); //Added to maintain user's interactions with viewState

const nextFrame = useNextFrame();

const updateCamera = (prevCamera) => {
Expand Down Expand Up @@ -79,18 +75,18 @@ export default function App() {
</div>
<DeckGL
ref={deckgl}
initialViewState={INITIAL_VIEW_STATE}
parameters={{
depthTest: false,
clearColor: [61 / 255, 20 / 255, 76 / 255, 1]
// blend: true,
// blendEquation: GL.FUNC_ADD,
// blendFunc: [GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA]
}}

viewState={viewState}
onViewStateChange={({viewState}) => {
setViewState(viewState);
}}
controller={true}

effects={[vignetteEffect, aaEffect]}
layers={layers}
{...adapter.getProps(deckgl, setReady, nextFrame)}
Expand Down
1 change: 0 additions & 1 deletion examples/camera/scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export async function sceneBuilder(animationLoop) {
easings: [easing.easeInOut]
})
};

const currentCamera = animationLoop.timeline.attachAnimation(keyframes.camera);

return new DeckScene({
Expand Down
1 change: 0 additions & 1 deletion modules/core/src/adapters/deck-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export default class DeckAdapter {

// Animating the camera is optional, but if a keyframe is defined then viewState is controlled by camera keyframe.
if (this.scene && this.scene.keyframes.camera && this.enabled) {

props.controller = false;
props.viewState = this._getViewState();
}
Expand Down
4 changes: 4 additions & 0 deletions modules/core/src/scene/deck-scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export default class DeckScene {
return Boolean(this._renderLayers);
}

hasLayers() {
return Boolean(this._renderLayers);
}

renderLayers() {
return this._renderLayers(this);
}
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2575,9 +2575,9 @@ bluebird@^3.5.1, bluebird@^3.5.3, bluebird@^3.5.5:
integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==

bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.4.0:
version "4.11.8"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f"
integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==
version "4.11.9"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.9.tgz#26d556829458f9d1e81fc48952493d0ba3507828"
integrity sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==

bn.js@^5.1.1:
version "5.1.1"
Expand Down Expand Up @@ -3881,9 +3881,9 @@ electron-to-chromium@^1.3.413:
integrity sha512-HMDYkANGhx6vfbqpOf/hc6hWEmiOipOHGDeRDeUb3HLD3XIWpvKQxFgWf0tgHcr3aNv6I/8VPecplqmQsXoZSw==

elliptic@^6.0.0, elliptic@^6.5.2:
version "6.5.2"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.2.tgz#05c5678d7173c049d8ca433552224a495d0e3762"
integrity sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==
version "6.5.3"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.3.tgz#cb59eb2efdaf73a0bd78ccd7015a62ad6e0f93d6"
integrity sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==
dependencies:
bn.js "^4.4.0"
brorand "^1.0.1"
Expand Down Expand Up @@ -6266,9 +6266,9 @@ lodash.uniq@^4.5.0:
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=

lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.3, lodash@^4.2.1:
version "4.17.15"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
version "4.17.19"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b"
integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==

log-driver@^1.2.7:
version "1.2.7"
Expand Down