These Go wrappers are now part of Azul3D!
See documentation online: http://azul3d.org/native/cp.v1
Do not use this repository anymore!
Chipmunk 2D physics wrapper for Go.
Home Page: http://azul3d.org/native/cp.v1
These Go wrappers are now part of Azul3D!
See documentation online: http://azul3d.org/native/cp.v1
Do not use this repository anymore!
Still investigating cause of this, here's test code using a minimal implementation of SpaceDebugDrawOptions.
package main
import (
cp "gopkg.in/slimsag/cp.v1"
)
func main() {
space := cp.SpaceNew()
body := cp.BodyNew(10, cp.MomentForCircle(1, 0, 32, cp.V(0, 0)))
space.AddBody(body)
space.AddShape(body.CircleShapeNew(32, cp.V(0, 0)))
debugDraw := &cp.SpaceDebugDrawOptions{
DrawCircle: func(pos cp.Vect, angle, radius float64,
outlineColor, fillColor cp.SpaceDebugColor, data interface{}) {
},
DrawSegment: func(a, b cp.Vect, color cp.SpaceDebugColor,
data interface{}) {
},
DrawFatSegment: func(a, b cp.Vect, radius float64,
outlineColor, fillColor cp.SpaceDebugColor, data interface{}) {
},
DrawPolygon: func(verts []cp.Vect, radius float64,
outlineColor, fillColor cp.SpaceDebugColor, data interface{}) {
},
DrawDot: func(size float64, pos cp.Vect,
color cp.SpaceDebugColor, data interface{}) {
},
ColorForShape: func(shape *cp.Shape, data interface{}) cp.SpaceDebugColor {
return cp.SpaceDebugColor{}
},
Flags: cp.SPACE_DEBUG_DRAW_SHAPES,
ShapeOutlineColor: cp.SpaceDebugColor{},
ConstraintColor: cp.SpaceDebugColor{},
CollisionPointColor: cp.SpaceDebugColor{},
Data: struct{}{},
}
space.DebugDraw(debugDraw)
}
Which results in the following crash
SIGSEGV: segmentation violation
PC=0x7f7578
signal arrived during cgo execution
runtime.cgocall(0x410c40, 0x7fa005321ed8)
/usr/local/go/src/pkg/runtime/cgocall.c:149 +0x11b fp=0x7fa005321ec0
gopkg.in/slimsag/cp%2ev1._Cfunc_cpSpaceDebugDraw(0x1245290, 0xc210042000)
gopkg.in/slimsag/cp.v1/_obj/_cgo_defun.c:2510 +0x31 fp=0x7fa005321ed8
gopkg.in/slimsag/cp%2ev1.(*Space).DebugDraw(0xc210036030, 0xc210041000)
/home/dave/gocode/src/gopkg.in/slimsag/cp.v1/space.go:662 +0x117 fp=0x7fa005321ef8
main.main()
/tmp/crash/crash.go:40 +0x1f6 fp=0x7fa005321f48
runtime.main()
/usr/local/go/src/pkg/runtime/proc.c:220 +0x11f fp=0x7fa005321fa0
runtime.goexit()
/usr/local/go/src/pkg/runtime/proc.c:1394 fp=0x7fa005321fa8
goroutine 3 [syscall]:
runtime.goexit()
/usr/local/go/src/pkg/runtime/proc.c:1394
rax 0x0
rbx 0xc210042000
rcx 0x0
rdx 0x5
rdi 0x1245d00
rsi 0xc210000008
rbp 0x7fff8b917230
rsp 0x7fff8b9171a8
r8 0xc210001120
r9 0x7fa005321e70
r10 0x0
r11 0x0
r12 0x1245d00
r13 0xc210000008
r14 0x1245be0
r15 0x0
rip 0x7f7578
rflags 0x10246
cs 0x33
fs 0x0
gs 0x0
exit status 2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.