|
@@ -747,6 +747,7 @@ function Renderer(container, context) { |
|
|
* @param {Object} [params] - Extra configuration parameters. |
|
|
* @param {Object} [params] - Extra configuration parameters. |
|
|
* @param {number} [params.roll] - Camera roll (in radians). |
|
|
* @param {number} [params.roll] - Camera roll (in radians). |
|
|
* @param {string} [params.returnImage] - Return rendered image? If specified, should be 'ImageBitmap', 'image/jpeg', or 'image/png'. |
|
|
* @param {string} [params.returnImage] - Return rendered image? If specified, should be 'ImageBitmap', 'image/jpeg', or 'image/png'. |
|
|
|
|
|
* @param {function} [params.hook] - Hook for executing arbitrary function in this environment. |
|
|
*/ |
|
|
*/ |
|
|
this.render = function(pitch, yaw, hfov, params) { |
|
|
this.render = function(pitch, yaw, hfov, params) { |
|
|
var focal, i, s, roll = 0; |
|
|
var focal, i, s, roll = 0; |
|
@@ -789,6 +790,20 @@ function Renderer(container, context) { |
|
|
roll += roll_adj; |
|
|
roll += roll_adj; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Execute function hook |
|
|
|
|
|
if (params.hook) { |
|
|
|
|
|
params.hook({ |
|
|
|
|
|
gl: gl, |
|
|
|
|
|
program: program, |
|
|
|
|
|
previewProgram: previewProgram, |
|
|
|
|
|
imageType: imageType, |
|
|
|
|
|
texCoordBuffer: texCoordBuffer, |
|
|
|
|
|
cubeVertBuf: cubeVertBuf, |
|
|
|
|
|
cubeVertTexCoordBuf: cubeVertTexCoordBuf, |
|
|
|
|
|
cubeVertIndBuf: cubeVertIndBuf |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// If no WebGL |
|
|
// If no WebGL |
|
|
if (!gl && (imageType == 'multires' || imageType == 'cubemap')) { |
|
|
if (!gl && (imageType == 'multires' || imageType == 'cubemap')) { |
|
|
// Determine face transforms |
|
|
// Determine face transforms |
|
|