将物理特性与vps相结合

问题描述 投票:0回答:1

我是新来的,如果有人能提供帮助,我将非常感激。我试图在现实环境中运行物理角色,了解角色如何卡在房间的网格上而不是与房间环境连接。我如何让它连接到 vps 而不是其网格?

aframe 8thwall-xr
1个回答
0
投票
<!-- Copyright (c) 2022 8th Wall, Inc. -->
<!-- body.html is optional; elements will be added to your html body after app.js is loaded. -->
<div id="jumpZone">
  <button id="circularButton" class="circularButton">A</button>
</div>

<div id="joystickZone">
  <div id="joystickParent" class="joystick-parent">
    <div id="joystickOrigin" class="joystick-origin">
      <div id="joystickPosition" class="joystick-position"></div>
    </div>
  </div>
</div>
<a-scene 
landing-page
vps-coaching-overlay
xrextras-loading
xrextras-runtime-error
xrextras-gesture-detector
renderer="colorManagement: true"
physics="driver: ammo; debug: false; gravity: 0, -28, 0"
  gltf-model="dracoDecoderPath: https://cdn.8thwall.com/web/aframe/draco-decoder/"
xrweb="enableVps: true; allowedDevices: any">

  <a-assets>
    <!-- download the mesh from the geospatial browser and add it here -->
    <a-asset-item id="vps-mesh" src="./assets/6d3f6ede8fdb.glb"></a-asset-item>
    <a-asset-item id="character-model" src="./assets/character-model.glb"></a-asset-item>
    <!-- if you have a prebaked animation that interacts with the mesh, add it here -->
    <a-asset-item id="vps-anim" src=""></a-asset-item>
  </a-assets>

   <a-camera id="camera" position="0 14 14"></a-camera>

  <!-- add a wayspot to the project from the geospatial browser
  and replace the name with the 'name' of the wayspot -->
  <a-entity named-wayspot="name: 6d3f6ede8fdb">
    <!-- apply hider material to the mesh to realistically occlude content -->
    <a-entity gltf-model="#vps-mesh" hider-material></a-entity>
    <!-- apply shadow shader to the mesh to realistically receive shadows -->
    <a-entity gltf-model="#vps-mesh" shadow-shader shadow="cast: false"></a-entity>
    <!-- add content here; either prebaked or realtime animations -->
    <!-- play-vps-animation waits for successful localization to begin the animation -->
    <a-entity gltf-model="#vps-anim" play-vps-animation shadow="receive: false"></a-entity>
  </a-entity>

  <!-- lights -->
  <a-entity
    light="
      type: directional;
      intensity: 0.8;
      castShadow: true;
      shadowMapHeight:2048;
      shadowMapWidth:2048;
      shadowCameraTop: 10;
      shadowCameraBottom: -10;
      shadowCameraRight: 10;
      shadowCameraLeft: -10;"
    position="0 10 -6"
    shadow>
  </a-entity>
  <a-light type="ambient" intensity="0.5"></a-light>
  <a-cylinder
    id="character"
    joystick-controller
    jump-controller
    position="0 5 0"
    height="2"
    material="transparent: true; opacity: 0; depthTest: false"
    ammo-body="type: dynamic; mass: 100; angularFactor: 0 0 0"
    ammo-shape="type: capsule">
    <!-- aniamted character -->
    <a-entity
      id="characterModel"
      gltf-model="#character-model"
      position="0 0 0"
      scale=".5 .5 .5"
      no-cull
      shadow></a-entity>
     
    <!-- raycaster -->
    
     
  </a-cylinder>
    <a-entity class="ground" gltf-model="#vps-mesh" scale="1 1 1" physics-object shadow></a-entity>
</a-scene>
© www.soinside.com 2019 - 2024. All rights reserved.