Пример #1
0
// SegmentShapeNew creates a new segment shape.
func SegmentShapeNew(body Body, a, b Vect, radius float64) SegmentShape {
	s := C.cpSegmentShapeNew(body.c(), a.c(), b.c(), C.cpFloat(radius))
	return SegmentShape{cpshape(s)}
}
Пример #2
0
func NewSegmentShape(body *Body, a Vect, b Vect, radius float64) *Shape {
	var cpshape *C.cpShape = C.cpSegmentShapeNew(body.CPBody, a.CPVect, b.CPVect, C.cpFloat(radius))
	return createAndRegister(cpshape)
}
Пример #3
0
func NewSegmentShape(body Body, a, b Vect, radius float32) Shape {
	return Shape{
		shape: C.cpSegmentShapeNew(body.body, C.cpVect(a), C.cpVect(b), f(radius)),
	}
}