five-on-it / apps/client/src/renderer/effects / Effects
Interface: Effects
Defined in: apps/client/src/renderer/effects.ts:195
The effects of one scene.
Properties
counts
readonlycounts:Readonly<{blasts:number;bleeds:number;dust:number;flashes:number;hits:number;landings:number;plume:number;shots:number;smoke:number;sparks:number; }>
Defined in: apps/client/src/renderer/effects.ts:244
How many shots (gunshots and swings), muzzle flashes, blasts, hits, spark bursts (on cars and walls), puffs of tyre smoke and of dust, landings, bleeds and puffs of a wreck's smoke were drawn so far.
lastBlast
readonlylastBlast:number
Defined in: apps/client/src/renderer/effects.ts:206
The reach of the last blast drawn (m; 0 before any).
marks
readonlymarks:TyreMarks
Defined in: apps/client/src/renderer/effects.ts:234
The tyre marks, laid by wheel-effects.ts.
stains
readonlystains:TyreMarks
Defined in: apps/client/src/renderer/effects.ts:236
The blood stains on the ground.
Methods
blast()
blast(
x,y,z,radius):void
Defined in: apps/client/src/renderer/effects.ts:204
A blast of radius m at a point: an explosion (explosion.ts).
Parameters
x
number
y
number
z
number
radius
number
Returns
void
bleed()
bleed(
wound):void
Defined in: apps/client/src/renderer/effects.ts:212
Blood from a person hit: a burst of mist that follows them, drops that fall, stains where they land.
Parameters
wound
Returns
void
debug()
debug():
object
Defined in: apps/client/src/renderer/effects.ts:257
What the tests read: the last gunshot, the streaks in flight, the plume's puffs and the blood's mist, drops and bursts now.
Returns
object
bursts
bursts:
BurstView[]
drops
drops:
number
last
last:
ShotView|undefined
mist
mist:
number
plume
plume:
number
streaks
streaks:
number
hit()
hit(
x,y,z,onCar):void
Defined in: apps/client/src/renderer/effects.ts:208
A hit at a point: a burst of sparks on a car (onCar); a person's blood is bleed's.
Parameters
x
number
y
number
z
number
onCar
boolean
Returns
void
landing()
landing(
x,y,z,radius,loose):void
Defined in: apps/client/src/renderer/effects.ts:228
A ring of dust (or smoke, on paved ground) radius m around a point where a car landed.
Parameters
x
number
y
number
z
number
radius
number
loose
boolean
Returns
void
puff()
puff(
x,y,z,loose,vx,vz,scale?):void
Defined in: apps/client/src/renderer/effects.ts:218
A puff from a sliding tyre on the ground at (x, y, z): dust off loose ground, tyre smoke otherwise, carried along a little by the car's velocity (vx, vz), scale times the size a car's tyre throws up (a two-wheeler's is smaller).
Parameters
x
number
y
number
z
number
loose
boolean
vx
number
vz
number
scale?
number
Returns
void
shot()
shot(
muzzle,ends,style):void
Defined in: apps/client/src/renderer/effects.ts:200
A gunshot: a muzzle flash at muzzle pointing at the first end, and a tracer streak in the weapon's style from the muzzle to each end (one per pellet of a shotgun).
Parameters
muzzle
ends
readonly Vec[]
style
Returns
void
smoke()
smoke(
x,y,z,vx,vz,thick):void
Defined in: apps/client/src/renderer/effects.ts:230
A puff of a wreck's smoke rising from (x, y, z), carried a little by the car's (vx, vz); thick (0..1) at first, thinner and greyer later.
Parameters
x
number
y
number
z
number
vx
number
vz
number
thick
number
Returns
void
sparks()
sparks(
x,y,z):void
Defined in: apps/client/src/renderer/effects.ts:210
A burst of sparks at a point: a shot that hit a wall.
Parameters
x
number
y
number
z
number
Returns
void
steam()
steam(
x,y,z):void
Defined in: apps/client/src/renderer/effects.ts:232
A puff of white steam rising from (x, y, z) (a fumarole's).
Parameters
x
number
y
number
z
number
Returns
void
swing()
swing(
origin,yaw,length,spread):void
Defined in: apps/client/src/renderer/effects.ts:202
A punch's swing: a fan of three short lines from origin along yaw, length m long, spread rad either side.
Parameters
origin
yaw
number
length
number
spread
number
Returns
void
update()
update(
dt,now):void
Defined in: apps/client/src/renderer/effects.ts:238
Ages and fades every effect by dt seconds; now is the clock the marks and stains are laid on (s).
Parameters
dt
number
now
number
Returns
void