@galacean/engine-core 2.0.0-alpha.6 → 2.0.0-alpha.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +28967 -22183
- package/dist/main.js.map +1 -1
- package/dist/module.js +28951 -22175
- package/dist/module.js.map +1 -1
- package/package.json +3 -5
- package/types/2d/assembler/ISpriteAssembler.d.ts +1 -0
- package/types/2d/assembler/ISpriteRenderer.d.ts +3 -2
- package/types/2d/assembler/SimpleSpriteAssembler.d.ts +1 -0
- package/types/2d/assembler/SlicedSpriteAssembler.d.ts +1 -0
- package/types/2d/assembler/TiledSpriteAssembler.d.ts +1 -0
- package/types/2d/atlas/FontAtlas.d.ts +23 -1
- package/types/2d/atlas/SpriteAtlas.d.ts +8 -0
- package/types/2d/sprite/Sprite.d.ts +30 -4
- package/types/2d/sprite/SpriteMask.d.ts +49 -1
- package/types/2d/sprite/SpriteRenderer.d.ts +35 -1
- package/types/2d/text/CharInfo.d.ts +20 -1
- package/types/2d/text/CharRenderInfo.d.ts +15 -1
- package/types/2d/text/Font.d.ts +11 -1
- package/types/2d/text/ITextRenderer.d.ts +3 -0
- package/types/2d/text/SubFont.d.ts +35 -1
- package/types/2d/text/TextRenderer.d.ts +54 -1
- package/types/2d/text/TextUtils.d.ts +89 -1
- package/types/Background.d.ts +19 -2
- package/types/BasicResources.d.ts +58 -0
- package/types/Camera.d.ts +79 -1
- package/types/Canvas.d.ts +36 -7
- package/types/Component.d.ts +35 -2
- package/types/ComponentsDependencies.d.ts +38 -1
- package/types/ComponentsManager.d.ts +20 -0
- package/types/Engine.d.ts +114 -7
- package/types/EngineEventType.d.ts +13 -0
- package/types/Entity.d.ts +112 -21
- package/types/Polyfill.d.ts +12 -1
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +4 -2
- package/types/RenderPipeline/BatcherManager.d.ts +23 -1
- package/types/RenderPipeline/Blitter.d.ts +1 -1
- package/types/RenderPipeline/CullingResults.d.ts +17 -1
- package/types/RenderPipeline/DepthOnlyPass.d.ts +15 -1
- package/types/RenderPipeline/InstanceBuffer.d.ts +28 -0
- package/types/RenderPipeline/MaskManager.d.ts +36 -1
- package/types/RenderPipeline/OpaqueTexturePass.d.ts +16 -1
- package/types/RenderPipeline/PipelineUtils.d.ts +11 -1
- package/types/RenderPipeline/PrimitiveChunk.d.ts +27 -1
- package/types/RenderPipeline/PrimitiveChunkManager.d.ts +16 -1
- package/types/RenderPipeline/RenderContext.d.ts +46 -1
- package/types/RenderPipeline/RenderElement.d.ts +26 -6
- package/types/RenderPipeline/RenderQueue.d.ts +23 -1
- package/types/RenderPipeline/RenderTargetPool.d.ts +17 -1
- package/types/RenderPipeline/SubPrimitiveChunk.d.ts +14 -1
- package/types/RenderPipeline/VertexArea.d.ts +10 -1
- package/types/RenderPipeline/VertexMergeBatcher.d.ts +11 -0
- package/types/RenderPipeline/enums/RenderQueueMaskType.d.ts +9 -1
- package/types/RenderPipeline/index.d.ts +4 -1
- package/types/Renderer.d.ts +82 -19
- package/types/Scene.d.ts +34 -7
- package/types/SceneManager.d.ts +18 -6
- package/types/Script.d.ts +41 -0
- package/types/Signal.d.ts +71 -0
- package/types/SystemInfo.d.ts +14 -2
- package/types/Transform.d.ts +26 -1
- package/types/UpdateFlag.d.ts +4 -1
- package/types/UpdateFlagManager.d.ts +41 -1
- package/types/Utils.d.ts +20 -0
- package/types/VirtualCamera.d.ts +16 -1
- package/types/animation/AnimationClip.d.ts +13 -2
- package/types/animation/AnimationClipCurveBinding.d.ts +17 -2
- package/types/animation/AnimationEvent.d.ts +2 -2
- package/types/animation/Animator.d.ts +49 -10
- package/types/animation/AnimatorController.d.ts +20 -2
- package/types/animation/AnimatorControllerLayer.d.ts +17 -2
- package/types/animation/AnimatorControllerParameter.d.ts +4 -0
- package/types/animation/AnimatorState.d.ts +46 -2
- package/types/animation/AnimatorStateInstance.d.ts +46 -0
- package/types/animation/AnimatorStateMachine.d.ts +17 -2
- package/types/animation/AnimatorStateTransition.d.ts +9 -0
- package/types/animation/AnimatorStateTransitionCollection.d.ts +23 -1
- package/types/animation/Keyframe.d.ts +1 -1
- package/types/animation/StateMachineScript.d.ts +2 -0
- package/types/animation/animationCurve/AnimationArrayCurve.d.ts +39 -0
- package/types/animation/animationCurve/AnimationBoolCurve.d.ts +39 -0
- package/types/animation/animationCurve/AnimationColorCurve.d.ts +39 -0
- package/types/animation/animationCurve/AnimationCurve.d.ts +9 -1
- package/types/animation/animationCurve/AnimationFloatArrayCurve.d.ts +38 -0
- package/types/animation/animationCurve/AnimationFloatCurve.d.ts +39 -0
- package/types/animation/animationCurve/AnimationQuaternionCurve.d.ts +41 -0
- package/types/animation/animationCurve/AnimationRectCurve.d.ts +18 -0
- package/types/animation/animationCurve/AnimationRefCurve.d.ts +20 -2
- package/types/animation/animationCurve/AnimationStringCurve.d.ts +39 -0
- package/types/animation/animationCurve/AnimationVector2Curve.d.ts +39 -0
- package/types/animation/animationCurve/AnimationVector3Curve.d.ts +43 -0
- package/types/animation/animationCurve/AnimationVector4Curve.d.ts +39 -0
- package/types/animation/animationCurve/interfaces/IAnimationCurveCalculator.d.ts +18 -1
- package/types/animation/enums/AnimatorStatePlayState.d.ts +8 -1
- package/types/animation/index.d.ts +1 -0
- package/types/animation/internal/AnimationCurveLayerOwner.d.ts +15 -1
- package/types/animation/internal/AnimationEventHandler.d.ts +8 -1
- package/types/animation/internal/AnimatorLayerData.d.ts +28 -1
- package/types/animation/internal/AnimatorStateData.d.ts +14 -1
- package/types/animation/internal/AnimatorStatePlayData.d.ts +27 -1
- package/types/animation/internal/AnimatorTempValue.d.ts +12 -1
- package/types/animation/internal/animationCurveOwner/AnimationCurveOwner.d.ts +39 -0
- package/types/animation/internal/animationCurveOwner/assembler/BlendShapeWeightsAnimationCurveOwnerAssembler.d.ts +12 -1
- package/types/animation/internal/animationCurveOwner/assembler/IAnimationCurveOwnerAssembler.d.ts +10 -1
- package/types/animation/internal/animationCurveOwner/assembler/PositionAnimationCurveOwnerAssembler.d.ts +13 -1
- package/types/animation/internal/animationCurveOwner/assembler/RotationAnimationCurveOwnerAssembler.d.ts +13 -1
- package/types/animation/internal/animationCurveOwner/assembler/ScaleAnimationCurveOwnerAssembler.d.ts +13 -1
- package/types/animation/internal/animationCurveOwner/assembler/UniversalAnimationCurveOwnerAssembler.d.ts +23 -1
- package/types/asset/AssetPromise.d.ts +4 -4
- package/types/asset/AssetType.d.ts +7 -9
- package/types/asset/GraphicsResource.d.ts +10 -0
- package/types/asset/IReferable.d.ts +8 -0
- package/types/asset/JSONAsset.d.ts +1 -1
- package/types/asset/LoadItem.d.ts +1 -1
- package/types/asset/Loader.d.ts +2 -2
- package/types/asset/ReferResource.d.ts +28 -0
- package/types/asset/RenderingStatistics.d.ts +8 -0
- package/types/asset/ResourceManager.d.ts +117 -9
- package/types/audio/AudioClip.d.ts +8 -0
- package/types/audio/AudioManager.d.ts +18 -0
- package/types/audio/AudioSource.d.ts +20 -2
- package/types/base/Constant.d.ts +2 -19
- package/types/base/DataObject.d.ts +6 -0
- package/types/base/EngineObject.d.ts +4 -0
- package/types/base/Time.d.ts +13 -0
- package/types/base/index.d.ts +1 -0
- package/types/clone/CloneDecorators.d.ts +37 -0
- package/types/clone/CloneUtil.d.ts +30 -0
- package/types/clone/ComponentCloner.d.ts +4 -10
- package/types/clone/ICloneHook.d.ts +12 -0
- package/types/enums/CameraType.d.ts +9 -1
- package/types/env-probe/CubeProbe.d.ts +2 -0
- package/types/env-probe/Probe.d.ts +1 -1
- package/types/graphic/Buffer.d.ts +23 -3
- package/types/graphic/BufferUtil.d.ts +8 -0
- package/types/graphic/ElementRangeMapping.d.ts +9 -0
- package/types/graphic/IndexBufferBinding.d.ts +4 -0
- package/types/graphic/Mesh.d.ts +58 -1
- package/types/graphic/Primitive.d.ts +50 -1
- package/types/graphic/TransformFeedback.d.ts +46 -0
- package/types/graphic/TransformFeedbackPrimitive.d.ts +57 -0
- package/types/graphic/TransformFeedbackSimulator.d.ts +55 -0
- package/types/graphic/VertexBufferBinding.d.ts +4 -0
- package/types/graphic/VertexElement.d.ts +1 -0
- package/types/graphic/enums/BufferBindFlag.d.ts +5 -3
- package/types/index.d.ts +7 -4
- package/types/input/InputManager.d.ts +25 -6
- package/types/input/enums/PointerButton.d.ts +8 -0
- package/types/input/keyboard/KeyboardManager.d.ts +41 -1
- package/types/input/pointer/Pointer.d.ts +37 -1
- package/types/input/pointer/PointerEventData.d.ts +4 -0
- package/types/input/pointer/PointerManager.d.ts +58 -0
- package/types/input/pointer/emitter/IHitResult.d.ts +11 -1
- package/types/input/pointer/emitter/PhysicsPointerEventEmitter.d.ts +20 -1
- package/types/input/wheel/WheelManager.d.ts +34 -1
- package/types/lighting/AmbientLight.d.ts +9 -8
- package/types/lighting/DirectLight.d.ts +17 -0
- package/types/lighting/KHR_lights.d.ts +13 -1
- package/types/lighting/Light.d.ts +2 -0
- package/types/lighting/LightManager.d.ts +57 -0
- package/types/lighting/PointLight.d.ts +17 -0
- package/types/lighting/SpotLight.d.ts +17 -0
- package/types/lighting/ambientOcclusion/AmbientOcclusion.d.ts +4 -0
- package/types/lighting/ambientOcclusion/ScalableAmbientObscurancePass.d.ts +37 -1
- package/types/material/BaseMaterial.d.ts +15 -11
- package/types/material/Material.d.ts +6 -9
- package/types/mesh/BlendShape.d.ts +14 -1
- package/types/mesh/BlendShapeFrame.d.ts +11 -4
- package/types/mesh/BlendShapeManager.d.ts +100 -1
- package/types/mesh/BufferMesh.d.ts +2 -2
- package/types/mesh/MeshRenderer.d.ts +42 -0
- package/types/mesh/MeshTangentUtils.d.ts +9 -0
- package/types/mesh/ModelMesh.d.ts +28 -12
- package/types/mesh/PrimitiveMesh.d.ts +266 -104
- package/types/mesh/PrimitiveMeshOptions.d.ts +415 -0
- package/types/mesh/Skin.d.ts +12 -3
- package/types/mesh/SkinnedMeshRenderer.d.ts +27 -1
- package/types/mesh/enums/PrimitiveMeshCapMode.d.ts +21 -0
- package/types/mesh/index.d.ts +2 -0
- package/types/mesh/primitive/MeshPathUtils.d.ts +13 -0
- package/types/mesh/primitive/PolygonUtils.d.ts +44 -0
- package/types/mesh/primitive/PrimitiveMeshBuilder.d.ts +25 -0
- package/types/mesh/primitive/PrimitiveMeshRestorer.d.ts +15 -0
- package/types/mesh/primitive/SubdivisionUtils.d.ts +9 -0
- package/types/particle/ParticleBounds.d.ts +87 -0
- package/types/particle/ParticleBufferUtils.d.ts +33 -1
- package/types/particle/ParticleGenerator.d.ts +142 -24
- package/types/particle/ParticleMaterial.d.ts +3 -1
- package/types/particle/ParticleRenderer.d.ts +62 -6
- package/types/particle/ParticleSubEmitterSpawnState.d.ts +36 -0
- package/types/particle/ParticleSystemManager.d.ts +17 -0
- package/types/particle/ParticleTransformFeedbackSimulator.d.ts +48 -0
- package/types/particle/enums/ParticleInheritVelocityMode.d.ts +14 -0
- package/types/particle/enums/ParticleRandomSubSeeds.d.ts +26 -1
- package/types/particle/enums/ParticleScaleMode.d.ts +5 -5
- package/types/particle/enums/ParticleSubEmitterInheritProperty.d.ts +17 -0
- package/types/particle/enums/ParticleSubEmitterType.d.ts +12 -0
- package/types/particle/enums/attributes/BillboardParticleVertexAttribute.d.ts +6 -1
- package/types/particle/enums/attributes/ParticleFeedbackVertexAttribute.d.ts +10 -0
- package/types/particle/enums/attributes/ParticleInstanceVertexAttribute.d.ts +19 -1
- package/types/particle/index.d.ts +9 -0
- package/types/particle/modules/BirthSubEmitterCommand.d.ts +29 -0
- package/types/particle/modules/BirthSubEmitterState.d.ts +9 -0
- package/types/particle/modules/Burst.d.ts +23 -2
- package/types/particle/modules/ColorOverLifetimeModule.d.ts +19 -0
- package/types/particle/modules/CustomDataModule.d.ts +90 -0
- package/types/particle/modules/DeathSubEmitterCommand.d.ts +19 -0
- package/types/particle/modules/EmissionModule.d.ts +51 -4
- package/types/particle/modules/EmissionState.d.ts +13 -0
- package/types/particle/modules/ForceOverLifetimeModule.d.ts +16 -1
- package/types/particle/modules/InheritVelocityModule.d.ts +86 -0
- package/types/particle/modules/LimitVelocityOverLifetimeModule.d.ts +163 -0
- package/types/particle/modules/MainModule.d.ts +56 -11
- package/types/particle/modules/NoiseModule.d.ts +114 -0
- package/types/particle/modules/ParticleCompositeCurve.d.ts +46 -4
- package/types/particle/modules/ParticleCompositeGradient.d.ts +8 -2
- package/types/particle/modules/ParticleCurve.d.ts +31 -2
- package/types/particle/modules/ParticleGeneratorModule.d.ts +9 -3
- package/types/particle/modules/ParticleGradient.d.ts +22 -5
- package/types/particle/modules/RotationOverLifetimeModule.d.ts +27 -3
- package/types/particle/modules/SizeOverLifetimeModule.d.ts +25 -0
- package/types/particle/modules/SubEmitter.d.ts +32 -0
- package/types/particle/modules/SubEmittersModule.d.ts +111 -0
- package/types/particle/modules/TextureSheetAnimationModule.d.ts +14 -1
- package/types/particle/modules/VelocityOverLifetimeModule.d.ts +124 -3
- package/types/particle/modules/shape/BaseShape.d.ts +65 -2
- package/types/particle/modules/shape/BoxShape.d.ts +13 -2
- package/types/particle/modules/shape/CircleShape.d.ts +13 -1
- package/types/particle/modules/shape/ConeShape.d.ts +13 -4
- package/types/particle/modules/shape/HemisphereShape.d.ts +13 -0
- package/types/particle/modules/shape/MeshShape.d.ts +26 -3
- package/types/particle/modules/shape/ShapeUtils.d.ts +13 -1
- package/types/particle/modules/shape/SphereShape.d.ts +13 -0
- package/types/physics/CharacterController.d.ts +24 -3
- package/types/physics/Collider.d.ts +47 -3
- package/types/physics/Collision.d.ts +3 -0
- package/types/physics/DynamicCollider.d.ts +33 -7
- package/types/physics/HitResult.d.ts +2 -2
- package/types/physics/PhysicsMaterial.d.ts +11 -2
- package/types/physics/PhysicsScene.d.ts +99 -7
- package/types/physics/StaticCollider.d.ts +5 -0
- package/types/physics/enums/HingeJointFlag.d.ts +14 -1
- package/types/physics/joint/HingeJoint.d.ts +4 -0
- package/types/physics/joint/Joint.d.ts +22 -2
- package/types/physics/joint/JointLimits.d.ts +2 -1
- package/types/physics/joint/JointMotor.d.ts +2 -1
- package/types/physics/shape/ColliderShape.d.ts +44 -7
- package/types/physics/shape/MeshColliderShape.d.ts +13 -12
- package/types/postProcess/FinalPass.d.ts +20 -1
- package/types/postProcess/PostProcess.d.ts +11 -6
- package/types/postProcess/PostProcessEffect.d.ts +6 -1
- package/types/postProcess/PostProcessEffectParameter.d.ts +23 -3
- package/types/postProcess/PostProcessManager.d.ts +43 -0
- package/types/postProcess/PostProcessPass.d.ts +3 -2
- package/types/postProcess/PostProcessUberPass.d.ts +2 -1
- package/types/postProcess/effects/BloomEffect.d.ts +26 -1
- package/types/postProcess/effects/TonemappingEffect.d.ts +3 -0
- package/types/renderingHardwareInterface/IHardwareRenderer.d.ts +74 -0
- package/types/renderingHardwareInterface/IPlatformBuffer.d.ts +1 -0
- package/types/renderingHardwareInterface/IPlatformPrimitive.d.ts +6 -0
- package/types/renderingHardwareInterface/IPlatformShaderProgram.d.ts +4 -0
- package/types/renderingHardwareInterface/IPlatformTexture2D.d.ts +0 -1
- package/types/renderingHardwareInterface/IPlatformTextureCube.d.ts +0 -1
- package/types/renderingHardwareInterface/IPlatformTransformFeedback.d.ts +36 -0
- package/types/renderingHardwareInterface/IPlatformTransformFeedbackPrimitive.d.ts +39 -0
- package/types/renderingHardwareInterface/index.d.ts +5 -0
- package/types/shader/BuiltinShaders.d.ts +27 -0
- package/types/shader/Shader.d.ts +52 -25
- package/types/shader/ShaderBlockProperty.d.ts +19 -0
- package/types/shader/ShaderData.d.ts +43 -4
- package/types/shader/ShaderFactory.d.ts +77 -0
- package/types/shader/ShaderMacro.d.ts +17 -2
- package/types/shader/ShaderMacroCollection.d.ts +57 -1
- package/types/shader/ShaderMacroProcessor.d.ts +54 -0
- package/types/shader/ShaderPass.d.ts +42 -13
- package/types/shader/ShaderProgram.d.ts +92 -1
- package/types/shader/ShaderProgramMap.d.ts +20 -0
- package/types/shader/ShaderProperty.d.ts +17 -0
- package/types/shader/ShaderTagKey.d.ts +2 -0
- package/types/shader/ShaderUniform.d.ts +49 -1
- package/types/shader/ShaderUniformBlock.d.ts +9 -1
- package/types/shader/enums/ConstantBufferBindingPoint.d.ts +7 -0
- package/types/shader/enums/ShaderLanguage.d.ts +1 -3
- package/types/shader/enums/ShaderPreprocessorDirective.d.ts +22 -0
- package/types/shader/index.d.ts +3 -1
- package/types/shader/state/BlendState.d.ts +16 -1
- package/types/shader/state/DepthState.d.ts +16 -1
- package/types/shader/state/RasterState.d.ts +19 -1
- package/types/shader/state/RenderState.d.ts +13 -2
- package/types/shader/state/RenderTargetBlendState.d.ts +2 -1
- package/types/shader/state/StencilState.d.ts +15 -1
- package/types/shadow/CascadedShadowCasterPass.d.ts +5 -3
- package/types/shadow/ShadowSliceData.d.ts +13 -1
- package/types/shadow/ShadowUtils.d.ts +41 -1
- package/types/sky/Sky.d.ts +13 -4
- package/types/sky/SkyBoxMaterial.d.ts +0 -7
- package/types/texture/RenderTarget.d.ts +28 -3
- package/types/texture/Texture.d.ts +46 -12
- package/types/texture/Texture2D.d.ts +4 -1
- package/types/texture/Texture2DArray.d.ts +4 -1
- package/types/texture/TextureCube.d.ts +4 -1
- package/types/texture/TextureUtils.d.ts +15 -1
- package/types/texture/enums/TextureFormat.d.ts +1 -9
- package/types/trail/TrailRenderer.d.ts +13 -8
- package/types/ui/IUICanvas.d.ts +16 -1
- package/types/utils/DisorderedArray.d.ts +3 -1
- package/types/xr/XRManager.d.ts +28 -0
- package/types/RenderPipeline/BatchUtils.d.ts +0 -1
- package/types/RenderPipeline/SubRenderElement.d.ts +0 -22
- package/types/clone/CloneManager.d.ts +0 -31
- package/types/clone/enums/CloneMode.d.ts +0 -13
- package/types/mesh/PrimitiveMeshRestorer.d.ts +0 -1
- package/types/physics/enums/ColliderShapeChangeFlag.d.ts +0 -1
- package/types/shader/ShaderPool.d.ts +0 -1
- package/types/shader/ShaderProgramPool.d.ts +0 -1
- package/types/shader/state/index.d.ts +0 -6
- package/types/shaderlib/ShaderFactory.d.ts +0 -20
- package/types/shaderlib/ShaderLib.d.ts +0 -73
- package/types/shaderlib/index.d.ts +0 -1
- package/types/shaderlib/particle/index.d.ts +0 -15
- package/types/shaderlib/pbr/index.d.ts +0 -11
- package/types/shaderlib/shadow/index.d.ts +0 -8
package/types/Entity.d.ts
CHANGED
|
@@ -4,16 +4,66 @@ import { Component } from "./Component";
|
|
|
4
4
|
import { Engine } from "./Engine";
|
|
5
5
|
import { Layer } from "./Layer";
|
|
6
6
|
import { Scene } from "./Scene";
|
|
7
|
+
import { Script } from "./Script";
|
|
7
8
|
import { Transform } from "./Transform";
|
|
9
|
+
import { UpdateFlagManager } from "./UpdateFlagManager";
|
|
10
|
+
import { ReferResource } from "./asset/ReferResource";
|
|
8
11
|
import { EngineObject } from "./base";
|
|
12
|
+
import { ActiveChangeFlag } from "./enums/ActiveChangeFlag";
|
|
13
|
+
import { EntityModifyFlags } from "./enums/EntityModifyFlags";
|
|
14
|
+
import { DisorderedArray } from "./utils/DisorderedArray";
|
|
9
15
|
/**
|
|
10
16
|
* Entity, be used as components container.
|
|
11
17
|
*/
|
|
12
18
|
export declare class Entity extends EngineObject {
|
|
19
|
+
/** @internal */
|
|
20
|
+
static _tempComponentConstructors: ComponentConstructor[];
|
|
21
|
+
private static _isTransformType;
|
|
22
|
+
private static _checkTransformDependencies;
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
static _findChildByName(entity: Entity, childIndex: number, paths: string[], pathIndex: number): Entity | null;
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
static _traverseSetOwnerScene(entity: Entity, scene: Scene | null | undefined): void;
|
|
31
|
+
/**
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
static _removeFromChildren(children: Entity[], entity: Entity): void;
|
|
35
|
+
/**
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
static _addToChildren(children: Entity[], entity: Entity, index?: number): void;
|
|
13
39
|
/** The name of entity. */
|
|
14
40
|
name: string;
|
|
15
41
|
/** The layer the entity belongs to. */
|
|
16
42
|
layer: Layer;
|
|
43
|
+
/** @internal */
|
|
44
|
+
_isActiveInHierarchy: boolean;
|
|
45
|
+
/** @internal */
|
|
46
|
+
_isActiveInScene: boolean;
|
|
47
|
+
/** @internal */
|
|
48
|
+
_components: Component[];
|
|
49
|
+
/** @internal */
|
|
50
|
+
_scripts: DisorderedArray<Script>;
|
|
51
|
+
/** @internal */
|
|
52
|
+
_scriptsVersion: number;
|
|
53
|
+
/** @internal */
|
|
54
|
+
_children: Entity[];
|
|
55
|
+
/** @internal */
|
|
56
|
+
_scene: Scene | null | undefined;
|
|
57
|
+
/** @internal */
|
|
58
|
+
_isRoot: boolean;
|
|
59
|
+
/** @internal */
|
|
60
|
+
_isActive: boolean;
|
|
61
|
+
/** @internal */
|
|
62
|
+
_siblingIndex: number;
|
|
63
|
+
/** @internal */
|
|
64
|
+
_isTemplate: boolean;
|
|
65
|
+
/** @internal */
|
|
66
|
+
_updateFlagManager: UpdateFlagManager;
|
|
17
67
|
private _transform;
|
|
18
68
|
private _templateResource;
|
|
19
69
|
private _parent;
|
|
@@ -33,10 +83,10 @@ export declare class Entity extends EngineObject {
|
|
|
33
83
|
*/
|
|
34
84
|
get isActiveInHierarchy(): boolean;
|
|
35
85
|
/**
|
|
36
|
-
* The parent entity.
|
|
86
|
+
* The parent entity, or null if this entity has no parent.
|
|
37
87
|
*/
|
|
38
|
-
get parent(): Entity;
|
|
39
|
-
set parent(value: Entity);
|
|
88
|
+
get parent(): Entity | null;
|
|
89
|
+
set parent(value: Entity | null);
|
|
40
90
|
/**
|
|
41
91
|
* The children entities
|
|
42
92
|
*/
|
|
@@ -47,9 +97,9 @@ export declare class Entity extends EngineObject {
|
|
|
47
97
|
*/
|
|
48
98
|
get childCount(): number;
|
|
49
99
|
/**
|
|
50
|
-
* The scene
|
|
100
|
+
* The owning scene, or null/undefined if this entity is not in a scene.
|
|
51
101
|
*/
|
|
52
|
-
get scene(): Scene;
|
|
102
|
+
get scene(): Scene | null | undefined;
|
|
53
103
|
/**
|
|
54
104
|
* The sibling index.
|
|
55
105
|
*/
|
|
@@ -84,9 +134,10 @@ export declare class Entity extends EngineObject {
|
|
|
84
134
|
getComponents<T extends Component>(type: ComponentConstructor<T>, results: T[]): T[];
|
|
85
135
|
/**
|
|
86
136
|
* Get the components which match the type of the entity and it's children.
|
|
137
|
+
* @remarks The components are returned in depth-first pre-order: the entity itself first, then each child's subtree in sibling order.
|
|
87
138
|
* @param type - The component type
|
|
88
139
|
* @param results - The components collection
|
|
89
|
-
* @returns
|
|
140
|
+
* @returns The components collection which match the type
|
|
90
141
|
*/
|
|
91
142
|
getComponentsIncludeChildren<T extends Component>(type: ComponentConstructor<T>, results: T[]): T[];
|
|
92
143
|
/**
|
|
@@ -106,24 +157,24 @@ export declare class Entity extends EngineObject {
|
|
|
106
157
|
*/
|
|
107
158
|
removeChild(child: Entity): void;
|
|
108
159
|
/**
|
|
160
|
+
* Get a child entity by index.
|
|
161
|
+
* @param index - The zero-based child index
|
|
162
|
+
* @returns The child at the index, or undefined if none exists
|
|
109
163
|
* @deprecated Please use `children` property instead.
|
|
110
|
-
* Find child entity by index.
|
|
111
|
-
* @param index - The index of the child entity
|
|
112
|
-
* @returns The component which be found
|
|
113
164
|
*/
|
|
114
|
-
getChild(index: number): Entity;
|
|
165
|
+
getChild(index: number): Entity | undefined;
|
|
115
166
|
/**
|
|
116
|
-
* Find entity
|
|
117
|
-
* @param name - The name of the entity
|
|
118
|
-
* @returns The
|
|
167
|
+
* Find the first entity with the given name in this entity and its descendants.
|
|
168
|
+
* @param name - The name of the entity to find
|
|
169
|
+
* @returns The first matching entity, or null if none is found
|
|
119
170
|
*/
|
|
120
|
-
findByName(name: string): Entity;
|
|
171
|
+
findByName(name: string): Entity | null;
|
|
121
172
|
/**
|
|
122
|
-
* Find
|
|
123
|
-
* @param path - The path
|
|
124
|
-
* @returns The
|
|
173
|
+
* Find a descendant by its path relative to this entity.
|
|
174
|
+
* @param path - The entity path, with names separated by "/"
|
|
175
|
+
* @returns The matching entity, this entity for an empty path, or null if none is found
|
|
125
176
|
*/
|
|
126
|
-
findByPath(path: string): Entity;
|
|
177
|
+
findByPath(path: string): Entity | null;
|
|
127
178
|
/**
|
|
128
179
|
* Create child entity.
|
|
129
180
|
* @param name - The child entity's name
|
|
@@ -135,8 +186,8 @@ export declare class Entity extends EngineObject {
|
|
|
135
186
|
*/
|
|
136
187
|
clearChildren(): void;
|
|
137
188
|
/**
|
|
138
|
-
* Clone this
|
|
139
|
-
* @returns
|
|
189
|
+
* Clone this Entity, including children and components.
|
|
190
|
+
* @returns A detached clone that must be added to a parent Entity or Scene to update and render
|
|
140
191
|
*/
|
|
141
192
|
clone(): Entity;
|
|
142
193
|
/**
|
|
@@ -144,12 +195,52 @@ export declare class Entity extends EngineObject {
|
|
|
144
195
|
* @returns Change flag
|
|
145
196
|
*/
|
|
146
197
|
registerWorldChangeFlag(): BoolUpdateFlag;
|
|
198
|
+
/**
|
|
199
|
+
* @internal
|
|
200
|
+
*/
|
|
201
|
+
_markAsTemplate(templateResource: ReferResource): void;
|
|
147
202
|
private _createCloneEntity;
|
|
148
203
|
private _parseCloneEntity;
|
|
149
204
|
/**
|
|
150
205
|
* Destroy self.
|
|
151
206
|
*/
|
|
152
207
|
destroy(): void;
|
|
208
|
+
/**
|
|
209
|
+
* @internal
|
|
210
|
+
*/
|
|
211
|
+
_removeComponent(component: Component): void;
|
|
212
|
+
/**
|
|
213
|
+
* @internal
|
|
214
|
+
*/
|
|
215
|
+
_addScript(script: Script): void;
|
|
216
|
+
/**
|
|
217
|
+
* @internal
|
|
218
|
+
*/
|
|
219
|
+
_removeScript(script: Script): void;
|
|
220
|
+
/**
|
|
221
|
+
* @internal
|
|
222
|
+
*/
|
|
223
|
+
_removeFromParent(): void;
|
|
224
|
+
/**
|
|
225
|
+
* @internal
|
|
226
|
+
*/
|
|
227
|
+
_processActive(activeChangeFlag: ActiveChangeFlag): void;
|
|
228
|
+
/**
|
|
229
|
+
* @internal
|
|
230
|
+
*/
|
|
231
|
+
_processInActive(activeChangeFlag: ActiveChangeFlag): void;
|
|
232
|
+
/**
|
|
233
|
+
* @internal
|
|
234
|
+
*/
|
|
235
|
+
_setParentChange(): void;
|
|
236
|
+
/**
|
|
237
|
+
* @internal
|
|
238
|
+
*/
|
|
239
|
+
_registerModifyListener(onChange: (flag: EntityModifyFlags) => void): void;
|
|
240
|
+
/**
|
|
241
|
+
* @internal
|
|
242
|
+
*/
|
|
243
|
+
_unRegisterModifyListener(onChange: (flag: EntityModifyFlags) => void): void;
|
|
153
244
|
private _dispatchModify;
|
|
154
245
|
private _addToChildrenList;
|
|
155
246
|
private _setParent;
|
|
@@ -158,7 +249,7 @@ export declare class Entity extends EngineObject {
|
|
|
158
249
|
private _setActiveInHierarchy;
|
|
159
250
|
private _setInActiveInHierarchy;
|
|
160
251
|
private _setSiblingIndex;
|
|
161
|
-
private
|
|
252
|
+
private _replaceTransform;
|
|
162
253
|
private _invModelMatrix;
|
|
163
254
|
private _inverseWorldMatFlag;
|
|
164
255
|
/**
|
package/types/Polyfill.d.ts
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
export declare class Polyfill {
|
|
5
|
+
static registerPolyfill(): void;
|
|
6
|
+
private static _registerMatchAll;
|
|
7
|
+
private static _registerAudioContext;
|
|
8
|
+
private static _registerOfflineAudioContext;
|
|
9
|
+
private static _promisifyDecodeAudioData;
|
|
10
|
+
private static _registerTextMetrics;
|
|
11
|
+
private static _registerPromiseFinally;
|
|
12
|
+
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { Camera } from "../Camera";
|
|
2
2
|
import { CameraClearFlags } from "../enums/CameraClearFlags";
|
|
3
3
|
import { TextureCubeFace } from "../texture";
|
|
4
|
+
import { CullingResults } from "./CullingResults";
|
|
4
5
|
import { RenderContext } from "./RenderContext";
|
|
5
6
|
import { RenderElement } from "./RenderElement";
|
|
6
7
|
/**
|
|
7
8
|
* Basic render pipeline.
|
|
8
9
|
*/
|
|
9
10
|
export declare class BasicRenderPipeline {
|
|
11
|
+
/** @internal */
|
|
12
|
+
_cullingResults: CullingResults;
|
|
10
13
|
private _camera;
|
|
11
14
|
private _lastCanvasSize;
|
|
12
15
|
private _internalColorTarget;
|
|
@@ -16,7 +19,6 @@ export declare class BasicRenderPipeline {
|
|
|
16
19
|
private _opaqueTexturePass;
|
|
17
20
|
private _finalPass;
|
|
18
21
|
private _copyBackgroundTexture;
|
|
19
|
-
private _canUseBlitFrameBuffer;
|
|
20
22
|
private _shouldCopyBackgroundColor;
|
|
21
23
|
/**
|
|
22
24
|
* Create a basic render pipeline.
|
|
@@ -42,7 +44,7 @@ export declare class BasicRenderPipeline {
|
|
|
42
44
|
* @param renderElement - Render element
|
|
43
45
|
*/
|
|
44
46
|
pushRenderElement(context: RenderContext, renderElement: RenderElement): void;
|
|
45
|
-
private
|
|
47
|
+
private _pushRenderElementByType;
|
|
46
48
|
private _drawBackgroundTexture;
|
|
47
49
|
private _prepareRender;
|
|
48
50
|
}
|
|
@@ -1 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
import { Engine } from "../Engine";
|
|
2
|
+
import { InstanceBuffer } from "./InstanceBuffer";
|
|
3
|
+
import { PrimitiveChunkManager } from "./PrimitiveChunkManager";
|
|
4
|
+
import { RenderElement } from "./RenderElement";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare class BatcherManager {
|
|
9
|
+
engine: Engine;
|
|
10
|
+
private _primitiveChunkManager2D;
|
|
11
|
+
private _primitiveChunkManagerMask;
|
|
12
|
+
private _primitiveChunkManagerUI;
|
|
13
|
+
private _instanceBuffer;
|
|
14
|
+
constructor(engine: Engine);
|
|
15
|
+
get instanceBuffer(): InstanceBuffer;
|
|
16
|
+
get primitiveChunkManager2D(): PrimitiveChunkManager;
|
|
17
|
+
get primitiveChunkManagerMask(): PrimitiveChunkManager;
|
|
18
|
+
get primitiveChunkManagerUI(): PrimitiveChunkManager;
|
|
19
|
+
destroy(): void;
|
|
20
|
+
batch(input: RenderElement[], output: RenderElement[]): void;
|
|
21
|
+
private static _flush;
|
|
22
|
+
uploadBuffer(): void;
|
|
23
|
+
}
|
|
@@ -24,5 +24,5 @@ export declare class Blitter {
|
|
|
24
24
|
* @param passIndex - Pass index to use of the provided material
|
|
25
25
|
* @param sourceScaleOffset - Source scale and offset
|
|
26
26
|
*/
|
|
27
|
-
static blitTexture(engine: Engine, source: Texture2D, destination: RenderTarget | null, mipLevel?: number, viewport?: Vector4, material?: Material, passIndex?: number, sourceScaleOffset?: Vector4): void;
|
|
27
|
+
static blitTexture(engine: Engine, source: Texture2D, destination: RenderTarget | null, mipLevel?: number, viewport?: Vector4, material?: Material | null, passIndex?: number, sourceScaleOffset?: Vector4): void;
|
|
28
28
|
}
|
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
import { BatcherManager } from "./BatcherManager";
|
|
2
|
+
import { ContextRendererUpdateFlag } from "./RenderContext";
|
|
3
|
+
import { RenderQueue } from "./RenderQueue";
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
* Culling results.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CullingResults {
|
|
9
|
+
readonly opaqueQueue: RenderQueue;
|
|
10
|
+
readonly transparentQueue: RenderQueue;
|
|
11
|
+
readonly alphaTestQueue: RenderQueue;
|
|
12
|
+
constructor();
|
|
13
|
+
reset(): void;
|
|
14
|
+
sortBatch(batcherManager: BatcherManager): void;
|
|
15
|
+
setRenderUpdateFlagTrue(rendererUpdateFlag: ContextRendererUpdateFlag): void;
|
|
16
|
+
destroy(): void;
|
|
17
|
+
}
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import { Camera } from "../Camera";
|
|
2
|
+
import { PipelinePass } from "../RenderPipeline/PipelinePass";
|
|
3
|
+
import { RenderTarget } from "../texture/RenderTarget";
|
|
4
|
+
import { CullingResults } from "./CullingResults";
|
|
5
|
+
import { RenderContext } from "./RenderContext";
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
* Depth only pass.
|
|
9
|
+
*/
|
|
10
|
+
export declare class DepthOnlyPass extends PipelinePass {
|
|
11
|
+
renderTarget: RenderTarget | null;
|
|
12
|
+
onConfig(camera: Camera): void;
|
|
13
|
+
onRender(context: RenderContext, cullingResults: CullingResults): void;
|
|
14
|
+
release(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Engine } from "../Engine";
|
|
2
|
+
import { Buffer } from "../graphic/Buffer";
|
|
3
|
+
import { Renderer } from "../Renderer";
|
|
4
|
+
import { ShaderMacro } from "../shader/ShaderMacro";
|
|
5
|
+
import { InstanceBufferLayout } from "../shader/ShaderFactory";
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
* Manages a UBO for GPU instancing, packing per-instance renderer data (ModelMat, Layer, etc.).
|
|
9
|
+
*/
|
|
10
|
+
export declare class InstanceBuffer {
|
|
11
|
+
static gpuInstanceMacro: ShaderMacro;
|
|
12
|
+
buffer: Buffer;
|
|
13
|
+
private _engine;
|
|
14
|
+
private _layout;
|
|
15
|
+
private _data;
|
|
16
|
+
private _floatView;
|
|
17
|
+
private _intView;
|
|
18
|
+
constructor(engine: Engine);
|
|
19
|
+
/**
|
|
20
|
+
* Set UBO layout and allocate buffer if needed.
|
|
21
|
+
*/
|
|
22
|
+
setLayout(layout: InstanceBufferLayout): void;
|
|
23
|
+
/**
|
|
24
|
+
* Pack renderer data into UBO and upload to GPU.
|
|
25
|
+
*/
|
|
26
|
+
upload(renderers: Renderer[], start: number, count: number): void;
|
|
27
|
+
destroy(): void;
|
|
28
|
+
}
|
|
@@ -1 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
import { SpriteMask } from "../2d";
|
|
2
|
+
import { SpriteMaskLayer } from "../enums/SpriteMaskLayer";
|
|
3
|
+
import { Material } from "../material";
|
|
4
|
+
import { RenderContext } from "./RenderContext";
|
|
5
|
+
import { RenderQueue } from "./RenderQueue";
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare class MaskManager {
|
|
10
|
+
private static _stencilEnabledProp;
|
|
11
|
+
private static _stencilWriteMaskProp;
|
|
12
|
+
private static _stencilMaskProp;
|
|
13
|
+
private static _stencilCompareFunctionFrontProp;
|
|
14
|
+
private static _stencilCompareFunctionBackProp;
|
|
15
|
+
private static _stencilPassOperationFrontProp;
|
|
16
|
+
private static _stencilPassOperationBackProp;
|
|
17
|
+
private static _stencilFailOperationFrontProp;
|
|
18
|
+
private static _stencilFailOperationBackProp;
|
|
19
|
+
private static _stencilZFailOperationFrontProp;
|
|
20
|
+
private static _stencilZFailOperationBackProp;
|
|
21
|
+
private static _maskIncrementRenderQueue;
|
|
22
|
+
private static _maskDecrementRenderQueue;
|
|
23
|
+
static getMaskIncrementRenderQueue(): RenderQueue;
|
|
24
|
+
static getMaskDecrementRenderQueue(): RenderQueue;
|
|
25
|
+
hasStencilWritten: boolean;
|
|
26
|
+
private _preMaskLayer;
|
|
27
|
+
private _allSpriteMasks;
|
|
28
|
+
addSpriteMask(mask: SpriteMask): void;
|
|
29
|
+
removeSpriteMask(mask: SpriteMask): void;
|
|
30
|
+
drawMask(context: RenderContext, pipelineStageTagValue: string, maskLayer: SpriteMaskLayer): void;
|
|
31
|
+
clearMask(context: RenderContext, pipelineStageTagValue: string): void;
|
|
32
|
+
isStencilWritten(material: Material): boolean;
|
|
33
|
+
isReadStencil(material: Material): boolean;
|
|
34
|
+
destroy(): void;
|
|
35
|
+
private _buildMaskRenderElement;
|
|
36
|
+
}
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { Camera } from "../Camera";
|
|
2
|
+
import { Engine } from "../Engine";
|
|
3
|
+
import { Texture } from "../texture";
|
|
4
|
+
import { PipelinePass } from "./PipelinePass";
|
|
5
|
+
import { RenderContext } from "./RenderContext";
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
* Opaque texture pass.
|
|
9
|
+
*/
|
|
10
|
+
export declare class OpaqueTexturePass extends PipelinePass {
|
|
11
|
+
private _cameraColorTexture;
|
|
12
|
+
private _renderTarget;
|
|
13
|
+
constructor(engine: Engine);
|
|
14
|
+
onConfig(camera: Camera, cameraColorTexture: Texture): void;
|
|
15
|
+
onRender(context: RenderContext): void;
|
|
16
|
+
}
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { Vector4 } from "@galacean/engine-math";
|
|
2
|
+
import { Engine } from "../Engine";
|
|
3
|
+
import { RenderTarget, Texture2D, TextureFilterMode, TextureFormat, TextureWrapMode } from "../texture";
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare class PipelineUtils {
|
|
8
|
+
static readonly defaultViewport: Vector4;
|
|
9
|
+
static recreateTextureIfNeeded(engine: Engine, currentTexture: Texture2D | null, width: number, height: number, format: TextureFormat, mipmap: boolean, isSRGBColorSpace: boolean, textureWrapMode: TextureWrapMode, textureFilterMode: TextureFilterMode): Texture2D;
|
|
10
|
+
static recreateRenderTargetIfNeeded(engine: Engine, currentRenderTarget: RenderTarget | null | undefined, width: number, height: number, colorFormat: TextureFormat | null, depthFormat: TextureFormat | null, needDepthTexture: boolean, mipmap: boolean, isSRGBColorSpace: boolean, antiAliasing: number, textureWrapMode: TextureWrapMode, textureFilterMode: TextureFilterMode): RenderTarget;
|
|
11
|
+
}
|
|
@@ -1 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
import { Engine } from "../Engine";
|
|
2
|
+
import { Primitive, SubMesh } from "../graphic";
|
|
3
|
+
import { ReturnableObjectPool } from "../utils/ReturnableObjectPool";
|
|
4
|
+
import { SubPrimitiveChunk } from "./SubPrimitiveChunk";
|
|
5
|
+
import { VertexArea } from "./VertexArea";
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare class PrimitiveChunk {
|
|
10
|
+
static areaPool: ReturnableObjectPool<VertexArea>;
|
|
11
|
+
static subChunkPool: ReturnableObjectPool<SubPrimitiveChunk>;
|
|
12
|
+
static subMeshPool: ReturnableObjectPool<SubMesh>;
|
|
13
|
+
primitive: Primitive;
|
|
14
|
+
vertices: Float32Array;
|
|
15
|
+
indices: Uint16Array;
|
|
16
|
+
updateVertexStart: number;
|
|
17
|
+
updateVertexEnd: number;
|
|
18
|
+
updateIndexLength: number;
|
|
19
|
+
vertexFreeAreas: Array<VertexArea>;
|
|
20
|
+
constructor(engine: Engine, maxVertexCount: number);
|
|
21
|
+
allocateSubChunk(vertexCount: number): SubPrimitiveChunk | null;
|
|
22
|
+
freeSubChunk(subChunk: SubPrimitiveChunk): void;
|
|
23
|
+
uploadBuffer(): void;
|
|
24
|
+
destroy(): void;
|
|
25
|
+
private _allocateArea;
|
|
26
|
+
private _freeArea;
|
|
27
|
+
}
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { Engine } from "../Engine";
|
|
2
|
+
import { PrimitiveChunk } from "./PrimitiveChunk";
|
|
3
|
+
import { SubPrimitiveChunk } from "./SubPrimitiveChunk";
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare class PrimitiveChunkManager {
|
|
8
|
+
engine: Engine;
|
|
9
|
+
maxVertexCount: number;
|
|
10
|
+
primitiveChunks: PrimitiveChunk[];
|
|
11
|
+
constructor(engine: Engine, maxVertexCount?: number);
|
|
12
|
+
allocateSubChunk(vertexCount: number): SubPrimitiveChunk | null;
|
|
13
|
+
freeSubChunk(subChunk: SubPrimitiveChunk): void;
|
|
14
|
+
uploadBuffer(): void;
|
|
15
|
+
destroy(): void;
|
|
16
|
+
}
|
|
@@ -1 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
import { Matrix, Vector4 } from "@galacean/engine-math";
|
|
2
|
+
import { Camera } from "../Camera";
|
|
3
|
+
import { VirtualCamera } from "../VirtualCamera";
|
|
4
|
+
import { ReplacementFailureStrategy } from "../enums/ReplacementFailureStrategy";
|
|
5
|
+
import { Shader, ShaderProperty } from "../shader";
|
|
6
|
+
import { ShaderTagKey } from "../shader/ShaderTagKey";
|
|
7
|
+
import { RenderTarget, TextureCubeFace } from "../texture";
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare class RenderContext {
|
|
12
|
+
static vpMatrixProperty: ShaderProperty;
|
|
13
|
+
static pipelineStageKey: ShaderTagKey;
|
|
14
|
+
/** @internal */
|
|
15
|
+
static _flipYMatrix: Matrix;
|
|
16
|
+
private static _cameraProjectionProperty;
|
|
17
|
+
private static _viewMatrixProperty;
|
|
18
|
+
private static _projectionMatrixProperty;
|
|
19
|
+
private static _flipYProjectionMatrix;
|
|
20
|
+
private static _flipYViewProjectionMatrix;
|
|
21
|
+
private _projectionParams;
|
|
22
|
+
camera: Camera;
|
|
23
|
+
virtualCamera: VirtualCamera;
|
|
24
|
+
replacementShader: Shader | null;
|
|
25
|
+
replacementTag: ShaderTagKey | null | undefined;
|
|
26
|
+
replacementFailureStrategy: ReplacementFailureStrategy | null;
|
|
27
|
+
flipProjection: boolean | null;
|
|
28
|
+
viewMatrix: Matrix;
|
|
29
|
+
projectionMatrix: Matrix;
|
|
30
|
+
viewProjectionMatrix: Matrix;
|
|
31
|
+
applyVirtualCamera(virtualCamera: VirtualCamera, flipProjection: boolean | null): void;
|
|
32
|
+
setRenderTarget(destination: RenderTarget | null, viewport: Vector4, mipLevel?: number, faceIndex?: TextureCubeFace): void;
|
|
33
|
+
garbageCollection(): void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
export declare enum ContextRendererUpdateFlag {
|
|
39
|
+
None = 0,
|
|
40
|
+
WorldMatrix = 1,
|
|
41
|
+
viewMatrix = 2,
|
|
42
|
+
ProjectionMatrix = 4,
|
|
43
|
+
WorldViewMatrix = 3,
|
|
44
|
+
viewProjectionMatrix = 6,
|
|
45
|
+
All = 7
|
|
46
|
+
}
|
|
@@ -1,12 +1,32 @@
|
|
|
1
|
+
import { Renderer } from "../Renderer";
|
|
2
|
+
import { Primitive, SubMesh } from "../graphic";
|
|
3
|
+
import { Material } from "../material";
|
|
4
|
+
import { ShaderData, SubShader } from "../shader";
|
|
5
|
+
import { Texture2D } from "../texture";
|
|
1
6
|
import { IPoolElement } from "../utils/ObjectPool";
|
|
2
|
-
import {
|
|
3
|
-
import { SubRenderElement } from "./SubRenderElement";
|
|
7
|
+
import { SubPrimitiveChunk } from "./SubPrimitiveChunk";
|
|
4
8
|
export declare class RenderElement implements IPoolElement {
|
|
5
9
|
priority: number;
|
|
6
10
|
distanceForSort: number;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
component: Renderer;
|
|
12
|
+
primitive: Primitive;
|
|
13
|
+
material: Material;
|
|
14
|
+
subPrimitive: SubMesh;
|
|
15
|
+
subShader: SubShader;
|
|
16
|
+
shaderData?: ShaderData;
|
|
17
|
+
instancedRenderers: Renderer[];
|
|
18
|
+
subDistancePriority: number;
|
|
19
|
+
/** @internal Marks a batch leader — a self-contained draw range that must not be merged again downstream */
|
|
20
|
+
_isBatched: boolean;
|
|
21
|
+
texture?: Texture2D;
|
|
22
|
+
subChunk?: SubPrimitiveChunk;
|
|
23
|
+
set(component: Renderer, material: Material, primitive: Primitive, subPrimitive: SubMesh, texture?: Texture2D, subChunk?: SubPrimitiveChunk, shaderData?: ShaderData): void;
|
|
24
|
+
/**
|
|
25
|
+
* @internal
|
|
26
|
+
* Copy identity fields from `source` and reset per-queue batch state, so the same
|
|
27
|
+
* logical element can live in multiple queues (e.g. an Opaque + Transparent multi-pass
|
|
28
|
+
* material) without one queue's batching corrupting another's `instancedRenderers`.
|
|
29
|
+
*/
|
|
30
|
+
_cloneFrom(source: RenderElement): void;
|
|
11
31
|
dispose(): void;
|
|
12
32
|
}
|
|
@@ -1 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
import { RenderQueueType } from "../shader";
|
|
2
|
+
import { BatcherManager } from "./BatcherManager";
|
|
3
|
+
import { ContextRendererUpdateFlag, RenderContext } from "./RenderContext";
|
|
4
|
+
import { RenderElement } from "./RenderElement";
|
|
5
|
+
import { RenderQueueMaskType } from "./enums/RenderQueueMaskType";
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare class RenderQueue {
|
|
10
|
+
renderQueueType: RenderQueueType;
|
|
11
|
+
static compareForOpaque(a: RenderElement, b: RenderElement): number;
|
|
12
|
+
static compareForTransparent(a: RenderElement, b: RenderElement): number;
|
|
13
|
+
readonly elements: RenderElement[];
|
|
14
|
+
readonly batchedElements: RenderElement[];
|
|
15
|
+
rendererUpdateFlag: ContextRendererUpdateFlag;
|
|
16
|
+
constructor(renderQueueType: RenderQueueType);
|
|
17
|
+
pushRenderElement(element: RenderElement): void;
|
|
18
|
+
sortBatch(compareFunc: Function, batcherManager: BatcherManager): void;
|
|
19
|
+
batch(batcherManager: BatcherManager): void;
|
|
20
|
+
render(context: RenderContext, pipelineStageTagValue: string, maskType?: RenderQueueMaskType): void;
|
|
21
|
+
clear(): void;
|
|
22
|
+
destroy(): void;
|
|
23
|
+
}
|
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
import { Engine } from "../Engine";
|
|
2
|
+
import { RenderTarget, Texture2D, TextureFilterMode, TextureFormat, TextureWrapMode } from "../texture";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare class RenderTargetPool {
|
|
7
|
+
private _freeRenderTargets;
|
|
8
|
+
private _freeTextures;
|
|
9
|
+
private _engine;
|
|
10
|
+
constructor(engine: Engine);
|
|
11
|
+
allocateRenderTarget(width: number, height: number, colorFormat: TextureFormat | null, depthFormat: TextureFormat | null, needDepthTexture: boolean, mipmap: boolean, isSRGBColorSpace: boolean, antiAliasing: number, wrapMode: TextureWrapMode, filterMode: TextureFilterMode): RenderTarget;
|
|
12
|
+
allocateTexture(width: number, height: number, format: TextureFormat, mipmap: boolean, isSRGBColorSpace: boolean, wrapMode: TextureWrapMode, filterMode: TextureFilterMode): Texture2D;
|
|
13
|
+
freeRenderTarget(renderTarget: RenderTarget): void;
|
|
14
|
+
freeTexture(texture: Texture2D): void;
|
|
15
|
+
gc(): void;
|
|
16
|
+
private static _matchRenderTarget;
|
|
17
|
+
}
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import { SubMesh } from "../graphic";
|
|
2
|
+
import { IPoolElement } from "../utils/ObjectPool";
|
|
3
|
+
import { VertexArea } from "./VertexArea";
|
|
4
|
+
import { PrimitiveChunk } from "./PrimitiveChunk";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare class SubPrimitiveChunk implements IPoolElement {
|
|
9
|
+
chunk: PrimitiveChunk;
|
|
10
|
+
vertexArea: VertexArea;
|
|
11
|
+
subMesh: SubMesh;
|
|
12
|
+
indices: number[];
|
|
13
|
+
dispose?(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ShaderTagKey } from "../shader";
|
|
2
|
+
import { RenderElement } from "./RenderElement";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare class VertexMergeBatcher {
|
|
7
|
+
protected static _disableBatchTag: ShaderTagKey;
|
|
8
|
+
static canBatchSprite(preElement: RenderElement, curElement: RenderElement): boolean;
|
|
9
|
+
static canBatchSpriteMask(preElement: RenderElement, curElement: RenderElement): boolean;
|
|
10
|
+
static batch(preElement: RenderElement | null, curElement: RenderElement): void;
|
|
11
|
+
}
|