@absolutejs/rapier3d 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,14 @@ export declare class IntegrationParameters {
7
7
  * Free the WASM memory used by these integration parameters.
8
8
  */
9
9
  free(): void;
10
+ /** Merge compatible contact manifolds into solver clusters. Upstream default: true. */
11
+ get contactClustering(): boolean;
12
+ /** Change between simulation steps; false may increase solver workload. */
13
+ set contactClustering(value: boolean);
14
+ /** Minimum CCD substep duration in seconds; upstream default is 1/60/100. */
15
+ get minCcdDt(): number;
16
+ /** Change between steps. Very small values may introduce numerical instability. */
17
+ set minCcdDt(value: number);
10
18
  /**
11
19
  * The timestep length (default: `1.0 / 60.0`)
12
20
  */
@@ -116,6 +116,17 @@ export declare class TempContactManifold {
116
116
  * the function returns this object instead of creating a new one.
117
117
  */
118
118
  solverContactPoint(i: number, target?: Vector): Vector | null;
119
+ /** Current world-space solver anchor on side 1; includes skin/hook offsets. */
120
+ solverContactPoint1(i: number, target?: Vector): Vector | null;
121
+ /** Current world-space solver anchor on side 2; includes skin/hook offsets. */
122
+ solverContactPoint2(i: number, target?: Vector): Vector | null;
123
+ /**
124
+ * Current anchor separation along the stored solver normal (negative means overlap).
125
+ * This is not a fresh collision query or a bound on unsampled material surfaces.
126
+ * Returns null for an invalid index. Unlike solverContactDist, uses current poses.
127
+ */
128
+ solverContactSeparation(i: number): number | null;
129
+ /** Cached distance at the last contact update; does not track subsequent motion. */
119
130
  solverContactDist(i: number): number;
120
131
  /**
121
132
  * The friction coefficient applied to this manifold's solver contacts. It is combined
@@ -137,4 +148,4 @@ export declare class TempContactManifold {
137
148
  solverContactTangentVelocity(i: number, target?: Vector): Vector;
138
149
  }
139
150
  /** Read-only solver view; geometric subshape and local-surface queries are excluded. */
140
- export type SolverContactManifold = Pick<TempContactManifold, 'normal' | 'numSolverContacts' | 'solverContactPoint' | 'solverContactDist' | 'friction' | 'restitution' | 'solverContactTangentVelocity'>;
151
+ export type SolverContactManifold = Pick<TempContactManifold, 'normal' | 'numSolverContacts' | 'solverContactPoint' | 'solverContactDist' | 'friction' | 'restitution' | 'solverContactTangentVelocity' | 'solverContactPoint1' | 'solverContactPoint2' | 'solverContactSeparation'>;
@@ -365,7 +365,19 @@ export class RawContactManifold {
365
365
  num_solver_contacts(): number;
366
366
  restitution(): number;
367
367
  solver_contact_dist(i: number): number;
368
+ /**
369
+ * Current world-space solver anchor; includes solver skin/hook offsets.
370
+ */
371
+ solver_contact_point1(bodies: RawRigidBodySet, i: number, scratch_buffer: Float32Array): boolean;
372
+ /**
373
+ * Current world-space solver anchor; includes solver skin/hook offsets.
374
+ */
375
+ solver_contact_point2(bodies: RawRigidBodySet, i: number, scratch_buffer: Float32Array): boolean;
368
376
  solver_contact_point(bodies: RawRigidBodySet, i: number, scratch_buffer: Float32Array): boolean;
377
+ /**
378
+ * Current anchor separation along the stored world-space solver normal.
379
+ */
380
+ solver_contact_separation(bodies: RawRigidBodySet, i: number): number | undefined;
369
381
  solver_contact_tangent_velocity(i: number, scratch_buffer: Float32Array): void;
370
382
  subshape1(): number;
371
383
  subshape2(): number;
@@ -693,10 +705,12 @@ export class RawIntegrationParameters {
693
705
  free(): void;
694
706
  [Symbol.dispose](): void;
695
707
  constructor();
708
+ contactClustering: boolean;
696
709
  readonly contact_erp: number;
697
710
  dt: number;
698
711
  lengthUnit: number;
699
712
  maxCcdSubsteps: number;
713
+ minCcdDt: number;
700
714
  normalizedAllowedLinearError: number;
701
715
  normalizedPredictionDistance: number;
702
716
  numInternalPgsIterations: number;
@@ -2161,6 +2175,9 @@ export interface InitOutput {
2161
2175
  readonly rawcontactmanifold_restitution: (a: number) => number;
2162
2176
  readonly rawcontactmanifold_solver_contact_dist: (a: number, b: number) => number;
2163
2177
  readonly rawcontactmanifold_solver_contact_point: (a: number, b: number, c: number, d: number) => number;
2178
+ readonly rawcontactmanifold_solver_contact_point1: (a: number, b: number, c: number, d: number) => number;
2179
+ readonly rawcontactmanifold_solver_contact_point2: (a: number, b: number, c: number, d: number) => number;
2180
+ readonly rawcontactmanifold_solver_contact_separation: (a: number, b: number, c: number) => number;
2164
2181
  readonly rawcontactmanifold_solver_contact_tangent_velocity: (a: number, b: number, c: number) => void;
2165
2182
  readonly rawcontactmanifold_subshape1: (a: number) => number;
2166
2183
  readonly rawcontactmanifold_subshape2: (a: number) => number;
@@ -2278,19 +2295,23 @@ export interface InitOutput {
2278
2295
  readonly rawimpulsejointset_len: (a: number) => number;
2279
2296
  readonly rawimpulsejointset_new: () => number;
2280
2297
  readonly rawimpulsejointset_remove: (a: number, b: number, c: number) => void;
2298
+ readonly rawintegrationparameters_contactClustering: (a: number) => number;
2281
2299
  readonly rawintegrationparameters_contact_erp: (a: number) => number;
2282
2300
  readonly rawintegrationparameters_dt: (a: number) => number;
2283
2301
  readonly rawintegrationparameters_lengthUnit: (a: number) => number;
2284
2302
  readonly rawintegrationparameters_maxCcdSubsteps: (a: number) => number;
2303
+ readonly rawintegrationparameters_minCcdDt: (a: number) => number;
2285
2304
  readonly rawintegrationparameters_new: () => number;
2286
2305
  readonly rawintegrationparameters_normalizedAllowedLinearError: (a: number) => number;
2287
2306
  readonly rawintegrationparameters_normalizedPredictionDistance: (a: number) => number;
2288
2307
  readonly rawintegrationparameters_numInternalPgsIterations: (a: number) => number;
2289
2308
  readonly rawintegrationparameters_numSolverIterations: (a: number) => number;
2309
+ readonly rawintegrationparameters_set_contactClustering: (a: number, b: number) => void;
2290
2310
  readonly rawintegrationparameters_set_contact_natural_frequency: (a: number, b: number) => void;
2291
2311
  readonly rawintegrationparameters_set_dt: (a: number, b: number) => void;
2292
2312
  readonly rawintegrationparameters_set_lengthUnit: (a: number, b: number) => void;
2293
2313
  readonly rawintegrationparameters_set_maxCcdSubsteps: (a: number, b: number) => void;
2314
+ readonly rawintegrationparameters_set_minCcdDt: (a: number, b: number) => void;
2294
2315
  readonly rawintegrationparameters_set_normalizedAllowedLinearError: (a: number, b: number) => void;
2295
2316
  readonly rawintegrationparameters_set_normalizedPredictionDistance: (a: number, b: number) => void;
2296
2317
  readonly rawintegrationparameters_set_numInternalPgsIterations: (a: number, b: number) => void;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@absolutejs/rapier3d",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "Rapier 3D with separate geometric and clustered solver-contact inspection",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/absolutejs/rapier3d.git"
9
+ "url": "git+https://github.com/absolutejs/rapier3d.git"
10
10
  },
11
11
  "files": [
12
12
  "dist",