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

81 lines
1.5 KiB
JavaScript
Raw Normal View History

2018-05-06 17:18:37 +02:00
/**
* R3.API.AR
* @param id
* @param name
* @param parentEntity
* @param video
* @param pathCamera
* @param pathMarker
* @param scene
* @param camera
2018-05-06 19:57:07 +02:00
* @param renderer
2018-05-06 17:18:37 +02:00
* @param markerRoot
* @constructor
*/
R3.API.AR = function(
id,
name,
parentEntity,
video,
pathCamera,
pathMarker,
scene,
camera,
2018-05-06 19:57:07 +02:00
renderer,
2018-05-06 17:18:37 +02:00
markerRoot
) {
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)) {
pathCamera = 'Data/camera_para.dat';
}
this.pathCamera = pathCamera;
if (R3.Utils.UndefinedOrNull(pathMarker)) {
pathMarker = 'Data/patt.hiro';
}
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-06 19:57:07 +02:00
if (R3.Utils.UndefinedOrNull(renderer)) {
renderer = null;
}
this.renderer = renderer;
2018-05-06 17:18:37 +02:00
if (R3.Utils.UndefinedOrNull(markerRoot)) {
2018-05-06 19:57:07 +02:00
markerRoot = null;
2018-05-06 17:18:37 +02:00
}
this.markerRoot = markerRoot;
R3.API.Component.call(
this,
R3.Component.AR,
parentEntity
);
};
R3.API.AR.prototype = Object.create(R3.API.Component.prototype);
R3.API.AR.prototype.constructor = R3.API.AR;