Skip to Content

Relay

Four runners pass a mimed baton down the track, and the anchor runs it in and celebrates.

Loading the take.

Each person is a chain of typed actions from @automovie/motions. This is what an agent writes for the scene; Composing motion explains the parts.

import type { IAutoMovieMotionHumanBody, IAutoMovieMotionHumanPerformance } from "@automovie/interface";
import { HumanChain, HumanGait, HumanPartner, HumanPerformance, HumanSport, HumanSportWorkout, HumanStance } from "@automovie/motions";

// r1: body m1, at (-7, 0) m, facing 90°, trained
const r1 = HumanChain.subject("r1")
  .registered("sprintStart", { seconds: 1.3, sex: "male" })
  .registered("sprint", { to: { x: 1, y: 0, z: 0 } }, "rl-leg1")
  .over((overlay) =>
    overlay
      .registered("relayIncoming", { partner: "r2", at: 4.3 })
  )
  .registered("jog", { to: { x: 2.5, y: 0, z: -1.4 }, face: 90 })
  .registered("handsOnHips", { seconds: 1.8 })
  .act("walk", { to: { x: 6, y: 0, z: -1.4 }, face: 90 })
  .registered("fistPump", { count: 2 });

// r2: body f1, at (-6, 0.6) m, facing 90°, trained
const r2 = HumanChain.subject("r2")
  .registered("legSwings", { reps: 2 })
  .act("stand", { seconds: 1 })
  .registered("sprint", { to: { x: 2, y: 0, z: 0.6 } })
  .over((overlay) =>
    overlay
      .registered("relayOutgoing", { partner: "r1", at: 4.3 })
  )
  .sync({ of: "rl-leg1", event: "start" })
  .registered("sprint", { to: { x: 10, y: 0, z: 0.6 } }, "rl-leg2")
  .over((overlay) =>
    overlay
      .registered("relayIncoming", { partner: "r3", at: 6.5 })
  )
  .registered("jog", { to: { x: 11.5, y: 0, z: 2 }, face: 90 })
  .registered("handsOnHips", { seconds: 1.8 })
  .act("walk", { to: { x: 15.3, y: 0, z: 2 }, face: 90 });

// r3: body m2, at (3, 0) m, facing 90°, trained
const r3 = HumanChain.subject("r3")
  .registered("armCircles", { reps: 2 })
  .registered("legSwings", { reps: 1 })
  .act("stand", { seconds: 1.5 })
  .registered("sprint", { to: { x: 11, y: 0, z: 0 } })
  .over((overlay) =>
    overlay
      .registered("relayOutgoing", { partner: "r2", at: 6.5 })
  )
  .sync({ of: "rl-leg2", event: "start" })
  .registered("sprint", { to: { x: 19, y: 0, z: 0 } }, "rl-leg3")
  .over((overlay) =>
    overlay
      .registered("relayIncoming", { partner: "r4", at: 8.7 })
  )
  .registered("jog", { to: { x: 20.5, y: 0, z: -1.4 }, face: 90 })
  .registered("handsOnHips", { seconds: 1.8 })
  .act("walk", { to: { x: 21.8, y: 0, z: -1.4 }, face: 90 });

// r4: body f2, at (12, 0.6) m, facing 90°, trained
const r4 = HumanChain.subject("r4")
  .registered("armCircles", { reps: 2 })
  .registered("legSwings", { reps: 2 })
  .act("stand", { seconds: 2 })
  .registered("sprint", { to: { x: 26, y: 0, z: 0.6 } })
  .over((overlay) =>
    overlay
      .registered("relayOutgoing", { partner: "r3", at: 8.7 })
  )
  .sync({ of: "rl-leg3", event: "start" })
  .registered("fistPump", { count: 2 })
  .registered("victory", {});

const scene = r1.with(r2, r3, r4);

// The lexicon's laws this scene's rows perform, registered with the performance.
const laws = [HumanSport.sprintStart, HumanGait.sprint, HumanPartner.relayIncoming, HumanGait.jog, HumanStance.handsOnHips, HumanStance.fistPump, HumanSportWorkout.legSwings, HumanPartner.relayOutgoing, HumanSportWorkout.armCircles, HumanStance.victory];

// Each body id's motion body, prepared from the site's measures.
declare const bodies: Record<string, IAutoMovieMotionHumanBody>;

const input: IAutoMovieMotionHumanPerformance.IInput = {
  seed: "relay",
  performers: [
    { subject: "r1", body: bodies["m1"]!, at: { x: -7, y: 0, z: 0 }, yaw: 90, proficiency: { level: "trained" } },
    { subject: "r2", body: bodies["f1"]!, at: { x: -6, y: 0, z: 0.6 }, yaw: 90, proficiency: { level: "trained" } },
    { subject: "r3", body: bodies["m2"]!, at: { x: 3, y: 0, z: 0 }, yaw: 90, proficiency: { level: "trained" } },
    { subject: "r4", body: bodies["f2"]!, at: { x: 12, y: 0, z: 0.6 }, yaw: 90, proficiency: { level: "trained" } },
  ],
  composition: scene.node,
  laws,
};
const performance = new HumanPerformance(input);