@ignifx/physics 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.
- package/dist/index.d.ts +42 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +81 -17
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/skills/physics/SKILL.md +18 -12
package/dist/index.d.ts
CHANGED
|
@@ -1163,6 +1163,27 @@ interface QueryOptions {
|
|
|
1163
1163
|
/** Whether trigger volumes count as hits. Defaults to `false`. */
|
|
1164
1164
|
readonly hitTriggers?: boolean;
|
|
1165
1165
|
}
|
|
1166
|
+
/**
|
|
1167
|
+
* Options a shape sweep accepts, on top of {@link QueryOptions}.
|
|
1168
|
+
*
|
|
1169
|
+
* @remarks
|
|
1170
|
+
* `ignore` exists because a sweep that starts at or inside a body — a camera boom leaving its
|
|
1171
|
+
* target's capsule, a step probe leaving the character's own feet — reports that body at fraction
|
|
1172
|
+
* zero and nothing else. Lite's sweep can exclude exactly one body, and cannot filter by layer at
|
|
1173
|
+
* all (`ShapeCastQuery` has `ignoreBody` and no collision masks, unlike `physicsRaycast`), so
|
|
1174
|
+
* `layerMask` decides which hit is *attributed* an entity while `ignore` is the one body the
|
|
1175
|
+
* geometry itself passes through. Added 2026-09-08.
|
|
1176
|
+
*
|
|
1177
|
+
* @public
|
|
1178
|
+
*/
|
|
1179
|
+
interface ShapeCastOptions extends QueryOptions {
|
|
1180
|
+
/**
|
|
1181
|
+
* An entity whose body the sweep passes through — usually the caller's own. A `Rigidbody`, a
|
|
1182
|
+
* collider-only static, and a `CharacterController` capsule are all accepted; an entity with no
|
|
1183
|
+
* body is ignored.
|
|
1184
|
+
*/
|
|
1185
|
+
readonly ignore?: Entity | null;
|
|
1186
|
+
}
|
|
1166
1187
|
/**
|
|
1167
1188
|
* A shape to sweep or to test for overlaps. It is a description, not a component: the service builds
|
|
1168
1189
|
* the Havok shape for the call and releases it afterwards.
|
|
@@ -1379,7 +1400,8 @@ declare class PhysicsRuntime {
|
|
|
1379
1400
|
markControllerDirty(component: CharacterController): void;
|
|
1380
1401
|
/**
|
|
1381
1402
|
* Restores the authoritative pose of every interpolated body and controller, undoing the display
|
|
1382
|
-
* pose the `
|
|
1403
|
+
* pose the `Update` system wrote at the top of the previous frame's `Update`
|
|
1404
|
+
* (`09-physics.md` §1, spike S4.3).
|
|
1383
1405
|
*/
|
|
1384
1406
|
restorePoses(): void;
|
|
1385
1407
|
/**
|
|
@@ -1408,6 +1430,16 @@ declare class PhysicsRuntime {
|
|
|
1408
1430
|
* @returns The record, or `null`.
|
|
1409
1431
|
*/
|
|
1410
1432
|
recordOf(entity: Entity): BodyRecord | null;
|
|
1433
|
+
/**
|
|
1434
|
+
* The Havok body an entity's physics is, whether that is a `Rigidbody`, a collider-only static, or
|
|
1435
|
+
* a `CharacterController`'s capsule — which is what a sweep names to pass through it
|
|
1436
|
+
* (`ShapeCastOptions.ignore`).
|
|
1437
|
+
*
|
|
1438
|
+
* @param entity - The entity.
|
|
1439
|
+
* @returns The body, or `null` when the entity has none yet: a body is built on the fixed step
|
|
1440
|
+
* after its components attach, so a query in the same frame finds nothing to ignore.
|
|
1441
|
+
*/
|
|
1442
|
+
bodyOf(entity: Entity): LitePhysicsBody | null;
|
|
1411
1443
|
/**
|
|
1412
1444
|
* The record a Lite node belongs to, which is how a Havok event or query result becomes an entity.
|
|
1413
1445
|
*
|
|
@@ -1626,14 +1658,20 @@ export declare class PhysicsService {
|
|
|
1626
1658
|
* Lite's `shapeCast` reports no body (`index.d.ts` 11497), so `entity` is resolved against the
|
|
1627
1659
|
* extension's body-bounds index and is bounds-accurate rather than shape-accurate.
|
|
1628
1660
|
*
|
|
1661
|
+
* The sweep itself cannot be filtered by layer — Lite's `ShapeCastQuery` carries no collision
|
|
1662
|
+
* masks — so a body outside `layerMask` still stops the sweep; it is merely reported with
|
|
1663
|
+
* `entity: null`. What the sweep *can* do is pass through one body, `options.ignore`, which is
|
|
1664
|
+
* how a camera boom leaves its target's capsule and a step probe leaves the character's own feet
|
|
1665
|
+
* without reporting them at fraction zero (2026-09-08).
|
|
1666
|
+
*
|
|
1629
1667
|
* @param shape - The shape to sweep.
|
|
1630
1668
|
* @param from - The start position.
|
|
1631
1669
|
* @param to - The end position.
|
|
1632
|
-
* @param options - Layer mask and
|
|
1670
|
+
* @param options - Layer mask, trigger behaviour, and the one entity to sweep through.
|
|
1633
1671
|
* @returns The hit, or `null`.
|
|
1634
1672
|
* @throws IgnifxError with code `IGX-0902` in development when no fixed step has run yet.
|
|
1635
1673
|
*/
|
|
1636
|
-
shapeCast(shape: QueryShape, from: Vec3Like, to: Vec3Like, options?:
|
|
1674
|
+
shapeCast(shape: QueryShape, from: Vec3Like, to: Vec3Like, options?: ShapeCastOptions): ShapeCastHit | null;
|
|
1637
1675
|
/**
|
|
1638
1676
|
* Lists the entities a positioned shape overlaps (`09-physics.md` §5).
|
|
1639
1677
|
*
|
|
@@ -1775,5 +1813,5 @@ export declare const physics: (options?: PhysicsOptions) => Extension;
|
|
|
1775
1813
|
*/
|
|
1776
1814
|
export declare function describeSchemas(): Readonly<Record<string, SchemaDescription>>;
|
|
1777
1815
|
//#endregion
|
|
1778
|
-
export type { BodyType, CapsuleDirection, CharacterCollision, Collision, CollisionEventMode, CollisionIdentityMode, ContactPoint, FreezeRotation, InterpolationMode, KinematicSyncMode, PhysicsDebugViewer, PhysicsErrorOptions, PhysicsLiteHandles, PhysicsMaterialValues, PhysicsOptions, PhysicsSettings, QueryOptions, QueryShape, RaycastHit, RigidbodyLiteHandles, ShapeCastHit, SupportStateName, TriggerEvent, VelocityLimitSettings };
|
|
1816
|
+
export type { BodyType, CapsuleDirection, CharacterCollision, Collision, CollisionEventMode, CollisionIdentityMode, ContactPoint, FreezeRotation, InterpolationMode, KinematicSyncMode, PhysicsDebugViewer, PhysicsErrorOptions, PhysicsLiteHandles, PhysicsMaterialValues, PhysicsOptions, PhysicsSettings, QueryOptions, QueryShape, RaycastHit, RigidbodyLiteHandles, ShapeCastHit, ShapeCastOptions, SupportStateName, TriggerEvent, VelocityLimitSettings };
|
|
1779
1817
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/settings.ts","../src/material.ts","../src/lite/havok.ts","../src/components/collider.ts","../src/events.ts","../src/components/rigidbody.ts","../src/components/character-controller.ts","../src/components/colliders.ts","../src/errors.ts","../src/queries.ts","../src/runtime/body-record.ts","../src/runtime/runtime.ts","../src/runtime/host.ts","../src/service.ts","../src/extension.ts","../src/schemas.ts"],"mappings":";;;;;;;;;;;;;;qBAea;;;;;;qBAOA;;;;;;;UAQI;;WAEN;;WAEA;;WAEA;;;;;;;;UASM;;WAEN;;WAEA;;;;;;;;;;;;;;;;;;;UAoBM;;WAEN,SAAS;;;;;WAKT,iBAAiB,SAAS;;WAE1B,iBAAiB;;WAEjB,gBAAgB;;WAEhB;;WAEA;;;;;;;;;;;;;wBA8BK,yBAAyB;;;;;;;;wBAyBzB,0BAA0B;;;;;;;;;;;;;qBC5H7B;;;;;;qBAOA;;;;;;qBAOA;;;;;;qBAOA;;;;;;;;;;;;;qBAcA,2BAA2B;;SAE/B;;WAGE;;WAGA;;WAGA;;WAGA;;;;;;;;EAST,YAAY,cAAc,QAAQ;;;;;;;;;;;;;SAmB3B,WAAW,cAAc,QAAQ,QAAQ,yBAAyB;;;;;;;;;wBAiB3D,+BAA+B,YAAY;;;;;;;;;;;wBAqB3C,qBAAqB,iBAAiB,UAAU,YAAY;;;;;;;;;wBAgC5D,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KC9FzC,mBAAmB;;;;;;;KAQnB,kBAAkB;;;;;;KAOlB,mBAAmB;;;;;;;cAQlB;;WAEX;;WAEA;;WAEA;;;;;;;KAQU,qBAAqB,yBAAyB;;UA0EzC;;WAEN,QAAQ;;WAER,OAAO;;;;;;;;;;;;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;;;;;;EAYA,YAAY,OAAO,kBAAkB,OAAO,WAAW;;;;;;;EAiBvD,iBAAiB,OAAO,UAAU,KAAK;;;;;;;;;;;;;;qBAkB5B,qBAAqB;;;SAEzB;;SAGA,QAAQ;EAEf,MAAc,YAAY;EAE1B;EAEA;;EAGA;;;;;;;;;EAaA,YAAY,OAAO,kBAAkB,QAAQ,UAAU,MAAM,gBAAgB;;;;;;;;EAY7E,iBAAiB,QAAQ,UAAU,KAAK;;;;;;;;;;;;;qBAkD7B,4BAA4B;;SAEhC;;SAGA,QAAQ;EAEf;EAEA;EAEA;EAEA,MAAc;;EAGd;;;;;;;;EAYA,YAAY,OAAO,kBAAkB,OAAO,WAAW;;;;;;;EAgCvD,iBAAiB,OAAO,UAAU,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;qBCzY5B;;WAEX;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;;;;;YAQU,2BAA2B,+BAA+B;;;;;;;qBAQzD,wBAAwB,SAAS;;;;;;;UAiB7B;;WAEN,UAAU;;WAEV;;WAEA;;;;;;;;;;;;;;;;;;;wBAoBK,aAAa,MAAM,kBAAkB,iBAAiB,UAAU,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;UC1ErF;;WAEN,YAAY;;WAEZ;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/settings.ts","../src/material.ts","../src/lite/havok.ts","../src/components/collider.ts","../src/events.ts","../src/components/rigidbody.ts","../src/components/character-controller.ts","../src/components/colliders.ts","../src/errors.ts","../src/queries.ts","../src/runtime/body-record.ts","../src/runtime/runtime.ts","../src/runtime/host.ts","../src/service.ts","../src/extension.ts","../src/schemas.ts"],"mappings":";;;;;;;;;;;;;;qBAea;;;;;;qBAOA;;;;;;;UAQI;;WAEN;;WAEA;;WAEA;;;;;;;;UASM;;WAEN;;WAEA;;;;;;;;;;;;;;;;;;;UAoBM;;WAEN,SAAS;;;;;WAKT,iBAAiB,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qB,UAAU;;;;;;EAuBxF,sBAAsB;;;;;;EA+BtB;;EAKA;;;;;;;;;MA6BI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UCzUW;;;;;;WAMN,sBAAsB;;WAEtB;;WAEA,aAAa;;;YAIZ;;aAEC,SAAS;;;;;;;;;;;;;;;;qBAqBT,UAAU,UAAU,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;wBChEpC,mBAAmB,SAAS,eAAe"}
|
package/dist/index.js
CHANGED
|
@@ -2163,6 +2163,18 @@ function probeSupport(controller, deltaSeconds, gravity, groundNormal) {
|
|
|
2163
2163
|
return toSupportState(surface.supportedState);
|
|
2164
2164
|
}
|
|
2165
2165
|
/**
|
|
2166
|
+
* The Havok body a controller's capsule is, which is what a query names to sweep *past* the
|
|
2167
|
+
* character rather than into it (`ShapeCastOptions.ignore`).
|
|
2168
|
+
*
|
|
2169
|
+
* @param controller - The controller.
|
|
2170
|
+
* @returns Its body handle.
|
|
2171
|
+
*
|
|
2172
|
+
* @internal
|
|
2173
|
+
*/
|
|
2174
|
+
function controllerBody(controller) {
|
|
2175
|
+
return controller.getBody();
|
|
2176
|
+
}
|
|
2177
|
+
/**
|
|
2166
2178
|
* Reads the controller's resolved position.
|
|
2167
2179
|
*
|
|
2168
2180
|
* @param controller - The controller.
|
|
@@ -2538,7 +2550,8 @@ var PhysicsRuntime = class {
|
|
|
2538
2550
|
}
|
|
2539
2551
|
/**
|
|
2540
2552
|
* Restores the authoritative pose of every interpolated body and controller, undoing the display
|
|
2541
|
-
* pose the `
|
|
2553
|
+
* pose the `Update` system wrote at the top of the previous frame's `Update`
|
|
2554
|
+
* (`09-physics.md` §1, spike S4.3).
|
|
2542
2555
|
*/
|
|
2543
2556
|
restorePoses() {
|
|
2544
2557
|
for (let index = 0; index < this.#records.length; index += 1) {
|
|
@@ -2612,6 +2625,24 @@ var PhysicsRuntime = class {
|
|
|
2612
2625
|
return this.#byEntity.get(entity) ?? null;
|
|
2613
2626
|
}
|
|
2614
2627
|
/**
|
|
2628
|
+
* The Havok body an entity's physics is, whether that is a `Rigidbody`, a collider-only static, or
|
|
2629
|
+
* a `CharacterController`'s capsule — which is what a sweep names to pass through it
|
|
2630
|
+
* (`ShapeCastOptions.ignore`).
|
|
2631
|
+
*
|
|
2632
|
+
* @param entity - The entity.
|
|
2633
|
+
* @returns The body, or `null` when the entity has none yet: a body is built on the fixed step
|
|
2634
|
+
* after its components attach, so a query in the same frame finds nothing to ignore.
|
|
2635
|
+
*/
|
|
2636
|
+
bodyOf(entity) {
|
|
2637
|
+
const record = this.#byEntity.get(entity);
|
|
2638
|
+
if (record !== void 0) return record.body;
|
|
2639
|
+
for (let index = 0; index < this.#controllers.length; index += 1) {
|
|
2640
|
+
const controller = this.#controllers[index];
|
|
2641
|
+
if (controller !== void 0 && controller.component.entity === entity) return controllerBody(controller.controller);
|
|
2642
|
+
}
|
|
2643
|
+
return null;
|
|
2644
|
+
}
|
|
2645
|
+
/**
|
|
2615
2646
|
* The record a Lite node belongs to, which is how a Havok event or query result becomes an entity.
|
|
2616
2647
|
*
|
|
2617
2648
|
* @param node - The node.
|
|
@@ -2810,7 +2841,8 @@ var PhysicsRuntime = class {
|
|
|
2810
2841
|
/**
|
|
2811
2842
|
* Publishes the frame's counters and zeroes the accumulators. The kernel resets `FrameSample` each
|
|
2812
2843
|
* frame but not diagnostics **groups** (`Diagnostics.beginFrame`), so a group that reports
|
|
2813
|
-
* per-frame totals resets itself — and `
|
|
2844
|
+
* per-frame totals resets itself — and the top of `Update`, where the display pose is written, is
|
|
2845
|
+
* the first point in a frame at which every fixed step of that frame is done.
|
|
2814
2846
|
*/
|
|
2815
2847
|
#publishCounters() {
|
|
2816
2848
|
this.#counters.set(this.#index("bodies"), this.#records.length);
|
|
@@ -3551,25 +3583,42 @@ function unknownLayer(name) {
|
|
|
3551
3583
|
//#endregion
|
|
3552
3584
|
//#region src/runtime/systems.ts
|
|
3553
3585
|
/**
|
|
3554
|
-
* The three systems `docs/architecture/01-lifecycle-and-time.md` §3
|
|
3555
|
-
*
|
|
3586
|
+
* The three systems `docs/architecture/01-lifecycle-and-time.md` §3 and `09-physics.md` §1 put
|
|
3587
|
+
* physics in the frame with:
|
|
3556
3588
|
*
|
|
3557
3589
|
* ```
|
|
3558
3590
|
* Systems(FixedUpdate, -100) restore the authoritative pose of interpolated bodies
|
|
3559
3591
|
* scripts.fixedUpdate(dt) forces, velocities, CharacterController.move()
|
|
3560
3592
|
* Systems(FixedUpdate, 100) step Havok, snapshot poses, dispatch collision and trigger events
|
|
3561
|
-
*
|
|
3593
|
+
* ── the fixed loop ends; time.fixedStepAlpha is final ──
|
|
3594
|
+
* Systems(Update, -900) write lerp(prev, cur, time.fixedStepAlpha)
|
|
3595
|
+
* scripts.update / lateUpdate, animation, rendering — all read the display pose
|
|
3562
3596
|
* ```
|
|
3563
3597
|
*
|
|
3598
|
+
* **Why the display pose is written at the top of `Update` and not in `PreRender`** (2026-09-08).
|
|
3599
|
+
* It used to be written in `PreRender`, after `lateUpdate`. Camera rigs run in `lateUpdate`, so they
|
|
3600
|
+
* framed the character where the last fixed step left it while the renderer drew it at
|
|
3601
|
+
* `lerp(prev, cur, alpha)`: up to one fixed step of motion of relative judder every frame, which is
|
|
3602
|
+
* exactly what a follow camera makes visible. Writing the pose before `scripts.update` means every
|
|
3603
|
+
* consumer of a transform outside the fixed loop — scripts, animation, camera rigs, the render sync
|
|
3604
|
+
* — sees the same pose the frame presents, which is Unity's model. The simulation is unaffected:
|
|
3605
|
+
* the restore system at `FixedUpdate −100` runs before `scripts.fixedUpdate`, so `fixedUpdate` and
|
|
3606
|
+
* Havok still see the authoritative pose.
|
|
3607
|
+
*
|
|
3564
3608
|
* Everything here is `@internal`.
|
|
3565
3609
|
*/
|
|
3566
3610
|
/** The `FixedUpdate` order the restore system runs at. */
|
|
3567
3611
|
const PHYSICS_RESTORE_ORDER = -100;
|
|
3568
|
-
/** The `PreRender` order the interpolation system runs at. */
|
|
3569
|
-
const PHYSICS_INTERPOLATE_ORDER = -500;
|
|
3570
3612
|
/**
|
|
3571
|
-
*
|
|
3572
|
-
*
|
|
3613
|
+
* The `Update` order the interpolation system runs at. Negative, so it lands in
|
|
3614
|
+
* `Systems(Update, order < 0)` — after the fixed loop and lifecycle flush B, before
|
|
3615
|
+
* `scripts.update` — and low enough that a game's own `Update` systems can still be ordered in
|
|
3616
|
+
* front of it if they must see the authoritative pose.
|
|
3617
|
+
*/
|
|
3618
|
+
const PHYSICS_INTERPOLATE_ORDER = -900;
|
|
3619
|
+
/**
|
|
3620
|
+
* Undoes the display pose the interpolation system wrote at the top of the previous `Update`, so
|
|
3621
|
+
* `fixedUpdate` and Havok both see the authoritative pose (spike S4.3).
|
|
3573
3622
|
*
|
|
3574
3623
|
* @internal
|
|
3575
3624
|
*/
|
|
@@ -3725,13 +3774,17 @@ function castRay(world, from, to, membership, collideWith, hitTriggers, point, n
|
|
|
3725
3774
|
* @param from - The start position.
|
|
3726
3775
|
* @param to - The end position.
|
|
3727
3776
|
* @param hitTriggers - Whether trigger volumes count as hits.
|
|
3777
|
+
* @param ignoreBody - One body the sweep passes through, or `null`. Lite's `ShapeCastQuery` takes
|
|
3778
|
+
* exactly one (`ignoreBody`, `index.d.ts` 11494) and — unlike `physicsRaycast` — no
|
|
3779
|
+
* `membership`/`collideWith` pair, so this is the only filtering a sweep can do inside Havok; a
|
|
3780
|
+
* layer mask is applied to the *attribution* of the hit by the service, never to the sweep.
|
|
3728
3781
|
* @param point - Written with the contact point on the hit body.
|
|
3729
3782
|
* @param normal - Written with the contact normal on the hit body.
|
|
3730
3783
|
* @param out - Written with the hit flag and the sweep fraction.
|
|
3731
3784
|
*
|
|
3732
3785
|
* @internal
|
|
3733
3786
|
*/
|
|
3734
|
-
function sweepShape(world, shape, rotation, from, to, hitTriggers, point, normal, out) {
|
|
3787
|
+
function sweepShape(world, shape, rotation, from, to, hitTriggers, ignoreBody, point, normal, out) {
|
|
3735
3788
|
const result = shapeCast(world, {
|
|
3736
3789
|
shape,
|
|
3737
3790
|
rotation: {
|
|
@@ -3750,7 +3803,8 @@ function sweepShape(world, shape, rotation, from, to, hitTriggers, point, normal
|
|
|
3750
3803
|
y: to.y,
|
|
3751
3804
|
z: to.z
|
|
3752
3805
|
},
|
|
3753
|
-
shouldHitTriggers: hitTriggers
|
|
3806
|
+
shouldHitTriggers: hitTriggers,
|
|
3807
|
+
...ignoreBody === null ? {} : { ignoreBody }
|
|
3754
3808
|
});
|
|
3755
3809
|
out.hit = result.hasHit;
|
|
3756
3810
|
out.fraction = result.fraction;
|
|
@@ -3938,24 +3992,32 @@ var PhysicsService = class {
|
|
|
3938
3992
|
* Lite's `shapeCast` reports no body (`index.d.ts` 11497), so `entity` is resolved against the
|
|
3939
3993
|
* extension's body-bounds index and is bounds-accurate rather than shape-accurate.
|
|
3940
3994
|
*
|
|
3995
|
+
* The sweep itself cannot be filtered by layer — Lite's `ShapeCastQuery` carries no collision
|
|
3996
|
+
* masks — so a body outside `layerMask` still stops the sweep; it is merely reported with
|
|
3997
|
+
* `entity: null`. What the sweep *can* do is pass through one body, `options.ignore`, which is
|
|
3998
|
+
* how a camera boom leaves its target's capsule and a step probe leaves the character's own feet
|
|
3999
|
+
* without reporting them at fraction zero (2026-09-08).
|
|
4000
|
+
*
|
|
3941
4001
|
* @param shape - The shape to sweep.
|
|
3942
4002
|
* @param from - The start position.
|
|
3943
4003
|
* @param to - The end position.
|
|
3944
|
-
* @param options - Layer mask and
|
|
4004
|
+
* @param options - Layer mask, trigger behaviour, and the one entity to sweep through.
|
|
3945
4005
|
* @returns The hit, or `null`.
|
|
3946
4006
|
* @throws IgnifxError with code `IGX-0902` in development when no fixed step has run yet.
|
|
3947
4007
|
*/
|
|
3948
4008
|
shapeCast(shape, from, to, options) {
|
|
3949
4009
|
this.#requireStep("shapeCast");
|
|
3950
4010
|
this.#rt().countQuery();
|
|
4011
|
+
const ignored = options?.ignore ?? null;
|
|
4012
|
+
const ignoredBody = ignored === null ? null : this.#rt().bodyOf(ignored);
|
|
3951
4013
|
const handle = this.#buildQueryShape(shape);
|
|
3952
4014
|
try {
|
|
3953
|
-
sweepShape(this.#rt().world, handle, Quat.identity(), from, to, options?.hitTriggers === true, this.#point, this.#normal, this.#sweepResult);
|
|
4015
|
+
sweepShape(this.#rt().world, handle, Quat.identity(), from, to, options?.hitTriggers === true, ignoredBody, this.#point, this.#normal, this.#sweepResult);
|
|
3954
4016
|
} finally {
|
|
3955
4017
|
destroyShape(this.#rt().world, handle);
|
|
3956
4018
|
}
|
|
3957
4019
|
if (!this.#sweepResult.hit) return null;
|
|
3958
|
-
const record = this.#recordAt(this.#point, options);
|
|
4020
|
+
const record = this.#recordAt(this.#point, options, ignored);
|
|
3959
4021
|
const distance = Math.hypot(to.x - from.x, to.y - from.y, to.z - from.z) * this.#sweepResult.fraction;
|
|
3960
4022
|
return {
|
|
3961
4023
|
entity: record?.entity ?? null,
|
|
@@ -4130,15 +4192,17 @@ var PhysicsService = class {
|
|
|
4130
4192
|
*
|
|
4131
4193
|
* @param point - The point.
|
|
4132
4194
|
* @param options - Layer mask and trigger behaviour.
|
|
4195
|
+
* @param ignored - The entity the sweep was told to pass through, which can therefore not be the
|
|
4196
|
+
* one it hit.
|
|
4133
4197
|
* @returns The record, or `null`.
|
|
4134
4198
|
*/
|
|
4135
|
-
#recordAt(point, options) {
|
|
4199
|
+
#recordAt(point, options, ignored = null) {
|
|
4136
4200
|
const records = this.#rt().records;
|
|
4137
4201
|
let best = null;
|
|
4138
4202
|
let bestDistance = Number.POSITIVE_INFINITY;
|
|
4139
4203
|
for (let index = 0; index < records.length; index += 1) {
|
|
4140
4204
|
const record = records[index];
|
|
4141
|
-
if (record === void 0 || !this.#accepts(record, options)) continue;
|
|
4205
|
+
if (record === void 0 || record.entity === ignored || !this.#accepts(record, options)) continue;
|
|
4142
4206
|
const centre = record.currentPosition;
|
|
4143
4207
|
const extents = record.halfExtents;
|
|
4144
4208
|
if (Math.abs(point.x - centre.x) > extents.x + BOUNDS_EPSILON || Math.abs(point.y - centre.y) > extents.y + BOUNDS_EPSILON || Math.abs(point.z - centre.z) > extents.z + BOUNDS_EPSILON) continue;
|
|
@@ -4369,7 +4433,7 @@ const physics = defineExtension((options = {}) => {
|
|
|
4369
4433
|
order: 100
|
|
4370
4434
|
});
|
|
4371
4435
|
ctx.registerSystem(new PhysicsInterpolationSystem(host), {
|
|
4372
|
-
phase: Phase.
|
|
4436
|
+
phase: Phase.Update,
|
|
4373
4437
|
order: PHYSICS_INTERPOLATE_ORDER
|
|
4374
4438
|
});
|
|
4375
4439
|
},
|