lecodes-sdk 0.20.0 → 1.0.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/dist/global.d.ts +48 -5
- package/dist/inject.js +361 -260
- package/dist/types/audio/Bus.d.ts +45 -0
- package/dist/types/audio/Sound.d.ts +28 -0
- package/dist/types/audio/Voice.d.ts +27 -0
- package/dist/types/audio/audio.d.ts +83 -0
- package/dist/types/audio/support.d.ts +1 -0
- package/dist/types/canvas/Canvas.d.ts +2 -0
- package/dist/types/gl/DecalSet.d.ts +148 -0
- package/dist/types/gl/Geometry.d.ts +17 -0
- package/dist/types/gl/Light.d.ts +7 -0
- package/dist/types/gl/Lightmap.d.ts +9 -0
- package/dist/types/gl/Material.d.ts +90 -2
- package/dist/types/gl/Mesh.d.ts +18 -1
- package/dist/types/gl/Model.d.ts +34 -0
- package/dist/types/gl/Particles.d.ts +13 -0
- package/dist/types/gl/Scene.d.ts +23 -0
- package/dist/types/gl/Texture.d.ts +29 -1
- package/dist/types/gl/animation/AnimationClip.d.ts +25 -12
- package/dist/types/gl/animation/DynamicBone.d.ts +173 -0
- package/dist/types/gl/{IK.d.ts → animation/IK.d.ts} +4 -4
- package/dist/types/gl/{Locomotion.d.ts → animation/Locomotion.d.ts} +6 -6
- package/dist/types/gl/animation/core.d.ts +15 -10
- package/dist/types/gl/audio/AudioSource.d.ts +60 -0
- package/dist/types/gl/audio/AudioZone.d.ts +32 -0
- package/dist/types/gl/audio/SceneAudio.d.ts +11 -0
- package/dist/types/gl/{NavAgent.d.ts → nav/NavAgent.d.ts} +4 -4
- package/dist/types/gl/{NavMesh.d.ts → nav/NavMesh.d.ts} +4 -4
- package/dist/types/gl/{CharacterController.d.ts → physics/CharacterController.d.ts} +5 -5
- package/dist/types/gl/{Physics.d.ts → physics/Physics.d.ts} +6 -5
- package/dist/types/gl/{Ragdoll.d.ts → physics/Ragdoll.d.ts} +4 -4
- package/dist/types/gl/{Shape.d.ts → physics/Shape.d.ts} +3 -3
- package/dist/types/gl/{Trigger.d.ts → physics/Trigger.d.ts} +2 -2
- package/dist/types/gl/state.d.ts +0 -1
- package/dist/types/gl/{Terrain.d.ts → terrain/Terrain.d.ts} +6 -6
- package/dist/types/gl/{terrainMesh.d.ts → terrain/terrainMesh.d.ts} +1 -1
- package/dist/types/gl/vehicle/Vehicle.d.ts +300 -0
- package/dist/types/gl/vehicle/Wheel.d.ts +147 -0
- package/dist/types/inject.d.ts +33 -21
- package/dist/types/runtime/files.d.ts +24 -1
- package/dist/types/runtime/input.d.ts +11 -0
- package/dist/types/scene/defineScene.d.ts +10 -3
- package/dist/types/ui/UIImage.d.ts +15 -5
- package/dist/types.json +1 -1
- package/package.json +1 -1
- package/prompts/README.md +142 -142
- package/prompts/dist/2d-game.md +408 -197
- package/prompts/dist/3d-app.md +491 -166
- package/prompts/dist/ar-app.md +373 -163
- package/prompts/dist/design.md +83 -87
- package/prompts/dist/ui-app.md +325 -136
- package/src/audio/Bus.ts +102 -0
- package/src/audio/Sound.ts +96 -0
- package/src/audio/Voice.ts +102 -0
- package/src/audio/audio.ts +161 -0
- package/src/audio/support.ts +6 -0
- package/src/bridges.d.ts +279 -32
- package/src/canvas/Canvas.ts +21 -0
- package/src/compile/__tests__/compile.test.ts +11 -0
- package/src/compile/compileProject.ts +30 -15
- package/src/compile/header.ts +6 -3
- package/src/compile/index.ts +4 -0
- package/src/compile/sceneEditor.ts +42 -1
- package/src/core/Aspect.ts +33 -8
- package/src/g2/Scene2D.ts +7 -0
- package/src/gl/CameraPlace.ts +52 -52
- package/src/gl/DecalSet.ts +360 -0
- package/src/gl/Geometry.ts +348 -279
- package/src/gl/Light.ts +16 -0
- package/src/gl/Lightmap.ts +35 -7
- package/src/gl/Material.ts +173 -4
- package/src/gl/Mesh.ts +120 -83
- package/src/gl/Model.ts +33 -1
- package/src/gl/Node.ts +1 -1
- package/src/gl/Particles.ts +21 -3
- package/src/gl/Scene.ts +41 -7
- package/src/gl/Texture.ts +43 -3
- package/src/gl/animation/AnimationClip.ts +43 -20
- package/src/gl/animation/Animator.ts +4 -3
- package/src/gl/animation/DynamicBone.ts +459 -0
- package/src/gl/{IK.ts → animation/IK.ts} +4 -4
- package/src/gl/{Locomotion.ts → animation/Locomotion.ts} +7 -7
- package/src/gl/animation/core.ts +20 -15
- package/src/gl/audio/AudioSource.ts +113 -0
- package/src/gl/audio/AudioZone.ts +75 -0
- package/src/gl/audio/SceneAudio.ts +26 -0
- package/src/gl/{NavAgent.ts → nav/NavAgent.ts} +5 -5
- package/src/gl/{NavMesh.ts → nav/NavMesh.ts} +8 -8
- package/src/gl/{CharacterController.ts → physics/CharacterController.ts} +5 -5
- package/src/gl/{Physics.ts → physics/Physics.ts} +12 -5
- package/src/gl/{Ragdoll.ts → physics/Ragdoll.ts} +272 -270
- package/src/gl/{Shape.ts → physics/Shape.ts} +3 -3
- package/src/gl/{Trigger.ts → physics/Trigger.ts} +2 -2
- package/src/gl/{physicsEvents.ts → physics/physicsEvents.ts} +1 -1
- package/src/gl/scenarios.ts +291 -291
- package/src/gl/state.ts +1 -1
- package/src/gl/{Terrain.ts → terrain/Terrain.ts} +10 -10
- package/src/gl/{terrainMesh.ts → terrain/terrainMesh.ts} +1 -1
- package/src/gl/vehicle/Vehicle.ts +666 -0
- package/src/gl/vehicle/Wheel.ts +290 -0
- package/src/inject.ts +226 -212
- package/src/runtime/files.ts +32 -2
- package/src/runtime/input.ts +6 -1
- package/src/scene/defineScene.ts +26 -10
- package/src/scene/gizmos.ts +148 -148
- package/src/scene/level.ts +2 -2
- package/src/ui/UIImage.ts +21 -7
- package/dist/types/gl/Gearbox.d.ts +0 -86
- package/dist/types/gl/Vehicle.d.ts +0 -191
- package/dist/types/gl/Wheel.d.ts +0 -95
- package/src/gl/Gearbox.ts +0 -212
- package/src/gl/Vehicle.ts +0 -473
- package/src/gl/Wheel.ts +0 -240
- /package/dist/types/gl/{physicsEvents.d.ts → physics/physicsEvents.d.ts} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Aspect } from "
|
|
2
|
-
import type { FieldMeta } from "
|
|
3
|
-
import { Vec3, type Vec2Like, type Vec3Like } from "
|
|
4
|
-
import type { CompWriter } from "
|
|
5
|
-
import type { Node } from "
|
|
1
|
+
import { Aspect } from "../../core/Aspect";
|
|
2
|
+
import type { FieldMeta } from "../../core/fields";
|
|
3
|
+
import { Vec3, type Vec2Like, type Vec3Like } from "../../math/vec";
|
|
4
|
+
import type { CompWriter } from "../../core/compWrite";
|
|
5
|
+
import type { Node } from "../Node";
|
|
6
6
|
/** Where the character's feet are, as reported by the solver after the last step. */
|
|
7
7
|
export type GroundState = "ground" | "slope" | "unsupported" | "air";
|
|
8
8
|
export declare class CharacterController extends Aspect<"controller", Node> implements CompWriter {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Aspect } from "
|
|
2
|
-
import type { FieldMeta } from "
|
|
3
|
-
import type { CompAxis, CompWriter } from "
|
|
4
|
-
import { Vec3, type Vec3Like } from "
|
|
5
|
-
import { type Node } from "
|
|
1
|
+
import { Aspect } from "../../core/Aspect";
|
|
2
|
+
import type { FieldMeta } from "../../core/fields";
|
|
3
|
+
import type { CompAxis, CompWriter } from "../../core/compWrite";
|
|
4
|
+
import { Vec3, type Vec3Like } from "../../math/vec";
|
|
5
|
+
import { type Node } from "../Node";
|
|
6
6
|
export type MotionType = "static" | "dynamic" | "kinematic";
|
|
7
7
|
export interface PhysicsConfig {
|
|
8
8
|
/** Gravity in world units/s² (Y-up: down is negative). Default [0, -9.81, 0]. */
|
|
@@ -57,6 +57,7 @@ export declare class Physics extends Aspect<"physics", Node> implements CompWrit
|
|
|
57
57
|
/** Scene-editor inspector: `motion` as a dropdown (a string default alone infers a text box). */
|
|
58
58
|
static fields: FieldMeta<Physics>;
|
|
59
59
|
private _bodyId;
|
|
60
|
+
private static _refusedWarned;
|
|
60
61
|
onAttach(): void;
|
|
61
62
|
onDetach(): void;
|
|
62
63
|
/** Native Jolt body id. 0 until attached, or if the build has no physics support. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Aspect } from "
|
|
2
|
-
import type { FieldMeta } from "
|
|
3
|
-
import { type Vec3Like } from "
|
|
4
|
-
import { Node } from "
|
|
1
|
+
import { Aspect } from "../../core/Aspect";
|
|
2
|
+
import type { FieldMeta } from "../../core/fields";
|
|
3
|
+
import { type Vec3Like } from "../../math/vec";
|
|
4
|
+
import { Node } from "../Node";
|
|
5
5
|
export interface RagdollHinge {
|
|
6
6
|
/** The hinge axis in the MODEL's space (its rest pose: +Z forward, +Y up, +X the model's left in
|
|
7
7
|
* glTF). Perpendicular to the bone; the engine drops any component along it. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Aspect } from "
|
|
2
|
-
import { type Vec3Like } from "
|
|
3
|
-
import type { Node } from "
|
|
1
|
+
import { Aspect } from "../../core/Aspect";
|
|
2
|
+
import { type Vec3Like } from "../../math/vec";
|
|
3
|
+
import type { Node } from "../Node";
|
|
4
4
|
/** Which geometry a Shape uses — the one-of the fields below encode (see `_build`'s order). */
|
|
5
5
|
export type ShapeKind = "auto" | "box" | "sphere" | "cylinder" | "capsule" | "mesh" | "convex" | "heightfield";
|
|
6
6
|
/** A node-local AABB, in the node's OWN frame (its own transform excluded), before world scale. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Aspect } from "
|
|
2
|
-
import type { Node } from "
|
|
1
|
+
import { Aspect } from "../../core/Aspect";
|
|
2
|
+
import type { Node } from "../Node";
|
|
3
3
|
export declare class Trigger extends Aspect<"trigger", Node> {
|
|
4
4
|
static readonly aspect = "trigger";
|
|
5
5
|
private _bodyId;
|
package/dist/types/gl/state.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Node } from "
|
|
2
|
-
import { Material } from "
|
|
3
|
-
import { Texture } from "
|
|
4
|
-
import { Geometry } from "
|
|
5
|
-
import { type ColorInput } from "
|
|
6
|
-
import { Vec3, type Vec3Like } from "
|
|
1
|
+
import { Node } from "../Node";
|
|
2
|
+
import { Material } from "../Material";
|
|
3
|
+
import { Texture } from "../Texture";
|
|
4
|
+
import { Geometry } from "../Geometry";
|
|
5
|
+
import { type ColorInput } from "../../core/color";
|
|
6
|
+
import { Vec3, type Vec3Like } from "../../math/vec";
|
|
7
7
|
export type TerrainLayer = {
|
|
8
8
|
/** Albedo texture (a URL / `asset()` handle, or a loaded Texture). Unset = white. */
|
|
9
9
|
albedo?: string | Texture;
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { Aspect } from "../../core/Aspect";
|
|
2
|
+
import type { FieldMeta } from "../../core/fields";
|
|
3
|
+
import { Vec3, type Vec3Like } from "../../math/vec";
|
|
4
|
+
import { type QuatLike } from "../../math/quat";
|
|
5
|
+
import { Node } from "../Node";
|
|
6
|
+
import { Wheel, type Point } from "./Wheel";
|
|
7
|
+
/** Which axle the engine drives — the default for every wheel's own `driven` share. */
|
|
8
|
+
export type DriveLayout = "rear" | "front" | "all" | "none";
|
|
9
|
+
/**
|
|
10
|
+
* How an axle's two wheels share torque.
|
|
11
|
+
* - `lsd` — limited slip (Jolt's 1.4 ratio), the sane default.
|
|
12
|
+
* - `open` — fully open: a lifted or spinning wheel takes ALL the torque.
|
|
13
|
+
* - `locked` — both wheels forced to the same speed. Breaks traction predictably: the drift diff.
|
|
14
|
+
* A number is the raw max/min wheel-speed ratio (> 1; smaller is more locked).
|
|
15
|
+
*/
|
|
16
|
+
export type DifferentialMode = "lsd" | "open" | "locked";
|
|
17
|
+
export interface EngineConfig {
|
|
18
|
+
/** Peak torque in N·m (default 500). The single biggest "how fast is it" knob. */
|
|
19
|
+
torque?: number;
|
|
20
|
+
/** Redline in RPM (default 6000) — Jolt's own clamp; a rev limiter's stutter is the game's. */
|
|
21
|
+
maxRpm?: number;
|
|
22
|
+
/** Idle RPM (default 1000): the engine's floor. `0` = no floor — the engine can be dragged to a
|
|
23
|
+
* standstill and stall, and holding idle (a governor), cranking it, are the game's to write. */
|
|
24
|
+
idleRpm?: number;
|
|
25
|
+
/**
|
|
26
|
+
* The engine's CHARACTER: points `{ x, y }` in NORMALISED units — x a fraction of the redline, y a
|
|
27
|
+
* fraction of `torque`, x ascending. Left out, Jolt's own broad curve is used.
|
|
28
|
+
*
|
|
29
|
+
* `[{ x: 0, y: 0.8 }, { x: 0.66, y: 1 }, { x: 1, y: 0.8 }]` is an ordinary petrol engine (peak two
|
|
30
|
+
* thirds up, falling to the redline); `[{ x: 0, y: 1 }, { x: 1, y: 1 }]` is flat, an electric motor.
|
|
31
|
+
*/
|
|
32
|
+
curve?: Point[];
|
|
33
|
+
/** Moment of inertia in kg·m² (default 0.5) — how eagerly it revs when the clutch is out. */
|
|
34
|
+
inertia?: number;
|
|
35
|
+
/** Engine braking: angular damping of the engine itself (default 0.2). */
|
|
36
|
+
braking?: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The steering wheel as a BODY the tires push back on, simulated by the engine every sub-step. With
|
|
40
|
+
* it, `steer` is where the driver's hands AIM the wheel and `steerForce` how firmly they hold it;
|
|
41
|
+
* where the road wheels end up is physics:
|
|
42
|
+
*
|
|
43
|
+
* I·θ̈ = T_hand + T_align·(1 − powerSteering) + T_stop − (damping + endStop.damping·depth)·θ̇ − parkingFriction(v) − friction
|
|
44
|
+
*
|
|
45
|
+
* `T_align` is the tires' self-aligning torque (`steering.caster` / `trail` / `trailAtPeak` — the
|
|
46
|
+
* same torque `steerTorque` reports without a feedback body, for a force-feedback wheel). `T_hand`
|
|
47
|
+
* is the driver's arms, `steering.driver`. So: heavy at speed, light when the front lets go,
|
|
48
|
+
* self-centring on release, and in a slide a let-go wheel swings into opposite lock by itself.
|
|
49
|
+
* Without `feedback` there is no body: `steer` is the road wheels' angle as a fraction of `maxAngle`.
|
|
50
|
+
*/
|
|
51
|
+
export interface SteeringFeedback {
|
|
52
|
+
/** Moment of inertia of wheel + column + rack about the axis, kg·m² (default 1). Heavier = slower
|
|
53
|
+
* off the mark under the hands, but a wheel whipping into counter-steer carries further. */
|
|
54
|
+
inertia?: number;
|
|
55
|
+
/** Viscous damping, N·m·s/rad (default 25): what keeps a let-go wheel from ringing about centre. */
|
|
56
|
+
damping?: number;
|
|
57
|
+
/** The column's own dry friction, N·m, at any speed (default 8) — rack and bearings: the floor a
|
|
58
|
+
* free wheel's spin decays against, and what keeps a let-go wheel from creeping under a small torque. */
|
|
59
|
+
friction?: number;
|
|
60
|
+
/** The contact patch's dry friction while (nearly) parked, N·m (default 40), fading out by 1.5 m/s
|
|
61
|
+
* — why a parked car is hard to steer, and why a wheel left turned stays turned. */
|
|
62
|
+
parkingFriction?: number;
|
|
63
|
+
/** Power steering, 0..1 (default 0.5): the share of the tires' aligning torque the wheel never
|
|
64
|
+
* sees. It is NOT a gain on the angle: 0 is a kart (heavy, full of feel, a held key gives up its
|
|
65
|
+
* lock early at speed), 1 is a dead rim that neither centres nor counter-steers. */
|
|
66
|
+
powerSteering?: number;
|
|
67
|
+
/** The END STOP before the lock — rubber, not a wall (default `{ band: 16, torque: 120, damping: 150 }`):
|
|
68
|
+
* over the last `band` degrees the rack pushes back toward centre with the SQUARE of the depth,
|
|
69
|
+
* `torque` N·m at the lock, and damps by `damping` N·m·s/rad × depth. A wheel let go on the stop
|
|
70
|
+
* eases back off it a few degrees; `band: 0` = the hard clamp only. */
|
|
71
|
+
endStop?: {
|
|
72
|
+
band?: number;
|
|
73
|
+
torque?: number;
|
|
74
|
+
damping?: number;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/** The driver's ARMS on a `feedback` wheel — an actuator with numbers, because a stiff hand spring
|
|
78
|
+
* has to be integrated with the column every sub-step. WHAT the hands do (aim, hold, let go) is
|
|
79
|
+
* the game's, per frame, through `steer` and `steerForce`. */
|
|
80
|
+
export interface SteeringDriver {
|
|
81
|
+
/** The most torque the hands can put on the wheel, N·m (default 130). The ceiling on how much lock
|
|
82
|
+
* a held key keeps at speed against the tires' pull. */
|
|
83
|
+
maxTorque?: number;
|
|
84
|
+
/** How stiff the arms are, N·m/rad of the gap between where they aim and where the wheel is (default 500). */
|
|
85
|
+
stiffness?: number;
|
|
86
|
+
/** The fastest the hands turn the road wheels, deg/s (default 120): the hands cannot PUSH a wheel
|
|
87
|
+
* that already outruns them, they can still hold and brake it; a let-go wheel is uncapped. */
|
|
88
|
+
maxRate?: number;
|
|
89
|
+
/** Seconds the hands' torque takes to build to `maxTorque` (default 0.1): muscles do not step. */
|
|
90
|
+
rampTime?: number;
|
|
91
|
+
}
|
|
92
|
+
export interface SteeringConfig {
|
|
93
|
+
/** Steering lock in degrees (default 35): what `steer = ±1` means. */
|
|
94
|
+
maxAngle?: number;
|
|
95
|
+
/** The front axle's GEOMETRY, the source of the tires' self-aligning torque (`steerTorque`, and
|
|
96
|
+
* what a `feedback` wheel is pushed by): the mechanical caster's trail, metres (default 0.03)… */
|
|
97
|
+
caster?: number;
|
|
98
|
+
/** …and the pneumatic trail, metres (default 0.025) — the patch's own lever, which collapses as the
|
|
99
|
+
* tire reaches its peak slip angle (the steering going light when the front lets go)… */
|
|
100
|
+
trail?: number;
|
|
101
|
+
/** …to this fraction of itself at the peak (default 0.5). */
|
|
102
|
+
trailAtPeak?: number;
|
|
103
|
+
/** Simulate the steering wheel as a body the tires push back on (`SteeringFeedback`). `true` = the
|
|
104
|
+
* defaults. Without it `steer` sets the road wheels' angle directly. */
|
|
105
|
+
feedback?: boolean | SteeringFeedback;
|
|
106
|
+
/** The driver's arms on a `feedback` wheel (`SteeringDriver`); the defaults without it. */
|
|
107
|
+
driver?: SteeringDriver;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Aerodynamics. Both numbers are quoted the same way — **a fraction of the car's own weight at
|
|
111
|
+
* 30 m/s (108 km/h)** — and both grow with the SQUARE of speed from there, so `0.5` at 30 m/s is
|
|
112
|
+
* `2.0` at 60 m/s. One mental model for both, and no drag coefficients or frontal areas to invent.
|
|
113
|
+
*/
|
|
114
|
+
export interface AeroConfig {
|
|
115
|
+
/**
|
|
116
|
+
* Downforce (default 0 — a car with no wing). The knob that decides whether a car corners better
|
|
117
|
+
* or worse the faster it goes: tire grip is a constant, but the force a corner demands grows with
|
|
118
|
+
* v², so with no downforce every car runs out of road at speed. `0.6` roughly doubles a car's
|
|
119
|
+
* cornering at 150 km/h; a road car is nearer `0.1`, a race car well past `1`.
|
|
120
|
+
*
|
|
121
|
+
* It presses along the CHASSIS' own down axis (that is what keeps a car planted over a crest) and
|
|
122
|
+
* only while a wheel is on the ground — a car on its roof is never launched by its own wing.
|
|
123
|
+
*/
|
|
124
|
+
downforce?: number;
|
|
125
|
+
/** Air resistance (default 0.03 — an ordinary car). What gives a car a top speed at all. */
|
|
126
|
+
drag?: number;
|
|
127
|
+
}
|
|
128
|
+
export declare class Vehicle extends Aspect<"vehicle", Node> {
|
|
129
|
+
static readonly aspect = "vehicle";
|
|
130
|
+
/** Chassis mass in kg (default 1200). Wheels are massless in this model. */
|
|
131
|
+
mass: number;
|
|
132
|
+
/** Centre of mass height in chassis space (metres, negative = lower). Left out, it drops to halfway
|
|
133
|
+
* down the chassis shape — a car with its mass at the shape's centre tips over. */
|
|
134
|
+
centerOfMass?: number;
|
|
135
|
+
/** Which axle the engine drives (default "rear") — the default for every wheel's own `driven`
|
|
136
|
+
* share: 1 on that axle, 0 elsewhere. `none` = no drive at all (a trailer, a pushed cart). */
|
|
137
|
+
driveAxle: DriveLayout;
|
|
138
|
+
/** Differential lock across each driven axle. `locked` is the drift setup — both wheels turn
|
|
139
|
+
* together, so the pair lets go as a pair. Live: re-configure the aspect to switch it mid-drive. */
|
|
140
|
+
differential: DifferentialMode | number;
|
|
141
|
+
/**
|
|
142
|
+
* Anti-roll bars between each axle's wheels — what stops a car rolling onto its inside wheels in a
|
|
143
|
+
* fast corner. `true` (default) is a bar 0.01 as stiff as the wheel's own spring; a number is that
|
|
144
|
+
* ratio directly, and `0` / `false` removes the bars.
|
|
145
|
+
*
|
|
146
|
+
* **The numbers are far smaller than they look and the gain is steep** — Jolt's bar feeds
|
|
147
|
+
* `lengthDifference × stiffness × dt` as a bias into the suspension's own soft constraint, so 4%
|
|
148
|
+
* of the spring already flattens the body. Measured on a 1250 kg car: `0` → 1.3° of roll at 0.86 g,
|
|
149
|
+
* `0.01` → 0.6°, `0.15` → 0.2° (flat), `0.5` → the car HOPS.
|
|
150
|
+
*
|
|
151
|
+
* This is the knob for how much a car visibly LEANS, not for wheel lift: bars change how far the
|
|
152
|
+
* body tips, not how much load transfers. For lift, lower `centerOfMass`.
|
|
153
|
+
*/
|
|
154
|
+
antiRoll: boolean | number;
|
|
155
|
+
/** Pitch/roll limit in degrees (default 60) before the constraint rights the car. 180 turns it off. */
|
|
156
|
+
maxTilt: number;
|
|
157
|
+
/** Friction of the CHASSIS body itself — how it slides when it lands on its roof or side. Nothing
|
|
158
|
+
* to do with the tires; those are the `Wheel`'s `tire` × the ground's friction. */
|
|
159
|
+
friction: number;
|
|
160
|
+
/** Strength of the clutch when fully engaged (default 10). Small values slip; large ones weld the
|
|
161
|
+
* engine to the wheels. `clutch` (the input) scales it 0..1. */
|
|
162
|
+
clutchStrength: number;
|
|
163
|
+
/** The clutch's torque CAPACITY, N·m (default 0 = none: Jolt's viscous clutch alone, torque =
|
|
164
|
+
* `clutchStrength` × slip speed, no ceiling — rigid at any real slip). Set it and the clutch
|
|
165
|
+
* SLIPS at this much torque × `clutch` — a dry clutch, emulated a physics step at a time: a
|
|
166
|
+
* launch can be feathered, and a dumped clutch in too high a gear drags the engine down instead
|
|
167
|
+
* of lurching. A road car's is ~1.5× the engine's peak torque. */
|
|
168
|
+
clutchCapacity: number;
|
|
169
|
+
engine: EngineConfig;
|
|
170
|
+
steering: SteeringConfig;
|
|
171
|
+
aero: AeroConfig;
|
|
172
|
+
/** Scene-editor inspector: the flat, tunable half. The grouped objects are edited in code. */
|
|
173
|
+
static fields: FieldMeta<Vehicle>;
|
|
174
|
+
static editor: {
|
|
175
|
+
rebuild: boolean;
|
|
176
|
+
};
|
|
177
|
+
/** Driver systems tick at the default 0, so their inputs land in the SAME early pass, before this flush. */
|
|
178
|
+
protected updateOrder: number;
|
|
179
|
+
private _id;
|
|
180
|
+
private _bodyId;
|
|
181
|
+
private _builtMass;
|
|
182
|
+
private _wheels;
|
|
183
|
+
private _state;
|
|
184
|
+
private _stateFrame;
|
|
185
|
+
private _throttle;
|
|
186
|
+
private _steer;
|
|
187
|
+
private _steerForce;
|
|
188
|
+
private _ratio;
|
|
189
|
+
private _clutch;
|
|
190
|
+
private _input;
|
|
191
|
+
private _sent;
|
|
192
|
+
private _dirty;
|
|
193
|
+
private _retunePending;
|
|
194
|
+
onAttach(): void;
|
|
195
|
+
onDetach(): void;
|
|
196
|
+
/**
|
|
197
|
+
* Re-configuring an attached vehicle retunes it in place — the way a drift button switches the
|
|
198
|
+
* differential without the car so much as blinking:
|
|
199
|
+
*
|
|
200
|
+
* car.aspect(Vehicle, { differential: drift ? 'locked' : 'lsd' })
|
|
201
|
+
*
|
|
202
|
+
* Live: `differential`, `engine`, `steering`, `aero`, `maxTilt`, `friction`, `clutchStrength`,
|
|
203
|
+
* `clutchCapacity`, `antiRoll` (its stiffness, on axles that have a bar), and every `Wheel`'s
|
|
204
|
+
* `tire`. Everything else describes the car's STRUCTURE — `mass`, `centerOfMass`, which wheels
|
|
205
|
+
* exist and where, their suspension, the driven shares — and is baked into the constraint at
|
|
206
|
+
* attach; to change one of those, re-attach the aspect.
|
|
207
|
+
*/
|
|
208
|
+
onReconfigure(): void;
|
|
209
|
+
/** Native vehicle id (0 until attached / no physics support). */
|
|
210
|
+
get id(): number;
|
|
211
|
+
/** The chassis rigid body id (for `physicsApplyImpulse`-style calls). */
|
|
212
|
+
get bodyId(): number;
|
|
213
|
+
/** The wheels, front axle first, in the order the engine knows them. */
|
|
214
|
+
get wheels(): readonly Wheel[];
|
|
215
|
+
/** Throttle 0..1 — the engine's pedal. No sign: the direction is `ratio`'s. */
|
|
216
|
+
get throttle(): number;
|
|
217
|
+
set throttle(v: number);
|
|
218
|
+
/** Steering −1..1. Without `steering.feedback`: the road wheels' angle as a fraction of `maxAngle`,
|
|
219
|
+
* applied as is (a taper with speed, a rate limit, are the game's). With it: where the hands AIM
|
|
220
|
+
* the wheel; the tires decide where the road wheels end up. */
|
|
221
|
+
get steer(): number;
|
|
222
|
+
set steer(v: number);
|
|
223
|
+
/** How firmly the hands hold a `feedback` wheel, 0..1 (default 1): the hands' torque is capped at
|
|
224
|
+
* `driver.maxTorque × steerForce`. 0 = let go — the tires alone have the wheel: back to centre in
|
|
225
|
+
* a grip corner, into opposite lock in a slide. Ignored without a feedback wheel. */
|
|
226
|
+
get steerForce(): number;
|
|
227
|
+
set steerForce(v: number);
|
|
228
|
+
/** The ONE gear ratio the engine runs (default 1): engine rpm = wheel rpm × ratio × the final
|
|
229
|
+
* drive (3.42). The SIGN is the direction — negative is reverse — and 0 is neutral. */
|
|
230
|
+
get ratio(): number;
|
|
231
|
+
set ratio(v: number);
|
|
232
|
+
/** Clutch engagement 0..1 (default 1 = home). 0 = out: the engine is free of the wheels. */
|
|
233
|
+
get clutch(): number;
|
|
234
|
+
set clutch(v: number);
|
|
235
|
+
/**
|
|
236
|
+
* EARLY phase: hand this frame's inputs to the engine, before the step. The vector is sent when
|
|
237
|
+
* anything changed — and every frame while a throttle, steer or brake is non-zero, because that is
|
|
238
|
+
* what keeps a driven car awake (an idle car with zero input sleeps). The pending re-tune (a
|
|
239
|
+
* config or tire change) goes first, so the step runs on the new numbers.
|
|
240
|
+
*/
|
|
241
|
+
protected updateBefore(): void;
|
|
242
|
+
/** Teleport upright and clear all motion (velocity, engine rpm, wheel spin). Defaults to the
|
|
243
|
+
* chassis node's current pose — `reset()` alone un-flips a car where it lies. The inputs are
|
|
244
|
+
* kept and re-sent on the next early pass. */
|
|
245
|
+
reset(position?: Vec3Like, rotation?: QuatLike): this;
|
|
246
|
+
/** Push the chassis (a boost pad, an explosion) — an instantaneous impulse in kg·m/s. */
|
|
247
|
+
applyImpulse(v: Vec3Like): this;
|
|
248
|
+
private _read;
|
|
249
|
+
/** Speed along the car's forward axis in m/s — negative when reversing (× 3.6 for km/h). */
|
|
250
|
+
get speed(): number;
|
|
251
|
+
/** Engine RPM. */
|
|
252
|
+
get rpm(): number;
|
|
253
|
+
/** How many wheels touch the ground this frame. */
|
|
254
|
+
get wheelsOnGround(): number;
|
|
255
|
+
/** At least one wheel on the ground. */
|
|
256
|
+
get grounded(): boolean;
|
|
257
|
+
/** Chassis velocity in world space, m/s. */
|
|
258
|
+
get velocity(): Vec3;
|
|
259
|
+
/** Chassis angular velocity in world space, rad/s. */
|
|
260
|
+
get angularVelocity(): Vec3;
|
|
261
|
+
/** How fast the car is turning about the vertical, in degrees per second — positive turning RIGHT
|
|
262
|
+
* (the same sense as `steer`). The signal a counter-steer assist reads. */
|
|
263
|
+
get yawRate(): number;
|
|
264
|
+
/**
|
|
265
|
+
* The car's slip angle in degrees: the angle between where the nose points and where the car is
|
|
266
|
+
* actually travelling, positive when it is travelling to the RIGHT of the nose. 0 going straight,
|
|
267
|
+
* ±180 backing up, and past ~10° the rear has stepped out — a drift.
|
|
268
|
+
*/
|
|
269
|
+
get slipAngle(): number;
|
|
270
|
+
/**
|
|
271
|
+
* The angle of the SLIDE, degrees, signed like `slipAngle` (positive = travelling to the right of
|
|
272
|
+
* the nose), −180..180: the angle between the car's axis and where its REAR AXLE travels — the
|
|
273
|
+
* mean of the non-steering wheels (every wheel if all of them steer), its velocity from the
|
|
274
|
+
* body's velocity and spin. Unlike `slipAngle` (the body's, at its centre) this is 0 on a clean
|
|
275
|
+
* corner at ANY speed: at walking pace and full lock the body already travels ~20° off its nose
|
|
276
|
+
* while the rear axle rolls straight along it. It is the rear stepping out — what a gyro comes in
|
|
277
|
+
* on, and what a drift meter should show — and unlike the tires' own `Wheel.slipAngle` it does
|
|
278
|
+
* not fold at 90°: a backward entry reads 110°, not 70°. The axis it is measured from is the one
|
|
279
|
+
* the DRIVETRAIN pushes along — the nose for a positive `ratio`, the tail for a negative one — so
|
|
280
|
+
* honest reversing reads 0, and a car spun round in a forward gear reads past 90°. 0 at a
|
|
281
|
+
* standstill: with no speed a direction is noise, so it fades in over walking pace,
|
|
282
|
+
* `DRIFT_SPEED_FROM`..`DRIFT_SPEED_FULL` of the axle's ground speed.
|
|
283
|
+
*/
|
|
284
|
+
get driftAngle(): number;
|
|
285
|
+
/** Where the steered wheels actually are, in degrees, right-positive: the angle `steer` set, or
|
|
286
|
+
* with `steering.feedback` where the column has come to. */
|
|
287
|
+
get steerAngle(): number;
|
|
288
|
+
/** The tires' self-aligning torque on the steering, N·m, positive = it pulls the wheel to the
|
|
289
|
+
* RIGHT — what the driver feels: heavy at speed, light when the front lets go, and the
|
|
290
|
+
* counter-steer in a slide. Reported with or without a `feedback` wheel: the signal a
|
|
291
|
+
* force-feedback steering wheel is driven by. */
|
|
292
|
+
get steerTorque(): number;
|
|
293
|
+
/** Every Wheel under the chassis, ordered front axle first, with its axle group resolved. */
|
|
294
|
+
private _collectWheels;
|
|
295
|
+
/** Pack the whole configuration into the one blob the host ABI takes (see bridges.d.ts). */
|
|
296
|
+
private _buildSettings;
|
|
297
|
+
/** Edit mode: which way the chassis faces. Each wheel draws its own circle and travel range — see
|
|
298
|
+
* `Wheel.rebuild()`. Play mode never calls this. */
|
|
299
|
+
rebuild(): void;
|
|
300
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { Aspect } from "../../core/Aspect";
|
|
2
|
+
import type { FieldMeta } from "../../core/fields";
|
|
3
|
+
import { Vec3 } from "../../math/vec";
|
|
4
|
+
import { Node } from "../Node";
|
|
5
|
+
/** Floats `vehicleGetState` writes before the per-wheel block: speed, rpm, contacts, vx, vy, vz, wx, wy, wz,
|
|
6
|
+
* steerDeg, steerTorque. */
|
|
7
|
+
export declare const STATE_HEADER = 11;
|
|
8
|
+
/** Floats per wheel: contact, slip, slipAngle, suspensionLength, steerDeg, spin, fLat, fLong, vLat, vSlip, load. */
|
|
9
|
+
export declare const WHEEL_STATE = 11;
|
|
10
|
+
/** Fully compressed = this fraction of `travel` (the engine's one suspension constant, mirrored here
|
|
11
|
+
* so `compression` and the resting-height maths read the same number). */
|
|
12
|
+
export declare const SUSPENSION_MIN_FRACTION = 0.4;
|
|
13
|
+
/** A point on a curve — a tire's friction over slip, an engine's torque over rpm. */
|
|
14
|
+
export type Point = {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
};
|
|
18
|
+
export interface WheelSuspension {
|
|
19
|
+
/** Total travel in metres, full droop to fully compressed (default 0.4). */
|
|
20
|
+
travel?: number;
|
|
21
|
+
/** Spring frequency in Hz — bigger is stiffer (default 1.4; a race car ~2.5, a truck ~1). It also
|
|
22
|
+
* sets the ride-height sag, and the sag is how far the wheel can still extend DOWN. */
|
|
23
|
+
stiffness?: number;
|
|
24
|
+
/** Damping ratio 0..1 (default 0.5). Low values pogo. */
|
|
25
|
+
damping?: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A tire, as the engine takes it: two friction curves and two numbers. `Tire.road()` and the other
|
|
29
|
+
* presets are starting points — copy one and edit, or `Tire.scale()` it.
|
|
30
|
+
*/
|
|
31
|
+
export interface Tire {
|
|
32
|
+
/** Lateral friction over slip ANGLE: `{ x: degrees, y: friction }`, x ascending. Friction is the
|
|
33
|
+
* coefficient the tire's load is multiplied by; the last value holds to 90°. The grip a wheel
|
|
34
|
+
* actually gets is combined with the ground it stands on as `sqrt(tire × groundFriction)`, and a
|
|
35
|
+
* body's friction defaults to 0.6 — a road a car should really corner on wants `Physics { friction: 1 }`. */
|
|
36
|
+
side: Point[];
|
|
37
|
+
/** Longitudinal friction over slip RATIO: `{ x: ratio, y: friction }` (0 = rolling in sync, 1 =
|
|
38
|
+
* locked or spinning freely). */
|
|
39
|
+
forward: Point[];
|
|
40
|
+
/** The longitudinal impulse clamp as a multiple of `friction × load` — for DRIVE only; a braking
|
|
41
|
+
* wheel is always clamped at the physical limit (or a locked rear would stop the car at a full g
|
|
42
|
+
* and kill every handbrake turn). `1` is the physical tire; `road`'s 10 is Jolt's own sample
|
|
43
|
+
* value (it keeps a driven wheel from ever spinning up). Anything a friction circle should bite
|
|
44
|
+
* on wants this near 1. */
|
|
45
|
+
traction?: number;
|
|
46
|
+
/** Friction circle, 0..1: how much of the lateral capacity the longitudinal impulse in use takes
|
|
47
|
+
* away. `0` = the two axes independent (a spinning wheel corners as well as a rolling one);
|
|
48
|
+
* `1` = the full circle — wheelspin or a locked wheel lets go sideways. */
|
|
49
|
+
circle?: number;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Tire presets — fresh point lists every call (editing one never touches another), and `scale`.
|
|
53
|
+
*
|
|
54
|
+
* - `road` — Jolt's stock tire: lateral peak 1.2 at 3° falling to 1.0 by 20° and flat after, the
|
|
55
|
+
* two axes independent, and the longitudinal clamp ×10 (Jolt's own sample runs this; it means a
|
|
56
|
+
* driven wheel practically never spins up). Grippy, glued, hard to unsettle.
|
|
57
|
+
* - `arcade` — the peak held all the way out on both axes: the car does not let go at all.
|
|
58
|
+
* - `drift` — a tire that can be held sideways: lateral grip falls to 0.7 past 25°, the longitudinal
|
|
59
|
+
* clamp is near the physical one (`traction: 2` — a launch at exactly 1 is a 0.4 g crawl; 2 keeps
|
|
60
|
+
* it punchy) so the rear can be spun up, and a friction circle (`circle: 0.85` — most of it, so a
|
|
61
|
+
* spinning rear loses most but not all of its lateral grip and the slide stays progressive):
|
|
62
|
+
* power oversteer, and a slide the throttle keeps alive. A 600 N·m car lights its tires off the
|
|
63
|
+
* line on it; that is the tire, and a traction control is the game's.
|
|
64
|
+
*/
|
|
65
|
+
export declare const Tire: {
|
|
66
|
+
road: () => Tire;
|
|
67
|
+
arcade: () => Tire;
|
|
68
|
+
drift: () => Tire;
|
|
69
|
+
/** Both curves multiplied by `k` — a grip slider, a cold tire, a wet road. A new tire; `t` is untouched. */
|
|
70
|
+
scale: (t: Tire, k: number) => Tire;
|
|
71
|
+
};
|
|
72
|
+
export declare function resolveTire(tire: Tire): ResolvedTire;
|
|
73
|
+
export declare class Wheel extends Aspect<"wheel", Node> {
|
|
74
|
+
static readonly aspect = "wheel";
|
|
75
|
+
/** Wheel radius in metres. Default: measured from the node's rendered bounds, else 0.35. Too small
|
|
76
|
+
* and the car scrapes, too large and it floats. */
|
|
77
|
+
radius?: number;
|
|
78
|
+
/** Wheel width in metres. Default: measured, else 0.25. */
|
|
79
|
+
width?: number;
|
|
80
|
+
/** Axle group, front to back. Default: derived from Z. Set it for a car whose wheels are not in neat
|
|
81
|
+
* left/right pairs — an axle's wheels are paired for the differential and the anti-roll bar. */
|
|
82
|
+
axle?: number;
|
|
83
|
+
/** Does this wheel steer? Default: the wheels on the front axle. */
|
|
84
|
+
steer?: boolean;
|
|
85
|
+
/** This wheel's SHARE of the engine's torque, 0 = not driven. Default: from the vehicle's
|
|
86
|
+
* `driveAxle` (1 on that axle). An axle's share is the sum of its two wheels', the left/right
|
|
87
|
+
* split their ratio, so `0.6` / `0.4` front-to-rear is `driven: 0.3` on each front wheel and
|
|
88
|
+
* `0.2` on each rear. Structural: baked at attach. */
|
|
89
|
+
driven?: number;
|
|
90
|
+
suspension: WheelSuspension;
|
|
91
|
+
/** The tire (default `Tire.road()`). Live: re-assign it or re-configure the aspect and the car
|
|
92
|
+
* retunes in place — a grip slider, a tire that heats up. */
|
|
93
|
+
tire: Tire;
|
|
94
|
+
/** INPUT: brake torque on this wheel THIS frame, N·m (default 0). Sticky, like `Vehicle.throttle`:
|
|
95
|
+
* write it every frame from a driver system's `updateBefore` — the foot brake's share, the
|
|
96
|
+
* handbrake's 4500 on a rear wheel, an ABS's pulses — and the same physics step applies it. A
|
|
97
|
+
* braking wheel is clamped at the physical tire limit (the `traction` boost is for drive only). */
|
|
98
|
+
brake: number;
|
|
99
|
+
/** Scene-editor inspector. `steer` / `driven` are deliberately absent: they are tri-state
|
|
100
|
+
* (undefined = derive it from the axle), which a slider cannot express. */
|
|
101
|
+
static fields: FieldMeta<Wheel>;
|
|
102
|
+
static editor: {
|
|
103
|
+
rebuild: boolean;
|
|
104
|
+
};
|
|
105
|
+
onDetach(): void;
|
|
106
|
+
/** Re-configuring a wheel on a live car retunes the car: the tire is live; size, suspension, the
|
|
107
|
+
* driven share and the axle are structural (re-attach the Vehicle). */
|
|
108
|
+
onReconfigure(): void;
|
|
109
|
+
private _state;
|
|
110
|
+
/** Touching the ground this step. */
|
|
111
|
+
get contact(): boolean;
|
|
112
|
+
/** Longitudinal slip RATIO, signed: 0 = rolling in sync with the ground, towards +1 = spinning up
|
|
113
|
+
* (wheelspin), towards −1 = locking under braking — whichever way the car travels. Smoke, tire
|
|
114
|
+
* marks, wheelspin sound and traction control key off this. */
|
|
115
|
+
get slip(): number;
|
|
116
|
+
/** Slip ANGLE in degrees, signed: how far the tire's travel direction is off from where it points,
|
|
117
|
+
* positive when the contact patch slides to the tire's RIGHT. Past the curve's peak (~3°) the tire
|
|
118
|
+
* is letting go sideways. */
|
|
119
|
+
get slipAngle(): number;
|
|
120
|
+
/** This wheel's steer angle in degrees, right-positive. */
|
|
121
|
+
get steerAngle(): number;
|
|
122
|
+
/** Wheel spin in rad/s (× radius ≈ the speed the tire is laying down). Forward-positive; a model
|
|
123
|
+
* turns about the right-hand axle by MINUS the integrated angle. */
|
|
124
|
+
get spin(): number;
|
|
125
|
+
/** The tire's lateral force this step, N, positive toward the tire's right — the road pushing the
|
|
126
|
+
* patch back against its slide. */
|
|
127
|
+
get sideForce(): number;
|
|
128
|
+
/** The tire's longitudinal force this step, N, positive pushing the car forward. */
|
|
129
|
+
get forwardForce(): number;
|
|
130
|
+
/** How fast the contact patch slides sideways, m/s, positive to the tire's right. */
|
|
131
|
+
get sideSlipSpeed(): number;
|
|
132
|
+
/** How fast the tread runs over the road, m/s, positive spinning up, negative locking. Force ×
|
|
133
|
+
* sliding speed (`|sideForce × sideSlipSpeed| + |forwardForce × slipSpeed|`) is the friction's
|
|
134
|
+
* heat into the tread, W — a tire-temperature model integrates it. */
|
|
135
|
+
get slipSpeed(): number;
|
|
136
|
+
/** The suspension's force on the wheel this step, N — the tire's LOAD (0 in the air). What a
|
|
137
|
+
* friction budget divides by: `hypot(sideForce, forwardForce) / (load × μ)`. */
|
|
138
|
+
get load(): number;
|
|
139
|
+
/** Suspension compression, 0 = fully extended (drooping) … 1 = fully compressed. */
|
|
140
|
+
get compression(): number;
|
|
141
|
+
/** Where the wheel's centre is right now, in CHASSIS space: the suspension's attachment point,
|
|
142
|
+
* down by however far it hangs this step. Put a wheel model here (see the file header). */
|
|
143
|
+
get position(): Vec3;
|
|
144
|
+
/** Edit mode: this wheel's own circle at its resting height, its travel range, and a mark when the
|
|
145
|
+
* engine drives it — enough to place a wheel without running the game. */
|
|
146
|
+
rebuild(): void;
|
|
147
|
+
}
|
package/dist/types/inject.d.ts
CHANGED
|
@@ -23,6 +23,10 @@ export { WebSocket } from "./runtime/net";
|
|
|
23
23
|
export { Net, NetPlayer, Replicated, NetEntity, type NetMessage, type NetRole, type NetStatus, type NetEvents, type NetLaunch, type NetInput, type NetKind, type NetTransform } from "./net";
|
|
24
24
|
export { __rpc, __channel, __serverOnly, RpcError, type ClientChannel } from "./runtime/rpc";
|
|
25
25
|
export { AudioPlayer, VideoPlayer } from "./runtime/media";
|
|
26
|
+
export { Sound, type SoundOptions } from "./audio/Sound";
|
|
27
|
+
export { Voice, type VoiceEvents } from "./audio/Voice";
|
|
28
|
+
export { Bus, REVERB_PRESETS, type ReverbPreset, type ReverbParams, type EchoParams } from "./audio/Bus";
|
|
29
|
+
export { audio, type PlaySoundOptions, type SpatialOptions, type Rolloff, type AudioStats } from "./audio/audio";
|
|
26
30
|
export { openFilePicker, files, type FileData } from "./runtime/files";
|
|
27
31
|
export { share } from "./runtime/share";
|
|
28
32
|
export { ClickEvent, TouchStartEvent, LongPressEvent } from "./runtime/touch";
|
|
@@ -81,21 +85,24 @@ export { Scene, ARScene, VRScene } from "./gl/Scene";
|
|
|
81
85
|
export { Node } from "./gl/Node";
|
|
82
86
|
export { Mesh } from "./gl/Mesh";
|
|
83
87
|
export { Model } from "./gl/Model";
|
|
84
|
-
export { Shape } from "./gl/Shape";
|
|
85
|
-
export { Physics } from "./gl/Physics";
|
|
86
|
-
export { Trigger } from "./gl/Trigger";
|
|
87
|
-
export {
|
|
88
|
-
export {
|
|
89
|
-
export
|
|
90
|
-
export {
|
|
91
|
-
export {
|
|
92
|
-
export type {
|
|
93
|
-
export
|
|
94
|
-
export {
|
|
88
|
+
export { Shape } from "./gl/physics/Shape";
|
|
89
|
+
export { Physics } from "./gl/physics/Physics";
|
|
90
|
+
export { Trigger } from "./gl/physics/Trigger";
|
|
91
|
+
export { AudioSource, type AudioCone } from "./gl/audio/AudioSource";
|
|
92
|
+
export { AudioZone } from "./gl/audio/AudioZone";
|
|
93
|
+
export { SceneAudio } from "./gl/audio/SceneAudio";
|
|
94
|
+
export { CharacterController } from "./gl/physics/CharacterController";
|
|
95
|
+
export { Vehicle } from "./gl/vehicle/Vehicle";
|
|
96
|
+
export type { DriveLayout, DifferentialMode, EngineConfig, SteeringConfig, SteeringFeedback, SteeringDriver, AeroConfig } from "./gl/vehicle/Vehicle";
|
|
97
|
+
export { Wheel, Tire, resolveTire } from "./gl/vehicle/Wheel";
|
|
98
|
+
export { Ragdoll } from "./gl/physics/Ragdoll";
|
|
99
|
+
export type { RagdollPart, RagdollHinge } from "./gl/physics/Ragdoll";
|
|
100
|
+
export type { Point, WheelSuspension } from "./gl/vehicle/Wheel";
|
|
95
101
|
export { AnimationClip } from "./gl/animation/AnimationClip";
|
|
96
102
|
export type { ClipDef, ClipTrackDef, ClipKey } from "./gl/animation/AnimationClip";
|
|
97
103
|
export { Animator } from "./gl/animation/Animator";
|
|
98
104
|
export type { LodMode } from "./gl/animation/Animator";
|
|
105
|
+
export type { TrianglePick } from "./gl/Model";
|
|
99
106
|
export { Feet } from "./gl/animation/Feet";
|
|
100
107
|
export type { FeetOptions, FootState } from "./gl/animation/Feet";
|
|
101
108
|
export { Warp } from "./gl/animation/Warp";
|
|
@@ -104,25 +111,30 @@ export { Playback } from "./gl/animation/Playback";
|
|
|
104
111
|
export { Loop } from "./gl/animation/Loop";
|
|
105
112
|
export { Layer } from "./gl/animation/Layer";
|
|
106
113
|
export type { PlayOptions, StopOptions, LayerOptions, LoopOptions, LoopDef, BlendPosition, BlendMember, ActiveClip, ClipInfo, ClipCycle, ClipAlign, KneeAxisReport, StepHandler, ClipEventHandler } from "./gl/animation/core";
|
|
107
|
-
export { IK } from "./gl/IK";
|
|
108
|
-
export
|
|
114
|
+
export { IK } from "./gl/animation/IK";
|
|
115
|
+
export { DynamicBone, DynamicBoneCollider } from "./gl/animation/DynamicBone";
|
|
116
|
+
export type { DynamicBoneCurve, DynamicBoneFloor, DynamicBoneColliders } from "./gl/animation/DynamicBone";
|
|
117
|
+
export type { IKTwoBone, IKLookAt } from "./gl/animation/IK";
|
|
109
118
|
export { Light } from "./gl/Light";
|
|
110
119
|
export { Lightmap } from "./gl/Lightmap";
|
|
111
|
-
export { Terrain } from "./gl/Terrain";
|
|
112
|
-
export type { TerrainOptions, TerrainLayer, TerrainRegion, ConformOptions, RibbonOptions, AutoPaintRules, SculptOptions, TerrainHit, TerrainSnapshot } from "./gl/Terrain";
|
|
113
|
-
export { NavMesh, NavCrowd } from "./gl/NavMesh";
|
|
114
|
-
export type { NavMeshLoadOptions, NavMeshInfo, NavPath, NavQueryOptions, NavRaycastHit, NavAgentSize } from "./gl/NavMesh";
|
|
115
|
-
export { NavAgent } from "./gl/NavAgent";
|
|
116
|
-
export type { NavAgentState, NavAgentAvoidance, NavAgentDrive, NavAgentEvents } from "./gl/NavAgent";
|
|
117
|
-
export { Locomotion } from "./gl/Locomotion";
|
|
118
|
-
export type { LocomotionSet, LocomotionClip, LocomotionTuning, LocomotionState, LocomotionEvents, Displacement, Gait } from "./gl/Locomotion";
|
|
120
|
+
export { Terrain } from "./gl/terrain/Terrain";
|
|
121
|
+
export type { TerrainOptions, TerrainLayer, TerrainRegion, ConformOptions, RibbonOptions, AutoPaintRules, SculptOptions, TerrainHit, TerrainSnapshot } from "./gl/terrain/Terrain";
|
|
122
|
+
export { NavMesh, NavCrowd } from "./gl/nav/NavMesh";
|
|
123
|
+
export type { NavMeshLoadOptions, NavMeshInfo, NavPath, NavQueryOptions, NavRaycastHit, NavAgentSize } from "./gl/nav/NavMesh";
|
|
124
|
+
export { NavAgent } from "./gl/nav/NavAgent";
|
|
125
|
+
export type { NavAgentState, NavAgentAvoidance, NavAgentDrive, NavAgentEvents } from "./gl/nav/NavAgent";
|
|
126
|
+
export { Locomotion } from "./gl/animation/Locomotion";
|
|
127
|
+
export type { LocomotionSet, LocomotionClip, LocomotionTuning, LocomotionState, LocomotionEvents, Displacement, Gait } from "./gl/animation/Locomotion";
|
|
119
128
|
export { Material } from "./gl/Material";
|
|
120
129
|
export { Geometry } from "./gl/Geometry";
|
|
121
130
|
export { InstancedMesh } from "./gl/InstancedMesh";
|
|
122
131
|
export type { InstanceTransform } from "./gl/InstancedMesh";
|
|
123
132
|
export { Texture } from "./gl/Texture";
|
|
133
|
+
export type { TextureLoadOptions } from "./gl/Texture";
|
|
124
134
|
export { Camera } from "./gl/Camera";
|
|
125
135
|
export { Ray } from "./gl/Ray";
|
|
126
136
|
export { Plane } from "./gl/Plane";
|
|
127
137
|
export { Noise } from "./gl/Noise";
|
|
128
138
|
export { Particles, Trail, curve, colorCurve } from "./gl/Particles";
|
|
139
|
+
export { DecalSet, DecalTrail } from "./gl/DecalSet";
|
|
140
|
+
export type { DecalOptions, DecalSetOptions, DecalSpawnOptions, DecalPlacement, DecalTrailOptions } from "./gl/DecalSet";
|