migrate to AR.js
parent
c7abedc0c7
commit
f3d485ba0a
|
@ -8,6 +8,7 @@
|
||||||
* @param pathMarker
|
* @param pathMarker
|
||||||
* @param scene
|
* @param scene
|
||||||
* @param camera
|
* @param camera
|
||||||
|
* @param renderer
|
||||||
* @param markerRoot
|
* @param markerRoot
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
|
@ -20,6 +21,7 @@ R3.API.AR = function(
|
||||||
pathMarker,
|
pathMarker,
|
||||||
scene,
|
scene,
|
||||||
camera,
|
camera,
|
||||||
|
renderer,
|
||||||
markerRoot
|
markerRoot
|
||||||
) {
|
) {
|
||||||
if (R3.Utils.UndefinedOrNull(id)) {
|
if (R3.Utils.UndefinedOrNull(id)) {
|
||||||
|
@ -57,8 +59,13 @@ R3.API.AR = function(
|
||||||
}
|
}
|
||||||
this.camera = camera;
|
this.camera = camera;
|
||||||
|
|
||||||
|
if (R3.Utils.UndefinedOrNull(renderer)) {
|
||||||
|
renderer = null;
|
||||||
|
}
|
||||||
|
this.renderer = renderer;
|
||||||
|
|
||||||
if (R3.Utils.UndefinedOrNull(markerRoot)) {
|
if (R3.Utils.UndefinedOrNull(markerRoot)) {
|
||||||
markerRoot = new R3.D3.API.Object();
|
markerRoot = null;
|
||||||
}
|
}
|
||||||
this.markerRoot = markerRoot;
|
this.markerRoot = markerRoot;
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
* @param aspectRatio
|
* @param aspectRatio
|
||||||
* @param scaleMode
|
* @param scaleMode
|
||||||
* @param activeCamera
|
* @param activeCamera
|
||||||
|
* @param activeScene
|
||||||
* @param activeScenes
|
* @param activeScenes
|
||||||
* @param activeComposer
|
* @param activeComposer
|
||||||
* @param activeEffect
|
* @param activeEffect
|
||||||
|
@ -23,6 +24,7 @@ R3.API.RenderConfiguration = function (
|
||||||
aspectRatio,
|
aspectRatio,
|
||||||
scaleMode,
|
scaleMode,
|
||||||
activeCamera,
|
activeCamera,
|
||||||
|
activeScene,
|
||||||
activeScenes,
|
activeScenes,
|
||||||
activeRenderer,
|
activeRenderer,
|
||||||
activeComposer,
|
activeComposer,
|
||||||
|
@ -63,6 +65,11 @@ R3.API.RenderConfiguration = function (
|
||||||
}
|
}
|
||||||
this.activeCamera = activeCamera;
|
this.activeCamera = activeCamera;
|
||||||
|
|
||||||
|
if (R3.Utils.UndefinedOrNull(activeScene)) {
|
||||||
|
activeScene = null;
|
||||||
|
}
|
||||||
|
this.activeScene = activeScene;
|
||||||
|
|
||||||
if (R3.Utils.UndefinedOrNull(activeScenes)) {
|
if (R3.Utils.UndefinedOrNull(activeScenes)) {
|
||||||
activeScenes = [];
|
activeScenes = [];
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,8 @@
|
||||||
* @param clippingPlanes
|
* @param clippingPlanes
|
||||||
* @param clearColor
|
* @param clearColor
|
||||||
* @param viewports
|
* @param viewports
|
||||||
|
* @param alpha
|
||||||
|
* @param opacity
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
R3.API.Renderer.D3 = function (
|
R3.API.Renderer.D3 = function (
|
||||||
|
@ -68,7 +70,9 @@ R3.API.Renderer.D3 = function (
|
||||||
renderTarget,
|
renderTarget,
|
||||||
clippingPlanes,
|
clippingPlanes,
|
||||||
clearColor,
|
clearColor,
|
||||||
viewports
|
viewports,
|
||||||
|
alpha,
|
||||||
|
opacity
|
||||||
) {
|
) {
|
||||||
|
|
||||||
if (R3.Utils.UndefinedOrNull(apiRenderer)) {
|
if (R3.Utils.UndefinedOrNull(apiRenderer)) {
|
||||||
|
@ -248,6 +252,16 @@ R3.API.Renderer.D3 = function (
|
||||||
}
|
}
|
||||||
this.viewports = viewports;
|
this.viewports = viewports;
|
||||||
|
|
||||||
|
if (R3.Utils.UndefinedOrNull(alpha)) {
|
||||||
|
alpha = true;
|
||||||
|
}
|
||||||
|
this.alpha = alpha;
|
||||||
|
|
||||||
|
if (R3.Utils.UndefinedOrNull(opacity)) {
|
||||||
|
opacity = 1;
|
||||||
|
}
|
||||||
|
this.opacity = opacity;
|
||||||
|
|
||||||
R3.API.Renderer.call(
|
R3.API.Renderer.call(
|
||||||
this,
|
this,
|
||||||
apiRenderer.id,
|
apiRenderer.id,
|
||||||
|
|
|
@ -35,13 +35,15 @@ R3.API.Video = function(
|
||||||
}
|
}
|
||||||
this.autoUpdateSize = autoUpdateSize;
|
this.autoUpdateSize = autoUpdateSize;
|
||||||
|
|
||||||
|
var size = R3.Utils.GetWindowSize();
|
||||||
|
|
||||||
if (R3.Utils.UndefinedOrNull(width)) {
|
if (R3.Utils.UndefinedOrNull(width)) {
|
||||||
width = 320;
|
width = size.width;
|
||||||
}
|
}
|
||||||
this.width = width;
|
this.width = width;
|
||||||
|
|
||||||
if (R3.Utils.UndefinedOrNull(height)) {
|
if (R3.Utils.UndefinedOrNull(height)) {
|
||||||
height = 240;
|
height = size.height;
|
||||||
}
|
}
|
||||||
this.height = height;
|
this.height = height;
|
||||||
|
|
||||||
|
@ -51,7 +53,7 @@ R3.API.Video = function(
|
||||||
this.offset = offset;
|
this.offset = offset;
|
||||||
|
|
||||||
if (R3.Utils.UndefinedOrNull(source)) {
|
if (R3.Utils.UndefinedOrNull(source)) {
|
||||||
source = "Data/output_4.ogg";
|
source = null;
|
||||||
}
|
}
|
||||||
this.source = source;
|
this.source = source;
|
||||||
|
|
||||||
|
|
191
src/r3-ar.js
191
src/r3-ar.js
|
@ -25,7 +25,9 @@ R3.AR = function(
|
||||||
apiAR.pathMarker,
|
apiAR.pathMarker,
|
||||||
apiAR.scene,
|
apiAR.scene,
|
||||||
apiAR.camera,
|
apiAR.camera,
|
||||||
apiAR.markerRoot
|
apiAR.renderer,
|
||||||
|
apiAR.markerRoot,
|
||||||
|
apiAR.renderConfiguration
|
||||||
);
|
);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
@ -50,9 +52,11 @@ R3.AR = function(
|
||||||
'video' : R3.Video,
|
'video' : R3.Video,
|
||||||
'scene' : R3.D3.Scene,
|
'scene' : R3.D3.Scene,
|
||||||
'camera' : R3.D3.Camera,
|
'camera' : R3.D3.Camera,
|
||||||
|
'renderer' : R3.D3.Renderer,
|
||||||
'markerRoot' : R3.D3.Object
|
'markerRoot' : R3.D3.Object
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
R3.AR.prototype = Object.create(R3.Component.prototype);
|
R3.AR.prototype = Object.create(R3.Component.prototype);
|
||||||
|
@ -64,53 +68,48 @@ R3.AR.prototype.constructor = R3.AR;
|
||||||
*/
|
*/
|
||||||
R3.AR.prototype.createInstance = function() {
|
R3.AR.prototype.createInstance = function() {
|
||||||
|
|
||||||
if (this.augmented.augmentedType !== R3.AugmentedRuntime.JS_AR_TOOLKIT_5) {
|
R3.Event.Emit(
|
||||||
console.warn('this augmented runtime is not implemented');
|
R3.Event.GET_RENDER_CONFIGURATION,
|
||||||
return;
|
null,
|
||||||
}
|
function (renderConfiguration) {
|
||||||
|
|
||||||
if (this.scene === null) {
|
if (this.scene === null) {
|
||||||
|
this.scene = renderConfiguration.activeScene;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.camera === null) {
|
||||||
|
this.camera = renderConfiguration.activeCamera;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.renderer === null) {
|
||||||
|
this.renderer = renderConfiguration.activeRenderer;
|
||||||
|
}
|
||||||
|
|
||||||
R3.Event.Emit(
|
|
||||||
R3.Event.GET_DEFAULT_SCENE,
|
|
||||||
null,
|
|
||||||
function(scene) {
|
|
||||||
this.scene = scene;
|
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (this.augmented.augmentedType === R3.AugmentedRuntime.JS_AR_TOOLKIT_5) {
|
||||||
|
|
||||||
|
console.warn('Using js artoolkit 5');
|
||||||
|
|
||||||
if (this.scene === null) {
|
if (this.scene === null) {
|
||||||
console.warn('there is no default scene to create an AR component with');
|
console.warn('there is no default scene to create an AR component with');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (this.camera === null) {
|
|
||||||
|
|
||||||
R3.Event.Emit(
|
|
||||||
R3.Event.GET_DEFAULT_CAMERA,
|
|
||||||
null,
|
|
||||||
function(camera) {
|
|
||||||
this.camera = camera;
|
|
||||||
}.bind(this)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (this.camera === null) {
|
if (this.camera === null) {
|
||||||
console.warn('there is no default camera to create an AR component with');
|
console.warn('there is no default camera to create an AR component with');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ARController.getUserMediaThreeScene(
|
ARController.getUserMediaThreeScene(
|
||||||
{
|
{
|
||||||
maxARVideoSize: 320,
|
maxARVideoSize: 320,
|
||||||
cameraParam: 'Data/camera_para-iPhone 5 rear 640x480 1.0m.dat',
|
cameraParam: 'Data/camera_para-iPhone 5 rear 640x480 1.0m.dat',
|
||||||
|
|
||||||
onSuccess: function(
|
onSuccess: function (arScene,
|
||||||
arScene,
|
|
||||||
arController,
|
arController,
|
||||||
arCamera
|
arCamera) {
|
||||||
) {
|
|
||||||
|
|
||||||
arScene.scene = this.scene.instance;
|
arScene.scene = this.scene.instance;
|
||||||
|
|
||||||
|
@ -118,7 +117,7 @@ R3.AR.prototype.createInstance = function() {
|
||||||
|
|
||||||
arController.loadMarker(
|
arController.loadMarker(
|
||||||
this.pathMarker,
|
this.pathMarker,
|
||||||
function(markerId) {
|
function (markerId) {
|
||||||
|
|
||||||
var markerRoot = arController.createThreeMarker(markerId);
|
var markerRoot = arController.createThreeMarker(markerId);
|
||||||
|
|
||||||
|
@ -143,9 +142,9 @@ R3.AR.prototype.createInstance = function() {
|
||||||
//arScene.scene.add(this.camera.instance);
|
//arScene.scene.add(this.camera.instance);
|
||||||
|
|
||||||
this.instance = {
|
this.instance = {
|
||||||
arScene : arScene,
|
arScene: arScene,
|
||||||
arController : arController,
|
arController: arController,
|
||||||
arCamera : arCamera
|
arCamera: arCamera
|
||||||
};
|
};
|
||||||
|
|
||||||
R3.Component.prototype.createInstance.call(this);
|
R3.Component.prototype.createInstance.call(this);
|
||||||
|
@ -157,6 +156,81 @@ R3.AR.prototype.createInstance = function() {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.augmented.augmentedType === R3.AugmentedRuntime.AR_JS) {
|
||||||
|
|
||||||
|
console.log('using ar.js');
|
||||||
|
|
||||||
|
var size = R3.Utils.GetWindowSize();
|
||||||
|
|
||||||
|
this.arToolkitSource = new THREEx.ArToolkitSource(
|
||||||
|
{
|
||||||
|
sourceType: 'webcam',
|
||||||
|
sourceWidth: size.width,
|
||||||
|
sourceHeight: size.height,
|
||||||
|
displayWidth: size.width,
|
||||||
|
displayHeight: size.height
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
this.arToolkitSource.init(
|
||||||
|
|
||||||
|
function initialized() {
|
||||||
|
|
||||||
|
delete this.video.instance;
|
||||||
|
|
||||||
|
this.video.instance = this.arToolkitSource.domElement;
|
||||||
|
|
||||||
|
this.arToolkitContext = new THREEx.ArToolkitContext(
|
||||||
|
{
|
||||||
|
cameraParametersUrl: this.pathCamera,
|
||||||
|
detectionMode: 'mono'
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
this.arToolkitContext.init(
|
||||||
|
|
||||||
|
function initialized() {
|
||||||
|
|
||||||
|
this.controls = new THREEx.ArMarkerControls(
|
||||||
|
this.arToolkitContext,
|
||||||
|
this.camera.instance,
|
||||||
|
{
|
||||||
|
type: 'pattern',
|
||||||
|
patternUrl: this.pathMarker,
|
||||||
|
changeMatrixMode: 'cameraTransformMatrix'
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
this.instance = {
|
||||||
|
arToolkitContext: this.arToolkitContext,
|
||||||
|
arToolkitSource: this.arToolkitSource
|
||||||
|
};
|
||||||
|
|
||||||
|
this.scene.instance.add(this.camera.instance);
|
||||||
|
|
||||||
|
this.resize();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copy the projectionmatrix of the context to our camera
|
||||||
|
* UPDATE - don't do this cause it messes up the projection matrix
|
||||||
|
*/
|
||||||
|
// this.camera.instance.projectionMatrix.copy(
|
||||||
|
// this.arToolkitContext.getProjectionMatrix()
|
||||||
|
// );
|
||||||
|
|
||||||
|
|
||||||
|
R3.Component.prototype.createInstance.call(this);
|
||||||
|
|
||||||
|
}.bind(this)
|
||||||
|
)
|
||||||
|
|
||||||
|
}.bind(this)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -198,6 +272,27 @@ R3.AR.prototype.updateInstance = function(property) {
|
||||||
|
|
||||||
if (property === 'camera') {
|
if (property === 'camera') {
|
||||||
console.warn('todo: update camera');
|
console.warn('todo: update camera');
|
||||||
|
|
||||||
|
if (this.augmented.augmentedType === R3.AugmentedRuntime.AR_JS) {
|
||||||
|
|
||||||
|
if (this.camera) {
|
||||||
|
this.controls = new THREEx.ArMarkerControls(
|
||||||
|
this.arToolkitContext,
|
||||||
|
this.camera.instance,
|
||||||
|
{
|
||||||
|
type: 'pattern',
|
||||||
|
patternUrl: this.pathMarker,
|
||||||
|
changeMatrixMode: 'cameraTransformMatrix'
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (property === 'renderer') {
|
||||||
|
console.warn('todo: update camera');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,6 +319,42 @@ R3.AR.prototype.toApiObject = function() {
|
||||||
this.pathMarker,
|
this.pathMarker,
|
||||||
R3.Utils.IdOrNull(this.scene),
|
R3.Utils.IdOrNull(this.scene),
|
||||||
R3.Utils.IdOrNull(this.camera),
|
R3.Utils.IdOrNull(this.camera),
|
||||||
|
R3.Utils.IdOrNull(this.renderer),
|
||||||
R3.Utils.IdOrNull(this.markerRoot)
|
R3.Utils.IdOrNull(this.markerRoot)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
R3.AR.prototype.beforeRender = function() {
|
||||||
|
|
||||||
|
if (this.augmented.augmentedType === R3.AugmentedRuntime.JS_AR_TOOLKIT_5) {
|
||||||
|
this.instance.arScene.process();
|
||||||
|
this.instance.arScene.renderOn(renderer.instance);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.augmented.augmentedType === R3.AugmentedRuntime.AR_JS) {
|
||||||
|
this.arToolkitContext.update(
|
||||||
|
this.arToolkitSource.domElement
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
R3.AR.prototype.resize = function() {
|
||||||
|
|
||||||
|
if (this.augmented.augmentedType === R3.AugmentedRuntime.AR_JS) {
|
||||||
|
|
||||||
|
console.log('updating AR size');
|
||||||
|
|
||||||
|
this.arToolkitSource.onResizeElement();
|
||||||
|
|
||||||
|
// if (this.arToolkitContext.arController !== null){
|
||||||
|
// this.arToolkitSource.copyElementSizeTo(
|
||||||
|
// this.arToolkitContext.arController.canvas
|
||||||
|
// )
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
|
@ -25,6 +25,7 @@ R3.RenderConfiguration = function (
|
||||||
apiRenderConfiguration.aspectRatio,
|
apiRenderConfiguration.aspectRatio,
|
||||||
apiRenderConfiguration.scaleMode,
|
apiRenderConfiguration.scaleMode,
|
||||||
apiRenderConfiguration.activeCamera,
|
apiRenderConfiguration.activeCamera,
|
||||||
|
apiRenderConfiguration.activeScene,
|
||||||
apiRenderConfiguration.activeScenes,
|
apiRenderConfiguration.activeScenes,
|
||||||
apiRenderConfiguration.activeRenderer,
|
apiRenderConfiguration.activeRenderer,
|
||||||
apiRenderConfiguration.activeComposer,
|
apiRenderConfiguration.activeComposer,
|
||||||
|
@ -43,6 +44,7 @@ R3.RenderConfiguration = function (
|
||||||
this,
|
this,
|
||||||
{
|
{
|
||||||
'activeCamera' : R3.D3.Camera,
|
'activeCamera' : R3.D3.Camera,
|
||||||
|
'activeScene' : R3.D3.Scene,
|
||||||
'activeScenes' : [R3.D3.Scene],
|
'activeScenes' : [R3.D3.Scene],
|
||||||
'activeRenderer' : R3.Renderer,
|
'activeRenderer' : R3.Renderer,
|
||||||
'activeComposer' : R3.D3.Composer,
|
'activeComposer' : R3.D3.Composer,
|
||||||
|
@ -135,6 +137,7 @@ R3.RenderConfiguration.prototype.updateInstance = function(property) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
property === 'activeScene' ||
|
||||||
property === 'activeScenes' ||
|
property === 'activeScenes' ||
|
||||||
property === 'activeRenderer'
|
property === 'activeRenderer'
|
||||||
) {
|
) {
|
||||||
|
@ -239,6 +242,7 @@ R3.RenderConfiguration.prototype.toApiObject = function() {
|
||||||
this.aspectRatio,
|
this.aspectRatio,
|
||||||
this.scaleMode,
|
this.scaleMode,
|
||||||
R3.Utils.IdOrNull(this.activeCamera),
|
R3.Utils.IdOrNull(this.activeCamera),
|
||||||
|
R3.Utils.IdOrNull(this.activeScene),
|
||||||
this.activeScenes.map(
|
this.activeScenes.map(
|
||||||
function(activeScene) {
|
function(activeScene) {
|
||||||
return R3.Utils.IdOrNull(activeScene);
|
return R3.Utils.IdOrNull(activeScene);
|
||||||
|
|
|
@ -51,7 +51,9 @@ R3.Renderer.D3 = function (
|
||||||
apiRendererD3.renderTarget,
|
apiRendererD3.renderTarget,
|
||||||
apiRendererD3.clippingPlanes,
|
apiRendererD3.clippingPlanes,
|
||||||
apiRendererD3.clearColor,
|
apiRendererD3.clearColor,
|
||||||
apiRendererD3.viewports
|
apiRendererD3.viewports,
|
||||||
|
apiRendererD3.alpha,
|
||||||
|
apiRendererD3.opacity
|
||||||
);
|
);
|
||||||
|
|
||||||
if (this.renderTarget instanceof R3.D3.API.RenderTarget) {
|
if (this.renderTarget instanceof R3.D3.API.RenderTarget) {
|
||||||
|
@ -180,7 +182,7 @@ R3.Renderer.D3.prototype.createInstance = function() {
|
||||||
this.clearColor.g,
|
this.clearColor.g,
|
||||||
this.clearColor.b
|
this.clearColor.b
|
||||||
),
|
),
|
||||||
1 - this.clearColor.a
|
this.opacity
|
||||||
);
|
);
|
||||||
|
|
||||||
R3.Renderer.prototype.createInstance.call(this);
|
R3.Renderer.prototype.createInstance.call(this);
|
||||||
|
@ -385,14 +387,17 @@ R3.Renderer.D3.prototype.updateInstance = function(property) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (property === 'clearColor') {
|
if (
|
||||||
|
property === 'clearColor' ||
|
||||||
|
property === 'opacity'
|
||||||
|
) {
|
||||||
this.instance.setClearColor(
|
this.instance.setClearColor(
|
||||||
new THREE.Color(
|
new THREE.Color(
|
||||||
this.clearColor.r,
|
this.clearColor.r,
|
||||||
this.clearColor.g,
|
this.clearColor.g,
|
||||||
this.clearColor.b
|
this.clearColor.b
|
||||||
),
|
),
|
||||||
1 - this.clearColor.a
|
this.opacity
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -401,6 +406,11 @@ R3.Renderer.D3.prototype.updateInstance = function(property) {
|
||||||
console.warn('todo: viewports change');
|
console.warn('todo: viewports change');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (property === 'alpha') {
|
||||||
|
this.instance.alpha = this.alpha;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
R3.Renderer.prototype.updateInstance.call(this, property);
|
R3.Renderer.prototype.updateInstance.call(this, property);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -533,7 +543,9 @@ R3.Renderer.D3.prototype.toApiObject = function() {
|
||||||
function(viewport){
|
function(viewport){
|
||||||
return R3.Utils.IdOrNull(viewport);
|
return R3.Utils.IdOrNull(viewport);
|
||||||
}
|
}
|
||||||
)
|
),
|
||||||
|
this.alpha,
|
||||||
|
this.opacity
|
||||||
);
|
);
|
||||||
|
|
||||||
return apiRendererD3;
|
return apiRendererD3;
|
||||||
|
|
|
@ -293,6 +293,12 @@ R3.System.Render.prototype.windowResize = function(data) {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
R3.EntityManager.Instance.queryComponentsByConstructor(R3.AR).map(
|
||||||
|
function(ar) {
|
||||||
|
ar.resize();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
R3.Event.Emit(
|
R3.Event.Emit(
|
||||||
R3.Event.AFTER_WINDOW_RESIZE,
|
R3.Event.AFTER_WINDOW_RESIZE,
|
||||||
data
|
data
|
||||||
|
@ -769,24 +775,8 @@ R3.System.Render.prototype.render = function(data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arComponent) {
|
if (arComponent) {
|
||||||
|
arComponent.beforeRender();
|
||||||
arComponent.instance.arScene.process();
|
renderer.instance.render( scene.instance, camera.instance);
|
||||||
|
|
||||||
// if (arComponent.markerRoot.instance.visible) {
|
|
||||||
// arComponent.instance.arController.getTransMatSquareCont(
|
|
||||||
// 0,
|
|
||||||
// 1,
|
|
||||||
// arComponent.markerRoot.instance.markerMatrix,
|
|
||||||
// arComponent.markerRoot.instance.markerMatrix
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// arComponent.instance.arController.transMatToGLMat(
|
|
||||||
// arComponent.markerRoot.instance.markerMatrix,
|
|
||||||
// arComponent.markerRoot.instance.matrix.elements
|
|
||||||
// );
|
|
||||||
|
|
||||||
arComponent.instance.arScene.renderOn(renderer.instance);
|
|
||||||
} else {
|
} else {
|
||||||
renderer.render(scene, camera);
|
renderer.render(scene, camera);
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,9 @@ R3.Video.prototype.createInstance = function() {
|
||||||
this.instance.height = this.height;
|
this.instance.height = this.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.source) {
|
||||||
this.instance.setAttribute('src', this.source);
|
this.instance.setAttribute('src', this.source);
|
||||||
|
}
|
||||||
|
|
||||||
R3.Component.prototype.createInstance.call(this);
|
R3.Component.prototype.createInstance.call(this);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue