func (a *Arbiter) GetContactPointSet() []*ContactPoint { points := make([]*ContactPoint, 0) rawSet := C.cpArbiterGetContactPointSet(a.CPArbiter) for i := 0; i < int(rawSet.count); i++ { point := ContactPoint{NewVectFromCPVect(rawSet.points[i].point), NewVectFromCPVect(rawSet.points[i].normal), float64(rawSet.points[i].dist)} points = append(points, &point) } return points }
// ContactPoints returns a contact set from an arbiter. func (a Arbiter) ContactPoints() []ContactPoint { set := C.cpArbiterGetContactPointSet(a.c()) c := make([]ContactPoint, int(set.count)) for i := range c { c[i] = ContactPoint{ cpVect(set.points[i].point), cpVect(set.points[i].normal), float64(set.points[i].dist)} } return c }