Skip to content

Commit cd53f6b

Browse files
Revert "Fix rotation around Y axis (#262)"
This reverts commit 048777a.
1 parent 048777a commit cd53f6b

File tree

3 files changed

+5
-29
lines changed

3 files changed

+5
-29
lines changed

lib/src/vector_math/matrix3.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -556,11 +556,11 @@ class Matrix3 {
556556
final s = math.sin(radians);
557557
_m3storage[0] = c;
558558
_m3storage[1] = 0.0;
559-
_m3storage[2] = -s;
559+
_m3storage[2] = s;
560560
_m3storage[3] = 0.0;
561561
_m3storage[4] = 1.0;
562562
_m3storage[5] = 0.0;
563-
_m3storage[6] = s;
563+
_m3storage[6] = -s;
564564
_m3storage[7] = 0.0;
565565
_m3storage[8] = c;
566566
}

lib/src/vector_math_64/matrix3.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -556,11 +556,11 @@ class Matrix3 {
556556
final s = math.sin(radians);
557557
_m3storage[0] = c;
558558
_m3storage[1] = 0.0;
559-
_m3storage[2] = -s;
559+
_m3storage[2] = s;
560560
_m3storage[3] = 0.0;
561561
_m3storage[4] = 1.0;
562562
_m3storage[5] = 0.0;
563-
_m3storage[6] = s;
563+
_m3storage[6] = -s;
564564
_m3storage[7] = 0.0;
565565
_m3storage[8] = c;
566566
}

test/matrix3_test.dart

+1-25
Original file line numberDiff line numberDiff line change
@@ -194,32 +194,11 @@ void testMatrix3Transform() {
194194

195195
relativeTest(rotX.transformed(input), input);
196196
relativeTest(rotY.transformed(input),
197-
Vector3(1.0 / math.sqrt(2.0), 0.0, -1.0 / math.sqrt(2.0)));
197+
Vector3(1.0 / math.sqrt(2.0), 0.0, 1.0 / math.sqrt(2.0)));
198198
relativeTest(rotZ.transformed(input),
199199
Vector3(1.0 / math.sqrt(2.0), 1.0 / math.sqrt(2.0), 0.0));
200200
}
201201

202-
void testMatrix3RotationX() {
203-
final rotX = Matrix3.rotationX(math.pi / 2);
204-
final input = Vector3(0.0, 1.0, 0.0);
205-
206-
relativeTest(rotX.transformed(input), Vector3(0.0, 0.0, 1.0));
207-
}
208-
209-
void testMatrix3RotationY() {
210-
final rotY = Matrix3.rotationY(math.pi / 2);
211-
final input = Vector3(0.0, 0.0, 1.0);
212-
213-
relativeTest(rotY.transformed(input), Vector3(1.0, 0.0, 0.0));
214-
}
215-
216-
void testMatrix3RotationZ() {
217-
final rotZ = Matrix3.rotationZ(math.pi / 2);
218-
final input = Vector3(1.0, 0.0, 0.0);
219-
220-
relativeTest(rotZ.transformed(input), Vector3(0.0, 1.0, 0.0));
221-
}
222-
223202
void testMatrix3Transform2() {
224203
final rotZ = Matrix3.rotationZ(math.pi / 4);
225204
final trans = Matrix3(1.0, 0.0, 3.0, 0.0, 1.0, 2.0, 3.0, 2.0, 1.0);
@@ -355,9 +334,6 @@ void main() {
355334
test('transform 2D', testMatrix3Transform2);
356335
test('rotation 2D', testMatrix3AbsoluteRotate2);
357336
test('transform', testMatrix3Transform);
358-
test('rotation 3D x', testMatrix3RotationX);
359-
test('rotation 3D y', testMatrix3RotationY);
360-
test('rotation 3D z', testMatrix3RotationZ);
361337
test('constructor', testMatrix3ConstructorCopy);
362338
test('inversion', testMatrix3Inversion);
363339
test('dot product', testMatrix3Dot);

0 commit comments

Comments
 (0)