» Home » Box2D » Page 1
box2d: positioning of an box2d body with a specific angle without using setTransform()?
by Chris in 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:


swordBod

create box2d andengine box2d body without sprite
by Ever Daniel Barreto in 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

How can I update Box2d?
by Wilson Mar in Web Design

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


http://code.google.com/p/box2d/downloads/detail?name=Box2D_v2.2.1.zip&can=2&q=

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

TAGS : update Box2d

Pong in Box2D XNA
by Uppsala9496 in 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

TAGS : Pong Box2D

Box2D and Sand in AS3
by Scott Smith in 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.


Thanks!

TAGS : Box2D Sand

Box2D SetAsOrientedBox
by Japan in 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);


Box2D ground box
by cheese_doodle in 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);
world->SetAllowSleeping(doSleep);
world->SetContinuo
TAGS : Box2D ground

Box2D in Objective-C
by Janko in 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.

TAGS : Box2D Objective

Box2D object speed
by Pseudoics in Web Design

I have a little issue with my game. In my main game scene I create a Player object from a class, like this:


player = [Player spriteWithFile:@"Icon-Small@2x.png"];
player.position = ccp(100.0f, 180.0f);
[player createBox2dObject:world];

Below is the main chunk of my small Player class that creates the body and the fixture so I can use it in a

TAGS : Box2D object speed

box2d concave body
by visual-c++ in Mobile Programming

I am creating a box2d body for my iOS game, that is built from 4 shapes that are convex.
The problem is that it fails when calling the init method.
Here's my code:


@implementation Banan
-(void)createBodyAtLocation:(CGPoint)location
{
int num;
float density = 1.0f;
b2BodyDef bodyDef;
bodyDef.type = b2_dynamicBody;
bo
TAGS : box2d concave body

Next
Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2014 © bighow.org All Rights Reserved .