小编Nov*_*ida的帖子

Physijs对象穿过凹面网格

我遇到的一个问题似乎是众所周知的:我的“边界”对象不会与“地板”凹面网格碰撞。

我已经读过这个问题可能是由于在与模型一起缩放凹面网格时发生的错误引起的,因此我按需要导出了我的地板模型,并在应用了凹面网格后(如下所示),但是它不起作用。

我对此表示红色:https : //github.com/chandlerprall/Physijs/issues/102以及与此主题相关的许多其他信息(Physijs负载模型three.js冲突不起作用,并且类似),我编写了以下代码但无事可做:(

我真的不明白为什么“界限”贯穿整个地板。

这是我的代码:

Physijs.scripts.worker = './libs/chandlerprall-Physijs-7e3837b/physijs_worker.js';
Physijs.scripts.ammo = './examples/js/ammo.js';
var gravityVector = new THREE.Vector3( 0, -100, 0 );
//renderer
var renderer = new THREE.WebGLRenderer({antialias:true});
renderer.setClearColor(0xffffff, 0);
renderer.setSize( window.innerWidth, window.innerHeight );
//canvas
var canvas = renderer.domElement;
canvas.setAttribute("width",  window.innerWidth);
canvas.setAttribute("height",  window.innerHeight);
document.body.appendChild( canvas );
var perspectiveCamera = new THREE.PerspectiveCamera(45,window.innerWidth/window.innerHeight, 1, 200000);
//scene
var rttScene = new Physijs.Scene();

var bounding = new Physijs.SphereMesh(new THREE.SphereGeometry(100, 100, 100),
    Physijs.createMaterial(
        new THREE.MeshBasicMaterial({color: '#ff0000'}),
        1.0, // friction
        0.0 // …
Run Code Online (Sandbox Code Playgroud)

three.js physijs

5
推荐指数
0
解决办法
1051
查看次数

标签 统计

physijs ×1

three.js ×1