IrinaTheNerd / collisiondetectionkit

Automatically exported from code.google.com/p/collisiondetectionkit
0 stars 0 forks source link

Need way to define a 'Region of Interest' within which collissions are checked for #12

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. In code, populate a container sprite with object from x = -5000 to 5000
2. Add these ojects to the collisionList.
3. Query collisions every frame

What is the expected output? What do you see instead?
Starts at 30fps. Goes down to 10fps when colliding. Maybe because 
stage.width is so large. I move this container across the stage, so I only 
care about objects I can see, aka stage.stageWidth. So would be great if I 
could define a 'Region of Interest' rectangle (= to the stage, or actually 
even smaller) so that collision detection is only done in that area.

What version of the product are you using? On what operating system?
1.5, Flash CS4, XP Pro.

Please provide any additional information below.
Maybe there is another reason for slow performance. I tried the following 
variables (glow means alpha at edges. solid means non alpha'ed jpg):
/* Speed tests (With panning background 7708x2056 unless otherwisw stated):
// With single half XGA,   Reticule.alpha = 0.5,    placeholder glow,  
goes down to 11fps at max intersection.
// With single XGA screen, Reticule.alpha = 0.5,    placeholder glow,  
goes down to 10fps at max intersection. Even if 'add' drills down to 
hotspots[] -> placeholder -> loader
// With single XGA screen, Reticule.alpha = 0.5,    placeholder glow,  
goes down to 11fps at max intersection. With panning background only 
2048x1536
// With single XGA screen, Reticule.alpha = 0.5,    placeholder glow,  
goes down to 10fps at max intersection. 
// With single XGA screen, Reticule.alpha = 1,      placeholder glow,  
goes down to 11fps at max intersection.
// With single XGA screen, Reticule.alpha = 1,      placeholder solid, 
goes down to 11fps at max intersection.
// With single XGA screen, Reticule solid square,   placeholder solid, 
goes down to  8fps at max intersection.
// With single XGA screen, Reticule stroke circle,  placeholder solid, 
goes down to 13fps at max intersection.
// With single XGA screen, Reticule 4 sml squares,  placeholder solid, 
goes down to 13fps at max intersection.
// With single XGA screen, Reticule 4 pixels,       placeholder solid, 
goes down to 14fps at max intersection.
// With single XGA screen, Reticule 3 pixels,       placeholder solid, 
goes down to 14fps at max intersection.
// With single XGA screen, Reticule 2 pixels,       placeholder solid, 
goes down to 30fps at max intersection.
// With single XGA screen, Reticule 1 pixels,       placeholder solid, 
goes down to 30fps at max intersection.
// With single XGA screen, Reticule plchldr solid,  placeholder solid, 
goes down to  3fps at same intersection.
// With single XGA screen, Reticule ph solid jpg,   ph solid jpg,      
goes down to  3fps at same intersection.
// Traces make no difference.
*/

Original issue reported on code.google.com by effortle...@gmail.com on 1 Jul 2009 at 11:32

GoogleCodeExporter commented 8 years ago
Sorry, I didn't mean to classify it as a defect.

Original comment by effortle...@gmail.com on 1 Jul 2009 at 11:33

GoogleCodeExporter commented 8 years ago
I don't see how people are getting good performance from this. I would find it 
very 
valuable if there was a wiki page outlining performance: expected, and how to 
get 
better performance. Thanks.

Original comment by effortle...@gmail.com on 1 Jul 2009 at 11:36