MCPcopy Create free account
hub / github.com/ByteArena/box2d / GetMetric

Method GetMetric

CollisionB2Distance.go:400–422  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

398}
399
400func (simplex B2Simplex) GetMetric() float64 {
401 switch simplex.M_count {
402 case 0:
403 B2Assert(false)
404 return 0.0
405
406 case 1:
407 return 0.0
408
409 case 2:
410 return B2Vec2Distance(simplex.M_vs[0].W, simplex.M_vs[1].W)
411
412 case 3:
413 return B2Vec2Cross(
414 B2Vec2Sub(simplex.M_vs[1].W, simplex.M_vs[0].W),
415 B2Vec2Sub(simplex.M_vs[2].W, simplex.M_vs[0].W),
416 )
417
418 default:
419 B2Assert(false)
420 return 0.0
421 }
422}
423
424////////////////////////////////////////////////////
425

Callers 2

ReadCacheMethod · 0.95
WriteCacheMethod · 0.95

Calls 4

B2AssertFunction · 0.85
B2Vec2DistanceFunction · 0.85
B2Vec2CrossFunction · 0.85
B2Vec2SubFunction · 0.85

Tested by

no test coverage detected