Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line Collision #244

Open
mjkaufer opened this issue Sep 25, 2015 · 1 comment
Open

Line Collision #244

mjkaufer opened this issue Sep 25, 2015 · 1 comment

Comments

@mjkaufer
Copy link

Is it possible to add collision events between Three.JS lines and other objects? I don't see a specific reference to this in the documentations, so is there perhaps a straightforwards way?

I am considering making a cylinder between my two points and having collisions for the cylinder, but the points - and thus the line - are moving consistently, so relocating the cylinder would be a hassle.

@ghost
Copy link

ghost commented Feb 24, 2016

@mjkaufer you can just go with raycasting. The THREE.Raycaster object has features for detecting collision with lines. It even has .linePrecision factor to control how precise the intersection detection should be. More on the documentation. As for collision response, I think you should just place a Physijs.SphereMesh wherever the collision between the cylinder and the line occured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant