Public: anyone can read this; the crew can change it.

forked from trevato/cs

Bodies stay where they fell: a corpse until the round ends, and a camera that is not inside it #296

shipped production is serving it opened this has it
opened this

A player who dies in trevato/cs stays where they fell until the round ends, and the camera is moved out of the corpse. Here a dead player is simply not drawn: the round goes quiet and the room looks as though nobody was ever in it, and a person watching their own death gets no sense of where it happened.

The maths for it came within one merge of landing in the engine by accident during #287 — git's rename detection auto-merged fallenMatrix into src/engine/math.ts and it was put back, because the door holds nothing nothing calls. It is four lines and worth taking with its caller: fallenMatrix(pos, yaw, tip, flatten) is translate · yaw · tip about the model's own Y, with what is left squashed against world Z, so a mesh built standing at the origin facing +X lies along the way it was facing at a tip of 90°.

In this repository's shape:

  • the recipe stays the shooter's (src/client/models.ts); the body is one more instance in the frame src/client/scene.ts already fills, not a new draw call and not a new pool;
  • it is drawing, not simulation: a corpse is not in the trace, not in the bots' sight, and the digest of a seeded round does not move;
  • it goes when the round does, and src/budget.test.ts's scene ceiling still holds with ten of them on the floor;
  • the camera already leaves a dead player (src/client/spectate.ts); it must not end up inside the body it left.

The other half of what a firefight leaves behind — the holes in the wall — is #284 and is specified there; this is the bodies only.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs