Skip to content

five-on-it / apps/client/src/renderer/remotes / Remotes

Class: Remotes ​

Defined in: apps/client/src/renderer/remotes.ts:662

The set of remote entities.

Constructors ​

Constructor ​

new Remotes(scene, models, pieces?, ragdolls?): Remotes

Defined in: apps/client/src/renderer/remotes.ts:719

ragdolls: the scene's ragdolls, which a person going down goes limp in (none: it lies as its clips say).

Parameters ​

scene ​

Scene

models ​

ActorModels

pieces? ​

ReadonlyMap<number, PieceView> = ...

ragdolls? ​

Ragdolls

Returns ​

Remotes

Properties ​

bark ​

bark: ((x, z) => void) | undefined

Defined in: apps/client/src/renderer/remotes.ts:743

What a dog's new bark is told to: where the dog is on the ground (m). Nothing until the game hands it in (it plays the bark, by how far it is).


companions ​

readonly companions: Companions

Defined in: apps/client/src/renderer/remotes.ts:736

The carts before the street sweepers.


dress ​

dress: CarDress | undefined

Defined in: apps/client/src/renderer/remotes.ts:689

What the cars wear besides their models (their doors, their cracks); nothing until the game hands it in.


glyphs ​

readonly glyphs: Glyphs

Defined in: apps/client/src/renderer/remotes.ts:673

The glyphs over people's heads.


held ​

held: boolean = false

Defined in: apps/client/src/renderer/remotes.ts:715

The snapshots have stopped coming (the server is silent, or gone): every remote stays where it was last seen, standing still (no walk on the spot, no wheel turning).


leads ​

readonly leads: Leads

Defined in: apps/client/src/renderer/remotes.ts:738

The dogs' leads.


predicted ​

predicted: PredictedRemotes | undefined

Defined in: apps/client/src/renderer/remotes.ts:702

The remote cars drawn at the local time near what the player controls; without it every remote is drawn interpolated.


predictedPieces ​

predictedPieces: PredictedPieces | undefined

Defined in: apps/client/src/renderer/remotes.ts:708

The level's light pieces drawn at the local time near what the player controls, where the prediction has them (from the tick it knocks one loose); without it every loose piece is drawn from the snapshots.


seen ​

readonly seen: Set<string>

Defined in: apps/client/src/renderer/remotes.ts:687

Every clip a person's figure has shown, for the tests.


sight ​

sight: number = 1

Defined in: apps/client/src/renderer/remotes.ts:1055

The share of their sight the guards keep for the player now (the dark, the weather): their cones are drawn that long.

Accessors ​

boxed ​

Get Signature ​

get boxed(): number

Defined in: apps/client/src/renderer/remotes.ts:763

Cars, trailers and people on screen still drawn as boxes.

Returns ​

number


cones ​

Get Signature ​

get cones(): number

Defined in: apps/client/src/renderer/remotes.ts:1064

View cones drawn right now.

Returns ​

number


dogs ​

Get Signature ​

get dogs(): number

Defined in: apps/client/src/renderer/remotes.ts:778

Dogs on screen, alive or dead.

Returns ​

number


ghosts ​

Get Signature ​

get ghosts(): number

Defined in: apps/client/src/renderer/remotes.ts:839

Players drawn as ghosts on screen (just back from lying dead).

Returns ​

number


hostiles ​

Get Signature ​

get hostiles(): number

Defined in: apps/client/src/renderer/remotes.ts:834

Enemy NPCs on screen, alive and in their own colour.

Returns ​

number


knockedDown ​

Get Signature ​

get knockedDown(): number

Defined in: apps/client/src/renderer/remotes.ts:822

People lying knocked down on screen (the dead slumped in a car's seat aside, and the dogs).

Returns ​

number


loose ​

Get Signature ​

get loose(): number

Defined in: apps/client/src/renderer/remotes.ts:753

Light pieces of the level lying loose on screen.

Returns ​

number


modelled ​

Get Signature ​

get modelled(): number

Defined in: apps/client/src/renderer/remotes.ts:758

Cars, trailers and people on screen wearing their model.

Returns ​

number


officers ​

Get Signature ​

get officers(): number

Defined in: apps/client/src/renderer/remotes.ts:844

Police officers on screen, on their feet or seated, alive.

Returns ​

number


pedestrians ​

Get Signature ​

get pedestrians(): number

Defined in: apps/client/src/renderer/remotes.ts:773

Pedestrians on screen (the dogs aside: they are no people).

Returns ​

number


players ​

Get Signature ​

get players(): number

Defined in: apps/client/src/renderer/remotes.ts:768

Other players' cars, trailers and characters on screen.

Returns ​

number


policeCars ​

Get Signature ​

get policeCars(): number

Defined in: apps/client/src/renderer/remotes.ts:849

Police cars on screen, not wrecked.

Returns ​

number


policeSpots ​

Get Signature ​

get policeSpots(): object[]

Defined in: apps/client/src/renderer/remotes.ts:859

Where the police cars on screen stand (not wrecked), on the ground; one not placed yet (nothing drawn of it before its first measurement's tick) is not on screen.

Returns ​

object[]


projectiles ​

Get Signature ​

get projectiles(): number

Defined in: apps/client/src/renderer/remotes.ts:804

Rockets and grenades on screen.

Returns ​

number


pursuitCars ​

Get Signature ​

get pursuitCars(): number

Defined in: apps/client/src/renderer/remotes.ts:854

Police cars on screen with the pursuit tune (the police's faster cars at three stars), not wrecked.

Returns ​

number


roles ​

Get Signature ​

get roles(): number[]

Defined in: apps/client/src/renderer/remotes.ts:870

Pedestrians on screen by role (an index into PEDESTRIAN_ROLES: the look each is drawn with).

Returns ​

number[]


vehicles ​

Get Signature ​

get vehicles(): Record<string, number>

Defined in: apps/client/src/renderer/remotes.ts:975

The cars on screen (the player's own aside) by class name.

Returns ​

Record<string, number>


wrecks ​

Get Signature ​

get wrecks(): number

Defined in: apps/client/src/renderer/remotes.ts:829

Wrecked cars on screen.

Returns ​

number

Methods ​

carLooks() ​

carLooks(): CarLook[]

Defined in: apps/client/src/renderer/remotes.ts:888

The cars on screen as they are drawn (see CarLook).

Returns ​

CarLook[]


cars() ​

cars(): object[]

Defined in: apps/client/src/renderer/remotes.ts:1509

The cars and trailers in view: their latest snapshot and their node as drawn this frame.

Returns ​

object[]


carsPlaced() ​

carsPlaced(): object[]

Defined in: apps/client/src/renderer/remotes.ts:1499

Every other car where it is placed this frame, in view or not (its server id): the tests' reading of the far ones.

Returns ​

object[]


characterOf() ​

characterOf(client): number | undefined

Defined in: apps/client/src/renderer/remotes.ts:915

The server entity id of the character another player plays (by their client id), or undefined for none among the remotes.

Parameters ​

client ​

number

Returns ​

number | undefined


classOf() ​

classOf(eid): number | undefined

Defined in: apps/client/src/renderer/remotes.ts:969

The class (its index) of a car on screen by its server entity id, or undefined.

Parameters ​

eid ​

number

Returns ​

number | undefined


dogViews() ​

dogViews(): DogView[]

Defined in: apps/client/src/renderer/remotes.ts:786

The dogs the page has, in view or not (see DogView): each where it is drawn, as its latest snapshot tells it and as its look poses it, for window.__poc.

Returns ​

DogView[]


drawnPose() ​

drawnPose(eid, renderTick, alpha): RemoteSample | undefined

Defined in: apps/client/src/renderer/remotes.ts:679

Where a remote is drawn at a render tick, as Remotes.render draws it (a car near the player's at the predicted time); undefined for none. The camera follows the car a passenger rides in through it, on the timeline the car is drawn on.

Parameters ​

eid ​

number

renderTick ​

number

alpha ​

number

Returns ​

RemoteSample | undefined


drop() ​

drop(eid): void

Defined in: apps/client/src/renderer/remotes.ts:1414

Removes an entity at once (it became the player's own).

Parameters ​

eid ​

number

Returns ​

void


emote() ​

emote(client, emote): void

Defined in: apps/client/src/renderer/remotes.ts:1385

Plays an emote over the character of the player client (the chat's emote line).

Parameters ​

client ​

number

emote ​

string

Returns ​

void


latestOf() ​

latestOf(eid): EntitySnapshot | undefined

Defined in: apps/client/src/renderer/remotes.ts:910

The latest snapshot of a remote entity, by its server entity id.

Parameters ​

eid ​

number

Returns ​

EntitySnapshot | undefined


markers() ​

markers(modeOf): Marker[]

Defined in: apps/client/src/renderer/remotes.ts:1021

Where everything is drawn, for the minimap; modeOf names a chaser's mode by entity (empty for anyone else).

Parameters ​

modeOf ​

(eid) => string

Returns ​

Marker[]


nearestSiren() ​

nearestSiren(from): { cls: number; distance: number; } | undefined

Defined in: apps/client/src/renderer/remotes.ts:986

The nearest car on screen whose siren wails: how far from from (m) and its class; undefined with none.

Parameters ​

from ​
x ​

number

z ​

number

Returns ​

{ cls: number; distance: number; } | undefined


nodeOf() ​

nodeOf(eid): Placed | undefined

Defined in: apps/client/src/renderer/remotes.ts:904

Where a person (a server entity id) is drawn now: its node, on foot; undefined when it is not on screen or sits in a vehicle.

Parameters ​

eid ​

number

Returns ​

Placed | undefined


people() ​

people(): PersonView[]

Defined in: apps/client/src/renderer/remotes.ts:1399

The people on screen and the clip each plays (a one-shot or the base, the upper clip after a +), its role, where it stands (its capsule) and its ragdoll: its state (none, active, settled) and where its body lies (the pelvis; the capsule without one), for window.__poc.

Returns ​

PersonView[]


placed() ​

placed(): object[]

Defined in: apps/client/src/renderer/remotes.ts:1009

The cars, the people on foot and the dogs this frame (not a seated one, whom riders.ts draws): where each is placed, and whether it was in the camera's view and drawn; a dog's kind is dog.

Returns ​

object[]


push() ​

push(e, measuredAt, tier): void

Defined in: apps/client/src/renderer/remotes.ts:1134

The news of a remote entity from a snapshot frame: what it is and does now, the tier its pose comes at, and, when the frame measured its pose, a sample of it at measuredAt (the intake's, @foi/net-client's RemoteIntake). A remote the frame removed was dropped before: an id back in the same frame is made anew here.

Parameters ​

e ​

EntitySnapshot

measuredAt ​

number | undefined

tier ​

number

Returns ​

void


readings() ​

readings(me?): RemoteReading[]

Defined in: apps/client/src/renderer/remotes.ts:1461

Every remote entity as it was drawn this frame, in view or not, with how its sample was made and how far it is from me (the entity the player follows): the netcode probe's reading (window.__remotes), built when asked, never in a frame.

Parameters ​

me? ​
x ​

number

z ​

number

Returns ​

RemoteReading[]


render() ​

render(renderTick, me?, dt?, view?, wanted?, alpha?): void

Defined in: apps/client/src/renderer/remotes.ts:1525

Positions every remote entity at renderTick (each behind it by its tier's delay), dt seconds after the last frame; those in view are posed and drawn (a modelled actor through the models' batches, which the frame flushes after every actor is in). A car or a trailer that may touch what the player controls is drawn at the local time instead, where the prediction has it (predicted, alpha of the way from the last tick to the next).

Parameters ​

renderTick ​

number

me? ​
x ​

number

z ​

number

dt? ​

number = 0

view? ​

ViewRect = EVERYWHERE

wanted? ​

number = 0

alpha? ​

number = 1

Returns ​

void


rockets() ​

rockets(): object[]

Defined in: apps/client/src/renderer/remotes.ts:809

The rockets in flight on screen: where each is drawn and which way it flies (a unit vector).

Returns ​

object[]


setCones() ​

setCones(on): void

Defined in: apps/client/src/renderer/remotes.ts:1058

Shows or hides the NPCs' view cones in the scene.

Parameters ​

on ​

boolean

Returns ​

void


shooter() ​

shooter(ev): Shooter | undefined

Defined in: apps/client/src/renderer/remotes.ts:928

Who fired a shot: the character of the shot's owner (an NPC's, owner 0, holding the shot's weapon) whose latest snapshot stands nearest the shot's origin (a metre over its centre, or over its car's when seated), within 2 m of it; undefined when none does (an entity not on screen).

Parameters ​

ev ​

GameEvent

Returns ​

Shooter | undefined


vehicleOf() ​

vehicleOf(eid): DrawnVehicle | undefined

Defined in: apps/client/src/renderer/remotes.ts:1426

A vehicle drawn this frame (enabled and in view) by its server entity id, for its riders.

Parameters ​

eid ​

number

Returns ​

DrawnVehicle | undefined


worldOf() ​

worldOf(node, out): Matrix

Defined in: apps/client/src/renderer/remotes.ts:962

The world matrix of a remote's node now, into out (a shooter's, for its gun).

Parameters ​

node ​

Placed

out ​

Matrix

Returns ​

Matrix