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

learn more… | top users | synonyms

3
votes
1answer
410 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
206 views

Transforms in Box2D

I'm attempting to implement a camera in my game. I had it working for regular objects, but I began using Box2D and obviously things changed a bit. I have a Body object that I want to draw at the ...
2
votes
1answer
566 views

Problem Implementing Texture on Libgdx Mesh of Randomized Terrain

I'm having problems understanding how to apply a texture to a non-rectangular object. The following code creates textures such as this: from the debug renderer I think I've got the physical shape ...
1
vote
1answer
438 views

Libgdx import bin/xml/json from physics editor

I'm using Libgdx. I did a simple json file in Physics Body Editor and I don't have any idea how could I import it into my physic world in libgdx. Any idea will be appreciated. P.S: Sorry if there ...
3
votes
0answers
190 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 ...
2
votes
0answers
101 views

JBox2D Polygon Collisions Acting Strange

I have been playing around with JBox2D and Slick2D and made a little demo with a ground object, a box object, and two different polygons. The problem I am facing is that the collision-detection for ...
2
votes
0answers
308 views

how to attach a body to a rope and making it swing to another rope

I've set some ropes (using cocos2d and box2d) and would like to attach a body to one rope in such a way that it can swing to another rope. I am not sure how to go about this. I read making and object ...
1
vote
0answers
35 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
0answers
69 views

Scrolling with SDL2 & Box2d - My Camera isn't keeping up with my player

I'm trying to get a game on the google play store before I'm 40 (long held dream to publish a game since the days of the speccy), I have just over a month to go so it's not looking good! Foolishly I ...
1
vote
0answers
61 views

LibGDX - Box2D: Realistic Light and Layers

I'm having some problems with my current game. Short description: It's a 2D game where you have to avoid the lights or you lose HP. My problem is the following one: Here is the rendering process: ...
1
vote
0answers
27 views

Box2D setGravity() in Andengine?

Im currently using the Andengine GLES20 branch. I know that the new Box2D method setGravity() isn't implemented yet. Has anyone managed yet to get it to work with Andengine or to write a method ...
1
vote
0answers
59 views

Need to join 2 bodies via weld joint but not on center of mass

I have successfully join 2 bodies via weld joint , but my problem is I want to join corners of bodies not on centre of mass. Is there any way to achieve this? Above image consist 3 polygon body that ...
1
vote
0answers
117 views

Box2D Qt wrong collisions

I am working on a simple Box2D game (with Qt), but my objects don't collide correctly: As you can see on the picture, objects try to go through each other and slide over. My b2World: b2Vec2 ...
1
vote
0answers
174 views

Image Texture Tracing Algorithm - Cocos2D Box2D

Context: I am working on a 2D Destructible Terrain engine for Cocos2D with Box2D. All images, when a level loads, have their border's traced and cached for the purposes of forming Box2D b2EdgeShape ...
1
vote
0answers
125 views

beginContact triggered more than once on some objects

Short version: It looks like beginContact is detecting continuous collisions. I'd like to avoid that. Long version : I use Box2Dweb to write a 2D platformer. It's my first game using this lib, and, ...
1
vote
0answers
820 views

Why do restitution values less than one still cause infinite bouncing in Box2D?

I'm currently trying to implement basketball bouncing into my game using Box2d (jBox2d technically), but I'm a bit confused about restitution. While trying to create the ball in the testbed first, ...
1
vote
0answers
305 views

Wheel Joint Implementation in AndEngine

I am currently developing car game in AndEngine. In which I was using revolute joint for car wheel and chassis attachment. But my friend suggest me that use wheel joint for that purpose for better ...
1
vote
0answers
380 views

changing body type without change of center of mass

I have an box2d project with some bodies in it, which move around without any user interaction. But if the user selects one of the bodies, he should be able to move it around just like he wants to. ...
1
vote
0answers
738 views

How to properly add texture to multi-fixture/shape b2Body

Hello to everyone this is my first poste here I hope that will be not fail start. At start I must say I make part 1 in Ray's Tutorial "How To Make A Game Like Fruit Ninja With Box2D and Cocos2D". But ...
1
vote
0answers
242 views

Design pattern for procedural terrain assets

I'm developing a procedural terrain class at the moment and am stuck on the correct design pattern. The terrain is 2D and is constructed from a series of (x,y) points. I currently have a method that ...
1
vote
0answers
575 views

Why are my Box2D bodies disappearing when they collide?

I have a Box2D simulation going on and a system that loads the bodies and its' shapes from a text file definition. I create a new physics world, i load bodies into it, from one of these files. ...
0
votes
0answers
12 views

setChaseEntity freezes or jitters the AnimatedSprite

I'm trying to implement setChaseEntity method in a physics based app. I wrote the below code which has an animated sprite ans as the player. The player is movable and it can jump. When i try to focus ...
0
votes
0answers
14 views

GWT problem with Box2D WheelJoint

I am using the below libgdx java code for a wheel joint and rear axle using Box2D. This works fine for android, Desktop, but when I attempt to run through GWT I get the following error. at ...
0
votes
0answers
5 views

box2dweb issue in DestroyJoint function

my jsfiddle : http://jsfiddle.net/H8e9m/9/ as you can see when the ball reach the pendulum end and collide with it by a revolute joint, the problem occurred when trying to make the ball release the ...
0
votes
0answers
25 views

Box2D—Dropshadow

I am about to create a Jump'n'run game using Box2D for the physics. I am asked to add a Dropshadow to the main Character, but as I noticed this could become quite complicated. Basically the Light ...
0
votes
0answers
17 views

Trying to make a mouseJoint with Box2D on Cocos2D-X

I'm trying to obtain this result: http://appcodingeasy.com/Gideros-Mobile/Dragging-Box2d-object-in-Gideros-Mobile (there's a video - YouTube). But I'm missing something, because if I follow the code ...
0
votes
0answers
40 views

How to find correct offset to adjust sprite to the position of box2D body after rotation

I am trying to implement phsyics with the as3 box2d port. I currently have a b2body for each of some certain sprites in my game and I am able to update the sprite's positions correctly from the ...
0
votes
0answers
24 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
66 views

How can I load an SVG file and create a shape and collision data from it?

I'm looking to write a game in C++ with vector-styled graphics. For this, I will need to turn an SVG shape into a Box2D body and a polygon for rendering in SFML. I don't need the full capabilities of ...
0
votes
0answers
24 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
58 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
14 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
23 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
21 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
173 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
75 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 ...
0
votes
0answers
114 views

Cave generation problem in LibGDX

I have been reading this article: http://roguebasin.roguelikedevelopment.org/index.php?title=Basic_directional_dungeon_generation, but I can't understand what I am supposed to do: I don't even know ...
0
votes
0answers
67 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 ...
0
votes
0answers
105 views

Impact js Multibody entities with animations

I have a simple impactjs project working with box2d. just a "car" that can run over some rough terrain. I would like to have the wheels spin though. I know I could accomplish this with a sprite sheet ...
0
votes
0answers
162 views

Box2D revoluteJoint Motor speed,Max torque scaling for diff Devices

Hi i am using Box2d Revolute Joint as a joint for wheel it's connect to Wheel and Body of my Car i am using RUBE for creating the Box2D world Prob. i am using a scaling floating point number to scale ...
0
votes
0answers
256 views

Libgdx - Box2D: Attach Physics Body Editor Loader mask to dynamic texture

I have a texture of a circle, which gets drawn to a new position when a touch drag occurs. It isn’t set up as a body. I have made a physics map using Aurelien Ribon's Physics Body Editor Loader GUI ...
0
votes
0answers
100 views

Chain Shape Collision

I am facing a new problem by using chain shape. The collision between two chain shape bodies doesn't happen as the collision between normal bodies. So is this normal behaviour or am i doing anything ...
0
votes
0answers
84 views

360 degree gravity game mechanic like “They Need To Be Fed” game

I am a fan of "They Need To Be Fed" game and I want to understand the game mechanic at a deeper level. What are some good resources for the basic Box2d (or similar) physics behind the 360 degree ...
0
votes
0answers
127 views

Weld Joint Box2d not run

i have two object like this : b2WeldJointDef weldJoint; //frist body bodyDefXich.type = b2_dynamicBody; bodyDefXich.position.Set(3, 2); b2FixtureDef fixtureDef; b2PolygonShape ...
0
votes
0answers
100 views

Catching an object from sky in Cocos2d and Box2d world

My world has a gravity of -9.8 and there are KDynamicBodyType bodies falling from the sky. At the bottom there is a PhysicsSprite with KinematicBodyType. I want the PhysicsSprite to be able to catch ...
0
votes
0answers
242 views

Slow Rope Joint Simulation

I am right now developing game similar to Cut The Rope. But I have some problem in developing this game. I have successfully created rope and attached multiple rope with candy. Below I represent ...
0
votes
0answers
137 views

Farseer non-colliding bodies affect eachother

I'm trying to use Farseer to make a tile engine, but bodies that are not colliding with a sprite are still having an effect on it. In this image there is a single sprite(the green box) and a single ...
0
votes
0answers
765 views

Box2d : Sprite display not fit with body when rotated

I have recently achieved to render box2d Objects, and texture with sprites at where the box2d objects exists. But now I am facing another problem. When I rotate the Box2D object, the sprite gets ...
-1
votes
0answers
52 views

Body height width is different from sprite height width in box2d libgdx

I have a problem with box2d in libgdx. I was makin 5 kinematic moving platform on which a dynamic body player can jump. Height of plateform is varying from 20 to 110 pixel which I am passing to body ...
-1
votes
0answers
31 views

Map in Scene2d/LigGdx

I'm a little lost for my game. For the moment I've a car, who work, but now I want to create a map (like hill Climb Racing for example, not necesserly randomly generated). I don't know how to do ...