drmcnellis / collisiondetectionkit Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/collisiondetectionkit
Automatically exported from code.google.com/p/collisiondetectionkit
What steps will reproduce the problem?
1. Copy CDK example on excludeColor
2. Compile
3. Test
What is the expected output? What do you see instead?
Expected: Red color is excluded.
Actual: Red color is not excluded (i.e. collided)
What version of the product are you using? On what operating system?
v1.5
Please provide any additional information below.
Do this has something to do with using 0xFF as base of color on detecting
collision?
Original issue reported on code.google.com by [email protected]
on 18 May 2012 at 2:54
i used the code for the terrain collision.
i use one large object for as the terrain.
The game starts ok, but after few seconds begin to slow down dramatically.
i use the 1.5 version on windows xp
system is P4 at 2,8 ghz.
Could be something related to the creation of the objects?
Maybe something must be clear or erased in the render loop?
Don't know.
Please, continue with the development of your code: is really great!!!
Thank you very much.
Best regards
Davide
Original issue reported on code.google.com by [email protected]
on 21 Dec 2009 at 11:28
When calling checkCollisions, you are giving an untyped argument with two
properties:
object1
object2
There is currently no way to know which object was the target passed to
CollisionList. In fact, it
seems to be random, and can sometimes be object1 or object2.
I suggest that we rename these to something like:
target
collisionItem
and ensure that target always contains the target.
This will make it clearer and easier to use, as well as improve performance
(since the developer
will not have to check which one is the target).
Original issue reported on code.google.com by mikechambers
on 21 Jun 2009 at 10:59
What steps will reproduce the problem?
I have a small game that is composed of :
1. first frame :preloader
2. second frame : a "var game:Game = new Game();
this.addChild(game);" code.
And a game.as Class which extends Sprite. Inside the Class, I have a
collisionGroup instance that should detect simple interaction.
What is the expected output? What do you see instead?
Once I want to add a sprite to the "collisionGroup", I get the following
error :
"Error: Cannot add item: [object HitMV] - Items added for collision
detection must be on the display list.
at coreyoneil.collision::CDK/addItem()
at Game()
at banner_fla::MainTimeline/frame2()
"
Basically, the "root" for my object is Null, instead of Main_Timeline.
What should I do ?
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 15 Mar 2009 at 1:14
It would be nice to prevent the return of collisions between the same
object types.
Example:
Right now I'm designing a basic shootemup game in flash. I'm checking for
collisions between bullets and enemies. Since some of these enemies can
over lap, they are being returned as a collision. Also, there may be times
when bullets overlap. I would like to prevent checkCollisions from
returning these cases.
I would think this could just be done with a property; then a simple if
statement to compare the two objects before we actually collision test them.
I'm looking to see if I can implement this myself, but perhaps others would
like this as well?
Original issue reported on code.google.com by [email protected]
on 27 Nov 2009 at 3:56
Hi, i created a few Movieclips that i added to the collisionList as items, the
collisions are fired well, but when i put an item behind another item, and i
click on the backward element through the forward one, the event of Mouse Down
is not being added, Thank You.
Original issue reported on code.google.com by [email protected]
on 18 Mar 2015 at 4:09
What steps will reproduce the problem?
1. I have an animated character on my screen. He is composed of 2 pieces,
head and body. When I create my collision list I am creating it using the
characters head (characer.head as target, where .head returns the "head_mc"
child of the character), but it's not showing collisions.
2. When I use a target of character.body or character.body_mc I do see my
collisions.
3. When I create a movie clip that I put over the character's head and set
that as the target I also see my collisions.
What is the expected output? What do you see instead?
I'm expecting to see collisions when I am over the head, instead I see nothing.
What version of the product are you using? On what operating system?
Not sure about the version. I downloaded it about a month ago, so I'm
assuming it's the latest.
Please provide any additional information below.
I'm thinking the issue was because my head movieclip was made up of
graphics, but that doesn't seem right as the body movieclip is as well and
it's detecting collisions just fine. I really just want to know why this is
happening!
Original issue reported on code.google.com by [email protected]
on 11 Mar 2009 at 1:24
What steps will reproduce the problem?
1. Create Canvas1.
2. Create Canvas2 (alpha=0) and put it on Canvas1.
3. Create Canvas3 (alpha=0) and put it on Canvas2.
4. Create Sprite1 and put it on Canvas3.(Canvas3.rowChildren.addChild(Sprite1))
5. Create Canvas4 (alpha=0) and put it on Canvas1.
6. Create Canvas5 (alpha=0) and put it on Canvas4.
7. Create Sprite2 and put it on Canvas5.(Canvas5.rowChildren.addChild(Sprite2))
8. Scale up Canvas5.
9. Change Canvas4's size/position properties to make it fit a new Canvas5's
size.
10. Move Canvas4 until it overlaps Canvas2.
11. collisionGroup.addItem(Sprite1); collisionGroup.addItem(Sprite2);
12. var collisions:Array = collisionGroup.checkCollisions();
13. collisions.length == 0
What is the expected output? What do you see instead?
expected: collisions.length > 0
see: collisions.length == 0
What version of the product are you using? On what operating system?
CDK 1.5.0 , MS Windows Server 2003, Flex 3 (SDK 3.5.0)
Please provide any additional information below.
Scaling down and rotation seems to work perfect. Skewing fails the same way as
scaling up.
Original issue reported on code.google.com by [email protected]
on 18 Aug 2011 at 1:13
What steps will reproduce the problem?
1. lets say you have a wall graphic
2. create a shape to match the wall
3. have a display object as your target
What is the expected output? What do you see instead?
Should report collision when targets enters/hit the wall-shape
What version of the product are you using? On what operating system?
Mac OS 10, flash CS4
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 16 Nov 2010 at 10:17
What steps will reproduce the problem?
1. Put any of your test codes inside a package (CollisionList or
CollisionGroup)
and i get:
TypeError: Error #1006: checkCollisions is not a function.
at Main/checkForCollision()
2.
If i declare the public var collisionGroup=new Array(); as public var
collisionGroup:*;
I get:
TypeError: Error #1010: A term is undefined and has no properties.
at Main/checkForCollision()
so iam thinking that =new Array(); is correctly defined..or is it?
3.
Code is attached hope you can help, iam hoping its me missing something
small,
BTW I did get it to work fine in timeline, and it's fantastic, used it in
conjuction with FlintParticles and it detected each Pixel... NICE Hope i
get it to work inside the package shortly...
What am i missing here? If anything maybe you can supply a test file
thats already in a package...
Original issue reported on code.google.com by [email protected]
on 20 Mar 2009 at 6:20
Attachments:
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
What steps will reproduce the problem?
1. I have a movieclip inside a movie clip (car1.hitarea) that is being checked
for collision with another moviclip inside another movie clip again
(car2.hitarea).
2. When the main car is on reverse, in a specific angle range, it overlaps car1
and the actual hit appears at the middle of the object..
What is the expected output? What do you see instead?
I would expect to have a hit event when they first touch.. Instead they wait to
reach the middle to react!
What version of the product are you using? On what operating system?
CDK 1.5, Flash CS5
Please provide any additional information below.
Is the problem because I am checking for collisions inside diffent nested movie
clips?
Any ideaS???
Original issue reported on code.google.com by [email protected]
on 13 Nov 2011 at 8:37
hello first of all great job with collision kit i love i really do.
but i ran in some problems i cant figure out what objects collide.
i trying to know when a collision happens and with what MovieClips. so the
collided MovieClips will do something.
basically how do know when a collision happens and what get collided.
thanks u
Original issue reported on code.google.com by [email protected]
on 9 May 2009 at 12:50
Couple of suggestions for the array returned from checkCollisions.
Right now, when you call checkCollisions() you get an Array of objects returned
to you for each
collision.
These objects should be Strongly typed. This will be faster for the player, and
will make it easier
to work with.
Maybe something like:
public class Collision
{
public var targetObject:DisplayObject; // the target
public var collisionObject; //the item the target is colliding with
public var overlapping:Array; (over Vector.<Point>;
}
Original issue reported on code.google.com by mikechambers
on 21 Jun 2009 at 10:56
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 [email protected]
on 1 Jul 2009 at 11:32
Its probably a good idea to call BitmapData.dispose() on BitmapData instances
we the code is done
with them, to ensure that the memory for them is reclaimed.
Original issue reported on code.google.com by mikechambers
on 22 Jun 2009 at 6:12
What steps will reproduce the problem?
1. Put your display objects in a container object.
2. Increase the scale (or size) of the container object.
3. Do collision detection on the objects in the container.
What is the expected output? What do you see instead?
The expected output is to see that the collision detection adapts to the
rescaled sizes. Instead the collision works only on the checked objects
original sizes, before rescaling.
What version of the product are you using? On what operating system?
Please provide any additional information below.
attaching a sample file that shows how this behavior occurs. Grab any
circle in the sample to rescale the container. Make them collide and
observe that as they grow collision is not detected in the outer parts of
the circle.
Original issue reported on code.google.com by [email protected]
on 31 Mar 2009 at 12:30
Attachments:
This is related to:
http://code.google.com/p/collisiondetectionkit/issues/detail?id=9
checkCollisions should include an option to not look up collision angles. The
code in findAngle can
be processor intensive, and this would provide a way to not take the CPU hit
when the angle data is
not needed.
checkCollisions(includeAngle:Boolean = true):Array
Original issue reported on code.google.com by mikechambers
on 22 Jun 2009 at 12:04
What steps will reproduce the problem?
1. Create DisplayObject with height != width, call it Object1
2. Add child (Object2) to Object1
3. Rotate (change transform matrix) Object1 to 90 degree
4. Add Object2 as target to a CollisionList
5. Try to overlap Object2 with some another object on the right side with
overlapping < (height - width).
What is the expected output? What do you see instead?
Collision should be detected but no collisions detected.
What version of the product are you using? On what operating system?
CDK v1.5
Please provide any additional information below.
The deffect is in CDK.as file.
Fixed file is in attachment.
Original issue reported on code.google.com by [email protected]
on 23 Apr 2011 at 2:21
Attachments:
What steps will reproduce the problem?
1. Compile with flash develop
You have many variables that are untyped and throwing warnings. Code needs to
be cleaned up a bit.
Original issue reported on code.google.com by [email protected]
on 3 Feb 2013 at 6:44
Right now, you can only specify the target for a CollisionList in the
constructor.
It would be helpful to be able to change the target of a CollisionList after
the instance has been
created.
Please add a target property to CollisionList.
This would be useful when you need to do multiple 1 to many collision checks,
where the many
are the same for each check (although the 1 is different).
This would allow you to reuse the same CollisionList instance across multiple
one to many
checks.
You could possibly use CollisionGroup for this, but that is not always as
efficient:
1. it may do unnecessary checks, if you dont care that some items hit others.
2. the same items may appear in the collisions array, making it more difficult
to work with them
(i.e. removing colliding items from the display list).
Original issue reported on code.google.com by mikechambers
on 17 Jun 2009 at 8:59
What steps will reproduce the problem?
1. I used collision group, but I expect I'd have the same result with collision
list too.
2. rotate 1 object on the stage, overlap with another.
3. Add a simple graphic to the stage using the x and y for each of the points
in the collision group array.
What is the expected output? What do you see instead?
You would expect the simple graphics getting drawn on top of the two objects
where they're overlapping but the points are placed in the wrong positions on
the stage.
What version of the product are you using? On what operating system?
CDK.v15
Please provide any additional information below.
..off topic. It would be good to have functions that return the centre point,
height and width (relative to the stage) of the overlapping area which could be
used rather than an array of points. This should make it faster and help when
trying to separate the objects after a collision.
Original issue reported on code.google.com by [email protected]
on 28 Jul 2010 at 4:33
Example.
Display list structure is as follows:
[container #1] (room)
-[child #1.1] (wall)
-[child #1.2] (object, rotated)
-- [child #1.2.1] (object's part)
When the child #1.2 is rotated, the collisions are not correctly detected
between the child #1.1 and the child #1.2.1 (while the #1.2.1 is a "target" and
#1.1 is in the CollisionList).
Although, when the #1.2 is not rotated - the collisions are successfully
detected between #1.2 and #1.2.1.
Original issue reported on code.google.com by [email protected]
on 4 Jan 2014 at 9:54
What steps will reproduce the problem?
1. In the last example "text" (no modifications done to it)
2. ball added to collisionList, but balls not detecting collision with
themselves.
What is the expected output? What do you see instead?
balls should register collisions with themselves. Instead they ignore other
balls.
What version of the product are you using? On what operating system?
newest version to date(7/20/11)
Original issue reported on code.google.com by [email protected]
on 21 Jul 2011 at 2:07
also known as Sweep Testing, Frame Independent Detection, Continuous Collision
Detection - this sort of Collision Detection prevents case scenarios where
objects moving too fast can pass thru barrier objects, because their positions
in space never collide on a frame.
I read an excellent article on the subject here:
http://sebleedelisle.com/2010/01/predictive-collision-detection-techniques/
Are there any plans on adding something like this to the CDK?
Original issue reported on code.google.com by [email protected]
on 8 Nov 2010 at 6:05
What steps will reproduce the problem?
1. Add displayobjects to a container displayobject
2. Setup a collision list for the display objects in the container
3. Change the scale of the container in realtime
What is the expected output? What do you see instead?
Until I started scaling the parent, everything worked fine
On calls to .checkCollisions() I get this error if the scale of the parent
changes during runtime:
TypeError: Error #1009: Cannot access a property or method of a null object
reference.
at flash.geom::Matrix/concat()
What version of the product are you using? On what operating system?
CDK Version 1.5
Windows 7
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 19 Jul 2011 at 3:48
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.