@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
|
@@ -1,13 +1,20 @@
|
|
|
1
|
+
import { ICollider, IColliderShape } from "@galacean/engine-design";
|
|
1
2
|
import { BoolUpdateFlag } from "../BoolUpdateFlag";
|
|
2
|
-
import {
|
|
3
|
+
import type { ICloneHook } from "../clone/ICloneHook";
|
|
3
4
|
import { Component } from "../Component";
|
|
5
|
+
import { Entity } from "../Entity";
|
|
4
6
|
import { Layer } from "../Layer";
|
|
5
7
|
import { ColliderShape } from "./shape/ColliderShape";
|
|
8
|
+
import type { MeshColliderShape } from "./shape/MeshColliderShape";
|
|
6
9
|
/**
|
|
7
10
|
* Base class for all colliders.
|
|
8
11
|
* @decorator `@dependentComponents(Transform, DependentMode.CheckOnly)`
|
|
9
12
|
*/
|
|
10
|
-
export declare class Collider extends Component implements
|
|
13
|
+
export declare class Collider extends Component implements ICloneHook<Collider> {
|
|
14
|
+
/** @internal */
|
|
15
|
+
_index: number;
|
|
16
|
+
/** @internal */
|
|
17
|
+
_nativeCollider: ICollider;
|
|
11
18
|
protected _updateFlag: BoolUpdateFlag;
|
|
12
19
|
protected _shapes: ColliderShape[];
|
|
13
20
|
protected _collisionLayerIndex: number;
|
|
@@ -22,8 +29,13 @@ export declare class Collider extends Component implements ICustomClone {
|
|
|
22
29
|
*/
|
|
23
30
|
get collisionLayer(): Layer;
|
|
24
31
|
set collisionLayer(value: Layer);
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
constructor(entity: Entity);
|
|
25
36
|
/**
|
|
26
37
|
* Add collider shape on this collider.
|
|
38
|
+
* @remarks If the shape belongs to another Collider, it is moved to this Collider.
|
|
27
39
|
* @param shape - Collider shape
|
|
28
40
|
*/
|
|
29
41
|
addShape(shape: ColliderShape): void;
|
|
@@ -36,8 +48,40 @@ export declare class Collider extends Component implements ICustomClone {
|
|
|
36
48
|
* Remove all shape attached.
|
|
37
49
|
*/
|
|
38
50
|
clearShapes(): void;
|
|
51
|
+
/**
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
_onUpdate(): void;
|
|
55
|
+
/**
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
_onLateUpdate(): void;
|
|
59
|
+
/**
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
_onEnableInScene(): void;
|
|
63
|
+
/**
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
_onDisableInScene(): void;
|
|
67
|
+
/**
|
|
68
|
+
* @internal
|
|
69
|
+
* @inheritdoc
|
|
70
|
+
*/
|
|
71
|
+
_onClone(target: Collider): void;
|
|
72
|
+
/**
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
_handleShapesChanged(): void;
|
|
76
|
+
/**
|
|
77
|
+
* @internal
|
|
78
|
+
*/
|
|
79
|
+
_replaceNativeShape(shape: MeshColliderShape, nativeShape: IColliderShape | null): void;
|
|
39
80
|
protected _syncNative(): void;
|
|
81
|
+
/**
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
84
|
+
protected _onDestroy(): void;
|
|
40
85
|
protected _addNativeShape(shape: ColliderShape): void;
|
|
41
86
|
protected _removeNativeShape(shape: ColliderShape): void;
|
|
42
|
-
private _setCollisionLayer;
|
|
43
87
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { ContactPoint } from "./ContactPoint";
|
|
2
2
|
import { ColliderShape } from "./shape";
|
|
3
|
+
import { ICollision } from "@galacean/engine-design";
|
|
3
4
|
/**
|
|
4
5
|
* Collision information between two shapes when they collide.
|
|
5
6
|
*/
|
|
6
7
|
export declare class Collision {
|
|
8
|
+
/** @internal */
|
|
9
|
+
_nativeCollision: ICollision;
|
|
7
10
|
/** The target shape be collided. */
|
|
8
11
|
shape: ColliderShape;
|
|
9
12
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Quaternion, Vector3 } from "@galacean/engine-math";
|
|
2
|
+
import { Entity } from "../Entity";
|
|
2
3
|
import { Collider } from "./Collider";
|
|
3
4
|
import { ColliderShape } from "./shape/ColliderShape";
|
|
4
5
|
/**
|
|
@@ -50,26 +51,26 @@ export declare class DynamicCollider extends Collider {
|
|
|
50
51
|
get mass(): number;
|
|
51
52
|
set mass(value: number);
|
|
52
53
|
/**
|
|
53
|
-
* Whether
|
|
54
|
-
* @remarks
|
|
54
|
+
* Whether the center of mass is calculated automatically from the attached shapes.
|
|
55
|
+
* @remarks Disabling this preserves the current value.
|
|
55
56
|
*/
|
|
56
57
|
get automaticCenterOfMass(): boolean;
|
|
57
58
|
set automaticCenterOfMass(value: boolean);
|
|
58
59
|
/**
|
|
59
60
|
* The center of mass relative to the transform's origin.
|
|
60
|
-
* @remarks
|
|
61
|
+
* @remarks Set `automaticCenterOfMass` to false before changing this value.
|
|
61
62
|
*/
|
|
62
63
|
get centerOfMass(): Vector3;
|
|
63
64
|
set centerOfMass(value: Vector3);
|
|
64
65
|
/**
|
|
65
|
-
* Whether
|
|
66
|
-
* @remarks
|
|
66
|
+
* Whether the inertia tensor is calculated automatically from the attached shapes and mass.
|
|
67
|
+
* @remarks Disabling this preserves the current value.
|
|
67
68
|
*/
|
|
68
69
|
get automaticInertiaTensor(): boolean;
|
|
69
70
|
set automaticInertiaTensor(value: boolean);
|
|
70
71
|
/**
|
|
71
72
|
* The diagonal inertia tensor of mass relative to the center of mass.
|
|
72
|
-
* @remarks
|
|
73
|
+
* @remarks Set `automaticInertiaTensor` to false before changing this value.
|
|
73
74
|
*/
|
|
74
75
|
get inertiaTensor(): Vector3;
|
|
75
76
|
set inertiaTensor(value: Vector3);
|
|
@@ -109,15 +110,27 @@ export declare class DynamicCollider extends Collider {
|
|
|
109
110
|
get constraints(): DynamicColliderConstraints;
|
|
110
111
|
set constraints(value: DynamicColliderConstraints);
|
|
111
112
|
/**
|
|
112
|
-
* The
|
|
113
|
+
* The collision detection mode.
|
|
114
|
+
* @remarks With the PhysX backend, Continuous and ContinuousDynamic are mapped to speculative CCD while the collider
|
|
115
|
+
* is kinematic.
|
|
113
116
|
*/
|
|
114
117
|
get collisionDetectionMode(): CollisionDetectionMode;
|
|
115
118
|
set collisionDetectionMode(value: CollisionDetectionMode);
|
|
119
|
+
/**
|
|
120
|
+
* @internal
|
|
121
|
+
*/
|
|
122
|
+
constructor(entity: Entity);
|
|
116
123
|
/**
|
|
117
124
|
* Apply a force to the DynamicCollider.
|
|
118
125
|
* @param force - The force make the collider move
|
|
119
126
|
*/
|
|
120
127
|
applyForce(force: Vector3): void;
|
|
128
|
+
/**
|
|
129
|
+
* Apply a force to the DynamicCollider at a given position in world space.
|
|
130
|
+
* @param force - The force to apply, in world space
|
|
131
|
+
* @param position - The position where the force is applied, in world space
|
|
132
|
+
*/
|
|
133
|
+
applyForceAtPosition(force: Vector3, position: Vector3): void;
|
|
121
134
|
/**
|
|
122
135
|
* Apply a torque to the DynamicCollider.
|
|
123
136
|
* @param torque - The force make the collider rotate
|
|
@@ -162,6 +175,19 @@ export declare class DynamicCollider extends Collider {
|
|
|
162
175
|
* @inheritdoc
|
|
163
176
|
*/
|
|
164
177
|
addShape(shape: ColliderShape): void;
|
|
178
|
+
/**
|
|
179
|
+
* @internal
|
|
180
|
+
*/
|
|
181
|
+
_onLateUpdate(): void;
|
|
182
|
+
/**
|
|
183
|
+
* @internal
|
|
184
|
+
* @inheritdoc
|
|
185
|
+
*/
|
|
186
|
+
_onClone(target: DynamicCollider): void;
|
|
187
|
+
/**
|
|
188
|
+
* @internal
|
|
189
|
+
*/
|
|
190
|
+
_handleShapesChanged(): void;
|
|
165
191
|
protected _syncNative(): void;
|
|
166
192
|
private _setMassAndUpdateInertia;
|
|
167
193
|
private _setLinearVelocity;
|
|
@@ -6,7 +6,7 @@ import { ColliderShape } from "./shape";
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class HitResult {
|
|
8
8
|
/** The entity that was hit. */
|
|
9
|
-
entity: Entity;
|
|
9
|
+
entity: Entity | null;
|
|
10
10
|
/** The distance from the ray's origin to the impact point. */
|
|
11
11
|
distance: number;
|
|
12
12
|
/** The impact point in world space where the ray hit the collider. */
|
|
@@ -14,5 +14,5 @@ export declare class HitResult {
|
|
|
14
14
|
/** The normal of the surface the ray hit. */
|
|
15
15
|
normal: Vector3;
|
|
16
16
|
/** The shape of the collider that was hit. */
|
|
17
|
-
shape: ColliderShape;
|
|
17
|
+
shape: ColliderShape | null;
|
|
18
18
|
}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
+
import { IPhysicsMaterial, IPhysicsMaterialProperties } from "@galacean/engine-design";
|
|
1
2
|
import { PhysicsMaterialCombineMode } from "./enums/PhysicsMaterialCombineMode";
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
+
* Surface friction, bounciness, and combine modes for collider shapes.
|
|
4
5
|
*/
|
|
5
6
|
export declare class PhysicsMaterial {
|
|
7
|
+
/** @internal */
|
|
8
|
+
static readonly _defaultProperties: IPhysicsMaterialProperties;
|
|
6
9
|
private _bounciness;
|
|
7
10
|
private _dynamicFriction;
|
|
8
11
|
private _staticFriction;
|
|
9
12
|
private _bounceCombine;
|
|
10
13
|
private _frictionCombine;
|
|
11
14
|
private _destroyed;
|
|
15
|
+
/** @internal */
|
|
16
|
+
_nativeMaterial: IPhysicsMaterial;
|
|
12
17
|
constructor();
|
|
13
18
|
/**
|
|
14
19
|
* The coefficient of bounciness, ranging from 0 to 1.
|
|
@@ -36,7 +41,11 @@ export declare class PhysicsMaterial {
|
|
|
36
41
|
get frictionCombine(): PhysicsMaterialCombineMode;
|
|
37
42
|
set frictionCombine(value: PhysicsMaterialCombineMode);
|
|
38
43
|
/**
|
|
39
|
-
*
|
|
44
|
+
* Create an independent material with the same properties.
|
|
45
|
+
*/
|
|
46
|
+
clone(): PhysicsMaterial;
|
|
47
|
+
/**
|
|
48
|
+
* Release this material after all shapes have stopped using it.
|
|
40
49
|
*/
|
|
41
50
|
destroy(): void;
|
|
42
51
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Ray, Vector3, Quaternion } from "@galacean/engine-math";
|
|
2
2
|
import { Layer } from "../Layer";
|
|
3
3
|
import { Scene } from "../Scene";
|
|
4
|
+
import { CharacterController } from "./CharacterController";
|
|
5
|
+
import { Collider } from "./Collider";
|
|
4
6
|
import { HitResult } from "./HitResult";
|
|
5
7
|
import { ColliderShape } from "./shape";
|
|
6
8
|
/**
|
|
@@ -9,18 +11,17 @@ import { ColliderShape } from "./shape";
|
|
|
9
11
|
export declare class PhysicsScene {
|
|
10
12
|
private static _collision;
|
|
11
13
|
private static _identityQuaternion;
|
|
14
|
+
private static _tempDirection;
|
|
15
|
+
private static _raycastHitPool;
|
|
16
|
+
private static _raycastSeenHits;
|
|
17
|
+
private static _scriptIndexSetter;
|
|
12
18
|
private _scene;
|
|
13
19
|
private _restTime;
|
|
14
20
|
private _fixedTimeStep;
|
|
15
21
|
private _colliders;
|
|
16
22
|
private _gravity;
|
|
17
23
|
private _nativePhysicsScene;
|
|
18
|
-
private
|
|
19
|
-
private _onContactExit;
|
|
20
|
-
private _onContactStay;
|
|
21
|
-
private _onTriggerEnter;
|
|
22
|
-
private _onTriggerExit;
|
|
23
|
-
private _onTriggerStay;
|
|
24
|
+
private _contactEventConsumerCount;
|
|
24
25
|
/**
|
|
25
26
|
* The gravity of physics scene.
|
|
26
27
|
*/
|
|
@@ -91,6 +92,46 @@ export declare class PhysicsScene {
|
|
|
91
92
|
* @returns Returns True if the ray intersects with a collider, otherwise false.
|
|
92
93
|
*/
|
|
93
94
|
raycast(ray: Ray, distance: number, layerMask: Layer, outHitResult: HitResult): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Casts a ray and writes all hits in unspecified order.
|
|
97
|
+
* @param ray - World-space ray; its direction is normalized internally
|
|
98
|
+
* @param outHitResults - Receives the hits, reusing existing objects; resized to the hit count
|
|
99
|
+
* @returns Whether any hit was found
|
|
100
|
+
*
|
|
101
|
+
* @remarks All result objects, including caller-supplied ones, are borrowed and overwritten on reuse.
|
|
102
|
+
* Copy values to retain them. Unused objects are cleared and recycled for other queries.
|
|
103
|
+
* Reuse the array without clearing it; manually removed objects are not pooled.
|
|
104
|
+
* Do not share objects across output arrays or resubmit recycled objects. Duplicate entries share the last write.
|
|
105
|
+
*/
|
|
106
|
+
raycastAll(ray: Ray, outHitResults: HitResult[]): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Casts a ray and writes all hits in unspecified order.
|
|
109
|
+
* @param ray - World-space ray; its direction is normalized internally
|
|
110
|
+
* @param distance - Maximum query distance; non-positive values return no hits
|
|
111
|
+
* @param outHitResults - Receives the hits, reusing existing objects; resized to the hit count
|
|
112
|
+
* @returns Whether any hit was found
|
|
113
|
+
*
|
|
114
|
+
* @remarks All result objects, including caller-supplied ones, are borrowed and overwritten on reuse.
|
|
115
|
+
* Copy values to retain them. Unused objects are cleared and recycled for other queries.
|
|
116
|
+
* Reuse the array without clearing it; manually removed objects are not pooled.
|
|
117
|
+
* Do not share objects across output arrays or resubmit recycled objects. Duplicate entries share the last write.
|
|
118
|
+
*/
|
|
119
|
+
raycastAll(ray: Ray, distance: number, outHitResults: HitResult[]): boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Casts a ray and optionally writes all hits in unspecified order.
|
|
122
|
+
* @param ray - World-space ray; its direction is normalized internally
|
|
123
|
+
* @param distance - Maximum query distance; defaults to `Number.MAX_VALUE`
|
|
124
|
+
* @param layerMask - Collision layers to include; defaults to `Layer.Everything`
|
|
125
|
+
* @param outHitResults - Receives the hits; resized to the hit count. Omit to test for a hit only
|
|
126
|
+
* @returns Whether any hit was found
|
|
127
|
+
*
|
|
128
|
+
* @remarks All result objects, including caller-supplied ones, are borrowed and overwritten on reuse.
|
|
129
|
+
* Copy values to retain them. Unused objects are cleared and recycled for other queries.
|
|
130
|
+
* Reuse the array without clearing it; manually removed objects are not pooled.
|
|
131
|
+
* Do not share objects across output arrays or resubmit recycled objects. Duplicate entries share the last write.
|
|
132
|
+
* Non-positive distances or directions that cannot be normalized clear the output; hits at distance 0 are ignored.
|
|
133
|
+
*/
|
|
134
|
+
raycastAll(ray: Ray, distance?: number, layerMask?: Layer, outHitResults?: HitResult[]): boolean;
|
|
94
135
|
/**
|
|
95
136
|
* Casts a box through the Scene and returns true if there is any hit.
|
|
96
137
|
* @param center - The center of the box
|
|
@@ -269,8 +310,59 @@ export declare class PhysicsScene {
|
|
|
269
310
|
* @returns The collider shapes overlapping with the capsule
|
|
270
311
|
*/
|
|
271
312
|
overlapCapsuleAll(center: Vector3, radius: number, height: number, orientation?: Quaternion, layerMask?: Layer, shapes?: ColliderShape[]): ColliderShape[];
|
|
313
|
+
/**
|
|
314
|
+
* Call on every frame to update pose of objects.
|
|
315
|
+
* @internal
|
|
316
|
+
*/
|
|
317
|
+
_update(deltaTime: number): void;
|
|
318
|
+
/**
|
|
319
|
+
* Add collider into the manager.
|
|
320
|
+
* @param collider - StaticCollider or DynamicCollider.
|
|
321
|
+
* @internal
|
|
322
|
+
*/
|
|
323
|
+
_addCollider(collider: Collider): void;
|
|
324
|
+
/**
|
|
325
|
+
* Add character controller into the manager.
|
|
326
|
+
* @param controller - Character Controller.
|
|
327
|
+
* @internal
|
|
328
|
+
*/
|
|
329
|
+
_addCharacterController(controller: CharacterController): void;
|
|
330
|
+
/**
|
|
331
|
+
* Remove collider.
|
|
332
|
+
* @param collider - StaticCollider or DynamicCollider.
|
|
333
|
+
* @internal
|
|
334
|
+
*/
|
|
335
|
+
_removeCollider(collider: Collider): void;
|
|
336
|
+
/**
|
|
337
|
+
* Remove collider.
|
|
338
|
+
* @param controller - Character Controller.
|
|
339
|
+
* @internal
|
|
340
|
+
*/
|
|
341
|
+
_removeCharacterController(controller: CharacterController): void;
|
|
342
|
+
/**
|
|
343
|
+
* @internal
|
|
344
|
+
*/
|
|
345
|
+
_addContactEventConsumer(delta: 1 | -1): void;
|
|
346
|
+
/**
|
|
347
|
+
* @internal
|
|
348
|
+
*/
|
|
349
|
+
_callColliderOnUpdate(): void;
|
|
350
|
+
/**
|
|
351
|
+
* @internal
|
|
352
|
+
*/
|
|
353
|
+
_callColliderOnLateUpdate(): void;
|
|
354
|
+
/**
|
|
355
|
+
* @internal
|
|
356
|
+
*/
|
|
357
|
+
_gc(): void;
|
|
358
|
+
/**
|
|
359
|
+
* @internal
|
|
360
|
+
*/
|
|
361
|
+
_destroy(): void;
|
|
362
|
+
private _dispatchEvents;
|
|
363
|
+
private static _normalizeDirection;
|
|
272
364
|
private _setGravity;
|
|
273
|
-
private _createPreFilter;
|
|
274
365
|
private _createHitCallback;
|
|
366
|
+
private _setHitResult;
|
|
275
367
|
private _clearHitResult;
|
|
276
368
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { Entity } from "../Entity";
|
|
1
2
|
import { Collider } from "./Collider";
|
|
2
3
|
/**
|
|
3
4
|
* A static collider component that will not move.
|
|
4
5
|
* @remarks Mostly used for object which always stays at the same place and never moves around.
|
|
5
6
|
*/
|
|
6
7
|
export declare class StaticCollider extends Collider {
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
constructor(entity: Entity);
|
|
7
12
|
}
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Flags specific to the Hinge Joint.
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare enum HingeJointFlag {
|
|
6
|
+
/** None. */
|
|
7
|
+
None = 0,
|
|
8
|
+
/** Enable the limit. */
|
|
9
|
+
LimitEnabled = 1,
|
|
10
|
+
/** Enable the drive. */
|
|
11
|
+
DriveEnabled = 2,
|
|
12
|
+
/** If the existing velocity is beyond the drive velocity, do not add force. */
|
|
13
|
+
DriveFreeSpin = 4
|
|
14
|
+
}
|
|
@@ -53,6 +53,10 @@ export declare class HingeJoint extends Joint {
|
|
|
53
53
|
get limits(): JointLimits;
|
|
54
54
|
set limits(value: JointLimits);
|
|
55
55
|
constructor(entity: Entity);
|
|
56
|
+
/**
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
_onDisableInScene(): void;
|
|
56
60
|
protected _createJoint(): void;
|
|
57
61
|
protected _syncNative(): void;
|
|
58
62
|
private _onMotorChanged;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DataObject } from "../../base/DataObject";
|
|
1
2
|
import { IJoint } from "@galacean/engine-design";
|
|
2
3
|
import { Vector3 } from "@galacean/engine-math";
|
|
3
4
|
import { Component } from "../../Component";
|
|
@@ -13,14 +14,14 @@ export declare abstract class Joint extends Component {
|
|
|
13
14
|
private static _tempMatrix;
|
|
14
15
|
protected _colliderInfo: JointColliderInfo;
|
|
15
16
|
protected _connectedColliderInfo: JointColliderInfo;
|
|
16
|
-
protected _nativeJoint: IJoint;
|
|
17
|
+
protected _nativeJoint: IJoint | null;
|
|
17
18
|
private _force;
|
|
18
19
|
private _torque;
|
|
19
20
|
private _automaticConnectedAnchor;
|
|
20
21
|
/**
|
|
21
22
|
* The connected collider.
|
|
22
23
|
*/
|
|
23
|
-
get connectedCollider(): Collider;
|
|
24
|
+
get connectedCollider(): Collider | null;
|
|
24
25
|
set connectedCollider(value: Collider);
|
|
25
26
|
/**
|
|
26
27
|
* The anchor position.
|
|
@@ -70,6 +71,14 @@ export declare abstract class Joint extends Component {
|
|
|
70
71
|
get breakTorque(): number;
|
|
71
72
|
set breakTorque(value: number);
|
|
72
73
|
constructor(entity: Entity);
|
|
74
|
+
/**
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
|
+
_onEnableInScene(): void;
|
|
78
|
+
/**
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
_onDisableInScene(): void;
|
|
73
82
|
protected abstract _createJoint(): void;
|
|
74
83
|
protected _syncNative(): void;
|
|
75
84
|
private _calculateConnectedAnchor;
|
|
@@ -79,3 +88,14 @@ export declare abstract class Joint extends Component {
|
|
|
79
88
|
private _updateRotation;
|
|
80
89
|
private _updateActualAnchor;
|
|
81
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* @internal
|
|
93
|
+
*/
|
|
94
|
+
declare class JointColliderInfo extends DataObject {
|
|
95
|
+
collider: Collider | null;
|
|
96
|
+
anchor: Vector3;
|
|
97
|
+
actualAnchor: Vector3;
|
|
98
|
+
massScale: number;
|
|
99
|
+
inertiaScale: number;
|
|
100
|
+
}
|
|
101
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { DataObject } from "../../base/DataObject";
|
|
1
2
|
import { UpdateFlagManager } from "../../UpdateFlagManager";
|
|
2
3
|
/**
|
|
3
4
|
* JointLimits is used to limit the joints angle.
|
|
4
5
|
*/
|
|
5
|
-
export declare class JointLimits {
|
|
6
|
+
export declare class JointLimits extends DataObject {
|
|
6
7
|
/** @internal */
|
|
7
8
|
_updateFlagManager: UpdateFlagManager;
|
|
8
9
|
private _max;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { DataObject } from "../../base/DataObject";
|
|
1
2
|
import { UpdateFlagManager } from "../../UpdateFlagManager";
|
|
2
3
|
/**
|
|
3
4
|
* The JointMotor is used to motorize a joint.
|
|
4
5
|
*/
|
|
5
|
-
export declare class JointMotor {
|
|
6
|
+
export declare class JointMotor extends DataObject {
|
|
6
7
|
/** @internal */
|
|
7
8
|
_updateFlagManager: UpdateFlagManager;
|
|
8
9
|
private _targetVelocity;
|
|
@@ -1,22 +1,38 @@
|
|
|
1
|
+
import { DataObject } from "../../base/DataObject";
|
|
2
|
+
import { IColliderShape, IPhysicsMaterial } from "@galacean/engine-design";
|
|
1
3
|
import { PhysicsMaterial } from "../PhysicsMaterial";
|
|
2
4
|
import { Vector3 } from "@galacean/engine-math";
|
|
3
5
|
import { Collider } from "../Collider";
|
|
4
|
-
import {
|
|
6
|
+
import type { ICloneHook } from "../../clone/ICloneHook";
|
|
5
7
|
/**
|
|
6
8
|
* Abstract class for collider shapes.
|
|
7
9
|
*/
|
|
8
|
-
export declare abstract class ColliderShape implements
|
|
10
|
+
export declare abstract class ColliderShape extends DataObject implements ICloneHook<ColliderShape> {
|
|
9
11
|
private static _idGenerator;
|
|
12
|
+
/** @internal */
|
|
13
|
+
_collider: Collider | null;
|
|
14
|
+
/** @internal */
|
|
15
|
+
_nativeShape: IColliderShape | null;
|
|
10
16
|
protected _id: number;
|
|
11
|
-
protected _material: PhysicsMaterial;
|
|
17
|
+
protected _material: PhysicsMaterial | null;
|
|
18
|
+
private _materialInstanced;
|
|
12
19
|
private _isTrigger;
|
|
20
|
+
private _isSceneQuery;
|
|
13
21
|
private _rotation;
|
|
14
22
|
private _position;
|
|
15
23
|
private _contactOffset;
|
|
24
|
+
/**
|
|
25
|
+
* @internal
|
|
26
|
+
* @beta
|
|
27
|
+
* Whether this shape participates in scene queries, including raycasts, shape casts, and overlap queries.
|
|
28
|
+
* This does not affect collision response.
|
|
29
|
+
*/
|
|
30
|
+
get isSceneQuery(): boolean;
|
|
31
|
+
set isSceneQuery(value: boolean);
|
|
16
32
|
/**
|
|
17
33
|
* Collider owner of this shape.
|
|
18
34
|
*/
|
|
19
|
-
get collider(): Collider;
|
|
35
|
+
get collider(): Collider | null;
|
|
20
36
|
/**
|
|
21
37
|
* Unique id for this shape.
|
|
22
38
|
*/
|
|
@@ -28,10 +44,12 @@ export declare abstract class ColliderShape implements ICustomClone {
|
|
|
28
44
|
get contactOffset(): number;
|
|
29
45
|
set contactOffset(value: number);
|
|
30
46
|
/**
|
|
31
|
-
*
|
|
47
|
+
* The assigned material, or null to use the shared default material.
|
|
48
|
+
* @defaultValue null
|
|
49
|
+
* @remarks This property returns null for the shared default. Use {@link getInstanceMaterial} to obtain an instance.
|
|
32
50
|
*/
|
|
33
|
-
get material(): PhysicsMaterial;
|
|
34
|
-
set material(value: PhysicsMaterial);
|
|
51
|
+
get material(): PhysicsMaterial | null;
|
|
52
|
+
set material(value: PhysicsMaterial | null);
|
|
35
53
|
/**
|
|
36
54
|
* The local rotation of this ColliderShape, in degrees.
|
|
37
55
|
*/
|
|
@@ -48,6 +66,13 @@ export declare abstract class ColliderShape implements ICustomClone {
|
|
|
48
66
|
get isTrigger(): boolean;
|
|
49
67
|
set isTrigger(value: boolean);
|
|
50
68
|
protected constructor();
|
|
69
|
+
/**
|
|
70
|
+
* Get the instance material for this shape.
|
|
71
|
+
* @remarks On first use, assigns a clone of {@link material}, or a new material with default properties if null.
|
|
72
|
+
* Reuses the instance until a different material or null is assigned.
|
|
73
|
+
* @returns The instance material
|
|
74
|
+
*/
|
|
75
|
+
getInstanceMaterial(): PhysicsMaterial;
|
|
51
76
|
/**
|
|
52
77
|
* Get the distance and the closest point on the shape from a point.
|
|
53
78
|
* @param point - Location in world space you want to find the closest point to
|
|
@@ -55,7 +80,19 @@ export declare abstract class ColliderShape implements ICustomClone {
|
|
|
55
80
|
* @returns The distance between the point and the shape
|
|
56
81
|
*/
|
|
57
82
|
getClosestPoint(point: Vector3, outClosestPoint: Vector3): number;
|
|
83
|
+
/**
|
|
84
|
+
* @internal
|
|
85
|
+
* @inheritdoc
|
|
86
|
+
*/
|
|
87
|
+
_onClone(target: ColliderShape): void;
|
|
88
|
+
/**
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
91
|
+
_destroy(): void;
|
|
92
|
+
protected _cloneNativeShape(target: ColliderShape): void;
|
|
93
|
+
protected _getNativeMaterial(): IPhysicsMaterial;
|
|
58
94
|
protected _syncNative(): void;
|
|
95
|
+
protected _syncNativeShape(nativeShape: IColliderShape): void;
|
|
59
96
|
private _setPosition;
|
|
60
97
|
private _setRotation;
|
|
61
98
|
}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { ModelMesh } from "../../mesh/ModelMesh";
|
|
2
1
|
import { Vector3 } from "@galacean/engine-math";
|
|
2
|
+
import { ModelMesh } from "../../mesh/ModelMesh";
|
|
3
3
|
import { MeshColliderShapeCookingFlag } from "../enums/MeshColliderShapeCookingFlag";
|
|
4
4
|
import { ColliderShape } from "./ColliderShape";
|
|
5
5
|
/**
|
|
6
6
|
* Collider shape based on mesh geometry, supporting both convex hull and triangle mesh modes.
|
|
7
7
|
*/
|
|
8
8
|
export declare class MeshColliderShape extends ColliderShape {
|
|
9
|
+
private static readonly _unitScale;
|
|
9
10
|
private _mesh;
|
|
10
11
|
private _isConvex;
|
|
11
|
-
private
|
|
12
|
-
private _indices;
|
|
12
|
+
private _meshData;
|
|
13
13
|
private _cookingFlags;
|
|
14
|
-
private _isShapeAttached;
|
|
15
14
|
/**
|
|
16
15
|
* Cooking flags for this mesh collider shape.
|
|
17
16
|
*/
|
|
@@ -20,7 +19,7 @@ export declare class MeshColliderShape extends ColliderShape {
|
|
|
20
19
|
/**
|
|
21
20
|
* Whether to use convex mesh mode.
|
|
22
21
|
* @remarks
|
|
23
|
-
* - When true, generates a convex hull from the mesh vertices. Works with
|
|
22
|
+
* - When true, generates a convex hull from the mesh vertices. Works with StaticCollider or DynamicCollider.
|
|
24
23
|
* - When false, uses the original triangle mesh. Only works with StaticCollider or kinematic DynamicCollider, and the mesh must have indices.
|
|
25
24
|
*/
|
|
26
25
|
get isConvex(): boolean;
|
|
@@ -29,17 +28,19 @@ export declare class MeshColliderShape extends ColliderShape {
|
|
|
29
28
|
* The mesh used for collision detection.
|
|
30
29
|
* @remarks The mesh must have accessible data (not released after upload).
|
|
31
30
|
*/
|
|
32
|
-
get mesh(): ModelMesh;
|
|
33
|
-
set mesh(value: ModelMesh);
|
|
31
|
+
get mesh(): ModelMesh | null;
|
|
32
|
+
set mesh(value: ModelMesh | null);
|
|
34
33
|
/**
|
|
35
34
|
* {@inheritDoc ColliderShape.getClosestPoint}
|
|
36
35
|
*/
|
|
37
36
|
getClosestPoint(point: Vector3, outClosestPoint: Vector3): number;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
_destroy(): void;
|
|
41
|
+
protected _cloneNativeShape(target: MeshColliderShape): void;
|
|
42
|
+
private _getMeshData;
|
|
41
43
|
private _updateNativeShapeData;
|
|
42
|
-
private _detachFromCollider;
|
|
43
|
-
private _attachToCollider;
|
|
44
44
|
private _createNativeShape;
|
|
45
|
+
private _replaceNativeShape;
|
|
45
46
|
}
|
|
@@ -1 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
import { Camera } from "../Camera";
|
|
2
|
+
import { Engine } from "../Engine";
|
|
3
|
+
import { PipelinePass } from "../RenderPipeline/PipelinePass";
|
|
4
|
+
import { RenderContext } from "../RenderPipeline/RenderContext";
|
|
5
|
+
import { Shader } from "../shader";
|
|
6
|
+
import { RenderTarget } from "../texture";
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
* Processing sRGB Conversion and FXAA.
|
|
10
|
+
*/
|
|
11
|
+
export declare class FinalPass extends PipelinePass {
|
|
12
|
+
private _inputRenderTarget;
|
|
13
|
+
private _srgbRenderTarget;
|
|
14
|
+
private _antiAliasingMaterial;
|
|
15
|
+
private _sRGBmaterial;
|
|
16
|
+
constructor(engine: Engine, sRGBShader: Shader, antiAliasingShader: Shader);
|
|
17
|
+
onConfig(camera: Camera, inputRenderTarget: RenderTarget): void;
|
|
18
|
+
onRender(context: RenderContext): void;
|
|
19
|
+
release(): void;
|
|
20
|
+
}
|