rhodonite 0.26.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/VERSION-FILE +1 -1
- package/dist/esm/foundation/core/MemoryManager.d.ts +19 -0
- package/dist/esm/foundation/core/MemoryManager.js +2 -2
- package/dist/esm/foundation/definitions/ShaderSemantics.d.ts +1 -0
- package/dist/esm/foundation/definitions/ShaderSemantics.js +2 -2
- package/dist/esm/foundation/helpers/Shadow/ShadowSystem.js +1 -1
- package/dist/esm/foundation/helpers/materials/createNodeBasedRaymarchingMaterials.js +1 -1
- package/dist/esm/foundation/helpers/materials/nodeBasedMaterialCommon.js +1 -1
- package/dist/esm/foundation/importer/DrcPointCloudImporter.js +1 -1
- package/dist/esm/foundation/importer/Gltf2Importer.d.ts +2 -1
- package/dist/esm/foundation/importer/Gltf2Importer.js +1 -1
- package/dist/esm/foundation/importer/GltfImporter.js +1 -1
- package/dist/esm/foundation/importer/RhodoniteImportExtension.js +1 -1
- package/dist/esm/foundation/importer/Vrm0xImporter.js +1 -1
- package/dist/esm/foundation/importer/VrmImporter.js +1 -1
- package/dist/esm/foundation/materials/contents/CustomMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/contents/MToon0xMaterialContent.js +11 -11
- package/dist/esm/foundation/materials/contents/MToon1MaterialContent.js +6 -6
- package/dist/esm/foundation/materials/core/AbstractMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/core/Material.d.ts +7 -2
- package/dist/esm/foundation/materials/core/Material.js +1 -1
- package/dist/esm/foundation/materials/core/ShaderityUtilityWebGL.js +2 -2
- package/dist/esm/foundation/materials/core/ShaderityUtilityWebGPU.js +2 -2
- package/dist/esm/foundation/memory/Accessor.js +6 -6
- package/dist/esm/foundation/memory/BufferView.js +1 -1
- package/dist/esm/foundation/misc/PngDecoder.d.ts +18 -0
- package/dist/esm/foundation/misc/PngDecoder.js +1 -0
- package/dist/esm/foundation/renderer/RenderPass.d.ts +7 -0
- package/dist/esm/foundation/renderer/RenderPass.js +1 -1
- package/dist/esm/foundation/renderer/pipelines/ForwardRenderPipeline.d.ts +2 -1
- package/dist/esm/foundation/renderer/pipelines/ForwardRenderPipeline.js +1 -1
- package/dist/esm/foundation/system/Engine.js +1 -1
- package/dist/esm/foundation/textures/CubeTexture.d.ts +11 -2
- package/dist/esm/foundation/textures/CubeTexture.js +1 -1
- package/dist/esm/foundation/textures/RenderTargetTexture2DArray.js +1 -1
- package/dist/esm/foundation/textures/RenderTargetTextureCube.d.ts +6 -0
- package/dist/esm/foundation/textures/RenderTargetTextureCube.js +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/webgl/MultiDraw.js +1 -1
- package/dist/esm/webgl/MultiDrawRepository.js +1 -1
- package/dist/esm/webgl/WebGLResourceRepository.d.ts +5 -0
- package/dist/esm/webgl/WebGLResourceRepository.js +3 -3
- package/dist/esm/webgl/WebGLStereoUtil.js +1 -1
- package/dist/esm/webgl/WebGLStrategyWebGL2.d.ts +19 -14
- package/dist/esm/webgl/WebGLStrategyWebGL2.js +67 -67
- package/dist/esm/webgl/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.frag.glsl.js +2 -1
- package/dist/esm/webgl/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.frag.glsl.js +1 -0
- package/dist/esm/webgl/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +2 -0
- package/dist/esm/webgl/shaderity_shaders/common/iblDefinition.glsl.js +11 -5
- package/dist/esm/webgl/shaders/nodes/BlockBeginShader.js +1 -1
- package/dist/esm/webgl/shaders/nodes/BlockEndShader.js +1 -1
- package/dist/esm/webgl/shaders/nodes/ConstantVariableShader.js +5 -5
- package/dist/esm/webgl/shaders/nodes/RaymarchObjectIdUniform.js +3 -3
- package/dist/esm/webgl/shaders/nodes/SdApplyWorldMatrix.js +3 -3
- package/dist/esm/webgl/shaders/nodes/Texture2DShader.js +14 -14
- package/dist/esm/webgl/shaders/nodes/UniformDataShader.js +13 -13
- package/dist/esm/webgpu/GpuCullingRegistry.js +1 -1
- package/dist/esm/webgpu/GpuDeformRegistry.js +1 -1
- package/dist/esm/webgpu/WebGpuGpuTimer.js +1 -1
- package/dist/esm/webgpu/WebGpuResourceRepository.d.ts +6 -0
- package/dist/esm/webgpu/WebGpuResourceRepository.js +5 -5
- package/dist/esm/webgpu/WebGpuStrategyBasic.js +2 -2
- package/dist/esm/webgpu/WebGpuVertexDeformer.js +1 -1
- package/dist/esm/webgpu/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.frag.wgsl.js +1 -0
- package/dist/esm/webgpu/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.frag.wgsl.js +1 -0
- package/dist/esm/webgpu/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +1 -0
- package/dist/esm/webgpu/shaderity_shaders/common/iblDefinition.wgsl.js +10 -4
- package/dist/esmdev/foundation/core/MemoryManager.d.ts +19 -0
- package/dist/esmdev/foundation/core/MemoryManager.js +28 -3
- package/dist/esmdev/foundation/core/RnObject.js +37 -37
- package/dist/esmdev/foundation/definitions/Blend.js +3 -3
- package/dist/esmdev/foundation/definitions/ComponentType.js +7 -7
- package/dist/esmdev/foundation/definitions/CompositionType.js +50 -50
- package/dist/esmdev/foundation/definitions/CompressionTextureType.js +6 -6
- package/dist/esmdev/foundation/definitions/ShaderSemantics.d.ts +1 -0
- package/dist/esmdev/foundation/definitions/ShaderSemantics.js +12 -7
- package/dist/esmdev/foundation/definitions/TextureFormat.js +3 -3
- package/dist/esmdev/foundation/definitions/TextureParameter.js +3 -3
- package/dist/esmdev/foundation/definitions/VertexAttribute.js +30 -30
- package/dist/esmdev/foundation/enhanced_js_objects/Array.js +2 -2
- package/dist/esmdev/foundation/exporter/Gltf2Exporter.js +106 -106
- package/dist/esmdev/foundation/geometry/ComplexVertexAttribute.js +18 -18
- package/dist/esmdev/foundation/geometry/Frustum.js +39 -39
- package/dist/esmdev/foundation/geometry/Mesh.js +205 -205
- package/dist/esmdev/foundation/geometry/Primitive.js +124 -124
- package/dist/esmdev/foundation/geometry/SimpleVertexAttribute.js +7 -7
- package/dist/esmdev/foundation/geometry/shapes/Cylinder.js +3 -3
- package/dist/esmdev/foundation/geometry/shapes/Joint.js +33 -33
- package/dist/esmdev/foundation/gizmos/AABBGizmo.js +12 -12
- package/dist/esmdev/foundation/gizmos/CapsuleColliderGizmo.js +23 -23
- package/dist/esmdev/foundation/gizmos/Gizmo.js +23 -23
- package/dist/esmdev/foundation/gizmos/JointGizmo.js +35 -35
- package/dist/esmdev/foundation/gizmos/LightGizmo.js +23 -23
- package/dist/esmdev/foundation/gizmos/LocatorGizmo.js +22 -22
- package/dist/esmdev/foundation/gizmos/RotationGizmo.js +197 -197
- package/dist/esmdev/foundation/gizmos/ScaleGizmo.js +129 -129
- package/dist/esmdev/foundation/gizmos/ShapeGizmo.js +43 -43
- package/dist/esmdev/foundation/gizmos/SphereColliderGizmo.js +24 -24
- package/dist/esmdev/foundation/gizmos/TranslationGizmo.js +129 -129
- package/dist/esmdev/foundation/helpers/BloomHelper.js +28 -28
- package/dist/esmdev/foundation/helpers/GaussianBlurHelper.js +18 -18
- package/dist/esmdev/foundation/helpers/Shadow/PointShadowMap.js +11 -11
- package/dist/esmdev/foundation/helpers/Shadow/ShadowMap.js +5 -5
- package/dist/esmdev/foundation/helpers/Shadow/ShadowSystem.js +111 -111
- package/dist/esmdev/foundation/helpers/materials/createNodeBasedRaymarchingMaterials.js +10 -1
- package/dist/esmdev/foundation/helpers/materials/nodeBasedMaterialCommon.js +11 -1
- package/dist/esmdev/foundation/importer/AnimationAssigner.js +44 -44
- package/dist/esmdev/foundation/importer/DrcPointCloudImporter.js +27 -27
- package/dist/esmdev/foundation/importer/Gltf2Importer.d.ts +2 -1
- package/dist/esmdev/foundation/importer/Gltf2Importer.js +21 -17
- package/dist/esmdev/foundation/importer/GltfImporter.js +22 -22
- package/dist/esmdev/foundation/importer/ModelConverter.js +131 -131
- package/dist/esmdev/foundation/importer/RhodoniteImportExtension.js +6 -6
- package/dist/esmdev/foundation/importer/Vrm0xImporter.js +48 -48
- package/dist/esmdev/foundation/importer/VrmImporter.js +10 -10
- package/dist/esmdev/foundation/materials/contents/CustomMaterialContent.js +37 -28
- package/dist/esmdev/foundation/materials/contents/DepthEncodeMaterialContent.js +2 -2
- package/dist/esmdev/foundation/materials/contents/MToon0xMaterialContent.js +145 -137
- package/dist/esmdev/foundation/materials/contents/MToon1MaterialContent.js +27 -19
- package/dist/esmdev/foundation/materials/contents/ShadowMapDecodeClassicMaterialContent.js +5 -5
- package/dist/esmdev/foundation/materials/contents/VarianceShadowMapDecodeClassicMaterialContent.js +4 -4
- package/dist/esmdev/foundation/materials/core/AbstractMaterialContent.js +47 -47
- package/dist/esmdev/foundation/materials/core/AbstractShaderNode.js +25 -25
- package/dist/esmdev/foundation/materials/core/DummyTextures.js +3 -3
- package/dist/esmdev/foundation/materials/core/Material.d.ts +7 -2
- package/dist/esmdev/foundation/materials/core/Material.js +113 -99
- package/dist/esmdev/foundation/materials/core/MaterialRepository.js +51 -51
- package/dist/esmdev/foundation/materials/core/ShaderGraphResolver.js +38 -38
- package/dist/esmdev/foundation/materials/core/ShaderHandler.js +4 -4
- package/dist/esmdev/foundation/materials/core/ShaderityUtilityWebGL.js +14 -14
- package/dist/esmdev/foundation/materials/core/ShaderityUtilityWebGPU.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/AbsShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/AcosShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/AddShaderNode.js +18 -18
- package/dist/esmdev/foundation/materials/nodes/AlphaTestShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/AndShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/Atan2ShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/AttributeColorShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributeInstanceIdsShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributeJointShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributeNormalShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributePositionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/AttributeTangentShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributeTexcoordShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/AttributeWeightShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/BlockBeginShaderNode.js +11 -11
- package/dist/esmdev/foundation/materials/nodes/BlockEndShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/BranchShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/CalcBitangentShaderNode.js +7 -7
- package/dist/esmdev/foundation/materials/nodes/CastToFloatShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/ClampShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/ClassicShaderNode.js +11 -11
- package/dist/esmdev/foundation/materials/nodes/ConstantScalarVariableShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/ConstantVariableShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/ConstantVector2VariableShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/ConstantVector3VariableShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/ConstantVector4VariableShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/CosShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/DiscardShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/DotProductShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/EqualShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/FlatShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/GreaterOrEqualShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/GreaterShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/GreaterThanShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/LengthShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/LessOrEqualShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/LessThanShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/MergeVectorShaderNode.js +19 -19
- package/dist/esmdev/foundation/materials/nodes/MinShaderNode.js +18 -18
- package/dist/esmdev/foundation/materials/nodes/MultiplyShaderNode.js +21 -21
- package/dist/esmdev/foundation/materials/nodes/NormalMatrixShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/NormalizeShaderNode.js +9 -9
- package/dist/esmdev/foundation/materials/nodes/NotEqualShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/OrShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/OutColorShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/OutPositionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/PbrAnisotropyPropsShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/PbrAnisotropyRotationShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/PbrBaseColorPropsShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/PbrClearcoatPropsShaderNode.js +7 -7
- package/dist/esmdev/foundation/materials/nodes/PbrDiffuseTransmissionPropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PbrEmissivePropsShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/PbrIridescencePropsShaderNode.js +8 -8
- package/dist/esmdev/foundation/materials/nodes/PbrMetallicRoughnessPropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PbrNormalPropsShaderNode.js +11 -11
- package/dist/esmdev/foundation/materials/nodes/PbrOcclusionPropsShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/PbrShaderShaderNode.js +21 -21
- package/dist/esmdev/foundation/materials/nodes/PbrSheenPropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PbrSpecularPropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PbrTransmissionPropsShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/PbrVolumePropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PremultipliedAlphaShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/ProcessGeometryShaderNode.js +22 -22
- package/dist/esmdev/foundation/materials/nodes/ProjectionMatrixShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/Random_HashPRNGShaderNode.js +12 -12
- package/dist/esmdev/foundation/materials/nodes/Random_SinHashShaderNode.js +12 -12
- package/dist/esmdev/foundation/materials/nodes/RemapShaderNode.js +17 -17
- package/dist/esmdev/foundation/materials/nodes/SinShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/SmoothStepShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/SplitVectorShaderNode.js +17 -17
- package/dist/esmdev/foundation/materials/nodes/StepShaderNode.js +14 -14
- package/dist/esmdev/foundation/materials/nodes/TanShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/Texture2DShaderNode.js +16 -16
- package/dist/esmdev/foundation/materials/nodes/TimeShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/TransformShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/UniformDataShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/ViewMatrixShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/WireframeMaterialNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/WorldMatrixShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendXYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendXZShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendYXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendYZShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendZXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendZYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/InitialPositionShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpSmoothIntersectionShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpSmoothSubtractionShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpSmoothUnionShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpSubtractionShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpUnionShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/raymarching/OutDistanceShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/raymarching/OutShadingColorShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/OutUnionShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchCameraPositionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchHitDistanceShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchHitNormalShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchHitPositionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchObjectIdShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchObjectIdUniformShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchRayDirectionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchTBNShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchViewDirectionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdApplyTransformShaderNode.js +9 -9
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdApplyWorldMatrixShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdBarXShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdBarYShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdBarZShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdBoxShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdCapsuleShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatXYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatYZShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatZShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatZXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRoundBoxShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdSphereShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdTorusShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdTubeXShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdTubeYShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdTubeZShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/TwistXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/TwistYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/TwistZShaderNode.js +4 -4
- package/dist/esmdev/foundation/math/AABB.js +120 -120
- package/dist/esmdev/foundation/math/AnimatedQuaternion.js +53 -53
- package/dist/esmdev/foundation/math/AnimatedScalar.js +54 -54
- package/dist/esmdev/foundation/math/AnimatedValueEvaluationState.js +18 -18
- package/dist/esmdev/foundation/math/AnimatedVector2.js +54 -54
- package/dist/esmdev/foundation/math/AnimatedVector3.js +54 -54
- package/dist/esmdev/foundation/math/AnimatedVector4.js +54 -54
- package/dist/esmdev/foundation/math/AnimatedVectorN.js +54 -54
- package/dist/esmdev/foundation/math/IdentityMatrix33.js +2 -2
- package/dist/esmdev/foundation/math/IdentityMatrix44.js +2 -2
- package/dist/esmdev/foundation/math/MathClassUtil.js +3 -3
- package/dist/esmdev/foundation/math/Quaternion.js +13 -13
- package/dist/esmdev/foundation/math/Transform3D.js +72 -72
- package/dist/esmdev/foundation/math/shapes/MathSphere.js +7 -7
- package/dist/esmdev/foundation/memory/Accessor.js +369 -369
- package/dist/esmdev/foundation/memory/Buffer.js +39 -39
- package/dist/esmdev/foundation/memory/BufferView.js +29 -29
- package/dist/esmdev/foundation/misc/DataUtil.js +2 -2
- package/dist/esmdev/foundation/misc/EnumIO.js +8 -8
- package/dist/esmdev/foundation/misc/Logger.js +14 -14
- package/dist/esmdev/foundation/misc/PngDecoder.d.ts +18 -0
- package/dist/esmdev/foundation/misc/PngDecoder.js +113 -0
- package/dist/esmdev/foundation/misc/RnPromise.js +14 -14
- package/dist/esmdev/foundation/misc/Time.js +23 -23
- package/dist/esmdev/foundation/misc/WeakOption.js +14 -14
- package/dist/esmdev/foundation/misc/cache/Cache.js +2 -2
- package/dist/esmdev/foundation/misc/cache/SymbolWeakMap.js +8 -8
- package/dist/esmdev/foundation/physics/PhysicsWorldQuery.js +10 -10
- package/dist/esmdev/foundation/physics/Rapier/RapierCharacterControllerStrategy.js +186 -186
- package/dist/esmdev/foundation/physics/Rapier/RapierPhysicsStrategy.js +221 -221
- package/dist/esmdev/foundation/physics/Rapier/RapierPhysicsWorldQueryStrategy.js +3 -3
- package/dist/esmdev/foundation/physics/VRMSpring/CapsuleCollider.js +36 -36
- package/dist/esmdev/foundation/physics/VRMSpring/SphereCollider.js +26 -26
- package/dist/esmdev/foundation/physics/VRMSpring/VRMSpringBone.js +6 -6
- package/dist/esmdev/foundation/physics/VRMSpring/VRMSpringBonePhysicsStrategy.js +39 -39
- package/dist/esmdev/foundation/renderer/Expression.js +6 -6
- package/dist/esmdev/foundation/renderer/Frame.js +6 -6
- package/dist/esmdev/foundation/renderer/FrameBuffer.js +25 -25
- package/dist/esmdev/foundation/renderer/RenderPass.d.ts +7 -0
- package/dist/esmdev/foundation/renderer/RenderPass.js +94 -86
- package/dist/esmdev/foundation/renderer/TemporalAA/PreviousFrameDataTracker.js +6 -6
- package/dist/esmdev/foundation/renderer/TemporalAA/TemporalAASystem.js +75 -75
- package/dist/esmdev/foundation/renderer/lightCluster/LightClusterSystem.js +146 -146
- package/dist/esmdev/foundation/renderer/lightCluster/LightClusterSystemStub.js +3 -3
- package/dist/esmdev/foundation/renderer/pipelines/DeferredRenderPipeline.js +4 -4
- package/dist/esmdev/foundation/renderer/pipelines/ForwardRenderPipeline.d.ts +2 -1
- package/dist/esmdev/foundation/renderer/pipelines/ForwardRenderPipeline.js +420 -420
- package/dist/esmdev/foundation/system/Engine.js +209 -209
- package/dist/esmdev/foundation/system/EventPubSub.js +8 -8
- package/dist/esmdev/foundation/system/InputManager.js +56 -56
- package/dist/esmdev/foundation/system/ModuleManager.js +3 -3
- package/dist/esmdev/foundation/textures/AbstractTexture.js +48 -48
- package/dist/esmdev/foundation/textures/CubeTexture.d.ts +11 -2
- package/dist/esmdev/foundation/textures/CubeTexture.js +47 -36
- package/dist/esmdev/foundation/textures/RenderBuffer.js +11 -11
- package/dist/esmdev/foundation/textures/RenderTargetTexture.js +24 -24
- package/dist/esmdev/foundation/textures/RenderTargetTexture2DArray.js +35 -35
- package/dist/esmdev/foundation/textures/RenderTargetTextureCube.d.ts +6 -0
- package/dist/esmdev/foundation/textures/RenderTargetTextureCube.js +25 -19
- package/dist/esmdev/foundation/textures/Sampler.js +24 -24
- package/dist/esmdev/foundation/textures/Texture.js +83 -83
- package/dist/esmdev/foundation/textures/TextureArray.js +8 -8
- package/dist/esmdev/foundation/textures/TextureDataFloat.js +26 -26
- package/dist/esmdev/foundation/textures/VideoTexture.js +24 -24
- package/dist/esmdev/version.js +2 -2
- package/dist/esmdev/webgl/InstanceSidTable.js +62 -62
- package/dist/esmdev/webgl/MultiDraw.js +2 -2
- package/dist/esmdev/webgl/MultiDrawRepository.js +30 -30
- package/dist/esmdev/webgl/WebGLContextWrapper.js +146 -146
- package/dist/esmdev/webgl/WebGLGpuTimer.js +30 -30
- package/dist/esmdev/webgl/WebGLResourceRepository.d.ts +5 -0
- package/dist/esmdev/webgl/WebGLResourceRepository.js +368 -307
- package/dist/esmdev/webgl/WebGLStereoUtil.js +39 -39
- package/dist/esmdev/webgl/WebGLStrategyWebGL2.d.ts +19 -14
- package/dist/esmdev/webgl/WebGLStrategyWebGL2.js +294 -280
- package/dist/esmdev/webgl/debug/ShaderParameterDebugger.js +4 -4
- package/dist/esmdev/webgl/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.frag.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.frag.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/common/iblDefinition.glsl.js +2 -2
- package/dist/esmdev/webgl/shaders/RaymarchingShaderPart.js +4 -4
- package/dist/esmdev/webgl/shaders/RaymarchingShadowShaderPart.js +14 -14
- package/dist/esmdev/webgl/shaders/StandardShaderPart.js +3 -3
- package/dist/esmdev/webgl/shaders/nodes/BlockBeginShader.js +10 -10
- package/dist/esmdev/webgl/shaders/nodes/BlockEndShader.js +10 -10
- package/dist/esmdev/webgl/shaders/nodes/ConstantVariableShader.js +21 -21
- package/dist/esmdev/webgl/shaders/nodes/OutDistance.js +12 -12
- package/dist/esmdev/webgl/shaders/nodes/OutUnion.js +9 -9
- package/dist/esmdev/webgl/shaders/nodes/RaymarchObjectIdUniform.js +8 -8
- package/dist/esmdev/webgl/shaders/nodes/SdApplyTransform.js +9 -9
- package/dist/esmdev/webgl/shaders/nodes/SdApplyWorldMatrix.js +8 -8
- package/dist/esmdev/webgl/shaders/nodes/Texture2DShader.js +23 -23
- package/dist/esmdev/webgl/shaders/nodes/UniformDataShader.js +23 -23
- package/dist/esmdev/webgl/textureLoader/KTX2TextureLoader.js +24 -24
- package/dist/esmdev/webgpu/GpuCullingRegistry.js +91 -91
- package/dist/esmdev/webgpu/GpuDeformRegistry.js +53 -53
- package/dist/esmdev/webgpu/RangeAllocator.js +16 -16
- package/dist/esmdev/webgpu/WebGpuBufferArena.js +21 -21
- package/dist/esmdev/webgpu/WebGpuDeviceWrapper.js +7 -7
- package/dist/esmdev/webgpu/WebGpuGpuCulling.js +198 -198
- package/dist/esmdev/webgpu/WebGpuGpuTimer.js +51 -51
- package/dist/esmdev/webgpu/WebGpuLightClusterBuilder.js +36 -36
- package/dist/esmdev/webgpu/WebGpuResourceRepository.d.ts +6 -0
- package/dist/esmdev/webgpu/WebGpuResourceRepository.js +655 -593
- package/dist/esmdev/webgpu/WebGpuStrategyBasic.js +123 -123
- package/dist/esmdev/webgpu/WebGpuVertexDeformer.js +128 -128
- package/dist/esmdev/webgpu/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.frag.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.frag.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/common/iblDefinition.wgsl.js +2 -2
- package/dist/esmdev/xr/WebARSystem.js +69 -69
- package/dist/esmdev/xr/WebXRSystem.js +151 -151
- package/package.json +2 -1
|
@@ -40,38 +40,38 @@ var _Accessor = class _Accessor {
|
|
|
40
40
|
arrayLength,
|
|
41
41
|
normalized
|
|
42
42
|
}) {
|
|
43
|
-
this.
|
|
44
|
-
this.
|
|
45
|
-
this.
|
|
46
|
-
this.
|
|
43
|
+
this.ft = CompositionType.Unknown;
|
|
44
|
+
this.ht = ComponentType.Unknown;
|
|
45
|
+
this.eu = 0;
|
|
46
|
+
this.lu = new Float32Array();
|
|
47
47
|
// init with a dummy Float32Array at first
|
|
48
|
-
this.
|
|
49
|
-
this
|
|
50
|
-
this.
|
|
48
|
+
this.iu = 0;
|
|
49
|
+
this.au = 0;
|
|
50
|
+
this.pt = MutableVector4.fromCopyArray([
|
|
51
51
|
-Number.MAX_VALUE,
|
|
52
52
|
-Number.MAX_VALUE,
|
|
53
53
|
-Number.MAX_VALUE,
|
|
54
54
|
-Number.MAX_VALUE
|
|
55
55
|
]);
|
|
56
|
-
this.
|
|
56
|
+
this.ot = MutableVector4.fromCopyArray([
|
|
57
57
|
Number.MAX_VALUE,
|
|
58
58
|
Number.MAX_VALUE,
|
|
59
59
|
Number.MAX_VALUE,
|
|
60
60
|
Number.MAX_VALUE
|
|
61
61
|
]);
|
|
62
|
-
this.
|
|
63
|
-
this.
|
|
64
|
-
this.
|
|
65
|
-
this.
|
|
62
|
+
this.ju = 1;
|
|
63
|
+
this.ou = false;
|
|
64
|
+
this.du = true;
|
|
65
|
+
this.nu = 0;
|
|
66
66
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
67
|
-
this.
|
|
68
|
-
this.
|
|
69
|
-
this.
|
|
70
|
-
this.
|
|
71
|
-
this.
|
|
72
|
-
this.
|
|
67
|
+
this.ku = bufferView;
|
|
68
|
+
this.fu = bufferView.byteOffsetInRawArrayBufferOfBuffer + byteOffsetInBufferView;
|
|
69
|
+
this.ft = compositionType;
|
|
70
|
+
this.ht = componentType;
|
|
71
|
+
this.eu = count;
|
|
72
|
+
this.ju = arrayLength;
|
|
73
73
|
if (Is.exist(max)) {
|
|
74
|
-
this.
|
|
74
|
+
this.pt.setComponents(
|
|
75
75
|
(_a = max[0]) != null ? _a : -Number.MAX_VALUE,
|
|
76
76
|
(_b = max[1]) != null ? _b : -Number.MAX_VALUE,
|
|
77
77
|
(_c = max[2]) != null ? _c : -Number.MAX_VALUE,
|
|
@@ -79,7 +79,7 @@ var _Accessor = class _Accessor {
|
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
81
|
if (Is.exist(min)) {
|
|
82
|
-
this.
|
|
82
|
+
this.ot.setComponents(
|
|
83
83
|
(_e = min[0]) != null ? _e : Number.MAX_VALUE,
|
|
84
84
|
(_f = min[1]) != null ? _f : Number.MAX_VALUE,
|
|
85
85
|
(_g = min[2]) != null ? _g : Number.MAX_VALUE,
|
|
@@ -87,55 +87,55 @@ var _Accessor = class _Accessor {
|
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
89
|
if (Is.exist(max) && Is.exist(min)) {
|
|
90
|
-
this.
|
|
90
|
+
this.du = false;
|
|
91
91
|
}
|
|
92
|
-
this.
|
|
93
|
-
this.
|
|
94
|
-
this
|
|
95
|
-
if (this
|
|
96
|
-
this
|
|
92
|
+
this.Mj = raw;
|
|
93
|
+
this.ou = normalized;
|
|
94
|
+
this.au = byteStride;
|
|
95
|
+
if (this.au === 0) {
|
|
96
|
+
this.au = this.ft.getNumberOfComponents() * this.ht.getSizeInBytes() * this.ju;
|
|
97
97
|
}
|
|
98
|
-
const typedArrayClass = this.getTypedArrayClass(this.
|
|
99
|
-
this.
|
|
100
|
-
const maxExceededSizeOnAoS = this
|
|
101
|
-
const sizeFromAccessorBeginToArrayBufferEnd = this.
|
|
102
|
-
const maxLimitSizeToAccess = this.byteStride * this.
|
|
98
|
+
const typedArrayClass = this.getTypedArrayClass(this.ht);
|
|
99
|
+
this.mu = typedArrayClass;
|
|
100
|
+
const maxExceededSizeOnAoS = this.au - this.ft.getNumberOfComponents() * this.ht.getSizeInBytes();
|
|
101
|
+
const sizeFromAccessorBeginToArrayBufferEnd = this.Mj.byteLength - this.fu;
|
|
102
|
+
const maxLimitSizeToAccess = this.byteStride * this.eu - maxExceededSizeOnAoS;
|
|
103
103
|
if (sizeFromAccessorBeginToArrayBufferEnd < maxLimitSizeToAccess) {
|
|
104
104
|
Logger.default.error(
|
|
105
105
|
`Requesting a data size that exceeds the remaining capacity of the buffer: ${this.bufferView.buffer.name}.
|
|
106
106
|
Exceeded Size: ${maxLimitSizeToAccess - sizeFromAccessorBeginToArrayBufferEnd}
|
|
107
|
-
this.__raw.byteLength: ${this.
|
|
107
|
+
this.__raw.byteLength: ${this.Mj.byteLength}
|
|
108
108
|
this.__byteOffsetInRawArrayBufferOfBuffer: ${this.byteOffsetInRawArrayBufferOfBuffer}
|
|
109
109
|
this.byteStride: ${this.byteStride}
|
|
110
|
-
this.__count: ${this.
|
|
111
|
-
this.__raw.byteLength - this.__byteOffsetInRawArrayBufferOfBuffer: ${this.
|
|
112
|
-
this.byteStride * this.__count: ${this.byteStride * this.
|
|
110
|
+
this.__count: ${this.eu}
|
|
111
|
+
this.__raw.byteLength - this.__byteOffsetInRawArrayBufferOfBuffer: ${this.Mj.byteLength - this.fu}
|
|
112
|
+
this.byteStride * this.__count: ${this.byteStride * this.eu}
|
|
113
113
|
maxExceededSizeOnAoS: ${maxExceededSizeOnAoS}
|
|
114
114
|
`
|
|
115
115
|
);
|
|
116
116
|
}
|
|
117
|
-
this.
|
|
118
|
-
this.
|
|
119
|
-
this.
|
|
120
|
-
Math.min(this
|
|
117
|
+
this.hu = new DataView(
|
|
118
|
+
this.Mj,
|
|
119
|
+
this.fu,
|
|
120
|
+
Math.min(this.au * this.eu, this.Mj.byteLength - this.fu)
|
|
121
121
|
);
|
|
122
|
-
if (this.
|
|
123
|
-
this.
|
|
124
|
-
this.
|
|
125
|
-
this.
|
|
126
|
-
this.
|
|
122
|
+
if (this.fu % typedArrayClass.BYTES_PER_ELEMENT === 0) {
|
|
123
|
+
this.lu = new typedArrayClass(
|
|
124
|
+
this.Mj,
|
|
125
|
+
this.fu,
|
|
126
|
+
this.ft.getNumberOfComponents() * this.eu
|
|
127
127
|
);
|
|
128
128
|
} else {
|
|
129
129
|
Logger.default.warn(`This Accessor's byteOffsetInRawArrayBufferOfBuffer is not aligned with the typedArrayClass's BYTES_PER_ELEMENT. So we need to copy the buffer.
|
|
130
130
|
So the typedArray data got by getTypedArray() is copied data, not reference to the original buffer.
|
|
131
131
|
`);
|
|
132
|
-
this.
|
|
132
|
+
this.pu();
|
|
133
133
|
}
|
|
134
|
-
this.
|
|
135
|
-
this.
|
|
134
|
+
this.bu = this.hu[this.getDataViewGetter(this.ht)].bind(
|
|
135
|
+
this.hu
|
|
136
136
|
);
|
|
137
|
-
this.
|
|
138
|
-
this.
|
|
137
|
+
this.cu = this.hu[this.getDataViewSetter(this.ht)].bind(
|
|
138
|
+
this.hu
|
|
139
139
|
);
|
|
140
140
|
}
|
|
141
141
|
/**
|
|
@@ -143,23 +143,23 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
143
143
|
* This is necessary when the buffer offset is not aligned with the typed array's BYTES_PER_ELEMENT.
|
|
144
144
|
* @private
|
|
145
145
|
*/
|
|
146
|
-
|
|
147
|
-
const typedArrayClass = this.getTypedArrayClass(this.
|
|
148
|
-
const copyBuffer = this.
|
|
149
|
-
this.
|
|
150
|
-
this.
|
|
146
|
+
pu() {
|
|
147
|
+
const typedArrayClass = this.getTypedArrayClass(this.ht);
|
|
148
|
+
const copyBuffer = this.Mj.slice(
|
|
149
|
+
this.fu,
|
|
150
|
+
this.fu + this.ft.getNumberOfComponents() * this.eu * typedArrayClass.BYTES_PER_ELEMENT
|
|
151
151
|
);
|
|
152
|
-
this.
|
|
152
|
+
this.lu = new typedArrayClass(copyBuffer);
|
|
153
153
|
}
|
|
154
154
|
/**
|
|
155
155
|
* Called when the accessor data is updated. Increments version and notifies associated primitives.
|
|
156
156
|
* @private
|
|
157
157
|
*/
|
|
158
|
-
|
|
158
|
+
gu() {
|
|
159
159
|
var _a;
|
|
160
|
-
this.
|
|
160
|
+
this.nu++;
|
|
161
161
|
if (this._primitive != null) {
|
|
162
|
-
(_a = this._primitive.deref()) == null ? void 0 : _a.onAccessorUpdated(this.
|
|
162
|
+
(_a = this._primitive.deref()) == null ? void 0 : _a.onAccessorUpdated(this.nu);
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
@@ -253,18 +253,18 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
253
253
|
* @throws Error if trying to allocate more elements than available
|
|
254
254
|
*/
|
|
255
255
|
takeOne() {
|
|
256
|
-
const arrayBufferOfBufferView = this.
|
|
257
|
-
if (this.
|
|
256
|
+
const arrayBufferOfBufferView = this.Mj;
|
|
257
|
+
if (this.iu >= this.eu) {
|
|
258
258
|
Logger.default.error("You are trying to allocate more than you have secured.");
|
|
259
259
|
}
|
|
260
|
-
const subTypedArray = new this.
|
|
260
|
+
const subTypedArray = new this.mu(
|
|
261
261
|
arrayBufferOfBufferView,
|
|
262
|
-
this.
|
|
263
|
-
this.
|
|
262
|
+
this.fu + this.au * this.iu,
|
|
263
|
+
this.ft.getNumberOfComponents() * this.ju
|
|
264
264
|
);
|
|
265
265
|
subTypedArray._accessor = this;
|
|
266
|
-
subTypedArray._idx_of_accessor = this.
|
|
267
|
-
this.
|
|
266
|
+
subTypedArray._idx_of_accessor = this.iu;
|
|
267
|
+
this.iu += 1;
|
|
268
268
|
return subTypedArray;
|
|
269
269
|
}
|
|
270
270
|
/**
|
|
@@ -276,14 +276,14 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
276
276
|
* @private
|
|
277
277
|
*/
|
|
278
278
|
_takeExistedOne(idx) {
|
|
279
|
-
const arrayBufferOfBufferView = this.
|
|
280
|
-
if (idx >= this.
|
|
279
|
+
const arrayBufferOfBufferView = this.Mj;
|
|
280
|
+
if (idx >= this.eu) {
|
|
281
281
|
Logger.default.error("You are trying to allocate more than you have secured.");
|
|
282
282
|
}
|
|
283
|
-
const subTypedArray = new this.
|
|
283
|
+
const subTypedArray = new this.mu(
|
|
284
284
|
arrayBufferOfBufferView,
|
|
285
|
-
this.
|
|
286
|
-
this.
|
|
285
|
+
this.fu + this.au * idx,
|
|
286
|
+
this.ft.getNumberOfComponents() * this.ju
|
|
287
287
|
);
|
|
288
288
|
subTypedArray._accessor = this;
|
|
289
289
|
subTypedArray._idx_of_accessor = idx;
|
|
@@ -294,21 +294,21 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
294
294
|
* @returns The count of taken elements
|
|
295
295
|
*/
|
|
296
296
|
get takenCount() {
|
|
297
|
-
return this.
|
|
297
|
+
return this.iu;
|
|
298
298
|
}
|
|
299
299
|
/**
|
|
300
300
|
* Gets the number of components per element (e.g., 3 for Vec3, 4 for Vec4).
|
|
301
301
|
* @returns The number of components
|
|
302
302
|
*/
|
|
303
303
|
get numberOfComponents() {
|
|
304
|
-
return this.
|
|
304
|
+
return this.ft.getNumberOfComponents();
|
|
305
305
|
}
|
|
306
306
|
/**
|
|
307
307
|
* Gets the size in bytes of each component.
|
|
308
308
|
* @returns The component size in bytes
|
|
309
309
|
*/
|
|
310
310
|
get componentSizeInBytes() {
|
|
311
|
-
return this.
|
|
311
|
+
return this.ht.getSizeInBytes();
|
|
312
312
|
}
|
|
313
313
|
/**
|
|
314
314
|
* Gets the size in bytes of each element (numberOfComponents * componentSizeInBytes).
|
|
@@ -323,28 +323,28 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
323
323
|
* @returns The element count
|
|
324
324
|
*/
|
|
325
325
|
get elementCount() {
|
|
326
|
-
return this.
|
|
326
|
+
return this.eu;
|
|
327
327
|
}
|
|
328
328
|
/**
|
|
329
329
|
* Gets the total byte length of all data in this accessor.
|
|
330
330
|
* @returns The byte length
|
|
331
331
|
*/
|
|
332
332
|
get byteLength() {
|
|
333
|
-
return this
|
|
333
|
+
return this.au * this.eu;
|
|
334
334
|
}
|
|
335
335
|
/**
|
|
336
336
|
* Gets the component type of this accessor.
|
|
337
337
|
* @returns The component type enum
|
|
338
338
|
*/
|
|
339
339
|
get componentType() {
|
|
340
|
-
return this.
|
|
340
|
+
return this.ht;
|
|
341
341
|
}
|
|
342
342
|
/**
|
|
343
343
|
* Gets the composition type of this accessor.
|
|
344
344
|
* @returns The composition type enum
|
|
345
345
|
*/
|
|
346
346
|
get compositionType() {
|
|
347
|
-
return this.
|
|
347
|
+
return this.ft;
|
|
348
348
|
}
|
|
349
349
|
/**
|
|
350
350
|
* Gets the underlying TypedArray for this accessor.
|
|
@@ -352,7 +352,7 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
352
352
|
* @returns The TypedArray containing the data
|
|
353
353
|
*/
|
|
354
354
|
getTypedArray() {
|
|
355
|
-
return this.
|
|
355
|
+
return this.lu;
|
|
356
356
|
}
|
|
357
357
|
/**
|
|
358
358
|
* Sets the data from a TypedArray into this accessor.
|
|
@@ -361,28 +361,28 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
361
361
|
* @param typedArray - The TypedArray to copy data from
|
|
362
362
|
*/
|
|
363
363
|
setTypedArray(typedArray) {
|
|
364
|
-
if (typedArray.buffer === this.
|
|
364
|
+
if (typedArray.buffer === this.Mj) {
|
|
365
365
|
} else {
|
|
366
|
-
if (this.
|
|
367
|
-
for (let i = 0; i < this.
|
|
366
|
+
if (this.ft === CompositionType.Scalar) {
|
|
367
|
+
for (let i = 0; i < this.eu; i++) {
|
|
368
368
|
this.setScalar(i, typedArray[i], { endian: true });
|
|
369
369
|
}
|
|
370
|
-
} else if (this.
|
|
371
|
-
for (let i = 0; i < this.
|
|
370
|
+
} else if (this.ft === CompositionType.Vec2) {
|
|
371
|
+
for (let i = 0; i < this.eu; i++) {
|
|
372
372
|
this.setVec2(i, typedArray[i * 2], typedArray[i * 2 + 1], { endian: true });
|
|
373
373
|
}
|
|
374
|
-
} else if (this.
|
|
375
|
-
for (let i = 0; i < this.
|
|
374
|
+
} else if (this.ft === CompositionType.Vec3) {
|
|
375
|
+
for (let i = 0; i < this.eu; i++) {
|
|
376
376
|
this.setVec3(i, typedArray[i * 3], typedArray[i * 3 + 1], typedArray[i * 3 + 2], { endian: true });
|
|
377
377
|
}
|
|
378
|
-
} else if (this.
|
|
379
|
-
for (let i = 0; i < this.
|
|
378
|
+
} else if (this.ft === CompositionType.Vec4) {
|
|
379
|
+
for (let i = 0; i < this.eu; i++) {
|
|
380
380
|
this.setVec4(i, typedArray[i * 4], typedArray[i * 4 + 1], typedArray[i * 4 + 2], typedArray[i * 4 + 3], {
|
|
381
381
|
endian: true
|
|
382
382
|
});
|
|
383
383
|
}
|
|
384
|
-
} else if (this.
|
|
385
|
-
for (let i = 0; i < this.
|
|
384
|
+
} else if (this.ft === CompositionType.Mat3) {
|
|
385
|
+
for (let i = 0; i < this.eu; i++) {
|
|
386
386
|
this.setMat3(
|
|
387
387
|
i,
|
|
388
388
|
typedArray[i * 9],
|
|
@@ -397,8 +397,8 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
397
397
|
{ endian: true }
|
|
398
398
|
);
|
|
399
399
|
}
|
|
400
|
-
} else if (this.
|
|
401
|
-
for (let i = 0; i < this.
|
|
400
|
+
} else if (this.ft === CompositionType.Mat4) {
|
|
401
|
+
for (let i = 0; i < this.eu; i++) {
|
|
402
402
|
this.setMat4(
|
|
403
403
|
i,
|
|
404
404
|
typedArray[i * 16],
|
|
@@ -423,7 +423,7 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
423
423
|
} else {
|
|
424
424
|
throw new Error("Unexpected CompositionType!");
|
|
425
425
|
}
|
|
426
|
-
this.
|
|
426
|
+
this.pu();
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
429
|
/**
|
|
@@ -452,7 +452,7 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
452
452
|
* @returns True if using SoA layout
|
|
453
453
|
*/
|
|
454
454
|
get isSoA() {
|
|
455
|
-
const isSoA = this.byteStride === this.
|
|
455
|
+
const isSoA = this.byteStride === this.ft.getNumberOfComponents() * this.ht.getSizeInBytes();
|
|
456
456
|
return isSoA;
|
|
457
457
|
}
|
|
458
458
|
/**
|
|
@@ -462,7 +462,7 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
462
462
|
* @returns The byte stride
|
|
463
463
|
*/
|
|
464
464
|
get byteStride() {
|
|
465
|
-
return this
|
|
465
|
+
return this.au;
|
|
466
466
|
}
|
|
467
467
|
/**
|
|
468
468
|
* Gets a scalar value at the specified index.
|
|
@@ -475,7 +475,7 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
475
475
|
if (indicesAccessor) {
|
|
476
476
|
index = indicesAccessor.getScalar(i, {});
|
|
477
477
|
}
|
|
478
|
-
return this.
|
|
478
|
+
return this.bu(this.au * index, endian);
|
|
479
479
|
}
|
|
480
480
|
/**
|
|
481
481
|
* Gets a scalar value at the specified index with a composition offset.
|
|
@@ -489,7 +489,7 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
489
489
|
if (indicesAccessor) {
|
|
490
490
|
index = indicesAccessor.getScalar(i, {});
|
|
491
491
|
}
|
|
492
|
-
return this.
|
|
492
|
+
return this.bu(this.au * index + compositionOffset, endian);
|
|
493
493
|
}
|
|
494
494
|
/**
|
|
495
495
|
* Gets a 2D vector as an array at the specified index.
|
|
@@ -504,8 +504,8 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
504
504
|
}
|
|
505
505
|
const byteSize = this.componentSizeInBytes;
|
|
506
506
|
return [
|
|
507
|
-
this.
|
|
508
|
-
this.
|
|
507
|
+
this.bu(this.au * index, endian),
|
|
508
|
+
this.bu(this.au * index + 1 * byteSize, endian)
|
|
509
509
|
];
|
|
510
510
|
}
|
|
511
511
|
/**
|
|
@@ -521,9 +521,9 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
521
521
|
}
|
|
522
522
|
const byteSize = this.componentSizeInBytes;
|
|
523
523
|
return [
|
|
524
|
-
this.
|
|
525
|
-
this.
|
|
526
|
-
this.
|
|
524
|
+
this.bu(this.au * index, endian),
|
|
525
|
+
this.bu(this.au * index + 1 * byteSize, endian),
|
|
526
|
+
this.bu(this.au * index + 2 * byteSize, endian)
|
|
527
527
|
];
|
|
528
528
|
}
|
|
529
529
|
/**
|
|
@@ -539,10 +539,10 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
539
539
|
}
|
|
540
540
|
const byteSize = this.componentSizeInBytes;
|
|
541
541
|
return [
|
|
542
|
-
this.
|
|
543
|
-
this.
|
|
544
|
-
this.
|
|
545
|
-
this.
|
|
542
|
+
this.bu(this.au * index, endian),
|
|
543
|
+
this.bu(this.au * index + 1 * byteSize, endian),
|
|
544
|
+
this.bu(this.au * index + 2 * byteSize, endian),
|
|
545
|
+
this.bu(this.au * index + 3 * byteSize, endian)
|
|
546
546
|
];
|
|
547
547
|
}
|
|
548
548
|
/**
|
|
@@ -558,15 +558,15 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
558
558
|
}
|
|
559
559
|
const byteSize = this.componentSizeInBytes;
|
|
560
560
|
return [
|
|
561
|
-
this.
|
|
562
|
-
this.
|
|
563
|
-
this.
|
|
564
|
-
this.
|
|
565
|
-
this.
|
|
566
|
-
this.
|
|
567
|
-
this.
|
|
568
|
-
this.
|
|
569
|
-
this.
|
|
561
|
+
this.bu(this.au * index, endian),
|
|
562
|
+
this.bu(this.au * index + 1 * byteSize, endian),
|
|
563
|
+
this.bu(this.au * index + 2 * byteSize, endian),
|
|
564
|
+
this.bu(this.au * index + 3 * byteSize, endian),
|
|
565
|
+
this.bu(this.au * index + 4 * byteSize, endian),
|
|
566
|
+
this.bu(this.au * index + 5 * byteSize, endian),
|
|
567
|
+
this.bu(this.au * index + 6 * byteSize, endian),
|
|
568
|
+
this.bu(this.au * index + 7 * byteSize, endian),
|
|
569
|
+
this.bu(this.au * index + 8 * byteSize, endian)
|
|
570
570
|
];
|
|
571
571
|
}
|
|
572
572
|
/**
|
|
@@ -582,22 +582,22 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
582
582
|
}
|
|
583
583
|
const byteSize = this.componentSizeInBytes;
|
|
584
584
|
return [
|
|
585
|
-
this.
|
|
586
|
-
this.
|
|
587
|
-
this.
|
|
588
|
-
this.
|
|
589
|
-
this.
|
|
590
|
-
this.
|
|
591
|
-
this.
|
|
592
|
-
this.
|
|
593
|
-
this.
|
|
594
|
-
this.
|
|
595
|
-
this.
|
|
596
|
-
this.
|
|
597
|
-
this.
|
|
598
|
-
this.
|
|
599
|
-
this.
|
|
600
|
-
this.
|
|
585
|
+
this.bu(this.au * index, endian),
|
|
586
|
+
this.bu(this.au * index + 1 * byteSize, endian),
|
|
587
|
+
this.bu(this.au * index + 2 * byteSize, endian),
|
|
588
|
+
this.bu(this.au * index + 3 * byteSize, endian),
|
|
589
|
+
this.bu(this.au * index + 4 * byteSize, endian),
|
|
590
|
+
this.bu(this.au * index + 5 * byteSize, endian),
|
|
591
|
+
this.bu(this.au * index + 6 * byteSize, endian),
|
|
592
|
+
this.bu(this.au * index + 7 * byteSize, endian),
|
|
593
|
+
this.bu(this.au * index + 8 * byteSize, endian),
|
|
594
|
+
this.bu(this.au * index + 9 * byteSize, endian),
|
|
595
|
+
this.bu(this.au * index + 10 * byteSize, endian),
|
|
596
|
+
this.bu(this.au * index + 11 * byteSize, endian),
|
|
597
|
+
this.bu(this.au * index + 12 * byteSize, endian),
|
|
598
|
+
this.bu(this.au * index + 13 * byteSize, endian),
|
|
599
|
+
this.bu(this.au * index + 14 * byteSize, endian),
|
|
600
|
+
this.bu(this.au * index + 15 * byteSize, endian)
|
|
601
601
|
];
|
|
602
602
|
}
|
|
603
603
|
/**
|
|
@@ -613,8 +613,8 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
613
613
|
}
|
|
614
614
|
const byteSize = this.componentSizeInBytes;
|
|
615
615
|
return Vector2.fromCopyArray2([
|
|
616
|
-
this.
|
|
617
|
-
this.
|
|
616
|
+
this.bu(this.au * index, endian),
|
|
617
|
+
this.bu(this.au * index + 1 * byteSize, endian)
|
|
618
618
|
]);
|
|
619
619
|
}
|
|
620
620
|
/**
|
|
@@ -630,9 +630,9 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
630
630
|
}
|
|
631
631
|
const byteSize = this.componentSizeInBytes;
|
|
632
632
|
return Vector3.fromCopyArray([
|
|
633
|
-
this.
|
|
634
|
-
this.
|
|
635
|
-
this.
|
|
633
|
+
this.bu(this.au * index, endian),
|
|
634
|
+
this.bu(this.au * index + 1 * byteSize, endian),
|
|
635
|
+
this.bu(this.au * index + 2 * byteSize, endian)
|
|
636
636
|
]);
|
|
637
637
|
}
|
|
638
638
|
/**
|
|
@@ -648,10 +648,10 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
648
648
|
}
|
|
649
649
|
const byteSize = this.componentSizeInBytes;
|
|
650
650
|
return Vector4.fromCopyArray([
|
|
651
|
-
this.
|
|
652
|
-
this.
|
|
653
|
-
this.
|
|
654
|
-
this.
|
|
651
|
+
this.bu(this.au * index, endian),
|
|
652
|
+
this.bu(this.au * index + 1 * byteSize, endian),
|
|
653
|
+
this.bu(this.au * index + 2 * byteSize, endian),
|
|
654
|
+
this.bu(this.au * index + 3 * byteSize, endian)
|
|
655
655
|
]);
|
|
656
656
|
}
|
|
657
657
|
/**
|
|
@@ -667,15 +667,15 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
667
667
|
}
|
|
668
668
|
const byteSize = this.componentSizeInBytes;
|
|
669
669
|
return Matrix33.fromCopy9RowMajor(
|
|
670
|
-
this.
|
|
671
|
-
this.
|
|
672
|
-
this.
|
|
673
|
-
this.
|
|
674
|
-
this.
|
|
675
|
-
this.
|
|
676
|
-
this.
|
|
677
|
-
this.
|
|
678
|
-
this.
|
|
670
|
+
this.bu(this.au * index, endian),
|
|
671
|
+
this.bu(this.au * index + 1 * byteSize, endian),
|
|
672
|
+
this.bu(this.au * index + 2 * byteSize, endian),
|
|
673
|
+
this.bu(this.au * index + 3 * byteSize, endian),
|
|
674
|
+
this.bu(this.au * index + 4 * byteSize, endian),
|
|
675
|
+
this.bu(this.au * index + 5 * byteSize, endian),
|
|
676
|
+
this.bu(this.au * index + 6 * byteSize, endian),
|
|
677
|
+
this.bu(this.au * index + 7 * byteSize, endian),
|
|
678
|
+
this.bu(this.au * index + 8 * byteSize, endian)
|
|
679
679
|
);
|
|
680
680
|
}
|
|
681
681
|
/**
|
|
@@ -691,22 +691,22 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
691
691
|
}
|
|
692
692
|
const byteSize = this.componentSizeInBytes;
|
|
693
693
|
return MutableMatrix44.fromCopy16RowMajor(
|
|
694
|
-
this.
|
|
695
|
-
this.
|
|
696
|
-
this.
|
|
697
|
-
this.
|
|
698
|
-
this.
|
|
699
|
-
this.
|
|
700
|
-
this.
|
|
701
|
-
this.
|
|
702
|
-
this.
|
|
703
|
-
this.
|
|
704
|
-
this.
|
|
705
|
-
this.
|
|
706
|
-
this.
|
|
707
|
-
this.
|
|
708
|
-
this.
|
|
709
|
-
this.
|
|
694
|
+
this.bu(this.au * index, endian),
|
|
695
|
+
this.bu(this.au * index + 1 * byteSize, endian),
|
|
696
|
+
this.bu(this.au * index + 2 * byteSize, endian),
|
|
697
|
+
this.bu(this.au * index + 3 * byteSize, endian),
|
|
698
|
+
this.bu(this.au * index + 4 * byteSize, endian),
|
|
699
|
+
this.bu(this.au * index + 5 * byteSize, endian),
|
|
700
|
+
this.bu(this.au * index + 6 * byteSize, endian),
|
|
701
|
+
this.bu(this.au * index + 7 * byteSize, endian),
|
|
702
|
+
this.bu(this.au * index + 8 * byteSize, endian),
|
|
703
|
+
this.bu(this.au * index + 9 * byteSize, endian),
|
|
704
|
+
this.bu(this.au * index + 10 * byteSize, endian),
|
|
705
|
+
this.bu(this.au * index + 11 * byteSize, endian),
|
|
706
|
+
this.bu(this.au * index + 12 * byteSize, endian),
|
|
707
|
+
this.bu(this.au * index + 13 * byteSize, endian),
|
|
708
|
+
this.bu(this.au * index + 14 * byteSize, endian),
|
|
709
|
+
this.bu(this.au * index + 15 * byteSize, endian)
|
|
710
710
|
);
|
|
711
711
|
}
|
|
712
712
|
/**
|
|
@@ -724,8 +724,8 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
724
724
|
}
|
|
725
725
|
const byteSize = this.componentSizeInBytes;
|
|
726
726
|
return out.setComponents(
|
|
727
|
-
this.
|
|
728
|
-
this.
|
|
727
|
+
this.bu(this.au * index, endian),
|
|
728
|
+
this.bu(this.au * index + 1 * byteSize, endian)
|
|
729
729
|
);
|
|
730
730
|
}
|
|
731
731
|
/**
|
|
@@ -743,9 +743,9 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
743
743
|
}
|
|
744
744
|
const byteSize = this.componentSizeInBytes;
|
|
745
745
|
return out.setComponents(
|
|
746
|
-
this.
|
|
747
|
-
this.
|
|
748
|
-
this.
|
|
746
|
+
this.bu(this.au * index, endian),
|
|
747
|
+
this.bu(this.au * index + 1 * byteSize, endian),
|
|
748
|
+
this.bu(this.au * index + 2 * byteSize, endian)
|
|
749
749
|
);
|
|
750
750
|
}
|
|
751
751
|
/**
|
|
@@ -763,10 +763,10 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
763
763
|
}
|
|
764
764
|
const byteSize = this.componentSizeInBytes;
|
|
765
765
|
return out.setComponents(
|
|
766
|
-
this.
|
|
767
|
-
this.
|
|
768
|
-
this.
|
|
769
|
-
this.
|
|
766
|
+
this.bu(this.au * index, endian),
|
|
767
|
+
this.bu(this.au * index + 1 * byteSize, endian),
|
|
768
|
+
this.bu(this.au * index + 2 * byteSize, endian),
|
|
769
|
+
this.bu(this.au * index + 3 * byteSize, endian)
|
|
770
770
|
);
|
|
771
771
|
}
|
|
772
772
|
/**
|
|
@@ -784,15 +784,15 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
784
784
|
}
|
|
785
785
|
const byteSize = this.componentSizeInBytes;
|
|
786
786
|
return out.setComponents(
|
|
787
|
-
this.
|
|
788
|
-
this.
|
|
789
|
-
this.
|
|
790
|
-
this.
|
|
791
|
-
this.
|
|
792
|
-
this.
|
|
793
|
-
this.
|
|
794
|
-
this.
|
|
795
|
-
this.
|
|
787
|
+
this.bu(this.au * index, endian),
|
|
788
|
+
this.bu(this.au * index + 1 * byteSize, endian),
|
|
789
|
+
this.bu(this.au * index + 2 * byteSize, endian),
|
|
790
|
+
this.bu(this.au * index + 3 * byteSize, endian),
|
|
791
|
+
this.bu(this.au * index + 4 * byteSize, endian),
|
|
792
|
+
this.bu(this.au * index + 5 * byteSize, endian),
|
|
793
|
+
this.bu(this.au * index + 6 * byteSize, endian),
|
|
794
|
+
this.bu(this.au * index + 7 * byteSize, endian),
|
|
795
|
+
this.bu(this.au * index + 8 * byteSize, endian)
|
|
796
796
|
);
|
|
797
797
|
}
|
|
798
798
|
/**
|
|
@@ -810,22 +810,22 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
810
810
|
}
|
|
811
811
|
const byteSize = this.componentSizeInBytes;
|
|
812
812
|
return out.setComponents(
|
|
813
|
-
this.
|
|
814
|
-
this.
|
|
815
|
-
this.
|
|
816
|
-
this.
|
|
817
|
-
this.
|
|
818
|
-
this.
|
|
819
|
-
this.
|
|
820
|
-
this.
|
|
821
|
-
this.
|
|
822
|
-
this.
|
|
823
|
-
this.
|
|
824
|
-
this.
|
|
825
|
-
this.
|
|
826
|
-
this.
|
|
827
|
-
this.
|
|
828
|
-
this.
|
|
813
|
+
this.bu(this.au * index, endian),
|
|
814
|
+
this.bu(this.au * index + 1 * byteSize, endian),
|
|
815
|
+
this.bu(this.au * index + 2 * byteSize, endian),
|
|
816
|
+
this.bu(this.au * index + 3 * byteSize, endian),
|
|
817
|
+
this.bu(this.au * index + 4 * byteSize, endian),
|
|
818
|
+
this.bu(this.au * index + 5 * byteSize, endian),
|
|
819
|
+
this.bu(this.au * index + 6 * byteSize, endian),
|
|
820
|
+
this.bu(this.au * index + 7 * byteSize, endian),
|
|
821
|
+
this.bu(this.au * index + 8 * byteSize, endian),
|
|
822
|
+
this.bu(this.au * index + 9 * byteSize, endian),
|
|
823
|
+
this.bu(this.au * index + 10 * byteSize, endian),
|
|
824
|
+
this.bu(this.au * index + 11 * byteSize, endian),
|
|
825
|
+
this.bu(this.au * index + 12 * byteSize, endian),
|
|
826
|
+
this.bu(this.au * index + 13 * byteSize, endian),
|
|
827
|
+
this.bu(this.au * index + 14 * byteSize, endian),
|
|
828
|
+
this.bu(this.au * index + 15 * byteSize, endian)
|
|
829
829
|
);
|
|
830
830
|
}
|
|
831
831
|
/**
|
|
@@ -839,9 +839,9 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
839
839
|
if (indicesAccessor) {
|
|
840
840
|
index = indicesAccessor.getScalar(i, {});
|
|
841
841
|
}
|
|
842
|
-
this.
|
|
843
|
-
this.
|
|
844
|
-
this.
|
|
842
|
+
this.cu(this.au * index, value, endian);
|
|
843
|
+
this.du = true;
|
|
844
|
+
this.gu();
|
|
845
845
|
}
|
|
846
846
|
/**
|
|
847
847
|
* Sets a 2D vector at the specified index.
|
|
@@ -856,10 +856,10 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
856
856
|
index = indicesAccessor.getScalar(i, {});
|
|
857
857
|
}
|
|
858
858
|
const sizeInBytes = this.componentSizeInBytes;
|
|
859
|
-
this.
|
|
860
|
-
this.
|
|
861
|
-
this.
|
|
862
|
-
this.
|
|
859
|
+
this.cu(this.au * index, x, endian);
|
|
860
|
+
this.cu(this.au * index + 1 * sizeInBytes, y, endian);
|
|
861
|
+
this.du = true;
|
|
862
|
+
this.gu();
|
|
863
863
|
}
|
|
864
864
|
/**
|
|
865
865
|
* Sets a 3D vector at the specified index.
|
|
@@ -875,11 +875,11 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
875
875
|
index = indicesAccessor.getScalar(i, {});
|
|
876
876
|
}
|
|
877
877
|
const sizeInBytes = this.componentSizeInBytes;
|
|
878
|
-
this.
|
|
879
|
-
this.
|
|
880
|
-
this.
|
|
881
|
-
this.
|
|
882
|
-
this.
|
|
878
|
+
this.cu(this.au * index, x, endian);
|
|
879
|
+
this.cu(this.au * index + 1 * sizeInBytes, y, endian);
|
|
880
|
+
this.cu(this.au * index + 2 * sizeInBytes, z, endian);
|
|
881
|
+
this.du = true;
|
|
882
|
+
this.gu();
|
|
883
883
|
}
|
|
884
884
|
/**
|
|
885
885
|
* Sets a 4D vector at the specified index.
|
|
@@ -896,12 +896,12 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
896
896
|
index = indicesAccessor.getScalar(i, {});
|
|
897
897
|
}
|
|
898
898
|
const sizeInBytes = this.componentSizeInBytes;
|
|
899
|
-
this.
|
|
900
|
-
this.
|
|
901
|
-
this.
|
|
902
|
-
this.
|
|
903
|
-
this.
|
|
904
|
-
this.
|
|
899
|
+
this.cu(this.au * index, x, endian);
|
|
900
|
+
this.cu(this.au * index + 1 * sizeInBytes, y, endian);
|
|
901
|
+
this.cu(this.au * index + 2 * sizeInBytes, z, endian);
|
|
902
|
+
this.cu(this.au * index + 3 * sizeInBytes, w, endian);
|
|
903
|
+
this.du = true;
|
|
904
|
+
this.gu();
|
|
905
905
|
}
|
|
906
906
|
/**
|
|
907
907
|
* Sets a 3x3 matrix at the specified index.
|
|
@@ -923,17 +923,17 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
923
923
|
index = indicesAccessor.getScalar(i, {});
|
|
924
924
|
}
|
|
925
925
|
const sizeInBytes = this.componentSizeInBytes;
|
|
926
|
-
this.
|
|
927
|
-
this.
|
|
928
|
-
this.
|
|
929
|
-
this.
|
|
930
|
-
this.
|
|
931
|
-
this.
|
|
932
|
-
this.
|
|
933
|
-
this.
|
|
934
|
-
this.
|
|
935
|
-
this.
|
|
936
|
-
this.
|
|
926
|
+
this.cu(this.au * index, v0, endian);
|
|
927
|
+
this.cu(this.au * index + 1 * sizeInBytes, v1, endian);
|
|
928
|
+
this.cu(this.au * index + 2 * sizeInBytes, v2, endian);
|
|
929
|
+
this.cu(this.au * index + 3 * sizeInBytes, v3, endian);
|
|
930
|
+
this.cu(this.au * index + 4 * sizeInBytes, v4, endian);
|
|
931
|
+
this.cu(this.au * index + 5 * sizeInBytes, v5, endian);
|
|
932
|
+
this.cu(this.au * index + 6 * sizeInBytes, v6, endian);
|
|
933
|
+
this.cu(this.au * index + 7 * sizeInBytes, v7, endian);
|
|
934
|
+
this.cu(this.au * index + 8 * sizeInBytes, v8, endian);
|
|
935
|
+
this.du = true;
|
|
936
|
+
this.gu();
|
|
937
937
|
}
|
|
938
938
|
/**
|
|
939
939
|
* Sets a 4x4 matrix at the specified index.
|
|
@@ -962,24 +962,24 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
962
962
|
index = indicesAccessor.getScalar(i, {});
|
|
963
963
|
}
|
|
964
964
|
const sizeInBytes = this.componentSizeInBytes;
|
|
965
|
-
this.
|
|
966
|
-
this.
|
|
967
|
-
this.
|
|
968
|
-
this.
|
|
969
|
-
this.
|
|
970
|
-
this.
|
|
971
|
-
this.
|
|
972
|
-
this.
|
|
973
|
-
this.
|
|
974
|
-
this.
|
|
975
|
-
this.
|
|
976
|
-
this.
|
|
977
|
-
this.
|
|
978
|
-
this.
|
|
979
|
-
this.
|
|
980
|
-
this.
|
|
981
|
-
this.
|
|
982
|
-
this.
|
|
965
|
+
this.cu(this.au * index, v0, endian);
|
|
966
|
+
this.cu(this.au * index + 1 * sizeInBytes, v1, endian);
|
|
967
|
+
this.cu(this.au * index + 2 * sizeInBytes, v2, endian);
|
|
968
|
+
this.cu(this.au * index + 3 * sizeInBytes, v3, endian);
|
|
969
|
+
this.cu(this.au * index + 4 * sizeInBytes, v4, endian);
|
|
970
|
+
this.cu(this.au * index + 5 * sizeInBytes, v5, endian);
|
|
971
|
+
this.cu(this.au * index + 6 * sizeInBytes, v6, endian);
|
|
972
|
+
this.cu(this.au * index + 7 * sizeInBytes, v7, endian);
|
|
973
|
+
this.cu(this.au * index + 8 * sizeInBytes, v8, endian);
|
|
974
|
+
this.cu(this.au * index + 9 * sizeInBytes, v9, endian);
|
|
975
|
+
this.cu(this.au * index + 10 * sizeInBytes, v10, endian);
|
|
976
|
+
this.cu(this.au * index + 11 * sizeInBytes, v11, endian);
|
|
977
|
+
this.cu(this.au * index + 12 * sizeInBytes, v12, endian);
|
|
978
|
+
this.cu(this.au * index + 13 * sizeInBytes, v13, endian);
|
|
979
|
+
this.cu(this.au * index + 14 * sizeInBytes, v14, endian);
|
|
980
|
+
this.cu(this.au * index + 15 * sizeInBytes, v15, endian);
|
|
981
|
+
this.du = true;
|
|
982
|
+
this.gu();
|
|
983
983
|
}
|
|
984
984
|
/**
|
|
985
985
|
* Sets a 2D vector at the specified index using a Vector2 object.
|
|
@@ -993,10 +993,10 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
993
993
|
index = indicesAccessor.getScalar(i, {});
|
|
994
994
|
}
|
|
995
995
|
const sizeInBytes = this.componentSizeInBytes;
|
|
996
|
-
this.
|
|
997
|
-
this.
|
|
998
|
-
this.
|
|
999
|
-
this.
|
|
996
|
+
this.cu(this.au * index, vec.x, endian);
|
|
997
|
+
this.cu(this.au * index + 1 * sizeInBytes, vec.y, endian);
|
|
998
|
+
this.du = true;
|
|
999
|
+
this.gu();
|
|
1000
1000
|
}
|
|
1001
1001
|
/**
|
|
1002
1002
|
* Sets a 3D vector at the specified index using a Vector3 object.
|
|
@@ -1010,11 +1010,11 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
1010
1010
|
index = indicesAccessor.getScalar(i, {});
|
|
1011
1011
|
}
|
|
1012
1012
|
const sizeInBytes = this.componentSizeInBytes;
|
|
1013
|
-
this.
|
|
1014
|
-
this.
|
|
1015
|
-
this.
|
|
1016
|
-
this.
|
|
1017
|
-
this.
|
|
1013
|
+
this.cu(this.au * index, vec.x, endian);
|
|
1014
|
+
this.cu(this.au * index + 1 * sizeInBytes, vec.y, endian);
|
|
1015
|
+
this.cu(this.au * index + 2 * sizeInBytes, vec.z, endian);
|
|
1016
|
+
this.du = true;
|
|
1017
|
+
this.gu();
|
|
1018
1018
|
}
|
|
1019
1019
|
/**
|
|
1020
1020
|
* Sets a 4D vector at the specified index using a Vector4 object.
|
|
@@ -1028,12 +1028,12 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
1028
1028
|
index = indicesAccessor.getScalar(i, {});
|
|
1029
1029
|
}
|
|
1030
1030
|
const sizeInBytes = this.componentSizeInBytes;
|
|
1031
|
-
this.
|
|
1032
|
-
this.
|
|
1033
|
-
this.
|
|
1034
|
-
this.
|
|
1035
|
-
this.
|
|
1036
|
-
this.
|
|
1031
|
+
this.cu(this.au * index, vec.x, endian);
|
|
1032
|
+
this.cu(this.au * index + 1 * sizeInBytes, vec.y, endian);
|
|
1033
|
+
this.cu(this.au * index + 2 * sizeInBytes, vec.z, endian);
|
|
1034
|
+
this.cu(this.au * index + 3 * sizeInBytes, vec.w, endian);
|
|
1035
|
+
this.du = true;
|
|
1036
|
+
this.gu();
|
|
1037
1037
|
}
|
|
1038
1038
|
/**
|
|
1039
1039
|
* Sets a 4x4 matrix at the specified index using a Matrix44 object.
|
|
@@ -1047,24 +1047,24 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
1047
1047
|
index = indicesAccessor.getScalar(i, {});
|
|
1048
1048
|
}
|
|
1049
1049
|
const sizeInBytes = this.componentSizeInBytes;
|
|
1050
|
-
this.
|
|
1051
|
-
this.
|
|
1052
|
-
this.
|
|
1053
|
-
this.
|
|
1054
|
-
this.
|
|
1055
|
-
this.
|
|
1056
|
-
this.
|
|
1057
|
-
this.
|
|
1058
|
-
this.
|
|
1059
|
-
this.
|
|
1060
|
-
this.
|
|
1061
|
-
this.
|
|
1062
|
-
this.
|
|
1063
|
-
this.
|
|
1064
|
-
this.
|
|
1065
|
-
this.
|
|
1066
|
-
this.
|
|
1067
|
-
this.
|
|
1050
|
+
this.cu(this.au * index, mat._v[0], endian);
|
|
1051
|
+
this.cu(this.au * index + 1 * sizeInBytes, mat._v[1], endian);
|
|
1052
|
+
this.cu(this.au * index + 2 * sizeInBytes, mat._v[2], endian);
|
|
1053
|
+
this.cu(this.au * index + 3 * sizeInBytes, mat._v[3], endian);
|
|
1054
|
+
this.cu(this.au * index + 4 * sizeInBytes, mat._v[4], endian);
|
|
1055
|
+
this.cu(this.au * index + 5 * sizeInBytes, mat._v[5], endian);
|
|
1056
|
+
this.cu(this.au * index + 6 * sizeInBytes, mat._v[6], endian);
|
|
1057
|
+
this.cu(this.au * index + 7 * sizeInBytes, mat._v[7], endian);
|
|
1058
|
+
this.cu(this.au * index + 8 * sizeInBytes, mat._v[8], endian);
|
|
1059
|
+
this.cu(this.au * index + 9 * sizeInBytes, mat._v[9], endian);
|
|
1060
|
+
this.cu(this.au * index + 10 * sizeInBytes, mat._v[10], endian);
|
|
1061
|
+
this.cu(this.au * index + 11 * sizeInBytes, mat._v[11], endian);
|
|
1062
|
+
this.cu(this.au * index + 12 * sizeInBytes, mat._v[12], endian);
|
|
1063
|
+
this.cu(this.au * index + 13 * sizeInBytes, mat._v[13], endian);
|
|
1064
|
+
this.cu(this.au * index + 14 * sizeInBytes, mat._v[14], endian);
|
|
1065
|
+
this.cu(this.au * index + 15 * sizeInBytes, mat._v[15], endian);
|
|
1066
|
+
this.du = true;
|
|
1067
|
+
this.gu();
|
|
1068
1068
|
}
|
|
1069
1069
|
/**
|
|
1070
1070
|
* Copies data from a TypedArray into this accessor.
|
|
@@ -1093,8 +1093,8 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
1093
1093
|
throw new Error("Other than vectors are currently not supported.");
|
|
1094
1094
|
}
|
|
1095
1095
|
}
|
|
1096
|
-
this.
|
|
1097
|
-
this.
|
|
1096
|
+
this.du = true;
|
|
1097
|
+
this.gu();
|
|
1098
1098
|
}
|
|
1099
1099
|
/**
|
|
1100
1100
|
* Sets a scalar value at the specified index with a composition offset.
|
|
@@ -1108,9 +1108,9 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
1108
1108
|
if (indicesAccessor) {
|
|
1109
1109
|
index = indicesAccessor.getScalar(i, {});
|
|
1110
1110
|
}
|
|
1111
|
-
this.
|
|
1112
|
-
this.
|
|
1113
|
-
this.
|
|
1111
|
+
this.cu(this.au * index + compositionOffset, value, endian);
|
|
1112
|
+
this.du = true;
|
|
1113
|
+
this.gu();
|
|
1114
1114
|
}
|
|
1115
1115
|
/**
|
|
1116
1116
|
* Sets an element from another accessor with the same composition type.
|
|
@@ -1129,20 +1129,20 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
1129
1129
|
} else if (this.compositionType.getNumberOfComponents() === 4) {
|
|
1130
1130
|
this.setVec4AsVector(i, accessor.getVec4(j, {}), {});
|
|
1131
1131
|
}
|
|
1132
|
-
this.
|
|
1133
|
-
this.
|
|
1132
|
+
this.du = true;
|
|
1133
|
+
this.gu();
|
|
1134
1134
|
}
|
|
1135
1135
|
/**
|
|
1136
1136
|
* Copies the entire buffer from another accessor.
|
|
1137
1137
|
* @param accessor - The source accessor to copy the buffer from
|
|
1138
1138
|
*/
|
|
1139
1139
|
copyBuffer(accessor) {
|
|
1140
|
-
new Uint8Array(this.
|
|
1141
|
-
new Uint8Array(accessor.
|
|
1142
|
-
this.
|
|
1140
|
+
new Uint8Array(this.Mj).set(
|
|
1141
|
+
new Uint8Array(accessor.Mj, accessor.fu, accessor.byteLength),
|
|
1142
|
+
this.fu
|
|
1143
1143
|
);
|
|
1144
|
-
this.
|
|
1145
|
-
this.
|
|
1144
|
+
this.du = true;
|
|
1145
|
+
this.gu();
|
|
1146
1146
|
}
|
|
1147
1147
|
/**
|
|
1148
1148
|
* Sets an element from another accessor, handling different composition types.
|
|
@@ -1205,8 +1205,8 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
1205
1205
|
this.setVec4AsVector(i, vec, {});
|
|
1206
1206
|
}
|
|
1207
1207
|
}
|
|
1208
|
-
this.
|
|
1209
|
-
this.
|
|
1208
|
+
this.du = true;
|
|
1209
|
+
this.gu();
|
|
1210
1210
|
}
|
|
1211
1211
|
/**
|
|
1212
1212
|
* Adds an element from another accessor with the same composition type, scaled by a coefficient.
|
|
@@ -1226,50 +1226,50 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
1226
1226
|
} else if (this.compositionType.getNumberOfComponents() === 4) {
|
|
1227
1227
|
this.setVec4AsVector(i, Vector4.add(this.getVec4(i, {}), Vector4.multiply(accessor.getVec4(j, {}), coeff)), {});
|
|
1228
1228
|
}
|
|
1229
|
-
this.
|
|
1230
|
-
this.
|
|
1229
|
+
this.du = true;
|
|
1230
|
+
this.gu();
|
|
1231
1231
|
}
|
|
1232
1232
|
/**
|
|
1233
1233
|
* Gets the underlying ArrayBuffer of the buffer view.
|
|
1234
1234
|
* @returns The ArrayBuffer containing the data
|
|
1235
1235
|
*/
|
|
1236
1236
|
get arrayBufferOfBufferView() {
|
|
1237
|
-
return this.
|
|
1237
|
+
return this.Mj;
|
|
1238
1238
|
}
|
|
1239
1239
|
/**
|
|
1240
1240
|
* Gets the DataView of the buffer view.
|
|
1241
1241
|
* @returns The DataView for accessing the buffer data
|
|
1242
1242
|
*/
|
|
1243
1243
|
get dataViewOfBufferView() {
|
|
1244
|
-
return this.
|
|
1244
|
+
return this.hu;
|
|
1245
1245
|
}
|
|
1246
1246
|
/**
|
|
1247
1247
|
* Gets the byte offset within the buffer view.
|
|
1248
1248
|
* @returns The byte offset in the buffer view
|
|
1249
1249
|
*/
|
|
1250
1250
|
get byteOffsetInBufferView() {
|
|
1251
|
-
return this.
|
|
1251
|
+
return this.fu - this.ku.byteOffsetInRawArrayBufferOfBuffer;
|
|
1252
1252
|
}
|
|
1253
1253
|
/**
|
|
1254
1254
|
* Gets the byte offset within the buffer.
|
|
1255
1255
|
* @returns The byte offset in the buffer
|
|
1256
1256
|
*/
|
|
1257
1257
|
get byteOffsetInBuffer() {
|
|
1258
|
-
return this.
|
|
1258
|
+
return this.fu - this.ku.buffer.byteOffsetInRawArrayBuffer;
|
|
1259
1259
|
}
|
|
1260
1260
|
/**
|
|
1261
1261
|
* Gets the byte offset in the raw ArrayBuffer of the buffer.
|
|
1262
1262
|
* @returns The byte offset in the raw ArrayBuffer
|
|
1263
1263
|
*/
|
|
1264
1264
|
get byteOffsetInRawArrayBufferOfBuffer() {
|
|
1265
|
-
return this.
|
|
1265
|
+
return this.fu;
|
|
1266
1266
|
}
|
|
1267
1267
|
/**
|
|
1268
1268
|
* Gets the BufferView that contains this accessor's data.
|
|
1269
1269
|
* @returns The BufferView object
|
|
1270
1270
|
*/
|
|
1271
1271
|
get bufferView() {
|
|
1272
|
-
return this.
|
|
1272
|
+
return this.ku;
|
|
1273
1273
|
}
|
|
1274
1274
|
/**
|
|
1275
1275
|
* Sets the minimum and maximum values for this accessor.
|
|
@@ -1279,31 +1279,31 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
1279
1279
|
setMinMax(min, max) {
|
|
1280
1280
|
const componentN = this.compositionType.getNumberOfComponents();
|
|
1281
1281
|
if (componentN === 1) {
|
|
1282
|
-
this.
|
|
1283
|
-
this.
|
|
1282
|
+
this.ot._v[0] = min[0];
|
|
1283
|
+
this.pt._v[0] = max[0];
|
|
1284
1284
|
} else if (componentN === 2) {
|
|
1285
|
-
this.
|
|
1286
|
-
this.
|
|
1287
|
-
this.
|
|
1288
|
-
this.
|
|
1285
|
+
this.ot._v[0] = min[0];
|
|
1286
|
+
this.ot._v[1] = min[1];
|
|
1287
|
+
this.pt._v[0] = max[0];
|
|
1288
|
+
this.pt._v[1] = max[1];
|
|
1289
1289
|
} else if (componentN === 3) {
|
|
1290
|
-
this.
|
|
1291
|
-
this.
|
|
1292
|
-
this.
|
|
1293
|
-
this.
|
|
1294
|
-
this.
|
|
1295
|
-
this.
|
|
1290
|
+
this.ot._v[0] = min[0];
|
|
1291
|
+
this.ot._v[1] = min[1];
|
|
1292
|
+
this.ot._v[2] = min[2];
|
|
1293
|
+
this.pt._v[0] = max[0];
|
|
1294
|
+
this.pt._v[1] = max[1];
|
|
1295
|
+
this.pt._v[2] = max[2];
|
|
1296
1296
|
} else if (componentN === 4) {
|
|
1297
|
-
this.
|
|
1298
|
-
this.
|
|
1299
|
-
this.
|
|
1300
|
-
this.
|
|
1301
|
-
this.
|
|
1302
|
-
this.
|
|
1303
|
-
this.
|
|
1304
|
-
this.
|
|
1297
|
+
this.ot._v[0] = min[0];
|
|
1298
|
+
this.ot._v[1] = min[1];
|
|
1299
|
+
this.ot._v[2] = min[2];
|
|
1300
|
+
this.ot._v[3] = min[3];
|
|
1301
|
+
this.pt._v[0] = max[0];
|
|
1302
|
+
this.pt._v[1] = max[1];
|
|
1303
|
+
this.pt._v[2] = max[2];
|
|
1304
|
+
this.pt._v[3] = max[3];
|
|
1305
1305
|
}
|
|
1306
|
-
this.
|
|
1306
|
+
this.du = false;
|
|
1307
1307
|
}
|
|
1308
1308
|
/**
|
|
1309
1309
|
* Gets the minimum values for each component.
|
|
@@ -1311,20 +1311,20 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
1311
1311
|
* @returns Array of minimum values
|
|
1312
1312
|
*/
|
|
1313
1313
|
get min() {
|
|
1314
|
-
if (this.
|
|
1315
|
-
this.
|
|
1314
|
+
if (this.du) {
|
|
1315
|
+
this.qu();
|
|
1316
1316
|
}
|
|
1317
1317
|
const componentN = this.compositionType.getNumberOfComponents();
|
|
1318
1318
|
if (componentN === 4) {
|
|
1319
|
-
return [this.
|
|
1319
|
+
return [this.ot._v[0], this.ot._v[1], this.ot._v[2], this.ot._v[3]];
|
|
1320
1320
|
}
|
|
1321
1321
|
if (componentN === 3) {
|
|
1322
|
-
return [this.
|
|
1322
|
+
return [this.ot._v[0], this.ot._v[1], this.ot._v[2]];
|
|
1323
1323
|
}
|
|
1324
1324
|
if (componentN === 2) {
|
|
1325
|
-
return [this.
|
|
1325
|
+
return [this.ot._v[0], this.ot._v[1]];
|
|
1326
1326
|
}
|
|
1327
|
-
return [this.
|
|
1327
|
+
return [this.ot._v[0]];
|
|
1328
1328
|
}
|
|
1329
1329
|
/**
|
|
1330
1330
|
* Gets the maximum values for each component.
|
|
@@ -1332,100 +1332,100 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
1332
1332
|
* @returns Array of maximum values
|
|
1333
1333
|
*/
|
|
1334
1334
|
get max() {
|
|
1335
|
-
if (this.
|
|
1336
|
-
this.
|
|
1335
|
+
if (this.du) {
|
|
1336
|
+
this.qu();
|
|
1337
1337
|
}
|
|
1338
1338
|
const componentN = this.compositionType.getNumberOfComponents();
|
|
1339
1339
|
if (componentN === 4) {
|
|
1340
|
-
return [this.
|
|
1340
|
+
return [this.pt._v[0], this.pt._v[1], this.pt._v[2], this.pt._v[3]];
|
|
1341
1341
|
}
|
|
1342
1342
|
if (componentN === 3) {
|
|
1343
|
-
return [this.
|
|
1343
|
+
return [this.pt._v[0], this.pt._v[1], this.pt._v[2]];
|
|
1344
1344
|
}
|
|
1345
1345
|
if (componentN === 2) {
|
|
1346
|
-
return [this.
|
|
1346
|
+
return [this.pt._v[0], this.pt._v[1]];
|
|
1347
1347
|
}
|
|
1348
|
-
return [this.
|
|
1348
|
+
return [this.pt._v[0]];
|
|
1349
1349
|
}
|
|
1350
1350
|
/**
|
|
1351
1351
|
* Gets whether the data should be normalized.
|
|
1352
1352
|
* @returns True if data should be normalized
|
|
1353
1353
|
*/
|
|
1354
1354
|
get normalized() {
|
|
1355
|
-
return this.
|
|
1355
|
+
return this.ou;
|
|
1356
1356
|
}
|
|
1357
1357
|
/**
|
|
1358
1358
|
* Calculates the minimum and maximum values for all elements.
|
|
1359
1359
|
* @private
|
|
1360
1360
|
*/
|
|
1361
|
-
|
|
1361
|
+
qu() {
|
|
1362
1362
|
const componentN = this.compositionType.getNumberOfComponents();
|
|
1363
1363
|
if (componentN === 4) {
|
|
1364
|
-
this.
|
|
1365
|
-
this.
|
|
1366
|
-
const vec4 = _Accessor.
|
|
1364
|
+
this.pt.setComponents(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
|
|
1365
|
+
this.ot.setComponents(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
|
|
1366
|
+
const vec4 = _Accessor.qn;
|
|
1367
1367
|
for (let i = 0; i < this.elementCount; i++) {
|
|
1368
1368
|
this.getVec4To(i, vec4, {});
|
|
1369
1369
|
for (let j = 0; j < 4; j++) {
|
|
1370
|
-
if (this.
|
|
1371
|
-
this.
|
|
1370
|
+
if (this.pt._v[j] < vec4._v[j]) {
|
|
1371
|
+
this.pt._v[j] = vec4._v[j];
|
|
1372
1372
|
}
|
|
1373
|
-
if (vec4._v[j] < this.
|
|
1374
|
-
this.
|
|
1373
|
+
if (vec4._v[j] < this.ot._v[j]) {
|
|
1374
|
+
this.ot._v[j] = vec4._v[j];
|
|
1375
1375
|
}
|
|
1376
1376
|
}
|
|
1377
1377
|
}
|
|
1378
1378
|
} else if (componentN === 3) {
|
|
1379
|
-
this.
|
|
1380
|
-
this.
|
|
1379
|
+
this.pt.setComponents(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
|
|
1380
|
+
this.ot.setComponents(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
|
|
1381
1381
|
const vec3 = _Accessor.Hc;
|
|
1382
1382
|
for (let i = 0; i < this.elementCount; i++) {
|
|
1383
1383
|
this.getVec3To(i, vec3, {});
|
|
1384
1384
|
for (let j = 0; j < 3; j++) {
|
|
1385
|
-
if (this.
|
|
1386
|
-
this.
|
|
1385
|
+
if (this.pt._v[j] < vec3._v[j]) {
|
|
1386
|
+
this.pt._v[j] = vec3._v[j];
|
|
1387
1387
|
}
|
|
1388
|
-
if (vec3._v[j] < this.
|
|
1389
|
-
this.
|
|
1388
|
+
if (vec3._v[j] < this.ot._v[j]) {
|
|
1389
|
+
this.ot._v[j] = vec3._v[j];
|
|
1390
1390
|
}
|
|
1391
1391
|
}
|
|
1392
1392
|
}
|
|
1393
1393
|
} else if (componentN === 2) {
|
|
1394
|
-
this.
|
|
1395
|
-
this.
|
|
1396
|
-
const vec2 = _Accessor.
|
|
1394
|
+
this.pt.setComponents(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
|
|
1395
|
+
this.ot.setComponents(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
|
|
1396
|
+
const vec2 = _Accessor.ru;
|
|
1397
1397
|
for (let i = 0; i < this.elementCount; i++) {
|
|
1398
1398
|
this.getVec2To(i, vec2, {});
|
|
1399
1399
|
for (let j = 0; j < 2; j++) {
|
|
1400
|
-
if (this.
|
|
1401
|
-
this.
|
|
1400
|
+
if (this.pt._v[j] < vec2._v[j]) {
|
|
1401
|
+
this.pt._v[j] = vec2._v[j];
|
|
1402
1402
|
}
|
|
1403
|
-
if (vec2._v[j] < this.
|
|
1404
|
-
this.
|
|
1403
|
+
if (vec2._v[j] < this.ot._v[j]) {
|
|
1404
|
+
this.ot._v[j] = vec2._v[j];
|
|
1405
1405
|
}
|
|
1406
1406
|
}
|
|
1407
1407
|
}
|
|
1408
1408
|
} else if (componentN === 1) {
|
|
1409
|
-
this.
|
|
1410
|
-
this.
|
|
1409
|
+
this.pt.setComponents(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
|
|
1410
|
+
this.ot.setComponents(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
|
|
1411
1411
|
for (let i = 0; i < this.elementCount; i++) {
|
|
1412
1412
|
const scalar = this.getScalar(i, {});
|
|
1413
|
-
if (this.
|
|
1414
|
-
this.
|
|
1413
|
+
if (this.pt._v[0] < scalar) {
|
|
1414
|
+
this.pt._v[0] = scalar;
|
|
1415
1415
|
}
|
|
1416
|
-
if (scalar < this.
|
|
1417
|
-
this.
|
|
1416
|
+
if (scalar < this.ot._v[0]) {
|
|
1417
|
+
this.ot._v[0] = scalar;
|
|
1418
1418
|
}
|
|
1419
1419
|
}
|
|
1420
1420
|
}
|
|
1421
|
-
this.
|
|
1421
|
+
this.du = false;
|
|
1422
1422
|
}
|
|
1423
1423
|
/**
|
|
1424
1424
|
* Gets whether the min/max values are dirty and need recalculation.
|
|
1425
1425
|
* @returns True if min/max values are dirty
|
|
1426
1426
|
*/
|
|
1427
1427
|
get isMinMaxDirty() {
|
|
1428
|
-
return this.
|
|
1428
|
+
return this.du;
|
|
1429
1429
|
}
|
|
1430
1430
|
/**
|
|
1431
1431
|
* Gets the version number of this accessor.
|
|
@@ -1433,18 +1433,18 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
1433
1433
|
* @returns The version number
|
|
1434
1434
|
*/
|
|
1435
1435
|
get version() {
|
|
1436
|
-
return this.
|
|
1436
|
+
return this.nu;
|
|
1437
1437
|
}
|
|
1438
1438
|
/**
|
|
1439
1439
|
* Gets the actual byte stride, accounting for zero stride.
|
|
1440
1440
|
* @returns The actual byte stride
|
|
1441
1441
|
*/
|
|
1442
1442
|
get actualByteStride() {
|
|
1443
|
-
if (this
|
|
1444
|
-
const actualByteStride = this.
|
|
1443
|
+
if (this.au === 0) {
|
|
1444
|
+
const actualByteStride = this.ft.getNumberOfComponents() * this.ht.getSizeInBytes() * this.ju;
|
|
1445
1445
|
return actualByteStride;
|
|
1446
1446
|
}
|
|
1447
|
-
return this
|
|
1447
|
+
return this.au;
|
|
1448
1448
|
}
|
|
1449
1449
|
/**
|
|
1450
1450
|
* Checks if this accessor is the same as another accessor.
|
|
@@ -1456,9 +1456,9 @@ So the typedArray data got by getTypedArray() is copied data, not reference to t
|
|
|
1456
1456
|
return this.byteLength === rnAccessor.byteLength && this.byteOffsetInRawArrayBufferOfBuffer === rnAccessor.byteOffsetInRawArrayBufferOfBuffer && this.bufferView.buffer.getArrayBuffer() === rnAccessor.bufferView.buffer.getArrayBuffer();
|
|
1457
1457
|
}
|
|
1458
1458
|
};
|
|
1459
|
-
_Accessor.
|
|
1459
|
+
_Accessor.qn = MutableVector4.zero();
|
|
1460
1460
|
_Accessor.Hc = MutableVector3.zero();
|
|
1461
|
-
_Accessor.
|
|
1461
|
+
_Accessor.ru = MutableVector2.zero();
|
|
1462
1462
|
var Accessor = _Accessor;
|
|
1463
1463
|
export {
|
|
1464
1464
|
Accessor
|