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

Method GetSupport

CollisionB2Distance.go:115–127  ·  view source on GitHub ↗
(d B2Vec2)

Source from the content-addressed store, hash-verified

113}
114
115func (p B2DistanceProxy) GetSupport(d B2Vec2) int {
116 bestIndex := 0
117 bestValue := B2Vec2Dot(p.M_vertices[0], d)
118 for i := 1; i < p.M_count; i++ {
119 value := B2Vec2Dot(p.M_vertices[i], d)
120 if value > bestValue {
121 bestIndex = i
122 bestValue = value
123 }
124 }
125
126 return bestIndex
127}
128
129func (p B2DistanceProxy) GetSupportVertex(d B2Vec2) B2Vec2 {
130 bestIndex := 0

Callers 2

B2DistanceFunction · 0.80
FindMinSeparationMethod · 0.80

Calls 1

B2Vec2DotFunction · 0.85

Tested by

no test coverage detected