You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use the collision utilities so that the camera will collide with some Box geometries that I have. I've successfully added the Boxes to the colliders list, but the trick is I don't really know how the collision is supposed to work. I figure that you'd probably want to overwrite THREE.Camera.prototype.translate. I took a look at some of the collision examples, but most of the stuff with rays and projection just went way over my head. I figured something like this would be a great example to include with the default package.
So, my question is: how can I overwrite the camera's translate method such that it will check for any blocks in the path of movement, and then prevent the camera from moving into a block in its path?
The text was updated successfully, but these errors were encountered:
I don't think you need to overwrite anything. You know in which direction the camera is going, right? Most likely: camera.target.position - camera.position. So using that vector you can throw a ray into the scene and check if it's colliding. I haven't used CollisionSystem yet thiough, I would use Ray myself.
I'm trying to use the collision utilities so that the camera will collide with some Box geometries that I have. I've successfully added the Boxes to the colliders list, but the trick is I don't really know how the collision is supposed to work. I figure that you'd probably want to overwrite
THREE.Camera.prototype.translate
. I took a look at some of the collision examples, but most of the stuff with rays and projection just went way over my head. I figured something like this would be a great example to include with the default package.So, my question is: how can I overwrite the camera's translate method such that it will check for any blocks in the path of movement, and then prevent the camera from moving into a block in its path?
The text was updated successfully, but these errors were encountered: