MCPcopy
hub / github.com/EngoEngine/engo / TestMatrixTranslate

Function TestMatrixTranslate

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

Source from the content-addressed store, hash-verified

881}
882
883func TestMatrixTranslate(t *testing.T) {
884 data := []struct {
885 matrix, expected []float32
886 transX, transY float32
887 }{
888 {
889 transX: 0,
890 transY: 0,
891 matrix: []float32{
892 0, 1, 2,
893 1, 2, 3,
894 2, 3, 4,
895 },
896 expected: []float32{
897 0, 1, 2,
898 1, 2, 3,
899 2, 3, 4,
900 },
901 },
902 {
903 transX: 15,
904 transY: 15,
905 matrix: []float32{
906 0, 1, 2,
907 1, 2, 3,
908 2, 3, 4,
909 },
910 expected: []float32{
911 0, 1, 2,
912 1, 2, 3,
913 17, 48, 79,
914 },
915 },
916 {
917 transX: -5,
918 transY: -5,
919 matrix: []float32{
920 0, 1, 2,
921 1, 2, 3,
922 2, 3, 4,
923 },
924 expected: []float32{
925 0, 1, 2,
926 1, 2, 3,
927 -3, -12, -21,
928 },
929 },
930 {
931 transX: 5,
932 transY: -5,
933 matrix: []float32{
934 0, 1, 2,
935 1, 2, 3,
936 2, 3, 4,
937 },
938 expected: []float32{
939 0, 1, 2,
940 1, 2, 3,

Callers

nothing calls this directly

Calls 4

IdentityMatrixFunction · 0.85
FloatEqualFunction · 0.85
TranslateMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected