@@ -194,11 +194,32 @@ void testMatrix3Transform() {
194
194
195
195
relativeTest (rotX.transformed (input), input);
196
196
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 )));
198
198
relativeTest (rotZ.transformed (input),
199
199
Vector3 (1.0 / math.sqrt (2.0 ), 1.0 / math.sqrt (2.0 ), 0.0 ));
200
200
}
201
201
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
+
202
223
void testMatrix3Transform2 () {
203
224
final rotZ = Matrix3 .rotationZ (math.pi / 4 );
204
225
final trans = Matrix3 (1.0 , 0.0 , 3.0 , 0.0 , 1.0 , 2.0 , 3.0 , 2.0 , 1.0 );
@@ -334,6 +355,9 @@ void main() {
334
355
test ('transform 2D' , testMatrix3Transform2);
335
356
test ('rotation 2D' , testMatrix3AbsoluteRotate2);
336
357
test ('transform' , testMatrix3Transform);
358
+ test ('rotation 3D x' , testMatrix3RotationX);
359
+ test ('rotation 3D y' , testMatrix3RotationY);
360
+ test ('rotation 3D z' , testMatrix3RotationZ);
337
361
test ('constructor' , testMatrix3ConstructorCopy);
338
362
test ('inversion' , testMatrix3Inversion);
339
363
test ('dot product' , testMatrix3Dot);
0 commit comments