• Stars
    star
    2,097
  • Rank 21,126 (Top 0.5 %)
  • Language
    C
  • License
    MIT License
  • Created almost 13 years ago
  • Updated 20 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A fast and lightweight 2D game physics library.

NEW IN CHIPMUNK 7

Chipmunk 7 is complete and now includes the ARM NEON optimizations, the autogeometry code, and the mulithreaded solver.

The latest programming guide is available.

ABOUT:

Chipmunk2D is a simple, lightweight, fast and portable 2D rigid body physics library written in C. It’s licensed under the unrestrictive, OSI approved MIT license. My aim is to give 2D developers access to the same quality of physics you find in newer 3D games. I hope you enjoy using Chipmunk2D!

FEATURES:

  • Designed specifically for 2D video games.
  • Circle, convex polygon, and beveled line segment collision primitives.
  • Multiple collision primitives can be attached to a single rigid body.
  • Fast broad phase collision detection by using a bounding box tree with great temporal coherence or a spatial hash.
  • Extremely fast impulse solving by utilizing Erin Catto’s contact persistence algorithm.
  • Supports sleeping objects that have come to rest to reduce the CPU load.
  • Support for collision event callbacks based on user definable object types types.
  • Flexible collision filtering system with layers, exclusion groups and callbacks.
    • Can be used to create all sorts of effects like one way platforms or buoyancy areas. (Examples included)
  • Supports nearest point, segment (raycasting), shape and bounding box queries to the collision detection system.
  • Collision impulses amounts can be retrieved for gameplay effects, sound effects, etc.
  • Large variety of joints – easily make vehicles, ragdolls, and more.
  • Joint callbacks.
    • Can be used to easily implement breakable or animated joints. (Examples included)
  • Maintains a contact graph of all colliding objects.
  • Lightweight C99 implementation with no external dependencies outside of the Std. C library.
  • Many language bindings available.
  • Simple, read the documentation and see!
  • Unrestrictive MIT license

CONTRACTING:

Howling Moon Software (my company) is available for contracting if you want to make the physics in your game really stand out. Given our unique experience with the library, we can help you use Chipmunk to its fullest potential. Feel free to contact us through our webpage: http://howlingmoonsoftware.com/

BUILDING:

Mac OS X: There is an included Xcode project file for building the static library and demo application. Alternatively you could use the CMake files or the macstatic.command script inside the xcode/ directory to build a static lib and package up the headers for you.

iPhone: A native Objective-C API is included. The Xcode project can build a static library with all the proper compiler settings. Alternatively, you can just run iphonestatic.command in the xcode/ directory. It will build you a fat library compiled as release for the device and debug for the simulator. After running it, you can simply drop the Chipmunk-iOS directory into your iPhone project!

UNIXes: A forum user was kind enough to make a set of CMake files for Chipmunk. This will require you to have CMake installed. To build run ‘cmake .’ then ‘make’. This should build a dynamic library, a static library, and the demo application. A number of people have had build errors on Ubuntu due to not having GLUT or libxmu installed.

Windows: Visual Studio projects are included in the msvc/ directory. While I try to make sure the MSVC 10 project is up to date, I don’t have MSVC 9 to keep that project updated regularly. It may not work. I’d appreciate a hand fixing it if that’s the case.

GET UP TO DATE:

If you got the source from a point release download, you might want to consider getting the latest source from GitHub. Bugs are fixed and new features are added regularly. Big changes are done in branches and tested before merging them in it’s rare for the point release downloads to be better or more bug free than the latest code.

Head on over to GitHub and experience the future TODAY! (Okay, so maybe it’s not that exciting.)

GETTING STARTED:

First of all, you can find the C API documentation in the doc/ directory.

A good starting point is to take a look at the included Demo application. The demos all just set up a Chipmunk simulation space and the demo app draws the graphics directly out of that. This makes it easy to see how the Chipmunk API works without worrying about the graphics code. You are free to use the demo drawing routines in your own projects, though it is certainly not the recommended way of drawing Chipmunk objects as it pokes around at the undocumented/private APIs of Chipmunk.

SUPPORT:

The best way to get support is to visit the Chipmunk Forums. There are plenty of people around using Chipmunk on the just about every platform I’ve ever heard of. If you are working on a commercial project and want some more direct help, Howling Moon Software is also available for contracting.

More Repositories

1

debugger.lua

A dependency free, embeddable debugger for Lua in a single file (.lua or .c)
Lua
711
star
2

Tina

Tina is a teeny tiny, header only, coroutine and job library.
C
249
star
3

Cocos2DShaderCookbook

A introductory guide to shaders with Cocos2D 3.1.
Objective-C
115
star
4

SpacePatrol

A high performance, large scale, deformable terrain example for Chipmunk Pro.
Objective-C
82
star
5

CocoRoids

Example game Cocos2D v3 using CCPhysics and SpriteBuilder.
Objective-C
63
star
6

CCPhysicsColorMatch

A simple CCPhysics based color matching game.
Objective-C
49
star
7

CloudBomber

Chipmunk Pro Autogeometry demo built on top of Cocos2D 2.0.
Objective-C
46
star
8

CCController

Use XBox, PlayStation (and other HID controllers) with Apple's GameController.framework.
Objective-C
32
star
9

ChipmunkShowcase

Chipmunk Pro Showcase app for iOS
Objective-C
28
star
10

UnofficialCocos2DTemplate

Cocos2D v3.4 template that does not require SpriteBuilder
Objective-C
26
star
11

veridian-expanse

Source code for the asteroid mining game I've been building.
C
20
star
12

ChipmunkColorMatch

A simple color matching game example for Chipmunk, Chipmunk Pro, Cocos2D and UIKit.
Objective-C
17
star
13

GalacticGuardian.spritebuilder

Open source Cocos2D/SpriteBuilder twin stick shooter.
Objective-C
15
star
14

LiFFT

The little FFT library
C
14
star
15

CausticCavern.spritebuilder

SpriteBuilder demo using some of the new 3.1 features.
Objective-C
14
star
16

critical-match

A hybrid platform/color matching game for NES.
C++
12
star
17

mini-lz4

A little lz4 implementation I made for fun.
Assembly
8
star
18

TwilightGolf

Open sourcing an old iPhone game we made.
C
8
star
19

love-debugger

A wrapper for debugger.lua for the Löve game engine.
Lua
8
star
20

Gemeralds

Pinball game using CocosBuilder and Chipmunk Pro to make the collision geometry.
Objective-C
7
star
21

InterglacticTransmissing

Interglactic Transmissing for NES
C
7
star
22

neslib-template

Template NES project in C using neslib.
C++
6
star
23

AngryChipmunks

A simple Cocos2D/ChipmunkPro example project.
Objective-C
5
star
24

slembcke.github.io

Website
JavaScript
4
star
25

streamingtest

Playing around with memory mapped bandwith with lz4
C
4
star
26

HotReloadingInC

C
3
star
27

Disasteroids2

Simple CCPhysics prototype game using GPL spritelib graphics.
Objective-C
3
star
28

flatpak-marathon

Flatpak build for Aleph One + Marathon 1, 2, and 3
Makefile
3
star
29

GCControllerTester

Extremely simple app that displays the values of an iOS 7 GCController (extended profile only).
Objective-C
3
star
30

elua.lua

ERB inspired templates for Lua.
Lua
2
star
31

libpng

Temporary libpng Xcode project repository for Cocos2D.
C
2
star
32

pixler

C library for creating NES games.
Assembly
2
star
33

PuzzleSnake

A little js / svg puzzle game
C
2
star
34

Super-City-Mayor

C++
2
star
35

SlapstickNES

Global Game Jam NES project template
C
2
star
36

ImageConvert

Extremely simple image conversion CLI tool for OS X.
Objective-C
1
star
37

MultiTouchObjectiveChipmunk

A simple Cocos2D 2.1 project demonstrating multi-touch physics with Objective-Chipmunk.
Objective-C
1
star
38

vscode-m68k

Gnu as m68k syntax highlighting for VSCode.
1
star
39

Blockade

Board game for the NES made during the 2021 Global Game Jam
C++
1
star
40

ggj22

Global Game Jam '22
Lua
1
star
41

AdventOfCode2020

Lua
1
star
42

iPhoneSnap2D

A simple ChipmunkPro/UIKit example of a physics board game.
Objective-C
1
star
43

tree-perf

Comparing performance of various AABB tree algorithms
C
1
star
44

over-crispd

Gene editing game for the NES inspired by Overcooked. Made for the Global Game Jam 2019.
C
1
star
45

ConcaveSprite

A simple example showing how to use Chipmunk Pro autogeometry to generate concave polygon shapes from Cocos2D sprites automatically.
Objective-C
1
star