box2d

Box2D SetAsOrientedBox

The command "SetAsOrientedBox" in Box2D doesn't work anymore. I couldn't find out the new command for it. Can someone tell me the new command? Old example: boxDef.SetAsOrientedBox(0.4, 0.1, new b2Vec(0.1, 0.1), 0.3); ...

Is it possible to change 2-3 times f->SetSensor() ?

Hello there ! i use cocos2d-iphone-0.99.2 and integrated in it box2d. i have 2 kind of sprites with tags 1 and 2. Also i created bodies and shape definitions for them. what i'm trying to do is to make sprite1 kinds to act as solid or act as not solid when sprite2 colides with them. i tried this code : for(b2Body *b = _world->GetBodyL...

Making Billiards in Box2D

As a quick overview: I'm trying to make a game of pool using Box2D as a basis. Now my question: How should I set up the billiard balls and edges so that they act normally? The balls sometimes seem to stick to the edges for no apparent reason. I've got four static wall objects with a restitution of 1 around the edges of the table. Ea...

how to make arc shape in box2d for iphone

hey guys i m looking for how some one can achieve the curve or concave shape in box2d for iphone i m stuck with this... Thanks in Advance... Umer Sufyan. ...

making of curve shape in Box2d in the latest version

i found some post that shows how to make curve shape in iphone using box2d but in the latest version of box2d i m unable to get some clue can you provide me some sample of making a shape instead of setasbox() function... ...

cocos2d and box2d .. creating map and worlds

So my question is really about creating different levels in my game. I am using cocos2d and box2d and right now I have a lot of code that actually constructs my world and I can't do pane or stuff like that coz honestly i don't know how.. So any tips and pointers for beginner to create world with static object and then I can add my own ...

Pong in Box2D XNA

So I have been trying to recreate Pong in Box2D to learn how to use the engine and I think creating pong in it is more complicated than i thought. I have the collision down by itself, i have the ball restitution set at 1.0 , my only problem is I have no idea how to have the ball hit the paddle, bounce back at the right angle and have eno...

Box2D: How to manually render a body

Hi, I'm getting crazy... I succeed installing box2d into my project. But how can I draw a body? Of course I need an engine to draw with, but that doesn't matter now (SDL). I just want to reach that I can get all the coordinates of the points that represent the body-polygon, to draw it with the engine. (Not relevant for circles) If you ...

BOX2D Acceleration/Velocity in XNA

I am having a problem, and i have tried all the possible combination. I am trying to get my ball to just basically fly off the screen as fast as possible. The only problem is no matter what values i set it just moves at the same rate. I tried doing ballBody.SetLinearVelocity(new Vector2(1000000f, 0)); ballBody.SetLinearVelocity(new Vec...

setup box2d for xcode ipad

I'm following this page, but the explaination it's for iphone simulator, i have the ipad simulator and the iphone os 3.2 in the xcode but when i try to follow the example and make it work for ipad get lots of errors in the box2d classes. Here it's the source: http://www.drobnik.com/touch/2010/05/physics-101-uikit-app-with-box2d-for-grav...

Scaling for multiple resolutions in Box2d and Android

I am developing a game that uses box2d engine in android. I create the physics world by definitions coming out a xml defined for 320X480 resolution. Now in box2d I have considered that 1 unit is 30 Pixels. The question is , is there any other option other than defining a separate xml for each resolution to scale this properly for all s...

BOX2D Contact (isTouching) Problem

Here is my problem Image I want to check if the balls are touching, which works perfect. Sometimes however that ball with the arrow isn't picked up which of course makes sense since it isn't touching anything. However, I want to give a little bit of leeway so that if a ball is say 4 pixels/0.001m away, it should be considered as touch...

box2d angle rotation in uiimageview for compund shapes

I want to apply an rotation to an uiimageview for shapes like "U" and "T" using compund objects and box2D, because "U" shapes are concave polygons so i can't do it using b2polygondef only. Here it is the method to make an "u" shape box when the user click on the screen // map from the world to the screen and screen to the world #define...

Move my body to a point

I am using box 2d. I just want to move my body to the point. What is the best way to do this? ...

Move a box2d body via cocos2d actions

Anyone know of a good tutorial for this? I am new to box 2d and don't really understand it much. ...

Non-Rigid Body 2D Physics Engines in C++

Hey, I'm trying to experiment with 2D physics engines in C++. So far, it seems the most popular is Box2D. Unfortunately, Box2D is a rigid body physics engine and that's not really going to help me with what I want to try. I want to be able to define a shape which has a number of vertices joined by springs, such that when this shape col...

BOX2D flash game Applyforce/Apply Impulse?

I am trying to replicate this game for flash using Box2D http://www.physicsgames.net/game/Tricharge.html . I have everything fine, the only problem i am having is when the group of bubbles burst, How do i apply a uniform increase in speed like it does in the game. I have tried ApplyForce, ApplyImpulse but all i get is what looks like an ...

Diminishing speed in zero gravity box2d world

I am trying to create a dynamic body that orbits around a static body in Box2D. I have a zero-gravity world, and a DistanceJoint that connects the two bodies. I have removed all friction and damping from the bodies and the joint, and am applying an initial linear velocity to the dynamic body. The result is that the body starts orbiting, ...

Box2d:apply velocity in a direction

Hi, I apply impulse in an object in box2d iPhone app and now want to increase its speed in particuler direction....i mean i need two thing 1.through the object in a direction 2.increase speed plz help.. ...

Box2D & XNA Rendering the data

So i have been finding that for Box2D your physics information should not be your rendering information so you can't do things like spriteBatch.Draw(mazeBox, mazeBody.Position / 0.01f, Color.White) instead you should create transforms of the physics info and use that as your rendering. So what does that exactly mean? I have been try...