MCPcopy Index your code
hub / github.com/EngoEngine/engo / TestMatrixRotate

Function TestMatrixRotate

math_test.go:1326–1395  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1324}
1325
1326func TestMatrixRotate(t *testing.T) {
1327 data := []struct {
1328 matrix, expected []float32
1329 rotation float32
1330 }{
1331 {
1332 rotation: 0,
1333 matrix: []float32{
1334 1, 2, 3,
1335 6, 5, 4,
1336 7, 8, 9,
1337 },
1338 expected: []float32{
1339 1, 2, 3,
1340 6, 5, 4,
1341 7, 8, 9,
1342 },
1343 },
1344 {
1345 rotation: 35,
1346 matrix: []float32{
1347 1, 2, 3,
1348 6, 5, 4,
1349 7, 8, 9,
1350 },
1351 expected: []float32{
1352 4.2606106, 4.5061865, 4.751762,
1353 4.341336, 2.9486074, 1.5558789,
1354 7, 8, 9,
1355 },
1356 },
1357 {
1358 rotation: -35,
1359 matrix: []float32{
1360 1, 2, 3,
1361 6, 5, 4,
1362 7, 8, 9,
1363 },
1364 expected: []float32{
1365 -2.6223066, -1.2295781, 0.16315031,
1366 5.4884887, 5.2429132, 4.9973373,
1367 7, 8, 9,
1368 },
1369 },
1370 {
1371 rotation: 90,
1372 matrix: []float32{
1373 1, 2, 3,
1374 6, 5, 4,
1375 7, 8, 9,
1376 },
1377 expected: []float32{
1378 6, 5, 4,
1379 -1, -2, -3,
1380 7, 8, 9,
1381 },
1382 },
1383 }

Callers

nothing calls this directly

Calls 4

IdentityMatrixFunction · 0.85
FloatEqualFunction · 0.85
RotateMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected