aframe physics - 静态物体之间的碰撞
aframe physics - Collision between static bodies
我正在使用 aframe physics extra component 并尝试检测两个静态物体之间的碰撞。
这是我的代码笔 - https://codepen.io/nirajupadhyay11/pen/gQraNq
但是,我不确定为什么它不起作用。
这是代码 -
<script src="https://aframe.io/releases/0.8.2/aframe.min.js"></script>
<script src="https://unpkg.com/aframe-animation-component@^4.1.2/dist/aframe-animation-component.min.js"></script>
<script src="https://cdn.rawgit.com/donmccurdy/aframe-physics-system/v3.1.2/dist/aframe-physics-system.min.js"></script>
<script src="https://unpkg.com/aframe-physics-extras@0.1.2/dist/aframe-physics-extras.min.js"></script>
<a-scene physics="gravity: 0">
<a-entity id='ball' position="0 1 -3" material="color:green;" geometry="primitive:sphere; radius: 1;" static-body physics-collider="ignoreSleep: true" animation="property: position; dur: 1500; easing: linear; to: 5 1 -3; dir:alternate; easing: easeInSine; loop:true">
</a-entity>
<a-plane color='grey' static-body rotation="-90 0 0" width="100" height="100"></a-plane>
<a-entity id='ball2' position="3 1 -3" material="color:red;" geometry="primitive:sphere; radius: 1;" static-body physics-collider="ignoreSleep: true"></a-entity>
</a-scene>
有人可以帮忙吗?
我正在使用 aframe physics extra component 并尝试检测两个静态物体之间的碰撞。
这是我的代码笔 - https://codepen.io/nirajupadhyay11/pen/gQraNq
但是,我不确定为什么它不起作用。
这是代码 -
<script src="https://aframe.io/releases/0.8.2/aframe.min.js"></script>
<script src="https://unpkg.com/aframe-animation-component@^4.1.2/dist/aframe-animation-component.min.js"></script>
<script src="https://cdn.rawgit.com/donmccurdy/aframe-physics-system/v3.1.2/dist/aframe-physics-system.min.js"></script>
<script src="https://unpkg.com/aframe-physics-extras@0.1.2/dist/aframe-physics-extras.min.js"></script>
<a-scene physics="gravity: 0">
<a-entity id='ball' position="0 1 -3" material="color:green;" geometry="primitive:sphere; radius: 1;" static-body physics-collider="ignoreSleep: true" animation="property: position; dur: 1500; easing: linear; to: 5 1 -3; dir:alternate; easing: easeInSine; loop:true">
</a-entity>
<a-plane color='grey' static-body rotation="-90 0 0" width="100" height="100"></a-plane>
<a-entity id='ball2' position="3 1 -3" material="color:red;" geometry="primitive:sphere; radius: 1;" static-body physics-collider="ignoreSleep: true"></a-entity>
</a-scene>
有人可以帮忙吗?