Skip to Content

Boxing class

A coach and three members drill against each other: the coach throws a jab and a cross, comes back to guard and front-kicks; the members throw a jab, a cross, a lead hook, an uppercut and a round kick; then the whole class finishes together with jumping jacks and high knees.

The packages refuse this scene today, in their own words on the view below. #3528 fixes it.

Computing 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, HumanDrill, HumanPerformance, HumanStrike } from "@automovie/motions";

// coa: body m2, at (0, 1) m, facing 180°, trained
const coa = HumanChain.subject("coa")
  .registered("jab", { at: { kind: "person", subject: "m2", region: "face" } })
  .registered("cross", { at: { kind: "person", subject: "m2", region: "face" } })
  .act("guard", {})
  .registered("frontKick", { at: { kind: "person", subject: "m2", region: "abdomen" } })
  .act("guard", { seconds: 0.3 })
  .act("exercise", { kind: "jumpingJack", reps: 4, tempo: [0.5, 0, 0.5] })
  .act("exercise", { kind: "highKnees", reps: 4, tempo: [0.6, 0, 0.6] });

// m1: body f1, at (-0.6427876096865393, 0.233955556881022) m, facing 40°, trained
const m1 = HumanChain.subject("m1")
  .registered("jab", { at: { kind: "person", subject: "coa", region: "face" } })
  .registered("cross", { at: { kind: "person", subject: "coa", region: "face" } })
  .registered("hook", {
      at: { kind: "person", subject: "coa", region: "jawRight" },
    })
  .registered("uppercut", { at: { kind: "person", subject: "coa", region: "chin" } })
  .registered("roundKick", {
      at: { kind: "person", subject: "coa", region: "ribsLeft" },
    })
  .act("exercise", { kind: "jumpingJack", reps: 4, tempo: [0.5, 0, 0.5] })
  .act("exercise", { kind: "highKnees", reps: 4, tempo: [0.6, 0, 0.6] });

// m2: body m1, at (0, 0) m, facing 0°, trained
const m2 = HumanChain.subject("m2")
  .registered("jab", { at: { kind: "person", subject: "coa", region: "face" } })
  .registered("cross", { at: { kind: "person", subject: "coa", region: "face" } })
  .registered("hook", {
      at: { kind: "person", subject: "coa", region: "jawRight" },
    })
  .registered("uppercut", { at: { kind: "person", subject: "coa", region: "chin" } })
  .registered("roundKick", {
      at: { kind: "person", subject: "coa", region: "ribsLeft" },
    })
  .act("exercise", { kind: "jumpingJack", reps: 4, tempo: [0.5, 0, 0.5] })
  .act("exercise", { kind: "highKnees", reps: 4, tempo: [0.6, 0, 0.6] });

// m3: body f2, at (0.6427876096865393, 0.233955556881022) m, facing -40°, trained
const m3 = HumanChain.subject("m3")
  .registered("jab", { at: { kind: "person", subject: "coa", region: "face" } })
  .registered("cross", { at: { kind: "person", subject: "coa", region: "face" } })
  .registered("hook", {
      at: { kind: "person", subject: "coa", region: "jawRight" },
    })
  .registered("uppercut", { at: { kind: "person", subject: "coa", region: "chin" } })
  .registered("roundKick", {
      at: { kind: "person", subject: "coa", region: "ribsLeft" },
    })
  .act("exercise", { kind: "jumpingJack", reps: 4, tempo: [0.5, 0, 0.5] })
  .act("exercise", { kind: "highKnees", reps: 4, tempo: [0.6, 0, 0.6] });

const scene = coa.with(m1, m2, m3);

// The lexicon's laws this scene's rows perform, registered with the performance.
const laws = [HumanStrike.jab, HumanStrike.cross, HumanDrill.frontKick, HumanDrill.hook, HumanDrill.uppercut, HumanStrike.roundKick];

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

const input: IAutoMovieMotionHumanPerformance.IInput = {
  seed: "boxing",
  performers: [
    { subject: "coa", body: bodies["m2"]!, at: { x: 0, y: 0, z: 1 }, yaw: 180, proficiency: { level: "trained" } },
    { subject: "m1", body: bodies["f1"]!, at: { x: -0.6427876096865393, y: 0, z: 0.233955556881022 }, yaw: 40, proficiency: { level: "trained" } },
    { subject: "m2", body: bodies["m1"]!, at: { x: 0, y: 0, z: 0 }, yaw: 0, proficiency: { level: "trained" } },
    { subject: "m3", body: bodies["f2"]!, at: { x: 0.6427876096865393, y: 0, z: 0.233955556881022 }, yaw: -40, proficiency: { level: "trained" } },
  ],
  composition: scene.node,
  laws,
};
const performance = new HumanPerformance(input);