nngn
Loading...
Searching...
No Matches
particles.lua File Reference

Functions

function grid init (prog, pos)
 
function grid update ()
 
function collision (prog, dt, grid, pos, vel, forces, wait)
 
function integrate (prog, dt, forces, vel, pos, wait)
 
function update (prog, grid, forces, vel, pos_v, pos, entities)
 

Variables

 camera = require "nngn.lib.camera"
 
 entity = require "nngn.lib.entity"
 
 input = require "nngn.lib.input"
 
 texture = require "nngn.lib.texture"
 
 N< const > = math.tointeger(2 ^ 12)
 
 PARTICLE_SIZE< const > = 4
 
 SIZE< const > = 512
 
 BUFFER_SIZE< const > = 4 * N
 
 TILE_SIZE< const > = 32
 
 GRID_SIZE< const > = SIZE / 2
 
 GRID_CELLS< const > = 16
 
 G< const > = 9.8 * TILE_SIZE
 
 KERNEL< const > = "collision_by_particle"
 
Compute opencl_params {version = {3, 0}})
 
 LIMITS< const > = nngn:compute():get_limits()
 
 LOCAL_SIZE< const > = LIMITS[Compute.WORK_GROUP_SIZE + 1]
 
 grid< const > = {kernel = 0}
 

Function Documentation

◆ collision()

function collision ( prog  ,
dt  ,
grid  ,
pos  ,
vel  ,
forces  ,
wait   
)
Here is the caller graph for this function:

◆ init()

function grid init ( prog  ,
pos   
)

◆ integrate()

function integrate ( prog  ,
dt  ,
forces  ,
vel  ,
pos  ,
wait   
)

◆ update() [1/2]

function grid update ( )

◆ update() [2/2]

function update ( prog  ,
grid  ,
forces  ,
vel  ,
pos_v  ,
pos  ,
entities   
)

Variable Documentation

◆ BUFFER_SIZE< const >

BUFFER_SIZE< const > = 4 * N

◆ camera

camera = require "nngn.lib.camera"

◆ entity

entity = require "nngn.lib.entity"

◆ G< const >

G< const > = 9.8 * TILE_SIZE

◆ grid< const >

grid< const > = {kernel = 0}

◆ GRID_CELLS< const >

GRID_CELLS< const > = 16

◆ GRID_SIZE< const >

GRID_SIZE< const > = SIZE / 2

◆ input

input = require "nngn.lib.input"

◆ KERNEL< const >

KERNEL< const > = "collision_by_particle"

◆ LIMITS< const >

LIMITS< const > = nngn:compute():get_limits()

◆ LOCAL_SIZE< const >

LOCAL_SIZE< const > = LIMITS[Compute.WORK_GROUP_SIZE + 1]

◆ N< const >

N< const > = math.tointeger(2 ^ 12)

◆ opencl_params

Compute opencl_params {version = {3, 0}})

◆ PARTICLE_SIZE< const >

PARTICLE_SIZE< const > = 4

◆ SIZE< const >

SIZE< const > = 512

◆ texture

texture = require "nngn.lib.texture"

◆ TILE_SIZE< const >

TILE_SIZE< const > = 32