What can I say? I try this again today and now the
snapshotting works and my scale hack throws it out of wack. Uhhh. I know I wasn't booching it and running out-of-synch code together, because everything's in this class and I had loads of trace logging in here when I was working with it on monday. I wouldn't believe myself if I hadn't been there. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@466 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -7,8 +7,6 @@ import flash.display.Bitmap;
|
||||
import flash.display.BitmapData;
|
||||
import flash.display.Sprite;
|
||||
|
||||
import flash.geom.Matrix;
|
||||
|
||||
import flash.media.Camera;
|
||||
import flash.media.Video;
|
||||
|
||||
@@ -107,10 +105,7 @@ public class CameraSnapshotter extends Sprite
|
||||
return; // throw exception?
|
||||
}
|
||||
|
||||
// for some reason the video seems to always be locked at 160x120 when we try to
|
||||
// draw it, so we do some scaling...
|
||||
var matrix :Matrix = new Matrix(_camera.width / 160, 0, 0, _camera.height / 120);
|
||||
_bitmap.bitmapData.draw(_video, matrix);
|
||||
_bitmap.bitmapData.draw(_video);
|
||||
|
||||
if (_video.parent != null) {
|
||||
removeChild(_video);
|
||||
|
||||
@@ -47,7 +47,7 @@ public class MathUtil
|
||||
*/
|
||||
public static function normalizeRadians (radians :Number) :Number
|
||||
{
|
||||
var twopi :Number = Math.PI * 2;
|
||||
const twopi :Number = Math.PI * 2;
|
||||
var norm :Number = radians % twopi;
|
||||
return (norm >= 0) ? norm : (norm + twopi);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user