AutoMovie API
    Preparing search index...

    Class ArchetypeBuilder<Id, Dimension>

    What every producer assembles an archetype with: dimensioned primitives, actual convex cells or visual meshes, the affordances an act reads, and the total mass.

    A producer states named dimensions and formulas: a box by its size and centre, a rod by its radius and ends, a ball by its radius and centre, or an actual convex wall by its generating corners. Hollow forms assemble separate wall cells so rendering, mass and collision preserve their empty space. The repository keeps every model as coarse as identification allows. Parts carry unit scale, flat colours and no texture.

    build computes the centre of mass and inertia from the parts under the stated total mass (ArchetypeMass) and returns the Archetype.

    Type Parameters

    • Id extends string

      The archetype's affordance ids.

    • Dimension extends string

      The archetype's free dimensions.

    Index
    • The finished archetype.

      Parameters

      • mass: number

        The total mass, kilograms, from the producer's cited band.

      • Optionalcontact: {
            drag?: IAutoMovieBodyDrag;
            ground?: Material;
            outcome?: IAutoMovieBodyContact;
            restitution?: number;
            rests?: Material;
        }

        Resting and ground materials select their cited friction pair. An explicit restitution is admitted from 0 to 1; otherwise restitution remains unknown; a material reference never supplies a universal scalar. Drag and outcome are the launched body's optional flight data. The constructor's physical material declaration is required independently of optical colours and resting surfaces.

      Returns Archetype<Id, Dimension>

      The archetype at rest.

      As ArchetypeMass.of does when no part has mass.

      When the physical material is missing or unknown, an explicit restitution is invalid, or no source measured a declared resting pair.

    • Declare the sets of parts a hit breaks off, each a fragment; the threshold is the body's contact.fracture, given to build as outcome.

      Parameters

      • sets: readonly ISet[]

        The fragment sets, each an id, the parts it carries away and the contacts on them that move none; declared after those contacts.

      Returns this

      This builder.

      When a set's id is declared twice, a set carries no part, a set names a part not yet recorded or one a set already names (its own included), or a contact not yet declared or one a set already carries, a producer's defect.

    • A span: a taut line between two frames of the model, laid again between them after every pose (ArchetypeSpan), such as a bowstring between its limbs' tips.

      Parameters

      • id: string

        Part id of the line, unique in the archetype.

      • from: End

        One end: a part already recorded with a point in its own coordinates, or an affordance already recorded.

      • to: End

        The other end, likewise.

      • radius: number

        The line's radius, metres.

      • Optionaloptions: ArchetypeBuilderTypes.IOptions

        Colour and relative density; a rotation is ignored, because the two ends fix it.

      • Optionallength: number

        The line's rest length, metres, when it has one: the span reports itself slack whenever its ends are closer.

      Returns this

      This builder.

      When the id repeats one already used, a producer's defect.

      When an end names a part or affordance not yet recorded, or the two ends meet at rest.