lecodes-sdk 0.20.2 → 1.1.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 +35 -9
- package/dist/types/animate/tween/Animation.d.ts +69 -0
- package/dist/types/animate/tween/Timeline.d.ts +55 -0
- package/dist/types/animate/tween/animateValue.d.ts +27 -0
- package/dist/types/animate/tween/easing.d.ts +29 -0
- package/dist/types/animate/tween/spec.d.ts +178 -0
- package/dist/types/canvas/Canvas.d.ts +2 -0
- package/dist/types/g2/Node2D.d.ts +16 -0
- package/dist/types/g2/Sprite.d.ts +11 -1
- package/dist/types/gl/Camera.d.ts +15 -1
- package/dist/types/gl/DecalSet.d.ts +48 -3
- package/dist/types/gl/Foliage.d.ts +47 -0
- package/dist/types/gl/Geometry.d.ts +36 -0
- package/dist/types/gl/Light.d.ts +25 -7
- package/dist/types/gl/Lightmap.d.ts +90 -51
- package/dist/types/gl/Material.d.ts +32 -20
- package/dist/types/gl/Mesh.d.ts +7 -1
- package/dist/types/gl/Model.d.ts +41 -5
- package/dist/types/gl/Node.d.ts +18 -0
- package/dist/types/gl/Particles.d.ts +53 -1
- package/dist/types/gl/Scene.d.ts +21 -1
- package/dist/types/gl/animation/AnimationClip.d.ts +19 -0
- package/dist/types/gl/animation/Animator.d.ts +27 -0
- package/dist/types/gl/animation/DynamicBone.d.ts +184 -0
- package/dist/types/gl/animation/IK.d.ts +109 -0
- package/dist/types/gl/{Locomotion.d.ts → animation/Locomotion.d.ts} +6 -6
- package/dist/types/gl/animation/Warp.d.ts +2 -1
- package/dist/types/gl/animation/core.d.ts +35 -4
- package/dist/types/gl/{AudioSource.d.ts → audio/AudioSource.d.ts} +6 -6
- package/dist/types/gl/{AudioZone.d.ts → audio/AudioZone.d.ts} +4 -4
- package/dist/types/gl/{SceneAudio.d.ts → audio/SceneAudio.d.ts} +1 -1
- 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/physics/Ragdoll.d.ts +161 -0
- 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/{Terrain.d.ts → terrain/Terrain.d.ts} +10 -8
- 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 +35 -27
- package/dist/types/runtime/files.d.ts +24 -1
- package/dist/types/scene/defineScene.d.ts +50 -31
- package/dist/types/ui/UIButton.d.ts +3 -1
- package/dist/types/ui/UIInput.d.ts +5 -1
- package/dist/types/ui/UINode.d.ts +24 -24
- package/dist/types.json +1 -1
- package/package.json +1 -1
- package/prompts/README.md +142 -142
- package/prompts/core-design.md +27 -4
- package/prompts/core.md +35 -6
- package/prompts/select.ts +19 -4
- package/src/animate/tween/Animation.ts +378 -0
- package/src/animate/tween/Timeline.ts +175 -0
- package/src/animate/tween/animateValue.ts +100 -0
- package/src/animate/tween/easing.ts +172 -0
- package/src/animate/tween/spec.ts +479 -0
- package/src/bridges.d.ts +1760 -1481
- package/src/canvas/Canvas.ts +21 -0
- package/src/compile/__tests__/assetMacro.test.ts +26 -0
- package/src/compile/__tests__/compile.test.ts +11 -0
- package/src/compile/__tests__/detectEntry.test.ts +19 -0
- package/src/compile/__tests__/serverSplit.test.ts +27 -0
- package/src/compile/bundler.ts +34 -4
- package/src/compile/compileProject.ts +31 -1
- package/src/compile/detectEntry.ts +8 -3
- package/src/compile/header.ts +6 -3
- package/src/compile/index.ts +3 -0
- package/src/compile/sceneEditor.ts +42 -1
- package/src/compile/serverSplit.ts +9 -3
- package/src/g2/Node2D.ts +38 -0
- package/src/g2/Sprite.ts +20 -1
- package/src/gl/Camera.ts +34 -1
- package/src/gl/DecalSet.ts +132 -5
- package/src/gl/Foliage.ts +102 -0
- package/src/gl/Geometry.ts +109 -0
- package/src/gl/Light.ts +46 -16
- package/src/gl/Lightmap.ts +440 -249
- package/src/gl/Material.ts +69 -36
- package/src/gl/Mesh.ts +120 -102
- package/src/gl/Model.ts +167 -124
- package/src/gl/Node.ts +40 -1
- package/src/gl/Particles.ts +82 -5
- package/src/gl/Scene.ts +35 -2
- package/src/gl/animation/AnimationClip.ts +52 -0
- package/src/gl/animation/Animator.ts +42 -2
- package/src/gl/animation/DynamicBone.ts +482 -0
- package/src/gl/animation/IK.ts +214 -0
- package/src/gl/{Locomotion.ts → animation/Locomotion.ts} +7 -7
- package/src/gl/animation/Playback.ts +5 -4
- package/src/gl/animation/Warp.ts +5 -2
- package/src/gl/animation/core.ts +65 -4
- package/src/gl/{AudioSource.ts → audio/AudioSource.ts} +7 -7
- package/src/gl/{AudioZone.ts → audio/AudioZone.ts} +75 -75
- package/src/gl/{SceneAudio.ts → audio/SceneAudio.ts} +2 -2
- 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/physics/Ragdoll.ts +451 -0
- package/src/gl/{Shape.ts → physics/Shape.ts} +3 -3
- package/src/gl/{Trigger.ts → physics/Trigger.ts} +45 -45
- package/src/gl/{physicsEvents.ts → physics/physicsEvents.ts} +1 -1
- package/src/gl/{Terrain.ts → terrain/Terrain.ts} +14 -12
- 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 +236 -224
- package/src/runtime/files.ts +32 -2
- package/src/scene/defineScene.ts +92 -66
- package/src/scene/level.ts +2 -2
- package/src/ui/UIButton.ts +2 -2
- package/src/ui/UIInput.ts +3 -3
- package/src/ui/UINode.ts +61 -36
- package/dist/types/animate/animate.d.ts +0 -20
- package/dist/types/gl/Gearbox.d.ts +0 -86
- package/dist/types/gl/IK.d.ts +0 -53
- package/dist/types/gl/Ragdoll.d.ts +0 -86
- package/dist/types/gl/Vehicle.d.ts +0 -191
- package/dist/types/gl/Wheel.d.ts +0 -95
- package/src/animate/animate.ts +0 -238
- package/src/gl/Gearbox.ts +0 -212
- package/src/gl/IK.ts +0 -193
- package/src/gl/Ragdoll.ts +0 -270
- 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 Vec3Like } from "
|
|
1
|
+
import { Aspect } from "../../core/Aspect";
|
|
2
|
+
import type { FieldMeta } from "../../core/fields";
|
|
3
|
+
import { Vec3, type Vec3Like } from "../../math/vec";
|
|
4
4
|
import { NavCrowd } from "./NavMesh";
|
|
5
|
-
import type { Node } from "
|
|
5
|
+
import type { Node } from "../Node";
|
|
6
6
|
export type NavAgentState = "idle" | "moving" | "arrived" | "blocked" | "offmesh";
|
|
7
7
|
export type NavAgentAvoidance = "off" | "low" | "medium" | "high";
|
|
8
8
|
export type NavAgentDrive = "position" | "controller";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { System } from "
|
|
2
|
-
import { Vec3, type Vec3Like } from "
|
|
3
|
-
import type { Node } from "
|
|
4
|
-
import type { Scene } from "
|
|
1
|
+
import { System } from "../../core/Aspect";
|
|
2
|
+
import { Vec3, type Vec3Like } from "../../math/vec";
|
|
3
|
+
import type { Node } from "../Node";
|
|
4
|
+
import type { Scene } from "../Scene";
|
|
5
5
|
export declare const NAV_AGENT: {
|
|
6
6
|
readonly RADIUS: 0;
|
|
7
7
|
readonly HEIGHT: 1;
|
|
@@ -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. */
|
|
@@ -0,0 +1,161 @@
|
|
|
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
|
+
export interface RagdollHinge {
|
|
6
|
+
/** The hinge axis in the MODEL's space (its rest pose: +Z forward, +Y up, +X the model's left in
|
|
7
|
+
* glTF). Perpendicular to the bone; the engine drops any component along it. */
|
|
8
|
+
axis: Vec3Like;
|
|
9
|
+
/** The bend range about `axis` in degrees, relative to the pose the ragdoll was built in — a knee
|
|
10
|
+
* is `{ axis: [1, 0, 0], min: 0, max: 140 }`: it folds one way only. */
|
|
11
|
+
min: number;
|
|
12
|
+
max: number;
|
|
13
|
+
}
|
|
14
|
+
export interface RagdollPart {
|
|
15
|
+
/** The bone the body sits on — its origin is the joint. */
|
|
16
|
+
bone: string;
|
|
17
|
+
/** The bone the capsule points at (the next joint down). Omitted = a leaf: `length` along the line
|
|
18
|
+
* from the parent part's origin (a head, a hand, a foot without toes). */
|
|
19
|
+
to?: string;
|
|
20
|
+
/** The bone of the part this one hangs from (default: the previous part in the list). The root
|
|
21
|
+
* has none. */
|
|
22
|
+
parent?: string;
|
|
23
|
+
/** Capsule radius in metres (default 0.05). */
|
|
24
|
+
radius?: number;
|
|
25
|
+
/** Length in metres: a leaf's, or an override of the distance to `to`. */
|
|
26
|
+
length?: number;
|
|
27
|
+
/** This part's share of the ragdoll's `mass` (relative weight, default 1). */
|
|
28
|
+
mass?: number;
|
|
29
|
+
/** Cone half-angle in degrees the part may swing off its parent (default 30). Ignored with `hinge`. */
|
|
30
|
+
swing?: number;
|
|
31
|
+
/** Twist half-angle in degrees about its own axis (default 20). */
|
|
32
|
+
twist?: number;
|
|
33
|
+
/** A one-way joint instead of the cone. */
|
|
34
|
+
hinge?: RagdollHinge;
|
|
35
|
+
}
|
|
36
|
+
/** How the body lies: on its back (the chest points up), prone (the chest points down), or on a side. */
|
|
37
|
+
export type RagdollFacing = "up" | "down" | "side";
|
|
38
|
+
export interface RagdollActivateOptions {
|
|
39
|
+
/** A LAUNCH added to every part's own motion (world m/s) — an explosion, a throw. The bones' own
|
|
40
|
+
* motion (the run, the swinging arms) is measured by the engine and needs no help. */
|
|
41
|
+
velocity?: Vec3Like;
|
|
42
|
+
/** The motors' strength from the first step (default: the current `strength`). */
|
|
43
|
+
strength?: number;
|
|
44
|
+
/** The root anchored to the animation from the first step (default: the current `anchored`). */
|
|
45
|
+
anchored?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface RagdollDeactivateOptions {
|
|
48
|
+
/** Seconds the animator takes to transition OUT of the fallen pose into whatever plays next (a
|
|
49
|
+
* get-up take started right after, or the loop). 0 (default) = a cut. Move the model node under
|
|
50
|
+
* the hips before this call: the bones are handed back against its new transform. */
|
|
51
|
+
blend?: number;
|
|
52
|
+
}
|
|
53
|
+
export interface RagdollHitOptions {
|
|
54
|
+
/** How long the body stays powered before the bones go back to the animator (s, default 0.6). */
|
|
55
|
+
duration?: number;
|
|
56
|
+
/** The transition out of the reaction's last physical pose (s, default 0.25). */
|
|
57
|
+
blend?: number;
|
|
58
|
+
/** The motors' strength during the reaction (default 1). */
|
|
59
|
+
strength?: number;
|
|
60
|
+
}
|
|
61
|
+
export declare class Ragdoll extends Aspect<"ragdoll", Node> {
|
|
62
|
+
static readonly aspect = "ragdoll";
|
|
63
|
+
/** The parts: `'humanoid'` (default) finds the standard bones by name; a list places bodies on any
|
|
64
|
+
* bones — parents before children. */
|
|
65
|
+
parts: RagdollPart[] | "humanoid";
|
|
66
|
+
/** Total mass in kg (default 70), split between the parts by their `mass` shares. */
|
|
67
|
+
mass: number;
|
|
68
|
+
/** Friction of every part (default 0.6 — the physics default). */
|
|
69
|
+
friction: number;
|
|
70
|
+
/** Linear / angular damping of every part; 0 = Jolt's own 0.05. More angular damping settles a
|
|
71
|
+
* flailing body sooner. */
|
|
72
|
+
linearDamping: number;
|
|
73
|
+
angularDamping: number;
|
|
74
|
+
/** What the parts collide with. `'static'` (default): the static geometry and other such ragdolls
|
|
75
|
+
* only — dynamic bodies, character controllers and vehicles pass through a fallen body, which then
|
|
76
|
+
* never shoves or blocks anything and costs nothing when they meet. `'all'`: a regular dynamic
|
|
77
|
+
* body that bumps into everything (and gets kicked awake by everything). */
|
|
78
|
+
collide: "static" | "all";
|
|
79
|
+
/** Once every part of a LIMP body has come to rest the parts turn static where they lie (default
|
|
80
|
+
* true): the pose holds, nothing can wake a settled body and it costs the solver nothing —
|
|
81
|
+
* `deactivate()` / `activate()` still work (activate makes it dynamic again). A driven or anchored
|
|
82
|
+
* body never freezes. */
|
|
83
|
+
freeze: boolean;
|
|
84
|
+
/** Seconds limp after which the body freezes whatever it is doing — a twitch on a slope or a pile
|
|
85
|
+
* never sleeps on its own. 0 (default) = no cap. */
|
|
86
|
+
freezeAfter: number;
|
|
87
|
+
/** The joint motors: the position spring's frequency in Hz (default 6 — higher = a stiffer, quicker
|
|
88
|
+
* return to the animated pose) and damping ratio (default 1 = critical, no overshoot). */
|
|
89
|
+
driveFrequency: number;
|
|
90
|
+
driveDamping: number;
|
|
91
|
+
/** The motors' torque limit at strength 1, in N·m per kg of the part (default 12: ~180 N·m at the
|
|
92
|
+
* hips of an 80 kg body, ~25 at a forearm). Lower = a hit displaces a limb more before the
|
|
93
|
+
* animation wins it back. */
|
|
94
|
+
driveTorque: number;
|
|
95
|
+
/** Joint friction in N·m per kg of the part (default 0.3): a torque that resists any joint motion,
|
|
96
|
+
* motor or not — a limp body folds instead of flopping like jelly. */
|
|
97
|
+
jointFriction: number;
|
|
98
|
+
/** Where the joint limits come from. `'clips'` (default): measured from the animation — at the first
|
|
99
|
+
* activation that finds clips on the model's animator, every joint's swing and twist range over
|
|
100
|
+
* every bound clip becomes its limit (plus `limitsMargin` on each side), so the motors never
|
|
101
|
+
* target a pose the limits forbid and a limp body settles into poses the clips use; until clips
|
|
102
|
+
* are bound the part table's cones apply. `'table'`: the part table's cones and hinges only. */
|
|
103
|
+
limits: "clips" | "table";
|
|
104
|
+
/** Degrees added on each side of a learned range (default 10). */
|
|
105
|
+
limitsMargin: number;
|
|
106
|
+
static fields: FieldMeta<Ragdoll>;
|
|
107
|
+
private _id;
|
|
108
|
+
private _active;
|
|
109
|
+
private _bones;
|
|
110
|
+
private _strength;
|
|
111
|
+
private _anchored;
|
|
112
|
+
private _hipsFwd;
|
|
113
|
+
private _hipsUp;
|
|
114
|
+
private _ramp;
|
|
115
|
+
private _release;
|
|
116
|
+
onAttach(): void;
|
|
117
|
+
onDetach(): void;
|
|
118
|
+
/** Hand the bones to physics from the pose they are in right now, each moving as it did over the
|
|
119
|
+
* last two frames (the engine measures: a runner keeps travelling, a swinging arm keeps swinging). */
|
|
120
|
+
activate(opts?: RagdollActivateOptions): boolean;
|
|
121
|
+
/** Take the bones back: the animator's pose shows again from the next frame — through a `blend`
|
|
122
|
+
* out of the fallen pose when asked (play the get-up take right after, with its own fade: it
|
|
123
|
+
* starts from where the body lies). */
|
|
124
|
+
deactivate(opts?: RagdollDeactivateOptions): void;
|
|
125
|
+
/** Physics owns the bones right now. */
|
|
126
|
+
get active(): boolean;
|
|
127
|
+
/** Active and every part asleep (or frozen) — the body has come to rest. */
|
|
128
|
+
get settled(): boolean;
|
|
129
|
+
/** The joint motors' strength, 0..1: how hard every joint is pulled toward the pose the animator
|
|
130
|
+
* shows (0 = off — a limp body). Kept across activations. */
|
|
131
|
+
get strength(): number;
|
|
132
|
+
set strength(v: number);
|
|
133
|
+
/** The hips follow the animation kinematically (the body stands in its clip while physics moves the
|
|
134
|
+
* limbs — hit reactions, a stagger). Off = the hips are a free body (a fall). */
|
|
135
|
+
get anchored(): boolean;
|
|
136
|
+
set anchored(v: boolean);
|
|
137
|
+
/** The joints give way: the strength ramps to 0 over `seconds` and the anchor comes off — a body
|
|
138
|
+
* shot mid-stride keeps its pose for a moment and then collapses, instead of switching off. */
|
|
139
|
+
goLimp(seconds?: number): void;
|
|
140
|
+
/** A flinch: the body powers up anchored to its animation (if it is not already active), the struck
|
|
141
|
+
* part gets the impulse (N·s, at a world point), and after `duration` the bones go back to the
|
|
142
|
+
* animator through `blend`. On a limp body (a corpse) it is just the impulse. */
|
|
143
|
+
hit(bone: string, v: Vec3Like, at?: Vec3Like, opts?: RagdollHitOptions): boolean;
|
|
144
|
+
/** The root part's bone (the hips): where the body is. */
|
|
145
|
+
get root(): Node | null;
|
|
146
|
+
/** How the body lies: `'up'` on its back (the chest points up), `'down'` prone, `'side'` otherwise.
|
|
147
|
+
* Read while it is down, to pick the get-up take. */
|
|
148
|
+
get facing(): RagdollFacing;
|
|
149
|
+
/** Where the head points along the ground, as a yaw in degrees (the model node's `eulerAngles` y
|
|
150
|
+
* that faces that way): where a get-up take that rises head-first ends up facing. A body still
|
|
151
|
+
* upright answers with the way its chest faces. */
|
|
152
|
+
get heading(): number;
|
|
153
|
+
/** The bones that carry a part, in order. */
|
|
154
|
+
get bones(): string[];
|
|
155
|
+
/** The rigid-body id of a part (0 if none) — for the plain body calls. */
|
|
156
|
+
bodyOf(bone: string): number;
|
|
157
|
+
/** Push one part: an impulse in N·s, at a world point (a hit) or through its centre. Wakes the body. */
|
|
158
|
+
impulse(bone: string, v: Vec3Like, at?: Vec3Like): boolean;
|
|
159
|
+
/** The strength ramp (goLimp) and the hit reaction's hand-back. */
|
|
160
|
+
update(dt: number): void;
|
|
161
|
+
}
|
|
@@ -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;
|
|
@@ -1,15 +1,17 @@
|
|
|
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
|
-
/** Albedo texture (a URL / `asset()` handle, or a loaded Texture). Unset = white.
|
|
8
|
+
/** Albedo texture (a URL / `asset()` handle, or a loaded Texture). Unset = white. Its ALPHA is the layer's roughness
|
|
9
|
+
* map (`lecodes assets terrain-pack --roughness` puts it there): an opaque albedo reads 1. */
|
|
9
10
|
albedo?: string | Texture;
|
|
10
11
|
/** Metres per texture repeat. Default 8. */
|
|
11
12
|
tiling?: number;
|
|
12
|
-
/** Perceptual roughness of the layer
|
|
13
|
+
/** Perceptual roughness of the layer — a factor on the albedo's alpha (its roughness map), the whole value when the
|
|
14
|
+
* albedo is opaque. A terrain has no metallic: ground is a dielectric. Default 1. */
|
|
13
15
|
roughness?: number;
|
|
14
16
|
/** Normal-map strength (0 = the layer's slot of the pack is not read). Default 0 — set 1 when the
|
|
15
17
|
* layer has a normal map in `normals`. */
|
|
@@ -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
|
+
}
|