问题标签 [physijs]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
29 浏览

javascript - PhysiJS 到 ThreeJS 项目导致“没有'new'就不能调用类构造器场景”

我仍在尝试将 PhysiJS 实施到我的 ThreeJS 项目中。

为了简化,我从网上下载了这个项目:https ://rawgit.com/mmmovania/Physijs_Tutorials/master/MultipleBoxes.html

我的项目设置可在此处获得:https ://drive.google.com/drive/u/0/folders/13et7wh72067X3umVGWQSw43k-_MW6bPT 盒子模拟是来自网络的示例。 习惯世界是我的习惯。

当我运行场景 = new THREE.Scene; 在我的 init()函数中它工作得很好,但是当我做scene = new Physijs.Scene; 我收到错误消息。

我遵循了本教程,非常直接,我使用了“新”这个词。我没有收到盒子模拟中的错误,那么自定义世界中发生了什么?很高兴收到所有回复 :) 教程:https ://www.youtube.com/watch?v=ARXYPRCNB14

0 投票
0 回答
41 浏览

javascript - 未捕获的类型错误:没有“新”行无法调用类构造函数场景:文件:///storage/emulated/0/threejs/libs/physi.js 的 391

我一直在将 Physijs 与旧版本的three.js 一起使用,它运行良好但是当我下载最新版本的threejs 时,它甚至无法在场景中放置平面网格

它带来了这个错误 Uncaught TypeError: Class constructor Scene cannot be invoked without 'new' line:391 of:file:///storage /emulated/0/threejs /learning-threejs/libs/physi .js

我不明白为什么这是我的代码

提前致谢