rhodonite 0.27.0 → 0.28.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/README.md +10 -10
- package/VERSION-FILE +1 -1
- package/dist/esm/effekseer/EffekseerComponent.js +3 -3
- package/dist/esm/foundation/components/Camera/CameraComponent.js +1 -1
- package/dist/esm/foundation/components/Light/LightComponent.d.ts +14 -0
- package/dist/esm/foundation/components/Light/LightComponent.js +1 -1
- package/dist/esm/foundation/components/Mesh/MeshComponent.js +1 -1
- package/dist/esm/foundation/components/MeshRenderer/MeshRendererComponent.d.ts +33 -5
- package/dist/esm/foundation/components/MeshRenderer/MeshRendererComponent.js +1 -1
- package/dist/esm/foundation/components/Physics/PhysicsComponent.js +1 -1
- package/dist/esm/foundation/components/Raymarching/RaymarchingSdfEvaluator.js +1 -1
- package/dist/esm/foundation/components/SceneGraph/SceneGraphComponent.js +1 -1
- package/dist/esm/foundation/components/Shape/ShapeComponent.js +1 -1
- package/dist/esm/foundation/components/Skeletal/AnimationRetarget/GlobalRetargetReverse.js +1 -1
- package/dist/esm/foundation/components/Skeletal/SkeletalComponent.js +1 -1
- package/dist/esm/foundation/components/Transform/TransformComponent.js +1 -1
- package/dist/esm/foundation/constraints/VrmRollConstraint.js +1 -1
- package/dist/esm/foundation/core/Component.js +1 -1
- package/dist/esm/foundation/core/Config.d.ts +15 -0
- package/dist/esm/foundation/core/Config.js +1 -1
- package/dist/esm/foundation/core/GlobalDataRepository.d.ts +3 -3
- package/dist/esm/foundation/core/GlobalDataRepository.js +1 -1
- package/dist/esm/foundation/definitions/RenderBackend.d.ts +21 -0
- package/dist/esm/foundation/definitions/RenderBackend.js +1 -0
- package/dist/esm/foundation/definitions/ShaderSemantics.js +1 -1
- package/dist/esm/foundation/definitions/ShaderSemanticsInfo.d.ts +1 -0
- package/dist/esm/foundation/definitions/ShaderSemanticsInfo.js +1 -1
- package/dist/esm/foundation/definitions/VertexAttribute.js +1 -1
- package/dist/esm/foundation/definitions/index.d.ts +1 -1
- package/dist/esm/foundation/definitions/index.js +1 -1
- package/dist/esm/foundation/exporter/Gltf2Exporter.d.ts +6 -0
- package/dist/esm/foundation/exporter/Gltf2Exporter.js +1 -1
- package/dist/esm/foundation/geometry/Frustum.js +1 -1
- package/dist/esm/foundation/geometry/Mesh.d.ts +33 -68
- package/dist/esm/foundation/geometry/Mesh.js +1 -1
- package/dist/esm/foundation/geometry/Primitive.d.ts +1 -1
- package/dist/esm/foundation/geometry/Primitive.js +1 -1
- package/dist/esm/foundation/geometry/shapes/Cylinder.js +1 -1
- package/dist/esm/foundation/geometry/shapes/Joint.js +1 -1
- package/dist/esm/foundation/gizmos/AABBGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/CapsuleColliderGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/Gizmo.js +1 -1
- package/dist/esm/foundation/gizmos/JointGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/LightGizmo.d.ts +108 -10
- package/dist/esm/foundation/gizmos/LightGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/LocatorGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/RotationGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/ScaleGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/ShapeGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/SphereColliderGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/TranslationGizmo.js +1 -1
- package/dist/esm/foundation/helpers/BloomHelper.js +1 -1
- package/dist/esm/foundation/helpers/GaussianBlurHelper.js +1 -1
- package/dist/esm/foundation/helpers/MaterialHelper.d.ts +2 -0
- package/dist/esm/foundation/helpers/MaterialHelper.js +1 -1
- package/dist/esm/foundation/helpers/Shadow/PointShadowMap.js +1 -1
- package/dist/esm/foundation/helpers/Shadow/ShadowCasterFilter.d.ts +8 -0
- package/dist/esm/foundation/helpers/Shadow/ShadowCasterFilter.js +1 -0
- package/dist/esm/foundation/helpers/Shadow/ShadowDirectionalAutoFit.d.ts +28 -0
- package/dist/esm/foundation/helpers/Shadow/ShadowDirectionalAutoFit.js +1 -0
- package/dist/esm/foundation/helpers/Shadow/ShadowMap.js +1 -1
- package/dist/esm/foundation/helpers/Shadow/ShadowSpotLightZNear.d.ts +8 -0
- package/dist/esm/foundation/helpers/Shadow/ShadowSpotLightZNear.js +1 -0
- package/dist/esm/foundation/helpers/Shadow/ShadowSystem.d.ts +1 -29
- package/dist/esm/foundation/helpers/Shadow/ShadowSystem.js +1 -1
- package/dist/esm/foundation/helpers/materials/createClassicUberMaterial.js +1 -1
- package/dist/esm/foundation/helpers/materials/createEnvConstantScreenSpaceMaterial.d.ts +21 -0
- package/dist/esm/foundation/helpers/materials/createEnvConstantScreenSpaceMaterial.js +1 -0
- package/dist/esm/foundation/helpers/materials/createGaussianBlurForEncodedDepthMaterial.js +1 -1
- package/dist/esm/foundation/helpers/materials/createGaussianBlurMaterial.js +1 -1
- package/dist/esm/foundation/helpers/materials/createMotionVectorMaterial.js +1 -1
- package/dist/esm/foundation/helpers/materials/createNodeBasedRaymarchingMaterials.js +1 -1
- package/dist/esm/foundation/helpers/materials/createPbrUberMaterial.js +1 -1
- package/dist/esm/foundation/helpers/materials/createTemporalAAResolveMaterial.js +1 -1
- package/dist/esm/foundation/helpers/materials/index.d.ts +1 -0
- package/dist/esm/foundation/helpers/materials/index.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.js +1 -1
- package/dist/esm/foundation/importer/GltfImporter.js +1 -1
- package/dist/esm/foundation/importer/ModelConverter.d.ts +19 -0
- package/dist/esm/foundation/importer/ModelConverter.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/ColorGradingUsingLUTsMaterialContent.d.ts +0 -20
- package/dist/esm/foundation/materials/contents/ColorGradingUsingLUTsMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/contents/CustomMaterialContent.d.ts +3 -1
- package/dist/esm/foundation/materials/contents/CustomMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/contents/DepthEncodeMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/contents/DetectHighLuminanceMaterialContent.d.ts +0 -16
- package/dist/esm/foundation/materials/contents/DetectHighLuminanceMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/contents/EntityUIDOutputMaterialContent.d.ts +0 -17
- package/dist/esm/foundation/materials/contents/EntityUIDOutputMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/contents/FurnaceTestMaterialContent.d.ts +0 -21
- package/dist/esm/foundation/materials/contents/FurnaceTestMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/contents/MToon0xMaterialContent.js +18 -18
- package/dist/esm/foundation/materials/contents/MToon1MaterialContent.js +6 -6
- package/dist/esm/foundation/materials/contents/MatCapMaterialContent.d.ts +0 -16
- package/dist/esm/foundation/materials/contents/MatCapMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/contents/ShadowMapDecodeClassicMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/contents/SynthesizeHdrMaterialContent.d.ts +0 -23
- package/dist/esm/foundation/materials/contents/SynthesizeHdrMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/contents/VarianceShadowMapDecodeClassicMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/core/AbstractMaterialContent.d.ts +6 -61
- package/dist/esm/foundation/materials/core/AbstractMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/core/AbstractShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/core/AbstractShaderNode.js +2 -2
- package/dist/esm/foundation/materials/core/Material.d.ts +7 -114
- package/dist/esm/foundation/materials/core/Material.js +1 -1
- package/dist/esm/foundation/materials/core/MaterialRepository.js +1 -1
- package/dist/esm/foundation/materials/core/ShaderGraphResolver.js +6 -6
- package/dist/esm/foundation/materials/core/ShaderNodeFactories.d.ts +23 -0
- package/dist/esm/foundation/materials/core/ShaderNodeFactories.js +1 -0
- package/dist/esm/foundation/materials/core/ShaderProgramDefinitions.d.ts +41 -0
- package/dist/esm/foundation/materials/core/ShaderProgramDefinitions.js +23 -0
- package/dist/esm/foundation/materials/core/ShaderityUtilityWebGL.js +2 -2
- package/dist/esm/foundation/materials/core/ShaderityUtilityWebGPU.js +2 -2
- package/dist/esm/foundation/materials/nodes/AbsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AcosShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AddShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AlphaTestShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AndShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/Atan2ShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AttributeColorShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AttributeInstanceIdsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AttributeJointShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AttributeNormalShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AttributePositionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AttributeTangentShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AttributeTexcoordShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AttributeWeightShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/BlockBeginShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/BlockEndShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/BranchShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/CalcBitangentShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/CastToFloatShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/CastToFloatShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/ClampShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/ClampShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/ClassicShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/ConstantVariableShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/CosShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/CosShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/DotProductShaderNode.d.ts +2 -2
- package/dist/esm/foundation/materials/nodes/DotProductShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/EqualShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/EqualShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/FlatShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/GreaterOrEqualShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/GreaterOrEqualShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/GreaterShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/GreaterThanShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/GreaterThanShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/LengthShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/LengthShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/LessOrEqualShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/LessOrEqualShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/LessThanShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/LessThanShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/MergeVectorShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/MinShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/MultiplyShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/MultiplyShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/NormalMatrixShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/NormalizeShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/NormalizeShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/NotEqualShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/NotEqualShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/OrShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrAnisotropyPropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrAnisotropyRotationShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrBaseColorPropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrClearcoatPropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrDiffuseTransmissionPropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrEmissivePropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrIridescencePropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrMetallicRoughnessPropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrNormalPropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrOcclusionPropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrShaderShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrSheenPropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrSpecularPropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrTransmissionPropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrVolumePropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PremultipliedAlphaShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/PremultipliedAlphaShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/ProcessGeometryShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/ProjectionMatrixShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/Random_HashPRNGShaderNode.js +2 -2
- package/dist/esm/foundation/materials/nodes/Random_SinHashShaderNode.js +2 -2
- package/dist/esm/foundation/materials/nodes/RemapShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/RemapShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/SinShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/SinShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/SmoothStepShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/SmoothStepShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/SplitVectorShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/SplitVectorShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/StepShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/TanShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/TanShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/Texture2DShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/TimeShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/TransformShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/TransformShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/UniformDataShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/ViewMatrixShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/WireframeMaterialNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/WorldMatrixShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/BendXYShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/BendXZShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/BendYXShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/BendYZShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/BendZXShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/BendZYShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/InitialPositionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/OpSmoothIntersectionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/OpSmoothSubtractionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/OpSmoothUnionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/OpSubtractionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/OpUnionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/OutDistanceShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/OutUnionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/RaymarchCameraPositionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/RaymarchHitDistanceShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/RaymarchHitNormalShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/RaymarchHitPositionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/RaymarchObjectIdShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/RaymarchObjectIdUniformShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/RaymarchRayDirectionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/RaymarchTBNShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/RaymarchViewDirectionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdApplyTransformShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdApplyWorldMatrixShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdBarXShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdBarYShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdBarZShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdBoxShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdCapsuleShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdRepeatShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdRepeatXShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdRepeatXYShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdRepeatYShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdRepeatYZShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdRepeatZShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdRepeatZXShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdRoundBoxShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdSphereShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdTorusShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdTubeXShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdTubeYShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdTubeZShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/TwistXShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/TwistYShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/TwistZShaderNode.js +1 -1
- package/dist/esm/foundation/math/IdentityMatrix33.js +2 -2
- package/dist/esm/foundation/math/IdentityMatrix44.js +2 -2
- package/dist/esm/foundation/math/MathClassUtil.js +1 -1
- package/dist/esm/foundation/math/MathUtil.d.ts +11 -0
- package/dist/esm/foundation/math/MathUtil.js +1 -1
- package/dist/esm/foundation/math/Quaternion.js +1 -1
- package/dist/esm/foundation/math/Transform3D.js +1 -1
- package/dist/esm/foundation/memory/Accessor.js +6 -6
- package/dist/esm/foundation/memory/Buffer.js +3 -3
- package/dist/esm/foundation/memory/BufferView.js +1 -1
- package/dist/esm/foundation/misc/Logger.js +1 -1
- package/dist/esm/foundation/misc/Time.js +1 -1
- package/dist/esm/foundation/physics/Rapier/RapierCharacterControllerStrategy.js +1 -1
- package/dist/esm/foundation/physics/Rapier/RapierPhysicsStrategy.js +1 -1
- package/dist/esm/foundation/physics/VRMSpring/CapsuleCollider.js +1 -1
- package/dist/esm/foundation/physics/VRMSpring/SphereCollider.js +1 -1
- package/dist/esm/foundation/physics/VRMSpring/VRMSpringBone.js +1 -1
- package/dist/esm/foundation/renderer/CGAPIResourceRepository.d.ts +74 -4
- package/dist/esm/foundation/renderer/CGAPIResourceRepository.js +1 -1
- package/dist/esm/foundation/renderer/Frame.js +1 -1
- package/dist/esm/foundation/renderer/FrameBuffer.js +1 -1
- package/dist/esm/foundation/renderer/FrameRenderer.d.ts +42 -0
- package/dist/esm/foundation/renderer/FrameRenderer.js +0 -0
- package/dist/esm/foundation/renderer/RenderPass.js +1 -1
- package/dist/esm/foundation/renderer/ShaderPropertyLayout.d.ts +77 -0
- package/dist/esm/foundation/renderer/ShaderPropertyLayout.js +1 -0
- package/dist/esm/foundation/renderer/TemporalAA/PreviousFrameDataTracker.js +1 -1
- package/dist/esm/foundation/renderer/TemporalAA/TemporalAASystem.d.ts +9 -3
- package/dist/esm/foundation/renderer/TemporalAA/TemporalAASystem.js +1 -1
- package/dist/esm/foundation/renderer/lightCluster/LightClusterSystem.d.ts +12 -0
- package/dist/esm/foundation/renderer/lightCluster/LightClusterSystem.js +1 -1
- package/dist/esm/foundation/renderer/lightCluster/LightClusterSystemStub.js +1 -1
- package/dist/esm/foundation/renderer/pipelines/DeferredRenderPipeline.js +1 -1
- package/dist/esm/foundation/renderer/pipelines/ForwardRenderPipeline.d.ts +82 -176
- package/dist/esm/foundation/renderer/pipelines/ForwardRenderPipeline.js +1 -1
- package/dist/esm/foundation/renderer/pipelines/RaymarchingRenderer.d.ts +263 -0
- package/dist/esm/foundation/renderer/pipelines/RaymarchingRenderer.js +1 -0
- package/dist/esm/foundation/system/Engine.d.ts +19 -44
- package/dist/esm/foundation/system/Engine.js +1 -1
- package/dist/esm/foundation/system/EngineState.d.ts +9 -3
- package/dist/esm/foundation/system/EngineState.js +1 -1
- package/dist/esm/foundation/system/GpuDriverWorkarounds.d.ts +50 -0
- package/dist/esm/foundation/system/GpuDriverWorkarounds.js +1 -0
- package/dist/esm/foundation/system/ModuleManager.js +1 -1
- package/dist/esm/foundation/system/index.d.ts +1 -0
- package/dist/esm/foundation/system/index.js +1 -1
- package/dist/esm/foundation/textures/AbstractReadableRenderTargetTexture.d.ts +39 -0
- package/dist/esm/foundation/textures/AbstractReadableRenderTargetTexture.js +1 -0
- package/dist/esm/foundation/textures/AbstractRenderTargetTexture.d.ts +60 -0
- package/dist/esm/foundation/textures/AbstractRenderTargetTexture.js +1 -0
- package/dist/esm/foundation/textures/AbstractTexture.js +1 -1
- package/dist/esm/foundation/textures/CubeTexture.js +1 -1
- package/dist/esm/foundation/textures/RenderBuffer.js +1 -1
- package/dist/esm/foundation/textures/RenderTargetTexture.d.ts +5 -67
- package/dist/esm/foundation/textures/RenderTargetTexture.js +1 -1
- package/dist/esm/foundation/textures/RenderTargetTexture2DArray.d.ts +5 -71
- package/dist/esm/foundation/textures/RenderTargetTexture2DArray.js +1 -1
- package/dist/esm/foundation/textures/RenderTargetTextureCube.d.ts +8 -50
- package/dist/esm/foundation/textures/RenderTargetTextureCube.js +1 -1
- package/dist/esm/foundation/textures/Texture.d.ts +19 -1
- package/dist/esm/foundation/textures/Texture.js +1 -1
- package/dist/esm/foundation/textures/TextureArray.js +1 -1
- package/dist/esm/foundation/textures/TextureDataFloat.js +1 -1
- package/dist/esm/foundation/textures/VideoTexture.d.ts +11 -0
- package/dist/esm/foundation/textures/VideoTexture.js +1 -1
- package/dist/esm/foundation/textures/decodeBasisImage.d.ts +14 -0
- package/dist/esm/foundation/textures/decodeBasisImage.js +1 -0
- package/dist/esm/foundation/textures/index.d.ts +2 -0
- package/dist/esm/foundation/textures/index.js +1 -1
- package/dist/esm/types/glTF2.d.ts +9 -0
- package/dist/esm/version.js +1 -1
- package/dist/esm/webgl/ComponentDataAccessorGLSL.d.ts +9 -0
- package/dist/esm/webgl/ComponentDataAccessorGLSL.js +27 -0
- package/dist/esm/webgl/InstanceSidTable.js +1 -1
- package/dist/esm/webgl/MultiDraw.d.ts +1 -1
- package/dist/esm/webgl/MultiDraw.js +1 -1
- package/dist/esm/webgl/MultiDrawRepository.js +1 -1
- package/dist/esm/webgl/ShaderPropertyAccessorGLSL.d.ts +11 -0
- package/dist/esm/webgl/ShaderPropertyAccessorGLSL.js +29 -0
- package/dist/esm/webgl/WebGLCompressedTextures.d.ts +48 -0
- package/dist/esm/webgl/WebGLCompressedTextures.js +1 -0
- package/dist/esm/webgl/WebGLContextWrapper.d.ts +9 -52
- package/dist/esm/webgl/WebGLContextWrapper.js +1 -1
- package/dist/esm/webgl/WebGLCubeTextureFileLoader.d.ts +38 -0
- package/dist/esm/webgl/WebGLCubeTextureFileLoader.js +1 -0
- package/dist/esm/webgl/WebGLCubeTextures.d.ts +92 -0
- package/dist/esm/webgl/WebGLCubeTextures.js +42 -0
- package/dist/esm/webgl/WebGLDataTexture.d.ts +108 -0
- package/dist/esm/webgl/WebGLDataTexture.js +1 -0
- package/dist/esm/webgl/WebGLDrawState.d.ts +84 -0
- package/dist/esm/webgl/WebGLDrawState.js +1 -0
- package/dist/esm/webgl/WebGLExternalState.d.ts +43 -0
- package/dist/esm/webgl/WebGLExternalState.js +1 -0
- package/dist/esm/webgl/WebGLFrameRenderer.d.ts +32 -0
- package/dist/esm/webgl/WebGLFrameRenderer.js +1 -0
- package/dist/esm/webgl/WebGLFramebuffers.d.ts +142 -0
- package/dist/esm/webgl/WebGLFramebuffers.js +1 -0
- package/dist/esm/webgl/WebGLGpuTimer.js +1 -1
- package/dist/esm/webgl/WebGLMaterialParameters.d.ts +47 -0
- package/dist/esm/webgl/WebGLMaterialParameters.js +1 -0
- package/dist/esm/webgl/WebGLMeshResources.d.ts +115 -0
- package/dist/esm/webgl/WebGLMeshResources.js +1 -0
- package/dist/esm/webgl/WebGLMorphUniformBuffers.d.ts +66 -0
- package/dist/esm/webgl/WebGLMorphUniformBuffers.js +57 -0
- package/dist/esm/webgl/WebGLResourceRepository.d.ts +100 -178
- package/dist/esm/webgl/WebGLResourceRepository.js +1 -55
- package/dist/esm/webgl/WebGLSamplers.d.ts +78 -0
- package/dist/esm/webgl/WebGLSamplers.js +1 -0
- package/dist/esm/webgl/WebGLShaderProgramBuilder.d.ts +40 -0
- package/dist/esm/webgl/WebGLShaderProgramBuilder.js +15 -0
- package/dist/esm/webgl/WebGLShaderPrograms.d.ts +88 -0
- package/dist/esm/webgl/WebGLShaderPrograms.js +14 -0
- package/dist/esm/webgl/WebGLStereoUtil.d.ts +0 -27
- package/dist/esm/webgl/WebGLStereoUtil.js +3 -3
- package/dist/esm/webgl/WebGLStrategyDataUploader.d.ts +152 -0
- package/dist/esm/webgl/WebGLStrategyDataUploader.js +1 -0
- package/dist/esm/webgl/WebGLStrategyMeshBatchRenderer.d.ts +40 -0
- package/dist/esm/webgl/WebGLStrategyMeshBatchRenderer.js +1 -0
- package/dist/esm/webgl/WebGLStrategyMeshDrawer.d.ts +92 -0
- package/dist/esm/webgl/WebGLStrategyMeshDrawer.js +1 -0
- package/dist/esm/webgl/WebGLStrategyWebGL2.d.ts +7 -360
- package/dist/esm/webgl/WebGLStrategyWebGL2.js +1 -146
- package/dist/esm/webgl/WebGLTextureUnitState.d.ts +79 -0
- package/dist/esm/webgl/WebGLTextureUnitState.js +1 -0
- package/dist/esm/webgl/WebGLTextureUploads.d.ts +106 -0
- package/dist/esm/webgl/WebGLTextureUploads.js +1 -0
- package/dist/esm/webgl/WebGLTextures.d.ts +316 -0
- package/dist/esm/webgl/WebGLTextures.js +1 -0
- package/dist/esm/webgl/WebGLUniformBuffers.d.ts +35 -0
- package/dist/esm/webgl/WebGLUniformBuffers.js +1 -0
- package/dist/esm/webgl/WebGLUniforms.d.ts +117 -0
- package/dist/esm/webgl/WebGLUniforms.js +1 -0
- package/dist/esm/webgl/WebGLVertexBuffers.d.ts +172 -0
- package/dist/esm/webgl/WebGLVertexBuffers.js +1 -0
- package/dist/esm/webgl/debug/BufferLayoutDecoder.d.ts +4 -4
- package/dist/esm/webgl/debug/BufferLayoutDecoder.js +1 -1
- package/dist/esm/webgl/debug/ShaderParameterDebugger.js +1 -1
- package/dist/esm/webgl/debug/types.d.ts +2 -2
- package/dist/esm/webgl/getRenderingStrategy.d.ts +2 -2
- package/dist/esm/webgl/getRenderingStrategy.js +1 -1
- package/dist/esm/webgl/main.d.ts +4 -17
- package/dist/esm/webgl/main.js +1 -1
- package/dist/esm/webgl/readColorAttachmentAsRgba8.d.ts +36 -0
- package/dist/esm/webgl/readColorAttachmentAsRgba8.js +1 -0
- package/dist/esm/webgl/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.frag.js +17 -8
- package/dist/esm/webgl/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.vert.js +5 -5
- package/dist/esm/webgl/shaderity_shaders/ColorGradingUsingLUTsShader/ColorGradingUsingLUTsShader.vert.js +1 -1
- package/dist/esm/webgl/shaderity_shaders/DepthEncodeSingleShader/DepthEncodeSingleShader.vert.js +2 -2
- package/dist/esm/webgl/shaderity_shaders/DepthMomentEncodeShader/DepthMomentEncodeShader.vert.js +3 -3
- package/dist/esm/webgl/shaderity_shaders/DetectHighLuminanceAndCorrectShader/DetectHighLuminanceAndCorrectShader.vert.js +2 -2
- package/dist/esm/webgl/shaderity_shaders/EntityUIDOutputSingleShader/EntityUIDOutputSingleShader.vert.js +2 -2
- package/dist/esm/webgl/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.frag.js +84 -0
- package/dist/esm/webgl/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.vert.js +34 -0
- package/dist/esm/webgl/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.frag.js +5 -5
- package/dist/esm/webgl/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.vert.js +2 -2
- package/dist/esm/webgl/shaderity_shaders/FlatSingleShader/FlatSingleShader.frag.js +7 -7
- package/dist/esm/webgl/shaderity_shaders/FlatSingleShader/FlatSingleShader.vert.js +4 -4
- package/dist/esm/webgl/shaderity_shaders/GammaCorrectionShader/GammaCorrectionShader.frag.js +1 -1
- package/dist/esm/webgl/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.frag.glsl.js +8 -5
- package/dist/esm/webgl/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.vert.glsl.js +1 -1
- package/dist/esm/webgl/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.frag.glsl.js +43 -40
- package/dist/esm/webgl/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.vert.glsl.js +4 -4
- package/dist/esm/webgl/shaderity_shaders/MatCapShader/MatCapShader.vert.js +1 -1
- package/dist/esm/webgl/shaderity_shaders/MotionVectorShader/MotionVectorShader.vert.js +3 -3
- package/dist/esm/webgl/shaderity_shaders/PanoramaToCubeShader/PanoramaToCubeShader.frag.js +1 -1
- package/dist/esm/webgl/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.frag.glsl.js +1 -1
- package/dist/esm/webgl/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.vert.glsl.js +4 -4
- package/dist/esm/webgl/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +124 -112
- package/dist/esm/webgl/shaderity_shaders/PbrSingleShader/PbrSingleShader.vert.js +6 -6
- package/dist/esm/webgl/shaderity_shaders/PrefilterIBLShader/PrefilterIBLShader.frag.js +5 -5
- package/dist/esm/webgl/shaderity_shaders/ShadowMapDecodeClassicSingleShader/ShadowMapDecodeClassicSingleShader.vert.js +2 -2
- package/dist/esm/webgl/shaderity_shaders/SummedAreaTableShader/SummedAreaTableShader.frag.js +3 -3
- package/dist/esm/webgl/shaderity_shaders/ToneMappingShader/ToneMappingShader.frag.js +1 -1
- package/dist/esm/webgl/shaderity_shaders/VarianceShadowMapDecodeClassicShader/VarianceShadowMapDecodeClassicShader.vert.js +2 -2
- package/dist/esm/webgl/shaderity_shaders/common/iblDefinition.glsl.js +54 -1
- package/dist/esm/webgl/shaderity_shaders/common/morphVariables.glsl.js +2 -2
- package/dist/esm/webgl/shaderity_shaders/common/opticalDefinition.glsl.js +4 -1
- package/dist/esm/webgl/shaderity_shaders/common/prerequisites.glsl.js +3 -3
- package/dist/esm/webgl/shaderity_shaders/nodes/ClassicShader.glsl.js +10 -1
- package/dist/esm/webgl/shaderity_shaders/nodes/PbrShader.glsl.js +12 -0
- package/dist/esm/webgl/shaders/RaymarchingShaderPart.d.ts +2 -2
- package/dist/esm/webgl/shaders/RaymarchingShaderPart.js +30 -18
- package/dist/esm/webgl/shaders/RaymarchingShadowShaderPart.js +9 -9
- package/dist/esm/webgl/shaders/StandardShaderPart.d.ts +3 -3
- package/dist/esm/webgl/shaders/StandardShaderPart.js +16 -16
- package/dist/esm/webgl/shaders/glslCommonChunks.d.ts +2 -2
- 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.d.ts +2 -2
- package/dist/esm/webgl/shaders/nodes/ConstantVariableShader.js +7 -7
- package/dist/esm/webgl/shaders/nodes/DiscardShader.d.ts +1 -1
- package/dist/esm/webgl/shaders/nodes/DiscardShader.js +3 -3
- package/dist/esm/webgl/shaders/nodes/EndShader.d.ts +2 -2
- package/dist/esm/webgl/shaders/nodes/EndShader.js +3 -3
- package/dist/esm/webgl/shaders/nodes/OutDistance.d.ts +1 -1
- package/dist/esm/webgl/shaders/nodes/OutDistance.js +1 -1
- package/dist/esm/webgl/shaders/nodes/OutUnion.js +1 -1
- package/dist/esm/webgl/shaders/nodes/RaymarchObjectIdUniform.js +3 -3
- package/dist/esm/webgl/shaders/nodes/SdApplyTransform.js +5 -5
- package/dist/esm/webgl/shaders/nodes/SdApplyWorldMatrix.d.ts +1 -1
- package/dist/esm/webgl/shaders/nodes/SdApplyWorldMatrix.js +3 -3
- package/dist/esm/webgl/shaders/nodes/Texture2DShader.js +18 -18
- package/dist/esm/webgl/shaders/nodes/UniformDataShader.js +14 -14
- package/dist/esm/webgl/textureLoader/KTX2TextureLoader.d.ts +1 -1
- package/dist/esm/webgl/textureLoader/KTX2TextureLoader.js +1 -1
- package/dist/esm/webgpu/AttributeReader.d.ts +18 -0
- package/dist/esm/webgpu/AttributeReader.js +1 -0
- package/dist/esm/webgpu/GpuCullingRegistry.js +1 -1
- package/dist/esm/webgpu/GpuDeformRegistry.js +1 -1
- package/dist/esm/webgpu/RangeAllocator.js +1 -1
- package/dist/esm/webgpu/ShaderPropertyAccessorWGSL.d.ts +11 -0
- package/dist/esm/webgpu/ShaderPropertyAccessorWGSL.js +24 -0
- package/dist/esm/webgpu/WebGpuBindGroups.d.ts +131 -0
- package/dist/esm/webgpu/WebGpuBindGroups.js +1 -0
- package/dist/esm/webgpu/WebGpuBufferArena.js +1 -1
- package/dist/esm/webgpu/WebGpuCompressedTextures.d.ts +38 -0
- package/dist/esm/webgpu/WebGpuCompressedTextures.js +1 -0
- package/dist/esm/webgpu/WebGpuCubeTextureShaders.d.ts +1 -0
- package/dist/esm/webgpu/WebGpuCubeTextureShaders.js +60 -0
- package/dist/esm/webgpu/WebGpuCubeTextures.d.ts +72 -0
- package/dist/esm/webgpu/WebGpuCubeTextures.js +1 -0
- package/dist/esm/webgpu/WebGpuDraw.d.ts +63 -0
- package/dist/esm/webgpu/WebGpuDraw.js +1 -0
- package/dist/esm/webgpu/WebGpuDrawParameters.d.ts +61 -0
- package/dist/esm/webgpu/WebGpuDrawParameters.js +1 -0
- package/dist/esm/webgpu/WebGpuExternalRenderPass.d.ts +44 -0
- package/dist/esm/webgpu/WebGpuExternalRenderPass.js +1 -0
- package/dist/esm/webgpu/WebGpuFrame.d.ts +55 -0
- package/dist/esm/webgpu/WebGpuFrame.js +1 -0
- package/dist/esm/webgpu/WebGpuFrameRenderer.d.ts +25 -0
- package/dist/esm/webgpu/WebGpuFrameRenderer.js +1 -0
- package/dist/esm/webgpu/WebGpuGpuCulling.js +1 -236
- package/dist/esm/webgpu/WebGpuGpuCullingShaders.d.ts +34 -0
- package/dist/esm/webgpu/WebGpuGpuCullingShaders.js +236 -0
- package/dist/esm/webgpu/WebGpuGpuTimer.js +1 -1
- package/dist/esm/webgpu/WebGpuLightClusterBuilder.js +1 -153
- package/dist/esm/webgpu/WebGpuLightClusterShaders.d.ts +14 -0
- package/dist/esm/webgpu/WebGpuLightClusterShaders.js +153 -0
- package/dist/esm/webgpu/WebGpuMipmapGenerator.d.ts +54 -0
- package/dist/esm/webgpu/WebGpuMipmapGenerator.js +1 -0
- package/dist/esm/webgpu/WebGpuMipmapShaders.d.ts +1 -0
- package/dist/esm/webgpu/WebGpuMipmapShaders.js +26 -0
- package/dist/esm/webgpu/WebGpuRenderBundles.d.ts +117 -0
- package/dist/esm/webgpu/WebGpuRenderBundles.js +1 -0
- package/dist/esm/webgpu/WebGpuRenderPassEncoders.d.ts +140 -0
- package/dist/esm/webgpu/WebGpuRenderPassEncoders.js +1 -0
- package/dist/esm/webgpu/WebGpuRenderPipelines.d.ts +75 -0
- package/dist/esm/webgpu/WebGpuRenderPipelines.js +3 -0
- package/dist/esm/webgpu/WebGpuRenderTargetTextures.d.ts +78 -0
- package/dist/esm/webgpu/WebGpuRenderTargetTextures.js +1 -0
- package/dist/esm/webgpu/WebGpuResourceRepository.d.ts +52 -322
- package/dist/esm/webgpu/WebGpuResourceRepository.js +1 -116
- package/dist/esm/webgpu/WebGpuSamplers.d.ts +45 -0
- package/dist/esm/webgpu/WebGpuSamplers.js +1 -0
- package/dist/esm/webgpu/WebGpuShaderProgramBuilder.d.ts +25 -0
- package/dist/esm/webgpu/WebGpuShaderProgramBuilder.js +9 -0
- package/dist/esm/webgpu/WebGpuStorageBuffers.d.ts +77 -0
- package/dist/esm/webgpu/WebGpuStorageBuffers.js +1 -0
- package/dist/esm/webgpu/WebGpuStrategyBasic.d.ts +2 -73
- package/dist/esm/webgpu/WebGpuStrategyBasic.js +1 -139
- package/dist/esm/webgpu/WebGpuStrategyStorage.d.ts +62 -0
- package/dist/esm/webgpu/WebGpuStrategyStorage.js +1 -0
- package/dist/esm/webgpu/WebGpuTextureReadback.d.ts +111 -0
- package/dist/esm/webgpu/WebGpuTextureReadback.js +1 -0
- package/dist/esm/webgpu/WebGpuTextureReadbackShaders.d.ts +4 -0
- package/dist/esm/webgpu/WebGpuTextureReadbackShaders.js +26 -0
- package/dist/esm/webgpu/WebGpuTextureUploads.d.ts +109 -0
- package/dist/esm/webgpu/WebGpuTextureUploads.js +1 -0
- package/dist/esm/webgpu/WebGpuTextures.d.ts +196 -0
- package/dist/esm/webgpu/WebGpuTextures.js +1 -0
- package/dist/esm/webgpu/WebGpuVertexBuffers.d.ts +142 -0
- package/dist/esm/webgpu/WebGpuVertexBuffers.js +1 -0
- package/dist/esm/webgpu/WebGpuVertexDeformer.js +1 -124
- package/dist/esm/webgpu/WebGpuVertexDeformerShaders.d.ts +7 -0
- package/dist/esm/webgpu/WebGpuVertexDeformerShaders.js +124 -0
- package/dist/esm/webgpu/WebGpuVertexShaderDefinitions.d.ts +16 -0
- package/dist/esm/webgpu/WebGpuVertexShaderDefinitions.js +84 -0
- package/dist/esm/webgpu/assertArrayBufferView.d.ts +9 -0
- package/dist/esm/webgpu/assertArrayBufferView.js +1 -0
- package/dist/esm/webgpu/main.d.ts +2 -16
- package/dist/esm/webgpu/main.js +1 -1
- package/dist/esm/webgpu/padCompressedRowsForUpload.d.ts +20 -0
- package/dist/esm/webgpu/padCompressedRowsForUpload.js +1 -0
- package/dist/esm/webgpu/removeRowPadding.d.ts +21 -0
- package/dist/esm/webgpu/removeRowPadding.js +1 -0
- package/dist/esm/webgpu/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.frag.js +15 -8
- package/dist/esm/webgpu/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.frag.wgsl.js +84 -0
- package/dist/esm/webgpu/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.vert.wgsl.js +19 -0
- package/dist/esm/webgpu/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.frag.js +6 -6
- package/dist/esm/webgpu/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.vert.js +3 -3
- package/dist/esm/webgpu/shaderity_shaders/FlatSingleShader/FlatSingleShader.frag.js +5 -5
- package/dist/esm/webgpu/shaderity_shaders/GammaCorrectionShader/GammaCorrectionShader.frag.js +3 -3
- package/dist/esm/webgpu/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.frag.wgsl.js +9 -6
- package/dist/esm/webgpu/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.frag.wgsl.js +44 -41
- package/dist/esm/webgpu/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.vert.wgsl.js +2 -2
- package/dist/esm/webgpu/shaderity_shaders/PanoramaToCubeShader/PanoramaToCubeShader.frag.wgsl.js +1 -1
- package/dist/esm/webgpu/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.frag.wgsl.js +2 -2
- package/dist/esm/webgpu/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.vert.wgsl.js +3 -3
- package/dist/esm/webgpu/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +125 -114
- package/dist/esm/webgpu/shaderity_shaders/PrefilterIBLShader/PrefilterIBLShader.frag.wgsl.js +5 -5
- package/dist/esm/webgpu/shaderity_shaders/ToneMappingShader/ToneMappingShader.frag.wgsl.js +1 -1
- package/dist/esm/webgpu/shaderity_shaders/common/iblDefinition.wgsl.js +55 -1
- package/dist/esm/webgpu/shaderity_shaders/common/opticalDefinition.wgsl.js +4 -1
- package/dist/esm/webgpu/shaderity_shaders/common/processGeometry.wgsl.js +1 -1
- package/dist/esm/webgpu/shaderity_shaders/nodes/ClassicShader.wgsl.js +7 -0
- package/dist/esm/webgpu/shaderity_shaders/nodes/PbrShader.wgsl.js +13 -2
- package/dist/esm/webgpu/wgslCommonChunks.d.ts +2 -2
- package/dist/esm/xr/WebARSystem.js +1 -1
- package/dist/esm/xr/WebXRSystem.d.ts +0 -4
- package/dist/esm/xr/WebXRSystem.js +1 -1
- package/dist/esmdev/effekseer/EffekseerComponent.js +3 -3
- package/dist/esmdev/foundation/components/Camera/CameraComponent.js +4 -4
- package/dist/esmdev/foundation/components/Light/LightComponent.d.ts +14 -0
- package/dist/esmdev/foundation/components/Light/LightComponent.js +38 -11
- package/dist/esmdev/foundation/components/Mesh/MeshComponent.js +47 -44
- package/dist/esmdev/foundation/components/MeshRenderer/MeshRendererComponent.d.ts +33 -5
- package/dist/esmdev/foundation/components/MeshRenderer/MeshRendererComponent.js +152 -102
- package/dist/esmdev/foundation/components/Physics/PhysicsComponent.js +65 -65
- package/dist/esmdev/foundation/components/Raymarching/RaymarchingComponent.js +54 -54
- package/dist/esmdev/foundation/components/Raymarching/RaymarchingSdfEvaluator.js +250 -250
- package/dist/esmdev/foundation/components/SceneGraph/SceneGraphComponent.js +335 -335
- package/dist/esmdev/foundation/components/Shape/ShapeComponent.js +31 -31
- package/dist/esmdev/foundation/components/Skeletal/AnimationRetarget/AbsoluteAnimation.js +5 -5
- package/dist/esmdev/foundation/components/Skeletal/AnimationRetarget/GlobalRetarget.js +5 -5
- package/dist/esmdev/foundation/components/Skeletal/AnimationRetarget/GlobalRetargetReverse.js +9 -9
- package/dist/esmdev/foundation/components/Skeletal/SkeletalComponent.js +222 -222
- package/dist/esmdev/foundation/components/Transform/TransformComponent.js +66 -66
- package/dist/esmdev/foundation/components/Trigger/TriggerComponent.js +61 -61
- package/dist/esmdev/foundation/components/Vrm/VrmComponent.js +44 -44
- package/dist/esmdev/foundation/constraints/VrmAimConstraint.js +11 -11
- package/dist/esmdev/foundation/constraints/VrmRollConstraint.js +16 -16
- package/dist/esmdev/foundation/constraints/VrmRotationConstraint.js +10 -10
- package/dist/esmdev/foundation/core/Component.js +32 -32
- package/dist/esmdev/foundation/core/ComponentMemoryRegistry.js +41 -41
- package/dist/esmdev/foundation/core/ComponentRepository.js +37 -37
- package/dist/esmdev/foundation/core/Config.d.ts +15 -0
- package/dist/esmdev/foundation/core/Config.js +27 -10
- package/dist/esmdev/foundation/core/Entity.js +9 -9
- package/dist/esmdev/foundation/core/EntityRepository.js +19 -19
- package/dist/esmdev/foundation/core/GlobalDataRepository.d.ts +3 -3
- package/dist/esmdev/foundation/core/GlobalDataRepository.js +33 -20
- package/dist/esmdev/foundation/core/MemoryManager.js +27 -27
- package/dist/esmdev/foundation/core/RnObject.js +36 -36
- 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/RenderBackend.d.ts +21 -0
- package/dist/esmdev/foundation/definitions/RenderBackend.js +60 -0
- package/dist/esmdev/foundation/definitions/ShaderSemantics.js +6 -6
- package/dist/esmdev/foundation/definitions/ShaderSemanticsInfo.d.ts +1 -0
- package/dist/esmdev/foundation/definitions/ShaderSemanticsInfo.js +1 -1
- 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/definitions/index.d.ts +1 -1
- package/dist/esmdev/foundation/definitions/index.js +2 -2
- package/dist/esmdev/foundation/enhanced_js_objects/Array.js +2 -2
- package/dist/esmdev/foundation/exporter/Gltf2Exporter.d.ts +6 -0
- package/dist/esmdev/foundation/exporter/Gltf2Exporter.js +140 -110
- package/dist/esmdev/foundation/geometry/ComplexVertexAttribute.js +24 -24
- package/dist/esmdev/foundation/geometry/Frustum.js +40 -40
- package/dist/esmdev/foundation/geometry/Mesh.d.ts +33 -68
- package/dist/esmdev/foundation/geometry/Mesh.js +211 -405
- package/dist/esmdev/foundation/geometry/Primitive.d.ts +1 -1
- package/dist/esmdev/foundation/geometry/Primitive.js +141 -135
- 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 +16 -16
- 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 +37 -37
- package/dist/esmdev/foundation/gizmos/LightGizmo.d.ts +108 -10
- package/dist/esmdev/foundation/gizmos/LightGizmo.js +248 -49
- package/dist/esmdev/foundation/gizmos/LocatorGizmo.js +25 -25
- package/dist/esmdev/foundation/gizmos/RotationGizmo.js +212 -212
- package/dist/esmdev/foundation/gizmos/ScaleGizmo.js +130 -130
- 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 +42 -38
- package/dist/esmdev/foundation/helpers/GaussianBlurHelper.js +18 -18
- package/dist/esmdev/foundation/helpers/MaterialHelper.d.ts +2 -0
- package/dist/esmdev/foundation/helpers/MaterialHelper.js +3 -1
- package/dist/esmdev/foundation/helpers/Shadow/PointShadowMap.js +12 -12
- package/dist/esmdev/foundation/helpers/Shadow/ShadowCasterFilter.d.ts +8 -0
- package/dist/esmdev/foundation/helpers/Shadow/ShadowCasterFilter.js +17 -0
- package/dist/esmdev/foundation/helpers/Shadow/ShadowDirectionalAutoFit.d.ts +28 -0
- package/dist/esmdev/foundation/helpers/Shadow/ShadowDirectionalAutoFit.js +126 -0
- package/dist/esmdev/foundation/helpers/Shadow/ShadowMap.js +5 -5
- package/dist/esmdev/foundation/helpers/Shadow/ShadowSpotLightZNear.d.ts +8 -0
- package/dist/esmdev/foundation/helpers/Shadow/ShadowSpotLightZNear.js +87 -0
- package/dist/esmdev/foundation/helpers/Shadow/ShadowSystem.d.ts +1 -29
- package/dist/esmdev/foundation/helpers/Shadow/ShadowSystem.js +100 -309
- package/dist/esmdev/foundation/helpers/materials/createClassicUberMaterial.js +13 -5
- package/dist/esmdev/foundation/helpers/materials/createEnvConstantScreenSpaceMaterial.d.ts +21 -0
- package/dist/esmdev/foundation/helpers/materials/createEnvConstantScreenSpaceMaterial.js +32 -0
- package/dist/esmdev/foundation/helpers/materials/createGaussianBlurForEncodedDepthMaterial.js +12 -4
- package/dist/esmdev/foundation/helpers/materials/createGaussianBlurMaterial.js +13 -5
- package/dist/esmdev/foundation/helpers/materials/createMotionVectorMaterial.js +7 -3
- package/dist/esmdev/foundation/helpers/materials/createNodeBasedRaymarchingMaterials.js +41 -18
- package/dist/esmdev/foundation/helpers/materials/createPbrUberMaterial.js +13 -5
- package/dist/esmdev/foundation/helpers/materials/createTemporalAAResolveMaterial.js +22 -8
- package/dist/esmdev/foundation/helpers/materials/index.d.ts +1 -0
- package/dist/esmdev/foundation/helpers/materials/index.js +3 -1
- package/dist/esmdev/foundation/helpers/materials/nodeBasedMaterialCommon.js +26 -14
- package/dist/esmdev/foundation/importer/AnimationAssigner.js +44 -44
- package/dist/esmdev/foundation/importer/DrcPointCloudImporter.js +33 -33
- package/dist/esmdev/foundation/importer/Gltf2Importer.js +14 -14
- package/dist/esmdev/foundation/importer/GltfImporter.js +22 -22
- package/dist/esmdev/foundation/importer/ModelConverter.d.ts +19 -0
- package/dist/esmdev/foundation/importer/ModelConverter.js +183 -132
- 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/ColorGradingUsingLUTsMaterialContent.d.ts +0 -20
- package/dist/esmdev/foundation/materials/contents/ColorGradingUsingLUTsMaterialContent.js +1 -33
- package/dist/esmdev/foundation/materials/contents/CustomMaterialContent.d.ts +3 -1
- package/dist/esmdev/foundation/materials/contents/CustomMaterialContent.js +31 -30
- package/dist/esmdev/foundation/materials/contents/DepthEncodeMaterialContent.js +15 -9
- package/dist/esmdev/foundation/materials/contents/DetectHighLuminanceMaterialContent.d.ts +0 -16
- package/dist/esmdev/foundation/materials/contents/DetectHighLuminanceMaterialContent.js +5 -20
- package/dist/esmdev/foundation/materials/contents/EntityUIDOutputMaterialContent.d.ts +0 -17
- package/dist/esmdev/foundation/materials/contents/EntityUIDOutputMaterialContent.js +5 -19
- package/dist/esmdev/foundation/materials/contents/FurnaceTestMaterialContent.d.ts +0 -21
- package/dist/esmdev/foundation/materials/contents/FurnaceTestMaterialContent.js +16 -28
- package/dist/esmdev/foundation/materials/contents/MToon0xMaterialContent.js +200 -174
- package/dist/esmdev/foundation/materials/contents/MToon1MaterialContent.js +21 -22
- package/dist/esmdev/foundation/materials/contents/MatCapMaterialContent.d.ts +0 -16
- package/dist/esmdev/foundation/materials/contents/MatCapMaterialContent.js +7 -20
- package/dist/esmdev/foundation/materials/contents/ShadowMapDecodeClassicMaterialContent.js +34 -21
- package/dist/esmdev/foundation/materials/contents/SynthesizeHdrMaterialContent.d.ts +0 -23
- package/dist/esmdev/foundation/materials/contents/SynthesizeHdrMaterialContent.js +5 -29
- package/dist/esmdev/foundation/materials/contents/VarianceShadowMapDecodeClassicMaterialContent.js +42 -26
- package/dist/esmdev/foundation/materials/core/AbstractMaterialContent.d.ts +6 -61
- package/dist/esmdev/foundation/materials/core/AbstractMaterialContent.js +61 -153
- package/dist/esmdev/foundation/materials/core/AbstractShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/core/AbstractShaderNode.js +31 -31
- package/dist/esmdev/foundation/materials/core/DummyTextures.js +3 -3
- package/dist/esmdev/foundation/materials/core/Material.d.ts +7 -114
- package/dist/esmdev/foundation/materials/core/Material.js +116 -364
- package/dist/esmdev/foundation/materials/core/MaterialRepository.js +65 -65
- package/dist/esmdev/foundation/materials/core/ShaderGraphResolver.js +46 -1399
- package/dist/esmdev/foundation/materials/core/ShaderNodeFactories.d.ts +23 -0
- package/dist/esmdev/foundation/materials/core/ShaderNodeFactories.js +609 -0
- package/dist/esmdev/foundation/materials/core/ShaderProgramDefinitions.d.ts +41 -0
- package/dist/esmdev/foundation/materials/core/ShaderProgramDefinitions.js +95 -0
- package/dist/esmdev/foundation/materials/core/ShaderityUtilityWebGL.js +26 -20
- package/dist/esmdev/foundation/materials/core/ShaderityUtilityWebGPU.js +29 -23
- package/dist/esmdev/foundation/materials/nodes/AbsShaderNode.js +16 -16
- package/dist/esmdev/foundation/materials/nodes/AcosShaderNode.js +16 -16
- package/dist/esmdev/foundation/materials/nodes/AddShaderNode.js +21 -21
- 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 +18 -18
- 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 +18 -18
- package/dist/esmdev/foundation/materials/nodes/CalcBitangentShaderNode.js +7 -7
- package/dist/esmdev/foundation/materials/nodes/CastToFloatShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/CastToFloatShaderNode.js +17 -17
- package/dist/esmdev/foundation/materials/nodes/ClampShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/ClampShaderNode.js +19 -19
- 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.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/CosShaderNode.js +17 -17
- package/dist/esmdev/foundation/materials/nodes/DiscardShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/DotProductShaderNode.d.ts +2 -2
- package/dist/esmdev/foundation/materials/nodes/DotProductShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/EqualShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/EqualShaderNode.js +14 -14
- package/dist/esmdev/foundation/materials/nodes/FlatShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/GreaterOrEqualShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/GreaterOrEqualShaderNode.js +14 -14
- package/dist/esmdev/foundation/materials/nodes/GreaterShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/GreaterThanShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/GreaterThanShaderNode.js +14 -14
- package/dist/esmdev/foundation/materials/nodes/LengthShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/LengthShaderNode.js +17 -17
- package/dist/esmdev/foundation/materials/nodes/LessOrEqualShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/LessOrEqualShaderNode.js +14 -14
- package/dist/esmdev/foundation/materials/nodes/LessThanShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/LessThanShaderNode.js +14 -14
- package/dist/esmdev/foundation/materials/nodes/MergeVectorShaderNode.js +23 -23
- package/dist/esmdev/foundation/materials/nodes/MinShaderNode.js +21 -21
- package/dist/esmdev/foundation/materials/nodes/MultiplyShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/MultiplyShaderNode.js +25 -25
- package/dist/esmdev/foundation/materials/nodes/NormalMatrixShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/NormalizeShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/NormalizeShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/NotEqualShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/NotEqualShaderNode.js +14 -14
- 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.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/PremultipliedAlphaShaderNode.js +8 -8
- 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 +15 -15
- package/dist/esmdev/foundation/materials/nodes/Random_SinHashShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/RemapShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/RemapShaderNode.js +21 -21
- package/dist/esmdev/foundation/materials/nodes/SinShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/SinShaderNode.js +17 -17
- package/dist/esmdev/foundation/materials/nodes/SmoothStepShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/SmoothStepShaderNode.js +19 -19
- package/dist/esmdev/foundation/materials/nodes/SplitVectorShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/SplitVectorShaderNode.js +22 -22
- package/dist/esmdev/foundation/materials/nodes/StepShaderNode.js +17 -17
- package/dist/esmdev/foundation/materials/nodes/TanShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/TanShaderNode.js +17 -17
- 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.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/TransformShaderNode.js +14 -14
- 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 +16 -16
- package/dist/esmdev/foundation/materials/nodes/raymarching/OutShadingColorShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/OutUnionShaderNode.js +16 -16
- 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 +132 -132
- package/dist/esmdev/foundation/math/AnimatedQuaternion.js +54 -54
- package/dist/esmdev/foundation/math/AnimatedScalar.js +55 -55
- package/dist/esmdev/foundation/math/AnimatedValueEvaluationState.js +20 -20
- package/dist/esmdev/foundation/math/AnimatedVector2.js +55 -55
- package/dist/esmdev/foundation/math/AnimatedVector3.js +55 -55
- package/dist/esmdev/foundation/math/AnimatedVector4.js +55 -55
- package/dist/esmdev/foundation/math/AnimatedVectorN.js +55 -55
- 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 +4 -4
- package/dist/esmdev/foundation/math/MathUtil.d.ts +11 -0
- package/dist/esmdev/foundation/math/MathUtil.js +5 -1
- package/dist/esmdev/foundation/math/Quaternion.js +20 -20
- package/dist/esmdev/foundation/math/Transform3D.js +74 -74
- 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 +40 -40
- package/dist/esmdev/foundation/memory/BufferView.js +33 -33
- package/dist/esmdev/foundation/misc/DataUtil.js +2 -2
- package/dist/esmdev/foundation/misc/EnumIO.js +10 -10
- package/dist/esmdev/foundation/misc/Logger.js +14 -14
- package/dist/esmdev/foundation/misc/RnPromise.js +14 -14
- package/dist/esmdev/foundation/misc/Time.js +27 -27
- 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 +190 -190
- package/dist/esmdev/foundation/physics/Rapier/RapierPhysicsStrategy.js +241 -241
- package/dist/esmdev/foundation/physics/Rapier/RapierPhysicsWorldQueryStrategy.js +3 -3
- package/dist/esmdev/foundation/physics/VRMSpring/CapsuleCollider.js +42 -42
- package/dist/esmdev/foundation/physics/VRMSpring/SphereCollider.js +27 -27
- package/dist/esmdev/foundation/physics/VRMSpring/VRMSpringBone.js +10 -10
- package/dist/esmdev/foundation/physics/VRMSpring/VRMSpringBonePhysicsStrategy.js +55 -55
- package/dist/esmdev/foundation/renderer/CGAPIResourceRepository.d.ts +74 -4
- package/dist/esmdev/foundation/renderer/CGAPIResourceRepository.js +4 -4
- package/dist/esmdev/foundation/renderer/Expression.js +6 -6
- package/dist/esmdev/foundation/renderer/Frame.js +12 -12
- package/dist/esmdev/foundation/renderer/FrameBuffer.js +28 -28
- package/dist/esmdev/foundation/renderer/FrameRenderer.d.ts +42 -0
- package/dist/esmdev/foundation/renderer/FrameRenderer.js +1 -0
- package/dist/esmdev/foundation/renderer/RenderPass.js +101 -101
- package/dist/esmdev/foundation/renderer/ShaderPropertyLayout.d.ts +77 -0
- package/dist/esmdev/foundation/renderer/ShaderPropertyLayout.js +61 -0
- package/dist/esmdev/foundation/renderer/TemporalAA/PreviousFrameDataTracker.js +10 -10
- package/dist/esmdev/foundation/renderer/TemporalAA/TemporalAASystem.d.ts +9 -3
- package/dist/esmdev/foundation/renderer/TemporalAA/TemporalAASystem.js +97 -83
- package/dist/esmdev/foundation/renderer/lightCluster/LightClusterSystem.d.ts +12 -0
- package/dist/esmdev/foundation/renderer/lightCluster/LightClusterSystem.js +193 -155
- package/dist/esmdev/foundation/renderer/lightCluster/LightClusterSystemStub.js +3 -3
- package/dist/esmdev/foundation/renderer/pipelines/DeferredRenderPipeline.js +6 -6
- package/dist/esmdev/foundation/renderer/pipelines/ForwardRenderPipeline.d.ts +82 -176
- package/dist/esmdev/foundation/renderer/pipelines/ForwardRenderPipeline.js +440 -1108
- package/dist/esmdev/foundation/renderer/pipelines/RaymarchingRenderer.d.ts +263 -0
- package/dist/esmdev/foundation/renderer/pipelines/RaymarchingRenderer.js +858 -0
- package/dist/esmdev/foundation/system/Engine.d.ts +19 -44
- package/dist/esmdev/foundation/system/Engine.js +235 -601
- package/dist/esmdev/foundation/system/EngineState.d.ts +9 -3
- package/dist/esmdev/foundation/system/EngineState.js +4 -4
- package/dist/esmdev/foundation/system/EventPubSub.js +8 -8
- package/dist/esmdev/foundation/system/GpuDriverWorkarounds.d.ts +50 -0
- package/dist/esmdev/foundation/system/GpuDriverWorkarounds.js +93 -0
- package/dist/esmdev/foundation/system/InputManager.js +56 -56
- package/dist/esmdev/foundation/system/ModuleManager.js +6 -6
- package/dist/esmdev/foundation/system/index.d.ts +1 -0
- package/dist/esmdev/foundation/system/index.js +2 -1
- package/dist/esmdev/foundation/textures/AbstractReadableRenderTargetTexture.d.ts +39 -0
- package/dist/esmdev/foundation/textures/AbstractReadableRenderTargetTexture.js +88 -0
- package/dist/esmdev/foundation/textures/AbstractRenderTargetTexture.d.ts +60 -0
- package/dist/esmdev/foundation/textures/AbstractRenderTargetTexture.js +59 -0
- package/dist/esmdev/foundation/textures/AbstractTexture.js +49 -49
- package/dist/esmdev/foundation/textures/CubeTexture.js +35 -42
- package/dist/esmdev/foundation/textures/RenderBuffer.js +16 -17
- package/dist/esmdev/foundation/textures/RenderTargetTexture.d.ts +5 -67
- package/dist/esmdev/foundation/textures/RenderTargetTexture.js +18 -140
- package/dist/esmdev/foundation/textures/RenderTargetTexture2DArray.d.ts +5 -71
- package/dist/esmdev/foundation/textures/RenderTargetTexture2DArray.js +34 -177
- package/dist/esmdev/foundation/textures/RenderTargetTextureCube.d.ts +8 -50
- package/dist/esmdev/foundation/textures/RenderTargetTextureCube.js +31 -88
- package/dist/esmdev/foundation/textures/Sampler.js +24 -24
- package/dist/esmdev/foundation/textures/Texture.d.ts +19 -1
- package/dist/esmdev/foundation/textures/Texture.js +133 -146
- package/dist/esmdev/foundation/textures/TextureArray.js +13 -16
- package/dist/esmdev/foundation/textures/TextureDataFloat.js +26 -26
- package/dist/esmdev/foundation/textures/VideoTexture.d.ts +11 -0
- package/dist/esmdev/foundation/textures/VideoTexture.js +47 -46
- package/dist/esmdev/foundation/textures/decodeBasisImage.d.ts +14 -0
- package/dist/esmdev/foundation/textures/decodeBasisImage.js +14 -0
- package/dist/esmdev/foundation/textures/index.d.ts +2 -0
- package/dist/esmdev/foundation/textures/index.js +3 -1
- package/dist/esmdev/types/glTF2.d.ts +9 -0
- package/dist/esmdev/types/glTF2.js +1 -1
- package/dist/esmdev/version.js +2 -2
- package/dist/esmdev/webgl/ComponentDataAccessorGLSL.d.ts +9 -0
- package/dist/esmdev/webgl/ComponentDataAccessorGLSL.js +146 -0
- package/dist/esmdev/webgl/InstanceSidTable.js +62 -62
- package/dist/esmdev/webgl/MultiDraw.d.ts +1 -1
- package/dist/esmdev/webgl/MultiDraw.js +4 -4
- package/dist/esmdev/webgl/MultiDrawRepository.js +34 -34
- package/dist/esmdev/webgl/ShaderPropertyAccessorGLSL.d.ts +11 -0
- package/dist/esmdev/webgl/ShaderPropertyAccessorGLSL.js +142 -0
- package/dist/esmdev/webgl/WebGLCompressedTextures.d.ts +48 -0
- package/dist/esmdev/webgl/WebGLCompressedTextures.js +105 -0
- package/dist/esmdev/webgl/WebGLContextWrapper.d.ts +9 -52
- package/dist/esmdev/webgl/WebGLContextWrapper.js +127 -229
- package/dist/esmdev/webgl/WebGLCubeTextureFileLoader.d.ts +38 -0
- package/dist/esmdev/webgl/WebGLCubeTextureFileLoader.js +178 -0
- package/dist/esmdev/webgl/WebGLCubeTextures.d.ts +92 -0
- package/dist/esmdev/webgl/WebGLCubeTextures.js +358 -0
- package/dist/esmdev/webgl/WebGLDataTexture.d.ts +108 -0
- package/dist/esmdev/webgl/WebGLDataTexture.js +337 -0
- package/dist/esmdev/webgl/WebGLDrawState.d.ts +84 -0
- package/dist/esmdev/webgl/WebGLDrawState.js +164 -0
- package/dist/esmdev/webgl/WebGLExternalState.d.ts +43 -0
- package/dist/esmdev/webgl/WebGLExternalState.js +70 -0
- package/dist/esmdev/webgl/WebGLFrameRenderer.d.ts +32 -0
- package/dist/esmdev/webgl/WebGLFrameRenderer.js +155 -0
- package/dist/esmdev/webgl/WebGLFramebuffers.d.ts +142 -0
- package/dist/esmdev/webgl/WebGLFramebuffers.js +245 -0
- package/dist/esmdev/webgl/WebGLGpuTimer.js +32 -32
- package/dist/esmdev/webgl/WebGLMaterialParameters.d.ts +47 -0
- package/dist/esmdev/webgl/WebGLMaterialParameters.js +81 -0
- package/dist/esmdev/webgl/WebGLMeshResources.d.ts +115 -0
- package/dist/esmdev/webgl/WebGLMeshResources.js +303 -0
- package/dist/esmdev/webgl/WebGLMorphUniformBuffers.d.ts +66 -0
- package/dist/esmdev/webgl/WebGLMorphUniformBuffers.js +272 -0
- package/dist/esmdev/webgl/WebGLResourceRepository.d.ts +100 -178
- package/dist/esmdev/webgl/WebGLResourceRepository.js +345 -2592
- package/dist/esmdev/webgl/WebGLSamplers.d.ts +78 -0
- package/dist/esmdev/webgl/WebGLSamplers.js +143 -0
- package/dist/esmdev/webgl/WebGLShaderProgramBuilder.d.ts +40 -0
- package/dist/esmdev/webgl/WebGLShaderProgramBuilder.js +208 -0
- package/dist/esmdev/webgl/WebGLShaderPrograms.d.ts +88 -0
- package/dist/esmdev/webgl/WebGLShaderPrograms.js +240 -0
- package/dist/esmdev/webgl/WebGLStereoUtil.d.ts +0 -27
- package/dist/esmdev/webgl/WebGLStereoUtil.js +36 -115
- package/dist/esmdev/webgl/WebGLStrategyDataUploader.d.ts +152 -0
- package/dist/esmdev/webgl/WebGLStrategyDataUploader.js +370 -0
- package/dist/esmdev/webgl/WebGLStrategyMeshBatchRenderer.d.ts +40 -0
- package/dist/esmdev/webgl/WebGLStrategyMeshBatchRenderer.js +213 -0
- package/dist/esmdev/webgl/WebGLStrategyMeshDrawer.d.ts +92 -0
- package/dist/esmdev/webgl/WebGLStrategyMeshDrawer.js +300 -0
- package/dist/esmdev/webgl/WebGLStrategyWebGL2.d.ts +7 -360
- package/dist/esmdev/webgl/WebGLStrategyWebGL2.js +75 -1856
- package/dist/esmdev/webgl/WebGLTextureUnitState.d.ts +79 -0
- package/dist/esmdev/webgl/WebGLTextureUnitState.js +149 -0
- package/dist/esmdev/webgl/WebGLTextureUploads.d.ts +106 -0
- package/dist/esmdev/webgl/WebGLTextureUploads.js +168 -0
- package/dist/esmdev/webgl/WebGLTextures.d.ts +316 -0
- package/dist/esmdev/webgl/WebGLTextures.js +577 -0
- package/dist/esmdev/webgl/WebGLUniformBuffers.d.ts +35 -0
- package/dist/esmdev/webgl/WebGLUniformBuffers.js +89 -0
- package/dist/esmdev/webgl/WebGLUniforms.d.ts +117 -0
- package/dist/esmdev/webgl/WebGLUniforms.js +283 -0
- package/dist/esmdev/webgl/WebGLVertexBuffers.d.ts +172 -0
- package/dist/esmdev/webgl/WebGLVertexBuffers.js +391 -0
- package/dist/esmdev/webgl/debug/BufferLayoutDecoder.d.ts +4 -4
- package/dist/esmdev/webgl/debug/BufferLayoutDecoder.js +52 -59
- package/dist/esmdev/webgl/debug/ShaderParameterDebugger.js +17 -17
- package/dist/esmdev/webgl/debug/types.d.ts +2 -2
- package/dist/esmdev/webgl/getRenderingStrategy.d.ts +2 -2
- package/dist/esmdev/webgl/getRenderingStrategy.js +5 -5
- package/dist/esmdev/webgl/main.d.ts +4 -17
- package/dist/esmdev/webgl/main.js +5 -3
- package/dist/esmdev/webgl/readColorAttachmentAsRgba8.d.ts +36 -0
- package/dist/esmdev/webgl/readColorAttachmentAsRgba8.js +47 -0
- package/dist/esmdev/webgl/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.frag.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/ColorGradingUsingLUTsShader/ColorGradingUsingLUTsShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/DepthEncodeSingleShader/DepthEncodeSingleShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/DepthMomentEncodeShader/DepthMomentEncodeShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/DetectHighLuminanceAndCorrectShader/DetectHighLuminanceAndCorrectShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/EntityUIDOutputSingleShader/EntityUIDOutputSingleShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.frag.js +12 -0
- package/dist/esmdev/webgl/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.vert.js +12 -0
- package/dist/esmdev/webgl/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.frag.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/FlatSingleShader/FlatSingleShader.frag.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/FlatSingleShader/FlatSingleShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/GammaCorrectionShader/GammaCorrectionShader.frag.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.frag.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.vert.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.frag.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.vert.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/MatCapShader/MatCapShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/MotionVectorShader/MotionVectorShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/PanoramaToCubeShader/PanoramaToCubeShader.frag.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.frag.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.vert.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/PbrSingleShader/PbrSingleShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/PrefilterIBLShader/PrefilterIBLShader.frag.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/ShadowMapDecodeClassicSingleShader/ShadowMapDecodeClassicSingleShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/SummedAreaTableShader/SummedAreaTableShader.frag.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/ToneMappingShader/ToneMappingShader.frag.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/VarianceShadowMapDecodeClassicShader/VarianceShadowMapDecodeClassicShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/common/iblDefinition.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/common/morphVariables.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/common/opticalDefinition.glsl.js +5 -2
- package/dist/esmdev/webgl/shaderity_shaders/common/prerequisites.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/nodes/ClassicShader.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/nodes/PbrShader.glsl.js +2 -2
- package/dist/esmdev/webgl/shaders/RaymarchingShaderPart.d.ts +2 -2
- package/dist/esmdev/webgl/shaders/RaymarchingShaderPart.js +35 -23
- package/dist/esmdev/webgl/shaders/RaymarchingShadowShaderPart.js +17 -17
- package/dist/esmdev/webgl/shaders/StandardShaderPart.d.ts +3 -3
- package/dist/esmdev/webgl/shaders/StandardShaderPart.js +15 -15
- package/dist/esmdev/webgl/shaders/glslCommonChunks.d.ts +2 -2
- package/dist/esmdev/webgl/shaders/glslCommonChunks.js +1 -1
- 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.d.ts +2 -2
- package/dist/esmdev/webgl/shaders/nodes/ConstantVariableShader.js +27 -27
- package/dist/esmdev/webgl/shaders/nodes/DiscardShader.d.ts +1 -1
- package/dist/esmdev/webgl/shaders/nodes/DiscardShader.js +8 -8
- package/dist/esmdev/webgl/shaders/nodes/EndShader.d.ts +2 -2
- package/dist/esmdev/webgl/shaders/nodes/EndShader.js +9 -9
- package/dist/esmdev/webgl/shaders/nodes/OutDistance.d.ts +1 -1
- package/dist/esmdev/webgl/shaders/nodes/OutDistance.js +17 -17
- package/dist/esmdev/webgl/shaders/nodes/OutUnion.js +12 -12
- package/dist/esmdev/webgl/shaders/nodes/RaymarchObjectIdUniform.js +11 -11
- package/dist/esmdev/webgl/shaders/nodes/SdApplyTransform.js +12 -12
- package/dist/esmdev/webgl/shaders/nodes/SdApplyWorldMatrix.d.ts +1 -1
- package/dist/esmdev/webgl/shaders/nodes/SdApplyWorldMatrix.js +13 -13
- package/dist/esmdev/webgl/shaders/nodes/Texture2DShader.js +27 -27
- package/dist/esmdev/webgl/shaders/nodes/UniformDataShader.js +27 -27
- package/dist/esmdev/webgl/textureLoader/KTX2TextureLoader.d.ts +1 -1
- package/dist/esmdev/webgl/textureLoader/KTX2TextureLoader.js +36 -30
- package/dist/esmdev/webgpu/AttributeReader.d.ts +18 -0
- package/dist/esmdev/webgpu/AttributeReader.js +57 -0
- package/dist/esmdev/webgpu/GpuCullingRegistry.js +94 -94
- package/dist/esmdev/webgpu/GpuDeformRegistry.js +53 -53
- package/dist/esmdev/webgpu/RangeAllocator.js +16 -16
- package/dist/esmdev/webgpu/ShaderPropertyAccessorWGSL.d.ts +11 -0
- package/dist/esmdev/webgpu/ShaderPropertyAccessorWGSL.js +131 -0
- package/dist/esmdev/webgpu/WebGpuBindGroups.d.ts +131 -0
- package/dist/esmdev/webgpu/WebGpuBindGroups.js +377 -0
- package/dist/esmdev/webgpu/WebGpuBufferArena.js +21 -21
- package/dist/esmdev/webgpu/WebGpuCompressedTextures.d.ts +38 -0
- package/dist/esmdev/webgpu/WebGpuCompressedTextures.js +155 -0
- package/dist/esmdev/webgpu/WebGpuCubeTextureShaders.d.ts +1 -0
- package/dist/esmdev/webgpu/WebGpuCubeTextureShaders.js +68 -0
- package/dist/esmdev/webgpu/WebGpuCubeTextures.d.ts +72 -0
- package/dist/esmdev/webgpu/WebGpuCubeTextures.js +340 -0
- package/dist/esmdev/webgpu/WebGpuDeviceWrapper.js +7 -7
- package/dist/esmdev/webgpu/WebGpuDraw.d.ts +63 -0
- package/dist/esmdev/webgpu/WebGpuDraw.js +133 -0
- package/dist/esmdev/webgpu/WebGpuDrawParameters.d.ts +61 -0
- package/dist/esmdev/webgpu/WebGpuDrawParameters.js +120 -0
- package/dist/esmdev/webgpu/WebGpuExternalRenderPass.d.ts +44 -0
- package/dist/esmdev/webgpu/WebGpuExternalRenderPass.js +115 -0
- package/dist/esmdev/webgpu/WebGpuFrame.d.ts +55 -0
- package/dist/esmdev/webgpu/WebGpuFrame.js +89 -0
- package/dist/esmdev/webgpu/WebGpuFrameRenderer.d.ts +25 -0
- package/dist/esmdev/webgpu/WebGpuFrameRenderer.js +248 -0
- package/dist/esmdev/webgpu/WebGpuGpuCulling.js +200 -454
- package/dist/esmdev/webgpu/WebGpuGpuCullingShaders.d.ts +34 -0
- package/dist/esmdev/webgpu/WebGpuGpuCullingShaders.js +264 -0
- package/dist/esmdev/webgpu/WebGpuGpuTimer.js +52 -52
- package/dist/esmdev/webgpu/WebGpuLightClusterBuilder.js +39 -194
- package/dist/esmdev/webgpu/WebGpuLightClusterShaders.d.ts +14 -0
- package/dist/esmdev/webgpu/WebGpuLightClusterShaders.js +161 -0
- package/dist/esmdev/webgpu/WebGpuMipmapGenerator.d.ts +54 -0
- package/dist/esmdev/webgpu/WebGpuMipmapGenerator.js +187 -0
- package/dist/esmdev/webgpu/WebGpuMipmapShaders.d.ts +1 -0
- package/dist/esmdev/webgpu/WebGpuMipmapShaders.js +34 -0
- package/dist/esmdev/webgpu/WebGpuRenderBundles.d.ts +117 -0
- package/dist/esmdev/webgpu/WebGpuRenderBundles.js +299 -0
- package/dist/esmdev/webgpu/WebGpuRenderPassEncoders.d.ts +140 -0
- package/dist/esmdev/webgpu/WebGpuRenderPassEncoders.js +611 -0
- package/dist/esmdev/webgpu/WebGpuRenderPipelines.d.ts +75 -0
- package/dist/esmdev/webgpu/WebGpuRenderPipelines.js +249 -0
- package/dist/esmdev/webgpu/WebGpuRenderTargetTextures.d.ts +78 -0
- package/dist/esmdev/webgpu/WebGpuRenderTargetTextures.js +108 -0
- package/dist/esmdev/webgpu/WebGpuResourceRepository.d.ts +52 -322
- package/dist/esmdev/webgpu/WebGpuResourceRepository.js +332 -3127
- package/dist/esmdev/webgpu/WebGpuSamplers.d.ts +45 -0
- package/dist/esmdev/webgpu/WebGpuSamplers.js +58 -0
- package/dist/esmdev/webgpu/WebGpuShaderProgramBuilder.d.ts +25 -0
- package/dist/esmdev/webgpu/WebGpuShaderProgramBuilder.js +108 -0
- package/dist/esmdev/webgpu/WebGpuStorageBuffers.d.ts +77 -0
- package/dist/esmdev/webgpu/WebGpuStorageBuffers.js +191 -0
- package/dist/esmdev/webgpu/WebGpuStrategyBasic.d.ts +2 -73
- package/dist/esmdev/webgpu/WebGpuStrategyBasic.js +63 -781
- package/dist/esmdev/webgpu/WebGpuStrategyStorage.d.ts +62 -0
- package/dist/esmdev/webgpu/WebGpuStrategyStorage.js +267 -0
- package/dist/esmdev/webgpu/WebGpuTextureReadback.d.ts +111 -0
- package/dist/esmdev/webgpu/WebGpuTextureReadback.js +188 -0
- package/dist/esmdev/webgpu/WebGpuTextureReadbackShaders.d.ts +4 -0
- package/dist/esmdev/webgpu/WebGpuTextureReadbackShaders.js +34 -0
- package/dist/esmdev/webgpu/WebGpuTextureUploads.d.ts +109 -0
- package/dist/esmdev/webgpu/WebGpuTextureUploads.js +197 -0
- package/dist/esmdev/webgpu/WebGpuTextures.d.ts +196 -0
- package/dist/esmdev/webgpu/WebGpuTextures.js +344 -0
- package/dist/esmdev/webgpu/WebGpuVertexBuffers.d.ts +142 -0
- package/dist/esmdev/webgpu/WebGpuVertexBuffers.js +281 -0
- package/dist/esmdev/webgpu/WebGpuVertexDeformer.js +106 -284
- package/dist/esmdev/webgpu/WebGpuVertexDeformerShaders.d.ts +7 -0
- package/dist/esmdev/webgpu/WebGpuVertexDeformerShaders.js +134 -0
- package/dist/esmdev/webgpu/WebGpuVertexShaderDefinitions.d.ts +16 -0
- package/dist/esmdev/webgpu/WebGpuVertexShaderDefinitions.js +216 -0
- package/dist/esmdev/webgpu/assertArrayBufferView.d.ts +9 -0
- package/dist/esmdev/webgpu/assertArrayBufferView.js +10 -0
- package/dist/esmdev/webgpu/main.d.ts +2 -16
- package/dist/esmdev/webgpu/main.js +3 -3
- package/dist/esmdev/webgpu/padCompressedRowsForUpload.d.ts +20 -0
- package/dist/esmdev/webgpu/padCompressedRowsForUpload.js +20 -0
- package/dist/esmdev/webgpu/removeRowPadding.d.ts +21 -0
- package/dist/esmdev/webgpu/removeRowPadding.js +23 -0
- package/dist/esmdev/webgpu/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.frag.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.frag.wgsl.js +12 -0
- package/dist/esmdev/webgpu/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.vert.wgsl.js +12 -0
- package/dist/esmdev/webgpu/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.frag.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.vert.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/FlatSingleShader/FlatSingleShader.frag.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/GammaCorrectionShader/GammaCorrectionShader.frag.js +2 -2
- 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/MToon1SingleShader/MToon1SingleShader.vert.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/PanoramaToCubeShader/PanoramaToCubeShader.frag.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.frag.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.vert.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/PrefilterIBLShader/PrefilterIBLShader.frag.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/ToneMappingShader/ToneMappingShader.frag.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/common/iblDefinition.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/common/opticalDefinition.wgsl.js +5 -2
- package/dist/esmdev/webgpu/shaderity_shaders/common/processGeometry.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/nodes/ClassicShader.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/nodes/PbrShader.wgsl.js +2 -2
- package/dist/esmdev/webgpu/wgslCommonChunks.d.ts +2 -2
- package/dist/esmdev/webgpu/wgslCommonChunks.js +1 -1
- package/dist/esmdev/xr/WebARSystem.js +69 -69
- package/dist/esmdev/xr/WebXRSystem.d.ts +0 -4
- package/dist/esmdev/xr/WebXRSystem.js +155 -160
- package/package.json +1 -1
- package/dist/esm/foundation/definitions/ProcessApproach.d.ts +0 -21
- package/dist/esm/foundation/definitions/ProcessApproach.js +0 -1
- package/dist/esm/foundation/materials/core/ShaderHandler.d.ts +0 -125
- package/dist/esm/foundation/materials/core/ShaderHandler.js +0 -48
- package/dist/esmdev/foundation/definitions/ProcessApproach.d.ts +0 -21
- package/dist/esmdev/foundation/definitions/ProcessApproach.js +0 -60
- package/dist/esmdev/foundation/materials/core/ShaderHandler.d.ts +0 -125
- package/dist/esmdev/foundation/materials/core/ShaderHandler.js +0 -416
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Component as U}from"../../core/Component.js";import{applyMixins as k}from"../../core/EntityRepository.js";import{BufferUse as G}from"../../definitions/BufferUse.js";import{ComponentType as S}from"../../definitions/ComponentType.js";import{CompositionType as A}from"../../definitions/CompositionType.js";import{ProcessStage as L}from"../../definitions/ProcessStage.js";import{ShaderType as B}from"../../definitions/ShaderType.js";import{_getGizmoClass as I}from"../../gizmos/GizmoRegistry.js";import{AABB as v}from"../../math/AABB.js";import{Matrix44 as T}from"../../math/Matrix44.js";import{MutableMatrix33 as Q}from"../../math/MutableMatrix33.js";import{MutableMatrix44 as d}from"../../math/MutableMatrix44.js";import{MutableQuaternion as R}from"../../math/MutableQuaternion.js";import{MutableScalar as P}from"../../math/MutableScalar.js";import{MutableVector3 as b}from"../../math/MutableVector3.js";import{Quaternion as y}from"../../math/Quaternion.js";import{Vector3 as W}from"../../math/Vector3.js";import{Is as o}from"../../misc/Is.js";import{CameraComponent as z}from"../Camera/CameraComponent.js";import{TransformComponent as D}from"../Transform/TransformComponent.js";import{WellKnownComponentTIDs as w}from"../WellKnownComponentTIDs.js";import{flattenHierarchy as E}from"./SceneGraphOps.js";var i=class i extends U{constructor(t,e,s,n,r){super(t,e,s,n,r);this.Ds=[];this.ur=[];this.mr=!1;this.Ls=0;this._worldMatrix=d.dummy();this._worldMatrixRest=d.identity();this._normalMatrix=Q.dummy();this._previousWorldMatrix=d.dummy();this._worldRotation=R.identity();this.js=!1;this.yr=0;this.dr=!1;this.fr=!1;this._s=!1;this.xr=new v;this.Sr=new v;this.$s=!0;this.Ks=!0;this.Hs=0;this.Ar=-1;this.Br=-1;this._isVisible=P.dummy();this._isBillboard=P.dummy();this.Fs=!1;this.Mr="world";this.io=0;this.toMakeWorldMatrixTheSameAsLocalMatrix=!1;this.isRootJoint=!1;this.jointIndex=-1;this._isCulled=!1;this.nr=-1;i.Wr.push(new WeakRef(this)),this.submitToAllocation(t.config.scenegraphComponentCountPerBufferView,r)}set isVisible(t){this._isVisible.setValue(t?1:0),i.fi(this.i)}get isVisible(){return this._isVisible.getValue()===1}static getUpdateCount(t){var e;return(e=this.pi.get(t))!=null?e:0}static fi(t){var s;let e=(s=this.pi.get(t))!=null?s:0;this.pi.set(t,e+1)}setVisibilityRecursively(t){this.isVisible=t;for(let e of this.Ds)e.setVisibilityRecursively(t)}set isBillboard(t){this._isBillboard.setValue(t?1:0)}get isBillboard(){return this._isBillboard.getValue()===1}setIsBillboardRecursively(t){this._isBillboard.setValue(t?1:0);for(let e of this.Ds)e.isBillboard=t}set isAABBGizmoVisible(t){t?(this.Fs=!0,o.not.defined(this.Es)&&(this.Es=new(I("aabb"))(this.entity.engine,this.entity),this.Es._setup()),this.Es.isVisible=!0):o.exist(this.Es)&&(this.Es.isVisible=!1)}get isAABBGizmoVisible(){return o.exist(this.Es)?this.Es.isVisible:!1}set isLocatorGizmoVisible(t){t?(this.Fs=!0,o.not.defined(this.Qs)&&(this.Qs=new(I("locator"))(this.entity.engine,this.entity),this.Qs._setup()),this.Qs.isVisible=!0):o.exist(this.Qs)&&(this.Qs.isVisible=!1)}get isLocatorGizmoVisible(){return o.exist(this.Qs)?this.Qs.isVisible:!1}set isTranslationGizmoVisible(t){t?(this.Fs=!0,o.not.defined(this.Gs)&&(this.Gs=new(I("translation"))(this.entity.engine,this.entity),this.Gs._setup()),this.Gs.isVisible=!0,this.Vr(),this.Gs.isSetup&&this.Gs._update()):o.exist(this.Gs)&&(this.Gs.isVisible=!1,this.Ir())}get isTranslationGizmoVisible(){return o.exist(this.Gs)?this.Gs.isVisible:!1}set isRotationGizmoVisible(t){t?(this.Fs=!0,o.not.defined(this.Is)&&(this.Is=new(I("rotation"))(this.entity.engine,this.entity),this.Is._setup(),this.Is.setSpace(this.Mr)),this.Is.isVisible=!0,this.Vr(),this.Is.isSetup&&this.Is._update()):o.exist(this.Is)&&(this.Is.isVisible=!1,this.Ir())}get isRotationGizmoVisible(){return o.exist(this.Is)?this.Is.isVisible:!1}set isScaleGizmoVisible(t){t?(this.Fs=!0,o.not.defined(this.Ws)&&(this.Ws=new(I("scale"))(this.entity.engine,this.entity),this.Ws._setup()),this.Ws.isVisible=!0,this.Vr(),this.Ws.isSetup&&this.Ws._update()):o.exist(this.Ws)&&(this.Ws.isVisible=!1,this.Ir())}get isScaleGizmoVisible(){return o.exist(this.Ws)?this.Ws.isVisible:!1}set isJointGizmoVisible(t){t&&this.isJoint()?(this.Fs=!0,o.not.defined(this.Us)&&(this.Us=new(I("joint"))(this.entity.engine,this.entity),this.Us._setup()),this.Us.isVisible=!0):o.exist(this.Us)&&(this.Us.isVisible=!1)}get isJointGizmoVisible(){return o.exist(this.Us)?this.Us.isVisible:!1}static getTopLevelComponents(){return i.Wr.map(t=>t.deref()).filter(t=>t!==void 0?t.isTopLevel:!1)}isJoint(){return this.jointIndex>=0}static get hierarchyVersion(){return i.Gr}static lr(){i.Gr++,i.Hs++}static get componentTID(){return w.SceneGraphComponentTID}get componentTID(){return w.SceneGraphComponentTID}setWorldMatrixRestDirty(){this.matrixRestInner,this.setWorldMatrixRestDirtyRecursively()}setWorldMatrixRestDirtyRecursively(){this.dr=!1;for(let t of this.children)t.setWorldMatrixRestDirtyRecursively()}get worldMatrixVersion(){return this.yr}get _previousWorldMatrixInner(){return this._previousWorldMatrix}get _lastComputedWorldMatrixInner(){return this._worldMatrix}setWorldMatrixDirty(){var t;this.setWorldMatrixDirtyRecursively(),this.mr||(t=this.parent)==null||t.setWorldAABBDirtyParentRecursively()}setWorldMatrixDirtyWithoutAABBDirty(){this.setWorldMatrixDirtyRecursively()}setWorldMatrixDirtyRecursively(){if(!(!this.js&&!this.fr&&!this._s&&this.$s&&this.Ks)){this.yr++,this.js=!1,this.fr=!1,this._s=!1,this.$s=!0,this.Ks=!0;for(let t of this.children)t.setWorldMatrixDirtyRecursively()}}setWorldAABBDirtyParentRecursively(){let t=i.Hs,e=this;for(;e!=null;){if(e.$s=!0,e.Ks=!0,e.Hs===t)return;e.Hs=t,e=e.Yi}}addChild(t,e=!1){let s;e&&(t.logicForce(),s=t.matrix),o.exist(t.Yi)&&t.Yi.removeChild(t),t.Yi=this,this.Ds.push(t),i.lr(),this.cr(t.Ls),e&&o.exist(s)&&(t.matrix=s),t.setWorldMatrixDirtyRecursively(),this.setWorldAABBDirtyParentRecursively()}removeChild(t){let e=this.Ds.indexOf(t);e>=0&&(this.cr(-t.Ls),this.Ds.splice(e,1));let s=this.ur.indexOf(t);s>=0&&this.ur.splice(s,1),t.Yi=void 0,t.mr=!1,i.lr(),t.setWorldMatrixDirtyRecursively(),e>=0&&this.setWorldAABBDirtyParentRecursively()}_addGizmoChild(t){t.Yi=this,t.mr=!0,this.ur.push(t),i.lr()}get isTopLevel(){return this.Yi==null}get children(){return this.Ds}get parent(){return this.Yi}get matrixInner(){return this.js||this.zr(),this._worldMatrix}get matrix(){return this.matrixInner.clone()}setMatrixWithoutPhysics(t){if(o.not.exist(this.Yi))this.entity.getTransform().localMatrixWithoutPhysics=t;else{let e=this.Yi,s=T.invertTo(e.matrixInner,i.Or);this.entity.getTransform().localMatrixWithoutPhysics=T.multiplyTo(s,t,i.gr).clone()}}setMatrixToPhysics(t){this.Dr(t,!0,!0,!0),this.br(!0,!0,!0)}Dr(t,e,s,n){let r=this.entity.tryToGetPhysics();if(r!==void 0&&r.strategy!==void 0){let a=r.strategy;if(s){let l=this.getQuaternionRecursivelyTo(i.Hr);a.setRotation!=null?a.setRotation(l):a.setEulerAngle!=null&&a.setEulerAngle(l.toEulerAnglesTo(i.wr))}e&&a.setPosition!=null&&a.setPosition(t.getTranslateTo(i.qr)),n&&a.setScale!=null&&a.setScale(this._getPhysicsWorldScale(t))}}br(t,e,s){let n=this.entity.tryToGetPhysics()===void 0?0:1;if(this.Ls!==n){this.matrixInner,this.setWorldMatrixDirty();for(let r of this.Ds)!r.toMakeWorldMatrixTheSameAsLocalMatrix&&r.Ls>0&&r.Er(t,e,s)}}Er(t,e,s){if(this.Ls!==0){this.Dr(this.matrixInner,t,e,s);for(let n of this.Ds)!n.toMakeWorldMatrixTheSameAsLocalMatrix&&n.Ls>0&&n.Er(t,e,s)}}_onPhysicsComponentAdded(){this.cr(1)}_onPhysicsComponentRemoved(){this.cr(-1)}get _hasPhysicsComponentInSubtree(){return this.Ls>0}cr(t){this.Ls+=t;let e=this.Yi;e!=null&&e.Ds.includes(this)&&e.cr(t)}set matrix(t){this.setMatrixWithoutPhysics(t),this.setMatrixToPhysics(t)}get matrixRestInner(){return this.dr||this.Qr(),this._worldMatrixRest}get matrixRest(){return this.matrixRestInner.clone()}get normalMatrixInner(){return this.fr||(T.invertTo(this.matrixInner,i.invertedMatrix44),this._normalMatrix.copyComponents(i.invertedMatrix44.transpose()),this.fr=!0),this._normalMatrix}get entityWorldWithSkeletalMatrix(){return this.entityWorldMatrixWithSkeletalInner.clone()}get entityWorldMatrixWithSkeletalInner(){let t=this.entity.tryToGetSkeletal();return o.exist(t)&&t.isWorldMatrixUpdated?t.worldMatrixInner:this.entity.getSceneGraph().matrixInner}get normalMatrix(){return this.normalMatrixInner.clone()}isWorldMatrixUpToDateRecursively(){return this.js?this.Yi?this.Yi.isWorldMatrixUpToDateRecursively():!0:!1}zr(){if(this.js)return this._worldMatrix;let t=this.entity.getTransform();if(this.Yi==null||this.toMakeWorldMatrixTheSameAsLocalMatrix)t.getLocalMatrixInnerTo(this._worldMatrix);else{let e=this.Yi.zr();t.getLocalMatrixInnerTo(i.gr),d.multiplyTo(e,i.gr,this._worldMatrix)}return this.js=!0,this._worldMatrix}Qr(){if(this.dr)return this._worldMatrixRest;let t=this.entity.getTransform();if(this.Yi==null||this.toMakeWorldMatrixTheSameAsLocalMatrix)t.getLocalMatrixInnerTo(this._worldMatrixRest);else{let e=this.Yi.Qr();t.getLocalMatrixInnerTo(i.gr),d.multiplyTo(e,i.gr,this._worldMatrixRest)}return this.dr=!0,this._worldMatrixRest}getQuaternionRecursively(){return y.fromCopyQuaternion(this.getQuaternionRecursivelyTo(i.Nr))}getQuaternionRecursivelyTo(t){let e=this.entity.getTransform().localRotationInner;return this.Yi==null?t.copyComponents(e):(this.Yi.getQuaternionRecursivelyTo(i.Pr),y.multiplyTo(i.Pr,e,t))}get worldPosition(){let t=i.Lr;return this.matrixInner.multiplyVector3To(t,i.returnVector3),i.returnVector3}getWorldPositionOf(t){return this.matrixInner.multiplyVector3(t)}getWorldPositionOfTo(t,e){return this.matrixInner.multiplyVector3To(t,e)}getLocalPositionOf(t){return T.invert(this.matrixInner).multiplyVector3(t)}getLocalPositionOfTo(t,e){return T.invertTo(this.matrixInner,i.vr).multiplyVector3To(t,e)}getWorldAABB(){let t=new v,e=this.entity.tryToGetMesh();o.exist(e)&&o.exist(e.mesh)?(t.mergeAABB(e.mesh.AABB),v.multiplyMatrixTo(this.entity.getSceneGraph().matrixInner,t,i.Js)):i.Js.initialize();let s=this.entity.tryToGetRaymarching();if(o.exist(s)){let n=s.calcWorldAABB();n!=null&&i.Js.mergeAABB(n)}return i.Js}calcWorldMergedAABB(){let t=this.getWorldAABB().clone();for(let e of this.children){let s=e.calcWorldMergedAABB();t.mergeAABB(s)}return this.Sr=t,t}get worldMergedAABB(){return this.$s&&(this.calcWorldMergedAABB(),this.$s=!1,i.Hs++),this.Sr}getWorldAABBWithSkeletal(){let t=new v,e=this.entity.tryToGetMesh();o.exist(e)&&o.exist(e.mesh)?(t.mergeAABB(e.mesh.AABB),v.multiplyMatrixTo(this.entity.getSceneGraph().entityWorldMatrixWithSkeletalInner,t,i.Js)):i.Js.initialize();let s=this.entity.tryToGetRaymarching();if(o.exist(s)){let n=s.calcWorldAABB();n!=null&&i.Js.mergeAABB(n)}return i.Js}calcWorldMergedAABBWithSkeletal(){let t=this.getWorldAABBWithSkeletal().clone();for(let e of this.children){let s=e.calcWorldMergedAABBWithSkeletal();t.mergeAABB(s)}return this.xr=t,t}get worldMergedAABBWithSkeletal(){return this.Ks&&(this.calcWorldMergedAABBWithSkeletal(),this.Ks=!1,i.Hs++),this.xr}castRay(t,e,s=0,n=[]){let r=E(this,!1),a=[];for(let p of r){let h=p.entity.tryToGetMesh();h&&a.push(h)}let l=Number.MAX_VALUE,f,c,g,x=0,M=0;for(let p of a){if(!p.entity.getSceneGraph().isVisible||!p.isPickable||n.indexOf(p)!==-1)continue;let h=p.castRay(t,e,s);o.defined(h.data)&&h.data.t<l&&(l=h.data.t,f=h.data.position,c=p,g=void 0,x=h.data.u,M=h.data.v)}for(let p of r){let h=p.entity.tryToGetRaymarching();if(h==null||!h.isPickable||!p.isVisible)continue;let u=h.castRay(t,e);u!=null&&u.t<l&&(l=u.t,f=u.position,c=void 0,g=h,x=0,M=0)}return(o.exist(c)||o.exist(g))&&o.exist(f)?{result:!0,data:{t:l,u:x,v:M,position:f,selectedMeshComponent:c,selectedRaymarchingComponent:g}}:{result:!1}}castRayFromScreen(t,e,s,n,r=0,a=[]){let l=E(this,!1),f=[];for(let u of l){let m=u.entity.tryToGetMesh();m&&f.push(m)}let c=Number.MAX_VALUE,g,x,M,p=0,h=0;for(let u of f){if(!u.entity.getSceneGraph().isVisible||!u.isPickable||a.indexOf(u)!==-1)continue;let m=u.castRayFromScreenInWorld(t,e,s,n,r);o.defined(m.data)&&m.data.t<c&&(c=m.data.t,g=m.data.position,x=u,M=void 0,p=m.data.u,h=m.data.v)}for(let u of l){let m=u.entity.tryToGetRaymarching();if(m==null||!m.isPickable||!u.isVisible)continue;let C=m.castRayFromScreen(t,e,s,n);C.result&&C.data!=null&&C.data.t<c&&(c=C.data.t,g=C.data.position,x=void 0,M=m,p=0,h=0)}return(o.exist(x)||o.exist(M))&&o.exist(g)?{result:!0,data:{t:c,u:p,v:h,position:g,selectedMeshComponent:x,selectedRaymarchingComponent:M}}:{result:!1}}$load(){this.moveStageTo(L.Logic)}$logic(){this.Ar===this.yr&&this.js&&!this.Fs&&this.Br===this.i.componentRepository._componentCreationCount||this.nr!==D.getUpdateCount(this.i)&&(this.logicForce(),this.nr=D.getUpdateCount(this.i))}logicForce(){this.matrixInner,this.entity.tryToGetMesh()!=null&&this.normalMatrixInner,this.so(),this.Ar=this.yr,this.Br=this.i.componentRepository._componentCreationCount}so(){this.Fs&&(o.exist(this.Es)&&this.Es.isSetup&&this.Es.isVisible&&this.Es._update(),o.exist(this.Qs)&&this.Qs.isSetup&&this.Qs.isVisible&&this.Qs._update(),this.Ur(),o.exist(this.Us)&&this.Us.isSetup&&this.Us.isVisible&&this.Us._update())}Ur(){o.exist(this.Gs)&&this.Gs.isSetup&&this.Gs.isVisible&&this.Gs._update(),o.exist(this.Is)&&this.Is.isSetup&&this.Is.isVisible&&this.Is._update(),o.exist(this.Ws)&&this.Ws.isSetup&&this.Ws.isVisible&&this.Ws._update()}ao(){return o.exist(this.Gs)&&this.Gs.isSetup&&this.Gs.isVisible||o.exist(this.Is)&&this.Is.isSetup&&this.Is.isVisible||o.exist(this.Ws)&&this.Ws.isSetup&&this.Ws.isVisible}Vr(){let t=this.i.objectUID,e=i.qs.get(t);e==null&&(e=new Set,i.qs.set(t,e)),e.add(this)}Ir(){var t;this.ao()||(t=i.qs.get(this.i.objectUID))==null||t.delete(this)}static _updateTransformGizmosByCameraChange(t){let e=z.getCurrent(t),s=z.getCurrentCameraUpdateCount(t),n=t.objectUID,r=i.Tr.get(n);if(r!=null&&r.componentSID===e&&r.updateCount===s)return;i.Tr.set(n,{componentSID:e,updateCount:s});let a=i.qs.get(n);if(a!=null)for(let l of a)l.Ur()}setPositionWithoutPhysics(t){o.not.exist(this.Yi)?this.entity.getTransform().localPositionWithoutPhysics=t:(d.invertTo(this.Yi.entity.getSceneGraph().matrixInner,i.vr),this.entity.getTransform().localPositionWithoutPhysics=i.vr.multiplyVector3(t))}set position(t){this.setPositionWithoutPhysics(t),this.setPositionToPhysics(t)}setPositionToPhysics(t){var s,n;let e=this.entity.tryToGetPhysics();e!==void 0&&e.strategy!==void 0&&((n=(s=e.strategy).setPosition)==null||n.call(s,t)),this.br(!0,!1,!1)}get position(){return this.matrixInner.getTranslate()}getPositionTo(t){return this.matrixInner.getTranslateTo(t)}get positionRest(){return this.matrixRestInner.getTranslate()}getPositionRestTo(t){return this.matrixRestInner.getTranslateTo(t)}set eulerAngles(t){if(o.not.exist(this.Yi))this.entity.getTransform().localEulerAnglesWithoutPhysics=t;else{let e=y.fromMatrix(this.Yi.entity.getSceneGraph().matrixInner),s=y.invert(e),n=y.fromMatrix(T.rotate(t)),r=y.multiply(n,s);this.entity.getTransform().localEulerAnglesWithoutPhysics=r.toEulerAngles()}this.setEulerAnglesToPhysics(t)}setEulerAnglesToPhysics(t){let e=this.entity.tryToGetPhysics();if(e!==void 0&&e.strategy!==void 0){let s=e.strategy;s.setEulerAngle!=null?s.setEulerAngle(t):s.setRotation!=null&&s.setRotation(y.fromMatrix(T.rotate(t)))}this.kr()}get eulerAngles(){return this.matrixInner.toEulerAngles()}setRotationWithoutPhysics(t){if(o.not.exist(this.Yi))this.entity.getTransform().localRotationWithoutPhysics=t;else{let e=this.Yi.entity.getSceneGraph().rotation,s=y.invert(e);this.entity.getTransform().localRotationWithoutPhysics=y.multiply(t,s)}}set rotation(t){this.setRotationWithoutPhysics(t),this.setRotationToPhysics(t)}setRotationToPhysics(t){let e=this.entity.tryToGetPhysics();if(e!==void 0&&e.strategy!==void 0){let s=e.strategy;s.setRotation!=null?s.setRotation(t):s.setEulerAngle!=null&&s.setEulerAngle(t.toEulerAnglesTo(i.wr))}this.kr()}kr(){var e;let t=(e=this.entity.tryToGetPhysics())==null?void 0:e.strategy;(t==null?void 0:t.setScale)!=null&&(this.matrixInner,this.setWorldMatrixDirty(),t.setScale(this._getPhysicsWorldScale(this.matrixInner))),this.br(!0,!0,!0)}Cr(){let t=this.entity.getTransform().localRotationInner;return this.Yi==null||this.toMakeWorldMatrixTheSameAsLocalMatrix?(this._s||(this._worldRotation.copyComponents(t),this._s=!0),this._worldRotation):(this._s||(y.multiplyTo(this.Yi.Cr(),t,this._worldRotation),this._s=!0),this._worldRotation)}get rotation(){return this.rotationInner.clone()}get rotationInner(){return this.Yi==null||this.toMakeWorldMatrixTheSameAsLocalMatrix?this.entity.getTransform().localRotationInner:this.Cr()}getRotationTo(t){let e=this.Cr();return t.setComponents(e._v[0],e._v[1],e._v[2],e._v[3]),t}get rotationRest(){let t=this.parent;return t!=null?y.multiply(t.rotationRest,this.entity.getTransform().localRotationRestInner):this.entity.getTransform().localRotationRestInner}getRotationRest(t){let e=this.parent;return e!=null&&!t(this)?y.multiply(e.getRotationRest(t),this.entity.getTransform().localRotationRestInner):y.identity()}set scale(t){if(o.not.exist(this.Yi))this.entity.getTransform().localScaleWithoutPhysics=t;else{let e=this.Yi.entity.getSceneGraph().matrix;e._v[12]=0,e._v[13]=0,e._v[14]=0;let s=d.invert(e);this.entity.getTransform().localScaleWithoutPhysics=s.multiplyVector3(t)}this.setScaleToPhysics(t)}setScaleToPhysics(t){var s,n;let e=this.entity.tryToGetPhysics();e!==void 0&&e.strategy!==void 0&&((n=(s=e.strategy).setScale)==null||n.call(s,t)),this.br(!0,!0,!0)}get scale(){return this.matrixInner.getScale()}_getPhysicsWorldScale(t=this.matrixInner){let e=this.getQuaternionRecursivelyTo(i.Xr),s=e.transformVector3To(i.jr,i.Yr),n=e.transformVector3To(i.Fr,i.Zr),r=e.transformVector3To(i.Jr,i._r),a=t.getScaleTo(i.$r),l=t.m00*s.x+t.m10*s.y+t.m20*s.z,f=t.m01*n.x+t.m11*n.y+t.m21*n.z,c=t.m02*r.x+t.m12*r.y+t.m22*r.z;return i.Kr.setComponents(l<0?-a.x:a.x,f<0?-a.y:a.y,c<0?-a.z:a.z)}lo(t){let e=t.entity.engine.entityRepository._shallowCopyEntityInner(t.entity);return e.getSceneGraph().Yi=this,i.lr(),e}_shallowCopyFrom(t){let e=t;this.Yi=e.Yi,this.Ds=[],i.lr(),this.Ls=0;for(let s=0;s<e.Ds.length;s++){let n=this.lo(e.Ds[s]).getSceneGraph();this.Ds.push(n),this.cr(n.Ls)}this.ur=e.ur.concat(),this.mr=e.mr,this._worldMatrix.copyComponents(e._worldMatrix),this._previousWorldMatrix.copyComponents(e._previousWorldMatrix),this._worldMatrixRest.copyComponents(e._worldMatrixRest),this._normalMatrix.copyComponents(e._normalMatrix),this.js=!1,this.dr=!1,this.fr=!1,this._s=!1,this.yr++,this.xr=e.xr.clone(),this.$s=!0,this.Ks=!0,this._isVisible.copyComponents(e._isVisible),this._isBillboard.copyComponents(e._isBillboard),this.Mr=e.Mr,this.io=e.io,this.toMakeWorldMatrixTheSameAsLocalMatrix=e.toMakeWorldMatrixTheSameAsLocalMatrix,this.isRootJoint=e.isRootJoint,this.jointIndex=e.jointIndex}get entity(){return this.i.entityRepository.getEntity(this.gn)}setTransformGizmoSpace(t){var e,s,n;this.Mr=t,(e=this.Gs)==null||e.setSpace(t),(s=this.Is)==null||s.setSpace(t),(n=this.Ws)==null||n.setSpace(t)}_destroy(){var t,e,s,n,r,a,l,f;super._destroy(),i.lr(),(t=i.qs.get(this.i.objectUID))==null||t.delete(this),(e=this.Es)==null||e._destroy(),(s=this.Qs)==null||s._destroy(),(n=this.Gs)==null||n._destroy(),(r=this.Is)==null||r._destroy(),(a=this.Ws)==null||a._destroy(),(l=this.Us)==null||l._destroy(),(f=this.parent)==null||f.removeChild(this),this.children.forEach(c=>{var g;return(g=c.parent)==null?void 0:g.removeChild(c)})}addThisComponentToEntity(t,e){class s extends t.constructor{getSceneGraph(){return this.Rr===void 0&&(this.Rr=this.getComponentByComponentTID(w.SceneGraphComponentTID)),this.Rr}get parent(){return this.getSceneGraph().parent}get matrix(){return this.getSceneGraph().matrix}get matrixInner(){return this.getSceneGraph().matrixInner}get position(){return this.getSceneGraph().position}set position(r){let a=this.getSceneGraph();a.position=r}get positionRest(){return this.getSceneGraph().positionRest}get scale(){return this.getSceneGraph().scale}set scale(r){let a=this.getSceneGraph();a.scale=r}get eulerAngles(){return this.getSceneGraph().eulerAngles}set eulerAngles(r){let a=this.getSceneGraph();a.eulerAngles=r}get rotation(){return this.getSceneGraph().rotation}set rotation(r){let a=this.getSceneGraph();a.rotation=r}get rotationRest(){return this.getSceneGraph().rotationRest}addChild(r,a=!1){this.getSceneGraph().addChild(r,a)}get children(){return this.getSceneGraph().children}removeChild(r){this.getSceneGraph().removeChild(r)}}return k(t,s),t}static _cleanupForEngine(t){i.pi.delete(t),i.qs.delete(t.objectUID),i.Tr.delete(t.objectUID)}};i.Gr=0,i.Hs=1,i.Lr=W.zero(),i.jr=W.fromCopy3(1,0,0),i.Fr=W.fromCopy3(0,1,0),i.Jr=W.fromCopy3(0,0,1),i.returnVector3=b.zero(),i.Wr=[],i.invertedMatrix44=d.fromCopyArray16ColumnMajor([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),i.vr=d.identity(),i.gr=d.identity(),i.Or=d.identity(),i.Pr=R.identity(),i.Nr=R.identity(),i.Xr=R.identity(),i.Hr=R.identity(),i.Yr=b.zero(),i.Zr=b.zero(),i._r=b.zero(),i.$r=b.one(),i.Kr=b.one(),i.wr=b.zero(),i.qr=b.zero(),i.pi=new Map,i.Js=new v,i.qs=new Map,i.Tr=new Map;var V=i;V.registerMember({bufferUse:G.GPUInstanceData,memberName:"worldMatrix",dataClassType:d,shaderType:B.VertexAndPixelShader,compositionType:A.Mat4,componentType:S.Float,initValues:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]});V.registerMember({bufferUse:G.GPUInstanceData,memberName:"normalMatrix",dataClassType:Q,shaderType:B.VertexAndPixelShader,compositionType:A.Mat3,componentType:S.Float,initValues:[1,0,0,0,1,0,0,0,1]});V.registerMember({bufferUse:G.GPUInstanceData,memberName:"isVisible",dataClassType:P,shaderType:B.VertexShader,compositionType:A.Scalar,componentType:S.Float,initValues:[1],convertToBool:!0});V.registerMember({bufferUse:G.GPUInstanceData,memberName:"isBillboard",dataClassType:P,shaderType:B.VertexShader,compositionType:A.Scalar,componentType:S.Float,initValues:[0],convertToBool:!0});V.registerMember({bufferUse:G.GPUInstanceData,memberName:"previousWorldMatrix",dataClassType:d,shaderType:B.VertexShader,compositionType:A.Mat4,componentType:S.Float,initValues:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]});export{V as SceneGraphComponent};
|
|
1
|
+
import{Component as U}from"../../core/Component.js";import{applyMixins as k}from"../../core/EntityRepository.js";import{BufferUse as G}from"../../definitions/BufferUse.js";import{ComponentType as S}from"../../definitions/ComponentType.js";import{CompositionType as A}from"../../definitions/CompositionType.js";import{ProcessStage as L}from"../../definitions/ProcessStage.js";import{ShaderType as B}from"../../definitions/ShaderType.js";import{_getGizmoClass as I}from"../../gizmos/GizmoRegistry.js";import{AABB as v}from"../../math/AABB.js";import{Matrix44 as T}from"../../math/Matrix44.js";import{MutableMatrix33 as Q}from"../../math/MutableMatrix33.js";import{MutableMatrix44 as d}from"../../math/MutableMatrix44.js";import{MutableQuaternion as R}from"../../math/MutableQuaternion.js";import{MutableScalar as P}from"../../math/MutableScalar.js";import{MutableVector3 as b}from"../../math/MutableVector3.js";import{Quaternion as y}from"../../math/Quaternion.js";import{Vector3 as W}from"../../math/Vector3.js";import{Is as o}from"../../misc/Is.js";import{CameraComponent as z}from"../Camera/CameraComponent.js";import{TransformComponent as D}from"../Transform/TransformComponent.js";import{WellKnownComponentTIDs as w}from"../WellKnownComponentTIDs.js";import{flattenHierarchy as E}from"./SceneGraphOps.js";var i=class i extends U{constructor(t,e,s,n,r){super(t,e,s,n,r);this.Es=[];this.dr=[];this.fr=!1;this.js=0;this._worldMatrix=d.dummy();this._worldMatrixRest=d.identity();this._normalMatrix=Q.dummy();this._previousWorldMatrix=d.dummy();this._worldRotation=R.identity();this.Hs=!1;this.gr=0;this.xr=!1;this.Mr=!1;this.qs=!1;this.vr=new v;this.Wr=new v;this.lr=!0;this.cr=!0;this.Ks=0;this.Pr=-1;this.wr=-1;this._isVisible=P.dummy();this._isBillboard=P.dummy();this._s=!1;this.Tr="world";this.io=0;this.toMakeWorldMatrixTheSameAsLocalMatrix=!1;this.isRootJoint=!1;this.jointIndex=-1;this._isCulled=!1;this.nr=-1;i.zr.push(new WeakRef(this)),this.submitToAllocation(t.config.scenegraphComponentCountPerBufferView,r)}set isVisible(t){this._isVisible.setValue(t?1:0),i.fi(this.i)}get isVisible(){return this._isVisible.getValue()===1}static getUpdateCount(t){var e;return(e=this.pi.get(t))!=null?e:0}static fi(t){var s;let e=(s=this.pi.get(t))!=null?s:0;this.pi.set(t,e+1)}setVisibilityRecursively(t){this.isVisible=t;for(let e of this.Es)e.setVisibilityRecursively(t)}set isBillboard(t){this._isBillboard.setValue(t?1:0)}get isBillboard(){return this._isBillboard.getValue()===1}setIsBillboardRecursively(t){this._isBillboard.setValue(t?1:0);for(let e of this.Es)e.isBillboard=t}set isAABBGizmoVisible(t){t?(this._s=!0,o.not.defined(this.Qs)&&(this.Qs=new(I("aabb"))(this.entity.engine,this.entity),this.Qs._setup()),this.Qs.isVisible=!0):o.exist(this.Qs)&&(this.Qs.isVisible=!1)}get isAABBGizmoVisible(){return o.exist(this.Qs)?this.Qs.isVisible:!1}set isLocatorGizmoVisible(t){t?(this._s=!0,o.not.defined(this.Us)&&(this.Us=new(I("locator"))(this.entity.engine,this.entity),this.Us._setup()),this.Us.isVisible=!0):o.exist(this.Us)&&(this.Us.isVisible=!1)}get isLocatorGizmoVisible(){return o.exist(this.Us)?this.Us.isVisible:!1}set isTranslationGizmoVisible(t){t?(this._s=!0,o.not.defined(this.Ws)&&(this.Ws=new(I("translation"))(this.entity.engine,this.entity),this.Ws._setup()),this.Ws.isVisible=!0,this.Rr(),this.Ws.isSetup&&this.Ws._update()):o.exist(this.Ws)&&(this.Ws.isVisible=!1,this.Gr())}get isTranslationGizmoVisible(){return o.exist(this.Ws)?this.Ws.isVisible:!1}set isRotationGizmoVisible(t){t?(this._s=!0,o.not.defined(this.Gs)&&(this.Gs=new(I("rotation"))(this.entity.engine,this.entity),this.Gs._setup(),this.Gs.setSpace(this.Tr)),this.Gs.isVisible=!0,this.Rr(),this.Gs.isSetup&&this.Gs._update()):o.exist(this.Gs)&&(this.Gs.isVisible=!1,this.Gr())}get isRotationGizmoVisible(){return o.exist(this.Gs)?this.Gs.isVisible:!1}set isScaleGizmoVisible(t){t?(this._s=!0,o.not.defined(this.Ds)&&(this.Ds=new(I("scale"))(this.entity.engine,this.entity),this.Ds._setup()),this.Ds.isVisible=!0,this.Rr(),this.Ds.isSetup&&this.Ds._update()):o.exist(this.Ds)&&(this.Ds.isVisible=!1,this.Gr())}get isScaleGizmoVisible(){return o.exist(this.Ds)?this.Ds.isVisible:!1}set isJointGizmoVisible(t){t&&this.isJoint()?(this._s=!0,o.not.defined(this.Ls)&&(this.Ls=new(I("joint"))(this.entity.engine,this.entity),this.Ls._setup()),this.Ls.isVisible=!0):o.exist(this.Ls)&&(this.Ls.isVisible=!1)}get isJointGizmoVisible(){return o.exist(this.Ls)?this.Ls.isVisible:!1}static getTopLevelComponents(){return i.zr.map(t=>t.deref()).filter(t=>t!==void 0?t.isTopLevel:!1)}isJoint(){return this.jointIndex>=0}static get hierarchyVersion(){return i.Br}static mr(){i.Br++,i.Ks++}static get componentTID(){return w.SceneGraphComponentTID}get componentTID(){return w.SceneGraphComponentTID}setWorldMatrixRestDirty(){this.matrixRestInner,this.setWorldMatrixRestDirtyRecursively()}setWorldMatrixRestDirtyRecursively(){this.xr=!1;for(let t of this.children)t.setWorldMatrixRestDirtyRecursively()}get worldMatrixVersion(){return this.gr}get _previousWorldMatrixInner(){return this._previousWorldMatrix}get _lastComputedWorldMatrixInner(){return this._worldMatrix}setWorldMatrixDirty(){var t;this.setWorldMatrixDirtyRecursively(),this.fr||(t=this.parent)==null||t.setWorldAABBDirtyParentRecursively()}setWorldMatrixDirtyWithoutAABBDirty(){this.setWorldMatrixDirtyRecursively()}setWorldMatrixDirtyRecursively(){if(!(!this.Hs&&!this.Mr&&!this.qs&&this.lr&&this.cr)){this.gr++,this.Hs=!1,this.Mr=!1,this.qs=!1,this.lr=!0,this.cr=!0;for(let t of this.children)t.setWorldMatrixDirtyRecursively()}}setWorldAABBDirtyParentRecursively(){let t=i.Ks,e=this;for(;e!=null;){if(e.lr=!0,e.cr=!0,e.Ks===t)return;e.Ks=t,e=e.Is}}addChild(t,e=!1){let s;e&&(t.logicForce(),s=t.matrix),o.exist(t.Is)&&t.Is.removeChild(t),t.Is=this,this.Es.push(t),i.mr(),this.yr(t.js),e&&o.exist(s)&&(t.matrix=s),t.setWorldMatrixDirtyRecursively(),this.setWorldAABBDirtyParentRecursively()}removeChild(t){let e=this.Es.indexOf(t);e>=0&&(this.yr(-t.js),this.Es.splice(e,1));let s=this.dr.indexOf(t);s>=0&&this.dr.splice(s,1),t.Is=void 0,t.fr=!1,i.mr(),t.setWorldMatrixDirtyRecursively(),e>=0&&this.setWorldAABBDirtyParentRecursively()}_addGizmoChild(t){t.Is=this,t.fr=!0,this.dr.push(t),i.mr()}get isTopLevel(){return this.Is==null}get children(){return this.Es}get parent(){return this.Is}get matrixInner(){return this.Hs||this.Qr(),this._worldMatrix}get matrix(){return this.matrixInner.clone()}setMatrixWithoutPhysics(t){if(o.not.exist(this.Is))this.entity.getTransform().localMatrixWithoutPhysics=t;else{let e=this.Is,s=T.invertTo(e.matrixInner,i.Hr);this.entity.getTransform().localMatrixWithoutPhysics=T.multiplyTo(s,t,i.br).clone()}}setMatrixToPhysics(t){this.Ur(t,!0,!0,!0),this.Vr(!0,!0,!0)}Ur(t,e,s,n){let r=this.entity.tryToGetPhysics();if(r!==void 0&&r.strategy!==void 0){let a=r.strategy;if(s){let l=this.getQuaternionRecursivelyTo(i._r);a.setRotation!=null?a.setRotation(l):a.setEulerAngle!=null&&a.setEulerAngle(l.toEulerAnglesTo(i.Er))}e&&a.setPosition!=null&&a.setPosition(t.getTranslateTo(i.lo)),n&&a.setScale!=null&&a.setScale(this._getPhysicsWorldScale(t))}}Vr(t,e,s){let n=this.entity.tryToGetPhysics()===void 0?0:1;if(this.js!==n){this.matrixInner,this.setWorldMatrixDirty();for(let r of this.Es)!r.toMakeWorldMatrixTheSameAsLocalMatrix&&r.js>0&&r.kr(t,e,s)}}kr(t,e,s){if(this.js!==0){this.Ur(this.matrixInner,t,e,s);for(let n of this.Es)!n.toMakeWorldMatrixTheSameAsLocalMatrix&&n.js>0&&n.kr(t,e,s)}}_onPhysicsComponentAdded(){this.yr(1)}_onPhysicsComponentRemoved(){this.yr(-1)}get _hasPhysicsComponentInSubtree(){return this.js>0}yr(t){this.js+=t;let e=this.Is;e!=null&&e.Es.includes(this)&&e.yr(t)}set matrix(t){this.setMatrixWithoutPhysics(t),this.setMatrixToPhysics(t)}get matrixRestInner(){return this.xr||this.Lr(),this._worldMatrixRest}get matrixRest(){return this.matrixRestInner.clone()}get normalMatrixInner(){return this.Mr||(T.invertTo(this.matrixInner,i.invertedMatrix44),this._normalMatrix.copyComponents(i.invertedMatrix44.transpose()),this.Mr=!0),this._normalMatrix}get entityWorldWithSkeletalMatrix(){return this.entityWorldMatrixWithSkeletalInner.clone()}get entityWorldMatrixWithSkeletalInner(){let t=this.entity.tryToGetSkeletal();return o.exist(t)&&t.isWorldMatrixUpdated?t.worldMatrixInner:this.entity.getSceneGraph().matrixInner}get normalMatrix(){return this.normalMatrixInner.clone()}isWorldMatrixUpToDateRecursively(){return this.Hs?this.Is?this.Is.isWorldMatrixUpToDateRecursively():!0:!1}Qr(){if(this.Hs)return this._worldMatrix;let t=this.entity.getTransform();if(this.Is==null||this.toMakeWorldMatrixTheSameAsLocalMatrix)t.getLocalMatrixInnerTo(this._worldMatrix);else{let e=this.Is.Qr();t.getLocalMatrixInnerTo(i.br),d.multiplyTo(e,i.br,this._worldMatrix)}return this.Hs=!0,this._worldMatrix}Lr(){if(this.xr)return this._worldMatrixRest;let t=this.entity.getTransform();if(this.Is==null||this.toMakeWorldMatrixTheSameAsLocalMatrix)t.getLocalMatrixInnerTo(this._worldMatrixRest);else{let e=this.Is.Lr();t.getLocalMatrixInnerTo(i.br),d.multiplyTo(e,i.br,this._worldMatrixRest)}return this.xr=!0,this._worldMatrixRest}getQuaternionRecursively(){return y.fromCopyQuaternion(this.getQuaternionRecursivelyTo(i.Yr))}getQuaternionRecursivelyTo(t){let e=this.entity.getTransform().localRotationInner;return this.Is==null?t.copyComponents(e):(this.Is.getQuaternionRecursivelyTo(i.Dr),y.multiplyTo(i.Dr,e,t))}get worldPosition(){let t=i.Jr;return this.matrixInner.multiplyVector3To(t,i.returnVector3),i.returnVector3}getWorldPositionOf(t){return this.matrixInner.multiplyVector3(t)}getWorldPositionOfTo(t,e){return this.matrixInner.multiplyVector3To(t,e)}getLocalPositionOf(t){return T.invert(this.matrixInner).multiplyVector3(t)}getLocalPositionOfTo(t,e){return T.invertTo(this.matrixInner,i.Ir).multiplyVector3To(t,e)}getWorldAABB(){let t=new v,e=this.entity.tryToGetMesh();o.exist(e)&&o.exist(e.mesh)?(t.mergeAABB(e.mesh.AABB),v.multiplyMatrixTo(this.entity.getSceneGraph().matrixInner,t,i.$s)):i.$s.initialize();let s=this.entity.tryToGetRaymarching();if(o.exist(s)){let n=s.calcWorldAABB();n!=null&&i.$s.mergeAABB(n)}return i.$s}calcWorldMergedAABB(){let t=this.getWorldAABB().clone();for(let e of this.children){let s=e.calcWorldMergedAABB();t.mergeAABB(s)}return this.Wr=t,t}get worldMergedAABB(){return this.lr&&(this.calcWorldMergedAABB(),this.lr=!1,i.Ks++),this.Wr}getWorldAABBWithSkeletal(){let t=new v,e=this.entity.tryToGetMesh();o.exist(e)&&o.exist(e.mesh)?(t.mergeAABB(e.mesh.AABB),v.multiplyMatrixTo(this.entity.getSceneGraph().entityWorldMatrixWithSkeletalInner,t,i.$s)):i.$s.initialize();let s=this.entity.tryToGetRaymarching();if(o.exist(s)){let n=s.calcWorldAABB();n!=null&&i.$s.mergeAABB(n)}return i.$s}calcWorldMergedAABBWithSkeletal(){let t=this.getWorldAABBWithSkeletal().clone();for(let e of this.children){let s=e.calcWorldMergedAABBWithSkeletal();t.mergeAABB(s)}return this.vr=t,t}get worldMergedAABBWithSkeletal(){return this.cr&&(this.calcWorldMergedAABBWithSkeletal(),this.cr=!1,i.Ks++),this.vr}castRay(t,e,s=0,n=[]){let r=E(this,!1),a=[];for(let p of r){let h=p.entity.tryToGetMesh();h&&a.push(h)}let l=Number.MAX_VALUE,f,c,g,x=0,M=0;for(let p of a){if(!p.entity.getSceneGraph().isVisible||!p.isPickable||n.indexOf(p)!==-1)continue;let h=p.castRay(t,e,s);o.defined(h.data)&&h.data.t<l&&(l=h.data.t,f=h.data.position,c=p,g=void 0,x=h.data.u,M=h.data.v)}for(let p of r){let h=p.entity.tryToGetRaymarching();if(h==null||!h.isPickable||!p.isVisible)continue;let u=h.castRay(t,e);u!=null&&u.t<l&&(l=u.t,f=u.position,c=void 0,g=h,x=0,M=0)}return(o.exist(c)||o.exist(g))&&o.exist(f)?{result:!0,data:{t:l,u:x,v:M,position:f,selectedMeshComponent:c,selectedRaymarchingComponent:g}}:{result:!1}}castRayFromScreen(t,e,s,n,r=0,a=[]){let l=E(this,!1),f=[];for(let u of l){let m=u.entity.tryToGetMesh();m&&f.push(m)}let c=Number.MAX_VALUE,g,x,M,p=0,h=0;for(let u of f){if(!u.entity.getSceneGraph().isVisible||!u.isPickable||a.indexOf(u)!==-1)continue;let m=u.castRayFromScreenInWorld(t,e,s,n,r);o.defined(m.data)&&m.data.t<c&&(c=m.data.t,g=m.data.position,x=u,M=void 0,p=m.data.u,h=m.data.v)}for(let u of l){let m=u.entity.tryToGetRaymarching();if(m==null||!m.isPickable||!u.isVisible)continue;let C=m.castRayFromScreen(t,e,s,n);C.result&&C.data!=null&&C.data.t<c&&(c=C.data.t,g=C.data.position,x=void 0,M=m,p=0,h=0)}return(o.exist(x)||o.exist(M))&&o.exist(g)?{result:!0,data:{t:c,u:p,v:h,position:g,selectedMeshComponent:x,selectedRaymarchingComponent:M}}:{result:!1}}$load(){this.moveStageTo(L.Logic)}$logic(){this.Pr===this.gr&&this.Hs&&!this._s&&this.wr===this.i.componentRepository._componentCreationCount||this.nr!==D.getUpdateCount(this.i)&&(this.logicForce(),this.nr=D.getUpdateCount(this.i))}logicForce(){this.matrixInner,this.entity.tryToGetMesh()!=null&&this.normalMatrixInner,this.ho(),this.Pr=this.gr,this.wr=this.i.componentRepository._componentCreationCount}ho(){this._s&&(o.exist(this.Qs)&&this.Qs.isSetup&&this.Qs.isVisible&&this.Qs._update(),o.exist(this.Us)&&this.Us.isSetup&&this.Us.isVisible&&this.Us._update(),this.jr(),o.exist(this.Ls)&&this.Ls.isSetup&&this.Ls.isVisible&&this.Ls._update())}jr(){o.exist(this.Ws)&&this.Ws.isSetup&&this.Ws.isVisible&&this.Ws._update(),o.exist(this.Gs)&&this.Gs.isSetup&&this.Gs.isVisible&&this.Gs._update(),o.exist(this.Ds)&&this.Ds.isSetup&&this.Ds.isVisible&&this.Ds._update()}co(){return o.exist(this.Ws)&&this.Ws.isSetup&&this.Ws.isVisible||o.exist(this.Gs)&&this.Gs.isSetup&&this.Gs.isVisible||o.exist(this.Ds)&&this.Ds.isSetup&&this.Ds.isVisible}Rr(){let t=this.i.objectUID,e=i.ur.get(t);e==null&&(e=new Set,i.ur.set(t,e)),e.add(this)}Gr(){var t;this.co()||(t=i.ur.get(this.i.objectUID))==null||t.delete(this)}static _updateTransformGizmosByCameraChange(t){let e=z.getCurrent(t),s=z.getCurrentCameraUpdateCount(t),n=t.objectUID,r=i.Cr.get(n);if(r!=null&&r.componentSID===e&&r.updateCount===s)return;i.Cr.set(n,{componentSID:e,updateCount:s});let a=i.ur.get(n);if(a!=null)for(let l of a)l.jr()}setPositionWithoutPhysics(t){o.not.exist(this.Is)?this.entity.getTransform().localPositionWithoutPhysics=t:(d.invertTo(this.Is.entity.getSceneGraph().matrixInner,i.Ir),this.entity.getTransform().localPositionWithoutPhysics=i.Ir.multiplyVector3(t))}set position(t){this.setPositionWithoutPhysics(t),this.setPositionToPhysics(t)}setPositionToPhysics(t){var s,n;let e=this.entity.tryToGetPhysics();e!==void 0&&e.strategy!==void 0&&((n=(s=e.strategy).setPosition)==null||n.call(s,t)),this.Vr(!0,!1,!1)}get position(){return this.matrixInner.getTranslate()}getPositionTo(t){return this.matrixInner.getTranslateTo(t)}get positionRest(){return this.matrixRestInner.getTranslate()}getPositionRestTo(t){return this.matrixRestInner.getTranslateTo(t)}set eulerAngles(t){if(o.not.exist(this.Is))this.entity.getTransform().localEulerAnglesWithoutPhysics=t;else{let e=y.fromMatrix(this.Is.entity.getSceneGraph().matrixInner),s=y.invert(e),n=y.fromMatrix(T.rotate(t)),r=y.multiply(n,s);this.entity.getTransform().localEulerAnglesWithoutPhysics=r.toEulerAngles()}this.setEulerAnglesToPhysics(t)}setEulerAnglesToPhysics(t){let e=this.entity.tryToGetPhysics();if(e!==void 0&&e.strategy!==void 0){let s=e.strategy;s.setEulerAngle!=null?s.setEulerAngle(t):s.setRotation!=null&&s.setRotation(y.fromMatrix(T.rotate(t)))}this.Fr()}get eulerAngles(){return this.matrixInner.toEulerAngles()}setRotationWithoutPhysics(t){if(o.not.exist(this.Is))this.entity.getTransform().localRotationWithoutPhysics=t;else{let e=this.Is.entity.getSceneGraph().rotation,s=y.invert(e);this.entity.getTransform().localRotationWithoutPhysics=y.multiply(t,s)}}set rotation(t){this.setRotationWithoutPhysics(t),this.setRotationToPhysics(t)}setRotationToPhysics(t){let e=this.entity.tryToGetPhysics();if(e!==void 0&&e.strategy!==void 0){let s=e.strategy;s.setRotation!=null?s.setRotation(t):s.setEulerAngle!=null&&s.setEulerAngle(t.toEulerAnglesTo(i.Er))}this.Fr()}Fr(){var e;let t=(e=this.entity.tryToGetPhysics())==null?void 0:e.strategy;(t==null?void 0:t.setScale)!=null&&(this.matrixInner,this.setWorldMatrixDirty(),t.setScale(this._getPhysicsWorldScale(this.matrixInner))),this.Vr(!0,!0,!0)}Sr(){let t=this.entity.getTransform().localRotationInner;return this.Is==null||this.toMakeWorldMatrixTheSameAsLocalMatrix?(this.qs||(this._worldRotation.copyComponents(t),this.qs=!0),this._worldRotation):(this.qs||(y.multiplyTo(this.Is.Sr(),t,this._worldRotation),this.qs=!0),this._worldRotation)}get rotation(){return this.rotationInner.clone()}get rotationInner(){return this.Is==null||this.toMakeWorldMatrixTheSameAsLocalMatrix?this.entity.getTransform().localRotationInner:this.Sr()}getRotationTo(t){let e=this.Sr();return t.setComponents(e._v[0],e._v[1],e._v[2],e._v[3]),t}get rotationRest(){let t=this.parent;return t!=null?y.multiply(t.rotationRest,this.entity.getTransform().localRotationRestInner):this.entity.getTransform().localRotationRestInner}getRotationRest(t){let e=this.parent;return e!=null&&!t(this)?y.multiply(e.getRotationRest(t),this.entity.getTransform().localRotationRestInner):y.identity()}set scale(t){if(o.not.exist(this.Is))this.entity.getTransform().localScaleWithoutPhysics=t;else{let e=this.Is.entity.getSceneGraph().matrix;e._v[12]=0,e._v[13]=0,e._v[14]=0;let s=d.invert(e);this.entity.getTransform().localScaleWithoutPhysics=s.multiplyVector3(t)}this.setScaleToPhysics(t)}setScaleToPhysics(t){var s,n;let e=this.entity.tryToGetPhysics();e!==void 0&&e.strategy!==void 0&&((n=(s=e.strategy).setScale)==null||n.call(s,t)),this.Vr(!0,!0,!0)}get scale(){return this.matrixInner.getScale()}_getPhysicsWorldScale(t=this.matrixInner){let e=this.getQuaternionRecursivelyTo(i.Zr),s=e.transformVector3To(i.Or,i.$r),n=e.transformVector3To(i.Nr,i.Kr),r=e.transformVector3To(i.Xr,i.qr),a=t.getScaleTo(i.so),l=t.m00*s.x+t.m10*s.y+t.m20*s.z,f=t.m01*n.x+t.m11*n.y+t.m21*n.z,c=t.m02*r.x+t.m12*r.y+t.m22*r.z;return i.ao.setComponents(l<0?-a.x:a.x,f<0?-a.y:a.y,c<0?-a.z:a.z)}uo(t){let e=t.entity.engine.entityRepository._shallowCopyEntityInner(t.entity);return e.getSceneGraph().Is=this,i.mr(),e}_shallowCopyFrom(t){let e=t;this.Is=e.Is,this.Es=[],i.mr(),this.js=0;for(let s=0;s<e.Es.length;s++){let n=this.uo(e.Es[s]).getSceneGraph();this.Es.push(n),this.yr(n.js)}this.dr=e.dr.concat(),this.fr=e.fr,this._worldMatrix.copyComponents(e._worldMatrix),this._previousWorldMatrix.copyComponents(e._previousWorldMatrix),this._worldMatrixRest.copyComponents(e._worldMatrixRest),this._normalMatrix.copyComponents(e._normalMatrix),this.Hs=!1,this.xr=!1,this.Mr=!1,this.qs=!1,this.gr++,this.vr=e.vr.clone(),this.lr=!0,this.cr=!0,this._isVisible.copyComponents(e._isVisible),this._isBillboard.copyComponents(e._isBillboard),this.Tr=e.Tr,this.io=e.io,this.toMakeWorldMatrixTheSameAsLocalMatrix=e.toMakeWorldMatrixTheSameAsLocalMatrix,this.isRootJoint=e.isRootJoint,this.jointIndex=e.jointIndex}get entity(){return this.i.entityRepository.getEntity(this.gn)}setTransformGizmoSpace(t){var e,s,n;this.Tr=t,(e=this.Ws)==null||e.setSpace(t),(s=this.Gs)==null||s.setSpace(t),(n=this.Ds)==null||n.setSpace(t)}_destroy(){var t,e,s,n,r,a,l,f;super._destroy(),i.mr(),(t=i.ur.get(this.i.objectUID))==null||t.delete(this),(e=this.Qs)==null||e._destroy(),(s=this.Us)==null||s._destroy(),(n=this.Ws)==null||n._destroy(),(r=this.Gs)==null||r._destroy(),(a=this.Ds)==null||a._destroy(),(l=this.Ls)==null||l._destroy(),(f=this.parent)==null||f.removeChild(this),this.children.forEach(c=>{var g;return(g=c.parent)==null?void 0:g.removeChild(c)})}addThisComponentToEntity(t,e){class s extends t.constructor{getSceneGraph(){return this.Ar===void 0&&(this.Ar=this.getComponentByComponentTID(w.SceneGraphComponentTID)),this.Ar}get parent(){return this.getSceneGraph().parent}get matrix(){return this.getSceneGraph().matrix}get matrixInner(){return this.getSceneGraph().matrixInner}get position(){return this.getSceneGraph().position}set position(r){let a=this.getSceneGraph();a.position=r}get positionRest(){return this.getSceneGraph().positionRest}get scale(){return this.getSceneGraph().scale}set scale(r){let a=this.getSceneGraph();a.scale=r}get eulerAngles(){return this.getSceneGraph().eulerAngles}set eulerAngles(r){let a=this.getSceneGraph();a.eulerAngles=r}get rotation(){return this.getSceneGraph().rotation}set rotation(r){let a=this.getSceneGraph();a.rotation=r}get rotationRest(){return this.getSceneGraph().rotationRest}addChild(r,a=!1){this.getSceneGraph().addChild(r,a)}get children(){return this.getSceneGraph().children}removeChild(r){this.getSceneGraph().removeChild(r)}}return k(t,s),t}static _cleanupForEngine(t){i.pi.delete(t),i.ur.delete(t.objectUID),i.Cr.delete(t.objectUID)}};i.Br=0,i.Ks=1,i.Jr=W.zero(),i.Or=W.fromCopy3(1,0,0),i.Nr=W.fromCopy3(0,1,0),i.Xr=W.fromCopy3(0,0,1),i.returnVector3=b.zero(),i.zr=[],i.invertedMatrix44=d.fromCopyArray16ColumnMajor([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),i.Ir=d.identity(),i.br=d.identity(),i.Hr=d.identity(),i.Dr=R.identity(),i.Yr=R.identity(),i.Zr=R.identity(),i._r=R.identity(),i.$r=b.zero(),i.Kr=b.zero(),i.qr=b.zero(),i.so=b.one(),i.ao=b.one(),i.Er=b.zero(),i.lo=b.zero(),i.pi=new Map,i.$s=new v,i.ur=new Map,i.Cr=new Map;var V=i;V.registerMember({bufferUse:G.GPUInstanceData,memberName:"worldMatrix",dataClassType:d,shaderType:B.VertexAndPixelShader,compositionType:A.Mat4,componentType:S.Float,initValues:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]});V.registerMember({bufferUse:G.GPUInstanceData,memberName:"normalMatrix",dataClassType:Q,shaderType:B.VertexAndPixelShader,compositionType:A.Mat3,componentType:S.Float,initValues:[1,0,0,0,1,0,0,0,1]});V.registerMember({bufferUse:G.GPUInstanceData,memberName:"isVisible",dataClassType:P,shaderType:B.VertexShader,compositionType:A.Scalar,componentType:S.Float,initValues:[1],convertToBool:!0});V.registerMember({bufferUse:G.GPUInstanceData,memberName:"isBillboard",dataClassType:P,shaderType:B.VertexShader,compositionType:A.Scalar,componentType:S.Float,initValues:[0],convertToBool:!0});V.registerMember({bufferUse:G.GPUInstanceData,memberName:"previousWorldMatrix",dataClassType:d,shaderType:B.VertexShader,compositionType:A.Mat4,componentType:S.Float,initValues:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]});export{V as SceneGraphComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Component as b}from"../../core/Component.js";import{applyMixins as F}from"../../core/EntityRepository.js";import{ProcessStage as R}from"../../definitions/ProcessStage.js";import{normalizeShapeDescriptor as V}from"../../geometry/Shape.js";import{_getGizmoClass as Y}from"../../gizmos/GizmoRegistry.js";import{Quaternion as _,Vector3 as m}from"../../math/index.js";import{WellKnownComponentTIDs as d}from"../WellKnownComponentTIDs.js";var D=class extends b{constructor(e,t,o,i,n){super(e,t,o,i,n);this.mo=new Map;this.
|
|
1
|
+
import{Component as b}from"../../core/Component.js";import{applyMixins as F}from"../../core/EntityRepository.js";import{ProcessStage as R}from"../../definitions/ProcessStage.js";import{normalizeShapeDescriptor as V}from"../../geometry/Shape.js";import{_getGizmoClass as Y}from"../../gizmos/GizmoRegistry.js";import{Quaternion as _,Vector3 as m}from"../../math/index.js";import{WellKnownComponentTIDs as d}from"../WellKnownComponentTIDs.js";var D=class extends b{constructor(e,t,o,i,n){super(e,t,o,i,n);this.mo=new Map;this.yo=0;this.moveStageTo(R.Logic)}static get componentTID(){return d.ShapeComponentTID}get componentTID(){return d.ShapeComponentTID}addShape(e,t={}){var n;let o=this.So(e,t),i=this.yo++;return this.mo.set(i,o),(n=this.po)==null||n.rebuild(),i}updateShape(e,t,o={}){var i;return this.mo.has(e)?(this.mo.set(e,this.So(t,o)),(i=this.po)==null||i.rebuild(),!0):!1}So(e,t){var y,S,f,z,C,g,I,w,B,E,v,x,A,T;let o=V(e),i=(S=(y=t.position)==null?void 0:y.x)!=null?S:0,n=(z=(f=t.position)==null?void 0:f.y)!=null?z:0,h=(g=(C=t.position)==null?void 0:C.z)!=null?g:0;if(![i,n,h].every(Number.isFinite))throw new Error("Shape local position components must be finite.");let s=m.fromCopy3(i,n,h);if(![s.x,s.y,s.z].every(Number.isFinite))throw new Error("Shape local position components must be representable as finite numbers.");let u=(w=(I=t.rotation)==null?void 0:I.x)!=null?w:0,r=(E=(B=t.rotation)==null?void 0:B.y)!=null?E:0,p=(x=(v=t.rotation)==null?void 0:v.z)!=null?x:0,a=(T=(A=t.rotation)==null?void 0:A.w)!=null?T:1;if(![u,r,p,a].every(Number.isFinite))throw new Error("Shape local rotation components must be finite.");let c=Math.hypot(u,r,p,a);if(!Number.isFinite(c)||c===0)throw new Error("Shape local rotation must be a non-zero quaternion.");let l=1/c;return Object.freeze({shape:o,localPosition:s,localRotation:_.fromCopy4(u*l,r*l,p*l,a*l)})}addBoxFromAabb(e,t={}){var n;if(e.isVanilla())throw new Error("Cannot create a box from an uninitialized AABB.");let o=(n=t.origin)!=null?n:m.zero();if([e.sizeX,e.sizeY,e.sizeZ,o.x,o.y,o.z].some(h=>!Number.isFinite(h))||e.sizeX<=0||e.sizeY<=0||e.sizeZ<=0)throw new Error("Box AABB and origin must contain finite values and positive dimensions.");return this.addShape({type:"box",size:m.fromCopy3(e.sizeX,e.sizeY,e.sizeZ)},{position:m.subtract(e.centerPoint,o)})}addCapsuleFromAabb(e,t={}){var r,p,a;if(e.isVanilla())throw new Error("Cannot create a capsule from an uninitialized AABB.");let o=(r=t.origin)!=null?r:m.zero(),i=(p=t.radiusScale)!=null?p:1,n=(a=t.maxRadiusToHeightRatio)!=null?a:.2;if([e.sizeX,e.sizeY,e.sizeZ,o.x,o.y,o.z,i,n].some(c=>!Number.isFinite(c))||e.sizeX<=0||e.sizeY<=0||e.sizeZ<=0)throw new Error("Capsule AABB and origin must contain finite values and positive dimensions.");if(i<=0||n<=0||n>=.5)throw new Error("Capsule radiusScale must be positive and maxRadiusToHeightRatio must be between 0 and 0.5.");let s=Math.min(Math.max(e.sizeX,e.sizeZ)/2*i,e.sizeY*n),u=e.sizeY-s*2;return this.addShape({type:"capsule",height:u,radiusBottom:s,radiusTop:s},{position:m.subtract(e.centerPoint,o)})}getShape(e=0){return this.mo.get(e)}removeShape(e){var t;return!Number.isInteger(e)||e<0||!this.mo.delete(e)?!1:((t=this.po)==null||t.rebuild(),!0)}clearShapes(){var e;this.mo.clear(),(e=this.po)==null||e.rebuild()}get shapeCount(){return this.mo.size}_getShapeEntries(){return this.mo.entries()}$logic(){var e;(e=this.po)!=null&&e.isVisible&&this.po._update()}set isShapeGizmoVisible(e){e&&this.po==null&&(this.po=new(Y("shape"))(this.i,this),this.po._setup()),this.po!=null&&(this.po.isVisible=e)}get isShapeGizmoVisible(){var e,t;return(t=(e=this.po)==null?void 0:e.isVisible)!=null?t:!1}get shapeGizmo(){return this.po}_shallowCopyFrom(e){let t=e;this.mo=new Map(t.mo),this.yo=t.yo}_destroy(){var e;(e=this.po)==null||e._destroy(),this.po=void 0,this.clearShapes(),this.yo=0,super._destroy()}addThisComponentToEntity(e,t){class o extends e.constructor{getShape(){return this.getComponentByComponentTID(d.ShapeComponentTID)}}return F(e,o),e}};export{D as ShapeComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Quaternion as e,Vector3 as a}from"../../../math/index.js";import{Is as l}from"../../../misc/Is.js";import{getTranslationScale as Q}from"./AnimationRetarget.js";var o=class o{constructor(n){this.Ea=n}getEntity(){return this.Ea}getSrcPGRestQ(n){let t,r=n.getSceneGraph().parent;return l.exist(r)?t=r.getRotationRest(s=>l.exist(s.entity.tryToGetVrm())):t=e.identity(),t}getDstPGRestQ(n){let t,r=n.getSceneGraph().parent;return l.exist(r)?t=r.getRotationRest(s=>l.exist(s.entity.tryToGetVrm())):t=e.identity(),t}retargetQuaternion(n){let t=this.Ea,r=t.getTransform().localRotationInner,s=t.getTransform().localRotationRestInner,c=this.getSrcPGRestQ(t),m=e.multiply(c,e.multiply(r,e.multiply(e.invert(s),e.invert(c)))),p=n.getTransform().localRotationRestInner,i=this.getDstPGRestQ(n),y=e.multiply(e.invert(i),e.multiply(m,e.multiply(i,p)));return e.multiply(e.multiply(o.
|
|
1
|
+
import{Quaternion as e,Vector3 as a}from"../../../math/index.js";import{Is as l}from"../../../misc/Is.js";import{getTranslationScale as Q}from"./AnimationRetarget.js";var o=class o{constructor(n){this.Ea=n}getEntity(){return this.Ea}getSrcPGRestQ(n){let t,r=n.getSceneGraph().parent;return l.exist(r)?t=r.getRotationRest(s=>l.exist(s.entity.tryToGetVrm())):t=e.identity(),t}getDstPGRestQ(n){let t,r=n.getSceneGraph().parent;return l.exist(r)?t=r.getRotationRest(s=>l.exist(s.entity.tryToGetVrm())):t=e.identity(),t}retargetQuaternion(n){let t=this.Ea,r=t.getTransform().localRotationInner,s=t.getTransform().localRotationRestInner,c=this.getSrcPGRestQ(t),m=e.multiply(c,e.multiply(r,e.multiply(e.invert(s),e.invert(c)))),p=n.getTransform().localRotationRestInner,i=this.getDstPGRestQ(n),y=e.multiply(e.invert(i),e.multiply(m,e.multiply(i,p)));return e.multiply(e.multiply(o.Io,y),e.invert(o.Io))}retargetTranslate(n){let t=this.Ea,r=t.getTransform().localPositionInner,s=t.getTransform().localPositionRestInner,c=this.getSrcPGRestQ(t),m=a.subtract(r,s),p=c.transformVector3(m),i=n.getTransform().localPositionRestInner,y=this.getDstPGRestQ(n),I=Q(t,n,s,i),g=a.multiply(p,I),u=a.add(y.transformVector3Inverse(g),i);return o.Io.transformVector3(u)}retargetScale(n){return this.Ea.getTransform().localScaleInner}};o.Io=e.fromAxisAngle(a.fromCopy3(0,1,0),Math.PI);var R=o;export{R as GlobalRetargetReverse};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Component as j}from"../../core/Component.js";import{applyMixins as P}from"../../core/EntityRepository.js";import{BoneDataType as b}from"../../definitions/BoneDataType.js";import{BufferUse as A}from"../../definitions/BufferUse.js";import{ComponentType as E}from"../../definitions/ComponentType.js";import{CompositionType as B}from"../../definitions/CompositionType.js";import{ProcessStage as W}from"../../definitions/ProcessStage.js";import{ShaderType as k}from"../../definitions/ShaderType.js";import{MathUtil as U}from"../../math/MathUtil.js";import{Matrix44 as O}from"../../math/Matrix44.js";import{MutableMatrix44 as v}from"../../math/MutableMatrix44.js";import{MutableQuaternion as z}from"../../math/MutableQuaternion.js";import{MutableVector4 as I}from"../../math/MutableVector4.js";import{VectorN as C}from"../../math/VectorN.js";import{DataUtil as $,Is as L}from"../../misc/index.js";import{AnimationStateRepository as _}from"../Animation/AnimationStateRepository.js";import{SceneGraphComponent as N}from"../SceneGraph/SceneGraphComponent.js";import{WellKnownComponentTIDs as J}from"../WellKnownComponentTIDs.js";var H=2147483648,s=class s extends j{constructor(t,e,i,n,a){super(t,e,i,n,a);this._jointIndices=[];this._a=[];this.isSkinning=!0;this._boneData=C.dummy();this._boneDataLocation=I.dummy();this._boneDataInfo=I.dummy();this._previousBoneData=C.dummy();this._previousBoneDataLocation=I.dummy();this._previousBoneDataInfo=I.dummy();this.Ha=!1;this.Qa=b.Vec4x2;this.qa=!1;this.Ka=!1;this.Wa=0;this.Ya=new Float32Array(0);this.wa=v.identity();this.La=!0;this._isCulled=!1;this.yo=-1;this.bo=-1;this.Do=!1;this.xo=-1;this.Io=-1;if(this.moveStageTo(W.Logic),a){this.Mo(),this.wa=v.identity(),this.La=!0,this._a=[],this.ja=void 0,this.topOfJointsHierarchy=void 0,this._bindShapeMatrix=void 0,this.isSkinning=!0,this.Qa=b.Vec4x2,this.qa=!1,this.Ha=!1,this.Ka=!1,this.Ma=void 0,this.Wa=0,this.Fa=void 0,this.Ua=void 0,this.Ja=void 0,this.yo=-1,this.bo=-1;return}s.Go++}Mo(){this._boneData.isDummy()||this._boneData._v.fill(0),this._boneData=C.dummy(),this.Za=void 0,this.So()}So(){this._previousBoneData.isDummy()||this._previousBoneData._v.fill(0),this._previousBoneData=C.dummy(),this.Vo()}Vo(){this._previousBoneDataInfo.isDummy()||(this._previousBoneDataInfo._v[3]=-1)}static get componentTID(){return J.SkeletalComponentTID}get componentTID(){return J.SkeletalComponentTID}setInverseBindMatricesAccessor(t){this.Ga=t,this.Ja=s.Ao(t),this.Xa()}setJoints(t){this.$a(),this._a=t,this.Fa=s.Eo(t),this.Mo();let e=this.boneDataType;this.Wa=s.Lo(e,t.length);let i=this.No;this.submitToAllocation(this.i.config.skeletalComponentCountPerBufferView,i),this.Za=new Uint32Array(this._boneData._v.buffer,this._boneData._v.byteOffset,this._boneData._v.length),this.Ma=e,this.vo(1,1,1,e),this.Xa()}get boneDataType(){var t;return(t=this.i.config.boneDataType)!=null?t:this.Qa}setBoneDataType(t,e=!1){this.Qa=t,this.qa=e,this.Bo()}Bo(){let t=this.boneDataType;this.Ma===void 0||this.Ma===t||this.setJoints(this._a)}static Lo(t,e){return Math.max(e,1)*b.getVec4CountPerJoint(t)}_getArrayLengthForAllocation(t){if(t==="boneData"&&this.Wa>0)return this.Wa;if(t==="previousBoneData")return this.Ha&&this.Wa>0?this.Wa:1}vo(t,e,i,n){if(this._boneDataInfo.isDummy())return;let a=this._boneDataInfo._v;a[0]=t,a[1]=e,a[2]=i,a[3]=n.index}updateJointsLightweight(t){this.$a(),this._a=t,this.Fa=s.Eo(t),this.Xa()}getJoints(){return this._a.concat()}get rootJointWorldMatrixInner(){var t;return(t=this.topOfJointsHierarchy)==null?void 0:t.matrixInner}get jointMatrices(){return this.ja}get boneDataArray(){return this._boneData._v}get boneDataInfo(){return this._boneDataInfo}_enablePreviousBoneData(){this.Ha||(this.Ha=!0,!this._boneData.isDummy()&&(this.So(),this.submitToAllocation(this.i.config.skeletalComponentCountPerBufferView,this.No),this.Vo()))}_updatePreviousBoneData(){if(!this.Ha||this._boneData.isDummy()||this._previousBoneData.isDummy())return!1;let t=this._boneData._v,e=this._previousBoneData._v;if(e.length!==t.length)return!1;let i=this._boneDataInfo._v,n=this._previousBoneDataInfo._v,a=n[0]===i[0]&&n[1]===i[1]&&n[2]===i[2]&&n[3]===i[3];if(a){let r=new Uint32Array(t.buffer,t.byteOffset,t.length),c=new Uint32Array(e.buffer,e.byteOffset,e.length);for(let u=0;u<r.length;u++)if(r[u]!==c[u]){a=!1;break}}return a?!1:(e.set(t),n.set(i),!0)}get _previousBoneDataArray(){return this._previousBoneData._v}get worldMatrix(){return this.wa.clone()}get worldMatrixInner(){return v.multiplyTo(this.entity.matrixInner,this.wa,s.Or)}get isWorldMatrixUpdated(){return!this.La}set isJointGizmosVisible(t){for(let e=0;e<this._a.length;e++)this._a[e].isJointGizmoVisible=t}get isJointGizmosVisible(){for(let t=0;t<this._a.length;t++)if(this._a[t].isJointGizmoVisible)return!0;return!1}$logic(){if(!this.isSkinning)return;let t=_.getProcessFrameToken(this.i);if(_.handleFrameTransitionIfNeeded(this.i,t),this._boneData.isDummy())return;if(this._isCulled){this.$a(),this.ko(),this.Ua!==void 0&&_.addCulledSkeletonJoints(this.i,this.Ua,this._a);return}this.Bo(),this.ko();let e=this.Ua,i=_.getOrCreateCacheLeaders(this.i),n=_.getOrCreateLeaderJointIndexToEntityUID(this.i),a=_.getOrCreateCurrentFrameCachedEntityUIDs(this.i);if(e){let o=s.fo.get(e);if((o==null?void 0:o.processFrameToken)===t){if(!(i.get(e)===this.entityUID))for(let y of this._a){let p=n.get(y.jointIndex);p!==void 0&&p!==y.entityUID&&a.add(y.entityUID)}this.jo(o),this.$a();return}i.set(e,this.entityUID);for(let l of this._a)n.set(l.jointIndex,l.entityUID)}if(this.Po(e)){e&&s.fo.set(e,this.Uo(t));return}let r=this.Ma,c=this._boneData._v,u=this.Za,m=this.Wo(r),w=v.invertTo(this.entity.matrixInner,s.Jo),f=!1;for(let o=0;o<this._a.length;o++){let l=this._a[o],y=l.matrixInner,p=v.multiplyTo(w,v.multiplyTypedArrayTo(y,this.Ga.getTypedArray(),s.vr,o),s.gr);this._bindShapeMatrix&&p.multiply(this._bindShapeMatrix);let d=p;if(o===0&&l.entity.tryToGetAnimation()!=null&&this.wa.copyComponents(d),o===1&&this._a[0].entity.tryToGetAnimation()==null&&this.wa.copyComponents(d),this.La=!1,r===b.Mat43x1){this.Oo(d,o);continue}let h=d._v,D=Math.hypot(h[0],h[1],h[2]),M=Math.hypot(h[4],h[5],h[6]),T=Math.hypot(h[8],h[9],h[10]),F=s.zo(h)<0;if(r===b.Vec4x2){let S=F?-D:D,g=s.wo(d,S,M,T),V=U.encodeLogQuat(g.x,g.y,g.z,g.w),x=o*8;c[x+0]=h[12],c[x+1]=h[13],c[x+2]=h[14],u[x+3]=V[0],c[x+4]=S,c[x+5]=M,c[x+6]=T,u[x+7]=V[1]}else{!f&&!U.isUniformScale(D,M,T)&&(f=!0);let S=F?-1:1,g=s.wo(d,S*D,S*M,S*T),V=U.encodeLogQuat(g.x,g.y,g.z,g.w);m[o*4+0]=h[12],m[o*4+1]=h[13],m[o*4+2]=h[14],m[o*4+3]=Math.max(D,M,T),u[o*4+0]=V[0],u[o*4+1]=F?(V[1]|H)>>>0:V[1]}}if(f&&this.$o()){this.$logic();return}if(r===b.Vec4x1){let o=1,l=1,y=1;for(let p=0;p<this._a.length;p++){let d=Math.abs(m[p*4+0]);d>o&&(o=d);let h=Math.abs(m[p*4+1]);h>l&&(l=h);let D=Math.abs(m[p*4+2]);D>y&&(y=D)}for(let p=0;p<this._a.length;p++){let d=m[p*4+0]/o,h=m[p*4+1]/l,D=m[p*4+2]/y,M=U.encodeVec4x1Scale(m[p*4+3]),T=U.packSnormVec4ToUVec2(d,h,D,M);u[p*4+2]=T[0],u[p*4+3]=T[1]}this.vo(o,l,y,r)}else this.vo(1,1,1,r);e&&s.fo.set(e,this.Uo(t)),this.Ho(e)}static zo(t){return t[0]*(t[5]*t[10]-t[6]*t[9])+t[1]*(t[6]*t[8]-t[4]*t[10])+t[2]*(t[4]*t[9]-t[5]*t[8])}static wo(t,e,i,n){let a=t._v,r=1/e,c=1/i,u=1/n;a[0]*=r,a[1]*=r,a[2]*=r,a[4]*=c,a[5]*=c,a[6]*=c,a[8]*=u,a[9]*=u,a[10]*=u;let m=s.Fo;return m.tryFromMatrix(t)||m.setComponents(0,0,0,1),m}$o(){let t=this.Qo();if(this.i.config.boneDataType==null&&t.every(e=>e.qa)){for(let e of t)e.setBoneDataType(b.Vec4x2,!0);return this.i.logger.info(`SkeletalComponent (entity ${this.entityUID}): switched the bone data type from Vec4x1 to Vec4x2 because a non-uniform scale was found (${t.length} component(s) sharing the skinning cache).`),this.Ma===b.Vec4x2}return this.Ka||(this.Ka=!0,this.i.logger.warn(`SkeletalComponent (entity ${this.entityUID}): the Vec4x1 bone data type supports only uniform scale, but a non-uniform scale was found. The largest scale is used. Use Vec4x2 or Mat43x1 for this skeleton.`)),!1}Qo(){var i;let t=this.Ua;return t==null?[this]:((i=this.i.componentRepository.getComponentsWithType(s))!=null?i:[]).filter(n=>n===this||n.Ua===t)}Wo(t){if(t!==b.Vec4x1)return this.Ya;let e=this._a.length*4;return this.Ya.length<e&&(this.Ya=new Float32Array(e)),this.Ya}Oo(t,e){this._boneData._v[e*12+0]=t._v[0],this._boneData._v[e*12+1]=t._v[1],this._boneData._v[e*12+2]=t._v[2],this._boneData._v[e*12+3]=t._v[4],this._boneData._v[e*12+4]=t._v[5],this._boneData._v[e*12+5]=t._v[6],this._boneData._v[e*12+6]=t._v[8],this._boneData._v[e*12+7]=t._v[9],this._boneData._v[e*12+8]=t._v[10],this._boneData._v[e*12+9]=t._v[12],this._boneData._v[e*12+10]=t._v[13],this._boneData._v[e*12+11]=t._v[14]}getInverseBindMatricesAccessor(){return this.Ga}_shallowCopyFrom(t){let e=t;this._jointIndices=e._jointIndices.concat(),this.Qa=e.Qa,this.qa=e.qa,e._a.length>0?(this.setJoints(e._a.concat()),this.Ro(e)):(this._a=[],this.$a()),this.Ga=e.Ga,L.exist(e._bindShapeMatrix)&&(this._bindShapeMatrix=e._bindShapeMatrix.clone()),this.topOfJointsHierarchy=e.topOfJointsHierarchy,this.isSkinning=e.isSkinning,this.wa.copyComponents(e.wa),this.La=e.La,this.Ja=e.Ja,this.Fa=e.Fa,this.Xa()}get entity(){return this.i.entityRepository.getEntity(this.gn)}_destroy(){this.$a(),super._destroy()}static isEntityCached(t,e){return _.isEntityCached(t,e)}addThisComponentToEntity(t,e){class i extends t.constructor{getSkeletal(){return this.getComponentByComponentTID(J.SkeletalComponentTID)}}return P(t,i),t}_getInverseBindMatrices(t){let e=this._a.indexOf(t),i=this.Ga.getTypedArray();return new O(i.slice(e*16,e*16+16))}Ro(t){let e=(i,n)=>{i.isDummy()||n.isDummy()||i.copyComponents(n)};L.exist(t.ja)?this.ja=t.ja.concat():this.ja=void 0,this.Ma===t.Ma&&this._boneData._v.length===t._boneData._v.length&&(e(this._boneData,t._boneData),!this._boneDataInfo.isDummy()&&!t._boneDataInfo.isDummy()&&this._boneDataInfo.copyComponents(t._boneDataInfo))}static _registerBoneDataMember(){s.registerMember({bufferUse:A.GPUInstanceData,memberName:"boneDataLocation",dataClassType:I,shaderType:k.VertexShader,compositionType:B.Vec4,componentType:E.Float,initValues:[0,0,0,0]}),s.registerMember({bufferUse:A.GPUInstanceData,memberName:"boneData",dataClassType:C,shaderType:k.VertexShader,compositionType:B.Vec4Array,componentType:E.Float,initValues:new C(new Float32Array(0)),isVariableLength:!0}),s.registerMember({bufferUse:A.GPUInstanceData,memberName:"previousBoneDataLocation",dataClassType:I,shaderType:k.VertexShader,compositionType:B.Vec4,componentType:E.Float,initValues:[0,0,0,0]}),s.registerMember({bufferUse:A.GPUInstanceData,memberName:"previousBoneData",dataClassType:C,shaderType:k.VertexShader,compositionType:B.Vec4Array,componentType:E.Float,initValues:new C(new Float32Array(0)),isVariableLength:!0})}static _registerBoneDataInfoMember(){s.registerMember({bufferUse:A.GPUInstanceData,memberName:"boneDataInfo",dataClassType:I,shaderType:k.VertexShader,compositionType:B.Vec4,componentType:E.Float,initValues:[1,1,1,b.Vec4x2.index]}),s.registerMember({bufferUse:A.GPUInstanceData,memberName:"previousBoneDataInfo",dataClassType:I,shaderType:k.VertexShader,compositionType:B.Vec4,componentType:E.Float,initValues:[1,1,1,-1]})}static Eo(t){return t.map(e=>e.jointIndex>=0?e.jointIndex:-1).join(",")}static qo(t){let e=2166136261;for(let i=0;i<t.length;i++)e^=t[i],e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24),e>>>=0;return e>>>0}static Ao(t){let e=this.go.get(t);if(e!==void 0)return e;let i=t.getTypedArray(),n=new Uint8Array(i.buffer,i.byteOffset,i.byteLength),r=this.qo(n).toString(16);return this.go.set(t,r),r}static Zo(t){if(!t)return"no_bind_shape";let e=this._o.get(t);if(e!==void 0)return e;let i=Array.from(t._v).join(",");return this._o.set(t,i),i}Xo(){if(this.entity.parent!=null)return this.Yo(this.entity.parent.entity)}Yo(t){let e=[],i=n=>{let a=n.tryToGetAnimation();if(a!=null){let r=a.getAnimationChannelsOfTrack();if(r.size>0){let c=new Set,u=a.getActiveAnimationTrack(),m=Array.from(r.keys()).some(f=>f.startsWith("vrmExpression/")),w=!1;for(let[f,o]of r)if(!f.startsWith("vrmExpression/")&&o.animatedValue.getAllTrackNames().includes(u)){w=!0;break}if(w){let f=a.currentTrackFeatureHash();f!=null&&c.add(f)}if(c.size===0&&!m)for(let[f,o]of r){if(f.startsWith("vrmExpression/"))continue;let l=o.animatedValue.getFirstActiveAnimationSamplerTrackName(),y=a.getAnimationTrackFeatureHash(l);y!=null&&c.add(y)}for(let f of c)e.push(f)}}for(let r of n.children)i(r.entity)};if(i(t),e.length!==0)return e.length===1?e[0]:$.toCRC32(e.join("|"))}ko(){this.yo===_.getAnimationBindingVersion()&&this.bo===N.hierarchyVersion||this.Xa()}Xa(){var i,n;if(this.yo=_.getAnimationBindingVersion(),this.bo=N.hierarchyVersion,!this.Ga){this.Ua=void 0;return}this.Ja||(this.Ja=s.Ao(this.Ga));let t=this.Xo(),e=((i=this.Ma)!=null?i:this.boneDataType).index;if(t!=null)this.Ua=`anim|${t.toString()}|${this.Ja}|${(n=this.Fa)!=null?n:""}|${e}`;else{if(!this.Fa){this.Ua=void 0;return}this.Ua=`${this.Fa}|${this.Ja}|no_animation|${e}`}}$a(){this.Do=!1}Po(t){if(!this.Do||this.To!==t||this.Co!==this._bindShapeMatrix)return!1;let e=this.entity.getSceneGraph();if(e==null||e.worldMatrixVersion!==this.Io)return!1;let i=0;for(let n=0;n<this._a.length;n++)i+=this._a[n].worldMatrixVersion;return i===this.xo}Ho(t){var i,n;let e=0;for(let a=0;a<this._a.length;a++)e+=this._a[a].worldMatrixVersion;this.To=t,this.xo=e,this.Io=(n=(i=this.entity.getSceneGraph())==null?void 0:i.worldMatrixVersion)!=null?n:-1,this.Co=this._bindShapeMatrix,this.Do=!0}Uo(t){let e=this._boneDataInfo._v;return{processFrameToken:t,boneData:this._boneData.isDummy()?void 0:this._boneData._v,boneDataInfo:[e[0],e[1],e[2],e[3]],jointMatrix:this.wa._v,isWorldMatrixVanilla:this.La}}jo(t){if(this.La=t.isWorldMatrixVanilla,this.wa._v.set(t.jointMatrix),t.boneData==null)return;let e=this._a.length*b.getVec4CountPerJoint(this.Ma)*4;this._boneData._v.set(t.boneData.subarray(0,Math.min(e,this._boneData._v.length))),this._boneDataInfo.isDummy()||this._boneDataInfo._v.set(t.boneDataInfo)}};s.fo=new Map,s.go=new WeakMap,s._o=new WeakMap,s.Go=0,s.vr=v.identity(),s.Fo=z.fromCopy4(0,0,0,1),s.Jo=v.identity(),s.gr=v.identity(),s.Or=v.identity();var G=s;G._registerBoneDataMember();G._registerBoneDataInfoMember();export{G as SkeletalComponent};
|
|
1
|
+
import{Component as j}from"../../core/Component.js";import{applyMixins as P}from"../../core/EntityRepository.js";import{BoneDataType as b}from"../../definitions/BoneDataType.js";import{BufferUse as A}from"../../definitions/BufferUse.js";import{ComponentType as E}from"../../definitions/ComponentType.js";import{CompositionType as B}from"../../definitions/CompositionType.js";import{ProcessStage as W}from"../../definitions/ProcessStage.js";import{ShaderType as k}from"../../definitions/ShaderType.js";import{MathUtil as U}from"../../math/MathUtil.js";import{Matrix44 as O}from"../../math/Matrix44.js";import{MutableMatrix44 as v}from"../../math/MutableMatrix44.js";import{MutableQuaternion as z}from"../../math/MutableQuaternion.js";import{MutableVector4 as I}from"../../math/MutableVector4.js";import{VectorN as C}from"../../math/VectorN.js";import{DataUtil as $,Is as L}from"../../misc/index.js";import{AnimationStateRepository as _}from"../Animation/AnimationStateRepository.js";import{SceneGraphComponent as N}from"../SceneGraph/SceneGraphComponent.js";import{WellKnownComponentTIDs as J}from"../WellKnownComponentTIDs.js";var H=2147483648,s=class s extends j{constructor(t,e,i,n,a){super(t,e,i,n,a);this._jointIndices=[];this._a=[];this.isSkinning=!0;this._boneData=C.dummy();this._boneDataLocation=I.dummy();this._boneDataInfo=I.dummy();this._previousBoneData=C.dummy();this._previousBoneDataLocation=I.dummy();this._previousBoneDataInfo=I.dummy();this.Ha=!1;this.Qa=b.Vec4x2;this.qa=!1;this.Ka=!1;this.Wa=0;this.Ya=new Float32Array(0);this.wa=v.identity();this.La=!0;this._isCulled=!1;this.bo=-1;this.Do=-1;this.vo=!1;this.Co=-1;this.Mo=-1;if(this.moveStageTo(W.Logic),a){this.Ao(),this.wa=v.identity(),this.La=!0,this._a=[],this.ja=void 0,this.topOfJointsHierarchy=void 0,this._bindShapeMatrix=void 0,this.isSkinning=!0,this.Qa=b.Vec4x2,this.qa=!1,this.Ha=!1,this.Ka=!1,this.Ma=void 0,this.Wa=0,this.Fa=void 0,this.Ua=void 0,this.Ja=void 0,this.bo=-1,this.Do=-1;return}s.Lo++}Ao(){this._boneData.isDummy()||this._boneData._v.fill(0),this._boneData=C.dummy(),this.Za=void 0,this.Eo()}Eo(){this._previousBoneData.isDummy()||this._previousBoneData._v.fill(0),this._previousBoneData=C.dummy(),this.Bo()}Bo(){this._previousBoneDataInfo.isDummy()||(this._previousBoneDataInfo._v[3]=-1)}static get componentTID(){return J.SkeletalComponentTID}get componentTID(){return J.SkeletalComponentTID}setInverseBindMatricesAccessor(t){this.Ga=t,this.Ja=s.ko(t),this.Xa()}setJoints(t){this.$a(),this._a=t,this.Fa=s.Uo(t),this.Ao();let e=this.boneDataType;this.Wa=s.Po(e,t.length);let i=this.Wo;this.submitToAllocation(this.i.config.skeletalComponentCountPerBufferView,i),this.Za=new Uint32Array(this._boneData._v.buffer,this._boneData._v.byteOffset,this._boneData._v.length),this.Ma=e,this.go(1,1,1,e),this.Xa()}get boneDataType(){var t;return(t=this.i.config.boneDataType)!=null?t:this.Qa}setBoneDataType(t,e=!1){this.Qa=t,this.qa=e,this.wo()}wo(){let t=this.boneDataType;this.Ma===void 0||this.Ma===t||this.setJoints(this._a)}static Po(t,e){return Math.max(e,1)*b.getVec4CountPerJoint(t)}_getArrayLengthForAllocation(t){if(t==="boneData"&&this.Wa>0)return this.Wa;if(t==="previousBoneData")return this.Ha&&this.Wa>0?this.Wa:1}go(t,e,i,n){if(this._boneDataInfo.isDummy())return;let a=this._boneDataInfo._v;a[0]=t,a[1]=e,a[2]=i,a[3]=n.index}updateJointsLightweight(t){this.$a(),this._a=t,this.Fa=s.Uo(t),this.Xa()}getJoints(){return this._a.concat()}get rootJointWorldMatrixInner(){var t;return(t=this.topOfJointsHierarchy)==null?void 0:t.matrixInner}get jointMatrices(){return this.ja}get boneDataArray(){return this._boneData._v}get boneDataInfo(){return this._boneDataInfo}_enablePreviousBoneData(){this.Ha||(this.Ha=!0,!this._boneData.isDummy()&&(this.Eo(),this.submitToAllocation(this.i.config.skeletalComponentCountPerBufferView,this.Wo),this.Bo()))}_updatePreviousBoneData(){if(!this.Ha||this._boneData.isDummy()||this._previousBoneData.isDummy())return!1;let t=this._boneData._v,e=this._previousBoneData._v;if(e.length!==t.length)return!1;let i=this._boneDataInfo._v,n=this._previousBoneDataInfo._v,a=n[0]===i[0]&&n[1]===i[1]&&n[2]===i[2]&&n[3]===i[3];if(a){let r=new Uint32Array(t.buffer,t.byteOffset,t.length),c=new Uint32Array(e.buffer,e.byteOffset,e.length);for(let u=0;u<r.length;u++)if(r[u]!==c[u]){a=!1;break}}return a?!1:(e.set(t),n.set(i),!0)}get _previousBoneDataArray(){return this._previousBoneData._v}get worldMatrix(){return this.wa.clone()}get worldMatrixInner(){return v.multiplyTo(this.entity.matrixInner,this.wa,s.Hr)}get isWorldMatrixUpdated(){return!this.La}set isJointGizmosVisible(t){for(let e=0;e<this._a.length;e++)this._a[e].isJointGizmoVisible=t}get isJointGizmosVisible(){for(let t=0;t<this._a.length;t++)if(this._a[t].isJointGizmoVisible)return!0;return!1}$logic(){if(!this.isSkinning)return;let t=_.getProcessFrameToken(this.i);if(_.handleFrameTransitionIfNeeded(this.i,t),this._boneData.isDummy())return;if(this._isCulled){this.$a(),this.Go(),this.Ua!==void 0&&_.addCulledSkeletonJoints(this.i,this.Ua,this._a);return}this.wo(),this.Go();let e=this.Ua,i=_.getOrCreateCacheLeaders(this.i),n=_.getOrCreateLeaderJointIndexToEntityUID(this.i),a=_.getOrCreateCurrentFrameCachedEntityUIDs(this.i);if(e){let o=s.fo.get(e);if((o==null?void 0:o.processFrameToken)===t){if(!(i.get(e)===this.entityUID))for(let y of this._a){let p=n.get(y.jointIndex);p!==void 0&&p!==y.entityUID&&a.add(y.entityUID)}this.Oo(o),this.$a();return}i.set(e,this.entityUID);for(let l of this._a)n.set(l.jointIndex,l.entityUID)}if(this.zo(e)){e&&s.fo.set(e,this.Fo(t));return}let r=this.Ma,c=this._boneData._v,u=this.Za,m=this.$o(r),w=v.invertTo(this.entity.matrixInner,s.jo),f=!1;for(let o=0;o<this._a.length;o++){let l=this._a[o],y=l.matrixInner,p=v.multiplyTo(w,v.multiplyTypedArrayTo(y,this.Ga.getTypedArray(),s.Ir,o),s.br);this._bindShapeMatrix&&p.multiply(this._bindShapeMatrix);let d=p;if(o===0&&l.entity.tryToGetAnimation()!=null&&this.wa.copyComponents(d),o===1&&this._a[0].entity.tryToGetAnimation()==null&&this.wa.copyComponents(d),this.La=!1,r===b.Mat43x1){this.Ho(d,o);continue}let h=d._v,D=Math.hypot(h[0],h[1],h[2]),M=Math.hypot(h[4],h[5],h[6]),T=Math.hypot(h[8],h[9],h[10]),F=s.Qo(h)<0;if(r===b.Vec4x2){let S=F?-D:D,g=s.Jo(d,S,M,T),V=U.encodeLogQuat(g.x,g.y,g.z,g.w),x=o*8;c[x+0]=h[12],c[x+1]=h[13],c[x+2]=h[14],u[x+3]=V[0],c[x+4]=S,c[x+5]=M,c[x+6]=T,u[x+7]=V[1]}else{!f&&!U.isUniformScale(D,M,T)&&(f=!0);let S=F?-1:1,g=s.Jo(d,S*D,S*M,S*T),V=U.encodeLogQuat(g.x,g.y,g.z,g.w);m[o*4+0]=h[12],m[o*4+1]=h[13],m[o*4+2]=h[14],m[o*4+3]=Math.max(D,M,T),u[o*4+0]=V[0],u[o*4+1]=F?(V[1]|H)>>>0:V[1]}}if(f&&this.Ro()){this.$logic();return}if(r===b.Vec4x1){let o=1,l=1,y=1;for(let p=0;p<this._a.length;p++){let d=Math.abs(m[p*4+0]);d>o&&(o=d);let h=Math.abs(m[p*4+1]);h>l&&(l=h);let D=Math.abs(m[p*4+2]);D>y&&(y=D)}for(let p=0;p<this._a.length;p++){let d=m[p*4+0]/o,h=m[p*4+1]/l,D=m[p*4+2]/y,M=U.encodeVec4x1Scale(m[p*4+3]),T=U.packSnormVec4ToUVec2(d,h,D,M);u[p*4+2]=T[0],u[p*4+3]=T[1]}this.go(o,l,y,r)}else this.go(1,1,1,r);e&&s.fo.set(e,this.Fo(t)),this.qo(e)}static Qo(t){return t[0]*(t[5]*t[10]-t[6]*t[9])+t[1]*(t[6]*t[8]-t[4]*t[10])+t[2]*(t[4]*t[9]-t[5]*t[8])}static Jo(t,e,i,n){let a=t._v,r=1/e,c=1/i,u=1/n;a[0]*=r,a[1]*=r,a[2]*=r,a[4]*=c,a[5]*=c,a[6]*=c,a[8]*=u,a[9]*=u,a[10]*=u;let m=s.No;return m.tryFromMatrix(t)||m.setComponents(0,0,0,1),m}Ro(){let t=this.Xo();if(this.i.config.boneDataType==null&&t.every(e=>e.qa)){for(let e of t)e.setBoneDataType(b.Vec4x2,!0);return this.i.logger.info(`SkeletalComponent (entity ${this.entityUID}): switched the bone data type from Vec4x1 to Vec4x2 because a non-uniform scale was found (${t.length} component(s) sharing the skinning cache).`),this.Ma===b.Vec4x2}return this.Ka||(this.Ka=!0,this.i.logger.warn(`SkeletalComponent (entity ${this.entityUID}): the Vec4x1 bone data type supports only uniform scale, but a non-uniform scale was found. The largest scale is used. Use Vec4x2 or Mat43x1 for this skeleton.`)),!1}Xo(){var i;let t=this.Ua;return t==null?[this]:((i=this.i.componentRepository.getComponentsWithType(s))!=null?i:[]).filter(n=>n===this||n.Ua===t)}$o(t){if(t!==b.Vec4x1)return this.Ya;let e=this._a.length*4;return this.Ya.length<e&&(this.Ya=new Float32Array(e)),this.Ya}Ho(t,e){this._boneData._v[e*12+0]=t._v[0],this._boneData._v[e*12+1]=t._v[1],this._boneData._v[e*12+2]=t._v[2],this._boneData._v[e*12+3]=t._v[4],this._boneData._v[e*12+4]=t._v[5],this._boneData._v[e*12+5]=t._v[6],this._boneData._v[e*12+6]=t._v[8],this._boneData._v[e*12+7]=t._v[9],this._boneData._v[e*12+8]=t._v[10],this._boneData._v[e*12+9]=t._v[12],this._boneData._v[e*12+10]=t._v[13],this._boneData._v[e*12+11]=t._v[14]}getInverseBindMatricesAccessor(){return this.Ga}_shallowCopyFrom(t){let e=t;this._jointIndices=e._jointIndices.concat(),this.Qa=e.Qa,this.qa=e.qa,e._a.length>0?(this.setJoints(e._a.concat()),this.Yo(e)):(this._a=[],this.$a()),this.Ga=e.Ga,L.exist(e._bindShapeMatrix)&&(this._bindShapeMatrix=e._bindShapeMatrix.clone()),this.topOfJointsHierarchy=e.topOfJointsHierarchy,this.isSkinning=e.isSkinning,this.wa.copyComponents(e.wa),this.La=e.La,this.Ja=e.Ja,this.Fa=e.Fa,this.Xa()}get entity(){return this.i.entityRepository.getEntity(this.gn)}_destroy(){this.$a(),super._destroy()}static isEntityCached(t,e){return _.isEntityCached(t,e)}addThisComponentToEntity(t,e){class i extends t.constructor{getSkeletal(){return this.getComponentByComponentTID(J.SkeletalComponentTID)}}return P(t,i),t}_getInverseBindMatrices(t){let e=this._a.indexOf(t),i=this.Ga.getTypedArray();return new O(i.slice(e*16,e*16+16))}Yo(t){let e=(i,n)=>{i.isDummy()||n.isDummy()||i.copyComponents(n)};L.exist(t.ja)?this.ja=t.ja.concat():this.ja=void 0,this.Ma===t.Ma&&this._boneData._v.length===t._boneData._v.length&&(e(this._boneData,t._boneData),!this._boneDataInfo.isDummy()&&!t._boneDataInfo.isDummy()&&this._boneDataInfo.copyComponents(t._boneDataInfo))}static _registerBoneDataMember(){s.registerMember({bufferUse:A.GPUInstanceData,memberName:"boneDataLocation",dataClassType:I,shaderType:k.VertexShader,compositionType:B.Vec4,componentType:E.Float,initValues:[0,0,0,0]}),s.registerMember({bufferUse:A.GPUInstanceData,memberName:"boneData",dataClassType:C,shaderType:k.VertexShader,compositionType:B.Vec4Array,componentType:E.Float,initValues:new C(new Float32Array(0)),isVariableLength:!0}),s.registerMember({bufferUse:A.GPUInstanceData,memberName:"previousBoneDataLocation",dataClassType:I,shaderType:k.VertexShader,compositionType:B.Vec4,componentType:E.Float,initValues:[0,0,0,0]}),s.registerMember({bufferUse:A.GPUInstanceData,memberName:"previousBoneData",dataClassType:C,shaderType:k.VertexShader,compositionType:B.Vec4Array,componentType:E.Float,initValues:new C(new Float32Array(0)),isVariableLength:!0})}static _registerBoneDataInfoMember(){s.registerMember({bufferUse:A.GPUInstanceData,memberName:"boneDataInfo",dataClassType:I,shaderType:k.VertexShader,compositionType:B.Vec4,componentType:E.Float,initValues:[1,1,1,b.Vec4x2.index]}),s.registerMember({bufferUse:A.GPUInstanceData,memberName:"previousBoneDataInfo",dataClassType:I,shaderType:k.VertexShader,compositionType:B.Vec4,componentType:E.Float,initValues:[1,1,1,-1]})}static Uo(t){return t.map(e=>e.jointIndex>=0?e.jointIndex:-1).join(",")}static Zo(t){let e=2166136261;for(let i=0;i<t.length;i++)e^=t[i],e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24),e>>>=0;return e>>>0}static ko(t){let e=this._o.get(t);if(e!==void 0)return e;let i=t.getTypedArray(),n=new Uint8Array(i.buffer,i.byteOffset,i.byteLength),r=this.Zo(n).toString(16);return this._o.set(t,r),r}static eh(t){if(!t)return"no_bind_shape";let e=this.To.get(t);if(e!==void 0)return e;let i=Array.from(t._v).join(",");return this.To.set(t,i),i}Ko(){if(this.entity.parent!=null)return this.th(this.entity.parent.entity)}th(t){let e=[],i=n=>{let a=n.tryToGetAnimation();if(a!=null){let r=a.getAnimationChannelsOfTrack();if(r.size>0){let c=new Set,u=a.getActiveAnimationTrack(),m=Array.from(r.keys()).some(f=>f.startsWith("vrmExpression/")),w=!1;for(let[f,o]of r)if(!f.startsWith("vrmExpression/")&&o.animatedValue.getAllTrackNames().includes(u)){w=!0;break}if(w){let f=a.currentTrackFeatureHash();f!=null&&c.add(f)}if(c.size===0&&!m)for(let[f,o]of r){if(f.startsWith("vrmExpression/"))continue;let l=o.animatedValue.getFirstActiveAnimationSamplerTrackName(),y=a.getAnimationTrackFeatureHash(l);y!=null&&c.add(y)}for(let f of c)e.push(f)}}for(let r of n.children)i(r.entity)};if(i(t),e.length!==0)return e.length===1?e[0]:$.toCRC32(e.join("|"))}Go(){this.bo===_.getAnimationBindingVersion()&&this.Do===N.hierarchyVersion||this.Xa()}Xa(){var i,n;if(this.bo=_.getAnimationBindingVersion(),this.Do=N.hierarchyVersion,!this.Ga){this.Ua=void 0;return}this.Ja||(this.Ja=s.ko(this.Ga));let t=this.Ko(),e=((i=this.Ma)!=null?i:this.boneDataType).index;if(t!=null)this.Ua=`anim|${t.toString()}|${this.Ja}|${(n=this.Fa)!=null?n:""}|${e}`;else{if(!this.Fa){this.Ua=void 0;return}this.Ua=`${this.Fa}|${this.Ja}|no_animation|${e}`}}$a(){this.vo=!1}zo(t){if(!this.vo||this.xo!==t||this.Vo!==this._bindShapeMatrix)return!1;let e=this.entity.getSceneGraph();if(e==null||e.worldMatrixVersion!==this.Mo)return!1;let i=0;for(let n=0;n<this._a.length;n++)i+=this._a[n].worldMatrixVersion;return i===this.Co}qo(t){var i,n;let e=0;for(let a=0;a<this._a.length;a++)e+=this._a[a].worldMatrixVersion;this.xo=t,this.Co=e,this.Mo=(n=(i=this.entity.getSceneGraph())==null?void 0:i.worldMatrixVersion)!=null?n:-1,this.Vo=this._bindShapeMatrix,this.vo=!0}Fo(t){let e=this._boneDataInfo._v;return{processFrameToken:t,boneData:this._boneData.isDummy()?void 0:this._boneData._v,boneDataInfo:[e[0],e[1],e[2],e[3]],jointMatrix:this.wa._v,isWorldMatrixVanilla:this.La}}Oo(t){if(this.La=t.isWorldMatrixVanilla,this.wa._v.set(t.jointMatrix),t.boneData==null)return;let e=this._a.length*b.getVec4CountPerJoint(this.Ma)*4;this._boneData._v.set(t.boneData.subarray(0,Math.min(e,this._boneData._v.length))),this._boneDataInfo.isDummy()||this._boneDataInfo._v.set(t.boneDataInfo)}};s.fo=new Map,s._o=new WeakMap,s.To=new WeakMap,s.Lo=0,s.Ir=v.identity(),s.No=z.fromCopy4(0,0,0,1),s.jo=v.identity(),s.br=v.identity(),s.Hr=v.identity();var G=s;G._registerBoneDataMember();G._registerBoneDataInfoMember();export{G as SkeletalComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Component as T}from"../../core/Component.js";import{applyMixins as R}from"../../core/EntityRepository.js";import{ProcessStage as d}from"../../definitions/ProcessStage.js";import{Matrix44 as p}from"../../math/index.js";import{MutableQuaternion as h}from"../../math/MutableQuaternion.js";import{Quaternion as I}from"../../math/Quaternion.js";import{Transform3D as g}from"../../math/Transform3D.js";import{Is as a}from"../../misc/index.js";import{WellKnownComponentTIDs as m}from"../WellKnownComponentTIDs.js";var o=class o extends T{constructor(){super(...arguments);this.
|
|
1
|
+
import{Component as T}from"../../core/Component.js";import{applyMixins as R}from"../../core/EntityRepository.js";import{ProcessStage as d}from"../../definitions/ProcessStage.js";import{Matrix44 as p}from"../../math/index.js";import{MutableQuaternion as h}from"../../math/MutableQuaternion.js";import{Quaternion as I}from"../../math/Quaternion.js";import{Transform3D as g}from"../../math/Transform3D.js";import{Is as a}from"../../misc/index.js";import{WellKnownComponentTIDs as m}from"../WellKnownComponentTIDs.js";var o=class o extends T{constructor(){super(...arguments);this.tl=new g;this.nl=0}static get renderedPropertyCount(){return null}static get componentTID(){return m.TransformComponentTID}get componentTID(){return m.TransformComponentTID}get restOrPose(){return this.el!==void 0?this.el:this.tl}static getUpdateCount(t){var e;return(e=this.pi.get(t))!=null?e:0}static fi(t){var s;let e=(s=this.pi.get(t))!=null?s:0;this.pi.set(t,e+1)}_backupTransformAsRest(){this.el===void 0&&(this.el=this.tl.clone(),this.entity.tryToGetSceneGraph().setWorldMatrixRestDirty())}_restoreTransformFromRest(){this.el!==void 0&&this.tl.setTransform(this.el.positionInner,this.el.scaleInner,h.fromCopyQuaternion(this.el.rotationInner))}get localTransform(){return this.tl}set localTransform(t){this.tl.setTransform(t.positionInner,t.scaleInner,h.fromCopyQuaternion(t.rotationInner)),o.fi(this.i)}get localTransformRest(){return this.restOrPose}set localTransformRest(t){a.undefined(this.el)&&(this.el=new g),this.el.setTransform(t.positionInner,t.scaleInner,h.fromCopyQuaternion(t.rotationInner)),o.fi(this.i)}set localPosition(t){this.tl.position=t;let e=this.entity.tryToGetSceneGraph();if(e!=null&&e._hasPhysicsComponentInSubtree){let s=e.parent;s!==void 0?e.setPositionToPhysics(s.matrixInner.multiplyVector3(t)):e.setPositionToPhysics(t)}o.fi(this.i)}set localPositionWithoutPhysics(t){this.tl.position=t,o.fi(this.i)}setLocalPositionAsArray3(t){this.tl.setPositionAsArray3(t),o.fi(this.i)}get localPosition(){return this.tl.position}get localPositionInner(){return this.tl.positionInner}set localPositionRest(t){a.undefined(this.el)&&(this.el=this.tl.clone()),this.el.position=t,o.fi(this.i)}get localPositionRest(){return this.restOrPose.position}get localPositionRestInner(){return this.restOrPose.positionInner}set localEulerAngles(t){this.tl.eulerAngles=t;let e=this.entity.tryToGetSceneGraph();if(e!=null&&e._hasPhysicsComponentInSubtree){let s=Math.sin(t._v[0]*.5),i=Math.cos(t._v[0]*.5),n=Math.sin(t._v[1]*.5),r=Math.cos(t._v[1]*.5),l=Math.sin(t._v[2]*.5),c=Math.cos(t._v[2]*.5),u=h.fromCopy4(s*r*c-i*n*l,i*n*c+s*r*l,i*r*l-s*n*c,i*r*c+s*n*l),f=e.parent;f!==void 0?e.setRotationToPhysics(I.multiply(f.rotation,u)):e.setRotationToPhysics(u)}o.fi(this.i)}set localEulerAnglesWithoutPhysics(t){this.tl.eulerAngles=t,o.fi(this.i)}get localEulerAngles(){return this.tl.eulerAngles}get localEulerAnglesInner(){return this.tl.eulerAnglesInner}set localEulerAnglesRest(t){a.undefined(this.el)&&(this.el=this.tl.clone()),this.el.eulerAngles=t,o.fi(this.i)}get localEulerAnglesRest(){return this.restOrPose.eulerAngles}get localEulerAnglesRestInner(){return this.restOrPose.eulerAnglesInner}set localScale(t){this.tl.scale=t;let e=this.entity.tryToGetSceneGraph();if(e!=null&&e._hasPhysicsComponentInSubtree){let s=e.parent,i=s===void 0?this.tl.matrixInner:p.multiply(s.matrixInner,this.tl.matrixInner);e.setScaleToPhysics(e._getPhysicsWorldScale(i))}o.fi(this.i)}set localScaleWithoutPhysics(t){this.tl.scale=t,o.fi(this.i)}setLocalScaleAsArray3(t){this.tl.setScaleAsArray3(t),o.fi(this.i)}get localScale(){return this.tl.scale}get localScaleInner(){return this.tl.scaleInner}set localScaleRest(t){a.undefined(this.el)&&(this.el=this.tl.clone()),this.el.scale=t,o.fi(this.i)}get localScaleRest(){return this.restOrPose.scale}get localScaleRestInner(){return this.restOrPose.scaleInner}set localRotation(t){this.tl.rotation=t;let e=this.entity.tryToGetSceneGraph();if(e!=null&&e._hasPhysicsComponentInSubtree){let s=e.parent;s!==void 0?e.setRotationToPhysics(I.multiply(s.rotationInner,t)):e.setRotationToPhysics(t)}o.fi(this.i)}set localRotationWithoutPhysics(t){this.tl.rotation=t,o.fi(this.i)}setLocalRotationAsArray4(t){this.tl.setRotationAsArray4(t),o.fi(this.i)}get localRotation(){return this.tl.rotation}get localRotationInner(){return this.tl.rotationInner}set localRotationRest(t){a.undefined(this.el)&&(this.el=this.tl.clone()),this.el.rotation=t,o.fi(this.i)}get localRotationRest(){return this.restOrPose.rotation}get localRotationRestInner(){return this.restOrPose.rotationInner}set localMatrix(t){this.tl.matrix=t;let e=this.entity.tryToGetSceneGraph();if(e!=null&&e._hasPhysicsComponentInSubtree){let s=e.parent;s!==void 0?e.setMatrixToPhysics(p.multiply(s.matrix,t)):e.setMatrixToPhysics(t)}o.fi(this.i)}set localMatrixWithoutPhysics(t){this.tl.matrix=t,o.fi(this.i)}get localMatrix(){return this.tl.matrix}get localMatrixInner(){return this.tl.matrixInner}getLocalMatrixInnerTo(t){this.tl.getMatrixInnerTo(t)}set localMatrixRest(t){a.undefined(this.el)&&(this.el=this.tl.clone()),this.el.matrix=t,o.fi(this.i)}get localMatrixRest(){return this.restOrPose.matrix}get localMatrixRestInner(){return this.restOrPose.matrixInner}$load(){this.moveStageTo(d.Logic)}$logic(){this.nl!==this.tl.updateCount&&(this.entity.tryToGetSceneGraph().setWorldMatrixDirty(),this.nl=this.tl.updateCount)}_shallowCopyFrom(t){let e=t;this.tl=e.tl.clone(),e.el!=null&&(this.el=e.el.clone()),this.nl=e.nl,o.fi(this.i)}get entity(){return this.i.entityRepository.getEntity(this.gn)}_destroy(){super._destroy()}addThisComponentToEntity(t,e){class s extends t.constructor{getTransform(){return this.ol===void 0&&(this.ol=this.getComponentByComponentTID(m.TransformComponentTID)),this.ol}set localPosition(n){let r=this.getTransform();r.localPosition=n}get localPosition(){return this.localPositionInner.clone()}get localPositionInner(){return this.getTransform().localPositionInner}set localPositionRest(n){let r=this.getTransform();r.localPositionRest=n}get localPositionRest(){return this.getTransform().localPositionRest}get localPositionRestInner(){return this.getTransform().localPositionRestInner}set localScale(n){let r=this.getTransform();r.localScale=n}get localScale(){return this.localScaleInner.clone()}get localScaleInner(){return this.getTransform().localScaleInner}set localScaleRest(n){let r=this.getTransform();r.localScaleRest=n}get localScaleRest(){return this.getTransform().localScaleRest}get localScaleRestInner(){return this.getTransform().localScaleRestInner}set localEulerAngles(n){let r=this.getTransform();r.localEulerAngles=n}get localEulerAngles(){return this.localEulerAnglesInner.clone()}get localEulerAnglesInner(){return this.getTransform().localEulerAnglesInner}set localEulerAnglesRest(n){let r=this.getTransform();r.localEulerAnglesRest=n}get localEulerAnglesRest(){return this.localEulerAnglesRestInner.clone()}get localEulerAnglesRestInner(){return this.getTransform().localEulerAnglesRestInner}set localRotation(n){let r=this.getTransform();r.localRotation=n}get localRotation(){return this.localRotationInner.clone()}get localRotationInner(){return this.getTransform().localRotationInner}set localRotationRest(n){let r=this.getTransform();r.localRotationRest=n}get localRotationRest(){return this.localQuaternionRestInner.clone()}get localRotationRestInner(){return this.getTransform().localRotationRestInner}set localMatrix(n){let r=this.getTransform();r.localMatrix=n}get localMatrix(){return this.localMatrixInner.clone()}get localMatrixInner(){return this.getTransform().localMatrixInner}set localMatrixRest(n){let r=this.getTransform();r.localMatrixRest=n}get localMatrixRest(){return this.localMatrixRestInner.clone()}get localMatrixRestInner(){return this.getTransform().localMatrixRestInner}}return R(t,s),t}static _cleanupForEngine(t){o.pi.delete(t)}};o.pi=new Map;var y=o;export{y as TransformComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Quaternion as t}from"../math/Quaternion.js";import{Vector3 as i}from"../math/Vector3.js";var a=class{constructor(o,n,r,e){this.Ea=o,this.
|
|
1
|
+
import{Quaternion as t}from"../math/Quaternion.js";import{Vector3 as i}from"../math/Vector3.js";var a=class{constructor(o,n,r,e){this.Ea=o,this.rl=n,this.Np=r,this.vp=e,this.vp.getTransform()._backupTransformAsRest()}getAxisVector(o){switch(o){case"X":return i.fromCopy3(1,0,0);case"Y":return i.fromCopy3(0,1,0);case"Z":return i.fromCopy3(0,0,1);default:throw new Error("Invalid roll axis")}}update(){let o=t.multiply(t.invert(this.Ea.localRotationRestInner),this.Ea.localRotationInner),n=t.multiply(t.multiply(this.Ea.localRotationRestInner,o),t.invert(this.Ea.localRotationRestInner)),r=t.multiply(t.multiply(t.invert(this.vp.localRotationRestInner),n),this.vp.localRotationRestInner),e=this.getAxisVector(this.rl),s=r.transformVector3(e),l=t.fromToRotation(e,s),c=t.lerp(this.vp.localRotationRestInner,t.multiply(t.multiply(this.vp.localRotationRestInner,t.invert(l)),r),this.Np);this.vp.localRotation=c}};export{a as VrmRollConstraint};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ComponentType as V}from"../definitions/ComponentType.js";import{CompositionType as M}from"../definitions/CompositionType.js";import{ProcessStage as E}from"../definitions/ProcessStage.js";import{VectorN as I}from"../math/VectorN.js";import{RnException as O}from"../misc/index.js";import{Err as A,Ok as L}from"../misc/Result.js";import{RnObject as S}from"./RnObject.js";var a=class a extends S{constructor(e,o,t,r,n){super();this._isAlive=!0;this.
|
|
1
|
+
import{ComponentType as V}from"../definitions/ComponentType.js";import{CompositionType as M}from"../definitions/CompositionType.js";import{ProcessStage as E}from"../definitions/ProcessStage.js";import{VectorN as I}from"../math/VectorN.js";import{RnException as O}from"../misc/index.js";import{Err as A,Ok as L}from"../misc/Result.js";import{RnObject as S}from"./RnObject.js";var a=class a extends S{constructor(e,o,t,r,n){super();this._isAlive=!0;this.Wo=!1;this.nf=E.Load;this.i=e,this.gn=o,this._component_sid=t,this.of=e.memoryManager,this.Na=r,n&&(this.Wo=!0)}moveStageTo(e){this.nf=e}static get componentTID(){return 0}get componentTID(){return 0}get componentSID(){return this._component_sid}get entityUID(){return this.gn}get currentProcessStage(){return this.nf}static doesTheProcessStageMethodExist(e,o){return e.prototype[o.methodName]!=null}isExistProcessStageMethod(e){return this[e.methodName]!=null}static process(e,o,t){if(!a.doesTheProcessStageMethodExist(o,t))return;let r=t.methodName,n=e.componentRepository._getComponents(o);if(n!=null)for(let i of n)i!=null&&t===i.nf&&i[r]()}static updateComponentsForRenderStage(e,o,t){let r=e.sort_$render;return r(t)}registerDependency(e,o){}rf(e,o,t,r,n,i){let m=this[`_${e}`];if(m!=null&&!m.isDummy())return;let y=Math.floor(n/i),l=n%i,s=this._componentMemoryRegistry,f=this.constructor,u=s.getAccessor(f,e,y)._takeExistedOne(l);if(this[`_${e}`]=new o(u,!1,!0),!(t instanceof I))for(let p=0;p<this[`_${e}`]._v.length;++p)this[`_${e}`]._v[p]=t[p];return null}sf(e,o){var g,h,d,C;let t=e.memberName,r=this[`_${t}`];if(r!=null&&!r.isDummy())return;let n=this.constructor,i=this._componentMemoryRegistry,m=Math.max((d=(h=this._getArrayLengthForAllocation(t))!=null?h:(g=a.tf.get(n))==null?void 0:g.get(t))!=null?d:1,1),y=e.compositionType.getNumberOfComponents()*m,l=y*e.componentType.getSizeInBytes(),s=i.getVariableLengthChunk(n,t,o);(s==null||s.byteCapacity<l)&&(s!=null&&i.releaseVariableLengthChunk(n,t,s),s=(C=i.takeFreeVariableLengthChunk(n,t,l))!=null?C:a.af(this.i,e.bufferUse,l),i.setVariableLengthChunk(n,t,o,s));let f=s.bufferView,c=new Float32Array(f.buffer.getArrayBuffer(),f.byteOffsetInRawArrayBufferOfBuffer,y);c.fill(0);let u=e.dataClassType;this[`_${t}`]=new u(c,!1,!0);let p=this[`_${a._getVariableLengthLocationMemberName(t)}`],b=a._variableLengthLocationRadix;p._v[0]=Math.floor(s.location/b),p._v[1]=s.location%b,p._v[2]=m,p._v[3]=0}static af(e,o,t){let r,n=0;do r=e.memoryManager.createOrGetBuffer(o,n).takeBufferView({byteLengthToNeed:t,byteStride:0}),r.isErr()&&n++;while(r.isErr());let i=r.get(),m=e.memoryManager.getByteOffsetOfExistingBuffers(o,i.buffer.indexOfTheBufferUsage)+i.byteOffsetInBuffer;return{bufferView:i,byteCapacity:t,location:m/4/4}}static _getVariableLengthLocationMemberName(e){return`${e}Location`}get _componentMemoryRegistry(){return this.i.componentMemoryRegistry}static ff(e,o,t,r,n,i,m,y,l){let s=e.componentMemoryRegistry,f=h(),c=s.getAccessor(r,t,m);if(c!=null&&c.elementCount===y&&c.byteStride===f&&c.compositionType===n&&c.componentType===i)return new L(c);let p,b=0;do p=e.memoryManager.createOrGetBuffer(o,b).takeBufferView({byteLengthToNeed:f*y,byteStride:0}),p.isErr()&&b++;while(p.isErr());let g=p.get().takeAccessor({compositionType:n,componentType:i,count:y,byteStride:f,arrayLength:l});if(g.isErr())return new A({message:`Failed to take accessor: ${g.getRnError().message}`,error:void 0});return s.setAccessor(r,t,m,g.get()),g;function h(){let d=n.getNumberOfComponents(),C=i.getSizeInBytes(),B=d*C;return M.isArray(n)&&(B*=l),B}}static registerMember({bufferUse:e,memberName:o,dataClassType:t,shaderType:r,compositionType:n,componentType:i,initValues:m,arrayLength:y,componentSID:l,convertToBool:s,isVariableLength:f}){a.ef.has(this)||a.ef.set(this,new Map);let c=a.ef.get(this);if(f===!0){if(n!==M.Vec4Array&&n!==M.Mat4Array&&n!==M.Mat4x3Array)throw new Error(`Variable-length member ${o} must be Vec4Array, Mat4Array or Mat4x3Array.`);if(i!==V.Float)throw new Error(`Variable-length member ${o} must have the Float component type.`);let u=c.get(a._getVariableLengthLocationMemberName(o));if(u==null||u.compositionType!==M.Vec4)throw new Error(`Register a Vec4 member named ${a._getVariableLengthLocationMemberName(o)} before the variable-length member ${o}.`)}if(c.set(o,{bufferUse:e,memberName:o,dataClassType:t,shaderType:r,compositionType:n,componentType:i,initValues:m,convertToBool:s,isVariableLength:f}),y!=null&&l!=null){a.tf.has(this)||a.tf.set(this,new Map);let u=a.tf.get(this),p=u.get(o);(p==null||y>p)&&u.set(o,y)}}submitToAllocation(e,o){let t=this.constructor,r=this._componentMemoryRegistry;r.setComponentCountPerBufferView(t,e);let n=a.ef.get(t),i=this.i,m=Math.floor(this._component_sid/e);(this._component_sid%e===0||y(m))&&l(m),n.forEach(s=>{s.isVariableLength!==!0&&this.rf(s.memberName,s.dataClassType,s.initValues,o,this._component_sid,e)}),n.forEach(s=>{s.isVariableLength===!0&&this.sf(s,this._component_sid)});function y(s){for(let f of n.values())if(f.isVariableLength!==!0&&r.getAccessor(t,f.memberName,s)==null)return!0;return!1}function l(s){n.forEach(f=>{var h;if(f.isVariableLength===!0)return;let c=(h=a.tf.get(t))==null?void 0:h.get(f.memberName),u=a.ff(i,f.bufferUse,f.memberName,t,f.compositionType,f.componentType,s,e,c!=null?c:1);if(u.isErr())throw new O(u.getRnError());let p=u.get(),g=i.memoryManager.getByteOffsetOfExistingBuffers(f.bufferUse,p.bufferView.buffer.indexOfTheBufferUsage)+p.byteOffsetInBuffer;r.setByteOffset(t,f.memberName,s,g)})}}_getArrayLengthForAllocation(e){}get entity(){return this.Na.getEntity(this.gn)}static getLocationOffsetOfMemberOfComponent(e,o,t){let r=[],i=e.componentMemoryRegistry.getByteOffsetsForMember(o,t);if(i==null)return[0];for(let[m,y]of i)r[m]=y/4/4;for(let m=0;m<r.length;m++)r[m]===void 0&&(r[m]=0);return r}addThisComponentToEntity(e,o){throw"Invalid Calling"}static getCompositionTypeOfMember(e,o,t){let n=a.ef.get(t).get(o);if(n!=null)return n.compositionType}static getComponentTypeOfMember(e,o,t){let n=a.ef.get(t).get(o);if(n!=null)return n.componentType}static getMemberInfo(e){return new Map(a.ef)}static getComponentCountPerBufferView(e){return e.componentMemoryRegistry.getAllComponentCountPerBufferView()}static getArrayLengthOfMember(e){return new Map(a.tf)}_destroy(){this._isAlive=!1}_shallowCopyFrom(e){}static getStateVersion(e){return e.componentMemoryRegistry.getStateVersion()}};a.ef=new Map,a.tf=new Map,a._processStages=[E.Load,E.Logic,E.Render],a._variableLengthLocationRadix=65536;var T=a;export{T as Component};
|
|
@@ -24,6 +24,7 @@ type ConfigInitDescription = {
|
|
|
24
24
|
isDepthPrepassEnabled?: boolean;
|
|
25
25
|
isGpuCullingEnabled?: boolean;
|
|
26
26
|
isComputeSkinningEnabled?: boolean;
|
|
27
|
+
isComputeSkinningWorkaroundEnabled?: boolean;
|
|
27
28
|
isClusteredForwardEnabled?: boolean;
|
|
28
29
|
clusteredForwardBuildMode?: ClusteredForwardBuildMode;
|
|
29
30
|
clusteredForwardGridSize?: [number, number, number];
|
|
@@ -300,6 +301,20 @@ export declare class Config {
|
|
|
300
301
|
* vertex shader deformation.
|
|
301
302
|
*/
|
|
302
303
|
isComputeSkinningEnabled: boolean;
|
|
304
|
+
/**
|
|
305
|
+
* Whether the engine turns `isComputeSkinningEnabled` off automatically on a GPU whose driver is known to misrender
|
|
306
|
+
* the compute deformation (WebGPU only).
|
|
307
|
+
*
|
|
308
|
+
* @remarks
|
|
309
|
+
* The browser exposes no driver version, so the workaround is keyed on the GPU names in
|
|
310
|
+
* `computeDeformationBrokenGpuPatterns` (`src/foundation/system/GpuDriverWorkarounds.ts`). Only GPUs whose failure
|
|
311
|
+
* was observed are listed; currently that is the Adreno 740 (Meta Quest 3 / Quest 3S), where a skinned morphing mesh
|
|
312
|
+
* fed by the compute deformation was not drawn at all while the same mesh rendered correctly through the vertex
|
|
313
|
+
* shader deformation. On such a GPU the skinned and morphing meshes keep the CPU culling and deform in the vertex
|
|
314
|
+
* shaders, while the other meshes keep the GPU culling; the detected GPU name is logged and stored in
|
|
315
|
+
* `EngineState.computeSkinningWorkaroundGpu`. Set this to false to keep the compute deformation everywhere.
|
|
316
|
+
*/
|
|
317
|
+
isComputeSkinningWorkaroundEnabled: boolean;
|
|
303
318
|
constructor(initDescription?: ConfigInitDescription);
|
|
304
319
|
}
|
|
305
320
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Logger as u,LogLevel as r}from"../misc/Logger.js";var a=class{constructor(e={}){this.scenegraphComponentCountPerBufferView=1e3;this.skeletalComponentCountPerBufferView=100;this.cameraComponentCountPerBufferView=1;this.lightComponentCountPerBufferView=64;this.eu=6;this.isClusteredForwardEnabled=!0;this.clusteredForwardBuildMode="auto";this.clusteredForwardGridSize=[48,27,48];this.clusteredForwardMaxViewNumber=4;this.clusteredForwardMinLocalLightNumber=1;this.clusteredForwardLightCapacityPerCluster=96;this.maxLightListLength=1024;this.lightAutoRangeThreshold=0;this.uu=1;this.materialCountPerBufferView=100;this.boneDataType=void 0;this.isUboEnabled=!1;this.cacheWebGpuRenderBundles=!0;this.cgApiDebugConsoleOutput=!1;this.multiViewForWebVR=!1;this.physicsTimeIntervalScale=1;this.isMobile=!1;this.bufferSizeDivisionRatiosForGPUInstanceDataUsage=[1/32,5/32,6/32,12/32];this.logLevel=r.Warn;this.isMultiDrawEnabled=!0;this.isDepthPrepassEnabled=!1;this.isGpuCullingEnabled=!0;this.isComputeSkinningEnabled=!0;e.scenegraphComponentCountPerBufferView!==void 0&&(this.scenegraphComponentCountPerBufferView=e.scenegraphComponentCountPerBufferView),e.skeletalComponentCountPerBufferView!==void 0&&(this.skeletalComponentCountPerBufferView=e.skeletalComponentCountPerBufferView),e.cameraComponentCountPerBufferView!==void 0&&(this.cameraComponentCountPerBufferView=e.cameraComponentCountPerBufferView),e.lightComponentCountPerBufferView!==void 0&&(this.lightComponentCountPerBufferView=e.lightComponentCountPerBufferView),e.maxLightNumber!==void 0&&(this.maxLightNumber=e.maxLightNumber),e.materialCountPerBufferView!==void 0&&(this.materialCountPerBufferView=e.materialCountPerBufferView),e.boneDataType!==void 0&&(this.boneDataType=e.boneDataType),e.isUboEnabled!==void 0&&(this.isUboEnabled=e.isUboEnabled),e.eventTargetDom!==void 0&&(this.eventTargetDom=e.eventTargetDom),e.cacheWebGpuRenderBundles!==void 0&&(this.cacheWebGpuRenderBundles=e.cacheWebGpuRenderBundles),e.cgApiDebugConsoleOutput!==void 0&&(this.cgApiDebugConsoleOutput=e.cgApiDebugConsoleOutput),e.multiViewForWebVR!==void 0&&(this.multiViewForWebVR=e.multiViewForWebVR),e.physicsTimeIntervalScale!==void 0&&(this.physicsTimeIntervalScale=e.physicsTimeIntervalScale),e.isMobile!==void 0&&(this.isMobile=e.isMobile),e.bufferSizeDivisionRatiosForGPUInstanceDataUsage!==void 0&&(this.bufferSizeDivisionRatiosForGPUInstanceDataUsage=e.bufferSizeDivisionRatiosForGPUInstanceDataUsage),e.logLevel!==void 0&&(this.logLevel=e.logLevel),e.isMultiDrawEnabled!==void 0&&(this.isMultiDrawEnabled=e.isMultiDrawEnabled),e.isDepthPrepassEnabled!==void 0&&(this.isDepthPrepassEnabled=e.isDepthPrepassEnabled),e.isGpuCullingEnabled!==void 0&&(this.isGpuCullingEnabled=e.isGpuCullingEnabled),e.isComputeSkinningEnabled!==void 0&&(this.isComputeSkinningEnabled=e.isComputeSkinningEnabled),e.isClusteredForwardEnabled!==void 0&&(this.isClusteredForwardEnabled=e.isClusteredForwardEnabled),e.clusteredForwardBuildMode!==void 0&&(this.clusteredForwardBuildMode=e.clusteredForwardBuildMode),e.clusteredForwardGridSize!==void 0&&(this.clusteredForwardGridSize=[...e.clusteredForwardGridSize]),e.clusteredForwardMinLocalLightNumber!==void 0&&(this.clusteredForwardMinLocalLightNumber=e.clusteredForwardMinLocalLightNumber),e.clusteredForwardMaxViewNumber!==void 0&&(this.clusteredForwardMaxViewNumber=e.clusteredForwardMaxViewNumber),e.clusteredForwardLightCapacityPerCluster!==void 0&&(this.clusteredForwardLightCapacityPerCluster=e.clusteredForwardLightCapacityPerCluster),e.maxLightListLength!==void 0&&(this.maxLightListLength=e.maxLightListLength),e.lightAutoRangeThreshold!==void 0&&(this.lightAutoRangeThreshold=e.lightAutoRangeThreshold),e.lightRangeScale!==void 0&&(this.lightRangeScale=e.lightRangeScale)}get maxLightNumber(){return this.eu}set maxLightNumber(e){if(!(e>=0)){u.default.warn(`Config.maxLightNumber (${e}) is invalid. Values below 0 are treated as 0.`),this.eu=0;return}this.eu=e}get maxLightNumberOrOne(){return this.eu>0?this.eu:1}get lightRangeScale(){return this.uu}set lightRangeScale(e){if(!(e>0)||e>1){u.default.warn(`Config.lightRangeScale (${e}) is invalid. Use a value in (0, 1].`),this.uu=1;return}this.uu=e}};export{a as Config};
|
|
1
|
+
import{Logger as u,LogLevel as r}from"../misc/Logger.js";var a=class{constructor(e={}){this.scenegraphComponentCountPerBufferView=1e3;this.skeletalComponentCountPerBufferView=100;this.cameraComponentCountPerBufferView=1;this.lightComponentCountPerBufferView=64;this.eu=6;this.isClusteredForwardEnabled=!0;this.clusteredForwardBuildMode="auto";this.clusteredForwardGridSize=[48,27,48];this.clusteredForwardMaxViewNumber=4;this.clusteredForwardMinLocalLightNumber=1;this.clusteredForwardLightCapacityPerCluster=96;this.maxLightListLength=1024;this.lightAutoRangeThreshold=0;this.uu=1;this.materialCountPerBufferView=100;this.boneDataType=void 0;this.isUboEnabled=!1;this.cacheWebGpuRenderBundles=!0;this.cgApiDebugConsoleOutput=!1;this.multiViewForWebVR=!1;this.physicsTimeIntervalScale=1;this.isMobile=!1;this.bufferSizeDivisionRatiosForGPUInstanceDataUsage=[1/32,5/32,6/32,12/32];this.logLevel=r.Warn;this.isMultiDrawEnabled=!0;this.isDepthPrepassEnabled=!1;this.isGpuCullingEnabled=!0;this.isComputeSkinningEnabled=!0;this.isComputeSkinningWorkaroundEnabled=!0;e.scenegraphComponentCountPerBufferView!==void 0&&(this.scenegraphComponentCountPerBufferView=e.scenegraphComponentCountPerBufferView),e.skeletalComponentCountPerBufferView!==void 0&&(this.skeletalComponentCountPerBufferView=e.skeletalComponentCountPerBufferView),e.cameraComponentCountPerBufferView!==void 0&&(this.cameraComponentCountPerBufferView=e.cameraComponentCountPerBufferView),e.lightComponentCountPerBufferView!==void 0&&(this.lightComponentCountPerBufferView=e.lightComponentCountPerBufferView),e.maxLightNumber!==void 0&&(this.maxLightNumber=e.maxLightNumber),e.materialCountPerBufferView!==void 0&&(this.materialCountPerBufferView=e.materialCountPerBufferView),e.boneDataType!==void 0&&(this.boneDataType=e.boneDataType),e.isUboEnabled!==void 0&&(this.isUboEnabled=e.isUboEnabled),e.eventTargetDom!==void 0&&(this.eventTargetDom=e.eventTargetDom),e.cacheWebGpuRenderBundles!==void 0&&(this.cacheWebGpuRenderBundles=e.cacheWebGpuRenderBundles),e.cgApiDebugConsoleOutput!==void 0&&(this.cgApiDebugConsoleOutput=e.cgApiDebugConsoleOutput),e.multiViewForWebVR!==void 0&&(this.multiViewForWebVR=e.multiViewForWebVR),e.physicsTimeIntervalScale!==void 0&&(this.physicsTimeIntervalScale=e.physicsTimeIntervalScale),e.isMobile!==void 0&&(this.isMobile=e.isMobile),e.bufferSizeDivisionRatiosForGPUInstanceDataUsage!==void 0&&(this.bufferSizeDivisionRatiosForGPUInstanceDataUsage=e.bufferSizeDivisionRatiosForGPUInstanceDataUsage),e.logLevel!==void 0&&(this.logLevel=e.logLevel),e.isMultiDrawEnabled!==void 0&&(this.isMultiDrawEnabled=e.isMultiDrawEnabled),e.isDepthPrepassEnabled!==void 0&&(this.isDepthPrepassEnabled=e.isDepthPrepassEnabled),e.isGpuCullingEnabled!==void 0&&(this.isGpuCullingEnabled=e.isGpuCullingEnabled),e.isComputeSkinningEnabled!==void 0&&(this.isComputeSkinningEnabled=e.isComputeSkinningEnabled),e.isComputeSkinningWorkaroundEnabled!==void 0&&(this.isComputeSkinningWorkaroundEnabled=e.isComputeSkinningWorkaroundEnabled),e.isClusteredForwardEnabled!==void 0&&(this.isClusteredForwardEnabled=e.isClusteredForwardEnabled),e.clusteredForwardBuildMode!==void 0&&(this.clusteredForwardBuildMode=e.clusteredForwardBuildMode),e.clusteredForwardGridSize!==void 0&&(this.clusteredForwardGridSize=[...e.clusteredForwardGridSize]),e.clusteredForwardMinLocalLightNumber!==void 0&&(this.clusteredForwardMinLocalLightNumber=e.clusteredForwardMinLocalLightNumber),e.clusteredForwardMaxViewNumber!==void 0&&(this.clusteredForwardMaxViewNumber=e.clusteredForwardMaxViewNumber),e.clusteredForwardLightCapacityPerCluster!==void 0&&(this.clusteredForwardLightCapacityPerCluster=e.clusteredForwardLightCapacityPerCluster),e.maxLightListLength!==void 0&&(this.maxLightListLength=e.maxLightListLength),e.lightAutoRangeThreshold!==void 0&&(this.lightAutoRangeThreshold=e.lightAutoRangeThreshold),e.lightRangeScale!==void 0&&(this.lightRangeScale=e.lightRangeScale)}get maxLightNumber(){return this.eu}set maxLightNumber(e){if(!(e>=0)){u.default.warn(`Config.maxLightNumber (${e}) is invalid. Values below 0 are treated as 0.`),this.eu=0;return}this.eu=e}get maxLightNumberOrOne(){return this.eu>0?this.eu:1}get lightRangeScale(){return this.uu}set lightRangeScale(e){if(!(e>0)||e>1){u.default.warn(`Config.lightRangeScale (${e}) is invalid. Use a value in (0, 1].`),this.uu=1;return}this.uu=e}};export{a as Config};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RenderBackendEnum } from '../../foundation/definitions/RenderBackend';
|
|
2
2
|
import type { CGAPIResourceHandle, Count, Index, IndexOf16Bytes } from '../../types/CommonTypes';
|
|
3
3
|
import type { getShaderPropertyFuncOfGlobalDataRepository, ShaderSemanticsName } from '../definitions/ShaderSemantics';
|
|
4
4
|
import { type ShaderSemanticsInfo } from '../definitions/ShaderSemanticsInfo';
|
|
@@ -16,12 +16,12 @@ export declare class GlobalDataRepository {
|
|
|
16
16
|
/**
|
|
17
17
|
* Initializes the GlobalDataRepository with all required global properties.
|
|
18
18
|
* Sets up data structures for camera matrices, lighting, skeletal animation,
|
|
19
|
-
* and other rendering parameters based on the specified
|
|
19
|
+
* and other rendering parameters based on the specified render backend.
|
|
20
20
|
*
|
|
21
21
|
* @param approach - The processing approach that determines
|
|
22
22
|
* how data is organized and accessed in shaders
|
|
23
23
|
*/
|
|
24
|
-
initialize(
|
|
24
|
+
initialize(_backend: RenderBackendEnum): void;
|
|
25
25
|
/**
|
|
26
26
|
* Returns the singleton instance of GlobalDataRepository.
|
|
27
27
|
* Creates a new instance if it doesn't exist yet.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{WellKnownComponentTIDs as p}from"../components/WellKnownComponentTIDs.js";import{BufferUse as y}from"../definitions/BufferUse.js";import{ComponentType as
|
|
1
|
+
import{WellKnownComponentTIDs as p}from"../components/WellKnownComponentTIDs.js";import{BufferUse as y}from"../definitions/BufferUse.js";import{ComponentType as o}from"../definitions/ComponentType.js";import{CompositionType as s}from"../definitions/CompositionType.js";import{calcAlignedByteLength as x}from"../definitions/ShaderSemanticsInfo.js";import{ShaderType as i}from"../definitions/ShaderType.js";import{MathClassUtil as h}from"../math/MathClassUtil.js";import{Scalar as f}from"../math/Scalar.js";import{Vector2 as d}from"../math/Vector2.js";import{Vector3 as A}from"../math/Vector3.js";import{VectorN as S}from"../math/VectorN.js";import{getLightClusterGlobalPropertyLength as T}from"../renderer/lightCluster/LightClusterLayout.js";var g=class b{constructor(e){this.em=new Map;this.i=e}initialize(e){let t={semantic:"currentComponentSIDs",compositionType:s.ScalarArray,componentType:o.Float,arrayLength:p.maxWellKnownTidNumber,stage:i.VertexAndPixelShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInternalSetting:!0,needUniformInDataTextureMode:!0,initialValue:new S(new Float32Array(p.maxWellKnownTidNumber))};this.tm(t,1),this.takeOne("currentComponentSIDs");let n={semantic:"skinningMode",compositionType:s.Scalar,componentType:o.Int,stage:i.VertexAndPixelShader,min:0,max:1,isInternalSetting:!0,initialValue:f.fromCopyNumber(-1)};this.tm(n,1),this.takeOne("skinningMode");let a={semantic:"lightNumber",compositionType:s.Scalar,componentType:o.Int,stage:i.VertexAndPixelShader,min:0,max:Number.MAX_SAFE_INTEGER,isInternalSetting:!0,initialValue:f.fromCopyNumber(0)};this.tm(a,1),this.takeOne("lightNumber");let r=T(this.i.config.maxLightListLength),m={semantic:"clusteredLightData",compositionType:s.Vec4Array,componentType:o.Float,arrayLength:r,stage:i.VertexAndPixelShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInternalSetting:!0,initialValue:new S(new Float32Array(r*4))};this.tm(m,1),this.takeOne("clusteredLightData");let c={semantic:"ambientLightIntensity",compositionType:s.Vec3,componentType:o.Float,stage:i.VertexAndPixelShader,min:0,max:Number.MAX_VALUE,isInternalSetting:!0,initialValue:A.fromCopy3(0,0,0)};this.tm(c,1),this.takeOne("ambientLightIntensity");let u={semantic:"backBufferTextureSize",compositionType:s.Vec2,componentType:o.Float,stage:i.VertexAndPixelShader,min:0,max:Number.MAX_SAFE_INTEGER,isInternalSetting:!0,needUniformInDataTextureMode:!0,initialValue:d.fromCopy2(0,0)};this.tm(u,1),this.takeOne("backBufferTextureSize");let l={semantic:"vrState",compositionType:s.Vec2,componentType:o.Int,stage:i.VertexAndPixelShader,min:0,max:Number.MAX_SAFE_INTEGER,isInternalSetting:!0,needUniformInDataTextureMode:!0,initialValue:d.fromCopy2(0,0)};this.tm(l,1),this.takeOne("vrState");let I={semantic:"time",compositionType:s.Scalar,componentType:o.Float,stage:i.VertexAndPixelShader,min:0,max:Number.MAX_SAFE_INTEGER,isInternalSetting:!0,initialValue:f.fromCopyNumber(0)};this.tm(I,1),this.takeOne("time")}static init(e){return new b(e)}tm(e,t){let n=x(e),a,r=0;do a=this.i.memoryManager.createOrGetBuffer(y.GPUInstanceData,r).takeBufferView({byteLengthToNeed:n*t,byteStride:0}),a.isErr()&&r++;while(a.isErr());let m=e.arrayLength;s.isArray(e.compositionType)&&m==null&&(m=100);let c=a.get().takeAccessor({compositionType:e.compositionType,componentType:o.Float,count:t,byteStride:n,arrayLength:m}).unwrapForce(),u={shaderSemanticsInfo:e,values:[],maxCount:t,accessor:c};this.em.set(e.semantic,u)}takeOne(e){let t=this.em.get(e);if(t){let n=t.shaderSemanticsInfo,a=t.accessor.takeOne(),r=t.values.length,m=h.initWithFloat32Array(n.initialValue,a);return t.values[r]=m,m}}setValue(e,t,n){let a=this.em.get(e);if(a){let r=a.values[t];h._setForce(r,n)}}getValue(e,t){let n=this.em.get(e);if(n)return n.values[t]}getPropertyTable(){let e=[];return this.em.forEach((t,n)=>{e.push({semantic:n,info:t.shaderSemanticsInfo,value:t.values[0],vec4Index:this.getLocationOffsetOfProperty(n),maxCount:t.maxCount})}),e}_setUniformLocationsForWebGL2ModeOnly(e){let t=this.i.webglResourceRepository,n=[];this.em.forEach(a=>{let r=a.shaderSemanticsInfo;r.needUniformInDataTextureMode&&n.push(r)}),t.setupUniformLocations(this.i.config,e,n)}getLocationOffsetOfProperty(e){let t=this.em.get(e);if(t){let n=t.accessor;return(this.i.memoryManager.getByteOffsetOfExistingBuffers(y.GPUInstanceData,n.bufferView.buffer.indexOfTheBufferUsage)+n.byteOffsetInBuffer)/4/4}return-1}_addPropertiesStr(e,t,n){return this.em.forEach(a=>{let r=a.shaderSemanticsInfo;(r.stage===i.VertexShader||r.stage===i.VertexAndPixelShader)&&(e+=n(this.i,r)),(r.stage===i.PixelShader||r.stage===i.VertexAndPixelShader)&&(t+=n(this.i,r))}),[e,t]}};export{g as GlobalDataRepository};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EnumClass, type EnumIO } from '../misc/EnumIO';
|
|
2
|
+
export declare class RenderBackendClass extends EnumClass implements EnumIO {
|
|
3
|
+
constructor({ index, str }: {
|
|
4
|
+
index: number;
|
|
5
|
+
str: string;
|
|
6
|
+
});
|
|
7
|
+
get webGLVersion(): 0 | 2;
|
|
8
|
+
}
|
|
9
|
+
export type RenderBackendEnum = RenderBackendClass;
|
|
10
|
+
declare function from(index: number): RenderBackendEnum | undefined;
|
|
11
|
+
declare const isWebGpuBackend: (renderBackend: RenderBackendEnum) => boolean;
|
|
12
|
+
declare const isWebGL2Backend: (renderBackend: RenderBackendEnum) => boolean;
|
|
13
|
+
export declare const RenderBackend: Readonly<{
|
|
14
|
+
isWebGpuBackend: typeof isWebGpuBackend;
|
|
15
|
+
None: RenderBackendClass;
|
|
16
|
+
WebGL2: RenderBackendClass;
|
|
17
|
+
WebGPU: RenderBackendClass;
|
|
18
|
+
from: typeof from;
|
|
19
|
+
isWebGL2Backend: typeof isWebGL2Backend;
|
|
20
|
+
}>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_from as c,EnumClass as a}from"../misc/EnumIO.js";var n=class extends a{constructor({index:d,str:u}){super({index:d,str:u})}get webGLVersion(){return this===r?2:0}},s=new n({index:0,str:"NONE"}),r=new n({index:2,str:"WebGL2"}),t=new n({index:3,str:"WebGPU"}),m=[s,r,t];function o(e){return c({typeList:m,index:e})}var i=e=>e===t,E=e=>e===r,k=Object.freeze({isWebGpuBackend:i,None:s,WebGL2:r,WebGPU:t,from:o,isWebGL2Backend:E});export{k as RenderBackend,n as RenderBackendClass};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_from as Gt,_fromString as $t,_fromStringCaseSensitively as zt,EnumClass as Vt}from"../misc/EnumIO.js";import{CompositionType as m}from"./CompositionType.js";var n=class n extends Vt{constructor({str:t}){super({index:++n.
|
|
1
|
+
import{_from as Gt,_fromString as $t,_fromStringCaseSensitively as zt,EnumClass as Vt}from"../misc/EnumIO.js";import{CompositionType as m}from"./CompositionType.js";var n=class n extends Vt{constructor({str:t}){super({index:++n.ec*n._scale,str:t,noCheckStrUnique:!0}),n.tc[this.index]=this}static getShaderSemanticByIndex(t){return this.tc[Math.abs(t)-Math.abs(t)%this._scale]}static isNonArrayShaderSemanticIndex(t){return t>=this._scale}static isArrayAndZeroIndexShaderSemanticIndex(t){return t<0&&Math.abs(t)%n._scale===0}static isArrayAndNonZeroIndexShaderSemanticIndex(t){return t<0&&Math.abs(t)%n._scale!==0}static getIndexCount(){return n.ec}};n.ec=-1,n._scale=1e4,n.tc=[];var e=n,S=new e({str:"worldMatrix"}),d=new e({str:"viewMatrix"}),h=new e({str:"isBillboard"}),l=new e({str:"enableViewMatrix"}),x=new e({str:"projectionMatrix"}),T=new e({str:"normalMatrix"}),w=new e({str:"boneMatrix"}),p=new e({str:"baseColorFactor"}),E=new e({str:"baseColorTexture"}),g=new e({str:"normalTexture"}),f=new e({str:"metallicRoughnessTexture"}),C=new e({str:"occlusionTexture"}),I=new e({str:"emissiveFactor"}),y=new e({str:"emissiveTexture"}),R=new e({str:"lightNumber"}),b=new e({str:"lightPosition"}),v=new e({str:"lightDirection"}),M=new e({str:"lightIntensity"}),F=new e({str:"lightProperty"}),P=new e({str:"metallicRoughnessFactor"}),k=new e({str:"brdfLutTexture"}),B=new e({str:"diffuseEnvTexture"}),N=new e({str:"specularEnvTexture"}),D=new e({str:"sheenEnvTexture"}),L=new e({str:"inverseEnvironment"}),O=new e({str:"iblParameter"}),A=new e({str:"iblMipLevelSkip"}),G=new e({str:"viewPosition"}),$=new e({str:"wireframe"}),z=new e({str:"diffuseColorFactor"}),V=new e({str:"diffuseColorTexture"}),_=new e({str:"shininess"}),H=new e({str:"shadingModel"}),j=new e({str:"skinningMode"}),Q=new e({str:"generalTexture"}),W=new e({str:"boneQuaternion"}),U=new e({str:"boneTranslateScale"}),K=new e({str:"boneTranslatePackedQuat"}),Z=new e({str:"boneScalePackedQuat"}),q=new e({str:"boneCompressedChunk"}),J=new e({str:"boneCompressedInfo"}),X=new e({str:"pointSize"}),Y=new e({str:"colorEnvTexture"}),ee=new e({str:"pointDistanceAttenuation"}),te=new e({str:"hdriFormat"}),ne=new e({str:"screenInfo"}),re=new e({str:"depthTexture"}),se=new e({str:"lightViewProjectionMatrix"}),ae=new e({str:"anisotropy"}),oe=new e({str:"clearcoatParameter"}),ie=new e({str:"sheenColorFactor"}),ce=new e({str:"sheenColorTexture"}),ue=new e({str:"sheenRoughnessFactor"}),me=new e({str:"sheenRoughnessTexture"}),Se=new e({str:"sheenLutTexture"}),de=new e({str:"specularGlossinessFactor"}),he=new e({str:"specularGlossinessTexture"}),le=new e({str:"entityUID"}),xe=new e({str:"morphTargetNumber"}),Te=new e({str:"dataTextureMorphOffsetPosition"}),we=new e({str:"morphWeights"}),pe=new e({str:"currentComponentSIDs"}),Ee=new e({str:"alphaCutoff"}),ge=new e({str:"alphaTexture"}),fe=new e({str:"makeOutputSrgb"}),_t=new e({str:"framebufferSize"}),Ce=new e({str:"clearCoatFactor"}),Ie=new e({str:"clearCoatTexture"}),ye=new e({str:"clearCoatRoughnessFactor"}),Re=new e({str:"clearCoatRoughnessTexture"}),be=new e({str:"clearCoatNormalTexture"}),ve=new e({str:"transmissionFactor"}),Me=new e({str:"transmissionTexture"}),Fe=new e({str:"backBufferTexture"}),Pe=new e({str:"backBufferTextureSize"}),ke=new e({str:"thicknessFactor"}),Be=new e({str:"thicknessTexture"}),Ne=new e({str:"attenuationDistance"}),De=new e({str:"attenuationColor"}),Le=new e({str:"isOutputHDR"}),Oe=new e({str:"baseColorTextureTransform"}),Ae=new e({str:"baseColorTextureRotation"}),Ge=new e({str:"normalTextureTransform"}),$e=new e({str:"normalTextureRotation"}),ze=new e({str:"metallicRoughnessTextureTransform"}),Ve=new e({str:"metallicRoughnessTextureRotation"}),_e=new e({str:"normalTexcoordIndex"}),He=new e({str:"baseColorTexcoordIndex"}),je=new e({str:"metallicRoughnessTexcoordIndex"}),Qe=new e({str:"occlusionTexcoordIndex"}),We=new e({str:"occlusionTextureTransform"}),Ue=new e({str:"occlusionTextureRotation"}),Ke=new e({str:"emissiveTexcoordIndex"}),Ze=new e({str:"emissiveTextureTransform"}),qe=new e({str:"emissiveTextureRotation"}),Je=new e({str:"normalScale"}),Xe=new e({str:"occlusionStrength"}),Ye=new e({str:"envRotation"}),et=new e({str:"envHdriFormat"}),tt=new e({str:"vrState"}),nt=new e({str:"enableLinearToSrgb"}),rt=new e({str:"specularFactor"}),st=new e({str:"specularTexture"}),at=new e({str:"specularColorFactor"}),ot=new e({str:"specularColorTexture"}),it=new e({str:"ior"}),ct=new e({str:"depthBiasPV"}),ut=new e({str:"clearCoatTextureTransform"}),mt=new e({str:"clearCoatTextureRotation"}),St=new e({str:"clearCoatRoughnessTextureTransform"}),dt=new e({str:"clearCoatRoughnessTextureRotation"}),ht=new e({str:"clearCoatNormalTextureTransform"}),lt=new e({str:"clearCoatNormalTextureRotation"}),xt=new e({str:"clearCoatTexcoordIndex"}),Tt=new e({str:"clearCoatRoughnessTexcoordIndex"}),wt=new e({str:"clearCoatNormalTexcoordIndex"}),pt=new e({str:"iridescenceFactor"}),Et=new e({str:"iridescenceTexture"}),gt=new e({str:"iridescenceIor"}),ft=new e({str:"iridescenceThicknessMinimum"}),Ct=new e({str:"iridescenceThicknessMaximum"}),It=new e({str:"iridescenceThicknessTexture"}),yt=new e({str:"gaussianKernelSize"}),Rt=new e({str:"gaussianRatio"}),bt=new e({str:"isHorizontal"}),vt=new e({str:"anisotropyStrength"}),Mt=new e({str:"anisotropyRotation"}),Ft=new e({str:"anisotropyTexture"}),Pt=new e({str:"emissiveStrength"}),kt=new e({str:"time"}),Bt=new e({str:"cubeMapFaceId"}),Nt=new e({str:"roughness"}),Dt=new e({str:"distributionType"}),i=[S,d,h,l,x,T,w,p,E,g,f,C,I,y,R,b,v,M,F,P,k,B,N,D,L,O,A,G,$,z,V,_,H,j,Q,W,U,K,Z,q,J,X,Y,ee,te,ne,re,se,ae,oe,ie,ce,ue,me,Se,de,he,le,xe,Te,we,pe,Ee,ge,fe,Ce,Ie,ye,Re,be,ve,Me,Fe,Pe,ke,Be,Ne,De,Le,Oe,Ae,Ge,$e,ze,Ve,_e,He,je,Qe,We,Ue,Ke,Ze,qe,Je,Xe,Ye,et,tt,nt,rt,st,at,ot,it,ct,ut,mt,St,dt,ht,lt,xt,Tt,wt,pt,Et,gt,ft,Ct,It,yt,Rt,bt,vt,Mt,Ft,Pt,kt,Bt,Nt,Dt];function Ht(r){return Gt({typeList:i,index:r})}function jt(r){return $t({typeList:i,str:r})}function Qt(r){return zt({typeList:i,str:r})}function qt(r){return r.index}function Wt(r,t,a){return Lt(r,a)}function Lt(r,t){let a=t.compositionType.getGlslStr(t.componentType),s=t.semantic,Ot=t.compositionType.getGlslStr(t.componentType),c="";t.arrayLength&&(c=`[${t.arrayLength}]`);let At=` uniform ${Ot} u_${s}${c};
|
|
2
2
|
`,o="";m.isArray(t.compositionType)?(s.match(/\[.+?\]/)?s=s.replace(/\[.+?\]/g,"[i]"):s+="[i]",o+=`
|
|
3
3
|
${a} val;
|
|
4
4
|
int i = int(index);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Logger as
|
|
1
|
+
import{Logger as r}from"../misc/Logger.js";import{CompositionType as a}from"./CompositionType.js";function s(n){let m=n.compositionType.getNumberOfComponents(),i=n.componentType.getSizeInBytes(),o=m*i,e=o;if(e%16!==0&&(e=o+16-o%16),a.isArray(n.compositionType)){let t=n.arrayLength;t!=null?e*=t:(r.default.error("semanticInfo has invalid maxIndex!"),e*=100)}return e}export{s as calcAlignedByteLength};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_from as d,_fromString as f,EnumClass as E}from"../misc/EnumIO.js";import{RnException as X}from"../misc/RnException.js";var i=class i extends E{constructor({str:r,shaderStr:N,attributeSlot:T,gltfComponentN:V,isIntegerType:g}){super({index:i.
|
|
1
|
+
import{_from as d,_fromString as f,EnumClass as E}from"../misc/EnumIO.js";import{RnException as X}from"../misc/RnException.js";var i=class i extends E{constructor({str:r,shaderStr:N,attributeSlot:T,gltfComponentN:V,isIntegerType:g}){super({index:i.ec++,str:r}),this.Au=T,this.Su=N,this.bu=V,this.Cu=g!=null?g:!1}getAttributeSlot(){return this.Au}get shaderStr(){return this.Su}get isIntegerType(){return this.Cu}get attributeTypeName(){return this.str}_setShaderStr(r){this.Su=this.Su+r}get X(){return`${this.attributeTypeName}.X`}get Y(){return`${this.attributeTypeName}.Y`}get Z(){return`${this.attributeTypeName}.Z`}get W(){return`${this.attributeTypeName}.W`}get XY(){return`${this.attributeTypeName}.X,${this.attributeTypeName}.Y`}get XYZ(){return`${this.attributeTypeName}.X,${this.attributeTypeName}.Y,${this.attributeTypeName}.Z`}get XYZW(){return`${this.attributeTypeName}.X,${this.attributeTypeName}.Y,${this.attributeTypeName}.Z,${this.attributeTypeName}.W`}getVertexAttributeComponentsAsGltf(){if(this.bu===1)return this.X;if(this.bu===2)return this.XY;if(this.bu===3)return this.XYZ;if(this.bu===4)return this.XYZW;throw new X({message:"Invalid gltf component number",error:this.bu})}static mu(r){return new i(r)}};i.ec=-1;var e=i,h=e.mu({str:"UNKNOWN",shaderStr:"a_unknown",attributeSlot:-1,gltfComponentN:0}),s=e.mu({str:"POSITION",shaderStr:"a_position",attributeSlot:0,gltfComponentN:3}),u=e.mu({str:"NORMAL",shaderStr:"a_normal",attributeSlot:1,gltfComponentN:3}),a=e.mu({str:"TANGENT",shaderStr:"a_tangent",attributeSlot:2,gltfComponentN:4}),m=e.mu({str:"TEXCOORD_0",shaderStr:"a_texcoord_0",attributeSlot:3,gltfComponentN:2}),p=e.mu({str:"TEXCOORD_1",shaderStr:"a_texcoord_1",attributeSlot:4,gltfComponentN:2}),b=e.mu({str:"COLOR_0",shaderStr:"a_color_0",attributeSlot:5,gltfComponentN:4}),n=e.mu({str:"JOINTS_0",shaderStr:"a_joints_0",attributeSlot:6,gltfComponentN:4,isIntegerType:!0}),c=e.mu({str:"WEIGHTS_0",shaderStr:"a_weights_0",attributeSlot:7,gltfComponentN:4}),o=e.mu({str:"INSTANCE",shaderStr:"a_instanceBase",attributeSlot:8,gltfComponentN:4,isIntegerType:!0}),S=e.mu({str:"FACE_NORMAL",shaderStr:"a_faceNormal",attributeSlot:9,gltfComponentN:3}),A=e.mu({str:"BARY_CENTRIC_COORD",shaderStr:"a_baryCentricCoord",attributeSlot:10,gltfComponentN:4}),C=e.mu({str:"TEXCOORD_2",shaderStr:"a_texcoord_2",attributeSlot:11,gltfComponentN:2}),l=e.mu({str:"MATERIAL_SID",shaderStr:"a_materialSid",attributeSlot:12,gltfComponentN:1,isIntegerType:!0}),x=[h,s,u,a,m,p,b,n,c,o,S,A,C,l],O=x.length-1;function y(t){return t instanceof e}function _(t){return d({typeList:x,index:t})}function Y(t){let r=t;return t==="COLOR"?r="COLOR_0":t==="TEXCOORD"?r="TEXCOORD_0":t==="JOINTS"?r="JOINTS_0":t==="WEIGHTS"&&(r="WEIGHTS_0"),f({typeList:x,str:r})}function I(t){switch(t){case s:return t.XYZ;case b:return t.XYZ;case u:return t.XYZ;case a:return t.XYZ;case m:return t.XY;case p:return t.XY;case C:return t.XY;case n:return t.XYZW;case c:return t.XYZW;case o:return t.XYZW;case S:return t.XYZW;case A:return t.XYZW;default:throw new Error("Invalied glTF VertexAttributeEnum")}}function $(t){switch(t){case s.XYZ:return s.getAttributeSlot();case b.XYZ:return b.getAttributeSlot();case u.XYZ:return u.getAttributeSlot();case a.XYZ:return a.getAttributeSlot();case m.XY:return m.getAttributeSlot();case p.XY:return p.getAttributeSlot();case C.XY:return C.getAttributeSlot();case n.XYZW:return n.getAttributeSlot();case c.XYZW:return c.getAttributeSlot();case o.XYZW:return o.getAttributeSlot();case S.XYZ:return S.getAttributeSlot();case A.XYZ:return A.getAttributeSlot();default:throw new Error("Invalied glTF VertexAttributeEnum")}}function Z(t){return t.split(",").length}var R=[n,o,l],D=Object.freeze({Unknown:h,Position:s,Normal:u,Tangent:a,Texcoord0:m,Texcoord1:p,Color0:b,Joints0:n,Weights0:c,Instance:o,FaceNormal:S,BaryCentricCoord:A,MaterialSid:l,AttributeTypeNumber:O,integerTypeAttributes:R,isInstanceOfVertexAttributeClass:y,toVertexAttributeSemanticJoinedStringAsGltfStyle:I,toAttributeSlotFromJoinedString:$,toVectorComponentN:Z,from:_,fromString:Y});export{D as VertexAttribute,e as VertexAttributeClass};
|
|
@@ -15,8 +15,8 @@ export * from './LightType';
|
|
|
15
15
|
export * from './PhysicsShapeType';
|
|
16
16
|
export * from './PixelFormat';
|
|
17
17
|
export * from './PrimitiveMode';
|
|
18
|
-
export * from './ProcessApproach';
|
|
19
18
|
export * from './ProcessStage';
|
|
19
|
+
export * from './RenderBackend';
|
|
20
20
|
export * from './RenderBufferTarget';
|
|
21
21
|
export * from './SdfShapeType';
|
|
22
22
|
export * from './ShaderNode';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./AlphaMode.js";export*from"./AnimationAttribute.js";export*from"./AnimationInterpolation.js";export*from"./BasisCompressionType.js";export*from"./BoneDataType.js";export*from"./BufferUse.js";export*from"./CameraControllerType.js";export*from"./CameraType.js";export*from"./ComponentType.js";export*from"./CompositionType.js";export*from"./CompressionTextureType.js";export*from"./FileType.js";export*from"./HdriFormat.js";export*from"./LightType.js";export*from"./PhysicsShapeType.js";export*from"./PixelFormat.js";export*from"./PrimitiveMode.js";export*from"./
|
|
1
|
+
export*from"./AlphaMode.js";export*from"./AnimationAttribute.js";export*from"./AnimationInterpolation.js";export*from"./BasisCompressionType.js";export*from"./BoneDataType.js";export*from"./BufferUse.js";export*from"./CameraControllerType.js";export*from"./CameraType.js";export*from"./ComponentType.js";export*from"./CompositionType.js";export*from"./CompressionTextureType.js";export*from"./FileType.js";export*from"./HdriFormat.js";export*from"./LightType.js";export*from"./PhysicsShapeType.js";export*from"./PixelFormat.js";export*from"./PrimitiveMode.js";export*from"./ProcessStage.js";export*from"./RenderBackend.js";export*from"./RenderBufferTarget.js";export*from"./SdfShapeType.js";export*from"./ShaderNode.js";export*from"./ShaderSemantics.js";export*from"./ShaderSemanticsInfo.js";export*from"./ShaderType.js";export*from"./ShaderVariableType.js";export*from"./ShadingModel.js";export*from"./ShadowMap.js";export*from"./TextureFormat.js";export*from"./TextureParameter.js";export*from"./ToneMappingType.js";export*from"./VertexAttribute.js";export*from"./Visibility.js";
|
|
@@ -120,6 +120,12 @@ export declare class Gltf2Exporter {
|
|
|
120
120
|
*/
|
|
121
121
|
static __createNodes(json: Gltf2Ex, entities: ISceneGraphEntity[], topLevelEntities: ISceneGraphEntity[]): void;
|
|
122
122
|
private static __exportLight;
|
|
123
|
+
/**
|
|
124
|
+
* Exports an ambient light. KHR_lights_punctual has no ambient light type, so the light is stored in the
|
|
125
|
+
* Rhodonite extras of the node (`node.extras.rhodonite.ambientLight`), which ModelConverter restores. Other
|
|
126
|
+
* viewers see the node as an empty node.
|
|
127
|
+
*/
|
|
128
|
+
private static __exportAmbientLight;
|
|
123
129
|
private static __ensureLightsExtension;
|
|
124
130
|
/**
|
|
125
131
|
* Exports the graph of a RaymarchingComponent as a Rhodonite node extension.
|