@ferret/fmdl-import
Functions
carModelFiles function
async function carModelFiles(o: CarModelOptions): Promise<Map<string, Uint8Array>>packages/fmdl-import/src/destruction.ts:24
carNodes function
function carNodes(glb: Uint8Array): NodeInfo[]the nodes of a car glb as autoparts reads them: bounds in the car frame (x forward, y up, z across, the origin on the ground) and the place of each node's origin (a wheel's hub)
packages/fmdl-import/src/destruction.ts:11
figureModelFiles function
async function figureModelFiles(data: HumanData, spec: HumanSpec, o: FigureModelOptions): Promise<Map<string, Uint8Array>>packages/fmdl-import/src/humans.ts:17
gltfModelFiles function
function gltfModelFiles(spec: ImportSpec): Promise<Map<string, Uint8Array>>A glTF file as a model: the same call with what the importer has to be told (ferret fmdl import).
packages/fmdl-import/src/library.ts:34
libraryModelFiles function
async function libraryModelFiles(o: LibraryModelOptions): Promise<Map<string, Uint8Array>>The item's tiers become the levels (the heaviest tier first, each tier the maxTier of its level), its materials' alpha and sidedness the render side, its collision the collision shape.
packages/fmdl-import/src/library.ts:16
physicalOf function
function physicalOf: (name: string) => Record<string, number>packages/fmdl-import/src/terrain.ts:7
plantModelFiles function
async function plantModelFiles(o: PlantOptions): Promise<Map<string, Uint8Array>>A generated plant: a static body whose collision is the trunk's cylinder (measured from the mesh at its foot) over the whole height.
packages/fmdl-import/src/terrain.ts:43
rockModelFiles function
async function rockModelFiles(o: RockOptions): Promise<Map<string, Uint8Array>>A generated rock. Its mass is its volume times the density of its material: the generator's mesh is closed, so the volume is exact.
packages/fmdl-import/src/terrain.ts:21
Interfaces
CarModelOptions interface
interface CarModelOptionsid: string | |
name: string | the name of the car: its curb weight is in the table of autoparts for the two library cars |
mass?: number | kg; needed for a car the table does not know |
levels: { glb: Uint8Array; maxTier?: ModelTier }[] | the glb of each level, the best first |
summary?: string | |
materials?: Record<string, string | Record<string, number>> |
packages/fmdl-import/src/destruction.ts:15
FigureModelOptions interface
interface FigureModelOptionsid: string | |
mass: number | kg: the body spec holds the height and the age, not the weight, so the caller gives it |
tiers?: { tier: string; maxTier: ModelTier }[] | the tiers of the figure to make a level of, the best first; each is the heaviest device tier that may draw it. Default: the full tier for desktop |
glb?: GlbOptions |
packages/fmdl-import/src/humans.ts:6
LibraryModelOptions interface
interface LibraryModelOptionsitem: ModelItem | |
read: (file: string) => Uint8Array | Promise<Uint8Array> | the bytes of a file of the item's package, by its path |
mass: number | kg: the library item knows the bounds and the collision, not the weight |
materials: ImportSpec['materials'] | the physical side of each glTF material of the item, * for the rest |
summary?: string | |
kind?: string |
packages/fmdl-import/src/library.ts:7
PlantOptions interface
interface PlantOptionsid: string | |
shape: string | |
seed: number | |
variant?: number | |
height: number | the height, m |
mass: number | kg: the generator knows the shape, not what a plant of this species weighs, so the caller gives it |
packages/fmdl-import/src/terrain.ts:36
RockOptions interface
interface RockOptionsid: string | |
seed: number | |
variant?: number | |
angular?: number | 0..1: how faceted it is (fresh blocks) against rounded |
detail?: number | |
size: number | the largest dimension, m |
material?: string | the name of a physical material of the physics table; default stone |
packages/fmdl-import/src/terrain.ts:13
Constants
BODY_DENSITY const
const BODY_DENSITY: 1010The mean density of a human body, kg/m3: the physical side of every material of a person.
packages/fmdl-import/src/humans.ts:15