kd-tree and sph

Paul Harris paulharris at computer.org
Mon Mar 10 09:44:03 UTC 2008


On 10/03/2008, Mickael POUCHOL <mickael.pouchol at xlim.fr> wrote:
>
> Hi,
>
> I'm using libkdtree++ for 2D SPH simulation for nearest neighbour
> search. The structure stored in the kd-tree is :
>
>
> struct ParticlePtr {
>   typedef float value_type;
>
>   inline value_type operator[](size_t const N) const { return
> ptr->position[N]; }
>   // The position if of type vec2f
>   Particle *ptr;
> };
>
> For each particle in the simulation, I use the tree to get its
> neighbours with a call to : t.find_within_range(current_particle, RANGE,
> std::back_inserter(v));
> Sometimes I would like to query the tree with a vec2f value and not with
> a ParticlePtr. Is there a way to do that?



I'm not sure if you can do it with the current KD-Tree.  I have some pending
changes to commit to the tree that opens up the templates a bit more and
makes it possible.


Secondly I would like to use another kd-tree to store segments (or
> triangles in 3D) and query it with a ray in the collision detection
> phase. I didn't not understand how to define such a kd-tree with the lib.


I don't know how you would do this either


see ya
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.alioth.debian.org/pipermail/libkdtree-devel/attachments/20080310/54f48ba5/attachment.htm 


More information about the libkdtree-devel mailing list