box2d

Position resizable circles near each other

时间秒杀一切 提交于 2019-12-22 03:54:06
问题 I am working on this browser-based experiment where i am given N specific circles (let's say they have a unique picture in them) and need to position them together, leaving as little space between them as possible. It doesn't have to be arranged in a circle, but they should be "clustered" together. The circle sizes are customizable and a user will be able to change the sizes by dragging a javascript slider, changing some circles' sizes (for example, in 10% of the slider the circle 4 will have

How to stop the forces acting on a body in box2d

此生再无相见时 提交于 2019-12-22 03:16:06
问题 I am using box2d on the iphone to create a game. I have a body that is effected by gravity to move down and not right or left. It will get hit by another body and will then be moving right or left. I then have a reset button which moves the body back to its starting point. The only problem is that it is still moving right or left. How can I counteract the forces that a ball is already traveling? How can I get rid of this right and left movement when I reset my game? 回答1: box2d automatically

How to stop the forces acting on a body in box2d

爱⌒轻易说出口 提交于 2019-12-22 03:16:06
问题 I am using box2d on the iphone to create a game. I have a body that is effected by gravity to move down and not right or left. It will get hit by another body and will then be moving right or left. I then have a reset button which moves the body back to its starting point. The only problem is that it is still moving right or left. How can I counteract the forces that a ball is already traveling? How can I get rid of this right and left movement when I reset my game? 回答1: box2d automatically

[ios.cocos2d+box2d]how to disable auto-rotation?

让人想犯罪 __ 提交于 2019-12-21 20:58:54
问题 I have created a project with cocos2d 0.99.5 + box2d. When I rotate my iphone, Screen automatically rotated too. So the boxes Flew up into the ceiling. How to disable auto-rotation? plz 回答1: In coco2d 0.99.5, the template creates a file called GameConfig.h, where you get to choose what system controls the app's rotation. The default is #define GAME_AUTOROTATION kGameAutorotationUIViewController Now take a look inside RootViewController.m, or whatever you've named it in your file. in the -

Is Box2D perfectly deterministic?

送分小仙女□ 提交于 2019-12-21 19:28:11
问题 I'm writing an Android game using LibGDX and Box2D. I'm planning on adding a turn-based multiplayer feature to it. Now, if on both clients I step the Box2D world at the same rate with the same time steps and I start a simulation on both clients with the exact same initial parameters, when the simulations are over, will the final state of both simulations be exactly the same? In other words, is a Box2D simulation perfectly deterministic? If it's not, then that means every time a simulation is

Libgdx game crashes on Android

一曲冷凌霜 提交于 2019-12-21 07:02:55
问题 I made a game using libgdx and it runs fine on both desktop and android before. I'm not sure if its because I started using box2d physics engine and liquidfun particles,what basically happens is that when I click play on my game it start loading then after loading it should go to the gameScreen, but it crashes then says "Unfortunately, myGame has stopped". error message: E/AndroidRuntime: FATAL EXCEPTION: GLThread 3764 Process: com.nivekbryan.puffypuff, PID: 8416 java.lang

Cocos2d + Box2d or Chipmunk [closed]

谁说胖子不能爱 提交于 2019-12-20 08:24:43
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . OK, im trying to make an iphone version of a game i made here http://scratch.mit.edu/projects/techy/781198 is box2d or chipmunk better and where are some tutorials for each one 回答1: If you download the Cocos2d

Getting the world's contactListener in Box2D

╄→尐↘猪︶ㄣ 提交于 2019-12-20 07:39:06
问题 I'm writing a game for Mac OS using cocos2D and Box2D. I've added a b2ContactListener subclass to my world as follows: contactListener = new ContactListener(); world->SetContactListener(contactListener); This works perfectly, but I am unsure of the best/accepted way to access the contact listener from other classes that don't currently have a direct reference to the contact listener. I know I can pass a reference to other classes that need it, but what I was wondering is if there is a better

Fatal signal 11 (andengine project)

风格不统一 提交于 2019-12-20 06:24:07
问题 I'm creating and android game powered by andengine framework the box2d extension I'm getting "Fatal Signal 11" which seems to happen out of nowhere (I guess you can call it randomly) there no clues (at least, I don't aware to any clues to help me solve this problem) my guesses are: 1) I'm creating game's entities using TimerTask class 2) maybe it has something to do with concurrency? what do you think? thanks, socksocket 回答1: You could still use a TimerTask, you just need to be sure to call

how many pixels is a meter in Box2D?

假如想象 提交于 2019-12-19 10:10:45
问题 Question is simple so, no codes! If someone knows Box2D and SDL2, then, please tell me how to wrap SDL_Rect with b2body. Ofcourse, it requires to know the conversion of metre to pixel and vice versa. This is because Box2D measures distance in metres. Can you give me a simple expression or function to convert metres(of Box2D) to pixels or pixels to metres(of Box2D)? 回答1: Can you give me a simple expression or function to convert metres(of Box2D) to pixels or pixels to metres(of Box2D)?