@babylonjs/core 5.35.0 → 5.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Audio/sound.d.ts +5 -0
- package/Audio/sound.js +7 -0
- package/Audio/sound.js.map +1 -1
- package/Debug/physicsViewer.d.ts +4 -3
- package/Debug/physicsViewer.js +2 -2
- package/Debug/physicsViewer.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +15 -15
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/Extensions/engine.renderTargetCube.d.ts +1 -1
- package/Engines/Extensions/engine.renderTargetCube.js.map +1 -1
- package/Engines/Extensions/engine.views.d.ts +4 -0
- package/Engines/Extensions/engine.views.js +61 -42
- package/Engines/Extensions/engine.views.js.map +1 -1
- package/Engines/Native/nativeHardwareTexture.d.ts +14 -0
- package/Engines/Native/nativeHardwareTexture.js +24 -0
- package/Engines/Native/nativeHardwareTexture.js.map +1 -0
- package/Engines/Native/nativeInterfaces.d.ts +22 -15
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/Native/nativePipelineContext.d.ts +252 -0
- package/Engines/Native/nativePipelineContext.js +502 -0
- package/Engines/Native/nativePipelineContext.js.map +1 -0
- package/Engines/Native/nativeRenderTargetWrapper.d.ts +16 -0
- package/Engines/Native/nativeRenderTargetWrapper.js +33 -0
- package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -0
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +3 -3
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTargetCube.js.map +1 -1
- package/Engines/engine.d.ts +1 -0
- package/Engines/engine.js +24 -18
- package/Engines/engine.js.map +1 -1
- package/Engines/nativeEngine.d.ts +18 -17
- package/Engines/nativeEngine.js +100 -598
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.d.ts +1 -1
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/thinEngine.d.ts +1 -1
- package/Engines/thinEngine.js +41 -38
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js.map +1 -1
- package/Gizmos/planeRotationGizmo.js +3 -1
- package/Gizmos/planeRotationGizmo.js.map +1 -1
- package/Inputs/scene.inputManager.js +4 -4
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +3 -3
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.js +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +19 -1
- package/Materials/Node/nodeMaterial.js +30 -0
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildStateSharedData.d.ts +2 -8
- package/Materials/Node/nodeMaterialBuildStateSharedData.js.map +1 -1
- package/Materials/Textures/baseTexture.d.ts +2 -1
- package/Materials/Textures/baseTexture.js +3 -2
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +2 -0
- package/Materials/Textures/internalTexture.js +4 -0
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/mirrorTexture.js +0 -2
- package/Materials/Textures/mirrorTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +53 -3
- package/Materials/Textures/renderTargetTexture.js +25 -25
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/texture.d.ts +2 -0
- package/Materials/Textures/texture.js +35 -7
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/Textures/textureCreationOptions.d.ts +4 -1
- package/Materials/Textures/textureCreationOptions.js.map +1 -1
- package/Materials/material.js +1 -1
- package/Materials/material.js.map +1 -1
- package/Meshes/abstractMesh.d.ts +4 -4
- package/Meshes/abstractMesh.js +4 -4
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +2 -2
- package/Meshes/mesh.js +1 -1
- package/Meshes/mesh.js.map +1 -1
- package/Misc/copyTextureToTexture.d.ts +9 -2
- package/Misc/copyTextureToTexture.js +23 -1
- package/Misc/copyTextureToTexture.js.map +1 -1
- package/Particles/IParticleSystem.d.ts +15 -1
- package/Particles/IParticleSystem.js.map +1 -1
- package/Particles/gpuParticleSystem.d.ts +24 -2
- package/Particles/gpuParticleSystem.js +98 -43
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particleSystem.d.ts +6 -1
- package/Particles/particleSystem.js +7 -2
- package/Particles/particleSystem.js.map +1 -1
- package/Physics/IPhysicsEngine.d.ts +8 -108
- package/Physics/IPhysicsEngine.js.map +1 -1
- package/Physics/Plugins/ammoJSPlugin.d.ts +1 -389
- package/Physics/Plugins/ammoJSPlugin.js +2 -1414
- package/Physics/Plugins/ammoJSPlugin.js.map +1 -1
- package/Physics/Plugins/cannonJSPlugin.d.ts +1 -75
- package/Physics/Plugins/cannonJSPlugin.js +2 -664
- package/Physics/Plugins/cannonJSPlugin.js.map +1 -1
- package/Physics/Plugins/oimoJSPlugin.d.ts +1 -59
- package/Physics/Plugins/oimoJSPlugin.js +2 -432
- package/Physics/Plugins/oimoJSPlugin.js.map +1 -1
- package/Physics/index.d.ts +3 -6
- package/Physics/index.js +3 -6
- package/Physics/index.js.map +1 -1
- package/Physics/physicsEngine.d.ts +1 -135
- package/Physics/physicsEngine.js +2 -221
- package/Physics/physicsEngine.js.map +1 -1
- package/Physics/physicsEngineComponent.d.ts +7 -42
- package/Physics/physicsEngineComponent.js +11 -71
- package/Physics/physicsEngineComponent.js.map +1 -1
- package/Physics/physicsHelper.d.ts +1 -411
- package/Physics/physicsHelper.js +2 -708
- package/Physics/physicsHelper.js.map +1 -1
- package/Physics/physicsImpostor.d.ts +1 -640
- package/Physics/physicsImpostor.js +2 -1004
- package/Physics/physicsImpostor.js.map +1 -1
- package/Physics/physicsJoint.d.ts +1 -275
- package/Physics/physicsJoint.js +2 -222
- package/Physics/physicsJoint.js.map +1 -1
- package/Physics/v1/IPhysicsEnginePlugin.d.ts +73 -0
- package/Physics/v1/IPhysicsEnginePlugin.js +2 -0
- package/Physics/v1/IPhysicsEnginePlugin.js.map +1 -0
- package/Physics/v1/Plugins/ammoJSPlugin.d.ts +401 -0
- package/Physics/v1/Plugins/ammoJSPlugin.js +1431 -0
- package/Physics/v1/Plugins/ammoJSPlugin.js.map +1 -0
- package/Physics/v1/Plugins/cannonJSPlugin.d.ts +87 -0
- package/Physics/v1/Plugins/cannonJSPlugin.js +683 -0
- package/Physics/v1/Plugins/cannonJSPlugin.js.map +1 -0
- package/Physics/{Plugins → v1/Plugins}/index.d.ts +0 -0
- package/Physics/{Plugins → v1/Plugins}/index.js +0 -0
- package/Physics/v1/Plugins/index.js.map +1 -0
- package/Physics/v1/Plugins/oimoJSPlugin.d.ts +71 -0
- package/Physics/v1/Plugins/oimoJSPlugin.js +450 -0
- package/Physics/v1/Plugins/oimoJSPlugin.js.map +1 -0
- package/Physics/v1/index.d.ts +7 -0
- package/Physics/v1/index.js +9 -0
- package/Physics/v1/index.js.map +1 -0
- package/Physics/v1/physicsEngine.d.ts +147 -0
- package/Physics/v1/physicsEngine.js +237 -0
- package/Physics/v1/physicsEngine.js.map +1 -0
- package/Physics/v1/physicsEngineComponent.d.ts +45 -0
- package/Physics/v1/physicsEngineComponent.js +70 -0
- package/Physics/v1/physicsEngineComponent.js.map +1 -0
- package/Physics/v1/physicsHelper.d.ts +411 -0
- package/Physics/v1/physicsHelper.js +709 -0
- package/Physics/v1/physicsHelper.js.map +1 -0
- package/Physics/v1/physicsImpostor.d.ts +636 -0
- package/Physics/v1/physicsImpostor.js +1001 -0
- package/Physics/v1/physicsImpostor.js.map +1 -0
- package/Physics/v1/physicsJoint.d.ts +275 -0
- package/Physics/v1/physicsJoint.js +223 -0
- package/Physics/v1/physicsJoint.js.map +1 -0
- package/Physics/v2/IPhysicsEnginePlugin.d.ts +170 -0
- package/Physics/v2/IPhysicsEnginePlugin.js +47 -0
- package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -0
- package/Physics/v2/Plugins/index.d.ts +0 -0
- package/Physics/v2/Plugins/index.js +2 -0
- package/Physics/v2/Plugins/index.js.map +1 -0
- package/Physics/v2/index.d.ts +6 -0
- package/Physics/v2/index.js +8 -0
- package/Physics/v2/index.js.map +1 -0
- package/Physics/v2/physicsAggregate.d.ts +114 -0
- package/Physics/v2/physicsAggregate.js +46 -0
- package/Physics/v2/physicsAggregate.js.map +1 -0
- package/Physics/v2/physicsBody.d.ts +109 -0
- package/Physics/v2/physicsBody.js +158 -0
- package/Physics/v2/physicsBody.js.map +1 -0
- package/Physics/v2/physicsConstraint.d.ts +184 -0
- package/Physics/v2/physicsConstraint.js +257 -0
- package/Physics/v2/physicsConstraint.js.map +1 -0
- package/Physics/v2/physicsEngine.d.ts +103 -0
- package/Physics/v2/physicsEngine.js +146 -0
- package/Physics/v2/physicsEngine.js.map +1 -0
- package/Physics/v2/physicsEngineComponent.d.ts +31 -0
- package/Physics/v2/physicsEngineComponent.js +50 -0
- package/Physics/v2/physicsEngineComponent.js.map +1 -0
- package/Physics/v2/physicsMaterial.d.ts +45 -0
- package/Physics/v2/physicsMaterial.js +67 -0
- package/Physics/v2/physicsMaterial.js.map +1 -0
- package/Physics/v2/physicsShape.d.ts +182 -0
- package/Physics/v2/physicsShape.js +229 -0
- package/Physics/v2/physicsShape.js.map +1 -0
- package/PostProcesses/postProcess.d.ts +3 -1
- package/PostProcesses/postProcess.js +4 -1
- package/PostProcesses/postProcess.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderer.d.ts +153 -0
- package/Rendering/fluidRenderer/fluidRenderer.js +410 -0
- package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -0
- package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.d.ts +13 -0
- package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js +31 -0
- package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js.map +1 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +81 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.js +180 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -0
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.d.ts +63 -0
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +130 -0
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -0
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.d.ts +64 -0
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +104 -0
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -0
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.d.ts +234 -0
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +690 -0
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -0
- package/Rendering/fluidRenderer/fluidRenderingTextures.d.ts +56 -0
- package/Rendering/fluidRenderer/fluidRenderingTextures.js +261 -0
- package/Rendering/fluidRenderer/fluidRenderingTextures.js.map +1 -0
- package/Rendering/fluidRenderer/index.d.ts +5 -0
- package/Rendering/fluidRenderer/index.js +6 -0
- package/Rendering/fluidRenderer/index.js.map +1 -0
- package/Rendering/index.d.ts +1 -0
- package/Rendering/index.js +2 -0
- package/Rendering/index.js.map +1 -1
- package/Shaders/copyTextureToTexture.fragment.js +4 -1
- package/Shaders/copyTextureToTexture.fragment.js.map +1 -1
- package/Shaders/fluidRenderingBilateralBlur.fragment.d.ts +5 -0
- package/Shaders/fluidRenderingBilateralBlur.fragment.js +9 -0
- package/Shaders/fluidRenderingBilateralBlur.fragment.js.map +1 -0
- package/Shaders/fluidRenderingParticleDepth.fragment.d.ts +5 -0
- package/Shaders/fluidRenderingParticleDepth.fragment.js +17 -0
- package/Shaders/fluidRenderingParticleDepth.fragment.js.map +1 -0
- package/Shaders/fluidRenderingParticleDepth.vertex.d.ts +5 -0
- package/Shaders/fluidRenderingParticleDepth.vertex.js +13 -0
- package/Shaders/fluidRenderingParticleDepth.vertex.js.map +1 -0
- package/Shaders/fluidRenderingParticleDiffuse.fragment.d.ts +5 -0
- package/Shaders/fluidRenderingParticleDiffuse.fragment.js +9 -0
- package/Shaders/fluidRenderingParticleDiffuse.fragment.js.map +1 -0
- package/Shaders/fluidRenderingParticleDiffuse.vertex.d.ts +5 -0
- package/Shaders/fluidRenderingParticleDiffuse.vertex.js +4 -0
- package/Shaders/fluidRenderingParticleDiffuse.vertex.js.map +1 -0
- package/Shaders/fluidRenderingParticleThickness.fragment.d.ts +5 -0
- package/Shaders/fluidRenderingParticleThickness.fragment.js +9 -0
- package/Shaders/fluidRenderingParticleThickness.fragment.js.map +1 -0
- package/Shaders/fluidRenderingParticleThickness.vertex.d.ts +5 -0
- package/Shaders/fluidRenderingParticleThickness.vertex.js +9 -0
- package/Shaders/fluidRenderingParticleThickness.vertex.js.map +1 -0
- package/Shaders/fluidRenderingRender.fragment.d.ts +5 -0
- package/Shaders/fluidRenderingRender.fragment.js +46 -0
- package/Shaders/fluidRenderingRender.fragment.js.map +1 -0
- package/Shaders/fluidRenderingStandardBlur.fragment.d.ts +5 -0
- package/Shaders/fluidRenderingStandardBlur.fragment.js +9 -0
- package/Shaders/fluidRenderingStandardBlur.fragment.js.map +1 -0
- package/XR/features/WebXRControllerPhysics.d.ts +1 -1
- package/XR/features/WebXRControllerPhysics.js +1 -1
- package/XR/features/WebXRControllerPhysics.js.map +1 -1
- package/XR/features/WebXRHandTracking.js +1 -1
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/package.json +1 -1
- package/scene.js +6 -1
- package/scene.js.map +1 -1
- package/sceneComponent.d.ts +3 -0
- package/sceneComponent.js +3 -0
- package/sceneComponent.js.map +1 -1
- package/Physics/Plugins/index.js.map +0 -1
|
@@ -1,68 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Vector3, Quaternion } from "../Maths/math.vector";
|
|
3
|
-
import type { AbstractMesh } from "../Meshes/abstractMesh";
|
|
4
|
-
import type { PhysicsImpostor, IPhysicsEnabledObject } from "./physicsImpostor";
|
|
5
|
-
import type { PhysicsJoint, IMotorEnabledJoint } from "./physicsJoint";
|
|
1
|
+
import type { Vector3 } from "../Maths/math.vector";
|
|
6
2
|
import type { PhysicsRaycastResult } from "./physicsRaycastResult";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
export interface PhysicsImpostorJoint {
|
|
11
|
-
/** Defines the main impostor to which the joint is linked */
|
|
12
|
-
mainImpostor: PhysicsImpostor;
|
|
13
|
-
/** Defines the impostor that is connected to the main impostor using this joint */
|
|
14
|
-
connectedImpostor: PhysicsImpostor;
|
|
15
|
-
/** Defines the joint itself */
|
|
16
|
-
joint: PhysicsJoint;
|
|
17
|
-
}
|
|
18
|
-
/** @internal */
|
|
19
|
-
export interface IPhysicsEnginePlugin {
|
|
20
|
-
world: any;
|
|
21
|
-
name: string;
|
|
22
|
-
setGravity(gravity: Vector3): void;
|
|
23
|
-
setTimeStep(timeStep: number): void;
|
|
24
|
-
getTimeStep(): number;
|
|
25
|
-
executeStep(delta: number, impostors: Array<PhysicsImpostor>): void;
|
|
26
|
-
applyImpulse(impostor: PhysicsImpostor, force: Vector3, contactPoint: Vector3): void;
|
|
27
|
-
applyForce(impostor: PhysicsImpostor, force: Vector3, contactPoint: Vector3): void;
|
|
28
|
-
generatePhysicsBody(impostor: PhysicsImpostor): void;
|
|
29
|
-
removePhysicsBody(impostor: PhysicsImpostor): void;
|
|
30
|
-
generateJoint(joint: PhysicsImpostorJoint): void;
|
|
31
|
-
removeJoint(joint: PhysicsImpostorJoint): void;
|
|
32
|
-
isSupported(): boolean;
|
|
33
|
-
setTransformationFromPhysicsBody(impostor: PhysicsImpostor): void;
|
|
34
|
-
setPhysicsBodyTransformation(impostor: PhysicsImpostor, newPosition: Vector3, newRotation: Quaternion): void;
|
|
35
|
-
setLinearVelocity(impostor: PhysicsImpostor, velocity: Nullable<Vector3>): void;
|
|
36
|
-
setAngularVelocity(impostor: PhysicsImpostor, velocity: Nullable<Vector3>): void;
|
|
37
|
-
getLinearVelocity(impostor: PhysicsImpostor): Nullable<Vector3>;
|
|
38
|
-
getAngularVelocity(impostor: PhysicsImpostor): Nullable<Vector3>;
|
|
39
|
-
setBodyMass(impostor: PhysicsImpostor, mass: number): void;
|
|
40
|
-
getBodyMass(impostor: PhysicsImpostor): number;
|
|
41
|
-
getBodyFriction(impostor: PhysicsImpostor): number;
|
|
42
|
-
setBodyFriction(impostor: PhysicsImpostor, friction: number): void;
|
|
43
|
-
getBodyRestitution(impostor: PhysicsImpostor): number;
|
|
44
|
-
setBodyRestitution(impostor: PhysicsImpostor, restitution: number): void;
|
|
45
|
-
getBodyPressure?(impostor: PhysicsImpostor): number;
|
|
46
|
-
setBodyPressure?(impostor: PhysicsImpostor, pressure: number): void;
|
|
47
|
-
getBodyStiffness?(impostor: PhysicsImpostor): number;
|
|
48
|
-
setBodyStiffness?(impostor: PhysicsImpostor, stiffness: number): void;
|
|
49
|
-
getBodyVelocityIterations?(impostor: PhysicsImpostor): number;
|
|
50
|
-
setBodyVelocityIterations?(impostor: PhysicsImpostor, velocityIterations: number): void;
|
|
51
|
-
getBodyPositionIterations?(impostor: PhysicsImpostor): number;
|
|
52
|
-
setBodyPositionIterations?(impostor: PhysicsImpostor, positionIterations: number): void;
|
|
53
|
-
appendAnchor?(impostor: PhysicsImpostor, otherImpostor: PhysicsImpostor, width: number, height: number, influence: number, noCollisionBetweenLinkedBodies: boolean): void;
|
|
54
|
-
appendHook?(impostor: PhysicsImpostor, otherImpostor: PhysicsImpostor, length: number, influence: number, noCollisionBetweenLinkedBodies: boolean): void;
|
|
55
|
-
sleepBody(impostor: PhysicsImpostor): void;
|
|
56
|
-
wakeUpBody(impostor: PhysicsImpostor): void;
|
|
57
|
-
raycast(from: Vector3, to: Vector3): PhysicsRaycastResult;
|
|
58
|
-
updateDistanceJoint(joint: PhysicsJoint, maxDistance: number, minDistance?: number): void;
|
|
59
|
-
setMotor(joint: IMotorEnabledJoint, speed: number, maxForce?: number, motorIndex?: number): void;
|
|
60
|
-
setLimit(joint: IMotorEnabledJoint, upperLimit: number, lowerLimit?: number, motorIndex?: number): void;
|
|
61
|
-
getRadius(impostor: PhysicsImpostor): number;
|
|
62
|
-
getBoxSizeToRef(impostor: PhysicsImpostor, result: Vector3): void;
|
|
63
|
-
syncMeshWithImpostor(mesh: AbstractMesh, impostor: PhysicsImpostor): void;
|
|
64
|
-
dispose(): void;
|
|
65
|
-
}
|
|
3
|
+
import type { IPhysicsEnginePlugin as IPhysicsEnginePluginV1 } from "./v1/IPhysicsEnginePlugin";
|
|
4
|
+
import type { IPhysicsEnginePlugin as IPhysicsEnginePluginV2 } from "./v2/IPhysicsEnginePlugin";
|
|
66
5
|
/**
|
|
67
6
|
* Interface used to define a physics engine
|
|
68
7
|
* @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
|
|
@@ -72,6 +11,10 @@ export interface IPhysicsEngine {
|
|
|
72
11
|
* Gets the gravity vector used by the simulation
|
|
73
12
|
*/
|
|
74
13
|
gravity: Vector3;
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
getPluginVersion(): number;
|
|
75
18
|
/**
|
|
76
19
|
* Sets the gravity vector used by the simulation
|
|
77
20
|
* @param gravity defines the gravity vector to use
|
|
@@ -111,54 +54,11 @@ export interface IPhysicsEngine {
|
|
|
111
54
|
* @returns the name of the plugin
|
|
112
55
|
*/
|
|
113
56
|
getPhysicsPluginName(): string;
|
|
114
|
-
/**
|
|
115
|
-
* Adding a new impostor for the impostor tracking.
|
|
116
|
-
* This will be done by the impostor itself.
|
|
117
|
-
* @param impostor the impostor to add
|
|
118
|
-
*/
|
|
119
|
-
addImpostor(impostor: PhysicsImpostor): void;
|
|
120
|
-
/**
|
|
121
|
-
* Remove an impostor from the engine.
|
|
122
|
-
* This impostor and its mesh will not longer be updated by the physics engine.
|
|
123
|
-
* @param impostor the impostor to remove
|
|
124
|
-
*/
|
|
125
|
-
removeImpostor(impostor: PhysicsImpostor): void;
|
|
126
|
-
/**
|
|
127
|
-
* Add a joint to the physics engine
|
|
128
|
-
* @param mainImpostor defines the main impostor to which the joint is added.
|
|
129
|
-
* @param connectedImpostor defines the impostor that is connected to the main impostor using this joint
|
|
130
|
-
* @param joint defines the joint that will connect both impostors.
|
|
131
|
-
*/
|
|
132
|
-
addJoint(mainImpostor: PhysicsImpostor, connectedImpostor: PhysicsImpostor, joint: PhysicsJoint): void;
|
|
133
|
-
/**
|
|
134
|
-
* Removes a joint from the simulation
|
|
135
|
-
* @param mainImpostor defines the impostor used with the joint
|
|
136
|
-
* @param connectedImpostor defines the other impostor connected to the main one by the joint
|
|
137
|
-
* @param joint defines the joint to remove
|
|
138
|
-
*/
|
|
139
|
-
removeJoint(mainImpostor: PhysicsImpostor, connectedImpostor: PhysicsImpostor, joint: PhysicsJoint): void;
|
|
140
57
|
/**
|
|
141
58
|
* Gets the current plugin used to run the simulation
|
|
142
59
|
* @returns current plugin
|
|
143
60
|
*/
|
|
144
|
-
getPhysicsPlugin():
|
|
145
|
-
/**
|
|
146
|
-
* Gets the list of physic impostors
|
|
147
|
-
* @returns an array of PhysicsImpostor
|
|
148
|
-
*/
|
|
149
|
-
getImpostors(): Array<PhysicsImpostor>;
|
|
150
|
-
/**
|
|
151
|
-
* Gets the impostor for a physics enabled object
|
|
152
|
-
* @param object defines the object impersonated by the impostor
|
|
153
|
-
* @returns the PhysicsImpostor or null if not found
|
|
154
|
-
*/
|
|
155
|
-
getImpostorForPhysicsObject(object: IPhysicsEnabledObject): Nullable<PhysicsImpostor>;
|
|
156
|
-
/**
|
|
157
|
-
* Gets the impostor for a physics body object
|
|
158
|
-
* @param body defines physics body used by the impostor
|
|
159
|
-
* @returns the PhysicsImpostor or null if not found
|
|
160
|
-
*/
|
|
161
|
-
getImpostorWithPhysicsBody(body: any): Nullable<PhysicsImpostor>;
|
|
61
|
+
getPhysicsPlugin(): IPhysicsEnginePluginV1 | IPhysicsEnginePluginV2 | null;
|
|
162
62
|
/**
|
|
163
63
|
* Does a raycast in the physics world
|
|
164
64
|
* @param from when should the ray start?
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IPhysicsEngine.js","sourceRoot":"","sources":["../../../../lts/core/generated/Physics/IPhysicsEngine.ts"],"names":[],"mappings":"","sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"IPhysicsEngine.js","sourceRoot":"","sources":["../../../../lts/core/generated/Physics/IPhysicsEngine.ts"],"names":[],"mappings":"","sourcesContent":["import type { Vector3 } from \"../Maths/math.vector\";\r\nimport type { PhysicsRaycastResult } from \"./physicsRaycastResult\";\r\nimport type { IPhysicsEnginePlugin as IPhysicsEnginePluginV1 } from \"./v1/IPhysicsEnginePlugin\";\r\nimport type { IPhysicsEnginePlugin as IPhysicsEnginePluginV2 } from \"./v2/IPhysicsEnginePlugin\";\r\n\r\n/**\r\n * Interface used to define a physics engine\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport interface IPhysicsEngine {\r\n /**\r\n * Gets the gravity vector used by the simulation\r\n */\r\n gravity: Vector3;\r\n\r\n /**\r\n *\r\n */\r\n getPluginVersion(): number;\r\n /**\r\n * Sets the gravity vector used by the simulation\r\n * @param gravity defines the gravity vector to use\r\n */\r\n setGravity(gravity: Vector3): void;\r\n\r\n /**\r\n * Set the time step of the physics engine.\r\n * Default is 1/60.\r\n * To slow it down, enter 1/600 for example.\r\n * To speed it up, 1/30\r\n * @param newTimeStep the new timestep to apply to this world.\r\n */\r\n setTimeStep(newTimeStep: number): void;\r\n\r\n /**\r\n * Get the time step of the physics engine.\r\n * @returns the current time step\r\n */\r\n getTimeStep(): number;\r\n\r\n /**\r\n * Set the sub time step of the physics engine.\r\n * Default is 0 meaning there is no sub steps\r\n * To increase physics resolution precision, set a small value (like 1 ms)\r\n * @param subTimeStep defines the new sub timestep used for physics resolution.\r\n */\r\n setSubTimeStep(subTimeStep: number): void;\r\n\r\n /**\r\n * Get the sub time step of the physics engine.\r\n * @returns the current sub time step\r\n */\r\n getSubTimeStep(): number;\r\n\r\n /**\r\n * Release all resources\r\n */\r\n dispose(): void;\r\n\r\n /**\r\n * Gets the name of the current physics plugin\r\n * @returns the name of the plugin\r\n */\r\n getPhysicsPluginName(): string;\r\n\r\n /**\r\n * Gets the current plugin used to run the simulation\r\n * @returns current plugin\r\n */\r\n getPhysicsPlugin(): IPhysicsEnginePluginV1 | IPhysicsEnginePluginV2 | null;\r\n\r\n /**\r\n * Does a raycast in the physics world\r\n * @param from when should the ray start?\r\n * @param to when should the ray end?\r\n * @returns PhysicsRaycastResult\r\n */\r\n raycast(from: Vector3, to: Vector3): PhysicsRaycastResult;\r\n\r\n /**\r\n * Called by the scene. No need to call it.\r\n * @param delta defines the timespan between frames\r\n */\r\n _step(delta: number): void;\r\n}\r\n"]}
|
|
@@ -1,389 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { IPhysicsEnginePlugin, PhysicsImpostorJoint } from "../../Physics/IPhysicsEngine";
|
|
3
|
-
import { PhysicsImpostor } from "../../Physics/physicsImpostor";
|
|
4
|
-
import type { IMotorEnabledJoint } from "../../Physics/physicsJoint";
|
|
5
|
-
import type { Nullable } from "../../types";
|
|
6
|
-
import type { AbstractMesh } from "../../Meshes/abstractMesh";
|
|
7
|
-
import { PhysicsRaycastResult } from "../physicsRaycastResult";
|
|
8
|
-
/**
|
|
9
|
-
* AmmoJS Physics plugin
|
|
10
|
-
* @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
|
|
11
|
-
* @see https://github.com/kripken/ammo.js/
|
|
12
|
-
*/
|
|
13
|
-
export declare class AmmoJSPlugin implements IPhysicsEnginePlugin {
|
|
14
|
-
private _useDeltaForWorldStep;
|
|
15
|
-
/**
|
|
16
|
-
* Reference to the Ammo library
|
|
17
|
-
*/
|
|
18
|
-
bjsAMMO: any;
|
|
19
|
-
/**
|
|
20
|
-
* Created ammoJS world which physics bodies are added to
|
|
21
|
-
*/
|
|
22
|
-
world: any;
|
|
23
|
-
/**
|
|
24
|
-
* Name of the plugin
|
|
25
|
-
*/
|
|
26
|
-
name: string;
|
|
27
|
-
private _timeStep;
|
|
28
|
-
private _fixedTimeStep;
|
|
29
|
-
private _maxSteps;
|
|
30
|
-
private _tmpQuaternion;
|
|
31
|
-
private _tmpAmmoTransform;
|
|
32
|
-
private _tmpAmmoQuaternion;
|
|
33
|
-
private _tmpAmmoConcreteContactResultCallback;
|
|
34
|
-
private _collisionConfiguration;
|
|
35
|
-
private _dispatcher;
|
|
36
|
-
private _overlappingPairCache;
|
|
37
|
-
private _solver;
|
|
38
|
-
private _softBodySolver;
|
|
39
|
-
private _tmpAmmoVectorA;
|
|
40
|
-
private _tmpAmmoVectorB;
|
|
41
|
-
private _tmpAmmoVectorC;
|
|
42
|
-
private _tmpAmmoVectorD;
|
|
43
|
-
private _tmpContactCallbackResult;
|
|
44
|
-
private _tmpAmmoVectorRCA;
|
|
45
|
-
private _tmpAmmoVectorRCB;
|
|
46
|
-
private _raycastResult;
|
|
47
|
-
private _tmpContactPoint;
|
|
48
|
-
private _tmpContactNormal;
|
|
49
|
-
private _tmpContactDistance;
|
|
50
|
-
private _tmpContactImpulse;
|
|
51
|
-
private _tmpVec3;
|
|
52
|
-
private static readonly _DISABLE_COLLISION_FLAG;
|
|
53
|
-
private static readonly _KINEMATIC_FLAG;
|
|
54
|
-
private static readonly _DISABLE_DEACTIVATION_FLAG;
|
|
55
|
-
/**
|
|
56
|
-
* Initializes the ammoJS plugin
|
|
57
|
-
* @param _useDeltaForWorldStep if the time between frames should be used when calculating physics steps (Default: true)
|
|
58
|
-
* @param ammoInjection can be used to inject your own ammo reference
|
|
59
|
-
* @param overlappingPairCache can be used to specify your own overlapping pair cache
|
|
60
|
-
*/
|
|
61
|
-
constructor(_useDeltaForWorldStep?: boolean, ammoInjection?: any, overlappingPairCache?: any);
|
|
62
|
-
/**
|
|
63
|
-
* Sets the gravity of the physics world (m/(s^2))
|
|
64
|
-
* @param gravity Gravity to set
|
|
65
|
-
*/
|
|
66
|
-
setGravity(gravity: Vector3): void;
|
|
67
|
-
/**
|
|
68
|
-
* Amount of time to step forward on each frame (only used if useDeltaForWorldStep is false in the constructor)
|
|
69
|
-
* @param timeStep timestep to use in seconds
|
|
70
|
-
*/
|
|
71
|
-
setTimeStep(timeStep: number): void;
|
|
72
|
-
/**
|
|
73
|
-
* Increment to step forward in the physics engine (If timeStep is set to 1/60 and fixedTimeStep is set to 1/120 the physics engine should run 2 steps per frame) (Default: 1/60)
|
|
74
|
-
* @param fixedTimeStep fixedTimeStep to use in seconds
|
|
75
|
-
*/
|
|
76
|
-
setFixedTimeStep(fixedTimeStep: number): void;
|
|
77
|
-
/**
|
|
78
|
-
* Sets the maximum number of steps by the physics engine per frame (Default: 5)
|
|
79
|
-
* @param maxSteps the maximum number of steps by the physics engine per frame
|
|
80
|
-
*/
|
|
81
|
-
setMaxSteps(maxSteps: number): void;
|
|
82
|
-
/**
|
|
83
|
-
* Gets the current timestep (only used if useDeltaForWorldStep is false in the constructor)
|
|
84
|
-
* @returns the current timestep in seconds
|
|
85
|
-
*/
|
|
86
|
-
getTimeStep(): number;
|
|
87
|
-
/**
|
|
88
|
-
* The create custom shape handler function to be called when using BABYLON.PhysicsImposter.CustomImpostor
|
|
89
|
-
*/
|
|
90
|
-
onCreateCustomShape: (impostor: PhysicsImpostor) => any;
|
|
91
|
-
/**
|
|
92
|
-
* The create custom mesh impostor handler function to support building custom mesh impostor vertex data
|
|
93
|
-
*/
|
|
94
|
-
onCreateCustomMeshImpostor: (impostor: PhysicsImpostor) => any;
|
|
95
|
-
/**
|
|
96
|
-
* The create custom convex hull impostor handler function to support building custom convex hull impostor vertex data
|
|
97
|
-
*/
|
|
98
|
-
onCreateCustomConvexHullImpostor: (impostor: PhysicsImpostor) => any;
|
|
99
|
-
private _isImpostorInContact;
|
|
100
|
-
private _isImpostorPairInContact;
|
|
101
|
-
private _stepSimulation;
|
|
102
|
-
/**
|
|
103
|
-
* Moves the physics simulation forward delta seconds and updates the given physics imposters
|
|
104
|
-
* Prior to the step the imposters physics location is set to the position of the babylon meshes
|
|
105
|
-
* After the step the babylon meshes are set to the position of the physics imposters
|
|
106
|
-
* @param delta amount of time to step forward
|
|
107
|
-
* @param impostors array of imposters to update before/after the step
|
|
108
|
-
*/
|
|
109
|
-
executeStep(delta: number, impostors: Array<PhysicsImpostor>): void;
|
|
110
|
-
/**
|
|
111
|
-
* Update babylon mesh to match physics world object
|
|
112
|
-
* @param impostor imposter to match
|
|
113
|
-
*/
|
|
114
|
-
private _afterSoftStep;
|
|
115
|
-
/**
|
|
116
|
-
* Update babylon mesh vertices vertices to match physics world softbody or cloth
|
|
117
|
-
* @param impostor imposter to match
|
|
118
|
-
*/
|
|
119
|
-
private _ropeStep;
|
|
120
|
-
/**
|
|
121
|
-
* Update babylon mesh vertices vertices to match physics world softbody or cloth
|
|
122
|
-
* @param impostor imposter to match
|
|
123
|
-
*/
|
|
124
|
-
private _softbodyOrClothStep;
|
|
125
|
-
private _tmpMatrix;
|
|
126
|
-
/**
|
|
127
|
-
* Applies an impulse on the imposter
|
|
128
|
-
* @param impostor imposter to apply impulse to
|
|
129
|
-
* @param force amount of force to be applied to the imposter
|
|
130
|
-
* @param contactPoint the location to apply the impulse on the imposter
|
|
131
|
-
*/
|
|
132
|
-
applyImpulse(impostor: PhysicsImpostor, force: Vector3, contactPoint: Vector3): void;
|
|
133
|
-
/**
|
|
134
|
-
* Applies a force on the imposter
|
|
135
|
-
* @param impostor imposter to apply force
|
|
136
|
-
* @param force amount of force to be applied to the imposter
|
|
137
|
-
* @param contactPoint the location to apply the force on the imposter
|
|
138
|
-
*/
|
|
139
|
-
applyForce(impostor: PhysicsImpostor, force: Vector3, contactPoint: Vector3): void;
|
|
140
|
-
/**
|
|
141
|
-
* Creates a physics body using the plugin
|
|
142
|
-
* @param impostor the imposter to create the physics body on
|
|
143
|
-
*/
|
|
144
|
-
generatePhysicsBody(impostor: PhysicsImpostor): void;
|
|
145
|
-
/**
|
|
146
|
-
* Removes the physics body from the imposter and disposes of the body's memory
|
|
147
|
-
* @param impostor imposter to remove the physics body from
|
|
148
|
-
*/
|
|
149
|
-
removePhysicsBody(impostor: PhysicsImpostor): void;
|
|
150
|
-
/**
|
|
151
|
-
* Generates a joint
|
|
152
|
-
* @param impostorJoint the imposter joint to create the joint with
|
|
153
|
-
*/
|
|
154
|
-
generateJoint(impostorJoint: PhysicsImpostorJoint): void;
|
|
155
|
-
/**
|
|
156
|
-
* Removes a joint
|
|
157
|
-
* @param impostorJoint the imposter joint to remove the joint from
|
|
158
|
-
*/
|
|
159
|
-
removeJoint(impostorJoint: PhysicsImpostorJoint): void;
|
|
160
|
-
private _addMeshVerts;
|
|
161
|
-
/**
|
|
162
|
-
* Initialise the soft body vertices to match its object's (mesh) vertices
|
|
163
|
-
* Softbody vertices (nodes) are in world space and to match this
|
|
164
|
-
* The object's position and rotation is set to zero and so its vertices are also then set in world space
|
|
165
|
-
* @param impostor to create the softbody for
|
|
166
|
-
*/
|
|
167
|
-
private _softVertexData;
|
|
168
|
-
/**
|
|
169
|
-
* Create an impostor's soft body
|
|
170
|
-
* @param impostor to create the softbody for
|
|
171
|
-
*/
|
|
172
|
-
private _createSoftbody;
|
|
173
|
-
/**
|
|
174
|
-
* Create cloth for an impostor
|
|
175
|
-
* @param impostor to create the softbody for
|
|
176
|
-
*/
|
|
177
|
-
private _createCloth;
|
|
178
|
-
/**
|
|
179
|
-
* Create rope for an impostor
|
|
180
|
-
* @param impostor to create the softbody for
|
|
181
|
-
*/
|
|
182
|
-
private _createRope;
|
|
183
|
-
/**
|
|
184
|
-
* Create a custom physics impostor shape using the plugin's onCreateCustomShape handler
|
|
185
|
-
* @param impostor to create the custom physics shape for
|
|
186
|
-
*/
|
|
187
|
-
private _createCustom;
|
|
188
|
-
private _addHullVerts;
|
|
189
|
-
private _createShape;
|
|
190
|
-
/**
|
|
191
|
-
* Sets the mesh body position/rotation from the babylon impostor
|
|
192
|
-
* @param impostor imposter containing the physics body and babylon object
|
|
193
|
-
*/
|
|
194
|
-
setTransformationFromPhysicsBody(impostor: PhysicsImpostor): void;
|
|
195
|
-
/**
|
|
196
|
-
* Sets the babylon object's position/rotation from the physics body's position/rotation
|
|
197
|
-
* @param impostor imposter containing the physics body and babylon object
|
|
198
|
-
* @param newPosition new position
|
|
199
|
-
* @param newRotation new rotation
|
|
200
|
-
*/
|
|
201
|
-
setPhysicsBodyTransformation(impostor: PhysicsImpostor, newPosition: Vector3, newRotation: Quaternion): void;
|
|
202
|
-
/**
|
|
203
|
-
* If this plugin is supported
|
|
204
|
-
* @returns true if its supported
|
|
205
|
-
*/
|
|
206
|
-
isSupported(): boolean;
|
|
207
|
-
/**
|
|
208
|
-
* Sets the linear velocity of the physics body
|
|
209
|
-
* @param impostor imposter to set the velocity on
|
|
210
|
-
* @param velocity velocity to set
|
|
211
|
-
*/
|
|
212
|
-
setLinearVelocity(impostor: PhysicsImpostor, velocity: Vector3): void;
|
|
213
|
-
/**
|
|
214
|
-
* Sets the angular velocity of the physics body
|
|
215
|
-
* @param impostor imposter to set the velocity on
|
|
216
|
-
* @param velocity velocity to set
|
|
217
|
-
*/
|
|
218
|
-
setAngularVelocity(impostor: PhysicsImpostor, velocity: Vector3): void;
|
|
219
|
-
/**
|
|
220
|
-
* gets the linear velocity
|
|
221
|
-
* @param impostor imposter to get linear velocity from
|
|
222
|
-
* @returns linear velocity
|
|
223
|
-
*/
|
|
224
|
-
getLinearVelocity(impostor: PhysicsImpostor): Nullable<Vector3>;
|
|
225
|
-
/**
|
|
226
|
-
* gets the angular velocity
|
|
227
|
-
* @param impostor imposter to get angular velocity from
|
|
228
|
-
* @returns angular velocity
|
|
229
|
-
*/
|
|
230
|
-
getAngularVelocity(impostor: PhysicsImpostor): Nullable<Vector3>;
|
|
231
|
-
/**
|
|
232
|
-
* Sets the mass of physics body
|
|
233
|
-
* @param impostor imposter to set the mass on
|
|
234
|
-
* @param mass mass to set
|
|
235
|
-
*/
|
|
236
|
-
setBodyMass(impostor: PhysicsImpostor, mass: number): void;
|
|
237
|
-
/**
|
|
238
|
-
* Gets the mass of the physics body
|
|
239
|
-
* @param impostor imposter to get the mass from
|
|
240
|
-
* @returns mass
|
|
241
|
-
*/
|
|
242
|
-
getBodyMass(impostor: PhysicsImpostor): number;
|
|
243
|
-
/**
|
|
244
|
-
* Gets friction of the impostor
|
|
245
|
-
* @param impostor impostor to get friction from
|
|
246
|
-
* @returns friction value
|
|
247
|
-
*/
|
|
248
|
-
getBodyFriction(impostor: PhysicsImpostor): number;
|
|
249
|
-
/**
|
|
250
|
-
* Sets friction of the impostor
|
|
251
|
-
* @param impostor impostor to set friction on
|
|
252
|
-
* @param friction friction value
|
|
253
|
-
*/
|
|
254
|
-
setBodyFriction(impostor: PhysicsImpostor, friction: number): void;
|
|
255
|
-
/**
|
|
256
|
-
* Gets restitution of the impostor
|
|
257
|
-
* @param impostor impostor to get restitution from
|
|
258
|
-
* @returns restitution value
|
|
259
|
-
*/
|
|
260
|
-
getBodyRestitution(impostor: PhysicsImpostor): number;
|
|
261
|
-
/**
|
|
262
|
-
* Sets restitution of the impostor
|
|
263
|
-
* @param impostor impostor to set resitution on
|
|
264
|
-
* @param restitution resitution value
|
|
265
|
-
*/
|
|
266
|
-
setBodyRestitution(impostor: PhysicsImpostor, restitution: number): void;
|
|
267
|
-
/**
|
|
268
|
-
* Gets pressure inside the impostor
|
|
269
|
-
* @param impostor impostor to get pressure from
|
|
270
|
-
* @returns pressure value
|
|
271
|
-
*/
|
|
272
|
-
getBodyPressure(impostor: PhysicsImpostor): number;
|
|
273
|
-
/**
|
|
274
|
-
* Sets pressure inside a soft body impostor
|
|
275
|
-
* Cloth and rope must remain 0 pressure
|
|
276
|
-
* @param impostor impostor to set pressure on
|
|
277
|
-
* @param pressure pressure value
|
|
278
|
-
*/
|
|
279
|
-
setBodyPressure(impostor: PhysicsImpostor, pressure: number): void;
|
|
280
|
-
/**
|
|
281
|
-
* Gets stiffness of the impostor
|
|
282
|
-
* @param impostor impostor to get stiffness from
|
|
283
|
-
* @returns pressure value
|
|
284
|
-
*/
|
|
285
|
-
getBodyStiffness(impostor: PhysicsImpostor): number;
|
|
286
|
-
/**
|
|
287
|
-
* Sets stiffness of the impostor
|
|
288
|
-
* @param impostor impostor to set stiffness on
|
|
289
|
-
* @param stiffness stiffness value from 0 to 1
|
|
290
|
-
*/
|
|
291
|
-
setBodyStiffness(impostor: PhysicsImpostor, stiffness: number): void;
|
|
292
|
-
/**
|
|
293
|
-
* Gets velocityIterations of the impostor
|
|
294
|
-
* @param impostor impostor to get velocity iterations from
|
|
295
|
-
* @returns velocityIterations value
|
|
296
|
-
*/
|
|
297
|
-
getBodyVelocityIterations(impostor: PhysicsImpostor): number;
|
|
298
|
-
/**
|
|
299
|
-
* Sets velocityIterations of the impostor
|
|
300
|
-
* @param impostor impostor to set velocity iterations on
|
|
301
|
-
* @param velocityIterations velocityIterations value
|
|
302
|
-
*/
|
|
303
|
-
setBodyVelocityIterations(impostor: PhysicsImpostor, velocityIterations: number): void;
|
|
304
|
-
/**
|
|
305
|
-
* Gets positionIterations of the impostor
|
|
306
|
-
* @param impostor impostor to get position iterations from
|
|
307
|
-
* @returns positionIterations value
|
|
308
|
-
*/
|
|
309
|
-
getBodyPositionIterations(impostor: PhysicsImpostor): number;
|
|
310
|
-
/**
|
|
311
|
-
* Sets positionIterations of the impostor
|
|
312
|
-
* @param impostor impostor to set position on
|
|
313
|
-
* @param positionIterations positionIterations value
|
|
314
|
-
*/
|
|
315
|
-
setBodyPositionIterations(impostor: PhysicsImpostor, positionIterations: number): void;
|
|
316
|
-
/**
|
|
317
|
-
* Append an anchor to a cloth object
|
|
318
|
-
* @param impostor is the cloth impostor to add anchor to
|
|
319
|
-
* @param otherImpostor is the rigid impostor to anchor to
|
|
320
|
-
* @param width ratio across width from 0 to 1
|
|
321
|
-
* @param height ratio up height from 0 to 1
|
|
322
|
-
* @param influence the elasticity between cloth impostor and anchor from 0, very stretchy to 1, little stretch
|
|
323
|
-
* @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false
|
|
324
|
-
*/
|
|
325
|
-
appendAnchor(impostor: PhysicsImpostor, otherImpostor: PhysicsImpostor, width: number, height: number, influence?: number, noCollisionBetweenLinkedBodies?: boolean): void;
|
|
326
|
-
/**
|
|
327
|
-
* Append an hook to a rope object
|
|
328
|
-
* @param impostor is the rope impostor to add hook to
|
|
329
|
-
* @param otherImpostor is the rigid impostor to hook to
|
|
330
|
-
* @param length ratio along the rope from 0 to 1
|
|
331
|
-
* @param influence the elasticity between soft impostor and anchor from 0, very stretchy to 1, little stretch
|
|
332
|
-
* @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false
|
|
333
|
-
*/
|
|
334
|
-
appendHook(impostor: PhysicsImpostor, otherImpostor: PhysicsImpostor, length: number, influence?: number, noCollisionBetweenLinkedBodies?: boolean): void;
|
|
335
|
-
/**
|
|
336
|
-
* Sleeps the physics body and stops it from being active
|
|
337
|
-
* @param impostor impostor to sleep
|
|
338
|
-
*/
|
|
339
|
-
sleepBody(impostor: PhysicsImpostor): void;
|
|
340
|
-
/**
|
|
341
|
-
* Activates the physics body
|
|
342
|
-
* @param impostor impostor to activate
|
|
343
|
-
*/
|
|
344
|
-
wakeUpBody(impostor: PhysicsImpostor): void;
|
|
345
|
-
/**
|
|
346
|
-
* Updates the distance parameters of the joint
|
|
347
|
-
*/
|
|
348
|
-
updateDistanceJoint(): void;
|
|
349
|
-
/**
|
|
350
|
-
* Sets a motor on the joint
|
|
351
|
-
* @param joint joint to set motor on
|
|
352
|
-
* @param speed speed of the motor
|
|
353
|
-
* @param maxForce maximum force of the motor
|
|
354
|
-
*/
|
|
355
|
-
setMotor(joint: IMotorEnabledJoint, speed?: number, maxForce?: number): void;
|
|
356
|
-
/**
|
|
357
|
-
* Sets the motors limit
|
|
358
|
-
*/
|
|
359
|
-
setLimit(): void;
|
|
360
|
-
/**
|
|
361
|
-
* Syncs the position and rotation of a mesh with the impostor
|
|
362
|
-
* @param mesh mesh to sync
|
|
363
|
-
* @param impostor impostor to update the mesh with
|
|
364
|
-
*/
|
|
365
|
-
syncMeshWithImpostor(mesh: AbstractMesh, impostor: PhysicsImpostor): void;
|
|
366
|
-
/**
|
|
367
|
-
* Gets the radius of the impostor
|
|
368
|
-
* @param impostor impostor to get radius from
|
|
369
|
-
* @returns the radius
|
|
370
|
-
*/
|
|
371
|
-
getRadius(impostor: PhysicsImpostor): number;
|
|
372
|
-
/**
|
|
373
|
-
* Gets the box size of the impostor
|
|
374
|
-
* @param impostor impostor to get box size from
|
|
375
|
-
* @param result the resulting box size
|
|
376
|
-
*/
|
|
377
|
-
getBoxSizeToRef(impostor: PhysicsImpostor, result: Vector3): void;
|
|
378
|
-
/**
|
|
379
|
-
* Disposes of the impostor
|
|
380
|
-
*/
|
|
381
|
-
dispose(): void;
|
|
382
|
-
/**
|
|
383
|
-
* Does a raycast in the physics world
|
|
384
|
-
* @param from where should the ray start?
|
|
385
|
-
* @param to where should the ray end?
|
|
386
|
-
* @returns PhysicsRaycastResult
|
|
387
|
-
*/
|
|
388
|
-
raycast(from: Vector3, to: Vector3): PhysicsRaycastResult;
|
|
389
|
-
}
|
|
1
|
+
export * from "../v1/Plugins/ammoJSPlugin";
|