74 lines
1.4 KiB
JavaScript
74 lines
1.4 KiB
JavaScript
|
/**
|
||
|
* R3.API.AR
|
||
|
* @param id
|
||
|
* @param name
|
||
|
* @param parentEntity
|
||
|
* @param video
|
||
|
* @param pathCamera
|
||
|
* @param pathMarker
|
||
|
* @param scene
|
||
|
* @param camera
|
||
|
* @param markerRoot
|
||
|
* @constructor
|
||
|
*/
|
||
|
R3.API.AR = function(
|
||
|
id,
|
||
|
name,
|
||
|
parentEntity,
|
||
|
video,
|
||
|
pathCamera,
|
||
|
pathMarker,
|
||
|
scene,
|
||
|
camera,
|
||
|
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;
|
||
|
|
||
|
if (R3.Utils.UndefinedOrNull(markerRoot)) {
|
||
|
markerRoot = new R3.D3.API.Object();
|
||
|
}
|
||
|
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;
|