@galacean/engine-core 0.0.0-experimental-animator-additive.1
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/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/main.js +24671 -0
- package/dist/main.js.map +1 -0
- package/dist/miniprogram.js +24671 -0
- package/dist/module.js +24554 -0
- package/dist/module.js.map +1 -0
- package/package.json +26 -0
- package/types/2d/assembler/IAssembler.d.ts +1 -0
- package/types/2d/assembler/SimpleSpriteAssembler.d.ts +1 -0
- package/types/2d/assembler/SlicedSpriteAssembler.d.ts +1 -0
- package/types/2d/atlas/FontAtlas.d.ts +1 -0
- package/types/2d/atlas/SpriteAtlas.d.ts +36 -0
- package/types/2d/atlas/types.d.ts +64 -0
- package/types/2d/data/RenderData2D.d.ts +1 -0
- package/types/2d/data/VertexData2D.d.ts +1 -0
- package/types/2d/enums/FontStyle.d.ts +11 -0
- package/types/2d/enums/SpriteDirtyFlag.d.ts +13 -0
- package/types/2d/enums/SpriteDrawMode.d.ts +9 -0
- package/types/2d/enums/SpriteMaskInteraction.d.ts +11 -0
- package/types/2d/enums/SpriteMaskLayer.d.ts +71 -0
- package/types/2d/enums/SpriteModifyFlags.d.ts +13 -0
- package/types/2d/enums/TextAlignment.d.ts +22 -0
- package/types/2d/enums/TextOverflow.d.ts +9 -0
- package/types/2d/index.d.ts +9 -0
- package/types/2d/sprite/Sprite.d.ts +97 -0
- package/types/2d/sprite/SpriteMask.d.ts +63 -0
- package/types/2d/sprite/SpriteRenderer.d.ts +77 -0
- package/types/2d/sprite/index.d.ts +3 -0
- package/types/2d/text/CharInfo.d.ts +1 -0
- package/types/2d/text/CharRenderData.d.ts +1 -0
- package/types/2d/text/CharRenderDataPool.d.ts +1 -0
- package/types/2d/text/Font.d.ts +26 -0
- package/types/2d/text/SubFont.d.ts +1 -0
- package/types/2d/text/TextRenderer.d.ts +123 -0
- package/types/2d/text/TextUtils.d.ts +1 -0
- package/types/2d/text/index.d.ts +2 -0
- package/types/Background.d.ts +43 -0
- package/types/BoolUpdateFlag.d.ts +12 -0
- package/types/Camera.d.ts +206 -0
- package/types/Canvas.d.ts +9 -0
- package/types/Component.d.ts +32 -0
- package/types/ComponentsDependencies.d.ts +17 -0
- package/types/ComponentsManager.d.ts +46 -0
- package/types/DisorderedArray.d.ts +18 -0
- package/types/Engine.d.ts +140 -0
- package/types/EngineSettings.d.ts +8 -0
- package/types/Entity.d.ts +151 -0
- package/types/Layer.d.ts +73 -0
- package/types/ListenerUpdateFlag.d.ts +12 -0
- package/types/Platform.d.ts +15 -0
- package/types/RenderPipeline/Basic2DBatcher.d.ts +20 -0
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +66 -0
- package/types/RenderPipeline/ClassPool.d.ts +17 -0
- package/types/RenderPipeline/MeshRenderData.d.ts +15 -0
- package/types/RenderPipeline/MeshRenderElement.d.ts +17 -0
- package/types/RenderPipeline/RenderContext.d.ts +1 -0
- package/types/RenderPipeline/RenderData.d.ts +7 -0
- package/types/RenderPipeline/RenderElement.d.ts +11 -0
- package/types/RenderPipeline/RenderPass.d.ts +55 -0
- package/types/RenderPipeline/RenderQueue.d.ts +38 -0
- package/types/RenderPipeline/SpriteBatcher.d.ts +1 -0
- package/types/RenderPipeline/SpriteElement.d.ts +13 -0
- package/types/RenderPipeline/SpriteMaskBatcher.d.ts +10 -0
- package/types/RenderPipeline/SpriteMaskElement.d.ts +10 -0
- package/types/RenderPipeline/SpriteMaskManager.d.ts +1 -0
- package/types/RenderPipeline/SpriteMaskRenderData.d.ts +10 -0
- package/types/RenderPipeline/SpriteRenderData.d.ts +12 -0
- package/types/RenderPipeline/TextRenderData.d.ts +6 -0
- package/types/RenderPipeline/TextRenderElement.d.ts +6 -0
- package/types/RenderPipeline/enums/PipelineStage.d.ts +9 -0
- package/types/RenderPipeline/index.d.ts +4 -0
- package/types/Renderer.d.ts +119 -0
- package/types/Scene.d.ts +142 -0
- package/types/SceneManager.d.ts +28 -0
- package/types/Script.d.ts +118 -0
- package/types/SystemInfo.d.ts +14 -0
- package/types/Transform.d.ts +258 -0
- package/types/UpdateFlag.d.ts +20 -0
- package/types/UpdateFlagManager.d.ts +1 -0
- package/types/Utils.d.ts +3 -0
- package/types/VirtualCamera.d.ts +1 -0
- package/types/animation/AnimationClip.d.ts +58 -0
- package/types/animation/AnimationClipCurveBinding.d.ts +21 -0
- package/types/animation/AnimationEvent.d.ts +11 -0
- package/types/animation/Animator.d.ts +86 -0
- package/types/animation/AnimatorController.d.ts +32 -0
- package/types/animation/AnimatorControllerLayer.d.ts +18 -0
- package/types/animation/AnimatorState.d.ts +60 -0
- package/types/animation/AnimatorStateMachine.d.ts +37 -0
- package/types/animation/AnimatorStatePlayData.d.ts +1 -0
- package/types/animation/AnimatorStateTransition.d.ts +12 -0
- package/types/animation/AnimatorTransition.d.ts +14 -0
- package/types/animation/AnimatorTransitionBase.d.ts +10 -0
- package/types/animation/Keyframe.d.ts +19 -0
- package/types/animation/StateMachineScript.d.ts +32 -0
- package/types/animation/animationCurve/AnimationArrayCurve.d.ts +7 -0
- package/types/animation/animationCurve/AnimationBoolCurve.d.ts +7 -0
- package/types/animation/animationCurve/AnimationColorCurve.d.ts +8 -0
- package/types/animation/animationCurve/AnimationCurve.d.ts +39 -0
- package/types/animation/animationCurve/AnimationFloatArrayCurve.d.ts +12 -0
- package/types/animation/animationCurve/AnimationFloatCurve.d.ts +7 -0
- package/types/animation/animationCurve/AnimationQuaternionCurve.d.ts +8 -0
- package/types/animation/animationCurve/AnimationVector2Curve.d.ts +8 -0
- package/types/animation/animationCurve/AnimationVector3Curve.d.ts +8 -0
- package/types/animation/animationCurve/AnimationVector4Curve.d.ts +8 -0
- package/types/animation/animationCurve/index.d.ts +10 -0
- package/types/animation/animationCurve/interfaces/IAnimationCurveCalculator.d.ts +1 -0
- package/types/animation/enums/AnimatorConditionMode.d.ts +8 -0
- package/types/animation/enums/AnimatorCullingMode.d.ts +9 -0
- package/types/animation/enums/AnimatorLayerBlendingMode.d.ts +4 -0
- package/types/animation/enums/AnimatorStatePlayState.d.ts +1 -0
- package/types/animation/enums/InterpolationType.d.ts +13 -0
- package/types/animation/enums/LayerState.d.ts +13 -0
- package/types/animation/enums/PlayState.d.ts +13 -0
- package/types/animation/enums/StateMachineState.d.ts +13 -0
- package/types/animation/enums/WrapMode.d.ts +9 -0
- package/types/animation/index.d.ts +21 -0
- package/types/animation/internal/AnimationEventHandler.d.ts +1 -0
- package/types/animation/internal/AnimatorLayerData.d.ts +1 -0
- package/types/animation/internal/AnimatorPlayableObject.d.ts +23 -0
- package/types/animation/internal/AnimatorStateData.d.ts +1 -0
- package/types/animation/internal/AnimatorStateInfo.d.ts +1 -0
- package/types/animation/internal/AnimatorStateMachineData.d.ts +1 -0
- package/types/animation/internal/AnimatorStatePlayData.d.ts +1 -0
- package/types/animation/internal/AnimatorTempValue.d.ts +1 -0
- package/types/animation/internal/CrossCurveData.d.ts +1 -0
- package/types/animation/internal/animationCurveOwner/AnimationCurveOwner.d.ts +5 -0
- package/types/animation/internal/animationCurveOwner/Assembler/BlendShapeWeightsAnimationCurveOwnerAssembler.d.ts +1 -0
- package/types/animation/internal/animationCurveOwner/Assembler/IAnimationCurveOwnerAssembler.d.ts +1 -0
- package/types/animation/internal/animationCurveOwner/Assembler/PositionAnimationCurveOwnerAssembler.d.ts +1 -0
- package/types/animation/internal/animationCurveOwner/Assembler/RotationAnimationCurveOwnerAssembler.d.ts +1 -0
- package/types/animation/internal/animationCurveOwner/Assembler/ScaleAnimationCurveOwnerAssembler.d.ts +1 -0
- package/types/animation/internal/animationCurveOwner/Assembler/UniversalAnimationCurveOwnerAssembler.d.ts +1 -0
- package/types/asset/AssetPromise.d.ts +56 -0
- package/types/asset/AssetType.d.ts +52 -0
- package/types/asset/ContentRestorer.d.ts +17 -0
- package/types/asset/GraphicsResource.d.ts +9 -0
- package/types/asset/IRefObject.d.ts +2 -0
- package/types/asset/IReferable.d.ts +2 -0
- package/types/asset/LoadItem.d.ts +33 -0
- package/types/asset/Loader.d.ts +30 -0
- package/types/asset/RefObject.d.ts +27 -0
- package/types/asset/ReferResource.d.ts +27 -0
- package/types/asset/ResourceManager.d.ts +101 -0
- package/types/asset/request.d.ts +25 -0
- package/types/base/Constant.d.ts +110 -0
- package/types/base/EngineObject.d.ts +24 -0
- package/types/base/Event.d.ts +24 -0
- package/types/base/EventDispatcher.d.ts +79 -0
- package/types/base/Logger.d.ts +11 -0
- package/types/base/StaticInterfaceImplement.d.ts +5 -0
- package/types/base/Time.d.ts +41 -0
- package/types/base/Util.d.ts +14 -0
- package/types/base/index.d.ts +7 -0
- package/types/clone/CloneManager.d.ts +31 -0
- package/types/clone/ComponentCloner.d.ts +14 -0
- package/types/clone/enums/CloneMode.d.ts +13 -0
- package/types/enums/BackgroundMode.d.ts +9 -0
- package/types/enums/BackgroundTextureFillMode.d.ts +8 -0
- package/types/enums/CameraClearFlags.d.ts +13 -0
- package/types/enums/ColorSpace.d.ts +9 -0
- package/types/enums/FogMode.d.ts +13 -0
- package/types/env-probe/CubeProbe.d.ts +34 -0
- package/types/env-probe/Probe.d.ts +58 -0
- package/types/env-probe/index.d.ts +2 -0
- package/types/fog/EXP2Fog.d.ts +15 -0
- package/types/fog/Fog.d.ts +14 -0
- package/types/fog/LinearFog.d.ts +22 -0
- package/types/fog/index.d.ts +3 -0
- package/types/graphic/Buffer.d.ts +105 -0
- package/types/graphic/BufferUtil.d.ts +11 -0
- package/types/graphic/IndexBufferBinding.d.ts +21 -0
- package/types/graphic/Mesh.d.ts +70 -0
- package/types/graphic/SubMesh.d.ts +19 -0
- package/types/graphic/VertexBufferBinding.d.ts +20 -0
- package/types/graphic/VertexElement.d.ts +44 -0
- package/types/graphic/enums/BufferBindFlag.d.ts +9 -0
- package/types/graphic/enums/BufferUsage.d.ts +11 -0
- package/types/graphic/enums/IndexFormat.d.ts +11 -0
- package/types/graphic/enums/MeshTopology.d.ts +19 -0
- package/types/graphic/enums/SetDataOptions.d.ts +9 -0
- package/types/graphic/enums/VertexElementFormat.d.ts +37 -0
- package/types/graphic/index.d.ts +13 -0
- package/types/index.d.ts +53 -0
- package/types/input/InputManager.d.ts +67 -0
- package/types/input/enums/Keys.d.ts +398 -0
- package/types/input/enums/PointerButton.d.ts +33 -0
- package/types/input/enums/PointerPhase.d.ts +15 -0
- package/types/input/index.d.ts +5 -0
- package/types/input/interface/IInput.d.ts +18 -0
- package/types/input/keyboard/KeyboardManager.d.ts +1 -0
- package/types/input/pointer/Pointer.d.ts +25 -0
- package/types/input/pointer/PointerManager.d.ts +1 -0
- package/types/input/wheel/WheelManager.d.ts +1 -0
- package/types/lighting/AmbientLight.d.ts +67 -0
- package/types/lighting/DirectLight.d.ts +21 -0
- package/types/lighting/KHR_lights.d.ts +4 -0
- package/types/lighting/Light.d.ts +48 -0
- package/types/lighting/LightManager.d.ts +5 -0
- package/types/lighting/PointLight.d.ts +18 -0
- package/types/lighting/SpotLight.d.ts +36 -0
- package/types/lighting/enums/DiffuseMode.d.ts +13 -0
- package/types/lighting/index.d.ts +6 -0
- package/types/material/BaseMaterial.d.ts +88 -0
- package/types/material/BlinnPhongMaterial.d.ts +71 -0
- package/types/material/Material.d.ts +51 -0
- package/types/material/PBRBaseMaterial.d.ts +101 -0
- package/types/material/PBRMaterial.d.ts +36 -0
- package/types/material/PBRSpecularMaterial.d.ts +38 -0
- package/types/material/UnlitMaterial.d.ts +33 -0
- package/types/material/enums/BlendMode.d.ts +9 -0
- package/types/material/enums/RenderFace.d.ts +11 -0
- package/types/material/enums/TextureCoordinate.d.ts +13 -0
- package/types/material/index.d.ts +10 -0
- package/types/mesh/BlendShape.d.ts +39 -0
- package/types/mesh/BlendShapeFrame.d.ts +22 -0
- package/types/mesh/BlendShapeManager.d.ts +1 -0
- package/types/mesh/BufferMesh.d.ts +59 -0
- package/types/mesh/MeshRenderer.d.ts +30 -0
- package/types/mesh/ModelMesh.d.ts +226 -0
- package/types/mesh/PrimitiveMesh.d.ts +86 -0
- package/types/mesh/PrimitiveMeshRestorer.d.ts +1 -0
- package/types/mesh/Skin.d.ts +16 -0
- package/types/mesh/SkinnedMeshRenderer.d.ts +62 -0
- package/types/mesh/enums/VertexAttribute.d.ts +33 -0
- package/types/mesh/index.d.ts +8 -0
- package/types/particle/ParticleRenderer.d.ts +235 -0
- package/types/particle/index.d.ts +1 -0
- package/types/physics/CharacterController.d.ts +53 -0
- package/types/physics/Collider.d.ts +29 -0
- package/types/physics/DynamicCollider.d.ts +161 -0
- package/types/physics/HitResult.d.ts +15 -0
- package/types/physics/PhysicsManager.d.ts +95 -0
- package/types/physics/PhysicsMaterial.d.ts +37 -0
- package/types/physics/StaticCollider.d.ts +7 -0
- package/types/physics/enums/ColliderShapeUpAxis.d.ts +11 -0
- package/types/physics/enums/ControllerCollisionFlag.d.ts +11 -0
- package/types/physics/enums/ControllerNonWalkableMode.d.ts +9 -0
- package/types/physics/enums/HingeJointFlag.d.ts +1 -0
- package/types/physics/enums/PhysicsMaterialCombineMode.d.ts +13 -0
- package/types/physics/enums/index.d.ts +4 -0
- package/types/physics/index.d.ts +10 -0
- package/types/physics/joint/FixedJoint.d.ts +3 -0
- package/types/physics/joint/HingeJoint.d.ts +57 -0
- package/types/physics/joint/Joint.d.ts +58 -0
- package/types/physics/joint/JointLimits.d.ts +15 -0
- package/types/physics/joint/JointMotor.d.ts +13 -0
- package/types/physics/joint/SpringJoint.d.ts +42 -0
- package/types/physics/joint/index.d.ts +6 -0
- package/types/physics/shape/BoxColliderShape.d.ts +15 -0
- package/types/physics/shape/CapsuleColliderShape.d.ts +26 -0
- package/types/physics/shape/ColliderShape.d.ts +51 -0
- package/types/physics/shape/PlaneColliderShape.d.ts +7 -0
- package/types/physics/shape/SphereColliderShape.d.ts +13 -0
- package/types/physics/shape/index.d.ts +5 -0
- package/types/renderingHardwareInterface/IHardwareRenderer.d.ts +6 -0
- package/types/renderingHardwareInterface/IPlatformBuffer.d.ts +8 -0
- package/types/renderingHardwareInterface/IPlatformRenderTarget.d.ts +20 -0
- package/types/renderingHardwareInterface/IPlatformTexture.d.ts +36 -0
- package/types/renderingHardwareInterface/IPlatformTexture2D.d.ts +37 -0
- package/types/renderingHardwareInterface/IPlatformTexture2DArray.d.ts +40 -0
- package/types/renderingHardwareInterface/IPlatformTextureCube.d.ts +41 -0
- package/types/renderingHardwareInterface/index.d.ts +6 -0
- package/types/shader/Shader.d.ts +72 -0
- package/types/shader/ShaderData.d.ts +350 -0
- package/types/shader/ShaderMacro.d.ts +10 -0
- package/types/shader/ShaderMacroCollection.d.ts +1 -0
- package/types/shader/ShaderPart.d.ts +41 -0
- package/types/shader/ShaderPass.d.ts +9 -0
- package/types/shader/ShaderPool.d.ts +1 -0
- package/types/shader/ShaderProgram.d.ts +1 -0
- package/types/shader/ShaderProgramPool.d.ts +1 -0
- package/types/shader/ShaderProperty.d.ts +13 -0
- package/types/shader/ShaderTagKey.d.ts +16 -0
- package/types/shader/ShaderUniform.d.ts +1 -0
- package/types/shader/ShaderUniformBlock.d.ts +1 -0
- package/types/shader/SubShader.d.ts +19 -0
- package/types/shader/enums/BlendFactor.d.ts +32 -0
- package/types/shader/enums/BlendOperation.d.ts +16 -0
- package/types/shader/enums/ColorWriteMask.d.ts +18 -0
- package/types/shader/enums/CompareFunction.d.ts +22 -0
- package/types/shader/enums/CullMode.d.ts +12 -0
- package/types/shader/enums/RenderQueueType.d.ts +11 -0
- package/types/shader/enums/ShaderDataGroup.d.ts +13 -0
- package/types/shader/enums/ShaderPropertyType.d.ts +27 -0
- package/types/shader/enums/StencilOperation.d.ts +22 -0
- package/types/shader/index.d.ts +12 -0
- package/types/shader/state/BlendState.d.ts +16 -0
- package/types/shader/state/DepthState.d.ts +14 -0
- package/types/shader/state/RasterState.d.ts +13 -0
- package/types/shader/state/RenderState.d.ts +20 -0
- package/types/shader/state/RenderTargetBlendState.d.ts +24 -0
- package/types/shader/state/StencilState.d.ts +34 -0
- package/types/shaderlib/ShaderFactory.d.ts +17 -0
- package/types/shaderlib/ShaderLib.d.ts +57 -0
- package/types/shaderlib/index.d.ts +1 -0
- package/types/shaderlib/pbr/index.d.ts +9 -0
- package/types/shaderlib/shadow/index.d.ts +8 -0
- package/types/shadow/CascadedShadowCasterPass.d.ts +47 -0
- package/types/shadow/ShadowSliceData.d.ts +1 -0
- package/types/shadow/ShadowUtils.d.ts +1 -0
- package/types/shadow/enum/ShadowCascadesMode.d.ts +11 -0
- package/types/shadow/enum/ShadowMode.d.ts +13 -0
- package/types/shadow/enum/ShadowResolution.d.ts +13 -0
- package/types/shadow/enum/ShadowType.d.ts +13 -0
- package/types/shadow/index.d.ts +3 -0
- package/types/sky/Sky.d.ts +14 -0
- package/types/sky/SkyBoxMaterial.d.ts +25 -0
- package/types/sky/index.d.ts +2 -0
- package/types/texture/RenderTarget.d.ts +95 -0
- package/types/texture/Texture.d.ts +77 -0
- package/types/texture/Texture2D.d.ts +68 -0
- package/types/texture/Texture2DArray.d.ts +81 -0
- package/types/texture/TextureCube.d.ts +70 -0
- package/types/texture/enums/RenderBufferDepthFormat.d.ts +21 -0
- package/types/texture/enums/TextureCubeFace.d.ts +17 -0
- package/types/texture/enums/TextureDepthCompareFunction.d.ts +21 -0
- package/types/texture/enums/TextureFilterMode.d.ts +11 -0
- package/types/texture/enums/TextureFormat.d.ts +69 -0
- package/types/texture/enums/TextureWrapMode.d.ts +11 -0
- package/types/texture/index.d.ts +11 -0
- package/types/trail/TrailMaterial.d.ts +5 -0
- package/types/trail/TrailRenderer.d.ts +40 -0
- package/types/trail/index.d.ts +2 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Vector3 } from "@galacean/engine-math";
|
|
2
|
+
import { Collider } from "./Collider";
|
|
3
|
+
import { ControllerNonWalkableMode } from "./enums/ControllerNonWalkableMode";
|
|
4
|
+
import { ColliderShape } from "./shape";
|
|
5
|
+
/**
|
|
6
|
+
* The character controllers.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CharacterController extends Collider {
|
|
9
|
+
private _stepOffset;
|
|
10
|
+
private _nonWalkableMode;
|
|
11
|
+
private _upDirection;
|
|
12
|
+
private _slopeLimit;
|
|
13
|
+
/**
|
|
14
|
+
* The step offset for the controller.
|
|
15
|
+
*/
|
|
16
|
+
get stepOffset(): number;
|
|
17
|
+
set stepOffset(value: number);
|
|
18
|
+
/**
|
|
19
|
+
* The value of the non-walkable mode.
|
|
20
|
+
*/
|
|
21
|
+
get nonWalkableMode(): ControllerNonWalkableMode;
|
|
22
|
+
set nonWalkableMode(value: ControllerNonWalkableMode);
|
|
23
|
+
/**
|
|
24
|
+
* The up direction for the controller.
|
|
25
|
+
*/
|
|
26
|
+
get upDirection(): Vector3;
|
|
27
|
+
set upDirection(value: Vector3);
|
|
28
|
+
/**
|
|
29
|
+
* The slope limit for the controller.
|
|
30
|
+
*/
|
|
31
|
+
get slopeLimit(): number;
|
|
32
|
+
set slopeLimit(value: number);
|
|
33
|
+
/**
|
|
34
|
+
* Moves the character using a "collide-and-slide" algorithm.
|
|
35
|
+
* @param disp - Displacement vector
|
|
36
|
+
* @param minDist - The minimum travelled distance to consider.
|
|
37
|
+
* @param elapsedTime - Time elapsed since last call
|
|
38
|
+
* @return flags - The ControllerCollisionFlag
|
|
39
|
+
*/
|
|
40
|
+
move(disp: Vector3, minDist: number, elapsedTime: number): number;
|
|
41
|
+
/**
|
|
42
|
+
* Add collider shape on this controller.
|
|
43
|
+
* @param shape - Collider shape
|
|
44
|
+
* @override
|
|
45
|
+
*/
|
|
46
|
+
addShape(shape: ColliderShape): void;
|
|
47
|
+
/**
|
|
48
|
+
* Remove all shape attached.
|
|
49
|
+
* @override
|
|
50
|
+
*/
|
|
51
|
+
clearShapes(): void;
|
|
52
|
+
private _setUpDirection;
|
|
53
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BoolUpdateFlag } from "../BoolUpdateFlag";
|
|
2
|
+
import { Component } from "../Component";
|
|
3
|
+
import { ColliderShape } from "./shape/ColliderShape";
|
|
4
|
+
/**
|
|
5
|
+
* Base class for all colliders.
|
|
6
|
+
* @decorator `@dependentComponents(Transform)`
|
|
7
|
+
*/
|
|
8
|
+
export declare class Collider extends Component {
|
|
9
|
+
protected _updateFlag: BoolUpdateFlag;
|
|
10
|
+
protected _shapes: ColliderShape[];
|
|
11
|
+
/**
|
|
12
|
+
* The shapes of this collider.
|
|
13
|
+
*/
|
|
14
|
+
get shapes(): Readonly<ColliderShape[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Add collider shape on this collider.
|
|
17
|
+
* @param shape - Collider shape
|
|
18
|
+
*/
|
|
19
|
+
addShape(shape: ColliderShape): void;
|
|
20
|
+
/**
|
|
21
|
+
* Remove a collider shape.
|
|
22
|
+
* @param shape - The collider shape.
|
|
23
|
+
*/
|
|
24
|
+
removeShape(shape: ColliderShape): void;
|
|
25
|
+
/**
|
|
26
|
+
* Remove all shape attached.
|
|
27
|
+
*/
|
|
28
|
+
clearShapes(): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { Quaternion, Vector3 } from "@galacean/engine-math";
|
|
2
|
+
import { Collider } from "./Collider";
|
|
3
|
+
/**
|
|
4
|
+
* A dynamic collider can act with self-defined movement or physical force.
|
|
5
|
+
*/
|
|
6
|
+
export declare class DynamicCollider extends Collider {
|
|
7
|
+
private _linearDamping;
|
|
8
|
+
private _angularDamping;
|
|
9
|
+
private _linearVelocity;
|
|
10
|
+
private _angularVelocity;
|
|
11
|
+
private _mass;
|
|
12
|
+
private _centerOfMass;
|
|
13
|
+
private _inertiaTensor;
|
|
14
|
+
private _maxAngularVelocity;
|
|
15
|
+
private _maxDepenetrationVelocity;
|
|
16
|
+
private _solverIterations;
|
|
17
|
+
private _isKinematic;
|
|
18
|
+
private _constraints;
|
|
19
|
+
private _collisionDetectionMode;
|
|
20
|
+
private _sleepThreshold;
|
|
21
|
+
/**
|
|
22
|
+
* The linear damping of the dynamic collider.
|
|
23
|
+
*/
|
|
24
|
+
get linearDamping(): number;
|
|
25
|
+
set linearDamping(value: number);
|
|
26
|
+
/**
|
|
27
|
+
* The angular damping of the dynamic collider.
|
|
28
|
+
*/
|
|
29
|
+
get angularDamping(): number;
|
|
30
|
+
set angularDamping(value: number);
|
|
31
|
+
/**
|
|
32
|
+
* The linear velocity vector of the dynamic collider measured in world unit per second.
|
|
33
|
+
*/
|
|
34
|
+
get linearVelocity(): Vector3;
|
|
35
|
+
set linearVelocity(value: Vector3);
|
|
36
|
+
/**
|
|
37
|
+
* The angular velocity vector of the dynamic collider measured in radians per second.
|
|
38
|
+
*/
|
|
39
|
+
get angularVelocity(): Vector3;
|
|
40
|
+
set angularVelocity(value: Vector3);
|
|
41
|
+
/**
|
|
42
|
+
* The mass of the dynamic collider.
|
|
43
|
+
*/
|
|
44
|
+
get mass(): number;
|
|
45
|
+
set mass(value: number);
|
|
46
|
+
/**
|
|
47
|
+
* The center of mass relative to the transform's origin.
|
|
48
|
+
*/
|
|
49
|
+
get centerOfMass(): Vector3;
|
|
50
|
+
set centerOfMass(value: Vector3);
|
|
51
|
+
/**
|
|
52
|
+
* The diagonal inertia tensor of mass relative to the center of mass.
|
|
53
|
+
*/
|
|
54
|
+
get inertiaTensor(): Vector3;
|
|
55
|
+
set inertiaTensor(value: Vector3);
|
|
56
|
+
/**
|
|
57
|
+
* The maximum angular velocity of the collider measured in radians per second. (Default 7) range { 0, infinity }.
|
|
58
|
+
*/
|
|
59
|
+
get maxAngularVelocity(): number;
|
|
60
|
+
set maxAngularVelocity(value: number);
|
|
61
|
+
/**
|
|
62
|
+
* Maximum velocity of a collider when moving out of penetrating state.
|
|
63
|
+
*/
|
|
64
|
+
get maxDepenetrationVelocity(): number;
|
|
65
|
+
set maxDepenetrationVelocity(value: number);
|
|
66
|
+
/**
|
|
67
|
+
* The mass-normalized energy threshold, below which objects start going to sleep.
|
|
68
|
+
*/
|
|
69
|
+
get sleepThreshold(): number;
|
|
70
|
+
set sleepThreshold(value: number);
|
|
71
|
+
/**
|
|
72
|
+
* The solverIterations determines how accurately collider joints and collision contacts are resolved.
|
|
73
|
+
*/
|
|
74
|
+
get solverIterations(): number;
|
|
75
|
+
set solverIterations(value: number);
|
|
76
|
+
/**
|
|
77
|
+
* Controls whether physics affects the dynamic collider.
|
|
78
|
+
*/
|
|
79
|
+
get isKinematic(): boolean;
|
|
80
|
+
set isKinematic(value: boolean);
|
|
81
|
+
/**
|
|
82
|
+
* The particular rigid dynamic lock flag.
|
|
83
|
+
*/
|
|
84
|
+
get constraints(): DynamicColliderConstraints;
|
|
85
|
+
set constraints(value: DynamicColliderConstraints);
|
|
86
|
+
/**
|
|
87
|
+
* The colliders' collision detection mode.
|
|
88
|
+
*/
|
|
89
|
+
get collisionDetectionMode(): CollisionDetectionMode;
|
|
90
|
+
set collisionDetectionMode(value: CollisionDetectionMode);
|
|
91
|
+
/**
|
|
92
|
+
* Apply a force to the DynamicCollider.
|
|
93
|
+
* @param force - The force make the collider move
|
|
94
|
+
*/
|
|
95
|
+
applyForce(force: Vector3): void;
|
|
96
|
+
/**
|
|
97
|
+
* Apply a torque to the DynamicCollider.
|
|
98
|
+
* @param torque - The force make the collider rotate
|
|
99
|
+
*/
|
|
100
|
+
applyTorque(torque: Vector3): void;
|
|
101
|
+
/**
|
|
102
|
+
* Moves kinematically controlled dynamic actors through the game world.
|
|
103
|
+
* @param position - The desired position for the kinematic actor
|
|
104
|
+
*/
|
|
105
|
+
move(position: Vector3): void;
|
|
106
|
+
/**
|
|
107
|
+
* Moves kinematically controlled dynamic actors through the game world.
|
|
108
|
+
* @param rotation - The desired rotation for the kinematic actor
|
|
109
|
+
*/
|
|
110
|
+
move(rotation: Quaternion): void;
|
|
111
|
+
/**
|
|
112
|
+
* Moves kinematically controlled dynamic actors through the game world.
|
|
113
|
+
* @param position - The desired position for the kinematic actor
|
|
114
|
+
* @param rotation - The desired rotation for the kinematic actor
|
|
115
|
+
*/
|
|
116
|
+
move(position: Vector3, rotation: Quaternion): void;
|
|
117
|
+
/**
|
|
118
|
+
* Forces a collider to sleep at least one frame.
|
|
119
|
+
*/
|
|
120
|
+
sleep(): void;
|
|
121
|
+
/**
|
|
122
|
+
* Forces a collider to wake up.
|
|
123
|
+
*/
|
|
124
|
+
wakeUp(): void;
|
|
125
|
+
private _setLinearVelocity;
|
|
126
|
+
private _setAngularVelocity;
|
|
127
|
+
private _setCenterOfMass;
|
|
128
|
+
private _setInertiaTensor;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* The collision detection mode constants.
|
|
132
|
+
*/
|
|
133
|
+
export declare enum CollisionDetectionMode {
|
|
134
|
+
/** Continuous collision detection is off for this dynamic collider. */
|
|
135
|
+
Discrete = 0,
|
|
136
|
+
/** Continuous collision detection is on for colliding with static mesh geometry. */
|
|
137
|
+
Continuous = 1,
|
|
138
|
+
/** Continuous collision detection is on for colliding with static and dynamic geometry. */
|
|
139
|
+
ContinuousDynamic = 2,
|
|
140
|
+
/** Speculative continuous collision detection is on for static and dynamic geometries */
|
|
141
|
+
ContinuousSpeculative = 3
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Use these flags to constrain motion of dynamic collider.
|
|
145
|
+
*/
|
|
146
|
+
export declare enum DynamicColliderConstraints {
|
|
147
|
+
/** Not Freeze. */
|
|
148
|
+
None = 0,
|
|
149
|
+
/** Freeze motion along the X-axis. */
|
|
150
|
+
FreezePositionX = 1,
|
|
151
|
+
/** Freeze motion along the Y-axis. */
|
|
152
|
+
FreezePositionY = 2,
|
|
153
|
+
/** Freeze motion along the Z-axis. */
|
|
154
|
+
FreezePositionZ = 4,
|
|
155
|
+
/** Freeze rotation along the X-axis. */
|
|
156
|
+
FreezeRotationX = 8,
|
|
157
|
+
/** Freeze rotation along the Y-axis. */
|
|
158
|
+
FreezeRotationY = 16,
|
|
159
|
+
/** Freeze rotation along the Z-axis. */
|
|
160
|
+
FreezeRotationZ = 32
|
|
161
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Entity } from "../Entity";
|
|
2
|
+
import { Vector3 } from "@galacean/engine-math";
|
|
3
|
+
/**
|
|
4
|
+
* Structure used to get information back from a raycast or a sweep.
|
|
5
|
+
*/
|
|
6
|
+
export declare class HitResult {
|
|
7
|
+
/** The entity that was hit. */
|
|
8
|
+
entity: Entity;
|
|
9
|
+
/** The distance from the ray's origin to the impact point. */
|
|
10
|
+
distance: number;
|
|
11
|
+
/** The impact point in world space where the ray hit the collider. */
|
|
12
|
+
point: Vector3;
|
|
13
|
+
/** The normal of the surface the ray hit. */
|
|
14
|
+
normal: Vector3;
|
|
15
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { IPhysics } from "@galacean/engine-design";
|
|
2
|
+
import { Ray, Vector3 } from "@galacean/engine-math";
|
|
3
|
+
import { Engine } from "../Engine";
|
|
4
|
+
import { Layer } from "../Layer";
|
|
5
|
+
import { HitResult } from "./HitResult";
|
|
6
|
+
/**
|
|
7
|
+
* A physics manager is a collection of colliders and constraints which can interact.
|
|
8
|
+
*/
|
|
9
|
+
export declare class PhysicsManager {
|
|
10
|
+
private _engine;
|
|
11
|
+
private _restTime;
|
|
12
|
+
private _colliders;
|
|
13
|
+
private _gravity;
|
|
14
|
+
private _nativePhysicsManager;
|
|
15
|
+
private _physicalObjectsMap;
|
|
16
|
+
private _onContactEnter;
|
|
17
|
+
private _onContactExit;
|
|
18
|
+
private _onContactStay;
|
|
19
|
+
private _onTriggerEnter;
|
|
20
|
+
private _onTriggerExit;
|
|
21
|
+
private _onTriggerStay;
|
|
22
|
+
/** The fixed time step in seconds at which physics are performed. */
|
|
23
|
+
fixedTimeStep: number;
|
|
24
|
+
/**
|
|
25
|
+
* The max allowed time step in seconds one frame.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* When the frame rate is low or stutter occurs, the maximum execution time of physics will not exceed this value.
|
|
29
|
+
* So physics will slow down a bit when performance hitch occurs.
|
|
30
|
+
*/
|
|
31
|
+
maxAllowedTimeStep: number;
|
|
32
|
+
/**
|
|
33
|
+
* The gravity of physics scene.
|
|
34
|
+
*/
|
|
35
|
+
get gravity(): Vector3;
|
|
36
|
+
set gravity(value: Vector3);
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated
|
|
39
|
+
* Please use `maxAllowedTimeStep` instead.
|
|
40
|
+
*/
|
|
41
|
+
get maxSumTimeStep(): number;
|
|
42
|
+
set maxSumTimeStep(value: number);
|
|
43
|
+
constructor(engine: Engine);
|
|
44
|
+
/**
|
|
45
|
+
* initialize PhysicsManager.
|
|
46
|
+
* @param physics - Physics Engine
|
|
47
|
+
*/
|
|
48
|
+
initialize(physics: IPhysics): void;
|
|
49
|
+
/**
|
|
50
|
+
* Casts a ray through the Scene and returns the first hit.
|
|
51
|
+
* @param ray - The ray
|
|
52
|
+
* @returns Returns True if the ray intersects with a collider, otherwise false
|
|
53
|
+
*/
|
|
54
|
+
raycast(ray: Ray): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Casts a ray through the Scene and returns the first hit.
|
|
57
|
+
* @param ray - The ray
|
|
58
|
+
* @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
|
|
59
|
+
* @returns Returns True if the ray intersects with a collider, otherwise false
|
|
60
|
+
*/
|
|
61
|
+
raycast(ray: Ray, outHitResult: HitResult): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Casts a ray through the Scene and returns the first hit.
|
|
64
|
+
* @param ray - The ray
|
|
65
|
+
* @param distance - The max distance the ray should check
|
|
66
|
+
* @returns Returns True if the ray intersects with a collider, otherwise false
|
|
67
|
+
*/
|
|
68
|
+
raycast(ray: Ray, distance: number): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Casts a ray through the Scene and returns the first hit.
|
|
71
|
+
* @param ray - The ray
|
|
72
|
+
* @param distance - The max distance the ray should check
|
|
73
|
+
* @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
|
|
74
|
+
* @returns Returns True if the ray intersects with a collider, otherwise false
|
|
75
|
+
*/
|
|
76
|
+
raycast(ray: Ray, distance: number, outHitResult: HitResult): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Casts a ray through the Scene and returns the first hit.
|
|
79
|
+
* @param ray - The ray
|
|
80
|
+
* @param distance - The max distance the ray should check
|
|
81
|
+
* @param layerMask - Layer mask that is used to selectively ignore Colliders when casting
|
|
82
|
+
* @returns Returns True if the ray intersects with a collider, otherwise false
|
|
83
|
+
*/
|
|
84
|
+
raycast(ray: Ray, distance: number, layerMask: Layer): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Casts a ray through the Scene and returns the first hit.
|
|
87
|
+
* @param ray - The ray
|
|
88
|
+
* @param distance - The max distance the ray should check
|
|
89
|
+
* @param layerMask - Layer mask that is used to selectively ignore Colliders when casting
|
|
90
|
+
* @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
|
|
91
|
+
* @returns Returns True if the ray intersects with a collider, otherwise false.
|
|
92
|
+
*/
|
|
93
|
+
raycast(ray: Ray, distance: number, layerMask: Layer, outHitResult: HitResult): boolean;
|
|
94
|
+
private _setGravity;
|
|
95
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { PhysicsMaterialCombineMode } from "./enums/PhysicsMaterialCombineMode";
|
|
2
|
+
/**
|
|
3
|
+
* Material class to represent a set of surface properties.
|
|
4
|
+
*/
|
|
5
|
+
export declare class PhysicsMaterial {
|
|
6
|
+
private _bounciness;
|
|
7
|
+
private _dynamicFriction;
|
|
8
|
+
private _staticFriction;
|
|
9
|
+
private _bounceCombine;
|
|
10
|
+
private _frictionCombine;
|
|
11
|
+
constructor();
|
|
12
|
+
/**
|
|
13
|
+
* The coefficient of bounciness.
|
|
14
|
+
*/
|
|
15
|
+
get bounciness(): number;
|
|
16
|
+
set bounciness(value: number);
|
|
17
|
+
/**
|
|
18
|
+
* The DynamicFriction value.
|
|
19
|
+
*/
|
|
20
|
+
get dynamicFriction(): number;
|
|
21
|
+
set dynamicFriction(value: number);
|
|
22
|
+
/**
|
|
23
|
+
* The coefficient of static friction.
|
|
24
|
+
*/
|
|
25
|
+
get staticFriction(): number;
|
|
26
|
+
set staticFriction(value: number);
|
|
27
|
+
/**
|
|
28
|
+
* The restitution combine mode.
|
|
29
|
+
*/
|
|
30
|
+
get bounceCombine(): PhysicsMaterialCombineMode;
|
|
31
|
+
set bounceCombine(value: PhysicsMaterialCombineMode);
|
|
32
|
+
/**
|
|
33
|
+
* The friction combine mode.
|
|
34
|
+
*/
|
|
35
|
+
get frictionCombine(): PhysicsMaterialCombineMode;
|
|
36
|
+
set frictionCombine(value: PhysicsMaterialCombineMode);
|
|
37
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The up axis of the collider shape.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum ControllerCollisionFlag {
|
|
5
|
+
/** Character is colliding to the sides. */
|
|
6
|
+
Sides = 1,
|
|
7
|
+
/** Character has collision above. */
|
|
8
|
+
Up = 2,
|
|
9
|
+
/** Character has collision below. */
|
|
10
|
+
Down = 4
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The up axis of the collider shape.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum ControllerNonWalkableMode {
|
|
5
|
+
/** Stops character from climbing up non-walkable slopes, but doesn't move it otherwise. */
|
|
6
|
+
PreventClimbing = 0,
|
|
7
|
+
/** Stops character from climbing up non-walkable slopes, and forces it to slide down those slopes. */
|
|
8
|
+
PreventClimbingAndForceSliding = 1
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Describes how physics materials of the colliding objects are combined.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum PhysicsMaterialCombineMode {
|
|
5
|
+
/** Averages the friction/bounce of the two colliding materials. */
|
|
6
|
+
Average = 0,
|
|
7
|
+
/** Uses the smaller friction/bounce of the two colliding materials. */
|
|
8
|
+
Minimum = 1,
|
|
9
|
+
/** Multiplies the friction/bounce of the two colliding materials. */
|
|
10
|
+
Multiply = 2,
|
|
11
|
+
/** Uses the larger friction/bounce of the two colliding materials. */
|
|
12
|
+
Maximum = 3
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { HitResult } from "./HitResult";
|
|
2
|
+
export { PhysicsManager } from "./PhysicsManager";
|
|
3
|
+
export { PhysicsMaterial } from "./PhysicsMaterial";
|
|
4
|
+
export { CharacterController } from "./CharacterController";
|
|
5
|
+
export * from "./shape";
|
|
6
|
+
export * from "./joint";
|
|
7
|
+
export * from "./enums";
|
|
8
|
+
export { Collider } from "./Collider";
|
|
9
|
+
export { StaticCollider } from "./StaticCollider";
|
|
10
|
+
export { DynamicCollider, CollisionDetectionMode, DynamicColliderConstraints } from "./DynamicCollider";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Joint } from "./Joint";
|
|
2
|
+
import { Vector3 } from "@galacean/engine-math";
|
|
3
|
+
import { JointMotor } from "./JointMotor";
|
|
4
|
+
import { JointLimits } from "./JointLimits";
|
|
5
|
+
/**
|
|
6
|
+
* A joint which behaves in a similar way to a hinge or axle.
|
|
7
|
+
*/
|
|
8
|
+
export declare class HingeJoint extends Joint {
|
|
9
|
+
private _axis;
|
|
10
|
+
private _hingeFlags;
|
|
11
|
+
private _useSpring;
|
|
12
|
+
private _jointMonitor;
|
|
13
|
+
private _limits;
|
|
14
|
+
/**
|
|
15
|
+
* The anchor rotation.
|
|
16
|
+
*/
|
|
17
|
+
get axis(): Vector3;
|
|
18
|
+
set axis(value: Vector3);
|
|
19
|
+
/**
|
|
20
|
+
* The swing offset.
|
|
21
|
+
*/
|
|
22
|
+
get swingOffset(): Vector3;
|
|
23
|
+
set swingOffset(value: Vector3);
|
|
24
|
+
/**
|
|
25
|
+
* The current angle in degrees of the joint relative to its rest position.
|
|
26
|
+
*/
|
|
27
|
+
get angle(): number;
|
|
28
|
+
/**
|
|
29
|
+
* The angular velocity of the joint in degrees per second.
|
|
30
|
+
*/
|
|
31
|
+
get velocity(): Readonly<Vector3>;
|
|
32
|
+
/**
|
|
33
|
+
* Enables the joint's limits. Disabled by default.
|
|
34
|
+
*/
|
|
35
|
+
get useLimits(): boolean;
|
|
36
|
+
set useLimits(value: boolean);
|
|
37
|
+
/**
|
|
38
|
+
* Enables the joint's motor. Disabled by default.
|
|
39
|
+
*/
|
|
40
|
+
get useMotor(): boolean;
|
|
41
|
+
set useMotor(value: boolean);
|
|
42
|
+
/**
|
|
43
|
+
* Enables the joint's spring. Disabled by default.
|
|
44
|
+
*/
|
|
45
|
+
get useSpring(): boolean;
|
|
46
|
+
set useSpring(value: boolean);
|
|
47
|
+
/**
|
|
48
|
+
* The motor will apply a force up to a maximum force to achieve the target velocity in degrees per second.
|
|
49
|
+
*/
|
|
50
|
+
get motor(): JointMotor;
|
|
51
|
+
set motor(value: JointMotor);
|
|
52
|
+
/**
|
|
53
|
+
* Limit of angular rotation (in degrees) on the hinge joint.
|
|
54
|
+
*/
|
|
55
|
+
get limits(): JointLimits;
|
|
56
|
+
set limits(value: JointLimits);
|
|
57
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { IJoint } from "@galacean/engine-design";
|
|
2
|
+
import { Vector3 } from "@galacean/engine-math";
|
|
3
|
+
import { Component } from "../../Component";
|
|
4
|
+
import { Collider } from "../Collider";
|
|
5
|
+
import { Entity } from "../../Entity";
|
|
6
|
+
/**
|
|
7
|
+
* A base class providing common functionality for joints.
|
|
8
|
+
* @decorator `@dependentComponents(Collider)`
|
|
9
|
+
*/
|
|
10
|
+
export declare class Joint extends Component {
|
|
11
|
+
protected _connectedCollider: JointCollider;
|
|
12
|
+
protected _collider: JointCollider;
|
|
13
|
+
protected _nativeJoint: IJoint;
|
|
14
|
+
private _force;
|
|
15
|
+
private _torque;
|
|
16
|
+
/**
|
|
17
|
+
* The connected collider.
|
|
18
|
+
*/
|
|
19
|
+
get connectedCollider(): Collider;
|
|
20
|
+
set connectedCollider(value: Collider);
|
|
21
|
+
/**
|
|
22
|
+
* The connected anchor position.
|
|
23
|
+
* @remarks If connectedCollider is set, this anchor is relative offset, or the anchor is world position.
|
|
24
|
+
*/
|
|
25
|
+
get connectedAnchor(): Vector3;
|
|
26
|
+
set connectedAnchor(value: Vector3);
|
|
27
|
+
/**
|
|
28
|
+
* The scale to apply to the inverse mass of collider 0 for resolving this constraint.
|
|
29
|
+
*/
|
|
30
|
+
get connectedMassScale(): number;
|
|
31
|
+
set connectedMassScale(value: number);
|
|
32
|
+
/**
|
|
33
|
+
* The scale to apply to the inverse inertia of collider0 for resolving this constraint.
|
|
34
|
+
*/
|
|
35
|
+
get connectedInertiaScale(): number;
|
|
36
|
+
set connectedInertiaScale(value: number);
|
|
37
|
+
/**
|
|
38
|
+
* The scale to apply to the inverse mass of collider 1 for resolving this constraint.
|
|
39
|
+
*/
|
|
40
|
+
get massScale(): number;
|
|
41
|
+
set massScale(value: number);
|
|
42
|
+
/**
|
|
43
|
+
* The scale to apply to the inverse inertia of collider1 for resolving this constraint.
|
|
44
|
+
*/
|
|
45
|
+
get inertiaScale(): number;
|
|
46
|
+
set inertiaScale(value: number);
|
|
47
|
+
/**
|
|
48
|
+
* The maximum force the joint can apply before breaking.
|
|
49
|
+
*/
|
|
50
|
+
get breakForce(): number;
|
|
51
|
+
set breakForce(value: number);
|
|
52
|
+
/**
|
|
53
|
+
* The maximum torque the joint can apply before breaking.
|
|
54
|
+
*/
|
|
55
|
+
get breakTorque(): number;
|
|
56
|
+
set breakTorque(value: number);
|
|
57
|
+
constructor(entity: Entity);
|
|
58
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JointLimits is used to limit the joints angle.
|
|
3
|
+
*/
|
|
4
|
+
export declare class JointLimits {
|
|
5
|
+
/** The upper angular limit (in degrees) of the joint. */
|
|
6
|
+
max: number;
|
|
7
|
+
/** The lower angular limit (in degrees) of the joint. */
|
|
8
|
+
min: number;
|
|
9
|
+
/** Distance inside the limit value at which the limit will be considered to be active by the solver. */
|
|
10
|
+
contactDistance: number;
|
|
11
|
+
/** The spring forces used to reach the target position. */
|
|
12
|
+
stiffness: number;
|
|
13
|
+
/** The damper force uses to dampen the spring. */
|
|
14
|
+
damping: number;
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The JointMotor is used to motorize a joint.
|
|
3
|
+
*/
|
|
4
|
+
export declare class JointMotor {
|
|
5
|
+
/** The motor will apply a force up to force to achieve targetVelocity. */
|
|
6
|
+
targetVelocity: number;
|
|
7
|
+
/** The force limit.*/
|
|
8
|
+
forceLimit: number;
|
|
9
|
+
/** Gear ration for the motor */
|
|
10
|
+
gearRation: number;
|
|
11
|
+
/** If freeSpin is enabled the motor will only accelerate but never slow down. */
|
|
12
|
+
freeSpin: boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Joint } from "./Joint";
|
|
2
|
+
import { Vector3 } from "@galacean/engine-math";
|
|
3
|
+
/**
|
|
4
|
+
* A joint that maintains an upper or lower bound (or both) on the distance between two points on different objects.
|
|
5
|
+
*/
|
|
6
|
+
export declare class SpringJoint extends Joint {
|
|
7
|
+
private _minDistance;
|
|
8
|
+
private _maxDistance;
|
|
9
|
+
private _tolerance;
|
|
10
|
+
private _stiffness;
|
|
11
|
+
private _damping;
|
|
12
|
+
/**
|
|
13
|
+
* The swing offset.
|
|
14
|
+
*/
|
|
15
|
+
get swingOffset(): Vector3;
|
|
16
|
+
set swingOffset(value: Vector3);
|
|
17
|
+
/**
|
|
18
|
+
* The minimum distance.
|
|
19
|
+
*/
|
|
20
|
+
get minDistance(): number;
|
|
21
|
+
set minDistance(value: number);
|
|
22
|
+
/**
|
|
23
|
+
* The maximum distance.
|
|
24
|
+
*/
|
|
25
|
+
get maxDistance(): number;
|
|
26
|
+
set maxDistance(value: number);
|
|
27
|
+
/**
|
|
28
|
+
* The distance beyond the allowed range at which the joint becomes active.
|
|
29
|
+
*/
|
|
30
|
+
get tolerance(): number;
|
|
31
|
+
set tolerance(value: number);
|
|
32
|
+
/**
|
|
33
|
+
* The spring strength of the joint.
|
|
34
|
+
*/
|
|
35
|
+
get stiffness(): number;
|
|
36
|
+
set stiffness(value: number);
|
|
37
|
+
/**
|
|
38
|
+
* The degree of damping of the joint spring of the joint.
|
|
39
|
+
*/
|
|
40
|
+
get damping(): number;
|
|
41
|
+
set damping(value: number);
|
|
42
|
+
}
|