示例#1
0
// BoxShapeNew creates a new box shape.
func BoxShapeNew(b Body, width, height float64) Shape {
	s := C.cpBoxShapeNew(b.c(), C.cpFloat(width), C.cpFloat(height))
	return PolyShape{cpshape(s)}
}
示例#2
0
func NewBoxShape(body *Body, width float64, height float64) *Shape {
	var cpshape *C.cpShape = C.cpBoxShapeNew(body.CPBody, C.cpFloat(width), C.cpFloat(height))
	return createAndRegister(cpshape)
}
示例#3
0
文件: chipmunk.go 项目: andrebq/exp
func NewBoxShape(body Body, width, height float32) Shape {
	return Shape{
		shape: C.cpBoxShapeNew(body.body, f(width), f(height)),
	}
}