-1
votes
1answer
78 views

simple collision detection with box2dweb

im beginner in box2dweb that version of box2d for javascript i wrote simple gravity system and i want to detect the collision between the box and the ground , when the falling box hit the ground ...
1
vote
1answer
73 views

Preventing rapid inversions of boolean on Collision detection

I know this is both a strange question and a stupid question. But this is an issue I have dealt with in every single game I've made, and I have yet but to find a solution. I can't be the only one ...
0
votes
1answer
98 views

How do physics engines like Box2D detect and respond to collisions between arbitrary polygons?

I've always wondered how collision detection like this was achieved, and I've always wondered what the response would be. Do they perform line-line intersection tests for each line making up the two ...
9
votes
1answer
513 views

How do I make a curved surface out of rectangular blocks?

For a Peggle-like game, I want to make blocks that follow a curve, like this: The blocks would then disappear as the ball hits them. I managed to draw some horizontally, but I'm having trouble ...
4
votes
1answer
231 views

How do I simulate a trampoline?

I'm quite new to game development. I was pretty impressed with the elastic effect I saw in this flash game when the ball hits the trampolines and I'm wondering how to recreate it. I've done some ...
1
vote
2answers
705 views

Box2D Libgdx removing bodies in case of simultaneous collisions

I am making a clone for the BreakOut game. I'm using Box2D and Libgdx for it. In the game, one scenario is that there could be 2-3 balls at one time. Now the problem occurs when 2 or more balls ...
0
votes
0answers
52 views

Box2d - Allow object to pass but still report collision [duplicate]

I am creating a laser which is a dynamic body with its own collision filtering. I want it to not collide, as it does not currently but I want it to still report the collision or when the two overlap. ...
0
votes
2answers
102 views

Floating point precision issue with Box2D

I'm using Box2D and I am putting edge tiles as b2Bodies so that the tile world can have physics: The problem is that there are 3 b2_kinematic bodies under the player right beside each other. Every ...
0
votes
0answers
34 views

2D collision beetween a sprite and an array of sprites [duplicate]

I am creating a simple Android jumper (think Doodle Jump or Abduction) using libGDX so I can get started in game programming. My problem is that I need to figure out a way to check for collision ...
2
votes
1answer
150 views

JBox2D Polygon Collisions Acting Strange

I have been playing around with JBox2D and Slick2D and made a little demo with a ground object, a box object, and two different polygons. The problem I am facing is that the collision-detection for ...
-1
votes
1answer
365 views

Box2D Static-Dynamic body joint eliminates collisions

I have a static body A, and a dynamic body B, and a dynamic body C. A is filtered to not collide with anything, B and C collide with each other. I wish to create a joint between B and A. When I ...
1
vote
1answer
463 views

Box2D: Efficient method to create b2Chainshapes for a tile-based map?

I'm working on a platforming game with tile based levels. I store the collision model for my tileset in an array. This is how the collision model for a 4x4 tilesheet would look like (I can't post ...
1
vote
0answers
194 views

beginContact triggered more than once on some objects

Short version: It looks like beginContact is detecting continuous collisions. I'd like to avoid that. Long version : I use Box2Dweb to write a 2D platformer. It's my first game using this lib, and, ...
0
votes
1answer
335 views

Is there a “box2d without physics” lib (only for collision detection)?

Box2d Collision detection algorithms are probably the best ones out there. Unfortunately, they are bundled together with a realistic physics engine that I don't need. Is there an open source project ...
8
votes
1answer
275 views

In Box2D, how can I get the compression force on a specific body?

I'm using Box2D. As you can see, there are three dynamic bodies connected to each other (think of it as a table from front view). LEG1 and LEG2 are connected to the static body (it's the ground ...
1
vote
0answers
995 views

Why do restitution values less than one still cause infinite bouncing in Box2D?

I'm currently trying to implement basketball bouncing into my game using Box2d (jBox2d technically), but I'm a bit confused about restitution. While trying to create the ball in the testbed first, ...
4
votes
1answer
542 views

Collision Filtering in Box2D

I have four bodies in my Box2D World. Each are polygon shape, with some physics parameters. Now when the game start, I need one of the bodies from the World (BodyA) to not be allowed to collide with ...
5
votes
1answer
619 views

box2d with lines

I have a very simple platform game builder and I've specified the ceilings, walls and floor as line segments. A line has a winding, or normal; you can determine the direction that a line should be ...
3
votes
1answer
323 views

What algorithms exist for generating collision geometry from an image?

I am currently working on a game using SFML and Box2D. I am interested in generating collision geometry from the sprite data that I load into SFML. So, for example, an algorithm that would do this ...
0
votes
1answer
533 views

Cocos2d Box2d contact listener call different method in collided object

I have the building object, wen it hit with other, i want to call some method inside it. Building.mm -(void)printTest { NSLog(@"printTest method work correctly"); } in my ContactListener i ...
1
vote
2answers
220 views

Box 2D Collision Question

I am very new to Box 2D Physics world. I wanted to know how to collide 2 bodies when one is Dynamic and other is Kinematic. The whole Scenario is explained below: I have 3 balls in total. I want to ...
5
votes
1answer
483 views

Do I need to roll my own polygon segmentation algorithm to automate Box2d body creation from a tile map?

Before re-inventing the wheel I figured I'd ask: I'm working on a tile-based 2d-maze level generator for cocos2d + box2d. The idea is: I'm using one of the well-known graph traversal algorithms to ...
1
vote
1answer
653 views

Check for bodies within a specific circle in Box2D

I'm trying to find positions to insert new bodies into my world. For that, I'd like to have a "free" spot where this body wouldn't overlap with anything else. So my plan was to sample "random" ...
0
votes
2answers
3k views

Box2d and sprites

i have really little practice with box2d, but basically it seems to me that it is possible to attach to every sprite (in a 2d game) a box2d shape (that is, a bounding box enclosing the sprite itself) ...
2
votes
1answer
230 views

Box 2d and really complex big shapes

I intended to use jbox2d for my project. But as I went deeper into it's manual I'd found out that it supports dynamic objects between 0.1 and 10 meters (if use scaling and assume that 0.1 is smallest ...
2
votes
1answer
886 views

How to detect collisions in AS3?

I'm trying to make a simple game, when the ball falls into certain block, you win. Mechanics: The ball falls through several obstacles, in the end there are two blocks, if the ball touches the left ...
2
votes
3answers
4k views

Clean way to detect collision of object with box2d

I have been looking into box2d (in java with libgdx) lately and have been trying to create my own custom bounce effect (I increase the Restitution after the first bounce) To do this as a test I ...
1
vote
1answer
2k views

How can I cancel a contact in a b2ContactListener?

To know when contacts happen we can derive from b2ContactListener and implement our own solution which is great. I'm wondering is there anyway we can cancel a contact, that is to say when we hit begin ...
1
vote
2answers
592 views

Ball bouncing within polygon

I saw there are quite a number of articles and sample code regarding ball bouncing within a rectangle. Is there any articles or sample code regarding ball bouncing within a polygon? I try to look ...
12
votes
5answers
3k views

2D Rope Collision Detection

I'm wanting to create a rope that can collide with objects like in the following youtube video: 2D Game Physics Rope I'm thinking that you implement the verlet integration which uses points and ...