x_ite 8.4.3 → 8.5.3
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 +5 -1
- package/Makefile +0 -3
- package/build/bin/components.js +173 -0
- package/build/bin/tags.pl +28 -0
- package/build/bin/tests.pl +80 -2
- package/build/bin/version.pl +12 -7
- 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 +28 -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 +19 -19
- package/dist/assets/components/Geometry2D.min.js +1 -1
- package/dist/assets/components/Geospatial.js +33 -33
- package/dist/assets/components/Geospatial.min.js +1 -1
- package/dist/assets/components/HAnim.js +63 -42
- 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 +37 -29
- package/dist/assets/components/Layout.min.js +1 -1
- package/dist/assets/components/NURBS.js +29 -31
- package/dist/assets/components/NURBS.min.js +1 -1
- package/dist/assets/components/ParticleSystems.js +23 -23
- package/dist/assets/components/ParticleSystems.min.js +1 -1
- package/dist/assets/components/Picking.js +19 -19
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +24 -19
- package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
- package/dist/assets/components/Scripting.js +30 -30
- package/dist/assets/components/Scripting.min.js +1 -1
- package/dist/assets/components/Text.js +172 -594
- package/dist/assets/components/Text.min.js +1 -1
- package/dist/assets/components/TextureProjector.js +31 -47
- package/dist/assets/components/TextureProjector.min.js +1 -1
- package/dist/assets/components/Texturing3D.js +367 -346
- package/dist/assets/components/Texturing3D.min.js +1 -1
- package/dist/assets/components/VolumeRendering.js +19 -19
- 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 +12174 -3553
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.zip +0 -0
- package/docs/_config.yml +5 -136
- package/docs/_data/nav/components-CADGeometry.yml +14 -0
- package/docs/_data/nav/components-Core.yml +16 -0
- package/docs/_data/nav/components-CubeMapTexturing.yml +8 -0
- package/docs/_data/nav/components-DIS.yml +14 -0
- package/docs/_data/nav/components-EnvironmentalEffects.yml +12 -0
- package/docs/_data/nav/components-EnvironmentalSensor.yml +8 -0
- package/docs/_data/nav/components-EventUtilities.yml +16 -0
- package/docs/_data/nav/components-Followers.yml +30 -0
- package/docs/_data/nav/components-Geometry2D.yml +18 -0
- package/docs/_data/nav/components-Geometry3D.yml +16 -0
- package/docs/_data/nav/components-Geospatial.yml +24 -0
- package/docs/_data/nav/components-Grouping.yml +10 -0
- package/docs/_data/nav/components-HAnim.yml +14 -0
- package/docs/_data/nav/components-Interpolation.yml +28 -0
- package/docs/_data/nav/components-KeyDeviceSensor.yml +6 -0
- package/docs/_data/nav/components-Layering.yml +8 -0
- package/docs/_data/nav/components-Layout.yml +12 -0
- package/docs/_data/nav/components-Lighting.yml +10 -0
- package/docs/_data/nav/components-NURBS.yml +30 -0
- package/docs/_data/nav/components-Navigation.yml +16 -0
- package/docs/_data/nav/components-Networking.yml +8 -0
- package/docs/_data/nav/components-ParticleSystems.yml +22 -0
- package/docs/_data/nav/components-Picking.yml +12 -0
- package/docs/_data/nav/components-PointingDeviceSensor.yml +10 -0
- package/docs/_data/nav/components-Rendering.yml +30 -0
- package/docs/_data/nav/components-RigidBodyPhysics.yml +30 -0
- package/docs/_data/nav/components-Scripting.yml +4 -0
- package/docs/_data/nav/components-Shaders.yml +18 -0
- package/docs/_data/nav/components-Shape.yml +22 -0
- package/docs/_data/nav/components-Sound.yml +44 -0
- package/docs/_data/nav/components-Text.yml +6 -0
- package/docs/_data/nav/components-TextureProjector.yml +6 -0
- package/docs/_data/nav/components-Texturing.yml +22 -0
- package/docs/_data/nav/components-Texturing3D.yml +18 -0
- package/docs/_data/nav/components-Time.yml +4 -0
- package/docs/_data/nav/components-VolumeRendering.yml +28 -0
- package/docs/_data/nav/components-X_ITE.yml +4 -0
- package/docs/_data/nav/main.yml +26 -0
- package/docs/_data/nav/reference.yml +18 -0
- package/docs/_data/nav/tutorials-animation-sensors-and-geometry.yml +18 -0
- package/docs/_data/nav/tutorials-basic.yml +6 -0
- package/docs/_data/nav/tutorials-optimize-your-scene.yml +6 -0
- package/docs/_data/nav/tutorials-scripts-and-prototypes.yml +12 -0
- package/docs/_data/nav/tutorials-shapes-geometry-and-appearance.yml +16 -0
- package/docs/_data/nav/tutorials-textures-lights-and-environment.yml +20 -0
- package/docs/_includes/nav.html +2 -2
- package/docs/_includes/scripts.html +2 -1
- package/docs/_posts/accessing-the-external-browser.md +1 -1
- package/docs/_posts/browser-support.md +1 -1
- package/docs/_posts/components/CADGeometry/CADAssembly.md +83 -0
- package/docs/_posts/components/CADGeometry/CADFace.md +70 -0
- package/docs/_posts/components/CADGeometry/CADLayer.md +84 -0
- package/docs/_posts/components/CADGeometry/CADPart.md +117 -0
- package/docs/_posts/components/CADGeometry/IndexedQuadSet.md +125 -0
- package/docs/_posts/components/CADGeometry/QuadSet.md +113 -0
- package/docs/_posts/components/Core/MetadataBoolean.md +90 -0
- package/docs/_posts/components/Core/MetadataDouble.md +67 -0
- package/docs/_posts/components/Core/MetadataFloat.md +67 -0
- package/docs/_posts/components/Core/MetadataInteger.md +66 -0
- package/docs/_posts/components/Core/MetadataSet.md +63 -0
- package/docs/_posts/components/Core/MetadataString.md +66 -0
- package/docs/_posts/components/Core/WorldInfo.md +54 -0
- package/docs/_posts/components/CubeMapTexturing/ComposedCubeMapTexture.md +76 -0
- package/docs/_posts/components/CubeMapTexturing/GeneratedCubeMapTexture.md +65 -0
- package/docs/_posts/components/CubeMapTexturing/ImageCubeMapTexture.md +66 -0
- package/docs/_posts/components/DIS/DISEntityManager.md +73 -0
- package/docs/_posts/components/DIS/DISEntityTypeMapping.md +88 -0
- package/docs/_posts/components/DIS/EspduTransform.md +416 -0
- package/docs/_posts/components/DIS/ReceiverPdu.md +168 -0
- package/docs/_posts/components/DIS/SignalPdu.md +168 -0
- package/docs/_posts/components/DIS/TransmitterPdu.md +232 -0
- package/docs/_posts/components/EnvironmentalEffects/Background.md +189 -0
- package/docs/_posts/components/EnvironmentalEffects/Fog.md +97 -0
- package/docs/_posts/components/EnvironmentalEffects/FogCoordinate.md +40 -0
- package/docs/_posts/components/EnvironmentalEffects/LocalFog.md +84 -0
- package/docs/_posts/components/EnvironmentalEffects/TextureBackground.md +142 -0
- package/docs/_posts/components/EnvironmentalSensor/ProximitySensor.md +90 -0
- package/docs/_posts/components/EnvironmentalSensor/TransformSensor.md +91 -0
- package/docs/_posts/components/EnvironmentalSensor/VisibilitySensor.md +73 -0
- package/docs/_posts/components/EventUtilities/BooleanFilter.md +62 -0
- package/docs/_posts/components/EventUtilities/BooleanSequencer.md +86 -0
- package/docs/_posts/components/EventUtilities/BooleanToggle.md +46 -0
- package/docs/_posts/components/EventUtilities/BooleanTrigger.md +47 -0
- package/docs/_posts/components/EventUtilities/IntegerSequencer.md +90 -0
- package/docs/_posts/components/EventUtilities/IntegerTrigger.md +51 -0
- package/docs/_posts/components/EventUtilities/TimeTrigger.md +47 -0
- package/docs/_posts/components/Followers/ColorChaser.md +77 -0
- package/docs/_posts/components/Followers/ColorDamper.md +85 -0
- package/docs/_posts/components/Followers/CoordinateChaser.md +76 -0
- package/docs/_posts/components/Followers/CoordinateDamper.md +80 -0
- package/docs/_posts/components/Followers/OrientationChaser.md +72 -0
- package/docs/_posts/components/Followers/OrientationDamper.md +80 -0
- package/docs/_posts/components/Followers/PositionChaser.md +72 -0
- package/docs/_posts/components/Followers/PositionChaser2D.md +72 -0
- package/docs/_posts/components/Followers/PositionDamper.md +80 -0
- package/docs/_posts/components/Followers/PositionDamper2D.md +80 -0
- package/docs/_posts/components/Followers/ScalarChaser.md +76 -0
- package/docs/_posts/components/Followers/ScalarDamper.md +80 -0
- package/docs/_posts/components/Followers/TexCoordChaser2D.md +72 -0
- package/docs/_posts/components/Followers/TexCoordDamper2D.md +80 -0
- package/docs/_posts/components/Geometry2D/Arc2D.md +71 -0
- package/docs/_posts/components/Geometry2D/ArcClose2D.md +91 -0
- package/docs/_posts/components/Geometry2D/Circle2D.md +55 -0
- package/docs/_posts/components/Geometry2D/Disk2D.md +75 -0
- package/docs/_posts/components/Geometry2D/Polyline2D.md +54 -0
- package/docs/_posts/components/Geometry2D/Polypoint2D.md +54 -0
- package/docs/_posts/components/Geometry2D/Rectangle2D.md +66 -0
- package/docs/_posts/components/Geometry2D/TriangleSet2D.md +66 -0
- package/docs/_posts/components/Geometry3D/Box.md +66 -0
- package/docs/_posts/components/Geometry3D/Cone.md +90 -0
- package/docs/_posts/components/Geometry3D/Cylinder.md +98 -0
- package/docs/_posts/components/Geometry3D/ElevationGrid.md +162 -0
- package/docs/_posts/components/Geometry3D/Extrusion.md +170 -0
- package/docs/_posts/components/Geometry3D/IndexedFaceSet.md +208 -0
- package/docs/_posts/components/Geometry3D/Sphere.md +66 -0
- package/docs/_posts/components/Geospatial/GeoCoordinate.md +65 -0
- package/docs/_posts/components/Geospatial/GeoElevationGrid.md +180 -0
- package/docs/_posts/components/Geospatial/GeoLOD.md +128 -0
- package/docs/_posts/components/Geospatial/GeoLocation.md +93 -0
- package/docs/_posts/components/Geospatial/GeoMetadata.md +75 -0
- package/docs/_posts/components/Geospatial/GeoOrigin.md +69 -0
- package/docs/_posts/components/Geospatial/GeoPositionInterpolator.md +95 -0
- package/docs/_posts/components/Geospatial/GeoProximitySensor.md +109 -0
- package/docs/_posts/components/Geospatial/GeoTouchSensor.md +108 -0
- package/docs/_posts/components/Geospatial/GeoTransform.md +121 -0
- package/docs/_posts/components/Geospatial/GeoViewpoint.md +126 -0
- package/docs/_posts/components/Grouping/Group.md +75 -0
- package/docs/_posts/components/Grouping/StaticGroup.md +65 -0
- package/docs/_posts/components/Grouping/Switch.md +89 -0
- package/docs/_posts/components/Grouping/Transform.md +126 -0
- package/docs/_posts/components/HAnim/HAnimDisplacer.md +89 -0
- package/docs/_posts/components/HAnim/HAnimHumanoid.md +136 -0
- package/docs/_posts/components/HAnim/HAnimJoint.md +165 -0
- package/docs/_posts/components/HAnim/HAnimMotion.md +68 -0
- package/docs/_posts/components/HAnim/HAnimSegment.md +107 -0
- package/docs/_posts/components/HAnim/HAnimSite.md +108 -0
- package/docs/_posts/components/Interpolation/ColorInterpolator.md +73 -0
- package/docs/_posts/components/Interpolation/CoordinateInterpolator.md +76 -0
- package/docs/_posts/components/Interpolation/CoordinateInterpolator2D.md +73 -0
- package/docs/_posts/components/Interpolation/EaseInEaseOut.md +67 -0
- package/docs/_posts/components/Interpolation/NormalInterpolator.md +68 -0
- package/docs/_posts/components/Interpolation/OrientationInterpolator.md +72 -0
- package/docs/_posts/components/Interpolation/PositionInterpolator.md +72 -0
- package/docs/_posts/components/Interpolation/PositionInterpolator2D.md +77 -0
- package/docs/_posts/components/Interpolation/ScalarInterpolator.md +76 -0
- package/docs/_posts/components/Interpolation/SplinePositionInterpolator.md +93 -0
- package/docs/_posts/components/Interpolation/SplinePositionInterpolator2D.md +93 -0
- package/docs/_posts/components/Interpolation/SplineScalarInterpolator.md +106 -0
- package/docs/_posts/components/Interpolation/SquadOrientationInterpolator.md +78 -0
- package/docs/_posts/components/KeyDeviceSensor/KeySensor.md +78 -0
- package/docs/_posts/components/KeyDeviceSensor/StringSensor.md +70 -0
- package/docs/_posts/components/Layering/Layer.md +67 -0
- package/docs/_posts/components/Layering/LayerSet.md +78 -0
- package/docs/_posts/components/Layering/Viewport.md +80 -0
- package/docs/_posts/components/Layout/Layout.md +107 -0
- package/docs/_posts/components/Layout/LayoutGroup.md +85 -0
- package/docs/_posts/components/Layout/LayoutLayer.md +74 -0
- package/docs/_posts/components/Layout/ScreenFontStyle.md +137 -0
- package/docs/_posts/components/Layout/ScreenGroup.md +71 -0
- package/docs/_posts/components/Lighting/DirectionalLight.md +100 -0
- package/docs/_posts/components/Lighting/EnvironmentLight.md +91 -0
- package/docs/_posts/components/Lighting/PointLight.md +103 -0
- package/docs/_posts/components/Lighting/SpotLight.md +132 -0
- package/docs/_posts/components/NURBS/Contour2D.md +57 -0
- package/docs/_posts/components/NURBS/ContourPolyline2D.md +46 -0
- package/docs/_posts/components/NURBS/CoordinateDouble.md +47 -0
- package/docs/_posts/components/NURBS/NurbsCurve.md +71 -0
- package/docs/_posts/components/NURBS/NurbsCurve2D.md +66 -0
- package/docs/_posts/components/NURBS/NurbsOrientationInterpolator.md +70 -0
- package/docs/_posts/components/NURBS/NurbsPatchSurface.md +106 -0
- package/docs/_posts/components/NURBS/NurbsPositionInterpolator.md +70 -0
- package/docs/_posts/components/NURBS/NurbsSet.md +66 -0
- package/docs/_posts/components/NURBS/NurbsSurfaceInterpolator.md +90 -0
- package/docs/_posts/components/NURBS/NurbsSweptSurface.md +69 -0
- package/docs/_posts/components/NURBS/NurbsSwungSurface.md +65 -0
- package/docs/_posts/components/NURBS/NurbsTextureCoordinate.md +77 -0
- package/docs/_posts/components/NURBS/NurbsTrimmedSurface.md +114 -0
- package/docs/_posts/components/Navigation/Billboard.md +88 -0
- package/docs/_posts/components/Navigation/Collision.md +102 -0
- package/docs/_posts/components/Navigation/LOD.md +99 -0
- package/docs/_posts/components/Navigation/NavigationInfo.md +122 -0
- package/docs/_posts/components/Navigation/OrthoViewpoint.md +117 -0
- package/docs/_posts/components/Navigation/Viewpoint.md +117 -0
- package/docs/_posts/components/Navigation/ViewpointGroup.md +80 -0
- package/docs/_posts/components/Networking/Anchor.md +111 -0
- package/docs/_posts/components/Networking/Inline.md +115 -0
- package/docs/_posts/components/Networking/LoadSensor.md +91 -0
- package/docs/_posts/components/ParticleSystems/BoundedPhysicsModel.md +54 -0
- package/docs/_posts/components/ParticleSystems/ConeEmitter.md +76 -0
- package/docs/_posts/components/ParticleSystems/ExplosionEmitter.md +72 -0
- package/docs/_posts/components/ParticleSystems/ForcePhysicsModel.md +58 -0
- package/docs/_posts/components/ParticleSystems/ParticleSystem.md +177 -0
- package/docs/_posts/components/ParticleSystems/PointEmitter.md +76 -0
- package/docs/_posts/components/ParticleSystems/PolylineEmitter.md +94 -0
- package/docs/_posts/components/ParticleSystems/SurfaceEmitter.md +90 -0
- package/docs/_posts/components/ParticleSystems/VolumeEmitter.md +90 -0
- package/docs/_posts/components/ParticleSystems/WindPhysicsModel.md +68 -0
- package/docs/_posts/components/Picking/LinePickSensor.md +125 -0
- package/docs/_posts/components/Picking/PickableGroup.md +93 -0
- package/docs/_posts/components/Picking/PointPickSensor.md +112 -0
- package/docs/_posts/components/Picking/PrimitivePickSensor.md +114 -0
- package/docs/_posts/components/Picking/VolumePickSensor.md +107 -0
- package/docs/_posts/components/PointingDeviceSensor/CylinderSensor.md +122 -0
- package/docs/_posts/components/PointingDeviceSensor/PlaneSensor.md +114 -0
- package/docs/_posts/components/PointingDeviceSensor/SphereSensor.md +89 -0
- package/docs/_posts/components/PointingDeviceSensor/TouchSensor.md +87 -0
- package/docs/_posts/components/Rendering/ClipPlane.md +67 -0
- package/docs/_posts/components/Rendering/Color.md +56 -0
- package/docs/_posts/components/Rendering/ColorRGBA.md +61 -0
- package/docs/_posts/components/Rendering/Coordinate.md +45 -0
- package/docs/_posts/components/Rendering/IndexedLineSet.md +128 -0
- package/docs/_posts/components/Rendering/IndexedTriangleFanSet.md +128 -0
- package/docs/_posts/components/Rendering/IndexedTriangleSet.md +128 -0
- package/docs/_posts/components/Rendering/IndexedTriangleStripSet.md +116 -0
- package/docs/_posts/components/Rendering/LineSet.md +85 -0
- package/docs/_posts/components/Rendering/Normal.md +41 -0
- package/docs/_posts/components/Rendering/PointSet.md +76 -0
- package/docs/_posts/components/Rendering/TriangleFanSet.md +112 -0
- package/docs/_posts/components/Rendering/TriangleSet.md +108 -0
- package/docs/_posts/components/Rendering/TriangleStripSet.md +116 -0
- package/docs/_posts/components/RigidBodyPhysics/BallJoint.md +78 -0
- package/docs/_posts/components/RigidBodyPhysics/CollidableOffset.md +75 -0
- package/docs/_posts/components/RigidBodyPhysics/CollidableShape.md +83 -0
- package/docs/_posts/components/RigidBodyPhysics/CollisionCollection.md +90 -0
- package/docs/_posts/components/RigidBodyPhysics/CollisionSensor.md +65 -0
- package/docs/_posts/components/RigidBodyPhysics/CollisionSpace.md +70 -0
- package/docs/_posts/components/RigidBodyPhysics/Contact.md +117 -0
- package/docs/_posts/components/RigidBodyPhysics/DoubleAxisHingeJoint.md +162 -0
- package/docs/_posts/components/RigidBodyPhysics/MotorJoint.md +183 -0
- package/docs/_posts/components/RigidBodyPhysics/RigidBody.md +175 -0
- package/docs/_posts/components/RigidBodyPhysics/RigidBodyCollection.md +120 -0
- package/docs/_posts/components/RigidBodyPhysics/SingleAxisHingeJoint.md +108 -0
- package/docs/_posts/components/RigidBodyPhysics/SliderJoint.md +106 -0
- package/docs/_posts/components/RigidBodyPhysics/UniversalJoint.md +119 -0
- package/docs/_posts/components/Scripting/Script.md +81 -0
- package/docs/_posts/components/Shaders/ComposedShader.md +81 -0
- package/docs/_posts/components/Shaders/FloatVertexAttribute.md +65 -0
- package/docs/_posts/components/Shaders/Matrix3VertexAttribute.md +53 -0
- package/docs/_posts/components/Shaders/Matrix4VertexAttribute.md +53 -0
- package/docs/_posts/components/Shaders/PackagedShader.md +77 -0
- package/docs/_posts/components/Shaders/ProgramShader.md +71 -0
- package/docs/_posts/components/Shaders/ShaderPart.md +76 -0
- package/docs/_posts/components/Shaders/ShaderProgram.md +68 -0
- package/docs/_posts/components/Shape/AcousticProperties.md +52 -0
- package/docs/_posts/components/Shape/Appearance.md +123 -0
- package/docs/_posts/components/Shape/FillProperties.md +67 -0
- package/docs/_posts/components/Shape/LineProperties.md +63 -0
- package/docs/_posts/components/Shape/Material.md +217 -0
- package/docs/_posts/components/Shape/PhysicalMaterial.md +173 -0
- package/docs/_posts/components/Shape/PointProperties.md +84 -0
- package/docs/_posts/components/Shape/Shape.md +63 -0
- package/docs/_posts/components/Shape/TwoSidedMaterial.md +149 -0
- package/docs/_posts/components/Shape/UnlitMaterial.md +115 -0
- package/docs/_posts/components/Sound/Analyser.md +72 -0
- package/docs/_posts/components/Sound/AudioClip.md +139 -0
- package/docs/_posts/components/Sound/AudioDestination.md +52 -0
- package/docs/_posts/components/Sound/BiquadFilter.md +70 -0
- package/docs/_posts/components/Sound/BufferAudioSource.md +86 -0
- package/docs/_posts/components/Sound/ChannelMerger.md +46 -0
- package/docs/_posts/components/Sound/ChannelSelector.md +48 -0
- package/docs/_posts/components/Sound/ChannelSplitter.md +48 -0
- package/docs/_posts/components/Sound/Convolver.md +66 -0
- package/docs/_posts/components/Sound/Delay.md +66 -0
- package/docs/_posts/components/Sound/DynamicsCompressor.md +74 -0
- package/docs/_posts/components/Sound/Gain.md +62 -0
- package/docs/_posts/components/Sound/ListenerPointSource.md +62 -0
- package/docs/_posts/components/Sound/MicrophoneSource.md +54 -0
- package/docs/_posts/components/Sound/OscillatorSource.md +58 -0
- package/docs/_posts/components/Sound/PeriodicWave.md +42 -0
- package/docs/_posts/components/Sound/Sound.md +92 -0
- package/docs/_posts/components/Sound/SpatialSound.md +68 -0
- package/docs/_posts/components/Sound/StreamAudioDestination.md +52 -0
- package/docs/_posts/components/Sound/StreamAudioSource.md +54 -0
- package/docs/_posts/components/Sound/WaveShaper.md +66 -0
- package/docs/_posts/components/Text/FontStyle.md +145 -0
- package/docs/_posts/components/Text/Text.md +102 -0
- package/docs/_posts/components/TextureProjector/TextureProjector.md +52 -0
- package/docs/_posts/components/TextureProjector/TextureProjectorParallel.md +52 -0
- package/docs/_posts/components/Texturing/ImageTexture.md +134 -0
- package/docs/_posts/components/Texturing/MovieTexture.md +221 -0
- package/docs/_posts/components/Texturing/MultiTexture.md +100 -0
- package/docs/_posts/components/Texturing/MultiTextureCoordinate.md +47 -0
- package/docs/_posts/components/Texturing/MultiTextureTransform.md +47 -0
- package/docs/_posts/components/Texturing/PixelTexture.md +80 -0
- package/docs/_posts/components/Texturing/TextureCoordinate.md +52 -0
- package/docs/_posts/components/Texturing/TextureCoordinateGenerator.md +64 -0
- package/docs/_posts/components/Texturing/TextureProperties.md +137 -0
- package/docs/_posts/components/Texturing/TextureTransform.md +73 -0
- package/docs/_posts/components/Texturing3D/ComposedTexture3D.md +76 -0
- package/docs/_posts/components/Texturing3D/ImageTexture3D.md +132 -0
- package/docs/_posts/components/Texturing3D/ImageTextureAtlas.md +131 -0
- package/docs/_posts/components/Texturing3D/PixelTexture3D.md +75 -0
- package/docs/_posts/components/Texturing3D/TextureCoordinate3D.md +53 -0
- package/docs/_posts/components/Texturing3D/TextureCoordinate4D.md +52 -0
- package/docs/_posts/components/Texturing3D/TextureTransform3D.md +69 -0
- package/docs/_posts/components/Texturing3D/TextureTransformMatrix3D.md +57 -0
- package/docs/_posts/components/Time/TimeSensor.md +136 -0
- package/docs/_posts/components/VolumeRendering/BlendedVolumeStyle.md +92 -0
- package/docs/_posts/components/VolumeRendering/BoundaryEnhancementVolumeStyle.md +53 -0
- package/docs/_posts/components/VolumeRendering/CartoonVolumeStyle.md +83 -0
- package/docs/_posts/components/VolumeRendering/ComposedVolumeStyle.md +51 -0
- package/docs/_posts/components/VolumeRendering/EdgeEnhancementVolumeStyle.md +67 -0
- package/docs/_posts/components/VolumeRendering/IsoSurfaceVolumeData.md +99 -0
- package/docs/_posts/components/VolumeRendering/OpacityMapVolumeStyle.md +51 -0
- package/docs/_posts/components/VolumeRendering/ProjectionVolumeStyle.md +48 -0
- package/docs/_posts/components/VolumeRendering/SegmentedVolumeData.md +80 -0
- package/docs/_posts/components/VolumeRendering/ShadedVolumeStyle.md +75 -0
- package/docs/_posts/components/VolumeRendering/SilhouetteEnhancementVolumeStyle.md +63 -0
- package/docs/_posts/components/VolumeRendering/ToneMappedVolumeStyle.md +71 -0
- package/docs/_posts/components/VolumeRendering/VolumeData.md +71 -0
- package/docs/_posts/components/X_ITE/BlendMode.md +94 -0
- package/docs/_posts/custom-shaders.md +9 -4
- package/docs/_posts/dom-integration.md +1 -6
- package/docs/_posts/features.md +2 -2
- package/docs/_posts/getting-started.md +100 -57
- package/docs/_posts/glossary.md +1 -1
- package/docs/_posts/how-to-configure-your-web-server.md +1 -1
- package/docs/_posts/reference/browser-services.md +78 -18
- package/docs/_posts/reference/constants-services.md +1 -1
- package/docs/_posts/reference/ecmascript-object-and-function-definitions.md +1 -1
- package/docs/_posts/reference/field-services-and-objects.md +8 -8
- package/docs/_posts/reference/prototype-services.md +7 -7
- package/docs/_posts/reference/route-services.md +1 -1
- package/docs/_posts/reference/scene-services.md +5 -5
- package/docs/_posts/reference/script-node-authoring-interface.md +1 -1
- package/docs/_posts/report-a-bug.md +1 -1
- package/docs/_posts/setup-a-localhost-server.md +5 -1
- package/docs/_posts/supported-nodes.md +239 -238
- package/docs/_posts/tutorials/adding-backgrounds.md +3 -3
- package/docs/_posts/tutorials/adding-fog.md +2 -2
- package/docs/_posts/tutorials/adding-sound.md +19 -19
- package/docs/_posts/tutorials/animating-transforms.md +17 -17
- package/docs/_posts/tutorials/basic-nodes.md +30 -30
- package/docs/_posts/tutorials/building-a-x3d-world.md +3 -3
- package/docs/_posts/tutorials/building-elevation-grids.md +7 -7
- package/docs/_posts/tutorials/building-extruded-shapes.md +7 -7
- package/docs/_posts/tutorials/building-primitive-shapes.md +13 -13
- package/docs/_posts/tutorials/building-shapes-out-of-points-lines-and-faces.md +21 -21
- package/docs/_posts/tutorials/controlling-appearance-with-materials.md +7 -7
- package/docs/_posts/tutorials/controlling-color-on-coordinate-based-geometry.md +11 -11
- package/docs/_posts/tutorials/controlling-detail.md +4 -4
- package/docs/_posts/tutorials/controlling-how-textures-are-mapped.md +7 -7
- package/docs/_posts/tutorials/controlling-navigation.md +3 -3
- package/docs/_posts/tutorials/controlling-shading-on-coordinate-based-geometry.md +13 -13
- package/docs/_posts/tutorials/controlling-the-viewpoint.md +3 -3
- package/docs/_posts/tutorials/creating-new-node-types.md +4 -4
- package/docs/_posts/tutorials/grouping-nodes.md +13 -13
- package/docs/_posts/tutorials/hello-world.md +1 -1
- package/docs/_posts/tutorials/improving-performance.md +1 -1
- package/docs/_posts/tutorials/increasing-rendering-speed.md +1 -1
- package/docs/_posts/tutorials/introducing-animation.md +10 -10
- package/docs/_posts/tutorials/introducing-script-use.md +3 -3
- package/docs/_posts/tutorials/introducing-x3d.md +1 -1
- package/docs/_posts/tutorials/lighting-your-world.md +4 -4
- package/docs/_posts/tutorials/mapping-textures.md +7 -7
- package/docs/_posts/tutorials/naming-nodes.md +1 -1
- package/docs/_posts/tutorials/overview.md +1 -1
- package/docs/_posts/tutorials/providing-information-about-your-world.md +2 -2
- package/docs/_posts/tutorials/sensing-the-viewer.md +15 -15
- package/docs/_posts/tutorials/sensing-viewer-actions.md +10 -10
- package/docs/_posts/tutorials/transforming-shapes.md +4 -4
- package/docs/_posts/tutorials/writing-program-scripts-with-ecmascript.md +5 -5
- package/docs/_posts/what's-new.md +40 -2
- package/docs/_tabs/components.md +383 -0
- package/docs/_tabs/imprint.md +1 -1
- package/docs/_tabs/laboratory.md +38 -6
- package/docs/_tabs/playground.html +22 -66
- package/docs/_tabs/reference.md +2 -1
- package/docs/_tabs/tags.md +1 -1
- package/docs/_tabs/tutorials.md +1 -1
- package/docs/assets/X3D/Michroma-Regular.ttf +0 -0
- package/docs/assets/X3D/peakpx.jpg +0 -0
- package/docs/assets/X3D/teaser.x3d +55 -0
- package/docs/assets/css/style.scss +120 -11
- package/docs/assets/img/laboratory/blend-mode.png +0 -0
- package/docs/assets/img/laboratory/dicom-nrrd.png +0 -0
- package/docs/assets/img/laboratory/earthquake.png +0 -0
- package/docs/assets/img/laboratory/gltf.png +0 -0
- package/docs/assets/img/laboratory/l-system.png +0 -0
- package/docs/assets/js/autoupdate.js +25 -0
- package/docs/laboratory/gltf-sample-viewer.html +318 -0
- package/docs/laboratory/x3d-visual-blend-mode-editor.html +1 -0
- package/package.json +9 -2
- package/src/assets/components/Texturing3D.js +5 -3
- package/src/assets/shaders/Types.glsl.js +5 -5
- package/src/assets/shaders/webgl1/PBR.fs.js +1 -1
- package/src/assets/shaders/webgl1/include/Colors.glsl.js +5 -7
- package/src/assets/shaders/webgl1/include/Fragment.glsl.js +4 -0
- package/src/assets/shaders/webgl1/include/Hatch.glsl.js +1 -1
- package/src/assets/shaders/webgl1/include/Texture.glsl.js +3 -3
- package/src/assets/shaders/webgl2/include/Colors.glsl.js +5 -7
- package/src/assets/shaders/webgl2/include/Hatch.glsl.js +1 -1
- package/src/assets/shaders/webgl2/include/Particle.glsl.js +2 -2
- package/src/assets/shaders/webgl2/include/Texture.glsl.js +2 -2
- package/src/bookmarks.js +12 -8
- package/src/examples.js +3 -0
- package/src/lib/jquery.js +20 -0
- package/src/lib/libgif/libgif.js +1004 -0
- package/src/lib/libtess.js +1 -0
- package/src/lib/nurbs/extras/sample.js +5 -7
- package/src/standard/Math/Algorithms/Bezier.js +175 -33
- package/src/standard/Math/Geometry/Box2.js +15 -55
- package/src/standard/Math/Geometry/Box3.js +19 -66
- package/src/standard/Math/Geometry/Triangle3.js +14 -79
- package/src/standard/Math/Numbers/Color3.js +4 -0
- package/src/standard/Math/Numbers/Color4.js +4 -0
- package/src/standard/Math/Numbers/Matrix3.js +11 -3
- package/src/standard/Math/Numbers/Matrix4.js +9 -6
- package/src/standard/Math/Numbers/Rotation4.js +72 -65
- package/src/tests.js +3 -0
- package/src/x_ite/Base/X3DArrayField.js +0 -2
- package/src/x_ite/Base/X3DInfoArray.js +2 -2
- package/src/x_ite/Base/X3DObjectArrayField.js +19 -0
- package/src/x_ite/Base/X3DTypedArrayField.js +149 -0
- package/src/x_ite/Browser/Core/BrowserOptions.js +108 -64
- package/src/x_ite/Browser/Core/Context.js +1 -1
- package/src/x_ite/Browser/Core/ContextMenu.js +2 -2
- package/src/x_ite/Browser/Core/Notification.js +1 -1
- package/src/x_ite/Browser/Core/RenderingProperties.js +4 -0
- package/src/x_ite/Browser/Core/X3DCoreContext.js +99 -54
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +4 -14
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +3 -13
- package/src/x_ite/Browser/Navigation/PlaneViewer.js +3 -12
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +25 -22
- package/src/x_ite/Browser/Navigation/X3DViewer.js +12 -3
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +2 -2
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +19 -15
- package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +30 -10
- package/src/x_ite/Browser/Shaders/X3DShadersContext.js +1 -1
- package/src/x_ite/Browser/Shape/X3DShapeContext.js +30 -3
- package/src/x_ite/Browser/Text/PolygonText.js +137 -134
- package/src/x_ite/Browser/Texturing/GifMedia.js +113 -0
- package/src/x_ite/Browser/Texturing3D/DICOMParser.js +1 -6
- package/src/x_ite/Browser/Texturing3D/NRRDParser.js +81 -310
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +162 -122
- package/src/x_ite/Browser/X3DBrowserContext.js +7 -5
- package/src/x_ite/Components/Core/WorldInfo.js +3 -3
- package/src/x_ite/Components/Core/X3DNode.js +7 -7
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +1 -1
- package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +2 -3
- package/src/x_ite/Components/Geometry3D/Extrusion.js +27 -23
- package/src/x_ite/Components/Geometry3D/IndexedFaceSet.js +10 -19
- package/src/x_ite/Components/Grouping/X3DBoundedObject.js +1 -3
- package/src/x_ite/Components/HAnim/HAnimHumanoid.js +39 -15
- package/src/x_ite/Components/HAnim/HAnimJoint.js +6 -9
- package/src/x_ite/Components/Layering/X3DLayerNode.js +21 -2
- package/src/x_ite/Components/Layout/Layout.js +4 -2
- package/src/x_ite/Components/Layout/ScreenFontStyle.js +6 -0
- package/src/x_ite/Components/Lighting/DirectionalLight.js +4 -11
- package/src/x_ite/Components/Lighting/EnvironmentLight.js +1 -1
- package/src/x_ite/Components/Lighting/PointLight.js +4 -11
- package/src/x_ite/Components/Lighting/SpotLight.js +4 -11
- package/src/x_ite/Components/Lighting/X3DLightNode.js +7 -9
- package/src/x_ite/Components/Navigation/OrthoViewpoint.js +2 -2
- package/src/x_ite/Components/Navigation/X3DViewpointNode.js +14 -6
- package/src/x_ite/Components/Networking/Inline.js +48 -59
- package/src/x_ite/Components/Networking/X3DUrlObject.js +1 -1
- package/src/x_ite/Components/PointingDeviceSensor/CylinderSensor.js +2 -2
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +7 -13
- package/src/x_ite/Components/Rendering/X3DPointGeometryNode.js +4 -2
- package/src/x_ite/Components/RigidBodyPhysics/RigidBody.js +4 -2
- package/src/x_ite/Components/Scripting/Script.js +2 -2
- package/src/x_ite/Components/Shaders/ShaderPart.js +1 -1
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +1 -3
- package/src/x_ite/Components/Shape/Appearance.js +27 -1
- package/src/x_ite/Components/Shape/FillProperties.js +1 -0
- package/src/x_ite/Components/Shape/LineProperties.js +15 -9
- package/src/x_ite/Components/Shape/Material.js +33 -22
- package/src/x_ite/Components/Shape/PhysicalMaterial.js +22 -15
- package/src/x_ite/Components/Shape/PointProperties.js +23 -7
- package/src/x_ite/Components/Shape/UnlitMaterial.js +3 -2
- package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +25 -19
- package/src/x_ite/Components/Sound/AudioClip.js +5 -5
- package/src/x_ite/Components/Sound/X3DSoundSourceNode.js +26 -34
- package/src/x_ite/Components/Text/X3DFontStyleNode.js +1 -1
- package/src/x_ite/Components/TextureProjector/TextureProjector.js +4 -12
- package/src/x_ite/Components/TextureProjector/TextureProjectorParallel.js +6 -14
- package/src/x_ite/Components/TextureProjector/X3DTextureProjectorNode.js +7 -7
- package/src/x_ite/Components/Texturing/ImageTexture.js +15 -10
- package/src/x_ite/Components/Texturing/MovieTexture.js +51 -11
- package/src/x_ite/Components/Texturing3D/ImageTexture3D.js +2 -2
- package/src/x_ite/Components/Texturing3D/ImageTextureAtlas.js +230 -0
- package/src/x_ite/Components/Time/X3DTimeDependentNode.js +12 -10
- package/src/x_ite/Execution/BindableList.js +35 -37
- package/src/x_ite/Execution/BindableStack.js +25 -7
- package/src/x_ite/Execution/X3DScene.js +2 -2
- package/src/x_ite/Execution/X3DWorld.js +1 -1
- package/src/x_ite/Fields/SFRotation.js +2 -1
- package/src/x_ite/Fields/SFString.js +1 -1
- package/src/x_ite/InputOutput/FileLoader.js +105 -236
- package/src/x_ite/InputOutput/Generator.js +12 -8
- package/src/x_ite/Parser/Expressions.js +85 -0
- package/src/x_ite/Parser/GLB2Parser.js +147 -0
- package/src/x_ite/Parser/GLTF2Parser.js +2221 -0
- package/src/x_ite/Parser/GoldenGate.js +64 -13
- package/src/x_ite/Parser/JSONParser.js +7 -36
- package/src/x_ite/Parser/OBJParser.js +1076 -0
- package/src/x_ite/Parser/STLAParser.js +376 -0
- package/src/x_ite/Parser/STLBParser.js +156 -0
- package/src/x_ite/Parser/SVGParser.js +2476 -0
- package/src/x_ite/Parser/VRMLParser.js +127 -183
- package/src/x_ite/Parser/X3DOptimizer.js +191 -0
- package/src/x_ite/Parser/X3DParser.js +34 -0
- package/src/x_ite/Parser/XMLParser.js +11 -109
- package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +2 -2
- package/src/x_ite/Prototype/X3DProtoDeclaration.js +3 -3
- package/src/x_ite/Rendering/DependentRenderer.js +1 -1
- package/src/x_ite/Rendering/MultiSampleFrameBuffer.js +150 -0
- package/src/x_ite/Rendering/TextureBuffer.js +3 -5
- package/src/x_ite/Rendering/X3DRenderObject.js +2 -7
- package/src/x_ite/X3D.js +1 -0
- package/src/x_ite/X3DCanvas.js +10 -0
- package/src/x_ite.html +39 -17
- package/webpack.config.js +1 -0
- package/x_ite.min.html +38 -17
- package/src/standard/Networking/BinaryTransport.js +0 -116
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default libtess;
|
|
@@ -188,13 +188,13 @@ export default function (mesh, surface, opts)
|
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
var
|
|
191
|
-
|
|
191
|
+
contours = [ ],
|
|
192
192
|
triangles = [ ],
|
|
193
193
|
trimmed = [ ];
|
|
194
194
|
|
|
195
195
|
for (var v = 0, fLength = faces .length; v < fLength; v += 3)
|
|
196
196
|
{
|
|
197
|
-
|
|
197
|
+
contours .length = 0;
|
|
198
198
|
triangles .length = 0;
|
|
199
199
|
|
|
200
200
|
var
|
|
@@ -211,11 +211,9 @@ export default function (mesh, surface, opts)
|
|
|
211
211
|
vertex2 .index = v + 1;
|
|
212
212
|
vertex3 .index = v + 2;
|
|
213
213
|
|
|
214
|
-
|
|
215
|
-
curves .push .apply (curves, holes);
|
|
216
|
-
curves .push (triangles);
|
|
214
|
+
contours .push ([ vertex1, vertex2, vertex3 ], ... holes);
|
|
217
215
|
|
|
218
|
-
Triangle3 .triangulatePolygon
|
|
216
|
+
Triangle3 .triangulatePolygon (contours, triangles);
|
|
219
217
|
|
|
220
218
|
for (var t = 0, tLength = triangles .length; t < tLength; ++ t)
|
|
221
219
|
trimmed .push (triangles [t] .index);
|
|
@@ -228,7 +226,7 @@ export default function (mesh, surface, opts)
|
|
|
228
226
|
break;
|
|
229
227
|
}
|
|
230
228
|
default:
|
|
231
|
-
throw new Error("Can only sample
|
|
229
|
+
throw new Error("Can only sample contours and surfaces");
|
|
232
230
|
}
|
|
233
231
|
|
|
234
232
|
return mesh;
|
|
@@ -46,61 +46,203 @@
|
|
|
46
46
|
******************************************************************************/
|
|
47
47
|
|
|
48
48
|
import Algorithm from "../Algorithm.js";
|
|
49
|
+
import Vector2 from "../Numbers/Vector2.js";
|
|
49
50
|
|
|
50
51
|
const lerp = Algorithm .lerp;
|
|
51
52
|
|
|
52
|
-
function Bezier (x0, y0, x1, y1, x2, y2, x3, y3)
|
|
53
|
+
function Bezier (/*x0, y0, x1, y1, x2, y2, x3, y3*/)
|
|
53
54
|
{
|
|
54
|
-
this .
|
|
55
|
-
this .y0 = y0;
|
|
56
|
-
this .x1 = x1;
|
|
57
|
-
this .y1 = y1;
|
|
58
|
-
this .x2 = x2;
|
|
59
|
-
this .y2 = y2;
|
|
60
|
-
this .x3 = x3;
|
|
61
|
-
this .y3 = y3;
|
|
62
|
-
|
|
63
|
-
this .order = arguments .length / 2 - 1;
|
|
55
|
+
this .args = arguments;
|
|
64
56
|
}
|
|
65
57
|
|
|
66
58
|
Bezier .prototype =
|
|
67
59
|
{
|
|
68
|
-
|
|
60
|
+
getPoints: function (type, steps)
|
|
69
61
|
{
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
x1 = this .x1,
|
|
74
|
-
y1 = this .y1,
|
|
75
|
-
x2 = this .x2,
|
|
76
|
-
y2 = this .y2,
|
|
77
|
-
x3 = this .x3,
|
|
78
|
-
y3 = this .y3,
|
|
79
|
-
lut = [ ];
|
|
80
|
-
|
|
81
|
-
switch (this .order)
|
|
62
|
+
const points = [ ];
|
|
63
|
+
|
|
64
|
+
switch (type)
|
|
82
65
|
{
|
|
83
|
-
case
|
|
66
|
+
case "quadric":
|
|
67
|
+
{
|
|
68
|
+
const
|
|
69
|
+
x0 = this .args [0],
|
|
70
|
+
y0 = this .args [1],
|
|
71
|
+
x1 = this .args [2],
|
|
72
|
+
y1 = this .args [3],
|
|
73
|
+
x2 = this .args [4],
|
|
74
|
+
y2 = this .args [5];
|
|
75
|
+
|
|
76
|
+
for (let i = 0, d = steps - 1; i < steps; ++ i)
|
|
77
|
+
{
|
|
78
|
+
points .push (quadric (x0, y0, x1, y1, x2, y2, i / d));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
case "cubic":
|
|
84
84
|
{
|
|
85
|
-
|
|
85
|
+
const
|
|
86
|
+
x0 = this .args [0],
|
|
87
|
+
y0 = this .args [1],
|
|
88
|
+
x1 = this .args [2],
|
|
89
|
+
y1 = this .args [3],
|
|
90
|
+
x2 = this .args [4],
|
|
91
|
+
y2 = this .args [5],
|
|
92
|
+
x3 = this .args [6],
|
|
93
|
+
y3 = this .args [7];
|
|
94
|
+
|
|
95
|
+
for (let i = 0, d = steps - 1; i < steps; ++ i)
|
|
86
96
|
{
|
|
87
|
-
|
|
97
|
+
points .push (cubic (x0, y0, x1, y1, x2, y2, x3, y3, i / d));
|
|
88
98
|
}
|
|
89
99
|
|
|
90
100
|
break;
|
|
91
101
|
}
|
|
92
|
-
case
|
|
102
|
+
case "arc":
|
|
93
103
|
{
|
|
94
|
-
|
|
104
|
+
let
|
|
105
|
+
ax = this .args [0],
|
|
106
|
+
ay = this .args [1],
|
|
107
|
+
rx = this .args [2],
|
|
108
|
+
ry = this .args [3],
|
|
109
|
+
xAxisRotation = this .args [4],
|
|
110
|
+
largeArcFlag = this .args [5],
|
|
111
|
+
sweepFlag = this .args [6],
|
|
112
|
+
x = this .args [7],
|
|
113
|
+
y = this .args [8];
|
|
114
|
+
|
|
115
|
+
// https://ericeastwood.com/blog/25/curves-and-arcs-quadratic-cubic-elliptical-svg-implementations
|
|
116
|
+
// See https://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes.
|
|
117
|
+
|
|
118
|
+
// If the endpoints are identical, then this is equivalent to omitting the elliptical arc segment entirely.
|
|
119
|
+
if (ax === x && ay === y)
|
|
95
120
|
{
|
|
96
|
-
|
|
121
|
+
points .push (new Vector2 (x, y));
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// In accordance to: http://www.w3.org/TR/SVG/implnote.html#ArcOutOfRangeParameters
|
|
126
|
+
|
|
127
|
+
rx = Math .abs (rx);
|
|
128
|
+
ry = Math .abs (ry);
|
|
129
|
+
|
|
130
|
+
// If rx = 0 or ry = 0 then this arc is treated as a straight line segment joining the endpoints.
|
|
131
|
+
if (rx === 0 || ry === 0)
|
|
132
|
+
{
|
|
133
|
+
points .push (new Vector2 (ax, ay), new Vector2 (x, y));
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const
|
|
138
|
+
rx2 = rx * rx,
|
|
139
|
+
ry2 = ry * ry;
|
|
140
|
+
|
|
141
|
+
// In accordance to: http://www.w3.org/TR/SVG/implnote.html#ArcOutOfRangeParameters
|
|
142
|
+
|
|
143
|
+
xAxisRotation = Algorithm .interval (xAxisRotation, 0, 2 * Math .PI);
|
|
144
|
+
|
|
145
|
+
const
|
|
146
|
+
sinRotation = Math .sin (xAxisRotation),
|
|
147
|
+
cosRotation = Math .cos (xAxisRotation);
|
|
148
|
+
|
|
149
|
+
// Following "Conversion from endpoint to center parameterization"
|
|
150
|
+
// http://www.w3.org/TR/SVG/implnote.html#ArcConversionEndpointToCenter
|
|
151
|
+
|
|
152
|
+
// Step #1: Compute transformedPoint
|
|
153
|
+
const d = new Vector2 (ax - x, ay - y) .divide (2);
|
|
154
|
+
|
|
155
|
+
const transformedPoint = new Vector2 ( cosRotation * d .x + sinRotation * d .y,
|
|
156
|
+
-sinRotation * d .x + cosRotation * d .y);
|
|
157
|
+
|
|
158
|
+
const transformedPoint2 = transformedPoint .copy () .multVec (transformedPoint);
|
|
159
|
+
|
|
160
|
+
// Ensure radii are large enough
|
|
161
|
+
const radiiCheck = transformedPoint2 .x / rx2 + transformedPoint2 .y / ry2;
|
|
162
|
+
|
|
163
|
+
if (radiiCheck > 1)
|
|
164
|
+
{
|
|
165
|
+
rx = Math .sqrt (radiiCheck) * rx;
|
|
166
|
+
ry = Math .sqrt (radiiCheck) * ry;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Step #2: Compute transformedCenter
|
|
170
|
+
const cSquareNumerator = rx2 * ry2 - rx2 * transformedPoint2 .y - ry2 * transformedPoint2 .x;
|
|
171
|
+
const cSquareRootDenom = rx2 * transformedPoint2 .y + ry2 * transformedPoint2 .x;
|
|
172
|
+
let cRadicand = cSquareNumerator / cSquareRootDenom;
|
|
173
|
+
|
|
174
|
+
// Make sure this never drops below zero because of precision
|
|
175
|
+
cRadicand = Math .max (0, cRadicand);
|
|
176
|
+
|
|
177
|
+
const cCoef = (largeArcFlag !== sweepFlag ? 1 : -1) * Math .sqrt (cRadicand);
|
|
178
|
+
|
|
179
|
+
const transformedCenter = new Vector2 ( cCoef * rx * transformedPoint .y / ry,
|
|
180
|
+
-cCoef * ry * transformedPoint .x / rx);
|
|
181
|
+
|
|
182
|
+
// Step #3: Compute center
|
|
183
|
+
const center = new Vector2 (cosRotation * transformedCenter .x - sinRotation * transformedCenter .y + ((ax + x) / 2),
|
|
184
|
+
sinRotation * transformedCenter .x + cosRotation * transformedCenter .y + ((ay + y) / 2));
|
|
185
|
+
|
|
186
|
+
// Step #4: Compute start/sweep angles
|
|
187
|
+
const startVector = new Vector2 ((transformedPoint .x - transformedCenter .x) / rx,
|
|
188
|
+
(transformedPoint .y - transformedCenter .y) / ry);
|
|
189
|
+
|
|
190
|
+
const endVector = new Vector2 ((-transformedPoint .x - transformedCenter .x) / rx,
|
|
191
|
+
(-transformedPoint .y - transformedCenter .y) / ry);
|
|
192
|
+
|
|
193
|
+
const get_angle = (x) => { return x > 0 ? x : 2 * Math .PI + x; }; // transform angle to range [0, 2pi]
|
|
194
|
+
const startAngle = get_angle (Math .atan2 (startVector .y, startVector .x));
|
|
195
|
+
const endAngle = get_angle (Math .atan2 (endVector .y, endVector .x));
|
|
196
|
+
|
|
197
|
+
let sweepAngle = endAngle - startAngle;
|
|
198
|
+
|
|
199
|
+
if (largeArcFlag)
|
|
200
|
+
{
|
|
201
|
+
// sweepAngle must be positive
|
|
202
|
+
if (sweepAngle < 0)
|
|
203
|
+
sweepAngle += 2 * Math .PI;
|
|
204
|
+
}
|
|
205
|
+
else
|
|
206
|
+
{
|
|
207
|
+
// sweepAngle must be negative
|
|
208
|
+
if (sweepAngle > 0)
|
|
209
|
+
sweepAngle -= 2 * Math .PI;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if (sweepFlag && sweepAngle < 0)
|
|
213
|
+
sweepAngle += 2 *Math .PI;
|
|
214
|
+
|
|
215
|
+
else if (!sweepFlag && sweepAngle > 0)
|
|
216
|
+
sweepAngle -= 2 * Math .PI;
|
|
217
|
+
|
|
218
|
+
// Interpolate:
|
|
219
|
+
|
|
220
|
+
const bezier_steps = Math .max (4, Math .abs (sweepAngle) * steps / (2 * Math .PI));
|
|
221
|
+
const bezier_steps_1 = bezier_steps - 1;
|
|
222
|
+
|
|
223
|
+
points .push (new Vector2 (ax, ay));
|
|
224
|
+
|
|
225
|
+
for (let i = 1; i < bezier_steps_1; ++ i)
|
|
226
|
+
{
|
|
227
|
+
const t = i / bezier_steps_1;
|
|
228
|
+
|
|
229
|
+
// From http://www.w3.org/TR/SVG/implnote.html#ArcParameterizationAlternatives
|
|
230
|
+
const angle = startAngle + (sweepAngle * t);
|
|
231
|
+
const x = rx * Math .cos (angle);
|
|
232
|
+
const y = ry * Math .sin (angle);
|
|
233
|
+
|
|
234
|
+
const point = new Vector2 (cosRotation * x - sinRotation * y + center .x,
|
|
235
|
+
sinRotation * x + cosRotation * y + center .y);
|
|
236
|
+
|
|
237
|
+
points .push (point);
|
|
97
238
|
}
|
|
98
239
|
|
|
240
|
+
points .push (new Vector2 (x, y));
|
|
99
241
|
break;
|
|
100
242
|
}
|
|
101
243
|
}
|
|
102
244
|
|
|
103
|
-
return
|
|
245
|
+
return points;
|
|
104
246
|
}
|
|
105
247
|
};
|
|
106
248
|
|
|
@@ -114,7 +256,7 @@ function quadric (x0, y0, x1, y1, x2, y2, t)
|
|
|
114
256
|
bx0 = lerp (ax0, ax1, t),
|
|
115
257
|
by0 = lerp (ay0, ay1, t);
|
|
116
258
|
|
|
117
|
-
return
|
|
259
|
+
return new Vector2 (bx0, by0);
|
|
118
260
|
}
|
|
119
261
|
|
|
120
262
|
function cubic (x0, y0, x1, y1, x2, y2, x3, y3, t)
|
|
@@ -133,7 +275,7 @@ function cubic (x0, y0, x1, y1, x2, y2, x3, y3, t)
|
|
|
133
275
|
cx0 = lerp (bx0, bx1, t),
|
|
134
276
|
cy0 = lerp (by0, by1, t);
|
|
135
277
|
|
|
136
|
-
return
|
|
278
|
+
return new Vector2 (cx0, cy0);
|
|
137
279
|
}
|
|
138
280
|
|
|
139
281
|
export default Bezier;
|
|
@@ -50,38 +50,9 @@ import Vector2 from "../Numbers/Vector2.js";
|
|
|
50
50
|
|
|
51
51
|
function Box2 (size, center)
|
|
52
52
|
{
|
|
53
|
-
|
|
54
|
-
{
|
|
55
|
-
case 0:
|
|
56
|
-
{
|
|
57
|
-
this .matrix = new Matrix3 (0, 0, 0,
|
|
58
|
-
0, 0, 0,
|
|
59
|
-
0, 0, 0);
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
case 2:
|
|
63
|
-
{
|
|
64
|
-
this .matrix = new Matrix3 (size .x / 2, 0, 0,
|
|
65
|
-
0, size .y / 2, 0,
|
|
66
|
-
center .x, center .y, 1);
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
case 3:
|
|
70
|
-
{
|
|
71
|
-
const
|
|
72
|
-
min = arguments [0],
|
|
73
|
-
max = arguments [1],
|
|
74
|
-
sx = (max .x - min .x) / 2,
|
|
75
|
-
sy = (max .y - min .y) / 2,
|
|
76
|
-
cx = (max .x + min .x) / 2,
|
|
77
|
-
cy = (max .y + min .y) / 2;
|
|
53
|
+
this .matrix = new Matrix3 ();
|
|
78
54
|
|
|
79
|
-
|
|
80
|
-
0, sy, 0,
|
|
81
|
-
cx, cy, 1);
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
55
|
+
this .set (... arguments);
|
|
85
56
|
}
|
|
86
57
|
|
|
87
58
|
Box2 .prototype =
|
|
@@ -104,39 +75,27 @@ Box2 .prototype =
|
|
|
104
75
|
},
|
|
105
76
|
set: function (size, center)
|
|
106
77
|
{
|
|
107
|
-
const m = this .matrix;
|
|
108
|
-
|
|
109
78
|
switch (arguments .length)
|
|
110
79
|
{
|
|
111
80
|
case 0:
|
|
112
81
|
{
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
82
|
+
this .matrix .set (0, 0, 0,
|
|
83
|
+
0, 0, 0,
|
|
84
|
+
0, 0, 0);
|
|
85
|
+
|
|
116
86
|
return this;
|
|
117
87
|
}
|
|
118
88
|
case 2:
|
|
119
89
|
{
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
90
|
+
this .matrix .set (size .x / 2, 0, 0,
|
|
91
|
+
0, size .y / 2, 0,
|
|
92
|
+
center .x, center .y, 1);
|
|
93
|
+
|
|
124
94
|
return this;
|
|
125
95
|
}
|
|
126
96
|
case 3:
|
|
127
97
|
{
|
|
128
|
-
|
|
129
|
-
min = arguments [0],
|
|
130
|
-
max = arguments [1],
|
|
131
|
-
sx = (max .x - min .x) / 2,
|
|
132
|
-
sy = (max .y - min .y) / 2,
|
|
133
|
-
cx = (max .x + min .x) / 2,
|
|
134
|
-
cy = (max .y + min .y) / 2;
|
|
135
|
-
|
|
136
|
-
this .matrix .set (sx, 0, 0,
|
|
137
|
-
0, sy, 0,
|
|
138
|
-
cx, cy, 1);
|
|
139
|
-
return this;
|
|
98
|
+
return this .setExtents (arguments [0], arguments [1]);
|
|
140
99
|
}
|
|
141
100
|
}
|
|
142
101
|
},
|
|
@@ -149,9 +108,10 @@ Box2 .prototype =
|
|
|
149
108
|
cx = (max .x + min .x) / 2,
|
|
150
109
|
cy = (max .y + min .y) / 2;
|
|
151
110
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
111
|
+
this .matrix .set (sx, 0, 0,
|
|
112
|
+
0, sy, 0,
|
|
113
|
+
cx, cy, 1);
|
|
114
|
+
|
|
155
115
|
return this;
|
|
156
116
|
},
|
|
157
117
|
isEmpty: function ()
|
|
@@ -52,43 +52,9 @@ import SAT from "../Algorithms/SAT.js";
|
|
|
52
52
|
|
|
53
53
|
function Box3 (size, center)
|
|
54
54
|
{
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
{
|
|
59
|
-
this .matrix = new Matrix4 (0, 0, 0, 0,
|
|
60
|
-
0, 0, 0, 0,
|
|
61
|
-
0, 0, 0, 0,
|
|
62
|
-
0, 0, 0, 0);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
case 2:
|
|
66
|
-
{
|
|
67
|
-
this .matrix = new Matrix4 (size .x / 2, 0, 0, 0,
|
|
68
|
-
0, size .y / 2, 0, 0,
|
|
69
|
-
0, 0, size .z / 2, 0,
|
|
70
|
-
center .x, center .y, center .z, 1);
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
case 3:
|
|
74
|
-
{
|
|
75
|
-
const
|
|
76
|
-
min = arguments [0],
|
|
77
|
-
max = arguments [1],
|
|
78
|
-
sx = (max .x - min .x) / 2,
|
|
79
|
-
sy = (max .y - min .y) / 2,
|
|
80
|
-
sz = (max .z - min .z) / 2,
|
|
81
|
-
cx = (max .x + min .x) / 2,
|
|
82
|
-
cy = (max .y + min .y) / 2,
|
|
83
|
-
cz = (max .z + min .z) / 2;
|
|
84
|
-
|
|
85
|
-
this .matrix = new Matrix4 (sx, 0, 0, 0,
|
|
86
|
-
0, sy, 0, 0,
|
|
87
|
-
0, 0, sz, 0,
|
|
88
|
-
cx, cy, cz, 1);
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
55
|
+
this .matrix = new Matrix4 ();
|
|
56
|
+
|
|
57
|
+
this .set (... arguments);
|
|
92
58
|
}
|
|
93
59
|
|
|
94
60
|
Box3 .prototype =
|
|
@@ -115,43 +81,29 @@ Box3 .prototype =
|
|
|
115
81
|
},
|
|
116
82
|
set: function (size, center)
|
|
117
83
|
{
|
|
118
|
-
const m = this .matrix;
|
|
119
|
-
|
|
120
84
|
switch (arguments .length)
|
|
121
85
|
{
|
|
122
86
|
case 0:
|
|
123
87
|
{
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
88
|
+
this .matrix .set (0, 0, 0, 0,
|
|
89
|
+
0, 0, 0, 0,
|
|
90
|
+
0, 0, 0, 0,
|
|
91
|
+
0, 0, 0, 0);
|
|
92
|
+
|
|
128
93
|
return this;
|
|
129
94
|
}
|
|
130
95
|
case 2:
|
|
131
96
|
{
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
97
|
+
this .matrix .set (size .x / 2, 0, 0, 0,
|
|
98
|
+
0, size .y / 2, 0, 0,
|
|
99
|
+
0, 0, size .z / 2, 0,
|
|
100
|
+
center .x, center .y, center .z, 1);
|
|
101
|
+
|
|
136
102
|
return this;
|
|
137
103
|
}
|
|
138
104
|
case 3:
|
|
139
105
|
{
|
|
140
|
-
|
|
141
|
-
min = arguments [0],
|
|
142
|
-
max = arguments [1],
|
|
143
|
-
sx = (max .x - min .x) / 2,
|
|
144
|
-
sy = (max .y - min .y) / 2,
|
|
145
|
-
sz = (max .z - min .z) / 2,
|
|
146
|
-
cx = (max .x + min .x) / 2,
|
|
147
|
-
cy = (max .y + min .y) / 2,
|
|
148
|
-
cz = (max .z + min .z) / 2;
|
|
149
|
-
|
|
150
|
-
this .matrix .set (sx, 0, 0, 0,
|
|
151
|
-
0, sy, 0, 0,
|
|
152
|
-
0, 0, sz, 0,
|
|
153
|
-
cx, cy, cz, 1);
|
|
154
|
-
return this;
|
|
106
|
+
return this .setExtents (arguments [0], arguments [1]);
|
|
155
107
|
}
|
|
156
108
|
}
|
|
157
109
|
},
|
|
@@ -166,10 +118,11 @@ Box3 .prototype =
|
|
|
166
118
|
cy = (max .y + min .y) / 2,
|
|
167
119
|
cz = (max .z + min .z) / 2;
|
|
168
120
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
121
|
+
this .matrix .set (sx, 0, 0, 0,
|
|
122
|
+
0, sy, 0, 0,
|
|
123
|
+
0, 0, sz, 0,
|
|
124
|
+
cx, cy, cz, 1);
|
|
125
|
+
|
|
173
126
|
return this;
|
|
174
127
|
},
|
|
175
128
|
getExtents: function (min, max)
|
|
@@ -93,73 +93,30 @@ const Triangle3 = {
|
|
|
93
93
|
},
|
|
94
94
|
triangulatePolygon: (function ()
|
|
95
95
|
{
|
|
96
|
-
|
|
97
|
-
{
|
|
98
|
-
// Function called for each vertex of tesselator output.
|
|
99
|
-
function vertexCallback (data, polyVertArray)
|
|
100
|
-
{
|
|
101
|
-
//console .log (data);
|
|
102
|
-
polyVertArray [polyVertArray .length] = data;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function beginCallback (type)
|
|
106
|
-
{
|
|
107
|
-
if (type !== libtess .primitiveType .GL_TRIANGLES)
|
|
108
|
-
console .log ('expected TRIANGLES but got type: ' + type);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function errorCallback (errno)
|
|
112
|
-
{
|
|
113
|
-
console .log ('error callback');
|
|
114
|
-
console .log ('error number: ' + errno);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// Callback for when segments intersect and must be split.
|
|
118
|
-
function combineCallback (coords, data, weight)
|
|
119
|
-
{
|
|
120
|
-
//console.log ('combine callback');
|
|
121
|
-
return data [0];
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
function edgeCallback (flag)
|
|
125
|
-
{
|
|
126
|
-
// Don't really care about the flag, but need no-strip/no-fan behavior.
|
|
127
|
-
// console .log ('edge flag: ' + flag);
|
|
128
|
-
}
|
|
96
|
+
// Function called for each vertex of tesselator output.
|
|
129
97
|
|
|
130
|
-
|
|
98
|
+
function vertexCallback (index, triangles)
|
|
99
|
+
{
|
|
100
|
+
triangles .push (index);
|
|
101
|
+
}
|
|
131
102
|
|
|
132
|
-
|
|
133
|
-
tessy .gluTessCallback (libtess .gluEnum .GLU_TESS_BEGIN, beginCallback);
|
|
134
|
-
tessy .gluTessCallback (libtess .gluEnum .GLU_TESS_ERROR, errorCallback);
|
|
135
|
-
tessy .gluTessCallback (libtess .gluEnum .GLU_TESS_COMBINE, combineCallback);
|
|
136
|
-
tessy .gluTessCallback (libtess .gluEnum .GLU_TESS_EDGE_FLAG, edgeCallback);
|
|
137
|
-
tessy .gluTessProperty (libtess .gluEnum .GLU_TESS_TOLERANCE, 0);
|
|
138
|
-
tessy .gluTessProperty (libtess .gluEnum .GLU_TESS_WINDING_RULE, libtess .windingRule .GLU_TESS_WINDING_ODD);
|
|
103
|
+
const tessy = new libtess .GluTesselator ();
|
|
139
104
|
|
|
140
|
-
|
|
141
|
-
|
|
105
|
+
tessy .gluTessCallback (libtess .gluEnum .GLU_TESS_VERTEX_DATA, vertexCallback);
|
|
106
|
+
tessy .gluTessProperty (libtess .gluEnum .GLU_TESS_WINDING_RULE, libtess .windingRule .GLU_TESS_WINDING_ODD);
|
|
142
107
|
|
|
143
|
-
return function (
|
|
108
|
+
return function (polygon, triangles)
|
|
144
109
|
{
|
|
145
|
-
const triangles = arguments [arguments .length - 1];
|
|
146
|
-
|
|
147
110
|
tessy .gluTessBeginPolygon (triangles);
|
|
111
|
+
tessy .gluTessBeginContour ();
|
|
148
112
|
|
|
149
|
-
for (
|
|
150
|
-
|
|
151
|
-
tessy .gluTessBeginContour ();
|
|
152
|
-
|
|
153
|
-
for (const contour of arguments [i])
|
|
154
|
-
{
|
|
155
|
-
tessy .gluTessVertex (contour, contour);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
tessy .gluTessEndContour ();
|
|
159
|
-
}
|
|
113
|
+
for (const point of polygon)
|
|
114
|
+
tessy .gluTessVertex (point, point .index);
|
|
160
115
|
|
|
116
|
+
tessy .gluTessEndContour ();
|
|
161
117
|
tessy .gluTessEndPolygon ();
|
|
162
118
|
|
|
119
|
+
// Return array of indices.
|
|
163
120
|
return triangles;
|
|
164
121
|
};
|
|
165
122
|
})(),
|
|
@@ -169,28 +126,6 @@ const Triangle3 = {
|
|
|
169
126
|
for (let i = 1, length = vertices .length - 1; i < length; ++ i)
|
|
170
127
|
triangles .push (vertices [0], vertices [i], vertices [i + 1]);
|
|
171
128
|
},
|
|
172
|
-
getPolygonNormal: function (vertices, normal)
|
|
173
|
-
{
|
|
174
|
-
// Determine polygon normal.
|
|
175
|
-
// We use Newell's method https://www.opengl.org/wiki/Calculating_a_Surface_Normal here:
|
|
176
|
-
|
|
177
|
-
normal .set (0, 0, 0);
|
|
178
|
-
|
|
179
|
-
var next = vertices [0];
|
|
180
|
-
|
|
181
|
-
for (let i = 0, length = vertices .length; i < length; ++ i)
|
|
182
|
-
{
|
|
183
|
-
var
|
|
184
|
-
current = next,
|
|
185
|
-
next = vertices [(i + 1) % length];
|
|
186
|
-
|
|
187
|
-
normal .x += (current .y - next .y) * (current .z + next .z);
|
|
188
|
-
normal .y += (current .z - next .z) * (current .x + next .x);
|
|
189
|
-
normal .z += (current .x - next .x) * (current .y + next .y);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
return normal .normalize ();
|
|
193
|
-
},
|
|
194
129
|
};
|
|
195
130
|
|
|
196
131
|
export default Triangle3;
|
|
@@ -93,12 +93,14 @@ Color3 .prototype =
|
|
|
93
93
|
this [_r] = color [_r];
|
|
94
94
|
this [_g] = color [_g];
|
|
95
95
|
this [_b] = color [_b];
|
|
96
|
+
return this;
|
|
96
97
|
},
|
|
97
98
|
set: function (r, g, b)
|
|
98
99
|
{
|
|
99
100
|
this [_r] = clamp (r, 0, 1);
|
|
100
101
|
this [_g] = clamp (g, 0, 1);
|
|
101
102
|
this [_b] = clamp (b, 0, 1);
|
|
103
|
+
return this;
|
|
102
104
|
},
|
|
103
105
|
equals: function (color)
|
|
104
106
|
{
|
|
@@ -173,6 +175,8 @@ Color3 .prototype =
|
|
|
173
175
|
default: this [_r] = v; this [_g] = p; this [_b] = q; break;
|
|
174
176
|
}
|
|
175
177
|
}
|
|
178
|
+
|
|
179
|
+
return this;
|
|
176
180
|
},
|
|
177
181
|
toString: function ()
|
|
178
182
|
{
|
|
@@ -100,6 +100,7 @@ Color4 .prototype =
|
|
|
100
100
|
this [_g] = color [_g];
|
|
101
101
|
this [_b] = color [_b];
|
|
102
102
|
this [_a] = color [_a];
|
|
103
|
+
return this;
|
|
103
104
|
},
|
|
104
105
|
set: function (r, g, b, a)
|
|
105
106
|
{
|
|
@@ -107,6 +108,7 @@ Color4 .prototype =
|
|
|
107
108
|
this [_g] = clamp (g, 0, 1);
|
|
108
109
|
this [_b] = clamp (b, 0, 1);
|
|
109
110
|
this [_a] = clamp (a, 0, 1);
|
|
111
|
+
return this;
|
|
110
112
|
},
|
|
111
113
|
equals: function (color)
|
|
112
114
|
{
|
|
@@ -128,6 +130,8 @@ Color4 .prototype =
|
|
|
128
130
|
Color3 .prototype .setHSV .call (this, h, s, v);
|
|
129
131
|
|
|
130
132
|
this [_a] = clamp (a, 0, 1);
|
|
133
|
+
|
|
134
|
+
return this;
|
|
131
135
|
},
|
|
132
136
|
toString: function ()
|
|
133
137
|
{
|