Skip to Content

Café

Two friends sit down at the ends of a table and each lifts a mug, sips and sets it down; one nods and lays a hand on her heart, the other checks a phone; a third walks round the table, clasps his hands and waves them over.

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, HumanEmblem, HumanGait, HumanHabit, HumanObject, HumanPerformance, HumanSocial, HumanStance } from "@automovie/motions";
import * as archetypes from "@automovie/archetypes";

const table = archetypes.createTable({ kind: "dining" });
const tableAt = { at: { x: 0, y: 0, z: 1.5 }, yaw: 0 };
const chairA = archetypes.createSeat({ kind: "dining" });
const chairAAt = { at: { x: -0.9, y: 0, z: 1.5 }, yaw: 90 };
const chairB = archetypes.createSeat({ kind: "dining" });
const chairBAt = { at: { x: 0.9, y: 0, z: 1.5 }, yaw: 270 };
const mugA = archetypes.createDrinkware({ kind: "mug" });
const mugAAt = { at: { x: -0.45, y: 0.736, z: 1.5 }, yaw: 180 };
const mugB = archetypes.createDrinkware({ kind: "mug" });
const mugBAt = { at: { x: 0.45, y: 0.736, z: 1.5 }, yaw: 0 };

// ana: body f1, at (-0.66, 1.5) m, facing 90°, trained
const ana = HumanChain.subject("ana")
  .act("sit", { seat: HumanObject.seat(chairA, chairAAt), seconds: 1 })
  .act("pickUp", { prop: "mugA", handle: "handle" })
  .registered("toastSip", { prop: "mugA" })
  .act("putDown", { prop: "mugA", at: { x: -0.45, y: 0.736, z: 1.62 } })
  .act("gesture", { kind: "nod" })
  .registered("handOnHeart", {});

// ben: body m1, at (0.66, 1.5) m, facing 270°, trained
const ben = HumanChain.subject("ben")
  .act("sit", { seat: HumanObject.seat(chairB, chairBAt), seconds: 1 })
  .registered("checkPhone", { seconds: 2 })
  .act("pickUp", { prop: "mugB", handle: "handle" })
  .registered("toastSip", { prop: "mugB" })
  .act("putDown", { prop: "mugB", at: { x: 0.45, y: 0.736, z: 1.38 } });

// cal: body m2, at (3, -1) m, facing 0°, trained
const cal = HumanChain.subject("cal")
  .registered("stroll", {
      to: { x: 0.6, y: 0, z: 2.6 },
      via: [{ x: 2.2, y: 0, z: 2.6 }],
    })
  .registered("handsClasped", {})
  .registered("comeHere", {});

const scene = ana.with(ben, cal);

// The lexicon's laws this scene's rows perform, registered with the performance.
const laws = [HumanSocial.toastSip, HumanEmblem.handOnHeart, HumanHabit.checkPhone, HumanGait.stroll, HumanStance.handsClasped, HumanEmblem.comeHere];

const props = [
  HumanObject.prop("table", table, tableAt),
  HumanObject.prop("chairA", chairA, chairAAt),
  HumanObject.prop("chairB", chairB, chairBAt),
  HumanObject.prop("mugA", mugA, mugAAt),
  HumanObject.prop("mugB", mugB, mugBAt),
];

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

const input: IAutoMovieMotionHumanPerformance.IInput = {
  seed: "cafe",
  performers: [
    { subject: "ana", body: bodies["f1"]!, at: { x: -0.66, y: 0, z: 1.5 }, yaw: 90, proficiency: { level: "trained" } },
    { subject: "ben", body: bodies["m1"]!, at: { x: 0.66, y: 0, z: 1.5 }, yaw: 270, proficiency: { level: "trained" } },
    { subject: "cal", body: bodies["m2"]!, at: { x: 3, y: 0, z: -1 }, yaw: 0, proficiency: { level: "trained" } },
  ],
  composition: scene.node,
  props,
  laws,
};
const performance = new HumanPerformance(input);