@aura3d/physics 2.0.0 → 2.0.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/package.json +2 -2
- package/dist/CharacterController.d.ts +0 -135
- package/dist/CharacterController.d.ts.map +0 -1
- package/dist/CharacterController.js +0 -609
- package/dist/CharacterController.js.map +0 -1
- package/dist/ClothFixtures.d.ts +0 -87
- package/dist/ClothFixtures.d.ts.map +0 -1
- package/dist/ClothFixtures.js +0 -264
- package/dist/ClothFixtures.js.map +0 -1
- package/dist/Crowd.d.ts +0 -64
- package/dist/Crowd.d.ts.map +0 -1
- package/dist/Crowd.js +0 -209
- package/dist/Crowd.js.map +0 -1
- package/dist/FireSmokeFixtures.d.ts +0 -103
- package/dist/FireSmokeFixtures.d.ts.map +0 -1
- package/dist/FireSmokeFixtures.js +0 -271
- package/dist/FireSmokeFixtures.js.map +0 -1
- package/dist/FluidFixtures.d.ts +0 -75
- package/dist/FluidFixtures.d.ts.map +0 -1
- package/dist/FluidFixtures.js +0 -219
- package/dist/FluidFixtures.js.map +0 -1
- package/dist/FractureFixtures.d.ts +0 -68
- package/dist/FractureFixtures.d.ts.map +0 -1
- package/dist/FractureFixtures.js +0 -199
- package/dist/FractureFixtures.js.map +0 -1
- package/dist/NarrowPhase.d.ts +0 -11
- package/dist/NarrowPhase.d.ts.map +0 -1
- package/dist/NarrowPhase.js +0 -565
- package/dist/NarrowPhase.js.map +0 -1
- package/dist/Navigation.d.ts +0 -67
- package/dist/Navigation.d.ts.map +0 -1
- package/dist/Navigation.js +0 -261
- package/dist/Navigation.js.map +0 -1
- package/dist/PathFollowDriver.d.ts +0 -162
- package/dist/PathFollowDriver.d.ts.map +0 -1
- package/dist/PathFollowDriver.js +0 -163
- package/dist/PathFollowDriver.js.map +0 -1
- package/dist/PhysicsSandboxFixtures.d.ts +0 -53
- package/dist/PhysicsSandboxFixtures.d.ts.map +0 -1
- package/dist/PhysicsSandboxFixtures.js +0 -280
- package/dist/PhysicsSandboxFixtures.js.map +0 -1
- package/dist/PlatformerFixtures.d.ts +0 -70
- package/dist/PlatformerFixtures.d.ts.map +0 -1
- package/dist/PlatformerFixtures.js +0 -120
- package/dist/PlatformerFixtures.js.map +0 -1
- package/dist/RacingLineProfile.d.ts +0 -116
- package/dist/RacingLineProfile.d.ts.map +0 -1
- package/dist/RacingLineProfile.js +0 -181
- package/dist/RacingLineProfile.js.map +0 -1
- package/dist/SoftBodyFixtures.d.ts +0 -70
- package/dist/SoftBodyFixtures.d.ts.map +0 -1
- package/dist/SoftBodyFixtures.js +0 -272
- package/dist/SoftBodyFixtures.js.map +0 -1
- package/dist/Steering.d.ts +0 -161
- package/dist/Steering.d.ts.map +0 -1
- package/dist/Steering.js +0 -347
- package/dist/Steering.js.map +0 -1
- package/dist/VehicleDynamics.d.ts +0 -162
- package/dist/VehicleDynamics.d.ts.map +0 -1
- package/dist/VehicleDynamics.js +0 -363
- package/dist/VehicleDynamics.js.map +0 -1
- package/dist/VehicleMotion.d.ts +0 -125
- package/dist/VehicleMotion.d.ts.map +0 -1
- package/dist/VehicleMotion.js +0 -373
- package/dist/VehicleMotion.js.map +0 -1
- package/dist/solverless-entry.d.ts +0 -41
- package/dist/solverless-entry.d.ts.map +0 -1
- package/dist/solverless-entry.js +0 -40
- package/dist/solverless-entry.js.map +0 -1
- package/dist/world-entry.d.ts +0 -31
- package/dist/world-entry.d.ts.map +0 -1
- package/dist/world-entry.js +0 -30
- package/dist/world-entry.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aura3d/physics",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@aura3d/physics-rapier": "2.0.
|
|
9
|
+
"@aura3d/physics-rapier": "2.0.1"
|
|
10
10
|
},
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import type { Collider } from "./Collider.js";
|
|
2
|
-
import { KinematicBody, type KinematicBodyDescriptor, type KinematicBodyEvent, type KinematicBodySnapshot, type KinematicStepOptions } from "./KinematicBody.js";
|
|
3
|
-
import type { PhysicsWorld } from "./PhysicsWorld.js";
|
|
4
|
-
import type { RigidBody } from "./RigidBody.js";
|
|
5
|
-
import { type Vec3 } from "./Shape.js";
|
|
6
|
-
export type CharacterControllerDescriptor = {
|
|
7
|
-
readonly position?: Vec3;
|
|
8
|
-
readonly radius?: number;
|
|
9
|
-
readonly halfHeight?: number;
|
|
10
|
-
readonly maxSpeed?: number;
|
|
11
|
-
readonly acceleration?: number;
|
|
12
|
-
readonly jumpSpeed?: number;
|
|
13
|
-
readonly groundProbeDistance?: number;
|
|
14
|
-
readonly maxSlopeAngleRadians?: number;
|
|
15
|
-
readonly collisionMask?: number;
|
|
16
|
-
/**
|
|
17
|
-
* Tallest ledge the character walks up without jumping, in world units.
|
|
18
|
-
*
|
|
19
|
-
* Without this a capsule stops dead at a kerb: the solver sees a vertical wall and
|
|
20
|
-
* pushes back. Every platformer needs it, because level geometry is full of small steps
|
|
21
|
-
* that a player expects to walk over rather than jump.
|
|
22
|
-
*/
|
|
23
|
-
readonly maxStepHeight?: number | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* Snap distance when walking off a small ledge, in world units.
|
|
26
|
-
*
|
|
27
|
-
* Without step-down a character walking down stairs launches off each edge and
|
|
28
|
-
* repeatedly loses `grounded`, which breaks coyote time, footstep audio and any state
|
|
29
|
-
* machine keyed on being on the floor.
|
|
30
|
-
*/
|
|
31
|
-
readonly stepDownDistance?: number | undefined;
|
|
32
|
-
/** Slide along a wall instead of stopping when movement is blocked. Defaults to true. */
|
|
33
|
-
readonly wallSlide?: boolean | undefined;
|
|
34
|
-
};
|
|
35
|
-
export type CharacterControllerMoveInput = {
|
|
36
|
-
readonly x: number;
|
|
37
|
-
readonly z?: number;
|
|
38
|
-
};
|
|
39
|
-
export type CharacterControllerState = {
|
|
40
|
-
readonly grounded: boolean;
|
|
41
|
-
readonly groundNormal: Vec3;
|
|
42
|
-
readonly groundColliderId: number | null;
|
|
43
|
-
readonly desiredVelocity: Vec3;
|
|
44
|
-
readonly velocity: Vec3;
|
|
45
|
-
readonly speed: number;
|
|
46
|
-
/** Height the character was lifted this step to clear a ledge. Zero when flat. */
|
|
47
|
-
readonly steppedUp: number;
|
|
48
|
-
/** Distance the character was snapped down this step to stay on a descending surface. */
|
|
49
|
-
readonly steppedDown: number;
|
|
50
|
-
/** True when horizontal motion was redirected along a wall rather than stopped. */
|
|
51
|
-
readonly wallSliding: boolean;
|
|
52
|
-
/** True when the head struck geometry, so upward velocity was cancelled. */
|
|
53
|
-
readonly ceilingHit: boolean;
|
|
54
|
-
/** Slope angle under the character in radians. Zero on flat ground. */
|
|
55
|
-
readonly slopeAngle: number;
|
|
56
|
-
/** True when standing on a surface steeper than `maxSlopeAngleRadians`. */
|
|
57
|
-
readonly onSteepSlope: boolean;
|
|
58
|
-
readonly jumpedThisFrame: boolean;
|
|
59
|
-
};
|
|
60
|
-
export type FightingCharacterControllerState = "idle" | "walk" | "dash" | "jump" | "fast-fall" | "crouch" | "landing";
|
|
61
|
-
export type FightingCharacterControllerDescriptor = KinematicBodyDescriptor & {
|
|
62
|
-
readonly walkSpeed?: number;
|
|
63
|
-
readonly crouchSpeed?: number;
|
|
64
|
-
readonly fastFallSpeed?: number;
|
|
65
|
-
};
|
|
66
|
-
export type FightingCharacterControllerSnapshot = KinematicBodySnapshot & {
|
|
67
|
-
readonly state: FightingCharacterControllerState;
|
|
68
|
-
readonly walkSpeed: number;
|
|
69
|
-
readonly crouchSpeed: number;
|
|
70
|
-
readonly fastFallSpeed: number;
|
|
71
|
-
};
|
|
72
|
-
export declare class FightingCharacterController {
|
|
73
|
-
readonly body: KinematicBody;
|
|
74
|
-
readonly walkSpeed: number;
|
|
75
|
-
readonly crouchSpeed: number;
|
|
76
|
-
readonly fastFallSpeed: number;
|
|
77
|
-
private state;
|
|
78
|
-
constructor(descriptor?: FightingCharacterControllerDescriptor);
|
|
79
|
-
walk(direction: number, speed?: number): void;
|
|
80
|
-
stop(): void;
|
|
81
|
-
jump(): void;
|
|
82
|
-
dash(direction?: number): void;
|
|
83
|
-
fastFall(speed?: number): void;
|
|
84
|
-
crouch(active?: boolean): void;
|
|
85
|
-
step(dt: number, options?: KinematicStepOptions): readonly KinematicBodyEvent[];
|
|
86
|
-
snapshot(): FightingCharacterControllerSnapshot;
|
|
87
|
-
private deriveState;
|
|
88
|
-
}
|
|
89
|
-
export declare function createFightingCharacterController(descriptor?: FightingCharacterControllerDescriptor): FightingCharacterController;
|
|
90
|
-
export declare class CharacterController {
|
|
91
|
-
private readonly world;
|
|
92
|
-
readonly body: RigidBody;
|
|
93
|
-
readonly collider: Collider;
|
|
94
|
-
readonly radius: number;
|
|
95
|
-
readonly halfHeight: number;
|
|
96
|
-
readonly maxSpeed: number;
|
|
97
|
-
readonly acceleration: number;
|
|
98
|
-
readonly jumpSpeed: number;
|
|
99
|
-
readonly groundProbeDistance: number;
|
|
100
|
-
readonly maxSlopeAngleRadians: number;
|
|
101
|
-
readonly maxStepHeight: number;
|
|
102
|
-
readonly stepDownDistance: number;
|
|
103
|
-
readonly wallSlide: boolean;
|
|
104
|
-
private readonly collisionMask;
|
|
105
|
-
private moveInput;
|
|
106
|
-
private jumpQueued;
|
|
107
|
-
private state;
|
|
108
|
-
constructor(world: PhysicsWorld, descriptor?: CharacterControllerDescriptor);
|
|
109
|
-
setMoveInput(input: CharacterControllerMoveInput): void;
|
|
110
|
-
jump(): void;
|
|
111
|
-
teleport(position: Vec3): void;
|
|
112
|
-
step(dt: number): CharacterControllerState;
|
|
113
|
-
snapshot(): CharacterControllerState;
|
|
114
|
-
/**
|
|
115
|
-
* Horizontal sweep ahead of the capsule's mid-section, for wall and ledge detection.
|
|
116
|
-
*
|
|
117
|
-
* Returns both the sweep's own travel (`distance`, which callers feed back into
|
|
118
|
-
* `probeStepSurface` so the two probes stay consistent) and `gap`, the distance from the
|
|
119
|
-
* **capsule's surface** to the obstacle. The two differ by the probe sphere's radius less
|
|
120
|
-
* the capsule's, and conflating them is what made step-up fire early: see the comment at
|
|
121
|
-
* the step-up call site.
|
|
122
|
-
*/
|
|
123
|
-
private castHorizontal;
|
|
124
|
-
/**
|
|
125
|
-
* Surface height just past an obstacle, or undefined when there is nothing to stand on.
|
|
126
|
-
*
|
|
127
|
-
* Probes downward from above the maximum step height at a point slightly ahead of the
|
|
128
|
-
* capsule. If it finds a walkable surface, that height is the top of the step.
|
|
129
|
-
*/
|
|
130
|
-
private probeStepSurface;
|
|
131
|
-
/** Ground probe with a caller-supplied reach, used by step-down. */
|
|
132
|
-
private probeGroundAt;
|
|
133
|
-
private probeGround;
|
|
134
|
-
}
|
|
135
|
-
//# sourceMappingURL=CharacterController.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CharacterController.d.ts","sourceRoot":"","sources":["../../../../packages/physics/src/CharacterController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,KAAK,uBAAuB,EAAE,KAAK,kBAAkB,EAAE,KAAK,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACjK,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAwB,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAE7D,MAAM,MAAM,6BAA6B,GAAG;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC;IACzB,QAAQ,CAAC,MAAM,C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