Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
cp
✓ github.com/jakecoffman/cp
Simple Chipmunk physics simulation
package main
import (
"fmt"
"github.com/jakecoffman/cp"
)
func main() {
space := cp.NewSpace()
body := space.AddBody(cp.NewBody(1, cp.MomentForCircle(1, 0, 10, cp.Vector{})))
body.SetPosition(cp.Vector{X: 100, Y: 100})
for i := 0; i < 60; i++ {
space.Step(1.0 / 60.0)
}
fmt.Println(body.Position())
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
1.2.1latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.