(cache *B2SimplexCache)
| 295 | } |
| 296 | |
| 297 | func (simplex B2Simplex) WriteCache(cache *B2SimplexCache) { |
| 298 | cache.Metric = simplex.GetMetric() |
| 299 | cache.Count = simplex.M_count |
| 300 | vertices := &simplex.M_vs |
| 301 | for i := 0; i < simplex.M_count; i++ { |
| 302 | cache.IndexA[i] = vertices[i].IndexA |
| 303 | cache.IndexB[i] = vertices[i].IndexB |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | func (simplex B2Simplex) GetSearchDirection() B2Vec2 { |
| 308 | switch simplex.M_count { |