Example #1
0
func (s *Space) SetGravity(g Vect) {
	C.cpSpaceSetGravity(s.s, C.cpVect(g))
}
Example #2
0
func MomentForCircle(mass, innerDiameter, outerDiameter float32, offset Vect) float32 {
	return float32(C.cpMomentForCircle(f(mass), f(innerDiameter), f(outerDiameter), C.cpVect(offset)))
}
Example #3
0
func NewCircleShape(body Body, radius float32, center Vect) Shape {
	return Shape{
		shape: C.cpCircleShapeNew(body.body, f(radius), C.cpVect(center)),
	}
}
Example #4
0
func (b *Body) SetPos(p Vect) {
	C.cpBodySetPos(b.body, C.cpVect(p))
}
Example #5
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)),
	}
}