drmcnellis / collisiondetectionkit

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

Need way to specify whether to include overlapping array #9

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When calling checkCollisions you are returned an object that contains an Array 
of Points where the 
objects are overlapping.

I suggest that we provide an api to make this optional:

checkCollisions(includeOverlapData:Boolean = true):Array

The main reason is performance. In a lot of cases, this data is not needed 
(just whether there is a 
collision). However, the overlapping array can contain a LOT of Point 
instances. In flash content 
where collisions are being detected among many items, frequently (maybe in 
onEnterFrame), this 
can lead to a LOT of Point objects being instantiated which may not be needed 
by the user. This can 
have a significant impact on performance.

Original issue reported on code.google.com by mikechambers on 21 Jun 2009 at 11:03

GoogleCodeExporter commented 9 years ago
I just did a quick test on this, and commented out the code that generates the 
points. In my case, where I have a 
lot of items, it gave me a 33% performance improvement.

Original comment by mikechambers on 21 Jun 2009 at 11:52

GoogleCodeExporter commented 9 years ago
Agreed.  The previous version of the CDK only returned the number of 
overlapping 
pixels (information I already had on hand without further computation), so when 
it 
was updated to include location having a condition for it wasn't considered.  
I'll 
put a flag in for it in the next release.

Original comment by lessthan...@gmail.com on 22 Jun 2009 at 7:43

GoogleCodeExporter commented 9 years ago
A Flag would be pretty much appreciated. Is there a rough Releasedate vor this 
fix?
I'm not sure If I can escape the nesseary lines by myself, so I will bett wait.

Original comment by indyaner...@gmail.com on 24 Oct 2009 at 4:29