Page 1 of 1

Raycast

Posted: Fri Mar 12, 2010 9:09 pm
by Piers
Is there a way to ignore an object while raycasting? I want to raycast past my character controlled to check where the camera should be when there is a wall.

Re: Raycast

Posted: Fri Mar 12, 2010 9:23 pm
by Norbo
One way would be to use the multiple-hit version of the rayCast method that takes Lists as parameters instead of single out parameters. You could then examine each hit in sequence, ignoring the entities you don't want.

Re: Raycast

Posted: Fri Mar 12, 2010 9:39 pm
by Piers
Is there any other way that I could do it? That way adds alot of extra work, especially since I'm only trying to ignore one object.

Re: Raycast

Posted: Fri Mar 12, 2010 9:54 pm
by Norbo
Currently, no; if you're worried about performance, specifying a reasonable maximum ray length will prevent the ray hit lists from growing large.

In a future version (v0.12.0), the broadphase/collision detection/raycasting system is being significantly reworked. One of the goals will be to provide support for optional automatic filtering, using something like the CollisionRules system in place for collision testing.