physicsRay

Hi



I am working to launch thousands of lightning PhysicsRay, but they fill the RAM memory, the rays are created con:



HashMap<String, PhysicsRay> rayoPhys = new HashMap<String, PhysicsRay>(1000000);

for(int mm=0; mm<1000000; mm++{

  ray2 = getPhysicsSpace (). CreateStaticNode (). CreateRay ( "r2" + mm);

  rayoPhys.put(("r2," + mm).toString(), ray2);

}



then removed with:



for(int mm=0; mm<1000000; mm++{

  rayoPhys.get(("r2,"+mm).toString()).getPhysicsNode().delete();

}



Thanks


excuse



then removed with:



for(int mm=0; mm<1000000; mm++{

  rayoPhys.get(("r2,"+mm).toString()).getPhysicsNode().delete();

  rayoPhys.remove(("r2,"+mm).toString());

}

what do you want to do with the physics rays, why so many?

A ray-Tracing for Multipath Propagation in Urban Environments, this is already running , but la RAM memory 2G is full with 3 million of ray, What do you recommend?

Use simple Rays not physic Rays, in your code you also create new StaticNodes i guess thats not needed.

Create a pool of rays and re-use them.

all right, but ray not implemented getContactPosition().



I need this information.



Who do I Apply getContactPosition() with ray?



or



Who do I optimize the RAM memory with PhysicsRay?



This is important for me.  Thanks.

I haven't used it much yet, maybe jmetest.intersection.TestTrianglePick can give you some ideas.

okey, and other option, I can clean the PhysicsRay in the RAM memory?.