Track
Defined in: packages/engine/src/gameplay/track/track.ts:131
A path an entity rides in track coordinates: a distance along its centerline, an offset across it, and a height above it. Built once from its points, sampled every half metre of arc length.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Track(
points,__namedParameters?):Track
Defined in: packages/engine/src/gameplay/track/track.ts:140
At least two points.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
points |
TrackPoint[] |
__namedParameters |
TrackOptions |
Returns
Section titled “Returns”Track
Accessors
Section titled “Accessors”length
Section titled “length”Get Signature
Section titled “Get Signature”get length():
number
Defined in: packages/engine/src/gameplay/track/track.ts:197
Metres from the start to the end, along the samples.
Returns
Section titled “Returns”number
Methods
Section titled “Methods”frameAt()
Section titled “frameAt()”frameAt(
distance,into?):TrackFrame
Defined in: packages/engine/src/gameplay/track/track.ts:204
The frame distance metres along, clamped to the track, blended
between the two samples either side, written into into: fresh
vectors unless the caller hands its own, as a step does.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
distance |
number |
into |
TrackFrame |
Returns
Section titled “Returns”frictionAt()
Section titled “frictionAt()”frictionAt(
distance,lateral):number
Defined in: packages/engine/src/gameplay/track/track.ts:259
The 1/s its surface costs a grounded mover at distance along and
lateral across: none unless the track was built with friction.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
distance |
number |
lateral |
number |
Returns
Section titled “Returns”number
locate()
Section titled “locate()”locate(
point):object
Defined in: packages/engine/src/gameplay/track/track.ts:270
The track coordinates of a world point: projected on the frame of the nearest sample, so the distance runs on between samples. ponytail: a scan of every sample, about 2000 on a kilometre; a spatial index once something calls this per vertex.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
point |
{ x: number; y: number; z: number; } |
point.x |
number |
point.y |
number |
point.z |
number |
Returns
Section titled “Returns”object
| Name | Type |
|---|---|
distance |
number |
lateral |
number |
pointAt()
Section titled “pointAt()”pointAt(
distance,lateral):Vector3
Defined in: packages/engine/src/gameplay/track/track.ts:228
The world point distance along and lateral across, positive to
the right of the direction of travel.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
distance |
number |
lateral |
number |
Returns
Section titled “Returns”Vector3
zoneWeight()
Section titled “zoneWeight()”zoneWeight(
distance,zone):number
Defined in: packages/engine/src/gameplay/track/track.ts:236
How much of zone the track is at distance, from 0 to 1: its
points’ tags blended from one point to the next, and held past the
ends.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
distance |
number |
zone |
string |
Returns
Section titled “Returns”number