Is pixel based collision going to be implemented?
by Philip Mansfield · in Torque Game Builder · 02/21/2006 (2:34 pm) · 5 replies
Just curious if pixel based collision will be added to T2D at any point?
I know it's been discussed in the past, and I think that the general thought was that it was quite slow compared to the polygon based collision. But for some irregular shapes, it would be much easier if it was possible to turn on pixel based collision for that sprite.
The alternatives are to either mount some dummy objects to the sprite with seperate collision polys for each one, or create the sprite from multiple components and then mount those together.
Allowing more complicated collision polys (that include convex and concave shapes) would be a good alternative.
Whilst I'm talking about collision polys, has there been any progress on easily changing collision polys on the fly for sprites? For instance, changing the collision poly slightly as a sprite animates through its frames.
I know it's been discussed in the past, and I think that the general thought was that it was quite slow compared to the polygon based collision. But for some irregular shapes, it would be much easier if it was possible to turn on pixel based collision for that sprite.
The alternatives are to either mount some dummy objects to the sprite with seperate collision polys for each one, or create the sprite from multiple components and then mount those together.
Allowing more complicated collision polys (that include convex and concave shapes) would be a good alternative.
Whilst I'm talking about collision polys, has there been any progress on easily changing collision polys on the fly for sprites? For instance, changing the collision poly slightly as a sprite animates through its frames.
#2
02/28/2006 (1:12 pm)
I've not tried it but can't you implement dfferent collision polys per frame by using the onFrameChange callback on t2dAnimatedSprite?
#3
02/28/2006 (1:48 pm)
Yeah, but it's a bit messy, and you still can't have concave shapes which means needing multiple collision polys.
#4
The concave shape thing is a pain. I need pretty much pixel perfect collision detection on the game I'm working on and have had to keep with a very simple shape for the main craft as a result. No bad thing though: accuracy is pretty key to the gameplay so making it extremely clear as to when you have or haven't hit something is no bad thing in this case.
02/28/2006 (2:05 pm)
True.The concave shape thing is a pain. I need pretty much pixel perfect collision detection on the game I'm working on and have had to keep with a very simple shape for the main craft as a result. No bad thing though: accuracy is pretty key to the gameplay so making it extremely clear as to when you have or haven't hit something is no bad thing in this case.
#5
03/01/2006 (11:40 pm)
Could faked pixel based collision be done by adding some functionality (in the c++ source) that actually "walks" the outline of the sprite (or frames of an animation), and generates a polygon shape (or multiple shapes to handle concave stuff) for each frame, based on some rules for the min/max amount of change in angles and all that kind of stuff? and then it would allow you to view/edit and dump the vertices so that you could use them for collision.
Torque Owner Darren Stuart
I want different collision polys per frame of an animation tbh.