Raycasting...

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Fax3D
Posts: 22
Joined: Mon Sep 29, 2008 7:42 am

Raycasting...

Post by Fax3D »

Hi all,

I've a question regarding (Space).rayCast... imagine to have 5 cube aligned along X axis (or Z or Y it doesn't matter!). They are part of one compoundbody. When i perform a ray cast, if the ray transfix all five cubes (or in another words, all the lenght of the compound body) i receive only one hitEntities (the first cube) and not all the five. I imagine this is due to the fact in reality there's only one compoundbody... it's true? There's a way to receive all 5 entities?

Thanks for helps!

Fax3D
User avatar
Zukarakox
Not a Site Admin
Posts: 426
Joined: Mon Jul 10, 2006 4:28 am

Re: Raycasting...

Post by Zukarakox »

I believe you will only get 1 return from compound bodies, but which override for Space.raycast are you using? The one with multiple Lists for entities, hits, normals, and times is the only ray function that returns multiple hits.
i has multiple toes
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Raycasting...

Post by Norbo »

This is another weakness of the current raycasting system that I'd like to address. The interfaces for space-wide raycasting require only that entities return a single hit since most entities are not compound. However, you can use the compound body's specialized rayTest method to determine more details.
Fax3D
Posts: 22
Joined: Mon Sep 29, 2008 7:42 am

Re: Raycasting...

Post by Fax3D »

Ok thank you guys, i try with the compound body's specialized rayTest method.

Fax3D
Post Reply