sm.tunnelGenerator

Use to generate cell data for producing tunnels through voxels.

Functions

generate

sm.tunnelGenerator.generate(
    seed,
    min,
    max,
    pathingSettings,
    tunnelRequests,
    gridSize
)

Returns an array table of pathing results. Each element consisting of a table {positions={Vec3,...}} of position arrays.

Parameters:

Name Type Description
seed integer Simplex noise seed.
min Vec3 Grid min x (inclusive).
max Vec3 Grid max x (non inclusive).
pathingSettings table An table of available pathing settings to be used by tunnel requests. {costNoiseFrequency=number,costNoiseIntensity=number,costZPenalty=number}
tunnelRequests table An array table of tunnel requests. {{posA=Vec3, posB=Vec3(, dirA=Vec3)(, dirB=Vec3), pathingSettings=string},...}
gridSize number Size of each grid cell in world units. (Used for debug draw only.)

Returns:

Type Description
table An array table with one tunnel result per request. {{positions={Vec3,...}}, ...}