Я пытаюсь использовать a-frame с системой физики a-frame. Тем не менее, он никогда не работал в моей среде (Mac OS 10.13, chrome, сервер node.js Express).
- Он читает файл сценария (cdn.rawgit.com/donmccurdy/aframe-physics-system/v3.2.0/dist/aframe-physics-system.js). Однако, когда я добавляю свойство «dynamic-body» или «static-body», я получаю сообщение об ошибке.
- Я пытался запустить этот код в других браузерах и на других хостах сервера, но результат тот же.
Ниже приведен код:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hello world!</title>
<meta name="description" content="Hello world!">
<script src="https://aframe.io/releases/0.3.2/aframe.min.js"></script>
<script src="//cdn.rawgit.com/donmccurdy/aframe-physics-system/v3.2.0/dist/aframe-physics-system.js"></script>
</head>
<body>
<a-scene physics="debug: true">
<a-entity position="0 0 0">
<a-plane color="green" static-body height="3" width="3" rotation="-90 0 0" position="0 0 -5"></a-plane>
<a-box color="red" dynamic-body position="0 5 -5"></a-box>
</a-entity>
</a-scene>
</body>
</html>
И ниже приведена ошибка, которую я получаю.
aframe-physics-system.js:5508 Uncaught TypeError: Cannot read property 'x' of undefined
at Vec3.copy (aframe-physics-system.js:5508)
at s.Body.syncToPhysics (aframe-physics-system.js:15876)
at s._play (aframe-physics-system.js:15729)
at s.initBody (aframe-physics-system.js:15670)
at Object.module.exports.fireEvent (index.js:28)
at a-node.js:208
at Array.map (<anonymous>)
at HTMLElement.value (a-node.js:207)
at a-node.js:104