@galacean/engine-core 0.9.0-beta.80
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 +24255 -0
- package/dist/main.js.map +1 -0
- package/dist/miniprogram.js +24255 -0
- package/dist/module.js +24138 -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/assembler/TiledSpriteAssembler.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 +53 -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/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/SpriteTileMode.d.ts +11 -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/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/AnimatorTransition.d.ts +14 -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/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/AnimatorStateData.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/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 +95 -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/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/Collision.d.ts +4 -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 +58 -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/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/SkyProceduralMaterial.d.ts +72 -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,235 @@
|
|
|
1
|
+
import { Vector3, Color } from "@galacean/engine-math";
|
|
2
|
+
import { Texture } from "../texture";
|
|
3
|
+
import { MeshRenderer } from "../mesh/MeshRenderer";
|
|
4
|
+
/**
|
|
5
|
+
* Blend mode enums of the particle renderer's material.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum ParticleRendererBlendMode {
|
|
8
|
+
Transparent = 0,
|
|
9
|
+
Additive = 1
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Particle Renderer Component.
|
|
13
|
+
*/
|
|
14
|
+
export declare class ParticleRenderer extends MeshRenderer {
|
|
15
|
+
/** The max number of indices that Uint16Array can support. */
|
|
16
|
+
private static _uint16VertexLimit;
|
|
17
|
+
private static _getRandom;
|
|
18
|
+
private _vertexStride;
|
|
19
|
+
private _vertices;
|
|
20
|
+
private _vertexBuffer;
|
|
21
|
+
private _maxCount;
|
|
22
|
+
private _position;
|
|
23
|
+
private _positionRandomness;
|
|
24
|
+
private _positionArray;
|
|
25
|
+
private _velocity;
|
|
26
|
+
private _velocityRandomness;
|
|
27
|
+
private _acceleration;
|
|
28
|
+
private _accelerationRandomness;
|
|
29
|
+
private _color;
|
|
30
|
+
private _colorRandomness;
|
|
31
|
+
private _size;
|
|
32
|
+
private _sizeRandomness;
|
|
33
|
+
private _alpha;
|
|
34
|
+
private _alphaRandomness;
|
|
35
|
+
private _startAngle;
|
|
36
|
+
private _startAngleRandomness;
|
|
37
|
+
private _rotateVelocity;
|
|
38
|
+
private _rotateVelocityRandomness;
|
|
39
|
+
private _lifetime;
|
|
40
|
+
private _startTimeRandomness;
|
|
41
|
+
private _scale;
|
|
42
|
+
private _isOnce;
|
|
43
|
+
private _onceTime;
|
|
44
|
+
private _time;
|
|
45
|
+
private _isInit;
|
|
46
|
+
private _isStart;
|
|
47
|
+
private _updateDirtyFlag;
|
|
48
|
+
private _isRotateToVelocity;
|
|
49
|
+
private _isUseOriginColor;
|
|
50
|
+
private _isScaleByLifetime;
|
|
51
|
+
private _is2d;
|
|
52
|
+
private _isFadeIn;
|
|
53
|
+
private _isFadeOut;
|
|
54
|
+
private _playOnEnable;
|
|
55
|
+
private _blendMode;
|
|
56
|
+
/**
|
|
57
|
+
* Sprite sheet of texture.
|
|
58
|
+
*/
|
|
59
|
+
spriteSheet: {
|
|
60
|
+
x: number;
|
|
61
|
+
y: number;
|
|
62
|
+
w: number;
|
|
63
|
+
h: number;
|
|
64
|
+
}[];
|
|
65
|
+
/**
|
|
66
|
+
* Texture of particle.
|
|
67
|
+
*/
|
|
68
|
+
get texture(): Texture;
|
|
69
|
+
set texture(texture: Texture);
|
|
70
|
+
/**
|
|
71
|
+
* Position of particles.
|
|
72
|
+
*/
|
|
73
|
+
get position(): Vector3;
|
|
74
|
+
set position(value: Vector3);
|
|
75
|
+
/**
|
|
76
|
+
* Random range of positions.
|
|
77
|
+
*/
|
|
78
|
+
get positionRandomness(): Vector3;
|
|
79
|
+
set positionRandomness(value: Vector3);
|
|
80
|
+
/**
|
|
81
|
+
* Array of fixed positions.
|
|
82
|
+
*/
|
|
83
|
+
get positionArray(): Vector3[];
|
|
84
|
+
set positionArray(value: Vector3[]);
|
|
85
|
+
/**
|
|
86
|
+
* Velocity of particles.
|
|
87
|
+
*/
|
|
88
|
+
get velocity(): Vector3;
|
|
89
|
+
set velocity(value: Vector3);
|
|
90
|
+
/**
|
|
91
|
+
* Random range of velocity.
|
|
92
|
+
*/
|
|
93
|
+
get velocityRandomness(): Vector3;
|
|
94
|
+
set velocityRandomness(value: Vector3);
|
|
95
|
+
/**
|
|
96
|
+
* Acceleration of particles.
|
|
97
|
+
*/
|
|
98
|
+
get acceleration(): Vector3;
|
|
99
|
+
set acceleration(value: Vector3);
|
|
100
|
+
/**
|
|
101
|
+
* Random range of acceleration.
|
|
102
|
+
*/
|
|
103
|
+
get accelerationRandomness(): Vector3;
|
|
104
|
+
set accelerationRandomness(value: Vector3);
|
|
105
|
+
/**
|
|
106
|
+
* Color of particles.
|
|
107
|
+
*/
|
|
108
|
+
get color(): Color;
|
|
109
|
+
set color(value: Color);
|
|
110
|
+
/**
|
|
111
|
+
* Random range of color.
|
|
112
|
+
*/
|
|
113
|
+
get colorRandomness(): number;
|
|
114
|
+
set colorRandomness(value: number);
|
|
115
|
+
/**
|
|
116
|
+
* Size of particles.
|
|
117
|
+
*/
|
|
118
|
+
get size(): number;
|
|
119
|
+
set size(value: number);
|
|
120
|
+
/**
|
|
121
|
+
* Random range of size.
|
|
122
|
+
*/
|
|
123
|
+
get sizeRandomness(): number;
|
|
124
|
+
set sizeRandomness(value: number);
|
|
125
|
+
/**
|
|
126
|
+
* Alpha of particles.
|
|
127
|
+
*/
|
|
128
|
+
get alpha(): number;
|
|
129
|
+
set alpha(value: number);
|
|
130
|
+
/**
|
|
131
|
+
* Random range of alpha.
|
|
132
|
+
*/
|
|
133
|
+
get alphaRandomness(): number;
|
|
134
|
+
set alphaRandomness(value: number);
|
|
135
|
+
/**
|
|
136
|
+
* Angle of particles.
|
|
137
|
+
*/
|
|
138
|
+
get angle(): number;
|
|
139
|
+
set angle(value: number);
|
|
140
|
+
/**
|
|
141
|
+
* Random range of angle.
|
|
142
|
+
*/
|
|
143
|
+
get angleRandomness(): number;
|
|
144
|
+
set angleRandomness(value: number);
|
|
145
|
+
/**
|
|
146
|
+
* Rotate velocity of particles.
|
|
147
|
+
*/
|
|
148
|
+
get rotateVelocity(): number;
|
|
149
|
+
set rotateVelocity(value: number);
|
|
150
|
+
/**
|
|
151
|
+
* Random range of rotate velocity.
|
|
152
|
+
*/
|
|
153
|
+
get rotateVelocityRandomness(): number;
|
|
154
|
+
set rotateVelocityRandomness(value: number);
|
|
155
|
+
/**
|
|
156
|
+
* Lifetime of particles.
|
|
157
|
+
*/
|
|
158
|
+
get lifetime(): number;
|
|
159
|
+
set lifetime(value: number);
|
|
160
|
+
/**
|
|
161
|
+
* Random range of start time.
|
|
162
|
+
*/
|
|
163
|
+
get startTimeRandomness(): number;
|
|
164
|
+
set startTimeRandomness(value: number);
|
|
165
|
+
/**
|
|
166
|
+
* Scale factor of particles.
|
|
167
|
+
*/
|
|
168
|
+
get scale(): number;
|
|
169
|
+
set scale(value: number);
|
|
170
|
+
/**
|
|
171
|
+
* Max count of particles.
|
|
172
|
+
*/
|
|
173
|
+
get maxCount(): number;
|
|
174
|
+
set maxCount(value: number);
|
|
175
|
+
/**
|
|
176
|
+
* Whether play once.
|
|
177
|
+
*/
|
|
178
|
+
get isOnce(): boolean;
|
|
179
|
+
set isOnce(value: boolean);
|
|
180
|
+
/**
|
|
181
|
+
* Whether follow the direction of velocity.
|
|
182
|
+
*/
|
|
183
|
+
get isRotateToVelocity(): boolean;
|
|
184
|
+
set isRotateToVelocity(value: boolean);
|
|
185
|
+
/**
|
|
186
|
+
* Whether use origin color.
|
|
187
|
+
*/
|
|
188
|
+
get isUseOriginColor(): boolean;
|
|
189
|
+
set isUseOriginColor(value: boolean);
|
|
190
|
+
/**
|
|
191
|
+
* Whether scale by lifetime.
|
|
192
|
+
*/
|
|
193
|
+
get isScaleByLifetime(): boolean;
|
|
194
|
+
set isScaleByLifetime(value: boolean);
|
|
195
|
+
/**
|
|
196
|
+
* Whether 2D rendering.
|
|
197
|
+
*/
|
|
198
|
+
get is2d(): boolean;
|
|
199
|
+
set is2d(value: boolean);
|
|
200
|
+
/**
|
|
201
|
+
* Whether fade in.
|
|
202
|
+
*/
|
|
203
|
+
get isFadeIn(): boolean;
|
|
204
|
+
set isFadeIn(value: boolean);
|
|
205
|
+
/**
|
|
206
|
+
* Whether fade out.
|
|
207
|
+
*/
|
|
208
|
+
get isFadeOut(): boolean;
|
|
209
|
+
set isFadeOut(value: boolean);
|
|
210
|
+
/**
|
|
211
|
+
* Whether play on enable.
|
|
212
|
+
*/
|
|
213
|
+
get playOnEnable(): boolean;
|
|
214
|
+
set playOnEnable(value: boolean);
|
|
215
|
+
/**
|
|
216
|
+
* Blend mode of the particle renderer's material.
|
|
217
|
+
*/
|
|
218
|
+
get blendMode(): ParticleRendererBlendMode;
|
|
219
|
+
set blendMode(value: ParticleRendererBlendMode);
|
|
220
|
+
constructor(props: any);
|
|
221
|
+
/**
|
|
222
|
+
* Start emitting.
|
|
223
|
+
*/
|
|
224
|
+
start(): void;
|
|
225
|
+
/**
|
|
226
|
+
* Stop emitting.
|
|
227
|
+
*/
|
|
228
|
+
stop(): void;
|
|
229
|
+
private _createMaterial;
|
|
230
|
+
private _createMesh;
|
|
231
|
+
private _updateBuffer;
|
|
232
|
+
private _updateSingleBuffer;
|
|
233
|
+
private _updateSingleUv;
|
|
234
|
+
private _onColorChanged;
|
|
235
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ParticleRenderer, ParticleRendererBlendMode } from "./ParticleRenderer";
|
|
@@ -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 {};
|