Pick with limited range?

Well I currently have a bullet class that checks if it hits a player with a Triangelpick and if not moves forward a little.

However suing a mass of them kinda creates overhead, so the main question is, is there a usefull way to reduce the needed processing power? sine usually i only need to check like 1 metre and not the whole map for a collision(and usually in the lifetime of a bullet it only hits one object, so except 1 tick there are no collisions).

hi,



instead of picking you could use a long cylinder ( e.g. 1 meter), move it forward  and check if its bounding has a collision. But you'll always have to check everything on a map (this is where the bounding tree / scenegraph comes into play)



Picking is always infinite. (Thats the nature of a ray cast)



Regards,

snare




So there is no way to  this?  Also does this stuff automatically take into account that if it does not hid a node it won't hit the children? cause then it's kinda easy to optimize

When the data-structure of your level is a BSP or octree it would be possible to write an efficient ray-check for limited rays.


Empire Phoenix said:

So there is no way to  this?  Also does this stuff automatically take into account that if it does not hid a node it won't hit the children? cause then it's kinda easy to optimize

Bouding-volumes are hierarchical, so it is a good optimization.

Just use regular pick and don't perform any actions unless the distance is short…