光标与gltf模型房屋的内壁相交

时间:2017-11-10 11:26:11

标签: cursor physics aframe intersect gltf

光标/相机能够与我在搅拌机中构建的房屋的内墙相交(.gltf 2.0)

外边界工作完全正常,但光标/相机无法穿透。

这是我的代码 -

     <html>
          <head>
            <meta http-equiv="X-UA-Compatible" content="IE=edge">
            <meta http-equiv="content-type" content="text/html; charset=utf-8">
            <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no,user-scalable=no,maximum-scale=1">
         <script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script>
        <script src="https://unpkg.com/aframe-gltf-part-component/dist/aframe-gltf-part-component.min.js"></script>
         <script src="//cdn.rawgit.com/donmccurdy/aframe-extras/v3.12.4/dist/aframe-extras.min.js"></script>
<script src="https://unpkg.com/aframe-gltf-part-component/dist/aframe-gltf-part-component.min.js"></script>
    <script src="scripts/components/cursor.js"></script>
          </head>
          <body>
        <div id="myEmbeddedScene">
          <a-scene raycaster-autorefresh physics embedded="">
            <a-assets>
                  <a-asset-item id="ducks" src="../images/house.glb"></a-asset-item>
                  <a-mixin id="checkpoint"></a-mixin>
                  <a-mixin id="checkpoint-hovered" color="#6CEEB5"></a-mixin>
            </a-assets>

            <a-entity static-body id="duck" gltf-model-next="#ducks" position="0 0.1 -2" rotation="0 -90 0"></a-entity>

            <a-grid static-body></a-grid>

            <a-entity camera="userHeight: .6"
              universal-controls="movementControls: checkpoint, keyboard"
              checkpoint-controls="mode: animate"
              kinematic-body>
              <a-cursor
                  cursor="fuse: true;"
                  timeout="10"
                  position="0 0.1 -2.2"
                  geometry="primitive: ring; radiusInner: 0.02; radiusOuter: 0.03;"
                  material="color: #4CC3D9; shader: flat;">
              </a-cursor>
            </a-entity>

            <a-light type="ambient" color="#fff"></a-light>
          </a-scene>
        </div>
             </body>
        </html>

https://codepen.io/nirajupadhyay11/pen/ZaGWdN?editors=1111

0 个答案:

没有答案