Questions tagged [box2d-iphone]

Box2D is a physics engine created by Erin Catto. This tag is similar to the box2d tag in that it is more specifically aimed at iOS development.

Box2D is a physics engine that is particularly popular among Cocos2D developers when developing a game for iOS devices. It is fairly fast and easy to use. More information can be found on its official website:

Box2D.org

For more information on Cocos2D (iOS) see:

Cocos2D-iPhone.org

410 questions
3
votes
1 answer

how to make a box2d body move along a Bezier curve/ arc path

I've searched extensively on how to make a Box2d body move along a Bezier curve or arc-like path with a start point, end point and possibly another control point. I know cocos2d objects can be moved around using ccBezier but how can it be done for…
3
votes
6 answers

Objective-C++ importing C++ class fails, cassert not found

So I want to publicly expose a Box2D (C++) pointer to other Objective-C++ classes in my cocos2d + box2d project. I declare a method "getWorld" in my interface which references C++ class b2World and imports Box2D.h. All the files in my project are…
2
votes
0 answers

Box2D/Cocos2D: Errors in CreateFixture

i'm programming a little game. you can shoot little bullets which should disappear when hitting an object. the problem is when i destroy the bodies (directly or first storing them into an array) i get errors within the CreateFixture() function for…
thomasguenzel
  • 670
  • 7
  • 25
2
votes
1 answer

Simple gun in cocos2d+box2d game

I'm newbie in box2d. Can you help me? I want to make gun (touch, move, stopped, ball flew). I make detection and rotation of gun, but I can't make popping of ball. How can I count velocity, which I need to set to the ball? Thank you very much
werbary
  • 1,105
  • 2
  • 14
  • 43
2
votes
1 answer

Correctly removing Box2D fixtures and updating b2Body

I have a Box2d body which I'm attempting to break into multiple pieces. To do this, I iterate over its fixtures and generate new bodies for each. Using debug draw, I can see that this seems to be working. As you can see in the above image, the…
ndg
  • 2,585
  • 2
  • 33
  • 58
2
votes
2 answers

How to get collision position in box2d

What's the best way to get the point of collision in box2d. I'm using it with cocos2d and Objective C, but I imagine the API is similar in other languages. Using the b2ContactListener class will produce b2Contact objects, but I can't find any…
Aram Kocharyan
  • 20,165
  • 11
  • 81
  • 96
2
votes
1 answer

Cocos2d Box2d multiple b2circle shape fixture for one body with positioning

Anybody knows how to add 2 circle fixture to one b2body with desired positioning? I know how to add two polygon fixture to one body by using m_centroid. But how can I do it for circle fixtures. Any answer will be appreciated. I want to stick some…
omarmaris
  • 96
  • 2
  • 9
2
votes
1 answer

How to make box2d mouse joint works similar to box2d setposition

I want to make b2mouse joint working similar to b2setposition, though i know in mouse joint force is applied, so it's not possible to reach the desired point without any delay like setPosition(), but i want to make it works as close as…
russell
  • 3,668
  • 9
  • 43
  • 56
2
votes
1 answer

Water Waves implementation in cocos2d

I am developing a game(cocos2d+box2d), where I want to implement waves similar to below link, http://jayisgames.com/cgdc8/?gameID=7 The above game done it using World Construction Kit for flash. Is there any one ported similar thing to cocos2d, or…
rat
  • 356
  • 1
  • 3
  • 14
2
votes
1 answer

I Want Remove Continuous collision detection in Box2D at some specific stage how can i over come?

==> I am developing game like carom board Where i am facing few issue due to continuous collision detection. As shown in the image due to collision detection striker hanging around with gray puck and game can not get continue after that and…
NIKHIL
  • 2,719
  • 1
  • 26
  • 50
2
votes
2 answers

Moving b2Body in given angle

I have b2Body of which i set angle using setTransform. But I want b2Body to move in particular angle. My CCSprite is moving in that angle using ccMoveBy. But my b2Body is not moving with that CCSprite. So I thought of using setTransform. I set the…
Anks
  • 225
  • 4
  • 15
2
votes
2 answers

Iphone game cocos2d and box2d

I have image named "platform.png" that represents one brick for platform of a IPhone game. I have a cartoon character that will jump on this platform. A series of platform.png will form one complete platform. These series will be generated by…
2
votes
1 answer

Converting rotation degrees to Box2D impulse

Many apologies if this has been answered before but I wasn't able to quite find what I was looking for. I have a Box2D dynamic body that I apply linear impulse to to turn it into a projectile. So when I click anywhere on the screen I want the body…
GivP
  • 2,634
  • 6
  • 32
  • 34
2
votes
1 answer

Is Box2D the best solution for my iphone game scenario?

I'm planning to build a basic rebound iOS game in Cocos2D. Will Box2D be best suited for the following scenario? The layout will consist of a target at the top of the screen, with obsticles in the middle of the screen, blocking direct view of the…
2
votes
1 answer

How to make a moving object "stick" to a stationary object in box2D

I have been experimenting with the box2D sample project within cocos2D for the iPhone and am wondering if box2D is the appropriate engine to use to make a moving object "stick" to a stationary object when the moving object is finished moving in a…