looks
What a projectile, beam, arc or puff looks like, as plain data. A look is one mesh + material + tint; everything drawn with the same look shares one entity pool in `projectileKit.render`, so drawing costs a few batched transform writes a frame however many shots are flying.
projectileKit.looks
What a projectile, beam, arc or puff looks like, as plain data. A look is one mesh +
material + tint; everything drawn with the same look shares one entity pool in
projectileKit.render, so drawing costs a few batched transform writes a frame however
many shots are flying.
Read by projectileKit.render (to build pool entities) and projectileKit.api (shots,
beams, arcs and bursts name a look). turretsKit styles pick looks by name.
Look fields
export type Look = {
mesh: string, -- cube | sphere | cylinder | octahedron | torus | cone | capsule
glow: boolean?, -- true = emissive (tracers, beams, sparks); false = lit plastic
metal: boolean?, -- true = brushed metal (shells, missiles)
color: { number }, -- { r, g, b } 0..1
size: { number }, -- { x, y, z } base scale in metres
stretch: number?, -- tracers: extra length along travel, metres per 100 m/s
cap: number?, -- most of this look drawn at once (the rest still fly, unseen)
label: string?, -- human-readable name
}
Built-in looks (M.list)
- Bullets and tracers:
tracer,tracerRed,tracerBlue,bolt,dart,pellet - Shells and balls:
shell,cannonball,stone,toyBall,plasmaBall - Missiles:
missile,firework,toyRocket - Beams (one stretched box end to end):
laserRed,laserGreen,laserBlue,arcaneBeam,rainbowBeam,beamCore,snipeTrail - Lightning arcs:
arcCyan,arcViolet,arcYellow - Puffs and particles:
flame,flameCore,frost,frostMist,poison,poisonDark,smoke,spark,confetti,bubble - Blasts and rings:
blast,blastBlue,shockRing,frostRing,poisonRing,auraRing,muzzle
Functions
get(name: string): Look?: a look by name, ornil.define(name: string, spec: any, base: string?): Look: adds or replaces a look. Missing fields come from thebaselook, then defaults (mesh = "sphere", white,size = { 0.2, 0.2, 0.2 },cap = 80).names(): { string }: every look name, sorted.
Scoped to this part · feeds back into the world's score.