SpuBatchRaycaster question

sandeep_slash
Posts: 48
Joined: Thu Jul 10, 2008 6:36 pm

SpuBatchRaycaster question

Post by sandeep_slash »

Hi,

I guess SpuBatchRaycaster is designed to return the closest hit point. If a ray collides with more than one object, how do I get info of all the hit points?

Thanks,
Sandeep.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: SpuBatchRaycaster question

Post by Erwin Coumans »

When you need all hit points, use the btCollisionWorld::rayTest instead.

Hope this helps,
Erwin
sandeep_slash
Posts: 48
Joined: Thu Jul 10, 2008 6:36 pm

Re: SpuBatchRaycaster question

Post by sandeep_slash »

Thanks Erwin.

I see that in case of SPUs (multi-threaded version), Bullet buffers/queues up all collision requests before performing actual collision. (For e.g. in SpuBatchRaycaster, there is addRay() func, which buffers all the rays before doing collision.)

I was wondering if I can do the same thing in PPU version for RayCasting?...

Is it possible to change SpuBatchRaycaster code, so that it collects all hitpoints rather than just the closest hit...?

Thanks in advance.
User avatar
John McCutchan
Posts: 133
Joined: Wed Jul 27, 2005 1:05 pm
Location: Berkeley, CA

Re: SpuBatchRaycaster question

Post by John McCutchan »

What could be done is to support an user defined buffer to store the hit results. That way you could get the closest 16, for example, hits. This is something we plan on supporting in the future.

John