Anyone could tell me why Ray doesnt hit the plane?

Blackbeard

27-03-2007 16:45:42

I used TreeCollision to create a body.
Its a scenenode with a plane attached. Position 0,0,0
Now i wonder what could be wrong.

start =Camera.Position;// at 0, 200, -200
end = new Vector3(110, -20, -90);

BasicRay does not hit the plane.

start =Camera.Position;// at 0, 200, -200
end = new Vector3(109, -20, -90);

BasicRay hits the plane.

Same if you change start position:

start = new Vector3(0, 200, -300);
end = new Vector3(109, -20, -90);

Does not hit the plane.

start = new Vector3(0, 200, -200);
end = new Vector3(109, -20, -90);

Hit the plane.

But why?

BasicRaycast nray = new BasicRaycast(Program.form.NWorld,start,end);

walaber

27-03-2007 17:39:59

TreeCollision won't work with a single plane, you need some "depth" to the model for it to work, IIRC.

Blackbeard

27-03-2007 19:04:24

Thank you, i will try a box to see what happens.