Esempio n. 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)}
}
Esempio n. 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)
}
Esempio n. 3
0
func NewBoxShape(body Body, width, height float32) Shape {
	return Shape{
		shape: C.cpBoxShapeNew(body.body, f(width), f(height)),
	}
}