This forum will be closing down. Please move to the respective dedicated project forums.
Search the Community
Showing results for tags 'pickwithray'.
Hi, when using var hitInfo = scene.pickWithRay(ray, null, true); I would expect that the ray only checks the boundingboxes and not the mesh. So if I import an "open package" where the ray can go through the object without collision, I want to check only if the ray hits the boundingbox, but this doesn't seem to work. Here is a playground: http://www.babylonjs-playground.com/#5PMLFP Thanks, Steffen
Hey everyone. I'm having a bit of trouble figuring out ray casting when the camera's parent is set to a mesh. I exhausted Google search and I'm hoping someone as some insight. Here's the scoop. I have a car that drives around a scene. I also have a FreeCamera that's parent is set to the car. The camera's position is set just above the car so you can see the front of it. (As if you placed a GoPro on the roof). I want the user to be able to rotate the camera in all directions to see around the car as it is driving (you can look out the back side as the vehicle drives forward). The rotation of the camera does not set the direction of the car. I am using scene.pickWithRay() with a reticle in the center of the camera. Everything works great when driving forward, until the car rotates it's direction. Then my ray is offset by that rotation. I'm not sure how to correct the offset when defining the ray. Here is how I'm currently defining the ray within my render loop... var ray = new BABYLON.Ray(camera.position.add(camera.parent.getAbsolutePosition()), camera.getTarget().subtract(camera.position).normalize()); Any ideas would be greatly appreciated. Thanks so much!
I have a character, a target (a box attached to a camera) and wall. For some reason, when Target is behind Wall, Character can still see the bloody Target! What's the correct way of using pickWithRay? Is there a way to visualize rays, e.g. draw a line?
Howdy, http://www.babylonjs-playground.com/#11DXRI This is the main problem from the other thread about moving with collisions. Ray casting just doesn't seem to work right as soon as the mesh is scaled (along the y axis?). This really seems like a bug to me ... or I am doing something horribly wrong here :-/ Can that be fixed somehow?