84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
R(matrix2 = [OFMatrix4x4 identityMatrix]) &&
R([matrix2 translateWithVector: OFMakeVector3D(1, 2, 3)]) &&
R(point =
[matrix2 transformedVector: OFMakeVector4D(2, 3, 4, 1)]) &&
point.x == 3 && point.y == 5 && point.z == 7 && point.w == 1)
TEST(@"-[scaleWithVector:]",
R([matrix2 scaleWithVector: OFMakeVector3D(-1, 0.5, 2)]) &&
R(point =
[matrix2 transformedVector: OFMakeVector4D(2, 3, 4, 1)]) &&
point.x == -3 && point.y == 2.5 && point.z == 14 && point.w == 1)
TEST(@"-[transformedVector:]",
R((point =
[matrix transformedVector: OFMakeVector4D(1, 2, 3, 1)])) &&
point.x == 18 && point.y == 46 && point.z == 74 && point.w == 102)
objc_autoreleasePoolPop(pool);
}
@end
|
|
|
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
R(matrix2 = [OFMatrix4x4 identityMatrix]) &&
R([matrix2 translateWithVector: OFMakeVector3D(1, 2, 3)]) &&
R(point =
[matrix2 transformedVector: OFMakeVector4D(2, 3, 4, 1)]) &&
point.x == 3 && point.y == 5 && point.z == 7 && point.w == 1)
TEST(@"-[scaleWithVector:]",
R([matrix2 scaleWithVector: OFMakeVector3D(-1, 0.5f, 2)]) &&
R(point =
[matrix2 transformedVector: OFMakeVector4D(2, 3, 4, 1)]) &&
point.x == -3 && point.y == 2.5 && point.z == 14 && point.w == 1)
TEST(@"-[transformedVector:]",
R((point =
[matrix transformedVector: OFMakeVector4D(1, 2, 3, 1)])) &&
point.x == 18 && point.y == 46 && point.z == 74 && point.w == 102)
objc_autoreleasePoolPop(pool);
}
@end
|