0

As I understood the only method to compute collisions with three.js is intersectObjects with a ray ...

I created an object that includes the basic elements of the collision : ground, walls, objects, stairs. with the firstpersoncontrols. I went with the idea that I should calculate the steering vector based on the direction in which the camera is currently traveling but it does not really work and I do not see where the error is.

I expected that the camera can not pass through ground, walls and objects with which she finds herself in a collision.

You can see the code here

4

1 回答 1

2

three.js 没有自动碰撞检测。

您现在实现光线投射Raycaster,而不是Ray

Raycaster.intersectObjects( objects, recursive );

您还必须自己控制相机的高度。

三.js r.54

于 2013-01-12T23:27:08.450 回答