伪造查看器-BimWalk隐形传态 [英] Forge Viewer - BimWalk Teleportation

查看:88
本文介绍了伪造查看器-BimWalk隐形传态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在自己的伪造查看器功能中使用BimWalk扩展的隐形传送属性.但是,我找不到远程传送的实现细节.有什么方法可以在伪造查看器中传送到模型的特定对象?

I wanted to use teleportation property of BimWalk extension in my own function of forge viewer. But, I was not able to find the implementation details of teleportation. Is there any way for teleporting to specific object of the model in forge viewer?

推荐答案

最简单的方法是模仿鼠标交互以触发传送并设置

The simplest approach would be to mimic the mouse interaction to trigger teleporting and set the

// when in first person mode
const bimWalk = viewer.getExtension('Autodesk.BimWalk')
bimWalkExt.tool.navigator.teleporting = true
viewer.select(dbid)

或者,您可以通过直接调用BimWalk扩展程序的导航器工具来设置传送目的地,例如:

Alternatively you can set the destination of teleportation by calling the navigator tool of the BimWalk extension directly, something like:

  const navigator = bimWalkExt.tool.navigator
  const camera = viewer.navigation.getCamera()
  navigator.teleporting = true;
  navigator.teleportTime = 0;
  navigator.teleportInitial.copy(camera.position);

            // Set target position, collision plus camera's height.
            const cameraUp = getTempVector(camera.worldup);
            cameraUp.multiplyScalar(navigator.get('cameraDistanceFromFloor') * this.metersToModel);

            this.teleportTarget.copy(intersection.intersectPoint).add(cameraUp);

            // On floor teleport ends on the spot.
            this.teleportVelocity.set(0,0,0);

正如Eason先前向您建议的那样,由于没有可用的官方文档,因此您需要自己仔细阅读代码...

As Eason has suggested to you earlier there's no official documentation available so you'd need to look through the code yourself ...

这篇关于伪造查看器-BimWalk隐形传态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆