示例#1
0
// CircleShapeNew creates a new circle shape.
func CircleShapeNew(body Body, radius float64, offset Vect) CircleShape {
	s := C.cpCircleShapeNew(body.c(), C.cpFloat(radius), offset.c())
	return CircleShape{cpshape(s)}
}
示例#2
0
func NewCircleShape(body *Body, radius float64, offset Vect) *Shape {
	var cpshape *C.cpShape = C.cpCircleShapeNew(body.CPBody, C.cpFloat(radius), offset.CPVect)
	return createAndRegister(cpshape)
}
示例#3
0
文件: chipmunk.go 项目: andrebq/exp
func NewCircleShape(body Body, radius float32, center Vect) Shape {
	return Shape{
		shape: C.cpCircleShapeNew(body.body, f(radius), C.cpVect(center)),
	}
}