@@ -50,17 +50,15 @@ package {
50
50
for (var i: int = 1 ; i < 180 ; i++ ) {
51
51
var pp: PerspectiveProjection = new PerspectiveProjection();
52
52
pp. fieldOfView = i;
53
- var fl: Number = pp. focalLength;
54
- trace ("FOV to FL" , i, roundN(fl, 100 )); // FIXME: Large numerical errors
53
+ trace ("FOV to FL" , i, pp. focalLength);
55
54
}
56
55
}
57
56
58
57
private function TestFLtoFOV (): void {
59
58
for (var i: int = 1 ; i < 1000 ; i++ ) {
60
59
var pp: PerspectiveProjection = new PerspectiveProjection();
61
60
pp. focalLength = i;
62
- var fl: Number = pp. fieldOfView;
63
- trace ("FL to FOV" , i, roundN(fl, 100000000000 ));
61
+ trace ("FL to FOV" , i, pp. fieldOfView);
64
62
}
65
63
}
66
64
@@ -108,35 +106,34 @@ package {
108
106
}
109
107
110
108
private function TestToMatrix3D (): void {
111
- var precision : Number = 100 ;
112
109
var pp: PerspectiveProjection = new PerspectiveProjection();
113
110
114
111
trace ("// toMatrix3D(default)" );
115
- trace (roundVecN( pp. toMatrix3D(). rawData, precision ) );
112
+ trace (pp. toMatrix3D(). rawData);
116
113
117
114
trace ("// toMatrix3D(FOV: 1)" );
118
115
pp. fieldOfView = 1 ;
119
- trace (roundVecN( pp. toMatrix3D(). rawData, precision ) );
116
+ trace (pp. toMatrix3D(). rawData);
120
117
121
118
trace ("// toMatrix3D(FOV: 100)" );
122
119
pp. fieldOfView = 100 ;
123
- trace (roundVecN( pp. toMatrix3D(). rawData, precision ) );
120
+ trace (pp. toMatrix3D(). rawData);
124
121
125
122
trace ("// toMatrix3D(FOV: 179)" );
126
123
pp. fieldOfView = 179 ;
127
- trace (roundVecN( pp. toMatrix3D(). rawData, precision ) );
124
+ trace (pp. toMatrix3D(). rawData);
128
125
129
126
trace ("// toMatrix3D(FL: 1)" );
130
127
pp. focalLength = 1 ;
131
- trace (roundVecN( pp. toMatrix3D(). rawData, precision ) );
128
+ trace (pp. toMatrix3D(). rawData);
132
129
133
130
trace ("// toMatrix3D(FL: 10)" );
134
131
pp. focalLength = 10 ;
135
- trace (roundVecN( pp. toMatrix3D(). rawData, precision ) );
132
+ trace (pp. toMatrix3D(). rawData);
136
133
137
134
trace ("// toMatrix3D(FL: 10000)" );
138
135
pp. focalLength = 10000 ;
139
- trace (roundVecN( pp. toMatrix3D(). rawData, precision ) );
136
+ trace (pp. toMatrix3D(). rawData);
140
137
}
141
138
142
139
private function TestTransform (): void {
@@ -179,20 +176,10 @@ package {
179
176
private function printProps (pp : PerspectiveProjection ): void {
180
177
trace (" perspectiveProjection = " + pp);
181
178
if (pp) {
182
- trace (" perspectiveProjection.fieldOfView = " + roundN( pp. fieldOfView, 100000000000 ) );
183
- trace (" perspectiveProjection.focalLength = " + roundN( pp. focalLength, 100 )) ; // FIXME: Large numerical errors
179
+ trace (" perspectiveProjection.fieldOfView = " + pp. fieldOfView);
180
+ trace (" perspectiveProjection.focalLength = " + pp. focalLength) ;
184
181
trace (" perspectiveProjection.projectionCenter = " + pp. projectionCenter);
185
182
}
186
183
}
187
-
188
- private function roundN (n : Number , precision : Number ): Number {
189
- return Math . round (n * precision ) / precision ;
190
- }
191
-
192
- private function roundVecN (v : Vector .<Number>, precision : Number ): Vector.<Number > {
193
- return v. map (
194
- function (n: Number , _ , _ ): Number {return roundN(n, precision ); }
195
- );
196
- }
197
184
}
198
185
}
0 commit comments