54 lines
1.1 KiB
JavaScript
54 lines
1.1 KiB
JavaScript
/**
|
|
* Augmented
|
|
* @param id
|
|
* @param name
|
|
* @param augmentedType
|
|
* @constructor
|
|
*/
|
|
R3.AugmentedRuntime = function(
|
|
id,
|
|
name,
|
|
augmentedType
|
|
) {
|
|
if (R3.Utils.UndefinedOrNull(id)) {
|
|
id = R3.Utils.RandomId();
|
|
}
|
|
this.id = id;
|
|
|
|
if (R3.Utils.UndefinedOrNull(name)) {
|
|
name = 'Augmented (' + id + ')';
|
|
}
|
|
this.name = name;
|
|
|
|
if (R3.Utils.UndefinedOrNull(augmentedType)) {
|
|
augmentedType = R3.AugmentedRuntime.JS_AR_TOOLKIT_5;
|
|
}
|
|
this.augmentedType = augmentedType;
|
|
|
|
this.createInstance();
|
|
};
|
|
|
|
/**
|
|
* R3.AugmentedRuntime Types
|
|
* @type {number}
|
|
*/
|
|
R3.AugmentedRuntime.JS_AR_TOOLKIT_5 = 0x1;
|
|
R3.AugmentedRuntime.AR_JS = 0x2;
|
|
|
|
R3.AugmentedRuntime.prototype.createInstance = function() {
|
|
if (this.augmentedType === R3.AugmentedRuntime.JS_AR_TOOLKIT_5) {
|
|
this.instance = {
|
|
ARController : ARController,
|
|
ARCameraParam : ARCameraParam
|
|
};
|
|
} else {
|
|
this.instance = null;
|
|
}
|
|
};
|
|
|
|
R3.AugmentedRuntime.prototype.updateInstance = function(property) {
|
|
if (property === 'augmentedType') {
|
|
this.createInstance();
|
|
}
|
|
};
|