Back to the Shapespark home page

Going through walls

So I’m sure everyone has bumped into the dreaded moment of going from one quick access to the next and going through walls.

I understand that creating a flight path from way point to way point is not part of this solution, however, is there a way to fade the camera to darkness when hitting a collider? If we can’t avoid it, at least lets prevent users from having to see the insides of our geometry.

Any help?

1 Like

Unfortunately, the fading the camera to darkness is not possible.

What you could experiment with is detecting a view switch using the onViewSwitchStarted API function, and re-routing the camera path programmatically through some intermediate views using the switchToView API function.

1 Like

I fould this script on the view-switch example:

document.getElementById('custom-view').addEventListener('click', function() {
    var view = new WALK.View();
    view.position.x = 0.956;
    view.position.y = -2.922;
    view.position.z = 1.546;
    view.rotation.yawDeg = 121.59;
    view.rotation.pitchDeg = -44.78;

It sounds like I would probably need to create a sequence of these views in order to create a path… or even create invisible views that I could jump to in order to minimize going through walls, although I anticipate scenarios where it’s still be inevitable.

1 Like

Yes, that’s the best what I can think of at the moment. To chain the intermediate views you could use a onViewSwitchDone listener.

If your scene has one level, you could perhaps use a single intermediate orbit/floorplan view . Then switching from view A to B would be re-routed through the orbit/floorplan view (as a side effect the visitor would be able to refer the source and target points to the interior layout).

1 Like