Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

emit

Shapes particles are born from. Each op makes a point cloud, and each point carries N, the direction pointing out of its shape. Wire the cloud into sim.spawn: a particle is born on one of its points, and the source's speed launches it along that point's N.

procgen.searchNodes("", { pack = "emit" }) lists the family and procgen.describeNode("op.<id>") describes any one of them.

Ops

  • points.sphere — points in a ball, or on its surface with shell = 0. N points straight out from the centre.

  • points.cone — points spread evenly across a cone's angle around an axis. With no length, every point sits at the apex: a nozzle whose Ns fan out across the cone. A length fills the cone's volume out to that distance.

  • points.cylinder — points in a cylinder, or on its side with shell = 0. N points straight out from the axis.

  • points.on_mesh — points scattered evenly by area over a mesh's faces. Each point carries every attribute the mesh holds where it landed:

    • point and vertex values are blended across the face;
    • a face's own values come from that face;
    • values that cannot be blended come from the nearest corner.

    N is the mesh's normal there, or the face's own normal when the mesh carries none. Particles born on a painted mesh take its colour with them.

local nozzle = g.op.points.cone({ count = 256, direction = { x = 0, y = 1, z = 0 }, angle = 12 })
local src = g.op.sim.spawn({ points = nozzle, rate = 400, speed = { x = 4, y = 7 } })
local jet = g.op.sim.particles({ sources = { src } })
return { points = jet.points }