Questions tagged [chipmunk]

Chipmunk is an open-source physics library written in C.

See: The Chipmunk Website

318 questions
1
vote
1 answer

Detecting collision with two or more shapes with Chipmunk

I wonder if anyone can suggest the best approach to detect collision between multiple shapes. I am using Chipmunk on an iPad with iOS 4.2 and Cocos2D 1.0 - I basically have a cpShape travelling around the iPad screen - there are two segment…
fedmest
  • 709
  • 5
  • 17
1
vote
1 answer

How to prevent fast moving objects passing through statics when calculating pi with colliding blocks

I am trying to implement a similar program to the following in Python using Pymunk and Pyglet. My current implementation works well at low velocities however at high speeds the block can pass through the static wall. This because in 1/60s clock…
cheese12345
  • 573
  • 1
  • 5
  • 15
1
vote
1 answer

chipmunks: how to make to objects stick together after they hit each other

Hi I am using chipmunks on my cocos2d project. I have two objects and when they collide, I like them to join and move together like one object? How can I do that? Thanks
Emmy
  • 3,949
  • 5
  • 28
  • 30
1
vote
1 answer

Collision callback problems (chipmunk + spaceManager)

I am trying to give the bottom wall that is created with addWindowContainmentWithFriction a collision callback, I don't know if I am doing it wrong. This is how I have been trying to do it. smgr.bottomWall->collision_type =…
Stephen
  • 499
  • 9
  • 28
1
vote
1 answer

Does Chipmunk/Pymumk have culling of objects that are outside screen boundary?

I found culling only under spatial hashing for collisions. I'm referring to the kind of backface culling performed by 3D graphics libraries, where anything that need not be visible isn't rendered. Does Chipmunk2D/Pymunk have any provision for not…
Nav
  • 19,885
  • 27
  • 92
  • 135
1
vote
1 answer

Help Logically setting up Layers for Good Game Design (involving SpaceManager Physics, Music, and Game Logic)

Im in the middle of creating my first iPhone game - I have a background in OOP and in particular C++ so I had some questions with regards to how best to logically setup layers while maintaining functionality. Currently I WANT for my game to have…
Salman
  • 494
  • 4
  • 18
1
vote
0 answers

Ruby Chipmunk remove object from space

So I'm writing a platforming game with Ruby, Gosu (ruby and C++ library for handling images, windows and other game-related things) and Chipmunk (physics library for ruby and C++) and I want to delete an enemy. This is the code I used to do…
Penguin
  • 21
  • 4
1
vote
3 answers

Is Chipmunk overkill for simple collision detection?

I'm working on a game where the physics are very simple. I just need to detect when a ball (point) hits a wall (line segment). There is no gravity, no friction, and the collisions are perfectly elastic. I've already written collision detection code,…
benzado
  • 82,288
  • 22
  • 110
  • 138
1
vote
1 answer

Units of velocity in Pymunk

I was wondering what the basic units of velocity are in Pymunk. If I put in a velocity of (50,50) does that correspond to 50 pixels/second in each direction? The API says that the units of angular velocity are rad/s but doesn't say anything about…
dottified
  • 45
  • 4
1
vote
2 answers

top down friction in pymunk

Been struggling with this for a couple of days, hard to find code examples on the net. I'm making a topdown game and having trouble getting the player to move on key press. At the moment i'm using add_force or add_impulse to move the player in a…
Joe
  • 11,147
  • 7
  • 49
  • 60
1
vote
1 answer

Rotating group of bodies in pymunk

I want to make a 2D grasping hand in pymunk, which can rotate, move up/down and to the sides and clench or extend its fingers, basically, the hand looks like 'U' letter. I tried to do it by making 3 separate bodies (palm, left finger, right finger)…
1
vote
0 answers

Compiling Chipmunk with Code::Blocks

I seem to be unable to compile chipmunk without compile errors, can anyone help me? I turned on C99 but I still get errors. Here's a few: C:\c++\ChipmunkLib\chipmunk.c:70: error: 'M_PI' undeclared (first use in this…
Chris
  • 515
  • 1
  • 6
  • 16
1
vote
1 answer

Chipmunk objects fall through floor at high velocities. Help?

I'm using Chipmunk cocos2d for what will ultimately be a sound-generation game where colliding particles make noise. But right now, I'm running into a problem: my particles keep falling through the floor! In the example "bouncing ball" templates,…
buildsucceeded
  • 4,203
  • 4
  • 34
  • 72
1
vote
1 answer

how to remove shape and body after a delay in collision callback (cocos2d-chipmunk)

can anyone help me to remove shape and body after a delay in collision callback. By using cpSpaceAddPostStepCallback(sapce, (cpPostStepFunc)postStepRemove, blockShape, NULL); i could safely remove the shape . But i need some delay before i call the…
user218404
1
vote
0 answers

How do I accomplish proper trajectory with a Cocos2d-x node using Chipmunk 2D impulses and rotation?

I'm building a game with Cocos2d-x version 3.13.1 and I've decided to go with the built-in physics engine (Chipmunk 2D) to accomplish animations and collision detection. I have a simple projectile called BulletUnit that inherits from cocos2d::Node.…
harrisonlee
  • 5,068
  • 4
  • 21
  • 20