Page 1 of 1

Raycasting...

Posted: Wed May 20, 2009 2:28 pm
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

Re: Raycasting...

Posted: Wed May 20, 2009 7:59 pm
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.

Re: Raycasting...

Posted: Wed May 20, 2009 9:29 pm
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.

Re: Raycasting...

Posted: Thu May 21, 2009 10:23 am
by Fax3D
Ok thank you guys, i try with the compound body's specialized rayTest method.

Fax3D