quickGeometry.package
- ..
- README.md2.7 KB
- channels.luau7.3 KB
- flat.luau15.1 KB
- init.luau23.1 KB
- pieces.luau7.2 KB
This package holds more than this page lists. See all of its files in its world.
README.md
quickGeometry.model
The program of a quick-geometry model. It reads the object tree a build hands the Generator (objects, parents before their children, and channels, the formulas of the poses that follow the clock) and stands what the graph draws without cooking it:
- an object is
{ name, parent, pose or channel and values, components?, leaves }:parentis the number of its parent (0 for the first),poseits position, rotation quaternion and scale as ten numbers, orchannelthe number of a formula andvaluesthe constants it puts in it, and each leaf is{ shape, material, matrix }, the matrix (row-major 4x4) placing the leaf in its object; - one mesh for each distinct shape, made by array kernels (
proc.compiled), or by a graph of its own for a piece whose chain has an op with no kernel; - one material for each distinct material;
- one instanced draw for each piece and material, the leaves the rows of a transform buffer. A row is the world matrix of its object times its leaf's matrix; the world matrices are composed down the tree, and each frame only the objects that move (a channel, or a parent that has one) are placed again and only their rows are written;
- an entity for each object that carries components and stands still, at the pose its parents give it.
check(params) answers nil when the program takes the parameters, else why it does not (no tree, an object that does not follow its parent, a formula that is not stated, a component on an object that moves). run(owner, params, opts) stands a model under owner and answers the standing, or nil and the reason the program does not take the parameters. opts.previous is the standing this one replaces: what the two share is taken from it, and it is let go of afterwards. opts.yield is called between the units of work (the Generator hands the frame back there) and opts.cancelled says the run is no longer wanted, which ends it with nothing stood. tick(standing, t) places every moving row at the clock t. release(standing) lets go of the draws, the buffers, the entities, and the pieces and materials no other standing holds. A standing's stats states the objects, kernels, graphs, meshes, materials, draws, rows, entities and triangles it made and the milliseconds each took.
flat states the formulas as data (flatten, the list of operations a pose is, shared by every object whose pose has the same shape) and composes a tree into the parts and moving groups ModelGraph.procGraph draws when the program does not stand the tree (params).
Part of @builtin::systems.quickGeometry; required as @builtin::systems.quickGeometry.model.