Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

This is a friendly fork of the fast and lightweight 2D game physics library Chipmunk2D

License

NotificationsYou must be signed in to change notification settings

viblo/Munk2D

 
 

Repository files navigation

FORK INFO

The main purpose of this fork is to be a companion for the Python 2D physicslibraryPymunk which is built on Chipmunk2D. Given theslow pace of development of Chipmunk2D, and some unique requirements andopportunities of Pymunk this is something that have grown over a long time. Whatreally made me consider making this fork more formal was the discussionhere with Slembcke, thecreator of Chipmunk2D.

I do not foresee that I have the time, motivation or skills to really reviveChipmunk2D. However, I hope to incorporate minor new features, and a bunch offixes. The changes are mainly driven by what make sense from the Pymunk usecase. I do think many of these changes can be useful also to users outsidePymunk, and you are of course free to use the fork for other projects /languages as well.

/Victor 2025-04-08

ABOUT

This is a fork of the 2D physics libraryChipmunk2D. Munk2D is a simple,lightweight, fast and portable 2D rigid body physics library written in C. It'slicensed under the permissive MIT license. I hope you enjoy using Munk2D!

Expectations from Munk2D

  • Munk2D will add fixes for various issues, especially issues affecting Pymunk.
  • Munk2D will add or improve features useful for Pymunk.
  • Munk2D does not aim for ABI stability between versions.
  • Munk2D will try to avoid API breaking changes, but ultimately be less strictthan Chipmunk2D.
  • While Munk2D will not try to actively break features or targets, breakage ismore likely than with Chipmunk2D.
  • Testing of Munk2D will mainly happen through Pymunk, parts not useful fromPymunk (e.g. ObjectiveC support), will be untested and therefor likely tobreak over time.
  • While Munk2D is focused on Pymunk, I will happily accept PRs to fix or improveother parts of the code, or improvements to tests, documentation and so on.

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 greattemporal coherence or a spatial hash.
  • Extremely fast impulse solving by utilizing Erin Catto's contact persistencealgorithm.
  • Supports sleeping objects that have come to rest to reduce the CPU load.
  • Support for collision event callbacks based on user definable object types.
  • Flexible collision filtering system with layers, exclusion groups andcallbacks. ** Can be used to create all sorts of effects like one wayplatforms or buoyancy areas. (Examples included)
  • Supports nearest point, segment (raycasting), shape and bounding box queriesto the collision detection system.
  • Collision impulses amounts can be retrieved for gameplay effects, soundeffects, etc.
  • Large variety of joints - easily make vehicles, ragdolls, and more.
  • Joint callbacks. ** Can be used to easily implement breakable or animatedjoints. (Examples included)
  • Maintains a contact graph of all colliding objects.
  • Lightweight C99 implementation with no external dependencies outside the Std.C library.
  • Many language bindings available:http://chipmunk2d.net/bindingsAndPorts.php.
  • Simple, read the documentation:https://viblo.github.io/Munk2D/ and see!
  • Unrestrictive MIT license

BUILDING

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

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

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 demoapplication. A number of people have had build errors on Ubuntu due to nothaving GLUT or libxmu installed.

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

GET UP TO DATE

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

Head on over tohttps://github.com/viblo/Munk2D and experience the future TODAY!(Okay, so maybe it's not that exciting.)

GETTING STARTED

The C API documentation is in the docs/ directory.

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

SUPPORT

There is a forum for Chipmunk2D athttp://chipmunk2d.net/forum/ Unfortunatelyits very inactive nowadays, but much of the discussions are still relevant.

The best way to get support is to visit the Chipmunk Forums athttp://chipmunk2d.net/forum/. There are plenty of people around using Chipmunkon the just about every platform I've ever heard of. If you are working on acommercial project and want some more direct help, Howling Moon Software is alsoavailable for contracting,http://howlingmoonsoftware.com/.

CONTRACTING

Howling Moon Software (company of Chipmunk2D) is available for contracting ifyou want to make the physics in your game really stand out. Given their uniqueexperience with Chipmunk2D, they can help you use Chipmunk (and likely Munk2D)to its fullest potential. Feel free to contact them through their webpage:http://howlingmoonsoftware.com/

About

This is a friendly fork of the fast and lightweight 2D game physics library Chipmunk2D

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C66.2%
  • Objective-C31.7%
  • Other2.1%

[8]ページ先頭

©2009-2025 Movatter.jp