@babylonjs/core 5.46.0 → 5.47.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/Actions/actionManager.js +6 -1
- package/Actions/actionManager.js.map +1 -1
- package/Debug/physicsViewer.js +3 -3
- package/Debug/physicsViewer.js.map +1 -1
- package/DeviceInput/eventFactory.d.ts +1 -1
- package/DeviceInput/eventFactory.js +4 -4
- package/DeviceInput/eventFactory.js.map +1 -1
- package/DeviceInput/webDeviceInputSystem.js +2 -2
- package/DeviceInput/webDeviceInputSystem.js.map +1 -1
- package/Engines/thinEngine.js +2 -2
- package/Engines/thinEngine.js.map +1 -1
- package/Events/pointerEvents.js +1 -1
- package/Events/pointerEvents.js.map +1 -1
- package/Inputs/scene.inputManager.d.ts +4 -3
- package/Inputs/scene.inputManager.js +12 -11
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +1 -3
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/videoTexture.js +1 -1
- package/Materials/Textures/videoTexture.js.map +1 -1
- package/Maths/math.vector.d.ts +21 -0
- package/Maths/math.vector.js +27 -0
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/mesh.js +1 -1
- package/Meshes/mesh.js.map +1 -1
- package/Particles/particleSystemComponent.js +5 -0
- package/Particles/particleSystemComponent.js.map +1 -1
- package/Physics/index.d.ts +1 -0
- package/Physics/index.js +1 -0
- package/Physics/index.js.map +1 -1
- package/Physics/v2/IPhysicsEnginePlugin.d.ts +6 -8
- package/Physics/v2/IPhysicsEnginePlugin.js +1 -0
- package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
- package/Physics/v2/physicsBody.d.ts +10 -1
- package/Physics/v2/physicsBody.js +13 -1
- package/Physics/v2/physicsBody.js.map +1 -1
- package/Physics/v2/physicsConstraint.d.ts +139 -66
- package/Physics/v2/physicsConstraint.js +145 -78
- package/Physics/v2/physicsConstraint.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +9 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.js +3 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +3 -0
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +129 -124
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockSubSurface.js +1 -1
- package/Shaders/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
- package/Shaders/fluidRenderingParticleDepth.fragment.js +5 -1
- package/Shaders/fluidRenderingParticleDepth.fragment.js.map +1 -1
- package/Shaders/fluidRenderingRender.fragment.js +7 -2
- package/Shaders/fluidRenderingRender.fragment.js.map +1 -1
- package/Shaders/geometry.fragment.d.ts +2 -0
- package/Shaders/geometry.fragment.js +5 -1
- package/Shaders/geometry.fragment.js.map +1 -1
- package/Shaders/geometry.vertex.d.ts +2 -0
- package/Shaders/geometry.vertex.js +8 -4
- package/Shaders/geometry.vertex.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,6 @@ import type { Scene } from "../../scene";
|
|
|
2
2
|
import type { Vector3 } from "../../Maths/math.vector";
|
|
3
3
|
import type { IPhysicsEnginePluginV2, ConstraintAxis, PhysicsConstraintParameters, ConstraintAxisLimitMode, ConstraintMotorType } from "./IPhysicsEnginePlugin";
|
|
4
4
|
import { ConstraintType } from "./IPhysicsEnginePlugin";
|
|
5
|
-
import type { PhysicsBody } from "./physicsBody";
|
|
6
5
|
/**
|
|
7
6
|
* This is a holder class for the physics constraint created by the physics plugin
|
|
8
7
|
* It holds a set of functions to control the underlying constraint
|
|
@@ -17,6 +16,8 @@ export declare class PhysicsConstraint {
|
|
|
17
16
|
* The V2 plugin used to create and manage this Physics Body
|
|
18
17
|
*/
|
|
19
18
|
protected _physicsPlugin: IPhysicsEnginePluginV2;
|
|
19
|
+
protected _options: PhysicsConstraintParameters;
|
|
20
|
+
protected _type: ConstraintType;
|
|
20
21
|
/**
|
|
21
22
|
* Constructs a new constraint for the physics constraint.
|
|
22
23
|
* @param type The type of constraint to create.
|
|
@@ -28,176 +29,248 @@ export declare class PhysicsConstraint {
|
|
|
28
29
|
*/
|
|
29
30
|
constructor(type: ConstraintType, options: PhysicsConstraintParameters, scene: Scene);
|
|
30
31
|
/**
|
|
31
|
-
*
|
|
32
|
-
* @param body - The parent body to set.
|
|
32
|
+
* Gets the type of the constraint.
|
|
33
33
|
*
|
|
34
|
-
*
|
|
35
|
-
* This allows the engine to accurately simulate the motion of the body in relation to its parent body.
|
|
36
|
-
* For example, if the parent body is a planet, the engine can accurately simulate the motion of the body in relation to the planet's gravity.
|
|
37
|
-
*/
|
|
38
|
-
setParentBody(body: PhysicsBody): void;
|
|
39
|
-
/**
|
|
40
|
-
* Retrieves the parent body of the current physics constraint.
|
|
34
|
+
* @returns The type of the constraint.
|
|
41
35
|
*
|
|
42
|
-
* @returns The parent body of the current physics constraint, or `undefined` if the
|
|
43
|
-
* current constraint does not have a parent body.
|
|
44
36
|
*/
|
|
45
|
-
|
|
37
|
+
getType(): ConstraintType;
|
|
46
38
|
/**
|
|
47
|
-
*
|
|
39
|
+
* Retrieves the options of the physics constraint.
|
|
48
40
|
*
|
|
49
|
-
* @
|
|
41
|
+
* @returns The physics constraint parameters.
|
|
50
42
|
*
|
|
51
|
-
* This method is useful for setting the child body of the current body in a physics engine.
|
|
52
|
-
* This allows for the creation of complex structures of bodies that interact with each other in a realistic way.
|
|
53
43
|
*/
|
|
54
|
-
|
|
44
|
+
getOptions(): PhysicsConstraintParameters;
|
|
55
45
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* @returns The child body of the current physics constraint, or `undefined` if no
|
|
59
|
-
* child body is present.
|
|
60
|
-
*/
|
|
61
|
-
getChildBody(): PhysicsBody | undefined;
|
|
62
|
-
/**
|
|
63
|
-
*
|
|
64
|
-
* @param pivot +
|
|
65
|
-
* @param axisX
|
|
66
|
-
* @param axisY
|
|
67
|
-
*/
|
|
68
|
-
setAnchorInParent(pivot: Vector3, axisX: Vector3, axisY: Vector3): void;
|
|
69
|
-
/**
|
|
70
|
-
*
|
|
71
|
-
* @param pivot
|
|
72
|
-
* @param axisX
|
|
73
|
-
* @param axisY
|
|
74
|
-
*/
|
|
75
|
-
setAnchorInChild(pivot: Vector3, axisX: Vector3, axisY: Vector3): void;
|
|
76
|
-
/**
|
|
77
|
-
*
|
|
78
|
-
* @param isEnabled
|
|
46
|
+
* Enable/disable the constraint
|
|
47
|
+
* @param isEnabled value for the constraint
|
|
79
48
|
*/
|
|
80
49
|
setEnabled(isEnabled: boolean): void;
|
|
81
50
|
/**
|
|
82
51
|
*
|
|
83
|
-
* @returns
|
|
52
|
+
* @returns true if constraint is enabled
|
|
84
53
|
*/
|
|
85
54
|
getEnabled(): boolean;
|
|
86
55
|
/**
|
|
56
|
+
* Enables or disables collisions for the physics engine.
|
|
57
|
+
*
|
|
58
|
+
* @param isEnabled - A boolean value indicating whether collisions should be enabled or disabled.
|
|
87
59
|
*
|
|
88
|
-
* @param isEnabled
|
|
89
60
|
*/
|
|
90
61
|
setCollisionsEnabled(isEnabled: boolean): void;
|
|
91
62
|
/**
|
|
63
|
+
* Gets whether collisions are enabled for this physics object.
|
|
64
|
+
*
|
|
65
|
+
* @returns `true` if collisions are enabled, `false` otherwise.
|
|
92
66
|
*
|
|
93
|
-
* @returns
|
|
94
67
|
*/
|
|
95
68
|
getCollisionsEnabled(): boolean;
|
|
96
69
|
/**
|
|
70
|
+
* Sets the friction of the given axis of the physics engine.
|
|
71
|
+
* @param axis - The axis of the physics engine to set the friction for.
|
|
72
|
+
* @param friction - The friction to set for the given axis.
|
|
97
73
|
*
|
|
98
|
-
* @param axis
|
|
99
|
-
* @param friction
|
|
100
74
|
*/
|
|
101
75
|
setAxisFriction(axis: ConstraintAxis, friction: number): void;
|
|
102
76
|
/**
|
|
77
|
+
* Gets the friction of the given axis of the physics engine.
|
|
78
|
+
* @param axis - The axis of the physics engine.
|
|
79
|
+
* @returns The friction of the given axis.
|
|
103
80
|
*
|
|
104
|
-
* @param axis
|
|
105
|
-
* @returns
|
|
106
81
|
*/
|
|
107
82
|
getAxisFriction(axis: ConstraintAxis): number;
|
|
108
83
|
/**
|
|
84
|
+
* Sets the limit mode for the given axis of the constraint.
|
|
85
|
+
* @param axis The axis to set the limit mode for.
|
|
86
|
+
* @param limitMode The limit mode to set.
|
|
109
87
|
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
88
|
+
* This method is useful for setting the limit mode for a given axis of the constraint. This is important for
|
|
89
|
+
* controlling the behavior of the physics engine when the constraint is reached. By setting the limit mode,
|
|
90
|
+
* the engine can be configured to either stop the motion of the objects, or to allow them to continue
|
|
91
|
+
* moving beyond the constraint.
|
|
112
92
|
*/
|
|
113
93
|
setAxisMode(axis: ConstraintAxis, limitMode: ConstraintAxisLimitMode): void;
|
|
114
94
|
/**
|
|
95
|
+
* Gets the limit mode of the given axis of the constraint.
|
|
96
|
+
*
|
|
97
|
+
* @param axis - The axis of the constraint.
|
|
98
|
+
* @returns The limit mode of the given axis.
|
|
115
99
|
*
|
|
116
|
-
* @param axis
|
|
117
100
|
*/
|
|
118
101
|
getAxisMode(axis: ConstraintAxis): ConstraintAxisLimitMode;
|
|
119
102
|
/**
|
|
103
|
+
* Sets the minimum limit of a given axis of a constraint.
|
|
104
|
+
* @param axis - The axis of the constraint.
|
|
105
|
+
* @param minLimit - The minimum limit of the axis.
|
|
120
106
|
*
|
|
121
107
|
*/
|
|
122
108
|
setAxisMinLimit(axis: ConstraintAxis, minLimit: number): void;
|
|
123
109
|
/**
|
|
110
|
+
* Gets the minimum limit of the given axis of the physics engine.
|
|
111
|
+
* @param axis - The axis of the physics engine.
|
|
112
|
+
* @returns The minimum limit of the given axis.
|
|
124
113
|
*
|
|
125
114
|
*/
|
|
126
115
|
getAxisMinLimit(axis: ConstraintAxis): number;
|
|
127
116
|
/**
|
|
117
|
+
* Sets the maximum limit of the given axis for the physics engine.
|
|
118
|
+
* @param axis - The axis to set the limit for.
|
|
119
|
+
* @param limit - The maximum limit of the axis.
|
|
128
120
|
*
|
|
121
|
+
* This method is useful for setting the maximum limit of the given axis for the physics engine,
|
|
122
|
+
* which can be used to control the movement of the physics object. This helps to ensure that the
|
|
123
|
+
* physics object does not move beyond the given limit.
|
|
129
124
|
*/
|
|
130
125
|
setAxisMaxLimit(axis: ConstraintAxis, limit: number): void;
|
|
131
126
|
/**
|
|
127
|
+
* Gets the maximum limit of the given axis of the physics engine.
|
|
128
|
+
* @param axis - The axis of the physics engine.
|
|
129
|
+
* @returns The maximum limit of the given axis.
|
|
132
130
|
*
|
|
133
131
|
*/
|
|
134
132
|
getAxisMaxLimit(axis: ConstraintAxis): number;
|
|
135
133
|
/**
|
|
134
|
+
* Sets the motor type of the given axis of the constraint.
|
|
135
|
+
* @param axis - The axis of the constraint.
|
|
136
|
+
* @param motorType - The type of motor to use.
|
|
137
|
+
* @returns void
|
|
136
138
|
*
|
|
137
139
|
*/
|
|
138
140
|
setAxisMotorType(axis: ConstraintAxis, motorType: ConstraintMotorType): void;
|
|
139
141
|
/**
|
|
142
|
+
* Gets the motor type of the specified axis of the constraint.
|
|
143
|
+
*
|
|
144
|
+
* @param axis - The axis of the constraint.
|
|
145
|
+
* @returns The motor type of the specified axis.
|
|
140
146
|
*
|
|
141
147
|
*/
|
|
142
148
|
getAxisMotorType(axis: ConstraintAxis): ConstraintMotorType;
|
|
143
149
|
/**
|
|
150
|
+
* Sets the target velocity of the motor associated with the given axis of the constraint.
|
|
151
|
+
* @param axis - The axis of the constraint.
|
|
152
|
+
* @param target - The target velocity of the motor.
|
|
144
153
|
*
|
|
154
|
+
* This method is useful for setting the target velocity of the motor associated with the given axis of the constraint.
|
|
145
155
|
*/
|
|
146
156
|
setAxisMotorTarget(axis: ConstraintAxis, target: number): void;
|
|
147
157
|
/**
|
|
158
|
+
* Gets the target velocity of the motor associated to the given constraint axis.
|
|
159
|
+
* @param axis - The constraint axis associated to the motor.
|
|
160
|
+
* @returns The target velocity of the motor.
|
|
148
161
|
*
|
|
149
162
|
*/
|
|
150
163
|
getAxisMotorTarget(axis: ConstraintAxis): number;
|
|
151
164
|
/**
|
|
165
|
+
* Sets the maximum force of the motor of the given axis of the constraint.
|
|
166
|
+
* @param axis - The axis of the constraint.
|
|
167
|
+
* @param maxForce - The maximum force of the motor.
|
|
152
168
|
*
|
|
153
169
|
*/
|
|
154
170
|
setAxisMotorMaxForce(axis: ConstraintAxis, maxForce: number): void;
|
|
155
171
|
/**
|
|
172
|
+
* Gets the maximum force of the motor of the given axis of the constraint.
|
|
173
|
+
* @param axis - The axis of the constraint.
|
|
174
|
+
* @returns The maximum force of the motor.
|
|
156
175
|
*
|
|
157
176
|
*/
|
|
158
177
|
getAxisMotorMaxForce(axis: ConstraintAxis): number;
|
|
159
178
|
/**
|
|
179
|
+
* Disposes the constraint from the physics engine.
|
|
160
180
|
*
|
|
181
|
+
* This method is useful for cleaning up the physics engine when a body is no longer needed. Disposing the body will free up resources and prevent memory leaks.
|
|
161
182
|
*/
|
|
162
183
|
dispose(): void;
|
|
163
184
|
}
|
|
164
185
|
/**
|
|
186
|
+
* Represents a Ball and Socket Constraint, used to simulate a joint
|
|
165
187
|
*
|
|
188
|
+
* @param pivotA - The first pivot, defined locally in the first body frame
|
|
189
|
+
* @param pivotB - The second pivot, defined locally in the second body frame
|
|
190
|
+
* @param axisA - The axis of the first body
|
|
191
|
+
* @param axisB - The axis of the second body
|
|
192
|
+
* @param scene - The scene the constraint is applied to
|
|
193
|
+
* @returns The Ball and Socket Constraint
|
|
194
|
+
*
|
|
195
|
+
* This class is useful for simulating a joint between two bodies in a physics engine.
|
|
196
|
+
* It allows for the two bodies to move relative to each other in a way that mimics a ball and socket joint, such as a shoulder or hip joint.
|
|
166
197
|
*/
|
|
167
|
-
|
|
168
|
-
export declare class PhysicsConstraintBallAndSocket extends PhysicsConstraint {
|
|
169
|
-
/** @internal */
|
|
198
|
+
export declare class BallAndSocketConstraint extends PhysicsConstraint {
|
|
170
199
|
constructor(pivotA: Vector3, pivotB: Vector3, axisA: Vector3, axisB: Vector3, scene: Scene);
|
|
171
200
|
}
|
|
172
201
|
/**
|
|
202
|
+
* Creates a distance constraint.
|
|
203
|
+
* @param maxDistance distance between bodies
|
|
204
|
+
* @param scene The scene the constraint belongs to
|
|
205
|
+
* @returns DistanceConstraint
|
|
206
|
+
*
|
|
207
|
+
* This code is useful for creating a distance constraint in a physics engine.
|
|
208
|
+
* A distance constraint is a type of constraint that keeps two objects at a certain distance from each other.
|
|
209
|
+
* The scene is used to add the constraint to the physics engine.
|
|
210
|
+
*/
|
|
211
|
+
export declare class DistanceConstraint extends PhysicsConstraint {
|
|
212
|
+
constructor(maxDistance: number, scene: Scene);
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Creates a HingeConstraint, which is a type of PhysicsConstraint.
|
|
216
|
+
*
|
|
217
|
+
* @param pivotA - The first pivot point, in world space.
|
|
218
|
+
* @param pivotB - The second pivot point, in world space.
|
|
219
|
+
* @param scene - The scene the constraint is used in.
|
|
220
|
+
* @returns The new HingeConstraint.
|
|
173
221
|
*
|
|
222
|
+
* This code is useful for creating a HingeConstraint, which is a type of PhysicsConstraint.
|
|
223
|
+
* This constraint is used to simulate a hinge joint between two rigid bodies, allowing them to rotate around a single axis.
|
|
174
224
|
*/
|
|
175
|
-
|
|
176
|
-
export declare class PhysicsConstraintDistance extends PhysicsConstraint {
|
|
177
|
-
/** @internal */
|
|
225
|
+
export declare class HingeConstraint extends PhysicsConstraint {
|
|
178
226
|
constructor(pivotA: Vector3, pivotB: Vector3, axisA: Vector3, axisB: Vector3, scene: Scene);
|
|
179
227
|
}
|
|
180
228
|
/**
|
|
229
|
+
* Creates a SliderConstraint, which is a type of PhysicsConstraint.
|
|
181
230
|
*
|
|
231
|
+
* @param pivotA - The first pivot of the constraint, in world space.
|
|
232
|
+
* @param pivotB - The second pivot of the constraint, in world space.
|
|
233
|
+
* @param axisA - The first axis of the constraint, in world space.
|
|
234
|
+
* @param axisB - The second axis of the constraint, in world space.
|
|
235
|
+
* @param scene - The scene the constraint belongs to.
|
|
236
|
+
* @returns The created SliderConstraint.
|
|
237
|
+
*
|
|
238
|
+
* This code is useful for creating a SliderConstraint, which is a type of PhysicsConstraint.
|
|
239
|
+
* It allows the user to specify the two pivots and two axes of the constraint in world space, as well as the scene the constraint belongs to.
|
|
240
|
+
* This is useful for creating a constraint between two rigid bodies that allows them to move along a certain axis.
|
|
182
241
|
*/
|
|
183
|
-
|
|
184
|
-
export declare class PhysicsConstraintHinge extends PhysicsConstraint {
|
|
185
|
-
/** @internal */
|
|
242
|
+
export declare class SliderConstraint extends PhysicsConstraint {
|
|
186
243
|
constructor(pivotA: Vector3, pivotB: Vector3, axisA: Vector3, axisB: Vector3, scene: Scene);
|
|
187
244
|
}
|
|
188
245
|
/**
|
|
246
|
+
* Creates a LockConstraint, which is a type of PhysicsConstraint.
|
|
247
|
+
*
|
|
248
|
+
* @param pivotA - The first pivot of the constraint in local space.
|
|
249
|
+
* @param pivotB - The second pivot of the constraint in local space.
|
|
250
|
+
* @param axisA - The first axis of the constraint in local space.
|
|
251
|
+
* @param axisB - The second axis of the constraint in local space.
|
|
252
|
+
* @param scene - The scene the constraint belongs to.
|
|
253
|
+
* @returns The created LockConstraint.
|
|
189
254
|
*
|
|
255
|
+
* This code is useful for creating a LockConstraint, which is a type of PhysicsConstraint.
|
|
256
|
+
* It takes in two pivots and two axes in local space, as well as the scene the constraint belongs to, and creates a LockConstraint.
|
|
190
257
|
*/
|
|
191
|
-
|
|
192
|
-
export declare class PhysicsConstraintSlider extends PhysicsConstraint {
|
|
193
|
-
/** @internal */
|
|
258
|
+
export declare class LockConstraint extends PhysicsConstraint {
|
|
194
259
|
constructor(pivotA: Vector3, pivotB: Vector3, axisA: Vector3, axisB: Vector3, scene: Scene);
|
|
195
260
|
}
|
|
196
261
|
/**
|
|
262
|
+
* Creates a PrismaticConstraint, which is a type of PhysicsConstraint.
|
|
263
|
+
*
|
|
264
|
+
* @param pivotA - The first pivot of the constraint in local space.
|
|
265
|
+
* @param pivotB - The second pivot of the constraint in local space.
|
|
266
|
+
* @param axisA - The first axis of the constraint in local space.
|
|
267
|
+
* @param axisB - The second axis of the constraint in local space.
|
|
268
|
+
* @param scene - The scene the constraint belongs to.
|
|
269
|
+
* @returns The created LockConstraint.
|
|
197
270
|
*
|
|
271
|
+
* This code is useful for creating a PrismaticConstraint, which is a type of PhysicsConstraint.
|
|
272
|
+
* It takes in two pivots and two axes in local space, as well as the scene the constraint belongs to, and creates a PrismaticConstraint.
|
|
198
273
|
*/
|
|
199
|
-
|
|
200
|
-
export declare class PhysicsConstraintLock extends PhysicsConstraint {
|
|
201
|
-
/** @internal */
|
|
274
|
+
export declare class PrismaticConstraint extends PhysicsConstraint {
|
|
202
275
|
constructor(pivotA: Vector3, pivotB: Vector3, axisA: Vector3, axisB: Vector3, scene: Scene);
|
|
203
276
|
}
|