MCPcopy Create free account
hub / github.com/egonelbre/exp / SetExtra6

Function SetExtra6

physicscompress/physics/encoding.go:217–238  ·  view source on GitHub ↗
(hist, base, cur []Cube)

Source from the content-addressed store, hash-verified

215}
216
217func SetExtra6(hist, base, cur []Cube) func(i int, v int32) {
218 N := len(base)
219 return func(i int, v int32) {
220 k := i % N
221 switch i / N {
222 case 0:
223 cur[k].A = v + base[k].A - (hist[k].A - base[k].A)
224 case 1:
225 cur[k].B = v + base[k].B - (hist[k].B - base[k].B)
226 case 2:
227 cur[k].C = v + base[k].C - (hist[k].C - base[k].C)
228 case 3:
229 cur[k].X = v + base[k].X - (hist[k].X - base[k].X)
230 case 4:
231 cur[k].Y = v + base[k].Y - (hist[k].Y - base[k].Y)
232 case 5:
233 cur[k].Z = v + base[k].Z - (hist[k].Z - base[k].Z)
234 default:
235 panic("invalid")
236 }
237 }
238}
239
240func SameBools(a, b []bool) {
241 if len(a) != len(b) {

Callers 1

DecodeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected