x_ite 4.7.12 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +9 -2
- package/Makefile +27 -24
- package/build/bin/version-number.pl +1 -1
- package/build/bin/version.pl +3 -3
- package/build/parts/default.start.frag.js +2 -2
- package/build/parts/x_ite.end.frag.js +1 -2
- package/build/parts/x_ite.start.frag.js +4 -7
- package/dist/assets/components/annotation.js +312 -312
- package/dist/assets/components/annotation.min.js +1 -1
- package/dist/assets/components/cad-geometry.js +536 -538
- package/dist/assets/components/cad-geometry.min.js +1 -1
- package/dist/assets/components/cube-map-texturing.js +797 -796
- package/dist/assets/components/cube-map-texturing.min.js +1 -1
- package/dist/assets/components/dis.js +487 -472
- package/dist/assets/components/dis.min.js +1 -1
- package/dist/assets/components/event-utilities.js +486 -505
- package/dist/assets/components/event-utilities.min.js +1 -1
- package/dist/assets/components/geometry2d.js +1221 -1271
- package/dist/assets/components/geometry2d.min.js +1 -1
- package/dist/assets/components/geospatial.js +2657 -2653
- package/dist/assets/components/geospatial.min.js +1 -2
- package/dist/assets/components/h-anim.js +640 -640
- package/dist/assets/components/h-anim.min.js +1 -1
- package/dist/assets/components/key-device-sensor.js +547 -549
- package/dist/assets/components/key-device-sensor.min.js +1 -1
- package/dist/assets/components/layout.js +1435 -1433
- package/dist/assets/components/layout.min.js +1 -1
- package/dist/assets/components/nurbs.js +3942 -3964
- package/dist/assets/components/nurbs.min.js +1 -2
- package/dist/assets/components/particle-systems.js +3227 -3238
- package/dist/assets/components/particle-systems.min.js +1 -2
- package/dist/assets/components/picking.js +1704 -1712
- package/dist/assets/components/picking.min.js +1 -1
- package/dist/assets/components/projective-texture-mapping.js +553 -553
- package/dist/assets/components/projective-texture-mapping.min.js +1 -1
- package/dist/assets/components/rigid-body-physics.js +3255 -3265
- package/dist/assets/components/rigid-body-physics.min.js +1 -59
- package/dist/assets/components/scripting.js +544 -549
- package/dist/assets/components/scripting.min.js +1 -1
- package/dist/assets/components/texturing-3d.js +2716 -2651
- package/dist/assets/components/texturing-3d.min.js +131 -48
- package/dist/assets/components/volume-rendering.js +2815 -2804
- package/dist/assets/components/volume-rendering.min.js +1 -3
- package/dist/assets/components/x_ite.js +142 -144
- package/dist/assets/components/x_ite.min.js +1 -1
- package/dist/assets/shaders/webgl1/Gouraud.fs +52 -15
- package/dist/assets/shaders/webgl1/Gouraud.vs +8 -9
- package/dist/assets/shaders/webgl1/{Wireframe.fs → Line.fs} +0 -0
- package/dist/assets/shaders/webgl1/{Wireframe.vs → Line.vs} +1 -1
- package/dist/assets/shaders/webgl1/PBR.fs +785 -0
- package/dist/assets/shaders/webgl1/PBR.vs +37 -0
- package/dist/assets/shaders/webgl1/Phong.fs +204 -32
- package/dist/assets/shaders/webgl1/Phong.vs +2 -3
- package/dist/assets/shaders/webgl1/{PointSet.fs → Point.fs} +59 -33
- package/dist/assets/shaders/webgl1/{PointSet.vs → Point.vs} +2 -2
- package/dist/assets/shaders/webgl1/Unlit.fs +73 -18
- package/dist/assets/shaders/webgl1/Unlit.vs +2 -3
- package/dist/assets/shaders/webgl2/Gouraud.fs +31 -19
- package/dist/assets/shaders/webgl2/Gouraud.vs +8 -9
- package/dist/assets/shaders/webgl2/{Wireframe.fs → Line.fs} +0 -0
- package/dist/assets/shaders/webgl2/{Wireframe.vs → Line.vs} +1 -1
- package/dist/assets/shaders/webgl2/PBR.fs +913 -0
- package/dist/assets/shaders/webgl2/PBR.vs +37 -0
- package/dist/assets/shaders/webgl2/Phong.fs +196 -35
- package/dist/assets/shaders/webgl2/Phong.vs +2 -3
- package/dist/assets/shaders/webgl2/{PointSet.fs → Point.fs} +87 -86
- package/dist/assets/shaders/webgl2/{PointSet.vs → Point.vs} +2 -2
- package/dist/assets/shaders/webgl2/Unlit.fs +55 -22
- package/dist/assets/shaders/webgl2/Unlit.vs +2 -3
- package/dist/example.html +2 -2
- package/dist/x_ite.css +316 -328
- package/dist/x_ite.js +55663 -52034
- package/dist/x_ite.min.js +79 -41
- package/dist/x_ite.zip +0 -0
- package/docs/Custom-Shaders.md +4 -3
- package/docs/_config.yml +1 -1
- package/docs/index.md +60 -7
- package/package.json +20 -20
- package/src/assets/components/annotation.js +24 -24
- package/src/assets/components/cad-geometry.js +24 -25
- package/src/assets/components/cube-map-texturing.js +18 -19
- package/src/assets/components/dis.js +22 -23
- package/src/assets/components/event-utilities.js +28 -29
- package/src/assets/components/geometry2d.js +28 -29
- package/src/assets/components/geospatial.js +34 -35
- package/src/assets/components/h-anim.js +22 -22
- package/src/assets/components/key-device-sensor.js +18 -19
- package/src/assets/components/layout.js +24 -25
- package/src/assets/components/nurbs.js +44 -45
- package/src/assets/components/particle-systems.js +36 -37
- package/src/assets/components/picking.js +25 -25
- package/src/assets/components/projective-texture-mapping.js +16 -16
- package/src/assets/components/rigid-body-physics.js +48 -48
- package/src/assets/components/scripting.js +14 -15
- package/src/assets/components/texturing-3d.js +26 -27
- package/src/assets/components/volume-rendering.js +46 -46
- package/src/assets/components/x_ite.js +12 -12
- package/src/assets/shaders/Types.glsl +230 -51
- package/src/assets/shaders/webgl1/Background.fs +2 -2
- package/src/assets/shaders/webgl1/Background.vs +4 -4
- package/src/assets/shaders/webgl1/Depth.fs +2 -2
- package/src/assets/shaders/webgl1/Depth.vs +3 -3
- package/src/assets/shaders/webgl1/Fallback.fs +15 -15
- package/src/assets/shaders/webgl1/Fallback.vs +5 -5
- package/src/assets/shaders/webgl1/FallbackUnlit.fs +4 -4
- package/src/assets/shaders/webgl1/FallbackUnlit.vs +3 -3
- package/src/assets/shaders/webgl1/Gouraud.fs +14 -14
- package/src/assets/shaders/webgl1/Gouraud.vs +54 -69
- package/src/assets/shaders/webgl1/Line.fs +74 -0
- package/src/assets/shaders/webgl1/Line.vs +63 -0
- package/src/assets/shaders/webgl1/PBR.fs +364 -0
- package/src/assets/shaders/webgl1/PBR.vs +46 -0
- package/src/assets/shaders/webgl1/Phong.fs +207 -84
- package/src/assets/shaders/webgl1/Phong.vs +17 -18
- package/src/assets/shaders/webgl1/Point.fs +88 -0
- package/src/assets/shaders/webgl1/Point.vs +70 -0
- package/src/assets/shaders/webgl1/Unlit.fs +53 -28
- package/src/assets/shaders/webgl1/Unlit.vs +17 -18
- package/src/assets/shaders/webgl1/include/ClipPlanes.glsl +7 -7
- package/src/assets/shaders/webgl1/include/Colors.glsl +27 -0
- package/src/assets/shaders/webgl1/include/Fog.glsl +17 -17
- package/src/assets/shaders/webgl1/include/Hatch.glsl +8 -8
- package/src/assets/shaders/webgl1/include/Normal.glsl +44 -0
- package/src/assets/shaders/webgl1/include/Pack.glsl +11 -11
- package/src/assets/shaders/webgl1/include/Perlin.glsl +19 -19
- package/src/assets/shaders/webgl1/include/Shadow.glsl +212 -212
- package/src/assets/shaders/webgl1/include/SpotFactor.glsl +12 -0
- package/src/assets/shaders/webgl1/include/Texture.glsl +444 -393
- package/src/assets/shaders/webgl2/Background.fs +2 -2
- package/src/assets/shaders/webgl2/Background.vs +4 -4
- package/src/assets/shaders/webgl2/Depth.fs +2 -2
- package/src/assets/shaders/webgl2/Depth.vs +3 -3
- package/src/assets/shaders/webgl2/Gouraud.fs +14 -14
- package/src/assets/shaders/webgl2/Gouraud.vs +54 -69
- package/src/assets/shaders/webgl2/Line.fs +73 -0
- package/src/assets/shaders/webgl2/Line.vs +64 -0
- package/src/assets/shaders/webgl2/PBR.fs +370 -0
- package/src/assets/shaders/webgl2/PBR.vs +48 -0
- package/src/assets/shaders/webgl2/Phong.fs +219 -84
- package/src/assets/shaders/webgl2/Phong.vs +17 -18
- package/src/assets/shaders/webgl2/Point.fs +87 -0
- package/src/assets/shaders/webgl2/Point.vs +71 -0
- package/src/assets/shaders/webgl2/Unlit.fs +56 -28
- package/src/assets/shaders/webgl2/Unlit.vs +17 -18
- package/src/assets/shaders/webgl2/include/ClipPlanes.glsl +7 -7
- package/src/assets/shaders/webgl2/include/Colors.glsl +27 -0
- package/src/assets/shaders/webgl2/include/Fog.glsl +34 -34
- package/src/assets/shaders/webgl2/include/Hatch.glsl +8 -8
- package/src/assets/shaders/webgl2/include/Normal.glsl +46 -0
- package/src/assets/shaders/webgl2/include/Pack.glsl +11 -11
- package/src/assets/shaders/webgl2/include/Perlin.glsl +19 -20
- package/src/assets/shaders/webgl2/include/Shadow.glsl +226 -226
- package/src/assets/shaders/webgl2/include/SpotFactor.glsl +12 -0
- package/src/assets/shaders/webgl2/include/Texture.glsl +557 -537
- package/src/bookmarks.js +92 -92
- package/src/examples.js +147 -147
- package/src/lib/ammojs/AmmoJS.js +2 -2
- package/src/lib/ammojs/Makefile +14 -15
- package/src/lib/jquery.fullscreen-min.js +2 -2
- package/src/lib/nurbs/extras/sample.js +215 -215
- package/src/lib/nurbs/nurbs.js +326 -326
- package/src/lib/nurbs/src/evaluate.js +405 -405
- package/src/lib/nurbs/src/numerical-derivative.js +48 -48
- package/src/lib/nurbs/src/support.js +143 -143
- package/src/lib/nurbs/src/transform.js +70 -70
- package/src/lib/nurbs/src/utils/accessor-preamble.js +23 -23
- package/src/lib/nurbs/src/utils/bisection-search.js +18 -18
- package/src/lib/nurbs/src/utils/cache-key.js +49 -50
- package/src/lib/nurbs/src/utils/create-accessors.js +101 -101
- package/src/lib/nurbs/src/utils/infer-type.js +43 -43
- package/src/lib/nurbs/src/utils/is-array-like.js +5 -5
- package/src/lib/nurbs/src/utils/is-ndarray-like.js +11 -11
- package/src/lib/nurbs/src/utils/is-ndarray.js +13 -13
- package/src/lib/nurbs/src/utils/ndloop.js +18 -18
- package/src/lib/nurbs/src/utils/size-getter.js +15 -15
- package/src/lib/nurbs/src/utils/variable.js +25 -25
- package/src/lib/opentype.js/bin/ot +27 -27
- package/src/lib/opentype.js/dist/opentype.js +5 -5
- package/src/lib/opentype.js/font-inspector.html +1 -1
- package/src/lib/opentype.js/site.css +1 -3
- package/src/locale/gettext.js +73 -73
- package/src/spinner.css +40 -43
- package/src/standard/Geospatial/Geodetic.js +195 -195
- package/src/standard/Geospatial/ReferenceEllipsoids.js +43 -43
- package/src/standard/Geospatial/UniversalTransverseMercator.js +159 -159
- package/src/standard/Math/Algorithm.js +199 -187
- package/src/standard/Math/Algorithms/Bezier.js +80 -80
- package/src/standard/Math/Algorithms/MergeSort.js +49 -49
- package/src/standard/Math/Algorithms/PartialSort.js +36 -36
- package/src/standard/Math/Algorithms/QuickSort.js +51 -51
- package/src/standard/Math/Algorithms/SAT.js +62 -62
- package/src/standard/Math/Algorithms/eigendecomposition.js +141 -141
- package/src/standard/Math/Geometry/Box2.js +205 -205
- package/src/standard/Math/Geometry/Box3.js +624 -624
- package/src/standard/Math/Geometry/Camera.js +68 -68
- package/src/standard/Math/Geometry/Cylinder3.js +112 -112
- package/src/standard/Math/Geometry/Line3.js +188 -153
- package/src/standard/Math/Geometry/Plane3.js +120 -120
- package/src/standard/Math/Geometry/Sphere3.js +148 -148
- package/src/standard/Math/Geometry/Spheroid3.js +38 -38
- package/src/standard/Math/Geometry/Triangle2.js +19 -19
- package/src/standard/Math/Geometry/Triangle3.js +148 -148
- package/src/standard/Math/Geometry/ViewVolume.js +359 -359
- package/src/standard/Math/Numbers/Color3.js +219 -214
- package/src/standard/Math/Numbers/Color4.js +148 -142
- package/src/standard/Math/Numbers/Complex.js +139 -139
- package/src/standard/Math/Numbers/Matrix2.js +193 -193
- package/src/standard/Math/Numbers/Matrix3.js +679 -679
- package/src/standard/Math/Numbers/Matrix4.js +883 -883
- package/src/standard/Math/Numbers/Quaternion.js +496 -496
- package/src/standard/Math/Numbers/Rotation4.js +421 -415
- package/src/standard/Math/Numbers/Vector2.js +220 -220
- package/src/standard/Math/Numbers/Vector3.js +280 -280
- package/src/standard/Math/Numbers/Vector4.js +296 -296
- package/src/standard/Math/Utility/BVH.js +303 -303
- package/src/standard/Math/Utility/MatrixStack.js +64 -64
- package/src/standard/Networking/BinaryTransport.js +67 -67
- package/src/standard/Time/MicroTime.js +22 -22
- package/src/standard/Utility/DataStorage.js +85 -81
- package/src/standard/Utility/MapUtilities.js +14 -1
- package/src/standard/Utility/ObjectCache.js +24 -24
- package/src/standard/Utility/Shuffle.js +13 -13
- package/src/tests.js +355 -384
- package/src/x_ite/Base/Events.js +64 -55
- package/src/x_ite/{Basic/X3DArrayField.js → Base/FieldArray.js} +19 -12
- package/src/x_ite/Base/FieldDefinitionArray.js +75 -0
- package/src/x_ite/{Basic/FieldDefinitionArray.js → Base/X3DArrayField.js} +35 -59
- package/src/x_ite/Base/X3DBaseNode.js +588 -0
- package/src/x_ite/{Bits → Base}/X3DCast.js +23 -22
- package/src/x_ite/Base/X3DChildObject.js +68 -62
- package/src/x_ite/{Bits → Base}/X3DConstants.js +85 -85
- package/src/x_ite/Base/X3DEventObject.js +73 -68
- package/src/x_ite/Base/X3DField.js +450 -0
- package/src/x_ite/Base/X3DFieldDefinition.js +78 -0
- package/src/x_ite/Base/X3DInfoArray.js +291 -0
- package/src/x_ite/Base/X3DObject.js +152 -109
- package/src/x_ite/Base/X3DObjectArrayField.js +573 -0
- package/src/x_ite/Base/X3DTypedArrayField.js +866 -0
- package/src/x_ite/Browser/Core/BrowserOptions.js +376 -394
- package/src/x_ite/Browser/Core/BrowserProperties.js +38 -38
- package/src/x_ite/Browser/Core/BrowserTimings.js +173 -172
- package/src/x_ite/Browser/Core/ContextMenu.js +547 -551
- package/src/x_ite/Browser/Core/Notification.js +57 -56
- package/src/x_ite/Browser/Core/PrimitiveQuality.js +8 -8
- package/src/x_ite/Browser/Core/RenderingProperties.js +55 -55
- package/src/x_ite/Browser/Core/Shading.js +10 -10
- package/src/x_ite/Browser/Core/TextureQuality.js +8 -8
- package/src/x_ite/Browser/Core/X3DCoreContext.js +746 -724
- package/src/x_ite/Browser/EnvironmentalEffects/X3DEnvironmentalEffectsContext.js +33 -25
- package/src/x_ite/Browser/Followers/X3DArrayChaserTemplate.js +23 -23
- package/src/x_ite/Browser/Followers/X3DArrayFollowerTemplate.js +127 -127
- package/src/x_ite/Browser/Geometry2D/Arc2DOptions.js +25 -25
- package/src/x_ite/Browser/Geometry2D/ArcClose2DOptions.js +25 -25
- package/src/x_ite/Browser/Geometry2D/Circle2DOptions.js +56 -55
- package/src/x_ite/Browser/Geometry2D/Disk2DOptions.js +116 -116
- package/src/x_ite/Browser/Geometry2D/Rectangle2DOptions.js +59 -59
- package/src/x_ite/Browser/Geometry2D/X3DGeometry2DContext.js +80 -77
- package/src/x_ite/Browser/Geometry3D/BoxOptions.js +70 -70
- package/src/x_ite/Browser/Geometry3D/ConeOptions.js +26 -26
- package/src/x_ite/Browser/Geometry3D/CylinderOptions.js +27 -27
- package/src/x_ite/Browser/Geometry3D/IcoSphere.js +357 -357
- package/src/x_ite/Browser/Geometry3D/IcoSphereOptions.js +61 -61
- package/src/x_ite/Browser/Geometry3D/QuadSphereOptions.js +243 -241
- package/src/x_ite/Browser/Geometry3D/X3DGeometry3DContext.js +37 -34
- package/src/x_ite/Browser/Geospatial/Geocentric.js +27 -27
- package/src/x_ite/Browser/Geospatial/Geospatial.js +157 -156
- package/src/x_ite/Browser/Grouping/X3DGroupingContext.js +38 -33
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolator.js +128 -130
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolator1.js +39 -41
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolator2.js +3 -3
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolator3.js +3 -3
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolatorTemplate.js +54 -56
- package/src/x_ite/Browser/Interpolation/SquatInterpolator.js +54 -56
- package/src/x_ite/Browser/KeyDeviceSensor/X3DKeyDeviceSensorContext.js +44 -41
- package/src/x_ite/Browser/Layering/X3DLayeringContext.js +20 -18
- package/src/x_ite/Browser/Layout/ScreenText.js +406 -405
- package/src/x_ite/Browser/Layout/X3DLayoutContext.js +36 -30
- package/src/x_ite/Browser/Lighting/X3DLightingContext.js +54 -50
- package/src/x_ite/Browser/NURBS/NURBS.js +417 -417
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +753 -753
- package/src/x_ite/Browser/Navigation/FlyViewer.js +39 -39
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +461 -461
- package/src/x_ite/Browser/Navigation/NoneViewer.js +18 -18
- package/src/x_ite/Browser/Navigation/PlaneViewer.js +193 -193
- package/src/x_ite/Browser/Navigation/WalkViewer.js +61 -61
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +709 -710
- package/src/x_ite/Browser/Navigation/X3DNavigationContext.js +188 -182
- package/src/x_ite/Browser/Navigation/X3DViewer.js +160 -160
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +152 -143
- package/src/x_ite/Browser/Networking/urls.js +31 -31
- package/src/x_ite/Browser/ParticleSystems/X3DParticleSystemsContext.js +17 -13
- package/src/x_ite/Browser/Picking/IntersectionType.js +7 -7
- package/src/x_ite/Browser/Picking/MatchCriterion.js +8 -8
- package/src/x_ite/Browser/Picking/SortOrder.js +9 -9
- package/src/x_ite/Browser/Picking/VolumePicker.js +138 -138
- package/src/x_ite/Browser/Picking/X3DPickingContext.js +80 -69
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +208 -209
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDeviceSensorContainer.js +34 -34
- package/src/x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext.js +269 -263
- package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +132 -119
- package/src/x_ite/Browser/RigidBodyPhysics/AppliedParametersType.js +14 -14
- package/src/x_ite/Browser/Scripting/X3DScriptingContext.js +20 -19
- package/src/x_ite/Browser/Scripting/evaluate.js +7 -7
- package/src/x_ite/Browser/Shaders/Shader.js +152 -159
- package/src/x_ite/Browser/Shaders/ShaderSource.js +81 -63
- package/src/x_ite/Browser/Shaders/ShaderTest.js +97 -98
- package/src/x_ite/Browser/Shaders/X3DShadersContext.js +256 -249
- package/src/x_ite/Browser/Shape/AlphaMode.js +9 -9
- package/src/x_ite/Browser/Shape/X3DShapeContext.js +111 -89
- package/src/x_ite/Browser/Sound/X3DSoundContext.js +11 -11
- package/src/x_ite/Browser/Text/PolygonText.js +319 -319
- package/src/x_ite/Browser/Text/TextAlignment.js +9 -9
- package/src/x_ite/Browser/Text/X3DTextContext.js +72 -65
- package/src/x_ite/Browser/Text/X3DTextGeometry.js +506 -506
- package/src/x_ite/Browser/Texturing/MultiTextureFunctionType.js +8 -8
- package/src/x_ite/Browser/Texturing/MultiTextureModeType.js +25 -25
- package/src/x_ite/Browser/Texturing/MultiTextureSourceType.js +9 -9
- package/src/x_ite/Browser/Texturing/TextureCoordinateGeneratorModeType.js +17 -17
- package/src/x_ite/Browser/Texturing/X3DTexturingContext.js +259 -224
- package/src/x_ite/Browser/Texturing3D/DICOMParser.js +1066 -1066
- package/src/x_ite/Browser/Texturing3D/NRRDParser.js +641 -630
- package/src/x_ite/Browser/Time/X3DTimeContext.js +54 -37
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/VolumeRendering/VolumeStyle.fs +55 -55
- package/src/x_ite/Browser/VolumeRendering/VolumeStyle.vs +5 -5
- package/src/x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext.js +52 -41
- package/src/x_ite/Browser/X3DBrowser.js +819 -755
- package/src/x_ite/Browser/X3DBrowserContext.js +253 -220
- package/src/x_ite/Components/Annotation/AnnotationLayer.js +43 -43
- package/src/x_ite/Components/Annotation/AnnotationTarget.js +38 -38
- package/src/x_ite/Components/Annotation/GroupAnnotation.js +48 -48
- package/src/x_ite/Components/Annotation/IconAnnotation.js +46 -46
- package/src/x_ite/Components/Annotation/TextAnnotation.js +39 -39
- package/src/x_ite/Components/Annotation/URLAnnotation.js +38 -38
- package/src/x_ite/Components/Annotation/X3DAnnotationNode.js +16 -16
- package/src/x_ite/Components/CADGeometry/CADAssembly.js +41 -41
- package/src/x_ite/Components/CADGeometry/CADFace.js +189 -189
- package/src/x_ite/Components/CADGeometry/CADLayer.js +38 -38
- package/src/x_ite/Components/CADGeometry/CADPart.js +46 -46
- package/src/x_ite/Components/CADGeometry/IndexedQuadSet.js +67 -67
- package/src/x_ite/Components/CADGeometry/QuadSet.js +64 -63
- package/src/x_ite/Components/CADGeometry/X3DProductStructureChildNode.js +13 -15
- package/src/x_ite/Components/Core/MetadataBoolean.js +38 -40
- package/src/x_ite/Components/Core/MetadataDouble.js +38 -40
- package/src/x_ite/Components/Core/MetadataFloat.js +38 -40
- package/src/x_ite/Components/Core/MetadataInteger.js +38 -40
- package/src/x_ite/Components/Core/MetadataSet.js +38 -40
- package/src/x_ite/Components/Core/MetadataString.js +38 -40
- package/src/x_ite/Components/Core/WorldInfo.js +42 -42
- package/src/x_ite/Components/Core/X3DBindableNode.js +20 -20
- package/src/x_ite/Components/Core/X3DChildNode.js +38 -40
- package/src/x_ite/Components/Core/X3DInfoNode.js +13 -15
- package/src/x_ite/Components/Core/X3DMetadataObject.js +11 -13
- package/src/x_ite/Components/Core/X3DNode.js +795 -14
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +585 -479
- package/src/x_ite/Components/Core/X3DSensorNode.js +13 -15
- package/src/x_ite/Components/Core.js +39 -39
- package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +193 -200
- package/src/x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture.js +209 -206
- package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +213 -219
- package/src/x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode.js +69 -60
- package/src/x_ite/Components/DIS/DISEntityManager.js +38 -40
- package/src/x_ite/Components/DIS/DISEntityTypeMapping.js +59 -41
- package/src/x_ite/Components/DIS/EspduTransform.js +128 -128
- package/src/x_ite/Components/DIS/ReceiverPdu.js +68 -68
- package/src/x_ite/Components/DIS/SignalPdu.js +68 -68
- package/src/x_ite/Components/DIS/TransmitterPdu.js +84 -84
- package/src/x_ite/Components/EnvironmentalEffects/Background.js +87 -89
- package/src/x_ite/Components/EnvironmentalEffects/Fog.js +59 -59
- package/src/x_ite/Components/EnvironmentalEffects/FogCoordinate.js +78 -78
- package/src/x_ite/Components/EnvironmentalEffects/LocalFog.js +56 -56
- package/src/x_ite/Components/EnvironmentalEffects/TextureBackground.js +86 -88
- package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +582 -589
- package/src/x_ite/Components/EnvironmentalEffects/X3DFogObject.js +105 -105
- package/src/x_ite/Components/EnvironmentalEffects.js +25 -25
- package/src/x_ite/Components/EnvironmentalSensor/ProximitySensor.js +229 -229
- package/src/x_ite/Components/EnvironmentalSensor/TransformSensor.js +256 -256
- package/src/x_ite/Components/EnvironmentalSensor/VisibilitySensor.js +114 -114
- package/src/x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode.js +71 -71
- package/src/x_ite/Components/EnvironmentalSensor.js +19 -19
- package/src/x_ite/Components/EventUtilities/BooleanFilter.js +50 -52
- package/src/x_ite/Components/EventUtilities/BooleanSequencer.js +50 -52
- package/src/x_ite/Components/EventUtilities/BooleanToggle.js +43 -45
- package/src/x_ite/Components/EventUtilities/BooleanTrigger.js +42 -44
- package/src/x_ite/Components/EventUtilities/IntegerSequencer.js +50 -52
- package/src/x_ite/Components/EventUtilities/IntegerTrigger.js +43 -45
- package/src/x_ite/Components/EventUtilities/TimeTrigger.js +43 -45
- package/src/x_ite/Components/EventUtilities/X3DSequencerNode.js +92 -94
- package/src/x_ite/Components/EventUtilities/X3DTriggerNode.js +13 -15
- package/src/x_ite/Components/Followers/ColorChaser.js +78 -78
- package/src/x_ite/Components/Followers/ColorDamper.js +78 -78
- package/src/x_ite/Components/Followers/CoordinateChaser.js +46 -46
- package/src/x_ite/Components/Followers/CoordinateDamper.js +48 -48
- package/src/x_ite/Components/Followers/OrientationChaser.js +64 -64
- package/src/x_ite/Components/Followers/OrientationDamper.js +61 -61
- package/src/x_ite/Components/Followers/PositionChaser.js +42 -42
- package/src/x_ite/Components/Followers/PositionChaser2D.js +42 -42
- package/src/x_ite/Components/Followers/PositionDamper.js +44 -44
- package/src/x_ite/Components/Followers/PositionDamper2D.js +44 -44
- package/src/x_ite/Components/Followers/ScalarChaser.js +70 -70
- package/src/x_ite/Components/Followers/ScalarDamper.js +60 -60
- package/src/x_ite/Components/Followers/TexCoordChaser2D.js +46 -46
- package/src/x_ite/Components/Followers/TexCoordDamper2D.js +48 -48
- package/src/x_ite/Components/Followers/X3DChaserNode.js +194 -194
- package/src/x_ite/Components/Followers/X3DDamperNode.js +120 -120
- package/src/x_ite/Components/Followers/X3DFollowerNode.js +83 -83
- package/src/x_ite/Components/Followers.js +45 -45
- package/src/x_ite/Components/Geometry2D/Arc2D.js +99 -113
- package/src/x_ite/Components/Geometry2D/ArcClose2D.js +164 -166
- package/src/x_ite/Components/Geometry2D/Circle2D.js +59 -67
- package/src/x_ite/Components/Geometry2D/Disk2D.js +207 -211
- package/src/x_ite/Components/Geometry2D/Polyline2D.js +43 -52
- package/src/x_ite/Components/Geometry2D/Polypoint2D.js +43 -60
- package/src/x_ite/Components/Geometry2D/Rectangle2D.js +76 -73
- package/src/x_ite/Components/Geometry2D/TriangleSet2D.js +69 -71
- package/src/x_ite/Components/Geometry3D/Box.js +90 -86
- package/src/x_ite/Components/Geometry3D/Cone.js +185 -187
- package/src/x_ite/Components/Geometry3D/Cylinder.js +246 -246
- package/src/x_ite/Components/Geometry3D/ElevationGrid.js +383 -384
- package/src/x_ite/Components/Geometry3D/Extrusion.js +653 -647
- package/src/x_ite/Components/Geometry3D/IndexedFaceSet.js +437 -445
- package/src/x_ite/Components/Geometry3D/Sphere.js +72 -74
- package/src/x_ite/Components/Geometry3D.js +25 -25
- package/src/x_ite/Components/Geospatial/GeoCoordinate.js +189 -191
- package/src/x_ite/Components/Geospatial/GeoElevationGrid.js +381 -383
- package/src/x_ite/Components/Geospatial/GeoLOD.js +397 -397
- package/src/x_ite/Components/Geospatial/GeoLocation.js +56 -56
- package/src/x_ite/Components/Geospatial/GeoMetadata.js +54 -36
- package/src/x_ite/Components/Geospatial/GeoOrigin.js +50 -52
- package/src/x_ite/Components/Geospatial/GeoPositionInterpolator.js +81 -83
- package/src/x_ite/Components/Geospatial/GeoProximitySensor.js +95 -97
- package/src/x_ite/Components/Geospatial/GeoTouchSensor.js +77 -79
- package/src/x_ite/Components/Geospatial/GeoTransform.js +79 -79
- package/src/x_ite/Components/Geospatial/GeoViewpoint.js +278 -278
- package/src/x_ite/Components/Geospatial/X3DGeospatialObject.js +216 -218
- package/src/x_ite/Components/Grouping/Group.js +37 -37
- package/src/x_ite/Components/Grouping/StaticGroup.js +245 -245
- package/src/x_ite/Components/Grouping/Switch.js +234 -234
- package/src/x_ite/Components/Grouping/Transform.js +42 -42
- package/src/x_ite/Components/Grouping/X3DBoundedObject.js +93 -93
- package/src/x_ite/Components/Grouping/X3DGroupingNode.js +654 -649
- package/src/x_ite/Components/Grouping/X3DTransformMatrix3DNode.js +99 -99
- package/src/x_ite/Components/Grouping/X3DTransformNode.js +31 -31
- package/src/x_ite/Components/Grouping.js +27 -27
- package/src/x_ite/Components/HAnim/HAnimDisplacer.js +35 -35
- package/src/x_ite/Components/HAnim/HAnimHumanoid.js +293 -293
- package/src/x_ite/Components/HAnim/HAnimJoint.js +137 -137
- package/src/x_ite/Components/HAnim/HAnimMotion.js +50 -50
- package/src/x_ite/Components/HAnim/HAnimSegment.js +44 -44
- package/src/x_ite/Components/HAnim/HAnimSite.js +43 -43
- package/src/x_ite/Components/Interpolation/ColorInterpolator.js +61 -63
- package/src/x_ite/Components/Interpolation/CoordinateInterpolator.js +60 -62
- package/src/x_ite/Components/Interpolation/CoordinateInterpolator2D.js +57 -59
- package/src/x_ite/Components/Interpolation/EaseInEaseOut.js +79 -80
- package/src/x_ite/Components/Interpolation/NormalInterpolator.js +96 -93
- package/src/x_ite/Components/Interpolation/OrientationInterpolator.js +70 -70
- package/src/x_ite/Components/Interpolation/PositionInterpolator.js +57 -59
- package/src/x_ite/Components/Interpolation/PositionInterpolator2D.js +57 -59
- package/src/x_ite/Components/Interpolation/ScalarInterpolator.js +53 -55
- package/src/x_ite/Components/Interpolation/SplinePositionInterpolator.js +78 -80
- package/src/x_ite/Components/Interpolation/SplinePositionInterpolator2D.js +77 -79
- package/src/x_ite/Components/Interpolation/SplineScalarInterpolator.js +78 -80
- package/src/x_ite/Components/Interpolation/SquadOrientationInterpolator.js +66 -66
- package/src/x_ite/Components/Interpolation/X3DInterpolatorNode.js +67 -69
- package/src/x_ite/Components/Interpolation.js +39 -39
- package/src/x_ite/Components/KeyDeviceSensor/KeySensor.js +304 -306
- package/src/x_ite/Components/KeyDeviceSensor/StringSensor.js +102 -104
- package/src/x_ite/Components/KeyDeviceSensor/X3DKeyDeviceSensorNode.js +51 -51
- package/src/x_ite/Components/Layering/Layer.js +50 -50
- package/src/x_ite/Components/Layering/LayerSet.js +160 -161
- package/src/x_ite/Components/Layering/Viewport.js +118 -118
- package/src/x_ite/Components/Layering/X3DLayerNode.js +322 -322
- package/src/x_ite/Components/Layering/X3DViewportNode.js +13 -13
- package/src/x_ite/Components/Layering.js +21 -21
- package/src/x_ite/Components/Layout/Layout.js +576 -578
- package/src/x_ite/Components/Layout/LayoutGroup.js +126 -126
- package/src/x_ite/Components/Layout/LayoutLayer.js +53 -53
- package/src/x_ite/Components/Layout/ScreenFontStyle.js +48 -48
- package/src/x_ite/Components/Layout/ScreenGroup.js +136 -136
- package/src/x_ite/Components/Layout/X3DLayoutNode.js +12 -14
- package/src/x_ite/Components/Lighting/DirectionalLight.js +239 -246
- package/src/x_ite/Components/Lighting/PointLight.js +296 -303
- package/src/x_ite/Components/Lighting/SpotLight.js +321 -316
- package/src/x_ite/Components/Lighting/X3DLightNode.js +153 -153
- package/src/x_ite/Components/Lighting.js +19 -19
- package/src/x_ite/Components/NURBS/Contour2D.js +81 -83
- package/src/x_ite/Components/NURBS/ContourPolyline2D.js +100 -102
- package/src/x_ite/Components/NURBS/CoordinateDouble.js +32 -34
- package/src/x_ite/Components/NURBS/NurbsCurve.js +167 -169
- package/src/x_ite/Components/NURBS/NurbsCurve2D.js +149 -149
- package/src/x_ite/Components/NURBS/NurbsOrientationInterpolator.js +166 -166
- package/src/x_ite/Components/NURBS/NurbsPatchSurface.js +45 -47
- package/src/x_ite/Components/NURBS/NurbsPositionInterpolator.js +154 -154
- package/src/x_ite/Components/NURBS/NurbsSet.js +125 -125
- package/src/x_ite/Components/NURBS/NurbsSurfaceInterpolator.js +128 -130
- package/src/x_ite/Components/NURBS/NurbsSweptSurface.js +120 -122
- package/src/x_ite/Components/NURBS/NurbsSwungSurface.js +120 -122
- package/src/x_ite/Components/NURBS/NurbsTextureCoordinate.js +93 -93
- package/src/x_ite/Components/NURBS/NurbsTrimmedSurface.js +88 -90
- package/src/x_ite/Components/NURBS/X3DNurbsControlCurveNode.js +13 -15
- package/src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js +339 -339
- package/src/x_ite/Components/NURBS/X3DParametricGeometryNode.js +18 -20
- package/src/x_ite/Components/Navigation/Billboard.js +132 -132
- package/src/x_ite/Components/Navigation/Collision.js +116 -116
- package/src/x_ite/Components/Navigation/LOD.js +308 -308
- package/src/x_ite/Components/Navigation/NavigationInfo.js +279 -285
- package/src/x_ite/Components/Navigation/OrthoViewpoint.js +258 -258
- package/src/x_ite/Components/Navigation/Viewpoint.js +137 -137
- package/src/x_ite/Components/Navigation/ViewpointGroup.js +169 -171
- package/src/x_ite/Components/Navigation/X3DViewpointNode.js +450 -453
- package/src/x_ite/Components/Navigation.js +27 -27
- package/src/x_ite/Components/Networking/Anchor.js +140 -128
- package/src/x_ite/Components/Networking/Inline.js +156 -197
- package/src/x_ite/Components/Networking/LoadSensor.js +193 -195
- package/src/x_ite/Components/Networking/X3DNetworkSensorNode.js +13 -15
- package/src/x_ite/Components/Networking/X3DUrlObject.js +170 -116
- package/src/x_ite/Components/Networking.js +21 -21
- package/src/x_ite/Components/ParticleSystems/BoundedPhysicsModel.js +62 -64
- package/src/x_ite/Components/ParticleSystems/ConeEmitter.js +81 -83
- package/src/x_ite/Components/ParticleSystems/ExplosionEmitter.js +59 -61
- package/src/x_ite/Components/ParticleSystems/ForcePhysicsModel.js +42 -44
- package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +1433 -1433
- package/src/x_ite/Components/ParticleSystems/PointEmitter.js +77 -79
- package/src/x_ite/Components/ParticleSystems/PolylineEmitter.js +196 -196
- package/src/x_ite/Components/ParticleSystems/SurfaceEmitter.js +195 -195
- package/src/x_ite/Components/ParticleSystems/VolumeEmitter.js +250 -250
- package/src/x_ite/Components/ParticleSystems/WindPhysicsModel.js +69 -71
- package/src/x_ite/Components/ParticleSystems/X3DParticleEmitterNode.js +346 -346
- package/src/x_ite/Components/ParticleSystems/X3DParticlePhysicsModelNode.js +15 -17
- package/src/x_ite/Components/Picking/LinePickSensor.js +284 -286
- package/src/x_ite/Components/Picking/PickableGroup.js +155 -155
- package/src/x_ite/Components/Picking/PointPickSensor.js +272 -272
- package/src/x_ite/Components/Picking/PrimitivePickSensor.js +207 -209
- package/src/x_ite/Components/Picking/VolumePickSensor.js +182 -184
- package/src/x_ite/Components/Picking/X3DPickSensorNode.js +382 -382
- package/src/x_ite/Components/Picking/X3DPickableObject.js +28 -30
- package/src/x_ite/Components/PointingDeviceSensor/CylinderSensor.js +257 -259
- package/src/x_ite/Components/PointingDeviceSensor/PlaneSensor.js +245 -247
- package/src/x_ite/Components/PointingDeviceSensor/SphereSensor.js +173 -175
- package/src/x_ite/Components/PointingDeviceSensor/TouchSensor.js +61 -63
- package/src/x_ite/Components/PointingDeviceSensor/X3DDragSensorNode.js +14 -16
- package/src/x_ite/Components/PointingDeviceSensor/X3DPointingDeviceSensorNode.js +57 -59
- package/src/x_ite/Components/PointingDeviceSensor/X3DTouchSensorNode.js +19 -21
- package/src/x_ite/Components/PointingDeviceSensor.js +25 -25
- package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorParallel.js +191 -191
- package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorPerspective.js +162 -162
- package/src/x_ite/Components/ProjectiveTextureMapping/X3DTextureProjectorNode.js +156 -156
- package/src/x_ite/Components/Rendering/ClipPlane.js +120 -120
- package/src/x_ite/Components/Rendering/Color.js +112 -112
- package/src/x_ite/Components/Rendering/ColorRGBA.js +114 -114
- package/src/x_ite/Components/Rendering/Coordinate.js +33 -35
- package/src/x_ite/Components/Rendering/IndexedLineSet.js +236 -243
- package/src/x_ite/Components/Rendering/IndexedTriangleFanSet.js +102 -102
- package/src/x_ite/Components/Rendering/IndexedTriangleSet.js +55 -55
- package/src/x_ite/Components/Rendering/IndexedTriangleStripSet.js +110 -110
- package/src/x_ite/Components/Rendering/LineSet.js +172 -179
- package/src/x_ite/Components/Rendering/Normal.js +100 -100
- package/src/x_ite/Components/Rendering/PointSet.js +142 -154
- package/src/x_ite/Components/Rendering/TriangleFanSet.js +73 -73
- package/src/x_ite/Components/Rendering/TriangleSet.js +51 -53
- package/src/x_ite/Components/Rendering/TriangleStripSet.js +76 -76
- package/src/x_ite/Components/Rendering/X3DColorNode.js +25 -27
- package/src/x_ite/Components/Rendering/X3DComposedGeometryNode.js +318 -321
- package/src/x_ite/Components/Rendering/X3DCoordinateNode.js +132 -132
- package/src/x_ite/Components/Rendering/X3DGeometricPropertyNode.js +13 -15
- package/src/x_ite/Components/Rendering/X3DGeometryNode.js +1190 -1171
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +231 -189
- package/src/x_ite/Components/Rendering/X3DNormalNode.js +13 -15
- package/src/x_ite/Components/Rendering/X3DPointGeometryNode.js +267 -0
- package/src/x_ite/Components/Rendering.js +53 -53
- package/src/x_ite/Components/RigidBodyPhysics/BallJoint.js +149 -149
- package/src/x_ite/Components/RigidBodyPhysics/CollidableOffset.js +229 -229
- package/src/x_ite/Components/RigidBodyPhysics/CollidableShape.js +465 -465
- package/src/x_ite/Components/RigidBodyPhysics/CollisionCollection.js +152 -154
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSensor.js +223 -223
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSpace.js +117 -117
- package/src/x_ite/Components/RigidBodyPhysics/Contact.js +54 -56
- package/src/x_ite/Components/RigidBodyPhysics/DoubleAxisHingeJoint.js +245 -245
- package/src/x_ite/Components/RigidBodyPhysics/MotorJoint.js +68 -70
- package/src/x_ite/Components/RigidBodyPhysics/RigidBody.js +453 -453
- package/src/x_ite/Components/RigidBodyPhysics/RigidBodyCollection.js +326 -326
- package/src/x_ite/Components/RigidBodyPhysics/SingleAxisHingeJoint.js +171 -171
- package/src/x_ite/Components/RigidBodyPhysics/SliderJoint.js +169 -169
- package/src/x_ite/Components/RigidBodyPhysics/UniversalJoint.js +50 -52
- package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollidableNode.js +101 -101
- package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollisionSpaceNode.js +15 -15
- package/src/x_ite/Components/RigidBodyPhysics/X3DRigidJointNode.js +161 -163
- package/src/x_ite/Components/Scripting/Script.js +506 -510
- package/src/x_ite/Components/Scripting/X3DScriptNode.js +15 -15
- package/src/x_ite/Components/Shaders/ComposedShader.js +215 -178
- package/src/x_ite/Components/Shaders/FloatVertexAttribute.js +84 -83
- package/src/x_ite/Components/Shaders/Matrix3VertexAttribute.js +74 -74
- package/src/x_ite/Components/Shaders/Matrix4VertexAttribute.js +73 -73
- package/src/x_ite/Components/Shaders/PackagedShader.js +52 -49
- package/src/x_ite/Components/Shaders/ProgramShader.js +36 -38
- package/src/x_ite/Components/Shaders/ShaderPart.js +135 -147
- package/src/x_ite/Components/Shaders/ShaderProgram.js +49 -46
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +1259 -1255
- package/src/x_ite/Components/Shaders/X3DShaderNode.js +83 -93
- package/src/x_ite/Components/Shaders/X3DVertexAttributeNode.js +13 -15
- package/src/x_ite/Components/Shaders.js +33 -33
- package/src/x_ite/{Execution/ExportedNode.js → Components/Shape/AcousticProperties.js} +41 -71
- package/src/x_ite/Components/Shape/Appearance.js +331 -318
- package/src/x_ite/Components/Shape/FillProperties.js +101 -98
- package/src/x_ite/Components/Shape/LineProperties.js +71 -69
- package/src/x_ite/Components/Shape/Material.js +344 -116
- package/src/x_ite/Components/Shape/PhysicalMaterial.js +310 -0
- package/src/x_ite/Components/Shape/PointProperties.js +79 -95
- package/src/x_ite/Components/Shape/Shape.js +178 -181
- package/src/x_ite/Components/Shape/TwoSidedMaterial.js +200 -200
- package/src/x_ite/Components/Shape/UnlitMaterial.js +93 -46
- package/src/x_ite/Components/Shape/X3DAppearanceChildNode.js +13 -15
- package/src/x_ite/Components/Shape/X3DAppearanceNode.js +24 -24
- package/src/x_ite/Components/Shape/X3DMaterialNode.js +24 -24
- package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +158 -54
- package/src/x_ite/Components/Shape/X3DShapeNode.js +147 -147
- package/src/x_ite/Components/Shape.js +43 -37
- package/src/x_ite/Components/Sound/AudioClip.js +135 -140
- package/src/x_ite/Components/Sound/Sound.js +246 -246
- package/src/x_ite/Components/Sound/X3DSoundNode.js +13 -15
- package/src/x_ite/Components/Sound/X3DSoundSourceNode.js +165 -179
- package/src/x_ite/Components/Sound.js +19 -19
- package/src/x_ite/Components/Text/FontStyle.js +49 -49
- package/src/x_ite/Components/Text/Text.js +135 -135
- package/src/x_ite/Components/Text/X3DFontStyleNode.js +207 -205
- package/src/x_ite/Components/Text.js +17 -17
- package/src/x_ite/Components/Texturing/ImageTexture.js +181 -194
- package/src/x_ite/Components/Texturing/MovieTexture.js +180 -190
- package/src/x_ite/Components/Texturing/MultiTexture.js +255 -262
- package/src/x_ite/Components/Texturing/MultiTextureCoordinate.js +124 -118
- package/src/x_ite/Components/Texturing/MultiTextureTransform.js +82 -76
- package/src/x_ite/Components/Texturing/PixelTexture.js +222 -221
- package/src/x_ite/Components/Texturing/TextureCoordinate.js +116 -116
- package/src/x_ite/Components/Texturing/TextureCoordinateGenerator.js +90 -90
- package/src/x_ite/Components/Texturing/TextureProperties.js +158 -160
- package/src/x_ite/Components/Texturing/TextureTransform.js +99 -99
- package/src/x_ite/Components/Texturing/X3DSingleTextureCoordinateNode.js +33 -28
- package/src/x_ite/Components/Texturing/X3DSingleTextureNode.js +54 -54
- package/src/x_ite/Components/Texturing/X3DSingleTextureTransformNode.js +22 -17
- package/src/x_ite/Components/Texturing/X3DTexture2DNode.js +135 -124
- package/src/x_ite/Components/Texturing/X3DTextureCoordinateNode.js +16 -16
- package/src/x_ite/Components/Texturing/X3DTextureNode.js +24 -24
- package/src/x_ite/Components/Texturing/X3DTextureTransformNode.js +22 -22
- package/src/x_ite/Components/Texturing.js +45 -45
- package/src/x_ite/Components/Texturing3D/ComposedTexture3D.js +125 -123
- package/src/x_ite/Components/Texturing3D/ImageTexture3D.js +115 -131
- package/src/x_ite/Components/Texturing3D/PixelTexture3D.js +158 -160
- package/src/x_ite/Components/Texturing3D/TextureCoordinate3D.js +116 -116
- package/src/x_ite/Components/Texturing3D/TextureCoordinate4D.js +116 -116
- package/src/x_ite/Components/Texturing3D/TextureTransform3D.js +88 -88
- package/src/x_ite/Components/Texturing3D/TextureTransformMatrix3D.js +46 -46
- package/src/x_ite/Components/Texturing3D/X3DTexture3DNode.js +135 -121
- package/src/x_ite/Components/Time/TimeSensor.js +155 -152
- package/src/x_ite/Components/Time/X3DTimeDependentNode.js +299 -302
- package/src/x_ite/Components/Time.js +15 -15
- package/src/x_ite/Components/VolumeRendering/BlendedVolumeStyle.js +338 -338
- package/src/x_ite/Components/VolumeRendering/BoundaryEnhancementVolumeStyle.js +80 -80
- package/src/x_ite/Components/VolumeRendering/CartoonVolumeStyle.js +228 -228
- package/src/x_ite/Components/VolumeRendering/ComposedVolumeStyle.js +163 -163
- package/src/x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle.js +117 -117
- package/src/x_ite/Components/VolumeRendering/IsoSurfaceVolumeData.js +334 -334
- package/src/x_ite/Components/VolumeRendering/OpacityMapVolumeStyle.js +116 -116
- package/src/x_ite/Components/VolumeRendering/ProjectionVolumeStyle.js +167 -167
- package/src/x_ite/Components/VolumeRendering/SegmentedVolumeData.js +247 -247
- package/src/x_ite/Components/VolumeRendering/ShadedVolumeStyle.js +198 -198
- package/src/x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle.js +116 -116
- package/src/x_ite/Components/VolumeRendering/ToneMappedVolumeStyle.js +126 -126
- package/src/x_ite/Components/VolumeRendering/VolumeData.js +173 -173
- package/src/x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode.js +12 -12
- package/src/x_ite/Components/VolumeRendering/X3DVolumeDataNode.js +167 -167
- package/src/x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode.js +70 -70
- package/src/x_ite/Components/X_ITE/BlendMode.js +143 -145
- package/src/x_ite/Components.js +47 -47
- package/src/x_ite/Configuration/ComponentInfo.js +47 -42
- package/src/x_ite/Configuration/ComponentInfoArray.js +21 -19
- package/src/x_ite/Configuration/ProfileInfo.js +33 -23
- package/src/x_ite/Configuration/ProfileInfoArray.js +26 -16
- package/src/x_ite/Configuration/SupportedComponents.js +311 -311
- package/src/x_ite/Configuration/SupportedNodes.js +53 -38
- package/src/x_ite/Configuration/SupportedProfiles.js +190 -190
- package/src/x_ite/Configuration/UnitInfo.js +60 -51
- package/src/x_ite/Configuration/UnitInfoArray.js +17 -10
- package/src/x_ite/DEBUG.js +2 -2
- package/src/x_ite/Execution/BindableList.js +146 -149
- package/src/x_ite/Execution/BindableStack.js +130 -123
- package/src/x_ite/Execution/ExportedNodesArray.js +75 -0
- package/src/x_ite/Execution/ImportedNodesArray.js +75 -0
- package/src/x_ite/{Basic/X3DFieldDefinition.js → Execution/NamedNodesArray.js} +20 -10
- package/src/x_ite/Execution/Scene.js +93 -90
- package/src/x_ite/Execution/X3DExecutionContext.js +957 -781
- package/src/x_ite/Execution/X3DExportedNode.js +152 -0
- package/src/x_ite/Execution/X3DImportedNode.js +393 -0
- package/src/x_ite/Execution/X3DScene.js +546 -493
- package/src/x_ite/Execution/X3DWorld.js +171 -0
- package/src/x_ite/Fallback.js +31 -31
- package/src/x_ite/Fields/ArrayFields.js +463 -443
- package/src/x_ite/Fields/SFBool.js +50 -47
- package/src/x_ite/Fields/SFColor.js +163 -160
- package/src/x_ite/Fields/SFColorRGBA.js +155 -152
- package/src/x_ite/Fields/SFDouble.js +51 -48
- package/src/x_ite/Fields/SFFloat.js +51 -48
- package/src/x_ite/Fields/SFImage.js +216 -213
- package/src/x_ite/Fields/SFInt32.js +47 -44
- package/src/x_ite/Fields/SFMatrix3.js +74 -71
- package/src/x_ite/Fields/SFMatrix4.js +68 -65
- package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +98 -98
- package/src/x_ite/Fields/SFNode.js +392 -299
- package/src/x_ite/Fields/SFNodeCache.js +22 -33
- package/src/x_ite/Fields/SFRotation.js +178 -175
- package/src/x_ite/Fields/SFString.js +71 -68
- package/src/x_ite/Fields/SFTime.js +47 -44
- package/src/x_ite/Fields/SFVec2.js +73 -70
- package/src/x_ite/Fields/SFVec3.js +105 -102
- package/src/x_ite/Fields/SFVec4.js +118 -115
- package/src/x_ite/Fields/SFVecPrototypeTemplate.js +94 -94
- package/src/x_ite/Fields.js +44 -44
- package/src/x_ite/InputOutput/FileLoader.js +426 -531
- package/src/x_ite/InputOutput/Generator.js +379 -376
- package/src/x_ite/{Configuration/X3DInfoArray.js → Parser/GoldenGate.js} +54 -86
- package/src/x_ite/Parser/HTMLSupport.js +28 -6
- package/src/x_ite/Parser/JSONParser.js +414 -388
- package/src/x_ite/Parser/VRMLParser.js +2964 -0
- package/src/x_ite/Parser/X3DParser.js +128 -128
- package/src/x_ite/Parser/XMLParser.js +1231 -1178
- package/src/x_ite/Prototype/ExternProtoDeclarationArray.js +17 -27
- package/src/x_ite/Prototype/ProtoDeclarationArray.js +17 -27
- package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +279 -297
- package/src/x_ite/Prototype/X3DProtoDeclaration.js +264 -263
- package/src/x_ite/Prototype/X3DProtoDeclarationNode.js +58 -35
- package/src/x_ite/Rendering/DependentRenderer.js +83 -80
- package/src/x_ite/Rendering/TextureBuffer.js +171 -168
- package/src/x_ite/{Bits → Rendering}/TraverseType.js +11 -11
- package/src/x_ite/Rendering/X3DRenderObject.js +895 -906
- package/src/x_ite/Routing/RouteArray.js +19 -71
- package/src/x_ite/Routing/X3DRoute.js +185 -179
- package/src/x_ite/Routing/X3DRoutingContext.js +60 -54
- package/src/x_ite/X3D.js +191 -175
- package/src/x_ite.config.js +83 -83
- package/src/x_ite.css +279 -288
- package/src/x_ite.html +226 -193
- package/src/x_ite.js +100 -127
- package/x_ite.min.html +220 -187
- package/src/assets/shaders/webgl1/PointSet.fs +0 -100
- package/src/assets/shaders/webgl1/PointSet.vs +0 -70
- package/src/assets/shaders/webgl1/Wireframe.fs +0 -74
- package/src/assets/shaders/webgl1/Wireframe.vs +0 -63
- package/src/assets/shaders/webgl2/PointSet.fs +0 -99
- package/src/assets/shaders/webgl2/PointSet.vs +0 -71
- package/src/assets/shaders/webgl2/Wireframe.fs +0 -73
- package/src/assets/shaders/webgl2/Wireframe.vs +0 -64
- package/src/x_ite/Basic/X3DBaseNode.js +0 -1253
- package/src/x_ite/Basic/X3DField.js +0 -370
- package/src/x_ite/Basic/X3DObjectArrayField.js +0 -545
- package/src/x_ite/Basic/X3DTypedArrayField.js +0 -839
- package/src/x_ite/Browser/Core/X3DCoreContext.js.~1~ +0 -714
- package/src/x_ite/Components/Texturing/X3DTexture2DNode.js.~1~ +0 -209
- package/src/x_ite/Execution/ImportedNode.js +0 -375
- package/src/x_ite/Execution/World.js +0 -162
- package/src/x_ite/Parser/Parser.js +0 -2944
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
var module = { }, exports, process;
|
|
5
5
|
|
|
6
6
|
const
|
|
7
|
-
define = X3D .define,
|
|
8
|
-
require = X3D .require;
|
|
7
|
+
define = window [Symbol .for ("X_ITE.X3D-5.0.0")] .define,
|
|
8
|
+
require = window [Symbol .for ("X_ITE.X3D-5.0.0")] .require;
|
|
9
9
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
10
10
|
*******************************************************************************
|
|
11
11
|
*
|
|
@@ -56,49 +56,55 @@ const
|
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
define ('x_ite/Browser/Layout/X3DLayoutContext',[
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
"jquery",
|
|
60
|
+
"x_ite/Components/Texturing/TextureProperties",
|
|
61
61
|
],
|
|
62
62
|
function ($,
|
|
63
63
|
TextureProperties)
|
|
64
64
|
{
|
|
65
65
|
"use strict";
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
67
|
+
const
|
|
68
|
+
_pointSize = Symbol (),
|
|
69
|
+
_screenTextureProperties = Symbol ();
|
|
70
|
+
|
|
71
|
+
function X3DLayoutContext () { }
|
|
72
|
+
|
|
73
|
+
X3DLayoutContext .prototype =
|
|
74
|
+
{
|
|
75
|
+
getPointSize: function ()
|
|
76
|
+
{
|
|
77
|
+
if (this [_pointSize] === undefined)
|
|
78
|
+
{
|
|
79
|
+
const div = $("<div></div>") .css ("height", "1in") .css ("display", "none");
|
|
80
|
+
this [_pointSize] = div .appendTo ($("body")) .height () / 72;
|
|
81
|
+
div .remove ();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return this [_pointSize];
|
|
85
|
+
},
|
|
86
|
+
getScreenTextureProperties: function ()
|
|
87
|
+
{
|
|
88
|
+
this [_screenTextureProperties] = new TextureProperties (this .getPrivateScene ());
|
|
89
|
+
|
|
90
|
+
this [_screenTextureProperties] ._boundaryModeS = "CLAMP";
|
|
91
|
+
this [_screenTextureProperties] ._boundaryModeT = "CLAMP";
|
|
92
|
+
this [_screenTextureProperties] ._boundaryModeR = "CLAMP";
|
|
93
|
+
this [_screenTextureProperties] ._minificationFilter = "NEAREST";
|
|
94
|
+
this [_screenTextureProperties] ._magnificationFilter = "NEAREST";
|
|
95
|
+
this [_screenTextureProperties] ._generateMipMaps = false;
|
|
96
|
+
|
|
97
|
+
this [_screenTextureProperties] .setup ();
|
|
98
|
+
|
|
99
|
+
this .getScreenTextureProperties = function () { return this [_screenTextureProperties]; };
|
|
100
|
+
|
|
101
|
+
Object .defineProperty (this, "getScreenTextureProperties", { enumerable: false });
|
|
102
|
+
|
|
103
|
+
return this [_screenTextureProperties];
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
return X3DLayoutContext;
|
|
102
108
|
});
|
|
103
109
|
|
|
104
110
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
@@ -151,31 +157,29 @@ function ($,
|
|
|
151
157
|
|
|
152
158
|
|
|
153
159
|
define ('x_ite/Components/Layout/X3DLayoutNode',[
|
|
154
|
-
|
|
155
|
-
|
|
160
|
+
"x_ite/Components/Core/X3DChildNode",
|
|
161
|
+
"x_ite/Base/X3DConstants",
|
|
156
162
|
],
|
|
157
163
|
function (X3DChildNode,
|
|
158
164
|
X3DConstants)
|
|
159
165
|
{
|
|
160
166
|
"use strict";
|
|
161
167
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
168
|
+
function X3DLayoutNode (executionContext)
|
|
169
|
+
{
|
|
170
|
+
X3DChildNode .call (this, executionContext);
|
|
165
171
|
|
|
166
|
-
|
|
167
|
-
|
|
172
|
+
this .addType (X3DConstants .X3DLayoutNode);
|
|
173
|
+
}
|
|
168
174
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
175
|
+
X3DLayoutNode .prototype = Object .assign (Object .create (X3DChildNode .prototype),
|
|
176
|
+
{
|
|
177
|
+
constructor: X3DLayoutNode,
|
|
178
|
+
});
|
|
173
179
|
|
|
174
|
-
|
|
180
|
+
return X3DLayoutNode;
|
|
175
181
|
});
|
|
176
182
|
|
|
177
|
-
|
|
178
|
-
|
|
179
183
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
180
184
|
*******************************************************************************
|
|
181
185
|
*
|
|
@@ -226,21 +230,21 @@ function (X3DChildNode,
|
|
|
226
230
|
|
|
227
231
|
|
|
228
232
|
define ('x_ite/Components/Layout/Layout',[
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
233
|
+
"x_ite/Fields",
|
|
234
|
+
"x_ite/Base/X3DFieldDefinition",
|
|
235
|
+
"x_ite/Base/FieldDefinitionArray",
|
|
236
|
+
"x_ite/Components/Layout/X3DLayoutNode",
|
|
237
|
+
"x_ite/Base/X3DCast",
|
|
238
|
+
"x_ite/Base/X3DConstants",
|
|
239
|
+
"standard/Math/Numbers/Vector2",
|
|
240
|
+
"standard/Math/Numbers/Vector3",
|
|
241
|
+
"standard/Math/Numbers/Rotation4",
|
|
242
|
+
"standard/Math/Numbers/Matrix4",
|
|
239
243
|
],
|
|
240
244
|
function (Fields,
|
|
241
245
|
X3DFieldDefinition,
|
|
242
246
|
FieldDefinitionArray,
|
|
243
|
-
X3DLayoutNode,
|
|
247
|
+
X3DLayoutNode,
|
|
244
248
|
X3DCast,
|
|
245
249
|
X3DConstants,
|
|
246
250
|
Vector2,
|
|
@@ -250,575 +254,573 @@ function (Fields,
|
|
|
250
254
|
{
|
|
251
255
|
"use strict";
|
|
252
256
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
257
|
+
var
|
|
258
|
+
i = 0,
|
|
259
|
+
LEFT = i++,
|
|
260
|
+
CENTER = i++,
|
|
261
|
+
RIGHT = i++,
|
|
262
|
+
BOTTOM = i++,
|
|
263
|
+
TOP = i++,
|
|
264
|
+
WORLD = i++,
|
|
265
|
+
FRACTION = i++,
|
|
266
|
+
PIXEL = i++,
|
|
267
|
+
NONE = i++,
|
|
268
|
+
STRETCH = i++;
|
|
269
|
+
|
|
270
|
+
function Layout (executionContext)
|
|
271
|
+
{
|
|
272
|
+
X3DLayoutNode .call (this, executionContext);
|
|
273
|
+
|
|
274
|
+
this .addType (X3DConstants .Layout);
|
|
275
|
+
|
|
276
|
+
this .alignX = CENTER;
|
|
277
|
+
this .alignY = CENTER;
|
|
278
|
+
this .offsetUnitX = WORLD;
|
|
279
|
+
this .offsetUnitY = WORLD;
|
|
280
|
+
this .offsetX = 0;
|
|
281
|
+
this .offsetY = 0;
|
|
282
|
+
this .sizeUnitX = WORLD;
|
|
283
|
+
this .sizeUnitY = WORLD;
|
|
284
|
+
this .sizeX = 1;
|
|
285
|
+
this .sizeY = 1;
|
|
286
|
+
this .scaleModeX = NONE;
|
|
287
|
+
this .scaleModeY = NONE;
|
|
288
|
+
this .parent = null;
|
|
289
|
+
this .rectangleCenter = new Vector2 (0, 0);
|
|
290
|
+
this .rectangleSize = new Vector2 (0, 0);
|
|
291
|
+
this .matrix = new Matrix4 ();
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
Layout .prototype = Object .assign (Object .create (X3DLayoutNode .prototype),
|
|
295
|
+
{
|
|
296
|
+
constructor: Layout,
|
|
297
|
+
viewportPixel: new Vector2 (0, 0),
|
|
298
|
+
pixelSize: new Vector2 (0, 0),
|
|
299
|
+
translation: new Vector3 (0, 0, 0),
|
|
300
|
+
offset: new Vector3 (0, 0, 0),
|
|
301
|
+
scale: new Vector3 (1, 1, 1),
|
|
302
|
+
currentTranslation: new Vector3 (0, 0, 0),
|
|
303
|
+
currentRotation: new Rotation4 (0, 0, 1, 0),
|
|
304
|
+
currentScale: new Vector3 (0, 0, 0),
|
|
305
|
+
modelViewMatrix: new Matrix4 (),
|
|
306
|
+
[Symbol .for ("X_ITE.X3DBaseNode.fieldDefinitions")]: new FieldDefinitionArray ([
|
|
307
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
308
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "align", new Fields .MFString ("CENTER", "CENTER")),
|
|
309
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "offsetUnits", new Fields .MFString ("WORLD", "WORLD")),
|
|
310
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "offset", new Fields .MFFloat (0, 0)),
|
|
311
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "sizeUnits", new Fields .MFString ("WORLD", "WORLD")),
|
|
312
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "size", new Fields .MFFloat (1, 1)),
|
|
313
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "scaleMode", new Fields .MFString ("NONE", "NONE")),
|
|
314
|
+
]),
|
|
315
|
+
getTypeName: function ()
|
|
316
|
+
{
|
|
317
|
+
return "Layout";
|
|
318
|
+
},
|
|
319
|
+
getComponentName: function ()
|
|
320
|
+
{
|
|
321
|
+
return "Layout";
|
|
322
|
+
},
|
|
323
|
+
getContainerField: function ()
|
|
324
|
+
{
|
|
325
|
+
return "layout";
|
|
326
|
+
},
|
|
327
|
+
initialize: function ()
|
|
328
|
+
{
|
|
329
|
+
X3DLayoutNode .prototype .initialize .call (this);
|
|
330
|
+
|
|
331
|
+
this ._align .addInterest ("set_align__", this);
|
|
332
|
+
this ._offsetUnits .addInterest ("set_offsetUnits__", this);
|
|
333
|
+
this ._offset .addInterest ("set_offset__", this);
|
|
334
|
+
this ._sizeUnits .addInterest ("set_sizeUnits__", this);
|
|
335
|
+
this ._size .addInterest ("set_size__", this);
|
|
336
|
+
this ._scaleMode .addInterest ("set_scaleMode__", this);
|
|
337
|
+
|
|
338
|
+
this .set_align__ ();
|
|
339
|
+
this .set_offsetUnits__ ();
|
|
340
|
+
this .set_offset__ ();
|
|
341
|
+
this .set_sizeUnits__ ();
|
|
342
|
+
this .set_size__ ();
|
|
343
|
+
this .set_scaleMode__ ();
|
|
344
|
+
},
|
|
345
|
+
set_align__: function ()
|
|
346
|
+
{
|
|
347
|
+
// X
|
|
348
|
+
|
|
349
|
+
if (this ._align .length > 0)
|
|
350
|
+
{
|
|
351
|
+
if (this ._align [0] === "LEFT")
|
|
352
|
+
this .alignX = LEFT;
|
|
353
|
+
|
|
354
|
+
else if (this ._align [0] === "RIGHT")
|
|
355
|
+
this .alignX = RIGHT;
|
|
356
|
+
|
|
357
|
+
else
|
|
358
|
+
this .alignX = CENTER;
|
|
359
|
+
}
|
|
360
|
+
else
|
|
361
|
+
this .alignX = CENTER;
|
|
362
|
+
|
|
363
|
+
// Y
|
|
364
|
+
|
|
365
|
+
if (this ._align .length > 1)
|
|
366
|
+
{
|
|
367
|
+
if (this ._align [1] === "BOTTOM")
|
|
368
|
+
this .alignY = BOTTOM;
|
|
369
|
+
|
|
370
|
+
else if (this ._align [1] === "TOP")
|
|
371
|
+
this .alignY = TOP;
|
|
372
|
+
|
|
373
|
+
else
|
|
374
|
+
this .alignY = CENTER;
|
|
375
|
+
}
|
|
376
|
+
else
|
|
377
|
+
this .alignY = CENTER;
|
|
378
|
+
},
|
|
379
|
+
set_offsetUnits__: function ()
|
|
380
|
+
{
|
|
381
|
+
if (this ._offsetUnits .length > 0)
|
|
382
|
+
{
|
|
383
|
+
// X
|
|
384
|
+
|
|
385
|
+
if (this ._offsetUnits [0] === "FRACTION")
|
|
386
|
+
this .offsetUnitX = FRACTION;
|
|
387
|
+
|
|
388
|
+
else if (this ._offsetUnits [0] === "PIXEL")
|
|
389
|
+
this .offsetUnitX = PIXEL;
|
|
390
|
+
|
|
391
|
+
else
|
|
392
|
+
this .offsetUnitX = WORLD;
|
|
393
|
+
|
|
394
|
+
// Y
|
|
395
|
+
|
|
396
|
+
if (this ._offsetUnits .length > 1)
|
|
397
|
+
{
|
|
398
|
+
if (this ._offsetUnits [1] === "FRACTION")
|
|
399
|
+
this .offsetUnitY = FRACTION;
|
|
400
|
+
|
|
401
|
+
else if (this ._offsetUnits [1] === "PIXEL")
|
|
402
|
+
this .offsetUnitY = PIXEL;
|
|
403
|
+
|
|
404
|
+
else
|
|
405
|
+
this .offsetUnitY = WORLD;
|
|
406
|
+
}
|
|
407
|
+
else
|
|
408
|
+
this .offsetUnitY = this .offsetUnitX;
|
|
409
|
+
}
|
|
410
|
+
else
|
|
411
|
+
{
|
|
412
|
+
this .offsetUnitX = WORLD;
|
|
413
|
+
this .offsetUnitY = WORLD;
|
|
414
|
+
}
|
|
415
|
+
},
|
|
416
|
+
set_offset__: function ()
|
|
417
|
+
{
|
|
418
|
+
if (this ._offset .length > 0)
|
|
419
|
+
{
|
|
420
|
+
// X
|
|
421
|
+
|
|
422
|
+
this .offsetX = this ._offset [0];
|
|
423
|
+
|
|
424
|
+
// Y
|
|
425
|
+
|
|
426
|
+
if (this ._offset .length > 1)
|
|
427
|
+
this .offsetY = this ._offset [1];
|
|
428
|
+
|
|
429
|
+
else
|
|
430
|
+
this .offsetY = offsetX;
|
|
431
|
+
}
|
|
432
|
+
else
|
|
433
|
+
{
|
|
434
|
+
this .offsetX = 0;
|
|
435
|
+
this .offsetY = 0;
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
set_sizeUnits__: function ()
|
|
439
|
+
{
|
|
440
|
+
if (this ._sizeUnits .length > 0)
|
|
441
|
+
{
|
|
442
|
+
// X
|
|
443
|
+
|
|
444
|
+
if (this ._sizeUnits [0] === "FRACTION")
|
|
445
|
+
this .sizeUnitX = FRACTION;
|
|
446
|
+
|
|
447
|
+
else if (this ._sizeUnits [0] === "PIXEL")
|
|
448
|
+
this .sizeUnitX = PIXEL;
|
|
449
|
+
|
|
450
|
+
else
|
|
451
|
+
this .sizeUnitX = WORLD;
|
|
452
|
+
|
|
453
|
+
// Y
|
|
454
|
+
|
|
455
|
+
if (this ._sizeUnits .length > 1)
|
|
456
|
+
{
|
|
457
|
+
if (this ._sizeUnits [1] === "FRACTION")
|
|
458
|
+
this .sizeUnitY = FRACTION;
|
|
459
|
+
|
|
460
|
+
else if (this ._sizeUnits [1] === "PIXEL")
|
|
461
|
+
this .sizeUnitY = PIXEL;
|
|
462
|
+
|
|
463
|
+
else
|
|
464
|
+
this .sizeUnitY = WORLD;
|
|
465
|
+
}
|
|
466
|
+
else
|
|
467
|
+
this .sizeUnitY = this .sizeUnitX;
|
|
468
|
+
}
|
|
469
|
+
else
|
|
470
|
+
{
|
|
471
|
+
this .sizeUnitX = WORLD;
|
|
472
|
+
this .sizeUnitY = WORLD;
|
|
473
|
+
}
|
|
474
|
+
},
|
|
475
|
+
set_size__: function ()
|
|
476
|
+
{
|
|
477
|
+
if (this ._size .length > 0)
|
|
478
|
+
{
|
|
479
|
+
// X
|
|
480
|
+
|
|
481
|
+
this .sizeX = this ._size [0];
|
|
482
|
+
|
|
483
|
+
// Y
|
|
484
|
+
|
|
485
|
+
if (this ._size .length > 1)
|
|
486
|
+
this .sizeY = this ._size [1];
|
|
487
|
+
|
|
488
|
+
else
|
|
489
|
+
this .sizeY = this .sizeX;
|
|
490
|
+
}
|
|
491
|
+
else
|
|
492
|
+
{
|
|
493
|
+
this .sizeX = 0;
|
|
494
|
+
this .sizeY = 0;
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
set_scaleMode__: function ()
|
|
498
|
+
{
|
|
499
|
+
if (this ._scaleMode .length > 0)
|
|
500
|
+
{
|
|
501
|
+
// X
|
|
502
|
+
|
|
503
|
+
if (this ._scaleMode [0] === "FRACTION")
|
|
504
|
+
this .scaleModeX = FRACTION;
|
|
505
|
+
|
|
506
|
+
else if (this ._scaleMode [0] === "PIXEL")
|
|
507
|
+
this .scaleModeX = PIXEL;
|
|
508
|
+
|
|
509
|
+
else if (this ._scaleMode [0] === "STRETCH")
|
|
510
|
+
this .scaleModeX = STRETCH;
|
|
511
|
+
|
|
512
|
+
else
|
|
513
|
+
this .scaleModeX = NONE;
|
|
514
|
+
|
|
515
|
+
// Y
|
|
516
|
+
|
|
517
|
+
if (this ._scaleMode .length > 1)
|
|
518
|
+
{
|
|
519
|
+
if (this ._scaleMode [1] === "FRACTION")
|
|
520
|
+
this .scaleModeY = FRACTION;
|
|
521
|
+
|
|
522
|
+
else if (this ._scaleMode [1] === "PIXEL")
|
|
523
|
+
this .scaleModeY = PIXEL;
|
|
524
|
+
|
|
525
|
+
else if (this ._scaleMode [1] === "STRETCH")
|
|
526
|
+
this .scaleModeY = STRETCH;
|
|
527
|
+
|
|
528
|
+
else
|
|
529
|
+
this .scaleModeY = NONE;
|
|
530
|
+
}
|
|
531
|
+
else
|
|
532
|
+
this .scaleModeY = this .scaleModeX;
|
|
533
|
+
}
|
|
534
|
+
else
|
|
535
|
+
{
|
|
536
|
+
this .scaleModeX = NONE;
|
|
537
|
+
this .scaleModeY = NONE;
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
getRectangleCenter: function ()
|
|
541
|
+
{
|
|
542
|
+
return this .rectangleCenter;
|
|
543
|
+
},
|
|
544
|
+
getRectangleSize: function ()
|
|
545
|
+
{
|
|
546
|
+
return this .rectangleSize;
|
|
547
|
+
},
|
|
548
|
+
getAlignX: function ()
|
|
549
|
+
{
|
|
550
|
+
return this .alignX;
|
|
551
|
+
},
|
|
552
|
+
getAlignY: function ()
|
|
553
|
+
{
|
|
554
|
+
return this .alignY;
|
|
555
|
+
},
|
|
556
|
+
getOffsetUnitX: function ()
|
|
557
|
+
{
|
|
558
|
+
if (this .offsetUnitX === WORLD)
|
|
559
|
+
{
|
|
560
|
+
if (this .parent)
|
|
561
|
+
return this .parent .getOffsetUnitX ();
|
|
562
|
+
|
|
563
|
+
return FRACTION;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
return this .offsetUnitX;
|
|
567
|
+
},
|
|
568
|
+
getOffsetUnitY: function ()
|
|
569
|
+
{
|
|
570
|
+
if (this .offsetUnitY === WORLD)
|
|
571
|
+
{
|
|
572
|
+
if (this .parent)
|
|
573
|
+
return this .parent .getOffsetUnitY ();
|
|
574
|
+
|
|
575
|
+
return FRACTION;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
return this .offsetUnitY;
|
|
579
|
+
},
|
|
580
|
+
getOffsetX: function ()
|
|
581
|
+
{
|
|
582
|
+
return this .offsetX;
|
|
583
|
+
},
|
|
584
|
+
getOffsetY: function ()
|
|
585
|
+
{
|
|
586
|
+
return this .offsetY;
|
|
587
|
+
},
|
|
588
|
+
getSizeUnitX: function ()
|
|
589
|
+
{
|
|
590
|
+
if (this .sizeUnitX === WORLD)
|
|
591
|
+
{
|
|
592
|
+
if (this .parent)
|
|
593
|
+
return this .parent .getSizeUnitX ();
|
|
594
|
+
|
|
595
|
+
return FRACTION;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
return this .sizeUnitX;
|
|
599
|
+
},
|
|
600
|
+
getSizeUnitY: function ()
|
|
601
|
+
{
|
|
602
|
+
if (this .sizeUnitY === WORLD)
|
|
603
|
+
{
|
|
604
|
+
if (this .parent)
|
|
605
|
+
return this .parent .getSizeUnitY ();
|
|
606
|
+
|
|
607
|
+
return FRACTION;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
return this .sizeUnitY;
|
|
611
|
+
},
|
|
612
|
+
getSizeX: function ()
|
|
613
|
+
{
|
|
614
|
+
return this .sizeX;
|
|
615
|
+
},
|
|
616
|
+
getSizeY: function ()
|
|
617
|
+
{
|
|
618
|
+
return this .sizeY;
|
|
619
|
+
},
|
|
620
|
+
getScaleModeX: function ()
|
|
621
|
+
{
|
|
622
|
+
if (this .parent)
|
|
623
|
+
return this .scaleModeX;
|
|
624
|
+
|
|
625
|
+
if (this .scaleModeX === NONE)
|
|
626
|
+
return FRACTION;
|
|
627
|
+
|
|
628
|
+
return this .scaleModeX;
|
|
629
|
+
},
|
|
630
|
+
getScaleModeY: function ()
|
|
631
|
+
{
|
|
632
|
+
if (this .parent)
|
|
633
|
+
return this .scaleModeY;
|
|
634
|
+
|
|
635
|
+
if (this .scaleModeY === NONE)
|
|
636
|
+
return FRACTION;
|
|
637
|
+
|
|
638
|
+
return this .scaleModeY;
|
|
639
|
+
},
|
|
640
|
+
transform: function (type, renderObject)
|
|
641
|
+
{
|
|
642
|
+
var parent = this .parent = renderObject .getParentLayout ();
|
|
643
|
+
|
|
644
|
+
// Calculate rectangleSize
|
|
645
|
+
|
|
646
|
+
var
|
|
647
|
+
matrix = this .matrix,
|
|
648
|
+
viewpoint = renderObject .getViewpoint (),
|
|
649
|
+
nearValue = renderObject .getNavigationInfo () .getNearValue (), // in meters
|
|
650
|
+
viewport = renderObject .getViewVolume () .getScissor (), // in pixels
|
|
651
|
+
viewportMeter = viewpoint .getViewportSize (viewport, nearValue), // in meters
|
|
652
|
+
viewportPixel = this .viewportPixel, // in pixels
|
|
653
|
+
pixelSize = this .pixelSize, // size of one pixel in meters
|
|
654
|
+
parentRectangleSize = parent ? parent .getRectangleSize () : viewportMeter, // in meters
|
|
655
|
+
rectangleSize = this .rectangleSize,
|
|
656
|
+
rectangleCenter = this .rectangleCenter;
|
|
657
|
+
|
|
658
|
+
viewportPixel .set (viewport [2], viewport [3]); // in pixel
|
|
659
|
+
pixelSize .assign (viewportMeter) .divVec (viewportPixel); // size of one pixel in meter
|
|
660
|
+
|
|
661
|
+
switch (this .getSizeUnitX ())
|
|
662
|
+
{
|
|
663
|
+
case FRACTION:
|
|
664
|
+
rectangleSize .x = this .sizeX * parentRectangleSize .x;
|
|
665
|
+
break;
|
|
666
|
+
case PIXEL:
|
|
667
|
+
rectangleSize .x = this .sizeX * pixelSize .x;
|
|
668
|
+
break;
|
|
669
|
+
default:
|
|
670
|
+
break;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
switch (this .getSizeUnitY ())
|
|
674
|
+
{
|
|
675
|
+
case FRACTION:
|
|
676
|
+
rectangleSize .y = this .sizeY * parentRectangleSize .y;
|
|
677
|
+
break;
|
|
678
|
+
case PIXEL:
|
|
679
|
+
rectangleSize .y = this .sizeY * pixelSize .y;
|
|
680
|
+
break;
|
|
681
|
+
default:
|
|
682
|
+
break;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
// Calculate translation
|
|
686
|
+
|
|
687
|
+
var translation = this .translation .set (0, 0, 0);
|
|
688
|
+
|
|
689
|
+
switch (this .getAlignX ())
|
|
690
|
+
{
|
|
691
|
+
case LEFT:
|
|
692
|
+
translation .x = -(parentRectangleSize .x - rectangleSize .x) / 2;
|
|
693
|
+
break;
|
|
694
|
+
case CENTER:
|
|
695
|
+
|
|
696
|
+
if (this .getSizeUnitX () === PIXEL && viewportPixel .x & 1)
|
|
697
|
+
translation .x = -pixelSize .x / 2;
|
|
698
|
+
|
|
699
|
+
break;
|
|
700
|
+
case RIGHT:
|
|
701
|
+
translation .x = (parentRectangleSize .x - rectangleSize .x) / 2;
|
|
702
|
+
break;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
switch (this .getAlignY ())
|
|
706
|
+
{
|
|
707
|
+
case BOTTOM:
|
|
708
|
+
translation .y = -(parentRectangleSize .y - rectangleSize .y) / 2;
|
|
709
|
+
break;
|
|
710
|
+
case CENTER:
|
|
711
|
+
|
|
712
|
+
if (this .getSizeUnitX === PIXEL && viewportPixel .y & 1)
|
|
713
|
+
translation .y = -pixelSize .y / 2;
|
|
714
|
+
|
|
715
|
+
break;
|
|
716
|
+
case TOP:
|
|
717
|
+
translation .y = (parentRectangleSize .y - rectangleSize .y) / 2;
|
|
718
|
+
break;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
// Calculate offset
|
|
722
|
+
|
|
723
|
+
var offset = this .offset .set (0, 0, 0);
|
|
724
|
+
|
|
725
|
+
switch (this .getOffsetUnitX ())
|
|
726
|
+
{
|
|
727
|
+
case FRACTION:
|
|
728
|
+
offset .x = this .offsetX * parentRectangleSize .x;
|
|
729
|
+
break;
|
|
730
|
+
case PIXEL:
|
|
731
|
+
offset .x = this .offsetX * viewportMeter .x / viewportPixel .x;
|
|
732
|
+
break;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
switch (this .getOffsetUnitY ())
|
|
736
|
+
{
|
|
737
|
+
case FRACTION:
|
|
738
|
+
offset .y = this .offsetY * parentRectangleSize .y;
|
|
739
|
+
break;
|
|
740
|
+
case PIXEL:
|
|
741
|
+
offset .y = this .offsetY * viewportMeter .y / viewportPixel .y;
|
|
742
|
+
break;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
// Calculate scale
|
|
746
|
+
|
|
747
|
+
var
|
|
748
|
+
scale = this .scale .set (1, 1, 1),
|
|
749
|
+
currentTranslation = this .currentTranslation,
|
|
750
|
+
currentRotation = this .currentRotation,
|
|
751
|
+
currentScale = this .currentScale;
|
|
752
|
+
|
|
753
|
+
var modelViewMatrix = renderObject .getModelViewMatrix () .get ();
|
|
754
|
+
modelViewMatrix .get (currentTranslation, currentRotation, currentScale);
|
|
755
|
+
|
|
756
|
+
switch (this .getScaleModeX ())
|
|
757
|
+
{
|
|
758
|
+
case NONE:
|
|
759
|
+
scale .x = currentScale .x;
|
|
760
|
+
break;
|
|
761
|
+
case FRACTION:
|
|
762
|
+
scale .x = rectangleSize .x;
|
|
763
|
+
break;
|
|
764
|
+
case STRETCH:
|
|
765
|
+
break;
|
|
766
|
+
case PIXEL:
|
|
767
|
+
scale .x = viewportMeter .x / viewportPixel .x;
|
|
768
|
+
break;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
switch (this .getScaleModeY ())
|
|
772
|
+
{
|
|
773
|
+
case NONE:
|
|
774
|
+
scale .y = currentScale .y;
|
|
775
|
+
break;
|
|
776
|
+
case FRACTION:
|
|
777
|
+
scale .y = rectangleSize .y;
|
|
778
|
+
break;
|
|
779
|
+
case STRETCH:
|
|
780
|
+
break;
|
|
781
|
+
case PIXEL:
|
|
782
|
+
scale .y = viewportMeter .y / viewportPixel .y;
|
|
783
|
+
break;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
// Calculate scale for scaleMode STRETCH
|
|
787
|
+
|
|
788
|
+
if (this .getScaleModeX () === STRETCH)
|
|
789
|
+
{
|
|
790
|
+
if (this .getScaleModeY () === STRETCH)
|
|
791
|
+
{
|
|
792
|
+
if (rectangleSize .x > rectangleSize .y)
|
|
793
|
+
{
|
|
794
|
+
scale .x = rectangleSize .x;
|
|
795
|
+
scale .y = scale .x;
|
|
796
|
+
}
|
|
797
|
+
else
|
|
798
|
+
{
|
|
799
|
+
scale .y = rectangleSize .y;
|
|
800
|
+
scale .x = scale .y;
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
else
|
|
804
|
+
scale .x = scale .y;
|
|
805
|
+
}
|
|
806
|
+
else if (this .getScaleModeY () === STRETCH)
|
|
807
|
+
scale .y = scale .x;
|
|
808
|
+
|
|
809
|
+
// Transform
|
|
810
|
+
|
|
811
|
+
rectangleCenter .assign (translation) .add (offset);
|
|
812
|
+
|
|
813
|
+
matrix .set (currentTranslation, currentRotation);
|
|
814
|
+
matrix .translate (translation .add (offset));
|
|
815
|
+
matrix .scale (scale);
|
|
816
|
+
|
|
817
|
+
return matrix;
|
|
818
|
+
},
|
|
819
|
+
});
|
|
820
|
+
|
|
821
|
+
return Layout;
|
|
818
822
|
});
|
|
819
823
|
|
|
820
|
-
|
|
821
|
-
|
|
822
824
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
823
825
|
*******************************************************************************
|
|
824
826
|
*
|
|
@@ -869,14 +871,14 @@ function (Fields,
|
|
|
869
871
|
|
|
870
872
|
|
|
871
873
|
define ('x_ite/Components/Layout/LayoutGroup',[
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
874
|
+
"x_ite/Fields",
|
|
875
|
+
"x_ite/Base/X3DFieldDefinition",
|
|
876
|
+
"x_ite/Base/FieldDefinitionArray",
|
|
877
|
+
"x_ite/Components/Grouping/X3DGroupingNode",
|
|
878
|
+
"x_ite/Base/X3DCast",
|
|
879
|
+
"x_ite/Rendering/TraverseType",
|
|
880
|
+
"x_ite/Base/X3DConstants",
|
|
881
|
+
"standard/Math/Numbers/Matrix4",
|
|
880
882
|
],
|
|
881
883
|
function (Fields,
|
|
882
884
|
X3DFieldDefinition,
|
|
@@ -889,124 +891,124 @@ function (Fields,
|
|
|
889
891
|
{
|
|
890
892
|
"use strict";
|
|
891
893
|
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
894
|
+
function LayoutGroup (executionContext)
|
|
895
|
+
{
|
|
896
|
+
X3DGroupingNode .call (this, executionContext);
|
|
897
|
+
|
|
898
|
+
this .addType (X3DConstants .LayoutGroup);
|
|
899
|
+
|
|
900
|
+
this .viewportNode = null;
|
|
901
|
+
this .layoutNode = null;
|
|
902
|
+
this .modelViewMatrix = new Matrix4 ();
|
|
903
|
+
this .screenMatrix = new Matrix4 ();
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
LayoutGroup .prototype = Object .assign (Object .create (X3DGroupingNode .prototype),
|
|
907
|
+
{
|
|
908
|
+
constructor: LayoutGroup,
|
|
909
|
+
[Symbol .for ("X_ITE.X3DBaseNode.fieldDefinitions")]: new FieldDefinitionArray ([
|
|
910
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
911
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "layout", new Fields .SFNode ()),
|
|
912
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "viewport", new Fields .SFNode ()),
|
|
913
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "visible", new Fields .SFBool (true)),
|
|
914
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "bboxDisplay", new Fields .SFBool ()),
|
|
915
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxSize", new Fields .SFVec3f (-1, -1, -1)),
|
|
916
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxCenter", new Fields .SFVec3f ()),
|
|
917
|
+
new X3DFieldDefinition (X3DConstants .inputOnly, "addChildren", new Fields .MFNode ()),
|
|
918
|
+
new X3DFieldDefinition (X3DConstants .inputOnly, "removeChildren", new Fields .MFNode ()),
|
|
919
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "children", new Fields .MFNode ()),
|
|
920
|
+
]),
|
|
921
|
+
getTypeName: function ()
|
|
922
|
+
{
|
|
923
|
+
return "LayoutGroup";
|
|
924
|
+
},
|
|
925
|
+
getComponentName: function ()
|
|
926
|
+
{
|
|
927
|
+
return "Layout";
|
|
928
|
+
},
|
|
929
|
+
getContainerField: function ()
|
|
930
|
+
{
|
|
931
|
+
return "children";
|
|
932
|
+
},
|
|
933
|
+
initialize: function ()
|
|
934
|
+
{
|
|
935
|
+
X3DGroupingNode .prototype .initialize .call (this);
|
|
936
|
+
|
|
937
|
+
this ._viewport .addInterest ("set_viewport__", this);
|
|
938
|
+
this ._layout .addInterest ("set_layout__", this);
|
|
939
|
+
|
|
940
|
+
this .set_viewport__ ();
|
|
941
|
+
this .set_layout__ ();
|
|
942
|
+
},
|
|
943
|
+
set_viewport__: function ()
|
|
944
|
+
{
|
|
945
|
+
this .viewportNode = X3DCast (X3DConstants .X3DViewportNode, this ._viewport);
|
|
946
|
+
},
|
|
947
|
+
set_layout__: function ()
|
|
948
|
+
{
|
|
949
|
+
this .layoutNode = X3DCast (X3DConstants .X3DLayoutNode, this ._layout);
|
|
950
|
+
},
|
|
951
|
+
getBBox: function (bbox, shadow)
|
|
952
|
+
{
|
|
953
|
+
return X3DGroupingNode .prototype .getBBox .call (this, bbox, shadow) .multRight (this .getMatrix ());
|
|
954
|
+
},
|
|
955
|
+
getMatrix: function ()
|
|
956
|
+
{
|
|
957
|
+
try
|
|
958
|
+
{
|
|
959
|
+
if (this .layoutNode)
|
|
960
|
+
this .matrix .assign (this .modelViewMatrix) .inverse () .multLeft (this .screenMatrix);
|
|
961
|
+
else
|
|
962
|
+
this .matrix .identity ();
|
|
963
|
+
}
|
|
964
|
+
catch (error)
|
|
965
|
+
{ }
|
|
966
|
+
|
|
967
|
+
return this .matrix;
|
|
968
|
+
},
|
|
969
|
+
traverse: function (type, renderObject)
|
|
970
|
+
{
|
|
971
|
+
switch (type)
|
|
972
|
+
{
|
|
973
|
+
case TraverseType .COLLISION:
|
|
974
|
+
{
|
|
975
|
+
return;
|
|
976
|
+
}
|
|
977
|
+
default:
|
|
978
|
+
{
|
|
979
|
+
if (this .viewportNode)
|
|
980
|
+
this .viewportNode .push ();
|
|
981
|
+
|
|
982
|
+
if (this .layoutNode)
|
|
983
|
+
{
|
|
984
|
+
var modelViewMatrix = renderObject .getModelViewMatrix ();
|
|
985
|
+
|
|
986
|
+
this .modelViewMatrix .assign (modelViewMatrix .get ());
|
|
987
|
+
this .screenMatrix .assign (this .layoutNode .transform (type, renderObject));
|
|
988
|
+
|
|
989
|
+
modelViewMatrix .pushMatrix (this .screenMatrix);
|
|
990
|
+
renderObject .getLayouts () .push (this .layoutNode);
|
|
991
|
+
|
|
992
|
+
X3DGroupingNode .prototype .traverse .call (this, type, renderObject);
|
|
993
|
+
|
|
994
|
+
renderObject .getLayouts () .pop ();
|
|
995
|
+
modelViewMatrix .pop ();
|
|
996
|
+
}
|
|
997
|
+
else
|
|
998
|
+
{
|
|
999
|
+
X3DGroupingNode .prototype .traverse .call (this, type, renderObject);
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
if (this .viewportNode)
|
|
1003
|
+
this .viewportNode .pop ();
|
|
1004
|
+
|
|
1005
|
+
return;
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
},
|
|
1009
|
+
});
|
|
1010
|
+
|
|
1011
|
+
return LayoutGroup;
|
|
1010
1012
|
});
|
|
1011
1013
|
|
|
1012
1014
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
@@ -1059,13 +1061,13 @@ function (Fields,
|
|
|
1059
1061
|
|
|
1060
1062
|
|
|
1061
1063
|
define ('x_ite/Components/Layout/LayoutLayer',[
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1064
|
+
"x_ite/Fields",
|
|
1065
|
+
"x_ite/Base/X3DFieldDefinition",
|
|
1066
|
+
"x_ite/Base/FieldDefinitionArray",
|
|
1067
|
+
"x_ite/Components/Layering/X3DLayerNode",
|
|
1068
|
+
"x_ite/Components/Layout/LayoutGroup",
|
|
1069
|
+
"x_ite/Components/Navigation/OrthoViewpoint",
|
|
1070
|
+
"x_ite/Base/X3DConstants",
|
|
1069
1071
|
],
|
|
1070
1072
|
function (Fields,
|
|
1071
1073
|
X3DFieldDefinition,
|
|
@@ -1077,58 +1079,58 @@ function (Fields,
|
|
|
1077
1079
|
{
|
|
1078
1080
|
"use strict";
|
|
1079
1081
|
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1082
|
+
function LayoutLayer (executionContext)
|
|
1083
|
+
{
|
|
1084
|
+
X3DLayerNode .call (this,
|
|
1085
|
+
executionContext,
|
|
1086
|
+
new OrthoViewpoint (executionContext),
|
|
1087
|
+
new LayoutGroup (executionContext));
|
|
1088
|
+
|
|
1089
|
+
this .addType (X3DConstants .LayoutLayer);
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
LayoutLayer .prototype = Object .assign (Object .create (X3DLayerNode .prototype),
|
|
1093
|
+
{
|
|
1094
|
+
constructor: LayoutLayer,
|
|
1095
|
+
[Symbol .for ("X_ITE.X3DBaseNode.fieldDefinitions")]: new FieldDefinitionArray ([
|
|
1096
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
1097
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "isPickable", new Fields .SFBool (true)),
|
|
1098
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "layout", new Fields .SFNode ()),
|
|
1099
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "viewport", new Fields .SFNode ()),
|
|
1100
|
+
new X3DFieldDefinition (X3DConstants .inputOnly, "addChildren", new Fields .MFNode ()),
|
|
1101
|
+
new X3DFieldDefinition (X3DConstants .inputOnly, "removeChildren", new Fields .MFNode ()),
|
|
1102
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "children", new Fields .MFNode ()),
|
|
1103
|
+
]),
|
|
1104
|
+
getTypeName: function ()
|
|
1105
|
+
{
|
|
1106
|
+
return "LayoutLayer";
|
|
1107
|
+
},
|
|
1108
|
+
getComponentName: function ()
|
|
1109
|
+
{
|
|
1110
|
+
return "Layout";
|
|
1111
|
+
},
|
|
1112
|
+
getContainerField: function ()
|
|
1113
|
+
{
|
|
1114
|
+
return "layers";
|
|
1115
|
+
},
|
|
1116
|
+
initialize: function ()
|
|
1117
|
+
{
|
|
1118
|
+
X3DLayerNode .prototype .initialize .call (this);
|
|
1119
|
+
|
|
1120
|
+
this ._layout .addFieldInterest (this .getGroup () ._layout);
|
|
1121
|
+
this ._addChildren .addFieldInterest (this .getGroup () ._addChildren);
|
|
1122
|
+
this ._removeChildren .addFieldInterest (this .getGroup () ._removeChildren);
|
|
1123
|
+
this ._children .addFieldInterest (this .getGroup () ._children);
|
|
1124
|
+
|
|
1125
|
+
this .getGroup () ._layout = this ._layout;
|
|
1126
|
+
this .getGroup () ._children = this ._children;
|
|
1127
|
+
|
|
1128
|
+
this .getGroup () .setPrivate (true);
|
|
1129
|
+
this .getGroup () .setup ();
|
|
1130
|
+
},
|
|
1131
|
+
});
|
|
1132
|
+
|
|
1133
|
+
return LayoutLayer;
|
|
1132
1134
|
});
|
|
1133
1135
|
|
|
1134
1136
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
@@ -1181,17 +1183,17 @@ function (Fields,
|
|
|
1181
1183
|
|
|
1182
1184
|
|
|
1183
1185
|
define ('x_ite/Browser/Layout/ScreenText',[
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1186
|
+
"jquery",
|
|
1187
|
+
"x_ite/Browser/Text/X3DTextGeometry",
|
|
1188
|
+
"x_ite/Browser/Text/TextAlignment",
|
|
1189
|
+
"x_ite/Components/Texturing/PixelTexture",
|
|
1190
|
+
"x_ite/Components/Rendering/X3DGeometryNode",
|
|
1191
|
+
"standard/Math/Numbers/Vector3",
|
|
1192
|
+
"standard/Math/Numbers/Vector4",
|
|
1193
|
+
"standard/Math/Numbers/Matrix4",
|
|
1194
|
+
"standard/Math/Geometry/Box3",
|
|
1195
|
+
"standard/Math/Geometry/ViewVolume",
|
|
1196
|
+
"standard/Math/Algorithm",
|
|
1195
1197
|
],
|
|
1196
1198
|
function ($,
|
|
1197
1199
|
X3DTextGeometry,
|
|
@@ -1207,400 +1209,401 @@ function ($,
|
|
|
1207
1209
|
{
|
|
1208
1210
|
"use strict";
|
|
1209
1211
|
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1212
|
+
function ScreenText (text, fontStyle)
|
|
1213
|
+
{
|
|
1214
|
+
X3DTextGeometry .call (this, text, fontStyle);
|
|
1215
|
+
|
|
1216
|
+
text .setTransparent (true);
|
|
1217
|
+
|
|
1218
|
+
this .texCoordArray = X3DGeometryNode .createArray ();
|
|
1219
|
+
this .textureNode = new PixelTexture (text .getExecutionContext ());
|
|
1220
|
+
this .canvas = $("<canvas></canvas>");
|
|
1221
|
+
this .context = this .canvas [0] .getContext ("2d");
|
|
1222
|
+
this .matrix = new Matrix4 ();
|
|
1223
|
+
|
|
1224
|
+
this .textureNode ._textureProperties = fontStyle .getBrowser () .getScreenTextureProperties ();
|
|
1225
|
+
this .textureNode .setup ();
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
ScreenText .prototype = Object .assign (Object .create (X3DTextGeometry .prototype),
|
|
1229
|
+
{
|
|
1230
|
+
constructor: ScreenText,
|
|
1231
|
+
modelViewMatrix: new Matrix4 (),
|
|
1232
|
+
getTransparent: function ()
|
|
1233
|
+
{
|
|
1234
|
+
return true;
|
|
1235
|
+
},
|
|
1236
|
+
getMatrix: function ()
|
|
1237
|
+
{
|
|
1238
|
+
return this .matrix;
|
|
1239
|
+
},
|
|
1240
|
+
update: (function ()
|
|
1241
|
+
{
|
|
1242
|
+
const
|
|
1243
|
+
min = new Vector3 (0, 0, 0),
|
|
1244
|
+
max = new Vector3 (1, 1, 0);
|
|
1245
|
+
|
|
1246
|
+
return function ()
|
|
1247
|
+
{
|
|
1248
|
+
X3DTextGeometry .prototype .update .call (this);
|
|
1249
|
+
|
|
1250
|
+
const
|
|
1251
|
+
fontStyle = this .getFontStyle (),
|
|
1252
|
+
text = this .getText (),
|
|
1253
|
+
offset = 1; // For antialiasing border on bottom and right side
|
|
1254
|
+
|
|
1255
|
+
text ._textBounds .x = Math .ceil (text ._textBounds .x) + offset;
|
|
1256
|
+
text ._textBounds .y = Math .ceil (text ._textBounds .y) + offset;
|
|
1257
|
+
|
|
1258
|
+
this .getBBox () .getExtents (min, max);
|
|
1259
|
+
|
|
1260
|
+
min .x -= offset;
|
|
1261
|
+
min .y -= offset;
|
|
1262
|
+
|
|
1263
|
+
switch (fontStyle .getMajorAlignment ())
|
|
1264
|
+
{
|
|
1265
|
+
case TextAlignment .BEGIN:
|
|
1266
|
+
case TextAlignment .FIRST:
|
|
1267
|
+
min .x = Math .floor (min .x);
|
|
1268
|
+
max .x = min .x + text ._textBounds .x;
|
|
1269
|
+
break;
|
|
1270
|
+
case TextAlignment .MIDDLE:
|
|
1271
|
+
min .x = Math .round (min .x);
|
|
1272
|
+
max .x = min .x + text ._textBounds .x;
|
|
1273
|
+
break;
|
|
1274
|
+
case TextAlignment .END:
|
|
1275
|
+
max .x = Math .ceil (max .x);
|
|
1276
|
+
min .x = max .x - text ._textBounds .x;
|
|
1277
|
+
break;
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
switch (fontStyle .getMinorAlignment ())
|
|
1281
|
+
{
|
|
1282
|
+
case TextAlignment .BEGIN:
|
|
1283
|
+
case TextAlignment .FIRST:
|
|
1284
|
+
max .y = Math .ceil (max .y);
|
|
1285
|
+
min .y = max .y - text ._textBounds .y;
|
|
1286
|
+
break;
|
|
1287
|
+
case TextAlignment .MIDDLE:
|
|
1288
|
+
max .y = Math .round (max .y);
|
|
1289
|
+
min .y = max .y - text ._textBounds .y;
|
|
1290
|
+
break;
|
|
1291
|
+
case TextAlignment .END:
|
|
1292
|
+
min .y = Math .floor (min .y);
|
|
1293
|
+
max .y = min .y + text ._textBounds .y;
|
|
1294
|
+
break;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
text ._origin .x = min .x;
|
|
1298
|
+
text ._origin .y = max .y;
|
|
1299
|
+
|
|
1300
|
+
this .getBBox () .setExtents (min, max);
|
|
1301
|
+
};
|
|
1302
|
+
})(),
|
|
1303
|
+
build: (function ()
|
|
1304
|
+
{
|
|
1305
|
+
const
|
|
1306
|
+
min = new Vector3 (0, 0, 0),
|
|
1307
|
+
max = new Vector3 (1, 1, 0);
|
|
1308
|
+
|
|
1309
|
+
return function ()
|
|
1310
|
+
{
|
|
1311
|
+
const
|
|
1312
|
+
fontStyle = this .getFontStyle (),
|
|
1313
|
+
font = fontStyle .getFont ();
|
|
1314
|
+
|
|
1315
|
+
if (! font)
|
|
1316
|
+
return;
|
|
1317
|
+
|
|
1318
|
+
const
|
|
1319
|
+
text = this .getText (),
|
|
1320
|
+
glyphs = this .getGlyphs (),
|
|
1321
|
+
minorAlignment = this .getMinorAlignment (),
|
|
1322
|
+
translations = this .getTranslations (),
|
|
1323
|
+
charSpacings = this .getCharSpacings (),
|
|
1324
|
+
size = fontStyle .getScale (), // in pixel
|
|
1325
|
+
sizeUnitsPerEm = size / font .unitsPerEm,
|
|
1326
|
+
texCoordArray = this .texCoordArray,
|
|
1327
|
+
normalArray = text .getNormals (),
|
|
1328
|
+
vertexArray = text .getVertices (),
|
|
1329
|
+
canvas = this .canvas [0],
|
|
1330
|
+
cx = this .context;
|
|
1331
|
+
|
|
1332
|
+
// Set texCoord.
|
|
1333
|
+
|
|
1334
|
+
texCoordArray .length = 0;
|
|
1335
|
+
|
|
1336
|
+
text .getMultiTexCoords () .push (texCoordArray);
|
|
1337
|
+
|
|
1338
|
+
// Triangle one and two.
|
|
1339
|
+
|
|
1340
|
+
this .getBBox () .getExtents (min, max);
|
|
1341
|
+
|
|
1342
|
+
normalArray .push (0, 0, 1,
|
|
1343
|
+
0, 0, 1,
|
|
1344
|
+
0, 0, 1,
|
|
1345
|
+
0, 0, 1,
|
|
1346
|
+
0, 0, 1,
|
|
1347
|
+
0, 0, 1);
|
|
1348
|
+
|
|
1349
|
+
vertexArray .push (min .x, min .y, 0, 1,
|
|
1350
|
+
max .x, min .y, 0, 1,
|
|
1351
|
+
max .x, max .y, 0, 1,
|
|
1352
|
+
min .x, min .y, 0, 1,
|
|
1353
|
+
max .x, max .y, 0, 1,
|
|
1354
|
+
min .x, max .y, 0, 1);
|
|
1355
|
+
|
|
1356
|
+
// Generate texture.
|
|
1357
|
+
|
|
1358
|
+
const
|
|
1359
|
+
width = text ._textBounds .x,
|
|
1360
|
+
height = text ._textBounds .y;
|
|
1361
|
+
|
|
1362
|
+
// Scale canvas.
|
|
1363
|
+
|
|
1364
|
+
canvas .width = Algorithm .nextPowerOfTwo (width),
|
|
1365
|
+
canvas .height = Algorithm .nextPowerOfTwo (height);
|
|
1366
|
+
|
|
1367
|
+
const
|
|
1368
|
+
w = width / canvas .width,
|
|
1369
|
+
h = height / canvas .height,
|
|
1370
|
+
y = 1 - h;
|
|
1371
|
+
|
|
1372
|
+
texCoordArray .push (0, y, 0, 1,
|
|
1373
|
+
w, y, 0, 1,
|
|
1374
|
+
w, 1, 0, 1,
|
|
1375
|
+
0, y, 0, 1,
|
|
1376
|
+
w, 1, 0, 1,
|
|
1377
|
+
0, 1, 0, 1);
|
|
1378
|
+
|
|
1379
|
+
// Setup canvas.
|
|
1380
|
+
|
|
1381
|
+
cx .fillStyle = "rgba(255,255,255,0)";
|
|
1382
|
+
cx .fillRect (0, 0, canvas .width, canvas .height);
|
|
1383
|
+
cx .fillStyle = "rgba(255,255,255,1)";
|
|
1384
|
+
|
|
1385
|
+
// Draw glyphs.
|
|
1386
|
+
|
|
1387
|
+
if (fontStyle ._horizontal .getValue ())
|
|
1388
|
+
{
|
|
1389
|
+
for (let l = 0, length = glyphs .length; l < length; ++ l)
|
|
1390
|
+
{
|
|
1391
|
+
const
|
|
1392
|
+
line = glyphs [l],
|
|
1393
|
+
charSpacing = charSpacings [l],
|
|
1394
|
+
translation = translations [l];
|
|
1395
|
+
|
|
1396
|
+
let advanceWidth = 0;
|
|
1397
|
+
|
|
1398
|
+
for (let g = 0, gl = line .length; g < gl; ++ g)
|
|
1399
|
+
{
|
|
1400
|
+
const
|
|
1401
|
+
glyph = line [g],
|
|
1402
|
+
x = minorAlignment .x + translation .x + advanceWidth + g * charSpacing - min .x,
|
|
1403
|
+
y = minorAlignment .y + translation .y - max .y;
|
|
1404
|
+
|
|
1405
|
+
this .drawGlyph (cx, font, glyph, x, y, size);
|
|
1406
|
+
|
|
1407
|
+
// Calculate advanceWidth.
|
|
1408
|
+
|
|
1409
|
+
let kerning = 0;
|
|
1410
|
+
|
|
1411
|
+
if (g + 1 < line .length)
|
|
1412
|
+
kerning = font .getKerningValue (glyph, line [g + 1]);
|
|
1413
|
+
|
|
1414
|
+
advanceWidth += (glyph .advanceWidth + kerning) * sizeUnitsPerEm;
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
else
|
|
1419
|
+
{
|
|
1420
|
+
const
|
|
1421
|
+
leftToRight = fontStyle ._leftToRight .getValue (),
|
|
1422
|
+
topToBottom = fontStyle ._topToBottom .getValue (),
|
|
1423
|
+
first = leftToRight ? 0 : text ._string .length - 1,
|
|
1424
|
+
last = leftToRight ? text ._string .length : -1,
|
|
1425
|
+
step = leftToRight ? 1 : -1;
|
|
1426
|
+
|
|
1427
|
+
for (let l = first, t = 0; l !== last; l += step)
|
|
1428
|
+
{
|
|
1429
|
+
const line = glyphs [l];
|
|
1430
|
+
|
|
1431
|
+
const
|
|
1432
|
+
numChars = line .length,
|
|
1433
|
+
firstG = topToBottom ? 0 : numChars - 1,
|
|
1434
|
+
lastG = topToBottom ? numChars : -1,
|
|
1435
|
+
stepG = topToBottom ? 1 : -1;
|
|
1436
|
+
|
|
1437
|
+
for (let g = firstG; g !== lastG; g += stepG, ++ t)
|
|
1438
|
+
{
|
|
1439
|
+
const translation = translations [t];
|
|
1440
|
+
|
|
1441
|
+
const
|
|
1442
|
+
x = minorAlignment .x + translation .x - min .x,
|
|
1443
|
+
y = minorAlignment .y + translation .y - max .y;
|
|
1444
|
+
|
|
1445
|
+
this .drawGlyph (cx, font, line [g], x, y, size);
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
// Transfer texture data.
|
|
1451
|
+
|
|
1452
|
+
const imageData = cx .getImageData (0, 0, canvas .width, canvas .height);
|
|
1453
|
+
|
|
1454
|
+
// If the cavas is to large imageData is null.
|
|
1455
|
+
if (imageData)
|
|
1456
|
+
this .textureNode .setTexture (canvas .width, canvas .height, true, new Uint8Array (imageData .data .buffer), true);
|
|
1457
|
+
else
|
|
1458
|
+
this .textureNode .clear ();
|
|
1459
|
+
};
|
|
1460
|
+
})(),
|
|
1461
|
+
drawGlyph: function (cx, font, glyph, x, y, size)
|
|
1462
|
+
{
|
|
1463
|
+
//console .log (glyph .name, x, y);
|
|
1464
|
+
|
|
1465
|
+
// Get curves for the current glyph.
|
|
1466
|
+
|
|
1467
|
+
const
|
|
1468
|
+
path = glyph .getPath (x, -y, size),
|
|
1469
|
+
commands = path .commands;
|
|
1470
|
+
|
|
1471
|
+
cx .beginPath ();
|
|
1472
|
+
|
|
1473
|
+
for (let i = 0, cl = commands .length; i < cl; ++ i)
|
|
1474
|
+
{
|
|
1475
|
+
const command = commands [i];
|
|
1476
|
+
|
|
1477
|
+
switch (command .type)
|
|
1478
|
+
{
|
|
1479
|
+
case "M": // Start
|
|
1480
|
+
{
|
|
1481
|
+
cx .moveTo (command .x, command .y);
|
|
1482
|
+
continue;
|
|
1483
|
+
}
|
|
1484
|
+
case "Z": // End
|
|
1485
|
+
{
|
|
1486
|
+
cx .closePath ();
|
|
1487
|
+
continue;
|
|
1488
|
+
}
|
|
1489
|
+
case "L": // Linear
|
|
1490
|
+
{
|
|
1491
|
+
cx .lineTo (command .x, command .y);
|
|
1492
|
+
continue;
|
|
1493
|
+
}
|
|
1494
|
+
case "Q": // Cubic
|
|
1495
|
+
{
|
|
1496
|
+
cx .quadraticCurveTo (command .x1, command .y1, command .x, command .y);
|
|
1497
|
+
continue;
|
|
1498
|
+
}
|
|
1499
|
+
case "C": // Bezier
|
|
1500
|
+
{
|
|
1501
|
+
cx .bezierCurveTo (command .x1, command .y1, command .x2, command .y2, command .x, command .y);
|
|
1502
|
+
continue;
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
if (path .fill)
|
|
1508
|
+
cx .fill ();
|
|
1509
|
+
|
|
1510
|
+
if (path .stroke)
|
|
1511
|
+
{
|
|
1512
|
+
cx .lineWidth = path .strokeWidth;
|
|
1513
|
+
cx .stroke ();
|
|
1514
|
+
}
|
|
1515
|
+
},
|
|
1516
|
+
getGlyphExtents: function (font, glyph, primitiveQuality, min, max)
|
|
1517
|
+
{
|
|
1518
|
+
const unitsPerEm = font .unitsPerEm;
|
|
1519
|
+
|
|
1520
|
+
min .set ((glyph .xMin || 0) / unitsPerEm, (glyph .yMin || 0) / unitsPerEm, 0);
|
|
1521
|
+
max .set ((glyph .xMax || 0) / unitsPerEm, (glyph .yMax || 0) / unitsPerEm, 0);
|
|
1522
|
+
},
|
|
1523
|
+
transform: (function ()
|
|
1524
|
+
{
|
|
1525
|
+
const
|
|
1526
|
+
x = new Vector4 (0, 0, 0, 0),
|
|
1527
|
+
y = new Vector4 (0, 0, 0, 0),
|
|
1528
|
+
z = new Vector4 (0, 0, 0, 0),
|
|
1529
|
+
screenPoint = new Vector3 (0, 0, 0),
|
|
1530
|
+
screenMatrix = new Matrix4 (),
|
|
1531
|
+
bbox = new Box3 ();
|
|
1532
|
+
|
|
1533
|
+
return function (renderObject)
|
|
1534
|
+
{
|
|
1535
|
+
// throws an exception
|
|
1536
|
+
|
|
1537
|
+
const
|
|
1538
|
+
text = this .getText (),
|
|
1539
|
+
modelViewMatrix = renderObject .getModelViewMatrix () .get (),
|
|
1540
|
+
projectionMatrix = renderObject .getProjectionMatrix () .get (),
|
|
1541
|
+
viewport = renderObject .getViewVolume () .getViewport ();
|
|
1542
|
+
|
|
1543
|
+
// Determine screenMatrix.
|
|
1544
|
+
// Same as in ScreenGroup.
|
|
1545
|
+
|
|
1546
|
+
const screenScale = renderObject .getViewpoint () .getScreenScale (modelViewMatrix .origin, viewport); // in meter/pixel
|
|
1547
|
+
|
|
1548
|
+
x .set (modelViewMatrix [ 0], modelViewMatrix [ 1], modelViewMatrix [ 2], modelViewMatrix [ 3]);
|
|
1549
|
+
y .set (modelViewMatrix [ 4], modelViewMatrix [ 5], modelViewMatrix [ 6], modelViewMatrix [ 7]);
|
|
1550
|
+
z .set (modelViewMatrix [ 8], modelViewMatrix [ 9], modelViewMatrix [10], modelViewMatrix [11]);
|
|
1551
|
+
|
|
1552
|
+
x .normalize () .multiply (screenScale .x);
|
|
1553
|
+
y .normalize () .multiply (screenScale .y);
|
|
1554
|
+
z .normalize () .multiply (screenScale .z);
|
|
1555
|
+
|
|
1556
|
+
screenMatrix .set (x .x, x .y, x .z, x .w,
|
|
1557
|
+
y .x, y .y, y .z, y .w,
|
|
1558
|
+
z .x, z .y, z .z, z .w,
|
|
1559
|
+
modelViewMatrix [12], modelViewMatrix [13], modelViewMatrix [14], modelViewMatrix [15]);
|
|
1560
|
+
|
|
1561
|
+
// Snap to whole pixel.
|
|
1562
|
+
|
|
1563
|
+
ViewVolume .projectPoint (Vector3 .Zero, screenMatrix, projectionMatrix, viewport, screenPoint);
|
|
1564
|
+
|
|
1565
|
+
screenPoint .x = Math .round (screenPoint .x);
|
|
1566
|
+
screenPoint .y = Math .round (screenPoint .y);
|
|
1567
|
+
|
|
1568
|
+
ViewVolume .unProjectPoint (screenPoint .x, screenPoint .y, screenPoint .z, screenMatrix, projectionMatrix, viewport, screenPoint);
|
|
1569
|
+
|
|
1570
|
+
screenPoint .z = 0;
|
|
1571
|
+
screenMatrix .translate (screenPoint);
|
|
1572
|
+
|
|
1573
|
+
// Assign modelViewMatrix and calculate relative matrix.
|
|
1574
|
+
|
|
1575
|
+
this .matrix .assign (modelViewMatrix) .inverse () .multLeft (screenMatrix);
|
|
1576
|
+
|
|
1577
|
+
// Update Text bbox.
|
|
1578
|
+
|
|
1579
|
+
bbox .assign (this .getBBox ()) .multRight (this .matrix);
|
|
1580
|
+
|
|
1581
|
+
text .setBBox (bbox);
|
|
1582
|
+
};
|
|
1583
|
+
})(),
|
|
1584
|
+
traverse: function (type, renderObject)
|
|
1585
|
+
{
|
|
1586
|
+
this .transform (renderObject);
|
|
1587
|
+
},
|
|
1588
|
+
display: function (gl, context)
|
|
1589
|
+
{
|
|
1590
|
+
Matrix4 .prototype .multLeft .call (context .modelViewMatrix, this .matrix);
|
|
1591
|
+
|
|
1592
|
+
context .textureNode = this .textureNode;
|
|
1593
|
+
},
|
|
1594
|
+
transformLine: function (line)
|
|
1595
|
+
{
|
|
1596
|
+
// Apply sceen nodes transformation in place here.
|
|
1597
|
+
return line .multLineMatrix (Matrix4 .inverse (this .matrix));
|
|
1598
|
+
},
|
|
1599
|
+
transformMatrix: function (matrix)
|
|
1600
|
+
{
|
|
1601
|
+
// Apply sceen nodes transformation in place here.
|
|
1602
|
+
return matrix .multLeft (this .matrix);
|
|
1603
|
+
},
|
|
1604
|
+
});
|
|
1605
|
+
|
|
1606
|
+
return ScreenText;
|
|
1604
1607
|
});
|
|
1605
1608
|
|
|
1606
1609
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
@@ -1653,12 +1656,12 @@ function ($,
|
|
|
1653
1656
|
|
|
1654
1657
|
|
|
1655
1658
|
define ('x_ite/Components/Layout/ScreenFontStyle',[
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1659
|
+
"x_ite/Fields",
|
|
1660
|
+
"x_ite/Base/X3DFieldDefinition",
|
|
1661
|
+
"x_ite/Base/FieldDefinitionArray",
|
|
1662
|
+
"x_ite/Components/Text/X3DFontStyleNode",
|
|
1663
|
+
"x_ite/Browser/Layout/ScreenText",
|
|
1664
|
+
"x_ite/Base/X3DConstants",
|
|
1662
1665
|
],
|
|
1663
1666
|
function (Fields,
|
|
1664
1667
|
X3DFieldDefinition,
|
|
@@ -1669,51 +1672,51 @@ function (Fields,
|
|
|
1669
1672
|
{
|
|
1670
1673
|
"use strict";
|
|
1671
1674
|
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1675
|
+
function ScreenFontStyle (executionContext)
|
|
1676
|
+
{
|
|
1677
|
+
X3DFontStyleNode .call (this, executionContext);
|
|
1678
|
+
|
|
1679
|
+
this .addType (X3DConstants .ScreenFontStyle);
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
ScreenFontStyle .prototype = Object .assign (Object .create (X3DFontStyleNode .prototype),
|
|
1683
|
+
{
|
|
1684
|
+
constructor: ScreenFontStyle,
|
|
1685
|
+
[Symbol .for ("X_ITE.X3DBaseNode.fieldDefinitions")]: new FieldDefinitionArray ([
|
|
1686
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
1687
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "language", new Fields .SFString ()),
|
|
1688
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "family", new Fields .MFString ("SERIF")),
|
|
1689
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "style", new Fields .SFString ("PLAIN")),
|
|
1690
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "pointSize", new Fields .SFFloat (12)),
|
|
1691
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "spacing", new Fields .SFFloat (1)),
|
|
1692
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "horizontal", new Fields .SFBool (true)),
|
|
1693
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "leftToRight", new Fields .SFBool (true)),
|
|
1694
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "topToBottom", new Fields .SFBool (true)),
|
|
1695
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "justify", new Fields .MFString ("BEGIN")),
|
|
1696
|
+
]),
|
|
1697
|
+
getTypeName: function ()
|
|
1698
|
+
{
|
|
1699
|
+
return "ScreenFontStyle";
|
|
1700
|
+
},
|
|
1701
|
+
getComponentName: function ()
|
|
1702
|
+
{
|
|
1703
|
+
return "Layout";
|
|
1704
|
+
},
|
|
1705
|
+
getContainerField: function ()
|
|
1706
|
+
{
|
|
1707
|
+
return "fontStyle";
|
|
1708
|
+
},
|
|
1709
|
+
getTextGeometry: function (text)
|
|
1710
|
+
{
|
|
1711
|
+
return new ScreenText (text, this);
|
|
1712
|
+
},
|
|
1713
|
+
getScale: function ()
|
|
1714
|
+
{
|
|
1715
|
+
return this ._pointSize .getValue () * this .getBrowser () .getPointSize ();
|
|
1716
|
+
},
|
|
1717
|
+
});
|
|
1718
|
+
|
|
1719
|
+
return ScreenFontStyle;
|
|
1717
1720
|
});
|
|
1718
1721
|
|
|
1719
1722
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
@@ -1766,16 +1769,16 @@ function (Fields,
|
|
|
1766
1769
|
|
|
1767
1770
|
|
|
1768
1771
|
define ('x_ite/Components/Layout/ScreenGroup',[
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1772
|
+
"x_ite/Fields",
|
|
1773
|
+
"x_ite/Base/X3DFieldDefinition",
|
|
1774
|
+
"x_ite/Base/FieldDefinitionArray",
|
|
1775
|
+
"x_ite/Components/Grouping/X3DGroupingNode",
|
|
1776
|
+
"x_ite/Base/X3DConstants",
|
|
1777
|
+
"x_ite/Rendering/TraverseType",
|
|
1778
|
+
"standard/Math/Numbers/Vector3",
|
|
1779
|
+
"standard/Math/Numbers/Vector4",
|
|
1780
|
+
"standard/Math/Numbers/Matrix4",
|
|
1781
|
+
"standard/Math/Geometry/ViewVolume",
|
|
1779
1782
|
],
|
|
1780
1783
|
function (Fields,
|
|
1781
1784
|
X3DFieldDefinition,
|
|
@@ -1790,132 +1793,132 @@ function (Fields,
|
|
|
1790
1793
|
{
|
|
1791
1794
|
"use strict";
|
|
1792
1795
|
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1796
|
+
function ScreenGroup (executionContext)
|
|
1797
|
+
{
|
|
1798
|
+
X3DGroupingNode .call (this, executionContext);
|
|
1799
|
+
|
|
1800
|
+
this .addType (X3DConstants .ScreenGroup);
|
|
1801
|
+
|
|
1802
|
+
this .matrix = new Matrix4 ();
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
ScreenGroup .prototype = Object .assign (Object .create (X3DGroupingNode .prototype),
|
|
1806
|
+
{
|
|
1807
|
+
constructor: ScreenGroup,
|
|
1808
|
+
[Symbol .for ("X_ITE.X3DBaseNode.fieldDefinitions")]: new FieldDefinitionArray ([
|
|
1809
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
1810
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "visible", new Fields .SFBool (true)),
|
|
1811
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "bboxDisplay", new Fields .SFBool ()),
|
|
1812
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxSize", new Fields .SFVec3f (-1, -1, -1)),
|
|
1813
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxCenter", new Fields .SFVec3f ()),
|
|
1814
|
+
new X3DFieldDefinition (X3DConstants .inputOnly, "addChildren", new Fields .MFNode ()),
|
|
1815
|
+
new X3DFieldDefinition (X3DConstants .inputOnly, "removeChildren", new Fields .MFNode ()),
|
|
1816
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "children", new Fields .MFNode ()),
|
|
1817
|
+
]),
|
|
1818
|
+
getTypeName: function ()
|
|
1819
|
+
{
|
|
1820
|
+
return "ScreenGroup";
|
|
1821
|
+
},
|
|
1822
|
+
getComponentName: function ()
|
|
1823
|
+
{
|
|
1824
|
+
return "Layout";
|
|
1825
|
+
},
|
|
1826
|
+
getContainerField: function ()
|
|
1827
|
+
{
|
|
1828
|
+
return "children";
|
|
1829
|
+
},
|
|
1830
|
+
getBBox: function (bbox, shadow)
|
|
1831
|
+
{
|
|
1832
|
+
return this .getSubBBox (bbox, shadow) .multRight (this .matrix);
|
|
1833
|
+
},
|
|
1834
|
+
getMatrix: function ()
|
|
1835
|
+
{
|
|
1836
|
+
return this .matrix;
|
|
1837
|
+
},
|
|
1838
|
+
scale: (function ()
|
|
1839
|
+
{
|
|
1840
|
+
var
|
|
1841
|
+
x = new Vector4 (0, 0, 0, 0),
|
|
1842
|
+
y = new Vector4 (0, 0, 0, 0),
|
|
1843
|
+
z = new Vector4 (0, 0, 0, 0),
|
|
1844
|
+
screenPoint = new Vector3 (0, 0, 0),
|
|
1845
|
+
screenMatrix = new Matrix4 ();
|
|
1846
|
+
|
|
1847
|
+
return function (renderObject)
|
|
1848
|
+
{
|
|
1849
|
+
// throws domain error
|
|
1850
|
+
|
|
1851
|
+
var
|
|
1852
|
+
modelViewMatrix = renderObject .getModelViewMatrix () .get (),
|
|
1853
|
+
projectionMatrix = renderObject .getProjectionMatrix () .get (),
|
|
1854
|
+
viewport = renderObject .getViewVolume () .getViewport ();
|
|
1855
|
+
|
|
1856
|
+
// Determine screenMatrix.
|
|
1857
|
+
// Same as in ScreenText.
|
|
1858
|
+
|
|
1859
|
+
var screenScale = renderObject .getViewpoint () .getScreenScale (modelViewMatrix .origin, viewport); // in meter/pixel
|
|
1860
|
+
|
|
1861
|
+
x .set (modelViewMatrix [ 0], modelViewMatrix [ 1], modelViewMatrix [ 2], modelViewMatrix [ 3]);
|
|
1862
|
+
y .set (modelViewMatrix [ 4], modelViewMatrix [ 5], modelViewMatrix [ 6], modelViewMatrix [ 7]);
|
|
1863
|
+
z .set (modelViewMatrix [ 8], modelViewMatrix [ 9], modelViewMatrix [10], modelViewMatrix [11]);
|
|
1864
|
+
|
|
1865
|
+
x .normalize () .multiply (screenScale .x);
|
|
1866
|
+
y .normalize () .multiply (screenScale .y);
|
|
1867
|
+
z .normalize () .multiply (screenScale .z);
|
|
1868
|
+
|
|
1869
|
+
screenMatrix .set (x .x, x .y, x .z, x .w,
|
|
1870
|
+
y .x, y .y, y .z, y .w,
|
|
1871
|
+
z .x, z .y, z .z, z .w,
|
|
1872
|
+
modelViewMatrix [12], modelViewMatrix [13], modelViewMatrix [14], modelViewMatrix [15]);
|
|
1873
|
+
|
|
1874
|
+
// Snap to whole pixel.
|
|
1875
|
+
|
|
1876
|
+
ViewVolume .projectPoint (Vector3 .Zero, screenMatrix, projectionMatrix, viewport, screenPoint);
|
|
1877
|
+
|
|
1878
|
+
screenPoint .x = Math .round (screenPoint .x);
|
|
1879
|
+
screenPoint .y = Math .round (screenPoint .y);
|
|
1880
|
+
|
|
1881
|
+
ViewVolume .unProjectPoint (screenPoint .x, screenPoint .y, screenPoint .z, screenMatrix, projectionMatrix, viewport, screenPoint);
|
|
1882
|
+
|
|
1883
|
+
screenPoint .z = 0;
|
|
1884
|
+
screenMatrix .translate (screenPoint);
|
|
1885
|
+
|
|
1886
|
+
// Assign relative matrix.
|
|
1887
|
+
|
|
1888
|
+
this .matrix .assign (modelViewMatrix) .inverse () .multLeft (screenMatrix);
|
|
1889
|
+
};
|
|
1890
|
+
})(),
|
|
1891
|
+
traverse: function (type, renderObject)
|
|
1892
|
+
{
|
|
1893
|
+
try
|
|
1894
|
+
{
|
|
1895
|
+
switch (type)
|
|
1896
|
+
{
|
|
1897
|
+
case TraverseType .CAMERA:
|
|
1898
|
+
case TraverseType .PICKING:
|
|
1899
|
+
case TraverseType .SHADOW: // ???
|
|
1900
|
+
// No clone support for shadow, generated cube map texture and bbox
|
|
1901
|
+
break;
|
|
1902
|
+
default:
|
|
1903
|
+
this .scale (renderObject);
|
|
1904
|
+
break;
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
var modelViewMatrix = renderObject .getModelViewMatrix ();
|
|
1908
|
+
|
|
1909
|
+
modelViewMatrix .push ();
|
|
1910
|
+
modelViewMatrix .multLeft (this .matrix);
|
|
1911
|
+
|
|
1912
|
+
X3DGroupingNode .prototype .traverse .call (this, type, renderObject);
|
|
1913
|
+
|
|
1914
|
+
modelViewMatrix .pop ();
|
|
1915
|
+
}
|
|
1916
|
+
catch (error)
|
|
1917
|
+
{ }
|
|
1918
|
+
},
|
|
1919
|
+
});
|
|
1920
|
+
|
|
1921
|
+
return ScreenGroup;
|
|
1919
1922
|
});
|
|
1920
1923
|
|
|
1921
1924
|
/*******************************************************************************
|
|
@@ -1967,14 +1970,14 @@ function (Fields,
|
|
|
1967
1970
|
|
|
1968
1971
|
|
|
1969
1972
|
define (require .getComponentUrl ("layout"), [
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1973
|
+
"x_ite/Components",
|
|
1974
|
+
"x_ite/Browser/Layout/X3DLayoutContext",
|
|
1975
|
+
"x_ite/Components/Layout/Layout",
|
|
1976
|
+
"x_ite/Components/Layout/LayoutGroup",
|
|
1977
|
+
"x_ite/Components/Layout/LayoutLayer",
|
|
1978
|
+
"x_ite/Components/Layout/ScreenFontStyle",
|
|
1979
|
+
"x_ite/Components/Layout/ScreenGroup",
|
|
1980
|
+
"x_ite/Components/Layout/X3DLayoutNode",
|
|
1978
1981
|
],
|
|
1979
1982
|
function (Components,
|
|
1980
1983
|
X3DLayoutContext,
|
|
@@ -1987,24 +1990,23 @@ function (Components,
|
|
|
1987
1990
|
{
|
|
1988
1991
|
"use strict";
|
|
1989
1992
|
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
1993
|
+
Components .addComponent ({
|
|
1994
|
+
name: "Layout",
|
|
1995
|
+
types:
|
|
1996
|
+
{
|
|
1997
|
+
Layout: Layout,
|
|
1998
|
+
LayoutGroup: LayoutGroup,
|
|
1999
|
+
LayoutLayer: LayoutLayer,
|
|
2000
|
+
ScreenFontStyle: ScreenFontStyle,
|
|
2001
|
+
ScreenGroup: ScreenGroup,
|
|
2002
|
+
},
|
|
2003
|
+
abstractTypes:
|
|
2004
|
+
{
|
|
2005
|
+
X3DLayoutNode: X3DLayoutNode,
|
|
2006
|
+
},
|
|
2007
|
+
browser: X3DLayoutContext,
|
|
2008
|
+
});
|
|
2006
2009
|
});
|
|
2007
2010
|
|
|
2008
2011
|
|
|
2009
|
-
|
|
2010
2012
|
})();
|