【发布时间】:2017-06-16 13:16:44
【问题描述】:
我使用“A-Frame 物理系统”(https://github.com/donmccurdy/aframe-physics-system) 在 A-Frame 中创建了一个场景:
<!DOCTYPE>
<html>
<head>
<script src="aframe.min.js"></script>
<script src="aframe-extras.min.js"></script>
<script src="aframe-physics-system-master/dist/aframe-physics-system.min.js"></script>
</head>
<a-scene id="myscene" physics>
<!--CAMERA-->
<a-entity camera="userHeight: 1.6" look-controls></a-entity>
<!--BALL1-->
<a-sphere color="red" radius="0.3" position="5 5 5" dynamic-body></a-sphere>
<!--BALL2-->
<a-sphere color="green" radius="0.3" position="6 5 5" dynamic-body></a-sphere>
<!--GROUND-->
<a-plane id="ground" height="200" width="200" rotation="-90 0 0" position="0 0 0" metalness="0" roughness="1" static-body></a-plane>
</a-scene>
</body>
</html>
场景由两个球体和一个平面组成。我希望一个球在击中飞机时比其他球弹得更多。我从文档中了解到,我们可以使用以下方法更改整个场景的摩擦和恢复等属性:
<a-scene physics="friction: 0.1; restitution: 0.5">
<!-- ... -->
</a-scene>
但我想要不同领域的不同摩擦和恢复值。请让我知道是否可以在 A-Frame 中使用。提前致谢!
【问题讨论】:
标签: virtual-reality aframe cannon.js