Hello.
I've just started with Chipmunk and am trying to do something very basic for, essentially, a science experiment, of all things.
I basically need to push a bunch of airplane like shapes together and see how they naturally 'fit' together.
So I've created three poly shapes (since the overall airplane form is non-convex).
One for the fuselage and two mirrored shapes for the the wings. All are convex.
I've copied much of the code in the Moonbuggy example to get started.
I've added the three shapes to a single 'plane' cpBody.
I've done this in a function so I can create a bunch of planes.
The results:
The parts stick together correctly but collisions between airplanes are not working as hoped.
What I seem to be getting is wing shapes correctly colliding with the fuselages but wings not correctly colliding with other wings (of other airplanes, of course).
The results seem a bit sporadic so I'm wondering if it may be related to some timestep controls or other tuning.
I've played with my timestep as well as cpSpaceResizeStaticHash and cpSpaceResizeActiveHash to no avail.
It really looks like there is no collision detection going on with some wings.
I'm not using any callbacks. I'm simply trying to get something approximating basic collisions.
I've also tried changing the group parameter for each plane but, assuming I'm doing it correctly, that doesn't help.
I looked for an example or demo that includes a composite shape but can't find any.
If anyone has any ideas to help I'd love to hear them. Thanks very much!
Collision on Multiple Shape Body
-
- Posts: 2
- Joined: Mon Jan 19, 2009 8:57 pm
- Contact:
-
- Posts: 157
- Joined: Mon Aug 20, 2007 12:53 pm
- Location: London, UK
- Contact:
Re: Collision on Multiple Shape Body
Problems like this are often caused by incorrect polygon winding. Have you checked this? If you mirrored the wing from one side to the other, that might mean one wing is incorrectly wound.
-
- Posts: 2
- Joined: Mon Jan 19, 2009 8:57 pm
- Contact:
Re: Collision on Multiple Shape Body
Hey! Thanks! That was the problem after all. I had quickly mirrored the verts from one wing to another.
I wasn't keeping close enough watch on that issue when I was building my geometry.
Next time I'll be more careful!
You're a king!
I wasn't keeping close enough watch on that issue when I was building my geometry.
Next time I'll be more careful!
You're a king!
Who is online
Users browsing this forum: Bing [Bot] and 3 guests