x_ite 8.8.3 → 8.8.4
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/dist/assets/components/Annotation.js +13 -13
- package/dist/assets/components/Annotation.min.js +1 -1
- package/dist/assets/components/CADGeometry.js +13 -13
- package/dist/assets/components/CADGeometry.min.js +1 -1
- package/dist/assets/components/CubeMapTexturing.js +29 -29
- package/dist/assets/components/CubeMapTexturing.min.js +1 -1
- package/dist/assets/components/DIS.js +13 -13
- package/dist/assets/components/DIS.min.js +1 -1
- package/dist/assets/components/EventUtilities.js +9 -9
- package/dist/assets/components/EventUtilities.min.js +1 -1
- package/dist/assets/components/Geometry2D.js +22 -22
- package/dist/assets/components/Geometry2D.min.js +1 -1
- package/dist/assets/components/Geospatial.js +48 -48
- package/dist/assets/components/Geospatial.min.js +1 -1
- package/dist/assets/components/HAnim.js +19 -19
- package/dist/assets/components/HAnim.min.js +1 -1
- package/dist/assets/components/KeyDeviceSensor.js +8 -8
- package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
- package/dist/assets/components/Layout.js +32 -32
- package/dist/assets/components/Layout.min.js +1 -1
- package/dist/assets/components/NURBS.js +35 -35
- package/dist/assets/components/NURBS.min.js +1 -1
- package/dist/assets/components/ParticleSystems.js +33 -33
- package/dist/assets/components/ParticleSystems.min.js +1 -1
- package/dist/assets/components/Picking.js +32 -35
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +47 -56
- package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
- package/dist/assets/components/Scripting.js +38 -45
- package/dist/assets/components/Scripting.min.js +1 -1
- package/dist/assets/components/Text.js +26 -26
- package/dist/assets/components/Text.min.js +1 -1
- package/dist/assets/components/TextureProjector.js +16 -16
- package/dist/assets/components/TextureProjector.min.js +1 -1
- package/dist/assets/components/Texturing3D.js +37 -37
- package/dist/assets/components/Texturing3D.min.js +1 -1
- package/dist/assets/components/VolumeRendering.js +18 -18
- package/dist/assets/components/VolumeRendering.min.js +1 -1
- package/dist/assets/components/X_ITE.js +9 -9
- package/dist/assets/components/X_ITE.min.js +1 -1
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.js +1762 -1827
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.zip +0 -0
- package/docs/_config.yml +1 -1
- package/package.json +2 -2
- package/src/bookmarks.js +1 -1
- package/src/lib/jquery.js +8 -0
- package/src/lib/nurbs/src/utils/create-accessors.js +4 -4
- package/src/lib/nurbs/src/utils/variable.js +1 -1
- package/src/shim.js +1 -1
- package/src/standard/Math/Algorithms/Bezier.js +2 -2
- package/src/standard/Math/Geometry/Box2.js +4 -4
- package/src/standard/Math/Geometry/Box3.js +8 -8
- package/src/standard/Math/Geometry/Camera.js +1 -1
- package/src/standard/Math/Geometry/Line2.js +2 -2
- package/src/standard/Math/Geometry/Line3.js +4 -4
- package/src/standard/Math/Geometry/Sphere3.js +1 -1
- package/src/standard/Math/Geometry/Triangle3.js +2 -2
- package/src/standard/Math/Geometry/ViewVolume.js +10 -10
- package/src/standard/Math/Numbers/Matrix2.js +2 -2
- package/src/standard/Math/Numbers/Matrix3.js +10 -10
- package/src/standard/Math/Numbers/Matrix4.js +12 -12
- package/src/standard/Math/Numbers/Quaternion.js +2 -2
- package/src/standard/Math/Numbers/Rotation4.js +2 -2
- package/src/standard/Math/Numbers/Vector3.js +1 -1
- package/src/standard/Utility/MapUtilities.js +2 -2
- package/src/x_ite/Base/Events.js +6 -33
- package/src/x_ite/Base/FieldArray.js +1 -1
- package/src/x_ite/Base/FieldDefinitionArray.js +1 -1
- package/src/x_ite/Base/X3DArrayField.js +1 -1
- package/src/x_ite/Base/X3DBaseNode.js +58 -69
- package/src/x_ite/Base/X3DChildObject.js +46 -14
- package/src/x_ite/Base/X3DConstants.js +1 -1
- package/src/x_ite/Base/X3DField.js +4 -6
- package/src/x_ite/Base/X3DFieldDefinition.js +1 -1
- package/src/x_ite/Base/X3DInfoArray.js +1 -1
- package/src/x_ite/Base/X3DObject.js +5 -5
- package/src/x_ite/Base/X3DObjectArrayField.js +1 -1
- package/src/x_ite/Base/X3DTypedArrayField.js +1 -1
- package/src/x_ite/Browser/Core/BrowserOptions.js +7 -3
- package/src/x_ite/Browser/Core/BrowserTimings.js +1 -1
- package/src/x_ite/Browser/Core/ContextMenu.js +1 -12
- package/src/x_ite/Browser/Core/X3DCoreContext.js +1 -2
- package/src/x_ite/Browser/Geometry2D/Disk2DOptions.js +1 -1
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolator.js +2 -2
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolatorTemplate.js +1 -1
- package/src/x_ite/Browser/Interpolation/SquatInterpolator.js +1 -1
- package/src/x_ite/Browser/Layout/ScreenText.js +4 -4
- package/src/x_ite/Browser/Layout/X3DLayoutContext.js +1 -1
- package/src/x_ite/Browser/NURBS/NURBS.js +3 -3
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +9 -13
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +4 -7
- package/src/x_ite/Browser/Navigation/WalkViewer.js +1 -1
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +5 -6
- package/src/x_ite/Browser/Navigation/X3DViewer.js +2 -2
- package/src/x_ite/Browser/Networking/URLs.js +17 -9
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +0 -2
- package/src/x_ite/Browser/Picking/VolumePicker.js +2 -2
- package/src/x_ite/Browser/Text/PolygonText.js +2 -2
- package/src/x_ite/Browser/Texturing3D/DICOMParser.js +3 -3
- package/src/x_ite/Browser/Texturing3D/NRRDParser.js +2 -2
- package/src/x_ite/Browser/Time/X3DTimeContext.js +1 -1
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +148 -67
- package/src/x_ite/Browser/X3DBrowserContext.js +52 -16
- package/src/x_ite/Components/Core/X3DNode.js +21 -2
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +38 -42
- package/src/x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture.js +2 -2
- package/src/x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode.js +1 -1
- package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +4 -4
- package/src/x_ite/Components/EnvironmentalEffects/X3DFogObject.js +1 -1
- package/src/x_ite/Components/EnvironmentalSensor/ProximitySensor.js +2 -2
- package/src/x_ite/Components/EnvironmentalSensor/TransformSensor.js +2 -2
- package/src/x_ite/Components/EnvironmentalSensor/VisibilitySensor.js +1 -1
- package/src/x_ite/Components/Followers/X3DFollowerNode.js +1 -1
- package/src/x_ite/Components/Geometry2D/ArcClose2D.js +1 -1
- package/src/x_ite/Components/Geometry2D/Rectangle2D.js +1 -1
- package/src/x_ite/Components/Geometry3D/Box.js +1 -1
- package/src/x_ite/Components/Geometry3D/Extrusion.js +3 -3
- package/src/x_ite/Components/Geometry3D/IndexedFaceSet.js +3 -3
- package/src/x_ite/Components/Geospatial/GeoCoordinate.js +6 -6
- package/src/x_ite/Components/Geospatial/GeoPositionInterpolator.js +1 -1
- package/src/x_ite/Components/Geospatial/GeoTouchSensor.js +1 -1
- package/src/x_ite/Components/Geospatial/GeoViewpoint.js +7 -7
- package/src/x_ite/Components/Grouping/StaticGroup.js +1 -1
- package/src/x_ite/Components/Grouping/X3DBoundedObject.js +2 -2
- package/src/x_ite/Components/HAnim/HAnimHumanoid.js +1 -1
- package/src/x_ite/Components/Interpolation/ColorInterpolator.js +1 -1
- package/src/x_ite/Components/Interpolation/NormalInterpolator.js +1 -1
- package/src/x_ite/Components/Interpolation/OrientationInterpolator.js +1 -1
- package/src/x_ite/Components/Interpolation/PositionInterpolator.js +1 -1
- package/src/x_ite/Components/Interpolation/PositionInterpolator2D.js +1 -1
- package/src/x_ite/Components/Layering/X3DLayerNode.js +1 -1
- package/src/x_ite/Components/Lighting/X3DLightNode.js +1 -1
- package/src/x_ite/Components/NURBS/NurbsSurfaceInterpolator.js +1 -1
- package/src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js +2 -2
- package/src/x_ite/Components/Navigation/Billboard.js +1 -1
- package/src/x_ite/Components/Navigation/LOD.js +2 -2
- package/src/x_ite/Components/Navigation/OrthoViewpoint.js +1 -1
- package/src/x_ite/Components/Navigation/Viewpoint.js +1 -1
- package/src/x_ite/Components/Navigation/X3DViewpointNode.js +3 -3
- package/src/x_ite/Components/Networking/Inline.js +0 -4
- package/src/x_ite/Components/ParticleSystems/ForcePhysicsModel.js +1 -1
- package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +2 -2
- package/src/x_ite/Components/ParticleSystems/PointEmitter.js +1 -1
- package/src/x_ite/Components/ParticleSystems/PolylineEmitter.js +2 -2
- package/src/x_ite/Components/ParticleSystems/SurfaceEmitter.js +1 -1
- package/src/x_ite/Components/ParticleSystems/VolumeEmitter.js +2 -2
- package/src/x_ite/Components/ParticleSystems/WindPhysicsModel.js +1 -1
- package/src/x_ite/Components/Picking/LinePickSensor.js +1 -1
- package/src/x_ite/Components/Picking/PickableGroup.js +1 -1
- package/src/x_ite/Components/Picking/PointPickSensor.js +2 -2
- package/src/x_ite/Components/Picking/PrimitivePickSensor.js +1 -1
- package/src/x_ite/Components/Picking/VolumePickSensor.js +1 -1
- package/src/x_ite/Components/Picking/X3DPickSensorNode.js +6 -9
- package/src/x_ite/Components/PointingDeviceSensor/X3DTouchSensorNode.js +1 -1
- package/src/x_ite/Components/Rendering/X3DComposedGeometryNode.js +1 -1
- package/src/x_ite/Components/Rendering/X3DCoordinateNode.js +2 -2
- package/src/x_ite/Components/Rendering/X3DGeometryNode.js +8 -11
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +2 -2
- package/src/x_ite/Components/RigidBodyPhysics/BallJoint.js +2 -2
- package/src/x_ite/Components/RigidBodyPhysics/CollidableShape.js +3 -3
- package/src/x_ite/Components/RigidBodyPhysics/CollisionCollection.js +1 -1
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSensor.js +5 -14
- package/src/x_ite/Components/RigidBodyPhysics/DoubleAxisHingeJoint.js +3 -3
- package/src/x_ite/Components/RigidBodyPhysics/RigidBody.js +9 -9
- package/src/x_ite/Components/RigidBodyPhysics/RigidBodyCollection.js +1 -1
- package/src/x_ite/Components/RigidBodyPhysics/SingleAxisHingeJoint.js +3 -3
- package/src/x_ite/Components/RigidBodyPhysics/SliderJoint.js +1 -1
- package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollidableNode.js +1 -1
- package/src/x_ite/Components/Scripting/Script.js +1 -8
- package/src/x_ite/Components/Shaders/ShaderPart.js +2 -2
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +385 -382
- package/src/x_ite/Components/Shape/Appearance.js +1 -1
- package/src/x_ite/Components/Shape/Material.js +1 -1
- package/src/x_ite/Components/Shape/PhysicalMaterial.js +1 -1
- package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +1 -1
- package/src/x_ite/Components/Sound/Sound.js +2 -2
- package/src/x_ite/Components/TextureProjector/X3DTextureProjectorNode.js +2 -2
- package/src/x_ite/Components/Texturing/MultiTexture.js +3 -3
- package/src/x_ite/Components/Texturing/TextureCoordinateGenerator.js +1 -1
- package/src/x_ite/Components/Texturing/TextureProperties.js +4 -4
- package/src/x_ite/Components/Texturing/TextureTransform.js +1 -1
- package/src/x_ite/Components/Texturing/X3DSingleTextureNode.js +2 -2
- package/src/x_ite/Components/Texturing3D/PixelTexture3D.js +1 -1
- package/src/x_ite/Components/Texturing3D/TextureTransform3D.js +1 -1
- package/src/x_ite/Components.js +1 -20
- package/src/x_ite/Configuration/AbstractNodesArray.js +1 -1
- package/src/x_ite/Configuration/ComponentInfo.js +1 -1
- package/src/x_ite/Configuration/ComponentInfoArray.js +1 -1
- package/src/x_ite/Configuration/ConcreteNodesArray.js +1 -1
- package/src/x_ite/Configuration/ProfileInfo.js +1 -1
- package/src/x_ite/Configuration/ProfileInfoArray.js +1 -1
- package/src/x_ite/Configuration/UnitInfo.js +1 -1
- package/src/x_ite/Configuration/UnitInfoArray.js +1 -1
- package/src/x_ite/Execution/BindableList.js +1 -1
- package/src/x_ite/Execution/BindableStack.js +1 -1
- package/src/x_ite/Execution/ExportedNodesArray.js +1 -1
- package/src/x_ite/Execution/ImportedNodesArray.js +1 -1
- package/src/x_ite/Execution/NamedNodesArray.js +1 -1
- package/src/x_ite/Execution/X3DExecutionContext.js +9 -11
- package/src/x_ite/Execution/X3DExportedNode.js +1 -1
- package/src/x_ite/Execution/X3DImportedNode.js +1 -1
- package/src/x_ite/Execution/X3DScene.js +2 -6
- package/src/x_ite/Execution/X3DWorld.js +1 -2
- package/src/x_ite/{Browser/Networking/Features.js → Features.js} +9 -2
- package/src/x_ite/Fields/ArrayFields.js +9 -51
- package/src/x_ite/Fields/SFBool.js +1 -1
- package/src/x_ite/Fields/SFColor.js +2 -2
- package/src/x_ite/Fields/SFColorRGBA.js +2 -2
- package/src/x_ite/Fields/SFDouble.js +1 -1
- package/src/x_ite/Fields/SFFloat.js +1 -1
- package/src/x_ite/Fields/SFImage.js +2 -2
- package/src/x_ite/Fields/SFInt32.js +1 -1
- package/src/x_ite/Fields/SFMatrix3.js +1 -1
- package/src/x_ite/Fields/SFMatrix4.js +1 -1
- package/src/x_ite/Fields/SFNode.js +3 -25
- package/src/x_ite/Fields/SFNodeCache.js +24 -3
- package/src/x_ite/Fields/SFRotation.js +1 -1
- package/src/x_ite/Fields/SFString.js +1 -1
- package/src/x_ite/Fields/SFTime.js +1 -1
- package/src/x_ite/Fields/SFVec2.js +1 -1
- package/src/x_ite/Fields/SFVec3.js +1 -1
- package/src/x_ite/Fields/SFVec4.js +1 -1
- package/src/x_ite/InputOutput/FileLoader.js +1 -1
- package/src/x_ite/InputOutput/Generator.js +8 -8
- package/src/x_ite/Parser/GLTF2Parser.js +5 -5
- package/src/x_ite/Parser/HTMLSupport.js +3 -0
- package/src/x_ite/Parser/SVGParser.js +2 -2
- package/src/x_ite/Parser/VRMLParser.js +1 -1
- package/src/x_ite/Parser/XMLParser.js +1 -1
- package/src/x_ite/Prototype/ExternProtoDeclarationArray.js +1 -1
- package/src/x_ite/Prototype/ProtoDeclarationArray.js +1 -1
- package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +1 -3
- package/src/x_ite/Prototype/X3DProtoDeclaration.js +1 -2
- package/src/x_ite/Prototype/X3DProtoDeclarationNode.js +1 -2
- package/src/x_ite/Rendering/DependentRenderer.js +1 -1
- package/src/x_ite/Rendering/TextureBuffer.js +2 -2
- package/src/x_ite/Rendering/X3DRenderObject.js +11 -11
- package/src/x_ite/Routing/RouteArray.js +1 -1
- package/src/x_ite/Routing/X3DRoute.js +1 -1
- package/src/x_ite/X3D.js +2 -2
- package/src/x_ite.html +3 -3
- package/x_ite.min.html +3 -3
- package/src/x_ite/Base/X3DEventObject.js +0 -115
|
@@ -421,112 +421,115 @@ Object .assign (X3DProgrammableShaderObject .prototype,
|
|
|
421
421
|
|
|
422
422
|
for (const field of this .getUserDefinedFields ())
|
|
423
423
|
{
|
|
424
|
+
if (field .getAccessType () === X3DConstants .outputOnly)
|
|
425
|
+
continue;
|
|
426
|
+
|
|
424
427
|
const location = gl .getUniformLocation (program, field .getName ());
|
|
425
428
|
|
|
426
|
-
if (location)
|
|
429
|
+
if (!location)
|
|
430
|
+
continue;
|
|
431
|
+
|
|
432
|
+
switch (field .getType ())
|
|
427
433
|
{
|
|
428
|
-
|
|
434
|
+
case X3DConstants .SFImage:
|
|
429
435
|
{
|
|
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
|
-
const locations = location .locations = [ ];
|
|
486
|
-
|
|
487
|
-
for (let i = 0;; ++ i)
|
|
488
|
-
{
|
|
489
|
-
const l = gl .getUniformLocation (program, field .getName () + "[" + i + "]");
|
|
436
|
+
location .array = new Int32Array (3 + field .array .length);
|
|
437
|
+
break;
|
|
438
|
+
}
|
|
439
|
+
case X3DConstants .SFMatrix3d:
|
|
440
|
+
case X3DConstants .SFMatrix3f:
|
|
441
|
+
case X3DConstants .SFRotation:
|
|
442
|
+
{
|
|
443
|
+
location .array = new Float32Array (9);
|
|
444
|
+
break;
|
|
445
|
+
}
|
|
446
|
+
case X3DConstants .SFMatrix4d:
|
|
447
|
+
case X3DConstants .SFMatrix4f:
|
|
448
|
+
{
|
|
449
|
+
location .array = new Float32Array (16);
|
|
450
|
+
break;
|
|
451
|
+
}
|
|
452
|
+
case X3DConstants .SFNode:
|
|
453
|
+
{
|
|
454
|
+
break;
|
|
455
|
+
}
|
|
456
|
+
case X3DConstants .MFBool:
|
|
457
|
+
case X3DConstants .MFInt32:
|
|
458
|
+
{
|
|
459
|
+
location .array = new Int32Array (this .getLocationLength (gl, program, field));
|
|
460
|
+
break;
|
|
461
|
+
}
|
|
462
|
+
case X3DConstants .MFFloat:
|
|
463
|
+
case X3DConstants .MFDouble:
|
|
464
|
+
case X3DConstants .MFTime:
|
|
465
|
+
{
|
|
466
|
+
location .array = new Float32Array (this .getLocationLength (gl, program, field));
|
|
467
|
+
break;
|
|
468
|
+
}
|
|
469
|
+
case X3DConstants .MFImage:
|
|
470
|
+
{
|
|
471
|
+
location .array = new Int32Array (this .getImagesLength (field));
|
|
472
|
+
break;
|
|
473
|
+
}
|
|
474
|
+
case X3DConstants .MFMatrix3d:
|
|
475
|
+
case X3DConstants .MFMatrix3f:
|
|
476
|
+
case X3DConstants .MFRotation:
|
|
477
|
+
{
|
|
478
|
+
location .array = new Float32Array (9 * this .getLocationLength (gl, program, field));
|
|
479
|
+
break;
|
|
480
|
+
}
|
|
481
|
+
case X3DConstants .MFMatrix4d:
|
|
482
|
+
case X3DConstants .MFMatrix4f:
|
|
483
|
+
{
|
|
484
|
+
location .array = new Float32Array (16 * this .getLocationLength (gl, program, field));
|
|
485
|
+
break;
|
|
486
|
+
}
|
|
487
|
+
case X3DConstants .MFNode:
|
|
488
|
+
{
|
|
489
|
+
const locations = location .locations = [ ];
|
|
490
490
|
|
|
491
|
-
|
|
492
|
-
|
|
491
|
+
for (let i = 0;; ++ i)
|
|
492
|
+
{
|
|
493
|
+
const l = gl .getUniformLocation (program, field .getName () + "[" + i + "]");
|
|
493
494
|
|
|
494
|
-
|
|
495
|
-
|
|
495
|
+
if (! l)
|
|
496
|
+
break;
|
|
496
497
|
|
|
497
|
-
|
|
498
|
-
}
|
|
499
|
-
case X3DConstants .MFVec2d:
|
|
500
|
-
case X3DConstants .MFVec2f:
|
|
501
|
-
{
|
|
502
|
-
location .array = new Float32Array (2 * this .getLocationLength (gl, program, field));
|
|
503
|
-
break;
|
|
504
|
-
}
|
|
505
|
-
case X3DConstants .MFVec3d:
|
|
506
|
-
case X3DConstants .MFVec3f:
|
|
507
|
-
case X3DConstants .MFColor:
|
|
508
|
-
{
|
|
509
|
-
location .array = new Float32Array (3 * this .getLocationLength (gl, program, field));
|
|
510
|
-
break;
|
|
511
|
-
}
|
|
512
|
-
case X3DConstants .MFVec4d:
|
|
513
|
-
case X3DConstants .MFVec4f:
|
|
514
|
-
case X3DConstants .MFColorRGBA:
|
|
515
|
-
{
|
|
516
|
-
location .array = new Float32Array (4 * this .getLocationLength (gl, program, field));
|
|
517
|
-
break;
|
|
498
|
+
locations .push (l);
|
|
518
499
|
}
|
|
500
|
+
|
|
501
|
+
break;
|
|
502
|
+
}
|
|
503
|
+
case X3DConstants .MFVec2d:
|
|
504
|
+
case X3DConstants .MFVec2f:
|
|
505
|
+
{
|
|
506
|
+
location .array = new Float32Array (2 * this .getLocationLength (gl, program, field));
|
|
507
|
+
break;
|
|
519
508
|
}
|
|
509
|
+
case X3DConstants .MFVec3d:
|
|
510
|
+
case X3DConstants .MFVec3f:
|
|
511
|
+
case X3DConstants .MFColor:
|
|
512
|
+
{
|
|
513
|
+
location .array = new Float32Array (3 * this .getLocationLength (gl, program, field));
|
|
514
|
+
break;
|
|
515
|
+
}
|
|
516
|
+
case X3DConstants .MFVec4d:
|
|
517
|
+
case X3DConstants .MFVec4f:
|
|
518
|
+
case X3DConstants .MFColorRGBA:
|
|
519
|
+
{
|
|
520
|
+
location .array = new Float32Array (4 * this .getLocationLength (gl, program, field));
|
|
521
|
+
break;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
520
524
|
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
+
if (location .array)
|
|
526
|
+
field [_uniformLocation] = location .array .length ? location : null;
|
|
527
|
+
else
|
|
528
|
+
field [_uniformLocation] = location;
|
|
525
529
|
|
|
526
|
-
|
|
530
|
+
field .addInterest ("set_field__", this);
|
|
527
531
|
|
|
528
|
-
|
|
529
|
-
}
|
|
532
|
+
this .set_field__ (field);
|
|
530
533
|
}
|
|
531
534
|
},
|
|
532
535
|
removeShaderFields ()
|
|
@@ -534,7 +537,7 @@ Object .assign (X3DProgrammableShaderObject .prototype,
|
|
|
534
537
|
for (const field of this .getUserDefinedFields ())
|
|
535
538
|
field .removeInterest ("set_field__", this);
|
|
536
539
|
},
|
|
537
|
-
set_field__: (
|
|
540
|
+
set_field__: (() =>
|
|
538
541
|
{
|
|
539
542
|
const rotation = new Float32Array (9);
|
|
540
543
|
|
|
@@ -547,361 +550,361 @@ Object .assign (X3DProgrammableShaderObject .prototype,
|
|
|
547
550
|
|
|
548
551
|
gl .useProgram (program);
|
|
549
552
|
|
|
550
|
-
if (location)
|
|
553
|
+
if (!location)
|
|
554
|
+
return;
|
|
555
|
+
|
|
556
|
+
switch (field .getType ())
|
|
551
557
|
{
|
|
552
|
-
|
|
558
|
+
case X3DConstants .SFBool:
|
|
559
|
+
case X3DConstants .SFInt32:
|
|
553
560
|
{
|
|
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
|
-
case X3DConstants .SFImage:
|
|
580
|
-
{
|
|
581
|
-
let array = location .array;
|
|
582
|
-
|
|
583
|
-
const
|
|
584
|
-
pixels = field .array,
|
|
585
|
-
length = 3 + pixels .length;
|
|
586
|
-
|
|
587
|
-
if (length !== array .length)
|
|
588
|
-
array = location .array = new Int32Array (length);
|
|
561
|
+
gl .uniform1i (location, field .getValue ());
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
case X3DConstants .SFColor:
|
|
565
|
+
{
|
|
566
|
+
const value = field .getValue ();
|
|
567
|
+
gl .uniform3f (location, value .r, value .g, value .b);
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
case X3DConstants .SFColorRGBA:
|
|
571
|
+
{
|
|
572
|
+
const value = field .getValue ();
|
|
573
|
+
gl .uniform4f (location, value .r, value .g, value .b, value .a);
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
case X3DConstants .SFDouble:
|
|
577
|
+
case X3DConstants .SFFloat:
|
|
578
|
+
case X3DConstants .SFTime:
|
|
579
|
+
{
|
|
580
|
+
gl .uniform1f (location, field .getValue ());
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
case X3DConstants .SFImage:
|
|
584
|
+
{
|
|
585
|
+
let array = location .array;
|
|
589
586
|
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
587
|
+
const
|
|
588
|
+
pixels = field .array,
|
|
589
|
+
length = 3 + pixels .length;
|
|
593
590
|
|
|
594
|
-
|
|
595
|
-
|
|
591
|
+
if (length !== array .length)
|
|
592
|
+
array = location .array = new Int32Array (length);
|
|
596
593
|
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
case X3DConstants .SFMatrix3d:
|
|
601
|
-
case X3DConstants .SFMatrix3f:
|
|
602
|
-
{
|
|
603
|
-
location .array .set (field .getValue ());
|
|
594
|
+
array [0] = field .width;
|
|
595
|
+
array [1] = field .height;
|
|
596
|
+
array [2] = field .comp;
|
|
604
597
|
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
}
|
|
608
|
-
case X3DConstants .SFMatrix4d:
|
|
609
|
-
case X3DConstants .SFMatrix4f:
|
|
610
|
-
{
|
|
611
|
-
location .array .set (field .getValue ());
|
|
598
|
+
for (let a = 3, p = 0, pl = pixels .length; p < pl; ++ p, ++ a)
|
|
599
|
+
array [a] = pixels [p];
|
|
612
600
|
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
601
|
+
gl .uniform1iv (location, array);
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
case X3DConstants .SFMatrix3d:
|
|
605
|
+
case X3DConstants .SFMatrix3f:
|
|
606
|
+
{
|
|
607
|
+
location .array .set (field .getValue ());
|
|
619
608
|
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
609
|
+
gl .uniformMatrix3fv (location, false, location .array);
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
612
|
+
case X3DConstants .SFMatrix4d:
|
|
613
|
+
case X3DConstants .SFMatrix4f:
|
|
614
|
+
{
|
|
615
|
+
location .array .set (field .getValue ());
|
|
624
616
|
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
617
|
+
gl .uniformMatrix4fv (location, false, location .array);
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
case X3DConstants .SFNode:
|
|
621
|
+
{
|
|
622
|
+
const texture = X3DCast (X3DConstants .X3DTextureNode, field);
|
|
631
623
|
|
|
632
|
-
|
|
633
|
-
}
|
|
634
|
-
case X3DConstants .SFRotation:
|
|
624
|
+
if (texture)
|
|
635
625
|
{
|
|
636
|
-
|
|
626
|
+
location .name = field .getName ();
|
|
627
|
+
location .texture = texture;
|
|
637
628
|
|
|
638
|
-
|
|
639
|
-
return;
|
|
629
|
+
this .textures .add (location);
|
|
640
630
|
}
|
|
641
|
-
|
|
631
|
+
else
|
|
642
632
|
{
|
|
643
|
-
|
|
633
|
+
this .textures .delete (location);
|
|
644
634
|
}
|
|
645
|
-
case X3DConstants .SFVec2d:
|
|
646
|
-
case X3DConstants .SFVec2f:
|
|
647
|
-
{
|
|
648
|
-
const value = field .getValue ();
|
|
649
|
-
gl .uniform2f (location, value .x, value .y);
|
|
650
|
-
return;
|
|
651
|
-
}
|
|
652
|
-
case X3DConstants .SFVec3d:
|
|
653
|
-
case X3DConstants .SFVec3f:
|
|
654
|
-
{
|
|
655
|
-
const value = field .getValue ();
|
|
656
|
-
gl .uniform3f (location, value .x, value .y, value .z);
|
|
657
|
-
return;
|
|
658
|
-
}
|
|
659
|
-
case X3DConstants .SFVec4d:
|
|
660
|
-
case X3DConstants .SFVec4f:
|
|
661
|
-
{
|
|
662
|
-
const value = field .getValue ();
|
|
663
|
-
gl .uniform4f (location, value .x, value .y, value .z, value .w);
|
|
664
|
-
return;
|
|
665
|
-
}
|
|
666
|
-
case X3DConstants .MFBool:
|
|
667
|
-
case X3DConstants .MFInt32:
|
|
668
|
-
{
|
|
669
|
-
const array = location .array;
|
|
670
635
|
|
|
671
|
-
|
|
672
|
-
|
|
636
|
+
return;
|
|
637
|
+
}
|
|
638
|
+
case X3DConstants .SFRotation:
|
|
639
|
+
{
|
|
640
|
+
field .getValue () .getMatrix (location .array);
|
|
673
641
|
|
|
674
|
-
|
|
675
|
-
|
|
642
|
+
gl .uniformMatrix3fv (location, false, location .array);
|
|
643
|
+
return;
|
|
644
|
+
}
|
|
645
|
+
case X3DConstants .SFString:
|
|
646
|
+
{
|
|
647
|
+
return;
|
|
648
|
+
}
|
|
649
|
+
case X3DConstants .SFVec2d:
|
|
650
|
+
case X3DConstants .SFVec2f:
|
|
651
|
+
{
|
|
652
|
+
const value = field .getValue ();
|
|
653
|
+
gl .uniform2f (location, value .x, value .y);
|
|
654
|
+
return;
|
|
655
|
+
}
|
|
656
|
+
case X3DConstants .SFVec3d:
|
|
657
|
+
case X3DConstants .SFVec3f:
|
|
658
|
+
{
|
|
659
|
+
const value = field .getValue ();
|
|
660
|
+
gl .uniform3f (location, value .x, value .y, value .z);
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
case X3DConstants .SFVec4d:
|
|
664
|
+
case X3DConstants .SFVec4f:
|
|
665
|
+
{
|
|
666
|
+
const value = field .getValue ();
|
|
667
|
+
gl .uniform4f (location, value .x, value .y, value .z, value .w);
|
|
668
|
+
return;
|
|
669
|
+
}
|
|
670
|
+
case X3DConstants .MFBool:
|
|
671
|
+
case X3DConstants .MFInt32:
|
|
672
|
+
{
|
|
673
|
+
const array = location .array;
|
|
676
674
|
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
}
|
|
680
|
-
case X3DConstants .MFColor:
|
|
681
|
-
{
|
|
682
|
-
const array = location .array;
|
|
675
|
+
for (var i = 0, length = field .length; i < length; ++ i)
|
|
676
|
+
array [i] = field [i];
|
|
683
677
|
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
const color = field [i];
|
|
678
|
+
for (let length = array .length; i < length; ++ i)
|
|
679
|
+
array [i] = 0;
|
|
687
680
|
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
681
|
+
gl .uniform1iv (location, array);
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
case X3DConstants .MFColor:
|
|
685
|
+
{
|
|
686
|
+
const array = location .array;
|
|
692
687
|
|
|
693
|
-
|
|
694
|
-
|
|
688
|
+
for (var i = 0, k = 0, length = field .length; i < length; ++ i)
|
|
689
|
+
{
|
|
690
|
+
const color = field [i];
|
|
695
691
|
|
|
696
|
-
|
|
697
|
-
|
|
692
|
+
array [k++] = color .r;
|
|
693
|
+
array [k++] = color .g;
|
|
694
|
+
array [k++] = color .b;
|
|
698
695
|
}
|
|
699
|
-
case X3DConstants .MFColorRGBA:
|
|
700
|
-
{
|
|
701
|
-
const array = location .array;
|
|
702
696
|
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
const color = field [i];
|
|
697
|
+
for (let length = array .length; k < length; ++ k)
|
|
698
|
+
array [k] = 0;
|
|
706
699
|
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
700
|
+
gl .uniform3fv (location, array);
|
|
701
|
+
return;
|
|
702
|
+
}
|
|
703
|
+
case X3DConstants .MFColorRGBA:
|
|
704
|
+
{
|
|
705
|
+
const array = location .array;
|
|
712
706
|
|
|
713
|
-
|
|
714
|
-
|
|
707
|
+
for (var i = 0, k = 0, length = field .length; i < length; ++ i)
|
|
708
|
+
{
|
|
709
|
+
const color = field [i];
|
|
715
710
|
|
|
716
|
-
|
|
717
|
-
|
|
711
|
+
array [k++] = color .r;
|
|
712
|
+
array [k++] = color .g;
|
|
713
|
+
array [k++] = color .b;
|
|
714
|
+
array [k++] = color .a;
|
|
718
715
|
}
|
|
719
|
-
case X3DConstants .MFDouble:
|
|
720
|
-
case X3DConstants .MFFloat:
|
|
721
|
-
case X3DConstants .MFTime:
|
|
722
|
-
{
|
|
723
|
-
const array = location .array;
|
|
724
716
|
|
|
725
|
-
|
|
726
|
-
|
|
717
|
+
for (let length = array .length; k < length; ++ k)
|
|
718
|
+
array [k] = 0;
|
|
727
719
|
|
|
728
|
-
|
|
729
|
-
|
|
720
|
+
gl .uniform4fv (location, array);
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
723
|
+
case X3DConstants .MFDouble:
|
|
724
|
+
case X3DConstants .MFFloat:
|
|
725
|
+
case X3DConstants .MFTime:
|
|
726
|
+
{
|
|
727
|
+
const array = location .array;
|
|
730
728
|
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
}
|
|
734
|
-
case X3DConstants .MFImage:
|
|
735
|
-
{
|
|
736
|
-
const array = location .array;
|
|
729
|
+
for (var i = 0, length = field .length; i < length; ++ i)
|
|
730
|
+
array [i] = field [i];
|
|
737
731
|
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
732
|
+
for (let length = array .length; i < length; ++ i)
|
|
733
|
+
array [i] = 0;
|
|
734
|
+
|
|
735
|
+
gl .uniform1fv (location, array);
|
|
736
|
+
return;
|
|
737
|
+
}
|
|
738
|
+
case X3DConstants .MFImage:
|
|
739
|
+
{
|
|
740
|
+
const array = location .array;
|
|
743
741
|
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
742
|
+
for (let i = 0, a = 0, length = field .length; i < length; ++ i)
|
|
743
|
+
{
|
|
744
|
+
const
|
|
745
|
+
value = field [i],
|
|
746
|
+
pixels = value .array;
|
|
747
747
|
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
748
|
+
array [a ++] = value .width;
|
|
749
|
+
array [a ++] = value .height;
|
|
750
|
+
array [a ++] = value .comp;
|
|
751
751
|
|
|
752
|
-
|
|
753
|
-
|
|
752
|
+
for (let p = 0, pl = pixels .length; p < pl; ++ p)
|
|
753
|
+
array [a ++] = pixels [p];
|
|
754
754
|
}
|
|
755
|
-
|
|
756
|
-
|
|
755
|
+
|
|
756
|
+
gl .uniform1iv (location, array);
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
case X3DConstants .MFMatrix3d:
|
|
760
|
+
case X3DConstants .MFMatrix3f:
|
|
761
|
+
{
|
|
762
|
+
const array = location .array;
|
|
763
|
+
|
|
764
|
+
for (var i = 0, k = 0, length = field .length; i < length; ++ i)
|
|
757
765
|
{
|
|
758
|
-
const
|
|
766
|
+
const matrix = field [i];
|
|
759
767
|
|
|
760
|
-
for (
|
|
761
|
-
|
|
762
|
-
|
|
768
|
+
for (let m = 0; m < 9; ++ m)
|
|
769
|
+
array [k++] = matrix [m];
|
|
770
|
+
}
|
|
763
771
|
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
}
|
|
772
|
+
for (let length = array .length; k < length; ++ k)
|
|
773
|
+
array [k] = 0;
|
|
767
774
|
|
|
768
|
-
|
|
769
|
-
|
|
775
|
+
gl .uniformMatrix3fv (location, false, array);
|
|
776
|
+
return;
|
|
777
|
+
}
|
|
778
|
+
case X3DConstants .MFMatrix4d:
|
|
779
|
+
case X3DConstants .MFMatrix4f:
|
|
780
|
+
{
|
|
781
|
+
const array = location .array;
|
|
770
782
|
|
|
771
|
-
|
|
772
|
-
return;
|
|
773
|
-
}
|
|
774
|
-
case X3DConstants .MFMatrix4d:
|
|
775
|
-
case X3DConstants .MFMatrix4f:
|
|
783
|
+
for (var i = 0, k = 0, length = field .length; i < length; ++ i)
|
|
776
784
|
{
|
|
777
|
-
const
|
|
785
|
+
const matrix = field [i];
|
|
778
786
|
|
|
779
|
-
for (
|
|
780
|
-
|
|
781
|
-
|
|
787
|
+
for (let m = 0; m < 16; ++ m)
|
|
788
|
+
array [k++] = matrix [m];
|
|
789
|
+
}
|
|
782
790
|
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
}
|
|
791
|
+
for (let length = array .length; k < length; ++ k)
|
|
792
|
+
array [k] = 0;
|
|
786
793
|
|
|
787
|
-
|
|
788
|
-
|
|
794
|
+
gl .uniformMatrix4fv (location, false, array);
|
|
795
|
+
return;
|
|
796
|
+
}
|
|
797
|
+
case X3DConstants .MFNode:
|
|
798
|
+
{
|
|
799
|
+
const locations = location .locations;
|
|
789
800
|
|
|
790
|
-
|
|
791
|
-
return;
|
|
792
|
-
}
|
|
793
|
-
case X3DConstants .MFNode:
|
|
801
|
+
for (let i = 0, length = field .length; i < length; ++ i)
|
|
794
802
|
{
|
|
795
|
-
const
|
|
803
|
+
const texture = X3DCast (X3DConstants .X3DTextureNode, field [i]);
|
|
796
804
|
|
|
797
|
-
|
|
805
|
+
if (texture)
|
|
798
806
|
{
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
if (texture)
|
|
802
|
-
{
|
|
803
|
-
locations [i] .name = field .getName ();
|
|
804
|
-
locations [i] .texture = texture;
|
|
805
|
-
|
|
806
|
-
this .textures .add (locations [i]);
|
|
807
|
-
}
|
|
808
|
-
else
|
|
809
|
-
{
|
|
810
|
-
this .textures .delete (locations [i]);
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
return;
|
|
815
|
-
}
|
|
816
|
-
case X3DConstants .MFRotation:
|
|
817
|
-
{
|
|
818
|
-
const array = location .array;
|
|
807
|
+
locations [i] .name = field .getName ();
|
|
808
|
+
locations [i] .texture = texture;
|
|
819
809
|
|
|
820
|
-
|
|
810
|
+
this .textures .add (locations [i]);
|
|
811
|
+
}
|
|
812
|
+
else
|
|
821
813
|
{
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
array [k++] = rotation [0];
|
|
825
|
-
array [k++] = rotation [1];
|
|
826
|
-
array [k++] = rotation [2];
|
|
827
|
-
array [k++] = rotation [3];
|
|
828
|
-
array [k++] = rotation [4];
|
|
829
|
-
array [k++] = rotation [5];
|
|
830
|
-
array [k++] = rotation [6];
|
|
831
|
-
array [k++] = rotation [7];
|
|
832
|
-
array [k++] = rotation [8];
|
|
814
|
+
this .textures .delete (locations [i]);
|
|
833
815
|
}
|
|
816
|
+
}
|
|
834
817
|
|
|
835
|
-
|
|
836
|
-
|
|
818
|
+
return;
|
|
819
|
+
}
|
|
820
|
+
case X3DConstants .MFRotation:
|
|
821
|
+
{
|
|
822
|
+
const array = location .array;
|
|
837
823
|
|
|
838
|
-
|
|
839
|
-
return;
|
|
840
|
-
}
|
|
841
|
-
case X3DConstants .MFString:
|
|
824
|
+
for (var i = 0, k = 0, length = field .length; i < length; ++ i)
|
|
842
825
|
{
|
|
843
|
-
|
|
826
|
+
field [i] .getValue () .getMatrix (rotation);
|
|
827
|
+
|
|
828
|
+
array [k++] = rotation [0];
|
|
829
|
+
array [k++] = rotation [1];
|
|
830
|
+
array [k++] = rotation [2];
|
|
831
|
+
array [k++] = rotation [3];
|
|
832
|
+
array [k++] = rotation [4];
|
|
833
|
+
array [k++] = rotation [5];
|
|
834
|
+
array [k++] = rotation [6];
|
|
835
|
+
array [k++] = rotation [7];
|
|
836
|
+
array [k++] = rotation [8];
|
|
844
837
|
}
|
|
845
|
-
case X3DConstants .MFVec2d:
|
|
846
|
-
case X3DConstants .MFVec2f:
|
|
847
|
-
{
|
|
848
|
-
const array = location .array;
|
|
849
838
|
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
const vector = field [i];
|
|
839
|
+
for (let length = array .length; k < length; ++ k)
|
|
840
|
+
array [k] = 0;
|
|
853
841
|
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
842
|
+
gl .uniformMatrix3fv (location, false, array);
|
|
843
|
+
return;
|
|
844
|
+
}
|
|
845
|
+
case X3DConstants .MFString:
|
|
846
|
+
{
|
|
847
|
+
return;
|
|
848
|
+
}
|
|
849
|
+
case X3DConstants .MFVec2d:
|
|
850
|
+
case X3DConstants .MFVec2f:
|
|
851
|
+
{
|
|
852
|
+
const array = location .array;
|
|
857
853
|
|
|
858
|
-
|
|
859
|
-
|
|
854
|
+
for (var i = 0, k = 0, length = field .length; i < length; ++ i)
|
|
855
|
+
{
|
|
856
|
+
const vector = field [i];
|
|
860
857
|
|
|
861
|
-
|
|
862
|
-
|
|
858
|
+
array [k++] = vector .x;
|
|
859
|
+
array [k++] = vector .y;
|
|
863
860
|
}
|
|
864
|
-
case X3DConstants .MFVec3d:
|
|
865
|
-
case X3DConstants .MFVec3f:
|
|
866
|
-
{
|
|
867
|
-
const array = location .array;
|
|
868
861
|
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
const vector = field [i];
|
|
862
|
+
for (let length = array .length; k < length; ++ k)
|
|
863
|
+
array [k] = 0;
|
|
872
864
|
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
865
|
+
gl .uniform2fv (location, array);
|
|
866
|
+
return;
|
|
867
|
+
}
|
|
868
|
+
case X3DConstants .MFVec3d:
|
|
869
|
+
case X3DConstants .MFVec3f:
|
|
870
|
+
{
|
|
871
|
+
const array = location .array;
|
|
877
872
|
|
|
878
|
-
|
|
879
|
-
|
|
873
|
+
for (var i = 0, k = 0, length = field .length; i < length; ++ i)
|
|
874
|
+
{
|
|
875
|
+
const vector = field [i];
|
|
880
876
|
|
|
881
|
-
|
|
882
|
-
|
|
877
|
+
array [k++] = vector .x;
|
|
878
|
+
array [k++] = vector .y;
|
|
879
|
+
array [k++] = vector .z;
|
|
883
880
|
}
|
|
884
|
-
case X3DConstants .MFVec4d:
|
|
885
|
-
case X3DConstants .MFVec4f:
|
|
886
|
-
{
|
|
887
|
-
const array = location .array;
|
|
888
881
|
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
const vector = field [i];
|
|
882
|
+
for (let length = array .length; k < length; ++ k)
|
|
883
|
+
array [k] = 0;
|
|
892
884
|
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
885
|
+
gl .uniform3fv (location, array);
|
|
886
|
+
return;
|
|
887
|
+
}
|
|
888
|
+
case X3DConstants .MFVec4d:
|
|
889
|
+
case X3DConstants .MFVec4f:
|
|
890
|
+
{
|
|
891
|
+
const array = location .array;
|
|
898
892
|
|
|
899
|
-
|
|
900
|
-
|
|
893
|
+
for (var i = 0, k = 0, length = field .length; i < length; ++ i)
|
|
894
|
+
{
|
|
895
|
+
const vector = field [i];
|
|
901
896
|
|
|
902
|
-
|
|
903
|
-
|
|
897
|
+
array [k++] = vector .x;
|
|
898
|
+
array [k++] = vector .y;
|
|
899
|
+
array [k++] = vector .z;
|
|
900
|
+
array [k++] = vector .w;
|
|
904
901
|
}
|
|
902
|
+
|
|
903
|
+
for (let length = array .length; k < length; ++ k)
|
|
904
|
+
array [k] = 0;
|
|
905
|
+
|
|
906
|
+
gl .uniform4fv (location, array);
|
|
907
|
+
return;
|
|
905
908
|
}
|
|
906
909
|
}
|
|
907
910
|
};
|
|
@@ -963,7 +966,7 @@ Object .assign (X3DProgrammableShaderObject .prototype,
|
|
|
963
966
|
for (const clipPlane of clipPlanes)
|
|
964
967
|
clipPlane .setShaderUniforms (gl, this);
|
|
965
968
|
},
|
|
966
|
-
setUniforms: (
|
|
969
|
+
setUniforms: (() =>
|
|
967
970
|
{
|
|
968
971
|
const normalMatrix = new Float32Array (9);
|
|
969
972
|
|
|
@@ -1301,8 +1304,8 @@ Object .assign (X3DProgrammableShaderObject .prototype,
|
|
|
1301
1304
|
result .attributeCount += attribute .size;
|
|
1302
1305
|
}
|
|
1303
1306
|
|
|
1304
|
-
result .uniforms .sort (
|
|
1305
|
-
result .attributes .sort (
|
|
1307
|
+
result .uniforms .sort ((a, b) => cmp (a .name, b .name));
|
|
1308
|
+
result .attributes .sort ((a, b) => cmp (a .name, b .name));
|
|
1306
1309
|
|
|
1307
1310
|
return result;
|
|
1308
1311
|
},
|