Box2D is an open-source rigid-body 2D physics simulation library for games, written in C++.

learn more… | top users | synonyms

4
votes
1answer
272 views

Letting the user draw a Polygon Body and Image

In my game, I want to provide the user with a drawing feature. By free hand drawing, the user creates a polygon shape. Then, in my game implementation, I have to create a body for the found vertices ...
3
votes
1answer
744 views

AndEngine; Box2D - high speed body overlapping, prismatic joints

I'm trying to make good suspension for my car game, but I'm getting nervous of some problems with it. At the beginning, I've tried to make it out of one prismatic joint/revolute joint per one wheel ...
2
votes
1answer
68 views

Box2d C++ x velocity slowing for no apparent reason

I'm making a 2d platformer in C++, using Box2d for physics and sfml for rendering, I want the player character to move with a constant velocity in the x direction, and to jump when the spacebar is ...
2
votes
1answer
87 views

Box2D—how make character tilt

I have got a floating character, which should be a robot like thing, floating over the ground, whereby I am using the »hovercar« effect described here. Zhe Image below outlines the basic setup of the ...
1
vote
1answer
48 views

box2D and libgdx: Attach ParticleEffect to Body

Hello I am a newbie with libgdx, my question is: how could I add a Particleeffect to a Body that is moving? I searched about the matter and I didnt find anything related to it. I have the following ...
1
vote
1answer
221 views

Box2d - Attaching a fired arrow to a moving enemy

I am firing an arrow from the player to moving enemies. When the arrow hits the enemy, I want it to attach exactly where it hit and cause the enemy (a square) to tumble to the ground. Excluding the ...
1
vote
1answer
203 views

Change the shape of body dynamically

I have a problem where i have a ballon which i need to continuously inflate and defalte in update method, I have tried to used setScaleCenter but it is not giving desired result. Below is a code i am ...
1
vote
1answer
195 views

Dynamic Hills like Contre Jour in Cocos2d

I'm interested in maps/environments which are flexible and change at runtime, such as those in Contre Jour. I have looked for a long time to find out how to make this effect, but I couldn't find an ...
1
vote
1answer
911 views

Drawing Shape in DebugView (Farseer)

As the title says, I need to draw a shape/polygon in Farseer using debugview. I have this piece of code which converts a Texture to polygon: //load texture that will represent the tray ...
0
votes
1answer
47 views

Box2D pixel to meter conversion

I have a game that was written in pixels and now I want to change it to meters like(box2D do). How I need to do that. I have wached a lot of tutorials and all they have some SCALING FACTOR but when I ...
0
votes
1answer
29 views

box2d ChainShape into curved line

i need to draw a curved line , i searched the internet and found nothing , maybe someone with knowlegde on the subject can help me with a link , i used chain shape and did this , and i don't know ...
0
votes
1answer
107 views

How to render a vertex buffer in DirectX11 C++ (specifically with box2d's b2Draw)

I have all the DirectX11 devices etc setup and working with DirectXTK's SpriteBatch and currently attempting to implement a b2Draw class to draw my box2d physics worlds. I have little idea on how to ...
0
votes
1answer
55 views

How can I create a character design that maintains a fixed rotation body, while allowing the body's “arm” to rotate 180 degrees?

I am attempting to create a 2d shooter in Farseer Physics on the Xbox360. I have a player body which has a fixed rotation, as I do not want the body to rotate at all during gameplay. I am now looking ...
0
votes
1answer
78 views

LibGDX Box2D TileGame Efficiency

I am trying to implement Box2D into my top down tile game in LibGDX. Each world consists of a set of chunks, and each chunk is 16 tiles wide/long. The maximum/minimum chunks loaded at one time is 9 (a ...
0
votes
1answer
63 views

Set Position of multiple bodies

I have a character composed of five bodies which are tied together by a lot of joints. On of them is the overall chassis, to which all forces and impulses are applied to move the whole Character. All ...
0
votes
1answer
551 views

Communication between Box2D and libGDX Stage (Scene2D) running in separate threads

I'm making a physics based 2D game using libGDX and Box2D. I want to move the execution of the simulation out of render thread. I use immutable messages and the BlockingQueue to pass the information ...
0
votes
1answer
129 views

Physics don't apply on a unique body AndEngine

I am developing a game in AndEngine. So far I managed to create everything I wanted for my sprite that was connected to a BoxBody. I was rotating it, moving it, everything was great. I wanted my ...
-1
votes
1answer
53 views

What's the difference between Box2D and tweening?

It seems like Box2D can be used to move sprites across the screen, so how does this differ from tweening? Is it that Box2D is for physical collision detections and tweening is just animations?
-1
votes
1answer
127 views

Collision function calls before colliding

My Box2D contact listener class is calling post solve and beginning the contact function before colliding? This is causing my object to bounce back before hitting the ground. What could be causing ...
-1
votes
1answer
425 views

Box2D Static-Dynamic body joint eliminates collisions

I have a static body A, and a dynamic body B, and a dynamic body C. A is filtered to not collide with anything, B and C collide with each other. I wish to create a joint between B and A. When I ...
-1
votes
1answer
1k views

Create Box2D and engine polygon Box2D body without sprite

Hey I have created my body using following code: (please read full description) Body polyBody; final BodyDef mBodyDef = new BodyDef(); mBodyDef.type = BodyDef.BodyType.DynamicBody; ...
-3
votes
1answer
501 views

How do I change gravity of box2d world after world is created?

I want to modify the world of box2d after creating it, namely to change the gravity vector. Is there a way to do this?
0
votes
0answers
165 views

Box2dLights rendering in bigger scale

So basically my box2dLights are rendering in wreid places. The circle in center is my player and as you can see lamp which should be aligned to player is in the right-top corner. my code: package ...
0
votes
0answers
53 views

Apply impulse to ball to a fixed height Jbox2D android

I have to hit a ball to a fixed height repeatedly as shown in the following image. This game is similar to 1983 Hitit The difference is the hitting y axis will be variable. I wanted to hit the ...
0
votes
0answers
120 views

Simulating a single water droplet in Box2d

This is for a class project. The main character in the game is an oil droplet and we're trying to simulate it using Box2D. One of the levels in the game is where the oil droplet is in contact with ...
0
votes
0answers
53 views

Prismatic Joint causes a crash-Box2D(cocos2d)

tried to set up a prismatic joint, but I get this error upon run time: Assertion failed: (IsLocked() == false), function CreateBody, file ...
0
votes
0answers
54 views

Andengine Box2D Physics “disappearing”?

I have problems with my PhysicsWorld in Andengine GLES20. Sometimes when i first load my app and level there is no velocity added to my bodies. they also rotate slower as it seems. This also happens ...
0
votes
0answers
42 views

Box2D Joints Disconnect

I'm trying to make a soft body physics system using rigid bodies in a circle. I'm having a problem where my joints only connect to one of the bodies, and seems to disconnect from the others. I think ...
0
votes
0answers
664 views

Box2D Soft Body Wheel in Unity3D

I was watching this video made with IForce2D, its about creating soft bodied wheels in box2D. http://www.youtube.com/watch?v=F-aDMZUVw0c I wanted help in being able to increase the Radius of the ...
0
votes
0answers
281 views

box2d's ApplyForce works wrong after cocos2d-x's replaceScene

i'm practicing making a breakout game, using cocos2d-x 3.x and box2d, referencing here. i create a ball in the scene's init function and apply force. when ball hits bottom wall, if i touch screen ...