bsc_car
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
bsc_car
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->TODO: describe this module.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
qaxis(x: number, y: number, z: number, a: number) → Quat
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| z | number | |
| a | number |
qmul(a: Quat, b: Quat) → Quat
| arg | type | description |
|---|---|---|
| a | Quat | |
| b | Quat |
qypr(yaw: number, pitch: number, roll: number) → Quat
yaw about Y, then pitch about X, then roll about Z
| arg | type | description |
|---|---|---|
| yaw | number | |
| pitch | number | |
| roll | number |
clamp(v: number, lo: number, hi: number) → number
| arg | type | description |
|---|---|---|
| v | number | |
| lo | number | |
| hi | number |
approach(cur: number, target: number, rate: number, dt: number) → number
| arg | type | description |
|---|---|---|
| cur | number | |
| target | number | |
| rate | number | |
| dt | number |
slab(z0: number, y0: number, z1: number, y1: number) → void
the tilt of a flat panel that spans (z0,y0)->(z1,y1); returns pitch + centre + length
| arg | type | description |
|---|---|---|
| z0 | number | |
| y0 | number | |
| z1 | number | |
| y1 | number |
node(parent: any, name: string) → any
Every entity a car is made of is `temporary`: it is rebuilt from this module on every play, so it must never be baked into the scene file.
| arg | type | description |
|---|---|---|
| parent | any | |
| name | string |
setMat(e: any, mat: string) → void
| arg | type | description |
|---|---|---|
| e | any | |
| mat | string |
buildWheel(parent: any, name: string, S: any, outSign: number) → any
| arg | type | description |
|---|---|---|
| parent | any | |
| name | string | |
| S | any | |
| outSign | number |
buildArch(parent: any, S: any, name: string, zc: number, sx: number, mat: string) → void
SHARED BODY FURNITURE
| arg | type | description |
|---|---|---|
| parent | any | |
| S | any | |
| name | string | |
| zc | number | |
| sx | number | |
| mat | string |
buildInterior(parent: any, S: any) → void
| arg | type | description |
|---|---|---|
| parent | any | |
| S | any |
buildDriverDummy(parent: any, S: any) → any
| arg | type | description |
|---|---|---|
| parent | any | |
| S | any |
buildSedan(body: any, S: any, lamps: any, deform: { any }) → void
THE SEDAN BODY — the Ryusei, the Cresta and the patrol car
| arg | type | description |
|---|---|---|
| body | any | |
| S | any | |
| lamps | any | |
| deform | { any } |
buildDoor(body: any, S: any) → any
the driver's door, hinged at the A pillar, on the +X (right-hand-drive) side
| arg | type | description |
|---|---|---|
| body | any | |
| S | any |
buildBoxVehicle(body: any, S: any, lamps: any, deform: { any }) → void
THE KEI TRUCK AND THE VAN
| arg | type | description |
|---|---|---|
| body | any | |
| S | any | |
| lamps | any | |
| deform | { any } |
makeClip(name: string, gen: () → void
the clip library is addressed by NAME: the Audio component resolves the identity itself, which keeps every reference in this file a static literal. `gen` is only called when the clip has to be synthesised, so re-checking the library after a hot reload costs eight existence probes rather than a second of DSP.
| arg | type | description |
|---|---|---|
| name | string | |
| gen | ( |
pcmEngine( ) → void
a four-cylinder note whose every term is periodic over one cycle, so the loop has no seam (loop points are not read back by playback — #8874)
pcmSkid( ) → void
pcmDoorOpen( ) → void
pcmDoorShut( ) → void
pcmStart( ) → void
pcmImpact( ) → void
pcmHorn( ) → void
pcmKerb( ) → void
buildClips( ) → void
spawnCar(kind: string, x: number, z: number, yaw: number) → any
| arg | type | description |
|---|---|---|
| kind | string | |
| x | number | |
| z | number | |
| yaw | number |
YIELD( ) → void
recOf(car: any) → any
| arg | type | description |
|---|---|---|
| car | any |
nearestCar(x: number, z: number, radius: number) → any
| arg | type | description |
|---|---|---|
| x | number | |
| z | number | |
| radius | number |
speed( ) → number
heroCar( ) → any
confine(x: number, z: number, ex: number, ez: number) → void
clamp a car centre into the union of the corridors; returns cx, cz, hit, corridor
| arg | type | description |
|---|---|---|
| x | number | |
| z | number | |
| ex | number | |
| ez | number |
scatter(rec: any, x: number, y: number, z: number, energy: number) → void
| arg | type | description |
|---|---|---|
| rec | any | |
| x | number | |
| y | number | |
| z | number | |
| energy | number |
updateDebris(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
applyDeform(rec: any) → void
DAMAGE
| arg | type | description |
|---|---|---|
| rec | any |
playerBody( ) → any
ENTER / EXIT
heroControl(on: boolean) → void
| arg | type | description |
|---|---|---|
| on | boolean |
heroAnim(name: string) → void
| arg | type | description |
|---|---|---|
| name | string |
oneShot(rec: any, clip: any, vol: number, pitch: number) → void
| arg | type | description |
|---|---|---|
| rec | any | |
| clip | any | |
| vol | number | |
| pitch | number |
seatWorld(rec: any) → void
world position of the driver's seat / of the spot beside the door
| arg | type | description |
|---|---|---|
| rec | any |
doorWorld(rec: any) → void
| arg | type | description |
|---|---|---|
| rec | any |
enter(car: any) → boolean
| arg | type | description |
|---|---|---|
| car | any |
exit( ) → boolean
stepSequence(rec: any, dt: number) → void
| arg | type | description |
|---|---|---|
| rec | any | |
| dt | number |
driveTo(car: any, x: number, z: number, opts: any?) → boolean
AI (the life slice steers its patrols through this)
| arg | type | description |
|---|---|---|
| car | any | |
| x | number | |
| z | number | |
| opts | any? |
releaseAi(car: any) → void
| arg | type | description |
|---|---|---|
| car | any |
setSiren(car: any, on: boolean) → void
| arg | type | description |
|---|---|---|
| car | any | |
| on | boolean |
aiControl(rec: any, dt: number) → void
| arg | type | description |
|---|---|---|
| rec | any | |
| dt | number |
integrate(rec: any, dt: number) → void
| arg | type | description |
|---|---|---|
| rec | any | |
| dt | number |
axleCircles(rec: any) → void
A car is 4.2 m by 1.7 m; one circle round it is far too fat to squeeze past anything on a 6 m lane, so each is two circles, one over each axle.
| arg | type | description |
|---|---|---|
| rec | any |
hitStatic(rec: any) → void
| arg | type | description |
|---|---|---|
| rec | any |
separate( ) → void
present(rec: any, dt: number) → void
PRESENTATION — weight transfer, suspension, wheels, lamps, sound
| arg | type | description |
|---|---|---|
| rec | any | |
| dt | number |
pressed(k: string) → boolean
| arg | type | description |
|---|---|---|
| k | string |
driverInput(rec: any, dt: number) → void
| arg | type | description |
|---|---|---|
| rec | any | |
| dt | number |
despawnMine( ) → void
BUILD / UPDATE
build( ) → void
rebuild( ) → void
update(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.