Esempio n. 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
}
Esempio n. 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
}
Esempio n. 3
0
func NewBody(mass, moment float32) Body {
	return Body{
		body: C.cpBodyNew(f(mass), f(moment))}
}