且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

防止相机“通过"aframe 对象

更新时间:2023-12-02 09:59:22

这取决于您计划支持哪些设备,以及您如何允许用户导航你的场景.对于大多数 VR 体验,请遵循***实践,并且仅根据用户的动作按比例移动相机.如果用户步在房间尺度空间中前进并且相机被阻挡",这是一个非常糟糕的经验.对于大多数 VR 应用程序,***使用传送,设计您的场景以避开障碍物,或探索更多创意在世界范围内移动用户的方式.

This depends on what devices you plan to support, and how you allow users to navigate your scene. For most VR experiences, follow best practices and only move the camera proportionately to the user's motion. If the user steps forward in roomscale space and the camera is "blocked," this is a very bad experience. For most VR applications it's better to do locomotion with teleportation, design your scene to keep obstacles out of the way, or explore more creative ways of moving users through the world.

用于带有游戏手柄或 WASD 控件的非 VR 桌面体验,或用于 VR 场景如果相机在车内,您可以添加一个物理引擎防止通过障碍物移动.

For non-VR desktop experiences with a gamepad or WASD controls, or for VR scenes where the camera is inside a vehicle, you can add a physics engine to prevent movement through obstacles.

^我会尽快将其添加到 A-Frame 常见问题解答或文档中.这已添加到 A-Frame 常见问题.这是一个使用检查点的示例和一个使用物理引擎的示例.

^I'll try to get this added to the A-Frame FAQ or documentation soon. This has been added to the A-Frame FAQ. Here's an example using checkpoints, and an example using a physics engine.