Raycast

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Piers
Posts: 8
Joined: Tue Sep 16, 2008 9:53 pm

Raycast

Post 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.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Raycast

Post 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.
Piers
Posts: 8
Joined: Tue Sep 16, 2008 9:53 pm

Re: Raycast

Post 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.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Raycast

Post 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.
Post Reply