box2d

Box2dweb - Collision Contact Point

跟風遠走 提交于 2019-12-04 20:19:53
问题 I use box2dweb. I am trying to develop a game. At some point I need to find out the contact point between a "Circle" and "Box". All I know is it can be done using b2ContactListener. We can receive contact data by implementing b2ContactListener using Post-Solve Event. Please help! 回答1: You are on the right track there are various events you can hook into with the b2ContactListener: var b2Listener = Box2D.Dynamics.b2ContactListener; //Add listeners for contact var listener = new b2Listener;

Cocos2D-x - Issues when with using CCFollow

断了今生、忘了曾经 提交于 2019-12-04 18:26:42
I've got a problem with CCFollow in Cocos2D-X. I want to follow my a Sprite, which is referred to a Box2D-Body. When i call this->runAction(CCFollow::create(playerSprite)); in the init method of my GameLayer, the lower left corner of my usual screen is centered on my device and although the emulator. May anyone help me with this issue ? :/ Best Regards, stotheg ССFollow is often not enough for your own purposes. One way out of this situation is to create your custom ССFollow action or adding the required logic in the game loop. Please read this article, there's a lot of useful information for

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

这一生的挚爱 提交于 2019-12-04 17:07:37
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 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 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation method, you'll see a

Strange “stutter” in box2D on different android devices

南楼画角 提交于 2019-12-04 12:52:10
I'm developing an engine and a game at the same time in C++ and I'm using box2D for the physics back end. I'm testing on different android devices and on 2 out of 3 devices, the game runs fine and so do the physics. However, on my galaxy tab 10.1 I'm sporadically getting a sort of "stutter". Here is a youtube video demonstrating: http://www.youtube.com/watch?v=DSbd8vX9FC0 The first device the game is running on is an Xperia Play... the second device is a Galaxy Tab 10.1. Needless to say the Galaxy tab has much better hardware than the Xperia Play, yet Box2D is lagging at random intervals for

When to use ShapeRenderer, Mesh + SpriteBatch, Box2D and Scene2D in Libgdx?

て烟熏妆下的殇ゞ 提交于 2019-12-04 11:06:59
问题 I'm new in Android Game Development and after I started with libgdx ShapeRenderer and did a little more search, I became confused if I started with the right foot. So, what I really would like to know is when should I use ShapeRenderer, Mesh + SpriteBatch, Box2D and Scene2D. 回答1: LibGDX has quite a lot of (mostly orthogonal) APIs for rendering. I'm still learning my way around many of them, but I can give an overview of the different parts. ShapeRenderer lets you quickly and easily put basic

AndEngine Sprite/Box2D Body removal crashes my program with no error/exception information?

心不动则不痛 提交于 2019-12-04 10:15:08
I am making a skateboarding game with obstacles you have to jump over using box2D and AndEngine. I am trying to make it so that when the player collides with an object, the object is removed and an explosion is placed at the objects old position, however something in the sprite removal code is freezing my program causing it to end (not even a force close message it just closes itself and goes to my home screen) and no error/exception information appears in logcat so I have no idea what is causing it! Here are some code snippets- when I create the sprites/boundaries I attach a JSONObject to the

Is Box2D perfectly deterministic?

若如初见. 提交于 2019-12-04 09:42:16
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 over, one client acting as a host will have to tell the other to throw away its final simulation's

How to use the mouse joint in Android?

ぐ巨炮叔叔 提交于 2019-12-04 06:14:50
问题 I want to use the MouseJoint in Java for Android. I am new in box2d and cocos2d. I don't know how to use the mouse joint. 回答1: i recomend you to see this tutorial example. Copy from it (sorry i don't like broken links :) ) ... you drag your body with the help of the MouseJoint, it will collide with the other bodys in the world and apply force to them. Box2d - Manual - http://www.box2d.org/manual.html#_Toc258082974 8.10 Mouse Joint The mouse joint is used in the testbed to manipulate bodies

How to enable Box2d debug draw with Coco2d-x 3.0 beta 2

╄→尐↘猪︶ㄣ 提交于 2019-12-04 06:02:18
问题 How I should enable debug draw with Cocos2d-x 3.0? There are some codes that do that with cocos2d-x 2.0 but they don't even compile on Cocos2d-x. Unfortunately I am new to both cocos2d-x and Box2d and I don't know how to port them. That would be great if you would share the method how you draw shapes. EDIT: I have found this: http://blog.csdn.net/tian2kong/article/details/20386213 I have overridden the draw method of my applications main Layer like this: void HelloWorld::draw() { GL:

how to use the libgdx contactlistener

别说谁变了你拦得住时间么 提交于 2019-12-04 03:39:00
I've just began to work with the Libgdx's Box2d Engine but i simply do not understand when the methods of the Contactlistener should be called. There is on the one hand "begin contact" and on the other "end contact". Where should i call them, to get the Number of of a certain fixture touching others? And how do I implement the Contactlistener ? A redirec' to a Tutorial would answer my Question. I didn't find anything while searching google. This one helped me a lot but it is written for C++ and does not refer to the implementation into a main-gamecircle. Thx for helping me ;) Here's a short