Questions tagged [box2dweb]

Box2dWeb is port of box2dFlash port to javascript.

Box2dWeb is a physics engine and it's basically a port of Box2DFlash library to JavaScript.

95 questions
5
votes
1 answer

How to include liquidfun physics engine with nodejs

I have been making a game with box2dweb and node.js. Everything has been working fine until I decided to switch to Google's LiquidFun engine, which is also based on Box2d. In box2dweb I could export the modules I needed by adding the following to…
two70
  • 51
  • 3
5
votes
1 answer

How do I remove a body in Box2dWeb after a collision

Inside of the Update function, if 2 bodies collide I want to remove them (or mark them as needing to be removed, and remove them at the end of the time step). How would I accomplish this? In the Update function I try var bodyA =…
Boundless
  • 2,444
  • 2
  • 25
  • 40
4
votes
2 answers

spring effect in box2djs

I want to simulate spring effect using box2djs. After a lot search i figure it that that distancejoint can be used (i am not sure). I tried the follwing code but i am not looking any joint between the body. distance_joint = new…
Rajesh
  • 41
  • 1
  • 2
4
votes
1 answer

Using transformation matrix in KineticJS

I have a body simulated with Box2Dweb and an image attached to the body. I want to take the body transformation matrix and apply the transformation to the image (draw the image with the transformation), so that its position and orientation…
Headcrab
  • 6,838
  • 8
  • 40
  • 45
3
votes
1 answer

Has b2DebugDraw and b2ContactListener been replaced in liquidfun.js?

I'm trying to replace my current Box2D library (box2dweb.js) with Google's LiquidFun library. The major difference seems like they placed all the b2#ClassName# classes in the global scope instead of keeping them modular (in a Box2D.* namespace like…
chamberlainpi
  • 4,854
  • 8
  • 32
  • 63
3
votes
1 answer

Drawing a sprite animation using box2dweb

what i am trying to do basically is making this animation http://jsfiddle.net/TLYZS/6/ in my box2d project but i am having some trouble in the drawing logic of each frame this is the result so far : http://jsfiddle.net/H8e9m/6/ how can i fix the…
Sora
  • 2,465
  • 18
  • 73
  • 146
3
votes
2 answers

Using KineticJS along with box2dweb

How do I use kineticJS along with box2dweb so that I can have collision detecting possible? Like, how can I put a circular boundary around an image rendered through kineticJS and apply physics through box2dweb? Are there any good tutorials on this…
Samarth Wahal
  • 171
  • 1
  • 2
  • 12
2
votes
1 answer

Box2D Cocos2d JS

I want to create a slope like in attached image in Box2D Cocos2d JS. However, I am unable to create it properly when attached sprites to it. My code is: new b2Vec2(0, 0), new b2Vec2(100 / worldScale, -50 / worldScale), new b2Vec2(200 / worldScale, 0…
Adnan Afzal
  • 167
  • 1
  • 3
  • 8
2
votes
0 answers

Node.js Box2dWeb error caused by require()

I'm trying to make a server using Node.js and Box2dWeb engine. But trying to "import" the "box2d.js" throws me a random error which doesn't seem to be related with what I'm doing. Here's the code that's causing the error: var Box2D =…
coNNecTT
  • 85
  • 2
  • 7
2
votes
1 answer

How to get around the memory leak issue in Box2D for javascript port?

As I understand now the Box2D version for web is leaking memory, bodies are not deleted, contacts neither. So how do I solve this problem? See my related question here explaining how is leaking: How to properly delete a box2d body in version:…
Totty.js
  • 15,563
  • 31
  • 103
  • 175
2
votes
1 answer

Rendering rotated rectangles from box2dweb in pixi.js

I am writing my own renderer for box2dweb and I decided I would like to use pixi.js. I am able to render rectangles, but only if they aren't rotated - if they are, the animation is messed up. It looks like this (one on the left is debug renderer…
Nebril
  • 3,153
  • 1
  • 33
  • 50
2
votes
1 answer

Using to move an object with arrow keys using ApplyForce is not working

part of learning game coding in javascript using box2d I am trying to just move a rectangular body (thinking as a Car) in 4 directions using arrow key events. For this I created a no-gravity world with static body (which are 2 parlallel edges) as…
poddroid
  • 845
  • 1
  • 14
  • 26
2
votes
1 answer

Is it a big difference to use Box2D in native Android game instead of Box2Dweb with HTML5 canvas?

I have to write a simulation of balls falling in a container for Android. First, I tried using Box2Dweb in a HTML5 canvas, but with 3 solid bodies and 50 balls, it performs really slow, even in desktop computer with Firefox (curiously, with Chrome…
Alex Text
  • 269
  • 1
  • 4
  • 11
2
votes
0 answers

box2dweb and kineticjs: poor update rate

folks ;) Im doing a basic animation with box2dweb and kineticjs. Both frameworks are awesome. This is a preview of what im doing: http://lab.devgf.com/boxkinetic/index_v.htm When I see it in Google Chrome or Safari (desktop) it works really nice. Up…
ppalmeida
  • 2,924
  • 5
  • 20
  • 25
2
votes
0 answers

How to avoid ghost collisions in box2dweb

I'm using box2dweb to create a game, but want to have an uneven ground in my game. However, box2dweb isn't up to date and doesn't contain edge chains to fix ghost collisions yet. Currently, my ground looks like this:…
bwong
  • 21
  • 3
1
2 3 4 5 6 7