Preventing camera from going 'through' aframe object

后端 未结 2 1999
轮回少年
轮回少年 2021-01-07 01:57

Lets say I have a cylinder model that I load into my webvr scene. How can I make the object solid? I.e. the user (camera view) cannot take any position within the object or

2条回答
  •  臣服心动
    2021-01-07 02:05

    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.

    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.

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

提交回复
热议问题