百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
C

cp

> 编程语言
开源

一个纯粹的 Go 物理库,不依赖任何其他库。非官方的 Chipmunk2D 移植。

396 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个纯粹的 Go 物理库,不依赖任何其他库。非官方的 Chipmunk2D 移植。

cp

Go port of Chipmunk2D physics library.

go
import "github.com/jakecoffman/cp/v2"

Project status

Stable -- most features are implemented and the demos are very close to Chipmunk2D demos.

Examples

  • github.com/jakecoffman/cp-examples contains the port of all of the Chipmunk2D demos.
  • github.com/hajimehoshi/ebiten/blob/main/examples/chipmunk/main.go is an example using Ebitengine
  • github.com/gen2brain/raylib-go/blob/master/examples/physics/chipmunk/main.go is an example with raylib's Go port

Documentation

The official chipmunk docs are a really good place to start: https://chipmunk-physics.net/release/ChipmunkLatest-Docs/

Features

Same features as Chipmunk2D:

  • 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.
  • No external dependencies.
  • Many language bindings available.
  • Simple, read the documentation and see!
  • Unrestrictive MIT license

Issues· 2 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Gochipmunk2dphysicsphysics-2d

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言