Cocos2d / Box2d CCRibbon Collision Detection?

Take each point and create a thin static rectangular box2d polygon using the points + the adjustment to make it a shape.

Take each point and create a thin static rectangular box2d polygon using the points + the adjustment to make it a shape. For (int I = 0; I X, ccribbon.pointsi. Y); ar1 = new b2Vec2(ccribbon.pointsi.

X + width, ccribbon.pointsi. Y + width); ar2 = new b2Vec2(ccribbon.pointsj. X, ccribbon.pointsj.

Y); ar3 = new b2Vec2(ccribbon.pointsj. X + width, ccribbon.pointsj. Y + width); //create new static object b2Polygon b2p = new b2Polygon(); b2p.

SetAsArray(ar); //do rest to add it to world etc. } of course don't copy that code exactly its just from what I remember and i'm also sure its a combination of C# and Actionscript 3. Its kindof a not so pseudo code with lots of blanks you'll need to fill in. Why the comments are there :P.

Thats basically how I would do it though. My experience is only in box2d for flash though.

Thanks I'll try that then accept your answer. I'm gonna try to "port" it though as it's for ObjectiveC ;) – Alexandre Cassagne Jun 15 '11 at 13:42.

I have... and indeed for creating simple sprites which are predetermined (a box, a ball, etc...) it's fairly simple to determine the shape (square, round, etc...). However, there's no way to access the shape of a CCRibbon. Without points, I can't create the shape.

Without the shape, I can't create the fixture. Thanks anyways, Alexandre Cassagne – Alexandre Cassagne Jun 11 '11 at 21:45 Then take a look at this...physicseditor.de – Anish Jun 12 '11 at 5:35 This is REALLY good, but the problem is it isn't dynamic. Isn't there anyway to dynamically take any cocos2d shape and convert it into a box2d one?

– Alexandre Cassagne Jun 12 '11 at 9:43 sorry..i didn't check for dynamic bodies...May be in their documentation you can find that – Anish Jun 12 '11 at 10:09 I wish, but Cocos2d's documentation is pretty sh*t if you see what I mean :) – Alexandre Cassagne Jun 12 '11 at 10:49.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions