r3-legacy/bak/r3-api-ar.js

88 lines
1.7 KiB
JavaScript
Raw Normal View History

2018-05-06 17:18:37 +02:00
/**
* R3.API.AR
* @param id
* @param name
2019-07-24 08:08:02 +02:00
* @param parent
2018-05-06 17:18:37 +02:00
* @param video
* @param pathCamera
* @param pathMarker
* @param scene
* @param camera
2018-05-11 12:51:30 +02:00
* @param videoScene
* @param videoCamera
2018-05-06 17:18:37 +02:00
* @constructor
*/
R3.API.AR = function(
id,
name,
2019-07-24 08:08:02 +02:00
parent,
2018-05-06 17:18:37 +02:00
video,
pathCamera,
pathMarker,
scene,
camera,
2018-05-11 12:51:30 +02:00
videoScene,
videoCamera
2018-05-06 17:18:37 +02:00
) {
if (R3.Utils.UndefinedOrNull(id)) {
id = R3.Utils.RandomId();
}
this.id = id;
if (R3.Utils.UndefinedOrNull(name)) {
name = 'AR (' + id + ')';
}
this.name = name;
if (R3.Utils.UndefinedOrNull(video)) {
video = new R3.API.Video();
}
this.video = video;
if (R3.Utils.UndefinedOrNull(pathCamera)) {
2018-05-06 20:53:21 +02:00
pathCamera = 'data/camera_para.dat';
2018-05-06 17:18:37 +02:00
}
this.pathCamera = pathCamera;
if (R3.Utils.UndefinedOrNull(pathMarker)) {
2018-05-06 20:53:21 +02:00
pathMarker = 'data/patt.hiro';
2018-05-06 17:18:37 +02:00
}
this.pathMarker = pathMarker;
if (R3.Utils.UndefinedOrNull(scene)) {
scene = null;
}
this.scene = scene;
if (R3.Utils.UndefinedOrNull(camera)) {
camera = null;
}
this.camera = camera;
2018-05-11 12:51:30 +02:00
if (R3.Utils.UndefinedOrNull(videoScene)) {
videoScene = new R3.D3.API.Scene(
null,
'Scene - AR Video'
);
2018-05-06 19:57:07 +02:00
}
2018-05-11 12:51:30 +02:00
this.videoScene = videoScene;
2018-05-06 19:57:07 +02:00
2018-05-11 12:51:30 +02:00
if (R3.Utils.UndefinedOrNull(videoCamera)) {
videoCamera = new R3.D3.API.Camera.Orthographic(
{
name : 'Camera Orthgraphic - AR Video'
}
);
2018-05-06 17:18:37 +02:00
}
2018-05-11 12:51:30 +02:00
this.videoCamera = videoCamera;
2018-05-06 17:18:37 +02:00
R3.API.Component.call(
this,
R3.Component.AR,
2019-07-24 08:08:02 +02:00
parent
2018-05-06 17:18:37 +02:00
);
};
R3.API.AR.prototype = Object.create(R3.API.Component.prototype);
R3.API.AR.prototype.constructor = R3.API.AR;