|
@@ -444,12 +444,6 @@ var BABYLON;
|
|
Tools.CreateScreenshot = function (engine, camera, size, successCallback) {
|
|
Tools.CreateScreenshot = function (engine, camera, size, successCallback) {
|
|
var width;
|
|
var width;
|
|
var height;
|
|
var height;
|
|
- var scene = camera.getScene();
|
|
|
|
- var previousCamera = null;
|
|
|
|
- if (scene.activeCamera !== camera) {
|
|
|
|
- previousCamera = scene.activeCamera;
|
|
|
|
- scene.activeCamera = camera;
|
|
|
|
- }
|
|
|
|
//If a precision value is specified
|
|
//If a precision value is specified
|
|
if (size.precision) {
|
|
if (size.precision) {
|
|
width = Math.round(engine.getRenderWidth() * size.precision);
|
|
width = Math.round(engine.getRenderWidth() * size.precision);
|
|
@@ -478,6 +472,12 @@ var BABYLON;
|
|
Tools.Error("Invalid 'size' parameter !");
|
|
Tools.Error("Invalid 'size' parameter !");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ var scene = camera.getScene();
|
|
|
|
+ var previousCamera = null;
|
|
|
|
+ if (scene.activeCamera !== camera) {
|
|
|
|
+ previousCamera = scene.activeCamera;
|
|
|
|
+ scene.activeCamera = camera;
|
|
|
|
+ }
|
|
//At this point size can be a number, or an object (according to engine.prototype.createRenderTargetTexture method)
|
|
//At this point size can be a number, or an object (according to engine.prototype.createRenderTargetTexture method)
|
|
var texture = new BABYLON.RenderTargetTexture("screenShot", size, scene, false, false);
|
|
var texture = new BABYLON.RenderTargetTexture("screenShot", size, scene, false, false);
|
|
texture.renderList = scene.meshes;
|
|
texture.renderList = scene.meshes;
|