rhodonite 0.26.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/VERSION-FILE +1 -1
- package/dist/esm/foundation/core/MemoryManager.d.ts +19 -0
- package/dist/esm/foundation/core/MemoryManager.js +2 -2
- package/dist/esm/foundation/definitions/ShaderSemantics.d.ts +1 -0
- package/dist/esm/foundation/definitions/ShaderSemantics.js +2 -2
- package/dist/esm/foundation/helpers/Shadow/ShadowSystem.js +1 -1
- package/dist/esm/foundation/helpers/materials/createNodeBasedRaymarchingMaterials.js +1 -1
- package/dist/esm/foundation/helpers/materials/nodeBasedMaterialCommon.js +1 -1
- package/dist/esm/foundation/importer/DrcPointCloudImporter.js +1 -1
- package/dist/esm/foundation/importer/Gltf2Importer.d.ts +2 -1
- package/dist/esm/foundation/importer/Gltf2Importer.js +1 -1
- package/dist/esm/foundation/importer/GltfImporter.js +1 -1
- package/dist/esm/foundation/importer/RhodoniteImportExtension.js +1 -1
- package/dist/esm/foundation/importer/Vrm0xImporter.js +1 -1
- package/dist/esm/foundation/importer/VrmImporter.js +1 -1
- package/dist/esm/foundation/materials/contents/CustomMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/contents/MToon0xMaterialContent.js +11 -11
- package/dist/esm/foundation/materials/contents/MToon1MaterialContent.js +6 -6
- package/dist/esm/foundation/materials/core/AbstractMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/core/Material.d.ts +7 -2
- package/dist/esm/foundation/materials/core/Material.js +1 -1
- package/dist/esm/foundation/materials/core/ShaderityUtilityWebGL.js +2 -2
- package/dist/esm/foundation/materials/core/ShaderityUtilityWebGPU.js +2 -2
- package/dist/esm/foundation/memory/Accessor.js +6 -6
- package/dist/esm/foundation/memory/BufferView.js +1 -1
- package/dist/esm/foundation/misc/PngDecoder.d.ts +18 -0
- package/dist/esm/foundation/misc/PngDecoder.js +1 -0
- package/dist/esm/foundation/renderer/RenderPass.d.ts +7 -0
- package/dist/esm/foundation/renderer/RenderPass.js +1 -1
- package/dist/esm/foundation/renderer/pipelines/ForwardRenderPipeline.d.ts +2 -1
- package/dist/esm/foundation/renderer/pipelines/ForwardRenderPipeline.js +1 -1
- package/dist/esm/foundation/system/Engine.js +1 -1
- package/dist/esm/foundation/textures/CubeTexture.d.ts +11 -2
- package/dist/esm/foundation/textures/CubeTexture.js +1 -1
- package/dist/esm/foundation/textures/RenderTargetTexture2DArray.js +1 -1
- package/dist/esm/foundation/textures/RenderTargetTextureCube.d.ts +6 -0
- package/dist/esm/foundation/textures/RenderTargetTextureCube.js +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/webgl/MultiDraw.js +1 -1
- package/dist/esm/webgl/MultiDrawRepository.js +1 -1
- package/dist/esm/webgl/WebGLResourceRepository.d.ts +5 -0
- package/dist/esm/webgl/WebGLResourceRepository.js +3 -3
- package/dist/esm/webgl/WebGLStereoUtil.js +1 -1
- package/dist/esm/webgl/WebGLStrategyWebGL2.d.ts +19 -14
- package/dist/esm/webgl/WebGLStrategyWebGL2.js +67 -67
- package/dist/esm/webgl/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.frag.glsl.js +2 -1
- package/dist/esm/webgl/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.frag.glsl.js +1 -0
- package/dist/esm/webgl/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +2 -0
- package/dist/esm/webgl/shaderity_shaders/common/iblDefinition.glsl.js +11 -5
- package/dist/esm/webgl/shaders/nodes/BlockBeginShader.js +1 -1
- package/dist/esm/webgl/shaders/nodes/BlockEndShader.js +1 -1
- package/dist/esm/webgl/shaders/nodes/ConstantVariableShader.js +5 -5
- package/dist/esm/webgl/shaders/nodes/RaymarchObjectIdUniform.js +3 -3
- package/dist/esm/webgl/shaders/nodes/SdApplyWorldMatrix.js +3 -3
- package/dist/esm/webgl/shaders/nodes/Texture2DShader.js +14 -14
- package/dist/esm/webgl/shaders/nodes/UniformDataShader.js +13 -13
- package/dist/esm/webgpu/GpuCullingRegistry.js +1 -1
- package/dist/esm/webgpu/GpuDeformRegistry.js +1 -1
- package/dist/esm/webgpu/WebGpuGpuTimer.js +1 -1
- package/dist/esm/webgpu/WebGpuResourceRepository.d.ts +6 -0
- package/dist/esm/webgpu/WebGpuResourceRepository.js +5 -5
- package/dist/esm/webgpu/WebGpuStrategyBasic.js +2 -2
- package/dist/esm/webgpu/WebGpuVertexDeformer.js +1 -1
- package/dist/esm/webgpu/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.frag.wgsl.js +1 -0
- package/dist/esm/webgpu/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.frag.wgsl.js +1 -0
- package/dist/esm/webgpu/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +1 -0
- package/dist/esm/webgpu/shaderity_shaders/common/iblDefinition.wgsl.js +10 -4
- package/dist/esmdev/foundation/core/MemoryManager.d.ts +19 -0
- package/dist/esmdev/foundation/core/MemoryManager.js +28 -3
- package/dist/esmdev/foundation/core/RnObject.js +37 -37
- package/dist/esmdev/foundation/definitions/Blend.js +3 -3
- package/dist/esmdev/foundation/definitions/ComponentType.js +7 -7
- package/dist/esmdev/foundation/definitions/CompositionType.js +50 -50
- package/dist/esmdev/foundation/definitions/CompressionTextureType.js +6 -6
- package/dist/esmdev/foundation/definitions/ShaderSemantics.d.ts +1 -0
- package/dist/esmdev/foundation/definitions/ShaderSemantics.js +12 -7
- package/dist/esmdev/foundation/definitions/TextureFormat.js +3 -3
- package/dist/esmdev/foundation/definitions/TextureParameter.js +3 -3
- package/dist/esmdev/foundation/definitions/VertexAttribute.js +30 -30
- package/dist/esmdev/foundation/enhanced_js_objects/Array.js +2 -2
- package/dist/esmdev/foundation/exporter/Gltf2Exporter.js +106 -106
- package/dist/esmdev/foundation/geometry/ComplexVertexAttribute.js +18 -18
- package/dist/esmdev/foundation/geometry/Frustum.js +39 -39
- package/dist/esmdev/foundation/geometry/Mesh.js +205 -205
- package/dist/esmdev/foundation/geometry/Primitive.js +124 -124
- package/dist/esmdev/foundation/geometry/SimpleVertexAttribute.js +7 -7
- package/dist/esmdev/foundation/geometry/shapes/Cylinder.js +3 -3
- package/dist/esmdev/foundation/geometry/shapes/Joint.js +33 -33
- package/dist/esmdev/foundation/gizmos/AABBGizmo.js +12 -12
- package/dist/esmdev/foundation/gizmos/CapsuleColliderGizmo.js +23 -23
- package/dist/esmdev/foundation/gizmos/Gizmo.js +23 -23
- package/dist/esmdev/foundation/gizmos/JointGizmo.js +35 -35
- package/dist/esmdev/foundation/gizmos/LightGizmo.js +23 -23
- package/dist/esmdev/foundation/gizmos/LocatorGizmo.js +22 -22
- package/dist/esmdev/foundation/gizmos/RotationGizmo.js +197 -197
- package/dist/esmdev/foundation/gizmos/ScaleGizmo.js +129 -129
- package/dist/esmdev/foundation/gizmos/ShapeGizmo.js +43 -43
- package/dist/esmdev/foundation/gizmos/SphereColliderGizmo.js +24 -24
- package/dist/esmdev/foundation/gizmos/TranslationGizmo.js +129 -129
- package/dist/esmdev/foundation/helpers/BloomHelper.js +28 -28
- package/dist/esmdev/foundation/helpers/GaussianBlurHelper.js +18 -18
- package/dist/esmdev/foundation/helpers/Shadow/PointShadowMap.js +11 -11
- package/dist/esmdev/foundation/helpers/Shadow/ShadowMap.js +5 -5
- package/dist/esmdev/foundation/helpers/Shadow/ShadowSystem.js +111 -111
- package/dist/esmdev/foundation/helpers/materials/createNodeBasedRaymarchingMaterials.js +10 -1
- package/dist/esmdev/foundation/helpers/materials/nodeBasedMaterialCommon.js +11 -1
- package/dist/esmdev/foundation/importer/AnimationAssigner.js +44 -44
- package/dist/esmdev/foundation/importer/DrcPointCloudImporter.js +27 -27
- package/dist/esmdev/foundation/importer/Gltf2Importer.d.ts +2 -1
- package/dist/esmdev/foundation/importer/Gltf2Importer.js +21 -17
- package/dist/esmdev/foundation/importer/GltfImporter.js +22 -22
- package/dist/esmdev/foundation/importer/ModelConverter.js +131 -131
- package/dist/esmdev/foundation/importer/RhodoniteImportExtension.js +6 -6
- package/dist/esmdev/foundation/importer/Vrm0xImporter.js +48 -48
- package/dist/esmdev/foundation/importer/VrmImporter.js +10 -10
- package/dist/esmdev/foundation/materials/contents/CustomMaterialContent.js +37 -28
- package/dist/esmdev/foundation/materials/contents/DepthEncodeMaterialContent.js +2 -2
- package/dist/esmdev/foundation/materials/contents/MToon0xMaterialContent.js +145 -137
- package/dist/esmdev/foundation/materials/contents/MToon1MaterialContent.js +27 -19
- package/dist/esmdev/foundation/materials/contents/ShadowMapDecodeClassicMaterialContent.js +5 -5
- package/dist/esmdev/foundation/materials/contents/VarianceShadowMapDecodeClassicMaterialContent.js +4 -4
- package/dist/esmdev/foundation/materials/core/AbstractMaterialContent.js +47 -47
- package/dist/esmdev/foundation/materials/core/AbstractShaderNode.js +25 -25
- package/dist/esmdev/foundation/materials/core/DummyTextures.js +3 -3
- package/dist/esmdev/foundation/materials/core/Material.d.ts +7 -2
- package/dist/esmdev/foundation/materials/core/Material.js +113 -99
- package/dist/esmdev/foundation/materials/core/MaterialRepository.js +51 -51
- package/dist/esmdev/foundation/materials/core/ShaderGraphResolver.js +38 -38
- package/dist/esmdev/foundation/materials/core/ShaderHandler.js +4 -4
- package/dist/esmdev/foundation/materials/core/ShaderityUtilityWebGL.js +14 -14
- package/dist/esmdev/foundation/materials/core/ShaderityUtilityWebGPU.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/AbsShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/AcosShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/AddShaderNode.js +18 -18
- package/dist/esmdev/foundation/materials/nodes/AlphaTestShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/AndShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/Atan2ShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/AttributeColorShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributeInstanceIdsShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributeJointShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributeNormalShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributePositionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/AttributeTangentShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributeTexcoordShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/AttributeWeightShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/BlockBeginShaderNode.js +11 -11
- package/dist/esmdev/foundation/materials/nodes/BlockEndShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/BranchShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/CalcBitangentShaderNode.js +7 -7
- package/dist/esmdev/foundation/materials/nodes/CastToFloatShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/ClampShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/ClassicShaderNode.js +11 -11
- package/dist/esmdev/foundation/materials/nodes/ConstantScalarVariableShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/ConstantVariableShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/ConstantVector2VariableShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/ConstantVector3VariableShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/ConstantVector4VariableShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/CosShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/DiscardShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/DotProductShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/EqualShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/FlatShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/GreaterOrEqualShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/GreaterShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/GreaterThanShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/LengthShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/LessOrEqualShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/LessThanShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/MergeVectorShaderNode.js +19 -19
- package/dist/esmdev/foundation/materials/nodes/MinShaderNode.js +18 -18
- package/dist/esmdev/foundation/materials/nodes/MultiplyShaderNode.js +21 -21
- package/dist/esmdev/foundation/materials/nodes/NormalMatrixShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/NormalizeShaderNode.js +9 -9
- package/dist/esmdev/foundation/materials/nodes/NotEqualShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/OrShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/OutColorShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/OutPositionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/PbrAnisotropyPropsShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/PbrAnisotropyRotationShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/PbrBaseColorPropsShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/PbrClearcoatPropsShaderNode.js +7 -7
- package/dist/esmdev/foundation/materials/nodes/PbrDiffuseTransmissionPropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PbrEmissivePropsShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/PbrIridescencePropsShaderNode.js +8 -8
- package/dist/esmdev/foundation/materials/nodes/PbrMetallicRoughnessPropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PbrNormalPropsShaderNode.js +11 -11
- package/dist/esmdev/foundation/materials/nodes/PbrOcclusionPropsShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/PbrShaderShaderNode.js +21 -21
- package/dist/esmdev/foundation/materials/nodes/PbrSheenPropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PbrSpecularPropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PbrTransmissionPropsShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/PbrVolumePropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PremultipliedAlphaShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/ProcessGeometryShaderNode.js +22 -22
- package/dist/esmdev/foundation/materials/nodes/ProjectionMatrixShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/Random_HashPRNGShaderNode.js +12 -12
- package/dist/esmdev/foundation/materials/nodes/Random_SinHashShaderNode.js +12 -12
- package/dist/esmdev/foundation/materials/nodes/RemapShaderNode.js +17 -17
- package/dist/esmdev/foundation/materials/nodes/SinShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/SmoothStepShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/SplitVectorShaderNode.js +17 -17
- package/dist/esmdev/foundation/materials/nodes/StepShaderNode.js +14 -14
- package/dist/esmdev/foundation/materials/nodes/TanShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/Texture2DShaderNode.js +16 -16
- package/dist/esmdev/foundation/materials/nodes/TimeShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/TransformShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/UniformDataShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/ViewMatrixShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/WireframeMaterialNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/WorldMatrixShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendXYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendXZShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendYXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendYZShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendZXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendZYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/InitialPositionShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpSmoothIntersectionShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpSmoothSubtractionShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpSmoothUnionShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpSubtractionShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpUnionShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/raymarching/OutDistanceShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/raymarching/OutShadingColorShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/OutUnionShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchCameraPositionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchHitDistanceShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchHitNormalShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchHitPositionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchObjectIdShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchObjectIdUniformShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchRayDirectionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchTBNShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchViewDirectionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdApplyTransformShaderNode.js +9 -9
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdApplyWorldMatrixShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdBarXShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdBarYShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdBarZShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdBoxShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdCapsuleShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatXYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatYZShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatZShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatZXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRoundBoxShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdSphereShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdTorusShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdTubeXShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdTubeYShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdTubeZShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/TwistXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/TwistYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/TwistZShaderNode.js +4 -4
- package/dist/esmdev/foundation/math/AABB.js +120 -120
- package/dist/esmdev/foundation/math/AnimatedQuaternion.js +53 -53
- package/dist/esmdev/foundation/math/AnimatedScalar.js +54 -54
- package/dist/esmdev/foundation/math/AnimatedValueEvaluationState.js +18 -18
- package/dist/esmdev/foundation/math/AnimatedVector2.js +54 -54
- package/dist/esmdev/foundation/math/AnimatedVector3.js +54 -54
- package/dist/esmdev/foundation/math/AnimatedVector4.js +54 -54
- package/dist/esmdev/foundation/math/AnimatedVectorN.js +54 -54
- package/dist/esmdev/foundation/math/IdentityMatrix33.js +2 -2
- package/dist/esmdev/foundation/math/IdentityMatrix44.js +2 -2
- package/dist/esmdev/foundation/math/MathClassUtil.js +3 -3
- package/dist/esmdev/foundation/math/Quaternion.js +13 -13
- package/dist/esmdev/foundation/math/Transform3D.js +72 -72
- package/dist/esmdev/foundation/math/shapes/MathSphere.js +7 -7
- package/dist/esmdev/foundation/memory/Accessor.js +369 -369
- package/dist/esmdev/foundation/memory/Buffer.js +39 -39
- package/dist/esmdev/foundation/memory/BufferView.js +29 -29
- package/dist/esmdev/foundation/misc/DataUtil.js +2 -2
- package/dist/esmdev/foundation/misc/EnumIO.js +8 -8
- package/dist/esmdev/foundation/misc/Logger.js +14 -14
- package/dist/esmdev/foundation/misc/PngDecoder.d.ts +18 -0
- package/dist/esmdev/foundation/misc/PngDecoder.js +113 -0
- package/dist/esmdev/foundation/misc/RnPromise.js +14 -14
- package/dist/esmdev/foundation/misc/Time.js +23 -23
- package/dist/esmdev/foundation/misc/WeakOption.js +14 -14
- package/dist/esmdev/foundation/misc/cache/Cache.js +2 -2
- package/dist/esmdev/foundation/misc/cache/SymbolWeakMap.js +8 -8
- package/dist/esmdev/foundation/physics/PhysicsWorldQuery.js +10 -10
- package/dist/esmdev/foundation/physics/Rapier/RapierCharacterControllerStrategy.js +186 -186
- package/dist/esmdev/foundation/physics/Rapier/RapierPhysicsStrategy.js +221 -221
- package/dist/esmdev/foundation/physics/Rapier/RapierPhysicsWorldQueryStrategy.js +3 -3
- package/dist/esmdev/foundation/physics/VRMSpring/CapsuleCollider.js +36 -36
- package/dist/esmdev/foundation/physics/VRMSpring/SphereCollider.js +26 -26
- package/dist/esmdev/foundation/physics/VRMSpring/VRMSpringBone.js +6 -6
- package/dist/esmdev/foundation/physics/VRMSpring/VRMSpringBonePhysicsStrategy.js +39 -39
- package/dist/esmdev/foundation/renderer/Expression.js +6 -6
- package/dist/esmdev/foundation/renderer/Frame.js +6 -6
- package/dist/esmdev/foundation/renderer/FrameBuffer.js +25 -25
- package/dist/esmdev/foundation/renderer/RenderPass.d.ts +7 -0
- package/dist/esmdev/foundation/renderer/RenderPass.js +94 -86
- package/dist/esmdev/foundation/renderer/TemporalAA/PreviousFrameDataTracker.js +6 -6
- package/dist/esmdev/foundation/renderer/TemporalAA/TemporalAASystem.js +75 -75
- package/dist/esmdev/foundation/renderer/lightCluster/LightClusterSystem.js +146 -146
- package/dist/esmdev/foundation/renderer/lightCluster/LightClusterSystemStub.js +3 -3
- package/dist/esmdev/foundation/renderer/pipelines/DeferredRenderPipeline.js +4 -4
- package/dist/esmdev/foundation/renderer/pipelines/ForwardRenderPipeline.d.ts +2 -1
- package/dist/esmdev/foundation/renderer/pipelines/ForwardRenderPipeline.js +420 -420
- package/dist/esmdev/foundation/system/Engine.js +209 -209
- package/dist/esmdev/foundation/system/EventPubSub.js +8 -8
- package/dist/esmdev/foundation/system/InputManager.js +56 -56
- package/dist/esmdev/foundation/system/ModuleManager.js +3 -3
- package/dist/esmdev/foundation/textures/AbstractTexture.js +48 -48
- package/dist/esmdev/foundation/textures/CubeTexture.d.ts +11 -2
- package/dist/esmdev/foundation/textures/CubeTexture.js +47 -36
- package/dist/esmdev/foundation/textures/RenderBuffer.js +11 -11
- package/dist/esmdev/foundation/textures/RenderTargetTexture.js +24 -24
- package/dist/esmdev/foundation/textures/RenderTargetTexture2DArray.js +35 -35
- package/dist/esmdev/foundation/textures/RenderTargetTextureCube.d.ts +6 -0
- package/dist/esmdev/foundation/textures/RenderTargetTextureCube.js +25 -19
- package/dist/esmdev/foundation/textures/Sampler.js +24 -24
- package/dist/esmdev/foundation/textures/Texture.js +83 -83
- package/dist/esmdev/foundation/textures/TextureArray.js +8 -8
- package/dist/esmdev/foundation/textures/TextureDataFloat.js +26 -26
- package/dist/esmdev/foundation/textures/VideoTexture.js +24 -24
- package/dist/esmdev/version.js +2 -2
- package/dist/esmdev/webgl/InstanceSidTable.js +62 -62
- package/dist/esmdev/webgl/MultiDraw.js +2 -2
- package/dist/esmdev/webgl/MultiDrawRepository.js +30 -30
- package/dist/esmdev/webgl/WebGLContextWrapper.js +146 -146
- package/dist/esmdev/webgl/WebGLGpuTimer.js +30 -30
- package/dist/esmdev/webgl/WebGLResourceRepository.d.ts +5 -0
- package/dist/esmdev/webgl/WebGLResourceRepository.js +368 -307
- package/dist/esmdev/webgl/WebGLStereoUtil.js +39 -39
- package/dist/esmdev/webgl/WebGLStrategyWebGL2.d.ts +19 -14
- package/dist/esmdev/webgl/WebGLStrategyWebGL2.js +294 -280
- package/dist/esmdev/webgl/debug/ShaderParameterDebugger.js +4 -4
- package/dist/esmdev/webgl/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.frag.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.frag.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/common/iblDefinition.glsl.js +2 -2
- package/dist/esmdev/webgl/shaders/RaymarchingShaderPart.js +4 -4
- package/dist/esmdev/webgl/shaders/RaymarchingShadowShaderPart.js +14 -14
- package/dist/esmdev/webgl/shaders/StandardShaderPart.js +3 -3
- package/dist/esmdev/webgl/shaders/nodes/BlockBeginShader.js +10 -10
- package/dist/esmdev/webgl/shaders/nodes/BlockEndShader.js +10 -10
- package/dist/esmdev/webgl/shaders/nodes/ConstantVariableShader.js +21 -21
- package/dist/esmdev/webgl/shaders/nodes/OutDistance.js +12 -12
- package/dist/esmdev/webgl/shaders/nodes/OutUnion.js +9 -9
- package/dist/esmdev/webgl/shaders/nodes/RaymarchObjectIdUniform.js +8 -8
- package/dist/esmdev/webgl/shaders/nodes/SdApplyTransform.js +9 -9
- package/dist/esmdev/webgl/shaders/nodes/SdApplyWorldMatrix.js +8 -8
- package/dist/esmdev/webgl/shaders/nodes/Texture2DShader.js +23 -23
- package/dist/esmdev/webgl/shaders/nodes/UniformDataShader.js +23 -23
- package/dist/esmdev/webgl/textureLoader/KTX2TextureLoader.js +24 -24
- package/dist/esmdev/webgpu/GpuCullingRegistry.js +91 -91
- package/dist/esmdev/webgpu/GpuDeformRegistry.js +53 -53
- package/dist/esmdev/webgpu/RangeAllocator.js +16 -16
- package/dist/esmdev/webgpu/WebGpuBufferArena.js +21 -21
- package/dist/esmdev/webgpu/WebGpuDeviceWrapper.js +7 -7
- package/dist/esmdev/webgpu/WebGpuGpuCulling.js +198 -198
- package/dist/esmdev/webgpu/WebGpuGpuTimer.js +51 -51
- package/dist/esmdev/webgpu/WebGpuLightClusterBuilder.js +36 -36
- package/dist/esmdev/webgpu/WebGpuResourceRepository.d.ts +6 -0
- package/dist/esmdev/webgpu/WebGpuResourceRepository.js +655 -593
- package/dist/esmdev/webgpu/WebGpuStrategyBasic.js +123 -123
- package/dist/esmdev/webgpu/WebGpuVertexDeformer.js +128 -128
- package/dist/esmdev/webgpu/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.frag.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.frag.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/common/iblDefinition.wgsl.js +2 -2
- package/dist/esmdev/xr/WebARSystem.js +69 -69
- package/dist/esmdev/xr/WebXRSystem.js +151 -151
- package/package.json +2 -1
|
@@ -25,20 +25,20 @@ import { Gizmo } from "./Gizmo.js";
|
|
|
25
25
|
var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
26
26
|
constructor() {
|
|
27
27
|
super(...arguments);
|
|
28
|
-
this.
|
|
28
|
+
this.Vn = Vector3.zero();
|
|
29
|
+
this.Xn = Vector3.one();
|
|
29
30
|
this.Wn = Vector3.one();
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
35
|
-
this.hn = this.Bn.bind(this);
|
|
31
|
+
this.Rm = false;
|
|
32
|
+
this.Ym = false;
|
|
33
|
+
this.yn = this.zn.bind(this);
|
|
34
|
+
this.An = this.Bn.bind(this);
|
|
35
|
+
this.jn = this.Cn.bind(this);
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* Gets the resources for a specific engine, or undefined if not initialized.
|
|
39
39
|
*/
|
|
40
|
-
static
|
|
41
|
-
return _ScaleGizmo.
|
|
40
|
+
static Qm(engine) {
|
|
41
|
+
return _ScaleGizmo.$m.get(engine.objectUID);
|
|
42
42
|
}
|
|
43
43
|
///
|
|
44
44
|
///
|
|
@@ -50,7 +50,7 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
50
50
|
* @returns True if the gizmo is set up, false otherwise
|
|
51
51
|
*/
|
|
52
52
|
get isSetup() {
|
|
53
|
-
if (this.
|
|
53
|
+
if (this.qm != null) {
|
|
54
54
|
return true;
|
|
55
55
|
}
|
|
56
56
|
return false;
|
|
@@ -62,7 +62,7 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
62
62
|
* constant in screen space. This value no longer affects the visual size.
|
|
63
63
|
*/
|
|
64
64
|
set length(val) {
|
|
65
|
-
_ScaleGizmo.
|
|
65
|
+
_ScaleGizmo.Mm = val;
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
68
|
* Gets the current length of the gizmo handles
|
|
@@ -71,7 +71,7 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
71
71
|
* constant in screen space. This value no longer affects the visual size.
|
|
72
72
|
*/
|
|
73
73
|
get length() {
|
|
74
|
-
return _ScaleGizmo.
|
|
74
|
+
return _ScaleGizmo.Mm;
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
77
|
* Sets the gizmo size as a fraction of the viewport height.
|
|
@@ -79,25 +79,25 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
79
79
|
* @param val - The ratio of the viewport height (for example, 0.12 for 12%)
|
|
80
80
|
*/
|
|
81
81
|
set screenSpaceRatio(val) {
|
|
82
|
-
_ScaleGizmo.
|
|
82
|
+
_ScaleGizmo.bn = val;
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
85
85
|
* Gets the gizmo size as a fraction of the viewport height.
|
|
86
86
|
* @returns The ratio of the viewport height occupied by the gizmo's unit axis length
|
|
87
87
|
*/
|
|
88
88
|
get screenSpaceRatio() {
|
|
89
|
-
return _ScaleGizmo.
|
|
89
|
+
return _ScaleGizmo.bn;
|
|
90
90
|
}
|
|
91
91
|
/**
|
|
92
92
|
* Sets the visibility of the gizmo and manages input event registration
|
|
93
93
|
* @param flg - True to show the gizmo, false to hide it
|
|
94
94
|
*/
|
|
95
95
|
set isVisible(flg) {
|
|
96
|
-
const resources = _ScaleGizmo.
|
|
96
|
+
const resources = _ScaleGizmo.Qm(this.c);
|
|
97
97
|
if (!resources) {
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
|
-
if (this.
|
|
100
|
+
if (this.xm === false && flg === true) {
|
|
101
101
|
let eventTargetDom = window;
|
|
102
102
|
if (Is.exist(this.c.config.eventTargetDom)) {
|
|
103
103
|
eventTargetDom = this.c.config.eventTargetDom;
|
|
@@ -105,58 +105,58 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
105
105
|
InputManager.register(INPUT_HANDLING_STATE_GIZMO_SCALE, [
|
|
106
106
|
{
|
|
107
107
|
eventName: getEvent("start"),
|
|
108
|
-
handler: this.
|
|
108
|
+
handler: this.yn,
|
|
109
109
|
options: {},
|
|
110
110
|
classInstance: this,
|
|
111
111
|
eventTargetDom
|
|
112
112
|
},
|
|
113
113
|
{
|
|
114
114
|
eventName: getEvent("move"),
|
|
115
|
-
handler: this.
|
|
115
|
+
handler: this.An,
|
|
116
116
|
options: {},
|
|
117
117
|
classInstance: this,
|
|
118
118
|
eventTargetDom
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
121
|
eventName: getEvent("end"),
|
|
122
|
-
handler: this.
|
|
122
|
+
handler: this.jn,
|
|
123
123
|
options: {},
|
|
124
124
|
classInstance: this,
|
|
125
125
|
eventTargetDom
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
128
|
eventName: "pointerleave",
|
|
129
|
-
handler: this.
|
|
129
|
+
handler: this.jn,
|
|
130
130
|
options: {},
|
|
131
131
|
classInstance: this,
|
|
132
132
|
eventTargetDom
|
|
133
133
|
}
|
|
134
134
|
]);
|
|
135
|
-
this.
|
|
136
|
-
_ScaleGizmo.
|
|
137
|
-
if (_ScaleGizmo
|
|
138
|
-
const quaternion = _ScaleGizmo.
|
|
139
|
-
const parent = this.
|
|
135
|
+
this.qm.getSceneGraph().addChild(resources.groupEntity.getSceneGraph());
|
|
136
|
+
_ScaleGizmo.dn = this.rm;
|
|
137
|
+
if (_ScaleGizmo.an === "local") {
|
|
138
|
+
const quaternion = _ScaleGizmo.hn;
|
|
139
|
+
const parent = this.rm.getSceneGraph();
|
|
140
140
|
if (Is.exist(parent)) {
|
|
141
141
|
parent.getQuaternionRecursivelyTo(quaternion);
|
|
142
142
|
} else {
|
|
143
143
|
quaternion.identity();
|
|
144
144
|
}
|
|
145
145
|
resources.groupEntity.getTransform().localRotation = quaternion;
|
|
146
|
-
} else if (_ScaleGizmo
|
|
147
|
-
resources.groupEntity.getTransform().localRotation = _ScaleGizmo.
|
|
146
|
+
} else if (_ScaleGizmo.an === "world") {
|
|
147
|
+
resources.groupEntity.getTransform().localRotation = _ScaleGizmo.hn.identity();
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
if (this.
|
|
150
|
+
if (this.xm === true && flg === false) {
|
|
151
151
|
InputManager.unregister(INPUT_HANDLING_STATE_GIZMO_SCALE);
|
|
152
|
-
this.
|
|
153
|
-
this.
|
|
154
|
-
this.
|
|
155
|
-
this.
|
|
156
|
-
_ScaleGizmo.
|
|
152
|
+
this.Xn = this.rm.getTransform().localScale;
|
|
153
|
+
this.Vn = Vector3.zero();
|
|
154
|
+
this.Rm = false;
|
|
155
|
+
this.Wn = this.rm.getTransform().localScale;
|
|
156
|
+
_ScaleGizmo.Om = "none";
|
|
157
157
|
}
|
|
158
158
|
InputManager.setActive(INPUT_HANDLING_STATE_GIZMO_SCALE, flg);
|
|
159
|
-
this.
|
|
159
|
+
this.ym(flg);
|
|
160
160
|
resources.xyPlaneEntity.getSceneGraph().isVisible = false;
|
|
161
161
|
resources.yzPlaneEntity.getSceneGraph().isVisible = false;
|
|
162
162
|
resources.zxPlaneEntity.getSceneGraph().isVisible = false;
|
|
@@ -166,8 +166,8 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
166
166
|
* @param space - The coordinate space to use ('local' or 'world')
|
|
167
167
|
*/
|
|
168
168
|
setSpace(space) {
|
|
169
|
-
_ScaleGizmo
|
|
170
|
-
if (this.
|
|
169
|
+
_ScaleGizmo.an = space;
|
|
170
|
+
if (this.xm) {
|
|
171
171
|
this.isVisible = false;
|
|
172
172
|
this.isVisible = true;
|
|
173
173
|
}
|
|
@@ -177,7 +177,7 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
177
177
|
* @returns True if the gizmo is visible, false otherwise
|
|
178
178
|
*/
|
|
179
179
|
get isVisible() {
|
|
180
|
-
return this.
|
|
180
|
+
return this.xm;
|
|
181
181
|
}
|
|
182
182
|
///
|
|
183
183
|
///
|
|
@@ -190,33 +190,33 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
190
190
|
* Creates all necessary meshes, materials, and entity hierarchies for the scale gizmo
|
|
191
191
|
*/
|
|
192
192
|
_setup() {
|
|
193
|
-
if (this.
|
|
193
|
+
if (this.sm()) {
|
|
194
194
|
return;
|
|
195
195
|
}
|
|
196
|
-
this.
|
|
197
|
-
this.
|
|
198
|
-
this.
|
|
199
|
-
this.
|
|
200
|
-
let resources = _ScaleGizmo.
|
|
196
|
+
this.qm = createGroupEntity(this.c);
|
|
197
|
+
this.qm.tryToSetUniqueName(`ScaleGizmo_of_${this.rm.uniqueName}`, true);
|
|
198
|
+
this.qm.getSceneGraph().toMakeWorldMatrixTheSameAsLocalMatrix = true;
|
|
199
|
+
this.rm.getSceneGraph()._addGizmoChild(this.qm.getSceneGraph());
|
|
200
|
+
let resources = _ScaleGizmo.Qm(this.c);
|
|
201
201
|
if (!resources) {
|
|
202
|
-
resources = this.
|
|
203
|
-
_ScaleGizmo.
|
|
202
|
+
resources = this.Dn();
|
|
203
|
+
_ScaleGizmo.$m.set(this.c.objectUID, resources);
|
|
204
204
|
}
|
|
205
|
-
this.
|
|
205
|
+
this.qm.getSceneGraph().addChild(resources.groupEntity.getSceneGraph());
|
|
206
206
|
resources.groupEntity.getSceneGraph().addChild(resources.xCubeEntity.getSceneGraph());
|
|
207
207
|
resources.groupEntity.getSceneGraph().addChild(resources.yCubeEntity.getSceneGraph());
|
|
208
208
|
resources.groupEntity.getSceneGraph().addChild(resources.zCubeEntity.getSceneGraph());
|
|
209
209
|
resources.groupEntity.getSceneGraph().addChild(resources.xyPlaneEntity.getSceneGraph());
|
|
210
210
|
resources.groupEntity.getSceneGraph().addChild(resources.yzPlaneEntity.getSceneGraph());
|
|
211
211
|
resources.groupEntity.getSceneGraph().addChild(resources.zxPlaneEntity.getSceneGraph());
|
|
212
|
-
_ScaleGizmo.
|
|
212
|
+
_ScaleGizmo.dn = this.rm;
|
|
213
213
|
this.setGizmoTag();
|
|
214
|
-
this.
|
|
214
|
+
this.qm.tryToSetTag({ tag: "Gizmo", value: "Scale" });
|
|
215
215
|
}
|
|
216
216
|
/**
|
|
217
217
|
* Creates all resources needed for the gizmo.
|
|
218
218
|
*/
|
|
219
|
-
|
|
219
|
+
Dn() {
|
|
220
220
|
const xCubeEntity = createMeshEntity(this.c);
|
|
221
221
|
xCubeEntity.tryToSetUniqueName("ScaleGizmo_xCube", true);
|
|
222
222
|
xCubeEntity.getTransform().localPosition = Vector3.fromCopy3(0.5, 0, 0);
|
|
@@ -395,20 +395,20 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
395
395
|
* Called each frame to maintain proper gizmo positioning and scaling behavior
|
|
396
396
|
*/
|
|
397
397
|
_update() {
|
|
398
|
-
if (this.
|
|
398
|
+
if (this.qm == null) {
|
|
399
399
|
return;
|
|
400
400
|
}
|
|
401
|
-
const sg = this.
|
|
401
|
+
const sg = this.rm.getSceneGraph();
|
|
402
402
|
const aabb = sg.worldMergedAABBWithSkeletal;
|
|
403
403
|
const worldPosition = aabb.isVanilla() ? sg.position : aabb.centerPoint;
|
|
404
|
-
const transform = this.
|
|
404
|
+
const transform = this.qm.getTransform();
|
|
405
405
|
transform.localPosition = worldPosition;
|
|
406
|
-
const scale = Gizmo.
|
|
406
|
+
const scale = Gizmo.Am(this.c, worldPosition, _ScaleGizmo.bn);
|
|
407
407
|
transform.localScale = Vector3.fromCopy3(scale, scale, scale);
|
|
408
|
-
this.
|
|
409
|
-
if (this.
|
|
410
|
-
if (_ScaleGizmo.
|
|
411
|
-
this.
|
|
408
|
+
this.zm();
|
|
409
|
+
if (this.Rm) {
|
|
410
|
+
if (_ScaleGizmo.dn === this.rm) {
|
|
411
|
+
this.rm.getTransform().localScale = this.Xn;
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
414
|
}
|
|
@@ -422,13 +422,13 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
422
422
|
* @returns A primitive containing position and color data for axis lines
|
|
423
423
|
* @private
|
|
424
424
|
*/
|
|
425
|
-
static
|
|
425
|
+
static Nm(engine) {
|
|
426
426
|
const positions = new Float32Array([
|
|
427
427
|
// X axis
|
|
428
428
|
0,
|
|
429
429
|
0,
|
|
430
430
|
0,
|
|
431
|
-
this.
|
|
431
|
+
this.Mm,
|
|
432
432
|
0,
|
|
433
433
|
0,
|
|
434
434
|
// Y axis
|
|
@@ -436,7 +436,7 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
436
436
|
0,
|
|
437
437
|
0,
|
|
438
438
|
0,
|
|
439
|
-
this.
|
|
439
|
+
this.Mm,
|
|
440
440
|
0,
|
|
441
441
|
// Z axis
|
|
442
442
|
0,
|
|
@@ -444,7 +444,7 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
444
444
|
0,
|
|
445
445
|
0,
|
|
446
446
|
0,
|
|
447
|
-
this.
|
|
447
|
+
this.Mm
|
|
448
448
|
]);
|
|
449
449
|
const color = new Float32Array([
|
|
450
450
|
// X axis as Red
|
|
@@ -481,12 +481,12 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
481
481
|
* @param evt - The pointer event containing input information
|
|
482
482
|
* @private
|
|
483
483
|
*/
|
|
484
|
-
|
|
485
|
-
this.
|
|
486
|
-
_ScaleGizmo.
|
|
484
|
+
zn(evt) {
|
|
485
|
+
this.Rm = true;
|
|
486
|
+
_ScaleGizmo.Om = "none";
|
|
487
487
|
_ScaleGizmo.S = evt.clientX;
|
|
488
488
|
_ScaleGizmo.T = evt.clientY;
|
|
489
|
-
const worldMatrix = this.
|
|
489
|
+
const worldMatrix = this.rm.getSceneGraph().matrix.getRotate();
|
|
490
490
|
const scaleVec = Vector3.one();
|
|
491
491
|
let rotMat = Matrix33.fromCopy9RowMajor(
|
|
492
492
|
scaleVec.x * worldMatrix.m00,
|
|
@@ -499,42 +499,42 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
499
499
|
scaleVec.z * worldMatrix.m21,
|
|
500
500
|
scaleVec.z * worldMatrix.m22
|
|
501
501
|
);
|
|
502
|
-
if (_ScaleGizmo
|
|
502
|
+
if (_ScaleGizmo.an === "local") {
|
|
503
503
|
rotMat = Matrix33.transpose(rotMat);
|
|
504
|
-
} else if (_ScaleGizmo
|
|
504
|
+
} else if (_ScaleGizmo.an === "world") {
|
|
505
505
|
rotMat = MutableMatrix33.identity();
|
|
506
506
|
}
|
|
507
507
|
const { xResult, yResult, zResult } = _ScaleGizmo.castRay(this.c, evt);
|
|
508
508
|
let axisPicked = false;
|
|
509
509
|
if (xResult.result) {
|
|
510
510
|
assertExist(xResult.data);
|
|
511
|
-
this.
|
|
512
|
-
Logger.default.debug(`Down:${this.
|
|
513
|
-
_ScaleGizmo.
|
|
511
|
+
this.Vn = rotMat.multiplyVector(xResult.data.position.clone());
|
|
512
|
+
Logger.default.debug(`Down:${this.Vn.toStringApproximately()}`);
|
|
513
|
+
_ScaleGizmo.Om = "x";
|
|
514
514
|
axisPicked = true;
|
|
515
515
|
}
|
|
516
516
|
if (yResult.result) {
|
|
517
517
|
assertExist(yResult.data);
|
|
518
|
-
this.
|
|
519
|
-
Logger.default.debug(`Down:${this.
|
|
520
|
-
_ScaleGizmo.
|
|
518
|
+
this.Vn = rotMat.multiplyVector(yResult.data.position.clone());
|
|
519
|
+
Logger.default.debug(`Down:${this.Vn.toStringApproximately()}`);
|
|
520
|
+
_ScaleGizmo.Om = "y";
|
|
521
521
|
axisPicked = true;
|
|
522
522
|
}
|
|
523
523
|
if (zResult.result) {
|
|
524
524
|
assertExist(zResult.data);
|
|
525
|
-
this.
|
|
526
|
-
Logger.default.debug(`Down:${this.
|
|
527
|
-
_ScaleGizmo.
|
|
525
|
+
this.Vn = rotMat.multiplyVector(zResult.data.position.clone());
|
|
526
|
+
Logger.default.debug(`Down:${this.Vn.toStringApproximately()}`);
|
|
527
|
+
_ScaleGizmo.Om = "z";
|
|
528
528
|
axisPicked = true;
|
|
529
529
|
}
|
|
530
|
-
if (_ScaleGizmo.
|
|
531
|
-
this.
|
|
530
|
+
if (_ScaleGizmo.Om === "none" || axisPicked === false) {
|
|
531
|
+
this.Rm = false;
|
|
532
532
|
return;
|
|
533
533
|
}
|
|
534
534
|
evt.preventDefault();
|
|
535
|
-
this.
|
|
536
|
-
if (_ScaleGizmo.
|
|
537
|
-
this.
|
|
535
|
+
this.Hn();
|
|
536
|
+
if (_ScaleGizmo.dn === this.rm) {
|
|
537
|
+
this.Wn = this.rm.getTransform().localScale;
|
|
538
538
|
}
|
|
539
539
|
}
|
|
540
540
|
/**
|
|
@@ -542,12 +542,12 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
542
542
|
* @param evt - The pointer event containing current pointer position
|
|
543
543
|
* @private
|
|
544
544
|
*/
|
|
545
|
-
|
|
545
|
+
Bn(evt) {
|
|
546
546
|
evt.preventDefault();
|
|
547
|
-
if (Is.false(this.
|
|
547
|
+
if (Is.false(this.Rm)) {
|
|
548
548
|
return;
|
|
549
549
|
}
|
|
550
|
-
const resources = _ScaleGizmo.
|
|
550
|
+
const resources = _ScaleGizmo.Qm(this.c);
|
|
551
551
|
if (!resources) {
|
|
552
552
|
return;
|
|
553
553
|
}
|
|
@@ -561,7 +561,7 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
561
561
|
CameraComponent,
|
|
562
562
|
CameraComponent.getCurrent(this.c)
|
|
563
563
|
);
|
|
564
|
-
const worldMatrix = this.
|
|
564
|
+
const worldMatrix = this.rm.getSceneGraph().matrix.getRotate();
|
|
565
565
|
const scaleVec = Vector3.one();
|
|
566
566
|
let rotMat = Matrix33.fromCopy9RowMajor(
|
|
567
567
|
scaleVec.x * worldMatrix.m00,
|
|
@@ -574,13 +574,13 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
574
574
|
scaleVec.z * worldMatrix.m21,
|
|
575
575
|
scaleVec.z * worldMatrix.m22
|
|
576
576
|
);
|
|
577
|
-
if (_ScaleGizmo
|
|
577
|
+
if (_ScaleGizmo.an === "local") {
|
|
578
578
|
rotMat = Matrix33.transpose(rotMat);
|
|
579
|
-
} else if (_ScaleGizmo
|
|
579
|
+
} else if (_ScaleGizmo.an === "world") {
|
|
580
580
|
rotMat = MutableMatrix33.identity();
|
|
581
581
|
}
|
|
582
|
-
let pickInMovingPoint = this.
|
|
583
|
-
if (_ScaleGizmo.
|
|
582
|
+
let pickInMovingPoint = this.Vn.clone();
|
|
583
|
+
if (_ScaleGizmo.Om === "x") {
|
|
584
584
|
const xResult = resources.xyPlaneEntity.getMesh().castRayFromScreenInWorld(x, y, activeCamera, viewport, 0);
|
|
585
585
|
if (xResult.result) {
|
|
586
586
|
assertExist(xResult.data);
|
|
@@ -589,7 +589,7 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
589
589
|
Logger.default.debug(`Move:${xResult.data.position.toStringApproximately()}`);
|
|
590
590
|
}
|
|
591
591
|
}
|
|
592
|
-
if (_ScaleGizmo.
|
|
592
|
+
if (_ScaleGizmo.Om === "y") {
|
|
593
593
|
const yResult = resources.xyPlaneEntity.getMesh().castRayFromScreenInWorld(x, y, activeCamera, viewport, 0);
|
|
594
594
|
if (yResult.result) {
|
|
595
595
|
assertExist(yResult.data);
|
|
@@ -598,7 +598,7 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
598
598
|
Logger.default.debug(`Move:${yResult.data.position.toStringApproximately()}`);
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
|
-
if (_ScaleGizmo.
|
|
601
|
+
if (_ScaleGizmo.Om === "z") {
|
|
602
602
|
const zResult = resources.yzPlaneEntity.getMesh().castRayFromScreenInWorld(x, y, activeCamera, viewport, 0);
|
|
603
603
|
if (zResult.result) {
|
|
604
604
|
assertExist(zResult.data);
|
|
@@ -607,29 +607,29 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
607
607
|
Logger.default.debug(`Move:${zResult.data.position.toStringApproximately()}`);
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
|
-
const sg = this.
|
|
610
|
+
const sg = this.rm.getSceneGraph();
|
|
611
611
|
const aabb = sg.worldMergedAABBWithSkeletal;
|
|
612
612
|
const deltaVector3 = Vector3.multiplyTo(
|
|
613
|
-
Vector3.subtractTo(pickInMovingPoint, this.
|
|
613
|
+
Vector3.subtractTo(pickInMovingPoint, this.Vn, _ScaleGizmo.Hc),
|
|
614
614
|
1 / aabb.lengthCenterToCorner,
|
|
615
615
|
_ScaleGizmo.Dc
|
|
616
616
|
);
|
|
617
|
-
Logger.default.debug(`${this.
|
|
618
|
-
if (_ScaleGizmo
|
|
619
|
-
this.
|
|
620
|
-
Math.max(this.
|
|
621
|
-
Math.max(this.
|
|
622
|
-
Math.max(this.
|
|
617
|
+
Logger.default.debug(`${this.rm.uniqueName}: ${deltaVector3.toStringApproximately()}`);
|
|
618
|
+
if (_ScaleGizmo.an === "local") {
|
|
619
|
+
this.Xn = _ScaleGizmo.Ec.setComponents(
|
|
620
|
+
Math.max(this.Wn.x + deltaVector3.x, 0.01),
|
|
621
|
+
Math.max(this.Wn.y + deltaVector3.y, 0.01),
|
|
622
|
+
Math.max(this.Wn.z + deltaVector3.z, 0.01)
|
|
623
623
|
);
|
|
624
|
-
} else if (_ScaleGizmo
|
|
625
|
-
const worldQuaternion = this.
|
|
624
|
+
} else if (_ScaleGizmo.an === "world") {
|
|
625
|
+
const worldQuaternion = this.rm.getSceneGraph().getQuaternionRecursivelyTo(_ScaleGizmo.hn);
|
|
626
626
|
const worldRotation = Matrix33.fromCopyQuaternion(worldQuaternion);
|
|
627
627
|
const inverseWorldRotation = Matrix33.transpose(worldRotation);
|
|
628
628
|
const deltaLocal = inverseWorldRotation.multiplyVectorTo(deltaVector3, _ScaleGizmo.Ec);
|
|
629
|
-
this.
|
|
630
|
-
Math.max(this.
|
|
631
|
-
Math.max(this.
|
|
632
|
-
Math.max(this.
|
|
629
|
+
this.Xn = _ScaleGizmo.Sn.setComponents(
|
|
630
|
+
Math.max(this.Wn.x + deltaLocal.x, 0.01),
|
|
631
|
+
Math.max(this.Wn.y + deltaLocal.y, 0.01),
|
|
632
|
+
Math.max(this.Wn.z + deltaLocal.z, 0.01)
|
|
633
633
|
);
|
|
634
634
|
}
|
|
635
635
|
this._update();
|
|
@@ -639,28 +639,28 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
639
639
|
* @param evt - The pointer event indicating the end of interaction
|
|
640
640
|
* @private
|
|
641
641
|
*/
|
|
642
|
-
|
|
642
|
+
Cn(evt) {
|
|
643
643
|
evt.preventDefault();
|
|
644
|
-
this.
|
|
645
|
-
_ScaleGizmo.
|
|
646
|
-
this.
|
|
647
|
-
if (_ScaleGizmo.
|
|
648
|
-
this.
|
|
644
|
+
this.Rm = false;
|
|
645
|
+
_ScaleGizmo.Om = "none";
|
|
646
|
+
this.Kn();
|
|
647
|
+
if (_ScaleGizmo.dn === this.rm) {
|
|
648
|
+
this.Wn = this.rm.getTransform().localScale;
|
|
649
649
|
}
|
|
650
650
|
}
|
|
651
|
-
|
|
652
|
-
if (this.
|
|
651
|
+
Hn() {
|
|
652
|
+
if (this.Ym) {
|
|
653
653
|
return;
|
|
654
654
|
}
|
|
655
655
|
InputManager.disableCameraController();
|
|
656
|
-
this.
|
|
656
|
+
this.Ym = true;
|
|
657
657
|
}
|
|
658
|
-
|
|
659
|
-
if (!this.
|
|
658
|
+
Kn() {
|
|
659
|
+
if (!this.Ym) {
|
|
660
660
|
return;
|
|
661
661
|
}
|
|
662
662
|
InputManager.enableCameraController();
|
|
663
|
-
this.
|
|
663
|
+
this.Ym = false;
|
|
664
664
|
}
|
|
665
665
|
/**
|
|
666
666
|
* Performs ray casting against the entire gizmo group entity
|
|
@@ -669,7 +669,7 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
669
669
|
* @private
|
|
670
670
|
*/
|
|
671
671
|
static castRay2(engine, evt) {
|
|
672
|
-
const resources = _ScaleGizmo.
|
|
672
|
+
const resources = _ScaleGizmo.Qm(engine);
|
|
673
673
|
if (!resources) {
|
|
674
674
|
return { result: false };
|
|
675
675
|
}
|
|
@@ -690,7 +690,7 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
690
690
|
* @private
|
|
691
691
|
*/
|
|
692
692
|
static castRay(engine, evt) {
|
|
693
|
-
const resources = _ScaleGizmo.
|
|
693
|
+
const resources = _ScaleGizmo.Qm(engine);
|
|
694
694
|
const emptyResult = { result: false };
|
|
695
695
|
if (!resources) {
|
|
696
696
|
return { xResult: emptyResult, yResult: emptyResult, zResult: emptyResult };
|
|
@@ -712,7 +712,7 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
712
712
|
* @internal
|
|
713
713
|
*/
|
|
714
714
|
_destroy() {
|
|
715
|
-
this.
|
|
715
|
+
this.tm();
|
|
716
716
|
}
|
|
717
717
|
/**
|
|
718
718
|
* Cleans up all static resources for a specific Engine.
|
|
@@ -720,26 +720,26 @@ var _ScaleGizmo = class _ScaleGizmo extends Gizmo {
|
|
|
720
720
|
* @internal Called from Engine.destroy()
|
|
721
721
|
*/
|
|
722
722
|
static _cleanupForEngine(engine) {
|
|
723
|
-
_ScaleGizmo.
|
|
724
|
-
_ScaleGizmo.
|
|
723
|
+
_ScaleGizmo.$m.delete(engine.objectUID);
|
|
724
|
+
_ScaleGizmo.Om = "none";
|
|
725
725
|
}
|
|
726
726
|
};
|
|
727
727
|
/** Resources managed per-Engine instance */
|
|
728
|
-
_ScaleGizmo
|
|
728
|
+
_ScaleGizmo.$m = /* @__PURE__ */ new Map();
|
|
729
729
|
_ScaleGizmo.S = 0;
|
|
730
730
|
_ScaleGizmo.T = 0;
|
|
731
|
-
_ScaleGizmo.
|
|
732
|
-
_ScaleGizmo
|
|
733
|
-
_ScaleGizmo.
|
|
731
|
+
_ScaleGizmo.Om = "none";
|
|
732
|
+
_ScaleGizmo.an = "world";
|
|
733
|
+
_ScaleGizmo.Mm = 1;
|
|
734
734
|
/** Gizmo size as a fraction of the viewport height (unit axis length). */
|
|
735
|
-
_ScaleGizmo.
|
|
735
|
+
_ScaleGizmo.bn = 0.12;
|
|
736
736
|
/** Reusable quaternion for world-rotation calculations (avoids per-frame allocations) */
|
|
737
|
-
_ScaleGizmo.
|
|
737
|
+
_ScaleGizmo.hn = MutableQuaternion.identity();
|
|
738
738
|
/** Reusable vectors for drag calculations (avoids per-frame allocations) */
|
|
739
739
|
_ScaleGizmo.Hc = MutableVector3.zero();
|
|
740
740
|
_ScaleGizmo.Dc = MutableVector3.zero();
|
|
741
741
|
_ScaleGizmo.Ec = MutableVector3.zero();
|
|
742
|
-
_ScaleGizmo.
|
|
742
|
+
_ScaleGizmo.Sn = MutableVector3.zero();
|
|
743
743
|
var ScaleGizmo = _ScaleGizmo;
|
|
744
744
|
export {
|
|
745
745
|
ScaleGizmo
|