Пример #1
0
// BodyNew creates a new body.
func BodyNew(m, i float64) Body {
	b := cpBody(C.cpBodyNew(C.cpFloat(m), C.cpFloat(i)))
	bodyDataMap[b] = &bodyData{}
	return b
}
Пример #2
0
func NewBody(mass float64, moment float64) *Body {
	var cpbody *C.cpBody = C.cpBodyNew(C.cpFloat(mass), C.cpFloat(moment))
	body := Body{cpbody}
	bodyLookup[cpbody] = &body
	return &body
}
Пример #3
0
func NewBody(mass, moment float32) Body {
	return Body{
		body: C.cpBodyNew(f(mass), f(moment))}
}