x_ite
Version:
X_ITE X3D Browser, view and manipulate X3D, VRML, glTF and other 3D sources in HTML.
1,165 lines (944 loc) • 3.44 MB
JavaScript
/* X_ITE v11.6.6 */
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["X3D"] = factory();
else
root["X3D"] = factory();
})(self, () => {
return /******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 11:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Fields_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7637);
/* harmony import */ var _Core_X3DNode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1847);
/* harmony import */ var _Shape_X3DAppearanceChildNode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5787);
/* harmony import */ var _Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5307);
/* harmony import */ var _Namespace_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3613);
function X3DTextureNode (executionContext)
{
_Shape_X3DAppearanceChildNode_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A .call (this, executionContext);
this .addType (_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A .X3DTextureNode);
this .addChildObjects (_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A .outputOnly, "transparent", new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFBool ());
}
Object .assign (Object .setPrototypeOf (X3DTextureNode .prototype, _Shape_X3DAppearanceChildNode_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A .prototype),
{
setTransparent (value)
{
if (!!value !== this ._transparent .getValue ())
this ._transparent = value;
},
isTransparent ()
{
return this ._transparent .getValue ();
},
});
Object .defineProperties (X3DTextureNode, _Core_X3DNode_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A .getStaticProperties ("X3DTextureNode", "Texturing", 1));
const __default__ = X3DTextureNode;
;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_Namespace_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A .add ("X3DTextureNode", __default__));
/***/ }),
/***/ 153:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Fields_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7637);
/* harmony import */ var _X3DNode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1847);
/* harmony import */ var _Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5307);
/* harmony import */ var _Rendering_TraverseType_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2506);
/* harmony import */ var _Namespace_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3613);
function X3DChildNode (executionContext)
{
if (this .getExecutionContext ())
return;
_X3DNode_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A .call (this, executionContext);
this .addType (_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A .X3DChildNode);
this .addChildObjects (_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A .outputOnly, "isBoundedObject", new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFBool (),
_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A .outputOnly, "isPointingObject", new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFBool (),
_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A .outputOnly, "isCameraObject", new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFBool (),
_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A .outputOnly, "isPickableObject", new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFBool (),
_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A .outputOnly, "isCollisionObject", new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFBool (),
_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A .outputOnly, "isShadowObject", new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFBool (),
_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A .outputOnly, "isVisibleObject", new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFBool ());
}
Object .assign (Object .setPrototypeOf (X3DChildNode .prototype, _X3DNode_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A .prototype),
{
setBoundedObject (value)
{
if (!!value !== this ._isBoundedObject .getValue ())
this ._isBoundedObject = value;
},
isBoundedObject ()
{
return this ._isBoundedObject .getValue ();
},
setPointingObject (value)
{
if (!!value !== this ._isPointingObject .getValue ())
this ._isPointingObject = value;
},
isPointingObject ()
{
return this ._isPointingObject .getValue ();
},
setCameraObject (value)
{
if (!!value !== this ._isCameraObject .getValue ())
this ._isCameraObject = value;
},
isCameraObject ()
{
return this ._isCameraObject .getValue ();
},
setPickableObject (value)
{
if (!!value !== this ._isPickableObject .getValue ())
this ._isPickableObject = value;
},
isPickableObject ()
{
return this ._isPickableObject .getValue ();
},
setShadowObject (value)
{
if (!!value !== this ._isShadowObject .getValue ())
this ._isShadowObject = value;
},
isShadowObject ()
{
return this ._isShadowObject .getValue ();
},
setCollisionObject (value)
{
if (!!value !== this ._isCollisionObject .getValue ())
this ._isCollisionObject = value;
},
isCollisionObject ()
{
return this ._isCollisionObject .getValue ();
},
setVisibleObject (value)
{
if (!!value !== this ._isVisibleObject .getValue ())
this ._isVisibleObject = value;
},
isVisibleObject ()
{
return this ._isVisibleObject .getValue ();
},
isVisible ()
{
// This function will be overloaded by X3DBoundedObject.
return true;
},
connectChildNode (childNode, excludes)
{
if (!excludes ?.includes (_Rendering_TraverseType_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A .BBOX))
{
childNode ._isBoundedObject .addFieldInterest (this ._isBoundedObject);
this .setBoundedObject (childNode .isBoundedObject ());
}
if (!excludes ?.includes (_Rendering_TraverseType_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A .POINTER))
{
childNode ._isPointingObject .addFieldInterest (this ._isPointingObject);
this .setPointingObject (childNode .isPointingObject ());
}
if (!excludes ?.includes (_Rendering_TraverseType_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A .CAMERA))
{
childNode ._isCameraObject .addFieldInterest (this ._isCameraObject);
this .setCameraObject (childNode .isCameraObject ());
}
if (!excludes ?.includes (_Rendering_TraverseType_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A .PICKING))
{
childNode ._isPickableObject .addFieldInterest (this ._isPickableObject);
this .setPickableObject (childNode .isPickableObject ());
}
if (!excludes ?.includes (_Rendering_TraverseType_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A .COLLISION))
{
childNode ._isCollisionObject .addFieldInterest (this ._isCollisionObject);
this .setCollisionObject (childNode .isCollisionObject ());
}
if (!excludes ?.includes (_Rendering_TraverseType_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A .SHADOW))
{
childNode ._isShadowObject .addFieldInterest (this ._isShadowObject);
this .setShadowObject (childNode .isShadowObject ());
}
if (!excludes ?.includes (_Rendering_TraverseType_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A .DISPLAY))
{
childNode ._isVisibleObject .addFieldInterest (this ._isVisibleObject);
this .setVisibleObject (childNode .isVisibleObject ());
}
},
disconnectChildNode (childNode)
{
childNode ._isBoundedObject .removeFieldInterest (this ._isBoundedObject);
childNode ._isPointingObject .removeFieldInterest (this ._isPointingObject);
childNode ._isCameraObject .removeFieldInterest (this ._isCameraObject);
childNode ._isPickableObject .removeFieldInterest (this ._isPickableObject);
childNode ._isCollisionObject .removeFieldInterest (this ._isCollisionObject);
childNode ._isShadowObject .removeFieldInterest (this ._isShadowObject);
childNode ._isVisibleObject .removeFieldInterest (this ._isVisibleObject);
},
});
Object .defineProperties (X3DChildNode, _X3DNode_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A .getStaticProperties ("X3DChildNode", "Core", 1));
const __default__ = X3DChildNode;
;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_Namespace_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A .add ("X3DChildNode", __default__));
/***/ }),
/***/ 227:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Base_X3DInfoArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3763);
/* harmony import */ var _UnitInfo_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8532);
/* harmony import */ var _Namespace_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3613);
function UnitInfoArray (values = [ ])
{
return _Base_X3DInfoArray_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .call (this, Array .from (values, value => [value .category, value]), _UnitInfo_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A);
}
Object .setPrototypeOf (UnitInfoArray .prototype, _Base_X3DInfoArray_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .prototype);
for (const key of Object .keys (UnitInfoArray .prototype))
Object .defineProperty (UnitInfoArray .prototype, key, { enumerable: false });
Object .defineProperties (UnitInfoArray,
{
typeName:
{
value: "UnitInfoArray",
enumerable: true,
},
});
const __default__ = UnitInfoArray;
;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_Namespace_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A .add ("UnitInfoArray", __default__));
/***/ }),
/***/ 497:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Fields_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7637);
/* harmony import */ var _Base_X3DFieldDefinition_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8815);
/* harmony import */ var _Base_FieldDefinitionArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6469);
/* harmony import */ var _Core_X3DNode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1847);
/* harmony import */ var _Core_X3DBindableNode_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2508);
/* harmony import */ var _X3DFogObject_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9499);
/* harmony import */ var _Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5307);
/* harmony import */ var _standard_Math_Numbers_Matrix4_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9280);
/* harmony import */ var _Namespace_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3613);
function Fog (executionContext)
{
_Core_X3DBindableNode_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A .call (this, executionContext);
_X3DFogObject_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A .call (this, executionContext);
this .addType (_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A .Fog);
this .modelMatrix = new _standard_Math_Numbers_Matrix4_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A ();
}
Object .assign (Object .setPrototypeOf (Fog .prototype, _Core_X3DBindableNode_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A .prototype),
_X3DFogObject_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A .prototype,
{
initialize ()
{
_Core_X3DBindableNode_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A .prototype .initialize .call (this);
_X3DFogObject_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A .prototype .initialize .call (this);
},
getModelMatrix ()
{
return this .modelMatrix;
},
traverse (type, renderObject)
{
renderObject .getLayer () .getFogs () .push (this);
this .modelMatrix .assign (renderObject .getModelViewMatrix () .get ());
},
dispose ()
{
_X3DFogObject_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A .prototype .dispose .call (this);
_Core_X3DBindableNode_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A .prototype .dispose .call (this);
},
});
Object .defineProperties (Fog,
{
... _Core_X3DNode_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A .getStaticProperties ("Fog", "EnvironmentalEffects", 2, "children", "2.0"),
fieldDefinitions:
{
value: new _Base_FieldDefinitionArray_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A ([
new _Base_X3DFieldDefinition_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A (_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A .inputOutput, "metadata", new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFNode ()),
new _Base_X3DFieldDefinition_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A (_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A .inputOnly, "set_bind", new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFBool ()),
new _Base_X3DFieldDefinition_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A (_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A .inputOutput, "fogType", new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFString ("LINEAR")),
new _Base_X3DFieldDefinition_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A (_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A .inputOutput, "color", new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFColor (1, 1, 1)),
new _Base_X3DFieldDefinition_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A (_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A .inputOutput, "visibilityStart", new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFFloat ()), // experimental
new _Base_X3DFieldDefinition_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A (_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A .inputOutput, "visibilityRange", new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFFloat ()),
new _Base_X3DFieldDefinition_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A (_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A .outputOnly, "isBound", new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFBool ()),
new _Base_X3DFieldDefinition_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A (_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A .outputOnly, "bindTime", new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFTime ()),
]),
enumerable: true,
},
});
const __default__ = Fog;
;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_Namespace_js__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A .add ("Fog", __default__));
/***/ }),
/***/ 812:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Namespace_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3613);
// Modified during dist build.
const __default__ = false;
;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_Namespace_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .add ("DEVELOPMENT", __default__));
/***/ }),
/***/ 826:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _DEVELOPMENT_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(812);
/* harmony import */ var _Namespace_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3613);
const MODULE = false;
const Features =
{
get ENVIRONMENT ()
{
if (_DEVELOPMENT_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)
return "BROWSER";
if (MODULE)
return "MODULE";
if ((typeof process === "object") && (process .release .name .search (/node|io.js/) !== -1))
return "NODE";
return "BROWSER";
},
WEAK_REF: typeof WeakRef !== "undefined",
FINALIZATION_REGISTRY: typeof FinalizationRegistry !== "undefined",
};
(() =>
{
// Added at February 2022
// https://github.com/tc39/proposal-relative-indexing-method#polyfill
function at (n)
{
// ToInteger() abstract op
n = Math.trunc(n) || 0;
// Allow negative indexing from the end
if (n < 0) n += this.length;
// OOB access is guaranteed to return undefined
if (n < 0 || n >= this.length) return undefined;
// Otherwise, this is just normal property access
return this[n];
}
const TypedArray = Reflect .getPrototypeOf (Int8Array);
for (const C of [Array, String, TypedArray])
{
if (C .prototype .at === undefined)
{
Object .defineProperty (C .prototype, "at",
{
value: at,
writable: true,
enumerable: false,
configurable: true,
});
}
}
})();
(() =>
{
if (!Features .WEAK_REF)
{
if (_DEVELOPMENT_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)
console .info ("Added shim for WeakRef.");
window .WeakRef = class WeakRef
{
#object;
constructor (object)
{
this .#object = object;
}
deref ()
{
return this .#object;
}
};
}
if (!Features .FINALIZATION_REGISTRY)
{
if (_DEVELOPMENT_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)
console .info ("Added shim for FinalizationRegistry.");
window .FinalizationRegistry = class FinalizationRegistry
{
register () { }
unregister () { }
};
}
})();
(() =>
{
// https://tc39.es/proposal-upsert/
for (const Class of [Map, WeakMap])
{
Class .prototype .getOrInsert ??= function (key, value)
{
if (this .has (key))
return this .get (key);
this .set (key, value);
return value;
};
}
for (const Class of [Map, WeakMap])
{
Class .prototype .getOrInsertComputed ??= function (key, callbackfn)
{
if (this .has (key))
return this .get (key);
const value = callbackfn (key);
this .set (key, value);
return value;
};
}
})();
const __default__ = Features;
;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_Namespace_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A .add ("Features", __default__));
/***/ }),
/***/ 849:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Namespace_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3613);
function VertexArray (gl)
{
this .gl = gl;
this .vertexArrays = new Map ();
}
Object .assign (VertexArray .prototype,
{
update (value = true)
{
if (value)
this .dispose ();
return this;
},
enable (program)
{
const { gl, vertexArrays } = this;
const vertexArray = vertexArrays .get (program);
if (vertexArray)
{
gl .bindVertexArray (vertexArray);
return false;
}
else
{
// Memory leak prevention when shaders are reloaded. There should normally be no more than maybe 10 VAOs, except when shaders are often reloaded.
if (vertexArrays .size > 100)
this .dispose ();
const vertexArray = gl .createVertexArray ();
vertexArrays .set (program, vertexArray)
gl .bindVertexArray (vertexArray);
// console .log ("rebuild vao");
return true; // Rebuild
}
},
dispose ()
{
const { gl, vertexArrays } = this;
for (const vertexArray of vertexArrays .values ())
gl .deleteVertexArray (vertexArray);
vertexArrays .clear ();
},
});
const __default__ = VertexArray;
;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_Namespace_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .add ("VertexArray", __default__));
/***/ }),
/***/ 921:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Fields_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7637);
/* harmony import */ var _Core_X3DNode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1847);
/* harmony import */ var _Core_X3DBindableNode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2508);
/* harmony import */ var _Time_TimeSensor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8243);
/* harmony import */ var _Interpolation_EaseInEaseOut_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8890);
/* harmony import */ var _Interpolation_PositionInterpolator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4137);
/* harmony import */ var _Interpolation_OrientationInterpolator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7712);
/* harmony import */ var _Interpolation_ScalarInterpolator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1346);
/* harmony import */ var _Base_X3DCast_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(6144);
/* harmony import */ var _Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(5307);
/* harmony import */ var _standard_Math_Numbers_Vector3_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2951);
/* harmony import */ var _standard_Math_Numbers_Rotation4_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(7421);
/* harmony import */ var _standard_Math_Numbers_Matrix3_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(7940);
/* harmony import */ var _standard_Math_Numbers_Matrix4_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(9280);
/* harmony import */ var _standard_Math_Geometry_Box3_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(9957);
/* harmony import */ var _Namespace_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(3613);
function X3DViewpointNode (executionContext)
{
_Core_X3DBindableNode_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A .call (this, executionContext);
this .addType (_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A .X3DViewpointNode);
this .addChildObjects (_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A .inputOutput, "positionOffset", new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFVec3f (),
_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A .inputOutput, "orientationOffset", new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFRotation (),
_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A .inputOutput, "scaleOffset", new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFVec3f (1, 1, 1),
_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A .inputOutput, "scaleOrientationOffset", new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFRotation (),
_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A .inputOutput, "centerOfRotationOffset", new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFVec3f (),
_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A .inputOutput, "fieldOfViewScale", new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFFloat (1));
this .descriptions = [ ];
this .userPosition = new _standard_Math_Numbers_Vector3_js__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A ();
this .userOrientation = new _standard_Math_Numbers_Rotation4_js__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .A ();
this .userCenterOfRotation = new _standard_Math_Numbers_Vector3_js__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A ();
this .modelMatrix = new _standard_Math_Numbers_Matrix4_js__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A ();
this .cameraSpaceMatrix = new _standard_Math_Numbers_Matrix4_js__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A (1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 10, 1);
this .viewMatrix = new _standard_Math_Numbers_Matrix4_js__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .A (1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, -10, 1);
const
browser = this .getBrowser (),
privateScene = browser .getPrivateScene ();
this .timeSensor = new _Time_TimeSensor_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A (privateScene);
this .easeInEaseOut = new _Interpolation_EaseInEaseOut_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A (privateScene);
this .positionInterpolator = new _Interpolation_PositionInterpolator_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A (privateScene);
this .orientationInterpolator = new _Interpolation_OrientationInterpolator_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A (privateScene);
this .scaleInterpolator = new _Interpolation_PositionInterpolator_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A (privateScene);
this .scaleOrientationInterpolator = new _Interpolation_OrientationInterpolator_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A (privateScene);
this .fieldOfViewScaleInterpolator = new _Interpolation_ScalarInterpolator_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A (privateScene);
}
Object .assign (Object .setPrototypeOf (X3DViewpointNode .prototype, _Core_X3DBindableNode_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A .prototype),
{
initialize ()
{
_Core_X3DBindableNode_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A .prototype .initialize .call (this);
this .timeSensor ._stopTime = 1;
this .timeSensor .setup ();
this .easeInEaseOut ._key = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFFloat (0, 1);
this .easeInEaseOut ._easeInEaseOut = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFVec2f (new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFVec2f (), new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFVec2f ());
this .easeInEaseOut .setup ();
this .positionInterpolator ._key = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFFloat (0, 1);
this .orientationInterpolator ._key = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFFloat (0, 1);
this .scaleInterpolator ._key = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFFloat (0, 1);
this .scaleOrientationInterpolator ._key = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFFloat (0, 1);
this .fieldOfViewScaleInterpolator ._key = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFFloat (0, 1);
this .positionInterpolator .setup ();
this .orientationInterpolator .setup ();
this .scaleInterpolator .setup ();
this .scaleOrientationInterpolator .setup ();
this .fieldOfViewScaleInterpolator .setup ();
this .timeSensor ._fraction_changed .addFieldInterest (this .easeInEaseOut ._set_fraction);
this .easeInEaseOut ._modifiedFraction_changed .addFieldInterest (this .positionInterpolator ._set_fraction);
this .easeInEaseOut ._modifiedFraction_changed .addFieldInterest (this .orientationInterpolator ._set_fraction);
this .easeInEaseOut ._modifiedFraction_changed .addFieldInterest (this .scaleInterpolator ._set_fraction);
this .easeInEaseOut ._modifiedFraction_changed .addFieldInterest (this .scaleOrientationInterpolator ._set_fraction);
this .easeInEaseOut ._modifiedFraction_changed .addFieldInterest (this .fieldOfViewScaleInterpolator ._set_fraction);
this .positionInterpolator ._value_changed .addFieldInterest (this ._positionOffset);
this .orientationInterpolator ._value_changed .addFieldInterest (this ._orientationOffset);
this .scaleInterpolator ._value_changed .addFieldInterest (this ._scaleOffset);
this .scaleOrientationInterpolator ._value_changed .addFieldInterest (this ._scaleOrientationOffset);
this .fieldOfViewScaleInterpolator ._value_changed .addFieldInterest (this ._fieldOfViewScale);
this ._nearDistance .addInterest ("set_nearDistance__", this);
this ._farDistance .addInterest ("set_farDistance__", this);
this ._viewAll .addInterest ("set_viewAll__", this);
this ._navigationInfo .addInterest ("set_navigationInfo__", this);
this ._isBound .addInterest ("set_bound__", this);
this .set_nearDistance__ ();
this .set_farDistance__ ();
this .set_navigationInfo__ ();
},
set_nearDistance__ ()
{
const nearDistance = this ._nearDistance .getValue ();
this .nearDistance = nearDistance >= 0 ? nearDistance : undefined;
},
set_farDistance__ ()
{
const farDistance = this ._farDistance .getValue ();
this .farDistance = farDistance >= 0 ? farDistance : undefined;
},
set_viewAll__ ()
{
if (!this ._viewAll .getValue ())
return;
if (!this ._isBound .getValue ())
return;
this ._set_bind = true;
},
set_navigationInfo__ ()
{
if (this .navigationInfoNode)
this ._isBound .removeFieldInterest (this .navigationInfoNode ._set_bind);
this .navigationInfoNode = (0,_Base_X3DCast_js__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A) (_Base_X3DConstants_js__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A .NavigationInfo, this ._navigationInfo);
if (this .navigationInfoNode)
this ._isBound .addFieldInterest (this .navigationInfoNode ._set_bind);
},
set_bound__ ()
{
if (this ._isBound .getValue ())
this .getBrowser () .setDescription (this ._description);
else
this .timeSensor ._stopTime = Date .now () / 1000;
},
set_active__ (navigationInfoNode, active)
{
if (active .getValue ())
return;
this .timeSensor ._isActive .removeInterest ("set_active__", this);
if (!this ._isBound .getValue ())
return;
if (this .timeSensor ._fraction_changed .getValue () !== 1)
return;
navigationInfoNode ._transitionComplete = true;
},
setInterpolators ()
{ },
getDescriptions ()
{
return this .descriptions;
},
getPosition ()
{
return this ._position .getValue ();
},
setPosition (value)
{
this ._position = value;
},
getOrientation ()
{
return this ._orientation .getValue ();
},
setOrientation (value)
{
this ._orientation = value;
},
getCenterOfRotation ()
{
return this ._centerOfRotation .getValue ();
},
setCenterOfRotation (value)
{
this ._centerOfRotation = value;
},
getUserPosition ()
{
return this .userPosition .assign (this .getPosition ())
.add (this ._positionOffset .getValue ());
},
setUserPosition (userPosition)
{
this ._positionOffset = this .userPosition .assign (userPosition)
.subtract (this .getPosition ());
},
getUserOrientation ()
{
return this .userOrientation .assign (this .getOrientation ())
.multRight (this ._orientationOffset .getValue ());
},
setUserOrientation (userOrientation)
{
this ._orientationOffset = this .userOrientation .assign (this .getOrientation ()) .inverse ()
.multRight (userOrientation);
},
getUserCenterOfRotation ()
{
return this .userCenterOfRotation .assign (this .getCenterOfRotation ())
.add (this ._centerOfRotationOffset .getValue ());
},
setUserCenterOfRotation (userCenterOfRotation)
{
this ._centerOfRotationOffset = this .userCenterOfRotation .assign (userCenterOfRotation)
.subtract (this .getCenterOfRotation ());
},
getFieldOfViewScale ()
{
return this ._fieldOfViewScale .getValue ();
},
setFieldOfViewScale (value)
{
this ._fieldOfViewScale = value;
},
getNearDistance (navigationInfoNode)
{
return this .nearDistance ?? navigationInfoNode ?.getNearValue ();
},
setNearDistance (value)
{
this .nearDistance = value;
},
getFarDistance (navigationInfoNode)
{
return this .farDistance
?? (navigationInfoNode ? navigationInfoNode .getFarValue () || this .getMaxFarValue () : undefined);
},
setFarDistance (value)
{
this .farDistance = value;
},
getProjectionMatrix (renderObject)
{
const navigationInfoNode = renderObject .getNavigationInfo ();
return this .getProjectionMatrixWithLimits (this .getNearDistance (navigationInfoNode),
this .getFarDistance (navigationInfoNode),
renderObject .getLayer () .getViewport () .getRectangle ());
},
getCameraSpaceMatrix ()
{
return this .cameraSpaceMatrix;
},
getViewMatrix ()
{
return this .viewMatrix;
},
getModelMatrix ()
{
return this .modelMatrix;
},
getMaxFarValue ()
{
return this .getBrowser () .getRenderingProperty ("LogarithmicDepthBuffer") ? 1e10 : 1e5;
},
getUpVector ()
{
// Local y-axis,
// see https://www.web3d.org/documents/specifications/19775-1/V4.0/Part01/components/navigation.html#NavigationInfo.
return _standard_Math_Numbers_Vector3_js__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A .yAxis;
},
getSpeedFactor ()
{
return 1;
},
setVRMLTransition (value)
{
// VRML behavior support.
this .VRMLTransition = value;
},
getVRMLTransition ()
{
// VRML behavior support.
return this .VRMLTransition;
},
checkTransition (description)
{
if (this .timeSensor ._isActive .getValue () && this .timeSensor ._description .getValue () === description)
return true;
this .timeSensor ._description = description;
return false;
},
transitionStart (layerNode, fromViewpointNode)
{
if (this ._jump .getValue ())
{
if (this .checkTransition ("transitionStart"))
return;
const relative = this .getRelativeTransformation (fromViewpointNode);
if (!this ._retainUserOffsets .getValue ())
this .resetUserOffsets ();
if (this ._viewAll .getValue ())
this .viewAll (layerNode .getBBox (new _standard_Math_Geometry_Box3_js__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .A ()));
// Handle NavigationInfo.
const
navigationInfoNode = layerNode .getNavigationInfo (),
transitionTime = navigationInfoNode ._transitionTime .getValue ();
let transitionType = navigationInfoNode .getTransitionType ();
// VRML behavior
if (this .getExecutionContext () .getSpecificationVersion () == 2.0)
{
if (this .getVRMLTransition ())
transitionType = "LINEAR";
else
transitionType = "TELEPORT";
}
this .setVRMLTransition (false);
// End VRML behavior
if (transitionTime <= 0)
transitionType = "TELEPORT";
if (this .constructor !== fromViewpointNode .constructor)
transitionType = "TELEPORT";
switch (transitionType)
{
case "TELEPORT":
{
navigationInfoNode ._transitionComplete = true;
return;
}
case "ANIMATE":
{
this .easeInEaseOut ._easeInEaseOut = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFVec2f (new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFVec2f (0, 1), new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFVec2f (1, 0));
break;
}
default:
{
// LINEAR
this .easeInEaseOut ._easeInEaseOut = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFVec2f (new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFVec2f (), new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFVec2f ());
break;
}
}
navigationInfoNode ._transitionStart = true;
this .timeSensor ._cycleInterval = transitionTime;
this .timeSensor ._stopTime = Date .now () / 1000;
this .timeSensor ._startTime = Date .now () / 1000;
this .timeSensor ._isActive .addInterest ("set_active__", this, navigationInfoNode);
this .positionInterpolator ._keyValue = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFVec3f (relative .position, this ._positionOffset);
this .orientationInterpolator ._keyValue = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFRotation (relative .orientation, this ._orientationOffset);
this .scaleInterpolator ._keyValue = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFVec3f (relative .scale, this ._scaleOffset);
this .scaleOrientationInterpolator ._keyValue = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFRotation (relative .scaleOrientation, this ._scaleOrientationOffset);
this ._positionOffset = relative .position;
this ._orientationOffset = relative .orientation;
this ._scaleOffset = relative .scale;
this ._scaleOrientationOffset = relative .scaleOrientation;
this .setInterpolators (fromViewpointNode, relative);
}
else
{
this .transitionStop ();
const navigationInfoNode = layerNode .getNavigationInfo ();
navigationInfoNode ._transitionComplete = true;
const relative = this .getRelativeTransformation (fromViewpointNode);
this ._positionOffset = relative .position;
this ._orientationOffset = relative .orientation;
this ._scaleOffset = relative .scale;
this ._scaleOrientationOffset = relative .scaleOrientation;
this .setInterpolators (fromViewpointNode, relative);
}
},
transitionStop ()
{
this .timeSensor ._stopTime = Date .now () / 1000;
this .timeSensor ._isActive .removeInterest ("set_active__", this);
},
resetUserOffsets ()
{
this ._positionOffset = _standard_Math_Numbers_Vector3_js__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A .Zero;
this ._orientationOffset = _standard_Math_Numbers_Rotation4_js__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .A .Identity;
this ._scaleOffset = _standard_Math_Numbers_Vector3_js__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A .One;
this ._scaleOrientationOffset = _standard_Math_Numbers_Rotation4_js__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .A .Identity;
this ._centerOfRotationOffset = _standard_Math_Numbers_Vector3_js__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A .Zero;
this ._fieldOfViewScale = 1;
this .set_nearDistance__ ();
this .set_farDistance__ ();
},
getRelativeTransformation: (() =>
{
const
position = new _standard_Math_Numbers_Vector3_js__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A (),
orientation = new _standard_Math_Numbers_Rotation4_js__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .A (),
scale = new _standard_Math_Numbers_Vector3_js__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A (),
scaleOrientation = new _standard_Math_Numbers_Rotation4_js__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .A ();
return function (fromViewpointNode)
{
const differenceMatrix = this .modelMatrix .copy () .multRight (fromViewpointNode .getViewMatrix ()) .inverse ();
differenceMatrix .get (position, orientation, scale, scaleOrientation);
position .subtract (this .getPosition ());
orientation .multLeft (this .getOrientation () .copy () .inverse ());
return {
position: position,
orientation: orientation,
scale: scale,
scaleOrientation: scaleOrientation,
};
};
})(),
getLookAtRotation: (() =>
{
const
x = new _standard_Math_Numbers_Vector3_js__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A (),
y = new _standard_Math_Numbers_Vector3_js__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A (),
z = new _standard_Math_Numbers_Vector3_js__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A (),
m = new _standard_Math_Numbers_Matrix3_js__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .A (),
r = new _standard_Math_Numbers_Rotation4_js__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .A ();
return function (fromPoint, toPoint)
{
const up = this .getUpVector (true);
z .assign (fromPoint) .subtract (toPoint) .normalize ();
x .assign (up) .cross (z) .normalize ();
y .assign (z) .cross (x) .normalize ();
m .set (... x, ... y, ... z);
r .setMatrix (m);
return r;
};
})(),
lookAtPoint (layerNode, point, transitionTime = 1, factor = 1, straighten = false)
{
this .getCameraSpaceMatrix () .multVecMatrix (point);
this .getModelMatrix () .copy () .inverse () .multVecMatrix (point);
const minDistance = this .getNearDistance (layerNode .getNavigationInfo ()) * 2;
this .lookAt (layerNode, point, minDistance, transitionTime, factor, straighten);
},
lookAtBBox (layerNode, bbox, transitionTime = 1, factor = 1, straighten = false)
{
if (bbox .size .equals (_standard_Math_Numbers_Vector3_js__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A .Zero))
return;
bbox = bbox .copy () .multRight (this .getModelMatrix () .copy () .inverse ());
this .lookAt (layerNode, bbox .center, this .getLookAtDistance (bbox), transitionTime, factor, straighten);
},
lookAt (layerNode, point, distance, transitionTime = 1, factor = 1, straighten = false)
{
this .timeSensor ._description = "lookAt";
const
offset = point .copy () .add (this .getUserOrientation () .multVecRot (new _standard_Math_Numbers_Vector3_js__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A (0, 0, distance))) .subtract (this .getPosition ());
layerNode .getNavigationInfo () ._transitionStart = true;
this .timeSensor ._cycleInterval = transitionTime;
this .timeSensor ._stopTime = Date .now () / 1000;
this .timeSensor ._startTime = Date .now () / 1000;
this .timeSensor ._isActive .addInterest ("set_active__", this, layerNode .getNavigationInfo ());
this .easeInEaseOut ._easeInEaseOut = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFVec2f (new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFVec2f (0, 1), new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFVec2f (1, 0));
const
translation = this ._positionOffset .getValue () .copy () .lerp (offset, factor),
direction = this .getPosition () .copy () .add (translation) .subtract (point);
let rotation = this ._orientationOffset .getValue () .copy () .multRight (new _standard_Math_Numbers_Rotation4_js__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .A (this .getUserOrientation () .multVecRot (new _standard_Math_Numbers_Vector3_js__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A (0, 0, 1)), direction));
if (straighten)
{
rotation = this .getOrientation () .copy () .inverse () .multRight (this .straightenHorizon (this .getOrientation () .copy () .multRight (rotation)));
}
this .positionInterpolator ._keyValue = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFVec3f (this ._positionOffset, translation);
this .orientationInterpolator ._keyValue = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFRotation (this ._orientationOffset, rotation);
this .scaleInterpolator ._keyValue = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFVec3f (this ._scaleOffset, _standard_Math_Numbers_Vector3_js__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A .One);
this .scaleOrientationInterpolator ._keyValue = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFRotation (this ._scaleOrientationOffset, this ._scaleOrientationOffset);
const relative = this .getRelativeTransformation (this);
this ._fieldOfViewScale = 1;
this ._centerOfRotationOffset = point .copy () .subtract (this .getCenterOfRotation ());
this .nearDistance = distance * (0.125 / 10);
this .farDistance = this .nearDistance * this .getMaxFarValue () / 0.125;
this .setInterpolators (this, relative);
},
straightenView (layerNode)
{
if (this .checkTransition ("straightenView"))
return;
layerNode .getNavigationInfo () ._transitionStart = true;
this .timeSensor ._cycleInterval = 1;
this .timeSensor ._stopTime = Date .now () / 1000;
this .timeSensor ._startTime = Date .now () / 1000;
this .timeSensor ._isActive .addInterest ("set_active__", this, layerNode .getNavigationInfo ());
this .easeInEaseOut ._easeInEaseOut = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFVec2f (new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFVec2f (0, 1), new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .SFVec2f (1, 0));
const rotation = this .getOrientation () .copy () .inverse () .multRight (this .straightenHorizon (this .getUserOrientation ()));
this .positionInterpolator ._keyValue = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFVec3f (this ._positionOffset, this ._positionOffset);
this .orientationInterpolator ._keyValue = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFRotation (this ._orientationOffset, rotation);
this .scaleInterpolator ._keyValue = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFVec3f (this ._scaleOffset, this ._scaleOffset);
this .scaleOrientationInterpolator ._keyValue = new _Fields_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A .MFRotation (this ._scaleOrientationOffset, this ._scaleOrientationOffset);
const relative = this .getRelativeTransformation (this);
this ._fieldOfViewScale = 1;
this .setInterpolators (this, relative);
},
straightenHorizon (orientation, upVector = this .getUpVector (true))
{
return orientation .straighten (upVector);
},
viewAll (bbox)
{
bbox .copy () .multRight (this .modelMatrix .copy () .inverse ());
if (bbox .size .equals (_standard_Math_Numbers_Vector3_js__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .A .Zero))
{
this .set_nearDistance__ ();