Skip to Content

Sword drill

Two fencers draw from the hip and drill cuts, thrusts and guards side by side.

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 { HumanBlade, HumanChain, HumanObject, HumanPerformance, HumanSword, HumanSwordGuard, HumanSwordParry, HumanSwordThrust } from "@automovie/motions";
import * as archetypes from "@automovie/archetypes";

const swordA = archetypes.createSword({ kind: "armingSword" });
const swordAAt = { at: { x: 0, y: 0, z: 0 }, yaw: 0 };
const swordB = archetypes.createSword({ kind: "longsword" });
const swordBAt = { at: { x: 0, y: 0, z: 0 }, yaw: 0 };

// ari: body m1, at (-0.8, 0) m, facing 0°, trained
const ari = HumanChain.subject("ari")
  .act("pickUp", {
      prop: "swordA",
      handle: "grip",
      use: { tip: "point", line: "oblique" },
    })
  .registered("draw", { blade: "swordA" })
  .registered("cut", { blade: "swordA" })
  .registered("slash", { blade: "swordA" })
  .registered("thrust", { blade: "swordA" })
  .registered("stab", { blade: "swordA" })
  .registered("backslash", { blade: "swordA" })
  .registered("traverse", {})
  .registered("vomTag", { blade: "swordA", seconds: 0.6 })
  .registered("cut", { blade: "swordA" })
  .registered("backslash", { blade: "swordA" })
  .registered("retreat", {})
  .registered("alber", { blade: "swordA", seconds: 0.6 });

// ben: body f1, at (0.8, 0) m, facing 0°, trained
const ben = HumanChain.subject("ben")
  .act("pickUp", {
      prop: "swordB",
      handle: "grip",
      use: { tip: "point", line: "oblique" },
    })
  .registered("swordGuard", { blade: "swordB" })
  .registered("beat", { blade: "swordB" })
  .registered("disengage", { blade: "swordB" })
  .registered("swordCut", { blade: "swordB" })
  .registered("swordParry", { blade: "swordB" })
  .registered("swordThrust", { blade: "swordB" })
  .registered("retreat", {})
  .registered("vomTag", { blade: "swordB", seconds: 0.6 })
  .registered("cut", { blade: "swordB" })
  .registered("advance", {})
  .registered("parry", { blade: "swordB" })
  .registered("disengage", { blade: "swordB" })
  .registered("slash", { blade: "swordB" })
  .registered("retreat", {})
  .registered("alber", { blade: "swordB", seconds: 0.6 });

const scene = ari.with(ben);

// The lexicon's laws this scene's rows perform, registered with the performance.
const laws = [HumanBlade.draw, HumanBlade.cut, HumanBlade.slash, HumanBlade.thrust, HumanBlade.stab, HumanBlade.backslash, HumanBlade.traverse, HumanBlade.vomTag, HumanBlade.retreat, HumanBlade.alber, HumanSwordGuard.guard, HumanBlade.beat, HumanBlade.disengage, HumanSword.cut, HumanSwordParry.parry, HumanSwordThrust.thrust, HumanBlade.advance, HumanBlade.parry];

const props = [
  { ...HumanObject.prop("swordA", swordA, swordAAt), worn: {
    subject: "ari",
    bone: "hips",
    offset: {
      position: { x: 0.17, y: 0.05, z: 0.08 },
      rotation: { x: 1, y: 0, z: 0, w: 0 },
    },
  } },
  { ...HumanObject.prop("swordB", swordB, swordBAt), worn: {
    subject: "ben",
    bone: "hips",
    offset: {
      position: { x: 0.17, y: 0.05, z: 0.08 },
      rotation: { x: 1, y: 0, z: 0, w: 0 },
    },
  } },
];

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

const input: IAutoMovieMotionHumanPerformance.IInput = {
  seed: "sword-drill",
  performers: [
    { subject: "ari", body: bodies["m1"]!, at: { x: -0.8, y: 0, z: 0 }, yaw: 0, proficiency: { level: "trained" } },
    { subject: "ben", body: bodies["f1"]!, at: { x: 0.8, y: 0, z: 0 }, yaw: 0, proficiency: { level: "trained" } },
  ],
  composition: scene.node,
  props,
  laws,
};
const performance = new HumanPerformance(input);