» Home » Box2D » Page 1
box2d: positioning of an box2d body with a specific angle without using setTransform()?
Category : Programming Languages

I am using box2d which is included in the libgdx api (java)

I am using a rectangular box2d body as a sensor for detecting swordslash-collisions (using the body as an sensor) in 4 directions
(slashing 90° up, down, left, right).
so for slashing in the up-direction i create basicly a new rectangular box2d body and setting its startposition each time:


View Replies

create box2d andengine box2d body without sprite
Category : Programming Languages

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;
mBodyDef.position.x = 20;
mBodyDef.position.y = 5;
polyBody= mPhysicsWorld.createBody(mBodyDef);
final PolygonShape mPoly = new PolygonS

View Replies

How can I update Box2d?
Category : Web Design

I updated cocos2d template but it doesn't have the new box2d.


How can i update my box2d alone?
When i try to switch box2d folders, i get errors.

View Replies

TAGS : update Box2d

Pong in Box2D XNA
Category : Programming Languages

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 enough speed to reach the other side. I just want it to

View Replies

TAGS : Pong Box2D

Box2D SetAsOrientedBox
Category : Programming Languages

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);

View Replies

Box2D in Objective-C
Category : Operating Systems

I am currently running Kobold 1.0.4 and cannot work out how to use Box2D using Objective-C, any help will be appreciated.
I have looked at the Box2d example project with kobold but it uses only c++ i need to do it in objective-c as i am not really confident playing with both.

View Replies

TAGS : Box2D Objective

Box2D ground box
Category : Programming Languages

I'm pretty new to Box2D and I'm trying to get a simple scene with some boxes and a ground, but no matter what i do, the boxes just falls through the ground.

This is how i init my Box2D world:

b2Vec2 gravity;
gravity.Set(0.0f, -9.81f);
bool doSleep = true;
world = new b2World(gravity);

View Replies

TAGS : Box2D ground

Box2D and Sand in AS3
Category : Programming Languages

I want to create a game where you shoot a rocket into the ground (Sand) and it blows, and moves the sand to the sides...
Is it possible in Box2D? breakable little objects?
It's almost pixel perfect collusion detection.


View Replies

TAGS : Box2D Sand

Pulling limbs in box2d
Category : Web Design

I am using Box2d (libgdx) to implement a BMX bike with its rider. The bike is one body and each limb of the rider is one body. When airborne during a jump, the player should be able to control not the rider but the bike. Since the rider is connected to bike at the handlebar and at the pedals, the limbs will follow the bike, until the arms/legs are fully stretched at which point the movement of

View Replies

Saving Box2D shapes
Category : Programming Languages

As part of my save/load game code, I need to save the state of all the Box2D bodies that are in the world. When I do this and then load and recreate them there is a quick pop were some of the bodies separate from each other. I've double and triple checked my save game information and it is correct.

For each body, I'm saving the world position, angle, AngularVelocity and LinearVelo

View Replies

2012 / 2017 Copyrights BigHow , All Rights Reserved .