|
@@ -79,9 +79,6 @@ interface Canvas3D {
|
|
readonly stats: RendererStats
|
|
readonly stats: RendererStats
|
|
readonly interaction: Canvas3dInteractionHelper['events']
|
|
readonly interaction: Canvas3dInteractionHelper['events']
|
|
|
|
|
|
- // TODO: is this a good solution?
|
|
|
|
- setSceneAnimating(animating: boolean): void
|
|
|
|
-
|
|
|
|
dispose: () => void
|
|
dispose: () => void
|
|
}
|
|
}
|
|
|
|
|
|
@@ -137,8 +134,6 @@ namespace Canvas3D {
|
|
const debugHelper = new BoundingSphereHelper(webgl, scene, p.debug);
|
|
const debugHelper = new BoundingSphereHelper(webgl, scene, p.debug);
|
|
const interactionHelper = new Canvas3dInteractionHelper(identify, getLoci, input);
|
|
const interactionHelper = new Canvas3dInteractionHelper(identify, getLoci, input);
|
|
|
|
|
|
- let isSceneAnimating = false
|
|
|
|
-
|
|
|
|
function getLoci(pickingId: PickingId) {
|
|
function getLoci(pickingId: PickingId) {
|
|
let loci: Loci = EmptyLoci
|
|
let loci: Loci = EmptyLoci
|
|
let repr: Representation.Any = Representation.Empty
|
|
let repr: Representation.Any = Representation.Empty
|
|
@@ -153,13 +148,13 @@ namespace Canvas3D {
|
|
return { loci, repr }
|
|
return { loci, repr }
|
|
}
|
|
}
|
|
|
|
|
|
- function mark(loci: Representation.Loci, action: MarkerAction) {
|
|
|
|
- const repr = loci.repr
|
|
|
|
|
|
+ function mark(reprLoci: Representation.Loci, action: MarkerAction) {
|
|
|
|
+ const { repr, loci } = reprLoci
|
|
let changed = false
|
|
let changed = false
|
|
if (repr) {
|
|
if (repr) {
|
|
- changed = repr.mark(loci.loci, action)
|
|
|
|
|
|
+ changed = repr.mark(loci, action)
|
|
} else {
|
|
} else {
|
|
- reprRenderObjects.forEach((_, _repr) => { changed = _repr.mark(loci.loci, action) || changed })
|
|
|
|
|
|
+ reprRenderObjects.forEach((_, _repr) => { changed = _repr.mark(loci, action) || changed })
|
|
}
|
|
}
|
|
if (changed) {
|
|
if (changed) {
|
|
scene.update(void 0, true)
|
|
scene.update(void 0, true)
|
|
@@ -263,7 +258,7 @@ namespace Canvas3D {
|
|
currentTime = now();
|
|
currentTime = now();
|
|
camera.transition.tick(currentTime);
|
|
camera.transition.tick(currentTime);
|
|
draw(false);
|
|
draw(false);
|
|
- if (!camera.transition.inTransition && !isSceneAnimating) interactionHelper.tick(currentTime);
|
|
|
|
|
|
+ if (!camera.transition.inTransition) interactionHelper.tick(currentTime);
|
|
window.requestAnimationFrame(animate)
|
|
window.requestAnimationFrame(animate)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -436,9 +431,6 @@ namespace Canvas3D {
|
|
get interaction() {
|
|
get interaction() {
|
|
return interactionHelper.events
|
|
return interactionHelper.events
|
|
},
|
|
},
|
|
- setSceneAnimating(animating) {
|
|
|
|
- isSceneAnimating = animating;
|
|
|
|
- },
|
|
|
|
dispose: () => {
|
|
dispose: () => {
|
|
scene.clear()
|
|
scene.clear()
|
|
debugHelper.clear()
|
|
debugHelper.clear()
|