Forge Viewer - BimWalk 传送 [英] Forge Viewer - BimWalk Teleportation

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

问题描述

我想在我自己的伪造查看器功能中使用 BimWalk 扩展的传送属性.但是,我找不到传送的实现细节.有没有办法在forge viewer中传送到模型的特定对象?

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 ...

这篇关于Forge Viewer - BimWalk 传送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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